1(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([typeof document === "object" ? document.currentScript : undefined, 2239616, 903446, 3((__turbopack_context__) => { 4"use strict"; 5 6// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/settings.js [app-client] (ecmascript) <export default as Settings> 7; 8// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/settings.js [app-client] (ecmascript) 9; 10/** 11 * @license lucide-react v0.556.0 - ISC 12 * 13 * This source code is licensed under the ISC license. 14 * See the LICENSE file in the root directory of this source tree. 15 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 16; 17const __iconNode = [ 18 [ 19 "path", 20 { 21 d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915", 22 key: "1i5ecw" 23 } 24 ], 25 [ 26 "circle", 27 { 28 cx: "12", 29 cy: "12", 30 r: "3", 31 key: "1v7zrd" 32 } 33 ] 34]; 35const Settings = (0, __TURBOPACK__imported__module__475254__["default"])("settings", __iconNode); 36; 37__turbopack_context__.s([ 38 "default", 39 0, 40 Settings 41], 903446); 42__turbopack_context__.s([ 43 "Settings", 44 0, 45 Settings 46], 239616); 47}), 48761911, 98740, 49((__turbopack_context__) => { 50"use strict"; 51 52// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/users.js [app-client] (ecmascript) <export default as Users> 53; 54// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/users.js [app-client] (ecmascript) 55; 56/** 57 * @license lucide-react v0.556.0 - ISC 58 * 59 * This source code is licensed under the ISC license. 60 * See the LICENSE file in the root directory of this source tree. 61 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 62; 63const __iconNode = [ 64 [ 65 "path", 66 { 67 d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", 68 key: "1yyitq" 69 } 70 ], 71 [ 72 "path", 73 { 74 d: "M16 3.128a4 4 0 0 1 0 7.744", 75 key: "16gr8j" 76 } 77 ], 78 [ 79 "path", 80 { 81 d: "M22 21v-2a4 4 0 0 0-3-3.87", 82 key: "kshegd" 83 } 84 ], 85 [ 86 "circle", 87 { 88 cx: "9", 89 cy: "7", 90 r: "4", 91 key: "nufk8" 92 } 93 ] 94]; 95const Users = (0, __TURBOPACK__imported__module__475254__["default"])("users", __iconNode); 96; 97__turbopack_context__.s([ 98 "default", 99 0, 100 Users 101], 98740); 102__turbopack_context__.s([ 103 "Users", 104 0, 105 Users 106], 761911); 107}), 10898919, 918549, 109((__turbopack_context__) => { 110"use strict"; 111 112// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/shield.js [app-client] (ecmascript) <export default as Shield> 113; 114// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/shield.js [app-client] (ecmascript) 115; 116/** 117 * @license lucide-react v0.556.0 - ISC 118 * 119 * This source code is licensed under the ISC license. 120 * See the LICENSE file in the root directory of this source tree. 121 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 122; 123const __iconNode = [ 124 [ 125 "path", 126 { 127 d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z", 128 key: "oel41y" 129 } 130 ] 131]; 132const Shield = (0, __TURBOPACK__imported__module__475254__["default"])("shield", __iconNode); 133; 134__turbopack_context__.s([ 135 "default", 136 0, 137 Shield 138], 918549); 139__turbopack_context__.s([ 140 "Shield", 141 0, 142 Shield 143], 98919); 144}), 145270756, 517302, 146((__turbopack_context__) => { 147"use strict"; 148 149// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/lock.js [app-client] (ecmascript) <export default as Lock> 150; 151// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/lock.js [app-client] (ecmascript) 152; 153/** 154 * @license lucide-react v0.556.0 - ISC 155 * 156 * This source code is licensed under the ISC license. 157 * See the LICENSE file in the root directory of this source tree. 158 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 159; 160const __iconNode = [ 161 [ 162 "rect", 163 { 164 width: "18", 165 height: "11", 166 x: "3", 167 y: "11", 168 rx: "2", 169 ry: "2", 170 key: "1w4ew1" 171 } 172 ], 173 [ 174 "path", 175 { 176 d: "M7 11V7a5 5 0 0 1 10 0v4", 177 key: "fwvmzm" 178 } 179 ] 180]; 181const Lock = (0, __TURBOPACK__imported__module__475254__["default"])("lock", __iconNode); 182; 183__turbopack_context__.s([ 184 "default", 185 0, 186 Lock 187], 517302); 188__turbopack_context__.s([
189 "Lock", 190 0, 191 Lock 192], 270756); 193}), 194201928, 280108, 195((__turbopack_context__) => { 196"use strict"; 197 198// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/shopping-cart.js [app-client] (ecmascript) <export default as ShoppingCart> 199; 200// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/shopping-cart.js [app-client] (ecmascript) 201; 202/** 203 * @license lucide-react v0.556.0 - ISC 204 * 205 * This source code is licensed under the ISC license. 206 * See the LICENSE file in the root directory of this source tree. 207 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 208; 209const __iconNode = [ 210 [ 211 "circle", 212 { 213 cx: "8", 214 cy: "21", 215 r: "1", 216 key: "jimo8o" 217 } 218 ], 219 [ 220 "circle", 221 { 222 cx: "19", 223 cy: "21", 224 r: "1", 225 key: "13723u" 226 } 227 ], 228 [ 229 "path", 230 { 231 d: "M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12", 232 key: "9zh506" 233 } 234 ] 235]; 236const ShoppingCart = (0, __TURBOPACK__imported__module__475254__["default"])("shopping-cart", __iconNode); 237; 238__turbopack_context__.s([ 239 "default", 240 0, 241 ShoppingCart 242], 280108); 243__turbopack_context__.s([ 244 "ShoppingCart", 245 0, 246 ShoppingCart 247], 201928); 248}), 249361277, ((__turbopack_context__) => { 250"use strict"; 251 252/** 253 * @license lucide-react v0.556.0 - ISC 254 * 255 * This source code is licensed under the ISC license. 256 * See the LICENSE file in the root directory of this source tree. 257 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 258; 259const __iconNode = [ 260 [ 261 "path", 262 { 263 d: "M8 2v4", 264 key: "1cmpym" 265 } 266 ], 267 [ 268 "path", 269 { 270 d: "M16 2v4", 271 key: "4m81vk" 272 } 273 ], 274 [ 275 "rect", 276 { 277 width: "18", 278 height: "18", 279 x: "3", 280 y: "4", 281 rx: "2", 282 key: "1hopcy" 283 } 284 ], 285 [ 286 "path", 287 { 288 d: "M3 10h18", 289 key: "8toen8" 290 } 291 ] 292]; 293const Calendar = (0, __TURBOPACK__imported__module__475254__["default"])("calendar", __iconNode); 294; 295__turbopack_context__.s([ 296 "default", 297 0, 298 Calendar 299]); 300}), 301715788, 621776, 302((__turbopack_context__) => { 303"use strict"; 304 305// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/truck.js [app-client] (ecmascript) <export default as Truck> 306; 307// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/truck.js [app-client] (ecmascript) 308; 309/** 310 * @license lucide-react v0.556.0 - ISC 311 * 312 * This source code is licensed under the ISC license. 313 * See the LICENSE file in the root directory of this source tree. 314 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 315; 316const __iconNode = [ 317 [ 318 "path", 319 { 320 d: "M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2", 321 key: "wrbu53" 322 } 323 ], 324 [ 325 "path", 326 { 327 d: "M15 18H9", 328 key: "1lyqi6" 329 } 330 ], 331 [ 332 "path", 333 { 334 d: "M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14", 335 key: "lysw3i" 336 } 337 ], 338 [ 339 "circle", 340 { 341 cx: "17", 342 cy: "18", 343 r: "2", 344 key: "332jqn" 345 } 346 ], 347 [ 348 "circle", 349 { 350 cx: "7", 351 cy: "18", 352 r: "2", 353 key: "19iecd" 354 } 355 ] 356]; 357const Truck = (0, __TURBOPACK__imported__module__475254__["default"])("truck", __iconNode); 358; 359__turbopack_context__.s([ 360 "default", 361 0, 362 Truck 363], 621776); 364__turbopack_context__.s([ 365 "Truck", 366 0, 367 Truck 368], 715788); 369}), 370150965, 26277, 371((__turbopack_context__) => { 372"use strict"; 373 374// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/shopping-bag.js [app-client] (ecmascript) <export default as ShoppingBag> 375; 376// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/shopping-bag.js [a
376pp-client] (ecmascript) 377; 378/** 379 * @license lucide-react v0.556.0 - ISC 380 * 381 * This source code is licensed under the ISC license. 382 * See the LICENSE file in the root directory of this source tree. 383 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 384; 385const __iconNode = [ 386 [ 387 "path", 388 { 389 d: "M16 10a4 4 0 0 1-8 0", 390 key: "1ltviw" 391 } 392 ], 393 [ 394 "path", 395 { 396 d: "M3.103 6.034h17.794", 397 key: "awc11p" 398 } 399 ], 400 [ 401 "path", 402 { 403 d: "M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z", 404 key: "o988cm" 405 } 406 ] 407]; 408const ShoppingBag = (0, __TURBOPACK__imported__module__475254__["default"])("shopping-bag", __iconNode); 409; 410__turbopack_context__.s([ 411 "default", 412 0, 413 ShoppingBag 414], 26277); 415__turbopack_context__.s([ 416 "ShoppingBag", 417 0, 418 ShoppingBag 419], 150965); 420}), 421571930, 444744, 422((__turbopack_context__) => { 423"use strict"; 424 425// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/bookmark.js [app-client] (ecmascript) <export default as Bookmark> 426; 427// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/bookmark.js [app-client] (ecmascript) 428; 429/** 430 * @license lucide-react v0.556.0 - ISC 431 * 432 * This source code is licensed under the ISC license. 433 * See the LICENSE file in the root directory of this source tree. 434 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 435; 436const __iconNode = [ 437 [ 438 "path", 439 { 440 d: "m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z", 441 key: "1fy3hk" 442 } 443 ] 444]; 445const Bookmark = (0, __TURBOPACK__imported__module__475254__["default"])("bookmark", __iconNode); 446; 447__turbopack_context__.s([ 448 "default", 449 0, 450 Bookmark 451], 444744); 452__turbopack_context__.s([ 453 "Bookmark", 454 0, 455 Bookmark 456], 571930); 457}), 458342920, 979491, 459((__turbopack_context__) => { 460"use strict"; 461 462// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/building.js [app-client] (ecmascript) <export default as Building> 463; 464// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/building.js [app-client] (ecmascript) 465; 466/** 467 * @license lucide-react v0.556.0 - ISC 468 * 469 * This source code is licensed under the ISC license. 470 * See the LICENSE file in the root directory of this source tree. 471 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 472; 473const __iconNode = [ 474 [ 475 "path", 476 { 477 d: "M12 10h.01", 478 key: "1nrarc" 479 } 480 ], 481 [ 482 "path", 483 { 484 d: "M12 14h.01", 485 key: "1etili" 486 } 487 ], 488 [ 489 "path", 490 { 491 d: "M12 6h.01", 492 key: "1vi96p" 493 } 494 ], 495 [ 496 "path", 497 { 498 d: "M16 10h.01", 499 key: "1m94wz" 500 } 501 ], 502 [ 503 "path", 504 { 505 d: "M16 14h.01", 506 key: "1gbofw" 507 } 508 ], 509 [ 510 "path", 511 { 512 d: "M16 6h.01", 513 key: "1x0f13" 514 } 515 ], 516 [ 517 "path", 518 { 519 d: "M8 10h.01", 520 key: "19clt8" 521 } 522 ], 523 [ 524 "path", 525 { 526 d: "M8 14h.01", 527 key: "6423bh" 528 } 529 ], 530 [ 531 "path", 532 { 533 d: "M8 6h.01", 534 key: "1dz90k" 535 } 536 ], 537 [ 538 "path", 539 { 540 d: "M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3", 541 key: "cabbwy" 542 } 543 ], 544 [ 545 "rect", 546 { 547 x: "4", 548 y: "2", 549 width: "16", 550 height: "20", 551 rx: "2", 552 key: "1uxh74" 553 } 554 ] 555]; 556const Building = (0, __TURBOPACK__imported__module__475254__["default"])("building", __iconNode); 557; 558__turbopack_context__.s([ 559 "default", 560 0, 561 Building 562], 979491); 563__turbopack_context__.s([ 564 "Building", 565 0, 566 Building 567], 342920); 568}), 569688154, ((__turbopack_context__) => { 570"use strict"; 571 572/** 573 * @license lucide-react v0.556.0 - ISC 574 * 575 * This source code is licensed under the ISC license. 576 * See the LICENSE file in the root directory of this source tree. 577 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 578; 579const __iconNode = [ 580 [ 581 "circle", 582 { 583 cx: "8", 584 cy: "8", 585 r: "6", 586 key: "3yglwk" 587 } 588 ], 589 [ 590 "path", 591 { 592 d: "M18.09 10.37A6 6 0 1 1 10.34 18", 593 key: "t5s6rm" 594 } 595 ], 596 [ 597 "path", 598 { 599 d: "M7 6h1v4", 600 key: "1obek4" 601 } 602 ], 603 [ 604 "path", 605 { 606 d: "m16.71 13.88.7.71-2.82 2.82", 607 key: "1rbuyh" 608 } 609 ] 610]; 611const Coins = (0, __TURBOPACK__imported__module__475254__["default"])("coins", __iconNode); 612; 613__turbopack_context__.s([ 614 "default", 615 0, 616 Coins 617]); 618}), 619575822, ((__turbopack_context__) => { 620"use strict"; 621 622var __TURBOPACK__imported__module__688154__ = __turbopack_context__.i(688154); 623__turbopack_context__.s([ 624 "Coins", 625 ()=>__TURBOPACK__imported__module__688154__["default"] 626]); 627}), 628423916, ((__turbopack_context__) => { 629"use strict"; 630 631/** 632 * @license lucide-react v0.556.0 - ISC 633 * 634 * This source code is licensed under the ISC license. 635 * See the LICENSE file in the root directory of this source tree. 636 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 637; 638const __iconNode = [ 639 [ 640 "path", 641 { 642 d: "M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4", 643 key: "1slcih" 644 } 645 ] 646]; 647const Flame = (0, __TURBOPACK__imported__module__475254__["default"])("flame", __iconNode); 648; 649__turbopack_context__.s([ 650 "default", 651 0, 652 Flame 653]); 654}), 655958377, ((__turbopack_context__) => { 656"use strict"; 657 658var __TURBOPACK__imported__module__423916__ = __turbopack_context__.i(423916); 659__turbopack_context__.s([ 660 "Flame", 661 ()=>__TURBOPACK__imported__module__423916__["default"] 662]); 663}), 664790597, 914299, 665((__turbopack_context__) => { 666"use strict"; 667 668// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/heart.js [app-client] (ecmascript) <export default as Heart> 669; 670// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/heart.js [app-client] (ecmascript) 671; 672/** 673 * @license lucide-react v0.556.0 - ISC 674 * 675 * This source code is licensed under the ISC license. 676 * See the LICENSE file in the root directory of this source tree. 677 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 678; 679const __iconNode = [ 680 [ 681 "path", 682 { 683 d: "M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5", 684 key: "mvr1a0" 685 } 686 ] 687]; 688const Heart = (0, __TURBOPACK__imported__module__475254__["default"])("heart", __iconNode); 689; 690__turbopack_context__.s([ 691 "default", 692 0, 693 Heart 694], 914299); 695__turbopack_context__.s([ 696 "Heart", 697 0, 698 Heart 699], 790597); 700}), 70123737, ((__turbopack_context__) => { 702"use strict"; 703 704/** 705 * @license lucide-react v0.556.0 - ISC 706 * 707 * This source code is licensed under the ISC license. 708 * See the LICENSE file in the root directory of this source tree. 709 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 710; 711const __iconNode = [ 712 [ 713 "circle", 714 { 715 cx: "12", 716 cy: "12", 717 r: "10", 718 key: "1mglay" 719 } 720 ], 721 [ 722 "path", 723 { 724 d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", 725 key: "1u773s" 726 } 727 ], 728 [ 729 "path", 730 { 731 d: "M12 17h.01", 732 key: "p32p05" 733 } 734 ] 735]; 736const CircleQuestionMark = (0, __TURBOPACK__imported__module__475254__["default"])("circle-question-mark", __iconNode); 737; 738__turbopack_context__.s([ 739 "default", 740 0, 741 CircleQuestionMark 742]); 743}), 744974875, ((__turbopack_context__) => { 745"use strict"; 746 747var __TURBOPACK__imported__module__23737__ = __turbopack_context__.i(23737); 748__turbopack_context__.s([ 749 "HelpCircle", 750 ()=>__TURBOPACK__imported__module__23737__["default"] 751]); 752}), 753113625, ((__turbopack_context__) => { 754"use strict"; 755 756/** 757 * @license lucide-react v0.556.0 - ISC 758 * 759 * This source code is licensed under the ISC license. 760 * See the LICENSE file in the root directory of this source tree. 761 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 762; 763const __iconNode = [ 764 [ 765 "path", 766 { 767 d: "M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z", 768 key: "zw3jo" 769 } 770 ], 771 [ 772 "path", 773 { 774 d: "M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12", 775 key: "1wduqc" 776 } 777 ], 778 [ 779 "path", 780 { 781 d: "M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17", 782 key: "kqbvx6" 783 } 784 ] 785]; 786const Layers = (0, __TURBOPACK__imported__module__475254__["default"])("layers", __iconNode); 787; 788__turbopack_context__.s([ 789 "default", 790 0, 791 Layers 792]); 793}), 794852008, ((__turbopack_context__) => { 795"use strict"; 796 797var __TURBOPACK__imported__module__113625__ = __turbopack_context__.i(113625); 798__turbopack_context__.s([ 799 "Layers", 800 ()=>__TURBOPACK__imported__module__113625__["default"] 801]); 802}), 803221345, 526943, 804((__turbopack_context__) => { 805"use strict"; 806 807// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/link.js [app-client] (ecmascript) <export default as Link> 808; 809// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/link.js [app-client] (ecmascript) 810; 811/** 812 * @license lucide-react v0.556.0 - ISC 813 * 814 * This source code is licensed under the ISC license. 815 * See the LICENSE file in the root directory of this source tree. 816 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 817; 818const __iconNode = [ 819 [ 820 "path", 821 { 822 d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", 823 key: "1cjeqo" 824 } 825 ], 826 [ 827 "path", 828 { 829 d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", 830 key: "19qd67" 831 } 832 ] 833]; 834const Link = (0, __TURBOPACK__imported__module__475254__["default"])("link", __iconNode); 835; 836__turbopack_context__.s([ 837 "default", 838 0, 839 Link 840], 526943); 841__turbopack_context__.s([ 842 "Link", 843 0, 844 Link 845], 221345); 846}), 847870273, 994958, 848((__turbopack_context__) => { 849"use strict"; 850 851// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/star.js [app-client] (ecmascript) <export default as Star> 852; 853// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/star.js [app-client] (ecmascript) 854; 855/** 856 * @license lucide-react v0.556.0 - ISC 857 * 858 * This source code is licensed under the ISC license. 859 * See the LICENSE file in the root directory of this source tree. 860 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 861; 862const __iconNode = [ 863 [ 864 "path", 865 { 866 d: "M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z", 867 key: "r04s7s" 868 } 869 ] 870]; 871const Star = (0, __TURBOPACK__imported__module__475254__["default"])("star", __iconNode); 872; 873__turbopack_context__.s([ 874 "default", 875 0, 876 Star 877], 994958); 878__turbopack_context__.s([ 879 "Star", 880 0, 881 Star 882], 870273); 883}), 884741719, ((__turbopack_context__) => { 885"use strict"; 886 887var __TURBOPACK__imported__module__843476__ = __turbopack_context__.i(843476); 888var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645); 889var __TURBOPACK__imported__module__174080__ = __turbopack_context__.i(174080); 890var __TURBOPACK__imported__module__928441__ = __turbopack_context__.i(928441); 891var __TURBOPACK__imported__module__110035__ = __turbopack_context__.i(110035); 892var __TURBOPACK__imported__module__741870__ = __turbopack_context__.i(741870); 893var __TURBOPACK__imported__module__406911__ = __turbopack_context__.i(406911); 894var __TURBOPACK__imported__module__531278__ = __turbopack_context__.i(531278); 895var __TURBOPACK__imported__module__37727__ = __turbopack_context__.i(37727); 896"use client"; 897; 898; 899; 900; 901; 902; 903; 904; 905function ConfirmDialog({ open: controlledOpen, onOpenChange, onConfirm, onCancel, title, text, confirmText, cancelText, variant = "default", loading = false, trigger }) { 906 const t = (0, __TURBOPACK__imported__module__928441__["useT"])(); 907 const dialogRef = __TURBOPACK__imported__module__271645__["useRef"](null); 908 const [internalOpen, setInternalOpen] = __TURBOPACK__imported__module__271645__["useState"](false); 909 const cancelButtonRef = __TURBOPACK__imported__module__271645__["useRef"](null); 910 const confirmButtonRef = __TURBOPACK__imported__module__271645__["useRef"](null); 911 const [portalTarget, setPortalTarget] = __TURBOPACK__imported__module__271645__["useState"](null); 912 const reactId = __TURBOPACK__imported__module__271645__["useId"](); 913 const titleId = `confirm-dialog-title-${reactId}`; 914 const descriptionId = `confirm-dialog-description-${reactId}`; 915 const isControlled = controlledOpen !== void 0; 916 const open = isControlled ? controlledOpen : internalOpen; 917 const setOpen = isControlled ? onOpenChange || (()=>{}) : setInternalOpen; 918 const handleCancelCallback = __TURBOPACK__imported__module__271645__["useCallback"](()=>{ 919 if (!isControlled) { 920 onCancel?.(); 921 } 922 }, [ 923 isControlled, 924 onCancel 925 ]); 926 const resolvedTitle = title ?? t("ui.dialogs.confirm.defaultTitle", "Are you sure?"); 927 const resolvedConfirmText = confirmText === false ? false : confirmText ?? t("ui.dialogs.confirm.confirmText", "Confirm"); 928 const resolvedCancelText = cancelText === false ? false : cancelText ?? t("ui.dialogs.confirm.cancelText", "Cancel"); 929 const closeAriaLabel = t("ui.dialog.close.ariaLabel", "Close"); 930 const requestClose = __TURBOPACK__imported__module__271645__["useCallback"](()=>{ 931 setOpen(false); 932 handleCancelCallback(); 933 }, [ 934 setOpen, 935 handleCancelCallback 936 ]); 937 __TURBOPACK__imported__module__271645__["useLayoutEffect"](()=>{ 938 setPortalTarget(document.body); 939 }, []); 940 __TURBOPACK__imported__module__271645__["useLayoutEffect"](()=>{ 941 const dialog = dialogRef.current; 942 if (!dialog) return; 943 if (open) { 944 if (!dialog.open) { 945 dialog.showModal(); 946 setTimeout(()=>{ 947 if (resolvedCancelText !== false && cancelButtonRef.current) { 948 cancelButtonRef.current.focus(); 949 } else if (confirmButtonRef.current) { 950 confirmButtonRef.current.focus(); 951 } 952 }, 0); 953 } 954 } else { 955 if (dialog.open) { 956 dialog.close(); 957 } 958 } 959 }, [ 960 open, 961 resolvedCancelText, 962 portalTarget 963 ]); 964 __TURBOPACK__imported__module__271645__["useEffect"](()=>{ 965 const dialog = dialogRef.current; 966 if (!dialog) return; 967 const handleCancel2 = (e)=>{ 968 if (loading) { 969 e.preventDefault(); 970 return; 971 } 972 requestClose(); 973 }; 974 dialog.addEventListener("cancel", handleCancel2); 975 return ()=>dialog.removeEventListener("cancel", handleCancel2); 976 }, [ 977 loading, 978 requestClose 979 ]); 980 const handleBackdropClick = (e)=>{ 981 if (e.target === dialogRef.current && !loading) { 982 requestClose(); 983 } 984 }; 985 __TURBOPACK__imported__module__271645__["useEffect"](()=>{ 986 if (!open) return; 987 con
987st handleKeyDown = (e)=>{ 988 if ((e.metaKey || e.ctrlKey) && e.key === "Enter" && !loading) { 989 e.preventDefault(); 990 handleConfirm(); 991 } 992 }; 993 window.addEventListener("keydown", handleKeyDown); 994 return ()=>window.removeEventListener("keydown", handleKeyDown); 995 }, [ 996 open, 997 loading 998 ]); 999 const handleConfirm = async ()=>{ 1000 await onConfirm(); 1001 if (!loading) { 1002 setOpen(false); 1003 } 1004 }; 1005 const handleCancel = ()=>{ 1006 requestClose(); 1007 }; 1008 const handleTriggerClick = ()=>{ 1009 if (trigger) { 1010 setOpen(true); 1011 } 1012 }; 1013 const dialogElement = /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])("dialog", { 1014 ref: dialogRef, 1015 role: "alertdialog", 1016 "aria-labelledby": titleId, 1017 "aria-describedby": text ? descriptionId : void 0, 1018 onClick: handleBackdropClick, 1019 className: (0, __TURBOPACK__imported__module__406911__["cn"])(// Reset dialog defaults 1020 "m-0 p-0 max-w-none bg-transparent border-none pointer-events-auto", // Backdrop styling 1021 "backdrop:bg-black/50 backdrop:backdrop-blur-sm backdrop:transition-opacity", // Mobile: bottom sheet 1022 "fixed inset-x-0 bottom-0 top-auto w-full", // Desktop: centered 1023 "sm:inset-auto sm:mx-auto sm:my-auto sm:max-w-md sm:top-1/2 sm:left-1/2 sm:-translate-x-1/2 sm:-translate-y-1/2", // Animation with reduced motion support 1024 "motion-safe:open:animate-in motion-safe:open:fade-in-0 motion-safe:open:slide-in-from-bottom-4", "sm:motion-safe:open:slide-in-from-bottom-0 sm:motion-safe:open:zoom-in-95", // Duration 1025 "motion-safe:open:duration-300"), 1026 children: /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsxs"])("div", { 1027 role: "document", 1028 className: (0, __TURBOPACK__imported__module__406911__["cn"])(// Panel container
1029 "flex flex-col gap-4 rounded-t-2xl border-t bg-card p-6 text-foreground shadow-lg", "sm:rounded-xl sm:border", // Relative positioning for close button 1030 "relative"), 1031 children: [ 1032 /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__741870__["IconButton"], { 1033 type: "button", 1034 variant: "ghost", 1035 size: "sm", 1036 onClick: handleCancel, 1037 disabled: loading, 1038 "aria-label": closeAriaLabel, 1039 className: "absolute right-4 top-4 opacity-70 hover:opacity-100", 1040 children: /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__37727__["X"], { 1041 className: "h-4 w-4" 1042 }) 1043 }), 1044 /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])("h2", { 1045 id: titleId, 1046 className: (0, __TURBOPACK__imported__module__406911__["cn"])("text-sm font-medium leading-snug tracking-tight pr-6", // Mobile: centered, Desktop: left-aligned 1047 "text-center sm:text-left"), 1048 children: resolvedTitle 1049 }), 1050 text && /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])("p", { 1051 id: descriptionId, 1052 className: "text-sm font-medium leading-snug text-muted-foreground", 1053 children: text 1054 }),
1055 /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsxs"])("div", { 1056 className: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", 1057 children: [ 1058 resolvedCancelText !== false && /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__110035__["Button"], { 1059 ref: cancelButtonRef, 1060 variant: "outline", 1061 onClick: handleCancel, 1062 disabled: loading, 1063 className: "w-full sm:w-auto", 1064 children: resolvedCancelText 1065 }), 1066 resolvedConfirmText !== false && /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsxs"])(__TURBOPACK__imported__module__110035__["Button"], { 1067 ref: confirmButtonRef, 1068 variant: variant === "destructive" ? "destructive" : "default", 1069 onClick: handleConfirm, 1070 disabled: loading, 1071 className: "w-full sm:w-auto", 1072 children: [ 1073 loading && /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__531278__["Loader2"], { 1074 className: "mr-2 h-4 w-4 animate-spin" 1075 }), 1076 resolvedConfirmText 1077 ] 1078 }) 1079 ] 1080 }) 1081 ] 1082 }) 1083 }); 1084 return /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsxs"])(__TURBOPACK__imported__module__843476__["Fragment"], { 1085 children: [ 1086 trigger && /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])("div", { 1087 onClick: handleTriggerClick, 1088 className: "inline-block", 1089 role: "presentation", 1090 children: trigger 1091 }), 1092 portalTarget ? /*#__PURE__*/ (0, __TURBOPACK__imported__module__174080__["createPortal"])(dialogElement, portalTarget) : null 1093 ] 1094 }); 1095} 1096; 1097__turbopack_context__.s([ 1098 "ConfirmDialog", 1099 0, 1100 ConfirmDialog 1101]); 1102}), 1103486775, ((__turbopack_context__) => { 1104"use strict"; 1105 1106var __TURBOPACK__imported__module__247167__ = /*#__PURE__*/ __turbopack_context__.i(247167); 1107var __TURBOPACK__imported__module__843476__ = __turbopack_context__.i(843476); 1108var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645); 1109var __TURBOPACK__imported__module__741719__ = __turbopack_context__.i(741719); 1110var __TURBOPACK__imported__module__488166__ = __turbopack_context__.i(488166); 1111"use client"; 1112; 1113; 1114; 1115; 1116const logger = (0, __TURBOPACK__imported__module__488166__["createLogger"])("ui"); 1117function DialogMountTracker({ trackerRef }) { 1118 __TURBOPACK__imported__module__271645__["useEffect"](()=>{ 1119 trackerRef.current = true; 1120 return ()=>{ 1121 trackerRef.current = false; 1122 }; 1123 }, [ 1124 trackerRef 1125 ]); 1126 return null; 1127} 1128function useConfirmDialog() { 1129 const [open, setOpen] = __TURBOPACK__imported__module__271645__["useState"](false); 1130 const [options, setOptions] = __TURBOPACK__imported__module__271645__["useState"]({}); 1131 const [loading, setLoading] = __TURBOPACK__imported__module__271645__["useState"](false); 1132 const resolveRef = __TURBOPACK__imported__module__271645__["useRef"](null); 1133 const openRef = __TURBOPACK__imported__module__271645__["useRef"](false); 1134 const isDialogElementRenderedRef = __TURBOPACK__imported__module__271645__["useRef"](false); 1135 const queueRef = __TURBOPACK__imported__module__271645__["useRef"]([]); 1136 const processQueue = __TURBOPACK__imported__module__271645__["useCallback"](()=>{ 1137 if (openRef.current) return; 1138 const next = queueRef.current.shift(); 1139 if (!next) return; 1140 openRef.current = true; 1141 resolveRef.current = next.resolve; 1142 queueMicrotask(()=>{ 1143 setOptions(next.options || {}); 1144 setOpen(true); 1145 }); 1146 }, []); 1147 const finalizeInteraction = __TURBOPACK__imported__module__271645__["useCallback"](()=>{ 1148 openRef.current = false;
1149 setOpen(false); 1150 queueMicrotask(()=>{ 1151 processQueue(); 1152 }); 1153 }, [ 1154 processQueue 1155 ]); 1156 const confirm = __TURBOPACK__imported__module__271645__["useCallback"]((newOptions)=>{ 1157 return new Promise((resolve)=>{ 1158 if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable 1159 ; 1160 if (openRef.current || resolveRef.current) { 1161 queueRef.current.push({ 1162 options: newOptions, 1163 resolve 1164 }); 1165 return; 1166 } 1167 openRef.current = true; 1168 resolveRef.current = resolve; 1169 queueMicrotask(()=>{ 1170 setOptions(newOptions || {}); 1171 setOpen(true); 1172 }); 1173 }); 1174 }, []); 1175 const handleConfirm = __TURBOPACK__imported__module__271645__["useCallback"](async ()=>{ 1176 setLoading(true); 1177 try { 1178 resolveRef.current?.(true); 1179 resolveRef.current = null; 1180 } finally{ 1181 setLoading(false); 1182 finalizeInteraction(); 1183 } 1184 }, [ 1185 finalizeInteraction 1186 ]); 1187 const handleCancel = __TURBOPACK__imported__module__271645__["useCallback"](()=>{ 1188 resolveRef.current?.(false); 1189 resolveRef.current = null; 1190 finalizeInteraction(); 1191 }, [ 1192 finalizeInteraction 1193 ]); 1194 const handleOpenChange = __TURBOPACK__imported__module__271645__["useCallback"]((newOpen)=>{ 1195 if (!newOpen && openRef.current) { 1196 handleCancel(); 1197 } 1198 }, [ 1199 handleCancel 1200 ]); 1201 const ConfirmDialogElement = __TURBOPACK__imported__module__271645__["useMemo"](()=>/* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsxs"])(__TURBOPACK__imported__module__843476__["Fragment"], { 1202 children: [
1203 /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(DialogMountTracker, { 1204 trackerRef: isDialogElementRenderedRef 1205 }), 1206 /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__741719__["ConfirmDialog"], { 1207 open, 1208 onOpenChange: handleOpenChange, 1209 onConfirm: handleConfirm, 1210 title: options.title, 1211 text: options.text ?? options.description, 1212 confirmText: options.confirmText, 1213 cancelText: options.cancelText, 1214 variant: options.variant, 1215 loading 1216 }) 1217 ] 1218 }), [ 1219 open, 1220 handleOpenChange, 1221 handleConfirm, 1222 options, 1223 loading 1224 ]); 1225 return { 1226 confirm, 1227 ConfirmDialogElement 1228 }; 1229} 1230; 1231__turbopack_context__.s([ 1232 "useConfirmDialog", 1233 0, 1234 useConfirmDialog 1235]); 1236}), 1237488573, ((__turbopack_context__) => { 1238"use strict"; 1239 1240var __TURBOPACK__imported__module__741719__ = __turbopack_context__.i(741719); 1241var __TURBOPACK__imported__module__486775__ = __turbopack_context__.i(486775); 1242; 1243; 1244; 1245__turbopack_context__.s([]); 1246}), 1247834161, 181692, 1248((__turbopack_context__) => { 1249"use strict"; 1250 1251// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/key.js [app-client] (ecmascript) <export default as Key> 1252; 1253// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/key.js [app-client] (ecmascript) 1254; 1255/** 1256 * @license lucide-react v0.556.0 - ISC 1257 * 1258 * This source code is licensed under the ISC license. 1259 * See the LICENSE file in the root directory of this source tree. 1260 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 1261; 1262const __iconNode = [ 1263 [ 1264 "path", 1265 { 1266 d: "m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4", 1267 key: "g0fldk" 1268 } 1269 ], 1270 [ 1271 "path", 1272 { 1273 d: "m21 2-9.6 9.6", 1274 key: "1j0ho8" 1275 } 1276 ], 1277 [ 1278 "circle", 1279 { 1280 cx: "7.5", 1281 cy: "15.5", 1282 r: "5.5", 1283 key: "yqb3hr" 1284 } 1285 ] 1286]; 1287const Key = (0, __TURBOPACK__imported__module__475254__["default"])("key", __iconNode); 1288; 1289__turbopack_context__.s([ 1290 "default", 1291 0, 1292 Key 1293], 181692); 1294__turbopack_context__.s([ 1295 "Key", 1296 0, 1297 Key 1298], 834161); 1299}), 1300370956, 824678, 1301((__turbopack_context__) => { 1302"use strict"; 1303 1304// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/list.js [app-client] (ecmascript) <export default as List> 1305; 1306// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/list.js [app-client] (ecmascript) 1307; 1308/** 1309 * @license lucide-react v0.556.0 - ISC 1310 * 1311 * This source code is licensed under the ISC license. 1312 * See the LICENSE file in the root directory of this source tree. 1313 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 1314; 1315const __iconNode = [ 1316 [ 1317 "path", 1318 { 1319 d: "M3 5h.01", 1320 key: "18ugdj" 1321 } 1322 ], 1323 [ 1324 "path", 1325 { 1326 d: "M3 12h.01", 1327 key: "nlz23k" 1328 } 1329 ], 1330 [ 1331 "path", 1332 { 1333 d: "M3 19h.01", 1334 key: "noohij" 1335 } 1336 ], 1337 [ 1338 "path", 1339 { 1340 d: "M8 5h13", 1341 key: "1pao27" 1342 } 1343 ], 1344 [ 1345 "path", 1346 { 1347 d: "M8 12h13", 1348 key: "1za7za" 1349 } 1350 ], 1351 [ 1352 "path", 1353 { 1354 d: "M8 19h13", 1355 key: "m83p4d" 1356 } 1357 ] 1358]; 1359const List = (0, __TURBOPACK__imported__module__475254__["default"])("list", __iconNode); 1360; 1361__turbopack_context__.s([ 1362 "default", 1363 0, 1364 List 1365], 824678); 1366__turbopack_context__.s([ 1367 "List", 1368 0, 1369 List 1370], 370956); 1371}), 1372194983, 895631, 1373((__turbopack_context__) => { 1374"use strict"; 1375 1376// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/message-circle.js [app-client] (ecmascript) <export default as MessageCircle> 1377; 1378// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/message-circle.js [app-client] (ecmascript) 1379; 1380/** 1381 * @license lucide-react v0.556.0 - ISC 1382 * 1383 * This source code is licensed under the ISC license. 1384 * See the LICENSE file in the root directory of this source tree. 1385 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 1386; 1387const __iconNode = [ 1388 [ 1389 "path", 1390 { 1391 d: "M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719", 1392 key: "1sd12s" 1393 } 1394 ] 1395]; 1396const MessageCircle = (0, __TURBOPACK__imported__module__475254__["default"])("message-circle", __iconNode); 1397; 1398__turbopack_context__.s([ 1399 "default", 1400 0, 1401 MessageCircle 1402], 895631); 1403__turbopack_context__.s([ 1404 "MessageCircle", 1405 0, 1406 MessageCircle 1407], 194983); 1408}), 1409561659, 247978, 1410((__turbopack_context__) => { 1411"use strict"; 1412 1413// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/credit-card.js [app-client] (ecmascript) <export default as CreditCard> 1414; 1415// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/credit-card.js [app-client] (ecmascript) 1416; 1417/** 1418 * @license lucide-react v0.556.0 - ISC 1419 * 1420 * This source code is licensed under the ISC license. 1421 * See the LICENSE file in the root directory of this source tree. 1422 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 1423; 1424const __iconNode = [ 1425 [ 1426 "rect", 1427 { 1428 width: "20", 1429 height: "14", 1430 x: "2", 1431 y: "5", 1432 rx: "2", 1433 key: "ynyp8z" 1434 } 1435 ], 1436 [ 1437 "line", 1438 { 1439 x1: "2", 1440 x2: "22", 1441 y1: "10", 1442 y2: "10", 1443 key: "1b3vmo" 1444 } 1445 ] 1446]; 1447const CreditCard = (0, __TURBOPACK__imported__module__475254__["default"])("credit-card", __iconNode); 1448; 1449__turbopack_context__.s([ 1450 "default", 1451 0, 1452 CreditCard 1453], 247978); 1454__turbopack_context__.s([
1455 "CreditCard", 1456 0, 1457 CreditCard 1458], 561659); 1459}), 1460367240, 272977, 1461((__turbopack_context__) => { 1462"use strict"; 1463 1464// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/rotate-ccw.js [app-client] (ecmascript) <export default as RotateCcw> 1465; 1466// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/rotate-ccw.js [app-client] (ecmascript) 1467; 1468/** 1469 * @license lucide-react v0.556.0 - ISC 1470 * 1471 * This source code is licensed under the ISC license. 1472 * See the LICENSE file in the root directory of this source tree. 1473 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 1474; 1475const __iconNode = [ 1476 [ 1477 "path", 1478 { 1479 d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", 1480 key: "1357e3" 1481 } 1482 ], 1483 [ 1484 "path", 1485 { 1486 d: "M3 3v5h5", 1487 key: "1xhq8a" 1488 } 1489 ] 1490]; 1491const RotateCcw = (0, __TURBOPACK__imported__module__475254__["default"])("rotate-ccw", __iconNode); 1492; 1493__turbopack_context__.s([ 1494 "default", 1495 0, 1496 RotateCcw 1497], 272977); 1498__turbopack_context__.s([ 1499 "RotateCcw", 1500 0, 1501 RotateCcw 1502], 367240); 1503}), 1504486348, ((__turbopack_context__) => { 1505"use strict"; 1506 1507/** 1508 * @license lucide-react v0.556.0 - ISC 1509 * 1510 * This source code is licensed under the ISC license. 1511 * See the LICENSE file in the root directory of this source tree. 1512 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 1513; 1514const __iconNode = [ 1515 [ 1516 "path", 1517 { 1518 d: "M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5", 1519 key: "slp6dd" 1520 } 1521 ], 1522 [ 1523 "path", 1524 { 1525 d: "M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244", 1526 key: "o0xfot" 1527 } 1528 ], 1529 [ 1530 "path", 1531 { 1532 d: "M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05", 1533 key: "wn3emo" 1534 } 1535 ] 1536]; 1537const Store = (0, __TURBOPACK__imported__module__475254__["default"])("store", __iconNode); 1538; 1539__turbopack_context__.s([ 1540 "default", 1541 0, 1542 Store 1543]); 1544}), 1545223945, ((__turbopack_context__) => { 1546"use strict"; 1547 1548var __TURBOPACK__imported__module__486348__ = __turbopack_context__.i(486348); 1549__turbopack_context__.s([ 1550 "Store", 1551 ()=>__TURBOPACK__imported__module__486348__["default"] 1552]); 1553}), 1554837647, 268586, 1555((__turbopack_context__) => { 1556"use strict"; 1557 1558// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/undo-2.js [app-client] (ecmascript) <export default as Undo2> 1559; 1560// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/undo-2.js [app-client] (ecmascript) 1561; 1562/** 1563 * @license lucide-react v0.556.0 - ISC 1564 * 1565 * This source code is licensed under the ISC license. 1566 * See the LICENSE file in the root directory of this source tree. 1567 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 1568; 1569const __iconNode = [ 1570 [ 1571 "path", 1572 { 1573 d: "M9 14 4 9l5-5", 1574 key: "102s5s" 1575 } 1576 ], 1577 [ 1578 "path", 1579 { 1580 d: "M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11", 1581 key: "f3b9sd" 1582 } 1583 ] 1584]; 1585const Undo2 = (0, __TURBOPACK__imported__module__475254__["default"])("undo-2", __iconNode); 1586; 1587__turbopack_context__.s([ 1588 "default", 1589 0, 1590 Undo2 1591], 268586); 1592__turbopack_context__.s([ 1593 "Undo2", 1594 0, 1595 Undo2 1596], 837647); 1597}), 1598750570, 738125, 1599((__turbopack_context__) => { 1600"use strict"; 1601 1602// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/grip-vertical.js [app-client] (ecmascript) <export default as GripVertical> 1603; 1604// MERGED MODULE: [project]/node_modules/lucide-react/dist/esm/icons/grip-vertical.js [app-client] (ecmascript) 1605; 1606/** 1607 * @license lucide-react v0.556.0 - ISC 1608 * 1609 * This source code is licensed under the ISC license. 1610 * See the LICENSE file in the root directory of this source tree. 1611 */ var __TURBOPACK__imported__module__475254__ = __turbopack_context__.i(475254); 1612; 1613const __iconNode = [ 1614 [ 1615 "circle", 1616 { 1617 cx: "9", 1618 cy: "12", 1619 r: "1", 1620 key: "1vctgf" 1621 } 1622 ], 1623 [ 1624 "circle", 1625 { 1626 cx: "9", 1627 cy: "5", 1628 r: "1", 1629 key: "hp0tcf" 1630 } 1631 ], 1632 [ 1633 "circle", 1634 { 1635 cx: "9", 1636 cy: "19", 1637 r: "1", 1638 key: "fkjjf6" 1639 } 1640 ], 1641 [ 1642 "circle", 1643 { 1644 cx: "15", 1645 cy: "12", 1646 r: "1", 1647 key: "1tmaij" 1648 } 1649 ], 1650 [ 1651 "circle", 1652 { 1653 cx: "15", 1654 cy: "5", 1655 r: "1", 1656 key: "19l28e" 1657 } 1658 ], 1659 [ 1660 "circle", 1661 { 1662 cx: "15", 1663 cy: "19", 1664 r: "1", 1665 key: "f4zoj3" 1666 } 1667 ] 1668]; 1669const GripVertical = (0, __TURBOPACK__imported__module__475254__["default"])("grip-vertical", __iconNode); 1670; 1671__turbopack_context__.s([ 1672 "default", 1673 0, 1674 GripVertical 1675], 738125); 1676__turbopack_context__.s([ 1677 "GripVertical", 1678 0, 1679 GripVertical 1680], 750570); 1681}),
1682477183, 807311, 168376590, 1684((__turbopack_context__) => { 1685"use strict"; 1686 1687// MERGED MODULE: [project]/node_modules/@dnd-kit/core/dist/core.esm.js [app-client] (ecmascript) 1688; 1689var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645); 1690var __TURBOPACK__imported__module__174080__ = __turbopack_context__.i(174080); 1691// MERGED MODULE: [project]/node_modules/@dnd-kit/utilities/dist/utilities.esm.js [app-client] (ecmascript) 1692; 1693var __TURBOPACK__imported__module__271645__1 = __TURBOPACK__imported__module__271645__; 1694; 1695function useCombinedRefs() { 1696 for(var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++){ 1697 refs[_key] = arguments[_key]; 1698 } 1699 return (0, __TURBOPACK__imported__module__271645__1["useMemo"])(()=>(node)=>{ 1700 refs.forEach((ref)=>ref(node)); 1701 }, refs); 1702} 1703// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js 1704const canUseDOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'; 1705function isWindow(element) { 1706 const elementString = Object.prototype.toString.call(element); 1707 return elementString === '[object Window]' || // In Electron context the Window object serializes to [object global] 1708 elementString === '[object global]'; 1709} 1710function isNode(node) { 1711 return 'nodeType' in node; 1712} 1713function getWindow(target) { 1714 var _target$ownerDocument, _target$ownerDocument2; 1715 if (!target) { 1716 return window; 1717 } 1718 if (isWindow(target)) { 1719 return target; 1720 } 1721 if (!isNode(target)) { 1722 return window; 1723 } 1724 return (_target$ownerDocument = (_target$ownerDocument2 = target.ownerDocument) == null ? void 0 : _target$ownerDocument2.defaultView) != null ? _target$ownerDocument : window; 1725} 1726function isDocument(node) { 1727 const { Document } = getWindow(node); 1728 return node instanceof Document; 1729} 1730function isHTMLElement(node) { 1731 if (isWindow(node)) { 1732 return false; 1733 } 1734 return node instanceof getWindow(node).HTMLElement; 1735} 1736function isSVGElement(node) { 1737 return node instanceof getWindow(node).SVGElement; 1738} 1739function getOwnerDocument(target) { 1740 if (!target) { 1741 return document; 1742 } 1743 if (isWindow(target)) { 1744 return target.document; 1745 } 1746 if (!isNode(target)) { 1747 return document; 1748 } 1749 if (isDocument(target)) { 1750 return target; 1751 } 1752 if (isHTMLElement(target) || isSVGElement(target)) { 1753 return target.ownerDocument; 1754 } 1755 return document; 1756} 1757/** 1758 * A hook that resolves to useEffect on the server and useLayoutEffect on the client 1759 * @param callback {function} Callback function that is invoked when the dependencies of the hook change 1760 */ const useIsomorphicLayoutEffect = canUseDOM ? __TURBOPACK__imported__module__271645__1["useLayoutEffect"] : __TURBOPACK__imported__module__271645__1["useEffect"]; 1761function useEvent(handler) { 1762 const handlerRef = (0, __TURBOPACK__imported__module__271645__1["useRef"])(handler); 1763 useIsomorphicLayoutEffect(()=>{ 1764 handlerRef.current = handler; 1765 }); 1766 return (0, __TURBOPACK__imported__module__271645__1["useCallback"])(function() { 1767 for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ 1768 args[_key] = arguments[_key]; 1769 } 1770 return handlerRef.current == null ? void 0 : handlerRef.current(...args); 1771 }, []); 1772} 1773function useInterval() { 1774 const intervalRef = (0, __TURBOPACK__imported__module__271645__1["useRef"])(null); 1775 const set = (0, __TURBOPACK__imported__module__271645__1["useCallback"])((listener, duration)=>{ 1776 intervalRef.current = setInterval(listener, duration); 1777 }, []); 1778 const clear = (0, __TURBOPACK__imported__module__271645__1["useCallback"])(()=>{ 1779 if (intervalRef.current !== null) { 1780 clearInterval(intervalRef.current); 1781 intervalRef.current = null; 1782 } 1783 }, []); 1784 return [ 1785 set, 1786 clear 1787 ]; 1788} 1789function useLatestValue(value, dependencies) { 1790 if (dependencies === void 0) { 1791 dependencies = [ 1792 value 1793 ]; 1794 } 1795 const valueRef = (0, __TURBOPACK__imported__module__271645__1["useRef"])(value); 1796 useIsomorphicLayoutEffect(()=>{ 1797 if (valueRef.current !== value) { 1798 valueRef.current = value; 1799 } 1800 }, dependencies); 1801 return valueRef; 1802} 1803function useLazyMemo(callback, dependencies) { 1804 const valueRef = (0, __TURBOPACK__imported__module__271645__1["useRef"])(); 1805 return (0, __TURBOPACK__imported__module__271645__1["useMemo"])(()=>{ 1806 const newValue = callback(valueRef.current); 1807 valueRef.current = newValue; 1808 return newValue; 1809 }, [
1810 ...dependencies 1811 ]); 1812} 1813function useNodeRef(onChange) { 1814 const onChangeHandler = useEvent(onChange); 1815 const node = (0, __TURBOPACK__imported__module__271645__1["useRef"])(null); 1816 const setNodeRef = (0, __TURBOPACK__imported__module__271645__1["useCallback"])((element)=>{ 1817 if (element !== node.current) { 1818 onChangeHandler == null ? void 0 : onChangeHandler(element, node.current); 1819 } 1820 node.current = element; 1821 }, []); 1822 return [ 1823 node, 1824 setNodeRef 1825 ]; 1826} 1827function usePrevious(value) { 1828 const ref = (0, __TURBOPACK__imported__module__271645__1["useRef"])(); 1829 (0, __TURBOPACK__imported__module__271645__1["useEffect"])(()=>{ 1830 ref.current = value; 1831 }, [ 1832 value 1833 ]); 1834 return ref.current; 1835} 1836let ids = {}; 1837function useUniqueId(prefix, value) { 1838 return (0, __TURBOPACK__imported__module__271645__1["useMemo"])(()=>{ 1839 if (value) { 1840 return value; 1841 } 1842 const id = ids[prefix] == null ? 0 : ids[prefix] + 1; 1843 ids[prefix] = id; 1844 return prefix + "-" + id; 1845 }, [ 1846 prefix, 1847 value 1848 ]); 1849} 1850function createAdjustmentFn(modifier) { 1851 return function(object) { 1852 for(var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){ 1853 adjustments[_key - 1] = arguments[_key]; 1854 } 1855 return adjustments.reduce((accumulator, adjustment)=>{ 1856 const entries = Object.entries(adjustment); 1857 for (const [key, valueAdjustment] of entries){ 1858 const value = accumulator[key]; 1859 if (value != null) { 1860 accumulator[key] = value + modifier * valueAdjustment; 1861 } 1862 } 1863 return accumulator; 1864 }, { 1865 ...object 1866 }); 1867 }; 1868} 1869const add = /*#__PURE__*/ createAdjustmentFn(1); 1870const subtract = /*#__PURE__*/ createAdjustmentFn(-1); 1871function hasViewportRelativeCoordinates(event) { 1872 return 'clientX' in event && 'clientY' in event; 1873} 1874function isKeyboardEvent(event) { 1875 if (!event) { 1876 return false; 1877 } 1878 const { KeyboardEvent } = getWindow(event.target); 1879 return KeyboardEvent && event instanceof KeyboardEvent; 1880} 1881function isTouchEvent(event) { 1882 if (!event) { 1883 return false; 1884 } 1885 const { TouchEvent } = getWindow(event.target); 1886 return TouchEvent && event instanceof TouchEvent; 1887} 1888/** 1889 * Returns the normalized x and y coordinates for mouse and touch events. 1890 */ function getEventCoordinates(event) { 1891 if (isTouchEvent(event)) { 1892 if (event.touches && event.touches.length) { 1893 const { clientX: x, clientY: y } = event.touches[0]; 1894 return { 1895 x, 1896 y 1897 }; 1898 } else if (event.changedTouches && event.changedTouches.length) { 1899 const { clientX: x, clientY: y } = event.changedTouches[0]; 1900 return { 1901 x, 1902 y 1903 }; 1904 } 1905 } 1906 if (hasViewportRelativeCoordinates(event)) { 1907 return { 1908 x: event.clientX, 1909 y: event.clientY 1910 }; 1911 } 1912 return null; 1913} 1914const CSS = /*#__PURE__*/ Object.freeze({ 1915 Translate: { 1916 toString (transform) { 1917 if (!transform) { 1918 return; 1919 } 1920 const { x, y } = transform; 1921 return "translate3d(" + (x ? Math.round(x) : 0) + "px, " + (y ? Math.round(y) : 0) + "px, 0)"; 1922 } 1923 }, 1924 Scale: { 1925 toString (transform) { 1926 if (!transform) { 1927 return; 1928 } 1929 const { scaleX, scaleY } = transform; 1930 return "scaleX(" + scaleX + ") scaleY(" + scaleY + ")"; 1931 } 1932 }, 1933 Transform: { 1934 toString (transform) { 1935 if (!transform) { 1936 return; 1937 } 1938 return [ 1939 CSS.Translate.toString(transform), 1940 CSS.Scale.toString(transform) 1941 ].join(' '); 1942 } 1943 }, 1944 Transition: { 1945 toString (_ref) { 1946 let { property, duration, easing } = _ref; 1947 return property + " " + duration + "ms " + easing; 1948 } 1949 } 1950}); 1951const SELECTOR = 'a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]'; 1952function findFirstFocusableNode(element) { 1953 if (element.matches(SELECTOR)) { 1954 return element; 1955 } 1956 return element.querySelector(SELECTOR); 1957} 1958; 1959__turbopack_context__.s([ 1960 "CSS", 1961 0, 1962 CSS, 1963 "add", 1964 0, 1965 add, 1966 "canUseDOM", 1967 0, 1968 canUseDOM, 1969 "findFirstFocusableNode", 1970 0, 1971 findFirstFocusableNode,
1972 "getEventCoordinates", 1973 0, 1974 getEventCoordinates, 1975 "getOwnerDocument", 1976 0, 1977 getOwnerDocument, 1978 "getWindow", 1979 0, 1980 getWindow, 1981 "isDocument", 1982 0, 1983 isDocument, 1984 "isHTMLElement", 1985 0, 1986 isHTMLElement, 1987 "isKeyboardEvent", 1988 0, 1989 isKeyboardEvent, 1990 "isNode", 1991 0, 1992 isNode, 1993 "isSVGElement", 1994 0, 1995 isSVGElement, 1996 "isWindow", 1997 0, 1998 isWindow, 1999 "subtract", 2000 0, 2001 subtract, 2002 "useCombinedRefs", 2003 0, 2004 useCombinedRefs, 2005 "useEvent", 2006 0, 2007 useEvent, 2008 "useInterval", 2009 0, 2010 useInterval, 2011 "useIsomorphicLayoutEffect", 2012 0, 2013 useIsomorphicLayoutEffect, 2014 "useLatestValue", 2015 0, 2016 useLatestValue, 2017 "useLazyMemo", 2018 0, 2019 useLazyMemo, 2020 "useNodeRef", 2021 0, 2022 useNodeRef, 2023 "usePrevious", 2024 0, 2025 usePrevious, 2026 "useUniqueId", 2027 0, 2028 useUniqueId 2029], 807311); 2030// MERGED MODULE: [project]/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js [app-client] (ecmascript) 2031; 2032var __TURBOPACK__imported__module__271645__2 = __TURBOPACK__imported__module__271645__; 2033; 2034const hiddenStyles = { 2035 display: 'none' 2036}; 2037function HiddenText(_ref) { 2038 let { id, value } = _ref; 2039 return __TURBOPACK__imported__module__271645__2["default"].createElement("div", { 2040 id: id, 2041 style: hiddenStyles 2042 }, value); 2043} 2044function LiveRegion(_ref) { 2045 let { id, announcement, ariaLiveType = "assertive" } = _ref; 2046 // Hide element visually but keep it readable by screen readers 2047 const visuallyHidden = { 2048 position: 'fixed', 2049 top: 0, 2050 left: 0, 2051 width: 1, 2052 height: 1, 2053 margin: -1, 2054 border: 0, 2055 padding: 0, 2056 overflow: 'hidden', 2057 clip: 'rect(0 0 0 0)', 2058 clipPath: 'inset(100%)', 2059 whiteSpace: 'nowrap' 2060 }; 2061 return __TURBOPACK__imported__module__271645__2["default"].createElement("div", { 2062 id: id, 2063 style: visuallyHidden, 2064 role: "status", 2065 "aria-live": ariaLiveType, 2066 "aria-atomic": true 2067 }, announcement); 2068} 2069function useAnnouncement() { 2070 const [announcement, setAnnouncement] = (0, __TURBOPACK__imported__module__271645__2["useState"])(''); 2071 const announce = (0, __TURBOPACK__imported__module__271645__2["useCallback"])((value)=>{ 2072 if (value != null) { 2073 setAnnouncement(value); 2074 } 2075 }, []); 2076 return { 2077 announce, 2078 announcement 2079 }; 2080} 2081; 2082; 2083; 2084; 2085; 2086const DndMonitorContext = /*#__PURE__*/ (0, __TURBOPACK__imported__module__271645__["createContext"])(null); 2087function useDndMonitor(listener) { 2088 const registerListener = (0, __TURBOPACK__imported__module__271645__["useContext"])(DndMonitorContext); 2089 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 2090 if (!registerListener) { 2091 throw new Error('useDndMonitor must be used within a children of <DndContext>'); 2092 } 2093 const unsubscribe = registerListener(listener); 2094 return unsubscribe; 2095 }, [ 2096 listener, 2097 registerListener 2098 ]); 2099} 2100function useDndMonitorProvider() { 2101 const [listeners] = (0, __TURBOPACK__imported__module__271645__["useState"])(()=>new Set()); 2102 const registerListener = (0, __TURBOPACK__imported__module__271645__["useCallback"])((listener)=>{ 2103 listeners.add(listener); 2104 return ()=>listeners.delete(listener); 2105 }, [ 2106 listeners 2107 ]); 2108 const dispatch = (0, __TURBOPACK__imported__module__271645__["useCallback"])((_ref)=>{ 2109 let { type, event } = _ref; 2110 listeners.forEach((listener)=>{ 2111 var _listener$type; 2112 return (_listener$type = listener[type]) == null ? void 0 : _listener$type.call(listener, event); 2113 }); 2114 }, [ 2115 listeners 2116 ]); 2117 return [ 2118 dispatch, 2119 registerListener 2120 ]; 2121} 2122const defaultScreenReaderInstructions = { 2123 draggable: "\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n " 2124}; 2125const defaultAnnouncements = { 2126 onDragStart (_ref) { 2127 let { active } = _ref; 2128 return "Picked up draggable item " + active.id + "."; 2129 }, 2130 onDragOver (_ref2) { 2131 let { active, over } = _ref2; 2132 if (over) { 2133 return "Draggable item " + active.id + " was moved over droppable area " + over.id + "."; 2134 } 2135 return "Draggable item " + active.id + " is no longer over a droppable area."; 2136 }, 2137 onDragEnd (_ref3) { 2138 let { active, over } = _ref3; 2139 if (over) { 2140 return "Draggable item " + active.id + " was dropped over droppable area " + over.id; 2141 } 2142 return "Draggable item " + active.id + " was dropped."; 2143 }, 2144 onDragCancel (_ref4) { 2145 let { active } = _ref4; 2146 return "Dragging was cancelled. Draggable item " + active.id + " was dropped."; 2147 } 2148}; 2149function Accessibility(_ref) { 2150 let { announcements = defaultAnnouncements, container, hiddenTextDescribedById, screenReaderInstructions = defaultScreenReaderInstructions } = _ref; 2151 const { announce, announcement } = useAnnouncement(); 2152 const liveRegionId = useUniqueId("DndLiveRegion"); 2153 const [mounted, setMounted] = (0, __TURBOPACK__imported__module__271645__["useState"])(false); 2154 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 2155 setMounted(true); 2156 }, []); 2157 useDndMonitor((0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>({ 2158 onDragStart (_ref2) { 2159 let { active } = _ref2; 2160 announce(announcements.onDragStart({ 2161 active 2162 })); 2163 }, 2164 onDragMove (_ref3) { 2165 let { active, over } = _ref3; 2166 if (announcements.onDragMove) { 2167 announce(announcements.onDragMove({ 2168 active, 2169 over 2170 })); 2171 } 2172 }, 2173 onDragOver (_ref4) { 2174 let { active, over } = _ref4; 2175 announce(announcements.onDragOver({ 2176 active, 2177 over 2178 })); 2179 }, 2180 onDragEnd (_ref5) { 2181 let { active, over } = _ref5; 2182 announce(announcements.onDragEnd({ 2183 active, 2184 over 2185 })); 2186 }, 2187 onDragCancel (_ref6) { 2188 let { active, over } = _ref6; 2189 announce(announcements.onDragCancel({ 2190 active, 2191 over 2192 })); 2193 } 2194 }), [ 2195 announce, 2196 announcements 2197 ])); 2198 if (!mounted) { 2199 return null; 2200 } 2201 const markup = __TURBOPACK__imported__module__271645__["default"].createElement(__TURBOPACK__imported__module__271645__["default"].Fragment, null, __TURBOPACK__imported__module__271645__["default"].createElement(HiddenText, { 2202 id: hiddenTextDescribedById, 2203 value: screenReaderInstructions.draggable 2204 }), __TURBOPACK__imported__module__271645__["default"].createElement(LiveRegion, { 2205 id: liveRegionId, 2206 announcement: announcement 2207 })); 2208 return container ? (0, __TURBOPACK__imported__module__174080__["createPortal"])(markup, container) : markup; 2209} 2210var Action; 2211(function(Action) { 2212 Action["DragStart"] = "dragStart"; 2213 Action["DragMove"] = "dragMove"; 2214 Action["DragEnd"] = "dragEnd"; 2215 Action["DragCancel"] = "dragCancel"; 2216 Action["DragOver"] = "dragOver"; 2217 Action["RegisterDroppable"] = "registerDroppable"; 2218 Action["SetDroppableDisabled"] = "setDroppableDisabled"; 2219 Action["UnregisterDroppable"] = "unregisterDroppable"; 2220})(Action || (Action = {})); 2221function noop() {} 2222function useSensor(sensor, options) { 2223 return (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>({ 2224 sensor, 2225 options: options != null ? options : {} 2226 }), [ 2227 sensor, 2228 options 2229 ]); 2230} 2231function useSensors() { 2232 for(var _len = arguments.length, sensors = new Array(_len), _key = 0; _key < _len; _key++){ 2233 sensors[_key] = arguments[_key]; 2234 } 2235 return (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>[ 2236 ...sensors 2237 ].filter((sensor)=>sensor != null), [ 2238 ...sensors 2239 ]); 2240} 2241const defaultCoordinates = /*#__PURE__*/ Object.freeze({ 2242 x: 0, 2243 y: 0 2244}); 2245/** 2246 * Returns the distance between two points 2247 */ function distanceBetween(p1, p2) { 2248 return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2)); 2249} 2250function getRelativeTransformOrigin(event, rect) {
vendor: 4,898 bytes, lines 2251-2393
2251 const eventCoordinates = getEventCoordinates(event); 2252 if (!eventCoordinates) { 2253 return '0 0'; 2254 } 2255 const transformOrigin = { 2256 x: (eventCoordinates.x - rect.left) / rect.width * 100, 2257 y: (eventCoordinates.y - rect.top) / rect.height * 100 2258 }; 2259 return transformOrigin.x + "% " + transformOrigin.y + "%"; 2260} 2261/** 2262 * Sort collisions from smallest to greatest value 2263 */ function sortCollisionsAsc(_ref, _ref2) { 2264 let { data: { value: a } } = _ref; 2265 let { data: { value: b } } = _ref2; 2266 return a - b; 2267} 2268/** 2269 * Sort collisions from greatest to smallest value 2270 */ function sortCollisionsDesc(_ref3, _ref4) { 2271 let { data: { value: a } } = _ref3; 2272 let { data: { value: b } } = _ref4; 2273 return b - a; 2274} 2275/** 2276 * Returns the coordinates of the corners of a given rectangle: 2277 * [TopLeft {x, y}, TopRight {x, y}, BottomLeft {x, y}, BottomRight {x, y}] 2278 */ function cornersOfRectangle(_ref5) { 2279 let { left, top, height, width } = _ref5; 2280 return [ 2281 { 2282 x: left, 2283 y: top 2284 }, 2285 { 2286 x: left + width, 2287 y: top 2288 }, 2289 { 2290 x: left, 2291 y: top + height 2292 }, 2293 { 2294 x: left + width, 2295 y: top + height 2296 } 2297 ]; 2298} 2299function getFirstCollision(collisions, property) { 2300 if (!collisions || collisions.length === 0) { 2301 return null; 2302 } 2303 const [firstCollision] = collisions; 2304 return property ? firstCollision[property] : firstCollision; 2305} 2306/** 2307 * Returns the coordinates of the center of a given ClientRect 2308 */ function centerOfRectangle(rect, left, top) { 2309 if (left === void 0) { 2310 left = rect.left; 2311 } 2312 if (top === void 0) { 2313 top = rect.top; 2314 } 2315 return { 2316 x: left + rect.width * 0.5, 2317 y: top + rect.height * 0.5 2318 }; 2319} 2320/** 2321 * Returns the closest rectangles from an array of rectangles to the center of a given 2322 * rectangle. 2323 */ const closestCenter = (_ref)=>{ 2324 let { collisionRect, droppableRects, droppableContainers } = _ref; 2325 const centerRect = centerOfRectangle(collisionRect, collisionRect.left, collisionRect.top); 2326 const collisions = []; 2327 for (const droppableContainer of droppableContainers){ 2328 const { id } = droppableContainer; 2329 const rect = droppableRects.get(id); 2330 if (rect) { 2331 const distBetween = distanceBetween(centerOfRectangle(rect), centerRect); 2332 collisions.push({ 2333 id, 2334 data: { 2335 droppableContainer, 2336 value: distBetween 2337 } 2338 }); 2339 } 2340 } 2341 return collisions.sort(sortCollisionsAsc); 2342}; 2343/** 2344 * Returns the closest rectangles from an array of rectangles to the corners of 2345 * another rectangle. 2346 */ const closestCorners = (_ref)=>{ 2347 let { collisionRect, droppableRects, droppableContainers } = _ref; 2348 const corners = cornersOfRectangle(collisionRect); 2349 const collisions = []; 2350 for (const droppableContainer of droppableContainers){ 2351 const { id } = droppableContainer; 2352 const rect = droppableRects.get(id); 2353 if (rect) { 2354 const rectCorners = cornersOfRectangle(rect); 2355 const distances = corners.reduce((accumulator, corner, index)=>{ 2356 return accumulator + distanceBetween(rectCorners[index], corner); 2357 }, 0); 2358 const effectiveDistance = Number((distances / 4).toFixed(4)); 2359 collisions.push({ 2360 id, 2361 data: { 2362 droppableContainer, 2363 value: effectiveDistance 2364 } 2365 }); 2366 } 2367 } 2368 return collisions.sort(sortCollisionsAsc); 2369}; 2370/** 2371 * Returns the intersecting rectangle area between two rectangles 2372 */ function getIntersectionRatio(entry, target) { 2373 const top = Math.max(target.top, entry.top); 2374 const left = Math.max(target.left, entry.left); 2375 const right = Math.min(target.left + target.width, entry.left + entry.width); 2376 const bottom = Math.min(target.top + target.height, entry.top + entry.height); 2377 const width = right - left; 2378 const height = bottom - top; 2379 if (left < right && top < bottom) { 2380 const targetArea = target.width * target.height; 2381 const entryArea = entry.width * entry.height; 2382 const intersectionArea = width * height; 2383 const intersectionRatio = intersectionArea / (targetArea + entryArea - intersectionArea); 2384 return Number(intersectionRatio.toFixed(4)); 2385 } // Rectangles do not overlap, or overlap has an area of zero (edge/corner overlap) 2386 return 0; 2387} 2388/** 2389 * Returns the rectangles that has the greatest intersection area with a given 2390 * rectangle in an array of rectangles. 2391 */ const rectIntersection = (_ref)=>{ 2392 let { collisionRect, droppableRects, droppableContainers } = _ref; 2393 const collisions = [];
vendor: 22,452 bytes, lines 2394-3048
2394 for (const droppableContainer of droppableContainers){ 2395 const { id } = droppableContainer; 2396 const rect = droppableRects.get(id); 2397 if (rect) { 2398 const intersectionRatio = getIntersectionRatio(rect, collisionRect); 2399 if (intersectionRatio > 0) { 2400 collisions.push({ 2401 id, 2402 data: { 2403 droppableContainer, 2404 value: intersectionRatio 2405 } 2406 }); 2407 } 2408 } 2409 } 2410 return collisions.sort(sortCollisionsDesc); 2411}; 2412/** 2413 * Check if a given point is contained within a bounding rectangle 2414 */ function isPointWithinRect(point, rect) { 2415 const { top, left, bottom, right } = rect; 2416 return top <= point.y && point.y <= bottom && left <= point.x && point.x <= right; 2417} 2418/** 2419 * Returns the rectangles that the pointer is hovering over 2420 */ const pointerWithin = (_ref)=>{ 2421 let { droppableContainers, droppableRects, pointerCoordinates } = _ref; 2422 if (!pointerCoordinates) { 2423 return []; 2424 } 2425 const collisions = []; 2426 for (const droppableContainer of droppableContainers){ 2427 const { id } = droppableContainer; 2428 const rect = droppableRects.get(id); 2429 if (rect && isPointWithinRect(pointerCoordinates, rect)) { 2430 /* There may be more than a single rectangle intersecting 2431 * with the pointer coordinates. In order to sort the 2432 * colliding rectangles, we measure the distance between 2433 * the pointer and the corners of the intersecting rectangle 2434 */ const corners = cornersOfRectangle(rect); 2435 const distances = corners.reduce((accumulator, corner)=>{ 2436 return accumulator + distanceBetween(pointerCoordinates, corner); 2437 }, 0); 2438 const effectiveDistance = Number((distances / 4).toFixed(4)); 2439 collisions.push({ 2440 id, 2441 data: { 2442 droppableContainer, 2443 value: effectiveDistance 2444 } 2445 }); 2446 } 2447 } 2448 return collisions.sort(sortCollisionsAsc); 2449}; 2450function adjustScale(transform, rect1, rect2) { 2451 return { 2452 ...transform, 2453 scaleX: rect1 && rect2 ? rect1.width / rect2.width : 1, 2454 scaleY: rect1 && rect2 ? rect1.height / rect2.height : 1 2455 }; 2456} 2457function getRectDelta(rect1, rect2) { 2458 return rect1 && rect2 ? { 2459 x: rect1.left - rect2.left, 2460 y: rect1.top - rect2.top 2461 } : defaultCoordinates; 2462} 2463function createRectAdjustmentFn(modifier) { 2464 return function adjustClientRect(rect) { 2465 for(var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){ 2466 adjustments[_key - 1] = arguments[_key]; 2467 } 2468 return adjustments.reduce((acc, adjustment)=>({ 2469 ...acc, 2470 top: acc.top + modifier * adjustment.y, 2471 bottom: acc.bottom + modifier * adjustment.y, 2472 left: acc.left + modifier * adjustment.x, 2473 right: acc.right + modifier * adjustment.x 2474 }), { 2475 ...rect 2476 }); 2477 }; 2478} 2479const getAdjustedRect = /*#__PURE__*/ createRectAdjustmentFn(1); 2480function parseTransform(transform) { 2481 if (transform.startsWith('matrix3d(')) { 2482 const transformArray = transform.slice(9, -1).split(/, /); 2483 return { 2484 x: +transformArray[12], 2485 y: +transformArray[13], 2486 scaleX: +transformArray[0], 2487 scaleY: +transformArray[5] 2488 }; 2489 } else if (transform.startsWith('matrix(')) { 2490 const transformArray = transform.slice(7, -1).split(/, /); 2491 return { 2492 x: +transformArray[4], 2493 y: +transformArray[5], 2494 scaleX: +transformArray[0], 2495 scaleY: +transformArray[3] 2496 }; 2497 } 2498 return null; 2499} 2500function inverseTransform(rect, transform, transformOrigin) { 2501 const parsedTransform = parseTransform(transform); 2502 if (!parsedTransform) { 2503 return rect; 2504 } 2505 const { scaleX, scaleY, x: translateX, y: translateY } = parsedTransform; 2506 const x = rect.left - translateX - (1 - scaleX) * parseFloat(transformOrigin); 2507 const y = rect.top - translateY - (1 - scaleY) * parseFloat(transformOrigin.slice(transformOrigin.indexOf(' ') + 1)); 2508 const w = scaleX ? rect.width / scaleX : rect.width; 2509 const h = scaleY ? rect.height / scaleY : rect.height; 2510 return { 2511 width: w, 2512 height: h, 2513 top: y, 2514 right: x + w, 2515 bottom: y + h, 2516 left: x 2517 }; 2518} 2519const defaultOptions = { 2520 ignoreTransform: false 2521}; 2522/** 2523 * Returns the bounding client rect of an element relative to the viewport. 2524 */ function getClientRect(element, options) { 2525 if (options === void 0) { 2526 options = defaultOptions; 2527 } 2528 let rect = element.getBoundingClientRect(); 2529 if (options.ignoreTransform) { 2530 const { transform, transformOrigin } = getWindow(element).getComputedStyle(element); 2531 if (transform) { 2532 rect = inverseTransform(rect, transform, transformOrigin); 2533 } 2534 } 2535 const { top, left, width, height, bottom, right } = rect; 2536 return { 2537 top, 2538 left, 2539 width, 2540 height, 2541 bottom, 2542 right 2543 }; 2544} 2545/** 2546 * Returns the bounding client rect of an element relative to the viewport. 2547 * 2548 * @remarks 2549 * The ClientRect returned by this method does not take into account transforms 2550 * applied to the element it measures. 2551 * 2552 */ function getTransformAgnosticClientRect(element) { 2553 return getClientRect(element, { 2554 ignoreTransform: true 2555 }); 2556} 2557function getWindowClientRect(element) { 2558 const width = element.innerWidth; 2559 const height = element.innerHeight; 2560 return { 2561 top: 0, 2562 left: 0, 2563 right: width, 2564 bottom: height, 2565 width, 2566 height 2567 }; 2568} 2569function isFixed(node, computedStyle) { 2570 if (computedStyle === void 0) { 2571 computedStyle = getWindow(node).getComputedStyle(node); 2572 } 2573 return computedStyle.position === 'fixed'; 2574} 2575function isScrollable(element, computedStyle) { 2576 if (computedStyle === void 0) { 2577 computedStyle = getWindow(element).getComputedStyle(element); 2578 } 2579 const overflowRegex = /(auto|scroll|overlay)/; 2580 const properties = [ 2581 'overflow', 2582 'overflowX', 2583 'overflowY' 2584 ]; 2585 return properties.some((property)=>{ 2586 const value = computedStyle[property]; 2587 return typeof value === 'string' ? overflowRegex.test(value) : false; 2588 }); 2589} 2590function getScrollableAncestors(element, limit) { 2591 const scrollParents = []; 2592 function findScrollableAncestors(node) { 2593 if (limit != null && scrollParents.length >= limit) { 2594 return scrollParents; 2595 } 2596 if (!node) { 2597 return scrollParents; 2598 } 2599 if (isDocument(node) && node.scrollingElement != null && !scrollParents.includes(node.scrollingElement)) { 2600 scrollParents.push(node.scrollingElement); 2601 return scrollParents; 2602 } 2603 if (!isHTMLElement(node) || isSVGElement(node)) { 2604 return scrollParents; 2605 } 2606 if (scrollParents.includes(node)) { 2607 return scrollParents; 2608 } 2609 const computedStyle = getWindow(element).getComputedStyle(node); 2610 if (node !== element) { 2611 if (isScrollable(node, computedStyle)) { 2612 scrollParents.push(node); 2613 } 2614 } 2615 if (isFixed(node, computedStyle)) { 2616 return scrollParents; 2617 } 2618 return findScrollableAncestors(node.parentNode); 2619 } 2620 if (!element) { 2621 return scrollParents; 2622 } 2623 return findScrollableAncestors(element); 2624} 2625function getFirstScrollableAncestor(node) { 2626 const [firstScrollableAncestor] = getScrollableAncestors(node, 1); 2627 return firstScrollableAncestor != null ? firstScrollableAncestor : null; 2628} 2629function getScrollableElement(element) { 2630 if (!canUseDOM || !element) { 2631 return null; 2632 } 2633 if (isWindow(element)) { 2634 return element; 2635 } 2636 if (!isNode(element)) { 2637 return null; 2638 } 2639 if (isDocument(element) || element === getOwnerDocument(element).scrollingElement) { 2640 return window; 2641 } 2642 if (isHTMLElement(element)) { 2643 return element; 2644 } 2645 return null; 2646} 2647function getScrollXCoordinate(element) { 2648 if (isWindow(element)) { 2649 return element.scrollX; 2650 } 2651 return element.scrollLeft; 2652} 2653function getScrollYCoordinate(element) { 2654 if (isWindow(element)) { 2655 return element.scrollY; 2656 } 2657 return element.scrollTop; 2658} 2659function getScrollCoordinates(element) { 2660 return { 2661 x: getScrollXCoordinate(element), 2662 y: getScrollYCoordinate(element) 2663 }; 2664} 2665var Direction; 2666(function(Direction) { 2667 Direction[Direction["Forward"] = 1] = "Forward"; 2668 Direction[Direction["Backward"] = -1] = "Backward"; 2669})(Direction || (Direction = {})); 2670function isDocumentScrollingElement(element) { 2671 if (!canUseDOM || !element) { 2672 return false; 2673 } 2674 return element === document.scrollingElement; 2675} 2676function getScrollPosition(scrollingContainer) { 2677 const minScroll = { 2678 x: 0, 2679 y: 0 2680 }; 2681 const dimensions = isDocumentScrollingElement(scrollingContainer) ? { 2682 height: window.innerHeight, 2683 width: window.innerWidth 2684 } : { 2685 height: scrollingContainer.clientHeight, 2686 width: scrollingContainer.clientWidth 2687 }; 2688 const maxScroll = { 2689 x: scrollingContainer.scrollWidth - dimensions.width, 2690 y: scrollingContainer.scrollHeight - dimensions.height 2691 }; 2692 const isTop = scrollingContainer.scrollTop <= minScroll.y; 2693 const isLeft = scrollingContainer.scrollLeft <= minScroll.x; 2694 const isBottom = scrollingContainer.scrollTop >= maxScroll.y; 2695 const isRight = scrollingContainer.scrollLeft >= maxScroll.x; 2696 return { 2697 isTop, 2698 isLeft, 2699 isBottom, 2700 isRight, 2701 maxScroll, 2702 minScroll 2703 }; 2704} 2705const defaultThreshold = { 2706 x: 0.2, 2707 y: 0.2 2708}; 2709function getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, _ref, acceleration, thresholdPercentage) { 2710 let { top, left, right, bottom } = _ref; 2711 if (acceleration === void 0) { 2712 acceleration = 10; 2713 } 2714 if (thresholdPercentage === void 0) { 2715 thresholdPercentage = defaultThreshold; 2716 } 2717 const { isTop, isBottom, isLeft, isRight } = getScrollPosition(scrollContainer); 2718 const direction = { 2719 x: 0, 2720 y: 0 2721 }; 2722 const speed = { 2723 x: 0, 2724 y: 0 2725 }; 2726 const threshold = { 2727 height: scrollContainerRect.height * thresholdPercentage.y, 2728 width: scrollContainerRect.width * thresholdPercentage.x 2729 }; 2730 if (!isTop && top <= scrollContainerRect.top + threshold.height) { 2731 // Scroll Up 2732 direction.y = Direction.Backward; 2733 speed.y = acceleration * Math.abs((scrollContainerRect.top + threshold.height - top) / threshold.height); 2734 } else if (!isBottom && bottom >= scrollContainerRect.bottom - threshold.height) { 2735 // Scroll Down 2736 direction.y = Direction.Forward; 2737 speed.y = acceleration * Math.abs((scrollContainerRect.bottom - threshold.height - bottom) / threshold.height); 2738 } 2739 if (!isRight && right >= scrollContainerRect.right - threshold.width) { 2740 // Scroll Right 2741 direction.x = Direction.Forward; 2742 speed.x = acceleration * Math.abs((scrollContainerRect.right - threshold.width - right) / threshold.width); 2743 } else if (!isLeft && left <= scrollContainerRect.left + threshold.width) { 2744 // Scroll Left 2745 direction.x = Direction.Backward; 2746 speed.x = acceleration * Math.abs((scrollContainerRect.left + threshold.width - left) / threshold.width); 2747 } 2748 return { 2749 direction, 2750 speed 2751 }; 2752} 2753function getScrollElementRect(element) { 2754 if (element === document.scrollingElement) { 2755 const { innerWidth, innerHeight } = window; 2756 return { 2757 top: 0, 2758 left: 0, 2759 right: innerWidth, 2760 bottom: innerHeight, 2761 width: innerWidth, 2762 height: innerHeight 2763 }; 2764 } 2765 const { top, left, right, bottom } = element.getBoundingClientRect(); 2766 return { 2767 top, 2768 left, 2769 right, 2770 bottom, 2771 width: element.clientWidth, 2772 height: element.clientHeight 2773 }; 2774} 2775function getScrollOffsets(scrollableAncestors) { 2776 return scrollableAncestors.reduce((acc, node)=>{ 2777 return add(acc, getScrollCoordinates(node)); 2778 }, defaultCoordinates); 2779} 2780function getScrollXOffset(scrollableAncestors) { 2781 return scrollableAncestors.reduce((acc, node)=>{ 2782 return acc + getScrollXCoordinate(node); 2783 }, 0); 2784} 2785function getScrollYOffset(scrollableAncestors) { 2786 return scrollableAncestors.reduce((acc, node)=>{ 2787 return acc + getScrollYCoordinate(node); 2788 }, 0); 2789} 2790function scrollIntoViewIfNeeded(element, measure) { 2791 if (measure === void 0) { 2792 measure = getClientRect; 2793 } 2794 if (!element) { 2795 return; 2796 } 2797 const { top, left, bottom, right } = measure(element); 2798 const firstScrollableAncestor = getFirstScrollableAncestor(element); 2799 if (!firstScrollableAncestor) { 2800 return; 2801 } 2802 if (bottom <= 0 || right <= 0 || top >= window.innerHeight || left >= window.innerWidth) { 2803 element.scrollIntoView({ 2804 block: 'center', 2805 inline: 'center' 2806 }); 2807 } 2808} 2809const properties = [ 2810 [ 2811 'x', 2812 [ 2813 'left', 2814 'right' 2815 ], 2816 getScrollXOffset 2817 ], 2818 [ 2819 'y', 2820 [ 2821 'top', 2822 'bottom' 2823 ], 2824 getScrollYOffset 2825 ] 2826]; 2827class Rect { 2828 constructor(rect, element){ 2829 this.rect = void 0; 2830 this.width = void 0; 2831 this.height = void 0; 2832 this.top = void 0; 2833 this.bottom = void 0; 2834 this.right = void 0; 2835 this.left = void 0; 2836 const scrollableAncestors = getScrollableAncestors(element); 2837 const scrollOffsets = getScrollOffsets(scrollableAncestors); 2838 this.rect = { 2839 ...rect 2840 }; 2841 this.width = rect.width; 2842 this.height = rect.height; 2843 for (const [axis, keys, getScrollOffset] of properties){ 2844 for (const key of keys){ 2845 Object.defineProperty(this, key, { 2846 get: ()=>{ 2847 const currentOffsets = getScrollOffset(scrollableAncestors); 2848 const scrollOffsetsDeltla = scrollOffsets[axis] - currentOffsets; 2849 return this.rect[key] + scrollOffsetsDeltla; 2850 }, 2851 enumerable: true 2852 }); 2853 } 2854 } 2855 Object.defineProperty(this, 'rect', { 2856 enumerable: false 2857 }); 2858 } 2859} 2860class Listeners { 2861 constructor(target){ 2862 this.target = void 0; 2863 this.listeners = []; 2864 this.removeAll = ()=>{ 2865 this.listeners.forEach((listener)=>{ 2866 var _this$target; 2867 return (_this$target = this.target) == null ? void 0 : _this$target.removeEventListener(...listener); 2868 }); 2869 }; 2870 this.target = target; 2871 } 2872 add(eventName, handler, options) { 2873 var _this$target2; 2874 (_this$target2 = this.target) == null ? void 0 : _this$target2.addEventListener(eventName, handler, options); 2875 this.listeners.push([ 2876 eventName, 2877 handler, 2878 options 2879 ]); 2880 } 2881} 2882function getEventListenerTarget(target) { 2883 // If the `event.target` element is removed from the document events will still be targeted 2884 // at it, and hence won't always bubble up to the window or document anymore. 2885 // If there is any risk of an element being removed while it is being dragged, 2886 // the best practice is to attach the event listeners directly to the target. 2887 // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget 2888 const { EventTarget } = getWindow(target); 2889 return target instanceof EventTarget ? target : getOwnerDocument(target); 2890} 2891function hasExceededDistance(delta, measurement) { 2892 const dx = Math.abs(delta.x); 2893 const dy = Math.abs(delta.y); 2894 if (typeof measurement === 'number') { 2895 return Math.sqrt(dx ** 2 + dy ** 2) > measurement; 2896 } 2897 if ('x' in measurement && 'y' in measurement) { 2898 return dx > measurement.x && dy > measurement.y; 2899 } 2900 if ('x' in measurement) { 2901 return dx > measurement.x; 2902 } 2903 if ('y' in measurement) { 2904 return dy > measurement.y; 2905 } 2906 return false; 2907} 2908var EventName; 2909(function(EventName) { 2910 EventName["Click"] = "click"; 2911 EventName["DragStart"] = "dragstart"; 2912 EventName["Keydown"] = "keydown"; 2913 EventName["ContextMenu"] = "contextmenu"; 2914 EventName["Resize"] = "resize"; 2915 EventName["SelectionChange"] = "selectionchange"; 2916 EventName["VisibilityChange"] = "visibilitychange"; 2917})(EventName || (EventName = {})); 2918function preventDefault(event) { 2919 event.preventDefault(); 2920} 2921function stopPropagation(event) { 2922 event.stopPropagation(); 2923} 2924var KeyboardCode; 2925(function(KeyboardCode) { 2926 KeyboardCode["Space"] = "Space"; 2927 KeyboardCode["Down"] = "ArrowDown"; 2928 KeyboardCode["Right"] = "ArrowRight"; 2929 KeyboardCode["Left"] = "ArrowLeft"; 2930 KeyboardCode["Up"] = "ArrowUp"; 2931 KeyboardCode["Esc"] = "Escape"; 2932 KeyboardCode["Enter"] = "Enter"; 2933 KeyboardCode["Tab"] = "Tab"; 2934})(KeyboardCode || (KeyboardCode = {})); 2935const defaultKeyboardCodes = { 2936 start: [ 2937 KeyboardCode.Space, 2938 KeyboardCode.Enter 2939 ], 2940 cancel: [ 2941 KeyboardCode.Esc 2942 ], 2943 end: [ 2944 KeyboardCode.Space, 2945 KeyboardCode.Enter, 2946 KeyboardCode.Tab 2947 ] 2948}; 2949const defaultKeyboardCoordinateGetter = (event, _ref)=>{ 2950 let { currentCoordinates } = _ref; 2951 switch(event.code){ 2952 case KeyboardCode.Right: 2953 return { 2954 ...currentCoordinates, 2955 x: currentCoordinates.x + 25 2956 }; 2957 case KeyboardCode.Left: 2958 return { 2959 ...currentCoordinates, 2960 x: currentCoordinates.x - 25 2961 }; 2962 case KeyboardCode.Down: 2963 return { 2964 ...currentCoordinates, 2965 y: currentCoordinates.y + 25 2966 }; 2967 case KeyboardCode.Up: 2968 return { 2969 ...currentCoordinates, 2970 y: currentCoordinates.y - 25 2971 }; 2972 } 2973 return undefined; 2974}; 2975class KeyboardSensor { 2976 constructor(props){ 2977 this.props = void 0; 2978 this.autoScrollEnabled = false; 2979 this.referenceCoordinates = void 0; 2980 this.listeners = void 0; 2981 this.windowListeners = void 0; 2982 this.props = props; 2983 const { event: { target } } = props; 2984 this.props = props; 2985 this.listeners = new Listeners(getOwnerDocument(target)); 2986 this.windowListeners = new Listeners(getWindow(target)); 2987 this.handleKeyDown = this.handleKeyDown.bind(this); 2988 this.handleCancel = this.handleCancel.bind(this); 2989 this.attach(); 2990 } 2991 attach() { 2992 this.handleStart(); 2993 this.windowListeners.add(EventName.Resize, this.handleCancel); 2994 this.windowListeners.add(EventName.VisibilityChange, this.handleCancel); 2995 setTimeout(()=>this.listeners.add(EventName.Keydown, this.handleKeyDown)); 2996 } 2997 handleStart() { 2998 const { activeNode, onStart } = this.props; 2999 const node = activeNode.node.current; 3000 if (node) { 3001 scrollIntoViewIfNeeded(node); 3002 } 3003 onStart(defaultCoordinates); 3004 } 3005 handleKeyDown(event) { 3006 if (isKeyboardEvent(event)) { 3007 const { active, context, options } = this.props; 3008 const { keyboardCodes = defaultKeyboardCodes, coordinateGetter = defaultKeyboardCoordinateGetter, scrollBehavior = 'smooth' } = options; 3009 const { code } = event; 3010 if (keyboardCodes.end.includes(code)) { 3011 this.handleEnd(event); 3012 return; 3013 } 3014 if (keyboardCodes.cancel.includes(code)) { 3015 this.handleCancel(event); 3016 return; 3017 } 3018 const { collisionRect } = context.current; 3019 const currentCoordinates = collisionRect ? { 3020 x: collisionRect.left, 3021 y: collisionRect.top 3022 } : defaultCoordinates; 3023 if (!this.referenceCoordinates) { 3024 this.referenceCoordinates = currentCoordinates; 3025 } 3026 const newCoordinates = coordinateGetter(event, { 3027 active, 3028 context: context.current, 3029 currentCoordinates 3030 }); 3031 if (newCoordinates) { 3032 const coordinatesDelta = subtract(newCoordinates, currentCoordinates); 3033 const scrollDelta = { 3034 x: 0, 3035 y: 0 3036 }; 3037 const { scrollableAncestors } = context.current; 3038 for (const scrollContainer of scrollableAncestors){ 3039 const direction = event.code; 3040 const { isTop, isRight, isLeft, isBottom, maxScroll, minScroll } = getScrollPosition(scrollContainer); 3041 const scrollElementRect = getScrollElementRect(scrollContainer); 3042 const clampedCoordinates = { 3043 x: Math.min(direction === KeyboardCode.Right ? scrollElementRect.right - scrollElementRect.width / 2 : scrollElementRect.right, Math.max(direction === KeyboardCode.Right ? scrollElementRect.left : scrollElementRect.left + scrollElementRect.width / 2, newCoordinates.x)), 3044 y: Math.min(direction === KeyboardCode.Down ? scrollElementRect.bottom - scrollElementRect.height / 2 : scrollElementRect.bottom, Math.max(direction === KeyboardCode.Down ? scrollElementRect.top : scrollElementRect.top + scrollElementRect.height / 2, newCoordinates.y)) 3045 }; 3046 const canScrollX = direction === KeyboardCode.Right && !isRight || direction === KeyboardCode.Left && !isLeft; 3047 const canScrollY = direction === KeyboardCode.Down && !isBottom || direction === KeyboardCode.Up && !isTop; 3048 if (canScrollX && clampedCoordinates.x !== newCoordinates.x) {
3049 const newScrollCoordinates = scrollContainer.scrollLeft + coordinatesDelta.x; 3050 const canScrollToNewCoordinates = direction === KeyboardCode.Right && newScrollCoordinates <= maxScroll.x || direction === KeyboardCode.Left && newScrollCoordinates >= minScroll.x; 3051 if (canScrollToNewCoordinates && !coordinatesDelta.y) { 3052 // We don't need to update coordinates, the scroll adjustment alone will trigger 3053 // logic to auto-detect the new container we are over 3054 scrollContainer.scrollTo({ 3055 left: newScrollCoordinates, 3056 behavior: scrollBehavior 3057 }); 3058 return; 3059 } 3060 if (canScrollToNewCoordinates) { 3061 scrollDelta.x = scrollContainer.scrollLeft - newScrollCoordinates; 3062 } else { 3063 scrollDelta.x = direction === KeyboardCode.Right ? scrollContainer.scrollLeft - maxScroll.x : scrollC
vendor: 10,866 bytes, lines 3063-3331
3063ontainer.scrollLeft - minScroll.x; 3064 } 3065 if (scrollDelta.x) { 3066 scrollContainer.scrollBy({ 3067 left: -scrollDelta.x, 3068 behavior: scrollBehavior 3069 }); 3070 } 3071 break; 3072 } else if (canScrollY && clampedCoordinates.y !== newCoordinates.y) { 3073 const newScrollCoordinates = scrollContainer.scrollTop + coordinatesDelta.y; 3074 const canScrollToNewCoordinates = direction === KeyboardCode.Down && newScrollCoordinates <= maxScroll.y || direction === KeyboardCode.Up && newScrollCoordinates >= minScroll.y; 3075 if (canScrollToNewCoordinates && !coordinatesDelta.x) { 3076 // We don't need to update coordinates, the scroll adjustment alone will trigger 3077 // logic to auto-detect the new container we are over 3078 scrollContainer.scrollTo({ 3079 top: newScrollCoordinates, 3080 behavior: scrollBehavior 3081 }); 3082 return; 3083 } 3084 if (canScrollToNewCoordinates) { 3085 scrollDelta.y = scrollContainer.scrollTop - newScrollCoordinates; 3086 } else { 3087 scrollDelta.y = direction === KeyboardCode.Down ? scrollContainer.scrollTop - maxScroll.y : scrollContainer.scrollTop - minScroll.y; 3088 } 3089 if (scrollDelta.y) { 3090 scrollContainer.scrollBy({ 3091 top: -scrollDelta.y, 3092 behavior: scrollBehavior 3093 }); 3094 } 3095 break; 3096 } 3097 } 3098 this.handleMove(event, add(subtract(newCoordinates, this.referenceCoordinates), scrollDelta)); 3099 } 3100 } 3101 } 3102 handleMove(event, coordinates) { 3103 const { onMove } = this.props; 3104 event.preventDefault(); 3105 onMove(coordinates); 3106 } 3107 handleEnd(event) { 3108 const { onEnd } = this.props; 3109 event.preventDefault(); 3110 this.detach(); 3111 onEnd(); 3112 } 3113 handleCancel(event) { 3114 const { onCancel } = this.props; 3115 event.preventDefault(); 3116 this.detach(); 3117 onCancel(); 3118 } 3119 detach() { 3120 this.listeners.removeAll(); 3121 this.windowListeners.removeAll(); 3122 } 3123} 3124KeyboardSensor.activators = [ 3125 { 3126 eventName: 'onKeyDown', 3127 handler: (event, _ref, _ref2)=>{ 3128 let { keyboardCodes = defaultKeyboardCodes, onActivation } = _ref; 3129 let { active } = _ref2; 3130 const { code } = event.nativeEvent; 3131 if (keyboardCodes.start.includes(code)) { 3132 const activator = active.activatorNode.current; 3133 if (activator && event.target !== activator) { 3134 return false; 3135 } 3136 event.preventDefault(); 3137 onActivation == null ? void 0 : onActivation({ 3138 event: event.nativeEvent 3139 }); 3140 return true; 3141 } 3142 return false; 3143 } 3144 } 3145]; 3146function isDistanceConstraint(constraint) { 3147 return Boolean(constraint && 'distance' in constraint); 3148} 3149function isDelayConstraint(constraint) { 3150 return Boolean(constraint && 'delay' in constraint); 3151} 3152class AbstractPointerSensor { 3153 constructor(props, events, listenerTarget){ 3154 var _getEventCoordinates; 3155 if (listenerTarget === void 0) { 3156 listenerTarget = getEventListenerTarget(props.event.target); 3157 } 3158 this.props = void 0; 3159 this.events = void 0; 3160 this.autoScrollEnabled = true; 3161 this.document = void 0; 3162 this.activated = false; 3163 this.initialCoordinates = void 0; 3164 this.timeoutId = null; 3165 this.listeners = void 0; 3166 this.documentListeners = void 0; 3167 this.windowListeners = void 0; 3168 this.props = props; 3169 this.events = events; 3170 const { event } = props; 3171 const { target } = event; 3172 this.props = props; 3173 this.events = events; 3174 this.document = getOwnerDocument(target); 3175 this.documentListeners = new Listeners(this.document); 3176 this.listeners = new Listeners(listenerTarget); 3177 this.windowListeners = new Listeners(getWindow(target)); 3178 this.initialCoordinates = (_getEventCoordinates = getEventCoordinates(event)) != null ? _getEventCoordinates : defaultCoordinates; 3179 this.handleStart = this.handleStart.bind(this); 3180 this.handleMove = this.handleMove.bind(this); 3181 this.handleEnd = this.handleEnd.bind(this); 3182 this.handleCancel = this.handleCancel.bind(this); 3183 this.handleKeydown = this.handleKeydown.bind(this); 3184 this.removeTextSelection = this.removeTextSelection.bind(this); 3185 this.attach(); 3186 } 3187 attach() { 3188 const { events, props: { options: { activationConstraint, bypassActivationConstraint } } } = this; 3189 this.listeners.add(events.move.name, this.handleMove, { 3190 passive: false 3191 }); 3192 this.listeners.add(events.end.name, this.handleEnd); 3193 if (events.cancel) { 3194 this.listeners.add(events.cancel.name, this.handleCancel); 3195 } 3196 this.windowListeners.add(EventName.Resize, this.handleCancel); 3197 this.windowListeners.add(EventName.DragStart, preventDefault); 3198 this.windowListeners.add(EventName.VisibilityChange, this.handleCancel); 3199 this.windowListeners.add(EventName.ContextMenu, preventDefault); 3200 this.documentListeners.add(EventName.Keydown, this.handleKeydown); 3201 if (activationConstraint) { 3202 if (bypassActivationConstraint != null && bypassActivationConstraint({ 3203 event: this.props.event, 3204 activeNode: this.props.activeNode, 3205 options: this.props.options 3206 })) { 3207 return this.handleStart(); 3208 } 3209 if (isDelayConstraint(activationConstraint)) { 3210 this.timeoutId = setTimeout(this.handleStart, activationConstraint.delay); 3211 this.handlePending(activationConstraint); 3212 return; 3213 } 3214 if (isDistanceConstraint(activationConstraint)) { 3215 this.handlePending(activationConstraint); 3216 return; 3217 } 3218 } 3219 this.handleStart(); 3220 } 3221 detach() { 3222 this.listeners.removeAll(); 3223 this.windowListeners.removeAll(); // Wait until the next event loop before removing document listeners 3224 // This is necessary because we listen for `click` and `selection` events on the document 3225 setTimeout(this.documentListeners.removeAll, 50); 3226 if (this.timeoutId !== null) { 3227 clearTimeout(this.timeoutId); 3228 this.timeoutId = null; 3229 } 3230 } 3231 handlePending(constraint, offset) { 3232 const { active, onPending } = this.props; 3233 onPending(active, constraint, this.initialCoordinates, offset); 3234 } 3235 handleStart() { 3236 const { initialCoordinates } = this; 3237 const { onStart } = this.props; 3238 if (initialCoordinates) { 3239 this.activated = true; // Stop propagation of click events once activation constraints are met 3240 this.documentListeners.add(EventName.Click, stopPropagation, { 3241 capture: true 3242 }); // Remove any text selection from the document 3243 this.removeTextSelection(); // Prevent further text selection while dragging 3244 this.documentListeners.add(EventName.SelectionChange, this.removeTextSelection); 3245 onStart(initialCoordinates); 3246 } 3247 } 3248 handleMove(event) { 3249 var _getEventCoordinates2; 3250 const { activated, initialCoordinates, props } = this; 3251 const { onMove, options: { activationConstraint } } = props; 3252 if (!initialCoordinates) { 3253 return; 3254 } 3255 const coordinates = (_getEventCoordinates2 = getEventCoordinates(event)) != null ? _getEventCoordinates2 : defaultCoordinates; 3256 const delta = subtract(initialCoordinates, coordinates); // Constraint validation 3257 if (!activated && activationConstraint) { 3258 if (isDistanceConstraint(activationConstraint)) { 3259 if (activationConstraint.tolerance != null && hasExceededDistance(delta, activationConstraint.tolerance)) { 3260 return this.handleCancel(); 3261 } 3262 if (hasExceededDistance(delta, activationConstraint.distance)) { 3263 return this.handleStart(); 3264 } 3265 } 3266 if (isDelayConstraint(activationConstraint)) { 3267 if (hasExceededDistance(delta, activationConstraint.tolerance)) { 3268 return this.handleCancel(); 3269 } 3270 } 3271 this.handlePending(activationConstraint, delta); 3272 return; 3273 } 3274 if (event.cancelable) { 3275 event.preventDefault(); 3276 } 3277 onMove(coordinates); 3278 } 3279 handleEnd() { 3280 const { onAbort, onEnd } = this.props; 3281 this.detach(); 3282 if (!this.activated) { 3283 onAbort(this.props.active); 3284 } 3285 onEnd(); 3286 } 3287 handleCancel() { 3288 const { onAbort, onCancel } = this.props; 3289 this.detach(); 3290 if (!this.activated) { 3291 onAbort(this.props.active); 3292 } 3293 onCancel(); 3294 } 3295 handleKeydown(event) { 3296 if (event.code === KeyboardCode.Esc) { 3297 this.handleCancel(); 3298 } 3299 } 3300 removeTextSelection() { 3301 var _this$document$getSel; 3302 (_this$document$getSel = this.document.getSelection()) == null ? void 0 : _this$document$getSel.removeAllRanges(); 3303 } 3304} 3305const events = { 3306 cancel: { 3307 name: 'pointercancel' 3308 }, 3309 move: { 3310 name: 'pointermove' 3311 }, 3312 end: { 3313 name: 'pointerup' 3314 } 3315}; 3316class PointerSensor extends AbstractPointerSensor { 3317 constructor(props){ 3318 const { event } = props; // Pointer events stop firing if the target is unmounted while dragging 3319 // Therefore we attach listeners to the owner document instead 3320 const listenerTarget = getOwnerDocument(event.target); 3321 super(props, events, listenerTarget); 3322 } 3323} 3324PointerSensor.activators = [ 3325 { 3326 eventName: 'onPointerDown', 3327 handler: (_ref, _ref2)=>{ 3328 let { nativeEvent: event } = _ref; 3329 let { onActivation } = _ref2; 3330 if (!event.isPrimary || event.button !== 0) { 3331 return false;
3332 } 3333 onActivation == null ? void 0 : onActivation({ 3334 event 3335 }); 3336 return true; 3337 } 3338 } 3339]; 3340const events$1 = { 3341 move: { 3342 name: 'mousemove' 3343 }, 3344 end: { 3345 name: 'mouseup' 3346 } 3347}; 3348var MouseButton; 3349(function(MouseButton) { 3350 MouseButton[MouseButton["RightClick"] = 2] = "RightClick"; 3351})(MouseButton || (MouseButton = {})); 3352class MouseSensor extends AbstractPointerSensor { 3353 constructor(props){ 3354 super(props, events$1, getOwnerDocument(props.event.target)); 3355 } 3356} 3357MouseSensor.activators = [ 3358 { 3359 eventName: 'onMouseDown', 3360 handler: (_ref, _ref2)=>{ 3361 let { nativeEvent: event } = _ref; 3362 let { onActivation } = _ref2; 3363 if (event.button === MouseButton.RightClick) { 3364 return false; 3365 } 3366 onActivation == null ? void 0 : onActivation({ 3367 event 3368 }); 3369 return true; 3370 } 3371 } 3372]; 3373const events$2 = { 3374 cancel: { 3375 name: 'touchcancel' 3376 }, 3377 move: { 3378 name: 'touchmove' 3379 }, 3380 end: { 3381 name: 'touchend' 3382 } 3383}; 3384class TouchSensor extends AbstractPointerSensor { 3385 constructor(props){ 3386 super(props, events$2); 3387 } 3388 static setup() { 3389 // Adding a non-capture and non-passive `touchmove` listener in order 3390 // to force `event.preventDefault()` calls to work in dynamically added 3391 // touchmove event handlers. This is required for iOS Safari. 3392 window.addEventListener(events$2.move.name, noop, { 3393 capture: false, 3394 passive: false 3395 }); 3396 return function teardown() { 3397 window.removeEventListener(events$2.move.name, noop); 3398 }; // We create a new handler because the teardown function of another sensor 3399 //TURBOPACK unreachable 3400 ; 3401 // could remove our event listener if we use a referentially equal listener. 3402 function noop() {} 3403 } 3404} 3405TouchSensor.activators = [ 3406 { 3407 eventName: 'onTouchStart', 3408 handler: (_ref, _ref2)=>{ 3409 let { nativeEvent: event } = _ref; 3410 let { onActivation } = _ref2; 3411 const { touches } = event; 3412 if (touches.length > 1) { 3413 return false; 3414 } 3415 onActivation == null ? void 0 : onActivation({ 3416 event 3417 }); 3418 return true; 3419 } 3420 } 3421]; 3422var AutoScrollActivator; 3423(function(AutoScrollActivator) { 3424 AutoScrollActivator[AutoScrollActivator["Pointer"] = 0] = "Pointer"; 3425 AutoScrollActivator[AutoScrollActivator["DraggableRect"] = 1] = "DraggableRect"; 3426})(AutoScrollActivator || (AutoScrollActivator = {})); 3427var TraversalOrder; 3428(function(TraversalOrder) { 3429 TraversalOrder[TraversalOrder["TreeOrder"] = 0] = "TreeOrder"; 3430 TraversalOrder[TraversalOrder["ReversedTreeOrder"] = 1] = "ReversedTreeOrder"; 3431})(TraversalOrder || (TraversalOrder = {})); 3432function useAutoScroller(_ref) { 3433 let { acceleration, activator = AutoScrollActivator.Pointer, canScroll, draggingRect, enabled, interval = 5, order = TraversalOrder.TreeOrder, pointerCoordinates, scrollableAncestors, scrollableAncestorRects, delta, threshold } = _ref; 3434 const scrollIntent = useScrollIntent({ 3435 delta, 3436 disabled: !enabled 3437 }); 3438 const [setAutoScrollInterval, clearAutoScrollInterval] = useInterval(); 3439 const scrollSpeed = (0, __TURBOPACK__imported__module__271645__["useRef"])({ 3440 x: 0, 3441 y: 0 3442 }); 3443 const scrollDirection = (0, __TURBOPACK__imported__module__271645__["useRef"])({ 3444 x: 0, 3445 y: 0 3446 }); 3447 const rect = (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>{ 3448 switch(activator){ 3449 case AutoScrollActivator.Pointer: 3450 return pointerCoordinates ? { 3451 top: pointerCoordinates.y, 3452 bottom: pointerCoordinates.y, 3453 left: pointerCoordinates.x, 3454 right: pointerCoordinates.x 3455 } : null; 3456 case AutoScrollActivator.DraggableRect: 3457 return draggingRect; 3458 } 3459 }, [ 3460 activator, 3461 draggingRect, 3462 pointerCoordinates 3463 ]); 3464 const scrollContainerRef = (0, __TURBOPACK__imported__module__271645__["useRef"])(null); 3465 const autoScroll = (0, __TURBOPACK__imported__module__271645__["useCallback"])(()=>{
vendor: 6,016 bytes, lines 3466-3623
3466 const scrollContainer = scrollContainerRef.current; 3467 if (!scrollContainer) { 3468 return; 3469 } 3470 const scrollLeft = scrollSpeed.current.x * scrollDirection.current.x; 3471 const scrollTop = scrollSpeed.current.y * scrollDirection.current.y; 3472 scrollContainer.scrollBy(scrollLeft, scrollTop); 3473 }, []); 3474 const sortedScrollableAncestors = (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>order === TraversalOrder.TreeOrder ? [ 3475 ...scrollableAncestors 3476 ].reverse() : scrollableAncestors, [ 3477 order, 3478 scrollableAncestors 3479 ]); 3480 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 3481 if (!enabled || !scrollableAncestors.length || !rect) { 3482 clearAutoScrollInterval(); 3483 return; 3484 } 3485 for (const scrollContainer of sortedScrollableAncestors){ 3486 if ((canScroll == null ? void 0 : canScroll(scrollContainer)) === false) { 3487 continue; 3488 } 3489 const index = scrollableAncestors.indexOf(scrollContainer); 3490 const scrollContainerRect = scrollableAncestorRects[index]; 3491 if (!scrollContainerRect) { 3492 continue; 3493 } 3494 const { direction, speed } = getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, rect, acceleration, threshold); 3495 for (const axis of [ 3496 'x', 3497 'y' 3498 ]){ 3499 if (!scrollIntent[axis][direction[axis]]) { 3500 speed[axis] = 0; 3501 direction[axis] = 0; 3502 } 3503 } 3504 if (speed.x > 0 || speed.y > 0) { 3505 clearAutoScrollInterval(); 3506 scrollContainerRef.current = scrollContainer; 3507 setAutoScrollInterval(autoScroll, interval); 3508 scrollSpeed.current = speed; 3509 scrollDirection.current = direction; 3510 return; 3511 } 3512 } 3513 scrollSpeed.current = { 3514 x: 0, 3515 y: 0 3516 }; 3517 scrollDirection.current = { 3518 x: 0, 3519 y: 0 3520 }; 3521 clearAutoScrollInterval(); 3522 }, [ 3523 acceleration, 3524 autoScroll, 3525 canScroll, 3526 clearAutoScrollInterval, 3527 enabled, 3528 interval, 3529 JSON.stringify(rect), 3530 JSON.stringify(scrollIntent), 3531 setAutoScrollInterval, 3532 scrollableAncestors, 3533 sortedScrollableAncestors, 3534 scrollableAncestorRects, 3535 JSON.stringify(threshold) 3536 ]); 3537} 3538const defaultScrollIntent = { 3539 x: { 3540 [Direction.Backward]: false, 3541 [Direction.Forward]: false 3542 }, 3543 y: { 3544 [Direction.Backward]: false, 3545 [Direction.Forward]: false 3546 } 3547}; 3548function useScrollIntent(_ref2) { 3549 let { delta, disabled } = _ref2; 3550 const previousDelta = usePrevious(delta); 3551 return useLazyMemo((previousIntent)=>{ 3552 if (disabled || !previousDelta || !previousIntent) { 3553 // Reset scroll intent tracking when auto-scrolling is disabled 3554 return defaultScrollIntent; 3555 } 3556 const direction = { 3557 x: Math.sign(delta.x - previousDelta.x), 3558 y: Math.sign(delta.y - previousDelta.y) 3559 }; // Keep track of the user intent to scroll in each direction for both axis 3560 return { 3561 x: { 3562 [Direction.Backward]: previousIntent.x[Direction.Backward] || direction.x === -1, 3563 [Direction.Forward]: previousIntent.x[Direction.Forward] || direction.x === 1 3564 }, 3565 y: { 3566 [Direction.Backward]: previousIntent.y[Direction.Backward] || direction.y === -1, 3567 [Direction.Forward]: previousIntent.y[Direction.Forward] || direction.y === 1 3568 } 3569 }; 3570 }, [ 3571 disabled, 3572 delta, 3573 previousDelta 3574 ]); 3575} 3576function useCachedNode(draggableNodes, id) { 3577 const draggableNode = id != null ? draggableNodes.get(id) : undefined; 3578 const node = draggableNode ? draggableNode.node.current : null; 3579 return useLazyMemo((cachedNode)=>{ 3580 var _ref; 3581 if (id == null) { 3582 return null; 3583 } // In some cases, the draggable node can unmount while dragging 3584 // This is the case for virtualized lists. In those situations, 3585 // we fall back to the last known value for that node. 3586 return (_ref = node != null ? node : cachedNode) != null ? _ref : null; 3587 }, [ 3588 node, 3589 id 3590 ]); 3591} 3592function useCombineActivators(sensors, getSyntheticHandler) { 3593 return (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>sensors.reduce((accumulator, sensor)=>{ 3594 const { sensor: Sensor } = sensor; 3595 const sensorActivators = Sensor.activators.map((activator)=>({ 3596 eventName: activator.eventName, 3597 handler: getSyntheticHandler(activator.handler, sensor) 3598 })); 3599 return [ 3600 ...accumulator, 3601 ...sensorActivators 3602 ]; 3603 }, []), [ 3604 sensors, 3605 getSyntheticHandler 3606 ]); 3607} 3608var MeasuringStrategy; 3609(function(MeasuringStrategy) { 3610 MeasuringStrategy[MeasuringStrategy["Always"] = 0] = "Always"; 3611 MeasuringStrategy[MeasuringStrategy["BeforeDragging"] = 1] = "BeforeDragging"; 3612 MeasuringStrategy[MeasuringStrategy["WhileDragging"] = 2] = "WhileDragging"; 3613})(MeasuringStrategy || (MeasuringStrategy = {})); 3614var MeasuringFrequency; 3615(function(MeasuringFrequency) { 3616 MeasuringFrequency["Optimized"] = "optimized"; 3617})(MeasuringFrequency || (MeasuringFrequency = {})); 3618const defaultValue = /*#__PURE__*/ new Map(); 3619function useDroppableMeasuring(containers, _ref) { 3620 let { dragging, dependencies, config } = _ref; 3621 const [queue, setQueue] = (0, __TURBOPACK__imported__module__271645__["useState"])(null); 3622 const { frequency, measure, strategy } = config; 3623 const containersRef = (0, __TURBOPACK__imported__module__271645__["useRef"])(containers
3623); 3624 const disabled = isDisabled(); 3625 const disabledRef = useLatestValue(disabled); 3626 const measureDroppableContainers = (0, __TURBOPACK__imported__module__271645__["useCallback"])(function(ids) { 3627 if (ids === void 0) { 3628 ids = []; 3629 } 3630 if (disabledRef.current) { 3631 return; 3632 } 3633 setQueue((value)=>{ 3634 if (value === null) { 3635 return ids; 3636 } 3637 return value.concat(ids.filter((id)=>!value.includes(id))); 3638 }); 3639 }, [ 3640 disabledRef 3641 ]); 3642 const timeoutId = (0, __TURBOPACK__imported__module__271645__["useRef"])(null); 3643 const droppableRects = useLazyMemo((previousValue)=>{ 3644 if (disabled && !dragging) { 3645 return defaultValue; 3646 } 3647 if (!previousValue || previousValue === defaultValue || containersRef.current !== containers || queue != null) { 3648 const map = new Map(); 3649 for (let container of containers){ 3650 if (!container) { 3651 continue; 3652 } 3653 if (queue && queue.length > 0 && !queue.includes(container.id) && container.rect.current) { 3654 // This container does not need to be re-measured 3655 map.set(container.id, container.rect.current); 3656 continue; 3657 } 3658 const node = container.node.current; 3659 const rect = node ? new Rect(measure(node), node) : null; 3660 container.rect.current = rect; 3661 if (rect) { 3662 map.set(container.id, rect); 3663 } 3664 } 3665 return map; 3666 } 3667 return previousValue; 3668 }, [ 3669 containers, 3670 queue, 3671 dragging, 3672 disabled, 3673 measure 3674 ]); 3675 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 3676 containersRef.current = containers; 3677 }, [ 3678 containers 3679 ]); 3680 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 3681 if (disabled) { 3682 return; 3683 } 3684 measureDroppableContainers(); 3685 }, [ 3686 dragging, 3687 disabled 3688 ]); 3689 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 3690 if (queue && queue.length > 0) { 3691 setQueue(null); 3692 } 3693 }, [ 3694 JSON.stringify(queue) 3695 ]); 3696 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 3697 if (disabled || typeof frequency !== 'number' || timeoutId.current !== null) { 3698 return; 3699 } 3700 timeoutId.current = setTimeout(()=>{ 3701 measureDroppableContainers(); 3702 timeoutId.current = null; 3703 }, frequency); 3704 }, [ 3705 frequency, 3706 disabled, 3707 measureDroppableContainers, 3708 ...dependencies 3709 ]); 3710 return { 3711 droppableRects, 3712 measureDroppableContainers, 3713 measuringScheduled: queue != null 3714 }; 3715 //TURBOPACK unreachable 3716 ; 3717 function isDisabled() { 3718 switch(strategy){ 3719 case MeasuringStrategy.Always: 3720 return false; 3721 case MeasuringStrategy.BeforeDragging: 3722 return dragging; 3723 default: 3724 return !dragging; 3725 } 3726 } 3727} 3728function useInitialValue(value, computeFn) { 3729 return useLazyMemo((previousValue)=>{ 3730 if (!value) { 3731 return null; 3732 } 3733 if (previousValue) { 3734 return previousValue; 3735 } 3736 return typeof computeFn === 'function' ? computeFn(value) : value; 3737 }, [ 3738 computeFn, 3739 value 3740 ]); 3741} 3742function useInitialRect(node, measure) { 3743 return useInitialValue(node, measure); 3744} 3745/** 3746 * Returns a new MutationObserver instance. 3747 * If `MutationObserver` is undefined in the execution environment, returns `undefined`. 3748 */ function useMutationObserver(_ref) { 3749 let { callback, disabled } = _ref; 3750 const handleMutations = useEvent(callback); 3751 const mutationObserver = (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>{ 3752 if (disabled || typeof window === 'undefined' || typeof window.MutationObserver === 'undefined') { 3753 return undefined; 3754 } 3755 const { MutationObserver } = window; 3756 return new MutationObserver(handleMutations); 3757 }, [ 3758 handleMutations, 3759 disabled 3760 ]); 3761 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 3762 return ()=>mutationObserver == null ? void 0 : mutationObserver.disconnect(); 3763 }, [ 3764 mutationObserver 3765 ]); 3766 return mutationObserver; 3767} 3768/** 3769 * Returns a new ResizeObserver instance bound to the `onResize` c
3769allback. 3770 * If `ResizeObserver` is undefined in the execution environment, returns `undefined`. 3771 */ function useResizeObserver(_ref) { 3772 let { callback, disabled } = _ref; 3773 const handleResize = useEvent(callback); 3774 const resizeObserver = (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>{ 3775 if (disabled || typeof window === 'undefined' || typeof window.ResizeObserver === 'undefined') { 3776 return undefined; 3777 } 3778 const { ResizeObserver } = window; 3779 return new ResizeObserver(handleResize); 3780 }, [ 3781 disabled 3782 ]); 3783 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 3784 return ()=>resizeObserver == null ? void 0 : resizeObserver.disconnect(); 3785 }, [ 3786 resizeObserver 3787 ]); 3788 return resizeObserver; 3789} 3790function defaultMeasure(element) { 3791 return new Rect(getClientRect(element), element); 3792} 3793function useRect(element, measure, fallbackRect) { 3794 if (measure === void 0) { 3795 measure = defaultMeasure; 3796 } 3797 const [rect, setRect] = (0, __TURBOPACK__imported__module__271645__["useState"])(null); 3798 function measureRect() { 3799 setRect((currentRect)=>{ 3800 if (!element) { 3801 return null; 3802 } 3803 if (element.isConnected === false) { 3804 var _ref; 3805 // Fall back to last rect we measured if the element is 3806 // no longer connected to the DOM. 3807 return (_ref = currentRect != null ? currentRect : fallbackRect) != null ? _ref : null; 3808 } 3809 const newRect = measure(element); 3810 if (JSON.stringify(currentRect) === JSON.stringify(newRect)) { 3811 return currentRect; 3812 } 3813 return newRect; 3814 }); 3815 } 3816 const mutationObserver = useMutationObserver({ 3817 callback (records) { 3818 if (!element) { 3819 return; 3820 } 3821 for (const record of records){ 3822 const { type, target } = record; 3823 if (type === 'childList' && target instanceof HTMLElement && target.contains(element)) { 3824 measureRect(); 3825 break; 3826 } 3827 } 3828 } 3829 }); 3830 const resizeObserver = useResizeObserver({ 3831 callback: measureRect 3832 }); 3833 useIsomorphicLayoutEffect(()=>{ 3834 measureRect(); 3835 if (element) { 3836 resizeObserver == null ? void 0 : resizeObserver.observe(element); 3837 mutationObserver == null ? void 0 : mutationObserver.observe(document.body, { 3838 childList: true, 3839 subtree: true 3840 }); 3841 } else { 3842 resizeObserver == null ? void 0 : resizeObserver.disconnect(); 3843 mutationObserver == null ? void 0 : mutationObserver.disconnect(); 3844 } 3845 }, [ 3846 element 3847 ]); 3848 return rect; 3849} 3850function useRectDelta(rect) { 3851 const initialRect = useInitialValue(rect); 3852 return getRectDelta(rect, initialRect); 3853} 3854const defaultValue$1 = []; 3855function useScrollableAncestors(node) { 3856 const previousNode = (0, __TURBOPACK__imported__module__271645__["useRef"])(node); 3857 const ancestors = useLazyMemo((previousValue)=>{ 3858 if (!node) { 3859 return defaultValue$1; 3860 } 3861 if (previousValue && previousValue !== defaultValue$1 && node && previousNode.current && node.parentNode === previousNode.current.parentNode) { 3862 return previousValue; 3863 } 3864 return getScrollableAncestors(node); 3865 }, [ 3866 node 3867 ]); 3868 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 3869 previousNode.current = node; 3870 }, [ 3871 node 3872 ]); 3873 return ancestors; 3874} 3875function useScrollOffsets(elements) {
3876 const [scrollCoordinates, setScrollCoordinates] = (0, __TURBOPACK__imported__module__271645__["useState"])(null); 3877 const prevElements = (0, __TURBOPACK__imported__module__271645__["useRef"])(elements); // To-do: Throttle the handleScroll callback 3878 const handleScroll = (0, __TURBOPACK__imported__module__271645__["useCallback"])((event)=>{ 3879 const scrollingElement = getScrollableElement(event.target); 3880 if (!scrollingElement) { 3881 return; 3882 } 3883 setScrollCoordinates((scrollCoordinates)=>{ 3884 if (!scrollCoordinates) { 3885 return null; 3886 } 3887 scrollCoordinates.set(scrollingElement, getScrollCoordinates(scrollingElement)); 3888 return new Map(scrollCoordinates); 3889 }); 3890 }, []); 3891 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 3892 const previousElements = prevElements.current; 3893 if (elements !== previousElements) { 3894 cleanup(previousElements); 3895 const entries = elements.map((element)=>{ 3896 const scrollableElement = getScrollableElement(element); 3897 if (scrollableElement) { 3898 scrollableElement.addEventListener('scroll', handleScroll, { 3899 passive: true 3900 }); 3901 return [ 3902 scrollableElement, 3903 getScrollCoordinates(scrollableElement) 3904 ]; 3905 } 3906 return null; 3907 }).filter((entry)=>entry != null);
3908 setScrollCoordinates(entries.length ? new Map(entries) : null); 3909 prevElements.current = elements; 3910 } 3911 return ()=>{ 3912 cleanup(elements); 3913 cleanup(previousElements); 3914 }; 3915 //TURBOPACK unreachable 3916 ; 3917 function cleanup(elements) { 3918 elements.forEach((element)=>{ 3919 const scrollableElement = getScrollableElement(element); 3920 scrollableElement == null ? void 0 : scrollableElement.removeEventListener('scroll', handleScroll); 3921 }); 3922 } 3923 }, [ 3924 handleScroll, 3925 elements 3926 ]); 3927 return (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>{ 3928 if (elements.length) { 3929 return scrollCoordinates ? Array.from(scrollCoordinates.values()).reduce((acc, coordinates)=>add(acc, coordinates), defaultCoordinates) : getScrollOffsets(elements); 3930 } 3931 return defaultCoordinates; 3932 }, [ 3933 elements, 3934 scrollCoordinates 3935 ]); 3936} 3937function useScrollOffsetsDelta(scrollOffsets, dependencies) { 3938 if (dependencies === void 0) { 3939 dependencies = []; 3940 } 3941 const initialScrollOffsets = (0, __TURBOPACK__imported__module__271645__["useRef"])(null); 3942 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 3943 initialScrollOffsets.current = null; 3944 }, dependencies); 3945 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 3946 const hasScrollOffsets = scrollOffsets !== defaultCoordinates; 3947 if (hasScrollOffsets && !initialScrollOffsets.current) { 3948 initialScrollOffsets.current = scrollOffsets; 3949 } 3950 if (!hasScrollOffsets && initialScrollOffsets.current) { 3951 initialScrollOffsets.current = null; 3952 } 3953 }, [ 3954 scrollOffsets 3955 ]); 3956 return initialScrollOffsets.current ? subtract(scrollOffsets, initialScrollOffsets.current) : defaultCoordinates; 3957} 3958function useSensorSetup(sensors) { 3959 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 3960 if (!canUseDOM) { 3961 return; 3962 } 3963 const teardownFns = sensors.map((_ref)=>{ 3964 let { sensor } = _ref; 3965 return sensor.setup == null ? void 0 : sensor.setup(); 3966 }); 3967 return ()=>{ 3968 for (const teardown of teardownFns){ 3969 teardown == null ? void 0 : teardown(); 3970 } 3971 }; 3972 }, // eslint-disable-next-line react-hooks/exhaustive-deps 3973 sensors.map((_ref2)=>{ 3974 let { sensor } = _ref2; 3975 return sensor; 3976 })); 3977} 3978function useSyntheticListeners(listeners, id) { 3979 return (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>{ 3980 return listeners.reduce((acc, _ref)=>{ 3981 let { eventName, handler } = _ref; 3982 acc[eventName] = (event)=>{ 3983 handler(event, id); 3984 }; 3985 return acc; 3986 }, {}); 3987 }, [ 3988 listeners, 3989 id 3990 ]); 3991} 3992function useWindowRect(element) { 3993 return (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>element ? getWindowClientRect(element) : null, [ 3994 element 3995 ]); 3996} 3997const defaultValue$2 = []; 3998function useRects(elements, measure) { 3999 if (measure === void 0) { 4000 measure = getClientRect; 4001 } 4002 const [firstElement] = elements; 4003 const windowRect = useWindowRect(firstElement ? getWindow(firstElement) : null); 4004 const [rects, setRects] = (0, __TURBOPACK__imported__module__271645__["useState"])(defaultValue$2); 4005 function measureRects() { 4006 setRects(()=>{ 4007 if (!elements.length) { 4008 return defaultValue$2; 4009 } 4010 return elements.map((element)=>isDocumentScrollingElement(element) ? windowRect : new Rect(measure(element), element)); 4011 }); 4012 } 4013 const resizeObserver = useResizeObserver({ 4014 callback: measureRects 4015 }); 4016 useIsomorphicLayoutEffect(()=>{ 4017 resizeObserver == null ? void 0 : resizeObserver.disconnect(); 4018 measureRects(); 4019 elements.forEach((element)=>resizeObserver == null ? void 0 : resizeObserver.observe(element)); 4020 }, [ 4021 elements 4022 ]); 4023 return rects; 4024} 4025function getMeasurableNode(node) { 4026 if (!node) { 4027 return null; 4028 } 4029 if (node.children.length > 1) { 4030 return node; 4031 } 4032 const firstChild = node.children[0]; 4033 return isHTMLElement(firstChild) ? firstChild : node; 4034} 4035function useDragOverlayMeasuring(_ref) { 4036 let { measure } = _ref; 4037 const [rect, setRect] = (0, __TURBOPACK__imported__module__271645__["useState"])(null); 4038 const handleResize = (0, __TURBOPACK__imported__module__271645__["useCallback"])((entries)=>{ 4039 for (const { target }
vendor: 5,576 bytes, lines 4039-4230
4039 of entries){ 4040 if (isHTMLElement(target)) { 4041 setRect((rect)=>{ 4042 const newRect = measure(target); 4043 return rect ? { 4044 ...rect, 4045 width: newRect.width, 4046 height: newRect.height 4047 } : newRect; 4048 }); 4049 break; 4050 } 4051 } 4052 }, [ 4053 measure 4054 ]); 4055 const resizeObserver = useResizeObserver({ 4056 callback: handleResize 4057 }); 4058 const handleNodeChange = (0, __TURBOPACK__imported__module__271645__["useCallback"])((element)=>{ 4059 const node = getMeasurableNode(element); 4060 resizeObserver == null ? void 0 : resizeObserver.disconnect(); 4061 if (node) { 4062 resizeObserver == null ? void 0 : resizeObserver.observe(node); 4063 } 4064 setRect(node ? measure(node) : null); 4065 }, [ 4066 measure, 4067 resizeObserver 4068 ]); 4069 const [nodeRef, setRef] = useNodeRef(handleNodeChange); 4070 return (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>({ 4071 nodeRef, 4072 rect, 4073 setRef 4074 }), [ 4075 rect, 4076 nodeRef, 4077 setRef 4078 ]); 4079} 4080const defaultSensors = [ 4081 { 4082 sensor: PointerSensor, 4083 options: {} 4084 }, 4085 { 4086 sensor: KeyboardSensor, 4087 options: {} 4088 } 4089]; 4090const defaultData = { 4091 current: {} 4092}; 4093const defaultMeasuringConfiguration = { 4094 draggable: { 4095 measure: getTransformAgnosticClientRect 4096 }, 4097 droppable: { 4098 measure: getTransformAgnosticClientRect, 4099 strategy: MeasuringStrategy.WhileDragging, 4100 frequency: MeasuringFrequency.Optimized 4101 }, 4102 dragOverlay: { 4103 measure: getClientRect 4104 } 4105}; 4106class DroppableContainersMap extends Map { 4107 get(id) { 4108 var _super$get; 4109 return id != null ? (_super$get = super.get(id)) != null ? _super$get : undefined : undefined; 4110 } 4111 toArray() { 4112 return Array.from(this.values()); 4113 } 4114 getEnabled() { 4115 return this.toArray().filter((_ref)=>{ 4116 let { disabled } = _ref; 4117 return !disabled; 4118 }); 4119 } 4120 getNodeFor(id) { 4121 var _this$get$node$curren, _this$get; 4122 return (_this$get$node$curren = (_this$get = this.get(id)) == null ? void 0 : _this$get.node.current) != null ? _this$get$node$curren : undefined; 4123 } 4124} 4125const defaultPublicContext = { 4126 activatorEvent: null, 4127 active: null, 4128 activeNode: null, 4129 activeNodeRect: null, 4130 collisions: null, 4131 containerNodeRect: null, 4132 draggableNodes: /*#__PURE__*/ new Map(), 4133 droppableRects: /*#__PURE__*/ new Map(), 4134 droppableContainers: /*#__PURE__*/ new DroppableContainersMap(), 4135 over: null, 4136 dragOverlay: { 4137 nodeRef: { 4138 current: null 4139 }, 4140 rect: null, 4141 setRef: noop 4142 }, 4143 scrollableAncestors: [], 4144 scrollableAncestorRects: [], 4145 measuringConfiguration: defaultMeasuringConfiguration, 4146 measureDroppableContainers: noop, 4147 windowRect: null, 4148 measuringScheduled: false 4149}; 4150const defaultInternalContext = { 4151 activatorEvent: null, 4152 activators: [], 4153 active: null, 4154 activeNodeRect: null, 4155 ariaDescribedById: { 4156 draggable: '' 4157 }, 4158 dispatch: noop, 4159 draggableNodes: /*#__PURE__*/ new Map(), 4160 over: null, 4161 measureDroppableContainers: noop 4162}; 4163const InternalContext = /*#__PURE__*/ (0, __TURBOPACK__imported__module__271645__["createContext"])(defaultInternalContext); 4164const PublicContext = /*#__PURE__*/ (0, __TURBOPACK__imported__module__271645__["createContext"])(defaultPublicContext); 4165function getInitialState() { 4166 return { 4167 draggable: { 4168 active: null, 4169 initialCoordinates: { 4170 x: 0, 4171 y: 0 4172 }, 4173 nodes: new Map(), 4174 translate: { 4175 x: 0, 4176 y: 0 4177 } 4178 }, 4179 droppable: { 4180 containers: new DroppableContainersMap() 4181 } 4182 }; 4183} 4184function reducer(state, action) { 4185 switch(action.type){ 4186 case Action.DragStart: 4187 return { 4188 ...state, 4189 draggable: { 4190 ...state.draggable, 4191 initialCoordinates: action.initialCoordinates, 4192 active: action.active 4193 } 4194 }; 4195 case Action.DragMove: 4196 if (state.draggable.active == null) { 4197 return state; 4198 } 4199 return { 4200 ...state, 4201 draggable: { 4202 ...state.draggable, 4203 translate: { 4204 x: action.coordinates.x - state.draggable.initialCoordinates.x, 4205 y: action.coordinates.y - state.draggable.initialCoordinates.y 4206 } 4207 } 4208 }; 4209 case Action.DragEnd: 4210 case Action.DragCancel: 4211 return { 4212 ...state, 4213 draggable: { 4214 ...state.draggable, 4215 active: null, 4216 initialCoordinates: { 4217 x: 0, 4218 y: 0 4219 }, 4220 translate: { 4221 x: 0, 4222 y: 0 4223 } 4224 } 4225 }; 4226 case Action.RegisterDroppable: 4227 { 4228 const { element } = action; 4229 const { id } = element; 4230 const containers = new DroppableContainersMap(state.droppable.containers
4230); 4231 containers.set(id, element); 4232 return { 4233 ...state, 4234 droppable: { 4235 ...state.droppable, 4236 containers 4237 } 4238 }; 4239 } 4240 case Action.SetDroppableDisabled: 4241 { 4242 const { id, key, disabled } = action; 4243 const element = state.droppable.containers.get(id); 4244 if (!element || key !== element.key) { 4245 return state; 4246 } 4247 const containers = new DroppableContainersMap(state.droppable.containers); 4248 containers.set(id, { 4249 ...element, 4250 disabled 4251 }); 4252 return { 4253 ...state, 4254 droppable: { 4255 ...state.droppable, 4256 containers 4257 } 4258 }; 4259 } 4260 case Action.UnregisterDroppable: 4261 { 4262 const { id, key } = action; 4263 const element = state.droppable.containers.get(id); 4264 if (!element || key !== element.key) { 4265 return state; 4266 } 4267 const containers = new DroppableContainersMap(state.droppable.containers); 4268 containers.delete(id); 4269 return { 4270 ...state, 4271 droppable: { 4272 ...state.droppable, 4273 containers 4274 } 4275 }; 4276 } 4277 default: 4278 { 4279 return state; 4280 } 4281 } 4282} 4283function RestoreFocus(_ref) { 4284 let { disabled } = _ref; 4285 const { active, activatorEvent, draggableNodes } = (0, __TURBOPACK__imported__module__271645__["useContext"])(InternalContext); 4286 const previousActivatorEvent = usePrevious(activatorEvent); 4287 const previousActiveId = usePrevious(active == null ? void 0 : active.id); // Restore keyboard focus on the activator node 4288 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 4289 if (disabled) { 4290 return; 4291 } 4292 if (!activatorEvent && previousActivatorEvent && previousActiveId != null) { 4293 if (!isKeyboardEvent(previousActivatorEvent)) { 4294 return; 4295 } 4296 if (document.activeElement === previousActivatorEvent.target) { 4297 // No need to restore focus 4298 return; 4299 } 4300 const draggableNode = draggableNodes.get(previousActiveId); 4301 if (!draggableNode) { 4302 return; 4303 } 4304 const { activatorNode, node } = draggableNode; 4305 if (!activatorNode.current && !node.current) { 4306 return; 4307 } 4308 requestAnimationFrame(()=>{ 4309 for (const element of [ 4310 activatorNode.current, 4311 node.current 4312 ]){ 4313 if (!element) { 4314 continue; 4315 } 4316 const focusableNode = findFirstFocusableNode(element); 4317 if (focusableNode) { 4318 focusableNode.focus(); 4319 break; 4320 } 4321 } 4322 }); 4323 } 4324 }, [ 4325 activatorEvent, 4326 disabled, 4327 draggableNodes, 4328 previousActiveId, 4329 previousActivatorEvent 4330 ]); 4331 return null; 4332} 4333function applyModifiers(modifiers, _ref) { 4334 let { transform, ...args } = _ref; 4335 return modifiers != null && modifiers.length ? modifiers.reduce((accumulator, modifier)=>{ 4336 return modifier({ 4337 transform: accumulator, 4338 ...args 4339 }); 4340 }, transform) : transform; 4341} 4342function useMeasuringConfiguration(config) { 4343 return (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>({ 4344 draggable: { 4345 ...defaultMeasuringConfiguration.draggable, 4346 ...config == null ? void 0 : config.draggable 4347 }, 4348 droppable: { 4349 ...defaultMeasuringConfiguration.droppable, 4350 ...config == null ? void 0 : config.droppable 4351 }, 4352 dragOverlay: { 4353 ...defaultMeasuringConfiguration.dragOverlay, 4354 ...config == null ? void 0 : config.dragOverlay 4355 } 4356 }), [ 4357 config == null ? void 0 : config.draggable, 4358 config == null ? void 0 : config.droppable, 4359 config == null ? void 0 : config.dragOverlay 4360 ]); 4361}
4362function useLayoutShiftScrollCompensation(_ref) { 4363 let { activeNode, measure, initialRect, config = true } = _ref; 4364 const initialized = (0, __TURBOPACK__imported__module__271645__["useRef"])(false); 4365 const { x, y } = typeof config === 'boolean' ? { 4366 x: config, 4367 y: config 4368 } : config; 4369 useIsomorphicLayoutEffect(()=>{ 4370 const disabled = !x && !y; 4371 if (disabled || !activeNode) { 4372 initialized.current = false; 4373 return; 4374 } 4375 if (initialized.current || !initialRect) { 4376 // Return early if layout shift scroll compensation was already attempted 4377 // or if there is no initialRect to compare to. 4378 return; 4379 } // Get the most up to date node ref for the active draggable 4380 const node = activeNode == null ? void 0 : activeNode.node.current; 4381 if (!node || node.isConnected === false) { 4382 // Return early if there is no attached node ref or if the node is 4383 // disconnected from the document. 4384 return; 4385 } 4386 const rect = measure(node); 4387 const rectDelta = getRectDelta(rect, initialRect); 4388 if (!x) { 4389 rectDelta.x = 0; 4390 } 4391 if (!y) { 4392 rectDelta.y = 0; 4393 } // Only perform layout shift scroll compensation once 4394 initialized.current = true; 4395 if (Math.abs(rectDelta.x) > 0 || Math.abs(rectDelta.y) > 0) { 4396 const firstScrollableAncestor = getFirstScrollableAncestor(node); 4397 if (firstScrollableAncestor) { 4398 firstScrollableAncestor.scrollBy({ 4399 top: rectDelta.y, 4400 left: rectDelta.x 4401 }); 4402 } 4403 } 4404 }, [ 4405 activeNode, 4406 x, 4407 y, 4408 initialRect, 4409 measure 4410 ]); 4411} 4412const ActiveDraggableContext = /*#__PURE__*/ (0, __TURBOPACK__imported__module__271645__["createContext"])({ 4413 ...defaultCoordinates, 4414 scaleX: 1, 4415 scaleY: 1 4416}); 4417var Status; 4418(function(Status) { 4419 Status[Status["Uninitialized"] = 0] = "Uninitialized"; 4420 Status[Status["Initializing"] = 1] = "Initializing"; 4421 Status[Status["Initialized"] = 2] = "Initialized"; 4422})(Status || (Status = {})); 4423const DndContext = /*#__PURE__*/ (0, __TURBOPACK__imported__module__271645__["memo"])(function DndContext(_ref) { 4424 var _sensorContext$curren, _dragOverlay$nodeRef$, _dragOverlay$rect, _over$rect; 4425 let { id, accessibility, autoScroll = true, children, sensors = defaultSensors, collisionDetection = rectIntersection, measuring, modifiers, ...props } = _ref; 4426 const store = (0, __TURBOPACK__imported__module__271645__["useReducer"])(reducer, undefined, getInitialState); 4427 const [state, dispatch] = store; 4428 const [dispatchMonitorEvent, registerMonitorListener] = useDndMonitorProvider(); 4429 const [status, setStatus] = (0, __TURBOPACK__imported__module__271645__["useState"])(Status.Uninitialized); 4430 const isInitialized = status === Status.Initialized; 4431 const { draggable: { active: activeId, nodes: draggableNodes, translate }, droppable: { containers: droppableContainers } } = state; 4432 const node = activeId != null ? draggableNodes.get(activeId) : null; 4433 const activeRects = (0, __TURBOPACK__imported__module__271645__["useRef"])({ 4434 initial: null, 4435 translated: null 4436 }); 4437 const active = (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>{ 4438 var _node$data; 4439 return activeId != null ? { 4440 id: activeId, 4441 // It's possible for the active node to unmount while dragging 4442 data: (_node$data = node == null ? void 0 : node.data) != null ? _node$data : defaultData, 4443 rect: activeRects 4444 } : null; 4445 }, [ 4446 activeId, 4447 node 4448 ]); 4449 const activeRef = (0, __TURBOPACK__imported__module__271645__["useRef"])(null); 4450 const [activeSensor, setActiveSensor] = (0, __TURBOPACK__imported__module__271645__["useState"])(null); 4451 const [activatorEvent, setActivatorEvent] = (0, __TURBOPACK__imported__module__271645__["useState"])(null); 4452 const latestProps = useLatestValue(props, Object.values(props)); 4453 const draggableDescribedById = useUniqueId("DndDescribedBy", id); 4454 const enabledDroppableContainers = (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>droppableContainers.getEnabled(), [ 4455 droppableContainers 4456 ]); 4457 const measuringConfiguration = useMeasuringConfiguration(measuring); 4458 const { droppableRects, measureDroppableContainers, measuringScheduled } = useDroppableMeasuring(enabledDroppableContainers, { 4459 dragging: isInitialized, 4460 dependencies: [ 4461 translate.x, 4462 translate.y 4463 ], 4464 config: measuringConfiguration.droppable 4465 }); 4466 const activeNode = useCachedNode(draggableNodes, activeId); 4467 const activationCoordinates = (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>
vendor: 5,430 bytes, lines 4467-4569
4467activatorEvent ? getEventCoordinates(activatorEvent) : null, [ 4468 activatorEvent 4469 ]); 4470 const autoScrollOptions = getAutoScrollerOptions(); 4471 const initialActiveNodeRect = useInitialRect(activeNode, measuringConfiguration.draggable.measure); 4472 useLayoutShiftScrollCompensation({ 4473 activeNode: activeId != null ? draggableNodes.get(activeId) : null, 4474 config: autoScrollOptions.layoutShiftCompensation, 4475 initialRect: initialActiveNodeRect, 4476 measure: measuringConfiguration.draggable.measure 4477 }); 4478 const activeNodeRect = useRect(activeNode, measuringConfiguration.draggable.measure, initialActiveNodeRect); 4479 const containerNodeRect = useRect(activeNode ? activeNode.parentElement : null); 4480 const sensorContext = (0, __TURBOPACK__imported__module__271645__["useRef"])({ 4481 activatorEvent: null, 4482 active: null, 4483 activeNode, 4484 collisionRect: null, 4485 collisions: null, 4486 droppableRects, 4487 draggableNodes, 4488 draggingNode: null, 4489 draggingNodeRect: null, 4490 droppableContainers, 4491 over: null, 4492 scrollableAncestors: [], 4493 scrollAdjustedTranslate: null 4494 }); 4495 const overNode = droppableContainers.getNodeFor((_sensorContext$curren = sensorContext.current.over) == null ? void 0 : _sensorContext$curren.id); 4496 const dragOverlay = useDragOverlayMeasuring({ 4497 measure: measuringConfiguration.dragOverlay.measure 4498 }); // Use the rect of the drag overlay if it is mounted 4499 const draggingNode = (_dragOverlay$nodeRef$ = dragOverlay.nodeRef.current) != null ? _dragOverlay$nodeRef$ : activeNode; 4500 const draggingNodeRect = isInitialized ? (_dragOverlay$rect = dragOverlay.rect) != null ? _dragOverlay$rect : activeNodeRect : null; 4501 const usesDragOverlay = Boolean(dragOverlay.nodeRef.current && dragOverlay.rect); // The delta between the previous and new position of the draggable node 4502 // is only relevant when there is no drag overlay 4503 const nodeRectDelta = useRectDelta(usesDragOverlay ? null : activeNodeRect); // Get the window rect of the dragging node 4504 const windowRect = useWindowRect(draggingNode ? getWindow(draggingNode) : null); // Get scrollable ancestors of the dragging node 4505 const scrollableAncestors = useScrollableAncestors(isInitialized ? overNode != null ? overNode : activeNode : null); 4506 const scrollableAncestorRects = useRects(scrollableAncestors); // Apply modifiers 4507 const modifiedTranslate = applyModifiers(modifiers, { 4508 transform: { 4509 x: translate.x - nodeRectDelta.x, 4510 y: translate.y - nodeRectDelta.y, 4511 scaleX: 1, 4512 scaleY: 1 4513 }, 4514 activatorEvent, 4515 active, 4516 activeNodeRect, 4517 containerNodeRect, 4518 draggingNodeRect, 4519 over: sensorContext.current.over, 4520 overlayNodeRect: dragOverlay.rect, 4521 scrollableAncestors, 4522 scrollableAncestorRects, 4523 windowRect 4524 }); 4525 const pointerCoordinates = activationCoordinates ? add(activationCoordinates, translate) : null; 4526 const scrollOffsets = useScrollOffsets(scrollableAncestors); // Represents the scroll delta since dragging was initiated 4527 const scrollAdjustment = useScrollOffsetsDelta(scrollOffsets); // Represents the scroll delta since the last time the active node rect was measured 4528 const activeNodeScrollDelta = useScrollOffsetsDelta(scrollOffsets, [ 4529 activeNodeRect 4530 ]); 4531 const scrollAdjustedTranslate = add(modifiedTranslate, scrollAdjustment); 4532 const collisionRect = draggingNodeRect ? getAdjustedRect(draggingNodeRect, modifiedTranslate) : null; 4533 const collisions = active && collisionRect ? collisionDetection({ 4534 active, 4535 collisionRect, 4536 droppableRects, 4537 droppableContainers: enabledDroppableContainers, 4538 pointerCoordinates 4539 }) : null; 4540 const overId = getFirstCollision(collisions, 'id'); 4541 const [over, setOver] = (0, __TURBOPACK__imported__module__271645__["useState"])(null); // When there is no drag overlay used, we need to account for the 4542 // window scroll delta 4543 const appliedTranslate = usesDragOverlay ? modifiedTranslate : add(modifiedTranslate, activeNodeScrollDelta); 4544 const transform = adjustScale(appliedTranslate, (_over$rect = over == null ? void 0 : over.rect) != null ? _over$rect : null, activeNodeRect); 4545 const activeSensorRef = (0, __TURBOPACK__imported__module__271645__["useRef"])(null); 4546 const instantiateSensor = (0, __TURBOPACK__imported__module__271645__["useCallback"])((event, _ref2)=>{ 4547 let { sensor: Sensor, options } = _ref2; 4548 if (activeRef.current == null) { 4549 return; 4550 } 4551 const activeNode = draggableNodes.get(activeRef.current); 4552 if (!activeNode) { 4553 return; 4554 } 4555 const activatorEvent = event.nativeEvent; 4556 const sensorInstance = new Sensor({ 4557 active: activeRef.current, 4558 activeNode, 4559 event: activatorEvent, 4560 options, 4561 // Sensors need to be instantiated with refs for arguments that change over time 4562 // otherwise they are frozen in time with the stale arguments 4563 context: sensorContext, 4564 onAbort (id) { 4565 const draggableNode = draggableNodes.get(id); 4566 if (!draggableNode) { 4567 return; 4568 } 4569 const { onDragAbort }
vendor: 3,880 bytes, lines 4569-4667
4569 = latestProps.current; 4570 const event = { 4571 id 4572 }; 4573 onDragAbort == null ? void 0 : onDragAbort(event); 4574 dispatchMonitorEvent({ 4575 type: 'onDragAbort', 4576 event 4577 }); 4578 }, 4579 onPending (id, constraint, initialCoordinates, offset) { 4580 const draggableNode = draggableNodes.get(id); 4581 if (!draggableNode) { 4582 return; 4583 } 4584 const { onDragPending } = latestProps.current; 4585 const event = { 4586 id, 4587 constraint, 4588 initialCoordinates, 4589 offset 4590 }; 4591 onDragPending == null ? void 0 : onDragPending(event); 4592 dispatchMonitorEvent({ 4593 type: 'onDragPending', 4594 event 4595 }); 4596 }, 4597 onStart (initialCoordinates) { 4598 const id = activeRef.current; 4599 if (id == null) { 4600 return; 4601 } 4602 const draggableNode = draggableNodes.get(id); 4603 if (!draggableNode) { 4604 return; 4605 } 4606 const { onDragStart } = latestProps.current; 4607 const event = { 4608 activatorEvent, 4609 active: { 4610 id, 4611 data: draggableNode.data, 4612 rect: activeRects 4613 } 4614 }; 4615 (0, __TURBOPACK__imported__module__174080__["unstable_batchedUpdates"])(()=>{ 4616 onDragStart == null ? void 0 : onDragStart(event); 4617 setStatus(Status.Initializing); 4618 dispatch({ 4619 type: Action.DragStart, 4620 initialCoordinates, 4621 active: id 4622 }); 4623 dispatchMonitorEvent({ 4624 type: 'onDragStart', 4625 event 4626 }); 4627 setActiveSensor(activeSensorRef.current); 4628 setActivatorEvent(activatorEvent); 4629 }); 4630 }, 4631 onMove (coordinates) { 4632 dispatch({ 4633 type: Action.DragMove, 4634 coordinates 4635 }); 4636 }, 4637 onEnd: createHandler(Action.DragEnd), 4638 onCancel: createHandler(Action.DragCancel) 4639 }); 4640 activeSensorRef.current = sensorInstance; 4641 function createHandler(type) { 4642 return async function handler() { 4643 const { active, collisions, over, scrollAdjustedTranslate } = sensorContext.current; 4644 let event = null; 4645 if (active && scrollAdjustedTranslate) { 4646 const { cancelDrop } = latestProps.current; 4647 event = { 4648 activatorEvent, 4649 active: active, 4650 collisions, 4651 delta: scrollAdjustedTranslate, 4652 over 4653 }; 4654 if (type === Action.DragEnd && typeof cancelDrop === 'function') { 4655 const shouldCancel = await Promise.resolve(cancelDrop(event)); 4656 if (shouldCancel) { 4657 type = Action.DragCancel; 4658 } 4659 } 4660 } 4661 activeRef.current = null; 4662 (0, __TURBOPACK__imported__module__174080__["unstable_batchedUpdates"])(()=>{ 4663 dispatch({ 4664 type 4665 }); 4666 setStatus(Status.Uninitialized); 4667 setOver(null);
4668 setActiveSensor(null); 4669 setActivatorEvent(null); 4670 activeSensorRef.current = null; 4671 const eventName = type === Action.DragEnd ? 'onDragEnd' : 'onDragCancel'; 4672 if (event) { 4673 const handler = latestProps.current[eventName]; 4674 handler == null ? void 0 : handler(event); 4675 dispatchMonitorEvent({ 4676 type: eventName, 4677 event 4678 }); 4679 } 4680 }); 4681 }; 4682 } 4683 }, [ 4684 draggableNodes 4685 ]); 4686 const bindActivatorToSensorInstantiator = (0, __TURBOPACK__imported__module__271645__["useCallback"])((handler, sensor)=>{ 4687 return (event, active)=>{ 4688 const nativeEvent = event.nativeEvent; 4689 const activeDraggableNode = draggableNodes.get(active); 4690 if (activeRef.current !== null || // No active draggable 4691 !activeDraggableNode || // Event has already been captured 4692 nativeEvent.dndKit || nativeEvent.defaultPrevented) { 4693 return; 4694 } 4695 const activationContext = { 4696 active: activeDraggableNode 4697 }; 4698 const shouldActivate = handler(event, sensor.options, activationContext); 4699 if (shouldActivate === true) { 4700 nativeEvent.dndKit = { 4701 capturedBy: sensor.sensor 4702 }; 4703 activeRef.current = active; 4704 instantiateSensor(event, sensor); 4705 } 4706 }; 4707 }, [ 4708 draggableNodes, 4709 instantiateSensor 4710 ]); 4711 const activators = useCombineActivators(sensors, bindActivatorToSensorInstantiator); 4712 useSensorSetup(sensors); 4713 useIsomorphicLayoutEffect(()=>{ 4714 if (activeNodeRect && status === Status.Initializing) { 4715 setStatus(Status.Initialized); 4716 } 4717 }, [ 4718 activeNodeRect, 4719 status 4720 ]); 4721 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 4722 const { onDragMove } = latestProps.current; 4723 const { active, activatorEvent, collisions, over } = sensorContext.current; 4724 if (!active || !activatorEvent) { 4725 return; 4726 } 4727 const event = { 4728 active, 4729 activatorEvent, 4730 collisions, 4731 delta: { 4732 x: scrollAdjustedTranslate.x, 4733 y: scrollAdjustedTranslate.y 4734 }, 4735 over 4736 }; 4737 (0, __TURBOPACK__imported__module__174080__["unstable_batchedUpdates"])(()=>{ 4738 onDragMove == null ? void 0 : onDragMove(event); 4739 dispatchMonitorEvent({ 4740 type: 'onDragMove', 4741 event 4742 }); 4743 }); 4744 }, [ 4745 scrollAdjustedTranslate.x, 4746 scrollAdjustedTranslate.y 4747 ]); 4748 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 4749 const { active, activatorEvent, collisions, droppableContainers, scrollAdjustedTranslate } = sensorContext.current; 4750 if (!active || activeRef.current == null || !activatorEvent || !scrollAdjustedTranslate) { 4751 return; 4752 } 4753 const { onDragOver } = latestProps.current; 4754 const overContainer = droppableContainers.get(overId); 4755 const over = overContainer && overContainer.rect.current ? { 4756 id: overContainer.id, 4757 rect: overContainer.rect.current, 4758 data: overContainer.data, 4759 disabled: overContainer.disabled 4760 } : null; 4761 const event = { 4762 active, 4763 activatorEvent, 4764 collisions, 4765 delta: { 4766 x: scrollAdjustedTranslate.x, 4767 y: scrollAdjustedTranslate.y 4768 }, 4769 over 4770 }; 4771 (0, __TURBOPACK__imported__module__174080__["unstable_batchedUpdates"])(()=>{ 4772 setOver(over); 4773 onDragOver == null ? void 0 : onDragOver(event); 4774 dispatchMonitorEvent({ 4775 type: 'onDragOver', 4776 event 4777 }); 4778 }); 4779 }, [ 4780 overId 4781 ]); 4782 useIsomorphicLayoutEffect(()=>{ 4783 sensorContext.current = { 4784 activatorEvent, 4785 active, 4786 activeNode, 4787 collisionRect, 4788 collisions, 4789 droppableRects, 4790 draggableNodes, 4791 draggingNode, 4792 draggingNodeRect, 4793 droppableContainers, 4794 over, 4795 scrollableAncestors, 4796 scrollAdjustedTranslate 4797 }; 4798 activeRects.current = { 4799 initial: draggingNodeRect, 4800 translated: collisionRect 4801 }; 4802 }, [ 4803 active, 4804 activeNode, 4805 collisions, 4806 collisionRect, 4807 draggableNodes, 4808 draggingNode, 4809 draggingNodeRect, 4810 droppableRects, 4811 droppableContainers, 4812 over, 4813 scrollableAncestors, 4814 scrollAdjustedTranslate 4815 ]); 4816 useAutoScroller({ 4817 ...autoScrollOptions, 4818 delta: translate, 4819 draggingRect: collisionRect, 4820 pointerCoordinates, 4821 scrollableAncestors, 4822 scrollableAncestorRects 4823 }); 4824 const publicContext = (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>{ 4825 const context = { 4826 active, 4827 activeNode, 4828 activeNodeRect, 4829 activatorEvent, 4830 collisions, 4831 containerNodeRect, 4832 dragOverlay, 4833 draggableNodes, 4834 droppableContainers, 4835 droppableRects, 4836 over, 4837 measureDroppableContainers, 4838 scrollableAncestors, 4839 scrollableAncestorRects, 4840 measuringConfiguration, 4841 measuringScheduled, 4842 windowRect 4843 }; 4844 return context; 4845 }, [ 4846 active, 4847 activeNode, 4848 activeNodeRect, 4849 activatorEvent, 4850 collisions, 4851 containerNodeRect, 4852 dragOverlay, 4853 draggableNodes, 4854 droppableContainers, 4855 droppableRects, 4856 over, 4857 measureDroppableContainers, 4858 scrollableAncestors, 4859 scrollableAncestorRects, 4860 measuringConfiguration, 4861 measuringScheduled, 4862 windowRect 4863 ]); 4864 const internalContext = (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>{ 4865 const context = { 4866 activatorEvent, 4867 activators, 4868 active, 4869 activeNodeRect, 4870 ariaDescribedById: { 4871 draggable: draggableDescribedById 4872 }, 4873 dispatch, 4874 draggableNodes, 4875 over, 4876 measureDroppableContainers 4877 }; 4878 return context; 4879 }, [ 4880 activatorEvent, 4881 activators, 4882 active, 4883 activeNodeRect, 4884 dispatch, 4885 draggableDescribedById, 4886 draggableNodes, 4887 over, 4888 measureDroppableContainers 4889 ]); 4890 return __TURBOPACK__imported__module__271645__["default"].createElement(DndMonitorContext.Provider, { 4891 value: registerMonitorListener 4892 }, __TURBOPACK__imported__module__271645__["default"].createElement(InternalContext.Provider, { 4893 value: internalContext 4894 }, __TURBOPACK__imported__module__271645__["default"].createElement(PublicContext.Provider, { 4895 value: publicContext 4896 }, __TURBOPACK__imported__module__271645__["default"].createElement(ActiveDraggableContext.Provider, { 4897 value: transform 4898 }, children)), __TURBOPACK__imported__module__271645__["default"].createElement(RestoreFocus, { 4899 disabled: (accessibility == null ? void 0 : accessibility.restoreFocus) === false 4900 })), __TURBOPACK__imported__module__271645__["default"].createElement(Accessibility, { 4901 ...accessibility, 4902 hiddenTextDescribedById: draggableDescribedById 4903 })); 4904 //TURBOPACK unreachable 4905 ; 4906 function getAutoScrollerOptions() { 4907 const activeSensorDisablesAutoscroll = (activeSensor == null ? void 0 : activeSensor.autoScrollEnabled) === false; 4908 const autoScrollGloballyDisabled = typeof autoScroll === 'object' ? autoScroll.enabled === false : autoScroll === false; 4909 const enabled = isInitialized && !activeSensorDisablesAutoscroll && !autoScrollGloballyDisabled; 4910 if (typeof autoScroll === 'object') { 4911 return { 4912 ...autoScroll, 4913 enabled 4914 }; 4915 } 4916 return { 4917 enabled 4918 }; 4919 } 4920}); 4921const NullContext = /*#__PURE__*/ (0, __TURBOPACK__imported__module__271645__["createContext"])(null); 4922const defaultRole = 'button'; 4923const ID_PREFIX = 'Draggable'; 4924function useDraggable(_ref) { 4925 let { id, data, disabled = false, attributes } = _ref;
4926 const key = useUniqueId(ID_PREFIX); 4927 const { activators, activatorEvent, active, activeNodeRect, ariaDescribedById, draggableNodes, over } = (0, __TURBOPACK__imported__module__271645__["useContext"])(InternalContext); 4928 const { role = defaultRole, roleDescription = 'draggable', tabIndex = 0 } = attributes != null ? attributes : {}; 4929 const isDragging = (active == null ? void 0 : active.id) === id; 4930 const transform = (0, __TURBOPACK__imported__module__271645__["useContext"])(isDragging ? ActiveDraggableContext : NullContext); 4931 const [node, setNodeRef] = useNodeRef(); 4932 const [activatorNode, setActivatorNodeRef] = useNodeRef(); 4933 const listeners = useSyntheticListeners(activators, id); 4934 const dataRef = useLatestValue(data); 4935 useIsomorphicLayoutEffect(()=>{ 4936 draggableNodes.set(id, { 4937 id, 4938 key, 4939 node, 4940 activatorNode, 4941 data: dataRef 4942 }); 4943 return ()=>{ 4944 const node = draggableNodes.get(id); 4945 if (node && node.key === key) { 4946 draggableNodes.delete(id); 4947 } 4948 }; 4949 }, [ 4950 draggableNodes, 4951 id 4952 ]); 4953 const memoizedAttributes = (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>({ 4954 role, 4955 tabIndex, 4956 'aria-disabled': disabled, 4957 'aria-pressed': isDragging && role === defaultRole ? true : undefined, 4958 'aria-roledescription': roleDescription, 4959 'aria-describedby': ariaDescribedById.draggable 4960 }), [ 4961 disabled, 4962 role, 4963 tabIndex, 4964 isDragging, 4965 roleDescription, 4966 ariaDescribedById.draggable 4967 ]); 4968 return { 4969 active, 4970 activatorEvent, 4971 activeNodeRect, 4972 attributes: memoizedAttributes, 4973 isDragging, 4974 listeners: disabled ? undefined : listeners, 4975 node, 4976 over, 4977 setNodeRef, 4978 setActivatorNodeRef, 4979 transform 4980 }; 4981} 4982function useDndContext() { 4983 return (0, __TURBOPACK__imported__module__271645__["useContext"])(PublicContext); 4984} 4985const ID_PREFIX$1 = 'Droppable'; 4986const defaultResizeObserverConfig = { 4987 timeout: 25 4988}; 4989function useDroppable(_ref) { 4990 let { data, disabled = false, id, resizeObserverConfig } = _ref; 4991 const key = useUniqueId(ID_PREFIX$1); 4992 const { active, dispatch, over, measureDroppableContainers } = (0, __TURBOPACK__imported__module__271645__["useContext"])(InternalContext); 4993 const previous = (0, __TURBOPACK__imported__module__271645__["useRef"])({ 4994 disabled 4995 }); 4996 const resizeObserverConnected = (0, __TURBOPACK__imported__module__271645__["useRef"])(false); 4997 const rect = (0, __TURBOPACK__imported__module__271645__["useRef"])(null); 4998 const callbackId = (0, __TURBOPACK__imported__module__271645__["useRef"])(null); 4999 const { disabled: resizeObserverDisabled, updateMeasurementsFor, timeout: resizeObserverTimeout } = { 5000 ...defaultResizeObserverConfig, 5001 ...resizeObserverConfig 5002 }; 5003 const ids = useLatestValue(updateMeasurementsFor != null ? updateMeasurementsFor : id); 5004 const handleResize = (0, __TURBOPACK__imported__module__271645__["useCallback"])(()=>{ 5005 if (!resizeObserverConnected.current) { 5006 // ResizeObserver invokes the `handleResize` callback as soon as `observe` is called, 5007 // assuming the element is rendered and displayed. 5008 resizeObserverConnected.current = true; 5009 return; 5010 } 5011 if (callbackId.current != null) { 5012 clearTimeout(callbackId.current); 5013 } 5014 callbackId.current = setTimeout(()=>{ 5015 measureDroppableContainers(Array.isArray(ids.current) ? ids.current : [ 5016 ids.current 5017 ]); 5018 callbackId.current = null; 5019 }, resizeObserverTimeout); 5020 }, [ 5021 resizeObserverTimeout 5022 ]); 5023 const resizeObserver = useResizeObserver({ 5024 callback: handleResize, 5025 disabled: resizeObserverDisabled || !active 5026 }); 5027 const handleNodeChange = (0, __TURBOPACK__imported__module__271645__["useCallback"])((newElement, previousElement)=>{ 5028 if (!resizeObserver) { 5029 return; 5030 } 5031 if (previousElement) { 5032 resizeObserver.unobserve(previousElement); 5033 resizeObserverConnected.current = false;
5034 } 5035 if (newElement) { 5036 resizeObserver.observe(newElement); 5037 } 5038 }, [ 5039 resizeObserver 5040 ]); 5041 const [nodeRef, setNodeRef] = useNodeRef(handleNodeChange); 5042 const dataRef = useLatestValue(data); 5043 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 5044 if (!resizeObserver || !nodeRef.current) { 5045 return; 5046 } 5047 resizeObserver.disconnect(); 5048 resizeObserverConnected.current = false; 5049 resizeObserver.observe(nodeRef.current); 5050 }, [ 5051 nodeRef, 5052 resizeObserver 5053 ]); 5054 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 5055 dispatch({ 5056 type: Action.RegisterDroppable, 5057 element: { 5058 id, 5059 key, 5060 disabled, 5061 node: nodeRef, 5062 rect, 5063 data: dataRef 5064 } 5065 }); 5066 return ()=>dispatch({ 5067 type: Action.UnregisterDroppable, 5068 key, 5069 id 5070 }); 5071 }, [ 5072 id 5073 ]); 5074 (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 5075 if (disabled !== previous.current.disabled) { 5076 dispatch({ 5077 type: Action.SetDroppableDisabled, 5078 id, 5079 key, 5080 disabled 5081 }); 5082 previous.current.disabled = disabled; 5083 } 5084 }, [ 5085 id, 5086 key, 5087 disabled, 5088 dispatch 5089 ]); 5090 return { 5091 active, 5092 rect, 5093 isOver: (over == null ? void 0 : over.id) === id, 5094 node: nodeRef, 5095 over, 5096 setNodeRef 5097 }; 5098} 5099function AnimationManager(_ref) { 5100 let { animation, children } = _ref; 5101 const [clonedChildren, setClonedChildren] = (0, __TURBOPACK__imported__module__271645__["useState"])(null); 5102 const [element, setElement] = (0, __TURBOPACK__imported__module__271645__["useState"])(null); 5103 const previousChildren = usePrevious(children); 5104 if (!children && !clonedChildren && previousChildren) { 5105 setClonedChildren(previousChildren); 5106 } 5107 useIsomorphicLayoutEffect(()=>{ 5108 if (!element) { 5109 return; 5110 } 5111 const key = clonedChildren == null ? void 0 : clonedChildren.key; 5112 const id = clonedChildren == null ? void 0 : clonedChildren.props.id; 5113 if (key == null || id == null) { 5114 setClonedChildren(null); 5115 return; 5116 } 5117 Promise.resolve(animation(id, element)).then(()=>{ 5118 setClonedChildren(null); 5119 }); 5120 }, [ 5121 animation, 5122 clonedChildren, 5123 element 5124 ]); 5125 return __TURBOPACK__imported__module__271645__["default"].createElement(__TURBOPACK__imported__module__271645__["default"].Fragment, null, children, clonedChildren ? (0, __TURBOPACK__imported__module__271645__["cloneElement"])(clonedChildren, { 5126 ref: setElement 5127 }) : null); 5128} 5129const defaultTransform = { 5130 x: 0, 5131 y: 0, 5132 scaleX: 1, 5133 scaleY: 1 5134}; 5135function NullifiedContextProvider(_ref) { 5136 let { children } = _ref; 5137 return __TURBOPACK__imported__module__271645__["default"].createElement(InternalContext.Provider, { 5138 value: defaultInternalContext 5139 }, __TURBOPACK__imported__module__271645__["default"].createElement(ActiveDraggableContext.Provider, { 5140 value: defaultTransform 5141 }, children)); 5142} 5143const baseStyles = { 5144 position: 'fixed', 5145 touchAction: 'none' 5146}; 5147const defaultTransition = (activatorEvent)=>{ 5148 const isKeyboardActivator = isKeyboardEvent(activatorEvent); 5149 return isKeyboardActivator ? 'transform 250ms ease' : undefined; 5150}; 5151const PositionedOverlay = /*#__PURE__*/ (0, __TURBOPACK__imported__module__271645__["forwardRef"])((_ref, ref)=>{ 5152 let { as, activatorEvent, adjustScale, children, className, rect, style, transform, transition = defaultTransition } = _ref; 5153 if (!rect) { 5154 return null; 5155 } 5156 const scaleAdjustedTransform = adjustScale ? transform : { 5157 ...transform, 5158 scaleX: 1, 5159 scaleY: 1 5160 }; 5161 const styles = { 5162 ...baseStyles, 5163 width: rect.width, 5164 height: rect.height, 5165 top: rect.top, 5166 left: rect.left, 5167 transform: CSS.Transform.toString(scaleAdjustedTransform), 5168 transformOrigin: adjustScale && activatorEvent ? getRelativeTransformOrigin(activatorEvent, rect) : undefined, 5169 transition: typeof transition === 'function' ? transition(activatorEvent) : transition, 5170 ...style 5171 }; 5172 return __TURBOPACK__imported__module__271645__["default"].createElement(as, { 5173 className, 5174 style: styles, 5175 ref 5176 }, children); 5177}); 5178const defaultDropAnimationSideEffects = (options)=>(_ref)=>{ 5179 let { active, dragOverlay } = _ref; 5180 const originalStyles = {}; 5181 const { styles, className } = options; 5182 if (styles != null && styles.active) { 5183 for (const [key, value] of Object.entries(styles.active)){ 5184 if (value === undefined) { 5185 continue; 5186 } 5187 originalStyles[key] = active.node.style.getPropertyValue(key); 5188 active.node.style.setProperty(key, value); 5189 } 5190 } 5191 if (styles != null && styles.dragOverlay) { 5192 for (const [key, value] of Object.entries(styles.dragOverlay)){ 5193 if (value === undefined) { 5194 continue; 5195 } 5196 dragOverlay.node.style.setProperty(key, value); 5197 } 5198 } 5199 if (className != null && className.active) { 5200 active.node.classList.add(className.active); 5201 } 5202 if (className != null && className.dragOverlay) { 5203 dragOverlay.node.classList.add(className.dragOverlay); 5204 } 5205 return function cleanup() { 5206 for (const [key, value] of Object.entries(originalStyles)){ 5207 active.node.style.setProperty(key, value); 5208 } 5209 if (className != null && className.active) { 5210 active.node.classList.remove(className.active); 5211 } 5212 }; 5213 }; 5214const defaultKeyframeResolver = (_ref2)=>{ 5215 let { transform: { initial, final } } = _ref2; 5216 return [ 5217 { 5218 transform: CSS.Transform.toString(initial) 5219 }, 5220 { 5221 transform: CSS.Transform.toString(final) 5222 } 5223 ]; 5224}; 5225const defaultDropAnimationConfiguration = { 5226 duration: 250, 5227 easing: 'ease',
vendor: 4,526 bytes, lines 5228-5352
5228 keyframes: defaultKeyframeResolver, 5229 sideEffects: /*#__PURE__*/ defaultDropAnimationSideEffects({ 5230 styles: { 5231 active: { 5232 opacity: '0' 5233 } 5234 } 5235 }) 5236}; 5237function useDropAnimation(_ref3) { 5238 let { config, draggableNodes, droppableContainers, measuringConfiguration } = _ref3; 5239 return useEvent((id, node)=>{ 5240 if (config === null) { 5241 return; 5242 } 5243 const activeDraggable = draggableNodes.get(id); 5244 if (!activeDraggable) { 5245 return; 5246 } 5247 const activeNode = activeDraggable.node.current; 5248 if (!activeNode) { 5249 return; 5250 } 5251 const measurableNode = getMeasurableNode(node); 5252 if (!measurableNode) { 5253 return; 5254 } 5255 const { transform } = getWindow(node).getComputedStyle(node); 5256 const parsedTransform = parseTransform(transform); 5257 if (!parsedTransform) { 5258 return; 5259 } 5260 const animation = typeof config === 'function' ? config : createDefaultDropAnimation(config); 5261 scrollIntoViewIfNeeded(activeNode, measuringConfiguration.draggable.measure); 5262 return animation({ 5263 active: { 5264 id, 5265 data: activeDraggable.data, 5266 node: activeNode, 5267 rect: measuringConfiguration.draggable.measure(activeNode) 5268 }, 5269 draggableNodes, 5270 dragOverlay: { 5271 node, 5272 rect: measuringConfiguration.dragOverlay.measure(measurableNode) 5273 }, 5274 droppableContainers, 5275 measuringConfiguration, 5276 transform: parsedTransform 5277 }); 5278 }); 5279} 5280function createDefaultDropAnimation(options) { 5281 const { duration, easing, sideEffects, keyframes } = { 5282 ...defaultDropAnimationConfiguration, 5283 ...options 5284 }; 5285 return (_ref4)=>{ 5286 let { active, dragOverlay, transform, ...rest } = _ref4; 5287 if (!duration) { 5288 // Do not animate if animation duration is zero. 5289 return; 5290 } 5291 const delta = { 5292 x: dragOverlay.rect.left - active.rect.left, 5293 y: dragOverlay.rect.top - active.rect.top 5294 }; 5295 const scale = { 5296 scaleX: transform.scaleX !== 1 ? active.rect.width * transform.scaleX / dragOverlay.rect.width : 1, 5297 scaleY: transform.scaleY !== 1 ? active.rect.height * transform.scaleY / dragOverlay.rect.height : 1 5298 }; 5299 const finalTransform = { 5300 x: transform.x - delta.x, 5301 y: transform.y - delta.y, 5302 ...scale 5303 }; 5304 const animationKeyframes = keyframes({ 5305 ...rest, 5306 active, 5307 dragOverlay, 5308 transform: { 5309 initial: transform, 5310 final: finalTransform 5311 } 5312 }); 5313 const [firstKeyframe] = animationKeyframes; 5314 const lastKeyframe = animationKeyframes[animationKeyframes.length - 1]; 5315 if (JSON.stringify(firstKeyframe) === JSON.stringify(lastKeyframe)) { 5316 // The start and end keyframes are the same, infer that there is no animation needed. 5317 return; 5318 } 5319 const cleanup = sideEffects == null ? void 0 : sideEffects({ 5320 active, 5321 dragOverlay, 5322 ...rest 5323 }); 5324 const animation = dragOverlay.node.animate(animationKeyframes, { 5325 duration, 5326 easing, 5327 fill: 'forwards' 5328 }); 5329 return new Promise((resolve)=>{ 5330 animation.onfinish = ()=>{ 5331 cleanup == null ? void 0 : cleanup(); 5332 resolve(); 5333 }; 5334 }); 5335 }; 5336} 5337let key = 0; 5338function useKey(id) { 5339 return (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>{ 5340 if (id == null) { 5341 return; 5342 } 5343 key++; 5344 return key; 5345 }, [ 5346 id 5347 ]); 5348} 5349const DragOverlay = /*#__PURE__*/ __TURBOPACK__imported__module__271645__["default"].memo((_ref)=>{ 5350 let { adjustScale = false, children, dropAnimation: dropAnimationConfig, style, transition, modifiers, wrapperElement = 'div', className, zIndex = 999 } = _ref; 5351 const { activatorEvent, active, activeNodeRect, containerNodeRect, draggableNodes, droppableContainers, dragOverlay, over, measuringConfiguration, scrollableAncestors, scrollableAncestorRects, windowRect } = useDndContext(); 5352 const transform = (0, __TURBOPACK__imported__module__271645__["useContext"])(ActiveDraggableContext);
5353 const key = useKey(active == null ? void 0 : active.id); 5354 const modifiedTransform = applyModifiers(modifiers, { 5355 activatorEvent, 5356 active, 5357 activeNodeRect, 5358 containerNodeRect, 5359 draggingNodeRect: dragOverlay.rect, 5360 over, 5361 overlayNodeRect: dragOverlay.rect, 5362 scrollableAncestors, 5363 scrollableAncestorRects, 5364 transform, 5365 windowRect 5366 }); 5367 const initialRect = useInitialValue(activeNodeRect); 5368 const dropAnimation = useDropAnimation({ 5369 config: dropAnimationConfig, 5370 draggableNodes, 5371 droppableContainers, 5372 measuringConfiguration 5373 }); // We need to wait for the active node to be measured before connecting the drag overlay ref 5374 // otherwise collisions can be computed against a mispositioned drag overlay 5375 const ref = initialRect ? dragOverlay.setRef : undefined; 5376 return __TURBOPACK__imported__module__271645__["default"].createElement(NullifiedContextProvider, null, __TURBOPACK__imported__module__271645__["default"].createElement(AnimationManager, { 5377 animation: dropAnimation 5378 }, active && key ? __TURBOPACK__imported__module__271645__["default"].createElement(PositionedOverlay, { 5379 key: key, 5380 id: active.id, 5381 ref: ref, 5382 as: wrapperElement, 5383 activatorEvent: activatorEvent, 5384 adjustScale: adjustScale, 5385 className: className, 5386 transition: transition, 5387 rect: initialRect, 5388 style: { 5389 zIndex, 5390 ...style 5391 }, 5392 transform: modifiedTransform 5393 }, children) : null)); 5394}); 5395; 5396__turbopack_context__.s([ 5397 "DndContext", 5398 0, 5399 DndContext, 5400 "DragOverlay", 5401 0, 5402 DragOverlay, 5403 "KeyboardCode", 5404 0, 5405 KeyboardCode, 5406 "KeyboardSensor", 5407 0, 5408 KeyboardSensor, 5409 "MeasuringStrategy", 5410 0, 5411 MeasuringStrategy, 5412 "PointerSensor", 5413 0, 5414 PointerSensor, 5415 "closestCenter", 5416 0, 5417 closestCenter, 5418 "closestCorners", 5419 0, 5420 closestCorners, 5421 "getClientRect", 5422 0, 5423 getClientRect, 5424 "getFirstCollision", 5425 0, 5426 getFirstCollision, 5427 "getScrollableAncestors", 5428 0, 5429 getScrollableAncestors, 5430 "pointerWithin", 5431 0, 5432 pointerWithin, 5433 "useDndContext", 5434 0, 5435 useDndContext, 5436 "useDraggable", 5437 0, 5438 useDraggable, 5439 "useDroppable", 5440 0, 5441 useDroppable, 5442 "useSensor", 5443 0, 5444 useSensor, 5445 "useSensors", 5446 0, 5447 useSensors 5448], 477183); 5449// MERGED MODULE: [project]/node_modules/@dnd-kit/sortable/dist/sortable.esm.js [app-client] (ecmascript) 5450; 5451var __TURBOPACK__imported__module__271645__3 = __TURBOPACK__imported__module__271645__; 5452; 5453; 5454; 5455/** 5456 * Move an array item to a different position. Returns a new array with the item moved to the new position. 5457 */ function arrayMove(array, from, to) { 5458 const newArray = array.slice(); 5459 newArray.splice(to < 0 ? newArray.length + to : to, 0, newArray.splice(from, 1)[0]); 5460 return newArray; 5461} 5462/** 5463 * Swap an array item to a different position. Returns a new array with the item swapped to the new position. 5464 */ function arraySwap(array, from, to) { 5465 const newArray = array.slice(); 5466 newArray[from] = array[to]; 5467 newArray[to] = array[from]; 5468 return newArray; 5469} 5470function getSortedRects(items, rects) { 5471 return items.reduce((accumulator, id, index)=>{ 5472 const rect = rects.get(id); 5473 if (rect) { 5474 accumulator[index] = rect; 5475 } 5476 return accumulator; 5477 }, Array(items.length)); 5478} 5479function isValidIndex(index) { 5480 return index !== null && index >= 0; 5481} 5482function itemsEqual(a, b) { 5483 if (a === b) { 5484 return true; 5485 } 5486 if (a.length !== b.length) { 5487 return false; 5488 } 5489 for(let i = 0; i < a.length; i++){ 5490 if (a[i] !== b[i]) { 5491 return false; 5492 } 5493 } 5494 return true; 5495} 5496function normalizeDisabled(disabled) { 5497 if (typeof disabled === 'boolean') { 5498 return { 5499 draggable: disabled, 5500 droppable: disabled 5501 }; 5502 } 5503 return disabled; 5504} 5505// To-do: We should be calculating scale transformation 5506const defaultScale = { 5507 scaleX: 1, 5508 scaleY: 1 5509}; 5510const horizontalListSortingStrategy = (_ref)=>{ 5511 var _rects$activeIndex; 5512 let { rects, activeNodeRect: fallbackActiveRect, activeIndex, overIndex, index } = _ref; 5513 const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect; 5514 if (!activeNodeRect) { 5515 return null; 5516 } 5517 const itemGap = getItemGap(rects, index, activeIndex); 5518 if (index === activeIndex) { 5519 const newIndexRect = rects[overIndex]; 5520 if (!newIndexRect) { 5521 return null; 5522 } 5523 return { 5524 x: activeIndex < overIndex ? newIndexRect.left + newIndexRect.width - (activeNodeRect.left + activeNodeRect.width) : newIndexRect.left - activeNodeRect.left, 5525 y: 0, 5526 ...defaultScale 5527 }; 5528 } 5529 if (index > activeIndex && index <= overIndex) { 5530 return { 5531 x: -activeNodeRect.width - itemGap, 5532 y: 0, 5533 ...defaultScale 5534 }; 5535 } 5536 if (index < activeIndex && index >= overIndex) { 5537 return { 5538 x: activeNodeRect.width + itemGap, 5539 y: 0, 5540 ...defaultScale 5541 }; 5542 } 5543 return { 5544 x: 0, 5545 y: 0, 5546 ...defaultScale 5547 }; 5548}; 5549function getItemGap(rects, index, activeIndex) { 5550 const currentRect = rects[index]; 5551 const previousRect = rects[index - 1]; 5552 const nextRect = rects[index + 1]; 5553 if (!currentRect || !previousRect && !nextRect) { 5554 return 0; 5555 } 5556 if (activeIndex < index) { 5557 return previousRect ? currentRect.left - (previousRect.left + previousRect.width) : nextRect.left - (currentRect.left + currentRect.width); 5558 } 5559 return nextRect ? nextRect.left - (currentRect.left + currentRect.width) : currentRect.left - (previousRect.left + previousRect.width); 5560} 5561const rectSortingStrategy = (_ref)=>{ 5562 let { rects, activeIndex, overIndex, index } = _ref; 5563 const newRects = arrayMove(rects, overIndex, activeIndex); 5564 const oldRect = rects[index]; 5565 const newRect = newRects[index]; 5566 if (!newRect || !oldRect) { 5567 return null; 5568 } 5569 return { 5570 x: newRect.left - oldRect.left, 5571 y: newRect.top - oldRect.top, 5572 scaleX: newRect.width / oldRect.width, 5573 scaleY: newRect.height / oldRect.height 5574 }; 5575}; 5576const rectSwappingStrategy = (_ref)=>{ 5577 let { activeIndex, index, rects, overIndex } = _ref; 5578 let oldRect; 5579 let newRect; 5580 if (index === activeIndex) { 5581 oldRect = rects[index]; 5582 newRect = rects[overIndex]; 5583 } 5584 if (index === overIndex) { 5585 oldRect = rects[index]; 5586 newRect = rects[activeIndex]; 5587 } 5588 if (!newRect || !oldRect) { 5589 return null; 5590 } 5591 return { 5592 x: newRect.left - oldRect.left, 5593 y: newRect.top - oldRect.top, 5594 scaleX: newRect.width / oldRect.width, 5595 scaleY: newRect.height / oldRect.height 5596 }; 5597}; 5598// To-do: We should be calculating scale transformation 5599const defaultScale$1 = { 5600 scaleX: 1, 5601 scaleY: 1 5602}; 5603const verticalListSortingStrategy = (_ref)=>{ 5604 var _rects$activeIndex; 5605 let { activeIndex, activeNodeRect: fallbackActiveRect, index, rects, overIndex } = _ref; 5606 const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect; 5607 if (!activeNodeRect) { 5608 return null; 5609 } 5610 if (index === activeIndex) { 5611 const overIndexRect = rects[overIndex]; 5612 if (!overIndexRect) { 5613 return null; 5614 } 5615 return { 5616 x: 0, 5617 y: activeIndex < overIndex ? overIndexRect.top + overIndexRect.height - (activeNodeRect.top + activeNodeRect.height) : overIndexRect.top - activeNodeRect.top, 5618 ...defaultScale$1 5619 }; 5620 } 5621 const itemGap = getItemGap$1(rects, index, activeIndex); 5622 if (index > activeIndex && index <= overIndex) { 5623 return { 5624 x: 0, 5625 y: -activeNodeRect.height - itemGap, 5626 ...defaultScale$1 5627 }; 5628 } 5629 if (index < activeIndex && index >= overIndex) { 5630 return { 5631 x: 0, 5632 y: activeNodeRect.height + itemGap, 5633 ...defaultScale$1 5634 }; 5635 } 5636 return { 5637 x: 0, 5638 y: 0, 5639 ...defaultScale$1 5640 }; 5641}; 5642function getItemGap$1(clientRects, index, activeIndex) { 5643 const currentRect = clientRects[index]; 5644 const previousRect = clientRects[index - 1]; 5645 const nextRect = clientRects[index + 1]; 5646 if (!currentRect) { 5647 return 0; 5648 } 5649 if (activeIndex < index) { 5650 return previousRect ? currentRect.top - (previousRect.top + previousRect.height) : nextRect ? nextRect.top - (currentRect.top + currentRect.height) : 0; 5651 } 5652 return nextRect ? nextRect.top - (currentRect.top + currentRect.height) : previousRect ? currentRect.top - (previousRect.top + previousRect.height) : 0; 5653} 5654const ID_PREFIX1 = 'Sortable'; 5655const Context = /*#__PURE__*/ __TURBOPACK__imported__module__271645__3["default"].createContext({ 5656 activeIndex: -1, 5657 containerId: ID_PREFIX1, 5658 disableTransforms: false, 5659 items: [], 5660 overIndex: -1,
5661 useDragOverlay: false, 5662 sortedRects: [], 5663 strategy: rectSortingStrategy, 5664 disabled: { 5665 draggable: false, 5666 droppable: false 5667 } 5668}); 5669function SortableContext(_ref) { 5670 let { children, id, items: userDefinedItems, strategy = rectSortingStrategy, disabled: disabledProp = false } = _ref; 5671 const { active, dragOverlay, droppableRects, over, measureDroppableContainers } = useDndContext(); 5672 const containerId = useUniqueId(ID_PREFIX1, id); 5673 const useDragOverlay = Boolean(dragOverlay.rect !== null); 5674 const items = (0, __TURBOPACK__imported__module__271645__3["useMemo"])(()=>userDefinedItems.map((item)=>typeof item === 'object' && 'id' in item ? item.id : item), [ 5675 userDefinedItems 5676 ]); 5677 const isDragging = active != null; 5678 const activeIndex = active ? items.indexOf(active.id) : -1; 5679 const overIndex = over ? items.indexOf(over.id) : -1; 5680 const previousItemsRef = (0, __TURBOPACK__imported__module__271645__3["useRef"])(items); 5681 const itemsHaveChanged = !itemsEqual(items, previousItemsRef.current); 5682 const disableTransforms = overIndex !== -1 && activeIndex === -1 || itemsHaveChanged; 5683 const disabled = normalizeDisabled(disabledProp); 5684 useIsomorphicLayoutEffect(()=>{ 5685 if (itemsHaveChanged && isDragging) { 5686 measureDroppableContainers(items); 5687 } 5688 }, [ 5689 itemsHaveChanged, 5690 items, 5691 isDragging, 5692 measureDroppableContainers 5693 ]); 5694 (0, __TURBOPACK__imported__module__271645__3["useEffect"])(()=>{ 5695 previousItemsRef.current = items; 5696 }, [ 5697 items 5698 ]); 5699 const contextValue = (0, __TURBOPACK__imported__module__271645__3["useMemo"])(()=>({ 5700 activeIndex, 5701 containerId, 5702 disabled, 5703 disableTransforms, 5704 items, 5705 overIndex, 5706 useDragOverlay, 5707 sortedRects: getSortedRects(items, droppableRects), 5708 strategy 5709 }), [ 5710 activeIndex, 5711 containerId, 5712 disabled.draggable, 5713 disabled.droppable, 5714 disableTransforms, 5715 items, 5716 overIndex, 5717 droppableRects, 5718 useDragOverlay, 5719 strategy 5720 ]); 5721 return __TURBOPACK__imported__module__271645__3["default"].createElement(Context.Provider, { 5722 value: contextValue 5723 }, children); 5724} 5725const defaultNewIndexGetter = (_ref)=>{ 5726 let { id, items, activeIndex, overIndex } = _ref; 5727 return arrayMove(items, activeIndex, overIndex).indexOf(id); 5728}; 5729const defaultAnimateLayoutChanges = (_ref2)=>{ 5730 let { containerId, isSorting, wasDragging, index, items, newIndex, previousItems, previousContainerId, transition } = _ref2; 5731 if (!transition || !wasDragging) { 5732 return false; 5733 } 5734 if (previousItems !== items && index === newIndex) { 5735 return false; 5736 } 5737 if (isSorting) { 5738 return true; 5739 } 5740 return newIndex !== index && containerId === previousContainerId; 5741}; 5742const defaultTransition1 = { 5743 duration: 200, 5744 easing: 'ease' 5745}; 5746const transitionProperty = 'transform'; 5747const disabledTransition = /*#__PURE__*/ CSS.Transition.toString({ 5748 property: transitionProperty, 5749 duration: 0, 5750 easing: 'linear' 5751}); 5752const defaultAttributes = { 5753 roleDescription: 'sortable' 5754}; 5755/* 5756 * When the index of an item changes while sorting, 5757 * we need to temporarily disable the transforms 5758 */ function useDerivedTransform(_ref) { 5759 let { disabled, index, node, rect } = _ref; 5760 const [derivedTransform, setDerivedtransform] = (0, __TURBOPACK__imported__module__271645__3["useState"])(null); 5761 const previousIndex = (0, __TURBOPACK__imported__module__271645__3["useRef"])(index); 5762 useIsomorphicLayoutEffect(()=>{ 5763 if (!disabled && index !== previousIndex.current && node.current) { 5764 const initial = rect.current; 5765 if (initial) { 5766 const current = getClientRect(node.current, { 5767 ignoreTransform: true 5768 }); 5769 const delta = { 5770 x: initial.left - current.left, 5771 y: initial.top - current.top, 5772 scaleX: initial.width / current.width, 5773 scaleY: initial.height / current.height 5774 }; 5775 if (delta.x || delta.y) { 5776 setDerivedtransform(delta); 5777 } 5778 } 5779 } 5780 if (index !== previousIndex.current) { 5781 previousIndex.current = index; 5782 } 5783 }, [ 5784 disabled, 5785 index, 5786 node, 5787 rect 5788 ]); 5789 (0, __TURBOPACK__imported__module__271645__3["useEffect"])(()=>{ 5790 if (derivedTransform) { 5791 setDerivedtransform(null); 5792 } 5793 }, [ 5794 derivedTransform 5795 ]); 5796 return derivedTransform; 5797} 5798function useSortable(_ref) { 5799 let { animateLayoutChanges = defaultAnimateLayoutChanges, attributes: userDefinedAttributes, disabled: localDisabled, data: customData, getNewIndex = defaultNewIndexGetter, id, strategy: localStrategy, resizeObserverConfig, transition = defaultTransition1 } = _ref; 5800 const { items, containerId, activeIndex, disabled: globalDisabled, disableTransforms, sortedRects, overIndex, useDragOverlay, strategy: globalStrategy } = (0, __TURBOPACK__imported__module__271645__3["useContext"])(Context); 5801 const disabled = normalizeLocalDisabled(localDisabled, globalDisabled); 5802 const index = items.indexOf(id); 5803 const data = (0, __TURBOPACK__imported__module__271645__3["useMemo"])(()=>({ 5804 sortable: { 5805 containerId, 5806 index, 5807 items 5808 }, 5809 ...customData 5810 }), [ 5811 containerId, 5812 customData, 5813 index, 5814 items 5815 ]); 5816 const itemsAfterCurrentSortable = (0, __TURBOPACK__imported__module__271645__3["useMemo"])(()=>items.slice(items.indexOf(id)), [ 5817 items, 5818 id 5819 ]); 5820 const { rect, node, isOver, setNodeRef: setDroppableNodeRef } = useDroppable({ 5821 id, 5822 data, 5823 disabled: disabled.droppable, 5824 resizeObserverConfig: { 5825 updateMeasurementsFor: itemsAfterCurrentSortable, 5826 ...resizeObserverConfig 5827 } 5828 }); 5829 const { active, activatorEvent, activeNodeRect, attributes, setNodeRef: setDraggableNodeRef, listeners, isDragging, over, setActivatorNodeRef, transform } = useDraggable({ 5830 id, 5831 data, 5832 attributes: { 5833 ...defaultAttributes, 5834 ...userDefinedAttributes 5835 }, 5836 disabled: disabled.draggable 5837 }); 5838 const setNodeRef = useCombinedRefs(setDroppableNodeRef, setDraggableNodeRef); 5839 const isSorting = Boolean(active); 5840 const displaceItem = isSorting && !disableTransforms && isValidIndex(activeIndex) && isValidIndex(overIndex); 5841 const shouldDisplaceDragSource = !useDragOverlay && isDragging; 5842 const dragSourceDisplacement = shouldDisplaceDragSource && displaceItem ? transform : null; 5843 const strategy = localStrategy != null ? localStrategy : globalStrategy; 5844 const finalTransform = displaceItem ? dragSourceDisplacement != null ? dragSourceDisplacement : strategy({ 5845 rects: sortedRects, 5846 activeNodeRect, 5847 activeIndex, 5848 overIndex, 5849 index 5850 }) : null; 5851 const newIndex = isValidIndex(activeIndex) && isValidIndex(overIndex) ? getNewIndex({ 5852 id, 5853 items, 5854 activeIndex, 5855 overIndex 5856 }) : index; 5857 const activeId = active == null ? void 0 : active.id; 5858 const previous = (0, __TURBOPACK__imported__module__271645__3["useRef"])({ 5859 activeId, 5860 items, 5861 newIndex, 5862 containerId 5863 }); 5864 const itemsHaveChanged = items !== previous.current.items; 5865 const shouldAnimateLayoutChanges = animateLayoutChanges({ 5866 active, 5867 containerId, 5868 isDragging, 5869 isSorting, 5870 id, 5871 index, 5872 items, 5873 newIndex: previous.current.newIndex, 5874 previousItems: previous.current.items, 5875 previousContainerId: previous.current.containerId, 5876 transition, 5877 wasDragging: previous.current.activeId != null 5878 }); 5879 const derivedTransform = useDerivedTransform({ 5880 disabled: !shouldAnimateLayoutChanges, 5881 index, 5882 node, 5883 rect 5884 }); 5885 (0, __TURBOPACK__imported__module__271645__3["useEffect"])(()=>{ 5886 if (isSorting && previous.current.newIndex !== newIndex) { 5887 previous.current.newIndex = newIndex; 5888 } 5889 if (containerId !== previous.current.containerId) { 5890 previous.current.containerId = containerId; 5891 } 5892 if (items !== previous.current.items) { 5893 previous.current.items = items; 5894 } 5895 }, [ 5896 isSorting, 5897 newIndex, 5898 containerId, 5899 items 5900 ]); 5901 (0, __TURBOPACK__imported__module__271645__3["useEffect"])(()=>{ 5902 if (activeId === previous.current.activeId) { 5903 return; 5904 } 5905 if (activeId != null && previous.current.activeId == null) { 5906 previous.current.activeId = activeId; 5907 return; 5908 } 5909 const timeoutId = setTimeout(()=>{ 5910 previous.current.activeId = activeId; 5911 }, 50); 5912 return ()=>clearTimeout(timeoutId); 5913 }, [ 5914 activeId 5915 ]); 5916 return { 5917 active, 5918 activeIndex, 5919 attributes, 5920 data, 5921 rect, 5922 index, 5923 newIndex, 5924 items, 5925 isOver, 5926 isSorting, 5927 isDragging, 5928 listeners, 5929 node, 5930 overIndex, 5931 over, 5932 setNodeRef,
5933 setActivatorNodeRef, 5934 setDroppableNodeRef, 5935 setDraggableNodeRef, 5936 transform: derivedTransform != null ? derivedTransform : finalTransform, 5937 transition: getTransition() 5938 }; 5939 //TURBOPACK unreachable 5940 ; 5941 function getTransition() { 5942 if (derivedTransform || // Or to prevent items jumping to back to their "new" position when items change 5943 itemsHaveChanged && previous.current.newIndex === index) { 5944 return disabledTransition; 5945 } 5946 if (shouldDisplaceDragSource && !isKeyboardEvent(activatorEvent) || !transition) { 5947 return undefined; 5948 } 5949 if (isSorting || shouldAnimateLayoutChanges) { 5950 return CSS.Transition.toString({ 5951 ...transition, 5952 property: transitionProperty 5953 }); 5954 } 5955 return undefined; 5956 } 5957} 5958function normalizeLocalDisabled(localDisabled, globalDisabled) { 5959 var _localDisabled$dragga, _localDisabled$droppa; 5960 if (typeof localDisabled === 'boolean') { 5961 return { 5962 draggable: localDisabled, 5963 // Backwards compatibility 5964 droppable: false 5965 }; 5966 } 5967 return { 5968 draggable: (_localDisabled$dragga = localDisabled == null ? void 0 : localDisabled.draggable) != null ? _localDisabled$dragga : globalDisabled.draggable, 5969 droppable: (_localDisabled$droppa = localDisabled == null ? void 0 : localDisabled.droppable) != null ? _localDisabled$droppa : globalDisabled.droppable 5970 }; 5971} 5972function hasSortableData(entry) { 5973 if (!entry) { 5974 return false; 5975 } 5976 const data = entry.data.current; 5977 if (data && 'sortable' in data && typeof data.sortable === 'object' && 'containerId' in data.sortable && 'items' in data.sortable && 'index' in data.sortable) { 5978 return true; 5979 } 5980 return false; 5981} 5982const directions = [ 5983 KeyboardCode.Down, 5984 KeyboardCode.Right, 5985 KeyboardCode.Up, 5986 KeyboardCode.Left 5987]; 5988const sortableKeyboardCoordinates = (event, _ref)=>{ 5989 let { context: { active, collisionRect, droppableRects, droppableContainers, over, scrollableAncestors } } = _ref; 5990 if (directions.includes(event.code)) { 5991 event.preventDefault(); 5992 if (!active || !collisionRect) { 5993 return; 5994 } 5995 const filteredContainers = []; 5996 droppableContainers.getEnabled().forEach((entry)=>{ 5997 if (!entry || entry != null && entry.disabled) { 5998 return; 5999 } 6000 const rect = droppableRects.get(entry.id); 6001 if (!rect) { 6002 return; 6003 } 6004 switch(event.code){ 6005 case KeyboardCode.Down: 6006 if (collisionRect.top < rect.top) { 6007 filteredContainers.push(entry); 6008 } 6009 break; 6010 case KeyboardCode.Up: 6011 if (collisionRect.top > rect.top) { 6012 filteredContainers.push(entry); 6013 } 6014 break; 6015 case KeyboardCode.Left: 6016 if (collisionRect.left > rect.left) { 6017 filteredContainers.push(entry); 6018 } 6019 break; 6020 case KeyboardCode.Right: 6021 if (collisionRect.left < rect.left) { 6022 filteredContainers.push(entry); 6023 } 6024 break; 6025 } 6026 }); 6027 const collisions = closestCorners({ 6028 active, 6029 collisionRect: collisionRect, 6030 droppableRects, 6031 droppableContainers: filteredContainers, 6032 pointerCoordinates: null 6033 }); 6034 let closestId = getFirstCollision(collisions, 'id'); 6035 if (closestId === (over == null ? void 0 : over.id) && collisions.length > 1) { 6036 closestId = collisions[1].id; 6037 } 6038 if (closestId != null) { 6039 const activeDroppable = droppableContainers.get(active.id); 6040 const newDroppable = droppableContainers.get(closestId); 6041 const newRect = newDroppable ? droppableRects.get(newDroppable.
6041id) : null; 6042 const newNode = newDroppable == null ? void 0 : newDroppable.node.current; 6043 if (newNode && newRect && activeDroppable && newDroppable) { 6044 const newScrollAncestors = getScrollableAncestors(newNode); 6045 const hasDifferentScrollAncestors = newScrollAncestors.some((element, index)=>scrollableAncestors[index] !== element); 6046 const hasSameContainer = isSameContainer(activeDroppable, newDroppable); 6047 const isAfterActive = isAfter(activeDroppable, newDroppable); 6048 const offset = hasDifferentScrollAncestors || !hasSameContainer ? { 6049 x: 0, 6050 y: 0 6051 } : { 6052 x: isAfterActive ? collisionRect.width - newRect.width : 0, 6053 y: isAfterActive ? collisionRect.height - newRect.height : 0 6054 }; 6055 const rectCoordinates = { 6056 x: newRect.left, 6057 y: newRect.top 6058 }; 6059 const newCoordinates = offset.x && offset.y ? rectCoordinates : subtract(rectCoordinates, offset); 6060 return newCoordinates; 6061 } 6062 } 6063 } 6064 return undefined; 6065}; 6066function isSameContainer(a, b) { 6067 if (!hasSortableData(a) || !hasSortableData(b)) { 6068 return false; 6069 } 6070 return a.data.current.sortable.containerId === b.data.current.sortable.containerId; 6071} 6072function isAfter(a, b) { 6073 if (!hasSortableData(a) || !hasSortableData(b)) { 6074 return false; 6075 } 6076 if (!isSameContainer(a, b)) { 6077 return false; 6078 } 6079 return a.data.current.sortable.index < b.data.current.sortable.index; 6080} 6081; 6082__turbopack_context__.s([ 6083 "SortableContext", 6084 0, 6085 SortableContext, 6086 "arrayMove", 6087 0, 6088 arrayMove, 6089 "horizontalListSortingStrategy", 6090 0, 6091 horizontalListSortingStrategy, 6092 "sortableKeyboardCoordinates", 6093 0, 6094 sortableKeyboardCoordinates, 6095 "useSortable", 6096 0, 6097 useSortable, 6098 "verticalListSortingStrategy", 6099 0, 6100 verticalListSortingStrategy 6101], 76590); 6102}), 6103]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.