ui.shipaid.com 0.3.125 → 0.3.126

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.
@@ -2164,7 +2164,6 @@ const DEFAULT_CHECKOUT_SELECTORS = [
2164
2164
  "button[type='submit'][name='checkout']",
2165
2165
  "button[name='checkout']",
2166
2166
  "input[type='submit'][name='checkout']",
2167
- "form[action*='/cart'] button[type='submit']",
2168
2167
  "a[href='/checkout']",
2169
2168
  "a[href*='/checkout']",
2170
2169
  "button#checkout",
@@ -2204,7 +2203,7 @@ class ShipAidWidgetV2 extends s {
2204
2203
  this.env = "prod";
2205
2204
  this.lang = "en";
2206
2205
  this.previewGreenShipAid = false;
2207
- this.dataSelector = "form[action*='/cart'] [name='checkout'], button[name='checkout']";
2206
+ this.dataSelector = "";
2208
2207
  this.isClone = false;
2209
2208
  this._hasFinishedSetup = false;
2210
2209
  this._hasProtectionInCart = false;
@@ -2383,11 +2382,13 @@ class ShipAidWidgetV2 extends s {
2383
2382
  }
2384
2383
  }
2385
2384
  _mountNearCheckoutButton() {
2385
+ var _a, _b;
2386
2386
  if (!this.isConnected) return;
2387
2387
  if (!this._shouldShowWidget()) return;
2388
2388
  this._ensureBaseStyles();
2389
2389
  try {
2390
- const provided = (this.dataSelector || "").trim();
2390
+ const dbSelector = ((_b = (_a = this._store) == null ? void 0 : _a.checkoutPlus) == null ? void 0 : _b.btnSelector) || "";
2391
+ const provided = (dbSelector || this.dataSelector || "").trim();
2391
2392
  const selectors = provided ? provided.split(",").map((s2) => s2.trim()).filter(Boolean) : DEFAULT_CHECKOUT_SELECTORS;
2392
2393
  const matches = Array.from(document.querySelectorAll(selectors.join(", ")));
2393
2394
  if (!matches.length) return;
@@ -2456,8 +2457,10 @@ class ShipAidWidgetV2 extends s {
2456
2457
  }
2457
2458
  }
2458
2459
  this._remountTimer = window.setTimeout(() => {
2460
+ var _a2, _b;
2459
2461
  const hasOriginal = !!(this._originalCheckoutButton && document.contains(this._originalCheckoutButton));
2460
- const provided = (this.dataSelector || "").trim();
2462
+ const dbSelector = ((_b = (_a2 = this._store) == null ? void 0 : _a2.checkoutPlus) == null ? void 0 : _b.btnSelector) || "";
2463
+ const provided = (dbSelector || this.dataSelector || "").trim();
2461
2464
  const selectors = provided ? provided.split(",").map((s2) => s2.trim()).filter(Boolean) : DEFAULT_CHECKOUT_SELECTORS;
2462
2465
  const nodeList = document.querySelectorAll(selectors.join(", "));
2463
2466
  let firstEl = null;