go-captcha-vue 2.0.0-beta.2 → 2.0.0-beta.3

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,4 +1,4 @@
1
- import { defineComponent as D, openBlock as b, createElementBlock as C, mergeProps as A, createElementVNode as c, reactive as U, toRaw as de, ref as X, watch as K, computed as z, normalizeClass as I, normalizeStyle as p, toDisplayString as N, withDirectives as H, unref as i, vShow as F, createVNode as P, Fragment as he, renderList as ve, onMounted as ne, nextTick as ce, toRefs as ge, createBlock as j, createCommentVNode as fe } from "vue";
1
+ import { defineComponent as M, openBlock as b, createElementBlock as C, mergeProps as A, createElementVNode as c, reactive as U, toRaw as re, ref as D, watch as j, computed as z, normalizeClass as I, normalizeStyle as m, toDisplayString as V, withDirectives as H, unref as i, vShow as F, createVNode as P, Fragment as de, renderList as he, onMounted as ne, nextTick as ce, toRefs as ve, createBlock as q, createCommentVNode as ge } from "vue";
2
2
  const le = () => ({
3
3
  width: 300,
4
4
  height: 220,
@@ -9,7 +9,7 @@ const le = () => ({
9
9
  showTheme: !0,
10
10
  title: "请在下图依次点击",
11
11
  buttonText: "确认"
12
- }), me = /* @__PURE__ */ c("path", { d: `M100.1,189.9C100.1,189.9,100,189.9,100.1,189.9c-49.7,0-90-40.4-90-89.9c0-49.6,40.4-89.9,89.9-89.9
12
+ }), fe = /* @__PURE__ */ c("path", { d: `M100.1,189.9C100.1,189.9,100,189.9,100.1,189.9c-49.7,0-90-40.4-90-89.9c0-49.6,40.4-89.9,89.9-89.9
13
13
  c49.6,0,89.9,40.4,89.9,89.9c0,18.2-5.4,35.7-15.6,50.7c-1.5,2.1-3.6,3.4-6.1,3.9c-2.5,0.4-5-0.1-7-1.6c-4.2-3-5.3-8.6-2.4-12.9
14
14
  c8.1-11.9,12.4-25.7,12.4-40.1c0-39.2-31.9-71.1-71.1-71.1c-39.2,0-71.1,31.9-71.1,71.1c0,39.2,31.9,71.1,71.1,71.1
15
15
  c7.7,0,15.3-1.2,22.6-3.6c2.4-0.8,4.9-0.6,7.2,0.5c2.2,1.1,3.9,3.1,4.7,5.5c1.6,4.9-1,10.2-5.9,11.9
@@ -17,8 +17,8 @@ const le = () => ({
17
17
  L86.7,100L66.4,79.7c-3.7-3.7-3.7-9.6,0-13.3c3.7-3.7,9.6-3.7,13.3,0L100,86.7l20.3-20.3c1.8-1.8,4.1-2.8,6.7-2.8c0,0,0,0,0,0
18
18
  c2.5,0,4.9,1,6.7,2.8c1.8,1.8,2.8,4.1,2.8,6.7c0,2.5-1,4.9-2.8,6.7L113.3,100l20.3,20.3c3.7,3.7,3.7,9.6,0,13.3
19
19
  c-3.7,3.7-9.6,3.7-13.3,0L100,113.3l-20.3,20.3C77.9,135.4,75.5,136.4,73,136.4z` }, null, -1), pe = [
20
- me
21
- ], Z = /* @__PURE__ */ D({
20
+ fe
21
+ ], Z = /* @__PURE__ */ M({
22
22
  __name: "close-icon",
23
23
  emits: ["click"],
24
24
  setup(l, { emit: t }) {
@@ -33,7 +33,7 @@ const le = () => ({
33
33
  height: "20"
34
34
  }, e.$attrs, { onClick: s }), pe, 16));
35
35
  }
36
- }), _e = /* @__PURE__ */ c("path", { d: `M135,149.9c-10.7,7.6-23.2,11.4-36,11.2c-1.7,0-3.4-0.1-5-0.3c-0.7-0.1-1.4-0.2-2-0.3c-1.3-0.2-2.6-0.4-3.9-0.6
36
+ }), me = /* @__PURE__ */ c("path", { d: `M135,149.9c-10.7,7.6-23.2,11.4-36,11.2c-1.7,0-3.4-0.1-5-0.3c-0.7-0.1-1.4-0.2-2-0.3c-1.3-0.2-2.6-0.4-3.9-0.6
37
37
  c-0.8-0.2-1.6-0.4-2.3-0.5c-1.2-0.3-2.5-0.6-3.7-1c-0.6-0.2-1.2-0.4-1.7-0.6c-1.4-0.5-2.8-1-4.2-1.5c-0.3-0.1-0.6-0.3-0.9-0.4
38
38
  c-1.6-0.7-3.2-1.4-4.7-2.3c-0.1,0-0.1-0.1-0.2-0.1c-5.1-2.9-9.8-6.4-14-10.6c-0.1-0.1-0.1-0.1-0.2-0.2c-1.3-1.3-2.5-2.7-3.7-4.1
39
39
  c-0.2-0.3-0.5-0.6-0.7-0.9c-8.4-10.6-13.5-24.1-13.5-38.8h14.3c0.4,0,0.7-0.2,0.9-0.5c0.2-0.3,0.2-0.8,0-1.1L29.5,60.9
@@ -50,9 +50,9 @@ const le = () => ({
50
50
  c0.6,0.1,1.3,0.3,1.9,0.4c1.4,0.3,2.8,0.7,4.2,1.1c0.4,0.1,0.9,0.3,1.3,0.4c1.6,0.5,3.1,1.1,4.6,1.7c0.2,0.1,0.3,0.1,0.5,0.2
51
51
  c9,3.9,17,10,23.2,17.6c0,0,0.1,0.1,0.1,0.2c8.7,10.7,14,24.5,14,39.4H147c-0.4,0-0.7,0.2-0.9,0.5c-0.2,0.3-0.2,0.8,0,1.1l24,36.4
52
52
  c0.2,0.3,0.5,0.5,0.9,0.5c0.4,0,0.7-0.2,0.9-0.5l23.9-36.4c0.2-0.3,0.2-0.7,0-1.1c-0.2-0.3-0.5-0.5-0.9-0.5L180.6,98.9L180.6,98.9
53
- L180.6,98.9z` }, null, -1), we = [
54
- _e
55
- ], R = /* @__PURE__ */ D({
53
+ L180.6,98.9z` }, null, -1), _e = [
54
+ me
55
+ ], R = /* @__PURE__ */ M({
56
56
  __name: "refresh-icon",
57
57
  emits: ["click"],
58
58
  setup(l, { emit: t }) {
@@ -65,9 +65,9 @@ const le = () => ({
65
65
  viewBox: "0 0 200 200",
66
66
  width: "20",
67
67
  height: "20"
68
- }, e.$attrs, { onClick: s }), we, 16));
68
+ }, e.$attrs, { onClick: s }), _e, 16));
69
69
  }
70
- }), be = /* @__PURE__ */ c("circle", {
70
+ }), we = /* @__PURE__ */ c("circle", {
71
71
  cx: "50",
72
72
  cy: "36.8101",
73
73
  r: "10"
@@ -81,9 +81,9 @@ const le = () => ({
81
81
  keyTimes: "0;0.5;1",
82
82
  values: "23;77;23"
83
83
  })
84
- ], -1), xe = [
85
- be
86
- ], ee = /* @__PURE__ */ D({
84
+ ], -1), be = [
85
+ we
86
+ ], ee = /* @__PURE__ */ M({
87
87
  __name: "loading-icon",
88
88
  emits: ["click"],
89
89
  setup(l, { emit: t }) {
@@ -97,10 +97,10 @@ const le = () => ({
97
97
  preserveAspectRatio: "xMidYMid",
98
98
  width: "84",
99
99
  height: "84"
100
- }, e.$attrs, { onClick: s }), xe, 16));
100
+ }, e.$attrs, { onClick: s }), be, 16));
101
101
  }
102
102
  });
103
- function Ee(l) {
103
+ function xe(l) {
104
104
  let t = 0, n = 0;
105
105
  if (l.getBoundingClientRect) {
106
106
  const s = l.getBoundingClientRect(), e = document.documentElement;
@@ -123,22 +123,22 @@ function se(l, t) {
123
123
  }
124
124
  return n !== l;
125
125
  }
126
- function ke(l, t) {
126
+ function Ee(l, t) {
127
127
  const n = U({ list: [] });
128
128
  return {
129
129
  dots: n,
130
130
  clickEvent: (o) => {
131
- const E = o.currentTarget, u = Ee(E), g = o.pageX || o.clientX, r = o.pageY || o.clientY, h = u.domX, _ = u.domY, w = g - h, v = r - _, f = parseInt(w.toString()), k = parseInt(v.toString()), $ = /* @__PURE__ */ new Date(), M = n.list.length, L = n.list;
132
- return L.push({ key: $.getTime(), index: M + 1, x: f, y: k }), n.list = L, t.click && t.click(f, k), o.cancelBubble = !0, o.preventDefault(), !1;
131
+ const E = o.currentTarget, u = xe(E), g = o.pageX || o.clientX, r = o.pageY || o.clientY, h = u.domX, _ = u.domY, w = g - h, v = r - _, f = parseInt(w.toString()), k = parseInt(v.toString()), $ = /* @__PURE__ */ new Date(), S = n.list.length, y = n.list;
132
+ return y.push({ key: $.getTime(), index: S + 1, x: f, y: k }), n.list = y, t.click && t.click(f, k), o.cancelBubble = !0, o.preventDefault(), !1;
133
133
  },
134
- confirmEvent: (o) => (t.confirm && t.confirm(de(n.list), () => {
134
+ confirmEvent: (o) => (t.confirm && t.confirm(re(n.list), () => {
135
135
  n.list = [];
136
136
  }), o.cancelBubble = !0, o.preventDefault(), !1),
137
137
  closeEvent: (o) => (t.close && t.close(), n.list = [], o.cancelBubble = !0, o.preventDefault(), !1),
138
138
  refreshEvent: (o) => (t.refresh && t.refresh(), n.list = [], o.cancelBubble = !0, o.preventDefault(), !1)
139
139
  };
140
140
  }
141
- const Le = { class: "gc-header" }, ye = ["src"], $e = { class: "gc-loading" }, Ce = ["src"], Te = { class: "gc-dots" }, Pe = { class: "gc-footer" }, ze = { class: "gc-icon-block gc-icon-block2" }, Se = { class: "gc-button-block" }, q = /* @__PURE__ */ D({
141
+ const ke = { class: "gc-header" }, ye = ["src"], Le = { class: "gc-loading" }, $e = ["src"], Ce = { class: "gc-dots" }, Te = { class: "gc-footer" }, Pe = { class: "gc-icon-block gc-icon-block2" }, ze = { class: "gc-button-block" }, G = /* @__PURE__ */ M({
142
142
  __name: "index",
143
143
  props: {
144
144
  config: { default: le },
@@ -146,17 +146,17 @@ const Le = { class: "gc-header" }, ye = ["src"], $e = { class: "gc-loading" }, C
146
146
  data: { default: () => ({}) }
147
147
  },
148
148
  setup(l) {
149
- const t = l, { data: n, events: s } = t, e = X({
149
+ const t = l, { data: n, events: s } = t, e = D({
150
150
  ...le(),
151
151
  ...t.config
152
152
  });
153
- K(() => t.config, () => {
153
+ j(() => t.config, () => {
154
154
  e.value = {
155
155
  ...e.value,
156
156
  ...t.config
157
157
  };
158
158
  });
159
- const a = ke(n, s), d = e.value.horizontalPadding || 0, o = e.value.verticalPadding || 0, E = (e.value.width || 0) + d * 2 + (e.value.showTheme ? 2 : 0), u = a.dots, g = z(() => ({
159
+ const a = Ee(n, s), d = e.value.horizontalPadding || 0, o = e.value.verticalPadding || 0, E = (e.value.width || 0) + d * 2 + (e.value.showTheme ? 2 : 0), u = a.dots, g = z(() => ({
160
160
  width: E + "px",
161
161
  paddingLeft: d + "px",
162
162
  paddingRight: d + "px",
@@ -171,12 +171,12 @@ const Le = { class: "gc-header" }, ye = ["src"], $e = { class: "gc-loading" }, C
171
171
  }));
172
172
  return (_, w) => (b(), C("div", {
173
173
  class: I(`go-captcha gc-wrapper ${e.value.showTheme ? "gc-theme" : ""}`),
174
- style: p(g.value)
174
+ style: m(g.value)
175
175
  }, [
176
- c("div", Le, [
177
- c("span", null, N(e.value.title), 1),
176
+ c("div", ke, [
177
+ c("span", null, V(e.value.title), 1),
178
178
  H(c("img", {
179
- style: p(r.value),
179
+ style: m(r.value),
180
180
  src: i(n).thumb,
181
181
  alt: "..."
182
182
  }, null, 12, ye), [
@@ -185,34 +185,34 @@ const Le = { class: "gc-header" }, ye = ["src"], $e = { class: "gc-loading" }, C
185
185
  ]),
186
186
  c("div", {
187
187
  class: "gc-body",
188
- style: p(h.value)
188
+ style: m(h.value)
189
189
  }, [
190
- c("div", $e, [
190
+ c("div", Le, [
191
191
  P(ee)
192
192
  ]),
193
193
  H(c("img", {
194
- style: p(h.value),
194
+ style: m(h.value),
195
195
  class: "gc-picture",
196
196
  src: i(n).image,
197
197
  alt: "...",
198
198
  onClick: w[0] || (w[0] = //@ts-ignore
199
199
  (...v) => i(a).clickEvent && i(a).clickEvent(...v))
200
- }, null, 12, Ce), [
200
+ }, null, 12, $e), [
201
201
  [F, i(n).image !== ""]
202
202
  ]),
203
- c("div", Te, [
204
- (b(!0), C(he, null, ve(i(u).list, (v) => (b(), C("div", {
203
+ c("div", Ce, [
204
+ (b(!0), C(de, null, he(i(u).list, (v) => (b(), C("div", {
205
205
  class: "gc-dot",
206
206
  key: `${v.key + "-" + v.index}`,
207
- style: p({
207
+ style: m({
208
208
  top: v.y - 11 + "px",
209
209
  left: v.x - 11 + "px"
210
210
  })
211
- }, N(v.index), 5))), 128))
211
+ }, V(v.index), 5))), 128))
212
212
  ])
213
213
  ], 4),
214
- c("div", Pe, [
215
- c("div", ze, [
214
+ c("div", Te, [
215
+ c("div", Pe, [
216
216
  P(Z, {
217
217
  width: 22,
218
218
  height: 22,
@@ -224,19 +224,19 @@ const Le = { class: "gc-header" }, ye = ["src"], $e = { class: "gc-loading" }, C
224
224
  onClick: i(a).refreshEvent
225
225
  }, null, 8, ["onClick"])
226
226
  ]),
227
- c("div", Se, [
227
+ c("div", ze, [
228
228
  c("button", {
229
229
  onClick: w[1] || (w[1] = //@ts-ignore
230
230
  (...v) => i(a).confirmEvent && i(a).confirmEvent(...v))
231
- }, N(e.value.buttonText), 1)
231
+ }, V(e.value.buttonText), 1)
232
232
  ])
233
233
  ])
234
234
  ], 6));
235
235
  }
236
236
  });
237
- q.name = "goCaptchaClick";
238
- q.install = function(l) {
239
- l.component("gocaptcha-click", q);
237
+ G.name = "gocaptcha-click";
238
+ G.install = function(l) {
239
+ l.component("gocaptcha-click", G);
240
240
  };
241
241
  const oe = () => ({
242
242
  width: 300,
@@ -251,7 +251,7 @@ const oe = () => ({
251
251
  s-5.4-5.4-30.4-30.7c-6.4-6.4-6.4-16.7,0-23.1s16.7-6.4,23.1,0l58.4,58.4c6.4,6.4,6.4,16.7,0,23.1c0,0-32.9,32.9-57.9,57.9
252
252
  c-6.4,6.4-16.7,6.4-23.1,0c-6.4-6.4-6.4-16.7,0-23.1C121.8,126.2,131.6,116.3,131.6,116.3z` }, null, -1), De = [
253
253
  Xe
254
- ], re = /* @__PURE__ */ D({
254
+ ], ue = /* @__PURE__ */ M({
255
255
  __name: "arrows-icon",
256
256
  emits: ["click"],
257
257
  setup(l, { emit: t }) {
@@ -274,34 +274,34 @@ function Me(l, t, n, s, e, a) {
274
274
  return {
275
275
  state: d,
276
276
  dragEvent: (r) => {
277
- const h = r.touches && r.touches[0], _ = e.value.offsetLeft, w = n.value.offsetWidth, v = e.value.offsetWidth, f = w - v, k = l.thumbX || 0, $ = s.value.offsetWidth, M = v - $, L = (f - k + M) / f;
277
+ const h = r.touches && r.touches[0], _ = e.value.offsetLeft, w = n.value.offsetWidth, v = e.value.offsetWidth, f = w - v, k = l.thumbX || 0, $ = s.value.offsetWidth, S = v - $, y = (f - k + S) / f;
278
278
  let x = !1, B = 0, T = 0;
279
279
  h ? B = h.pageX - _ : B = r.clientX - _;
280
- const Y = (m) => {
280
+ const W = (p) => {
281
281
  x = !0;
282
- const V = m.touches && m.touches[0];
283
- let y = 0;
284
- if (V ? y = V.pageX - B : y = m.clientX - B, y >= f) {
282
+ const N = p.touches && p.touches[0];
283
+ let L = 0;
284
+ if (N ? L = N.pageX - B : L = p.clientX - B, L >= f) {
285
285
  d.dragLeft = f;
286
286
  return;
287
287
  }
288
- if (y <= 0) {
288
+ if (L <= 0) {
289
289
  d.dragLeft = 0;
290
290
  return;
291
291
  }
292
- d.dragLeft = y, T = k + y * L, d.thumbLeft = T, t.move && t.move(T, l.thumbY || 0), m.cancelBubble = !0, m.preventDefault();
293
- }, S = (m) => {
294
- se(a.value, m) && x && (a.value.removeEventListener("mousemove", Y, !1), a.value.removeEventListener("touchmove", Y, { passive: !1 }), a.value.removeEventListener("mouseup", S, !1), a.value.removeEventListener("mouseout", S, !1), a.value.removeEventListener("touchend", S, !1), x = !1, t.confirm && t.confirm({ x: parseInt(T.toString()), y: l.thumbY || 0 }, () => {
292
+ d.dragLeft = L, T = k + L * y, d.thumbLeft = T, t.move && t.move(T, l.thumbY || 0), p.cancelBubble = !0, p.preventDefault();
293
+ }, X = (p) => {
294
+ se(a.value, p) && x && (a.value.removeEventListener("mousemove", W, !1), a.value.removeEventListener("touchmove", W, { passive: !1 }), a.value.removeEventListener("mouseup", X, !1), a.value.removeEventListener("mouseout", X, !1), a.value.removeEventListener("touchend", X, !1), x = !1, t.confirm && t.confirm({ x: parseInt(T.toString()), y: l.thumbY || 0 }, () => {
295
295
  o();
296
- }), m.cancelBubble = !0, m.preventDefault());
296
+ }), p.cancelBubble = !0, p.preventDefault());
297
297
  };
298
- a.value.addEventListener("mousemove", Y, !1), a.value.addEventListener("touchmove", Y, { passive: !1 }), a.value.addEventListener("mouseup", S, !1), a.value.addEventListener("mouseout", S, !1), a.value.addEventListener("touchend", S, !1);
298
+ a.value.addEventListener("mousemove", W, !1), a.value.addEventListener("touchmove", W, { passive: !1 }), a.value.addEventListener("mouseup", X, !1), a.value.addEventListener("mouseout", X, !1), a.value.addEventListener("touchend", X, !1);
299
299
  },
300
300
  closeEvent: (r) => (t && t.close && t.close(), o(), r.cancelBubble = !0, r.preventDefault(), !1),
301
301
  refreshEvent: (r) => (t && t.refresh && t.refresh(), o(), r.cancelBubble = !0, r.preventDefault(), !1)
302
302
  };
303
303
  }
304
- const Be = { class: "gc-header" }, Ye = { class: "gc-icon-block" }, We = { class: "gc-loading" }, He = ["src"], Fe = ["src"], Ae = { class: "gc-footer" }, Ne = /* @__PURE__ */ c("div", { class: "gc-drag-line" }, null, -1), G = /* @__PURE__ */ D({
304
+ const Se = { class: "gc-header" }, Be = { class: "gc-icon-block" }, We = { class: "gc-loading" }, Ye = ["src"], He = ["src"], Fe = { class: "gc-footer" }, Ae = /* @__PURE__ */ c("div", { class: "gc-drag-line" }, null, -1), J = /* @__PURE__ */ M({
305
305
  __name: "index",
306
306
  props: {
307
307
  config: { default: oe },
@@ -309,17 +309,17 @@ const Be = { class: "gc-header" }, Ye = { class: "gc-icon-block" }, We = { class
309
309
  data: { default: () => ({}) }
310
310
  },
311
311
  setup(l) {
312
- const t = l, { data: n, events: s } = t, e = X({
312
+ const t = l, { data: n, events: s } = t, e = D({
313
313
  ...oe(),
314
314
  ...t.config
315
315
  });
316
- K(() => t.config, () => {
316
+ j(() => t.config, () => {
317
317
  e.value = {
318
318
  ...e.value,
319
319
  ...t.config
320
320
  };
321
321
  });
322
- const a = X(null), d = X(null), o = X(null), E = X(null), u = Me(n, s, d, E, o, a), g = e.value.horizontalPadding || 0, r = e.value.verticalPadding || 0, h = (e.value.width || 0) + g * 2 + (e.value.showTheme ? 2 : 0), _ = z(() => ({
322
+ const a = D(null), d = D(null), o = D(null), E = D(null), u = Me(n, s, d, E, o, a), g = e.value.horizontalPadding || 0, r = e.value.verticalPadding || 0, h = (e.value.width || 0) + g * 2 + (e.value.showTheme ? 2 : 0), _ = z(() => ({
323
323
  width: h + "px",
324
324
  paddingLeft: g + "px",
325
325
  paddingRight: g + "px",
@@ -338,11 +338,11 @@ const Be = { class: "gc-header" }, Ye = { class: "gc-icon-block" }, We = { class
338
338
  await ce(), o.value && o.value.addEventListener("dragstart", (f) => f.preventDefault());
339
339
  }), (f, k) => (b(), C("div", {
340
340
  class: I(`go-captcha gc-wrapper ${e.value.showTheme ? "gc-theme" : ""}`),
341
- style: p(_.value)
341
+ style: m(_.value)
342
342
  }, [
343
- c("div", Be, [
344
- c("span", null, N(e.value.title), 1),
345
- c("div", Ye, [
343
+ c("div", Se, [
344
+ c("span", null, V(e.value.title), 1),
345
+ c("div", Be, [
346
346
  P(Z, {
347
347
  width: 22,
348
348
  height: 22,
@@ -359,34 +359,34 @@ const Be = { class: "gc-header" }, Ye = { class: "gc-icon-block" }, We = { class
359
359
  class: "gc-body",
360
360
  ref_key: "containerRef",
361
361
  ref: d,
362
- style: p(v.value)
362
+ style: m(v.value)
363
363
  }, [
364
364
  c("div", We, [
365
365
  P(ee)
366
366
  ]),
367
367
  H(c("img", {
368
368
  class: "gc-picture",
369
- style: p(v.value),
369
+ style: m(v.value),
370
370
  src: i(n).image,
371
371
  alt: "..."
372
- }, null, 12, He), [
372
+ }, null, 12, Ye), [
373
373
  [F, i(n).image !== ""]
374
374
  ]),
375
375
  c("div", {
376
376
  class: "gc-tile",
377
377
  ref_key: "tileRef",
378
378
  ref: E,
379
- style: p(w.value)
379
+ style: m(w.value)
380
380
  }, [
381
381
  H(c("img", {
382
382
  src: i(n).thumb,
383
383
  alt: "..."
384
- }, null, 8, Fe), [
384
+ }, null, 8, He), [
385
385
  [F, i(n).thumb !== ""]
386
386
  ])
387
387
  ], 4)
388
388
  ], 4),
389
- c("div", Ae, [
389
+ c("div", Fe, [
390
390
  c("div", {
391
391
  class: "gc-drag-slide-bar",
392
392
  ref_key: "dragBarRef",
@@ -394,25 +394,25 @@ const Be = { class: "gc-header" }, Ye = { class: "gc-icon-block" }, We = { class
394
394
  onMousedown: k[1] || (k[1] = //@ts-ignore
395
395
  (...$) => i(u).dragEvent && i(u).dragEvent(...$))
396
396
  }, [
397
- Ne,
397
+ Ae,
398
398
  c("div", {
399
399
  class: "gc-drag-block",
400
400
  ref_key: "dragBlockRef",
401
401
  ref: o,
402
402
  onTouchstart: k[0] || (k[0] = //@ts-ignore
403
403
  (...$) => i(u).dragEvent && i(u).dragEvent(...$)),
404
- style: p({ left: i(u).state.dragLeft + "px" })
404
+ style: m({ left: i(u).state.dragLeft + "px" })
405
405
  }, [
406
- P(re)
406
+ P(ue)
407
407
  ], 36)
408
408
  ], 544)
409
409
  ])
410
410
  ], 6));
411
411
  }
412
412
  });
413
- G.name = "goCaptchaSlide";
414
- G.install = function(l) {
415
- l.component("gocaptcha-slide", G);
413
+ J.name = "gocaptcha-slide";
414
+ J.install = function(l) {
415
+ l.component("gocaptcha-slide", J);
416
416
  };
417
417
  const ie = () => ({
418
418
  width: 300,
@@ -430,25 +430,25 @@ function Ve(l, t, n, s) {
430
430
  state: e,
431
431
  dragEvent: (u) => {
432
432
  const g = u.touches && u.touches[0], r = s.value.offsetLeft, h = s.value.offsetTop, _ = n.value.offsetWidth, w = n.value.offsetHeight, v = s.value.offsetWidth, f = s.value.offsetHeight, k = _ - v, $ = w - f;
433
- let M = !1, L = 0, x = 0, B = 0, T = 0;
434
- g ? (L = g.pageX - r, x = g.pageY - h) : (L = u.clientX - r, x = u.clientY - h);
435
- const Y = (m) => {
436
- M = !0;
437
- const V = m.touches && m.touches[0];
438
- let y = 0, W = 0;
439
- V ? (y = V.pageX - L, W = V.pageY - x) : (y = m.clientX - L, W = m.clientY - x), y <= 0 && (y = 0), W <= 0 && (W = 0), y >= k && (y = k), W >= $ && (W = $), e.x = y, e.y = W, B = y, T = W, t.move && t.move(y, W), m.cancelBubble = !0, m.preventDefault();
440
- }, S = (m) => {
441
- se(n.value, m) && M && (M = !1, n.value.removeEventListener("mousemove", Y, !1), n.value.removeEventListener("touchmove", Y, { passive: !1 }), n.value.removeEventListener("mouseup", S, !1), n.value.removeEventListener("mouseout", S, !1), n.value.removeEventListener("touchend", S, !1), t.confirm && t.confirm({ x: B, y: T }, () => {
433
+ let S = !1, y = 0, x = 0, B = 0, T = 0;
434
+ g ? (y = g.pageX - r, x = g.pageY - h) : (y = u.clientX - r, x = u.clientY - h);
435
+ const W = (p) => {
436
+ S = !0;
437
+ const N = p.touches && p.touches[0];
438
+ let L = 0, Y = 0;
439
+ N ? (L = N.pageX - y, Y = N.pageY - x) : (L = p.clientX - y, Y = p.clientY - x), L <= 0 && (L = 0), Y <= 0 && (Y = 0), L >= k && (L = k), Y >= $ && (Y = $), e.x = L, e.y = Y, B = L, T = Y, t.move && t.move(L, Y), p.cancelBubble = !0, p.preventDefault();
440
+ }, X = (p) => {
441
+ se(n.value, p) && S && (S = !1, n.value.removeEventListener("mousemove", W, !1), n.value.removeEventListener("touchmove", W, { passive: !1 }), n.value.removeEventListener("mouseup", X, !1), n.value.removeEventListener("mouseout", X, !1), n.value.removeEventListener("touchend", X, !1), t.confirm && t.confirm({ x: B, y: T }, () => {
442
442
  a();
443
- }), m.cancelBubble = !0, m.preventDefault());
443
+ }), p.cancelBubble = !0, p.preventDefault());
444
444
  };
445
- n.value.addEventListener("mousemove", Y, !1), n.value.addEventListener("touchmove", Y, { passive: !1 }), n.value.addEventListener("mouseup", S, !1), n.value.addEventListener("mouseout", S, !1), n.value.addEventListener("touchend", S, !1);
445
+ n.value.addEventListener("mousemove", W, !1), n.value.addEventListener("touchmove", W, { passive: !1 }), n.value.addEventListener("mouseup", X, !1), n.value.addEventListener("mouseout", X, !1), n.value.addEventListener("touchend", X, !1);
446
446
  },
447
447
  closeEvent: (u) => (t && t.close && t.close(), a(), u.cancelBubble = !0, u.preventDefault(), !1),
448
448
  refreshEvent: (u) => (t && t.refresh && t.refresh(), a(), u.cancelBubble = !0, u.preventDefault(), !1)
449
449
  };
450
450
  }
451
- const Ie = { class: "gc-header gc-header2" }, Ke = { class: "gc-loading" }, je = ["src"], qe = ["src"], Ge = { class: "gc-footer" }, Je = { class: "gc-icon-block" }, J = /* @__PURE__ */ D({
451
+ const Ne = { class: "gc-header gc-header2" }, Ie = { class: "gc-loading" }, je = ["src"], qe = ["src"], Ge = { class: "gc-footer" }, Je = { class: "gc-icon-block" }, K = /* @__PURE__ */ M({
452
452
  __name: "index",
453
453
  props: {
454
454
  config: { default: ie },
@@ -456,17 +456,17 @@ const Ie = { class: "gc-header gc-header2" }, Ke = { class: "gc-loading" }, je =
456
456
  data: { default: () => ({}) }
457
457
  },
458
458
  setup(l) {
459
- const t = l, { data: n, events: s } = t, e = X({
459
+ const t = l, { data: n, events: s } = t, e = D({
460
460
  ...ie(),
461
461
  ...t.config
462
462
  });
463
- K(() => t.config, () => {
463
+ j(() => t.config, () => {
464
464
  e.value = {
465
465
  ...e.value,
466
466
  ...t.config
467
467
  };
468
468
  });
469
- const a = X(null), d = X(null), o = Ve(n, s, a, d), E = e.value.horizontalPadding || 0, u = e.value.verticalPadding || 0;
469
+ const a = D(null), d = D(null), o = Ve(n, s, a, d), E = e.value.horizontalPadding || 0, u = e.value.verticalPadding || 0;
470
470
  let g = (e.value.width || 0) + E * 2 + (e.value.showTheme ? 2 : 0);
471
471
  const r = z(() => ({
472
472
  width: g + "px",
@@ -487,23 +487,23 @@ const Ie = { class: "gc-header gc-header2" }, Ke = { class: "gc-loading" }, je =
487
487
  await ce(), d.value && d.value.addEventListener("dragstart", (w) => w.preventDefault());
488
488
  }), (w, v) => (b(), C("div", {
489
489
  class: I(`go-captcha gc-wrapper ${e.value.showTheme ? "gc-theme" : ""}`),
490
- style: p(r.value)
490
+ style: m(r.value)
491
491
  }, [
492
- c("div", Ie, [
493
- c("span", null, N(e.value.title), 1)
492
+ c("div", Ne, [
493
+ c("span", null, V(e.value.title), 1)
494
494
  ]),
495
495
  c("div", {
496
496
  class: "gc-body",
497
497
  ref_key: "containerRef",
498
498
  ref: a,
499
- style: p(_.value)
499
+ style: m(_.value)
500
500
  }, [
501
- c("div", Ke, [
501
+ c("div", Ie, [
502
502
  P(ee)
503
503
  ]),
504
504
  H(c("img", {
505
505
  class: "gc-picture",
506
- style: p(_.value),
506
+ style: m(_.value),
507
507
  src: i(n).image,
508
508
  alt: "..."
509
509
  }, null, 12, je), [
@@ -513,7 +513,7 @@ const Ie = { class: "gc-header gc-header2" }, Ke = { class: "gc-loading" }, je =
513
513
  class: "gc-tile",
514
514
  ref_key: "tileRef",
515
515
  ref: d,
516
- style: p(h.value),
516
+ style: m(h.value),
517
517
  onMousedown: v[0] || (v[0] = //@ts-ignore
518
518
  (...f) => i(o).dragEvent && i(o).dragEvent(...f)),
519
519
  onTouchstart: v[1] || (v[1] = //@ts-ignore
@@ -544,9 +544,9 @@ const Ie = { class: "gc-header gc-header2" }, Ke = { class: "gc-loading" }, je =
544
544
  ], 6));
545
545
  }
546
546
  });
547
- J.name = "goCaptchaSlideRegion";
548
- J.install = function(l) {
549
- l.component("gocaptcha-slide-region", J);
547
+ K.name = "gocaptcha-slide-region";
548
+ K.install = function(l) {
549
+ l.component("gocaptcha-slide-region", K);
550
550
  };
551
551
  const te = () => ({
552
552
  width: 300,
@@ -557,7 +557,7 @@ const te = () => ({
557
557
  showTheme: !0,
558
558
  title: "请拖动滑块完成拼图"
559
559
  });
560
- function Oe(l, t, n, s) {
560
+ function Ke(l, t, n, s) {
561
561
  const e = U({ dragLeft: 0, thumbAngle: l.angle || 0 }), a = () => {
562
562
  e.dragLeft = 0, e.thumbAngle = 0;
563
563
  };
@@ -567,7 +567,7 @@ function Oe(l, t, n, s) {
567
567
  const g = u.touches && u.touches[0], r = n.value.offsetLeft, h = s.value.offsetWidth, _ = n.value.offsetWidth, w = h - _, v = 360 / w;
568
568
  let f = 0, k = !1, $ = 0;
569
569
  g ? $ = g.pageX - r : $ = u.clientX - r;
570
- const M = (x) => {
570
+ const S = (x) => {
571
571
  k = !0;
572
572
  const B = x.touches && x.touches[0];
573
573
  let T = 0;
@@ -580,18 +580,18 @@ function Oe(l, t, n, s) {
580
580
  return;
581
581
  }
582
582
  e.dragLeft = T, f = T * v, e.thumbAngle = f, t.rotate && t.rotate(f), x.cancelBubble = !0, x.preventDefault();
583
- }, L = (x) => {
584
- se(s.value, x) && k && (s.value.removeEventListener("mousemove", M, !1), s.value.removeEventListener("touchmove", M, { passive: !1 }), s.value.removeEventListener("mouseup", L, !1), s.value.removeEventListener("mouseout", L, !1), s.value.removeEventListener("touchend", L, !1), k = !1, t.confirm && t.confirm(parseInt(f.toString()), () => {
583
+ }, y = (x) => {
584
+ se(s.value, x) && k && (s.value.removeEventListener("mousemove", S, !1), s.value.removeEventListener("touchmove", S, { passive: !1 }), s.value.removeEventListener("mouseup", y, !1), s.value.removeEventListener("mouseout", y, !1), s.value.removeEventListener("touchend", y, !1), k = !1, t.confirm && t.confirm(parseInt(f.toString()), () => {
585
585
  a();
586
586
  }), x.cancelBubble = !0, x.preventDefault());
587
587
  };
588
- s.value.addEventListener("mousemove", M, !1), s.value.addEventListener("touchmove", M, { passive: !1 }), s.value.addEventListener("mouseup", L, !1), s.value.addEventListener("mouseout", L, !1), s.value.addEventListener("touchend", L, !1);
588
+ s.value.addEventListener("mousemove", S, !1), s.value.addEventListener("touchmove", S, { passive: !1 }), s.value.addEventListener("mouseup", y, !1), s.value.addEventListener("mouseout", y, !1), s.value.addEventListener("touchend", y, !1);
589
589
  },
590
590
  closeEvent: (u) => (t && t.close && t.close(), a(), u.cancelBubble = !0, u.preventDefault(), !1),
591
591
  refreshEvent: (u) => (t && t.refresh && t.refresh(), a(), u.cancelBubble = !0, u.preventDefault(), !1)
592
592
  };
593
593
  }
594
- const Qe = { class: "gc-header" }, Ue = { class: "gc-icon-block" }, Ze = { class: "gc-loading" }, Re = ["src"], et = /* @__PURE__ */ c("div", { class: "gc-round" }, null, -1), tt = { class: "gc-thumb gc-rotate-thumb" }, nt = ["src"], ct = { class: "gc-footer" }, st = /* @__PURE__ */ c("div", { class: "gc-drag-line" }, null, -1), O = /* @__PURE__ */ D({
594
+ const Oe = { class: "gc-header" }, Qe = { class: "gc-icon-block" }, Ue = { class: "gc-loading" }, Ze = ["src"], Re = /* @__PURE__ */ c("div", { class: "gc-round" }, null, -1), et = { class: "gc-thumb gc-rotate-thumb" }, tt = ["src"], nt = { class: "gc-footer" }, ct = /* @__PURE__ */ c("div", { class: "gc-drag-line" }, null, -1), O = /* @__PURE__ */ M({
595
595
  __name: "index",
596
596
  props: {
597
597
  config: { default: te },
@@ -599,17 +599,17 @@ const Qe = { class: "gc-header" }, Ue = { class: "gc-icon-block" }, Ze = { class
599
599
  data: { default: () => ({}) }
600
600
  },
601
601
  setup(l) {
602
- const t = l, { data: n, events: s } = t, e = X({
602
+ const t = l, { data: n, events: s } = t, e = D({
603
603
  ...te(),
604
604
  ...t.config
605
605
  });
606
- K(() => t.config, () => {
606
+ j(() => t.config, () => {
607
607
  e.value = {
608
608
  ...e.value,
609
609
  ...t.config
610
610
  };
611
611
  });
612
- const a = X(null), d = X(null), o = Oe(n, s, d, a), E = z(() => {
612
+ const a = D(null), d = D(null), o = Ke(n, s, d, a), E = z(() => {
613
613
  const r = e.value.horizontalPadding || 0, h = e.value.verticalPadding || 0;
614
614
  return {
615
615
  width: (e.value.width || 0) + r * 2 + (e.value.showTheme ? 2 : 0) + "px",
@@ -632,11 +632,11 @@ const Qe = { class: "gc-header" }, Ue = { class: "gc-icon-block" }, Ze = { class
632
632
  await ce(), d.value && d.value.addEventListener("dragstart", (r) => r.preventDefault());
633
633
  }), (r, h) => (b(), C("div", {
634
634
  class: I(`go-captcha gc-wrapper ${e.value.showTheme ? "gc-theme" : ""}`),
635
- style: p(E.value)
635
+ style: m(E.value)
636
636
  }, [
637
- c("div", Qe, [
638
- c("span", null, N(e.value.title), 1),
639
- c("div", Ue, [
637
+ c("div", Oe, [
638
+ c("span", null, V(e.value.title), 1),
639
+ c("div", Qe, [
640
640
  P(Z, {
641
641
  width: 22,
642
642
  height: 22,
@@ -652,38 +652,38 @@ const Qe = { class: "gc-header" }, Ue = { class: "gc-icon-block" }, Ze = { class
652
652
  c("div", {
653
653
  class: "gc-body gc-rotate-body",
654
654
  ref: "containerRef",
655
- style: p(g.value)
655
+ style: m(g.value)
656
656
  }, [
657
- c("div", Ze, [
657
+ c("div", Ue, [
658
658
  P(ee)
659
659
  ]),
660
660
  c("div", {
661
661
  class: "gc-picture gc-rotate-picture",
662
- style: p(g.value)
662
+ style: m(g.value)
663
663
  }, [
664
664
  H(c("img", {
665
665
  src: i(n).image,
666
666
  alt: "..."
667
- }, null, 8, Re), [
667
+ }, null, 8, Ze), [
668
668
  [F, i(n).image !== ""]
669
669
  ]),
670
- et
670
+ Re
671
671
  ], 4),
672
- c("div", tt, [
672
+ c("div", et, [
673
673
  c("div", {
674
674
  class: "gc-rotate-thumb-block",
675
- style: p(u.value)
675
+ style: m(u.value)
676
676
  }, [
677
677
  H(c("img", {
678
678
  src: i(n).thumb,
679
679
  alt: "..."
680
- }, null, 8, nt), [
680
+ }, null, 8, tt), [
681
681
  [F, i(n).thumb !== ""]
682
682
  ])
683
683
  ], 4)
684
684
  ])
685
685
  ], 4),
686
- c("div", ct, [
686
+ c("div", nt, [
687
687
  c("div", {
688
688
  class: "gc-drag-slide-bar",
689
689
  ref_key: "dragBarRef",
@@ -691,39 +691,39 @@ const Qe = { class: "gc-header" }, Ue = { class: "gc-icon-block" }, Ze = { class
691
691
  onMousedown: h[1] || (h[1] = //@ts-ignore
692
692
  (..._) => i(o).dragEvent && i(o).dragEvent(..._))
693
693
  }, [
694
- st,
694
+ ct,
695
695
  c("div", {
696
696
  class: "gc-drag-block",
697
697
  ref_key: "dragBlockRef",
698
698
  ref: d,
699
699
  onTouchstart: h[0] || (h[0] = //@ts-ignore
700
700
  (..._) => i(o).dragEvent && i(o).dragEvent(..._)),
701
- style: p({ left: i(o).state.dragLeft + "px" })
701
+ style: m({ left: i(o).state.dragLeft + "px" })
702
702
  }, [
703
- P(re)
703
+ P(ue)
704
704
  ], 36)
705
705
  ], 544)
706
706
  ])
707
707
  ], 6));
708
708
  }
709
709
  });
710
- O.name = "goCaptchaRotate";
710
+ O.name = "gocaptcha-rotate";
711
711
  O.install = function(l) {
712
712
  l.component("gocaptcha-rotate", O);
713
713
  };
714
- const lt = /* @__PURE__ */ c("circle", {
714
+ const st = /* @__PURE__ */ c("circle", {
715
715
  fill: "#3E7CFF",
716
716
  cx: "100",
717
717
  cy: "100",
718
718
  r: "96.3"
719
- }, null, -1), ot = /* @__PURE__ */ c("path", {
719
+ }, null, -1), lt = /* @__PURE__ */ c("path", {
720
720
  fill: "#FFFFFF",
721
721
  d: `M140.8,64.4l-39.6-11.9h-2.4L59.2,64.4c-1.6,0.8-2.8,2.4-2.8,4v24.1c0,25.3,15.8,45.9,42.3,54.6
722
722
  c0.4,0,0.8,0.4,1.2,0.4c0.4,0,0.8,0,1.2-0.4c26.5-8.7,42.3-28.9,42.3-54.6V68.3C143.5,66.8,142.3,65.2,140.8,64.4z`
723
- }, null, -1), it = [
724
- lt,
725
- ot
726
- ], at = /* @__PURE__ */ D({
723
+ }, null, -1), ot = [
724
+ st,
725
+ lt
726
+ ], it = /* @__PURE__ */ M({
727
727
  __name: "btn-default-icon",
728
728
  emits: ["click"],
729
729
  setup(l, { emit: t }) {
@@ -736,18 +736,18 @@ const lt = /* @__PURE__ */ c("circle", {
736
736
  viewBox: "0 0 200 200",
737
737
  width: "20",
738
738
  height: "20"
739
- }, e.$attrs, { onClick: s }), it, 16));
739
+ }, e.$attrs, { onClick: s }), ot, 16));
740
740
  }
741
- }), ut = /* @__PURE__ */ c("path", {
741
+ }), at = /* @__PURE__ */ c("path", {
742
742
  fill: "#FFA000",
743
743
  d: `M184,26.6L102.4,2.1h-4.9L16,26.6c-3.3,1.6-5.7,4.9-5.7,8.2v49.8c0,52.2,32.6,94.7,87.3,112.6
744
744
  c0.8,0,1.6,0.8,2.4,0.8s1.6,0,2.4-0.8c54.7-18,87.3-59.6,87.3-112.6V34.7C189.8,31.5,187.3,28.2,184,26.6z M107.3,109.1
745
745
  c-0.5,5.4-3.9,7.9-7.3,7.9c-2.5,0,0,0,0,0c-3.2-0.6-5.7-2-6.8-7.4l-4.4-50.9c0-5.1,6.2-9.7,11.5-9.7c5.3,0,11,4.7,11,9.9
746
746
  L107.3,109.1z M109.3,133.3c0,5.1-4.2,9.3-9.3,9.3c-5.1,0-9.3-4.2-9.3-9.3c0-5.1,4.2-9.3,9.3-9.3C105.1,124,109.3,128.1,109.3,133.3
747
747
  z`
748
- }, null, -1), rt = [
749
- ut
750
- ], dt = /* @__PURE__ */ D({
748
+ }, null, -1), ut = [
749
+ at
750
+ ], rt = /* @__PURE__ */ M({
751
751
  __name: "btn-warn-icon",
752
752
  emits: ["click"],
753
753
  setup(l, { emit: t }) {
@@ -760,18 +760,18 @@ const lt = /* @__PURE__ */ c("circle", {
760
760
  viewBox: "0 0 200 200",
761
761
  width: "20",
762
762
  height: "20"
763
- }, e.$attrs, { onClick: s }), rt, 16));
763
+ }, e.$attrs, { onClick: s }), ut, 16));
764
764
  }
765
- }), ht = /* @__PURE__ */ c("path", {
765
+ }), dt = /* @__PURE__ */ c("path", {
766
766
  fill: "#ED4630",
767
767
  d: `M184,26.6L102.4,2.1h-4.9L16,26.6c-3.3,1.6-5.7,4.9-5.7,8.2v49.8c0,52.2,32.6,94.7,87.3,112.6
768
768
  c0.8,0,1.6,0.8,2.4,0.8s1.6,0,2.4-0.8c54.7-18,87.3-59.6,87.3-112.6V34.7C189.8,31.5,187.3,28.2,184,26.6z M134.5,123.1
769
769
  c3.1,3.1,3.1,8.2,0,11.3c-1.6,1.6-3.6,2.3-5.7,2.3s-4.1-0.8-5.7-2.3L100,111.3l-23.1,23.1c-1.6,1.6-3.6,2.3-5.7,2.3
770
770
  c-2,0-4.1-0.8-5.7-2.3c-3.1-3.1-3.1-8.2,0-11.3L88.7,100L65.5,76.9c-3.1-3.1-3.1-8.2,0-11.3c3.1-3.1,8.2-3.1,11.3,0L100,88.7
771
771
  l23.1-23.1c3.1-3.1,8.2-3.1,11.3,0c3.1,3.1,3.1,8.2,0,11.3L111.3,100L134.5,123.1z`
772
- }, null, -1), vt = [
773
- ht
774
- ], gt = /* @__PURE__ */ D({
772
+ }, null, -1), ht = [
773
+ dt
774
+ ], vt = /* @__PURE__ */ M({
775
775
  __name: "btn-error-icon",
776
776
  emits: ["click"],
777
777
  setup(l, { emit: t }) {
@@ -784,17 +784,17 @@ const lt = /* @__PURE__ */ c("circle", {
784
784
  viewBox: "0 0 200 200",
785
785
  width: "20",
786
786
  height: "20"
787
- }, e.$attrs, { onClick: s }), vt, 16));
787
+ }, e.$attrs, { onClick: s }), ht, 16));
788
788
  }
789
- }), ft = /* @__PURE__ */ c("path", {
789
+ }), gt = /* @__PURE__ */ c("path", {
790
790
  fill: "#5EAA2F",
791
791
  d: `M183.3,27.2L102.4,2.9h-4.9L16.7,27.2C13.4,28.8,11,32,11,35.3v49.4c0,51.8,32.4,93.9,86.6,111.7
792
792
  c0.8,0,1.6,0.8,2.4,0.8c0.8,0,1.6,0,2.4-0.8c54.2-17.8,86.6-59.1,86.6-111.7V35.3C189,32,186.6,28.8,183.3,27.2z M146.1,81.4
793
793
  l-48.5,48.5c-1.6,1.6-3.2,2.4-5.7,2.4c-2.4,0-4-0.8-5.7-2.4L62,105.7c-3.2-3.2-3.2-8.1,0-11.3c3.2-3.2,8.1-3.2,11.3,0l18.6,18.6
794
794
  l42.9-42.9c3.2-3.2,8.1-3.2,11.3,0C149.4,73.3,149.4,78.2,146.1,81.4L146.1,81.4z`
795
- }, null, -1), mt = [
796
- ft
797
- ], pt = /* @__PURE__ */ D({
795
+ }, null, -1), ft = [
796
+ gt
797
+ ], pt = /* @__PURE__ */ M({
798
798
  __name: "btn-success-icon",
799
799
  emits: ["click"],
800
800
  setup(l, { emit: t }) {
@@ -807,14 +807,14 @@ const lt = /* @__PURE__ */ c("circle", {
807
807
  viewBox: "0 0 200 200",
808
808
  width: "20",
809
809
  height: "20"
810
- }, e.$attrs, { onClick: s }), mt, 16));
810
+ }, e.$attrs, { onClick: s }), ft, 16));
811
811
  }
812
812
  }), ae = () => ({
813
813
  width: 330,
814
814
  height: 44,
815
815
  verticalPadding: 12,
816
816
  horizontalPadding: 16
817
- }), Q = /* @__PURE__ */ D({
817
+ }), Q = /* @__PURE__ */ M({
818
818
  __name: "index",
819
819
  props: {
820
820
  config: { default: ae },
@@ -825,11 +825,11 @@ const lt = /* @__PURE__ */ c("circle", {
825
825
  },
826
826
  emits: ["click-event"],
827
827
  setup(l, { emit: t }) {
828
- const n = l, { type: s, title: e, disabled: a } = ge(n), d = X({
828
+ const n = l, { type: s, title: e, disabled: a } = ve(n), d = D({
829
829
  ...ae(),
830
830
  ...n.config
831
831
  });
832
- K(() => n.config, () => {
832
+ j(() => n.config, () => {
833
833
  d.value = {
834
834
  ...d.value,
835
835
  ...n.config
@@ -848,30 +848,30 @@ const lt = /* @__PURE__ */ c("circle", {
848
848
  }
849
849
  return (r, h) => (b(), C("div", {
850
850
  class: I(o.value),
851
- style: p(E.value),
851
+ style: m(E.value),
852
852
  onClick: g
853
853
  }, [
854
854
  c("div", {
855
855
  class: I(i(s) === "default" ? "gc-ripple" : "")
856
856
  }, [
857
- i(s) === "default" ? (b(), j(at, { key: 0 })) : i(s) === "warn" ? (b(), j(dt, { key: 1 })) : i(s) === "error" ? (b(), j(gt, { key: 2 })) : i(s) === "success" ? (b(), j(pt, { key: 3 })) : fe("", !0)
857
+ i(s) === "default" ? (b(), q(it, { key: 0 })) : i(s) === "warn" ? (b(), q(rt, { key: 1 })) : i(s) === "error" ? (b(), q(vt, { key: 2 })) : i(s) === "success" ? (b(), q(pt, { key: 3 })) : ge("", !0)
858
858
  ], 2),
859
- c("span", null, N(i(e)), 1)
859
+ c("span", null, V(i(e)), 1)
860
860
  ], 6));
861
861
  }
862
862
  });
863
- Q.name = "goCaptchaButton";
863
+ Q.name = "gocaptcha-button";
864
864
  Q.install = function(l) {
865
865
  l.component("gocaptcha-button", Q);
866
866
  };
867
- const ue = Symbol("INSTALLED_KEY"), wt = (l) => {
868
- l[ue] || (l[ue] = !0, [q, G, J, O, Q].forEach((t) => l.use(t)));
867
+ const _t = (l) => {
868
+ l.installed || (l.installed = !0, [G, J, K, O, Q].map((t) => l.use(t)));
869
869
  };
870
870
  export {
871
871
  Q as Button,
872
- q as Click,
872
+ G as Click,
873
873
  O as Rotate,
874
- G as Slide,
875
- J as SlideRegion,
876
- wt as default
874
+ J as Slide,
875
+ K as SlideRegion,
876
+ _t as default
877
877
  };
@@ -1,4 +1,4 @@
1
- (function(C,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(C=typeof globalThis<"u"?globalThis:C||self,e(C["go-captcha-vue"]={},C.Vue))})(this,function(C,e){"use strict";const Ae="",A=()=>({width:300,height:220,thumbWidth:150,thumbHeight:40,verticalPadding:16,horizontalPadding:12,showTheme:!0,title:"请在下图依次点击",buttonText:"确认"}),G=[e.createElementVNode("path",{d:`M100.1,189.9C100.1,189.9,100,189.9,100.1,189.9c-49.7,0-90-40.4-90-89.9c0-49.6,40.4-89.9,89.9-89.9
1
+ (function($,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):($=typeof globalThis<"u"?globalThis:$||self,e($["go-captcha-vue"]={},$.Vue))})(this,function($,e){"use strict";const Fe="",A=()=>({width:300,height:220,thumbWidth:150,thumbHeight:40,verticalPadding:16,horizontalPadding:12,showTheme:!0,title:"请在下图依次点击",buttonText:"确认"}),G=[e.createElementVNode("path",{d:`M100.1,189.9C100.1,189.9,100,189.9,100.1,189.9c-49.7,0-90-40.4-90-89.9c0-49.6,40.4-89.9,89.9-89.9
2
2
  c49.6,0,89.9,40.4,89.9,89.9c0,18.2-5.4,35.7-15.6,50.7c-1.5,2.1-3.6,3.4-6.1,3.9c-2.5,0.4-5-0.1-7-1.6c-4.2-3-5.3-8.6-2.4-12.9
3
3
  c8.1-11.9,12.4-25.7,12.4-40.1c0-39.2-31.9-71.1-71.1-71.1c-39.2,0-71.1,31.9-71.1,71.1c0,39.2,31.9,71.1,71.1,71.1
4
4
  c7.7,0,15.3-1.2,22.6-3.6c2.4-0.8,4.9-0.6,7.2,0.5c2.2,1.1,3.9,3.1,4.7,5.5c1.6,4.9-1,10.2-5.9,11.9
@@ -22,18 +22,18 @@
22
22
  c0.6,0.1,1.3,0.3,1.9,0.4c1.4,0.3,2.8,0.7,4.2,1.1c0.4,0.1,0.9,0.3,1.3,0.4c1.6,0.5,3.1,1.1,4.6,1.7c0.2,0.1,0.3,0.1,0.5,0.2
23
23
  c9,3.9,17,10,23.2,17.6c0,0,0.1,0.1,0.1,0.2c8.7,10.7,14,24.5,14,39.4H147c-0.4,0-0.7,0.2-0.9,0.5c-0.2,0.3-0.2,0.8,0,1.1l24,36.4
24
24
  c0.2,0.3,0.5,0.5,0.9,0.5c0.4,0,0.7-0.2,0.9-0.5l23.9-36.4c0.2-0.3,0.2-0.7,0-1.1c-0.2-0.3-0.5-0.5-0.9-0.5L180.6,98.9L180.6,98.9
25
- L180.6,98.9z`},null,-1)],Y=e.defineComponent({__name:"refresh-icon",emits:["click"],setup(l,{emit:n}){const c=n;function o(t){c("click",t)}return(t,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},t.$attrs,{onClick:o}),J,16))}}),Q=[e.createElementVNode("circle",{cx:"50",cy:"36.8101",r:"10"},[e.createElementVNode("animate",{attributeName:"cy",dur:"1s",repeatCount:"indefinite",calcMode:"spline",keySplines:"0.45 0 0.9 0.55;0 0.45 0.55 0.9",keyTimes:"0;0.5;1",values:"23;77;23"})],-1)],W=e.defineComponent({__name:"loading-icon",emits:["click"],setup(l,{emit:n}){const c=n;function o(t){c("click",t)}return(t,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",width:"84",height:"84"},t.$attrs,{onClick:o}),Q,16))}});function U(l){let n=0,c=0;if(l.getBoundingClientRect){const o=l.getBoundingClientRect(),t=document.documentElement;n=o.left+Math.max(t.scrollLeft,document.body.scrollLeft)-t.clientLeft,c=o.top+Math.max(t.scrollTop,document.body.scrollTop)-t.clientTop}else for(;l!==document.body;)n+=l.offsetLeft,c+=l.offsetTop,l=l.offsetParent;return{domX:n,domY:c}}function H(l,n){let c=n.relatedTarget;try{for(;c&&c!==l;)c=c.parentNode}catch(o){console.warn(o)}return c!==l}function Z(l,n){const c=e.reactive({list:[]});return{dots:c,clickEvent:s=>{const w=s.currentTarget,a=U(w),f=s.pageX||s.clientX,r=s.pageY||s.clientY,h=a.domX,u=a.domY,_=f-h,m=r-u,g=parseInt(_.toString()),k=parseInt(m.toString()),x=new Date,$=c.list.length,b=c.list;return b.push({key:x.getTime(),index:$+1,x:g,y:k}),c.list=b,n.click&&n.click(g,k),s.cancelBubble=!0,s.preventDefault(),!1},confirmEvent:s=>(n.confirm&&n.confirm(e.toRaw(c.list),()=>{c.list=[]}),s.cancelBubble=!0,s.preventDefault(),!1),closeEvent:s=>(n.close&&n.close(),c.list=[],s.cancelBubble=!0,s.preventDefault(),!1),refreshEvent:s=>(n.refresh&&n.refresh(),c.list=[],s.cancelBubble=!0,s.preventDefault(),!1)}}const R={class:"gc-header"},ee=["src"],te={class:"gc-loading"},ne=["src"],ce={class:"gc-dots"},oe={class:"gc-footer"},le={class:"gc-icon-block gc-icon-block2"},se={class:"gc-button-block"},z=e.defineComponent({__name:"index",props:{config:{default:A},events:{default:()=>({})},data:{default:()=>({})}},setup(l){const n=l,{data:c,events:o}=n,t=e.ref({...A(),...n.config});e.watch(()=>n.config,()=>{t.value={...t.value,...n.config}});const i=Z(c,o),d=t.value.horizontalPadding||0,s=t.value.verticalPadding||0,w=(t.value.width||0)+d*2+(t.value.showTheme?2:0),a=i.dots,f=e.computed(()=>({width:w+"px",paddingLeft:d+"px",paddingRight:d+"px",paddingTop:s+"px",paddingBottom:s+"px"})),r=e.computed(()=>({width:t.value.thumbWidth+"px",height:t.value.thumbHeight+"px"})),h=e.computed(()=>({width:t.value.width+"px",height:t.value.height+"px"}));return(u,_)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`go-captcha gc-wrapper ${t.value.showTheme?"gc-theme":""}`),style:e.normalizeStyle(f.value)},[e.createElementVNode("div",R,[e.createElementVNode("span",null,e.toDisplayString(t.value.title),1),e.withDirectives(e.createElementVNode("img",{style:e.normalizeStyle(r.value),src:e.unref(c).thumb,alt:"..."},null,12,ee),[[e.vShow,e.unref(c).thumb!==""]])]),e.createElementVNode("div",{class:"gc-body",style:e.normalizeStyle(h.value)},[e.createElementVNode("div",te,[e.createVNode(W)]),e.withDirectives(e.createElementVNode("img",{style:e.normalizeStyle(h.value),class:"gc-picture",src:e.unref(c).image,alt:"...",onClick:_[0]||(_[0]=(...m)=>e.unref(i).clickEvent&&e.unref(i).clickEvent(...m))},null,12,ne),[[e.vShow,e.unref(c).image!==""]]),e.createElementVNode("div",ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a).list,m=>(e.openBlock(),e.createElementBlock("div",{class:"gc-dot",key:`${m.key+"-"+m.index}`,style:e.normalizeStyle({top:m.y-11+"px",left:m.x-11+"px"})},e.toDisplayString(m.index),5))),128))])],4),e.createElementVNode("div",oe,[e.createElementVNode("div",le,[e.createVNode(X,{width:22,height:22,onClick:e.unref(i).closeEvent},null,8,["onClick"]),e.createVNode(Y,{width:22,height:22,onClick:e.unref(i).refreshEvent},null,8,["onClick"])]),e.createElementVNode("div",se,[e.createElementVNode("button",{onClick:_[1]||(_[1]=(...m)=>e.unref(i).confirmEvent&&e.unref(i).confirmEvent(...m))},e.toDisplayString(t.value.buttonText),1)])])],6))}}),qe="";z.name="goCaptchaClick",z.install=function(l){l.component("gocaptcha-click",z)};const I=()=>({width:300,height:220,thumbWidth:150,thumbHeight:40,verticalPadding:16,horizontalPadding:12,showTheme:!0,title:"请拖动滑块完成拼图"}),ie=[e.createElementVNode("path",{d:`M131.6,116.3c0,0-75.6,0-109.7,0c-9.1,0-16.2-7.4-16.2-16.2c0-9.1,7.4-16.2,16.2-16.2c28.7,0,109.7,0,109.7,0
25
+ L180.6,98.9z`},null,-1)],W=e.defineComponent({__name:"refresh-icon",emits:["click"],setup(l,{emit:n}){const c=n;function o(t){c("click",t)}return(t,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},t.$attrs,{onClick:o}),J,16))}}),K=[e.createElementVNode("circle",{cx:"50",cy:"36.8101",r:"10"},[e.createElementVNode("animate",{attributeName:"cy",dur:"1s",repeatCount:"indefinite",calcMode:"spline",keySplines:"0.45 0 0.9 0.55;0 0.45 0.55 0.9",keyTimes:"0;0.5;1",values:"23;77;23"})],-1)],Y=e.defineComponent({__name:"loading-icon",emits:["click"],setup(l,{emit:n}){const c=n;function o(t){c("click",t)}return(t,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",width:"84",height:"84"},t.$attrs,{onClick:o}),K,16))}});function Q(l){let n=0,c=0;if(l.getBoundingClientRect){const o=l.getBoundingClientRect(),t=document.documentElement;n=o.left+Math.max(t.scrollLeft,document.body.scrollLeft)-t.clientLeft,c=o.top+Math.max(t.scrollTop,document.body.scrollTop)-t.clientTop}else for(;l!==document.body;)n+=l.offsetLeft,c+=l.offsetTop,l=l.offsetParent;return{domX:n,domY:c}}function H(l,n){let c=n.relatedTarget;try{for(;c&&c!==l;)c=c.parentNode}catch(o){console.warn(o)}return c!==l}function U(l,n){const c=e.reactive({list:[]});return{dots:c,clickEvent:s=>{const w=s.currentTarget,a=Q(w),f=s.pageX||s.clientX,r=s.pageY||s.clientY,h=a.domX,u=a.domY,_=f-h,m=r-u,g=parseInt(_.toString()),k=parseInt(m.toString()),x=new Date,C=c.list.length,b=c.list;return b.push({key:x.getTime(),index:C+1,x:g,y:k}),c.list=b,n.click&&n.click(g,k),s.cancelBubble=!0,s.preventDefault(),!1},confirmEvent:s=>(n.confirm&&n.confirm(e.toRaw(c.list),()=>{c.list=[]}),s.cancelBubble=!0,s.preventDefault(),!1),closeEvent:s=>(n.close&&n.close(),c.list=[],s.cancelBubble=!0,s.preventDefault(),!1),refreshEvent:s=>(n.refresh&&n.refresh(),c.list=[],s.cancelBubble=!0,s.preventDefault(),!1)}}const Z={class:"gc-header"},R=["src"],ee={class:"gc-loading"},te=["src"],ne={class:"gc-dots"},ce={class:"gc-footer"},oe={class:"gc-icon-block gc-icon-block2"},le={class:"gc-button-block"},z=e.defineComponent({__name:"index",props:{config:{default:A},events:{default:()=>({})},data:{default:()=>({})}},setup(l){const n=l,{data:c,events:o}=n,t=e.ref({...A(),...n.config});e.watch(()=>n.config,()=>{t.value={...t.value,...n.config}});const i=U(c,o),d=t.value.horizontalPadding||0,s=t.value.verticalPadding||0,w=(t.value.width||0)+d*2+(t.value.showTheme?2:0),a=i.dots,f=e.computed(()=>({width:w+"px",paddingLeft:d+"px",paddingRight:d+"px",paddingTop:s+"px",paddingBottom:s+"px"})),r=e.computed(()=>({width:t.value.thumbWidth+"px",height:t.value.thumbHeight+"px"})),h=e.computed(()=>({width:t.value.width+"px",height:t.value.height+"px"}));return(u,_)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`go-captcha gc-wrapper ${t.value.showTheme?"gc-theme":""}`),style:e.normalizeStyle(f.value)},[e.createElementVNode("div",Z,[e.createElementVNode("span",null,e.toDisplayString(t.value.title),1),e.withDirectives(e.createElementVNode("img",{style:e.normalizeStyle(r.value),src:e.unref(c).thumb,alt:"..."},null,12,R),[[e.vShow,e.unref(c).thumb!==""]])]),e.createElementVNode("div",{class:"gc-body",style:e.normalizeStyle(h.value)},[e.createElementVNode("div",ee,[e.createVNode(Y)]),e.withDirectives(e.createElementVNode("img",{style:e.normalizeStyle(h.value),class:"gc-picture",src:e.unref(c).image,alt:"...",onClick:_[0]||(_[0]=(...m)=>e.unref(i).clickEvent&&e.unref(i).clickEvent(...m))},null,12,te),[[e.vShow,e.unref(c).image!==""]]),e.createElementVNode("div",ne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a).list,m=>(e.openBlock(),e.createElementBlock("div",{class:"gc-dot",key:`${m.key+"-"+m.index}`,style:e.normalizeStyle({top:m.y-11+"px",left:m.x-11+"px"})},e.toDisplayString(m.index),5))),128))])],4),e.createElementVNode("div",ce,[e.createElementVNode("div",oe,[e.createVNode(X,{width:22,height:22,onClick:e.unref(i).closeEvent},null,8,["onClick"]),e.createVNode(W,{width:22,height:22,onClick:e.unref(i).refreshEvent},null,8,["onClick"])]),e.createElementVNode("div",le,[e.createElementVNode("button",{onClick:_[1]||(_[1]=(...m)=>e.unref(i).confirmEvent&&e.unref(i).confirmEvent(...m))},e.toDisplayString(t.value.buttonText),1)])])],6))}}),qe="";z.name="gocaptcha-click",z.install=function(l){l.component("gocaptcha-click",z)};const I=()=>({width:300,height:220,thumbWidth:150,thumbHeight:40,verticalPadding:16,horizontalPadding:12,showTheme:!0,title:"请拖动滑块完成拼图"}),se=[e.createElementVNode("path",{d:`M131.6,116.3c0,0-75.6,0-109.7,0c-9.1,0-16.2-7.4-16.2-16.2c0-9.1,7.4-16.2,16.2-16.2c28.7,0,109.7,0,109.7,0
26
26
  s-5.4-5.4-30.4-30.7c-6.4-6.4-6.4-16.7,0-23.1s16.7-6.4,23.1,0l58.4,58.4c6.4,6.4,6.4,16.7,0,23.1c0,0-32.9,32.9-57.9,57.9
27
- c-6.4,6.4-16.7,6.4-23.1,0c-6.4-6.4-6.4-16.7,0-23.1C121.8,126.2,131.6,116.3,131.6,116.3z`},null,-1)],j=e.defineComponent({__name:"arrows-icon",emits:["click"],setup(l,{emit:n}){const c=n;function o(t){c("click",t)}return(t,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},t.$attrs,{onClick:o}),ie,16))}});function ae(l,n,c,o,t,i){const d=e.reactive({dragLeft:0,thumbLeft:l.thumbX||0}),s=()=>{d.dragLeft=0,d.thumbLeft=0};return{state:d,dragEvent:r=>{const h=r.touches&&r.touches[0],u=t.value.offsetLeft,_=c.value.offsetWidth,m=t.value.offsetWidth,g=_-m,k=l.thumbX||0,x=o.value.offsetWidth,$=m-x,b=(g-k+$)/g;let E=!1,V=0,v=0;h?V=h.pageX-u:V=r.clientX-u;const N=p=>{E=!0;const B=p.touches&&p.touches[0];let y=0;if(B?y=B.pageX-V:y=p.clientX-V,y>=g){d.dragLeft=g;return}if(y<=0){d.dragLeft=0;return}d.dragLeft=y,v=k+y*b,d.thumbLeft=v,n.move&&n.move(v,l.thumbY||0),p.cancelBubble=!0,p.preventDefault()},L=p=>{H(i.value,p)&&E&&(i.value.removeEventListener("mousemove",N,!1),i.value.removeEventListener("touchmove",N,{passive:!1}),i.value.removeEventListener("mouseup",L,!1),i.value.removeEventListener("mouseout",L,!1),i.value.removeEventListener("touchend",L,!1),E=!1,n.confirm&&n.confirm({x:parseInt(v.toString()),y:l.thumbY||0},()=>{s()}),p.cancelBubble=!0,p.preventDefault())};i.value.addEventListener("mousemove",N,!1),i.value.addEventListener("touchmove",N,{passive:!1}),i.value.addEventListener("mouseup",L,!1),i.value.addEventListener("mouseout",L,!1),i.value.addEventListener("touchend",L,!1)},closeEvent:r=>(n&&n.close&&n.close(),s(),r.cancelBubble=!0,r.preventDefault(),!1),refreshEvent:r=>(n&&n.refresh&&n.refresh(),s(),r.cancelBubble=!0,r.preventDefault(),!1)}}const re={class:"gc-header"},de={class:"gc-icon-block"},he={class:"gc-loading"},me=["src"],fe=["src"],ge={class:"gc-footer"},pe=e.createElementVNode("div",{class:"gc-drag-line"},null,-1),T=e.defineComponent({__name:"index",props:{config:{default:I},events:{default:()=>({})},data:{default:()=>({})}},setup(l){const n=l,{data:c,events:o}=n,t=e.ref({...I(),...n.config});e.watch(()=>n.config,()=>{t.value={...t.value,...n.config}});const i=e.ref(null),d=e.ref(null),s=e.ref(null),w=e.ref(null),a=ae(c,o,d,w,s,i),f=t.value.horizontalPadding||0,r=t.value.verticalPadding||0,h=(t.value.width||0)+f*2+(t.value.showTheme?2:0),u=e.computed(()=>({width:h+"px",paddingLeft:f+"px",paddingRight:f+"px",paddingTop:r+"px",paddingBottom:r+"px"})),_=e.computed(()=>({width:c.thumbWidth+"px",height:c.thumbHeight+"px",top:c.thumbY+"px",left:a.state.thumbLeft+"px"})),m=e.computed(()=>({width:t.value.width+"px",height:t.value.height+"px"}));return e.onMounted(async()=>{await e.nextTick(),s.value&&s.value.addEventListener("dragstart",g=>g.preventDefault())}),(g,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`go-captcha gc-wrapper ${t.value.showTheme?"gc-theme":""}`),style:e.normalizeStyle(u.value)},[e.createElementVNode("div",re,[e.createElementVNode("span",null,e.toDisplayString(t.value.title),1),e.createElementVNode("div",de,[e.createVNode(X,{width:22,height:22,onClick:e.unref(a).closeEvent},null,8,["onClick"]),e.createVNode(Y,{width:22,height:22,onClick:e.unref(a).refreshEvent},null,8,["onClick"])])]),e.createElementVNode("div",{class:"gc-body",ref_key:"containerRef",ref:d,style:e.normalizeStyle(m.value)},[e.createElementVNode("div",he,[e.createVNode(W)]),e.withDirectives(e.createElementVNode("img",{class:"gc-picture",style:e.normalizeStyle(m.value),src:e.unref(c).image,alt:"..."},null,12,me),[[e.vShow,e.unref(c).image!==""]]),e.createElementVNode("div",{class:"gc-tile",ref_key:"tileRef",ref:w,style:e.normalizeStyle(_.value)},[e.withDirectives(e.createElementVNode("img",{src:e.unref(c).thumb,alt:"..."},null,8,fe),[[e.vShow,e.unref(c).thumb!==""]])],4)],4),e.createElementVNode("div",ge,[e.createElementVNode("div",{class:"gc-drag-slide-bar",ref_key:"dragBarRef",ref:i,onMousedown:k[1]||(k[1]=(...x)=>e.unref(a).dragEvent&&e.unref(a).dragEvent(...x))},[pe,e.createElementVNode("div",{class:"gc-drag-block",ref_key:"dragBlockRef",ref:s,onTouchstart:k[0]||(k[0]=(...x)=>e.unref(a).dragEvent&&e.unref(a).dragEvent(...x)),style:e.normalizeStyle({left:e.unref(a).state.dragLeft+"px"})},[e.createVNode(j)],36)],544)])],6))}}),Ge="";T.name="goCaptchaSlide",T.install=function(l){l.component("gocaptcha-slide",T)};const K=()=>({width:300,height:220,verticalPadding:16,horizontalPadding:12,showTheme:!0,title:"请拖拽贴图完成拼图"});function ue(l,n,c,o){const t=e.reactive({x:l.thumbX||0,y:l.thumbY||0}),i=()=>{t.x=l.thumbX||0,t.y=l.thumbY||0};return{state:t,dragEvent:a=>{const f=a.touches&&a.touches[0],r=o.value.offsetLeft,h=o.value.offsetTop,u=c.value.offsetWidth,_=c.value.offsetHeight,m=o.value.offsetWidth,g=o.value.offsetHeight,k=u-m,x=_-g;let $=!1,b=0,E=0,V=0,v=0;f?(b=f.pageX-r,E=f.pageY-h):(b=a.clientX-r,E=a.clientY-h);const N=p=>{$=!0;const B=p.touches&&p.touches[0];let y=0,S=0;B?(y=B.pageX-b,S=B.pageY-E):(y=p.clientX-b,S=p.clientY-E),y<=0&&(y=0),S<=0&&(S=0),y>=k&&(y=k),S>=x&&(S=x),t.x=y,t.y=S,V=y,v=S,n.move&&n.move(y,S),p.cancelBubble=!0,p.preventDefault()},L=p=>{H(c.value,p)&&$&&($=!1,c.value.removeEventListener("mousemove",N,!1),c.value.removeEventListener("touchmove",N,{passive:!1}),c.value.removeEventListener("mouseup",L,!1),c.value.removeEventListener("mouseout",L,!1),c.value.removeEventListener("touchend",L,!1),n.confirm&&n.confirm({x:V,y:v},()=>{i()}),p.cancelBubble=!0,p.preventDefault())};c.value.addEventListener("mousemove",N,!1),c.value.addEventListener("touchmove",N,{passive:!1}),c.value.addEventListener("mouseup",L,!1),c.value.addEventListener("mouseout",L,!1),c.value.addEventListener("touchend",L,!1)},closeEvent:a=>(n&&n.close&&n.close(),i(),a.cancelBubble=!0,a.preventDefault(),!1),refreshEvent:a=>(n&&n.refresh&&n.refresh(),i(),a.cancelBubble=!0,a.preventDefault(),!1)}}const _e={class:"gc-header gc-header2"},Ee={class:"gc-loading"},we=["src"],ke=["src"],be={class:"gc-footer"},ye={class:"gc-icon-block"},P=e.defineComponent({__name:"index",props:{config:{default:K},events:{default:()=>({})},data:{default:()=>({})}},setup(l){const n=l,{data:c,events:o}=n,t=e.ref({...K(),...n.config});e.watch(()=>n.config,()=>{t.value={...t.value,...n.config}});const i=e.ref(null),d=e.ref(null),s=ue(c,o,i,d),w=t.value.horizontalPadding||0,a=t.value.verticalPadding||0;let f=(t.value.width||0)+w*2+(t.value.showTheme?2:0);const r=e.computed(()=>({width:f+"px",paddingLeft:w+"px",paddingRight:w+"px",paddingTop:a+"px",paddingBottom:a+"px"})),h=e.computed(()=>({width:c.thumbWidth+"px",height:c.thumbHeight+"px",top:s.state.y+"px",left:s.state.x+"px"})),u=e.computed(()=>({width:t.value.width+"px",height:t.value.height+"px"}));return e.onMounted(async()=>{await e.nextTick(),d.value&&d.value.addEventListener("dragstart",_=>_.preventDefault())}),(_,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`go-captcha gc-wrapper ${t.value.showTheme?"gc-theme":""}`),style:e.normalizeStyle(r.value)},[e.createElementVNode("div",_e,[e.createElementVNode("span",null,e.toDisplayString(t.value.title),1)]),e.createElementVNode("div",{class:"gc-body",ref_key:"containerRef",ref:i,style:e.normalizeStyle(u.value)},[e.createElementVNode("div",Ee,[e.createVNode(W)]),e.withDirectives(e.createElementVNode("img",{class:"gc-picture",style:e.normalizeStyle(u.value),src:e.unref(c).image,alt:"..."},null,12,we),[[e.vShow,e.unref(c).image!==""]]),e.createElementVNode("div",{class:"gc-tile",ref_key:"tileRef",ref:d,style:e.normalizeStyle(h.value),onMousedown:m[0]||(m[0]=(...g)=>e.unref(s).dragEvent&&e.unref(s).dragEvent(...g)),onTouchstart:m[1]||(m[1]=(...g)=>e.unref(s).dragEvent&&e.unref(s).dragEvent(...g))},[e.withDirectives(e.createElementVNode("img",{src:e.unref(c).thumb,alt:"..."},null,8,ke),[[e.vShow,e.unref(c).thumb!==""]])],36)],4),e.createElementVNode("div",be,[e.createElementVNode("div",ye,[e.createVNode(X,{width:22,height:22,onClick:e.unref(s).closeEvent},null,8,["onClick"]),e.createVNode(Y,{width:22,height:22,onClick:e.unref(s).refreshEvent},null,8,["onClick"])])])],6))}}),Je="";P.name="goCaptchaSlideRegion",P.install=function(l){l.component("gocaptcha-slide-region",P)};const F=()=>({width:300,height:220,size:220,verticalPadding:16,horizontalPadding:12,showTheme:!0,title:"请拖动滑块完成拼图"});function xe(l,n,c,o){const t=e.reactive({dragLeft:0,thumbAngle:l.angle||0}),i=()=>{t.dragLeft=0,t.thumbAngle=0};return{state:t,dragEvent:a=>{const f=a.touches&&a.touches[0],r=c.value.offsetLeft,h=o.value.offsetWidth,u=c.value.offsetWidth,_=h-u,m=360/_;let g=0,k=!1,x=0;f?x=f.pageX-r:x=a.clientX-r;const $=E=>{k=!0;const V=E.touches&&E.touches[0];let v=0;if(V?v=V.pageX-x:v=E.clientX-x,v>=_){t.dragLeft=_;return}if(v<=0){t.dragLeft=0;return}t.dragLeft=v,g=v*m,t.thumbAngle=g,n.rotate&&n.rotate(g),E.cancelBubble=!0,E.preventDefault()},b=E=>{H(o.value,E)&&k&&(o.value.removeEventListener("mousemove",$,!1),o.value.removeEventListener("touchmove",$,{passive:!1}),o.value.removeEventListener("mouseup",b,!1),o.value.removeEventListener("mouseout",b,!1),o.value.removeEventListener("touchend",b,!1),k=!1,n.confirm&&n.confirm(parseInt(g.toString()),()=>{i()}),E.cancelBubble=!0,E.preventDefault())};o.value.addEventListener("mousemove",$,!1),o.value.addEventListener("touchmove",$,{passive:!1}),o.value.addEventListener("mouseup",b,!1),o.value.addEventListener("mouseout",b,!1),o.value.addEventListener("touchend",b,!1)},closeEvent:a=>(n&&n.close&&n.close(),i(),a.cancelBubble=!0,a.preventDefault(),!1),refreshEvent:a=>(n&&n.refresh&&n.refresh(),i(),a.cancelBubble=!0,a.preventDefault(),!1)}}const ve={class:"gc-header"},Le={class:"gc-icon-block"},Ce={class:"gc-loading"},$e=["src"],Ve=e.createElementVNode("div",{class:"gc-round"},null,-1),Ne={class:"gc-thumb gc-rotate-thumb"},Se=["src"],Be={class:"gc-footer"},ze=e.createElementVNode("div",{class:"gc-drag-line"},null,-1),D=e.defineComponent({__name:"index",props:{config:{default:F},events:{default:()=>({})},data:{default:()=>({})}},setup(l){const n=l,{data:c,events:o}=n,t=e.ref({...F(),...n.config});e.watch(()=>n.config,()=>{t.value={...t.value,...n.config}});const i=e.ref(null),d=e.ref(null),s=xe(c,o,d,i),w=e.computed(()=>{const r=t.value.horizontalPadding||0,h=t.value.verticalPadding||0;return{width:(t.value.width||0)+r*2+(t.value.showTheme?2:0)+"px",paddingLeft:r+"px",paddingRight:r+"px",paddingTop:h+"px",paddingBottom:h+"px"}}),a=e.computed(()=>({transform:`rotate(${s.state.thumbAngle}deg)`})),f=e.computed(()=>{var h;const r=(((h=t.value)==null?void 0:h.size)||0)>0?t.value.size:F().size;return{width:r+"px",height:r+"px"}});return e.onMounted(async()=>{await e.nextTick(),d.value&&d.value.addEventListener("dragstart",r=>r.preventDefault())}),(r,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`go-captcha gc-wrapper ${t.value.showTheme?"gc-theme":""}`),style:e.normalizeStyle(w.value)},[e.createElementVNode("div",ve,[e.createElementVNode("span",null,e.toDisplayString(t.value.title),1),e.createElementVNode("div",Le,[e.createVNode(X,{width:22,height:22,onClick:e.unref(s).closeEvent},null,8,["onClick"]),e.createVNode(Y,{width:22,height:22,onClick:e.unref(s).refreshEvent},null,8,["onClick"])])]),e.createElementVNode("div",{class:"gc-body gc-rotate-body",ref:"containerRef",style:e.normalizeStyle(f.value)},[e.createElementVNode("div",Ce,[e.createVNode(W)]),e.createElementVNode("div",{class:"gc-picture gc-rotate-picture",style:e.normalizeStyle(f.value)},[e.withDirectives(e.createElementVNode("img",{src:e.unref(c).image,alt:"..."},null,8,$e),[[e.vShow,e.unref(c).image!==""]]),Ve],4),e.createElementVNode("div",Ne,[e.createElementVNode("div",{class:"gc-rotate-thumb-block",style:e.normalizeStyle(a.value)},[e.withDirectives(e.createElementVNode("img",{src:e.unref(c).thumb,alt:"..."},null,8,Se),[[e.vShow,e.unref(c).thumb!==""]])],4)])],4),e.createElementVNode("div",Be,[e.createElementVNode("div",{class:"gc-drag-slide-bar",ref_key:"dragBarRef",ref:i,onMousedown:h[1]||(h[1]=(...u)=>e.unref(s).dragEvent&&e.unref(s).dragEvent(...u))},[ze,e.createElementVNode("div",{class:"gc-drag-block",ref_key:"dragBlockRef",ref:d,onTouchstart:h[0]||(h[0]=(...u)=>e.unref(s).dragEvent&&e.unref(s).dragEvent(...u)),style:e.normalizeStyle({left:e.unref(s).state.dragLeft+"px"})},[e.createVNode(j)],36)],544)])],6))}}),Qe="";D.name="goCaptchaRotate",D.install=function(l){l.component("gocaptcha-rotate",D)};const Te=[e.createElementVNode("circle",{fill:"#3E7CFF",cx:"100",cy:"100",r:"96.3"},null,-1),e.createElementVNode("path",{fill:"#FFFFFF",d:`M140.8,64.4l-39.6-11.9h-2.4L59.2,64.4c-1.6,0.8-2.8,2.4-2.8,4v24.1c0,25.3,15.8,45.9,42.3,54.6
28
- c0.4,0,0.8,0.4,1.2,0.4c0.4,0,0.8,0,1.2-0.4c26.5-8.7,42.3-28.9,42.3-54.6V68.3C143.5,66.8,142.3,65.2,140.8,64.4z`},null,-1)],Pe=e.defineComponent({__name:"btn-default-icon",emits:["click"],setup(l,{emit:n}){const c=n;function o(t){c("click",t)}return(t,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},t.$attrs,{onClick:o}),Te,16))}}),De=[e.createElementVNode("path",{fill:"#FFA000",d:`M184,26.6L102.4,2.1h-4.9L16,26.6c-3.3,1.6-5.7,4.9-5.7,8.2v49.8c0,52.2,32.6,94.7,87.3,112.6
27
+ c-6.4,6.4-16.7,6.4-23.1,0c-6.4-6.4-6.4-16.7,0-23.1C121.8,126.2,131.6,116.3,131.6,116.3z`},null,-1)],j=e.defineComponent({__name:"arrows-icon",emits:["click"],setup(l,{emit:n}){const c=n;function o(t){c("click",t)}return(t,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},t.$attrs,{onClick:o}),se,16))}});function ie(l,n,c,o,t,i){const d=e.reactive({dragLeft:0,thumbLeft:l.thumbX||0}),s=()=>{d.dragLeft=0,d.thumbLeft=0};return{state:d,dragEvent:r=>{const h=r.touches&&r.touches[0],u=t.value.offsetLeft,_=c.value.offsetWidth,m=t.value.offsetWidth,g=_-m,k=l.thumbX||0,x=o.value.offsetWidth,C=m-x,b=(g-k+C)/g;let E=!1,V=0,v=0;h?V=h.pageX-u:V=r.clientX-u;const N=p=>{E=!0;const B=p.touches&&p.touches[0];let y=0;if(B?y=B.pageX-V:y=p.clientX-V,y>=g){d.dragLeft=g;return}if(y<=0){d.dragLeft=0;return}d.dragLeft=y,v=k+y*b,d.thumbLeft=v,n.move&&n.move(v,l.thumbY||0),p.cancelBubble=!0,p.preventDefault()},L=p=>{H(i.value,p)&&E&&(i.value.removeEventListener("mousemove",N,!1),i.value.removeEventListener("touchmove",N,{passive:!1}),i.value.removeEventListener("mouseup",L,!1),i.value.removeEventListener("mouseout",L,!1),i.value.removeEventListener("touchend",L,!1),E=!1,n.confirm&&n.confirm({x:parseInt(v.toString()),y:l.thumbY||0},()=>{s()}),p.cancelBubble=!0,p.preventDefault())};i.value.addEventListener("mousemove",N,!1),i.value.addEventListener("touchmove",N,{passive:!1}),i.value.addEventListener("mouseup",L,!1),i.value.addEventListener("mouseout",L,!1),i.value.addEventListener("touchend",L,!1)},closeEvent:r=>(n&&n.close&&n.close(),s(),r.cancelBubble=!0,r.preventDefault(),!1),refreshEvent:r=>(n&&n.refresh&&n.refresh(),s(),r.cancelBubble=!0,r.preventDefault(),!1)}}const ae={class:"gc-header"},re={class:"gc-icon-block"},de={class:"gc-loading"},he=["src"],me=["src"],fe={class:"gc-footer"},ge=e.createElementVNode("div",{class:"gc-drag-line"},null,-1),T=e.defineComponent({__name:"index",props:{config:{default:I},events:{default:()=>({})},data:{default:()=>({})}},setup(l){const n=l,{data:c,events:o}=n,t=e.ref({...I(),...n.config});e.watch(()=>n.config,()=>{t.value={...t.value,...n.config}});const i=e.ref(null),d=e.ref(null),s=e.ref(null),w=e.ref(null),a=ie(c,o,d,w,s,i),f=t.value.horizontalPadding||0,r=t.value.verticalPadding||0,h=(t.value.width||0)+f*2+(t.value.showTheme?2:0),u=e.computed(()=>({width:h+"px",paddingLeft:f+"px",paddingRight:f+"px",paddingTop:r+"px",paddingBottom:r+"px"})),_=e.computed(()=>({width:c.thumbWidth+"px",height:c.thumbHeight+"px",top:c.thumbY+"px",left:a.state.thumbLeft+"px"})),m=e.computed(()=>({width:t.value.width+"px",height:t.value.height+"px"}));return e.onMounted(async()=>{await e.nextTick(),s.value&&s.value.addEventListener("dragstart",g=>g.preventDefault())}),(g,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`go-captcha gc-wrapper ${t.value.showTheme?"gc-theme":""}`),style:e.normalizeStyle(u.value)},[e.createElementVNode("div",ae,[e.createElementVNode("span",null,e.toDisplayString(t.value.title),1),e.createElementVNode("div",re,[e.createVNode(X,{width:22,height:22,onClick:e.unref(a).closeEvent},null,8,["onClick"]),e.createVNode(W,{width:22,height:22,onClick:e.unref(a).refreshEvent},null,8,["onClick"])])]),e.createElementVNode("div",{class:"gc-body",ref_key:"containerRef",ref:d,style:e.normalizeStyle(m.value)},[e.createElementVNode("div",de,[e.createVNode(Y)]),e.withDirectives(e.createElementVNode("img",{class:"gc-picture",style:e.normalizeStyle(m.value),src:e.unref(c).image,alt:"..."},null,12,he),[[e.vShow,e.unref(c).image!==""]]),e.createElementVNode("div",{class:"gc-tile",ref_key:"tileRef",ref:w,style:e.normalizeStyle(_.value)},[e.withDirectives(e.createElementVNode("img",{src:e.unref(c).thumb,alt:"..."},null,8,me),[[e.vShow,e.unref(c).thumb!==""]])],4)],4),e.createElementVNode("div",fe,[e.createElementVNode("div",{class:"gc-drag-slide-bar",ref_key:"dragBarRef",ref:i,onMousedown:k[1]||(k[1]=(...x)=>e.unref(a).dragEvent&&e.unref(a).dragEvent(...x))},[ge,e.createElementVNode("div",{class:"gc-drag-block",ref_key:"dragBlockRef",ref:s,onTouchstart:k[0]||(k[0]=(...x)=>e.unref(a).dragEvent&&e.unref(a).dragEvent(...x)),style:e.normalizeStyle({left:e.unref(a).state.dragLeft+"px"})},[e.createVNode(j)],36)],544)])],6))}}),Ge="";T.name="gocaptcha-slide",T.install=function(l){l.component("gocaptcha-slide",T)};const q=()=>({width:300,height:220,verticalPadding:16,horizontalPadding:12,showTheme:!0,title:"请拖拽贴图完成拼图"});function pe(l,n,c,o){const t=e.reactive({x:l.thumbX||0,y:l.thumbY||0}),i=()=>{t.x=l.thumbX||0,t.y=l.thumbY||0};return{state:t,dragEvent:a=>{const f=a.touches&&a.touches[0],r=o.value.offsetLeft,h=o.value.offsetTop,u=c.value.offsetWidth,_=c.value.offsetHeight,m=o.value.offsetWidth,g=o.value.offsetHeight,k=u-m,x=_-g;let C=!1,b=0,E=0,V=0,v=0;f?(b=f.pageX-r,E=f.pageY-h):(b=a.clientX-r,E=a.clientY-h);const N=p=>{C=!0;const B=p.touches&&p.touches[0];let y=0,S=0;B?(y=B.pageX-b,S=B.pageY-E):(y=p.clientX-b,S=p.clientY-E),y<=0&&(y=0),S<=0&&(S=0),y>=k&&(y=k),S>=x&&(S=x),t.x=y,t.y=S,V=y,v=S,n.move&&n.move(y,S),p.cancelBubble=!0,p.preventDefault()},L=p=>{H(c.value,p)&&C&&(C=!1,c.value.removeEventListener("mousemove",N,!1),c.value.removeEventListener("touchmove",N,{passive:!1}),c.value.removeEventListener("mouseup",L,!1),c.value.removeEventListener("mouseout",L,!1),c.value.removeEventListener("touchend",L,!1),n.confirm&&n.confirm({x:V,y:v},()=>{i()}),p.cancelBubble=!0,p.preventDefault())};c.value.addEventListener("mousemove",N,!1),c.value.addEventListener("touchmove",N,{passive:!1}),c.value.addEventListener("mouseup",L,!1),c.value.addEventListener("mouseout",L,!1),c.value.addEventListener("touchend",L,!1)},closeEvent:a=>(n&&n.close&&n.close(),i(),a.cancelBubble=!0,a.preventDefault(),!1),refreshEvent:a=>(n&&n.refresh&&n.refresh(),i(),a.cancelBubble=!0,a.preventDefault(),!1)}}const ue={class:"gc-header gc-header2"},_e={class:"gc-loading"},Ee=["src"],we=["src"],ke={class:"gc-footer"},be={class:"gc-icon-block"},P=e.defineComponent({__name:"index",props:{config:{default:q},events:{default:()=>({})},data:{default:()=>({})}},setup(l){const n=l,{data:c,events:o}=n,t=e.ref({...q(),...n.config});e.watch(()=>n.config,()=>{t.value={...t.value,...n.config}});const i=e.ref(null),d=e.ref(null),s=pe(c,o,i,d),w=t.value.horizontalPadding||0,a=t.value.verticalPadding||0;let f=(t.value.width||0)+w*2+(t.value.showTheme?2:0);const r=e.computed(()=>({width:f+"px",paddingLeft:w+"px",paddingRight:w+"px",paddingTop:a+"px",paddingBottom:a+"px"})),h=e.computed(()=>({width:c.thumbWidth+"px",height:c.thumbHeight+"px",top:s.state.y+"px",left:s.state.x+"px"})),u=e.computed(()=>({width:t.value.width+"px",height:t.value.height+"px"}));return e.onMounted(async()=>{await e.nextTick(),d.value&&d.value.addEventListener("dragstart",_=>_.preventDefault())}),(_,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`go-captcha gc-wrapper ${t.value.showTheme?"gc-theme":""}`),style:e.normalizeStyle(r.value)},[e.createElementVNode("div",ue,[e.createElementVNode("span",null,e.toDisplayString(t.value.title),1)]),e.createElementVNode("div",{class:"gc-body",ref_key:"containerRef",ref:i,style:e.normalizeStyle(u.value)},[e.createElementVNode("div",_e,[e.createVNode(Y)]),e.withDirectives(e.createElementVNode("img",{class:"gc-picture",style:e.normalizeStyle(u.value),src:e.unref(c).image,alt:"..."},null,12,Ee),[[e.vShow,e.unref(c).image!==""]]),e.createElementVNode("div",{class:"gc-tile",ref_key:"tileRef",ref:d,style:e.normalizeStyle(h.value),onMousedown:m[0]||(m[0]=(...g)=>e.unref(s).dragEvent&&e.unref(s).dragEvent(...g)),onTouchstart:m[1]||(m[1]=(...g)=>e.unref(s).dragEvent&&e.unref(s).dragEvent(...g))},[e.withDirectives(e.createElementVNode("img",{src:e.unref(c).thumb,alt:"..."},null,8,we),[[e.vShow,e.unref(c).thumb!==""]])],36)],4),e.createElementVNode("div",ke,[e.createElementVNode("div",be,[e.createVNode(X,{width:22,height:22,onClick:e.unref(s).closeEvent},null,8,["onClick"]),e.createVNode(W,{width:22,height:22,onClick:e.unref(s).refreshEvent},null,8,["onClick"])])])],6))}}),Je="";P.name="gocaptcha-slide-region",P.install=function(l){l.component("gocaptcha-slide-region",P)};const F=()=>({width:300,height:220,size:220,verticalPadding:16,horizontalPadding:12,showTheme:!0,title:"请拖动滑块完成拼图"});function ye(l,n,c,o){const t=e.reactive({dragLeft:0,thumbAngle:l.angle||0}),i=()=>{t.dragLeft=0,t.thumbAngle=0};return{state:t,dragEvent:a=>{const f=a.touches&&a.touches[0],r=c.value.offsetLeft,h=o.value.offsetWidth,u=c.value.offsetWidth,_=h-u,m=360/_;let g=0,k=!1,x=0;f?x=f.pageX-r:x=a.clientX-r;const C=E=>{k=!0;const V=E.touches&&E.touches[0];let v=0;if(V?v=V.pageX-x:v=E.clientX-x,v>=_){t.dragLeft=_;return}if(v<=0){t.dragLeft=0;return}t.dragLeft=v,g=v*m,t.thumbAngle=g,n.rotate&&n.rotate(g),E.cancelBubble=!0,E.preventDefault()},b=E=>{H(o.value,E)&&k&&(o.value.removeEventListener("mousemove",C,!1),o.value.removeEventListener("touchmove",C,{passive:!1}),o.value.removeEventListener("mouseup",b,!1),o.value.removeEventListener("mouseout",b,!1),o.value.removeEventListener("touchend",b,!1),k=!1,n.confirm&&n.confirm(parseInt(g.toString()),()=>{i()}),E.cancelBubble=!0,E.preventDefault())};o.value.addEventListener("mousemove",C,!1),o.value.addEventListener("touchmove",C,{passive:!1}),o.value.addEventListener("mouseup",b,!1),o.value.addEventListener("mouseout",b,!1),o.value.addEventListener("touchend",b,!1)},closeEvent:a=>(n&&n.close&&n.close(),i(),a.cancelBubble=!0,a.preventDefault(),!1),refreshEvent:a=>(n&&n.refresh&&n.refresh(),i(),a.cancelBubble=!0,a.preventDefault(),!1)}}const xe={class:"gc-header"},ve={class:"gc-icon-block"},Le={class:"gc-loading"},$e=["src"],Ce=e.createElementVNode("div",{class:"gc-round"},null,-1),Ve={class:"gc-thumb gc-rotate-thumb"},Ne=["src"],Se={class:"gc-footer"},Be=e.createElementVNode("div",{class:"gc-drag-line"},null,-1),D=e.defineComponent({__name:"index",props:{config:{default:F},events:{default:()=>({})},data:{default:()=>({})}},setup(l){const n=l,{data:c,events:o}=n,t=e.ref({...F(),...n.config});e.watch(()=>n.config,()=>{t.value={...t.value,...n.config}});const i=e.ref(null),d=e.ref(null),s=ye(c,o,d,i),w=e.computed(()=>{const r=t.value.horizontalPadding||0,h=t.value.verticalPadding||0;return{width:(t.value.width||0)+r*2+(t.value.showTheme?2:0)+"px",paddingLeft:r+"px",paddingRight:r+"px",paddingTop:h+"px",paddingBottom:h+"px"}}),a=e.computed(()=>({transform:`rotate(${s.state.thumbAngle}deg)`})),f=e.computed(()=>{var h;const r=(((h=t.value)==null?void 0:h.size)||0)>0?t.value.size:F().size;return{width:r+"px",height:r+"px"}});return e.onMounted(async()=>{await e.nextTick(),d.value&&d.value.addEventListener("dragstart",r=>r.preventDefault())}),(r,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`go-captcha gc-wrapper ${t.value.showTheme?"gc-theme":""}`),style:e.normalizeStyle(w.value)},[e.createElementVNode("div",xe,[e.createElementVNode("span",null,e.toDisplayString(t.value.title),1),e.createElementVNode("div",ve,[e.createVNode(X,{width:22,height:22,onClick:e.unref(s).closeEvent},null,8,["onClick"]),e.createVNode(W,{width:22,height:22,onClick:e.unref(s).refreshEvent},null,8,["onClick"])])]),e.createElementVNode("div",{class:"gc-body gc-rotate-body",ref:"containerRef",style:e.normalizeStyle(f.value)},[e.createElementVNode("div",Le,[e.createVNode(Y)]),e.createElementVNode("div",{class:"gc-picture gc-rotate-picture",style:e.normalizeStyle(f.value)},[e.withDirectives(e.createElementVNode("img",{src:e.unref(c).image,alt:"..."},null,8,$e),[[e.vShow,e.unref(c).image!==""]]),Ce],4),e.createElementVNode("div",Ve,[e.createElementVNode("div",{class:"gc-rotate-thumb-block",style:e.normalizeStyle(a.value)},[e.withDirectives(e.createElementVNode("img",{src:e.unref(c).thumb,alt:"..."},null,8,Ne),[[e.vShow,e.unref(c).thumb!==""]])],4)])],4),e.createElementVNode("div",Se,[e.createElementVNode("div",{class:"gc-drag-slide-bar",ref_key:"dragBarRef",ref:i,onMousedown:h[1]||(h[1]=(...u)=>e.unref(s).dragEvent&&e.unref(s).dragEvent(...u))},[Be,e.createElementVNode("div",{class:"gc-drag-block",ref_key:"dragBlockRef",ref:d,onTouchstart:h[0]||(h[0]=(...u)=>e.unref(s).dragEvent&&e.unref(s).dragEvent(...u)),style:e.normalizeStyle({left:e.unref(s).state.dragLeft+"px"})},[e.createVNode(j)],36)],544)])],6))}}),Ke="";D.name="gocaptcha-rotate",D.install=function(l){l.component("gocaptcha-rotate",D)};const ze=[e.createElementVNode("circle",{fill:"#3E7CFF",cx:"100",cy:"100",r:"96.3"},null,-1),e.createElementVNode("path",{fill:"#FFFFFF",d:`M140.8,64.4l-39.6-11.9h-2.4L59.2,64.4c-1.6,0.8-2.8,2.4-2.8,4v24.1c0,25.3,15.8,45.9,42.3,54.6
28
+ c0.4,0,0.8,0.4,1.2,0.4c0.4,0,0.8,0,1.2-0.4c26.5-8.7,42.3-28.9,42.3-54.6V68.3C143.5,66.8,142.3,65.2,140.8,64.4z`},null,-1)],Te=e.defineComponent({__name:"btn-default-icon",emits:["click"],setup(l,{emit:n}){const c=n;function o(t){c("click",t)}return(t,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},t.$attrs,{onClick:o}),ze,16))}}),Pe=[e.createElementVNode("path",{fill:"#FFA000",d:`M184,26.6L102.4,2.1h-4.9L16,26.6c-3.3,1.6-5.7,4.9-5.7,8.2v49.8c0,52.2,32.6,94.7,87.3,112.6
29
29
  c0.8,0,1.6,0.8,2.4,0.8s1.6,0,2.4-0.8c54.7-18,87.3-59.6,87.3-112.6V34.7C189.8,31.5,187.3,28.2,184,26.6z M107.3,109.1
30
30
  c-0.5,5.4-3.9,7.9-7.3,7.9c-2.5,0,0,0,0,0c-3.2-0.6-5.7-2-6.8-7.4l-4.4-50.9c0-5.1,6.2-9.7,11.5-9.7c5.3,0,11,4.7,11,9.9
31
31
  L107.3,109.1z M109.3,133.3c0,5.1-4.2,9.3-9.3,9.3c-5.1,0-9.3-4.2-9.3-9.3c0-5.1,4.2-9.3,9.3-9.3C105.1,124,109.3,128.1,109.3,133.3
32
- z`},null,-1)],Me=e.defineComponent({__name:"btn-warn-icon",emits:["click"],setup(l,{emit:n}){const c=n;function o(t){c("click",t)}return(t,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},t.$attrs,{onClick:o}),De,16))}}),Xe=[e.createElementVNode("path",{fill:"#ED4630",d:`M184,26.6L102.4,2.1h-4.9L16,26.6c-3.3,1.6-5.7,4.9-5.7,8.2v49.8c0,52.2,32.6,94.7,87.3,112.6
32
+ z`},null,-1)],De=e.defineComponent({__name:"btn-warn-icon",emits:["click"],setup(l,{emit:n}){const c=n;function o(t){c("click",t)}return(t,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},t.$attrs,{onClick:o}),Pe,16))}}),Me=[e.createElementVNode("path",{fill:"#ED4630",d:`M184,26.6L102.4,2.1h-4.9L16,26.6c-3.3,1.6-5.7,4.9-5.7,8.2v49.8c0,52.2,32.6,94.7,87.3,112.6
33
33
  c0.8,0,1.6,0.8,2.4,0.8s1.6,0,2.4-0.8c54.7-18,87.3-59.6,87.3-112.6V34.7C189.8,31.5,187.3,28.2,184,26.6z M134.5,123.1
34
34
  c3.1,3.1,3.1,8.2,0,11.3c-1.6,1.6-3.6,2.3-5.7,2.3s-4.1-0.8-5.7-2.3L100,111.3l-23.1,23.1c-1.6,1.6-3.6,2.3-5.7,2.3
35
35
  c-2,0-4.1-0.8-5.7-2.3c-3.1-3.1-3.1-8.2,0-11.3L88.7,100L65.5,76.9c-3.1-3.1-3.1-8.2,0-11.3c3.1-3.1,8.2-3.1,11.3,0L100,88.7
36
- l23.1-23.1c3.1-3.1,8.2-3.1,11.3,0c3.1,3.1,3.1,8.2,0,11.3L111.3,100L134.5,123.1z`},null,-1)],Ye=e.defineComponent({__name:"btn-error-icon",emits:["click"],setup(l,{emit:n}){const c=n;function o(t){c("click",t)}return(t,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},t.$attrs,{onClick:o}),Xe,16))}}),We=[e.createElementVNode("path",{fill:"#5EAA2F",d:`M183.3,27.2L102.4,2.9h-4.9L16.7,27.2C13.4,28.8,11,32,11,35.3v49.4c0,51.8,32.4,93.9,86.6,111.7
36
+ l23.1-23.1c3.1-3.1,8.2-3.1,11.3,0c3.1,3.1,3.1,8.2,0,11.3L111.3,100L134.5,123.1z`},null,-1)],Xe=e.defineComponent({__name:"btn-error-icon",emits:["click"],setup(l,{emit:n}){const c=n;function o(t){c("click",t)}return(t,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},t.$attrs,{onClick:o}),Me,16))}}),We=[e.createElementVNode("path",{fill:"#5EAA2F",d:`M183.3,27.2L102.4,2.9h-4.9L16.7,27.2C13.4,28.8,11,32,11,35.3v49.4c0,51.8,32.4,93.9,86.6,111.7
37
37
  c0.8,0,1.6,0.8,2.4,0.8c0.8,0,1.6,0,2.4-0.8c54.2-17.8,86.6-59.1,86.6-111.7V35.3C189,32,186.6,28.8,183.3,27.2z M146.1,81.4
38
38
  l-48.5,48.5c-1.6,1.6-3.2,2.4-5.7,2.4c-2.4,0-4-0.8-5.7-2.4L62,105.7c-3.2-3.2-3.2-8.1,0-11.3c3.2-3.2,8.1-3.2,11.3,0l18.6,18.6
39
- l42.9-42.9c3.2-3.2,8.1-3.2,11.3,0C149.4,73.3,149.4,78.2,146.1,81.4L146.1,81.4z`},null,-1)],He=e.defineComponent({__name:"btn-success-icon",emits:["click"],setup(l,{emit:n}){const c=n;function o(t){c("click",t)}return(t,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},t.$attrs,{onClick:o}),We,16))}}),q=()=>({width:330,height:44,verticalPadding:12,horizontalPadding:16}),M=e.defineComponent({__name:"index",props:{config:{default:q},clickEvent:{},disabled:{type:Boolean,default:!1},type:{default:"default"},title:{default:"点击按键进行验证"}},emits:["click-event"],setup(l,{emit:n}){const c=l,{type:o,title:t,disabled:i}=e.toRefs(c),d=e.ref({...q(),...c.config});e.watch(()=>c.config,()=>{d.value={...d.value,...c.config}});const s=e.computed(()=>["go-captcha","gc-btn-block",`gc-${o.value}`,i.value?"gc-disabled":""]),w=e.computed(()=>({width:d.value.width+"px",height:d.value.height+"px",paddingLeft:d.value.horizontalPadding+"px",paddingRight:d.value.horizontalPadding+"px",paddingTop:d.value.verticalPadding+"px",paddingBottom:d.value.verticalPadding+"px"})),a=n;function f(r){a("click-event",r)}return(r,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(s.value),style:e.normalizeStyle(w.value),onClick:f},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(o)==="default"?"gc-ripple":"")},[e.unref(o)==="default"?(e.openBlock(),e.createBlock(Pe,{key:0})):e.unref(o)==="warn"?(e.openBlock(),e.createBlock(Me,{key:1})):e.unref(o)==="error"?(e.openBlock(),e.createBlock(Ye,{key:2})):e.unref(o)==="success"?(e.openBlock(),e.createBlock(He,{key:3})):e.createCommentVNode("",!0)],2),e.createElementVNode("span",null,e.toDisplayString(e.unref(t)),1)],6))}}),nt="";M.name="goCaptchaButton",M.install=function(l){l.component("gocaptcha-button",M)};const O=Symbol("INSTALLED_KEY"),Fe=l=>{l[O]||(l[O]=!0,[z,T,P,D,M].forEach(n=>l.use(n)))};C.Button=M,C.Click=z,C.Rotate=D,C.Slide=T,C.SlideRegion=P,C.default=Fe,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
39
+ l42.9-42.9c3.2-3.2,8.1-3.2,11.3,0C149.4,73.3,149.4,78.2,146.1,81.4L146.1,81.4z`},null,-1)],Ye=e.defineComponent({__name:"btn-success-icon",emits:["click"],setup(l,{emit:n}){const c=n;function o(t){c("click",t)}return(t,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},t.$attrs,{onClick:o}),We,16))}}),O=()=>({width:330,height:44,verticalPadding:12,horizontalPadding:16}),M=e.defineComponent({__name:"index",props:{config:{default:O},clickEvent:{},disabled:{type:Boolean,default:!1},type:{default:"default"},title:{default:"点击按键进行验证"}},emits:["click-event"],setup(l,{emit:n}){const c=l,{type:o,title:t,disabled:i}=e.toRefs(c),d=e.ref({...O(),...c.config});e.watch(()=>c.config,()=>{d.value={...d.value,...c.config}});const s=e.computed(()=>["go-captcha","gc-btn-block",`gc-${o.value}`,i.value?"gc-disabled":""]),w=e.computed(()=>({width:d.value.width+"px",height:d.value.height+"px",paddingLeft:d.value.horizontalPadding+"px",paddingRight:d.value.horizontalPadding+"px",paddingTop:d.value.verticalPadding+"px",paddingBottom:d.value.verticalPadding+"px"})),a=n;function f(r){a("click-event",r)}return(r,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(s.value),style:e.normalizeStyle(w.value),onClick:f},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(o)==="default"?"gc-ripple":"")},[e.unref(o)==="default"?(e.openBlock(),e.createBlock(Te,{key:0})):e.unref(o)==="warn"?(e.openBlock(),e.createBlock(De,{key:1})):e.unref(o)==="error"?(e.openBlock(),e.createBlock(Xe,{key:2})):e.unref(o)==="success"?(e.openBlock(),e.createBlock(Ye,{key:3})):e.createCommentVNode("",!0)],2),e.createElementVNode("span",null,e.toDisplayString(e.unref(t)),1)],6))}}),tt="";M.name="gocaptcha-button",M.install=function(l){l.component("gocaptcha-button",M)};const He=l=>{l.installed||(l.installed=!0,[z,T,P,D,M].map(n=>l.use(n)))};$.Button=M,$.Click=z,$.Rotate=D,$.Slide=T,$.SlideRegion=P,$.default=He,Object.defineProperties($,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "go-captcha-vue",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0-beta.3",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -28,6 +28,19 @@
28
28
  "module": "dist/go-captcha-vue.es.js",
29
29
  "types": "./dist/index.d.ts",
30
30
  "typings": "./dist/index.d.ts",
31
+ "exports": {
32
+ ".": {
33
+ "import": {
34
+ "node": "./dist/go-captcha-vue.es.js",
35
+ "default": "./dist/go-captcha-vue.es.js"
36
+ },
37
+ "require": "./dist/go-captcha-vue.es.js",
38
+ "types": "./dist/index.d.ts"
39
+ },
40
+ "./dist/*": "./dist/*",
41
+ "./env.d.ts": "./env.d.ts",
42
+ "./package.json": "./package.json"
43
+ },
31
44
  "files": [
32
45
  "dist/*",
33
46
  "env.d.ts"