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