var e = require("../../common/vendor.js"),
  n = require("../../hooks/onMounted.js"),
  t = require("../../hooks/onShareAppMessage.js"),
  i = require("../../hooks/useState.js"),
  o = require("../../constant/index.js"),
  u = require("../../data/index.js"),
  a = require("../../utils/navigate.js"),
  r = require("../../utils/util.js"),
  l = require("../../utils/common.js"),
  s = require("../../utils/vin.js");
require("../../service/index.js"),
  require("../../utils/request.js"),
  require("../../config/index.js"),
  require("../../enums/index.js"),
  require("../../store/app/index.js"),
  Math ||
    (
      e.unref(h) +
      e.unref(c) +
      e.unref(d) +
      e.unref(p) +
      e.unref(g) +
      e.unref(f) +
      e.unref(v)
    )();
var v = function () {
    return "../../components/popup-copy-vin/index.js";
  },
  c = function () {
    return "../../components/agreement/index.js";
  },
  f = function () {
    return "../../components/keyboard/index.js";
  },
  d = function () {
    return "../../components/divider/index.js";
  },
  h = function () {
    return "../../components/tips/index.js";
  },
  p = function () {
    return "../../components/float-back-to-top/index.js";
  },
  g = function () {
    return "../../components/float-share/index.js";
  },
  m = {
    __name: "index",
    setup: function (v) {
      var c = i.useState().showAgreementPopup,
        f = e.ref(!0),
        d = e.ref(""),
        h = e.ref(!1),
        p = e.ref(""),
        g = e.ref(!1),
        m = e.ref(!1),
        x = e.ref(""),
        j = e.ref(!1),
        q = function () {
          var e = c.value || m.value;
          return "height: 100%; overflow: "
            .concat(e ? "hidden" : "visible", "; position: ")
            .concat(e ? "fixed" : "relative");
        },
        w = function () {
          a.navigateTo({ url: "/pages/vin-info/index" });
        },
        k = function () {
          p.value = "";
        },
        b = function () {
          l.ocrIdentifyVin().then(function (e) {
            p.value = e;
          });
        },
        S = function () {
          g.value = !0;
        },
        T = function () {
          g.value = !1;
        },
        y = function (e) {
          p.value = e.value;
        },
        _ = function () {
          h.value = !h.value;
        },
        I = function () {
          m.value = !1;
        },
        M = function () {
          (p.value = x.value), (m.value = !1), V();
        },
        V = function () {
          if (((g.value = !1), h.value))
            if (0 !== p.value.length)
              if (p.value.length < 17) r.showToast("请输入完整的VIN车架号");
              else if (s.validateVIN(p.value)) {
                var n = !1,
                  t = e.index.getStorageSync("loadRewardedVideoAdCount"),
                  i = new Date().getFullYear(),
                  o = new Date().getMonth() + 1,
                  u = new Date().getDate();
                if (t) {
                  var l = JSON.parse(t),
                    v = l.date,
                    c = l.count;
                  (v !== "".concat(i, "-").concat(o, "-").concat(u) || c < 2) &&
                    (n = !0);
                } else n = !0;
                a.navigateTo({
                  url: "/pages/vehicle-info-detail/index",
                  params: { vin: p.value, showMask: n },
                });
              } else r.showToast("车架号有误，请检查后重新输入");
            else r.showToast("请输入VIN车架号");
          else r.showToast("请先阅读并同意协议");
        };
      return (
        n.onMounted(function (n) {
          e.index.setNavigationBarTitle({ title: n.title }),
            l.hasClickAgreement() &&
              e.index.getClipboardData().then(function (n) {
                var t = n.data;
                e.index.hideToast(),
                  17 === t.trim().length &&
                    setTimeout(function () {
                      (x.value = t.trim()), (m.value = !0);
                    }, 300);
              }),
            (d.value = n.title),
            (f.value = !1),
            r.hideLoading();
        }),
        e.onPageScroll(function (n) {
          var t = n.scrollTop;
          j.value = t >= e.index.getSystemInfoSync().windowHeight / 3;
        }),
        t.onShareAppMessage(),
        function (n, t) {
          return e.e(
            { a: q(), b: !f.value },
            f.value
              ? {}
              : e.e(
                  { c: e.t(d.value), d: e.o(w), e: 0 === p.value.length },
                  (p.value.length, {}),
                  { f: e.t(p.value), g: e.o(S), h: p.value.length > 0 },
                  p.value.length > 0 ? { i: e.o(k) } : {},
                  {
                    j: e.t(p.value.length),
                    k: e.o(b),
                    l: p.value.length > 0 ? 1 : "",
                    m: e.o(V),
                    n: e.o(_),
                    o: e.p({ checked: h.value }),
                    p: e.f(e.unref(u.mockVehicleInfoList), function (n, t, i) {
                      return { a: e.t(n.label), b: e.t(n.value), c: t };
                    }),
                    q: e.t(e.unref(o.disclaimer)),
                    r: e.p({ visible: j.value }),
                    s: e.o(T),
                    t: e.o(y),
                    v: e.p({
                      visible: g.value,
                      "can-switch": !1,
                      vin: p.value,
                    }),
                    w: e.o(M),
                    x: e.o(I),
                    y: e.p({ visible: m.value, "copy-vin": x.value }),
                  }
                )
          );
        }
      );
    },
  },
  x = e._export_sfc(m, [["__scopeId", "data-v-972a1a01"]]);
(m.__runtimeHooks = 3), wx.createPage(x);
