import { defineComponent as R, useCssVars as nt, ref as l, watch as ut, onMounted as ct, resolveComponent as V, resolveDirective as dt, createElementBlock as r, openBlock as a, createElementVNode as o, createVNode as m, createTextVNode as w, unref as vt, withCtx as D, Fragment as T, renderList as I, createCommentVNode as h, withDirectives as bt, normalizeStyle as gt, normalizeClass as ft, toDisplayString as O } from "vue";
import { ElMessage as L } from "element-plus";
import B from "moment";
import "../../text-text-basic/index.mjs";
import "../../text-table-basic/index.mjs";
import "../../chart-other-gauge/index.mjs";
import "../../chart-other-gauge-stage/index.mjs";
import "../../chart-other-gauge-grade/index.mjs";
import "../../chart-other-word-cloud/index.mjs";
import "../../chart-other-liquidfill/index.mjs";
import "../../chart-other-funnel/index.mjs";
import "../../chart-other-force/index.mjs";
import "../../chart-other-radar/index.mjs";
import "../../chart-other-funnel-split/index.mjs";
import "../../chart-other-funnel-contrast/index.mjs";
import "../../chart-other-candlestick-basic/index.mjs";
import "../../chart-other-candlestick-shanghai/index.mjs";
import "../../chart-other-candlestick-demo/index.mjs";
import "../../chart-other-heatmap/index.mjs";
import "../../chart-other-force2/index.mjs";
import "../../chart-other-graph-basic/index.mjs";
import "../../chart-other-graph-basic2/index.mjs";
import "../../chart-other-graph-calendar/index.mjs";
import "../../chart-other-tree-line/index.mjs";
import "../../chart-other-treemap-basic/index.mjs";
import "../../chart-other-sunburst-basic/index.mjs";
import "../../chart-other-sunburst-basic2/index.mjs";
import "../../chart-other-sunburst-basic3/index.mjs";
import "../../chart-other-sunburst-basic4/index.mjs";
import "../../chart-other-sunburst-book/index.mjs";
import "../../chart-other-sunburst-radius/index.mjs";
import "../../chart-other-sunburst-flavors/index.mjs";
import "../../chart-other-parallel-basic/index.mjs";
import "../../chart-other-parallel-mul/index.mjs";
import "../../chart-other-circular-graph/index.mjs";
import "../../map-earth-basic/index.mjs";
import "../../map-earth-cool-tech/index.mjs";
import "../../map-earth-particle/index.mjs";
import "../../map-earth-hacker/index.mjs";
import "../../map-earth-fly-line/index.mjs";
import "../../chart-other-grid-percentage/index.mjs";
import "../../chart-other-radar-stack/index.mjs";
import "../../chart-other-funnel2/index.mjs";
import "../../chart-other-label-gauge/index.mjs";
import "../../chart-other-theme-river/index.mjs";
import "../../chart-other-tree/index.mjs";
import "../../chart-other-treemap/index.mjs";
import "../../commons-product-model/index.mjs";
import "../../commons-vr-photo/index.mjs";
import "../../commons-vr-video/index.mjs";
import "../../commons-three-loader/index.mjs";
import "../../commons-three-loader3/index.mjs";
import "../../commons-loop-iterator/index.mjs";
import "../../commons-gaussian-splatting-view/index.mjs";
import "../../commons-babylon/index.mjs";
import "../../commons-svg/index.mjs";
import "../../commons-weather/index.mjs";
import "../../commons-weather-dynamic/index.mjs";
import "../../media-wavesurfer/index.mjs";
import "../../interaction-tabs/index.mjs";
import "../../interaction-tabs2/index.mjs";
import "../../interaction-button/index.mjs";
import "../../interaction-button-image/index.mjs";
import "../../interaction-select/index.mjs";
import "../../interaction-input/index.mjs";
import "../../interaction-radio/index.mjs";
import "../../interaction-slider/index.mjs";
import "../../interaction-switch/index.mjs";
import "../../interaction-data-picker/index.mjs";
import "../../interaction-button-refresh/index.mjs";
import "../../media-image/index.mjs";
import "../../text-title/index.mjs";
import "../../commons-qrcode/index.mjs";
import "../../media-video/index.mjs";
import "../../media-audio/index.mjs";
import "../../text-real-time/index.mjs";
import "../../media-carousel/index.mjs";
import "../../media-carousel-slides/index.mjs";
import "../../media-iframe-carousel/index.mjs";
import "../../media-iframe/index.mjs";
import "../../media-m3u8/index.mjs";
import "../../media-m3u8-dynamic/index.mjs";
import "../../media-audio-dynamic/index.mjs";
import "../../media-video-dynamic/index.mjs";
import "../../media-image-dynamic/index.mjs";
import "../../media-iframe-dynamic/index.mjs";
import "../../media-flv/index.mjs";
import "../../commons-echarts/index.mjs";
import "../../text-over-number/index.mjs";
import "../../text-table-scroll/index.mjs";
import "../../text-carousel/index.mjs";
import "../../text-row-scroll/index.mjs";
import "../../text-text-dynamic/index.mjs";
import "../../text-count-down/index.mjs";
import "../../graphical-circle/index.mjs";
import "../../graphical-diamond/index.mjs";
import "../../graphical-hexagon/index.mjs";
import "../../graphical-isosceles-triangle/index.mjs";
import "../../graphical-pentagon/index.mjs";
import "../../graphical-rect/index.mjs";
import "../../graphical-right-triangle/index.mjs";
import "../../scene-map3d/index.mjs";
import "../../scene-amap2d/index.mjs";
import "../../scene-amap3d/index.mjs";
import "../../scene-vr/index.mjs";
import "../../scene-unity-iframe/index.mjs";
import "../../scene-unity-webgl/index.mjs";
import "../../scene-ue-iframe/index.mjs";
import "../../scene-ue-shj/index.mjs";
import "../../scene-default/index.mjs";
import "../../interaction/tabs/index.mjs";
import "../../interaction/tabs-icon/index.mjs";
import "../../interaction/button/index.mjs";
import "../../interaction/date-picker/src/date-picker/index.mjs";
import "../../interaction/date-picker/src/date-picker-range/index.mjs";
import "../../text/list/index.mjs";
import "../../chart/src/bar/basic/index.mjs";
import "../../chart/src/bar/animation/index.mjs";
import "../../chart/src/bar/contrast/index.mjs";
import "../../chart/src/bar/contrast2/index.mjs";
import "../../chart/src/bar/contrast3/index.mjs";
import "../../chart/src/bar/gradient-column-chart/index.mjs";
import "../../chart/src/bar/horizontal/index.mjs";
import "../../chart/src/bar/horizontal-stack/index.mjs";
import "../../chart/src/bar/line-bar/index.mjs";
import "../../chart/src/bar/line-bar2/index.mjs";
import "../../chart/src/bar/loop/index.mjs";
import "../../chart/src/bar/mini/index.mjs";
import "../../chart/src/bar/polar/index.mjs";
import "../../chart/src/bar/polar-stack/index.mjs";
import "../../chart/src/bar/polar2/index.mjs";
import "../../chart/src/bar/radius-circle/index.mjs";
import "../../chart/src/bar/rank/index.mjs";
import "../../chart/src/bar/segmented-progress/index.mjs";
import "../../chart/src/bar/spire/index.mjs";
import "../../chart/src/bar/stack/index.mjs";
import "../../chart/src/bar/stack-line/index.mjs";
import "../../chart/src/bar/stack2/index.mjs";
import "../../chart/src/bar/stack3/index.mjs";
import "../../chart/src/bar/staggered/index.mjs";
import "../../chart/src/bar/three/index.mjs";
import "../../chart/src/bar/waterfall/index.mjs";
import "../../chart/src/bar/zebra/index.mjs";
import "../../chart/src/line/area-gradient/index.mjs";
import "../../chart/src/line/area-highlight/index.mjs";
import "../../chart/src/line/area-highlight2/index.mjs";
import "../../chart/src/line/basic/index.mjs";
import "../../chart/src/line/bump/index.mjs";
import "../../chart/src/line/dashed/index.mjs";
import "../../chart/src/line/ladder/index.mjs";
import "../../chart/src/line/logarithm/index.mjs";
import "../../chart/src/line/multix/index.mjs";
import "../../chart/src/line/polar-double/index.mjs";
import "../../chart/src/line/rain-flow/index.mjs";
import "../../chart/src/line/scale/index.mjs";
import "../../chart/src/line/smooth/index.mjs";
import "../../chart/src/line/smooth-area/index.mjs";
import "../../chart/src/line/stack/index.mjs";
import "../../chart/src/line/stack-area/index.mjs";
import "../../chart/src/line/temp/index.mjs";
import "../../chart/src/line/vertical/index.mjs";
import "../../chart/src/map/basic/index.mjs";
import "../../chart/src/map/bmap-basic/index.mjs";
import "../../chart/src/map/bmap-heatmap/index.mjs";
import "../../chart/src/map/bmap-rich/index.mjs";
import "../../chart/src/map/customize/index.mjs";
import "../../chart/src/map/lines/index.mjs";
import "../../chart/src/map/scatter/index.mjs";
import "../../chart/src/pie/3d/index.mjs";
import "../../chart/src/pie/basic/index.mjs";
import "../../chart/src/pie/basic2/index.mjs";
import "../../chart/src/pie/customized/index.mjs";
import "../../chart/src/pie/index/index.mjs";
import "../../chart/src/pie/interval/index.mjs";
import "../../chart/src/pie/legend-scroll/index.mjs";
import "../../chart/src/pie/radius/index.mjs";
import "../../chart/src/pie/rose/index.mjs";
import "../../chart/src/pie/round/index.mjs";
import "../../chart/src/pie/sunburst/index.mjs";
import "../../chart/src/scatter/basic/index.mjs";
import "../../chart/src/scatter/basic2/index.mjs";
import "../../chart/src/scatter/bubble/index.mjs";
import "../../chart/src/scatter/ripples/index.mjs";
import "../../commons/custom-component-render/index.mjs";
import "../zv-hj-tree-list/index.mjs";
import "../zv-hj-model-resource/index.mjs";
import "../zv-hj-one-map-config/index.mjs";
import "../zv-hj-video-control/index.mjs";
import "../zv-hj-video-page/index.mjs";
import "../zv-hj-password-input/index.mjs";
import "../zv-hj-carousel/index.mjs";
import "../zv-hj-video-monitor/index.mjs";
import "../zv-hj-scene-amap2d/index.mjs";
import "../zv-hj-scene-amap3d/index.mjs";
import "./index.mjs";
import "../zv-hj-resource-type-phone/index.mjs";
import "../zv-hj-tree-list-phone/index.mjs";
import "../zv-hj-video-page-phone/index.mjs";
import "../zv-hj-model-resource-phone/index.mjs";
import "../zv-hj-bottom-suspend/index.mjs";
import "../zv-hj-pagination/index.mjs";
import "../zv-hj-password-input-phone/index.mjs";
/* empty css                           */
/* empty css                                  */
import { SHJDatasourceV2 as yt } from "../../../plugins/datasource/index.mjs";
import { SHJParseEvent as _t } from "../../../plugins/event/index.mjs";
import "lodash";
import { DataSourceUtils as G } from "../../../plugins/datasource/utils/utils.mjs";
import { HJLYDatasourceApi as kt } from "../../../plugins/datasource/hjly/index.mjs";
const Dt = { class: "hj-person-face" }, ht = { class: "header" }, Ot = { class: "title" }, Nt = ["src"], Ut = {
  key: 0,
  class: "upload-tip-box"
}, Ct = {
  key: 1,
  class: "avatar-img-box"
}, Et = { class: "filter-area" }, St = { class: "option" }, Vt = { class: "option" }, Tt = { class: "option" }, It = { class: "option" }, Lt = { class: "option" }, Mt = { class: "operate-group" }, Yt = { class: "result-area" }, wt = {
  key: 0,
  class: "no-data"
}, zt = {
  key: 1,
  class: "image-box"
}, Ht = ["onClick"], Pt = ["src"], jt = {
  key: 0,
  class: "text"
}, At = {
  key: 0,
  class: "right"
}, Bt = { class: "top" }, Gt = { class: "adddress" }, Rt = { class: "time" }, Ft = { class: "detail-img" }, Kt = ["src"], qt = {
  key: 0,
  class: "text"
}, Jt = ["src"], Wt = R({ name: "zv-hj-person-face" }), Fl = /* @__PURE__ */ R({
  ...Wt,
  props: {
    basicOption: {},
    sources: {},
    useEvents: {},
    uuid: {}
  },
  emits: ["on-click"],
  setup(F, { expose: K, emit: q }) {
    var A;
    nt((e) => ({
      cdbccedc: "url(" + e.basicOption.upload.bg + ")",
      "08cdd324": "url(" + e.basicOption.upload.uploadTipImage + ")",
      b5b460e2: "url(" + e.basicOption.upload.faceBg + ")",
      "63edb588": "url(" + c.value + ")",
      "734ba09e": "url(" + e.basicOption.option.bg + ")",
      "53bd4ba5": e.basicOption.select.color,
      "4b32cb5f": e.basicOption.select.fontSize + "px",
      "14cd056e": e.basicOption.select.fontSize,
      "1c34c0a5": e.basicOption.select.fontWeight,
      "02084cde": e.basicOption.select.fontFamily,
      "52531bf7": "url(" + e.basicOption.select.bg + ")",
      50774538: "url(" + e.basicOption.reset.bg + ")",
      "7b9e6e70": "url(" + e.basicOption.noData.bg + ")",
      "35317df6": "url(" + e.basicOption.result.bg + ")"
    }));
    const J = q, _ = F;
    ut(() => _.sources, () => {
      S();
    }, { deep: !0 });
    const W = l({});
    l();
    const N = l(), $ = [
      { value: "UNKNOWN", label: "未知" },
      { value: "INFANT", label: "婴幼儿" },
      { value: "KID", label: "儿童" },
      { value: "CHILD", label: "少年" },
      { value: "TEENAGER", label: "青少年" },
      { value: "YOUNG", label: "青年" },
      { value: "PRIME", label: "壮年" },
      { value: "MIDDLE", label: "中年" },
      { value: "MIDDLEAGED", label: "中老年" },
      { value: "OLD", label: "老年" }
    ], U = l(), x = [
      {
        value: "UNKNOWN",
        label: "未知"
      },
      {
        value: "male",
        label: "男"
      },
      {
        value: "female",
        label: "女"
      }
    ], C = l(), X = [
      {
        value: "UNKNOWN",
        label: "未知"
      },
      {
        value: "yes",
        label: "有"
      },
      {
        value: "no",
        label: "无"
      }
    ], p = l(50), c = l(), Q = G.getEnvironments(), z = "/imcs-admin/document/upload", Z = G.replaceEnvVariables(z, Q), tt = l(Z + z);
    let E = null;
    const H = localStorage.getItem("Session_token") || sessionStorage.getItem("Session_token");
    H && (E = JSON.parse(H));
    const et = { "X-Token": (A = E == null ? void 0 : E.data) == null ? void 0 : A.token }, d = l(0), k = l(0), P = l(20), M = l(0), v = l([]), b = l(5), g = l(!1), s = l();
    ct(() => {
      S();
    });
    const S = () => {
      yt.parse({
        tId: _.uuid,
        sources: _.sources,
        callback: ({ data: e }) => {
          W.value = e[0].data[0];
        }
      });
    }, j = (e) => {
      if (!c.value)
        return L({
          message: "请先上传图片",
          type: "error"
        });
      if (e === 1)
        k.value = 1, v.value = [];
      else {
        if (M.value > 0 && M.value / P.value < k.value)
          return L({
            message: "没有更多数据了",
            type: "warning"
          });
        k.value = k.value + 1;
      }
      const t = {
        facePicUrl: null,
        ageGroup: null,
        withGlass: null,
        sex: null,
        minSimilarity: 50,
        pageNo: k.value,
        pageSize: P.value,
        startTime: B().startOf("day").format("YYYY-MM-DDTHH:mm:ss.000+08:00"),
        // "2024-11-01T08:50:00+08:00"
        endTime: B().endOf("day").format("YYYY-MM-DDTHH:mm:ss.000+08:00")
        // "2024-11-01T08:59:59+08:00"
      };
      t.ageGroup = N.value, t.withGlass = C.value, t.sex = U.value, t.minSimilarity = p.value, t.facePicUrl = c.value, kt.captureSearch(
        t
      ).then((n) => {
        var f, y;
        e === 1 && (g.value = !1, s.value = null, b.value = 5), ((y = (f = n == null ? void 0 : n.data) == null ? void 0 : f.list) == null ? void 0 : y.length) > 0 ? (d.value = 1, v.value.push(...n.data.list), M.value = n.data.page.dataCount) : (d.value = 0, v.value = []);
      }).catch(() => {
        d.value = 0, v.value = [];
      });
    }, ot = () => {
      c.value = null, N.value = null, U.value = null, C.value = null, p.value = 50, d.value = 0, v.value = [], s.value = null, g.value = !1, b.value = 5;
    }, it = (e) => {
      e.data && (c.value = e.data);
    }, lt = (e) => {
      const t = e.size / 1024 / 1024 < 1;
      if (e.type !== "image/jpg" && e.type !== "image/png" && e.type !== "image/jpeg" && e.type !== "image/bmp")
        return L({
          message: "上传图片格式错误,请上传jpg/png/jpeg/bmp格式的图片!",
          type: "error"
        }), !1;
      if (!t)
        return L({
          message: "上传头像图片大小不能超过 1MB!",
          type: "error"
        }), !1;
    }, Y = (e) => {
      e.target.src = require(_.basicOption.defaultImg.url);
    }, rt = (e) => {
      b.value = 3, s.value = e, g.value = !0;
    }, at = () => {
      b.value = 5, g.value = !1;
    }, st = (e) => {
      J("on-click", e.facePicUrl), _t.parseEvents(_.useEvents, "on-click", e.facePicUrl);
    };
    return K({
      refresh: () => S(),
      refreshData: () => S()
    }), (e, t) => {
      const n = V("el-upload"), f = V("el-option"), y = V("el-select"), pt = V("el-input"), mt = dt("infinite-scroll");
      return a(), r("div", Dt, [
        o("div", ht, [
          o("div", Ot, [
            t[6] || (t[6] = w(" 以图搜图 ")),
            o("img", {
              src: e.basicOption.head.bg,
              alt: "",
              class: "title-img"
            }, null, 8, Nt)
          ]),
          m(n, {
            class: "upload-area avatar-uploader",
            drag: "",
            action: tt.value,
            headers: vt(et),
            "show-file-list": !1,
            name: "multipartFile",
            "on-success": it,
            "before-upload": lt,
            size: 1
          }, {
            default: D(() => [
              c.value ? (a(), r("div", Ct, t[8] || (t[8] = [
                o("div", {
                  class: "avatar-img",
                  alt: ""
                }, null, -1)
              ]))) : (a(), r("div", Ut, t[7] || (t[7] = [
                o("div", {
                  class: "upload-img",
                  alt: ""
                }, null, -1),
                o("span", { class: "upload-text" }, "将图片放到此处或", -1),
                o("a", { class: "upload-btn" }, "上传文件", -1)
              ])))
            ]),
            _: 1
          }, 8, ["action", "headers"])
        ]),
        o("div", Et, [
          o("div", St, [
            t[9] || (t[9] = o("div", { class: "label" }, "年龄段", -1)),
            m(y, {
              modelValue: N.value,
              "onUpdate:modelValue": t[0] || (t[0] = (i) => N.value = i),
              placeholder: "年龄段",
              clearable: ""
            }, {
              default: D(() => [
                (a(), r(T, null, I($, (i, u) => m(f, {
                  key: u + "A",
                  value: i.value,
                  label: i.label
                }, null, 8, ["value", "label"])), 64))
              ]),
              _: 1
            }, 8, ["modelValue"])
          ]),
          o("div", Vt, [
            t[10] || (t[10] = o("div", { class: "label" }, "性别", -1)),
            m(y, {
              modelValue: U.value,
              "onUpdate:modelValue": t[1] || (t[1] = (i) => U.value = i),
              placeholder: "性别",
              clearable: ""
            }, {
              default: D(() => [
                (a(), r(T, null, I(x, (i, u) => m(f, {
                  key: u + "B",
                  value: i.value,
                  label: i.label
                }, null, 8, ["value", "label"])), 64))
              ]),
              _: 1
            }, 8, ["modelValue"])
          ]),
          o("div", Tt, [
            t[11] || (t[11] = o("div", { class: "label" }, "戴眼镜", -1)),
            m(y, {
              modelValue: C.value,
              "onUpdate:modelValue": t[2] || (t[2] = (i) => C.value = i),
              placeholder: "戴眼镜",
              clearable: ""
            }, {
              default: D(() => [
                (a(), r(T, null, I(X, (i, u) => m(f, {
                  key: u + "C",
                  value: i.value,
                  label: i.label
                }, null, 8, ["value", "label"])), 64))
              ]),
              _: 1
            }, 8, ["modelValue"])
          ]),
          o("div", It, [
            t[13] || (t[13] = o("div", { class: "label" }, "相似度", -1)),
            m(pt, {
              modelValue: p.value,
              "onUpdate:modelValue": t[3] || (t[3] = (i) => p.value = i),
              placeholder: "相似度",
              oninput: (i) => {
                p.value = i.target.value.replace(/[^0-9]/g, ""), p.value > 100 && (p.value = 100), p.value < 1 && (p.value = 1);
              }
            }, {
              append: D(() => t[12] || (t[12] = [
                w("%")
              ])),
              _: 1
            }, 8, ["modelValue", "oninput"])
          ]),
          o("div", Lt, [
            t[14] || (t[14] = o("div", { class: "label" }, "操作", -1)),
            o("div", Mt, [
              o("div", {
                class: "operate query",
                onClick: t[4] || (t[4] = (i) => j(1))
              }, "查询"),
              o("div", {
                class: "operate reset",
                onClick: ot
              }, "重置")
            ])
          ])
        ]),
        o("div", Yt, [
          d.value == 0 ? (a(), r("div", wt, t[15] || (t[15] = [
            o("div", { class: "icon" }, null, -1),
            o("div", { class: "text" }, "暂无数据，请先上传目标照片进行查询", -1),
            o("div", { class: "tips" }, "图片支持jpg,jpeg,bmp,png格式,大小1KB-1MB", -1),
            o("div", { class: "tips" }, "像素建议为480*640以上", -1)
          ]))) : h("", !0),
          d.value == 1 ? (a(), r("div", zt, [
            bt((a(), r("div", {
              class: ft(["left", [g.value ? "detail" : ""]]),
              style: gt({ gridTemplateRows: "repeat(" + b.value + ", 1fr)", gridTemplateColumns: "repeat(" + b.value + ", 1fr)" })
            }, [
              (a(!0), r(T, null, I(v.value, (i, u) => (a(), r("div", {
                key: "D" + u,
                class: "capture",
                alt: "",
                onClick: ($t) => rt(i)
              }, [
                o("img", {
                  src: i.facePicUrl || i.snapUrl,
                  alt: "",
                  class: "capture-img",
                  referrerpolicy: "no-referrer",
                  onError: Y
                }, null, 40, Pt),
                i.similarity ? (a(), r("div", jt, O(i.similarity), 1)) : h("", !0)
              ], 8, Ht))), 128))
            ], 6)), [
              [mt, j]
            ]),
            g.value ? (a(), r("div", At, [
              o("div", Bt, [
                o("div", null, O(s.value.cameraName), 1),
                o("div", {
                  class: "icon",
                  onClick: at
                })
              ]),
              o("div", Gt, O(s.value.address), 1),
              o("div", Rt, O(s.value.captureTime && s.value.captureTime.replace("T", " ").replace("+08:00", "")), 1),
              o("div", Ft, [
                o("img", {
                  src: s.value.facePicUrl,
                  alt: "",
                  referrerpolicy: "no-referrer",
                  onError: Y
                }, null, 40, Kt),
                s.value.similarity ? (a(), r("div", qt, O(s.value.similarity), 1)) : h("", !0),
                o("div", {
                  class: "search",
                  onClick: t[5] || (t[5] = (i) => st(s.value))
                }, [
                  o("img", {
                    src: e.basicOption.search.bg,
                    alt: "",
                    onError: Y
                  }, null, 40, Jt),
                  t[16] || (t[16] = w(" 搜图 "))
                ])
              ])
            ])) : h("", !0)
          ])) : h("", !0)
        ])
      ]);
    };
  }
});
export {
  Fl as default
};
