<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">window.Laya = (function (t) {
  "use strict";
  class e {}
  (e.animationInterval = 50),
    (e.isAntialias = !0),
    (e.isAlpha = !1),
    (e.premultipliedAlpha = !0),
    (e.isStencil = !0),
    (e.preserveDrawingBuffer = !1),
    (e.webGL2D_MeshAllocMaxMem = !0),
    (e.is2DPixelArtGame = !1),
    (e.useWebGL2 = !0),
    (e.printWebglOrder = !1),
    (e.allowGPUInstanceDynamicBatch = !0),
    (e.enableStaticBatch = !0),
    (e.useRetinalCanvas = !1),
    (window.Config = e);
  class i {
    static regClass(t) {
      i.__classMap[t.name] = t;
    }
  }
  (i.Laya = null),
    (i.Timer = null),
    (i.WorkerLoader = null),
    (i.Dragging = null),
    (i.GraphicsBounds = null),
    (i.Sprite = null),
    (i.TextRender = null),
    (i.TextAtlas = null),
    (i.timer = null),
    (i.systemTimer = null),
    (i.startTimer = null),
    (i.updateTimer = null),
    (i.lateTimer = null),
    (i.physicsTimer = null),
    (i.stage = null),
    (i.Loader = null),
    (i.loader = null),
    (i.TTFLoader = null),
    (i.SoundManager = null),
    (i.WebAudioSound = null),
    (i.AudioSound = null),
    (i.ShaderCompile = null),
    (i.ClassUtils = null),
    (i.SceneUtils = null),
    (i.Context = null),
    (i.Render = null),
    (i.MouseManager = null),
    (i.Text = null),
    (i.Browser = null),
    (i.WebGL = null),
    (i.Pool = null),
    (i.Utils = null),
    (i.Graphics = null),
    (i.Submit = null),
    (i.Stage = null),
    (i.Resource = null),
    (i.__classMap = {});
  class s {
    static getPoolBySign(t) {
      return s._poolDic[t] || (s._poolDic[t] = []);
    }
    static clearBySign(t) {
      s._poolDic[t] &amp;&amp; (s._poolDic[t].length = 0);
    }
    static recover(t, e) {
      e[s.POOLSIGN] || ((e[s.POOLSIGN] = !0), s.getPoolBySign(t).push(e));
    }
    static recoverByClass(t) {
      if (t) {
        var e = t.__className || t.constructor._$gid;
        e &amp;&amp; s.recover(e, t);
      }
    }
    static _getClassSign(t) {
      var e = t.__className || t._$gid;
      return e || ((t._$gid = e = s._CLSID + ""), s._CLSID++), e;
    }
    static createByClass(t) {
      return s.getItemByClass(s._getClassSign(t), t);
    }
    static getItemByClass(t, e) {
      if (!s._poolDic[t]) return new e();
      var i = s.getPoolBySign(t);
      if (i.length) {
        var r = i.pop();
        r[s.POOLSIGN] = !1;
      } else r = new e();
      return r;
    }
    static getItemByCreateFun(t, e, i = null) {
      var r = s.getPoolBySign(t),
        a = r.length ? r.pop() : e.call(i);
      return (a[s.POOLSIGN] = !1), a;
    }
    static getItem(t) {
      var e = s.getPoolBySign(t),
        i = e.length ? e.pop() : null;
      return i &amp;&amp; (i[s.POOLSIGN] = !1), i;
    }
  }
  (s._CLSID = 0), (s.POOLSIGN = "__InPool"), (s._poolDic = {});
  class r {
    static create(t) {
      var e = s.getItemByClass("AlphaCmd", r);
      return (e.alpha = t), e;
    }
    recover() {
      s.recover("AlphaCmd", this);
    }
    run(t, e, i) {
      t.alpha(this.alpha);
    }
    get cmdID() {
      return r.ID;
    }
  }
  r.ID = "Alpha";
  class a {
    static create(t, e, i, r, n, h, o) {
      var l = s.getItemByClass("DrawCircleCmd", a);
      return (
        (l.x = t),
        (l.y = e),
        (l.radius = i),
        (l.fillColor = r),
        (l.lineColor = n),
        (l.lineWidth = h),
        (l.vid = o),
        l
      );
    }
    recover() {
      (this.fillColor = null),
        (this.lineColor = null),
        s.recover("DrawCircleCmd", this);
    }
    run(t, e, i) {
      t._drawCircle(
        this.x + e,
        this.y + i,
        this.radius,
        this.fillColor,
        this.lineColor,
        this.lineWidth,
        this.vid,
      );
    }
    get cmdID() {
      return a.ID;
    }
  }
  a.ID = "DrawCircle";
  class n {
    static create(t, e, i, r, a) {
      var h = s.getItemByClass("DrawCurvesCmd", n);
      return (
        (h.x = t),
        (h.y = e),
        (h.points = i),
        (h.lineColor = r),
        (h.lineWidth = a),
        h
      );
    }
    recover() {
      (this.points = null),
        (this.lineColor = null),
        s.recover("DrawCurvesCmd", this);
    }
    run(t, e, i) {
      this.points &amp;&amp;
        t.drawCurves(
          this.x + e,
          this.y + i,
          this.points,
          this.lineColor,
          this.lineWidth,
        );
    }
    get cmdID() {
      return n.ID;
    }
  }
  n.ID = "DrawCurves";
  class h {
    static create(t, e, i, r, a) {
      var n = s.getItemByClass("DrawImageCmd", h);
      return (
        (n.texture = t),
        t._addReference(),
        (n.x = e),
        (n.y = i),
        (n.width = r),
        (n.height = a),
        n
      );
    }
    recover() {
      this.texture &amp;&amp; this.texture._removeReference(),
        (this.texture = null),
        s.recover("DrawImageCmd", this);
    }
    run(t, e, i) {
      this.texture &amp;&amp;
        t.drawTexture(
          this.texture,
          this.x + e,
          this.y + i,
          this.width,
          this.height,
        );
    }
    get cmdID() {
      return h.ID;
    }
  }
  h.ID = "DrawImage";
  class o {
    static create(t, e, i, r, a, n, h) {
      var l = s.getItemByClass("DrawLineCmd", o);
      return (
        (l.fromX = t),
        (l.fromY = e),
        (l.toX = i),
        (l.toY = r),
        (l.lineColor = a),
        (l.lineWidth = n),
        (l.vid = h),
        l
      );
    }
    recover() {
      s.recover("DrawLineCmd", this);
    }
    run(t, e, i) {
      t._drawLine(
        e,
        i,
        this.fromX,
        this.fromY,
        this.toX,
        this.toY,
        this.lineColor,
        this.lineWidth,
        this.vid,
      );
    }
    get cmdID() {
      return o.ID;
    }
  }
  o.ID = "DrawLine";
  class l {
    static create(t, e, i, r, a, n) {
      var h = s.getItemByClass("DrawLinesCmd", l);
      return (
        (h.x = t),
        (h.y = e),
        (h.points = i),
        (h.lineColor = r),
        (h.lineWidth = a),
        (h.vid = n),
        h
      );
    }
    recover() {
      (this.points = null),
        (this.lineColor = null),
        s.recover("DrawLinesCmd", this);
    }
    run(t, e, i) {
      this.points &amp;&amp;
        t._drawLines(
          this.x + e,
          this.y + i,
          this.points,
          this.lineColor,
          this.lineWidth,
          this.vid,
        );
    }
    get cmdID() {
      return l.ID;
    }
  }
  l.ID = "DrawLines";
  class _ {
    static create(t, e, i, r, a) {
      var n = s.getItemByClass("DrawPathCmd", _);
      return (n.x = t), (n.y = e), (n.paths = i), (n.brush = r), (n.pen = a), n;
    }
    recover() {
      (this.paths = null),
        (this.brush = null),
        (this.pen = null),
        s.recover("DrawPathCmd", this);
    }
    run(t, e, i) {
      this.paths &amp;&amp;
        t._drawPath(this.x + e, this.y + i, this.paths, this.brush, this.pen);
    }
    get cmdID() {
      return _.ID;
    }
  }
  _.ID = "DrawPath";
  class u {
    static create(t, e, i, r, a, n, h, o, l) {
      var _ = s.getItemByClass("DrawPieCmd", u);
      return (
        (_.x = t),
        (_.y = e),
        (_.radius = i),
        (_._startAngle = r),
        (_._endAngle = a),
        (_.fillColor = n),
        (_.lineColor = h),
        (_.lineWidth = o),
        (_.vid = l),
        _
      );
    }
    recover() {
      (this.fillColor = null),
        (this.lineColor = null),
        s.recover("DrawPieCmd", this);
    }
    run(t, e, i) {
      t._drawPie(
        this.x + e,
        this.y + i,
        this.radius,
        this._startAngle,
        this._endAngle,
        this.fillColor,
        this.lineColor,
        this.lineWidth,
        this.vid,
      );
    }
    get cmdID() {
      return u.ID;
    }
    get startAngle() {
      return (180 * this._startAngle) / Math.PI;
    }
    set startAngle(t) {
      this._startAngle = (t * Math.PI) / 180;
    }
    get endAngle() {
      return (180 * this._endAngle) / Math.PI;
    }
    set endAngle(t) {
      this._endAngle = (t * Math.PI) / 180;
    }
  }
  u.ID = "DrawPie";
  class c {
    static create(t, e, i, r, a, n, h, o) {
      var l = s.getItemByClass("DrawPolyCmd", c);
      return (
        (l.x = t),
        (l.y = e),
        (l.points = i),
        (l.fillColor = r),
        (l.lineColor = a),
        (l.lineWidth = n),
        (l.isConvexPolygon = h),
        (l.vid = o),
        l
      );
    }
    recover() {
      (this.points = null),
        (this.fillColor = null),
        (this.lineColor = null),
        s.recover("DrawPolyCmd", this);
    }
    run(t, e, i) {
      this.points &amp;&amp;
        t._drawPoly(
          this.x + e,
          this.y + i,
          this.points,
          this.fillColor,
          this.lineColor,
          this.lineWidth,
          this.isConvexPolygon,
          this.vid,
        );
    }
    get cmdID() {
      return c.ID;
    }
  }
  c.ID = "DrawPoly";
  class d {
    static create(t, e, i, r, a, n, h) {
      var o = s.getItemByClass("DrawRectCmd", d);
      return (
        (o.x = t),
        (o.y = e),
        (o.width = i),
        (o.height = r),
        (o.fillColor = a),
        (o.lineColor = n),
        (o.lineWidth = h),
        o
      );
    }
    recover() {
      (this.fillColor = null),
        (this.lineColor = null),
        s.recover("DrawRectCmd", this);
    }
    run(t, e, i) {
      t.drawRect(
        this.x + e,
        this.y + i,
        this.width,
        this.height,
        this.fillColor,
        this.lineColor,
        this.lineWidth,
      );
    }
    get cmdID() {
      return d.ID;
    }
  }
  d.ID = "DrawRect";
  class p {
    constructor(t = 1, e = 0, i = 0, s = 1, r = 0, a = 0, n = 0) {
      if (((this._bTransform = !1), null != p._createFun))
        return p._createFun(t, e, i, s, r, a, n);
      (this.a = t),
        (this.b = e),
        (this.c = i),
        (this.d = s),
        (this.tx = r),
        (this.ty = a),
        this._checkTransform();
    }
    identity() {
      return (
        (this.a = this.d = 1),
        (this.b = this.tx = this.ty = this.c = 0),
        (this._bTransform = !1),
        this
      );
    }
    _checkTransform() {
      return (this._bTransform =
        1 !== this.a || 0 !== this.b || 0 !== this.c || 1 !== this.d);
    }
    setTranslate(t, e) {
      return (this.tx = t), (this.ty = e), this;
    }
    translate(t, e) {
      return (this.tx += t), (this.ty += e), this;
    }
    scale(t, e) {
      return (
        (this.a *= t),
        (this.d *= e),
        (this.c *= t),
        (this.b *= e),
        (this.tx *= t),
        (this.ty *= e),
        (this._bTransform = !0),
        this
      );
    }
    rotate(t) {
      var e = Math.cos(t),
        i = Math.sin(t),
        s = this.a,
        r = this.c,
        a = this.tx;
      return (
        (this.a = s * e - this.b * i),
        (this.b = s * i + this.b * e),
        (this.c = r * e - this.d * i),
        (this.d = r * i + this.d * e),
        (this.tx = a * e - this.ty * i),
        (this.ty = a * i + this.ty * e),
        (this._bTransform = !0),
        this
      );
    }
    skew(t, e) {
      var i = Math.tan(t),
        s = Math.tan(e),
        r = this.a,
        a = this.b;
      return (
        (this.a += s * this.c),
        (this.b += s * this.d),
        (this.c += i * r),
        (this.d += i * a),
        this
      );
    }
    invertTransformPoint(t) {
      var e = this.a,
        i = this.b,
        s = this.c,
        r = this.d,
        a = this.tx,
        n = e * r - i * s,
        h = r / n,
        o = -i / n,
        l = -s / n,
        _ = e / n,
        u = (s * this.ty - r * a) / n,
        c = -(e * this.ty - i * a) / n;
      return t.setTo(h * t.x + l * t.y + u, o * t.x + _ * t.y + c);
    }
    transformPoint(t) {
      return t.setTo(
        this.a * t.x + this.c * t.y + this.tx,
        this.b * t.x + this.d * t.y + this.ty,
      );
    }
    transformPointN(t) {
      return t.setTo(this.a * t.x + this.c * t.y, this.b * t.x + this.d * t.y);
    }
    getScaleX() {
      return 0 === this.b
        ? this.a
        : Math.sqrt(this.a * this.a + this.b * this.b);
    }
    getScaleY() {
      return 0 === this.c
        ? this.d
        : Math.sqrt(this.c * this.c + this.d * this.d);
    }
    invert() {
      var t = this.a,
        e = this.b,
        i = this.c,
        s = this.d,
        r = this.tx,
        a = t * s - e * i;
      return (
        (this.a = s / a),
        (this.b = -e / a),
        (this.c = -i / a),
        (this.d = t / a),
        (this.tx = (i * this.ty - s * r) / a),
        (this.ty = -(t * this.ty - e * r) / a),
        this
      );
    }
    setTo(t, e, i, s, r, a) {
      return (
        (this.a = t),
        (this.b = e),
        (this.c = i),
        (this.d = s),
        (this.tx = r),
        (this.ty = a),
        this
      );
    }
    concat(t) {
      var e = this.a,
        i = this.c,
        s = this.tx;
      return (
        (this.a = e * t.a + this.b * t.c),
        (this.b = e * t.b + this.b * t.d),
        (this.c = i * t.a + this.d * t.c),
        (this.d = i * t.b + this.d * t.d),
        (this.tx = s * t.a + this.ty * t.c + t.tx),
        (this.ty = s * t.b + this.ty * t.d + t.ty),
        this
      );
    }
    static mul(t, e, i) {
      var s = t.a,
        r = t.b,
        a = t.c,
        n = t.d,
        h = t.tx,
        o = t.ty,
        l = e.a,
        _ = e.b,
        u = e.c,
        c = e.d,
        d = e.tx,
        p = e.ty;
      return (
        0 !== _ || 0 !== u
          ? ((i.a = s * l + r * u),
            (i.b = s * _ + r * c),
            (i.c = a * l + n * u),
            (i.d = a * _ + n * c),
            (i.tx = l * h + u * o + d),
            (i.ty = _ * h + c * o + p))
          : ((i.a = s * l),
            (i.b = r * c),
            (i.c = a * l),
            (i.d = n * c),
            (i.tx = l * h + d),
            (i.ty = c * o + p)),
        i
      );
    }
    static mul16(t, e, i) {
      var s = t.a,
        r = t.b,
        a = t.c,
        n = t.d,
        h = t.tx,
        o = t.ty,
        l = e.a,
        _ = e.b,
        u = e.c,
        c = e.d,
        d = e.tx,
        p = e.ty;
      return (
        0 !== _ || 0 !== u
          ? ((i[0] = s * l + r * u),
            (i[1] = s * _ + r * c),
            (i[4] = a * l + n * u),
            (i[5] = a * _ + n * c),
            (i[12] = l * h + u * o + d),
            (i[13] = _ * h + c * o + p))
          : ((i[0] = s * l),
            (i[1] = r * c),
            (i[4] = a * l),
            (i[5] = n * c),
            (i[12] = l * h + d),
            (i[13] = c * o + p)),
        i
      );
    }
    scaleEx(t, e) {
      var i = this.a,
        s = this.b,
        r = this.c,
        a = this.d;
      0 !== s || 0 !== r
        ? ((this.a = t * i),
          (this.b = t * s),
          (this.c = e * r),
          (this.d = e * a))
        : ((this.a = t * i),
          (this.b = 0 * a),
          (this.c = 0 * i),
          (this.d = e * a)),
        (this._bTransform = !0);
    }
    rotateEx(t) {
      var e = Math.cos(t),
        i = Math.sin(t),
        s = this.a,
        r = this.b,
        a = this.c,
        n = this.d;
      0 !== r || 0 !== a
        ? ((this.a = e * s + i * a),
          (this.b = e * r + i * n),
          (this.c = -i * s + e * a),
          (this.d = -i * r + e * n))
        : ((this.a = e * s),
          (this.b = i * n),
          (this.c = -i * s),
          (this.d = e * n)),
        (this._bTransform = !0);
    }
    clone() {
      var t = p.create();
      return (
        (t.a = this.a),
        (t.b = this.b),
        (t.c = this.c),
        (t.d = this.d),
        (t.tx = this.tx),
        (t.ty = this.ty),
        (t._bTransform = this._bTransform),
        t
      );
    }
    copyTo(t) {
      return (
        (t.a = this.a),
        (t.b = this.b),
        (t.c = this.c),
        (t.d = this.d),
        (t.tx = this.tx),
        (t.ty = this.ty),
        (t._bTransform = this._bTransform),
        t
      );
    }
    toString() {
      return (
        this.a +
        "," +
        this.b +
        "," +
        this.c +
        "," +
        this.d +
        "," +
        this.tx +
        "," +
        this.ty
      );
    }
    destroy() {
      this.recover();
    }
    recover() {
      s.recover("Matrix", this.identity());
    }
    static create() {
      return s.getItemByClass("Matrix", p);
    }
  }
  (p.EMPTY = new p()), (p.TEMP = new p()), (p._createFun = null);
  class f {
    constructor(t = 0, e = 0) {
      (this.x = t), (this.y = e);
    }
    static create() {
      return s.getItemByClass("Point", f);
    }
    setTo(t, e) {
      return (this.x = t), (this.y = e), this;
    }
    reset() {
      return (this.x = this.y = 0), this;
    }
    recover() {
      s.recover("Point", this.reset());
    }
    distance(t, e) {
      return Math.sqrt(
        (this.x - t) * (this.x - t) + (this.y - e) * (this.y - e),
      );
    }
    toString() {
      return this.x + "," + this.y;
    }
    normalize() {
      var t = Math.sqrt(this.x * this.x + this.y * this.y);
      if (t &gt; 0) {
        var e = 1 / t;
        (this.x *= e), (this.y *= e);
      }
    }
    copy(t) {
      return this.setTo(t.x, t.y);
    }
  }
  (f.TEMP = new f()), (f.EMPTY = new f());
  class m {
    constructor(t = 0, e = 0, i = 0, s = 0) {
      (this.x = t), (this.y = e), (this.width = i), (this.height = s);
    }
    get right() {
      return this.x + this.width;
    }
    get bottom() {
      return this.y + this.height;
    }
    setTo(t, e, i, s) {
      return (
        (this.x = t), (this.y = e), (this.width = i), (this.height = s), this
      );
    }
    reset() {
      return (this.x = this.y = this.width = this.height = 0), this;
    }
    recover() {
      this != m.TEMP &amp;&amp; this != m.EMPTY
        ? s.recover("Rectangle", this.reset())
        : console.log("recover Temp or Empty:", this);
    }
    static create() {
      return s.getItemByClass("Rectangle", m);
    }
    copyFrom(t) {
      return (
        (this.x = t.x),
        (this.y = t.y),
        (this.width = t.width),
        (this.height = t.height),
        this
      );
    }
    contains(t, e) {
      return (
        !(this.width &lt;= 0 || this.height &lt;= 0) &amp;&amp;
        t &gt;= this.x &amp;&amp;
        t &lt; this.right &amp;&amp;
        e &gt;= this.y &amp;&amp;
        e &lt; this.bottom
      );
    }
    intersects(t) {
      return !(
        t.x &gt; this.x + this.width ||
        t.x + t.width &lt; this.x ||
        t.y &gt; this.y + this.height ||
        t.y + t.height &lt; this.y
      );
    }
    intersection(t, e = null) {
      return this.intersects(t)
        ? (e || (e = new m()),
          (e.x = Math.max(this.x, t.x)),
          (e.y = Math.max(this.y, t.y)),
          (e.width = Math.min(this.right, t.right) - e.x),
          (e.height = Math.min(this.bottom, t.bottom) - e.y),
          e)
        : null;
    }
    union(t, e = null) {
      return (
        e || (e = new m()),
        this.clone(e),
        t.width &lt;= 0 || t.height &lt;= 0
          ? e
          : (e.addPoint(t.x, t.y), e.addPoint(t.right, t.bottom), this)
      );
    }
    clone(t = null) {
      return (
        t || (t = new m()),
        (t.x = this.x),
        (t.y = this.y),
        (t.width = this.width),
        (t.height = this.height),
        t
      );
    }
    toString() {
      return this.x + "," + this.y + "," + this.width + "," + this.height;
    }
    equals(t) {
      return !(
        !t ||
        t.x !== this.x ||
        t.y !== this.y ||
        t.width !== this.width ||
        t.height !== this.height
      );
    }
    addPoint(t, e) {
      return (
        this.x &gt; t &amp;&amp; ((this.width += this.x - t), (this.x = t)),
        this.y &gt; e &amp;&amp; ((this.height += this.y - e), (this.y = e)),
        this.width &lt; t - this.x &amp;&amp; (this.width = t - this.x),
        this.height &lt; e - this.y &amp;&amp; (this.height = e - this.y),
        this
      );
    }
    _getBoundPoints() {
      var t = m._temB;
      return (
        (t.length = 0),
        0 == this.width || 0 == this.height
          ? t
          : (t.push(
              this.x,
              this.y,
              this.x + this.width,
              this.y,
              this.x,
              this.y + this.height,
              this.x + this.width,
              this.y + this.height,
            ),
            t)
      );
    }
    static _getBoundPointS(t, e, i, s) {
      var r = m._temA;
      return (
        (r.length = 0),
        0 == i || 0 == s
          ? r
          : (r.push(t, e, t + i, e, t, e + s, t + i, e + s), r)
      );
    }
    static _getWrapRec(t, e = null) {
      if (!t || t.length &lt; 1)
        return e ? e.setTo(0, 0, 0, 0) : m.TEMP.setTo(0, 0, 0, 0);
      e = e || m.create();
      var i,
        s,
        r,
        a,
        n,
        h = t.length,
        o = f.TEMP;
      for (r = n = -(s = a = 99999), i = 0; i &lt; h; i += 2)
        (o.x = t[i]),
          (o.y = t[i + 1]),
          (s = s &lt; o.x ? s : o.x),
          (a = a &lt; o.y ? a : o.y),
          (r = r &gt; o.x ? r : o.x),
          (n = n &gt; o.y ? n : o.y);
      return e.setTo(s, a, r - s, n - a);
    }
    isEmpty() {
      return this.width &lt;= 0 || this.height &lt;= 0;
    }
  }
  (m.EMPTY = new m()), (m.TEMP = new m()), (m._temB = []), (m._temA = []);
  class g {}
  (g.ARRAY_BUFFER_TYPE_DATA = 0),
    (g.ARRAY_BUFFER_TYPE_CMD = 1),
    (g.ARRAY_BUFFER_REF_REFERENCE = 0),
    (g.ARRAY_BUFFER_REF_COPY = 1),
    (g.UPLOAD_SHADER_UNIFORM_TYPE_ID = 0),
    (g.UPLOAD_SHADER_UNIFORM_TYPE_DATA = 1);
  var T,
    v,
    x,
    y,
    E,
    R,
    C = 1,
    A = 0;
  class b {
    static __init__() {
      var t = g.instance;
      (b._depthFunc = t.LESS),
        (b._blendEquation = t.FUNC_ADD),
        (b._blendEquationRGB = t.FUNC_ADD),
        (b._blendEquationAlpha = t.FUNC_ADD),
        (C = t.ONE),
        (A = t.ZERO),
        (b._sFactorAlpha = t.ONE),
        (b._dFactorAlpha = t.ZERO),
        (b._activedTextureID = t.TEXTURE0);
      var e = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS);
      (b._activeTextures = new Array(e)),
        (b._glTextureIDs = [
          t.TEXTURE0,
          t.TEXTURE1,
          t.TEXTURE2,
          t.TEXTURE3,
          t.TEXTURE4,
          t.TEXTURE5,
          t.TEXTURE6,
          t.TEXTURE7,
          t.TEXTURE8,
          t.TEXTURE9,
          t.TEXTURE10,
          t.TEXTURE11,
          t.TEXTURE12,
          t.TEXTURE13,
          t.TEXTURE14,
          t.TEXTURE15,
          t.TEXTURE16,
          t.TEXTURE17,
          t.TEXTURE18,
          t.TEXTURE19,
          t.TEXTURE20,
          t.TEXTURE21,
          t.TEXTURE22,
          t.TEXTURE23,
          t.TEXTURE24,
          t.TEXTURE25,
          t.TEXTURE26,
          t.TEXTURE27,
          t.TEXTURE28,
          t.TEXTURE29,
          t.TEXTURE30,
          t.TEXTURE31,
        ]);
      var i = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
        s = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS);
      b._maxUniformFragmentVectors = Math.min(i, s);
    }
    static useProgram(t, e) {
      return b._useProgram !== e &amp;&amp; (t.useProgram(e), (b._useProgram = e), !0);
    }
    static setDepthTest(t, e) {
      e !== b._depthTest &amp;&amp;
        ((b._depthTest = e),
        e ? t.enable(t.DEPTH_TEST) : t.disable(t.DEPTH_TEST));
    }
    static setDepthMask(t, e) {
      e !== b._depthMask &amp;&amp; ((b._depthMask = e), t.depthMask(e));
    }
    static setDepthFunc(t, e) {
      e !== b._depthFunc &amp;&amp; ((b._depthFunc = e), t.depthFunc(e));
    }
    static setStencilTest(t, e) {
      e !== b._stencilTest &amp;&amp;
        ((b._stencilTest = e),
        e ? t.enable(t.STENCIL_TEST) : t.disable(t.STENCIL_TEST));
    }
    static setStencilMask(t, e) {
      e !== b._stencilMask &amp;&amp;
        ((b._stencilMask = e), e ? t.stencilMask(255) : t.stencilMask(0));
    }
    static setStencilFunc(t, e, i) {
      (e == b._stencilFunc &amp;&amp; i == b._stencilRef) ||
        ((b._stencilFunc = e), (b._stencilRef = i), t.stencilFunc(e, i, 255));
    }
    static setstencilOp(t, e, i, s) {
      (b._stencilOp_fail == e &amp;&amp;
        b._stencilOp_zfail == i &amp;&amp;
        b._stencilOp_zpass == s) ||
        ((b._stencilOp_fail = e),
        (b._stencilOp_zfail = i),
        (b._stencilOp_zpass = s),
        t.stencilOp(e, i, s));
    }
    static setBlend(t, e) {
      e !== b._blend &amp;&amp;
        ((b._blend = e), e ? t.enable(t.BLEND) : t.disable(t.BLEND));
    }
    static setBlendEquation(t, e) {
      e !== b._blendEquation &amp;&amp;
        ((b._blendEquation = e),
        (b._blendEquationRGB = b._blendEquationAlpha = null),
        t.blendEquation(e));
    }
    static setBlendEquationSeparate(t, e, i) {
      (e === b._blendEquationRGB &amp;&amp; i === b._blendEquationAlpha) ||
        ((b._blendEquationRGB = e),
        (b._blendEquationAlpha = i),
        (b._blendEquation = null),
        t.blendEquationSeparate(e, i));
    }
    static setBlendFunc(t, e, i, s = !1) {
      (s || e !== C || i !== A) &amp;&amp;
        ((C = e),
        (A = i),
        (b._sFactorRGB = null),
        (b._dFactorRGB = null),
        (b._sFactorAlpha = null),
        (b._dFactorAlpha = null),
        t.blendFunc(e, i));
    }
    static setBlendFuncSeperate(t, e, i, s, r) {
      (e === b._sFactorRGB &amp;&amp;
        i === b._dFactorRGB &amp;&amp;
        s === b._sFactorAlpha &amp;&amp;
        r === b._dFactorAlpha) ||
        ((b._sFactorRGB = e),
        (b._dFactorRGB = i),
        (b._sFactorAlpha = s),
        (b._dFactorAlpha = r),
        (C = null),
        (A = null),
        t.blendFuncSeparate(e, i, s, r));
    }
    static setCullFace(t, e) {
      e !== b._cullFace &amp;&amp;
        ((b._cullFace = e), e ? t.enable(t.CULL_FACE) : t.disable(t.CULL_FACE));
    }
    static setFrontFace(t, e) {
      e !== b._frontFace &amp;&amp; ((b._frontFace = e), t.frontFace(e));
    }
    static activeTexture(t, e) {
      b._activedTextureID !== e &amp;&amp;
        (t.activeTexture(e), (b._activedTextureID = e));
    }
    static bindTexture(t, e, i) {
      b._activeTextures[b._activedTextureID - t.TEXTURE0] !== i &amp;&amp;
        (t.bindTexture(e, i),
        (b._activeTextures[b._activedTextureID - t.TEXTURE0] = i));
    }
    static __init_native() {
      if (i.Render.supportWebGLPlusRendering) {
        var t = b;
        (t.activeTexture = t.activeTextureForNative),
          (t.bindTexture = t.bindTextureForNative);
      }
    }
    static useProgramForNative(t, e) {
      return t.useProgram(e), !0;
    }
    static setDepthTestForNative(t, e) {
      e ? t.enable(t.DEPTH_TEST) : t.disable(t.DEPTH_TEST);
    }
    static setDepthMaskForNative(t, e) {
      t.depthMask(e);
    }
    static setDepthFuncForNative(t, e) {
      t.depthFunc(e);
    }
    static setBlendForNative(t, e) {
      e ? t.enable(t.BLEND) : t.disable(t.BLEND);
    }
    static setBlendFuncForNative(t, e, i) {
      t.blendFunc(e, i);
    }
    static setCullFaceForNative(t, e) {
      e ? t.enable(t.CULL_FACE) : t.disable(t.CULL_FACE);
    }
    static setFrontFaceForNative(t, e) {
      t.frontFace(e);
    }
    static activeTextureForNative(t, e) {
      t.activeTexture(e);
    }
    static bindTextureForNative(t, e, i) {
      t.bindTexture(e, i);
    }
    static bindVertexArrayForNative(t, e) {
      t.bindVertexArray(e);
    }
    static getUniformMaxVector() {
      return b._maxUniformFragmentVectors;
    }
  }
  (b._activeTextures = new Array(1)),
    (b._useProgram = null),
    (b._depthTest = !0),
    (b._depthMask = !0),
    (b._stencilTest = !1),
    (b._blend = !1),
    (b._cullFace = !1),
    (b.mainContext = null);
  class S {
    constructor(t = null, e = null, i = null, s = !1) {
      (this.once = !1), (this._id = 0), this.setTo(t, e, i, s);
    }
    setTo(t, e, i, s = !1) {
      return (
        (this._id = S._gid++),
        (this.caller = t),
        (this.method = e),
        (this.args = i),
        (this.once = s),
        this
      );
    }
    run() {
      if (null == this.method) return null;
      var t = this._id,
        e = this.method.apply(this.caller, this.args);
      return this._id === t &amp;&amp; this.once &amp;&amp; this.recover(), e;
    }
    runWith(t) {
      if (null == this.method) return null;
      var e = this._id;
      if (null == t) var i = this.method.apply(this.caller, this.args);
      else
        i =
          this.args || t.unshift
            ? this.args
              ? this.method.apply(this.caller, this.args.concat(t))
              : this.method.apply(this.caller, t)
            : this.method.call(this.caller, t);
      return this._id === e &amp;&amp; this.once &amp;&amp; this.recover(), i;
    }
    clear() {
      return (
        (this.caller = null), (this.method = null), (this.args = null), this
      );
    }
    recover() {
      this._id &gt; 0 &amp;&amp; ((this._id = 0), S._pool.push(this.clear()));
    }
    static create(t, e, i = null, s = !0) {
      return S._pool.length
        ? S._pool.pop().setTo(t, e, i, s)
        : new S(t, e, i, s);
    }
  }
  (S._pool = []), (S._gid = 1);
  class w {
    hasListener(t) {
      return !!(this._events &amp;&amp; this._events[t]);
    }
    event(t, e = null) {
      if (!this._events || !this._events[t]) return !1;
      var i = this._events[t];
      if (i.run)
        i.once &amp;&amp; delete this._events[t], null != e ? i.runWith(e) : i.run();
      else {
        for (var s = 0, r = i.length; s &lt; r; s++) {
          var a = i[s];
          a &amp;&amp; (null != e ? a.runWith(e) : a.run()),
            (a &amp;&amp; !a.once) || (i.splice(s, 1), s--, r--);
        }
        0 === i.length &amp;&amp;
          this._events &amp;&amp;
          this._events[t] &amp;&amp;
          !this._events[t].run &amp;&amp;
          delete this._events[t];
      }
      return !0;
    }
    on(t, e, i, s = null) {
      return this._createListener(t, e, i, s, !1);
    }
    once(t, e, i, s = null) {
      return this._createListener(t, e, i, s, !0);
    }
    _createListener(t, e, i, s, r, a = !0) {
      a &amp;&amp; this.off(t, e, i, r);
      var n = M.create(e || this, i, s, r);
      this._events || (this._events = {});
      var h = this._events;
      return (
        h[t] ? (h[t].run ? (h[t] = [h[t], n]) : h[t].push(n)) : (h[t] = n), this
      );
    }
    off(t, e, i, s = !1) {
      if (!this._events || !this._events[t]) return this;
      var r = this._events[t];
      if (null != r)
        if (r.run)
          (e &amp;&amp; r.caller !== e) ||
            (null != i &amp;&amp; r.method !== i) ||
            (s &amp;&amp; !r.once) ||
            (delete this._events[t], r.recover());
        else {
          for (var a = 0, n = 0, h = r.length; n &lt; h; n++) {
            var o = r[n];
            o
              ? !o ||
                (e &amp;&amp; o.caller !== e) ||
                (null != i &amp;&amp; o.method !== i) ||
                (s &amp;&amp; !o.once) ||
                (a++, (r[n] = null), o.recover())
              : a++;
          }
          a === h &amp;&amp; delete this._events[t];
        }
      return this;
    }
    offAll(t = null) {
      var e = this._events;
      if (!e) return this;
      if (t) this._recoverHandlers(e[t]), delete e[t];
      else {
        for (var i in e) this._recoverHandlers(e[i]);
        this._events = null;
      }
      return this;
    }
    offAllCaller(t) {
      if (t &amp;&amp; this._events) for (var e in this._events) this.off(e, t, null);
      return this;
    }
    _recoverHandlers(t) {
      if (t)
        if (t.run) t.recover();
        else
          for (var e = t.length - 1; e &gt; -1; e--)
            t[e] &amp;&amp; (t[e].recover(), (t[e] = null));
    }
    isMouseEvent(t) {
      return w.MOUSE_EVENTS[t] || !1;
    }
  }
  w.MOUSE_EVENTS = {
    rightmousedown: !0,
    rightmouseup: !0,
    rightclick: !0,
    mousedown: !0,
    mouseup: !0,
    mousemove: !0,
    mouseover: !0,
    mouseout: !0,
    click: !0,
    doubleclick: !0,
  };
  class M extends S {
    constructor(t, e, i, s) {
      super(t, e, i, s);
    }
    recover() {
      this._id &gt; 0 &amp;&amp; ((this._id = 0), M._pool.push(this.clear()));
    }
    static create(t, e, i = null, s = !0) {
      return M._pool.length
        ? M._pool.pop().setTo(t, e, i, s)
        : new M(t, e, i, s);
    }
  }
  M._pool = [];
  class I {
    constructor(t) {
      (this._url = I.formatURL(t)), (this._path = I.getPath(t));
    }
    get url() {
      return this._url;
    }
    get path() {
      return this._path;
    }
    static set basePath(t) {
      (I._basePath = i.Laya._getUrlPath()), (I._basePath = I.formatURL(t));
    }
    static get basePath() {
      return I._basePath;
    }
    static formatURL(t) {
      if (!t) return "null path";
      if (t.indexOf(":") &gt; 0) return t;
      I.exportSceneToJson &amp;&amp; (t = I.getAdptedFilePath(t)),
        null != I.customFormat &amp;&amp; (t = I.customFormat(t));
      var e = t.charAt(0);
      if ("." === e) return I._formatRelativePath(I._basePath + t);
      if ("~" === e) return I.rootPath + t.substring(1);
      if ("d" === e) {
        if (0 === t.indexOf("data:image")) return t;
      } else if ("/" === e) return t;
      return I._basePath + t;
    }
    static _formatRelativePath(t) {
      for (var e = t.split("/"), i = 0, s = e.length; i &lt; s; i++)
        ".." == e[i] &amp;&amp; (e.splice(i - 1, 2), (i -= 2));
      return e.join("/");
    }
    static getPath(t) {
      var e = t.lastIndexOf("/");
      return e &gt; 0 ? t.substr(0, e + 1) : "";
    }
    static getFileName(t) {
      var e = t.lastIndexOf("/");
      return e &gt; 0 ? t.substr(e + 1) : t;
    }
    static getAdptedFilePath(t) {
      if (!I.exportSceneToJson || !t) return t;
      var e, i, s;
      for (i = I._adpteTypeList.length, e = 0; e &lt; i; e++)
        (s = I._adpteTypeList[e]), (t = t.replace(s[0], s[1]));
      return t;
    }
  }
  (I.version = {}),
    (I.exportSceneToJson = !1),
    (I._basePath = ""),
    (I.rootPath = ""),
    (I.customFormat = function (t) {
      var e = I.version[t];
      return !window.conch &amp;&amp; e &amp;&amp; (t += "?v=" + e), t;
    }),
    (I._adpteTypeList = [
      [".scene3d", ".json"],
      [".scene", ".json"],
      [".taa", ".json"],
      [".prefab", ".json"],
    ]);
  class P extends w {
    constructor() {
      super(),
        (this._id = 0),
        (this._url = null),
        (this._cpuMemory = 0),
        (this._gpuMemory = 0),
        (this._destroyed = !1),
        (this._referenceCount = 0),
        (this.lock = !1),
        (this.name = null),
        (this._id = ++P._uniqueIDCounter),
        (this._destroyed = !1),
        (this._referenceCount = 0),
        (P._idResourcesMap[this.id] = this),
        (this.lock = !1);
    }
    static get cpuMemory() {
      return P._cpuMemory;
    }
    static get gpuMemory() {
      return P._gpuMemory;
    }
    static _addCPUMemory(t) {
      P._cpuMemory += t;
    }
    static _addGPUMemory(t) {
      P._gpuMemory += t;
    }
    static _addMemory(t, e) {
      (P._cpuMemory += t), (P._gpuMemory += e);
    }
    static getResourceByID(t) {
      return P._idResourcesMap[t];
    }
    static getResourceByURL(t, e = 0) {
      return P._urlResourcesMap[t][e];
    }
    static destroyUnusedResources() {
      for (var t in P._idResourcesMap) {
        var e = P._idResourcesMap[t];
        e.lock || 0 !== e._referenceCount || e.destroy();
      }
    }
    get id() {
      return this._id;
    }
    get url() {
      return this._url;
    }
    get cpuMemory() {
      return this._cpuMemory;
    }
    get gpuMemory() {
      return this._gpuMemory;
    }
    get destroyed() {
      return this._destroyed;
    }
    get referenceCount() {
      return this._referenceCount;
    }
    _setCPUMemory(t) {
      var e = t - this._cpuMemory;
      (this._cpuMemory = t), P._addCPUMemory(e);
    }
    _setGPUMemory(t) {
      var e = t - this._gpuMemory;
      (this._gpuMemory = t), P._addGPUMemory(e);
    }
    _setCreateURL(t) {
      var e;
      ((t = I.formatURL(t)), this._url !== t) &amp;&amp;
        (this._url &amp;&amp;
          ((e = P._urlResourcesMap[this._url]).splice(e.indexOf(this), 1),
          0 === e.length &amp;&amp; delete P._urlResourcesMap[this._url]),
        t &amp;&amp;
          ((e = P._urlResourcesMap[t]) || (P._urlResourcesMap[t] = e = []),
          e.push(this)),
        (this._url = t));
    }
    _addReference(t = 1) {
      this._referenceCount += t;
    }
    _removeReference(t = 1) {
      this._referenceCount -= t;
    }
    _clearReference() {
      this._referenceCount = 0;
    }
    _recoverResource() {}
    _disposeResource() {}
    _activeResource() {}
    destroy() {
      var t;
      this._destroyed ||
        ((this._destroyed = !0),
        (this.lock = !1),
        this._disposeResource(),
        delete P._idResourcesMap[this.id],
        this._url &amp;&amp;
          ((t = P._urlResourcesMap[this._url]) &amp;&amp;
            (t.splice(t.indexOf(this), 1),
            0 === t.length &amp;&amp; delete P._urlResourcesMap[this._url]),
          i.Loader.loadedMap[this._url] == this &amp;&amp;
            delete i.Loader.loadedMap[this._url]));
    }
  }
  (P._uniqueIDCounter = 0),
    (P._idResourcesMap = {}),
    (P._urlResourcesMap = {}),
    (P._cpuMemory = 0),
    (P._gpuMemory = 0);
  class L extends P {
    constructor() {
      super(), (this._width = -1), (this._height = -1);
    }
    get width() {
      return this._width;
    }
    set width(t) {
      this._width = t;
    }
    get height() {
      return this._height;
    }
    set height(t) {
      this._height = t;
    }
    _getSource() {
      throw "Bitmap: must override it.";
    }
  }
  ((T = t.FilterMode || (t.FilterMode = {}))[(T.Point = 0)] = "Point"),
    (T[(T.Bilinear = 1)] = "Bilinear"),
    (T[(T.Trilinear = 2)] = "Trilinear"),
    ((v = t.TextureFormat || (t.TextureFormat = {}))[(v.R8G8B8 = 0)] =
      "R8G8B8"),
    (v[(v.R8G8B8A8 = 1)] = "R8G8B8A8"),
    (v[(v.R5G6B5 = 16)] = "R5G6B5"),
    (v[(v.Alpha8 = 2)] = "Alpha8"),
    (v[(v.DXT1 = 3)] = "DXT1"),
    (v[(v.DXT5 = 4)] = "DXT5"),
    (v[(v.ETC1RGB = 5)] = "ETC1RGB"),
    (v[(v.ETC2RGB = 6)] = "ETC2RGB"),
    (v[(v.ETC2RGBA = 7)] = "ETC2RGBA"),
    (v[(v.ETC2RGB_Alpha8 = 8)] = "ETC2RGB_Alpha8"),
    (v[(v.ETC2SRGB = 28)] = "ETC2SRGB"),
    (v[(v.PVRTCRGB_2BPPV = 9)] = "PVRTCRGB_2BPPV"),
    (v[(v.PVRTCRGBA_2BPPV = 10)] = "PVRTCRGBA_2BPPV"),
    (v[(v.PVRTCRGB_4BPPV = 11)] = "PVRTCRGB_4BPPV"),
    (v[(v.PVRTCRGBA_4BPPV = 12)] = "PVRTCRGBA_4BPPV"),
    (v[(v.R32G32B32A32 = 15)] = "R32G32B32A32"),
    (v[(v.R16G16B16A16 = 17)] = "R16G16B16A16"),
    (v[(v.ASTC4x4 = 18)] = "ASTC4x4"),
    (v[(v.ASTC4x4SRGB = 23)] = "ASTC4x4SRGB"),
    (v[(v.ASTC6x6 = 19)] = "ASTC6x6"),
    (v[(v.ASTC6x6SRGB = 24)] = "ASTC6x6SRGB"),
    (v[(v.ASTC8x8 = 20)] = "ASTC8x8"),
    (v[(v.ASTC8x8SRGB = 25)] = "ASTC8x8SRGB"),
    (v[(v.ASTC10x10 = 21)] = "ASTC10x10"),
    (v[(v.ASTC10x10SRGB = 26)] = "ASTC10x10SRGB"),
    (v[(v.ASTC12x12 = 22)] = "ASTC12x12"),
    (v[(v.ASTC12x12SRGB = 27)] = "ASTC12x12SRGB"),
    (v[(v.KTXTEXTURE = -1)] = "KTXTEXTURE"),
    (v[(v.PVRTEXTURE = -2)] = "PVRTEXTURE"),
    ((x = t.WarpMode || (t.WarpMode = {}))[(x.Repeat = 0)] = "Repeat"),
    (x[(x.Clamp = 1)] = "Clamp"),
    (x[(x.Mirrored = 2)] = "Mirrored");
  class D extends L {
    constructor(e, i) {
      super(),
        (this._wrapModeU = t.WarpMode.Repeat),
        (this._wrapModeV = t.WarpMode.Repeat),
        (this._filterMode = t.FilterMode.Bilinear),
        (this._readyed = !1),
        (this._width = -1),
        (this._height = -1),
        (this._format = e),
        (this._mipmap = i),
        (this._anisoLevel = 1),
        (this._glTexture = g.instance.createTexture());
    }
    get mipmap() {
      return this._mipmap;
    }
    get format() {
      return this._format;
    }
    get wrapModeU() {
      return this._wrapModeU;
    }
    set wrapModeU(t) {
      this._wrapModeU !== t &amp;&amp;
        ((this._wrapModeU = t),
        -1 !== this._width &amp;&amp; this._setWarpMode(g.instance.TEXTURE_WRAP_S, t));
    }
    get wrapModeV() {
      return this._wrapModeV;
    }
    set wrapModeV(t) {
      this._wrapModeV !== t &amp;&amp;
        ((this._wrapModeV = t),
        -1 !== this._height &amp;&amp; this._setWarpMode(g.instance.TEXTURE_WRAP_T, t));
    }
    get filterMode() {
      return this._filterMode;
    }
    set filterMode(t) {
      t !== this._filterMode &amp;&amp;
        ((this._filterMode = t),
        -1 !== this._width &amp;&amp; -1 !== this._height &amp;&amp; this._setFilterMode(t));
    }
    get anisoLevel() {
      return this._anisoLevel;
    }
    set anisoLevel(t) {
      t !== this._anisoLevel &amp;&amp;
        ((this._anisoLevel = Math.max(1, Math.min(16, t))),
        -1 !== this._width &amp;&amp; -1 !== this._height &amp;&amp; this._setAnisotropy(t));
    }
    get mipmapCount() {
      return this._mipmapCount;
    }
    set mipmapCount(t) {
      this._mipmapCount = t;
    }
    get defaulteTexture() {
      throw "BaseTexture:must override it.";
    }
    _getFormatByteCount() {
      switch (this._format) {
        case t.TextureFormat.R8G8B8:
          return 3;
        case t.TextureFormat.R8G8B8A8:
          return 4;
        case t.TextureFormat.R5G6B5:
        case t.TextureFormat.Alpha8:
          return 1;
        case t.TextureFormat.R16G16B16A16:
          return 2;
        case t.TextureFormat.R32G32B32A32:
          return 4;
        default:
          throw "Texture2D: unknown format.";
      }
    }
    _isPot(t) {
      return 0 == (t &amp; (t - 1));
    }
    _getGLFormat() {
      var e,
        i = g.instance,
        s = g.layaGPUInstance;
      switch (this._format) {
        case t.TextureFormat.R8G8B8:
        case t.TextureFormat.R5G6B5:
          e = i.RGB;
          break;
        case t.TextureFormat.R8G8B8A8:
          e = i.RGBA;
          break;
        case t.TextureFormat.Alpha8:
          e = i.ALPHA;
          break;
        case t.TextureFormat.R32G32B32A32:
        case t.TextureFormat.R16G16B16A16:
          e = i.RGBA;
          break;
        case t.TextureFormat.DXT1:
          if (!s._compressedTextureS3tc)
            throw "BaseTexture: not support DXT1 format.";
          e = s._compressedTextureS3tc.COMPRESSED_RGB_S3TC_DXT1_EXT;
          break;
        case t.TextureFormat.DXT5:
          if (!s._compressedTextureS3tc)
            throw "BaseTexture: not support DXT5 format.";
          e = s._compressedTextureS3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT;
          break;
        case t.TextureFormat.ETC1RGB:
          if (!s._compressedTextureEtc1)
            throw "BaseTexture: not support ETC1RGB format.";
          e = s._compressedTextureEtc1.COMPRESSED_RGB_ETC1_WEBGL;
          break;
        case t.TextureFormat.ETC2RGB:
          if (!s._compressedTextureETC)
            throw "BaseTexture: not support ETC2RGB format.";
          e = s._compressedTextureETC.COMPRESSED_RGB8_ETC2;
          break;
        case t.TextureFormat.ETC2RGBA:
          if (!s._compressedTextureETC)
            throw "BaseTexture: not support ETC2RGBA format.";
          e = s._compressedTextureETC.COMPRESSED_RGBA8_ETC2_EAC;
          break;
        case t.TextureFormat.ETC2RGB_Alpha8:
          if (!s._compressedTextureETC)
            throw "BaseTexture: not support ETC2SRGB_Alpha8 format.";
          e = s._compressedTextureETC.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC;
          break;
        case t.TextureFormat.ETC2SRGB:
          if (!s._compressedTextureETC)
            throw "BaseTexture: not support ETC2SRGB format.";
          e = s._compressedTextureETC.COMPRESSED_SRGB8_ETC2;
          break;
        case t.TextureFormat.PVRTCRGB_2BPPV:
          if (!s._compressedTexturePvrtc)
            throw "BaseTexture: not support PVRTCRGB_2BPPV format.";
          e = s._compressedTexturePvrtc.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
          break;
        case t.TextureFormat.PVRTCRGBA_2BPPV:
          if (!s._compressedTexturePvrtc)
            throw "BaseTexture: not support PVRTCRGBA_2BPPV format.";
          e = s._compressedTexturePvrtc.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;
          break;
        case t.TextureFormat.PVRTCRGB_4BPPV:
          if (!s._compressedTexturePvrtc)
            throw "BaseTexture: not support PVRTCRGB_4BPPV format.";
          e = s._compressedTexturePvrtc.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
          break;
        case t.TextureFormat.PVRTCRGBA_4BPPV:
          if (!s._compressedTexturePvrtc)
            throw "BaseTexture: not support PVRTCRGBA_4BPPV format.";
          e = s._compressedTexturePvrtc.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
          break;
        case t.TextureFormat.ASTC4x4:
          if (!s._compressedTextureASTC)
            throw "BaseTexture: not support ASTC4x4 format.";
          e = s._compressedTextureASTC.COMPRESSED_RGBA_ASTC_4x4_KHR;
          break;
        case t.TextureFormat.ASTC4x4SRGB:
          if (!s._compressedTextureASTC)
            throw "BaseTexture: not support ASTC4x4_KHR format.";
          e = s._compressedTextureASTC.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;
          break;
        case t.TextureFormat.ASTC6x6:
          if (!s._compressedTextureASTC)
            throw "BaseTexture: not support ASTC6x6 format.";
          e = s._compressedTextureASTC.COMPRESSED_RGBA_ASTC_6x6_KHR;
          break;
        case t.TextureFormat.ASTC6x6SRGB:
          if (!s._compressedTextureASTC)
            throw "BaseTexture: not support ASTC6x6_KHR format.";
          e = s._compressedTextureASTC.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR;
          break;
        case t.TextureFormat.ASTC8x8:
          if (!s._compressedTextureASTC)
            throw "BaseTexture: not support ASTC8x8 format.";
          e = s._compressedTextureASTC.COMPRESSED_RGBA_ASTC_8x8_KHR;
          break;
        case t.TextureFormat.ASTC8x8SRGB:
          if (!s._compressedTextureASTC)
            throw "BaseTexture: not support ASTC8x8 format.";
          e = s._compressedTextureASTC.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR;
          break;
        case t.TextureFormat.ASTC10x10:
          if (!s._compressedTextureASTC)
            throw "BaseTexture: not support ASTC10x10 format.";
          e = s._compressedTextureASTC.COMPRESSED_RGBA_ASTC_10x10_KHR;
          break;
        case t.TextureFormat.ASTC10x10SRGB:
          if (!s._compressedTextureASTC)
            throw "BaseTexture: not support ASTC10x10 format.";
          e = s._compressedTextureASTC.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR;
          break;
        case t.TextureFormat.ASTC12x12:
          if (!s._compressedTextureASTC)
            throw "BaseTexture: not support ASTC12x12 format.";
          e = s._compressedTextureASTC.COMPRESSED_RGBA_ASTC_12x12_KHR;
          break;
        case t.TextureFormat.ASTC12x12SRGB:
          if (!s._compressedTextureASTC)
            throw "BaseTexture: not support ASTC12x12 format.";
          e = s._compressedTextureASTC.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR;
          break;
        default:
          throw "BaseTexture: unknown texture format.";
      }
      return e;
    }
    _setFilterMode(e) {
      var i = g.instance;
      switch ((b.bindTexture(i, this._glTextureType, this._glTexture), e)) {
        case t.FilterMode.Point:
          this._mipmap
            ? i.texParameteri(
                this._glTextureType,
                i.TEXTURE_MIN_FILTER,
                i.NEAREST_MIPMAP_NEAREST,
              )
            : i.texParameteri(
                this._glTextureType,
                i.TEXTURE_MIN_FILTER,
                i.NEAREST,
              ),
            i.texParameteri(
              this._glTextureType,
              i.TEXTURE_MAG_FILTER,
              i.NEAREST,
            );
          break;
        case t.FilterMode.Bilinear:
          this._mipmap
            ? i.texParameteri(
                this._glTextureType,
                i.TEXTURE_MIN_FILTER,
                i.LINEAR_MIPMAP_NEAREST,
              )
            : i.texParameteri(
                this._glTextureType,
                i.TEXTURE_MIN_FILTER,
                i.LINEAR,
              ),
            i.texParameteri(
              this._glTextureType,
              i.TEXTURE_MAG_FILTER,
              i.LINEAR,
            );
          break;
        case t.FilterMode.Trilinear:
          this._mipmap
            ? i.texParameteri(
                this._glTextureType,
                i.TEXTURE_MIN_FILTER,
                i.LINEAR_MIPMAP_LINEAR,
              )
            : i.texParameteri(
                this._glTextureType,
                i.TEXTURE_MIN_FILTER,
                i.LINEAR,
              ),
            i.texParameteri(
              this._glTextureType,
              i.TEXTURE_MAG_FILTER,
              i.LINEAR,
            );
          break;
        default:
          throw new Error("BaseTexture:unknown filterMode value.");
      }
      b.bindTexture(i, this._glTextureType, null);
    }
    _setWarpMode(e, i) {
      var s = g.instance;
      if (
        (b.bindTexture(s, this._glTextureType, this._glTexture),
        this._isPot(this._width) &amp;&amp; this._isPot(this._height))
      )
        switch (i) {
          case t.WarpMode.Repeat:
            s.texParameteri(this._glTextureType, e, s.REPEAT);
            break;
          case t.WarpMode.Clamp:
            s.texParameteri(this._glTextureType, e, s.CLAMP_TO_EDGE);
            break;
          case t.WarpMode.Mirrored:
            s.texParameteri(this._glTextureType, e, s.MIRRORED_REPEAT);
        }
      else s.texParameteri(this._glTextureType, e, s.CLAMP_TO_EDGE);
      b.bindTexture(s, this._glTextureType, null);
    }
    _setAnisotropy(t) {
      var e = g.layaGPUInstance._extTextureFilterAnisotropic;
      if (e) {
        t = Math.max(t, 1);
        var i = g.instance;
        b.bindTexture(i, this._glTextureType, this._glTexture),
          (t = Math.min(i.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT), t)),
          i.texParameterf(this._glTextureType, e.TEXTURE_MAX_ANISOTROPY_EXT, t),
          b.bindTexture(i, this._glTextureType, null);
      }
    }
    _disposeResource() {
      this._glTexture &amp;&amp;
        (g.instance.deleteTexture(this._glTexture),
        (this._glTexture = null),
        this._setGPUMemory(0));
    }
    _getSource() {
      return this._readyed ? this._glTexture : null;
    }
    generateMipmap() {
      this._isPot(this.width) &amp;&amp;
        this._isPot(this.height) &amp;&amp;
        g.instance.generateMipmap(this._glTextureType);
    }
  }
  (D._rgbmRange = 5),
    (D.FORMAT_R8G8B8 = 0),
    (D.FORMAT_R8G8B8A8 = 1),
    (D.FORMAT_ALPHA8 = 2),
    (D.FORMAT_DXT1 = 3),
    (D.FORMAT_DXT5 = 4),
    (D.FORMAT_ETC1RGB = 5),
    (D.FORMAT_PVRTCRGB_2BPPV = 9),
    (D.FORMAT_PVRTCRGBA_2BPPV = 10),
    (D.FORMAT_PVRTCRGB_4BPPV = 11),
    (D.FORMAT_PVRTCRGBA_4BPPV = 12),
    (D.RENDERTEXTURE_FORMAT_RGBA_HALF_FLOAT = 14),
    (D.FORMAT_R32G32B32A32 = 15),
    (D.FORMAT_DEPTH_16 = 0),
    (D.FORMAT_STENCIL_8 = 1),
    (D.FORMAT_DEPTHSTENCIL_16_8 = 2),
    (D.FORMAT_DEPTHSTENCIL_NONE = 3),
    (D.FILTERMODE_POINT = 0),
    (D.FILTERMODE_BILINEAR = 1),
    (D.FILTERMODE_TRILINEAR = 2),
    (D.WARPMODE_REPEAT = 0),
    (D.WARPMODE_CLAMP = 1);
  class B {
    constructor(t = null) {
      (this._xd_ = !0),
        (this._allocated_ = 8),
        (this._pos_ = 0),
        (this._length = 0),
        t
          ? ((this._u8d_ = new Uint8Array(t)),
            (this._d_ = new DataView(this._u8d_.buffer)),
            (this._length = this._d_.byteLength))
          : this._resizeBuffer(this._allocated_);
    }
    static getSystemEndian() {
      if (!B._sysEndian) {
        var t = new ArrayBuffer(2);
        new DataView(t).setInt16(0, 256, !0),
          (B._sysEndian =
            256 === new Int16Array(t)[0] ? B.LITTLE_ENDIAN : B.BIG_ENDIAN);
      }
      return B._sysEndian;
    }
    get buffer() {
      var t = this._d_.buffer;
      return t.byteLength === this._length ? t : t.slice(0, this._length);
    }
    get endian() {
      return this._xd_ ? B.LITTLE_ENDIAN : B.BIG_ENDIAN;
    }
    set endian(t) {
      this._xd_ = t === B.LITTLE_ENDIAN;
    }
    set length(t) {
      this._allocated_ &lt; t
        ? this._resizeBuffer(
            (this._allocated_ = Math.floor(Math.max(t, 2 * this._allocated_))),
          )
        : this._allocated_ &gt; t &amp;&amp; this._resizeBuffer((this._allocated_ = t)),
        (this._length = t);
    }
    get length() {
      return this._length;
    }
    _resizeBuffer(t) {
      try {
        var e = new Uint8Array(t);
        null != this._u8d_ &amp;&amp;
          (this._u8d_.length &lt;= t
            ? e.set(this._u8d_)
            : e.set(this._u8d_.subarray(0, t))),
          (this._u8d_ = e),
          (this._d_ = new DataView(e.buffer));
      } catch (e) {
        throw "Invalid typed array length:" + t;
      }
    }
    getString() {
      return this.readString();
    }
    readString() {
      return this._rUTF(this.getUint16());
    }
    getFloat32Array(t, e) {
      return this.readFloat32Array(t, e);
    }
    readFloat32Array(t, e) {
      var i = t + e;
      i = i &gt; this._length ? this._length : i;
      var s = new Float32Array(this._d_.buffer.slice(t, i));
      return (this._pos_ = i), s;
    }
    getUint8Array(t, e) {
      return this.readUint8Array(t, e);
    }
    readUint8Array(t, e) {
      var i = t + e;
      i = i &gt; this._length ? this._length : i;
      var s = new Uint8Array(this._d_.buffer.slice(t, i));
      return (this._pos_ = i), s;
    }
    getInt16Array(t, e) {
      return this.readInt16Array(t, e);
    }
    readInt16Array(t, e) {
      var i = t + e;
      i = i &gt; this._length ? this._length : i;
      var s = new Int16Array(this._d_.buffer.slice(t, i));
      return (this._pos_ = i), s;
    }
    getFloat32() {
      return this.readFloat32();
    }
    readFloat32() {
      if (this._pos_ + 4 &gt; this._length)
        throw "getFloat32 error - Out of bounds";
      var t = this._d_.getFloat32(this._pos_, this._xd_);
      return (this._pos_ += 4), t;
    }
    getFloat64() {
      return this.readFloat64();
    }
    readFloat64() {
      if (this._pos_ + 8 &gt; this._length)
        throw "getFloat64 error - Out of bounds";
      var t = this._d_.getFloat64(this._pos_, this._xd_);
      return (this._pos_ += 8), t;
    }
    writeFloat32(t) {
      this._ensureWrite(this._pos_ + 4),
        this._d_.setFloat32(this._pos_, t, this._xd_),
        (this._pos_ += 4);
    }
    writeFloat64(t) {
      this._ensureWrite(this._pos_ + 8),
        this._d_.setFloat64(this._pos_, t, this._xd_),
        (this._pos_ += 8);
    }
    getInt32() {
      return this.readInt32();
    }
    readInt32() {
      if (this._pos_ + 4 &gt; this._length) throw "getInt32 error - Out of bounds";
      var t = this._d_.getInt32(this._pos_, this._xd_);
      return (this._pos_ += 4), t;
    }
    getUint32() {
      return this.readUint32();
    }
    readUint32() {
      if (this._pos_ + 4 &gt; this._length)
        throw "getUint32 error - Out of bounds";
      var t = this._d_.getUint32(this._pos_, this._xd_);
      return (this._pos_ += 4), t;
    }
    writeInt32(t) {
      this._ensureWrite(this._pos_ + 4),
        this._d_.setInt32(this._pos_, t, this._xd_),
        (this._pos_ += 4);
    }
    writeUint32(t) {
      this._ensureWrite(this._pos_ + 4),
        this._d_.setUint32(this._pos_, t, this._xd_),
        (this._pos_ += 4);
    }
    getInt16() {
      return this.readInt16();
    }
    readInt16() {
      if (this._pos_ + 2 &gt; this._length) throw "getInt16 error - Out of bounds";
      var t = this._d_.getInt16(this._pos_, this._xd_);
      return (this._pos_ += 2), t;
    }
    getUint16() {
      return this.readUint16();
    }
    readUint16() {
      if (this._pos_ + 2 &gt; this._length)
        throw "getUint16 error - Out of bounds";
      var t = this._d_.getUint16(this._pos_, this._xd_);
      return (this._pos_ += 2), t;
    }
    writeUint16(t) {
      this._ensureWrite(this._pos_ + 2),
        this._d_.setUint16(this._pos_, t, this._xd_),
        (this._pos_ += 2);
    }
    writeInt16(t) {
      this._ensureWrite(this._pos_ + 2),
        this._d_.setInt16(this._pos_, t, this._xd_),
        (this._pos_ += 2);
    }
    getUint8() {
      return this.readUint8();
    }
    readUint8() {
      if (this._pos_ + 1 &gt; this._length) throw "getUint8 error - Out of bounds";
      return this._u8d_[this._pos_++];
    }
    writeUint8(t) {
      this._ensureWrite(this._pos_ + 1),
        this._d_.setUint8(this._pos_, t),
        this._pos_++;
    }
    _getUInt8(t) {
      return this._readUInt8(t);
    }
    _readUInt8(t) {
      return this._d_.getUint8(t);
    }
    _getUint16(t) {
      return this._readUint16(t);
    }
    _readUint16(t) {
      return this._d_.getUint16(t, this._xd_);
    }
    _getMatrix() {
      return this._readMatrix();
    }
    _readMatrix() {
      return new p(
        this.getFloat32(),
        this.getFloat32(),
        this.getFloat32(),
        this.getFloat32(),
        this.getFloat32(),
        this.getFloat32(),
      );
    }
    _rUTF(t) {
      var e,
        i,
        s = this._pos_ + t,
        r = String.fromCharCode,
        a = this._u8d_,
        n = [],
        h = 0;
      for (n.length = 1e3; this._pos_ &lt; s; )
        if ((e = a[this._pos_++]) &lt; 128) 0 != e &amp;&amp; (n[h++] = r(e));
        else if (e &lt; 224) n[h++] = r(((63 &amp; e) &lt;&lt; 6) | (127 &amp; a[this._pos_++]));
        else if (e &lt; 240)
          (i = a[this._pos_++]),
            (n[h++] = r(
              ((31 &amp; e) &lt;&lt; 12) | ((127 &amp; i) &lt;&lt; 6) | (127 &amp; a[this._pos_++]),
            ));
        else {
          const t =
            ((15 &amp; e) &lt;&lt; 18) |
            ((127 &amp; (i = a[this._pos_++])) &lt;&lt; 12) |
            ((127 &amp; a[this._pos_++]) &lt;&lt; 6) |
            (127 &amp; a[this._pos_++]);
          if (t &gt;= 65536) {
            const e = t - 65536,
              i = 55296 | (e &gt;&gt; 10),
              s = 56320 | (1023 &amp; e);
            (n[h++] = r(i)), (n[h++] = r(s));
          } else n[h++] = r(t);
        }
      return (n.length = h), n.join("");
    }
    getCustomString(t) {
      return this.readCustomString(t);
    }
    readCustomString(t) {
      for (
        var e, i = "", s = 0, r = String.fromCharCode, a = this._u8d_;
        t &gt; 0;

      )
        if ((e = a[this._pos_]) &lt; 128) (i += r(e)), this._pos_++, t--;
        else
          for (s = e - 128, this._pos_++, t -= s; s &gt; 0; )
            (e = a[this._pos_++]), (i += r((a[this._pos_++] &lt;&lt; 8) | e)), s--;
      return i;
    }
    get pos() {
      return this._pos_;
    }
    set pos(t) {
      this._pos_ = t;
    }
    get bytesAvailable() {
      return this._length - this._pos_;
    }
    clear() {
      (this._pos_ = 0), (this.length = 0);
    }
    __getBuffer() {
      return this._d_.buffer;
    }
    writeUTFBytes(t) {
      for (var e = 0, i = (t += "").length; e &lt; i; e++) {
        var s = t.charCodeAt(e);
        if (s &lt;= 127) this.writeByte(s);
        else if (s &lt;= 2047)
          this._ensureWrite(this._pos_ + 2),
            this._u8d_.set([192 | (s &gt;&gt; 6), 128 | (63 &amp; s)], this._pos_),
            (this._pos_ += 2);
        else if (s &gt;= 55296 &amp;&amp; s &lt;= 56319) {
          e++;
          const i = t.charCodeAt(e);
          if (!Number.isNaN(i) &amp;&amp; i &gt;= 56320 &amp;&amp; i &lt;= 57343) {
            const t = 64 + (1023 &amp; s),
              e = 1023 &amp; i,
              r = 240 | ((t &gt;&gt; 8) &amp; 63),
              a = 128 | ((t &gt;&gt; 2) &amp; 63),
              n = 128 | ((3 &amp; t) &lt;&lt; 4) | ((e &gt;&gt; 6) &amp; 15),
              h = 128 | (63 &amp; e);
            this._ensureWrite(this._pos_ + 4),
              this._u8d_.set([r, a, n, h], this._pos_),
              (this._pos_ += 4);
          }
        } else
          s &lt;= 65535
            ? (this._ensureWrite(this._pos_ + 3),
              this._u8d_.set(
                [224 | (s &gt;&gt; 12), 128 | ((s &gt;&gt; 6) &amp; 63), 128 | (63 &amp; s)],
                this._pos_,
              ),
              (this._pos_ += 3))
            : (this._ensureWrite(this._pos_ + 4),
              this._u8d_.set(
                [
                  240 | (s &gt;&gt; 18),
                  128 | ((s &gt;&gt; 12) &amp; 63),
                  128 | ((s &gt;&gt; 6) &amp; 63),
                  128 | (63 &amp; s),
                ],
                this._pos_,
              ),
              (this._pos_ += 4));
      }
    }
    writeUTFString(t) {
      var e = this.pos;
      this.writeUint16(1), this.writeUTFBytes(t);
      var i = this.pos - e - 2;
      this._d_.setUint16(e, i, this._xd_);
    }
    writeUTFString32(t) {
      var e = this.pos;
      this.writeUint32(1), this.writeUTFBytes(t);
      var i = this.pos - e - 4;
      this._d_.setUint32(e, i, this._xd_);
    }
    readUTFString() {
      return this.readUTFBytes(this.getUint16());
    }
    readUTFString32() {
      return this.readUTFBytes(this.getUint32());
    }
    getUTFString() {
      return this.readUTFString();
    }
    readUTFBytes(t = -1) {
      if (0 === t) return "";
      var e = this.bytesAvailable;
      if (t &gt; e) throw "readUTFBytes error - Out of bounds";
      return (t = t &gt; 0 ? t : e), this._rUTF(t);
    }
    getUTFBytes(t = -1) {
      return this.readUTFBytes(t);
    }
    writeByte(t) {
      this._ensureWrite(this._pos_ + 1),
        this._d_.setInt8(this._pos_, t),
        (this._pos_ += 1);
    }
    readByte() {
      if (this._pos_ + 1 &gt; this._length) throw "readByte error - Out of bounds";
      return this._d_.getInt8(this._pos_++);
    }
    getByte() {
      return this.readByte();
    }
    _ensureWrite(t) {
      this._length &lt; t &amp;&amp; (this._length = t),
        this._allocated_ &lt; t &amp;&amp; (this.length = t);
    }
    writeArrayBuffer(t, e = 0, i = 0) {
      if (e &lt; 0 || i &lt; 0) throw "writeArrayBuffer error - Out of bounds";
      0 == i &amp;&amp; (i = t.byteLength - e), this._ensureWrite(this._pos_ + i);
      var s = new Uint8Array(t);
      this._u8d_.set(s.subarray(e, e + i), this._pos_), (this._pos_ += i);
    }
    readArrayBuffer(t) {
      var e;
      return (
        (e = this._u8d_.buffer.slice(this._pos_, this._pos_ + t)),
        (this._pos_ = this._pos_ + t),
        e
      );
    }
  }
  (B.BIG_ENDIAN = "bigEndian"),
    (B.LITTLE_ENDIAN = "littleEndian"),
    (B._sysEndian = null),
    ((y = t.RenderTextureFormat || (t.RenderTextureFormat = {}))[
      (y.R8G8B8 = 0)
    ] = "R8G8B8"),
    (y[(y.R8G8B8A8 = 1)] = "R8G8B8A8"),
    (y[(y.Alpha8 = 2)] = "Alpha8"),
    (y[(y.R16G16B16A16 = 14)] = "R16G16B16A16"),
    (y[(y.Depth = 15)] = "Depth"),
    (y[(y.ShadowMap = 16)] = "ShadowMap"),
    ((E = t.RenderTextureDepthFormat || (t.RenderTextureDepthFormat = {}))[
      (E.DEPTH_16 = 0)
    ] = "DEPTH_16"),
    (E[(E.STENCIL_8 = 1)] = "STENCIL_8"),
    (E[(E.DEPTHSTENCIL_24_8 = 2)] = "DEPTHSTENCIL_24_8"),
    (E[(E.DEPTHSTENCIL_NONE = 3)] = "DEPTHSTENCIL_NONE"),
    (E[(E.DEPTH_32 = 4)] = "DEPTH_32"),
    (E[(E.DEPTHSTENCIL_16_8 = 2)] = "DEPTHSTENCIL_16_8"),
    ((R = t.RTDEPTHATTACHMODE || (t.RTDEPTHATTACHMODE = {}))[
      (R.RENDERBUFFER = 0)
    ] = "RENDERBUFFER"),
    (R[(R.TEXTURE = 1)] = "TEXTURE");
  class F {
    static get maxTextureCount() {
      return this._maxTextureCount;
    }
    static get maxTextureSize() {
      return this._maxTextureSize;
    }
    static get shaderCapailityLevel() {
      return this._shaderCapailityLevel;
    }
    static supportTextureFormat(e) {
      switch (e) {
        case t.TextureFormat.R32G32B32A32:
          return !(
            !g.layaGPUInstance._isWebGL2 &amp;&amp; !g.layaGPUInstance._oesTextureFloat
          );
        case t.TextureFormat.R16G16B16A16:
          return !(
            !g.layaGPUInstance._isWebGL2 &amp;&amp;
            !g.layaGPUInstance._oesTextureHalfFloat
          );
        default:
          return !0;
      }
    }
    static supportRenderTextureFormat(e) {
      switch (e) {
        case t.RenderTextureFormat.R16G16B16A16:
          return !!(
            (g.layaGPUInstance._isWebGL2 &amp;&amp;
              g.layaGPUInstance._extColorBufferFloat) ||
            (g.layaGPUInstance._oesTextureHalfFloat &amp;&amp;
              g.layaGPUInstance._oesTextureHalfFloatLinear)
          );
        case t.RenderTextureFormat.Depth:
          return !(
            !g.layaGPUInstance._isWebGL2 &amp;&amp;
            !g.layaGPUInstance._webgl_depth_texture
          );
        case t.RenderTextureFormat.ShadowMap:
          return !!g.layaGPUInstance._isWebGL2;
        default:
          return !0;
      }
    }
  }
  class O {
    static __init__() {
      for (var t = 0; t &lt; 256; ++t) {
        var e = t - 127;
        e &lt; -27
          ? ((O._baseTable[0 | t] = 0),
            (O._baseTable[256 | t] = 32768),
            (O._shiftTable[0 | t] = 24),
            (O._shiftTable[256 | t] = 24))
          : e &lt; -14
            ? ((O._baseTable[0 | t] = 1024 &gt;&gt; (-e - 14)),
              (O._baseTable[256 | t] = (1024 &gt;&gt; (-e - 14)) | 32768),
              (O._shiftTable[0 | t] = -e - 1),
              (O._shiftTable[256 | t] = -e - 1))
            : e &lt;= 15
              ? ((O._baseTable[0 | t] = (e + 15) &lt;&lt; 10),
                (O._baseTable[256 | t] = ((e + 15) &lt;&lt; 10) | 32768),
                (O._shiftTable[0 | t] = 13),
                (O._shiftTable[256 | t] = 13))
              : e &lt; 128
                ? ((O._baseTable[0 | t] = 31744),
                  (O._baseTable[256 | t] = 64512),
                  (O._shiftTable[0 | t] = 24),
                  (O._shiftTable[256 | t] = 24))
                : ((O._baseTable[0 | t] = 31744),
                  (O._baseTable[256 | t] = 64512),
                  (O._shiftTable[0 | t] = 13),
                  (O._shiftTable[256 | t] = 13));
      }
      for (O._mantissaTable[0] = 0, t = 1; t &lt; 1024; ++t) {
        var i = t &lt;&lt; 13;
        for (e = 0; 0 == (8388608 &amp; i); ) (e -= 8388608), (i &lt;&lt;= 1);
        (i &amp;= -8388609), (e += 947912704), (O._mantissaTable[t] = i | e);
      }
      for (t = 1024; t &lt; 2048; ++t)
        O._mantissaTable[t] = 939524096 + ((t - 1024) &lt;&lt; 13);
      for (O._exponentTable[0] = 0, t = 1; t &lt; 31; ++t)
        O._exponentTable[t] = t &lt;&lt; 23;
      for (
        O._exponentTable[31] = 1199570944,
          O._exponentTable[32] = 2147483648,
          t = 33;
        t &lt; 63;
        ++t
      )
        O._exponentTable[t] = 2147483648 + ((t - 32) &lt;&lt; 23);
      for (
        O._exponentTable[63] = 3347054592, O._offsetTable[0] = 0, t = 1;
        t &lt; 64;
        ++t
      )
        O._offsetTable[t] = 32 === t ? 0 : 1024;
    }
    static roundToFloat16Bits(t) {
      O._floatView[0] = t;
      var e = O._uint32View[0],
        i = (e &gt;&gt; 23) &amp; 511;
      return O._baseTable[i] + ((8388607 &amp; e) &gt;&gt; O._shiftTable[i]);
    }
    static convertToNumber(t) {
      var e = t &gt;&gt; 10;
      return (
        (O._uint32View[0] =
          O._mantissaTable[O._offsetTable[e] + (1023 &amp; t)] +
          O._exponentTable[e]),
        O._floatView[0]
      );
    }
  }
  (O._buffer = new ArrayBuffer(4)),
    (O._floatView = new Float32Array(O._buffer)),
    (O._uint32View = new Uint32Array(O._buffer)),
    (O._baseTable = new Uint32Array(512)),
    (O._shiftTable = new Uint32Array(512)),
    (O._mantissaTable = new Uint32Array(2048)),
    (O._exponentTable = new Uint32Array(64)),
    (O._offsetTable = new Uint32Array(64));
  class N extends D {
    constructor(e = 0, i = 0, s = t.TextureFormat.R8G8B8A8, r = !0, a = !1) {
      super(s, r);
      var n = g.instance;
      (this._glTextureType = n.TEXTURE_2D),
        (this._width = e),
        (this._height = i),
        (this._canRead = a),
        this._setWarpMode(n.TEXTURE_WRAP_S, this._wrapModeU),
        this._setWarpMode(n.TEXTURE_WRAP_T, this._wrapModeV),
        this._setFilterMode(this._filterMode),
        this._setAnisotropy(this._anisoLevel);
      var h = this._gpuCompressFormat();
      if (r) {
        var o = Math.max(
          Math.ceil(Math.log2(e)) + 1,
          Math.ceil(Math.log2(i)) + 1,
        );
        if (!h)
          for (var l = 0; l &lt; o; l++)
            this._setPixels(null, l, Math.max(e &gt;&gt; l, 1), Math.max(i &gt;&gt; l, 1));
        (this._mipmapCount = o), this._setGPUMemory(e * i * 4 * (1 + 1 / 3));
      } else
        h || this._setPixels(null, 0, e, i),
          (this._mipmapCount = 1),
          this._setGPUMemory(e * i * 4);
    }
    static __init__() {
      var e = new Uint8Array(3);
      (e[0] = 128),
        (e[1] = 128),
        (e[2] = 128),
        (N.grayTexture = new N(1, 1, t.TextureFormat.R8G8B8, !1, !1)),
        N.grayTexture.setPixels(e),
        (N.grayTexture.lock = !0),
        (e[0] = 255),
        (e[1] = 255),
        (e[2] = 255),
        (N.whiteTexture = new N(1, 1, t.TextureFormat.R8G8B8, !1, !1)),
        N.whiteTexture.setPixels(e),
        (N.whiteTexture.lock = !0),
        (e[0] = 0),
        (e[1] = 0),
        (e[2] = 0),
        (N.blackTexture = new N(1, 1, t.TextureFormat.R8G8B8, !1, !1)),
        N.blackTexture.setPixels(e),
        (N.blackTexture.lock = !0),
        (N.erroTextur = N.whiteTexture);
    }
    static _parse(e, i = null, s = null) {
      var r = s ? new N(s[0], s[1], s[2], s[3], s[4]) : new N(0, 0);
      switch (
        (i &amp;&amp;
          ((r.wrapModeU = i.wrapModeU),
          (r.wrapModeV = i.wrapModeV),
          (r.filterMode = i.filterMode),
          (r.anisoLevel = i.anisoLevel)),
        r._format)
      ) {
        case t.TextureFormat.R8G8B8:
        case t.TextureFormat.R8G8B8A8:
          r.loadImageSource(e);
          break;
        case t.TextureFormat.DXT1:
        case t.TextureFormat.DXT5:
        case t.TextureFormat.ETC1RGB:
        case t.TextureFormat.PVRTCRGB_2BPPV:
        case t.TextureFormat.PVRTCRGBA_2BPPV:
        case t.TextureFormat.PVRTCRGB_4BPPV:
        case t.TextureFormat.PVRTCRGBA_4BPPV:
        case t.TextureFormat.ETC2RGB:
        case t.TextureFormat.ETC2RGBA:
        case t.TextureFormat.ETC2SRGB:
        case t.TextureFormat.ASTC4x4:
        case t.TextureFormat.ASTC6x6:
        case t.TextureFormat.ASTC8x8:
        case t.TextureFormat.ASTC10x10:
        case t.TextureFormat.ASTC12x12:
        case t.TextureFormat.KTXTEXTURE:
        case t.TextureFormat.PVRTEXTURE:
          r.setCompressData(e);
          break;
        default:
          throw "Texture2D:unkonwn format.";
      }
      return r;
    }
    static _SimpleAnimatorTextureParse(e, i = null, s = null) {
      var r,
        a,
        n = new B(e);
      switch (n.readUTFString()) {
        case "LAYAANIMATORTEXTURE:0000":
          var h,
            o = n.readInt32(),
            l = n.readInt32();
          (r = new Float32Array(o * o * 4)),
            (a = new Float32Array(n.readArrayBuffer(4 * l))),
            r.set(a, 0),
            (h = new N(o, o, t.TextureFormat.R32G32B32A32, !1, !1)).setPixels(
              r,
              0,
            ),
            (h.filterMode = t.FilterMode.Point);
          break;
        case "LAYACOMPRESSANIMATORTEXTURE:0000":
          (o = n.readInt32()), (l = n.readInt32());
          if (
            ((r = new Uint16Array(n.readArrayBuffer(2 * l))),
            F.supportTextureFormat(t.TextureFormat.R16G16B16A16))
          )
            (a = new Uint16Array(o * o * 4)).set(r, 0),
              (h = new N(o, o, t.TextureFormat.R16G16B16A16, !1, !1)).setPixels(
                a,
                0,
              ),
              (h.filterMode = t.FilterMode.Point);
          else {
            console.log(
              "The platform does not support 16-bit floating-point textures",
            ),
              F.supportTextureFormat(t.TextureFormat.R32G32B32A32) ||
                console.error(
                  "The platform does not support 32-bit floating-point textures",
                ),
              (a = new Float32Array(o * o * 4));
            for (var _ = 0, u = r.length; _ &lt; u; _++)
              a[_] = O.convertToNumber(r[_]);
            (h = new N(o, o, t.TextureFormat.R32G32B32A32, !1, !1)).setPixels(
              a,
              0,
            ),
              (h.filterMode = t.FilterMode.Point);
          }
          break;
        default:
          throw "Laya3D:unknow version.";
      }
      return h;
    }
    static load(t, e) {
      i.loader.create(t, e, null, i.Loader.TEXTURE2D);
    }
    get defaulteTexture() {
      return N.grayTexture;
    }
    _gpuCompressFormat() {
      return (
        this._format != t.TextureFormat.R8G8B8A8 &amp;&amp;
        this._format != t.TextureFormat.R8G8B8 &amp;&amp;
        this._format != t.TextureFormat.R16G16B16A16 &amp;&amp;
        this._format != t.TextureFormat.R32G32B32A32 &amp;&amp;
        this._format != t.TextureFormat.R5G6B5 &amp;&amp;
        this._format != t.TextureFormat.Alpha8
      );
    }
    _setPixels(e, i, s, r) {
      var a = g.instance,
        n = this._glTextureType,
        h = this._getGLFormat();
      switch ((b.bindTexture(a, n, this._glTexture), this.format)) {
        case t.TextureFormat.R8G8B8:
        case t.TextureFormat.R8G8B8A8:
          a.pixelStorei(a.UNPACK_ALIGNMENT, 1),
            a.texImage2D(n, i, h, s, r, 0, h, a.UNSIGNED_BYTE, e),
            a.pixelStorei(a.UNPACK_ALIGNMENT, 4);
          break;
        case t.TextureFormat.R5G6B5:
          a.pixelStorei(a.UNPACK_ALIGNMENT, 2),
            a.texImage2D(n, i, h, s, r, 0, h, a.UNSIGNED_SHORT_5_6_5, e),
            a.pixelStorei(a.UNPACK_ALIGNMENT, 4);
          break;
        case t.TextureFormat.R32G32B32A32:
          g.layaGPUInstance._isWebGL2
            ? a.texImage2D(n, i, a.RGBA32F, s, r, 0, h, a.FLOAT, e)
            : a.texImage2D(n, i, a.RGBA, s, r, 0, h, a.FLOAT, e);
          break;
        case t.TextureFormat.R16G16B16A16:
          g.layaGPUInstance._isWebGL2
            ? a.texImage2D(n, i, a.RGBA16F, s, r, 0, h, a.HALF_FLOAT, e)
            : a.texImage2D(
                n,
                i,
                a.RGBA,
                s,
                r,
                0,
                h,
                g.layaGPUInstance._oesTextureHalfFloat.HALF_FLOAT_OES,
                e,
              );
          break;
        default:
          a.texImage2D(n, i, h, s, r, 0, h, a.UNSIGNED_BYTE, e);
      }
    }
    _calcualatesCompressedDataSize(e, i, s) {
      switch (e) {
        case t.TextureFormat.DXT1:
          return ((i + 3) &gt;&gt; 2) * ((s + 3) &gt;&gt; 2) * 8;
        case t.TextureFormat.DXT5:
          return ((i + 3) &gt;&gt; 2) * ((s + 3) &gt;&gt; 2) * 16;
        case t.TextureFormat.PVRTCRGB_4BPPV:
        case t.TextureFormat.PVRTCRGBA_4BPPV:
          return Math.floor((Math.max(i, 8) * Math.max(s, 8) * 4 + 7) / 8);
        case t.TextureFormat.PVRTCRGB_2BPPV:
        case t.TextureFormat.PVRTCRGBA_2BPPV:
          return Math.floor((Math.max(i, 16) * Math.max(s, 8) * 2 + 7) / 8);
        default:
          return 0;
      }
    }
    _pharseDDS(e) {
      var i = new Int32Array(e, 0, 31);
      if (542327876 != i[0]) throw "Invalid magic number in DDS header";
      if (!(4 &amp; i[20])) throw "Unsupported format, must contain a FourCC code";
      var s = i[21];
      switch (this._format) {
        case t.TextureFormat.DXT1:
          if (827611204 !== s)
            throw "the FourCC code is not same with texture format.";
          break;
        case t.TextureFormat.DXT5:
          if (894720068 !== s)
            throw "the FourCC code is not same with texture format.";
          break;
        default:
          throw "unknown texture format.";
      }
      var r = 1;
      if (131072 &amp; i[2]) {
        if (((r = Math.max(1, i[7])), !this._mipmap))
          throw "the mipmap is not same with Texture2D.";
      } else if (this._mipmap) throw "the mipmap is not same with Texture2D.";
      var a = i[4],
        n = i[3];
      (this._width = a), (this._height = n);
      var h = i[1] + 4;
      this._upLoadCompressedTexImage2D(e, a, n, r, h, 0);
    }
    _pharseKTX(e) {
      var i = new Uint8Array(e, 0, 12);
      if (
        171 != i[0] ||
        75 != i[1] ||
        84 != i[2] ||
        88 != i[3] ||
        32 != i[4] ||
        49 != i[5] ||
        49 != i[6] ||
        187 != i[7] ||
        13 != i[8] ||
        10 != i[9] ||
        26 != i[10] ||
        10 != i[11]
      )
        throw "Invalid fileIdentifier in KTX header";
      var s = new Int32Array(i.buffer, i.length, 13),
        r = s[4];
      if (((this._format = -1), g.layaGPUInstance._compressedTextureASTC))
        switch (r) {
          case g.layaGPUInstance._compressedTextureASTC
            .COMPRESSED_RGBA_ASTC_4x4_KHR:
            this._format = t.TextureFormat.ASTC4x4;
            break;
          case g.layaGPUInstance._compressedTextureASTC
            .COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:
            this._format = t.TextureFormat.ASTC4x4SRGB;
            break;
          case g.layaGPUInstance._compressedTextureASTC
            .COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:
            this._format = t.TextureFormat.ASTC6x6SRGB;
            break;
          case g.layaGPUInstance._compressedTextureASTC
            .COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:
            this._format = t.TextureFormat.ASTC8x8SRGB;
            break;
          case g.layaGPUInstance._compressedTextureASTC
            .COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:
            this._format = t.TextureFormat.ASTC10x10SRGB;
            break;
          case g.layaGPUInstance._compressedTextureASTC
            .COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:
            this._format = t.TextureFormat.ASTC12x12SRGB;
            break;
          case g.layaGPUInstance._compressedTextureASTC
            .COMPRESSED_RGBA_ASTC_6x6_KHR:
            this._format = t.TextureFormat.ASTC6x6;
            break;
          case g.layaGPUInstance._compressedTextureASTC
            .COMPRESSED_RGBA_ASTC_8x8_KHR:
            this._format = t.TextureFormat.ASTC8x8;
            break;
          case g.layaGPUInstance._compressedTextureASTC
            .COMPRESSED_RGBA_ASTC_10x10_KHR:
            this._format = t.TextureFormat.ASTC10x10;
            break;
          case g.layaGPUInstance._compressedTextureASTC
            .COMPRESSED_RGBA_ASTC_12x12_KHR:
            this._format = t.TextureFormat.ASTC12x12;
        }
      if (g.layaGPUInstance._compressedTextureEtc1)
        switch (r) {
          case g.layaGPUInstance._compressedTextureEtc1
            .COMPRESSED_RGB_ETC1_WEBGL:
            this._format = t.TextureFormat.ETC1RGB;
        }
      if (g.layaGPUInstance._compressedTextureETC)
        switch (r) {
          case g.layaGPUInstance._compressedTextureETC
            .COMPRESSED_RGBA8_ETC2_EAC:
            this._format = t.TextureFormat.ETC2RGBA;
            break;
          case g.layaGPUInstance._compressedTextureETC.COMPRESSED_RGB8_ETC2:
            this._format = t.TextureFormat.ETC2RGB;
            break;
          case g.layaGPUInstance._compressedTextureETC
            .COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:
            this._format = t.TextureFormat.ETC2RGB_Alpha8;
            break;
          case g.layaGPUInstance._compressedTextureETC.COMPRESSED_SRGB8_ETC2:
            this._format = t.TextureFormat.ETC2SRGB;
        }
      if (-1 == this._format) throw "unknown texture format.";
      var a = s[11],
        n = s[6],
        h = s[7];
      (this._width = n), (this._height = h);
      var o = 64 + s[12];
      this._upLoadKTXCompressedTexImage2D(e, n, h, a, o, 4);
    }
    _pharsePVR(e) {
      var i = new Int32Array(e, 0, 13);
      if (55727696 != i[0]) throw "Invalid magic number in PVR header";
      switch (i[2]) {
        case 0:
          this._format = t.TextureFormat.PVRTCRGB_2BPPV;
          break;
        case 2:
          this._format = t.TextureFormat.PVRTCRGB_4BPPV;
          break;
        case 1:
          this._format = t.TextureFormat.PVRTCRGBA_2BPPV;
          break;
        case 3:
          this._format = t.TextureFormat.PVRTCRGBA_4BPPV;
          break;
        default:
          throw "Texture2D:unknown PVR format.";
      }
      var s = i[11],
        r = i[7],
        a = i[6];
      (this._width = r), (this._height = a);
      var n = i[12] + 52;
      this._upLoadCompressedTexImage2D(e, r, a, s, n, 0);
    }
    _upLoadCompressedTexImage2D(t, e, i, s, r, a) {
      var n = g.instance,
        h = this._glTextureType;
      b.bindTexture(n, h, this._glTexture);
      for (var o = this._getGLFormat(), l = r, _ = 0; _ &lt; s; _++) {
        l += a;
        var u = this._calcualatesCompressedDataSize(this._format, e, i),
          c = new Uint8Array(t, l, u);
        n.compressedTexImage2D(h, _, o, e, i, 0, c),
          (e = Math.max(e &gt;&gt; 1, 1)),
          (i = Math.max(i &gt;&gt; 1, 1)),
          (l += u);
      }
      var d = l;
      this._setGPUMemory(d), (this._readyed = !0), this._activeResource();
    }
    _upLoadKTXCompressedTexImage2D(t, e, i, s, r, a) {
      var n = g.instance,
        h = this._glTextureType;
      b.bindTexture(n, h, this._glTexture);
      for (var o = this._getGLFormat(), l = r, _ = 0; _ &lt; s; _++) {
        var u = new Int32Array(t, l, 1)[0];
        l += a;
        var c = new Uint8Array(t, l, u);
        n.compressedTexImage2D(h, _, o, e, i, 0, c),
          (e = Math.max(e &gt;&gt; 1, 1)),
          (i = Math.max(i &gt;&gt; 1, 1)),
          (l += u),
          (l += 3 - ((u + 3) % 4));
      }
      var d = l;
      this._setGPUMemory(d), (this._readyed = !0), this._activeResource();
    }
    loadImageSource(e, s = !1) {
      var r = g.instance,
        a = e.width,
        n = e.height;
      (this._width = a),
        (this._height = n),
        (this._isPot(a) &amp;&amp; this._isPot(n)) || (this._mipmap = !1),
        this._setWarpMode(r.TEXTURE_WRAP_S, this._wrapModeU),
        this._setWarpMode(r.TEXTURE_WRAP_T, this._wrapModeV),
        this._setFilterMode(this._filterMode),
        b.bindTexture(r, this._glTextureType, this._glTexture);
      var h = this._getGLFormat();
      i.Render.isConchApp
        ? (e.setPremultiplyAlpha &amp;&amp; e.setPremultiplyAlpha(s),
          r.texImage2D(
            this._glTextureType,
            0,
            r.RGBA,
            r.RGBA,
            r.UNSIGNED_BYTE,
            e,
          ))
        : (s &amp;&amp; r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0),
          this.format == t.TextureFormat.R5G6B5
            ? r.texImage2D(
                this._glTextureType,
                0,
                r.RGB,
                r.RGB,
                r.UNSIGNED_SHORT_5_6_5,
                e,
              )
            : r.texImage2D(this._glTextureType, 0, h, h, r.UNSIGNED_BYTE, e),
          s &amp;&amp; r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1)),
        this._mipmap
          ? (r.generateMipmap(this._glTextureType),
            this._setGPUMemory(a * n * 4 * (1 + 1 / 3)))
          : this._setGPUMemory(a * n * 4),
        this._canRead &amp;&amp;
          (i.Render.isConchApp &amp;&amp; e._nativeObj
            ? (this._pixels = new Uint8Array(
                e._nativeObj.getImageData(0, 0, a, n),
              ))
            : (i.Browser.canvas.size(a, n),
              i.Browser.canvas.clear(),
              i.Browser.context.drawImage(e, 0, 0, a, n),
              (this._pixels = new Uint8Array(
                i.Browser.context.getImageData(0, 0, a, n).data.buffer,
              )))),
        (this._readyed = !0),
        this._activeResource();
    }
    setPixels(t, e = 0) {
      if (this._gpuCompressFormat())
        throw "Texture2D:the format is GPU compression format.";
      if (!t) throw "Texture2D:pixels can't be null.";
      var i = Math.max(this._width &gt;&gt; e, 1),
        s = Math.max(this._height &gt;&gt; e, 1),
        r = i * s * this._getFormatByteCount();
      if (t.length &lt; r)
        throw "Texture2D:pixels length should at least " + r + ".";
      this._setPixels(t, e, i, s),
        this._canRead &amp;&amp; (this._pixels = t),
        (this._readyed = !0),
        this._activeResource();
    }
    setSubPixels(e, i, s, r, a, n = 0) {
      if (this._gpuCompressFormat())
        throw "Texture2D:the format is GPU compression format.";
      if (!a) throw "Texture2D:pixels can't be null.";
      var h = g.instance,
        o = this._glTextureType;
      b.bindTexture(h, o, this._glTexture);
      var l = this._getGLFormat();
      switch (this.format) {
        case t.TextureFormat.R8G8B8:
          h.pixelStorei(h.UNPACK_ALIGNMENT, 1),
            h.texSubImage2D(o, n, e, i, s, r, l, h.UNSIGNED_BYTE, a),
            h.pixelStorei(h.UNPACK_ALIGNMENT, 4);
          break;
        case t.TextureFormat.R5G6B5:
          h.pixelStorei(h.UNPACK_ALIGNMENT, 2),
            h.texSubImage2D(o, n, e, i, s, r, l, h.UNSIGNED_SHORT_5_6_5, a),
            h.pixelStorei(h.UNPACK_ALIGNMENT, 4);
          break;
        case t.TextureFormat.R32G32B32A32:
          h.texSubImage2D(o, n, e, i, s, r, l, h.FLOAT, a);
          break;
        default:
          h.texSubImage2D(o, n, e, i, s, r, l, h.UNSIGNED_BYTE, a);
      }
      (this._readyed = !0), this._activeResource();
    }
    setCompressData(e) {
      switch (this._format) {
        case t.TextureFormat.DXT1:
        case t.TextureFormat.DXT5:
          this._pharseDDS(e);
          break;
        case t.TextureFormat.ETC1RGB:
        case t.TextureFormat.ETC2RGB:
        case t.TextureFormat.ETC2RGBA:
        case t.TextureFormat.ETC2RGB_Alpha8:
        case t.TextureFormat.ETC2SRGB:
        case t.TextureFormat.ASTC4x4:
        case t.TextureFormat.ASTC4x4SRGB:
        case t.TextureFormat.ASTC6x6:
        case t.TextureFormat.ASTC6x6SRGB:
        case t.TextureFormat.ASTC8x8:
        case t.TextureFormat.ASTC8x8SRGB:
        case t.TextureFormat.ASTC10x10:
        case t.TextureFormat.ASTC10x10SRGB:
        case t.TextureFormat.ASTC12x12:
        case t.TextureFormat.ASTC12x12SRGB:
        case t.TextureFormat.KTXTEXTURE:
          this._pharseKTX(e);
          break;
        case t.TextureFormat.PVRTCRGB_2BPPV:
        case t.TextureFormat.PVRTCRGBA_2BPPV:
        case t.TextureFormat.PVRTCRGB_4BPPV:
        case t.TextureFormat.PVRTCRGBA_4BPPV:
        case t.TextureFormat.PVRTEXTURE:
          this._pharsePVR(e);
          break;
        default:
          throw "Texture2D:unkonwn format.";
      }
      1 == this.mipmapCount ||
      (this.width != 1 &lt;&lt; (this.mipmapCount - 1) &amp;&amp;
        this.height != 1 &lt;&lt; this.mipmapCount)
        ? (this._mipmap = !1)
        : (this._mipmap = !0);
      let i = g.instance;
      this._setWarpMode(i.TEXTURE_WRAP_S, this._wrapModeU),
        this._setWarpMode(i.TEXTURE_WRAP_T, this._wrapModeV),
        this._setFilterMode(this._filterMode);
    }
    getPixels() {
      if (this._canRead) return this._pixels;
      throw new Error("Texture2D: must set texture canRead is true.");
    }
  }
  (N.TEXTURE2D = "TEXTURE2D"),
    (N.grayTexture = null),
    (N.whiteTexture = null),
    (N.blackTexture = null),
    (N.erroTextur = null);
  class U extends P {
    constructor() {
      super();
    }
  }
  class G {
    static mat2MatArray(t, e) {
      var i = t,
        s = e;
      return (
        (s[0] = i.a),
        (s[1] = i.b),
        (s[2] = G.EMPTYMAT4_ARRAY[2]),
        (s[3] = G.EMPTYMAT4_ARRAY[3]),
        (s[4] = i.c),
        (s[5] = i.d),
        (s[6] = G.EMPTYMAT4_ARRAY[6]),
        (s[7] = G.EMPTYMAT4_ARRAY[7]),
        (s[8] = G.EMPTYMAT4_ARRAY[8]),
        (s[9] = G.EMPTYMAT4_ARRAY[9]),
        (s[10] = G.EMPTYMAT4_ARRAY[10]),
        (s[11] = G.EMPTYMAT4_ARRAY[11]),
        (s[12] = i.tx),
        (s[13] = i.ty),
        (s[14] = G.EMPTYMAT4_ARRAY[14]),
        (s[15] = G.EMPTYMAT4_ARRAY[15]),
        e
      );
    }
    static restoreTempArray() {
      (G.TEMPMAT4_ARRAY[0] = 1),
        (G.TEMPMAT4_ARRAY[1] = 0),
        (G.TEMPMAT4_ARRAY[4] = 0),
        (G.TEMPMAT4_ARRAY[5] = 1),
        (G.TEMPMAT4_ARRAY[12] = 0),
        (G.TEMPMAT4_ARRAY[13] = 0);
    }
    static clear() {
      (G.worldScissorTest = !1), (G.worldAlpha = 1);
    }
  }
  (G._MAXSIZE = 99999999),
    (G.EMPTYMAT4_ARRAY = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
    (G.TEMPMAT4_ARRAY = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
    (G.worldMatrix4 = G.TEMPMAT4_ARRAY),
    (G.worldMatrix = new p()),
    (G.matWVP = null),
    (G.worldAlpha = 1),
    (G.worldScissorTest = !1),
    (G.width = 0),
    (G.height = 0);
  class k extends D {
    constructor(
      e,
      i,
      s = t.RenderTextureFormat.R8G8B8,
      r = t.RenderTextureDepthFormat.DEPTH_16,
    ) {
      super(s, !1),
        (this._mgrKey = 0),
        (this._glTextureType = g.instance.TEXTURE_2D),
        (this._width = e),
        (this._height = i),
        (this._depthStencilFormat = r),
        this._create(e, i),
        (this.lock = !0);
    }
    static get currentActive() {
      return k._currentActive;
    }
    get depthStencilFormat() {
      return this._depthStencilFormat;
    }
    get defaulteTexture() {
      return N.grayTexture;
    }
    getIsReady() {
      return !0;
    }
    get sourceWidth() {
      return this._width;
    }
    get sourceHeight() {
      return this._height;
    }
    get offsetX() {
      return 0;
    }
    get offsetY() {
      return 0;
    }
    _create(e, i) {
      var s = g.instance;
      (this._frameBuffer = s.createFramebuffer()),
        b.bindTexture(s, this._glTextureType, this._glTexture);
      var r = this._getGLFormat();
      if (
        (s.texImage2D(
          this._glTextureType,
          0,
          r,
          e,
          i,
          0,
          r,
          s.UNSIGNED_BYTE,
          null,
        ),
        this._setGPUMemory(e * i * 4),
        s.bindFramebuffer(s.FRAMEBUFFER, this._frameBuffer),
        s.framebufferTexture2D(
          s.FRAMEBUFFER,
          s.COLOR_ATTACHMENT0,
          s.TEXTURE_2D,
          this._glTexture,
          0,
        ),
        this._depthStencilFormat !==
          t.RenderTextureDepthFormat.DEPTHSTENCIL_NONE)
      )
        switch (
          ((this._depthStencilBuffer = s.createRenderbuffer()),
          s.bindRenderbuffer(s.RENDERBUFFER, this._depthStencilBuffer),
          this._depthStencilFormat)
        ) {
          case t.RenderTextureDepthFormat.DEPTH_16:
            s.renderbufferStorage(s.RENDERBUFFER, s.DEPTH_COMPONENT16, e, i),
              s.framebufferRenderbuffer(
                s.FRAMEBUFFER,
                s.DEPTH_ATTACHMENT,
                s.RENDERBUFFER,
                this._depthStencilBuffer,
              );
            break;
          case t.RenderTextureDepthFormat.STENCIL_8:
            s.renderbufferStorage(s.RENDERBUFFER, s.STENCIL_INDEX8, e, i),
              s.framebufferRenderbuffer(
                s.FRAMEBUFFER,
                s.STENCIL_ATTACHMENT,
                s.RENDERBUFFER,
                this._depthStencilBuffer,
              );
            break;
          case t.RenderTextureDepthFormat.DEPTHSTENCIL_24_8:
            s.renderbufferStorage(s.RENDERBUFFER, s.DEPTH_STENCIL, e, i),
              s.framebufferRenderbuffer(
                s.FRAMEBUFFER,
                s.DEPTH_STENCIL_ATTACHMENT,
                s.RENDERBUFFER,
                this._depthStencilBuffer,
              );
        }
      s.bindFramebuffer(s.FRAMEBUFFER, null),
        s.bindRenderbuffer(s.RENDERBUFFER, null),
        this._setWarpMode(s.TEXTURE_WRAP_S, this._wrapModeU),
        this._setWarpMode(s.TEXTURE_WRAP_T, this._wrapModeV),
        this._setFilterMode(this._filterMode),
        this._setAnisotropy(this._anisoLevel),
        (this._readyed = !0),
        this._activeResource();
    }
    generateMipmap() {
      this._isPot(this.width) &amp;&amp; this._isPot(this.height)
        ? ((this._mipmap = !0),
          g.instance.generateMipmap(this._glTextureType),
          this._setFilterMode(this._filterMode),
          this._setGPUMemory(this.width * this.height * 4 * (1 + 1 / 3)))
        : ((this._mipmap = !1),
          this._setGPUMemory(this.width * this.height * 4));
    }
    static pushRT() {
      k.rtStack.push({ rt: k._currentActive, w: G.width, h: G.height });
    }
    static popRT() {
      var t = g.instance,
        e = k.rtStack.pop();
      e &amp;&amp;
        (k._currentActive != e.rt &amp;&amp;
          (g.instance.bindFramebuffer(
            t.FRAMEBUFFER,
            e.rt ? e.rt._frameBuffer : null,
          ),
          (k._currentActive = e.rt)),
        t.viewport(0, 0, e.w, e.h),
        (G.width = e.w),
        (G.height = e.h));
    }
    start() {
      var t = g.instance;
      g.instance.bindFramebuffer(t.FRAMEBUFFER, this._frameBuffer),
        (this._lastRT = k._currentActive),
        (k._currentActive = this),
        (this._readyed = !0),
        t.viewport(0, 0, this._width, this._height),
        (this._lastWidth = G.width),
        (this._lastHeight = G.height),
        (G.width = this._width),
        (G.height = this._height),
        (U.activeShader = null);
    }
    end() {
      var t = g.instance;
      t.bindFramebuffer(t.FRAMEBUFFER, null),
        (k._currentActive = null),
        (this._readyed = !0);
    }
    restore() {
      var t = g.instance;
      this._lastRT != k._currentActive &amp;&amp;
        (g.instance.bindFramebuffer(
          t.FRAMEBUFFER,
          this._lastRT ? this._lastRT._frameBuffer : null,
        ),
        (k._currentActive = this._lastRT)),
        (this._readyed = !0),
        t.viewport(0, 0, this._lastWidth, this._lastHeight),
        (G.width = this._lastWidth),
        (G.height = this._lastHeight),
        (U.activeShader = null);
    }
    clear(t = 0, e = 0, i = 0, s = 1) {
      var r = g.instance;
      r.clearColor(t, e, i, s);
      var a = r.COLOR_BUFFER_BIT;
      switch (this._depthStencilFormat) {
        case r.DEPTH_COMPONENT16:
          a |= r.DEPTH_BUFFER_BIT;
          break;
        case r.STENCIL_INDEX8:
          a |= r.STENCIL_BUFFER_BIT;
          break;
        case r.DEPTH_STENCIL:
          (a |= r.DEPTH_BUFFER_BIT), (a |= r.STENCIL_BUFFER_BIT);
      }
      r.clear(a);
    }
    getData(t, e, s, r) {
      if (i.Render.isConchApp &amp;&amp; 2 == window.conchConfig.threadMode)
        throw "native 2 thread mode use getDataAsync";
      var a = g.instance;
      if (
        (a.bindFramebuffer(a.FRAMEBUFFER, this._frameBuffer),
        !(a.checkFramebufferStatus(a.FRAMEBUFFER) === a.FRAMEBUFFER_COMPLETE))
      )
        return a.bindFramebuffer(a.FRAMEBUFFER, null), null;
      var n = new Uint8Array(this._width * this._height * 4),
        h = this._getGLFormat();
      return (
        a.readPixels(t, e, s, r, h, a.UNSIGNED_BYTE, n),
        a.bindFramebuffer(a.FRAMEBUFFER, null),
        n
      );
    }
    getDataAsync(t, e, i, s, r) {
      var a = g.instance;
      a.bindFramebuffer(a.FRAMEBUFFER, this._frameBuffer),
        a.readPixelsAsync(t, e, i, s, a.RGBA, a.UNSIGNED_BYTE, function (t) {
          r(new Uint8Array(t));
        }),
        a.bindFramebuffer(a.FRAMEBUFFER, null);
    }
    recycle() {}
    _disposeResource() {
      if (this._frameBuffer) {
        var t = g.instance;
        t.deleteTexture(this._glTexture),
          t.deleteFramebuffer(this._frameBuffer),
          t.deleteRenderbuffer(this._depthStencilBuffer),
          (this._glTexture = null),
          (this._frameBuffer = null),
          (this._depthStencilBuffer = null),
          this._setGPUMemory(0);
      }
    }
  }
  (k.rtStack = []),
    (k.defuv = [0, 0, 1, 0, 1, 1, 0, 1]),
    (k.flipyuv = [0, 1, 1, 1, 1, 0, 0, 0]);
  class W {
    static getRT(e, i) {
      return (
        (i |= 0),
        (e |= 0) &gt;= 1e4 &amp;&amp; console.error("getRT error! w too big"),
        new k(e, i, t.RenderTextureFormat.R8G8B8A8, -1)
      );
    }
    static releaseRT(t) {
      t.destroy();
    }
  }
  W.dict = {};
  class Y {
    static _init_(t) {
      (Y.fns = [
        Y.BlendNormal,
        Y.BlendAdd,
        Y.BlendMultiply,
        Y.BlendScreen,
        Y.BlendOverlay,
        Y.BlendLight,
        Y.BlendMask,
        Y.BlendDestinationOut,
        Y.BlendAddOld,
      ]),
        (Y.targetFns = [
          Y.BlendNormalTarget,
          Y.BlendAddTarget,
          Y.BlendMultiplyTarget,
          Y.BlendScreenTarget,
          Y.BlendOverlayTarget,
          Y.BlendLightTarget,
          Y.BlendMask,
          Y.BlendDestinationOut,
          Y.BlendAddTargetOld,
        ]);
    }
    static BlendNormal(t) {
      b.setBlendFunc(t, t.ONE, t.ONE_MINUS_SRC_ALPHA, !0);
    }
    static BlendAddOld(t) {
      b.setBlendFunc(t, t.ONE, t.DST_ALPHA, !0);
    }
    static BlendAdd(t) {
      b.setBlendFunc(t, t.ONE, t.ONE, !0);
    }
    static BlendMultiply(t) {
      b.setBlendFunc(t, t.DST_COLOR, t.ONE_MINUS_SRC_ALPHA, !0);
    }
    static BlendScreen(t) {
      b.setBlendFunc(t, t.ONE, t.ONE, !0);
    }
    static BlendOverlay(t) {
      b.setBlendFunc(t, t.ONE, t.ONE_MINUS_SRC_COLOR, !0);
    }
    static BlendLight(t) {
      b.setBlendFunc(t, t.ONE, t.ONE, !0);
    }
    static BlendNormalTarget(t) {
      b.setBlendFunc(t, t.ONE, t.ONE_MINUS_SRC_ALPHA, !0);
    }
    static BlendAddTargetOld(t) {
      b.setBlendFunc(t, t.ONE, t.DST_ALPHA, !0);
    }
    static BlendAddTarget(t) {
      b.setBlendFunc(t, t.ONE, t.ONE, !0);
    }
    static BlendMultiplyTarget(t) {
      b.setBlendFunc(t, t.DST_COLOR, t.ONE_MINUS_SRC_ALPHA, !0);
    }
    static BlendScreenTarget(t) {
      b.setBlendFunc(t, t.ONE, t.ONE, !0);
    }
    static BlendOverlayTarget(t) {
      b.setBlendFunc(t, t.ONE, t.ONE_MINUS_SRC_COLOR, !0);
    }
    static BlendLightTarget(t) {
      b.setBlendFunc(t, t.ONE, t.ONE, !0);
    }
    static BlendMask(t) {
      b.setBlendFunc(t, t.ZERO, t.SRC_ALPHA, !0);
    }
    static BlendDestinationOut(t) {
      b.setBlendFunc(t, t.ZERO, t.ZERO, !0);
    }
  }
  (Y.activeBlendFunction = null),
    (Y.NAMES = [
      "normal",
      "add",
      "multiply",
      "screen",
      "overlay",
      "light",
      "mask",
      "destination-out",
      "add_old",
    ]),
    (Y.TOINT = {
      normal: 0,
      add: 1,
      multiply: 2,
      screen: 3,
      overlay: 4,
      light: 5,
      mask: 6,
      "destination-out": 7,
      lighter: 1,
      lighter_old: 8,
      add_old: 8,
    }),
    (Y.NORMAL = "normal"),
    (Y.MASK = "mask"),
    (Y.LIGHTER = "lighter");
  class V {
    constructor(t, e, i) {
      (this._value = 0),
        (this._name2int = t),
        (this._int2name = e),
        (this._int2nameMap = i);
    }
    add(t) {
      return (
        (this._value |= "string" == typeof t ? this._name2int[t] : t),
        this._value
      );
    }
    addInt(t) {
      return (this._value |= t), this._value;
    }
    remove(t) {
      return (
        (this._value &amp;= "string" == typeof t ? ~this._name2int[t] : ~t),
        this._value
      );
    }
    isDefine(t) {
      return (this._value &amp; t) === t;
    }
    getValue() {
      return this._value;
    }
    setValue(t) {
      this._value = t;
    }
    toNameDic() {
      var t = this._int2nameMap[this._value];
      return t || V._toText(this._value, this._int2name, this._int2nameMap);
    }
    static _reg(t, e, i, s) {
      (i[t] = e), (s[e] = t);
    }
    static _toText(t, e, i) {
      var s = i[t];
      if (s) return s;
      for (var r = {}, a = 1, n = 0; n &lt; 32 &amp;&amp; !((a = 1 &lt;&lt; n) &gt; t); n++)
        if (t &amp; a) {
          var h = e[a];
          h &amp;&amp; (r[h] = "");
        }
      return (i[t] = r), r;
    }
    static _toInt(t, e) {
      for (var i = t.split("."), s = 0, r = 0, a = i.length; r &lt; a; r++) {
        var n = e[i[r]];
        if (!n) throw new Error("Defines to int err:" + t + "/" + i[r]);
        s |= n;
      }
      return s;
    }
  }
  class X extends V {
    constructor() {
      super(X.__name2int, X.__int2name, X.__int2nameMap);
    }
    static __init__() {
      X.reg("TEXTURE2D", X.TEXTURE2D),
        X.reg("PRIMITIVE", X.PRIMITIVE),
        X.reg("GLOW_FILTER", X.FILTERGLOW),
        X.reg("BLUR_FILTER", X.FILTERBLUR),
        X.reg("COLOR_FILTER", X.FILTERCOLOR),
        X.reg("COLOR_ADD", X.COLORADD),
        X.reg("WORLDMAT", X.WORLDMAT),
        X.reg("FILLTEXTURE", X.FILLTEXTURE),
        X.reg("MVP3D", X.MVP3D);
    }
    static reg(t, e) {
      this._reg(t, e, X.__name2int, X.__int2name);
    }
    static toText(t, e, i) {
      return this._toText(t, e, i);
    }
    static toInt(t) {
      return this._toInt(t, X.__name2int);
    }
  }
  (X.TEXTURE2D = 1),
    (X.PRIMITIVE = 4),
    (X.FILTERGLOW = 8),
    (X.FILTERBLUR = 16),
    (X.FILTERCOLOR = 32),
    (X.COLORADD = 64),
    (X.WORLDMAT = 128),
    (X.FILLTEXTURE = 256),
    (X.SKINMESH = 512),
    (X.MVP3D = 2048),
    (X.NOOPTMASK = X.FILTERGLOW | X.FILTERBLUR | X.FILTERCOLOR | X.FILLTEXTURE),
    (X.__name2int = {}),
    (X.__int2name = []),
    (X.__int2nameMap = []);
  class H {
    static show(t = 0, e = 0) {
      H._StatRender.show(t, e);
    }
    static enable() {
      H._StatRender.enable();
    }
    static hide() {
      H._StatRender.hide();
    }
    static clear() {
      H.trianglesFaces =
        H.renderBatches =
        H.savedRenderBatches =
        H.shaderCall =
        H.spriteRenderUseCacheCount =
        H.frustumCulling =
        H.octreeNodeCulling =
        H.canvasNormal =
        H.canvasBitmap =
        H.canvasReCache =
          0;
    }
    static set onclick(t) {
      H._StatRender.set_onclick(t);
    }
  }
  (H.FPS = 0),
    (H.loopCount = 0),
    (H.shaderCall = 0),
    (H.renderBatches = 0),
    (H.savedRenderBatches = 0),
    (H.trianglesFaces = 0),
    (H.spriteCount = 0),
    (H.spriteRenderUseCacheCount = 0),
    (H.frustumCulling = 0),
    (H.octreeNodeCulling = 0),
    (H.canvasNormal = 0),
    (H.canvasBitmap = 0),
    (H.canvasReCache = 0),
    (H.renderSlow = !1),
    (H._fpsData = []),
    (H._timer = 0),
    (H._count = 0),
    (H._StatRender = null);
  class z {
    constructor() {
      (this._strsToID = {}), (this._idToStrs = []), (this._length = 0);
    }
    add(t) {
      var e = this._strsToID[t];
      return null != e
        ? e
        : ((this._idToStrs[this._length] = t),
          (this._strsToID[t] = this._length++));
    }
    getID(t) {
      var e = this._strsToID[t];
      return null == e ? -1 : e;
    }
    getName(t) {
      var e = this._idToStrs[t];
      return null == e ? void 0 : e;
    }
  }
  class K extends U {
    constructor(t, e, i = null, s = null, r = null) {
      if (
        (super(),
        (this._attribInfo = null),
        (this.customCompile = !1),
        (this._curActTexIndex = 0),
        (this.tag = {}),
        (this._program = null),
        (this._params = null),
        (this._paramsMap = {}),
        !t || !e)
      )
        throw "Shader Error";
      (this._attribInfo = r),
        (this._id = ++K._count),
        (this._vs = t),
        (this._ps = e),
        (this._nameMap = s || {}),
        null != i &amp;&amp; (K.sharders[i] = this),
        this.recreateResource(),
        (this.lock = !0);
    }
    static getShader(t) {
      return K.sharders[t];
    }
    static create(t, e, i = null, s = null, r = null) {
      return new K(t, e, i, s, r);
    }
    static withCompile(t, e, i, s) {
      if (i &amp;&amp; K.sharders[i]) return K.sharders[i];
      var r = K._preCompileShader[K.SHADERNAME2ID * t];
      if (!r) throw new Error("withCompile shader err!" + t);
      return r.createShader(e, i, s, null);
    }
    static withCompile2D(t, e, i, s, r, a = null) {
      if (s &amp;&amp; K.sharders[s]) return K.sharders[s];
      var n = K._preCompileShader[K.SHADERNAME2ID * t + e];
      if (!n) throw new Error("withCompile shader err!" + t + " " + e);
      return n.createShader(i, s, r, a);
    }
    static addInclude(t, e) {
      i.ShaderCompile.addInclude(t, e);
    }
    static preCompile(t, e, s, r) {
      var a = K.SHADERNAME2ID * t;
      K._preCompileShader[a] = new i.ShaderCompile(e, s, r);
    }
    static preCompile2D(t, e, s, r, a) {
      var n = K.SHADERNAME2ID * t + e;
      K._preCompileShader[n] = new i.ShaderCompile(s, r, a);
    }
    recreateResource() {
      this._compile(), this._setGPUMemory(0);
    }
    _disposeResource() {
      b.mainContext.deleteShader(this._vshader),
        b.mainContext.deleteShader(this._pshader),
        b.mainContext.deleteProgram(this._program),
        (this._vshader = this._pshader = this._program = null),
        (this._params = null),
        (this._paramsMap = {}),
        this._setGPUMemory(0),
        (this._curActTexIndex = 0);
    }
    _compile() {
      if (this._vs &amp;&amp; this._ps &amp;&amp; !this._params) {
        var t;
        (this._reCompile = !0),
          (this._params = []),
          this.customCompile &amp;&amp;
            (t = i.ShaderCompile.preGetParams(this._vs, this._ps));
        var e,
          s,
          r,
          a = b.mainContext;
        (this._program = a.createProgram()),
          (this._vshader = K._createShader(a, this._vs, a.VERTEX_SHADER)),
          (this._pshader = K._createShader(a, this._ps, a.FRAGMENT_SHADER)),
          a.attachShader(this._program, this._vshader),
          a.attachShader(this._program, this._pshader);
        var n = this._attribInfo ? this._attribInfo.length : 0;
        for (s = 0; s &lt; n; s += 2)
          a.bindAttribLocation(
            this._program,
            this._attribInfo[s + 1],
            this._attribInfo[s],
          );
        if (
          (a.linkProgram(this._program),
          !this.customCompile &amp;&amp;
            !a.getProgramParameter(this._program, a.LINK_STATUS))
        )
          throw a.getProgramInfoLog(this._program);
        var h = this.customCompile
          ? t.uniforms.length
          : a.getProgramParameter(this._program, a.ACTIVE_UNIFORMS);
        for (s = 0; s &lt; h; s++) {
          var o = this.customCompile
            ? t.uniforms[s]
            : a.getActiveUniform(this._program, s);
          (e = {
            vartype: "uniform",
            glfun: null,
            ivartype: 1,
            location: a.getUniformLocation(this._program, o.name),
            name: o.name,
            type: o.type,
            isArray: !1,
            isSame: !1,
            preValue: null,
            indexOfParams: 0,
          }).name.indexOf("[0]") &gt; 0 &amp;&amp;
            ((e.name = e.name.substr(0, e.name.length - 3)),
            (e.isArray = !0),
            (e.location = a.getUniformLocation(this._program, e.name))),
            this._params.push(e);
        }
        for (s = 0, r = this._params.length; s &lt; r; s++)
          switch (
            (((e = this._params[s]).indexOfParams = s),
            (e.index = 1),
            (e.value = [e.location, null]),
            (e.codename = e.name),
            (e.name = this._nameMap[e.codename]
              ? this._nameMap[e.codename]
              : e.codename),
            (this._paramsMap[e.name] = e),
            (e._this = this),
            (e.uploadedValue = []),
            e.type)
          ) {
            case a.INT:
              e.fun = e.isArray ? this._uniform1iv : this._uniform1i;
              break;
            case a.FLOAT:
              e.fun = e.isArray ? this._uniform1fv : this._uniform1f;
              break;
            case a.FLOAT_VEC2:
              e.fun = e.isArray ? this._uniform_vec2v : this._uniform_vec2;
              break;
            case a.FLOAT_VEC3:
              e.fun = e.isArray ? this._uniform_vec3v : this._uniform_vec3;
              break;
            case a.FLOAT_VEC4:
              e.fun = e.isArray ? this._uniform_vec4v : this._uniform_vec4;
              break;
            case a.SAMPLER_2D:
              e.fun = this._uniform_sampler2D;
              break;
            case a.SAMPLER_CUBE:
              e.fun = this._uniform_samplerCube;
              break;
            case a.FLOAT_MAT4:
              (e.glfun = a.uniformMatrix4fv), (e.fun = this._uniformMatrix4fv);
              break;
            case a.BOOL:
              e.fun = this._uniform1i;
              break;
            case a.FLOAT_MAT2:
            case a.FLOAT_MAT3:
            default:
              throw new Error("compile shader err!");
          }
      }
    }
    static _createShader(t, e, i) {
      var s = t.createShader(i);
      return (
        t.shaderSource(s, e),
        t.compileShader(s),
        t.getShaderParameter(s, t.COMPILE_STATUS)
          ? s
          : (console.log(t.getShaderInfoLog(s)), null)
      );
    }
    getUniform(t) {
      return this._paramsMap[t];
    }
    _uniform1f(t, e) {
      var i = t.uploadedValue;
      return i[0] !== e
        ? (b.mainContext.uniform1f(t.location, (i[0] = e)), 1)
        : 0;
    }
    _uniform1fv(t, e) {
      if (e.length &lt; 4) {
        var i = t.uploadedValue;
        return i[0] !== e[0] || i[1] !== e[1] || i[2] !== e[2] || i[3] !== e[3]
          ? (b.mainContext.uniform1fv(t.location, e),
            (i[0] = e[0]),
            (i[1] = e[1]),
            (i[2] = e[2]),
            (i[3] = e[3]),
            1)
          : 0;
      }
      return b.mainContext.uniform1fv(t.location, e), 1;
    }
    _uniform_vec2(t, e) {
      var i = t.uploadedValue;
      return i[0] !== e[0] || i[1] !== e[1]
        ? (b.mainContext.uniform2f(t.location, (i[0] = e[0]), (i[1] = e[1])), 1)
        : 0;
    }
    _uniform_vec2v(t, e) {
      if (e.length &lt; 2) {
        var i = t.uploadedValue;
        return i[0] !== e[0] || i[1] !== e[1] || i[2] !== e[2] || i[3] !== e[3]
          ? (b.mainContext.uniform2fv(t.location, e),
            (i[0] = e[0]),
            (i[1] = e[1]),
            (i[2] = e[2]),
            (i[3] = e[3]),
            1)
          : 0;
      }
      return b.mainContext.uniform2fv(t.location, e), 1;
    }
    _uniform_vec3(t, e) {
      var i = t.uploadedValue;
      return i[0] !== e[0] || i[1] !== e[1] || i[2] !== e[2]
        ? (b.mainContext.uniform3f(
            t.location,
            (i[0] = e[0]),
            (i[1] = e[1]),
            (i[2] = e[2]),
          ),
          1)
        : 0;
    }
    _uniform_vec3v(t, e) {
      return b.mainContext.uniform3fv(t.location, e), 1;
    }
    _uniform_vec4(t, e) {
      var i = t.uploadedValue;
      return i[0] !== e[0] || i[1] !== e[1] || i[2] !== e[2] || i[3] !== e[3]
        ? (b.mainContext.uniform4f(
            t.location,
            (i[0] = e[0]),
            (i[1] = e[1]),
            (i[2] = e[2]),
            (i[3] = e[3]),
          ),
          1)
        : 0;
    }
    _uniform_vec4v(t, e) {
      return b.mainContext.uniform4fv(t.location, e), 1;
    }
    _uniformMatrix2fv(t, e) {
      return b.mainContext.uniformMatrix2fv(t.location, !1, e), 1;
    }
    _uniformMatrix3fv(t, e) {
      return b.mainContext.uniformMatrix3fv(t.location, !1, e), 1;
    }
    _uniformMatrix4fv(t, e) {
      return b.mainContext.uniformMatrix4fv(t.location, !1, e), 1;
    }
    _uniform1i(t, e) {
      var i = t.uploadedValue;
      return i[0] !== e
        ? (b.mainContext.uniform1i(t.location, (i[0] = e)), 1)
        : 0;
    }
    _uniform1iv(t, e) {
      return b.mainContext.uniform1iv(t.location, e), 1;
    }
    _uniform_ivec2(t, e) {
      var i = t.uploadedValue;
      return i[0] !== e[0] || i[1] !== e[1]
        ? (b.mainContext.uniform2i(t.location, (i[0] = e[0]), (i[1] = e[1])), 1)
        : 0;
    }
    _uniform_ivec2v(t, e) {
      return b.mainContext.uniform2iv(t.location, e), 1;
    }
    _uniform_vec3i(t, e) {
      var i = t.uploadedValue;
      return i[0] !== e[0] || i[1] !== e[1] || i[2] !== e[2]
        ? (b.mainContext.uniform3i(
            t.location,
            (i[0] = e[0]),
            (i[1] = e[1]),
            (i[2] = e[2]),
          ),
          1)
        : 0;
    }
    _uniform_vec3vi(t, e) {
      return b.mainContext.uniform3iv(t.location, e), 1;
    }
    _uniform_vec4i(t, e) {
      var i = t.uploadedValue;
      return i[0] !== e[0] || i[1] !== e[1] || i[2] !== e[2] || i[3] !== e[3]
        ? (b.mainContext.uniform4i(
            t.location,
            (i[0] = e[0]),
            (i[1] = e[1]),
            (i[2] = e[2]),
            (i[3] = e[3]),
          ),
          1)
        : 0;
    }
    _uniform_vec4vi(t, e) {
      return b.mainContext.uniform4iv(t.location, e), 1;
    }
    _uniform_sampler2D(t, e) {
      var i = b.mainContext,
        s = t.uploadedValue;
      return null == s[0]
        ? ((s[0] = this._curActTexIndex),
          i.uniform1i(t.location, this._curActTexIndex),
          b.activeTexture(i, i.TEXTURE0 + this._curActTexIndex),
          b.bindTexture(i, i.TEXTURE_2D, e),
          this._curActTexIndex++,
          1)
        : (b.activeTexture(i, i.TEXTURE0 + s[0]),
          b.bindTexture(i, i.TEXTURE_2D, e),
          0);
    }
    _uniform_samplerCube(t, e) {
      var i = b.mainContext,
        s = t.uploadedValue;
      return null == s[0]
        ? ((s[0] = this._curActTexIndex),
          i.uniform1i(t.location, this._curActTexIndex),
          b.activeTexture(i, i.TEXTURE0 + this._curActTexIndex),
          b.bindTexture(i, i.TEXTURE_CUBE_MAP, e),
          this._curActTexIndex++,
          1)
        : (b.activeTexture(i, i.TEXTURE0 + s[0]),
          b.bindTexture(i, i.TEXTURE_CUBE_MAP, e),
          0);
    }
    _noSetValue(t) {
      console.log("no....:" + t.name);
    }
    uploadOne(t, e) {
      b.useProgram(b.mainContext, this._program);
      var i = this._paramsMap[t];
      i.fun.call(this, i, e);
    }
    uploadTexture2D(t) {
      var e = b;
      e._activeTextures[0] !== t &amp;&amp;
        (e.bindTexture(b.mainContext, g.instance.TEXTURE_2D, t),
        (e._activeTextures[0] = t));
    }
    upload(t, e = null) {
      U.activeShader = U.bindShader = this;
      var i = b.mainContext;
      b.useProgram(i, this._program),
        this._reCompile
          ? ((e = this._params), (this._reCompile = !1))
          : (e = e || this._params);
      for (var s, r, a = e.length, n = 0, h = 0; h &lt; a; h++)
        null !== (r = t[(s = e[h]).name]) &amp;&amp; (n += s.fun.call(this, s, r));
      H.shaderCall += n;
    }
    uploadArray(t, e, i) {
      (U.activeShader = this),
        (U.bindShader = this),
        b.useProgram(b.mainContext, this._program);
      this._params;
      for (var s, r, a = 0, n = e - 2; n &gt;= 0; n -= 2)
        (r = this._paramsMap[t[n]]) &amp;&amp;
          null != (s = t[n + 1]) &amp;&amp;
          (i &amp;&amp; i[r.name] &amp;&amp; i[r.name].bind(), (a += r.fun.call(this, r, s)));
      H.shaderCall += a;
    }
    getParams() {
      return this._params;
    }
    setAttributesLocation(t) {
      this._attribInfo = t;
    }
  }
  (K._count = 0),
    (K._preCompileShader = {}),
    (K.SHADERNAME2ID = 2e-4),
    (K.nameKey = new z()),
    (K.sharders = new Array(32));
  class j extends K {
    constructor(t, e, i = null, s = null, r = null) {
      super(t, e, i, s, r),
        (this._params2dQuick2 = null),
        (this._shaderValueWidth = 0),
        (this._shaderValueHeight = 0);
    }
    _disposeResource() {
      super._disposeResource(), (this._params2dQuick2 = null);
    }
    upload2dQuick2(t) {
      this.upload(t, this._params2dQuick2 || this._make2dQuick2());
    }
    _make2dQuick2() {
      if (!this._params2dQuick2) {
        this._params2dQuick2 = [];
        for (var t, e = this._params, i = 0, s = e.length; i &lt; s; i++)
          "size" !== (t = e[i]).name &amp;&amp; this._params2dQuick2.push(t);
      }
      return this._params2dQuick2;
    }
    static create(t, e, i = null, s = null, r = null) {
      return new j(t, e, i, s, r);
    }
  }
  class q {
    constructor(t, e) {
      (this.defines = new X()),
        (this.size = [0, 0]),
        (this.alpha = 1),
        (this.ALPHA = 1),
        (this.subID = 0),
        (this.ref = 1),
        (this._cacheID = 0),
        (this.clipMatDir = [i.Context._MAXSIZE, 0, 0, i.Context._MAXSIZE]),
        (this.clipMatPos = [0, 0]),
        (this.clipOff = [0, 0]),
        (this.mainID = t),
        (this.subID = e),
        (this.textureHost = null),
        (this.texture = null),
        (this.color = null),
        (this.colorAdd = null),
        (this.u_mmat2 = null),
        (this._cacheID = t | e),
        (this._inClassCache = q._cache[this._cacheID]),
        t &gt; 0 &amp;&amp;
          !this._inClassCache &amp;&amp;
          ((this._inClassCache = q._cache[this._cacheID] = []),
          (this._inClassCache._length = 0)),
        this.clear();
    }
    static _initone(t, e) {
      (q._typeClass[t] = e), (q._cache[t] = []), (q._cache[t]._length = 0);
    }
    static __init__() {}
    setValue(t) {}
    _ShaderWithCompile() {
      return K.withCompile2D(
        0,
        this.mainID,
        this.defines.toNameDic(),
        this.mainID | this.defines._value,
        j.create,
        this._attribLocation,
      );
    }
    upload() {
      var t = G;
      G.worldMatrix4 === G.TEMPMAT4_ARRAY || this.defines.addInt(X.WORLDMAT),
        (this.mmat = t.worldMatrix4),
        G.matWVP &amp;&amp;
          (this.defines.addInt(X.MVP3D),
          (this.u_MvpMatrix = G.matWVP.elements));
      var e =
        K.sharders[this.mainID | this.defines._value] ||
        this._ShaderWithCompile();
      e._shaderValueWidth !== t.width || e._shaderValueHeight !== t.height
        ? ((this.size[0] = t.width),
          (this.size[1] = t.height),
          (e._shaderValueWidth = t.width),
          (e._shaderValueHeight = t.height),
          e.upload(this, null))
        : e.upload(this, e._params2dQuick2 || e._make2dQuick2());
    }
    setFilters(t) {
      if (((this.filters = t), t))
        for (var e, i = t.length, s = 0; s &lt; i; s++)
          (e = t[s]) &amp;&amp; (this.defines.add(e.type), e.action.setValue(this));
    }
    clear() {
      (this.defines._value = this.subID), (this.clipOff[0] = 0);
    }
    release() {
      --this.ref &lt; 1 &amp;&amp;
        (this._inClassCache &amp;&amp;
          (this._inClassCache[this._inClassCache._length++] = this),
        this.clear(),
        (this.filters = null),
        (this.ref = 1),
        (this.clipOff[0] = 0));
    }
    static create(t, e) {
      var i = q._cache[t | e];
      return i._length ? i[--i._length] : new q._typeClass[t | e](e);
    }
  }
  (q._cache = []),
    (q._typeClass = []),
    (q.TEMPMAT4_ARRAY = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
  class Z {
    constructor() {
      this.clear();
    }
    clear() {
      (this.submitType = -1), (this.blendShader = this.other = 0);
    }
    copyFrom(t) {
      (this.other = t.other),
        (this.blendShader = t.blendShader),
        (this.submitType = t.submitType);
    }
    copyFrom2(t, e, i) {
      (this.other = i), (this.submitType = e);
    }
    equal3_2(t, e, i) {
      return (
        this.submitType === e &amp;&amp;
        this.other === i &amp;&amp;
        this.blendShader === t.blendShader
      );
    }
    equal4_2(t, e, i) {
      return (
        this.submitType === e &amp;&amp;
        this.other === i &amp;&amp;
        this.blendShader === t.blendShader
      );
    }
    equal_3(t) {
      return (
        this.submitType === t.submitType &amp;&amp; this.blendShader === t.blendShader
      );
    }
    equal(t) {
      return (
        this.other === t.other &amp;&amp;
        this.submitType === t.submitType &amp;&amp;
        this.blendShader === t.blendShader
      );
    }
  }
  class Q {
    constructor() {
      (this._ref = 1), (this._key = new Z());
    }
    renderSubmit() {
      return this.fun.apply(this._this, this.args), 1;
    }
    getRenderType() {
      return 0;
    }
    releaseRender() {
      if (--this._ref &lt; 1) {
        var t = Q.POOL;
        t[t._length++] = this;
      }
    }
    static create(t, e, i) {
      var s = Q.POOL._length ? Q.POOL[--Q.POOL._length] : new Q();
      return (
        (s.fun = e),
        (s.args = t),
        (s._this = i),
        (s._ref = 1),
        s._key.clear(),
        s
      );
    }
  }
  (Q.POOL = []), (Q.POOL._length = 0);
  class $ {
    constructor() {}
    get type() {
      return -1;
    }
  }
  ($.BLUR = 16),
    ($.COLOR = 32),
    ($.GLOW = 8),
    ($._filter = function (t, e, i, s) {
      var r = e,
        a = this._next;
      if (a) {
        var n = t.filters,
          h = n.length;
        if (1 == h &amp;&amp; n[0].type == $.COLOR)
          return (
            e.save(),
            e.setColorFilter(n[0]),
            a._fun.call(a, t, e, i, s),
            void e.restore()
          );
        var o,
          l = q.create(X.TEXTURE2D, 0),
          _ = f.TEMP,
          u = r._curMat,
          c = p.create();
        u.copyTo(c);
        var d = 0,
          g = 0,
          T = null,
          v = t._cacheStyle.filterCache || null;
        if (v &amp;&amp; 0 == t.getRepaint()) {
          if (
            ((t._isHaveGlowFilter() || !1) &amp;&amp; ((d = 50), (g = 25)),
            (o = t.getBounds()).width &lt;= 0 || o.height &lt;= 0)
          )
            return;
          (o.width += d + 8),
            (o.height += d + 8),
            (o.x -= t.pivotX + 4),
            (o.y -= t.pivotY + 4),
            (_.x = o.x * c.a + o.y * c.c),
            (_.y = o.y * c.d + o.x * c.b),
            (o.x = _.x),
            (o.y = _.y),
            (_.x = o.width * c.a + o.height * c.c),
            (_.y = o.height * c.d + o.width * c.b),
            (o.width = _.x),
            (o.height = _.y);
        } else {
          t._isHaveGlowFilter() &amp;&amp; ((d = 50), (g = 25)),
            (o = new m()).copyFrom(t.getSelfBounds()),
            (o.x += t.x),
            (o.y += t.y),
            (o.x -= t.pivotX + 4),
            (o.y -= t.pivotY + 4);
          var x = o.x,
            y = o.y;
          if (
            ((o.width += d + 8),
            (o.height += d + 8),
            (_.x = o.x * c.a + o.y * c.c),
            (_.y = o.y * c.d + o.x * c.b),
            (o.x = _.x),
            (o.y = _.y),
            (_.x = o.width * c.a + o.height * c.c),
            (_.y = o.height * c.d + o.width * c.b),
            (o.width = _.x),
            (o.height = _.y),
            o.width &lt;= 0 || o.height &lt;= 0)
          )
            return;
          v &amp;&amp; W.releaseRT(v), (T = W.getRT(o.width, o.height));
          var E = (v = W.getRT(o.width, o.height));
          (t._getCacheStyle().filterCache = v), r.pushRT(), r.useRT(T);
          var R = t.x - x + g,
            C = t.y - y + g;
          a._fun.call(a, t, e, R, C), r.useRT(E);
          for (var A = 0; A &lt; h; A++) {
            0 != A &amp;&amp;
              (r.useRT(T),
              r.drawTarget(
                E,
                0,
                0,
                o.width,
                o.height,
                p.TEMP.identity(),
                l,
                null,
                Y.TOINT.overlay,
              ),
              r.useRT(E));
            var b = n[A];
            switch (b.type) {
              case $.BLUR:
              case $.GLOW:
                b._glRender &amp;&amp; b._glRender.render(T, e, o.width, o.height, b);
                break;
              case $.COLOR:
                r.setColorFilter(b),
                  r.drawTarget(
                    T,
                    0,
                    0,
                    o.width,
                    o.height,
                    p.EMPTY.identity(),
                    q.create(X.TEXTURE2D, 0),
                  ),
                  r.setColorFilter(null);
            }
          }
          r.popRT();
        }
        if (
          ((i = i - g - t.x),
          (s = s - g - t.y),
          _.setTo(i, s),
          c.transformPoint(_),
          (i = _.x + o.x),
          (s = _.y + o.y),
          r._drawRenderTexture(
            v,
            i,
            s,
            o.width,
            o.height,
            p.TEMP.identity(),
            1,
            k.defuv,
          ),
          T)
        ) {
          var S = Q.create(
            [T],
            function (t) {
              t.destroy();
            },
            this,
          );
          (T = null), e.addRenderObject(S);
        }
        c.destroy();
      }
    });
  class J {
    static toRadian(t) {
      return t * J._pi2;
    }
    static toAngle(t) {
      return t * J._pi;
    }
    static toHexColor(t) {
      if (t &lt; 0 || isNaN(t)) return null;
      for (var e = t.toString(16); e.length &lt; 6; ) e = "0" + e;
      return "#" + e;
    }
    static getGID() {
      return J._gid++;
    }
    static concatArray(t, e) {
      if (!e) return t;
      if (!t) return e;
      var i,
        s = e.length;
      for (i = 0; i &lt; s; i++) t.push(e[i]);
      return t;
    }
    static clearArray(t) {
      return t ? ((t.length = 0), t) : t;
    }
    static copyArray(t, e) {
      if ((t || (t = []), !e)) return t;
      t.length = e.length;
      var i,
        s = e.length;
      for (i = 0; i &lt; s; i++) t[i] = e[i];
      return t;
    }
    static getGlobalRecByPoints(t, e, i, s, r) {
      var a, n;
      (a = f.create().setTo(e, i)),
        (a = t.localToGlobal(a)),
        (n = f.create().setTo(s, r)),
        (n = t.localToGlobal(n));
      var h = m._getWrapRec([a.x, a.y, n.x, n.y]);
      return a.recover(), n.recover(), h;
    }
    static getGlobalPosAndScale(t) {
      return J.getGlobalRecByPoints(t, 0, 0, 1, 1);
    }
    static bind(t, e) {
      return t.bind(e);
    }
    static updateOrder(t) {
      if (!t || t.length &lt; 2) return !1;
      for (var e, i, s, r = 1, a = t.length; r &lt; a; ) {
        for (s = t[(e = r)], i = t[e]._zOrder; --e &gt; -1 &amp;&amp; t[e]._zOrder &gt; i; )
          t[e + 1] = t[e];
        (t[e + 1] = s), r++;
      }
      return !0;
    }
    static transPointList(t, e, i) {
      var s,
        r = t.length;
      for (s = 0; s &lt; r; s += 2) (t[s] += e), (t[s + 1] += i);
    }
    static parseInt(t, e = 0) {
      var i = parseInt(t, e);
      return isNaN(i) ? 0 : i;
    }
    static getFileExtension(t) {
      J._extReg.lastIndex = t.lastIndexOf(".");
      var e = J._extReg.exec(t);
      return e &amp;&amp; e.length &gt; 1 ? e[1].toLowerCase() : null;
    }
    static getFilecompatibleExtension(t) {
      var e = t.split("."),
        i = e.length;
      return e.length &gt; 2 ? e[i - 2] + "." + e[i - 1] : null;
    }
    static getTransformRelativeToWindow(t, e, i) {
      var s = J.gStage,
        r = J.getGlobalPosAndScale(t),
        a = s._canvasTransform.clone(),
        n = a.tx,
        h = a.ty;
      a.rotate((-Math.PI / 180) * s.canvasDegree),
        a.scale(s.clientScaleX, s.clientScaleY);
      var o,
        l,
        _,
        u,
        c = s.canvasDegree % 180 != 0;
      return (
        c
          ? ((o = i + r.y),
            (l = e + r.x),
            (o *= a.d),
            (l *= a.a),
            90 == s.canvasDegree
              ? ((o = n - o), (l += h))
              : ((o += n), (l = h - l)))
          : ((o = e + r.x),
            (l = i + r.y),
            (o *= a.a),
            (l *= a.d),
            (o += n),
            (l += h)),
        (l += s._safariOffsetY),
        c
          ? ((_ = a.d * r.height), (u = a.a * r.width))
          : ((_ = a.a * r.width), (u = a.d * r.height)),
        { x: o, y: l, scaleX: _, scaleY: u }
      );
    }
    static fitDOMElementInArea(t, e, i, s, r, a) {
      t._fitLayaAirInitialized ||
        ((t._fitLayaAirInitialized = !0),
        (t.style.transformOrigin = t.style.webKittransformOrigin = "left top"),
        (t.style.position = "absolute"));
      var n = J.getTransformRelativeToWindow(e, i, s);
      (t.style.transform = t.style.webkitTransform =
        "scale(" +
        n.scaleX +
        "," +
        n.scaleY +
        ") rotate(" +
        J.gStage.canvasDegree +
        "deg)"),
        (t.style.width = r + "px"),
        (t.style.height = a + "px"),
        (t.style.left = n.x + "px"),
        (t.style.top = n.y + "px");
    }
    static isOkTextureList(t) {
      if (!t) return !1;
      var e,
        i,
        s = t.length;
      for (e = 0; e &lt; s; e++) if (!(i = t[e]) || !i._getSource()) return !1;
      return !0;
    }
    static isOKCmdList(t) {
      if (!t) return !1;
      var e,
        i = t.length;
      for (e = 0; e &lt; i; e++) t[e];
      return !0;
    }
    static getQueryString(t) {
      if (i.Browser.onMiniGame) return null;
      if (!window.location || !window.location.search) return null;
      var e = new RegExp("(^|&amp;)" + t + "=([^&amp;]*)(&amp;|$)"),
        s = window.location.search.substr(1).match(e);
      return null != s ? unescape(s[2]) : null;
    }
  }
  (J.gStage = null),
    (J._gid = 1),
    (J._pi = 180 / Math.PI),
    (J._pi2 = Math.PI / 180),
    (J._extReg = /\.(\w+)\??/g),
    (J.parseXMLFromString = function (t) {
      var e;
      if (
        ((t = t.replace(/&gt;\s+&lt;/g, "&gt;&lt;")),
        (e = new DOMParser().parseFromString(
          t,
          "text/xml",
        )).firstChild.textContent.indexOf(
          "This page contains the following errors",
        ) &gt; -1)
      )
        throw new Error(e.firstChild.firstChild.textContent);
      return e;
    });
  class tt {
    constructor(t) {
      if (((this.arrColor = []), null == t || "none" == t))
        return (
          (this.strColor = "#00000000"),
          (this.numColor = 0),
          void (this.arrColor = [0, 0, 0, 0])
        );
      var e, i, s;
      if ("string" == typeof t)
        if (t.indexOf("rgba(") &gt;= 0 || t.indexOf("rgb(") &gt;= 0) {
          var r,
            a,
            n = t;
          for (
            r = n.indexOf("("),
              a = n.indexOf(")"),
              n = n.substring(r + 1, a),
              this.arrColor = n.split(","),
              i = this.arrColor.length,
              e = 0;
            e &lt; i;
            e++
          )
            (this.arrColor[e] = parseFloat(this.arrColor[e])),
              e &lt; 3 &amp;&amp; (this.arrColor[e] = Math.round(this.arrColor[e]));
          (s =
            4 == this.arrColor.length
              ? 256 *
                  (256 * (256 * this.arrColor[0] + this.arrColor[1]) +
                    this.arrColor[2]) +
                Math.round(255 * this.arrColor[3])
              : 256 * (256 * this.arrColor[0] + this.arrColor[1]) +
                this.arrColor[2]),
            (this.strColor = t);
        } else {
          if (
            ((this.strColor = t),
            "#" === t.charAt(0) &amp;&amp; (t = t.substr(1)),
            3 === (i = t.length) || 4 === i)
          ) {
            var h = "";
            for (e = 0; e &lt; i; e++) h += t[e] + t[e];
            t = h;
          }
          s = parseInt(t, 16);
        }
      else (s = t), (this.strColor = J.toHexColor(s));
      this.strColor.indexOf("rgba") &gt;= 0 || 9 === this.strColor.length
        ? ((this.arrColor = [
            ((4278190080 &amp; s) &gt;&gt;&gt; 24) / 255,
            ((16711680 &amp; s) &gt;&gt; 16) / 255,
            ((65280 &amp; s) &gt;&gt; 8) / 255,
            (255 &amp; s) / 255,
          ]),
          (this.numColor =
            ((4278190080 &amp; s) &gt;&gt;&gt; 24) |
            ((16711680 &amp; s) &gt;&gt; 8) |
            ((65280 &amp; s) &lt;&lt; 8) |
            ((255 &amp; s) &lt;&lt; 24)))
        : ((this.arrColor = [
            ((16711680 &amp; s) &gt;&gt; 16) / 255,
            ((65280 &amp; s) &gt;&gt; 8) / 255,
            (255 &amp; s) / 255,
            1,
          ]),
          (this.numColor =
            4278190080 |
            ((16711680 &amp; s) &gt;&gt; 16) |
            (65280 &amp; s) |
            ((255 &amp; s) &lt;&lt; 16))),
        (this.arrColor.__id = ++tt._COLODID);
    }
    static _initDefault() {
      for (var t in ((tt._DEFAULT = {}), tt._COLOR_MAP))
        tt._SAVE[t] = tt._DEFAULT[t] = new tt(tt._COLOR_MAP[t]);
      return tt._DEFAULT;
    }
    static _initSaveMap() {
      for (var t in ((tt._SAVE_SIZE = 0), (tt._SAVE = {}), tt._DEFAULT))
        tt._SAVE[t] = tt._DEFAULT[t];
    }
    static create(t) {
      var e = t + "",
        i = tt._SAVE[e];
      return null != i
        ? i
        : (tt._SAVE_SIZE &lt; 1e3 &amp;&amp; tt._initSaveMap(), (tt._SAVE[e] = new tt(t)));
    }
  }
  (tt._SAVE = {}),
    (tt._SAVE_SIZE = 0),
    (tt._COLOR_MAP = {
      purple: "#800080",
      orange: "#ffa500",
      white: "#FFFFFF",
      red: "#FF0000",
      green: "#00FF00",
      blue: "#0000FF",
      black: "#000000",
      yellow: "#FFFF00",
      gray: "#808080",
    }),
    (tt._DEFAULT = tt._initDefault()),
    (tt._COLODID = 1);
  class et extends $ {
    constructor(t = null) {
      super(),
        t || (t = this._copyMatrix(et.IDENTITY_MATRIX)),
        (this._mat = new Float32Array(16)),
        (this._alpha = new Float32Array(4)),
        this.setByMatrix(t);
    }
    gray() {
      return this.setByMatrix(et.GRAY_MATRIX);
    }
    color(t = 0, e = 0, i = 0, s = 1) {
      return this.setByMatrix([
        1,
        0,
        0,
        0,
        t,
        0,
        1,
        0,
        0,
        e,
        0,
        0,
        1,
        0,
        i,
        0,
        0,
        0,
        1,
        s,
      ]);
    }
    setColor(t) {
      var e = tt.create(t).arrColor,
        i = [
          0,
          0,
          0,
          0,
          256 * e[0],
          0,
          0,
          0,
          0,
          256 * e[1],
          0,
          0,
          0,
          0,
          256 * e[2],
          0,
          0,
          0,
          1,
          0,
        ];
      return this.setByMatrix(i);
    }
    setByMatrix(t) {
      this._matrix != t &amp;&amp; this._copyMatrix(t);
      for (var e = 0, i = 0, s = 0; s &lt; 20; s++)
        s % 5 != 4 ? (this._mat[e++] = t[s]) : (this._alpha[i++] = t[s]);
      return this;
    }
    get type() {
      return $.COLOR;
    }
    adjustColor(t, e, i, s) {
      return (
        this.adjustHue(s),
        this.adjustContrast(e),
        this.adjustBrightness(t),
        this.adjustSaturation(i),
        this
      );
    }
    adjustBrightness(t) {
      return 0 == (t = this._clampValue(t, 100)) || isNaN(t)
        ? this
        : this._multiplyMatrix([
            1,
            0,
            0,
            0,
            t,
            0,
            1,
            0,
            0,
            t,
            0,
            0,
            1,
            0,
            t,
            0,
            0,
            0,
            1,
            0,
            0,
            0,
            0,
            0,
            1,
          ]);
    }
    adjustContrast(t) {
      if (0 == (t = this._clampValue(t, 100)) || isNaN(t)) return this;
      var e,
        i =
          (e =
            t &lt; 0
              ? 127 + (t / 100) * 127
              : 127 *
                  (e =
                    0 == (e = t % 1)
                      ? et.DELTA_INDEX[t]
                      : et.DELTA_INDEX[t &lt;&lt; 0] * (1 - e) +
                        et.DELTA_INDEX[1 + (t &lt;&lt; 0)] * e) +
                127) / 127,
        s = 0.5 * (127 - e);
      return this._multiplyMatrix([
        i,
        0,
        0,
        0,
        s,
        0,
        i,
        0,
        0,
        s,
        0,
        0,
        i,
        0,
        s,
        0,
        0,
        0,
        1,
        0,
        0,
        0,
        0,
        0,
        1,
      ]);
    }
    adjustSaturation(t) {
      if (0 == (t = this._clampValue(t, 100)) || isNaN(t)) return this;
      var e = 1 + (t &gt; 0 ? (3 * t) / 100 : t / 100),
        i = 1 - e,
        s = 0.3086 * i,
        r = 0.6094 * i,
        a = 0.082 * i;
      return this._multiplyMatrix([
        s + e,
        r,
        a,
        0,
        0,
        s,
        r + e,
        a,
        0,
        0,
        s,
        r,
        a + e,
        0,
        0,
        0,
        0,
        0,
        1,
        0,
        0,
        0,
        0,
        0,
        1,
      ]);
    }
    adjustHue(t) {
      if (0 == (t = (this._clampValue(t, 180) / 180) * Math.PI) || isNaN(t))
        return this;
      var e = Math.cos(t),
        i = Math.sin(t),
        s = 0.213,
        r = 0.715,
        a = 0.072;
      return this._multiplyMatrix([
        s + e * (1 - s) + i * -s,
        r + e * -r + i * -r,
        a + e * -a + i * (1 - a),
        0,
        0,
        s + e * -s + 0.143 * i,
        r + e * (1 - r) + 0.14 * i,
        a + e * -a + -0.283 * i,
        0,
        0,
        s + e * -s + -0.787 * i,
        r + e * -r + i * r,
        a + e * (1 - a) + i * a,
        0,
        0,
        0,
        0,
        0,
        1,
        0,
        0,
        0,
        0,
        0,
        1,
      ]);
    }
    reset() {
      return this.setByMatrix(this._copyMatrix(et.IDENTITY_MATRIX));
    }
    _multiplyMatrix(t) {
      var e = [];
      this._matrix = this._fixMatrix(this._matrix);
      for (var i = 0; i &lt; 5; i++) {
        for (var s = 0; s &lt; 5; s++) e[s] = this._matrix[s + 5 * i];
        for (s = 0; s &lt; 5; s++) {
          for (var r = 0, a = 0; a &lt; 5; a++) r += t[s + 5 * a] * e[a];
          this._matrix[s + 5 * i] = r;
        }
      }
      return this.setByMatrix(this._matrix);
    }
    _clampValue(t, e) {
      return Math.min(e, Math.max(-e, t));
    }
    _fixMatrix(t = null) {
      return null == t
        ? et.IDENTITY_MATRIX
        : (t.length &lt; et.LENGTH
            ? (t = t
                .slice(0, t.length)
                .concat(et.IDENTITY_MATRIX.slice(t.length, et.LENGTH)))
            : t.length &gt; et.LENGTH &amp;&amp; (t = t.slice(0, et.LENGTH)),
          t);
    }
    _copyMatrix(t) {
      var e = et.LENGTH;
      this._matrix || (this._matrix = []);
      for (var i = 0; i &lt; e; i++) this._matrix[i] = t[i];
      return this._matrix;
    }
  }
  (et.DELTA_INDEX = [
    0, 0.01, 0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.1, 0.11, 0.12, 0.14, 0.15,
    0.16, 0.17, 0.18, 0.2, 0.21, 0.22, 0.24, 0.25, 0.27, 0.28, 0.3, 0.32, 0.34,
    0.36, 0.38, 0.4, 0.42, 0.44, 0.46, 0.48, 0.5, 0.53, 0.56, 0.59, 0.62, 0.65,
    0.68, 0.71, 0.74, 0.77, 0.8, 0.83, 0.86, 0.89, 0.92, 0.95, 0.98, 1, 1.06,
    1.12, 1.18, 1.24, 1.3, 1.36, 1.42, 1.48, 1.54, 1.6, 1.66, 1.72, 1.78, 1.84,
    1.9, 1.96, 2, 2.12, 2.25, 2.37, 2.5, 2.62, 2.75, 2.87, 3, 3.2, 3.4, 3.6,
    3.8, 4, 4.3, 4.7, 4.9, 5, 5.5, 6, 6.5, 6.8, 7, 7.3, 7.5, 7.8, 8, 8.4, 8.7,
    9, 9.4, 9.6, 9.8, 10,
  ]),
    (et.GRAY_MATRIX = [
      0.3086, 0.6094, 0.082, 0, 0, 0.3086, 0.6094, 0.082, 0, 0, 0.3086, 0.6094,
      0.082, 0, 0, 0, 0, 0, 1, 0,
    ]),
    (et.IDENTITY_MATRIX = [
      1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1,
    ]),
    (et.LENGTH = 25);
  class it {
    constructor() {
      (this.colorFlt = null), (this.uv = null);
    }
    static create(t, e, i, r, a, n, h, o, l, _) {
      var u = s.getItemByClass("DrawTextureCmd", it);
      return (
        (u.texture = t),
        t._addReference(),
        (u.x = e),
        (u.y = i),
        (u.width = r),
        (u.height = a),
        (u.matrix = n),
        (u.alpha = h),
        (u.color = o),
        (u.blendMode = l),
        (u.uv = null == _ ? null : _),
        o &amp;&amp; ((u.colorFlt = new et()), u.colorFlt.setColor(o)),
        u
      );
    }
    recover() {
      this.texture &amp;&amp; this.texture._removeReference(),
        (this.texture = null),
        (this.matrix = null),
        s.recover("DrawTextureCmd", this);
    }
    run(t, e, i) {
      this.texture &amp;&amp;
        t.drawTextureWithTransform(
          this.texture,
          this.x,
          this.y,
          this.width,
          this.height,
          this.matrix,
          e,
          i,
          this.alpha,
          this.blendMode,
          this.colorFlt,
          this.uv,
        );
    }
    get cmdID() {
      return it.ID;
    }
  }
  it.ID = "DrawTexture";
  class st {
    static create(t, e, i, r, a, n, h, o) {
      var l = s.getItemByClass("FillTextureCmd", st);
      return (
        (l.texture = t),
        (l.x = e),
        (l.y = i),
        (l.width = r),
        (l.height = a),
        (l.type = n),
        (l.offset = h),
        (l.other = o),
        l
      );
    }
    recover() {
      (this.texture = null),
        (this.offset = null),
        (this.other = null),
        s.recover("FillTextureCmd", this);
    }
    run(t, e, i) {
      t.fillTexture(
        this.texture,
        this.x + e,
        this.y + i,
        this.width,
        this.height,
        this.type,
        this.offset,
        this.other,
      );
    }
    get cmdID() {
      return st.ID;
    }
  }
  st.ID = "FillTexture";
  class rt {
    static create() {
      return s.getItemByClass("RestoreCmd", rt);
    }
    recover() {
      s.recover("RestoreCmd", this);
    }
    run(t, e, i) {
      t.restore();
    }
    get cmdID() {
      return rt.ID;
    }
  }
  rt.ID = "Restore";
  class at {
    static create(t, e, i) {
      var r = s.getItemByClass("RotateCmd", at);
      return (r.angle = t), (r.pivotX = e), (r.pivotY = i), r;
    }
    recover() {
      s.recover("RotateCmd", this);
    }
    run(t, e, i) {
      t._rotate(this.angle, this.pivotX + e, this.pivotY + i);
    }
    get cmdID() {
      return at.ID;
    }
  }
  at.ID = "Rotate";
  class nt {
    static create(t, e, i, r) {
      var a = s.getItemByClass("ScaleCmd", nt);
      return (a.scaleX = t), (a.scaleY = e), (a.pivotX = i), (a.pivotY = r), a;
    }
    recover() {
      s.recover("ScaleCmd", this);
    }
    run(t, e, i) {
      t._scale(this.scaleX, this.scaleY, this.pivotX + e, this.pivotY + i);
    }
    get cmdID() {
      return nt.ID;
    }
  }
  nt.ID = "Scale";
  class ht {
    static create(t, e, i) {
      var r = s.getItemByClass("TransformCmd", ht);
      return (r.matrix = t), (r.pivotX = e), (r.pivotY = i), r;
    }
    recover() {
      (this.matrix = null), s.recover("TransformCmd", this);
    }
    run(t, e, i) {
      t._transform(this.matrix, this.pivotX + e, this.pivotY + i);
    }
    get cmdID() {
      return ht.ID;
    }
  }
  ht.ID = "Transform";
  class ot {
    static create(t, e) {
      var i = s.getItemByClass("TranslateCmd", ot);
      return (i.tx = t), (i.ty = e), i;
    }
    recover() {
      s.recover("TranslateCmd", this);
    }
    run(t, e, i) {
      t.translate(this.tx, this.ty);
    }
    get cmdID() {
      return ot.ID;
    }
  }
  ot.ID = "Translate";
  class lt {
    constructor() {
      (this._controlPoints = [new f(), new f(), new f()]),
        (this._calFun = this.getPoint2);
    }
    _switchPoint(t, e) {
      var i = this._controlPoints.shift();
      i.setTo(t, e), this._controlPoints.push(i);
    }
    getPoint2(t, e) {
      var i = this._controlPoints[0],
        s = this._controlPoints[1],
        r = this._controlPoints[2],
        a =
          Math.pow(1 - t, 2) * i.x +
          2 * t * (1 - t) * s.x +
          Math.pow(t, 2) * r.x,
        n =
          Math.pow(1 - t, 2) * i.y +
          2 * t * (1 - t) * s.y +
          Math.pow(t, 2) * r.y;
      e.push(a, n);
    }
    getPoint3(t, e) {
      var i = this._controlPoints[0],
        s = this._controlPoints[1],
        r = this._controlPoints[2],
        a = this._controlPoints[3],
        n =
          Math.pow(1 - t, 3) * i.x +
          3 * s.x * t * (1 - t) * (1 - t) +
          3 * r.x * t * t * (1 - t) +
          a.x * Math.pow(t, 3),
        h =
          Math.pow(1 - t, 3) * i.y +
          3 * s.y * t * (1 - t) * (1 - t) +
          3 * r.y * t * t * (1 - t) +
          a.y * Math.pow(t, 3);
      e.push(n, h);
    }
    insertPoints(t, e) {
      var i, s;
      for (s = 1 / (t = t &gt; 0 ? t : 5), i = 0; i &lt;= 1; i += s)
        this._calFun(i, e);
    }
    getBezierPoints(t, e = 5, i = 2) {
      var s, r;
      if ((r = t.length) &lt; 2 * (i + 1)) return [];
      var a = [];
      switch (i) {
        case 2:
          this._calFun = this.getPoint2;
          break;
        case 3:
          this._calFun = this.getPoint3;
          break;
        default:
          return [];
      }
      for (; this._controlPoints.length &lt;= i; )
        this._controlPoints.push(f.create());
      for (s = 0; s &lt; 2 * i; s += 2) this._switchPoint(t[s], t[s + 1]);
      for (s = 2 * i; s &lt; r; s += 2)
        this._switchPoint(t[s], t[s + 1]),
          (s / 2) % i == 0 &amp;&amp; this.insertPoints(e, a);
      return a;
    }
  }
  lt.I = new lt();
  class _t {
    static multiply(t, e, i) {
      return (t.x - i.x) * (e.y - i.y) - (e.x - i.x) * (t.y - i.y);
    }
    static dis(t, e) {
      return (t.x - e.x) * (t.x - e.x) + (t.y - e.y) * (t.y - e.y);
    }
    static _getPoints(t, e = !1, i = null) {
      for (_t._mPointList || (_t._mPointList = []); _t._mPointList.length &lt; t; )
        _t._mPointList.push(new f());
      return (
        i || (i = []),
        (i.length = 0),
        e
          ? _t.getFrom(i, _t._mPointList, t)
          : _t.getFromR(i, _t._mPointList, t),
        i
      );
    }
    static getFrom(t, e, i) {
      var s;
      for (s = 0; s &lt; i; s++) t.push(e[s]);
      return t;
    }
    static getFromR(t, e, i) {
      var s;
      for (s = 0; s &lt; i; s++) t.push(e.pop());
      return t;
    }
    static pListToPointList(t, e = !1) {
      var i,
        s = t.length / 2,
        r = _t._getPoints(s, e, _t._tempPointList);
      for (i = 0; i &lt; s; i++) r[i].setTo(t[i + i], t[i + i + 1]);
      return r;
    }
    static pointListToPlist(t) {
      var e,
        i,
        s = t.length,
        r = _t._temPList;
      for (r.length = 0, e = 0; e &lt; s; e++) (i = t[e]), r.push(i.x, i.y);
      return r;
    }
    static scanPList(t) {
      return J.copyArray(
        t,
        _t.pointListToPlist(_t.scan(_t.pListToPointList(t, !0))),
      );
    }
    static scan(t) {
      var e,
        i,
        s,
        r,
        a,
        n = 0,
        h = t.length,
        o = {};
      for ((r = _t._temArr).length = 0, e = (h = t.length) - 1; e &gt;= 0; e--)
        (a = (s = t[e]).x + "_" + s.y) in o || ((o[a] = !0), r.push(s));
      for (h = r.length, J.copyArray(t, r), e = 1; e &lt; h; e++)
        (t[e].y &lt; t[n].y || (t[e].y == t[n].y &amp;&amp; t[e].x &lt; t[n].x)) &amp;&amp; (n = e);
      for (s = t[0], t[0] = t[n], t[n] = s, e = 1; e &lt; h - 1; e++) {
        for (n = e, i = e + 1; i &lt; h; i++)
          (_t.multiply(t[i], t[n], t[0]) &gt; 0 ||
            (0 == _t.multiply(t[i], t[n], t[0]) &amp;&amp;
              _t.dis(t[0], t[i]) &lt; _t.dis(t[0], t[n]))) &amp;&amp;
            (n = i);
        (s = t[e]), (t[e] = t[n]), (t[n] = s);
      }
      if ((((r = _t._temArr).length = 0), t.length &lt; 3))
        return J.copyArray(r, t);
      for (r.push(t[0], t[1], t[2]), e = 3; e &lt; h; e++) {
        for (
          ;
          r.length &gt;= 2 &amp;&amp;
          _t.multiply(t[e], r[r.length - 1], r[r.length - 2]) &gt;= 0;

        )
          r.pop();
        t[e] &amp;&amp; r.push(t[e]);
      }
      return r;
    }
  }
  (_t._tempPointList = []), (_t._temPList = []), (_t._temArr = []);
  class ut {
    constructor(t) {
      this.setValue(t);
    }
    static create(t) {
      if (t) {
        var e = t instanceof tt ? t : tt.create(t);
        return e._drawStyle || (e._drawStyle = new ut(t));
      }
      return ut.DEFAULT;
    }
    setValue(t) {
      this._color = t
        ? t instanceof tt
          ? t
          : tt.create(t)
        : tt.create("#000000");
    }
    reset() {
      this._color = tt.create("#000000");
    }
    toInt() {
      return this._color.numColor;
    }
    equal(t) {
      return "string" == typeof t
        ? this._color.strColor === t
        : t instanceof tt &amp;&amp; this._color.numColor === t.numColor;
    }
    toColorStr() {
      return this._color.strColor;
    }
  }
  ut.DEFAULT = new ut("#000000");
  class ct {
    constructor() {
      (this._lastOriX = 0),
        (this._lastOriY = 0),
        (this.paths = []),
        (this._curPath = null);
    }
    beginPath(t) {
      (this.paths.length = 1),
        (this._curPath = this.paths[0] = new dt()),
        (this._curPath.convex = t);
    }
    closePath() {
      this._curPath.loop = !0;
    }
    newPath() {
      (this._curPath = new dt()), this.paths.push(this._curPath);
    }
    addPoint(t, e) {
      this._curPath.path.push(t, e);
    }
    push(t, e) {
      this._curPath
        ? this._curPath.path.length &gt; 0 &amp;&amp;
          ((this._curPath = new dt()), this.paths.push(this._curPath))
        : ((this._curPath = new dt()), this.paths.push(this._curPath));
      var i = this._curPath;
      (i.path = t.slice()), (i.convex = e);
    }
    reset() {
      this.paths.length = 0;
    }
  }
  class dt {
    constructor() {
      (this.path = []), (this.loop = !1), (this.convex = !1);
    }
  }
  class pt {
    constructor(t = pt.TYPE_2D) {
      (this.clipInfoID = -1),
        (this._mesh = null),
        (this._blendFn = null),
        (this._id = 0),
        (this._renderType = 0),
        (this._parent = null),
        (this._key = new Z()),
        (this._startIdx = 0),
        (this._numEle = 0),
        (this._ref = 1),
        (this.shaderValue = null),
        (this._renderType = t),
        (this._id = ++pt.ID);
    }
    static __init__() {
      var t = (pt.RENDERBASE = new pt(-1));
      (t.shaderValue = new q(0, 0)),
        (t.shaderValue.ALPHA = 1),
        (t._ref = 4294967295);
    }
    getID() {
      return this._id;
    }
    getRenderType() {
      return this._renderType;
    }
    toString() {
      return (
        "ibindex:" +
        this._startIdx +
        " num:" +
        this._numEle +
        " key=" +
        this._key
      );
    }
    renderSubmit() {
      return 1;
    }
    releaseRender() {}
  }
  (pt.TYPE_2D = 1e4),
    (pt.TYPE_CANVAS = 10003),
    (pt.TYPE_CMDSETRT = 10004),
    (pt.TYPE_CUSTOM = 10005),
    (pt.TYPE_BLURRT = 10006),
    (pt.TYPE_CMDDESTORYPRERT = 10007),
    (pt.TYPE_DISABLESTENCIL = 10008),
    (pt.TYPE_OTHERIBVB = 10009),
    (pt.TYPE_PRIMITIVE = 10010),
    (pt.TYPE_RT = 10011),
    (pt.TYPE_BLUR_RT = 10012),
    (pt.TYPE_TARGET = 10013),
    (pt.TYPE_CHANGE_VALUE = 10014),
    (pt.TYPE_SHAPE = 10015),
    (pt.TYPE_TEXTURE = 10016),
    (pt.TYPE_FILLTEXTURE = 10017),
    (pt.KEY_ONCE = -1),
    (pt.KEY_FILLRECT = 1),
    (pt.KEY_DRAWTEXTURE = 2),
    (pt.KEY_VG = 3),
    (pt.KEY_TRIANGLES = 4),
    (pt.ID = 1),
    (pt.preRender = null);
  class ft {
    constructor() {}
    static _createArray() {
      var t = [];
      return (t._length = 0), t;
    }
    static _init() {
      var t = (ft._namemap = {});
      return (
        (t[ft.TYPE_ALPHA] = "ALPHA"),
        (t[ft.TYPE_FILESTYLE] = "fillStyle"),
        (t[ft.TYPE_FONT] = "font"),
        (t[ft.TYPE_LINEWIDTH] = "lineWidth"),
        (t[ft.TYPE_STROKESTYLE] = "strokeStyle"),
        (t[ft.TYPE_ENABLEMERGE] = "_mergeID"),
        (t[ft.TYPE_MARK] = t[ft.TYPE_TRANSFORM] = t[ft.TYPE_TRANSLATE] = []),
        (t[ft.TYPE_TEXTBASELINE] = "textBaseline"),
        (t[ft.TYPE_TEXTALIGN] = "textAlign"),
        (t[ft.TYPE_GLOBALCOMPOSITEOPERATION] = "_nBlendType"),
        (t[ft.TYPE_SHADER] = "shader"),
        (t[ft.TYPE_FILTERS] = "filters"),
        (t[ft.TYPE_COLORFILTER] = "_colorFiler"),
        t
      );
    }
    isSaveMark() {
      return !1;
    }
    restore(t) {
      (this._dataObj[this._valueName] = this._value),
        (ft.POOL[ft.POOL._length++] = this),
        this._newSubmit &amp;&amp; (t._curSubmit = pt.RENDERBASE);
    }
    static save(t, e, i, s) {
      if ((t._saveMark._saveuse &amp; e) !== e) {
        t._saveMark._saveuse |= e;
        var r = ft.POOL,
          a = r._length &gt; 0 ? r[--r._length] : new ft();
        (a._value = i[(a._valueName = ft._namemap[e])]),
          (a._dataObj = i),
          (a._newSubmit = s);
        var n = t._save;
        n[n._length++] = a;
      }
    }
  }
  (ft.TYPE_ALPHA = 1),
    (ft.TYPE_FILESTYLE = 2),
    (ft.TYPE_FONT = 8),
    (ft.TYPE_LINEWIDTH = 256),
    (ft.TYPE_STROKESTYLE = 512),
    (ft.TYPE_MARK = 1024),
    (ft.TYPE_TRANSFORM = 2048),
    (ft.TYPE_TRANSLATE = 4096),
    (ft.TYPE_ENABLEMERGE = 8192),
    (ft.TYPE_TEXTBASELINE = 16384),
    (ft.TYPE_TEXTALIGN = 32768),
    (ft.TYPE_GLOBALCOMPOSITEOPERATION = 65536),
    (ft.TYPE_CLIPRECT = 131072),
    (ft.TYPE_CLIPRECT_STENCIL = 262144),
    (ft.TYPE_IBVB = 524288),
    (ft.TYPE_SHADER = 1048576),
    (ft.TYPE_FILTERS = 2097152),
    (ft.TYPE_FILTERS_TYPE = 4194304),
    (ft.TYPE_COLORFILTER = 8388608),
    (ft.POOL = ft._createArray()),
    (ft._namemap = ft._init());
  class mt {
    constructor() {
      (this._globalClipMatrix = new p()),
        (this._clipInfoID = -1),
        (this._clipRect = new m()),
        (this.incache = !1);
    }
    isSaveMark() {
      return !1;
    }
    restore(t) {
      this._globalClipMatrix.copyTo(t._globalClipMatrix),
        this._clipRect.clone(t._clipRect),
        (t._clipInfoID = this._clipInfoID),
        (mt.POOL[mt.POOL._length++] = this),
        (t._clipInCache = this.incache);
    }
    static save(t) {
      if ((t._saveMark._saveuse &amp; ft.TYPE_CLIPRECT) != ft.TYPE_CLIPRECT) {
        t._saveMark._saveuse |= ft.TYPE_CLIPRECT;
        var e = mt.POOL,
          i = e._length &gt; 0 ? e[--e._length] : new mt();
        t._globalClipMatrix.copyTo(i._globalClipMatrix),
          t._clipRect.clone(i._clipRect),
          (i._clipInfoID = t._clipInfoID),
          (i.incache = t._clipInCache);
        var s = t._save;
        s[s._length++] = i;
      }
    }
  }
  mt.POOL = ft._createArray();
  class gt {
    constructor() {
      this._saveuse = 0;
    }
    isSaveMark() {
      return !0;
    }
    restore(t) {
      (t._saveMark = this._preSaveMark), (gt.POOL[gt.POOL._length++] = this);
    }
    static Create(t) {
      var e = gt.POOL,
        i = e._length &gt; 0 ? e[--e._length] : new gt();
      return (
        (i._saveuse = 0), (i._preSaveMark = t._saveMark), (t._saveMark = i), i
      );
    }
  }
  gt.POOL = ft._createArray();
  class Tt {
    constructor() {
      this._matrix = new p();
    }
    isSaveMark() {
      return !1;
    }
    restore(t) {
      (t._curMat = this._savematrix), (Tt.POOL[Tt.POOL._length++] = this);
    }
    static save(t) {
      var e = t._saveMark;
      if ((e._saveuse &amp; ft.TYPE_TRANSFORM) !== ft.TYPE_TRANSFORM) {
        e._saveuse |= ft.TYPE_TRANSFORM;
        var i = Tt.POOL,
          s = i._length &gt; 0 ? i[--i._length] : new Tt();
        (s._savematrix = t._curMat), (t._curMat = t._curMat.copyTo(s._matrix));
        var r = t._save;
        r[r._length++] = s;
      }
    }
  }
  Tt.POOL = ft._createArray();
  class vt {
    constructor() {
      this._mat = new p();
    }
    isSaveMark() {
      return !1;
    }
    restore(t) {
      this._mat.copyTo(t._curMat), (vt.POOL[vt.POOL._length++] = this);
    }
    static save(t) {
      var e = vt.POOL,
        i = e._length &gt; 0 ? e[--e._length] : new vt();
      t._curMat.copyTo(i._mat);
      var s = t._save;
      s[s._length++] = i;
    }
  }
  vt.POOL = ft._createArray();
  class xt {
    constructor() {
      this._nativeVertexArrayObject = g.layaGPUInstance.createVertexArray();
    }
    bind() {
      xt._curBindedBufferState !== this &amp;&amp;
        (g.layaGPUInstance.bindVertexArray(this._nativeVertexArrayObject),
        (xt._curBindedBufferState = this));
    }
    unBind() {
      if (xt._curBindedBufferState !== this)
        throw "BufferState: must call bind() function first.";
      g.layaGPUInstance.bindVertexArray(null),
        (xt._curBindedBufferState = null);
    }
    destroy() {
      g.layaGPUInstance.deleteVertexArray(this._nativeVertexArrayObject);
    }
    bindForNative() {
      g.instance.bindVertexArray(this._nativeVertexArrayObject),
        (xt._curBindedBufferState = this);
    }
    unBindForNative() {
      g.instance.bindVertexArray(null), (xt._curBindedBufferState = null);
    }
  }
  class yt extends xt {
    constructor() {
      super();
    }
  }
  class Et {
    constructor() {
      (this._byteLength = 0), (this._glBuffer = g.instance.createBuffer());
    }
    get bufferUsage() {
      return this._bufferUsage;
    }
    _bindForVAO() {}
    bind() {
      return !1;
    }
    destroy() {
      this._glBuffer &amp;&amp;
        (g.instance.deleteBuffer(this._glBuffer), (this._glBuffer = null));
    }
  }
  class Rt {}
  (Rt.loopStTm = 0), (Rt.loopCount = 0);
  class Ct extends Et {
    constructor() {
      super(),
        (this._maxsize = 0),
        (this._upload = !0),
        (this._uploadSize = 0),
        (this._bufferSize = 0),
        (this._u8Array = null);
    }
    static __int__(t) {}
    get bufferLength() {
      return this._buffer.byteLength;
    }
    set byteLength(t) {
      this.setByteLength(t);
    }
    setByteLength(t) {
      this._byteLength !== t &amp;&amp;
        (t &lt;= this._bufferSize || this._resizeBuffer(2 * t + 256, !0),
        (this._byteLength = t));
    }
    needSize(t) {
      var e = this._byteLength;
      if (t) {
        var i = this._byteLength + t;
        i &lt;= this._bufferSize || this._resizeBuffer(i &lt;&lt; 1, !0),
          (this._byteLength = i);
      }
      return e;
    }
    _bufferData() {
      (this._maxsize = Math.max(this._maxsize, this._byteLength)),
        Rt.loopCount % 30 == 0 &amp;&amp;
          (this._buffer.byteLength &gt; this._maxsize + 64 &amp;&amp;
            ((this._buffer = this._buffer.slice(0, this._maxsize + 64)),
            (this._bufferSize = this._buffer.byteLength),
            this._checkArrayUse()),
          (this._maxsize = this._byteLength)),
        this._uploadSize &lt; this._buffer.byteLength &amp;&amp;
          ((this._uploadSize = this._buffer.byteLength),
          g.instance.bufferData(
            this._bufferType,
            this._uploadSize,
            this._bufferUsage,
          )),
        g.instance.bufferSubData(
          this._bufferType,
          0,
          new Uint8Array(this._buffer, 0, this._byteLength),
        );
    }
    _bufferSubData(t = 0, e = 0, i = 0) {
      if (
        ((this._maxsize = Math.max(this._maxsize, this._byteLength)),
        Rt.loopCount % 30 == 0 &amp;&amp;
          (this._buffer.byteLength &gt; this._maxsize + 64 &amp;&amp;
            ((this._buffer = this._buffer.slice(0, this._maxsize + 64)),
            (this._bufferSize = this._buffer.byteLength),
            this._checkArrayUse()),
          (this._maxsize = this._byteLength)),
        this._uploadSize &lt; this._buffer.byteLength &amp;&amp;
          ((this._uploadSize = this._buffer.byteLength),
          g.instance.bufferData(
            this._bufferType,
            this._uploadSize,
            this._bufferUsage,
          )),
        e || i)
      ) {
        var s = this._buffer.slice(e, i);
        g.instance.bufferSubData(this._bufferType, t, s);
      } else g.instance.bufferSubData(this._bufferType, t, this._buffer);
    }
    _checkArrayUse() {}
    _bind_uploadForVAO() {
      return (
        !!this._upload &amp;&amp;
        ((this._upload = !1), this._bindForVAO(), this._bufferData(), !0)
      );
    }
    _bind_upload() {
      return (
        !!this._upload &amp;&amp;
        ((this._upload = !1), this.bind(), this._bufferData(), !0)
      );
    }
    _bind_subUpload(t = 0, e = 0, i = 0) {
      return (
        !!this._upload &amp;&amp;
        ((this._upload = !1), this.bind(), this._bufferSubData(t, e, i), !0)
      );
    }
    _resizeBuffer(t, e) {
      var i = this._buffer;
      if (t &lt;= i.byteLength) return this;
      var s = this._u8Array;
      if (e &amp;&amp; i &amp;&amp; i.byteLength &gt; 0) {
        var r = new ArrayBuffer(t),
          a = s &amp;&amp; s.buffer == i ? s : new Uint8Array(i);
        (s = this._u8Array = new Uint8Array(r)).set(a, 0),
          (i = this._buffer = r);
      } else (i = this._buffer = new ArrayBuffer(t)), (this._u8Array = null);
      return (
        this._checkArrayUse(),
        (this._upload = !0),
        (this._bufferSize = i.byteLength),
        this
      );
    }
    append(t) {
      var e, i;
      (this._upload = !0),
        (e = t.byteLength),
        t instanceof Uint8Array
          ? (this._resizeBuffer(this._byteLength + e, !0),
            (i = new Uint8Array(this._buffer, this._byteLength)))
          : t instanceof Uint16Array
            ? (this._resizeBuffer(this._byteLength + e, !0),
              (i = new Uint16Array(this._buffer, this._byteLength)))
            : t instanceof Float32Array &amp;&amp;
              (this._resizeBuffer(this._byteLength + e, !0),
              (i = new Float32Array(this._buffer, this._byteLength))),
        i.set(t, 0),
        (this._byteLength += e),
        this._checkArrayUse();
    }
    appendU16Array(t, e) {
      this._resizeBuffer(this._byteLength + 2 * e, !0);
      var i = new Uint16Array(this._buffer, this._byteLength, e);
      if (6 == e)
        (i[0] = t[0]),
          (i[1] = t[1]),
          (i[2] = t[2]),
          (i[3] = t[3]),
          (i[4] = t[4]),
          (i[5] = t[5]);
      else if (e &gt;= 100) i.set(new Uint16Array(t.buffer, 0, e));
      else for (var s = 0; s &lt; e; s++) i[s] = t[s];
      (this._byteLength += 2 * e), this._checkArrayUse();
    }
    appendEx(t, e) {
      var i;
      (this._upload = !0),
        (i = t.byteLength),
        this._resizeBuffer(this._byteLength + i, !0),
        new e(this._buffer, this._byteLength).set(t, 0),
        (this._byteLength += i),
        this._checkArrayUse();
    }
    appendEx2(t, e, i, s = 1) {
      var r, a, n;
      for (
        this._upload = !0,
          r = i * s,
          this._resizeBuffer(this._byteLength + r, !0),
          a = new e(this._buffer, this._byteLength),
          n = 0;
        n &lt; i;
        n++
      )
        a[n] = t[n];
      (this._byteLength += r), this._checkArrayUse();
    }
    getBuffer() {
      return this._buffer;
    }
    setNeedUpload() {
      this._upload = !0;
    }
    getNeedUpload() {
      return this._upload;
    }
    upload() {
      var t = g.instance,
        e = this._bind_upload();
      return (
        t.bindBuffer(this._bufferType, null),
        this._bufferType == t.ARRAY_BUFFER &amp;&amp; (Et._bindedVertexBuffer = null),
        this._bufferType == t.ELEMENT_ARRAY_BUFFER &amp;&amp;
          (Et._bindedIndexBuffer = null),
        (U.activeShader = null),
        e
      );
    }
    subUpload(t = 0, e = 0, i = 0) {
      var s = g.instance,
        r = this._bind_subUpload();
      return (
        s.bindBuffer(this._bufferType, null),
        this._bufferType == s.ARRAY_BUFFER &amp;&amp; (Et._bindedVertexBuffer = null),
        this._bufferType == s.ELEMENT_ARRAY_BUFFER &amp;&amp;
          (Et._bindedIndexBuffer = null),
        (U.activeShader = null),
        r
      );
    }
    _disposeResource() {
      (this._upload = !0), (this._uploadSize = 0);
    }
    clear() {
      (this._byteLength = 0), (this._upload = !0);
    }
  }
  (Ct.FLOAT32 = 4), (Ct.SHORT = 2);
  class At extends Ct {
    constructor(t = 35044) {
      super(),
        (this._bufferUsage = t),
        (this._bufferType = g.instance.ELEMENT_ARRAY_BUFFER),
        (this._buffer = new ArrayBuffer(8));
    }
    _checkArrayUse() {
      this._uint16Array &amp;&amp; (this._uint16Array = new Uint16Array(this._buffer));
    }
    getUint16Array() {
      return (
        this._uint16Array || (this._uint16Array = new Uint16Array(this._buffer))
      );
    }
    _bindForVAO() {
      var t = g.instance;
      t.bindBuffer(t.ELEMENT_ARRAY_BUFFER, this._glBuffer);
    }
    bind() {
      if (Et._bindedIndexBuffer !== this._glBuffer) {
        var t = g.instance;
        return (
          t.bindBuffer(t.ELEMENT_ARRAY_BUFFER, this._glBuffer),
          (Et._bindedIndexBuffer = this._glBuffer),
          !0
        );
      }
      return !1;
    }
    destory() {
      (this._uint16Array = null), (this._buffer = null);
    }
    disposeResource() {
      this._disposeResource();
    }
  }
  At.create = function (t = 35044) {
    return new At(t);
  };
  class bt extends Ct {
    constructor(t, e) {
      super(),
        (this._vertexStride = t),
        (this._bufferUsage = e),
        (this._bufferType = g.instance.ARRAY_BUFFER),
        (this._buffer = new ArrayBuffer(8)),
        (this._floatArray32 = new Float32Array(this._buffer)),
        (this._uint32Array = new Uint32Array(this._buffer));
    }
    get vertexStride() {
      return this._vertexStride;
    }
    getFloat32Array() {
      return this._floatArray32;
    }
    appendArray(t) {
      var e = this._byteLength &gt;&gt; 2;
      this.setByteLength(this._byteLength + 4 * t.length),
        this.getFloat32Array().set(t, e),
        (this._upload = !0);
    }
    _checkArrayUse() {
      this._floatArray32 &amp;&amp;
        (this._floatArray32 = new Float32Array(this._buffer)),
        this._uint32Array &amp;&amp;
          (this._uint32Array = new Uint32Array(this._buffer));
    }
    deleteBuffer() {
      super._disposeResource();
    }
    _bindForVAO() {
      var t = g.instance;
      t.bindBuffer(t.ARRAY_BUFFER, this._glBuffer);
    }
    bind() {
      if (Et._bindedVertexBuffer !== this._glBuffer) {
        var t = g.instance;
        return (
          t.bindBuffer(t.ARRAY_BUFFER, this._glBuffer),
          (Et._bindedVertexBuffer = this._glBuffer),
          !0
        );
      }
      return !1;
    }
    destroy() {
      super.destroy(),
        (this._byteLength = 0),
        (this._upload = !0),
        (this._buffer = null),
        (this._floatArray32 = null);
    }
  }
  bt.create = function (t, e = 35048) {
    return new bt(t, e);
  };
  class St {
    constructor(t, i, s) {
      (this._stride = 0),
        (this.vertNum = 0),
        (this.indexNum = 0),
        (this._applied = !1),
        (this._quadNum = 0),
        (this.canReuse = !1),
        (this._stride = t),
        (this._vb = new bt(t, g.instance.DYNAMIC_DRAW)),
        i
          ? this._vb._resizeBuffer(i, !1)
          : e.webGL2D_MeshAllocMaxMem &amp;&amp; this._vb._resizeBuffer(65536 * t, !1),
        (this._ib = new At()),
        s &amp;&amp; this._ib._resizeBuffer(s, !1);
    }
    cloneWithNewVB() {
      var t = new St(this._stride, 0, 0);
      return (
        (t._ib = this._ib),
        (t._quadNum = this._quadNum),
        (t._attribInfo = this._attribInfo),
        t
      );
    }
    cloneWithNewVBIB() {
      var t = new St(this._stride, 0, 0);
      return (t._attribInfo = this._attribInfo), t;
    }
    getVBW() {
      return this._vb.setNeedUpload(), this._vb;
    }
    getVBR() {
      return this._vb;
    }
    getIBR() {
      return this._ib;
    }
    getIBW() {
      return this._ib.setNeedUpload(), this._ib;
    }
    createQuadIB(t) {
      (this._quadNum = t),
        this._ib._resizeBuffer(6 * t * 2, !1),
        (this._ib.byteLength = this._ib.bufferLength);
      for (var e = this._ib.getUint16Array(), i = 0, s = 0, r = 0; r &lt; t; r++)
        (e[i++] = s),
          (e[i++] = s + 2),
          (e[i++] = s + 1),
          (e[i++] = s),
          (e[i++] = s + 3),
          (e[i++] = s + 2),
          (s += 4);
      this._ib.setNeedUpload();
    }
    setAttributes(t) {
      if (((this._attribInfo = t), this._attribInfo.length % 3 != 0))
        throw "Mesh2D setAttributes error!";
    }
    configVAO(t) {
      if (!this._applied) {
        (this._applied = !0),
          this._vao || (this._vao = new yt()),
          this._vao.bind(),
          this._vb._bindForVAO();
        for (var e = this._attribInfo.length / 3, i = 0, s = 0; s &lt; e; s++) {
          var r = this._attribInfo[i + 1],
            a = this._attribInfo[i],
            n = this._attribInfo[i + 2];
          t.enableVertexAttribArray(s),
            t.vertexAttribPointer(s, r, a, !1, this._stride, n),
            (i += 3);
        }
        this._vao.unBind();
      }
    }
    useMesh(t) {
      this._applied || this.configVAO(t),
        this._vao.bind(),
        this._vb.bind(),
        this._ib._bind_upload() || this._ib._bindForVAO(),
        this._vb._bind_upload() || this._vb.bind();
    }
    getEleNum() {
      return this._ib.getBuffer().byteLength / 2;
    }
    releaseMesh() {}
    destroy() {}
    clearVB() {
      this._vb.clear();
    }
  }
  St._gvaoid = 0;
  class wt extends St {
    constructor() {
      super(wt.const_stride, 4, 4),
        (this.canReuse = !0),
        this.setAttributes(wt._fixattriInfo),
        wt._fixib
          ? ((this._ib = wt._fixib), (this._quadNum = wt._maxIB))
          : (this.createQuadIB(wt._maxIB), (wt._fixib = this._ib));
    }
    static __int__() {
      wt._fixattriInfo = [5126, 4, 0, 5121, 4, 16, 5121, 4, 20];
    }
    static getAMesh(t) {
      var e = null;
      return (
        (e = wt._POOL.length ? wt._POOL.pop() : new wt()),
        t &amp;&amp; e._vb._resizeBuffer(65536 * wt.const_stride, !1),
        e
      );
    }
    releaseMesh() {
      this._vb.setByteLength(0),
        (this.vertNum = 0),
        (this.indexNum = 0),
        wt._POOL.push(this);
    }
    destroy() {
      this._vb.destroy(), this._vb.deleteBuffer();
    }
    addQuad(t, e, i, s) {
      var r = this._vb,
        a = r._byteLength &gt;&gt; 2;
      r.setByteLength((a + wt.const_stride) &lt;&lt; 2);
      var n = r._floatArray32 || r.getFloat32Array(),
        h = r._uint32Array,
        o = a,
        l = s ? 255 : 0;
      (n[o++] = t[0]),
        (n[o++] = t[1]),
        (n[o++] = e[0]),
        (n[o++] = e[1]),
        (h[o++] = i),
        (h[o++] = l),
        (n[o++] = t[2]),
        (n[o++] = t[3]),
        (n[o++] = e[2]),
        (n[o++] = e[3]),
        (h[o++] = i),
        (h[o++] = l),
        (n[o++] = t[4]),
        (n[o++] = t[5]),
        (n[o++] = e[4]),
        (n[o++] = e[5]),
        (h[o++] = i),
        (h[o++] = l),
        (n[o++] = t[6]),
        (n[o++] = t[7]),
        (n[o++] = e[6]),
        (n[o++] = e[7]),
        (h[o++] = i),
        (h[o++] = l),
        (r._upload = !0);
    }
  }
  (wt.const_stride = 24), (wt._maxIB = 16384), (wt._POOL = []);
  class Mt extends St {
    constructor() {
      super(Mt.const_stride, 4, 4),
        (this.canReuse = !0),
        this.setAttributes(Mt._fixattriInfo);
    }
    static __init__() {
      Mt._fixattriInfo = [5126, 4, 0, 5121, 4, 16, 5121, 4, 20];
    }
    static getAMesh(t) {
      var e;
      return (
        (e = Mt._POOL.length ? Mt._POOL.pop() : new Mt()),
        t &amp;&amp; e._vb._resizeBuffer(65536 * Mt.const_stride, !1),
        e
      );
    }
    addData(t, e, i, s, r) {
      var a = this._vb,
        n = this._ib,
        h = t.length &gt;&gt; 1,
        o = a.needSize(h * Mt.const_stride) &gt;&gt; 2,
        l = a._floatArray32 || a.getFloat32Array(),
        _ = a._uint32Array,
        u = 0,
        c = s.a,
        d = s.b,
        p = s.c,
        f = s.d,
        m = s.tx,
        g = s.ty,
        T = 0;
      for (T = 0; T &lt; h; T++) {
        var v = t[u],
          x = t[u + 1];
        (l[o] = v * c + x * p + m),
          (l[o + 1] = v * d + x * f + g),
          (l[o + 2] = e[u]),
          (l[o + 3] = e[u + 1]),
          (_[o + 4] = r),
          (_[o + 5] = 255),
          (o += 6),
          (u += 2);
      }
      a.setNeedUpload();
      var y = this.vertNum,
        E = i.length,
        R = n.needSize(i.byteLength),
        C = n.getUint16Array(),
        A = R &gt;&gt; 1;
      if (y &gt; 0) {
        var b = A + E,
          S = 0;
        for (T = A; T &lt; b; T++, S++) C[T] = i[S] + y;
      } else C.set(i, A);
      n.setNeedUpload(), (this.vertNum += h), (this.indexNum += i.length);
    }
    releaseMesh() {
      this._vb.setByteLength(0),
        this._ib.setByteLength(0),
        (this.vertNum = 0),
        (this.indexNum = 0),
        Mt._POOL.push(this);
    }
    destroy() {
      this._ib.destroy(),
        this._vb.destroy(),
        this._ib.disposeResource(),
        this._vb.deleteBuffer();
    }
  }
  (Mt.const_stride = 24), (Mt._POOL = []);
  class It extends St {
    constructor() {
      super(It.const_stride, 4, 4),
        (this.canReuse = !0),
        this.setAttributes(It._fixattriInfo);
    }
    static __init__() {
      It._fixattriInfo = [5126, 2, 0, 5121, 4, 8];
    }
    static getAMesh(t) {
      var e;
      return (
        (e = It._POOL.length ? It._POOL.pop() : new It()),
        t &amp;&amp; e._vb._resizeBuffer(65536 * It.const_stride, !1),
        e
      );
    }
    addVertAndIBToMesh(t, e, i, s) {
      for (
        var r = this._vb.needSize((e.length / 2) * It.const_stride) &gt;&gt; 2,
          a = this._vb._floatArray32 || this._vb.getFloat32Array(),
          n = this._vb._uint32Array,
          h = 0,
          o = e.length / 2,
          l = 0;
        l &lt; o;
        l++
      )
        (a[r++] = e[h]), (a[r++] = e[h + 1]), (h += 2), (n[r++] = i);
      this._vb.setNeedUpload(),
        this._ib.append(new Uint16Array(s)),
        this._ib.setNeedUpload(),
        (this.vertNum += o),
        (this.indexNum += s.length);
    }
    releaseMesh() {
      this._vb.setByteLength(0),
        this._ib.setByteLength(0),
        (this.vertNum = 0),
        (this.indexNum = 0),
        It._POOL.push(this);
    }
    destroy() {
      this._ib.destroy(),
        this._vb.destroy(),
        this._ib.disposeResource(),
        this._vb.deleteBuffer();
    }
  }
  (It.const_stride = 12), (It._POOL = []);
  class Pt {
    constructor(t, e) {
      (this.submitStartPos = 0),
        (this.submitEndPos = 0),
        (this.touches = []),
        (this.submits = []),
        (this.sprite = null),
        (this.meshlist = []),
        (this.cachedClipInfo = new p()),
        (this.oldTx = 0),
        (this.oldTy = 0),
        (this.invMat = new p()),
        (this.context = t),
        (this.sprite = e),
        t._globalClipMatrix.copyTo(this.cachedClipInfo);
    }
    startRec() {
      let t = this.context;
      t._charSubmitCache &amp;&amp;
        t._charSubmitCache._enable &amp;&amp;
        (t._charSubmitCache.enable(!1, t), t._charSubmitCache.enable(!0, t)),
        (t._incache = !0),
        (this.touches.length = 0),
        (t.touches = this.touches),
        t._globalClipMatrix.copyTo(this.cachedClipInfo),
        (this.submits.length = 0),
        (this.submitStartPos = t._submits._length);
      for (var e = 0, i = this.meshlist.length; e &lt; i; e++) {
        var s = this.meshlist[e];
        s.canReuse ? s.releaseMesh() : s.destroy();
      }
      (this.meshlist.length = 0),
        (this._mesh = wt.getAMesh(!1)),
        (this._pathMesh = It.getAMesh(!1)),
        (this._triangleMesh = Mt.getAMesh(!1)),
        this.meshlist.push(this._mesh),
        this.meshlist.push(this._pathMesh),
        this.meshlist.push(this._triangleMesh),
        (t._curSubmit = pt.RENDERBASE),
        (this._oldMesh = t._mesh),
        (this._oldPathMesh = t._pathMesh),
        (this._oldTriMesh = t._triangleMesh),
        (this._oldMeshList = t.meshlist),
        (t._mesh = this._mesh),
        (t._pathMesh = this._pathMesh),
        (t._triangleMesh = this._triangleMesh),
        (t.meshlist = this.meshlist),
        (this.oldTx = t._curMat.tx),
        (this.oldTy = t._curMat.ty),
        (t._curMat.tx = 0),
        (t._curMat.ty = 0),
        t._curMat.copyTo(this.invMat),
        this.invMat.invert();
    }
    endRec() {
      let t = this.context;
      t._charSubmitCache &amp;&amp;
        t._charSubmitCache._enable &amp;&amp;
        (t._charSubmitCache.enable(!1, t), t._charSubmitCache.enable(!0, t));
      var e = t._submits;
      this.submitEndPos = e._length;
      for (var i = this.submitEndPos - this.submitStartPos, s = 0; s &lt; i; s++)
        this.submits.push(e[this.submitStartPos + s]);
      (e._length -= i),
        (t._mesh = this._oldMesh),
        (t._pathMesh = this._oldPathMesh),
        (t._triangleMesh = this._oldTriMesh),
        (t.meshlist = this._oldMeshList),
        (t._curSubmit = pt.RENDERBASE),
        (t._curMat.tx = this.oldTx),
        (t._curMat.ty = this.oldTy),
        (t.touches = null),
        (t._incache = !1);
    }
    isCacheValid() {
      var t = this.context._globalClipMatrix;
      return (
        t.a == this.cachedClipInfo.a &amp;&amp;
        t.b == this.cachedClipInfo.b &amp;&amp;
        t.c == this.cachedClipInfo.c &amp;&amp;
        t.d == this.cachedClipInfo.d &amp;&amp;
        t.tx == this.cachedClipInfo.tx &amp;&amp;
        t.ty == this.cachedClipInfo.ty
      );
    }
    flushsubmit() {
      var t = pt.RENDERBASE;
      this.submits.forEach(function (e) {
        e != pt.RENDERBASE &amp;&amp; ((pt.preRender = t), (t = e), e.renderSubmit());
      });
    }
    releaseMem() {}
  }
  Pt.matI = new p();
  var Lt =
      "/*\r\n\ttextureå’Œfillrectä½¿ç”¨çš„ã€‚\r\n*/\r\nattribute vec4 posuv;\r\nattribute vec4 attribColor;\r\nattribute vec4 attribFlags;\r\n//attribute vec4 clipDir;\r\n//attribute vec2 clipRect;\r\nuniform vec4 clipMatDir;\r\nuniform vec2 clipMatPos;\t\t// è¿™ä¸ªæ˜¯å…¨å±€çš„ï¼Œä¸ç”¨å†åº”ç”¨çŸ©é˜µäº†ã€‚\r\nvarying vec2 cliped;\r\nuniform vec2 size;\r\nuniform vec2 clipOff;\t\t\t// ä½¿ç”¨è¦æŠŠclipåç§»ã€‚cacheas normalç”¨. åªç”¨äº†[0]\r\n#ifdef WORLDMAT\r\n\tuniform mat4 mmat;\r\n#endif\r\n#ifdef MVP3D\r\n\tuniform mat4 u_MvpMatrix;\r\n#endif\r\nvarying vec4 v_texcoordAlpha;\r\nvarying vec4 v_color;\r\nvarying float v_useTex;\r\n\r\nvoid main() {\r\n\r\n\tvec4 pos = vec4(posuv.xy,0.,1.);\r\n#ifdef WORLDMAT\r\n\tpos=mmat*pos;\r\n#endif\r\n\tvec4 pos1  =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);\r\n#ifdef MVP3D\r\n\tgl_Position=u_MvpMatrix*pos1;\r\n#else\r\n\tgl_Position=pos1;\r\n#endif\r\n\tv_texcoordAlpha.xy = posuv.zw;\r\n\t//v_texcoordAlpha.z = attribColor.a/255.0;\r\n\tv_color = attribColor/255.0;\r\n\tv_color.xyz*=v_color.w;//åæ­£åŽé¢ä¹Ÿè¦é¢„ä¹˜\r\n\t\r\n\tv_useTex = attribFlags.r/255.0;\r\n\tfloat clipw = length(clipMatDir.xy);\r\n\tfloat cliph = length(clipMatDir.zw);\r\n\t\r\n\tvec2 clpos = clipMatPos.xy;\r\n\t#ifdef WORLDMAT\r\n\t\t// å¦‚æžœæœ‰mmatï¼Œéœ€è¦ä¿®æ”¹clipMatPos,å›&nbsp;ä¸º è¿™æ˜¯cacheas normal ï¼ˆå¦‚æžœä¸æ˜¯å°±é”™äº†ï¼‰ï¼Œ clipMatPosè¢«åŽ»æŽ‰äº†åç§»\r\n\t\tif(clipOff[0]&gt;0.0){\r\n\t\t\tclpos.x+=mmat[3].x;\t//tx\tæœ€ç®€å•å¤„ç†\r\n\t\t\tclpos.y+=mmat[3].y;\t//ty\r\n\t\t}\r\n\t#endif\r\n\tvec2 clippos = pos.xy - clpos;\t//poså·²ç»åº”ç”¨çŸ©é˜µäº†ï¼Œä¸ºäº†å‡çš„æœ‰æ„ä¹‰ï¼Œclipçš„ä½ç½®ä¹Ÿè¦ç¼©æ”¾\r\n\tif(clipw&gt;20000. &amp;&amp; cliph&gt;20000.)\r\n\t\tcliped = vec2(0.5,0.5);\r\n\telse {\r\n\t\t//è½¬æˆ0åˆ°1ä¹‹é—´ã€‚/clipw/clipw è¡¨ç¤ºclipposä¸Žnormalizeä¹‹åŽçš„clipæœå‘ç‚¹ç§¯ä¹‹åŽï¼Œå†é™¤ä»¥clipw\r\n\t\tcliped=vec2( dot(clippos,clipMatDir.xy)/clipw/clipw, dot(clippos,clipMatDir.zw)/cliph/cliph);\r\n\t}\r\n\r\n}",
    Dt =
      "/*\r\n\ttextureå’Œfillrectä½¿ç”¨çš„ã€‚\r\n*/\r\n#if defined(GL_FRAGMENT_PRECISION_HIGH)//Â&nbsp;åŽŸæ¥çš„å†™æ³•ä¼šè¢«æˆ‘ä»¬è‡ªå·±çš„è§£æžæµç¨‹å¤„ç†ï¼Œè€Œæˆ‘ä»¬çš„è§£æžæ˜¯ä¸è®¤å†…ç½®å®çš„ï¼Œå¯¼è‡´è¢«åˆ&nbsp;æŽ‰ï¼Œæ‰€ä»¥æ”¹æˆÂ&nbsp;ifÂ&nbsp;definedÂ&nbsp;äº†\r\nprecision highp float;\r\n#else\r\nprecision mediump float;\r\n#endif\r\n\r\nvarying vec4 v_texcoordAlpha;\r\nvarying vec4 v_color;\r\nvarying float v_useTex;\r\nuniform sampler2D texture;\r\nvarying vec2 cliped;\r\n\r\n#ifdef BLUR_FILTER\r\nuniform vec4 strength_sig2_2sig2_gauss1;//TODOæ¨¡ç³Šçš„è¿‡ç¨‹ä¸­ä¼šå¯¼è‡´å˜æš—å˜äº®  \r\nuniform vec2 blurInfo;\r\n\r\n#define PI 3.141593\r\n\r\nfloat getGaussian(float x, float y){\r\n    return strength_sig2_2sig2_gauss1.w*exp(-(x*x+y*y)/strength_sig2_2sig2_gauss1.z);\r\n}\r\n\r\nvec4 blur(){\r\n    const float blurw = 9.0;\r\n    vec4 vec4Color = vec4(0.0,0.0,0.0,0.0);\r\n    vec2 halfsz=vec2(blurw,blurw)/2.0/blurInfo;    \r\n    vec2 startpos=v_texcoordAlpha.xy-halfsz;\r\n    vec2 ctexcoord = startpos;\r\n    vec2 step = 1.0/blurInfo;  //æ¯ä¸ªåƒç´&nbsp;      \r\n    \r\n    for(float y = 0.0;y&lt;=blurw; ++y){\r\n        ctexcoord.x=startpos.x;\r\n        for(float x = 0.0;x&lt;=blurw; ++x){\r\n            //TODO çº¹ç†åæ&nbsp;‡çš„å›ºå®šåç§»åº”è¯¥åœ¨vsä¸­å¤„ç†\r\n            vec4Color += texture2D(texture, ctexcoord)*getGaussian(x-blurw/2.0,y-blurw/2.0);\r\n            ctexcoord.x+=step.x;\r\n        }\r\n        ctexcoord.y+=step.y;\r\n    }\r\n    //vec4Color.w=1.0;  è¿™ä¸ªä¼šå¯¼è‡´ä¸¢å¤±alphaã€‚ä»¥åŽæœ‰æ—¶é—´å†æ‰¾æ¨¡ç³Šä¼šå¯¼è‡´é€æ˜Žçš„é—®é¢˜\r\n    return vec4Color;\r\n}\r\n#endif\r\n\r\n#ifdef COLOR_FILTER\r\nuniform vec4 colorAlpha;\r\nuniform mat4 colorMat;\r\n#endif\r\n\r\n#ifdef GLOW_FILTER\r\nuniform vec4 u_color;\r\nuniform vec4 u_blurInfo1;\r\nuniform vec4 u_blurInfo2;\r\n#endif\r\n\r\n#ifdef COLOR_ADD\r\nuniform vec4 colorAdd;\r\n#endif\r\n\r\n#ifdef FILLTEXTURE\t\r\nuniform vec4 u_TexRange;//startu,startv,urange, vrange\r\n#endif\r\nvoid main() {\r\n\tif(cliped.x&lt;0.) discard;\r\n\tif(cliped.x&gt;1.) discard;\r\n\tif(cliped.y&lt;0.) discard;\r\n\tif(cliped.y&gt;1.) discard;\r\n\t\r\n#ifdef FILLTEXTURE\t\r\n   vec4 color= texture2D(texture, fract(v_texcoordAlpha.xy)*u_TexRange.zw + u_TexRange.xy);\r\n#else\r\n   vec4 color= texture2D(texture, v_texcoordAlpha.xy);\r\n#endif\r\n\r\n   if(v_useTex&lt;=0.)color = vec4(1.,1.,1.,1.);\r\n   color.a*=v_color.w;\r\n   //color.rgb*=v_color.w;\r\n   color.rgb*=v_color.rgb;\r\n   gl_FragColor=color;\r\n   \r\n   #ifdef COLOR_ADD\r\n\tgl_FragColor = vec4(colorAdd.rgb,colorAdd.a*gl_FragColor.a);\r\n\tgl_FragColor.xyz *= colorAdd.a;\r\n   #endif\r\n   \r\n   #ifdef BLUR_FILTER\r\n\tgl_FragColor =   blur();\r\n\tgl_FragColor.w*=v_color.w;   \r\n   #endif\r\n   \r\n   #ifdef COLOR_FILTER\r\n\tmat4 alphaMat =colorMat;\r\n\r\n\talphaMat[0][3] *= gl_FragColor.a;\r\n\talphaMat[1][3] *= gl_FragColor.a;\r\n\talphaMat[2][3] *= gl_FragColor.a;\r\n\r\n\tgl_FragColor = gl_FragColor * alphaMat;\r\n\tgl_FragColor += colorAlpha/255.0*gl_FragColor.a;\r\n   #endif\r\n   \r\n   #ifdef GLOW_FILTER\r\n\tconst float c_IterationTime = 10.0;\r\n\tfloat floatIterationTotalTime = c_IterationTime * c_IterationTime;\r\n\tvec4 vec4Color = vec4(0.0,0.0,0.0,0.0);\r\n\tvec2 vec2FilterDir = vec2(-(u_blurInfo1.z)/u_blurInfo2.x,-(u_blurInfo1.w)/u_blurInfo2.y);\r\n\tvec2 vec2FilterOff = vec2(u_blurInfo1.x/u_blurInfo2.x/c_IterationTime * 2.0,u_blurInfo1.y/u_blurInfo2.y/c_IterationTime * 2.0);\r\n\tfloat maxNum = u_blurInfo1.x * u_blurInfo1.y;\r\n\tvec2 vec2Off = vec2(0.0,0.0);\r\n\tfloat floatOff = c_IterationTime/2.0;\r\n\tfor(float i = 0.0;i&lt;=c_IterationTime; ++i){\r\n\t\tfor(float j = 0.0;j&lt;=c_IterationTime; ++j){\r\n\t\t\tvec2Off = vec2(vec2FilterOff.x * (i - floatOff),vec2FilterOff.y * (j - floatOff));\r\n\t\t\tvec4Color += texture2D(texture, v_texcoordAlpha.xy + vec2FilterDir + vec2Off)/floatIterationTotalTime;\r\n\t\t}\r\n\t}\r\n\tgl_FragColor = vec4(u_color.rgb,vec4Color.a * u_blurInfo2.z);\r\n\tgl_FragColor.rgb *= gl_FragColor.a;   \r\n   #endif\r\n   \r\n}",
    Bt =
      "attribute vec4 position;\r\nattribute vec4 attribColor;\r\n//attribute vec4 clipDir;\r\n//attribute vec2 clipRect;\r\nuniform vec4 clipMatDir;\r\nuniform vec2 clipMatPos;\r\n#ifdef WORLDMAT\r\n\tuniform mat4 mmat;\r\n#endif\r\nuniform mat4 u_mmat2;\r\n//uniform vec2 u_pos;\r\nuniform vec2 size;\r\nvarying vec4 color;\r\n//vec4 dirxy=vec4(0.9,0.1, -0.1,0.9);\r\n//vec4 clip=vec4(100.,30.,300.,600.);\r\nvarying vec2 cliped;\r\nvoid main(){\r\n\t\r\n#ifdef WORLDMAT\r\n\tvec4 pos=mmat*vec4(position.xy,0.,1.);\r\n\tgl_Position =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,pos.z,1.0);\r\n#else\r\n\tgl_Position =vec4((position.x/size.x-0.5)*2.0,(0.5-position.y/size.y)*2.0,position.z,1.0);\r\n#endif\t\r\n\tfloat clipw = length(clipMatDir.xy);\r\n\tfloat cliph = length(clipMatDir.zw);\r\n\tvec2 clippos = position.xy - clipMatPos.xy;\t//poså·²ç»åº”ç”¨çŸ©é˜µäº†ï¼Œä¸ºäº†å‡çš„æœ‰æ„ä¹‰ï¼Œclipçš„ä½ç½®ä¹Ÿè¦ç¼©æ”¾\r\n\tif(clipw&gt;20000. &amp;&amp; cliph&gt;20000.)\r\n\t\tcliped = vec2(0.5,0.5);\r\n\telse {\r\n\t\t//clipdiræ˜¯å¸¦ç¼©æ”¾çš„æ–¹å‘ï¼Œç”±äºŽä¸Šé¢clipposæ˜¯åœ¨ç¼©æ”¾åŽçš„ç©ºé—´è®¡ç®—çš„ï¼Œæ‰€ä»¥éœ€è¦æŠŠæ–¹å‘å…ˆnormalizeä¸€ä¸‹\r\n\t\tcliped=vec2( dot(clippos,clipMatDir.xy)/clipw/clipw, dot(clippos,clipMatDir.zw)/cliph/cliph);\r\n\t}\r\n  //pos2d.x = dot(clippos,dirx);\r\n  color=attribColor/255.;\r\n}",
    Ft =
      "precision mediump float;\r\n//precision mediump float;\r\nvarying vec4 color;\r\n//uniform float alpha;\r\nvarying vec2 cliped;\r\nvoid main(){\r\n\t//vec4 a=vec4(color.r, color.g, color.b, 1);\r\n\t//a.a*=alpha;\r\n    gl_FragColor= color;// vec4(color.r, color.g, color.b, alpha);\r\n\tgl_FragColor.rgb*=color.a;\r\n\tif(cliped.x&lt;0.) discard;\r\n\tif(cliped.x&gt;1.) discard;\r\n\tif(cliped.y&lt;0.) discard;\r\n\tif(cliped.y&gt;1.) discard;\r\n}",
    Ot =
      "attribute vec2 position;\r\nattribute vec2 texcoord;\r\nattribute vec4 color;\r\nuniform vec2 size;\r\nuniform float offsetX;\r\nuniform float offsetY;\r\nuniform mat4 mmat;\r\nuniform mat4 u_mmat2;\r\nvarying vec2 v_texcoord;\r\nvarying vec4 v_color;\r\nvoid main() {\r\n  vec4 pos=mmat*u_mmat2*vec4(offsetX+position.x,offsetY+position.y,0,1 );\r\n  gl_Position = vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,pos.z,1.0);\r\n  v_color = color;\r\n  v_color.rgb *= v_color.a;\r\n  v_texcoord = texcoord;  \r\n}",
    Nt =
      "precision mediump float;\r\nvarying vec2 v_texcoord;\r\nvarying vec4 v_color;\r\nuniform sampler2D texture;\r\nuniform float alpha;\r\nvoid main() {\r\n\tvec4 t_color = texture2D(texture, v_texcoord);\r\n\tgl_FragColor = t_color.rgba * v_color;\r\n\tgl_FragColor *= alpha;\r\n}";
  class Ut {
    constructor() {
      (this.ALPHA = 1),
        (this.defines = new X()),
        (this.shaderType = 0),
        (this.fillStyle = ut.DEFAULT),
        (this.strokeStyle = ut.DEFAULT);
    }
    destroy() {
      (this.defines = null), (this.filters = null);
    }
    static __init__() {
      K.preCompile2D(0, X.TEXTURE2D, Lt, Dt, null),
        K.preCompile2D(0, X.PRIMITIVE, Bt, Ft, null),
        K.preCompile2D(0, X.SKINMESH, Ot, Nt, null);
    }
  }
  class Gt {
    constructor() {
      var t = g.instance;
      (this.ib = At.create(t.DYNAMIC_DRAW)), (this.vb = bt.create(8));
    }
    static getInstance() {
      return (Gt.instance = Gt.instance || new Gt());
    }
    addSkinMesh(t) {
      t.getData2(this.vb, this.ib, this.vb._byteLength / 32);
    }
    reset() {
      this.vb.clear(), this.ib.clear();
    }
  }
  class kt {
    static createLine2(t, e, i, s, r, a) {
      if (t.length &lt; 4) return null;
      var n =
        kt.tempData.length &gt; t.length + 2
          ? kt.tempData
          : new Array(t.length + 2);
      (n[0] = t[0]), (n[1] = t[1]);
      var h = 2,
        o = 0,
        l = t.length;
      for (o = 2; o &lt; l; o += 2)
        Math.abs(t[o] - t[o - 2]) + Math.abs(t[o + 1] - t[o - 1]) &gt; 0.01 &amp;&amp;
          ((n[h++] = t[o]), (n[h++] = t[o + 1]));
      a &amp;&amp;
        Math.abs(t[0] - n[h - 2]) + Math.abs(t[1] - n[h - 1]) &gt; 0.01 &amp;&amp;
        ((n[h++] = t[0]), (n[h++] = t[1]));
      var _ = r;
      l = h / 2;
      var u,
        c,
        d,
        p,
        f,
        m,
        g,
        T,
        v,
        x,
        y,
        E,
        R,
        C,
        A,
        b,
        S,
        w,
        M,
        I,
        P = i / 2;
      for (
        d = n[0],
          p = n[1],
          x = d - (f = n[2]),
          v = ((v = -(p - (m = n[3]))) / (I = Math.sqrt(v * v + x * x))) * P,
          x = (x / I) * P,
          _.push(d - v, p - x, d + v, p + x),
          o = 1;
        o &lt; l - 1;
        o++
      )
        (d = n[2 * (o - 1)]),
          (p = n[2 * (o - 1) + 1]),
          (f = n[2 * o]),
          (m = n[2 * o + 1]),
          (g = n[2 * (o + 1)]),
          (T = n[2 * (o + 1) + 1]),
          (x = d - f),
          (E = f - g),
          (A =
            (-(v = ((v = -(p - m)) / (I = Math.sqrt(v * v + x * x))) * P) + d) *
              (-(x = (x / I) * P) + m) -
            (-v + f) * (-x + p)),
          (w =
            (-(y = ((y = -(m - T)) / (I = Math.sqrt(y * y + E * E))) * P) + g) *
              (-(E = (E / I) * P) + m) -
            (-y + f) * (-E + T)),
          (M =
            (R = -x + p - (-x + m)) * (S = -y + f - (-y + g)) -
            (b = -E + T - (-E + m)) * (C = -v + f - (-v + d))),
          Math.abs(M) &lt; 0.1
            ? ((M += 10.1), _.push(f - v, m - x, f + v, m + x))
            : ((u = (C * w - S * A) / M),
              (c = (b * A - R * w) / M),
              _.push(u, c, f - (u - f), m - (c - m)));
      for (
        d = n[h - 4],
          p = n[h - 3],
          x = d - (f = n[h - 2]),
          v =
            ((v = -(p - (m = n[h - 1]))) / (I = Math.sqrt(v * v + x * x))) * P,
          x = (x / I) * P,
          _.push(f - v, m - x, f + v, m + x),
          o = 1;
        o &lt; l;
        o++
      )
        e.push(
          s + 2 * (o - 1),
          s + 2 * (o - 1) + 1,
          s + 2 * o + 1,
          s + 2 * o + 1,
          s + 2 * o,
          s + 2 * (o - 1),
        );
      return _;
    }
    static createLineTriangle(t, e, i, s, r, a, n) {
      var h = t.slice(),
        o = h.length,
        l = h[0],
        _ = h[1],
        u = h[2],
        c = (h[2], 0),
        d = 0,
        p = 0,
        f = 0,
        m = o / 2;
      if (!(m &lt;= 1) &amp;&amp; 2 != m) {
        for (var g = new Array(4 * m), T = 0, v = 0, x = 0; x &lt; m - 1; x++)
          (l = h[v++]),
            (_ = h[v++]),
            (u = h[v++]),
            (f = h[v++] - _),
            0 != (p = u - l) &amp;&amp;
              0 != f &amp;&amp;
              (c = Math.sqrt(p * p + f * f)) &gt; 0.001 &amp;&amp;
              ((g[(d = 4 * T)] = l),
              (g[d + 1] = _),
              (g[d + 2] = p / c),
              (g[d + 3] = f / c),
              T++);
        for (
          s
            ? ((l = h[o - 2]),
              (_ = h[o - 1]),
              (u = h[0]),
              (f = h[1] - _),
              0 != (p = u - l) &amp;&amp;
                0 != f &amp;&amp;
                (c = Math.sqrt(p * p + f * f)) &gt; 0.001 &amp;&amp;
                ((g[(d = 4 * T)] = l),
                (g[d + 1] = _),
                (g[d + 2] = p / c),
                (g[d + 3] = f / c),
                T++))
            : ((g[(d = 4 * T)] = l),
              (g[d + 1] = _),
              (g[d + 2] = p / c),
              (g[d + 3] = f / c),
              T++),
            v = 0,
            x = 0;
          x &lt; m;
          x++
        )
          (l = h[v]), (_ = h[v + 1]), (u = h[v + 2]), h[v + 3];
      }
    }
  }
  kt.tempData = new Array(256);
  class Wt {
    constructor(t, e, i) {
      (this.i = t),
        (this.x = e),
        (this.y = i),
        (this.prev = null),
        (this.next = null),
        (this.z = null),
        (this.prevZ = null),
        (this.nextZ = null),
        (this.steiner = !1);
    }
  }
  class Yt {
    static earcut(t, e, i) {
      i = i || 2;
      var s,
        r,
        a,
        n,
        h,
        o,
        l,
        _ = e &amp;&amp; e.length,
        u = _ ? e[0] * i : t.length,
        c = Yt.linkedList(t, 0, u, i, !0),
        d = [];
      if (!c) return d;
      if ((_ &amp;&amp; (c = Yt.eliminateHoles(t, e, c, i)), t.length &gt; 80 * i)) {
        (s = a = t[0]), (r = n = t[1]);
        for (var p = i; p &lt; u; p += i)
          (h = t[p]) &lt; s &amp;&amp; (s = h),
            (o = t[p + 1]) &lt; r &amp;&amp; (r = o),
            h &gt; a &amp;&amp; (a = h),
            o &gt; n &amp;&amp; (n = o);
        l = 0 !== (l = Math.max(a - s, n - r)) ? 1 / l : 0;
      }
      return Yt.earcutLinked(c, d, i, s, r, l), d;
    }
    static linkedList(t, e, i, s, r) {
      var a, n;
      if (r === Yt.signedArea(t, e, i, s) &gt; 0)
        for (a = e; a &lt; i; a += s) n = Yt.insertNode(a, t[a], t[a + 1], n);
      else
        for (a = i - s; a &gt;= e; a -= s) n = Yt.insertNode(a, t[a], t[a + 1], n);
      return n &amp;&amp; Yt.equals(n, n.next) &amp;&amp; (Yt.removeNode(n), (n = n.next)), n;
    }
    static filterPoints(t, e) {
      if (!t) return t;
      e || (e = t);
      var i,
        s = t;
      do {
        if (
          ((i = !1),
          s.steiner ||
            (!Yt.equals(s, s.next) &amp;&amp; 0 !== Yt.area(s.prev, s, s.next)))
        )
          s = s.next;
        else {
          if ((Yt.removeNode(s), (s = e = s.prev) === s.next)) break;
          i = !0;
        }
      } while (i || s !== e);
      return e;
    }
    static earcutLinked(t, e, i, s, r, a, n = null) {
      if (t) {
        !n &amp;&amp; a &amp;&amp; Yt.indexCurve(t, s, r, a);
        for (var h, o, l = t; t.prev !== t.next; )
          if (
            ((h = t.prev),
            (o = t.next),
            a ? Yt.isEarHashed(t, s, r, a) : Yt.isEar(t))
          )
            e.push(h.i / i),
              e.push(t.i / i),
              e.push(o.i / i),
              Yt.removeNode(t),
              (t = o.next),
              (l = o.next);
          else if ((t = o) === l) {
            n
              ? 1 === n
                ? ((t = Yt.cureLocalIntersections(t, e, i)),
                  Yt.earcutLinked(t, e, i, s, r, a, 2))
                : 2 === n &amp;&amp; Yt.splitEarcut(t, e, i, s, r, a)
              : Yt.earcutLinked(Yt.filterPoints(t, null), e, i, s, r, a, 1);
            break;
          }
      }
    }
    static isEar(t) {
      var e = t.prev,
        i = t,
        s = t.next;
      if (Yt.area(e, i, s) &gt;= 0) return !1;
      for (var r = t.next.next; r !== t.prev; ) {
        if (
          Yt.pointInTriangle(e.x, e.y, i.x, i.y, s.x, s.y, r.x, r.y) &amp;&amp;
          Yt.area(r.prev, r, r.next) &gt;= 0
        )
          return !1;
        r = r.next;
      }
      return !0;
    }
    static isEarHashed(t, e, i, s) {
      var r = t.prev,
        a = t,
        n = t.next;
      if (Yt.area(r, a, n) &gt;= 0) return !1;
      for (
        var h = r.x &lt; a.x ? (r.x &lt; n.x ? r.x : n.x) : a.x &lt; n.x ? a.x : n.x,
          o = r.y &lt; a.y ? (r.y &lt; n.y ? r.y : n.y) : a.y &lt; n.y ? a.y : n.y,
          l = r.x &gt; a.x ? (r.x &gt; n.x ? r.x : n.x) : a.x &gt; n.x ? a.x : n.x,
          _ = r.y &gt; a.y ? (r.y &gt; n.y ? r.y : n.y) : a.y &gt; n.y ? a.y : n.y,
          u = Yt.zOrder(h, o, e, i, s),
          c = Yt.zOrder(l, _, e, i, s),
          d = t.nextZ;
        d &amp;&amp; d.z &lt;= c;

      ) {
        if (
          d !== t.prev &amp;&amp;
          d !== t.next &amp;&amp;
          Yt.pointInTriangle(r.x, r.y, a.x, a.y, n.x, n.y, d.x, d.y) &amp;&amp;
          Yt.area(d.prev, d, d.next) &gt;= 0
        )
          return !1;
        d = d.nextZ;
      }
      for (d = t.prevZ; d &amp;&amp; d.z &gt;= u; ) {
        if (
          d !== t.prev &amp;&amp;
          d !== t.next &amp;&amp;
          Yt.pointInTriangle(r.x, r.y, a.x, a.y, n.x, n.y, d.x, d.y) &amp;&amp;
          Yt.area(d.prev, d, d.next) &gt;= 0
        )
          return !1;
        d = d.prevZ;
      }
      return !0;
    }
    static cureLocalIntersections(t, e, i) {
      var s = t;
      do {
        var r = s.prev,
          a = s.next.next;
        !Yt.equals(r, a) &amp;&amp;
          Yt.intersects(r, s, s.next, a) &amp;&amp;
          Yt.locallyInside(r, a) &amp;&amp;
          Yt.locallyInside(a, r) &amp;&amp;
          (e.push(r.i / i),
          e.push(s.i / i),
          e.push(a.i / i),
          Yt.removeNode(s),
          Yt.removeNode(s.next),
          (s = t = a)),
          (s = s.next);
      } while (s !== t);
      return s;
    }
    static splitEarcut(t, e, i, s, r, a) {
      var n = t;
      do {
        for (var h = n.next.next; h !== n.prev; ) {
          if (n.i !== h.i &amp;&amp; Yt.isValidDiagonal(n, h)) {
            var o = Yt.splitPolygon(n, h);
            return (
              (n = Yt.filterPoints(n, n.next)),
              (o = Yt.filterPoints(o, o.next)),
              Yt.earcutLinked(n, e, i, s, r, a),
              void Yt.earcutLinked(o, e, i, s, r, a)
            );
          }
          h = h.next;
        }
        n = n.next;
      } while (n !== t);
    }
    static eliminateHoles(t, e, i, s) {
      var r,
        a,
        n,
        h,
        o,
        l = [];
      for (r = 0, a = e.length; r &lt; a; r++)
        (n = e[r] * s),
          (h = r &lt; a - 1 ? e[r + 1] * s : t.length),
          (o = Yt.linkedList(t, n, h, s, !1)) === o.next &amp;&amp; (o.steiner = !0),
          l.push(Yt.getLeftmost(o));
      for (l.sort(Yt.compareX), r = 0; r &lt; l.length; r++)
        Yt.eliminateHole(l[r], i), (i = Yt.filterPoints(i, i.next));
      return i;
    }
    static compareX(t, e) {
      return t.x - e.x;
    }
    static eliminateHole(t, e) {
      if ((e = Yt.findHoleBridge(t, e))) {
        var i = Yt.splitPolygon(e, t);
        Yt.filterPoints(i, i.next);
      }
    }
    static findHoleBridge(t, e) {
      var i,
        s = e,
        r = t.x,
        a = t.y,
        n = -1 / 0;
      do {
        if (a &lt;= s.y &amp;&amp; a &gt;= s.next.y &amp;&amp; s.next.y !== s.y) {
          var h = s.x + ((a - s.y) * (s.next.x - s.x)) / (s.next.y - s.y);
          if (h &lt;= r &amp;&amp; h &gt; n) {
            if (((n = h), h === r)) {
              if (a === s.y) return s;
              if (a === s.next.y) return s.next;
            }
            i = s.x &lt; s.next.x ? s : s.next;
          }
        }
        s = s.next;
      } while (s !== e);
      if (!i) return null;
      if (r === n) return i.prev;
      var o,
        l = i,
        _ = i.x,
        u = i.y,
        c = 1 / 0;
      for (s = i.next; s !== l; )
        r &gt;= s.x &amp;&amp;
          s.x &gt;= _ &amp;&amp;
          r !== s.x &amp;&amp;
          Yt.pointInTriangle(
            a &lt; u ? r : n,
            a,
            _,
            u,
            a &lt; u ? n : r,
            a,
            s.x,
            s.y,
          ) &amp;&amp;
          ((o = Math.abs(a - s.y) / (r - s.x)) &lt; c || (o === c &amp;&amp; s.x &gt; i.x)) &amp;&amp;
          Yt.locallyInside(s, t) &amp;&amp;
          ((i = s), (c = o)),
          (s = s.next);
      return i;
    }
    static indexCurve(t, e, i, s) {
      var r = t;
      do {
        null === r.z &amp;&amp; (r.z = Yt.zOrder(r.x, r.y, e, i, s)),
          (r.prevZ = r.prev),
          (r.nextZ = r.next),
          (r = r.next);
      } while (r !== t);
      (r.prevZ.nextZ = null), (r.prevZ = null), Yt.sortLinked(r);
    }
    static sortLinked(t) {
      var e,
        i,
        s,
        r,
        a,
        n,
        h,
        o,
        l = 1;
      do {
        for (i = t, t = null, a = null, n = 0; i; ) {
          for (n++, s = i, h = 0, e = 0; e &lt; l &amp;&amp; (h++, (s = s.nextZ)); e++);
          for (o = l; h &gt; 0 || (o &gt; 0 &amp;&amp; s); )
            0 !== h &amp;&amp; (0 === o || !s || i.z &lt;= s.z)
              ? ((r = i), (i = i.nextZ), h--)
              : ((r = s), (s = s.nextZ), o--),
              a ? (a.nextZ = r) : (t = r),
              (r.prevZ = a),
              (a = r);
          i = s;
        }
        (a.nextZ = null), (l *= 2);
      } while (n &gt; 1);
      return t;
    }
    static zOrder(t, e, i, s, r) {
      return (
        (t =
          1431655765 &amp;
          ((t =
            858993459 &amp;
            ((t =
              252645135 &amp;
              ((t = 16711935 &amp; ((t = 32767 * (t - i) * r) | (t &lt;&lt; 8))) |
                (t &lt;&lt; 4))) |
              (t &lt;&lt; 2))) |
            (t &lt;&lt; 1))) |
        ((e =
          1431655765 &amp;
          ((e =
            858993459 &amp;
            ((e =
              252645135 &amp;
              ((e = 16711935 &amp; ((e = 32767 * (e - s) * r) | (e &lt;&lt; 8))) |
                (e &lt;&lt; 4))) |
              (e &lt;&lt; 2))) |
            (e &lt;&lt; 1))) &lt;&lt;
          1)
      );
    }
    static getLeftmost(t) {
      var e = t,
        i = t;
      do {
        e.x &lt; i.x &amp;&amp; (i = e), (e = e.next);
      } while (e !== t);
      return i;
    }
    static pointInTriangle(t, e, i, s, r, a, n, h) {
      return (
        (r - n) * (e - h) - (t - n) * (a - h) &gt;= 0 &amp;&amp;
        (t - n) * (s - h) - (i - n) * (e - h) &gt;= 0 &amp;&amp;
        (i - n) * (a - h) - (r - n) * (s - h) &gt;= 0
      );
    }
    static isValidDiagonal(t, e) {
      return (
        t.next.i !== e.i &amp;&amp;
        t.prev.i !== e.i &amp;&amp;
        !Yt.intersectsPolygon(t, e) &amp;&amp;
        Yt.locallyInside(t, e) &amp;&amp;
        Yt.locallyInside(e, t) &amp;&amp;
        Yt.middleInside(t, e)
      );
    }
    static area(t, e, i) {
      return (e.y - t.y) * (i.x - e.x) - (e.x - t.x) * (i.y - e.y);
    }
    static equals(t, e) {
      return t.x === e.x &amp;&amp; t.y === e.y;
    }
    static intersects(t, e, i, s) {
      return (
        !!(
          (Yt.equals(t, e) &amp;&amp; Yt.equals(i, s)) ||
          (Yt.equals(t, s) &amp;&amp; Yt.equals(i, e))
        ) ||
        (Yt.area(t, e, i) &gt; 0 != Yt.area(t, e, s) &gt; 0 &amp;&amp;
          Yt.area(i, s, t) &gt; 0 != Yt.area(i, s, e) &gt; 0)
      );
    }
    static intersectsPolygon(t, e) {
      var i = t;
      do {
        if (
          i.i !== t.i &amp;&amp;
          i.next.i !== t.i &amp;&amp;
          i.i !== e.i &amp;&amp;
          i.next.i !== e.i &amp;&amp;
          Yt.intersects(i, i.next, t, e)
        )
          return !0;
        i = i.next;
      } while (i !== t);
      return !1;
    }
    static locallyInside(t, e) {
      return Yt.area(t.prev, t, t.next) &lt; 0
        ? Yt.area(t, e, t.next) &gt;= 0 &amp;&amp; Yt.area(t, t.prev, e) &gt;= 0
        : Yt.area(t, e, t.prev) &lt; 0 || Yt.area(t, t.next, e) &lt; 0;
    }
    static middleInside(t, e) {
      var i = t,
        s = !1,
        r = (t.x + e.x) / 2,
        a = (t.y + e.y) / 2;
      do {
        i.y &gt; a != i.next.y &gt; a &amp;&amp;
          i.next.y !== i.y &amp;&amp;
          r &lt; ((i.next.x - i.x) * (a - i.y)) / (i.next.y - i.y) + i.x &amp;&amp;
          (s = !s),
          (i = i.next);
      } while (i !== t);
      return s;
    }
    static splitPolygon(t, e) {
      var i = new Wt(t.i, t.x, t.y),
        s = new Wt(e.i, e.x, e.y),
        r = t.next,
        a = e.prev;
      return (
        (t.next = e),
        (e.prev = t),
        (i.next = r),
        (r.prev = i),
        (s.next = i),
        (i.prev = s),
        (a.next = s),
        (s.prev = a),
        s
      );
    }
    static insertNode(t, e, i, s) {
      var r = new Wt(t, e, i);
      return (
        s
          ? ((r.next = s.next), (r.prev = s), (s.next.prev = r), (s.next = r))
          : ((r.prev = r), (r.next = r)),
        r
      );
    }
    static removeNode(t) {
      (t.next.prev = t.prev),
        (t.prev.next = t.next),
        t.prevZ &amp;&amp; (t.prevZ.nextZ = t.nextZ),
        t.nextZ &amp;&amp; (t.nextZ.prevZ = t.prevZ);
    }
    static signedArea(t, e, i, s) {
      for (var r = 0, a = e, n = i - s; a &lt; i; a += s)
        (r += (t[n] - t[a]) * (t[a + 1] + t[n + 1])), (n = a);
      return r;
    }
  }
  class Vt {}
  (Vt.BYTES_PE = 4),
    (Vt.BYTES_PIDX = 2),
    (Vt.defaultMatrix4 = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
    (Vt.defaultMinusYMatrix4 = [
      1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1,
    ]),
    (Vt.uniformMatrix3 = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0]),
    (Vt._TMPARRAY = []),
    (Vt._OFFSETX = 0),
    (Vt._OFFSETY = 0);
  class Xt extends pt {
    constructor(t = pt.TYPE_2D) {
      super(t);
    }
    renderSubmit() {
      if (0 === this._numEle || !this._mesh || 0 == this._numEle) return 1;
      var t = this.shaderValue.textureHost;
      if (t) {
        var e = t._getSource();
        if (!e) return 1;
        this.shaderValue.texture = e;
      }
      var i = b.mainContext;
      return (
        this._mesh.useMesh(i),
        this.shaderValue.upload(),
        Y.activeBlendFunction !== this._blendFn &amp;&amp;
          (b.setBlend(i, !0),
          this._blendFn(i),
          (Y.activeBlendFunction = this._blendFn)),
        i.drawElements(
          i.TRIANGLES,
          this._numEle,
          i.UNSIGNED_SHORT,
          this._startIdx,
        ),
        H.renderBatches++,
        (H.trianglesFaces += this._numEle / 3),
        1
      );
    }
    releaseRender() {
      pt.RENDERBASE != this &amp;&amp;
        --this._ref &lt; 1 &amp;&amp;
        ((Xt.POOL[Xt._poolSize++] = this),
        this.shaderValue.release(),
        (this.shaderValue = null),
        (this._mesh = null),
        this._parent &amp;&amp; (this._parent.releaseRender(), (this._parent = null)));
    }
    static create(t, e, i) {
      var s = Xt._poolSize ? Xt.POOL[--Xt._poolSize] : new Xt();
      (s._ref = 1),
        (s._mesh = e),
        s._key.clear(),
        (s._startIdx = e.indexNum * Vt.BYTES_PIDX),
        (s._numEle = 0);
      var r = t._nBlendType;
      (s._blendFn = t._targets ? Y.targetFns[r] : Y.fns[r]),
        (s.shaderValue = i),
        s.shaderValue.setValue(t._shader2D);
      var a = t._shader2D.filters;
      return a &amp;&amp; s.shaderValue.setFilters(a), s;
    }
    static createShape(t, e, i, s) {
      var r = Xt._poolSize ? Xt.POOL[--Xt._poolSize] : new Xt();
      (r._mesh = e),
        (r._numEle = i),
        (r._startIdx = 2 * e.indexNum),
        (r._ref = 1),
        (r.shaderValue = s),
        r.shaderValue.setValue(t._shader2D);
      var a = t._nBlendType;
      return (
        (r._key.blendShader = a),
        (r._blendFn = t._targets ? Y.targetFns[a] : Y.fns[a]),
        r
      );
    }
  }
  (Xt._poolSize = 0), (Xt.POOL = []);
  class Ht extends pt {
    constructor() {
      super(pt.TYPE_2D),
        (this._matrix = new p()),
        (this._matrix4 = Vt.defaultMatrix4.concat()),
        (this.shaderValue = new q(0, 0));
    }
    static create(t, e, i) {
      var s = Ht.POOL._length ? Ht.POOL[--Ht.POOL._length] : new Ht();
      (s.canv = t), (s._ref = 1), (s._numEle = 0);
      var r = s.shaderValue;
      return (
        (r.alpha = e),
        r.defines.setValue(0),
        i &amp;&amp; i.length &amp;&amp; r.setFilters(i),
        s
      );
    }
    renderSubmit() {
      var t = G.worldAlpha,
        e = G.worldMatrix4,
        i = G.worldMatrix,
        s = G.worldFilters,
        r = G.worldShaderDefines,
        a = this.shaderValue,
        n = this._matrix,
        h = this._matrix4,
        o = p.TEMP;
      return (
        p.mul(n, i, o),
        (h[0] = o.a),
        (h[1] = o.b),
        (h[4] = o.c),
        (h[5] = o.d),
        (h[12] = o.tx),
        (h[13] = o.ty),
        (G.worldMatrix = o.clone()),
        (G.worldMatrix4 = h),
        (G.worldAlpha = G.worldAlpha * a.alpha),
        a.filters &amp;&amp;
          a.filters.length &amp;&amp;
          ((G.worldFilters = a.filters), (G.worldShaderDefines = a.defines)),
        this.canv.flushsubmit(),
        (G.worldAlpha = t),
        (G.worldMatrix4 = e),
        G.worldMatrix.destroy(),
        (G.worldMatrix = i),
        (G.worldFilters = s),
        (G.worldShaderDefines = r),
        1
      );
    }
    releaseRender() {
      if (--this._ref &lt; 1) {
        var t = Ht.POOL;
        (this._mesh = null), (t[t._length++] = this);
      }
    }
    getRenderType() {
      return pt.TYPE_CANVAS;
    }
  }
  (Ht.POOL = []), (Ht.POOL._length = 0);
  class zt {
    constructor() {
      (this.blendType = 0), (this._ref = 1), (this._key = new Z());
    }
    renderSubmit() {
      var t = b.mainContext;
      this._mesh.useMesh(t);
      var e = this.srcRT;
      return (
        e &amp;&amp;
          ((this.shaderValue.texture = e._getSource()),
          this.shaderValue.upload(),
          this.blend(),
          H.renderBatches++,
          (H.trianglesFaces += this._numEle / 3),
          t.drawElements(
            t.TRIANGLES,
            this._numEle,
            t.UNSIGNED_SHORT,
            this._startIdx,
          )),
        1
      );
    }
    blend() {
      if (Y.activeBlendFunction !== Y.fns[this.blendType]) {
        var t = b.mainContext;
        t.enable(t.BLEND),
          Y.fns[this.blendType](t),
          (Y.activeBlendFunction = Y.fns[this.blendType]);
      }
    }
    getRenderType() {
      return 0;
    }
    releaseRender() {
      if (--this._ref &lt; 1) {
        var t = zt.POOL;
        t[t._length++] = this;
      }
    }
    static create(t, e, i, s) {
      var r = zt.POOL._length ? zt.POOL[--zt.POOL._length] : new zt();
      if (
        ((r._mesh = e),
        (r.srcRT = s),
        (r._startIdx = e.indexNum * Vt.BYTES_PIDX),
        (r._ref = 1),
        r._key.clear(),
        (r._numEle = 0),
        (r.blendType = t._nBlendType),
        (r._key.blendShader = r.blendType),
        (r.shaderValue = i),
        r.shaderValue.setValue(t._shader2D),
        t._colorFiler)
      ) {
        var a = t._colorFiler;
        i.defines.add(a.type), (i.colorMat = a._mat), (i.colorAlpha = a._alpha);
      }
      return r;
    }
  }
  (zt.POOL = []), (zt.POOL._length = 0);
  class Kt extends pt {
    constructor(t = pt.TYPE_2D) {
      super(t);
    }
    releaseRender() {
      --this._ref &lt; 1 &amp;&amp;
        ((Kt.POOL[Kt._poolSize++] = this),
        this.shaderValue.release(),
        (this._mesh = null),
        this._parent &amp;&amp; (this._parent.releaseRender(), (this._parent = null)));
    }
    renderSubmit() {
      if (0 === this._numEle) return 1;
      var t = this.shaderValue.textureHost;
      if (t) {
        var e = t ? t._getSource() : null;
        if (!e) return 1;
      }
      var i = b.mainContext;
      this._mesh.useMesh(i);
      var s = pt.preRender,
        r = pt.preRender._key;
      return (
        0 === this._key.blendShader &amp;&amp;
        this._key.submitType === r.submitType &amp;&amp;
        this._key.blendShader === r.blendShader &amp;&amp;
        U.activeShader &amp;&amp;
        pt.preRender.clipInfoID == this.clipInfoID &amp;&amp;
        s.shaderValue.defines._value === this.shaderValue.defines._value &amp;&amp;
        0 == (this.shaderValue.defines._value &amp; X.NOOPTMASK)
          ? U.activeShader.uploadTexture2D(e)
          : (Y.activeBlendFunction !== this._blendFn &amp;&amp;
              (b.setBlend(i, !0),
              this._blendFn(i),
              (Y.activeBlendFunction = this._blendFn)),
            (this.shaderValue.texture = e),
            this.shaderValue.upload()),
        i.drawElements(
          i.TRIANGLES,
          this._numEle,
          i.UNSIGNED_SHORT,
          this._startIdx,
        ),
        H.renderBatches++,
        (H.trianglesFaces += this._numEle / 3),
        1
      );
    }
    static create(t, e, i) {
      var s = Kt._poolSize ? Kt.POOL[--Kt._poolSize] : new Kt(pt.TYPE_TEXTURE);
      (s._mesh = e),
        s._key.clear(),
        (s._key.submitType = pt.KEY_DRAWTEXTURE),
        (s._ref = 1),
        (s._startIdx = e.indexNum * Vt.BYTES_PIDX),
        (s._numEle = 0);
      var r = t._nBlendType;
      if (
        ((s._key.blendShader = r),
        (s._blendFn = t._targets ? Y.targetFns[r] : Y.fns[r]),
        (s.shaderValue = i),
        t._colorFiler)
      ) {
        var a = t._colorFiler;
        i.defines.add(a.type), (i.colorMat = a._mat), (i.colorAlpha = a._alpha);
      }
      return s;
    }
  }
  (Kt._poolSize = 0), (Kt.POOL = []);
  class jt {
    constructor() {
      (this._data = []),
        (this._ndata = 0),
        (this._clipid = -1),
        (this._clipMatrix = new p()),
        (this._enable = !1);
    }
    clear() {
      (this._tex = null),
        (this._imgId = -1),
        (this._ndata = 0),
        (this._enable = !1),
        (this._colorFiler = null);
    }
    destroy() {
      this.clear(), (this._data.length = 0), (this._data = null);
    }
    add(t, e, i, s, r, a) {
      this._ndata &gt; 0 &amp;&amp;
        (this._tex != e ||
          this._imgId != i ||
          (this._clipid &gt;= 0 &amp;&amp; this._clipid != t._clipInfoID)) &amp;&amp;
        this.submit(t),
        (this._clipid = t._clipInfoID),
        t._globalClipMatrix.copyTo(this._clipMatrix),
        (this._tex = e),
        (this._imgId = i),
        (this._colorFiler = t._colorFiler),
        (this._data[this._ndata] = s),
        (this._data[this._ndata + 1] = r),
        (this._data[this._ndata + 2] = a),
        (this._ndata += 3);
    }
    getPos() {
      return 0 == jt.__nPosPool ? new Array(8) : jt.__posPool[--jt.__nPosPool];
    }
    enable(t, e) {
      t !== this._enable &amp;&amp;
        ((this._enable = t), this._enable || this.submit(e));
    }
    submit(t) {
      var e = this._ndata;
      if (e) {
        var i = t._mesh,
          s = t._colorFiler;
        t._colorFiler = this._colorFiler;
        var r = Kt.create(t, i, q.create(X.TEXTURE2D, 0));
        (t._submits[t._submits._length++] = t._curSubmit = r),
          (r.shaderValue.textureHost = this._tex),
          (r._key.other = this._imgId),
          (t._colorFiler = s),
          t._copyClipInfo(r, this._clipMatrix),
          (r.clipInfoID = this._clipid);
        for (var a = 0; a &lt; e; a += 3)
          i.addQuad(this._data[a], this._data[a + 1], this._data[a + 2], !0),
            (jt.__posPool[jt.__nPosPool++] = this._data[a]);
        (e /= 3),
          (r._numEle += 6 * e),
          (i.indexNum += 6 * e),
          (i.vertNum += 4 * e),
          (t._drawCount += e),
          (this._ndata = 0),
          Rt.loopCount % 100 == 0 &amp;&amp; (this._data.length = 0);
      }
    }
  }
  (jt.__posPool = []), (jt.__nPosPool = 0);
  class qt {
    constructor(t = 0, e = 0, i = 0) {
      (this.atlasID = 0),
        (this._width = 0),
        (this._height = 0),
        (this._texCount = 0),
        (this._rowInfo = null),
        (this._cells = null),
        (this._used = 0),
        (this._cells = null),
        (this._rowInfo = null),
        (this.atlasID = i),
        this._init(t, e);
    }
    addRect(t, e, i, s) {
      return (
        !!this._get(e, i, s) &amp;&amp;
        (this._fill(s.x, s.y, e, i, t), this._texCount++, !0)
      );
    }
    _release() {
      (this._cells = null), (this._rowInfo = null);
    }
    _init(t, e) {
      return (
        (this._width = t),
        (this._height = e),
        this._release(),
        0 != this._width &amp;&amp;
          ((this._cells = new Uint8Array(this._width * this._height * 3)),
          (this._rowInfo = new Uint8Array(this._height)),
          (this._used = 0),
          this._clear(),
          !0)
      );
    }
    _get(t, e, i) {
      if (t &gt; this._width || e &gt; this._height) return !1;
      for (
        var s = -1,
          r = -1,
          a = this._width,
          n = this._height,
          h = this._cells,
          o = 0;
        o &lt; n;
        o++
      )
        if (!(this._rowInfo[o] &lt; t))
          for (var l = 0; l &lt; a; ) {
            var _ = 3 * (o * a + l);
            if (0 != h[_] || h[_ + 1] &lt; t || h[_ + 2] &lt; e) l += h[_ + 1];
            else {
              (s = l), (r = o);
              for (var u = 0; u &lt; t; u++)
                if (h[3 * u + _ + 2] &lt; e) {
                  s = -1;
                  break;
                }
              if (!(s &lt; 0)) return (i.x = s), (i.y = r), !0;
              l += h[_ + 1];
            }
          }
      return !1;
    }
    _fill(t, e, i, s, r) {
      var a = this._width,
        n = this._height;
      this._check(t + i &lt;= a &amp;&amp; e + s &lt;= n);
      for (var h = e; h &lt; s + e; ++h) {
        this._check(this._rowInfo[h] &gt;= i), (this._rowInfo[h] -= i);
        for (var o = 0; o &lt; i; o++) {
          var l = 3 * (t + h * a + o);
          this._check(0 == this._cells[l]),
            (this._cells[l] = r),
            (this._cells[l + 1] = i),
            (this._cells[l + 2] = s);
        }
      }
      if (t &gt; 0)
        for (h = 0; h &lt; s; ++h) {
          var _ = 0;
          for (
            o = t - 1;
            o &gt;= 0 &amp;&amp; 0 == this._cells[3 * ((e + h) * a + o)];
            --o, ++_
          );
          for (o = _; o &gt; 0; --o)
            (this._cells[3 * ((e + h) * a + t - o) + 1] = o),
              this._check(o &gt; 0);
        }
      if (e &gt; 0)
        for (o = t; o &lt; t + i; ++o) {
          for (
            _ = 0, h = e - 1;
            h &gt;= 0 &amp;&amp; 0 == this._cells[3 * (o + h * a)];
            --h, _++
          );
          for (h = _; h &gt; 0; --h)
            (this._cells[3 * (o + (e - h) * a) + 2] = h), this._check(h &gt; 0);
        }
      this._used += (i * s) / (this._width * this._height);
    }
    _check(t) {
      0 == t &amp;&amp; console.log("xtexMerger é”™è¯¯å•¦");
    }
    _clear() {
      this._texCount = 0;
      for (var t = 0; t &lt; this._height; t++) this._rowInfo[t] = this._width;
      for (var e = 0; e &lt; this._height; e++)
        for (var i = 0; i &lt; this._width; i++) {
          var s = 3 * (e * this._width + i);
          (this._cells[s] = 0),
            (this._cells[s + 1] = this._width - i),
            (this._cells[s + 2] = this._width - e);
        }
    }
  }
  class Zt extends P {
    constructor(t, e) {
      super(),
        (this._texW = 0),
        (this._texH = 0),
        (this.__destroyed = !1),
        (this._discardTm = 0),
        (this.genID = 0),
        (this.bitmap = { id: 0, _glTexture: null }),
        (this.curUsedCovRate = 0),
        (this.curUsedCovRateAtlas = 0),
        (this.lastTouchTm = 0),
        (this.ri = null),
        (this._texW = t || Zt.gTextRender.atlasWidth),
        (this._texH = e || Zt.gTextRender.atlasWidth),
        (this.bitmap.id = this.id),
        (this.lock = !0);
    }
    recreateResource() {
      if (!this._source) {
        var t = g.instance,
          e = (this._source = t.createTexture());
        (this.bitmap._glTexture = e),
          b.bindTexture(t, t.TEXTURE_2D, e),
          t.texImage2D(
            t.TEXTURE_2D,
            0,
            t.RGBA,
            this._texW,
            this._texH,
            0,
            t.RGBA,
            t.UNSIGNED_BYTE,
            null,
          ),
          t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, t.LINEAR),
          t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MAG_FILTER, t.LINEAR),
          t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_S, t.CLAMP_TO_EDGE),
          t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_T, t.CLAMP_TO_EDGE),
          Zt.gTextRender.debugUV &amp;&amp; this.fillWhite();
      }
    }
    addChar(t, e, s, r = null) {
      if (Zt.gTextRender.isWan1Wan) return this.addCharCanvas(t, e, s, r);
      !this._source &amp;&amp; this.recreateResource();
      var a = g.instance;
      b.bindTexture(a, a.TEXTURE_2D, this._source),
        !i.Render.isConchApp &amp;&amp;
          a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);
      var n,
        h,
        o,
        l,
        _ = t.data;
      return (
        t.data instanceof Uint8ClampedArray &amp;&amp; (_ = new Uint8Array(_.buffer)),
        a.texSubImage2D(
          a.TEXTURE_2D,
          0,
          e,
          s,
          t.width,
          t.height,
          a.RGBA,
          a.UNSIGNED_BYTE,
          _,
        ),
        !i.Render.isConchApp &amp;&amp;
          a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1),
        (n = e / this._texW),
        (h = s / this._texH),
        (o = (e + t.width) / this._texW),
        (l = (s + t.height) / this._texH),
        ((r = r || new Array(8))[0] = n),
        (r[1] = h),
        (r[2] = o),
        (r[3] = h),
        (r[4] = o),
        (r[5] = l),
        (r[6] = n),
        (r[7] = l),
        r
      );
    }
    addCharCanvas(t, e, s, r = null) {
      !this._source &amp;&amp; this.recreateResource();
      var a,
        n,
        h,
        o,
        l = g.instance;
      return (
        b.bindTexture(l, l.TEXTURE_2D, this._source),
        !i.Render.isConchApp &amp;&amp;
          l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0),
        l.texSubImage2D(l.TEXTURE_2D, 0, e, s, l.RGBA, l.UNSIGNED_BYTE, t),
        !i.Render.isConchApp &amp;&amp;
          l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1),
        i.Render.isConchApp
          ? ((a = e / this._texW),
            (n = s / this._texH),
            (h = (e + t.width) / this._texW),
            (o = (s + t.height) / this._texH))
          : ((a = (e + 1) / this._texW),
            (n = (s + 1) / this._texH),
            (h = (e + t.width - 1) / this._texW),
            (o = (s + t.height - 1) / this._texH)),
        ((r = r || new Array(8))[0] = a),
        (r[1] = n),
        (r[2] = h),
        (r[3] = n),
        (r[4] = h),
        (r[5] = o),
        (r[6] = a),
        (r[7] = o),
        r
      );
    }
    fillWhite() {
      !this._source &amp;&amp; this.recreateResource();
      var t = g.instance,
        e = new Uint8Array(this._texW * this._texH * 4);
      e.fill(255),
        t.texSubImage2D(
          t.TEXTURE_2D,
          0,
          0,
          0,
          this._texW,
          this._texH,
          t.RGBA,
          t.UNSIGNED_BYTE,
          e,
        );
    }
    discard() {
      i.stage.setGlobalRepaint(), this.destroy();
    }
    static getTextTexture(t, e) {
      return new Zt(t, e);
    }
    destroy() {
      this.__destroyed = !0;
      var t = g.instance;
      this._source &amp;&amp; t.deleteTexture(this._source), (this._source = null);
    }
    static clean() {
      var t = Rt.loopStTm;
      if (
        (0 === Zt.cleanTm &amp;&amp; (Zt.cleanTm = t),
        t - Zt.cleanTm &gt;= Zt.gTextRender.checkCleanTextureDt)
      ) {
        for (var e = 0; e &lt; Zt.poolLen; e++) {
          var i = Zt.pool[e];
          t - i._discardTm &gt;= Zt.gTextRender.destroyUnusedTextureDt &amp;&amp;
            (i.destroy(),
            (Zt.pool[e] = Zt.pool[Zt.poolLen - 1]),
            Zt.poolLen--,
            e--);
        }
        Zt.cleanTm = t;
      }
    }
    touchRect(t, e) {
      this.lastTouchTm != e &amp;&amp;
        ((this.curUsedCovRate = 0),
        (this.curUsedCovRateAtlas = 0),
        (this.lastTouchTm = e));
      var s = Zt.gTextRender.atlasWidth * Zt.gTextRender.atlasWidth,
        r = i.TextAtlas.atlasGridW * i.TextAtlas.atlasGridW;
      (this.curUsedCovRate += (t.bmpWidth * t.bmpHeight) / s),
        (this.curUsedCovRateAtlas +=
          (Math.ceil(t.bmpWidth / i.TextAtlas.atlasGridW) *
            Math.ceil(t.bmpHeight / i.TextAtlas.atlasGridW)) /
          (s / r));
    }
    get texture() {
      return this;
    }
    _getSource() {
      return this._source;
    }
    drawOnScreen(t, e) {}
  }
  (Zt.gTextRender = null),
    (Zt.pool = new Array(10)),
    (Zt.poolLen = 0),
    (Zt.cleanTm = 0);
  class Qt {
    constructor() {
      (this.texWidth = 1024),
        (this.texHeight = 1024),
        (this.texture = null),
        (this.charMaps = {}),
        (this.texHeight = this.texWidth = i.TextRender.atlasWidth),
        (this.texture = Zt.getTextTexture(this.texWidth, this.texHeight)),
        this.texWidth / Qt.atlasGridW &gt; 256 &amp;&amp;
          (Qt.atlasGridW = Math.ceil(this.texWidth / 256)),
        (this.atlasgrid = new qt(
          this.texWidth / Qt.atlasGridW,
          this.texHeight / Qt.atlasGridW,
          this.texture.id,
        ));
    }
    setProtecteDist(t) {}
    getAEmpty(t, e, i) {
      var s = this.atlasgrid.addRect(
        1,
        Math.ceil(t / Qt.atlasGridW),
        Math.ceil(e / Qt.atlasGridW),
        i,
      );
      return s &amp;&amp; ((i.x *= Qt.atlasGridW), (i.y *= Qt.atlasGridW)), s;
    }
    get usedRate() {
      return this.atlasgrid._used;
    }
    destroy() {
      for (var t in this.charMaps) {
        this.charMaps[t].deleted = !0;
      }
      this.texture.discard();
    }
    printDebugInfo() {}
  }
  Qt.atlasGridW = 16;
  class $t {
    setTo(t, e, i) {
      return (this.type = t), (this.currentTarget = e), (this.target = i), this;
    }
    stopPropagation() {
      this._stoped = !0;
    }
    get touches() {
      if (!this.nativeEvent) return null;
      var t = this.nativeEvent.touches;
      if (t)
        for (var e = i.stage, s = 0, r = t.length; s &lt; r; s++) {
          var a = t[s],
            n = f.TEMP;
          n.setTo(a.clientX, a.clientY),
            e._canvasTransform.invertTransformPoint(n),
            e.transform.invertTransformPoint(n),
            (a.stageX = n.x),
            (a.stageY = n.y);
        }
      return t;
    }
    get altKey() {
      return this.nativeEvent.altKey;
    }
    get ctrlKey() {
      return this.nativeEvent.ctrlKey;
    }
    get shiftKey() {
      return this.nativeEvent.shiftKey;
    }
    get charCode() {
      return this.nativeEvent.charCode;
    }
    get keyLocation() {
      return this.nativeEvent.location || this.nativeEvent.keyLocation;
    }
    get stageX() {
      return i.stage.mouseX;
    }
    get stageY() {
      return i.stage.mouseY;
    }
  }
  ($t.EMPTY = new $t()),
    ($t.MOUSE_DOWN = "mousedown"),
    ($t.MOUSE_UP = "mouseup"),
    ($t.CLICK = "click"),
    ($t.RIGHT_MOUSE_DOWN = "rightmousedown"),
    ($t.RIGHT_MOUSE_UP = "rightmouseup"),
    ($t.RIGHT_CLICK = "rightclick"),
    ($t.MOUSE_MOVE = "mousemove"),
    ($t.MOUSE_OVER = "mouseover"),
    ($t.MOUSE_OUT = "mouseout"),
    ($t.MOUSE_WHEEL = "mousewheel"),
    ($t.ROLL_OVER = "mouseover"),
    ($t.ROLL_OUT = "mouseout"),
    ($t.DOUBLE_CLICK = "doubleclick"),
    ($t.CHANGE = "change"),
    ($t.CHANGED = "changed"),
    ($t.RESIZE = "resize"),
    ($t.ADDED = "added"),
    ($t.REMOVED = "removed"),
    ($t.DISPLAY = "display"),
    ($t.UNDISPLAY = "undisplay"),
    ($t.ERROR = "error"),
    ($t.COMPLETE = "complete"),
    ($t.LOADED = "loaded"),
    ($t.READY = "ready"),
    ($t.PROGRESS = "progress"),
    ($t.INPUT = "input"),
    ($t.RENDER = "render"),
    ($t.OPEN = "open"),
    ($t.MESSAGE = "message"),
    ($t.CLOSE = "close"),
    ($t.KEY_DOWN = "keydown"),
    ($t.KEY_PRESS = "keypress"),
    ($t.KEY_UP = "keyup"),
    ($t.FRAME = "enterframe"),
    ($t.DRAG_START = "dragstart"),
    ($t.DRAG_MOVE = "dragmove"),
    ($t.DRAG_END = "dragend"),
    ($t.ENTER = "enter"),
    ($t.SELECT = "select"),
    ($t.BLUR = "blur"),
    ($t.FOCUS = "focus"),
    ($t.VISIBILITY_CHANGE = "visibilitychange"),
    ($t.FOCUS_CHANGE = "focuschange"),
    ($t.PLAYED = "played"),
    ($t.PAUSED = "paused"),
    ($t.STOPPED = "stopped"),
    ($t.START = "start"),
    ($t.END = "end"),
    ($t.COMPONENT_ADDED = "componentadded"),
    ($t.COMPONENT_REMOVED = "componentremoved"),
    ($t.RELEASED = "released"),
    ($t.LINK = "link"),
    ($t.LABEL = "label"),
    ($t.FULL_SCREEN_CHANGE = "fullscreenchange"),
    ($t.DEVICE_LOST = "devicelost"),
    ($t.TRANSFORM_CHANGED = "transformchanged"),
    ($t.ANIMATION_CHANGED = "animationchanged"),
    ($t.TRAIL_FILTER_CHANGE = "trailfilterchange"),
    ($t.TRIGGER_ENTER = "triggerenter"),
    ($t.TRIGGER_STAY = "triggerstay"),
    ($t.TRIGGER_EXIT = "triggerexit");
  class Jt extends w {
    constructor(t = null, e = null, i = 0, s = 0) {
      super(),
        (this.uvrect = [0, 0, 1, 1]),
        (this._destroyed = !1),
        (this._referenceCount = 0),
        (this.$_GID = 0),
        (this.offsetX = 0),
        (this.offsetY = 0),
        (this._w = 0),
        (this._h = 0),
        (this.sourceWidth = 0),
        (this.sourceHeight = 0),
        (this.url = null),
        (this.scaleRate = 1),
        this.setTo(t, e, i, s);
    }
    static moveUV(t, e, i) {
      for (var s = 0; s &lt; 8; s += 2) (i[s] += t), (i[s + 1] += e);
      return i;
    }
    static create(t, e, i, s, r, a = 0, n = 0, h = 0, o = 0) {
      return Jt._create(t, e, i, s, r, a, n, h, o);
    }
    static _create(t, e, i, s, r, a = 0, n = 0, h = 0, o = 0, l = null) {
      var _,
        u = t instanceof Jt,
        c = u ? t.uv : Jt.DEF_UV,
        d = u ? t.bitmap : t;
      d.width &amp;&amp; e + s &gt; d.width &amp;&amp; (s = d.width - e),
        d.height &amp;&amp; i + r &gt; d.height &amp;&amp; (r = d.height - i),
        l
          ? (_ = l).setTo(d, null, h || s, o || r)
          : (_ = new Jt(d, null, h || s, o || r)),
        (_.width = s),
        (_.height = r),
        (_.offsetX = a),
        (_.offsetY = n);
      var p = 1 / d.width,
        f = 1 / d.height;
      (e *= p), (i *= f), (s *= p), (r *= f);
      var m = _.uv[0],
        g = _.uv[1],
        T = _.uv[4],
        v = _.uv[5],
        x = T - m,
        y = v - g,
        E = Jt.moveUV(c[0], c[1], [e, i, e + s, i, e + s, i + r, e, i + r]);
      _.uv = new Float32Array([
        m + E[0] * x,
        g + E[1] * y,
        T - (1 - E[2]) * x,
        g + E[3] * y,
        T - (1 - E[4]) * x,
        v - (1 - E[5]) * y,
        m + E[6] * x,
        v - (1 - E[7]) * y,
      ]);
      var R = d.scaleRate;
      return (
        R &amp;&amp; 1 != R
          ? ((_.sourceWidth /= R),
            (_.sourceHeight /= R),
            (_.width /= R),
            (_.height /= R),
            (_.scaleRate = R),
            (_.offsetX /= R),
            (_.offsetY /= R))
          : (_.scaleRate = 1),
        _
      );
    }
    static createFromTexture(t, e, i, s, r) {
      var a = t.scaleRate;
      1 != a &amp;&amp; ((e *= a), (i *= a), (s *= a), (r *= a));
      var n = m.TEMP.setTo(e - t.offsetX, i - t.offsetY, s, r),
        h = n.intersection(Jt._rect1.setTo(0, 0, t.width, t.height), Jt._rect2);
      return h
        ? Jt.create(t, h.x, h.y, h.width, h.height, h.x - n.x, h.y - n.y, s, r)
        : null;
    }
    get uv() {
      return this._uv;
    }
    set uv(t) {
      (this.uvrect[0] = Math.min(t[0], t[2], t[4], t[6])),
        (this.uvrect[1] = Math.min(t[1], t[3], t[5], t[7])),
        (this.uvrect[2] = Math.max(t[0], t[2], t[4], t[6]) - this.uvrect[0]),
        (this.uvrect[3] = Math.max(t[1], t[3], t[5], t[7]) - this.uvrect[1]),
        (this._uv = t);
    }
    get width() {
      return this._w
        ? this._w
        : this.bitmap
          ? this.uv &amp;&amp; this.uv !== Jt.DEF_UV
            ? (this.uv[2] - this.uv[0]) * this.bitmap.width
            : this.bitmap.width
          : 0;
    }
    set width(t) {
      (this._w = t), this.sourceWidth || (this.sourceWidth = t);
    }
    get height() {
      return this._h
        ? this._h
        : this.bitmap
          ? this.uv &amp;&amp; this.uv !== Jt.DEF_UV
            ? (this.uv[5] - this.uv[1]) * this.bitmap.height
            : this.bitmap.height
          : 0;
    }
    set height(t) {
      (this._h = t), this.sourceHeight || (this.sourceHeight = t);
    }
    get bitmap() {
      return this._bitmap;
    }
    set bitmap(t) {
      this._bitmap &amp;&amp; this._bitmap._removeReference(this._referenceCount),
        (this._bitmap = t),
        t &amp;&amp; t._addReference(this._referenceCount);
    }
    get destroyed() {
      return this._destroyed;
    }
    _addReference() {
      this._bitmap &amp;&amp; this._bitmap._addReference(), this._referenceCount++;
    }
    _removeReference() {
      this._bitmap &amp;&amp; this._bitmap._removeReference(), this._referenceCount--;
    }
    _getSource(t = null) {
      return this._destroyed || !this._bitmap
        ? null
        : (this.recoverBitmap(t),
          this._bitmap.destroyed ? null : this.bitmap._getSource());
    }
    _onLoaded(t, e) {
      if (e)
        if (e == this);
        else if (e instanceof Jt) {
          var i = e;
          Jt._create(
            e,
            0,
            0,
            i.width,
            i.height,
            0,
            0,
            i.sourceWidth,
            i.sourceHeight,
            this,
          );
        } else
          (this.bitmap = e),
            (this.sourceWidth = this._w = e.width),
            (this.sourceHeight = this._h = e.height);
      else;
      t &amp;&amp; t.run(), this.event($t.READY, this);
    }
    getIsReady() {
      return !this._destroyed &amp;&amp; !!this._bitmap;
    }
    setTo(t = null, e = null, i = 0, s = 0) {
      (this.bitmap = t),
        (this.sourceWidth = i),
        (this.sourceHeight = s),
        t &amp;&amp;
          ((this._w = t.width),
          (this._h = t.height),
          (this.sourceWidth = this.sourceWidth || t.width),
          (this.sourceHeight = this.sourceHeight || t.height)),
        (this.uv = e || Jt.DEF_UV);
    }
    load(t, e = null) {
      this._destroyed ||
        i.loader.load(
          t,
          S.create(this, this._onLoaded, [e]),
          null,
          "htmlimage",
          1,
          !0,
        );
    }
    getTexturePixels(t, e, s, r) {
      var a,
        n,
        h,
        o = this.bitmap,
        l = this._w,
        _ = this._h,
        u = this.sourceWidth,
        c = this.sourceHeight,
        d = o.width,
        p = o.height,
        f = this.offsetX,
        m = this.offsetY;
      let g = s,
        T = r;
      if (
        (t + s &gt; l + f &amp;&amp; (g -= t + s - l - f),
        t + s &gt; u &amp;&amp; (s -= t + s - u),
        e + r &gt; _ + m &amp;&amp; (T -= e + r - _ - m),
        e + r &gt; c &amp;&amp; (r -= e + r - c),
        s &lt;= 0 || r &lt;= 0)
      )
        return null;
      let v = f &gt; t ? f - t : 0,
        x = m &gt; e ? m - e : 0,
        y = t &gt; f ? t - f : 0,
        E = e &gt; m ? e - m : 0;
      (g -= v), (T -= x);
      var R = 4 * s,
        C = null;
      try {
        C = o.getPixels();
      } catch (t) {}
      if (C) {
        if (0 == t &amp;&amp; 0 == e &amp;&amp; s == d &amp;&amp; r == p) return C;
        let i = this._uv.slice(),
          o = Math.round(i[0] * d),
          l = Math.round(i[1] * p);
        var A = new Uint8Array(s * r * 4);
        for (a = 4 * o + 4 * y + (n = (l + E) * (R = 4 * d)), h = 0; h &lt; T; h++)
          A.set(C.slice(a, a + 4 * g), 4 * s * (h + x) + 4 * v), (a += R);
        return A;
      }
      var b = new i.Context();
      b.size(s, r), (b.asBitmap = !0);
      var S = null;
      if (0 != t || 0 != e || s != d || r != p) {
        var w = (S = this._uv.slice())[0],
          M = S[1],
          I = (S[2] - w) / l,
          P = (S[7] - M) / _;
        S = [
          w + y * I,
          M + E * P,
          w + (y + g) * I,
          M + E * P,
          w + (y + g) * I,
          M + (E + T) * P,
          w + y * I,
          M + (E + T) * P,
        ];
      }
      b._drawTextureM(this, v, x, g, T, null, 1, S),
        b._targets.start(),
        b.flush(),
        b._targets.end(),
        b._targets.restore();
      var L = b._targets.getData(0, 0, s, r);
      for (
        b.destroy(),
          A = new Uint8Array(s * r * 4),
          a = 0,
          n = (r - 1) * R,
          h = r - 1;
        h &gt;= 0;
        h--
      )
        A.set(L.slice(n, n + R), a), (a += R), (n -= R);
      return A;
    }
    getPixels(t, e, i, s) {
      return this.getTexturePixels(t, e, i, s);
    }
    recoverBitmap(t = null) {
      var e = this._bitmap.url;
      if (!this._destroyed &amp;&amp; (!this._bitmap || this._bitmap.destroyed) &amp;&amp; e) {
        let s = i.Loader.loadedMap[e];
        s
          ? ((this.bitmap = s), t &amp;&amp; t())
          : i.loader.load(
              e,
              S.create(this, (e) =&gt; {
                (this.bitmap = e), t &amp;&amp; t();
              }),
              null,
              "htmlimage",
              1,
              !0,
            );
      }
    }
    disposeBitmap() {
      !this._destroyed &amp;&amp; this._bitmap &amp;&amp; this._bitmap.destroy();
    }
    destroy(t = !1) {
      if (!this._destroyed) {
        this._destroyed = !0;
        var e = this._bitmap;
        e &amp;&amp;
          (e._removeReference(this._referenceCount),
          (0 === e.referenceCount || t) &amp;&amp; e.destroy(),
          (e = null)),
          this.url &amp;&amp;
            this === i.loader.getRes(this.url) &amp;&amp;
            i.Loader.clearRes(this.url);
      }
    }
  }
  (Jt.DEF_UV = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])),
    (Jt.NO_UV = new Float32Array([0, 0, 0, 0, 0, 0, 0, 0])),
    (Jt.INV_UV = new Float32Array([0, 1, 1, 1, 1, 0, 0, 0])),
    (Jt._rect1 = new m()),
    (Jt._rect2 = new m());
  class te {
    constructor(t) {
      (this._font = "14px Arial"),
        (this._family = "Arial"),
        (this._size = 14),
        (this._italic = !1),
        (this._bold = !1),
        (this._id = te._gfontID++),
        this.setFont(t || this._font);
    }
    static Parse(t) {
      if (t === te._lastFont) return te._lastFontInfo;
      var e = te._cache[t];
      return (
        e || (e = te._cache[t] = new te(t)),
        (te._lastFont = t),
        (te._lastFontInfo = e),
        e
      );
    }
    setFont(t) {
      this._font = t;
      var e = t.split(" "),
        i = e.length;
      if (i &lt; 2)
        1 == i &amp;&amp; e[0].indexOf("px") &gt; 0 &amp;&amp; (this._size = parseInt(e[0]));
      else {
        for (var s = -1, r = 0; r &lt; i; r++)
          if (e[r].indexOf("px") &gt; 0 || e[r].indexOf("pt") &gt; 0) {
            (s = r),
              (this._size = parseInt(e[r])),
              this._size &lt;= 0 &amp;&amp;
                (console.error("font parse error:" + t), (this._size = 14));
            break;
          }
        var a = s + 1,
          n = e[a];
        for (a++; a &lt; i; a++) n += " " + e[a];
        (this._family = n.split(",")[0]),
          (this._italic = e.indexOf("italic") &gt;= 0),
          (this._bold = e.indexOf("bold") &gt;= 0);
      }
    }
  }
  (te.EMPTY = new te(null)),
    (te._cache = {}),
    (te._gfontID = 0),
    (te._lastFont = "");
  class ee {
    constructor() {
      (this.save = []),
        (this.toUpperCase = null),
        (this.width = -1),
        (this.pageChars = []),
        (this.startID = 0),
        (this.startIDStroke = 0),
        (this.lastGCCnt = 0),
        (this.splitRender = !1),
        (this.scalex = 1),
        (this.scaley = 1);
    }
    setText(t) {
      (this.changed = !0),
        (this._text = t),
        (this.width = -1),
        this.cleanCache();
    }
    toString() {
      return this._text;
    }
    get length() {
      return this._text ? this._text.length : 0;
    }
    charCodeAt(t) {
      return this._text ? this._text.charCodeAt(t) : NaN;
    }
    charAt(t) {
      return this._text ? this._text.charAt(t) : null;
    }
    cleanCache() {
      let t = this.pageChars;
      for (var e in t) {
        let s = t[e];
        var i = s.tex;
        1 == s.words.length &amp;&amp; i &amp;&amp; i.ri &amp;&amp; i.destroy();
      }
      (this.pageChars = []),
        (this.startID = 0),
        (this.scalex = 1),
        (this.scaley = 1);
    }
  }
  class ie {
    constructor() {
      (this.char = ""),
        (this.deleted = !1),
        (this.uv = new Array(8)),
        (this.pos = 0),
        (this.orix = 0),
        (this.oriy = 0),
        (this.touchTick = 0),
        (this.isSpace = !1);
    }
    touch() {
      var t = Rt.loopCount;
      this.touchTick != t &amp;&amp; this.tex.touchRect(this, t), (this.touchTick = t);
    }
  }
  class se {
    constructor() {
      this.fontsz = 16;
    }
    getWidth(t, e) {
      return 0;
    }
    scale(t, e) {}
    get canvasWidth() {
      return 0;
    }
    set canvasWidth(t) {}
    getCharBmp(t, e, i, s, r, a, n, h, o, l, _ = null) {
      return null;
    }
  }
  class re {
    static __init__() {
      var t = window.Laya || i.Laya;
      if (re._window) return re._window;
      var e = (re._window = window),
        s = (re._document = e.document),
        r = (re.userAgent = e.navigator.userAgent),
        a = e.navigator.maxTouchPoints || 0,
        n = e.navigator.platform;
      "my" in re.window &amp;&amp;
        (r.indexOf("TB/") &gt; -1 ||
        r.indexOf("Taobao/") &gt; -1 ||
        r.indexOf("TM/") &gt; -1
          ? (window.tbMiniGame(t, t),
            t.TBMiniAdapter
              ? t.TBMiniAdapter.enable()
              : console.error(
                  "è¯·å…ˆæ·»åŠ&nbsp;æ·˜å®é€‚é…åº“,è¯¦ç»†æ•™ç¨‹ï¼šhttps://ldc2.layabox.com/doc/?language=zh&amp;nav=zh-ts-5-10-0",
                ))
          : r.indexOf("AlipayMiniGame") &gt; -1 &amp;&amp;
            (window.aliPayMiniGame(t, t),
            t.ALIMiniAdapter
              ? t.ALIMiniAdapter.enable()
              : console.error(
                  "è¯·å…ˆæ·»åŠ&nbsp;é˜¿é‡Œå°æ¸¸æˆé€‚é…åº“,è¯¦ç»†æ•™ç¨‹ï¼šhttps://ldc2.layabox.com/doc/?language=zh&amp;nav=zh-ts-5-6-0",
                ))),
        -1 == r.indexOf("OPPO") &amp;&amp;
          r.indexOf("MiniGame") &gt; -1 &amp;&amp;
          "wx" in re.window &amp;&amp;
          ("tt" in re.window
            ? (window.ttMiniGame(t, t),
              t.TTMiniAdapter
                ? t.TTMiniAdapter.enable()
                : console.error(
                    "è¯·å¼•å…¥å­—èŠ‚è·³åŠ¨å°æ¸¸æˆçš„é€‚é…åº“,è¯¦ç»†æ•™ç¨‹ï¼šhttps://ldc2.layabox.com/doc/?language=zh&amp;nav=zh-ts-5-8-0",
                  ))
            : "bl" in re.window
              ? (window.biliMiniGame(t, t),
                t.BLMiniAdapter
                  ? t.BLMiniAdapter.enable()
                  : console.error(
                      "è¯·å¼•å…¥bilibiliå°æ¸¸æˆçš„é€‚é…åº“,è¯¦ç»†æ•™ç¨‹ï¼šhttps://ldc2.layabox.com/doc/?language=zh&amp;nav=zh-ts-5-7-0",
                    ))
              : "qq" in re.window
                ? (window.qqMiniGame(t, t),
                  t.QQMiniAdapter
                    ? t.QQMiniAdapter.enable()
                    : console.error(
                        "è¯·å¼•å…¥æ‰‹æœºQQå°æ¸¸æˆçš„é€‚é…åº“,è¯¦ç»†æ•™ç¨‹ï¼šhttps://ldc2.layabox.com/doc/?language=zh&amp;nav=zh-ts-5-5-0",
                      ))
                : (window.wxMiniGame(t, t),
                  t.MiniAdpter
                    ? t.MiniAdpter.enable()
                    : console.error(
                        "è¯·å…ˆæ·»åŠ&nbsp;å°æ¸¸æˆé€‚é…åº“,è¯¦ç»†æ•™ç¨‹ï¼šhttps://ldc2.layabox.com/doc/?nav=zh-ts-5-0-0",
                      ))),
        "hbs" in re.window &amp;&amp;
          (window.hwMiniGame(t, t),
          t.HWMiniAdapter
            ? t.HWMiniAdapter.enable()
            : console.error(
                "è¯·å…ˆæ·»åŠ&nbsp;å°æ¸¸æˆé€‚é…åº“ï¼Œè¯¦ç»†æ•™ç¨‹ï¼šhttps://ldc2.layabox.com/doc/?language=zh&amp;nav=zh-ts-5-9-1",
              )),
        r.indexOf("SwanGame") &gt; -1 &amp;&amp;
          (window.bdMiniGame(t, t),
          t.BMiniAdapter
            ? t.BMiniAdapter.enable()
            : console.error(
                "è¯·å…ˆæ·»åŠ&nbsp;ç™¾åº¦å°æ¸¸æˆé€‚é…åº“,è¯¦ç»†æ•™ç¨‹ï¼šhttps://ldc2.layabox.com/doc/?language=zh&amp;nav=zh-ts-5-1-0",
              )),
        r.indexOf("QuickGame") &gt; -1 &amp;&amp;
          (window.miMiniGame(t, t),
          t.KGMiniAdapter
            ? t.KGMiniAdapter.enable()
            : console.error(
                "è¯·å…ˆæ·»åŠ&nbsp;å°ç±³å°æ¸¸æˆé€‚é…åº“,è¯¦ç»†æ•™ç¨‹ï¼šhttps://ldc2.layabox.com/doc/?language=zh&amp;nav=zh-ts-5-2-0",
              )),
        r.indexOf("OPPO") &gt; -1 &amp;&amp;
          r.indexOf("MiniGame") &gt; -1 &amp;&amp;
          (window.qgMiniGame(t, t),
          t.QGMiniAdapter
            ? t.QGMiniAdapter.enable()
            : console.error(
                "è¯·å…ˆæ·»åŠ&nbsp;OPPOå°æ¸¸æˆé€‚é…åº“,è¯¦ç»†æ•™ç¨‹ï¼šhttps://ldc2.layabox.com/doc/?language=zh&amp;nav=zh-ts-5-3-0",
              )),
        r.indexOf("VVGame") &gt; -1 &amp;&amp;
          (window.vvMiniGame(t, t),
          t.VVMiniAdapter
            ? t.VVMiniAdapter.enable()
            : console.error(
                "è¯·å…ˆæ·»åŠ&nbsp;vivoå°æ¸¸æˆé€‚é…åº“,è¯¦ç»†æ•™ç¨‹ï¼šhttps://ldc2.layabox.com/doc/?language=zh&amp;nav=zh-ts-5-4-0",
              )),
        (e.trace = console.log),
        (e.requestAnimationFrame =
          e.requestAnimationFrame ||
          e.webkitRequestAnimationFrame ||
          e.mozRequestAnimationFrame ||
          e.oRequestAnimationFrame ||
          e.msRequestAnimationFrame ||
          function (t) {
            return e.setTimeout(t, 1e3 / 60);
          });
      var h = s.body.style;
      (h.margin = 0),
        (h.overflow = "hidden"),
        (h["-webkit-user-select"] = "none"),
        (h["-webkit-tap-highlight-color"] = "rgba(200,200,200,0)");
      for (
        var o = s.getElementsByTagName("meta"),
          l = 0,
          _ = !1,
          u =
            "width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no";
        l &lt; o.length;

      ) {
        var c = o[l];
        if ("viewport" == c.name) {
          (c.content = u), (_ = !0);
          break;
        }
        l++;
      }
      return (
        _ ||
          (((c = s.createElement("meta")).name = "viewport"),
          (c.content = u),
          s.getElementsByTagName("head")[0].appendChild(c)),
        (re.onMobile = !!window.conch || r.indexOf("Mobile") &gt; -1),
        (re.onIOS = !!r.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)),
        (re.onIPhone = r.indexOf("iPhone") &gt; -1),
        (re.onMac = r.indexOf("Mac OS X") &gt; -1),
        (re.onIPad = r.indexOf("iPad") &gt; -1 || ("MacIntel" === n &amp;&amp; a &gt; 1)),
        (re.onAndroid = r.indexOf("Android") &gt; -1 || r.indexOf("Adr") &gt; -1),
        (re.onWP = r.indexOf("Windows Phone") &gt; -1),
        (re.onQQBrowser = r.indexOf("QQBrowser") &gt; -1),
        (re.onMQQBrowser =
          r.indexOf("MQQBrowser") &gt; -1 ||
          (r.indexOf("Mobile") &gt; -1 &amp;&amp; r.indexOf("QQ") &gt; -1)),
        (re.onIE = !!e.ActiveXObject || "ActiveXObject" in e),
        (re.onWeiXin = r.indexOf("MicroMessenger") &gt; -1),
        (re.onSafari = r.indexOf("Safari") &gt; -1),
        (re.onChrome = r.indexOf("Chrome") &gt; -1),
        (re.onPC = !re.onMobile),
        (re.onFirefox = r.indexOf("Firefox") &gt; -1),
        (re.onEdge = r.indexOf("Edge") &gt; -1),
        (re.onMiniGame = r.indexOf("MiniGame") &gt; -1),
        (re.onBDMiniGame = r.indexOf("SwanGame") &gt; -1),
        (re.onLayaRuntime = !!window.conch),
        r.indexOf("OPPO") &gt; -1 &amp;&amp; r.indexOf("MiniGame") &gt; -1
          ? ((re.onQGMiniGame = !0), (re.onMiniGame = !1))
          : "qq" in re.window &amp;&amp; r.indexOf("MiniGame") &gt; -1
            ? ((re.onQQMiniGame = !0), (re.onMiniGame = !1))
            : "bl" in re.window &amp;&amp; r.indexOf("MiniGame") &gt; -1
              ? ((re.onBLMiniGame = !0), (re.onMiniGame = !1))
              : "tt" in re.window &amp;&amp;
                r.indexOf("MiniGame") &gt; -1 &amp;&amp;
                ((re.onTTMiniGame = !0), (re.onMiniGame = !1)),
        (re.onHWMiniGame = "hbs" in re.window),
        (re.onVVMiniGame = r.indexOf("VVGame") &gt; -1),
        (re.onKGMiniGame = r.indexOf("QuickGame") &gt; -1),
        r.indexOf("AlipayMiniGame") &gt; -1 &amp;&amp;
          ((re.onAlipayMiniGame = !0), (re.onMiniGame = !1)),
        (r.indexOf("TB/") &gt; -1 ||
          r.indexOf("Taobao/") &gt; -1 ||
          r.indexOf("TM/") &gt; -1) &amp;&amp;
          (re.onTBMiniGame = !0),
        e
      );
    }
    static get _isMiniGame() {
      return (
        re.onMiniGame ||
        re.onBDMiniGame ||
        re.onQGMiniGame ||
        re.onKGMiniGame ||
        re.onVVMiniGame ||
        re.onAlipayMiniGame ||
        re.onQQMiniGame ||
        re.onBLMiniGame ||
        re.onTTMiniGame ||
        re.onHWMiniGame ||
        re.onTBMiniGame
      );
    }
    static createElement(t) {
      return re.__init__(), re._document.createElement(t);
    }
    static getElementById(t) {
      return re.__init__(), re._document.getElementById(t);
    }
    static removeElement(t) {
      t &amp;&amp; t.parentNode &amp;&amp; t.parentNode.removeChild(t);
    }
    static now() {
      return Date.now();
    }
    static get clientWidth() {
      return (
        re.__init__(), re._window.innerWidth || re._document.body.clientWidth
      );
    }
    static get clientHeight() {
      return (
        re.__init__(),
        re._window.innerHeight ||
          re._document.body.clientHeight ||
          re._document.documentElement.clientHeight
      );
    }
    static get width() {
      return (
        re.__init__(),
        (i.stage &amp;&amp; i.stage.canvasRotation ? re.clientHeight : re.clientWidth) *
          re.pixelRatio
      );
    }
    static get height() {
      return (
        re.__init__(),
        (i.stage &amp;&amp; i.stage.canvasRotation ? re.clientWidth : re.clientHeight) *
          re.pixelRatio
      );
    }
    static get pixelRatio() {
      return (
        re._pixelRatio &lt; 0 &amp;&amp;
          (re.__init__(),
          re.userAgent.indexOf(
            "Mozilla/6.0(Linux; Android 6.0; HUAWEI NXT-AL10 Build/HUAWEINXT-AL10)",
          ) &gt; -1
            ? (re._pixelRatio = 2)
            : ((re._pixelRatio = re._window.devicePixelRatio || 1),
              re._pixelRatio &lt; 1 &amp;&amp; (re._pixelRatio = 1))),
        re._pixelRatio
      );
    }
    static get container() {
      return (
        re._container ||
          (re.__init__(),
          (re._container = re.createElement("div")),
          (re._container.id = "layaContainer"),
          re._document.body.appendChild(re._container)),
        re._container
      );
    }
    static set container(t) {
      re._container = t;
    }
    static get window() {
      return re._window || re.__init__();
    }
    static get document() {
      return re.__init__(), re._document;
    }
  }
  (re._pixelRatio = -1),
    (re.mainCanvas = null),
    (re.hanzi = new RegExp("^[ä¸€-é¾¥]$")),
    (re.fontMap = {}),
    (re.measureText = function (t, e) {
      var i = re.hanzi.test(t);
      if (i &amp;&amp; re.fontMap[e]) return re.fontMap[e];
      var s = re.context;
      s.font = e;
      var r = s.measureText(t);
      return i &amp;&amp; (re.fontMap[e] = r), r;
    });
  class ae extends se {
    constructor(t, e, i = !0, s = !0, r = !1) {
      super(),
        (this.ctx = null),
        (this.lastScaleX = 1),
        (this.lastScaleY = 1),
        (this.maxTexW = 0),
        (this.maxTexH = 0),
        (this.scaleFontSize = !0),
        (this.showDbgInfo = !1),
        (this.supportImageData = !0),
        (this.maxTexW = t),
        (this.maxTexH = e),
        (this.scaleFontSize = i),
        (this.supportImageData = s),
        (this.showDbgInfo = r),
        ae.canvas ||
          ((ae.canvas = re.createElement("canvas")),
          (ae.canvas.width = 1024),
          (ae.canvas.height = 512),
          (ae.canvas.style.left = "-10000px"),
          (ae.canvas.style.position = "absolute"),
          document.body.appendChild(ae.canvas),
          (this.ctx = ae.canvas.getContext("2d")));
    }
    get canvasWidth() {
      return ae.canvas.width;
    }
    set canvasWidth(t) {
      ae.canvas.width != t &amp;&amp;
        ((ae.canvas.width = t),
        t &gt; 2048 &amp;&amp; console.warn("ç”»æ–‡å­—è®¾ç½®çš„å®½åº¦å¤ªå¤§ï¼Œè¶…è¿‡2048äº†"),
        this.ctx.setTransform(1, 0, 0, 1, 0, 0),
        this.ctx.scale(this.lastScaleX, this.lastScaleY));
    }
    getWidth(t, e) {
      return this.ctx
        ? (this.ctx._lastFont != t &amp;&amp;
            ((this.ctx.font = t), (this.ctx._lastFont = t)),
          this.ctx.measureText(e).width)
        : 0;
    }
    scale(t, e) {
      if (!this.supportImageData)
        return (this.lastScaleX = t), void (this.lastScaleY = e);
      (this.lastScaleX == t &amp;&amp; this.lastScaleY == e) ||
        (this.ctx.setTransform(t, 0, 0, e, 0, 0),
        (this.lastScaleX = t),
        (this.lastScaleY = e));
    }
    getCharBmp(t, e, i, s, r, a, n, h, o, l, _ = null) {
      if (!this.supportImageData)
        return this.getCharCanvas(t, e, i, s, r, a, n, h, o, l);
      var u = this.ctx,
        c = this.fontsz;
      u.font != e &amp;&amp; ((u.font = e), (u._lastFont = e)),
        (a.width = u.measureText(t).width);
      var d = a.width * this.lastScaleX,
        p = a.height * this.lastScaleY;
      (d += (n + o) * this.lastScaleX),
        (p += (h + l) * this.lastScaleY),
        (d = Math.ceil(d)),
        (p = Math.ceil(p));
      var f = (d = Math.min(d, ae.canvas.width)) + 2 * i + 1,
        m = (p = Math.min(p, ae.canvas.height)) + 2 * i + 1;
      _ &amp;&amp;
        ((f = Math.max(f, _[0] + _[2] + 1)),
        (m = Math.max(m, _[1] + _[3] + 1))),
        u.clearRect(0, 0, f / this.lastScaleX + 1, m / this.lastScaleY + 1),
        u.save(),
        (u.textBaseline = "middle"),
        i &gt; 0 &amp;&amp;
          ((u.strokeStyle = r),
          (u.lineWidth = i),
          u.strokeText(t, n, h + c / 2)),
        s &amp;&amp; ((u.fillStyle = s), u.fillText(t, n, h + c / 2)),
        this.showDbgInfo &amp;&amp;
          ((u.strokeStyle = "#ff0000"),
          u.strokeRect(1, 1, d - 2, p - 2),
          (u.strokeStyle = "#00ff00"),
          u.strokeRect(n, h, a.width, a.height)),
        _ &amp;&amp;
          (-1 == _[2] &amp;&amp;
            (_[2] = Math.ceil((a.width + 2 * i) * this.lastScaleX)),
          _[2] &lt;= 0 &amp;&amp; (_[2] = 1));
      var g = _
        ? u.getImageData(_[0], _[1], _[2], _[3] + 1)
        : u.getImageData(0, 0, d, p + 1);
      return u.restore(), (a.bmpWidth = g.width), (a.bmpHeight = g.height), g;
    }
    getCharCanvas(t, e, i, s, r, a, n, h, o, l) {
      var _ = this.ctx;
      _.font != e &amp;&amp; ((_.font = e), (_._lastFont = e)),
        (a.width = _.measureText(t).width);
      var u = a.width * this.lastScaleX,
        c = a.height * this.lastScaleY;
      (u += (n + o) * this.lastScaleX),
        (c += (h + l) * this.lastScaleY + 1),
        (u = Math.min(u, this.maxTexW)),
        (c = Math.min(c, this.maxTexH)),
        (ae.canvas.width = Math.min(u + 1, this.maxTexW)),
        (ae.canvas.height = Math.min(c + 1, this.maxTexH)),
        (_.font = e),
        _.clearRect(0, 0, u + 1 + i, c + 1 + i),
        _.setTransform(1, 0, 0, 1, 0, 0),
        _.save(),
        this.scaleFontSize &amp;&amp; _.scale(this.lastScaleX, this.lastScaleY),
        _.translate(n, h),
        (_.textAlign = "left");
      var d = this.fontsz;
      return (
        (_.textBaseline = "middle"),
        i &gt; 0
          ? ((_.strokeStyle = r),
            (_.fillStyle = s),
            (_.lineWidth = i),
            _.fillAndStrokeText
              ? _.fillAndStrokeText(t, 0, d / 2)
              : (_.strokeText(t, 0, d / 2), _.fillText(t, 0, d / 2)))
          : s &amp;&amp; ((_.fillStyle = s), _.fillText(t, 0, d / 2)),
        this.showDbgInfo &amp;&amp;
          ((_.strokeStyle = "#ff0000"),
          _.strokeRect(0, 0, u, c),
          (_.strokeStyle = "#00ff00"),
          _.strokeRect(0, 0, a.width, a.height)),
        _.restore(),
        (a.bmpWidth = ae.canvas.width),
        (a.bmpHeight = ae.canvas.height),
        ae.canvas
      );
    }
  }
  ae.canvas = null;
  class ne extends se {
    constructor() {
      super(),
        (this.lastFont = ""),
        (this.lastScaleX = 1),
        (this.lastScaleY = 1);
    }
    getWidth(t, e) {
      return window.conchTextCanvas
        ? ((window.conchTextCanvas.font = t),
          (this.lastFont = t),
          window.conchTextCanvas.measureText(e).width)
        : 0;
    }
    scale(t, e) {
      (this.lastScaleX = t), (this.lastScaleY = e);
    }
    getCharBmp(t, e, i, s, r, a, n, h, o, l, _ = null) {
      if (!window.conchTextCanvas) return null;
      (window.conchTextCanvas.font = e), (this.lastFont = e);
      (a.width = window.conchTextCanvas.measureText(t).width), a.height;
      window.conchTextCanvas.scale &amp;&amp;
        window.conchTextCanvas.scale(this.lastScaleX, this.lastScaleY);
      var u = tt.create(r).numColor,
        c = tt.create(s).numColor,
        d = window.conchTextCanvas.getTextBitmapData(t, c, i &gt; 2 ? 2 : i, u);
      return (a.bmpWidth = d.width), (a.bmpHeight = d.height), d;
    }
  }
  class he {
    constructor() {
      (this.fontSizeInfo = {}),
        (this.mapFont = {}),
        (this.fontID = 0),
        (this.fontScaleX = 1),
        (this.fontScaleY = 1),
        (this._curStrPos = 0),
        (this.textAtlases = []),
        (this.isoTextures = []),
        (this.lastFont = null),
        (this.fontSizeW = 0),
        (this.fontSizeH = 0),
        (this.fontSizeOffX = 0),
        (this.fontSizeOffY = 0),
        (this.renderPerChar = !0),
        (this.tmpAtlasPos = new f()),
        (this.textureMem = 0),
        (i.TextAtlas = Qt);
      var t = !1,
        e = i.Laya.MiniAdpter;
      e &amp;&amp;
        e.systemInfo &amp;&amp;
        e.systemInfo.system &amp;&amp;
        (t = "ios 10.1.1" === e.systemInfo.system.toLowerCase()),
        (i.Browser.onMiniGame ||
          i.Browser.onTTMiniGame ||
          i.Browser.onBLMiniGame ||
          i.Browser.onAlipayMiniGame ||
          i.Browser.onTBMiniGame) &amp;&amp;
          !t &amp;&amp;
          (he.isWan1Wan = !0),
        (this.charRender = i.Render.isConchApp
          ? new ne()
          : new ae(2048, 2048, he.scaleFontWithCtx, !he.isWan1Wan, !1)),
        (he.textRenderInst = this),
        (i.Laya.textRender = this),
        (he.atlasWidth2 = he.atlasWidth * he.atlasWidth);
    }
    setFont(t) {
      if (this.lastFont != t) {
        this.lastFont = t;
        var e = this.getFontSizeInfo(t._family),
          i = e &gt;&gt; 24,
          s = (e &gt;&gt; 16) &amp; 255,
          r = (e &gt;&gt; 8) &amp; 255,
          a = 255 &amp; e,
          n = t._size / he.standardFontSize;
        (this.fontSizeOffX = Math.ceil(i * n)),
          (this.fontSizeOffY = Math.ceil(s * n)),
          (this.fontSizeW = Math.ceil(r * n)),
          (this.fontSizeH = Math.ceil(a * n)),
          t._font.indexOf("italic") &gt;= 0
            ? (this.fontStr = t._font.replace("italic", ""))
            : (this.fontStr = t._font);
      }
    }
    getNextChar(t) {
      var e = t.length,
        i = this._curStrPos;
      if (!t.substring) return null;
      if (i &gt;= e) return null;
      for (var s = i, r = 0; s &lt; e; s++) {
        var a = t.charCodeAt(s);
        if (a &gt;&gt;&gt; 11 == 27) {
          if (1 == r) break;
          (r = 1), s++;
        } else if (65038 === a || 65039 === a);
        else if (8205 == a) r = 2;
        else if (0 == r) r = 1;
        else if (1 == r) break;
      }
      return (this._curStrPos = s), t.substring(i, s);
    }
    filltext(t, e, s, r, a, n, h, o, l, _ = 0) {
      if (!(e.length &lt;= 0)) {
        var u = te.Parse(a),
          c = 0;
        switch (l) {
          case "center":
            c = i.Context.ENUM_TEXTALIGN_CENTER;
            break;
          case "right":
            c = i.Context.ENUM_TEXTALIGN_RIGHT;
        }
        this._fast_filltext(t, e, null, s, r, u, n, h, o, c, _);
      }
    }
    fillWords(t, e, i, s, r, a, n, h) {
      if (e &amp;&amp; !(e.length &lt;= 0)) {
        var o = "string" == typeof r ? te.Parse(r) : r;
        this._fast_filltext(t, null, e, i, s, o, a, n, h, 0, 0);
      }
    }
    _fast_filltext(t, e, s, r, a, n, h, o, l, _, u = 0) {
      if ((!e || e.length &gt;= 1) &amp;&amp; !(s &amp;&amp; s.length &lt; 1)) {
        if (
          (l &lt; 0 &amp;&amp; (l = 0),
          this.setFont(n),
          (this.fontScaleX = this.fontScaleY = 1),
          he.scaleFontWithCtx)
        ) {
          var c = 1,
            d = 1;
          if (
            ((i.Render.isConchApp &amp;&amp; !window.conchTextCanvas.scale) ||
              ((c = t.getMatScaleX()), (d = t.getMatScaleY())),
            c &lt; 1e-4 || d &lt; 0.1)
          )
            return;
          c &gt; 1 &amp;&amp; (this.fontScaleX = c), d &gt; 1 &amp;&amp; (this.fontScaleY = d);
        }
        n._italic &amp;&amp; (t._italicDeg = 13);
        var p = e,
          f = !s &amp;&amp; e instanceof ee,
          m = e &amp;&amp; e.toString(),
          g = !!s,
          T = f ? p.pageChars : [],
          v = 0;
        switch (
          (f
            ? ((m = p._text),
              (v = p.width) &lt; 0 &amp;&amp;
                (v = p.width = this.charRender.getWidth(this.fontStr, m)))
            : (v = m ? this.charRender.getWidth(this.fontStr, m) : 0),
          _)
        ) {
          case i.Context.ENUM_TEXTALIGN_CENTER:
            r -= v / 2;
            break;
          case i.Context.ENUM_TEXTALIGN_RIGHT:
            r -= v;
        }
        p &amp;&amp; T &amp;&amp; this.hasFreedText(T) &amp;&amp; (T = p.pageChars = []);
        var x = null,
          y = (this.renderPerChar =
            !f || he.forceSplitRender || g || (f &amp;&amp; p.splitRender));
        if (!T || T.length &lt; 1)
          if (
            (f &amp;&amp; ((p.scalex = this.fontScaleX), (p.scaley = this.fontScaleY)),
            y)
          ) {
            var E,
              R = 0,
              C = 0;
            for (this._curStrPos = 0; ; ) {
              if (s) {
                var A = s[this._curStrPos++];
                A ? ((E = A.char), (R = A.x), (C = A.y)) : (E = null);
              } else E = this.getNextChar(m);
              if (!E) break;
              if (!(x = this.getCharRenderInfo(E, n, h, o, l, !1))) break;
              if (x.isSpace);
              else {
                var b = T[x.tex.id];
                if (b) b = b.words;
                else {
                  var S = {
                    texgen: x.tex.genID,
                    tex: x.tex,
                    words: new Array(),
                  };
                  (T[x.tex.id] = S), (b = S.words);
                }
                b.push({
                  ri: x,
                  x: R,
                  y: C,
                  w: x.bmpWidth / this.fontScaleX,
                  h: x.bmpHeight / this.fontScaleY,
                }),
                  (R += x.width);
              }
            }
          } else {
            var w = i.Render.isConchApp ? 0 : (n._size / 3) | 0,
              M = he.noAtlas || (v + w + w) * this.fontScaleX &gt; he.atlasWidth;
            (x = this.getCharRenderInfo(m, n, h, o, l, M)),
              (T[0] = {
                texgen: x.tex.genID,
                tex: x.tex,
                words: [
                  {
                    ri: x,
                    x: 0,
                    y: 0,
                    w: x.bmpWidth / this.fontScaleX,
                    h: x.bmpHeight / this.fontScaleY,
                  },
                ],
              });
          }
        this._drawResortedWords(t, r, a, T), (t._italicDeg = 0);
      }
    }
    _drawResortedWords(t, e, s, r) {
      var a = !!t._charSubmitCache &amp;&amp; t._charSubmitCache._enable,
        n = t._curMat;
      for (var h in r) {
        var o = r[h];
        if (o) {
          var l = o.words,
            _ = l.length;
          if (!(_ &lt;= 0))
            for (var u = r[h].tex, c = 0; c &lt; _; c++) {
              var d = l[c],
                p = d.ri;
              if (!p.isSpace) {
                if ((p.touch(), (t.drawTexAlign = !0), i.Render.isConchApp))
                  t._drawTextureM(
                    u.texture,
                    e + d.x - p.orix,
                    s + d.y - p.oriy,
                    d.w,
                    d.h,
                    null,
                    1,
                    p.uv,
                  );
                else {
                  let i = u;
                  t._inner_drawTexture(
                    i.texture,
                    i.id,
                    e + d.x - p.orix,
                    s + d.y - p.oriy,
                    d.w,
                    d.h,
                    n,
                    p.uv,
                    1,
                    a,
                  );
                }
                t.touches &amp;&amp; t.touches.push(p);
              }
            }
        }
      }
    }
    hasFreedText(t) {
      for (let s in t) {
        var e = t[s];
        if (e) {
          var i = e.tex;
          if (i.__destroyed || i.genID != e.texgen) return !0;
        }
      }
      return !1;
    }
    getCharRenderInfo(t, e, s, r, a, n = !1) {
      var h = this.mapFont[e._family];
      null == h &amp;&amp; (this.mapFont[e._family] = h = this.fontID++);
      var o = t + "_" + h + "_" + e._size + "_" + s;
      a &gt; 0 &amp;&amp; (o += "_" + r + a),
        e._bold &amp;&amp; (o += "P"),
        (1 == this.fontScaleX &amp;&amp; 1 == this.fontScaleY) ||
          (o +=
            ((20 * this.fontScaleX) | 0) + "_" + ((20 * this.fontScaleY) | 0));
      var l,
        _,
        u = 0,
        c = this.textAtlases.length;
      if (!n)
        for (u = 0; u &lt; c; u++)
          if ((l = (_ = this.textAtlases[u]).charMaps[o])) return l.touch(), l;
      (l = new ie()),
        this.charRender.scale(this.fontScaleX, this.fontScaleY),
        (l.char = t),
        (l.height = e._size);
      var d = i.Render.isConchApp ? 0 : (e._size / 3) | 0,
        p = null;
      a || (a = 0);
      var f = Math.ceil(
        (this.charRender.getWidth(this.fontStr, t) + 2 * a) * this.fontScaleX,
      );
      if (
        (f &gt; this.charRender.canvasWidth &amp;&amp;
          (this.charRender.canvasWidth = Math.min(2048, f + 2 * d)),
        n)
      ) {
        if (
          ((this.charRender.fontsz = e._size),
          (p = this.charRender.getCharBmp(
            t,
            this.fontStr,
            a,
            s,
            r,
            l,
            d,
            d,
            d,
            d,
            null,
          )))
        ) {
          var m = Zt.getTextTexture(p.width, p.height);
          m.addChar(p, 0, 0, l.uv),
            (l.tex = m),
            (l.orix = d),
            (l.oriy = d),
            (m.ri = l),
            this.isoTextures.push(m);
        }
      } else {
        var g = t.length,
          T = 1 * a,
          v = Math.ceil((this.fontSizeW + 2 * T) * this.fontScaleX),
          x = Math.ceil((this.fontSizeH + 2 * T) * this.fontScaleY);
        (he.imgdtRect[0] = ((d - this.fontSizeOffX - T) * this.fontScaleX) | 0),
          (he.imgdtRect[1] =
            ((d - this.fontSizeOffY - T) * this.fontScaleY) | 0),
          this.renderPerChar || 1 == g
            ? ((he.imgdtRect[2] = Math.max(f, v)),
              (he.imgdtRect[3] = Math.max(f, x)))
            : ((he.imgdtRect[2] = -1), (he.imgdtRect[3] = x)),
          (this.charRender.fontsz = e._size),
          (p = this.charRender.getCharBmp(
            t,
            this.fontStr,
            a,
            s,
            r,
            l,
            d,
            d,
            d,
            d,
            he.imgdtRect,
          )) &amp;&amp;
            ((_ = this.addBmpData(p, l)),
            he.isWan1Wan
              ? ((l.orix = d), (l.oriy = d))
              : ((l.orix = this.fontSizeOffX + T),
                (l.oriy = this.fontSizeOffY + T)),
            (_.charMaps[o] = l));
      }
      return l;
    }
    addBmpData(t, e) {
      for (
        var i,
          s = t.width,
          r = t.height,
          a = this.textAtlases.length,
          n = !1,
          h = 0;
        h &lt; a &amp;&amp;
        !(n = (i = this.textAtlases[h]).getAEmpty(s, r, this.tmpAtlasPos));
        h++
      );
      if (!n) {
        if (
          ((i = new Qt()),
          this.textAtlases.push(i),
          !(n = i.getAEmpty(s, r, this.tmpAtlasPos)))
        )
          throw "err1";
        this.cleanAtlases();
      }
      return (
        n &amp;&amp;
          (i.texture.addChar(t, this.tmpAtlasPos.x, this.tmpAtlasPos.y, e.uv),
          (e.tex = i.texture)),
        i
      );
    }
    GC() {
      for (
        var t = 0,
          e = this.textAtlases.length,
          i = he.destroyAtlasDt,
          s = 0,
          r = Rt.loopCount,
          a = -1,
          n = 0,
          h = null,
          o = null;
        t &lt; e;
        t++
      ) {
        if ((h = (o = this.textAtlases[t]).texture)) {
          h.curUsedCovRate, (s += h.curUsedCovRateAtlas);
          var l = o.usedRate - h.curUsedCovRateAtlas;
          n &lt; l &amp;&amp; ((n = l), (a = t));
        }
        r - o.texture.lastTouchTm &gt; i &amp;&amp;
          (he.showLog &amp;&amp; console.log(o.texture.id),
          o.destroy(),
          (this.textAtlases[t] = this.textAtlases[e - 1]),
          e--,
          t--,
          (a = -1));
      }
      for (
        this.textAtlases.length = e, e = this.isoTextures.length, t = 0;
        t &lt; e;
        t++
      )
        r - (h = this.isoTextures[t]).lastTouchTm &gt; he.destroyUnusedTextureDt &amp;&amp;
          ((h.ri.deleted = !0),
          (h.ri.tex = null),
          h.destroy(),
          (this.isoTextures[t] = this.isoTextures[e - 1]),
          e--,
          t--);
      this.isoTextures.length = e;
      var _ = this.textAtlases.length &gt; 1 &amp;&amp; this.textAtlases.length - s &gt;= 2;
      (he.atlasWidth * he.atlasWidth * 4 * this.textAtlases.length &gt;
        he.cleanMem ||
        _ ||
        he.simClean) &amp;&amp;
        ((he.simClean = !1),
        he.showLog &amp;&amp;
          console.log(
            "æ¸…ç†ä½¿ç”¨çŽ‡ä½Žçš„è´´å›¾ã€‚æ€»ä½¿ç”¨çŽ‡:",
            s,
            ":",
            this.textAtlases.length,
            "æœ€å·®è´´å›¾:" + a,
          ),
        a &gt;= 0 &amp;&amp;
          ((o = this.textAtlases[a]).destroy(),
          (this.textAtlases[a] = this.textAtlases[this.textAtlases.length - 1]),
          (this.textAtlases.length = this.textAtlases.length - 1))),
        Zt.clean();
    }
    cleanAtlases() {}
    getCharBmp(t) {}
    checkBmpLine(t, e, i, s) {
      this.bmpData32.buffer != t.data.buffer &amp;&amp;
        (this.bmpData32 = new Uint32Array(t.data.buffer));
      for (var r = t.width * e + i, a = i; a &lt; s; a++)
        if (0 != this.bmpData32[r++]) return !0;
      return !1;
    }
    updateBbx(t, e, i = !1) {
      var s = t.width,
        r = t.height,
        a = 0,
        n = e[1],
        h = 0,
        o = n;
      if (this.checkBmpLine(t, n, 0, s))
        for (;;) {
          if ((o = ((n + h) / 2) | 0) + 1 &gt;= n) {
            e[1] = o;
            break;
          }
          this.checkBmpLine(t, o, 0, s) ? (n = o) : (h = o);
        }
      if (e[3] &gt; r) e[3] = r;
      else if (((o = n = e[3]), (h = r), this.checkBmpLine(t, n, 0, s)))
        for (;;) {
          if ((o = ((n + h) / 2) | 0) - 1 &lt;= n) {
            e[3] = o;
            break;
          }
          this.checkBmpLine(t, o, 0, s) ? (n = o) : (h = o);
        }
      if (!i) {
        var l = e[0],
          _ = s * e[1];
        for (o = e[1]; o &lt; e[3]; o++) {
          for (a = 0; a &lt; l; a++)
            if (0 != this.bmpData32[_ + a]) {
              l = a;
              break;
            }
          _ += s;
        }
        e[0] = l;
        var u = e[2];
        for (_ = s * e[1], o = e[1]; o &lt; e[3]; o++) {
          for (a = u; a &lt; s; a++)
            if (0 != this.bmpData32[_ + a]) {
              u = a;
              break;
            }
          _ += s;
        }
        e[2] = u;
      }
    }
    getFontSizeInfo(t) {
      var e = this.fontSizeInfo[t];
      if (null != e) return e;
      var s = "bold " + he.standardFontSize + "px " + t;
      if (he.isWan1Wan) {
        (this.fontSizeW = 1.5 * this.charRender.getWidth(s, "æœ‰")),
          (this.fontSizeH = 1.5 * he.standardFontSize);
        var r = (this.fontSizeW &lt;&lt; 8) | this.fontSizeH;
        return (this.fontSizeInfo[t] = r), r;
      }
      (he.pixelBBX[0] = he.standardFontSize / 2),
        (he.pixelBBX[1] = he.standardFontSize / 2),
        (he.pixelBBX[2] = he.standardFontSize),
        (he.pixelBBX[3] = he.standardFontSize);
      var a = 16,
        n = 16;
      this.charRender.scale(1, 1),
        (he.tmpRI.height = he.standardFontSize),
        (this.charRender.fontsz = he.standardFontSize);
      var h = this.charRender.getCharBmp(
        "g",
        s,
        0,
        "red",
        null,
        he.tmpRI,
        a,
        n,
        16,
        16,
      );
      i.Render.isConchApp &amp;&amp; (h.data = new Uint8ClampedArray(h.data)),
        (this.bmpData32 = new Uint32Array(h.data.buffer)),
        this.updateBbx(h, he.pixelBBX, !1),
        (h = this.charRender.getCharBmp(
          "æœ‰",
          s,
          0,
          "red",
          null,
          he.tmpRI,
          n,
          n,
          16,
          16,
        )),
        i.Render.isConchApp &amp;&amp; (h.data = new Uint8ClampedArray(h.data)),
        (this.bmpData32 = new Uint32Array(h.data.buffer)),
        he.pixelBBX[2] &lt; a + he.tmpRI.width &amp;&amp;
          (he.pixelBBX[2] = a + he.tmpRI.width),
        this.updateBbx(h, he.pixelBBX, !1),
        i.Render.isConchApp &amp;&amp; ((a = 0), (n = 0));
      var o =
        (Math.max(a - he.pixelBBX[0], 0) &lt;&lt; 24) |
        (Math.max(n - he.pixelBBX[1], 0) &lt;&lt; 16) |
        ((he.pixelBBX[2] - he.pixelBBX[0]) &lt;&lt; 8) |
        (he.pixelBBX[3] - he.pixelBBX[1]);
      return (this.fontSizeInfo[t] = o), o;
    }
    printDbgInfo() {
      for (var t in (console.log(
        "å›¾é›†ä¸ªæ•°:" +
          this.textAtlases.length +
          ",æ¯ä¸ªå›¾é›†å¤§å°:" +
          he.atlasWidth +
          "x" +
          he.atlasWidth,
        " ç”¨canvas:",
        he.isWan1Wan,
      ),
      console.log(
        "å›¾é›†å&nbsp;ç”¨ç©ºé—´:" +
          ((he.atlasWidth * he.atlasWidth * 4) / 1024 / 1024) *
            this.textAtlases.length +
          "M",
      ),
      console.log("ç¼“å­˜ç”¨åˆ°çš„å­—ä½“:"),
      this.mapFont)) {
        var e = this.getFontSizeInfo(t),
          i = e &gt;&gt; 24,
          s = (e &gt;&gt; 16) &amp; 255,
          r = (e &gt;&gt; 8) &amp; 255,
          a = 255 &amp; e;
        console.log("    " + t, " off:", i, s, " size:", r, a);
      }
      var n = 0;
      console.log("ç¼“å­˜æ•°æ®:");
      var h = 0,
        o = 0;
      this.textAtlases.forEach(function (t) {
        var e = t.texture.id,
          i = Rt.loopCount - t.texture.lastTouchTm,
          s = i &gt; 0 ? i + "å¸§ä»¥å‰" : "å½“å‰å¸§";
        for (var r in ((h += t.texture.curUsedCovRate),
        (o += t.texture.curUsedCovRateAtlas),
        console.log(
          "--å›¾é›†(id:" +
            e +
            ",å½“å‰ä½¿ç”¨çŽ‡:" +
            ((1e3 * t.texture.curUsedCovRate) | 0) +
            "â€°",
          "å½“å‰å›¾é›†ä½¿ç”¨çŽ‡:",
          ((100 * t.texture.curUsedCovRateAtlas) | 0) + "%",
          "å›¾é›†ä½¿ç”¨çŽ‡:",
          (100 * t.usedRate) | 0,
          "%, ä½¿ç”¨äºŽ:" + s + ")--:",
        ),
        t.charMaps)) {
          var a = t.charMaps[r];
          console.log(
            "     off:",
            a.orix,
            a.oriy,
            " bmpå®½é«˜:",
            a.bmpWidth,
            a.bmpHeight,
            "æ—&nbsp;æ•ˆ:",
            a.deleted,
            "touchdt:",
            Rt.loopCount - a.touchTick,
            "ä½ç½®:",
            (a.uv[0] * he.atlasWidth) | 0,
            (a.uv[1] * he.atlasWidth) | 0,
            "å­—ç¬¦:",
            a.char,
            "key:",
            r,
          ),
            n++;
        }
      }),
        console.log("ç‹¬ç«‹è´´å›¾æ–‡å­—(" + this.isoTextures.length + "ä¸ª):"),
        this.isoTextures.forEach(function (t) {
          console.log(
            "    size:",
            t._texW,
            t._texH,
            "touché—´éš”:",
            Rt.loopCount - t.lastTouchTm,
            "char:",
            t.ri.char,
          );
        }),
        console.log("æ€»ç¼“å­˜:", n, "æ€»ä½¿ç”¨çŽ‡:", h, "æ€»å½“å‰å›¾é›†ä½¿ç”¨çŽ‡:", o);
    }
    showAtlas(t, e, s, r, a, n) {
      if (!this.textAtlases[t]) return console.log("æ²¡æœ‰è¿™ä¸ªå›¾é›†"), null;
      var h = new i.Sprite(),
        o = this.textAtlases[t].texture,
        l = {
          width: he.atlasWidth,
          height: he.atlasWidth,
          sourceWidth: he.atlasWidth,
          sourceHeight: he.atlasWidth,
          offsetX: 0,
          offsetY: 0,
          getIsReady: function () {
            return !0;
          },
          _addReference: function () {},
          _removeReference: function () {},
          _getSource: function () {
            return o._getSource();
          },
          bitmap: { id: o.id },
          _uv: Jt.DEF_UV,
        };
      return (
        (h.size = function (t, i) {
          return (
            (this.width = t),
            (this.height = i),
            h.graphics.clear(),
            h.graphics.drawRect(0, 0, h.width, h.height, e),
            h.graphics.drawTexture(l, 0, 0, h.width, h.height),
            this
          );
        }),
        h.graphics.drawRect(0, 0, a, n, e),
        h.graphics.drawTexture(l, 0, 0, a, n),
        h.pos(s, r),
        i.stage.addChild(h),
        h
      );
    }
    filltext_native(t, e, s, r, a, n, h, o, l, _, u = 0) {
      if (!((e &amp;&amp; e.length &lt;= 0) || (s &amp;&amp; s.length &lt; 1))) {
        var c = te.Parse(n),
          d = 0;
        switch (_) {
          case "center":
            d = i.Context.ENUM_TEXTALIGN_CENTER;
            break;
          case "right":
            d = i.Context.ENUM_TEXTALIGN_RIGHT;
        }
        return this._fast_filltext(t, e, s, r, a, c, h, o, l, d, u);
      }
    }
  }
  (he.useOldCharBook = !1),
    (he.atlasWidth = 1024),
    (he.noAtlas = !1),
    (he.forceSplitRender = !1),
    (he.forceWholeRender = !1),
    (he.scaleFontWithCtx = !0),
    (he.standardFontSize = 32),
    (he.destroyAtlasDt = 10),
    (he.checkCleanTextureDt = 2e3),
    (he.destroyUnusedTextureDt = 3e3),
    (he.cleanMem = 104857600),
    (he.isWan1Wan = !1),
    (he.showLog = !1),
    (he.debugUV = !1),
    (he.tmpRI = new ie()),
    (he.pixelBBX = [0, 0, 0, 0]),
    (he.imgdtRect = [0, 0, 0, 0]),
    (he.simClean = !1),
    (Zt.gTextRender = he);
  class oe {
    constructor() {
      if (
        ((this._tmpMatrix = new p()),
        (this._drawTexToDrawTri_Vert = new Float32Array(8)),
        (this._drawTexToDrawTri_Index = new Uint16Array([0, 1, 2, 0, 2, 3])),
        (this._tempUV = new Float32Array(8)),
        (this._drawTriUseAbsMatrix = !1),
        (this._id = ++oe._COUNT),
        (this._other = null),
        (this._renderNextSubmitIndex = 0),
        (this._path = null),
        (this._drawCount = 1),
        (this._width = oe._MAXSIZE),
        (this._height = oe._MAXSIZE),
        (this._renderCount = 0),
        (this._submits = null),
        (this._curSubmit = null),
        (this._submitKey = new Z()),
        (this._pathMesh = null),
        (this._triangleMesh = null),
        (this.meshlist = []),
        (this._transedPoints = new Array(8)),
        (this._temp4Points = new Array(8)),
        (this._clipRect = oe.MAXCLIPRECT),
        (this._globalClipMatrix = new p(oe._MAXSIZE, 0, 0, oe._MAXSIZE, 0, 0)),
        (this._clipInCache = !1),
        (this._clipInfoID = 0),
        (this._clipID_Gen = 0),
        (this._lastMatScaleX = 1),
        (this._lastMatScaleY = 1),
        (this._lastMat_a = 1),
        (this._lastMat_b = 0),
        (this._lastMat_c = 0),
        (this._lastMat_d = 1),
        (this._nBlendType = 0),
        (this._save = null),
        (this._targets = null),
        (this._charSubmitCache = null),
        (this._saveMark = null),
        (this._shader2D = new Ut()),
        (this.sprite = null),
        (this._italicDeg = 0),
        (this._lastTex = null),
        (this._fillColor = 0),
        (this._flushCnt = 0),
        (this.defTexture = null),
        (this._colorFiler = null),
        (this.drawTexAlign = !1),
        (this._incache = !1),
        (this.isMain = !1),
        oe._contextcount++,
        (oe._textRender = oe._textRender || new he()),
        !this.defTexture)
      ) {
        var t = new N(2, 2);
        t.setPixels(new Uint8Array(16)),
          (t.lock = !0),
          (this.defTexture = new Jt(t));
      }
      (this._lastTex = this.defTexture), this.clear();
    }
    static __init__() {
      (oe.MAXCLIPRECT = new m(0, 0, oe._MAXSIZE, oe._MAXSIZE)),
        (le.DEFAULT = new le());
    }
    drawImage(...t) {}
    getImageData(...t) {}
    measureText(t) {
      return null;
    }
    setTransform(...t) {}
    $transform(t, e, i, s, r, a) {}
    get lineJoin() {
      return "";
    }
    set lineJoin(t) {}
    get lineCap() {
      return "";
    }
    set lineCap(t) {}
    get miterLimit() {
      return "";
    }
    set miterLimit(t) {}
    clearRect(t, e, i, s) {}
    _drawRect(t, e, i, s, r) {
      H.renderBatches++,
        r &amp;&amp; (this.fillStyle = r),
        this.fillRect(t, e, i, s, null);
    }
    drawTexture2(t, e, i, s, r, a) {}
    transformByMatrix(t, e, i) {
      this.transform(t.a, t.b, t.c, t.d, t.tx + e, t.ty + i);
    }
    saveTransform(t) {
      this.save();
    }
    restoreTransform(t) {
      this.restore();
    }
    drawRect(t, e, i, s, r, a, n) {
      null != r &amp;&amp; ((this.fillStyle = r), this.fillRect(t, e, i, s)),
        null != a &amp;&amp;
          ((this.strokeStyle = a),
          (this.lineWidth = n),
          this.strokeRect(t, e, i, s));
    }
    alpha(t) {
      this.globalAlpha *= t;
    }
    _transform(t, e, i) {
      this.translate(e, i),
        this.transform(t.a, t.b, t.c, t.d, t.tx, t.ty),
        this.translate(-e, -i);
    }
    _rotate(t, e, i) {
      this.translate(e, i), this.rotate(t), this.translate(-e, -i);
    }
    _scale(t, e, i, s) {
      this.translate(i, s), this.scale(t, e), this.translate(-i, -s);
    }
    _drawLine(t, e, i, s, r, a, n, h, o) {
      this.beginPath(),
        (this.strokeStyle = n),
        (this.lineWidth = h),
        this.moveTo(t + i, e + s),
        this.lineTo(t + r, e + a),
        this.stroke();
    }
    _drawLines(t, e, i, s, r, a) {
      this.beginPath(),
        (this.strokeStyle = s),
        (this.lineWidth = r),
        this.addPath(i.slice(), !1, !1, t, e),
        this.stroke();
    }
    drawCurves(t, e, i, s, r) {
      this.beginPath(),
        (this.strokeStyle = s),
        (this.lineWidth = r),
        this.moveTo(t + i[0], e + i[1]);
      for (var a = 2, n = i.length; a &lt; n; )
        this.quadraticCurveTo(t + i[a++], e + i[a++], t + i[a++], e + i[a++]);
      this.stroke();
    }
    _fillAndStroke(t, e, i, s = !1) {
      null != t &amp;&amp; ((this.fillStyle = t), this.fill()),
        null != e &amp;&amp;
          i &gt; 0 &amp;&amp;
          ((this.strokeStyle = e), (this.lineWidth = i), this.stroke());
    }
    _drawCircle(t, e, i, s, r, a, n) {
      H.renderBatches++,
        this.beginPath(!0),
        this.arc(t, e, i, 0, oe.PI2),
        this.closePath(),
        this._fillAndStroke(s, r, a);
    }
    _drawPie(t, e, i, s, r, a, n, h, o) {
      this.beginPath(),
        this.moveTo(t, e),
        this.arc(t, e, i, s, r),
        this.closePath(),
        this._fillAndStroke(a, n, h);
    }
    _drawPoly(t, e, i, s, r, a, n, h) {
      this.beginPath(),
        this.addPath(i.slice(), !0, n, t, e),
        this.closePath(),
        this._fillAndStroke(s, r, a, n);
    }
    _drawPath(t, e, i, s, r) {
      this.beginPath();
      for (var a = 0, n = i.length; a &lt; n; a++) {
        var h = i[a];
        switch (h[0]) {
          case "moveTo":
            this.moveTo(t + h[1], e + h[2]);
            break;
          case "lineTo":
            this.lineTo(t + h[1], e + h[2]);
            break;
          case "arcTo":
            this.arcTo(t + h[1], e + h[2], t + h[3], e + h[4], h[5]);
            break;
          case "closePath":
            this.closePath();
        }
      }
      null != s &amp;&amp; ((this.fillStyle = s.fillStyle), this.fill()),
        null != r &amp;&amp;
          ((this.strokeStyle = r.strokeStyle),
          (this.lineWidth = r.lineWidth || 1),
          (this.lineJoin = r.lineJoin),
          (this.lineCap = r.lineCap),
          (this.miterLimit = r.miterLimit),
          this.stroke());
    }
    static set2DRenderConfig() {
      var t = g.instance;
      b.setBlend(t, !0),
        b.setBlendEquation(t, t.FUNC_ADD),
        (Y.activeBlendFunction = null),
        b.setBlendFunc(t, t.ONE, t.ONE_MINUS_SRC_ALPHA),
        b.setDepthTest(t, !1),
        b.setCullFace(t, !1),
        b.setDepthMask(t, !0),
        b.setFrontFace(t, t.CCW),
        t.viewport(0, 0, G.width, G.height),
        t.enable(t.SCISSOR_TEST),
        t.scissor(0, 0, G.width, G.height);
    }
    clearBG(t, e, i, s) {
      var r = b.mainContext;
      r.clearColor(t, e, i, s), r.clear(r.COLOR_BUFFER_BIT);
    }
    _getSubmits() {
      return this._submits;
    }
    _releaseMem(t = !1) {
      if (this._submits) {
        this._curMat &amp;&amp; this._curMat.destroy(),
          (this._curMat = null),
          this._shader2D.destroy(),
          (this._shader2D = null),
          this._charSubmitCache.clear();
        for (var e = 0, i = this._submits._length; e &lt; i; e++)
          this._submits[e].releaseRender();
        var s;
        for (
          this._submits.length = 0,
            this._submits._length = 0,
            this._submits = null,
            this._curSubmit = null,
            this._path = null,
            this._save = null,
            e = 0,
            s = this.meshlist.length;
          e &lt; s;
          e++
        ) {
          this.meshlist[e].destroy();
        }
        (this.meshlist.length = 0),
          (this.sprite = null),
          t ||
            (this._targets &amp;&amp; this._targets.destroy(), (this._targets = null));
      }
    }
    destroy(t = !1) {
      --oe._contextcount,
        (this.sprite = null),
        this._releaseMem(t),
        this._charSubmitCache &amp;&amp; this._charSubmitCache.destroy(),
        this._mesh.destroy(),
        t || (this._targets &amp;&amp; this._targets.destroy(), (this._targets = null));
    }
    clear() {
      this._submits ||
        ((this._other = le.DEFAULT),
        (this._curMat = p.create()),
        (this._charSubmitCache = new jt()),
        (this._mesh = wt.getAMesh(this.isMain)),
        this.meshlist.push(this._mesh),
        (this._pathMesh = It.getAMesh(this.isMain)),
        this.meshlist.push(this._pathMesh),
        (this._triangleMesh = Mt.getAMesh(this.isMain)),
        this.meshlist.push(this._triangleMesh),
        (this._submits = []),
        (this._save = [gt.Create(this)]),
        (this._save.length = 10),
        (this._shader2D = new Ut())),
        this._submitKey.clear(),
        this._mesh.clearVB(),
        (this._drawCount = 1),
        (this._other = le.DEFAULT),
        (this._other.lineWidth = this._shader2D.ALPHA = 1),
        (this._nBlendType = 0),
        (this._clipRect = oe.MAXCLIPRECT),
        (this._curSubmit = pt.RENDERBASE),
        (pt.RENDERBASE._ref = 16777215),
        (pt.RENDERBASE._numEle = 0),
        (this._shader2D.fillStyle = this._shader2D.strokeStyle = ut.DEFAULT);
      for (var t = 0, e = this._submits._length; t &lt; e; t++)
        this._submits[t].releaseRender();
      (this._submits._length = 0),
        this._curMat.identity(),
        this._other.clear(),
        (this._saveMark = this._save[0]),
        (this._save._length = 1);
    }
    size(e, i) {
      (this._width == e &amp;&amp; this._height == i) ||
        ((this._width = e),
        (this._height = i),
        this._targets &amp;&amp;
          (this._targets.destroy(),
          (this._targets = new k(e, i, t.RenderTextureFormat.R8G8B8A8, -1))),
        this.isMain &amp;&amp;
          (b.mainContext.viewport(0, 0, e, i), (G.width = e), (G.height = i))),
        0 === e &amp;&amp; 0 === i &amp;&amp; this._releaseMem();
    }
    set asBitmap(e) {
      if (e) {
        let e = this._targets;
        if (!this._width || !this._height) throw Error("asBitmap no size!");
        (e &amp;&amp; e.width == this._width &amp;&amp; e.height == this._height) ||
          (e &amp;&amp; e.destroy(),
          (this._targets = new k(
            this._width,
            this._height,
            t.RenderTextureFormat.R8G8B8A8,
            -1,
          )));
      } else this._targets &amp;&amp; this._targets.destroy(), (this._targets = null);
    }
    getMatScaleX() {
      return this._lastMat_a == this._curMat.a &amp;&amp;
        this._lastMat_b == this._curMat.b
        ? this._lastMatScaleX
        : ((this._lastMatScaleX = this._curMat.getScaleX()),
          (this._lastMat_a = this._curMat.a),
          (this._lastMat_b = this._curMat.b),
          this._lastMatScaleX);
    }
    getMatScaleY() {
      return this._lastMat_c == this._curMat.c &amp;&amp;
        this._lastMat_d == this._curMat.d
        ? this._lastMatScaleY
        : ((this._lastMatScaleY = this._curMat.getScaleY()),
          (this._lastMat_c = this._curMat.c),
          (this._lastMat_d = this._curMat.d),
          this._lastMatScaleY);
    }
    setFillColor(t) {
      this._fillColor = t;
    }
    getFillColor() {
      return this._fillColor;
    }
    set fillStyle(t) {
      this._shader2D.fillStyle.equal(t) ||
        (ft.save(this, ft.TYPE_FILESTYLE, this._shader2D, !1),
        (this._shader2D.fillStyle = ut.create(t)),
        (this._submitKey.other = -this._shader2D.fillStyle.toInt()));
    }
    get fillStyle() {
      return this._shader2D.fillStyle;
    }
    set globalAlpha(t) {
      (t = Math.floor(1e3 * t) / 1e3) != this._shader2D.ALPHA &amp;&amp;
        (ft.save(this, ft.TYPE_ALPHA, this._shader2D, !1),
        (this._shader2D.ALPHA = t));
    }
    get globalAlpha() {
      return this._shader2D.ALPHA;
    }
    set textAlign(t) {
      this._other.textAlign === t ||
        ((this._other = this._other.make()),
        ft.save(this, ft.TYPE_TEXTALIGN, this._other, !1),
        (this._other.textAlign = t));
    }
    get textAlign() {
      return this._other.textAlign;
    }
    set textBaseline(t) {
      this._other.textBaseline === t ||
        ((this._other = this._other.make()),
        ft.save(this, ft.TYPE_TEXTBASELINE, this._other, !1),
        (this._other.textBaseline = t));
    }
    get textBaseline() {
      return this._other.textBaseline;
    }
    set globalCompositeOperation(t) {
      var e = Y.TOINT[t];
      null == e ||
        this._nBlendType === e ||
        (ft.save(this, ft.TYPE_GLOBALCOMPOSITEOPERATION, this, !0),
        (this._curSubmit = pt.RENDERBASE),
        (this._nBlendType = e));
    }
    get globalCompositeOperation() {
      return Y.NAMES[this._nBlendType];
    }
    set strokeStyle(t) {
      this._shader2D.strokeStyle.equal(t) ||
        (ft.save(this, ft.TYPE_STROKESTYLE, this._shader2D, !1),
        (this._shader2D.strokeStyle = ut.create(t)),
        (this._submitKey.other = -this._shader2D.strokeStyle.toInt()));
    }
    get strokeStyle() {
      return this._shader2D.strokeStyle;
    }
    translate(t, e) {
      (0 === t &amp;&amp; 0 === e) ||
        (vt.save(this),
        this._curMat._bTransform
          ? (Tt.save(this),
            (this._curMat.tx += t * this._curMat.a + e * this._curMat.c),
            (this._curMat.ty += t * this._curMat.b + e * this._curMat.d))
          : ((this._curMat.tx = t), (this._curMat.ty = e)));
    }
    set lineWidth(t) {
      this._other.lineWidth === t ||
        ((this._other = this._other.make()),
        ft.save(this, ft.TYPE_LINEWIDTH, this._other, !1),
        (this._other.lineWidth = t));
    }
    get lineWidth() {
      return this._other.lineWidth;
    }
    save() {
      this._save[this._save._length++] = gt.Create(this);
    }
    restore() {
      var t = this._save._length,
        e = this._nBlendType;
      if (!(t &lt; 1)) {
        for (var i = t - 1; i &gt;= 0; i--) {
          var s = this._save[i];
          if ((s.restore(this), s.isSaveMark()))
            return void (this._save._length = i);
        }
        e != this._nBlendType &amp;&amp; (this._curSubmit = pt.RENDERBASE);
      }
    }
    set font(t) {
      (this._other = this._other.make()),
        ft.save(this, ft.TYPE_FONT, this._other, !1);
    }
    fillText(t, e, i, s, r, a, n = 0, h = "") {
      oe._textRender.filltext(this, t, e, i, s, r, h, n, a);
    }
    drawText(t, e, i, s, r, a) {
      oe._textRender.filltext(this, t, e, i, s, r, null, 0, a);
    }
    fillWords(t, e, i, s, r) {
      oe._textRender.fillWords(this, t, e, i, s, r, null, 0);
    }
    strokeWord(t, e, i, s, r, a, n) {
      oe._textRender.filltext(this, t, e, i, s, null, r, a, n);
    }
    fillBorderText(t, e, i, s, r, a, n, h) {
      oe._textRender.filltext(this, t, e, i, s, r, a, n, h);
    }
    fillBorderWords(t, e, i, s, r, a, n) {
      oe._textRender.fillWords(this, t, e, i, s, r, a, n);
    }
    _fast_filltext(t, e, i, s, r, a, n, h, o = 0) {
      oe._textRender._fast_filltext(this, t, null, e, i, s, r, a, n, h, o);
    }
    _fillRect(t, e, i, s, r) {
      var a = this._curSubmit,
        n =
          a &amp;&amp;
          a._key.submitType === pt.KEY_DRAWTEXTURE &amp;&amp;
          a._key.blendShader === this._nBlendType;
      this._mesh.vertNum + 4 &gt; oe._MAXVERTNUM &amp;&amp;
        ((this._mesh = wt.getAMesh(this.isMain)),
        this.meshlist.push(this._mesh),
        (n = !1)),
        n &amp;&amp; (n = n &amp;&amp; this.isSameClipInfo(a)),
        this.transformQuad(t, e, i, s, 0, this._curMat, this._transedPoints),
        this.clipedOff(this._transedPoints) ||
          (this._mesh.addQuad(this._transedPoints, Jt.NO_UV, r, !1),
          n ||
            ((a = this._curSubmit =
              Kt.create(this, this._mesh, q.create(X.TEXTURE2D, 0))),
            (this._submits[this._submits._length++] = a),
            this._copyClipInfo(a, this._globalClipMatrix),
            (a.shaderValue.textureHost = this._lastTex),
            (a._key.other =
              this._lastTex &amp;&amp; this._lastTex.bitmap
                ? this._lastTex.bitmap.id
                : -1),
            (a._renderType = pt.TYPE_TEXTURE)),
          (this._curSubmit._numEle += 6),
          (this._mesh.indexNum += 6),
          (this._mesh.vertNum += 4));
    }
    fillRect(t, e, i, s, r) {
      var a = r ? ut.create(r) : this._shader2D.fillStyle,
        n = this.mixRGBandAlpha(a.toInt());
      this._fillRect(t, e, i, s, n);
    }
    fillTexture(t, e, s, r, a, n, h, o) {
      t._getSource()
        ? this._fillTexture(
            t,
            t.width,
            t.height,
            t.uvrect,
            e,
            s,
            r,
            a,
            n,
            h.x,
            h.y,
          )
        : this.sprite &amp;&amp; i.systemTimer.callLater(this, this._repaintSprite);
    }
    _fillTexture(t, e, i, s, r, a, n, h, o, l, _) {
      var u = this._curSubmit;
      this._mesh.vertNum + 4 &gt; oe._MAXVERTNUM &amp;&amp;
        ((this._mesh = wt.getAMesh(this.isMain)),
        this.meshlist.push(this._mesh));
      var c = !0,
        d = !0;
      switch (o) {
        case "repeat":
          break;
        case "repeat-x":
          d = !1;
          break;
        case "repeat-y":
          c = !1;
          break;
        case "no-repeat":
          c = d = !1;
      }
      var p = this._temp4Points,
        f = 0,
        m = 0,
        g = 0,
        T = 0,
        v = 0,
        x = 0;
      if (
        (l &lt; 0 ? ((g = r), (f = (-l % e) / e)) : (g = r + l),
        _ &lt; 0 ? ((T = a), (m = (-_ % i) / i)) : (T = a + _),
        (v = r + n),
        (x = a + h),
        !c &amp;&amp; (v = Math.min(v, r + l + e)),
        !d &amp;&amp; (x = Math.min(x, a + _ + i)),
        !(v &lt; r || x &lt; a || g &gt; v || T &gt; x))
      ) {
        var y = (v - r - l) / e,
          E = (x - a - _) / i;
        if (
          (this.transformQuad(
            g,
            T,
            v - g,
            x - T,
            0,
            this._curMat,
            this._transedPoints,
          ),
          (p[0] = f),
          (p[1] = m),
          (p[2] = y),
          (p[3] = m),
          (p[4] = y),
          (p[5] = E),
          (p[6] = f),
          (p[7] = E),
          !this.clipedOff(this._transedPoints))
        ) {
          var R = this._mixRGBandAlpha(4294967295, this._shader2D.ALPHA);
          this._mesh.addQuad(this._transedPoints, p, R, !0);
          var C = q.create(X.TEXTURE2D, 0);
          C.defines.add(X.FILLTEXTURE),
            (C.u_TexRange = s.concat()),
            (u = this._curSubmit = Kt.create(this, this._mesh, C)),
            (this._submits[this._submits._length++] = u),
            this._copyClipInfo(u, this._globalClipMatrix),
            (u.shaderValue.textureHost = t),
            (u._renderType = pt.TYPE_TEXTURE),
            (this._curSubmit._numEle += 6),
            (this._mesh.indexNum += 6),
            (this._mesh.vertNum += 4);
        }
        this.breakNextMerge();
      }
    }
    setColorFilter(t) {
      ft.save(this, ft.TYPE_COLORFILTER, this, !0),
        (this._colorFiler = t),
        (this._curSubmit = pt.RENDERBASE);
    }
    drawTexture(t, e, i, s, r) {
      this._drawTextureM(t, e, i, s, r, null, 1, null);
    }
    drawTextures(t, e, s, r) {
      if (t._getSource())
        for (var a = e.length / 2, n = 0, h = t.bitmap.id, o = 0; o &lt; a; o++)
          this._inner_drawTexture(
            t,
            h,
            e[n++] + s,
            e[n++] + r,
            0,
            0,
            null,
            null,
            1,
            !1,
          );
      else this.sprite &amp;&amp; i.systemTimer.callLater(this, this._repaintSprite);
    }
    _drawTextureAddSubmit(t, e) {
      var i = null;
      (i = Kt.create(this, this._mesh, q.create(X.TEXTURE2D, 0))),
        (this._submits[this._submits._length++] = i),
        (i.shaderValue.textureHost = e),
        (i._key.other = t),
        (i._renderType = pt.TYPE_TEXTURE),
        (this._curSubmit = i);
    }
    _drawTextureM(t, e, i, s, r, a, n, h) {
      var o = this.sprite;
      return (
        !!t._getSource(function () {
          o &amp;&amp; o.repaint();
        }) &amp;&amp; this._inner_drawTexture(t, t.bitmap.id, e, i, s, r, a, h, n, !1)
      );
    }
    _drawRenderTexture(t, e, i, s, r, a, n, h) {
      return this._inner_drawTexture(t, -1, e, i, s, r, a, h, 1, !1);
    }
    submitDebugger() {
      this._submits[this._submits._length++] = Q.create(
        [],
        function () {},
        this,
      );
    }
    _copyClipInfo(t, e) {
      var i = t.shaderValue.clipMatDir;
      (i[0] = e.a), (i[1] = e.b), (i[2] = e.c), (i[3] = e.d);
      var s = t.shaderValue.clipMatPos;
      (s[0] = e.tx),
        (s[1] = e.ty),
        (t.clipInfoID = this._clipInfoID),
        this._clipInCache &amp;&amp; (t.shaderValue.clipOff[0] = 1);
    }
    isSameClipInfo(t) {
      return t.clipInfoID === this._clipInfoID;
    }
    _useNewTex2DSubmit(t, e) {
      this._mesh.vertNum + e &gt; oe._MAXVERTNUM &amp;&amp;
        ((this._mesh = wt.getAMesh(this.isMain)),
        this.meshlist.push(this._mesh));
      var i = Kt.create(this, this._mesh, q.create(X.TEXTURE2D, 0));
      (this._submits[this._submits._length++] = this._curSubmit = i),
        (i.shaderValue.textureHost = t),
        this._copyClipInfo(i, this._globalClipMatrix);
    }
    _drawTexRect(t, e, i, s, r) {
      this.transformQuad(
        t,
        e,
        i,
        s,
        this._italicDeg,
        this._curMat,
        this._transedPoints,
      );
      var a = this._transedPoints;
      (a[0] = (a[0] + 0.5) | 0),
        (a[1] = (a[1] + 0.5) | 0),
        (a[2] = (a[2] + 0.5) | 0),
        (a[3] = (a[3] + 0.5) | 0),
        (a[4] = (a[4] + 0.5) | 0),
        (a[5] = (a[5] + 0.5) | 0),
        (a[6] = (a[6] + 0.5) | 0),
        (a[7] = (a[7] + 0.5) | 0),
        this.clipedOff(this._transedPoints) ||
          (this._mesh.addQuad(this._transedPoints, r, this._fillColor, !0),
          (this._curSubmit._numEle += 6),
          (this._mesh.indexNum += 6),
          (this._mesh.vertNum += 4));
    }
    drawCallOptimize(t) {
      return this._charSubmitCache.enable(t, this), t;
    }
    _inner_drawTexture(t, e, i, s, r, a, n, h, o, l) {
      if (r &lt;= 0 || a &lt;= 0) return !1;
      var _ = this._curSubmit._key;
      if (
        ((h = h || t._uv), _.submitType === pt.KEY_TRIANGLES &amp;&amp; _.other === e)
      ) {
        var u = this._drawTexToDrawTri_Vert;
        (u[0] = i),
          (u[1] = s),
          (u[2] = i + r),
          (u[3] = s),
          (u[4] = i + r),
          (u[5] = s + a),
          (u[6] = i),
          (u[7] = s + a),
          (this._drawTriUseAbsMatrix = !0);
        var c = this._tempUV;
        return (
          (c[0] = h[0]),
          (c[1] = h[1]),
          (c[2] = h[2]),
          (c[3] = h[3]),
          (c[4] = h[4]),
          (c[5] = h[5]),
          (c[6] = h[6]),
          (c[7] = h[7]),
          this.drawTriangles(
            t,
            0,
            0,
            u,
            c,
            this._drawTexToDrawTri_Index,
            n || this._curMat,
            o,
            null,
            null,
          ),
          (this._drawTriUseAbsMatrix = !1),
          !0
        );
      }
      var d = this._mesh,
        p = this._curSubmit,
        f = l ? this._charSubmitCache.getPos() : this._transedPoints;
      if (
        (this.transformQuad(
          i,
          s,
          r || t.width,
          a || t.height,
          this._italicDeg,
          n || this._curMat,
          f,
        ),
        this.drawTexAlign)
      ) {
        var m = Math.round;
        (f[0] = m(f[0])),
          (f[1] = m(f[1])),
          (f[2] = m(f[2])),
          (f[3] = m(f[3])),
          (f[4] = m(f[4])),
          (f[5] = m(f[5])),
          (f[6] = m(f[6])),
          (f[7] = m(f[7])),
          (this.drawTexAlign = !1);
      }
      var g = this._mixRGBandAlpha(4294967295, this._shader2D.ALPHA * o);
      if (l) return this._charSubmitCache.add(this, t, e, f, h, g), !0;
      this._drawCount++;
      var T = e &gt;= 0 &amp;&amp; _.submitType === pt.KEY_DRAWTEXTURE &amp;&amp; _.other === e;
      return (
        T &amp;&amp; (T = T &amp;&amp; this.isSameClipInfo(p)),
        (this._lastTex = t),
        d.vertNum + 4 &gt; oe._MAXVERTNUM &amp;&amp;
          ((d = this._mesh = wt.getAMesh(this.isMain)),
          this.meshlist.push(d),
          (T = !1)),
        d.addQuad(f, h, g, !0),
        T ||
          ((this._submits[this._submits._length++] =
            this._curSubmit =
            p =
              Kt.create(this, d, q.create(X.TEXTURE2D, 0))),
          (p.shaderValue.textureHost = t),
          (p._key.other = e),
          this._copyClipInfo(p, this._globalClipMatrix)),
        (p._numEle += 6),
        (d.indexNum += 6),
        (d.vertNum += 4),
        !0
      );
    }
    transform4Points(t, e, i) {
      var s = e.tx,
        r = e.ty,
        a = e.a,
        n = e.b,
        h = e.c,
        o = e.d,
        l = t[0],
        _ = t[1],
        u = t[2],
        c = t[3],
        d = t[4],
        p = t[5],
        f = t[6],
        m = t[7];
      e._bTransform
        ? ((i[0] = l * a + _ * h + s),
          (i[1] = l * n + _ * o + r),
          (i[2] = u * a + c * h + s),
          (i[3] = u * n + c * o + r),
          (i[4] = d * a + p * h + s),
          (i[5] = d * n + p * o + r),
          (i[6] = f * a + m * h + s),
          (i[7] = f * n + m * o + r))
        : ((i[0] = l + s),
          (i[1] = _ + r),
          (i[2] = u + s),
          (i[3] = c + r),
          (i[4] = d + s),
          (i[5] = p + r),
          (i[6] = f + s),
          (i[7] = m + r));
    }
    clipedOff(t) {
      return this._clipRect.width &lt;= 0 || this._clipRect.height &lt;= 0;
    }
    transformQuad(t, e, i, s, r, a, n) {
      var h = 0;
      0 != r &amp;&amp; (h = Math.tan((r * Math.PI) / 180) * s);
      var o = t + i,
        l = e + s,
        _ = a.tx,
        u = a.ty,
        c = a.a,
        d = a.b,
        p = a.c,
        f = a.d,
        m = t + h,
        g = e,
        T = o + h,
        v = e,
        x = o,
        y = l,
        E = t,
        R = l;
      a._bTransform
        ? ((n[0] = m * c + g * p + _),
          (n[1] = m * d + g * f + u),
          (n[2] = T * c + v * p + _),
          (n[3] = T * d + v * f + u),
          (n[4] = x * c + y * p + _),
          (n[5] = x * d + y * f + u),
          (n[6] = E * c + R * p + _),
          (n[7] = E * d + R * f + u))
        : ((n[0] = m + _),
          (n[1] = g + u),
          (n[2] = T + _),
          (n[3] = v + u),
          (n[4] = x + _),
          (n[5] = y + u),
          (n[6] = E + _),
          (n[7] = R + u));
    }
    pushRT() {
      this.addRenderObject(Q.create(null, k.pushRT, this));
    }
    popRT() {
      this.addRenderObject(Q.create(null, k.popRT, this)),
        this.breakNextMerge();
    }
    useRT(t) {
      this.addRenderObject(
        Q.create(
          [t],
          function (t) {
            if (!t) throw "error useRT";
            t.start(), t.clear(0, 0, 0, 0);
          },
          this,
        ),
      ),
        this.breakNextMerge();
    }
    RTRestore(t) {
      this.addRenderObject(
        Q.create(
          [t],
          function (t) {
            t.restore();
          },
          this,
        ),
      ),
        this.breakNextMerge();
    }
    breakNextMerge() {
      this._curSubmit = pt.RENDERBASE;
    }
    _repaintSprite() {
      this.sprite &amp;&amp; this.sprite.repaint();
    }
    drawTextureWithTransform(t, e, i, s, r, a, n, h, o, l, _ = null, u) {
      var c,
        d = this._curMat;
      l &amp;&amp;
        ((c = this.globalCompositeOperation),
        (this.globalCompositeOperation = l));
      var f = this._colorFiler;
      if ((_ &amp;&amp; this.setColorFilter(_), !a))
        return (
          this._drawTextureM(t, e + n, i + h, s, r, d, o, u),
          l &amp;&amp; (this.globalCompositeOperation = c),
          void (_ &amp;&amp; this.setColorFilter(f))
        );
      var m = this._tmpMatrix;
      (m.a = a.a),
        (m.b = a.b),
        (m.c = a.c),
        (m.d = a.d),
        (m.tx = a.tx + n),
        (m.ty = a.ty + h),
        (m._bTransform = a._bTransform),
        a &amp;&amp; d._bTransform
          ? (p.mul(m, d, m), ((a = m)._bTransform = !0))
          : ((m.tx += d.tx), (m.ty += d.ty), (a = m)),
        this._drawTextureM(t, e, i, s, r, a, o, u),
        l &amp;&amp; (this.globalCompositeOperation = c),
        _ &amp;&amp; this.setColorFilter(f);
    }
    _flushToTarget(t, e) {
      G.worldScissorTest = !1;
      var s = g.instance;
      s.disable(s.SCISSOR_TEST);
      var r = G.worldAlpha,
        a = G.worldMatrix4,
        n = G.worldMatrix;
      (G.worldMatrix = p.EMPTY),
        G.restoreTempArray(),
        (G.worldMatrix4 = G.TEMPMAT4_ARRAY),
        (G.worldAlpha = 1),
        (U.activeShader = null),
        i.Browser.onIOS &amp;&amp; s.flush(),
        e.start(),
        t._submits._length &gt; 0 &amp;&amp; e.clear(0, 0, 0, 0),
        (t._curSubmit = pt.RENDERBASE),
        t.flush(),
        t.clear(),
        e.restore(),
        (t._curSubmit = pt.RENDERBASE),
        (U.activeShader = null),
        (G.worldAlpha = r),
        (G.worldMatrix4 = a),
        (G.worldMatrix = n);
    }
    drawCanvas(t, e, i, s, r) {
      if (t) {
        var a,
          n = t.context;
        if (n._targets)
          n._submits._length &gt; 0 &amp;&amp;
            ((a = Q.create([n, n._targets], this._flushToTarget, this)),
            (this._submits[this._submits._length++] = a)),
            this._drawRenderTexture(n._targets, e, i, s, r, null, 1, k.flipyuv),
            (this._curSubmit = pt.RENDERBASE);
        else {
          var h = t;
          h.touches &amp;&amp;
            h.touches.forEach(function (t) {
              t.touch();
            }),
            (a = Ht.create(t, this._shader2D.ALPHA, this._shader2D.filters)),
            (this._submits[this._submits._length++] = a),
            a._key.clear();
          var o = a._matrix;
          this._curMat.copyTo(o);
          var l = o.tx,
            _ = o.ty;
          (o.tx = o.ty = 0),
            o.transformPoint(f.TEMP.setTo(e, i)),
            o.translate(f.TEMP.x + l, f.TEMP.y + _),
            p.mul(h.invMat, o, o),
            (this._curSubmit = pt.RENDERBASE);
        }
      }
    }
    drawTarget(t, e, i, s, r, a, n, h = null, o = -1) {
      if (
        (this._drawCount++,
        this._mesh.vertNum + 4 &gt; oe._MAXVERTNUM &amp;&amp;
          ((this._mesh = wt.getAMesh(this.isMain)),
          this.meshlist.push(this._mesh)),
        this.transformQuad(
          e,
          i,
          s,
          r,
          0,
          a || this._curMat,
          this._transedPoints,
        ),
        !this.clipedOff(this._transedPoints))
      ) {
        this._mesh.addQuad(this._transedPoints, h || Jt.DEF_UV, 4294967295, !0);
        var l = (this._curSubmit = zt.create(this, this._mesh, n, t));
        return (
          (l.blendType = -1 == o ? this._nBlendType : o),
          this._copyClipInfo(l, this._globalClipMatrix),
          (l._numEle = 6),
          (this._mesh.indexNum += 6),
          (this._mesh.vertNum += 4),
          (this._submits[this._submits._length++] = l),
          (this._curSubmit = pt.RENDERBASE),
          !0
        );
      }
      return (this._curSubmit = pt.RENDERBASE), !1;
    }
    drawTriangles(t, e, s, r, a, n, h, o, l, _, u = 4294967295) {
      if (t._getSource()) {
        var c = null;
        _ &amp;&amp;
          ((c = this.globalCompositeOperation),
          (this.globalCompositeOperation = _)),
          this._drawCount++;
        var d = this._tmpMatrix,
          f = this._triangleMesh,
          m = null,
          g = !1;
        l &amp;&amp;
          ((m = this._colorFiler),
          (this._colorFiler = l),
          (this._curSubmit = pt.RENDERBASE),
          (g = m != l));
        var T = t.bitmap,
          v = this._curSubmit._key,
          x =
            v.submitType === pt.KEY_TRIANGLES &amp;&amp;
            v.other === T.id &amp;&amp;
            v.blendShader == this._nBlendType;
        if (
          (f.vertNum + r.length / 2 &gt; oe._MAXVERTNUM &amp;&amp;
            ((f = this._triangleMesh = Mt.getAMesh(this.isMain)),
            this.meshlist.push(f),
            (x = !1)),
          !x)
        ) {
          var y = (this._curSubmit = Kt.create(
            this,
            f,
            q.create(X.TEXTURE2D, 0),
          ));
          (y.shaderValue.textureHost = t),
            (y._renderType = pt.TYPE_TEXTURE),
            (y._key.submitType = pt.KEY_TRIANGLES),
            (y._key.other = T.id),
            this._copyClipInfo(y, this._globalClipMatrix),
            (this._submits[this._submits._length++] = y);
        }
        var E = this._mixRGBandAlpha(u, this._shader2D.ALPHA * o);
        this._drawTriUseAbsMatrix
          ? f.addData(r, a, n, h, E)
          : (h
              ? ((d.a = h.a),
                (d.b = h.b),
                (d.c = h.c),
                (d.d = h.d),
                (d.tx = h.tx + e),
                (d.ty = h.ty + s))
              : ((d.a = 1),
                (d.b = 0),
                (d.c = 0),
                (d.d = 1),
                (d.tx = e),
                (d.ty = s)),
            p.mul(d, this._curMat, d),
            f.addData(r, a, n, d || this._curMat, E)),
          (this._curSubmit._numEle += n.length),
          g &amp;&amp; ((this._colorFiler = m), (this._curSubmit = pt.RENDERBASE)),
          _ &amp;&amp; (this.globalCompositeOperation = c);
      } else this.sprite &amp;&amp; i.systemTimer.callLater(this, this._repaintSprite);
    }
    transform(t, e, i, s, r, a) {
      Tt.save(this),
        p.mul(p.TEMP.setTo(t, e, i, s, r, a), this._curMat, this._curMat),
        this._curMat._checkTransform();
    }
    _transformByMatrix(t, e, i) {
      t.setTranslate(e, i),
        p.mul(t, this._curMat, this._curMat),
        t.setTranslate(0, 0),
        (this._curMat._bTransform = !0);
    }
    setTransformByMatrix(t) {
      t.copyTo(this._curMat);
    }
    rotate(t) {
      Tt.save(this), this._curMat.rotateEx(t);
    }
    scale(t, e) {
      Tt.save(this), this._curMat.scaleEx(t, e);
    }
    clipRect(t, e, i, s) {
      mt.save(this),
        this._clipRect == oe.MAXCLIPRECT
          ? (this._clipRect = new m(t, e, i, s))
          : ((this._clipRect.width = i),
            (this._clipRect.height = s),
            (this._clipRect.x = t),
            (this._clipRect.y = e)),
        this._clipID_Gen++,
        (this._clipID_Gen %= 1e4),
        (this._clipInfoID = this._clipID_Gen);
      var r = this._globalClipMatrix,
        a = r.tx,
        n = r.ty,
        h = a + r.a,
        o = n + r.d;
      if (
        (this._clipRect.width &gt;= oe._MAXSIZE
          ? ((r.a = r.d = oe._MAXSIZE), (r.b = r.c = r.tx = r.ty = 0))
          : (this._curMat._bTransform
              ? ((r.tx =
                  this._clipRect.x * this._curMat.a +
                  this._clipRect.y * this._curMat.c +
                  this._curMat.tx),
                (r.ty =
                  this._clipRect.x * this._curMat.b +
                  this._clipRect.y * this._curMat.d +
                  this._curMat.ty),
                (r.a = this._clipRect.width * this._curMat.a),
                (r.b = this._clipRect.width * this._curMat.b),
                (r.c = this._clipRect.height * this._curMat.c),
                (r.d = this._clipRect.height * this._curMat.d))
              : ((r.tx = this._clipRect.x + this._curMat.tx),
                (r.ty = this._clipRect.y + this._curMat.ty),
                (r.a = this._clipRect.width),
                (r.b = r.c = 0),
                (r.d = this._clipRect.height)),
            this._incache &amp;&amp; (this._clipInCache = !0)),
        r.a &gt; 0 &amp;&amp; r.d &gt; 0)
      ) {
        var l = r.tx + r.a,
          _ = r.ty + r.d;
        l &lt;= a || _ &lt;= n || r.tx &gt;= h || r.ty &gt;= o
          ? ((r.a = -0.1), (r.d = -0.1))
          : (r.tx &lt; a &amp;&amp; ((r.a -= a - r.tx), (r.tx = a)),
            l &gt; h &amp;&amp; (r.a -= l - h),
            r.ty &lt; n &amp;&amp; ((r.d -= n - r.ty), (r.ty = n)),
            _ &gt; o &amp;&amp; (r.d -= _ - o),
            r.a &lt;= 0 &amp;&amp; (r.a = -0.1),
            r.d &lt;= 0 &amp;&amp; (r.d = -0.1));
      }
    }
    drawMesh(t, e, i, s, r, a, n, h, o = 0) {}
    addRenderObject(t) {
      this._submits[this._submits._length++] = t;
    }
    submitElement(t, e) {
      this.isMain;
      var i = this._submits,
        s = i._length;
      e &lt; 0 &amp;&amp; (e = i._length);
      for (var r = pt.RENDERBASE; t &lt; e; )
        (this._renderNextSubmitIndex = t + 1),
          i[t] !== pt.RENDERBASE
            ? ((pt.preRender = r), (t += (r = i[t]).renderSubmit()))
            : t++;
      return s;
    }
    flush() {
      this._clipID_Gen = 0;
      var t = this.submitElement(0, this._submits._length);
      this._path &amp;&amp; this._path.reset(),
        Gt.instance &amp;&amp; Gt.getInstance().reset(),
        (this._curSubmit = pt.RENDERBASE);
      for (var e = 0, i = this.meshlist.length; e &lt; i; e++) {
        var s = this.meshlist[e];
        s.canReuse ? s.releaseMesh() : s.destroy();
      }
      return (
        (this.meshlist.length = 0),
        (this._mesh = wt.getAMesh(this.isMain)),
        (this._pathMesh = It.getAMesh(this.isMain)),
        (this._triangleMesh = Mt.getAMesh(this.isMain)),
        this.meshlist.push(this._mesh, this._pathMesh, this._triangleMesh),
        this._flushCnt++,
        this._flushCnt % 60 == 0 &amp;&amp;
          this.isMain &amp;&amp;
          he.textRenderInst &amp;&amp;
          he.textRenderInst.GC(),
        t
      );
    }
    beginPath(t = !1) {
      this._getPath().beginPath(t);
    }
    closePath() {
      this._path.closePath();
    }
    addPath(t, e, i, s, r) {
      for (var a = 0, n = 0, h = t.length / 2; n &lt; h; n++) {
        var o = t[a] + s,
          l = t[a + 1] + r;
        (t[a] = o), (t[a + 1] = l), (a += 2);
      }
      this._getPath().push(t, i);
    }
    fill() {
      var t = this._curMat,
        e = this._getPath(),
        i = this._curSubmit,
        s =
          i._key.submitType === pt.KEY_VG &amp;&amp;
          i._key.blendShader === this._nBlendType;
      s &amp;&amp; (s = s &amp;&amp; this.isSameClipInfo(i)),
        s || (this._curSubmit = this.addVGSubmit(this._pathMesh));
      for (
        var r,
          a = this.mixRGBandAlpha(this.fillStyle.toInt()),
          n = 0,
          h = 0,
          o = e.paths.length;
        h &lt; o;
        h++
      ) {
        var l = e.paths[h],
          _ = l.path.length / 2;
        if (!(_ &lt; 3 || (3 == _ &amp;&amp; !l.convex))) {
          var u,
            c,
            d,
            p,
            f = l.path.concat(),
            m = 0;
          if (t._bTransform)
            for (m = 0; m &lt; _; m++)
              (c = (u = m &lt;&lt; 1) + 1),
                (d = f[u]),
                (p = f[c]),
                (f[u] = t.a * d + t.c * p + t.tx),
                (f[c] = t.b * d + t.d * p + t.ty);
          else
            for (m = 0; m &lt; _; m++)
              (c = (u = m &lt;&lt; 1) + 1),
                (d = f[u]),
                (p = f[c]),
                (f[u] = d + t.tx),
                (f[c] = p + t.ty);
          this._pathMesh.vertNum + _ &gt; oe._MAXVERTNUM &amp;&amp;
            ((this._curSubmit._numEle += n),
            (n = 0),
            (this._pathMesh = It.getAMesh(this.isMain)),
            (this._curSubmit = this.addVGSubmit(this._pathMesh)));
          var g = this._pathMesh.vertNum;
          if (l.convex) {
            var T = _ - 2;
            r = new Array(3 * T);
            for (var v = 0, x = 0; x &lt; T; x++)
              (r[v++] = g), (r[v++] = x + 1 + g), (r[v++] = x + 2 + g);
          } else if (((r = Yt.earcut(f, null, 2)), g &gt; 0))
            for (var y = 0; y &lt; r.length; y++) r[y] += g;
          this._pathMesh.addVertAndIBToMesh(this, f, a, r), (n += r.length);
        }
      }
      this._curSubmit._numEle += n;
    }
    addVGSubmit(t) {
      var e = Xt.createShape(this, t, 0, q.create(X.PRIMITIVE, 0));
      return (
        (e._key.submitType = pt.KEY_VG),
        (this._submits[this._submits._length++] = e),
        this._copyClipInfo(e, this._globalClipMatrix),
        e
      );
    }
    stroke() {
      if (this.lineWidth &gt; 0) {
        var t = this.mixRGBandAlpha(this.strokeStyle._color.numColor),
          e = this._getPath(),
          i = this._curSubmit,
          s =
            i._key.submitType === pt.KEY_VG &amp;&amp;
            i._key.blendShader === this._nBlendType;
        s &amp;&amp; (s = s &amp;&amp; this.isSameClipInfo(i)),
          s || (this._curSubmit = this.addVGSubmit(this._pathMesh));
        for (var r = 0, a = 0, n = e.paths.length; a &lt; n; a++) {
          var h = e.paths[a];
          if (!(h.path.length &lt;= 0)) {
            var o = [],
              l = [],
              _ = 2 * h.path.length;
            if (!(_ &lt; 2)) {
              this._pathMesh.vertNum + _ &gt; oe._MAXVERTNUM &amp;&amp;
                ((this._curSubmit._numEle += r),
                (r = 0),
                (this._pathMesh = It.getAMesh(this.isMain)),
                this.meshlist.push(this._pathMesh),
                (this._curSubmit = this.addVGSubmit(this._pathMesh))),
                kt.createLine2(
                  h.path,
                  o,
                  this.lineWidth,
                  this._pathMesh.vertNum,
                  l,
                  h.loop,
                );
              var u,
                c,
                d,
                p,
                f = l.length / 2,
                m = this._curMat,
                g = 0;
              if (m._bTransform)
                for (g = 0; g &lt; f; g++)
                  (c = (u = g &lt;&lt; 1) + 1),
                    (d = l[u]),
                    (p = l[c]),
                    (l[u] = m.a * d + m.c * p + m.tx),
                    (l[c] = m.b * d + m.d * p + m.ty);
              else
                for (g = 0; g &lt; f; g++)
                  (c = (u = g &lt;&lt; 1) + 1),
                    (d = l[u]),
                    (p = l[c]),
                    (l[u] = d + m.tx),
                    (l[c] = p + m.ty);
              this._pathMesh.addVertAndIBToMesh(this, l, t, o), (r += o.length);
            }
          }
        }
        this._curSubmit._numEle += r;
      }
    }
    moveTo(t, e) {
      var i = this._getPath();
      i.newPath(), (i._lastOriX = t), (i._lastOriY = e), i.addPoint(t, e);
    }
    lineTo(t, e) {
      var i = this._getPath();
      (Math.abs(t - i._lastOriX) &lt; 0.001 &amp;&amp;
        Math.abs(e - i._lastOriY) &lt; 0.001) ||
        ((i._lastOriX = t), (i._lastOriY = e), i.addPoint(t, e));
    }
    arcTo(t, e, i, s, r) {
      var a = 0,
        n = 0,
        h = 0,
        o = this._path._lastOriX - t,
        l = this._path._lastOriY - e,
        _ = Math.sqrt(o * o + l * l);
      if (!(_ &lt;= 1e-6)) {
        var u = o / _,
          c = l / _,
          d = i - t,
          p = s - e,
          f = d * d + p * p,
          m = Math.sqrt(f);
        if (!(m &lt;= 1e-6)) {
          var g = d / m,
            T = p / m,
            v = u + g,
            x = c + T,
            y = Math.sqrt(v * v + x * x);
          if (!(y &lt;= 1e-6)) {
            var E = v / y,
              R = x / y,
              C = Math.acos(E * u + R * c),
              A = Math.PI / 2 - C,
              b = (_ = r / Math.tan(A)) * u + t,
              S = _ * c + e,
              w = Math.sqrt(_ * _ + r * r),
              M = t + E * w,
              I = e + R * w,
              P = 0,
              L = 0;
            if (u * T - c * g &gt;= 0) {
              var D = (2 * A) / oe.SEGNUM;
              (P = Math.sin(D)), (L = Math.cos(D));
            } else
              (D = (2 * -A) / oe.SEGNUM), (P = Math.sin(D)), (L = Math.cos(D));
            var B = this._path._lastOriX,
              F = this._path._lastOriY,
              O = b,
              N = S;
            (Math.abs(O - this._path._lastOriX) &gt; 0.1 ||
              Math.abs(N - this._path._lastOriY) &gt; 0.1) &amp;&amp;
              ((n = O),
              (h = N),
              (B = O),
              (F = N),
              (this._path._lastOriX = n),
              (this._path._lastOriY = h),
              this._path.addPoint(n, h));
            var U = b - M,
              G = S - I;
            for (a = 0; a &lt; oe.SEGNUM; a++) {
              var k = U * L + G * P,
                W = -U * P + G * L;
              (n = k + M),
                (h = W + I),
                (Math.abs(B - n) &gt; 0.1 || Math.abs(F - h) &gt; 0.1) &amp;&amp;
                  ((this._path._lastOriX = n),
                  (this._path._lastOriY = h),
                  this._path.addPoint(n, h),
                  (B = n),
                  (F = h)),
                (U = k),
                (G = W);
            }
          }
        }
      }
    }
    arc(t, e, i, s, r, a = !1, n = !0) {
      var h,
        o,
        l = 0,
        _ = 0,
        u = 0,
        c = 0,
        d = 0;
      if (((_ = r - s), a))
        if (Math.abs(_) &gt;= 2 * Math.PI) _ = 2 * -Math.PI;
        else for (; _ &gt; 0; ) _ -= 2 * Math.PI;
      else if (Math.abs(_) &gt;= 2 * Math.PI) _ = 2 * Math.PI;
      else for (; _ &lt; 0; ) _ += 2 * Math.PI;
      var p = this.getMatScaleX(),
        f = this.getMatScaleY(),
        m = i * (p &gt; f ? p : f),
        g = 2 * Math.PI * m;
      o = 0 | Math.max(g / 10, 10);
      var T = this._getPath();
      for (h = 0; h &lt;= o; h++)
        (l = s + _ * (h / o)),
          (u = Math.cos(l)),
          (d = e + Math.sin(l) * i),
          ((c = t + u * i) == this._path._lastOriX &amp;&amp;
            d == this._path._lastOriY) ||
            T.addPoint(c, d);
      (u = Math.cos(r)),
        (d = e + Math.sin(r) * i),
        ((c = t + u * i) == this._path._lastOriX &amp;&amp;
          d == this._path._lastOriY) ||
          T.addPoint(c, d);
    }
    quadraticCurveTo(t, e, i, s) {
      for (
        var r = lt.I.getBezierPoints(
            [this._path._lastOriX, this._path._lastOriY, t, e, i, s],
            30,
            2,
          ),
          a = 0,
          n = r.length / 2;
        a &lt; n;
        a++
      )
        this.lineTo(r[2 * a], r[2 * a + 1]);
      this.lineTo(i, s);
    }
    mixRGBandAlpha(t) {
      return this._mixRGBandAlpha(t, this._shader2D.ALPHA);
    }
    _mixRGBandAlpha(t, e) {
      if (e &gt;= 1) return t;
      var i = (4278190080 &amp; t) &gt;&gt;&gt; 24;
      return 0 != i ? (i *= e) : (i = 255 * e), (16777215 &amp; t) | (i &lt;&lt; 24);
    }
    strokeRect(t, e, i, s, r) {
      if (this.lineWidth &gt; 0) {
        var a = this.mixRGBandAlpha(this.strokeStyle._color.numColor),
          n = this.lineWidth / 2;
        this._fillRect(t - n, e - n, i + this.lineWidth, this.lineWidth, a),
          this._fillRect(
            t - n,
            e - n + s,
            i + this.lineWidth,
            this.lineWidth,
            a,
          ),
          this._fillRect(t - n, e + n, this.lineWidth, s - this.lineWidth, a),
          this._fillRect(
            t - n + i,
            e + n,
            this.lineWidth,
            s - this.lineWidth,
            a,
          );
      }
    }
    clip() {}
    drawParticle(t, e, i) {
      (i.x = t), (i.y = e), (this._submits[this._submits._length++] = i);
    }
    _getPath() {
      return this._path || (this._path = new ct());
    }
    get canvas() {
      return this._canvas;
    }
    _fillTexture_h(t, e, i, s, r, a, n, h) {
      s &lt;= 0 &amp;&amp; console.error("_fillTexture_h error: oriw must&gt;0");
      for (var o = a, l = Math.floor(h / s), _ = h % s, u = 0; u &lt; l; u++)
        this._inner_drawTexture(t, e, o, n, s, r, this._curMat, i, 1, !1),
          (o += s);
      if (_ &gt; 0) {
        var c = i[2] - i[0],
          d = i[0] + c * (_ / s),
          p = oe.tmpuv1;
        (p[0] = i[0]),
          (p[1] = i[1]),
          (p[2] = d),
          (p[3] = i[3]),
          (p[4] = d),
          (p[5] = i[5]),
          (p[6] = i[6]),
          (p[7] = i[7]),
          this._inner_drawTexture(t, e, o, n, _, r, this._curMat, p, 1, !1);
      }
    }
    _fillTexture_v(t, e, i, s, r, a, n, h) {
      r &lt;= 0 &amp;&amp; console.error("_fillTexture_v error: orih must&gt;0");
      for (var o = n, l = Math.floor(h / r), _ = h % r, u = 0; u &lt; l; u++)
        this._inner_drawTexture(t, e, a, o, s, r, this._curMat, i, 1, !1),
          (o += r);
      if (_ &gt; 0) {
        var c = i[7] - i[1],
          d = i[1] + c * (_ / r),
          p = oe.tmpuv1;
        (p[0] = i[0]),
          (p[1] = i[1]),
          (p[2] = i[2]),
          (p[3] = i[3]),
          (p[4] = i[4]),
          (p[5] = d),
          (p[6] = i[6]),
          (p[7] = d),
          this._inner_drawTexture(t, e, a, o, s, _, this._curMat, p, 1, !1);
      }
    }
    drawTextureWithSizeGrid(t, e, i, s, r, a, n, h) {
      if (t._getSource()) {
        (e += n), (i += h);
        var o = t.uv,
          l = t.bitmap.width,
          _ = t.bitmap.height,
          u = t.sourceWidth,
          c = t.sourceHeight,
          d = a[0],
          p = a[3],
          f = a[1],
          m = a[2],
          g = a[4];
        s == u &amp;&amp; (p = f = 0), r == c &amp;&amp; (d = m = 0);
        var T = d / _,
          v = p / l,
          x = f / l,
          y = m / _,
          E = t.bitmap.id,
          R = this._curMat,
          C = this._tempUV,
          A = 1,
          b = 1;
        p + f &gt; s &amp;&amp; (A = s / (p + f)),
          d + m &gt; r &amp;&amp; (b = r / (d + m)),
          (p *= A),
          (f *= A),
          (d *= b),
          (m *= b);
        var S = o[0],
          w = o[1],
          M = o[4],
          I = o[5],
          P = S,
          L = w,
          D = M,
          B = I;
        if (
          (p &amp;&amp;
            d &amp;&amp;
            ((D = S + v),
            (B = w + T),
            (C[0] = S),
            (C[1] = w),
            (C[2] = D),
            (C[3] = w),
            (C[4] = D),
            (C[5] = B),
            (C[6] = S),
            (C[7] = B),
            this._inner_drawTexture(t, E, e, i, p, d, R, C, 1, !1)),
          f &amp;&amp;
            d &amp;&amp;
            ((P = M - x),
            (L = w),
            (D = M),
            (B = w + T),
            (C[0] = P),
            (C[1] = L),
            (C[2] = D),
            (C[3] = L),
            (C[4] = D),
            (C[5] = B),
            (C[6] = P),
            (C[7] = B),
            this._inner_drawTexture(t, E, s - f + e, 0 + i, f, d, R, C, 1, !1)),
          p &amp;&amp;
            m &amp;&amp;
            ((P = S),
            (L = I - y),
            (D = S + v),
            (B = I),
            (C[0] = P),
            (C[1] = L),
            (C[2] = D),
            (C[3] = L),
            (C[4] = D),
            (C[5] = B),
            (C[6] = P),
            (C[7] = B),
            this._inner_drawTexture(t, E, 0 + e, r - m + i, p, m, R, C, 1, !1)),
          f &amp;&amp;
            m &amp;&amp;
            ((P = M - x),
            (L = I - y),
            (D = M),
            (B = I),
            (C[0] = P),
            (C[1] = L),
            (C[2] = D),
            (C[3] = L),
            (C[4] = D),
            (C[5] = B),
            (C[6] = P),
            (C[7] = B),
            this._inner_drawTexture(
              t,
              E,
              s - f + e,
              r - m + i,
              f,
              m,
              R,
              C,
              1,
              !1,
            )),
          d &amp;&amp;
            ((P = S + v),
            (L = w),
            (D = M - x),
            (B = w + T),
            (C[0] = P),
            (C[1] = L),
            (C[2] = D),
            (C[3] = L),
            (C[4] = D),
            (C[5] = B),
            (C[6] = P),
            (C[7] = B),
            g
              ? this._fillTexture_h(
                  t,
                  E,
                  C,
                  t.width - p - f,
                  d,
                  p + e,
                  i,
                  s - p - f,
                )
              : this._inner_drawTexture(
                  t,
                  E,
                  p + e,
                  i,
                  s - p - f,
                  d,
                  R,
                  C,
                  1,
                  !1,
                )),
          m &amp;&amp;
            ((P = S + v),
            (L = I - y),
            (D = M - x),
            (B = I),
            (C[0] = P),
            (C[1] = L),
            (C[2] = D),
            (C[3] = L),
            (C[4] = D),
            (C[5] = B),
            (C[6] = P),
            (C[7] = B),
            g
              ? this._fillTexture_h(
                  t,
                  E,
                  C,
                  t.width - p - f,
                  m,
                  p + e,
                  r - m + i,
                  s - p - f,
                )
              : this._inner_drawTexture(
                  t,
                  E,
                  p + e,
                  r - m + i,
                  s - p - f,
                  m,
                  R,
                  C,
                  1,
                  !1,
                )),
          p &amp;&amp;
            ((P = S),
            (L = w + T),
            (D = S + v),
            (B = I - y),
            (C[0] = P),
            (C[1] = L),
            (C[2] = D),
            (C[3] = L),
            (C[4] = D),
            (C[5] = B),
            (C[6] = P),
            (C[7] = B),
            g
              ? this._fillTexture_v(
                  t,
                  E,
                  C,
                  p,
                  t.height - d - m,
                  e,
                  d + i,
                  r - d - m,
                )
              : this._inner_drawTexture(
                  t,
                  E,
                  e,
                  d + i,
                  p,
                  r - d - m,
                  R,
                  C,
                  1,
                  !1,
                )),
          f &amp;&amp;
            ((P = M - x),
            (L = w + T),
            (D = M),
            (B = I - y),
            (C[0] = P),
            (C[1] = L),
            (C[2] = D),
            (C[3] = L),
            (C[4] = D),
            (C[5] = B),
            (C[6] = P),
            (C[7] = B),
            g
              ? this._fillTexture_v(
                  t,
                  E,
                  C,
                  f,
                  t.height - d - m,
                  s - f + e,
                  d + i,
                  r - d - m,
                )
              : this._inner_drawTexture(
                  t,
                  E,
                  s - f + e,
                  d + i,
                  f,
                  r - d - m,
                  R,
                  C,
                  1,
                  !1,
                )),
          (P = S + v),
          (L = w + T),
          (D = M - x),
          (B = I - y),
          (C[0] = P),
          (C[1] = L),
          (C[2] = D),
          (C[3] = L),
          (C[4] = D),
          (C[5] = B),
          (C[6] = P),
          (C[7] = B),
          g)
        ) {
          var F = oe.tmpUVRect;
          (F[0] = P),
            (F[1] = L),
            (F[2] = D - P),
            (F[3] = B - L),
            this._fillTexture(
              t,
              t.width - p - f,
              t.height - d - m,
              F,
              p + e,
              d + i,
              s - p - f,
              r - d - m,
              "repeat",
              0,
              0,
            );
        } else
          this._inner_drawTexture(
            t,
            E,
            p + e,
            d + i,
            s - p - f,
            r - d - m,
            R,
            C,
            1,
            !1,
          );
      }
    }
  }
  (oe.ENUM_TEXTALIGN_DEFAULT = 0),
    (oe.ENUM_TEXTALIGN_CENTER = 1),
    (oe.ENUM_TEXTALIGN_RIGHT = 2),
    (oe._SUBMITVBSIZE = 32e3),
    (oe._MAXSIZE = 99999999),
    (oe._MAXVERTNUM = 65535),
    (oe.MAXCLIPRECT = null),
    (oe._COUNT = 0),
    (oe.SEGNUM = 32),
    (oe._contextcount = 0),
    (oe.PI2 = 2 * Math.PI),
    (oe._textRender = null),
    (oe.tmpuv1 = [0, 0, 0, 0, 0, 0, 0, 0]),
    (oe.tmpUV = [0, 0, 0, 0, 0, 0, 0, 0]),
    (oe.tmpUVRect = [0, 0, 0, 0]);
  class le {
    constructor() {
      this.lineWidth = 1;
    }
    clear() {
      (this.lineWidth = 1), (this.textAlign = this.textBaseline = null);
    }
    make() {
      return this === le.DEFAULT ? new le() : this;
    }
  }
  class _e {
    static _uint8ArraySlice() {
      for (
        var t = this.length, e = new Uint8Array(this.length), i = 0;
        i &lt; t;
        i++
      )
        e[i] = this[i];
      return e;
    }
    static _float32ArraySlice() {
      for (
        var t = this.length, e = new Float32Array(this.length), i = 0;
        i &lt; t;
        i++
      )
        e[i] = this[i];
      return e;
    }
    static _uint16ArraySlice(...t) {
      var e, i, s;
      if (0 === t.length)
        for (e = this.length, i = new Uint16Array(e), s = 0; s &lt; e; s++)
          i[s] = this[s];
      else if (2 === t.length) {
        var r = t[0],
          a = t[1];
        if (a &gt; r)
          for (e = a - r, i = new Uint16Array(e), s = r; s &lt; a; s++)
            i[s - r] = this[s];
        else i = new Uint16Array(0);
      }
      return i;
    }
    static _nativeRender_enable() {}
    static enable() {
      return !0;
    }
    static inner_enable() {
      return (
        Float32Array.prototype.slice ||
          (Float32Array.prototype.slice = _e._float32ArraySlice),
        Uint16Array.prototype.slice ||
          (Uint16Array.prototype.slice = _e._uint16ArraySlice),
        Uint8Array.prototype.slice ||
          (Uint8Array.prototype.slice = _e._uint8ArraySlice),
        !0
      );
    }
    static onStageResize(t, e) {
      null != b.mainContext &amp;&amp;
        (b.mainContext.viewport(0, 0, t, e), (G.width = t), (G.height = e));
    }
  }
  (_e._isWebGL2 = !1), (_e.isNativeRender_enable = !1);
  !(function () {
    var t = {};
    function synthesizeGLError(e, i) {
      var s;
      (t[e] = !0),
        void 0 !== i &amp;&amp;
          ((s = i),
          window.console &amp;&amp; window.console.error &amp;&amp; window.console.error(s));
    }
    var e = function WebGLVertexArrayObjectOES(t) {
      var e = t.gl;
      (this.ext = t),
        (this.isAlive = !0),
        (this.hasBeenBound = !1),
        (this.elementArrayBuffer = null),
        (this.attribs = new Array(t.maxVertexAttribs));
      for (var i = 0; i &lt; this.attribs.length; i++) {
        var s = new WebGLVertexArrayObjectOES.VertexAttrib(e);
        this.attribs[i] = s;
      }
      this.maxAttrib = 0;
    };
    (e.VertexAttrib = function (t) {
      (this.enabled = !1),
        (this.buffer = null),
        (this.size = 4),
        (this.type = t.FLOAT),
        (this.normalized = !1),
        (this.stride = 16),
        (this.offset = 0),
        (this.cached = ""),
        this.recache();
    }).prototype.recache = function () {
      this.cached = [
        this.size,
        this.type,
        this.normalized,
        this.stride,
        this.offset,
      ].join(":");
    };
    var i = function (e) {
      var i = this;
      (this.gl = e),
        (function (e) {
          var i = e.getError;
          e.getError = function () {
            var s;
            do {
              (s = i.apply(e)) != e.NO_ERROR &amp;&amp; (t[s] = !0);
            } while (s != e.NO_ERROR);
            for (var r in t) if (t[r]) return delete t[r], parseInt(r);
            return e.NO_ERROR;
          };
        })(e);
      var s = (this.original = {
        getParameter: e.getParameter,
        enableVertexAttribArray: e.enableVertexAttribArray,
        disableVertexAttribArray: e.disableVertexAttribArray,
        bindBuffer: e.bindBuffer,
        getVertexAttrib: e.getVertexAttrib,
        vertexAttribPointer: e.vertexAttribPointer,
      });
      (e.getParameter = function (t) {
        return t == i.VERTEX_ARRAY_BINDING_OES
          ? i.currentVertexArrayObject == i.defaultVertexArrayObject
            ? null
            : i.currentVertexArrayObject
          : s.getParameter.apply(this, arguments);
      }),
        (e.enableVertexAttribArray = function (t) {
          var e = i.currentVertexArrayObject;
          return (
            (e.maxAttrib = Math.max(e.maxAttrib, t)),
            (e.attribs[t].enabled = !0),
            s.enableVertexAttribArray.apply(this, arguments)
          );
        }),
        (e.disableVertexAttribArray = function (t) {
          var e = i.currentVertexArrayObject;
          return (
            (e.maxAttrib = Math.max(e.maxAttrib, t)),
            (e.attribs[t].enabled = !1),
            s.disableVertexAttribArray.apply(this, arguments)
          );
        }),
        (e.bindBuffer = function (t, r) {
          switch (t) {
            case e.ARRAY_BUFFER:
              i.currentArrayBuffer = r;
              break;
            case e.ELEMENT_ARRAY_BUFFER:
              i.currentVertexArrayObject.elementArrayBuffer = r;
          }
          return s.bindBuffer.apply(this, arguments);
        }),
        (e.getVertexAttrib = function (t, r) {
          var a = i.currentVertexArrayObject.attribs[t];
          switch (r) {
            case e.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:
              return a.buffer;
            case e.VERTEX_ATTRIB_ARRAY_ENABLED:
              return a.enabled;
            case e.VERTEX_ATTRIB_ARRAY_SIZE:
              return a.size;
            case e.VERTEX_ATTRIB_ARRAY_STRIDE:
              return a.stride;
            case e.VERTEX_ATTRIB_ARRAY_TYPE:
              return a.type;
            case e.VERTEX_ATTRIB_ARRAY_NORMALIZED:
              return a.normalized;
            default:
              return s.getVertexAttrib.apply(this, arguments);
          }
        }),
        (e.vertexAttribPointer = function (t, e, r, a, n, h) {
          var o = i.currentVertexArrayObject;
          o.maxAttrib = Math.max(o.maxAttrib, t);
          var l = o.attribs[t];
          return (
            (l.buffer = i.currentArrayBuffer),
            (l.size = e),
            (l.type = r),
            (l.normalized = a),
            (l.stride = n),
            (l.offset = h),
            l.recache(),
            s.vertexAttribPointer.apply(this, arguments)
          );
        }),
        e.instrumentExtension &amp;&amp;
          e.instrumentExtension(this, "OES_vertex_array_object"),
        e.canvas.addEventListener(
          "webglcontextrestored",
          function () {
            var t;
            (t = "OESVertexArrayObject emulation library context restored"),
              window.console &amp;&amp; window.console.log &amp;&amp; window.console.log(t),
              i.reset_();
          },
          !0,
        ),
        this.reset_();
    };
    (i.prototype.VERTEX_ARRAY_BINDING_OES = 34229),
      (i.prototype.reset_ = function () {
        if (void 0 !== this.vertexArrayObjects)
          for (var t = 0; t &lt; this.vertexArrayObjects.length; ++t)
            this.vertexArrayObjects.isAlive = !1;
        var i = this.gl;
        (this.maxVertexAttribs = i.getParameter(i.MAX_VERTEX_ATTRIBS)),
          (this.defaultVertexArrayObject = new e(this)),
          (this.currentVertexArrayObject = null),
          (this.currentArrayBuffer = null),
          (this.vertexArrayObjects = [this.defaultVertexArrayObject]),
          this.bindVertexArrayOES(null);
      }),
      (i.prototype.createVertexArrayOES = function () {
        var t = new e(this);
        return this.vertexArrayObjects.push(t), t;
      }),
      (i.prototype.deleteVertexArrayOES = function (t) {
        (t.isAlive = !1),
          this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(t), 1),
          this.currentVertexArrayObject == t &amp;&amp; this.bindVertexArrayOES(null);
      }),
      (i.prototype.isVertexArrayOES = function (t) {
        return !!(t &amp;&amp; t instanceof e &amp;&amp; t.hasBeenBound &amp;&amp; t.ext == this);
      }),
      (i.prototype.bindVertexArrayOES = function (t) {
        var e = this.gl;
        if (!t || t.isAlive) {
          var i = this.original,
            s = this.currentVertexArrayObject;
          (this.currentVertexArrayObject = t || this.defaultVertexArrayObject),
            (this.currentVertexArrayObject.hasBeenBound = !0);
          var r = this.currentVertexArrayObject;
          if (s != r) {
            (s &amp;&amp; r.elementArrayBuffer == s.elementArrayBuffer) ||
              i.bindBuffer.call(
                e,
                e.ELEMENT_ARRAY_BUFFER,
                r.elementArrayBuffer,
              );
            for (
              var a = this.currentArrayBuffer,
                n = Math.max(s ? s.maxAttrib : 0, r.maxAttrib),
                h = 0;
              h &lt;= n;
              h++
            ) {
              var o = r.attribs[h],
                l = s ? s.attribs[h] : null;
              if (
                ((s &amp;&amp; o.enabled == l.enabled) ||
                  (o.enabled
                    ? i.enableVertexAttribArray.call(e, h)
                    : i.disableVertexAttribArray.call(e, h)),
                o.enabled)
              ) {
                var _ = !1;
                (s &amp;&amp; o.buffer == l.buffer) ||
                  (a != o.buffer &amp;&amp;
                    (i.bindBuffer.call(e, e.ARRAY_BUFFER, o.buffer),
                    (a = o.buffer)),
                  (_ = !0)),
                  (_ || o.cached != l.cached) &amp;&amp;
                    i.vertexAttribPointer.call(
                      e,
                      h,
                      o.size,
                      o.type,
                      o.normalized,
                      o.stride,
                      o.offset,
                    );
              }
            }
            this.currentArrayBuffer != a &amp;&amp;
              i.bindBuffer.call(e, e.ARRAY_BUFFER, this.currentArrayBuffer);
          }
        } else
          synthesizeGLError(
            e.INVALID_OPERATION,
            "bindVertexArrayOES: attempt to bind deleted arrayObject",
          );
      }),
      (window._setupVertexArrayObject = function (t) {
        var e = t.getSupportedExtensions;
        t.getSupportedExtensions = function () {
          var t = e.call(this) || [];
          return (
            t.indexOf("OES_vertex_array_object") &lt; 0 &amp;&amp;
              t.push("OES_vertex_array_object"),
            t
          );
        };
        var s = t.getExtension;
        t.getExtension = function (t) {
          var e = s.call(this, t);
          return (
            e ||
            ("OES_vertex_array_object" !== t
              ? null
              : (this.__OESVertexArrayObject ||
                  (console.log("Setup OES_vertex_array_object polyfill"),
                  (this.__OESVertexArrayObject = new i(this))),
                this.__OESVertexArrayObject))
          );
        };
      });
  })();
  class ue {
    constructor(t, e) {
      (this._gl = null),
        (this._vaoExt = null),
        (this._angleInstancedArrays = null),
        (this._isWebGL2 = !1),
        (this._oesTextureHalfFloat = null),
        (this._oes_element_index_uint = null),
        (this._oesTextureHalfFloatLinear = null),
        (this._oesTextureFloat = null),
        (this._extShaderTextureLod = null),
        (this._extTextureFilterAnisotropic = null),
        (this._compressedTextureS3tc = null),
        (this._compressedTexturePvrtc = null),
        (this._compressedTextureEtc1 = null),
        (this._compressedTextureETC = null),
        (this._compressedTextureASTC = null),
        (this._webgl_depth_texture = null),
        (this._extColorBufferFloat = null),
        (this._gl = t),
        (this._isWebGL2 = e);
      var s = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
        r = t.getParameter(t.MAX_TEXTURE_SIZE);
      e
        ? ((this._extColorBufferFloat = this._getExtension(
            "EXT_color_buffer_float",
          )),
          (F._shaderCapailityLevel = 35))
        : (i.Render.isConchApp ||
            (window._setupVertexArrayObject &amp;&amp;
              window._setupVertexArrayObject(t)),
          (this._vaoExt = this._getExtension("OES_vertex_array_object")),
          (this._angleInstancedArrays = this._getExtension(
            "ANGLE_instanced_arrays",
          )),
          (this._oesTextureHalfFloat = this._getExtension(
            "OES_texture_half_float",
          )),
          (this._oesTextureHalfFloatLinear = this._getExtension(
            "OES_texture_half_float_linear",
          )),
          (this._oesTextureFloat = this._getExtension("OES_texture_float")),
          (this._oes_element_index_uint = this._getExtension(
            "OES_element_index_uint",
          )),
          (this._extShaderTextureLod = this._getExtension(
            "EXT_shader_texture_lod",
          )),
          (this._webgl_depth_texture = this._getExtension(
            "WEBGL_depth_texture",
          )),
          (F._shaderCapailityLevel = 30)),
        (this._extTextureFilterAnisotropic = this._getExtension(
          "EXT_texture_filter_anisotropic",
        )),
        (this._compressedTextureS3tc = this._getExtension(
          "WEBGL_compressed_texture_s3tc",
        )),
        (this._compressedTexturePvrtc = this._getExtension(
          "WEBGL_compressed_texture_pvrtc",
        )),
        (this._compressedTextureEtc1 = this._getExtension(
          "WEBGL_compressed_texture_etc1",
        )),
        (this._compressedTextureETC = this._getExtension(
          "WEBGL_compressed_texture_etc",
        )),
        (this._compressedTextureASTC = this._getExtension(
          "WEBGL_compressed_texture_astc",
        )),
        (F._maxTextureCount = s),
        (F._maxTextureSize = r);
    }
    _getExtension(t) {
      var e = ue._extentionVendorPrefixes;
      for (var i in e) {
        var s = this._gl.getExtension(e[i] + t);
        if (s) return s;
      }
      return null;
    }
    createVertexArray() {
      return this._isWebGL2
        ? this._gl.createVertexArray()
        : this._vaoExt.createVertexArrayOES();
    }
    bindVertexArray(t) {
      this._isWebGL2
        ? this._gl.bindVertexArray(t)
        : this._vaoExt.bindVertexArrayOES(t);
    }
    deleteVertexArray(t) {
      this._isWebGL2
        ? this._gl.deleteVertexArray(t)
        : this._vaoExt.deleteVertexArrayOES(t);
    }
    isVertexArray(t) {
      this._isWebGL2
        ? this._gl.isVertexArray(t)
        : this._vaoExt.isVertexArrayOES(t);
    }
    drawElementsInstanced(t, e, i, s, r) {
      this._isWebGL2
        ? this._gl.drawElementsInstanced(t, e, i, s, r)
        : this._angleInstancedArrays.drawElementsInstancedANGLE(t, e, i, s, r);
    }
    drawArraysInstanced(t, e, i, s) {
      this._isWebGL2
        ? this._gl.drawArraysInstanced(t, e, i, s)
        : this._angleInstancedArrays.drawArraysInstancedANGLE(t, e, i, s);
    }
    vertexAttribDivisor(t, e) {
      this._isWebGL2
        ? this._gl.vertexAttribDivisor(t, e)
        : this._angleInstancedArrays.vertexAttribDivisorANGLE(t, e);
    }
    supportInstance() {
      return !(
        (!this._isWebGL2 &amp;&amp; !this._angleInstancedArrays) ||
        !e.allowGPUInstanceDynamicBatch
      );
    }
    supportElementIndexUint32() {
      return !(!this._isWebGL2 &amp;&amp; !this._oes_element_index_uint);
    }
  }
  ue._extentionVendorPrefixes = ["", "WEBKIT_", "MOZ_"];
  class ce {
    constructor(t, e, s) {
      (this._timeId = 0), (ce._Render = this), (ce._mainCanvas = s);
      let r = ce._mainCanvas.source;
      (r.id = "layaCanvas"),
        (r.width = t),
        (r.height = e),
        ce.isConchApp &amp;&amp; document.body.appendChild(r),
        this.initRender(ce._mainCanvas, t, e),
        window.requestAnimationFrame(function loop(t) {
          i.stage._loop();
          ce._customRequestAnimationFrame &amp;&amp; ce._loopFunction
            ? ce._customRequestAnimationFrame(ce._loopFunction)
            : window.requestAnimationFrame(loop);
        }),
        i.stage.on("visibilitychange", this, this._onVisibilitychange);
    }
    static customRequestAnimationFrame(t, e) {
      (ce._customRequestAnimationFrame = t), (ce._loopFunction = e);
    }
    _onVisibilitychange() {
      i.stage.isVisibility
        ? 0 != this._timeId &amp;&amp; window.clearInterval(this._timeId)
        : (this._timeId = window.setInterval(this._enterFrame, 1e3));
    }
    initRender(t, i, s) {
      var r =
        (g.instance =
        b.mainContext =
          (function (t) {
            var i,
              s = [
                "webgl2",
                "webgl",
                "experimental-webgl",
                "webkit-3d",
                "moz-webgl",
              ];
            (e.useWebGL2 &amp;&amp; !re.onBDMiniGame) || s.shift();
            for (var r = 0; r &lt; s.length; r++) {
              try {
                i = t.getContext(s[r], {
                  stencil: e.isStencil,
                  alpha: e.isAlpha,
                  antialias: e.isAntialias,
                  premultipliedAlpha: e.premultipliedAlpha,
                  preserveDrawingBuffer: e.preserveDrawingBuffer,
                });
              } catch (t) {}
              if (i) return "webgl2" === s[r] &amp;&amp; (_e._isWebGL2 = !0), i;
            }
            return null;
          })(ce._mainCanvas.source));
      if ((e.printWebglOrder &amp;&amp; this._replaceWebglcall(r), !r)) return !1;
      (g.instance = r),
        (g.layaGPUInstance = new ue(r, _e._isWebGL2)),
        t.size(i, s),
        oe.__init__(),
        pt.__init__();
      var a = new oe();
      return (
        (a.isMain = !0),
        (ce._context = a),
        t._setContext(a),
        X.__init__(),
        q.__init__(),
        Ut.__init__(),
        Ct.__int__(r),
        Y._init_(r),
        !0
      );
    }
    _replaceWebglcall(t) {
      var e = {};
      for (const i in t)
        "function" == typeof t[i] &amp;&amp;
          "getError" != i &amp;&amp;
          "__SPECTOR_Origin_getError" != i &amp;&amp;
          "__proto__" != i &amp;&amp;
          ((e[i] = t[i]),
          (t[i] = function () {
            let s = [];
            for (let t = 0; t &lt; arguments.length; t++) s.push(arguments[t]);
            let r = e[i].apply(t, s);
            console.log(Rt.loopCount + ":gl." + i + ":" + s);
            let a = t.getError();
            return a &amp;&amp; console.log(a), r;
          }));
    }
    _enterFrame(t = null) {
      i.stage._loop();
    }
    static get context() {
      return ce._context;
    }
    static get canvas() {
      return ce._mainCanvas.source;
    }
  }
  (ce.supportWebGLPlusAnimation = !1),
    (ce.supportWebGLPlusRendering = !1),
    (ce.isConchApp = !1),
    (ce.isConchApp = null != window.conch),
    ce.isConchApp
      ? (ce.supportWebGLPlusRendering = !1)
      : null != window.qq &amp;&amp;
        null != window.qq.webglPlus &amp;&amp;
        (ce.supportWebGLPlusRendering = !1);
  class de {
    static create(t, e, i, r, a, n, h, o, l, _, u) {
      var c = s.getItemByClass("DrawTrianglesCmd", de);
      if (
        ((c.texture = t),
        (c.x = e),
        (c.y = i),
        (c.vertices = r),
        (c.uvs = a),
        (c.indices = n),
        (c.matrix = h),
        (c.alpha = o),
        l)
      ) {
        c.color = new et();
        var d = tt.create(l).arrColor;
        c.color.color(255 * d[0], 255 * d[1], 255 * d[2], 255 * d[3]);
      }
      return (c.blendMode = _), (c.colorNum = u), c;
    }
    recover() {
      (this.texture = null),
        (this.vertices = null),
        (this.uvs = null),
        (this.indices = null),
        (this.matrix = null),
        s.recover("DrawTrianglesCmd", this);
    }
    run(t, e, i) {
      t.drawTriangles(
        this.texture,
        this.x + e,
        this.y + i,
        this.vertices,
        this.uvs,
        this.indices,
        this.matrix,
        this.alpha,
        this.color,
        this.blendMode,
        this.colorNum,
      );
    }
    get cmdID() {
      return de.ID;
    }
  }
  de.ID = "DrawTriangles";
  class pe {
    constructor() {}
    static create(t, e, i, r, a, n) {
      var h = s.getItemByClass("Draw9GridTexture", pe);
      return (
        (h.texture = t),
        t._addReference(),
        (h.x = e),
        (h.y = i),
        (h.width = r),
        (h.height = a),
        (h.sizeGrid = n),
        h
      );
    }
    recover() {
      this.texture._removeReference(), s.recover("Draw9GridTexture", this);
    }
    run(t, e, i) {
      t.drawTextureWithSizeGrid(
        this.texture,
        this.x,
        this.y,
        this.width,
        this.height,
        this.sizeGrid,
        e,
        i,
      );
    }
    get cmdID() {
      return pe.ID;
    }
  }
  pe.ID = "Draw9GridTexture";
  class fe {
    static create() {
      return s.getItemByClass("SaveCmd", fe);
    }
    recover() {
      s.recover("SaveCmd", this);
    }
    run(t, e, i) {
      t.save();
    }
    get cmdID() {
      return fe.ID;
    }
  }
  fe.ID = "Save";
  class me {
    constructor() {
      this._cacheBoundsType = !1;
    }
    destroy() {
      (this._graphics = null),
        (this._cacheBoundsType = !1),
        this._temp &amp;&amp; (this._temp.length = 0),
        this._rstBoundPoints &amp;&amp; (this._rstBoundPoints.length = 0),
        this._bounds &amp;&amp; this._bounds.recover(),
        (this._bounds = null),
        s.recover("GraphicsBounds", this);
    }
    static create() {
      return s.getItemByClass("GraphicsBounds", me);
    }
    reset() {
      this._temp &amp;&amp; (this._temp.length = 0);
    }
    getBounds(t = !1) {
      return (
        (!this._bounds ||
          !this._temp ||
          this._temp.length &lt; 1 ||
          t != this._cacheBoundsType) &amp;&amp;
          (this._bounds = m._getWrapRec(this.getBoundPoints(t), this._bounds)),
        (this._cacheBoundsType = t),
        this._bounds
      );
    }
    getBoundPoints(t = !1) {
      return (
        (!this._temp || this._temp.length &lt; 1 || t != this._cacheBoundsType) &amp;&amp;
          (this._temp = this._getCmdPoints(t)),
        (this._cacheBoundsType = t),
        (this._rstBoundPoints = J.copyArray(this._rstBoundPoints, this._temp))
      );
    }
    _getCmdPoints(t = !1) {
      var e,
        i = this._graphics.cmds;
      if (
        (((e = this._temp || (this._temp = [])).length = 0),
        i ||
          null == this._graphics._one ||
          ((me._tempCmds.length = 0),
          me._tempCmds.push(this._graphics._one),
          (i = me._tempCmds)),
        !i)
      )
        return e;
      var s = me._tempMatrixArrays;
      s.length = 0;
      var p = me._initMatrix;
      p.identity();
      for (var f, g, T = me._tempMatrix, v = 0, x = i.length; v &lt; x; v++)
        switch ((f = i[v]).cmdID) {
          case r.ID:
          case fe.ID:
            s.push(p), (p = p.clone());
            break;
          case rt.ID:
            p = s.pop();
            break;
          case nt.ID:
            T.identity(),
              T.translate(-f.pivotX, -f.pivotY),
              T.scale(f.scaleX, f.scaleY),
              T.translate(f.pivotX, f.pivotY),
              this._switchMatrix(p, T);
            break;
          case at.ID:
            T.identity(),
              T.translate(-f.pivotX, -f.pivotY),
              T.rotate(f.angle),
              T.translate(f.pivotX, f.pivotY),
              this._switchMatrix(p, T);
            break;
          case ot.ID:
            T.identity(), T.translate(f.tx, f.ty), this._switchMatrix(p, T);
            break;
          case ht.ID:
            T.identity(),
              T.translate(-f.pivotX, -f.pivotY),
              T.concat(f.matrix),
              T.translate(f.pivotX, f.pivotY),
              this._switchMatrix(p, T);
            break;
          case h.ID:
          case st.ID:
            me._addPointArrToRst(
              e,
              m._getBoundPointS(f.x, f.y, f.width, f.height),
              p,
            );
            break;
          case it.ID:
            p.copyTo(T),
              f.matrix &amp;&amp; T.concat(f.matrix),
              me._addPointArrToRst(
                e,
                m._getBoundPointS(f.x, f.y, f.width, f.height),
                T,
              );
            break;
          case h.ID:
            if (((g = f.texture), t))
              f.width &amp;&amp; f.height
                ? me._addPointArrToRst(
                    e,
                    m._getBoundPointS(f.x, f.y, f.width, f.height),
                    p,
                  )
                : me._addPointArrToRst(
                    e,
                    m._getBoundPointS(f.x, f.y, g.width, g.height),
                    p,
                  );
            else {
              var y = (f.width || g.sourceWidth) / g.width,
                E = (f.height || g.sourceHeight) / g.height,
                R = y * g.sourceWidth,
                C = E * g.sourceHeight,
                A = g.offsetX &gt; 0 ? g.offsetX : 0,
                b = g.offsetY &gt; 0 ? g.offsetY : 0;
              (A *= y),
                (b *= E),
                me._addPointArrToRst(
                  e,
                  m._getBoundPointS(f.x - A, f.y - b, R, C),
                  p,
                );
            }
            break;
          case st.ID:
            f.width &amp;&amp; f.height
              ? me._addPointArrToRst(
                  e,
                  m._getBoundPointS(f.x, f.y, f.width, f.height),
                  p,
                )
              : ((g = f.texture),
                me._addPointArrToRst(
                  e,
                  m._getBoundPointS(f.x, f.y, g.width, g.height),
                  p,
                ));
            break;
          case it.ID:
            var S;
            f.matrix ? (p.copyTo(T), T.concat(f.matrix), (S = T)) : (S = p),
              t
                ? f.width &amp;&amp; f.height
                  ? me._addPointArrToRst(
                      e,
                      m._getBoundPointS(f.x, f.y, f.width, f.height),
                      S,
                    )
                  : ((g = f.texture),
                    me._addPointArrToRst(
                      e,
                      m._getBoundPointS(f.x, f.y, g.width, g.height),
                      S,
                    ))
                : ((g = f.texture),
                  (y = (f.width || g.sourceWidth) / g.width),
                  (E = (f.height || g.sourceHeight) / g.height),
                  (R = y * g.sourceWidth),
                  (C = E * g.sourceHeight),
                  (A = g.offsetX &gt; 0 ? g.offsetX : 0),
                  (b = g.offsetY &gt; 0 ? g.offsetY : 0),
                  (A *= y),
                  (b *= E),
                  me._addPointArrToRst(
                    e,
                    m._getBoundPointS(f.x - A, f.y - b, R, C),
                    S,
                  ));
            break;
          case d.ID:
            me._addPointArrToRst(
              e,
              m._getBoundPointS(f.x, f.y, f.width, f.height),
              p,
            );
            break;
          case a.ID:
            me._addPointArrToRst(
              e,
              m._getBoundPointS(
                f.x - f.radius,
                f.y - f.radius,
                f.radius + f.radius,
                f.radius + f.radius,
              ),
              p,
            );
            break;
          case o.ID:
            var w;
            (me._tempPoints.length = 0),
              (w = 0.5 * f.lineWidth),
              f.fromX == f.toX
                ? me._tempPoints.push(
                    f.fromX + w,
                    f.fromY,
                    f.toX + w,
                    f.toY,
                    f.fromX - w,
                    f.fromY,
                    f.toX - w,
                    f.toY,
                  )
                : f.fromY == f.toY
                  ? me._tempPoints.push(
                      f.fromX,
                      f.fromY + w,
                      f.toX,
                      f.toY + w,
                      f.fromX,
                      f.fromY - w,
                      f.toX,
                      f.toY - w,
                    )
                  : me._tempPoints.push(f.fromX, f.fromY, f.toX, f.toY),
              me._addPointArrToRst(e, me._tempPoints, p);
            break;
          case n.ID:
            me._addPointArrToRst(
              e,
              lt.I.getBezierPoints(f.points),
              p,
              f.x,
              f.y,
            );
            break;
          case l.ID:
          case c.ID:
            me._addPointArrToRst(e, f.points, p, f.x, f.y);
            break;
          case _.ID:
            me._addPointArrToRst(e, this._getPathPoints(f.paths), p, f.x, f.y);
            break;
          case u.ID:
            me._addPointArrToRst(
              e,
              this._getPiePoints(f.x, f.y, f.radius, f.startAngle, f.endAngle),
              p,
            );
            break;
          case de.ID:
            me._addPointArrToRst(e, this._getTriAngBBXPoints(f.vertices), p);
            break;
          case pe.ID:
            me._addPointArrToRst(e, this._getDraw9GridBBXPoints(f), p);
        }
      return (
        e.length &gt; 200
          ? (e = J.copyArray(e, m._getWrapRec(e)._getBoundPoints()))
          : e.length &gt; 8 &amp;&amp; (e = _t.scanPList(e)),
        e
      );
    }
    _switchMatrix(t, e) {
      e.concat(t), e.copyTo(t);
    }
    static _addPointArrToRst(t, e, i, s = 0, r = 0) {
      var a, n;
      for (n = e.length, a = 0; a &lt; n; a += 2)
        me._addPointToRst(t, e[a] + s, e[a + 1] + r, i);
    }
    static _addPointToRst(t, e, i, s) {
      var r = f.TEMP;
      r.setTo(e || 0, i || 0), s.transformPoint(r), t.push(r.x, r.y);
    }
    _getPiePoints(t, e, i, s, r) {
      var a = me._tempPoints;
      me._tempPoints.length = 0;
      var n = Math.PI / 180,
        h = r - s;
      if (h &gt;= 360 || h &lt;= -360)
        return (
          a.push(t - i, e - i),
          a.push(t + i, e - i),
          a.push(t + i, e + i),
          a.push(t - i, e + i),
          a
        );
      a.push(t, e);
      var o = h % 360;
      o &lt; 0 &amp;&amp; (o += 360);
      var l = s + o,
        _ = s * n,
        u = l * n;
      a.push(t + i * Math.cos(_), e + i * Math.sin(_)),
        a.push(t + i * Math.cos(u), e + i * Math.sin(u));
      for (
        var c = 90 * Math.ceil(s / 90), d = 90 * Math.floor(l / 90), p = c;
        p &lt;= d;
        p += 90
      ) {
        var f = p * n;
        a.push(t + i * Math.cos(f), e + i * Math.sin(f));
      }
      return a;
    }
    _getTriAngBBXPoints(t) {
      var e = t.length;
      if (e &lt; 2) return [];
      for (var i = t[0], s = t[1], r = i, a = s, n = 2; n &lt; e; ) {
        var h = t[n++],
          o = t[n++];
        i &gt; h &amp;&amp; (i = h), s &gt; o &amp;&amp; (s = o), r &lt; h &amp;&amp; (r = h), a &lt; o &amp;&amp; (a = o);
      }
      return [i, s, r, s, r, a, i, a];
    }
    _getDraw9GridBBXPoints(t) {
      var e = t.width,
        i = t.height;
      return [0, 0, e, 0, e, i, 0, i];
    }
    _getPathPoints(t) {
      var e,
        i,
        s,
        r = me._tempPoints;
      for (r.length = 0, i = t.length, e = 0; e &lt; i; e++)
        (s = t[e]).length &gt; 1 &amp;&amp;
          (r.push(s[1], s[2]), s.length &gt; 3 &amp;&amp; r.push(s[3], s[4]));
      return r;
    }
  }
  (me._tempMatrix = new p()),
    (me._initMatrix = new p()),
    (me._tempPoints = []),
    (me._tempMatrixArrays = []),
    (me._tempCmds = []);
  class ge {}
  (ge.ALPHA = 1),
    (ge.TRANSFORM = 2),
    (ge.BLEND = 4),
    (ge.CANVAS = 8),
    (ge.FILTERS = 16),
    (ge.MASK = 32),
    (ge.CLIP = 64),
    (ge.STYLE = 128),
    (ge.TEXTURE = 256),
    (ge.GRAPHICS = 512),
    (ge.LAYAGL3D = 1024),
    (ge.CUSTOM = 2048),
    (ge.ONECHILD = 4096),
    (ge.CHILDS = 8192),
    (ge.REPAINT_NONE = 0),
    (ge.REPAINT_NODE = 1),
    (ge.REPAINT_CACHE = 2),
    (ge.REPAINT_ALL = 3);
  class Te {
    static create(t, e, i, r) {
      var a = s.getItemByClass("ClipRectCmd", Te);
      return (a.x = t), (a.y = e), (a.width = i), (a.height = r), a;
    }
    recover() {
      s.recover("ClipRectCmd", this);
    }
    run(t, e, i) {
      t.clipRect(this.x + e, this.y + i, this.width, this.height);
    }
    get cmdID() {
      return Te.ID;
    }
  }
  Te.ID = "ClipRect";
  class ve {
    static create(t, e) {
      var i = s.getItemByClass("DrawTexturesCmd", ve);
      return (i.texture = t), t._addReference(), (i.pos = e), i;
    }
    recover() {
      this.texture._removeReference(),
        (this.texture = null),
        (this.pos = null),
        s.recover("DrawTexturesCmd", this);
    }
    run(t, e, i) {
      t.drawTextures(this.texture, this.pos, e, i);
    }
    get cmdID() {
      return ve.ID;
    }
  }
  ve.ID = "DrawTextures";
  class xe {
    constructor() {
      (this._textIsWorldText = !1),
        (this._fontColor = 4294967295),
        (this._strokeColor = 0),
        (this._fontObj = xe._defFontObj),
        (this._nTexAlign = 0);
    }
    static create(t, e, i, r, a, n, h, o, l) {
      var _ = s.getItemByClass("FillTextCmd", xe);
      return (
        (_.text = t),
        (_._textIsWorldText = t instanceof ee),
        (_._words = e),
        (_.x = i),
        (_.y = r),
        (_.font = a),
        (_.color = n),
        (_.textAlign = h),
        (_._lineWidth = o),
        (_._borderColor = l),
        _
      );
    }
    recover() {
      s.recover("FillTextCmd", this);
    }
    run(t, e, s) {
      i.stage.isGlobalRepaint() &amp;&amp;
        this._textIsWorldText &amp;&amp;
        this._text.cleanCache(),
        this._words
          ? oe._textRender.fillWords(
              t,
              this._words,
              this.x + e,
              this.y + s,
              this._fontObj,
              this._color,
              this._borderColor,
              this._lineWidth,
            )
          : this._textIsWorldText
            ? t._fast_filltext(
                this._text,
                this.x + e,
                this.y + s,
                this._fontObj,
                this._color,
                this._borderColor,
                this._lineWidth,
                this._nTexAlign,
                0,
              )
            : oe._textRender.filltext(
                t,
                this._text,
                this.x + e,
                this.y + s,
                this.font,
                this.color,
                this._borderColor,
                this._lineWidth,
                this._textAlign,
              );
    }
    get cmdID() {
      return xe.ID;
    }
    get text() {
      return this._text;
    }
    set text(t) {
      (this._text = t),
        (this._textIsWorldText = t instanceof ee),
        this._textIsWorldText &amp;&amp; this._text.cleanCache();
    }
    get font() {
      return this._font;
    }
    set font(t) {
      (this._font = t),
        (this._fontObj = te.Parse(t)),
        this._textIsWorldText &amp;&amp; this._text.cleanCache();
    }
    get color() {
      return this._color;
    }
    set color(t) {
      (this._color = t),
        (this._fontColor = tt.create(t).numColor),
        this._textIsWorldText &amp;&amp; this._text.cleanCache();
    }
    get textAlign() {
      return this._textAlign;
    }
    set textAlign(t) {
      switch (((this._textAlign = t), t)) {
        case "center":
          this._nTexAlign = i.Context.ENUM_TEXTALIGN_CENTER;
          break;
        case "right":
          this._nTexAlign = i.Context.ENUM_TEXTALIGN_RIGHT;
          break;
        default:
          this._nTexAlign = i.Context.ENUM_TEXTALIGN_DEFAULT;
      }
      this._textIsWorldText &amp;&amp; this._text.cleanCache();
    }
  }
  (xe.ID = "FillText"), (xe._defFontObj = new te(null));
  class ye {
    constructor() {}
    static regCacheByFunction(t, e) {
      var i;
      ye.unRegCacheByFunction(t, e),
        (i = { tryDispose: t, getCacheList: e }),
        ye._cacheList.push(i);
    }
    static unRegCacheByFunction(t, e) {
      var i, s;
      for (s = ye._cacheList.length, i = 0; i &lt; s; i++)
        if (
          ye._cacheList[i].tryDispose == t &amp;&amp;
          ye._cacheList[i].getCacheList == e
        )
          return void ye._cacheList.splice(i, 1);
    }
    static forceDispose() {
      var t,
        e = ye._cacheList.length;
      for (t = 0; t &lt; e; t++) ye._cacheList[t].tryDispose(!0);
    }
    static beginCheck(t = 15e3) {
      i.systemTimer.loop(t, null, ye._checkLoop);
    }
    static stopCheck() {
      i.systemTimer.clear(null, ye._checkLoop);
    }
    static _checkLoop() {
      var t = ye._cacheList;
      if (!(t.length &lt; 1)) {
        var e,
          s,
          r = i.Browser.now();
        for (
          s = e = t.length;
          e &gt; 0 &amp;&amp;
          (ye._index++,
          (ye._index = ye._index % s),
          t[ye._index].tryDispose(!1),
          !(i.Browser.now() - r &gt; ye.loopTimeLimit));

        )
          e--;
      }
    }
  }
  (ye.loopTimeLimit = 2), (ye._cacheList = []), (ye._index = 0);
  class Ee {
    constructor() {
      (this.useDic = {}),
        (this.shapeDic = {}),
        (this.shapeLineDic = {}),
        (this._id = 0),
        (this._checkKey = !1),
        (this._freeIdArray = []),
        ye.regCacheByFunction(
          this.startDispose.bind(this),
          this.getCacheList.bind(this),
        );
    }
    static getInstance() {
      return (Ee.instance = Ee.instance || new Ee());
    }
    getId() {
      return this._id++;
    }
    addShape(t, e) {
      (this.shapeDic[t] = e), this.useDic[t] || (this.useDic[t] = !0);
    }
    addLine(t, e) {
      (this.shapeLineDic[t] = e),
        this.shapeLineDic[t] || (this.shapeLineDic[t] = !0);
    }
    getShape(t) {
      this._checkKey &amp;&amp; null != this.useDic[t] &amp;&amp; (this.useDic[t] = !0);
    }
    deleteShape(t) {
      this.shapeDic[t] &amp;&amp; ((this.shapeDic[t] = null), delete this.shapeDic[t]),
        this.shapeLineDic[t] &amp;&amp;
          ((this.shapeLineDic[t] = null), delete this.shapeLineDic[t]),
        null != this.useDic[t] &amp;&amp; delete this.useDic[t];
    }
    getCacheList() {
      var t,
        e = [];
      for (t in this.shapeDic) e.push(this.shapeDic[t]);
      for (t in this.shapeLineDic) e.push(this.shapeLineDic[t]);
      return e;
    }
    startDispose(t) {
      var e;
      for (e in this.useDic) this.useDic[e] = !1;
      this._checkKey = !0;
    }
    endDispose() {
      if (this._checkKey) {
        var t;
        for (t in this.useDic) this.useDic[t] || this.deleteShape(t);
        this._checkKey = !1;
      }
    }
  }
  class Re {
    constructor() {
      (this._sp = null),
        (this._one = null),
        (this._render = this._renderEmpty),
        (this._cmds = null),
        (this._vectorgraphArray = null),
        (this._graphicBounds = null),
        (this.autoDestroy = !1),
        this._createData();
    }
    _createData() {}
    _clearData() {}
    _destroyData() {}
    destroy() {
      this.clear(!0),
        this._graphicBounds &amp;&amp; this._graphicBounds.destroy(),
        (this._graphicBounds = null),
        (this._vectorgraphArray = null),
        this._sp &amp;&amp;
          ((this._sp._renderType = 0),
          this._sp._setRenderType(0),
          (this._sp = null)),
        this._destroyData();
    }
    clear(t = !0) {
      if (t) {
        var e = this._one;
        if (this._cmds) {
          var i,
            s = this._cmds.length;
          for (i = 0; i &lt; s; i++) (e = this._cmds[i]).recover();
          this._cmds = null;
        } else e &amp;&amp; e.recover();
      } else this._cmds = null;
      if (
        ((this._one = null),
        (this._render = this._renderEmpty),
        this._clearData(),
        this._sp &amp;&amp;
          ((this._sp._renderType &amp;= ~ge.GRAPHICS),
          this._sp._setRenderType(this._sp._renderType)),
        this._repaint(),
        this._vectorgraphArray)
      ) {
        for (i = 0, s = this._vectorgraphArray.length; i &lt; s; i++)
          Ee.getInstance().deleteShape(this._vectorgraphArray[i]);
        this._vectorgraphArray.length = 0;
      }
    }
    _clearBoundsCache() {
      this._graphicBounds &amp;&amp; this._graphicBounds.reset();
    }
    _initGraphicBounds() {
      this._graphicBounds ||
        ((this._graphicBounds = me.create()),
        (this._graphicBounds._graphics = this));
    }
    _repaint() {
      this._clearBoundsCache(), this._sp &amp;&amp; this._sp.repaint();
    }
    _isOnlyOne() {
      return !this._cmds || 0 === this._cmds.length;
    }
    get cmds() {
      return this._cmds;
    }
    set cmds(t) {
      this._sp &amp;&amp;
        ((this._sp._renderType |= ge.GRAPHICS),
        this._sp._setRenderType(this._sp._renderType)),
        (this._cmds = t),
        (this._render = this._renderAll),
        this._repaint();
    }
    getBounds(t = !1) {
      return this._initGraphicBounds(), this._graphicBounds.getBounds(t);
    }
    getBoundPoints(t = !1) {
      return this._initGraphicBounds(), this._graphicBounds.getBoundPoints(t);
    }
    drawImage(t, e = 0, i = 0, s = 0, r = 0) {
      if (!t) return null;
      if (
        (s || (s = t.sourceWidth), r || (r = t.sourceHeight), t.getIsReady())
      ) {
        var a = s / t.sourceWidth,
          n = r / t.sourceHeight;
        if (((s = t.width * a), (r = t.height * n), s &lt;= 0 || r &lt;= 0))
          return null;
        (e += t.offsetX * a), (i += t.offsetY * n);
      }
      this._sp &amp;&amp;
        ((this._sp._renderType |= ge.GRAPHICS),
        this._sp._setRenderType(this._sp._renderType));
      var o = h.create.call(this, t, e, i, s, r);
      return (
        null == this._one
          ? ((this._one = o), (this._render = this._renderOneImg))
          : this._saveToCmd(null, o),
        this._repaint(),
        o
      );
    }
    drawTexture(
      t,
      e = 0,
      i = 0,
      s = 0,
      r = 0,
      a = null,
      n = 1,
      h = null,
      o = null,
      l,
    ) {
      if (!t || n &lt; 0.01) return null;
      if (!t.getIsReady()) return null;
      if (
        (s || (s = t.sourceWidth), r || (r = t.sourceHeight), t.getIsReady())
      ) {
        var _ = s / t.sourceWidth,
          u = r / t.sourceHeight;
        if (((s = t.width * _), (r = t.height * u), s &lt;= 0 || r &lt;= 0))
          return null;
        (e += t.offsetX * _), (i += t.offsetY * u);
      }
      this._sp &amp;&amp;
        ((this._sp._renderType |= ge.GRAPHICS),
        this._sp._setRenderType(this._sp._renderType));
      var c = it.create.call(this, t, e, i, s, r, a, n, h, o, l);
      return this._repaint(), this._saveToCmd(null, c);
    }
    drawTextures(t, e) {
      return t
        ? this._saveToCmd(ce._context.drawTextures, ve.create.call(this, t, e))
        : null;
    }
    drawTriangles(
      t,
      e,
      i,
      s,
      r,
      a,
      n = null,
      h = 1,
      o = null,
      l = null,
      _ = 4294967295,
    ) {
      return this._saveToCmd(
        ce._context.drawTriangles,
        de.create.call(this, t, e, i, s, r, a, n, h, o, l, _),
      );
    }
    fillTexture(t, e, i, s = 0, r = 0, a = "repeat", n = null) {
      return t &amp;&amp; t.getIsReady()
        ? this._saveToCmd(
            ce._context._fillTexture,
            st.create.call(this, t, e, i, s, r, a, n || f.EMPTY, {}),
          )
        : null;
    }
    _saveToCmd(t, e) {
      return (
        this._sp &amp;&amp;
          ((this._sp._renderType |= ge.GRAPHICS),
          this._sp._setRenderType(this._sp._renderType)),
        null == this._one
          ? ((this._one = e), (this._render = this._renderOne))
          : ((this._render = this._renderAll),
            0 === (this._cmds || (this._cmds = [])).length &amp;&amp;
              this._cmds.push(this._one),
            this._cmds.push(e)),
        this._repaint(),
        e
      );
    }
    clipRect(t, e, i, s) {
      return this._saveToCmd(
        ce._context.clipRect,
        Te.create.call(this, t, e, i, s),
      );
    }
    fillText(t, e, s, r, a, n) {
      return this._saveToCmd(
        ce._context.fillText,
        xe.create.call(
          this,
          t,
          null,
          e,
          s,
          r || i.Text.defaultFontStr(),
          a,
          n,
          0,
          "",
        ),
      );
    }
    fillBorderText(t, e, s, r, a, n, h, o) {
      return this._saveToCmd(
        ce._context.fillText,
        xe.create.call(
          this,
          t,
          null,
          e,
          s,
          r || i.Text.defaultFontStr(),
          a,
          n,
          h,
          o,
        ),
      );
    }
    fillWords(t, e, s, r, a) {
      return this._saveToCmd(
        ce._context.fillText,
        xe.create.call(
          this,
          null,
          t,
          e,
          s,
          r || i.Text.defaultFontStr(),
          a,
          "",
          0,
          null,
        ),
      );
    }
    fillBorderWords(t, e, s, r, a, n, h) {
      return this._saveToCmd(
        ce._context.fillText,
        xe.create.call(
          this,
          null,
          t,
          e,
          s,
          r || i.Text.defaultFontStr(),
          a,
          "",
          h,
          n,
        ),
      );
    }
    strokeText(t, e, s, r, a, n, h) {
      return this._saveToCmd(
        ce._context.fillText,
        xe.create.call(
          this,
          t,
          null,
          e,
          s,
          r || i.Text.defaultFontStr(),
          null,
          h,
          n,
          a,
        ),
      );
    }
    alpha(t) {
      return this._saveToCmd(ce._context.alpha, r.create.call(this, t));
    }
    transform(t, e = 0, i = 0) {
      return this._saveToCmd(
        ce._context._transform,
        ht.create.call(this, t, e, i),
      );
    }
    rotate(t, e = 0, i = 0) {
      return this._saveToCmd(
        ce._context._rotate,
        at.create.call(this, t, e, i),
      );
    }
    scale(t, e, i = 0, s = 0) {
      return this._saveToCmd(
        ce._context._scale,
        nt.create.call(this, t, e, i, s),
      );
    }
    translate(t, e) {
      return this._saveToCmd(ce._context.translate, ot.create.call(this, t, e));
    }
    save() {
      return this._saveToCmd(ce._context._save, fe.create.call(this));
    }
    restore() {
      return this._saveToCmd(ce._context.restore, rt.create.call(this));
    }
    replaceText(t) {
      this._repaint();
      var e = this._cmds;
      if (e) {
        for (var i = e.length - 1; i &gt; -1; i--)
          if (this._isTextCmd(e[i])) return (e[i].text = t), !0;
      } else if (this._one &amp;&amp; this._isTextCmd(this._one))
        return (this._one.text = t), !0;
      return !1;
    }
    _isTextCmd(t) {
      return t.cmdID == xe.ID;
    }
    replaceTextColor(t) {
      this._repaint();
      var e = this._cmds;
      if (e)
        for (var i = e.length - 1; i &gt; -1; i--)
          this._isTextCmd(e[i]) &amp;&amp; this._setTextCmdColor(e[i], t);
      else
        this._one &amp;&amp;
          this._isTextCmd(this._one) &amp;&amp;
          this._setTextCmdColor(this._one, t);
    }
    _setTextCmdColor(t, e) {
      switch (t.cmdID) {
        case xe.ID:
          t.color = e;
      }
    }
    loadImage(t, e = 0, s = 0, r = 0, a = 0, n = null) {
      var h = i.Loader.getRes(t);
      h
        ? h.getIsReady()
          ? this.drawImage(h, e, s, r, a)
          : h.once($t.READY, this, this.drawImage, [h, e, s, r, a])
        : ((h = new Jt()).load(t),
          i.Loader.cacheTexture(t, h),
          h.once($t.READY, this, this.drawImage, [h, e, s, r, a])),
        null != n &amp;&amp;
          (h.getIsReady() ? n.call(this._sp) : h.on($t.READY, this._sp, n));
    }
    _renderEmpty(t, e, i, s) {}
    _renderAll(t, e, i, s) {
      for (var r = this._cmds, a = 0, n = r.length; a &lt; n; a++)
        r[a].run(e, i, s);
    }
    _renderOne(t, e, i, s) {
      (e.sprite = t), this._one.run(e, i, s);
    }
    _renderOneImg(t, e, i, s) {
      (e.sprite = t), this._one.run(e, i, s);
    }
    drawLine(t, e, i, s, r, a = 1) {
      var n = a &lt; 1 || a % 2 == 0 ? 0 : 0.5;
      return this._saveToCmd(
        ce._context._drawLine,
        o.create.call(this, t + n, e + n, i + n, s + n, r, a, 0),
      );
    }
    drawLines(t, e, i, s, r = 1) {
      if (!i || i.length &lt; 4) return null;
      var a = r &lt; 1 || r % 2 == 0 ? 0 : 0.5;
      return this._saveToCmd(
        ce._context._drawLines,
        l.create.call(this, t + a, e + a, i, s, r, 0),
      );
    }
    drawCurves(t, e, i, s, r = 1) {
      return this._saveToCmd(
        ce._context.drawCurves,
        n.create.call(this, t, e, i, s, r),
      );
    }
    drawRect(t, e, i, s, r, a = null, n = 1) {
      var h = n &gt;= 1 &amp;&amp; a ? n / 2 : 0,
        o = a ? n : 0;
      return this._saveToCmd(
        ce._context.drawRect,
        d.create.call(this, t + h, e + h, i - o, s - o, r, a, n),
      );
    }
    drawCircle(t, e, i, s, r = null, n = 1) {
      var h = n &gt;= 1 &amp;&amp; r ? n / 2 : 0;
      return this._saveToCmd(
        ce._context._drawCircle,
        a.create.call(this, t, e, i - h, s, r, n, 0),
      );
    }
    drawPie(t, e, i, s, r, a, n = null, h = 1) {
      var o = h &gt;= 1 &amp;&amp; n ? h / 2 : 0,
        l = n ? h : 0;
      return this._saveToCmd(
        ce._context._drawPie,
        u.create.call(
          this,
          t + o,
          e + o,
          i - l,
          J.toRadian(s),
          J.toRadian(r),
          a,
          n,
          h,
          0,
        ),
      );
    }
    drawPoly(t, e, i, s, r = null, a = 1) {
      var n = !1;
      n = !(i.length &gt; 6);
      var h = a &gt;= 1 &amp;&amp; r ? (a % 2 == 0 ? 0 : 0.5) : 0;
      return this._saveToCmd(
        ce._context._drawPoly,
        c.create.call(this, t + h, e + h, i, s, r, a, n, 0),
      );
    }
    drawPath(t, e, i, s = null, r = null) {
      return this._saveToCmd(
        ce._context._drawPath,
        _.create.call(this, t, e, i, s, r),
      );
    }
    draw9Grid(t, e = 0, i = 0, s = 0, r = 0, a) {
      this._saveToCmd(null, pe.create(t, e, i, s, r, a));
    }
  }
  class Ce {}
  (Ce.NOT_ACTIVE = 1),
    (Ce.ACTIVE_INHIERARCHY = 2),
    (Ce.AWAKED = 4),
    (Ce.NOT_READY = 8),
    (Ce.DISPLAY = 16),
    (Ce.HAS_ZORDER = 32),
    (Ce.HAS_MOUSE = 64),
    (Ce.DISPLAYED_INSTAGE = 128),
    (Ce.DRAWCALL_OPTIMIZE = 256);
  class Ae {
    static __init__() {
      (Ae.map[ge.ALPHA | ge.TRANSFORM | ge.GRAPHICS] =
        Ae.alpha_transform_drawLayaGL),
        (Ae.map[ge.ALPHA | ge.GRAPHICS] = Ae.alpha_drawLayaGL),
        (Ae.map[ge.TRANSFORM | ge.GRAPHICS] = Ae.transform_drawLayaGL),
        (Ae.map[ge.TRANSFORM | ge.CHILDS] = Ae.transform_drawNodes),
        (Ae.map[ge.ALPHA | ge.TRANSFORM | ge.TEXTURE] =
          Ae.alpha_transform_drawTexture),
        (Ae.map[ge.ALPHA | ge.TEXTURE] = Ae.alpha_drawTexture),
        (Ae.map[ge.TRANSFORM | ge.TEXTURE] = Ae.transform_drawTexture),
        (Ae.map[ge.GRAPHICS | ge.CHILDS] = Ae.drawLayaGL_drawNodes);
    }
    static transform_drawTexture(t, e, i, s) {
      t._style;
      var r = t.texture;
      e.saveTransform(Ae.curMat), e.transformByMatrix(t.transform, i, s);
      var a = t._width || r.sourceWidth,
        n = t._height || r.sourceHeight,
        h = a / r.sourceWidth,
        o = n / r.sourceHeight;
      if (((a = r.width * h), (n = r.height * o), a &lt;= 0 || n &lt;= 0))
        return null;
      var l = -t.pivotX + r.offsetX * h,
        _ = -t.pivotY + r.offsetY * o;
      e.drawTexture(r, l, _, a, n), e.restoreTransform(Ae.curMat);
    }
    static alpha_drawTexture(t, e, i, s) {
      var r,
        a = t._style,
        n = t.texture;
      if ((r = a.alpha) &gt; 0.01 || t._needRepaint()) {
        var h = e.globalAlpha;
        e.globalAlpha *= r;
        var o = t._width || n.width,
          l = t._height || n.height,
          _ = o / n.sourceWidth,
          u = l / n.sourceHeight;
        if (((o = n.width * _), (l = n.height * u), o &lt;= 0 || l &lt;= 0))
          return null;
        var c = i - a.pivotX + n.offsetX * _,
          d = s - a.pivotY + n.offsetY * u;
        e.drawTexture(n, c, d, o, l), (e.globalAlpha = h);
      }
    }
    static alpha_transform_drawTexture(t, e, i, s) {
      var r,
        a = t._style,
        n = t.texture;
      if ((r = a.alpha) &gt; 0.01 || t._needRepaint()) {
        var h = e.globalAlpha;
        (e.globalAlpha *= r),
          e.saveTransform(Ae.curMat),
          e.transformByMatrix(t.transform, i, s);
        var o = t._width || n.sourceWidth,
          l = t._height || n.sourceHeight,
          _ = o / n.sourceWidth,
          u = l / n.sourceHeight;
        if (((o = n.width * _), (l = n.height * u), o &lt;= 0 || l &lt;= 0))
          return null;
        var c = -a.pivotX + n.offsetX * _,
          d = -a.pivotY + n.offsetY * u;
        e.drawTexture(n, c, d, o, l),
          e.restoreTransform(Ae.curMat),
          (e.globalAlpha = h);
      }
    }
    static alpha_transform_drawLayaGL(t, e, i, s) {
      var r,
        a = t._style;
      if ((r = a.alpha) &gt; 0.01 || t._needRepaint()) {
        var n = e.globalAlpha;
        (e.globalAlpha *= r),
          e.saveTransform(Ae.curMat),
          e.transformByMatrix(t.transform, i, s),
          t._graphics &amp;&amp; t._graphics._render(t, e, -a.pivotX, -a.pivotY),
          e.restoreTransform(Ae.curMat),
          (e.globalAlpha = n);
      }
    }
    static alpha_drawLayaGL(t, e, i, s) {
      var r,
        a = t._style;
      if ((r = a.alpha) &gt; 0.01 || t._needRepaint()) {
        var n = e.globalAlpha;
        (e.globalAlpha *= r),
          t._graphics &amp;&amp; t._graphics._render(t, e, i - a.pivotX, s - a.pivotY),
          (e.globalAlpha = n);
      }
    }
    static transform_drawLayaGL(t, e, i, s) {
      var r = t._style;
      e.saveTransform(Ae.curMat),
        e.transformByMatrix(t.transform, i, s),
        t._graphics &amp;&amp; t._graphics._render(t, e, -r.pivotX, -r.pivotY),
        e.restoreTransform(Ae.curMat);
    }
    static transform_drawNodes(t, e, i, s) {
      var r = t._getBit(Ce.DRAWCALL_OPTIMIZE) &amp;&amp; e.drawCallOptimize(!0),
        a = t._style;
      e.saveTransform(Ae.curMat),
        e.transformByMatrix(t.transform, i, s),
        (i = -a.pivotX),
        (s = -a.pivotY);
      var n,
        h = t._children,
        o = h.length;
      if (a.viewport) {
        var l,
          _,
          u = a.viewport,
          c = u.x,
          d = u.y,
          p = u.right,
          f = u.bottom;
        for (m = 0; m &lt; o; ++m)
          (n = h[m])._visible &amp;&amp;
            (l = n._x) &lt; p &amp;&amp;
            l + n.width &gt; c &amp;&amp;
            (_ = n._y) &lt; f &amp;&amp;
            _ + n.height &gt; d &amp;&amp;
            n.render(e, i, s);
      } else
        for (var m = 0; m &lt; o; ++m) (n = h[m])._visible &amp;&amp; n.render(e, i, s);
      e.restoreTransform(Ae.curMat), r &amp;&amp; e.drawCallOptimize(!1);
    }
    static drawLayaGL_drawNodes(t, e, i, s) {
      var r = t._getBit(Ce.DRAWCALL_OPTIMIZE) &amp;&amp; e.drawCallOptimize(!0),
        a = t._style;
      (i -= a.pivotX),
        (s -= a.pivotY),
        t._graphics &amp;&amp; t._graphics._render(t, e, i, s);
      var n,
        h = t._children,
        o = h.length;
      if (a.viewport) {
        var l,
          _,
          u = a.viewport,
          c = u.x,
          d = u.y,
          p = u.right,
          f = u.bottom;
        for (m = 0; m &lt; o; ++m)
          (n = h[m])._visible &amp;&amp;
            (l = n._x) &lt; p &amp;&amp;
            l + n.width &gt; c &amp;&amp;
            (_ = n._y) &lt; f &amp;&amp;
            _ + n.height &gt; d &amp;&amp;
            n.render(e, i, s);
      } else
        for (var m = 0; m &lt; o; ++m) (n = h[m])._visible &amp;&amp; n.render(e, i, s);
      r &amp;&amp; e.drawCallOptimize(!1);
    }
  }
  (Ae.map = []), (Ae.curMat = new p());
  class be {
    constructor(t, e) {
      if (Ae.map[t])
        return (this._fun = Ae.map[t]), void (this._next = be.NORENDER);
      switch (((this._next = e || be.NORENDER), t)) {
        case 0:
          return void (this._fun = this._no);
        case ge.ALPHA:
          return void (this._fun = this._alpha);
        case ge.TRANSFORM:
          return void (this._fun = this._transform);
        case ge.BLEND:
          return void (this._fun = this._blend);
        case ge.CANVAS:
          return void (this._fun = this._canvas);
        case ge.MASK:
          return void (this._fun = this._mask);
        case ge.CLIP:
          return void (this._fun = this._clip);
        case ge.STYLE:
          return void (this._fun = this._style);
        case ge.GRAPHICS:
          return void (this._fun = this._graphics);
        case ge.CHILDS:
          return void (this._fun = this._children);
        case ge.CUSTOM:
          return void (this._fun = this._custom);
        case ge.TEXTURE:
          return void (this._fun = this._texture);
        case ge.FILTERS:
          return void (this._fun = $._filter);
        case be.INIT:
          return void (this._fun = be._initRenderFun);
      }
      this.onCreate(t);
    }
    static __init__() {
      var t, e, i;
      for (
        Ae.__init__(),
          i = new be(be.INIT, null),
          e = be.renders.length = 2 * ge.CHILDS,
          t = 0;
        t &lt; e;
        t++
      )
        be.renders[t] = i;
      be.renders[0] = new be(0, null);
    }
    static _initRenderFun(t, e, i, s) {
      var r = t._renderType;
      (be.renders[r] = be._getTypeRender(r))._fun(t, e, i, s);
    }
    static _getTypeRender(t) {
      if (Ae.map[t]) return new be(t, null);
      for (var e = null, i = ge.CHILDS; i &gt; 0; )
        i &amp; t &amp;&amp; (e = new be(i, e)), (i &gt;&gt;= 1);
      return e;
    }
    onCreate(t) {}
    _style(t, e, i, s) {
      var r = t._style;
      null != r.render &amp;&amp; r.render(t, e, i, s);
      var a = this._next;
      a._fun.call(a, t, e, i, s);
    }
    _no(t, e, i, s) {}
    _custom(t, e, i, s) {
      t.customRender(e, i, s), this._next._fun.call(this._next, t, e, 0, 0);
    }
    _clip(t, e, i, s) {
      var r = this._next;
      if (r != be.NORENDER) {
        var a = t._style.scrollRect,
          n = a.width,
          h = a.height;
        0 !== n &amp;&amp;
          0 !== h &amp;&amp;
          (e.save(),
          e.clipRect(i, s, n, h),
          r._fun.call(r, t, e, i - a.x, s - a.y),
          e.restore());
      }
    }
    _texture(t, e, i, s) {
      var r = t.texture;
      if (r._getSource()) {
        var a = t._width || r.sourceWidth,
          n = t._height || r.sourceHeight,
          h = a / r.sourceWidth,
          o = n / r.sourceHeight;
        if (((a = r.width * h), (n = r.height * o), a &lt;= 0 || n &lt;= 0)) return;
        var l = i - t.pivotX + r.offsetX * h,
          _ = s - t.pivotY + r.offsetY * o;
        e.drawTexture(r, l, _, a, n);
      }
      var u = this._next;
      u != be.NORENDER &amp;&amp; u._fun.call(u, t, e, i, s);
    }
    _graphics(t, e, i, s) {
      var r = t._style,
        a = t._graphics;
      a &amp;&amp; a._render(t, e, i - r.pivotX, s - r.pivotY);
      var n = this._next;
      n != be.NORENDER &amp;&amp; n._fun.call(n, t, e, i, s);
    }
    _image(t, e, i, s) {
      var r = t._style;
      e.drawTexture2(i, s, r.pivotX, r.pivotY, t.transform, t._graphics._one);
    }
    _image2(t, e, i, s) {
      var r = t._style;
      e.drawTexture2(i, s, r.pivotX, r.pivotY, t.transform, t._graphics._one);
    }
    _alpha(t, e, i, s) {
      var r;
      if ((r = t._style.alpha) &gt; 0.01 || t._needRepaint()) {
        var a = e.globalAlpha;
        e.globalAlpha *= r;
        var n = this._next;
        n._fun.call(n, t, e, i, s), (e.globalAlpha = a);
      }
    }
    _transform(t, e, i, s) {
      var r = t.transform,
        a = this._next;
      t._style;
      r &amp;&amp; a != be.NORENDER
        ? (e.save(),
          e.transform(r.a, r.b, r.c, r.d, r.tx + i, r.ty + s),
          a._fun.call(a, t, e, 0, 0),
          e.restore())
        : a != be.NORENDER &amp;&amp; a._fun.call(a, t, e, i, s);
    }
    _children(t, e, i, s) {
      var r,
        a = t._style,
        n = t._children,
        h = n.length;
      (i -= t.pivotX), (s -= t.pivotY);
      var o = t._getBit(Ce.DRAWCALL_OPTIMIZE) &amp;&amp; e.drawCallOptimize(!0);
      if (a.viewport) {
        var l,
          _,
          u = a.viewport,
          c = u.x,
          d = u.y,
          p = u.right,
          f = u.bottom;
        for (m = 0; m &lt; h; ++m)
          (r = n[m])._visible &amp;&amp;
            (l = r._x) &lt; p &amp;&amp;
            l + r.width &gt; c &amp;&amp;
            (_ = r._y) &lt; f &amp;&amp;
            _ + r.height &gt; d &amp;&amp;
            r.render(e, i, s);
      } else
        for (var m = 0; m &lt; h; ++m) (r = n[m])._visible &amp;&amp; r.render(e, i, s);
      o &amp;&amp; e.drawCallOptimize(!1);
    }
    _canvas(t, e, s, r) {
      var a = t._cacheStyle,
        n = this._next;
      if (a.enableCanvasRender) {
        "bitmap" === a.cacheAs ? H.canvasBitmap++ : H.canvasNormal++;
        var h = !1,
          o = !1;
        if (a.canvas) {
          var l = a.canvas,
            _ = (l.context, l.touches);
          if (_)
            for (var u = 0; u &lt; _.length; u++)
              if (_[u].deleted) {
                o = !0;
                break;
              }
          h = l.isCacheValid &amp;&amp; !l.isCacheValid();
        }
        if (
          t._needRepaint() ||
          !a.canvas ||
          o ||
          h ||
          i.stage.isGlobalRepaint()
        )
          if ("normal" === a.cacheAs) {
            if (e._targets) return void n._fun.call(n, t, e, s, r);
            this._canvas_webgl_normal_repaint(t, e);
          } else this._canvas_repaint(t, e, s, r);
        var c = a.cacheRect;
        e.drawCanvas(a.canvas, s + c.x, r + c.y, c.width, c.height);
      } else n._fun.call(n, t, e, s, r);
    }
    _canvas_repaint(t, e, i, s) {
      var r,
        a,
        n,
        h,
        o,
        l,
        _,
        u,
        c,
        d = t._cacheStyle,
        p = this._next,
        f = d.canvas,
        m = d.cacheAs;
      if (
        ((_ = (c = d._calculateCacheRect(t, m, i, s)).x),
        (u = c.y),
        (o = (h = d.cacheRect).width * _),
        (l = h.height * u),
        (a = h.x),
        (n = h.y),
        "bitmap" === m &amp;&amp; (o &gt; 2048 || l &gt; 2048))
      )
        return (
          console.warn("cache bitmap size larger than 2048,cache ignored"),
          d.releaseContext(),
          void p._fun.call(p, t, e, i, s)
        );
      if (
        (f || (d.createContext(), (f = d.canvas)),
        ((r = f.context).sprite = t),
        (f.width != o || f.height != l) &amp;&amp; f.size(o, l),
        "bitmap" === m
          ? (r.asBitmap = !0)
          : "normal" === m &amp;&amp; (r.asBitmap = !1),
        r.clear(),
        1 != _ || 1 != u)
      ) {
        var g = r;
        g.save(),
          g.scale(_, u),
          p._fun.call(p, t, r, -a, -n),
          g.restore(),
          t._applyFilters();
      } else (g = r), p._fun.call(p, t, r, -a, -n), t._applyFilters();
      d.staticCache &amp;&amp; (d.reCache = !1), H.canvasReCache++;
    }
    _canvas_webgl_normal_repaint(t, e) {
      var i = t._cacheStyle,
        s = this._next,
        r = i.canvas,
        a = i.cacheAs;
      i._calculateCacheRect(t, a, 0, 0),
        r || ((r = new Pt(e, t)), (i.canvas = r));
      var n = r.context;
      r.startRec(),
        s._fun.call(s, t, n, t.pivotX, t.pivotY),
        t._applyFilters(),
        H.canvasReCache++,
        r.endRec();
    }
    _blend(t, e, i, s) {
      var r = t._style,
        a = this._next;
      r.blendMode
        ? (e.save(),
          (e.globalCompositeOperation = r.blendMode),
          a._fun.call(a, t, e, i, s),
          e.restore())
        : a._fun.call(a, t, e, i, s);
    }
    _mask(t, e, i, s) {
      var r = this._next,
        a = t.mask,
        n = e;
      if (a) {
        n.save();
        var h = n.globalCompositeOperation,
          o = new m();
        if (
          (o.copyFrom(a.getBounds()),
          (o.width = Math.round(o.width)),
          (o.height = Math.round(o.height)),
          (o.x = Math.round(o.x)),
          (o.y = Math.round(o.y)),
          o.width &gt; 0 &amp;&amp; o.height &gt; 0)
        ) {
          var l = o.width,
            _ = o.height,
            u = W.getRT(l, _);
          n.breakNextMerge(),
            n.pushRT(),
            n.addRenderObject(Q.create([n, u, l, _], be.tmpTarget, this)),
            a.render(n, -o.x, -o.y),
            n.breakNextMerge(),
            n.popRT(),
            n.save();
          let e = 0.1;
          n.clipRect(
            i + o.x - t.getStyle().pivotX + e,
            s + o.y - t.getStyle().pivotY + e,
            l - 2 * e,
            _ - 2 * e,
          ),
            r._fun.call(r, t, n, i, s),
            n.restore(),
            (h = n.globalCompositeOperation),
            n.addRenderObject(Q.create(["mask"], be.setBlendMode, this));
          var c = q.create(X.TEXTURE2D, 0),
            d = Jt.INV_UV;
          n.drawTarget(
            u,
            i + o.x - t.getStyle().pivotX,
            s + o.y - t.getStyle().pivotY,
            l,
            _,
            p.TEMP.identity(),
            c,
            d,
            6,
          ),
            n.addRenderObject(Q.create([u], be.recycleTarget, this)),
            n.addRenderObject(Q.create([h], be.setBlendMode, this));
        }
        n.restore();
      } else r._fun.call(r, t, e, i, s);
    }
    static tmpTarget(t, e, i, s) {
      e.start(), e.clear(0, 0, 0, 0);
    }
    static recycleTarget(t) {
      W.releaseRT(t);
    }
    static setBlendMode(t) {
      var e = b.mainContext;
      Y.targetFns[Y.TOINT[t]](e);
    }
  }
  (be.INIT = 69905),
    (be.renders = []),
    (be.NORENDER = new be(0, null)),
    (be.tempUV = new Array(8));
  class Se extends L {
    constructor(t = !1) {
      super(),
        (this._source = t ? re.createElement("canvas") : this),
        (this.lock = !0);
    }
    get source() {
      return this._source;
    }
    _getSource() {
      return this._source;
    }
    clear() {
      this._ctx &amp;&amp;
        (this._ctx.clear
          ? this._ctx.clear()
          : this._ctx.clearRect(0, 0, this._width, this._height)),
        this._texture &amp;&amp; (this._texture.destroy(), (this._texture = null));
    }
    destroy() {
      super.destroy(),
        this._setCPUMemory(0),
        this._ctx &amp;&amp; this._ctx.destroy &amp;&amp; this._ctx.destroy(),
        (this._ctx = null);
    }
    release() {}
    get context() {
      return this._ctx
        ? this._ctx
        : (this._source == this
            ? (this._ctx = new i.Context())
            : (this._ctx = this._source.getContext(
                i.Render.isConchApp ? "layagl" : "2d",
              )),
          (this._ctx._canvas = this),
          this._ctx);
    }
    _setContext(t) {
      this._ctx = t;
    }
    getContext(t, e = null) {
      return this.context;
    }
    getMemSize() {
      return 0;
    }
    size(t, e) {
      (this._width != t ||
        this._height != e ||
        (this._source &amp;&amp;
          (this._source.width != t || this._source.height != e))) &amp;&amp;
        ((this._width = t),
        (this._height = e),
        this._setCPUMemory(t * e * 4),
        this._ctx &amp;&amp; this._ctx.size &amp;&amp; this._ctx.size(t, e),
        this._source &amp;&amp; ((this._source.height = e), (this._source.width = t)),
        this._texture &amp;&amp; (this._texture.destroy(), (this._texture = null)));
    }
    getTexture() {
      if (!this._texture) {
        var t = new N();
        t.loadImageSource(this.source), (this._texture = new Jt(t));
      }
      return this._texture;
    }
    toBase64(t, e) {
      if (this._source) {
        if (i.Render.isConchApp) {
          var s = window;
          if (2 == s.conchConfig.threadMode)
            throw "native 2 thread mode use toBase64Async";
          var r = this._ctx._targets.sourceWidth,
            a = this._ctx._targets.sourceHeight,
            n = this._ctx._targets.getData(0, 0, r, a);
          return s.conchToBase64FlipY
            ? s.conchToBase64FlipY(t, e, n.buffer, r, a)
            : s.conchToBase64(t, e, n.buffer, r, a);
        }
        return this._source.toDataURL(t, e);
      }
      return null;
    }
    toBase64Async(t, e, i) {
      var s = this._ctx._targets.sourceWidth,
        r = this._ctx._targets.sourceHeight;
      this._ctx._targets.getDataAsync(0, 0, s, r, function (a) {
        let n = window;
        var h = n.conchToBase64FlipY
          ? n.conchToBase64FlipY(t, e, a.buffer, s, r)
          : n.conchToBase64(t, e, a.buffer, s, r);
        i(h);
      });
    }
  }
  class we {
    contains(t, e) {
      return (
        !!we._isHitGraphic(t, e, this.hit) &amp;&amp;
        !we._isHitGraphic(t, e, this.unHit)
      );
    }
    static _isHitGraphic(t, e, i) {
      if (!i) return !1;
      var s,
        r,
        a,
        n = i.cmds;
      if ((!n &amp;&amp; i._one &amp;&amp; (((n = we._cmds).length = 1), (n[0] = i._one)), !n))
        return !1;
      for (r = n.length, s = 0; s &lt; r; s++)
        if ((a = n[s])) {
          switch (a.cmdID) {
            case "Translate":
              (t -= a.tx), (e -= a.ty);
          }
          if (we._isHitCmd(t, e, a)) return !0;
        }
      return !1;
    }
    static _isHitCmd(t, e, i) {
      if (!i) return !1;
      var s = !1;
      switch (i.cmdID) {
        case "DrawRect":
          we._rect.setTo(i.x, i.y, i.width, i.height),
            (s = we._rect.contains(t, e));
          break;
        case "DrawCircle":
          s = (t -= i.x) * t + (e -= i.y) * e &lt; i.radius * i.radius;
          break;
        case "DrawPoly":
          (t -= i.x), (e -= i.y), (s = we._ptInPolygon(t, e, i.points));
      }
      return s;
    }
    static _ptInPolygon(t, e, i) {
      var s = we._ptPoint;
      s.setTo(t, e);
      var r,
        a,
        n,
        h,
        o,
        l = 0;
      o = i.length;
      for (var _ = 0; _ &lt; o; _ += 2) {
        if (
          ((r = i[_]),
          (a = i[_ + 1]),
          (n = i[(_ + 2) % o]),
          a != (h = i[(_ + 3) % o]))
        )
          if (!(s.y &lt; Math.min(a, h)))
            if (!(s.y &gt;= Math.max(a, h)))
              ((s.y - a) * (n - r)) / (h - a) + r &gt; s.x &amp;&amp; l++;
      }
      return l % 2 == 1;
    }
    get hit() {
      return this._hit || (this._hit = new i.Graphics()), this._hit;
    }
    set hit(t) {
      this._hit = t;
    }
    get unHit() {
      return this._unHit || (this._unHit = new i.Graphics()), this._unHit;
    }
    set unHit(t) {
      this._unHit = t;
    }
  }
  (we._cmds = []), (we._rect = new m()), (we._ptPoint = new f());
  class Me {
    static regClass(t, e) {
      Me._classMap[t] = e;
    }
    static regShortClassName(t) {
      for (var e = 0; e &lt; t.length; e++) {
        var i = t[e],
          s = i.name;
        Me._classMap[s] = i;
      }
    }
    static getRegClass(t) {
      return Me._classMap[t];
    }
    static getClass(t) {
      var e = Me._classMap[t] || Me._classMap["Laya." + t] || t,
        s = i.Laya;
      return "string" == typeof e ? i.__classMap[e] || s[t] : e;
    }
    static getInstance(t) {
      var e = Me.getClass(t);
      return e ? new e() : (console.warn("[error] Undefined class:", t), null);
    }
    static createByJson(t, e = null, i = null, s = null, r = null) {
      "string" == typeof t &amp;&amp; (t = JSON.parse(t));
      var a = t.props;
      if (!e &amp;&amp; !(e = r ? r.runWith(t) : Me.getInstance(a.runtime || t.type)))
        return null;
      var n = t.child;
      if (n)
        for (var h = 0, o = n.length; h &lt; o; h++) {
          var l = n[h];
          if (
            ("render" !== l.props.name &amp;&amp; "render" !== l.props.renderType) ||
            !e._$set_itemRender
          )
            if ("Graphic" == l.type) Me._addGraphicsToSprite(l, e);
            else if (Me._isDrawType(l.type)) Me._addGraphicToSprite(l, e, !0);
            else {
              var _ = Me.createByJson(l, null, i, s, r);
              "Script" === l.type
                ? "owner" in _
                  ? (_.owner = e)
                  : "target" in _ &amp;&amp; (_.target = e)
                : "mask" == l.props.renderType
                  ? (e.mask = _)
                  : e.addChild(_);
            }
          else e.itemRender = l;
        }
      if (a)
        for (var u in a) {
          var c = a[u];
          "var" === u &amp;&amp; i
            ? (i[c] = e)
            : c instanceof Array &amp;&amp; e[u] instanceof Function
              ? e[u].apply(e, c)
              : (e[u] = c);
        }
      return (
        s &amp;&amp; t.customProps &amp;&amp; s.runWith([e, t]), e.created &amp;&amp; e.created(), e
      );
    }
    static _addGraphicsToSprite(t, e) {
      var i = t.child;
      if (i &amp;&amp; !(i.length &lt; 1)) {
        var s,
          r,
          a = Me._getGraphicsFromSprite(t, e),
          n = 0,
          h = 0;
        for (
          t.props &amp;&amp;
            ((n = Me._getObjVar(t.props, "x", 0)),
            (h = Me._getObjVar(t.props, "y", 0))),
            0 != n &amp;&amp; 0 != h &amp;&amp; a.translate(n, h),
            r = i.length,
            s = 0;
          s &lt; r;
          s++
        )
          Me._addGraphicToGraphics(i[s], a);
        0 != n &amp;&amp; 0 != h &amp;&amp; a.translate(-n, -h);
      }
    }
    static _addGraphicToSprite(t, e, i = !1) {
      var s = i ? Me._getGraphicsFromSprite(t, e) : e.graphics;
      Me._addGraphicToGraphics(t, s);
    }
    static _getGraphicsFromSprite(t, e) {
      if (!t || !t.props) return e.graphics;
      var i = t.props.renderType;
      if ("hit" === i || "unHit" === i) {
        var s = e._style.hitArea || (e.hitArea = new we());
        s[i] || (s[i] = new Re());
        var r = s[i];
      }
      return r || (r = e.graphics), r;
    }
    static _getTransformData(t) {
      var e;
      ("pivotX" in t || "pivotY" in t) &amp;&amp;
        (e = e || new p()).translate(
          -Me._getObjVar(t, "pivotX", 0),
          -Me._getObjVar(t, "pivotY", 0),
        );
      var i = Me._getObjVar(t, "scaleX", 1),
        s = Me._getObjVar(t, "scaleY", 1),
        r = Me._getObjVar(t, "rotation", 0);
      Me._getObjVar(t, "skewX", 0), Me._getObjVar(t, "skewY", 0);
      return (
        (1 == i &amp;&amp; 1 == s &amp;&amp; 0 == r) ||
          ((e = e || new p()).scale(i, s), e.rotate(0.0174532922222222 * r)),
        e
      );
    }
    static _addGraphicToGraphics(t, e) {
      var i, s;
      if ((i = t.props) &amp;&amp; (s = Me.DrawTypeDic[t.type])) {
        var r = e,
          a = Me._getParams(i, s[1], s[2], s[3]),
          n = Me._tM;
        (n || 1 != Me._alpha) &amp;&amp;
          (r.save(), n &amp;&amp; r.transform(n), 1 != Me._alpha &amp;&amp; r.alpha(Me._alpha)),
          r[s[0]].apply(r, a),
          (n || 1 != Me._alpha) &amp;&amp; r.restore();
      }
    }
    static _adptLineData(t) {
      return (
        (t[2] = parseFloat(t[0]) + parseFloat(t[2])),
        (t[3] = parseFloat(t[1]) + parseFloat(t[3])),
        t
      );
    }
    static _adptTextureData(t) {
      return (t[0] = i.Loader.getRes(t[0])), t;
    }
    static _adptLinesData(t) {
      return (t[2] = Me._getPointListByStr(t[2])), t;
    }
    static _isDrawType(t) {
      return "Image" !== t &amp;&amp; t in Me.DrawTypeDic;
    }
    static _getParams(t, e, i = 0, s = null) {
      var r,
        a,
        n,
        h = Me._temParam;
      for (h.length = e.length, a = e.length, r = 0; r &lt; a; r++)
        h[r] = Me._getObjVar(t, e[r][0], e[r][1]);
      return (
        (Me._alpha = Me._getObjVar(t, "alpha", 1)),
        (n = Me._getTransformData(t))
          ? (i || (i = 0),
            n.translate(h[i], h[i + 1]),
            (h[i] = h[i + 1] = 0),
            (Me._tM = n))
          : (Me._tM = null),
        s &amp;&amp; Me[s] &amp;&amp; (h = Me[s](h)),
        h
      );
    }
    static _getPointListByStr(t) {
      var e,
        i,
        s = t.split(",");
      for (i = s.length, e = 0; e &lt; i; e++) s[e] = parseFloat(s[e]);
      return s;
    }
    static _getObjVar(t, e, i) {
      return e in t ? t[e] : i;
    }
  }
  (Me.DrawTypeDic = {
    Rect: [
      "drawRect",
      [
        ["x", 0],
        ["y", 0],
        ["width", 0],
        ["height", 0],
        ["fillColor", null],
        ["lineColor", null],
        ["lineWidth", 1],
      ],
    ],
    Circle: [
      "drawCircle",
      [
        ["x", 0],
        ["y", 0],
        ["radius", 0],
        ["fillColor", null],
        ["lineColor", null],
        ["lineWidth", 1],
      ],
    ],
    Pie: [
      "drawPie",
      [
        ["x", 0],
        ["y", 0],
        ["radius", 0],
        ["startAngle", 0],
        ["endAngle", 0],
        ["fillColor", null],
        ["lineColor", null],
        ["lineWidth", 1],
      ],
    ],
    Image: [
      "drawTexture",
      [
        ["x", 0],
        ["y", 0],
        ["width", 0],
        ["height", 0],
      ],
    ],
    Texture: [
      "drawTexture",
      [
        ["skin", null],
        ["x", 0],
        ["y", 0],
        ["width", 0],
        ["height", 0],
      ],
      1,
      "_adptTextureData",
    ],
    FillTexture: [
      "fillTexture",
      [
        ["skin", null],
        ["x", 0],
        ["y", 0],
        ["width", 0],
        ["height", 0],
        ["repeat", null],
      ],
      1,
      "_adptTextureData",
    ],
    FillText: [
      "fillText",
      [
        ["text", ""],
        ["x", 0],
        ["y", 0],
        ["font", null],
        ["color", null],
        ["textAlign", null],
      ],
      1,
    ],
    Line: [
      "drawLine",
      [
        ["x", 0],
        ["y", 0],
        ["toX", 0],
        ["toY", 0],
        ["lineColor", null],
        ["lineWidth", 0],
      ],
      0,
      "_adptLineData",
    ],
    Lines: [
      "drawLines",
      [
        ["x", 0],
        ["y", 0],
        ["points", ""],
        ["lineColor", null],
        ["lineWidth", 0],
      ],
      0,
      "_adptLinesData",
    ],
    Curves: [
      "drawCurves",
      [
        ["x", 0],
        ["y", 0],
        ["points", ""],
        ["lineColor", null],
        ["lineWidth", 0],
      ],
      0,
      "_adptLinesData",
    ],
    Poly: [
      "drawPoly",
      [
        ["x", 0],
        ["y", 0],
        ["points", ""],
        ["fillColor", null],
        ["lineColor", null],
        ["lineWidth", 1],
      ],
      0,
      "_adptLinesData",
    ],
  }),
    (Me._temParam = []),
    (Me._classMap = {});
  class Ie {
    reset() {
      return (
        this.bounds &amp;&amp; this.bounds.recover(),
        this.userBounds &amp;&amp; this.userBounds.recover(),
        (this.bounds = null),
        (this.userBounds = null),
        (this.temBM = null),
        this
      );
    }
    recover() {
      s.recover("BoundsStyle", this.reset());
    }
    static create() {
      return s.getItemByClass("BoundsStyle", Ie);
    }
  }
  class Pe {
    constructor() {
      this.reset();
    }
    needBitmapCache() {
      return this.cacheForFilters || !!this.mask;
    }
    needEnableCanvasRender() {
      return "none" != this.userSetCache || this.cacheForFilters || !!this.mask;
    }
    releaseContext() {
      if (this.canvas &amp;&amp; this.canvas.size) {
        s.recover("CacheCanvas", this.canvas), this.canvas.size(0, 0);
        try {
          (this.canvas.width = 0), (this.canvas.height = 0);
        } catch (t) {}
      }
      this.canvas = null;
    }
    createContext() {
      if (!this.canvas) {
        this.canvas = s.getItem("CacheCanvas") || new Se(!1);
        var t = this.canvas.context;
        t || (t = this.canvas.getContext("2d"));
      }
    }
    releaseFilterCache() {
      var t = this.filterCache;
      t &amp;&amp; (t.destroy(), t.recycle(), (this.filterCache = null));
    }
    recover() {
      this !== Pe.EMPTY &amp;&amp; s.recover("SpriteCache", this.reset());
    }
    reset() {
      return (
        this.releaseContext(),
        this.releaseFilterCache(),
        (this.cacheAs = "none"),
        (this.enableCanvasRender = !1),
        (this.userSetCache = "none"),
        (this.cacheForFilters = !1),
        (this.staticCache = !1),
        (this.reCache = !0),
        (this.mask = null),
        (this.maskParent = null),
        (this.filterCache = null),
        (this.filters = null),
        (this.hasGlowFilter = !1),
        this.cacheRect &amp;&amp; this.cacheRect.recover(),
        (this.cacheRect = null),
        this
      );
    }
    static create() {
      return s.getItemByClass("SpriteCache", Pe);
    }
    _calculateCacheRect(t, e, i, s) {
      var r,
        a = t._cacheStyle;
      if (
        (a.cacheRect || (a.cacheRect = m.create()),
        "bitmap" === e
          ? (((r = t.getSelfBounds()).width =
              r.width + 2 * Pe.CANVAS_EXTEND_EDGE),
            (r.height = r.height + 2 * Pe.CANVAS_EXTEND_EDGE),
            (r.x = r.x - t.pivotX),
            (r.y = r.y - t.pivotY),
            (r.x = r.x - Pe.CANVAS_EXTEND_EDGE),
            (r.y = r.y - Pe.CANVAS_EXTEND_EDGE),
            (r.x = Math.floor(r.x + i) - i),
            (r.y = Math.floor(r.y + s) - s),
            (r.width = Math.floor(r.width)),
            (r.height = Math.floor(r.height)),
            a.cacheRect.copyFrom(r))
          : a.cacheRect.setTo(-t._style.pivotX, -t._style.pivotY, 1, 1),
        (r = a.cacheRect),
        t._style.scrollRect)
      ) {
        var n = t._style.scrollRect;
        (r.x -= n.x), (r.y -= n.y);
      }
      return Pe._scaleInfo.setTo(1, 1), Pe._scaleInfo;
    }
  }
  (Pe.EMPTY = new Pe()),
    (Pe._scaleInfo = new f()),
    (Pe.CANVAS_EXTEND_EDGE = 16);
  class Le {
    constructor() {
      this.reset();
    }
    reset() {
      return (
        (this.scaleX = this.scaleY = 1),
        (this.skewX = this.skewY = 0),
        (this.pivotX = this.pivotY = this.rotation = 0),
        (this.alpha = 1),
        this.scrollRect &amp;&amp; this.scrollRect.recover(),
        (this.scrollRect = null),
        this.viewport &amp;&amp; this.viewport.recover(),
        (this.viewport = null),
        (this.hitArea = null),
        (this.dragging = null),
        (this.blendMode = null),
        this
      );
    }
    recover() {
      this !== Le.EMPTY &amp;&amp; s.recover("SpriteStyle", this.reset());
    }
    static create() {
      return s.getItemByClass("SpriteStyle", Le);
    }
  }
  Le.EMPTY = new Le();
  class De extends w {
    constructor() {
      super(),
        (this._bits = 0),
        (this._children = De.ARRAY_EMPTY),
        (this._extUIChild = De.ARRAY_EMPTY),
        (this._parent = null),
        (this.name = ""),
        (this.destroyed = !1),
        this.createGLBuffer();
    }
    createGLBuffer() {}
    _setBit(t, e) {
      t === Ce.DISPLAY &amp;&amp;
        this._getBit(t) != e &amp;&amp;
        this._updateDisplayedInstage();
      e ? (this._bits |= t) : (this._bits &amp;= ~t);
    }
    _getBit(t) {
      return 0 != (this._bits &amp; t);
    }
    _setUpNoticeChain() {
      this._getBit(Ce.DISPLAY) &amp;&amp; this._setBitUp(Ce.DISPLAY);
    }
    _setBitUp(t) {
      var e = this;
      for (e._setBit(t, !0), e = e._parent; e; ) {
        if (e._getBit(t)) return;
        e._setBit(t, !0), (e = e._parent);
      }
    }
    on(t, e, i, s = null) {
      return (
        (t !== $t.DISPLAY &amp;&amp; t !== $t.UNDISPLAY) ||
          this._getBit(Ce.DISPLAY) ||
          this._setBitUp(Ce.DISPLAY),
        this._createListener(t, e, i, s, !1)
      );
    }
    once(t, e, i, s = null) {
      return (
        (t !== $t.DISPLAY &amp;&amp; t !== $t.UNDISPLAY) ||
          this._getBit(Ce.DISPLAY) ||
          this._setBitUp(Ce.DISPLAY),
        this._createListener(t, e, i, s, !0)
      );
    }
    destroy(t = !0) {
      (this.destroyed = !0),
        this._destroyAllComponent(),
        this._parent &amp;&amp; this._parent.removeChild(this),
        this._children &amp;&amp; (t ? this.destroyChildren() : this.removeChildren()),
        this.onDestroy(),
        (this._children = null),
        this.offAll();
    }
    onDestroy() {}
    destroyChildren() {
      if (this._children)
        for (var t = 0, e = this._children.length; t &lt; e; t++)
          this._children[0].destroy(!0);
    }
    addChild(t) {
      if (!t || this.destroyed || t === this) return t;
      if ((t._zOrder &amp;&amp; this._setBit(Ce.HAS_ZORDER, !0), t._parent === this)) {
        var e = this.getChildIndex(t);
        e !== this._children.length - 1 &amp;&amp;
          (this._children.splice(e, 1),
          this._children.push(t),
          this._childChanged());
      } else
        t._parent &amp;&amp; t._parent.removeChild(t),
          this._children === De.ARRAY_EMPTY &amp;&amp; (this._children = []),
          this._children.push(t),
          t._setParent(this),
          this._childChanged();
      return t;
    }
    addInputChild(t) {
      if (this._extUIChild == De.ARRAY_EMPTY) this._extUIChild = [t];
      else {
        if (this._extUIChild.indexOf(t) &gt;= 0) return null;
        this._extUIChild.push(t);
      }
      return null;
    }
    removeInputChild(t) {
      var e = this._extUIChild.indexOf(t);
      e &gt;= 0 &amp;&amp; this._extUIChild.splice(e, 1);
    }
    addChildren(...t) {
      for (var e = 0, i = t.length; e &lt; i; ) this.addChild(t[e++]);
    }
    addChildAt(t, e) {
      if (!t || this.destroyed || t === this) return t;
      if (
        (t._zOrder &amp;&amp; this._setBit(Ce.HAS_ZORDER, !0),
        e &gt;= 0 &amp;&amp; e &lt;= this._children.length)
      ) {
        if (t._parent === this) {
          var i = this.getChildIndex(t);
          this._children.splice(i, 1),
            this._children.splice(e, 0, t),
            this._childChanged();
        } else
          t._parent &amp;&amp; t._parent.removeChild(t),
            this._children === De.ARRAY_EMPTY &amp;&amp; (this._children = []),
            this._children.splice(e, 0, t),
            t._setParent(this);
        return t;
      }
      throw new Error("appendChildAt:The index is out of bounds");
    }
    getChildIndex(t) {
      return this._children.indexOf(t);
    }
    getChildByName(t) {
      var e = this._children;
      if (e)
        for (var i = 0, s = e.length; i &lt; s; i++) {
          var r = e[i];
          if (r &amp;&amp; r.name === t) return r;
        }
      return null;
    }
    getChildAt(t) {
      return this._children[t] || null;
    }
    setChildIndex(t, e) {
      var i = this._children;
      if (e &lt; 0 || e &gt;= i.length)
        throw new Error("setChildIndex:The index is out of bounds.");
      var s = this.getChildIndex(t);
      if (s &lt; 0)
        throw new Error("setChildIndex:node is must child of this object.");
      return i.splice(s, 1), i.splice(e, 0, t), this._childChanged(), t;
    }
    _childChanged(t = null) {}
    removeChild(t) {
      if (!this._children) return t;
      var e = this._children.indexOf(t);
      return this.removeChildAt(e);
    }
    removeSelf() {
      return this._parent &amp;&amp; this._parent.removeChild(this), this;
    }
    removeChildByName(t) {
      var e = this.getChildByName(t);
      return e &amp;&amp; this.removeChild(e), e;
    }
    removeChildAt(t) {
      var e = this.getChildAt(t);
      return e &amp;&amp; (this._children.splice(t, 1), e._setParent(null)), e;
    }
    removeChildren(t = 0, e = 2147483647) {
      if (this._children &amp;&amp; this._children.length &gt; 0) {
        var i = this._children;
        if (0 === t &amp;&amp; e &gt;= i.length - 1) {
          var s = i;
          this._children = De.ARRAY_EMPTY;
        } else s = i.splice(t, e - t + 1);
        for (var r = 0, a = s.length; r &lt; a; r++) s[r]._setParent(null);
      }
      return this;
    }
    replaceChild(t, e) {
      var i = this._children.indexOf(e);
      return i &gt; -1
        ? (this._children.splice(i, 1, t),
          e._setParent(null),
          t._setParent(this),
          t)
        : null;
    }
    get numChildren() {
      return this._children.length;
    }
    get parent() {
      return this._parent;
    }
    _setParent(t) {
      this._parent !== t &amp;&amp;
        (t
          ? ((this._parent = t),
            this._onAdded(),
            this.event($t.ADDED),
            this._getBit(Ce.DISPLAY) &amp;&amp;
              (this._setUpNoticeChain(),
              t.displayedInStage &amp;&amp; this._displayChild(this, !0)),
            t._childChanged(this))
          : (this._onRemoved(),
            this.event($t.REMOVED),
            this._parent._childChanged(),
            this._getBit(Ce.DISPLAY) &amp;&amp; this._displayChild(this, !1),
            (this._parent = t)));
    }
    get displayedInStage() {
      return this._getBit(Ce.DISPLAY)
        ? this._getBit(Ce.DISPLAYED_INSTAGE)
        : (this._setBitUp(Ce.DISPLAY), this._getBit(Ce.DISPLAYED_INSTAGE));
    }
    _updateDisplayedInstage() {
      var t;
      t = this;
      for (var e = i.stage, s = !1; t; ) {
        if (t._getBit(Ce.DISPLAY)) {
          s = t._getBit(Ce.DISPLAYED_INSTAGE);
          break;
        }
        if (t === e || t._getBit(Ce.DISPLAYED_INSTAGE)) {
          s = !0;
          break;
        }
        t = t._parent;
      }
      this._setBit(Ce.DISPLAYED_INSTAGE, s);
    }
    _setDisplay(t) {
      this._getBit(Ce.DISPLAYED_INSTAGE) !== t &amp;&amp;
        (this._setBit(Ce.DISPLAYED_INSTAGE, t),
        t ? this.event($t.DISPLAY) : this.event($t.UNDISPLAY));
    }
    _displayChild(t, e) {
      var i = t._children;
      if (i)
        for (var s = 0, r = i.length; s &lt; r; s++) {
          var a = i[s];
          a &amp;&amp;
            a._getBit(Ce.DISPLAY) &amp;&amp;
            (a._children.length &gt; 0
              ? this._displayChild(a, e)
              : a._setDisplay(e));
        }
      t._setDisplay(e);
    }
    contains(t) {
      if (t === this) return !0;
      for (; t; ) {
        if (t._parent === this) return !0;
        t = t._parent;
      }
      return !1;
    }
    timerLoop(t, e, s, r = null, a = !0, n = !1) {
      (this.scene ? this.scene.timer : i.timer).loop(t, e, s, r, a, n);
    }
    timerOnce(t, e, s, r = null, a = !0) {
      (this.scene ? this.scene.timer : i.timer)._create(!1, !1, t, e, s, r, a);
    }
    frameLoop(t, e, s, r = null, a = !0) {
      (this.scene ? this.scene.timer : i.timer)._create(!0, !0, t, e, s, r, a);
    }
    frameOnce(t, e, s, r = null, a = !0) {
      (this.scene ? this.scene.timer : i.timer)._create(!0, !1, t, e, s, r, a);
    }
    clearTimer(t, e) {
      (this.scene ? this.scene.timer : i.timer).clear(t, e);
    }
    callLater(t, e = null) {
      (this.scene ? this.scene.timer : i.timer).callLater(this, t, e);
    }
    runCallLater(t) {
      (this.scene ? this.scene.timer : i.timer).runCallLater(this, t);
    }
    get scene() {
      return this._scene;
    }
    get active() {
      return !this._getBit(Ce.NOT_READY) &amp;&amp; !this._getBit(Ce.NOT_ACTIVE);
    }
    set active(t) {
      if (((t = !!t), !this._getBit(Ce.NOT_ACTIVE) !== t)) {
        if (this._activeChangeScripts &amp;&amp; 0 !== this._activeChangeScripts.length)
          throw t
            ? "Node: can't set the main inActive node active in hierarchy,if the operate is in main inActive node or it's children script's onDisable Event."
            : "Node: can't set the main active node inActive in hierarchy,if the operate is in main active node or it's children script's onEnable Event.";
        this._setBit(Ce.NOT_ACTIVE, !t),
          this._parent &amp;&amp;
            this._parent.activeInHierarchy &amp;&amp;
            (t ? this._processActive() : this._processInActive());
      }
    }
    get activeInHierarchy() {
      return this._getBit(Ce.ACTIVE_INHIERARCHY);
    }
    _onActive() {
      H.spriteCount++;
    }
    _onInActive() {
      H.spriteCount--;
    }
    _onActiveInScene() {}
    _onInActiveInScene() {}
    _parse(t, e) {}
    _setBelongScene(t) {
      if (!this._scene) {
        (this._scene = t), this._onActiveInScene();
        for (var e = 0, i = this._children.length; e &lt; i; e++)
          this._children[e]._setBelongScene(t);
      }
    }
    _setUnBelongScene() {
      if (this._scene !== this) {
        this._onInActiveInScene(), (this._scene = null);
        for (var t = 0, e = this._children.length; t &lt; e; t++)
          this._children[t]._setUnBelongScene();
      }
    }
    onAwake() {}
    onEnable() {}
    _processActive() {
      this._activeChangeScripts || (this._activeChangeScripts = []),
        this._activeHierarchy(this._activeChangeScripts),
        this._activeScripts();
    }
    _activeHierarchy(t) {
      if ((this._setBit(Ce.ACTIVE_INHIERARCHY, !0), this._components))
        for (var e = 0, i = this._components.length; e &lt; i; e++) {
          var s = this._components[e];
          s._isScript() ? s._enabled &amp;&amp; t.push(s) : s._setActive(!0);
        }
      for (this._onActive(), e = 0, i = this._children.length; e &lt; i; e++) {
        var r = this._children[e];
        !r._getBit(Ce.NOT_ACTIVE) &amp;&amp;
          !r._getBit(Ce.NOT_READY) &amp;&amp;
          r._activeHierarchy(t);
      }
      this._getBit(Ce.AWAKED) || (this._setBit(Ce.AWAKED, !0), this.onAwake()),
        this.onEnable();
    }
    _activeScripts() {
      for (var t = 0, e = this._activeChangeScripts.length; t &lt; e; t++) {
        var i = this._activeChangeScripts[t],
          s = i.owner;
        s &amp;&amp; !i._awaked &amp;&amp; ((i._awaked = !0), i._onAwake()),
          s &amp;&amp; s.activeInHierarchy &amp;&amp; i._onEnable();
      }
      this._activeChangeScripts.length = 0;
    }
    _processInActive() {
      this._activeChangeScripts || (this._activeChangeScripts = []),
        this._inActiveHierarchy(this._activeChangeScripts),
        this._inActiveScripts();
    }
    _inActiveHierarchy(t) {
      if ((this._onInActive(), this._components))
        for (var e = 0, i = this._components.length; e &lt; i; e++) {
          var s = this._components[e];
          !s._isScript() &amp;&amp; s._setActive(!1),
            s._isScript() &amp;&amp; s._enabled &amp;&amp; t.push(s);
        }
      for (
        this._setBit(Ce.ACTIVE_INHIERARCHY, !1),
          e = 0,
          i = this._children.length;
        e &lt; i;
        e++
      ) {
        var r = this._children[e];
        r &amp;&amp; !r._getBit(Ce.NOT_ACTIVE) &amp;&amp; r._inActiveHierarchy(t);
      }
      this.onDisable();
    }
    _inActiveScripts() {
      for (var t = 0, e = this._activeChangeScripts.length; t &lt; e; t++)
        this._activeChangeScripts[t].owner &amp;&amp;
          this._activeChangeScripts[t]._onDisable();
      this._activeChangeScripts.length = 0;
    }
    onDisable() {}
    _onAdded() {
      if (this._activeChangeScripts &amp;&amp; 0 !== this._activeChangeScripts.length)
        throw "Node: can't set the main inActive node active in hierarchy,if the operate is in main inActive node or it's children script's onDisable Event.";
      var t = this._parent.scene;
      t &amp;&amp; this._setBelongScene(t),
        this._parent.activeInHierarchy &amp;&amp; this.active &amp;&amp; this._processActive();
    }
    _onRemoved() {
      if (this._activeChangeScripts &amp;&amp; 0 !== this._activeChangeScripts.length)
        throw "Node: can't set the main active node inActive in hierarchy,if the operate is in main active node or it's children script's onEnable Event.";
      this._parent.activeInHierarchy &amp;&amp; this.active &amp;&amp; this._processInActive(),
        this._parent.scene &amp;&amp; this._setUnBelongScene();
    }
    _addComponentInstance(t) {
      (this._components = this._components || []),
        this._components.push(t),
        (t.owner = this),
        t._onAdded(),
        this.activeInHierarchy &amp;&amp; t._setActive(!0);
    }
    _destroyComponent(t) {
      if (this._components)
        for (var e = 0, i = this._components.length; e &lt; i; e++) {
          var s = this._components[e];
          if (s === t) {
            s._destroy(), this._components.splice(e, 1);
            break;
          }
        }
    }
    _destroyAllComponent() {
      if (this._components) {
        for (var t = 0, e = this._components.length; t &lt; e; t++) {
          var i = this._components[t];
          i &amp;&amp; i._destroy();
        }
        this._components.length = 0;
      }
    }
    _cloneTo(t, e, i) {
      var s = t;
      if (this._components)
        for (var r = 0, a = this._components.length; r &lt; a; r++) {
          var n = s.addComponent(this._components[r].constructor);
          this._components[r]._cloneTo(n);
        }
    }
    addComponentIntance(t) {
      if (t.owner) throw "Node:the component has belong to other node.";
      if (t.isSingleton &amp;&amp; this.getComponent(t.constructor))
        throw "Node:the component is singleton,can't add the second one.";
      return this._addComponentInstance(t), t;
    }
    addComponent(t) {
      var e = s.createByClass(t);
      if (!e) throw t.toString() + "ç»„ä»¶ä¸å­˜åœ¨";
      if (((e._destroyed = !1), e.isSingleton &amp;&amp; this.getComponent(t)))
        throw "æ—&nbsp;æ³•å®žä¾‹" + t + "ç»„ä»¶ï¼Œ" + t + "ç»„ä»¶å·²å­˜åœ¨ï¼";
      return this._addComponentInstance(e), e;
    }
    getComponent(t) {
      if (this._components)
        for (var e = 0, i = this._components.length; e &lt; i; e++) {
          var s = this._components[e];
          if (s instanceof t) return s;
        }
      return null;
    }
    getComponents(t) {
      var e;
      if (this._components)
        for (var i = 0, s = this._components.length; i &lt; s; i++) {
          var r = this._components[i];
          r instanceof t &amp;&amp; (e = e || []).push(r);
        }
      return e;
    }
    get timer() {
      return this.scene ? this.scene.timer : i.timer;
    }
  }
  (De.ARRAY_EMPTY = []),
    Me.regClass("laya.display.Node", De),
    Me.regClass("Laya.Node", De);
  class Be extends De {
    constructor() {
      super(),
        (this._x = 0),
        (this._y = 0),
        (this._width = 0),
        (this._height = 0),
        (this._visible = !0),
        (this._mouseState = 0),
        (this._zOrder = 0),
        (this._renderType = 0),
        (this._transform = null),
        (this._tfChanged = !1),
        (this._repaint = ge.REPAINT_NONE),
        (this._texture = null),
        (this._style = Le.EMPTY),
        (this._cacheStyle = Pe.EMPTY),
        (this._boundStyle = null),
        (this._graphics = null),
        (this.mouseThrough = !1),
        (this.autoSize = !1),
        (this.hitTestPrior = !1);
    }
    destroy(t = !0) {
      super.destroy(t),
        this._style &amp;&amp; this._style.recover(),
        this._cacheStyle &amp;&amp; this._cacheStyle.recover(),
        this._boundStyle &amp;&amp; this._boundStyle.recover(),
        this._transform &amp;&amp; this._transform.recover(),
        (this._style = null),
        (this._cacheStyle = null),
        (this._boundStyle = null),
        (this._transform = null),
        this._graphics &amp;&amp;
          this._graphics.autoDestroy &amp;&amp;
          this._graphics.destroy(),
        (this._graphics = null),
        (this.texture = null);
    }
    updateZOrder() {
      J.updateOrder(this._children) &amp;&amp; this.repaint();
    }
    _getBoundsStyle() {
      return (
        this._boundStyle || (this._boundStyle = Ie.create()), this._boundStyle
      );
    }
    _setCustomRender() {}
    set customRenderEnable(t) {
      t &amp;&amp;
        ((this._renderType |= ge.CUSTOM),
        this._setRenderType(this._renderType),
        this._setCustomRender());
    }
    get cacheAs() {
      return this._cacheStyle.cacheAs;
    }
    _setCacheAs(t) {}
    set cacheAs(t) {
      t !== this._cacheStyle.userSetCache &amp;&amp;
        ((this.mask &amp;&amp; "normal" === t) ||
          (this._setCacheAs(t),
          (this._getCacheStyle().userSetCache = t),
          this._checkCanvasEnable(),
          this.repaint()));
    }
    _checkCanvasEnable() {
      var t = this._cacheStyle.needEnableCanvasRender();
      (this._getCacheStyle().enableCanvasRender = t),
        t
          ? (this._cacheStyle.needBitmapCache()
              ? (this._cacheStyle.cacheAs = "bitmap")
              : (this._cacheStyle.cacheAs = this._cacheStyle.userSetCache),
            (this._cacheStyle.reCache = !0),
            (this._renderType |= ge.CANVAS))
          : ((this._cacheStyle.cacheAs = "none"),
            this._cacheStyle.releaseContext(),
            (this._renderType &amp;= ~ge.CANVAS)),
        this._setCacheAs(this._cacheStyle.cacheAs),
        this._setRenderType(this._renderType);
    }
    get staticCache() {
      return this._cacheStyle.staticCache;
    }
    set staticCache(t) {
      (this._getCacheStyle().staticCache = t), t || this.reCache();
    }
    reCache() {
      (this._cacheStyle.reCache = !0), (this._repaint |= ge.REPAINT_CACHE);
    }
    getRepaint() {
      return this._repaint;
    }
    _setX(t) {
      this._x = t;
    }
    _setY(t) {
      this._y = t;
    }
    _setWidth(t, e) {}
    _setHeight(t, e) {}
    get x() {
      return this._x;
    }
    set x(t) {
      if (!this.destroyed &amp;&amp; this._x !== t) {
        this._setX(t), this.parentRepaint(ge.REPAINT_CACHE);
        var e = this._cacheStyle.maskParent;
        e &amp;&amp; e.repaint(ge.REPAINT_CACHE);
      }
    }
    get y() {
      return this._y;
    }
    set y(t) {
      if (!this.destroyed &amp;&amp; this._y !== t) {
        this._setY(t), this.parentRepaint(ge.REPAINT_CACHE);
        var e = this._cacheStyle.maskParent;
        e &amp;&amp; e.repaint(ge.REPAINT_CACHE);
      }
    }
    get width() {
      return this.get_width();
    }
    set width(t) {
      this.set_width(t);
    }
    set_width(t) {
      this._width !== t &amp;&amp;
        ((this._width = t),
        this._setWidth(this.texture, t),
        this._setTranformChange());
    }
    get_width() {
      return this.autoSize
        ? this.texture
          ? this.texture.width
          : this._graphics || 0 !== this._children.length
            ? this.getSelfBounds().width
            : 0
        : this._width || (this.texture ? this.texture.width : 0);
    }
    get height() {
      return this.get_height();
    }
    set height(t) {
      this.set_height(t);
    }
    set_height(t) {
      this._height !== t &amp;&amp;
        ((this._height = t),
        this._setHeight(this.texture, t),
        this._setTranformChange());
    }
    get_height() {
      return this.autoSize
        ? this.texture
          ? this.texture.height
          : this._graphics || 0 !== this._children.length
            ? this.getSelfBounds().height
            : 0
        : this._height || (this.texture ? this.texture.height : 0);
    }
    get displayWidth() {
      return this.width * this.scaleX;
    }
    get displayHeight() {
      return this.height * this.scaleY;
    }
    setSelfBounds(t) {
      this._getBoundsStyle().userBounds = t;
    }
    getBounds() {
      return (this._getBoundsStyle().bounds = m._getWrapRec(
        this._boundPointsToParent(),
      ));
    }
    getSelfBounds() {
      return this._boundStyle &amp;&amp; this._boundStyle.userBounds
        ? this._boundStyle.userBounds
        : this._graphics || 0 !== this._children.length || this._texture
          ? (this._getBoundsStyle().bounds = m._getWrapRec(
              this._getBoundPointsM(!1),
            ))
          : m.TEMP.setTo(0, 0, this.width, this.height);
    }
    _boundPointsToParent(t = !1) {
      var e = 0,
        i = 0;
      this._style &amp;&amp;
        ((e = this.pivotX),
        (i = this.pivotY),
        (t = t || 0 !== this._style.rotation),
        this._style.scrollRect &amp;&amp;
          ((e += this._style.scrollRect.x), (i += this._style.scrollRect.y)));
      var s = this._getBoundPointsM(t);
      if (!s || s.length &lt; 1) return s;
      if (
        (8 != s.length &amp;&amp;
          (s = t
            ? _t.scanPList(s)
            : m._getWrapRec(s, m.TEMP)._getBoundPoints()),
        !this.transform)
      )
        return J.transPointList(s, this._x - e, this._y - i), s;
      var r,
        a = f.TEMP,
        n = s.length;
      for (r = 0; r &lt; n; r += 2)
        (a.x = s[r]),
          (a.y = s[r + 1]),
          this.toParentPoint(a),
          (s[r] = a.x),
          (s[r + 1] = a.y);
      return s;
    }
    getGraphicBounds(t = !1) {
      return this._graphics
        ? this._graphics.getBounds(t)
        : m.TEMP.setTo(0, 0, 0, 0);
    }
    _getBoundPointsM(t = !1) {
      if (this._boundStyle &amp;&amp; this._boundStyle.userBounds)
        return this._boundStyle.userBounds._getBoundPoints();
      if (
        (this._boundStyle || this._getBoundsStyle(),
        this._boundStyle.temBM || (this._boundStyle.temBM = []),
        this._style.scrollRect)
      ) {
        var e = J.clearArray(this._boundStyle.temBM),
          i = m.TEMP;
        return (
          i.copyFrom(this._style.scrollRect),
          J.concatArray(e, i._getBoundPoints()),
          e
        );
      }
      var s, r, a, n;
      (s = this._graphics
        ? this._graphics.getBoundPoints()
        : J.clearArray(this._boundStyle.temBM)),
        this._texture &amp;&amp;
          ((i = m.TEMP).setTo(
            0,
            0,
            this.width || this._texture.width,
            this.height || this._texture.height,
          ),
          J.concatArray(s, i._getBoundPoints()));
      for (var h = 0, o = (n = this._children).length; h &lt; o; h++)
        (r = n[h]) instanceof Be &amp;&amp;
          !0 === r._visible &amp;&amp;
          (a = r._boundPointsToParent(t)) &amp;&amp;
          (s = s ? J.concatArray(s, a) : a);
      return s;
    }
    _getCacheStyle() {
      return (
        this._cacheStyle === Pe.EMPTY &amp;&amp; (this._cacheStyle = Pe.create()),
        this._cacheStyle
      );
    }
    getStyle() {
      return (
        this._style === Le.EMPTY &amp;&amp; (this._style = Le.create()), this._style
      );
    }
    setStyle(t) {
      this._style = t;
    }
    get scaleX() {
      return this._style.scaleX;
    }
    set scaleX(t) {
      this.set_scaleX(t);
    }
    _setScaleX(t) {
      this._style.scaleX = t;
    }
    get scaleY() {
      return this._style.scaleY;
    }
    set scaleY(t) {
      this.set_scaleY(t);
    }
    _setScaleY(t) {
      this._style.scaleY = t;
    }
    set_scaleX(t) {
      this.getStyle().scaleX !== t &amp;&amp;
        (this._setScaleX(t), this._setTranformChange());
    }
    get_scaleX() {
      return this._style.scaleX;
    }
    set_scaleY(t) {
      this.getStyle().scaleY !== t &amp;&amp;
        (this._setScaleY(t), this._setTranformChange());
    }
    get_scaleY() {
      return this._style.scaleY;
    }
    get rotation() {
      return this._style.rotation;
    }
    set rotation(t) {
      this.getStyle().rotation !== t &amp;&amp;
        (this._setRotation(t), this._setTranformChange());
    }
    _setRotation(t) {
      this._style.rotation = t;
    }
    get skewX() {
      return this._style.skewX;
    }
    set skewX(t) {
      this.getStyle().skewX !== t &amp;&amp;
        (this._setSkewX(t), this._setTranformChange());
    }
    _setSkewX(t) {
      this._style.skewX = t;
    }
    get skewY() {
      return this._style.skewY;
    }
    set skewY(t) {
      this.getStyle().skewY !== t &amp;&amp;
        (this._setSkewY(t), this._setTranformChange());
    }
    _setSkewY(t) {
      this._style.skewY = t;
    }
    _createTransform() {
      return p.create();
    }
    _adjustTransform() {
      this._tfChanged = !1;
      var t = this._style,
        e = t.scaleX,
        i = t.scaleY,
        s = t.skewX,
        r = t.skewY,
        a = t.rotation,
        n = this._transform || (this._transform = this._createTransform());
      if (a || 1 !== e || 1 !== i || 0 !== s || 0 !== r) {
        n._bTransform = !0;
        var h = 0.0174532922222222 * (a - s),
          o = 0.0174532922222222 * (a + r),
          l = Math.cos(o),
          _ = Math.sin(o),
          u = Math.sin(h),
          c = Math.cos(h);
        (n.a = e * l),
          (n.b = e * _),
          (n.c = -i * u),
          (n.d = i * c),
          (n.tx = n.ty = 0);
      } else
        n.identity(),
          (this._renderType &amp;= ~ge.TRANSFORM),
          this._setRenderType(this._renderType);
      return n;
    }
    _setTransform(t) {}
    get transform() {
      return this._tfChanged ? this._adjustTransform() : this._transform;
    }
    set transform(t) {
      this.set_transform(t);
    }
    get_transform() {
      return this._tfChanged ? this._adjustTransform() : this._transform;
    }
    set_transform(t) {
      this._tfChanged = !1;
      var e = this._transform || (this._transform = this._createTransform());
      t.copyTo(e),
        this._setTransform(e),
        t &amp;&amp; ((this._x = e.tx), (this._y = e.ty), (e.tx = e.ty = 0)),
        t
          ? (this._renderType |= ge.TRANSFORM)
          : (this._renderType &amp;= ~ge.TRANSFORM),
        this._setRenderType(this._renderType),
        this.parentRepaint();
    }
    _setPivotX(t) {
      this.getStyle().pivotX = t;
    }
    _getPivotX() {
      return this._style.pivotX;
    }
    _setPivotY(t) {
      this.getStyle().pivotY = t;
    }
    _getPivotY() {
      return this._style.pivotY;
    }
    get pivotX() {
      return this._getPivotX();
    }
    set pivotX(t) {
      this._setPivotX(t), this.repaint();
    }
    get pivotY() {
      return this._getPivotY();
    }
    set pivotY(t) {
      this._setPivotY(t), this.repaint();
    }
    _setAlpha(t) {
      this._style.alpha !== t &amp;&amp;
        ((this.getStyle().alpha = t),
        1 !== t
          ? (this._renderType |= ge.ALPHA)
          : (this._renderType &amp;= ~ge.ALPHA),
        this._setRenderType(this._renderType),
        this.parentRepaint());
    }
    _getAlpha() {
      return this._style.alpha;
    }
    get alpha() {
      return this._getAlpha();
    }
    set alpha(t) {
      (t = t &lt; 0 ? 0 : t &gt; 1 ? 1 : t), this._setAlpha(t);
    }
    get visible() {
      return this.get_visible();
    }
    set visible(t) {
      this.set_visible(t);
    }
    get_visible() {
      return this._visible;
    }
    set_visible(t) {
      this._visible !== t &amp;&amp;
        ((this._visible = t), this.parentRepaint(ge.REPAINT_ALL));
    }
    _setBlendMode(t) {}
    get blendMode() {
      return this._style.blendMode;
    }
    set blendMode(t) {
      this._setBlendMode(t),
        (this.getStyle().blendMode = t),
        t &amp;&amp; "source-over" != t
          ? (this._renderType |= ge.BLEND)
          : (this._renderType &amp;= ~ge.BLEND),
        this._setRenderType(this._renderType),
        this.parentRepaint();
    }
    get graphics() {
      return (
        this._graphics ||
          ((this.graphics = new Re()), (this._graphics.autoDestroy = !0)),
        this._graphics
      );
    }
    _setGraphics(t) {}
    _setGraphicsCallBack() {}
    set graphics(t) {
      this._graphics &amp;&amp; (this._graphics._sp = null),
        (this._graphics = t),
        t
          ? (this._setGraphics(t),
            (this._renderType |= ge.GRAPHICS),
            (t._sp = this))
          : (this._renderType &amp;= ~ge.GRAPHICS),
        this._setRenderType(this._renderType),
        this.repaint();
    }
    get scrollRect() {
      return this._style.scrollRect;
    }
    _setScrollRect(t) {}
    set scrollRect(t) {
      (this.getStyle().scrollRect = t),
        this._setScrollRect(t),
        this.repaint(),
        t ? (this._renderType |= ge.CLIP) : (this._renderType &amp;= ~ge.CLIP),
        this._setRenderType(this._renderType);
    }
    pos(t, e, i = !1) {
      if (this._x !== t || this._y !== e) {
        if (this.destroyed) return this;
        if (i) {
          this._setX(t), this._setY(e), this.parentRepaint(ge.REPAINT_CACHE);
          var s = this._cacheStyle.maskParent;
          s &amp;&amp; s.repaint(ge.REPAINT_CACHE);
        } else (this.x = t), (this.y = e);
      }
      return this;
    }
    pivot(t, e) {
      return (this.pivotX = t), (this.pivotY = e), this;
    }
    size(t, e) {
      return (this.width = t), (this.height = e), this;
    }
    scale(t, e, i = !1) {
      var s = this.getStyle();
      if (s.scaleX != t || s.scaleY != e) {
        if (this.destroyed) return this;
        i
          ? (this._setScaleX(t), this._setScaleY(e), this._setTranformChange())
          : ((this.scaleX = t), (this.scaleY = e));
      }
      return this;
    }
    skew(t, e) {
      return (this.skewX = t), (this.skewY = e), this;
    }
    render(t, e, i) {
      be.renders[this._renderType]._fun(this, t, e + this._x, i + this._y),
        (this._repaint = 0);
    }
    drawToCanvas(t, e, i, s) {
      return Be.drawToCanvas(this, this._renderType, t, e, i, s);
    }
    drawToTexture(t, e, i, s, r = null) {
      return Be.drawToTexture(this, this._renderType, t, e, i, s, r);
    }
    drawToTexture3D(t, e, i) {
      throw "not implement";
    }
    static drawToCanvas(t, e, i, s, r, a) {
      (r -= t.x), (a -= t.y), (r |= 0), (a |= 0), (i |= 0), (s |= 0);
      var n = new oe();
      n.size(i, s),
        (n.asBitmap = !0),
        n._targets.start(),
        n._targets.clear(0, 0, 0, 0),
        be.renders[e]._fun(t, n, r, a),
        n.flush(),
        n._targets.end(),
        n._targets.restore();
      var h = n._targets.getData(0, 0, i, s);
      n.destroy();
      for (
        var o = new ImageData(i, s),
          l = 4 * i,
          _ = o.data,
          u = s - 1,
          c = u * l,
          d = 0;
        u &gt;= 0;
        u--
      )
        _.set(h.subarray(d, d + l), c), (c -= l), (d += l);
      var p = new Se(!0);
      return p.size(i, s), p.getContext("2d").putImageData(o, 0, 0), p;
    }
    static drawToTexture(t, e, i, s, r, a, n = null) {
      Be.drawtocanvCtx || (Be.drawtocanvCtx = new oe()),
        (r -= t.x),
        (a -= t.y),
        (r |= 0),
        (a |= 0),
        (i |= 0),
        (s |= 0);
      var h = n ? Be.drawtocanvCtx : new oe();
      if (
        (h.clear(),
        h.size(i, s),
        n ? (h._targets = n) : (h.asBitmap = !0),
        h._targets &amp;&amp;
          (h._targets.start(),
          h._targets.clear(0, 0, 0, 0),
          be.renders[e]._fun(t, h, r, a),
          h.flush(),
          h._targets.end(),
          h._targets.restore()),
        !n)
      ) {
        var o = new Jt(h._targets, Jt.INV_UV);
        return h.destroy(!0), o;
      }
      return (t._repaint = 0), n;
    }
    customRender(t, e, i) {
      this._repaint = ge.REPAINT_ALL;
    }
    _applyFilters() {}
    get filters() {
      return this._cacheStyle.filters;
    }
    _setColorFilter(t) {}
    set filters(t) {
      t &amp;&amp; 0 === t.length &amp;&amp; (t = null),
        (this._getCacheStyle().filters = t ? t.slice() : null),
        t &amp;&amp; t.length
          ? (this._setColorFilter(t[0]), (this._renderType |= ge.FILTERS))
          : (this._setColorFilter(null), (this._renderType &amp;= ~ge.FILTERS)),
        this._setRenderType(this._renderType),
        t &amp;&amp; t.length &gt; 0
          ? (this._getBit(Ce.DISPLAY) || this._setBitUp(Ce.DISPLAY),
            (1 == t.length &amp;&amp; t[0] instanceof et) ||
              ((this._getCacheStyle().cacheForFilters = !0),
              this._checkCanvasEnable()))
          : this._cacheStyle.cacheForFilters &amp;&amp;
            ((this._cacheStyle.cacheForFilters = !1),
            this._checkCanvasEnable()),
        (this._getCacheStyle().hasGlowFilter = this._isHaveGlowFilter()),
        this.repaint();
    }
    _isHaveGlowFilter() {
      var t, e;
      if (this.filters)
        for (t = 0; t &lt; this.filters.length; t++)
          if (this.filters[t].type == $.GLOW) return !0;
      for (t = 0, e = this._children.length; t &lt; e; t++)
        if (this._children[t]._isHaveGlowFilter()) return !0;
      return !1;
    }
    localToGlobal(t, e = !1, s = null) {
      !0 === e &amp;&amp; (t = new f(t.x, t.y));
      var r = this;
      for (s = s || i.stage; r &amp;&amp; !r.destroyed &amp;&amp; r != s; )
        (t = r.toParentPoint(t)), (r = r.parent);
      return t;
    }
    globalToLocal(t, e = !1, s = null) {
      e &amp;&amp; (t = new f(t.x, t.y));
      var r = this,
        a = [];
      for (s = s || i.stage; r &amp;&amp; !r.destroyed &amp;&amp; r != s; )
        a.push(r), (r = r.parent);
      for (var n = a.length - 1; n &gt;= 0; )
        (t = (r = a[n]).fromParentPoint(t)), n--;
      return t;
    }
    toParentPoint(t) {
      if (!t) return t;
      (t.x -= this.pivotX),
        (t.y -= this.pivotY),
        this.transform &amp;&amp; this._transform.transformPoint(t),
        (t.x += this._x),
        (t.y += this._y);
      var e = this._style.scrollRect;
      return e &amp;&amp; ((t.x -= e.x), (t.y -= e.y)), t;
    }
    fromParentPoint(t) {
      if (!t) return t;
      (t.x -= this._x), (t.y -= this._y);
      var e = this._style.scrollRect;
      return (
        e &amp;&amp; ((t.x += e.x), (t.y += e.y)),
        this.transform &amp;&amp; this._transform.invertTransformPoint(t),
        (t.x += this.pivotX),
        (t.y += this.pivotY),
        t
      );
    }
    fromStagePoint(t) {
      return t;
    }
    on(t, e, i, s = null) {
      return 1 !== this._mouseState &amp;&amp; this.isMouseEvent(t)
        ? ((this.mouseEnabled = !0),
          this._setBit(Ce.HAS_MOUSE, !0),
          this._parent &amp;&amp; this._onDisplay(),
          this._createListener(t, e, i, s, !1))
        : super.on(t, e, i, s);
    }
    once(t, e, i, s = null) {
      return 1 !== this._mouseState &amp;&amp; this.isMouseEvent(t)
        ? ((this.mouseEnabled = !0),
          this._setBit(Ce.HAS_MOUSE, !0),
          this._parent &amp;&amp; this._onDisplay(),
          this._createListener(t, e, i, s, !0))
        : super.once(t, e, i, s);
    }
    _onDisplay(t) {
      if (1 !== this._mouseState) {
        var e = this;
        for (
          e = e.parent;
          e &amp;&amp; 1 !== e._mouseState &amp;&amp; !e._getBit(Ce.HAS_MOUSE);

        )
          (e.mouseEnabled = !0), e._setBit(Ce.HAS_MOUSE, !0), (e = e.parent);
      }
    }
    _setParent(t) {
      super._setParent(t), t &amp;&amp; this._getBit(Ce.HAS_MOUSE) &amp;&amp; this._onDisplay();
    }
    loadImage(t, e = null) {
      if (t) {
        var s = i.Loader.textureMap[I.formatURL(t)];
        s || ((s = new Jt()).load(t), i.Loader.cacheTexture(t, s)),
          (this.texture = s),
          s.getIsReady() ? loaded.call(this) : s.once($t.READY, this, loaded);
      } else (this.texture = null), loaded.call(this);
      function loaded() {
        this.repaint(ge.REPAINT_ALL), e &amp;&amp; e.run();
      }
      return this;
    }
    static fromImage(t) {
      return new Be().loadImage(t);
    }
    repaint(t = ge.REPAINT_CACHE) {
      this._repaint &amp; t || ((this._repaint |= t), this.parentRepaint(t)),
        this._cacheStyle &amp;&amp;
          this._cacheStyle.maskParent &amp;&amp;
          this._cacheStyle.maskParent.repaint(t);
    }
    _needRepaint() {
      return (
        this._repaint &amp; ge.REPAINT_CACHE &amp;&amp;
        this._cacheStyle.enableCanvasRender &amp;&amp;
        this._cacheStyle.reCache
      );
    }
    _childChanged(t = null) {
      this._children.length
        ? (this._renderType |= ge.CHILDS)
        : (this._renderType &amp;= ~ge.CHILDS),
        this._setRenderType(this._renderType),
        t &amp;&amp;
          this._getBit(Ce.HAS_ZORDER) &amp;&amp;
          i.systemTimer.callLater(this, this.updateZOrder),
        this.repaint(ge.REPAINT_ALL);
    }
    parentRepaint(t = ge.REPAINT_CACHE) {
      var e = this._parent;
      !e || e._repaint &amp; t || ((e._repaint |= t), e.parentRepaint(t));
    }
    get stage() {
      return i.stage;
    }
    get hitArea() {
      return this._style.hitArea;
    }
    set hitArea(t) {
      this.getStyle().hitArea = t;
    }
    _setMask(t) {}
    get mask() {
      return this._cacheStyle.mask;
    }
    set mask(t) {
      (t &amp;&amp; this.mask &amp;&amp; this.mask._cacheStyle.maskParent) ||
        ((this._getCacheStyle().mask = t),
        this._setMask(t),
        this._checkCanvasEnable(),
        t
          ? (t._getCacheStyle().maskParent = this)
          : this.mask &amp;&amp; (this.mask._getCacheStyle().maskParent = null),
        (this._renderType |= ge.MASK),
        this._setRenderType(this._renderType),
        this.parentRepaint(ge.REPAINT_ALL));
    }
    get mouseEnabled() {
      return this._mouseState &gt; 1;
    }
    set mouseEnabled(t) {
      this._mouseState = t ? 2 : 1;
    }
    startDrag(t = null, e = !1, s = 0, r = 300, a = null, n = !1, h = 0.92) {
      this._style.dragging || (this.getStyle().dragging = new i.Dragging()),
        this._style.dragging.start(this, t, e, s, r, a, n, h);
    }
    stopDrag() {
      this._style.dragging &amp;&amp; this._style.dragging.stop();
    }
    _setDisplay(t) {
      t ||
        (this._cacheStyle &amp;&amp;
          (this._cacheStyle.releaseContext(),
          this._cacheStyle.releaseFilterCache(),
          this._cacheStyle.hasGlowFilter &amp;&amp;
            (this._cacheStyle.hasGlowFilter = !1))),
        super._setDisplay(t);
    }
    hitTestPoint(t, e) {
      var i = this.globalToLocal(f.TEMP.setTo(t, e));
      return (
        (t = i.x),
        (e = i.y),
        (this._style.hitArea
          ? this._style.hitArea
          : this._width &gt; 0 &amp;&amp; this._height &gt; 0
            ? m.TEMP.setTo(0, 0, this._width, this._height)
            : this.getSelfBounds()
        ).contains(t, e)
      );
    }
    getMousePoint() {
      return this.globalToLocal(f.TEMP.setTo(i.stage.mouseX, i.stage.mouseY));
    }
    get globalScaleX() {
      for (var t = 1, e = this; e &amp;&amp; e !== i.stage; )
        (t *= e.scaleX), (e = e.parent);
      return t;
    }
    get globalRotation() {
      for (var t = 0, e = this; e &amp;&amp; e !== i.stage; )
        (t += e.rotation), (e = e.parent);
      return t;
    }
    get globalScaleY() {
      for (var t = 1, e = this; e &amp;&amp; e !== i.stage; )
        (t *= e.scaleY), (e = e.parent);
      return t;
    }
    get mouseX() {
      return this.getMousePoint().x;
    }
    get mouseY() {
      return this.getMousePoint().y;
    }
    get zOrder() {
      return this._zOrder;
    }
    set zOrder(t) {
      this._zOrder != t &amp;&amp;
        ((this._zOrder = t),
        this._parent &amp;&amp;
          (t &amp;&amp; this._parent._setBit(Ce.HAS_ZORDER, !0),
          i.systemTimer.callLater(this._parent, this.updateZOrder)));
    }
    get texture() {
      return this._texture;
    }
    _setTexture(t) {}
    set texture(t) {
      "string" == typeof t
        ? this.loadImage(t)
        : this._texture != t &amp;&amp;
          (this._texture &amp;&amp; this._texture._removeReference(),
          (this._texture = t),
          t &amp;&amp; t._addReference(),
          this._setTexture(t),
          this._setWidth(this._texture, this.width),
          this._setHeight(this._texture, this.height),
          t
            ? (this._renderType |= ge.TEXTURE)
            : (this._renderType &amp;= ~ge.TEXTURE),
          this._setRenderType(this._renderType),
          this.repaint());
    }
    get viewport() {
      return this._style.viewport;
    }
    set viewport(t) {
      var e;
      "string" == typeof t &amp;&amp;
        (e = t.split(",")).length &gt; 3 &amp;&amp;
        (t = new m(
          parseFloat(e[0]),
          parseFloat(e[1]),
          parseFloat(e[2]),
          parseFloat(e[3]),
        ));
      this.getStyle().viewport = t;
    }
    _setRenderType(t) {}
    _setTranformChange() {
      (this._tfChanged = !0),
        (this._renderType |= ge.TRANSFORM),
        this.parentRepaint(ge.REPAINT_CACHE);
    }
    _setBgStyleColor(t, e, i, s, r) {}
    _setBorderStyleColor(t, e, i, s, r, a) {}
    captureMouseEvent(t) {
      i.MouseManager.instance.setCapture(this, t);
    }
    releaseMouseEvent() {
      i.MouseManager.instance.releaseCapture();
    }
    set drawCallOptimize(t) {
      this._setBit(Ce.DRAWCALL_OPTIMIZE, t);
    }
    get drawCallOptimize() {
      return this._getBit(Ce.DRAWCALL_OPTIMIZE);
    }
  }
  Me.regClass("laya.display.Sprite", Be), Me.regClass("Laya.Sprite", Be);
  class Fe extends Le {
    constructor() {
      super(...arguments), (this.italic = !1);
    }
    reset() {
      return (
        super.reset(),
        (this.italic = !1),
        (this.align = "left"),
        (this.wordWrap = !1),
        (this.leading = 0),
        (this.padding = [0, 0, 0, 0]),
        (this.bgColor = null),
        (this.borderColor = null),
        (this.asPassword = !1),
        (this.stroke = 0),
        (this.strokeColor = "#000000"),
        (this.bold = !1),
        (this.underline = !1),
        (this.underlineColor = null),
        (this.currBitmapFont = null),
        this
      );
    }
    recover() {
      this !== Fe.EMPTY &amp;&amp; s.recover("TextStyle", this.reset());
    }
    static create() {
      return s.getItemByClass("TextStyle", Fe);
    }
    render(t, e, i, s) {
      (this.bgColor || this.borderColor) &amp;&amp;
        e.drawRect(
          i - this.pivotX,
          s - this.pivotY,
          t.width,
          t.height,
          this.bgColor,
          this.borderColor,
          1,
        );
    }
  }
  Fe.EMPTY = new Fe();
  class Oe extends Be {
    constructor() {
      super(),
        (this._textWidth = 0),
        (this._textHeight = 0),
        (this._lines = []),
        (this._lineWidths = []),
        (this._startX = 0),
        (this._startY = 0),
        (this._charSize = {}),
        (this._valign = "top"),
        (this._fontSize = Oe.defaultFontSize),
        (this._font = Oe.defaultFont),
        (this._color = "#000000"),
        (this._singleCharRender = !1),
        (this.overflow = Oe.VISIBLE),
        (this._style = Fe.EMPTY);
    }
    static defaultFontStr() {
      return Oe.defaultFontSize + "px " + Oe.defaultFont;
    }
    getStyle() {
      return (
        this._style === Fe.EMPTY &amp;&amp; (this._style = Fe.create()), this._style
      );
    }
    _getTextStyle() {
      return (
        this._style === Fe.EMPTY &amp;&amp; (this._style = Fe.create()), this._style
      );
    }
    static registerBitmapFont(t, e) {
      Oe._bitmapFonts || (Oe._bitmapFonts = {}), (Oe._bitmapFonts[t] = e);
    }
    static unregisterBitmapFont(t, e = !0) {
      if (Oe._bitmapFonts &amp;&amp; Oe._bitmapFonts[t]) {
        var i = Oe._bitmapFonts[t];
        e &amp;&amp; i.destroy(), delete Oe._bitmapFonts[t];
      }
    }
    destroy(t = !0) {
      super.destroy(t),
        (this._clipPoint = null),
        (this._lines = null),
        (this._lineWidths = null),
        this._words &amp;&amp;
          this._words.forEach(function (t) {
            t.cleanCache();
          }),
        (this._words = null),
        (this._charSize = null);
    }
    _getBoundPointsM(t = !1) {
      var e = m.TEMP;
      return e.setTo(0, 0, this.width, this.height), e._getBoundPoints();
    }
    getGraphicBounds(t = !1) {
      var e = m.TEMP;
      return e.setTo(0, 0, this.width, this.height), e;
    }
    get width() {
      return this._width
        ? this._width
        : this.textWidth + this.padding[1] + this.padding[3];
    }
    set width(t) {
      t != this._width &amp;&amp;
        (super.set_width(t),
        (this.isChanged = !0),
        this.borderColor &amp;&amp;
          this._setBorderStyleColor(
            0,
            0,
            this.width,
            this.height,
            this.borderColor,
            1,
          ));
    }
    _getCSSStyle() {
      return this._style;
    }
    get height() {
      return this._height ? this._height : this.textHeight;
    }
    set height(t) {
      t != this._height &amp;&amp;
        (super.set_height(t),
        (this.isChanged = !0),
        this.borderColor &amp;&amp;
          this._setBorderStyleColor(
            0,
            0,
            this.width,
            this.height,
            this.borderColor,
            1,
          ));
    }
    get textWidth() {
      return (
        this._isChanged &amp;&amp; i.systemTimer.runCallLater(this, this.typeset),
        this._textWidth
      );
    }
    get textHeight() {
      return (
        this._isChanged &amp;&amp; i.systemTimer.runCallLater(this, this.typeset),
        this._textHeight
      );
    }
    get text() {
      return this._text || "";
    }
    get_text() {
      return this._text || "";
    }
    set_text(t) {
      this._text !== t &amp;&amp;
        (this.lang(t + ""),
        (this.isChanged = !0),
        this.event($t.CHANGE),
        this.borderColor &amp;&amp;
          this._setBorderStyleColor(
            0,
            0,
            this.width,
            this.height,
            this.borderColor,
            1,
          ));
    }
    set text(t) {
      this.set_text(t);
    }
    lang(
      t,
      e = null,
      i = null,
      s = null,
      r = null,
      a = null,
      n = null,
      h = null,
      o = null,
      l = null,
      _ = null,
    ) {
      if (
        ((t = Oe.langPacks &amp;&amp; Oe.langPacks[t] ? Oe.langPacks[t] : t),
        arguments.length &lt; 2)
      )
        this._text = t;
      else {
        for (var u = 0, c = arguments.length; u &lt; c; u++)
          t = t.replace("{" + u + "}", arguments[u + 1]);
        this._text = t;
      }
    }
    get font() {
      return this._font;
    }
    set font(t) {
      this._style.currBitmapFont &amp;&amp;
        ((this._getTextStyle().currBitmapFont = null), this.scale(1, 1)),
        Oe._bitmapFonts &amp;&amp;
          Oe._bitmapFonts[t] &amp;&amp;
          (this._getTextStyle().currBitmapFont = Oe._bitmapFonts[t]),
        (this._font = t),
        (this.isChanged = !0);
    }
    get fontSize() {
      return this._fontSize;
    }
    set fontSize(t) {
      this._fontSize != t &amp;&amp; ((this._fontSize = t), (this.isChanged = !0));
    }
    get bold() {
      return this._style.bold;
    }
    set bold(t) {
      (this._getTextStyle().bold = t), (this.isChanged = !0);
    }
    get color() {
      return this._color;
    }
    set color(t) {
      this.set_color(t);
    }
    get_color() {
      return this._color;
    }
    set_color(t) {
      this._color != t &amp;&amp;
        ((this._color = t),
        !this._isChanged &amp;&amp; this._graphics
          ? this._graphics.replaceTextColor(this.color)
          : (this.isChanged = !0));
    }
    get italic() {
      return this._style.italic;
    }
    set italic(t) {
      (this._getTextStyle().italic = t), (this.isChanged = !0);
    }
    get align() {
      return this._style.align;
    }
    set align(t) {
      (this._getTextStyle().align = t), (this.isChanged = !0);
    }
    get valign() {
      return this._valign;
    }
    set valign(t) {
      (this._valign = t), (this.isChanged = !0);
    }
    get wordWrap() {
      return this._style.wordWrap;
    }
    set wordWrap(t) {
      (this._getTextStyle().wordWrap = t), (this.isChanged = !0);
    }
    get leading() {
      return this._style.leading;
    }
    set leading(t) {
      (this._getTextStyle().leading = t), (this.isChanged = !0);
    }
    get padding() {
      return this._style.padding;
    }
    set padding(t) {
      if ("string" == typeof t) {
        var e, i, s;
        for (s = (e = t.split(",")).length; e.length &lt; 4; ) e.push(0);
        for (i = 0; i &lt; s; i++) e[i] = parseFloat(e[i]) || 0;
        t = e;
      }
      (this._getTextStyle().padding = t), (this.isChanged = !0);
    }
    get bgColor() {
      return this._style.bgColor;
    }
    set bgColor(t) {
      this.set_bgColor(t);
    }
    set_bgColor(t) {
      (this._getTextStyle().bgColor = t),
        (this._renderType |= ge.STYLE),
        this._setBgStyleColor(0, 0, this.width, this.height, t),
        this._setRenderType(this._renderType),
        (this.isChanged = !0);
    }
    get_bgColor() {
      return this._style.bgColor;
    }
    get borderColor() {
      return this._style.borderColor;
    }
    set borderColor(t) {
      (this._getTextStyle().borderColor = t),
        (this._renderType |= ge.STYLE),
        this._setBorderStyleColor(0, 0, this.width, this.height, t, 1),
        this._setRenderType(this._renderType),
        (this.isChanged = !0);
    }
    get stroke() {
      return this._style.stroke;
    }
    set stroke(t) {
      (this._getTextStyle().stroke = t), (this.isChanged = !0);
    }
    get strokeColor() {
      return this._style.strokeColor;
    }
    set strokeColor(t) {
      (this._getTextStyle().strokeColor = t), (this.isChanged = !0);
    }
    set isChanged(t) {
      this._isChanged !== t &amp;&amp;
        ((this._isChanged = t),
        t &amp;&amp; i.systemTimer.callLater(this, this.typeset));
    }
    _getContextFont() {
      return (
        (this.italic ? "italic " : "") +
        (this.bold ? "bold " : "") +
        this.fontSize +
        "px " +
        ((i.Browser.onIPhone &amp;&amp; Oe.fontFamilyMap[this.font]) || this.font)
      );
    }
    _isPassWordMode() {
      var t = this._style.asPassword;
      return "prompt" in this &amp;&amp; this.prompt == this._text &amp;&amp; (t = !1), t;
    }
    _getPassWordTxt(t) {
      var e;
      e = "";
      for (var i = t.length; i &gt; 0; i--) e += "â—";
      return e;
    }
    _renderText() {
      var t = this.padding,
        e = this._lines.length;
      this.overflow != Oe.VISIBLE &amp;&amp;
        (e = Math.min(
          e,
          Math.floor(
            (this.height - t[0] - t[2]) /
              (this.leading + this._charSize.height),
          ) + 1,
        ));
      var s = (this.scrollY / (this._charSize.height + this.leading)) | 0,
        r = this.graphics;
      r.clear(!0);
      var a = this._getContextFont();
      i.Browser.context.font = a;
      var n = t[3],
        h = "left",
        o = this._lines,
        l = this.leading + this._charSize.height,
        _ = this._style.currBitmapFont;
      _ &amp;&amp; (l = this.leading + _.getMaxHeight());
      var u = t[0];
      !_ &amp;&amp;
        this._width &gt; 0 &amp;&amp;
        this._textWidth &lt;= this._width &amp;&amp;
        ("right" == this.align
          ? ((h = "right"), (n = this._width - t[1]))
          : "center" == this.align &amp;&amp;
            ((h = "center"), (n = 0.5 * this._width + t[3] - t[1])));
      let c = 1;
      if (
        (_ &amp;&amp; _.autoScaleSize &amp;&amp; (c = _.fontSize / this.fontSize),
        this._height &gt; 0)
      ) {
        var d = this._textHeight &gt; this._height ? "top" : this.valign;
        "middle" === d
          ? (u = 0.5 * (this._height - (e / c) * l) + t[0] - t[2])
          : "bottom" === d &amp;&amp; (u = this._height - (e / c) * l - t[2]);
      }
      if (this._clipPoint) {
        var p, f;
        if ((r.save(), _ &amp;&amp; _.autoScaleSize))
          (p = this._width ? this._width - t[3] - t[1] : this._textWidth),
            (f = this._height ? this._height - t[0] - t[2] : this._textHeight),
            (p *= c),
            (f *= c),
            r.clipRect(t[3], t[0], p, f);
        else
          r.clipRect(
            t[3],
            t[0],
            this._width ? this._width - t[3] - t[1] : this._textWidth,
            this._height ? this._height - t[0] - t[2] : this._textHeight,
          );
        this.repaint();
      }
      var m = this._style,
        g = m.asPassword;
      "prompt" in this &amp;&amp; this.prompt == this._text &amp;&amp; (g = !1);
      for (
        var T = 0, v = 0, x = Math.min(this._lines.length, e + s) || 1, y = s;
        y &lt; x;
        y++
      ) {
        var E,
          R = o[y];
        if (g) {
          let t = R.length;
          R = "";
          for (var C = t; C &gt; 0; C--) R += "â—";
        }
        if (
          (null == R &amp;&amp; (R = ""),
          (T = n - (this._clipPoint ? this._clipPoint.x : 0)),
          (v = u + 2 + l * y - (this._clipPoint ? this._clipPoint.y : 0)),
          this.underline &amp;&amp; this._drawUnderline(h, T, v, y),
          _)
        ) {
          var A = this.width;
          _.autoScaleSize &amp;&amp; ((A = this.width * c), (T *= c), (v *= c)),
            _._drawText(R, this, T, v, this.align, A);
        } else
          this._words || (this._words = []),
            this._words.length &gt; y - s
              ? (E = this._words[y - s])
              : ((E = new ee()), this._words.push(E)),
            E.setText(R),
            (E.splitRender = this._singleCharRender),
            m.stroke
              ? r.fillBorderText(
                  E,
                  T,
                  v,
                  a,
                  this.color,
                  h,
                  m.stroke,
                  m.strokeColor,
                )
              : r.fillText(E, T, v, a, this.color, h);
      }
      if (_ &amp;&amp; _.autoScaleSize) {
        var b = 1 / c;
        this.scale(b, b);
      }
      this._clipPoint &amp;&amp; r.restore(), (this._startX = n), (this._startY = u);
    }
    _drawUnderline(t, e, i, s) {
      var r = this._lineWidths[s];
      switch (t) {
        case "center":
          e -= r / 2;
          break;
        case "right":
          e -= r;
      }
      (i += this._charSize.height),
        this._graphics.drawLine(
          e,
          i,
          e + r,
          i,
          this.underlineColor || this.color,
          1,
        );
    }
    typeset() {
      if (((this._isChanged = !1), !this._text))
        return (
          (this._clipPoint = null),
          (this._textWidth = this._textHeight = 0),
          void this.graphics.clear(!0)
        );
      i.Render.isConchApp
        ? (window.conchTextCanvas.font = this._getContextFont())
        : (i.Browser.context.font = this._getContextFont()),
        (this._lines.length = 0),
        (this._lineWidths.length = 0),
        this._isPassWordMode()
          ? this._parseLines(this._getPassWordTxt(this._text))
          : this._parseLines(this._text),
        this._evalTextSize(),
        this._checkEnabledViewportOrNot()
          ? this._clipPoint || (this._clipPoint = new f(0, 0))
          : (this._clipPoint = null),
        this._renderText();
    }
    _evalTextSize() {
      var t, e;
      t = Math.max.apply(this, this._lineWidths);
      let i = this._style.currBitmapFont;
      if (i) {
        let t = i.getMaxHeight();
        i.autoScaleSize &amp;&amp; (t = this.fontSize),
          (e =
            this._lines.length * (t + this.leading) +
            this.padding[0] +
            this.padding[2]);
      } else
        (e =
          this._lines.length * (this._charSize.height + this.leading) +
          this.padding[0] +
          this.padding[2]),
          this._lines.length &amp;&amp; (e -= this.leading);
      (t == this._textWidth &amp;&amp; e == this._textHeight) ||
        ((this._textWidth = t), (this._textHeight = e));
    }
    _checkEnabledViewportOrNot() {
      return (
        this.overflow == Oe.SCROLL &amp;&amp;
        ((this._width &gt; 0 &amp;&amp; this._textWidth &gt; this._width) ||
          (this._height &gt; 0 &amp;&amp; this._textHeight &gt; this._height))
      );
    }
    changeText(t) {
      this._text !== t &amp;&amp;
        (this.lang(t + ""),
        (this._graphics &amp;&amp; this._graphics.replaceText(this._text)) ||
          this.typeset());
    }
    _parseLines(t) {
      var e = this.wordWrap || this.overflow == Oe.HIDDEN;
      if (e) var s = this._getWordWrapWidth();
      var r = this._style.currBitmapFont;
      if (r)
        (this._charSize.width = r.getMaxWidth()),
          (this._charSize.height = r.getMaxHeight());
      else {
        var a = null;
        (a = i.Render.isConchApp
          ? window.conchTextCanvas.measureText(Oe._testWord)
          : i.Browser.context.measureText(Oe._testWord)) ||
          (a = { width: 100 }),
          (this._charSize.width = a.width),
          (this._charSize.height = a.height || this.fontSize);
      }
      for (
        var n = t.replace(/\r\n/g, "\n").split("\n"), h = 0, o = n.length;
        h &lt; o;
        h++
      ) {
        var l = n[h];
        e
          ? this._parseLine(l, s)
          : (this._lineWidths.push(this._getTextWidth(l)), this._lines.push(l));
      }
    }
    _parseLine(t, e) {
      var i = this._lines,
        s = 0,
        r = 0,
        a = 0,
        n = 0;
      if ((r = this._getTextWidth(t)) &lt;= e)
        return i.push(t), void this._lineWidths.push(r);
      (r = this._charSize.width),
        0 == (s = Math.floor(e / r)) &amp;&amp; (s = 1),
        (a = r = this._getTextWidth(t.substring(0, s)));
      for (var h = s, o = t.length; h &lt; o; h++)
        if ((a += r = this._getTextWidth(t.charAt(h))) &gt; e)
          if (this.wordWrap) {
            var l = t.substring(n, h),
              _ = l.charCodeAt(l.length - 1);
            if (_ &lt; 19968 || _ &gt; 40869) {
              var u = /(?:[^\s\!-\/])+$/.exec(l);
              u &amp;&amp;
                ((h = u.index + n),
                0 == u.index ? (h += l.length) : (l = t.substring(n, h)));
            }
            if (
              (i.push(l), this._lineWidths.push(a - r), (n = h), !(h + s &lt; o))
            ) {
              i.push(t.substring(n, o)),
                this._lineWidths.push(this._getTextWidth(i[i.length - 1])),
                (n = -1);
              break;
            }
            (h += s), (a = r = this._getTextWidth(t.substring(n, h))), h--;
          } else if (this.overflow == Oe.HIDDEN)
            return (
              i.push(t.substring(0, h)),
              void this._lineWidths.push(this._getTextWidth(i[i.length - 1]))
            );
      this.wordWrap &amp;&amp;
        -1 != n &amp;&amp;
        (i.push(t.substring(n, o)),
        this._lineWidths.push(this._getTextWidth(i[i.length - 1])));
    }
    _getTextWidth(t) {
      var e = this._style.currBitmapFont;
      if (e) return e.getTextWidth(t);
      if (i.Render.isConchApp)
        return window.conchTextCanvas.measureText(t).width;
      return (i.Browser.context.measureText(t) || { width: 100 }).width;
    }
    _getWordWrapWidth() {
      var t,
        e = this.padding,
        s = this._style.currBitmapFont;
      return (
        (t =
          s &amp;&amp; s.autoScaleSize
            ? this._width * (s.fontSize / this.fontSize)
            : this._width) &lt;= 0 &amp;&amp; (t = this.wordWrap ? 100 : i.Browser.width),
        t &lt;= 0 &amp;&amp; (t = 100),
        t - e[3] - e[1]
      );
    }
    getCharPoint(t, e = null) {
      this._isChanged &amp;&amp; i.systemTimer.runCallLater(this, this.typeset);
      for (var s = 0, r = this._lines, a = 0, n = 0, h = r.length; n &lt; h; n++) {
        if (t &lt; (s += r[n].length)) {
          var o = n;
          break;
        }
        a = s;
      }
      var l =
        (this.italic ? "italic " : "") +
        (this.bold ? "bold " : "") +
        this.fontSize +
        "px " +
        this.font;
      i.Browser.context.font = l;
      var _ = this._getTextWidth(this._text.substring(a, t));
      return (e || new f()).setTo(
        this._startX + _ - (this._clipPoint ? this._clipPoint.x : 0),
        this._startY +
          o * (this._charSize.height + this.leading) -
          (this._clipPoint ? this._clipPoint.y : 0),
      );
    }
    set scrollX(t) {
      this.overflow != Oe.SCROLL ||
        this.textWidth &lt; this._width ||
        !this._clipPoint ||
        ((this._clipPoint.x = t &gt; this._textWidth ? this._textWidth : t),
        this._renderText());
    }
    get scrollX() {
      return this._clipPoint ? this._clipPoint.x : 0;
    }
    set scrollY(t) {
      this.overflow != Oe.SCROLL ||
        this.textHeight &lt; this._height ||
        !this._clipPoint ||
        ((this._clipPoint.y = t &gt; this._textHeight ? this._textHeight : t),
        this._renderText());
    }
    get scrollY() {
      return this._clipPoint ? this._clipPoint.y : 0;
    }
    get maxScrollX() {
      return this.textWidth &lt; this._width ? 0 : this._textWidth - this._width;
    }
    get maxScrollY() {
      return this.textHeight &lt; this._height
        ? 0
        : this._textHeight - this._height;
    }
    get lines() {
      return this._isChanged &amp;&amp; this.typeset(), this._lines;
    }
    get underlineColor() {
      return this._style.underlineColor;
    }
    set underlineColor(t) {
      (this._getTextStyle().underlineColor = t),
        this._isChanged || this._renderText();
    }
    get underline() {
      return this._style.underline;
    }
    set underline(t) {
      this._getTextStyle().underline = t;
    }
    set singleCharRender(t) {
      this._singleCharRender = t;
    }
    get singleCharRender() {
      return this._singleCharRender;
    }
  }
  (Oe.VISIBLE = "visible"),
    (Oe.SCROLL = "scroll"),
    (Oe.HIDDEN = "hidden"),
    (Oe.defaultFontSize = 12),
    (Oe.defaultFont = "Arial"),
    (Oe.isComplexText = !1),
    (Oe.fontFamilyMap = {
      æŠ¥éš¶: "æŠ¥éš¶-ç®€",
      é»‘ä½“: "é»‘ä½“-ç®€",
      æ¥·ä½“: "æ¥·ä½“-ç®€",
      å…°äº­é»‘: "å…°äº­é»‘-ç®€",
      éš¶å˜: "éš¶å˜-ç®€",
      å‡Œæ…§ä½“: "å‡Œæ…§ä½“-ç®€",
      ç¿©ç¿©ä½“: "ç¿©ç¿©ä½“-ç®€",
      è‹¹æ–¹: "è‹¹æ–¹-ç®€",
      æ‰‹æœ­ä½“: "æ‰‹æœ­ä½“-ç®€",
      å®‹ä½“: "å®‹ä½“-ç®€",
      å¨ƒå¨ƒä½“: "å¨ƒå¨ƒä½“-ç®€",
      é­ç¢‘: "é­ç¢‘-ç®€",
      è¡Œæ¥·: "è¡Œæ¥·-ç®€",
      é›…ç—ž: "é›…ç—ž-ç®€",
      åœ†ä½“: "åœ†ä½“-ç®€",
    }),
    (Oe._testWord = "æ¸¸"),
    (Oe.CharacterCache = !0),
    (Oe.RightToLeft = !1),
    i.regClass(Oe),
    Me.regClass("laya.display.Text", Oe),
    Me.regClass("Laya.Text", Oe);
  class Ne extends Oe {
    constructor() {
      super(),
        (this._multiline = !1),
        (this._editable = !0),
        (this._maxChars = 1e5),
        (this._type = "text"),
        (this._prompt = ""),
        (this._promptColor = "#A9A9A9"),
        (this._originColor = "#000000"),
        (this._content = ""),
        (Ne.IOS_IFRAME =
          i.Browser.onIOS &amp;&amp; i.Browser.window.top != i.Browser.window.self),
        (this._width = 100),
        (this._height = 20),
        (this.multiline = !1),
        (this.overflow = Oe.SCROLL),
        this.on($t.MOUSE_DOWN, this, this._onMouseDown),
        this.on($t.UNDISPLAY, this, this._onUnDisplay);
    }
    static __init__() {
      if ((Ne._createInputElement(), i.Browser.onMobile)) {
        var t = !1;
        (i.Browser.onMiniGame ||
          i.Browser.onBDMiniGame ||
          i.Browser.onQGMiniGame ||
          i.Browser.onKGMiniGame ||
          i.Browser.onVVMiniGame ||
          i.Browser.onAlipayMiniGame ||
          i.Browser.onQQMiniGame ||
          i.Browser.onBLMiniGame ||
          i.Browser.onTTMiniGame ||
          i.Browser.onHWMiniGame ||
          i.Browser.onTBMiniGame) &amp;&amp;
          (t = !0),
          i.Render.canvas.addEventListener(
            Ne.IOS_IFRAME ? (t ? "touchend" : "click") : "touchend",
            Ne._popupInputMethod,
          );
      }
    }
    static _popupInputMethod(t) {
      Ne.isInputting &amp;&amp; Ne.inputElement.focus();
    }
    static _createInputElement() {
      Ne._initInput((Ne.area = i.Browser.createElement("textarea"))),
        Ne._initInput((Ne.input = i.Browser.createElement("input"))),
        (Ne.inputContainer = i.Browser.createElement("div")),
        (Ne.inputContainer.style.position = "absolute"),
        (Ne.inputContainer.style.zIndex = "1E5"),
        i.Browser.container.appendChild(Ne.inputContainer),
        (Ne.inputContainer.setPos = function (t, e) {
          (Ne.inputContainer.style.left = t + "px"),
            (Ne.inputContainer.style.top = e + "px");
        });
    }
    static _initInput(t) {
      var e = t.style;
      (e.cssText =
        "position:absolute;overflow:hidden;resize:none;transform-origin:0 0;-webkit-transform-origin:0 0;-moz-transform-origin:0 0;-o-transform-origin:0 0;"),
        (e.resize = "none"),
        (e.backgroundColor = "transparent"),
        (e.border = "none"),
        (e.outline = "none"),
        (e.zIndex = "1"),
        t.addEventListener("input", Ne._processInputting),
        t.addEventListener("mousemove", Ne._stopEvent),
        t.addEventListener("mousedown", Ne._stopEvent),
        t.addEventListener("touchmove", Ne._stopEvent),
        (t.setFontFace = function (e) {
          t.style.fontFamily = e;
        }),
        i.Render.isConchApp ||
          ((t.setColor = function (e) {
            t.style.color = e;
          }),
          (t.setFontSize = function (e) {
            t.style.fontSize = e + "px";
          }));
    }
    static _processInputting(t) {
      var e = Ne.inputElement.target;
      if (e) {
        var i = Ne.inputElement.value;
        e._restrictPattern &amp;&amp;
          ((i = i.replace(/\u2006|\x27/g, "")),
          e._restrictPattern.test(i) &amp;&amp;
            ((i = i.replace(e._restrictPattern, "")),
            (Ne.inputElement.value = i))),
          (e._text = i),
          e.event($t.INPUT);
      }
    }
    static _stopEvent(t) {
      "touchmove" == t.type &amp;&amp; t.preventDefault(),
        t.stopPropagation &amp;&amp; t.stopPropagation();
    }
    setSelection(t, e) {
      (this.focus = !0),
        (Ne.inputElement.selectionStart = t),
        (Ne.inputElement.selectionEnd = e);
    }
    get multiline() {
      return this._multiline;
    }
    set multiline(t) {
      (this._multiline = t), (this.valign = t ? "top" : "middle");
    }
    get nativeInput() {
      return this._multiline ? Ne.area : Ne.input;
    }
    _onUnDisplay(t = null) {
      this.focus = !1;
    }
    _onMouseDown(t) {
      this.focus = !0;
    }
    _syncInputTransform() {
      var t = this.nativeInput,
        e = J.getTransformRelativeToWindow(
          this,
          this.padding[3],
          this.padding[0],
        ),
        s = this._width - this.padding[1] - this.padding[3],
        r = this._height - this.padding[0] - this.padding[2];
      i.Render.isConchApp
        ? (t.setScale(e.scaleX, e.scaleY), t.setSize(s, r), t.setPos(e.x, e.y))
        : ((Ne.inputContainer.style.transform =
            Ne.inputContainer.style.webkitTransform =
              "scale(" +
              e.scaleX +
              "," +
              e.scaleY +
              ") rotate(" +
              i.stage.canvasDegree +
              "deg)"),
          (t.style.width = s + "px"),
          (t.style.height = r + "px"),
          (Ne.inputContainer.style.left = e.x + "px"),
          (Ne.inputContainer.style.top = e.y + "px"));
    }
    select() {
      this.nativeInput.select();
    }
    get focus() {
      return this._focus;
    }
    set focus(t) {
      var e = this.nativeInput;
      this._focus !== t &amp;&amp;
        (t
          ? (e.target ? e.target._focusOut() : this._setInputMethod(),
            ((e = this.nativeInput).target = this),
            this._focusIn())
          : ((e.target = null),
            this._focusOut(),
            (i.Browser.document.body.scrollTop = 0),
            e.blur(),
            i.Render.isConchApp
              ? e.setPos(-1e4, -1e4)
              : Ne.inputContainer.contains(e) &amp;&amp;
                Ne.inputContainer.removeChild(e)));
    }
    _setInputMethod() {
      Ne.input.parentElement &amp;&amp; Ne.inputContainer.removeChild(Ne.input),
        Ne.area.parentElement &amp;&amp; Ne.inputContainer.removeChild(Ne.area),
        i.Browser.onAndroid &amp;&amp;
          ((Ne.input = Ne.inputElement = i.Browser.createElement("input")),
          Ne._initInput(Ne.input)),
        (Ne.inputElement = this._multiline ? Ne.area : Ne.input),
        Ne.inputContainer.appendChild(Ne.inputElement),
        Oe.RightToLeft &amp;&amp; (Ne.inputElement.style.direction = "rtl");
    }
    _focusIn() {
      Ne.isInputting = !0;
      var t = this.nativeInput;
      Ne.input &amp;&amp; (Ne.input.type = this._type), (this._focus = !0);
      var e = t.style;
      (e.whiteSpace = this.wordWrap ? "pre-wrap" : "nowrap"),
        this._setPromptColor(),
        (t.readOnly = !this._editable),
        i.Render.isConchApp &amp;&amp;
          (t.setType(this._type), t.setForbidEdit(!this._editable)),
        (t.maxLength = this._maxChars),
        (t.value = this._content),
        (t.placeholder = this._prompt),
        i.stage.off($t.KEY_DOWN, this, this._onKeyDown),
        i.stage.on($t.KEY_DOWN, this, this._onKeyDown),
        (i.stage.focus = this),
        this.event($t.FOCUS),
        i.Browser.onPC &amp;&amp; t.focus(),
        i.Browser.onMiniGame ||
          i.Browser.onBDMiniGame ||
          i.Browser.onQGMiniGame ||
          i.Browser.onKGMiniGame ||
          i.Browser.onVVMiniGame ||
          i.Browser.onAlipayMiniGame ||
          i.Browser.onQQMiniGame ||
          i.Browser.onBLMiniGame ||
          i.Browser.onTTMiniGame ||
          i.Browser.onHWMiniGame ||
          i.Browser.onTBMiniGame ||
          (this._text = null),
        this.typeset(),
        t.setColor(this._originColor),
        t.setFontSize(this.fontSize),
        t.setFontFace(
          (i.Browser.onIPhone &amp;&amp; Oe.fontFamilyMap[this.font]) || this.font,
        ),
        i.Render.isConchApp &amp;&amp;
          t.setMultiAble &amp;&amp;
          t.setMultiAble(this._multiline),
        (e.lineHeight = this.leading + this.fontSize + "px"),
        (e.fontStyle = this.italic ? "italic" : "normal"),
        (e.fontWeight = this.bold ? "bold" : "normal"),
        (e.textAlign = this.align),
        (e.padding = "0 0"),
        this._syncInputTransform(),
        !i.Render.isConchApp &amp;&amp;
          i.Browser.onPC &amp;&amp;
          i.systemTimer.frameLoop(1, this, this._syncInputTransform);
    }
    _setPromptColor() {
      (Ne.promptStyleDOM = i.Browser.getElementById("promptStyle")),
        Ne.promptStyleDOM ||
          ((Ne.promptStyleDOM = i.Browser.createElement("style")),
          Ne.promptStyleDOM.setAttribute("id", "promptStyle"),
          i.Browser.document.head.appendChild(Ne.promptStyleDOM)),
        (Ne.promptStyleDOM.innerText =
          "input::-webkit-input-placeholder, textarea::-webkit-input-placeholder {color:" +
          this._promptColor +
          "}input:-moz-placeholder, textarea:-moz-placeholder {color:" +
          this._promptColor +
          "}input::-moz-placeholder, textarea::-moz-placeholder {color:" +
          this._promptColor +
          "}input:-ms-input-placeholder, textarea:-ms-input-placeholder {color:" +
          this._promptColor +
          "}");
    }
    _focusOut() {
      Ne.isInputting &amp;&amp;
        ((Ne.isInputting = !1),
        (this._focus = !1),
        (this._text = null),
        (this._content = this.nativeInput.value),
        this._content
          ? (super.set_text(this._content), super.set_color(this._originColor))
          : (super.set_text(this._prompt), super.set_color(this._promptColor)),
        i.stage.off($t.KEY_DOWN, this, this._onKeyDown),
        (i.stage.focus = null),
        this.event($t.BLUR),
        this.event($t.CHANGE),
        i.Browser.onPC &amp;&amp; i.systemTimer.clear(this, this._syncInputTransform));
    }
    _onKeyDown(t) {
      13 === t.keyCode &amp;&amp;
        (i.Browser.onMobile &amp;&amp; !this._multiline &amp;&amp; (this.focus = !1),
        this.event($t.ENTER));
    }
    miniGameTxt(t) {
      super.set_color(this._originColor),
        (t += ""),
        this._multiline || (t = t.replace(/\r?\n/g, "")),
        (this._content = t),
        t
          ? super.set_text(t)
          : (super.set_text(this._prompt), super.set_color(this.promptColor));
    }
    set text(t) {
      super.set_color(this._originColor),
        (t += ""),
        this._focus
          ? ((this.nativeInput.value = t || ""), this.event($t.CHANGE))
          : (this._multiline || (t = t.replace(/\r?\n/g, "")),
            (this._content = t),
            t
              ? super.set_text(t)
              : (super.set_text(this._prompt),
                super.set_color(this.promptColor)));
    }
    get text() {
      return this._focus ? this.nativeInput.value : this._content || "";
    }
    changeText(t) {
      (this._content = t),
        this._focus
          ? ((this.nativeInput.value = t || ""), this.event($t.CHANGE))
          : super.changeText(t);
    }
    set color(t) {
      this._focus &amp;&amp; this.nativeInput.setColor(t),
        super.set_color(this._content ? t : this._promptColor),
        (this._originColor = t);
    }
    get color() {
      return super.color;
    }
    set bgColor(t) {
      super.set_bgColor(t),
        i.Render.isConchApp &amp;&amp; this.nativeInput.setBgColor(t);
    }
    get bgColor() {
      return super.bgColor;
    }
    get restrict() {
      return this._restrictPattern ? this._restrictPattern.source : "";
    }
    set restrict(t) {
      t
        ? ((t = "[^" + t + "]").indexOf("^^") &gt; -1 &amp;&amp; (t = t.replace("^^", "")),
          (this._restrictPattern = new RegExp(t, "g")))
        : (this._restrictPattern = null);
    }
    set editable(t) {
      (this._editable = t), i.Render.isConchApp &amp;&amp; Ne.input.setForbidEdit(!t);
    }
    get editable() {
      return this._editable;
    }
    get maxChars() {
      return this._maxChars;
    }
    set maxChars(t) {
      t &lt;= 0 &amp;&amp; (t = 1e5), (this._maxChars = t);
    }
    get prompt() {
      return this._prompt;
    }
    set prompt(t) {
      !this._text &amp;&amp; t &amp;&amp; super.set_color(this._promptColor),
        (this.promptColor = this._promptColor),
        this._text
          ? super.set_text(this._text == this._prompt ? t : this._text)
          : super.set_text(t),
        (this._prompt = Oe.langPacks &amp;&amp; Oe.langPacks[t] ? Oe.langPacks[t] : t);
    }
    get promptColor() {
      return this._promptColor;
    }
    set promptColor(t) {
      (this._promptColor = t), this._content || super.set_color(t);
    }
    get type() {
      return this._type;
    }
    set type(t) {
      (this._getTextStyle().asPassword = "password" === t), (this._type = t);
    }
  }
  (Ne.TYPE_TEXT = "text"),
    (Ne.TYPE_PASSWORD = "password"),
    (Ne.TYPE_EMAIL = "email"),
    (Ne.TYPE_URL = "url"),
    (Ne.TYPE_NUMBER = "number"),
    (Ne.TYPE_RANGE = "range"),
    (Ne.TYPE_DATE = "date"),
    (Ne.TYPE_MONTH = "month"),
    (Ne.TYPE_WEEK = "week"),
    (Ne.TYPE_TIME = "time"),
    (Ne.TYPE_DATE_TIME = "datetime"),
    (Ne.TYPE_DATE_TIME_LOCAL = "datetime-local"),
    (Ne.TYPE_SEARCH = "search"),
    (Ne.IOS_IFRAME = !1),
    (Ne.inputHeight = 45),
    (Ne.isInputting = !1),
    Me.regClass("laya.display.Input", Ne),
    Me.regClass("Laya.Input", Ne);
  class Ue {
    constructor() {
      (this.preOvers = []),
        (this.preDowns = []),
        (this.preRightDowns = []),
        (this.enable = !0),
        (this._event = new $t()),
        (this._lastClickTime = 0);
    }
    _clearTempArrs() {
      (Ue._oldArr.length = 0),
        (Ue._newArr.length = 0),
        (Ue._tEleArr.length = 0);
    }
    getTouchFromArr(t, e) {
      var i, s, r;
      for (s = e.length, i = 0; i &lt; s; i++) if ((r = e[i]).id == t) return r;
      return null;
    }
    removeTouchFromArr(t, e) {
      var i;
      for (i = e.length - 1; i &gt;= 0; i--) e[i].id == t &amp;&amp; e.splice(i, 1);
    }
    createTouchO(t, e) {
      var i;
      return ((i = s.getItem("TouchData") || {}).id = e), (i.tar = t), i;
    }
    onMouseDown(t, e, i = !1) {
      var s, r, a, n;
      this.enable &amp;&amp;
        ((s = this.getTouchFromArr(e, this.preOvers)),
        (a = this.getEles(t, null, Ue._tEleArr)),
        s
          ? (s.tar = t)
          : ((r = this.createTouchO(t, e)), this.preOvers.push(r)),
        re.onMobile &amp;&amp; this.sendEvents(a, $t.MOUSE_OVER),
        (n = i ? this.preDowns : this.preRightDowns),
        (s = this.getTouchFromArr(e, n))
          ? (s.tar = t)
          : ((r = this.createTouchO(t, e)), n.push(r)),
        this.sendEvents(a, i ? $t.MOUSE_DOWN : $t.RIGHT_MOUSE_DOWN),
        this._clearTempArrs());
    }
    sendEvents(t, e) {
      var i, s, r;
      for (
        s = t.length, this._event._stoped = !1, r = t[0], i = 0;
        i &lt; s;
        i++
      ) {
        var a = t[i];
        if (a.destroyed) return;
        if ((a.event(e, this._event.setTo(e, a, r)), this._event._stoped))
          break;
      }
    }
    getEles(t, e = null, i = null) {
      for (i ? (i.length = 0) : (i = []); t &amp;&amp; t != e; )
        i.push(t), (t = t.parent);
      return i;
    }
    checkMouseOutAndOverOfMove(t, e, i = 0) {
      var s, r, a, n;
      if (e != t)
        if (e.contains(t))
          (r = this.getEles(t, e, Ue._tEleArr)),
            this.sendEvents(r, $t.MOUSE_OVER);
        else if (t.contains(e))
          (r = this.getEles(e, t, Ue._tEleArr)),
            this.sendEvents(r, $t.MOUSE_OUT);
        else {
          var h, o, l;
          for (
            (r = Ue._tEleArr).length = 0,
              h = this.getEles(e, null, Ue._oldArr),
              o = this.getEles(t, null, Ue._newArr),
              n = h.length,
              a = 0;
            a &lt; n;
            a++
          ) {
            if (((s = h[a]), (l = o.indexOf(s)) &gt;= 0)) {
              o.splice(l, o.length - l);
              break;
            }
            r.push(s);
          }
          r.length &gt; 0 &amp;&amp; this.sendEvents(r, $t.MOUSE_OUT),
            o.length &gt; 0 &amp;&amp; this.sendEvents(o, $t.MOUSE_OVER);
        }
    }
    onMouseMove(t, e) {
      var i, s;
      this.enable &amp;&amp;
        ((i = this.getTouchFromArr(e, this.preOvers))
          ? (this.checkMouseOutAndOverOfMove(t, i.tar),
            (i.tar = t),
            (s = this.getEles(t, null, Ue._tEleArr)))
          : ((s = this.getEles(t, null, Ue._tEleArr)),
            this.sendEvents(s, $t.MOUSE_OVER),
            this.preOvers.push(this.createTouchO(t, e))),
        this.sendEvents(s, $t.MOUSE_MOVE),
        this._clearTempArrs());
    }
    getLastOvers() {
      return (
        (Ue._tEleArr.length = 0),
        this.preOvers.length &gt; 0 &amp;&amp; this.preOvers[0].tar
          ? this.getEles(this.preOvers[0].tar, null, Ue._tEleArr)
          : (Ue._tEleArr.push(i.stage), Ue._tEleArr)
      );
    }
    stageMouseOut() {
      var t;
      (t = this.getLastOvers()),
        (this.preOvers.length = 0),
        this.sendEvents(t, $t.MOUSE_OUT);
    }
    onMouseUp(t, e, i = !1) {
      if (this.enable) {
        var r,
          a,
          n,
          h,
          o,
          l,
          _,
          u,
          c = re.onMobile;
        if (
          ((a = this.getEles(t, null, Ue._tEleArr)),
          this.sendEvents(a, i ? $t.MOUSE_UP : $t.RIGHT_MOUSE_UP),
          (u = i ? this.preDowns : this.preRightDowns),
          (r = this.getTouchFromArr(e, u)))
        ) {
          var d,
            p = re.now();
          if (
            ((d = p - this._lastClickTime &lt; 300),
            (this._lastClickTime = p),
            t == r.tar)
          )
            _ = a;
          else
            for (
              n = this.getEles(r.tar, null, Ue._oldArr),
                (_ = Ue._newArr).length = 0,
                o = n.length,
                h = 0;
              h &lt; o;
              h++
            )
              (l = n[h]), a.indexOf(l) &gt;= 0 &amp;&amp; _.push(l);
          _.length &gt; 0 &amp;&amp; this.sendEvents(_, i ? $t.CLICK : $t.RIGHT_CLICK),
            i &amp;&amp; d &amp;&amp; this.sendEvents(_, $t.DOUBLE_CLICK),
            this.removeTouchFromArr(e, u),
            (r.tar = null),
            s.recover("TouchData", r);
        } else;
        (r = this.getTouchFromArr(e, this.preOvers)) &amp;&amp;
          c &amp;&amp;
          ((_ = this.getEles(r.tar, null, _)) &amp;&amp;
            _.length &gt; 0 &amp;&amp;
            this.sendEvents(_, $t.MOUSE_OUT),
          this.removeTouchFromArr(e, this.preOvers),
          (r.tar = null),
          s.recover("TouchData", r)),
          this._clearTempArrs();
      }
    }
  }
  (Ue.I = new Ue()), (Ue._oldArr = []), (Ue._newArr = []), (Ue._tEleArr = []);
  class Ge {
    constructor() {
      (this.mouseX = 0),
        (this.mouseY = 0),
        (this.disableMouseEvent = !1),
        (this.mouseDownTime = 0),
        (this.mouseMoveAccuracy = 2),
        (this._event = new $t()),
        (this._captureSp = null),
        (this._captureChain = []),
        (this._captureExlusiveMode = !1),
        (this._hitCaputreSp = !1),
        (this._point = new f()),
        (this._rect = new m()),
        (this._lastMoveTimer = 0),
        (this._prePoint = new f()),
        (this._touchIDs = {}),
        (this._curTouchID = NaN),
        (this._id = 1);
    }
    __init__(t, e) {
      this._stage = t;
      var i = this;
      (e.oncontextmenu = function (t) {
        if (Ge.enabled) return !1;
      }),
        e.addEventListener("mousedown", function (t) {
          Ge.enabled &amp;&amp;
            (re.onIE || (t.cancelable &amp;&amp; t.preventDefault()),
            (i.mouseDownTime = re.now()),
            i.runEvent(t));
        }),
        e.addEventListener(
          "mouseup",
          function (t) {
            Ge.enabled &amp;&amp;
              (t.cancelable &amp;&amp; t.preventDefault(),
              (i.mouseDownTime = -re.now()),
              i.runEvent(t));
          },
          !0,
        ),
        e.addEventListener(
          "mousemove",
          function (t) {
            if (Ge.enabled) {
              t.cancelable &amp;&amp; t.preventDefault();
              var e = re.now();
              if (e - i._lastMoveTimer &lt; 10) return;
              (i._lastMoveTimer = e), i.runEvent(t);
            }
          },
          !0,
        ),
        e.addEventListener("mouseout", function (t) {
          Ge.enabled &amp;&amp; i.runEvent(t);
        }),
        e.addEventListener("mouseover", function (t) {
          Ge.enabled &amp;&amp; i.runEvent(t);
        }),
        e.addEventListener("touchstart", function (t) {
          Ge.enabled &amp;&amp;
            (Ge._isFirstTouch ||
              Ne.isInputting ||
              (t.cancelable &amp;&amp; t.preventDefault()),
            (i.mouseDownTime = re.now()),
            i.runEvent(t));
        }),
        e.addEventListener(
          "touchend",
          function (t) {
            Ge.enabled
              ? (Ge._isFirstTouch ||
                  Ne.isInputting ||
                  (t.cancelable &amp;&amp; t.preventDefault()),
                (Ge._isFirstTouch = !1),
                (i.mouseDownTime = -re.now()),
                i.runEvent(t))
              : (i._curTouchID = NaN);
          },
          !0,
        ),
        e.addEventListener(
          "touchmove",
          function (t) {
            Ge.enabled &amp;&amp; (t.cancelable &amp;&amp; t.preventDefault(), i.runEvent(t));
          },
          !0,
        ),
        e.addEventListener(
          "touchcancel",
          function (t) {
            Ge.enabled
              ? (t.cancelable &amp;&amp; t.preventDefault(), i.runEvent(t))
              : (i._curTouchID = NaN);
          },
          !0,
        ),
        e.addEventListener("mousewheel", function (t) {
          Ge.enabled &amp;&amp; i.runEvent(t);
        }),
        e.addEventListener("DOMMouseScroll", function (t) {
          Ge.enabled &amp;&amp; i.runEvent(t);
        });
    }
    initEvent(t, e = null) {
      var i;
      (this._event._stoped = !1),
        (this._event.nativeEvent = e || t),
        (this._target = null),
        this._point.setTo(t.pageX || t.clientX, t.pageY || t.clientY),
        this._stage._canvasTransform &amp;&amp;
          (this._stage._canvasTransform.invertTransformPoint(this._point),
          (this.mouseX = this._point.x),
          (this.mouseY = this._point.y)),
        (this._event.touchId = t.identifier || 0),
        (this._tTouchID = this._event.touchId),
        ((i = Ue.I._event)._stoped = !1),
        (i.nativeEvent = this._event.nativeEvent),
        (i.touchId = this._event.touchId);
    }
    checkMouseWheel(t) {
      this._event.delta = t.wheelDelta ? 0.025 * t.wheelDelta : -t.detail;
      for (var e = Ue.I.getLastOvers(), i = 0, s = e.length; i &lt; s; i++) {
        var r = e[i];
        r.event(
          $t.MOUSE_WHEEL,
          this._event.setTo($t.MOUSE_WHEEL, r, this._target),
        );
      }
    }
    onMouseMove(t) {
      Ue.I.onMouseMove(t, this._tTouchID);
    }
    onMouseDown(t) {
      if (
        Ne.isInputting &amp;&amp;
        i.stage.focus &amp;&amp;
        i.stage.focus.focus &amp;&amp;
        !i.stage.focus.contains(this._target)
      ) {
        var e = i.stage.focus._tf || i.stage.focus;
        t._tf;
        e.focus = !1;
      }
      Ue.I.onMouseDown(t, this._tTouchID, this._isLeftMouse);
    }
    onMouseUp(t) {
      Ue.I.onMouseUp(t, this._tTouchID, this._isLeftMouse);
    }
    check(t, e, i, s) {
      this._point.setTo(e, i),
        t.fromParentPoint(this._point),
        (e = this._point.x),
        (i = this._point.y);
      var r = t._style.scrollRect;
      if (
        r &amp;&amp;
        (this._rect.setTo(r.x, r.y, r.width, r.height),
        !this._rect.contains(e, i))
      )
        return !1;
      if (!this.disableMouseEvent) {
        if (t.hitTestPrior &amp;&amp; !t.mouseThrough &amp;&amp; !this.hitTest(t, e, i))
          return !1;
        for (var a = t._children.length - 1; a &gt; -1; a--) {
          var n = t._children[a];
          if (
            !n.destroyed &amp;&amp;
            n._mouseState &gt; 1 &amp;&amp;
            n._visible &amp;&amp;
            this.check(n, e, i, s)
          )
            return !0;
        }
        for (a = t._extUIChild.length - 1; a &gt;= 0; a--) {
          var h = t._extUIChild[a];
          if (
            !h.destroyed &amp;&amp;
            h._mouseState &gt; 1 &amp;&amp;
            h._visible &amp;&amp;
            this.check(h, e, i, s)
          )
            return !0;
        }
      }
      var o =
        !(!t.hitTestPrior || t.mouseThrough || this.disableMouseEvent) ||
        this.hitTest(t, e, i);
      return (
        o
          ? ((this._target = t),
            s.call(this, t),
            this._target == this._hitCaputreSp &amp;&amp; (this._hitCaputreSp = !0))
          : s === this.onMouseUp &amp;&amp;
            t === this._stage &amp;&amp;
            ((this._target = this._stage), s.call(this, this._target)),
        o
      );
    }
    hitTest(t, e, i) {
      var s = !1;
      t.scrollRect &amp;&amp;
        ((e -= t._style.scrollRect.x), (i -= t._style.scrollRect.y));
      var r = t._style.hitArea;
      return r &amp;&amp; r._hit
        ? r.contains(e, i)
        : (((t.width &gt; 0 &amp;&amp; t.height &gt; 0) || t.mouseThrough || r) &amp;&amp;
            (s = t.mouseThrough
              ? t.getGraphicBounds().contains(e, i)
              : (r || this._rect.setTo(0, 0, t.width, t.height)).contains(
                  e,
                  i,
                )),
          s);
    }
    _checkAllBaseUI(t, e, i) {
      var s = this.handleExclusiveCapture(this.mouseX, this.mouseY, i);
      return (
        !!s ||
        ((s = this.check(this._stage, this.mouseX, this.mouseY, i)),
        this.handleCapture(this.mouseX, this.mouseY, i) || s)
      );
    }
    check3DUI(t, e, i) {
      for (var s = this._stage._3dUI, r = 0, a = !1; r &lt; s.length; r++) {
        var n = s[r];
        (this._stage._curUIBase = n),
          !n.destroyed &amp;&amp;
            n._mouseState &gt; 1 &amp;&amp;
            n._visible &amp;&amp;
            (a = a || this.check(n, this.mouseX, this.mouseY, i));
      }
      return (this._stage._curUIBase = this._stage), a;
    }
    handleExclusiveCapture(t, e, i) {
      if (
        this._captureExlusiveMode &amp;&amp;
        this._captureSp &amp;&amp;
        this._captureChain.length &gt; 0
      ) {
        var s;
        this._point.setTo(t, e);
        for (var r = 0; r &lt; this._captureChain.length; r++)
          (s = this._captureChain[r]).fromParentPoint(this._point);
        return (this._target = s), i.call(this, s), !0;
      }
      return !1;
    }
    handleCapture(t, e, i) {
      if (
        !this._hitCaputreSp &amp;&amp;
        this._captureSp &amp;&amp;
        this._captureChain.length &gt; 0
      ) {
        var s;
        this._point.setTo(t, e);
        for (var r = 0; r &lt; this._captureChain.length; r++)
          (s = this._captureChain[r]).fromParentPoint(this._point);
        return (this._target = s), i.call(this, s), !0;
      }
      return !1;
    }
    runEvent(t) {
      var e, i, s;
      switch (
        ("mousemove" !== t.type &amp;&amp; (this._prePoint.x = this._prePoint.y = -1e6),
        t.type)
      ) {
        case "mousedown":
          (this._touchIDs[0] = this._id++),
            Ge._isTouchRespond
              ? (Ge._isTouchRespond = !1)
              : ((this._isLeftMouse = 0 === t.button),
                this.initEvent(t),
                this._checkAllBaseUI(
                  this.mouseX,
                  this.mouseY,
                  this.onMouseDown,
                ));
          break;
        case "mouseup":
          (this._isLeftMouse = 0 === t.button),
            this.initEvent(t),
            this._checkAllBaseUI(this.mouseX, this.mouseY, this.onMouseUp);
          break;
        case "mousemove":
          Math.abs(this._prePoint.x - t.clientX) +
            Math.abs(this._prePoint.y - t.clientY) &gt;=
            this.mouseMoveAccuracy &amp;&amp;
            ((this._prePoint.x = t.clientX),
            (this._prePoint.y = t.clientY),
            this.initEvent(t),
            this._checkAllBaseUI(this.mouseX, this.mouseY, this.onMouseMove));
          break;
        case "touchstart":
          (Ge._isTouchRespond = !0), (this._isLeftMouse = !0);
          var r = t.changedTouches;
          for (e = 0, i = r.length; e &lt; i; e++)
            (s = r[e]),
              (Ge.multiTouchEnabled || isNaN(this._curTouchID)) &amp;&amp;
                ((this._curTouchID = s.identifier),
                this._id % 200 == 0 &amp;&amp; (this._touchIDs = {}),
                (this._touchIDs[s.identifier] = this._id++),
                this.initEvent(s, t),
                this._checkAllBaseUI(
                  this.mouseX,
                  this.mouseY,
                  this.onMouseDown,
                ));
          break;
        case "touchend":
        case "touchcancel":
          (Ge._isTouchRespond = !0), (this._isLeftMouse = !0);
          var a = t.changedTouches;
          for (e = 0, i = a.length; e &lt; i; e++) {
            if (
              ((s = a[e]),
              Ge.multiTouchEnabled || s.identifier == this._curTouchID)
            )
              (this._curTouchID = NaN),
                this.initEvent(s, t),
                this._checkAllBaseUI(
                  this.mouseX,
                  this.mouseY,
                  this.onMouseUp,
                ) || this.onMouseUp(null);
          }
          break;
        case "touchmove":
          var n = t.changedTouches;
          for (e = 0, i = n.length; e &lt; i; e++)
            (s = n[e]),
              (Ge.multiTouchEnabled || s.identifier == this._curTouchID) &amp;&amp;
                (this.initEvent(s, t),
                this._checkAllBaseUI(
                  this.mouseX,
                  this.mouseY,
                  this.onMouseMove,
                ));
          break;
        case "wheel":
        case "mousewheel":
        case "DOMMouseScroll":
          this.checkMouseWheel(t);
          break;
        case "mouseout":
          Ue.I.stageMouseOut();
          break;
        case "mouseover":
          this._stage.event(
            $t.MOUSE_OVER,
            this._event.setTo($t.MOUSE_OVER, this._stage, this._stage),
          );
      }
    }
    setCapture(t, e = !1) {
      (this._captureSp = t),
        (this._captureExlusiveMode = e),
        (this._captureChain.length = 0),
        this._captureChain.push(t);
      for (
        var s = t;
        s != i.stage &amp;&amp; s != i.stage._curUIBase &amp;&amp; (s = s.parent);

      )
        this._captureChain.splice(0, 0, s);
    }
    releaseCapture() {
      console.log("release capture"), (this._captureSp = null);
    }
  }
  (Ge.instance = new Ge()),
    (Ge.enabled = !0),
    (Ge.multiTouchEnabled = !0),
    (Ge._isFirstTouch = !0);
  class ke {
    constructor() {
      (this._pool = []), (this._map = {}), (this._laters = []);
    }
    _update() {
      let t = this._laters,
        e = t.length;
      if (e &gt; 0) {
        for (let i = 0, s = e - 1; i &lt;= s; i++) {
          let e = t[i];
          (this._map[e.key] = null),
            null !== e.method &amp;&amp; (e.run(), e.clear()),
            this._pool.push(e),
            i === s &amp;&amp; (s = t.length - 1);
        }
        t.length = 0;
      }
    }
    _getHandler(t, e) {
      var s = t ? t.$_GID || (t.$_GID = i.Utils.getGID()) : 0,
        r = e.$_TID || (e.$_TID = i.Timer._mid++);
      return this._map[s + "." + r];
    }
    callLater(t, e, i = null) {
      if (null == this._getHandler(t, e)) {
        let a;
        ((a = this._pool.length ? this._pool.pop() : new We()).caller = t),
          (a.method = e),
          (a.args = i);
        var s = t ? t.$_GID : 0,
          r = e.$_TID;
        (a.key = s + "." + r), (this._map[a.key] = a), this._laters.push(a);
      }
    }
    runCallLater(t, e) {
      var i = this._getHandler(t, e);
      i &amp;&amp; null != i.method &amp;&amp; ((this._map[i.key] = null), i.run(), i.clear());
    }
  }
  ke.I = new ke();
  class We {
    clear() {
      (this.caller = null), (this.method = null), (this.args = null);
    }
    run() {
      var t = this.caller;
      if (t &amp;&amp; t.destroyed) return this.clear();
      var e = this.method,
        i = this.args;
      null != e &amp;&amp; (i ? e.apply(t, i) : e.call(t));
    }
  }
  class Ye {}
  (Ye.createShaderCondition = function (t) {
    var e = "(function() {return " + t + ";})";
    return window.Laya._runScript(e);
  }),
    (Ye.changeWebGLSize = function (t, e) {
      _e.onStageResize(t, e);
    });
  class Ve {
    static setPerformanceDataTool(t) {
      this.performanceTool = t;
    }
    static begainSample(t) {
      this.performanceTool &amp;&amp;
        this.performanceTool.enable &amp;&amp;
        this.performanceTool.BegainSample(t);
    }
    static endSample(t) {
      return this.performanceTool &amp;&amp; this.performanceTool.enable
        ? this.performanceTool.EndSample(t)
        : 0;
    }
    static expoertFile(t) {
      if (this.performanceTool)
        return this.performanceTool.enable
          ? this.performanceTool.exportPerformanceFile()
          : null;
    }
    static showFunSampleFun(t) {
      this.performanceTool.showFunSampleFun(t);
    }
    static set enable(t) {
      this.performanceTool &amp;&amp; (this.performanceTool.enable = t);
    }
    static get enable() {
      return !!this.performanceTool &amp;&amp; this._enable;
    }
    static set enableDataExport(t) {
      this.performanceTool &amp;&amp; (this.performanceTool.enableDataExport = t);
    }
    static get enableDataExport() {
      return !!this.performanceTool &amp;&amp; this.performanceTool.enableDataExport;
    }
  }
  (Ve.performanceTool = null),
    (Ve._enable = !1),
    (Ve.PERFORMANCE_LAYA = "Laya"),
    (Ve.PERFORMANCE_LAYA_3D = "Laya/3D"),
    (Ve.PERFORMANCE_LAYA_2D = "Laya/2D"),
    (Ve.PERFORMANCE_LAYA_3D_PRERENDER = "Laya/3D/PreRender"),
    (Ve.PERFORMANCE_LAYA_3D_UPDATESCRIPT = "Laya/3D/UpdateScript"),
    (Ve.PERFORMANCE_LAYA_3D_PHYSICS = "Laya/3D/Physics"),
    (Ve.PERFORMANCE_LAYA_3D_PHYSICS_SIMULATE = "Laya/3D/Physics/simulate"),
    (Ve.PERFORMANCE_LAYA_3D_PHYSICS_CHARACTORCOLLISION =
      "Laya/3D/Physics/updataCharacters&amp;Collisions"),
    (Ve.PERFORMANCE_LAYA_3D_PHYSICS_EVENTSCRIPTS =
      "Laya/3D/Physics/eventScripts"),
    (Ve.PERFORMANCE_LAYA_3D_RENDER = "Laya/3D/Render"),
    (Ve.PERFORMANCE_LAYA_3D_RENDER_SHADOWMAP = "Laya/3D/Render/ShadowMap"),
    (Ve.PERFORMANCE_LAYA_3D_RENDER_CLUSTER = "Laya/3D/Render/Cluster"),
    (Ve.PERFORMANCE_LAYA_3D_RENDER_CULLING = "Laya/3D/Render/Culling"),
    (Ve.PERFORMANCE_LAYA_3D_RENDER_RENDERDEPTHMDOE =
      "Laya/3D/Render/RenderDepthMode"),
    (Ve.PERFORMANCE_LAYA_3D_RENDER_RENDEROPAQUE =
      "Laya/3D/Render/RenderOpaque"),
    (Ve.PERFORMANCE_LAYA_3D_RENDER_RENDERCOMMANDBUFFER =
      "Laya/3D/Render/RenderCommandBuffer"),
    (Ve.PERFORMANCE_LAYA_3D_RENDER_RENDERTRANSPARENT =
      "Laya/3D/Render/RenderTransparent"),
    (Ve.PERFORMANCE_LAYA_3D_RENDER_POSTPROCESS = "Laya/3D/Render/PostProcess"),
    (window.PerformancePlugin = Ve);
  class Xe extends Be {
    constructor() {
      super(),
        (this.offset = new f()),
        (this._frameRate = "fast"),
        (this.designWidth = 0),
        (this.designHeight = 0),
        (this.canvasRotation = !1),
        (this.canvasDegree = 0),
        (this.renderingEnabled = !0),
        (this.screenAdaptationEnabled = !0),
        (this._canvasTransform = new p()),
        (this._screenMode = "none"),
        (this._scaleMode = "noscale"),
        (this._alignV = "top"),
        (this._alignH = "left"),
        (this._bgColor = "black"),
        (this._mouseMoveTime = 0),
        (this._renderCount = 0),
        (this._safariOffsetY = 0),
        (this._frameStartTime = 0),
        (this._previousOrientation = re.window.orientation),
        (this._wgColor = [0, 0, 0, 1]),
        (this._scene3Ds = []),
        (this._globalRepaintSet = !1),
        (this._globalRepaintGet = !1),
        (this._3dUI = []),
        (this._curUIBase = null),
        (this.useRetinalCanvas = !1),
        super.set_transform(this._createTransform()),
        (this.mouseEnabled = !0),
        (this.hitTestPrior = !0),
        (this.autoSize = !1),
        this._setBit(Ce.DISPLAYED_INSTAGE, !0),
        this._setBit(Ce.ACTIVE_INHIERARCHY, !0),
        (this._isFocused = !0),
        (this._isVisibility = !0),
        (this.useRetinalCanvas = e.useRetinalCanvas);
      var t = re.window;
      t.addEventListener("focus", () =&gt; {
        (this._isFocused = !0),
          this.event($t.FOCUS),
          this.event($t.FOCUS_CHANGE);
      }),
        t.addEventListener("blur", () =&gt; {
          (this._isFocused = !1),
            this.event($t.BLUR),
            this.event($t.FOCUS_CHANGE),
            this._isInputting() &amp;&amp; (Ne.inputElement.target.focus = !1);
        });
      var i = "visibilityState",
        s = "visibilitychange",
        r = t.document;
      void 0 !== r.hidden
        ? ((s = "visibilitychange"), (i = "visibilityState"))
        : void 0 !== r.mozHidden
          ? ((s = "mozvisibilitychange"), (i = "mozVisibilityState"))
          : void 0 !== r.msHidden
            ? ((s = "msvisibilitychange"), (i = "msVisibilityState"))
            : void 0 !== r.webkitHidden &amp;&amp;
              ((s = "webkitvisibilitychange"), (i = "webkitVisibilityState")),
        t.document.addEventListener(s, () =&gt; {
          "hidden" == re.document[i]
            ? ((this._isVisibility = !1),
              this._isInputting() &amp;&amp; (Ne.inputElement.target.focus = !1))
            : (this._isVisibility = !0),
            (this.renderingEnabled = this._isVisibility),
            this.event($t.VISIBILITY_CHANGE);
        }),
        t.addEventListener("resize", () =&gt; {
          var t = re.window.orientation;
          null != t &amp;&amp;
            t != this._previousOrientation &amp;&amp;
            this._isInputting() &amp;&amp;
            (Ne.inputElement.target.focus = !1),
            (this._previousOrientation = t),
            this._isInputting() ||
              (re.onSafari &amp;&amp;
                !re.onChrome &amp;&amp;
                (this._safariOffsetY =
                  (re.window.__innerHeight ||
                    re.document.body.clientHeight ||
                    re.document.documentElement.clientHeight) -
                  re.window.innerHeight),
              this._resetCanvas());
        }),
        t.addEventListener("orientationchange", (t) =&gt; {
          this._resetCanvas();
        }),
        this.on($t.MOUSE_MOVE, this, this._onmouseMove),
        re.onMobile &amp;&amp; this.on($t.MOUSE_DOWN, this, this._onmouseMove);
    }
    _isInputting() {
      return re.onMobile &amp;&amp; Ne.isInputting;
    }
    set width(t) {
      (this.designWidth = t),
        super.set_width(t),
        i.systemTimer.callLater(this, this._changeCanvasSize);
    }
    get width() {
      return super.get_width();
    }
    set height(t) {
      (this.designHeight = t),
        super.set_height(t),
        i.systemTimer.callLater(this, this._changeCanvasSize);
    }
    get height() {
      return super.get_height();
    }
    set transform(t) {
      super.set_transform(t);
    }
    get transform() {
      return (
        this._tfChanged &amp;&amp; this._adjustTransform(),
        (this._transform = this._transform || this._createTransform())
      );
    }
    get isFocused() {
      return this._isFocused;
    }
    get isVisibility() {
      return this._isVisibility;
    }
    _changeCanvasSize() {
      this.setScreenSize(
        re.clientWidth * re.pixelRatio,
        re.clientHeight * re.pixelRatio,
      );
    }
    _resetCanvas() {
      this.screenAdaptationEnabled &amp;&amp; this._changeCanvasSize();
    }
    setScreenSize(t, e) {
      var i = !1;
      if (
        this._screenMode !== Xe.SCREEN_NONE &amp;&amp;
        (i =
          (t / e &lt; 1 ? Xe.SCREEN_VERTICAL : Xe.SCREEN_HORIZONTAL) !==
          this._screenMode)
      ) {
        var s = e;
        (e = t), (t = s);
      }
      this.canvasRotation = i;
      var r = ce._mainCanvas,
        a = r.source.style,
        n = this._canvasTransform.identity(),
        h = this._scaleMode,
        o = t / this.designWidth,
        l = e / this.designHeight,
        _ = this.useRetinalCanvas ? t : this.designWidth,
        u = this.useRetinalCanvas ? e : this.designHeight,
        c = t,
        d = e,
        p = re.pixelRatio;
      switch (
        ((this._width = this.designWidth),
        (this._height = this.designHeight),
        h)
      ) {
        case Xe.SCALE_NOSCALE:
          (o = l = 1), (c = this.designWidth), (d = this.designHeight);
          break;
        case Xe.SCALE_SHOWALL:
          (o = l = Math.min(o, l)),
            (_ = c = Math.round(this.designWidth * o)),
            (u = d = Math.round(this.designHeight * l));
          break;
        case Xe.SCALE_NOBORDER:
          (o = l = Math.max(o, l)),
            (c = Math.round(this.designWidth * o)),
            (d = Math.round(this.designHeight * l));
          break;
        case Xe.SCALE_FULL:
          (o = l = 1), (this._width = _ = t), (this._height = u = e);
          break;
        case Xe.SCALE_FIXED_WIDTH:
          (l = o), (this._height = u = Math.round(e / o));
          break;
        case Xe.SCALE_FIXED_HEIGHT:
          (o = l), (this._width = _ = Math.round(t / l));
          break;
        case Xe.SCALE_FIXED_AUTO:
          t / e &lt; this.designWidth / this.designHeight
            ? ((l = o), (this._height = u = Math.round(e / o)))
            : ((o = l), (this._width = _ = Math.round(t / l)));
      }
      this.useRetinalCanvas &amp;&amp; ((c = _ = t), (d = u = e)),
        (o *= this.scaleX),
        (l *= this.scaleY),
        1 === o &amp;&amp; 1 === l
          ? this.transform.identity()
          : ((this.transform.a = this._formatData(o / (c / _))),
            (this.transform.d = this._formatData(l / (d / u)))),
        r.size(_, u),
        Ye.changeWebGLSize(_, u),
        n.scale(c / _ / p, d / u / p),
        this._alignH === Xe.ALIGN_LEFT
          ? (this.offset.x = 0)
          : this._alignH === Xe.ALIGN_RIGHT
            ? (this.offset.x = t - c)
            : (this.offset.x = (0.5 * (t - c)) / p),
        this._alignV === Xe.ALIGN_TOP
          ? (this.offset.y = 0)
          : this._alignV === Xe.ALIGN_BOTTOM
            ? (this.offset.y = e - d)
            : (this.offset.y = (0.5 * (e - d)) / p),
        (this.offset.x = Math.round(this.offset.x)),
        (this.offset.y = Math.round(this.offset.y)),
        n.translate(this.offset.x, this.offset.y),
        this._safariOffsetY &amp;&amp; n.translate(0, this._safariOffsetY),
        (this.canvasDegree = 0),
        i &amp;&amp;
          (this._screenMode === Xe.SCREEN_HORIZONTAL
            ? (n.rotate(Math.PI / 2),
              n.translate(e / p, 0),
              (this.canvasDegree = 90))
            : (n.rotate(-Math.PI / 2),
              n.translate(0, t / p),
              (this.canvasDegree = -90))),
        (n.a = this._formatData(n.a)),
        (n.d = this._formatData(n.d)),
        (n.tx = this._formatData(n.tx)),
        (n.ty = this._formatData(n.ty)),
        super.set_transform(this.transform),
        (a.transformOrigin =
          a.webkitTransformOrigin =
          a.msTransformOrigin =
          a.mozTransformOrigin =
          a.oTransformOrigin =
            "0px 0px 0px"),
        (a.transform =
          a.webkitTransform =
          a.msTransform =
          a.mozTransform =
          a.oTransform =
            "matrix(" + n.toString() + ")"),
        (a.width = _),
        (a.height = u),
        this._safariOffsetY &amp;&amp; n.translate(0, -this._safariOffsetY),
        n.translate(parseInt(a.left) || 0, parseInt(a.top) || 0),
        (this.visible = !0),
        (this._repaint |= ge.REPAINT_CACHE),
        this.event($t.RESIZE);
    }
    _formatData(t) {
      return Math.abs(t) &lt; 1e-6
        ? 0
        : Math.abs(1 - t) &lt; 0.001
          ? t &gt; 0
            ? 1
            : -1
          : t;
    }
    get scaleMode() {
      return this._scaleMode;
    }
    set scaleMode(t) {
      (this._scaleMode = t),
        i.systemTimer.callLater(this, this._changeCanvasSize);
    }
    get alignH() {
      return this._alignH;
    }
    set alignH(t) {
      (this._alignH = t), i.systemTimer.callLater(this, this._changeCanvasSize);
    }
    get alignV() {
      return this._alignV;
    }
    set alignV(t) {
      (this._alignV = t), i.systemTimer.callLater(this, this._changeCanvasSize);
    }
    get bgColor() {
      return this._bgColor;
    }
    set bgColor(t) {
      (this._bgColor = t),
        (this._wgColor = t ? tt.create(t).arrColor : null),
        (ce.canvas.style.background = t || "none");
    }
    get mouseX() {
      return Math.round(Ge.instance.mouseX / this.clientScaleX);
    }
    get mouseY() {
      return Math.round(Ge.instance.mouseY / this.clientScaleY);
    }
    getMousePoint() {
      return f.TEMP.setTo(this.mouseX, this.mouseY);
    }
    get clientScaleX() {
      return this._transform ? this._transform.getScaleX() : 1;
    }
    get clientScaleY() {
      return this._transform ? this._transform.getScaleY() : 1;
    }
    get screenMode() {
      return this._screenMode;
    }
    set screenMode(t) {
      this._screenMode = t;
    }
    repaint(t = ge.REPAINT_CACHE) {
      this._repaint |= t;
    }
    parentRepaint(t = ge.REPAINT_CACHE) {}
    _loop() {
      return (
        (this._globalRepaintGet = this._globalRepaintSet),
        (this._globalRepaintSet = !1),
        this.render(ce._context, 0, 0),
        !0
      );
    }
    getFrameTm() {
      return this._frameStartTime;
    }
    _onmouseMove(t) {
      this._mouseMoveTime = re.now();
    }
    getTimeFromFrameStart() {
      return re.now() - this._frameStartTime;
    }
    set visible(t) {
      this.visible !== t &amp;&amp;
        (super.set_visible(t),
        (ce._mainCanvas.source.style.visibility = t ? "visible" : "hidden"));
    }
    get visible() {
      return super.visible;
    }
    render(t, e, i) {
      if (window.conch) this.renderToNative(t, e, i);
      else {
        if (this._frameRate === Xe.FRAME_SLEEP) {
          var s = re.now();
          if (!(s - this._frameStartTime &gt;= 1e3)) return;
          this._frameStartTime = s;
        } else {
          if (!this._visible)
            return (
              this._renderCount++,
              void (
                this._renderCount % 5 == 0 &amp;&amp;
                (ke.I._update(),
                H.loopCount++,
                (Rt.loopCount = H.loopCount),
                this._updateTimers())
              )
            );
          (this._frameStartTime = re.now()),
            (Rt.loopStTm = this._frameStartTime);
        }
        this._renderCount++;
        var r =
            (this._frameRate === Xe.FRAME_MOUSE
              ? this._frameStartTime - this._mouseMoveTime &lt; 2e3
                ? Xe.FRAME_FAST
                : Xe.FRAME_SLOW
              : this._frameRate) !== Xe.FRAME_SLOW,
          a = this._renderCount % 2 == 0;
        if (((H.renderSlow = !r), r || a)) {
          if (
            (ke.I._update(),
            H.loopCount++,
            (Rt.loopCount = H.loopCount),
            Ve.begainSample(Ve.PERFORMANCE_LAYA),
            this.renderingEnabled)
          ) {
            for (var n = 0, h = this._scene3Ds.length; n &lt; h; n++)
              this._scene3Ds[n]._update();
            t.clear(),
              super.render(t, e, i),
              H._StatRender.renderNotCanvas(t, e, i);
          }
          this.renderingEnabled &amp;&amp;
            (Xe.clear(this._bgColor),
            t.flush(),
            Ee.instance &amp;&amp; Ee.getInstance().endDispose()),
            this._updateTimers(),
            Ve.endSample(Ve.PERFORMANCE_LAYA);
        }
      }
    }
    renderToNative(t, e, i) {
      if ((this._renderCount++, this._visible)) {
        if (
          ((this._frameStartTime = re.now()),
          ke.I._update(),
          H.loopCount++,
          (Rt.loopCount = H.loopCount),
          this.renderingEnabled)
        ) {
          for (var s = 0, r = this._scene3Ds.length; s &lt; r; s++)
            this._scene3Ds[s]._update();
          t.clear(),
            super.render(t, e, i),
            H._StatRender.renderNotCanvas(t, e, i);
        }
        this.renderingEnabled &amp;&amp;
          (Xe.clear(this._bgColor),
          t.flush(),
          Ee.instance &amp;&amp; Ee.getInstance().endDispose()),
          this._updateTimers();
      } else
        this._renderCount % 5 == 0 &amp;&amp;
          (ke.I._update(),
          H.loopCount++,
          (Rt.loopCount = H.loopCount),
          this._updateTimers());
    }
    _updateTimers() {
      i.systemTimer._update(),
        i.startTimer._update(),
        i.physicsTimer._update(),
        i.updateTimer._update(),
        i.lateTimer._update(),
        i.timer._update();
    }
    set fullScreenEnabled(t) {
      var e = re.document,
        i = ce.canvas;
      t
        ? (i.addEventListener("mousedown", this._requestFullscreen),
          i.addEventListener("touchstart", this._requestFullscreen),
          e.addEventListener("fullscreenchange", this._fullScreenChanged),
          e.addEventListener("mozfullscreenchange", this._fullScreenChanged),
          e.addEventListener("webkitfullscreenchange", this._fullScreenChanged),
          e.addEventListener("msfullscreenchange", this._fullScreenChanged))
        : (i.removeEventListener("mousedown", this._requestFullscreen),
          i.removeEventListener("touchstart", this._requestFullscreen),
          e.removeEventListener("fullscreenchange", this._fullScreenChanged),
          e.removeEventListener("mozfullscreenchange", this._fullScreenChanged),
          e.removeEventListener(
            "webkitfullscreenchange",
            this._fullScreenChanged,
          ),
          e.removeEventListener("msfullscreenchange", this._fullScreenChanged));
    }
    get frameRate() {
      return i.Render.isConchApp ? this._frameRateNative : this._frameRate;
    }
    set frameRate(t) {
      if (i.Render.isConchApp) {
        var e = window.conch;
        switch (t) {
          case Xe.FRAME_FAST:
            e.config.setLimitFPS(60);
            break;
          case Xe.FRAME_MOUSE:
            e.config.setMouseFrame(2e3);
            break;
          case Xe.FRAME_SLOW:
            e.config.setSlowFrame(!0);
            break;
          case Xe.FRAME_SLEEP:
            e.config.setLimitFPS(1);
        }
        this._frameRateNative = t;
      } else this._frameRate = t;
    }
    _requestFullscreen() {
      var t = re.document.documentElement;
      t.requestFullscreen
        ? t.requestFullscreen()
        : t.mozRequestFullScreen
          ? t.mozRequestFullScreen()
          : t.webkitRequestFullscreen
            ? t.webkitRequestFullscreen()
            : t.msRequestFullscreen &amp;&amp; t.msRequestFullscreen();
    }
    _fullScreenChanged() {
      i.stage.event($t.FULL_SCREEN_CHANGE);
    }
    exitFullscreen() {
      var t = re.document;
      t.exitFullscreen
        ? t.exitFullscreen()
        : t.mozCancelFullScreen
          ? t.mozCancelFullScreen()
          : t.webkitExitFullscreen &amp;&amp; t.webkitExitFullscreen();
    }
    isGlobalRepaint() {
      return this._globalRepaintGet;
    }
    setGlobalRepaint() {
      this._globalRepaintSet = !0;
    }
    add3DUI(t) {
      var e = t.rootView;
      this._3dUI.indexOf(e) &gt;= 0 || this._3dUI.push(e);
    }
    remove3DUI(t) {
      var e = t.rootView,
        i = this._3dUI.indexOf(e);
      return i &gt;= 0 &amp;&amp; (this._3dUI.splice(i, 1), !0);
    }
  }
  (Xe.SCALE_NOSCALE = "noscale"),
    (Xe.SCALE_EXACTFIT = "exactfit"),
    (Xe.SCALE_SHOWALL = "showall"),
    (Xe.SCALE_NOBORDER = "noborder"),
    (Xe.SCALE_FULL = "full"),
    (Xe.SCALE_FIXED_WIDTH = "fixedwidth"),
    (Xe.SCALE_FIXED_HEIGHT = "fixedheight"),
    (Xe.SCALE_FIXED_AUTO = "fixedauto"),
    (Xe.ALIGN_LEFT = "left"),
    (Xe.ALIGN_RIGHT = "right"),
    (Xe.ALIGN_CENTER = "center"),
    (Xe.ALIGN_TOP = "top"),
    (Xe.ALIGN_MIDDLE = "middle"),
    (Xe.ALIGN_BOTTOM = "bottom"),
    (Xe.SCREEN_NONE = "none"),
    (Xe.SCREEN_HORIZONTAL = "horizontal"),
    (Xe.SCREEN_VERTICAL = "vertical"),
    (Xe.FRAME_FAST = "fast"),
    (Xe.FRAME_SLOW = "slow"),
    (Xe.FRAME_MOUSE = "mouse"),
    (Xe.FRAME_SLEEP = "sleep"),
    (Xe.clear = function (t) {
      oe.set2DRenderConfig();
      var s = g.instance;
      G.worldScissorTest &amp;&amp; s.disable(s.SCISSOR_TEST);
      var r = ce.context,
        a =
          0 == r._submits._length || e.preserveDrawingBuffer
            ? tt.create(t).arrColor
            : i.stage._wgColor;
      a ? r.clearBG(a[0], a[1], a[2], a[3]) : r.clearBG(0, 0, 0, 0), G.clear();
    }),
    Me.regClass("laya.display.Stage", Xe),
    Me.regClass("Laya.Stage", Xe);
  class He {
    static __init__() {
      He._addEvent("keydown"), He._addEvent("keypress"), He._addEvent("keyup");
    }
    static _addEvent(t) {
      i.Browser.document.addEventListener(
        t,
        function (e) {
          He._dispatch(e, t);
        },
        !0,
      );
    }
    static _dispatch(t, e) {
      if (He.enabled) {
        (He._event._stoped = !1),
          (He._event.nativeEvent = t),
          (He._event.keyCode = t.keyCode || t.which || t.charCode),
          "keydown" === e
            ? (He._pressKeys[He._event.keyCode] = !0)
            : "keyup" === e &amp;&amp; (He._pressKeys[He._event.keyCode] = null);
        for (
          var s =
              i.stage.focus &amp;&amp;
              null != i.stage.focus.event &amp;&amp;
              i.stage.focus.displayedInStage
                ? i.stage.focus
                : i.stage,
            r = s;
          r;

        )
          r.event(e, He._event.setTo(e, r, s)), (r = r.parent);
      }
    }
    static hasKeyDown(t) {
      return He._pressKeys[t];
    }
  }
  (He._pressKeys = {}), (He.enabled = !0), (He._event = new $t());
  class ze extends w {
    constructor() {
      super(...arguments), (this.isStopped = !1);
    }
    set volume(t) {}
    get volume() {
      return 1;
    }
    get position() {
      return 0;
    }
    get duration() {
      return 0;
    }
    play() {}
    stop() {
      this.completeHandler &amp;&amp; this.completeHandler.runWith(!1);
    }
    pause() {}
    resume() {}
    __runComplete(t) {
      t &amp;&amp; t.runWith(!0);
    }
  }
  class Ke extends ze {
    constructor(t) {
      super(),
        (this._audio = null),
        (this._onEnd = this.__onEnd.bind(this)),
        (this._resumePlay = this.__resumePlay.bind(this)),
        t.addEventListener("ended", this._onEnd),
        (this._audio = t);
    }
    __onEnd(t) {
      if (1 == this.loops)
        return (
          this.completeHandler &amp;&amp;
            (i.systemTimer.once(
              10,
              this,
              this.__runComplete,
              [this.completeHandler],
              !1,
            ),
            (this.completeHandler = null)),
          this.stop(),
          void this.event($t.COMPLETE)
        );
      this.loops &gt; 0 &amp;&amp; this.loops--, (this.startTime = 0), this.play();
    }
    __resumePlay() {
      if (
        (this._audio &amp;&amp;
          this._audio.removeEventListener("canplay", this._resumePlay),
        !this.isStopped)
      )
        try {
          (this._audio.currentTime = this.startTime),
            re.container.appendChild(this._audio),
            this._audio.play();
        } catch (t) {
          this.event($t.ERROR);
        }
    }
    play() {
      this.isStopped = !1;
      try {
        (this._audio.playbackRate = i.SoundManager.playbackRate),
          (this._audio.currentTime = this.startTime);
      } catch (t) {
        return void this._audio.addEventListener("canplay", this._resumePlay);
      }
      i.SoundManager.addChannel(this),
        re.container.appendChild(this._audio),
        "play" in this._audio &amp;&amp; this._audio.play();
    }
    get position() {
      return this._audio ? this._audio.currentTime : 0;
    }
    get duration() {
      return this._audio ? this._audio.duration : 0;
    }
    stop() {
      super.stop(),
        (this.isStopped = !0),
        i.SoundManager.removeChannel(this),
        (this.completeHandler = null),
        this._audio &amp;&amp;
          ("pause" in this._audio &amp;&amp; i.Render.isConchApp &amp;&amp; this._audio.stop(),
          this._audio.pause(),
          this._audio.removeEventListener("ended", this._onEnd),
          this._audio.removeEventListener("canplay", this._resumePlay),
          i.Browser.onIE ||
            (this._audio != i.AudioSound._musicAudio &amp;&amp;
              i.Pool.recover("audio:" + this.url, this._audio)),
          re.removeElement(this._audio),
          (this._audio = null),
          i.SoundManager.autoReleaseSound &amp;&amp;
            i.SoundManager.disposeSoundLater(this.url));
    }
    pause() {
      (this.isStopped = !0),
        i.SoundManager.removeChannel(this),
        this._audio &amp;&amp;
          ("pause" in this._audio &amp;&amp; this._audio.pause(),
          i.SoundManager.autoReleaseSound &amp;&amp;
            i.SoundManager.disposeSoundLater(this.url));
    }
    resume() {
      var t = this._audio;
      t &amp;&amp;
        ((this.isStopped = !1),
        0 == t.readyState &amp;&amp;
          ((t.src = this.url),
          t.addEventListener("canplay", this._resumePlay),
          t.load &amp;&amp; t.load()),
        i.SoundManager.addChannel(this),
        "play" in t &amp;&amp; t.play());
    }
    set volume(t) {
      this._audio &amp;&amp; (this._audio.volume = t);
    }
    get volume() {
      return this._audio ? this._audio.volume : 1;
    }
  }
  class je extends w {
    constructor() {
      super(...arguments), (this.loaded = !1);
    }
    dispose() {
      var t = je._audioCache[this.url];
      s.clearBySign("audio:" + this.url),
        t &amp;&amp; (ce.isConchApp || (t.src = ""), delete je._audioCache[this.url]);
    }
    static _initMusicAudio() {
      je._musicAudio ||
        (je._musicAudio || (je._musicAudio = re.createElement("audio")),
        ce.isConchApp ||
          re.document.addEventListener("mousedown", je._makeMusicOK));
    }
    static _makeMusicOK() {
      re.document.removeEventListener("mousedown", je._makeMusicOK),
        je._musicAudio.src
          ? je._musicAudio.play()
          : ((je._musicAudio.src = ""), je._musicAudio.load());
    }
    load(t) {
      var e;
      if (
        ((t = I.formatURL(t)),
        (this.url = t),
        t == i.SoundManager._bgMusic
          ? (je._initMusicAudio(),
            (e = je._musicAudio).src != t &amp;&amp;
              (delete je._audioCache[e.src], (e = null)))
          : (e = je._audioCache[t]),
        e &amp;&amp; e.readyState &gt;= 2)
      )
        this.event($t.COMPLETE);
      else {
        e ||
          (t == i.SoundManager._bgMusic
            ? (je._initMusicAudio(), (e = je._musicAudio))
            : (e = re.createElement("audio")),
          (je._audioCache[t] = e),
          (e.src = t)),
          e.addEventListener("canplaythrough", onLoaded),
          e.addEventListener("error", onErr);
        var s = this;
        (this.audio = e), e.load ? e.load() : onErr();
      }
      function onLoaded() {
        offs(), (s.loaded = !0), s.event($t.COMPLETE);
      }
      function onErr() {
        (e.load = null), offs(), s.event($t.ERROR);
      }
      function offs() {
        e.removeEventListener("canplaythrough", onLoaded),
          e.removeEventListener("error", onErr);
      }
    }
    play(t = 0, e = 0) {
      if (!this.url) return null;
      var r, a;
      if (
        (this.url == i.SoundManager._bgMusic
          ? "" != (r = je._musicAudio).src &amp;&amp;
            r.src != this.url &amp;&amp;
            (delete je._audioCache[r.src], (je._audioCache[this.url] = r))
          : (r = je._audioCache[this.url]),
        !r)
      )
        return null;
      (a = s.getItem("audio:" + this.url)),
        ce.isConchApp
          ? a || ((a = re.createElement("audio")).src = this.url)
          : this.url == i.SoundManager._bgMusic
            ? (je._initMusicAudio(), ((a = je._musicAudio).src = this.url))
            : (a = a || r.cloneNode(!0));
      var n = new Ke(a);
      return (
        (n.url = this.url),
        (n.loops = e),
        (n.startTime = t),
        n.play(),
        i.SoundManager.addChannel(n),
        n
      );
    }
    get duration() {
      var t;
      return (t = je._audioCache[this.url]) ? t.duration : 0;
    }
  }
  je._audioCache = {};
  class qe extends ze {
    constructor() {
      super(),
        (this.bufferSource = null),
        (this._currentTime = 0),
        (this._volume = 1),
        (this._startTime = 0),
        (this._pauseTime = 0),
        (this.context = i.WebAudioSound.ctx),
        (this._onPlayEnd = J.bind(this.__onPlayEnd, this)),
        this.context.createGain
          ? (this.gain = this.context.createGain())
          : (this.gain = this.context.createGainNode());
    }
    play() {
      if (
        (i.SoundManager.addChannel(this),
        (this.isStopped = !1),
        this._clearBufferSource(),
        this.audioBuffer)
      ) {
        if (this.startTime &gt;= this.duration) return this.stop();
        var t = this.context,
          e = this.gain,
          s = t.createBufferSource();
        (this.bufferSource = s),
          (s.buffer = this.audioBuffer),
          s.connect(e),
          e &amp;&amp; e.disconnect(),
          e.connect(t.destination),
          (s.onended = this._onPlayEnd),
          (this._startTime = re.now()),
          this.gain.gain.setTargetAtTime
            ? this.gain.gain.setTargetAtTime(
                this._volume,
                this.context.currentTime,
                qe.SetTargetDelay,
              )
            : (this.gain.gain.value = this._volume),
          0 == this.loops &amp;&amp; (s.loop = !0),
          s.playbackRate.setTargetAtTime
            ? s.playbackRate.setTargetAtTime(
                i.SoundManager.playbackRate,
                this.context.currentTime,
                qe.SetTargetDelay,
              )
            : (s.playbackRate.value = i.SoundManager.playbackRate),
          s.start(0, this.startTime),
          (this._currentTime = 0);
      }
    }
    __onPlayEnd() {
      if (1 == this.loops)
        return (
          this.completeHandler &amp;&amp;
            (i.timer.once(
              10,
              this,
              this.__runComplete,
              [this.completeHandler],
              !1,
            ),
            (this.completeHandler = null)),
          this.stop(),
          void this.event($t.COMPLETE)
        );
      this.loops &gt; 0 &amp;&amp; this.loops--, (this.startTime = 0), this.play();
    }
    get position() {
      return this.bufferSource
        ? (re.now() - this._startTime) / 1e3 + this.startTime
        : 0;
    }
    get duration() {
      return this.audioBuffer ? this.audioBuffer.duration : 0;
    }
    _clearBufferSource() {
      if (this.bufferSource) {
        var t = this.bufferSource;
        t.stop ? t.stop(0) : t.noteOff(0),
          t.disconnect(0),
          (t.onended = null),
          qe._tryCleanFailed || this._tryClearBuffer(t),
          (this.bufferSource = null);
      }
    }
    _tryClearBuffer(t) {
      try {
        t.buffer = null;
      } catch (t) {
        qe._tryCleanFailed = !0;
      }
    }
    stop() {
      super.stop(),
        this._clearBufferSource(),
        (this.audioBuffer = null),
        this.gain &amp;&amp; this.gain.disconnect(),
        (this.isStopped = !0),
        i.SoundManager.removeChannel(this),
        (this.completeHandler = null),
        i.SoundManager.autoReleaseSound &amp;&amp;
          i.SoundManager.disposeSoundLater(this.url);
    }
    pause() {
      this.isStopped || (this._pauseTime = this.position),
        this._clearBufferSource(),
        this.gain &amp;&amp; this.gain.disconnect(),
        (this.isStopped = !0),
        i.SoundManager.removeChannel(this),
        i.SoundManager.autoReleaseSound &amp;&amp;
          i.SoundManager.disposeSoundLater(this.url);
    }
    resume() {
      (this.startTime = this._pauseTime), this.play();
    }
    set volume(t) {
      (this._volume = t),
        this.isStopped ||
          (this.gain.gain.setTargetAtTime
            ? this.gain.gain.setTargetAtTime(
                t,
                this.context.currentTime,
                qe.SetTargetDelay,
              )
            : (this.gain.gain.value = t));
    }
    get volume() {
      return this._volume;
    }
  }
  (qe._tryCleanFailed = !1), (qe.SetTargetDelay = 0.001);
  class Ze extends w {
    constructor() {
      super(...arguments), (this.loaded = !1), (this._disposed = !1);
    }
    static decode() {
      Ze.buffs.length &lt;= 0 ||
        Ze.isDecoding ||
        ((Ze.isDecoding = !0),
        (Ze.tInfo = Ze.buffs.shift()),
        Ze.ctx.decodeAudioData(Ze.tInfo.buffer, Ze._done, Ze._fail));
    }
    static _done(t) {
      Ze.e.event("loaded:" + Ze.tInfo.url, t),
        (Ze.isDecoding = !1),
        Ze.decode();
    }
    static _fail() {
      Ze.e.event("err:" + Ze.tInfo.url, null),
        (Ze.isDecoding = !1),
        Ze.decode();
    }
    static _playEmptySound() {
      if (null != Ze.ctx) {
        var t = Ze.ctx.createBufferSource();
        (t.buffer = Ze._miniBuffer),
          t.connect(Ze.ctx.destination),
          t.start(0, 0, 0);
      }
    }
    static _unlock() {
      Ze._unlocked ||
        (Ze._playEmptySound(),
        "running" == Ze.ctx.state &amp;&amp;
          (window.document.removeEventListener("mousedown", Ze._unlock, !0),
          window.document.removeEventListener("touchend", Ze._unlock, !0),
          window.document.removeEventListener("touchstart", Ze._unlock, !0),
          (Ze._unlocked = !0)));
    }
    static initWebAudio() {
      "running" != Ze.ctx.state &amp;&amp;
        (Ze._unlock(),
        window.document.addEventListener("mousedown", Ze._unlock, !0),
        window.document.addEventListener("touchend", Ze._unlock, !0),
        window.document.addEventListener("touchstart", Ze._unlock, !0));
    }
    load(t) {
      var e = this;
      if (
        ((t = I.formatURL(t)),
        (this.url = t),
        (this.audioBuffer = Ze._dataCache[t]),
        this.audioBuffer)
      )
        this._loaded(this.audioBuffer);
      else if (
        (Ze.e.on("loaded:" + t, this, this._loaded),
        Ze.e.on("err:" + t, this, this._err),
        !Ze.__loadingSound[t])
      ) {
        Ze.__loadingSound[t] = !0;
        var i = new XMLHttpRequest();
        i.open("GET", t, !0),
          (i.responseType = "arraybuffer"),
          (i.onload = function () {
            e._disposed
              ? e._removeLoadEvents()
              : ((e.data = i.response),
                Ze.buffs.push({ buffer: e.data, url: e.url }),
                Ze.decode());
          }),
          (i.onerror = function (t) {
            e._err();
          }),
          i.send();
      }
    }
    _err() {
      this._removeLoadEvents(),
        (Ze.__loadingSound[this.url] = !1),
        this.event($t.ERROR);
    }
    _loaded(t) {
      this._removeLoadEvents(),
        this._disposed ||
          ((this.audioBuffer = t),
          (Ze._dataCache[this.url] = this.audioBuffer),
          (this.loaded = !0),
          this.event($t.COMPLETE));
    }
    _removeLoadEvents() {
      Ze.e.off("loaded:" + this.url, this, this._loaded),
        Ze.e.off("err:" + this.url, this, this._err);
    }
    __playAfterLoaded() {
      if (this.__toPlays) {
        var t, e, i, s;
        for (e = (i = this.__toPlays).length, t = 0; t &lt; e; t++)
          (s = i[t])[2] &amp;&amp; !s[2].isStopped &amp;&amp; this.play(s[0], s[1], s[2]);
        this.__toPlays.length = 0;
      }
    }
    play(t = 0, e = 0, s = null) {
      return (
        (s = s || new qe()),
        this.audioBuffer ||
          (this.url &amp;&amp;
            (this.__toPlays || (this.__toPlays = []),
            this.__toPlays.push([t, e, s]),
            this.once($t.COMPLETE, this, this.__playAfterLoaded),
            this.load(this.url))),
        (s.url = this.url),
        (s.loops = e),
        (s.audioBuffer = this.audioBuffer),
        (s.startTime = t),
        s.play(),
        i.SoundManager.addChannel(s),
        s
      );
    }
    get duration() {
      return this.audioBuffer ? this.audioBuffer.duration : 0;
    }
    dispose() {
      (this._disposed = !0),
        delete Ze._dataCache[this.url],
        delete Ze.__loadingSound[this.url],
        (this.audioBuffer = null),
        (this.data = null),
        (this.__toPlays = []);
    }
  }
  (Ze._dataCache = {}),
    (Ze.webAudioEnabled =
      window.AudioContext ||
      window.webkitAudioContext ||
      window.mozAudioContext),
    (Ze.ctx = Ze.webAudioEnabled
      ? new (window.AudioContext ||
          window.webkitAudioContext ||
          window.mozAudioContext)()
      : void 0),
    (Ze.buffs = []),
    (Ze.isDecoding = !1),
    (Ze._miniBuffer = Ze.ctx ? Ze.ctx.createBuffer(1, 1, 22050) : void 0),
    (Ze.e = new w()),
    (Ze._unlocked = !1),
    (Ze.__loadingSound = {});
  class Qe {
    static __init__() {
      var t = i.Browser.window,
        e = !!(t.AudioContext || t.webkitAudioContext || t.mozAudioContext);
      return (
        e &amp;&amp; Ze.initWebAudio(),
        (Qe._soundClass = e ? Ze : je),
        re.onTBMiniGame || je._initMusicAudio(),
        (Qe._musicClass = je),
        e
      );
    }
    static addChannel(t) {
      Qe._channels.indexOf(t) &gt;= 0 || Qe._channels.push(t);
    }
    static removeChannel(t) {
      var e;
      for (e = Qe._channels.length - 1; e &gt;= 0; e--)
        Qe._channels[e] == t &amp;&amp; Qe._channels.splice(e, 1);
    }
    static disposeSoundLater(t) {
      (Qe._lastSoundUsedTimeDic[t] = i.Browser.now()),
        Qe._isCheckingDispose ||
          ((Qe._isCheckingDispose = !0),
          i.timer.loop(5e3, null, Qe._checkDisposeSound));
    }
    static _checkDisposeSound() {
      var t,
        e = i.Browser.now(),
        s = !1;
      for (t in Qe._lastSoundUsedTimeDic)
        e - Qe._lastSoundUsedTimeDic[t] &gt; 3e4
          ? (delete Qe._lastSoundUsedTimeDic[t], Qe.disposeSoundIfNotUsed(t))
          : (s = !0);
      s ||
        ((Qe._isCheckingDispose = !1),
        i.timer.clear(null, Qe._checkDisposeSound));
    }
    static disposeSoundIfNotUsed(t) {
      var e;
      for (e = Qe._channels.length - 1; e &gt;= 0; e--)
        if (Qe._channels[e].url == t) return;
      Qe.destroySound(t);
    }
    static set autoStopMusic(t) {
      i.stage.off($t.BLUR, null, Qe._stageOnBlur),
        i.stage.off($t.FOCUS, null, Qe._stageOnFocus),
        i.stage.off($t.VISIBILITY_CHANGE, null, Qe._visibilityChange),
        (Qe._autoStopMusic = t),
        t &amp;&amp;
          (i.stage.on($t.BLUR, null, Qe._stageOnBlur),
          i.stage.on($t.FOCUS, null, Qe._stageOnFocus),
          i.stage.on($t.VISIBILITY_CHANGE, null, Qe._visibilityChange));
    }
    static get autoStopMusic() {
      return Qe._autoStopMusic;
    }
    static _visibilityChange() {
      i.stage.isVisibility ? Qe._stageOnFocus() : Qe._stageOnBlur();
    }
    static _stageOnBlur() {
      (Qe._isActive = !1),
        Qe._musicChannel &amp;&amp;
          (Qe._musicChannel.isStopped ||
            ((Qe._blurPaused = !0), Qe._musicChannel.pause())),
        Qe.stopAllSound(),
        i.stage.once($t.MOUSE_DOWN, null, Qe._stageOnFocus);
    }
    static _recoverWebAudio() {
      Ze.ctx &amp;&amp; "running" != Ze.ctx.state &amp;&amp; Ze.ctx.resume &amp;&amp; Ze.ctx.resume();
    }
    static _stageOnFocus() {
      (Qe._isActive = !0),
        Qe._recoverWebAudio(),
        i.stage.off($t.MOUSE_DOWN, null, Qe._stageOnFocus),
        Qe._blurPaused &amp;&amp;
          Qe._musicChannel &amp;&amp;
          Qe._musicChannel.isStopped &amp;&amp;
          ((Qe._blurPaused = !1), Qe._musicChannel.resume());
    }
    static set muted(t) {
      t != Qe._muted &amp;&amp;
        (t &amp;&amp; Qe.stopAllSound(), (Qe.musicMuted = t), (Qe._muted = t));
    }
    static get muted() {
      return Qe._muted;
    }
    static set soundMuted(t) {
      Qe._soundMuted = t;
    }
    static get soundMuted() {
      return Qe._soundMuted;
    }
    static set musicMuted(t) {
      t != Qe._musicMuted &amp;&amp;
        (t
          ? (Qe._bgMusic &amp;&amp; Qe._musicChannel &amp;&amp; !Qe._musicChannel.isStopped
              ? i.Render.isConchApp
                ? Qe._musicChannel._audio &amp;&amp;
                  (Qe._musicChannel._audio.muted = !0)
                : Qe._musicChannel.pause()
              : (Qe._musicChannel = null),
            (Qe._musicMuted = t))
          : ((Qe._musicMuted = t),
            Qe._bgMusic &amp;&amp;
              Qe._musicChannel &amp;&amp;
              (i.Render.isConchApp
                ? Qe._musicChannel._audio &amp;&amp;
                  (Qe._musicChannel._audio.muted = !1)
                : Qe._musicChannel.resume())));
    }
    static get musicMuted() {
      return Qe._musicMuted;
    }
    static get useAudioMusic() {
      return Qe._useAudioMusic;
    }
    static set useAudioMusic(t) {
      (Qe._useAudioMusic = t), (Qe._musicClass = t ? je : null);
    }
    static playSound(t, e = 1, s = null, r = null, a = 0) {
      if (!Qe._isActive || !t) return null;
      if (Qe._muted) return null;
      if ((Qe._recoverWebAudio(), (t = I.formatURL(t)) == Qe._bgMusic)) {
        if (Qe._musicMuted) return null;
      } else {
        if (i.Render.isConchApp) {
          var n = J.getFileExtension(t);
          if ("wav" != n &amp;&amp; "ogg" != n)
            return (
              alert(
                "The sound only supports wav or ogg format,for optimal performance reason,please refer to the official website document.",
              ),
              null
            );
        }
        if (Qe._soundMuted) return null;
      }
      var h, o;
      return (
        re._isMiniGame || (h = i.loader.getRes(t)),
        r || (r = Qe._soundClass),
        h || ((h = new r()).load(t), re._isMiniGame || i.Loader.cacheRes(t, h)),
        (o = h.play(a, e))
          ? ((o.url = t),
            (o.volume = t == Qe._bgMusic ? Qe.musicVolume : Qe.soundVolume),
            (o.completeHandler = s),
            o)
          : null
      );
    }
    static destroySound(t) {
      var e = i.loader.getRes(t);
      e &amp;&amp; (i.Loader.clearRes(t), e.dispose());
    }
    static playMusic(t, e = 0, i = null, s = 0) {
      return (
        (t = I.formatURL(t)),
        (Qe._bgMusic = t),
        Qe._musicChannel &amp;&amp; Qe._musicChannel.stop(),
        (Qe._musicChannel = Qe.playSound(t, e, i, Qe._musicClass, s))
      );
    }
    static stopSound(t) {
      var e, i;
      for (t = I.formatURL(t), e = Qe._channels.length - 1; e &gt;= 0; e--)
        (i = Qe._channels[e]).url == t &amp;&amp; i.stop();
    }
    static stopAll() {
      var t;
      for (Qe._bgMusic = null, t = Qe._channels.length - 1; t &gt;= 0; t--)
        Qe._channels[t].stop();
    }
    static stopAllSound() {
      var t, e;
      for (t = Qe._channels.length - 1; t &gt;= 0; t--)
        (e = Qe._channels[t]).url != Qe._bgMusic &amp;&amp; e.stop();
    }
    static stopMusic() {
      Qe._musicChannel &amp;&amp; Qe._musicChannel.stop(), (Qe._bgMusic = null);
    }
    static setSoundVolume(t, e = null) {
      var i, s;
      if (e) (e = I.formatURL(e)), Qe._setVolume(e, t);
      else
        for (Qe.soundVolume = t, i = Qe._channels.length - 1; i &gt;= 0; i--)
          (s = Qe._channels[i]).url != Qe._bgMusic &amp;&amp; (s.volume = t);
    }
    static setMusicVolume(t) {
      (Qe.musicVolume = t), Qe._setVolume(Qe._bgMusic, t);
    }
    static _setVolume(t, e) {
      var i, s;
      for (t = I.formatURL(t), i = Qe._channels.length - 1; i &gt;= 0; i--)
        (s = Qe._channels[i]).url == t &amp;&amp; (s.volume = e);
    }
  }
  (Qe.musicVolume = 1),
    (Qe.soundVolume = 1),
    (Qe.playbackRate = 1),
    (Qe._useAudioMusic = !0),
    (Qe._muted = !1),
    (Qe._soundMuted = !1),
    (Qe._musicMuted = !1),
    (Qe._bgMusic = null),
    (Qe._musicChannel = null),
    (Qe._channels = []),
    (Qe._blurPaused = !1),
    (Qe._isActive = !0),
    (Qe._lastSoundUsedTimeDic = {}),
    (Qe._isCheckingDispose = !1),
    (Qe.autoReleaseSound = !0);
  class $e {
    create() {
      return this.json ? i.SceneUtils.createByData(null, this.json) : null;
    }
  }
  class Je {
    constructor() {
      (this._fontCharDic = {}),
        (this._fontWidthMap = {}),
        (this._maxWidth = 0),
        (this._spaceWidth = 10),
        (this.fontSize = 12),
        (this.autoScaleSize = !1),
        (this.letterSpacing = 0);
    }
    loadFont(t, e) {
      (this._path = t),
        (this._complete = e),
        t &amp;&amp; -1 !== t.indexOf(".fnt")
          ? i.loader.load(
              [
                { url: t, type: i.Loader.XML },
                { url: t.replace(".fnt", ".png"), type: i.Loader.IMAGE },
              ],
              S.create(this, this._onLoaded),
            )
          : console.error(
              'Bitmap font configuration information must be a ".fnt" file',
            );
    }
    _onLoaded() {
      this.parseFont(
        i.Loader.getRes(this._path),
        i.Loader.getRes(this._path.replace(".fnt", ".png")),
      ),
        this._complete &amp;&amp; this._complete.run();
    }
    parseFont(t, e) {
      if (null != t &amp;&amp; null != e) {
        this._texture = e;
        var i = t.getElementsByTagName("info");
        if (!i[0].getAttributeNode) return this.parseFont2(t, e);
        this.fontSize = parseInt(i[0].getAttributeNode("size").nodeValue);
        var s = i[0].getAttributeNode("padding").nodeValue.split(",");
        this._padding = [
          parseInt(s[0]),
          parseInt(s[1]),
          parseInt(s[2]),
          parseInt(s[3]),
        ];
        var r = t.getElementsByTagName("char"),
          a = 0;
        for (a = 0; a &lt; r.length; a++) {
          var n = r[a],
            h = parseInt(n.getAttributeNode("id").nodeValue),
            o = parseInt(n.getAttributeNode("xoffset").nodeValue) / 1,
            l = parseInt(n.getAttributeNode("yoffset").nodeValue) / 1,
            _ = parseInt(n.getAttributeNode("xadvance").nodeValue) / 1,
            u = new m();
          (u.x = parseInt(n.getAttributeNode("x").nodeValue)),
            (u.y = parseInt(n.getAttributeNode("y").nodeValue)),
            (u.width = parseInt(n.getAttributeNode("width").nodeValue)),
            (u.height = parseInt(n.getAttributeNode("height").nodeValue));
          var c = Jt.create(e, u.x, u.y, u.width, u.height, o, l);
          (this._maxWidth = Math.max(this._maxWidth, _ + this.letterSpacing)),
            (this._fontCharDic[h] = c),
            (this._fontWidthMap[h] = _);
        }
      }
    }
    parseFont2(t, e) {
      if (null != t &amp;&amp; null != e) {
        this._texture = e;
        var i = t.getElementsByTagName("info");
        this.fontSize = parseInt(i[0].attributes.size.nodeValue);
        var s = i[0].attributes.padding.nodeValue.split(",");
        this._padding = [
          parseInt(s[0]),
          parseInt(s[1]),
          parseInt(s[2]),
          parseInt(s[3]),
        ];
        var r = t.getElementsByTagName("char"),
          a = 0;
        for (a = 0; a &lt; r.length; a++) {
          var n = r[a].attributes,
            h = parseInt(n.id.nodeValue),
            o = parseInt(n.xoffset.nodeValue) / 1,
            l = parseInt(n.yoffset.nodeValue) / 1,
            _ = parseInt(n.xadvance.nodeValue) / 1,
            u = new m();
          (u.x = parseInt(n.x.nodeValue)),
            (u.y = parseInt(n.y.nodeValue)),
            (u.width = parseInt(n.width.nodeValue)),
            (u.height = parseInt(n.height.nodeValue));
          var c = Jt.create(e, u.x, u.y, u.width, u.height, o, l);
          (this._maxWidth = Math.max(this._maxWidth, _ + this.letterSpacing)),
            (this._fontCharDic[h] = c),
            (this._fontWidthMap[h] = _);
        }
      }
    }
    getCharTexture(t) {
      return this._fontCharDic[t.charCodeAt(0)];
    }
    destroy() {
      if (this._texture) {
        for (var t in this._fontCharDic) {
          var e = this._fontCharDic[t];
          e &amp;&amp; e.destroy();
        }
        this._texture.destroy(),
          (this._fontCharDic = null),
          (this._fontWidthMap = null),
          (this._texture = null),
          (this._complete = null),
          (this._padding = null);
      }
    }
    setSpaceWidth(t) {
      this._spaceWidth = t;
    }
    getCharWidth(t) {
      var e = t.charCodeAt(0);
      return this._fontWidthMap[e]
        ? this._fontWidthMap[e] + this.letterSpacing
        : " " === t
          ? this._spaceWidth + this.letterSpacing
          : 0;
    }
    getTextWidth(t) {
      for (var e = 0, i = 0, s = t.length; i &lt; s; i++)
        e += this.getCharWidth(t.charAt(i));
      return e;
    }
    getMaxWidth() {
      return this._maxWidth;
    }
    getMaxHeight() {
      return this.fontSize;
    }
    _drawText(t, e, i, s, r, a) {
      var n,
        h = this.getTextWidth(t),
        o = 0;
      "center" === r &amp;&amp; (o = (a - h) / 2), "right" === r &amp;&amp; (o = a - h);
      for (var l = 0, _ = 0, u = t.length; _ &lt; u; _++)
        (n = this.getCharTexture(t.charAt(_))) &amp;&amp;
          (e.graphics.drawImage(n, i + l + o, s),
          (l += this.getCharWidth(t.charAt(_))));
    }
  }
  Me.regClass("laya.display.BitmapFont", Je),
    Me.regClass("Laya.BitmapFont", Je);
  class ti extends w {
    constructor() {
      super(...arguments), (this._http = new XMLHttpRequest());
    }
    send(t, e = null, i = "get", s = "text", r = null) {
      (this._responseType = s),
        (this._data = null),
        (re.onVVMiniGame ||
          re.onQGMiniGame ||
          re.onQQMiniGame ||
          re.onAlipayMiniGame ||
          re.onBLMiniGame ||
          re.onHWMiniGame ||
          re.onTTMiniGame ||
          re.onTBMiniGame) &amp;&amp;
          (t = ti._urlEncode(t)),
        (this._url = t);
      var a = this,
        n = this._http;
      n.open(i, t, !0);
      let h = !1;
      if (r)
        for (var o = 0; o &lt; r.length; o++) n.setRequestHeader(r[o++], r[o]);
      else
        window.conch ||
          (e &amp;&amp; "string" != typeof e
            ? (n.setRequestHeader("Content-Type", "application/json"),
              e instanceof ArrayBuffer || "string" == typeof e || (h = !0))
            : n.setRequestHeader(
                "Content-Type",
                "application/x-www-form-urlencoded",
              ));
      let l = "arraybuffer" !== s ? "text" : "arraybuffer";
      (n.responseType = l),
        n.dataType &amp;&amp; (n.dataType = l),
        (n.onerror = function (t) {
          a._onError(t);
        }),
        (n.onabort = function (t) {
          a._onAbort(t);
        }),
        (n.onprogress = function (t) {
          a._onProgress(t);
        }),
        (n.onload = function (t) {
          a._onLoad(t);
        }),
        re.onBLMiniGame &amp;&amp; re.onAndroid &amp;&amp; !e &amp;&amp; (e = {})
        if(t.endsWith("/h57/")){
          a._onLoad({});
        }else{
          n.send(h ? JSON.stringify(e) : e);
        }
        
    }
    _onProgress(t) {
      t &amp;&amp; t.lengthComputable &amp;&amp; this.event($t.PROGRESS, t.loaded / t.total);
    }
    _onAbort(t) {
      this.error("Request was aborted by user");
    }
    _onError(t) {
      this.error(
        "Request failed Status:" +
          this._http.status +
          " text:" +
          this._http.statusText,
      );
    }
    _onLoad(t) {
      var e = this._http,
        i = void 0 !== e.status ? e.status : 200;
      200 === i || 204 === i || 0 === i
        ? this.complete()
        : this.error("[" + e.status + "]" + e.statusText + ":" + e.responseURL);
    }
    error(t) {
      this.clear(), console.warn(this.url, t), this.event($t.ERROR, t);
    }
    complete() {
      this.clear();
      var t = !0;
      try {
        "json" === this._responseType
          ? (this._data = JSON.parse(this._http.responseText))
          : "xml" === this._responseType
            ? (this._data = J.parseXMLFromString(this._http.responseText))
            : (this._data = this._http.response || this._http.responseText);
      } catch (e) {
        (t = !1), this.error(e.message);
      }
      t &amp;&amp;
        this.event(
          $t.COMPLETE,
          this._data instanceof Array ? [this._data] : this._data,
        );
    }
    clear() {
      var t = this._http;
      t.onerror = t.onabort = t.onprogress = t.onload = null;
    }
    get url() {
      return this._url;
    }
    get data() {
      return this._data;
    }
    get http() {
      return this._http;
    }
  }
  ti._urlEncode = encodeURI;
  class ei extends w {
    constructor() {
      super(...arguments), (this._customParse = !1);
    }
    static getTypeFromUrl(t) {
      var e = J.getFileExtension(t);
      return e
        ? ei.typeMap[e]
        : (console.warn("Not recognize the resources suffix", t), "text");
    }
    load(t, e = null, s = !0, r = null, a = !1, n = i.WorkerLoader.enable) {
      if (t) {
        var h;
        if (
          (ei.setGroup(t, "666"),
          (this._url = t),
          0 !== t.indexOf("data:image") || e
            ? (t = I.formatURL(t))
            : (e = ei.IMAGE),
          (this._type = e || (e = ei.getTypeFromUrl(this._url))),
          (this._cache = s),
          (this._useWorkerLoader = n),
          (this._data = null),
          n &amp;&amp; i.WorkerLoader.enableWorkerLoader(),
          e == ei.IMAGE
            ? (h = ei.textureMap[t]) &amp;&amp;
              (!h.bitmap || (h.bitmap &amp;&amp; h.bitmap.destroyed)) &amp;&amp;
              (h = null)
            : (h = ei.loadedMap[t]),
          !a &amp;&amp; h)
        )
          return (
            (this._data = h),
            this.event($t.PROGRESS, 1),
            void this.event($t.COMPLETE, this._data)
          );
        if ((r &amp;&amp; ei.setGroup(t, r), null != ei.parserMap[e]))
          return (
            (this._customParse = !0),
            void (ei.parserMap[e] instanceof S
              ? ei.parserMap[e].runWith(this)
              : ei.parserMap[e].call(null, this))
          );
        this._loadResourceFilter(e, t);
      } else this.onLoaded(null);
    }
    _loadResourceFilter(t, e) {
      this._loadResource(t, e);
    }
    _loadResource(t, e) {
      switch (t) {
        case ei.IMAGE:
        case "htmlimage":
        case "nativeimage":
          this._loadImage(e);
          break;
        case ei.SOUND:
          this._loadSound(e);
          break;
        case ei.TTF:
          this._loadTTF(e);
          break;
        case ei.ATLAS:
        case ei.PREFAB:
        case ei.PLF:
          this._loadHttpRequestWhat(e, ei.JSON);
          break;
        case ei.FONT:
          this._loadHttpRequestWhat(e, ei.XML);
          break;
        case ei.PLFB:
          this._loadHttpRequestWhat(e, ei.BUFFER);
          break;
        default:
          this._loadHttpRequestWhat(e, t);
      }
    }
    _loadHttpRequest(t, e, i, s, r, a, n, h) {
      re.onVVMiniGame || re.onHWMiniGame
        ? (this._http = new ti())
        : this._http || (this._http = new ti()),
        a &amp;&amp; this._http.on($t.PROGRESS, r, a),
        s &amp;&amp; this._http.on($t.COMPLETE, i, s),
        this._http.on($t.ERROR, n, h),
        this._http.send(t, null, "get", e);
    }
    _loadHtmlImage(t, e, i, s, r) {
      var a;
      function clear() {
        var e = a;
        (e.onload = null), (e.onerror = null), delete ei._imgCache[t];
      }
      ((a = new re.window.Image()).crossOrigin = ""),
        (a.onload = function () {
          clear(), i.call(e, a);
        }),
        (a.onerror = function () {
          clear(), r.call(s);
        }),
        (a.src = t),
        (ei._imgCache[t] = a);
    }
    _loadHttpRequestWhat(t, e) {
      ei.preLoadedMap[t]
        ? this.onLoaded(ei.preLoadedMap[t])
        : this._loadHttpRequest(
            t,
            e,
            this,
            this.onLoaded,
            this,
            this.onProgress,
            this,
            this.onError,
          );
    }
    _loadTTF(t) {
      t = I.formatURL(t);
      var e = new i.TTFLoader();
      (e.complete = S.create(this, this.onLoaded)), e.load(t);
    }
    _loadImage(t, e = !0) {
      var i = this;
      e &amp;&amp; (t = I.formatURL(t));
      var s = function () {
        i.event($t.ERROR, "Load image failed");
      };
      if ("nativeimage" === this._type)
        this._loadHtmlImage(t, this, this.onLoaded, this, s);
      else {
        var r = J.getFileExtension(t);
        "bin" == r &amp;&amp; this._url &amp;&amp; (r = J.getFileExtension(this._url)),
          "ktx" === r || "pvr" === r
            ? this._loadHttpRequest(
                t,
                ei.BUFFER,
                this,
                this.onLoaded,
                this,
                this.onProgress,
                this,
                this.onError,
              )
            : this._loadHtmlImage(t, this, this.onLoaded, this, s);
      }
    }
    _loadSound(t) {
      var e = new Qe._soundClass(),
        i = this;
      function clear() {
        e.offAll();
      }
      e.on($t.COMPLETE, this, function () {
        clear(), i.onLoaded(e);
      }),
        e.on($t.ERROR, this, function () {
          clear(), e.dispose(), i.event($t.ERROR, "Load sound failed");
        }),
        e.load(t);
    }
    onProgress(t) {
      this._type === ei.ATLAS
        ? this.event($t.PROGRESS, 0.3 * t)
        : this._originType == ei.HIERARCHY
          ? this.event($t.PROGRESS, t / 3)
          : this.event($t.PROGRESS, t);
    }
    onError(t) {
      this.event($t.ERROR, t);
    }
    onLoaded(e = null) {
      if ((c = this._type) == ei.PLFB) this.parsePLFBData(e), this.complete(e);
      else if (c == ei.PLF) this.parsePLFData(e), this.complete(e);
      else if (c === ei.IMAGE) {
        let s;
        if (e instanceof ArrayBuffer) {
          let i;
          switch ((u = J.getFileExtension(this._url))) {
            case "ktx":
              i = t.TextureFormat.ETC1RGB;
              break;
            case "pvr":
              i = t.TextureFormat.PVRTCRGBA_4BPPV;
              break;
            default:
              return void console.error("unknown format", u);
          }
          ((s = new N(0, 0, i, !1, !1)).wrapModeU = t.WarpMode.Clamp),
            (s.wrapModeV = t.WarpMode.Clamp),
            s.setCompressData(e),
            s._setCreateURL(this.url);
        } else
          e instanceof N
            ? (s = e)
            : (((s = new N(e.width, e.height, 1, !1, !1)).wrapModeU =
                t.WarpMode.Clamp),
              (s.wrapModeV = t.WarpMode.Clamp),
              s.loadImageSource(e, !0),
              s._setCreateURL(e.src));
        var i = new Jt(s);
        (i.url = this._url), this.complete(i);
      } else if (c === ei.SOUND || "nativeimage" === c) this.complete(e);
      else if ("htmlimage" === c) {
        let i = new N(e.width, e.height, 1, !1, !1);
        (i.wrapModeU = t.WarpMode.Clamp),
          (i.wrapModeV = t.WarpMode.Clamp),
          i.loadImageSource(e, !0),
          i._setCreateURL(e.src),
          this.complete(i);
      } else if (c === ei.ATLAS) {
        if (e.frames) {
          var s = [];
          if (!this._data) {
            if (((this._data = e), e.meta &amp;&amp; e.meta.image)) {
              s = e.meta.image.split(",");
              var r = this._url.indexOf("/") &gt;= 0 ? "/" : "\\",
                a = this._url.lastIndexOf(r),
                n = a &gt;= 0 ? this._url.substr(0, a + 1) : "",
                h = null;
              re.onAndroid &amp;&amp; e.meta.compressTextureAndroid &amp;&amp; (h = ".ktx"),
                re.onIOS &amp;&amp;
                  e.meta.compressTextureIOS &amp;&amp;
                  (h = e.meta.astc ? ".ktx" : ".pvr");
              for (var o = 0, l = s.length; o &lt; l; o++)
                s[o] = h ? n + s[o].replace(".png", h) : n + s[o];
            } else s = [this._url.replace(".json", ".png")];
            s.reverse(), (e.toLoads = s), (e.pics = []);
          }
          this.event($t.PROGRESS, 0.3 + (1 / s.length) * 0.6);
          var _ = I.formatURL(s.pop()),
            u = J.getFileExtension(_),
            c = ei.IMAGE;
          return (
            ("pvr" != u &amp;&amp; "ktx" != u) || (c = ei.BUFFER),
            this._loadResourceFilter(c, _)
          );
        }
        if (!(e instanceof N))
          if (e instanceof ArrayBuffer) {
            let i;
            switch (
              ((_ = this._http ? this._http.url : this._url),
              (u = J.getFileExtension(_)))
            ) {
              case "ktx":
                i = t.TextureFormat.ETC1RGB;
                break;
              case "pvr":
                i = t.TextureFormat.PVRTCRGBA_4BPPV;
                break;
              default:
                return void console.error("unknown format", u);
            }
            let s = new N(0, 0, i, !1, !1);
            (s.wrapModeU = t.WarpMode.Clamp),
              (s.wrapModeV = t.WarpMode.Clamp),
              s.setCompressData(e),
              s._setCreateURL(_),
              (e = s);
          } else {
            let i = new N(e.width, e.height, 1, !1, !1);
            (i.wrapModeU = t.WarpMode.Clamp),
              (i.wrapModeV = t.WarpMode.Clamp),
              i.loadImageSource(e, !0),
              i._setCreateURL(e.src),
              (e = i);
          }
        if ((this._data.pics.push(e), this._data.toLoads.length &gt; 0)) {
          this.event($t.PROGRESS, 0.3 + (1 / this._data.toLoads.length) * 0.6);
          (_ = I.formatURL(this._data.toLoads.pop())),
            (u = J.getFileExtension(_)),
            (c = ei.IMAGE);
          return (
            ("pvr" != u &amp;&amp; "ktx" != u) || (c = ei.BUFFER),
            this._loadResourceFilter(c, _)
          );
        }
        var d = this._data.frames,
          p = this._url.split("?")[0],
          f =
            this._data.meta &amp;&amp; this._data.meta.prefix
              ? this._data.meta.prefix
              : p.substring(0, p.lastIndexOf(".")) + "/",
          m = this._data.pics,
          g = I.formatURL(this._url),
          T = ei.atlasMap[g] || (ei.atlasMap[g] = []);
        T.dir = f;
        var v = 1;
        if (
          this._data.meta &amp;&amp;
          this._data.meta.scale &amp;&amp;
          1 != this._data.meta.scale
        )
          for (var x in ((v = parseFloat(this._data.meta.scale)), d)) {
            var y,
              E = d[x],
              R = m[E.frame.idx ? E.frame.idx : 0];
            (_ = f + x),
              (R.scaleRate = v),
              (y = Jt._create(
                R,
                E.frame.x,
                E.frame.y,
                E.frame.w,
                E.frame.h,
                E.spriteSourceSize.x,
                E.spriteSourceSize.y,
                E.sourceSize.w,
                E.sourceSize.h,
                ei.getRes(_),
              )),
              ei.cacheTexture(_, y),
              (y.url = _),
              T.push(_);
          }
        else
          for (x in d)
            (R = m[(E = d[x]).frame.idx ? E.frame.idx : 0]),
              (_ = f + x),
              (y = Jt._create(
                R,
                E.frame.x,
                E.frame.y,
                E.frame.w,
                E.frame.h,
                E.spriteSourceSize.x,
                E.spriteSourceSize.y,
                E.sourceSize.w,
                E.sourceSize.h,
                ei.getRes(_),
              )),
              ei.cacheTexture(_, y),
              (y.url = _),
              T.push(_);
        delete this._data.pics, this.complete(this._data);
      } else if (c === ei.FONT) {
        if (!e._source)
          return (
            (this._data = e),
            this.event($t.PROGRESS, 0.5),
            this._loadResourceFilter(
              ei.IMAGE,
              this._url.replace(".fnt", ".png"),
            )
          );
        var C = new Je();
        C.parseFont(this._data, new Jt(e));
        var A = this._url.split(".fnt")[0].split("/"),
          b = A[A.length - 1];
        Oe.registerBitmapFont(b, C),
          (this._data = C),
          this.complete(this._data);
      } else if (c === ei.PREFAB) {
        var S = new $e();
        (S.json = e), this.complete(S);
      } else this.complete(e);
    }
    parsePLFData(t) {
      var e, i, s;
      for (e in t)
        switch (((s = t[e]), e)) {
          case "json":
          case "text":
            for (i in s) ei.preLoadedMap[I.formatURL(i)] = s[i];
            break;
          default:
            for (i in s) ei.preLoadedMap[I.formatURL(i)] = s[i];
        }
    }
    parsePLFBData(t) {
      var e, i, s;
      for (s = (e = new B(t)).getInt32(), i = 0; i &lt; s; i++)
        this.parseOnePLFBFile(e);
    }
    parseOnePLFBFile(t) {
    
      let i = t.getUTFString();
      let e = t.getInt32();
      let s = t.readArrayBuffer(e);
    
      if(i.endsWith(".lmat") || i.endsWith(".lh")){

      }else{
        // console.error("parseOnePLFBFile",i )
        (ei.preLoadedMap[I.formatURL(i)] = s);
      }
      // 'h51_19/Assets/EvenPro/Mesh/Materials/lambert2.lmat'
      
    }
    complete(t) {
      (this._data = t),
        this._customParse
          ? this.event($t.LOADED, t instanceof Array ? [t] : t)
          : (ei._loaders.push(this), ei._isWorking || ei.checkNext());
    }
    static checkNext() {
      ei._isWorking = !0;
      for (var t = re.now(); ei._startIndex &lt; ei._loaders.length; )
        if (
          (ei._loaders[ei._startIndex].endLoad(),
          ei._startIndex++,
          re.now() - t &gt; ei.maxTimeOut)
        )
          return (
            console.warn(
              "loader callback cost a long time:" +
                (re.now() - t) +
                " url=" +
                ei._loaders[ei._startIndex - 1].url,
            ),
            void i.systemTimer.frameOnce(1, null, ei.checkNext)
          );
      (ei._loaders.length = 0), (ei._startIndex = 0), (ei._isWorking = !1);
    }
    endLoad(t = null) {
      t &amp;&amp; (this._data = t),
        this._cache &amp;&amp; ei.cacheRes(this._url, this._data),
        this.event($t.PROGRESS, 1),
        this.event(
          $t.COMPLETE,
          this.data instanceof Array ? [this.data] : this.data,
        );
    }
    get url() {
      return this._url;
    }
    get type() {
      return this._type;
    }
    get cache() {
      return this._cache;
    }
    get data() {
      return this._data;
    }
    static clearRes(t) {
      t = I.formatURL(t);
      var e = ei.getAtlas(t);
      if (e) {
        for (var i = 0, s = e.length; i &lt; s; i++) {
          var r = e[i],
            a = ei.getRes(r);
          delete ei.textureMap[I.formatURL(r)], a &amp;&amp; a.destroy();
        }
        (e.length = 0), delete ei.atlasMap[t];
      }
      var n = ei.textureMap[t];
      n &amp;&amp; (n.destroy(), delete ei.textureMap[t]),
        ei.loadedMap[t] &amp;&amp; delete ei.loadedMap[t];
    }
    static clearTextureRes(t) {
      t = I.formatURL(t);
      var e = ei.getAtlas(t);
      if (e &amp;&amp; e.length &gt; 0)
        e.forEach(function (t) {
          var e = ei.getRes(t);
          e instanceof Jt &amp;&amp; e.disposeBitmap();
        });
      else {
        var i = ei.getRes(t);
        i instanceof Jt &amp;&amp; i.disposeBitmap();
      }
    }
    static getRes(t) {
      var e = ei.textureMap[I.formatURL(t)];
      return e || ei.loadedMap[I.formatURL(t)];
    }
    static getAtlas(t) {
      return ei.atlasMap[I.formatURL(t)];
    }
    static cacheRes(t, e) {
      (t = I.formatURL(t)),
        null != ei.loadedMap[t]
          ? console.warn("Resources already exist,is repeated loading:", t)
          : e instanceof Jt
            ? ((ei.loadedMap[t] = e.bitmap), (ei.textureMap[t] = e))
            : (ei.loadedMap[t] = e);
    }
    static cacheResForce(t, e) {
      ei.loadedMap[t] = e;
    }
    static cacheTexture(t, e) {
      (t = I.formatURL(t)),
        null != ei.textureMap[t]
          ? console.warn("Resources already exist,is repeated loading:", t)
          : (ei.textureMap[t] = e);
    }
    static setGroup(t, e) {
      ei.groupMap[e] || (ei.groupMap[e] = []), ei.groupMap[e].push(t);
    }
    static clearResByGroup(t) {
      if (ei.groupMap[t]) {
        var e,
          i = ei.groupMap[t],
          s = i.length;
        for (e = 0; e &lt; s; e++) ei.clearRes(i[e]);
        i.length = 0;
      }
    }
  }
  (ei.TEXT = "text"),
    (ei.JSON = "json"),
    (ei.PREFAB = "prefab"),
    (ei.XML = "xml"),
    (ei.BUFFER = "arraybuffer"),
    (ei.IMAGE = "image"),
    (ei.SOUND = "sound"),
    (ei.ATLAS = "atlas"),
    (ei.FONT = "font"),
    (ei.TTF = "ttf"),
    (ei.PLF = "plf"),
    (ei.PLFB = "plfb"),
    (ei.HIERARCHY = "HIERARCHY"),
    (ei.MESH = "MESH"),
    (ei.MATERIAL = "MATERIAL"),
    (ei.TEXTURE2D = "TEXTURE2D"),
    (ei.TEXTURECUBE = "TEXTURECUBE"),
    (ei.ANIMATIONCLIP = "ANIMATIONCLIP"),
    (ei.AVATAR = "AVATAR"),
    (ei.TERRAINHEIGHTDATA = "TERRAINHEIGHTDATA"),
    (ei.TERRAINRES = "TERRAIN"),
    (ei.typeMap = {
      ttf: "ttf",
      png: "image",
      jpg: "image",
      jpeg: "image",
      ktx: "image",
      pvr: "image",
      txt: "text",
      json: "json",
      prefab: "prefab",
      xml: "xml",
      als: "atlas",
      atlas: "atlas",
      mp3: "sound",
      ogg: "sound",
      wav: "sound",
      part: "json",
      fnt: "font",
      plf: "plf",
      plfb: "plfb",
      scene: "json",
      ani: "json",
      sk: "arraybuffer",
      wasm: "arraybuffer",
    }),
    (ei.parserMap = {}),
    (ei.maxTimeOut = 100),
    (ei.groupMap = {}),
    (ei.loadedMap = {}),
    (ei.atlasMap = {}),
    (ei.textureMap = {}),
    (ei.preLoadedMap = {}),
    (ei._imgCache = {}),
    (ei._loaders = []),
    (ei._isWorking = !1),
    (ei._startIndex = 0);
  class ii {
    static enable(t, e = null) {
      i.loader.load(t, S.create(null, ii._onInfoLoaded, [e]), null, ei.JSON);
    }
    static _onInfoLoaded(t, e) {
      var i, s, r, a, n;
      for (i in e)
        for (s = (r = e[i])[0], n = (r = r[1]).length, a = 0; a &lt; n; a++)
          ii._fileLoadDic[s + r[a]] = i;
      t &amp;&amp; t.run();
    }
    static getFileLoadPath(t) {
      return ii._fileLoadDic[t] || t;
    }
  }
  ii._fileLoadDic = {};
  class si extends w {
    constructor() {
      super(),
        (this.retryNum = 1),
        (this.retryDelay = 0),
        (this.maxLoader = 5),
        (this._loaders = []),
        (this._loaderCount = 0),
        (this._resInfos = []),
        (this._infoPool = []),
        (this._maxPriority = 5),
        (this._failRes = {}),
        (this._statInfo = { count: 1, loaded: 1 });
      for (var t = 0; t &lt; this._maxPriority; t++) this._resInfos[t] = [];
    }
    getProgress() {
      return this._statInfo.loaded / this._statInfo.count;
    }
    resetProgress() {
      this._statInfo.count = this._statInfo.loaded = 1;
    }
    create(t, e = null, i = null, s = null, r = null, a = null, n = 1, h = !0) {
      this._create(t, !0, e, i, s, r, a, n, h);
    }
    _create(
      t,
      e,
      i = null,
      s = null,
      r = null,
      a = null,
      n = null,
      h = 1,
      o = !0,
    ) {
      if (t instanceof Array) {
        var l = !0,
          _ = t,
          u = _.length,
          c = 0;
        if (s) var d = S.create(s.caller, s ? s.method : null, s.args, !1);
        for (var p = 0; p &lt; u; p++) {
          var f = _[p];
          "string" == typeof f &amp;&amp; (f = _[p] = { url: f }), (f.progress = 0);
        }
        for (p = 0; p &lt; u; p++) {
          f = _[p];
          var m = s
              ? S.create(
                  null,
                  function (t, e) {
                    t.progress = e;
                    for (var i = 0, s = 0; s &lt; u; s++) {
                      i += _[s].progress;
                    }
                    var r = i / u;
                    d.runWith(r);
                  },
                  [f],
                  !1,
                )
              : null,
            g =
              s || i
                ? S.create(
                    null,
                    function (t, e = null) {
                      c++,
                        (t.progress = 1),
                        e || (l = !1),
                        c === u &amp;&amp; i &amp;&amp; i.runWith(l);
                    },
                    [f],
                  )
                : null;
          this._createOne(
            f.url,
            e,
            g,
            m,
            f.type || r,
            f.constructParams || a,
            f.propertyParams || n,
            f.priority || h,
            o,
          );
        }
      } else this._createOne(t, e, i, s, r, a, n, h, o);
    }
    _createOne(
      t,
      e,
      s = null,
      r = null,
      a = null,
      n = null,
      h = null,
      o = 1,
      l = !0,
    ) {
      var _ = this.getRes(t);
      if (_)
        !e &amp;&amp; _ instanceof P &amp;&amp; _._addReference(),
          r &amp;&amp; r.runWith(1),
          s &amp;&amp; s.runWith(_);
      else {
        var u = si.createMap[J.getFilecompatibleExtension(t)]
          ? J.getFilecompatibleExtension(t)
          : J.getFileExtension(t);
        if ((a || (a = si.createMap[u] ? si.createMap[u][0] : null), !a))
          return void this.load(t, s, r, a, o, l);
        if (!ei.parserMap[a]) return void this.load(t, s, r, a, o, l);
        this._createLoad(
          t,
          S.create(null, function (r) {
            r &amp;&amp;
              (!e &amp;&amp; r instanceof P &amp;&amp; r._addReference(), r._setCreateURL(t)),
              s &amp;&amp; s.runWith(r),
              i.loader.event(t);
          }),
          r,
          a,
          n,
          h,
          o,
          l,
          !0,
        );
      }
    }
    load(
      t,
      e = null,
      s = null,
      r = null,
      a = 1,
      n = !0,
      h = null,
      o = !1,
      l = i.WorkerLoader.enable,
    ) {
      if (t instanceof Array) return this._loadAssets(t, e, s, r, a, n, h);
      var _;
      if (
        (r ||
          (r = 0 === t.indexOf("data:image") ? ei.IMAGE : ei.getTypeFromUrl(t)),
        r === ei.IMAGE
          ? (_ = ei.textureMap[I.formatURL(t)]) &amp;&amp;
            (!_.bitmap || (_.bitmap &amp;&amp; _.bitmap.destroyed)) &amp;&amp;
            (_ = null)
          : (_ = ei.loadedMap[I.formatURL(t)]),
        o || null == _)
      ) {
        var u;
        (u = t),
          (t = ii.getFileLoadPath(t)) != u &amp;&amp; "nativeimage" !== r
            ? (r = ei.ATLAS)
            : (u = null);
        var c = si._resMap[t];
        c
          ? (e &amp;&amp;
              (u
                ? e &amp;&amp;
                  c._createListener(
                    $t.COMPLETE,
                    this,
                    this._resInfoLoaded,
                    [u, e],
                    !1,
                    !1,
                  )
                : e &amp;&amp;
                  c._createListener(
                    $t.COMPLETE,
                    e.caller,
                    e.method,
                    e.args,
                    !1,
                    !1,
                  )),
            s &amp;&amp;
              c._createListener(
                $t.PROGRESS,
                s.caller,
                s.method,
                s.args,
                !1,
                !1,
              ))
          : (((c = this._infoPool.length
              ? this._infoPool.pop()
              : new ri()).url = t),
            (c.type = r),
            (c.cache = n),
            (c.group = h),
            (c.ignoreCache = o),
            (c.useWorkerLoader = l),
            (c.originalUrl = u),
            e &amp;&amp; c.on($t.COMPLETE, e.caller, e.method, e.args),
            s &amp;&amp; c.on($t.PROGRESS, s.caller, s.method, s.args),
            (si._resMap[t] = c),
            (a = a &lt; this._maxPriority ? a : this._maxPriority - 1),
            this._resInfos[a].push(c),
            this._statInfo.count++,
            this.event($t.PROGRESS, this.getProgress()),
            this._next());
      } else
        i.systemTimer.callLater(this, function () {
          s &amp;&amp; s.runWith(1),
            e &amp;&amp; e.runWith(_ instanceof Array ? [_] : _),
            this._loaderCount || this.event($t.COMPLETE);
        });
      return this;
    }
    _resInfoLoaded(t, e) {
      e.runWith(ei.getRes(t));
    }
    _createLoad(
      t,
      e = null,
      s = null,
      r = null,
      a = null,
      n = null,
      h = 1,
      o = !0,
      l = !1,
    ) {
      if (t instanceof Array) return this._loadAssets(t, e, s, r, h, o);
      var _ = ei.getRes(t);
      if (null != _)
        i.systemTimer.frameOnce(1, this, function () {
          s &amp;&amp; s.runWith(1),
            e &amp;&amp; e.runWith(_),
            this._loaderCount || this.event($t.COMPLETE);
        });
      else {
        var u = si._resMap[t];
        u
          ? (e &amp;&amp;
              u._createListener(
                $t.COMPLETE,
                e.caller,
                e.method,
                e.args,
                !1,
                !1,
              ),
            s &amp;&amp;
              u._createListener(
                $t.PROGRESS,
                s.caller,
                s.method,
                s.args,
                !1,
                !1,
              ))
          : (((u = this._infoPool.length
              ? this._infoPool.pop()
              : new ri()).url = t),
            (u.type = r),
            (u.cache = !1),
            (u.ignoreCache = l),
            (u.originalUrl = null),
            (u.group = null),
            (u.createCache = o),
            (u.createConstructParams = a),
            (u.createPropertyParams = n),
            e &amp;&amp; u.on($t.COMPLETE, e.caller, e.method, e.args),
            s &amp;&amp; u.on($t.PROGRESS, s.caller, s.method, s.args),
            (si._resMap[t] = u),
            (h = h &lt; this._maxPriority ? h : this._maxPriority - 1),
            this._resInfos[h].push(u),
            this._statInfo.count++,
            this.event($t.PROGRESS, this.getProgress()),
            this._next());
      }
      return this;
    }
    _next() {
      if (!(this._loaderCount &gt;= this.maxLoader)) {
        for (var t = 0; t &lt; this._maxPriority; t++)
          for (var e = this._resInfos[t]; e.length &gt; 0; ) {
            var i = e.shift();
            if (i) return this._doLoad(i);
          }
        this._loaderCount || this.event($t.COMPLETE);
      }
    }
    _doLoad(t) {
      this._loaderCount++;
      var e = this._loaders.length ? this._loaders.pop() : new ei();
      e.on($t.COMPLETE, null, onLoaded),
        e.on($t.PROGRESS, null, function (e) {
          t.event($t.PROGRESS, e);
        }),
        e.on($t.ERROR, null, function (t) {
          onLoaded(null);
        });
      var i = this;
      function onLoaded(s = null) {
        e.offAll(),
          (e._data = null),
          (e._customParse = !1),
          i._loaders.push(e),
          i._endLoad(t, s instanceof Array ? [s] : s),
          i._loaderCount--,
          i._next();
      }
      (e._constructParams = t.createConstructParams),
        (e._propertyParams = t.createPropertyParams),
        (e._createCache = t.createCache),
        e.load(
          t.url,
          t.type,
          t.cache,
          t.group,
          t.ignoreCache,
          t.useWorkerLoader,
        );
    }
    _endLoad(t, e) {
      var s = t.url;
      if (null == e) {
        var r = this._failRes[s] || 0;
        if (r &lt; this.retryNum)
          return (
            console.warn("[warn]Retry to load:", s),
            (this._failRes[s] = r + 1),
            void i.systemTimer.once(
              this.retryDelay,
              this,
              this._addReTry,
              [t],
              !1,
            )
          );
        ei.clearRes(s),
          console.warn("[error]Failed to load:", s),
          this.event($t.ERROR, s);
      }
      this._failRes[s] &amp;&amp; (this._failRes[s] = 0),
        delete si._resMap[s],
        t.originalUrl &amp;&amp; (e = ei.getRes(t.originalUrl)),
        t.event($t.COMPLETE, e),
        t.offAll(),
        this._infoPool.push(t),
        this._statInfo.loaded++,
        this.event($t.PROGRESS, this.getProgress());
    }
    _addReTry(t) {
      this._resInfos[this._maxPriority - 1].push(t), this._next();
    }
    clearRes(t) {
      ei.clearRes(t);
    }
    clearTextureRes(t) {
      ei.clearTextureRes(t);
    }
    getRes(t) {
      return ei.getRes(t);
    }
    cacheRes(t, e) {
      ei.cacheRes(t, e);
    }
    setGroup(t, e) {
      ei.setGroup(t, e);
    }
    clearResByGroup(t) {
      ei.clearResByGroup(t);
    }
    static cacheRes(t, e) {
      ei.cacheRes(t, e);
    }
    clearUnLoaded() {
      for (var t = 0; t &lt; this._maxPriority; t++) {
        for (var e = this._resInfos[t], i = e.length - 1; i &gt; -1; i--) {
          var s = e[i];
          s &amp;&amp; (s.offAll(), this._infoPool.push(s));
        }
        e.length = 0;
      }
      (this._loaderCount = 0), (si._resMap = {});
    }
    cancelLoadByUrls(t) {
      if (t)
        for (var e = 0, i = t.length; e &lt; i; e++) this.cancelLoadByUrl(t[e]);
    }
    cancelLoadByUrl(t) {
      for (var e = 0; e &lt; this._maxPriority; e++)
        for (var i = this._resInfos[e], s = i.length - 1; s &gt; -1; s--) {
          var r = i[s];
          r &amp;&amp;
            r.url === t &amp;&amp;
            ((i[s] = null), r.offAll(), this._infoPool.push(r));
        }
      si._resMap[t] &amp;&amp; delete si._resMap[t];
    }
    _loadAssets(t, e = null, i = null, s = null, r = 1, a = !0, n = null) {
      for (var h = t.length, o = 0, l = 0, _ = [], u = !0, c = 0; c &lt; h; c++) {
        let h,
          o = t[c];
        (h =
          "string" == typeof o ? { url: o, type: s, size: 1, priority: r } : o)
          .size || (h.size = 1),
          (h.progress = 0),
          (l += h.size),
          _.push(h);
        var d = i ? S.create(null, loadProgress, [h], !1) : null,
          p = e || i ? S.create(null, loadComplete, [h]) : null;
        this.load(
          h.url,
          p,
          d,
          h.type,
          h.priority || 1,
          a,
          h.group || n,
          !1,
          h.useWorkerLoader,
        );
      }
      function loadComplete(t, i = null) {
        o++, (t.progress = 1), i || (u = !1), o === h &amp;&amp; e &amp;&amp; e.runWith(u);
      }
      function loadProgress(t, e) {
        if (null != i) {
          t.progress = e;
          for (var s = 0, r = 0; r &lt; _.length; r++) {
            var a = _[r];
            if (a) {
              let t = null == a.progress ? 0 : a.progress;
              s += null == a.size ? 0 : a.size * t;
            }
          }
          var n = s / l;
          i.runWith(n);
        }
      }
      return this;
    }
    decodeBitmaps(t) {
      var e,
        s,
        r = t.length;
      for (s = i.Render._context, e = 0; e &lt; r; e++) {
        var a, n;
        if ((a = ei.getAtlas(t[e]))) this._decodeTexture(a[0], s);
        else
          (n = this.getRes(t[e])) &amp;&amp;
            n instanceof Jt &amp;&amp;
            this._decodeTexture(n, s);
      }
    }
    _decodeTexture(t, e) {
      var i = t.bitmap;
      if (t &amp;&amp; i) {
        var s = i.source || i.image;
        if (s &amp;&amp; s instanceof HTMLImageElement) {
          e.drawImage(s, 0, 0, 1, 1);
          e.getImageData(0, 0, 1, 1);
        }
      }
    }
  }
  (si._resMap = {}), (si.createMap = { atlas: [null, ei.ATLAS] });
  class ri extends w {}
  class ai {
    static __init__() {
      return (
        ai._baseClass || ((ai._baseClass = ni), ni.init()),
        (ai.items = ai._baseClass.items),
        (ai.support = ai._baseClass.support),
        ai.support
      );
    }
    static setItem(t, e) {
      ai._baseClass.setItem(t, e);
    }
    static getItem(t) {
      return ai._baseClass.getItem(t);
    }
    static setJSON(t, e) {
      ai._baseClass.setJSON(t, e);
    }
    static getJSON(t) {
      return ai._baseClass.getJSON(t);
    }
    static removeItem(t) {
      ai._baseClass.removeItem(t);
    }
    static clear() {
      ai._baseClass.clear();
    }
  }
  ai.support = !1;
  class ni {
    static init() {
      try {
        (ni.support = !0),
          (ni.items = window.localStorage),
          ni.setItem("laya", "1"),
          ni.removeItem("laya");
      } catch (t) {
        ni.support = !1;
      }
      ni.support ||
        console.log("LocalStorage is not supprot or browser is private mode.");
    }
    static setItem(t, e) {
      try {
        ni.support &amp;&amp; ni.items.setItem(t, e);
      } catch (t) {
        console.warn("set localStorage failed", t);
      }
    }
    static getItem(t) {
      return ni.support ? ni.items.getItem(t) : null;
    }
    static setJSON(t, e) {
      try {
        ni.support &amp;&amp; ni.items.setItem(t, JSON.stringify(e));
      } catch (t) {
        console.warn("set localStorage failed", t);
      }
    }
    static getJSON(t) {
      try {
        return JSON.parse(ni.support ? ni.items.getItem(t) : null);
      } catch (e) {
        return ni.items.getItem(t);
      }
    }
    static removeItem(t) {
      ni.support &amp;&amp; ni.items.removeItem(t);
    }
    static clear() {
      ni.support &amp;&amp; ni.items.clear();
    }
  }
  ni.support = !1;
  class hi {
    load(t) {
      this._url = t;
      var e = t.toLowerCase().split(".ttf")[0].split("/");
      (this.fontName = e[e.length - 1]),
        i.Render.isConchApp
          ? this._loadConch()
          : window.FontFace
            ? this._loadWithFontFace()
            : this._loadWithCSS();
    }
    _loadConch() {
      (this._http = new ti()),
        this._http.on($t.ERROR, this, this._onErr),
        this._http.on($t.COMPLETE, this, this._onHttpLoaded),
        this._http.send(this._url, null, "get", ei.BUFFER);
    }
    _onHttpLoaded(t = null) {
      window.conchTextCanvas.setFontFaceFromBuffer(this.fontName, t),
        this._clearHttp(),
        this._complete();
    }
    _clearHttp() {
      this._http &amp;&amp;
        (this._http.off($t.ERROR, this, this._onErr),
        this._http.off($t.COMPLETE, this, this._onHttpLoaded),
        (this._http = null));
    }
    _onErr() {
      this._clearHttp(),
        this.err &amp;&amp; (this.err.runWith("fail:" + this._url), (this.err = null));
    }
    _complete() {
      i.systemTimer.clear(this, this._complete),
        i.systemTimer.clear(this, this._checkComplete),
        this._div &amp;&amp;
          this._div.parentNode &amp;&amp;
          (this._div.parentNode.removeChild(this._div), (this._div = null)),
        this.complete &amp;&amp; (this.complete.runWith(this), (this.complete = null));
    }
    _checkComplete() {
      i.Browser.measureText(hi._testString, this._fontTxt).width !=
        this._txtWidth &amp;&amp; this._complete();
    }
    _loadWithFontFace() {
      var t = new window.FontFace(this.fontName, "url('" + this._url + "')");
      document.fonts.add(t);
      var e = this;
      t.loaded.then(function () {
        e._complete();
      }),
        t.load();
    }
    _createDiv() {
      (this._div = re.createElement("div")), (this._div.innerHTML = "laya");
      var t = this._div.style;
      (t.fontFamily = this.fontName),
        (t.position = "absolute"),
        (t.left = "-100px"),
        (t.top = "-100px"),
        document.body.appendChild(this._div);
    }
    _loadWithCSS() {
      var t = re.createElement("style");
      (t.type = "text/css"),
        document.body.appendChild(t),
        (t.textContent =
          "@font-face { font-family:'" +
          this.fontName +
          "'; src:url('" +
          this._url +
          "');}"),
        (this._fontTxt = "40px " + this.fontName),
        (this._txtWidth = re.measureText(hi._testString, this._fontTxt).width);
      var e = this;
      (t.onload = function () {
        i.systemTimer.once(1e4, e, e._complete);
      }),
        i.systemTimer.loop(20, this, this._checkComplete),
        this._createDiv();
    }
  }
  hi._testString = "LayaTTFFont";
  class oi {
    static linearNone(t, e, i, s) {
      return (i * t) / s + e;
    }
    static linearIn(t, e, i, s) {
      return (i * t) / s + e;
    }
    static linearInOut(t, e, i, s) {
      return (i * t) / s + e;
    }
    static linearOut(t, e, i, s) {
      return (i * t) / s + e;
    }
    static bounceIn(t, e, i, s) {
      return i - oi.bounceOut(s - t, 0, i, s) + e;
    }
    static bounceInOut(t, e, i, s) {
      return t &lt; 0.5 * s
        ? 0.5 * oi.bounceIn(2 * t, 0, i, s) + e
        : 0.5 * oi.bounceOut(2 * t - s, 0, i, s) + 0.5 * i + e;
    }
    static bounceOut(t, e, i, s) {
      return (t /= s) &lt; 1 / 2.75
        ? i * (7.5625 * t * t) + e
        : t &lt; 2 / 2.75
          ? i * (7.5625 * (t -= 1.5 / 2.75) * t + 0.75) + e
          : t &lt; 2.5 / 2.75
            ? i * (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375) + e
            : i * (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375) + e;
    }
    static backIn(t, e, i, s, r = 1.70158) {
      return i * (t /= s) * t * ((r + 1) * t - r) + e;
    }
    static backInOut(t, e, i, s, r = 1.70158) {
      return (t /= 0.5 * s) &lt; 1
        ? 0.5 * i * (t * t * ((1 + (r *= 1.525)) * t - r)) + e
        : (i / 2) * ((t -= 2) * t * ((1 + (r *= 1.525)) * t + r) + 2) + e;
    }
    static backOut(t, e, i, s, r = 1.70158) {
      return i * ((t = t / s - 1) * t * ((r + 1) * t + r) + 1) + e;
    }
    static elasticIn(t, e, i, s, r = 0, a = 0) {
      var n;
      return 0 == t
        ? e
        : 1 == (t /= s)
          ? e + i
          : (a || (a = 0.3 * s),
            !r || (i &gt; 0 &amp;&amp; r &lt; i) || (i &lt; 0 &amp;&amp; r &lt; -i)
              ? ((r = i), (n = a / 4))
              : (n = (a / oi.PI2) * Math.asin(i / r)),
            -r *
              Math.pow(2, 10 * (t -= 1)) *
              Math.sin(((t * s - n) * oi.PI2) / a) +
              e);
    }
    static elasticInOut(t, e, i, s, r = 0, a = 0) {
      var n;
      return 0 == t
        ? e
        : 2 == (t /= 0.5 * s)
          ? e + i
          : (a || (a = s * (0.3 * 1.5)),
            !r || (i &gt; 0 &amp;&amp; r &lt; i) || (i &lt; 0 &amp;&amp; r &lt; -i)
              ? ((r = i), (n = a / 4))
              : (n = (a / oi.PI2) * Math.asin(i / r)),
            t &lt; 1
              ? r *
                  Math.pow(2, 10 * (t -= 1)) *
                  Math.sin(((t * s - n) * oi.PI2) / a) *
                  -0.5 +
                e
              : r *
                  Math.pow(2, -10 * (t -= 1)) *
                  Math.sin(((t * s - n) * oi.PI2) / a) *
                  0.5 +
                i +
                e);
    }
    static elasticOut(t, e, i, s, r = 0, a = 0) {
      var n;
      return 0 == t
        ? e
        : 1 == (t /= s)
          ? e + i
          : (a || (a = 0.3 * s),
            !r || (i &gt; 0 &amp;&amp; r &lt; i) || (i &lt; 0 &amp;&amp; r &lt; -i)
              ? ((r = i), (n = a / 4))
              : (n = (a / oi.PI2) * Math.asin(i / r)),
            r * Math.pow(2, -10 * t) * Math.sin(((t * s - n) * oi.PI2) / a) +
              i +
              e);
    }
    static strongIn(t, e, i, s) {
      return i * (t /= s) * t * t * t * t + e;
    }
    static strongInOut(t, e, i, s) {
      return (t /= 0.5 * s) &lt; 1
        ? 0.5 * i * t * t * t * t * t + e
        : 0.5 * i * ((t -= 2) * t * t * t * t + 2) + e;
    }
    static strongOut(t, e, i, s) {
      return i * ((t = t / s - 1) * t * t * t * t + 1) + e;
    }
    static sineInOut(t, e, i, s) {
      return 0.5 * -i * (Math.cos((Math.PI * t) / s) - 1) + e;
    }
    static sineIn(t, e, i, s) {
      return -i * Math.cos((t / s) * oi.HALF_PI) + i + e;
    }
    static sineOut(t, e, i, s) {
      return i * Math.sin((t / s) * oi.HALF_PI) + e;
    }
    static quintIn(t, e, i, s) {
      return i * (t /= s) * t * t * t * t + e;
    }
    static quintInOut(t, e, i, s) {
      return (t /= 0.5 * s) &lt; 1
        ? 0.5 * i * t * t * t * t * t + e
        : 0.5 * i * ((t -= 2) * t * t * t * t + 2) + e;
    }
    static quintOut(t, e, i, s) {
      return i * ((t = t / s - 1) * t * t * t * t + 1) + e;
    }
    static quartIn(t, e, i, s) {
      return i * (t /= s) * t * t * t + e;
    }
    static quartInOut(t, e, i, s) {
      return (t /= 0.5 * s) &lt; 1
        ? 0.5 * i * t * t * t * t + e
        : 0.5 * -i * ((t -= 2) * t * t * t - 2) + e;
    }
    static quartOut(t, e, i, s) {
      return -i * ((t = t / s - 1) * t * t * t - 1) + e;
    }
    static cubicIn(t, e, i, s) {
      return i * (t /= s) * t * t + e;
    }
    static cubicInOut(t, e, i, s) {
      return (t /= 0.5 * s) &lt; 1
        ? 0.5 * i * t * t * t + e
        : 0.5 * i * ((t -= 2) * t * t + 2) + e;
    }
    static cubicOut(t, e, i, s) {
      return i * ((t = t / s - 1) * t * t + 1) + e;
    }
    static quadIn(t, e, i, s) {
      return i * (t /= s) * t + e;
    }
    static quadInOut(t, e, i, s) {
      return (t /= 0.5 * s) &lt; 1
        ? 0.5 * i * t * t + e
        : 0.5 * -i * (--t * (t - 2) - 1) + e;
    }
    static quadOut(t, e, i, s) {
      return -i * (t /= s) * (t - 2) + e;
    }
    static expoIn(t, e, i, s) {
      return 0 == t ? e : i * Math.pow(2, 10 * (t / s - 1)) + e - 0.001 * i;
    }
    static expoInOut(t, e, i, s) {
      return 0 == t
        ? e
        : t == s
          ? e + i
          : (t /= 0.5 * s) &lt; 1
            ? 0.5 * i * Math.pow(2, 10 * (t - 1)) + e
            : 0.5 * i * (2 - Math.pow(2, -10 * --t)) + e;
    }
    static expoOut(t, e, i, s) {
      return t == s ? e + i : i * (1 - Math.pow(2, (-10 * t) / s)) + e;
    }
    static circIn(t, e, i, s) {
      return -i * (Math.sqrt(1 - (t /= s) * t) - 1) + e;
    }
    static circInOut(t, e, i, s) {
      return (t /= 0.5 * s) &lt; 1
        ? 0.5 * -i * (Math.sqrt(1 - t * t) - 1) + e
        : 0.5 * i * (Math.sqrt(1 - (t -= 2) * t) + 1) + e;
    }
    static circOut(t, e, i, s) {
      return i * Math.sqrt(1 - (t = t / s - 1) * t) + e;
    }
  }
  (oi.HALF_PI = 0.5 * Math.PI), (oi.PI2 = 2 * Math.PI);
  class li {
    constructor() {
      (this.gid = 0), (this.repeat = 1), (this._count = 0);
    }
    static to(t, e, i, r = null, a = null, n = 0, h = !1, o = !0) {
      return s
        .getItemByClass("tween", li)
        ._create(t, e, i, r, a, n, h, !0, o, !0);
    }
    static from(t, e, i, r = null, a = null, n = 0, h = !1, o = !0) {
      return s
        .getItemByClass("tween", li)
        ._create(t, e, i, r, a, n, h, !1, o, !0);
    }
    to(t, e, i, s = null, r = null, a = 0, n = !1) {
      return this._create(t, e, i, s, r, a, n, !0, !1, !0);
    }
    from(t, e, i, s = null, r = null, a = 0, n = !1) {
      return this._create(t, e, i, s, r, a, n, !1, !1, !0);
    }
    _create(t, e, s, r, a, n, h, o, l, _) {
      if (!t) throw new Error("Tween:target is null");
      (this._target = t),
        (this._duration = s),
        (this._ease = r || e.ease || li.easeNone),
        (this._complete = a || e.complete),
        (this._delay = n),
        (this._props = []),
        (this._usedTimer = 0),
        (this._startTimer = re.now()),
        (this._usedPool = l),
        (this._delayParam = null),
        (this.update = e.update);
      var u = t.$_GID || (t.$_GID = J.getGID());
      return (
        li.tweenMap[u]
          ? (h &amp;&amp; li.clearTween(t), li.tweenMap[u].push(this))
          : (li.tweenMap[u] = [this]),
        _
          ? n &lt;= 0
            ? this.firstStart(t, e, o)
            : ((this._delayParam = [t, e, o]),
              i.timer.once(n, this, this.firstStart, this._delayParam))
          : this._initProps(t, e, o),
        this
      );
    }
    firstStart(t, e, i) {
      (this._delayParam = null),
        t.destroyed
          ? this.clear()
          : (this._initProps(t, e, i), this._beginLoop());
    }
    _initProps(t, e, i) {
      for (var s in e)
        if ("number" == typeof t[s]) {
          var r = i ? t[s] : e[s],
            a = i ? e[s] : t[s];
          this._props.push([s, r, a - r]), i || (t[s] = r);
        }
    }
    _beginLoop() {
      i.timer.frameLoop(1, this, this._doEase);
    }
    _doEase() {
      this._updateEase(re.now());
    }
    _updateEase(t) {
      var e = this._target;
      if (e) {
        if (e.destroyed) return li.clearTween(e);
        var i = (this._usedTimer = t - this._startTimer - this._delay);
        if (!(i &lt; 0)) {
          if (i &gt;= this._duration) return this.complete();
          for (
            var s = i &gt; 0 ? this._ease(i, 0, 1, this._duration) : 0,
              r = this._props,
              a = 0,
              n = r.length;
            a &lt; n;
            a++
          ) {
            var h = r[a];
            e[h[0]] = h[1] + s * h[2];
          }
          this.update &amp;&amp; this.update.run();
        }
      }
    }
    set progress(t) {
      var e = t * this._duration;
      this._startTimer = re.now() - this._delay - e;
    }
    complete() {
      if (this._target) {
        i.timer.runTimer(this, this.firstStart);
        for (
          var t = this._target,
            e = this._props,
            s = this._complete,
            r = 0,
            a = e.length;
          r &lt; a;
          r++
        ) {
          var n = e[r];
          t[n[0]] = n[1] + n[2];
        }
        this.update &amp;&amp; this.update.run(),
          this._count++,
          0 != this.repeat &amp;&amp; this._count &gt;= this.repeat
            ? (this.clear(), s &amp;&amp; s.run())
            : this.restart();
      }
    }
    pause() {
      var t;
      i.timer.clear(this, this._beginLoop),
        i.timer.clear(this, this._doEase),
        i.timer.clear(this, this.firstStart),
        (t = re.now() - this._startTimer - this._delay) &lt; 0 &amp;&amp;
          (this._usedTimer = t);
    }
    setStartTime(t) {
      this._startTimer = t;
    }
    static clearAll(t) {
      if (t &amp;&amp; t.$_GID) {
        var e = li.tweenMap[t.$_GID];
        if (e) {
          for (var i = 0, s = e.length; i &lt; s; i++) e[i]._clear();
          e.length = 0;
        }
      }
    }
    static clear(t) {
      t.clear();
    }
    static clearTween(t) {
      li.clearAll(t);
    }
    clear() {
      this._target &amp;&amp; (this._remove(), this._clear());
    }
    _clear() {
      this.pause(),
        i.timer.clear(this, this.firstStart),
        (this._complete = null),
        (this._target = null),
        (this._ease = null),
        (this._props = null),
        (this._delayParam = null),
        (this.repeat = 1),
        this._usedPool &amp;&amp; ((this.update = null), s.recover("tween", this));
    }
    recover() {
      (this._usedPool = !0), this._clear();
    }
    _remove() {
      var t = li.tweenMap[this._target.$_GID];
      if (t)
        for (var e = 0, i = t.length; e &lt; i; e++)
          if (t[e] === this) {
            t.splice(e, 1);
            break;
          }
    }
    restart() {
      if (
        (this.pause(),
        (this._usedTimer = 0),
        (this._startTimer = re.now()),
        this._delayParam)
      )
        i.timer.once(this._delay, this, this.firstStart, this._delayParam);
      else {
        for (var t = this._props, e = 0, s = t.length; e &lt; s; e++) {
          var r = t[e];
          this._target[r[0]] = r[1];
        }
        i.timer.once(this._delay, this, this._beginLoop);
      }
    }
    resume() {
      this._usedTimer &gt;= this._duration ||
        ((this._startTimer = re.now() - this._usedTimer - this._delay),
        this._delayParam
          ? this._usedTimer &lt; 0
            ? i.timer.once(
                -this._usedTimer,
                this,
                this.firstStart,
                this._delayParam,
              )
            : this.firstStart.apply(this, this._delayParam)
          : this._beginLoop());
    }
    static easeNone(t, e, i, s) {
      return (i * t) / s + e;
    }
  }
  li.tweenMap = [];
  class _i {
    constructor() {
      (this.ratio = 0.92),
        (this.maxOffset = 60),
        (this._dragging = !1),
        (this._clickOnly = !0);
    }
    start(t, e, s, r, a, n, h, o = 0.92) {
      this.clearTimer(),
        (this.target = t),
        (this.area = e),
        (this.hasInertia = s),
        (this.elasticDistance = e ? r : 0),
        (this.elasticBackTime = a),
        (this.data = n),
        (this._disableMouseEvent = h),
        (this.ratio = o),
        (this._parent = t.parent),
        (this._clickOnly = !0),
        (this._dragging = !0),
        (this._elasticRateX = this._elasticRateY = 1),
        (this._lastX = this._parent.mouseX),
        (this._lastY = this._parent.mouseY),
        i.stage.on($t.MOUSE_UP, this, this.onStageMouseUp),
        i.stage.on($t.MOUSE_OUT, this, this.onStageMouseUp),
        i.systemTimer.frameLoop(1, this, this.loop);
    }
    clearTimer() {
      i.systemTimer.clear(this, this.loop),
        i.systemTimer.clear(this, this.tweenMove),
        this._tween &amp;&amp; (this._tween.recover(), (this._tween = null));
    }
    stop() {
      this._dragging &amp;&amp;
        ((Ge.instance.disableMouseEvent = !1),
        i.stage.off($t.MOUSE_UP, this, this.onStageMouseUp),
        i.stage.off($t.MOUSE_OUT, this, this.onStageMouseUp),
        (this._dragging = !1),
        this.target &amp;&amp; this.area &amp;&amp; this.backToArea(),
        this.clear());
    }
    loop() {
      var t = this._parent.getMousePoint(),
        e = t.x,
        s = t.y,
        r = e - this._lastX,
        a = s - this._lastY;
      if (this._clickOnly) {
        if (
          !(
            Math.abs(r * i.stage._canvasTransform.getScaleX()) &gt; 1 ||
            Math.abs(a * i.stage._canvasTransform.getScaleY()) &gt; 1
          )
        )
          return;
        (this._clickOnly = !1),
          this._offsets || (this._offsets = []),
          (this._offsets.length = 0),
          this.target.event($t.DRAG_START, this.data),
          (Ge.instance.disableMouseEvent = this._disableMouseEvent);
      } else this._offsets.push(r, a);
      (0 === r &amp;&amp; 0 === a) ||
        ((this._lastX = e),
        (this._lastY = s),
        (this.target.x += r * this._elasticRateX),
        (this.target.y += a * this._elasticRateY),
        this.area &amp;&amp; this.checkArea(),
        this.target.event($t.DRAG_MOVE, this.data));
    }
    checkArea() {
      if (this.elasticDistance &lt;= 0) this.backToArea();
      else {
        if (this.target._x &lt; this.area.x) var t = this.area.x - this.target._x;
        else
          t =
            this.target._x &gt; this.area.x + this.area.width
              ? this.target._x - this.area.x - this.area.width
              : 0;
        if (
          ((this._elasticRateX = Math.max(0, 1 - t / this.elasticDistance)),
          this.target._y &lt; this.area.y)
        )
          var e = this.area.y - this.target.y;
        else
          e =
            this.target._y &gt; this.area.y + this.area.height
              ? this.target._y - this.area.y - this.area.height
              : 0;
        this._elasticRateY = Math.max(0, 1 - e / this.elasticDistance);
      }
    }
    backToArea() {
      (this.target.x = Math.min(
        Math.max(this.target._x, this.area.x),
        this.area.x + this.area.width,
      )),
        (this.target.y = Math.min(
          Math.max(this.target._y, this.area.y),
          this.area.y + this.area.height,
        ));
    }
    onStageMouseUp(t) {
      if (
        ((Ge.instance.disableMouseEvent = !1),
        i.stage.off($t.MOUSE_UP, this, this.onStageMouseUp),
        i.stage.off($t.MOUSE_OUT, this, this.onStageMouseUp),
        i.systemTimer.clear(this, this.loop),
        !this._clickOnly &amp;&amp; this.target)
      )
        if (this.hasInertia) {
          this._offsets.length &lt; 1 &amp;&amp;
            this._offsets.push(
              this._parent.mouseX - this._lastX,
              this._parent.mouseY - this._lastY,
            ),
            (this._offsetX = this._offsetY = 0);
          for (
            var e = this._offsets.length,
              s = Math.min(e, 6),
              r = this._offsets.length - s,
              a = e - 1;
            a &gt; r;
            a--
          )
            (this._offsetY += this._offsets[a--]),
              (this._offsetX += this._offsets[a]);
          (this._offsetX = (this._offsetX / s) * 2),
            (this._offsetY = (this._offsetY / s) * 2),
            Math.abs(this._offsetX) &gt; this.maxOffset &amp;&amp;
              (this._offsetX =
                this._offsetX &gt; 0 ? this.maxOffset : -this.maxOffset),
            Math.abs(this._offsetY) &gt; this.maxOffset &amp;&amp;
              (this._offsetY =
                this._offsetY &gt; 0 ? this.maxOffset : -this.maxOffset),
            i.systemTimer.frameLoop(1, this, this.tweenMove);
        } else this.elasticDistance &gt; 0 ? this.checkElastic() : this.clear();
    }
    checkElastic() {
      var t = NaN,
        e = NaN;
      if (
        (this.target.x &lt; this.area.x
          ? (t = this.area.x)
          : this.target._x &gt; this.area.x + this.area.width &amp;&amp;
            (t = this.area.x + this.area.width),
        this.target.y &lt; this.area.y
          ? (e = this.area.y)
          : this.target._y &gt; this.area.y + this.area.height &amp;&amp;
            (e = this.area.y + this.area.height),
        isNaN(t) &amp;&amp; isNaN(e))
      )
        this.clear();
      else {
        var i = {};
        isNaN(t) || (i.x = t),
          isNaN(e) || (i.y = e),
          (this._tween = li.to(
            this.target,
            i,
            this.elasticBackTime,
            oi.sineOut,
            S.create(this, this.clear),
            0,
            !1,
            !1,
          ));
      }
    }
    tweenMove() {
      (this._offsetX *= this.ratio * this._elasticRateX),
        (this._offsetY *= this.ratio * this._elasticRateY),
        (this.target.x += this._offsetX),
        (this.target.y += this._offsetY),
        this.area &amp;&amp; this.checkArea(),
        this.target.event($t.DRAG_MOVE, this.data),
        ((Math.abs(this._offsetX) &lt; 1 &amp;&amp; Math.abs(this._offsetY) &lt; 1) ||
          this._elasticRateX &lt; 0.5 ||
          this._elasticRateY &lt; 0.5) &amp;&amp;
          (i.systemTimer.clear(this, this.tweenMove),
          this.elasticDistance &gt; 0 ? this.checkElastic() : this.clear());
    }
    clear() {
      if (this.target) {
        this.clearTimer();
        var t = this.target;
        (this.target = null),
          (this._parent = null),
          t.event($t.DRAG_END, this.data);
      }
    }
  }
  class ui {
    constructor() {
      (this._id = J.getGID()), this._resetComp();
    }
    get id() {
      return this._id;
    }
    get enabled() {
      return this._enabled;
    }
    set enabled(t) {
      this._enabled != t &amp;&amp;
        ((this._enabled = t),
        this.owner &amp;&amp;
          (t
            ? this.owner.activeInHierarchy &amp;&amp; this._onEnable()
            : this.owner.activeInHierarchy &amp;&amp; this._onDisable()));
    }
    get isSingleton() {
      return !0;
    }
    get destroyed() {
      return this._destroyed;
    }
    _isScript() {
      return !1;
    }
    _resetComp() {
      (this._indexInList = -1),
        (this._enabled = !0),
        (this._awaked = !1),
        (this.owner = null);
    }
    _getIndexInList() {
      return this._indexInList;
    }
    _setIndexInList(t) {
      this._indexInList = t;
    }
    _onAdded() {}
    _onAwake() {}
    _onEnable() {}
    _onDisable() {}
    _onDestroy() {}
    onReset() {}
    _parse(t, e = null) {}
    _parseInteractive(t = null, e = null) {}
    _cloneTo(t) {}
    _setActive(t) {
      t
        ? (this._awaked || ((this._awaked = !0), this._onAwake()),
          this._enabled &amp;&amp; this._onEnable())
        : this._enabled &amp;&amp; this._onDisable();
    }
    destroy() {
      this.owner &amp;&amp; this.owner._destroyComponent(this);
    }
    _destroy() {
      this.owner.activeInHierarchy &amp;&amp; this._enabled &amp;&amp; this._setActive(!1),
        this._onDestroy(),
        (this._destroyed = !0),
        this.onReset !== ui.prototype.onReset
          ? (this.onReset(), this._resetComp(), s.recoverByClass(this))
          : this._resetComp();
    }
  }
  class ci extends Be {
    constructor() {
      super(),
        (this.wrapMode = 0),
        (this._interval = e.animationInterval),
        (this._isReverse = !1),
        (this._frameRateChanged = !1),
        this._setBitUp(Ce.DISPLAY);
    }
    play(t = 0, e = !0, i = "") {
      (this._isPlaying = !0),
        (this._actionName = i),
        (this.index = "string" == typeof t ? this._getFrameByLabel(t) : t),
        (this.loop = e),
        (this._isReverse = this.wrapMode === ci.WRAP_REVERSE),
        0 == this.index &amp;&amp; this._isReverse &amp;&amp; (this.index = this.count - 1),
        this.interval &gt; 0 &amp;&amp;
          this.timerLoop(this.interval, this, this._frameLoop, null, !0, !0);
    }
    get interval() {
      return this._interval;
    }
    set interval(t) {
      this._interval != t &amp;&amp;
        ((this._frameRateChanged = !0),
        (this._interval = t),
        this._isPlaying &amp;&amp;
          t &gt; 0 &amp;&amp;
          this.timerLoop(t, this, this._frameLoop, null, !0, !0));
    }
    _getFrameByLabel(t) {
      for (var e = 0; e &lt; this._count; e++) {
        var i = this._labels[e];
        if (i &amp;&amp; i.indexOf(t) &gt; -1) return e;
      }
      return 0;
    }
    _frameLoop() {
      if (this._controlNode &amp;&amp; !this._controlNode.destroyed) {
        if (this._isReverse) {
          if ((this._index--, this._index &lt; 0)) {
            if (!this.loop)
              return (
                (this._index = 0), this.stop(), void this.event($t.COMPLETE)
              );
            this.wrapMode == ci.WRAP_PINGPONG
              ? ((this._index = this._count &gt; 0 ? 1 : 0),
                (this._isReverse = !1))
              : (this._index = this._count - 1),
              this.event($t.COMPLETE);
          }
        } else if ((this._index++, this._index &gt;= this._count)) {
          if (!this.loop)
            return this._index--, this.stop(), void this.event($t.COMPLETE);
          this.wrapMode == ci.WRAP_PINGPONG
            ? ((this._index = this._count - 2 &gt;= 0 ? this._count - 2 : 0),
              (this._isReverse = !0))
            : (this._index = 0),
            this.event($t.COMPLETE);
        }
        this.index = this._index;
      } else this.clearTimer(this, this._frameLoop);
    }
    _setControlNode(t) {
      this._controlNode &amp;&amp;
        (this._controlNode.off($t.DISPLAY, this, this._resumePlay),
        this._controlNode.off($t.UNDISPLAY, this, this._resumePlay)),
        (this._controlNode = t),
        t &amp;&amp;
          t != this &amp;&amp;
          (t.on($t.DISPLAY, this, this._resumePlay),
          t.on($t.UNDISPLAY, this, this._resumePlay));
    }
    _setDisplay(t) {
      super._setDisplay(t), this._resumePlay();
    }
    _resumePlay() {
      this._isPlaying &amp;&amp;
        (this._controlNode.displayedInStage
          ? this.play(this._index, this.loop, this._actionName)
          : this.clearTimer(this, this._frameLoop));
    }
    stop() {
      (this._isPlaying = !1), this.clearTimer(this, this._frameLoop);
    }
    get isPlaying() {
      return this._isPlaying;
    }
    addLabel(t, e) {
      this._labels || (this._labels = {}),
        this._labels[e] || (this._labels[e] = []),
        this._labels[e].push(t);
    }
    removeLabel(t) {
      if (t) {
        if (this._labels)
          for (var e in this._labels)
            this._removeLabelFromList(this._labels[e], t);
      } else this._labels = null;
    }
    _removeLabelFromList(t, e) {
      if (t)
        for (var i = t.length - 1; i &gt;= 0; i--) t[i] == e &amp;&amp; t.splice(i, 1);
    }
    gotoAndStop(t) {
      (this.index = "string" == typeof t ? this._getFrameByLabel(t) : t),
        this.stop();
    }
    get index() {
      return this._index;
    }
    set index(t) {
      if (
        ((this._index = t),
        this._displayToIndex(t),
        this._labels &amp;&amp; this._labels[t])
      )
        for (var e = this._labels[t], i = 0, s = e.length; i &lt; s; i++)
          this.event($t.LABEL, e[i]);
    }
    _displayToIndex(t) {}
    get count() {
      return this._count;
    }
    clear() {
      return this.stop(), (this._labels = null), this;
    }
  }
  (ci.WRAP_POSITIVE = 0),
    (ci.WRAP_REVERSE = 1),
    (ci.WRAP_PINGPONG = 2),
    Me.regClass("laya.display.AnimationBase", ci),
    Me.regClass("Laya.AnimationBase", ci);
  class di {
    static subtractVector3(t, e, i) {
      (i[0] = t[0] - e[0]), (i[1] = t[1] - e[1]), (i[2] = t[2] - e[2]);
    }
    static lerp(t, e, i) {
      return t * (1 - i) + e * i;
    }
    static scaleVector3(t, e, i) {
      (i[0] = t[0] * e), (i[1] = t[1] * e), (i[2] = t[2] * e);
    }
    static lerpVector3(t, e, i, s) {
      var r = t[0],
        a = t[1],
        n = t[2];
      (s[0] = r + i * (e[0] - r)),
        (s[1] = a + i * (e[1] - a)),
        (s[2] = n + i * (e[2] - n));
    }
    static lerpVector4(t, e, i, s) {
      var r = t[0],
        a = t[1],
        n = t[2],
        h = t[3];
      (s[0] = r + i * (e[0] - r)),
        (s[1] = a + i * (e[1] - a)),
        (s[2] = n + i * (e[2] - n)),
        (s[3] = h + i * (e[3] - h));
    }
    static slerpQuaternionArray(t, e, i, s, r, a, n) {
      var h,
        o,
        l,
        _,
        u,
        c = t[e + 0],
        d = t[e + 1],
        p = t[e + 2],
        f = t[e + 3],
        m = i[s + 0],
        g = i[s + 1],
        T = i[s + 2],
        v = i[s + 3];
      return (
        (o = c * m + d * g + p * T + f * v) &lt; 0 &amp;&amp;
          ((o = -o), (m = -m), (g = -g), (T = -T), (v = -v)),
        1 - o &gt; 1e-6
          ? ((h = Math.acos(o)),
            (l = Math.sin(h)),
            (_ = Math.sin((1 - r) * h) / l),
            (u = Math.sin(r * h) / l))
          : ((_ = 1 - r), (u = r)),
        (a[n + 0] = _ * c + u * m),
        (a[n + 1] = _ * d + u * g),
        (a[n + 2] = _ * p + u * T),
        (a[n + 3] = _ * f + u * v),
        a
      );
    }
    static getRotation(t, e, i, s) {
      return (Math.atan2(s - e, i - t) / Math.PI) * 180;
    }
    static sortBigFirst(t, e) {
      return t == e ? 0 : e &gt; t ? 1 : -1;
    }
    static sortSmallFirst(t, e) {
      return t == e ? 0 : e &gt; t ? -1 : 1;
    }
    static sortNumBigFirst(t, e) {
      return parseFloat(e) - parseFloat(t);
    }
    static sortNumSmallFirst(t, e) {
      return parseFloat(t) - parseFloat(e);
    }
    static sortByKey(t, e = !1, i = !0) {
      var s;
      return (
        (s = e
          ? i
            ? di.sortNumBigFirst
            : di.sortBigFirst
          : i
            ? di.sortNumSmallFirst
            : di.sortSmallFirst),
        function (e, i) {
          return s(e[t], i[t]);
        }
      );
    }
  }
  class pi extends ci {
    constructor() {
      super(),
        void 0 === pi._sortIndexFun &amp;&amp;
          (pi._sortIndexFun = di.sortByKey("index", !1, !0));
    }
    static _sortIndexFun(t, e) {
      return t.index - e.index;
    }
    _setUp(t, e) {
      (this._targetDic = t),
        (this._animationData = e),
        (this.interval = 1e3 / e.frameRate),
        e.parsed
          ? ((this._count = e.count),
            (this._labels = e.labels),
            (this._usedFrames = e.animationNewFrames))
          : ((this._usedFrames = []),
            this._calculateDatas(),
            (e.parsed = !0),
            (e.labels = this._labels),
            (e.count = this._count),
            (e.animationNewFrames = this._usedFrames));
    }
    clear() {
      return (
        super.clear(),
        (this._targetDic = null),
        (this._animationData = null),
        this
      );
    }
    _displayToIndex(t) {
      if (this._animationData) {
        t &lt; 0 &amp;&amp; (t = 0), t &gt; this._count &amp;&amp; (t = this._count);
        var e,
          i = this._animationData.nodes,
          s = i.length;
        for (e = 0; e &lt; s; e++) this._displayNodeToFrame(i[e], t);
      }
    }
    _displayNodeToFrame(t, e, i = null) {
      i || (i = this._targetDic);
      var s = i[t.target];
      if (s) {
        var r,
          a,
          n,
          h,
          o = t.frames,
          l = t.keys,
          _ = l.length;
        for (h = 0; h &lt; _; h++)
          (n = (a = o[(r = l[h])]).length &gt; e ? a[e] : a[a.length - 1]),
            (s[r] = n);
        var u,
          c = t.funkeys;
        if (0 != (_ = c.length))
          for (h = 0; h &lt; _; h++)
            void 0 !== (u = o[(r = c[h])])[e] &amp;&amp; s[r] &amp;&amp; s[r].apply(s, u[e]);
      }
    }
    _calculateDatas() {
      if (this._animationData) {
        var t,
          e,
          i = this._animationData.nodes,
          s = i.length;
        for (this._count = 0, t = 0; t &lt; s; t++)
          (e = i[t]), this._calculateKeyFrames(e);
        this._count += 1;
      }
    }
    _calculateKeyFrames(t) {
      var e,
        i,
        s = t.keyframes,
        r = t.target;
      for (e in (t.frames || (t.frames = {}),
      t.keys ? (t.keys.length = 0) : (t.keys = []),
      t.funkeys ? (t.funkeys.length = 0) : (t.funkeys = []),
      t.initValues || (t.initValues = {}),
      s)) {
        var a = -1 != e.indexOf("()");
        if (
          ((i = s[e]),
          a &amp;&amp; (e = e.substr(0, e.length - 2)),
          t.frames[e] || (t.frames[e] = []),
          a)
        ) {
          t.funkeys.push(e);
          for (var n = t.frames[e], h = 0; h &lt; i.length; h++) {
            var o = i[h];
            (n[o.index] = o.value),
              o.index &gt; this._count &amp;&amp; (this._count = o.index);
          }
        } else
          this._targetDic &amp;&amp;
            this._targetDic[r] &amp;&amp;
            (t.initValues[e] = this._targetDic[r][e]),
            i.sort(pi._sortIndexFun),
            t.keys.push(e),
            this._calculateNodePropFrames(i, t.frames[e], e, r);
      }
    }
    resetNodes() {
      if (this._targetDic &amp;&amp; this._animationData) {
        var t,
          e,
          i,
          s = this._animationData.nodes,
          r = s.length;
        for (t = 0; t &lt; r; t++)
          if ((i = (e = s[t]).initValues)) {
            var a,
              n = this._targetDic[e.target];
            if (n) for (a in i) n[a] = i[a];
          }
      }
    }
    _calculateNodePropFrames(t, e, i, s) {
      var r,
        a = t.length - 1;
      for (e.length = t[a].index + 1, r = 0; r &lt; a; r++)
        this._dealKeyFrame(t[r]), this._calculateFrameValues(t[r], t[r + 1], e);
      0 == a &amp;&amp;
        ((e[0] = t[0].value),
        this._usedFrames &amp;&amp; (this._usedFrames[t[0].index] = !0)),
        this._dealKeyFrame(t[r]);
    }
    _dealKeyFrame(t) {
      t.label &amp;&amp; "" != t.label &amp;&amp; this.addLabel(t.label, t.index);
    }
    _calculateFrameValues(t, e, i) {
      var s,
        r,
        a = t.index,
        n = e.index,
        h = t.value,
        o = e.value - t.value,
        l = n - a,
        _ = this._usedFrames;
      if ((n &gt; this._count &amp;&amp; (this._count = n), t.tween))
        for (
          null == (r = oi[t.tweenMethod]) &amp;&amp; (r = oi.linearNone), s = a;
          s &lt; n;
          s++
        )
          (i[s] = r(s - a, h, o, l)), _ &amp;&amp; (_[s] = !0);
      else for (s = a; s &lt; n; s++) i[s] = h;
      _ &amp;&amp; ((_[t.index] = !0), (_[e.index] = !0)), (i[e.index] = e.value);
    }
  }
  Me.regClass("laya.display.FrameAnimation", pi),
    Me.regClass("Laya.FrameAnimation", pi);
  class fi {
    constructor() {
      (this._obj = {}), fi._maps.push(this);
    }
    static __init__() {
      (fi.I = new fi()),
        fi.supportWeakMap ||
          i.systemTimer.loop(fi.delInterval, null, fi.clearCache);
    }
    static clearCache() {
      for (var t = 0, e = fi._maps.length; t &lt; e; t++) {
        fi._maps[t]._obj = {};
      }
    }
    set(t, e) {
      null != t &amp;&amp;
        (fi.supportWeakMap ||
          ("string" == typeof t || "number" == typeof t
            ? (this._obj[t] = e)
            : (t.$_GID || (t.$_GID = J.getGID()), (this._obj[t.$_GID] = e))));
    }
    get(t) {
      return null == t
        ? null
        : fi.supportWeakMap
          ? void 0
          : "string" == typeof t || "number" == typeof t
            ? this._obj[t]
            : this._obj[t.$_GID];
    }
    del(t) {
      null != t &amp;&amp;
        (fi.supportWeakMap ||
          ("string" == typeof t || "number" == typeof t
            ? delete this._obj[t]
            : delete this._obj[this._obj.$_GID]));
    }
    has(t) {
      return (
        null != t &amp;&amp;
        !fi.supportWeakMap &amp;&amp;
        ("string" == typeof t || "number" == typeof t
          ? null != this._obj[t]
          : null != this._obj[this._obj.$_GID])
      );
    }
  }
  (fi.supportWeakMap = !1), (fi.delInterval = 6e5), (fi._maps = []);
  class mi {
    static __init() {
      mi._funMap = new fi();
    }
    static getBindFun(t) {
      var e = mi._funMap.get(t);
      if (null == e) {
        var i = '"' + t + '"',
          s =
            "(function(data){if(data==null)return;with(data){try{\nreturn " +
            (i = i
              .replace(/^"\${|}"$/g, "")
              .replace(/\${/g, '"+')
              .replace(/}/g, '+"')) +
            "\n}catch(e){}}})";
        (e = window.Laya._runScript(s)), mi._funMap.set(t, e);
      }
      return e;
    }
    static createByData(t, e) {
      var i = Ti.create();
      if (
        ((t = mi.createComp(e, t, t, null, i))._setBit(Ce.NOT_READY, !0),
        "_idMap" in t &amp;&amp; (t._idMap = i._idMap),
        e.animations)
      ) {
        var s,
          r,
          a,
          n = [],
          h = e.animations,
          o = h.length;
        for (s = 0; s &lt; o; s++) {
          switch (
            ((r = new pi()),
            (a = h[s]),
            r._setUp(i._idMap, a),
            (t[a.name] = r),
            r._setControlNode(t),
            a.action)
          ) {
            case 1:
              r.play(0, !1);
              break;
            case 2:
              r.play(0, !0);
          }
          n.push(r);
        }
        t._aniList = n;
      }
      return (
        "Scene" === t._$componentType &amp;&amp;
          t._width &gt; 0 &amp;&amp;
          null == e.props.hitTestPrior &amp;&amp;
          !t.mouseThrough &amp;&amp;
          (t.hitTestPrior = !0),
        i.beginLoad(t),
        t
      );
    }
    static createInitTool() {
      return Ti.create();
    }
    static createComp(t, e = null, s = null, r = null, a = null) {
      if ("Scene3D" == t.type || "Sprite3D" == t.type) {
        var n = [],
          h = i.Laya.Utils3D._createSceneByJsonForMaker(t, n, a);
        return (
          "Sprite3D" == t.type
            ? i.Laya.StaticBatchManager.combine(h, n)
            : i.Laya.StaticBatchManager.combine(null, n),
          h
        );
      }
      if (!(e = e || mi.getCompInstance(t)))
        return (
          t.props &amp;&amp; t.props.runtime
            ? console.warn("runtime not found:" + t.props.runtime)
            : console.warn("can not create:" + t.type),
          null
        );
      var o = t.child;
      if (o)
        for (
          var l = "List" == e._$componentType, _ = 0, u = o.length;
          _ &lt; u;
          _++
        ) {
          var c = o[_];
          if (
            "itemRender" in e &amp;&amp;
            ("render" == c.props.name || "render" === c.props.renderType)
          )
            e.itemRender = c;
          else if ("Graphic" == c.type) i.ClassUtils._addGraphicsToSprite(c, e);
          else if (i.ClassUtils._isDrawType(c.type))
            i.ClassUtils._addGraphicToSprite(c, e, !0);
          else {
            if (l) {
              var d = [],
                p = mi.createComp(c, null, s, d, a);
              d.length &amp;&amp; (p._$bindData = d);
            } else p = mi.createComp(c, null, s, r, a);
            "Script" == c.type
              ? p instanceof ui
                ? e._addComponentInstance(p)
                : "owner" in p
                  ? (p.owner = e)
                  : "target" in p &amp;&amp; (p.target = e)
              : "mask" == c.props.renderType || "mask" == c.props.name
                ? (e.mask = p)
                : p instanceof De &amp;&amp; e.addChild(p);
          }
        }
      var f = t.props;
      for (var m in f) {
        var g = f[m];
        "string" == typeof g &amp;&amp;
        (g.indexOf("@node:") &gt;= 0 || g.indexOf("@Prefab:") &gt;= 0)
          ? a &amp;&amp; a.addNodeRef(e, m, g)
          : mi.setCompValue(e, m, g, s, r);
      }
      return (
        e._afterInited &amp;&amp; e._afterInited(),
        t.compId &amp;&amp; a &amp;&amp; a._idMap &amp;&amp; (a._idMap[t.compId] = e),
        e
      );
    }
    static setCompValue(t, e, s, r = null, a = null) {
      if ("string" == typeof s &amp;&amp; s.indexOf("${") &gt; -1) {
        if (
          (mi._sheet || (mi._sheet = i.ClassUtils.getClass("laya.data.Table")),
          !mi._sheet)
        )
          return void console.warn("Can not find class Sheet");
        if (a) a.push(t, e, s);
        else if (r) {
          -1 == s.indexOf("].") &amp;&amp; (s = s.replace(".", "[0]."));
          var n,
            h,
            o = new gi(t, e, s);
          o.exe(r);
          for (
            var l = s.replace(/\[.*?\]\./g, ".");
            null != (n = mi._parseWatchData.exec(l));

          ) {
            for (var _ = n[1]; null != (h = mi._parseKeyWord.exec(_)); ) {
              var u = h[0],
                c = r._watchMap[u] || (r._watchMap[u] = []);
              c.push(o), mi._sheet.I.notifer.on(u, r, r.changeData, [u]);
            }
            (c = r._watchMap[_] || (r._watchMap[_] = [])).push(o),
              mi._sheet.I.notifer.on(_, r, r.changeData, [_]);
          }
        }
      } else
        "var" === e &amp;&amp; r
          ? (r[s] = t)
          : (t[e] = "true" === s || ("false" !== s &amp;&amp; s));
    }
    static getCompInstance(t) {
      if ("UIView" == t.type &amp;&amp; t.props &amp;&amp; t.props.pageData)
        return mi.createByData(null, t.props.pageData);
      var e = (t.props &amp;&amp; t.props.runtime) || t.type,
        r = i.ClassUtils.getClass(e);
      if (!r) throw "Can not find class " + e;
      if ("Script" === t.type &amp;&amp; r.prototype._doAwake) {
        var a = s.createByClass(r);
        return (a._destroyed = !1), a;
      }
      return t.props &amp;&amp;
        "renderType" in t.props &amp;&amp;
        "instance" == t.props.renderType
        ? (r.instance || (r.instance = new r()), r.instance)
        : new r();
    }
  }
  (mi._parseWatchData = /\${(.*?)}/g),
    (mi._parseKeyWord =
      /[a-zA-Z_][a-zA-Z0-9_]*(?:(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+)/g);
  class gi {
    constructor(t, e, i) {
      (this.comp = t), (this.prop = e), (this.value = i);
    }
    exe(t) {
      var e = mi.getBindFun(this.value);
      this.comp[this.prop] = e.call(this, t);
    }
  }
  class Ti {
    reset() {
      (this._nodeRefList = null),
        (this._initList = null),
        (this._idMap = null),
        (this._loadList = null),
        (this._scene = null);
    }
    recover() {
      this.reset(), s.recover("InitTool", this);
    }
    static create() {
      var t = s.getItemByClass("InitTool", Ti);
      return (t._idMap = {}), t;
    }
    addLoadRes(t, e = null) {
      this._loadList || (this._loadList = []),
        i.loader.getRes(t) ||
          (e
            ? this._loadList.push({ url: t, type: e })
            : this._loadList.push(t));
    }
    addNodeRef(t, e, i) {
      this._nodeRefList || (this._nodeRefList = []),
        this._nodeRefList.push([t, e, i]),
        i.indexOf("@Prefab:") &gt;= 0 &amp;&amp;
          this.addLoadRes(i.replace("@Prefab:", ""), ei.PREFAB);
    }
    setNodeRef() {
      if (this._nodeRefList)
        if (this._idMap) {
          var t, e, i;
          for (e = this._nodeRefList.length, t = 0; t &lt; e; t++)
            (i = this._nodeRefList[t])[0][i[1]] = this.getReferData(i[2]);
          this._nodeRefList = null;
        } else this._nodeRefList = null;
    }
    getReferData(t) {
      if (t.indexOf("@Prefab:") &gt;= 0)
        return ei.getRes(t.replace("@Prefab:", ""));
      if (t.indexOf("@arr:") &gt;= 0) {
        var e, i, s, r;
        for (
          s = (e = (t = t.replace("@arr:", "")).split(",")).length, i = 0;
          i &lt; s;
          i++
        )
          (r = e[i]), (e[i] = r ? this._idMap[r.replace("@node:", "")] : null);
        return e;
      }
      return this._idMap[t.replace("@node:", "")];
    }
    addInitItem(t) {
      this._initList || (this._initList = []), this._initList.push(t);
    }
    doInits() {
      this._initList &amp;&amp; (this._initList = null);
    }
    finish() {
      this.setNodeRef(),
        this.doInits(),
        this._scene._setBit(Ce.NOT_READY, !1),
        this._scene.parent &amp;&amp;
          this._scene.parent.activeInHierarchy &amp;&amp;
          this._scene.active &amp;&amp;
          this._scene._processActive(),
        this._scene.event("onViewCreated"),
        this.recover();
    }
    beginLoad(t) {
      (this._scene = t),
        !this._loadList || this._loadList.length &lt; 1
          ? this.finish()
          : i.loader.load(this._loadList, S.create(this, this.finish));
    }
  }
  class vi {
    show(t = 0, e = 0) {}
    enable() {}
    hide() {}
    set_onclick(t) {}
    isCanvasRender() {
      return !0;
    }
    renderNotCanvas(t, e, i) {}
  }
  class xi extends vi {
    constructor() {
      super(...arguments),
        (this._show = !1),
        (this._useCanvas = !1),
        (this._height = 100),
        (this._view = []);
    }
    show(t = 0, e = 0) {
      re._isMiniGame || i.Render.isConchApp || (this._useCanvas = !0),
        (this._show = !0),
        (H._fpsData.length = 60),
        (this._view[0] = {
          title: "FPS(WebGL)",
          value: "_fpsStr",
          color: "yellow",
          units: "int",
        }),
        (this._view[1] = {
          title: "Sprite",
          value: "_spriteStr",
          color: "white",
          units: "int",
        }),
        (this._view[2] = {
          title: "RenderBatches",
          value: "renderBatches",
          color: "white",
          units: "int",
        }),
        (this._view[3] = {
          title: "SavedRenderBatches",
          value: "savedRenderBatches",
          color: "white",
          units: "int",
        }),
        (this._view[4] = {
          title: "CPUMemory",
          value: "cpuMemory",
          color: "yellow",
          units: "M",
        }),
        (this._view[5] = {
          title: "GPUMemory",
          value: "gpuMemory",
          color: "yellow",
          units: "M",
        }),
        (this._view[6] = {
          title: "Shader",
          value: "shaderCall",
          color: "white",
          units: "int",
        }),
        (this._view[7] = {
          title: "Canvas",
          value: "_canvasStr",
          color: "white",
          units: "int",
        }),
        ce.is3DMode &amp;&amp;
          ((this._view[0].title = "FPS(3D)"),
          (this._view[8] = {
            title: "TriFaces",
            value: "trianglesFaces",
            color: "white",
            units: "int",
          }),
          (this._view[9] = {
            title: "FrustumCulling",
            value: "frustumCulling",
            color: "white",
            units: "int",
          }),
          (this._view[10] = {
            title: "OctreeNodeCulling",
            value: "octreeNodeCulling",
            color: "white",
            units: "int",
          })),
        this._useCanvas ? this.createUIPre(t, e) : this.createUI(t, e),
        this.enable();
    }
    createUIPre(t, e) {
      var i = re.pixelRatio;
      (this._width = 180 * i),
        (this._vx = 120 * i),
        (this._height = i * (12 * this._view.length + 3 * i) + 4),
        (xi._fontSize = 12 * i);
      for (var s = 0; s &lt; this._view.length; s++)
        (this._view[s].x = 4), (this._view[s].y = s * xi._fontSize + 2 * i);
      this._canvas ||
        ((this._canvas = new Se(!0)),
        this._canvas.size(this._width, this._height),
        (this._ctx = this._canvas.getContext("2d")),
        (this._ctx.textBaseline = "top"),
        (this._ctx.font = xi._fontSize + "px Arial"),
        (this._canvas.source.style.cssText =
          "pointer-events:none;background:rgba(150,150,150,0.8);z-index:100000;position: absolute;direction:ltr;left:" +
          t +
          "px;top:" +
          e +
          "px;width:" +
          this._width / i +
          "px;height:" +
          this._height / i +
          "px;")),
        re.onKGMiniGame || re.container.appendChild(this._canvas.source),
        (this._first = !0),
        this.loop(),
        (this._first = !1);
    }
    createUI(t, e) {
      var i = this._sp,
        s = re.pixelRatio;
      i ||
        ((i = new Be()),
        (this._leftText = new Oe()),
        this._leftText.pos(5, 5),
        (this._leftText.color = "#ffffff"),
        i.addChild(this._leftText),
        (this._txt = new Oe()),
        this._txt.pos(130 * s, 5),
        (this._txt.color = "#ffffff"),
        i.addChild(this._txt),
        (this._sp = i)),
        i.pos(t, e);
      for (var r = "", a = 0; a &lt; this._view.length; a++) {
        r += this._view[a].title + "\n";
      }
      this._leftText.text = r;
      var n = 138 * s,
        h = s * (12 * this._view.length + 3 * s) + 4;
      (this._txt.fontSize = xi._fontSize * s),
        (this._leftText.fontSize = xi._fontSize * s),
        i.size(n, h),
        i.graphics.clear(),
        i.graphics.alpha(0.5),
        i.graphics.drawRect(0, 0, n + 110, h + 30, "#999999"),
        i.graphics.alpha(2),
        this.loop();
    }
    enable() {
      i.systemTimer.frameLoop(1, this, this.loop);
    }
    hide() {
      (this._show = !1),
        i.systemTimer.clear(this, this.loop),
        this._canvas &amp;&amp; re.removeElement(this._canvas.source);
    }
    set_onclick(t) {
      this._sp &amp;&amp; this._sp.on("click", this._sp, t),
        this._canvas &amp;&amp;
          ((this._canvas.source.onclick = t),
          (this._canvas.source.style.pointerEvents = ""));
    }
    loop() {
      H._count++;
      var t = re.now();
      if (!(t - H._timer &lt; 1e3)) {
        var e = H._count;
        if (((H.FPS = Math.round((1e3 * e) / (t - H._timer))), this._show)) {
          (H.trianglesFaces = Math.round(H.trianglesFaces / e)),
            this._useCanvas
              ? (H.renderBatches = Math.round(H.renderBatches / e))
              : (H.renderBatches = Math.round(H.renderBatches / e) - 1),
            (H.savedRenderBatches = Math.round(H.savedRenderBatches / e)),
            (H.shaderCall = Math.round(H.shaderCall / e)),
            (H.spriteRenderUseCacheCount = Math.round(
              H.spriteRenderUseCacheCount / e,
            )),
            (H.canvasNormal = Math.round(H.canvasNormal / e)),
            (H.canvasBitmap = Math.round(H.canvasBitmap / e)),
            (H.canvasReCache = Math.ceil(H.canvasReCache / e)),
            (H.frustumCulling = Math.round(H.frustumCulling / e)),
            (H.octreeNodeCulling = Math.round(H.octreeNodeCulling / e));
          var i = H.FPS &gt; 0 ? Math.floor(1e3 / H.FPS).toString() : " ";
          (H._fpsStr = H.FPS + (H.renderSlow ? " slow" : "") + " " + i),
            (H._spriteStr =
              H.spriteCount +
              (H.spriteRenderUseCacheCount
                ? "/" + H.spriteRenderUseCacheCount
                : "")),
            (H._canvasStr =
              H.canvasReCache + "/" + H.canvasNormal + "/" + H.canvasBitmap),
            (H.cpuMemory = P.cpuMemory),
            (H.gpuMemory = P.gpuMemory),
            this._useCanvas ? this.renderInfoPre() : this.renderInfo(),
            H.clear();
        }
        (H._count = 0), (H._timer = t);
      }
    }
    renderInfoPre() {
      var t,
        e,
        i = 0;
      if (this._canvas) {
        var s = this._ctx;
        for (
          s.clearRect(this._first ? 0 : this._vx, 0, this._width, this._height),
            i = 0;
          i &lt; this._view.length;
          i++
        )
          (t = this._view[i]),
            this._first &amp;&amp;
              ((s.fillStyle = "white"), s.fillText(t.title, t.x, t.y)),
            (s.fillStyle = t.color),
            (e = H[t.value]),
            "M" == t.units &amp;&amp;
              (e = Math.floor((e / 1048576) * 100) / 100 + " M"),
            s.fillText(e + "", t.x + this._vx, t.y);
      }
    }
    renderInfo() {
      for (var t = "", e = 0; e &lt; this._view.length; e++) {
        var i = this._view[e],
          s = H[i.value];
        "M" == i.units &amp;&amp; (s = Math.floor((s / 1048576) * 100) / 100 + " M"),
          "K" == i.units &amp;&amp; (s = Math.floor((s / 1024) * 100) / 100 + " K"),
          (t += s + "\n");
      }
      this._txt.text = t;
    }
    isCanvasRender() {
      return this._useCanvas;
    }
    renderNotCanvas(t, e, i) {
      this._show &amp;&amp; this._sp &amp;&amp; this._sp.render(t, 0, 0);
    }
  }
  xi._fontSize = 12;
  class yi {
    constructor(t = !0) {
      (this.scale = 1),
        (this.currTimer = Date.now()),
        (this.currFrame = 0),
        (this._delta = 0),
        (this._lastTimer = Date.now()),
        (this._map = {}),
        (this._handlers = []),
        (this._temp = []),
        (this._count = 0),
        t &amp;&amp; yi.gSysTimer &amp;&amp; yi.gSysTimer.frameLoop(1, this, this._update);
    }
    get delta() {
      return this._delta;
    }
    _update() {
      if (this.scale &lt;= 0)
        return (this._lastTimer = Date.now()), void (this._delta = 0);
      var t = (this.currFrame = this.currFrame + this.scale),
        e = Date.now(),
        i = e - this._lastTimer &gt; 3e4;
      this._delta = (e - this._lastTimer) * this.scale;
      var s = (this.currTimer = this.currTimer + this._delta);
      this._lastTimer = e;
      var r = this._handlers;
      this._count = 0;
      for (var a = 0, n = r.length; a &lt; n; a++) {
        var h = r[a];
        if (null !== h.method) {
          var o = h.userFrame ? t : s;
          if (o &gt;= h.exeTime)
            if (h.repeat)
              if (!h.jumpFrame || i)
                (h.exeTime += h.delay),
                  h.run(!1),
                  o &gt; h.exeTime &amp;&amp;
                    (h.exeTime +=
                      Math.ceil((o - h.exeTime) / h.delay) * h.delay);
              else for (; o &gt;= h.exeTime; ) (h.exeTime += h.delay), h.run(!1);
            else h.run(!0);
        } else this._count++;
      }
      (this._count &gt; 30 || t % 200 == 0) &amp;&amp; this._clearHandlers();
    }
    _clearHandlers() {
      for (var t = this._handlers, e = 0, i = t.length; e &lt; i; e++) {
        var s = t[e];
        null !== s.method ? this._temp.push(s) : this._recoverHandler(s);
      }
      (this._handlers = this._temp), (t.length = 0), (this._temp = t);
    }
    _recoverHandler(t) {
      this._map[t.key] == t &amp;&amp; delete this._map[t.key],
        t.clear(),
        yi._pool.push(t);
    }
    _create(t, e, i, s, r, a, n) {
      if (!i) return r.apply(s, a), null;
      if (n) {
        var h = this._getHandler(s, r);
        if (h)
          return (
            (h.repeat = e),
            (h.userFrame = t),
            (h.delay = i),
            (h.caller = s),
            (h.method = r),
            (h.args = a),
            (h.exeTime =
              i +
              (t
                ? this.currFrame
                : this.currTimer + Date.now() - this._lastTimer)),
            h
          );
      }
      return (
        ((h = yi._pool.length &gt; 0 ? yi._pool.pop() : new Ei()).repeat = e),
        (h.userFrame = t),
        (h.delay = i),
        (h.caller = s),
        (h.method = r),
        (h.args = a),
        (h.exeTime =
          i +
          (t ? this.currFrame : this.currTimer + Date.now() - this._lastTimer)),
        this._indexHandler(h),
        this._handlers.push(h),
        h
      );
    }
    _indexHandler(t) {
      var e = t.caller,
        s = t.method,
        r = e ? e.$_GID || (e.$_GID = i.Utils.getGID()) : 0,
        a = s.$_TID || (s.$_TID = yi._mid++);
      (t.key = r + "_" + a), (this._map[t.key] = t);
    }
    once(t, e, i, s = null, r = !0) {
      this._create(!1, !1, t, e, i, s, r);
    }
    loop(t, e, i, s = null, r = !0, a = !1) {
      var n = this._create(!1, !0, t, e, i, s, r);
      n &amp;&amp; (n.jumpFrame = a);
    }
    frameOnce(t, e, i, s = null, r = !0) {
      this._create(!0, !1, t, e, i, s, r);
    }
    frameLoop(t, e, i, s = null, r = !0) {
      this._create(!0, !0, t, e, i, s, r);
    }
    toString() {
      return " handlers:" + this._handlers.length + " pool:" + yi._pool.length;
    }
    clear(t, e) {
      var i = this._getHandler(t, e);
      i &amp;&amp; i.clear();
    }
    clearAll(t) {
      if (t)
        for (var e = 0, i = this._handlers.length; e &lt; i; e++) {
          var s = this._handlers[e];
          s.caller === t &amp;&amp; s.clear();
        }
    }
    _getHandler(t, e) {
      var s =
        (t ? t.$_GID || (t.$_GID = i.Utils.getGID()) : 0) +
        "_" +
        (e.$_TID || (e.$_TID = yi._mid++));
      return this._map[s];
    }
    callLater(t, e, i = null) {
      ke.I.callLater(t, e, i);
    }
    runCallLater(t, e) {
      ke.I.runCallLater(t, e);
    }
    runTimer(t, e) {
      var i = this._getHandler(t, e);
      i &amp;&amp; null != i.method &amp;&amp; ((this._map[i.key] = null), i.run(!0));
    }
    pause() {
      this.scale = 0;
    }
    resume() {
      this.scale = 1;
    }
  }
  (yi.gSysTimer = null), (yi._pool = []), (yi._mid = 1);
  class Ei {
    clear() {
      (this.caller = null), (this.method = null), (this.args = null);
    }
    run(t) {
      var e = this.caller;
      if (e &amp;&amp; e.destroyed) return this.clear();
      var i = this.method,
        s = this.args;
      t &amp;&amp; this.clear(), null != i &amp;&amp; (s ? i.apply(e, s) : i.call(e));
    }
  }
  class Ri extends q {
    constructor(t) {
      super(X.SKINMESH, 0), (this.offsetX = 300), (this.offsetY = 0);
      var e = b.mainContext,
        i = 8 * Vt.BYTES_PE;
      (this.position = [2, e.FLOAT, !1, i, 0]),
        (this.texcoord = [2, e.FLOAT, !1, i, 2 * Vt.BYTES_PE]),
        (this.color = [4, e.FLOAT, !1, i, 4 * Vt.BYTES_PE]);
    }
  }
  class Ci extends q {
    constructor(t) {
      super(X.PRIMITIVE, 0),
        (this._attribLocation = ["position", 0, "attribColor", 1]);
    }
  }
  class Ai extends q {
    constructor(t = 0) {
      super(X.TEXTURE2D, t),
        (this.strength = 0),
        (this.blurInfo = null),
        (this.colorMat = null),
        (this.colorAlpha = null),
        (this._attribLocation = [
          "posuv",
          0,
          "attribColor",
          1,
          "attribFlags",
          2,
        ]);
    }
    clear() {
      (this.texture = null),
        (this.shader = null),
        (this.defines._value = this.subID);
    }
  }
  class bi {
    constructor(t) {
      (this.codes = {}),
        (this.funs = {}),
        (this.curUseID = -1),
        (this.funnames = ""),
        (this.script = t);
      for (var e, s, r = 0; !((r = t.indexOf("#begin", r)) &lt; 0); ) {
        for (
          s = r + 5;
          !((s = t.indexOf("#end", s)) &lt; 0) &amp;&amp; "i" === t.charAt(s + 4);

        )
          s += 5;
        if (s &lt; 0) throw "add include err,no #end:" + t;
        e = t.indexOf("\n", r);
        var a = i.ShaderCompile.splitToWords(t.substr(r, e - r), null);
        "code" == a[1]
          ? (this.codes[a[2]] = t.substr(e + 1, s - e - 1))
          : "function" == a[1] &amp;&amp;
            ((e = t.indexOf("function", r)),
            (e += "function".length),
            (this.funs[a[3]] = t.substr(e + 1, s - e - 1)),
            (this.funnames += a[3] + ";")),
          (r = s + 1);
      }
    }
    getWith(t = null) {
      var e = t ? this.codes[t] : this.script;
      if (!e) throw "get with error:" + t;
      return e;
    }
    getFunsScript(t) {
      var e = "";
      for (var i in this.funs) t.indexOf(i + ";") &gt;= 0 &amp;&amp; (e += this.funs[i]);
      return e;
    }
  }
  class Si {
    constructor(t) {
      (this.childs = []),
        (this.text = ""),
        (this.useFuns = ""),
        (this.z = 0),
        (this.includefiles = t);
    }
    setParent(t) {
      t.childs.push(this), (this.z = t.z + 1), (this.parent = t);
    }
    setCondition(t, e) {
      t &amp;&amp;
        ((this.conditionType = e),
        (t = t.replace(/(\s*$)/g, "")),
        (this.condition = function () {
          return this[t];
        }),
        (this.condition.__condition = t));
    }
    toscript(t, e) {
      return this._toscript(t, e, ++Si.__id);
    }
    _toscript(t, e, s) {
      if (this.childs.length &lt; 1 &amp;&amp; !this.text) return e;
      e.length;
      if (this.condition) {
        var r = !!this.condition.call(t);
        if ((this.conditionType === i.ShaderCompile.IFDEF_ELSE &amp;&amp; (r = !r), !r))
          return e;
      }
      if (
        (this.noCompile &amp;&amp; this.text &amp;&amp; e.push(this.text),
        this.childs.length &gt; 0 &amp;&amp;
          this.childs.forEach(function (i, r, a) {
            i._toscript(t, e, s);
          }),
        this.includefiles.length &gt; 0 &amp;&amp; this.useFuns.length &gt; 0)
      )
        for (var a, n = 0, h = this.includefiles.length; n &lt; h; n++)
          this.includefiles[n].curUseID != s &amp;&amp;
            (a = this.includefiles[n].file.getFunsScript(this.useFuns)).length &gt;
              0 &amp;&amp;
            ((this.includefiles[n].curUseID = s), (e[0] = a + e[0]));
      return e;
    }
  }
  Si.__id = 1;
  class wi {
    constructor(t, e, i) {
      this.defs = {};
      let s = this;
      function _compile(t) {
        t = t.replace(wi._clearCR, "");
        var e = [],
          i = new Si(e);
        return s._compileToTree(i, t.split("\n"), 0, e, s.defs), i;
      }
      var r = Date.now();
      (this._VS = _compile(t)),
        (this._PS = _compile(e)),
        (this._nameMap = i),
        Date.now() - r &gt; 2 &amp;&amp;
          console.log(
            "ShaderCompile use time:" +
              (Date.now() - r) +
              "  size:" +
              t.length +
              "/" +
              e.length,
          );
    }
    static __init__() {
      var t = g.instance;
      wi.shaderParamsMap = {
        float: t.FLOAT,
        int: t.INT,
        bool: t.BOOL,
        vec2: t.FLOAT_VEC2,
        vec3: t.FLOAT_VEC3,
        vec4: t.FLOAT_VEC4,
        ivec2: t.INT_VEC2,
        ivec3: t.INT_VEC3,
        ivec4: t.INT_VEC4,
        bvec2: t.BOOL_VEC2,
        bvec3: t.BOOL_VEC3,
        bvec4: t.BOOL_VEC4,
        mat2: t.FLOAT_MAT2,
        mat3: t.FLOAT_MAT3,
        mat4: t.FLOAT_MAT4,
        sampler2D: t.SAMPLER_2D,
        samplerCube: t.SAMPLER_CUBE,
      };
    }
    static _parseOne(t, e, i, s, r, a) {
      var n = {
        type: wi.shaderParamsMap[i[s + 1]],
        name: i[s + 2],
        size: isNaN(parseInt(i[s + 3])) ? 1 : parseInt(i[s + 3]),
      };
      return (
        a &amp;&amp; ("attribute" == r ? t.push(n) : e.push(n)),
        ":" == i[s + 3] &amp;&amp; ((n.type = i[s + 4]), (s += 2)),
        (s += 2)
      );
    }
    static addInclude(t, e) {
      if (!e || 0 === e.length)
        throw new Error("add shader include file err:" + t);
      if (wi.includes[t])
        throw new Error("add shader include file err, has add:" + t);
      wi.includes[t] = new bi(e);
    }
    static preGetParams(t, e) {
      var i,
        s,
        r = [t, e],
        a = {},
        n = [],
        h = [],
        o = {},
        l = {};
      (a.attributes = n), (a.uniforms = h), (a.defines = o);
      for (var _ = 0; _ &lt; 2; _++) {
        r[_] = r[_].replace(wi._removeAnnotation, "");
        var u,
          c = r[_].match(wi._reg);
        for (i = 0, s = c.length; i &lt; s; i++) {
          var d = c[i];
          if ("attribute" == d || "uniform" == d)
            i = wi._parseOne(n, h, c, i, d, !0);
          else {
            if ("#define" == d) {
              l[(d = c[++i])] = 1;
              continue;
            }
            if ("#ifdef" == d) {
              o[(u = c[++i])] = o[u] || [];
              for (i++; i &lt; s; i++)
                if ("attribute" == (d = c[i]) || "uniform" == d)
                  i = wi._parseOne(n, h, c, i, d, !!l[u]);
                else if ("#else" == d)
                  for (i++; i &lt; s; i++)
                    if ("attribute" == (d = c[i]) || "uniform" == d)
                      i = wi._parseOne(n, h, c, i, d, !l[u]);
                    else if ("#endif" == d) break;
            }
          }
        }
      }
      return a;
    }
    static splitToWords(t, e) {
      for (var i, s, r = [], a = -1, n = 0, h = t.length; n &lt; h; n++)
        if (((i = t.charAt(n)), " \t=+-*/&amp;%!&lt;&gt;()'\",;".indexOf(i) &gt;= 0)) {
          if (
            (a &gt;= 0 &amp;&amp; n - a &gt; 1 &amp;&amp; ((s = t.substr(a, n - a)), r.push(s)),
            '"' == i || "'" == i)
          ) {
            var o = t.indexOf(i, n + 1);
            if (o &lt; 0) throw "Sharder err:" + t;
            r.push(t.substr(n + 1, o - n - 1)), (n = o), (a = -1);
            continue;
          }
          "(" == i &amp;&amp;
            e &amp;&amp;
            r.length &gt; 0 &amp;&amp;
            ((s = r[r.length - 1] + ";"),
            "vec4;main;".indexOf(s) &lt; 0 &amp;&amp; (e.useFuns += s)),
            (a = -1);
        } else a &lt; 0 &amp;&amp; (a = n);
      return a &lt; h &amp;&amp; h - a &gt; 1 &amp;&amp; ((s = t.substr(a, h - a)), r.push(s)), r;
    }
    _compileToTree(t, e, i, s, r) {
      var a, n, h, o, l, _, u, c, d, p, f;
      for (d = i; d &lt; e.length; d++)
        if (!((h = e[d]).length &lt; 1) &amp;&amp; 0 !== (_ = h.indexOf("//"))) {
          if (
            (_ &gt;= 0 &amp;&amp; (h = h.substr(0, _)),
            (a = c || new Si(s)),
            (c = null),
            (a.text = h),
            (a.noCompile = !0),
            (_ = h.indexOf("#")) &gt;= 0)
          ) {
            for (o = "#", f = _ + 1, p = h.length; f &lt; p; f++) {
              var m = h.charAt(f);
              if (" " === m || "\t" === m || "?" === m) break;
              o += m;
            }
            switch (((a.name = o), o)) {
              case "#ifdef":
              case "#ifndef":
                if (
                  ((a.src = h),
                  (a.noCompile = null != h.match(/[!&amp;|()=&lt;&gt;]/)),
                  a.noCompile
                    ? console.log(
                        "function():Boolean{return " +
                          h.substr(_ + a.name.length) +
                          "}",
                      )
                    : ((u = h.replace(/^\s*/, "").split(/\s+/)),
                      a.setCondition(
                        u[1],
                        "#ifdef" === o ? wi.IFDEF_YES : wi.IFDEF_ELSE,
                      ),
                      (a.text = "//" + a.text)),
                  a.setParent(t),
                  (t = a),
                  r)
                )
                  for (
                    u = h.substr(f).split(wi._splitToWordExps3), f = 0;
                    f &lt; u.length;
                    f++
                  )
                    (h = u[f]).length &amp;&amp; (r[h] = !0);
                continue;
              case "#if":
                if (
                  ((a.src = h), (a.noCompile = !0), a.setParent(t), (t = a), r)
                )
                  for (
                    u = h.substr(f).split(wi._splitToWordExps3), f = 0;
                    f &lt; u.length;
                    f++
                  )
                    (h = u[f]).length &amp;&amp; "defined" != h &amp;&amp; (r[h] = !0);
                continue;
              case "#else":
                (a.src = h),
                  (n = (t = t.parent).childs[t.childs.length - 1]),
                  (a.noCompile = n.noCompile),
                  a.noCompile ||
                    ((a.condition = n.condition),
                    (a.conditionType =
                      n.conditionType == wi.IFDEF_YES
                        ? wi.IFDEF_ELSE
                        : wi.IFDEF_YES),
                    (a.text =
                      "//" + a.text + " " + n.text + " " + a.conditionType)),
                  a.setParent(t),
                  (t = a);
                continue;
              case "#endif":
                (n = (t = t.parent).childs[t.childs.length - 1]),
                  (a.noCompile = n.noCompile),
                  a.noCompile || (a.text = "//" + a.text),
                  a.setParent(t);
                continue;
              case "#include":
                u = wi.splitToWords(h, null);
                var g = wi.includes[u[1]];
                if (!g)
                  throw "ShaderCompile error no this include file:" + u[1];
                if ((_ = u[0].indexOf("?")) &lt; 0) {
                  a.setParent(t),
                    (h = g.getWith("with" == u[2] ? u[3] : null)),
                    this._compileToTree(a, h.split("\n"), 0, s, r),
                    (a.text = "");
                  continue;
                }
                a.setCondition(u[0].substr(_ + 1), wi.IFDEF_YES),
                  (a.text = g.getWith("with" == u[2] ? u[3] : null));
                break;
              case "#import":
                (l = (u = wi.splitToWords(h, null))[1]),
                  s.push({ node: a, file: wi.includes[l], ofs: a.text.length });
                continue;
            }
          } else {
            if ((n = t.childs[t.childs.length - 1]) &amp;&amp; !n.name) {
              s.length &gt; 0 &amp;&amp; wi.splitToWords(h, n),
                (c = a),
                (n.text += "\n" + h);
              continue;
            }
            s.length &gt; 0 &amp;&amp; wi.splitToWords(h, a);
          }
          a.setParent(t);
        }
    }
    createShader(t, e, i, s) {
      var r = {},
        a = "";
      if (t) for (var n in t) (a += "#define " + n + "\n"), (r[n] = !0);
      var h = this._VS.toscript(r, []),
        o = this._PS.toscript(r, []);
      return (i || K.create)(
        a + h.join("\n"),
        a + o.join("\n"),
        e,
        this._nameMap,
        s,
      );
    }
  }
  (wi.IFDEF_NO = 0),
    (wi.IFDEF_YES = 1),
    (wi.IFDEF_ELSE = 2),
    (wi.IFDEF_PARENT = 3),
    (wi._removeAnnotation = new RegExp(
      "(/\\*([^*]|[\\r\\\n]|(\\*+([^*/]|[\\r\\n])))*\\*+/)|(//.*)",
      "g",
    )),
    (wi._reg = new RegExp(
      "(\".*\")|('.*')|([#\\w\\*-\\.+/()=&lt;&gt;{}\\\\]+)|([,;:\\\\])",
      "g",
    )),
    (wi._splitToWordExps = new RegExp(
      "[(\".*\")]+|[('.*')]+|([ \\t=\\+\\-*/&amp;%!&lt;&gt;!%(),;])",
      "g",
    )),
    (wi.includes = {}),
    (wi._clearCR = new RegExp("\r", "g")),
    (wi._splitToWordExps3 = new RegExp("[ \\t=\\+\\-*/&amp;%!&lt;&gt;!%(),;\\|]", "g"));
  class Mi extends w {
    constructor() {
      super(), (this.worker = new Worker(Mi.workerPath));
      let t = this;
      this.worker.onmessage = function (e) {
        t.workerMessage(e.data);
      };
    }
    static __init__() {
      return (
        null == Mi._preLoadFun &amp;&amp;
        !!Worker &amp;&amp;
        ((Mi._preLoadFun = ei.prototype._loadImage),
        (ei.prototype._loadImage = Mi.prototype._loadImage),
        Mi.I || (Mi.I = new Mi()),
        !0)
      );
    }
    static workerSupported() {
      return !!Worker;
    }
    static enableWorkerLoader() {
      Mi._tryEnabled || ((Mi.enable = !0), (Mi._tryEnabled = !0));
    }
    static set enable(t) {
      Mi._enable != t &amp;&amp;
        ((Mi._enable = t),
        t &amp;&amp; null == Mi._preLoadFun &amp;&amp; (Mi._enable = Mi.__init__()));
    }
    static get enable() {
      return Mi._enable;
    }
    workerMessage(t) {
      if (t)
        switch (t.type) {
          case "Image":
            this.imageLoaded(t);
            break;
          case "Disable":
            Mi.enable = !1;
        }
    }
    imageLoaded(t) {
      if (t.dataType &amp;&amp; "imageBitmap" == t.dataType) {
        var e = t.imageBitmap;
        console.log("load:", t.url), this.event(t.url, e);
      } else this.event(t.url, null);
    }
    loadImage(t) {
      this.worker.postMessage(t);
    }
    _loadImage(e) {
      var i = this;
      let s = i.type;
      if (this._useWorkerLoader &amp;&amp; Mi._enable) {
        e = I.formatURL(e);
        var r = function (a) {
          if ((Mi.I.off(e, i, r), a)) {
            var n = a;
            "nativeimage" !== s &amp;&amp;
              (((n = new N()).wrapModeU = t.WarpMode.Clamp),
              (n.wrapModeV = t.WarpMode.Clamp),
              n.loadImageSource(a, !0)),
              i.onLoaded(n);
          } else Mi._preLoadFun.call(i, e);
        };
        Mi.I.on(e, i, r), Mi.I.loadImage(e);
      } else Mi._preLoadFun.call(i, e);
    }
  }
  (Mi.workerPath = "libs/workerloader.js"),
    (Mi._enable = !1),
    (Mi._tryEnabled = !1);
  class Ii {
    static set cursor(t) {
      Ii._style.cursor = t;
    }
    static get cursor() {
      return Ii._style.cursor;
    }
    static __init__() {
      Ii._style = re.document.body.style;
    }
    static hide() {
      "none" != Ii.cursor &amp;&amp;
        ((Ii._preCursor = Ii.cursor), (Ii.cursor = "none"));
    }
    static show() {
      "none" == Ii.cursor &amp;&amp;
        (Ii._preCursor ? (Ii.cursor = Ii._preCursor) : (Ii.cursor = "auto"));
    }
  }
  class Pi extends St {
    constructor(t) {
      super(Pi.const_stride, 4 * t * Pi.const_stride, 4),
        (this.canReuse = !0),
        this.setAttributes(Pi._fixattriInfo),
        this.createQuadIB(t),
        (this._quadNum = t);
    }
    static __init__() {
      var t = g.instance;
      Pi._fixattriInfo = [
        t.FLOAT,
        4,
        0,
        t.FLOAT,
        3,
        16,
        t.FLOAT,
        3,
        28,
        t.FLOAT,
        4,
        40,
        t.FLOAT,
        4,
        56,
        t.FLOAT,
        3,
        72,
        t.FLOAT,
        2,
        84,
        t.FLOAT,
        4,
        92,
        t.FLOAT,
        1,
        108,
        t.FLOAT,
        1,
        112,
      ];
    }
    setMaxParticleNum(t) {
      this._vb._resizeBuffer(4 * t * Pi.const_stride, !1), this.createQuadIB(t);
    }
    static getAMesh(t) {
      if (Pi._POOL.length) {
        var e = Pi._POOL.pop();
        return e.setMaxParticleNum(t), e;
      }
      return new Pi(t);
    }
    releaseMesh() {
      this._vb.setByteLength(0),
        (this.vertNum = 0),
        (this.indexNum = 0),
        Pi._POOL.push(this);
    }
    destroy() {
      this._ib.destroy(), this._vb.destroy(), this._vb.deleteBuffer();
    }
  }
  (Pi.const_stride = 116), (Pi._POOL = []);
  class Li extends L {}
  Li.create = function (e, i, s) {
    var r = new N(e, i, s, !1, !1);
    return (
      (r.wrapModeU = t.WarpMode.Clamp), (r.wrapModeV = t.WarpMode.Clamp), r
    );
  };
  class Di {
    static __init(t) {
      t.forEach(function (t) {
        t.__init$ &amp;&amp; t.__init$();
      });
    }
    static init(e, s, ...r) {
      if (!Di._isinit) {
        (Di._isinit = !0),
          ArrayBuffer.prototype.slice ||
            (ArrayBuffer.prototype.slice = Di._arrayBufferSlice),
          re.__init__();
        var a = (re.mainCanvas = new Se(!0)),
          n = a.source.style;
        if (
          ((n.position = "absolute"),
          (n.top = n.left = "0px"),
          (n.background = "#000000"),
          re.onKGMiniGame ||
            re.onAlipayMiniGame ||
            re.container.appendChild(a.source),
          (re.canvas = new Se(!0)),
          (re.context = re.canvas.getContext("2d")),
          (re.supportWebAudio = Qe.__init__()),
          (re.supportLocalStorage = ai.__init__()),
          (Di.systemTimer = new yi(!1)),
          (t.systemTimer = yi.gSysTimer = Di.systemTimer),
          (Di.startTimer = new yi(!1)),
          (Di.physicsTimer = new yi(!1)),
          (Di.updateTimer = new yi(!1)),
          (Di.lateTimer = new yi(!1)),
          (Di.timer = new yi(!1)),
          (t.startTimer = i.startTimer = Di.startTimer),
          (t.lateTimer = i.lateTimer = Di.lateTimer),
          (t.updateTimer = i.updateTimer = Di.updateTimer),
          (i.systemTimer = Di.systemTimer),
          (t.timer = i.timer = Di.timer),
          (t.physicsTimer = i.physicsTimer = Di.physicsTimer),
          (Di.loader = new si()),
          (i.Laya = Di),
          (t.loader = i.loader = Di.loader),
          fi.__init__(),
          mi.__init(),
          Ii.__init__(),
          _e.inner_enable(),
          r)
        )
          for (var h = 0, o = r.length; h &lt; o; h++)
            r[h] &amp;&amp; r[h].enable &amp;&amp; r[h].enable();
        return (
          i.Render.isConchApp &amp;&amp; Di.enableNative(),
          Di.enableWebGLPlus(),
          ye.beginCheck(),
          (t.stage = Di.stage = new Xe()),
          (i.stage = Di.stage),
          (J.gStage = Di.stage),
          (I.rootPath = I._basePath = Di._getUrlPath()),
          wt.__int__(),
          It.__init__(),
          Mt.__init__(),
          (Di.render = Di.createRender()),
          (t.render = Di.render),
          Di.stage.size(e, s),
          (window.stage = Di.stage),
          b.__init__(),
          Pi.__init__(),
          wi.__init__(),
          be.__init__(),
          He.__init__(),
          Ge.instance.__init__(Di.stage, ce.canvas),
          Ne.__init__(),
          (Qe.autoStopMusic = !0),
          (H._StatRender = new xi()),
          q._initone(X.TEXTURE2D, Ai),
          q._initone(X.TEXTURE2D | X.FILTERGLOW, Ai),
          q._initone(X.PRIMITIVE, Ci),
          q._initone(X.SKINMESH, Ri),
          ce.canvas
        );
      }
    }
    static createRender() {
      return new ce(0, 0, re.mainCanvas);
    }
    static _getUrlPath() {
      return I.getPath(
        location.protocol + "//" + location.host + location.pathname,
      );
    }
    static _arrayBufferSlice(t, e) {
      var i = new Uint8Array(this, t, e - t),
        s = new Uint8Array(i.length);
      return s.set(i), s.buffer;
    }
    static alertGlobalError(t) {
      var e = 0;
      re.window.onerror = t
        ? function (t, i, s, r, a) {
            e++ &lt; 5 &amp;&amp;
              a &amp;&amp;
              this.alert(
                "å‡ºé”™å•¦ï¼Œè¯·æŠŠæ­¤ä¿¡æ¯æˆªå›¾ç»™ç&nbsp;”å‘å•†\n" + t + "\n" + a.stack,
              );
          }
        : null;
    }
    static _runScript(t) {
      return re.window[Di._evcode](t);
    }
    static enableDebugPanel(t = "libs/laya.debugtool.js") {
      if (window.Laya.DebugPanel) window.Laya.DebugPanel.enable();
      else {
        var e = re.createElement("script");
        (e.onload = function () {
          window.Laya.DebugPanel.enable();
        }),
          (e.src = t),
          re.document.body.appendChild(e);
      }
    }
    static enableWebGLPlus() {
      b.__init_native();
    }
    static enableNative() {
      Di.isNativeRender_enable ||
        ((e.useRetinalCanvas = !0),
        (Di.isNativeRender_enable = !0),
        ce.supportWebGLPlusRendering &amp;&amp;
          (K.prototype.uploadTexture2D = function (t) {
            var e = g.instance;
            e.bindTexture(e.TEXTURE_2D, t);
          }),
        (G.width = re.window.innerWidth),
        (G.height = re.window.innerHeight),
        (re.measureText = function (t, e) {
          return (
            (window.conchTextCanvas.font = e),
            window.conchTextCanvas.measureText(t)
          );
        }),
        (Xe.clear = function (t) {
          oe.set2DRenderConfig();
          var e = tt.create(t).arrColor,
            i = g.instance;
          e &amp;&amp; i.clearColor(e[0], e[1], e[2], e[3]),
            i.clear(
              i.COLOR_BUFFER_BIT | i.DEPTH_BUFFER_BIT | i.STENCIL_BUFFER_BIT,
            ),
            G.clear();
        }),
        (Be.drawToCanvas = function (t, e, i, s, r, a) {
          (r -= t.x), (a -= t.y), (r |= 0), (a |= 0), (i |= 0), (s |= 0);
          var n = new Se(!1),
            h = n.getContext("2d");
          return (
            n.size(i, s),
            (h.asBitmap = !0),
            h._targets.start(),
            be.renders[e]._fun(t, h, r, a),
            h.flush(),
            h._targets.end(),
            h._targets.restore(),
            n
          );
        }),
        Object.defineProperty(k.prototype, "uv", {
          get: function () {
            return this._uv;
          },
          set: function (t) {
            this._uv = t;
          },
        }),
        (Se.prototype.getTexture = function () {
          return (
            this._texture ||
              ((this._texture = this.context._targets),
              (this._texture.uv = k.flipyuv),
              (this._texture.bitmap = this._texture)),
            this._texture
          );
        }));
    }
  }
  (Di.stage = null),
    (Di.systemTimer = null),
    (Di.startTimer = null),
    (Di.physicsTimer = null),
    (Di.updateTimer = null),
    (Di.lateTimer = null),
    (Di.timer = null),
    (Di.loader = null),
    (Di.version = "2.13.3"),
    (Di._isinit = !1),
    (Di.isWXOpenDataContext = !1),
    (Di.isWXPosMsg = !1),
    (Di.__classmap = null),
    (Di.Config = e),
    (Di.TextRender = he),
    (Di.EventDispatcher = w),
    (Di.SoundChannel = ze),
    (Di.Stage = Xe),
    (Di.Render = ce),
    (Di.Browser = re),
    (Di.Sprite = Be),
    (Di.Node = De),
    (Di.Context = oe),
    (Di.WebGL = _e),
    (Di.Handler = S),
    (Di.RunDriver = Ye),
    (Di.Utils = J),
    (Di.Input = Ne),
    (Di.Loader = ei),
    (Di.LocalStorage = ai),
    (Di.SoundManager = Qe),
    (Di.URL = I),
    (Di.Event = $t),
    (Di.Matrix = p),
    (Di.HTMLImage = Li),
    (Di.Laya = Di),
    (Di._evcode = "eval"),
    (Di.isNativeRender_enable = !1),
    (Di.__classmap = i.__classMap),
    (i.Timer = yi),
    (i.Dragging = _i),
    (i.GraphicsBounds = me),
    (i.Sprite = Be),
    (i.TextRender = he),
    (i.Loader = ei),
    (i.TTFLoader = hi),
    (i.WebAudioSound = Ze),
    (i.SoundManager = Qe),
    (i.ShaderCompile = wi),
    (i.ClassUtils = Me),
    (i.SceneUtils = mi),
    (i.Context = oe),
    (i.Render = ce),
    (i.MouseManager = Ge),
    (i.Text = Oe),
    (i.Browser = re),
    (i.WebGL = _e),
    (i.AudioSound = je),
    (i.Pool = s),
    (i.Utils = J),
    (i.Graphics = Re),
    (i.Submit = Xt),
    (i.Stage = Xe),
    (i.Resource = P),
    (i.WorkerLoader = Mi);
  var Bi = window._layalibs;
  if (Bi) {
    Bi.sort(function (t, e) {
      return t.i - e.i;
    });
    for (var Fi = 0; Fi &lt; Bi.length; Fi++)
      Bi[Fi].f(window, window.document, Di);
  }
  let Oi = window;
  Oi.Laya ? ((Oi.Laya.Laya = Di), Object.assign(Oi.Laya, Di)) : (Oi.Laya = Di);
  var Ni,
    Ui = Di.__init,
    Gi = Di.init,
    ki = Di.version,
    Wi = Di.alertGlobalError,
    Yi = Di.enableDebugPanel;
  function _static(t, e) {
    for (var i = 0, s = e.length; i &lt; s; i += 2)
      if ("length" == e[i]) t.length = e[i + 1].call(t);
      else {
        function tmp() {
          var s = e[i],
            r = e[i + 1];
          Object.defineProperty(t, s, {
            get: function () {
              return delete this[s], (this[s] = r.call(this));
            },
            set: function (t) {
              delete this[s], (this[s] = t);
            },
            enumerable: !0,
            configurable: !0,
          });
        }
        tmp();
      }
  }
  class Vi extends ui {
    get isSingleton() {
      return !1;
    }
    _onAwake() {
      this.onAwake(),
        this.onStart !== Vi.prototype.onStart &amp;&amp;
          i.startTimer.callLater(this, this.onStart);
    }
    _onEnable() {
      var t = Vi.prototype;
      this.onTriggerEnter !== t.onTriggerEnter &amp;&amp;
        this.owner.on($t.TRIGGER_ENTER, this, this.onTriggerEnter),
        this.onTriggerStay !== t.onTriggerStay &amp;&amp;
          this.owner.on($t.TRIGGER_STAY, this, this.onTriggerStay),
        this.onTriggerExit !== t.onTriggerExit &amp;&amp;
          this.owner.on($t.TRIGGER_EXIT, this, this.onTriggerExit),
        this.onMouseDown !== t.onMouseDown &amp;&amp;
          this.owner.on($t.MOUSE_DOWN, this, this.onMouseDown),
        this.onMouseUp !== t.onMouseUp &amp;&amp;
          this.owner.on($t.MOUSE_UP, this, this.onMouseUp),
        this.onClick !== t.onClick &amp;&amp;
          this.owner.on($t.CLICK, this, this.onClick),
        this.onStageMouseDown !== t.onStageMouseDown &amp;&amp;
          i.stage.on($t.MOUSE_DOWN, this, this.onStageMouseDown),
        this.onStageMouseUp !== t.onStageMouseUp &amp;&amp;
          i.stage.on($t.MOUSE_UP, this, this.onStageMouseUp),
        this.onStageClick !== t.onStageClick &amp;&amp;
          i.stage.on($t.CLICK, this, this.onStageClick),
        this.onStageMouseMove !== t.onStageMouseMove &amp;&amp;
          i.stage.on($t.MOUSE_MOVE, this, this.onStageMouseMove),
        this.onDoubleClick !== t.onDoubleClick &amp;&amp;
          this.owner.on($t.DOUBLE_CLICK, this, this.onDoubleClick),
        this.onRightClick !== t.onRightClick &amp;&amp;
          this.owner.on($t.RIGHT_CLICK, this, this.onRightClick),
        this.onMouseMove !== t.onMouseMove &amp;&amp;
          this.owner.on($t.MOUSE_MOVE, this, this.onMouseMove),
        this.onMouseOver !== t.onMouseOver &amp;&amp;
          this.owner.on($t.MOUSE_OVER, this, this.onMouseOver),
        this.onMouseOut !== t.onMouseOut &amp;&amp;
          this.owner.on($t.MOUSE_OUT, this, this.onMouseOut),
        this.onKeyDown !== t.onKeyDown &amp;&amp;
          i.stage.on($t.KEY_DOWN, this, this.onKeyDown),
        this.onKeyPress !== t.onKeyPress &amp;&amp;
          i.stage.on($t.KEY_PRESS, this, this.onKeyPress),
        this.onKeyUp !== t.onKeyUp &amp;&amp; i.stage.on($t.KEY_UP, this, this.onKeyUp),
        this.onUpdate !== t.onUpdate &amp;&amp;
          i.updateTimer.frameLoop(1, this, this.onUpdate),
        this.onLateUpdate !== t.onLateUpdate &amp;&amp;
          i.lateTimer.frameLoop(1, this, this.onLateUpdate),
        this.onPreRender !== t.onPreRender &amp;&amp;
          i.lateTimer.frameLoop(1, this, this.onPreRender),
        this.onEnable();
    }
    _onDisable() {
      this.owner.offAllCaller(this),
        i.stage.offAllCaller(this),
        i.startTimer.clearAll(this),
        i.updateTimer.clearAll(this),
        i.lateTimer.clearAll(this),
        this.onDisable();
    }
    _isScript() {
      return !0;
    }
    _onDestroy() {
      this.onDestroy();
    }
    onAwake() {}
    onEnable() {}
    onStart() {}
    onTriggerEnter(t, e, i) {}
    onTriggerStay(t, e, i) {}
    onTriggerExit(t, e, i) {}
    onMouseDown(t) {}
    onMouseUp(t) {}
    onClick(t) {}
    onStageMouseDown(t) {}
    onStageMouseUp(t) {}
    onStageClick(t) {}
    onStageMouseMove(t) {}
    onDoubleClick(t) {}
    onRightClick(t) {}
    onMouseMove(t) {}
    onMouseOver(t) {}
    onMouseOut(t) {}
    onKeyDown(t) {}
    onKeyPress(t) {}
    onKeyUp(t) {}
    onUpdate() {}
    onLateUpdate() {}
    onPreRender() {}
    onPostRender() {}
    onDisable() {}
    onDestroy() {}
  }
  class Xi extends pi {
    constructor() {
      super(...arguments), (this._nodeIDAniDic = {});
    }
    _parseNodeList(t) {
      this._nodeList || (this._nodeList = []),
        (this._nodeDefaultProps[t.compId] = t.props),
        t.compId &amp;&amp; this._nodeList.push(t.compId);
      var e = t.child;
      if (e) {
        var i,
          s = e.length;
        for (i = 0; i &lt; s; i++) this._parseNodeList(e[i]);
      }
    }
    _calGraphicData(t) {
      var e;
      if ((this._setUp(null, t), this._createGraphicData(), this._nodeIDAniDic))
        for (e in this._nodeIDAniDic) this._nodeIDAniDic[e] = null;
    }
    _createGraphicData() {
      var t,
        e,
        i = [],
        s = this.count,
        r = this._usedFrames;
      for (r || (r = []), t = 0; t &lt; s; t++)
        (!r[t] &amp;&amp; e) || (e = this._createFrameGraphic(t)), i.push(e);
      this._gList = i;
    }
    _createFrameGraphic(t) {
      var e = new Re();
      return (
        Xi._rootMatrix || (Xi._rootMatrix = new p()),
        this._updateNodeGraphic(this._rootNode, t, Xi._rootMatrix, e),
        e
      );
    }
    _updateNodeGraphic(t, e, i, s, r = 1) {
      var a, n, h;
      (a = this._nodeGDic[t.compId] =
        this._getNodeGraphicData(t.compId, e, this._nodeGDic[t.compId]))
        .resultTransform || (a.resultTransform = new p()),
        (n = a.resultTransform),
        p.mul(a.transform, i, n);
      var o = a.alpha * r;
      if (!(o &lt; 0.01)) {
        a.skin &amp;&amp;
          (h = this._getTextureByUrl(a.skin)) &amp;&amp;
          (n._checkTransform()
            ? (s.drawTexture(h, 0, 0, a.width, a.height, n, o),
              (a.resultTransform = null))
            : s.drawTexture(h, n.tx, n.ty, a.width, a.height, null, o));
        var l,
          _,
          u = t.child;
        if (u)
          for (_ = u.length, l = 0; l &lt; _; l++)
            this._updateNodeGraphic(u[l], e, n, s, o);
      }
    }
    _updateNoChilds(t, e) {
      if (t.skin) {
        var i = this._getTextureByUrl(t.skin);
        if (i) {
          var s = t.transform;
          s._checkTransform(),
            !s._bTransform
              ? e.drawTexture(i, s.tx, s.ty, t.width, t.height, null, t.alpha)
              : e.drawTexture(i, 0, 0, t.width, t.height, s.clone(), t.alpha);
        }
      }
    }
    _updateNodeGraphic2(t, e, i) {
      var s;
      if (
        ((s = this._nodeGDic[t.compId] =
          this._getNodeGraphicData(t.compId, e, this._nodeGDic[t.compId])),
        t.child)
      ) {
        var r,
          a,
          n,
          h = s.transform;
        h._checkTransform(),
          (a = (r = !h._bTransform) &amp;&amp; (0 != h.tx || 0 != h.ty)),
          (n = h._bTransform || 1 != s.alpha) &amp;&amp; i.save(),
          1 != s.alpha &amp;&amp; i.alpha(s.alpha),
          r ? a &amp;&amp; i.translate(h.tx, h.ty) : i.transform(h.clone());
        var o,
          l,
          _,
          u = t.child;
        if (
          (s.skin &amp;&amp;
            (o = this._getTextureByUrl(s.skin)) &amp;&amp;
            i.drawImage(o, 0, 0, s.width, s.height),
          u)
        )
          for (_ = u.length, l = 0; l &lt; _; l++)
            this._updateNodeGraphic2(u[l], e, i);
        n
          ? i.restore()
          : r
            ? a &amp;&amp; i.translate(-h.tx, -h.ty)
            : i.transform(h.clone().invert());
      } else this._updateNoChilds(s, i);
    }
    _calculateKeyFrames(t) {
      super._calculateKeyFrames(t), (this._nodeIDAniDic[t.target] = t);
    }
    getNodeDataByID(t) {
      return this._nodeIDAniDic[t];
    }
    _getParams(t, e, i, s) {
      var r = Xi._temParam;
      r.length = e.length;
      var a,
        n = e.length;
      for (a = 0; a &lt; n; a++) r[a] = this._getObjVar(t, e[a][0], i, e[a][1], s);
      return r;
    }
    _getObjVar(t, e, i, s, r) {
      if (e in t) {
        var a = t[e];
        return i &gt;= a.length &amp;&amp; (i = a.length - 1), t[e][i];
      }
      return e in r ? r[e] : s;
    }
    _getNodeGraphicData(t, e, i) {
      i || (i = new Hi()),
        i.transform ? i.transform.identity() : (i.transform = new p());
      var s = this.getNodeDataByID(t);
      if (!s) return i;
      var r,
        a,
        n,
        h = s.frames,
        o = this._getParams(
          h,
          Xi._drawTextureCmd,
          e,
          this._nodeDefaultProps[t],
        ),
        l = o[0],
        _ = o[5],
        u = o[6],
        c = o[13],
        d = o[14],
        f = o[7],
        m = o[8],
        g = o[9],
        T = o[11],
        v = o[12];
      (r = o[3]),
        (a = o[4]),
        (0 != r &amp;&amp; 0 != a) || (l = null),
        -1 == r &amp;&amp; (r = 0),
        -1 == a &amp;&amp; (a = 0),
        (i.skin = l),
        (i.width = r),
        (i.height = a),
        l &amp;&amp;
          ((n = this._getTextureByUrl(l))
            ? (r || (r = n.sourceWidth), a || (a = n.sourceHeight))
            : console.warn("lost skin:", l, ",you may load pics first")),
        (i.alpha = o[10]);
      var x = i.transform;
      0 != c &amp;&amp; (_ = c * r),
        0 != d &amp;&amp; (u = d * a),
        (0 == _ &amp;&amp; 0 == u) || x.translate(-_, -u);
      var y = null;
      if (g || 1 !== f || 1 !== m || T || v) {
        (y = Xi._tempMt).identity(), (y._bTransform = !0);
        var E = 0.0174532922222222 * (g - T),
          R = 0.0174532922222222 * (g + v),
          C = Math.cos(R),
          A = Math.sin(R),
          b = Math.sin(E),
          S = Math.cos(E);
        (y.a = f * C),
          (y.b = f * A),
          (y.c = -m * b),
          (y.d = m * S),
          (y.tx = y.ty = 0);
      }
      return y &amp;&amp; (x = p.mul(x, y, x)), x.translate(o[1], o[2]), i;
    }
    _getTextureByUrl(t) {
      return ei.getRes(t);
    }
    setAniData(t, e = null) {
      if (t.animations) {
        (this._nodeDefaultProps = {}),
          (this._nodeGDic = {}),
          this._nodeList &amp;&amp; (this._nodeList.length = 0),
          (this._rootNode = t),
          this._parseNodeList(t);
        var i,
          s,
          r = {},
          a = [],
          n = t.animations,
          h = n.length;
        for (i = 0; i &lt; h; i++)
          if (((s = n[i]), (this._labels = null), (!e || e == s.name) &amp;&amp; s)) {
            try {
              this._calGraphicData(s);
            } catch (t) {
              console.warn(
                "parse animation fail:" + s.name + ",empty animation created",
              ),
                (this._gList = []);
            }
            var o = {};
            (o.interval = 1e3 / s.frameRate),
              (o.frames = this._gList),
              (o.labels = this._labels),
              (o.name = s.name),
              a.push(o),
              (r[s.name] = o);
          }
        (this.animationList = a), (this.animationDic = r);
      }
      Xi._temParam.length = 0;
    }
    parseByData(t) {
      var e, i;
      (e = t.nodeRoot),
        (i = t.aniO),
        delete t.nodeRoot,
        delete t.aniO,
        (this._nodeDefaultProps = {}),
        (this._nodeGDic = {}),
        this._nodeList &amp;&amp; (this._nodeList.length = 0),
        (this._rootNode = e),
        this._parseNodeList(e),
        (this._labels = null);
      try {
        this._calGraphicData(i);
      } catch (t) {
        console.warn(
          "parse animation fail:" + i.name + ",empty animation created",
        ),
          (this._gList = []);
      }
      var s = t;
      return (
        (s.interval = 1e3 / i.frameRate),
        (s.frames = this._gList),
        (s.labels = this._labels),
        (s.name = i.name),
        s
      );
    }
    setUpAniData(t) {
      if (t.animations) {
        var e,
          i,
          s = {},
          r = [],
          a = t.animations,
          n = a.length;
        for (e = 0; e &lt; n; e++)
          if ((i = a[e])) {
            var h = {};
            (h.name = i.name),
              (h.aniO = i),
              (h.nodeRoot = t),
              r.push(h),
              (s[i.name] = h);
          }
        (this.animationList = r), (this.animationDic = s);
      }
    }
    _clear() {
      (this.animationList = null),
        (this.animationDic = null),
        (this._gList = null),
        (this._nodeGDic = null);
    }
    static parseAnimationByData(t) {
      var e;
      return (
        Xi._I || (Xi._I = new Xi()),
        (e = Xi._I.parseByData(t)),
        Xi._I._clear(),
        e
      );
    }
    static parseAnimationData(t) {
      var e;
      return (
        Xi._I || (Xi._I = new Xi()),
        Xi._I.setUpAniData(t),
        ((e = {}).animationList = Xi._I.animationList),
        (e.animationDic = Xi._I.animationDic),
        Xi._I._clear(),
        e
      );
    }
  }
  (Xi._drawTextureCmd = [
    ["skin", null],
    ["x", 0],
    ["y", 0],
    ["width", -1],
    ["height", -1],
    ["pivotX", 0],
    ["pivotY", 0],
    ["scaleX", 1],
    ["scaleY", 1],
    ["rotation", 0],
    ["alpha", 1],
    ["skewX", 0],
    ["skewY", 0],
    ["anchorX", 0],
    ["anchorY", 0],
  ]),
    (Xi._temParam = []),
    (Xi._tempMt = new p());
  class Hi {
    constructor() {
      this.alpha = 1;
    }
  }
  class zi extends ci {
    constructor() {
      super(), this._setControlNode(this);
    }
    destroy(t = !0) {
      this.stop(),
        super.destroy(t),
        (this._frames = null),
        (this._labels = null);
    }
    play(t = 0, e = !0, i = "") {
      i &amp;&amp; this._setFramesFromCache(i, !0), super.play(t, e, i);
    }
    _setFramesFromCache(t, e = !1) {
      if ((this._url &amp;&amp; (t = this._url + "#" + t), t &amp;&amp; zi.framesMap[t])) {
        var i = zi.framesMap[t];
        return (
          i instanceof Array
            ? ((this._frames = zi.framesMap[t]),
              (this._count = this._frames.length))
            : (i.nodeRoot &amp;&amp;
                ((zi.framesMap[t] = Xi.parseAnimationByData(i)),
                (i = zi.framesMap[t])),
              (this._frames = i.frames),
              (this._count = this._frames.length),
              this._frameRateChanged || (this._interval = i.interval),
              (this._labels = this._copyLabels(i.labels))),
          !0
        );
      }
      return e &amp;&amp; console.log("ani not found:", t), !1;
    }
    _copyLabels(t) {
      if (!t) return null;
      var e, i;
      for (i in ((e = {}), t)) e[i] = J.copyArray([], t[i]);
      return e;
    }
    _frameLoop() {
      this._visible &amp;&amp;
        this._style.alpha &gt; 0.01 &amp;&amp;
        this._frames &amp;&amp;
        super._frameLoop();
    }
    _displayToIndex(t) {
      this._frames &amp;&amp; (this.graphics = this._frames[t]);
    }
    get frames() {
      return this._frames;
    }
    set frames(t) {
      (this._frames = t),
        t &amp;&amp;
          ((this._count = t.length),
          this._actionName &amp;&amp; this._setFramesFromCache(this._actionName, !0),
          (this.index = this._index));
    }
    set source(t) {
      t.indexOf(".ani") &gt; -1
        ? this.loadAnimation(t)
        : t.indexOf(".json") &gt; -1 ||
            t.indexOf("als") &gt; -1 ||
            t.indexOf("atlas") &gt; -1
          ? this.loadAtlas(t)
          : this.loadImages(t.split(","));
    }
    set autoAnimation(t) {
      this.play(0, !0, t);
    }
    set autoPlay(t) {
      t ? this.play() : this.stop();
    }
    clear() {
      return (
        super.clear(),
        this.stop(),
        (this.graphics = null),
        (this._frames = null),
        (this._labels = null),
        this
      );
    }
    loadImages(t, e = "") {
      return (
        (this._url = ""),
        this._setFramesFromCache(e) ||
          (this.frames = zi.framesMap[e]
            ? zi.framesMap[e]
            : zi.createFrames(t, e)),
        this
      );
    }
    loadAtlas(t, e = null, s = "") {
      this._url = "";
      var r = this;
      if (!r._setFramesFromCache(s)) {
        function onLoaded(i) {
          t === i &amp;&amp;
            ((r.frames = zi.framesMap[s]
              ? zi.framesMap[s]
              : zi.createFrames(t, s)),
            e &amp;&amp; e.run());
        }
        ei.getAtlas(t)
          ? onLoaded(t)
          : i.loader.load(t, S.create(null, onLoaded, [t]), null, ei.ATLAS);
      }
      return this;
    }
    loadAnimation(t, e = null, s = null) {
      this._url = t;
      return (
        this._actionName || (this._actionName = ""),
        this._setFramesFromCache(this._actionName)
          ? (this._setFramesFromCache(this._actionName, !0),
            (this.index = 0),
            e &amp;&amp; e.run())
          : !s || ei.getAtlas(s)
            ? this._loadAnimationData(t, e, s)
            : i.loader.load(
                s,
                S.create(this, this._loadAnimationData, [t, e, s]),
                null,
                ei.ATLAS,
              ),
        this
      );
    }
    _loadAnimationData(t, e = null, s = null) {
      if (!s || ei.getAtlas(s)) {
        var r = this;
        ei.getRes(t)
          ? onLoaded(t)
          : i.loader.load(t, S.create(null, onLoaded, [t]), null, ei.JSON);
      } else console.warn("atlas load fail:" + s);
      function onLoaded(i) {
        if (ei.getRes(i)) {
          if (t === i) {
            var s;
            if (zi.framesMap[t + "#"])
              r._setFramesFromCache(r._actionName, !0),
                (r.index = 0),
                r._resumePlay();
            else {
              var a = Xi.parseAnimationData(ei.getRes(t));
              if (!a) return;
              var n,
                h,
                o = a.animationList,
                l = o.length;
              for (n = 0; n &lt; l; n++)
                (s = o[n]), (zi.framesMap[t + "#" + s.name] = s), h || (h = s);
              h &amp;&amp;
                ((zi.framesMap[t + "#"] = h),
                r._setFramesFromCache(r._actionName, !0),
                (r.index = 0)),
                r._resumePlay();
            }
            e &amp;&amp; e.run();
          }
          ei.clearRes(t);
        } else
          zi.framesMap[t + "#"] &amp;&amp;
            (r._setFramesFromCache(r._actionName, !0),
            (r.index = 0),
            r._resumePlay(),
            e &amp;&amp; e.run());
      }
    }
    static createFrames(t, e) {
      var i;
      if ("string" == typeof t) {
        var s = ei.getAtlas(t);
        if (s &amp;&amp; s.length) {
          i = [];
          for (var r = 0, a = s.length; r &lt; a; r++) {
            var n = new Re();
            n.drawImage(ei.getRes(s[r]), 0, 0), i.push(n);
          }
        }
      } else if (t instanceof Array)
        for (i = [], r = 0, a = t.length; r &lt; a; r++)
          (n = new Re()).loadImage(t[r], 0, 0), i.push(n);
      return e &amp;&amp; (zi.framesMap[e] = i), i;
    }
    static clearCache(t) {
      var e,
        i = zi.framesMap,
        s = t + "#";
      for (e in i) (e !== t &amp;&amp; 0 !== e.indexOf(s)) || delete zi.framesMap[e];
    }
  }
  (zi.framesMap = {}),
    i.regClass(zi),
    Me.regClass("laya.display.Animation", zi),
    Me.regClass("Laya.Animation", zi);
  class Ki extends pi {
    constructor() {
      super(...arguments), (this._initData = {});
    }
    set target(t) {
      this._target &amp;&amp;
        this._target.off(Ki.EFFECT_BEGIN, this, this._onOtherBegin),
        (this._target = t),
        this._target &amp;&amp;
          this._target.on(Ki.EFFECT_BEGIN, this, this._onOtherBegin),
        this._addEvent();
    }
    get target() {
      return this._target;
    }
    _onOtherBegin(t) {
      t !== this &amp;&amp; this.stop();
    }
    set playEvent(t) {
      (this._playEvent = t), t &amp;&amp; this._addEvent();
    }
    _addEvent() {
      this._target &amp;&amp;
        this._playEvent &amp;&amp;
        (this._setControlNode(this._target),
        this._target.on(this._playEvent, this, this._onPlayAction));
    }
    _onPlayAction() {
      this.play(0, !1);
    }
    play(t = 0, e = !0, i = "") {
      this._target &amp;&amp;
        (this._target.event(Ki.EFFECT_BEGIN, [this]),
        this._recordInitData(),
        super.play(t, e, i));
    }
    _recordInitData() {
      var t, e, i;
      if (this._aniKeys)
        for (e = this._aniKeys.length, t = 0; t &lt; e; t++)
          (i = this._aniKeys[t]), (this._initData[i] = this._target[i]);
    }
    set effectClass(t) {
      if (((this._effectClass = Me.getClass(t)), this._effectClass)) {
        var e = this._effectClass.uiView;
        if (e) {
          var i = e.animations;
          if (i &amp;&amp; i[0]) {
            var s = i[0];
            this._setUp({}, s),
              s.nodes &amp;&amp; s.nodes[0] &amp;&amp; (this._aniKeys = s.nodes[0].keys);
          }
        }
      }
    }
    set effectData(t) {
      if (t) {
        var e = t.animations;
        if (e &amp;&amp; e[0]) {
          var i = e[0];
          this._setUp({}, i),
            i.nodes &amp;&amp; i.nodes[0] &amp;&amp; (this._aniKeys = i.nodes[0].keys);
        }
      }
    }
    _displayToIndex(t) {
      if (this._animationData) {
        t &lt; 0 &amp;&amp; (t = 0), t &gt; this._count &amp;&amp; (t = this._count);
        var e,
          i = this._animationData.nodes,
          s = i.length;
        for (s = s &gt; 1 ? 1 : s, e = 0; e &lt; s; e++)
          this._displayNodeToFrame(i[e], t);
      }
    }
    _displayNodeToFrame(t, e, i = null) {
      if (this._target) {
        var s,
          r,
          a,
          n,
          h,
          o,
          l,
          _,
          u,
          c = this._target,
          d = t.frames,
          p = t.keys,
          f = p.length,
          m = t.secondFrames;
        for (n = 0; n &lt; f; n++)
          (r = d[(s = p[n])]),
            -1 == (h = m[s])
              ? (a = this._initData[s])
              : e &lt; h
                ? (_ = (l = t.keyframes[s])[0]).tween
                  ? (null == (o = oi[_.tweenMethod]) &amp;&amp; (o = oi.linearNone),
                    (u = l[1]),
                    (a = o(
                      e,
                      this._initData[s],
                      u.value - this._initData[s],
                      u.index,
                    )))
                  : (a = this._initData[s])
                : (a = r.length &gt; e ? r[e] : r[r.length - 1]),
            (c[s] = a);
      }
    }
    _calculateKeyFrames(t) {
      super._calculateKeyFrames(t);
      var e,
        i,
        s = t.keyframes,
        r = (t.target, {});
      for (e in ((t.secondFrames = r), s))
        (i = s[e]).length &lt;= 1 ? (r[e] = -1) : (r[e] = i[1].index);
    }
  }
  (Ki.EFFECT_BEGIN = "effectbegin"),
    Me.regClass("laya.display.EffectAnimation", Ki),
    Me.regClass("Laya.EffectAnimation", Ki);
  class ji extends w {
    constructor() {
      super(),
        (this._completeHandler = new S(this, this.onOneLoadComplete)),
        this.reset();
    }
    reset() {
      (this._toLoadList = []), (this._isLoading = !1), (this.totalCount = 0);
    }
    get leftCount() {
      return this._isLoading
        ? this._toLoadList.length + 1
        : this._toLoadList.length;
    }
    get loadedCount() {
      return this.totalCount - this.leftCount;
    }
    load(t, e = !1, i = !0) {
      var s, r;
      if (t instanceof Array)
        for (r = t.length, s = 0; s &lt; r; s++) this._addToLoadList(t[s], e);
      else this._addToLoadList(t, e);
      i &amp;&amp; this._checkNext();
    }
    _addToLoadList(t, e = !1) {
      this._toLoadList.indexOf(t) &gt;= 0 ||
        ei.getRes(t) ||
        (e ? this._toLoadList.push({ url: t }) : this._toLoadList.push(t),
        this.totalCount++);
    }
    _checkNext() {
      if (!this._isLoading) {
        if (0 == this._toLoadList.length) return void this.event($t.COMPLETE);
        var t;
        "string" == typeof (t = this._toLoadList.pop())
          ? this.loadOne(t)
          : this.loadOne(t.url, !0);
      }
    }
    loadOne(t, e = !1) {
      this._curUrl = t;
      var s = J.getFileExtension(this._curUrl);
      e
        ? i.loader.create(t, this._completeHandler)
        : ji.LoadableExtensions[s]
          ? i.loader.load(
              t,
              this._completeHandler,
              null,
              ji.LoadableExtensions[s],
            )
          : t != ii.getFileLoadPath(t) ||
              ji.No3dLoadTypes[s] ||
              !si.createMap[s]
            ? i.loader.load(t, this._completeHandler)
            : i.loader.create(t, this._completeHandler);
    }
    onOneLoadComplete() {
      (this._isLoading = !1),
        ei.getRes(this._curUrl) || console.log("Fail to load:", this._curUrl);
      var t,
        e = J.getFileExtension(this._curUrl);
      ji.LoadableExtensions[e] &amp;&amp;
        ((t = ei.getRes(this._curUrl)) &amp;&amp; t instanceof $e &amp;&amp; (t = t.json),
        t &amp;&amp;
          (t.loadList &amp;&amp; this.load(t.loadList, !1, !1),
          t.loadList3D &amp;&amp; this.load(t.loadList3D, !0, !1)));
      "sk" == e &amp;&amp; this.load(this._curUrl.replace(".sk", ".png"), !1, !1),
        this.event($t.PROGRESS, this.getProgress()),
        this._checkNext();
    }
    getProgress() {
      return this.loadedCount / this.totalCount;
    }
  }
  (ji.LoadableExtensions = {
    scene: ei.JSON,
    scene3d: ei.JSON,
    ani: ei.JSON,
    ui: ei.JSON,
    prefab: ei.PREFAB,
  }),
    (ji.No3dLoadTypes = { png: !0, jpg: !0, txt: !0 });
  class qi extends Be {
    constructor(t = !0) {
      super(),
        (this.autoDestroyAtClosed = !1),
        (this.url = null),
        (this._viewCreated = !1),
        (this._idMap = null),
        (this._$componentType = "Scene"),
        qi.unDestroyedScenes.push(this),
        (this._scene = this),
        t &amp;&amp; this.createChildren();
    }
    createChildren() {}
    static setUIMap(t) {
      let e = i.loader.getRes(t);
      if (!e) throw "è¯·æå‰åŠ&nbsp;è½½uimapçš„jsonï¼Œå†ä½¿ç”¨è¯¥æŽ¥å£è®¾ç½®ï¼";
      for (let t in e) i.Loader.loadedMap[I.formatURL(t + ".scene")] = e[t];
    }
    loadScene(t) {
      var e = t.indexOf(".") &gt; -1 ? t : t + ".scene",
        s = i.loader.getRes(e);
      if (s) this.createView(s);
      else {
        this._setBit(Ce.NOT_READY, !0), i.loader.resetProgress();
        var r = new ji();
        r.on($t.COMPLETE, this, this._onSceneLoaded, [e]), r.load(e);
      }
    }
    _onSceneLoaded(t) {
      this.createView(i.Loader.getRes(t));
    }
    createView(t) {
      t &amp;&amp;
        !this._viewCreated &amp;&amp;
        ((this._viewCreated = !0), mi.createByData(this, t));
    }
    getNodeByID(t) {
      return this._idMap ? this._idMap[t] : null;
    }
    open(t = !0, e = null) {
      t &amp;&amp; qi.closeAll(), qi.root.addChild(this), this.onOpened(e);
    }
    onOpened(t) {}
    close(t = null) {
      this.onClosed(t),
        this.autoDestroyAtClosed ? this.destroy() : this.removeSelf();
    }
    onClosed(t = null) {}
    destroy(t = !0) {
      (this._idMap = null), super.destroy(t);
      for (var e = qi.unDestroyedScenes, i = e.length - 1; i &gt; -1; i--)
        if (e[i] === this) return void e.splice(i, 1);
    }
    set scaleX(t) {
      super.get_scaleX() != t &amp;&amp; (super.set_scaleX(t), this.event($t.RESIZE));
    }
    get scaleX() {
      return super.scaleX;
    }
    set scaleY(t) {
      super.get_scaleY() != t &amp;&amp; (super.set_scaleY(t), this.event($t.RESIZE));
    }
    get scaleY() {
      return super.scaleY;
    }
    get width() {
      if (this._width) return this._width;
      for (var t = 0, e = this.numChildren - 1; e &gt; -1; e--) {
        var i = this.getChildAt(e);
        i._visible &amp;&amp; (t = Math.max(i._x + i.width * i.scaleX, t));
      }
      return t;
    }
    set width(t) {
      super.get_width() != t &amp;&amp;
        (super.set_width(t), this.callLater(this._sizeChanged));
    }
    get height() {
      if (this._height) return this._height;
      for (var t = 0, e = this.numChildren - 1; e &gt; -1; e--) {
        var i = this.getChildAt(e);
        i._visible &amp;&amp; (t = Math.max(i._y + i.height * i.scaleY, t));
      }
      return t;
    }
    set height(t) {
      super.get_height() != t &amp;&amp;
        (super.set_height(t), this.callLater(this._sizeChanged));
    }
    _sizeChanged() {
      this.event($t.RESIZE);
    }
    static get root() {
      return (
        qi._root ||
          ((qi._root = i.stage.addChild(new Be())),
          (qi._root.name = "root"),
          i.stage.on("resize", null, () =&gt; {
            qi._root.size(i.stage.width, i.stage.height),
              qi._root.event($t.RESIZE);
          }),
          qi._root.size(i.stage.width, i.stage.height),
          qi._root.event($t.RESIZE)),
        qi._root
      );
    }
    get timer() {
      return this._timer || i.timer;
    }
    set timer(t) {
      this._timer = t;
    }
    static load(t, e = null, s = null) {
      i.loader.resetProgress();
      var r = new ji();
      function onProgress(t) {
        qi._loadPage &amp;&amp; qi._loadPage.event("progress", t), s &amp;&amp; s.runWith(t);
      }
      r.on($t.PROGRESS, null, onProgress),
        r.once($t.COMPLETE, null, function () {
          r.off($t.PROGRESS, null, onProgress);
          var s = i.Loader.getRes(t);
          if (!s) throw "Can not find scene:" + t;
          if (!s.props) throw "Scene data is error:" + t;
          var a = s.props.runtime ? s.props.runtime : s.type,
            n = i.ClassUtils.getClass(a);
          if ("instance" == s.props.renderType)
            var h = n.instance || (n.instance = new n());
          else h = new n();
          if (!(h &amp;&amp; h instanceof De)) throw "Can not find scene:" + a;
          (h.url = t),
            h._viewCreated
              ? e &amp;&amp; e.runWith(h)
              : (h.on("onViewCreated", null, function () {
                  e &amp;&amp; e.runWith(h);
                }),
                h.createView(s)),
            qi.hideLoadingPage();
        }),
        r.load(t);
    }
    static open(t, e = !0, i = null, s = null, r = null) {
      if (i instanceof S) {
        var a = s;
        (s = i), (i = a);
      }
      qi.showLoadingPage(),
        qi.load(t, S.create(null, this._onSceneLoaded, [e, s, i]), r);
    }
    static _onSceneLoaded(t, e, i, s) {
      s.open(t, i), e &amp;&amp; e.runWith(s);
    }
    static close(t, e = "") {
      for (
        var i = !1, s = qi.unDestroyedScenes, r = 0, a = s.length;
        r &lt; a;
        r++
      ) {
        var n = s[r];
        n &amp;&amp; n.parent &amp;&amp; n.url === t &amp;&amp; n.name == e &amp;&amp; (n.close(), (i = !0));
      }
      return i;
    }
    static closeAll() {
      for (var t = qi.root, e = 0, i = t.numChildren; e &lt; i; e++) {
        var s = t.getChildAt(0);
        s instanceof qi ? s.close() : s.removeSelf();
      }
    }
    static destroy(t, e = "") {
      for (
        var i = !1, s = [].concat(qi.unDestroyedScenes), r = 0, a = s.length;
        r &lt; a;
        r++
      ) {
        var n = s[r];
        n.url !== t || n.name != e || n.destroyed || (n.destroy(), (i = !0));
      }
      return i;
    }
    static gc() {
      P.destroyUnusedResources();
    }
    static setLoadingPage(t) {
      qi._loadPage != t &amp;&amp; (qi._loadPage = t);
    }
    static showLoadingPage(t = null, e = 500) {
      qi._loadPage &amp;&amp;
        (i.systemTimer.clear(null, qi._showLoading),
        i.systemTimer.clear(null, qi._hideLoading),
        i.systemTimer.once(e, null, qi._showLoading, [t], !1));
    }
    static _showLoading(t) {
      i.stage.addChild(qi._loadPage), qi._loadPage.onOpened(t);
    }
    static _hideLoading() {
      qi._loadPage.close();
    }
    static hideLoadingPage(t = 500) {
      qi._loadPage &amp;&amp;
        (i.systemTimer.clear(null, qi._showLoading),
        i.systemTimer.clear(null, qi._hideLoading),
        i.systemTimer.once(t, null, qi._hideLoading));
    }
  }
  (qi.unDestroyedScenes = []),
    i.regClass(qi),
    Me.regClass("laya.display.Scene", qi),
    Me.regClass("Laya.Scene", qi);
  class Zi {
    static create(t) {
      var e = s.getItemByClass("DrawParticleCmd", Zi);
      return (e._templ = t), e;
    }
    recover() {
      (this._templ = null), s.recover("DrawParticleCmd", this);
    }
    run(t, e, i) {
      t.drawParticle(e, i, this._templ);
    }
    get cmdID() {
      return Zi.ID;
    }
  }
  Zi.ID = "DrawParticleCmd";
  class Qi {
    constructor() {}
    paramChanged() {
      Di.systemTimer.callLater(this, this.buildFilter);
    }
    buildFilter() {
      this._target &amp;&amp; this.addFilter(this._target);
    }
    addFilter(t) {
      var e;
      t &amp;&amp;
        (t.filters
          ? (e = t.filters).indexOf(this._filter) &lt; 0 &amp;&amp;
            (e.push(this._filter), (t.filters = J.copyArray([], e)))
          : (t.filters = [this._filter]));
    }
    removeFilter(t) {
      t &amp;&amp; (t.filters = null);
    }
    set target(t) {
      this._target != t &amp;&amp; ((this._target = t), this.paramChanged());
    }
  }
  class $i {
    render(t, e, i, s, r) {
      var a = q.create(X.TEXTURE2D, 0);
      this.setShaderInfo(a, r, t.width, t.height),
        e.drawTarget(t, 0, 0, i, s, p.EMPTY.identity(), a);
    }
    setShaderInfo(t, e, i, s) {
      t.defines.add($.BLUR);
      var r = t;
      ($i.blurinfo[0] = i), ($i.blurinfo[1] = s), (r.blurInfo = $i.blurinfo);
      var a = e.strength / 3,
        n = a * a;
      (e.strength_sig2_2sig2_gauss1[0] = e.strength),
        (e.strength_sig2_2sig2_gauss1[1] = n),
        (e.strength_sig2_2sig2_gauss1[2] = 2 * n),
        (e.strength_sig2_2sig2_gauss1[3] = 1 / (2 * Math.PI * n)),
        (r.strength_sig2_2sig2_gauss1 = e.strength_sig2_2sig2_gauss1);
    }
  }
  $i.blurinfo = new Array(2);
  class Ji extends $ {
    constructor(t = 4) {
      super(),
        (this.strength_sig2_2sig2_gauss1 = []),
        (this.strength = t),
        (this._glRender = new $i());
    }
    get type() {
      return $.BLUR;
    }
    getStrenth_sig2_2sig2_native() {
      this.strength_sig2_native ||
        (this.strength_sig2_native = new Float32Array(4));
      var t = this.strength / 3,
        e = t * t;
      return (
        (this.strength_sig2_native[0] = this.strength),
        (this.strength_sig2_native[1] = e),
        (this.strength_sig2_native[2] = 2 * e),
        (this.strength_sig2_native[3] = 1 / (2 * Math.PI * e)),
        this.strength_sig2_native
      );
    }
  }
  class ts extends Qi {
    constructor() {
      super(), (this._strength = 4), (this._filter = new Ji(this.strength));
    }
    buildFilter() {
      (this._filter = new Ji(this.strength)), super.buildFilter();
    }
    get strength() {
      return this._strength;
    }
    set strength(t) {
      this._strength = t;
    }
  }
  Me.regClass("laya.effect.BlurFilterSetter", ts),
    Me.regClass("Laya.BlurFilterSetter", ts);
  class es extends Qi {
    constructor() {
      super(),
        (this._brightness = 0),
        (this._contrast = 0),
        (this._saturation = 0),
        (this._hue = 0),
        (this._red = 0),
        (this._green = 0),
        (this._blue = 0),
        (this._alpha = 0),
        (this._filter = new et());
    }
    buildFilter() {
      this._filter.reset(),
        this._filter.color(this.red, this.green, this.blue, this.alpha),
        this._filter.adjustHue(this.hue),
        this._filter.adjustContrast(this.contrast),
        this._filter.adjustBrightness(this.brightness),
        this._filter.adjustSaturation(this.saturation),
        super.buildFilter();
    }
    get brightness() {
      return this._brightness;
    }
    set brightness(t) {
      (this._brightness = t), this.paramChanged();
    }
    get contrast() {
      return this._contrast;
    }
    set contrast(t) {
      (this._contrast = t), this.paramChanged();
    }
    get saturation() {
      return this._saturation;
    }
    set saturation(t) {
      (this._saturation = t), this.paramChanged();
    }
    get hue() {
      return this._hue;
    }
    set hue(t) {
      (this._hue = t), this.paramChanged();
    }
    get red() {
      return this._red;
    }
    set red(t) {
      (this._red = t), this.paramChanged();
    }
    get green() {
      return this._green;
    }
    set green(t) {
      (this._green = t), this.paramChanged();
    }
    get blue() {
      return this._blue;
    }
    set blue(t) {
      (this._blue = t), this.paramChanged();
    }
    get color() {
      return this._color;
    }
    set color(t) {
      var e;
      (this._color = t),
        (e = tt.create(t)),
        (this._red = 255 * e.arrColor[0]),
        (this._green = 255 * e.arrColor[1]),
        (this._blue = 255 * e.arrColor[2]),
        this.paramChanged();
    }
    get alpha() {
      return this._alpha;
    }
    set alpha(t) {
      (this._alpha = t), this.paramChanged();
    }
  }
  Me.regClass("laya.effect.ColorFilterSetter", es),
    Me.regClass("Laya.ColorFilterSetter", es);
  class is extends ui {
    constructor() {
      super(...arguments),
        (this.duration = 1e3),
        (this.delay = 0),
        (this.repeat = 0),
        (this.autoDestroyAtComplete = !0);
    }
    _onAwake() {
      (this.target = this.target || this.owner),
        this.autoDestroyAtComplete &amp;&amp;
          (this._comlete = S.create(
            this.target,
            this.target.destroy,
            null,
            !1,
          )),
        this.eventName
          ? this.owner.on(this.eventName, this, this._exeTween)
          : this._exeTween();
    }
    _exeTween() {
      (this._tween = this._doTween()), (this._tween.repeat = this.repeat);
    }
    _doTween() {
      return null;
    }
    onReset() {
      (this.duration = 1e3),
        (this.delay = 0),
        (this.repeat = 0),
        (this.ease = null),
        (this.target = null),
        this.eventName &amp;&amp;
          (this.owner.off(this.eventName, this, this._exeTween),
          (this.eventName = null)),
        this._comlete &amp;&amp; (this._comlete.recover(), (this._comlete = null)),
        this._tween &amp;&amp; (this._tween.clear(), (this._tween = null));
    }
  }
  class ss {
    setShaderInfo(t, e, i, s) {
      t.defines.add(s.type);
      var r = t;
      r.u_blurInfo1 = s._sv_blurInfo1;
      var a = s._sv_blurInfo2;
      (a[0] = e), (a[1] = i), (r.u_blurInfo2 = a), (r.u_color = s.getColor());
    }
    render(t, e, i, s, r) {
      var a = i,
        n = s,
        h = q.create(X.TEXTURE2D, 0);
      this.setShaderInfo(h, a, n, r);
      var o = q.create(X.TEXTURE2D, 0),
        l = p.TEMP.identity();
      e.drawTarget(t, 0, 0, a, n, l, h), e.drawTarget(t, 0, 0, a, n, l, o);
    }
  }
  class rs extends $ {
    constructor(t, e = 4, i = 6, s = 6) {
      super(),
        (this._elements = new Float32Array(9)),
        (this._sv_blurInfo1 = new Array(4)),
        (this._sv_blurInfo2 = [0, 0, 1, 0]),
        (this._color = new tt(t)),
        (this.blur = Math.min(e, 20)),
        (this.offX = i),
        (this.offY = s),
        (this._sv_blurInfo1[0] = this._sv_blurInfo1[1] = this.blur),
        (this._sv_blurInfo1[2] = i),
        (this._sv_blurInfo1[3] = -s),
        (this._glRender = new ss());
    }
    get type() {
      return Ji.GLOW;
    }
    get offY() {
      return this._elements[6];
    }
    set offY(t) {
      (this._elements[6] = t), (this._sv_blurInfo1[3] = -t);
    }
    get offX() {
      return this._elements[5];
    }
    set offX(t) {
      (this._elements[5] = t), (this._sv_blurInfo1[2] = t);
    }
    getColor() {
      return this._color.arrColor;
    }
    get blur() {
      return this._elements[4];
    }
    set blur(t) {
      (this._elements[4] = t),
        (this._sv_blurInfo1[0] = this._sv_blurInfo1[1] = t);
    }
    getColorNative() {
      this._color_native || (this._color_native = new Float32Array(4));
      var t = this.getColor();
      return (
        (this._color_native[0] = t[0]),
        (this._color_native[1] = t[1]),
        (this._color_native[2] = t[2]),
        (this._color_native[3] = t[3]),
        this._color_native
      );
    }
    getBlurInfo1Native() {
      return (
        this._blurInof1_native ||
          (this._blurInof1_native = new Float32Array(4)),
        (this._blurInof1_native[0] = this._blurInof1_native[1] = this.blur),
        (this._blurInof1_native[2] = this.offX),
        (this._blurInof1_native[3] = this.offY),
        this._blurInof1_native
      );
    }
    getBlurInfo2Native() {
      return (
        this._blurInof2_native ||
          (this._blurInof2_native = new Float32Array(4)),
        (this._blurInof2_native[2] = 1),
        this._blurInof2_native
      );
    }
  }
  class as extends Qi {
    constructor() {
      super(),
        (this._color = "#ff0000"),
        (this._blur = 4),
        (this._offX = 6),
        (this._offY = 6),
        (this._filter = new rs(this._color));
    }
    buildFilter() {
      (this._filter = new rs(this.color, this.blur, this.offX, this.offY)),
        super.buildFilter();
    }
    get color() {
      return this._color;
    }
    set color(t) {
      (this._color = t), this.paramChanged();
    }
    get blur() {
      return this._blur;
    }
    set blur(t) {
      (this._blur = t), this.paramChanged();
    }
    get offX() {
      return this._offX;
    }
    set offX(t) {
      (this._offX = t), this.paramChanged();
    }
    get offY() {
      return this._offY;
    }
    set offY(t) {
      (this._offY = t), this.paramChanged();
    }
  }
  Me.regClass("laya.effect.GlowFilterSetter", as),
    Me.regClass("Laya.GlowFilterSetter", as);
  class ns {}
  (ns.STANDARD = 0), (ns.LEFT = 1), (ns.RIGHT = 2), (ns.NUM_PAD = 3);
  class hs {}
  (hs.NUMBER_0 = 48),
    (hs.NUMBER_1 = 49),
    (hs.NUMBER_2 = 50),
    (hs.NUMBER_3 = 51),
    (hs.NUMBER_4 = 52),
    (hs.NUMBER_5 = 53),
    (hs.NUMBER_6 = 54),
    (hs.NUMBER_7 = 55),
    (hs.NUMBER_8 = 56),
    (hs.NUMBER_9 = 57),
    (hs.A = 65),
    (hs.B = 66),
    (hs.C = 67),
    (hs.D = 68),
    (hs.E = 69),
    (hs.F = 70),
    (hs.G = 71),
    (hs.H = 72),
    (hs.I = 73),
    (hs.J = 74),
    (hs.K = 75),
    (hs.L = 76),
    (hs.M = 77),
    (hs.N = 78),
    (hs.O = 79),
    (hs.P = 80),
    (hs.Q = 81),
    (hs.R = 82),
    (hs.S = 83),
    (hs.T = 84),
    (hs.U = 85),
    (hs.V = 86),
    (hs.W = 87),
    (hs.X = 88),
    (hs.Y = 89),
    (hs.Z = 90),
    (hs.F1 = 112),
    (hs.F2 = 113),
    (hs.F3 = 114),
    (hs.F4 = 115),
    (hs.F5 = 116),
    (hs.F6 = 117),
    (hs.F7 = 118),
    (hs.F8 = 119),
    (hs.F9 = 120),
    (hs.F10 = 121),
    (hs.F11 = 122),
    (hs.F12 = 123),
    (hs.F13 = 124),
    (hs.F14 = 125),
    (hs.F15 = 126),
    (hs.NUMPAD = 21),
    (hs.NUMPAD_0 = 96),
    (hs.NUMPAD_1 = 97),
    (hs.NUMPAD_2 = 98),
    (hs.NUMPAD_3 = 99),
    (hs.NUMPAD_4 = 100),
    (hs.NUMPAD_5 = 101),
    (hs.NUMPAD_6 = 102),
    (hs.NUMPAD_7 = 103),
    (hs.NUMPAD_8 = 104),
    (hs.NUMPAD_9 = 105),
    (hs.NUMPAD_ADD = 107),
    (hs.NUMPAD_DECIMAL = 110),
    (hs.NUMPAD_DIVIDE = 111),
    (hs.NUMPAD_ENTER = 108),
    (hs.NUMPAD_MULTIPLY = 106),
    (hs.NUMPAD_SUBTRACT = 109),
    (hs.SEMICOLON = 186),
    (hs.EQUAL = 187),
    (hs.COMMA = 188),
    (hs.MINUS = 189),
    (hs.PERIOD = 190),
    (hs.SLASH = 191),
    (hs.BACKQUOTE = 192),
    (hs.LEFTBRACKET = 219),
    (hs.BACKSLASH = 220),
    (hs.RIGHTBRACKET = 221),
    (hs.QUOTE = 222),
    (hs.ALTERNATE = 18),
    (hs.BACKSPACE = 8),
    (hs.CAPS_LOCK = 20),
    (hs.COMMAND = 15),
    (hs.CONTROL = 17),
    (hs.DELETE = 46),
    (hs.ENTER = 13),
    (hs.ESCAPE = 27),
    (hs.PAGE_UP = 33),
    (hs.PAGE_DOWN = 34),
    (hs.END = 35),
    (hs.HOME = 36),
    (hs.LEFT = 37),
    (hs.UP = 38),
    (hs.RIGHT = 39),
    (hs.DOWN = 40),
    (hs.SHIFT = 16),
    (hs.SPACE = 32),
    (hs.TAB = 9),
    (hs.INSERT = 45);
  class os {
    constructor() {}
    static getMCDName(t) {
      return os._typeToNameDic[t];
    }
    static showRenderTypeInfo(t, e = !1) {
      if (e || !os.showedDic[t]) {
        if (((os.showedDic[t] = !0), !os._rendertypeToStrDic[t])) {
          var i,
            s = [];
          for (i = 1; i &lt;= t; )
            i &amp; t &amp;&amp; s.push(os.getMCDName(i &amp; t)), (i &lt;&lt;= 1);
          os._rendertypeToStrDic[t] = s.join(",");
        }
        console.log("cmd:", os._rendertypeToStrDic[t]);
      }
    }
    static __init__() {
      (os._typeToNameDic[ge.ALPHA] = "ALPHA"),
        (os._typeToNameDic[ge.TRANSFORM] = "TRANSFORM"),
        (os._typeToNameDic[ge.TEXTURE] = "TEXTURE"),
        (os._typeToNameDic[ge.GRAPHICS] = "GRAPHICS"),
        (os._typeToNameDic[ge.ONECHILD] = "ONECHILD"),
        (os._typeToNameDic[ge.CHILDS] = "CHILDS"),
        (os._typeToNameDic[ge.TRANSFORM | ge.ALPHA] = "TRANSFORM|ALPHA"),
        (os._typeToNameDic[ge.CANVAS] = "CANVAS"),
        (os._typeToNameDic[ge.BLEND] = "BLEND"),
        (os._typeToNameDic[ge.FILTERS] = "FILTERS"),
        (os._typeToNameDic[ge.MASK] = "MASK"),
        (os._typeToNameDic[ge.CLIP] = "CLIP"),
        (os._typeToNameDic[ge.LAYAGL3D] = "LAYAGL3D");
    }
    render(t, e, i) {
      os._addType(this._renderType),
        os.showRenderTypeInfo(this._renderType),
        be.renders[this._renderType]._fun(this, t, e + this._x, i + this._y),
        (this._repaint = 0);
    }
    _stageRender(t, e, s) {
      os._countStart(),
        os._PreStageRender.call(i.stage, t, e, s),
        os._countEnd();
    }
    static _countStart() {
      var t;
      for (t in os._countDic) os._countDic[t] = 0;
    }
    static _countEnd() {
      os._i++, os._i &gt; 60 &amp;&amp; (os.showCountInfo(), (os._i = 0));
    }
    static _addType(t) {
      os._countDic[t] ? (os._countDic[t] += 1) : (os._countDic[t] = 1);
    }
    static showCountInfo() {
      var t;
      for (t in (console.log("==================="), os._countDic))
        console.log("count:" + os._countDic[t]), os.showRenderTypeInfo(t, !0);
    }
    static enableQuickTest() {
      os.__init__(),
        (Be.prototype.render = os.prototype.render),
        (os._PreStageRender = Xe.prototype.render),
        (Xe.prototype.render = os.prototype._stageRender);
    }
  }
  (os.showedDic = {}),
    (os._rendertypeToStrDic = {}),
    (os._typeToNameDic = {}),
    (os._countDic = {}),
    (os._i = 0);
  class ls extends Be {
    constructor() {
      super(),
        (this.visible = !1),
        this.on($t.ADDED, this, this._onParentChange),
        this.on($t.REMOVED, this, this._onParentChange);
    }
    _onParentChange() {
      this.target = this.parent;
    }
    play(t = 1, e = null) {
      isNaN(t) &amp;&amp; (t = 1),
        this.url &amp;&amp;
          (this.stop(), (this._channel = Qe.playSound(this.url, t, e)));
    }
    stop() {
      this._channel &amp;&amp; !this._channel.isStopped &amp;&amp; this._channel.stop(),
        (this._channel = null);
    }
    _setPlayAction(t, e, i, s = !0) {
      this[i] &amp;&amp; t &amp;&amp; (s ? t.on(e, this, this[i]) : t.off(e, this, this[i]));
    }
    _setPlayActions(t, e, i, s = !0) {
      if (t &amp;&amp; e) {
        var r,
          a,
          n = e.split(",");
        for (a = n.length, r = 0; r &lt; a; r++)
          this._setPlayAction(t, n[r], i, s);
      }
    }
    set playEvent(t) {
      (this._playEvents = t),
        t &amp;&amp; this._tar &amp;&amp; this._setPlayActions(this._tar, t, "play");
    }
    set target(t) {
      this._tar &amp;&amp;
        (this._setPlayActions(this._tar, this._playEvents, "play", !1),
        this._setPlayActions(this._tar, this._stopEvents, "stop", !1)),
        (this._tar = t),
        this._tar &amp;&amp;
          (this._setPlayActions(this._tar, this._playEvents, "play", !0),
          this._setPlayActions(this._tar, this._stopEvents, "stop", !0));
    }
    set stopEvent(t) {
      (this._stopEvents = t),
        t &amp;&amp; this._tar &amp;&amp; this._setPlayActions(this._tar, t, "stop");
    }
  }
  Me.regClass("laya.media.SoundNode", ls), Me.regClass("Laya.SoundNode", ls);
  class _s {
    static enable(t, e, s = 2) {
      (_s.type = s),
        i.loader.load(
          t,
          S.create(null, _s.onManifestLoaded, [e]),
          null,
          ei.JSON,
        );
    }
    static onManifestLoaded(t, e) {
      (_s.manifest = e),
        (I.customFormat = _s.addVersionPrefix),
        t.run(),
        e ||
          console.warn(
            "èµ„æºç‰ˆæœ¬æ¸…å•æ–‡ä»¶ä¸å­˜åœ¨ï¼Œä¸ä½¿ç”¨èµ„æºç‰ˆæœ¬ç®¡ç†ã€‚å¿½ç•¥ERR_FILE_NOT_FOUNDé”™è¯¯ã€‚",
          );
    }
    static addVersionPrefix(t) {
      return _s.manifest &amp;&amp; _s.manifest[t]
        ? _s.type == _s.FILENAME_VERSION
          ? _s.manifest[t]
          : _s.manifest[t] + "/" + t
        : t;
    }
  }
  (_s.FOLDER_VERSION = 1),
    (_s.FILENAME_VERSION = 2),
    (_s.type = _s.FOLDER_VERSION);
  class us extends w {
    constructor(t = null, e = 0, i = null, s = null) {
      super(),
        (this.disableInput = !1),
        (this.protocols = []),
        (this._byteClass = i || B),
        (this.protocols = s),
        (this.endian = us.BIG_ENDIAN),
        t &amp;&amp; e &gt; 0 &amp;&amp; e &lt; 65535 &amp;&amp; this.connect(t, e);
    }
    get input() {
      return this._input;
    }
    get output() {
      return this._output;
    }
    get connected() {
      return this._connected;
    }
    get endian() {
      return this._endian;
    }
    set endian(t) {
      (this._endian = t),
        null != this._input &amp;&amp; (this._input.endian = t),
        null != this._output &amp;&amp; (this._output.endian = t);
    }
    connect(t, e) {
      var i = "ws://" + t + ":" + e;
      this.connectByUrl(i);
    }
    connectByUrl(t) {
      null != this._socket &amp;&amp; this.close(),
        this._socket &amp;&amp; this.cleanSocket(),
        this.protocols &amp;&amp; 0 != this.protocols.length
          ? (this._socket = new re.window.WebSocket(t, this.protocols))
          : (this._socket = new re.window.WebSocket(t)),
        (this._socket.binaryType = "arraybuffer"),
        (this._output = new this._byteClass()),
        (this._output.endian = this.endian),
        (this._input = new this._byteClass()),
        (this._input.endian = this.endian),
        (this._addInputPosition = 0),
        (this._socket.onopen = (t) =&gt; {
          this._onOpen(t);
        }),
        (this._socket.onmessage = (t) =&gt; {
          this._onMessage(t);
        }),
        (this._socket.onclose = (t) =&gt; {
          this._onClose(t);
        }),
        (this._socket.onerror = (t) =&gt; {
          this._onError(t);
        });
    }
    cleanSocket() {
      this.close(),
        (this._connected = !1),
        (this._socket.onopen = null),
        (this._socket.onmessage = null),
        (this._socket.onclose = null),
        (this._socket.onerror = null),
        (this._socket = null);
    }
    close() {
      if (null != this._socket)
        try {
          this._socket.close();
        } catch (t) {}
    }
    _onOpen(t) {
      (this._connected = !0), this.event($t.OPEN, t);
    }
    _onMessage(t) {
      if (t &amp;&amp; t.data) {
        var e = t.data;
        if (this.disableInput &amp;&amp; e) this.event($t.MESSAGE, e);
        else {
          this._input.length &gt; 0 &amp;&amp;
            this._input.bytesAvailable &lt; 1 &amp;&amp;
            (this._input.clear(), (this._addInputPosition = 0));
          var i = this._input.pos;
          !this._addInputPosition &amp;&amp; (this._addInputPosition = 0),
            (this._input.pos = this._addInputPosition),
            e &amp;&amp;
              ("string" == typeof e
                ? this._input.writeUTFBytes(e)
                : this._input.writeArrayBuffer(e),
              (this._addInputPosition = this._input.pos),
              (this._input.pos = i)),
            this.event($t.MESSAGE, e);
        }
      }
    }
    _onClose(t) {
      (this._connected = !1), this.event($t.CLOSE, t);
    }
    _onError(t) {
      this.event($t.ERROR, t);
    }
    send(t) {
      this._socket.send(t);
    }
    flush() {
      if (this._output &amp;&amp; this._output.length &gt; 0) {
        var t;
        try {
          this._socket &amp;&amp;
            this._socket.send(
              this._output.__getBuffer().slice(0, this._output.length),
            );
        } catch (e) {
          t = e;
        }
        (this._output.endian = this.endian),
          this._output.clear(),
          t &amp;&amp; this.event($t.ERROR, t);
      }
    }
  }
  (us.LITTLE_ENDIAN = "littleEndian"),
    (us.BIG_ENDIAN = "bigEndian"),
    ((Ni = t.TextureDecodeFormat || (t.TextureDecodeFormat = {}))[
      (Ni.Normal = 0)
    ] = "Normal"),
    (Ni[(Ni.RGBM = 1)] = "RGBM");
  class cs extends D {
    constructor() {
      var e = g.instance;
      super(e.RGB, !1),
        (this._glTextureType = e.TEXTURE_2D),
        (this._width = 1),
        (this._height = 1),
        (this._wrapModeU = this._wrapModeV = t.WarpMode.Clamp),
        (this._filterMode = t.FilterMode.Bilinear),
        this._setWarpMode(e.TEXTURE_WRAP_S, this._wrapModeU),
        this._setWarpMode(e.TEXTURE_WRAP_T, this._wrapModeV),
        this._setFilterMode(this._filterMode),
        (this._needUpdate = !1),
        (this._readyed = !0),
        cs._videoTexturePool.push(this);
    }
    static _update() {
      for (var t = cs._videoTexturePool, e = 0, i = t.length; e &lt; i; e++) {
        var s = t[e];
        s &amp;&amp; s._updateVideoData();
      }
    }
    get video() {
      return this._video;
    }
    set video(t) {
      t &amp;&amp;
        t instanceof HTMLVideoElement &amp;&amp;
        ((this._video = t),
        Di.Browser.onMobile &amp;&amp;
          ((this._video["x5-playsInline"] = !0),
          (this._video["x5-playsinline"] = !0),
          (this._video.x5PlaysInline = !0),
          (this._video.playsInline = !0),
          (this._video["webkit-playsInline"] = !0),
          (this._video["webkit-playsinline"] = !0),
          (this._video.webkitPlaysInline = !0),
          (this._video.playsinline = !0),
          (this._video.style.playsInline = !0),
          (this._video.crossOrigin = "anonymous"),
          this._video.setAttribute("crossorigin", "anonymous"),
          this._video.setAttribute("playsinline", "true"),
          this._video.setAttribute("x5-playsinline", "true"),
          this._video.setAttribute("webkit-playsinline", "true"),
          (this._video.autoplay = !0)));
    }
    _updateVideoData() {
      if (this._video &amp;&amp; this._needUpdate) {
        var t = g.instance;
        b.bindTexture(t, this._glTextureType, this._glTexture),
          t.texImage2D(
            this._glTextureType,
            0,
            t.RGB,
            t.RGB,
            t.UNSIGNED_BYTE,
            this._video,
          );
      }
    }
    videoPlay() {
      this._video.play(), (this._needUpdate = !0);
    }
    videoPause() {
      this._video.pause(), (this._needUpdate = !1);
    }
    destroy() {
      super.destroy(), (this._video = null);
    }
  }
  cs._videoTexturePool = new Array();
  class ds {
    constructor() {
      this.reset();
    }
    setData(t, e, i, s) {
      return (
        (this.char = t),
        (this.charNum = t.charCodeAt(0)),
        (this.x = this.y = 0),
        (this.width = e),
        (this.height = i),
        (this.style = s),
        (this.isWord = !ds._isWordRegExp.test(t)),
        this
      );
    }
    reset() {
      return (
        (this.x = this.y = this.width = this.height = 0),
        (this.isWord = !1),
        (this.char = null),
        (this.charNum = 0),
        (this.style = null),
        this
      );
    }
    recover() {
      s.recover("HTMLChar", this.reset());
    }
    static create() {
      return s.getItemByClass("HTMLChar", ds);
    }
    _isChar() {
      return !0;
    }
    _getCSSStyle() {
      return this.style;
    }
  }
  ds._isWordRegExp = new RegExp("[\\w.]", "");
  class ps {
    static enable() {
      ps._logdiv ||
        ((ps._logdiv = re.createElement("div")),
        (ps._logdiv.style.cssText =
          "border:white;padding:4px;overflow-y:auto;z-index:1000000;background:rgba(100,100,100,0.6);color:white;position: absolute;left:0px;top:0px;width:50%;height:50%;"),
        re.document.body.appendChild(ps._logdiv),
        (ps._btn = re.createElement("button")),
        (ps._btn.innerText = "Hide"),
        (ps._btn.style.cssText =
          "z-index:1000001;position: absolute;left:10px;top:10px;"),
        (ps._btn.onclick = ps.toggle),
        re.document.body.appendChild(ps._btn));
    }
    static toggle() {
      var t = ps._logdiv.style;
      "" === t.display
        ? ((ps._btn.innerText = "Show"), (t.display = "none"))
        : ((ps._btn.innerText = "Hide"), (t.display = ""));
    }
    static print(t) {
      ps._logdiv &amp;&amp;
        (ps._count &gt;= ps.maxCount &amp;&amp; ps.clear(),
        ps._count++,
        (ps._logdiv.innerText += t + "\n"),
        ps.autoScrollToBottom &amp;&amp;
          ps._logdiv.scrollHeight -
            ps._logdiv.scrollTop -
            ps._logdiv.clientHeight &lt;
            50 &amp;&amp;
          (ps._logdiv.scrollTop = ps._logdiv.scrollHeight));
    }
    static clear() {
      (ps._logdiv.innerText = ""), (ps._count = 0);
    }
  }
  (ps._count = 0), (ps.maxCount = 50), (ps.autoScrollToBottom = !0);
  let fs = 300;
  class ms {
    constructor(t, e, i, s) {
      (this.scale = 1),
        (this.datas = new Array(fs)),
        (this.datapos = 0),
        (this.id = t),
        (this.color = e),
        (this.name = i),
        (this.scale = s);
    }
    addData(t) {
      (this.datas[this.datapos] = t), this.datapos++, (this.datapos %= fs);
    }
  }
  class gs extends Be {
    constructor() {
      super(),
        (this.datas = []),
        (this.xdata = new Array(gs.DATANUM)),
        (this.ydata = new Array(gs.DATANUM)),
        (this.hud_width = 800),
        (this.hud_height = 200),
        (this.gMinV = 0),
        (this.gMaxV = 100),
        (this.textSpace = 40),
        (this.sttm = 0),
        (gs.inst = this),
        (this._renderType |= ge.CUSTOM),
        this._setRenderType(this._renderType),
        this._setCustomRender(),
        this.addDataDef(0, 16777215, "frame", 1),
        this.addDataDef(1, 65280, "update", 1),
        this.addDataDef(2, 16711680, "flush", 1),
        (gs._now = performance ? performance.now.bind(performance) : Date.now);
    }
    now() {
      return gs._now();
    }
    start() {
      this.sttm = gs._now();
    }
    end(t) {
      var e = gs._now() - this.sttm;
      this.updateValue(t, e);
    }
    config(t, e) {
      (this.hud_width = t), (this.hud_height = e);
    }
    addDataDef(t, e, i, s) {
      this.datas[t] = new ms(t, e, i, s);
    }
    updateValue(t, e) {
      this.datas[t].addData(e);
    }
    v2y(t) {
      this._y, this.hud_height, this.gMinV, this.gMaxV;
      return this._y + this.hud_height * (1 - (t - this.gMinV) / this.gMaxV);
    }
    drawHLine(t, e, i, s) {
      var r = this._x,
        a = (this._x, this.hud_width, this.v2y(e));
      t.fillText(s, r, a - 6, null, "green", null),
        (r += this.textSpace),
        (t.fillStyle = i),
        t.fillRect(r, a, this._x + this.hud_width, 1, null);
    }
    customRender(t, e, i) {
      var s = performance.now();
      gs._lastTm &lt;= 0 &amp;&amp; (gs._lastTm = s),
        this.updateValue(0, s - gs._lastTm),
        (gs._lastTm = s),
        t.save(),
        t.fillRect(
          this._x,
          this._y,
          this.hud_width,
          this.hud_height + 4,
          "#000000cc",
        ),
        (t.globalAlpha = 0.9),
        this.drawHLine(t, 0, "green", "    0"),
        this.drawHLine(t, 10, "green", "  10"),
        this.drawHLine(t, 16.667, "red", " "),
        this.drawHLine(t, 20, "green", "50|20"),
        this.drawHLine(t, 33.334, "yellow", ""),
        this.drawHLine(t, 16.667 * 3, "yellow", ""),
        this.drawHLine(t, 66.668, "yellow", ""),
        this.drawHLine(t, 50, "green", "20|50"),
        this.drawHLine(t, 100, "green", "10|100");
      for (var r = 0, a = this.datas.length; r &lt; a; r++) {
        var n = this.datas[r];
        if (n) {
          var h = n.datas.length,
            o = (this.hud_width - this.textSpace) / h,
            l = n.datapos,
            _ = this._x + this.textSpace;
          t.fillStyle = n.color;
          for (var u = h; l &lt; u; l++) {
            var c = this.v2y(n.datas[l] * n.scale);
            t.fillRect(_, c, o, this.hud_height + this._y - c, null), (_ += o);
          }
          for (l = 0; l &lt; n.datapos; l++)
            (c = this.v2y(n.datas[l] * n.scale)),
              t.fillRect(_, c, o, this.hud_height + this._y - c, null),
              (_ += o);
        }
      }
      t.restore();
    }
  }
  (gs._lastTm = 0), (gs._now = null), (gs.DATANUM = 300), (gs.drawTexTm = 0);
  class Ts {
    constructor() {
      this.maxCount = 1e3;
    }
    getCacheList() {
      return s.getPoolBySign(this.sign);
    }
    tryDispose(t) {
      var e;
      (e = s.getPoolBySign(this.sign)).length &gt; this.maxCount &amp;&amp;
        e.splice(this.maxCount, e.length - this.maxCount);
    }
    static addPoolCacheManager(t, e = 100) {
      var i;
      ((i = new Ts()).sign = t),
        (i.maxCount = e),
        ye.regCacheByFunction(
          J.bind(i.tryDispose, i),
          J.bind(i.getCacheList, i),
        );
    }
  }
  class vs extends w {
    constructor() {
      super(...arguments),
        (this._tweenDic = {}),
        (this._tweenDataList = []),
        (this._currTime = 0),
        (this._lastTime = 0),
        (this._startTime = 0),
        (this._index = 0),
        (this._gidIndex = 0),
        (this._firstTweenDic = {}),
        (this._startTimeSort = !1),
        (this._endTimeSort = !1),
        (this._loopKey = !1),
        (this.scale = 1),
        (this._frameRate = 60),
        (this._frameIndex = 0),
        (this._total = 0);
    }
    static to(t, e, i, s = null, r = 0) {
      return new vs().to(t, e, i, s, r);
    }
    static from(t, e, i, s = null, r = 0) {
      return new vs().from(t, e, i, s, r);
    }
    to(t, e, i, s = null, r = 0) {
      return this._create(t, e, i, s, r, !0);
    }
    from(t, e, i, s = null, r = 0) {
      return this._create(t, e, i, s, r, !1);
    }
    _create(t, e, i, r, a, n) {
      var h = s.getItemByClass("tweenData", xs);
      return (
        (h.isTo = n),
        (h.type = 0),
        (h.target = t),
        (h.duration = i),
        (h.data = e),
        (h.startTime = this._startTime + a),
        (h.endTime = h.startTime + h.duration),
        (h.ease = r),
        (this._startTime = Math.max(h.endTime, this._startTime)),
        this._tweenDataList.push(h),
        (this._startTimeSort = !0),
        (this._endTimeSort = !0),
        this
      );
    }
    addLabel(t, e) {
      var i = s.getItemByClass("tweenData", xs);
      return (
        (i.type = 1),
        (i.data = t),
        (i.endTime = i.startTime = this._startTime + e),
        this._labelDic || (this._labelDic = {}),
        (this._labelDic[t] = i),
        this._tweenDataList.push(i),
        this
      );
    }
    removeLabel(t) {
      if (this._labelDic &amp;&amp; this._labelDic[t]) {
        var e = this._labelDic[t];
        if (e) {
          var i = this._tweenDataList.indexOf(e);
          i &gt; -1 &amp;&amp; this._tweenDataList.splice(i, 1);
        }
        delete this._labelDic[t];
      }
    }
    gotoTime(t) {
      if (null != this._tweenDataList &amp;&amp; 0 != this._tweenDataList.length) {
        var e, i, r, a;
        for (var n in this._firstTweenDic)
          if ((i = this._firstTweenDic[n]))
            for (var h in i) h in i.diyTarget &amp;&amp; (i.diyTarget[h] = i[h]);
        for (n in this._tweenDic)
          (e = this._tweenDic[n]).clear(), delete this._tweenDic[n];
        if (
          ((this._index = 0),
          (this._gidIndex = 0),
          (this._currTime = t),
          (this._lastTime = re.now()),
          null == this._endTweenDataList || this._endTimeSort)
        ) {
          (this._endTimeSort = !1),
            (this._endTweenDataList = r = this._tweenDataList.concat()),
            r.sort(function (t, e) {
              return t.endTime &gt; e.endTime ? 1 : t.endTime &lt; e.endTime ? -1 : 0;
            });
        } else r = this._endTweenDataList;
        for (var o = 0, l = r.length; o &lt; l; o++)
          if (0 == (a = r[o]).type) {
            if (!(t &gt;= a.endTime)) break;
            this._index = Math.max(this._index, o + 1);
            var _ = a.data;
            if (a.isTo) for (var u in _) a.target[u] = _[u];
          }
        for (o = 0, l = this._tweenDataList.length; o &lt; l; o++)
          0 == (a = this._tweenDataList[o]).type &amp;&amp;
            t &gt;= a.startTime &amp;&amp;
            t &lt; a.endTime &amp;&amp;
            ((this._index = Math.max(this._index, o + 1)),
            this._gidIndex++,
            (e = s.getItemByClass("tween", li))._create(
              a.target,
              a.data,
              a.duration,
              a.ease,
              S.create(this, this._animComplete, [this._gidIndex]),
              0,
              !1,
              a.isTo,
              !0,
              !1,
            ),
            e.setStartTime(this._currTime - (t - a.startTime)),
            e._updateEase(this._currTime),
            (e.gid = this._gidIndex),
            (this._tweenDic[this._gidIndex] = e));
      }
    }
    gotoLabel(t) {
      if (null != this._labelDic) {
        var e = this._labelDic[t];
        e &amp;&amp; this.gotoTime(e.startTime);
      }
    }
    pause() {
      i.timer.clear(this, this._update);
    }
    resume() {
      this.play(this._currTime, this._loopKey);
    }
    play(t = 0, e = !1) {
      if (this._tweenDataList) {
        if (this._startTimeSort) {
          (this._startTimeSort = !1),
            this._tweenDataList.sort(function (t, e) {
              return t.startTime &gt; e.startTime
                ? 1
                : t.startTime &lt; e.startTime
                  ? -1
                  : 0;
            });
          for (var s = 0, r = this._tweenDataList.length; s &lt; r; s++) {
            var a = this._tweenDataList[s];
            if (null != a &amp;&amp; 0 == a.type) {
              var n = a.target,
                h = n.$_GID || (n.$_GID = J.getGID()),
                o = null;
              for (var l in (null == this._firstTweenDic[h]
                ? (((o = {}).diyTarget = n), (this._firstTweenDic[h] = o))
                : (o = this._firstTweenDic[h]),
              a.data))
                null == o[l] &amp;&amp; (o[l] = n[l]);
            }
          }
        }
        "string" == typeof t ? this.gotoLabel(t) : this.gotoTime(t),
          (this._loopKey = e),
          (this._lastTime = re.now()),
          i.timer.frameLoop(1, this, this._update);
      }
    }
    _update() {
      if (this._currTime &gt;= this._startTime) {
        if (!this._loopKey) {
          for (var t in this._tweenDic) (e = this._tweenDic[t]).complete();
          return this.pause(), void this._complete();
        }
        if ((this._complete(), !this._tweenDataList)) return;
        this.gotoTime(0);
      }
      var e,
        i = re.now(),
        r = i - this._lastTime,
        a = (this._currTime += r * this.scale);
      for (t in ((this._lastTime = i), this._tweenDic))
        (e = this._tweenDic[t])._updateEase(a);
      if (
        0 != this._tweenDataList.length &amp;&amp;
        this._index &lt; this._tweenDataList.length
      ) {
        var n = this._tweenDataList[this._index];
        a &gt;= n.startTime &amp;&amp;
          (this._index++,
          0 == n.type
            ? (this._gidIndex++,
              (e = s.getItemByClass("tween", li))._create(
                n.target,
                n.data,
                n.duration,
                n.ease,
                S.create(this, this._animComplete, [this._gidIndex]),
                0,
                !1,
                n.isTo,
                !0,
                !1,
              ),
              e.setStartTime(a),
              (e.gid = this._gidIndex),
              (this._tweenDic[this._gidIndex] = e),
              e._updateEase(a))
            : this.event($t.LABEL, n.data));
      }
    }
    _animComplete(t) {
      this._tweenDic[t] &amp;&amp; delete this._tweenDic[t];
    }
    _complete() {
      this.event($t.COMPLETE);
    }
    get index() {
      return this._frameIndex;
    }
    set index(t) {
      (this._frameIndex = t),
        this.gotoTime((this._frameIndex / this._frameRate) * 1e3);
    }
    get total() {
      return (
        (this._total = Math.floor((this._startTime / 1e3) * this._frameRate)),
        this._total
      );
    }
    reset() {
      var t, e, s;
      if (this._labelDic) for (t in this._labelDic) delete this._labelDic[t];
      for (t in this._tweenDic)
        this._tweenDic[t].clear(), delete this._tweenDic[t];
      for (t in this._firstTweenDic) delete this._firstTweenDic[t];
      if (
        ((this._endTweenDataList = null),
        this._tweenDataList &amp;&amp; this._tweenDataList.length)
      )
        for (s = this._tweenDataList.length, e = 0; e &lt; s; e++)
          this._tweenDataList[e] &amp;&amp; this._tweenDataList[e].destroy();
      (this._tweenDataList.length = 0),
        (this._currTime = 0),
        (this._lastTime = 0),
        (this._startTime = 0),
        (this._index = 0),
        (this._gidIndex = 0),
        (this.scale = 1),
        i.timer.clear(this, this._update);
    }
    destroy() {
      this.reset(),
        (this._labelDic = null),
        (this._tweenDic = null),
        (this._tweenDataList = null),
        (this._firstTweenDic = null);
    }
  }
  class xs {
    constructor() {
      (this.type = 0), (this.isTo = !0);
    }
    destroy() {
      (this.target = null),
        (this.ease = null),
        (this.data = null),
        (this.isTo = !0),
        (this.type = 0),
        s.recover("tweenData", this);
    }
  }
  class ys {
    characterMapContains(t) {
      for (var e = 0; e &lt; ys.charsMap.length; ++e)
        if (ys.charsMap[e][0] === t) return !0;
      return !1;
    }
    getCharRep(t) {
      for (var e = 0; e &lt; ys.charsMap.length; ++e)
        if (ys.charsMap[e][0] === t) return ys.charsMap[e];
      return !1;
    }
    getCombCharRep(t, e) {
      for (var i = 0; i &lt; ys.combCharsMap.length; ++i)
        if (ys.combCharsMap[i][0][0] === t &amp;&amp; ys.combCharsMap[i][0][1] === e)
          return ys.combCharsMap[i];
      return !1;
    }
    isTransparent(t) {
      for (var e = 0; e &lt; ys.transChars.length; ++e)
        if (ys.transChars[e] === t) return !0;
      return !1;
    }
    getOriginalCharsFromCode(t) {
      var e;
      for (e = 0; e &lt; ys.charsMap.length; ++e)
        if (ys.charsMap[e].indexOf(t) &gt; -1)
          return String.fromCharCode(ys.charsMap[e][0]);
      for (e = 0; e &lt; ys.combCharsMap.length; ++e)
        if (ys.combCharsMap[e].indexOf(t) &gt; -1)
          return (
            String.fromCharCode(ys.combCharsMap[e][0][0]) +
            String.fromCharCode(ys.combCharsMap[e][0][1])
          );
      return String.fromCharCode(t);
    }
    convertArabic(t) {
      for (var e, i, s = "", r = 0; r &lt; t.length; ++r) {
        var a = t.charCodeAt(r);
        if (this.characterMapContains(a)) {
          for (
            var n = null, h = null, o = r - 1, l = r + 1;
            o &gt;= 0 &amp;&amp; this.isTransparent(t.charCodeAt(o));
            --o
          );
          for (
            (!(e =
              !!(n = o &gt;= 0 ? t.charCodeAt(o) : null) &amp;&amp; this.getCharRep(n)) ||
              (null == e[2] &amp;&amp; null == e[3])) &amp;&amp;
            (n = null);
            l &lt; t.length &amp;&amp; this.isTransparent(t.charCodeAt(l));
            ++l
          );
          if (
            ((!(e =
              !!(h = l &lt; t.length ? t.charCodeAt(l) : null) &amp;&amp;
              this.getCharRep(h)) ||
              (null == e[3] &amp;&amp; null == e[4])) &amp;&amp;
              (h = null),
            1604 === a &amp;&amp;
              null != h &amp;&amp;
              (1570 === h || 1571 === h || 1573 === h || 1575 === h))
          ) {
            (i = this.getCombCharRep(a, h)),
              (s +=
                null != n
                  ? String.fromCharCode(i[4])
                  : String.fromCharCode(i[1])),
              ++r;
            continue;
          }
          if (
            ((e = this.getCharRep(a)), null != n &amp;&amp; null != h &amp;&amp; null != e[3])
          ) {
            s += String.fromCharCode(e[3]);
            continue;
          }
          if (null != n &amp;&amp; null != e[4]) {
            s += String.fromCharCode(e[4]);
            continue;
          }
          if (null != h &amp;&amp; null != e[2]) {
            s += String.fromCharCode(e[2]);
            continue;
          }
          s += String.fromCharCode(e[1]);
        } else s += String.fromCharCode(a);
      }
      return s;
    }
    convertArabicBack(t) {
      var e,
        i,
        s = "";
      for (i = 0; i &lt; t.length; ++i)
        (e = t.charCodeAt(i)), (s += this.getOriginalCharsFromCode(e));
      return s;
    }
  }
  (ys.charsMap = [
    [1569, 65152, null, null, null],
    [1570, 65153, null, null, 65154],
    [1571, 65155, null, null, 65156],
    [1572, 65157, null, null, 65158],
    [1573, 65159, null, null, 65160],
    [1574, 65161, 65163, 65164, 65162],
    [1575, 65165, null, null, 65166],
    [1576, 65167, 65169, 65170, 65168],
    [1577, 65171, null, null, 65172],
    [1578, 65173, 65175, 65176, 65174],
    [1579, 65177, 65179, 65180, 65178],
    [1580, 65181, 65183, 65184, 65182],
    [1581, 65185, 65187, 65188, 65186],
    [1582, 65189, 65191, 65192, 65190],
    [1583, 65193, null, null, 65194],
    [1584, 65195, null, null, 65196],
    [1585, 65197, null, null, 65198],
    [1586, 65199, null, null, 65200],
    [1587, 65201, 65203, 65204, 65202],
    [1588, 65205, 65207, 65208, 65206],
    [1589, 65209, 65211, 65212, 65210],
    [1590, 65213, 65215, 65216, 65214],
    [1591, 65217, 65219, 65220, 65218],
    [1592, 65221, 65223, 65224, 65222],
    [1593, 65225, 65227, 65228, 65226],
    [1594, 65229, 65231, 65232, 65230],
    [1600, 1600, 1600, 1600, 1600],
    [1601, 65233, 65235, 65236, 65234],
    [1602, 65237, 65239, 65240, 65238],
    [1603, 65241, 65243, 65244, 65242],
    [1604, 65245, 65247, 65248, 65246],
    [1605, 65249, 65251, 65252, 65250],
    [1606, 65253, 65255, 65256, 65254],
    [1607, 65257, 65259, 65260, 65258],
    [1608, 65261, null, null, 65262],
    [1609, 65263, null, null, 65264],
    [1610, 65265, 65267, 65268, 65266],
    [1662, 64342, 64344, 64345, 64343],
    [1740, 64508, 64510, 64511, 64509],
    [1670, 64378, 64380, 64381, 64379],
    [1705, 64398, 64400, 64401, 64399],
    [1711, 64402, 64404, 64405, 64403],
    [1688, 64394, null, null, 64395],
  ]),
    (ys.combCharsMap = [
      [[1604, 1570], 65269, null, null, 65270],
      [[1604, 1571], 65271, null, null, 65272],
      [[1604, 1573], 65273, null, null, 65274],
      [[1604, 1575], 65275, null, null, 65276],
    ]),
    (ys.transChars = [
      1552, 1554, 1555, 1556, 1557, 1611, 1612, 1613, 1614, 1615, 1616, 1617,
      1618, 1619, 1620, 1621, 1622, 1623, 1624, 1648, 1750, 1751, 1752, 1753,
      1754, 1755, 1756, 1759, 1760, 1761, 1762, 1763, 1764, 1767, 1768, 1770,
      1771, 1772, 1773,
    ]);
  class Es {
    static ArrayMul(t, e, i) {
      if (t)
        if (e)
          for (var s, r, a, n, h = 0; h &lt; 4; h++)
            (s = t[h]),
              (r = t[h + 4]),
              (a = t[h + 8]),
              (n = t[h + 12]),
              (i[h] = s * e[0] + r * e[1] + a * e[2] + n * e[3]),
              (i[h + 4] = s * e[4] + r * e[5] + a * e[6] + n * e[7]),
              (i[h + 8] = s * e[8] + r * e[9] + a * e[10] + n * e[11]),
              (i[h + 12] = s * e[12] + r * e[13] + a * e[14] + n * e[15]);
        else Es.copyArray(t, i);
      else Es.copyArray(e, i);
    }
    static copyArray(t, e) {
      if (t &amp;&amp; e) for (var i = 0; i &lt; t.length; i++) e[i] = t[i];
    }
  }
  return (
    (t.AlphaCmd = r),
    (t.Animation = zi),
    (t.AnimationBase = ci),
    (t.ArabicReshaper = ys),
    (t.AtlasGrid = qt),
    (t.AtlasInfoManager = ii),
    (t.AudioSound = je),
    (t.AudioSoundChannel = Ke),
    (t.BasePoly = kt),
    (t.BaseShader = U),
    (t.BaseTexture = D),
    (t.Bezier = lt),
    (t.Bitmap = L),
    (t.BitmapFont = Je),
    (t.BlendMode = Y),
    (t.BlurFilter = Ji),
    (t.BlurFilterGLRender = $i),
    (t.BlurFilterSetter = ts),
    (t.BoundsStyle = Ie),
    (t.Browser = re),
    (t.Buffer = Et),
    (t.Buffer2D = Ct),
    (t.BufferState2D = yt),
    (t.BufferStateBase = xt),
    (t.ButtonEffect = class {
      constructor() {
        (this._curState = 0), (this.effectScale = 1.5), (this.tweenTime = 300);
      }
      set target(t) {
        (this._tar = t),
          t.on($t.MOUSE_DOWN, this, this.toChangedState),
          t.on($t.MOUSE_UP, this, this.toInitState),
          t.on($t.MOUSE_OUT, this, this.toInitState);
      }
      toChangedState() {
        (this._curState = 1),
          this._curTween &amp;&amp; li.clear(this._curTween),
          (this._curTween = li.to(
            this._tar,
            { scaleX: this.effectScale, scaleY: this.effectScale },
            this.tweenTime,
            oi[this.effectEase],
            S.create(this, this.tweenComplete),
          ));
      }
      toInitState() {
        2 != this._curState &amp;&amp;
          (this._curTween &amp;&amp; li.clear(this._curTween),
          (this._curState = 2),
          (this._curTween = li.to(
            this._tar,
            { scaleX: 1, scaleY: 1 },
            this.tweenTime,
            oi[this.backEase],
            S.create(this, this.tweenComplete),
          )));
      }
      tweenComplete() {
        (this._curState = 0), (this._curTween = null);
      }
    }),
    (t.Byte = B),
    (t.CONST3D2D = Vt),
    (t.CacheManger = ye),
    (t.CacheStyle = Pe),
    (t.CallLater = ke),
    (t.CharRenderInfo = ie),
    (t.CharRender_Canvas = ae),
    (t.CharRender_Native = ne),
    (t.CharSubmitCache = jt),
    (t.ClassUtils = Me),
    (t.ClipRectCmd = Te),
    (t.ColorFilter = et),
    (t.ColorFilterSetter = es),
    (t.ColorUtils = tt),
    (t.CommandEncoder = class {
      constructor(t, e, i, s) {
        this._idata = [];
      }
      getArrayData() {
        return this._idata;
      }
      getPtrID() {
        return 0;
      }
      beginEncoding() {}
      endEncoding() {}
      clearEncoding() {
        this._idata.length = 0;
      }
      getCount() {
        return this._idata.length;
      }
      add_ShaderValue(t) {
        this._idata.push(t);
      }
      addShaderUniform(t) {
        this.add_ShaderValue(t);
      }
    }),
    (t.CommonScript = class extends ui {
      get isSingleton() {
        return !1;
      }
      constructor() {
        super();
      }
      onAwake() {}
      onEnable() {}
      onStart() {}
      onUpdate() {}
      onLateUpdate() {}
      onDisable() {}
      onDestroy() {}
    }),
    (t.Component = ui),
    (t.Config = e),
    (t.Const = Ce),
    (t.Context = oe),
    (t.Dragging = _i),
    (t.Draw9GridTexture = pe),
    (t.DrawCircleCmd = a),
    (t.DrawCurvesCmd = n),
    (t.DrawImageCmd = h),
    (t.DrawLineCmd = o),
    (t.DrawLinesCmd = l),
    (t.DrawParticleCmd = Zi),
    (t.DrawPathCmd = _),
    (t.DrawPieCmd = u),
    (t.DrawPolyCmd = c),
    (t.DrawRectCmd = d),
    (t.DrawStyle = ut),
    (t.DrawTextureCmd = it),
    (t.DrawTexturesCmd = ve),
    (t.DrawTrianglesCmd = de),
    (t.Earcut = Yt),
    (t.EarcutNode = Wt),
    (t.Ease = oi),
    (t.EffectAnimation = Ki),
    (t.EffectBase = is),
    (t.Event = $t),
    (t.EventDispatcher = w),
    (t.FadeIn = class extends is {
      _doTween() {
        return (
          (this.target.alpha = 0),
          li.to(
            this.target,
            { alpha: 1 },
            this.duration,
            oi[this.ease],
            this._comlete,
            this.delay,
          )
        );
      }
    }),
    (t.FadeOut = class extends is {
      _doTween() {
        return (
          (this.target.alpha = 1),
          li.to(
            this.target,
            { alpha: 0 },
            this.duration,
            oi[this.ease],
            this._comlete,
            this.delay,
          )
        );
      }
    }),
    (t.FillTextCmd = xe),
    (t.FillTextureCmd = st),
    (t.Filter = $),
    (t.FilterSetterBase = Qi),
    (t.FontInfo = te),
    (t.FrameAnimation = pi),
    (t.GlowFilter = rs),
    (t.GlowFilterGLRender = ss),
    (t.GlowFilterSetter = as),
    (t.GrahamScan = _t),
    (t.GraphicAnimation = Xi),
    (t.Graphics = Re),
    (t.GraphicsBounds = me),
    (t.HTMLCanvas = Se),
    (t.HTMLChar = ds),
    (t.HTMLImage = Li),
    (t.HalfFloatUtils = O),
    (t.Handler = S),
    (t.HitArea = we),
    (t.HttpRequest = ti),
    (t.ICharRender = se),
    (t.ILaya = i),
    (t.IStatRender = vi),
    (t.IndexBuffer2D = At),
    (t.InlcudeFile = bi),
    (t.Input = Ne),
    (t.KeyBoardManager = He),
    (t.KeyLocation = ns),
    (t.Keyboard = hs),
    (t.Laya = Di),
    (t.LayaGL = g),
    (t.LayaGLQuickRunner = Ae),
    (t.LayaGLRunner = class {
      static uploadShaderUniforms(t, e, i, s) {
        for (
          var r = i._data, a = e.getArrayData(), n = 0, h = 0, o = a.length;
          h &lt; o;
          h++
        ) {
          var l = a[h];
          if (s || -1 !== l.textureID) {
            var _ = r[l.dataOffset];
            null != _ &amp;&amp; (n += l.fun.call(l.caller, l, _));
          }
        }
        return n;
      }
      static uploadCustomUniform(t, e, i, s) {
        var r = 0,
          a = e[i];
        return a &amp;&amp; null != s &amp;&amp; (r += a.fun.call(a.caller, a, s)), r;
      }
      static uploadShaderUniformsForNative(t, e, i) {
        var s = g.UPLOAD_SHADER_UNIFORM_TYPE_ID;
        i._runtimeCopyValues.length &gt; 0 &amp;&amp;
          (s = g.UPLOAD_SHADER_UNIFORM_TYPE_DATA);
        var r = i._data;
        return g.instance.uploadShaderUniforms(e, r, s);
      }
    }),
    (t.LayaGPU = ue),
    (t.Loader = ei),
    (t.LoaderManager = si),
    (t.LocalStorage = ai),
    (t.Log = ps),
    (t.MathUtil = di),
    (t.MatirxArray = Es),
    (t.Matrix = p),
    (t.Mesh2D = St),
    (t.MeshParticle2D = Pi),
    (t.MeshQuadTexture = wt),
    (t.MeshTexture = Mt),
    (t.MeshVG = It),
    (t.Mouse = Ii),
    (t.MouseManager = Ge),
    (t.Node = De),
    (t.Path = ct),
    (t.PerfData = ms),
    (t.PerfHUD = gs),
    (t.PerformancePlugin = Ve),
    (t.Point = f),
    (t.Pool = s),
    (t.PoolCache = Ts),
    (t.Prefab = $e),
    (t.PrimitiveSV = Ci),
    (t.QuickTestTool = os),
    (t.Rectangle = m),
    (t.Render = ce),
    (t.RenderInfo = Rt),
    (t.RenderSprite = be),
    (t.RenderState2D = G),
    (t.RenderTexture2D = k),
    (t.Resource = P),
    (t.ResourceVersion = _s),
    (t.RestoreCmd = rt),
    (t.RotateCmd = at),
    (t.RunDriver = Ye),
    (t.SaveBase = ft),
    (t.SaveClipRect = mt),
    (t.SaveCmd = fe),
    (t.SaveMark = gt),
    (t.SaveTransform = Tt),
    (t.SaveTranslate = vt),
    (t.ScaleCmd = nt),
    (t.Scene = qi),
    (t.SceneLoader = ji),
    (t.SceneUtils = mi),
    (t.Script = Vi),
    (t.Shader = K),
    (t.Shader2D = Ut),
    (t.Shader2X = j),
    (t.ShaderCompile = wi),
    (t.ShaderDefines2D = X),
    (t.ShaderDefinesBase = V),
    (t.ShaderNode = Si),
    (t.ShaderValue = class {
      constructor() {}
    }),
    (t.SkinMeshBuffer = Gt),
    (t.SkinSV = Ri),
    (t.Socket = us),
    (t.Sound = class extends w {
      load(t) {}
      play(t = 0, e = 0) {
        return null;
      }
      get duration() {
        return 0;
      }
      dispose() {}
    }),
    (t.SoundChannel = ze),
    (t.SoundManager = Qe),
    (t.SoundNode = ls),
    (t.Sprite = Be),
    (t.SpriteConst = ge),
    (t.SpriteStyle = Le),
    (t.Stage = Xe),
    (t.Stat = H),
    (t.StatUI = xi),
    (t.StringKey = z),
    (t.Submit = Xt),
    (t.SubmitBase = pt),
    (t.SubmitCMD = Q),
    (t.SubmitCanvas = Ht),
    (t.SubmitKey = Z),
    (t.SubmitTarget = zt),
    (t.SubmitTexture = Kt),
    (t.System = class {
      static changeDefinition(t, e) {
        window.Laya[t] = e;
        var i = t + "=classObj";
        window.eval(i);
      }
    }),
    (t.SystemUtils = F),
    (t.TTFLoader = hi),
    (t.Text = Oe),
    (t.TextAtlas = Qt),
    (t.TextRender = he),
    (t.TextStyle = Fe),
    (t.TextTexture = Zt),
    (t.Texture = Jt),
    (t.Texture2D = N),
    (t.TextureSV = Ai),
    (t.TimeLine = vs),
    (t.Timer = yi),
    (t.TouchManager = Ue),
    (t.TransformCmd = ht),
    (t.TranslateCmd = ot),
    (t.Tween = li),
    (t.URL = I),
    (t.Utils = J),
    (t.Value2D = q),
    (t.VectorGraphManager = Ee),
    (t.VertexArrayObject = class {
      constructor() {}
    }),
    (t.VertexBuffer2D = bt),
    (t.VideoTexture = cs),
    (t.WeakObject = fi),
    (t.WebAudioSound = Ze),
    (t.WebAudioSoundChannel = qe),
    (t.WebGL = _e),
    (t.WebGLCacheAsNormalCanvas = Pt),
    (t.WebGLContext = b),
    (t.WebGLRTMgr = W),
    (t.WordText = ee),
    (t.WorkerLoader = Mi),
    (t.__init = Ui),
    (t._static = _static),
    (t.alertGlobalError = Wi),
    (t.enableDebugPanel = Yi),
    (t.init = Gi),
    (t.isWXOpenDataContext = void 0),
    (t.isWXPosMsg = void 0),
    (t.version = ki),
    (t.static = _static),
    t
  );
})({});
</pre></body></html>