go-captcha-vue 2.0.1 → 2.0.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.
Files changed (31) hide show
  1. package/README.md +43 -8
  2. package/dist/components/button/index.vue.d.ts +3 -6
  3. package/dist/components/click/hooks/handler.d.ts +5 -1
  4. package/dist/components/click/index.vue.d.ts +9 -6
  5. package/dist/components/click/meta/config.d.ts +2 -0
  6. package/dist/components/click/meta/data.d.ts +1 -1
  7. package/dist/components/click/meta/event.d.ts +2 -3
  8. package/dist/components/click/meta/expose.d.ts +11 -0
  9. package/dist/components/rotate/hooks/handler.d.ts +7 -1
  10. package/dist/components/rotate/index.vue.d.ts +9 -6
  11. package/dist/components/rotate/meta/config.d.ts +2 -0
  12. package/dist/components/rotate/meta/data.d.ts +1 -0
  13. package/dist/components/rotate/meta/event.d.ts +1 -1
  14. package/dist/components/rotate/meta/expose.d.ts +11 -0
  15. package/dist/components/slide/hooks/handler.d.ts +7 -1
  16. package/dist/components/slide/index.vue.d.ts +9 -6
  17. package/dist/components/slide/meta/config.d.ts +2 -0
  18. package/dist/components/slide/meta/data.d.ts +1 -0
  19. package/dist/components/slide/meta/event.d.ts +1 -1
  20. package/dist/components/slide/meta/expose.d.ts +11 -0
  21. package/dist/components/slide-region/hooks/handler.d.ts +7 -1
  22. package/dist/components/slide-region/index.vue.d.ts +9 -6
  23. package/dist/components/slide-region/meta/config.d.ts +2 -0
  24. package/dist/components/slide-region/meta/data.d.ts +1 -0
  25. package/dist/components/slide-region/meta/event.d.ts +1 -1
  26. package/dist/components/slide-region/meta/expose.d.ts +11 -0
  27. package/dist/go-captcha-vue.es.js +753 -565
  28. package/dist/go-captcha-vue.umd.js +8 -8
  29. package/dist/index.d.ts +4 -2
  30. package/dist/style.css +1 -1
  31. package/package.json +1 -1
@@ -1,5 +1,5 @@
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
- const le = () => ({
1
+ import { defineComponent as U, openBlock as z, createElementBlock as Y, mergeProps as oe, createElementVNode as o, reactive as B, toRaw as I, watch as F, computed as x, withDirectives as K, normalizeClass as se, normalizeStyle as D, toDisplayString as ie, vShow as Q, createVNode as A, unref as v, Fragment as De, renderList as $e, ref as ee, onMounted as pe, nextTick as _e, toRefs as ze, createBlock as ae, createCommentVNode as Ce } from "vue";
2
+ const we = () => ({
3
3
  width: 300,
4
4
  height: 220,
5
5
  thumbWidth: 150,
@@ -8,32 +8,34 @@ const le = () => ({
8
8
  horizontalPadding: 12,
9
9
  showTheme: !0,
10
10
  title: "请在下图依次点击",
11
- buttonText: "确认"
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
11
+ buttonText: "确认",
12
+ iconSize: 22,
13
+ dotSize: 24
14
+ }), Se = /* @__PURE__ */ o("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
15
  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
16
  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
17
  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
16
18
  C119.3,188.4,109.8,189.9,100.1,189.9z M73,136.4C73,136.4,73,136.4,73,136.4c-2.5,0-4.9-1-6.7-2.8c-3.7-3.7-3.7-9.6,0-13.3
17
19
  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
20
  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
- 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
- fe
21
- ], Z = /* @__PURE__ */ M({
21
+ 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), Be = [
22
+ Se
23
+ ], ge = /* @__PURE__ */ U({
22
24
  __name: "close-icon",
23
25
  emits: ["click"],
24
- setup(l, { emit: t }) {
25
- const n = t;
26
- function s(e) {
27
- n("click", e);
26
+ setup(n, { emit: t }) {
27
+ const a = t;
28
+ function r(i) {
29
+ a("click", i);
28
30
  }
29
- return (e, a) => (b(), C("svg", A({
31
+ return (i, m) => (z(), Y("svg", oe({
30
32
  xmlns: "http://www.w3.org/2000/svg",
31
33
  viewBox: "0 0 200 200",
32
34
  width: "20",
33
35
  height: "20"
34
- }, e.$attrs, { onClick: s }), pe, 16));
36
+ }, i.$attrs, { onClick: r }), Be, 16));
35
37
  }
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
38
+ }), Te = /* @__PURE__ */ o("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
39
  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
40
  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
41
  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,29 +52,29 @@ const le = () => ({
50
52
  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
53
  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
54
  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), _e = [
54
- me
55
- ], R = /* @__PURE__ */ M({
55
+ L180.6,98.9z` }, null, -1), Pe = [
56
+ Te
57
+ ], fe = /* @__PURE__ */ U({
56
58
  __name: "refresh-icon",
57
59
  emits: ["click"],
58
- setup(l, { emit: t }) {
59
- const n = t;
60
- function s(e) {
61
- n("click", e);
60
+ setup(n, { emit: t }) {
61
+ const a = t;
62
+ function r(i) {
63
+ a("click", i);
62
64
  }
63
- return (e, a) => (b(), C("svg", A({
65
+ return (i, m) => (z(), Y("svg", oe({
64
66
  xmlns: "http://www.w3.org/2000/svg",
65
67
  viewBox: "0 0 200 200",
66
68
  width: "20",
67
69
  height: "20"
68
- }, e.$attrs, { onClick: s }), _e, 16));
70
+ }, i.$attrs, { onClick: r }), Pe, 16));
69
71
  }
70
- }), we = /* @__PURE__ */ c("circle", {
72
+ }), Xe = /* @__PURE__ */ o("circle", {
71
73
  cx: "50",
72
74
  cy: "36.8101",
73
75
  r: "10"
74
76
  }, [
75
- /* @__PURE__ */ c("animate", {
77
+ /* @__PURE__ */ o("animate", {
76
78
  attributeName: "cy",
77
79
  dur: "1s",
78
80
  repeatCount: "indefinite",
@@ -81,164 +83,190 @@ const le = () => ({
81
83
  keyTimes: "0;0.5;1",
82
84
  values: "23;77;23"
83
85
  })
84
- ], -1), be = [
85
- we
86
- ], ee = /* @__PURE__ */ M({
86
+ ], -1), We = [
87
+ Xe
88
+ ], ve = /* @__PURE__ */ U({
87
89
  __name: "loading-icon",
88
90
  emits: ["click"],
89
- setup(l, { emit: t }) {
90
- const n = t;
91
- function s(e) {
92
- n("click", e);
91
+ setup(n, { emit: t }) {
92
+ const a = t;
93
+ function r(i) {
94
+ a("click", i);
93
95
  }
94
- return (e, a) => (b(), C("svg", A({
96
+ return (i, m) => (z(), Y("svg", oe({
95
97
  xmlns: "http://www.w3.org/2000/svg",
96
98
  viewBox: "0 0 100 100",
97
99
  preserveAspectRatio: "xMidYMid",
98
100
  width: "84",
99
101
  height: "84"
100
- }, e.$attrs, { onClick: s }), be, 16));
102
+ }, i.$attrs, { onClick: r }), We, 16));
101
103
  }
102
104
  });
103
- function xe(l) {
104
- let t = 0, n = 0;
105
- if (l.getBoundingClientRect) {
106
- const s = l.getBoundingClientRect(), e = document.documentElement;
107
- t = s.left + Math.max(e.scrollLeft, document.body.scrollLeft) - e.clientLeft, n = s.top + Math.max(e.scrollTop, document.body.scrollTop) - e.clientTop;
105
+ function Me(n) {
106
+ let t = 0, a = 0;
107
+ if (n.getBoundingClientRect) {
108
+ const r = n.getBoundingClientRect(), i = document.documentElement;
109
+ t = r.left + Math.max(i.scrollLeft, document.body.scrollLeft) - i.clientLeft, a = r.top + Math.max(i.scrollTop, document.body.scrollTop) - i.clientTop;
108
110
  } else
109
- for (; l !== document.body; )
110
- t += l.offsetLeft, n += l.offsetTop, l = l.offsetParent;
111
+ for (; n !== document.body; )
112
+ t += n.offsetLeft, a += n.offsetTop, n = n.offsetParent;
111
113
  return {
112
114
  domX: t,
113
- domY: n
115
+ domY: a
114
116
  };
115
117
  }
116
- function se(l, t) {
117
- let n = t.relatedTarget;
118
+ function be(n, t) {
119
+ let a = t.relatedTarget;
118
120
  try {
119
- for (; n && n !== l; )
120
- n = n.parentNode;
121
- } catch (s) {
122
- console.warn(s);
121
+ for (; a && a !== n; )
122
+ a = a.parentNode;
123
+ } catch (r) {
124
+ console.warn(r);
123
125
  }
124
- return n !== l;
126
+ return a !== n;
125
127
  }
126
- function Ee(l, t) {
127
- const n = U({ list: [] });
128
+ function Fe(n, t, a) {
129
+ const r = B({ list: [] }), i = (s) => {
130
+ const p = s.currentTarget, b = Me(p), l = s.pageX || s.clientX, _ = s.pageY || s.clientY, g = b.domX, S = b.domY, L = l - g, h = _ - S, f = parseInt(L.toString()), w = parseInt(h.toString()), T = /* @__PURE__ */ new Date(), q = r.list.length;
131
+ return r.list.push({ key: T.getTime(), index: q + 1, x: f, y: w }), t.click && t.click(f, w), s.cancelBubble = !0, s.preventDefault(), !1;
132
+ }, m = (s) => (t.confirm && t.confirm(I(r.list), () => {
133
+ y();
134
+ }), s.cancelBubble = !0, s.preventDefault(), !1), c = (s) => (e(), s.cancelBubble = !0, s.preventDefault(), !1), u = (s) => (d(), s.cancelBubble = !0, s.preventDefault(), !1), e = () => {
135
+ t.close && t.close(), y();
136
+ }, d = () => {
137
+ t.refresh && t.refresh(), y();
138
+ }, y = () => {
139
+ r.list = [];
140
+ };
128
141
  return {
129
- dots: n,
130
- clickEvent: (o) => {
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;
142
+ dots: r,
143
+ clickEvent: i,
144
+ confirmEvent: m,
145
+ closeEvent: c,
146
+ refreshEvent: u,
147
+ resetData: y,
148
+ clearData: () => {
149
+ y(), a && a();
133
150
  },
134
- confirmEvent: (o) => (t.confirm && t.confirm(re(n.list), () => {
135
- n.list = [];
136
- }), o.cancelBubble = !0, o.preventDefault(), !1),
137
- closeEvent: (o) => (t.close && t.close(), n.list = [], o.cancelBubble = !0, o.preventDefault(), !1),
138
- refreshEvent: (o) => (t.refresh && t.refresh(), n.list = [], o.cancelBubble = !0, o.preventDefault(), !1)
151
+ refresh: d,
152
+ close: e
139
153
  };
140
154
  }
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({
155
+ const Re = { class: "gc-header" }, Ye = ["src"], He = { class: "gc-loading" }, Oe = ["src"], je = { class: "gc-dots" }, Ae = { class: "gc-footer" }, Ie = { class: "gc-icon-block gc-icon-block2" }, Ve = { class: "gc-button-block" }, le = /* @__PURE__ */ U({
142
156
  __name: "index",
143
157
  props: {
144
- config: { default: le },
158
+ config: { default: we },
145
159
  events: { default: () => ({}) },
146
160
  data: { default: () => ({}) }
147
161
  },
148
- setup(l) {
149
- const t = l, { data: n, events: s } = t, e = D({
150
- ...le(),
151
- ...t.config
152
- });
153
- j(() => t.config, () => {
154
- e.value = {
155
- ...e.value,
156
- ...t.config
162
+ setup(n, { expose: t }) {
163
+ const a = n, { data: r, events: i, config: m } = a, c = B({ ...I(r) }), u = B({ ...I(i) }), e = B({ ...we(), ...I(m) });
164
+ F(() => a.data, (l, _) => {
165
+ Object.assign(c, l);
166
+ }, { deep: !0 }), F(() => a.events, (l, _) => {
167
+ Object.assign(u, l);
168
+ }, { deep: !0 }), F(() => a.config, (l, _) => {
169
+ Object.assign(e, l);
170
+ }, { deep: !0 });
171
+ const d = Fe(c, u, () => {
172
+ c.thumb = "", c.image = "";
173
+ }), y = x(() => {
174
+ const l = e.horizontalPadding || 0, _ = e.verticalPadding || 0;
175
+ return {
176
+ width: (e.width || 0) + l * 2 + (e.showTheme ? 2 : 0) + "px",
177
+ paddingLeft: l + "px",
178
+ paddingRight: l + "px",
179
+ paddingTop: _ + "px",
180
+ paddingBottom: _ + "px"
157
181
  };
158
- });
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
- width: E + "px",
161
- paddingLeft: d + "px",
162
- paddingRight: d + "px",
163
- paddingTop: o + "px",
164
- paddingBottom: o + "px"
165
- })), r = z(() => ({
166
- width: e.value.thumbWidth + "px",
167
- height: e.value.thumbHeight + "px"
168
- })), h = z(() => ({
169
- width: e.value.width + "px",
170
- height: e.value.height + "px"
171
- }));
172
- return (_, w) => (b(), C("div", {
173
- class: I(`go-captcha gc-wrapper ${e.value.showTheme ? "gc-theme" : ""}`),
174
- style: m(g.value)
182
+ }), E = x(() => ({
183
+ width: e.thumbWidth + "px",
184
+ height: e.thumbHeight + "px"
185
+ })), s = x(() => ({
186
+ width: e.width + "px",
187
+ height: e.height + "px"
188
+ })), p = x(() => c.image != "" || c.thumb != ""), b = x(() => (e.width || 0) > 0 || (e.height || 0) > 0);
189
+ return t({
190
+ reset: d.resetData,
191
+ clear: d.clearData,
192
+ refresh: d.refresh,
193
+ close: d.close
194
+ }), (l, _) => K((z(), Y("div", {
195
+ class: se(`go-captcha gc-wrapper ${e.showTheme && "gc-theme"}`),
196
+ style: D(y.value)
175
197
  }, [
176
- c("div", ke, [
177
- c("span", null, V(e.value.title), 1),
178
- H(c("img", {
179
- style: m(r.value),
180
- src: i(n).thumb,
181
- alt: "..."
182
- }, null, 12, ye), [
183
- [F, i(n).thumb !== ""]
198
+ o("div", Re, [
199
+ o("span", null, ie(e.title), 1),
200
+ K(o("img", {
201
+ style: D(E.value),
202
+ src: c.thumb,
203
+ alt: ""
204
+ }, null, 12, Ye), [
205
+ [Q, p.value]
184
206
  ])
185
207
  ]),
186
- c("div", {
208
+ o("div", {
187
209
  class: "gc-body",
188
- style: m(h.value)
210
+ style: D(s.value)
189
211
  }, [
190
- c("div", Le, [
191
- P(ee)
212
+ o("div", He, [
213
+ A(ve)
192
214
  ]),
193
- H(c("img", {
194
- style: m(h.value),
215
+ K(o("img", {
216
+ style: D(s.value),
195
217
  class: "gc-picture",
196
- src: i(n).image,
197
- alt: "...",
198
- onClick: w[0] || (w[0] = //@ts-ignore
199
- (...v) => i(a).clickEvent && i(a).clickEvent(...v))
200
- }, null, 12, $e), [
201
- [F, i(n).image !== ""]
218
+ src: c.image,
219
+ onClick: _[0] || (_[0] = //@ts-ignore
220
+ (...g) => v(d).clickEvent && v(d).clickEvent(...g)),
221
+ alt: ""
222
+ }, null, 12, Oe), [
223
+ [Q, p.value]
202
224
  ]),
203
- c("div", Ce, [
204
- (b(!0), C(de, null, he(i(u).list, (v) => (b(), C("div", {
225
+ o("div", je, [
226
+ (z(!0), Y(De, null, $e(v(d).dots.list, (g) => (z(), Y("div", {
205
227
  class: "gc-dot",
206
- key: `${v.key + "-" + v.index}`,
207
- style: m({
208
- top: v.y - 11 + "px",
209
- left: v.x - 11 + "px"
228
+ key: `${g.key + "-" + g.index}`,
229
+ style: D({
230
+ width: e.dotSize + "px",
231
+ height: e.dotSize + "px",
232
+ borderRadius: e.dotSize + "px",
233
+ top: g.y - (e.dotSize || 1) / 2 - 1 + "px",
234
+ left: g.x - (e.dotSize || 1) / 2 - 1 + "px"
210
235
  })
211
- }, V(v.index), 5))), 128))
236
+ }, ie(g.index), 5))), 128))
212
237
  ])
213
238
  ], 4),
214
- c("div", Te, [
215
- c("div", Pe, [
216
- P(Z, {
217
- width: 22,
218
- height: 22,
219
- onClick: i(a).closeEvent
220
- }, null, 8, ["onClick"]),
221
- P(R, {
222
- width: 22,
223
- height: 22,
224
- onClick: i(a).refreshEvent
225
- }, null, 8, ["onClick"])
239
+ o("div", Ae, [
240
+ o("div", Ie, [
241
+ A(ge, {
242
+ width: e.iconSize,
243
+ height: e.iconSize,
244
+ onClick: v(d).closeEvent
245
+ }, null, 8, ["width", "height", "onClick"]),
246
+ A(fe, {
247
+ width: e.iconSize,
248
+ height: e.iconSize,
249
+ onClick: v(d).refreshEvent
250
+ }, null, 8, ["width", "height", "onClick"])
226
251
  ]),
227
- c("div", ze, [
228
- c("button", {
229
- onClick: w[1] || (w[1] = //@ts-ignore
230
- (...v) => i(a).confirmEvent && i(a).confirmEvent(...v))
231
- }, V(e.value.buttonText), 1)
252
+ o("div", Ve, [
253
+ o("button", {
254
+ class: se(!p.value && "disabled"),
255
+ onClick: _[1] || (_[1] = //@ts-ignore
256
+ (...g) => v(d).confirmEvent && v(d).confirmEvent(...g))
257
+ }, ie(e.buttonText), 3)
232
258
  ])
233
259
  ])
234
- ], 6));
260
+ ], 6)), [
261
+ [Q, b.value]
262
+ ]);
235
263
  }
236
264
  });
237
- G.name = "gocaptcha-click";
238
- G.install = function(l) {
239
- l.component("gocaptcha-click", G);
265
+ le.name = "gocaptcha-click";
266
+ le.install = function(n) {
267
+ n.component("gocaptcha-click", le);
240
268
  };
241
- const oe = () => ({
269
+ const xe = () => ({
242
270
  width: 300,
243
271
  height: 220,
244
272
  thumbWidth: 150,
@@ -246,632 +274,792 @@ const oe = () => ({
246
274
  verticalPadding: 16,
247
275
  horizontalPadding: 12,
248
276
  showTheme: !0,
249
- title: "请拖动滑块完成拼图"
250
- }), Xe = /* @__PURE__ */ c("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
277
+ title: "请拖动滑块完成拼图",
278
+ iconSize: 22,
279
+ scope: !0
280
+ }), Ne = /* @__PURE__ */ o("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
251
281
  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
- 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
- Xe
254
- ], ue = /* @__PURE__ */ M({
282
+ 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), Ue = [
283
+ Ne
284
+ ], ye = /* @__PURE__ */ U({
255
285
  __name: "arrows-icon",
256
286
  emits: ["click"],
257
- setup(l, { emit: t }) {
258
- const n = t;
259
- function s(e) {
260
- n("click", e);
287
+ setup(n, { emit: t }) {
288
+ const a = t;
289
+ function r(i) {
290
+ a("click", i);
261
291
  }
262
- return (e, a) => (b(), C("svg", A({
292
+ return (i, m) => (z(), Y("svg", oe({
263
293
  xmlns: "http://www.w3.org/2000/svg",
264
294
  viewBox: "0 0 200 200",
265
295
  width: "20",
266
296
  height: "20"
267
- }, e.$attrs, { onClick: s }), De, 16));
297
+ }, i.$attrs, { onClick: r }), Ue, 16));
268
298
  }
299
+ }), qe = () => ({
300
+ thumbX: 0,
301
+ thumbY: 0,
302
+ thumbWidth: 0,
303
+ thumbHeight: 0,
304
+ image: "",
305
+ thumb: ""
269
306
  });
270
- function Me(l, t, n, s, e, a) {
271
- const d = U({ dragLeft: 0, thumbLeft: l.thumbX || 0 }), o = () => {
272
- d.dragLeft = 0, d.thumbLeft = 0;
307
+ function Ge(n, t, a, r, i, m, c, u, e) {
308
+ const d = B({ dragLeft: 0, thumbLeft: n.thumbX || 0, isFreeze: !1 });
309
+ F(() => n, (g, S) => {
310
+ d.isFreeze || (d.thumbLeft = g.thumbX || 0);
311
+ }, { deep: !0 });
312
+ const y = (g) => {
313
+ const S = g.touches && g.touches[0], L = c.value.offsetLeft, h = i.value.offsetWidth, f = c.value.offsetWidth, w = h - f, T = m.value.offsetWidth, q = m.value.offsetLeft, te = h - T, G = (h - (T + q)) / w;
314
+ let V = !1, P = null, Z = 0, H = 0;
315
+ S ? Z = S.pageX - L : Z = g.clientX - L;
316
+ const R = (W) => {
317
+ V = !0;
318
+ const J = W.touches && W.touches[0];
319
+ let M = 0;
320
+ J ? M = J.pageX - Z : M = W.clientX - Z;
321
+ let ke = q + M * G;
322
+ if (M >= w) {
323
+ d.dragLeft = w, d.thumbLeft = H = te;
324
+ return;
325
+ }
326
+ if (M <= 0) {
327
+ d.dragLeft = 0, d.thumbLeft = H = q;
328
+ return;
329
+ }
330
+ d.dragLeft = M, d.thumbLeft = H = ke, t.move && t.move(H, n.thumbY || 0), W.cancelBubble = !0, W.preventDefault();
331
+ }, N = (W) => {
332
+ be(u.value, W) && V && (X(), !(H < 0) && (V = !1, t.confirm && t.confirm({ x: parseInt(H.toString()), y: n.thumbY || 0 }, () => {
333
+ l();
334
+ }), W.cancelBubble = !0, W.preventDefault()));
335
+ }, O = (W) => {
336
+ P = W;
337
+ }, j = () => {
338
+ P = null;
339
+ }, ce = (W) => {
340
+ P && (N(P), X());
341
+ }, k = a.scope, $ = k ? r.value : u.value, C = k ? r.value : document.body, X = () => {
342
+ C.removeEventListener("mousemove", R, !1), C.removeEventListener("touchmove", R, { passive: !1 }), $.removeEventListener("mouseup", N, !1), $.removeEventListener("mouseenter", j, !1), $.removeEventListener("mouseleave", O, !1), $.removeEventListener("touchend", N, !1), C.removeEventListener("mouseleave", N, !1), C.removeEventListener("mouseup", ce, !1), d.isFreeze = !1;
343
+ };
344
+ d.isFreeze = !0, C.addEventListener("mousemove", R, !1), C.addEventListener("touchmove", R, { passive: !1 }), $.addEventListener("mouseup", N, !1), $.addEventListener("mouseenter", j, !1), $.addEventListener("mouseleave", O, !1), $.addEventListener("touchend", N, !1), C.addEventListener("mouseleave", N, !1), C.addEventListener("mouseup", ce, !1);
345
+ }, E = (g) => (p(), g.cancelBubble = !0, g.preventDefault(), !1), s = (g) => (b(), g.cancelBubble = !0, g.preventDefault(), !1), p = () => {
346
+ t && t.close && t.close(), l();
347
+ }, b = () => {
348
+ t && t.refresh && t.refresh(), l();
349
+ }, l = () => {
350
+ d.dragLeft = 0, d.thumbLeft = n.thumbX || 0;
273
351
  };
274
352
  return {
275
353
  state: d,
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, S = v - $, y = (f - k + S) / f;
278
- let x = !1, B = 0, T = 0;
279
- h ? B = h.pageX - _ : B = r.clientX - _;
280
- const W = (p) => {
281
- x = !0;
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
- d.dragLeft = f;
286
- return;
287
- }
288
- if (L <= 0) {
289
- d.dragLeft = 0;
290
- return;
291
- }
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
- o();
296
- }), p.cancelBubble = !0, p.preventDefault());
297
- };
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);
354
+ dragEvent: y,
355
+ closeEvent: E,
356
+ refreshEvent: s,
357
+ resetData: l,
358
+ clearData: () => {
359
+ e && e(), l();
299
360
  },
300
- closeEvent: (r) => (t && t.close && t.close(), o(), r.cancelBubble = !0, r.preventDefault(), !1),
301
- refreshEvent: (r) => (t && t.refresh && t.refresh(), o(), r.cancelBubble = !0, r.preventDefault(), !1)
361
+ refresh: b,
362
+ close: p
302
363
  };
303
364
  }
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({
365
+ const Je = { class: "gc-header" }, Ke = { class: "gc-icon-block" }, Qe = { class: "gc-loading" }, Ze = ["src"], et = ["src"], tt = { class: "gc-footer" }, nt = /* @__PURE__ */ o("div", { class: "gc-drag-line" }, null, -1), re = /* @__PURE__ */ U({
305
366
  __name: "index",
306
367
  props: {
307
- config: { default: oe },
368
+ config: { default: xe },
308
369
  events: { default: () => ({}) },
309
370
  data: { default: () => ({}) }
310
371
  },
311
- setup(l) {
312
- const t = l, { data: n, events: s } = t, e = D({
313
- ...oe(),
314
- ...t.config
315
- });
316
- j(() => t.config, () => {
317
- e.value = {
318
- ...e.value,
319
- ...t.config
372
+ setup(n, { expose: t }) {
373
+ const a = n, { data: r, events: i, config: m } = a, c = B({ ...qe(), ...I(r) }), u = B({ ...I(i) }), e = B({ ...xe(), ...I(m) });
374
+ F(() => a.data, (f, w) => {
375
+ Object.assign(c, f);
376
+ }, { deep: !0 }), F(() => a.events, (f, w) => {
377
+ Object.assign(u, f);
378
+ }, { deep: !0 }), F(() => a.config, (f, w) => {
379
+ Object.assign(e, f);
380
+ }, { deep: !0 });
381
+ const d = ee(null), y = ee(null), E = ee(null), s = ee(null), p = ee(null), b = Ge(
382
+ c,
383
+ u,
384
+ e,
385
+ d,
386
+ E,
387
+ p,
388
+ s,
389
+ y,
390
+ () => {
391
+ c.thumb = "", c.image = "", c.thumbX = 0, c.thumbY = 0, c.thumbWidth = 0, c.thumbHeight = 0;
392
+ }
393
+ ), l = x(() => {
394
+ const f = e.horizontalPadding || 0, w = e.verticalPadding || 0;
395
+ return {
396
+ width: (e.width || 0) + f * 2 + (e.showTheme ? 2 : 0) + "px",
397
+ paddingLeft: f + "px",
398
+ paddingRight: f + "px",
399
+ paddingTop: w + "px",
400
+ paddingBottom: w + "px"
320
401
  };
321
- });
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
- width: h + "px",
324
- paddingLeft: g + "px",
325
- paddingRight: g + "px",
326
- paddingTop: r + "px",
327
- paddingBottom: r + "px"
328
- })), w = z(() => ({
329
- width: n.thumbWidth + "px",
330
- height: n.thumbHeight + "px",
331
- top: n.thumbY + "px",
332
- left: u.state.thumbLeft + "px"
333
- })), v = z(() => ({
334
- width: e.value.width + "px",
335
- height: e.value.height + "px"
336
- }));
337
- return ne(async () => {
338
- await ce(), o.value && o.value.addEventListener("dragstart", (f) => f.preventDefault());
339
- }), (f, k) => (b(), C("div", {
340
- class: I(`go-captcha gc-wrapper ${e.value.showTheme ? "gc-theme" : ""}`),
341
- style: m(_.value)
402
+ }), _ = x(() => ({
403
+ width: c.thumbWidth + "px",
404
+ height: c.thumbHeight + "px",
405
+ top: c.thumbY + "px",
406
+ left: b.state.thumbLeft + "px"
407
+ })), g = x(() => ({
408
+ width: e.width + "px",
409
+ height: e.height + "px"
410
+ })), S = x(() => c.image != ""), L = x(() => c.thumb != ""), h = x(() => (e.width || 0) > 0 || (e.height || 0) > 0);
411
+ return pe(async () => {
412
+ await _e(), s.value && s.value.addEventListener("dragstart", (f) => f.preventDefault());
413
+ }), t({
414
+ reset: b.resetData,
415
+ clear: b.clearData,
416
+ refresh: b.refresh,
417
+ close: b.close
418
+ }), (f, w) => K((z(), Y("div", {
419
+ class: se(`go-captcha gc-wrapper ${e.showTheme && "gc-theme"}`),
420
+ style: D(l.value),
421
+ ref_key: "rootRef",
422
+ ref: d
342
423
  }, [
343
- c("div", Se, [
344
- c("span", null, V(e.value.title), 1),
345
- c("div", Be, [
346
- P(Z, {
347
- width: 22,
348
- height: 22,
349
- onClick: i(u).closeEvent
350
- }, null, 8, ["onClick"]),
351
- P(R, {
352
- width: 22,
353
- height: 22,
354
- onClick: i(u).refreshEvent
355
- }, null, 8, ["onClick"])
424
+ o("div", Je, [
425
+ o("span", null, ie(e.title), 1),
426
+ o("div", Ke, [
427
+ A(ge, {
428
+ width: e.iconSize,
429
+ height: e.iconSize,
430
+ onClick: v(b).closeEvent
431
+ }, null, 8, ["width", "height", "onClick"]),
432
+ A(fe, {
433
+ width: e.iconSize,
434
+ height: e.iconSize,
435
+ onClick: v(b).refreshEvent
436
+ }, null, 8, ["width", "height", "onClick"])
356
437
  ])
357
438
  ]),
358
- c("div", {
439
+ o("div", {
359
440
  class: "gc-body",
360
441
  ref_key: "containerRef",
361
- ref: d,
362
- style: m(v.value)
442
+ ref: E,
443
+ style: D(g.value)
363
444
  }, [
364
- c("div", We, [
365
- P(ee)
445
+ o("div", Qe, [
446
+ A(ve)
366
447
  ]),
367
- H(c("img", {
448
+ K(o("img", {
368
449
  class: "gc-picture",
369
- style: m(v.value),
370
- src: i(n).image,
371
- alt: "..."
372
- }, null, 12, Ye), [
373
- [F, i(n).image !== ""]
450
+ style: D(g.value),
451
+ src: c.image,
452
+ alt: ""
453
+ }, null, 12, Ze), [
454
+ [Q, S.value]
374
455
  ]),
375
- c("div", {
456
+ o("div", {
376
457
  class: "gc-tile",
377
458
  ref_key: "tileRef",
378
- ref: E,
379
- style: m(w.value)
459
+ ref: p,
460
+ style: D(_.value)
380
461
  }, [
381
- H(c("img", {
382
- src: i(n).thumb,
383
- alt: "..."
384
- }, null, 8, He), [
385
- [F, i(n).thumb !== ""]
462
+ K(o("img", {
463
+ src: c.thumb,
464
+ alt: ""
465
+ }, null, 8, et), [
466
+ [Q, L.value]
386
467
  ])
387
468
  ], 4)
388
469
  ], 4),
389
- c("div", Fe, [
390
- c("div", {
470
+ o("div", tt, [
471
+ o("div", {
391
472
  class: "gc-drag-slide-bar",
392
473
  ref_key: "dragBarRef",
393
- ref: a,
394
- onMousedown: k[1] || (k[1] = //@ts-ignore
395
- (...$) => i(u).dragEvent && i(u).dragEvent(...$))
474
+ ref: y
396
475
  }, [
397
- Ae,
398
- c("div", {
399
- class: "gc-drag-block",
476
+ nt,
477
+ o("div", {
478
+ class: se(["gc-drag-block", !S.value && "disabled"]),
400
479
  ref_key: "dragBlockRef",
401
- ref: o,
402
- onTouchstart: k[0] || (k[0] = //@ts-ignore
403
- (...$) => i(u).dragEvent && i(u).dragEvent(...$)),
404
- style: m({ left: i(u).state.dragLeft + "px" })
480
+ ref: s,
481
+ onMousedown: w[1] || (w[1] = //@ts-ignore
482
+ (...T) => v(b).dragEvent && v(b).dragEvent(...T)),
483
+ style: D({ left: v(b).state.dragLeft + "px" })
405
484
  }, [
406
- P(ue)
407
- ], 36)
408
- ], 544)
485
+ o("div", {
486
+ class: "gc-drag-block-inline",
487
+ onTouchstart: w[0] || (w[0] = //@ts-ignore
488
+ (...T) => v(b).dragEvent && v(b).dragEvent(...T))
489
+ }, [
490
+ A(ye)
491
+ ], 32)
492
+ ], 38)
493
+ ], 512)
409
494
  ])
410
- ], 6));
495
+ ], 6)), [
496
+ [Q, h.value]
497
+ ]);
411
498
  }
412
499
  });
413
- J.name = "gocaptcha-slide";
414
- J.install = function(l) {
415
- l.component("gocaptcha-slide", J);
500
+ re.name = "gocaptcha-slide";
501
+ re.install = function(n) {
502
+ n.component("gocaptcha-slide", re);
416
503
  };
417
- const ie = () => ({
504
+ const Ee = () => ({
418
505
  width: 300,
419
506
  height: 220,
420
507
  verticalPadding: 16,
421
508
  horizontalPadding: 12,
422
509
  showTheme: !0,
423
- title: "请拖拽贴图完成拼图"
510
+ title: "请拖拽贴图完成拼图",
511
+ iconSize: 22,
512
+ scope: !0
513
+ }), st = () => ({
514
+ thumbX: 0,
515
+ thumbY: 0,
516
+ thumbWidth: 0,
517
+ thumbHeight: 0,
518
+ image: "",
519
+ thumb: ""
424
520
  });
425
- function Ve(l, t, n, s) {
426
- const e = U({ x: l.thumbX || 0, y: l.thumbY || 0 }), a = () => {
427
- e.x = l.thumbX || 0, e.y = l.thumbY || 0;
521
+ function ct(n, t, a, r, i, m, c) {
522
+ const u = B({ x: n.thumbX || 0, y: n.thumbY || 0, isFreeze: !1 });
523
+ F(() => n, (l, _) => {
524
+ u.isFreeze || (u.x = l.thumbX || 0, u.y = l.thumbY || 0);
525
+ }, { deep: !0 });
526
+ const e = (l) => {
527
+ const _ = l.touches && l.touches[0], g = m.value.offsetLeft, S = m.value.offsetTop, L = i.value.offsetWidth, h = i.value.offsetHeight, f = m.value.offsetWidth, w = m.value.offsetHeight, T = L - f, q = h - w;
528
+ let te = !1, ne = null, G = 0, V = 0, P = 0, Z = 0;
529
+ _ ? (G = _.pageX - g, V = _.pageY - S) : (G = l.clientX - g, V = l.clientY - S);
530
+ const H = (X) => {
531
+ te = !0;
532
+ const W = X.touches && X.touches[0];
533
+ let J = 0, M = 0;
534
+ W ? (J = W.pageX - G, M = W.pageY - V) : (J = X.clientX - G, M = X.clientY - V), J <= 0 && (J = 0), M <= 0 && (M = 0), J >= T && (J = T), M >= q && (M = q), u.x = J, u.y = M, P = J, Z = M, t.move && t.move(J, M), X.cancelBubble = !0, X.preventDefault();
535
+ }, R = (X) => {
536
+ be(i.value, X) && te && (te = !1, C(), !(P < 0 || Z < 0) && (t.confirm && t.confirm({ x: P, y: Z }, () => {
537
+ p();
538
+ }), X.cancelBubble = !0, X.preventDefault()));
539
+ }, N = (X) => {
540
+ ne = X;
541
+ }, O = () => {
542
+ ne = null;
543
+ }, j = (X) => {
544
+ ne && (R(ne), C());
545
+ }, ce = a.scope, k = ce ? r.value : i.value, $ = ce ? r.value : document.body, C = () => {
546
+ $.removeEventListener("mousemove", H, !1), $.removeEventListener("touchmove", H, { passive: !1 }), k.removeEventListener("mouseup", R, !1), k.removeEventListener("mouseenter", O, !1), k.removeEventListener("mouseleave", N, !1), k.removeEventListener("touchend", R, !1), $.removeEventListener("mouseleave", R, !1), $.removeEventListener("mouseup", j, !1), u.isFreeze = !1;
547
+ };
548
+ u.isFreeze = !0, $.addEventListener("mousemove", H, !1), $.addEventListener("touchmove", H, { passive: !1 }), k.addEventListener("mouseup", R, !1), k.addEventListener("mouseenter", O, !1), k.addEventListener("mouseleave", N, !1), k.addEventListener("touchend", R, !1), $.addEventListener("mouseleave", R, !1), $.addEventListener("mouseup", j, !1);
549
+ }, d = (l) => (E(), l.cancelBubble = !0, l.preventDefault(), !1), y = (l) => (s(), l.cancelBubble = !0, l.preventDefault(), !1), E = () => {
550
+ t && t.close && t.close(), p();
551
+ }, s = () => {
552
+ t && t.refresh && t.refresh(), p();
553
+ }, p = () => {
554
+ u.x = n.thumbX || 0, u.y = n.thumbY || 0;
428
555
  };
429
556
  return {
430
- state: e,
431
- dragEvent: (u) => {
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 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
- a();
443
- }), p.cancelBubble = !0, p.preventDefault());
444
- };
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);
557
+ state: u,
558
+ dragEvent: e,
559
+ closeEvent: d,
560
+ refreshEvent: y,
561
+ resetData: p,
562
+ clearData: () => {
563
+ c && c(), p();
446
564
  },
447
- closeEvent: (u) => (t && t.close && t.close(), a(), u.cancelBubble = !0, u.preventDefault(), !1),
448
- refreshEvent: (u) => (t && t.refresh && t.refresh(), a(), u.cancelBubble = !0, u.preventDefault(), !1)
565
+ refresh: s,
566
+ close: E
449
567
  };
450
568
  }
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({
569
+ const ot = { class: "gc-header gc-header2" }, it = { class: "gc-loading" }, at = ["src"], lt = ["src"], rt = { class: "gc-footer" }, ut = { class: "gc-icon-block" }, ue = /* @__PURE__ */ U({
452
570
  __name: "index",
453
571
  props: {
454
- config: { default: ie },
572
+ config: { default: Ee },
455
573
  events: { default: () => ({}) },
456
574
  data: { default: () => ({}) }
457
575
  },
458
- setup(l) {
459
- const t = l, { data: n, events: s } = t, e = D({
460
- ...ie(),
461
- ...t.config
462
- });
463
- j(() => t.config, () => {
464
- e.value = {
465
- ...e.value,
466
- ...t.config
576
+ setup(n, { expose: t }) {
577
+ const a = n, { data: r, events: i, config: m } = a, c = B({ ...st(), ...I(r) }), u = B({ ...I(i) }), e = B({ ...Ee(), ...I(m) });
578
+ F(() => a.data, (L, h) => {
579
+ Object.assign(c, L);
580
+ }, { deep: !0 }), F(() => a.events, (L, h) => {
581
+ Object.assign(u, L);
582
+ }, { deep: !0 }), F(() => a.config, (L, h) => {
583
+ Object.assign(e, L);
584
+ }, { deep: !0 });
585
+ const d = ee(null), y = ee(null), E = ee(null), s = ct(
586
+ c,
587
+ u,
588
+ e,
589
+ d,
590
+ y,
591
+ E,
592
+ () => {
593
+ c.thumb = "", c.image = "", c.thumbX = 0, c.thumbY = 0, c.thumbWidth = 0, c.thumbHeight = 0;
594
+ }
595
+ ), p = x(() => {
596
+ const L = e.horizontalPadding || 0, h = e.verticalPadding || 0;
597
+ return {
598
+ width: (e.width || 0) + L * 2 + (e.showTheme ? 2 : 0) + "px",
599
+ paddingLeft: L + "px",
600
+ paddingRight: L + "px",
601
+ paddingTop: h + "px",
602
+ paddingBottom: h + "px"
467
603
  };
468
- });
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
- let g = (e.value.width || 0) + E * 2 + (e.value.showTheme ? 2 : 0);
471
- const r = z(() => ({
472
- width: g + "px",
473
- paddingLeft: E + "px",
474
- paddingRight: E + "px",
475
- paddingTop: u + "px",
476
- paddingBottom: u + "px"
477
- })), h = z(() => ({
478
- width: n.thumbWidth + "px",
479
- height: n.thumbHeight + "px",
480
- top: o.state.y + "px",
481
- left: o.state.x + "px"
482
- })), _ = z(() => ({
483
- width: e.value.width + "px",
484
- height: e.value.height + "px"
485
- }));
486
- return ne(async () => {
487
- await ce(), d.value && d.value.addEventListener("dragstart", (w) => w.preventDefault());
488
- }), (w, v) => (b(), C("div", {
489
- class: I(`go-captcha gc-wrapper ${e.value.showTheme ? "gc-theme" : ""}`),
490
- style: m(r.value)
604
+ }), b = x(() => ({
605
+ width: c.thumbWidth + "px",
606
+ height: c.thumbHeight + "px",
607
+ top: s.state.y + "px",
608
+ left: s.state.x + "px"
609
+ })), l = x(() => ({
610
+ width: e.width + "px",
611
+ height: e.height + "px"
612
+ })), _ = x(() => c.image != ""), g = x(() => c.thumb != ""), S = x(() => (e.width || 0) > 0 || (e.height || 0) > 0);
613
+ return pe(async () => {
614
+ await _e(), E.value && E.value.addEventListener("dragstart", (L) => L.preventDefault());
615
+ }), t({
616
+ reset: s.resetData,
617
+ clear: s.clearData,
618
+ refresh: s.refresh,
619
+ close: s.close
620
+ }), (L, h) => K((z(), Y("div", {
621
+ class: se(`go-captcha gc-wrapper ${e.showTheme && "gc-theme"}`),
622
+ style: D(p.value),
623
+ ref_key: "rootRef",
624
+ ref: d
491
625
  }, [
492
- c("div", Ne, [
493
- c("span", null, V(e.value.title), 1)
626
+ o("div", ot, [
627
+ o("span", null, ie(e.title), 1)
494
628
  ]),
495
- c("div", {
629
+ o("div", {
496
630
  class: "gc-body",
497
631
  ref_key: "containerRef",
498
- ref: a,
499
- style: m(_.value)
632
+ ref: y,
633
+ style: D(l.value)
500
634
  }, [
501
- c("div", Ie, [
502
- P(ee)
635
+ o("div", it, [
636
+ A(ve)
503
637
  ]),
504
- H(c("img", {
638
+ K(o("img", {
505
639
  class: "gc-picture",
506
- style: m(_.value),
507
- src: i(n).image,
508
- alt: "..."
509
- }, null, 12, je), [
510
- [F, i(n).image !== ""]
640
+ style: D(l.value),
641
+ src: c.image,
642
+ alt: ""
643
+ }, null, 12, at), [
644
+ [Q, _.value]
511
645
  ]),
512
- c("div", {
646
+ o("div", {
513
647
  class: "gc-tile",
514
648
  ref_key: "tileRef",
515
- ref: d,
516
- style: m(h.value),
517
- onMousedown: v[0] || (v[0] = //@ts-ignore
518
- (...f) => i(o).dragEvent && i(o).dragEvent(...f)),
519
- onTouchstart: v[1] || (v[1] = //@ts-ignore
520
- (...f) => i(o).dragEvent && i(o).dragEvent(...f))
649
+ ref: E,
650
+ style: D(b.value),
651
+ onMousedown: h[0] || (h[0] = //@ts-ignore
652
+ (...f) => v(s).dragEvent && v(s).dragEvent(...f)),
653
+ onTouchstart: h[1] || (h[1] = //@ts-ignore
654
+ (...f) => v(s).dragEvent && v(s).dragEvent(...f))
521
655
  }, [
522
- H(c("img", {
523
- src: i(n).thumb,
524
- alt: "..."
525
- }, null, 8, qe), [
526
- [F, i(n).thumb !== ""]
656
+ K(o("img", {
657
+ src: c.thumb,
658
+ alt: ""
659
+ }, null, 8, lt), [
660
+ [Q, g.value]
527
661
  ])
528
662
  ], 36)
529
663
  ], 4),
530
- c("div", Ge, [
531
- c("div", Je, [
532
- P(Z, {
533
- width: 22,
534
- height: 22,
535
- onClick: i(o).closeEvent
536
- }, null, 8, ["onClick"]),
537
- P(R, {
538
- width: 22,
539
- height: 22,
540
- onClick: i(o).refreshEvent
541
- }, null, 8, ["onClick"])
664
+ o("div", rt, [
665
+ o("div", ut, [
666
+ A(ge, {
667
+ width: e.iconSize,
668
+ height: e.iconSize,
669
+ onClick: v(s).closeEvent
670
+ }, null, 8, ["width", "height", "onClick"]),
671
+ A(fe, {
672
+ width: e.iconSize,
673
+ height: e.iconSize,
674
+ onClick: v(s).refreshEvent
675
+ }, null, 8, ["width", "height", "onClick"])
542
676
  ])
543
677
  ])
544
- ], 6));
678
+ ], 6)), [
679
+ [Q, S.value]
680
+ ]);
545
681
  }
546
682
  });
547
- K.name = "gocaptcha-slide-region";
548
- K.install = function(l) {
549
- l.component("gocaptcha-slide-region", K);
683
+ ue.name = "gocaptcha-slide-region";
684
+ ue.install = function(n) {
685
+ n.component("gocaptcha-slide-region", ue);
550
686
  };
551
- const te = () => ({
687
+ const me = () => ({
552
688
  width: 300,
553
689
  height: 220,
554
690
  size: 220,
555
691
  verticalPadding: 16,
556
692
  horizontalPadding: 12,
557
693
  showTheme: !0,
558
- title: "请拖动滑块完成拼图"
694
+ title: "请拖动滑块完成拼图",
695
+ iconSize: 22,
696
+ scope: !0
697
+ }), dt = () => ({
698
+ angle: 0,
699
+ image: "",
700
+ thumb: ""
559
701
  });
560
- function Ke(l, t, n, s) {
561
- const e = U({ dragLeft: 0, thumbAngle: l.angle || 0 }), a = () => {
562
- e.dragLeft = 0, e.thumbAngle = 0;
702
+ function ht(n, t, a, r, i, m, c) {
703
+ const u = B({ dragLeft: 0, thumbAngle: n.angle || 0, isFreeze: !1 });
704
+ F(() => n, (l, _) => {
705
+ u.isFreeze || (u.thumbAngle = l.angle || 0);
706
+ }, { deep: !0 });
707
+ const e = (l) => {
708
+ const _ = l.touches && l.touches[0], g = i.value.offsetLeft, S = m.value.offsetWidth, L = i.value.offsetWidth, h = S - L, f = 360, w = (f - n.angle) / h;
709
+ let T = 0, q = !1, te = null, ne = 0, G = 0;
710
+ _ ? ne = _.pageX - g : ne = l.clientX - g;
711
+ const V = (k) => {
712
+ q = !0;
713
+ const $ = k.touches && k.touches[0];
714
+ let C = 0;
715
+ if ($ ? C = $.pageX - ne : C = k.clientX - ne, T = n.angle + C * w, C >= h) {
716
+ u.dragLeft = h, u.thumbAngle = G = f;
717
+ return;
718
+ }
719
+ if (C <= 0) {
720
+ u.dragLeft = 0, u.thumbAngle = G = n.angle;
721
+ return;
722
+ }
723
+ u.dragLeft = C, u.thumbAngle = G = T, t.rotate && t.rotate(T), k.cancelBubble = !0, k.preventDefault();
724
+ }, P = (k) => {
725
+ be(m.value, k) && q && (ce(), !(G < 0) && (q = !1, t.confirm && t.confirm(parseInt(G.toString()), () => {
726
+ p();
727
+ }), k.cancelBubble = !0, k.preventDefault()));
728
+ }, Z = (k) => {
729
+ te = k;
730
+ }, H = () => {
731
+ te = null;
732
+ }, R = (k) => {
733
+ te && (P(te), ce());
734
+ }, N = a.scope, O = N ? r.value : m.value, j = N ? r.value : document.body, ce = () => {
735
+ j.removeEventListener("mousemove", V, !1), j.removeEventListener("touchmove", V, { passive: !1 }), O.removeEventListener("mouseup", P, !1), O.removeEventListener("mouseenter", H, !1), O.removeEventListener("mouseleave", Z, !1), O.removeEventListener("touchend", P, !1), j.removeEventListener("mouseleave", P, !1), j.removeEventListener("mouseup", R, !1), u.isFreeze = !1;
736
+ };
737
+ u.isFreeze = !0, j.addEventListener("mousemove", V, !1), j.addEventListener("touchmove", V, { passive: !1 }), O.addEventListener("mouseup", P, !1), O.addEventListener("mouseenter", H, !1), O.addEventListener("mouseleave", Z, !1), O.addEventListener("touchend", P, !1), j.addEventListener("mouseleave", P, !1), j.addEventListener("mouseup", R, !1);
738
+ }, d = (l) => (E(), l.cancelBubble = !0, l.preventDefault(), !1), y = (l) => (s(), l.cancelBubble = !0, l.preventDefault(), !1), E = () => {
739
+ t && t.close && t.close(), p();
740
+ }, s = () => {
741
+ t && t.refresh && t.refresh(), p();
742
+ }, p = () => {
743
+ u.dragLeft = 0, u.thumbAngle = n.angle;
563
744
  };
564
745
  return {
565
- state: e,
566
- dragEvent: (u) => {
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
- let f = 0, k = !1, $ = 0;
569
- g ? $ = g.pageX - r : $ = u.clientX - r;
570
- const S = (x) => {
571
- k = !0;
572
- const B = x.touches && x.touches[0];
573
- let T = 0;
574
- if (B ? T = B.pageX - $ : T = x.clientX - $, T >= w) {
575
- e.dragLeft = w;
576
- return;
577
- }
578
- if (T <= 0) {
579
- e.dragLeft = 0;
580
- return;
581
- }
582
- e.dragLeft = T, f = T * v, e.thumbAngle = f, t.rotate && t.rotate(f), x.cancelBubble = !0, x.preventDefault();
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
- a();
586
- }), x.cancelBubble = !0, x.preventDefault());
587
- };
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);
746
+ state: u,
747
+ dragEvent: e,
748
+ closeEvent: d,
749
+ refreshEvent: y,
750
+ resetData: p,
751
+ clearData: () => {
752
+ c && c(), p();
589
753
  },
590
- closeEvent: (u) => (t && t.close && t.close(), a(), u.cancelBubble = !0, u.preventDefault(), !1),
591
- refreshEvent: (u) => (t && t.refresh && t.refresh(), a(), u.cancelBubble = !0, u.preventDefault(), !1)
754
+ refresh: s,
755
+ close: E
592
756
  };
593
757
  }
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({
758
+ const gt = { class: "gc-header" }, ft = { class: "gc-icon-block" }, vt = { class: "gc-loading" }, mt = ["src"], pt = /* @__PURE__ */ o("div", { class: "gc-round" }, null, -1), _t = { class: "gc-thumb gc-rotate-thumb" }, bt = ["src"], wt = { class: "gc-footer" }, xt = /* @__PURE__ */ o("div", { class: "gc-drag-line" }, null, -1), de = /* @__PURE__ */ U({
595
759
  __name: "index",
596
760
  props: {
597
- config: { default: te },
761
+ config: { default: me },
598
762
  events: { default: () => ({}) },
599
763
  data: { default: () => ({}) }
600
764
  },
601
- setup(l) {
602
- const t = l, { data: n, events: s } = t, e = D({
603
- ...te(),
604
- ...t.config
605
- });
606
- j(() => t.config, () => {
607
- e.value = {
608
- ...e.value,
609
- ...t.config
610
- };
611
- });
612
- const a = D(null), d = D(null), o = Ke(n, s, d, a), E = z(() => {
613
- const r = e.value.horizontalPadding || 0, h = e.value.verticalPadding || 0;
765
+ setup(n, { expose: t }) {
766
+ const a = n, { data: r, events: i, config: m } = a, c = B({ ...dt(), ...I(r) }), u = B({ ...I(i) }), e = B({ ...me(), ...I(m) });
767
+ F(() => a.data, (h, f) => {
768
+ Object.assign(c, h);
769
+ }, { deep: !0 }), F(() => a.events, (h, f) => {
770
+ Object.assign(u, h);
771
+ }, { deep: !0 }), F(() => a.config, (h, f) => {
772
+ Object.assign(e, h);
773
+ }, { deep: !0 });
774
+ const d = ee(null), y = ee(null), E = ee(null), s = ht(
775
+ c,
776
+ u,
777
+ e,
778
+ d,
779
+ E,
780
+ y,
781
+ () => {
782
+ c.thumb = "", c.image = "", c.angle = 0;
783
+ }
784
+ ), p = x(() => {
785
+ const h = e.horizontalPadding || 0, f = e.verticalPadding || 0;
614
786
  return {
615
- width: (e.value.width || 0) + r * 2 + (e.value.showTheme ? 2 : 0) + "px",
616
- paddingLeft: r + "px",
617
- paddingRight: r + "px",
618
- paddingTop: h + "px",
619
- paddingBottom: h + "px"
787
+ width: (e.width || 0) + h * 2 + (e.showTheme ? 2 : 0) + "px",
788
+ paddingLeft: h + "px",
789
+ paddingRight: h + "px",
790
+ paddingTop: f + "px",
791
+ paddingBottom: f + "px"
620
792
  };
621
- }), u = z(() => ({
622
- transform: `rotate(${o.state.thumbAngle}deg)`
623
- })), g = z(() => {
624
- var h;
625
- const r = (((h = e.value) == null ? void 0 : h.size) || 0) > 0 ? e.value.size : te().size;
793
+ }), b = x(() => ({
794
+ transform: `rotate(${s.state.thumbAngle}deg)`
795
+ })), l = x(() => ({
796
+ width: e.width + "px",
797
+ height: e.height + "px"
798
+ })), _ = x(() => {
799
+ const h = (e.size || 0) > 0 ? e.size : me().size;
626
800
  return {
627
- width: r + "px",
628
- height: r + "px"
801
+ width: h + "px",
802
+ height: h + "px"
629
803
  };
630
- });
631
- return ne(async () => {
632
- await ce(), d.value && d.value.addEventListener("dragstart", (r) => r.preventDefault());
633
- }), (r, h) => (b(), C("div", {
634
- class: I(`go-captcha gc-wrapper ${e.value.showTheme ? "gc-theme" : ""}`),
635
- style: m(E.value)
804
+ }), g = x(() => c.image != ""), S = x(() => c.thumb != ""), L = x(() => (e.width || 0) > 0 || (e.height || 0) > 0);
805
+ return pe(async () => {
806
+ await _e(), E.value && E.value.addEventListener("dragstart", (h) => h.preventDefault());
807
+ }), t({
808
+ reset: s.resetData,
809
+ clear: s.clearData,
810
+ refresh: s.refresh,
811
+ close: s.close
812
+ }), (h, f) => K((z(), Y("div", {
813
+ class: se(`go-captcha gc-wrapper ${e.showTheme && "gc-theme"}`),
814
+ style: D(p.value),
815
+ ref_key: "rootRef",
816
+ ref: d
636
817
  }, [
637
- c("div", Oe, [
638
- c("span", null, V(e.value.title), 1),
639
- c("div", Qe, [
640
- P(Z, {
641
- width: 22,
642
- height: 22,
643
- onClick: i(o).closeEvent
644
- }, null, 8, ["onClick"]),
645
- P(R, {
646
- width: 22,
647
- height: 22,
648
- onClick: i(o).refreshEvent
649
- }, null, 8, ["onClick"])
818
+ o("div", gt, [
819
+ o("span", null, ie(e.title), 1),
820
+ o("div", ft, [
821
+ A(ge, {
822
+ width: e.iconSize,
823
+ height: e.iconSize,
824
+ onClick: v(s).closeEvent
825
+ }, null, 8, ["width", "height", "onClick"]),
826
+ A(fe, {
827
+ width: e.iconSize,
828
+ height: e.iconSize,
829
+ onClick: v(s).refreshEvent
830
+ }, null, 8, ["width", "height", "onClick"])
650
831
  ])
651
832
  ]),
652
- c("div", {
833
+ o("div", {
653
834
  class: "gc-body gc-rotate-body",
654
835
  ref: "containerRef",
655
- style: m(g.value)
836
+ style: D(l.value)
656
837
  }, [
657
- c("div", Ue, [
658
- P(ee)
659
- ]),
660
- c("div", {
661
- class: "gc-picture gc-rotate-picture",
662
- style: m(g.value)
838
+ o("div", {
839
+ class: "gc-body-inner",
840
+ style: D(_.value)
663
841
  }, [
664
- H(c("img", {
665
- src: i(n).image,
666
- alt: "..."
667
- }, null, 8, Ze), [
668
- [F, i(n).image !== ""]
842
+ o("div", vt, [
843
+ A(ve)
669
844
  ]),
670
- Re
671
- ], 4),
672
- c("div", et, [
673
- c("div", {
674
- class: "gc-rotate-thumb-block",
675
- style: m(u.value)
845
+ o("div", {
846
+ class: "gc-picture gc-rotate-picture",
847
+ style: D(_.value)
676
848
  }, [
677
- H(c("img", {
678
- src: i(n).thumb,
679
- alt: "..."
680
- }, null, 8, tt), [
681
- [F, i(n).thumb !== ""]
682
- ])
683
- ], 4)
684
- ])
849
+ K(o("img", {
850
+ src: c.image,
851
+ alt: ""
852
+ }, null, 8, mt), [
853
+ [Q, g.value]
854
+ ]),
855
+ pt
856
+ ], 4),
857
+ o("div", _t, [
858
+ o("div", {
859
+ class: "gc-rotate-thumb-block",
860
+ style: D(b.value)
861
+ }, [
862
+ K(o("img", {
863
+ src: c.thumb,
864
+ alt: ""
865
+ }, null, 8, bt), [
866
+ [Q, S.value]
867
+ ])
868
+ ], 4)
869
+ ])
870
+ ], 4)
685
871
  ], 4),
686
- c("div", nt, [
687
- c("div", {
872
+ o("div", wt, [
873
+ o("div", {
688
874
  class: "gc-drag-slide-bar",
689
875
  ref_key: "dragBarRef",
690
- ref: a,
691
- onMousedown: h[1] || (h[1] = //@ts-ignore
692
- (..._) => i(o).dragEvent && i(o).dragEvent(..._))
876
+ ref: y
693
877
  }, [
694
- ct,
695
- c("div", {
696
- class: "gc-drag-block",
878
+ xt,
879
+ o("div", {
880
+ class: se(["gc-drag-block", !g.value && "disabled"]),
697
881
  ref_key: "dragBlockRef",
698
- ref: d,
699
- onTouchstart: h[0] || (h[0] = //@ts-ignore
700
- (..._) => i(o).dragEvent && i(o).dragEvent(..._)),
701
- style: m({ left: i(o).state.dragLeft + "px" })
882
+ ref: E,
883
+ onMousedown: f[1] || (f[1] = //@ts-ignore
884
+ (...w) => v(s).dragEvent && v(s).dragEvent(...w)),
885
+ style: D({ left: v(s).state.dragLeft + "px" })
702
886
  }, [
703
- P(ue)
704
- ], 36)
705
- ], 544)
887
+ o("div", {
888
+ class: "gc-drag-block-inline",
889
+ onTouchstart: f[0] || (f[0] = //@ts-ignore
890
+ (...w) => v(s).dragEvent && v(s).dragEvent(...w))
891
+ }, [
892
+ A(ye)
893
+ ], 32)
894
+ ], 38)
895
+ ], 512)
706
896
  ])
707
- ], 6));
897
+ ], 6)), [
898
+ [Q, L.value]
899
+ ]);
708
900
  }
709
901
  });
710
- O.name = "gocaptcha-rotate";
711
- O.install = function(l) {
712
- l.component("gocaptcha-rotate", O);
902
+ de.name = "gocaptcha-rotate";
903
+ de.install = function(n) {
904
+ n.component("gocaptcha-rotate", de);
713
905
  };
714
- const st = /* @__PURE__ */ c("circle", {
906
+ const Et = /* @__PURE__ */ o("circle", {
715
907
  fill: "#3E7CFF",
716
908
  cx: "100",
717
909
  cy: "100",
718
910
  r: "96.3"
719
- }, null, -1), lt = /* @__PURE__ */ c("path", {
911
+ }, null, -1), Lt = /* @__PURE__ */ o("path", {
720
912
  fill: "#FFFFFF",
721
913
  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
914
  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), ot = [
724
- st,
725
- lt
726
- ], it = /* @__PURE__ */ M({
915
+ }, null, -1), yt = [
916
+ Et,
917
+ Lt
918
+ ], kt = /* @__PURE__ */ U({
727
919
  __name: "btn-default-icon",
728
920
  emits: ["click"],
729
- setup(l, { emit: t }) {
730
- const n = t;
731
- function s(e) {
732
- n("click", e);
921
+ setup(n, { emit: t }) {
922
+ const a = t;
923
+ function r(i) {
924
+ a("click", i);
733
925
  }
734
- return (e, a) => (b(), C("svg", A({
926
+ return (i, m) => (z(), Y("svg", oe({
735
927
  xmlns: "http://www.w3.org/2000/svg",
736
928
  viewBox: "0 0 200 200",
737
929
  width: "20",
738
930
  height: "20"
739
- }, e.$attrs, { onClick: s }), ot, 16));
931
+ }, i.$attrs, { onClick: r }), yt, 16));
740
932
  }
741
- }), at = /* @__PURE__ */ c("path", {
933
+ }), Dt = /* @__PURE__ */ o("path", {
742
934
  fill: "#FFA000",
743
935
  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
936
  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
937
  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
938
  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
939
  z`
748
- }, null, -1), ut = [
749
- at
750
- ], rt = /* @__PURE__ */ M({
940
+ }, null, -1), $t = [
941
+ Dt
942
+ ], zt = /* @__PURE__ */ U({
751
943
  __name: "btn-warn-icon",
752
944
  emits: ["click"],
753
- setup(l, { emit: t }) {
754
- const n = t;
755
- function s(e) {
756
- n("click", e);
945
+ setup(n, { emit: t }) {
946
+ const a = t;
947
+ function r(i) {
948
+ a("click", i);
757
949
  }
758
- return (e, a) => (b(), C("svg", A({
950
+ return (i, m) => (z(), Y("svg", oe({
759
951
  xmlns: "http://www.w3.org/2000/svg",
760
952
  viewBox: "0 0 200 200",
761
953
  width: "20",
762
954
  height: "20"
763
- }, e.$attrs, { onClick: s }), ut, 16));
955
+ }, i.$attrs, { onClick: r }), $t, 16));
764
956
  }
765
- }), dt = /* @__PURE__ */ c("path", {
957
+ }), Ct = /* @__PURE__ */ o("path", {
766
958
  fill: "#ED4630",
767
959
  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
960
  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
961
  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
962
  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
963
  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), ht = [
773
- dt
774
- ], vt = /* @__PURE__ */ M({
964
+ }, null, -1), St = [
965
+ Ct
966
+ ], Bt = /* @__PURE__ */ U({
775
967
  __name: "btn-error-icon",
776
968
  emits: ["click"],
777
- setup(l, { emit: t }) {
778
- const n = t;
779
- function s(e) {
780
- n("click", e);
969
+ setup(n, { emit: t }) {
970
+ const a = t;
971
+ function r(i) {
972
+ a("click", i);
781
973
  }
782
- return (e, a) => (b(), C("svg", A({
974
+ return (i, m) => (z(), Y("svg", oe({
783
975
  xmlns: "http://www.w3.org/2000/svg",
784
976
  viewBox: "0 0 200 200",
785
977
  width: "20",
786
978
  height: "20"
787
- }, e.$attrs, { onClick: s }), ht, 16));
979
+ }, i.$attrs, { onClick: r }), St, 16));
788
980
  }
789
- }), gt = /* @__PURE__ */ c("path", {
981
+ }), Tt = /* @__PURE__ */ o("path", {
790
982
  fill: "#5EAA2F",
791
983
  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
984
  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
985
  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
986
  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), ft = [
796
- gt
797
- ], pt = /* @__PURE__ */ M({
987
+ }, null, -1), Pt = [
988
+ Tt
989
+ ], Xt = /* @__PURE__ */ U({
798
990
  __name: "btn-success-icon",
799
991
  emits: ["click"],
800
- setup(l, { emit: t }) {
801
- const n = t;
802
- function s(e) {
803
- n("click", e);
992
+ setup(n, { emit: t }) {
993
+ const a = t;
994
+ function r(i) {
995
+ a("click", i);
804
996
  }
805
- return (e, a) => (b(), C("svg", A({
997
+ return (i, m) => (z(), Y("svg", oe({
806
998
  xmlns: "http://www.w3.org/2000/svg",
807
999
  viewBox: "0 0 200 200",
808
1000
  width: "20",
809
1001
  height: "20"
810
- }, e.$attrs, { onClick: s }), ft, 16));
1002
+ }, i.$attrs, { onClick: r }), Pt, 16));
811
1003
  }
812
- }), ae = () => ({
1004
+ }), Le = () => ({
813
1005
  width: 330,
814
1006
  height: 44,
815
1007
  verticalPadding: 12,
816
1008
  horizontalPadding: 16
817
- }), Q = /* @__PURE__ */ M({
1009
+ }), he = /* @__PURE__ */ U({
818
1010
  __name: "index",
819
1011
  props: {
820
- config: { default: ae },
1012
+ config: { default: Le },
821
1013
  clickEvent: {},
822
1014
  disabled: { type: Boolean, default: !1 },
823
1015
  type: { default: "default" },
824
1016
  title: { default: "点击按键进行验证" }
825
1017
  },
826
1018
  emits: ["click-event"],
827
- setup(l, { emit: t }) {
828
- const n = l, { type: s, title: e, disabled: a } = ve(n), d = D({
829
- ...ae(),
830
- ...n.config
831
- });
832
- j(() => n.config, () => {
833
- d.value = {
834
- ...d.value,
835
- ...n.config
836
- };
837
- });
838
- const o = z(() => ["go-captcha", "gc-btn-block", `gc-${s.value}`, a.value ? "gc-disabled" : ""]), E = z(() => ({
839
- width: d.value.width + "px",
840
- height: d.value.height + "px",
841
- paddingLeft: d.value.horizontalPadding + "px",
842
- paddingRight: d.value.horizontalPadding + "px",
843
- paddingTop: d.value.verticalPadding + "px",
844
- paddingBottom: d.value.verticalPadding + "px"
845
- })), u = t;
846
- function g(r) {
847
- u("click-event", r);
1019
+ setup(n, { emit: t }) {
1020
+ const a = n, { type: r, title: i, disabled: m, config: c } = ze(a), u = B({ ...Le(), ...I(c) });
1021
+ F(() => a.config, (s, p) => {
1022
+ Object.assign(u, s);
1023
+ }, { deep: !0 });
1024
+ const e = x(() => ["go-captcha", "gc-btn-block", `gc-${r.value}`, m.value ? "gc-disabled" : ""]), d = x(() => ({
1025
+ width: u.width + "px",
1026
+ height: u.height + "px",
1027
+ paddingLeft: u.horizontalPadding + "px",
1028
+ paddingRight: u.horizontalPadding + "px",
1029
+ paddingTop: u.verticalPadding + "px",
1030
+ paddingBottom: u.verticalPadding + "px"
1031
+ })), y = t;
1032
+ function E(s) {
1033
+ y("click-event", s);
848
1034
  }
849
- return (r, h) => (b(), C("div", {
850
- class: I(o.value),
851
- style: m(E.value),
852
- onClick: g
1035
+ return (s, p) => (z(), Y("div", {
1036
+ class: se(e.value),
1037
+ style: D(d.value),
1038
+ onClick: E
853
1039
  }, [
854
- c("div", {
855
- class: I(i(s) === "default" ? "gc-ripple" : "")
1040
+ o("div", {
1041
+ class: se(v(r) === "default" ? "gc-ripple" : "")
856
1042
  }, [
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)
1043
+ v(r) === "default" ? (z(), ae(kt, { key: 0 })) : v(r) === "warn" ? (z(), ae(zt, { key: 1 })) : v(r) === "error" ? (z(), ae(Bt, { key: 2 })) : v(r) === "success" ? (z(), ae(Xt, { key: 3 })) : Ce("", !0)
858
1044
  ], 2),
859
- c("span", null, V(i(e)), 1)
1045
+ o("span", null, ie(v(i)), 1)
860
1046
  ], 6));
861
1047
  }
862
1048
  });
863
- Q.name = "gocaptcha-button";
864
- Q.install = function(l) {
865
- l.component("gocaptcha-button", Q);
1049
+ he.name = "gocaptcha-button";
1050
+ he.install = function(n) {
1051
+ n.component("gocaptcha-button", he);
866
1052
  };
867
- const _t = (l) => {
868
- l.installed || (l.installed = !0, [G, J, K, O, Q].map((t) => l.use(t)));
1053
+ const Mt = {
1054
+ install(n) {
1055
+ le.install(n), re.install(n), ue.install(n), de.install(n), he.install(n);
1056
+ }
869
1057
  };
870
1058
  export {
871
- Q as Button,
872
- G as Click,
873
- O as Rotate,
874
- J as Slide,
875
- K as SlideRegion,
876
- _t as default
1059
+ he as Button,
1060
+ le as Click,
1061
+ de as Rotate,
1062
+ re as Slide,
1063
+ ue as SlideRegion,
1064
+ Mt as default
877
1065
  };