@16x/webphone-sdk 3.0.1 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +39 -22
  2. package/LICENSE +1 -2
  3. package/README.md +113 -113
  4. package/dist/{CCBarClient-BdbynNBi.js → CCBarClient-CcPfEToZ.js} +431 -179
  5. package/dist/CCBarClient-DCQ8XjcL.cjs +1 -0
  6. package/dist/{Diagnostics-BYVvmxil.cjs → Diagnostics-D38Hm3NT.cjs} +1 -1
  7. package/dist/{Diagnostics-Cw2HVrCD.js → Diagnostics-Di049OpT.js} +9 -9
  8. package/dist/JsSipAdapter-BBRrDaM4.cjs +1 -0
  9. package/dist/{JsSipAdapter-GHzVSCDh.js → JsSipAdapter-Bke1Qjfe.js} +37 -25
  10. package/dist/SharedWorkerProtocol-39dch6xL.cjs +1 -0
  11. package/dist/{SharedWorkerProtocol-BqUafs8d.js → SharedWorkerProtocol-DKVQ5-po.js} +31 -17
  12. package/dist/core/CCBarClient.d.ts +36 -4
  13. package/dist/core/CallManager.d.ts +2 -0
  14. package/dist/{createJsSipFactory-yttVU3d6.js → createJsSipFactory-9CPsweDR.js} +4 -1
  15. package/dist/{createJsSipFactory-2X4FBIU2.cjs → createJsSipFactory-Dr8HbLl-.cjs} +1 -1
  16. package/dist/diagnostics/Diagnostics.d.ts +1 -0
  17. package/dist/diagnostics/index.cjs +1 -1
  18. package/dist/diagnostics/index.d.ts +1 -1
  19. package/dist/diagnostics/index.js +3 -6
  20. package/dist/errors/CCBarError.d.ts +6 -0
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.js +9 -139
  23. package/dist/index.umd.js +17 -17
  24. package/dist/legacy/index.cjs +1 -1
  25. package/dist/legacy/index.js +2 -2
  26. package/dist/shared/SharedWorkerProtocol.d.ts +2 -0
  27. package/dist/shared-worker.cjs +1 -1
  28. package/dist/shared-worker.js +13 -6
  29. package/dist/styles.css +7 -7
  30. package/dist/types.d.ts +5 -0
  31. package/dist/ui/XCallCCBarElement.d.ts +2 -0
  32. package/dist/ui/index.cjs +1 -1
  33. package/dist/ui/index.js +138 -130
  34. package/dist/version.d.ts +1 -0
  35. package/package.json +111 -107
  36. package/dist/CCBarClient-DKWdvgf5.cjs +0 -1
  37. package/dist/CCBarError-CIqJE8zK.cjs +0 -1
  38. package/dist/CCBarError-DSbPw2dA.js +0 -14
  39. package/dist/JsSipAdapter-jtGdoXrm.cjs +0 -1
  40. package/dist/SharedWorkerProtocol-CYN0AprP.cjs +0 -1
package/dist/ui/index.js CHANGED
@@ -654,74 +654,82 @@ var B = ":root,:host{--ccbar-color-surface:#fff;--ccbar-color-surface-muted:#f1f
654
654
  ];
655
655
  }
656
656
  #e;
657
- #t = [];
658
- #n = "idle";
659
- #r = "unknown";
660
- #i;
661
- #a = /* @__PURE__ */ new Set();
662
- #o = "";
657
+ #t = !1;
658
+ #n = [];
659
+ #r = "idle";
660
+ #i = "unknown";
661
+ #a;
662
+ #o = /* @__PURE__ */ new Set();
663
663
  #s = "";
664
- #c = "offline";
665
- #l = !1;
664
+ #c = "";
665
+ #l = "offline";
666
666
  #u = !1;
667
- #d = Promise.resolve();
668
- #f;
669
- #p = !1;
667
+ #d = !1;
668
+ #f = Promise.resolve();
669
+ #p;
670
670
  #m = !1;
671
- #h;
671
+ #h = !1;
672
672
  #g;
673
673
  #_;
674
674
  #v;
675
675
  #y;
676
+ #b;
676
677
  get messageResolver() {
677
- return this.#v;
678
+ return this.#y;
678
679
  }
679
680
  set messageResolver(e) {
680
- this.#v = e, this.shadowRoot !== null && this.render();
681
+ this.#y = e, this.shadowRoot !== null && this.render();
681
682
  }
682
683
  get client() {
683
684
  return this.#e;
684
685
  }
685
686
  set client(e) {
686
- this.#D(), this.#e = e, this.#E(), this.render();
687
+ this.#O(), this.#e = e, this.#D(), this.render();
688
+ }
689
+ get ownsClient() {
690
+ return this.#t;
691
+ }
692
+ set ownsClient(e) {
693
+ this.#t = e === !0;
687
694
  }
688
695
  connectedCallback() {
689
- this.#B(), this.#z(), this.render();
696
+ this.#V(), this.#B(), this.render();
690
697
  }
691
698
  disconnectedCallback() {
692
- this.#D(), this.#W(), this.#y?.(), this.#y = void 0;
699
+ let e = this.#e, t = this.#t;
700
+ this.#O(), this.#G(), this.#b?.(), this.#b = void 0, t && (this.#e = void 0, e?.dispose());
693
701
  }
694
702
  attributeChangedCallback(e) {
695
- this.#B(), e === "theme" && this.#z(), this.shadowRoot !== null && this.render();
703
+ this.#V(), e === "theme" && this.#B(), this.shadowRoot !== null && this.render();
696
704
  }
697
705
  render() {
698
- let e = this.#O();
699
- e !== void 0 && (e.innerHTML = `<style>${B}</style>`, e.append(this.#x(this.#b())));
706
+ let e = this.#k();
707
+ e !== void 0 && (e.innerHTML = `<style>${B}</style>`, e.append(this.#S(this.#x())));
700
708
  }
701
- #b() {
709
+ #x() {
702
710
  let e = this.#e?.getCalls?.().map((e) => ({
703
711
  id: e.id,
704
712
  state: e.state,
705
713
  destination: e.destination,
706
- direction: this.#a.has(e.id) ? "inbound" : "outbound"
714
+ direction: this.#o.has(e.id) ? "inbound" : "outbound"
707
715
  })) ?? [];
708
716
  return z({
709
- connectionState: this.#n,
710
- permission: this.#r,
717
+ connectionState: this.#r,
718
+ permission: this.#i,
711
719
  calls: e,
712
- error: this.#i
720
+ error: this.#a
713
721
  });
714
722
  }
715
- #x(e) {
716
- let t = this.#R(), n = this.#g ?? this.#h ?? K(e, t), r = {
723
+ #S(e) {
724
+ let t = this.#z(), n = this.#_ ?? this.#g ?? K(e, t), r = {
717
725
  ...t,
718
726
  status: n
719
- }, i = this.#S(e, r, n);
720
- return i.setAttribute("data-view", this.#T() && !this.#p ? "setup" : e.kind), i.hasAttribute("data-layout") || i.setAttribute("data-layout", this.#T() ? "mobile" : "panel"), i;
727
+ }, i = this.#C(e, r, n);
728
+ return i.setAttribute("data-view", this.#E() && !this.#m ? "setup" : e.kind), i.hasAttribute("data-layout") || i.setAttribute("data-layout", this.#E() ? "mobile" : "panel"), i;
721
729
  }
722
- #S(e, t, n) {
723
- if (this.#T() && !this.#p) return N({
724
- enabling: this.#m,
730
+ #C(e, t, n) {
731
+ if (this.#E() && !this.#m) return N({
732
+ enabling: this.#h,
725
733
  status: n,
726
734
  enablePhone: t.enablePhone
727
735
  });
@@ -732,12 +740,12 @@ var B = ":root,:host{--ccbar-color-surface:#fff;--ccbar-color-surface-muted:#f1f
732
740
  view: e,
733
741
  messages: t
734
742
  });
735
- case "incoming": return this.#T() ? P({
743
+ case "incoming": return this.#E() ? P({
736
744
  view: { kind: "ready" },
737
745
  messages: t,
738
- destination: this.#o,
739
- muted: this.#l,
740
- canDial: s(this.#o, this.#r, this.#n),
746
+ destination: this.#s,
747
+ muted: this.#u,
748
+ canDial: s(this.#s, this.#i, this.#r),
741
749
  showOutputDevice: this.#e?.media.supportsOutputSelection() === !0
742
750
  }) : j({
743
751
  view: e,
@@ -749,121 +757,121 @@ var B = ":root,:host{--ccbar-color-surface:#fff;--ccbar-color-surface-muted:#f1f
749
757
  case "ready":
750
758
  case "active":
751
759
  case "held":
752
- case "dialing": return this.#T() ? P({
760
+ case "dialing": return this.#E() ? P({
753
761
  view: e.kind === "held" ? { kind: "ready" } : e,
754
762
  messages: t,
755
- destination: this.#o,
756
- muted: this.#l,
757
- canDial: s(this.#o, this.#r, this.#n),
763
+ destination: this.#s,
764
+ muted: this.#u,
765
+ canDial: s(this.#s, this.#i, this.#r),
758
766
  showOutputDevice: this.#e?.media.supportsOutputSelection() === !0
759
767
  }) : _({
760
- mode: this.#w() === "compact" ? "compact" : "panel",
768
+ mode: this.#T() === "compact" ? "compact" : "panel",
761
769
  view: e,
762
770
  messages: t,
763
- destination: this.#o,
764
- muted: this.#l,
765
- canDial: s(this.#o, this.#r, this.#n),
766
- moreOpen: this.#u,
771
+ destination: this.#s,
772
+ muted: this.#u,
773
+ canDial: s(this.#s, this.#i, this.#r),
774
+ moreOpen: this.#d,
767
775
  floating: this.hasAttribute("floating"),
768
- connected: this.#n === "connected",
769
- agentStatus: this.#c,
770
- extension: this.#s,
771
- calls: this.#C()
776
+ connected: this.#r === "connected",
777
+ agentStatus: this.#l,
778
+ extension: this.#c,
779
+ calls: this.#w()
772
780
  });
773
781
  default: return e;
774
782
  }
775
783
  }
776
- #C() {
784
+ #w() {
777
785
  let e = this.#e?.getActiveCall?.()?.id;
778
786
  return this.#e?.getCalls?.().map((t) => ({
779
787
  id: t.id,
780
788
  destination: t.destination,
781
789
  state: t.state,
782
- direction: this.#a.has(t.id) ? "inbound" : "outbound",
790
+ direction: this.#o.has(t.id) ? "inbound" : "outbound",
783
791
  current: t.id === e
784
792
  })) ?? [];
785
793
  }
786
- #w() {
794
+ #T() {
787
795
  let e = this.getAttribute("mode");
788
796
  return e === "compact" || e === "mobile" ? e : "panel";
789
797
  }
790
- #T() {
791
- return this.#w() === "mobile";
792
- }
793
798
  #E() {
799
+ return this.#T() === "mobile";
800
+ }
801
+ #D() {
794
802
  let e = this.#e;
795
- e !== void 0 && (this.#t.push(e.on("connection.stateChanged", (t) => {
796
- if (this.#n = t.state, t.state !== "connected" && (this.#c = "offline"), t.state === "connected") {
803
+ e !== void 0 && (this.#n.push(e.on("connection.stateChanged", (t) => {
804
+ if (this.#r = t.state, t.state !== "connected" && (this.#l = "offline"), t.state === "connected") {
797
805
  let t = e.getAgent?.()?.extension?.trim();
798
- t !== void 0 && t !== "" && (this.#s = t);
806
+ t !== void 0 && t !== "" && (this.#c = t);
799
807
  }
800
- })), this.#t.push(e.on("agent.statusChanged", (e) => {
801
- (e.status === "available" || e.status === "offline" || e.status === "break") && (this.#c = e.status);
802
- })), this.#t.push(e.on("connection.failed", (e) => {
803
- this.#n = "failed", this.#i = { code: e.error.code };
804
- })), this.#t.push(e.on("media.permissionChanged", (e) => {
805
- this.#r = e.permission;
806
- })), this.#t.push(e.on("error", (e) => {
807
- this.#i = { code: e.error.code };
808
- })), this.#t.push(e.on("call.incoming", (e) => {
809
- this.#a.add(e.callId);
810
- })), this.#t.push(e.on("call.ended", (e) => {
811
- this.#a.delete(e.callId), this.#l = !1;
812
- })), this.#t.push(e.on("call.failed", () => {
813
- this.#g = this.#R().statusFailed;
808
+ })), this.#n.push(e.on("agent.statusChanged", (e) => {
809
+ (e.status === "available" || e.status === "offline" || e.status === "break") && (this.#l = e.status);
810
+ })), this.#n.push(e.on("connection.failed", (e) => {
811
+ this.#r = "failed", this.#a = { code: e.error.code };
812
+ })), this.#n.push(e.on("media.permissionChanged", (e) => {
813
+ this.#i = e.permission;
814
+ })), this.#n.push(e.on("error", (e) => {
815
+ this.#a = { code: e.error.code };
816
+ })), this.#n.push(e.on("call.incoming", (e) => {
817
+ this.#o.add(e.callId);
818
+ })), this.#n.push(e.on("call.ended", (e) => {
819
+ this.#o.delete(e.callId), this.#u = !1;
820
+ })), this.#n.push(e.on("call.failed", () => {
821
+ this.#_ = this.#z().statusFailed;
814
822
  })), U.forEach((t) => {
815
- this.#t.push(e.on(t, () => this.render()));
816
- }), this.#T() && typeof e.recover == "function" && (this.#_ = a(e, {
823
+ this.#n.push(e.on(t, () => this.render()));
824
+ }), this.#E() && typeof e.recover == "function" && (this.#v = a(e, {
817
825
  onChecking: () => {
818
- this.#h = this.#R().foregroundChecking, this.render();
826
+ this.#g = this.#z().foregroundChecking, this.render();
819
827
  },
820
828
  onRecovered: () => {
821
- this.#h = void 0, this.render();
829
+ this.#g = void 0, this.render();
822
830
  },
823
831
  onFailed: () => {
824
- this.#h = this.#R().foregroundFailed, this.render();
832
+ this.#g = this.#z().foregroundFailed, this.render();
825
833
  }
826
834
  })));
827
835
  }
828
- #D() {
829
- let e = this.#t;
830
- this.#t = [], e.forEach((e) => e()), this.#n = "idle", this.#r = "unknown", this.#c = "offline", this.#i = void 0, this.#a.clear(), this.#l = !1, this.#u = !1, this.#p = !1, this.#m = !1, this.#h = void 0, this.#_?.(), this.#_ = void 0;
831
- }
832
836
  #O() {
837
+ let e = this.#n;
838
+ this.#n = [], e.forEach((e) => e()), this.#r = "idle", this.#i = "unknown", this.#l = "offline", this.#a = void 0, this.#o.clear(), this.#u = !1, this.#d = !1, this.#m = !1, this.#h = !1, this.#g = void 0, this.#v?.(), this.#v = void 0;
839
+ }
840
+ #k() {
833
841
  if (typeof this.attachShadow != "function") return;
834
842
  let e = this.shadowRoot ?? this.attachShadow({ mode: "open" });
835
- return H.has(e) || (H.add(e), e.addEventListener("click", (e) => this.#k(e)), e.addEventListener("input", (e) => this.#N(e)), e.addEventListener("pointerdown", (e) => this.#V(e))), e;
843
+ return H.has(e) || (H.add(e), e.addEventListener("click", (e) => this.#A(e)), e.addEventListener("input", (e) => this.#P(e)), e.addEventListener("pointerdown", (e) => this.#H(e))), e;
836
844
  }
837
- #k(e) {
845
+ #A(e) {
838
846
  let t = J(e, this), n = t?.closest("[data-action=\"enable-phone\"]");
839
- n instanceof HTMLButtonElement && (n.disabled = !0), this.#d = this.#d.then(() => this.#P(t)).catch((e) => {
840
- this.#g = Y(e), this.render();
847
+ n instanceof HTMLButtonElement && (n.disabled = !0), this.#f = this.#f.then(() => this.#F(t)).catch((e) => {
848
+ this.#_ = Y(e), this.render();
841
849
  });
842
850
  }
843
- #A() {
851
+ #j() {
844
852
  let e = this.shadowRoot?.querySelector("input[name=\"destination\"]");
845
- return e instanceof HTMLInputElement ? e.value : this.#o;
853
+ return e instanceof HTMLInputElement ? e.value : this.#s;
846
854
  }
847
- #j() {
855
+ #M() {
848
856
  let e = this.shadowRoot?.querySelector("input[name=\"extension\"]");
849
- return e instanceof HTMLInputElement ? e.value.trim() : this.#s;
857
+ return e instanceof HTMLInputElement ? e.value.trim() : this.#c;
850
858
  }
851
- #M() {
859
+ #N() {
852
860
  let e = this.shadowRoot?.querySelector("input[name=\"transfer-target\"]");
853
861
  return e instanceof HTMLInputElement ? e.value : "";
854
862
  }
855
- #N(e) {
863
+ #P(e) {
856
864
  let t = J(e, this);
857
865
  if (t instanceof HTMLInputElement && t.name !== "transfer-target") {
858
866
  if (t.name === "extension") {
859
- this.#s = t.value.trim();
867
+ this.#c = t.value.trim();
860
868
  return;
861
869
  }
862
- this.#o = t.value, this.#I();
870
+ this.#s = t.value, this.#L();
863
871
  }
864
872
  }
865
- async #P(e) {
866
- if (this.#g = void 0, e === void 0) return;
873
+ async #F(e) {
874
+ if (this.#_ = void 0, e === void 0) return;
867
875
  let t = e.closest("[data-call-id]");
868
876
  if (t instanceof HTMLElement && t.dataset.callId !== void 0) {
869
877
  await this.#e?.setActiveCall(t.dataset.callId);
@@ -871,7 +879,7 @@ var B = ":root,:host{--ccbar-color-surface:#fff;--ccbar-color-surface-muted:#f1f
871
879
  }
872
880
  let n = e.closest("[data-digit]");
873
881
  if (n instanceof HTMLElement && n.dataset.digit !== void 0) {
874
- await this.#F(n.dataset.digit);
882
+ await this.#I(n.dataset.digit);
875
883
  return;
876
884
  }
877
885
  let r = e.closest("[data-action]");
@@ -880,20 +888,20 @@ var B = ":root,:host{--ccbar-color-surface:#fff;--ccbar-color-surface-muted:#f1f
880
888
  switch (r.getAttribute("data-action")) {
881
889
  case "signin":
882
890
  if (this.#e === void 0) return;
883
- this.#s = this.#j(), await this.#e.media?.requestPermission?.(), await this.#e.initialize(), await this.#e.connect(this.#s === "" ? void 0 : { extension: this.#s });
891
+ this.#c = this.#M(), await this.#e.media?.requestPermission?.(), await this.#e.initialize(), await this.#e.connect(this.#c === "" ? void 0 : { extension: this.#c });
884
892
  return;
885
893
  case "signout":
886
894
  if (this.#e === void 0) return;
887
- this.#c = "offline", await this.#e.disconnect();
895
+ this.#l = "offline", await this.#e.disconnect();
888
896
  return;
889
897
  case "dial":
890
898
  case "dial-internal":
891
- if (this.#o = this.#A(), this.#e === void 0) return;
892
- this.#r !== "granted" && await this.#e.media?.requestPermission?.(), await c(this.#e, this.#o, r.getAttribute("data-action") === "dial-internal" ? "extension" : void 0);
899
+ if (this.#s = this.#j(), this.#e === void 0) return;
900
+ this.#i !== "granted" && await this.#e.media?.requestPermission?.(), await c(this.#e, this.#s, r.getAttribute("data-action") === "dial-internal" ? "extension" : void 0);
893
901
  return;
894
902
  case "mute":
895
903
  if (a === void 0) return;
896
- this.#l = await l(a, this.#l), this.#L();
904
+ this.#u = await l(a, this.#u), this.#R();
897
905
  return;
898
906
  case "hold":
899
907
  a !== void 0 && await u(a);
@@ -902,7 +910,7 @@ var B = ":root,:host{--ccbar-color-surface:#fff;--ccbar-color-surface-muted:#f1f
902
910
  a !== void 0 && await a.resume();
903
911
  return;
904
912
  case "transfer":
905
- a !== void 0 && await f(a, this.#M());
913
+ a !== void 0 && await f(a, this.#N());
906
914
  return;
907
915
  case "hangup":
908
916
  await a?.hangup();
@@ -914,16 +922,16 @@ var B = ":root,:host{--ccbar-color-surface:#fff;--ccbar-color-surface-muted:#f1f
914
922
  await a?.reject();
915
923
  return;
916
924
  case "enable-phone":
917
- if (this.#e === void 0 || this.#p) return;
918
- this.#m = !0;
925
+ if (this.#e === void 0 || this.#m) return;
926
+ this.#h = !0;
919
927
  try {
920
- await i(this.#e), this.#p = !0;
928
+ await i(this.#e), this.#m = !0;
921
929
  } finally {
922
- this.#m = !1, this.render();
930
+ this.#h = !1, this.render();
923
931
  }
924
932
  return;
925
933
  case "more":
926
- this.#u = !this.#u, this.render();
934
+ this.#d = !this.#d, this.render();
927
935
  return;
928
936
  case "retry-permission":
929
937
  await this.#e?.media.requestPermission();
@@ -939,32 +947,32 @@ var B = ":root,:host{--ccbar-color-surface:#fff;--ccbar-color-surface-muted:#f1f
939
947
  default: return;
940
948
  }
941
949
  }
942
- async #F(e) {
950
+ async #I(e) {
943
951
  let t = this.#e?.getActiveCall?.();
944
952
  if (t !== void 0 && (t.state === "active" || t.state === "held")) {
945
953
  await d(t, e);
946
954
  return;
947
955
  }
948
- this.#o += e;
956
+ this.#s += e;
949
957
  let n = this.shadowRoot?.querySelector("input[name=\"destination\"]");
950
- n instanceof HTMLInputElement && (n.value = this.#o), this.#I();
958
+ n instanceof HTMLInputElement && (n.value = this.#s), this.#L();
951
959
  }
952
- #I() {
953
- let e = !s(this.#o, this.#r, this.#n);
960
+ #L() {
961
+ let e = !s(this.#s, this.#i, this.#r);
954
962
  for (let t of ["dial", "dial-internal"]) {
955
963
  let n = this.shadowRoot?.querySelector(`[data-action="${t}"]`);
956
964
  n instanceof HTMLButtonElement && (n.disabled = e);
957
965
  }
958
966
  }
959
- #L() {
960
- let e = this.shadowRoot?.querySelector("[data-action=\"mute\"]");
961
- e instanceof HTMLButtonElement && (e.setAttribute("aria-pressed", this.#l ? "true" : "false"), e.textContent = this.#l ? this.#R().unmute : this.#R().mute);
962
- }
963
967
  #R() {
964
- return r(this.getAttribute("locale") ?? "zh-CN", void 0, this.#v);
968
+ let e = this.shadowRoot?.querySelector("[data-action=\"mute\"]");
969
+ e instanceof HTMLButtonElement && (e.setAttribute("aria-pressed", this.#u ? "true" : "false"), e.textContent = this.#u ? this.#z().unmute : this.#z().mute);
965
970
  }
966
971
  #z() {
967
- this.#y?.(), this.#y = void 0;
972
+ return r(this.getAttribute("locale") ?? "zh-CN", void 0, this.#y);
973
+ }
974
+ #B() {
975
+ this.#b?.(), this.#b = void 0;
968
976
  let e = this.getAttribute("theme") ?? "light";
969
977
  if (e === "dark" || e === "light") {
970
978
  this.setAttribute("data-theme", e);
@@ -977,31 +985,31 @@ var B = ":root,:host{--ccbar-color-surface:#fff;--ccbar-color-surface-muted:#f1f
977
985
  let t = window.matchMedia("(prefers-color-scheme: dark)"), n = () => {
978
986
  this.setAttribute("data-theme", t.matches ? "dark" : "light");
979
987
  };
980
- n(), t.addEventListener("change", n), this.#y = () => t.removeEventListener("change", n);
988
+ n(), t.addEventListener("change", n), this.#b = () => t.removeEventListener("change", n);
981
989
  }
982
- #B() {
990
+ #V() {
983
991
  this.style.position = this.hasAttribute("floating") ? "fixed" : "";
984
992
  }
985
- #V(e) {
993
+ #H(e) {
986
994
  if (!(e instanceof PointerEvent) || !this.hasAttribute("floating") || !this.hasAttribute("draggable") || (e.target instanceof Element ? e.target.closest("[data-drag-handle]") : null) === null) return;
987
995
  e.preventDefault();
988
996
  let t = this.getBoundingClientRect();
989
- this.#f = {
997
+ this.#p = {
990
998
  pointerId: e.pointerId,
991
999
  offsetX: e.clientX - t.left,
992
1000
  offsetY: e.clientY - t.top
993
- }, window.addEventListener("pointermove", this.#H), window.addEventListener("pointerup", this.#U);
1001
+ }, window.addEventListener("pointermove", this.#U), window.addEventListener("pointerup", this.#W);
994
1002
  }
995
- #H = (e) => {
996
- if (this.#f === void 0 || e.pointerId !== this.#f.pointerId) return;
997
- let t = window.visualViewport, n = t?.width ?? window.innerWidth, r = t?.height ?? window.innerHeight, i = q(e.clientX - this.#f.offsetX, 0, Math.max(0, n - this.offsetWidth)), a = q(e.clientY - this.#f.offsetY, 0, Math.max(0, r - this.offsetHeight));
1003
+ #U = (e) => {
1004
+ if (this.#p === void 0 || e.pointerId !== this.#p.pointerId) return;
1005
+ let t = window.visualViewport, n = t?.width ?? window.innerWidth, r = t?.height ?? window.innerHeight, i = q(e.clientX - this.#p.offsetX, 0, Math.max(0, n - this.offsetWidth)), a = q(e.clientY - this.#p.offsetY, 0, Math.max(0, r - this.offsetHeight));
998
1006
  this.style.left = `${i}px`, this.style.top = `${a}px`, this.style.right = "auto", this.style.bottom = "auto";
999
1007
  };
1000
- #U = (e) => {
1001
- this.#f !== void 0 && e.pointerId === this.#f.pointerId && this.#W();
1008
+ #W = (e) => {
1009
+ this.#p !== void 0 && e.pointerId === this.#p.pointerId && this.#G();
1002
1010
  };
1003
- #W() {
1004
- this.#f = void 0, window.removeEventListener("pointermove", this.#H), window.removeEventListener("pointerup", this.#U);
1011
+ #G() {
1012
+ this.#p = void 0, window.removeEventListener("pointermove", this.#U), window.removeEventListener("pointerup", this.#W);
1005
1013
  }
1006
1014
  };
1007
1015
  function G(e = {}) {
@@ -0,0 +1 @@
1
+ export declare const SDK_VERSION = "3.1.0";