@aiquants/drag-drop-panels 0.8.5 → 0.9.1

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.
package/dist/index.es.js CHANGED
@@ -1,276 +1,276 @@
1
- import qe, { forwardRef as Ie, createElement as Ee, useRef as F, useState as te, useEffect as K, useLayoutEffect as Se, useCallback as w, memo as st, useMemo as Ue, Fragment as ot } from "react";
2
- var we = { exports: {} }, pe = {};
3
- var We;
4
- function at() {
5
- if (We) return pe;
6
- We = 1;
7
- var r = /* @__PURE__ */ Symbol.for("react.transitional.element"), e = /* @__PURE__ */ Symbol.for("react.fragment");
8
- function n(s, o, i) {
9
- var u = null;
10
- if (i !== void 0 && (u = "" + i), o.key !== void 0 && (u = "" + o.key), "key" in o) {
11
- i = {};
12
- for (var c in o)
13
- c !== "key" && (i[c] = o[c]);
14
- } else i = o;
15
- return o = i.ref, {
16
- $$typeof: r,
17
- type: s,
18
- key: u,
19
- ref: o !== void 0 ? o : null,
20
- props: i
1
+ import qt, { forwardRef as Wt, createElement as Ge, useRef as I, useState as se, useEffect as oe, useLayoutEffect as we, memo as mn, useMemo as Le, useId as fn, useCallback as k, Fragment as pn } from "react";
2
+ var _e = { exports: {} }, Ne = {};
3
+ var kt;
4
+ function gn() {
5
+ if (kt) return Ne;
6
+ kt = 1;
7
+ var t = /* @__PURE__ */ Symbol.for("react.transitional.element"), n = /* @__PURE__ */ Symbol.for("react.fragment");
8
+ function e(o, r, a) {
9
+ var i = null;
10
+ if (a !== void 0 && (i = "" + a), r.key !== void 0 && (i = "" + r.key), "key" in r) {
11
+ a = {};
12
+ for (var d in r)
13
+ d !== "key" && (a[d] = r[d]);
14
+ } else a = r;
15
+ return r = a.ref, {
16
+ $$typeof: t,
17
+ type: o,
18
+ key: i,
19
+ ref: r !== void 0 ? r : null,
20
+ props: a
21
21
  };
22
22
  }
23
- return pe.Fragment = e, pe.jsx = n, pe.jsxs = n, pe;
23
+ return Ne.Fragment = n, Ne.jsx = e, Ne.jsxs = e, Ne;
24
24
  }
25
- var xe = {};
26
- var ze;
27
- function lt() {
28
- return ze || (ze = 1, process.env.NODE_ENV !== "production" && (function() {
29
- function r(a) {
30
- if (a == null) return null;
31
- if (typeof a == "function")
32
- return a.$$typeof === C ? null : a.displayName || a.name || null;
33
- if (typeof a == "string") return a;
34
- switch (a) {
35
- case k:
25
+ var Oe = {};
26
+ var Ct;
27
+ function xn() {
28
+ return Ct || (Ct = 1, process.env.NODE_ENV !== "production" && (function() {
29
+ function t(u) {
30
+ if (u == null) return null;
31
+ if (typeof u == "function")
32
+ return u.$$typeof === $ ? null : u.displayName || u.name || null;
33
+ if (typeof u == "string") return u;
34
+ switch (u) {
35
+ case T:
36
36
  return "Fragment";
37
- case R:
37
+ case P:
38
38
  return "Profiler";
39
- case _:
39
+ case h:
40
40
  return "StrictMode";
41
- case U:
41
+ case L:
42
42
  return "Suspense";
43
- case $:
43
+ case B:
44
44
  return "SuspenseList";
45
45
  case x:
46
46
  return "Activity";
47
47
  }
48
- if (typeof a == "object")
49
- switch (typeof a.tag == "number" && console.error(
48
+ if (typeof u == "object")
49
+ switch (typeof u.tag == "number" && console.error(
50
50
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
51
- ), a.$$typeof) {
52
- case j:
51
+ ), u.$$typeof) {
52
+ case C:
53
53
  return "Portal";
54
- case Z:
55
- return a.displayName || "Context";
56
- case z:
57
- return (a._context.displayName || "Context") + ".Consumer";
58
- case Y:
59
- var d = a.render;
60
- return a = a.displayName, a || (a = d.displayName || d.name || "", a = a !== "" ? "ForwardRef(" + a + ")" : "ForwardRef"), a;
61
- case L:
62
- return d = a.displayName || null, d !== null ? d : r(a.type) || "Memo";
63
- case f:
64
- d = a._payload, a = a._init;
54
+ case l:
55
+ return u.displayName || "Context";
56
+ case N:
57
+ return (u._context.displayName || "Context") + ".Consumer";
58
+ case _:
59
+ var f = u.render;
60
+ return u = u.displayName, u || (u = f.displayName || f.name || "", u = u !== "" ? "ForwardRef(" + u + ")" : "ForwardRef"), u;
61
+ case J:
62
+ return f = u.displayName || null, f !== null ? f : t(u.type) || "Memo";
63
+ case p:
64
+ f = u._payload, u = u._init;
65
65
  try {
66
- return r(a(d));
66
+ return t(u(f));
67
67
  } catch {
68
68
  }
69
69
  }
70
70
  return null;
71
71
  }
72
- function e(a) {
73
- return "" + a;
72
+ function n(u) {
73
+ return "" + u;
74
74
  }
75
- function n(a) {
75
+ function e(u) {
76
76
  try {
77
- e(a);
78
- var d = !1;
77
+ n(u);
78
+ var f = !1;
79
79
  } catch {
80
- d = !0;
80
+ f = !0;
81
81
  }
82
- if (d) {
83
- d = console;
84
- var S = d.error, X = typeof Symbol == "function" && Symbol.toStringTag && a[Symbol.toStringTag] || a.constructor.name || "Object";
82
+ if (f) {
83
+ f = console;
84
+ var S = f.error, U = typeof Symbol == "function" && Symbol.toStringTag && u[Symbol.toStringTag] || u.constructor.name || "Object";
85
85
  return S.call(
86
- d,
86
+ f,
87
87
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
88
- X
89
- ), e(a);
88
+ U
89
+ ), n(u);
90
90
  }
91
91
  }
92
- function s(a) {
93
- if (a === k) return "<>";
94
- if (typeof a == "object" && a !== null && a.$$typeof === f)
92
+ function o(u) {
93
+ if (u === T) return "<>";
94
+ if (typeof u == "object" && u !== null && u.$$typeof === p)
95
95
  return "<...>";
96
96
  try {
97
- var d = r(a);
98
- return d ? "<" + d + ">" : "<...>";
97
+ var f = t(u);
98
+ return f ? "<" + f + ">" : "<...>";
99
99
  } catch {
100
100
  return "<...>";
101
101
  }
102
102
  }
103
- function o() {
104
- var a = W.A;
105
- return a === null ? null : a.getOwner();
103
+ function r() {
104
+ var u = W.A;
105
+ return u === null ? null : u.getOwner();
106
106
  }
107
- function i() {
107
+ function a() {
108
108
  return Error("react-stack-top-frame");
109
109
  }
110
- function u(a) {
111
- if (p.call(a, "key")) {
112
- var d = Object.getOwnPropertyDescriptor(a, "key").get;
113
- if (d && d.isReactWarning) return !1;
110
+ function i(u) {
111
+ if (v.call(u, "key")) {
112
+ var f = Object.getOwnPropertyDescriptor(u, "key").get;
113
+ if (f && f.isReactWarning) return !1;
114
114
  }
115
- return a.key !== void 0;
115
+ return u.key !== void 0;
116
116
  }
117
- function c(a, d) {
117
+ function d(u, f) {
118
118
  function S() {
119
- v || (v = !0, console.error(
119
+ D || (D = !0, console.error(
120
120
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
121
- d
121
+ f
122
122
  ));
123
123
  }
124
- S.isReactWarning = !0, Object.defineProperty(a, "key", {
124
+ S.isReactWarning = !0, Object.defineProperty(u, "key", {
125
125
  get: S,
126
126
  configurable: !0
127
127
  });
128
128
  }
129
- function h() {
130
- var a = r(this.type);
131
- return D[a] || (D[a] = !0, console.error(
129
+ function m() {
130
+ var u = t(this.type);
131
+ return R[u] || (R[u] = !0, console.error(
132
132
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
133
- )), a = this.props.ref, a !== void 0 ? a : null;
133
+ )), u = this.props.ref, u !== void 0 ? u : null;
134
134
  }
135
- function N(a, d, S, X, G, Q) {
136
- var V = S.ref;
137
- return a = {
138
- $$typeof: l,
139
- type: a,
140
- key: d,
135
+ function w(u, f, S, U, K, ae) {
136
+ var G = S.ref;
137
+ return u = {
138
+ $$typeof: E,
139
+ type: u,
140
+ key: f,
141
141
  props: S,
142
- _owner: X
143
- }, (V !== void 0 ? V : null) !== null ? Object.defineProperty(a, "ref", {
142
+ _owner: U
143
+ }, (G !== void 0 ? G : null) !== null ? Object.defineProperty(u, "ref", {
144
144
  enumerable: !1,
145
- get: h
146
- }) : Object.defineProperty(a, "ref", { enumerable: !1, value: null }), a._store = {}, Object.defineProperty(a._store, "validated", {
145
+ get: m
146
+ }) : Object.defineProperty(u, "ref", { enumerable: !1, value: null }), u._store = {}, Object.defineProperty(u._store, "validated", {
147
147
  configurable: !1,
148
148
  enumerable: !1,
149
149
  writable: !0,
150
150
  value: 0
151
- }), Object.defineProperty(a, "_debugInfo", {
151
+ }), Object.defineProperty(u, "_debugInfo", {
152
152
  configurable: !1,
153
153
  enumerable: !1,
154
154
  writable: !0,
155
155
  value: null
156
- }), Object.defineProperty(a, "_debugStack", {
156
+ }), Object.defineProperty(u, "_debugStack", {
157
157
  configurable: !1,
158
158
  enumerable: !1,
159
159
  writable: !0,
160
- value: G
161
- }), Object.defineProperty(a, "_debugTask", {
160
+ value: K
161
+ }), Object.defineProperty(u, "_debugTask", {
162
162
  configurable: !1,
163
163
  enumerable: !1,
164
164
  writable: !0,
165
- value: Q
166
- }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
165
+ value: ae
166
+ }), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
167
167
  }
168
- function b(a, d, S, X, G, Q) {
169
- var V = d.children;
170
- if (V !== void 0)
171
- if (X)
172
- if (g(V)) {
173
- for (X = 0; X < V.length; X++)
174
- M(V[X]);
175
- Object.freeze && Object.freeze(V);
168
+ function b(u, f, S, U, K, ae) {
169
+ var G = f.children;
170
+ if (G !== void 0)
171
+ if (U)
172
+ if (y(G)) {
173
+ for (U = 0; U < G.length; U++)
174
+ A(G[U]);
175
+ Object.freeze && Object.freeze(G);
176
176
  } else
177
177
  console.error(
178
178
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
179
179
  );
180
- else M(V);
181
- if (p.call(d, "key")) {
182
- V = r(a);
183
- var re = Object.keys(d).filter(function(se) {
184
- return se !== "key";
180
+ else A(G);
181
+ if (v.call(f, "key")) {
182
+ G = t(u);
183
+ var H = Object.keys(f).filter(function(ue) {
184
+ return ue !== "key";
185
185
  });
186
- X = 0 < re.length ? "{key: someKey, " + re.join(": ..., ") + ": ...}" : "{key: someKey}", H[V + X] || (re = 0 < re.length ? "{" + re.join(": ..., ") + ": ...}" : "{}", console.error(
186
+ U = 0 < H.length ? "{key: someKey, " + H.join(": ..., ") + ": ...}" : "{key: someKey}", X[G + U] || (H = 0 < H.length ? "{" + H.join(": ..., ") + ": ...}" : "{}", console.error(
187
187
  `A props object containing a "key" prop is being spread into JSX:
188
188
  let props = %s;
189
189
  <%s {...props} />
190
190
  React keys must be passed directly to JSX without using spread:
191
191
  let props = %s;
192
192
  <%s key={someKey} {...props} />`,
193
- X,
194
- V,
195
- re,
196
- V
197
- ), H[V + X] = !0);
193
+ U,
194
+ G,
195
+ H,
196
+ G
197
+ ), X[G + U] = !0);
198
198
  }
199
- if (V = null, S !== void 0 && (n(S), V = "" + S), u(d) && (n(d.key), V = "" + d.key), "key" in d) {
199
+ if (G = null, S !== void 0 && (e(S), G = "" + S), i(f) && (e(f.key), G = "" + f.key), "key" in f) {
200
200
  S = {};
201
- for (var ce in d)
202
- ce !== "key" && (S[ce] = d[ce]);
203
- } else S = d;
204
- return V && c(
201
+ for (var ve in f)
202
+ ve !== "key" && (S[ve] = f[ve]);
203
+ } else S = f;
204
+ return G && d(
205
205
  S,
206
- typeof a == "function" ? a.displayName || a.name || "Unknown" : a
207
- ), N(
208
- a,
209
- V,
210
- S,
211
- o(),
206
+ typeof u == "function" ? u.displayName || u.name || "Unknown" : u
207
+ ), w(
208
+ u,
212
209
  G,
213
- Q
210
+ S,
211
+ r(),
212
+ K,
213
+ ae
214
214
  );
215
215
  }
216
- function M(a) {
217
- T(a) ? a._store && (a._store.validated = 1) : typeof a == "object" && a !== null && a.$$typeof === f && (a._payload.status === "fulfilled" ? T(a._payload.value) && a._payload.value._store && (a._payload.value._store.validated = 1) : a._store && (a._store.validated = 1));
216
+ function A(u) {
217
+ q(u) ? u._store && (u._store.validated = 1) : typeof u == "object" && u !== null && u.$$typeof === p && (u._payload.status === "fulfilled" ? q(u._payload.value) && u._payload.value._store && (u._payload.value._store.validated = 1) : u._store && (u._store.validated = 1));
218
218
  }
219
- function T(a) {
220
- return typeof a == "object" && a !== null && a.$$typeof === l;
219
+ function q(u) {
220
+ return typeof u == "object" && u !== null && u.$$typeof === E;
221
221
  }
222
- var y = qe, l = /* @__PURE__ */ Symbol.for("react.transitional.element"), j = /* @__PURE__ */ Symbol.for("react.portal"), k = /* @__PURE__ */ Symbol.for("react.fragment"), _ = /* @__PURE__ */ Symbol.for("react.strict_mode"), R = /* @__PURE__ */ Symbol.for("react.profiler"), z = /* @__PURE__ */ Symbol.for("react.consumer"), Z = /* @__PURE__ */ Symbol.for("react.context"), Y = /* @__PURE__ */ Symbol.for("react.forward_ref"), U = /* @__PURE__ */ Symbol.for("react.suspense"), $ = /* @__PURE__ */ Symbol.for("react.suspense_list"), L = /* @__PURE__ */ Symbol.for("react.memo"), f = /* @__PURE__ */ Symbol.for("react.lazy"), x = /* @__PURE__ */ Symbol.for("react.activity"), C = /* @__PURE__ */ Symbol.for("react.client.reference"), W = y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, p = Object.prototype.hasOwnProperty, g = Array.isArray, m = console.createTask ? console.createTask : function() {
222
+ var j = qt, E = /* @__PURE__ */ Symbol.for("react.transitional.element"), C = /* @__PURE__ */ Symbol.for("react.portal"), T = /* @__PURE__ */ Symbol.for("react.fragment"), h = /* @__PURE__ */ Symbol.for("react.strict_mode"), P = /* @__PURE__ */ Symbol.for("react.profiler"), N = /* @__PURE__ */ Symbol.for("react.consumer"), l = /* @__PURE__ */ Symbol.for("react.context"), _ = /* @__PURE__ */ Symbol.for("react.forward_ref"), L = /* @__PURE__ */ Symbol.for("react.suspense"), B = /* @__PURE__ */ Symbol.for("react.suspense_list"), J = /* @__PURE__ */ Symbol.for("react.memo"), p = /* @__PURE__ */ Symbol.for("react.lazy"), x = /* @__PURE__ */ Symbol.for("react.activity"), $ = /* @__PURE__ */ Symbol.for("react.client.reference"), W = j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, v = Object.prototype.hasOwnProperty, y = Array.isArray, g = console.createTask ? console.createTask : function() {
223
223
  return null;
224
224
  };
225
- y = {
226
- react_stack_bottom_frame: function(a) {
227
- return a();
225
+ j = {
226
+ react_stack_bottom_frame: function(u) {
227
+ return u();
228
228
  }
229
229
  };
230
- var v, D = {}, A = y.react_stack_bottom_frame.bind(
231
- y,
232
- i
233
- )(), O = m(s(i)), H = {};
234
- xe.Fragment = k, xe.jsx = function(a, d, S) {
235
- var X = 1e4 > W.recentlyCreatedOwnerStacks++;
230
+ var D, R = {}, Y = j.react_stack_bottom_frame.bind(
231
+ j,
232
+ a
233
+ )(), F = g(o(a)), X = {};
234
+ Oe.Fragment = T, Oe.jsx = function(u, f, S) {
235
+ var U = 1e4 > W.recentlyCreatedOwnerStacks++;
236
236
  return b(
237
- a,
238
- d,
237
+ u,
238
+ f,
239
239
  S,
240
240
  !1,
241
- X ? Error("react-stack-top-frame") : A,
242
- X ? m(s(a)) : O
241
+ U ? Error("react-stack-top-frame") : Y,
242
+ U ? g(o(u)) : F
243
243
  );
244
- }, xe.jsxs = function(a, d, S) {
245
- var X = 1e4 > W.recentlyCreatedOwnerStacks++;
244
+ }, Oe.jsxs = function(u, f, S) {
245
+ var U = 1e4 > W.recentlyCreatedOwnerStacks++;
246
246
  return b(
247
- a,
248
- d,
247
+ u,
248
+ f,
249
249
  S,
250
250
  !0,
251
- X ? Error("react-stack-top-frame") : A,
252
- X ? m(s(a)) : O
251
+ U ? Error("react-stack-top-frame") : Y,
252
+ U ? g(o(u)) : F
253
253
  );
254
254
  };
255
- })()), xe;
255
+ })()), Oe;
256
256
  }
257
- var Ye;
258
- function it() {
259
- return Ye || (Ye = 1, process.env.NODE_ENV === "production" ? we.exports = at() : we.exports = lt()), we.exports;
257
+ var Nt;
258
+ function vn() {
259
+ return Nt || (Nt = 1, process.env.NODE_ENV === "production" ? _e.exports = gn() : _e.exports = xn()), _e.exports;
260
260
  }
261
- var t = it();
262
- const ct = (r) => r.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), ut = (r) => r.replace(
261
+ var s = vn();
262
+ const bn = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), yn = (t) => t.replace(
263
263
  /^([A-Z])|[\s-_]+(\w)/g,
264
- (e, n, s) => s ? s.toUpperCase() : n.toLowerCase()
265
- ), Fe = (r) => {
266
- const e = ut(r);
267
- return e.charAt(0).toUpperCase() + e.slice(1);
268
- }, Be = (...r) => r.filter((e, n, s) => !!e && e.trim() !== "" && s.indexOf(e) === n).join(" ").trim(), dt = (r) => {
269
- for (const e in r)
270
- if (e.startsWith("aria-") || e === "role" || e === "title")
264
+ (n, e, o) => o ? o.toUpperCase() : e.toLowerCase()
265
+ ), Ot = (t) => {
266
+ const n = yn(t);
267
+ return n.charAt(0).toUpperCase() + n.slice(1);
268
+ }, Ht = (...t) => t.filter((n, e, o) => !!n && n.trim() !== "" && o.indexOf(n) === e).join(" ").trim(), wn = (t) => {
269
+ for (const n in t)
270
+ if (n.startsWith("aria-") || n === "role" || n === "title")
271
271
  return !0;
272
272
  };
273
- var ht = {
273
+ var jn = {
274
274
  xmlns: "http://www.w3.org/2000/svg",
275
275
  width: 24,
276
276
  height: 24,
@@ -281,51 +281,67 @@ var ht = {
281
281
  strokeLinecap: "round",
282
282
  strokeLinejoin: "round"
283
283
  };
284
- const mt = Ie(
284
+ const Pn = Wt(
285
285
  ({
286
- color: r = "currentColor",
287
- size: e = 24,
288
- strokeWidth: n = 2,
289
- absoluteStrokeWidth: s,
290
- className: o = "",
291
- children: i,
292
- iconNode: u,
293
- ...c
294
- }, h) => Ee(
286
+ color: t = "currentColor",
287
+ size: n = 24,
288
+ strokeWidth: e = 2,
289
+ absoluteStrokeWidth: o,
290
+ className: r = "",
291
+ children: a,
292
+ iconNode: i,
293
+ ...d
294
+ }, m) => Ge(
295
295
  "svg",
296
296
  {
297
- ref: h,
298
- ...ht,
299
- width: e,
300
- height: e,
301
- stroke: r,
302
- strokeWidth: s ? Number(n) * 24 / Number(e) : n,
303
- className: Be("lucide", o),
304
- ...!i && !dt(c) && { "aria-hidden": "true" },
305
- ...c
297
+ ref: m,
298
+ ...jn,
299
+ width: n,
300
+ height: n,
301
+ stroke: t,
302
+ strokeWidth: o ? Number(e) * 24 / Number(n) : e,
303
+ className: Ht("lucide", r),
304
+ ...!a && !wn(d) && { "aria-hidden": "true" },
305
+ ...d
306
306
  },
307
307
  [
308
- ...u.map(([N, b]) => Ee(N, b)),
309
- ...Array.isArray(i) ? i : [i]
308
+ ...i.map(([w, b]) => Ge(w, b)),
309
+ ...Array.isArray(a) ? a : [a]
310
310
  ]
311
311
  )
312
312
  );
313
- const oe = (r, e) => {
314
- const n = Ie(
315
- ({ className: s, ...o }, i) => Ee(mt, {
316
- ref: i,
317
- iconNode: e,
318
- className: Be(
319
- `lucide-${ct(Fe(r))}`,
320
- `lucide-${r}`,
321
- s
313
+ const ie = (t, n) => {
314
+ const e = Wt(
315
+ ({ className: o, ...r }, a) => Ge(Pn, {
316
+ ref: a,
317
+ iconNode: n,
318
+ className: Ht(
319
+ `lucide-${bn(Ot(t))}`,
320
+ `lucide-${t}`,
321
+ o
322
322
  ),
323
- ...o
323
+ ...r
324
324
  })
325
325
  );
326
- return n.displayName = Fe(r), n;
326
+ return e.displayName = Ot(t), e;
327
327
  };
328
- const ft = [
328
+ const En = [
329
+ ["path", { d: "M12 5v14", key: "s699le" }],
330
+ ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
331
+ ], Dn = ie("arrow-down", En);
332
+ const kn = [
333
+ ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
334
+ ["path", { d: "M19 12H5", key: "x3x0zl" }]
335
+ ], Cn = ie("arrow-left", kn);
336
+ const Nn = [
337
+ ["path", { d: "M5 12h14", key: "1ays0h" }],
338
+ ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
339
+ ], On = ie("arrow-right", Nn);
340
+ const Sn = [
341
+ ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
342
+ ["path", { d: "M12 19V5", key: "x0mq9r" }]
343
+ ], Mn = ie("arrow-up", Sn);
344
+ const An = [
329
345
  [
330
346
  "path",
331
347
  {
@@ -334,8 +350,8 @@ const ft = [
334
350
  }
335
351
  ],
336
352
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
337
- ], pt = oe("eye", ft);
338
- const xt = [
353
+ ], $n = ie("eye", An);
354
+ const Tn = [
339
355
  [
340
356
  "path",
341
357
  {
@@ -352,20 +368,20 @@ const xt = [
352
368
  }
353
369
  ],
354
370
  ["path", { d: "m2 2 20 20", key: "1ooewy" }]
355
- ], Xe = oe("eye-off", xt);
356
- const gt = [
371
+ ], St = ie("eye-off", Tn);
372
+ const Rn = [
357
373
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
358
374
  ["path", { d: "m21 3-7 7", key: "1l2asr" }],
359
375
  ["path", { d: "m3 21 7-7", key: "tjx5ai" }],
360
376
  ["path", { d: "M9 21H3v-6", key: "wtvkvv" }]
361
- ], bt = oe("maximize-2", gt);
362
- const vt = [
377
+ ], _n = ie("maximize-2", Rn);
378
+ const Ln = [
363
379
  ["path", { d: "m14 10 7-7", key: "oa77jy" }],
364
380
  ["path", { d: "M20 10h-6V4", key: "mjg0md" }],
365
381
  ["path", { d: "m3 21 7-7", key: "tjx5ai" }],
366
382
  ["path", { d: "M4 14h6v6", key: "rmj7iw" }]
367
- ], yt = oe("minimize-2", vt);
368
- const wt = [
383
+ ], zn = ie("minimize-2", Ln);
384
+ const In = [
369
385
  ["path", { d: "M12.586 12.586 19 19", key: "ea5xo7" }],
370
386
  [
371
387
  "path",
@@ -374,8 +390,8 @@ const wt = [
374
390
  key: "277e5u"
375
391
  }
376
392
  ]
377
- ], jt = oe("mouse-pointer", wt);
378
- const Pt = [
393
+ ], qn = ie("mouse-pointer", In);
394
+ const Wn = [
379
395
  ["path", { d: "M14 4.1 12 6", key: "ita8i4" }],
380
396
  ["path", { d: "m5.1 8-2.9-.8", key: "1go3kf" }],
381
397
  ["path", { d: "m6 12-1.9 2", key: "mnht97" }],
@@ -387,19 +403,19 @@ const Pt = [
387
403
  key: "s0h3yz"
388
404
  }
389
405
  ]
390
- ], kt = oe("mouse-pointer-click", Pt);
391
- const Nt = [
406
+ ], Hn = ie("mouse-pointer-click", Wn);
407
+ const Yn = [
392
408
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
393
409
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
394
- ], Ve = oe("x", Nt), le = class le {
410
+ ], Yt = ie("x", Yn), me = class me {
395
411
  /**
396
412
  * @constructor
397
413
  * @param {LogLevel} [level=LogLevel.WARN] - The minimum log level to output.
398
414
  * @param {string} [prefix="[drag-drop-panels]"] - The prefix to add to all log messages.
399
415
  * @param {ILogger} [impl=console] - The implementation to use for logging.
400
416
  */
401
- constructor(e = 2, n = "[drag-drop-panels]", s = console) {
402
- this.level = e, this.prefix = n, this.impl = s;
417
+ constructor(n = 2, e = "[drag-drop-panels]", o = console) {
418
+ this.level = n, this.prefix = e, this.impl = o;
403
419
  }
404
420
  /**
405
421
  * @method setLevel
@@ -407,8 +423,8 @@ const Nt = [
407
423
  * @description 静的インスタンスの現在のログレベルを更新します。
408
424
  * @param {LogLevel} level - The new log level.
409
425
  */
410
- static setLevel(e) {
411
- le.instance.setLevel(e);
426
+ static setLevel(n) {
427
+ me.instance.setLevel(n);
412
428
  }
413
429
  /**
414
430
  * @method setLevel
@@ -416,8 +432,8 @@ const Nt = [
416
432
  * @description 現在のログレベルを更新します。
417
433
  * @param {LogLevel} level - The new log level.
418
434
  */
419
- setLevel(e) {
420
- this.level = e;
435
+ setLevel(n) {
436
+ this.level = n;
421
437
  }
422
438
  /**
423
439
  * @method setImplementation
@@ -425,8 +441,8 @@ const Nt = [
425
441
  * @description 静的インスタンスのロガーの実装を更新します。
426
442
  * @param {ILogger} impl - The new logger implementation.
427
443
  */
428
- static setImplementation(e) {
429
- le.instance.setImplementation(e);
444
+ static setImplementation(n) {
445
+ me.instance.setImplementation(n);
430
446
  }
431
447
  /**
432
448
  * @method setImplementation
@@ -434,8 +450,8 @@ const Nt = [
434
450
  * @description ロガーの実装を更新します。
435
451
  * @param {ILogger} impl - The new logger implementation.
436
452
  */
437
- setImplementation(e) {
438
- this.impl = e;
453
+ setImplementation(n) {
454
+ this.impl = n;
439
455
  }
440
456
  /**
441
457
  * @method setPrefix
@@ -443,8 +459,8 @@ const Nt = [
443
459
  * @description 静的インスタンスのログのプレフィックスを更新します。
444
460
  * @param {string} prefix - The new prefix.
445
461
  */
446
- static setPrefix(e) {
447
- le.instance.setPrefix(e);
462
+ static setPrefix(n) {
463
+ me.instance.setPrefix(n);
448
464
  }
449
465
  /**
450
466
  * @method setPrefix
@@ -452,462 +468,1028 @@ const Nt = [
452
468
  * @description ログのプレフィックスを更新します。
453
469
  * @param {string} prefix - The new prefix.
454
470
  */
455
- setPrefix(e) {
456
- this.prefix = e;
471
+ setPrefix(n) {
472
+ this.prefix = n;
457
473
  }
458
- formatMessage(e) {
459
- return typeof e == "string" ? [`${this.prefix} ${e}`] : [this.prefix, e];
474
+ formatMessage(n) {
475
+ return typeof n == "string" ? [`${this.prefix} ${n}`] : [this.prefix, n];
460
476
  }
461
- static debug(e, ...n) {
462
- le.instance.debug(e, ...n);
477
+ static debug(n, ...e) {
478
+ me.instance.debug(n, ...e);
463
479
  }
464
- debug(e, ...n) {
465
- this.level <= 0 && this.impl.debug(...this.formatMessage(e), ...n);
480
+ debug(n, ...e) {
481
+ this.level <= 0 && this.impl.debug(...this.formatMessage(n), ...e);
466
482
  }
467
- static info(e, ...n) {
468
- le.instance.info(e, ...n);
483
+ static info(n, ...e) {
484
+ me.instance.info(n, ...e);
469
485
  }
470
- info(e, ...n) {
471
- this.level <= 1 && this.impl.info(...this.formatMessage(e), ...n);
486
+ info(n, ...e) {
487
+ this.level <= 1 && this.impl.info(...this.formatMessage(n), ...e);
472
488
  }
473
- static warn(e, ...n) {
474
- le.instance.warn(e, ...n);
489
+ static warn(n, ...e) {
490
+ me.instance.warn(n, ...e);
475
491
  }
476
- warn(e, ...n) {
477
- this.level <= 2 && this.impl.warn(...this.formatMessage(e), ...n);
492
+ warn(n, ...e) {
493
+ this.level <= 2 && this.impl.warn(...this.formatMessage(n), ...e);
478
494
  }
479
- static error(e, ...n) {
480
- le.instance.error(e, ...n);
495
+ static error(n, ...e) {
496
+ me.instance.error(n, ...e);
481
497
  }
482
- error(e, ...n) {
483
- this.level <= 3 && this.impl.error(...this.formatMessage(e), ...n);
498
+ error(n, ...e) {
499
+ this.level <= 3 && this.impl.error(...this.formatMessage(n), ...e);
484
500
  }
485
501
  };
486
- le.instance = new le(2, "[drag-drop-panels]");
487
- let Ce = le;
488
- const Dt = ({ config: r, panelId: e, sizeInfo: n, onSizeInfoClick: s }) => r.showPanelSizes && n ? (
502
+ me.instance = new me(2, "[drag-drop-panels]");
503
+ let Ke = me;
504
+ const Fn = ({ config: t, panelId: n, sizeInfo: e, onSizeInfoClick: o }) => t.showPanelSizes && e ? (
489
505
  // biome-ignore lint/a11y/noStaticElementInteractions: クリックイベントを持つ静的要素。デバッグ目的のため、インタラクティブ性は限定的。
490
506
  // biome-ignore lint/a11y/useKeyWithClickEvents: キーボード操作はデバッグ機能では優先度が低い。
491
- /* @__PURE__ */ t.jsxs(
507
+ /* @__PURE__ */ s.jsxs(
492
508
  "div",
493
509
  {
494
510
  className: "absolute top-1 right-24 z-10 cursor-default rounded-md bg-red-500/90 px-2 py-1 font-mono text-white text-xs leading-tight shadow-lg",
495
- onClick: s,
496
- onMouseDown: s,
497
- onTouchStart: (o) => o instanceof TouchEvent && s(o),
498
- onDragStart: s,
511
+ onClick: o,
512
+ onMouseDown: o,
513
+ onTouchStart: (r) => r instanceof TouchEvent && o(r),
514
+ onDragStart: o,
499
515
  children: [
500
- /* @__PURE__ */ t.jsxs("div", { className: "text-[10px] opacity-80", children: [
516
+ /* @__PURE__ */ s.jsxs("div", { className: "text-[10px] opacity-80", children: [
501
517
  "ID:",
502
- e
518
+ n
503
519
  ] }),
504
- /* @__PURE__ */ t.jsxs("div", { children: [
505
- n.width,
520
+ /* @__PURE__ */ s.jsxs("div", { children: [
521
+ e.width,
506
522
  "×",
507
- n.height
523
+ e.height
508
524
  ] }),
509
- /* @__PURE__ */ t.jsxs("div", { children: [
525
+ /* @__PURE__ */ s.jsxs("div", { children: [
510
526
  "X:",
511
- n.x,
527
+ e.x,
512
528
  " Y:",
513
- n.y
529
+ e.y
514
530
  ] }),
515
- /* @__PURE__ */ t.jsxs("div", { className: "text-[10px] opacity-80", children: [
531
+ /* @__PURE__ */ s.jsxs("div", { className: "text-[10px] opacity-80", children: [
516
532
  "min:",
517
- n.minHeight,
533
+ e.minHeight,
518
534
  " max:",
519
- n.maxHeight
535
+ e.maxHeight
520
536
  ] })
521
537
  ]
522
538
  }
523
539
  )
524
- ) : null, E = (r, e, ...n) => {
525
- (r.logLevel ?? 0) >= e && Ce.info(...n);
526
- }, Ze = qe.memo(({ index: r, columnIndex: e, isDragging: n, dragOverPosition: s, originalPosition: o, onDragEnter: i, onDragLeave: u, config: c, customDrag: h }) => {
527
- const N = o && o.columnIndex === e && (o.panelIndex === r || o.panelIndex + 1 === r), b = !N && s?.columnIndex === e && s?.insertIndex === r, M = F(null), [T, y] = te(null), l = n || (h?.isActive ?? !1);
528
- return K(() => {
529
- if (M.current) {
530
- const j = M.current.getBoundingClientRect(), k = {
531
- width: Math.round(j.width),
532
- height: Math.round(j.height),
533
- x: Math.round(j.left),
534
- y: Math.round(j.top)
540
+ ) : null, M = (t, n, ...e) => {
541
+ (t.logLevel ?? 0) >= n && Ke.info(...e);
542
+ }, et = (t, n, e) => t.columnIndex === n && (t.panelIndex === e || t.panelIndex + 1 === e), Ft = (t, n, e, o) => {
543
+ const r = Object.keys(t).find((d) => t[d].includes(n));
544
+ if (r === void 0 || t[e] === void 0) return null;
545
+ const a = { ...t };
546
+ if (r === e) {
547
+ const d = [...t[r]], m = d.indexOf(n);
548
+ return d.splice(m, 1), d.splice(m < o ? o - 1 : o, 0, n), a[e] = d, a;
549
+ }
550
+ a[r] = t[r].filter((d) => d !== n);
551
+ const i = [...t[e]];
552
+ return i.splice(o, 0, n), a[e] = i, a;
553
+ }, De = Object.freeze(["previous-column", "next-column", "up", "down"]), Bn = (t, n) => t.columnPanels[n] ?? [], tt = (t) => t.columnKeys.map((n) => Bn(t, n).filter((e) => t.panelVisibility[e] === !0)), Pe = (t, n) => {
554
+ for (const [e, o] of tt(t).entries()) {
555
+ const r = o.indexOf(n);
556
+ if (r >= 0) return { column: e, index: r };
557
+ }
558
+ return null;
559
+ }, Bt = (t, n, e) => {
560
+ switch (e) {
561
+ case "previous-column":
562
+ case "next-column": {
563
+ const o = n.column + (e === "previous-column" ? -1 : 1), r = t[o];
564
+ return r === void 0 ? null : { column: o, index: Math.min(n.index, r.length) };
565
+ }
566
+ case "up":
567
+ return n.index > 0 ? { column: n.column, index: n.index - 1 } : null;
568
+ case "down":
569
+ return n.index < t[n.column].length - 1 ? { column: n.column, index: n.index + 1 } : null;
570
+ default: {
571
+ const o = e;
572
+ throw new RangeError(`[@aiquants/drag-drop-panels] unknown panel move ${JSON.stringify(o)}; expected one of ${De.join(", ")}`);
573
+ }
574
+ }
575
+ }, Un = (t, n, e, o) => {
576
+ const r = t.filter(n), a = (m) => [...t.slice(0, m), e, ...t.slice(m)], i = r[o];
577
+ if (i !== void 0) return a(t.indexOf(i));
578
+ const d = r[o - 1];
579
+ return a(d !== void 0 ? t.indexOf(d) + 1 : t.length);
580
+ }, Xn = (t, n) => {
581
+ const e = Pe(t, n);
582
+ if (e === null) return [];
583
+ const o = tt(t);
584
+ return De.filter((r) => Bt(o, e, r) !== null);
585
+ }, Vn = (t, n, e) => {
586
+ if (!De.includes(e)) throw new RangeError(`[@aiquants/drag-drop-panels] unknown panel move ${JSON.stringify(e)}; expected one of ${De.join(", ")}`);
587
+ const o = Pe(t, n);
588
+ if (o === null) return null;
589
+ const r = Bt(tt(t), o, e);
590
+ if (r === null) return null;
591
+ const a = (m) => t.panelVisibility[m] === !0, i = Object.fromEntries(Object.entries(t.columnPanels).map(([m, w]) => [m, w.filter((b) => b !== n)])), d = t.columnKeys[r.column];
592
+ return i[d] = Un(i[d] ?? [], a, n, r.index), { columnPanels: i, from: o, place: r };
593
+ }, Zn = (t, n, e) => {
594
+ const o = (r, a) => (r[a] ?? []).filter((i) => i !== e);
595
+ for (const r of /* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(n)])) {
596
+ const a = o(t, r), i = o(n, r);
597
+ if (a.length !== i.length || a.some((d, m) => d !== i[m])) return !1;
598
+ }
599
+ return !0;
600
+ }, Ut = Object.freeze({
601
+ "previous-column": Object.freeze({ key: "ArrowLeft", aria: "Alt+Shift+ArrowLeft", text: "Alt+Shift+←" }),
602
+ "next-column": Object.freeze({ key: "ArrowRight", aria: "Alt+Shift+ArrowRight", text: "Alt+Shift+→" }),
603
+ up: Object.freeze({ key: "ArrowUp", aria: "Alt+Shift+ArrowUp", text: "Alt+Shift+↑" }),
604
+ down: Object.freeze({ key: "ArrowDown", aria: "Alt+Shift+ArrowDown", text: "Alt+Shift+↓" })
605
+ }), Gn = (t) => {
606
+ if (!(t.altKey && t.shiftKey) || t.ctrlKey || t.metaKey) return null;
607
+ const n = De.find((e) => Ut[e].key === t.key);
608
+ return n === void 0 ? null : n;
609
+ }, Xt = qt.memo(({ index: t, columnIndex: n, isDragging: e, dragOverPosition: o, originalPosition: r, onDragEnter: a, onDragLeave: i, config: d, customDrag: m, label: w }) => {
610
+ const b = r !== null && et(r, n, t), A = !b && o?.columnIndex === n && o?.insertIndex === t, q = I(null), [j, E] = se(null), C = e || (m?.isActive ?? !1), T = b || !C ? "hidden" : A ? "target" : "shown";
611
+ return oe(() => {
612
+ if (q.current) {
613
+ const h = q.current.getBoundingClientRect(), P = {
614
+ width: Math.round(h.width),
615
+ height: Math.round(h.height),
616
+ x: Math.round(h.left),
617
+ y: Math.round(h.top)
535
618
  };
536
- y(k), b && E(c, 1, `🎯 アクティブプレースホルダー ${r}-${e}:`, {
537
- size: `${k.width}×${k.height}`,
538
- position: `(${k.x}, ${k.y})`,
539
- bottomRight: `(${k.x + k.width}, ${k.y + k.height})`,
540
- center: `(${k.x + k.width / 2}, ${k.y + k.height / 2})`
619
+ E(P), A && M(d, 1, `🎯 アクティブプレースホルダー ${t}-${n}:`, {
620
+ size: `${P.width}×${P.height}`,
621
+ position: `(${P.x}, ${P.y})`,
622
+ bottomRight: `(${P.x + P.width}, ${P.y + P.height})`,
623
+ center: `(${P.x + P.width / 2}, ${P.y + P.height / 2})`
541
624
  });
542
625
  }
543
- }, [b, r, e, c]), E(c, 2, `プレースホルダー${r}-${e}: 表示中`, { isHighlighted: b, isDragging: n, dragOverPosition: s, shouldShow: l }), // biome-ignore lint/a11y/noStaticElementInteractions: ドラッグイベントを処理するための対話的な要素。デバッグ目的のため、キーボード操作は必須ではない。
544
- /* @__PURE__ */ t.jsxs(
626
+ }, [A, t, n, d]), M(d, 2, `プレースホルダー${t}-${n}: 表示中`, { isHighlighted: A, isDragging: e, dragOverPosition: o, shouldShow: C }), // biome-ignore lint/a11y/noStaticElementInteractions: ドラッグイベントを処理するための対話的な要素。デバッグ目的のため、キーボード操作は必須ではない。
627
+ /* @__PURE__ */ s.jsxs(
545
628
  "div",
546
629
  {
547
- ref: M,
548
- "data-placeholder-index": r,
549
- "data-placeholder-column": e,
550
- onDragEnter: () => i(e, r),
551
- onDragLeave: (j) => u(j, e, r),
552
- className: `relative flex w-full items-center justify-center transition-all duration-0 ${N ? "pointer-events-none h-0 overflow-hidden opacity-0" : l ? b ? "my-2 scale-[1.02] rounded-xl border-4 border-sky-500 border-dashed bg-sky-200 px-4 py-6 shadow-lg ring-2 ring-sky-400 ring-opacity-50" : "my-2 rounded-xl border-2 border-sky-300 border-dashed bg-sky-50/70 px-2 py-4 opacity-80" : "pointer-events-none h-0 overflow-hidden opacity-0"}`,
630
+ ref: q,
631
+ "data-placeholder-index": t,
632
+ "data-placeholder-column": n,
633
+ "data-aqdd-drop-placeholder": T,
634
+ onDragEnter: () => a(n, t),
635
+ onDragLeave: (h) => i(h, n, t),
636
+ className: `relative flex w-full items-center justify-center ${T === "hidden" ? "pointer-events-none h-0 overflow-hidden opacity-0" : T === "target" ? "my-2 scale-[1.02] rounded-xl border-4 border-dashed px-4 py-6 shadow-lg" : "my-2 rounded-xl border-2 border-dashed px-2 py-4"}`,
553
637
  children: [
554
- !N && l && c.showPlaceholderInfo && T && /* @__PURE__ */ t.jsxs("div", { className: "absolute top-1 right-1 z-10 rounded-md bg-blue-500/90 px-2 py-1 font-mono text-white text-xs leading-tight shadow-lg", children: [
555
- /* @__PURE__ */ t.jsxs("div", { children: [
556
- T.width,
638
+ !b && C && d.showPlaceholderInfo && j && /* @__PURE__ */ s.jsxs("div", { className: "absolute top-1 right-1 z-10 rounded-md bg-blue-500/90 px-2 py-1 font-mono text-white text-xs leading-tight shadow-lg", children: [
639
+ /* @__PURE__ */ s.jsxs("div", { children: [
640
+ j.width,
557
641
  "×",
558
- T.height
642
+ j.height
559
643
  ] }),
560
- /* @__PURE__ */ t.jsxs("div", { children: [
644
+ /* @__PURE__ */ s.jsxs("div", { children: [
561
645
  "X:",
562
- T.x,
646
+ j.x,
563
647
  " Y:",
564
- T.y
648
+ j.y
565
649
  ] }),
566
- /* @__PURE__ */ t.jsx("div", { className: "text-[10px] opacity-80", children: "min:200px max:500px" }),
567
- /* @__PURE__ */ t.jsxs("div", { className: "mt-0.5 text-[10px] opacity-80", children: [
650
+ /* @__PURE__ */ s.jsx("div", { className: "text-[10px] opacity-80", children: "min:200px max:500px" }),
651
+ /* @__PURE__ */ s.jsxs("div", { className: "mt-0.5 text-[10px] opacity-80", children: [
568
652
  "PH-",
569
- e,
653
+ n,
570
654
  "-",
571
- r,
655
+ t,
572
656
  " ",
573
- b ? "ACTIVE" : "IDLE"
657
+ A ? "ACTIVE" : "IDLE"
574
658
  ] })
575
659
  ] }),
576
- !N && l && /* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-2 text-sky-600", children: [
577
- /* @__PURE__ */ t.jsxs("svg", { className: "h-6 w-6", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [
578
- /* @__PURE__ */ t.jsx("title", { children: "パネルをここにドロップ" }),
579
- /* @__PURE__ */ t.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 6v6m0 0v6m0-6h6m-6 0H6" })
580
- ] }),
581
- /* @__PURE__ */ t.jsx("span", { className: "font-medium text-sm", children: "パネルをここにドロップ" })
660
+ !b && C && /* @__PURE__ */ s.jsxs("div", { className: "flex items-center space-x-2", children: [
661
+ /* @__PURE__ */ s.jsx("svg", { className: "h-6 w-6", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ s.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 6v6m0 0v6m0-6h6m-6 0H6" }) }),
662
+ /* @__PURE__ */ s.jsx("span", { lang: w.lang, className: "font-medium text-sm", children: w.text })
582
663
  ] })
583
664
  ]
584
665
  }
585
666
  );
586
667
  });
587
- Ze.displayName = "InsertPlaceholder";
588
- const Ge = ({ columnIndex: r, isDragging: e, dragOverPosition: n, children: s, config: o }) => {
589
- const i = F(null), [u, c] = te(null);
590
- return K(() => {
591
- if (i.current && e) {
592
- const h = i.current.getBoundingClientRect(), N = n?.columnIndex === r, b = {
593
- width: Math.round(h.width),
594
- height: Math.round(h.height),
595
- x: Math.round(h.left),
596
- y: Math.round(h.top),
597
- isActive: N
668
+ Xt.displayName = "InsertPlaceholder";
669
+ const Vt = ({ columnIndex: t, isDragging: n, dragOverPosition: e, children: o, config: r }) => {
670
+ const a = I(null), [i, d] = se(null);
671
+ return oe(() => {
672
+ if (a.current && n) {
673
+ const m = a.current.getBoundingClientRect(), w = e?.columnIndex === t, b = {
674
+ width: Math.round(m.width),
675
+ height: Math.round(m.height),
676
+ x: Math.round(m.left),
677
+ y: Math.round(m.top),
678
+ isActive: w
598
679
  };
599
- c(b), N && E(o, 1, `🎯 アクティブドロップゾーン ${r}:`, {
680
+ d(b), w && M(r, 1, `🎯 アクティブドロップゾーン ${t}:`, {
600
681
  size: `${b.width}×${b.height}`,
601
682
  position: `(${b.x}, ${b.y})`,
602
683
  bottomRight: `(${b.x + b.width}, ${b.y + b.height})`,
603
684
  center: `(${b.x + b.width / 2}, ${b.y + b.height / 2})`
604
685
  });
605
686
  }
606
- }, [e, n, r, o]), /* @__PURE__ */ t.jsxs("div", { ref: i, className: "relative", children: [
607
- s,
608
- e && u && o.showDropZoneOutlines && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
609
- /* @__PURE__ */ t.jsx("div", { className: `pointer-events-none absolute inset-0 rounded-lg border-2 border-dashed transition-all duration-200 ${u.isActive ? "border-red-500 bg-red-100/20 shadow-lg" : "border-gray-400 bg-gray-100/10"}` }),
610
- /* @__PURE__ */ t.jsxs("div", { className: `absolute top-2 left-2 z-20 rounded-md px-2 py-1 font-mono text-xs leading-tight shadow-lg transition-all duration-200 ${u.isActive ? "bg-red-500/90 text-white" : "bg-gray-500/90 text-white"}`, children: [
611
- /* @__PURE__ */ t.jsxs("div", { className: "font-bold", children: [
687
+ }, [n, e, t, r]), /* @__PURE__ */ s.jsxs("div", { ref: a, className: "relative", children: [
688
+ o,
689
+ n && i && r.showDropZoneOutlines && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
690
+ /* @__PURE__ */ s.jsx("div", { className: `pointer-events-none absolute inset-0 rounded-lg border-2 border-dashed transition-all duration-200 ${i.isActive ? "border-red-500 bg-red-100/20 shadow-lg" : "border-gray-400 bg-gray-100/10"}` }),
691
+ /* @__PURE__ */ s.jsxs("div", { className: `absolute top-2 left-2 z-20 rounded-md px-2 py-1 font-mono text-xs leading-tight shadow-lg transition-all duration-200 ${i.isActive ? "bg-red-500/90 text-white" : "bg-gray-500/90 text-white"}`, children: [
692
+ /* @__PURE__ */ s.jsxs("div", { className: "font-bold", children: [
612
693
  "DropZone-",
613
- r
694
+ t
614
695
  ] }),
615
- /* @__PURE__ */ t.jsxs("div", { children: [
616
- u.width,
696
+ /* @__PURE__ */ s.jsxs("div", { children: [
697
+ i.width,
617
698
  "×",
618
- u.height
699
+ i.height
619
700
  ] }),
620
- /* @__PURE__ */ t.jsxs("div", { children: [
701
+ /* @__PURE__ */ s.jsxs("div", { children: [
621
702
  "X:",
622
- u.x,
703
+ i.x,
623
704
  " Y:",
624
- u.y
705
+ i.y
625
706
  ] }),
626
- /* @__PURE__ */ t.jsx("div", { className: "mt-0.5 text-[10px] opacity-80", children: u.isActive ? "ACTIVE" : "IDLE" })
707
+ /* @__PURE__ */ s.jsx("div", { className: "mt-0.5 text-[10px] opacity-80", children: i.isActive ? "ACTIVE" : "IDLE" })
627
708
  ] }),
628
- /* @__PURE__ */ t.jsx(
709
+ /* @__PURE__ */ s.jsx(
629
710
  "div",
630
711
  {
631
- className: `pointer-events-none absolute transition-all duration-200 ${u.isActive ? "opacity-100" : "opacity-50"}`,
712
+ className: `pointer-events-none absolute transition-all duration-200 ${i.isActive ? "opacity-100" : "opacity-50"}`,
632
713
  style: {
633
- left: `${u.width / 2 - 6}px`,
634
- top: `${u.height / 2 - 6}px`
714
+ left: `${i.width / 2 - 6}px`,
715
+ top: `${i.height / 2 - 6}px`
635
716
  },
636
- children: /* @__PURE__ */ t.jsx("div", { className: `h-3 w-3 rounded-full border-2 ${u.isActive ? "border-red-700 bg-red-500" : "border-gray-700 bg-gray-500"}` })
717
+ children: /* @__PURE__ */ s.jsx("div", { className: `h-3 w-3 rounded-full border-2 ${i.isActive ? "border-red-700 bg-red-500" : "border-gray-700 bg-gray-500"}` })
637
718
  }
638
719
  ),
639
- u.isActive && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
640
- /* @__PURE__ */ t.jsx("div", { className: "pointer-events-none absolute top-0 left-0 h-2 w-2 rounded-full bg-red-500" }),
641
- /* @__PURE__ */ t.jsx("div", { className: "pointer-events-none absolute top-0 right-0 h-2 w-2 rounded-full bg-red-500" }),
642
- /* @__PURE__ */ t.jsx("div", { className: "pointer-events-none absolute bottom-0 left-0 h-2 w-2 rounded-full bg-red-500" }),
643
- /* @__PURE__ */ t.jsx("div", { className: "pointer-events-none absolute right-0 bottom-0 h-2 w-2 rounded-full bg-red-500" })
720
+ i.isActive && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
721
+ /* @__PURE__ */ s.jsx("div", { className: "pointer-events-none absolute top-0 left-0 h-2 w-2 rounded-full bg-red-500" }),
722
+ /* @__PURE__ */ s.jsx("div", { className: "pointer-events-none absolute top-0 right-0 h-2 w-2 rounded-full bg-red-500" }),
723
+ /* @__PURE__ */ s.jsx("div", { className: "pointer-events-none absolute bottom-0 left-0 h-2 w-2 rounded-full bg-red-500" }),
724
+ /* @__PURE__ */ s.jsx("div", { className: "pointer-events-none absolute right-0 bottom-0 h-2 w-2 rounded-full bg-red-500" })
644
725
  ] })
645
726
  ] })
646
727
  ] });
647
728
  };
648
- Ge.displayName = "DropZoneDebugOverlay";
649
- const Et = 0.25, St = typeof window < "u" ? Se : K, Ct = (r, e = Et) => {
650
- const n = F(null), [s, o] = te(1);
651
- return St(() => {
652
- const i = n.current;
653
- if (!i || r <= 0) {
654
- o(1);
729
+ Vt.displayName = "DropZoneDebugOverlay";
730
+ const Zt = "[data-aqdd-scroll-root]", Ee = "data-aqdd-panel-action", Kn = 0.25, Jn = typeof window < "u" ? we : oe, Qn = (t, n = Kn) => {
731
+ const e = I(null), [o, r] = se(1);
732
+ return Jn(() => {
733
+ const a = e.current;
734
+ if (!a || t <= 0) {
735
+ r(1);
655
736
  return;
656
737
  }
657
- const u = () => {
658
- const h = i.clientWidth;
659
- if (h <= 0)
738
+ const i = () => {
739
+ const m = a.clientWidth;
740
+ if (m <= 0)
660
741
  return;
661
- const N = h >= r ? 1 : Math.max(h / r, e);
662
- o((b) => Math.abs(b - N) < 5e-3 ? b : N);
742
+ const w = m >= t ? 1 : Math.max(m / t, n);
743
+ r((b) => Math.abs(b - w) < 5e-3 ? b : w);
663
744
  };
664
- u();
665
- const c = new ResizeObserver(u);
666
- return c.observe(i), () => c.disconnect();
667
- }, [r, e]), { containerRef: n, scale: s };
668
- }, Je = ({ columnId: r, onResizeStart: e, onResize: n, onResizeEnd: s, isResizing: o = !1, position: i = "right", className: u = "", debug: c = {} }) => {
669
- const h = F(!1), N = F(null);
670
- K(() => {
671
- !o && h.current && (E(c, 1, "外部からのリサイズ解除を検出、ドラッグ状態を強制解除:", r), h.current = !1, document.body.style.cursor = "", document.body.style.userSelect = "", document.body.classList.remove("resizing-column"));
672
- }, [o, r, c]);
673
- const b = w(
674
- (y) => {
675
- y.preventDefault(), y.stopPropagation(), E(c, 2, "リサイズハンドル マウスダウン:", r), h.current = !0, e(r, y.clientX), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.body.classList.add("resizing-column");
676
- },
677
- [r, e, c]
678
- );
679
- K(() => {
680
- const y = (j) => {
681
- h.current && (j.preventDefault(), n(j.clientX));
682
- }, l = () => {
683
- h.current && (E(c, 2, "リサイズハンドル マウスアップ:", r), h.current = !1, s(), document.body.style.cursor = "", document.body.style.userSelect = "", document.body.classList.remove("resizing-column"));
684
- };
685
- return document.addEventListener("mousemove", y), document.addEventListener("mouseup", l), () => {
686
- document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", l);
687
- };
688
- }, [r, n, s, c]);
689
- const M = w(
690
- (y) => {
691
- y.preventDefault(), y.stopPropagation();
692
- const l = y.touches[0];
693
- E(c, 2, "リサイズハンドル タッチスタート:", r), h.current = !0, e(r, l.clientX), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.body.classList.add("resizing-column");
694
- },
695
- [r, e, c]
696
- );
697
- K(() => {
698
- const y = (j) => {
699
- if (!h.current) return;
700
- j.preventDefault();
701
- const k = j.touches[0];
702
- n(k.clientX);
703
- }, l = () => {
704
- h.current && (E(c, 2, "リサイズハンドル タッチエンド:", r), h.current = !1, s(), document.body.style.cursor = "", document.body.style.userSelect = "", document.body.classList.remove("resizing-column"));
745
+ i();
746
+ const d = new ResizeObserver(i);
747
+ return d.observe(a), () => d.disconnect();
748
+ }, [t, n]), { containerRef: e, scale: o };
749
+ }, er = Object.freeze([
750
+ "--aqdd-panel-surface",
751
+ "--aqdd-panel-border",
752
+ "--aqdd-panel-title-color",
753
+ "--aqdd-header-button-color",
754
+ "--aqdd-header-button-hover-color",
755
+ "--aqdd-header-button-hover-surface",
756
+ "--aqdd-custom-badge-color",
757
+ "--aqdd-custom-badge-surface",
758
+ "--aqdd-default-panel-surface",
759
+ "--aqdd-default-panel-border",
760
+ "--aqdd-default-panel-title-color",
761
+ "--aqdd-default-header-button-color",
762
+ "--aqdd-default-header-button-hover-color",
763
+ "--aqdd-default-header-button-hover-surface",
764
+ "--aqdd-default-header-close-hover-color",
765
+ "--aqdd-default-custom-badge-color",
766
+ "--aqdd-default-custom-badge-surface"
767
+ ]), Gt = (t, n) => {
768
+ const e = window.getComputedStyle(t);
769
+ for (const o of er) {
770
+ const r = e.getPropertyValue(o).trim();
771
+ r !== "" && n.style.setProperty(o, r);
772
+ }
773
+ }, Kt = (t, n, e) => {
774
+ const o = t.getBoundingClientRect(), r = t.cloneNode(!0);
775
+ return r.removeAttribute("data-panel-id"), Gt(t, r), r.style.position = "fixed", r.style.top = "0px", r.style.left = "0px", r.style.width = `${t.offsetWidth}px`, r.style.height = `${t.offsetHeight}px`, r.style.pointerEvents = "none", r.style.zIndex = "1000", r.style.opacity = "0.5", r.style.margin = "0", r.style.transition = "none", r.style.boxShadow = "0 8px 32px rgba(0,0,0,0.3)", r.style.transformOrigin = "top left", r.style.transform = `translate(${o.left}px, ${o.top}px) scale(${e})`, r.id = `drag-image-${n}`, document.body.appendChild(r), r;
776
+ }, Jt = (t, n, e, o, r) => {
777
+ t.style.transform = `translate(${n - o.x}px, ${e - o.y}px) scale(${r * 1.05})`;
778
+ }, tr = (t, n) => {
779
+ let e = n.closest("[data-drop-zone]");
780
+ for (; e !== null && e.closest("[data-aqdd-layout]") !== t; ) {
781
+ const o = e.parentElement;
782
+ e = o === null ? null : o.closest("[data-drop-zone]");
783
+ }
784
+ return e;
785
+ }, nr = (t, n, e) => {
786
+ const o = document.elementFromPoint(n, e), r = o === null ? null : tr(t, o);
787
+ if (r === null) return null;
788
+ let a = null;
789
+ for (const i of r.querySelectorAll("[data-placeholder-index]")) {
790
+ if (i.closest("[data-drop-zone]") !== r) continue;
791
+ const { top: d, bottom: m } = i.getBoundingClientRect(), w = e < d ? d - e : e > m ? e - m : 0;
792
+ (a === null || w < a.distance) && (a = { insertIndex: Number(i.getAttribute("data-placeholder-index")), distance: w });
793
+ }
794
+ return a === null ? null : { columnIndex: Number(r.getAttribute("data-column-index")), insertIndex: a.insertIndex };
795
+ }, Me = {
796
+ triggerDistance: 80,
797
+ scrollSpeed: 5,
798
+ maxScrollSpeed: 20
799
+ }, nt = () => {
800
+ const t = window.visualViewport;
801
+ return t ? new DOMRect(t.offsetLeft, t.offsetTop, t.width, t.height) : new DOMRect(0, 0, window.innerWidth, window.innerHeight);
802
+ }, rr = (t) => {
803
+ const n = t.getBoundingClientRect(), e = nt(), o = Math.max(n.left, e.left), r = Math.max(n.top, e.top), a = Math.min(n.right, e.right), i = Math.min(n.bottom, e.bottom);
804
+ return a > o && i > r ? new DOMRect(o, r, a - o, i - r) : null;
805
+ }, Mt = (t, n, e = Me, o) => {
806
+ const { triggerDistance: r, scrollSpeed: a, maxScrollSpeed: i } = e, d = o === void 0 ? nt() : rr(o);
807
+ if (d === null) return { x: 0, y: 0 };
808
+ const { left: m, top: w, right: b, bottom: A } = d;
809
+ let q = 0, j = 0;
810
+ if (t >= m && t <= b && n >= w && n <= A) {
811
+ if (t < m + r) {
812
+ const E = Math.max(0, (m + r - t) / r);
813
+ q = -Math.min(i, a + E * (i - a));
814
+ } else if (t > b - r) {
815
+ const E = Math.max(0, (t - (b - r)) / r);
816
+ q = Math.min(i, a + E * (i - a));
817
+ }
818
+ if (n < w + r) {
819
+ const E = Math.max(0, (w + r - n) / r);
820
+ j = -Math.min(i, a + E * (i - a));
821
+ } else if (n > A - r) {
822
+ const E = Math.max(0, (n - (A - r)) / r);
823
+ j = Math.min(i, a + E * (i - a));
824
+ }
825
+ }
826
+ return { x: q, y: j };
827
+ }, or = (t, n) => {
828
+ if (t === document.documentElement) return !1;
829
+ if (t === document.body) {
830
+ const r = window.getComputedStyle(document.documentElement);
831
+ if (r.overflowX === "visible" && r.overflowY === "visible") return !1;
832
+ }
833
+ const e = window.getComputedStyle(t), o = n === "x" ? e.overflowX : e.overflowY;
834
+ return o === "auto" || o === "scroll";
835
+ }, sr = (t, n, e, o) => e === "x" ? o > 0 ? t.right - n.right : n.left - t.left : o > 0 ? t.bottom - n.bottom : n.top - t.top, Qt = (t, n, e) => {
836
+ const o = n === "x" ? t.scrollLeft : t.scrollTop;
837
+ return t.scrollBy(n === "x" ? { left: e, behavior: "instant" } : { top: e, behavior: "instant" }), (n === "x" ? t.scrollLeft : t.scrollTop) !== o;
838
+ }, At = (t, n, e, o, r) => {
839
+ const a = sr(e, n, o, r);
840
+ return a > 0 && Qt(t, o, Math.sign(r) * Math.min(Math.abs(r), a));
841
+ }, $t = (t, n, e) => {
842
+ if (Qt(t, n, e)) return;
843
+ const o = t.getBoundingClientRect();
844
+ for (let a = t.parentElement; a !== null; a = a.parentElement)
845
+ if (or(a, n) && At(a, a.getBoundingClientRect(), o, n, e)) return;
846
+ const r = document.scrollingElement;
847
+ r instanceof Element && r !== t && At(r, nt(), o, n, e);
848
+ }, ar = (t, n) => {
849
+ if (n === void 0) {
850
+ (t.x !== 0 || t.y !== 0) && window.scrollBy(t.x, t.y);
851
+ return;
852
+ }
853
+ t.x !== 0 && $t(n, "x", t.x), t.y !== 0 && $t(n, "y", t.y);
854
+ };
855
+ class rt {
856
+ /**
857
+ * Creates a manager for an element, or for the window without one.
858
+ * 要素 (無ければウインドウ) の管理役を作る。
859
+ *
860
+ * @param config - The edge bands and speeds. 端の帯と速さ。
861
+ * @param scrollElement - The element to scroll. スクロールする要素。
862
+ */
863
+ constructor(n = Me, e) {
864
+ this.intervalId = null, this.isActive = !1, this.pointX = 0, this.pointY = 0, this.config = n, this.scrollElement = e;
865
+ }
866
+ /**
867
+ * Sets the element to scroll (the window without one).
868
+ * スクロールする要素を設定する (無ければウインドウ)。
869
+ *
870
+ * @param element - The element. 要素。
871
+ */
872
+ setScrollElement(n) {
873
+ this.scrollElement = n;
874
+ }
875
+ /**
876
+ * Starts scrolling for a pointer at a point; while it runs, it only moves the point.
877
+ * ある点のポインタのスクロールを始める (動いている間は点だけを移す)。
878
+ *
879
+ * @param clientX - The pointer's viewport x. ポインタのビューポートの x。
880
+ * @param clientY - The pointer's viewport y. ポインタのビューポートの y。
881
+ */
882
+ start(n, e) {
883
+ this.pointX = n, this.pointY = e, !this.isActive && (this.isActive = !0, this.intervalId = window.setInterval(() => {
884
+ const o = Mt(this.pointX, this.pointY, this.config, this.scrollElement);
885
+ ar(o, this.scrollElement);
886
+ }, 16));
887
+ }
888
+ /**
889
+ * Follows the pointer to a new point: starts scrolling when it enters an edge band, keeps scrolling toward its latest
890
+ * point while it stays in one, and stops when it leaves them.
891
+ * ポインタを新しい点へ追う処理 (端の帯へ入るとスクロールを始め、帯の中にいる間は最新の点へ向けて続け、帯を出ると止める)。
892
+ *
893
+ * @param clientX - The pointer's viewport x. ポインタのビューポートの x。
894
+ * @param clientY - The pointer's viewport y. ポインタのビューポートの y。
895
+ */
896
+ update(n, e) {
897
+ this.pointX = n, this.pointY = e;
898
+ const o = Mt(n, e, this.config, this.scrollElement);
899
+ (o.x !== 0 || o.y !== 0) && !this.isActive ? this.start(n, e) : o.x === 0 && o.y === 0 && this.isActive && this.stop();
900
+ }
901
+ /**
902
+ * Stops scrolling.
903
+ * スクロールを止める。
904
+ */
905
+ stop() {
906
+ this.intervalId !== null && (clearInterval(this.intervalId), this.intervalId = null), this.isActive = !1;
907
+ }
908
+ /**
909
+ * Whether it is scrolling now.
910
+ * 今スクロールしているか。
911
+ *
912
+ * @returns Whether a scroll runs. スクロールが動いているか。
913
+ */
914
+ isScrolling() {
915
+ return this.isActive;
916
+ }
917
+ /**
918
+ * Replaces the edge bands and speeds.
919
+ * 端の帯と速さを置き換える。
920
+ *
921
+ * @param newConfig - The edge bands and speeds. 端の帯と速さ。
922
+ */
923
+ updateConfig(n) {
924
+ this.config = n;
925
+ }
926
+ }
927
+ const Tt = "custom-dragging", lr = (t, n) => t === null ? n === null : n !== null && t.columnIndex === n.columnIndex && t.insertIndex === n.insertIndex, Rt = (t, n, e) => {
928
+ const { left: o, top: r, right: a, bottom: i } = t.getBoundingClientRect();
929
+ return n < o || n > a || e < r || e > i;
930
+ }, ir = (t, n) => {
931
+ let e = null;
932
+ const o = (l) => {
933
+ const _ = t(), L = _.layoutRef.current;
934
+ if (L === null || Rt(L, l.x, l.y)) return null;
935
+ const B = nr(L, l.x, l.y), J = _.originOf(l.panelId);
936
+ return B === null || J === null || et(J, B.columnIndex, B.insertIndex) ? null : B;
937
+ }, r = () => {
938
+ if (e === null || e.phase !== "dragging") return;
939
+ const l = o(e);
940
+ n((_) => _ === null || lr(_.over, l) ? _ : { panelId: _.panelId, over: l });
941
+ }, a = (l) => {
942
+ if (e === null || l.pointerId !== e.pointerId) return;
943
+ if (e.x = l.clientX, e.y = l.clientY, e.phase === "pressing") {
944
+ Math.hypot(e.x - e.startX, e.y - e.startY) > t().config.slop && j();
945
+ return;
946
+ }
947
+ const _ = t(), L = _.layoutRef.current;
948
+ if (L === null || Rt(L, e.x, e.y)) {
949
+ E();
950
+ return;
951
+ }
952
+ Jt(e.image, e.x, e.y, e.offset, _.scale), e.edgeScroll.update(e.x, e.y), r();
953
+ }, i = (l) => {
954
+ if (e === null || l.pointerId !== e.pointerId) return;
955
+ if (e.phase === "pressing") {
956
+ j();
957
+ return;
958
+ }
959
+ e.x = l.clientX, e.y = l.clientY;
960
+ const _ = o(e), L = j();
961
+ if (L === null) return;
962
+ const B = t();
963
+ _ === null ? B.onCancel(L.panelId) : B.onDrop(L.panelId, _);
964
+ }, d = (l) => {
965
+ e !== null && l.pointerId === e.pointerId && E();
966
+ }, m = (l) => {
967
+ e !== null && e.phase === "pressing" && l.pointerId !== e.pointerId && j();
968
+ }, w = (l) => {
969
+ e !== null && e.phase === "dragging" && l.pointerId === e.pointerId && l.target === e.header && E();
970
+ }, b = (l) => {
971
+ e === null || e.phase !== "dragging" || l.key !== "Escape" || l.defaultPrevented || l.isComposing || (l.preventDefault(), E());
972
+ }, A = () => {
973
+ document.addEventListener("pointermove", a, !0), document.addEventListener("pointerup", i, !0), document.addEventListener("pointercancel", d, !0), document.addEventListener("pointerdown", m, !0), document.addEventListener("lostpointercapture", w, !0), document.addEventListener("keydown", b, !0);
974
+ }, q = () => {
975
+ document.removeEventListener("pointermove", a, !0), document.removeEventListener("pointerup", i, !0), document.removeEventListener("pointercancel", d, !0), document.removeEventListener("pointerdown", m, !0), document.removeEventListener("lostpointercapture", w, !0), document.removeEventListener("keydown", b, !0);
976
+ }, j = () => {
977
+ const l = e;
978
+ return l === null ? null : (e = null, q(), l.phase === "pressing" ? (window.clearTimeout(l.timer), l) : (document.removeEventListener("scroll", r, !0), l.edgeScroll.stop(), l.image.remove(), document.body.classList.remove(Tt), l.header.hasPointerCapture(l.pointerId) && l.header.releasePointerCapture(l.pointerId), n(null), l));
979
+ }, E = () => {
980
+ const l = j();
981
+ l !== null && l.phase === "dragging" && t().onCancel(l.panelId);
982
+ }, C = () => {
983
+ if (e === null || e.phase !== "pressing") return;
984
+ const l = e, _ = t(), L = _.panelElementOf(l.panelId), B = _.scrollRootRef.current;
985
+ if (!_.canStart || L === null || B === null || !l.header.isConnected) {
986
+ j();
987
+ return;
988
+ }
989
+ try {
990
+ l.header.setPointerCapture(l.pointerId);
991
+ } catch (x) {
992
+ if (x instanceof DOMException) {
993
+ j();
994
+ return;
995
+ }
996
+ throw x;
997
+ }
998
+ const { left: J, top: p } = L.getBoundingClientRect();
999
+ e = {
1000
+ phase: "dragging",
1001
+ pointerId: l.pointerId,
1002
+ panelId: l.panelId,
1003
+ header: l.header,
1004
+ image: Kt(L, l.panelId, _.scale),
1005
+ offset: { x: l.x - J, y: l.y - p },
1006
+ edgeScroll: new rt(Me, B),
1007
+ x: l.x,
1008
+ y: l.y
1009
+ }, document.addEventListener("scroll", r, { capture: !0, passive: !0 }), document.body.classList.add(Tt), n({ panelId: l.panelId, over: null }), _.onLift(l.panelId);
1010
+ };
1011
+ return { pressHeader: (l, _) => {
1012
+ if (e !== null || !l.isPrimary || l.button !== 0 || l.pointerType !== "touch" && l.pointerType !== "pen") return;
1013
+ const L = t();
1014
+ L.canStart && (l.target instanceof Element && l.target.closest(`[${Ee}]`) !== null || (e = {
1015
+ phase: "pressing",
1016
+ pointerId: l.pointerId,
1017
+ panelId: _,
1018
+ header: l.currentTarget,
1019
+ startX: l.clientX,
1020
+ startY: l.clientY,
1021
+ timer: window.setTimeout(C, L.config.longPressDelay),
1022
+ x: l.clientX,
1023
+ y: l.clientY
1024
+ }, A()));
1025
+ }, holdContextMenu: (l) => {
1026
+ e !== null && e.header === l.currentTarget && l.preventDefault();
1027
+ }, bindHeader: (l) => {
1028
+ if (l === null) return;
1029
+ const _ = (L) => {
1030
+ e !== null && e.phase === "dragging" && e.header === l && L.cancelable && L.preventDefault();
705
1031
  };
706
- return document.addEventListener("touchmove", y, { passive: !1 }), document.addEventListener("touchend", l), () => {
707
- document.removeEventListener("touchmove", y), document.removeEventListener("touchend", l);
1032
+ return l.addEventListener("touchmove", _, { passive: !1 }), () => l.removeEventListener("touchmove", _);
1033
+ }, cancel: E, dispose: () => {
1034
+ j();
1035
+ } };
1036
+ }, cr = (t) => {
1037
+ const n = I(t);
1038
+ we(() => {
1039
+ n.current = t;
1040
+ });
1041
+ const [e, o] = se(null), [r] = se(() => ir(() => n.current, o));
1042
+ return oe(() => r.dispose, [r]), { touchDrag: e, pressHeader: r.pressHeader, holdContextMenu: r.holdContextMenu, bindHeader: r.bindHeader, cancel: r.cancel };
1043
+ }, Ie = Object.freeze({
1044
+ switchToCustomDragMode: { text: "カスタムドラッグモードに切り替え", lang: "ja" },
1045
+ switchToNormalDragMode: { text: "通常ドラッグモードに戻す", lang: "ja" },
1046
+ hidePanel: { text: "パネルを非表示", lang: "ja" },
1047
+ maximizePanel: { text: "パネルを最大化", lang: "ja" },
1048
+ restorePanel: { text: "元のサイズに戻す", lang: "ja" },
1049
+ closePanel: { text: "パネルを閉じる", lang: "ja" },
1050
+ movePanelToPreviousColumn: { text: "前の列へ移動", lang: "ja" },
1051
+ movePanelToNextColumn: { text: "次の列へ移動", lang: "ja" },
1052
+ movePanelUp: { text: "上へ移動", lang: "ja" },
1053
+ movePanelDown: { text: "下へ移動", lang: "ja" },
1054
+ customDragModeBadge: { text: "Custom", lang: "en" },
1055
+ panelMoved: { text: "{title} を {column} 列目の {position} 番目へ移動しました", lang: "ja" },
1056
+ panelMoveUnavailable: { text: "{title} は{move}できません", lang: "ja" },
1057
+ panelDragStarted: { text: "{title} を持ち上げました", lang: "ja" },
1058
+ panelDragCancelled: { text: "{title} の移動を取り消しました", lang: "ja" },
1059
+ hiddenPanels: { text: "非表示のパネル:", lang: "ja" },
1060
+ hiddenPanelBadge: { text: "非表示", lang: "ja" },
1061
+ hiddenPanelNotice: { text: "このパネルは非表示です", lang: "ja" },
1062
+ emptyColumn: { text: "このエリアは空です", lang: "ja" },
1063
+ dropZone: { text: "Drop zone for column {column}", lang: "en" },
1064
+ dropHere: { text: "パネルをここにドロップ", lang: "ja" },
1065
+ resizeColumn: { text: "{column} 列目のカラム幅を調整", lang: "ja" }
1066
+ }), _t = new Set(Object.keys(Ie)), ur = Object.freeze({
1067
+ panelMoved: Object.freeze(["title", "column", "position"]),
1068
+ panelMoveUnavailable: Object.freeze(["title", "move"]),
1069
+ panelDragStarted: Object.freeze(["title"]),
1070
+ panelDragCancelled: Object.freeze(["title"]),
1071
+ dropZone: Object.freeze(["column"]),
1072
+ resizeColumn: Object.freeze(["column"])
1073
+ }), en = /\{(\w+)\}/g, Fr = Object.freeze(Object.fromEntries(Object.entries(Ie).map(([t, n]) => [t, n.text]))), dr = (t) => {
1074
+ if (t !== void 0) {
1075
+ const e = t;
1076
+ if (e === null || typeof e != "object")
1077
+ throw new TypeError(`[@aiquants/drag-drop-panels] labels must be an object; got ${e === null ? "null" : typeof e}`);
1078
+ for (const o of Object.keys(e))
1079
+ if (!_t.has(o))
1080
+ throw new RangeError(`[@aiquants/drag-drop-panels] labels has the unknown key "${o}"; the labels are ${[..._t].join(", ")}`);
1081
+ }
1082
+ const n = {};
1083
+ for (const e of Object.keys(Ie)) {
1084
+ const o = t?.[e];
1085
+ if (o === void 0) {
1086
+ n[e] = Ie[e];
1087
+ continue;
1088
+ }
1089
+ if (typeof o != "string")
1090
+ throw new TypeError(`[@aiquants/drag-drop-panels] label "${e}" must be a string; got ${o === null ? "null" : typeof o}`);
1091
+ const r = ur[e];
1092
+ if (r !== void 0) {
1093
+ for (const [, a] of o.matchAll(en))
1094
+ if (!r.includes(a))
1095
+ throw new RangeError(`[@aiquants/drag-drop-panels] label "${e}" uses the unknown placeholder {${a}}; it accepts ${r.map((i) => `{${i}}`).join(", ")}`);
1096
+ }
1097
+ n[e] = { text: o, lang: void 0 };
1098
+ }
1099
+ return Object.freeze(n);
1100
+ }, ze = (t, n) => {
1101
+ const e = [], o = (r, a) => {
1102
+ if (r === "") return;
1103
+ const i = e[e.length - 1];
1104
+ if (i !== void 0 && i.lang === a) {
1105
+ e[e.length - 1] = { text: `${i.text}${r}`, lang: a };
1106
+ return;
1107
+ }
1108
+ e.push({ text: r, lang: a });
1109
+ };
1110
+ for (const [r, a] of t.text.split(en).entries()) {
1111
+ if (r % 2 === 0) {
1112
+ o(a, t.lang);
1113
+ continue;
1114
+ }
1115
+ const i = n[a];
1116
+ if (i === void 0) throw new RangeError(`[@aiquants/drag-drop-panels] no value for the placeholder {${a}} of "${t.text}"`);
1117
+ typeof i == "number" ? o(String(i), t.lang) : o(i.text, i.lang);
1118
+ }
1119
+ return e;
1120
+ }, Lt = (t, n) => ({
1121
+ text: ze(t, n).map((e) => e.text).join(""),
1122
+ lang: t.lang
1123
+ }), hr = 229, mr = /* @__PURE__ */ new Set(["", "auto", "hint"]), fr = (t) => {
1124
+ for (const n of t.querySelectorAll("[popover]")) {
1125
+ const e = n.getAttribute("popover");
1126
+ if (e !== null && mr.has(e.toLowerCase()) && n.matches(":popover-open")) return !0;
1127
+ }
1128
+ return !1;
1129
+ }, pr = (t) => t.key !== "Escape" || t.defaultPrevented || t.isComposing || t.keyCode === hr || t.target instanceof Element && t.target.closest("dialog[open]") !== null ? !1 : !("popover" in HTMLElement.prototype && fr(document)), gr = "resizing-column", zt = (t) => {
1130
+ document.body.style.cursor = t ? "col-resize" : "", document.body.style.userSelect = t ? "none" : "", document.body.classList.toggle(gr, t);
1131
+ }, tn = ({ columnId: t, onResizeStart: n, onResize: e, onResizeEnd: o, isResizing: r = !1, position: a = "right", className: i = "", debug: d = {}, label: m }) => {
1132
+ const w = I({ columnId: t, onResize: e, onResizeEnd: o, debug: d });
1133
+ we(() => {
1134
+ w.current = { columnId: t, onResize: e, onResizeEnd: o, debug: d };
1135
+ });
1136
+ const b = I(null);
1137
+ oe(() => {
1138
+ r || b.current?.();
1139
+ }, [r]), oe(() => () => b.current?.(), []);
1140
+ const A = (j) => {
1141
+ if (b.current !== null || !j.isPrimary || j.button !== 0) return;
1142
+ const E = j.currentTarget, { pointerId: C } = j;
1143
+ try {
1144
+ E.setPointerCapture(C);
1145
+ } catch (l) {
1146
+ if (l instanceof DOMException) return;
1147
+ throw l;
1148
+ }
1149
+ j.preventDefault(), j.stopPropagation(), M(d, 2, "リサイズハンドル ポインタダウン:", t, j.pointerType);
1150
+ const T = (l) => {
1151
+ l.pointerId === C && w.current.onResize(l.clientX);
1152
+ }, h = (l) => {
1153
+ l.pointerId === C && N(!0);
1154
+ }, P = (l) => {
1155
+ l.pointerId === C && N(!0);
1156
+ }, N = (l) => {
1157
+ b.current = null, document.removeEventListener("pointermove", T, !0), document.removeEventListener("pointerup", h, !0), document.removeEventListener("pointercancel", h, !0), E.removeEventListener("lostpointercapture", P), E.hasPointerCapture(C) && E.releasePointerCapture(C), zt(!1), M(w.current.debug, l ? 2 : 1, l ? "リサイズハンドル 終了:" : "リサイズハンドル 中断:", w.current.columnId), l && w.current.onResizeEnd();
708
1158
  };
709
- }, [r, n, s, c]), K(() => () => {
710
- h.current && (E(c, 1, "リサイズハンドルアンマウント時のクリーンアップ:", r), document.body.style.cursor = "", document.body.style.userSelect = "", document.body.classList.remove("resizing-column"));
711
- }, [r, c]);
712
- const T = ["resize-handle", i, o ? "resizing" : "", u].filter(Boolean).join(" ");
1159
+ b.current = () => N(!1), document.addEventListener("pointermove", T, !0), document.addEventListener("pointerup", h, !0), document.addEventListener("pointercancel", h, !0), E.addEventListener("lostpointercapture", P), zt(!0), n(t, j.clientX);
1160
+ }, q = ["resize-handle", a, r ? "resizing" : "", i].filter(Boolean).join(" ");
713
1161
  return (
714
1162
  // biome-ignore lint/a11y/useFocusableInteractive: リサイズハンドルとして機能するためインタラクティブである必要がある
715
1163
  // biome-ignore lint/a11y/useSemanticElements: divを使用するが、aria-roleでセマンティックな意味を提供している
716
1164
  // biome-ignore lint/a11y/useAriaPropsForRole: リサイズハンドルのため、値の範囲を指定することが難しい
717
- /* @__PURE__ */ t.jsxs("div", { ref: N, className: T, onMouseDown: b, onTouchStart: M, "data-column-id": r, "data-position": i, "aria-label": `${r}のカラム幅を調整`, role: "separator", "aria-orientation": "vertical", children: [
718
- /* @__PURE__ */ t.jsx("div", { className: "resize-handle-bar" }),
719
- c.showPanelSizes && /* @__PURE__ */ t.jsxs("div", { className: "resize-handle-debug-info", children: [
720
- r,
721
- o && " (resizing)"
1165
+ /* @__PURE__ */ s.jsxs("div", { className: q, onPointerDown: A, "data-column-id": t, "data-position": a, "aria-label": m.text, lang: m.lang, role: "separator", "aria-orientation": "vertical", children: [
1166
+ /* @__PURE__ */ s.jsx("div", { className: "resize-handle-bar" }),
1167
+ d.showPanelSizes && /* @__PURE__ */ s.jsxs("div", { className: "resize-handle-debug-info", children: [
1168
+ t,
1169
+ r && " (resizing)"
722
1170
  ] })
723
1171
  ] })
724
1172
  );
725
- }, Gt = ({ columnId: r, width: e, minWidth: n = 100, maxWidth: s = 800, onResizeStart: o, onResize: i, onResizeEnd: u, isResizing: c = !1, resizable: h = !0, className: N = "", debug: b = {}, children: M }) => {
726
- const T = ["resizable-column", c ? "resizing" : "", N].filter(Boolean).join(" ");
727
- return K(() => {
728
- const y = document.querySelector(`[data-column-id="${r}"]`);
729
- y && (y.style.setProperty("--column-width", `${e}px`), y.style.setProperty("--column-min-width", `${n}px`), y.style.setProperty("--column-max-width", `${s}px`));
730
- }, [r, e, n, s]), /* @__PURE__ */ t.jsxs("div", { className: T, "data-column-id": r, "data-width": e, "data-min-width": n, "data-max-width": s, children: [
731
- M,
732
- h && /* @__PURE__ */ t.jsx(Je, { columnId: r, onResizeStart: o, onResize: i, onResizeEnd: u, isResizing: c, position: "right", debug: b }),
733
- b.showPanelSizes && /* @__PURE__ */ t.jsxs("div", { className: "column-debug-size", children: [
734
- e,
1173
+ }, Br = ({ columnId: t, width: n, minWidth: e = 100, maxWidth: o = 800, onResizeStart: r, onResize: a, onResizeEnd: i, isResizing: d = !1, resizable: m = !0, className: w = "", debug: b = {}, resizeHandleLabel: A, children: q }) => {
1174
+ const j = ["resizable-column", d ? "resizing" : "", w].filter(Boolean).join(" ");
1175
+ return oe(() => {
1176
+ const E = document.querySelector(`[data-column-id="${t}"]`);
1177
+ E && (E.style.setProperty("--column-width", `${n}px`), E.style.setProperty("--column-min-width", `${e}px`), E.style.setProperty("--column-max-width", `${o}px`));
1178
+ }, [t, n, e, o]), /* @__PURE__ */ s.jsxs("div", { className: j, "data-column-id": t, "data-width": n, "data-min-width": e, "data-max-width": o, children: [
1179
+ q,
1180
+ m && /* @__PURE__ */ s.jsx(tn, { columnId: t, onResizeStart: r, onResize: a, onResizeEnd: i, isResizing: d, position: "right", debug: b, label: A }),
1181
+ b.showPanelSizes && /* @__PURE__ */ s.jsxs("div", { className: "column-debug-size", children: [
1182
+ n,
735
1183
  "px",
736
- c && " ↔"
1184
+ d && " ↔"
737
1185
  ] })
738
1186
  ] });
739
- }, Me = st(
1187
+ }, xr = Object.freeze({ longPressDelay: 500, slop: 10 }), Ve = Object.freeze(["longPressDelay", "slop"]), vr = (t) => {
1188
+ const n = t;
1189
+ if (n === null || typeof n != "object")
1190
+ throw new TypeError(`[@aiquants/drag-drop-panels] touchDragConfig must be an object; got ${n === null ? "null" : typeof n}`);
1191
+ for (const e of Object.keys(n))
1192
+ if (!Ve.includes(e))
1193
+ throw new RangeError(`[@aiquants/drag-drop-panels] touchDragConfig has the unknown key "${e}"; the keys are ${Ve.join(", ")}`);
1194
+ for (const e of Ve) {
1195
+ const o = t[e];
1196
+ if (typeof o != "number")
1197
+ throw new TypeError(`[@aiquants/drag-drop-panels] touchDragConfig.${e} must be a number; got ${o === null ? "null" : typeof o}`);
1198
+ if (!Number.isFinite(o) || o < 0)
1199
+ throw new RangeError(`[@aiquants/drag-drop-panels] touchDragConfig.${e} must be a finite number of 0 or more; got ${o}`);
1200
+ }
1201
+ }, It = Object.freeze({
1202
+ "previous-column": "movePanelToPreviousColumn",
1203
+ "next-column": "movePanelToNextColumn",
1204
+ up: "movePanelUp",
1205
+ down: "movePanelDown"
1206
+ }), br = Object.freeze({ "previous-column": Cn, "next-column": On, up: Mn, down: Dn }), yr = 'input, textarea, select, [contenteditable]:not([contenteditable="false"])', Ze = (t, n) => ({ segments: n, serial: t === null ? 1 : t.serial + 1 }), wr = "​", jr = "(prefers-reduced-motion: reduce)", Pr = () => typeof window.matchMedia == "function" && window.matchMedia(jr).matches, Er = (t) => {
1207
+ t.key === "Enter" && t.repeat && t.preventDefault();
1208
+ }, Se = ({ action: t, label: n, tooltip: e, unavailable: o, keyShortcuts: r, onActivate: a, children: i }) => /* @__PURE__ */ s.jsx(
1209
+ "button",
1210
+ {
1211
+ type: "button",
1212
+ [Ee]: t,
1213
+ "aria-label": n.text,
1214
+ "aria-disabled": o ? !0 : void 0,
1215
+ "aria-keyshortcuts": r,
1216
+ title: e,
1217
+ lang: n.lang,
1218
+ className: "rounded p-1 motion-safe:transition-colors",
1219
+ onClick: (d) => {
1220
+ d.stopPropagation(), a();
1221
+ },
1222
+ children: i
1223
+ }
1224
+ ), Je = mn(
740
1225
  ({
741
- index: r,
742
- columnIndex: e,
743
- isDragging: n,
744
- dragOverPosition: s,
745
- originalPosition: o,
746
- onDragEnter: i,
747
- onDragLeave: u,
748
- debugConfig: c,
749
- customDrag: h
750
- }) => /* @__PURE__ */ t.jsx(Ze, { index: r, columnIndex: e, isDragging: n, dragOverPosition: s, originalPosition: o, onDragEnter: i, onDragLeave: u, config: c, customDrag: h })
1226
+ index: t,
1227
+ columnIndex: n,
1228
+ isDragging: e,
1229
+ dragOverPosition: o,
1230
+ originalPosition: r,
1231
+ onDragEnter: a,
1232
+ onDragLeave: i,
1233
+ debugConfig: d,
1234
+ customDrag: m,
1235
+ label: w
1236
+ }) => /* @__PURE__ */ s.jsx(Xt, { index: t, columnIndex: n, isDragging: e, dragOverPosition: o, originalPosition: r, onDragEnter: a, onDragLeave: i, config: d, customDrag: m, label: w })
751
1237
  );
752
- Me.displayName = "LocalInsertPlaceholder";
753
- const Jt = ({
754
- columns: r,
755
- panels: e,
756
- columnPanels: n,
757
- // onColumnPanelsChange,
758
- panelVisibility: s,
759
- onPanelVisibilityChange: o,
1238
+ Je.displayName = "LocalInsertPlaceholder";
1239
+ const Ur = ({
1240
+ columns: t,
1241
+ panels: n,
1242
+ columnPanels: e,
1243
+ onColumnPanelsChange: o,
1244
+ panelVisibility: r,
1245
+ onPanelVisibilityChange: a,
760
1246
  dragState: i,
761
- dragOverPosition: u,
762
- originalPanelPosition: c,
763
- dragModes: h,
764
- onDragStart: N,
765
- onDragEnd: b,
766
- onPlaceholderDragEnter: M,
767
- onPlaceholderDragLeave: T,
768
- onDragOverWithInsert: y,
769
- onDropWithInsert: l,
770
- onColumnDragLeave: j,
771
- onPanelClick: k,
772
- onPanelMouseDown: _,
773
- onTouchStart: R,
774
- onTouchMove: z,
775
- onTouchEnd: Z,
776
- debugConfig: Y,
777
- panelSizes: U,
778
- setPanelRef: $,
1247
+ dragOverPosition: d,
1248
+ originalPanelPosition: m,
1249
+ dragModes: w,
1250
+ onDragStart: b,
1251
+ onDragEnd: A,
1252
+ onPlaceholderDragEnter: q,
1253
+ onPlaceholderDragLeave: j,
1254
+ onDragOverWithInsert: E,
1255
+ onDropWithInsert: C,
1256
+ onColumnDragLeave: T,
1257
+ onPanelClick: h,
1258
+ onPanelMouseDown: P,
1259
+ debugConfig: N,
1260
+ panelSizes: l,
1261
+ setPanelRef: _,
779
1262
  enableResize: L = !1,
780
- columnWidths: f,
1263
+ columnWidths: B,
781
1264
  // onColumnWidthChange,
782
- onResizeStart: x,
783
- onResize: C,
784
- onResizeEnd: W,
785
- isResizing: p = !1,
786
- resizingColumn: g,
787
- onPanelSizeInfoClick: m,
788
- onToggleDragMode: v,
789
- onPanelClose: D,
790
- onPanelMaximizeChange: A,
791
- customDrag: O,
792
- dragHandle: H = "panel",
793
- maximizedPanel: a = null,
794
- panelClassName: d = "",
795
- scale: S,
796
- autoScale: X,
797
- onScaleChange: G
1265
+ onResizeStart: J,
1266
+ onResize: p,
1267
+ onResizeEnd: x,
1268
+ isResizing: $ = !1,
1269
+ resizingColumn: W,
1270
+ onPanelSizeInfoClick: v,
1271
+ onToggleDragMode: y,
1272
+ onPanelClose: g,
1273
+ onPanelMaximizeChange: D,
1274
+ customDrag: R,
1275
+ dragHandle: Y = "panel",
1276
+ maximizedPanel: F = null,
1277
+ panelClassName: X = "",
1278
+ scale: u,
1279
+ autoScale: f,
1280
+ onScaleChange: S,
1281
+ scrollRootElement: U = "div",
1282
+ labels: K,
1283
+ touchDragConfig: ae = xr
798
1284
  }) => {
799
- const Q = F(Y);
800
- K(() => {
801
- Q.current = Y;
802
- }, [Y]);
803
- const { containerRef: V, scale: re } = Ct(X?.requiredWidth ?? 0, X?.minScale), ce = a ? 1 : S ?? (X ? re : 1), se = Number.isFinite(ce) && ce > 0 ? ce : 1, ge = F(se);
804
- ge.current = se, K(() => {
805
- G && G(se);
806
- }, [se, G]);
807
- const et = se < 1 ? {
808
- width: `${100 / se}%`,
809
- height: `${100 / se}%`,
810
- transform: `scale(${se})`,
1285
+ if (U !== "div" && U !== "main")
1286
+ throw new RangeError(`[@aiquants/drag-drop-panels] scrollRootElement must be "div" or "main"; got ${JSON.stringify(U)}`);
1287
+ const G = U, H = Le(() => dr(K), [K]);
1288
+ vr(ae);
1289
+ const ve = fn(), ue = Le(() => {
1290
+ const c = {};
1291
+ return n.forEach((O) => {
1292
+ c[O.id] = O;
1293
+ }), c;
1294
+ }, [n]), pe = Le(
1295
+ () => ({
1296
+ columnKeys: t.map((c) => c.key),
1297
+ columnPanels: e,
1298
+ panelVisibility: Object.fromEntries(Object.keys(r).map((c) => [c, r[c] === !0 && ue[c] !== void 0]))
1299
+ }),
1300
+ [t, e, r, ue]
1301
+ ), ot = F === null ? null : Pe(pe, F), de = ot !== null, be = I(N);
1302
+ oe(() => {
1303
+ be.current = N;
1304
+ }, [N]);
1305
+ const { containerRef: rn, scale: on } = Qn(f?.requiredWidth ?? 0, f?.minScale), He = de ? 1 : u ?? (f ? on : 1), ge = Number.isFinite(He) && He > 0 ? He : 1, st = I(ge);
1306
+ st.current = ge, oe(() => {
1307
+ S && S(ge);
1308
+ }, [ge, S]);
1309
+ const sn = ge < 1 ? {
1310
+ width: `${100 / ge}%`,
1311
+ height: `${100 / ge}%`,
1312
+ transform: `scale(${ge})`,
811
1313
  transformOrigin: "top left"
812
- } : void 0, he = F({}), Ne = F(/* @__PURE__ */ new Map());
813
- K(() => {
814
- E(Q.current, 1, "🎨 DragDropLayout - dragModes props changed:", {
815
- dragModes: h,
1314
+ } : void 0, he = I({}), Ye = I(/* @__PURE__ */ new Map());
1315
+ oe(() => {
1316
+ M(be.current, 1, "🎨 DragDropLayout - dragModes props changed:", {
1317
+ dragModes: w,
816
1318
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
817
- keys: Object.keys(h),
818
- values: Object.values(h)
1319
+ keys: Object.keys(w),
1320
+ values: Object.values(w)
819
1321
  });
820
- }, [h]);
821
- const De = Ue(() => {
822
- const P = {};
823
- return e.forEach((B) => {
824
- P[B.id] = B;
825
- }), P;
826
- }, [e]);
827
- K(() => {
828
- if (!(a && A))
1322
+ }, [w]);
1323
+ const [Fe, Be] = se(null), Ae = I(null), at = I({ arrangement: pe, labels: H, panelComponentMap: ue });
1324
+ we(() => {
1325
+ at.current = { arrangement: pe, labels: H, panelComponentMap: ue };
1326
+ });
1327
+ const lt = I(null), it = I(null), an = k((c) => {
1328
+ it.current = c;
1329
+ }, []), ct = I(null), Ue = (c, O) => {
1330
+ const z = ue[O];
1331
+ if (z === void 0) return;
1332
+ const Q = ze(c, { title: { text: z.title, lang: void 0 } });
1333
+ Be((ee) => Ze(ee, Q));
1334
+ }, ut = (c, O, z, Q) => {
1335
+ const ee = he.current[c], ne = document.activeElement, re = ee instanceof HTMLElement && ne !== null && ee.contains(ne) ? ne.closest(`[${Ee}]`)?.getAttribute(Ee) ?? Q : null;
1336
+ Ae.current = { panelId: c, from: O, columnPanels: pe.columnPanels, focusAction: re }, o(z);
1337
+ }, dt = (c) => {
1338
+ for (const [O, z] of t.entries()) {
1339
+ const Q = (e[z.key] ?? []).indexOf(c);
1340
+ if (Q >= 0) return { columnIndex: O, panelIndex: Q };
1341
+ }
1342
+ return null;
1343
+ }, ln = (c, O) => {
1344
+ const z = Pe(pe, c), Q = t[O.columnIndex], ee = z === null || Q === void 0 ? null : Ft(e, c, Q.key, O.insertIndex);
1345
+ if (z === null || ee === null) {
1346
+ Ue(H.panelDragCancelled, c);
829
1347
  return;
830
- const P = (B) => {
831
- B.key === "Escape" && A(null);
1348
+ }
1349
+ ut(c, z, ee, null);
1350
+ }, ht = !(i.isDragging || R?.isActive === !0 || de), ke = cr({
1351
+ config: ae,
1352
+ layoutRef: lt,
1353
+ scrollRootRef: it,
1354
+ scale: ge,
1355
+ canStart: ht,
1356
+ panelElementOf: (c) => he.current[c] ?? null,
1357
+ originOf: dt,
1358
+ onLift: (c) => Ue(H.panelDragStarted, c),
1359
+ onDrop: ln,
1360
+ onCancel: (c) => Ue(H.panelDragCancelled, c)
1361
+ }), { touchDrag: ye } = ke, mt = ye !== null && (!ht || Pe(pe, ye.panelId) === null), ft = ke.cancel;
1362
+ oe(() => {
1363
+ mt && ft();
1364
+ }, [mt, ft]);
1365
+ const $e = i.isDragging || R?.isActive === !0 || ye !== null;
1366
+ we(() => {
1367
+ $e && (Ae.current = null);
1368
+ }, [$e]), we(() => {
1369
+ const c = Ae.current;
1370
+ if (c === null || (Ae.current = null, !Zn(c.columnPanels, e, c.panelId))) return;
1371
+ const O = at.current, z = Pe({ ...O.arrangement, columnPanels: e }, c.panelId);
1372
+ if (z === null || z.column === c.from.column && z.index === c.from.index) return;
1373
+ const Q = ze(O.labels.panelMoved, { title: { text: O.panelComponentMap[c.panelId].title, lang: void 0 }, column: z.column + 1, position: z.index + 1 });
1374
+ Be((te) => Ze(te, Q));
1375
+ const ee = he.current[c.panelId];
1376
+ if (c.focusAction === null || ee === null || ee === void 0) return;
1377
+ const { activeElement: ne, body: re } = document;
1378
+ if (ne === null || ne === re) {
1379
+ const te = ee.querySelector(`[${Ee}="${c.focusAction}"]`);
1380
+ te instanceof HTMLElement && te.focus({ preventScroll: !0 });
1381
+ }
1382
+ const V = document.activeElement;
1383
+ V instanceof HTMLElement && ee.contains(V) && V.scrollIntoView({ block: "nearest", inline: "nearest" });
1384
+ }, [e]), oe(() => {
1385
+ if (!(de && D))
1386
+ return;
1387
+ const c = (O) => {
1388
+ pr(O) && (O.preventDefault(), D(null));
832
1389
  };
833
- return document.addEventListener("keydown", P), () => document.removeEventListener("keydown", P);
834
- }, [a, A]), Se(() => {
835
- const P = /* @__PURE__ */ new Map();
836
- Object.keys(he.current).forEach((q) => {
837
- const ne = he.current[q];
838
- if (ne) {
839
- const de = ne.getBoundingClientRect();
840
- P.set(q, {
841
- rect: de,
842
- height: ne.offsetHeight,
843
- width: ne.offsetWidth
1390
+ return document.addEventListener("keydown", c), () => document.removeEventListener("keydown", c);
1391
+ }, [de, D]), we(() => {
1392
+ const c = /* @__PURE__ */ new Map();
1393
+ Object.keys(he.current).forEach((re) => {
1394
+ const V = he.current[re];
1395
+ if (V) {
1396
+ const te = V.getBoundingClientRect();
1397
+ c.set(re, {
1398
+ rect: te,
1399
+ height: V.offsetHeight,
1400
+ width: V.offsetWidth
844
1401
  });
845
1402
  }
846
1403
  });
847
- const B = Ne.current, ee = 300, me = /* @__PURE__ */ new Set();
848
- Object.values(n).forEach((q) => {
849
- q.forEach((ne) => {
850
- me.add(ne);
1404
+ const O = Ye.current, z = 300, Q = /* @__PURE__ */ new Set();
1405
+ Object.values(e).forEach((re) => {
1406
+ re.forEach((V) => {
1407
+ Q.add(V);
851
1408
  });
852
- }), new Set(B.keys()).forEach((q) => {
853
- me.has(q) || (E(Q.current, 1, "パネル削除検出 - クリーンアップ:", q), B.delete(q), he.current[q] && delete he.current[q]);
854
- }), P.forEach((q, ne) => {
855
- const de = B.get(ne);
856
- if (de) {
857
- const J = de.rect.left - q.rect.left, fe = de.rect.top - q.rect.top;
858
- if (J !== 0 || fe !== 0) {
859
- E(Q.current, 2, "パネル移動検出 - アニメーション開始:", ne, { dx: J, dy: fe });
860
- const ae = he.current[ne];
861
- if (ae) {
862
- const be = ge.current || 1;
863
- ae.style.transform = `translate(${J / be}px, ${fe / be}px)`, ae.style.transition = "none", ae.classList.add("is-moving"), requestAnimationFrame(() => {
864
- ae.style.transition = `transform ${ee}ms cubic-bezier(0.2, 0, 0.2, 1)`, ae.style.transform = "translate(0, 0)", setTimeout(() => {
865
- ae.style.transition = "", ae.style.transform = "", ae.classList.remove("is-moving");
866
- }, ee);
1409
+ }), new Set(O.keys()).forEach((re) => {
1410
+ Q.has(re) || (M(be.current, 1, "パネル削除検出 - クリーンアップ:", re), O.delete(re), he.current[re] && delete he.current[re]);
1411
+ });
1412
+ const ne = !Pr();
1413
+ c.forEach((re, V) => {
1414
+ if (!ne) return;
1415
+ const te = O.get(V);
1416
+ if (te) {
1417
+ const le = te.rect.left - re.rect.left, xe = te.rect.top - re.rect.top;
1418
+ if (le !== 0 || xe !== 0) {
1419
+ M(be.current, 2, "パネル移動検出 - アニメーション開始:", V, { dx: le, dy: xe });
1420
+ const ce = he.current[V];
1421
+ if (ce) {
1422
+ const Te = st.current || 1;
1423
+ ce.style.transform = `translate(${le / Te}px, ${xe / Te}px)`, ce.style.transition = "none", ce.classList.add("is-moving"), requestAnimationFrame(() => {
1424
+ ce.style.transition = `transform ${z}ms cubic-bezier(0.2, 0, 0.2, 1)`, ce.style.transform = "translate(0, 0)", setTimeout(() => {
1425
+ ce.style.transition = "", ce.style.transform = "", ce.classList.remove("is-moving");
1426
+ }, z);
867
1427
  });
868
1428
  }
869
1429
  }
870
1430
  } else {
871
- E(Q.current, 1, "新規パネル検出 - フェードインアニメーション:", ne);
872
- const J = he.current[ne];
873
- J && (J.style.opacity = "0", J.style.transition = "none", requestAnimationFrame(() => {
874
- J.style.transition = `opacity ${ee}ms ease-out`, J.style.opacity = "1", setTimeout(() => {
875
- J.style.transition = "", J.style.opacity = "";
876
- }, ee);
1431
+ M(be.current, 1, "新規パネル検出 - フェードインアニメーション:", V);
1432
+ const le = he.current[V];
1433
+ le && (le.style.opacity = "0", le.style.transition = "none", requestAnimationFrame(() => {
1434
+ le.style.transition = `opacity ${z}ms ease-out`, le.style.opacity = "1", setTimeout(() => {
1435
+ le.style.transition = "", le.style.opacity = "";
1436
+ }, z);
877
1437
  }));
878
1438
  }
879
- }), Ne.current = P;
880
- }, [n]), Se(() => {
881
- const P = /* @__PURE__ */ new Map();
882
- Object.keys(he.current).forEach((B) => {
883
- const ee = he.current[B];
884
- ee && P.set(B, { rect: ee.getBoundingClientRect(), height: ee.offsetHeight, width: ee.offsetWidth });
885
- }), Ne.current = P;
886
- }, [se]);
887
- const tt = (P) => {
888
- if (!s[P]) return null;
889
- const B = De[P];
890
- if (!B)
891
- return E(Q.current, 1, `Panel config not found for panelId: ${P}`), null;
892
- const ee = B.component, me = B.title, ue = i.draggedPanel === P, q = h[P] || "normal";
893
- E(Q.current, 2, `🎨 renderPanel - ${P}:`, {
894
- panelId: P,
895
- dragMode: q,
1439
+ }), Ye.current = c;
1440
+ }, [e]), we(() => {
1441
+ const c = /* @__PURE__ */ new Map();
1442
+ Object.keys(he.current).forEach((O) => {
1443
+ const z = he.current[O];
1444
+ z && c.set(O, { rect: z.getBoundingClientRect(), height: z.offsetHeight, width: z.offsetWidth });
1445
+ }), Ye.current = c;
1446
+ }, [ge]);
1447
+ const pt = (c, O, z) => {
1448
+ if ($e) return;
1449
+ const Q = Vn(pe, c, O);
1450
+ if (Q === null) {
1451
+ if (z) {
1452
+ const ee = ze(H.panelMoveUnavailable, { title: { text: ue[c].title, lang: void 0 }, move: H[It[O]] });
1453
+ Be((ne) => Ze(ne, ee));
1454
+ }
1455
+ return;
1456
+ }
1457
+ ut(c, Q.from, Q.columnPanels, `move-${O}`);
1458
+ }, cn = (c, O) => {
1459
+ if (c.defaultPrevented || de || !(c.target instanceof Node && c.currentTarget.contains(c.target))) return;
1460
+ const z = Gn(c);
1461
+ z !== null && (c.target instanceof Element && c.target.closest(yr) !== null || (c.preventDefault(), !c.repeat && pt(O, z, !0)));
1462
+ }, gt = (c, O) => {
1463
+ const z = ct.current;
1464
+ if (z === "touch" || z === "pen") {
1465
+ c.preventDefault();
1466
+ return;
1467
+ }
1468
+ b(c, O);
1469
+ }, Xe = ye === null ? d : ye.over, xt = ye === null ? m : dt(ye.panelId), un = (c) => {
1470
+ if (!r[c]) return null;
1471
+ const O = ue[c];
1472
+ if (!O)
1473
+ return M(be.current, 1, `Panel config not found for panelId: ${c}`), null;
1474
+ const z = O.component, Q = O.title, ee = i.draggedPanel === c || ye?.panelId === c, ne = w[c] || "normal";
1475
+ M(be.current, 2, `🎨 renderPanel - ${c}:`, {
1476
+ panelId: c,
1477
+ dragMode: ne,
896
1478
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
897
1479
  });
898
- const ne = (I) => {
899
- he.current[P] = I, $ && $(P, I), I && Y.showPanelSizes && requestAnimationFrame(() => {
900
- const ye = I.getBoundingClientRect(), Le = window.getComputedStyle(I);
901
- E(Q.current, 1, `Panel ${P} mounted with size:`, {
902
- width: ye.width,
903
- height: ye.height,
904
- x: ye.left,
905
- y: ye.top,
906
- minHeight: Le.minHeight,
907
- maxHeight: Le.maxHeight
1480
+ const re = (Z) => {
1481
+ he.current[c] = Z, _ && _(c, Z), Z && N.showPanelSizes && requestAnimationFrame(() => {
1482
+ const je = Z.getBoundingClientRect(), Ce = window.getComputedStyle(Z);
1483
+ M(be.current, 1, `Panel ${c} mounted with size:`, {
1484
+ width: je.width,
1485
+ height: je.height,
1486
+ x: je.left,
1487
+ y: je.top,
1488
+ minHeight: Ce.minHeight,
1489
+ maxHeight: Ce.maxHeight
908
1490
  });
909
1491
  });
910
- }, de = U[P], J = a === P, fe = !!A, ae = () => A?.(J ? null : P), be = J ? {
1492
+ }, V = l[c], te = F === c, le = !!D, xe = () => D?.(te ? null : c), ce = te ? null : new Set(Xn(pe, c)), Te = te ? {
911
1493
  position: "fixed",
912
1494
  top: "var(--aqdd-maximize-top, 0px)",
913
1495
  right: "var(--aqdd-maximize-right, 0px)",
@@ -917,473 +1499,475 @@ const Jt = ({
917
1499
  minHeight: 0,
918
1500
  maxHeight: "none"
919
1501
  } : {
920
- minHeight: B.minHeight ?? "200px",
921
- maxHeight: B.maxHeight ?? "500px"
922
- }, ve = H === "header", Oe = q === "normal" && !ve && !J, Te = q === "normal" && ve && !J, _e = ue ? "cursor-grabbing" : "cursor-grab", Re = `panel-draggable group relative flex flex-col overflow-hidden border border-slate-200 text-left shadow-lg backdrop-blur-lg ${q === "custom" ? "select-none" : ""}`, rt = J ? (
923
- // 最大化中: 角丸・ホバー演出・grab カーソル無し、背景は不透過寄りで下のレイアウトを遮蔽
924
- `${Re} rounded-none bg-white/95 p-4 ${d}`
925
- ) : `${Re} rounded-2xl bg-white/80 p-4 transition-all duration-300 hover:-translate-y-1 hover:shadow-xl ${ve ? "" : _e} ${d}`;
1502
+ minHeight: O.minHeight ?? "200px",
1503
+ maxHeight: O.maxHeight ?? "500px"
1504
+ }, Re = Y === "header", bt = ne === "normal" && !Re && !te, yt = ne === "normal" && Re && !te, wt = ee ? "cursor-grabbing" : "cursor-grab", jt = `panel-draggable relative flex flex-col overflow-hidden border text-left shadow-lg backdrop-blur-lg ${ne === "custom" ? "select-none" : ""}`, hn = te ? (
1505
+ // 最大化中: 角丸・ホバー演出・grab カーソル無し (下のレイアウトを遮蔽する不透過寄りの面は CSS が data-maximized で描く)
1506
+ `${jt} rounded-none p-4 ${X}`
1507
+ ) : `${jt} rounded-2xl p-4 motion-safe:transition-all motion-safe:duration-300 motion-safe:hover:-translate-y-1 hover:shadow-xl ${Re ? "" : wt} ${X}`, Pt = ne === "custom" ? H.switchToNormalDragMode : H.switchToCustomDragMode, Et = te ? H.restorePanel : H.maximizePanel;
926
1508
  return (
927
1509
  // biome-ignore lint/a11y/noStaticElementInteractions: クリックイベントを持つ静的要素
928
- /* @__PURE__ */ t.jsxs(
1510
+ /* @__PURE__ */ s.jsxs(
929
1511
  "div",
930
1512
  {
931
- ref: ne,
932
- "data-panel-id": P,
933
- "data-dragging": ue,
934
- "data-maximized": J || void 0,
1513
+ ref: re,
1514
+ "data-panel-id": c,
1515
+ "data-aqdd-panel": !0,
1516
+ "data-aqdd-drag-mode": ne,
1517
+ "data-dragging": ee,
1518
+ "data-maximized": te || void 0,
935
1519
  role: "presentation",
936
- draggable: Oe,
937
- onDragStart: (I) => Oe && N(I, P),
938
- onDragEnd: b,
939
- onClick: (I) => k?.(I, P),
940
- onMouseDown: (I) => _?.(I, P),
941
- onTouchStart: (I) => R?.(I, P),
942
- onTouchMove: z,
943
- onTouchEnd: Z,
944
- style: be,
945
- className: rt,
1520
+ draggable: bt,
1521
+ onDragStart: (Z) => bt && gt(Z, c),
1522
+ onDragEnd: A,
1523
+ onClick: (Z) => h?.(Z, c),
1524
+ onMouseDown: (Z) => P?.(Z, c),
1525
+ onKeyDown: (Z) => cn(Z, c),
1526
+ style: Te,
1527
+ className: hn,
946
1528
  children: [
947
- /* @__PURE__ */ t.jsxs(
1529
+ /* @__PURE__ */ s.jsxs(
948
1530
  "div",
949
1531
  {
950
- className: `group relative mb-3 flex items-center justify-between ${ve && !J ? _e : ""}`,
951
- draggable: Te,
952
- onDragStart: (I) => Te && N(I, P),
953
- onDoubleClick: fe ? (I) => {
954
- I.stopPropagation(), ae();
1532
+ ref: ke.bindHeader,
1533
+ "data-aqdd-panel-header": !0,
1534
+ className: `relative mb-3 ${Re && !te ? wt : ""}`,
1535
+ draggable: yt,
1536
+ onDragStart: (Z) => yt && gt(Z, c),
1537
+ onPointerDown: (Z) => ke.pressHeader(Z, c),
1538
+ onContextMenu: ke.holdContextMenu,
1539
+ onKeyDown: Er,
1540
+ onDoubleClick: le ? (Z) => {
1541
+ Z.stopPropagation(), !(Z.target instanceof Element && Z.target.closest(`[${Ee}]`) !== null) && xe();
955
1542
  } : void 0,
956
1543
  children: [
957
- /* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-2", children: [
958
- /* @__PURE__ */ t.jsx("h3", { className: "font-semibold text-lg text-slate-700 transition-colors group-hover:text-slate-900", children: me }),
959
- q === "custom" && /* @__PURE__ */ t.jsx("span", { className: "rounded-md bg-orange-100 px-2 py-1 font-medium text-orange-600 text-xs", children: "Custom" })
960
- ] }),
961
- /* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-1 opacity-0 transition-opacity group-hover:opacity-100", children: [
962
- /* @__PURE__ */ t.jsx(
963
- "button",
964
- {
965
- type: "button",
966
- onClick: (I) => {
967
- I.stopPropagation(), v && v(P);
968
- },
969
- onKeyDown: (I) => {
970
- (I.key === "Enter" || I.key === " ") && (I.preventDefault(), I.stopPropagation(), v && v(P));
971
- },
972
- tabIndex: 0,
973
- className: `cursor-pointer rounded p-1 text-xs transition-colors ${q === "custom" ? "bg-orange-100 text-orange-600 hover:bg-orange-200" : "text-slate-400 hover:bg-slate-100 hover:text-slate-600"}`,
974
- title: q === "custom" ? "通常ドラッグモードに戻す" : "カスタムドラッグモードに切り替え",
975
- children: q === "custom" ? /* @__PURE__ */ t.jsx(kt, { className: "h-4 w-4" }) : /* @__PURE__ */ t.jsx(jt, { className: "h-4 w-4" })
976
- }
977
- ),
978
- !J && /* @__PURE__ */ t.jsx(
979
- "button",
980
- {
981
- type: "button",
982
- onClick: (I) => {
983
- I.stopPropagation(), o({
984
- ...s,
985
- [P]: !1
986
- });
987
- },
988
- className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600",
989
- title: "パネルを非表示",
990
- children: /* @__PURE__ */ t.jsx(Xe, { className: "h-4 w-4" })
991
- }
992
- ),
993
- fe && /* @__PURE__ */ t.jsx(
994
- "button",
995
- {
996
- type: "button",
997
- onClick: (I) => {
998
- I.stopPropagation(), ae();
999
- },
1000
- className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600",
1001
- title: J ? "元のサイズに戻す" : "パネルを最大化",
1002
- children: J ? /* @__PURE__ */ t.jsx(yt, { className: "h-4 w-4" }) : /* @__PURE__ */ t.jsx(bt, { className: "h-4 w-4" })
1003
- }
1004
- ),
1005
- D && /* @__PURE__ */ t.jsx(
1006
- "button",
1007
- {
1008
- type: "button",
1009
- onClick: (I) => {
1010
- I.stopPropagation(), D(P);
1011
- },
1012
- className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-red-500",
1013
- title: "パネルを閉じる",
1014
- children: /* @__PURE__ */ t.jsx(Ve, { className: "h-4 w-4" })
1015
- }
1016
- )
1544
+ /* @__PURE__ */ s.jsx("h3", { "data-aqdd-panel-title": !0, className: "font-semibold text-lg", children: Q }),
1545
+ /* @__PURE__ */ s.jsxs("div", { "data-aqdd-panel-controls": !0, children: [
1546
+ ne === "custom" && /* @__PURE__ */ s.jsx("span", { "data-aqdd-custom-badge": !0, lang: H.customDragModeBadge.lang, className: "rounded-md px-2 py-1 font-medium text-xs", children: H.customDragModeBadge.text }),
1547
+ /* @__PURE__ */ s.jsxs("div", { "data-aqdd-panel-buttons": !0, children: [
1548
+ ce !== null && De.map((Z) => {
1549
+ const je = br[Z], Ce = H[It[Z]], Dt = Ut[Z];
1550
+ return /* @__PURE__ */ s.jsx(Se, { action: `move-${Z}`, label: Ce, tooltip: `${Ce.text} (${Dt.text})`, unavailable: !ce.has(Z), keyShortcuts: Dt.aria, onActivate: () => pt(c, Z, !1), children: /* @__PURE__ */ s.jsx(je, { className: "h-4 w-4", "aria-hidden": "true" }) }, Z);
1551
+ }),
1552
+ /* @__PURE__ */ s.jsx(Se, { action: "drag-mode", label: Pt, tooltip: Pt.text, unavailable: !1, keyShortcuts: void 0, onActivate: () => y?.(c), children: ne === "custom" ? /* @__PURE__ */ s.jsx(Hn, { className: "h-4 w-4", "aria-hidden": "true" }) : /* @__PURE__ */ s.jsx(qn, { className: "h-4 w-4", "aria-hidden": "true" }) }),
1553
+ !te && /* @__PURE__ */ s.jsx(Se, { action: "hide", label: H.hidePanel, tooltip: H.hidePanel.text, unavailable: !1, keyShortcuts: void 0, onActivate: () => a({ ...r, [c]: !1 }), children: /* @__PURE__ */ s.jsx(St, { className: "h-4 w-4", "aria-hidden": "true" }) }),
1554
+ le && /* @__PURE__ */ s.jsx(Se, { action: te ? "restore" : "maximize", label: Et, tooltip: Et.text, unavailable: !1, keyShortcuts: void 0, onActivate: xe, children: te ? /* @__PURE__ */ s.jsx(zn, { className: "h-4 w-4", "aria-hidden": "true" }) : /* @__PURE__ */ s.jsx(_n, { className: "h-4 w-4", "aria-hidden": "true" }) }),
1555
+ g && /* @__PURE__ */ s.jsx(Se, { action: "close", label: H.closePanel, tooltip: H.closePanel.text, unavailable: !1, keyShortcuts: void 0, onActivate: () => g(c), children: /* @__PURE__ */ s.jsx(Yt, { className: "h-4 w-4", "aria-hidden": "true" }) })
1556
+ ] })
1017
1557
  ] })
1018
1558
  ]
1019
1559
  }
1020
1560
  ),
1021
- /* @__PURE__ */ t.jsx("div", { "data-aqdd-scroll-area": !0, className: "panel-scroll-area min-h-0 flex-1 overflow-y-auto", children: /* @__PURE__ */ t.jsx(ee, { ...B.props || {} }) }),
1022
- /* @__PURE__ */ t.jsx(Dt, { config: Y, panelId: P, sizeInfo: de, onSizeInfoClick: (I) => m?.(I, P) })
1561
+ /* @__PURE__ */ s.jsx("div", { "data-aqdd-scroll-area": !0, className: "panel-scroll-area min-h-0 flex-1 overflow-y-auto", children: /* @__PURE__ */ s.jsx(z, { ...O.props || {} }) }),
1562
+ /* @__PURE__ */ s.jsx(Fn, { config: N, panelId: c, sizeInfo: V, onSizeInfoClick: (Z) => v?.(Z, c) })
1023
1563
  ]
1024
1564
  },
1025
- P
1565
+ c
1026
1566
  )
1027
1567
  );
1028
- }, nt = (P, B) => {
1029
- const ee = n[P] || [];
1030
- let me = !1;
1031
- for (const q of ee)
1032
- if (s[q]) {
1033
- me = !0;
1568
+ }, dn = (c, O) => {
1569
+ const z = e[c] || [];
1570
+ let Q = !1;
1571
+ for (const V of z)
1572
+ if (r[V]) {
1573
+ Q = !0;
1034
1574
  break;
1035
1575
  }
1036
- const ue = i.isDragging || (O?.isActive ?? !1);
1037
- return /* @__PURE__ */ t.jsx(Ge, { columnIndex: B, isDragging: ue, dragOverPosition: u, config: Y, children: /* @__PURE__ */ t.jsxs(
1576
+ const ee = $e, ne = Lt(H.dropZone, { column: O + 1 }), re = `${ve}-drop-zone-${O}`;
1577
+ return /* @__PURE__ */ s.jsx(Vt, { columnIndex: O, isDragging: ee, dragOverPosition: Xe, config: N, children: /* @__PURE__ */ s.jsxs(
1038
1578
  "section",
1039
1579
  {
1040
1580
  "data-drop-zone": "true",
1041
- "data-column-key": P,
1042
- "data-column-index": B,
1043
- "aria-label": `Drop zone for column ${B + 1}`,
1044
- onDragOver: (q) => y(q, B),
1045
- onDrop: (q) => l(q, P),
1046
- onDragLeave: j,
1047
- className: "relative flex h-full flex-col transition-all duration-200",
1581
+ "data-column-key": c,
1582
+ "data-column-index": O,
1583
+ "aria-labelledby": re,
1584
+ onDragOver: (V) => E(V, O),
1585
+ onDrop: (V) => C(V, c),
1586
+ onDragLeave: T,
1587
+ className: "relative flex h-full flex-col motion-safe:transition-all motion-safe:duration-200",
1048
1588
  children: [
1049
- /* @__PURE__ */ t.jsx("div", { className: "placeholder-container", children: /* @__PURE__ */ t.jsx(
1050
- Me,
1589
+ /* @__PURE__ */ s.jsx("span", { id: re, hidden: !0, lang: ne.lang, children: ne.text }),
1590
+ /* @__PURE__ */ s.jsx("div", { className: "placeholder-container", inert: de, children: /* @__PURE__ */ s.jsx(
1591
+ Je,
1051
1592
  {
1052
1593
  index: 0,
1053
- columnIndex: B,
1054
- isDragging: ue,
1055
- dragOverPosition: u,
1056
- originalPosition: c,
1057
- onDragEnter: M,
1058
- onDragLeave: T,
1059
- debugConfig: Y,
1060
- customDrag: O
1594
+ columnIndex: O,
1595
+ isDragging: ee,
1596
+ dragOverPosition: Xe,
1597
+ originalPosition: xt,
1598
+ onDragEnter: q,
1599
+ onDragLeave: j,
1600
+ debugConfig: N,
1601
+ customDrag: R,
1602
+ label: H.dropHere
1061
1603
  }
1062
1604
  ) }),
1063
- ee.map((q, ne) => {
1064
- const de = s[q], J = !(de || ue);
1065
- return /* @__PURE__ */ t.jsxs("div", { className: `panel-with-placeholder ${J ? "m-0 h-0 overflow-hidden p-0" : ""}`, "data-panel-hidden": J ? "true" : void 0, "aria-hidden": J ? "true" : void 0, children: [
1066
- de ? tt(q) : ue ? (
1067
- /* ドラッグ中のみ隠されたパネルのダミー表示 */
1068
- /* @__PURE__ */ t.jsxs("div", { className: "hidden-panel-placeholder relative h-[120px] rounded-2xl border-2 border-amber-300 border-dashed bg-gradient-to-br from-amber-50 to-orange-50 p-3 text-left shadow-lg backdrop-blur-lg", children: [
1069
- /* @__PURE__ */ t.jsxs("div", { className: "mb-2 flex items-center space-x-2", children: [
1070
- /* @__PURE__ */ t.jsx("h3", { className: "font-semibold text-amber-700 text-base", children: De[q]?.title || q }),
1071
- /* @__PURE__ */ t.jsx("span", { className: "rounded-md bg-amber-100 px-2 py-1 font-medium text-amber-600 text-xs", children: "非表示" })
1072
- ] }),
1073
- /* @__PURE__ */ t.jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ t.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ t.jsxs("div", { className: "text-center text-amber-600", children: [
1074
- /* @__PURE__ */ t.jsx(Xe, { className: "mx-auto h-6 w-6 opacity-50" }),
1075
- /* @__PURE__ */ t.jsx("p", { className: "mt-1 text-xs", children: "このパネルは非表示です" })
1076
- ] }) }) })
1077
- ] })
1078
- ) : null,
1079
- /* @__PURE__ */ t.jsx(
1080
- Me,
1081
- {
1082
- index: ne + 1,
1083
- columnIndex: B,
1084
- isDragging: ue,
1085
- dragOverPosition: u,
1086
- originalPosition: c,
1087
- onDragEnter: M,
1088
- onDragLeave: T,
1089
- debugConfig: Y,
1090
- customDrag: O
1091
- }
1092
- )
1093
- ] }, `panel-${q}`);
1605
+ z.map((V, te) => {
1606
+ const le = r[V], xe = !(le || ee), ce = de && V === F;
1607
+ return /* @__PURE__ */ s.jsxs(
1608
+ "div",
1609
+ {
1610
+ className: `panel-with-placeholder ${xe ? "m-0 h-0 overflow-hidden p-0" : ""}`,
1611
+ "data-panel-hidden": xe ? "true" : void 0,
1612
+ "aria-hidden": xe ? "true" : void 0,
1613
+ inert: de && !ce,
1614
+ children: [
1615
+ le ? un(V) : ee ? (
1616
+ /* ドラッグ中のみ隠されたパネルの代わりを出す (面・枠線・文字・印の色は CSS が --aqdd-* の変数から描く) */
1617
+ /* @__PURE__ */ s.jsxs("div", { "data-aqdd-hidden-panel-stand-in": !0, className: "hidden-panel-placeholder relative h-[120px] rounded-2xl border-2 border-dashed p-3 text-left shadow-lg backdrop-blur-lg", children: [
1618
+ /* @__PURE__ */ s.jsxs("div", { className: "mb-2 flex items-center space-x-2", children: [
1619
+ /* @__PURE__ */ s.jsx("h3", { className: "font-semibold text-base", children: ue[V]?.title || V }),
1620
+ /* @__PURE__ */ s.jsx("span", { "data-aqdd-hidden-panel-badge": !0, lang: H.hiddenPanelBadge.lang, className: "rounded-md px-2 py-1 font-medium text-xs", children: H.hiddenPanelBadge.text })
1621
+ ] }),
1622
+ /* @__PURE__ */ s.jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ s.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ s.jsxs("div", { className: "text-center", children: [
1623
+ /* @__PURE__ */ s.jsx(St, { className: "mx-auto h-6 w-6 opacity-50", "aria-hidden": "true" }),
1624
+ /* @__PURE__ */ s.jsx("p", { lang: H.hiddenPanelNotice.lang, className: "mt-1 text-xs", children: H.hiddenPanelNotice.text })
1625
+ ] }) }) })
1626
+ ] })
1627
+ ) : null,
1628
+ ce ? null : /* @__PURE__ */ s.jsx(
1629
+ Je,
1630
+ {
1631
+ index: te + 1,
1632
+ columnIndex: O,
1633
+ isDragging: ee,
1634
+ dragOverPosition: Xe,
1635
+ originalPosition: xt,
1636
+ onDragEnter: q,
1637
+ onDragLeave: j,
1638
+ debugConfig: N,
1639
+ customDrag: R,
1640
+ label: H.dropHere
1641
+ }
1642
+ )
1643
+ ]
1644
+ },
1645
+ `panel-${V}`
1646
+ );
1094
1647
  }),
1095
- !(me || ue) && /* @__PURE__ */ t.jsx("div", { className: "flex-shrink-0 rounded-xl border-2 border-slate-200 border-dashed bg-white/30 p-8 text-center text-slate-400 transition-all duration-200", children: /* @__PURE__ */ t.jsx("div", { className: "text-sm", children: "このエリアは空です" }) })
1648
+ !(Q || ee) && /* @__PURE__ */ s.jsx("div", { "data-aqdd-empty-column": !0, className: "flex-shrink-0 rounded-xl border-2 border-dashed p-8 text-center motion-safe:transition-all motion-safe:duration-200", inert: de, children: /* @__PURE__ */ s.jsx("div", { lang: H.emptyColumn.lang, className: "text-sm", children: H.emptyColumn.text }) })
1096
1649
  ]
1097
1650
  }
1098
1651
  ) });
1099
- }, Ae = Object.keys(s).filter((P) => !s[P]);
1100
- return /* @__PURE__ */ t.jsxs("div", { className: "flex h-full flex-col", children: [
1101
- Ae.length > 0 && /* @__PURE__ */ t.jsx("div", { className: "border-slate-200 border-b bg-white/70 px-4 py-2 backdrop-blur-lg", children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-wrap gap-2", children: [
1102
- /* @__PURE__ */ t.jsx("span", { className: "mr-2 text-slate-600 text-sm", children: "非表示のパネル:" }),
1103
- Ae.map((P) => {
1104
- const ee = De[P]?.title || P;
1105
- return /* @__PURE__ */ t.jsxs(
1106
- "button",
1107
- {
1108
- type: "button",
1109
- onClick: () => o({
1110
- ...s,
1111
- [P]: !0
1112
- }),
1113
- className: "flex items-center space-x-1 rounded-lg border border-sky-300 bg-gradient-to-r from-sky-500 to-indigo-500 px-3 py-1 text-sm text-white shadow-md transition-all duration-200 hover:from-sky-600 hover:to-indigo-600 hover:shadow-lg",
1114
- children: [
1115
- /* @__PURE__ */ t.jsx(pt, { className: "h-3 w-3" }),
1116
- /* @__PURE__ */ t.jsx("span", { children: ee })
1117
- ]
1118
- },
1119
- P
1120
- );
1121
- })
1122
- ] }) }),
1123
- /* @__PURE__ */ t.jsx("div", { ref: V, className: "relative min-h-0 flex-1 overflow-hidden", children: /* @__PURE__ */ t.jsx("div", { className: "h-full w-full", style: et, children: /* @__PURE__ */ t.jsx("main", { "data-aqdd-scroll-root": !0, className: "no-scrollbar h-full max-w-full flex-1 overflow-auto px-4 py-6 sm:px-6", children: /* @__PURE__ */ t.jsx("div", { className: "relative flex h-full items-start gap-6 pr-4", children: r.map((P, B) => {
1124
- const ee = f?.[P.id] || P.initialWidth || 350, me = L && (P.resizable ?? !0);
1125
- return /* @__PURE__ */ t.jsx(ot, { children: /* @__PURE__ */ t.jsxs(
1126
- "div",
1127
- {
1128
- className: `column relative ${P.className || ""} ${L ? "resize-enabled-column" : "auto-width-column"} ${p && g === P.id ? "column-resizing-active" : ""}`,
1129
- "data-column": B,
1130
- "data-column-id": P.id,
1131
- "data-min-width": P.minWidth || 350,
1132
- "data-max-width": P.maxWidth,
1133
- "data-column-width": L ? ee : void 0,
1134
- ...L && {
1135
- style: { "--column-width": `${ee}px` }
1136
- },
1137
- children: [
1138
- nt(P.key, B),
1139
- me && x && C && W && /* @__PURE__ */ t.jsx(Je, { columnId: P.id, onResizeStart: x, onResize: C, onResizeEnd: W, isResizing: p && g === P.id, position: "right", debug: Y })
1140
- ]
1141
- }
1142
- ) }, P.id);
1143
- }) }) }) }) })
1144
- ] });
1652
+ }, vt = Object.keys(r).filter((c) => !r[c]);
1653
+ return /* @__PURE__ */ s.jsxs(
1654
+ "div",
1655
+ {
1656
+ ref: lt,
1657
+ "data-aqdd-layout": !0,
1658
+ className: "flex h-full flex-col",
1659
+ onPointerDownCapture: (c) => {
1660
+ ct.current = c.pointerType;
1661
+ },
1662
+ children: [
1663
+ /* @__PURE__ */ s.jsxs("div", { "data-aqdd-announcer": !0, role: "status", "aria-live": "polite", "aria-atomic": "true", inert: de, children: [
1664
+ Fe?.segments.map(
1665
+ (c, O) => c.lang === void 0 ? c.text : /* @__PURE__ */ s.jsx("span", { lang: c.lang, children: c.text }, O)
1666
+ ),
1667
+ Fe !== null && Fe.serial % 2 === 0 ? wr : null
1668
+ ] }),
1669
+ vt.length > 0 && /* @__PURE__ */ s.jsx("div", { "data-aqdd-hidden-panels": !0, className: "border-b px-4 py-2 backdrop-blur-lg", inert: de, children: /* @__PURE__ */ s.jsxs("div", { className: "flex flex-wrap gap-2", children: [
1670
+ /* @__PURE__ */ s.jsx("span", { lang: H.hiddenPanels.lang, className: "mr-2 text-sm", children: H.hiddenPanels.text }),
1671
+ vt.map((c) => {
1672
+ const z = ue[c]?.title || c;
1673
+ return /* @__PURE__ */ s.jsxs(
1674
+ "button",
1675
+ {
1676
+ type: "button",
1677
+ "data-aqdd-restore-panel": c,
1678
+ onClick: () => a({
1679
+ ...r,
1680
+ [c]: !0
1681
+ }),
1682
+ className: "flex items-center space-x-1 rounded-lg px-3 py-1 text-sm shadow-md hover:shadow-lg motion-safe:transition-all motion-safe:duration-200",
1683
+ children: [
1684
+ /* @__PURE__ */ s.jsx($n, { className: "h-3 w-3", "aria-hidden": "true" }),
1685
+ /* @__PURE__ */ s.jsx("span", { children: z })
1686
+ ]
1687
+ },
1688
+ c
1689
+ );
1690
+ })
1691
+ ] }) }),
1692
+ /* @__PURE__ */ s.jsx("div", { ref: rn, className: "relative min-h-0 flex-1 overflow-hidden", children: /* @__PURE__ */ s.jsx("div", { className: "h-full w-full", style: sn, children: /* @__PURE__ */ s.jsx(G, { ref: an, "data-aqdd-scroll-root": !0, className: "no-scrollbar h-full max-w-full flex-1 overflow-auto", children: /* @__PURE__ */ s.jsx("div", { "data-aqdd-columns": !0, className: "relative flex h-full items-start", children: t.map((c, O) => {
1693
+ const z = B?.[c.id] || c.initialWidth || 350, Q = L && (c.resizable ?? !0);
1694
+ return /* @__PURE__ */ s.jsx(pn, { children: /* @__PURE__ */ s.jsxs(
1695
+ "div",
1696
+ {
1697
+ className: `column relative ${c.className || ""} ${L ? "resize-enabled-column" : "auto-width-column"} ${$ && W === c.id ? "column-resizing-active" : ""}`,
1698
+ "data-column": O,
1699
+ "data-column-id": c.id,
1700
+ "data-min-width": c.minWidth || 350,
1701
+ "data-max-width": c.maxWidth,
1702
+ "data-column-width": L ? z : void 0,
1703
+ inert: de && O !== ot.column,
1704
+ ...L && {
1705
+ style: { "--column-width": `${z}px` }
1706
+ },
1707
+ children: [
1708
+ dn(c.key, O),
1709
+ Q && !de && J && p && x && /* @__PURE__ */ s.jsx(
1710
+ tn,
1711
+ {
1712
+ columnId: c.id,
1713
+ onResizeStart: J,
1714
+ onResize: p,
1715
+ onResizeEnd: x,
1716
+ isResizing: $ && W === c.id,
1717
+ position: "right",
1718
+ debug: N,
1719
+ label: Lt(H.resizeColumn, { column: O + 1 })
1720
+ }
1721
+ )
1722
+ ]
1723
+ }
1724
+ ) }, c.id);
1725
+ }) }) }) }) })
1726
+ ]
1727
+ }
1728
+ );
1145
1729
  };
1146
- const Mt = [
1730
+ const Dr = [
1147
1731
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
1148
1732
  ["path", { d: "M3 9h18", key: "1pudct" }],
1149
1733
  ["path", { d: "M3 15h18", key: "5xshup" }],
1150
1734
  ["path", { d: "M9 3v18", key: "fh3hqa" }],
1151
1735
  ["path", { d: "M15 3v18", key: "14nvp0" }]
1152
- ], $t = oe("grid-3x3", Mt);
1153
- const At = [["path", { d: "M5 12h14", key: "1ays0h" }]], Ot = oe("minus", At);
1154
- const Tt = [
1736
+ ], kr = ie("grid-3x3", Dr);
1737
+ const Cr = [["path", { d: "M5 12h14", key: "1ays0h" }]], Nr = ie("minus", Cr);
1738
+ const Or = [
1155
1739
  ["path", { d: "M5 12h14", key: "1ays0h" }],
1156
1740
  ["path", { d: "M12 5v14", key: "s699le" }]
1157
- ], $e = oe("plus", Tt);
1158
- const _t = [
1741
+ ], Qe = ie("plus", Or);
1742
+ const Sr = [
1159
1743
  ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
1160
1744
  ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
1161
- ], Rt = oe("rotate-ccw", _t), Qt = ({ columnCount: r, onColumnCountChange: e, onAutoBalance: n, onResetWidths: s, minColumns: o = 2, maxColumns: i = 6, isResizing: u = !1, isResponsiveMode: c = !1, responsiveColumnCount: h }) => {
1162
- const N = r > o && !c, b = r < i && !c;
1163
- return /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-3 rounded-lg border border-slate-200 bg-white/80 px-4 py-2 shadow-sm backdrop-blur-lg", children: [
1164
- /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
1165
- /* @__PURE__ */ t.jsx("span", { className: "font-medium text-slate-700 text-sm", children: "カラム数:" }),
1166
- /* @__PURE__ */ t.jsx(
1745
+ ], Mr = ie("rotate-ccw", Sr), Xr = ({ columnCount: t, onColumnCountChange: n, onAutoBalance: e, onResetWidths: o, minColumns: r = 2, maxColumns: a = 6, isResizing: i = !1, isResponsiveMode: d = !1, responsiveColumnCount: m }) => {
1746
+ const w = t > r && !d, b = t < a && !d;
1747
+ return /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-3 rounded-lg border border-slate-200 bg-white/80 px-4 py-2 shadow-sm backdrop-blur-lg", children: [
1748
+ /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-2", children: [
1749
+ /* @__PURE__ */ s.jsx("span", { className: "font-medium text-slate-700 text-sm", children: "カラム数:" }),
1750
+ /* @__PURE__ */ s.jsx(
1167
1751
  "button",
1168
1752
  {
1169
1753
  type: "button",
1170
- onClick: () => N && e(r - 1),
1171
- disabled: !N || u,
1172
- className: `rounded p-1 text-xs transition-colors ${N && !u ? "border border-slate-300 text-slate-600 hover:border-red-300 hover:bg-red-50 hover:text-red-600" : "cursor-not-allowed border border-slate-200 bg-slate-50 text-slate-300"}`,
1173
- title: c ? "レスポンシブモード中:カラム数は自動調整されます" : `カラムを削除 (最小: ${o}列)`,
1174
- children: /* @__PURE__ */ t.jsx(Ot, { className: "h-3 w-3" })
1754
+ onClick: () => w && n(t - 1),
1755
+ disabled: !w || i,
1756
+ className: `rounded p-1 text-xs transition-colors ${w && !i ? "border border-slate-300 text-slate-600 hover:border-red-300 hover:bg-red-50 hover:text-red-600" : "cursor-not-allowed border border-slate-200 bg-slate-50 text-slate-300"}`,
1757
+ title: d ? "レスポンシブモード中:カラム数は自動調整されます" : `カラムを削除 (最小: ${r}列)`,
1758
+ children: /* @__PURE__ */ s.jsx(Nr, { className: "h-3 w-3" })
1175
1759
  }
1176
1760
  ),
1177
- /* @__PURE__ */ t.jsxs("div", { className: `min-w-[2rem] rounded border px-3 py-1 text-center font-mono text-sm ${c ? "border-blue-300 bg-blue-50 text-blue-700" : "border-slate-300 bg-slate-100 text-slate-700"}`, children: [
1178
- c ? h ?? r : r,
1179
- c && /* @__PURE__ */ t.jsx("span", { className: "ml-1 text-xs", children: "自動" })
1761
+ /* @__PURE__ */ s.jsxs("div", { className: `min-w-[2rem] rounded border px-3 py-1 text-center font-mono text-sm ${d ? "border-blue-300 bg-blue-50 text-blue-700" : "border-slate-300 bg-slate-100 text-slate-700"}`, children: [
1762
+ d ? m ?? t : t,
1763
+ d && /* @__PURE__ */ s.jsx("span", { className: "ml-1 text-xs", children: "自動" })
1180
1764
  ] }),
1181
- /* @__PURE__ */ t.jsx(
1765
+ /* @__PURE__ */ s.jsx(
1182
1766
  "button",
1183
1767
  {
1184
1768
  type: "button",
1185
- onClick: () => b && e(r + 1),
1186
- disabled: !b || u,
1187
- className: `rounded p-1 text-xs transition-colors ${b && !u ? "border border-slate-300 text-slate-600 hover:border-blue-300 hover:bg-blue-50 hover:text-blue-600" : "cursor-not-allowed border border-slate-200 bg-slate-50 text-slate-300"}`,
1188
- title: c ? "レスポンシブモード中:カラム数は自動調整されます" : `カラムを追加 (最大: ${i}列)`,
1189
- children: /* @__PURE__ */ t.jsx($e, { className: "h-3 w-3" })
1769
+ onClick: () => b && n(t + 1),
1770
+ disabled: !b || i,
1771
+ className: `rounded p-1 text-xs transition-colors ${b && !i ? "border border-slate-300 text-slate-600 hover:border-blue-300 hover:bg-blue-50 hover:text-blue-600" : "cursor-not-allowed border border-slate-200 bg-slate-50 text-slate-300"}`,
1772
+ title: d ? "レスポンシブモード中:カラム数は自動調整されます" : `カラムを追加 (最大: ${a}列)`,
1773
+ children: /* @__PURE__ */ s.jsx(Qe, { className: "h-3 w-3" })
1190
1774
  }
1191
1775
  )
1192
1776
  ] }),
1193
- /* @__PURE__ */ t.jsx("div", { className: "h-6 w-px bg-slate-300" }),
1194
- /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
1195
- /* @__PURE__ */ t.jsxs(
1777
+ /* @__PURE__ */ s.jsx("div", { className: "h-6 w-px bg-slate-300" }),
1778
+ /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-2", children: [
1779
+ /* @__PURE__ */ s.jsxs(
1196
1780
  "button",
1197
1781
  {
1198
1782
  type: "button",
1199
- onClick: n,
1200
- disabled: u,
1201
- className: `flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors ${u ? "cursor-not-allowed border border-slate-200 bg-slate-50 text-slate-300" : "border border-slate-300 text-slate-600 hover:border-green-300 hover:bg-green-50 hover:text-green-600"}`,
1783
+ onClick: e,
1784
+ disabled: i,
1785
+ className: `flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors ${i ? "cursor-not-allowed border border-slate-200 bg-slate-50 text-slate-300" : "border border-slate-300 text-slate-600 hover:border-green-300 hover:bg-green-50 hover:text-green-600"}`,
1202
1786
  title: "パネルを全カラムに均等分散",
1203
1787
  children: [
1204
- /* @__PURE__ */ t.jsx($t, { className: "h-3 w-3" }),
1205
- /* @__PURE__ */ t.jsx("span", { children: "バランス" })
1788
+ /* @__PURE__ */ s.jsx(kr, { className: "h-3 w-3" }),
1789
+ /* @__PURE__ */ s.jsx("span", { children: "バランス" })
1206
1790
  ]
1207
1791
  }
1208
1792
  ),
1209
- /* @__PURE__ */ t.jsxs(
1793
+ /* @__PURE__ */ s.jsxs(
1210
1794
  "button",
1211
1795
  {
1212
1796
  type: "button",
1213
- onClick: s,
1214
- disabled: u,
1215
- className: `flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors ${u ? "cursor-not-allowed border border-slate-200 bg-slate-50 text-slate-300" : "border border-slate-300 text-slate-600 hover:border-orange-300 hover:bg-orange-50 hover:text-orange-600"}`,
1797
+ onClick: o,
1798
+ disabled: i,
1799
+ className: `flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors ${i ? "cursor-not-allowed border border-slate-200 bg-slate-50 text-slate-300" : "border border-slate-300 text-slate-600 hover:border-orange-300 hover:bg-orange-50 hover:text-orange-600"}`,
1216
1800
  title: "カラム幅を初期値にリセット",
1217
1801
  children: [
1218
- /* @__PURE__ */ t.jsx(Rt, { className: "h-3 w-3" }),
1219
- /* @__PURE__ */ t.jsx("span", { children: "幅リセット" })
1802
+ /* @__PURE__ */ s.jsx(Mr, { className: "h-3 w-3" }),
1803
+ /* @__PURE__ */ s.jsx("span", { children: "幅リセット" })
1220
1804
  ]
1221
1805
  }
1222
1806
  )
1223
1807
  ] }),
1224
- u && /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1 text-blue-600 text-xs", children: [
1225
- /* @__PURE__ */ t.jsx("div", { className: "h-2 w-2 animate-pulse rounded-full bg-blue-500" }),
1226
- /* @__PURE__ */ t.jsx("span", { children: "リサイズ中..." })
1808
+ i && /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-1 text-blue-600 text-xs", children: [
1809
+ /* @__PURE__ */ s.jsx("div", { className: "h-2 w-2 animate-pulse rounded-full bg-blue-500" }),
1810
+ /* @__PURE__ */ s.jsx("span", { children: "リサイズ中..." })
1227
1811
  ] })
1228
1812
  ] });
1229
- }, Kt = ({ columnCount: r, onInsertColumn: e, onDeleteColumn: n, minColumns: s = 1, maxColumns: o = 6, isResizing: i = !1, disabled: u = !1 }) => {
1230
- const c = r < o && !u, h = r > s && !u;
1231
- return /* @__PURE__ */ t.jsxs("div", { className: `flex items-center justify-center gap-1 rounded-lg border border-slate-200 px-4 py-2 shadow-sm backdrop-blur-lg ${u ? "bg-slate-100/80 opacity-60" : "bg-white/80"}`, children: [
1232
- u && /* @__PURE__ */ t.jsx("div", { className: "flex items-center gap-2 text-slate-500 text-xs", children: /* @__PURE__ */ t.jsx("span", { children: "レスポンシブモード有効中:カラム数は自動調整されます" }) }),
1233
- !u && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1234
- /* @__PURE__ */ t.jsx(
1813
+ }, Vr = ({ columnCount: t, onInsertColumn: n, onDeleteColumn: e, minColumns: o = 1, maxColumns: r = 6, isResizing: a = !1, disabled: i = !1 }) => {
1814
+ const d = t < r && !i, m = t > o && !i;
1815
+ return /* @__PURE__ */ s.jsxs("div", { className: `flex items-center justify-center gap-1 rounded-lg border border-slate-200 px-4 py-2 shadow-sm backdrop-blur-lg ${i ? "bg-slate-100/80 opacity-60" : "bg-white/80"}`, children: [
1816
+ i && /* @__PURE__ */ s.jsx("div", { className: "flex items-center gap-2 text-slate-500 text-xs", children: /* @__PURE__ */ s.jsx("span", { children: "レスポンシブモード有効中:カラム数は自動調整されます" }) }),
1817
+ !i && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
1818
+ /* @__PURE__ */ s.jsx(
1235
1819
  "button",
1236
1820
  {
1237
1821
  type: "button",
1238
- onClick: () => c && e(0),
1239
- disabled: !c || i,
1240
- className: `flex h-8 w-8 items-center justify-center rounded border-2 border-dashed text-xs transition-colors ${c && !i ? "border-blue-300 text-blue-600 hover:border-blue-500 hover:bg-blue-50" : "cursor-not-allowed border-slate-200 text-slate-300"}`,
1822
+ onClick: () => d && n(0),
1823
+ disabled: !d || a,
1824
+ className: `flex h-8 w-8 items-center justify-center rounded border-2 border-dashed text-xs transition-colors ${d && !a ? "border-blue-300 text-blue-600 hover:border-blue-500 hover:bg-blue-50" : "cursor-not-allowed border-slate-200 text-slate-300"}`,
1241
1825
  title: "この位置に新しいカラムを挿入",
1242
- children: /* @__PURE__ */ t.jsx($e, { className: "h-4 w-4" })
1826
+ children: /* @__PURE__ */ s.jsx(Qe, { className: "h-4 w-4" })
1243
1827
  }
1244
1828
  ),
1245
- Array.from({ length: r }, (N, b) => /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1", children: [
1246
- /* @__PURE__ */ t.jsxs("div", { className: "relative flex h-8 w-12 items-center justify-center rounded border border-slate-300 bg-slate-100", children: [
1247
- /* @__PURE__ */ t.jsx("span", { className: "font-medium font-mono text-slate-700 text-xs", children: b + 1 }),
1248
- h && !i && /* @__PURE__ */ t.jsx(
1829
+ Array.from({ length: t }, (w, b) => /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-1", children: [
1830
+ /* @__PURE__ */ s.jsxs("div", { className: "relative flex h-8 w-12 items-center justify-center rounded border border-slate-300 bg-slate-100", children: [
1831
+ /* @__PURE__ */ s.jsx("span", { className: "font-medium font-mono text-slate-700 text-xs", children: b + 1 }),
1832
+ m && !a && /* @__PURE__ */ s.jsx(
1249
1833
  "button",
1250
1834
  {
1251
1835
  type: "button",
1252
- onClick: () => n(b),
1836
+ onClick: () => e(b),
1253
1837
  className: "absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full border border-red-300 bg-red-100 text-red-600 hover:bg-red-200",
1254
1838
  title: `カラム ${b + 1} を削除`,
1255
- children: /* @__PURE__ */ t.jsx(Ve, { className: "h-2.5 w-2.5" })
1839
+ children: /* @__PURE__ */ s.jsx(Yt, { className: "h-2.5 w-2.5" })
1256
1840
  }
1257
1841
  )
1258
1842
  ] }),
1259
- /* @__PURE__ */ t.jsx(
1843
+ /* @__PURE__ */ s.jsx(
1260
1844
  "button",
1261
1845
  {
1262
1846
  type: "button",
1263
- onClick: () => c && e(b + 1),
1264
- disabled: !c || i,
1265
- className: `flex h-8 w-8 items-center justify-center rounded border-2 border-dashed text-xs transition-colors ${c && !i ? "border-blue-300 text-blue-600 hover:border-blue-500 hover:bg-blue-50" : "cursor-not-allowed border-slate-200 text-slate-300"}`,
1847
+ onClick: () => d && n(b + 1),
1848
+ disabled: !d || a,
1849
+ className: `flex h-8 w-8 items-center justify-center rounded border-2 border-dashed text-xs transition-colors ${d && !a ? "border-blue-300 text-blue-600 hover:border-blue-500 hover:bg-blue-50" : "cursor-not-allowed border-slate-200 text-slate-300"}`,
1266
1850
  title: "この位置に新しいカラムを挿入",
1267
- children: /* @__PURE__ */ t.jsx($e, { className: "h-4 w-4" })
1851
+ children: /* @__PURE__ */ s.jsx(Qe, { className: "h-4 w-4" })
1268
1852
  }
1269
1853
  )
1270
1854
  ] }, `column-${b}`))
1271
1855
  ] })
1272
1856
  ] });
1273
- }, en = ({ config: r, onConfigChange: e, isVisible: n, onToggleVisibility: s }) => n ? /* @__PURE__ */ t.jsxs("div", { className: "fixed right-4 bottom-4 z-50 max-w-sm rounded-lg border border-gray-300 bg-white p-4 shadow-xl", children: [
1274
- /* @__PURE__ */ t.jsxs("div", { className: "mb-3 flex items-center justify-between", children: [
1275
- /* @__PURE__ */ t.jsx("h3", { className: "font-bold text-gray-800 text-sm", children: "🛠️ デバッグ設定" }),
1276
- /* @__PURE__ */ t.jsx("button", { type: "button", onClick: s, className: "text-gray-500 text-lg hover:text-gray-700", title: "閉じる", children: "✕" })
1857
+ }, Zr = ({ config: t, onConfigChange: n, isVisible: e, onToggleVisibility: o }) => e ? /* @__PURE__ */ s.jsxs("div", { className: "fixed right-4 bottom-4 z-50 max-w-sm rounded-lg border border-gray-300 bg-white p-4 shadow-xl", children: [
1858
+ /* @__PURE__ */ s.jsxs("div", { className: "mb-3 flex items-center justify-between", children: [
1859
+ /* @__PURE__ */ s.jsx("h3", { className: "font-bold text-gray-800 text-sm", children: "🛠️ デバッグ設定" }),
1860
+ /* @__PURE__ */ s.jsx("button", { type: "button", onClick: o, className: "text-gray-500 text-lg hover:text-gray-700", title: "閉じる", children: "✕" })
1277
1861
  ] }),
1278
- /* @__PURE__ */ t.jsxs("div", { className: "space-y-2", children: [
1279
- /* @__PURE__ */ t.jsxs("label", { className: "flex items-center space-x-2 text-sm", children: [
1280
- /* @__PURE__ */ t.jsx(
1862
+ /* @__PURE__ */ s.jsxs("div", { className: "space-y-2", children: [
1863
+ /* @__PURE__ */ s.jsxs("label", { className: "flex items-center space-x-2 text-sm", children: [
1864
+ /* @__PURE__ */ s.jsx(
1281
1865
  "input",
1282
1866
  {
1283
1867
  type: "checkbox",
1284
- checked: r.showDebugPanel ?? !1,
1285
- onChange: (o) => e({
1286
- ...r,
1287
- showDebugPanel: o.target.checked
1868
+ checked: t.showDebugPanel ?? !1,
1869
+ onChange: (r) => n({
1870
+ ...t,
1871
+ showDebugPanel: r.target.checked
1288
1872
  }),
1289
1873
  className: "rounded"
1290
1874
  }
1291
1875
  ),
1292
- /* @__PURE__ */ t.jsx("span", { children: "デバッグパネル表示" })
1876
+ /* @__PURE__ */ s.jsx("span", { children: "デバッグパネル表示" })
1293
1877
  ] }),
1294
- /* @__PURE__ */ t.jsxs("label", { className: "flex items-center space-x-2 text-sm", children: [
1295
- /* @__PURE__ */ t.jsx(
1878
+ /* @__PURE__ */ s.jsxs("label", { className: "flex items-center space-x-2 text-sm", children: [
1879
+ /* @__PURE__ */ s.jsx(
1296
1880
  "input",
1297
1881
  {
1298
1882
  type: "checkbox",
1299
- checked: r.showMousePosition ?? !1,
1300
- onChange: (o) => e({
1301
- ...r,
1302
- showMousePosition: o.target.checked
1883
+ checked: t.showMousePosition ?? !1,
1884
+ onChange: (r) => n({
1885
+ ...t,
1886
+ showMousePosition: r.target.checked
1303
1887
  }),
1304
1888
  className: "rounded"
1305
1889
  }
1306
1890
  ),
1307
- /* @__PURE__ */ t.jsx("span", { children: "マウス位置表示" })
1891
+ /* @__PURE__ */ s.jsx("span", { children: "マウス位置表示" })
1308
1892
  ] }),
1309
- /* @__PURE__ */ t.jsxs("label", { className: "flex items-center space-x-2 text-sm", children: [
1310
- /* @__PURE__ */ t.jsx(
1893
+ /* @__PURE__ */ s.jsxs("label", { className: "flex items-center space-x-2 text-sm", children: [
1894
+ /* @__PURE__ */ s.jsx(
1311
1895
  "input",
1312
1896
  {
1313
1897
  type: "checkbox",
1314
- checked: r.showPanelSizes ?? !1,
1315
- onChange: (o) => e({
1316
- ...r,
1317
- showPanelSizes: o.target.checked
1898
+ checked: t.showPanelSizes ?? !1,
1899
+ onChange: (r) => n({
1900
+ ...t,
1901
+ showPanelSizes: r.target.checked
1318
1902
  }),
1319
1903
  className: "rounded"
1320
1904
  }
1321
1905
  ),
1322
- /* @__PURE__ */ t.jsx("span", { children: "パネルサイズ情報" })
1906
+ /* @__PURE__ */ s.jsx("span", { children: "パネルサイズ情報" })
1323
1907
  ] }),
1324
- /* @__PURE__ */ t.jsxs("label", { className: "flex items-center space-x-2 text-sm", children: [
1325
- /* @__PURE__ */ t.jsx(
1908
+ /* @__PURE__ */ s.jsxs("label", { className: "flex items-center space-x-2 text-sm", children: [
1909
+ /* @__PURE__ */ s.jsx(
1326
1910
  "input",
1327
1911
  {
1328
1912
  type: "checkbox",
1329
- checked: r.showPlaceholderInfo ?? !1,
1330
- onChange: (o) => e({
1331
- ...r,
1332
- showPlaceholderInfo: o.target.checked
1913
+ checked: t.showPlaceholderInfo ?? !1,
1914
+ onChange: (r) => n({
1915
+ ...t,
1916
+ showPlaceholderInfo: r.target.checked
1333
1917
  }),
1334
1918
  className: "rounded"
1335
1919
  }
1336
1920
  ),
1337
- /* @__PURE__ */ t.jsx("span", { children: "プレースホルダー詳細" })
1921
+ /* @__PURE__ */ s.jsx("span", { children: "プレースホルダー詳細" })
1338
1922
  ] }),
1339
- /* @__PURE__ */ t.jsxs("label", { className: "flex items-center space-x-2 text-sm", children: [
1340
- /* @__PURE__ */ t.jsx(
1923
+ /* @__PURE__ */ s.jsxs("label", { className: "flex items-center space-x-2 text-sm", children: [
1924
+ /* @__PURE__ */ s.jsx(
1341
1925
  "input",
1342
1926
  {
1343
1927
  type: "checkbox",
1344
- checked: r.showDropZoneOutlines ?? !1,
1345
- onChange: (o) => e({
1346
- ...r,
1347
- showDropZoneOutlines: o.target.checked
1928
+ checked: t.showDropZoneOutlines ?? !1,
1929
+ onChange: (r) => n({
1930
+ ...t,
1931
+ showDropZoneOutlines: r.target.checked
1348
1932
  }),
1349
1933
  className: "rounded"
1350
1934
  }
1351
1935
  ),
1352
- /* @__PURE__ */ t.jsx("span", { children: "ドロップゾーン境界" })
1936
+ /* @__PURE__ */ s.jsx("span", { children: "ドロップゾーン境界" })
1353
1937
  ] }),
1354
- /* @__PURE__ */ t.jsxs("div", { className: "border-gray-200 border-t pt-2", children: [
1355
- /* @__PURE__ */ t.jsxs("label", { htmlFor: "log-level-slider", className: "mb-1 block text-sm", children: [
1938
+ /* @__PURE__ */ s.jsxs("div", { className: "border-gray-200 border-t pt-2", children: [
1939
+ /* @__PURE__ */ s.jsxs("label", { htmlFor: "log-level-slider", className: "mb-1 block text-sm", children: [
1356
1940
  "ログレベル: ",
1357
- r.logLevel ?? 0
1941
+ t.logLevel ?? 0
1358
1942
  ] }),
1359
- /* @__PURE__ */ t.jsx(
1943
+ /* @__PURE__ */ s.jsx(
1360
1944
  "input",
1361
1945
  {
1362
1946
  id: "log-level-slider",
1363
1947
  type: "range",
1364
1948
  min: "0",
1365
1949
  max: "2",
1366
- value: r.logLevel ?? 0,
1367
- onChange: (o) => e({
1368
- ...r,
1369
- logLevel: parseInt(o.target.value, 10)
1950
+ value: t.logLevel ?? 0,
1951
+ onChange: (r) => n({
1952
+ ...t,
1953
+ logLevel: parseInt(r.target.value, 10)
1370
1954
  }),
1371
1955
  className: "w-full",
1372
1956
  "aria-label": "ログレベル設定"
1373
1957
  }
1374
1958
  ),
1375
- /* @__PURE__ */ t.jsxs("div", { className: "mt-1 flex justify-between text-gray-500 text-xs", children: [
1376
- /* @__PURE__ */ t.jsx("span", { children: "無効" }),
1377
- /* @__PURE__ */ t.jsx("span", { children: "基本" }),
1378
- /* @__PURE__ */ t.jsx("span", { children: "詳細" })
1959
+ /* @__PURE__ */ s.jsxs("div", { className: "mt-1 flex justify-between text-gray-500 text-xs", children: [
1960
+ /* @__PURE__ */ s.jsx("span", { children: "無効" }),
1961
+ /* @__PURE__ */ s.jsx("span", { children: "基本" }),
1962
+ /* @__PURE__ */ s.jsx("span", { children: "詳細" })
1379
1963
  ] })
1380
1964
  ] }),
1381
- /* @__PURE__ */ t.jsxs("div", { className: "space-y-2 pt-2", children: [
1382
- /* @__PURE__ */ t.jsx(
1965
+ /* @__PURE__ */ s.jsxs("div", { className: "space-y-2 pt-2", children: [
1966
+ /* @__PURE__ */ s.jsx(
1383
1967
  "button",
1384
1968
  {
1385
1969
  type: "button",
1386
- onClick: () => e({
1970
+ onClick: () => n({
1387
1971
  showDebugPanel: !0,
1388
1972
  showMousePosition: !0,
1389
1973
  showPanelSizes: !0,
@@ -1395,11 +1979,11 @@ const _t = [
1395
1979
  children: "すべて有効"
1396
1980
  }
1397
1981
  ),
1398
- /* @__PURE__ */ t.jsx(
1982
+ /* @__PURE__ */ s.jsx(
1399
1983
  "button",
1400
1984
  {
1401
1985
  type: "button",
1402
- onClick: () => e({
1986
+ onClick: () => n({
1403
1987
  showDebugPanel: !1,
1404
1988
  showMousePosition: !1,
1405
1989
  showPanelSizes: !1,
@@ -1413,1104 +1997,990 @@ const _t = [
1413
1997
  )
1414
1998
  ] })
1415
1999
  ] })
1416
- ] }) : /* @__PURE__ */ t.jsx("button", { type: "button", onClick: s, className: "fixed right-4 bottom-4 z-50 rounded-lg bg-gray-800 p-2 text-white shadow-lg transition-colors hover:bg-gray-700", title: "デバッグ設定を開く", children: "🛠️" }), ie = {
2000
+ ] }) : /* @__PURE__ */ s.jsx("button", { type: "button", onClick: o, className: "fixed right-4 bottom-4 z-50 rounded-lg bg-gray-800 p-2 text-white shadow-lg transition-colors hover:bg-gray-700", title: "デバッグ設定を開く", children: "🛠️" }), fe = {
1417
2001
  prefix: "column",
1418
2002
  startIndex: 1,
1419
2003
  separator: "_"
1420
- }, je = (r, e = ie) => {
1421
- const { prefix: n, startIndex: s, separator: o } = e, i = r + s;
1422
- return `${n}${o}${i}`;
1423
- }, Qe = (r, e = ie) => Array.from({ length: r }, (n, s) => je(s, e)), Pe = (r, e = ie) => {
1424
- const { prefix: n, startIndex: s, separator: o } = e, i = `${n}${o}`;
1425
- if (!r.startsWith(i))
2004
+ }, qe = (t, n = fe) => {
2005
+ const { prefix: e, startIndex: o, separator: r } = n, a = t + o;
2006
+ return `${e}${r}${a}`;
2007
+ }, nn = (t, n = fe) => Array.from({ length: t }, (e, o) => qe(o, n)), We = (t, n = fe) => {
2008
+ const { prefix: e, startIndex: o, separator: r } = n, a = `${e}${r}`;
2009
+ if (!t.startsWith(a))
1426
2010
  return null;
1427
- const u = r.slice(i.length), c = parseInt(u, 10);
1428
- return Number.isNaN(c) || c < s ? null : c - s;
1429
- }, tn = (r, e = ie) => Pe(r, e) !== null, nn = (r, e = ie) => {
1430
- const n = r.map((s) => Pe(s, e)).filter((s) => s !== null).sort((s, o) => s - o);
1431
- for (let s = 0; s < n.length; s++)
1432
- if (n[s] !== s)
1433
- return je(s, e);
1434
- return je(n.length, e);
1435
- }, Lt = (r, e = ie) => r.sort((n, s) => {
1436
- const o = Pe(n, e) ?? -1, i = Pe(s, e) ?? -1;
1437
- return o - i;
1438
- }), rn = (r, e = ie) => {
1439
- const n = {};
1440
- return r.forEach((s, o) => {
1441
- const i = je(o, e);
1442
- n[s] = i;
1443
- }), n;
1444
- }, Wt = (r, e, n = ie) => {
1445
- const s = [];
1446
- Object.values(r).forEach((u) => {
1447
- s.push(...u);
2011
+ const i = t.slice(a.length), d = parseInt(i, 10);
2012
+ return Number.isNaN(d) || d < o ? null : d - o;
2013
+ }, Gr = (t, n = fe) => We(t, n) !== null, Kr = (t, n = fe) => {
2014
+ const e = t.map((o) => We(o, n)).filter((o) => o !== null).sort((o, r) => o - r);
2015
+ for (let o = 0; o < e.length; o++)
2016
+ if (e[o] !== o)
2017
+ return qe(o, n);
2018
+ return qe(e.length, n);
2019
+ }, Ar = (t, n = fe) => t.sort((e, o) => {
2020
+ const r = We(e, n) ?? -1, a = We(o, n) ?? -1;
2021
+ return r - a;
2022
+ }), Jr = (t, n = fe) => {
2023
+ const e = {};
2024
+ return t.forEach((o, r) => {
2025
+ const a = qe(r, n);
2026
+ e[o] = a;
2027
+ }), e;
2028
+ }, $r = (t, n, e = fe) => {
2029
+ const o = [];
2030
+ Object.values(t).forEach((i) => {
2031
+ o.push(...i);
1448
2032
  });
1449
- const o = {}, i = Qe(e, n);
1450
- return i.forEach((u) => {
1451
- o[u] = [];
1452
- }), s.forEach((u, c) => {
1453
- const h = c % e, N = i[h];
1454
- o[N].push(u);
1455
- }), o;
1456
- }, sn = ({ initialColumns: r, initialPanels: e, debug: n = {}, onLayoutChange: s }) => {
1457
- const [o, i] = te(() => {
1458
- const f = {};
1459
- for (const x of r)
1460
- f[x.id] = x.initialWidth || 400;
2033
+ const r = {}, a = nn(n, e);
2034
+ return a.forEach((i) => {
2035
+ r[i] = [];
2036
+ }), o.forEach((i, d) => {
2037
+ const m = d % n, w = a[m];
2038
+ r[w].push(i);
2039
+ }), r;
2040
+ }, Qr = ({ initialColumns: t, initialPanels: n, debug: e = {}, onLayoutChange: o }) => {
2041
+ const [r, a] = se(() => {
2042
+ const p = {};
2043
+ for (const x of t)
2044
+ p[x.id] = x.initialWidth || 400;
1461
2045
  return {
1462
- columns: r,
1463
- columnWidths: f,
2046
+ columns: t,
2047
+ columnWidths: p,
1464
2048
  isResizing: !1,
1465
2049
  resizingColumn: null,
1466
- columnPanels: e,
2050
+ columnPanels: n,
1467
2051
  showInsertPlaceholders: !1
1468
2052
  };
1469
- }), u = F(0), c = F(0);
1470
- K(() => {
1471
- s?.(o);
1472
- }, [o, s]);
1473
- const h = w(
1474
- (f, x) => {
1475
- E(n, 1, "カラム追加:", f.id, "at position:", x), i((C) => {
1476
- const W = [...C.columns], p = x ?? W.length;
1477
- W.splice(p, 0, f);
1478
- const g = {
1479
- ...C.columnWidths,
1480
- [f.id]: f.initialWidth || 400
1481
- }, m = {
1482
- ...C.columnPanels,
1483
- [f.id]: []
2053
+ }), i = I(0), d = I(0);
2054
+ oe(() => {
2055
+ o?.(r);
2056
+ }, [r, o]);
2057
+ const m = k(
2058
+ (p, x) => {
2059
+ M(e, 1, "カラム追加:", p.id, "at position:", x), a(($) => {
2060
+ const W = [...$.columns], v = x ?? W.length;
2061
+ W.splice(v, 0, p);
2062
+ const y = {
2063
+ ...$.columnWidths,
2064
+ [p.id]: p.initialWidth || 400
2065
+ }, g = {
2066
+ ...$.columnPanels,
2067
+ [p.id]: []
1484
2068
  };
1485
2069
  return {
1486
- ...C,
2070
+ ...$,
1487
2071
  columns: W,
1488
- columnWidths: g,
1489
- columnPanels: m
2072
+ columnWidths: y,
2073
+ columnPanels: g
1490
2074
  };
1491
2075
  });
1492
2076
  },
1493
- [n]
1494
- ), N = w(
1495
- (f) => {
1496
- E(n, 1, "カラム削除:", f), i((x) => {
1497
- const C = x.columnPanels[f] || [], W = x.columns.filter((v) => v.id !== f);
2077
+ [e]
2078
+ ), w = k(
2079
+ (p) => {
2080
+ M(e, 1, "カラム削除:", p), a((x) => {
2081
+ const $ = x.columnPanels[p] || [], W = x.columns.filter((D) => D.id !== p);
1498
2082
  if (W.length === 0)
1499
- return E(n, 1, "警告: 最後のカラムを削除しようとしています"), x;
1500
- const p = W[0].id, g = { ...x.columnPanels };
1501
- C.length > 0 && (g[p] = [...g[p], ...C]), delete g[f];
1502
- const m = { ...x.columnWidths };
1503
- return delete m[f], {
2083
+ return M(e, 1, "警告: 最後のカラムを削除しようとしています"), x;
2084
+ const v = W[0].id, y = { ...x.columnPanels };
2085
+ $.length > 0 && (y[v] = [...y[v], ...$]), delete y[p];
2086
+ const g = { ...x.columnWidths };
2087
+ return delete g[p], {
1504
2088
  ...x,
1505
2089
  columns: W,
1506
- columnWidths: m,
1507
- columnPanels: g
2090
+ columnWidths: g,
2091
+ columnPanels: y
1508
2092
  };
1509
2093
  });
1510
2094
  },
1511
- [n]
1512
- ), b = w(
1513
- (f, x) => {
1514
- E(n, 1, "カラム移動:", f, "->", x), i((C) => {
1515
- const W = [...C.columns], [p] = W.splice(f, 1);
1516
- return W.splice(x, 0, p), {
1517
- ...C,
2095
+ [e]
2096
+ ), b = k(
2097
+ (p, x) => {
2098
+ M(e, 1, "カラム移動:", p, "->", x), a(($) => {
2099
+ const W = [...$.columns], [v] = W.splice(p, 1);
2100
+ return W.splice(x, 0, v), {
2101
+ ...$,
1518
2102
  columns: W
1519
2103
  };
1520
2104
  });
1521
2105
  },
1522
- [n]
1523
- ), M = w(
1524
- (f, x) => {
1525
- E(n, 2, "リサイズ開始:", f, "at X:", x), u.current = x, c.current = o.columnWidths[f] || 300, i((C) => ({
1526
- ...C,
2106
+ [e]
2107
+ ), A = k(
2108
+ (p, x) => {
2109
+ M(e, 2, "リサイズ開始:", p, "at X:", x), i.current = x, d.current = r.columnWidths[p] || 300, a(($) => ({
2110
+ ...$,
1527
2111
  isResizing: !0,
1528
- resizingColumn: f
2112
+ resizingColumn: p
1529
2113
  }));
1530
2114
  },
1531
- [n, o.columnWidths]
1532
- ), T = w(
1533
- (f) => {
1534
- const { resizingColumn: x, isResizing: C } = o;
1535
- if (!(C && x)) return;
1536
- const W = f - u.current, p = Math.max(100, Math.min(800, c.current + W));
1537
- E(n, 2, "リサイズ中:", x, "new width:", p), i((g) => ({
1538
- ...g,
2115
+ [e, r.columnWidths]
2116
+ ), q = k(
2117
+ (p) => {
2118
+ const { resizingColumn: x, isResizing: $ } = r;
2119
+ if (!($ && x)) return;
2120
+ const W = p - i.current, v = Math.max(100, Math.min(800, d.current + W));
2121
+ M(e, 2, "リサイズ中:", x, "new width:", v), a((y) => ({
2122
+ ...y,
1539
2123
  columnWidths: {
1540
- ...g.columnWidths,
1541
- [x]: p
2124
+ ...y.columnWidths,
2125
+ [x]: v
1542
2126
  }
1543
2127
  }));
1544
2128
  },
1545
- [n, o]
1546
- ), y = w(() => {
1547
- E(n, 2, "リサイズ終了"), i((f) => ({
1548
- ...f,
2129
+ [e, r]
2130
+ ), j = k(() => {
2131
+ M(e, 2, "リサイズ終了"), a((p) => ({
2132
+ ...p,
1549
2133
  isResizing: !1,
1550
2134
  resizingColumn: null
1551
2135
  }));
1552
- }, [n]), l = w(
1553
- (f, x) => {
1554
- E(n, 2, "カラム幅設定:", f, x), i((C) => ({
1555
- ...C,
2136
+ }, [e]), E = k(
2137
+ (p, x) => {
2138
+ M(e, 2, "カラム幅設定:", p, x), a(($) => ({
2139
+ ...$,
1556
2140
  columnWidths: {
1557
- ...C.columnWidths,
1558
- [f]: Math.max(100, Math.min(800, x))
2141
+ ...$.columnWidths,
2142
+ [p]: Math.max(100, Math.min(800, x))
1559
2143
  }
1560
2144
  }));
1561
2145
  },
1562
- [n]
1563
- ), j = w(() => {
1564
- E(n, 1, "カラム幅リセット"), i((f) => {
2146
+ [e]
2147
+ ), C = k(() => {
2148
+ M(e, 1, "カラム幅リセット"), a((p) => {
1565
2149
  const x = {};
1566
- for (const C of f.columns)
1567
- x[C.id] = C.initialWidth || 400;
2150
+ for (const $ of p.columns)
2151
+ x[$.id] = $.initialWidth || 400;
1568
2152
  return {
1569
- ...f,
2153
+ ...p,
1570
2154
  columnWidths: x
1571
2155
  };
1572
2156
  });
1573
- }, [n]), k = w(
1574
- (f, x, C, W) => {
1575
- E(n, 1, "パネル移動:", f, "from", x, "to", C, "at", W), i((p) => {
1576
- const g = { ...p.columnPanels };
1577
- if (x in g && (g[x] = g[x].filter((m) => m !== f)), C in g) {
1578
- const m = [...g[C]];
1579
- m.splice(W, 0, f), g[C] = m;
2157
+ }, [e]), T = k(
2158
+ (p, x, $, W) => {
2159
+ M(e, 1, "パネル移動:", p, "from", x, "to", $, "at", W), a((v) => {
2160
+ const y = { ...v.columnPanels };
2161
+ if (x in y && (y[x] = y[x].filter((g) => g !== p)), $ in y) {
2162
+ const g = [...y[$]];
2163
+ g.splice(W, 0, p), y[$] = g;
1580
2164
  }
1581
2165
  return {
1582
- ...p,
1583
- columnPanels: g
2166
+ ...v,
2167
+ columnPanels: y
1584
2168
  };
1585
2169
  });
1586
2170
  },
1587
- [n]
1588
- ), _ = w(
1589
- (f, x, C) => {
1590
- E(n, 1, "パネル追加:", f, "to column:", x), i((W) => {
1591
- const p = { ...W.columnPanels };
1592
- x in p || (p[x] = []);
1593
- const g = [...p[x]], m = C ?? g.length;
1594
- return g.splice(m, 0, f), p[x] = g, {
2171
+ [e]
2172
+ ), h = k(
2173
+ (p, x, $) => {
2174
+ M(e, 1, "パネル追加:", p, "to column:", x), a((W) => {
2175
+ const v = { ...W.columnPanels };
2176
+ x in v || (v[x] = []);
2177
+ const y = [...v[x]], g = $ ?? y.length;
2178
+ return y.splice(g, 0, p), v[x] = y, {
1595
2179
  ...W,
1596
- columnPanels: p
2180
+ columnPanels: v
1597
2181
  };
1598
2182
  });
1599
2183
  },
1600
- [n]
1601
- ), R = w(
1602
- (f) => {
1603
- E(n, 1, "パネル削除:", f), i((x) => {
1604
- const C = {};
1605
- for (const [W, p] of Object.entries(x.columnPanels))
1606
- C[W] = p.filter((g) => g !== f);
2184
+ [e]
2185
+ ), P = k(
2186
+ (p) => {
2187
+ M(e, 1, "パネル削除:", p), a((x) => {
2188
+ const $ = {};
2189
+ for (const [W, v] of Object.entries(x.columnPanels))
2190
+ $[W] = v.filter((y) => y !== p);
1607
2191
  return {
1608
2192
  ...x,
1609
- columnPanels: C
2193
+ columnPanels: $
1610
2194
  };
1611
2195
  });
1612
2196
  },
1613
- [n]
1614
- ), z = w(
1615
- (f) => {
1616
- E(n, 1, "カラム数更新:", f), i((x) => {
1617
- const C = x.columns.length;
1618
- if (f === C) return x;
1619
- const W = Wt(x.columnPanels, f, ie), p = Qe(f, ie), g = x.isResizing && x.resizingColumn && !p.includes(x.resizingColumn);
1620
- g && E(n, 1, "リサイズ中のカラムが削除されるためリサイズを強制終了:", x.resizingColumn);
1621
- const m = p.map((O, H) => ({
1622
- id: O,
1623
- title: `カラム ${H + 1}`,
2197
+ [e]
2198
+ ), N = k(
2199
+ (p) => {
2200
+ M(e, 1, "カラム数更新:", p), a((x) => {
2201
+ const $ = x.columns.length;
2202
+ if (p === $) return x;
2203
+ const W = $r(x.columnPanels, p, fe), v = nn(p, fe), y = x.isResizing && x.resizingColumn && !v.includes(x.resizingColumn);
2204
+ y && M(e, 1, "リサイズ中のカラムが削除されるためリサイズを強制終了:", x.resizingColumn);
2205
+ const g = v.map((F, X) => ({
2206
+ id: F,
2207
+ title: `カラム ${X + 1}`,
1624
2208
  minWidth: 350,
1625
2209
  maxWidth: 800,
1626
2210
  initialWidth: 400,
1627
- resizable: !(H === 1 && f === 3)
1628
- })), v = {};
1629
- if (Object.entries(x.columnWidths).some(([, O]) => O !== 400))
1630
- p.forEach((O) => {
1631
- const H = x.columnWidths[O];
1632
- H && H !== 400 ? v[O] = H : v[O] = 400;
2211
+ resizable: !(X === 1 && p === 3)
2212
+ })), D = {};
2213
+ if (Object.entries(x.columnWidths).some(([, F]) => F !== 400))
2214
+ v.forEach((F) => {
2215
+ const X = x.columnWidths[F];
2216
+ X && X !== 400 ? D[F] = X : D[F] = 400;
1633
2217
  });
1634
2218
  else {
1635
- const O = C > f ? Object.values(x.columnWidths).reduce((a, d) => a + d, 0) : f * 400, H = Math.max(O / f, 350);
1636
- p.forEach((a) => {
1637
- v[a] = H;
2219
+ const F = $ > p ? Object.values(x.columnWidths).reduce((u, f) => u + f, 0) : p * 400, X = Math.max(F / p, 350);
2220
+ v.forEach((u) => {
2221
+ D[u] = X;
1638
2222
  });
1639
2223
  }
1640
2224
  return {
1641
2225
  ...x,
1642
- columns: m,
2226
+ columns: g,
1643
2227
  columnPanels: W,
1644
- columnWidths: v,
1645
- isResizing: g ? !1 : x.isResizing,
1646
- resizingColumn: g ? null : x.resizingColumn
2228
+ columnWidths: D,
2229
+ isResizing: y ? !1 : x.isResizing,
2230
+ resizingColumn: y ? null : x.resizingColumn
1647
2231
  };
1648
2232
  });
1649
2233
  },
1650
- [n]
1651
- ), Z = w(() => {
1652
- E(n, 1, "カラム自動バランス調整"), i((f) => {
2234
+ [e]
2235
+ ), l = k(() => {
2236
+ M(e, 1, "カラム自動バランス調整"), a((p) => {
1653
2237
  const x = [];
1654
- for (const p of Object.keys(f.columnPanels))
1655
- for (const g of f.columnPanels[p])
1656
- x.push(g);
1657
- const C = {};
1658
- for (const p of f.columns)
1659
- C[p.id] = [];
2238
+ for (const v of Object.keys(p.columnPanels))
2239
+ for (const y of p.columnPanels[v])
2240
+ x.push(y);
2241
+ const $ = {};
2242
+ for (const v of p.columns)
2243
+ $[v.id] = [];
1660
2244
  let W = 0;
1661
- for (const p of x) {
1662
- const g = f.columns[W % f.columns.length].id;
1663
- C[g].push(p), W += 1;
2245
+ for (const v of x) {
2246
+ const y = p.columns[W % p.columns.length].id;
2247
+ $[y].push(v), W += 1;
1664
2248
  }
1665
2249
  return {
1666
- ...f,
1667
- columnPanels: C
2250
+ ...p,
2251
+ columnPanels: $
1668
2252
  };
1669
2253
  });
1670
- }, [n]), Y = w(
1671
- (f) => o.columns.find((x) => x.id === f),
1672
- [o.columns]
1673
- ), U = w(() => {
1674
- let f = 0;
1675
- for (const x of Object.values(o.columnWidths))
1676
- f += x;
1677
- return f;
1678
- }, [o.columnWidths]), $ = w((f) => document.querySelector(`[data-column-id="${f}"]`), []), L = w((f) => {
1679
- i((x) => ({
2254
+ }, [e]), _ = k(
2255
+ (p) => r.columns.find((x) => x.id === p),
2256
+ [r.columns]
2257
+ ), L = k(() => {
2258
+ let p = 0;
2259
+ for (const x of Object.values(r.columnWidths))
2260
+ p += x;
2261
+ return p;
2262
+ }, [r.columnWidths]), B = k((p) => document.querySelector(`[data-column-id="${p}"]`), []), J = k((p) => {
2263
+ a((x) => ({
1680
2264
  ...x,
1681
- showInsertPlaceholders: f
2265
+ showInsertPlaceholders: p
1682
2266
  }));
1683
2267
  }, []);
1684
2268
  return {
1685
- layoutState: o,
1686
- addColumn: h,
1687
- removeColumn: N,
2269
+ layoutState: r,
2270
+ addColumn: m,
2271
+ removeColumn: w,
1688
2272
  moveColumn: b,
1689
- startResize: M,
1690
- handleResize: T,
1691
- endResize: y,
1692
- setColumnWidth: l,
1693
- resetColumnWidths: j,
1694
- movePanel: k,
1695
- addPanel: _,
1696
- removePanel: R,
1697
- updateColumnCount: z,
1698
- autoBalanceColumns: Z,
1699
- getColumnById: Y,
1700
- getTotalWidth: U,
1701
- getColumnElement: $,
1702
- setShowInsertPlaceholders: L
2273
+ startResize: A,
2274
+ handleResize: q,
2275
+ endResize: j,
2276
+ setColumnWidth: E,
2277
+ resetColumnWidths: C,
2278
+ movePanel: T,
2279
+ addPanel: h,
2280
+ removePanel: P,
2281
+ updateColumnCount: N,
2282
+ autoBalanceColumns: l,
2283
+ getColumnById: _,
2284
+ getTotalWidth: L,
2285
+ getColumnElement: B,
2286
+ setShowInsertPlaceholders: J
1703
2287
  };
1704
- }, ke = {
1705
- triggerDistance: 80,
1706
- scrollSpeed: 5,
1707
- maxScrollSpeed: 20
1708
- }, He = (r, e, n = ke, s) => {
1709
- const { triggerDistance: o, scrollSpeed: i, maxScrollSpeed: u } = n;
1710
- let c;
1711
- s ? c = s.getBoundingClientRect() : c = new DOMRect(0, 0, window.innerWidth, window.innerHeight);
1712
- const { left: h, top: N, right: b, bottom: M } = c;
1713
- let T = 0, y = 0;
1714
- if (r >= h && r <= b && e >= N && e <= M) {
1715
- if (r < h + o) {
1716
- const l = Math.max(0, (h + o - r) / o);
1717
- T = -Math.min(u, i + l * (u - i));
1718
- } else if (r > b - o) {
1719
- const l = Math.max(0, (r - (b - o)) / o);
1720
- T = Math.min(u, i + l * (u - i));
1721
- }
1722
- if (e < N + o) {
1723
- const l = Math.max(0, (N + o - e) / o);
1724
- y = -Math.min(u, i + l * (u - i));
1725
- } else if (e > M - o) {
1726
- const l = Math.max(0, (e - (M - o)) / o);
1727
- y = Math.min(u, i + l * (u - i));
1728
- }
1729
- }
1730
- return { x: T, y };
1731
- }, zt = (r, e) => {
1732
- (r.x !== 0 || r.y !== 0) && (e ? e.scrollBy(r.x, r.y) : window.scrollBy(r.x, r.y));
1733
- };
1734
- class Ke {
1735
- constructor(e = ke, n) {
1736
- this.intervalId = null, this.isActive = !1, this.config = e, this.scrollElement = n;
1737
- }
1738
- setScrollElement(e) {
1739
- this.scrollElement = e;
1740
- }
1741
- start(e, n) {
1742
- this.isActive || (this.isActive = !0, this.intervalId = window.setInterval(() => {
1743
- const s = He(e, n, this.config, this.scrollElement);
1744
- zt(s, this.scrollElement);
1745
- }, 16));
1746
- }
1747
- update(e, n) {
1748
- const s = He(e, n, this.config, this.scrollElement);
1749
- (s.x !== 0 || s.y !== 0) && !this.isActive ? this.start(e, n) : s.x === 0 && s.y === 0 && this.isActive && this.stop();
1750
- }
1751
- stop() {
1752
- this.intervalId !== null && (clearInterval(this.intervalId), this.intervalId = null), this.isActive = !1;
1753
- }
1754
- isScrolling() {
1755
- return this.isActive;
1756
- }
1757
- updateConfig(e) {
1758
- this.config = e;
1759
- }
1760
- }
1761
- const Yt = ({
1762
- debugConfig: r,
1763
- dragState: e,
1764
- customDrag: n,
1765
- clickState: s,
1766
- dragModes: o,
1767
- isMouseDown: i,
1768
- dragOverPosition: u,
1769
- setCustomDrag: c,
1770
- setDragState: h,
1771
- setDragOverPosition: N,
2288
+ }, Tr = ({
2289
+ debugConfig: t,
2290
+ dragState: n,
2291
+ customDrag: e,
2292
+ clickState: o,
2293
+ dragModes: r,
2294
+ isMouseDown: a,
2295
+ dragOverPosition: i,
2296
+ setCustomDrag: d,
2297
+ setDragState: m,
2298
+ setDragOverPosition: w,
1772
2299
  setOriginalPanelPosition: b,
1773
- setClickState: M,
1774
- setIsMouseDown: T,
1775
- findPanelPosition: y,
1776
- performPanelMove: l,
1777
- showMousePosition: j,
1778
- updateMousePosition: k,
1779
- recordMouseDown: _,
1780
- recordClickPosition: R,
1781
- isVirtualClick: z,
1782
- calculateMoveDistance: Z,
1783
- clearMouseTracking: Y,
1784
- resetDragState: U,
1785
- resetClickState: $,
1786
- createDragImage: L,
1787
- updateDragImagePosition: f,
2300
+ setClickState: A,
2301
+ setIsMouseDown: q,
2302
+ findPanelPosition: j,
2303
+ performPanelMove: E,
2304
+ showMousePosition: C,
2305
+ updateMousePosition: T,
2306
+ recordMouseDown: h,
2307
+ recordClickPosition: P,
2308
+ isVirtualClick: N,
2309
+ calculateMoveDistance: l,
2310
+ clearMouseTracking: _,
2311
+ resetDragState: L,
2312
+ resetClickState: B,
2313
+ createDragImage: J,
2314
+ updateDragImagePosition: p,
1788
2315
  removeDragImage: x,
1789
- handlePlaceholderDragEnter: C,
2316
+ handlePlaceholderDragEnter: $,
1790
2317
  handlePlaceholderDragLeave: W
1791
2318
  }) => {
1792
- const p = F(r);
1793
- p.current = r;
1794
- const g = F(null), m = F(null), v = F(0), D = F(new Ke(ke));
1795
- K(() => {
1796
- const d = document.querySelector("main[data-aqdd-scroll-root]");
1797
- d && D.current.setScrollElement(d);
2319
+ const v = I(t);
2320
+ v.current = t;
2321
+ const y = I(null), g = I(null), D = I(0), R = I(new rt(Me));
2322
+ oe(() => {
2323
+ const f = document.querySelector(Zt);
2324
+ f && R.current.setScrollElement(f);
1798
2325
  }, []);
1799
- const A = F(u);
1800
- K(() => {
1801
- A.current = u, E(p.current, 2, "dragOverPositionRef更新:", u);
1802
- }, [u]);
1803
- const O = w(
1804
- (d) => {
1805
- if (n.isActive || s.isClicked) {
1806
- d.preventDefault();
2326
+ const Y = I(i);
2327
+ oe(() => {
2328
+ Y.current = i, M(v.current, 2, "dragOverPositionRef更新:", i);
2329
+ }, [i]);
2330
+ const F = k(
2331
+ (f) => {
2332
+ if (e.isActive || o.isClicked) {
2333
+ f.preventDefault();
1807
2334
  const S = window.getSelection();
1808
2335
  S && S.rangeCount > 0 && S.removeAllRanges();
1809
2336
  }
1810
- if (n.isActive) {
1811
- k(d.clientX, d.clientY), f(d.clientX, d.clientY), D.current.update(d.clientX, d.clientY);
1812
- const S = document.elementFromPoint(d.clientX, d.clientY), X = S?.closest("[data-drop-zone]");
1813
- if (X) {
2337
+ if (e.isActive) {
2338
+ T(f.clientX, f.clientY), p(f.clientX, f.clientY), R.current.update(f.clientX, f.clientY);
2339
+ const S = document.elementFromPoint(f.clientX, f.clientY), U = S?.closest("[data-drop-zone]");
2340
+ if (U) {
1814
2341
  document.body.classList.add("droppable");
1815
- const G = X.getAttribute("data-column-index"), Q = G ? parseInt(G, 10) : null;
1816
- Q !== null && Q !== e.dragOverColumn && h((re) => ({ ...re, dragOverColumn: Q }));
1817
- const V = S?.closest("[data-placeholder-index]");
1818
- if (V) {
1819
- const re = V.getAttribute("data-placeholder-index"), ce = V.getAttribute("data-placeholder-column");
1820
- if (re && ce) {
1821
- const se = parseInt(re, 10), ge = parseInt(ce, 10);
1822
- C(ge, se);
2342
+ const K = U.getAttribute("data-column-index"), ae = K ? parseInt(K, 10) : null;
2343
+ ae !== null && ae !== n.dragOverColumn && m((H) => ({ ...H, dragOverColumn: ae }));
2344
+ const G = S?.closest("[data-placeholder-index]");
2345
+ if (G) {
2346
+ const H = G.getAttribute("data-placeholder-index"), ve = G.getAttribute("data-placeholder-column");
2347
+ if (H && ve) {
2348
+ const ue = parseInt(H, 10), pe = parseInt(ve, 10);
2349
+ $(pe, ue);
1823
2350
  }
1824
2351
  } else
1825
2352
  W();
1826
2353
  } else
1827
- document.body.classList.remove("droppable"), N(null), h((G) => ({ ...G, dragOverColumn: null }));
1828
- } else if (i && s.isClicked && s.panelId) {
1829
- if (o[s.panelId] !== "custom" || Z(d.clientX, d.clientY) < 10) return;
1830
- E(p.current, 1, "🚀 カスタムドラッグ開始 -", s.panelId);
1831
- const X = document.querySelector(`[data-panel-id="${s.panelId}"]`);
1832
- if (X && m.current) {
1833
- const G = X.getBoundingClientRect(), Q = m.current.x - G.left, V = m.current.y - G.top;
1834
- L(s.panelId, Q, V), document.body.classList.add("custom-dragging"), c({
2354
+ document.body.classList.remove("droppable"), w(null), m((K) => ({ ...K, dragOverColumn: null }));
2355
+ } else if (a && o.isClicked && o.panelId) {
2356
+ if (r[o.panelId] !== "custom" || l(f.clientX, f.clientY) < 10) return;
2357
+ M(v.current, 1, "🚀 カスタムドラッグ開始 -", o.panelId);
2358
+ const U = document.querySelector(`[data-panel-id="${o.panelId}"]`);
2359
+ if (U && g.current) {
2360
+ const K = U.getBoundingClientRect(), ae = g.current.x - K.left, G = g.current.y - K.top;
2361
+ J(o.panelId, ae, G), document.body.classList.add("custom-dragging"), d({
1835
2362
  isActive: !0,
1836
- panelId: s.panelId,
1837
- startX: Q,
1838
- startY: V
2363
+ panelId: o.panelId,
2364
+ startX: ae,
2365
+ startY: G
1839
2366
  });
1840
2367
  }
1841
- h({ isDragging: !0, draggedPanel: s.panelId, dragOverColumn: null }), b(y(s.panelId)), j(d.clientX, d.clientY), M({ isClicked: !1, panelId: null }), T(!1), Y(), m.current = null, g.current && (clearTimeout(g.current), g.current = null);
2368
+ m({ isDragging: !0, draggedPanel: o.panelId, dragOverColumn: null }), b(j(o.panelId)), C(f.clientX, f.clientY), A({ isClicked: !1, panelId: null }), q(!1), _(), g.current = null, y.current && (clearTimeout(y.current), y.current = null);
1842
2369
  }
1843
2370
  },
1844
2371
  [
1845
- n.isActive,
1846
- s,
1847
- e.dragOverColumn,
2372
+ e.isActive,
1848
2373
  o,
1849
- i,
1850
- k,
1851
- h,
1852
- N,
1853
- Z,
1854
- y,
1855
- c,
1856
- b,
1857
- j,
1858
- M,
2374
+ n.dragOverColumn,
2375
+ r,
2376
+ a,
1859
2377
  T,
1860
- Y,
1861
- L,
1862
- f,
2378
+ m,
2379
+ w,
2380
+ l,
2381
+ j,
2382
+ d,
2383
+ b,
1863
2384
  C,
2385
+ A,
2386
+ q,
2387
+ _,
2388
+ J,
2389
+ p,
2390
+ $,
1864
2391
  W
1865
2392
  ]
1866
- ), H = w(
1867
- (d) => {
1868
- if (E(p.current, 1, "🐭 カスタムドラッグハンドラー - グローバルマウスアップ", {
1869
- isActive: n.isActive,
1870
- panelId: n.panelId,
1871
- dragMode: n.panelId ? o[n.panelId] : "unknown"
1872
- }), n.isActive) {
1873
- D.current.stop();
1874
- const S = A.current;
2393
+ ), X = k(
2394
+ (f) => {
2395
+ if (M(v.current, 1, "🐭 カスタムドラッグハンドラー - グローバルマウスアップ", {
2396
+ isActive: e.isActive,
2397
+ panelId: e.panelId,
2398
+ dragMode: e.panelId ? r[e.panelId] : "unknown"
2399
+ }), e.isActive) {
2400
+ R.current.stop();
2401
+ const S = Y.current;
1875
2402
  if (S) {
1876
- const G = document.elementFromPoint(d.clientX, d.clientY)?.closest("[data-drop-zone]");
1877
- if (G) {
1878
- const Q = G.getAttribute("data-column-key");
1879
- Q && o[n.panelId] === "custom" ? (E(p.current, 1, "🔄 カスタムドラッグパネル移動実行:", n.panelId, "→", Q), l(n.panelId, Q, S.insertIndex)) : E(p.current, 1, "🚫 カスタムドラッグパネル移動スキップ:", n.panelId, "モード:", o[n.panelId]);
2403
+ const K = document.elementFromPoint(f.clientX, f.clientY)?.closest("[data-drop-zone]");
2404
+ if (K) {
2405
+ const ae = K.getAttribute("data-column-key");
2406
+ ae && r[e.panelId] === "custom" ? (M(v.current, 1, "🔄 カスタムドラッグパネル移動実行:", e.panelId, "→", ae), E(e.panelId, ae, S.insertIndex)) : M(v.current, 1, "🚫 カスタムドラッグパネル移動スキップ:", e.panelId, "モード:", r[e.panelId]);
1880
2407
  }
1881
2408
  }
1882
- x(), document.body.classList.remove("custom-dragging", "droppable"), U(), v.current = 0;
1883
- } else if (z(d.clientX, d.clientY)) {
1884
- const X = document.elementFromPoint(d.clientX, d.clientY)?.closest("[data-panel-id]"), G = X?.getAttribute("data-panel-id") ?? null;
1885
- if (!(X && G) || o[G] !== "custom") {
1886
- g.current && (clearTimeout(g.current), g.current = null), $(), m.current = null, v.current = 0;
2409
+ x(), document.body.classList.remove("custom-dragging", "droppable"), L(), D.current = 0;
2410
+ } else if (N(f.clientX, f.clientY)) {
2411
+ const U = document.elementFromPoint(f.clientX, f.clientY)?.closest("[data-panel-id]"), K = U?.getAttribute("data-panel-id") ?? null;
2412
+ if (!(U && K) || r[K] !== "custom") {
2413
+ y.current && (clearTimeout(y.current), y.current = null), B(), g.current = null, D.current = 0;
1887
2414
  return;
1888
2415
  }
1889
- v.current += 1, s.isClicked === !1 && v.current === 1 ? (E(p.current, 1, "🖱️ 仮想クリック検出 - ドラッグ待機状態へ:", G), M({ isClicked: !0, panelId: G }), g.current = window.setTimeout(() => {
1890
- E(p.current, 1, "⏳ クリック待機状態を自動解除:", G), $(), m.current = null, v.current = 0;
1891
- }, 2e3)) : (E(p.current, 1, "🚫 クリック待機状態を解除 - 仮想クリック検出停止:", G), g.current && (clearTimeout(g.current), g.current = null), $(), m.current = null, v.current = 0, g.current = window.setTimeout(() => {
1892
- E(p.current, 1, "⏳ 仮想クリック検出再開:", G);
2416
+ D.current += 1, o.isClicked === !1 && D.current === 1 ? (M(v.current, 1, "🖱️ 仮想クリック検出 - ドラッグ待機状態へ:", K), A({ isClicked: !0, panelId: K }), y.current = window.setTimeout(() => {
2417
+ M(v.current, 1, "⏳ クリック待機状態を自動解除:", K), B(), g.current = null, D.current = 0;
2418
+ }, 2e3)) : (M(v.current, 1, "🚫 クリック待機状態を解除 - 仮想クリック検出停止:", K), y.current && (clearTimeout(y.current), y.current = null), B(), g.current = null, D.current = 0, y.current = window.setTimeout(() => {
2419
+ M(v.current, 1, "⏳ 仮想クリック検出再開:", K);
1893
2420
  }, 2e3));
1894
- } else s.isClicked && ($(), m.current = null, v.current = 0);
1895
- i && T(!1);
2421
+ } else o.isClicked && (B(), g.current = null, D.current = 0);
2422
+ a && q(!1);
1896
2423
  },
1897
- [n.isActive, n.panelId, s, o, i, l, U, $, z, M, T, x]
1898
- ), a = w(
1899
- (d, S) => {
1900
- if (o[S] !== "custom") {
1901
- E(p.current, 1, "🚫 カスタムドラッグモードではない - スキップ:", S);
2424
+ [e.isActive, e.panelId, o, r, a, E, L, B, N, A, q, x]
2425
+ ), u = k(
2426
+ (f, S) => {
2427
+ if (r[S] !== "custom") {
2428
+ M(v.current, 1, "🚫 カスタムドラッグモードではない - スキップ:", S);
1902
2429
  return;
1903
2430
  }
1904
- _(d.clientX, d.clientY), s.isClicked && s.panelId === S && (T(!0), g.current !== null && (clearTimeout(g.current), g.current = null), R(d.clientX, d.clientY), m.current = { x: d.clientX, y: d.clientY });
2431
+ h(f.clientX, f.clientY), o.isClicked && o.panelId === S && (q(!0), y.current !== null && (clearTimeout(y.current), y.current = null), P(f.clientX, f.clientY), g.current = { x: f.clientX, y: f.clientY });
1905
2432
  },
1906
- [s, o, _, T, R]
2433
+ [o, r, h, q, P]
1907
2434
  );
1908
- return K(() => () => {
1909
- g.current !== null && clearTimeout(g.current), D.current.stop();
2435
+ return oe(() => () => {
2436
+ y.current !== null && clearTimeout(y.current), R.current.stop();
1910
2437
  }, []), {
1911
- handleGlobalMouseMove: O,
1912
- handleGlobalMouseUp: H,
1913
- handleMouseDown: a
2438
+ handleGlobalMouseMove: F,
2439
+ handleGlobalMouseUp: X,
2440
+ handleMouseDown: u
1914
2441
  };
1915
- }, Ft = () => {
1916
- const [r, e] = te({
2442
+ }, Rr = () => {
2443
+ const [t, n] = se({
1917
2444
  isDragging: !1,
1918
2445
  draggedPanel: null,
1919
2446
  dragOverColumn: null
1920
- }), [n, s] = te(null), [o, i] = te(null), [u, c] = te({
2447
+ }), [e, o] = se(null), [r, a] = se(null), [i, d] = se({
1921
2448
  isActive: !1,
1922
2449
  panelId: "",
1923
2450
  startX: 0,
1924
2451
  startY: 0
1925
- }), [h, N] = te({
2452
+ }), [m, w] = se({
1926
2453
  isClicked: !1,
1927
2454
  panelId: null
1928
- }), [b, M] = te({
1929
- isTouchDragging: !1,
1930
- startX: 0,
1931
- startY: 0,
1932
- currentX: 0,
1933
- currentY: 0,
1934
- draggedElement: null
1935
- }), [T, y] = te(!1), l = w(() => {
1936
- c({ isActive: !1, panelId: "", startX: 0, startY: 0 }), e({ isDragging: !1, draggedPanel: null, dragOverColumn: null }), s(null), i(null);
1937
- }, []), j = w(() => {
1938
- N({ isClicked: !1, panelId: null }), y(!1);
1939
- }, []), k = w(($) => {
1940
- e($);
1941
- }, []), _ = w(($) => {
1942
- s($);
1943
- }, []), R = w(($) => {
1944
- i($);
1945
- }, []), z = w(($) => {
1946
- c($);
1947
- }, []), Z = w(($) => {
1948
- N($);
1949
- }, []), Y = w(($) => {
1950
- M($);
1951
- }, []), U = w(($) => {
1952
- y($);
2455
+ }), [b, A] = se(!1), q = k(() => {
2456
+ d({ isActive: !1, panelId: "", startX: 0, startY: 0 }), n({ isDragging: !1, draggedPanel: null, dragOverColumn: null }), o(null), a(null);
2457
+ }, []), j = k(() => {
2458
+ w({ isClicked: !1, panelId: null }), A(!1);
2459
+ }, []), E = k((l) => {
2460
+ n(l);
2461
+ }, []), C = k((l) => {
2462
+ o(l);
2463
+ }, []), T = k((l) => {
2464
+ a(l);
2465
+ }, []), h = k((l) => {
2466
+ d(l);
2467
+ }, []), P = k((l) => {
2468
+ w(l);
2469
+ }, []), N = k((l) => {
2470
+ A(l);
1953
2471
  }, []);
1954
2472
  return {
1955
2473
  // States / 状態
1956
- dragState: r,
1957
- dragOverPosition: n,
1958
- originalPanelPosition: o,
1959
- customDrag: u,
1960
- clickState: h,
1961
- touchDragState: b,
1962
- isMouseDown: T,
2474
+ dragState: t,
2475
+ dragOverPosition: e,
2476
+ originalPanelPosition: r,
2477
+ customDrag: i,
2478
+ clickState: m,
2479
+ isMouseDown: b,
1963
2480
  // Stabilized Setters / 安定化されたセッター
1964
- setDragState: k,
1965
- setDragOverPosition: _,
1966
- setOriginalPanelPosition: R,
1967
- setCustomDrag: z,
1968
- setClickState: Z,
1969
- setTouchDragState: Y,
1970
- setIsMouseDown: U,
2481
+ setDragState: E,
2482
+ setDragOverPosition: C,
2483
+ setOriginalPanelPosition: T,
2484
+ setCustomDrag: h,
2485
+ setClickState: P,
2486
+ setIsMouseDown: N,
1971
2487
  // Utility Functions / ユーティリティ関数
1972
- resetDragState: l,
2488
+ resetDragState: q,
1973
2489
  resetClickState: j
1974
2490
  };
1975
- }, Xt = () => {
1976
- const [r, e] = te({
2491
+ }, _r = () => {
2492
+ const [t, n] = se({
1977
2493
  x: 0,
1978
2494
  y: 0,
1979
2495
  isVisible: !1
1980
- }), n = F(null), s = F(0), o = F(null), i = w((y, l) => {
1981
- e({ x: y, y: l, isVisible: !0 });
1982
- }, []), u = w(() => {
1983
- e((y) => ({ ...y, isVisible: !1 }));
1984
- }, []), c = w((y, l) => {
1985
- e((j) => j.x === y && j.y === l ? j : {
1986
- x: y,
1987
- y: l,
1988
- isVisible: j.isVisible
2496
+ }), e = I(null), o = I(0), r = I(null), a = k((j, E) => {
2497
+ n({ x: j, y: E, isVisible: !0 });
2498
+ }, []), i = k(() => {
2499
+ n((j) => ({ ...j, isVisible: !1 }));
2500
+ }, []), d = k((j, E) => {
2501
+ n((C) => C.x === j && C.y === E ? C : {
2502
+ x: j,
2503
+ y: E,
2504
+ isVisible: C.isVisible
1989
2505
  });
1990
- }, []), h = w((y, l) => {
1991
- s.current = Date.now(), o.current = { x: y, y: l };
1992
- }, []), N = w((y, l) => {
1993
- n.current = { x: y, y: l };
1994
- }, []), b = w((y, l, j = 500, k = 5) => Date.now() - (s.current || 0) >= j || !o.current ? !1 : Math.sqrt((y - o.current.x) ** 2 + (l - o.current.y) ** 2) < k, []), M = w((y, l) => {
1995
- if (!n.current)
2506
+ }, []), m = k((j, E) => {
2507
+ o.current = Date.now(), r.current = { x: j, y: E };
2508
+ }, []), w = k((j, E) => {
2509
+ e.current = { x: j, y: E };
2510
+ }, []), b = k((j, E, C = 500, T = 5) => Date.now() - (o.current || 0) >= C || !r.current ? !1 : Math.sqrt((j - r.current.x) ** 2 + (E - r.current.y) ** 2) < T, []), A = k((j, E) => {
2511
+ if (!e.current)
1996
2512
  return 0;
1997
- const j = Math.abs(y - n.current.x), k = Math.abs(l - n.current.y);
1998
- return Math.sqrt(j * j + k * k);
1999
- }, []), T = w(() => {
2000
- n.current = null, s.current = 0, o.current = null;
2513
+ const C = Math.abs(j - e.current.x), T = Math.abs(E - e.current.y);
2514
+ return Math.sqrt(C * C + T * T);
2515
+ }, []), q = k(() => {
2516
+ e.current = null, o.current = 0, r.current = null;
2001
2517
  }, []);
2002
2518
  return {
2003
- mousePosition: r,
2004
- lastClickPosition: n.current,
2005
- mouseDownTime: s.current,
2006
- mouseDownPosition: o.current,
2007
- showMousePosition: i,
2008
- hideMousePosition: u,
2009
- updateMousePosition: c,
2010
- recordMouseDown: h,
2011
- recordClickPosition: N,
2519
+ mousePosition: t,
2520
+ lastClickPosition: e.current,
2521
+ mouseDownTime: o.current,
2522
+ mouseDownPosition: r.current,
2523
+ showMousePosition: a,
2524
+ hideMousePosition: i,
2525
+ updateMousePosition: d,
2526
+ recordMouseDown: m,
2527
+ recordClickPosition: w,
2012
2528
  isVirtualClick: b,
2013
- calculateMoveDistance: M,
2014
- clearMouseTracking: T
2529
+ calculateMoveDistance: A,
2530
+ clearMouseTracking: q
2015
2531
  };
2016
- }, Ht = ({
2017
- debugConfig: r,
2018
- dragState: e,
2019
- customDrag: n,
2020
- dragModes: s,
2021
- columnPanels: o,
2022
- dragOverPosition: i,
2023
- originalPanelPosition: u,
2024
- setDragState: c,
2025
- setDragOverPosition: h,
2026
- setOriginalPanelPosition: N,
2532
+ }, Lr = ({
2533
+ debugConfig: t,
2534
+ dragState: n,
2535
+ customDrag: e,
2536
+ dragModes: o,
2537
+ columnPanels: r,
2538
+ dragOverPosition: a,
2539
+ originalPanelPosition: i,
2540
+ setDragState: d,
2541
+ setDragOverPosition: m,
2542
+ setOriginalPanelPosition: w,
2027
2543
  performPanelMove: b,
2028
- showMousePosition: M,
2029
- updateMousePosition: T,
2030
- resetDragState: y,
2031
- handlePlaceholderDragEnter: l,
2032
- handlePlaceholderDragLeave: j,
2033
- scale: k = 1
2544
+ showMousePosition: A,
2545
+ updateMousePosition: q,
2546
+ resetDragState: j,
2547
+ handlePlaceholderDragEnter: E,
2548
+ handlePlaceholderDragLeave: C,
2549
+ scale: T = 1
2034
2550
  }) => {
2035
- const _ = F(r);
2036
- _.current = r;
2037
- const R = F(o);
2038
- R.current = o;
2039
- const z = F(e);
2040
- z.current = e;
2041
- const Z = F(i);
2042
- Z.current = i;
2043
- const Y = F(u);
2044
- Y.current = u;
2045
- const U = F(k);
2046
- U.current = k;
2047
- const $ = F(new Ke(ke));
2048
- K(() => {
2049
- const p = document.querySelector("main[data-aqdd-scroll-root]");
2050
- p && $.current.setScrollElement(p);
2551
+ const h = I(t);
2552
+ h.current = t;
2553
+ const P = I(r);
2554
+ P.current = r;
2555
+ const N = I(n);
2556
+ N.current = n;
2557
+ const l = I(a);
2558
+ l.current = a;
2559
+ const _ = I(i);
2560
+ _.current = i;
2561
+ const L = I(T);
2562
+ L.current = T;
2563
+ const B = I(new rt(Me));
2564
+ oe(() => {
2565
+ const v = document.querySelector(Zt);
2566
+ v && B.current.setScrollElement(v);
2051
2567
  }, []);
2052
- const L = w(
2053
- (p, g) => {
2054
- if (n.isActive) {
2055
- E(_.current, 2, "カスタムドラッグアクティブ中 - 通常ドラッグを無効化:", g), p.preventDefault();
2568
+ const J = k(
2569
+ (v, y) => {
2570
+ if (e.isActive) {
2571
+ M(h.current, 2, "カスタムドラッグアクティブ中 - 通常ドラッグを無効化:", y), v.preventDefault();
2056
2572
  return;
2057
2573
  }
2058
- if (s[g] === "custom") {
2059
- E(_.current, 2, "カスタムドラッグモード - 通常ドラッグを無効化:", g), p.preventDefault();
2574
+ if (o[y] === "custom") {
2575
+ M(h.current, 2, "カスタムドラッグモード - 通常ドラッグを無効化:", y), v.preventDefault();
2060
2576
  return;
2061
2577
  }
2062
- E(_.current, 1, "ドラッグ開始:", g);
2063
- const m = Object.keys(R.current);
2064
- let v = null;
2065
- for (let D = 0; D < m.length; D++) {
2066
- const A = m[D], O = R.current[A].indexOf(g);
2067
- if (O !== -1) {
2068
- v = { columnIndex: D, panelIndex: O };
2578
+ M(h.current, 1, "ドラッグ開始:", y);
2579
+ const g = Object.keys(P.current);
2580
+ let D = null;
2581
+ for (let R = 0; R < g.length; R++) {
2582
+ const Y = g[R], F = P.current[Y].indexOf(y);
2583
+ if (F !== -1) {
2584
+ D = { columnIndex: R, panelIndex: F };
2069
2585
  break;
2070
2586
  }
2071
2587
  }
2072
- if (N(v), p.dataTransfer) {
2073
- p.dataTransfer.setData("text/plain", g), p.dataTransfer.effectAllowed = "move";
2074
- const D = U.current;
2075
- if (D < 1) {
2076
- const A = p.currentTarget.closest("[data-panel-id]") ?? p.currentTarget, O = A.getBoundingClientRect(), H = A.offsetWidth, a = A.offsetHeight, d = A.cloneNode(!0);
2077
- d.removeAttribute("data-panel-id"), d.removeAttribute("id"), d.style.margin = "0", d.style.width = `${H}px`, d.style.height = `${a}px`, d.style.transform = `scale(${D})`, d.style.transformOrigin = "top left";
2588
+ if (w(D), v.dataTransfer) {
2589
+ v.dataTransfer.setData("text/plain", y), v.dataTransfer.effectAllowed = "move";
2590
+ const R = L.current;
2591
+ if (R < 1) {
2592
+ const Y = v.currentTarget.closest("[data-panel-id]") ?? v.currentTarget, F = Y.getBoundingClientRect(), X = Y.offsetWidth, u = Y.offsetHeight, f = Y.cloneNode(!0);
2593
+ f.removeAttribute("data-panel-id"), f.removeAttribute("id"), Gt(Y, f), f.style.margin = "0", f.style.width = `${X}px`, f.style.height = `${u}px`, f.style.transform = `scale(${R})`, f.style.transformOrigin = "top left";
2078
2594
  const S = document.createElement("div");
2079
- S.style.position = "fixed", S.style.top = "0", S.style.left = "-10000px", S.style.width = `${H * D}px`, S.style.height = `${a * D}px`, S.style.overflow = "hidden", S.style.opacity = "0.8", S.style.pointerEvents = "none", S.appendChild(d), document.body.appendChild(S), p.dataTransfer.setDragImage(S, p.clientX - O.left, p.clientY - O.top), requestAnimationFrame(() => S.remove());
2595
+ S.style.position = "fixed", S.style.top = "0", S.style.left = "-10000px", S.style.width = `${X * R}px`, S.style.height = `${u * R}px`, S.style.overflow = "hidden", S.style.opacity = "0.8", S.style.pointerEvents = "none", S.appendChild(f), document.body.appendChild(S), v.dataTransfer.setDragImage(S, v.clientX - F.left, v.clientY - F.top), requestAnimationFrame(() => S.remove());
2080
2596
  }
2081
2597
  }
2082
- M(p.clientX, p.clientY), requestAnimationFrame(() => {
2083
- c({
2598
+ A(v.clientX, v.clientY), requestAnimationFrame(() => {
2599
+ d({
2084
2600
  isDragging: !0,
2085
- draggedPanel: g,
2601
+ draggedPanel: y,
2086
2602
  dragOverColumn: null
2087
2603
  });
2088
2604
  });
2089
2605
  },
2090
- [s, n.isActive, N, M, c]
2091
- ), f = w(() => {
2092
- E(_.current, 1, "ドラッグ終了"), $.current.stop(), y();
2093
- }, [y]), x = w(
2094
- (p, g) => {
2095
- if (p.preventDefault(), p.dataTransfer.dropEffect = "move", !z.current.isDragging) return;
2096
- T(p.clientX, p.clientY), g !== z.current.dragOverColumn && c((D) => ({ ...D, dragOverColumn: g }));
2097
- const m = document.elementFromPoint(p.clientX, p.clientY), v = m?.closest("[data-placeholder-index]");
2098
- if (v) {
2099
- const D = v.getAttribute("data-placeholder-index"), A = v.getAttribute("data-placeholder-column");
2100
- if (D && A) {
2101
- const O = parseInt(D, 10), H = parseInt(A, 10);
2102
- l(H, O);
2606
+ [o, e.isActive, w, A, d]
2607
+ ), p = k(() => {
2608
+ M(h.current, 1, "ドラッグ終了"), B.current.stop(), j();
2609
+ }, [j]), x = k(
2610
+ (v, y) => {
2611
+ if (v.preventDefault(), v.dataTransfer.dropEffect = "move", !N.current.isDragging) return;
2612
+ q(v.clientX, v.clientY), y !== N.current.dragOverColumn && d((R) => ({ ...R, dragOverColumn: y }));
2613
+ const g = document.elementFromPoint(v.clientX, v.clientY), D = g?.closest("[data-placeholder-index]");
2614
+ if (D) {
2615
+ const R = D.getAttribute("data-placeholder-index"), Y = D.getAttribute("data-placeholder-column");
2616
+ if (R && Y) {
2617
+ const F = parseInt(R, 10), X = parseInt(Y, 10);
2618
+ E(X, F);
2103
2619
  }
2104
2620
  } else
2105
- m?.closest("[data-drop-zone]") || j();
2621
+ g?.closest("[data-drop-zone]") || C();
2106
2622
  },
2107
- [T, c, l, j]
2108
- ), C = w(
2109
- (p, g) => {
2110
- p.preventDefault();
2111
- const m = p.dataTransfer.getData("text/plain"), v = Z.current;
2112
- m && v && (E(_.current, 1, "🎯 ドロップ完了:", {
2113
- draggedPanel: m,
2114
- targetColumn: g,
2115
- insertPosition: `カラム${v.columnIndex} - 位置${v.insertIndex}`
2116
- }), b(m, g, v.insertIndex), h(null), f());
2623
+ [q, d, E, C]
2624
+ ), $ = k(
2625
+ (v, y) => {
2626
+ v.preventDefault();
2627
+ const g = v.dataTransfer.getData("text/plain"), D = l.current;
2628
+ g && D && (M(h.current, 1, "🎯 ドロップ完了:", {
2629
+ draggedPanel: g,
2630
+ targetColumn: y,
2631
+ insertPosition: `カラム${D.columnIndex} - 位置${D.insertIndex}`
2632
+ }), b(g, y, D.insertIndex), m(null), p());
2117
2633
  },
2118
- [b, h, f]
2119
- ), W = w(
2120
- (p) => {
2121
- const g = p.currentTarget, m = p.relatedTarget;
2122
- m && g.contains(m) || (h(null), c((v) => ({ ...v, dragOverColumn: null })));
2634
+ [b, m, p]
2635
+ ), W = k(
2636
+ (v) => {
2637
+ const y = v.currentTarget, g = v.relatedTarget;
2638
+ g && y.contains(g) || (m(null), d((D) => ({ ...D, dragOverColumn: null })));
2123
2639
  },
2124
- [h, c]
2640
+ [m, d]
2125
2641
  );
2126
- return K(() => {
2127
- const p = (g) => {
2128
- z.current.isDragging && (T(g.clientX, g.clientY), $.current.update(g.clientX, g.clientY));
2642
+ return oe(() => {
2643
+ const v = (y) => {
2644
+ N.current.isDragging && (q(y.clientX, y.clientY), B.current.update(y.clientX, y.clientY));
2129
2645
  };
2130
- if (e.isDragging)
2131
- return document.addEventListener("dragover", p), () => {
2132
- document.removeEventListener("dragover", p), $.current.stop();
2646
+ if (n.isDragging)
2647
+ return document.addEventListener("dragover", v), () => {
2648
+ document.removeEventListener("dragover", v), B.current.stop();
2133
2649
  };
2134
- }, [e.isDragging, T]), K(() => () => {
2135
- $.current.stop();
2650
+ }, [n.isDragging, q]), oe(() => () => {
2651
+ B.current.stop();
2136
2652
  }, []), {
2137
- handleDragStart: L,
2138
- handleDragEnd: f,
2653
+ handleDragStart: J,
2654
+ handleDragEnd: p,
2139
2655
  handleDragOverWithInsert: x,
2140
- handleDropWithInsert: C,
2656
+ handleDropWithInsert: $,
2141
2657
  handleColumnDragLeave: W
2142
2658
  };
2143
- }, qt = (r, e = 1) => {
2144
- const [n, s] = te(r), [o, i] = te({}), u = F({}), c = F(null), h = F({ x: 0, y: 0 }), N = F(e);
2145
- N.current = e;
2146
- const b = w((R) => document.querySelector(`[data-panel-id="${R}"]`), []), M = w(
2147
- (R, z) => {
2148
- const Z = z.getBoundingClientRect(), Y = window.getComputedStyle(z), U = {
2149
- width: Math.round(Z.width),
2150
- height: Math.round(Z.height),
2151
- x: Math.round(Z.left),
2152
- y: Math.round(Z.top),
2153
- minHeight: Y.minHeight || "auto",
2154
- maxHeight: Y.maxHeight || "none"
2155
- }, $ = u.current[R];
2156
- (!$ || Object.keys(U).some((L) => $[L] !== U[L])) && (u.current[R] = U, i((L) => ({
2157
- ...L,
2158
- [R]: U
2659
+ }, zr = (t, n = 1) => {
2660
+ const [e, o] = se(t), [r, a] = se({}), i = I({}), d = I(null), m = I({ x: 0, y: 0 }), w = I(n);
2661
+ w.current = n;
2662
+ const b = k((P) => document.querySelector(`[data-panel-id="${P}"]`), []), A = k(
2663
+ (P, N) => {
2664
+ const l = N.getBoundingClientRect(), _ = window.getComputedStyle(N), L = {
2665
+ width: Math.round(l.width),
2666
+ height: Math.round(l.height),
2667
+ x: Math.round(l.left),
2668
+ y: Math.round(l.top),
2669
+ minHeight: _.minHeight || "auto",
2670
+ maxHeight: _.maxHeight || "none"
2671
+ }, B = i.current[P];
2672
+ (!B || Object.keys(L).some((J) => B[J] !== L[J])) && (i.current[P] = L, a((J) => ({
2673
+ ...J,
2674
+ [P]: L
2159
2675
  })));
2160
2676
  },
2161
2677
  []
2162
2678
  // setPanelSizes は React の state セッターなので依存配列に含める必要はありません
2163
- ), T = w(
2164
- (R) => {
2165
- const z = b(R);
2166
- z && M(R, z);
2679
+ ), q = k(
2680
+ (P) => {
2681
+ const N = b(P);
2682
+ N && A(P, N);
2167
2683
  },
2168
- [b, M]
2169
- ), y = w(
2170
- (R, z) => {
2171
- z && requestAnimationFrame(() => M(R, z));
2684
+ [b, A]
2685
+ ), j = k(
2686
+ (P, N) => {
2687
+ N && requestAnimationFrame(() => A(P, N));
2172
2688
  },
2173
- [M]
2174
- ), l = w(
2175
- (R, z, Z) => {
2176
- const Y = b(R);
2177
- if (!Y || c.current) return;
2178
- const U = N.current, $ = Y.getBoundingClientRect(), L = Y.cloneNode(!0);
2179
- L.removeAttribute("data-panel-id"), L.style.position = "fixed", L.style.top = "0px", L.style.left = "0px", L.style.width = `${Y.offsetWidth}px`, L.style.height = `${Y.offsetHeight}px`, L.style.pointerEvents = "none", L.style.zIndex = "1000", L.style.opacity = "0.5", L.style.margin = "0", L.style.transition = "none", L.style.boxShadow = "0 8px 32px rgba(0,0,0,0.3)", L.style.transformOrigin = "top left", L.style.transform = `translate(${$.left}px, ${$.top}px) scale(${U})`, L.id = `drag-image-${R}`, document.body.appendChild(L), c.current = L, h.current = { x: z, y: Z };
2689
+ [A]
2690
+ ), E = k(
2691
+ (P, N, l) => {
2692
+ const _ = b(P);
2693
+ !_ || d.current || (d.current = Kt(_, P, w.current), m.current = { x: N, y: l });
2180
2694
  },
2181
2695
  [b]
2182
- ), j = w((R, z) => {
2183
- if (c.current) {
2184
- const Z = R - h.current.x, Y = z - h.current.y;
2185
- c.current.style.transform = `translate(${Z}px, ${Y}px) scale(${N.current * 1.05})`;
2186
- }
2187
- }, []), k = w(() => {
2188
- c.current && (c.current.remove(), c.current = null);
2189
- }, []), _ = w((R) => {
2190
- s((z) => ({
2191
- ...z,
2192
- [R]: !z[R]
2696
+ ), C = k((P, N) => {
2697
+ d.current && Jt(d.current, P, N, m.current, w.current);
2698
+ }, []), T = k(() => {
2699
+ d.current && (d.current.remove(), d.current = null);
2700
+ }, []), h = k((P) => {
2701
+ o((N) => ({
2702
+ ...N,
2703
+ [P]: !N[P]
2193
2704
  }));
2194
2705
  }, []);
2195
2706
  return {
2196
2707
  // State / 状態
2197
- panelVisibility: n,
2198
- panelSizes: o,
2708
+ panelVisibility: e,
2709
+ panelSizes: r,
2199
2710
  // State update functions / 状態更新関数
2200
- setPanelVisibility: s,
2201
- setPanelSizes: i,
2202
- setPanelRef: y,
2203
- updatePanelSize: T,
2204
- togglePanelVisibility: _,
2711
+ setPanelVisibility: o,
2712
+ setPanelSizes: a,
2713
+ setPanelRef: j,
2714
+ updatePanelSize: q,
2715
+ togglePanelVisibility: h,
2205
2716
  // Utility functions / ユーティリティ関数
2206
2717
  getPanelElement: b,
2207
2718
  // Functions for drag image management / ドラッグイメージ管理用の関数
2208
- createDragImage: l,
2209
- updateDragImagePosition: j,
2210
- removeDragImage: k
2719
+ createDragImage: E,
2720
+ updateDragImagePosition: C,
2721
+ removeDragImage: T
2211
2722
  };
2212
- }, on = ({ initialColumnPanels: r, initialPanelVisibility: e, initialDragModes: n = {}, debugConfig: s, onPanelMove: o, onDragModeChange: i, onColumnPanelsChange: u, scale: c = 1 }) => {
2213
- const h = F(s);
2214
- h.current = s;
2215
- const [N, b] = te(r), [M, T] = te(n), y = F(N);
2216
- y.current = N;
2217
- const l = Ft(), j = Xt(), k = qt(e, c), _ = F({
2723
+ }, eo = ({ initialColumnPanels: t, initialPanelVisibility: n, initialDragModes: e = {}, debugConfig: o, onPanelMove: r, onDragModeChange: a, onColumnPanelsChange: i, scale: d = 1 }) => {
2724
+ const m = I(o);
2725
+ m.current = o;
2726
+ const [w, b] = se(t), [A, q] = se(e), j = I(w), E = I(A), C = k((g) => {
2727
+ if (typeof g == "function") throw new TypeError("setColumnPanels takes the next arrangement itself, not an updater function");
2728
+ j.current = g, b(g);
2729
+ }, []), T = k((g) => {
2730
+ if (typeof g == "function") throw new TypeError("setDragModes takes the next drag modes themselves, not an updater function");
2731
+ E.current = g, q(g);
2732
+ }, []), h = Rr(), P = _r(), N = zr(n, d), l = I({
2218
2733
  mousemove: null,
2219
2734
  mouseup: null
2220
- }), R = w((m) => {
2221
- const v = Object.keys(y.current), D = Lt(v, ie);
2222
- for (let A = 0; A < D.length; A++) {
2223
- const O = D[A], H = y.current[O]?.indexOf(m) ?? -1;
2224
- if (H !== -1)
2225
- return { columnIndex: A, panelIndex: H };
2735
+ }), _ = k((g) => {
2736
+ const D = Object.keys(j.current), R = Ar(D, fe);
2737
+ for (let Y = 0; Y < R.length; Y++) {
2738
+ const F = R[Y], X = j.current[F]?.indexOf(g) ?? -1;
2739
+ if (X !== -1)
2740
+ return { columnIndex: Y, panelIndex: X };
2226
2741
  }
2227
2742
  return null;
2228
- }, []), z = w(
2229
- (m, v, D) => {
2230
- E(h.current, 1, "🔄 パネル移動実行:", m, "→", v, "@", D), b((A) => {
2231
- const O = { ...A }, H = Object.keys(O).find((a) => O[a].includes(m));
2232
- if (!H)
2233
- return console.error("Source column not found for panel:", m), A;
2234
- if (!O[v])
2235
- return console.error("Target column not found:", v), A;
2236
- if (H === v) {
2237
- const a = [...O[H]], d = a.indexOf(m), [S] = a.splice(d, 1), X = d < D ? D - 1 : D;
2238
- a.splice(X, 0, S), O[v] = a;
2239
- } else {
2240
- O[H] = O[H].filter((d) => d !== m);
2241
- const a = [...O[v]];
2242
- a.splice(D, 0, m), O[v] = a;
2743
+ }, []), L = k(
2744
+ (g, D, R) => {
2745
+ M(m.current, 1, "🔄 パネル移動実行:", g, "→", D, "@", R);
2746
+ const Y = j.current, F = Object.keys(Y).find((u) => Y[u].includes(g));
2747
+ if (F === void 0) {
2748
+ console.error("Source column not found for panel:", g);
2749
+ return;
2750
+ }
2751
+ if (!Y[D]) {
2752
+ console.error("Target column not found:", D);
2753
+ return;
2754
+ }
2755
+ const X = Ft(Y, g, D, R);
2756
+ X !== null && (C(X), M(m.current, 1, "✅ パネル移動完了:", g, "→", D), !(i === void 0 && r === void 0) && requestAnimationFrame(() => {
2757
+ const u = [];
2758
+ try {
2759
+ i?.(X);
2760
+ } catch (f) {
2761
+ u.push(f);
2243
2762
  }
2244
- if (E(h.current, 1, "✅ パネル移動完了:", m, "→", v), u && requestAnimationFrame(() => {
2245
- u(O);
2246
- }), o) {
2247
- const a = Object.keys(A).find((d) => A[d].includes(m));
2248
- a && requestAnimationFrame(() => {
2249
- o(m, a, v, D);
2250
- });
2763
+ try {
2764
+ r?.(g, F, D, R);
2765
+ } catch (f) {
2766
+ u.push(f);
2251
2767
  }
2252
- return O;
2253
- });
2768
+ if (u.length === 1) throw u[0];
2769
+ if (u.length === 2) throw new AggregateError(u, "onColumnPanelsChange and onPanelMove both threw");
2770
+ }));
2254
2771
  },
2255
- [u, o]
2256
- ), Z = w(
2257
- (m, v) => {
2258
- if (!(l.dragState.isDragging || l.customDrag.isActive)) return;
2259
- const D = l.originalPanelPosition;
2260
- if (D && D.columnIndex === m && (D.panelIndex === v || D.panelIndex + 1 === v)) {
2261
- E(h.current, 1, `元の位置への挿入をスキップ: カラム${m}, 位置${v}`);
2772
+ [i, r, C]
2773
+ ), B = k(
2774
+ (g, D) => {
2775
+ if (!(h.dragState.isDragging || h.customDrag.isActive)) return;
2776
+ const R = h.originalPanelPosition;
2777
+ if (R !== null && et(R, g, D)) {
2778
+ M(m.current, 1, `元の位置への挿入をスキップ: カラム${g}, 位置${D}`);
2262
2779
  return;
2263
2780
  }
2264
- const A = l.dragOverPosition;
2265
- (!A || A.columnIndex !== m || A.insertIndex !== v) && (E(h.current, 1, `プレースホルダーエンター: カラム${m}, 位置${v}`), l.setDragOverPosition({ columnIndex: m, insertIndex: v }), l.setDragState((O) => ({ ...O, dragOverColumn: m })));
2781
+ const Y = h.dragOverPosition;
2782
+ (!Y || Y.columnIndex !== g || Y.insertIndex !== D) && (M(m.current, 1, `プレースホルダーエンター: カラム${g}, 位置${D}`), h.setDragOverPosition({ columnIndex: g, insertIndex: D }), h.setDragState((F) => ({ ...F, dragOverColumn: g })));
2266
2783
  },
2267
- [l]
2268
- ), Y = w(
2269
- (m, v, D) => {
2270
- if (l.dragState.isDragging || l.customDrag.isActive) {
2271
- if (l.customDrag.isActive)
2272
- E(h.current, 1, "🚫 カスタムドラッグ - プレースホルダーリーブ: ハイライトを解除します。"), l.setDragOverPosition(null);
2273
- else if (l.dragState.isDragging && m && v !== void 0 && D !== void 0) {
2274
- const A = l.dragOverPosition;
2275
- if (A && A.columnIndex === v && A.insertIndex === D) {
2276
- const O = m.currentTarget, H = m.relatedTarget;
2277
- H && O.contains(H) || (E(h.current, 1, `ノーマルドラッグ - プレースホルダーリーブ: カラム${v}, 位置${D}。ハイライトを解除します。`), l.setDragOverPosition(null));
2784
+ [h]
2785
+ ), J = k(
2786
+ (g, D, R) => {
2787
+ if (h.dragState.isDragging || h.customDrag.isActive) {
2788
+ if (h.customDrag.isActive)
2789
+ M(m.current, 1, "🚫 カスタムドラッグ - プレースホルダーリーブ: ハイライトを解除します。"), h.setDragOverPosition(null);
2790
+ else if (h.dragState.isDragging && g && D !== void 0 && R !== void 0) {
2791
+ const Y = h.dragOverPosition;
2792
+ if (Y && Y.columnIndex === D && Y.insertIndex === R) {
2793
+ const F = g.currentTarget, X = g.relatedTarget;
2794
+ X && F.contains(X) || (M(m.current, 1, `ノーマルドラッグ - プレースホルダーリーブ: カラム${D}, 位置${R}。ハイライトを解除します。`), h.setDragOverPosition(null));
2278
2795
  }
2279
2796
  }
2280
2797
  }
2281
2798
  },
2282
- [l]
2283
- ), U = Yt({
2284
- debugConfig: h.current,
2285
- dragState: l.dragState,
2286
- customDrag: l.customDrag,
2287
- clickState: l.clickState,
2288
- dragModes: M,
2289
- isMouseDown: l.isMouseDown,
2290
- originalPanelPosition: l.originalPanelPosition,
2291
- dragOverPosition: l.dragOverPosition,
2292
- setCustomDrag: l.setCustomDrag,
2293
- setDragState: l.setDragState,
2294
- setDragOverPosition: l.setDragOverPosition,
2295
- setOriginalPanelPosition: l.setOriginalPanelPosition,
2296
- setClickState: l.setClickState,
2297
- setIsMouseDown: l.setIsMouseDown,
2298
- findPanelPosition: R,
2299
- performPanelMove: z,
2300
- showMousePosition: j.showMousePosition,
2301
- updateMousePosition: j.updateMousePosition,
2302
- recordMouseDown: j.recordMouseDown,
2303
- recordClickPosition: j.recordClickPosition,
2304
- isVirtualClick: j.isVirtualClick,
2305
- calculateMoveDistance: j.calculateMoveDistance,
2306
- clearMouseTracking: j.clearMouseTracking,
2307
- resetDragState: l.resetDragState,
2308
- resetClickState: l.resetClickState,
2309
- createDragImage: k.createDragImage,
2310
- updateDragImagePosition: k.updateDragImagePosition,
2311
- removeDragImage: k.removeDragImage,
2312
- handlePlaceholderDragEnter: Z,
2313
- handlePlaceholderDragLeave: Y
2314
- }), $ = Ht({
2315
- debugConfig: h.current,
2316
- dragState: l.dragState,
2317
- customDrag: l.customDrag,
2318
- dragModes: M,
2319
- columnPanels: N,
2320
- dragOverPosition: l.dragOverPosition,
2321
- originalPanelPosition: l.originalPanelPosition,
2322
- setDragState: l.setDragState,
2323
- setDragOverPosition: l.setDragOverPosition,
2324
- setOriginalPanelPosition: l.setOriginalPanelPosition,
2325
- performPanelMove: z,
2326
- showMousePosition: j.showMousePosition,
2327
- updateMousePosition: j.updateMousePosition,
2328
- resetDragState: l.resetDragState,
2329
- handlePlaceholderDragEnter: Z,
2330
- handlePlaceholderDragLeave: Y,
2331
- scale: c
2332
- }), L = w((m) => {
2333
- _.current.mousemove && _.current.mousemove(m);
2334
- }, []), f = w((m) => {
2335
- _.current.mouseup && _.current.mouseup(m);
2799
+ [h]
2800
+ ), p = Tr({
2801
+ debugConfig: m.current,
2802
+ dragState: h.dragState,
2803
+ customDrag: h.customDrag,
2804
+ clickState: h.clickState,
2805
+ dragModes: A,
2806
+ isMouseDown: h.isMouseDown,
2807
+ originalPanelPosition: h.originalPanelPosition,
2808
+ dragOverPosition: h.dragOverPosition,
2809
+ setCustomDrag: h.setCustomDrag,
2810
+ setDragState: h.setDragState,
2811
+ setDragOverPosition: h.setDragOverPosition,
2812
+ setOriginalPanelPosition: h.setOriginalPanelPosition,
2813
+ setClickState: h.setClickState,
2814
+ setIsMouseDown: h.setIsMouseDown,
2815
+ findPanelPosition: _,
2816
+ performPanelMove: L,
2817
+ showMousePosition: P.showMousePosition,
2818
+ updateMousePosition: P.updateMousePosition,
2819
+ recordMouseDown: P.recordMouseDown,
2820
+ recordClickPosition: P.recordClickPosition,
2821
+ isVirtualClick: P.isVirtualClick,
2822
+ calculateMoveDistance: P.calculateMoveDistance,
2823
+ clearMouseTracking: P.clearMouseTracking,
2824
+ resetDragState: h.resetDragState,
2825
+ resetClickState: h.resetClickState,
2826
+ createDragImage: N.createDragImage,
2827
+ updateDragImagePosition: N.updateDragImagePosition,
2828
+ removeDragImage: N.removeDragImage,
2829
+ handlePlaceholderDragEnter: B,
2830
+ handlePlaceholderDragLeave: J
2831
+ }), x = Lr({
2832
+ debugConfig: m.current,
2833
+ dragState: h.dragState,
2834
+ customDrag: h.customDrag,
2835
+ dragModes: A,
2836
+ columnPanels: w,
2837
+ dragOverPosition: h.dragOverPosition,
2838
+ originalPanelPosition: h.originalPanelPosition,
2839
+ setDragState: h.setDragState,
2840
+ setDragOverPosition: h.setDragOverPosition,
2841
+ setOriginalPanelPosition: h.setOriginalPanelPosition,
2842
+ performPanelMove: L,
2843
+ showMousePosition: P.showMousePosition,
2844
+ updateMousePosition: P.updateMousePosition,
2845
+ resetDragState: h.resetDragState,
2846
+ handlePlaceholderDragEnter: B,
2847
+ handlePlaceholderDragLeave: J,
2848
+ scale: d
2849
+ }), $ = k((g) => {
2850
+ l.current.mousemove && l.current.mousemove(g);
2851
+ }, []), W = k((g) => {
2852
+ l.current.mouseup && l.current.mouseup(g);
2336
2853
  }, []);
2337
- K(() => (E(h.current, 1, "🔧 グローバルイベントリスナー初期化 - refベース管理開始"), document.addEventListener("mousemove", L), document.addEventListener("mouseup", f), () => {
2338
- E(h.current, 1, "🔴 グローバルイベントリスナー終了 - refベース管理終了"), document.removeEventListener("mousemove", L), document.removeEventListener("mouseup", f);
2339
- }), [L, f]), K(() => {
2340
- const m = !l.clickState.isClicked && Object.entries(M).some(([, D]) => D === "custom"), v = l.clickState.isClicked && l.clickState.panelId;
2341
- if (m || v) {
2342
- const D = m ? "パターン1(仮想クリック検出)" : "パターン2,3(ドラッグ準備)";
2343
- E(h.current, 1, `🔧 イベントハンドラー設定開始: ${D}`), _.current.mousemove = U.handleGlobalMouseMove, _.current.mouseup = U.handleGlobalMouseUp;
2854
+ oe(() => (M(m.current, 1, "🔧 グローバルイベントリスナー初期化 - refベース管理開始"), document.addEventListener("mousemove", $), document.addEventListener("mouseup", W), () => {
2855
+ M(m.current, 1, "🔴 グローバルイベントリスナー終了 - refベース管理終了"), document.removeEventListener("mousemove", $), document.removeEventListener("mouseup", W);
2856
+ }), [$, W]), oe(() => {
2857
+ const g = !h.clickState.isClicked && Object.entries(A).some(([, R]) => R === "custom"), D = h.clickState.isClicked && h.clickState.panelId;
2858
+ if (g || D) {
2859
+ const R = g ? "パターン1(仮想クリック検出)" : "パターン2,3(ドラッグ準備)";
2860
+ M(m.current, 1, `🔧 イベントハンドラー設定開始: ${R}`), l.current.mousemove = p.handleGlobalMouseMove, l.current.mouseup = p.handleGlobalMouseUp;
2344
2861
  } else
2345
- l.customDrag.isActive || l.dragState.isDragging || (_.current.mousemove = null, _.current.mouseup = null);
2346
- }, [l.clickState.isClicked, l.clickState.panelId, M, l.customDrag.isActive, l.dragState.isDragging, U.handleGlobalMouseMove, U.handleGlobalMouseUp]);
2347
- const x = w(
2348
- (m, v) => {
2349
- const D = m.touches[0], A = m.currentTarget;
2350
- l.setTouchDragState({
2351
- isTouchDragging: !0,
2352
- startX: D.clientX,
2353
- startY: D.clientY,
2354
- currentX: D.clientX,
2355
- currentY: D.clientY,
2356
- draggedElement: A
2357
- }), l.setDragState({
2358
- isDragging: !0,
2359
- draggedPanel: v,
2360
- dragOverColumn: null
2361
- });
2362
- },
2363
- [l]
2364
- ), C = w(
2365
- (m) => {
2366
- if (!l.touchDragState.isTouchDragging) return;
2367
- m.preventDefault();
2368
- const v = m.touches[0];
2369
- l.setTouchDragState((D) => ({
2370
- ...D,
2371
- currentX: v.clientX,
2372
- currentY: v.clientY
2373
- }));
2374
- },
2375
- [l.touchDragState.isTouchDragging, l]
2376
- ), W = w(
2377
- (m) => {
2378
- l.touchDragState.isTouchDragging && (l.setTouchDragState({
2379
- isTouchDragging: !1,
2380
- startX: 0,
2381
- startY: 0,
2382
- currentX: 0,
2383
- currentY: 0,
2384
- draggedElement: null
2385
- }), $.handleDragEnd());
2386
- },
2387
- [l.touchDragState.isTouchDragging, l, $]
2388
- ), p = w(
2389
- (m) => {
2390
- E(h.current, 1, "🔄 toggleDragMode called:", { panelId: m }), T((v) => {
2391
- const A = (v[m] || "normal") === "normal" ? "custom" : "normal", O = { ...v, [m]: A };
2392
- if (i)
2393
- try {
2394
- i(m, A);
2395
- } catch (H) {
2396
- console.error("🔄 Error in onDragModeChange:", H);
2397
- }
2398
- return O;
2399
- });
2862
+ h.customDrag.isActive || h.dragState.isDragging || (l.current.mousemove = null, l.current.mouseup = null);
2863
+ }, [h.clickState.isClicked, h.clickState.panelId, A, h.customDrag.isActive, h.dragState.isDragging, p.handleGlobalMouseMove, p.handleGlobalMouseUp]);
2864
+ const v = k(
2865
+ (g) => {
2866
+ M(m.current, 1, "🔄 toggleDragMode called:", { panelId: g });
2867
+ const D = E.current, R = (D[g] ?? "normal") === "normal" ? "custom" : "normal";
2868
+ if (T({ ...D, [g]: R }), a !== void 0)
2869
+ try {
2870
+ a(g, R);
2871
+ } catch (Y) {
2872
+ console.error("🔄 Error in onDragModeChange:", Y);
2873
+ }
2400
2874
  },
2401
- [i]
2402
- ), g = w((m, v) => {
2403
- m.stopPropagation(), E(h.current, 2, "パネルサイズ情報クリック:", v);
2875
+ [a, T]
2876
+ ), y = k((g, D) => {
2877
+ g.stopPropagation(), M(m.current, 2, "パネルサイズ情報クリック:", D);
2404
2878
  }, []);
2405
2879
  return {
2406
2880
  // 状態
2407
- columnPanels: N,
2408
- panelVisibility: k.panelVisibility,
2409
- dragModes: M,
2410
- dragState: l.dragState,
2411
- dragOverPosition: l.dragOverPosition,
2412
- originalPanelPosition: l.originalPanelPosition,
2413
- touchDragState: l.touchDragState,
2414
- customDrag: l.customDrag,
2415
- clickState: l.clickState,
2416
- mousePosition: j.mousePosition,
2417
- panelSizes: k.panelSizes,
2881
+ columnPanels: w,
2882
+ panelVisibility: N.panelVisibility,
2883
+ dragModes: A,
2884
+ dragState: h.dragState,
2885
+ dragOverPosition: h.dragOverPosition,
2886
+ originalPanelPosition: h.originalPanelPosition,
2887
+ customDrag: h.customDrag,
2888
+ clickState: h.clickState,
2889
+ mousePosition: P.mousePosition,
2890
+ panelSizes: N.panelSizes,
2418
2891
  // 状態更新関数
2419
- setColumnPanels: b,
2420
- setPanelVisibility: k.setPanelVisibility,
2892
+ setColumnPanels: C,
2893
+ setPanelVisibility: N.setPanelVisibility,
2421
2894
  setDragModes: T,
2422
- setPanelRef: k.setPanelRef,
2895
+ setPanelRef: N.setPanelRef,
2423
2896
  // イベントハンドラー
2424
- handleDragStart: $.handleDragStart,
2425
- handleDragEnd: $.handleDragEnd,
2426
- handleMouseDown: U.handleMouseDown,
2427
- handleTouchStart: x,
2428
- handleTouchMove: C,
2429
- handleTouchEnd: W,
2430
- handlePlaceholderDragEnter: Z,
2431
- handlePlaceholderDragLeave: Y,
2432
- handleDragOverWithInsert: $.handleDragOverWithInsert,
2433
- handleDropWithInsert: $.handleDropWithInsert,
2434
- handleColumnDragLeave: $.handleColumnDragLeave,
2435
- handlePanelSizeInfoClick: g,
2897
+ handleDragStart: x.handleDragStart,
2898
+ handleDragEnd: x.handleDragEnd,
2899
+ handleMouseDown: p.handleMouseDown,
2900
+ handlePlaceholderDragEnter: B,
2901
+ handlePlaceholderDragLeave: J,
2902
+ handleDragOverWithInsert: x.handleDragOverWithInsert,
2903
+ handleDropWithInsert: x.handleDropWithInsert,
2904
+ handleColumnDragLeave: x.handleColumnDragLeave,
2905
+ handlePanelSizeInfoClick: y,
2436
2906
  // ユーティリティ関数
2437
- toggleDragMode: p,
2438
- findPanelPosition: R
2907
+ toggleDragMode: v,
2908
+ findPanelPosition: _
2439
2909
  };
2440
- }, an = ({ minColumnWidth: r = 350, defaultColumns: e = 3, maxColumns: n = 6, minColumns: s = 1, currentColumnWidths: o = {} } = {}) => {
2441
- const [i, u] = te(0), c = F(0), h = F(null), [N, b] = te(!1), M = F(e);
2442
- K(() => {
2910
+ }, to = ({ minColumnWidth: t = 350, defaultColumns: n = 3, maxColumns: e = 6, minColumns: o = 1, currentColumnWidths: r = {} } = {}) => {
2911
+ const [a, i] = se(0), d = I(0), m = I(null), [w, b] = se(!1), A = I(n);
2912
+ oe(() => {
2443
2913
  if (typeof window > "u")
2444
2914
  return;
2445
- const l = () => {
2446
- const k = window.visualViewport?.width ?? 0, _ = document?.documentElement?.clientWidth ?? 0, R = document?.body?.clientWidth ?? 0, z = window.innerWidth ?? 0;
2447
- return _ > 0 ? Math.floor(_) : k > 0 ? Math.floor(k) : R > 0 ? Math.floor(R) : Math.floor(z);
2448
- }, j = () => {
2449
- h.current !== null && cancelAnimationFrame(h.current), h.current = requestAnimationFrame(() => {
2450
- const k = l();
2451
- h.current = null, k !== 0 && (Math.abs(c.current - k) < 2 || (c.current = k, u(k)));
2915
+ const E = () => {
2916
+ const T = window.visualViewport?.width ?? 0, h = document?.documentElement?.clientWidth ?? 0, P = document?.body?.clientWidth ?? 0, N = window.innerWidth ?? 0;
2917
+ return h > 0 ? Math.floor(h) : T > 0 ? Math.floor(T) : P > 0 ? Math.floor(P) : Math.floor(N);
2918
+ }, C = () => {
2919
+ m.current !== null && cancelAnimationFrame(m.current), m.current = requestAnimationFrame(() => {
2920
+ const T = E();
2921
+ m.current = null, T !== 0 && (Math.abs(d.current - T) < 2 || (d.current = T, i(T)));
2452
2922
  });
2453
2923
  };
2454
- return j(), window.addEventListener("resize", j), window.addEventListener("orientationchange", j), window.visualViewport?.addEventListener("resize", j), () => {
2455
- h.current !== null && cancelAnimationFrame(h.current), window.removeEventListener("resize", j), window.removeEventListener("orientationchange", j), window.visualViewport?.removeEventListener("resize", j);
2924
+ return C(), window.addEventListener("resize", C), window.addEventListener("orientationchange", C), window.visualViewport?.addEventListener("resize", C), () => {
2925
+ m.current !== null && cancelAnimationFrame(m.current), window.removeEventListener("resize", C), window.removeEventListener("orientationchange", C), window.visualViewport?.removeEventListener("resize", C);
2456
2926
  };
2457
2927
  }, []);
2458
- const T = Ue(() => {
2459
- if (!N || i === 0)
2460
- return M.current = e, e;
2461
- const l = Math.max(i - 64, 0), j = 24, k = Object.values(o);
2462
- let _;
2463
- if (k.length > 0) {
2464
- const R = k.reduce((Y, U) => Y + U, 0) / k.length, z = Math.max(r, R);
2465
- _ = Math.floor((l + j) / (z + j)), k.reduce((Y, U) => Y + U, 0) + (k.length - 1) * j > l && k.length > s && (_ = Math.min(_, k.length - 1));
2928
+ const q = Le(() => {
2929
+ if (!w || a === 0)
2930
+ return A.current = n, n;
2931
+ const E = Math.max(a - 64, 0), C = 24, T = Object.values(r);
2932
+ let h;
2933
+ if (T.length > 0) {
2934
+ const P = T.reduce((_, L) => _ + L, 0) / T.length, N = Math.max(t, P);
2935
+ h = Math.floor((E + C) / (N + C)), T.reduce((_, L) => _ + L, 0) + (T.length - 1) * C > E && T.length > o && (h = Math.min(h, T.length - 1));
2466
2936
  } else
2467
- _ = Math.floor((l + j) / (r + j));
2468
- return _ = Math.max(s, Math.min(n, _)), M.current === _ ? M.current : (M.current = _, _);
2469
- }, [N, i, e, r, n, s, o]), y = w(() => {
2470
- b((l) => !l);
2937
+ h = Math.floor((E + C) / (t + C));
2938
+ return h = Math.max(o, Math.min(e, h)), A.current === h ? A.current : (A.current = h, h);
2939
+ }, [w, a, n, t, e, o, r]), j = k(() => {
2940
+ b((E) => !E);
2471
2941
  }, []);
2472
2942
  return {
2473
- responsiveColumnCount: T,
2474
- isResponsiveMode: N,
2475
- screenWidth: i,
2476
- toggleResponsiveMode: y
2943
+ responsiveColumnCount: q,
2944
+ isResponsiveMode: w,
2945
+ screenWidth: a,
2946
+ toggleResponsiveMode: j
2477
2947
  };
2478
2948
  };
2479
- const It = [
2949
+ const Ir = [
2480
2950
  ["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
2481
2951
  ["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
2482
2952
  ["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
2483
- ], Ut = oe("monitor", It);
2484
- const Bt = [
2953
+ ], qr = ie("monitor", Ir);
2954
+ const Wr = [
2485
2955
  ["rect", { width: "14", height: "20", x: "5", y: "2", rx: "2", ry: "2", key: "1yt0o3" }],
2486
2956
  ["path", { d: "M12 18h.01", key: "mhygvu" }]
2487
- ], Vt = oe("smartphone", Bt), ln = ({ isResponsiveMode: r, responsiveColumnCount: e, currentColumnCount: n, screenWidth: s, onToggleResponsive: o }) => /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2 rounded-lg border border-slate-300 bg-white/90 px-3 py-1", children: [
2488
- /* @__PURE__ */ t.jsxs(
2957
+ ], Hr = ie("smartphone", Wr), no = ({ isResponsiveMode: t, responsiveColumnCount: n, currentColumnCount: e, screenWidth: o, onToggleResponsive: r }) => /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-2 rounded-lg border border-slate-300 bg-white/90 px-3 py-1", children: [
2958
+ /* @__PURE__ */ s.jsxs(
2489
2959
  "button",
2490
2960
  {
2491
2961
  type: "button",
2492
- onClick: o,
2493
- className: `flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors ${r ? "border border-blue-300 bg-blue-100 text-blue-700" : "border border-slate-300 text-slate-600 hover:bg-blue-50 hover:text-blue-600"}`,
2494
- title: r ? "レスポンシブモードを無効化" : "レスポンシブモードを有効化",
2962
+ onClick: r,
2963
+ className: `flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors ${t ? "border border-blue-300 bg-blue-100 text-blue-700" : "border border-slate-300 text-slate-600 hover:bg-blue-50 hover:text-blue-600"}`,
2964
+ title: t ? "レスポンシブモードを無効化" : "レスポンシブモードを有効化",
2495
2965
  children: [
2496
- r ? /* @__PURE__ */ t.jsx(Vt, { className: "h-3 w-3" }) : /* @__PURE__ */ t.jsx(Ut, { className: "h-3 w-3" }),
2497
- /* @__PURE__ */ t.jsx("span", { children: r ? "レスポンシブ" : "固定" })
2966
+ t ? /* @__PURE__ */ s.jsx(Hr, { className: "h-3 w-3" }) : /* @__PURE__ */ s.jsx(qr, { className: "h-3 w-3" }),
2967
+ /* @__PURE__ */ s.jsx("span", { children: t ? "レスポンシブ" : "固定" })
2498
2968
  ]
2499
2969
  }
2500
2970
  ),
2501
- r && /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1 text-slate-600 text-xs", children: [
2502
- /* @__PURE__ */ t.jsxs("span", { className: "font-mono", children: [
2503
- s,
2971
+ t && /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-1 text-slate-600 text-xs", children: [
2972
+ /* @__PURE__ */ s.jsxs("span", { className: "font-mono", children: [
2973
+ o,
2504
2974
  "px"
2505
2975
  ] }),
2506
- /* @__PURE__ */ t.jsx("span", { children: "→" }),
2507
- /* @__PURE__ */ t.jsxs("span", { className: "font-semibold text-blue-600", children: [
2508
- e,
2976
+ /* @__PURE__ */ s.jsx("span", { children: "→" }),
2977
+ /* @__PURE__ */ s.jsxs("span", { className: "font-semibold text-blue-600", children: [
2978
+ n,
2509
2979
  "列"
2510
2980
  ] }),
2511
- e !== n && /* @__PURE__ */ t.jsx("span", { className: "text-orange-600", children: "(変更予定)" })
2981
+ n !== e && /* @__PURE__ */ s.jsx("span", { className: "text-orange-600", children: "(変更予定)" })
2512
2982
  ] })
2513
- ] }), cn = {
2983
+ ] }), ro = {
2514
2984
  showDebugPanel: !1,
2515
2985
  showMousePosition: !1,
2516
2986
  showPanelSizes: !1,
@@ -2519,37 +2989,49 @@ const Bt = [
2519
2989
  logLevel: 0
2520
2990
  };
2521
2991
  export {
2522
- Qt as ColumnControlPanel,
2523
- Kt as ColumnInsertPanel,
2524
- ie as DEFAULT_COLUMN_ID_CONFIG,
2525
- cn as DEFAULT_DEBUG_CONFIG,
2526
- ke as DEFAULT_EDGE_SCROLL_CONFIG,
2527
- en as DebugControlPanel,
2528
- Jt as DragDropLayout,
2529
- Ge as DropZoneDebugOverlay,
2530
- Ke as EdgeScrollManager,
2531
- Ze as InsertPlaceholder,
2532
- Dt as PanelSizeDisplay,
2533
- Gt as ResizableColumn,
2534
- Je as ResizeHandle,
2535
- ln as ResponsiveControl,
2536
- He as calculateScrollVector,
2537
- rn as createColumnIdMapping,
2538
- E as debugLog,
2539
- je as generateColumnId,
2540
- Qe as generateColumnIds,
2541
- nn as getNextColumnId,
2542
- tn as isValidColumnId,
2543
- Wt as normalizeColumnPanels,
2544
- Pe as parseColumnId,
2545
- zt as performScroll,
2546
- Lt as sortColumnIds,
2547
- sn as useColumnLayout,
2548
- Yt as useCustomDragHandlers,
2549
- on as useDragDropColumns,
2550
- Ft as useDragDropState,
2551
- Xt as useMouseTracking,
2552
- Ht as useNormalDragHandlers,
2553
- qt as usePanelManagement,
2554
- an as useResponsiveColumns
2992
+ Xr as ColumnControlPanel,
2993
+ Vr as ColumnInsertPanel,
2994
+ fe as DEFAULT_COLUMN_ID_CONFIG,
2995
+ ro as DEFAULT_DEBUG_CONFIG,
2996
+ Fr as DEFAULT_DRAG_DROP_LAYOUT_LABELS,
2997
+ Me as DEFAULT_EDGE_SCROLL_CONFIG,
2998
+ xr as DEFAULT_TOUCH_DRAG_CONFIG,
2999
+ Zr as DebugControlPanel,
3000
+ Ur as DragDropLayout,
3001
+ Vt as DropZoneDebugOverlay,
3002
+ rt as EdgeScrollManager,
3003
+ Xt as InsertPlaceholder,
3004
+ Ee as PANEL_ACTION_ATTRIBUTE,
3005
+ De as PANEL_MOVES,
3006
+ Ut as PANEL_MOVE_SHORTCUTS,
3007
+ Fn as PanelSizeDisplay,
3008
+ Br as ResizableColumn,
3009
+ tn as ResizeHandle,
3010
+ no as ResponsiveControl,
3011
+ Zt as SCROLL_ROOT_SELECTOR,
3012
+ ur as TEMPLATE_PLACEHOLDERS,
3013
+ Xn as availablePanelMoves,
3014
+ Mt as calculateScrollVector,
3015
+ Jr as createColumnIdMapping,
3016
+ M as debugLog,
3017
+ qe as generateColumnId,
3018
+ nn as generateColumnIds,
3019
+ Kr as getNextColumnId,
3020
+ Ft as insertPanelAt,
3021
+ Gr as isValidColumnId,
3022
+ Vn as movePanelInColumns,
3023
+ $r as normalizeColumnPanels,
3024
+ Gn as panelMoveOfKey,
3025
+ We as parseColumnId,
3026
+ ar as performScroll,
3027
+ Pe as shownPanelPlace,
3028
+ Ar as sortColumnIds,
3029
+ Qr as useColumnLayout,
3030
+ Tr as useCustomDragHandlers,
3031
+ eo as useDragDropColumns,
3032
+ Rr as useDragDropState,
3033
+ _r as useMouseTracking,
3034
+ Lr as useNormalDragHandlers,
3035
+ zr as usePanelManagement,
3036
+ to as useResponsiveColumns
2555
3037
  };