@frigate-nvr/image-annotator 1.0.0 → 1.0.2

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.
@@ -1,22 +1,58 @@
1
- import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
- import { c as r } from "../index-sN46tOW-.js";
3
- import '../assets/Button.css';const s = (n) => {
4
- const l = r({
5
- btn: !0,
6
- "btn-xs": n.xs,
7
- "btn-sm": n.sm,
8
- "btn-xl": n.xl,
9
- "btn-base": !n.xl,
10
- "btn-secondary": n.secondary,
11
- "btn-primary": !n.secondary,
12
- "btn-red": n.red,
13
- "btn-green": n.green,
14
- "w-full": n.full
1
+ import { jsxs as a, jsx as l } from "react/jsx-runtime";
2
+ import { g as x } from "../_commonjsHelpers-DjF3Plf2.js";
3
+ var c = { exports: {} };
4
+ /*!
5
+ Copyright (c) 2018 Jed Watson.
6
+ Licensed under the MIT License (MIT), see
7
+ http://jedwatson.github.io/classnames
8
+ */
9
+ (function(t) {
10
+ (function() {
11
+ var o = {}.hasOwnProperty;
12
+ function i() {
13
+ for (var e = "", r = 0; r < arguments.length; r++) {
14
+ var n = arguments[r];
15
+ n && (e = s(e, f(n)));
16
+ }
17
+ return e;
18
+ }
19
+ function f(e) {
20
+ if (typeof e == "string" || typeof e == "number")
21
+ return e;
22
+ if (typeof e != "object")
23
+ return "";
24
+ if (Array.isArray(e))
25
+ return i.apply(null, e);
26
+ if (e.toString !== Object.prototype.toString && !e.toString.toString().includes("[native code]"))
27
+ return e.toString();
28
+ var r = "";
29
+ for (var n in e)
30
+ o.call(e, n) && e[n] && (r = s(r, n));
31
+ return r;
32
+ }
33
+ function s(e, r) {
34
+ return r ? e ? e + " " + r : e + r : e;
35
+ }
36
+ t.exports ? (i.default = i, t.exports = i) : window.classNames = i;
37
+ })();
38
+ })(c);
39
+ var d = c.exports;
40
+ const m = /* @__PURE__ */ x(d), b = (t) => {
41
+ const o = m({
42
+ "text-sm py-2 px-2": t.xs,
43
+ "text-base font-medium py-2 px-3": t.sm,
44
+ "font-extrabold text-xl py-4 px-6": t.xl,
45
+ "text-lg font-semibold py-2 px-4": !t.xl,
46
+ "bg-white text-gray-700 border-gray-400 hover:bg-gray-100 active:bg-white": t.secondary,
47
+ "text-white bg-primary-700 border-gray-100 hover:bg-primary-900 active:bg-primary-800": !t.secondary && !t.red && !t.green,
48
+ "text-white bg-red-500 border-gray-100 hover:bg-red-600 active:bg-red-500": t.red,
49
+ "text-white bg-green-600 border-gray-100 hover:bg-green-700 active:bg-green-600": t.green,
50
+ "w-full": t.full
15
51
  });
16
52
  return (
17
53
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
18
- /* @__PURE__ */ t("div", { className: l, children: [
19
- n.loading && /* @__PURE__ */ t(
54
+ /* @__PURE__ */ a("div", { className: `inline-flex rounded-md border items-center justify-center ${o}`, children: [
55
+ t.loading && /* @__PURE__ */ a(
20
56
  "svg",
21
57
  {
22
58
  xmlns: "http://www.w3.org/2000/svg",
@@ -24,8 +60,8 @@ import '../assets/Button.css';const s = (n) => {
24
60
  fill: "none",
25
61
  viewBox: "0 0 24 24",
26
62
  children: [
27
- /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor" }),
28
- /* @__PURE__ */ e(
63
+ /* @__PURE__ */ l("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor" }),
64
+ /* @__PURE__ */ l(
29
65
  "path",
30
66
  {
31
67
  fill: "currentColor",
@@ -35,11 +71,11 @@ import '../assets/Button.css';const s = (n) => {
35
71
  ]
36
72
  }
37
73
  ),
38
- n.children
74
+ t.children
39
75
  ] })
40
76
  );
41
77
  };
42
78
  export {
43
- s as Button
79
+ b as Button
44
80
  };
45
81
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../src/components/Button.tsx"],"sourcesContent":["import \"./Button.css\";\nimport { ReactNode } from \"react\";\n\nimport classNames from \"classnames\";\n\ninterface IButtonProps {\n loading?: boolean;\n xs?: boolean;\n sm?: boolean;\n xl?: boolean;\n secondary?: boolean;\n red?: boolean;\n green?: boolean;\n full?: boolean;\n children: ReactNode;\n}\n\n/**\n * @component\n * @params props - Component props.\n * @param props.loading - Display loading indicator.\n * @param props.xs - Button in xs size.\n * @param props.sm - Button in sm size.\n * @param props.xl - Button in xl size.\n * @param props.secondary - Indicates if the button is a secondary button.\n * @param props.red - Indicates if the button is a red button.\n * @param props.green - Indicates if the button is a green button.\n * @param props.full - Indicates if the button takes 100% width.\n * @param props.children - Children components.\n */\nconst Button = (props: IButtonProps) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n const btnClass = classNames({\n btn: true,\n \"btn-xs\": props.xs,\n \"btn-sm\": props.sm,\n \"btn-xl\": props.xl,\n \"btn-base\": !props.xl,\n \"btn-secondary\": props.secondary,\n \"btn-primary\": !props.secondary,\n \"btn-red\": props.red,\n \"btn-green\": props.green,\n \"w-full\": props.full,\n });\n\n return (\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n <div className={btnClass}>\n {props.loading && (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"animate-spin h-5 w-5 text-white mr-1\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" />\n <path\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n />\n </svg>\n )}\n\n {props.children}\n </div>\n );\n};\n\nexport { Button };\n"],"names":["Button","props","btnClass","classNames","jsxs","jsx"],"mappings":";;AA8BM,MAAAA,IAAS,CAACC,MAAwB;AAEtC,QAAMC,IAAWC,EAAW;AAAA,IAC1B,KAAK;AAAA,IACL,UAAUF,EAAM;AAAA,IAChB,UAAUA,EAAM;AAAA,IAChB,UAAUA,EAAM;AAAA,IAChB,YAAY,CAACA,EAAM;AAAA,IACnB,iBAAiBA,EAAM;AAAA,IACvB,eAAe,CAACA,EAAM;AAAA,IACtB,WAAWA,EAAM;AAAA,IACjB,aAAaA,EAAM;AAAA,IACnB,UAAUA,EAAM;AAAA,EAAA,CACjB;AAED;AAAA;AAAA,IAEE,gBAAAG,EAAC,OAAI,EAAA,WAAWF,GACb,UAAA;AAAA,MAAAD,EAAM,WACL,gBAAAG;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,OAAM;AAAA,UACN,WAAU;AAAA,UACV,MAAK;AAAA,UACL,SAAQ;AAAA,UAER,UAAA;AAAA,YAAC,gBAAAC,EAAA,UAAA,EAAO,IAAG,MAAK,IAAG,MAAK,GAAE,MAAK,QAAO,eAAe,CAAA;AAAA,YACrD,gBAAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,GAAE;AAAA,cAAA;AAAA,YACJ;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,MAGDJ,EAAM;AAAA,IAAA,GACT;AAAA;AAEJ;"}
1
+ {"version":3,"file":"Button.js","sources":["../../node_modules/classnames/index.js","../../src/components/Button.tsx"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import { ReactNode } from \"react\";\n\nimport classNames from \"classnames\";\n\ninterface IButtonProps {\n loading?: boolean;\n xs?: boolean;\n sm?: boolean;\n xl?: boolean;\n secondary?: boolean;\n red?: boolean;\n green?: boolean;\n full?: boolean;\n children: ReactNode;\n}\n\n/**\n * @component\n * @params props - Component props.\n * @param props.loading - Display loading indicator.\n * @param props.xs - Button in xs size.\n * @param props.sm - Button in sm size.\n * @param props.xl - Button in xl size.\n * @param props.secondary - Indicates if the button is a secondary button.\n * @param props.red - Indicates if the button is a red button.\n * @param props.green - Indicates if the button is a green button.\n * @param props.full - Indicates if the button takes 100% width.\n * @param props.children - Children components.\n */\nconst Button = (props: IButtonProps) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n const btnClass = classNames({\n \"text-sm py-2 px-2\": props.xs,\n \"text-base font-medium py-2 px-3\": props.sm,\n \"font-extrabold text-xl py-4 px-6\": props.xl,\n \"text-lg font-semibold py-2 px-4\": !props.xl,\n \"bg-white text-gray-700 border-gray-400 hover:bg-gray-100 active:bg-white\": props.secondary,\n \"text-white bg-primary-700 border-gray-100 hover:bg-primary-900 active:bg-primary-800\": !props.secondary && !props.red && !props.green,\n \"text-white bg-red-500 border-gray-100 hover:bg-red-600 active:bg-red-500\": props.red,\n \"text-white bg-green-600 border-gray-100 hover:bg-green-700 active:bg-green-600\": props.green,\n \"w-full\": props.full,\n });\n\n return (\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n <div className={`inline-flex rounded-md border items-center justify-center ${btnClass}`}>\n {props.loading && (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"animate-spin h-5 w-5 text-white mr-1\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" />\n <path\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n />\n </svg>\n )}\n\n {props.children}\n </div>\n );\n};\n\nexport { Button };\n"],"names":["hasOwn","classNames","classes","i","arg","appendClass","parseValue","key","value","newClass","module","Button","props","btnClass","jsxs","jsx"],"mappings":";;;;;;;;;AAOA,GAAC,WAAY;AAGZ,QAAIA,IAAS,CAAE,EAAC;AAEhB,aAASC,IAAc;AAGtB,eAFIC,IAAU,IAELC,IAAI,GAAGA,IAAI,UAAU,QAAQA,KAAK;AAC1C,YAAIC,IAAM,UAAUD,CAAC;AACrB,QAAIC,MACHF,IAAUG,EAAYH,GAASI,EAAWF,CAAG,CAAC;AAAA,MAE/C;AAED,aAAOF;AAAA,IACP;AAED,aAASI,EAAYF,GAAK;AACzB,UAAI,OAAOA,KAAQ,YAAY,OAAOA,KAAQ;AAC7C,eAAOA;AAGR,UAAI,OAAOA,KAAQ;AAClB,eAAO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;AAAA,YACrD,gBAAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,GAAE;AAAA,cAAA;AAAA,YACJ;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,MAGDH,EAAM;AAAA,IAAA,GACT;AAAA;AAEJ;","x_google_ignoreList":[0]}
@@ -1,66 +1,64 @@
1
- import { jsxs as D, Fragment as oe, jsx as i } from "react/jsx-runtime";
2
- import { useRef as B, useEffect as te, useMemo as ce, useState as O, Fragment as ae } from "react";
3
- import { Button as v } from "./Button.js";
1
+ import { jsxs as S, Fragment as oe, jsx as i } from "react/jsx-runtime";
2
+ import { useRef as v, useEffect as te, useMemo as ce, useState as O, Fragment as ae } from "react";
3
+ import { Button as b } from "./Button.js";
4
4
  import { Crosshairs as se } from "./Crosshairs.js";
5
5
  import { InfoDialog as de } from "./InfoDialog.js";
6
6
  import { LabelDialog as ue } from "./LabelDialog.js";
7
7
  import { VerifyDialog as Z } from "./VerifyDialog.js";
8
- import { FormElement as he } from "./FormElement.js";
9
- import { FormElementBox as fe } from "./FormElementBox.js";
10
8
  import { BoundingBox as ee, BoundingBoxType as q } from "./BoundingBox.js";
11
- import { T as me, a as we } from "../index.esm-FeyXGhGs.js";
12
- function ge(a, y, d) {
13
- var f = this, g = B(null), L = B(0), e = B(null), o = B([]), p = B(), b = B(), M = B(a), k = B(!0);
9
+ import { T as he, a as fe } from "../index.esm-FeyXGhGs.js";
10
+ function me(a, y, d) {
11
+ var f = this, g = v(null), L = v(0), e = v(null), o = v([]), p = v(), B = v(), M = v(a), k = v(!0);
14
12
  M.current = a;
15
- var A = typeof window < "u", T = !y && y !== 0 && A;
13
+ var F = typeof window < "u", T = !y && y !== 0 && F;
16
14
  if (typeof a != "function") throw new TypeError("Expected a function");
17
15
  y = +y || 0;
18
- var I = !!(d = d || {}).leading, X = !("trailing" in d) || !!d.trailing, N = "maxWait" in d, j = "debounceOnServer" in d && !!d.debounceOnServer, W = N ? Math.max(+d.maxWait || 0, y) : null;
16
+ var X = !!(d = d || {}).leading, j = !("trailing" in d) || !!d.trailing, A = "maxWait" in d, E = "debounceOnServer" in d && !!d.debounceOnServer, W = A ? Math.max(+d.maxWait || 0, y) : null;
19
17
  te(function() {
20
18
  return k.current = !0, function() {
21
19
  k.current = !1;
22
20
  };
23
21
  }, []);
24
22
  var V = ce(function() {
25
- var F = function(u) {
23
+ var N = function(u) {
26
24
  var m = o.current, R = p.current;
27
- return o.current = p.current = null, L.current = u, b.current = M.current.apply(R, m);
28
- }, S = function(u, m) {
25
+ return o.current = p.current = null, L.current = u, B.current = M.current.apply(R, m);
26
+ }, D = function(u, m) {
29
27
  T && cancelAnimationFrame(e.current), e.current = T ? requestAnimationFrame(u) : setTimeout(u, m);
30
28
  }, _ = function(u) {
31
29
  if (!k.current) return !1;
32
30
  var m = u - g.current;
33
- return !g.current || m >= y || m < 0 || N && u - L.current >= W;
31
+ return !g.current || m >= y || m < 0 || A && u - L.current >= W;
34
32
  }, U = function(u) {
35
- return e.current = null, X && o.current ? F(u) : (o.current = p.current = null, b.current);
36
- }, P = function u() {
33
+ return e.current = null, j && o.current ? N(u) : (o.current = p.current = null, B.current);
34
+ }, z = function u() {
37
35
  var m = Date.now();
38
36
  if (_(m)) return U(m);
39
37
  if (k.current) {
40
- var R = y - (m - g.current), C = N ? Math.min(R, W - (m - L.current)) : R;
41
- S(u, C);
38
+ var R = y - (m - g.current), C = A ? Math.min(R, W - (m - L.current)) : R;
39
+ D(u, C);
42
40
  }
43
- }, z = function() {
44
- if (A || j) {
41
+ }, P = function() {
42
+ if (F || E) {
45
43
  var u = Date.now(), m = _(u);
46
44
  if (o.current = [].slice.call(arguments), p.current = f, g.current = u, m) {
47
- if (!e.current && k.current) return L.current = g.current, S(P, y), I ? F(g.current) : b.current;
48
- if (N) return S(P, y), F(g.current);
45
+ if (!e.current && k.current) return L.current = g.current, D(z, y), X ? N(g.current) : B.current;
46
+ if (A) return D(z, y), N(g.current);
49
47
  }
50
- return e.current || S(P, y), b.current;
48
+ return e.current || D(z, y), B.current;
51
49
  }
52
50
  };
53
- return z.cancel = function() {
51
+ return P.cancel = function() {
54
52
  e.current && (T ? cancelAnimationFrame(e.current) : clearTimeout(e.current)), L.current = 0, o.current = g.current = p.current = e.current = null;
55
- }, z.isPending = function() {
53
+ }, P.isPending = function() {
56
54
  return !!e.current;
57
- }, z.flush = function() {
58
- return e.current ? U(Date.now()) : b.current;
59
- }, z;
60
- }, [I, N, y, W, X, T, A, j]);
55
+ }, P.flush = function() {
56
+ return e.current ? U(Date.now()) : B.current;
57
+ }, P;
58
+ }, [X, A, y, W, j, T, F, E]);
61
59
  return V;
62
60
  }
63
- const ke = (a) => {
61
+ const Ce = (a) => {
64
62
  var G;
65
63
  const y = [
66
64
  { codes: ["?"], action: "Shortcut help" },
@@ -90,26 +88,26 @@ const ke = (a) => {
90
88
  difficult: !1,
91
89
  width: 1,
92
90
  height: 1
93
- }), p = B(null), b = B(null), M = B(null), k = () => {
91
+ }), p = v(null), B = v(null), M = v(null), k = () => {
94
92
  var w, x, H, K;
95
93
  let t = 4;
96
- const r = ((w = p.current) == null ? void 0 : w.naturalHeight) ?? 0, n = ((x = p.current) == null ? void 0 : x.naturalWidth) ?? 0, c = Math.round(r * t), l = ((H = b.current) == null ? void 0 : H.getBoundingClientRect().height) ?? 0;
94
+ const r = ((w = p.current) == null ? void 0 : w.naturalHeight) ?? 0, n = ((x = p.current) == null ? void 0 : x.naturalWidth) ?? 0, c = Math.round(r * t), l = ((H = B.current) == null ? void 0 : H.getBoundingClientRect().height) ?? 0;
97
95
  c > l - 10 && (t = (l - 10) / r);
98
- const h = Math.round(n * t), s = ((K = b.current) == null ? void 0 : K.getBoundingClientRect().width) ?? 0;
96
+ const h = Math.round(n * t), s = ((K = B.current) == null ? void 0 : K.getBoundingClientRect().width) ?? 0;
99
97
  h > s - 10 && (t = (s - 10) / n), o({
100
98
  ...e,
101
99
  width: Math.round(n * t),
102
100
  height: Math.round(r * t)
103
101
  });
104
- }, A = ge(() => {
102
+ }, F = me(() => {
105
103
  k();
106
104
  }, 200);
107
105
  te(() => {
108
106
  var t, r;
109
- return window.addEventListener("resize", A), (r = (t = b.current) == null ? void 0 : t.parentElement) == null || r.focus(), () => {
110
- window.removeEventListener("resize", A);
107
+ return window.addEventListener("resize", F), (r = (t = B.current) == null ? void 0 : t.parentElement) == null || r.focus(), () => {
108
+ window.removeEventListener("resize", F);
111
109
  };
112
- }, [A]);
110
+ }, [F]);
113
111
  const T = (t, r, n) => {
114
112
  f(
115
113
  (c) => c.map((l) => l.id === n ? {
@@ -120,7 +118,7 @@ const ke = (a) => {
120
118
  h: t.offsetHeight / e.height
121
119
  } : l)
122
120
  );
123
- }, I = (t, r) => {
121
+ }, X = (t, r) => {
124
122
  f(
125
123
  (n) => n.map((c) => c.id === r ? {
126
124
  ...c,
@@ -128,7 +126,7 @@ const ke = (a) => {
128
126
  y: t.y / e.height
129
127
  } : c)
130
128
  );
131
- }, X = (t) => {
129
+ }, j = (t) => {
132
130
  var r, n;
133
131
  if (e.createMode) {
134
132
  const c = ((r = M.current) == null ? void 0 : r.instance.transformState.scale) ?? 1, l = (n = p.current) == null ? void 0 : n.getBoundingClientRect(), h = (t.clientX - ((l == null ? void 0 : l.left) ?? 0)) / c / e.width, s = (t.clientY - ((l == null ? void 0 : l.top) ?? 0)) / c / e.height;
@@ -150,7 +148,7 @@ const ke = (a) => {
150
148
  ]);
151
149
  } else
152
150
  o({ ...e, selectedBox: void 0 });
153
- }, N = (t) => {
151
+ }, A = (t) => {
154
152
  if (e.drawingMode) {
155
153
  const r = Date.now().toString();
156
154
  o({
@@ -167,16 +165,16 @@ const ke = (a) => {
167
165
  Math.abs(e.drawStartX - H),
168
166
  Math.abs(e.drawStartY - K)
169
167
  ) > 1e-3) {
170
- let Y = Math.min(e.drawStartX, H), E = Math.min(e.drawStartY, K), J = Math.abs(e.drawStartX - H), Q = Math.abs(e.drawStartY - K);
171
- Y < 0 && (J -= Math.abs(Y), Y = 0), E < 0 && (Q -= Math.abs(E), E = 0), c.push({
168
+ let Y = Math.min(e.drawStartX, H), I = Math.min(e.drawStartY, K), J = Math.abs(e.drawStartX - H), Q = Math.abs(e.drawStartY - K);
169
+ Y < 0 && (J -= Math.abs(Y), Y = 0), I < 0 && (Q -= Math.abs(I), I = 0), c.push({
172
170
  ...l,
173
171
  id: r,
174
172
  label: e.selectedLabel,
175
173
  difficult: !1,
176
174
  x: Y,
177
- y: E,
175
+ y: I,
178
176
  w: Math.min(1 - Y, J),
179
- h: Math.min(1 - E, Q)
177
+ h: Math.min(1 - I, Q)
180
178
  });
181
179
  }
182
180
  } else
@@ -185,7 +183,7 @@ const ke = (a) => {
185
183
  }, [])
186
184
  );
187
185
  }
188
- }, j = (t) => {
186
+ }, E = (t) => {
189
187
  e.drawingMode && f(
190
188
  (r) => r.map((n) => {
191
189
  var c, l;
@@ -212,7 +210,7 @@ const ke = (a) => {
212
210
  selectedLabel: (r == null ? void 0 : r.label) ?? e.selectedLabel,
213
211
  difficult: (r == null ? void 0 : r.difficult) ?? e.difficult
214
212
  });
215
- }, F = (t, r, n) => {
213
+ }, N = (t, r, n) => {
216
214
  f(
217
215
  (c) => c.map((l) => l.id === t ? {
218
216
  ...l,
@@ -226,7 +224,7 @@ const ke = (a) => {
226
224
  )
227
225
  } : l)
228
226
  );
229
- }, S = (t, r, n) => {
227
+ }, D = (t, r, n) => {
230
228
  f(
231
229
  (c) => c.map((l) => l.id === t ? {
232
230
  ...l,
@@ -254,9 +252,9 @@ const ke = (a) => {
254
252
  label: h
255
253
  } : w)
256
254
  ), o({ ...e, selectedLabel: h });
257
- }, P = (t) => {
258
- f((r) => r.filter((n) => n.id !== t));
259
255
  }, z = (t) => {
256
+ f((r) => r.filter((n) => n.id !== t));
257
+ }, P = (t) => {
260
258
  L((r) => r.filter((n) => n.id !== t));
261
259
  }, u = (t) => {
262
260
  var r;
@@ -267,7 +265,7 @@ const ke = (a) => {
267
265
  const r = d.findIndex((n) => n.id === t);
268
266
  return r === d.length - 1 ? d[0].id : d[r + 1].id;
269
267
  }, C = 5 / (((G = M.current) == null ? void 0 : G.instance.transformState.scale) ?? 1), ne = (t) => {
270
- if (t.code === "Escape" && (e.createMode ? o({ ...e, createMode: !1 }) : o({ ...e, selectedBox: void 0 })), t.code === "KeyW" && (e.createMode ? o({ ...e, createMode: !1 }) : o({ ...e, createMode: !0, selectedBox: void 0 })), t.code === "KeyF" && o({ ...e, showBoxes: !e.showBoxes }), t.code === "KeyD" && e.selectedBox && _(e.selectedBox), t.code === "KeyS" && e.selectedBox && U(e.selectedBox, t.shiftKey), t.code === "Delete" && e.selectedBox && (P(e.selectedBox), o({ ...e, selectedBox: void 0 })), t.code === "Tab") {
268
+ if (t.code === "Escape" && (e.createMode ? o({ ...e, createMode: !1 }) : o({ ...e, selectedBox: void 0 })), t.code === "KeyW" && (e.createMode ? o({ ...e, createMode: !1 }) : o({ ...e, createMode: !0, selectedBox: void 0 })), t.code === "KeyF" && o({ ...e, showBoxes: !e.showBoxes }), t.code === "KeyD" && e.selectedBox && _(e.selectedBox), t.code === "KeyS" && e.selectedBox && U(e.selectedBox, t.shiftKey), t.code === "Delete" && e.selectedBox && (z(e.selectedBox), o({ ...e, selectedBox: void 0 })), t.code === "Tab") {
271
269
  const r = R(e.selectedBox), n = m(r);
272
270
  o({
273
271
  ...e,
@@ -275,7 +273,7 @@ const ke = (a) => {
275
273
  selectedLabel: (n == null ? void 0 : n.label) ?? e.selectedLabel
276
274
  }), t.preventDefault();
277
275
  }
278
- t.code === "Space" && a.save(d, g.length === 0, a.labels), t.code === "Slash" && t.shiftKey && o({ ...e, showHelp: !0 }), e.selectedBox && (t.code === "ArrowLeft" && (t.shiftKey ? S(e.selectedBox, 0, -C) : F(e.selectedBox, 0, -C)), t.code === "ArrowRight" && (t.shiftKey ? S(e.selectedBox, 0, C) : F(e.selectedBox, 0, C)), t.code === "ArrowUp" && (t.shiftKey ? S(e.selectedBox, -C, 0) : F(e.selectedBox, -C, 0)), t.code === "ArrowDown" && (t.shiftKey ? S(e.selectedBox, C, 0) : F(e.selectedBox, C, 0)));
276
+ t.code === "Space" && a.save(d, g.length === 0, a.labels), t.code === "Slash" && t.shiftKey && o({ ...e, showHelp: !0 }), e.selectedBox && (t.code === "ArrowLeft" && (t.shiftKey ? D(e.selectedBox, 0, -C) : N(e.selectedBox, 0, -C)), t.code === "ArrowRight" && (t.shiftKey ? D(e.selectedBox, 0, C) : N(e.selectedBox, 0, C)), t.code === "ArrowUp" && (t.shiftKey ? D(e.selectedBox, -C, 0) : N(e.selectedBox, -C, 0)), t.code === "ArrowDown" && (t.shiftKey ? D(e.selectedBox, C, 0) : N(e.selectedBox, C, 0)));
279
277
  }, re = (t) => {
280
278
  k(), f(
281
279
  a.annotations.concat(a.suggestions).sort((r, n) => n.w * n.h - r.w * r.h)
@@ -291,17 +289,17 @@ const ke = (a) => {
291
289
  }, le = () => {
292
290
  o({ ...e, showLabeler: !1 }), f((t) => t.filter((r) => r.label));
293
291
  }, $ = e.showBoxes ? 0 : -1;
294
- return /* @__PURE__ */ D(oe, { children: [
295
- /* @__PURE__ */ i(me, { ref: M, disabled: e.createMode || e.drawingMode, children: ({ zoomIn: t, zoomOut: r }) => /* @__PURE__ */ D(
292
+ return /* @__PURE__ */ S(oe, { children: [
293
+ /* @__PURE__ */ i(he, { ref: M, disabled: e.createMode || e.drawingMode, children: ({ zoomIn: t, zoomOut: r }) => /* @__PURE__ */ S(
296
294
  "div",
297
295
  {
298
296
  className: "flex h-screen min-w-[600px] flex-col overflow-hidden bg-slate-900",
299
297
  onKeyDown: ne,
300
298
  tabIndex: 0,
301
299
  children: [
302
- /* @__PURE__ */ D("div", { className: "flex flex-initial bg-slate-300 p-1", children: [
303
- /* @__PURE__ */ i("div", { className: "flex-initial", children: /* @__PURE__ */ i("button", { type: "button", onClick: a.back, children: /* @__PURE__ */ i(v, { secondary: !0, sm: !0, children: "Back" }) }) }),
304
- /* @__PURE__ */ D("div", { className: "flex flex-auto justify-center", children: [
300
+ /* @__PURE__ */ S("div", { className: "flex flex-initial bg-slate-300 p-1", children: [
301
+ /* @__PURE__ */ i("div", { className: "flex-initial", children: /* @__PURE__ */ i("button", { type: "button", onClick: a.back, children: /* @__PURE__ */ i(b, { secondary: !0, sm: !0, children: "Back" }) }) }),
302
+ /* @__PURE__ */ S("div", { className: "flex flex-auto justify-center", children: [
305
303
  /* @__PURE__ */ i(
306
304
  "button",
307
305
  {
@@ -309,7 +307,7 @@ const ke = (a) => {
309
307
  onClick: () => {
310
308
  r();
311
309
  },
312
- children: /* @__PURE__ */ i(v, { children: /* @__PURE__ */ i(
310
+ children: /* @__PURE__ */ i(b, { children: /* @__PURE__ */ i(
313
311
  "svg",
314
312
  {
315
313
  xmlns: "http://www.w3.org/2000/svg",
@@ -337,7 +335,7 @@ const ke = (a) => {
337
335
  onClick: () => {
338
336
  t();
339
337
  },
340
- children: /* @__PURE__ */ i(v, { children: /* @__PURE__ */ i(
338
+ children: /* @__PURE__ */ i(b, { children: /* @__PURE__ */ i(
341
339
  "svg",
342
340
  {
343
341
  xmlns: "http://www.w3.org/2000/svg",
@@ -358,16 +356,16 @@ const ke = (a) => {
358
356
  ) })
359
357
  }
360
358
  ),
361
- /* @__PURE__ */ i("button", { type: "button", onClick: W, children: /* @__PURE__ */ i(v, { secondary: !0, sm: !0, children: "Add (w)" }) })
359
+ /* @__PURE__ */ i("button", { type: "button", onClick: W, children: /* @__PURE__ */ i(b, { secondary: !0, sm: !0, children: "Add (w)" }) })
362
360
  ] }),
363
- /* @__PURE__ */ D("div", { className: "flex-initial", children: [
361
+ /* @__PURE__ */ S("div", { className: "flex-initial", children: [
364
362
  /* @__PURE__ */ i(
365
363
  "button",
366
364
  {
367
365
  onClick: () => {
368
366
  o({ ...e, showVerify: !0 });
369
367
  },
370
- children: /* @__PURE__ */ i(v, { sm: !0, children: "Verify & Save" })
368
+ children: /* @__PURE__ */ i(b, { sm: !0, children: "Verify & Save" })
371
369
  }
372
370
  ),
373
371
  /* @__PURE__ */ i(
@@ -376,7 +374,7 @@ const ke = (a) => {
376
374
  onClick: () => {
377
375
  a.save(d, g.length === 0, []);
378
376
  },
379
- children: /* @__PURE__ */ i(v, { green: !0, sm: !0, children: "Save" })
377
+ children: /* @__PURE__ */ i(b, { green: !0, sm: !0, children: "Save" })
380
378
  }
381
379
  ),
382
380
  /* @__PURE__ */ i(
@@ -385,7 +383,7 @@ const ke = (a) => {
385
383
  onClick: () => {
386
384
  o({ ...e, showDelete: !0 });
387
385
  },
388
- children: /* @__PURE__ */ i(v, { red: !0, sm: !0, children: "Delete" })
386
+ children: /* @__PURE__ */ i(b, { red: !0, sm: !0, children: "Delete" })
389
387
  }
390
388
  ),
391
389
  /* @__PURE__ */ i(
@@ -394,7 +392,7 @@ const ke = (a) => {
394
392
  onClick: () => {
395
393
  o({ ...e, showHelp: !0 });
396
394
  },
397
- children: /* @__PURE__ */ i(v, { sm: !0, secondary: !0, children: "?" })
395
+ children: /* @__PURE__ */ i(b, { sm: !0, secondary: !0, children: "?" })
398
396
  }
399
397
  )
400
398
  ] })
@@ -402,15 +400,15 @@ const ke = (a) => {
402
400
  /* @__PURE__ */ i(
403
401
  "div",
404
402
  {
405
- ref: b,
403
+ ref: B,
406
404
  className: "grid flex-auto place-content-center",
407
- children: /* @__PURE__ */ i(we, { children: /* @__PURE__ */ D(
405
+ children: /* @__PURE__ */ i(fe, { children: /* @__PURE__ */ S(
408
406
  "div",
409
407
  {
410
408
  className: "grid place-content-center",
411
- onMouseDown: X,
412
- onMouseUp: N,
413
- onMouseMove: j,
409
+ onMouseDown: j,
410
+ onMouseUp: A,
411
+ onMouseMove: E,
414
412
  children: [
415
413
  /* @__PURE__ */ i(
416
414
  "img",
@@ -472,13 +470,13 @@ const ke = (a) => {
472
470
  e.createMode || (V(n.id), l.stopPropagation());
473
471
  },
474
472
  onDragStop: (l, h) => {
475
- I(h, n.id);
473
+ X(h, n.id);
476
474
  },
477
475
  onResizeStop: (l, h, s, w, x) => {
478
476
  T(s, x, n.id);
479
477
  },
480
478
  onClickDelete: () => {
481
- P(n.id);
479
+ z(n.id);
482
480
  },
483
481
  onClickEdit: () => {
484
482
  o({ ...e, showLabeler: !0 });
@@ -490,7 +488,7 @@ const ke = (a) => {
490
488
  /* @__PURE__ */ i(
491
489
  se,
492
490
  {
493
- className: "col-start-1 row-start-1",
491
+ className: "col-start-1 row-start-1 z-10",
494
492
  show: e.createMode && !e.drawingMode
495
493
  }
496
494
  )
@@ -508,12 +506,13 @@ const ke = (a) => {
508
506
  title: "Annotate",
509
507
  show: e.showLabeler,
510
508
  cancelText: "Cancel",
511
- button: /* @__PURE__ */ i("button", { type: "button", onClick: ie, children: /* @__PURE__ */ i(v, { sm: !0, green: !0, children: "Save" }) }),
509
+ button: /* @__PURE__ */ i("button", { type: "button", onClick: ie, children: /* @__PURE__ */ i(b, { sm: !0, green: !0, children: "Save" }) }),
512
510
  handleCancel: le,
513
- children: /* @__PURE__ */ D("div", { className: "my-2 grid grid-cols-1 gap-y-2", children: [
514
- /* @__PURE__ */ i(he, { children: /* @__PURE__ */ i(
511
+ children: /* @__PURE__ */ S("div", { className: "my-2 grid grid-cols-1 gap-y-2", children: [
512
+ /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
515
513
  "select",
516
514
  {
515
+ className: "w-full rounded-md border-gray-300 shadow-sm focus:border-primary-300 focus:ring focus:ring-primary-200 focus:ring-opacity-50",
517
516
  value: e.selectedLabel,
518
517
  onChange: (t) => {
519
518
  o({ ...e, selectedLabel: t.target.value });
@@ -521,17 +520,21 @@ const ke = (a) => {
521
520
  children: a.labels.map((t) => /* @__PURE__ */ i("option", { value: t, children: t }, t))
522
521
  }
523
522
  ) }),
524
- /* @__PURE__ */ i(fe, { htmlFor: "difficult", text: "Difficult?", children: /* @__PURE__ */ i(
525
- "input",
526
- {
527
- id: "difficult",
528
- type: "checkbox",
529
- checked: e.difficult,
530
- onChange: (t) => {
531
- o({ ...e, difficult: t.target.checked });
523
+ /* @__PURE__ */ S("div", { className: "flex items-center", children: [
524
+ /* @__PURE__ */ i(
525
+ "input",
526
+ {
527
+ id: "difficult",
528
+ className: "border-gray-300 text-primary-600 shadow-sm hover:border-gray-300 focus:border-primary-300 focus:ring focus:ring-primary-200 focus:ring-opacity-50 focus:ring-offset-0 rounded",
529
+ type: "checkbox",
530
+ checked: e.difficult,
531
+ onChange: (t) => {
532
+ o({ ...e, difficult: t.target.checked });
533
+ }
532
534
  }
533
- }
534
- ) })
535
+ ),
536
+ /* @__PURE__ */ i("label", { htmlFor: "difficult", className: "ml-2", children: "Difficult?" })
537
+ ] })
535
538
  ] })
536
539
  }
537
540
  ),
@@ -543,7 +546,7 @@ const ke = (a) => {
543
546
  handleClose: () => {
544
547
  o({ ...e, showHelp: !1 });
545
548
  },
546
- children: /* @__PURE__ */ i("div", { className: "grid w-full grid-cols-2 place-content-center gap-2 p-5", children: y.map((t) => /* @__PURE__ */ D(ae, { children: [
549
+ children: /* @__PURE__ */ i("div", { className: "grid w-full grid-cols-2 place-content-center gap-2 p-5", children: y.map((t) => /* @__PURE__ */ S(ae, { children: [
547
550
  /* @__PURE__ */ i("div", { children: t.action }),
548
551
  /* @__PURE__ */ i("div", { className: "justify-self-end", children: t.codes.map((r) => /* @__PURE__ */ i(
549
552
  "span",
@@ -573,7 +576,7 @@ const ke = (a) => {
573
576
  onClick: () => {
574
577
  a.save(d, g.length === 0, a.labels), o({ ...e, showVerify: !1 });
575
578
  },
576
- children: /* @__PURE__ */ i(v, { sm: !0, green: !0, children: "Yes, all objects are labeled" })
579
+ children: /* @__PURE__ */ i(b, { sm: !0, green: !0, children: "Yes, all objects are labeled" })
577
580
  }
578
581
  ),
579
582
  children: /* @__PURE__ */ i("ul", { className: "list-inside list-disc", children: a.labels.map((t) => /* @__PURE__ */ i("li", { children: t }, t)) })
@@ -596,7 +599,7 @@ const ke = (a) => {
596
599
  onClick: () => {
597
600
  a.delete(), o({ ...e, showDelete: !1 });
598
601
  },
599
- children: /* @__PURE__ */ i(v, { sm: !0, red: !0, children: "Yes, permanently delete" })
602
+ children: /* @__PURE__ */ i(b, { sm: !0, red: !0, children: "Yes, permanently delete" })
600
603
  }
601
604
  ),
602
605
  children: "This cannot be undone."
@@ -618,13 +621,13 @@ const ke = (a) => {
618
621
  {
619
622
  type: "button",
620
623
  onClick: () => {
621
- e.selectedBox && z(e.selectedBox), o({
624
+ e.selectedBox && P(e.selectedBox), o({
622
625
  ...e,
623
626
  showConfirmDeleteFalsePositive: !1,
624
627
  selectedBox: void 0
625
628
  });
626
629
  },
627
- children: /* @__PURE__ */ D(v, { sm: !0, red: !0, children: [
630
+ children: /* @__PURE__ */ S(b, { sm: !0, red: !0, children: [
628
631
  "Do not teach my model that this is not a",
629
632
  " ",
630
633
  e.selectedBox ? u(e.selectedBox) : " "
@@ -637,6 +640,6 @@ const ke = (a) => {
637
640
  ] });
638
641
  };
639
642
  export {
640
- ke as ImageAnnotator
643
+ Ce as ImageAnnotator
641
644
  };
642
645
  //# sourceMappingURL=ImageAnnotator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ImageAnnotator.js","sources":["../../node_modules/use-debounce/dist/index.module.js","../../src/components/ImageAnnotator.tsx"],"sourcesContent":["import{useRef as r,useEffect as n,useMemo as t,useReducer as e,useCallback as u}from\"react\";function c(e,u,c){var i=this,a=r(null),o=r(0),f=r(null),l=r([]),v=r(),m=r(),d=r(e),g=r(!0);d.current=e;var p=\"undefined\"!=typeof window,w=!u&&0!==u&&p;if(\"function\"!=typeof e)throw new TypeError(\"Expected a function\");u=+u||0;var s=!!(c=c||{}).leading,x=!(\"trailing\"in c)||!!c.trailing,h=\"maxWait\"in c,y=\"debounceOnServer\"in c&&!!c.debounceOnServer,F=h?Math.max(+c.maxWait||0,u):null;n(function(){return g.current=!0,function(){g.current=!1}},[]);var A=t(function(){var r=function(r){var n=l.current,t=v.current;return l.current=v.current=null,o.current=r,m.current=d.current.apply(t,n)},n=function(r,n){w&&cancelAnimationFrame(f.current),f.current=w?requestAnimationFrame(r):setTimeout(r,n)},t=function(r){if(!g.current)return!1;var n=r-a.current;return!a.current||n>=u||n<0||h&&r-o.current>=F},e=function(n){return f.current=null,x&&l.current?r(n):(l.current=v.current=null,m.current)},c=function r(){var c=Date.now();if(t(c))return e(c);if(g.current){var i=u-(c-a.current),f=h?Math.min(i,F-(c-o.current)):i;n(r,f)}},A=function(){if(p||y){var e=Date.now(),d=t(e);if(l.current=[].slice.call(arguments),v.current=i,a.current=e,d){if(!f.current&&g.current)return o.current=a.current,n(c,u),s?r(a.current):m.current;if(h)return n(c,u),r(a.current)}return f.current||n(c,u),m.current}};return A.cancel=function(){f.current&&(w?cancelAnimationFrame(f.current):clearTimeout(f.current)),o.current=0,l.current=a.current=v.current=f.current=null},A.isPending=function(){return!!f.current},A.flush=function(){return f.current?e(Date.now()):m.current},A},[s,h,u,F,x,w,p,y]);return A}function i(r,n){return r===n}function a(r,n){return n}function o(n,t,o){var f=o&&o.equalityFn||i,l=e(a,n),v=l[0],m=l[1],d=c(u(function(r){return m(r)},[m]),t,o),g=r(n);return f(g.current,n)||(d(n),g.current=n),[v,d]}function f(r,n,t){var e=void 0===t?{}:t,u=e.leading,i=e.trailing;return c(r,n,{maxWait:n,leading:void 0===u||u,trailing:void 0===i||i})}export{o as useDebounce,c as useDebouncedCallback,f as useThrottledCallback};\n//# sourceMappingURL=index.module.js.map\n","import {\n useState,\n useRef,\n MouseEventHandler,\n KeyboardEventHandler,\n ReactEventHandler,\n Fragment,\n useEffect,\n} from \"react\";\n\nimport { Position, DraggableData } from \"react-rnd\";\n\nimport { Button } from \"./Button\";\nimport { Crosshairs } from \"./Crosshairs\";\nimport { InfoDialog } from \"./InfoDialog\";\nimport { LabelDialog } from \"./LabelDialog\";\nimport { VerifyDialog } from \"./VerifyDialog\";\nimport { FormElement } from \"./FormElement\";\nimport { FormElementBox } from \"./FormElementBox\";\nimport { BoundingBox, BoundingBoxType } from \"./BoundingBox\";\nimport { Annotation } from \"../types/Annotation\";\nimport { FalsePositive } from \"../types/FalsePositive\";\nimport { ReactZoomPanPinchRef, TransformComponent, TransformWrapper } from \"react-zoom-pan-pinch\";\nimport { useDebouncedCallback } from \"use-debounce\";\n\ninterface EditorState {\n createMode: boolean;\n drawingMode: boolean;\n showBoxes: boolean;\n drawStartX: number;\n drawStartY: number;\n selectedBox?: string;\n showLabeler: boolean;\n selectedLabel: string;\n difficult: boolean;\n height: number;\n width: number;\n showHelp: boolean;\n showVerify: boolean;\n showDelete: boolean;\n showTutorial: boolean;\n showConfirmDeleteFalsePositive: boolean;\n}\n\ninterface IImageAnnotationProps {\n annotations: Annotation[];\n suggestions: Annotation[];\n falsePositives: FalsePositive[];\n nextImage: () => void;\n save: (\n annotations: Annotation[],\n deleteFalsePositive: boolean,\n verified: string[],\n ) => void;\n delete: () => void;\n back: () => void;\n imageUrl: string;\n labels: string[];\n userAnnotationCount: number;\n}\n\n/**\n * A image annotation component.\n * @component\n * @params props - Component props.\n * @param props.annotations - Bounding boxes\n * @param props.save - Callback for the save button.\n */\nconst ImageAnnotator = (props: IImageAnnotationProps) => {\n const shortcuts = [\n { codes: [\"?\"], action: \"Shortcut help\" },\n { codes: [\"w\"], action: \"Add Box\" },\n { codes: [\"d\"], action: \"Mark Difficult\" },\n { codes: [\"s\"], action: \"Cycle Label\" },\n { codes: [\"Tab\"], action: \"Select Next Box\" },\n { codes: [\"Del\"], action: \"Delete Box\" },\n { codes: [\"Esc\"], action: \"Deselect/Cancel\" },\n { codes: [\"← ↑ → ↓\"], action: \"Move Box\" },\n { codes: [\"Shift\", \"← ↑ → ↓\"], action: \"Resize Box\" },\n { codes: [\"f\"], action: \"Toggle Unselected Boxes\" },\n { codes: [\"Spacebar\"], action: \"Verify and Save\" },\n ];\n\n const [bboxes, setBBoxes] = useState<Annotation[]>([]);\n\n const [fpboxes, setFPBoxes] = useState<FalsePositive[]>([]);\n\n const [state, setState] = useState<EditorState>({\n createMode: false,\n drawingMode: false,\n showBoxes: true,\n showLabeler: false,\n showHelp: false,\n showVerify: false,\n showDelete: false,\n showConfirmDeleteFalsePositive: false,\n showTutorial: props.userAnnotationCount === 0,\n drawStartX: 0,\n drawStartY: 0,\n selectedLabel: props.labels[0],\n difficult: false,\n width: 1,\n height: 1,\n });\n\n const ref = useRef<HTMLImageElement>(null);\n\n const editorRef = useRef<HTMLDivElement>(null);\n\n const transformRef = useRef<ReactZoomPanPinchRef>(null);\n\n const resize = () => {\n let adjustedZoom = 4;\n const naturalHeight = ref.current?.naturalHeight ?? 0;\n const naturalWidth = ref.current?.naturalWidth ?? 0;\n const desiredHeight = Math.round(naturalHeight * adjustedZoom);\n const editorHeight = editorRef.current?.getBoundingClientRect().height ?? 0;\n\n if (desiredHeight > editorHeight - 10) {\n adjustedZoom = (editorHeight - 10) / naturalHeight;\n }\n\n const desiredWidth = Math.round(naturalWidth * adjustedZoom);\n const editorWidth = editorRef.current?.getBoundingClientRect().width ?? 0;\n\n if (desiredWidth > editorWidth - 10) {\n adjustedZoom = (editorWidth - 10) / naturalWidth;\n }\n\n setState({\n ...state,\n width: Math.round(naturalWidth * adjustedZoom),\n height: Math.round(naturalHeight * adjustedZoom),\n });\n }\n\n const handleResize = useDebouncedCallback(() => {\n resize()\n }, 200);\n\n useEffect(() => {\n window.addEventListener('resize', handleResize);\n editorRef.current?.parentElement?.focus();\n\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, [handleResize]);\n \n const onResizeStop = (\n elem: HTMLElement,\n position: Position,\n boxId: string,\n ) => {\n setBBoxes((prev) =>\n prev.map((a) => {\n if (a.id === boxId) {\n return {\n ...a,\n x: position.x / state.width,\n y: position.y / state.height,\n w: elem.offsetWidth / state.width,\n h: elem.offsetHeight / state.height,\n };\n }\n return a;\n }),\n );\n };\n const onDragStop = (d: DraggableData, boxId: string) => {\n setBBoxes((prev) =>\n prev.map((a) => {\n if (a.id === boxId) {\n return {\n ...a,\n x: d.x / state.width,\n y: d.y / state.height,\n };\n }\n return a;\n }),\n );\n };\n\n const onMouseDown: MouseEventHandler<HTMLImageElement> = (e) => {\n if (state.createMode) {\n const scale = transformRef.current?.instance.transformState.scale ?? 1;\n const bounds = ref.current?.getBoundingClientRect();\n const x =\n (e.clientX - (bounds?.left ?? 0)) / scale /\n state.width;\n const y =\n (e.clientY - (bounds?.top ?? 0)) / scale /\n state.height;\n\n setState({\n ...state,\n drawingMode: true,\n drawStartX: x,\n drawStartY: y,\n selectedBox: \"draft\",\n });\n setBBoxes((prev) => [\n ...prev,\n {\n id: \"draft\",\n x,\n y,\n w: 0.0,\n h: 0.0,\n },\n ]);\n } else {\n setState({ ...state, selectedBox: undefined });\n }\n };\n\n const onMouseUp: MouseEventHandler<HTMLImageElement> = (e) => {\n if (state.drawingMode) {\n const newId = Date.now().toString();\n setState({\n ...state,\n drawingMode: false,\n createMode: false,\n selectedBox: newId,\n });\n setBBoxes((prev) =>\n prev.reduce<Annotation[]>((out, a) => {\n if (a.id === \"draft\") {\n const scale = transformRef.current?.instance.transformState.scale ?? 1;\n const bounds = ref.current?.getBoundingClientRect();\n const x =\n (e.clientX - (bounds?.left ?? 0)) / scale /\n state.width;\n const y =\n (e.clientY - (bounds?.top ?? 0)) / scale /\n state.height;\n\n if (\n Math.min(\n Math.abs(state.drawStartX - x),\n Math.abs(state.drawStartY - y),\n ) > 0.001\n ) {\n let left = Math.min(state.drawStartX, x);\n let top = Math.min(state.drawStartY, y);\n let width = Math.abs(state.drawStartX - x);\n let height = Math.abs(state.drawStartY - y);\n if (left < 0) {\n width -= Math.abs(left);\n left = 0;\n }\n if (top < 0) {\n height -= Math.abs(top);\n top = 0;\n }\n out.push({\n ...a,\n id: newId,\n label: state.selectedLabel,\n difficult: false,\n x: left,\n y: top,\n w: Math.min(1.0 - left, width),\n h: Math.min(1.0 - top, height),\n });\n }\n } else {\n out.push(a);\n }\n return out;\n }, []),\n );\n }\n };\n\n const onMouseMove: MouseEventHandler<HTMLImageElement> = (e) => {\n if (state.drawingMode) {\n setBBoxes((prev) =>\n prev.map((a) => {\n if (a.id === \"draft\") {\n const scale = transformRef.current?.instance.transformState.scale ?? 1;\n const bounds = ref.current?.getBoundingClientRect();\n const x =\n (e.pageX - (bounds?.left ?? 0)) / scale /\n state.width;\n const y =\n (e.pageY - (bounds?.top ?? 0)) / scale /\n state.height;\n\n return {\n ...a,\n x: Math.min(state.drawStartX, x),\n y: Math.min(state.drawStartY, y),\n w: Math.abs(state.drawStartX - x),\n h: Math.abs(state.drawStartY - y),\n };\n }\n return a;\n }),\n );\n }\n };\n\n const clickCreate: MouseEventHandler<HTMLButtonElement> = () => {\n setState({ ...state, createMode: !state.createMode });\n };\n\n const onClickBBox = (boxId: string) => {\n const selectedBox = bboxes.find((b) => b.id === boxId);\n setState({\n ...state,\n selectedBox: boxId,\n selectedLabel: selectedBox?.label ?? state.selectedLabel,\n difficult: selectedBox?.difficult ?? state.difficult,\n });\n };\n\n const moveBox = (boxId: string, vertical: number, horizontal: number) => {\n setBBoxes((prev) =>\n prev.map((a) => {\n if (a.id === boxId) {\n return {\n ...a,\n x: Math.min(\n 1.0 - a.w,\n Math.max(0.0, a.x + horizontal / state.width),\n ),\n y: Math.min(\n 1.0 - a.h,\n Math.max(0.0, a.y + vertical / state.height),\n ),\n };\n }\n return a;\n }),\n );\n };\n\n const resizeBox = (boxId: string, vertical: number, horizontal: number) => {\n setBBoxes((prev) =>\n prev.map((a) => {\n if (a.id === boxId) {\n return {\n ...a,\n w: Math.min(1.0 - a.x, a.w + horizontal / state.width),\n h: Math.min(1.0 - a.y, a.h + vertical / state.height),\n };\n }\n return a;\n }),\n );\n };\n\n const toggleDifficult = (boxId: string) => {\n setBBoxes((prev) =>\n prev.map((a) => {\n if (a.id === boxId) {\n return {\n ...a,\n difficult: !a.difficult,\n };\n }\n return a;\n }),\n );\n };\n\n const cycleLabel = (boxId: string, reverse = false) => {\n const currentLabelIndex = props.labels.findIndex(\n (label) => state.selectedLabel === label,\n );\n const lastIndex = props.labels.length - 1;\n\n let newIndex = 0;\n if (reverse) {\n newIndex = currentLabelIndex === 0 ? lastIndex : currentLabelIndex - 1;\n } else {\n newIndex = currentLabelIndex === lastIndex ? 0 : currentLabelIndex + 1;\n }\n const newLabel = props.labels[newIndex];\n setBBoxes((prev) =>\n prev.map((a) => {\n if (a.id === boxId) {\n return {\n ...a,\n label: newLabel,\n };\n }\n return a;\n }),\n );\n setState({ ...state, selectedLabel: newLabel });\n };\n\n const deleteBox = (boxId: string) => {\n setBBoxes((prev) => prev.filter((a) => a.id !== boxId));\n };\n\n const deleteFP = (boxId: string) => {\n setFPBoxes((prev) => prev.filter((a) => a.id !== boxId));\n };\n\n const getFPLabel = (boxId: string) => {\n return fpboxes.find((box) => box.id === boxId)?.label;\n };\n\n const getBox = (boxId: string) => {\n return bboxes.find((box) => box.id === boxId);\n };\n\n const nextBox = (boxId?: string) => {\n if (!boxId) {\n return bboxes[0].id;\n }\n const currentIndex = bboxes.findIndex((box) => box.id === boxId);\n if (currentIndex === bboxes.length - 1) {\n return bboxes[0].id;\n } else {\n return bboxes[currentIndex + 1].id;\n }\n };\n\n const stepSize = 5 / (transformRef.current?.instance.transformState.scale ?? 1);\n const onKeyDown: KeyboardEventHandler<HTMLDivElement> = (e) => {\n if (e.code === \"Escape\") {\n if (state.createMode) {\n setState({ ...state, createMode: false });\n } else {\n setState({ ...state, selectedBox: undefined });\n }\n }\n if (e.code === \"KeyW\") {\n if (!state.createMode) {\n setState({ ...state, createMode: true, selectedBox: undefined });\n } else {\n setState({ ...state, createMode: false });\n }\n }\n if (e.code === \"KeyF\") {\n setState({ ...state, showBoxes: !state.showBoxes });\n }\n if (e.code === \"KeyD\") {\n if (state.selectedBox) {\n toggleDifficult(state.selectedBox);\n }\n }\n if (e.code === \"KeyS\") {\n if (state.selectedBox) {\n cycleLabel(state.selectedBox, e.shiftKey);\n }\n }\n if (e.code === \"Delete\" && state.selectedBox) {\n deleteBox(state.selectedBox);\n setState({ ...state, selectedBox: undefined });\n }\n if (e.code === \"Tab\") {\n const next = nextBox(state.selectedBox);\n const box = getBox(next);\n setState({\n ...state,\n selectedBox: next,\n selectedLabel: box?.label ?? state.selectedLabel,\n });\n e.preventDefault();\n }\n if (e.code === \"Space\") {\n props.save(bboxes, fpboxes.length === 0, props.labels);\n }\n if (e.code === \"Slash\" && e.shiftKey) {\n setState({ ...state, showHelp: true });\n }\n if (state.selectedBox) {\n if (e.code === \"ArrowLeft\") {\n if (e.shiftKey) {\n resizeBox(state.selectedBox, 0, -stepSize);\n } else {\n moveBox(state.selectedBox, 0, -stepSize);\n }\n }\n if (e.code === \"ArrowRight\") {\n if (e.shiftKey) {\n resizeBox(state.selectedBox, 0, stepSize);\n } else {\n moveBox(state.selectedBox, 0, stepSize);\n }\n }\n if (e.code === \"ArrowUp\") {\n if (e.shiftKey) {\n resizeBox(state.selectedBox, -stepSize, 0);\n } else {\n moveBox(state.selectedBox, -stepSize, 0);\n }\n }\n if (e.code === \"ArrowDown\") {\n if (e.shiftKey) {\n resizeBox(state.selectedBox, stepSize, 0);\n } else {\n moveBox(state.selectedBox, stepSize, 0);\n }\n }\n }\n };\n\n const onLoad: ReactEventHandler<HTMLImageElement> = (_e) => {\n resize();\n\n setBBoxes(\n props.annotations\n .concat(props.suggestions)\n .sort((a, b) => b.w * b.h - a.w * a.h),\n );\n setFPBoxes(props.falsePositives.sort((a, b) => b.w * b.h - a.w * a.h));\n };\n\n const onSaveLabel: MouseEventHandler<HTMLButtonElement> = () => {\n setState({ ...state, showLabeler: false });\n setBBoxes((prev) =>\n prev.map((a) => {\n if (a.id === state.selectedBox) {\n return {\n ...a,\n label: state.selectedLabel,\n difficult: state.difficult,\n };\n }\n return a;\n }),\n );\n };\n\n const onCancelLabel = () => {\n setState({ ...state, showLabeler: false });\n setBBoxes((prev) => prev.filter((a) => a.label));\n };\n\n const defaultZIndex = state.showBoxes ? 0 : -1;\n\n return (\n <>\n <TransformWrapper ref={transformRef} disabled={state.createMode || state.drawingMode}>\n {({ zoomIn, zoomOut }) => (\n <div\n className=\"flex h-screen min-w-[600px] flex-col overflow-hidden bg-slate-900\"\n onKeyDown={onKeyDown}\n tabIndex={0}\n >\n <div className=\"flex flex-initial bg-slate-300 p-1\">\n <div className=\"flex-initial\">\n <button type=\"button\" onClick={props.back}>\n <Button secondary sm>\n Back\n </Button>\n </button>\n </div>\n <div className=\"flex flex-auto justify-center\">\n <button\n type=\"button\"\n onClick={() => {\n zoomOut();\n }}\n >\n <Button>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-6 w-6\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n d=\"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM13 10H7\"\n />\n </svg>\n </Button>\n </button>\n <button\n type=\"button\"\n onClick={() => {\n zoomIn();\n }}\n >\n <Button>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-6 w-6\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n d=\"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v3m0 0v3m0-3h3m-3 0H7\"\n />\n </svg>\n </Button>\n </button>\n <button type=\"button\" onClick={clickCreate}>\n <Button secondary sm>\n Add (w)\n </Button>\n </button>\n </div>\n <div className=\"flex-initial\">\n <button\n onClick={() => {\n setState({ ...state, showVerify: true });\n }}\n >\n <Button sm>Verify &amp; Save</Button>\n </button>\n <button\n onClick={() => {\n props.save(bboxes, fpboxes.length === 0, []);\n }}\n >\n <Button green sm>\n Save\n </Button>\n </button>\n <button\n onClick={() => {\n setState({ ...state, showDelete: true });\n }}\n >\n <Button red sm>\n Delete\n </Button>\n </button>\n <button\n onClick={() => {\n setState({ ...state, showHelp: true });\n }}\n >\n <Button sm secondary>\n ?\n </Button>\n </button>\n </div>\n </div>\n <div\n ref={editorRef}\n className=\"grid flex-auto place-content-center\"\n >\n <TransformComponent>\n <div\n className=\"grid place-content-center\"\n onMouseDown={onMouseDown}\n onMouseUp={onMouseUp}\n onMouseMove={onMouseMove}\n \n >\n <img\n ref={ref}\n className=\"col-start-1 row-start-1 h-full w-full\"\n alt=\"annotate\"\n src={props.imageUrl}\n onLoad={onLoad}\n style={{\n width: state.width,\n height: state.height,\n }}\n />\n {fpboxes.map((box) => (\n <BoundingBox\n type={BoundingBoxType.falsePositive}\n label={box.label ?? \"\"}\n key={box.id}\n zIndex={box.id === state.selectedBox ? 1 : defaultZIndex}\n x={box.x * state.width}\n y={box.y * state.height}\n w={box.w * state.width}\n h={box.h * state.height}\n initialScale={transformRef.current?.instance.transformState.scale}\n selected={box.id === state.selectedBox}\n onMouseDown={(e: { stopPropagation: () => void }) => {\n if (!state.createMode) {\n onClickBBox(box.id);\n e.stopPropagation();\n }\n }}\n onClickDelete={() => {\n setState({\n ...state,\n showConfirmDeleteFalsePositive: true,\n });\n }}\n />\n ))}\n {bboxes.map((box) => (\n <BoundingBox\n type={\n box.suggestion\n ? BoundingBoxType.suggestion\n : BoundingBoxType.truePositive\n }\n label={box.label ?? \"\"}\n difficult={box.difficult}\n key={box.id}\n zIndex={box.id === state.selectedBox ? 1 : defaultZIndex}\n x={box.x * state.width}\n y={box.y * state.height}\n w={box.w * state.width}\n h={box.h * state.height}\n initialScale={transformRef.current?.instance.transformState.scale}\n selected={box.id === state.selectedBox}\n onMouseDown={(e: { stopPropagation: () => void }) => {\n if (!state.createMode) {\n onClickBBox(box.id);\n e.stopPropagation();\n }\n }}\n onDragStop={(_e, d) => {\n onDragStop(d, box.id);\n }}\n onResizeStop={(_e, _d, r: HTMLElement, _delta, p) => {\n onResizeStop(r, p, box.id);\n }}\n onClickDelete={() => {\n deleteBox(box.id);\n }}\n onClickEdit={() => {\n setState({ ...state, showLabeler: true });\n }}\n />\n ))}\n <Crosshairs\n className=\"col-start-1 row-start-1\"\n show={state.createMode && !state.drawingMode}\n />\n </div>\n </TransformComponent>\n </div>\n </div>\n )}\n </TransformWrapper>\n <LabelDialog\n title=\"Annotate\"\n show={state.showLabeler}\n cancelText=\"Cancel\"\n button={\n <button type=\"button\" onClick={onSaveLabel}>\n <Button sm green>\n Save\n </Button>\n </button>\n }\n handleCancel={onCancelLabel}\n >\n <div className=\"my-2 grid grid-cols-1 gap-y-2\">\n <FormElement>\n <select\n value={state.selectedLabel}\n onChange={(e) => {\n setState({ ...state, selectedLabel: e.target.value });\n }}\n >\n {props.labels.map((o) => (\n <option key={o} value={o}>\n {o}\n </option>\n ))}\n </select>\n </FormElement>\n <FormElementBox htmlFor=\"difficult\" text=\"Difficult?\">\n <input\n id=\"difficult\"\n type=\"checkbox\"\n checked={state.difficult}\n onChange={(e) => {\n setState({ ...state, difficult: e.target.checked });\n }}\n />\n </FormElementBox>\n </div>\n </LabelDialog>\n <InfoDialog\n title=\"Keyboard shortcuts\"\n show={state.showHelp}\n handleClose={() => {\n setState({ ...state, showHelp: false });\n }}\n >\n <div className=\"grid w-full grid-cols-2 place-content-center gap-2 p-5\">\n {shortcuts.map((s) => (\n <Fragment key={s.action}>\n <div>{s.action}</div>\n <div className=\"justify-self-end\">\n {s.codes\n .map<React.ReactNode>((c) => (\n <span\n key={c}\n className=\"rounded-md bg-slate-100 p-1 font-mono text-xs shadow-inner\"\n >\n {c}\n </span>\n ))\n .reduce((prev, curr) => [prev, \" + \", curr])}\n </div>\n </Fragment>\n ))}\n </div>\n </InfoDialog>\n <VerifyDialog\n title=\"Are all objects in this image labeled?\"\n description=\" \"\n handleCancel={() => {\n setState({ ...state, showVerify: false });\n }}\n show={state.showVerify}\n cancelText=\"Cancel\"\n button={\n <button\n type=\"button\"\n onClick={() => {\n props.save(bboxes, fpboxes.length === 0, props.labels);\n setState({ ...state, showVerify: false });\n }}\n >\n <Button sm green>\n Yes, all objects are labeled\n </Button>\n </button>\n }\n >\n <ul className=\"list-inside list-disc\">\n {props.labels.map((o) => (\n <li key={o}>{o}</li>\n ))}\n </ul>\n </VerifyDialog>\n <VerifyDialog\n title=\"Are you sure you want to delete this image?\"\n description=\"\"\n handleCancel={() => {\n setState({ ...state, showDelete: false });\n }}\n show={state.showDelete}\n cancelText=\"Cancel\"\n button={\n <button\n type=\"button\"\n onClick={() => {\n props.delete();\n setState({ ...state, showDelete: false });\n }}\n >\n <Button sm red>\n Yes, permanently delete\n </Button>\n </button>\n }\n >\n This cannot be undone.\n </VerifyDialog>\n <VerifyDialog\n title=\"Are you sure you want to delete this reported false positive?\"\n description=\" \"\n maxWidthClass=\"max-w-xl\"\n handleCancel={() => {\n setState({ ...state, showConfirmDeleteFalsePositive: false });\n }}\n show={state.showConfirmDeleteFalsePositive}\n cancelText=\"Cancel\"\n button={\n <button\n type=\"button\"\n onClick={() => {\n if (state.selectedBox) {\n deleteFP(state.selectedBox);\n }\n setState({\n ...state,\n showConfirmDeleteFalsePositive: false,\n selectedBox: undefined,\n });\n }}\n >\n <Button sm red>\n Do not teach my model that this is not a{\" \"}\n {state.selectedBox ? getFPLabel(state.selectedBox) : \" \"}\n </Button>\n </button>\n }\n >\n <p>\n False positives submitted from Frigate are used to improve your model\n and should not be deleted unless you submitted them accidentally.\n </p>\n </VerifyDialog>\n </>\n );\n};\n\nexport { ImageAnnotator };\n"],"names":["c","e","u","i","a","r","o","f","l","v","m","d","g","p","w","s","x","h","y","F","n","A","t","ImageAnnotator","props","shortcuts","bboxes","setBBoxes","useState","fpboxes","setFPBoxes","state","setState","ref","useRef","editorRef","transformRef","resize","adjustedZoom","naturalHeight","_a","naturalWidth","_b","desiredHeight","editorHeight","_c","desiredWidth","editorWidth","_d","handleResize","useDebouncedCallback","useEffect","onResizeStop","elem","position","boxId","prev","onDragStop","onMouseDown","scale","bounds","onMouseUp","newId","out","left","top","width","height","onMouseMove","clickCreate","onClickBBox","selectedBox","b","moveBox","vertical","horizontal","resizeBox","toggleDifficult","cycleLabel","reverse","currentLabelIndex","label","lastIndex","newIndex","newLabel","deleteBox","deleteFP","getFPLabel","box","getBox","nextBox","currentIndex","stepSize","onKeyDown","next","onLoad","_e","onSaveLabel","onCancelLabel","defaultZIndex","jsxs","Fragment","jsx","TransformWrapper","zoomIn","zoomOut","Button","TransformComponent","BoundingBox","BoundingBoxType","_delta","Crosshairs","LabelDialog","FormElement","FormElementBox","InfoDialog","curr","VerifyDialog"],"mappings":";;;;;;;;;;;AAA4F,SAASA,GAAEC,GAAEC,GAAEF,GAAE;AAAC,MAAIG,IAAE,MAAKC,IAAEC,EAAE,IAAI,GAAEC,IAAED,EAAE,CAAC,GAAEE,IAAEF,EAAE,IAAI,GAAEG,IAAEH,EAAE,EAAE,GAAEI,IAAEJ,EAAG,GAACK,IAAEL,KAAIM,IAAEN,EAAEJ,CAAC,GAAEW,IAAEP,EAAE,EAAE;AAAE,EAAAM,EAAE,UAAQV;AAAE,MAAIY,IAAe,OAAO,SAApB,KAA2BC,IAAE,CAACZ,KAAOA,MAAJ,KAAOW;AAAE,MAAe,OAAOZ,KAAnB,WAAqB,OAAM,IAAI,UAAU,qBAAqB;AAAE,EAAAC,IAAE,CAACA,KAAG;AAAE,MAAIa,IAAE,CAAC,EAAEf,IAAEA,KAAG,IAAI,SAAQgB,IAAE,EAAE,cAAahB,MAAI,CAAC,CAACA,EAAE,UAASiB,IAAE,aAAYjB,GAAEkB,IAAE,sBAAqBlB,KAAG,CAAC,CAACA,EAAE,kBAAiBmB,IAAEF,IAAE,KAAK,IAAI,CAACjB,EAAE,WAAS,GAAEE,CAAC,IAAE;AAAKkB,EAAAA,GAAE,WAAU;AAAC,WAAOR,EAAE,UAAQ,IAAG,WAAU;AAAC,MAAAA,EAAE,UAAQ;AAAA,IAAE;AAAA,EAAC,GAAE,CAAE,CAAA;AAAE,MAAIS,IAAEC,GAAE,WAAU;AAAC,QAAIjB,IAAE,SAASA,GAAE;AAAC,UAAIe,IAAEZ,EAAE,SAAQc,IAAE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QACA,MAAMA,EAAM;AAAA,QACZ,YAAW;AAAA,QACX,QACE,gBAAAuE;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,SAAS,MAAM;AACb,cAAA9E,EAAM,OAAO,GACbQ,EAAS,EAAE,GAAGD,GAAO,YAAY,GAAO,CAAA;AAAA,YAC1C;AAAA,YAEA,4BAAC2E,GAAO,EAAA,IAAE,IAAC,KAAG,IAAC,UAEf,2BAAA;AAAA,UAAA;AAAA,QACF;AAAA,QAEH,UAAA;AAAA,MAAA;AAAA,IAED;AAAA,IACA,gBAAAJ;AAAA,MAACe;AAAA,MAAA;AAAA,QACC,OAAM;AAAA,QACN,aAAY;AAAA,QACZ,eAAc;AAAA,QACd,cAAc,MAAM;AAClB,UAAArF,EAAS,EAAE,GAAGD,GAAO,gCAAgC,GAAO,CAAA;AAAA,QAC9D;AAAA,QACA,MAAMA,EAAM;AAAA,QACZ,YAAW;AAAA,QACX,QACE,gBAAAuE;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,SAAS,MAAM;AACb,cAAIvE,EAAM,eACRuD,EAASvD,EAAM,WAAW,GAEnBC,EAAA;AAAA,gBACP,GAAGD;AAAA,gBACH,gCAAgC;AAAA,gBAChC,aAAa;AAAA,cAAA,CACd;AAAA,YACH;AAAA,YAEA,UAAC,gBAAAqE,EAAAM,GAAA,EAAO,IAAE,IAAC,KAAG,IAAC,UAAA;AAAA,cAAA;AAAA,cAC4B;AAAA,cACxC3E,EAAM,cAAcwD,EAAWxD,EAAM,WAAW,IAAI;AAAA,YAAA,GACvD;AAAA,UAAA;AAAA,QACF;AAAA,QAGF,UAAA,gBAAAuE,EAAC,OAAE,UAGH,0IAAA,CAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"ImageAnnotator.js","sources":["../../node_modules/use-debounce/dist/index.module.js","../../src/components/ImageAnnotator.tsx"],"sourcesContent":["import{useRef as r,useEffect as n,useMemo as t,useReducer as e,useCallback as u}from\"react\";function c(e,u,c){var i=this,a=r(null),o=r(0),f=r(null),l=r([]),v=r(),m=r(),d=r(e),g=r(!0);d.current=e;var p=\"undefined\"!=typeof window,w=!u&&0!==u&&p;if(\"function\"!=typeof e)throw new TypeError(\"Expected a function\");u=+u||0;var s=!!(c=c||{}).leading,x=!(\"trailing\"in c)||!!c.trailing,h=\"maxWait\"in c,y=\"debounceOnServer\"in c&&!!c.debounceOnServer,F=h?Math.max(+c.maxWait||0,u):null;n(function(){return g.current=!0,function(){g.current=!1}},[]);var A=t(function(){var r=function(r){var n=l.current,t=v.current;return l.current=v.current=null,o.current=r,m.current=d.current.apply(t,n)},n=function(r,n){w&&cancelAnimationFrame(f.current),f.current=w?requestAnimationFrame(r):setTimeout(r,n)},t=function(r){if(!g.current)return!1;var n=r-a.current;return!a.current||n>=u||n<0||h&&r-o.current>=F},e=function(n){return f.current=null,x&&l.current?r(n):(l.current=v.current=null,m.current)},c=function r(){var c=Date.now();if(t(c))return e(c);if(g.current){var i=u-(c-a.current),f=h?Math.min(i,F-(c-o.current)):i;n(r,f)}},A=function(){if(p||y){var e=Date.now(),d=t(e);if(l.current=[].slice.call(arguments),v.current=i,a.current=e,d){if(!f.current&&g.current)return o.current=a.current,n(c,u),s?r(a.current):m.current;if(h)return n(c,u),r(a.current)}return f.current||n(c,u),m.current}};return A.cancel=function(){f.current&&(w?cancelAnimationFrame(f.current):clearTimeout(f.current)),o.current=0,l.current=a.current=v.current=f.current=null},A.isPending=function(){return!!f.current},A.flush=function(){return f.current?e(Date.now()):m.current},A},[s,h,u,F,x,w,p,y]);return A}function i(r,n){return r===n}function a(r,n){return n}function o(n,t,o){var f=o&&o.equalityFn||i,l=e(a,n),v=l[0],m=l[1],d=c(u(function(r){return m(r)},[m]),t,o),g=r(n);return f(g.current,n)||(d(n),g.current=n),[v,d]}function f(r,n,t){var e=void 0===t?{}:t,u=e.leading,i=e.trailing;return c(r,n,{maxWait:n,leading:void 0===u||u,trailing:void 0===i||i})}export{o as useDebounce,c as useDebouncedCallback,f as useThrottledCallback};\n//# sourceMappingURL=index.module.js.map\n","import {\n useState,\n useRef,\n MouseEventHandler,\n KeyboardEventHandler,\n ReactEventHandler,\n Fragment,\n useEffect,\n} from \"react\";\n\nimport { Position, DraggableData } from \"react-rnd\";\n\nimport { Button } from \"./Button\";\nimport { Crosshairs } from \"./Crosshairs\";\nimport { InfoDialog } from \"./InfoDialog\";\nimport { LabelDialog } from \"./LabelDialog\";\nimport { VerifyDialog } from \"./VerifyDialog\";\nimport { BoundingBox, BoundingBoxType } from \"./BoundingBox\";\nimport { Annotation } from \"../types/Annotation\";\nimport { FalsePositive } from \"../types/FalsePositive\";\nimport { ReactZoomPanPinchRef, TransformComponent, TransformWrapper } from \"react-zoom-pan-pinch\";\nimport { useDebouncedCallback } from \"use-debounce\";\n\ninterface EditorState {\n createMode: boolean;\n drawingMode: boolean;\n showBoxes: boolean;\n drawStartX: number;\n drawStartY: number;\n selectedBox?: string;\n showLabeler: boolean;\n selectedLabel: string;\n difficult: boolean;\n height: number;\n width: number;\n showHelp: boolean;\n showVerify: boolean;\n showDelete: boolean;\n showTutorial: boolean;\n showConfirmDeleteFalsePositive: boolean;\n}\n\ninterface IImageAnnotationProps {\n annotations: Annotation[];\n suggestions: Annotation[];\n falsePositives: FalsePositive[];\n nextImage: () => void;\n save: (\n annotations: Annotation[],\n deleteFalsePositive: boolean,\n verified: string[],\n ) => void;\n delete: () => void;\n back: () => void;\n imageUrl: string;\n labels: string[];\n userAnnotationCount: number;\n}\n\n/**\n * A image annotation component.\n * @component\n * @params props - Component props.\n * @param props.annotations - Bounding boxes\n * @param props.save - Callback for the save button.\n */\nconst ImageAnnotator = (props: IImageAnnotationProps) => {\n const shortcuts = [\n { codes: [\"?\"], action: \"Shortcut help\" },\n { codes: [\"w\"], action: \"Add Box\" },\n { codes: [\"d\"], action: \"Mark Difficult\" },\n { codes: [\"s\"], action: \"Cycle Label\" },\n { codes: [\"Tab\"], action: \"Select Next Box\" },\n { codes: [\"Del\"], action: \"Delete Box\" },\n { codes: [\"Esc\"], action: \"Deselect/Cancel\" },\n { codes: [\"← ↑ → ↓\"], action: \"Move Box\" },\n { codes: [\"Shift\", \"← ↑ → ↓\"], action: \"Resize Box\" },\n { codes: [\"f\"], action: \"Toggle Unselected Boxes\" },\n { codes: [\"Spacebar\"], action: \"Verify and Save\" },\n ];\n\n const [bboxes, setBBoxes] = useState<Annotation[]>([]);\n\n const [fpboxes, setFPBoxes] = useState<FalsePositive[]>([]);\n\n const [state, setState] = useState<EditorState>({\n createMode: false,\n drawingMode: false,\n showBoxes: true,\n showLabeler: false,\n showHelp: false,\n showVerify: false,\n showDelete: false,\n showConfirmDeleteFalsePositive: false,\n showTutorial: props.userAnnotationCount === 0,\n drawStartX: 0,\n drawStartY: 0,\n selectedLabel: props.labels[0],\n difficult: false,\n width: 1,\n height: 1,\n });\n\n const ref = useRef<HTMLImageElement>(null);\n\n const editorRef = useRef<HTMLDivElement>(null);\n\n const transformRef = useRef<ReactZoomPanPinchRef>(null);\n\n const resize = () => {\n let adjustedZoom = 4;\n const naturalHeight = ref.current?.naturalHeight ?? 0;\n const naturalWidth = ref.current?.naturalWidth ?? 0;\n const desiredHeight = Math.round(naturalHeight * adjustedZoom);\n const editorHeight = editorRef.current?.getBoundingClientRect().height ?? 0;\n\n if (desiredHeight > editorHeight - 10) {\n adjustedZoom = (editorHeight - 10) / naturalHeight;\n }\n\n const desiredWidth = Math.round(naturalWidth * adjustedZoom);\n const editorWidth = editorRef.current?.getBoundingClientRect().width ?? 0;\n\n if (desiredWidth > editorWidth - 10) {\n adjustedZoom = (editorWidth - 10) / naturalWidth;\n }\n\n setState({\n ...state,\n width: Math.round(naturalWidth * adjustedZoom),\n height: Math.round(naturalHeight * adjustedZoom),\n });\n }\n\n const handleResize = useDebouncedCallback(() => {\n resize()\n }, 200);\n\n useEffect(() => {\n window.addEventListener('resize', handleResize);\n editorRef.current?.parentElement?.focus();\n\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, [handleResize]);\n \n const onResizeStop = (\n elem: HTMLElement,\n position: Position,\n boxId: string,\n ) => {\n setBBoxes((prev) =>\n prev.map((a) => {\n if (a.id === boxId) {\n return {\n ...a,\n x: position.x / state.width,\n y: position.y / state.height,\n w: elem.offsetWidth / state.width,\n h: elem.offsetHeight / state.height,\n };\n }\n return a;\n }),\n );\n };\n const onDragStop = (d: DraggableData, boxId: string) => {\n setBBoxes((prev) =>\n prev.map((a) => {\n if (a.id === boxId) {\n return {\n ...a,\n x: d.x / state.width,\n y: d.y / state.height,\n };\n }\n return a;\n }),\n );\n };\n\n const onMouseDown: MouseEventHandler<HTMLImageElement> = (e) => {\n if (state.createMode) {\n const scale = transformRef.current?.instance.transformState.scale ?? 1;\n const bounds = ref.current?.getBoundingClientRect();\n const x =\n (e.clientX - (bounds?.left ?? 0)) / scale /\n state.width;\n const y =\n (e.clientY - (bounds?.top ?? 0)) / scale /\n state.height;\n\n setState({\n ...state,\n drawingMode: true,\n drawStartX: x,\n drawStartY: y,\n selectedBox: \"draft\",\n });\n setBBoxes((prev) => [\n ...prev,\n {\n id: \"draft\",\n x,\n y,\n w: 0.0,\n h: 0.0,\n },\n ]);\n } else {\n setState({ ...state, selectedBox: undefined });\n }\n };\n\n const onMouseUp: MouseEventHandler<HTMLImageElement> = (e) => {\n if (state.drawingMode) {\n const newId = Date.now().toString();\n setState({\n ...state,\n drawingMode: false,\n createMode: false,\n selectedBox: newId,\n });\n setBBoxes((prev) =>\n prev.reduce<Annotation[]>((out, a) => {\n if (a.id === \"draft\") {\n const scale = transformRef.current?.instance.transformState.scale ?? 1;\n const bounds = ref.current?.getBoundingClientRect();\n const x =\n (e.clientX - (bounds?.left ?? 0)) / scale /\n state.width;\n const y =\n (e.clientY - (bounds?.top ?? 0)) / scale /\n state.height;\n\n if (\n Math.min(\n Math.abs(state.drawStartX - x),\n Math.abs(state.drawStartY - y),\n ) > 0.001\n ) {\n let left = Math.min(state.drawStartX, x);\n let top = Math.min(state.drawStartY, y);\n let width = Math.abs(state.drawStartX - x);\n let height = Math.abs(state.drawStartY - y);\n if (left < 0) {\n width -= Math.abs(left);\n left = 0;\n }\n if (top < 0) {\n height -= Math.abs(top);\n top = 0;\n }\n out.push({\n ...a,\n id: newId,\n label: state.selectedLabel,\n difficult: false,\n x: left,\n y: top,\n w: Math.min(1.0 - left, width),\n h: Math.min(1.0 - top, height),\n });\n }\n } else {\n out.push(a);\n }\n return out;\n }, []),\n );\n }\n };\n\n const onMouseMove: MouseEventHandler<HTMLImageElement> = (e) => {\n if (state.drawingMode) {\n setBBoxes((prev) =>\n prev.map((a) => {\n if (a.id === \"draft\") {\n const scale = transformRef.current?.instance.transformState.scale ?? 1;\n const bounds = ref.current?.getBoundingClientRect();\n const x =\n (e.pageX - (bounds?.left ?? 0)) / scale /\n state.width;\n const y =\n (e.pageY - (bounds?.top ?? 0)) / scale /\n state.height;\n\n return {\n ...a,\n x: Math.min(state.drawStartX, x),\n y: Math.min(state.drawStartY, y),\n w: Math.abs(state.drawStartX - x),\n h: Math.abs(state.drawStartY - y),\n };\n }\n return a;\n }),\n );\n }\n };\n\n const clickCreate: MouseEventHandler<HTMLButtonElement> = () => {\n setState({ ...state, createMode: !state.createMode });\n };\n\n const onClickBBox = (boxId: string) => {\n const selectedBox = bboxes.find((b) => b.id === boxId);\n setState({\n ...state,\n selectedBox: boxId,\n selectedLabel: selectedBox?.label ?? state.selectedLabel,\n difficult: selectedBox?.difficult ?? state.difficult,\n });\n };\n\n const moveBox = (boxId: string, vertical: number, horizontal: number) => {\n setBBoxes((prev) =>\n prev.map((a) => {\n if (a.id === boxId) {\n return {\n ...a,\n x: Math.min(\n 1.0 - a.w,\n Math.max(0.0, a.x + horizontal / state.width),\n ),\n y: Math.min(\n 1.0 - a.h,\n Math.max(0.0, a.y + vertical / state.height),\n ),\n };\n }\n return a;\n }),\n );\n };\n\n const resizeBox = (boxId: string, vertical: number, horizontal: number) => {\n setBBoxes((prev) =>\n prev.map((a) => {\n if (a.id === boxId) {\n return {\n ...a,\n w: Math.min(1.0 - a.x, a.w + horizontal / state.width),\n h: Math.min(1.0 - a.y, a.h + vertical / state.height),\n };\n }\n return a;\n }),\n );\n };\n\n const toggleDifficult = (boxId: string) => {\n setBBoxes((prev) =>\n prev.map((a) => {\n if (a.id === boxId) {\n return {\n ...a,\n difficult: !a.difficult,\n };\n }\n return a;\n }),\n );\n };\n\n const cycleLabel = (boxId: string, reverse = false) => {\n const currentLabelIndex = props.labels.findIndex(\n (label) => state.selectedLabel === label,\n );\n const lastIndex = props.labels.length - 1;\n\n let newIndex = 0;\n if (reverse) {\n newIndex = currentLabelIndex === 0 ? lastIndex : currentLabelIndex - 1;\n } else {\n newIndex = currentLabelIndex === lastIndex ? 0 : currentLabelIndex + 1;\n }\n const newLabel = props.labels[newIndex];\n setBBoxes((prev) =>\n prev.map((a) => {\n if (a.id === boxId) {\n return {\n ...a,\n label: newLabel,\n };\n }\n return a;\n }),\n );\n setState({ ...state, selectedLabel: newLabel });\n };\n\n const deleteBox = (boxId: string) => {\n setBBoxes((prev) => prev.filter((a) => a.id !== boxId));\n };\n\n const deleteFP = (boxId: string) => {\n setFPBoxes((prev) => prev.filter((a) => a.id !== boxId));\n };\n\n const getFPLabel = (boxId: string) => {\n return fpboxes.find((box) => box.id === boxId)?.label;\n };\n\n const getBox = (boxId: string) => {\n return bboxes.find((box) => box.id === boxId);\n };\n\n const nextBox = (boxId?: string) => {\n if (!boxId) {\n return bboxes[0].id;\n }\n const currentIndex = bboxes.findIndex((box) => box.id === boxId);\n if (currentIndex === bboxes.length - 1) {\n return bboxes[0].id;\n } else {\n return bboxes[currentIndex + 1].id;\n }\n };\n\n const stepSize = 5 / (transformRef.current?.instance.transformState.scale ?? 1);\n const onKeyDown: KeyboardEventHandler<HTMLDivElement> = (e) => {\n if (e.code === \"Escape\") {\n if (state.createMode) {\n setState({ ...state, createMode: false });\n } else {\n setState({ ...state, selectedBox: undefined });\n }\n }\n if (e.code === \"KeyW\") {\n if (!state.createMode) {\n setState({ ...state, createMode: true, selectedBox: undefined });\n } else {\n setState({ ...state, createMode: false });\n }\n }\n if (e.code === \"KeyF\") {\n setState({ ...state, showBoxes: !state.showBoxes });\n }\n if (e.code === \"KeyD\") {\n if (state.selectedBox) {\n toggleDifficult(state.selectedBox);\n }\n }\n if (e.code === \"KeyS\") {\n if (state.selectedBox) {\n cycleLabel(state.selectedBox, e.shiftKey);\n }\n }\n if (e.code === \"Delete\" && state.selectedBox) {\n deleteBox(state.selectedBox);\n setState({ ...state, selectedBox: undefined });\n }\n if (e.code === \"Tab\") {\n const next = nextBox(state.selectedBox);\n const box = getBox(next);\n setState({\n ...state,\n selectedBox: next,\n selectedLabel: box?.label ?? state.selectedLabel,\n });\n e.preventDefault();\n }\n if (e.code === \"Space\") {\n props.save(bboxes, fpboxes.length === 0, props.labels);\n }\n if (e.code === \"Slash\" && e.shiftKey) {\n setState({ ...state, showHelp: true });\n }\n if (state.selectedBox) {\n if (e.code === \"ArrowLeft\") {\n if (e.shiftKey) {\n resizeBox(state.selectedBox, 0, -stepSize);\n } else {\n moveBox(state.selectedBox, 0, -stepSize);\n }\n }\n if (e.code === \"ArrowRight\") {\n if (e.shiftKey) {\n resizeBox(state.selectedBox, 0, stepSize);\n } else {\n moveBox(state.selectedBox, 0, stepSize);\n }\n }\n if (e.code === \"ArrowUp\") {\n if (e.shiftKey) {\n resizeBox(state.selectedBox, -stepSize, 0);\n } else {\n moveBox(state.selectedBox, -stepSize, 0);\n }\n }\n if (e.code === \"ArrowDown\") {\n if (e.shiftKey) {\n resizeBox(state.selectedBox, stepSize, 0);\n } else {\n moveBox(state.selectedBox, stepSize, 0);\n }\n }\n }\n };\n\n const onLoad: ReactEventHandler<HTMLImageElement> = (_e) => {\n resize();\n\n setBBoxes(\n props.annotations\n .concat(props.suggestions)\n .sort((a, b) => b.w * b.h - a.w * a.h),\n );\n setFPBoxes(props.falsePositives.sort((a, b) => b.w * b.h - a.w * a.h));\n };\n\n const onSaveLabel: MouseEventHandler<HTMLButtonElement> = () => {\n setState({ ...state, showLabeler: false });\n setBBoxes((prev) =>\n prev.map((a) => {\n if (a.id === state.selectedBox) {\n return {\n ...a,\n label: state.selectedLabel,\n difficult: state.difficult,\n };\n }\n return a;\n }),\n );\n };\n\n const onCancelLabel = () => {\n setState({ ...state, showLabeler: false });\n setBBoxes((prev) => prev.filter((a) => a.label));\n };\n\n const defaultZIndex = state.showBoxes ? 0 : -1;\n\n return (\n <>\n <TransformWrapper ref={transformRef} disabled={state.createMode || state.drawingMode}>\n {({ zoomIn, zoomOut }) => (\n <div\n className=\"flex h-screen min-w-[600px] flex-col overflow-hidden bg-slate-900\"\n onKeyDown={onKeyDown}\n tabIndex={0}\n >\n <div className=\"flex flex-initial bg-slate-300 p-1\">\n <div className=\"flex-initial\">\n <button type=\"button\" onClick={props.back}>\n <Button secondary sm>\n Back\n </Button>\n </button>\n </div>\n <div className=\"flex flex-auto justify-center\">\n <button\n type=\"button\"\n onClick={() => {\n zoomOut();\n }}\n >\n <Button>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-6 w-6\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n d=\"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM13 10H7\"\n />\n </svg>\n </Button>\n </button>\n <button\n type=\"button\"\n onClick={() => {\n zoomIn();\n }}\n >\n <Button>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-6 w-6\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n d=\"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v3m0 0v3m0-3h3m-3 0H7\"\n />\n </svg>\n </Button>\n </button>\n <button type=\"button\" onClick={clickCreate}>\n <Button secondary sm>\n Add (w)\n </Button>\n </button>\n </div>\n <div className=\"flex-initial\">\n <button\n onClick={() => {\n setState({ ...state, showVerify: true });\n }}\n >\n <Button sm>Verify &amp; Save</Button>\n </button>\n <button\n onClick={() => {\n props.save(bboxes, fpboxes.length === 0, []);\n }}\n >\n <Button green sm>\n Save\n </Button>\n </button>\n <button\n onClick={() => {\n setState({ ...state, showDelete: true });\n }}\n >\n <Button red sm>\n Delete\n </Button>\n </button>\n <button\n onClick={() => {\n setState({ ...state, showHelp: true });\n }}\n >\n <Button sm secondary>\n ?\n </Button>\n </button>\n </div>\n </div>\n <div\n ref={editorRef}\n className=\"grid flex-auto place-content-center\"\n >\n <TransformComponent>\n <div\n className=\"grid place-content-center\"\n onMouseDown={onMouseDown}\n onMouseUp={onMouseUp}\n onMouseMove={onMouseMove}\n \n >\n <img\n ref={ref}\n className=\"col-start-1 row-start-1 h-full w-full\"\n alt=\"annotate\"\n src={props.imageUrl}\n onLoad={onLoad}\n style={{\n width: state.width,\n height: state.height,\n }}\n />\n {fpboxes.map((box) => (\n <BoundingBox\n type={BoundingBoxType.falsePositive}\n label={box.label ?? \"\"}\n key={box.id}\n zIndex={box.id === state.selectedBox ? 1 : defaultZIndex}\n x={box.x * state.width}\n y={box.y * state.height}\n w={box.w * state.width}\n h={box.h * state.height}\n initialScale={transformRef.current?.instance.transformState.scale}\n selected={box.id === state.selectedBox}\n onMouseDown={(e: { stopPropagation: () => void }) => {\n if (!state.createMode) {\n onClickBBox(box.id);\n e.stopPropagation();\n }\n }}\n onClickDelete={() => {\n setState({\n ...state,\n showConfirmDeleteFalsePositive: true,\n });\n }}\n />\n ))}\n {bboxes.map((box) => (\n <BoundingBox\n type={\n box.suggestion\n ? BoundingBoxType.suggestion\n : BoundingBoxType.truePositive\n }\n label={box.label ?? \"\"}\n difficult={box.difficult}\n key={box.id}\n zIndex={box.id === state.selectedBox ? 1 : defaultZIndex}\n x={box.x * state.width}\n y={box.y * state.height}\n w={box.w * state.width}\n h={box.h * state.height}\n initialScale={transformRef.current?.instance.transformState.scale}\n selected={box.id === state.selectedBox}\n onMouseDown={(e: { stopPropagation: () => void }) => {\n if (!state.createMode) {\n onClickBBox(box.id);\n e.stopPropagation();\n }\n }}\n onDragStop={(_e, d) => {\n onDragStop(d, box.id);\n }}\n onResizeStop={(_e, _d, r: HTMLElement, _delta, p) => {\n onResizeStop(r, p, box.id);\n }}\n onClickDelete={() => {\n deleteBox(box.id);\n }}\n onClickEdit={() => {\n setState({ ...state, showLabeler: true });\n }}\n />\n ))}\n <Crosshairs\n className=\"col-start-1 row-start-1 z-10\"\n show={state.createMode && !state.drawingMode}\n />\n </div>\n </TransformComponent>\n </div>\n </div>\n )}\n </TransformWrapper>\n <LabelDialog\n title=\"Annotate\"\n show={state.showLabeler}\n cancelText=\"Cancel\"\n button={\n <button type=\"button\" onClick={onSaveLabel}>\n <Button sm green>\n Save\n </Button>\n </button>\n }\n handleCancel={onCancelLabel}\n >\n <div className=\"my-2 grid grid-cols-1 gap-y-2\">\n <div>\n <select\n className=\"w-full rounded-md border-gray-300 shadow-sm focus:border-primary-300 focus:ring focus:ring-primary-200 focus:ring-opacity-50\"\n value={state.selectedLabel}\n onChange={(e) => {\n setState({ ...state, selectedLabel: e.target.value });\n }}\n >\n {props.labels.map((o) => (\n <option key={o} value={o}>\n {o}\n </option>\n ))}\n </select>\n </div>\n <div className=\"flex items-center\">\n <input\n id=\"difficult\"\n className=\"border-gray-300 text-primary-600 shadow-sm hover:border-gray-300 focus:border-primary-300 focus:ring focus:ring-primary-200 focus:ring-opacity-50 focus:ring-offset-0 rounded\"\n type=\"checkbox\"\n checked={state.difficult}\n onChange={(e) => {\n setState({ ...state, difficult: e.target.checked });\n }}\n />\n <label htmlFor=\"difficult\" className=\"ml-2\">\n Difficult?\n </label>\n </div>\n </div>\n </LabelDialog>\n <InfoDialog\n title=\"Keyboard shortcuts\"\n show={state.showHelp}\n handleClose={() => {\n setState({ ...state, showHelp: false });\n }}\n >\n <div className=\"grid w-full grid-cols-2 place-content-center gap-2 p-5\">\n {shortcuts.map((s) => (\n <Fragment key={s.action}>\n <div>{s.action}</div>\n <div className=\"justify-self-end\">\n {s.codes\n .map<React.ReactNode>((c) => (\n <span\n key={c}\n className=\"rounded-md bg-slate-100 p-1 font-mono text-xs shadow-inner\"\n >\n {c}\n </span>\n ))\n .reduce((prev, curr) => [prev, \" + \", curr])}\n </div>\n </Fragment>\n ))}\n </div>\n </InfoDialog>\n <VerifyDialog\n title=\"Are all objects in this image labeled?\"\n description=\" \"\n handleCancel={() => {\n setState({ ...state, showVerify: false });\n }}\n show={state.showVerify}\n cancelText=\"Cancel\"\n button={\n <button\n type=\"button\"\n onClick={() => {\n props.save(bboxes, fpboxes.length === 0, props.labels);\n setState({ ...state, showVerify: false });\n }}\n >\n <Button sm green>\n Yes, all objects are labeled\n </Button>\n </button>\n }\n >\n <ul className=\"list-inside list-disc\">\n {props.labels.map((o) => (\n <li key={o}>{o}</li>\n ))}\n </ul>\n </VerifyDialog>\n <VerifyDialog\n title=\"Are you sure you want to delete this image?\"\n description=\"\"\n handleCancel={() => {\n setState({ ...state, showDelete: false });\n }}\n show={state.showDelete}\n cancelText=\"Cancel\"\n button={\n <button\n type=\"button\"\n onClick={() => {\n props.delete();\n setState({ ...state, showDelete: false });\n }}\n >\n <Button sm red>\n Yes, permanently delete\n </Button>\n </button>\n }\n >\n This cannot be undone.\n </VerifyDialog>\n <VerifyDialog\n title=\"Are you sure you want to delete this reported false positive?\"\n description=\" \"\n maxWidthClass=\"max-w-xl\"\n handleCancel={() => {\n setState({ ...state, showConfirmDeleteFalsePositive: false });\n }}\n show={state.showConfirmDeleteFalsePositive}\n cancelText=\"Cancel\"\n button={\n <button\n type=\"button\"\n onClick={() => {\n if (state.selectedBox) {\n deleteFP(state.selectedBox);\n }\n setState({\n ...state,\n showConfirmDeleteFalsePositive: false,\n selectedBox: undefined,\n });\n }}\n >\n <Button sm red>\n Do not teach my model that this is not a{\" \"}\n {state.selectedBox ? getFPLabel(state.selectedBox) : \" \"}\n </Button>\n </button>\n }\n >\n <p>\n False positives submitted from Frigate are used to improve your model\n and should not be deleted unless you submitted them accidentally.\n </p>\n </VerifyDialog>\n </>\n );\n};\n\nexport { ImageAnnotator };\n"],"names":["c","e","u","i","a","r","o","f","l","v","m","d","g","p","w","s","x","h","y","F","n","A","t","ImageAnnotator","props","shortcuts","bboxes","setBBoxes","useState","fpboxes","setFPBoxes","state","setState","ref","useRef","editorRef","transformRef","resize","adjustedZoom","naturalHeight","_a","naturalWidth","_b","desiredHeight","editorHeight","_c","desiredWidth","editorWidth","_d","handleResize","useDebouncedCallback","useEffect","onResizeStop","elem","position","boxId","prev","onDragStop","onMouseDown","scale","bounds","onMouseUp","newId","out","left","top","width","height","onMouseMove","clickCreate","onClickBBox","selectedBox","b","moveBox","vertical","horizontal","resizeBox","toggleDifficult","cycleLabel","reverse","currentLabelIndex","label","lastIndex","newIndex","newLabel","deleteBox","deleteFP","getFPLabel","box","getBox","nextBox","currentIndex","stepSize","onKeyDown","next","onLoad","_e","onSaveLabel","onCancelLabel","defaultZIndex","jsxs","Fragment","jsx","TransformWrapper","zoomIn","zoomOut","Button","TransformComponent","BoundingBox","BoundingBoxType","_delta","Crosshairs","LabelDialog","InfoDialog","curr","VerifyDialog"],"mappings":";;;;;;;;;AAA4F,SAASA,GAAEC,GAAEC,GAAEF,GAAE;AAAC,MAAIG,IAAE,MAAKC,IAAEC,EAAE,IAAI,GAAEC,IAAED,EAAE,CAAC,GAAEE,IAAEF,EAAE,IAAI,GAAEG,IAAEH,EAAE,EAAE,GAAEI,IAAEJ,EAAG,GAACK,IAAEL,KAAIM,IAAEN,EAAEJ,CAAC,GAAEW,IAAEP,EAAE,EAAE;AAAE,EAAAM,EAAE,UAAQV;AAAE,MAAIY,IAAe,OAAO,SAApB,KAA2BC,IAA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gCAAgC,GAAO,CAAA;AAAA,QAC9D;AAAA,QACA,MAAMA,EAAM;AAAA,QACZ,YAAW;AAAA,QACX,QACE,gBAAAuE;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,SAAS,MAAM;AACb,cAAIvE,EAAM,eACRuD,EAASvD,EAAM,WAAW,GAEnBC,EAAA;AAAA,gBACP,GAAGD;AAAA,gBACH,gCAAgC;AAAA,gBAChC,aAAa;AAAA,cAAA,CACd;AAAA,YACH;AAAA,YAEA,UAAC,gBAAAqE,EAAAM,GAAA,EAAO,IAAE,IAAC,KAAG,IAAC,UAAA;AAAA,cAAA;AAAA,cAC4B;AAAA,cACxC3E,EAAM,cAAcwD,EAAWxD,EAAM,WAAW,IAAI;AAAA,YAAA,GACvD;AAAA,UAAA;AAAA,QACF;AAAA,QAGF,UAAA,gBAAAuE,EAAC,OAAE,UAGH,0IAAA,CAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ;","x_google_ignoreList":[0]}
@@ -1,22 +1,18 @@
1
1
  import { BoundingBox as e, BoundingBoxType as t } from "./BoundingBox.js";
2
2
  import { Button as x } from "./Button.js";
3
3
  import { Crosshairs as n } from "./Crosshairs.js";
4
- import { FormElement as a } from "./FormElement.js";
5
- import { FormElementBox as g } from "./FormElementBox.js";
6
- import { ImageAnnotator as B } from "./ImageAnnotator.js";
7
- import { InfoDialog as u } from "./InfoDialog.js";
8
- import { LabelDialog as d } from "./LabelDialog.js";
9
- import { VerifyDialog as E } from "./VerifyDialog.js";
4
+ import { ImageAnnotator as a } from "./ImageAnnotator.js";
5
+ import { InfoDialog as g } from "./InfoDialog.js";
6
+ import { LabelDialog as l } from "./LabelDialog.js";
7
+ import { VerifyDialog as u } from "./VerifyDialog.js";
10
8
  export {
11
9
  e as BoundingBox,
12
10
  t as BoundingBoxType,
13
11
  x as Button,
14
12
  n as Crosshairs,
15
- a as FormElement,
16
- g as FormElementBox,
17
- B as ImageAnnotator,
18
- u as InfoDialog,
19
- d as LabelDialog,
20
- E as VerifyDialog
13
+ a as ImageAnnotator,
14
+ g as InfoDialog,
15
+ l as LabelDialog,
16
+ u as VerifyDialog
21
17
  };
22
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -49,25 +49,6 @@ export declare interface FalsePositive {
49
49
  label?: string;
50
50
  }
51
51
 
52
- /**
53
- * @component
54
- * @params props - Component props.
55
- * @param props.children - Children components.
56
- * @param props.colSpanSize - Tailwind CSS class to control how elements are sized in grid.
57
- * @param props.helper - Helper message for users on how fill the form element.
58
- */
59
- export declare const FormElement: (props: IFormElementProps) => JSX_2.Element;
60
-
61
- /**
62
- * @component
63
- * @params props - Component props.
64
- * @param props.htmlFor - for attribute in HTML.
65
- * @param props.text - Label text.
66
- * @param props.children - Children components.
67
- * @param props.colSpanSize - Tailwind CSS class to control how elements are sized in grid.
68
- */
69
- export declare const FormElementBox: (props: IFormElementBoxProps) => JSX_2.Element;
70
-
71
52
  declare interface IBoundingBoxProps {
72
53
  type: BoundingBoxType;
73
54
  selected: boolean;
@@ -104,19 +85,6 @@ declare interface ICrosshairsProps {
104
85
  show: boolean;
105
86
  }
106
87
 
107
- declare interface IFormElementBoxProps {
108
- htmlFor?: string;
109
- text: string;
110
- children: ReactNode;
111
- colSpanSize?: string;
112
- }
113
-
114
- declare interface IFormElementProps {
115
- children: ReactNode;
116
- colSpanSize?: string;
117
- helper?: string;
118
- }
119
-
120
88
  declare interface IImageAnnotationProps {
121
89
  annotations: Annotation[];
122
90
  suggestions: Annotation[];
package/dist/index.js CHANGED
@@ -1,22 +1,18 @@
1
1
  import { BoundingBox as e, BoundingBoxType as t } from "./components/BoundingBox.js";
2
2
  import { Button as x } from "./components/Button.js";
3
3
  import { Crosshairs as n } from "./components/Crosshairs.js";
4
- import { FormElement as a } from "./components/FormElement.js";
5
- import { FormElementBox as g } from "./components/FormElementBox.js";
6
- import { ImageAnnotator as B } from "./components/ImageAnnotator.js";
7
- import { InfoDialog as u } from "./components/InfoDialog.js";
8
- import { LabelDialog as d } from "./components/LabelDialog.js";
9
- import { VerifyDialog as E } from "./components/VerifyDialog.js";
4
+ import { ImageAnnotator as a } from "./components/ImageAnnotator.js";
5
+ import { InfoDialog as g } from "./components/InfoDialog.js";
6
+ import { LabelDialog as l } from "./components/LabelDialog.js";
7
+ import { VerifyDialog as u } from "./components/VerifyDialog.js";
10
8
  export {
11
9
  e as BoundingBox,
12
10
  t as BoundingBoxType,
13
11
  x as Button,
14
12
  n as Crosshairs,
15
- a as FormElement,
16
- g as FormElementBox,
17
- B as ImageAnnotator,
18
- u as InfoDialog,
19
- d as LabelDialog,
20
- E as VerifyDialog
13
+ a as ImageAnnotator,
14
+ g as InfoDialog,
15
+ l as LabelDialog,
16
+ u as VerifyDialog
21
17
  };
22
18
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frigate-nvr/image-annotator",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "image annotator designed for frigate nvr",
5
5
  "exports": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -1 +0,0 @@
1
- .btn{display:inline-flex;align-items:center;justify-content:center;border-radius:.375rem;border-width:1px}.btn-base{padding:.5rem 1rem;font-size:1.125rem;font-weight:600}.btn-xl{padding:1rem 1.5rem;font-size:1.25rem;font-weight:800}.btn-xs{padding:.5rem;font-size:.875rem}.btn-sm{padding:.5rem .75rem;font-size:1rem;font-weight:500}.btn-primary{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(43 108 176 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.btn-primary:hover{--tw-bg-opacity: 1;background-color:rgb(42 67 101 / var(--tw-bg-opacity))}.btn-primary:active{--tw-bg-opacity: 1;background-color:rgb(44 82 130 / var(--tw-bg-opacity))}.btn-secondary{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.btn-secondary:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.btn-secondary:active{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.btn-red{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.btn-red:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity))}.btn-red:active{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.btn-green{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.btn-green:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity))}.btn-green:active{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity))}
@@ -1 +0,0 @@
1
- .input input,.input select,.input textarea{width:100%;border-radius:.375rem;--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity));--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.input input:focus,.input select:focus,.input textarea:focus{--tw-border-opacity: 1;border-color:rgb(144 205 244 / var(--tw-border-opacity));--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-color: rgb(190 227 248 / var(--tw-ring-opacity));--tw-ring-opacity: .5 }
@@ -1 +0,0 @@
1
- .form-element-box input[type=checkbox],.form-element-box input[type=radio]{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(49 130 206 / var(--tw-text-opacity));--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.form-element-box input[type=checkbox]:hover,.form-element-box input[type=radio]:hover{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.form-element-box input[type=checkbox]:focus,.form-element-box input[type=radio]:focus{--tw-border-opacity: 1;border-color:rgb(144 205 244 / var(--tw-border-opacity));--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-color: rgb(190 227 248 / var(--tw-ring-opacity));--tw-ring-opacity: .5;--tw-ring-offset-width: 0px }.form-element-box input[type=checkbox]{border-radius:.25rem}
@@ -1,13 +0,0 @@
1
- import { jsxs as s, jsx as l } from "react/jsx-runtime";
2
- import { c as m } from "../index-sN46tOW-.js";
3
- import '../assets/FormElement.css';const c = (e) => {
4
- const t = m("input", e.colSpanSize);
5
- return /* @__PURE__ */ s("div", { className: t, children: [
6
- e.children,
7
- e.helper && /* @__PURE__ */ l("div", { className: "mt-1 text-sm text-gray-500", children: e.helper })
8
- ] });
9
- };
10
- export {
11
- c as FormElement
12
- };
13
- //# sourceMappingURL=FormElement.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormElement.js","sources":["../../src/components/FormElement.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\n\nimport \"./FormElement.css\";\nimport classNames from \"classnames\";\n\ninterface IFormElementProps {\n children: ReactNode;\n colSpanSize?: string;\n helper?: string;\n}\n\n/**\n * @component\n * @params props - Component props.\n * @param props.children - Children components.\n * @param props.colSpanSize - Tailwind CSS class to control how elements are sized in grid.\n * @param props.helper - Helper message for users on how fill the form element.\n */\nconst FormElement = (props: IFormElementProps) => {\n const inputClass = classNames(\"input\", props.colSpanSize);\n\n return (\n <div className={inputClass}>\n {props.children}\n\n {props.helper && (\n <div className=\"mt-1 text-sm text-gray-500\">{props.helper}</div>\n )}\n </div>\n );\n};\n\nexport { FormElement };\n"],"names":["FormElement","props","inputClass","classNames","jsxs","jsx"],"mappings":";;AAkBM,MAAAA,IAAc,CAACC,MAA6B;AAChD,QAAMC,IAAaC,EAAW,SAASF,EAAM,WAAW;AAGtD,SAAA,gBAAAG,EAAC,OAAI,EAAA,WAAWF,GACb,UAAA;AAAA,IAAMD,EAAA;AAAA,IAENA,EAAM,UACL,gBAAAI,EAAC,SAAI,WAAU,8BAA8B,YAAM,QAAO;AAAA,EAE9D,EAAA,CAAA;AAEJ;"}
@@ -1,18 +0,0 @@
1
- import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
- import { c as s } from "../index-sN46tOW-.js";
3
- import '../assets/FormElementBox.css';const c = (e) => {
4
- const l = s(
5
- "form-element-box",
6
- "flex",
7
- "items-center",
8
- e.colSpanSize
9
- );
10
- return /* @__PURE__ */ m("div", { className: l, children: [
11
- e.children,
12
- /* @__PURE__ */ t("label", { htmlFor: e.htmlFor, className: "ml-2", children: e.text })
13
- ] });
14
- };
15
- export {
16
- c as FormElementBox
17
- };
18
- //# sourceMappingURL=FormElementBox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormElementBox.js","sources":["../../src/components/FormElementBox.tsx"],"sourcesContent":["import \"./FormElementBox.css\";\nimport { ReactNode } from \"react\";\n\nimport classNames from \"classnames\";\n\ninterface IFormElementBoxProps {\n htmlFor?: string;\n text: string;\n children: ReactNode;\n colSpanSize?: string;\n}\n\n/**\n * @component\n * @params props - Component props.\n * @param props.htmlFor - for attribute in HTML.\n * @param props.text - Label text.\n * @param props.children - Children components.\n * @param props.colSpanSize - Tailwind CSS class to control how elements are sized in grid.\n */\nconst FormElementBox = (props: IFormElementBoxProps) => {\n const boxClass = classNames(\n \"form-element-box\",\n \"flex\",\n \"items-center\",\n props.colSpanSize\n );\n\n return (\n <div className={boxClass}>\n {props.children}\n\n <label htmlFor={props.htmlFor} className=\"ml-2\">\n {props.text}\n </label>\n </div>\n );\n};\n\nexport { FormElementBox };\n"],"names":["FormElementBox","props","boxClass","classNames","jsxs","jsx"],"mappings":";;AAoBM,MAAAA,IAAiB,CAACC,MAAgC;AACtD,QAAMC,IAAWC;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACAF,EAAM;AAAA,EAAA;AAIN,SAAA,gBAAAG,EAAC,OAAI,EAAA,WAAWF,GACb,UAAA;AAAA,IAAMD,EAAA;AAAA,IAEP,gBAAAI,EAAC,WAAM,SAASJ,EAAM,SAAS,WAAU,QACtC,YAAM,KACT,CAAA;AAAA,EACF,EAAA,CAAA;AAEJ;"}
@@ -1,43 +0,0 @@
1
- import { g as c } from "./_commonjsHelpers-DjF3Plf2.js";
2
- var i = { exports: {} };
3
- /*!
4
- Copyright (c) 2018 Jed Watson.
5
- Licensed under the MIT License (MIT), see
6
- http://jedwatson.github.io/classnames
7
- */
8
- (function(e) {
9
- (function() {
10
- var f = {}.hasOwnProperty;
11
- function s() {
12
- for (var t = "", r = 0; r < arguments.length; r++) {
13
- var n = arguments[r];
14
- n && (t = o(t, a(n)));
15
- }
16
- return t;
17
- }
18
- function a(t) {
19
- if (typeof t == "string" || typeof t == "number")
20
- return t;
21
- if (typeof t != "object")
22
- return "";
23
- if (Array.isArray(t))
24
- return s.apply(null, t);
25
- if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]"))
26
- return t.toString();
27
- var r = "";
28
- for (var n in t)
29
- f.call(t, n) && t[n] && (r = o(r, n));
30
- return r;
31
- }
32
- function o(t, r) {
33
- return r ? t ? t + " " + r : t + r : t;
34
- }
35
- e.exports ? (s.default = s, e.exports = s) : window.classNames = s;
36
- })();
37
- })(i);
38
- var p = i.exports;
39
- const l = /* @__PURE__ */ c(p);
40
- export {
41
- l as c
42
- };
43
- //# sourceMappingURL=index-sN46tOW-.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-sN46tOW-.js","sources":["../node_modules/classnames/index.js"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n"],"names":["hasOwn","classNames","classes","i","arg","appendClass","parseValue","key","value","newClass","module"],"mappings":";;;;;;;;AAOA,GAAC,WAAY;AAGZ,QAAIA,IAAS,CAAE,EAAC;AAEhB,aAASC,IAAc;AAGtB,eAFIC,IAAU,IAELC,IAAI,GAAGA,IAAI,UAAU,QAAQA,KAAK;AAC1C,YAAIC,IAAM,UAAUD,CAAC;AACrB,QAAIC,MACHF,IAAUG,EAAYH,GAASI,EAAWF,CAAG,CAAC;AAAA,MAE/C;AAED,aAAOF;AAAA,IACP;AAED,aAASI,EAAYF,GAAK;AACzB,UAAI,OAAOA,KAAQ,YAAY,OAAOA,KAAQ;AAC7C,eAAOA;AAGR,UAAI,OAAOA,KAAQ;AAClB,eAAO;AAGR,UAAI,MAAM,QAAQA,CAAG;AACpB,eAAOH,EAAW,MAAM,MAAMG,CAAG;AAGlC,UAAIA,EAAI,aAAa,OAAO,UAAU,YAAY,CAACA,EAAI,SAAS,SAAQ,EAAG,SAAS,eAAe;AAClG,eAAOA,EAAI;AAGZ,UAAIF,IAAU;AAEd,eAASK,KAAOH;AACf,QAAIJ,EAAO,KAAKI,GAAKG,CAAG,KAAKH,EAAIG,CAAG,MACnCL,IAAUG,EAAYH,GAASK,CAAG;AAIpC,aAAOL;AAAA,IACP;AAED,aAASG,EAAaG,GAAOC,GAAU;AACtC,aAAKA,IAIDD,IACIA,IAAQ,MAAMC,IAGfD,IAAQC,IAPPD;AAAA,IAQR;AAED,IAAqCE,EAAO,WAC3CT,EAAW,UAAUA,GACrBS,EAAA,UAAiBT,KAOjB,OAAO,aAAaA;AAAA,EAEtB;;;;","x_google_ignoreList":[0]}