Plugin Directory

Changeset 3457881


Ignore:
Timestamp:
02/10/2026 10:35:36 AM (7 weeks ago)
Author:
debuggersstudio
Message:

Update to version 4.0.15 from GitHub

Location:
ecomm-reels
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • ecomm-reels/tags/4.0.15/CHANGELOG.md

    r3457000 r3457881  
    11# Changelog
     2
     3## [4.0.15](https://github.com/dstudio-asia/reels-wp/compare/v4.0.14...v4.0.15) (2026-02-10)
     4
     5
     6### Features
     7
     8* **ui:** add locked pro appearance options with upgrade prompt ([f37782e](https://github.com/dstudio-asia/reels-wp/commit/f37782e43b3db942fd7e7e5d29ca12c30e539961))
     9* **ui:** add tablet responsive size and gap support ([7ba09ba](https://github.com/dstudio-asia/reels-wp/commit/7ba09bae224fb4e5a01befb480243e661a4e9b3d))
     10
     11
     12### Bug Fixes
     13
     14* **side-panel:** adjust z-index behavior for responsive layouts ([32bf56a](https://github.com/dstudio-asia/reels-wp/commit/32bf56a4786c1d419481811a9acf2abb7ee71d15))
     15* **thumbnail:** remove pointer cursor from frame ([41591dc](https://github.com/dstudio-asia/reels-wp/commit/41591dcf70697b9b52fe3f1a5642904245aad153))
     16* **ui:** correct side panel height and padding behavior ([571c1b3](https://github.com/dstudio-asia/reels-wp/commit/571c1b390531e0f6e5877f8d92be5adfeb64e9a5))
    217
    318## [4.0.14](https://github.com/dstudio-asia/reels-wp/compare/v4.0.13...v4.0.14) (2026-02-09)
  • ecomm-reels/tags/4.0.15/build/index.js

    r3457000 r3457881  
    1 (function(y,va,Ln,_a){"use strict";var ya=document.createElement("style");ya.textContent=`:root{--color-primary: #2563eb;--color-primary-foreground: #ffffff;--color-secondary: #e5e7eb;--color-secondary-foreground: #111827;--color-foreground: #111827;--color-muted: #f3f4f6;--color-muted-foreground: #6b7280;--color-accent: #f3f4f6;--color-border: #e5e7eb;--color-ring: #60a5fa}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{box-sizing:border-box;color:var(--color-foreground, #111);font-family:Inter,Segoe UI,system-ui,-apple-system,sans-serif}#ecommreels-admin-app *,#ecommreels-admin-app *:before,#ecommreels-admin-app *:after,.ecommreels-short-code *,.ecommreels-short-code *:before,.ecommreels-short-code *:after,.reelswp-group-short-code *,.reelswp-group-short-code *:before,.reelswp-group-short-code *:after,.reelswp-reel-short-code *,.reelswp-reel-short-code *:before,.reelswp-reel-short-code *:after{box-sizing:inherit}#ecommreels-admin-app input,#ecommreels-admin-app select,#ecommreels-admin-app textarea,.ecommreels-short-code input,.ecommreels-short-code select,.ecommreels-short-code textarea,.reelswp-group-short-code input,.reelswp-group-short-code select,.reelswp-group-short-code textarea,.reelswp-reel-short-code input,.reelswp-reel-short-code select,.reelswp-reel-short-code textarea{font:inherit;color:inherit}#ecommreels-admin-app button,.ecommreels-short-code button,.reelswp-group-short-code button,.reelswp-reel-short-code button{border:none}#ecommreels-admin-app input[type=checkbox],#ecommreels-admin-app input[type=radio],.ecommreels-short-code input[type=checkbox],.ecommreels-short-code input[type=radio],.reelswp-group-short-code input[type=checkbox],.reelswp-group-short-code input[type=radio],.reelswp-reel-short-code input[type=checkbox],.reelswp-reel-short-code input[type=radio]{margin:0}#ecommreels-admin-app input[type=number]::-webkit-inner-spin-button,#ecommreels-admin-app input[type=number]::-webkit-outer-spin-button,.ecommreels-short-code input[type=number]::-webkit-inner-spin-button,.ecommreels-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-group-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-group-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}#ecommreels-admin-app input[type=number],.ecommreels-short-code input[type=number],.reelswp-group-short-code input[type=number],.reelswp-reel-short-code input[type=number]{-moz-appearance:textfield}#ecommreels-admin-app input,.ecommreels-short-code input,.reelswp-group-short-code input,.reelswp-reel-short-code input{min-height:auto}#ecommreels-admin-app img,.ecommreels-short-code img,.reelswp-group-short-code img,.reelswp-reel-short-code img{max-width:100%;display:block}#ecommreels-admin-app h1,#ecommreels-admin-app h2,#ecommreels-admin-app h3,#ecommreels-admin-app h4,#ecommreels-admin-app h5,#ecommreels-admin-app h6,.ecommreels-short-code h1,.ecommreels-short-code h2,.ecommreels-short-code h3,.ecommreels-short-code h4,.ecommreels-short-code h5,.ecommreels-short-code h6,.reelswp-group-short-code h1,.reelswp-group-short-code h2,.reelswp-group-short-code h3,.reelswp-group-short-code h4,.reelswp-group-short-code h5,.reelswp-group-short-code h6,.reelswp-reel-short-code h1,.reelswp-reel-short-code h2,.reelswp-reel-short-code h3,.reelswp-reel-short-code h4,.reelswp-reel-short-code h5,.reelswp-reel-short-code h6{margin:0;font-weight:600}#ecommreels-admin-app p,.ecommreels-short-code p,.reelswp-group-short-code p,.reelswp-reel-short-code p{margin:0}#ecommreels-admin-app .ecr-admin-panel{position:relative;margin:24px;min-height:50vh;border-radius:6px;border:1px solid #d1d5db;background:#fff;padding:16px}#ecommreels-admin-app .ecr-admin-panel--reels{padding:16px}#ecommreels-admin-app .ecr-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid transparent;border-radius:6px;font-size:14px;font-weight:600;line-height:1;padding:8px 16px;background:#111;color:#fff;cursor:pointer;transition:background-color .2s ease,border-color .2s ease,color .2s ease,box-shadow .2s ease,transform .2s ease}#ecommreels-admin-app .ecr-button:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-button--primary{background:#2563eb;color:#fff}#ecommreels-admin-app .ecr-button--primary:hover{background:#1f29371a}#ecommreels-admin-app .ecr-button--secondary{background:#e5e7eb;color:#111827}#ecommreels-admin-app .ecr-button--secondary:hover{background:#e5e7eb1a}#ecommreels-admin-app .ecr-button--outline{background:transparent;border-color:#2563eb;color:#2563eb}#ecommreels-admin-app .ecr-button--outline:hover{background:#2563eb1a}#ecommreels-admin-app .ecr-button--outline-danger{background:transparent;border-color:#dc2626;color:#dc2626}#ecommreels-admin-app .ecr-button--outline-danger:hover{background:#dc26261a}#ecommreels-admin-app .ecr-button--ghost{background:transparent;color:#111827}#ecommreels-admin-app .ecr-button--ghost:hover{background:#f3f4f6}#ecommreels-admin-app .ecr-button--link{background:none;border-color:transparent;padding:0;color:#2563eb;text-decoration:none}#ecommreels-admin-app .ecr-button--link:hover{text-decoration:underline}#ecommreels-admin-app .ecr-button--danger{background:#dc2626;color:#fff}#ecommreels-admin-app .ecr-button--danger:hover{background:#b91c1c}#ecommreels-admin-app .ecr-button--sm{height:32px;padding:0 12px;font-size:13px}#ecommreels-admin-app .ecr-button--md{height:36px;padding:0 16px}#ecommreels-admin-app .ecr-button--lg{height:40px;padding:0 20px;font-size:15px}#ecommreels-admin-app .ecr-button--icon,#ecommreels-admin-app .ecr-button--icon-sm,#ecommreels-admin-app .ecr-button--icon-lg{padding:0;width:36px;height:36px}#ecommreels-admin-app .ecr-button--icon-sm{width:32px;height:32px}#ecommreels-admin-app .ecr-button--icon-lg{width:40px;height:40px}#ecommreels-admin-app .ecr-admin-reels-header{margin-bottom:16px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__left{display:flex;align-items:center;gap:32px}#ecommreels-admin-app .ecr-admin-reels-header__right{display:flex;flex-wrap:wrap;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__title{margin:0;padding:6px 0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-reels-header__actions{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__action{padding:0;font-weight:600;background:none;border:none;box-shadow:none}#ecommreels-admin-app .ecr-admin-reels-header__action--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reels-header__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reels-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-reels-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-reels-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-reels-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__create{border:1px solid #3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-reels-header__create:hover{background:#ffffffe6}#ecommreels-admin-app .ecr-admin-reels-header__spinner{animation:ecr-reels-spin 1s linear infinite}@keyframes ecr-reels-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-reels-empty{display:flex;align-items:center;justify-content:center;padding-top:50px}#ecommreels-admin-app .ecr-admin-reels-empty__text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:14px}#ecommreels-admin-app .ecr-admin-reels-loading{display:flex;align-items:center;justify-content:center;padding:16px 0}#ecommreels-admin-app .ecr-admin-reels-loading--fullscreen{position:absolute;inset:0}#ecommreels-admin-app .ecr-admin-reels-loading__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-reels-loading-spin 1s linear infinite}@keyframes ecr-reels-loading-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-player__progress,.ecommreels-short-code .ecr-player__progress,.reelswp-group-short-code .ecr-player__progress,.reelswp-reel-short-code .ecr-player__progress{position:absolute;top:4px;left:50%;z-index:2;display:flex;width:90%;transform:translate(-50%);gap:4px;overflow:hidden;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-track,.ecommreels-short-code .ecr-player__progress-track,.reelswp-group-short-code .ecr-player__progress-track,.reelswp-reel-short-code .ecr-player__progress-track{width:100%;height:3px;background:#ffffff80;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-fill,.ecommreels-short-code .ecr-player__progress-fill,.reelswp-group-short-code .ecr-player__progress-fill,.reelswp-reel-short-code .ecr-player__progress-fill{height:3px;background:#fff;border-radius:999px;width:0}#ecommreels-admin-app .ecr-player__progress-fill--active,.ecommreels-short-code .ecr-player__progress-fill--active,.reelswp-group-short-code .ecr-player__progress-fill--active,.reelswp-reel-short-code .ecr-player__progress-fill--active{animation:ecr-progress var(--reels-wp-animation-time) linear forwards}#ecommreels-admin-app .ecr-player__progress-fill--complete,.ecommreels-short-code .ecr-player__progress-fill--complete,.reelswp-group-short-code .ecr-player__progress-fill--complete,.reelswp-reel-short-code .ecr-player__progress-fill--complete{width:100%}#ecommreels-admin-app .ecr-player__progress-fill--empty,.ecommreels-short-code .ecr-player__progress-fill--empty,.reelswp-group-short-code .ecr-player__progress-fill--empty,.reelswp-reel-short-code .ecr-player__progress-fill--empty{width:0}@keyframes ecr-progress{0%{width:0}to{width:100%}}#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{position:absolute;top:50%;z-index:5;display:none;width:40px;height:40px;padding:0;transform:translateY(-50%);border:none;border-radius:999px;background:#ffffffd9;color:#374151;cursor:pointer;align-items:center;justify-content:center}@media(min-width:1024px){#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{display:grid}}#ecommreels-admin-app .ecr-player__nav--left,.ecommreels-short-code .ecr-player__nav--left,.reelswp-group-short-code .ecr-player__nav--left,.reelswp-reel-short-code .ecr-player__nav--left{left:0;transform:translate(-120%,-50%)}#ecommreels-admin-app .ecr-player__nav--right,.ecommreels-short-code .ecr-player__nav--right,.reelswp-group-short-code .ecr-player__nav--right,.reelswp-reel-short-code .ecr-player__nav--right{right:0;transform:translate(120%,-50%)}#ecommreels-admin-app .ecr-player__nav:hover,.ecommreels-short-code .ecr-player__nav:hover,.reelswp-group-short-code .ecr-player__nav:hover,.reelswp-reel-short-code .ecr-player__nav:hover{background:#fff}#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{position:relative;display:flex;width:100%;height:100%;align-items:center;justify-content:center;overflow:hidden;border-radius:16px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{border-radius:0}}#ecommreels-admin-app .ecr-player__media,.ecommreels-short-code .ecr-player__media,.reelswp-group-short-code .ecr-player__media,.reelswp-reel-short-code .ecr-player__media{width:100%;height:auto}#ecommreels-admin-app .ecr-player__media--portrait,.ecommreels-short-code .ecr-player__media--portrait,.reelswp-group-short-code .ecr-player__media--portrait,.reelswp-reel-short-code .ecr-player__media--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-player__media--auto,.ecommreels-short-code .ecr-player__media--auto,.reelswp-group-short-code .ecr-player__media--auto,.reelswp-reel-short-code .ecr-player__media--auto{height:auto}#ecommreels-admin-app .ecr-player__slider,.ecommreels-short-code .ecr-player__slider,.reelswp-group-short-code .ecr-player__slider,.reelswp-reel-short-code .ecr-player__slider{position:absolute;top:0;display:flex;background:#000;transition:left .2s ease}#ecommreels-admin-app .ecr-player__slide,.ecommreels-short-code .ecr-player__slide,.reelswp-group-short-code .ecr-player__slide,.reelswp-reel-short-code .ecr-player__slide{position:relative;display:flex;align-items:center;justify-content:center;height:90vh;max-width:100vw;aspect-ratio:9 / 16}#ecommreels-admin-app .ecr-player__controls,.ecommreels-short-code .ecr-player__controls,.reelswp-group-short-code .ecr-player__controls,.reelswp-reel-short-code .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:5;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon,.ecommreels-short-code .ecr-player__control-icon,.reelswp-group-short-code .ecr-player__control-icon,.reelswp-reel-short-code .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecommreels-story-modal,.ecommreels-short-code .ecommreels-story-modal,.reelswp-group-short-code .ecommreels-story-modal,.reelswp-reel-short-code .ecommreels-story-modal{max-width:100%!important;z-index:2147483647;background-color:#000c;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}#ecommreels-admin-app #player *,.ecommreels-short-code #player *,.reelswp-group-short-code #player *,.reelswp-reel-short-code #player *{scrollbar-width:none;-ms-overflow-style:none}#ecommreels-admin-app #player *::-webkit-scrollbar,.ecommreels-short-code #player *::-webkit-scrollbar,.reelswp-group-short-code #player *::-webkit-scrollbar,.reelswp-reel-short-code #player *::-webkit-scrollbar{display:none}#ecommreels-admin-app .ecr-player,.ecommreels-short-code .ecr-player,.reelswp-group-short-code .ecr-player,.reelswp-reel-short-code .ecr-player{position:fixed!important;top:0!important;left:0!important;display:grid;place-items:center;width:100vw!important;height:100vh!important}#ecommreels-admin-app .ecr-player__stage,.ecommreels-short-code .ecr-player__stage,.reelswp-group-short-code .ecr-player__stage,.reelswp-reel-short-code .ecr-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:90vh;max-width:100vw;overflow:hidden;border-radius:24px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{height:100vh;border-radius:0}}#ecommreels-admin-app .ecr-player__close,.ecommreels-short-code .ecr-player__close,.reelswp-group-short-code .ecr-player__close,.reelswp-reel-short-code .ecr-player__close{position:absolute;top:8px;right:8px;z-index:5;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1}#ecommreels-admin-app .ecr-player__close-icon,.ecommreels-short-code .ecr-player__close-icon,.reelswp-group-short-code .ecr-player__close-icon,.reelswp-reel-short-code .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-admin-reels-grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}#ecommreels-admin-app .ecr-thumb__media,.ecommreels-short-code .ecr-thumb__media,.reelswp-group-short-code .ecr-thumb__media,.reelswp-reel-short-code .ecr-thumb__media{position:relative;width:100%;height:100%}#ecommreels-admin-app .ecr-thumb__video,.ecommreels-short-code .ecr-thumb__video,.reelswp-group-short-code .ecr-thumb__video,.reelswp-reel-short-code .ecr-thumb__video{pointer-events:none;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-thumb__placeholder,.ecommreels-short-code .ecr-thumb__placeholder,.reelswp-group-short-code .ecr-thumb__placeholder,.reelswp-reel-short-code .ecr-thumb__placeholder{display:flex;width:100%;height:100%;align-items:center;justify-content:center;background:#e5e7eb;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-thumb__views,.ecommreels-short-code .ecr-thumb__views,.reelswp-group-short-code .ecr-thumb__views,.reelswp-reel-short-code .ecr-thumb__views{position:absolute;top:8px;z-index:4;display:inline-flex;align-items:center;gap:4px;background:#6b7280;color:#fff;padding:2.4px 5.6px;font-size:11px;border-radius:4px}#ecommreels-admin-app .ecr-admin-reel-card{display:block}#ecommreels-admin-app .ecr-admin-reel-card__frame{position:relative;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease,box-shadow .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame--selected{border-color:#3b82f6;box-shadow:0 0 0 2px #2b7fff}#ecommreels-admin-app .ecr-admin-reel-card__actions{position:absolute;top:100%;z-index:5;display:flex;width:100%;height:50%;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__actions--hover{top:50%}#ecommreels-admin-app .ecr-admin-reel-card__action{background:#fff;color:#111827}#ecommreels-admin-app .ecr-admin-reel-card__action:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reel-card__icon--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reel-card__icon--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__corner{position:absolute;display:flex;top:-2px;right:-2px;z-index:6;width:42px;height:42px;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__corner--hidden{transform:translate(100%,-100%)}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__corner--hidden{transform:translate(0)}#ecommreels-admin-app .ecr-admin-reel-card__corner--selected{background:#3b82f6}#ecommreels-admin-app .ecr-admin-reel-card__corner--idle{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__select{margin-left:auto;width:24px;height:24px;border-radius:4px;background:transparent;padding:4px}#ecommreels-admin-app .ecr-admin-reel-card__select:hover{background:none}#ecommreels-admin-app .ecr-admin-reel-card__check{color:#6b7280}#ecommreels-admin-app .ecr-admin-reel-card__check--active{color:#fff}#ecommreels-admin-app .ecr-admin-reel-card__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-back-button{background:none;border:none;padding:0;color:#6b7280;cursor:pointer;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-back-button:hover{color:#2563eb}#ecommreels-admin-app .ecr-admin-breadcrumb{margin-top:12px;padding:0 24px;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-breadcrumb__list{display:flex;flex-wrap:wrap;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-breadcrumb__item{display:inline-flex;align-items:center}#ecommreels-admin-app .ecr-admin-breadcrumb__link{color:#2563eb;text-decoration:none;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-breadcrumb__current{font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-breadcrumb__separator{margin:0 4px;font-size:18px;color:#9ca3af}#ecommreels-admin-app .ecr-admin-modal{position:fixed;inset:0;z-index:2147483647;display:grid;place-items:center;background:#000c}#ecommreels-admin-app .ecr-admin-modal__panel{border-radius:8px;background:#fff;padding:24px;min-width:320px;max-width:500px}#ecommreels-admin-app .ecr-admin-modal__content{margin-bottom:16px}#ecommreels-admin-app .ecr-admin-modal__icon{margin-bottom:8px;display:flex;justify-content:center}#ecommreels-admin-app .ecr-admin-modal__message{margin:0;font-size:16px;font-weight:600;color:#111827;text-align:center}#ecommreels-admin-app .ecr-admin-modal__actions{display:flex;width:100%;align-items:center;justify-content:center;gap:8px}#ecommreels-admin-app .ecr-admin-modal__button{border-radius:6px;border:1px solid transparent;padding:6px 24px;font-size:14px;font-weight:600;cursor:pointer}#ecommreels-admin-app .ecr-admin-modal__button:disabled{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-modal__button--cancel{border-color:#3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-modal__button--danger{display:inline-flex;align-items:center;gap:6px;border-color:#ef4444;background:#ef4444;color:#fff}#ecommreels-admin-app .ecr-admin-modal__spinner{animation:ecr-modal-spin 1s linear infinite}@keyframes ecr-modal-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-link-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:6px;background:#3b82f6;padding:8px 16px;font-size:14px;font-weight:600;text-decoration:none;transition:background-color .15s ease;margin-inline-start:auto;white-space:nowrap}#ecommreels-admin-app .ecr-admin-link-button:hover{background:#1d4ed8}#ecommreels-admin-app .ecr-admin-loader{position:fixed;inset:0;z-index:5;display:grid;place-items:center;background:#fffc;color:#3b82f6}#ecommreels-admin-app .ecr-admin-loader__icon{animation:ecr-admin-spin 1s linear infinite}@keyframes ecr-admin-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-navbar{display:flex;align-items:center;justify-content:space-between;background:#fff;padding:16px 24px;gap:16px;flex-wrap:wrap}#ecommreels-admin-app .ecr-admin-navbar__section{display:flex;align-items:center;gap:16px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-navbar{justify-content:center}}#ecommreels-admin-app .ecr-admin-page-name{margin:0;display:inline-flex;align-items:center;gap:4px;font-size:20px;font-weight:600;-webkit-user-select:none;user-select:none;white-space:nowrap}#ecommreels-admin-app .ecr-admin-widget-name{display:inline-flex;align-items:center;justify-content:center;gap:4px;width:320px;border-radius:6px;background:#e5e7eb;padding:8px;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create{margin:16px 24px 0;display:flex;gap:24px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create{flex-direction:column}}#ecommreels-admin-app .ecr-admin-create__panel{position:relative;overflow-x:hidden;border-radius:16px;background:#fff;padding:16px 20px 20px}#ecommreels-admin-app .ecr-admin-create__panel--main{flex:1;min-width:0}#ecommreels-admin-app .ecr-admin-create__panel--side{width:300px;flex-shrink:0}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create__panel--side{width:100%}}#ecommreels-admin-app .ecr-admin-create__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create__separator{margin:12px 0}#ecommreels-admin-app .ecr-admin-save-button{background:#3b82f6;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-save-button:hover{background:#2563eb}#ecommreels-admin-app .ecr-admin-save-button:disabled{background:#6b7280}#ecommreels-admin-app .ecr-admin-save-button__icon{font-size:16px}#ecommreels-admin-app .ecr-admin-save-button__icon--spin{animation:ecr-save-spin 1s linear infinite}@keyframes ecr-save-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-title-input{width:320px;border-radius:6px;border:1px solid transparent;background:#e5e7eb;padding:8px;text-align:center;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-upload{display:grid;width:260px;aspect-ratio:9 / 16;place-items:center;border-radius:12px;border:2px dashed #d1d5db;background:#eff6ff;padding:20px}#ecommreels-admin-app .ecr-admin-upload--active{border-color:#3b82f6;background:#eff6ff}#ecommreels-admin-app .ecr-admin-upload--idle{border-color:#d1d5db}#ecommreels-admin-app .ecr-admin-upload__label{display:grid;cursor:pointer;place-items:center;text-align:center}#ecommreels-admin-app .ecr-admin-upload__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-upload__label:hover .ecr-admin-upload__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-upload__text{margin:8px 0 0;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-stack{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-upload__text-item{font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-strong{font-weight:600}#ecommreels-admin-app .ecr-popover{border-radius:10px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding-block:16px;width:288px;box-shadow:0 10px 30px #00000026;z-index:9}#ecommreels-admin-app .ecr-popover[data-state=open]{animation:ecr-popover-in .15s ease-out}@keyframes ecr-popover-in{0%{opacity:0;transform:translateY(4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.ecr-separator{background:var(--color-border, #e5e7eb);flex-shrink:0}.ecr-separator[data-orientation=horizontal]{height:1px;width:100%}.ecr-separator[data-orientation=vertical]{width:1px;height:100%}.ecr-admin-upgrade__title{margin:0;display:inline-flex;align-items:center;gap:6px;font-weight:600;padding-inline:16px}.ecr-admin-upgrade__name{text-transform:capitalize}.ecr-admin-upgrade__tag{display:inline-block;padding:0 4px;border-radius:2px;background:#2563eb;color:#fff;font-size:10px;letter-spacing:.32px}.ecr-admin-upgrade__text{margin:0;font-size:13px;color:#374151;line-height:1.4;padding-inline:16px}.ecr-admin-upgrade__actions{display:flex;justify-content:flex-end;padding-inline:16px}.ecr-admin-upgrade__button{background:#3b82f6;color:#fff}.ecr-admin-upgrade__button:hover{background:#2563eb}.ecr-admin-upgrade__link{font-size:13px;text-decoration:none}.ecr-admin-separator{margin:12px 0}#ecommreels-admin-app .ecr-dialog__overlay{position:fixed;inset:0;background:#0f172abf;z-index:5}#ecommreels-admin-app .ecr-dialog__overlay[data-state=open]{animation:ecr-dialog-overlay-in .15s ease-out}#ecommreels-admin-app .ecr-dialog__content{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(500px,92vw);max-height:85vh;overflow:auto;border-radius:12px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding:20px;box-shadow:0 25px 60px #0f172a40;z-index:6}#ecommreels-admin-app .ecr-dialog__content[data-state=open]{animation:ecr-dialog-content-in .2s ease-out}#ecommreels-admin-app .ecr-dialog__close{position:absolute;right:12px;top:12px;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-muted-foreground, #6b7280);cursor:pointer}#ecommreels-admin-app .ecr-dialog__close:hover{color:var(--color-foreground, #111827)}#ecommreels-admin-app .ecr-dialog__close-icon{width:16px;height:16px}#ecommreels-admin-app .ecr-dialog__header{display:flex;flex-direction:column;gap:6px;padding-right:36px;margin-bottom:16px}#ecommreels-admin-app .ecr-dialog__title{font-size:16px;font-weight:600;text-transform:none}#ecommreels-admin-app .ecr-dialog__description{font-size:13px;color:var(--color-muted-foreground, #6b7280)}@keyframes ecr-dialog-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes ecr-dialog-content-in{0%{opacity:0;transform:translate(-50%,-48%) scale(.98)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}#ecommreels-admin-app .ecr-admin-link-tabs{width:100%;max-height:550px}#ecommreels-admin-app .ecr-admin-link-tabs__list{width:100%;display:grid;grid-template-columns:1fr;gap:8px;border-radius:10px;padding:3px}#ecommreels-admin-app .ecr-admin-link-tabs__trigger,#ecommreels-admin-app .ecr-admin-link-tabs__lock{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;border:1px solid #3b82f6;border-radius:8px;padding:8px;font-size:13px;font-weight:600;background:#fff;color:#6b7280;text-transform:none}#ecommreels-admin-app .ecr-admin-link-tabs__lock{border-color:#969eab}#ecommreels-admin-app .ecr-admin-link-tabs__trigger{color:#3b82f6}#ecommreels-admin-app .ecr-admin-link-tabs__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-link-tabs__content{display:flex;flex-direction:column;gap:20px}#ecommreels-admin-app .ecr-admin-link-dialog{max-width:560px}#ecommreels-admin-app .ecr-admin-product-link__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-product-link__list{height:100%;max-height:300px;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-product-link__list-inner{display:flex;flex-direction:column;gap:8px;width:100%}#ecommreels-admin-app .ecr-admin-product-link__empty{padding:24px 0;text-align:center;font-size:14px;color:#6b7280}#ecommreels-admin-app .ecr-admin-product-link__item{width:100%}#ecommreels-admin-app .ecr-admin-product-link__button{height:auto;width:100%;justify-content:flex-start;border:1px solid #e5e7eb;background:#f7f7f7;color:#111827;padding:8px;font-weight:400;text-align:left;font-size:13px;display:flex;align-items:center;gap:8px;border-radius:6px}#ecommreels-admin-app .ecr-admin-product-link__button--selected{border-color:#2563eb;background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__button--unselected:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__thumb{pointer-events:none;width:40px;height:40px;flex:0 0 auto}#ecommreels-admin-app .ecr-admin-product-link__error{margin:0 0 8px;text-align:left;font-size:14px;color:#ef4444}#ecommreels-admin-app .ecr-admin-product-link__actions{display:flex;justify-content:end}#ecommreels-admin-app .ecr-admin-product-link__actions .ecr-button{text-transform:capitalize;padding:12px 32px}#ecommreels-admin-app .ecr-admin-product-link__loader{display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-product-link__spinner{width:24px;height:24px;border-radius:999px;border-bottom:2px solid #3b82f6;animation:ecr-admin-product-link-spin 1s linear infinite}@keyframes ecr-admin-product-link-spin{to{transform:rotate(360deg)}}.scrollbarThin{--sb-track: transparent;--sb-thumb: rgba(0, 0, 0, .35);--sb-thumb-hover: rgba(0, 0, 0, .5);--sb-thumb-radius: 6px;--sb-size: 8px;scrollbar-width:thin;scrollbar-color:var(--sb-thumb) var(--sb-track);-ms-overflow-style:auto}.scrollbarThin::-webkit-scrollbar{width:var(--sb-size);height:var(--sb-size)}.scrollbarThin::-webkit-scrollbar-track{background:var(--sb-track)}.scrollbarThin::-webkit-scrollbar-thumb{background-color:var(--sb-thumb);border-radius:var(--sb-thumb-radius);border:2px solid transparent;background-clip:padding-box}.scrollbarThin::-webkit-scrollbar-thumb:hover{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-thumb:active{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-corner{background:var(--sb-track)}.scrollbarThin:focus-within::-webkit-scrollbar-thumb{box-shadow:0 0 0 1px #0000000f inset}#ecommreels-admin-app .ecr-admin-link__label{display:block;text-align:left;font-size:14px;font-weight:600;text-transform:capitalize;margin-bottom:4px}#ecommreels-admin-app .ecr-admin-link__input{width:100%;border-radius:6px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app .ecr-admin-link__input--normal{border-color:#6b7280}#ecommreels-admin-app .ecr-admin-link__input--error{border-color:#ef4444}#ecommreels-admin-app .ecr-admin-link__input:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-link__error{margin:4px 0 0;text-align:left;font-size:12px;color:#ef4444}#ecommreels-admin-app .ecr-admin-link__toggle{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-link__checkbox{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-link__toggle-label{cursor:pointer;font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-link__actions{margin-top:12px;display:flex;gap:8px}#ecommreels-admin-app .ecr-admin-link__actions .ecr-button{text-transform:capitalize;width:100%}#ecommreels-admin-app .ecr-admin-links{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-links__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-links__wrapper{display:flex;flex-direction:column;gap:4px;max-height:380px;overflow-y:auto}#ecommreels-admin-app .ecr-admin-links__item{display:flex;align-items:center;justify-content:space-between;border-radius:6px;background:#eff6ff;padding:2px 8px 2px 16px}#ecommreels-admin-app .ecr-admin-links__remove{color:#ef4444}#ecommreels-admin-app .ecr-admin-links__add-more_btn{margin-top:8px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6;padding:8px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__upgrade{margin-top:12px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6b3;padding:6px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reelvideo{width:100%;border-radius:12px;display:block}#ecommreels-admin-app .ecr-admin-reelvideo--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reelvideo--landscape{width:100%}#ecommreels-admin-app .ecr-admin-customization__panel{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;cursor:grab;align-items:center;justify-content:center;overflow:hidden;border-radius:12px;background:#000;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-customization__panel:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-customization__remove{position:absolute;top:8px;left:8px;z-index:3;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__controls{position:absolute;top:8px;right:8px;z-index:5;display:flex;gap:8px;font-size:18px;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__control{cursor:pointer}#ecommreels-admin-app .ecr-admin-customization{display:flex;width:fit-content;flex-wrap:wrap;gap:16px}#ecommreels-admin-app .ecr-admin-customization__add{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:12px;border:2px dashed #d1d5db;background:#e5e7eb;padding:20px;cursor:pointer}#ecommreels-admin-app .ecr-admin-customization__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-customization__add:hover .ecr-admin-customization__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-customization__label{font-size:13px;color:#4b5563}#ecommreels-admin-app .ecr-admin-customization__lock{position:absolute;top:8px;right:8px;color:#6b7280}#ecommreels-admin-app .ecr-admin-customization__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-thumbnail{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumbnail__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-thumbnail__preview{position:relative;margin:0 auto;width:100%;aspect-ratio:9 / 16;overflow:hidden;border-radius:12px}#ecommreels-admin-app .ecr-admin-thumbnail__image{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-thumbnail__remove{position:absolute;top:8px;right:8px;z-index:3;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-thumbnail__uploader{margin:0 auto;width:100%}#ecommreels-admin-app .ecr-admin-card{margin:24px auto 0;max-width:1024px;border:1px solid #6b7280;border-radius:6px;background:#fff;padding:24px;box-shadow:0 0 8px #aaa}#ecommreels-admin-app .ecr-admin-card--settings{width:fit-content}#ecommreels-admin-app .ecr-admin-card__header{display:flex;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-card__title{margin:0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-groups{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-groups__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-groups__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-groups__create-button{border:1px solid #2563eb;background:#fff;color:#2563eb}#ecommreels-admin-app .ecr-admin-groups__create-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-groups__load-more{display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-groups__load-more__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-load-more-spin 1s linear infinite}@keyframes ecr-load-more-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-groups_action_wrapper{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-groups-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-groups-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-groups-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-groups-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-groups-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-groups-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-groups-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-docs-link{color:#2563eb;display:flex;align-items:center;text-decoration:none;gap:4px;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-docs-link:focus{box-shadow:none}#ecommreels-admin-app .ecr-admin-error{margin-top:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:6px;border:1px solid #fecaca;background:#fef2f2;padding:24px;color:#dc2626}#ecommreels-admin-app .ecr-admin-error__icon{width:28px;height:28px}#ecommreels-admin-app .ecr-admin-error__text{margin:0;text-align:center;font-weight:600}.ecr-table__container{width:100%;overflow-x:auto}.ecr-table{width:100%;border-collapse:collapse;font-size:13px}.ecr-table__header tr{border-bottom:1px solid var(--color-border, #e5e7eb)}.ecr-table__row{border-bottom:1px solid var(--color-border, #e5e7eb);transition:background-color .2s ease}.ecr-table__row:hover,.ecr-table__row[data-state=selected]{background:var(--color-muted, #f3f4f6)}.ecr-table__head,.ecr-table__cell{padding:8px;text-align:left;vertical-align:middle;white-space:nowrap}.ecr-table__head{font-weight:600;color:var(--color-foreground, #111827)}.ecr-table__footer{border-top:1px solid var(--color-border, #e5e7eb);font-weight:600;background:var(--color-muted, #f3f4f6)}.ecr-table__caption{margin-top:16px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-admin-groups__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-groups__row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-groups__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__cell--strong{font-weight:600}#ecommreels-admin-app .ecr-admin-groups__name{display:flex;align-items:center;gap:8px;font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-groups__shortcode{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-groups__shortcode-text{font-family:Courier New,monospace;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-groups__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-groups__copy-button{border:none;border-radius:4px;background:#1f2937;color:#fff;padding:4px 6px;cursor:pointer;transition:transform .15s ease}#ecommreels-admin-app .ecr-admin-groups__copy-button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-groups__copy-icon{display:block;width:12px;height:12px}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip{position:absolute;top:-8px;right:8px;transform:translate(33%,-100%) scale(0);transform-origin:bottom right;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip:after{content:"";position:absolute;bottom:-4px;left:50%;width:12px;height:12px;transform:translate(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip--visible{transform:translate(33%,-100%) scale(1)}#ecommreels-admin-app .ecr-admin-groups__actions{display:flex;align-items:center;justify-content:center;gap:6px}#ecommreels-admin-app .ecr-admin-groups__action-button{color:inherit}#ecommreels-admin-app .ecr-admin-groups__icon{width:18px;height:18px}#ecommreels-admin-app .ecr-admin-groups__icon--neutral{color:#475569}#ecommreels-admin-app .ecr-admin-groups__icon--danger{color:#f43f5e}#ecommreels-admin-app .ecr-admin-groups__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-groups__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:15px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-groups__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-groups__skeleton-table{width:100%;border-collapse:collapse}#ecommreels-admin-app .ecr-admin-groups__skeleton-head{background:#1f2937}#ecommreels-admin-app .ecr-admin-groups__skeleton-row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__skeleton-row--alt{background:#f9fafb}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell{border:1px solid #e5e7eb;padding:8px}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__skeleton-block,#ecommreels-admin-app .ecr-admin-groups__skeleton-line{border-radius:4px;background:#d1d5db;animation:ecr-groups-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-groups__skeleton-block{height:24px}#ecommreels-admin-app .ecr-admin-groups__skeleton-line{height:16px;margin:4px 0}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--tiny,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--tiny{width:32px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--small,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--small{width:96px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--medium,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--medium{width:160px}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--large,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--large{width:220px}@keyframes ecr-groups-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-form{margin-top:24px;display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-form__row{display:grid;grid-template-columns:1fr;align-items:center;gap:24px}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-form__row{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-form__label{font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-form__input{width:128px;border-radius:6px;border:1px solid #d1d5db;padding:8px;font-size:14px}#ecommreels-admin-app .ecr-admin-stats{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-stats__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-stats__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary{font-size:15px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary-skeleton{width:64px;height:24px;border-radius:6px;background:#d1d5db;animation:ecr-stats-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-stats__body{margin-top:16px}@keyframes ecr-stats-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-stats__table{margin-top:8px}#ecommreels-admin-app .ecr-admin-stats__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-stats__row{background:#fff}#ecommreels-admin-app .ecr-admin-stats__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-stats__cell{border:1px solid #e5e7eb;padding:8px;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-stats__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-stats__cell--link{word-break:break-word}#ecommreels-admin-app .ecr-admin-stats__link{color:#2563eb;text-decoration:underline}#ecommreels-admin-app .ecr-admin-stats__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-stats__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-stats__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-group-edit{margin-top:24px;padding:0 24px;display:flex;flex-direction:column;gap:16px;position:relative}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-group-edit{flex-direction:row}}#ecommreels-admin-app .ecr-admin-group-title__wrapper{position:relative}#ecommreels-admin-app .ecr-admin-group-title-customization__trigger{position:absolute;top:50%;translate:0 -50%;right:0;background-color:transparent;color:gray;padding:0 8px}#ecommreels-admin-app .ecr-admin-group-title-customization-dialog{max-width:350px}#ecommreels-admin-app .ecr-admin-nav-btn-reverse{flex-direction:row-reverse}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-nav-btn-reverse{flex-direction:row}}#ecommreels-admin-app .ecr-admin-side-toggle{background:none;border:none;padding:0;color:#6b7280;cursor:pointer}#ecommreels-admin-app .ecr-admin-side-toggle--active{color:#2563eb}.ecr-input{width:100%;min-width:0;border:1px solid transparent;border-radius:6px;background:#f3f4f6;color:inherit;padding:6.4px 12px;font-size:14px;line-height:1.4;transition:border-color .2s ease,box-shadow .2s ease,background-color .2s ease}.ecr-input:focus{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent);background:#fff}.ecr-input::placeholder{color:var(--color-muted-foreground, #9ca3af)}.ecr-input:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-range{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-range__label{font-size:13px;font-weight:600;white-space:nowrap;color:#374151;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-range__row{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-range__slider{width:112px;cursor:pointer;accent-color:#2563eb}#ecommreels-admin-app .ecr-admin-range__value{display:inline-flex;align-items:center;gap:6px}#ecommreels-admin-app .ecr-admin-range__value .ecr-input{width:80px;padding:6px 8px}#ecommreels-admin-app .ecr-admin-range__unit{font-size:12px;color:#6b7280}#ecommreels-admin-app .ecr-admin-group-title_alignment{display:flex;align-items:center;flex-wrap:wrap;gap:8px;justify-content:space-between}#ecommreels-admin-app .ecr-admin-group-title_alignment-label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-group-title_alignment-options{display:flex;align-items:center;gap:0;background-color:#dfdfdf;border-radius:8px;overflow:hidden}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button{border-radius:0;color:#3d3d3d}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button:not(:last-child){border-right:1px solid gray}#ecommreels-admin-app .ecr-admin-group-title-customization__content{display:flex;flex-direction:column;gap:16px;margin-top:40px}#ecommreels-admin-app .ecr-admin-color-selector-popover{width:auto;padding:0;z-index:9}#ecommreels-admin-app .ecr-admin-shortcode{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-shortcode__badge{border-radius:4px;background:#e5e7eb;padding:4px 8px;font-family:Courier New,monospace;font-size:14px;color:#111827;font-weight:900}#ecommreels-admin-app .ecr-admin-shortcode__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-shortcode__button{cursor:pointer;border:none;border-radius:4px;background:#1f2937;padding:4px 6px;color:#fff}#ecommreels-admin-app .ecr-admin-shortcode__button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip{position:absolute;top:50%;right:150%;transform:translateY(-50%) scale(0);transform-origin:center;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-shortcode__tooltip:after{content:"";position:absolute;top:50%;right:-4px;width:12px;height:12px;transform:translateY(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--visible{transform:translateY(-50%) scale(1)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--hidden{transform:translateY(-50%) scale(0)}#ecommreels-admin-app .ecr-admin-reelitem{display:inline-flex;flex-direction:column;width:var(--thumbnail-size, 150px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-reelitem{width:var(--thumbnail-size-mobile, 150px)}}#ecommreels-admin-app .ecr-admin-reelitem__frame{position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:aspect-ratio .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__actions{position:absolute;top:100%;left:0;z-index:1;display:flex;height:50%;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__frame:hover .ecr-admin-reelitem__actions{top:50%}#ecommreels-admin-app .ecr-admin-reelitem__button{background:#fff;color:#111827;padding:4px;border-radius:6px}#ecommreels-admin-app .ecr-admin-reelitem__button:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reelitem__button--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reelitem__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reelitem__spinner{animation:ecr-reelitem-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reelitem__link{display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-reelitem__link--disabled{pointer-events:none}#ecommreels-admin-app .ecr-admin-reelitem__link--active{pointer-events:auto}#ecommreels-admin-app .zoom-in,#ecommreels-admin-app .zoom-out{transition:transform .2s ease}#ecommreels-admin-app .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-reel__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes ecr-reelitem-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-product-card-one,.ecommreels-short-code .ecr-product-card-one,.reelswp-group-short-code .ecr-product-card-one,.reelswp-reel-short-code .ecr-product-card-one{display:flex;flex-direction:column;align-items:stretch;gap:16px;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:8px;padding:8px;overflow:hidden;border:1px solid #fff;flex-shrink:0;border-bottom-left-radius:max(calc(var(--thumbnail-border-radius, 0px) - 4px),8px);border-bottom-right-radius:max(calc(var(--thumbnail-border-radius, 0px) - 4px),8px);transition:all .3s ease-in-out;min-height:var(--thumbnail-border-radius);padding-inline:max(var(--thumbnail-border-radius) / 5,8px)}#ecommreels-admin-app .ecr-product-card-one-content-wrapper,.ecommreels-short-code .ecr-product-card-one-content-wrapper,.reelswp-group-short-code .ecr-product-card-one-content-wrapper,.reelswp-reel-short-code .ecr-product-card-one-content-wrapper{display:flex;align-items:center;gap:8px;flex-shrink:0}#ecommreels-admin-app .ecr-product-card-one__thumb,.ecommreels-short-code .ecr-product-card-one__thumb,.reelswp-group-short-code .ecr-product-card-one__thumb,.reelswp-reel-short-code .ecr-product-card-one__thumb{pointer-events:none;width:40px;height:40px;flex-shrink:0;border-radius:4px}#ecommreels-admin-app .ecr-product-card-one__content,.ecommreels-short-code .ecr-product-card-one__content,.reelswp-group-short-code .ecr-product-card-one__content,.reelswp-reel-short-code .ecr-product-card-one__content{flex-grow:1;display:flex;flex-direction:column;align-items:flex-start;gap:4px;overflow:hidden}#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title{max-width:100%;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:1.2;color:#fff;text-decoration:none}:is(#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title):hover{text-decoration:underline}#ecommreels-admin-app .ecr-product-card-one__meta,.ecommreels-short-code .ecr-product-card-one__meta,.reelswp-group-short-code .ecr-product-card-one__meta,.reelswp-reel-short-code .ecr-product-card-one__meta{display:flex;flex-wrap:wrap;column-gap:8px;row-gap:4px}#ecommreels-admin-app .ecr-product-card-one__rating,.ecommreels-short-code .ecr-product-card-one__rating,.reelswp-group-short-code .ecr-product-card-one__rating,.reelswp-reel-short-code .ecr-product-card-one__rating{margin-left:4px;display:flex;align-items:center;gap:4px;font-size:12px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__star,.ecommreels-short-code .ecr-product-card-one__star,.reelswp-group-short-code .ecr-product-card-one__star,.reelswp-reel-short-code .ecr-product-card-one__star{width:16px;height:16px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price,.ecommreels-short-code .ecr-product-card-one__price,.reelswp-group-short-code .ecr-product-card-one__price,.reelswp-reel-short-code .ecr-product-card-one__price{display:flex;align-items:center;gap:.25ch;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price *,.ecommreels-short-code .ecr-product-card-one__price *,.reelswp-group-short-code .ecr-product-card-one__price *,.reelswp-reel-short-code .ecr-product-card-one__price *{line-height:1;background-color:transparent;color:#fff;font-size:12px}#ecommreels-admin-app .ecr-product-card-one__price span.woocommerce-Price-amount,.ecommreels-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-group-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-reel-short-code .ecr-product-card-one__price span.woocommerce-Price-amount{line-height:normal}#ecommreels-admin-app .ecr-product-card-one__price ins,.ecommreels-short-code .ecr-product-card-one__price ins,.reelswp-group-short-code .ecr-product-card-one__price ins,.reelswp-reel-short-code .ecr-product-card-one__price ins{text-decoration:none}#ecommreels-admin-app .ecr-thumb__link-wrapper,.ecommreels-short-code .ecr-thumb__link-wrapper,.reelswp-group-short-code .ecr-thumb__link-wrapper,.reelswp-reel-short-code .ecr-thumb__link-wrapper{display:flex;flex-direction:column;gap:4px;flex-shrink:0}#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link{display:grid;place-items:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-radius:8px;background-color:transparent;position:relative;min-height:max(var(--thumbnail-border-radius, 48px),48px);text-align:center;font-size:16px;font-weight:600;color:#fff;text-decoration:none;border:1px solid #fff;border-bottom-left-radius:max(var(--thumbnail-border-radius, 8px),8px);border-bottom-right-radius:max(var(--thumbnail-border-radius, 8px),8px);transition:all .3s ease-in-out;isolation:isolate}:is(#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link):hover{text-decoration:underline}:is(#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link):before{content:"";position:absolute;inset:0;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:8px;border-bottom-left-radius:max(var(--thumbnail-border-radius, 8px),8px);border-bottom-right-radius:max(var(--thumbnail-border-radius, 8px),8px);overflow:hidden;z-index:-1;transition:all .3s ease-in-out}#ecommreels-admin-app .ecr-admin-reelitem-links,.ecommreels-short-code .ecr-admin-reelitem-links,.reelswp-group-short-code .ecr-admin-reelitem-links,.reelswp-reel-short-code .ecr-admin-reelitem-links{display:flex;align-items:center;gap:8px;overflow:hidden;margin-top:8px;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-reelitem-links[data-dragging=true] *,.ecommreels-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-group-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-reel-short-code .ecr-admin-reelitem-links[data-dragging=true] *{pointer-events:none}#ecommreels-admin-app .ecr-reel_title,.ecommreels-short-code .ecr-reel_title,.reelswp-group-short-code .ecr-reel_title,.reelswp-reel-short-code .ecr-reel_title{position:absolute;left:50%;transform:translate(-50%);bottom:8px;text-transform:capitalize;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);padding:4px 8px;color:#fff;width:95%;border-radius:8px;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-editor-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-editor-carousel__track{display:flex;width:max-content;flex-wrap:nowrap;padding:16px 0;gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-editor-carousel__track{gap:var(--thumbnail-gap-mobile, 16px)}}#ecommreels-admin-app .ecr-admin-editor-carousel__track--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-carousel__empty{display:flex;width:100%;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-editor-carousel__nav{position:absolute;top:50%;z-index:2;transform:translateY(-50%);border:none;background:#fff;padding:6px 8px;color:#374151;cursor:pointer;width:32px;height:40px;transition:background-color .2s ease;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--left{left:0;border-radius:0 999px 999px 0}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--right{right:0;border-radius:999px 0 0 999px}#ecommreels-admin-app .ecr-admin-editor-grid{display:flex;flex-wrap:wrap;row-gap:16px;column-gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-editor-grid{column-gap:var(--thumbnail-gap-mobile, 16px)}}#ecommreels-admin-app .ecr-admin-editor-grid--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-grid__empty{display:flex;width:100%;justify-content:center;padding-top:160px}#ecommreels-admin-app .ecr-admin-editor-grid__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-grid__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-existing{width:100%;flex:1;overflow:hidden;border-radius:8px;border:1px solid #e5e7eb;background:#fff}#ecommreels-admin-app .ecr-admin-existing__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-existing__title-wrapper{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-existing__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-existing__body{max-height:800px;overflow-y:auto;padding:8px 16px 16px}#ecommreels-admin-app .ecr-preview-player{background-color:#000000b3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);display:grid;place-items:center;padding:24px;width:100%;min-height:320px;border-radius:4px}#ecommreels-admin-app .ecr-preview-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-preview-player .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:min(70vh,560px);max-width:90vw;overflow:hidden;border-radius:24px}#ecommreels-admin-app .ecr-preview-player__media{width:100%;height:100%}#ecommreels-admin-app .ecr-preview-player__media-item{width:100%;object-fit:cover;display:block}#ecommreels-admin-app .ecr-preview-player__nav--disabled{opacity:.4;cursor:not-allowed}#ecommreels-admin-app .ecr-player__close{position:absolute;top:8px;right:8px;z-index:5;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1;background:transparent;border:none}#ecommreels-admin-app .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:5;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecr-preview-player__empty{display:grid;place-items:center;color:#fff;font-size:14px;height:100%;width:100%}#ecommreels-admin-app .ecr-admin-reellist{display:flex;flex-direction:column;min-height:100%;width:100%;flex-shrink:0;overflow-y:auto;border-radius:8px;border:1px solid #e5e7eb;background:#fff;box-shadow:0 1px 2px #0000000d}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-reellist{width:280px}}#ecommreels-admin-app .ecr-admin-reellist__header{border-bottom:1px solid #e5e7eb;padding:16px 16px 8px;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-reellist__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-reellist__body{margin-top:8px;display:flex;flex-direction:column;gap:12px;padding:0 16px 16px}#ecommreels-admin-app .ecr-admin-reellist__add-button{width:100%;flex-shrink:0;margin-inline-start:0;border:1px solid #2563eb;background:#fff}#ecommreels-admin-app .ecr-admin-reellist__add-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reellist__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-reellist__search-input:focus{outline:none;border-color:#93c5fd;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-reellist__grid{margin-top:16px;max-height:60vh;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-reellist__items{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}@media(min-width:767px)and (max-width:1199px){#ecommreels-admin-app .ecr-admin-reellist__items{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-reellist__items{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-reellist__empty{grid-column:1 / -1;padding:24px 0;text-align:center;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-reellist__item{width:100%}#ecommreels-admin-app .ecr-admin-reellist__card{position:relative;width:100%;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease;padding:0}#ecommreels-admin-app .ecr-admin-reellist__card:hover{border-color:#3b82f6}#ecommreels-admin-app .ecr-admin-reellist__media{aspect-ratio:9 / 16;width:100%}#ecommreels-admin-app .ecr-admin-reellist__thumb{pointer-events:none;display:block;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reellist__label{position:absolute;bottom:0;left:0;width:100%;padding:4px;background:linear-gradient(0deg,#fff 20%,#fff0);font-size:13px;font-weight:600;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-reellist__overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#ffffffbf}#ecommreels-admin-app .ecr-admin-reellist__overlay-icon{width:24px;height:24px;color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reellist__loader{grid-column:1 / -1;display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-reellist__spinner{width:24px;height:24px;border-radius:999px;border:2px solid #cbd5e1;border-top-color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}@keyframes ecr-reellist-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-tabs{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-tabs__list{display:inline-flex;align-items:center;background:var(--color-muted, #f3f4f6);border-radius:10px;padding:3px;width:fit-content}#ecommreels-admin-app .ecr-tabs__trigger{border:1px solid transparent;border-radius:8px;padding:8px;font-size:13px;font-weight:600;color:var(--color-muted-foreground, #6b7280);background:transparent;transition:background-color .2s ease,color .2s ease,border-color .2s ease}#ecommreels-admin-app .ecr-tabs__trigger[data-state=active]{background:#fff;color:var(--color-foreground, #111827);border-color:var(--color-border, #e5e7eb);box-shadow:0 1px 2px #0000000f}#ecommreels-admin-app .ecr-tabs__content{outline:none}#ecommreels-admin-app .ecr-admin-sidepanel{position:relative;display:flex;flex-direction:column;min-height:100%;max-height:100%;flex-shrink:0;overflow:hidden;border-radius:8px;transition:width .2s ease}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:100%;height:100%;position:absolute;right:16px;top:0}#ecommreels-admin-app .ecr-admin-mobile-overlay{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#0f172abf;z-index:5}#ecommreels-admin-app .ecr-admin-sidepanel-content{width:280px;background:#fff;margin-left:auto;border:2px solid #e5e7eb;z-index:6;height:100vh;position:fixed;top:0;padding-bottom:64px;right:0}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-sidepanel--expanded{position:static}#ecommreels-admin-app .ecr-admin-mobile-overlay{display:none}#ecommreels-admin-app .ecr-admin-sidepanel-content{position:static;width:280px;background:#fff;margin-left:0;border:2px solid #e5e7eb;height:100%;border-radius:8px}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:fit-content}}#ecommreels-admin-app .ecr-admin-sidepanel--collapsed{width:0;border:0;pointer-events:none}#ecommreels-admin-app .ecr-admin-sidepanel__header{position:relative;display:flex;flex-direction:column;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-sidepanel__title{margin:0;font-size:15px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-sidepanel__body{height:100%;overflow-x:hidden;padding:8px 16px 16px}#ecommreels-admin-app .ecr-admin-sidepanel__tabs,#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{width:100%}#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{display:grid;grid-template-columns:1fr 1fr}#ecommreels-admin-app .ecr-admin-sidepanel__lock-trigger{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;font-size:13px;color:#6b7280;text-transform:capitalize;padding:8px}#ecommreels-admin-app .ecr-admin-sidepanel__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-switch{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:14px;font-weight:500;color:#6b7280}#ecommreels-admin-app .ecr-admin-switch__label{display:inline-flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-switch__icon{color:#6b7280}#ecommreels-admin-app .ecr-admin-popover{background:#eff6ff;z-index:9}#ecommreels-admin-app .ecr-select__trigger{display:inline-flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid var(--color-border, #d1d5db);border-radius:6px;padding:7.2px 12px;font-size:13px;background:#fff;color:var(--color-foreground, #111827);min-width:fit-content}#ecommreels-admin-app .ecr-select__trigger[data-size=sm]{height:32px}#ecommreels-admin-app .ecr-select__trigger[data-size=default]{height:36px}#ecommreels-admin-app .ecr-select__trigger:focus-visible{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent)}#ecommreels-admin-app .ecr-select__icon{width:16px;height:16px;opacity:.6}#ecommreels-admin-app .ecr-select__content{background:#fff;color:var(--color-foreground, #111827);border:1px solid var(--color-border, #d1d5db);border-radius:8px;box-shadow:0 10px 30px #00000026;overflow:hidden;min-width:140px;z-index:9}#ecommreels-admin-app .ecr-select__content[data-side=bottom]{animation:ecr-fade-down .15s ease-out}#ecommreels-admin-app .ecr-select__content[data-side=top]{animation:ecr-fade-up .15s ease-out}#ecommreels-admin-app .ecr-select__viewport{padding:5.6px}#ecommreels-admin-app .ecr-select__item{display:flex;align-items:center;gap:8px;border-radius:6px;padding:8px;font-size:13px;cursor:pointer;text-transform:capitalize}#ecommreels-admin-app .ecr-select__item[data-highlighted]{background:var(--color-accent, #f3f4f6)}#ecommreels-admin-app .ecr-select__item[data-disabled]{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-select__label{padding:5.6px 8px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-select__separator{height:1px;margin:4px 0;background:var(--color-border, #e5e7eb)}#ecommreels-admin-app .ecr-select__check{position:absolute;right:8px;width:14px;height:14px;display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-select__check-icon{width:14px;height:14px}#ecommreels-admin-app .ecr-select__scroll-button{display:flex;align-items:center;justify-content:center;padding:4px 0;cursor:default}@keyframes ecr-fade-down{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}@keyframes ecr-fade-up{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}#ecommreels-admin-app .ecr-admin-thumb-controls{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section{border:1px solid var(--color-border, #e5e7eb);border-radius:10px;padding:12px;background:#fff;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumb-controls__section-trigger{align-items:center;background:transparent;border:none;color:var(--color-foreground, #111827);cursor:pointer;display:flex;font-size:13px;font-weight:600;justify-content:space-between;padding:0;text-align:left}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content[data-state=open]{margin-top:12px;padding-top:12px;border-top:1px solid #e5e7eb}#ecommreels-admin-app .ecr-collapsible__trigger{align-items:center;display:inline-flex;gap:8px;justify-content:space-between;width:100%}#ecommreels-admin-app .ecr-collapsible__trigger-label{align-items:center;display:inline-flex;gap:4px}#ecommreels-admin-app .ecr-collapsible__trigger-icon{height:16px;width:16px;transition:transform .2s ease}#ecommreels-admin-app .ecr-collapsible__trigger[data-state=open] .ecr-collapsible__trigger-icon{transform:rotate(180deg)}#ecommreels-admin-app .ecr-admin-control{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-control--row,#ecommreels-admin-app .ecr-admin-control--inline{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px}#ecommreels-admin-app .ecr-admin-control__label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-control__row{display:flex;align-items:center;gap:12px}#ecommreels-admin-app .ecr-admin-control__row--color{position:relative}#ecommreels-admin-app .ecr-admin-control__choice{display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__choice-label{cursor:pointer;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__trigger,#ecommreels-admin-app .ecr-admin-control__option{text-transform:capitalize}.ecr-admin-control__lock-trigger{display:flex;width:100%;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;font-size:13px;color:#6b7280;cursor:pointer;border:none}.ecr-admin-control__lock-trigger:hover{background:#f3f4f6}.ecr-admin-control__popover{background:#eff6ff}.ecr-admin-control__swatch{width:24px;height:24px;cursor:pointer;border-radius:4px;border:2px solid #6b7280}#ecommreels-admin-app .ecr-admin-control__picker{position:absolute;top:100%;left:0;z-index:9;box-shadow:0 8px 16px #0000001f;outline:none}#ecommreels-admin-app .ecr-admin-control__hex{width:80px;border-radius:4px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{--reels-wp-animation-time: 3s;--reels-wp-marquee-time: 20s}#ecommreels-admin-app .ecr-player__loader,.ecommreels-short-code .ecr-player__loader,.reelswp-group-short-code .ecr-player__loader,.reelswp-reel-short-code .ecr-player__loader{height:90vh;max-width:100vw;aspect-ratio:9 / 16;border-radius:16px;border:1px solid #e5e7eb;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-loader,.ecommreels-short-code .ecr-loader,.reelswp-group-short-code .ecr-loader,.reelswp-reel-short-code .ecr-loader{width:100%;height:100%;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px}#ecommreels-admin-app .ecr-loader__ball,.ecommreels-short-code .ecr-loader__ball,.reelswp-group-short-code .ecr-loader__ball,.reelswp-reel-short-code .ecr-loader__ball{width:20px;height:20px;border-radius:50%;background:#919191;animation:ecr-bounce 1s alternate infinite}#ecommreels-admin-app .ecr-loader__ball:nth-child(2),.ecommreels-short-code .ecr-loader__ball:nth-child(2),.reelswp-group-short-code .ecr-loader__ball:nth-child(2),.reelswp-reel-short-code .ecr-loader__ball:nth-child(2){animation-delay:.25s}#ecommreels-admin-app .ecr-loader__ball:nth-child(3),.ecommreels-short-code .ecr-loader__ball:nth-child(3),.reelswp-group-short-code .ecr-loader__ball:nth-child(3),.reelswp-reel-short-code .ecr-loader__ball:nth-child(3){animation-delay:.5s}@keyframes ecr-bounce{0%{transform:scale(2)}to{transform:scale(1)}}#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{display:block;width:var(--thumbnail-size, 150px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{width:var(--thumbnail-size-mobile, 150px)}}#ecommreels-admin-app .ecr-thumb__frame,.ecommreels-short-code .ecr-thumb__frame,.reelswp-group-short-code .ecr-thumb__frame,.reelswp-reel-short-code .ecr-thumb__frame{cursor:pointer;overflow:hidden;width:100%;position:relative}#ecommreels-admin-app .zoom-in,.ecommreels-short-code .zoom-in,.reelswp-group-short-code .zoom-in,.reelswp-reel-short-code .zoom-in,#ecommreels-admin-app .zoom-out,.ecommreels-short-code .zoom-out,.reelswp-group-short-code .zoom-out,.reelswp-reel-short-code .zoom-out{transition:transform .2s ease-in-out}#ecommreels-admin-app .zoom-in:hover,.ecommreels-short-code .zoom-in:hover,.reelswp-group-short-code .zoom-in:hover,.reelswp-reel-short-code .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover,.ecommreels-short-code .zoom-out:hover,.reelswp-group-short-code .zoom-out:hover,.reelswp-reel-short-code .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-reel__title,.ecommreels-short-code .ecr-reel__title,.reelswp-group-short-code .ecr-reel__title,.reelswp-reel-short-code .ecr-reel__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-front-carousel,.ecommreels-short-code .ecr-front-carousel,.reelswp-group-short-code .ecr-front-carousel,.reelswp-reel-short-code .ecr-front-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-front-carousel__viewport,.ecommreels-short-code .ecr-front-carousel__viewport,.reelswp-group-short-code .ecr-front-carousel__viewport,.reelswp-reel-short-code .ecr-front-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{display:flex;flex-wrap:nowrap;width:max-content;gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{gap:var(--thumbnail-gap-mobile, 16px)}}#ecommreels-admin-app .ecr-front-carousel__track--zoom,.ecommreels-short-code .ecr-front-carousel__track--zoom,.reelswp-group-short-code .ecr-front-carousel__track--zoom,.reelswp-reel-short-code .ecr-front-carousel__track--zoom{padding:16px}#ecommreels-admin-app .ecr-front-carousel__nav,.ecommreels-short-code .ecr-front-carousel__nav,.reelswp-group-short-code .ecr-front-carousel__nav,.reelswp-reel-short-code .ecr-front-carousel__nav{position:absolute;top:50%;z-index:1;transform:translateY(-50%);border:none;background:#fff;color:#1f2937;cursor:pointer;width:32px;height:40px;padding:0;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-front-carousel__nav--left,.ecommreels-short-code .ecr-front-carousel__nav--left,.reelswp-group-short-code .ecr-front-carousel__nav--left,.reelswp-reel-short-code .ecr-front-carousel__nav--left{left:0;border-top-right-radius:999px;border-bottom-right-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav--right,.ecommreels-short-code .ecr-front-carousel__nav--right,.reelswp-group-short-code .ecr-front-carousel__nav--right,.reelswp-reel-short-code .ecr-front-carousel__nav--right{right:0;border-top-left-radius:999px;border-bottom-left-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav:hover,.ecommreels-short-code .ecr-front-carousel__nav:hover,.reelswp-group-short-code .ecr-front-carousel__nav:hover,.reelswp-reel-short-code .ecr-front-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-front-grid,.ecommreels-short-code .ecr-front-grid,.reelswp-group-short-code .ecr-front-grid,.reelswp-reel-short-code .ecr-front-grid{cursor:default;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid, 150px),1fr));row-gap:16px;column-gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{column-gap:var(--thumbnail-gap-mobile, 16px);grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid-mobile, 150px),1fr))}}
    2 /*$vite$:1*/`,document.head.appendChild(ya);function wa(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const x=wa(y),vr=wa(_a);function Cd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var In={exports:{}},qt={};/**
     1(function(y,_a,Ln,va){"use strict";var ya=document.createElement("style");ya.textContent=`:root{--color-primary: #2563eb;--color-primary-foreground: #ffffff;--color-secondary: #e5e7eb;--color-secondary-foreground: #111827;--color-foreground: #111827;--color-muted: #f3f4f6;--color-muted-foreground: #6b7280;--color-accent: #f3f4f6;--color-border: #e5e7eb;--color-ring: #60a5fa}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{box-sizing:border-box;color:var(--color-foreground, #111);font-family:Inter,Segoe UI,system-ui,-apple-system,sans-serif}#ecommreels-admin-app *,#ecommreels-admin-app *:before,#ecommreels-admin-app *:after,.ecommreels-short-code *,.ecommreels-short-code *:before,.ecommreels-short-code *:after,.reelswp-group-short-code *,.reelswp-group-short-code *:before,.reelswp-group-short-code *:after,.reelswp-reel-short-code *,.reelswp-reel-short-code *:before,.reelswp-reel-short-code *:after{box-sizing:inherit}#ecommreels-admin-app input,#ecommreels-admin-app select,#ecommreels-admin-app textarea,.ecommreels-short-code input,.ecommreels-short-code select,.ecommreels-short-code textarea,.reelswp-group-short-code input,.reelswp-group-short-code select,.reelswp-group-short-code textarea,.reelswp-reel-short-code input,.reelswp-reel-short-code select,.reelswp-reel-short-code textarea{font:inherit;color:inherit}#ecommreels-admin-app button,.ecommreels-short-code button,.reelswp-group-short-code button,.reelswp-reel-short-code button{border:none}#ecommreels-admin-app input[type=checkbox],#ecommreels-admin-app input[type=radio],.ecommreels-short-code input[type=checkbox],.ecommreels-short-code input[type=radio],.reelswp-group-short-code input[type=checkbox],.reelswp-group-short-code input[type=radio],.reelswp-reel-short-code input[type=checkbox],.reelswp-reel-short-code input[type=radio]{margin:0}#ecommreels-admin-app input[type=number]::-webkit-inner-spin-button,#ecommreels-admin-app input[type=number]::-webkit-outer-spin-button,.ecommreels-short-code input[type=number]::-webkit-inner-spin-button,.ecommreels-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-group-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-group-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}#ecommreels-admin-app input[type=number],.ecommreels-short-code input[type=number],.reelswp-group-short-code input[type=number],.reelswp-reel-short-code input[type=number]{-moz-appearance:textfield}#ecommreels-admin-app input,.ecommreels-short-code input,.reelswp-group-short-code input,.reelswp-reel-short-code input{min-height:auto}#ecommreels-admin-app img,.ecommreels-short-code img,.reelswp-group-short-code img,.reelswp-reel-short-code img{max-width:100%;display:block}#ecommreels-admin-app h1,#ecommreels-admin-app h2,#ecommreels-admin-app h3,#ecommreels-admin-app h4,#ecommreels-admin-app h5,#ecommreels-admin-app h6,.ecommreels-short-code h1,.ecommreels-short-code h2,.ecommreels-short-code h3,.ecommreels-short-code h4,.ecommreels-short-code h5,.ecommreels-short-code h6,.reelswp-group-short-code h1,.reelswp-group-short-code h2,.reelswp-group-short-code h3,.reelswp-group-short-code h4,.reelswp-group-short-code h5,.reelswp-group-short-code h6,.reelswp-reel-short-code h1,.reelswp-reel-short-code h2,.reelswp-reel-short-code h3,.reelswp-reel-short-code h4,.reelswp-reel-short-code h5,.reelswp-reel-short-code h6{margin:0;font-weight:600}#ecommreels-admin-app p,.ecommreels-short-code p,.reelswp-group-short-code p,.reelswp-reel-short-code p{margin:0}#ecommreels-admin-app .ecr-admin-panel{position:relative;margin:24px;min-height:50vh;border-radius:6px;border:1px solid #d1d5db;background:#fff;padding:16px}#ecommreels-admin-app .ecr-admin-panel--reels{padding:16px}#ecommreels-admin-app .ecr-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid transparent;border-radius:6px;font-size:14px;font-weight:600;line-height:1;padding:8px 16px;background:#111;color:#fff;cursor:pointer;transition:background-color .2s ease,border-color .2s ease,color .2s ease,box-shadow .2s ease,transform .2s ease}#ecommreels-admin-app .ecr-button:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-button--primary{background:#2563eb;color:#fff}#ecommreels-admin-app .ecr-button--primary:hover{background:#1f29371a}#ecommreels-admin-app .ecr-button--secondary{background:#e5e7eb;color:#111827}#ecommreels-admin-app .ecr-button--secondary:hover{background:#e5e7eb1a}#ecommreels-admin-app .ecr-button--outline{background:transparent;border-color:#2563eb;color:#2563eb}#ecommreels-admin-app .ecr-button--outline:hover{background:#2563eb1a}#ecommreels-admin-app .ecr-button--outline-danger{background:transparent;border-color:#dc2626;color:#dc2626}#ecommreels-admin-app .ecr-button--outline-danger:hover{background:#dc26261a}#ecommreels-admin-app .ecr-button--ghost{background:transparent;color:#111827}#ecommreels-admin-app .ecr-button--ghost:hover{background:#f3f4f6}#ecommreels-admin-app .ecr-button--link{background:none;border-color:transparent;padding:0;color:#2563eb;text-decoration:none}#ecommreels-admin-app .ecr-button--link:hover{text-decoration:underline}#ecommreels-admin-app .ecr-button--danger{background:#dc2626;color:#fff}#ecommreels-admin-app .ecr-button--danger:hover{background:#b91c1c}#ecommreels-admin-app .ecr-button--sm{height:32px;padding:0 12px;font-size:13px}#ecommreels-admin-app .ecr-button--md{height:36px;padding:0 16px}#ecommreels-admin-app .ecr-button--lg{height:40px;padding:0 20px;font-size:15px}#ecommreels-admin-app .ecr-button--icon,#ecommreels-admin-app .ecr-button--icon-sm,#ecommreels-admin-app .ecr-button--icon-lg{padding:0;width:36px;height:36px}#ecommreels-admin-app .ecr-button--icon-sm{width:32px;height:32px}#ecommreels-admin-app .ecr-button--icon-lg{width:40px;height:40px}#ecommreels-admin-app .ecr-admin-reels-header{margin-bottom:16px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__left{display:flex;align-items:center;gap:32px}#ecommreels-admin-app .ecr-admin-reels-header__right{display:flex;flex-wrap:wrap;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__title{margin:0;padding:6px 0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-reels-header__actions{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__action{padding:0;font-weight:600;background:none;border:none;box-shadow:none}#ecommreels-admin-app .ecr-admin-reels-header__action--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reels-header__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reels-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-reels-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-reels-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-reels-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__create{border:1px solid #3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-reels-header__create:hover{background:#ffffffe6}#ecommreels-admin-app .ecr-admin-reels-header__spinner{animation:ecr-reels-spin 1s linear infinite}@keyframes ecr-reels-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-reels-empty{display:flex;align-items:center;justify-content:center;padding-top:50px}#ecommreels-admin-app .ecr-admin-reels-empty__text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:14px}#ecommreels-admin-app .ecr-admin-reels-loading{display:flex;align-items:center;justify-content:center;padding:16px 0}#ecommreels-admin-app .ecr-admin-reels-loading--fullscreen{position:absolute;inset:0}#ecommreels-admin-app .ecr-admin-reels-loading__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-reels-loading-spin 1s linear infinite}@keyframes ecr-reels-loading-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-player__progress,.ecommreels-short-code .ecr-player__progress,.reelswp-group-short-code .ecr-player__progress,.reelswp-reel-short-code .ecr-player__progress{position:absolute;top:4px;left:50%;z-index:2;display:flex;width:90%;transform:translate(-50%);gap:4px;overflow:hidden;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-track,.ecommreels-short-code .ecr-player__progress-track,.reelswp-group-short-code .ecr-player__progress-track,.reelswp-reel-short-code .ecr-player__progress-track{width:100%;height:3px;background:#ffffff80;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-fill,.ecommreels-short-code .ecr-player__progress-fill,.reelswp-group-short-code .ecr-player__progress-fill,.reelswp-reel-short-code .ecr-player__progress-fill{height:3px;background:#fff;border-radius:999px;width:0}#ecommreels-admin-app .ecr-player__progress-fill--active,.ecommreels-short-code .ecr-player__progress-fill--active,.reelswp-group-short-code .ecr-player__progress-fill--active,.reelswp-reel-short-code .ecr-player__progress-fill--active{animation:ecr-progress var(--reels-wp-animation-time) linear forwards}#ecommreels-admin-app .ecr-player__progress-fill--complete,.ecommreels-short-code .ecr-player__progress-fill--complete,.reelswp-group-short-code .ecr-player__progress-fill--complete,.reelswp-reel-short-code .ecr-player__progress-fill--complete{width:100%}#ecommreels-admin-app .ecr-player__progress-fill--empty,.ecommreels-short-code .ecr-player__progress-fill--empty,.reelswp-group-short-code .ecr-player__progress-fill--empty,.reelswp-reel-short-code .ecr-player__progress-fill--empty{width:0}@keyframes ecr-progress{0%{width:0}to{width:100%}}#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{position:absolute;top:50%;z-index:5;display:none;width:40px;height:40px;padding:0;transform:translateY(-50%);border:none;border-radius:999px;background:#ffffffd9;color:#374151;cursor:pointer;align-items:center;justify-content:center}@media(min-width:1024px){#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{display:grid}}#ecommreels-admin-app .ecr-player__nav--left,.ecommreels-short-code .ecr-player__nav--left,.reelswp-group-short-code .ecr-player__nav--left,.reelswp-reel-short-code .ecr-player__nav--left{left:0;transform:translate(-120%,-50%)}#ecommreels-admin-app .ecr-player__nav--right,.ecommreels-short-code .ecr-player__nav--right,.reelswp-group-short-code .ecr-player__nav--right,.reelswp-reel-short-code .ecr-player__nav--right{right:0;transform:translate(120%,-50%)}#ecommreels-admin-app .ecr-player__nav:hover,.ecommreels-short-code .ecr-player__nav:hover,.reelswp-group-short-code .ecr-player__nav:hover,.reelswp-reel-short-code .ecr-player__nav:hover{background:#fff}#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{position:relative;display:flex;width:100%;height:100%;align-items:center;justify-content:center;overflow:hidden;border-radius:16px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{border-radius:0}}#ecommreels-admin-app .ecr-player__media,.ecommreels-short-code .ecr-player__media,.reelswp-group-short-code .ecr-player__media,.reelswp-reel-short-code .ecr-player__media{width:100%;height:auto}#ecommreels-admin-app .ecr-player__media--portrait,.ecommreels-short-code .ecr-player__media--portrait,.reelswp-group-short-code .ecr-player__media--portrait,.reelswp-reel-short-code .ecr-player__media--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-player__media--auto,.ecommreels-short-code .ecr-player__media--auto,.reelswp-group-short-code .ecr-player__media--auto,.reelswp-reel-short-code .ecr-player__media--auto{height:auto}#ecommreels-admin-app .ecr-player__slider,.ecommreels-short-code .ecr-player__slider,.reelswp-group-short-code .ecr-player__slider,.reelswp-reel-short-code .ecr-player__slider{position:absolute;top:0;display:flex;background:#000;transition:left .2s ease}#ecommreels-admin-app .ecr-player__slide,.ecommreels-short-code .ecr-player__slide,.reelswp-group-short-code .ecr-player__slide,.reelswp-reel-short-code .ecr-player__slide{position:relative;display:flex;align-items:center;justify-content:center;height:90vh;max-width:100vw;aspect-ratio:9 / 16}#ecommreels-admin-app .ecr-player__controls,.ecommreels-short-code .ecr-player__controls,.reelswp-group-short-code .ecr-player__controls,.reelswp-reel-short-code .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:5;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon,.ecommreels-short-code .ecr-player__control-icon,.reelswp-group-short-code .ecr-player__control-icon,.reelswp-reel-short-code .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecommreels-story-modal,.ecommreels-short-code .ecommreels-story-modal,.reelswp-group-short-code .ecommreels-story-modal,.reelswp-reel-short-code .ecommreels-story-modal{max-width:100%!important;z-index:2147483647;background-color:#000c;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}#ecommreels-admin-app #player *,.ecommreels-short-code #player *,.reelswp-group-short-code #player *,.reelswp-reel-short-code #player *{scrollbar-width:none;-ms-overflow-style:none}#ecommreels-admin-app #player *::-webkit-scrollbar,.ecommreels-short-code #player *::-webkit-scrollbar,.reelswp-group-short-code #player *::-webkit-scrollbar,.reelswp-reel-short-code #player *::-webkit-scrollbar{display:none}#ecommreels-admin-app .ecr-player,.ecommreels-short-code .ecr-player,.reelswp-group-short-code .ecr-player,.reelswp-reel-short-code .ecr-player{position:fixed!important;top:0!important;left:0!important;display:grid;place-items:center;width:100vw!important;height:100vh!important}#ecommreels-admin-app .ecr-player__stage,.ecommreels-short-code .ecr-player__stage,.reelswp-group-short-code .ecr-player__stage,.reelswp-reel-short-code .ecr-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:90vh;max-width:100vw;overflow:hidden;border-radius:24px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{height:100vh;border-radius:0}}#ecommreels-admin-app .ecr-player__close,.ecommreels-short-code .ecr-player__close,.reelswp-group-short-code .ecr-player__close,.reelswp-reel-short-code .ecr-player__close{position:absolute;top:8px;right:8px;z-index:5;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1}#ecommreels-admin-app .ecr-player__close-icon,.ecommreels-short-code .ecr-player__close-icon,.reelswp-group-short-code .ecr-player__close-icon,.reelswp-reel-short-code .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-admin-reels-grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}#ecommreels-admin-app .ecr-thumb__media,.ecommreels-short-code .ecr-thumb__media,.reelswp-group-short-code .ecr-thumb__media,.reelswp-reel-short-code .ecr-thumb__media{position:relative;width:100%;height:100%}#ecommreels-admin-app .ecr-thumb__video,.ecommreels-short-code .ecr-thumb__video,.reelswp-group-short-code .ecr-thumb__video,.reelswp-reel-short-code .ecr-thumb__video{pointer-events:none;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-thumb__placeholder,.ecommreels-short-code .ecr-thumb__placeholder,.reelswp-group-short-code .ecr-thumb__placeholder,.reelswp-reel-short-code .ecr-thumb__placeholder{display:flex;width:100%;height:100%;align-items:center;justify-content:center;background:#e5e7eb;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-thumb__views,.ecommreels-short-code .ecr-thumb__views,.reelswp-group-short-code .ecr-thumb__views,.reelswp-reel-short-code .ecr-thumb__views{position:absolute;top:8px;z-index:4;display:inline-flex;align-items:center;gap:4px;background:#6b7280;color:#fff;padding:2.4px 5.6px;font-size:11px;border-radius:4px}#ecommreels-admin-app .ecr-admin-reel-card{display:block}#ecommreels-admin-app .ecr-admin-reel-card__frame{position:relative;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease,box-shadow .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame--selected{border-color:#3b82f6;box-shadow:0 0 0 2px #2b7fff}#ecommreels-admin-app .ecr-admin-reel-card__actions{position:absolute;top:100%;z-index:5;display:flex;width:100%;height:50%;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__actions--hover{top:50%}#ecommreels-admin-app .ecr-admin-reel-card__action{background:#fff;color:#111827}#ecommreels-admin-app .ecr-admin-reel-card__action:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reel-card__icon--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reel-card__icon--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__corner{position:absolute;display:flex;top:-2px;right:-2px;z-index:6;width:42px;height:42px;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__corner--hidden{transform:translate(100%,-100%)}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__corner--hidden{transform:translate(0)}#ecommreels-admin-app .ecr-admin-reel-card__corner--selected{background:#3b82f6}#ecommreels-admin-app .ecr-admin-reel-card__corner--idle{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__select{margin-left:auto;width:24px;height:24px;border-radius:4px;background:transparent;padding:4px}#ecommreels-admin-app .ecr-admin-reel-card__select:hover{background:none}#ecommreels-admin-app .ecr-admin-reel-card__check{color:#6b7280}#ecommreels-admin-app .ecr-admin-reel-card__check--active{color:#fff}#ecommreels-admin-app .ecr-admin-reel-card__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-back-button{background:none;border:none;padding:0;color:#6b7280;cursor:pointer;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-back-button:hover{color:#2563eb}#ecommreels-admin-app .ecr-admin-breadcrumb{margin-top:12px;padding:0 24px;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-breadcrumb__list{display:flex;flex-wrap:wrap;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-breadcrumb__item{display:inline-flex;align-items:center}#ecommreels-admin-app .ecr-admin-breadcrumb__link{color:#2563eb;text-decoration:none;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-breadcrumb__current{font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-breadcrumb__separator{margin:0 4px;font-size:18px;color:#9ca3af}#ecommreels-admin-app .ecr-admin-modal{position:fixed;inset:0;z-index:2147483647;display:grid;place-items:center;background:#000c}#ecommreels-admin-app .ecr-admin-modal__panel{border-radius:8px;background:#fff;padding:24px;min-width:320px;max-width:500px}#ecommreels-admin-app .ecr-admin-modal__content{margin-bottom:16px}#ecommreels-admin-app .ecr-admin-modal__icon{margin-bottom:8px;display:flex;justify-content:center}#ecommreels-admin-app .ecr-admin-modal__message{margin:0;font-size:16px;font-weight:600;color:#111827;text-align:center}#ecommreels-admin-app .ecr-admin-modal__actions{display:flex;width:100%;align-items:center;justify-content:center;gap:8px}#ecommreels-admin-app .ecr-admin-modal__button{border-radius:6px;border:1px solid transparent;padding:6px 24px;font-size:14px;font-weight:600;cursor:pointer}#ecommreels-admin-app .ecr-admin-modal__button:disabled{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-modal__button--cancel{border-color:#3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-modal__button--danger{display:inline-flex;align-items:center;gap:6px;border-color:#ef4444;background:#ef4444;color:#fff}#ecommreels-admin-app .ecr-admin-modal__spinner{animation:ecr-modal-spin 1s linear infinite}@keyframes ecr-modal-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-link-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:6px;background:#3b82f6;padding:8px 16px;font-size:14px;font-weight:600;text-decoration:none;transition:background-color .15s ease;margin-inline-start:auto;white-space:nowrap}#ecommreels-admin-app .ecr-admin-link-button:hover{background:#1d4ed8}#ecommreels-admin-app .ecr-admin-loader{position:fixed;inset:0;z-index:5;display:grid;place-items:center;background:#fffc;color:#3b82f6}#ecommreels-admin-app .ecr-admin-loader__icon{animation:ecr-admin-spin 1s linear infinite}@keyframes ecr-admin-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-navbar{display:flex;align-items:center;justify-content:space-between;background:#fff;padding:16px 24px;gap:16px;flex-wrap:wrap}#ecommreels-admin-app .ecr-admin-navbar__section{display:flex;align-items:center;gap:16px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-navbar{justify-content:center}}#ecommreels-admin-app .ecr-admin-page-name{margin:0;display:inline-flex;align-items:center;gap:4px;font-size:20px;font-weight:600;-webkit-user-select:none;user-select:none;white-space:nowrap}#ecommreels-admin-app .ecr-admin-widget-name{display:inline-flex;align-items:center;justify-content:center;gap:4px;width:320px;border-radius:6px;background:#e5e7eb;padding:8px;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create{margin:16px 24px 0;display:flex;gap:24px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create{flex-direction:column}}#ecommreels-admin-app .ecr-admin-create__panel{position:relative;overflow-x:hidden;border-radius:16px;background:#fff;padding:16px 20px 20px}#ecommreels-admin-app .ecr-admin-create__panel--main{flex:1;min-width:0}#ecommreels-admin-app .ecr-admin-create__panel--side{width:300px;flex-shrink:0}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create__panel--side{width:100%}}#ecommreels-admin-app .ecr-admin-create__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create__separator{margin:12px 0}#ecommreels-admin-app .ecr-admin-save-button{background:#3b82f6;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-save-button:hover{background:#2563eb}#ecommreels-admin-app .ecr-admin-save-button:disabled{background:#6b7280}#ecommreels-admin-app .ecr-admin-save-button__icon{font-size:16px}#ecommreels-admin-app .ecr-admin-save-button__icon--spin{animation:ecr-save-spin 1s linear infinite}@keyframes ecr-save-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-title-input{width:320px;border-radius:6px;border:1px solid transparent;background:#e5e7eb;padding:8px;text-align:center;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-upload{display:grid;width:260px;aspect-ratio:9 / 16;place-items:center;border-radius:12px;border:2px dashed #d1d5db;background:#eff6ff;padding:20px}#ecommreels-admin-app .ecr-admin-upload--active{border-color:#3b82f6;background:#eff6ff}#ecommreels-admin-app .ecr-admin-upload--idle{border-color:#d1d5db}#ecommreels-admin-app .ecr-admin-upload__label{display:grid;cursor:pointer;place-items:center;text-align:center}#ecommreels-admin-app .ecr-admin-upload__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-upload__label:hover .ecr-admin-upload__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-upload__text{margin:8px 0 0;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-stack{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-upload__text-item{font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-strong{font-weight:600}#ecommreels-admin-app .ecr-popover{border-radius:10px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding-block:16px;width:288px;box-shadow:0 10px 30px #00000026;z-index:999}#ecommreels-admin-app .ecr-popover[data-state=open]{animation:ecr-popover-in .15s ease-out}@keyframes ecr-popover-in{0%{opacity:0;transform:translateY(4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.ecr-separator{background:var(--color-border, #e5e7eb);flex-shrink:0}.ecr-separator[data-orientation=horizontal]{height:1px;width:100%}.ecr-separator[data-orientation=vertical]{width:1px;height:100%}.ecr-admin-upgrade__title{margin:0;display:inline-flex;align-items:center;gap:6px;font-weight:600;padding-inline:16px}.ecr-admin-upgrade__name{text-transform:capitalize}.ecr-admin-upgrade__tag{display:inline-block;padding:0 4px;border-radius:2px;background:#2563eb;color:#fff;font-size:10px;letter-spacing:.32px}.ecr-admin-upgrade__text{margin:0;font-size:13px;color:#374151;line-height:1.4;padding-inline:16px}.ecr-admin-upgrade__actions{display:flex;justify-content:flex-end;padding-inline:16px}.ecr-admin-upgrade__button{background:#3b82f6;color:#fff}.ecr-admin-upgrade__button:hover{background:#2563eb}.ecr-admin-upgrade__link{font-size:13px;text-decoration:none}.ecr-admin-separator{margin:12px 0}#ecommreels-admin-app .ecr-dialog__overlay{position:fixed;inset:0;background:#0f172abf;z-index:5}#ecommreels-admin-app .ecr-dialog__overlay[data-state=open]{animation:ecr-dialog-overlay-in .15s ease-out}#ecommreels-admin-app .ecr-dialog__content{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(500px,92vw);max-height:85vh;overflow:auto;border-radius:12px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding:20px;box-shadow:0 25px 60px #0f172a40;z-index:6}#ecommreels-admin-app .ecr-dialog__content[data-state=open]{animation:ecr-dialog-content-in .2s ease-out}#ecommreels-admin-app .ecr-dialog__close{position:absolute;right:12px;top:12px;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-muted-foreground, #6b7280);cursor:pointer}#ecommreels-admin-app .ecr-dialog__close:hover{color:var(--color-foreground, #111827)}#ecommreels-admin-app .ecr-dialog__close-icon{width:16px;height:16px}#ecommreels-admin-app .ecr-dialog__header{display:flex;flex-direction:column;gap:6px;padding-right:36px;margin-bottom:16px}#ecommreels-admin-app .ecr-dialog__title{font-size:16px;font-weight:600;text-transform:none}#ecommreels-admin-app .ecr-dialog__description{font-size:13px;color:var(--color-muted-foreground, #6b7280)}@keyframes ecr-dialog-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes ecr-dialog-content-in{0%{opacity:0;transform:translate(-50%,-48%) scale(.98)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}#ecommreels-admin-app .ecr-admin-link-tabs{width:100%;max-height:550px}#ecommreels-admin-app .ecr-admin-link-tabs__list{width:100%;display:grid;grid-template-columns:1fr;gap:8px;border-radius:10px;padding:3px}#ecommreels-admin-app .ecr-admin-link-tabs__trigger,#ecommreels-admin-app .ecr-admin-link-tabs__lock{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;border:1px solid #3b82f6;border-radius:8px;padding:8px;font-size:13px;font-weight:600;background:#fff;color:#6b7280;text-transform:none}#ecommreels-admin-app .ecr-admin-link-tabs__lock{border-color:#969eab}#ecommreels-admin-app .ecr-admin-link-tabs__trigger{color:#3b82f6}#ecommreels-admin-app .ecr-admin-link-tabs__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-link-tabs__content{display:flex;flex-direction:column;gap:20px}#ecommreels-admin-app .ecr-admin-link-dialog{max-width:560px}#ecommreels-admin-app .ecr-admin-product-link__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-product-link__list{height:100%;max-height:300px;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-product-link__list-inner{display:flex;flex-direction:column;gap:8px;width:100%}#ecommreels-admin-app .ecr-admin-product-link__empty{padding:24px 0;text-align:center;font-size:14px;color:#6b7280}#ecommreels-admin-app .ecr-admin-product-link__item{width:100%}#ecommreels-admin-app .ecr-admin-product-link__button{height:auto;width:100%;justify-content:flex-start;border:1px solid #e5e7eb;background:#f7f7f7;color:#111827;padding:8px;font-weight:400;text-align:left;font-size:13px;display:flex;align-items:center;gap:8px;border-radius:6px}#ecommreels-admin-app .ecr-admin-product-link__button--selected{border-color:#2563eb;background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__button--unselected:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__thumb{pointer-events:none;width:40px;height:40px;flex:0 0 auto}#ecommreels-admin-app .ecr-admin-product-link__error{margin:0 0 8px;text-align:left;font-size:14px;color:#ef4444}#ecommreels-admin-app .ecr-admin-product-link__actions{display:flex;justify-content:end}#ecommreels-admin-app .ecr-admin-product-link__actions .ecr-button{text-transform:capitalize;padding:12px 32px}#ecommreels-admin-app .ecr-admin-product-link__loader{display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-product-link__spinner{width:24px;height:24px;border-radius:999px;border-bottom:2px solid #3b82f6;animation:ecr-admin-product-link-spin 1s linear infinite}@keyframes ecr-admin-product-link-spin{to{transform:rotate(360deg)}}.scrollbarThin{--sb-track: transparent;--sb-thumb: rgba(0, 0, 0, .35);--sb-thumb-hover: rgba(0, 0, 0, .5);--sb-thumb-radius: 6px;--sb-size: 8px;scrollbar-width:thin;scrollbar-color:var(--sb-thumb) var(--sb-track);-ms-overflow-style:auto}.scrollbarThin::-webkit-scrollbar{width:var(--sb-size);height:var(--sb-size)}.scrollbarThin::-webkit-scrollbar-track{background:var(--sb-track)}.scrollbarThin::-webkit-scrollbar-thumb{background-color:var(--sb-thumb);border-radius:var(--sb-thumb-radius);border:2px solid transparent;background-clip:padding-box}.scrollbarThin::-webkit-scrollbar-thumb:hover{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-thumb:active{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-corner{background:var(--sb-track)}.scrollbarThin:focus-within::-webkit-scrollbar-thumb{box-shadow:0 0 0 1px #0000000f inset}#ecommreels-admin-app .ecr-admin-link__label{display:block;text-align:left;font-size:14px;font-weight:600;text-transform:capitalize;margin-bottom:4px}#ecommreels-admin-app .ecr-admin-link__input{width:100%;border-radius:6px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app .ecr-admin-link__input--normal{border-color:#6b7280}#ecommreels-admin-app .ecr-admin-link__input--error{border-color:#ef4444}#ecommreels-admin-app .ecr-admin-link__input:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-link__error{margin:4px 0 0;text-align:left;font-size:12px;color:#ef4444}#ecommreels-admin-app .ecr-admin-link__toggle{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-link__checkbox{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-link__toggle-label{cursor:pointer;font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-link__actions{margin-top:12px;display:flex;gap:8px}#ecommreels-admin-app .ecr-admin-link__actions .ecr-button{text-transform:capitalize;width:100%}#ecommreels-admin-app .ecr-admin-links{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-links__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-links__wrapper{display:flex;flex-direction:column;gap:4px;max-height:380px;overflow-y:auto}#ecommreels-admin-app .ecr-admin-links__item{display:flex;align-items:center;justify-content:space-between;border-radius:6px;background:#eff6ff;padding:2px 8px 2px 16px}#ecommreels-admin-app .ecr-admin-links__remove{color:#ef4444}#ecommreels-admin-app .ecr-admin-links__add-more_btn{margin-top:8px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6;padding:8px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__upgrade{margin-top:12px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6b3;padding:6px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reelvideo{width:100%;border-radius:12px;display:block}#ecommreels-admin-app .ecr-admin-reelvideo--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reelvideo--landscape{width:100%}#ecommreels-admin-app .ecr-admin-customization__panel{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;cursor:grab;align-items:center;justify-content:center;overflow:hidden;border-radius:12px;background:#000;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-customization__panel:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-customization__remove{position:absolute;top:8px;left:8px;z-index:3;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__controls{position:absolute;top:8px;right:8px;z-index:5;display:flex;gap:8px;font-size:18px;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__control{cursor:pointer}#ecommreels-admin-app .ecr-admin-customization{display:flex;width:fit-content;flex-wrap:wrap;gap:16px}#ecommreels-admin-app .ecr-admin-customization__add{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:12px;border:2px dashed #d1d5db;background:#e5e7eb;padding:20px;cursor:pointer}#ecommreels-admin-app .ecr-admin-customization__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-customization__add:hover .ecr-admin-customization__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-customization__label{font-size:13px;color:#4b5563}#ecommreels-admin-app .ecr-admin-customization__lock{position:absolute;top:8px;right:8px;color:#6b7280}#ecommreels-admin-app .ecr-admin-customization__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-thumbnail{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumbnail__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-thumbnail__preview{position:relative;margin:0 auto;width:100%;aspect-ratio:9 / 16;overflow:hidden;border-radius:12px}#ecommreels-admin-app .ecr-admin-thumbnail__image{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-thumbnail__remove{position:absolute;top:8px;right:8px;z-index:3;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-thumbnail__uploader{margin:0 auto;width:100%}#ecommreels-admin-app .ecr-admin-card{margin:24px auto 0;max-width:1024px;border:1px solid #6b7280;border-radius:6px;background:#fff;padding:24px;box-shadow:0 0 8px #aaa}#ecommreels-admin-app .ecr-admin-card--settings{width:fit-content}#ecommreels-admin-app .ecr-admin-card__header{display:flex;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-card__title{margin:0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-groups{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-groups__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-groups__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-groups__create-button{border:1px solid #2563eb;background:#fff;color:#2563eb}#ecommreels-admin-app .ecr-admin-groups__create-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-groups__load-more{display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-groups__load-more__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-load-more-spin 1s linear infinite}@keyframes ecr-load-more-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-groups_action_wrapper{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-groups-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-groups-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-groups-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-groups-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-groups-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-groups-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-groups-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-docs-link{color:#2563eb;display:flex;align-items:center;text-decoration:none;gap:4px;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-docs-link:focus{box-shadow:none}#ecommreels-admin-app .ecr-admin-error{margin-top:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:6px;border:1px solid #fecaca;background:#fef2f2;padding:24px;color:#dc2626}#ecommreels-admin-app .ecr-admin-error__icon{width:28px;height:28px}#ecommreels-admin-app .ecr-admin-error__text{margin:0;text-align:center;font-weight:600}.ecr-table__container{width:100%;overflow-x:auto}.ecr-table{width:100%;border-collapse:collapse;font-size:13px}.ecr-table__header tr{border-bottom:1px solid var(--color-border, #e5e7eb)}.ecr-table__row{border-bottom:1px solid var(--color-border, #e5e7eb);transition:background-color .2s ease}.ecr-table__row:hover,.ecr-table__row[data-state=selected]{background:var(--color-muted, #f3f4f6)}.ecr-table__head,.ecr-table__cell{padding:8px;text-align:left;vertical-align:middle;white-space:nowrap}.ecr-table__head{font-weight:600;color:var(--color-foreground, #111827)}.ecr-table__footer{border-top:1px solid var(--color-border, #e5e7eb);font-weight:600;background:var(--color-muted, #f3f4f6)}.ecr-table__caption{margin-top:16px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-admin-groups__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-groups__row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-groups__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__cell--strong{font-weight:600}#ecommreels-admin-app .ecr-admin-groups__name{display:flex;align-items:center;gap:8px;font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-groups__shortcode{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-groups__shortcode-text{font-family:Courier New,monospace;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-groups__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-groups__copy-button{border:none;border-radius:4px;background:#1f2937;color:#fff;padding:4px 6px;cursor:pointer;transition:transform .15s ease}#ecommreels-admin-app .ecr-admin-groups__copy-button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-groups__copy-icon{display:block;width:12px;height:12px}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip{position:absolute;top:-8px;right:8px;transform:translate(33%,-100%) scale(0);transform-origin:bottom right;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip:after{content:"";position:absolute;bottom:-4px;left:50%;width:12px;height:12px;transform:translate(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip--visible{transform:translate(33%,-100%) scale(1)}#ecommreels-admin-app .ecr-admin-groups__actions{display:flex;align-items:center;justify-content:center;gap:6px}#ecommreels-admin-app .ecr-admin-groups__action-button{color:inherit}#ecommreels-admin-app .ecr-admin-groups__icon{width:18px;height:18px}#ecommreels-admin-app .ecr-admin-groups__icon--neutral{color:#475569}#ecommreels-admin-app .ecr-admin-groups__icon--danger{color:#f43f5e}#ecommreels-admin-app .ecr-admin-groups__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-groups__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:15px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-groups__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-groups__skeleton-table{width:100%;border-collapse:collapse}#ecommreels-admin-app .ecr-admin-groups__skeleton-head{background:#1f2937}#ecommreels-admin-app .ecr-admin-groups__skeleton-row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__skeleton-row--alt{background:#f9fafb}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell{border:1px solid #e5e7eb;padding:8px}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__skeleton-block,#ecommreels-admin-app .ecr-admin-groups__skeleton-line{border-radius:4px;background:#d1d5db;animation:ecr-groups-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-groups__skeleton-block{height:24px}#ecommreels-admin-app .ecr-admin-groups__skeleton-line{height:16px;margin:4px 0}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--tiny,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--tiny{width:32px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--small,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--small{width:96px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--medium,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--medium{width:160px}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--large,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--large{width:220px}@keyframes ecr-groups-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-form{margin-top:24px;display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-form__row{display:grid;grid-template-columns:1fr;align-items:center;gap:24px}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-form__row{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-form__label{font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-form__input{width:128px;border-radius:6px;border:1px solid #d1d5db;padding:8px;font-size:14px}#ecommreels-admin-app .ecr-admin-stats{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-stats__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-stats__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary{font-size:15px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary-skeleton{width:64px;height:24px;border-radius:6px;background:#d1d5db;animation:ecr-stats-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-stats__body{margin-top:16px}@keyframes ecr-stats-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-stats__table{margin-top:8px}#ecommreels-admin-app .ecr-admin-stats__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-stats__row{background:#fff}#ecommreels-admin-app .ecr-admin-stats__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-stats__cell{border:1px solid #e5e7eb;padding:8px;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-stats__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-stats__cell--link{word-break:break-word}#ecommreels-admin-app .ecr-admin-stats__link{color:#2563eb;text-decoration:underline}#ecommreels-admin-app .ecr-admin-stats__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-stats__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-stats__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-group-edit{margin-top:24px;padding:0 24px;display:flex;flex-direction:column;gap:16px;position:relative}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-group-edit{flex-direction:row}}#ecommreels-admin-app .ecr-admin-group-title__wrapper{position:relative}#ecommreels-admin-app .ecr-admin-group-title-customization__trigger{position:absolute;top:50%;translate:0 -50%;right:0;background-color:transparent;color:gray;padding:0 8px}#ecommreels-admin-app .ecr-admin-group-title-customization-dialog{max-width:350px}#ecommreels-admin-app .ecr-admin-nav-btn-reverse{flex-direction:row-reverse}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-nav-btn-reverse{flex-direction:row}}#ecommreels-admin-app .ecr-admin-side-toggle{background:none;border:none;padding:0;color:#6b7280;cursor:pointer}#ecommreels-admin-app .ecr-admin-side-toggle--active{color:#2563eb}.ecr-input{width:100%;min-width:0;border:1px solid transparent;border-radius:6px;background:#f3f4f6;color:inherit;padding:6.4px 12px;font-size:14px;line-height:1.4;transition:border-color .2s ease,box-shadow .2s ease,background-color .2s ease}.ecr-input:focus{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent);background:#fff}.ecr-input::placeholder{color:var(--color-muted-foreground, #9ca3af)}.ecr-input:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-range{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-range__label{font-size:13px;font-weight:600;white-space:nowrap;color:#374151;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-range__row{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-range__slider{width:112px;cursor:pointer;accent-color:#2563eb}#ecommreels-admin-app .ecr-admin-range__value{display:inline-flex;align-items:center;gap:6px}#ecommreels-admin-app .ecr-admin-range__value .ecr-input{width:80px;padding:6px 8px}#ecommreels-admin-app .ecr-admin-range__unit{font-size:12px;color:#6b7280}#ecommreels-admin-app .ecr-admin-group-title_alignment{display:flex;align-items:center;flex-wrap:wrap;gap:8px;justify-content:space-between}#ecommreels-admin-app .ecr-admin-group-title_alignment-label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-group-title_alignment-options{display:flex;align-items:center;gap:0;background-color:#dfdfdf;border-radius:8px;overflow:hidden}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button{border-radius:0;color:#3d3d3d}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button:not(:last-child){border-right:1px solid gray}#ecommreels-admin-app .ecr-admin-group-title-customization__content{display:flex;flex-direction:column;gap:16px;margin-top:40px}#ecommreels-admin-app .ecr-admin-color-selector-popover{width:auto;padding:0;z-index:9}#ecommreels-admin-app .ecr-admin-shortcode{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-shortcode__badge{border-radius:4px;background:#e5e7eb;padding:4px 8px;font-family:Courier New,monospace;font-size:14px;color:#111827;font-weight:900}#ecommreels-admin-app .ecr-admin-shortcode__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-shortcode__button{cursor:pointer;border:none;border-radius:4px;background:#1f2937;padding:4px 6px;color:#fff}#ecommreels-admin-app .ecr-admin-shortcode__button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip{position:absolute;top:50%;right:150%;transform:translateY(-50%) scale(0);transform-origin:center;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-shortcode__tooltip:after{content:"";position:absolute;top:50%;right:-4px;width:12px;height:12px;transform:translateY(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--visible{transform:translateY(-50%) scale(1)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--hidden{transform:translateY(-50%) scale(0)}#ecommreels-admin-app .ecr-admin-reelitem{display:inline-flex;flex-direction:column;width:var(--thumbnail-size, 150px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-reelitem{width:var(--thumbnail-size-mobile, 150px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-reelitem{width:var(--thumbnail-size-tab, 150px)}}#ecommreels-admin-app .ecr-admin-reelitem__frame{position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:aspect-ratio .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__actions{position:absolute;top:100%;left:0;z-index:1;display:flex;height:50%;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__frame:hover .ecr-admin-reelitem__actions{top:50%}#ecommreels-admin-app .ecr-admin-reelitem__button{background:#fff;color:#111827;padding:4px;border-radius:6px}#ecommreels-admin-app .ecr-admin-reelitem__button:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reelitem__button--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reelitem__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reelitem__spinner{animation:ecr-reelitem-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reelitem__link{display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-reelitem__link--disabled{pointer-events:none}#ecommreels-admin-app .ecr-admin-reelitem__link--active{pointer-events:auto}#ecommreels-admin-app .zoom-in,#ecommreels-admin-app .zoom-out{transition:transform .2s ease}#ecommreels-admin-app .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-reel__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes ecr-reelitem-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-product-card-one,.ecommreels-short-code .ecr-product-card-one,.reelswp-group-short-code .ecr-product-card-one,.reelswp-reel-short-code .ecr-product-card-one{display:flex;flex-direction:column;align-items:stretch;gap:16px;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:8px;padding:8px;overflow:hidden;border:1px solid #fff;flex-shrink:0;border-bottom-left-radius:max(calc(var(--thumbnail-border-radius, 0px) - 4px),8px);border-bottom-right-radius:max(calc(var(--thumbnail-border-radius, 0px) - 4px),8px);transition:all .3s ease-in-out;min-height:var(--thumbnail-border-radius);padding-inline:max(var(--thumbnail-border-radius) / 5,8px)}#ecommreels-admin-app .ecr-product-card-one-content-wrapper,.ecommreels-short-code .ecr-product-card-one-content-wrapper,.reelswp-group-short-code .ecr-product-card-one-content-wrapper,.reelswp-reel-short-code .ecr-product-card-one-content-wrapper{display:flex;align-items:center;gap:8px;flex-shrink:0}#ecommreels-admin-app .ecr-product-card-one__thumb,.ecommreels-short-code .ecr-product-card-one__thumb,.reelswp-group-short-code .ecr-product-card-one__thumb,.reelswp-reel-short-code .ecr-product-card-one__thumb{pointer-events:none;width:40px;height:40px;flex-shrink:0;border-radius:4px}#ecommreels-admin-app .ecr-product-card-one__content,.ecommreels-short-code .ecr-product-card-one__content,.reelswp-group-short-code .ecr-product-card-one__content,.reelswp-reel-short-code .ecr-product-card-one__content{flex-grow:1;display:flex;flex-direction:column;align-items:flex-start;gap:4px;overflow:hidden}#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title{max-width:100%;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:1.2;color:#fff;text-decoration:none}:is(#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title):hover{text-decoration:underline}#ecommreels-admin-app .ecr-product-card-one__meta,.ecommreels-short-code .ecr-product-card-one__meta,.reelswp-group-short-code .ecr-product-card-one__meta,.reelswp-reel-short-code .ecr-product-card-one__meta{display:flex;flex-wrap:wrap;column-gap:8px;row-gap:4px}#ecommreels-admin-app .ecr-product-card-one__rating,.ecommreels-short-code .ecr-product-card-one__rating,.reelswp-group-short-code .ecr-product-card-one__rating,.reelswp-reel-short-code .ecr-product-card-one__rating{margin-left:4px;display:flex;align-items:center;gap:4px;font-size:12px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__star,.ecommreels-short-code .ecr-product-card-one__star,.reelswp-group-short-code .ecr-product-card-one__star,.reelswp-reel-short-code .ecr-product-card-one__star{width:16px;height:16px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price,.ecommreels-short-code .ecr-product-card-one__price,.reelswp-group-short-code .ecr-product-card-one__price,.reelswp-reel-short-code .ecr-product-card-one__price{display:flex;align-items:center;gap:.25ch;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price *,.ecommreels-short-code .ecr-product-card-one__price *,.reelswp-group-short-code .ecr-product-card-one__price *,.reelswp-reel-short-code .ecr-product-card-one__price *{line-height:1;background-color:transparent;color:#fff;font-size:12px}#ecommreels-admin-app .ecr-product-card-one__price span.woocommerce-Price-amount,.ecommreels-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-group-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-reel-short-code .ecr-product-card-one__price span.woocommerce-Price-amount{line-height:normal}#ecommreels-admin-app .ecr-product-card-one__price ins,.ecommreels-short-code .ecr-product-card-one__price ins,.reelswp-group-short-code .ecr-product-card-one__price ins,.reelswp-reel-short-code .ecr-product-card-one__price ins{text-decoration:none}#ecommreels-admin-app .ecr-thumb__link-wrapper,.ecommreels-short-code .ecr-thumb__link-wrapper,.reelswp-group-short-code .ecr-thumb__link-wrapper,.reelswp-reel-short-code .ecr-thumb__link-wrapper{display:flex;flex-direction:column;gap:4px;flex-shrink:0}#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link{display:grid;place-items:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-radius:8px;background-color:transparent;position:relative;min-height:max(var(--thumbnail-border-radius, 48px),48px);text-align:center;font-size:16px;font-weight:600;color:#fff;text-decoration:none;border:1px solid #fff;border-bottom-left-radius:max(var(--thumbnail-border-radius, 8px),8px);border-bottom-right-radius:max(var(--thumbnail-border-radius, 8px),8px);transition:all .3s ease-in-out;isolation:isolate}:is(#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link):hover{text-decoration:underline}:is(#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link):before{content:"";position:absolute;inset:0;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:8px;border-bottom-left-radius:max(var(--thumbnail-border-radius, 8px),8px);border-bottom-right-radius:max(var(--thumbnail-border-radius, 8px),8px);overflow:hidden;z-index:-1;transition:all .3s ease-in-out}#ecommreels-admin-app .ecr-admin-reelitem-links,.ecommreels-short-code .ecr-admin-reelitem-links,.reelswp-group-short-code .ecr-admin-reelitem-links,.reelswp-reel-short-code .ecr-admin-reelitem-links{display:flex;align-items:center;gap:8px;overflow:hidden;margin-top:8px;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-reelitem-links[data-dragging=true] *,.ecommreels-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-group-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-reel-short-code .ecr-admin-reelitem-links[data-dragging=true] *{pointer-events:none}#ecommreels-admin-app .ecr-reel_title,.ecommreels-short-code .ecr-reel_title,.reelswp-group-short-code .ecr-reel_title,.reelswp-reel-short-code .ecr-reel_title{position:absolute;left:50%;transform:translate(-50%);bottom:8px;text-transform:capitalize;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);padding:4px 8px;color:#fff;width:95%;border-radius:8px;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-editor-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-editor-carousel__track{display:flex;width:max-content;flex-wrap:nowrap;padding:16px 0;gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-editor-carousel__track{gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-editor-carousel__track{gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-admin-editor-carousel__track--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-carousel__empty{display:flex;width:100%;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-editor-carousel__nav{position:absolute;top:50%;z-index:2;transform:translateY(-50%);border:none;background:#fff;padding:6px 8px;color:#374151;cursor:pointer;width:32px;height:40px;transition:background-color .2s ease;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--left{left:0;border-radius:0 999px 999px 0}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--right{right:0;border-radius:999px 0 0 999px}#ecommreels-admin-app .ecr-admin-editor-grid{display:flex;flex-wrap:wrap;row-gap:16px;column-gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-editor-grid{column-gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-editor-grid{column-gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-admin-editor-grid--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-grid__empty{display:flex;width:100%;justify-content:center;padding-top:160px}#ecommreels-admin-app .ecr-admin-editor-grid__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-grid__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-existing{width:100%;flex:1;overflow:hidden;border-radius:8px;border:1px solid #e5e7eb;background:#fff}#ecommreels-admin-app .ecr-admin-existing__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-existing__title-wrapper{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-existing__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-existing__body{max-height:800px;overflow-y:auto;padding:8px 16px 16px}#ecommreels-admin-app .ecr-preview-player{background-color:#000000b3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);display:grid;place-items:center;padding:24px;width:100%;min-height:320px;border-radius:4px}#ecommreels-admin-app .ecr-preview-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-preview-player .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:min(70vh,560px);max-width:90vw;overflow:hidden;border-radius:24px}#ecommreels-admin-app .ecr-preview-player__media{width:100%;height:100%}#ecommreels-admin-app .ecr-preview-player__media-item{width:100%;object-fit:cover;display:block}#ecommreels-admin-app .ecr-preview-player__nav--disabled{opacity:.4;cursor:not-allowed}#ecommreels-admin-app .ecr-player__close{position:absolute;top:8px;right:8px;z-index:5;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1;background:transparent;border:none}#ecommreels-admin-app .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:5;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecr-preview-player__empty{display:grid;place-items:center;color:#fff;font-size:14px;height:100%;width:100%}#ecommreels-admin-app .ecr-admin-reellist{display:flex;flex-direction:column;min-height:100%;width:100%;flex-shrink:0;overflow-y:auto;border-radius:8px;border:1px solid #e5e7eb;background:#fff;box-shadow:0 1px 2px #0000000d}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-reellist{width:280px}}#ecommreels-admin-app .ecr-admin-reellist__header{border-bottom:1px solid #e5e7eb;padding:16px 16px 8px;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-reellist__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-reellist__body{margin-top:8px;display:flex;flex-direction:column;gap:12px;padding:0 16px 16px}#ecommreels-admin-app .ecr-admin-reellist__add-button{width:100%;flex-shrink:0;margin-inline-start:0;border:1px solid #2563eb;background:#fff}#ecommreels-admin-app .ecr-admin-reellist__add-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reellist__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-reellist__search-input:focus{outline:none;border-color:#93c5fd;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-reellist__grid{margin-top:16px;max-height:60vh;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-reellist__items{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}@media(min-width:767px)and (max-width:1199px){#ecommreels-admin-app .ecr-admin-reellist__items{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-reellist__items{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-reellist__empty{grid-column:1 / -1;padding:24px 0;text-align:center;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-reellist__item{width:100%}#ecommreels-admin-app .ecr-admin-reellist__card{position:relative;width:100%;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease;padding:0}#ecommreels-admin-app .ecr-admin-reellist__card:hover{border-color:#3b82f6}#ecommreels-admin-app .ecr-admin-reellist__media{aspect-ratio:9 / 16;width:100%}#ecommreels-admin-app .ecr-admin-reellist__thumb{pointer-events:none;display:block;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reellist__label{position:absolute;bottom:0;left:0;width:100%;padding:4px;background:linear-gradient(0deg,#fff 20%,#fff0);font-size:13px;font-weight:600;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-reellist__overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#ffffffbf}#ecommreels-admin-app .ecr-admin-reellist__overlay-icon{width:24px;height:24px;color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reellist__loader{grid-column:1 / -1;display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-reellist__spinner{width:24px;height:24px;border-radius:999px;border:2px solid #cbd5e1;border-top-color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}@keyframes ecr-reellist-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-tabs{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-tabs__list{display:inline-flex;align-items:center;background:var(--color-muted, #f3f4f6);border-radius:10px;padding:3px;width:fit-content}#ecommreels-admin-app .ecr-tabs__trigger{border:1px solid transparent;border-radius:8px;padding:8px;font-size:13px;font-weight:600;color:var(--color-muted-foreground, #6b7280);background:transparent;transition:background-color .2s ease,color .2s ease,border-color .2s ease}#ecommreels-admin-app .ecr-tabs__trigger[data-state=active]{background:#fff;color:var(--color-foreground, #111827);border-color:var(--color-border, #e5e7eb);box-shadow:0 1px 2px #0000000f}#ecommreels-admin-app .ecr-tabs__content{outline:none}#ecommreels-admin-app .ecr-admin-sidepanel{position:relative;display:flex;flex-direction:column;min-height:100%;max-height:100%;flex-shrink:0;overflow:hidden;border-radius:8px;transition:width .2s ease}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:100%;max-height:100%;position:absolute;right:16px;top:0}#ecommreels-admin-app .ecr-admin-mobile-overlay{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#0f172abf;z-index:5}#ecommreels-admin-app .ecr-admin-sidepanel-content{width:280px;background:#fff;margin-left:auto;border:2px solid #e5e7eb;height:100vh;position:fixed;top:0;right:0}@media(max-width:1024px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-sidepanel-content{padding-top:32px}}@media(max-width:1200px){#ecommreels-admin-app .ecr-admin-sidepanel-content{z-index:999}}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-sidepanel--expanded{position:static}#ecommreels-admin-app .ecr-admin-mobile-overlay{display:none}#ecommreels-admin-app .ecr-admin-sidepanel-content{position:static;width:280px;background:#fff;margin-left:0;border:2px solid #e5e7eb;height:100%;border-radius:8px}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:fit-content}}#ecommreels-admin-app .ecr-admin-sidepanel--collapsed{width:0;border:0;pointer-events:none}#ecommreels-admin-app .ecr-admin-sidepanel__header{position:relative;display:flex;flex-direction:column;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-sidepanel__title{margin:0;font-size:15px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-sidepanel__body{height:100%;overflow-x:hidden;padding:8px 16px 16px}#ecommreels-admin-app .ecr-admin-sidepanel__tabs,#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{width:100%}#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{display:grid;grid-template-columns:1fr 1fr}#ecommreels-admin-app .ecr-admin-sidepanel__lock-trigger{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;font-size:13px;color:#6b7280;text-transform:capitalize;padding:8px}#ecommreels-admin-app .ecr-admin-sidepanel__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-switch{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:14px;font-weight:500;color:#6b7280}#ecommreels-admin-app .ecr-admin-switch__label{display:inline-flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-switch__icon{color:#6b7280}#ecommreels-admin-app .ecr-admin-popover{background:#eff6ff}#ecommreels-admin-app .ecr-select__trigger{display:inline-flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid var(--color-border, #d1d5db);border-radius:6px;padding:7.2px 12px;font-size:13px;background:#fff;color:var(--color-foreground, #111827);min-width:fit-content}#ecommreels-admin-app .ecr-select__trigger[data-size=sm]{height:32px}#ecommreels-admin-app .ecr-select__trigger[data-size=default]{height:36px}#ecommreels-admin-app .ecr-select__trigger:focus-visible{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent)}#ecommreels-admin-app .ecr-select__icon{width:16px;height:16px;opacity:.6}#ecommreels-admin-app .ecr-select__content{background:#fff;color:var(--color-foreground, #111827);border:1px solid var(--color-border, #d1d5db);border-radius:8px;box-shadow:0 10px 30px #00000026;overflow:hidden;min-width:140px;z-index:999}#ecommreels-admin-app .ecr-select__content[data-side=bottom]{animation:ecr-fade-down .15s ease-out}#ecommreels-admin-app .ecr-select__content[data-side=top]{animation:ecr-fade-up .15s ease-out}#ecommreels-admin-app .ecr-select__viewport{padding:5.6px}#ecommreels-admin-app .ecr-select__item{display:flex;align-items:center;gap:8px;border-radius:6px;padding:8px;font-size:13px;cursor:pointer;text-transform:capitalize}#ecommreels-admin-app .ecr-select__item[data-highlighted]{background:var(--color-accent, #f3f4f6)}#ecommreels-admin-app .ecr-select__item[data-disabled]{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-select__label{padding:5.6px 8px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-select__separator{height:1px;margin:4px 0;background:var(--color-border, #e5e7eb)}#ecommreels-admin-app .ecr-select__check{position:absolute;right:8px;width:14px;height:14px;display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-select__check-icon{width:14px;height:14px}#ecommreels-admin-app .ecr-select__scroll-button{display:flex;align-items:center;justify-content:center;padding:4px 0;cursor:default}@keyframes ecr-fade-down{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}@keyframes ecr-fade-up{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}#ecommreels-admin-app .ecr-admin-thumb-controls{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section{border:1px solid var(--color-border, #e5e7eb);border-radius:10px;padding:12px;background:#fff;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumb-controls__section-trigger{align-items:center;background:transparent;border:none;color:var(--color-foreground, #111827);cursor:pointer;display:flex;font-size:13px;font-weight:600;justify-content:space-between;padding:0;text-align:left}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content[data-state=open]{margin-top:12px;padding-top:12px;border-top:1px solid #e5e7eb}#ecommreels-admin-app .ecr-collapsible__trigger{align-items:center;display:inline-flex;gap:8px;justify-content:space-between;width:100%}#ecommreels-admin-app .ecr-collapsible__trigger-label{align-items:center;display:inline-flex;gap:4px}#ecommreels-admin-app .ecr-collapsible__trigger-icon{height:16px;width:16px;transition:transform .2s ease}#ecommreels-admin-app .ecr-collapsible__trigger[data-state=open] .ecr-collapsible__trigger-icon{transform:rotate(180deg)}#ecommreels-admin-app .ecr-admin-control{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-control--row,#ecommreels-admin-app .ecr-admin-control--inline{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px}#ecommreels-admin-app .ecr-admin-control__label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-control__row{display:flex;align-items:center;gap:12px}#ecommreels-admin-app .ecr-admin-control__row--color{position:relative}#ecommreels-admin-app .ecr-admin-control__choice{display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__choice-label{cursor:pointer;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__trigger,#ecommreels-admin-app .ecr-admin-control__option{text-transform:capitalize}.ecr-admin-control__lock-trigger{display:flex;width:100%;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;font-size:13px;color:#6b7280;cursor:pointer;border:none}.ecr-admin-control__lock-trigger:hover{background:#f3f4f6}.ecr-admin-control__popover{background:#eff6ff}.ecr-admin-control__swatch{width:24px;height:24px;cursor:pointer;border-radius:4px;border:2px solid #6b7280}#ecommreels-admin-app .ecr-admin-control__picker{position:absolute;top:100%;left:0;z-index:9;box-shadow:0 8px 16px #0000001f;outline:none}#ecommreels-admin-app .ecr-admin-control__hex{width:80px;border-radius:4px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{--reels-wp-animation-time: 3s;--reels-wp-marquee-time: 20s}#ecommreels-admin-app .ecr-player__loader,.ecommreels-short-code .ecr-player__loader,.reelswp-group-short-code .ecr-player__loader,.reelswp-reel-short-code .ecr-player__loader{height:90vh;max-width:100vw;aspect-ratio:9 / 16;border-radius:16px;border:1px solid #e5e7eb;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-loader,.ecommreels-short-code .ecr-loader,.reelswp-group-short-code .ecr-loader,.reelswp-reel-short-code .ecr-loader{width:100%;height:100%;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px}#ecommreels-admin-app .ecr-loader__ball,.ecommreels-short-code .ecr-loader__ball,.reelswp-group-short-code .ecr-loader__ball,.reelswp-reel-short-code .ecr-loader__ball{width:20px;height:20px;border-radius:50%;background:#919191;animation:ecr-bounce 1s alternate infinite}#ecommreels-admin-app .ecr-loader__ball:nth-child(2),.ecommreels-short-code .ecr-loader__ball:nth-child(2),.reelswp-group-short-code .ecr-loader__ball:nth-child(2),.reelswp-reel-short-code .ecr-loader__ball:nth-child(2){animation-delay:.25s}#ecommreels-admin-app .ecr-loader__ball:nth-child(3),.ecommreels-short-code .ecr-loader__ball:nth-child(3),.reelswp-group-short-code .ecr-loader__ball:nth-child(3),.reelswp-reel-short-code .ecr-loader__ball:nth-child(3){animation-delay:.5s}@keyframes ecr-bounce{0%{transform:scale(2)}to{transform:scale(1)}}#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{display:block;width:var(--thumbnail-size, 150px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{width:var(--thumbnail-size-mobile, 150px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{width:var(--thumbnail-size-tab, 150px)}}#ecommreels-admin-app .ecr-thumb__frame,.ecommreels-short-code .ecr-thumb__frame,.reelswp-group-short-code .ecr-thumb__frame,.reelswp-reel-short-code .ecr-thumb__frame{overflow:hidden;width:100%;position:relative}#ecommreels-admin-app .zoom-in,.ecommreels-short-code .zoom-in,.reelswp-group-short-code .zoom-in,.reelswp-reel-short-code .zoom-in,#ecommreels-admin-app .zoom-out,.ecommreels-short-code .zoom-out,.reelswp-group-short-code .zoom-out,.reelswp-reel-short-code .zoom-out{transition:transform .2s ease-in-out}#ecommreels-admin-app .zoom-in:hover,.ecommreels-short-code .zoom-in:hover,.reelswp-group-short-code .zoom-in:hover,.reelswp-reel-short-code .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover,.ecommreels-short-code .zoom-out:hover,.reelswp-group-short-code .zoom-out:hover,.reelswp-reel-short-code .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-reel__title,.ecommreels-short-code .ecr-reel__title,.reelswp-group-short-code .ecr-reel__title,.reelswp-reel-short-code .ecr-reel__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-front-carousel,.ecommreels-short-code .ecr-front-carousel,.reelswp-group-short-code .ecr-front-carousel,.reelswp-reel-short-code .ecr-front-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-front-carousel__viewport,.ecommreels-short-code .ecr-front-carousel__viewport,.reelswp-group-short-code .ecr-front-carousel__viewport,.reelswp-reel-short-code .ecr-front-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{display:flex;flex-wrap:nowrap;width:max-content;gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-front-carousel__track--zoom,.ecommreels-short-code .ecr-front-carousel__track--zoom,.reelswp-group-short-code .ecr-front-carousel__track--zoom,.reelswp-reel-short-code .ecr-front-carousel__track--zoom{padding:16px}#ecommreels-admin-app .ecr-front-carousel__nav,.ecommreels-short-code .ecr-front-carousel__nav,.reelswp-group-short-code .ecr-front-carousel__nav,.reelswp-reel-short-code .ecr-front-carousel__nav{position:absolute;top:50%;z-index:1;transform:translateY(-50%);border:none;background:#fff;color:#1f2937;cursor:pointer;width:32px;height:40px;padding:0;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-front-carousel__nav--left,.ecommreels-short-code .ecr-front-carousel__nav--left,.reelswp-group-short-code .ecr-front-carousel__nav--left,.reelswp-reel-short-code .ecr-front-carousel__nav--left{left:0;border-top-right-radius:999px;border-bottom-right-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav--right,.ecommreels-short-code .ecr-front-carousel__nav--right,.reelswp-group-short-code .ecr-front-carousel__nav--right,.reelswp-reel-short-code .ecr-front-carousel__nav--right{right:0;border-top-left-radius:999px;border-bottom-left-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav:hover,.ecommreels-short-code .ecr-front-carousel__nav:hover,.reelswp-group-short-code .ecr-front-carousel__nav:hover,.reelswp-reel-short-code .ecr-front-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-front-grid,.ecommreels-short-code .ecr-front-grid,.reelswp-group-short-code .ecr-front-grid,.reelswp-reel-short-code .ecr-front-grid{cursor:default;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid, 150px),1fr));row-gap:16px;column-gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{column-gap:var(--thumbnail-gap-mobile, 16px);grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid-mobile, 150px),1fr))}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{column-gap:var(--thumbnail-gap-tab, 16px);grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid-tab, 150px),1fr))}}
     2/*$vite$:1*/`,document.head.appendChild(ya);function wa(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const x=wa(y),_r=wa(va);function Cd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var In={exports:{}},Kt={};/**
    33 * @license React
    44 * react-jsx-runtime.production.min.js
     
    88 * This source code is licensed under the MIT license found in the
    99 * LICENSE file in the root directory of this source tree.
    10  */var ja;function kd(){if(ja)return qt;ja=1;var e=y,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(l,d,c){var u,p={},m=null,g=null;c!==void 0&&(m=""+c),d.key!==void 0&&(m=""+d.key),d.ref!==void 0&&(g=d.ref);for(u in d)n.call(d,u)&&!i.hasOwnProperty(u)&&(p[u]=d[u]);if(l&&l.defaultProps)for(u in d=l.defaultProps,d)p[u]===void 0&&(p[u]=d[u]);return{$$typeof:t,type:l,key:m,ref:g,props:p,_owner:o.current}}return qt.Fragment=r,qt.jsx=s,qt.jsxs=s,qt}var Sa;function Nd(){return Sa||(Sa=1,In.exports=kd()),In.exports}var a=Nd();/**
     10 */var ja;function kd(){if(ja)return Kt;ja=1;var e=y,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(l,c,d){var u,p={},m=null,g=null;d!==void 0&&(m=""+d),c.key!==void 0&&(m=""+c.key),c.ref!==void 0&&(g=c.ref);for(u in c)n.call(c,u)&&!i.hasOwnProperty(u)&&(p[u]=c[u]);if(l&&l.defaultProps)for(u in c=l.defaultProps,c)p[u]===void 0&&(p[u]=c[u]);return{$$typeof:t,type:l,key:m,ref:g,props:p,_owner:o.current}}return Kt.Fragment=r,Kt.jsx=s,Kt.jsxs=s,Kt}var Sa;function Nd(){return Sa||(Sa=1,In.exports=kd()),In.exports}var a=Nd();/**
    1111 * @remix-run/router v1.23.2
    1212 *
     
    1717 *
    1818 * @license MIT
    19  */function Gt(){return Gt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gt.apply(this,arguments)}var et;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(et||(et={}));const Ca="popstate";function Ed(e){e===void 0&&(e={});function t(o,i){let{pathname:s="/",search:l="",hash:d=""}=Kt(o.location.hash.substr(1));return!s.startsWith("/")&&!s.startsWith(".")&&(s="/"+s),zn("",{pathname:s,search:l,hash:d},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(o,i){let s=o.document.querySelector("base"),l="";if(s&&s.getAttribute("href")){let d=o.location.href,c=d.indexOf("#");l=c===-1?d:d.slice(0,c)}return l+"#"+(typeof i=="string"?i:_r(i))}function n(o,i){ka(o.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(i)+")")}return Ad(t,r,n,e)}function ye(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ka(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Td(){return Math.random().toString(36).substr(2,8)}function Na(e,t){return{usr:e.state,key:e.key,idx:t}}function zn(e,t,r,n){return r===void 0&&(r=null),Gt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Kt(t):t,{state:r,key:t&&t.key||n||Td()})}function _r(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Kt(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Ad(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:i=!1}=n,s=o.history,l=et.Pop,d=null,c=u();c==null&&(c=0,s.replaceState(Gt({},s.state,{idx:c}),""));function u(){return(s.state||{idx:null}).idx}function p(){l=et.Pop;let h=u(),v=h==null?null:h-c;c=h,d&&d({action:l,location:f.location,delta:v})}function m(h,v){l=et.Push;let _=zn(f.location,h,v);r&&r(_,h),c=u()+1;let w=Na(_,c),j=f.createHref(_);try{s.pushState(w,"",j)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(j)}i&&d&&d({action:l,location:f.location,delta:1})}function g(h,v){l=et.Replace;let _=zn(f.location,h,v);r&&r(_,h),c=u();let w=Na(_,c),j=f.createHref(_);s.replaceState(w,"",j),i&&d&&d({action:l,location:f.location,delta:0})}function b(h){let v=o.location.origin!=="null"?o.location.origin:o.location.href,_=typeof h=="string"?h:_r(h);return _=_.replace(/ $/,"%20"),ye(v,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,v)}let f={get action(){return l},get location(){return e(o,s)},listen(h){if(d)throw new Error("A history only accepts one active listener");return o.addEventListener(Ca,p),d=h,()=>{o.removeEventListener(Ca,p),d=null}},createHref(h){return t(o,h)},createURL:b,encodeLocation(h){let v=b(h);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:m,replace:g,go(h){return s.go(h)}};return f}var Ea;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ea||(Ea={}));function Ta(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const Pd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Od=e=>Pd.test(e);function Rd(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Kt(e):e,i;if(r)if(Od(r))i=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),ka(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+r))}r.startsWith("/")?i=Aa(r.substring(1),"/"):i=Aa(r,t)}else i=t;return{pathname:i,search:Id(n),hash:zd(o)}}function Aa(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Mn(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Ld(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Pa(e,t){let r=Ld(e);return t?r.map((n,o)=>o===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Oa(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Kt(e):(o=Gt({},e),ye(!o.pathname||!o.pathname.includes("?"),Mn("?","pathname","search",o)),ye(!o.pathname||!o.pathname.includes("#"),Mn("#","pathname","hash",o)),ye(!o.search||!o.search.includes("#"),Mn("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,l;if(s==null)l=r;else{let p=t.length-1;if(!n&&s.startsWith("..")){let m=s.split("/");for(;m[0]==="..";)m.shift(),p-=1;o.pathname=m.join("/")}l=p>=0?t[p]:"/"}let d=Rd(o,l),c=s&&s!=="/"&&s.endsWith("/"),u=(i||s===".")&&r.endsWith("/");return!d.pathname.endsWith("/")&&(c||u)&&(d.pathname+="/"),d}const Ra=e=>e.join("/").replace(/\/\/+/g,"/"),Id=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,zd=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,La=["post","put","patch","delete"];new Set(La);const Md=["get",...La];new Set(Md);/**
     19 */function Yt(){return Yt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yt.apply(this,arguments)}var et;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(et||(et={}));const Ca="popstate";function Ed(e){e===void 0&&(e={});function t(o,i){let{pathname:s="/",search:l="",hash:c=""}=Xt(o.location.hash.substr(1));return!s.startsWith("/")&&!s.startsWith(".")&&(s="/"+s),zn("",{pathname:s,search:l,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(o,i){let s=o.document.querySelector("base"),l="";if(s&&s.getAttribute("href")){let c=o.location.href,d=c.indexOf("#");l=d===-1?c:c.slice(0,d)}return l+"#"+(typeof i=="string"?i:vr(i))}function n(o,i){ka(o.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(i)+")")}return Ad(t,r,n,e)}function ye(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ka(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Td(){return Math.random().toString(36).substr(2,8)}function Na(e,t){return{usr:e.state,key:e.key,idx:t}}function zn(e,t,r,n){return r===void 0&&(r=null),Yt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Xt(t):t,{state:r,key:t&&t.key||n||Td()})}function vr(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Xt(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Ad(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:i=!1}=n,s=o.history,l=et.Pop,c=null,d=u();d==null&&(d=0,s.replaceState(Yt({},s.state,{idx:d}),""));function u(){return(s.state||{idx:null}).idx}function p(){l=et.Pop;let h=u(),_=h==null?null:h-d;d=h,c&&c({action:l,location:f.location,delta:_})}function m(h,_){l=et.Push;let v=zn(f.location,h,_);r&&r(v,h),d=u()+1;let w=Na(v,d),j=f.createHref(v);try{s.pushState(w,"",j)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(j)}i&&c&&c({action:l,location:f.location,delta:1})}function g(h,_){l=et.Replace;let v=zn(f.location,h,_);r&&r(v,h),d=u();let w=Na(v,d),j=f.createHref(v);s.replaceState(w,"",j),i&&c&&c({action:l,location:f.location,delta:0})}function b(h){let _=o.location.origin!=="null"?o.location.origin:o.location.href,v=typeof h=="string"?h:vr(h);return v=v.replace(/ $/,"%20"),ye(_,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,_)}let f={get action(){return l},get location(){return e(o,s)},listen(h){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(Ca,p),c=h,()=>{o.removeEventListener(Ca,p),c=null}},createHref(h){return t(o,h)},createURL:b,encodeLocation(h){let _=b(h);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:m,replace:g,go(h){return s.go(h)}};return f}var Ea;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ea||(Ea={}));function Ta(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const Pd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Od=e=>Pd.test(e);function Rd(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Xt(e):e,i;if(r)if(Od(r))i=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),ka(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+r))}r.startsWith("/")?i=Aa(r.substring(1),"/"):i=Aa(r,t)}else i=t;return{pathname:i,search:Id(n),hash:zd(o)}}function Aa(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Mn(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Ld(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Pa(e,t){let r=Ld(e);return t?r.map((n,o)=>o===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Oa(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Xt(e):(o=Yt({},e),ye(!o.pathname||!o.pathname.includes("?"),Mn("?","pathname","search",o)),ye(!o.pathname||!o.pathname.includes("#"),Mn("#","pathname","hash",o)),ye(!o.search||!o.search.includes("#"),Mn("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,l;if(s==null)l=r;else{let p=t.length-1;if(!n&&s.startsWith("..")){let m=s.split("/");for(;m[0]==="..";)m.shift(),p-=1;o.pathname=m.join("/")}l=p>=0?t[p]:"/"}let c=Rd(o,l),d=s&&s!=="/"&&s.endsWith("/"),u=(i||s===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const Ra=e=>e.join("/").replace(/\/\/+/g,"/"),Id=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,zd=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,La=["post","put","patch","delete"];new Set(La);const Md=["get",...La];new Set(Md);/**
    2020 * React Router v6.30.3
    2121 *
     
    2626 *
    2727 * @license MIT
    28  */function yr(){return yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yr.apply(this,arguments)}const Ia=x.createContext(null),ft=x.createContext(null),Dn=x.createContext(null),wr=x.createContext({outlet:null,matches:[],isDataRoute:!1});function Dd(e,t){let{relative:r}=t===void 0?{}:t;jr()||ye(!1);let{basename:n,navigator:o}=x.useContext(ft),{hash:i,pathname:s,search:l}=Ma(e,{relative:r}),d=s;return n!=="/"&&(d=s==="/"?n:Ra([n,s])),o.createHref({pathname:d,search:l,hash:i})}function jr(){return x.useContext(Dn)!=null}function Sr(){return jr()||ye(!1),x.useContext(Dn).location}function za(e){x.useContext(ft).static||x.useLayoutEffect(e)}function Ne(){let{isDataRoute:e}=x.useContext(wr);return e?Hd():Fd()}function Fd(){jr()||ye(!1);let e=x.useContext(Ia),{basename:t,future:r,navigator:n}=x.useContext(ft),{matches:o}=x.useContext(wr),{pathname:i}=Sr(),s=JSON.stringify(Pa(o,r.v7_relativeSplatPath)),l=x.useRef(!1);return za(()=>{l.current=!0}),x.useCallback(function(c,u){if(u===void 0&&(u={}),!l.current)return;if(typeof c=="number"){n.go(c);return}let p=Oa(c,JSON.parse(s),i,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Ra([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,s,i,e])}function Ma(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=x.useContext(ft),{matches:o}=x.useContext(wr),{pathname:i}=Sr(),s=JSON.stringify(Pa(o,n.v7_relativeSplatPath));return x.useMemo(()=>Oa(e,JSON.parse(s),i,r==="path"),[e,s,i,r])}var Da=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Da||{}),Fa=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(Fa||{});function $d(e){let t=x.useContext(Ia);return t||ye(!1),t}function Bd(e){let t=x.useContext(wr);return t||ye(!1),t}function Ud(e){let t=Bd(),r=t.matches[t.matches.length-1];return r.route.id||ye(!1),r.route.id}function Hd(){let{router:e}=$d(Da.UseNavigateStable),t=Ud(Fa.UseNavigateStable),r=x.useRef(!1);return za(()=>{r.current=!0}),x.useCallback(function(o,i){i===void 0&&(i={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,yr({fromRouteId:t},i)))},[e,t])}function Vd(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function Wd(e){let{basename:t="/",children:r=null,location:n,navigationType:o=et.Pop,navigator:i,static:s=!1,future:l}=e;jr()&&ye(!1);let d=t.replace(/^\/*/,"/"),c=x.useMemo(()=>({basename:d,navigator:i,static:s,future:yr({v7_relativeSplatPath:!1},l)}),[d,l,i,s]);typeof n=="string"&&(n=Kt(n));let{pathname:u="/",search:p="",hash:m="",state:g=null,key:b="default"}=n,f=x.useMemo(()=>{let h=Ta(u,d);return h==null?null:{location:{pathname:h,search:p,hash:m,state:g,key:b},navigationType:o}},[d,u,p,m,g,b,o]);return f==null?null:x.createElement(ft.Provider,{value:c},x.createElement(Dn.Provider,{children:r,value:f}))}new Promise(()=>{});/**
     28 */function yr(){return yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yr.apply(this,arguments)}const Ia=x.createContext(null),xt=x.createContext(null),Dn=x.createContext(null),wr=x.createContext({outlet:null,matches:[],isDataRoute:!1});function Dd(e,t){let{relative:r}=t===void 0?{}:t;jr()||ye(!1);let{basename:n,navigator:o}=x.useContext(xt),{hash:i,pathname:s,search:l}=Ma(e,{relative:r}),c=s;return n!=="/"&&(c=s==="/"?n:Ra([n,s])),o.createHref({pathname:c,search:l,hash:i})}function jr(){return x.useContext(Dn)!=null}function Sr(){return jr()||ye(!1),x.useContext(Dn).location}function za(e){x.useContext(xt).static||x.useLayoutEffect(e)}function Ne(){let{isDataRoute:e}=x.useContext(wr);return e?Hd():Fd()}function Fd(){jr()||ye(!1);let e=x.useContext(Ia),{basename:t,future:r,navigator:n}=x.useContext(xt),{matches:o}=x.useContext(wr),{pathname:i}=Sr(),s=JSON.stringify(Pa(o,r.v7_relativeSplatPath)),l=x.useRef(!1);return za(()=>{l.current=!0}),x.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let p=Oa(d,JSON.parse(s),i,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Ra([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,s,i,e])}function Ma(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=x.useContext(xt),{matches:o}=x.useContext(wr),{pathname:i}=Sr(),s=JSON.stringify(Pa(o,n.v7_relativeSplatPath));return x.useMemo(()=>Oa(e,JSON.parse(s),i,r==="path"),[e,s,i,r])}var Da=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Da||{}),Fa=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(Fa||{});function $d(e){let t=x.useContext(Ia);return t||ye(!1),t}function Bd(e){let t=x.useContext(wr);return t||ye(!1),t}function Ud(e){let t=Bd(),r=t.matches[t.matches.length-1];return r.route.id||ye(!1),r.route.id}function Hd(){let{router:e}=$d(Da.UseNavigateStable),t=Ud(Fa.UseNavigateStable),r=x.useRef(!1);return za(()=>{r.current=!0}),x.useCallback(function(o,i){i===void 0&&(i={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,yr({fromRouteId:t},i)))},[e,t])}function Vd(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function Wd(e){let{basename:t="/",children:r=null,location:n,navigationType:o=et.Pop,navigator:i,static:s=!1,future:l}=e;jr()&&ye(!1);let c=t.replace(/^\/*/,"/"),d=x.useMemo(()=>({basename:c,navigator:i,static:s,future:yr({v7_relativeSplatPath:!1},l)}),[c,l,i,s]);typeof n=="string"&&(n=Xt(n));let{pathname:u="/",search:p="",hash:m="",state:g=null,key:b="default"}=n,f=x.useMemo(()=>{let h=Ta(u,c);return h==null?null:{location:{pathname:h,search:p,hash:m,state:g,key:b},navigationType:o}},[c,u,p,m,g,b,o]);return f==null?null:x.createElement(xt.Provider,{value:d},x.createElement(Dn.Provider,{children:r,value:f}))}new Promise(()=>{});/**
    2929 * React Router DOM v6.30.3
    3030 *
     
    3535 *
    3636 * @license MIT
    37  */function Fn(){return Fn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fn.apply(this,arguments)}function qd(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i<n.length;i++)o=n[i],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function Gd(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Kd(e,t){return e.button===0&&(!t||t==="_self")&&!Gd(e)}function $n(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}function Yd(e,t){let r=$n(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(i=>{r.append(o,i)})}),r}const Xd=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Jd="6";try{window.__reactRouterVersion=Jd}catch{}const $a=x["startTransition"];function Zd(e){let{basename:t,children:r,future:n,window:o}=e,i=x.useRef();i.current==null&&(i.current=Ed({window:o,v5Compat:!0}));let s=i.current,[l,d]=x.useState({action:s.action,location:s.location}),{v7_startTransition:c}=n||{},u=x.useCallback(p=>{c&&$a?$a(()=>d(p)):d(p)},[d,c]);return x.useLayoutEffect(()=>s.listen(u),[s,u]),x.useEffect(()=>Vd(n),[n]),x.createElement(Wd,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}const Qd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",eu=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ht=x.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:i,replace:s,state:l,target:d,to:c,preventScrollReset:u,viewTransition:p}=t,m=qd(t,Xd),{basename:g}=x.useContext(ft),b,f=!1;if(typeof c=="string"&&eu.test(c)&&(b=c,Qd))try{let w=new URL(window.location.href),j=c.startsWith("//")?new URL(w.protocol+c):new URL(c),C=Ta(j.pathname,g);j.origin===w.origin&&C!=null?c=C+j.search+j.hash:f=!0}catch{}let h=Dd(c,{relative:o}),v=tu(c,{replace:s,state:l,target:d,preventScrollReset:u,relative:o,viewTransition:p});function _(w){n&&n(w),w.defaultPrevented||v(w)}return x.createElement("a",Fn({},m,{href:b||h,onClick:f||i?n:_,ref:r,target:d}))});var Ba;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ba||(Ba={}));var Ua;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ua||(Ua={}));function tu(e,t){let{target:r,replace:n,state:o,preventScrollReset:i,relative:s,viewTransition:l}=t===void 0?{}:t,d=Ne(),c=Sr(),u=Ma(e,{relative:s});return x.useCallback(p=>{if(Kd(p,r)){p.preventDefault();let m=n!==void 0?n:_r(c)===_r(u);d(e,{replace:m,state:o,preventScrollReset:i,relative:s,viewTransition:l})}},[c,d,u,n,o,r,e,i,s,l])}function Yt(e){let t=x.useRef($n(e)),r=x.useRef(!1),n=Sr(),o=x.useMemo(()=>Yd(n.search,r.current?null:t.current),[n.search]),i=Ne(),s=x.useCallback((l,d)=>{const c=$n(typeof l=="function"?l(o):l);r.current=!0,i("?"+c,d)},[i,o]);return[o,s]}let ru={data:""},nu=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||ru},ou=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,au=/\/\*[^]*?\*\/|  +/g,Ha=/\n+/g,Ue=(e,t)=>{let r="",n="",o="";for(let i in e){let s=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+s+";":n+=i[1]=="f"?Ue(s,i):i+"{"+Ue(s,i[1]=="k"?"":t)+"}":typeof s=="object"?n+=Ue(s,t?t.replace(/([^,])+/g,l=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,d=>/&/.test(d)?d.replace(/&/g,l):l?l+" "+d:d)):i):s!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Ue.p?Ue.p(i,s):i+":"+s+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Me={},Va=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Va(e[r]);return t}return e},iu=(e,t,r,n,o)=>{let i=Va(e),s=Me[i]||(Me[i]=(d=>{let c=0,u=11;for(;c<d.length;)u=101*u+d.charCodeAt(c++)>>>0;return"go"+u})(i));if(!Me[s]){let d=i!==e?e:(c=>{let u,p,m=[{}];for(;u=ou.exec(c.replace(au,""));)u[4]?m.shift():u[3]?(p=u[3].replace(Ha," ").trim(),m.unshift(m[0][p]=m[0][p]||{})):m[0][u[1]]=u[2].replace(Ha," ").trim();return m[0]})(e);Me[s]=Ue(o?{["@keyframes "+s]:d}:d,r?"":"."+s)}let l=r&&Me.g?Me.g:null;return r&&(Me.g=Me[s]),((d,c,u,p)=>{p?c.data=c.data.replace(p,d):c.data.indexOf(d)===-1&&(c.data=u?d+c.data:c.data+d)})(Me[s],t,n,l),s},su=(e,t,r)=>e.reduce((n,o,i)=>{let s=t[i];if(s&&s.call){let l=s(r),d=l&&l.props&&l.props.className||/^go/.test(l)&&l;s=d?"."+d:l&&typeof l=="object"?l.props?"":Ue(l,""):l===!1?"":l}return n+o+(s??"")},"");function Cr(e){let t=this||{},r=e.call?e(t.p):e;return iu(r.unshift?r.raw?su(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,nu(t.target),t.g,t.o,t.k)}let Wa,Bn,Un;Cr.bind({g:1});let De=Cr.bind({k:1});function lu(e,t,r,n){Ue.p=t,Wa=e,Bn=r,Un=n}function He(e,t){let r=this||{};return function(){let n=arguments;function o(i,s){let l=Object.assign({},i),d=l.className||o.className;r.p=Object.assign({theme:Bn&&Bn()},l),r.o=/ *go\d+/.test(d),l.className=Cr.apply(r,n)+(d?" "+d:"");let c=e;return e[0]&&(c=l.as||e,delete l.as),Un&&c[0]&&Un(l),Wa(c,l)}return o}}var cu=e=>typeof e=="function",kr=(e,t)=>cu(e)?e(t):e,du=(()=>{let e=0;return()=>(++e).toString()})(),qa=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),uu=20,Hn="default",Ga=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return Ga(e,{type:e.toasts.find(s=>s.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(s=>s.id===o||o===void 0?{...s,dismissed:!0,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(s=>({...s,pauseDuration:s.pauseDuration+i}))}}},Nr=[],Ka={toasts:[],pausedAt:void 0,settings:{toastLimit:uu}},Ee={},Ya=(e,t=Hn)=>{Ee[t]=Ga(Ee[t]||Ka,e),Nr.forEach(([r,n])=>{r===t&&n(Ee[t])})},Xa=e=>Object.keys(Ee).forEach(t=>Ya(e,t)),pu=e=>Object.keys(Ee).find(t=>Ee[t].toasts.some(r=>r.id===e)),Er=(e=Hn)=>t=>{Ya(t,e)},mu={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},fu=(e={},t=Hn)=>{let[r,n]=y.useState(Ee[t]||Ka),o=y.useRef(Ee[t]);y.useEffect(()=>(o.current!==Ee[t]&&n(Ee[t]),Nr.push([t,n]),()=>{let s=Nr.findIndex(([l])=>l===t);s>-1&&Nr.splice(s,1)}),[t]);let i=r.toasts.map(s=>{var l,d,c;return{...e,...e[s.type],...s,removeDelay:s.removeDelay||((l=e[s.type])==null?void 0:l.removeDelay)||e?.removeDelay,duration:s.duration||((d=e[s.type])==null?void 0:d.duration)||e?.duration||mu[s.type],style:{...e.style,...(c=e[s.type])==null?void 0:c.style,...s.style}}});return{...r,toasts:i}},hu=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:r?.id||du()}),Xt=e=>(t,r)=>{let n=hu(t,e,r);return Er(n.toasterId||pu(n.id))({type:2,toast:n}),n.id},ne=(e,t)=>Xt("blank")(e,t);ne.error=Xt("error"),ne.success=Xt("success"),ne.loading=Xt("loading"),ne.custom=Xt("custom"),ne.dismiss=(e,t)=>{let r={type:3,toastId:e};t?Er(t)(r):Xa(r)},ne.dismissAll=e=>ne.dismiss(void 0,e),ne.remove=(e,t)=>{let r={type:4,toastId:e};t?Er(t)(r):Xa(r)},ne.removeAll=e=>ne.remove(void 0,e),ne.promise=(e,t,r)=>{let n=ne.loading(t.loading,{...r,...r?.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let i=t.success?kr(t.success,o):void 0;return i?ne.success(i,{id:n,...r,...r?.success}):ne.dismiss(n),o}).catch(o=>{let i=t.error?kr(t.error,o):void 0;i?ne.error(i,{id:n,...r,...r?.error}):ne.dismiss(n)}),e};var gu=1e3,xu=(e,t="default")=>{let{toasts:r,pausedAt:n}=fu(e,t),o=y.useRef(new Map).current,i=y.useCallback((p,m=gu)=>{if(o.has(p))return;let g=setTimeout(()=>{o.delete(p),s({type:4,toastId:p})},m);o.set(p,g)},[]);y.useEffect(()=>{if(n)return;let p=Date.now(),m=r.map(g=>{if(g.duration===1/0)return;let b=(g.duration||0)+g.pauseDuration-(p-g.createdAt);if(b<0){g.visible&&ne.dismiss(g.id);return}return setTimeout(()=>ne.dismiss(g.id,t),b)});return()=>{m.forEach(g=>g&&clearTimeout(g))}},[r,n,t]);let s=y.useCallback(Er(t),[t]),l=y.useCallback(()=>{s({type:5,time:Date.now()})},[s]),d=y.useCallback((p,m)=>{s({type:1,toast:{id:p,height:m}})},[s]),c=y.useCallback(()=>{n&&s({type:6,time:Date.now()})},[n,s]),u=y.useCallback((p,m)=>{let{reverseOrder:g=!1,gutter:b=8,defaultPosition:f}=m||{},h=r.filter(w=>(w.position||f)===(p.position||f)&&w.height),v=h.findIndex(w=>w.id===p.id),_=h.filter((w,j)=>j<v&&w.visible).length;return h.filter(w=>w.visible).slice(...g?[_+1]:[0,_]).reduce((w,j)=>w+(j.height||0)+b,0)},[r]);return y.useEffect(()=>{r.forEach(p=>{if(p.dismissed)i(p.id,p.removeDelay);else{let m=o.get(p.id);m&&(clearTimeout(m),o.delete(p.id))}})},[r,i]),{toasts:r,handlers:{updateHeight:d,startPause:l,endPause:c,calculateOffset:u}}},bu=De`
     37 */function Fn(){return Fn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fn.apply(this,arguments)}function qd(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i<n.length;i++)o=n[i],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function Gd(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Kd(e,t){return e.button===0&&(!t||t==="_self")&&!Gd(e)}function $n(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}function Yd(e,t){let r=$n(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(i=>{r.append(o,i)})}),r}const Xd=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Jd="6";try{window.__reactRouterVersion=Jd}catch{}const $a=x["startTransition"];function Zd(e){let{basename:t,children:r,future:n,window:o}=e,i=x.useRef();i.current==null&&(i.current=Ed({window:o,v5Compat:!0}));let s=i.current,[l,c]=x.useState({action:s.action,location:s.location}),{v7_startTransition:d}=n||{},u=x.useCallback(p=>{d&&$a?$a(()=>c(p)):c(p)},[c,d]);return x.useLayoutEffect(()=>s.listen(u),[s,u]),x.useEffect(()=>Vd(n),[n]),x.createElement(Wd,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}const Qd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",eu=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bt=x.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:i,replace:s,state:l,target:c,to:d,preventScrollReset:u,viewTransition:p}=t,m=qd(t,Xd),{basename:g}=x.useContext(xt),b,f=!1;if(typeof d=="string"&&eu.test(d)&&(b=d,Qd))try{let w=new URL(window.location.href),j=d.startsWith("//")?new URL(w.protocol+d):new URL(d),C=Ta(j.pathname,g);j.origin===w.origin&&C!=null?d=C+j.search+j.hash:f=!0}catch{}let h=Dd(d,{relative:o}),_=tu(d,{replace:s,state:l,target:c,preventScrollReset:u,relative:o,viewTransition:p});function v(w){n&&n(w),w.defaultPrevented||_(w)}return x.createElement("a",Fn({},m,{href:b||h,onClick:f||i?n:v,ref:r,target:c}))});var Ba;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ba||(Ba={}));var Ua;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ua||(Ua={}));function tu(e,t){let{target:r,replace:n,state:o,preventScrollReset:i,relative:s,viewTransition:l}=t===void 0?{}:t,c=Ne(),d=Sr(),u=Ma(e,{relative:s});return x.useCallback(p=>{if(Kd(p,r)){p.preventDefault();let m=n!==void 0?n:vr(d)===vr(u);c(e,{replace:m,state:o,preventScrollReset:i,relative:s,viewTransition:l})}},[d,c,u,n,o,r,e,i,s,l])}function Jt(e){let t=x.useRef($n(e)),r=x.useRef(!1),n=Sr(),o=x.useMemo(()=>Yd(n.search,r.current?null:t.current),[n.search]),i=Ne(),s=x.useCallback((l,c)=>{const d=$n(typeof l=="function"?l(o):l);r.current=!0,i("?"+d,c)},[i,o]);return[o,s]}let ru={data:""},nu=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||ru},ou=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,au=/\/\*[^]*?\*\/|  +/g,Ha=/\n+/g,Ue=(e,t)=>{let r="",n="",o="";for(let i in e){let s=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+s+";":n+=i[1]=="f"?Ue(s,i):i+"{"+Ue(s,i[1]=="k"?"":t)+"}":typeof s=="object"?n+=Ue(s,t?t.replace(/([^,])+/g,l=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):i):s!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Ue.p?Ue.p(i,s):i+":"+s+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Me={},Va=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Va(e[r]);return t}return e},iu=(e,t,r,n,o)=>{let i=Va(e),s=Me[i]||(Me[i]=(c=>{let d=0,u=11;for(;d<c.length;)u=101*u+c.charCodeAt(d++)>>>0;return"go"+u})(i));if(!Me[s]){let c=i!==e?e:(d=>{let u,p,m=[{}];for(;u=ou.exec(d.replace(au,""));)u[4]?m.shift():u[3]?(p=u[3].replace(Ha," ").trim(),m.unshift(m[0][p]=m[0][p]||{})):m[0][u[1]]=u[2].replace(Ha," ").trim();return m[0]})(e);Me[s]=Ue(o?{["@keyframes "+s]:c}:c,r?"":"."+s)}let l=r&&Me.g?Me.g:null;return r&&(Me.g=Me[s]),((c,d,u,p)=>{p?d.data=d.data.replace(p,c):d.data.indexOf(c)===-1&&(d.data=u?c+d.data:d.data+c)})(Me[s],t,n,l),s},su=(e,t,r)=>e.reduce((n,o,i)=>{let s=t[i];if(s&&s.call){let l=s(r),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;s=c?"."+c:l&&typeof l=="object"?l.props?"":Ue(l,""):l===!1?"":l}return n+o+(s??"")},"");function Cr(e){let t=this||{},r=e.call?e(t.p):e;return iu(r.unshift?r.raw?su(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,nu(t.target),t.g,t.o,t.k)}let Wa,Bn,Un;Cr.bind({g:1});let De=Cr.bind({k:1});function lu(e,t,r,n){Ue.p=t,Wa=e,Bn=r,Un=n}function He(e,t){let r=this||{};return function(){let n=arguments;function o(i,s){let l=Object.assign({},i),c=l.className||o.className;r.p=Object.assign({theme:Bn&&Bn()},l),r.o=/ *go\d+/.test(c),l.className=Cr.apply(r,n)+(c?" "+c:"");let d=e;return e[0]&&(d=l.as||e,delete l.as),Un&&d[0]&&Un(l),Wa(d,l)}return o}}var cu=e=>typeof e=="function",kr=(e,t)=>cu(e)?e(t):e,du=(()=>{let e=0;return()=>(++e).toString()})(),qa=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),uu=20,Hn="default",Ga=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return Ga(e,{type:e.toasts.find(s=>s.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(s=>s.id===o||o===void 0?{...s,dismissed:!0,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(s=>({...s,pauseDuration:s.pauseDuration+i}))}}},Nr=[],Ka={toasts:[],pausedAt:void 0,settings:{toastLimit:uu}},Ee={},Ya=(e,t=Hn)=>{Ee[t]=Ga(Ee[t]||Ka,e),Nr.forEach(([r,n])=>{r===t&&n(Ee[t])})},Xa=e=>Object.keys(Ee).forEach(t=>Ya(e,t)),pu=e=>Object.keys(Ee).find(t=>Ee[t].toasts.some(r=>r.id===e)),Er=(e=Hn)=>t=>{Ya(t,e)},mu={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},fu=(e={},t=Hn)=>{let[r,n]=y.useState(Ee[t]||Ka),o=y.useRef(Ee[t]);y.useEffect(()=>(o.current!==Ee[t]&&n(Ee[t]),Nr.push([t,n]),()=>{let s=Nr.findIndex(([l])=>l===t);s>-1&&Nr.splice(s,1)}),[t]);let i=r.toasts.map(s=>{var l,c,d;return{...e,...e[s.type],...s,removeDelay:s.removeDelay||((l=e[s.type])==null?void 0:l.removeDelay)||e?.removeDelay,duration:s.duration||((c=e[s.type])==null?void 0:c.duration)||e?.duration||mu[s.type],style:{...e.style,...(d=e[s.type])==null?void 0:d.style,...s.style}}});return{...r,toasts:i}},hu=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:r?.id||du()}),Zt=e=>(t,r)=>{let n=hu(t,e,r);return Er(n.toasterId||pu(n.id))({type:2,toast:n}),n.id},ne=(e,t)=>Zt("blank")(e,t);ne.error=Zt("error"),ne.success=Zt("success"),ne.loading=Zt("loading"),ne.custom=Zt("custom"),ne.dismiss=(e,t)=>{let r={type:3,toastId:e};t?Er(t)(r):Xa(r)},ne.dismissAll=e=>ne.dismiss(void 0,e),ne.remove=(e,t)=>{let r={type:4,toastId:e};t?Er(t)(r):Xa(r)},ne.removeAll=e=>ne.remove(void 0,e),ne.promise=(e,t,r)=>{let n=ne.loading(t.loading,{...r,...r?.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let i=t.success?kr(t.success,o):void 0;return i?ne.success(i,{id:n,...r,...r?.success}):ne.dismiss(n),o}).catch(o=>{let i=t.error?kr(t.error,o):void 0;i?ne.error(i,{id:n,...r,...r?.error}):ne.dismiss(n)}),e};var gu=1e3,xu=(e,t="default")=>{let{toasts:r,pausedAt:n}=fu(e,t),o=y.useRef(new Map).current,i=y.useCallback((p,m=gu)=>{if(o.has(p))return;let g=setTimeout(()=>{o.delete(p),s({type:4,toastId:p})},m);o.set(p,g)},[]);y.useEffect(()=>{if(n)return;let p=Date.now(),m=r.map(g=>{if(g.duration===1/0)return;let b=(g.duration||0)+g.pauseDuration-(p-g.createdAt);if(b<0){g.visible&&ne.dismiss(g.id);return}return setTimeout(()=>ne.dismiss(g.id,t),b)});return()=>{m.forEach(g=>g&&clearTimeout(g))}},[r,n,t]);let s=y.useCallback(Er(t),[t]),l=y.useCallback(()=>{s({type:5,time:Date.now()})},[s]),c=y.useCallback((p,m)=>{s({type:1,toast:{id:p,height:m}})},[s]),d=y.useCallback(()=>{n&&s({type:6,time:Date.now()})},[n,s]),u=y.useCallback((p,m)=>{let{reverseOrder:g=!1,gutter:b=8,defaultPosition:f}=m||{},h=r.filter(w=>(w.position||f)===(p.position||f)&&w.height),_=h.findIndex(w=>w.id===p.id),v=h.filter((w,j)=>j<_&&w.visible).length;return h.filter(w=>w.visible).slice(...g?[v+1]:[0,v]).reduce((w,j)=>w+(j.height||0)+b,0)},[r]);return y.useEffect(()=>{r.forEach(p=>{if(p.dismissed)i(p.id,p.removeDelay);else{let m=o.get(p.id);m&&(clearTimeout(m),o.delete(p.id))}})},[r,i]),{toasts:r,handlers:{updateHeight:c,startPause:l,endPause:d,calculateOffset:u}}},bu=De`
    3838from {
    3939  transform: scale(0) rotate(45deg);
     
    4343 transform: scale(1) rotate(45deg);
    4444  opacity: 1;
    45 }`,vu=De`
     45}`,_u=De`
    4646from {
    4747  transform: scale(0);
     
    5151  transform: scale(1);
    5252  opacity: 1;
    53 }`,_u=De`
     53}`,vu=De`
    5454from {
    5555  transform: scale(0) rotate(90deg);
     
    7575  &:before {
    7676    content: '';
    77     animation: ${vu} 0.15s ease-out forwards;
     77    animation: ${_u} 0.15s ease-out forwards;
    7878    animation-delay: 150ms;
    7979    position: absolute;
     
    8888
    8989  &:before {
    90     animation: ${_u} 0.15s ease-out forwards;
     90    animation: ${vu} 0.15s ease-out forwards;
    9191    animation-delay: 180ms;
    9292    transform: rotate(90deg);
     
    206206  flex: 1 1 auto;
    207207  white-space: pre-line;
    208 `,Du=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=qa()?[Lu,Iu]:[Ou(r),Ru(r)];return{animation:t?`${De(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${De(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Fu=x.memo(({toast:e,position:t,style:r,children:n})=>{let o=e.height?Du(e.position||t||"top-center",e.visible):{opacity:0},i=x.createElement(Pu,{toast:e}),s=x.createElement(Mu,{...e.ariaProps},kr(e.message,e));return x.createElement(zu,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:i,message:s}):x.createElement(x.Fragment,null,i,s))});lu(x.createElement);var $u=({id:e,className:t,style:r,onHeightUpdate:n,children:o})=>{let i=x.useCallback(s=>{if(s){let l=()=>{let d=s.getBoundingClientRect().height;n(e,d)};l(),new MutationObserver(l).observe(s,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return x.createElement("div",{ref:i,className:t,style:r},o)},Bu=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:qa()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},Uu=Cr`
     208`,Du=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=qa()?[Lu,Iu]:[Ou(r),Ru(r)];return{animation:t?`${De(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${De(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Fu=x.memo(({toast:e,position:t,style:r,children:n})=>{let o=e.height?Du(e.position||t||"top-center",e.visible):{opacity:0},i=x.createElement(Pu,{toast:e}),s=x.createElement(Mu,{...e.ariaProps},kr(e.message,e));return x.createElement(zu,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:i,message:s}):x.createElement(x.Fragment,null,i,s))});lu(x.createElement);var $u=({id:e,className:t,style:r,onHeightUpdate:n,children:o})=>{let i=x.useCallback(s=>{if(s){let l=()=>{let c=s.getBoundingClientRect().height;n(e,c)};l(),new MutationObserver(l).observe(s,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return x.createElement("div",{ref:i,className:t,style:r},o)},Bu=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:qa()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},Uu=Cr`
    209209  z-index: 9999;
    210210  > * {
    211211    pointer-events: auto;
    212212  }
    213 `,Tr=16,Hu=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:i,containerStyle:s,containerClassName:l})=>{let{toasts:d,handlers:c}=xu(r,i);return x.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:Tr,left:Tr,right:Tr,bottom:Tr,pointerEvents:"none",...s},className:l,onMouseEnter:c.startPause,onMouseLeave:c.endPause},d.map(u=>{let p=u.position||t,m=c.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),g=Bu(p,m);return x.createElement($u,{id:u.id,key:u.id,onHeightUpdate:c.updateHeight,className:u.visible?Uu:"",style:g},u.type==="custom"?kr(u.message,u):o?o(u):x.createElement(Fu,{toast:u,position:p}))}))},K=ne;const Ja={carousel:"carousel",grid:"grid"},Vu=["marquee","stacked"],tt={topBottomSpacing:0,gap:16,gapOnMobile:16,shape:"rectangle",size:150,sizeOnMobile:150,hoverEffect:"none",border:{border_width:2,border_color:"#9ca3af",border_radius:6},shadow:{shadow_size:16},template:Ja.carousel,appearance:"overlay",widgetTitle:{alignment:"hidden",fontSize:24,color:"#000000"},playerAppearance:"overlay"},X={settings:"settings",stat:"statistics",cr:"create-reel",mg:"manage-group",ag:"all-groups",ar:"all-reels"},Wu=[{label:"None",value:"none"},{label:"zoom in",value:"zoom-in"},{label:"zoom out",value:"zoom-out"}],Za=[{label:"Horizontal",value:"horizontal"}],qu=[{label:"Vertical",value:"vertical"}],Gu=[{label:"Overlay",value:"overlay"},{label:"Only Title",value:"title"},{label:"None",value:"none"}],Ku=[{label:"Overlay",value:"overlay"},{label:"Only Tile",value:"title"},{label:"None",value:"none"}];var Qa={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ei=y.createContext&&y.createContext(Qa),Yu=["attr","size","title"];function Xu(e,t){if(e==null)return{};var r=Ju(e,t),n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ju(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ar(){return Ar=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ar.apply(this,arguments)}function ti(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Pr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ti(Object(r),!0).forEach(function(n){Zu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ti(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Zu(e,t,r){return t=Qu(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qu(e){var t=ep(e,"string");return typeof t=="symbol"?t:t+""}function ep(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ri(e){return e&&e.map((t,r)=>y.createElement(t.tag,Pr({key:r},t.attr),ri(t.child)))}function H(e){return t=>y.createElement(tp,Ar({attr:Pr({},e.attr)},t),ri(e.child))}function tp(e){var t=r=>{var{attr:n,size:o,title:i}=e,s=Xu(e,Yu),l=o||r.size||"1em",d;return r.className&&(d=r.className),e.className&&(d=(d?d+" ":"")+e.className),y.createElement("svg",Ar({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:d,style:Pr(Pr({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&y.createElement("title",null,i),e.children)};return ei!==void 0?y.createElement(ei.Consumer,null,r=>t(r)):t(Qa)}function rp(e){return H({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M164.44,105.34l-48-32A8,8,0,0,0,104,80v64a8,8,0,0,0,12.44,6.66l48-32a8,8,0,0,0,0-13.32ZM120,129.05V95l25.58,17ZM216,40H40A16,16,0,0,0,24,56V168a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,128H40V56H216V168Zm16,40a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16H224A8,8,0,0,1,232,208Z"},child:[]}]})(e)}function Jt(e){return H({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17 10h-1v-2c0-2.205-1.794-4-4-4s-4 1.795-4 4v2h-1c-1.103 0-2 .896-2 2v7c0 1.104.897 2 2 2h10c1.103 0 2-.896 2-2v-7c0-1.104-.897-2-2-2zm-5 8.299c-.719 0-1.3-.58-1.3-1.299s.581-1.301 1.3-1.301 1.3.582 1.3 1.301-.581 1.299-1.3 1.299zm2-7.299h-4v-3c0-1.104.897-2 2-2s2 .896 2 2v3z"},child:[]}]})(e)}function gt(e){return H({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18 10h-4v-4c0-1.104-.896-2-2-2s-2 .896-2 2l.071 4h-4.071c-1.104 0-2 .896-2 2s.896 2 2 2l4.071-.071-.071 4.071c0 1.104.896 2 2 2s2-.896 2-2v-4.071l4 .071c1.104 0 2-.896 2-2s-.896-2-2-2z"},child:[]}]})(e)}function Zt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m15 18-6-6 6-6"},child:[]}]})(e)}function Qt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m9 18 6-6-6-6"},child:[]}]})(e)}function np(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"},child:[]}]})(e)}function op(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]}]})(e)}function rt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12a9 9 0 1 1-6.219-8.56"},child:[]}]})(e)}function ap(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"},child:[]},{tag:"path",attr:{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7"},child:[]},{tag:"path",attr:{d:"M7 3v4a1 1 0 0 0 1 1h7"},child:[]}]})(e)}function ni(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"path",attr:{d:"m21 21-4.3-4.3"},child:[]}]})(e)}function ip(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},child:[]},{tag:"path",attr:{d:"M12 9v4"},child:[]},{tag:"path",attr:{d:"M12 17h.01"},child:[]}]})(e)}function er(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18 6 6 18"},child:[]},{tag:"path",attr:{d:"m6 6 12 12"},child:[]}]})(e)}function Vn(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function sp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function lp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},child:[]}]})(e)}function cp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM12 5.5v9l6-4.5z"},child:[]}]})(e)}function dp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M12 6.5a9.77 9.77 0 0 1 8.82 5.5c-1.65 3.37-5.02 5.5-8.82 5.5S4.83 15.37 3.18 12A9.77 9.77 0 0 1 12 6.5m0-2C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zm0 5a2.5 2.5 0 0 1 0 5 2.5 2.5 0 0 1 0-5m0-2c-2.48 0-4.5 2.02-4.5 4.5s2.02 4.5 4.5 4.5 4.5-2.02 4.5-4.5-2.02-4.5-4.5-4.5z"},child:[]}]})(e)}function oi(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Wn(...e){return t=>{let r=!1;const n=e.map(o=>{const i=oi(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():oi(e[o],null)}}}}function J(...e){return x.useCallback(Wn(...e),e)}function nt(e){const t=pp(e),r=x.forwardRef((n,o)=>{const{children:i,...s}=n,l=x.Children.toArray(i),d=l.find(fp);if(d){const c=d.props.children,u=l.map(p=>p===d?x.Children.count(c)>1?x.Children.only(null):x.isValidElement(c)?c.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(c)?x.cloneElement(c,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var up=nt("Slot");function pp(e){const t=x.forwardRef((r,n)=>{const{children:o,...i}=r;if(x.isValidElement(o)){const s=gp(o),l=hp(i,o.props);return o.type!==x.Fragment&&(l.ref=n?Wn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var mp=Symbol("radix.slottable");function fp(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mp}function hp(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const d=i(...l);return o(...l),d}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function gp(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function ai(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=ai(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function xp(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=ai(e))&&(n&&(n+=" "),n+=t);return n}function F(...e){return xp(e)}const bp="ecr-button",vp={default:"ecr-button--primary",destructive:"ecr-button--danger",outline:"ecr-button--outline","outline-danger":"ecr-button--outline-danger",secondary:"ecr-button--secondary",ghost:"ecr-button--ghost",link:"ecr-button--link"},_p={default:"ecr-button--md",sm:"ecr-button--sm",lg:"ecr-button--lg",icon:"ecr-button--icon","icon-sm":"ecr-button--icon-sm","icon-lg":"ecr-button--icon-lg"};function te({className:e,variant:t="default",size:r="default",asChild:n=!1,...o}){const i=n?up:"button";return a.jsx(i,{"data-slot":"button","data-variant":t,"data-size":r,className:F(bp,vp[t],_p[r],e),...o})}function yp({selectedReelIds:e,handleSelectAll:t,clearSelection:r,searchTerm:n,setSearchTerm:o,isCreating:i,handleCreateGroup:s,handleBulkDelete:l}){return a.jsxs("div",{className:"ecr-admin-reels-header",children:[a.jsxs("div",{className:"ecr-admin-reels-header__left",children:[a.jsx("h2",{className:"ecr-admin-reels-header__title",children:"Reels"}),e.length?a.jsxs("div",{className:"ecr-admin-reels-header__actions",children:[a.jsx(te,{onClick:t,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--primary",children:"Select all"}),a.jsx(te,{onClick:r,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--danger",children:"Clear"}),a.jsxs(te,{variant:"outline-danger",size:"sm",onClick:l,children:[a.jsx(Vn,{size:22,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"}),"Delete Selected"]})]}):null]}),a.jsxs("div",{className:"ecr-admin-reels-header__right",children:[a.jsxs("div",{className:"ecr-admin-reels-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:d=>o(d.target.value),className:"ecr-admin-search-input"}),a.jsxs("div",{className:"ecr-admin-reels-header__icon-wrapper",children:[n&&a.jsx(te,{onClick:()=>o(""),variant:"link",size:"icon-sm",children:a.jsx(er,{size:16,className:"ecr-admin-reels-header__clear-icon"})}),a.jsx(ni,{size:16,className:"ecr-admin-reels-header__search-icon"})]})," "]}),e.length?a.jsxs(te,{disabled:i,onClick:s,className:"ecr-admin-reels-header__create",children:[i?a.jsx(rt,{className:"ecr-admin-reels-header__spinner"}):a.jsx(gt,{})," ","Create Widget"]}):null]})]})}function jp(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m112 160-64 64 64 64"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M64 224h294c58.76 0 106 49.33 106 108v20"},child:[]}]})(e)}function Sp(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M262.29 192.31a64 64 0 1 0 57.4 57.4 64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22 155.3 155.3 0 0 1-21.46-12.57 16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22 155.3 155.3 0 0 1 21.46 12.57 16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z"},child:[]}]})(e)}function ot(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M85.57 446.25h340.86a32 32 0 0 0 28.17-47.17L284.18 82.58c-12.09-22.44-44.27-22.44-56.36 0L57.4 399.08a32 32 0 0 0 28.17 47.17z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m250.26 195.39 5.74 122 5.73-121.95a5.74 5.74 0 0 0-5.79-6h0a5.74 5.74 0 0 0-5.68 5.95z"},child:[]},{tag:"path",attr:{d:"M256 397.25a20 20 0 1 1 20-20 20 20 0 0 1-20 20z"},child:[]}]})(e)}function Cp(){return a.jsx("div",{className:"ecr-admin-reels-empty",children:a.jsxs("p",{className:"ecr-admin-reels-empty__text",children:[a.jsx(ot,{color:"#FFA500",size:40}),a.jsx("span",{children:"You did not have any reel yet."})]})})}function kp({isFullScreen:e}){return a.jsx("div",{className:F("ecr-admin-reels-loading",e&&"ecr-admin-reels-loading--fullscreen"),children:a.jsx(rt,{className:"ecr-admin-reels-loading__icon"})})}const ii=({playingStory:e,duration:t,currentFileIndex:r,isPaused:n})=>a.jsx("div",{className:"ecr-player__progress",children:e?.files?.map((o,i)=>a.jsx("div",{className:"ecr-player__progress-track",children:a.jsx("div",{style:{"--reels-wp-animation-time":`${t}s`,animationPlayState:n?"paused":"running"},className:F("ecr-player__progress-fill",i===r?.index?"ecr-player__progress-fill--active":i<r?.index?"ecr-player__progress-fill--complete":"ecr-player__progress-fill--empty")})},i))}),xt=({className:e,children:t,...r})=>a.jsx("button",{className:F("ecr-player__nav",e),...r,children:t});function qn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4.5 3H6v10H4.5V3zm7 0v10H10V3h1.5z"},child:[]}]})(e)}function Gn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 5h2.79l3.86-3.83.85.35v13l-.85.33L4.29 11H1.5l-.5-.5v-5l.5-.5zm3.35 5.17L8 13.31V2.73L4.85 5.85 4.5 6H2v4h2.5l.35.17zm9.381-4.108l.707.707L13.207 8.5l1.731 1.732-.707.707L12.5 9.207l-1.732 1.732-.707-.707L11.793 8.5 10.06 6.77l.707-.707 1.733 1.73 1.731-1.731z"},child:[]}]})(e)}function Kn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3.78 2L3 2.41v12l.78.42 9-6V8l-9-6zM4 13.48V3.35l7.6 5.07L4 13.48z"},child:[]}]})(e)}function Yn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 4.83h2.79L8.15 1l.85.35v13l-.85.33-3.86-3.85H1.5l-.5-.5v-5l.5-.5zM4.85 10L8 13.14V2.56L4.85 5.68l-.35.15H2v4h2.5l.35.17zM15 7.83a6.97 6.97 0 0 1-1.578 4.428l-.712-.71A5.975 5.975 0 0 0 14 7.83c0-1.4-.48-2.689-1.284-3.71l.712-.71A6.971 6.971 0 0 1 15 7.83zm-2 0a4.978 4.978 0 0 1-1.002 3.004l-.716-.716A3.982 3.982 0 0 0 12 7.83a3.98 3.98 0 0 0-.713-2.28l.716-.716c.626.835.997 1.872.997 2.996zm-2 0c0 .574-.16 1.11-.44 1.566l-.739-.738a1.993 1.993 0 0 0 .005-1.647l.739-.739c.276.454.435.988.435 1.558z"},child:[]}]})(e)}const Np="Left",Ep="Right",Tp="Up",Ap="Down",bt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Xn={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},si="mousemove",li="mouseup",Pp="touchend",Op="touchmove",Rp="touchstart";function Lp(e,t,r,n){return e>t?r>0?Ep:Np:n>0?Ap:Tp}function ci(e,t){if(t===0)return e;const r=Math.PI/180*t,n=e[0]*Math.cos(r)+e[1]*Math.sin(r),o=e[1]*Math.cos(r)-e[0]*Math.sin(r);return[n,o]}function Ip(e,t){const r=u=>{const p="touches"in u;p&&u.touches.length>1||e((m,g)=>{g.trackMouse&&!p&&(document.addEventListener(si,n),document.addEventListener(li,s));const{clientX:b,clientY:f}=p?u.touches[0]:u,h=ci([b,f],g.rotationAngle);return g.onTouchStartOrOnMouseDown&&g.onTouchStartOrOnMouseDown({event:u}),Object.assign(Object.assign(Object.assign({},m),Xn),{initial:h.slice(),xy:h,start:u.timeStamp||0})})},n=u=>{e((p,m)=>{const g="touches"in u;if(g&&u.touches.length>1)return p;if(u.timeStamp-p.start>m.swipeDuration)return p.swiping?Object.assign(Object.assign({},p),{swiping:!1}):p;const{clientX:b,clientY:f}=g?u.touches[0]:u,[h,v]=ci([b,f],m.rotationAngle),_=h-p.xy[0],w=v-p.xy[1],j=Math.abs(_),C=Math.abs(w),N=(u.timeStamp||0)-p.start,k=Math.sqrt(j*j+C*C)/(N||1),E=[_/(N||1),w/(N||1)],T=Lp(j,C,_,w),A=typeof m.delta=="number"?m.delta:m.delta[T.toLowerCase()]||bt.delta;if(j<A&&C<A&&!p.swiping)return p;const O={absX:j,absY:C,deltaX:_,deltaY:w,dir:T,event:u,first:p.first,initial:p.initial,velocity:k,vxvy:E};O.first&&m.onSwipeStart&&m.onSwipeStart(O),m.onSwiping&&m.onSwiping(O);let R=!1;return(m.onSwiping||m.onSwiped||m[`onSwiped${T}`])&&(R=!0),R&&m.preventScrollOnSwipe&&m.trackTouch&&u.cancelable&&u.preventDefault(),Object.assign(Object.assign({},p),{first:!1,eventData:O,swiping:!0})})},o=u=>{e((p,m)=>{let g;if(p.swiping&&p.eventData){if(u.timeStamp-p.start<m.swipeDuration){g=Object.assign(Object.assign({},p.eventData),{event:u}),m.onSwiped&&m.onSwiped(g);const b=m[`onSwiped${g.dir}`];b&&b(g)}}else m.onTap&&m.onTap({event:u});return m.onTouchEndOrOnMouseUp&&m.onTouchEndOrOnMouseUp({event:u}),Object.assign(Object.assign(Object.assign({},p),Xn),{eventData:g})})},i=()=>{document.removeEventListener(si,n),document.removeEventListener(li,s)},s=u=>{i(),o(u)},l=(u,p)=>{let m=()=>{};if(u&&u.addEventListener){const g=Object.assign(Object.assign({},bt.touchEventOptions),p.touchEventOptions),b=[[Rp,r,g],[Op,n,Object.assign(Object.assign({},g),p.preventScrollOnSwipe?{passive:!1}:{})],[Pp,o,g]];b.forEach(([f,h,v])=>u.addEventListener(f,h,v)),m=()=>b.forEach(([f,h])=>u.removeEventListener(f,h))}return m},c={ref:u=>{u!==null&&e((p,m)=>{if(p.el===u)return p;const g={};return p.el&&p.el!==u&&p.cleanUpTouch&&(p.cleanUpTouch(),g.cleanUpTouch=void 0),m.trackTouch&&u&&(g.cleanUpTouch=l(u,m)),Object.assign(Object.assign(Object.assign({},p),{el:u}),g)})}};return t.trackMouse&&(c.onMouseDown=r),[c,l]}function zp(e,t,r,n){return!t.trackTouch||!e.el?(e.cleanUpTouch&&e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:void 0})):e.cleanUpTouch?t.preventScrollOnSwipe!==r.preventScrollOnSwipe||t.touchEventOptions.passive!==r.touchEventOptions.passive?(e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})):e:Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})}function Mp(e){const{trackMouse:t}=e,r=x.useRef(Object.assign({},Xn)),n=x.useRef(Object.assign({},bt)),o=x.useRef(Object.assign({},n.current));o.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},bt),e);let i;for(i in bt)n.current[i]===void 0&&(n.current[i]=bt[i]);const[s,l]=x.useMemo(()=>Ip(d=>r.current=d(r.current,n.current),{trackMouse:t}),[t]);return r.current=zp(r.current,n.current,o.current,l),s}const Dp=({videoRefs:e,file:t,isMuted:r,isPaused:n,i:o,togglePlayPause:i,handleNextFile:s,setDuration:l})=>{const[d,c]=y.useState(!1);return a.jsx("div",{className:"ecr-player__media-frame",children:a.jsx("video",{preload:"none",playsInline:!0,muted:r,autoPlay:!n,controls:!1,loop:!1,disablePictureInPicture:!0,controlsList:"nodownload noplaybackrate noremoteplayback",ref:u=>{u&&(e.current[o]=u,u.setAttribute("webkit-playsinline","true"),u.setAttribute("x-webkit-airplay","allow"),u.setAttribute("airplay","allow"))},className:d?"ecr-player__media ecr-player__media--portrait":"ecr-player__media",src:t?.url,onClick:()=>i(o),onEnded:s,onLoadedMetadata:u=>{const p=u.currentTarget,m=p.videoWidth,g=p.videoHeight;c(g>m),l(p.duration)}})})},di=({currentFileIndex:e,files:t,setDuration:r,setIsPlaying:n,setPreviewReel:o,isPaused:i,setIsPaused:s,handlePrevFile:l,handleNextFile:d})=>{const[c,u]=y.useState(!1),p=y.useRef([]);y.useEffect(()=>{p.current=[]},[t]);const m=h=>{const v=p.current[h];v&&(i?v.play():v.pause(),s(_=>!_))},g=h=>{const v=p.current[h];v&&(v.muted=!c,u(_=>!_))},b=typeof window<"u"&&window.matchMedia("(max-width: 767px)").matches,f=Mp({trackMouse:!0,onSwipedRight:l,onSwipedLeft:d,onSwipedUp:()=>{b&&d()},onSwipedDown:()=>{if(b){l();return}n&&n(null),o&&o(null)}});return a.jsx("div",{style:{left:`${-100*e?.index}%`},className:"ecr-player__slider",...f,children:Array.isArray(t)&&t.map((h,v)=>a.jsx("div",{className:"ecr-player__slide",children:h?.mime_type?.startsWith("image")?null:a.jsxs("div",{className:"ecr-player__media-frame",children:[a.jsx(Dp,{videoRefs:p,file:h,isMuted:c,i:v,togglePlayPause:m,handleNextFile:d,setDuration:r,isPaused:i},h.file_uuid),a.jsxs("div",{className:"ecr-player__controls",children:[i?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(v)}):a.jsx(qn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(v)}),c?a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(v)}):a.jsx(Yn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(v)})]})]})},v))})},Fp=({previewReel:e,setPreviewReel:t})=>{const[r,n]=y.useState({index:0,story_uuid:e?.story_uuid}),[o,i]=y.useState(!1),[s,l]=y.useState(3);y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const d=()=>{const m=e?.files??[];r?.index>0?n(g=>({index:g.index-1,story_uuid:m[g.index-1].story_uuid})):t(null)},c=()=>{const m=e?.files??[];r?.index+1<m.length?n(g=>({index:g.index+1,story_uuid:m[g.index+1].story_uuid})):t(null)},u=e.files.length,p=m=>{m.target===m.currentTarget&&t(null)};return a.jsx("div",{onClick:p,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:e&&a.jsxs("div",{className:"ecr-player__stage",children:[u>1?a.jsxs(a.Fragment,{children:[r.index>0?a.jsx(xt,{onClick:d,className:"ecr-player__nav--left",children:a.jsx(Zt,{size:24})}):null,r.index<u-1?a.jsx(xt,{onClick:c,className:"ecr-player__nav--right",children:a.jsx(Qt,{size:24})}):null]}):null,a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[e&&a.jsx(ii,{playingStory:e,duration:s,currentFileIndex:r,isPaused:o},`${e.story_uuid}-${r.index}`),a.jsx("div",{onClick:()=>t(null),className:"ecr-player__close",children:a.jsx(er,{className:"ecr-player__close-icon"})}),e?.files.length>0&&a.jsx(di,{currentFileIndex:r,files:e?.files,setDuration:l,setPreviewReel:t,isPaused:o,setIsPaused:i,handlePrevFile:d,handleNextFile:c,storyId:e.id,storyTitle:e?.title})]})]})})};function $p(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z"},child:[]}]})(e)}function Bp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z"},child:[]}]})(e)}function Up(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z"},child:[]}]})(e)}function Or(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.045 7.401c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.378-.378-.88-.586-1.414-.586s-1.036.208-1.413.585L4 13.585V18h4.413L19.045 7.401zm-3-3 1.587 1.585-1.59 1.584-1.586-1.585 1.589-1.584zM6 16v-1.585l7.04-7.018 1.586 1.586L7.587 16H6zm-2 4h16v2H4z"},child:[]}]})(e)}function Hp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 19c.946 0 1.81-.103 2.598-.281l-1.757-1.757c-.273.021-.55.038-.841.038-5.351 0-7.424-3.846-7.926-5a8.642 8.642 0 0 1 1.508-2.297L4.184 8.305c-1.538 1.667-2.121 3.346-2.132 3.379a.994.994 0 0 0 0 .633C2.073 12.383 4.367 19 12 19zm0-14c-1.837 0-3.346.396-4.604.981L3.707 2.293 2.293 3.707l18 18 1.414-1.414-3.319-3.319c2.614-1.951 3.547-4.615 3.561-4.657a.994.994 0 0 0 0-.633C21.927 11.617 19.633 5 12 5zm4.972 10.558-2.28-2.28c.19-.39.308-.819.308-1.278 0-1.641-1.359-3-3-3-.459 0-.888.118-1.277.309L8.915 7.501A9.26 9.26 0 0 1 12 7c5.351 0 7.424 3.846 7.926 5-.302.692-1.166 2.342-2.954 3.558z"},child:[]}]})(e)}function ui(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 12a2 2 0 0 0-.703.133l-2.398-1.963c.059-.214.101-.436.101-.67C17 8.114 15.886 7 14.5 7S12 8.114 12 9.5c0 .396.1.765.262 1.097l-2.909 3.438A2.06 2.06 0 0 0 9 14c-.179 0-.348.03-.512.074l-2.563-2.563C5.97 11.348 6 11.179 6 11c0-1.108-.892-2-2-2s-2 .892-2 2 .892 2 2 2c.179 0 .348-.03.512-.074l2.563 2.563A1.906 1.906 0 0 0 7 16c0 1.108.892 2 2 2s2-.892 2-2c0-.237-.048-.46-.123-.671l2.913-3.442c.227.066.462.113.71.113a2.48 2.48 0 0 0 1.133-.281l2.399 1.963A2.077 2.077 0 0 0 18 14c0 1.108.892 2 2 2s2-.892 2-2-.892-2-2-2z"},child:[]}]})(e)}function Vp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM7 12.414l-3.707-3.707 1.414-1.414 2.293 2.293 4.793-4.793 1.414 1.414-6.207 6.207z"},child:[]}]})(e)}function Wp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM14 14h-12v-12h12v12z"},child:[]}]})(e)}function qp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 10c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2s-0.895 2-2 2z"},child:[]}]})(e)}function Gp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 14c-3.314 0-6-2.686-6-6s2.686-6 6-6c3.314 0 6 2.686 6 6s-2.686 6-6 6z"},child:[]}]})(e)}const Kp=e=>{if(e<1e3)return e;if(e<1e6){const r=e/1e3;return r%1===0?`${r}k`:`${r.toFixed(1)}k`}if(e<1e9){const r=e/1e6;return r%1===0?`${r}m`:`${r.toFixed(1)}m`}const t=e/1e9;return t%1===0?`${t}b`:`${t.toFixed(1)}b`},Yp=({story:e,styles:t,storyViews:r,setStoryViews:n})=>{y.useEffect(()=>{n&&n(s=>({...s,[e.id]:e.view_count}))},[e]);const o=e?.files[0]?.mime_type.startsWith("video"),i=e.thumbnail||void 0;return a.jsxs("div",{className:"ecr-thumb__media",children:[o?a.jsx("video",{className:"ecr-thumb__video",src:e?.files[0]?.url,poster:i}):a.jsx("div",{className:"ecr-thumb__placeholder",children:"No Video"}),(r?.[e.id]??e.view_count)>0&&a.jsxs("div",{style:{left:t?.shape==="circle"?"50%":"100%",transform:`translateX(${t?.shape==="circle"?"-50%":`calc(-120% - ${t.border.border_radius/2}px)`})`,transition:"all 0.3s ease-in-out"},className:"ecr-thumb__views",children:[a.jsx("span",{children:Kp(r?.[e.id]??e.view_count)}),a.jsx(op,{size:14})]})]})},Jn=y.memo(Yp);function Xp({reel:e,styles:t,isSelected:r,onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:s}){return a.jsxs("div",{className:`ecr-admin-reel-card ${t?.hoverEffect??""}`,children:[a.jsxs("div",{style:{aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},className:F("ecr-admin-reel-card__frame",r?"ecr-admin-reel-card__frame--selected":""),children:[a.jsx(Jn,{story:e,styles:t}),a.jsxs("div",{className:F("ecr-admin-reel-card__actions",s?"":"ecr-admin-reel-card__actions--hover"),children:[e.files[0]?.mime_type.startsWith("image")?null:a.jsx(te,{onClick:()=>i(e),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--primary",size:"icon-sm",title:"Preview Reel",children:a.jsx(dp,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--primary"})}),a.jsx(te,{title:"Edit Reel",size:"icon-sm",asChild:!0,className:"ecr-admin-reel-card__action",children:a.jsx(ht,{to:`?view=${X.cr}&from=${X.ar}&sid=${e.id}`,children:a.jsx(Or,{className:"ecr-admin-reel-card__icon"})})}),a.jsx(te,{onClick:()=>o(e.id),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--danger",size:"icon-sm",title:"Remove Reel",children:a.jsx(Vn,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"})})]}),a.jsx("div",{style:{clipPath:"polygon(0% 0, 100% 100%, 100% 0)"},className:F("ecr-admin-reel-card__corner",s?"":"ecr-admin-reel-card__corner--hidden",r?"ecr-admin-reel-card__corner--selected":"ecr-admin-reel-card__corner--idle"),children:a.jsx(te,{onClick:()=>n(e.id),size:"icon-sm",className:"ecr-admin-reel-card__select",children:r?a.jsx(Vp,{size:18,className:"ecr-admin-reel-card__check ecr-admin-reel-card__check--active"}):a.jsx(Wp,{size:18,className:"ecr-admin-reel-card__check"})})})]}),e.title&&a.jsx("p",{className:"ecr-admin-reel-card__title",children:e.title})]})}function Jp({reels:e,styles:t,selectedReelIds:r,onSelectReel:n,onDeleteReel:o,onPreviewReel:i,lastStoryElementRef:s}){return a.jsx("div",{className:"ecr-admin-reels-grid",children:e?.map((l,d)=>a.jsx("div",{ref:e.length===d+1?s:null,children:a.jsx(Xp,{reel:l,styles:t,isSelected:r.includes(l.id),onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:r.length>0})},l.id))})}const tr=({cb:e})=>{const t=Ne(),r=()=>{e?e():t(-1)};return a.jsx("button",{title:"Back",onClick:r,className:"ecr-admin-back-button",children:a.jsx(jp,{size:24})})};function Zp(e){return H({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"},child:[]}]})(e)}const rr=({breads:e=[],onNavigate:t})=>a.jsx("nav",{className:"ecr-admin-breadcrumb","aria-label":"Breadcrumb",children:a.jsx("ul",{className:"ecr-admin-breadcrumb__list",children:e.map((r,n)=>{const o=!r.href;return a.jsxs("li",{className:"ecr-admin-breadcrumb__item",children:[r.href&&!o?a.jsx(ht,{to:r.href,className:"ecr-admin-breadcrumb__link",onClick:i=>{if(!t)return;const s=r.href;s&&(i.preventDefault(),t(s))},children:r.label}):a.jsx("span",{className:"ecr-admin-breadcrumb__current",children:r.label}),n<e.length-1&&a.jsx(Zp,{className:"ecr-admin-breadcrumb__separator"})]},n)})})}),Rr=({onReject:e,onAccept:t,isLoading:r,message:n="Are you sure, You want to delete this story?"})=>{const o=y.useRef(null);return y.useEffect(()=>{o.current&&o.current.focus()},[]),a.jsx("div",{className:"ecr-admin-modal",children:a.jsxs("div",{ref:o,tabIndex:-1,className:"ecr-admin-modal__panel",onBlur:i=>{i.currentTarget.contains(i.relatedTarget)||e(null)},children:[a.jsxs("div",{className:"ecr-admin-modal__content",children:[a.jsx("div",{className:"ecr-admin-modal__icon",children:a.jsx(ip,{size:40,color:"#ffa500"})}),a.jsx("p",{className:"ecr-admin-modal__message",children:n})]}),a.jsxs("div",{className:"ecr-admin-modal__actions",children:[a.jsx("button",{disabled:r,onClick:()=>e(null),className:"ecr-admin-modal__button ecr-admin-modal__button--cancel",children:"No"}),a.jsxs("button",{disabled:r,onClick:t,className:"ecr-admin-modal__button ecr-admin-modal__button--danger",children:[r&&a.jsx(rt,{className:"ecr-admin-modal__spinner"}),"Yes"]})]})]})})},Lr=({to:e,Icon:t,textColor:r="#fff",text:n,className:o,onNavigate:i})=>a.jsxs(ht,{style:{color:r},to:e,className:F("ecr-admin-link-button",o),onClick:s=>{i&&(s.preventDefault(),i(e))},children:[t&&a.jsx(t,{}),n]}),Ir=({className:e})=>a.jsx("div",{className:F("ecr-admin-loader",e),children:a.jsx(rt,{className:"ecr-admin-loader__icon",size:64})}),vt=({left:e=[],center:t=[],right:r=[],leftClass:n="",centerClass:o="",rightClass:i=""})=>a.jsxs("div",{className:"ecr-admin-navbar",children:[a.jsx("div",{className:`ecr-admin-navbar__section ${n}`.trim(),children:e.map((s,l)=>a.jsx(y.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${o}`.trim(),children:t.map((s,l)=>a.jsx(y.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${i}`.trim(),children:r.map((s,l)=>a.jsx(y.Fragment,{children:s},l))})]}),_t=({name:e,Icon:t})=>a.jsxs("h1",{className:"ecr-admin-page-name",children:[a.jsx(t,{}),e]});function Qp(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M55 18v476h18v-37h46v37h274v-37h46v37h18V18h-18v37h-46V18h-18v60H137V18h-18v37H73V18H55zm18 55h46v46H73V73zm320 0h46v46h-46V73zm-256 41h238v156H137V114zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 201h46v46H73v-46zm320 0h46v46h-46v-46zM73 265h46v46H73v-46zm320 0h46v46h-46v-46zm-256 41h238v156H137V306zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 393h46v46H73v-46zm320 0h46v46h-46v-46z"},child:[]}]})(e)}const zr=()=>a.jsxs("div",{className:"ecr-admin-widget-name",children:[a.jsx(Qp,{}),"ReelsWP"]});function pi(e,t){return function(){return e.apply(t,arguments)}}const{toString:em}=Object.prototype,{getPrototypeOf:Zn}=Object,{iterator:Mr,toStringTag:mi}=Symbol,Dr=(e=>t=>{const r=em.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),we=e=>(e=e.toLowerCase(),t=>Dr(t)===e),Fr=e=>t=>typeof t===e,{isArray:yt}=Array,wt=Fr("undefined");function nr(e){return e!==null&&!wt(e)&&e.constructor!==null&&!wt(e.constructor)&&me(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const fi=we("ArrayBuffer");function tm(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&fi(e.buffer),t}const rm=Fr("string"),me=Fr("function"),hi=Fr("number"),or=e=>e!==null&&typeof e=="object",nm=e=>e===!0||e===!1,$r=e=>{if(Dr(e)!=="object")return!1;const t=Zn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(mi in e)&&!(Mr in e)},om=e=>{if(!or(e)||nr(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},am=we("Date"),im=we("File"),sm=we("Blob"),lm=we("FileList"),cm=e=>or(e)&&me(e.pipe),dm=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||me(e.append)&&((t=Dr(e))==="formdata"||t==="object"&&me(e.toString)&&e.toString()==="[object FormData]"))},um=we("URLSearchParams"),[pm,mm,fm,hm]=["ReadableStream","Request","Response","Headers"].map(we),gm=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ar(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),yt(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(nr(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let l;for(n=0;n<s;n++)l=i[n],t.call(null,e[l],l,e)}}function gi(e,t){if(nr(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const at=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,xi=e=>!wt(e)&&e!==at;function Qn(){const{caseless:e,skipUndefined:t}=xi(this)&&this||{},r={},n=(o,i)=>{const s=e&&gi(r,i)||i;$r(r[s])&&$r(o)?r[s]=Qn(r[s],o):$r(o)?r[s]=Qn({},o):yt(o)?r[s]=o.slice():(!t||!wt(o))&&(r[s]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&ar(arguments[o],n);return r}const xm=(e,t,r,{allOwnKeys:n}={})=>(ar(t,(o,i)=>{r&&me(o)?e[i]=pi(o,r):e[i]=o},{allOwnKeys:n}),e),bm=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),vm=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},_m=(e,t,r,n)=>{let o,i,s;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!l[s]&&(t[s]=e[s],l[s]=!0);e=r!==!1&&Zn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},ym=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},wm=e=>{if(!e)return null;if(yt(e))return e;let t=e.length;if(!hi(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},jm=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Zn(Uint8Array)),Sm=(e,t)=>{const n=(e&&e[Mr]).call(e);let o;for(;(o=n.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},Cm=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},km=we("HTMLFormElement"),Nm=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),bi=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Em=we("RegExp"),vi=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ar(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},Tm=e=>{vi(e,(t,r)=>{if(me(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(me(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Am=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return yt(e)?n(e):n(String(e).split(t)),r},Pm=()=>{},Om=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Rm(e){return!!(e&&me(e.append)&&e[mi]==="FormData"&&e[Mr])}const Lm=e=>{const t=new Array(10),r=(n,o)=>{if(or(n)){if(t.indexOf(n)>=0)return;if(nr(n))return n;if(!("toJSON"in n)){t[o]=n;const i=yt(n)?[]:{};return ar(n,(s,l)=>{const d=r(s,o+1);!wt(d)&&(i[l]=d)}),t[o]=void 0,i}}return n};return r(e,0)},Im=we("AsyncFunction"),zm=e=>e&&(or(e)||me(e))&&me(e.then)&&me(e.catch),_i=((e,t)=>e?setImmediate:t?((r,n)=>(at.addEventListener("message",({source:o,data:i})=>{o===at&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),at.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",me(at.postMessage)),Mm=typeof queueMicrotask<"u"?queueMicrotask.bind(at):typeof process<"u"&&process.nextTick||_i,S={isArray:yt,isArrayBuffer:fi,isBuffer:nr,isFormData:dm,isArrayBufferView:tm,isString:rm,isNumber:hi,isBoolean:nm,isObject:or,isPlainObject:$r,isEmptyObject:om,isReadableStream:pm,isRequest:mm,isResponse:fm,isHeaders:hm,isUndefined:wt,isDate:am,isFile:im,isBlob:sm,isRegExp:Em,isFunction:me,isStream:cm,isURLSearchParams:um,isTypedArray:jm,isFileList:lm,forEach:ar,merge:Qn,extend:xm,trim:gm,stripBOM:bm,inherits:vm,toFlatObject:_m,kindOf:Dr,kindOfTest:we,endsWith:ym,toArray:wm,forEachEntry:Sm,matchAll:Cm,isHTMLForm:km,hasOwnProperty:bi,hasOwnProp:bi,reduceDescriptors:vi,freezeMethods:Tm,toObjectSet:Am,toCamelCase:Nm,noop:Pm,toFiniteNumber:Om,findKey:gi,global:at,isContextDefined:xi,isSpecCompliantForm:Rm,toJSONObject:Lm,isAsyncFn:Im,isThenable:zm,setImmediate:_i,asap:Mm,isIterable:e=>e!=null&&me(e[Mr])};function U(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}S.inherits(U,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:S.toJSONObject(this.config),code:this.code,status:this.status}}});const yi=U.prototype,wi={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{wi[e]={value:e}}),Object.defineProperties(U,wi),Object.defineProperty(yi,"isAxiosError",{value:!0}),U.from=(e,t,r,n,o,i)=>{const s=Object.create(yi);S.toFlatObject(e,s,function(u){return u!==Error.prototype},c=>c!=="isAxiosError");const l=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return U.call(s,l,d,r,n,o),e&&s.cause==null&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const Dm=null;function eo(e){return S.isPlainObject(e)||S.isArray(e)}function ji(e){return S.endsWith(e,"[]")?e.slice(0,-2):e}function Si(e,t,r){return e?e.concat(t).map(function(o,i){return o=ji(o),!r&&i?"["+o+"]":o}).join(r?".":""):t}function Fm(e){return S.isArray(e)&&!e.some(eo)}const $m=S.toFlatObject(S,{},null,function(t){return/^is[A-Z]/.test(t)});function Br(e,t,r){if(!S.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=S.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,h){return!S.isUndefined(h[f])});const n=r.metaTokens,o=r.visitor||u,i=r.dots,s=r.indexes,d=(r.Blob||typeof Blob<"u"&&Blob)&&S.isSpecCompliantForm(t);if(!S.isFunction(o))throw new TypeError("visitor must be a function");function c(b){if(b===null)return"";if(S.isDate(b))return b.toISOString();if(S.isBoolean(b))return b.toString();if(!d&&S.isBlob(b))throw new U("Blob is not supported. Use a Buffer instead.");return S.isArrayBuffer(b)||S.isTypedArray(b)?d&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function u(b,f,h){let v=b;if(b&&!h&&typeof b=="object"){if(S.endsWith(f,"{}"))f=n?f:f.slice(0,-2),b=JSON.stringify(b);else if(S.isArray(b)&&Fm(b)||(S.isFileList(b)||S.endsWith(f,"[]"))&&(v=S.toArray(b)))return f=ji(f),v.forEach(function(w,j){!(S.isUndefined(w)||w===null)&&t.append(s===!0?Si([f],j,i):s===null?f:f+"[]",c(w))}),!1}return eo(b)?!0:(t.append(Si(h,f,i),c(b)),!1)}const p=[],m=Object.assign($m,{defaultVisitor:u,convertValue:c,isVisitable:eo});function g(b,f){if(!S.isUndefined(b)){if(p.indexOf(b)!==-1)throw Error("Circular reference detected in "+f.join("."));p.push(b),S.forEach(b,function(v,_){(!(S.isUndefined(v)||v===null)&&o.call(t,v,S.isString(_)?_.trim():_,f,m))===!0&&g(v,f?f.concat(_):[_])}),p.pop()}}if(!S.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Ci(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function to(e,t){this._pairs=[],e&&Br(e,this,t)}const ki=to.prototype;ki.append=function(t,r){this._pairs.push([t,r])},ki.toString=function(t){const r=t?function(n){return t.call(this,n,Ci)}:Ci;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Bm(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ni(e,t,r){if(!t)return e;const n=r&&r.encode||Bm;S.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(o?i=o(t,r):i=S.isURLSearchParams(t)?t.toString():new to(t,r).toString(n),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ei{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){S.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Ti={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Um={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:to,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ro=typeof window<"u"&&typeof document<"u",no=typeof navigator=="object"&&navigator||void 0,Hm=ro&&(!no||["ReactNative","NativeScript","NS"].indexOf(no.product)<0),Vm=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Wm=ro&&window.location.href||"http://localhost",de={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ro,hasStandardBrowserEnv:Hm,hasStandardBrowserWebWorkerEnv:Vm,navigator:no,origin:Wm},Symbol.toStringTag,{value:"Module"})),...Um};function qm(e,t){return Br(e,new de.classes.URLSearchParams,{visitor:function(r,n,o,i){return de.isNode&&S.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function Gm(e){return S.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Km(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}function Ai(e){function t(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const l=Number.isFinite(+s),d=i>=r.length;return s=!s&&S.isArray(o)?o.length:s,d?(S.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!l):((!o[s]||!S.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&S.isArray(o[s])&&(o[s]=Km(o[s])),!l)}if(S.isFormData(e)&&S.isFunction(e.entries)){const r={};return S.forEachEntry(e,(n,o)=>{t(Gm(n),o,r,0)}),r}return null}function Ym(e,t,r){if(S.isString(e))try{return(t||JSON.parse)(e),S.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const ir={transitional:Ti,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=S.isObject(t);if(i&&S.isHTMLForm(t)&&(t=new FormData(t)),S.isFormData(t))return o?JSON.stringify(Ai(t)):t;if(S.isArrayBuffer(t)||S.isBuffer(t)||S.isStream(t)||S.isFile(t)||S.isBlob(t)||S.isReadableStream(t))return t;if(S.isArrayBufferView(t))return t.buffer;if(S.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return qm(t,this.formSerializer).toString();if((l=S.isFileList(t))||n.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Br(l?{"files[]":t}:t,d&&new d,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),Ym(t)):t}],transformResponse:[function(t){const r=this.transitional||ir.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(S.isResponse(t)||S.isReadableStream(t))return t;if(t&&S.isString(t)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(l){if(s)throw l.name==="SyntaxError"?U.from(l,U.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:de.classes.FormData,Blob:de.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};S.forEach(["delete","get","head","post","put","patch"],e=>{ir.headers[e]={}});const Xm=S.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Jm=e=>{const t={};let r,n,o;return e&&e.split(`
    214 `).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||t[r]&&Xm[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Pi=Symbol("internals");function sr(e){return e&&String(e).trim().toLowerCase()}function Ur(e){return e===!1||e==null?e:S.isArray(e)?e.map(Ur):String(e)}function Zm(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const Qm=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function oo(e,t,r,n,o){if(S.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!S.isString(t)){if(S.isString(n))return t.indexOf(n)!==-1;if(S.isRegExp(n))return n.test(t)}}function ef(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function tf(e,t){const r=S.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,i,s){return this[n].call(this,t,o,i,s)},configurable:!0})})}let fe=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function i(l,d,c){const u=sr(d);if(!u)throw new Error("header name must be a non-empty string");const p=S.findKey(o,u);(!p||o[p]===void 0||c===!0||c===void 0&&o[p]!==!1)&&(o[p||d]=Ur(l))}const s=(l,d)=>S.forEach(l,(c,u)=>i(c,u,d));if(S.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(S.isString(t)&&(t=t.trim())&&!Qm(t))s(Jm(t),r);else if(S.isObject(t)&&S.isIterable(t)){let l={},d,c;for(const u of t){if(!S.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[c=u[0]]=(d=l[c])?S.isArray(d)?[...d,u[1]]:[d,u[1]]:u[1]}s(l,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=sr(t),t){const n=S.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return Zm(o);if(S.isFunction(r))return r.call(this,o,n);if(S.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=sr(t),t){const n=S.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||oo(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function i(s){if(s=sr(s),s){const l=S.findKey(n,s);l&&(!r||oo(n,n[l],l,r))&&(delete n[l],o=!0)}}return S.isArray(t)?t.forEach(i):i(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const i=r[n];(!t||oo(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const r=this,n={};return S.forEach(this,(o,i)=>{const s=S.findKey(n,i);if(s){r[s]=Ur(o),delete r[i];return}const l=t?ef(i):String(i).trim();l!==i&&delete r[i],r[l]=Ur(o),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return S.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&S.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
    215 `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Pi]=this[Pi]={accessors:{}}).accessors,o=this.prototype;function i(s){const l=sr(s);n[l]||(tf(o,s),n[l]=!0)}return S.isArray(t)?t.forEach(i):i(t),this}};fe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),S.reduceDescriptors(fe.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),S.freezeMethods(fe);function ao(e,t){const r=this||ir,n=t||r,o=fe.from(n.headers);let i=n.data;return S.forEach(e,function(l){i=l.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Oi(e){return!!(e&&e.__CANCEL__)}function jt(e,t,r){U.call(this,e??"canceled",U.ERR_CANCELED,t,r),this.name="CanceledError"}S.inherits(jt,U,{__CANCEL__:!0});function Ri(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new U("Request failed with status code "+r.status,[U.ERR_BAD_REQUEST,U.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function rf(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function nf(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(d){const c=Date.now(),u=n[i];s||(s=c),r[o]=d,n[o]=c;let p=i,m=0;for(;p!==o;)m+=r[p++],p=p%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-s<t)return;const g=u&&c-u;return g?Math.round(m*1e3/g):void 0}}function of(e,t){let r=0,n=1e3/t,o,i;const s=(c,u=Date.now())=>{r=u,o=null,i&&(clearTimeout(i),i=null),e(...c)};return[(...c)=>{const u=Date.now(),p=u-r;p>=n?s(c,u):(o=c,i||(i=setTimeout(()=>{i=null,s(o)},n-p)))},()=>o&&s(o)]}const Hr=(e,t,r=3)=>{let n=0;const o=nf(50,250);return of(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,d=s-n,c=o(d),u=s<=l;n=s;const p={loaded:s,total:l,progress:l?s/l:void 0,bytes:d,rate:c||void 0,estimated:c&&l&&u?(l-s)/c:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(p)},r)},Li=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ii=e=>(...t)=>S.asap(()=>e(...t)),af=de.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,de.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(de.origin),de.navigator&&/(msie|trident)/i.test(de.navigator.userAgent)):()=>!0,sf=de.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];S.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),S.isString(n)&&l.push(`path=${n}`),S.isString(o)&&l.push(`domain=${o}`),i===!0&&l.push("secure"),S.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function lf(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function cf(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function zi(e,t,r){let n=!lf(t);return e&&(n||r==!1)?cf(e,t):t}const Mi=e=>e instanceof fe?{...e}:e;function it(e,t){t=t||{};const r={};function n(c,u,p,m){return S.isPlainObject(c)&&S.isPlainObject(u)?S.merge.call({caseless:m},c,u):S.isPlainObject(u)?S.merge({},u):S.isArray(u)?u.slice():u}function o(c,u,p,m){if(S.isUndefined(u)){if(!S.isUndefined(c))return n(void 0,c,p,m)}else return n(c,u,p,m)}function i(c,u){if(!S.isUndefined(u))return n(void 0,u)}function s(c,u){if(S.isUndefined(u)){if(!S.isUndefined(c))return n(void 0,c)}else return n(void 0,u)}function l(c,u,p){if(p in t)return n(c,u);if(p in e)return n(void 0,c)}const d={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(c,u,p)=>o(Mi(c),Mi(u),p,!0)};return S.forEach(Object.keys({...e,...t}),function(u){const p=d[u]||o,m=p(e[u],t[u],u);S.isUndefined(m)&&p!==l||(r[u]=m)}),r}const Di=e=>{const t=it({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:l}=t;if(t.headers=s=fe.from(s),t.url=Ni(zi(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),S.isFormData(r)){if(de.hasStandardBrowserEnv||de.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(S.isFunction(r.getHeaders)){const d=r.getHeaders(),c=["content-type","content-length"];Object.entries(d).forEach(([u,p])=>{c.includes(u.toLowerCase())&&s.set(u,p)})}}if(de.hasStandardBrowserEnv&&(n&&S.isFunction(n)&&(n=n(t)),n||n!==!1&&af(t.url))){const d=o&&i&&sf.read(i);d&&s.set(o,d)}return t},df=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Di(e);let i=o.data;const s=fe.from(o.headers).normalize();let{responseType:l,onUploadProgress:d,onDownloadProgress:c}=o,u,p,m,g,b;function f(){g&&g(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let h=new XMLHttpRequest;h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout;function v(){if(!h)return;const w=fe.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),C={data:!l||l==="text"||l==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:w,config:e,request:h};Ri(function(k){r(k),f()},function(k){n(k),f()},C),h=null}"onloadend"in h?h.onloadend=v:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(v)},h.onabort=function(){h&&(n(new U("Request aborted",U.ECONNABORTED,e,h)),h=null)},h.onerror=function(j){const C=j&&j.message?j.message:"Network Error",N=new U(C,U.ERR_NETWORK,e,h);N.event=j||null,n(N),h=null},h.ontimeout=function(){let j=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const C=o.transitional||Ti;o.timeoutErrorMessage&&(j=o.timeoutErrorMessage),n(new U(j,C.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,e,h)),h=null},i===void 0&&s.setContentType(null),"setRequestHeader"in h&&S.forEach(s.toJSON(),function(j,C){h.setRequestHeader(C,j)}),S.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),l&&l!=="json"&&(h.responseType=o.responseType),c&&([m,b]=Hr(c,!0),h.addEventListener("progress",m)),d&&h.upload&&([p,g]=Hr(d),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(u=w=>{h&&(n(!w||w.type?new jt(null,e,h):w),h.abort(),h=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const _=rf(o.url);if(_&&de.protocols.indexOf(_)===-1){n(new U("Unsupported protocol "+_+":",U.ERR_BAD_REQUEST,e));return}h.send(i||null)})},uf=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const i=function(c){if(!o){o=!0,l();const u=c instanceof Error?c:this.reason;n.abort(u instanceof U?u:new jt(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,i(new U(`timeout ${t} of ms exceeded`,U.ETIMEDOUT))},t);const l=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),e=null)};e.forEach(c=>c.addEventListener("abort",i));const{signal:d}=n;return d.unsubscribe=()=>S.asap(l),d}},pf=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},mf=async function*(e,t){for await(const r of ff(e))yield*pf(r,t)},ff=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Fi=(e,t,r,n)=>{const o=mf(e,t);let i=0,s,l=d=>{s||(s=!0,n&&n(d))};return new ReadableStream({async pull(d){try{const{done:c,value:u}=await o.next();if(c){l(),d.close();return}let p=u.byteLength;if(r){let m=i+=p;r(m)}d.enqueue(new Uint8Array(u))}catch(c){throw l(c),c}},cancel(d){return l(d),o.return()}},{highWaterMark:2})},$i=64*1024,{isFunction:Vr}=S,hf=(({Request:e,Response:t})=>({Request:e,Response:t}))(S.global),{ReadableStream:Bi,TextEncoder:Ui}=S.global,Hi=(e,...t)=>{try{return!!e(...t)}catch{return!1}},gf=e=>{e=S.merge.call({skipUndefined:!0},hf,e);const{fetch:t,Request:r,Response:n}=e,o=t?Vr(t):typeof fetch=="function",i=Vr(r),s=Vr(n);if(!o)return!1;const l=o&&Vr(Bi),d=o&&(typeof Ui=="function"?(b=>f=>b.encode(f))(new Ui):async b=>new Uint8Array(await new r(b).arrayBuffer())),c=i&&l&&Hi(()=>{let b=!1;const f=new r(de.origin,{body:new Bi,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!f}),u=s&&l&&Hi(()=>S.isReadableStream(new n("").body)),p={stream:u&&(b=>b.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!p[b]&&(p[b]=(f,h)=>{let v=f&&f[b];if(v)return v.call(f);throw new U(`Response type '${b}' is not supported`,U.ERR_NOT_SUPPORT,h)})});const m=async b=>{if(b==null)return 0;if(S.isBlob(b))return b.size;if(S.isSpecCompliantForm(b))return(await new r(de.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(S.isArrayBufferView(b)||S.isArrayBuffer(b))return b.byteLength;if(S.isURLSearchParams(b)&&(b=b+""),S.isString(b))return(await d(b)).byteLength},g=async(b,f)=>{const h=S.toFiniteNumber(b.getContentLength());return h??m(f)};return async b=>{let{url:f,method:h,data:v,signal:_,cancelToken:w,timeout:j,onDownloadProgress:C,onUploadProgress:N,responseType:k,headers:E,withCredentials:T="same-origin",fetchOptions:A}=Di(b),O=t||fetch;k=k?(k+"").toLowerCase():"text";let R=uf([_,w&&w.toAbortSignal()],j),L=null;const P=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let M;try{if(N&&c&&h!=="get"&&h!=="head"&&(M=await g(E,v))!==0){let ie=new r(f,{method:"POST",body:v,duplex:"half"}),ge;if(S.isFormData(v)&&(ge=ie.headers.get("content-type"))&&E.setContentType(ge),ie.body){const[ve,pe]=Li(M,Hr(Ii(N)));v=Fi(ie.body,$i,ve,pe)}}S.isString(T)||(T=T?"include":"omit");const I=i&&"credentials"in r.prototype,B={...A,signal:R,method:h.toUpperCase(),headers:E.normalize().toJSON(),body:v,duplex:"half",credentials:I?T:void 0};L=i&&new r(f,B);let z=await(i?O(L,A):O(f,B));const q=u&&(k==="stream"||k==="response");if(u&&(C||q&&P)){const ie={};["status","statusText","headers"].forEach(G=>{ie[G]=z[G]});const ge=S.toFiniteNumber(z.headers.get("content-length")),[ve,pe]=C&&Li(ge,Hr(Ii(C),!0))||[];z=new n(Fi(z.body,$i,ve,()=>{pe&&pe(),P&&P()}),ie)}k=k||"text";let ae=await p[S.findKey(p,k)||"text"](z,b);return!q&&P&&P(),await new Promise((ie,ge)=>{Ri(ie,ge,{data:ae,headers:fe.from(z.headers),status:z.status,statusText:z.statusText,config:b,request:L})})}catch(I){throw P&&P(),I&&I.name==="TypeError"&&/Load failed|fetch/i.test(I.message)?Object.assign(new U("Network Error",U.ERR_NETWORK,b,L),{cause:I.cause||I}):U.from(I,I&&I.code,b,L)}}},xf=new Map,Vi=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s=i.length,l=s,d,c,u=xf;for(;l--;)d=i[l],c=u.get(d),c===void 0&&u.set(d,c=l?new Map:gf(t)),u=c;return c};Vi();const io={http:Dm,xhr:df,fetch:{get:Vi}};S.forEach(io,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Wi=e=>`- ${e}`,bf=e=>S.isFunction(e)||e===null||e===!1;function vf(e,t){e=S.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){n=e[s];let l;if(o=n,!bf(n)&&(o=io[(l=String(n)).toLowerCase()],o===void 0))throw new U(`Unknown adapter '${l}'`);if(o&&(S.isFunction(o)||(o=o.get(t))))break;i[l||"#"+s]=o}if(!o){const s=Object.entries(i).map(([d,c])=>`adapter ${d} `+(c===!1?"is not supported by the environment":"is not available in the build"));let l=r?s.length>1?`since :
     213`,Tr=16,Hu=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:i,containerStyle:s,containerClassName:l})=>{let{toasts:c,handlers:d}=xu(r,i);return x.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:Tr,left:Tr,right:Tr,bottom:Tr,pointerEvents:"none",...s},className:l,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(u=>{let p=u.position||t,m=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),g=Bu(p,m);return x.createElement($u,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?Uu:"",style:g},u.type==="custom"?kr(u.message,u):o?o(u):x.createElement(Fu,{toast:u,position:p}))}))},K=ne;const Ja={carousel:"carousel",grid:"grid"},Vu=["marquee","stacked"],tt={topBottomSpacing:0,gap:16,gapOnTab:16,gapOnMobile:16,shape:"rectangle",size:200,sizeOnTab:150,sizeOnMobile:150,hoverEffect:"none",border:{border_width:2,border_color:"#9ca3af",border_radius:6},shadow:{shadow_size:16},template:Ja.carousel,appearance:"overlay",widgetTitle:{alignment:"hidden",fontSize:24,color:"#000000"},playerAppearance:"overlay"},X={settings:"settings",stat:"statistics",cr:"create-reel",mg:"manage-group",ag:"all-groups",ar:"all-reels"},Wu=[{label:"None",value:"none"},{label:"zoom in",value:"zoom-in"},{label:"zoom out",value:"zoom-out"}],Za=[{label:"Horizontal",value:"horizontal"}],qu=[{label:"Vertical",value:"vertical"}],Gu=[{label:"Overlay",value:"overlay"},{label:"Only Title",value:"title"},{label:"None",value:"none"}],Ku=[{label:"Modern",value:"modern"},{label:"Classic",value:"classic"}],Yu=[{label:"Overlay",value:"overlay"},{label:"Only Tile",value:"title"},{label:"None",value:"none"}];var Qa={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ei=y.createContext&&y.createContext(Qa),Xu=["attr","size","title"];function Ju(e,t){if(e==null)return{};var r=Zu(e,t),n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Zu(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ar(){return Ar=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ar.apply(this,arguments)}function ti(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Pr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ti(Object(r),!0).forEach(function(n){Qu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ti(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Qu(e,t,r){return t=ep(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ep(e){var t=tp(e,"string");return typeof t=="symbol"?t:t+""}function tp(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ri(e){return e&&e.map((t,r)=>y.createElement(t.tag,Pr({key:r},t.attr),ri(t.child)))}function H(e){return t=>y.createElement(rp,Ar({attr:Pr({},e.attr)},t),ri(e.child))}function rp(e){var t=r=>{var{attr:n,size:o,title:i}=e,s=Ju(e,Xu),l=o||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),y.createElement("svg",Ar({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:c,style:Pr(Pr({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&y.createElement("title",null,i),e.children)};return ei!==void 0?y.createElement(ei.Consumer,null,r=>t(r)):t(Qa)}function np(e){return H({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M164.44,105.34l-48-32A8,8,0,0,0,104,80v64a8,8,0,0,0,12.44,6.66l48-32a8,8,0,0,0,0-13.32ZM120,129.05V95l25.58,17ZM216,40H40A16,16,0,0,0,24,56V168a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,128H40V56H216V168Zm16,40a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16H224A8,8,0,0,1,232,208Z"},child:[]}]})(e)}function _t(e){return H({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17 10h-1v-2c0-2.205-1.794-4-4-4s-4 1.795-4 4v2h-1c-1.103 0-2 .896-2 2v7c0 1.104.897 2 2 2h10c1.103 0 2-.896 2-2v-7c0-1.104-.897-2-2-2zm-5 8.299c-.719 0-1.3-.58-1.3-1.299s.581-1.301 1.3-1.301 1.3.582 1.3 1.301-.581 1.299-1.3 1.299zm2-7.299h-4v-3c0-1.104.897-2 2-2s2 .896 2 2v3z"},child:[]}]})(e)}function vt(e){return H({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18 10h-4v-4c0-1.104-.896-2-2-2s-2 .896-2 2l.071 4h-4.071c-1.104 0-2 .896-2 2s.896 2 2 2l4.071-.071-.071 4.071c0 1.104.896 2 2 2s2-.896 2-2v-4.071l4 .071c1.104 0 2-.896 2-2s-.896-2-2-2z"},child:[]}]})(e)}function Qt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m15 18-6-6 6-6"},child:[]}]})(e)}function er(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m9 18 6-6-6-6"},child:[]}]})(e)}function op(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"},child:[]}]})(e)}function ap(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]}]})(e)}function rt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12a9 9 0 1 1-6.219-8.56"},child:[]}]})(e)}function ip(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"},child:[]},{tag:"path",attr:{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7"},child:[]},{tag:"path",attr:{d:"M7 3v4a1 1 0 0 0 1 1h7"},child:[]}]})(e)}function ni(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"path",attr:{d:"m21 21-4.3-4.3"},child:[]}]})(e)}function sp(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},child:[]},{tag:"path",attr:{d:"M12 9v4"},child:[]},{tag:"path",attr:{d:"M12 17h.01"},child:[]}]})(e)}function tr(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18 6 6 18"},child:[]},{tag:"path",attr:{d:"m6 6 12 12"},child:[]}]})(e)}function Vn(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function lp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function cp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},child:[]}]})(e)}function dp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM12 5.5v9l6-4.5z"},child:[]}]})(e)}function up(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M12 6.5a9.77 9.77 0 0 1 8.82 5.5c-1.65 3.37-5.02 5.5-8.82 5.5S4.83 15.37 3.18 12A9.77 9.77 0 0 1 12 6.5m0-2C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zm0 5a2.5 2.5 0 0 1 0 5 2.5 2.5 0 0 1 0-5m0-2c-2.48 0-4.5 2.02-4.5 4.5s2.02 4.5 4.5 4.5 4.5-2.02 4.5-4.5-2.02-4.5-4.5-4.5z"},child:[]}]})(e)}function oi(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Wn(...e){return t=>{let r=!1;const n=e.map(o=>{const i=oi(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():oi(e[o],null)}}}}function J(...e){return x.useCallback(Wn(...e),e)}function nt(e){const t=mp(e),r=x.forwardRef((n,o)=>{const{children:i,...s}=n,l=x.Children.toArray(i),c=l.find(hp);if(c){const d=c.props.children,u=l.map(p=>p===c?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var pp=nt("Slot");function mp(e){const t=x.forwardRef((r,n)=>{const{children:o,...i}=r;if(x.isValidElement(o)){const s=xp(o),l=gp(i,o.props);return o.type!==x.Fragment&&(l.ref=n?Wn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fp=Symbol("radix.slottable");function hp(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fp}function gp(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function xp(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function ai(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=ai(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function bp(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=ai(e))&&(n&&(n+=" "),n+=t);return n}function F(...e){return bp(e)}const _p="ecr-button",vp={default:"ecr-button--primary",destructive:"ecr-button--danger",outline:"ecr-button--outline","outline-danger":"ecr-button--outline-danger",secondary:"ecr-button--secondary",ghost:"ecr-button--ghost",link:"ecr-button--link"},yp={default:"ecr-button--md",sm:"ecr-button--sm",lg:"ecr-button--lg",icon:"ecr-button--icon","icon-sm":"ecr-button--icon-sm","icon-lg":"ecr-button--icon-lg"};function te({className:e,variant:t="default",size:r="default",asChild:n=!1,...o}){const i=n?pp:"button";return a.jsx(i,{"data-slot":"button","data-variant":t,"data-size":r,className:F(_p,vp[t],yp[r],e),...o})}function jp({selectedReelIds:e,handleSelectAll:t,clearSelection:r,searchTerm:n,setSearchTerm:o,isCreating:i,handleCreateGroup:s,handleBulkDelete:l}){return a.jsxs("div",{className:"ecr-admin-reels-header",children:[a.jsxs("div",{className:"ecr-admin-reels-header__left",children:[a.jsx("h2",{className:"ecr-admin-reels-header__title",children:"Reels"}),e.length?a.jsxs("div",{className:"ecr-admin-reels-header__actions",children:[a.jsx(te,{onClick:t,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--primary",children:"Select all"}),a.jsx(te,{onClick:r,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--danger",children:"Clear"}),a.jsxs(te,{variant:"outline-danger",size:"sm",onClick:l,children:[a.jsx(Vn,{size:22,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"}),"Delete Selected"]})]}):null]}),a.jsxs("div",{className:"ecr-admin-reels-header__right",children:[a.jsxs("div",{className:"ecr-admin-reels-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:c=>o(c.target.value),className:"ecr-admin-search-input"}),a.jsxs("div",{className:"ecr-admin-reels-header__icon-wrapper",children:[n&&a.jsx(te,{onClick:()=>o(""),variant:"link",size:"icon-sm",children:a.jsx(tr,{size:16,className:"ecr-admin-reels-header__clear-icon"})}),a.jsx(ni,{size:16,className:"ecr-admin-reels-header__search-icon"})]})," "]}),e.length?a.jsxs(te,{disabled:i,onClick:s,className:"ecr-admin-reels-header__create",children:[i?a.jsx(rt,{className:"ecr-admin-reels-header__spinner"}):a.jsx(vt,{})," ","Create Widget"]}):null]})]})}function Sp(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m112 160-64 64 64 64"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M64 224h294c58.76 0 106 49.33 106 108v20"},child:[]}]})(e)}function Cp(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M262.29 192.31a64 64 0 1 0 57.4 57.4 64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22 155.3 155.3 0 0 1-21.46-12.57 16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22 155.3 155.3 0 0 1 21.46 12.57 16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z"},child:[]}]})(e)}function ot(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M85.57 446.25h340.86a32 32 0 0 0 28.17-47.17L284.18 82.58c-12.09-22.44-44.27-22.44-56.36 0L57.4 399.08a32 32 0 0 0 28.17 47.17z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m250.26 195.39 5.74 122 5.73-121.95a5.74 5.74 0 0 0-5.79-6h0a5.74 5.74 0 0 0-5.68 5.95z"},child:[]},{tag:"path",attr:{d:"M256 397.25a20 20 0 1 1 20-20 20 20 0 0 1-20 20z"},child:[]}]})(e)}function kp(){return a.jsx("div",{className:"ecr-admin-reels-empty",children:a.jsxs("p",{className:"ecr-admin-reels-empty__text",children:[a.jsx(ot,{color:"#FFA500",size:40}),a.jsx("span",{children:"You did not have any reel yet."})]})})}function Np({isFullScreen:e}){return a.jsx("div",{className:F("ecr-admin-reels-loading",e&&"ecr-admin-reels-loading--fullscreen"),children:a.jsx(rt,{className:"ecr-admin-reels-loading__icon"})})}const ii=({playingStory:e,duration:t,currentFileIndex:r,isPaused:n})=>a.jsx("div",{className:"ecr-player__progress",children:e?.files?.map((o,i)=>a.jsx("div",{className:"ecr-player__progress-track",children:a.jsx("div",{style:{"--reels-wp-animation-time":`${t}s`,animationPlayState:n?"paused":"running"},className:F("ecr-player__progress-fill",i===r?.index?"ecr-player__progress-fill--active":i<r?.index?"ecr-player__progress-fill--complete":"ecr-player__progress-fill--empty")})},i))}),yt=({className:e,children:t,...r})=>a.jsx("button",{className:F("ecr-player__nav",e),...r,children:t});function qn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4.5 3H6v10H4.5V3zm7 0v10H10V3h1.5z"},child:[]}]})(e)}function Gn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 5h2.79l3.86-3.83.85.35v13l-.85.33L4.29 11H1.5l-.5-.5v-5l.5-.5zm3.35 5.17L8 13.31V2.73L4.85 5.85 4.5 6H2v4h2.5l.35.17zm9.381-4.108l.707.707L13.207 8.5l1.731 1.732-.707.707L12.5 9.207l-1.732 1.732-.707-.707L11.793 8.5 10.06 6.77l.707-.707 1.733 1.73 1.731-1.731z"},child:[]}]})(e)}function Kn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3.78 2L3 2.41v12l.78.42 9-6V8l-9-6zM4 13.48V3.35l7.6 5.07L4 13.48z"},child:[]}]})(e)}function Yn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 4.83h2.79L8.15 1l.85.35v13l-.85.33-3.86-3.85H1.5l-.5-.5v-5l.5-.5zM4.85 10L8 13.14V2.56L4.85 5.68l-.35.15H2v4h2.5l.35.17zM15 7.83a6.97 6.97 0 0 1-1.578 4.428l-.712-.71A5.975 5.975 0 0 0 14 7.83c0-1.4-.48-2.689-1.284-3.71l.712-.71A6.971 6.971 0 0 1 15 7.83zm-2 0a4.978 4.978 0 0 1-1.002 3.004l-.716-.716A3.982 3.982 0 0 0 12 7.83a3.98 3.98 0 0 0-.713-2.28l.716-.716c.626.835.997 1.872.997 2.996zm-2 0c0 .574-.16 1.11-.44 1.566l-.739-.738a1.993 1.993 0 0 0 .005-1.647l.739-.739c.276.454.435.988.435 1.558z"},child:[]}]})(e)}const Ep="Left",Tp="Right",Ap="Up",Pp="Down",wt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Xn={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},si="mousemove",li="mouseup",Op="touchend",Rp="touchmove",Lp="touchstart";function Ip(e,t,r,n){return e>t?r>0?Tp:Ep:n>0?Pp:Ap}function ci(e,t){if(t===0)return e;const r=Math.PI/180*t,n=e[0]*Math.cos(r)+e[1]*Math.sin(r),o=e[1]*Math.cos(r)-e[0]*Math.sin(r);return[n,o]}function zp(e,t){const r=u=>{const p="touches"in u;p&&u.touches.length>1||e((m,g)=>{g.trackMouse&&!p&&(document.addEventListener(si,n),document.addEventListener(li,s));const{clientX:b,clientY:f}=p?u.touches[0]:u,h=ci([b,f],g.rotationAngle);return g.onTouchStartOrOnMouseDown&&g.onTouchStartOrOnMouseDown({event:u}),Object.assign(Object.assign(Object.assign({},m),Xn),{initial:h.slice(),xy:h,start:u.timeStamp||0})})},n=u=>{e((p,m)=>{const g="touches"in u;if(g&&u.touches.length>1)return p;if(u.timeStamp-p.start>m.swipeDuration)return p.swiping?Object.assign(Object.assign({},p),{swiping:!1}):p;const{clientX:b,clientY:f}=g?u.touches[0]:u,[h,_]=ci([b,f],m.rotationAngle),v=h-p.xy[0],w=_-p.xy[1],j=Math.abs(v),C=Math.abs(w),N=(u.timeStamp||0)-p.start,k=Math.sqrt(j*j+C*C)/(N||1),E=[v/(N||1),w/(N||1)],T=Ip(j,C,v,w),A=typeof m.delta=="number"?m.delta:m.delta[T.toLowerCase()]||wt.delta;if(j<A&&C<A&&!p.swiping)return p;const O={absX:j,absY:C,deltaX:v,deltaY:w,dir:T,event:u,first:p.first,initial:p.initial,velocity:k,vxvy:E};O.first&&m.onSwipeStart&&m.onSwipeStart(O),m.onSwiping&&m.onSwiping(O);let R=!1;return(m.onSwiping||m.onSwiped||m[`onSwiped${T}`])&&(R=!0),R&&m.preventScrollOnSwipe&&m.trackTouch&&u.cancelable&&u.preventDefault(),Object.assign(Object.assign({},p),{first:!1,eventData:O,swiping:!0})})},o=u=>{e((p,m)=>{let g;if(p.swiping&&p.eventData){if(u.timeStamp-p.start<m.swipeDuration){g=Object.assign(Object.assign({},p.eventData),{event:u}),m.onSwiped&&m.onSwiped(g);const b=m[`onSwiped${g.dir}`];b&&b(g)}}else m.onTap&&m.onTap({event:u});return m.onTouchEndOrOnMouseUp&&m.onTouchEndOrOnMouseUp({event:u}),Object.assign(Object.assign(Object.assign({},p),Xn),{eventData:g})})},i=()=>{document.removeEventListener(si,n),document.removeEventListener(li,s)},s=u=>{i(),o(u)},l=(u,p)=>{let m=()=>{};if(u&&u.addEventListener){const g=Object.assign(Object.assign({},wt.touchEventOptions),p.touchEventOptions),b=[[Lp,r,g],[Rp,n,Object.assign(Object.assign({},g),p.preventScrollOnSwipe?{passive:!1}:{})],[Op,o,g]];b.forEach(([f,h,_])=>u.addEventListener(f,h,_)),m=()=>b.forEach(([f,h])=>u.removeEventListener(f,h))}return m},d={ref:u=>{u!==null&&e((p,m)=>{if(p.el===u)return p;const g={};return p.el&&p.el!==u&&p.cleanUpTouch&&(p.cleanUpTouch(),g.cleanUpTouch=void 0),m.trackTouch&&u&&(g.cleanUpTouch=l(u,m)),Object.assign(Object.assign(Object.assign({},p),{el:u}),g)})}};return t.trackMouse&&(d.onMouseDown=r),[d,l]}function Mp(e,t,r,n){return!t.trackTouch||!e.el?(e.cleanUpTouch&&e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:void 0})):e.cleanUpTouch?t.preventScrollOnSwipe!==r.preventScrollOnSwipe||t.touchEventOptions.passive!==r.touchEventOptions.passive?(e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})):e:Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})}function Dp(e){const{trackMouse:t}=e,r=x.useRef(Object.assign({},Xn)),n=x.useRef(Object.assign({},wt)),o=x.useRef(Object.assign({},n.current));o.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},wt),e);let i;for(i in wt)n.current[i]===void 0&&(n.current[i]=wt[i]);const[s,l]=x.useMemo(()=>zp(c=>r.current=c(r.current,n.current),{trackMouse:t}),[t]);return r.current=Mp(r.current,n.current,o.current,l),s}const Fp=({videoRefs:e,file:t,isMuted:r,isPaused:n,i:o,togglePlayPause:i,handleNextFile:s,setDuration:l})=>{const[c,d]=y.useState(!1);return a.jsx("div",{className:"ecr-player__media-frame",children:a.jsx("video",{preload:"none",playsInline:!0,muted:r,autoPlay:!n,controls:!1,loop:!1,disablePictureInPicture:!0,controlsList:"nodownload noplaybackrate noremoteplayback",ref:u=>{u&&(e.current[o]=u,u.setAttribute("webkit-playsinline","true"),u.setAttribute("x-webkit-airplay","allow"),u.setAttribute("airplay","allow"))},className:c?"ecr-player__media ecr-player__media--portrait":"ecr-player__media",src:t?.url,onClick:()=>i(o),onEnded:s,onLoadedMetadata:u=>{const p=u.currentTarget,m=p.videoWidth,g=p.videoHeight;d(g>m),l(p.duration)}})})},di=({currentFileIndex:e,files:t,setDuration:r,setIsPlaying:n,setPreviewReel:o,isPaused:i,setIsPaused:s,handlePrevFile:l,handleNextFile:c})=>{const[d,u]=y.useState(!1),p=y.useRef([]);y.useEffect(()=>{p.current=[]},[t]);const m=h=>{const _=p.current[h];_&&(i?_.play():_.pause(),s(v=>!v))},g=h=>{const _=p.current[h];_&&(_.muted=!d,u(v=>!v))},b=typeof window<"u"&&window.matchMedia("(max-width: 767px)").matches,f=Dp({trackMouse:!0,onSwipedRight:l,onSwipedLeft:c,onSwipedUp:()=>{b&&c()},onSwipedDown:()=>{if(b){l();return}n&&n(null),o&&o(null)}});return a.jsx("div",{style:{left:`${-100*e?.index}%`},className:"ecr-player__slider",...f,children:Array.isArray(t)&&t.map((h,_)=>a.jsx("div",{className:"ecr-player__slide",children:h?.mime_type?.startsWith("image")?null:a.jsxs("div",{className:"ecr-player__media-frame",children:[a.jsx(Fp,{videoRefs:p,file:h,isMuted:d,i:_,togglePlayPause:m,handleNextFile:c,setDuration:r,isPaused:i},h.file_uuid),a.jsxs("div",{className:"ecr-player__controls",children:[i?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(_)}):a.jsx(qn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(_)}),d?a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(_)}):a.jsx(Yn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(_)})]})]})},_))})},$p=({previewReel:e,setPreviewReel:t})=>{const[r,n]=y.useState({index:0,story_uuid:e?.story_uuid}),[o,i]=y.useState(!1),[s,l]=y.useState(3);y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const c=()=>{const m=e?.files??[];r?.index>0?n(g=>({index:g.index-1,story_uuid:m[g.index-1].story_uuid})):t(null)},d=()=>{const m=e?.files??[];r?.index+1<m.length?n(g=>({index:g.index+1,story_uuid:m[g.index+1].story_uuid})):t(null)},u=e.files.length,p=m=>{m.target===m.currentTarget&&t(null)};return a.jsx("div",{onClick:p,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:e&&a.jsxs("div",{className:"ecr-player__stage",children:[u>1?a.jsxs(a.Fragment,{children:[r.index>0?a.jsx(yt,{onClick:c,className:"ecr-player__nav--left",children:a.jsx(Qt,{size:24})}):null,r.index<u-1?a.jsx(yt,{onClick:d,className:"ecr-player__nav--right",children:a.jsx(er,{size:24})}):null]}):null,a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[e&&a.jsx(ii,{playingStory:e,duration:s,currentFileIndex:r,isPaused:o},`${e.story_uuid}-${r.index}`),a.jsx("div",{onClick:()=>t(null),className:"ecr-player__close",children:a.jsx(tr,{className:"ecr-player__close-icon"})}),e?.files.length>0&&a.jsx(di,{currentFileIndex:r,files:e?.files,setDuration:l,setPreviewReel:t,isPaused:o,setIsPaused:i,handlePrevFile:c,handleNextFile:d,storyId:e.id,storyTitle:e?.title})]})]})})};function Bp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z"},child:[]}]})(e)}function Up(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z"},child:[]}]})(e)}function Hp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z"},child:[]}]})(e)}function Or(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.045 7.401c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.378-.378-.88-.586-1.414-.586s-1.036.208-1.413.585L4 13.585V18h4.413L19.045 7.401zm-3-3 1.587 1.585-1.59 1.584-1.586-1.585 1.589-1.584zM6 16v-1.585l7.04-7.018 1.586 1.586L7.587 16H6zm-2 4h16v2H4z"},child:[]}]})(e)}function Vp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 19c.946 0 1.81-.103 2.598-.281l-1.757-1.757c-.273.021-.55.038-.841.038-5.351 0-7.424-3.846-7.926-5a8.642 8.642 0 0 1 1.508-2.297L4.184 8.305c-1.538 1.667-2.121 3.346-2.132 3.379a.994.994 0 0 0 0 .633C2.073 12.383 4.367 19 12 19zm0-14c-1.837 0-3.346.396-4.604.981L3.707 2.293 2.293 3.707l18 18 1.414-1.414-3.319-3.319c2.614-1.951 3.547-4.615 3.561-4.657a.994.994 0 0 0 0-.633C21.927 11.617 19.633 5 12 5zm4.972 10.558-2.28-2.28c.19-.39.308-.819.308-1.278 0-1.641-1.359-3-3-3-.459 0-.888.118-1.277.309L8.915 7.501A9.26 9.26 0 0 1 12 7c5.351 0 7.424 3.846 7.926 5-.302.692-1.166 2.342-2.954 3.558z"},child:[]}]})(e)}function ui(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 12a2 2 0 0 0-.703.133l-2.398-1.963c.059-.214.101-.436.101-.67C17 8.114 15.886 7 14.5 7S12 8.114 12 9.5c0 .396.1.765.262 1.097l-2.909 3.438A2.06 2.06 0 0 0 9 14c-.179 0-.348.03-.512.074l-2.563-2.563C5.97 11.348 6 11.179 6 11c0-1.108-.892-2-2-2s-2 .892-2 2 .892 2 2 2c.179 0 .348-.03.512-.074l2.563 2.563A1.906 1.906 0 0 0 7 16c0 1.108.892 2 2 2s2-.892 2-2c0-.237-.048-.46-.123-.671l2.913-3.442c.227.066.462.113.71.113a2.48 2.48 0 0 0 1.133-.281l2.399 1.963A2.077 2.077 0 0 0 18 14c0 1.108.892 2 2 2s2-.892 2-2-.892-2-2-2z"},child:[]}]})(e)}function Wp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM7 12.414l-3.707-3.707 1.414-1.414 2.293 2.293 4.793-4.793 1.414 1.414-6.207 6.207z"},child:[]}]})(e)}function qp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM14 14h-12v-12h12v12z"},child:[]}]})(e)}function Gp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 10c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2s-0.895 2-2 2z"},child:[]}]})(e)}function Kp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 14c-3.314 0-6-2.686-6-6s2.686-6 6-6c3.314 0 6 2.686 6 6s-2.686 6-6 6z"},child:[]}]})(e)}const Yp=e=>{if(e<1e3)return e;if(e<1e6){const r=e/1e3;return r%1===0?`${r}k`:`${r.toFixed(1)}k`}if(e<1e9){const r=e/1e6;return r%1===0?`${r}m`:`${r.toFixed(1)}m`}const t=e/1e9;return t%1===0?`${t}b`:`${t.toFixed(1)}b`},Xp=({story:e,styles:t,storyViews:r,setStoryViews:n})=>{y.useEffect(()=>{n&&n(s=>({...s,[e.id]:e.view_count}))},[e]);const o=e?.files[0]?.mime_type.startsWith("video"),i=e.thumbnail||void 0;return a.jsxs("div",{className:"ecr-thumb__media",children:[o?a.jsx("video",{className:"ecr-thumb__video",src:e?.files[0]?.url,poster:i}):a.jsx("div",{className:"ecr-thumb__placeholder",children:"No Video"}),(r?.[e.id]??e.view_count)>0&&a.jsxs("div",{style:{left:t?.shape==="circle"?"50%":"100%",transform:`translateX(${t?.shape==="circle"?"-50%":`calc(-120% - ${t.border.border_radius/2}px)`})`,transition:"all 0.3s ease-in-out"},className:"ecr-thumb__views",children:[a.jsx("span",{children:Yp(r?.[e.id]??e.view_count)}),a.jsx(ap,{size:14})]})]})},Jn=y.memo(Xp);function Jp({reel:e,styles:t,isSelected:r,onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:s}){return a.jsxs("div",{className:`ecr-admin-reel-card ${t?.hoverEffect??""}`,children:[a.jsxs("div",{style:{aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},className:F("ecr-admin-reel-card__frame",r?"ecr-admin-reel-card__frame--selected":""),children:[a.jsx(Jn,{story:e,styles:t}),a.jsxs("div",{className:F("ecr-admin-reel-card__actions",s?"":"ecr-admin-reel-card__actions--hover"),children:[e.files[0]?.mime_type.startsWith("image")?null:a.jsx(te,{onClick:()=>i(e),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--primary",size:"icon-sm",title:"Preview Reel",children:a.jsx(up,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--primary"})}),a.jsx(te,{title:"Edit Reel",size:"icon-sm",asChild:!0,className:"ecr-admin-reel-card__action",children:a.jsx(bt,{to:`?view=${X.cr}&from=${X.ar}&sid=${e.id}`,children:a.jsx(Or,{className:"ecr-admin-reel-card__icon"})})}),a.jsx(te,{onClick:()=>o(e.id),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--danger",size:"icon-sm",title:"Remove Reel",children:a.jsx(Vn,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"})})]}),a.jsx("div",{style:{clipPath:"polygon(0% 0, 100% 100%, 100% 0)"},className:F("ecr-admin-reel-card__corner",s?"":"ecr-admin-reel-card__corner--hidden",r?"ecr-admin-reel-card__corner--selected":"ecr-admin-reel-card__corner--idle"),children:a.jsx(te,{onClick:()=>n(e.id),size:"icon-sm",className:"ecr-admin-reel-card__select",children:r?a.jsx(Wp,{size:18,className:"ecr-admin-reel-card__check ecr-admin-reel-card__check--active"}):a.jsx(qp,{size:18,className:"ecr-admin-reel-card__check"})})})]}),e.title&&a.jsx("p",{className:"ecr-admin-reel-card__title",children:e.title})]})}function Zp({reels:e,styles:t,selectedReelIds:r,onSelectReel:n,onDeleteReel:o,onPreviewReel:i,lastStoryElementRef:s}){return a.jsx("div",{className:"ecr-admin-reels-grid",children:e?.map((l,c)=>a.jsx("div",{ref:e.length===c+1?s:null,children:a.jsx(Jp,{reel:l,styles:t,isSelected:r.includes(l.id),onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:r.length>0})},l.id))})}const rr=({cb:e})=>{const t=Ne(),r=()=>{e?e():t(-1)};return a.jsx("button",{title:"Back",onClick:r,className:"ecr-admin-back-button",children:a.jsx(Sp,{size:24})})};function Qp(e){return H({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"},child:[]}]})(e)}const nr=({breads:e=[],onNavigate:t})=>a.jsx("nav",{className:"ecr-admin-breadcrumb","aria-label":"Breadcrumb",children:a.jsx("ul",{className:"ecr-admin-breadcrumb__list",children:e.map((r,n)=>{const o=!r.href;return a.jsxs("li",{className:"ecr-admin-breadcrumb__item",children:[r.href&&!o?a.jsx(bt,{to:r.href,className:"ecr-admin-breadcrumb__link",onClick:i=>{if(!t)return;const s=r.href;s&&(i.preventDefault(),t(s))},children:r.label}):a.jsx("span",{className:"ecr-admin-breadcrumb__current",children:r.label}),n<e.length-1&&a.jsx(Qp,{className:"ecr-admin-breadcrumb__separator"})]},n)})})}),Rr=({onReject:e,onAccept:t,isLoading:r,message:n="Are you sure, You want to delete this story?"})=>{const o=y.useRef(null);return y.useEffect(()=>{o.current&&o.current.focus()},[]),a.jsx("div",{className:"ecr-admin-modal",children:a.jsxs("div",{ref:o,tabIndex:-1,className:"ecr-admin-modal__panel",onBlur:i=>{i.currentTarget.contains(i.relatedTarget)||e(null)},children:[a.jsxs("div",{className:"ecr-admin-modal__content",children:[a.jsx("div",{className:"ecr-admin-modal__icon",children:a.jsx(sp,{size:40,color:"#ffa500"})}),a.jsx("p",{className:"ecr-admin-modal__message",children:n})]}),a.jsxs("div",{className:"ecr-admin-modal__actions",children:[a.jsx("button",{disabled:r,onClick:()=>e(null),className:"ecr-admin-modal__button ecr-admin-modal__button--cancel",children:"No"}),a.jsxs("button",{disabled:r,onClick:t,className:"ecr-admin-modal__button ecr-admin-modal__button--danger",children:[r&&a.jsx(rt,{className:"ecr-admin-modal__spinner"}),"Yes"]})]})]})})},Lr=({to:e,Icon:t,textColor:r="#fff",text:n,className:o,onNavigate:i})=>a.jsxs(bt,{style:{color:r},to:e,className:F("ecr-admin-link-button",o),onClick:s=>{i&&(s.preventDefault(),i(e))},children:[t&&a.jsx(t,{}),n]}),Ir=({className:e})=>a.jsx("div",{className:F("ecr-admin-loader",e),children:a.jsx(rt,{className:"ecr-admin-loader__icon",size:64})}),jt=({left:e=[],center:t=[],right:r=[],leftClass:n="",centerClass:o="",rightClass:i=""})=>a.jsxs("div",{className:"ecr-admin-navbar",children:[a.jsx("div",{className:`ecr-admin-navbar__section ${n}`.trim(),children:e.map((s,l)=>a.jsx(y.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${o}`.trim(),children:t.map((s,l)=>a.jsx(y.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${i}`.trim(),children:r.map((s,l)=>a.jsx(y.Fragment,{children:s},l))})]}),St=({name:e,Icon:t})=>a.jsxs("h1",{className:"ecr-admin-page-name",children:[a.jsx(t,{}),e]});function em(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M55 18v476h18v-37h46v37h274v-37h46v37h18V18h-18v37h-46V18h-18v60H137V18h-18v37H73V18H55zm18 55h46v46H73V73zm320 0h46v46h-46V73zm-256 41h238v156H137V114zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 201h46v46H73v-46zm320 0h46v46h-46v-46zM73 265h46v46H73v-46zm320 0h46v46h-46v-46zm-256 41h238v156H137V306zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 393h46v46H73v-46zm320 0h46v46h-46v-46z"},child:[]}]})(e)}const zr=()=>a.jsxs("div",{className:"ecr-admin-widget-name",children:[a.jsx(em,{}),"ReelsWP"]});function pi(e,t){return function(){return e.apply(t,arguments)}}const{toString:tm}=Object.prototype,{getPrototypeOf:Zn}=Object,{iterator:Mr,toStringTag:mi}=Symbol,Dr=(e=>t=>{const r=tm.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),we=e=>(e=e.toLowerCase(),t=>Dr(t)===e),Fr=e=>t=>typeof t===e,{isArray:Ct}=Array,kt=Fr("undefined");function or(e){return e!==null&&!kt(e)&&e.constructor!==null&&!kt(e.constructor)&&me(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const fi=we("ArrayBuffer");function rm(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&fi(e.buffer),t}const nm=Fr("string"),me=Fr("function"),hi=Fr("number"),ar=e=>e!==null&&typeof e=="object",om=e=>e===!0||e===!1,$r=e=>{if(Dr(e)!=="object")return!1;const t=Zn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(mi in e)&&!(Mr in e)},am=e=>{if(!ar(e)||or(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},im=we("Date"),sm=we("File"),lm=we("Blob"),cm=we("FileList"),dm=e=>ar(e)&&me(e.pipe),um=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||me(e.append)&&((t=Dr(e))==="formdata"||t==="object"&&me(e.toString)&&e.toString()==="[object FormData]"))},pm=we("URLSearchParams"),[mm,fm,hm,gm]=["ReadableStream","Request","Response","Headers"].map(we),xm=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ir(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),Ct(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(or(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let l;for(n=0;n<s;n++)l=i[n],t.call(null,e[l],l,e)}}function gi(e,t){if(or(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const at=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,xi=e=>!kt(e)&&e!==at;function Qn(){const{caseless:e,skipUndefined:t}=xi(this)&&this||{},r={},n=(o,i)=>{const s=e&&gi(r,i)||i;$r(r[s])&&$r(o)?r[s]=Qn(r[s],o):$r(o)?r[s]=Qn({},o):Ct(o)?r[s]=o.slice():(!t||!kt(o))&&(r[s]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&ir(arguments[o],n);return r}const bm=(e,t,r,{allOwnKeys:n}={})=>(ir(t,(o,i)=>{r&&me(o)?e[i]=pi(o,r):e[i]=o},{allOwnKeys:n}),e),_m=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),vm=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},ym=(e,t,r,n)=>{let o,i,s;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!l[s]&&(t[s]=e[s],l[s]=!0);e=r!==!1&&Zn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},wm=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},jm=e=>{if(!e)return null;if(Ct(e))return e;let t=e.length;if(!hi(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Sm=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Zn(Uint8Array)),Cm=(e,t)=>{const n=(e&&e[Mr]).call(e);let o;for(;(o=n.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},km=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Nm=we("HTMLFormElement"),Em=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),bi=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Tm=we("RegExp"),_i=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ir(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},Am=e=>{_i(e,(t,r)=>{if(me(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(me(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Pm=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return Ct(e)?n(e):n(String(e).split(t)),r},Om=()=>{},Rm=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Lm(e){return!!(e&&me(e.append)&&e[mi]==="FormData"&&e[Mr])}const Im=e=>{const t=new Array(10),r=(n,o)=>{if(ar(n)){if(t.indexOf(n)>=0)return;if(or(n))return n;if(!("toJSON"in n)){t[o]=n;const i=Ct(n)?[]:{};return ir(n,(s,l)=>{const c=r(s,o+1);!kt(c)&&(i[l]=c)}),t[o]=void 0,i}}return n};return r(e,0)},zm=we("AsyncFunction"),Mm=e=>e&&(ar(e)||me(e))&&me(e.then)&&me(e.catch),vi=((e,t)=>e?setImmediate:t?((r,n)=>(at.addEventListener("message",({source:o,data:i})=>{o===at&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),at.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",me(at.postMessage)),Dm=typeof queueMicrotask<"u"?queueMicrotask.bind(at):typeof process<"u"&&process.nextTick||vi,S={isArray:Ct,isArrayBuffer:fi,isBuffer:or,isFormData:um,isArrayBufferView:rm,isString:nm,isNumber:hi,isBoolean:om,isObject:ar,isPlainObject:$r,isEmptyObject:am,isReadableStream:mm,isRequest:fm,isResponse:hm,isHeaders:gm,isUndefined:kt,isDate:im,isFile:sm,isBlob:lm,isRegExp:Tm,isFunction:me,isStream:dm,isURLSearchParams:pm,isTypedArray:Sm,isFileList:cm,forEach:ir,merge:Qn,extend:bm,trim:xm,stripBOM:_m,inherits:vm,toFlatObject:ym,kindOf:Dr,kindOfTest:we,endsWith:wm,toArray:jm,forEachEntry:Cm,matchAll:km,isHTMLForm:Nm,hasOwnProperty:bi,hasOwnProp:bi,reduceDescriptors:_i,freezeMethods:Am,toObjectSet:Pm,toCamelCase:Em,noop:Om,toFiniteNumber:Rm,findKey:gi,global:at,isContextDefined:xi,isSpecCompliantForm:Lm,toJSONObject:Im,isAsyncFn:zm,isThenable:Mm,setImmediate:vi,asap:Dm,isIterable:e=>e!=null&&me(e[Mr])};function U(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}S.inherits(U,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:S.toJSONObject(this.config),code:this.code,status:this.status}}});const yi=U.prototype,wi={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{wi[e]={value:e}}),Object.defineProperties(U,wi),Object.defineProperty(yi,"isAxiosError",{value:!0}),U.from=(e,t,r,n,o,i)=>{const s=Object.create(yi);S.toFlatObject(e,s,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const l=e&&e.message?e.message:"Error",c=t==null&&e?e.code:t;return U.call(s,l,c,r,n,o),e&&s.cause==null&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const Fm=null;function eo(e){return S.isPlainObject(e)||S.isArray(e)}function ji(e){return S.endsWith(e,"[]")?e.slice(0,-2):e}function Si(e,t,r){return e?e.concat(t).map(function(o,i){return o=ji(o),!r&&i?"["+o+"]":o}).join(r?".":""):t}function $m(e){return S.isArray(e)&&!e.some(eo)}const Bm=S.toFlatObject(S,{},null,function(t){return/^is[A-Z]/.test(t)});function Br(e,t,r){if(!S.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=S.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,h){return!S.isUndefined(h[f])});const n=r.metaTokens,o=r.visitor||u,i=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&S.isSpecCompliantForm(t);if(!S.isFunction(o))throw new TypeError("visitor must be a function");function d(b){if(b===null)return"";if(S.isDate(b))return b.toISOString();if(S.isBoolean(b))return b.toString();if(!c&&S.isBlob(b))throw new U("Blob is not supported. Use a Buffer instead.");return S.isArrayBuffer(b)||S.isTypedArray(b)?c&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function u(b,f,h){let _=b;if(b&&!h&&typeof b=="object"){if(S.endsWith(f,"{}"))f=n?f:f.slice(0,-2),b=JSON.stringify(b);else if(S.isArray(b)&&$m(b)||(S.isFileList(b)||S.endsWith(f,"[]"))&&(_=S.toArray(b)))return f=ji(f),_.forEach(function(w,j){!(S.isUndefined(w)||w===null)&&t.append(s===!0?Si([f],j,i):s===null?f:f+"[]",d(w))}),!1}return eo(b)?!0:(t.append(Si(h,f,i),d(b)),!1)}const p=[],m=Object.assign(Bm,{defaultVisitor:u,convertValue:d,isVisitable:eo});function g(b,f){if(!S.isUndefined(b)){if(p.indexOf(b)!==-1)throw Error("Circular reference detected in "+f.join("."));p.push(b),S.forEach(b,function(_,v){(!(S.isUndefined(_)||_===null)&&o.call(t,_,S.isString(v)?v.trim():v,f,m))===!0&&g(_,f?f.concat(v):[v])}),p.pop()}}if(!S.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Ci(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function to(e,t){this._pairs=[],e&&Br(e,this,t)}const ki=to.prototype;ki.append=function(t,r){this._pairs.push([t,r])},ki.toString=function(t){const r=t?function(n){return t.call(this,n,Ci)}:Ci;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Um(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ni(e,t,r){if(!t)return e;const n=r&&r.encode||Um;S.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(o?i=o(t,r):i=S.isURLSearchParams(t)?t.toString():new to(t,r).toString(n),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ei{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){S.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Ti={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Hm={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:to,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ro=typeof window<"u"&&typeof document<"u",no=typeof navigator=="object"&&navigator||void 0,Vm=ro&&(!no||["ReactNative","NativeScript","NS"].indexOf(no.product)<0),Wm=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",qm=ro&&window.location.href||"http://localhost",ue={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ro,hasStandardBrowserEnv:Vm,hasStandardBrowserWebWorkerEnv:Wm,navigator:no,origin:qm},Symbol.toStringTag,{value:"Module"})),...Hm};function Gm(e,t){return Br(e,new ue.classes.URLSearchParams,{visitor:function(r,n,o,i){return ue.isNode&&S.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function Km(e){return S.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Ym(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}function Ai(e){function t(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const l=Number.isFinite(+s),c=i>=r.length;return s=!s&&S.isArray(o)?o.length:s,c?(S.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!l):((!o[s]||!S.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&S.isArray(o[s])&&(o[s]=Ym(o[s])),!l)}if(S.isFormData(e)&&S.isFunction(e.entries)){const r={};return S.forEachEntry(e,(n,o)=>{t(Km(n),o,r,0)}),r}return null}function Xm(e,t,r){if(S.isString(e))try{return(t||JSON.parse)(e),S.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const sr={transitional:Ti,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=S.isObject(t);if(i&&S.isHTMLForm(t)&&(t=new FormData(t)),S.isFormData(t))return o?JSON.stringify(Ai(t)):t;if(S.isArrayBuffer(t)||S.isBuffer(t)||S.isStream(t)||S.isFile(t)||S.isBlob(t)||S.isReadableStream(t))return t;if(S.isArrayBufferView(t))return t.buffer;if(S.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Gm(t,this.formSerializer).toString();if((l=S.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Br(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),Xm(t)):t}],transformResponse:[function(t){const r=this.transitional||sr.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(S.isResponse(t)||S.isReadableStream(t))return t;if(t&&S.isString(t)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(l){if(s)throw l.name==="SyntaxError"?U.from(l,U.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ue.classes.FormData,Blob:ue.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};S.forEach(["delete","get","head","post","put","patch"],e=>{sr.headers[e]={}});const Jm=S.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Zm=e=>{const t={};let r,n,o;return e&&e.split(`
     214`).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||t[r]&&Jm[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Pi=Symbol("internals");function lr(e){return e&&String(e).trim().toLowerCase()}function Ur(e){return e===!1||e==null?e:S.isArray(e)?e.map(Ur):String(e)}function Qm(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const ef=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function oo(e,t,r,n,o){if(S.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!S.isString(t)){if(S.isString(n))return t.indexOf(n)!==-1;if(S.isRegExp(n))return n.test(t)}}function tf(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function rf(e,t){const r=S.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,i,s){return this[n].call(this,t,o,i,s)},configurable:!0})})}let fe=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function i(l,c,d){const u=lr(c);if(!u)throw new Error("header name must be a non-empty string");const p=S.findKey(o,u);(!p||o[p]===void 0||d===!0||d===void 0&&o[p]!==!1)&&(o[p||c]=Ur(l))}const s=(l,c)=>S.forEach(l,(d,u)=>i(d,u,c));if(S.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(S.isString(t)&&(t=t.trim())&&!ef(t))s(Zm(t),r);else if(S.isObject(t)&&S.isIterable(t)){let l={},c,d;for(const u of t){if(!S.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[d=u[0]]=(c=l[d])?S.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}s(l,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=lr(t),t){const n=S.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return Qm(o);if(S.isFunction(r))return r.call(this,o,n);if(S.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=lr(t),t){const n=S.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||oo(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function i(s){if(s=lr(s),s){const l=S.findKey(n,s);l&&(!r||oo(n,n[l],l,r))&&(delete n[l],o=!0)}}return S.isArray(t)?t.forEach(i):i(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const i=r[n];(!t||oo(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const r=this,n={};return S.forEach(this,(o,i)=>{const s=S.findKey(n,i);if(s){r[s]=Ur(o),delete r[i];return}const l=t?tf(i):String(i).trim();l!==i&&delete r[i],r[l]=Ur(o),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return S.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&S.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
     215`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Pi]=this[Pi]={accessors:{}}).accessors,o=this.prototype;function i(s){const l=lr(s);n[l]||(rf(o,s),n[l]=!0)}return S.isArray(t)?t.forEach(i):i(t),this}};fe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),S.reduceDescriptors(fe.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),S.freezeMethods(fe);function ao(e,t){const r=this||sr,n=t||r,o=fe.from(n.headers);let i=n.data;return S.forEach(e,function(l){i=l.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Oi(e){return!!(e&&e.__CANCEL__)}function Nt(e,t,r){U.call(this,e??"canceled",U.ERR_CANCELED,t,r),this.name="CanceledError"}S.inherits(Nt,U,{__CANCEL__:!0});function Ri(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new U("Request failed with status code "+r.status,[U.ERR_BAD_REQUEST,U.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function nf(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function of(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=n[i];s||(s=d),r[o]=c,n[o]=d;let p=i,m=0;for(;p!==o;)m+=r[p++],p=p%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),d-s<t)return;const g=u&&d-u;return g?Math.round(m*1e3/g):void 0}}function af(e,t){let r=0,n=1e3/t,o,i;const s=(d,u=Date.now())=>{r=u,o=null,i&&(clearTimeout(i),i=null),e(...d)};return[(...d)=>{const u=Date.now(),p=u-r;p>=n?s(d,u):(o=d,i||(i=setTimeout(()=>{i=null,s(o)},n-p)))},()=>o&&s(o)]}const Hr=(e,t,r=3)=>{let n=0;const o=of(50,250);return af(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,c=s-n,d=o(c),u=s<=l;n=s;const p={loaded:s,total:l,progress:l?s/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-s)/d:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(p)},r)},Li=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ii=e=>(...t)=>S.asap(()=>e(...t)),sf=ue.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ue.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ue.origin),ue.navigator&&/(msie|trident)/i.test(ue.navigator.userAgent)):()=>!0,lf=ue.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];S.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),S.isString(n)&&l.push(`path=${n}`),S.isString(o)&&l.push(`domain=${o}`),i===!0&&l.push("secure"),S.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function cf(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function df(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function zi(e,t,r){let n=!cf(t);return e&&(n||r==!1)?df(e,t):t}const Mi=e=>e instanceof fe?{...e}:e;function it(e,t){t=t||{};const r={};function n(d,u,p,m){return S.isPlainObject(d)&&S.isPlainObject(u)?S.merge.call({caseless:m},d,u):S.isPlainObject(u)?S.merge({},u):S.isArray(u)?u.slice():u}function o(d,u,p,m){if(S.isUndefined(u)){if(!S.isUndefined(d))return n(void 0,d,p,m)}else return n(d,u,p,m)}function i(d,u){if(!S.isUndefined(u))return n(void 0,u)}function s(d,u){if(S.isUndefined(u)){if(!S.isUndefined(d))return n(void 0,d)}else return n(void 0,u)}function l(d,u,p){if(p in t)return n(d,u);if(p in e)return n(void 0,d)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(d,u,p)=>o(Mi(d),Mi(u),p,!0)};return S.forEach(Object.keys({...e,...t}),function(u){const p=c[u]||o,m=p(e[u],t[u],u);S.isUndefined(m)&&p!==l||(r[u]=m)}),r}const Di=e=>{const t=it({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:l}=t;if(t.headers=s=fe.from(s),t.url=Ni(zi(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),S.isFormData(r)){if(ue.hasStandardBrowserEnv||ue.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(S.isFunction(r.getHeaders)){const c=r.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([u,p])=>{d.includes(u.toLowerCase())&&s.set(u,p)})}}if(ue.hasStandardBrowserEnv&&(n&&S.isFunction(n)&&(n=n(t)),n||n!==!1&&sf(t.url))){const c=o&&i&&lf.read(i);c&&s.set(o,c)}return t},uf=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Di(e);let i=o.data;const s=fe.from(o.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=o,u,p,m,g,b;function f(){g&&g(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let h=new XMLHttpRequest;h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout;function _(){if(!h)return;const w=fe.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),C={data:!l||l==="text"||l==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:w,config:e,request:h};Ri(function(k){r(k),f()},function(k){n(k),f()},C),h=null}"onloadend"in h?h.onloadend=_:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(_)},h.onabort=function(){h&&(n(new U("Request aborted",U.ECONNABORTED,e,h)),h=null)},h.onerror=function(j){const C=j&&j.message?j.message:"Network Error",N=new U(C,U.ERR_NETWORK,e,h);N.event=j||null,n(N),h=null},h.ontimeout=function(){let j=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const C=o.transitional||Ti;o.timeoutErrorMessage&&(j=o.timeoutErrorMessage),n(new U(j,C.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,e,h)),h=null},i===void 0&&s.setContentType(null),"setRequestHeader"in h&&S.forEach(s.toJSON(),function(j,C){h.setRequestHeader(C,j)}),S.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),l&&l!=="json"&&(h.responseType=o.responseType),d&&([m,b]=Hr(d,!0),h.addEventListener("progress",m)),c&&h.upload&&([p,g]=Hr(c),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(u=w=>{h&&(n(!w||w.type?new Nt(null,e,h):w),h.abort(),h=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const v=nf(o.url);if(v&&ue.protocols.indexOf(v)===-1){n(new U("Unsupported protocol "+v+":",U.ERR_BAD_REQUEST,e));return}h.send(i||null)})},pf=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const i=function(d){if(!o){o=!0,l();const u=d instanceof Error?d:this.reason;n.abort(u instanceof U?u:new Nt(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,i(new U(`timeout ${t} of ms exceeded`,U.ETIMEDOUT))},t);const l=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),e=null)};e.forEach(d=>d.addEventListener("abort",i));const{signal:c}=n;return c.unsubscribe=()=>S.asap(l),c}},mf=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},ff=async function*(e,t){for await(const r of hf(e))yield*mf(r,t)},hf=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Fi=(e,t,r,n)=>{const o=ff(e,t);let i=0,s,l=c=>{s||(s=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await o.next();if(d){l(),c.close();return}let p=u.byteLength;if(r){let m=i+=p;r(m)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),o.return()}},{highWaterMark:2})},$i=64*1024,{isFunction:Vr}=S,gf=(({Request:e,Response:t})=>({Request:e,Response:t}))(S.global),{ReadableStream:Bi,TextEncoder:Ui}=S.global,Hi=(e,...t)=>{try{return!!e(...t)}catch{return!1}},xf=e=>{e=S.merge.call({skipUndefined:!0},gf,e);const{fetch:t,Request:r,Response:n}=e,o=t?Vr(t):typeof fetch=="function",i=Vr(r),s=Vr(n);if(!o)return!1;const l=o&&Vr(Bi),c=o&&(typeof Ui=="function"?(b=>f=>b.encode(f))(new Ui):async b=>new Uint8Array(await new r(b).arrayBuffer())),d=i&&l&&Hi(()=>{let b=!1;const f=new r(ue.origin,{body:new Bi,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!f}),u=s&&l&&Hi(()=>S.isReadableStream(new n("").body)),p={stream:u&&(b=>b.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!p[b]&&(p[b]=(f,h)=>{let _=f&&f[b];if(_)return _.call(f);throw new U(`Response type '${b}' is not supported`,U.ERR_NOT_SUPPORT,h)})});const m=async b=>{if(b==null)return 0;if(S.isBlob(b))return b.size;if(S.isSpecCompliantForm(b))return(await new r(ue.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(S.isArrayBufferView(b)||S.isArrayBuffer(b))return b.byteLength;if(S.isURLSearchParams(b)&&(b=b+""),S.isString(b))return(await c(b)).byteLength},g=async(b,f)=>{const h=S.toFiniteNumber(b.getContentLength());return h??m(f)};return async b=>{let{url:f,method:h,data:_,signal:v,cancelToken:w,timeout:j,onDownloadProgress:C,onUploadProgress:N,responseType:k,headers:E,withCredentials:T="same-origin",fetchOptions:A}=Di(b),O=t||fetch;k=k?(k+"").toLowerCase():"text";let R=pf([v,w&&w.toAbortSignal()],j),L=null;const P=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let M;try{if(N&&d&&h!=="get"&&h!=="head"&&(M=await g(E,_))!==0){let ie=new r(f,{method:"POST",body:_,duplex:"half"}),ge;if(S.isFormData(_)&&(ge=ie.headers.get("content-type"))&&E.setContentType(ge),ie.body){const[_e,pe]=Li(M,Hr(Ii(N)));_=Fi(ie.body,$i,_e,pe)}}S.isString(T)||(T=T?"include":"omit");const I=i&&"credentials"in r.prototype,B={...A,signal:R,method:h.toUpperCase(),headers:E.normalize().toJSON(),body:_,duplex:"half",credentials:I?T:void 0};L=i&&new r(f,B);let z=await(i?O(L,A):O(f,B));const q=u&&(k==="stream"||k==="response");if(u&&(C||q&&P)){const ie={};["status","statusText","headers"].forEach(G=>{ie[G]=z[G]});const ge=S.toFiniteNumber(z.headers.get("content-length")),[_e,pe]=C&&Li(ge,Hr(Ii(C),!0))||[];z=new n(Fi(z.body,$i,_e,()=>{pe&&pe(),P&&P()}),ie)}k=k||"text";let ae=await p[S.findKey(p,k)||"text"](z,b);return!q&&P&&P(),await new Promise((ie,ge)=>{Ri(ie,ge,{data:ae,headers:fe.from(z.headers),status:z.status,statusText:z.statusText,config:b,request:L})})}catch(I){throw P&&P(),I&&I.name==="TypeError"&&/Load failed|fetch/i.test(I.message)?Object.assign(new U("Network Error",U.ERR_NETWORK,b,L),{cause:I.cause||I}):U.from(I,I&&I.code,b,L)}}},bf=new Map,Vi=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s=i.length,l=s,c,d,u=bf;for(;l--;)c=i[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:xf(t)),u=d;return d};Vi();const io={http:Fm,xhr:uf,fetch:{get:Vi}};S.forEach(io,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Wi=e=>`- ${e}`,_f=e=>S.isFunction(e)||e===null||e===!1;function vf(e,t){e=S.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){n=e[s];let l;if(o=n,!_f(n)&&(o=io[(l=String(n)).toLowerCase()],o===void 0))throw new U(`Unknown adapter '${l}'`);if(o&&(S.isFunction(o)||(o=o.get(t))))break;i[l||"#"+s]=o}if(!o){const s=Object.entries(i).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=r?s.length>1?`since :
    216216`+s.map(Wi).join(`
    217 `):" "+Wi(s[0]):"as no adapter specified";throw new U("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o}const qi={getAdapter:vf,adapters:io};function so(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new jt(null,e)}function Gi(e){return so(e),e.headers=fe.from(e.headers),e.data=ao.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),qi.getAdapter(e.adapter||ir.adapter,e)(e).then(function(n){return so(e),n.data=ao.call(e,e.transformResponse,n),n.headers=fe.from(n.headers),n},function(n){return Oi(n)||(so(e),n&&n.response&&(n.response.data=ao.call(e,e.transformResponse,n.response),n.response.headers=fe.from(n.response.headers))),Promise.reject(n)})}const Ki="1.13.1",Wr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Wr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Yi={};Wr.transitional=function(t,r,n){function o(i,s){return"[Axios v"+Ki+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,l)=>{if(t===!1)throw new U(o(s," has been removed"+(r?" in "+r:"")),U.ERR_DEPRECATED);return r&&!Yi[s]&&(Yi[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,l):!0}},Wr.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function _f(e,t,r){if(typeof e!="object")throw new U("options must be an object",U.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],s=t[i];if(s){const l=e[i],d=l===void 0||s(l,i,e);if(d!==!0)throw new U("option "+i+" must be "+d,U.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new U("Unknown option "+i,U.ERR_BAD_OPTION)}}const qr={assertOptions:_f,validators:Wr},Te=qr.validators;let st=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ei,response:new Ei}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
    218 `+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=it(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&qr.assertOptions(n,{silentJSONParsing:Te.transitional(Te.boolean),forcedJSONParsing:Te.transitional(Te.boolean),clarifyTimeoutError:Te.transitional(Te.boolean)},!1),o!=null&&(S.isFunction(o)?r.paramsSerializer={serialize:o}:qr.assertOptions(o,{encode:Te.function,serialize:Te.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),qr.assertOptions(r,{baseUrl:Te.spelling("baseURL"),withXsrfToken:Te.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&S.merge(i.common,i[r.method]);i&&S.forEach(["delete","get","head","post","put","patch","common"],b=>{delete i[b]}),r.headers=fe.concat(s,i);const l=[];let d=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(d=d&&f.synchronous,l.unshift(f.fulfilled,f.rejected))});const c=[];this.interceptors.response.forEach(function(f){c.push(f.fulfilled,f.rejected)});let u,p=0,m;if(!d){const b=[Gi.bind(this),void 0];for(b.unshift(...l),b.push(...c),m=b.length,u=Promise.resolve(r);p<m;)u=u.then(b[p++],b[p++]);return u}m=l.length;let g=r;for(;p<m;){const b=l[p++],f=l[p++];try{g=b(g)}catch(h){f.call(this,h);break}}try{u=Gi.call(this,g)}catch(b){return Promise.reject(b)}for(p=0,m=c.length;p<m;)u=u.then(c[p++],c[p++]);return u}getUri(t){t=it(this.defaults,t);const r=zi(t.baseURL,t.url,t.allowAbsoluteUrls);return Ni(r,t.params,t.paramsSerializer)}};S.forEach(["delete","get","head","options"],function(t){st.prototype[t]=function(r,n){return this.request(it(n||{},{method:t,url:r,data:(n||{}).data}))}}),S.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,l){return this.request(it(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}st.prototype[t]=r(),st.prototype[t+"Form"]=r(!0)});let yf=class Sd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(l=>{n.subscribe(l),i=l}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,l){n.reason||(n.reason=new jt(i,s,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Sd(function(o){t=o}),cancel:t}}};function wf(e){return function(r){return e.apply(null,r)}}function jf(e){return S.isObject(e)&&e.isAxiosError===!0}const lo={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(lo).forEach(([e,t])=>{lo[t]=e});function Xi(e){const t=new st(e),r=pi(st.prototype.request,t);return S.extend(r,st.prototype,t,{allOwnKeys:!0}),S.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return Xi(it(e,o))},r}const ee=Xi(ir);ee.Axios=st,ee.CanceledError=jt,ee.CancelToken=yf,ee.isCancel=Oi,ee.VERSION=Ki,ee.toFormData=Br,ee.AxiosError=U,ee.Cancel=ee.CanceledError,ee.all=function(t){return Promise.all(t)},ee.spread=wf,ee.isAxiosError=jf,ee.mergeConfig=it,ee.AxiosHeaders=fe,ee.formToJSON=e=>Ai(S.isHTMLForm(e)?new FormData(e):e),ee.getAdapter=qi.getAdapter,ee.HttpStatusCode=lo,ee.default=ee;const{Axios:A_,AxiosError:P_,CanceledError:O_,isCancel:R_,CancelToken:L_,VERSION:I_,all:z_,Cancel:M_,isAxiosError:D_,spread:F_,toFormData:$_,AxiosHeaders:B_,HttpStatusCode:U_,formToJSON:H_,getAdapter:V_,mergeConfig:W_}=ee,Ji=ecommreelsInfo,he=ee.create({baseURL:`${Ji.apiBase}`,headers:{"X-WP-Nonce":Ji.nonce,"Content-Type":"application/json"}}),Sf=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState(!1),o=y.useCallback(async s=>{try{t(!0);const l={styles:tt,story_ids:s},d=await he.post("stories/manage-group-stories",l);return K.success("Group created successfully!"),d.data.group_id}catch(l){return l instanceof Error?K.error(l.message):K.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]),i=y.useCallback(async(s,l,d)=>{try{return n(!0),await he.delete(`story/${s}`),l(c=>c.filter(u=>u.id!==s)),d?.silent||K.success("Reel deleted successfully!"),{ok:!0}}catch(c){const u=c instanceof Error?c.message:"Something went wrong. Try again later!";return d?.silent||K.error(u),{ok:!1,message:u}}finally{n(!1)}},[]);return{styles:tt,isCreating:e,isDeleting:r,createGroup:o,deleteReel:i}};function co(e,t){const[r,n]=y.useState(e);return y.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const Zi=e=>{const[t,r]=y.useState([]),[n,o]=y.useState(1),[i,s]=y.useState(!0),[l,d]=y.useState(!1),[c,u]=y.useState(!1),[p,m]=y.useState(""),g=co(p,500),b=y.useRef(!0),f=y.useCallback(async w=>{w===1&&b.current?u(!0):d(!0);try{const j={page:w,per_page:20};e&&(j.group_id=e),g&&(j.search=g);const C=await he.get("stories",{params:j}),N=C.data,k=parseInt(C.headers["x-wp-totalpages"]);r(E=>w===1?N:[...E,...N]),o(w+1),s(w<k)}catch(j){j instanceof Error?K.error(j.message):K.error("Something went wrong. Try again later!")}finally{b.current&&(b.current=!1),d(!1),u(!1)}},[e,g]),h=y.useCallback(()=>{o(1),r([]),f(1)},[f]);y.useEffect(()=>{h()},[g,h]);const v=y.useRef(null),_=y.useCallback(w=>{l||(v.current&&v.current.disconnect(),v.current=new IntersectionObserver(j=>{j[0].isIntersecting&&i&&f(n)}),w&&v.current.observe(w))},[l,i,n,f]);return y.useEffect(()=>()=>{v.current&&v.current.disconnect()},[]),{allReels:t,setAllReels:r,searchTerm:p,setSearchTerm:m,isSearching:l,isLoading:c,lastStoryElementRef:_,refreshReels:h}};function Cf(){const e=Ne(),{allReels:t,setAllReels:r,isSearching:n,lastStoryElementRef:o,searchTerm:i,setSearchTerm:s,isLoading:l}=Zi(null),{styles:d,isCreating:c,isDeleting:u,createGroup:p,deleteReel:m}=Sf(),[g,b]=y.useState(null),[f,h]=y.useState(null),[v,_]=y.useState(null),[w,j]=y.useState([]),C=async()=>{const A=await p(w);A&&e(`?view=${X.mg}&gid=${A}`)},N=()=>{j(t.map(A=>A.id))},k=A=>{j(O=>O.includes(A)?O.filter(R=>R!==A):[...O,A])},E=()=>{w.length&&h(w)},T=y.useCallback(async()=>{if(g){await m(g,r),b(null);return}if(f?.length){const A=await Promise.all(f.map(P=>m(P,r,{silent:!0}))),O=f.filter((P,M)=>A[M]?.ok),R=O.length,L=f.length-R;R&&(r(P=>P.filter(M=>!O.includes(M.id))),j(P=>P.filter(M=>!O.includes(M)))),R&&K.success(`${R} reels deleted successfully!`),L&&K.error(`${L} reels failed to delete.`),h(null)}},[m,g,f,r]);return l&&!t.length?a.jsx(Ir,{}):a.jsxs(a.Fragment,{children:[(g||f)&&a.jsx(Rr,{onReject:()=>{b(null),h(null)},onAccept:T,isLoading:u,message:f?.length?`Are you sure you want to remove ${f.length} reels?`:"Are you sure you want to remove this reel?"}),a.jsx(vt,{left:[a.jsx(_t,{name:"All Reels",Icon:rp},"page"),a.jsx(tr,{cb:()=>e(`?view=${X.ag}`)},"back")],center:[a.jsx(zr,{},"reel-wp")],right:[a.jsx(Lr,{to:`?view=${X.cr}&from=${X.ar}`,text:"Add Reel",Icon:gt},"add-reel-all-reel")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"All Reels"}]}),a.jsxs("div",{className:"ecr-admin-panel ecr-admin-panel--reels",children:[a.jsx(yp,{selectedReelIds:w,handleSelectAll:N,clearSelection:()=>j([]),searchTerm:i,setSearchTerm:s,isCreating:c,handleCreateGroup:C,handleBulkDelete:E}),t.length?a.jsx(Jp,{reels:t,styles:d,selectedReelIds:w,onSelectReel:k,onDeleteReel:b,onPreviewReel:_,lastStoryElementRef:o}):!n&&!l?a.jsx(Cp,{}):null,n&&a.jsx(kp,{isFullScreen:!t.length})]}),!!v&&a.jsx(Fp,{previewReel:v,setPreviewReel:_})]})}const kf=()=>{const[e,t]=y.useState(!1),r=y.useCallback(async({storyId:n,storyTitle:o,uploadedFiles:i,links:s,thumbnail:l})=>{try{t(!0);const d={story_title:o,files:i,links:s};typeof l=="string"&&l.trim().length>0&&(d.thumbnail=l),n&&(d.story_id=n);const c=await he.post("files",d);return K.success(`Story ${n?"updated":"created"} successfully!`),c.data.story_id}catch(d){return d instanceof Error?K.error(d.message):K.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]);return{isSaving:e,saveStory:r}},uo=({isSaving:e,onSave:t,text:r="Save",className:n,...o})=>a.jsxs(te,{onClick:t,className:F("ecr-admin-save-button",n),...o,children:[e?a.jsx(rt,{className:"ecr-admin-save-button__icon ecr-admin-save-button__icon--spin"}):a.jsx(ap,{className:"ecr-admin-save-button__icon"})," ",r]}),Qi=({setIsEdited:e,title:t,setTitle:r,placeholder:n,style:o})=>a.jsx("div",{children:a.jsx("input",{style:o,className:"ecr-admin-title-input",type:"text",value:t,placeholder:n,onChange:i=>{e&&e(!0),r(i.target.value)}})}),Nf=({uploadedFiles:e,links:t,storyTitle:r,setStoryTitle:n,thumbnail:o})=>{const i=Ne(),[s]=Yt(),l=s.get("sid"),d=s.get("from")||X.ag,c=s.get("gid"),{isSaving:u,saveStory:p}=kf(),m=async()=>{u||!await p({storyId:l,storyTitle:r,uploadedFiles:e,links:t,thumbnail:o})||i(`?view=${d}${c?`&gid=${c}`:""}`,{replace:!0})};return a.jsxs(a.Fragment,{children:[a.jsx(vt,{left:[a.jsx(_t,{name:l?"Update Reel":"Add Reel",Icon:gt},"page"),a.jsx(tr,{},"back")],center:[a.jsx(Qi,{placeholder:"Enter reel title",title:r,setTitle:n},"title")],right:[a.jsx(uo,{onSave:m,isSaving:u,disabled:!e.length},"save")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:"?view=my-reels"},{label:l?"Update Reel":"Add Reel"}]})]})},se=[];for(let e=0;e<256;++e)se.push((e+256).toString(16).slice(1));function Ef(e,t=0){return(se[e[t+0]]+se[e[t+1]]+se[e[t+2]]+se[e[t+3]]+"-"+se[e[t+4]]+se[e[t+5]]+"-"+se[e[t+6]]+se[e[t+7]]+"-"+se[e[t+8]]+se[e[t+9]]+"-"+se[e[t+10]]+se[e[t+11]]+se[e[t+12]]+se[e[t+13]]+se[e[t+14]]+se[e[t+15]]).toLowerCase()}let po;const Tf=new Uint8Array(16);function Af(){if(!po){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");po=crypto.getRandomValues.bind(crypto)}return po(Tf)}const es={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Pf(e,t,r){e=e||{};const n=e.random??e.rng?.()??Af();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Ef(n)}function mo(e,t,r){return es.randomUUID&&!e?es.randomUUID():Pf(e)}const ts="data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23919191'%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20stroke='%23919191'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cg%20data-name='Layer%202'%3e%3cg%20data-name='file-add'%3e%3crect%20width='24'%20height='24'%20opacity='0'/%3e%3cpath%20d='M19.74%207.33l-4.44-5a1%201%200%200%200-.74-.33h-8A2.53%202.53%200%200%200%204%204.5v15A2.53%202.53%200%200%200%206.56%2022h10.88A2.53%202.53%200%200%200%2020%2019.5V8a1%201%200%200%200-.26-.67zM14%2015h-1v1a1%201%200%200%201-2%200v-1h-1a1%201%200%200%201%200-2h1v-1a1%201%200%200%201%202%200v1h1a1%201%200%200%201%200%202zm.71-7a.79.79%200%200%201-.71-.85V4l3.74%204z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",rs=({setUploadedFiles:e,setThumbnail:t,usedFor:r="video",mode:n="files",multiple:o=!1,className:i})=>{const[s,l]=y.useState(!1),d=()=>{const c=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:o,library:{type:[r]}});c.on("select",()=>{const u=c.state().get("selection").toJSON();if(n==="thumbnail"){const m=u[0];m&&t&&t(m.url);return}if(!e)return;const p=u.map(m=>({url:m.url,mime_type:m.mime,file_uuid:mo()}));e(m=>[...m,...p])}),c.open()};return a.jsx("div",{className:F("ecr-admin-upload",s?"ecr-admin-upload--active":"ecr-admin-upload--idle",i),onDragOver:c=>{c.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:c=>{c.preventDefault(),l(!1),d()},children:a.jsxs("label",{className:"ecr-admin-upload__label",htmlFor:"file",onClick:d,children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:ts,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:s?a.jsx("span",{className:"ecr-admin-upload__text-strong",children:"Drop files here..."}):a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsxs("span",{className:"ecr-admin-upload__text-item",children:["Upload ",r]}),n==="files"?a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click or Drag and drop files here"}):null]})})]})})};/**
    219  * @license lucide-react v0.552.0 - ISC
    220  *
    221  * This source code is licensed under the ISC license.
    222  * See the LICENSE file in the root directory of this source tree.
    223  */const Of=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Rf=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),ns=e=>{const t=Rf(e);return t.charAt(0).toUpperCase()+t.slice(1)},os=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),Lf=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
    224  * @license lucide-react v0.552.0 - ISC
    225  *
    226  * This source code is licensed under the ISC license.
    227  * See the LICENSE file in the root directory of this source tree.
    228  */var If={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
    229  * @license lucide-react v0.552.0 - ISC
    230  *
    231  * This source code is licensed under the ISC license.
    232  * See the LICENSE file in the root directory of this source tree.
    233  */const zf=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:s,...l},d)=>y.createElement("svg",{ref:d,...If,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:os("lucide",o),...!i&&!Lf(l)&&{"aria-hidden":"true"},...l},[...s.map(([c,u])=>y.createElement(c,u)),...Array.isArray(i)?i:[i]]));/**
    234  * @license lucide-react v0.552.0 - ISC
    235  *
    236  * This source code is licensed under the ISC license.
    237  * See the LICENSE file in the root directory of this source tree.
    238  */const ue=(e,t)=>{const r=y.forwardRef(({className:n,...o},i)=>y.createElement(zf,{ref:i,iconNode:t,className:os(`lucide-${Of(ns(e))}`,`lucide-${e}`,n),...o}));return r.displayName=ns(e),r};/**
    239  * @license lucide-react v0.552.0 - ISC
    240  *
    241  * This source code is licensed under the ISC license.
    242  * See the LICENSE file in the root directory of this source tree.
    243  */const Mf=ue("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
    244  * @license lucide-react v0.552.0 - ISC
    245  *
    246  * This source code is licensed under the ISC license.
    247  * See the LICENSE file in the root directory of this source tree.
    248  */const fo=ue("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
    249  * @license lucide-react v0.552.0 - ISC
    250  *
    251  * This source code is licensed under the ISC license.
    252  * See the LICENSE file in the root directory of this source tree.
    253  */const Df=ue("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
    254  * @license lucide-react v0.552.0 - ISC
    255  *
    256  * This source code is licensed under the ISC license.
    257  * See the LICENSE file in the root directory of this source tree.
    258  */const Ff=ue("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
    259  * @license lucide-react v0.552.0 - ISC
    260  *
    261  * This source code is licensed under the ISC license.
    262  * See the LICENSE file in the root directory of this source tree.
    263  */const $f=ue("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
    264  * @license lucide-react v0.552.0 - ISC
    265  *
    266  * This source code is licensed under the ISC license.
    267  * See the LICENSE file in the root directory of this source tree.
    268  */const Bf=ue("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
    269  * @license lucide-react v0.552.0 - ISC
    270  *
    271  * This source code is licensed under the ISC license.
    272  * See the LICENSE file in the root directory of this source tree.
    273  */const Uf=ue("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
    274  * @license lucide-react v0.552.0 - ISC
    275  *
    276  * This source code is licensed under the ISC license.
    277  * See the LICENSE file in the root directory of this source tree.
    278  */const Hf=ue("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
    279  * @license lucide-react v0.552.0 - ISC
    280  *
    281  * This source code is licensed under the ISC license.
    282  * See the LICENSE file in the root directory of this source tree.
    283  */const Vf=ue("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
    284  * @license lucide-react v0.552.0 - ISC
    285  *
    286  * This source code is licensed under the ISC license.
    287  * See the LICENSE file in the root directory of this source tree.
    288  */const Wf=ue("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);/**
    289  * @license lucide-react v0.552.0 - ISC
    290  *
    291  * This source code is licensed under the ISC license.
    292  * See the LICENSE file in the root directory of this source tree.
    293  */const qf=ue("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
    294  * @license lucide-react v0.552.0 - ISC
    295  *
    296  * This source code is licensed under the ISC license.
    297  * See the LICENSE file in the root directory of this source tree.
    298  */const Gf=ue("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
    299  * @license lucide-react v0.552.0 - ISC
    300  *
    301  * This source code is licensed under the ISC license.
    302  * See the LICENSE file in the root directory of this source tree.
    303  */const Kf=ue("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
    304  * @license lucide-react v0.552.0 - ISC
    305  *
    306  * This source code is licensed under the ISC license.
    307  * See the LICENSE file in the root directory of this source tree.
    308  */const Yf=ue("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
    309  * @license lucide-react v0.552.0 - ISC
    310  *
    311  * This source code is licensed under the ISC license.
    312  * See the LICENSE file in the root directory of this source tree.
    313  */const Xf=ue("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/**
    314  * @license lucide-react v0.552.0 - ISC
    315  *
    316  * This source code is licensed under the ISC license.
    317  * See the LICENSE file in the root directory of this source tree.
    318  */const Jf=ue("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function V(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function Zf(e,t){const r=x.createContext(t),n=i=>{const{children:s,...l}=i,d=x.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:d,children:s})};n.displayName=e+"Provider";function o(i){const s=x.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,o]}function Ve(e,t=[]){let r=[];function n(i,s){const l=x.createContext(s),d=r.length;r=[...r,s];const c=p=>{const{scope:m,children:g,...b}=p,f=m?.[e]?.[d]||l,h=x.useMemo(()=>b,Object.values(b));return a.jsx(f.Provider,{value:h,children:g})};c.displayName=i+"Provider";function u(p,m){const g=m?.[e]?.[d]||l,b=x.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=r.map(s=>x.createContext(s));return function(l){const d=l?.[e]||i;return x.useMemo(()=>({[`__scope${e}`]:{...l,[e]:d}}),[l,d])}};return o.scopeName=e,[n,Qf(o,...t)]}function Qf(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=n.reduce((l,{useScope:d,scopeName:c})=>{const p=d(i)[`__scope${c}`];return{...l,...p}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var eh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],W=eh.reduce((e,t)=>{const r=nt(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,d=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function th(e,t){e&&vr.flushSync(()=>e.dispatchEvent(t))}function We(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...r)=>t.current?.(...r),[])}function rh(e,t=globalThis?.document){const r=We(e);x.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var nh="DismissableLayer",ho="dismissableLayer.update",oh="dismissableLayer.pointerDownOutside",ah="dismissableLayer.focusOutside",as,is=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gr=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...d}=e,c=x.useContext(is),[u,p]=x.useState(null),m=u?.ownerDocument??globalThis?.document,[,g]=x.useState({}),b=J(t,k=>p(k)),f=Array.from(c.layers),[h]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=f.indexOf(h),_=u?f.indexOf(u):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,j=_>=v,C=lh(k=>{const E=k.target,T=[...c.branches].some(A=>A.contains(E));!j||T||(o?.(k),s?.(k),k.defaultPrevented||l?.())},m),N=ch(k=>{const E=k.target;[...c.branches].some(A=>A.contains(E))||(i?.(k),s?.(k),k.defaultPrevented||l?.())},m);return rh(k=>{_===c.layers.size-1&&(n?.(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},m),x.useEffect(()=>{if(u)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(as=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),ss(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=as)}},[u,m,r,c]),x.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),ss())},[u,c]),x.useEffect(()=>{const k=()=>g({});return document.addEventListener(ho,k),()=>document.removeEventListener(ho,k)},[]),a.jsx(W.div,{...d,ref:b,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:V(e.onFocusCapture,N.onFocusCapture),onBlurCapture:V(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,C.onPointerDownCapture)})});Gr.displayName=nh;var ih="DismissableLayerBranch",sh=x.forwardRef((e,t)=>{const r=x.useContext(is),n=x.useRef(null),o=J(t,n);return x.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),a.jsx(W.div,{...e,ref:o})});sh.displayName=ih;function lh(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let d=function(){ls(oh,r,c,{discrete:!0})};const c={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function ch(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1);return x.useEffect(()=>{const o=i=>{i.target&&!n.current&&ls(ah,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function ss(){const e=new CustomEvent(ho);document.dispatchEvent(e)}function ls(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?th(o,i):o.dispatchEvent(i)}var go=0;function xo(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??cs()),document.body.insertAdjacentElement("beforeend",e[1]??cs()),go++,()=>{go===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),go--}},[])}function cs(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var bo="focusScope.autoFocusOnMount",vo="focusScope.autoFocusOnUnmount",ds={bubbles:!1,cancelable:!0},dh="FocusScope",Kr=x.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[l,d]=x.useState(null),c=We(o),u=We(i),p=x.useRef(null),m=J(t,f=>d(f)),g=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(n){let f=function(w){if(g.paused||!l)return;const j=w.target;l.contains(j)?p.current=j:qe(p.current,{select:!0})},h=function(w){if(g.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||qe(p.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&qe(l)};document.addEventListener("focusin",f),document.addEventListener("focusout",h);const _=new MutationObserver(v);return l&&_.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",h),_.disconnect()}}},[n,l,g.paused]),x.useEffect(()=>{if(l){ms.add(g);const f=document.activeElement;if(!l.contains(f)){const v=new CustomEvent(bo,ds);l.addEventListener(bo,c),l.dispatchEvent(v),v.defaultPrevented||(uh(gh(us(l)),{select:!0}),document.activeElement===f&&qe(l))}return()=>{l.removeEventListener(bo,c),setTimeout(()=>{const v=new CustomEvent(vo,ds);l.addEventListener(vo,u),l.dispatchEvent(v),v.defaultPrevented||qe(f??document.body,{select:!0}),l.removeEventListener(vo,u),ms.remove(g)},0)}}},[l,c,u,g]);const b=x.useCallback(f=>{if(!r&&!n||g.paused)return;const h=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,v=document.activeElement;if(h&&v){const _=f.currentTarget,[w,j]=ph(_);w&&j?!f.shiftKey&&v===j?(f.preventDefault(),r&&qe(w,{select:!0})):f.shiftKey&&v===w&&(f.preventDefault(),r&&qe(j,{select:!0})):v===_&&f.preventDefault()}},[r,n,g.paused]);return a.jsx(W.div,{tabIndex:-1,...s,ref:m,onKeyDown:b})});Kr.displayName=dh;function uh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(qe(n,{select:t}),document.activeElement!==r)return}function ph(e){const t=us(e),r=ps(t,e),n=ps(t.reverse(),e);return[r,n]}function us(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function ps(e,t){for(const r of e)if(!mh(r,{upTo:t}))return r}function mh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function fh(e){return e instanceof HTMLInputElement&&"select"in e}function qe(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&fh(e)&&t&&e.select()}}var ms=hh();function hh(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=fs(e,t),e.unshift(t)},remove(t){e=fs(e,t),e[0]?.resume()}}}function fs(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function gh(e){return e.filter(t=>t.tagName!=="A")}var le=globalThis?.document?x.useLayoutEffect:()=>{},xh=x[" useId ".trim().toString()]||(()=>{}),bh=0;function Ae(e){const[t,r]=x.useState(xh());return le(()=>{r(n=>n??String(bh++))},[e]),e||(t?`radix-${t}`:"")}const vh=["top","right","bottom","left"],Ge=Math.min,xe=Math.max,Yr=Math.round,Xr=Math.floor,Pe=e=>({x:e,y:e}),_h={left:"right",right:"left",bottom:"top",top:"bottom"},yh={start:"end",end:"start"};function _o(e,t,r){return xe(e,Ge(t,r))}function Fe(e,t){return typeof e=="function"?e(t):e}function $e(e){return e.split("-")[0]}function St(e){return e.split("-")[1]}function yo(e){return e==="x"?"y":"x"}function wo(e){return e==="y"?"height":"width"}const wh=new Set(["top","bottom"]);function Oe(e){return wh.has($e(e))?"y":"x"}function jo(e){return yo(Oe(e))}function jh(e,t,r){r===void 0&&(r=!1);const n=St(e),o=jo(e),i=wo(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Jr(s)),[s,Jr(s)]}function Sh(e){const t=Jr(e);return[So(e),t,So(t)]}function So(e){return e.replace(/start|end/g,t=>yh[t])}const hs=["left","right"],gs=["right","left"],Ch=["top","bottom"],kh=["bottom","top"];function Nh(e,t,r){switch(e){case"top":case"bottom":return r?t?gs:hs:t?hs:gs;case"left":case"right":return t?Ch:kh;default:return[]}}function Eh(e,t,r,n){const o=St(e);let i=Nh($e(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(So)))),i}function Jr(e){return e.replace(/left|right|bottom|top/g,t=>_h[t])}function Th(e){return{top:0,right:0,bottom:0,left:0,...e}}function xs(e){return typeof e!="number"?Th(e):{top:e,right:e,bottom:e,left:e}}function Zr(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function bs(e,t,r){let{reference:n,floating:o}=e;const i=Oe(t),s=jo(t),l=wo(s),d=$e(t),c=i==="y",u=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,m=n[l]/2-o[l]/2;let g;switch(d){case"top":g={x:u,y:n.y-o.height};break;case"bottom":g={x:u,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:p};break;case"left":g={x:n.x-o.width,y:p};break;default:g={x:n.x,y:n.y}}switch(St(t)){case"start":g[s]-=m*(r&&c?-1:1);break;case"end":g[s]+=m*(r&&c?-1:1);break}return g}const Ah=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,l=i.filter(Boolean),d=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:p}=bs(c,n,d),m=n,g={},b=0;for(let f=0;f<l.length;f++){const{name:h,fn:v}=l[f],{x:_,y:w,data:j,reset:C}=await v({x:u,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:g,rects:c,platform:s,elements:{reference:e,floating:t}});u=_??u,p=w??p,g={...g,[h]:{...g[h],...j}},C&&b<=50&&(b++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(c=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:p}=bs(c,m,d)),f=-1)}return{x:u,y:p,placement:m,strategy:o,middlewareData:g}};async function lr(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:s,elements:l,strategy:d}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=Fe(t,e),b=xs(g),h=l[m?p==="floating"?"reference":"floating":p],v=Zr(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(h)))==null||r?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:d})),_=p==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),j=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Zr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:_,offsetParent:w,strategy:d}):_);return{top:(v.top-C.top+b.top)/j.y,bottom:(C.bottom-v.bottom+b.bottom)/j.y,left:(v.left-C.left+b.left)/j.x,right:(C.right-v.right+b.right)/j.x}}const Ph=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:l,middlewareData:d}=t,{element:c,padding:u=0}=Fe(e,t)||{};if(c==null)return{};const p=xs(u),m={x:r,y:n},g=jo(o),b=wo(g),f=await s.getDimensions(c),h=g==="y",v=h?"top":"left",_=h?"bottom":"right",w=h?"clientHeight":"clientWidth",j=i.reference[b]+i.reference[g]-m[g]-i.floating[b],C=m[g]-i.reference[g],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let k=N?N[w]:0;(!k||!await(s.isElement==null?void 0:s.isElement(N)))&&(k=l.floating[w]||i.floating[b]);const E=j/2-C/2,T=k/2-f[b]/2-1,A=Ge(p[v],T),O=Ge(p[_],T),R=A,L=k-f[b]-O,P=k/2-f[b]/2+E,M=_o(R,P,L),I=!d.arrow&&St(o)!=null&&P!==M&&i.reference[b]/2-(P<R?A:O)-f[b]/2<0,B=I?P<R?P-R:P-L:0;return{[g]:m[g]+B,data:{[g]:M,centerOffset:P-M-B,...I&&{alignmentOffset:B}},reset:I}}}),Oh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:d,elements:c}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:f=!0,...h}=Fe(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const v=$e(o),_=Oe(l),w=$e(l)===l,j=await(d.isRTL==null?void 0:d.isRTL(c.floating)),C=m||(w||!f?[Jr(l)]:Sh(l)),N=b!=="none";!m&&N&&C.push(...Eh(l,f,b,j));const k=[l,...C],E=await lr(t,h),T=[];let A=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&T.push(E[v]),p){const P=jh(o,s,j);T.push(E[P[0]],E[P[1]])}if(A=[...A,{placement:o,overflows:T}],!T.every(P=>P<=0)){var O,R;const P=(((O=i.flip)==null?void 0:O.index)||0)+1,M=k[P];if(M&&(!(p==="alignment"?_!==Oe(M):!1)||A.every(z=>Oe(z.placement)===_?z.overflows[0]>0:!0)))return{data:{index:P,overflows:A},reset:{placement:M}};let I=(R=A.filter(B=>B.overflows[0]<=0).sort((B,z)=>B.overflows[1]-z.overflows[1])[0])==null?void 0:R.placement;if(!I)switch(g){case"bestFit":{var L;const B=(L=A.filter(z=>{if(N){const q=Oe(z.placement);return q===_||q==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(q=>q>0).reduce((q,ae)=>q+ae,0)]).sort((z,q)=>z[1]-q[1])[0])==null?void 0:L[0];B&&(I=B);break}case"initialPlacement":I=l;break}if(o!==I)return{reset:{placement:I}}}return{}}}};function vs(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _s(e){return vh.some(t=>e[t]>=0)}const Rh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Fe(e,t);switch(n){case"referenceHidden":{const i=await lr(t,{...o,elementContext:"reference"}),s=vs(i,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:_s(s)}}}case"escaped":{const i=await lr(t,{...o,altBoundary:!0}),s=vs(i,r.floating);return{data:{escapedOffsets:s,escaped:_s(s)}}}default:return{}}}}},ys=new Set(["left","top"]);async function Lh(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=$e(r),l=St(r),d=Oe(r)==="y",c=ys.has(s)?-1:1,u=i&&d?-1:1,p=Fe(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof b=="number"&&(g=l==="end"?b*-1:b),d?{x:g*u,y:m*c}:{x:m*c,y:g*u}}const Ih=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:l}=t,d=await Lh(t,e);return s===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+d.x,y:i+d.y,data:{...d,placement:s}}}}},zh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:h=>{let{x:v,y:_}=h;return{x:v,y:_}}},...d}=Fe(e,t),c={x:r,y:n},u=await lr(t,d),p=Oe($e(o)),m=yo(p);let g=c[m],b=c[p];if(i){const h=m==="y"?"top":"left",v=m==="y"?"bottom":"right",_=g+u[h],w=g-u[v];g=_o(_,g,w)}if(s){const h=p==="y"?"top":"left",v=p==="y"?"bottom":"right",_=b+u[h],w=b-u[v];b=_o(_,b,w)}const f=l.fn({...t,[m]:g,[p]:b});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[m]:i,[p]:s}}}}}},Mh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:d=!0,crossAxis:c=!0}=Fe(e,t),u={x:r,y:n},p=Oe(o),m=yo(p);let g=u[m],b=u[p];const f=Fe(l,t),h=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(d){const w=m==="y"?"height":"width",j=i.reference[m]-i.floating[w]+h.mainAxis,C=i.reference[m]+i.reference[w]-h.mainAxis;g<j?g=j:g>C&&(g=C)}if(c){var v,_;const w=m==="y"?"width":"height",j=ys.has($e(o)),C=i.reference[p]-i.floating[w]+(j&&((v=s.offset)==null?void 0:v[p])||0)+(j?0:h.crossAxis),N=i.reference[p]+i.reference[w]+(j?0:((_=s.offset)==null?void 0:_[p])||0)-(j?h.crossAxis:0);b<C?b=C:b>N&&(b=N)}return{[m]:g,[p]:b}}}},Dh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:l}=t,{apply:d=()=>{},...c}=Fe(e,t),u=await lr(t,c),p=$e(o),m=St(o),g=Oe(o)==="y",{width:b,height:f}=i.floating;let h,v;p==="top"||p==="bottom"?(h=p,v=m===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(v=p,h=m==="end"?"top":"bottom");const _=f-u.top-u.bottom,w=b-u.left-u.right,j=Ge(f-u[h],_),C=Ge(b-u[v],w),N=!t.middlewareData.shift;let k=j,E=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(k=_),N&&!m){const A=xe(u.left,0),O=xe(u.right,0),R=xe(u.top,0),L=xe(u.bottom,0);g?E=b-2*(A!==0||O!==0?A+O:xe(u.left,u.right)):k=f-2*(R!==0||L!==0?R+L:xe(u.top,u.bottom))}await d({...t,availableWidth:E,availableHeight:k});const T=await s.getDimensions(l.floating);return b!==T.width||f!==T.height?{reset:{rects:!0}}:{}}}};function Qr(){return typeof window<"u"}function Ct(e){return ws(e)?(e.nodeName||"").toLowerCase():"#document"}function be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Re(e){var t;return(t=(ws(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ws(e){return Qr()?e instanceof Node||e instanceof be(e).Node:!1}function je(e){return Qr()?e instanceof Element||e instanceof be(e).Element:!1}function Le(e){return Qr()?e instanceof HTMLElement||e instanceof be(e).HTMLElement:!1}function js(e){return!Qr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof be(e).ShadowRoot}const Fh=new Set(["inline","contents"]);function cr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Se(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Fh.has(o)}const $h=new Set(["table","td","th"]);function Bh(e){return $h.has(Ct(e))}const Uh=[":popover-open",":modal"];function en(e){return Uh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Hh=["transform","translate","scale","rotate","perspective"],Vh=["transform","translate","scale","rotate","perspective","filter"],Wh=["paint","layout","strict","content"];function Co(e){const t=ko(),r=je(e)?Se(e):e;return Hh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Vh.some(n=>(r.willChange||"").includes(n))||Wh.some(n=>(r.contain||"").includes(n))}function qh(e){let t=Ke(e);for(;Le(t)&&!kt(t);){if(Co(t))return t;if(en(t))return null;t=Ke(t)}return null}function ko(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Gh=new Set(["html","body","#document"]);function kt(e){return Gh.has(Ct(e))}function Se(e){return be(e).getComputedStyle(e)}function tn(e){return je(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ke(e){if(Ct(e)==="html")return e;const t=e.assignedSlot||e.parentNode||js(e)&&e.host||Re(e);return js(t)?t.host:t}function Ss(e){const t=Ke(e);return kt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Le(t)&&cr(t)?t:Ss(t)}function dr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=Ss(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=be(o);if(i){const l=No(s);return t.concat(s,s.visualViewport||[],cr(o)?o:[],l&&r?dr(l):[])}return t.concat(o,dr(o,[],r))}function No(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Cs(e){const t=Se(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Le(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,l=Yr(r)!==i||Yr(n)!==s;return l&&(r=i,n=s),{width:r,height:n,$:l}}function Eo(e){return je(e)?e:e.contextElement}function Nt(e){const t=Eo(e);if(!Le(t))return Pe(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=Cs(t);let s=(i?Yr(r.width):r.width)/n,l=(i?Yr(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Kh=Pe(0);function ks(e){const t=be(e);return!ko()||!t.visualViewport?Kh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Yh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==be(e)?!1:t}function lt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=Eo(e);let s=Pe(1);t&&(n?je(n)&&(s=Nt(n)):s=Nt(e));const l=Yh(i,r,n)?ks(i):Pe(0);let d=(o.left+l.x)/s.x,c=(o.top+l.y)/s.y,u=o.width/s.x,p=o.height/s.y;if(i){const m=be(i),g=n&&je(n)?be(n):n;let b=m,f=No(b);for(;f&&n&&g!==b;){const h=Nt(f),v=f.getBoundingClientRect(),_=Se(f),w=v.left+(f.clientLeft+parseFloat(_.paddingLeft))*h.x,j=v.top+(f.clientTop+parseFloat(_.paddingTop))*h.y;d*=h.x,c*=h.y,u*=h.x,p*=h.y,d+=w,c+=j,b=be(f),f=No(b)}}return Zr({width:u,height:p,x:d,y:c})}function rn(e,t){const r=tn(e).scrollLeft;return t?t.left+r:lt(Re(e)).left+r}function Ns(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-rn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function Xh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=Re(n),l=t?en(t.floating):!1;if(n===s||l&&i)return r;let d={scrollLeft:0,scrollTop:0},c=Pe(1);const u=Pe(0),p=Le(n);if((p||!p&&!i)&&((Ct(n)!=="body"||cr(s))&&(d=tn(n)),Le(n))){const g=lt(n);c=Nt(n),u.x=g.x+n.clientLeft,u.y=g.y+n.clientTop}const m=s&&!p&&!i?Ns(s,d):Pe(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-d.scrollLeft*c.x+u.x+m.x,y:r.y*c.y-d.scrollTop*c.y+u.y+m.y}}function Jh(e){return Array.from(e.getClientRects())}function Zh(e){const t=Re(e),r=tn(e),n=e.ownerDocument.body,o=xe(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=xe(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+rn(e);const l=-r.scrollTop;return Se(n).direction==="rtl"&&(s+=xe(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:l}}const Es=25;function Qh(e,t){const r=be(e),n=Re(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,l=0,d=0;if(o){i=o.width,s=o.height;const u=ko();(!u||u&&t==="fixed")&&(l=o.offsetLeft,d=o.offsetTop)}const c=rn(n);if(c<=0){const u=n.ownerDocument,p=u.body,m=getComputedStyle(p),g=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(n.clientWidth-p.clientWidth-g);b<=Es&&(i-=b)}else c<=Es&&(i+=c);return{width:i,height:s,x:l,y:d}}const eg=new Set(["absolute","fixed"]);function tg(e,t){const r=lt(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=Le(e)?Nt(e):Pe(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,d=o*i.x,c=n*i.y;return{width:s,height:l,x:d,y:c}}function Ts(e,t,r){let n;if(t==="viewport")n=Qh(e,r);else if(t==="document")n=Zh(Re(e));else if(je(t))n=tg(t,r);else{const o=ks(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Zr(n)}function As(e,t){const r=Ke(e);return r===t||!je(r)||kt(r)?!1:Se(r).position==="fixed"||As(r,t)}function rg(e,t){const r=t.get(e);if(r)return r;let n=dr(e,[],!1).filter(l=>je(l)&&Ct(l)!=="body"),o=null;const i=Se(e).position==="fixed";let s=i?Ke(e):e;for(;je(s)&&!kt(s);){const l=Se(s),d=Co(s);!d&&l.position==="fixed"&&(o=null),(i?!d&&!o:!d&&l.position==="static"&&!!o&&eg.has(o.position)||cr(s)&&!d&&As(e,s))?n=n.filter(u=>u!==s):o=l,s=Ke(s)}return t.set(e,n),n}function ng(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?en(t)?[]:rg(t,this._c):[].concat(r),n],l=s[0],d=s.reduce((c,u)=>{const p=Ts(t,u,o);return c.top=xe(p.top,c.top),c.right=Ge(p.right,c.right),c.bottom=Ge(p.bottom,c.bottom),c.left=xe(p.left,c.left),c},Ts(t,l,o));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function og(e){const{width:t,height:r}=Cs(e);return{width:t,height:r}}function ag(e,t,r){const n=Le(t),o=Re(t),i=r==="fixed",s=lt(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const d=Pe(0);function c(){d.x=rn(o)}if(n||!n&&!i)if((Ct(t)!=="body"||cr(o))&&(l=tn(t)),n){const g=lt(t,!0,i,t);d.x=g.x+t.clientLeft,d.y=g.y+t.clientTop}else o&&c();i&&!n&&o&&c();const u=o&&!n&&!i?Ns(o,l):Pe(0),p=s.left+l.scrollLeft-d.x-u.x,m=s.top+l.scrollTop-d.y-u.y;return{x:p,y:m,width:s.width,height:s.height}}function To(e){return Se(e).position==="static"}function Ps(e,t){if(!Le(e)||Se(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Re(e)===r&&(r=r.ownerDocument.body),r}function Os(e,t){const r=be(e);if(en(e))return r;if(!Le(e)){let o=Ke(e);for(;o&&!kt(o);){if(je(o)&&!To(o))return o;o=Ke(o)}return r}let n=Ps(e,t);for(;n&&Bh(n)&&To(n);)n=Ps(n,t);return n&&kt(n)&&To(n)&&!Co(n)?r:n||qh(e)||r}const ig=async function(e){const t=this.getOffsetParent||Os,r=this.getDimensions,n=await r(e.floating);return{reference:ag(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function sg(e){return Se(e).direction==="rtl"}const lg={convertOffsetParentRelativeRectToViewportRelativeRect:Xh,getDocumentElement:Re,getClippingRect:ng,getOffsetParent:Os,getElementRects:ig,getClientRects:Jh,getDimensions:og,getScale:Nt,isElement:je,isRTL:sg};function Rs(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cg(e,t){let r=null,n;const o=Re(e);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function s(l,d){l===void 0&&(l=!1),d===void 0&&(d=1),i();const c=e.getBoundingClientRect(),{left:u,top:p,width:m,height:g}=c;if(l||t(),!m||!g)return;const b=Xr(p),f=Xr(o.clientWidth-(u+m)),h=Xr(o.clientHeight-(p+g)),v=Xr(u),w={rootMargin:-b+"px "+-f+"px "+-h+"px "+-v+"px",threshold:xe(0,Ge(1,d))||1};let j=!0;function C(N){const k=N[0].intersectionRatio;if(k!==d){if(!j)return s();k?s(!1,k):n=setTimeout(()=>{s(!1,1e-7)},1e3)}k===1&&!Rs(c,e.getBoundingClientRect())&&s(),j=!1}try{r=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,w)}r.observe(e)}return s(!0),i}function dg(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:d=!1}=n,c=Eo(e),u=o||i?[...c?dr(c):[],...dr(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",r,{passive:!0}),i&&v.addEventListener("resize",r)});const p=c&&l?cg(c,r):null;let m=-1,g=null;s&&(g=new ResizeObserver(v=>{let[_]=v;_&&_.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),r()}),c&&!d&&g.observe(c),g.observe(t));let b,f=d?lt(e):null;d&&h();function h(){const v=lt(e);f&&!Rs(f,v)&&r(),f=v,b=requestAnimationFrame(h)}return r(),()=>{var v;u.forEach(_=>{o&&_.removeEventListener("scroll",r),i&&_.removeEventListener("resize",r)}),p?.(),(v=g)==null||v.disconnect(),g=null,d&&cancelAnimationFrame(b)}}const ug=Ih,pg=zh,mg=Oh,fg=Dh,hg=Rh,Ls=Ph,gg=Mh,xg=(e,t,r)=>{const n=new Map,o={platform:lg,...r},i={...o.platform,_c:n};return Ah(e,t,{...o,platform:i})};var bg=typeof document<"u",vg=function(){},nn=bg?y.useLayoutEffect:vg;function on(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!on(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!on(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Is(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zs(e,t){const r=Is(e);return Math.round(t*r)/r}function Ao(e){const t=x.useRef(e);return nn(()=>{t.current=e}),t}function _g(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:d,open:c}=e,[u,p]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=x.useState(n);on(m,n)||g(n);const[b,f]=x.useState(null),[h,v]=x.useState(null),_=x.useCallback(z=>{z!==N.current&&(N.current=z,f(z))},[]),w=x.useCallback(z=>{z!==k.current&&(k.current=z,v(z))},[]),j=i||b,C=s||h,N=x.useRef(null),k=x.useRef(null),E=x.useRef(u),T=d!=null,A=Ao(d),O=Ao(o),R=Ao(c),L=x.useCallback(()=>{if(!N.current||!k.current)return;const z={placement:t,strategy:r,middleware:m};O.current&&(z.platform=O.current),xg(N.current,k.current,z).then(q=>{const ae={...q,isPositioned:R.current!==!1};P.current&&!on(E.current,ae)&&(E.current=ae,vr.flushSync(()=>{p(ae)}))})},[m,t,r,O,R]);nn(()=>{c===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(z=>({...z,isPositioned:!1})))},[c]);const P=x.useRef(!1);nn(()=>(P.current=!0,()=>{P.current=!1}),[]),nn(()=>{if(j&&(N.current=j),C&&(k.current=C),j&&C){if(A.current)return A.current(j,C,L);L()}},[j,C,L,A,T]);const M=x.useMemo(()=>({reference:N,floating:k,setReference:_,setFloating:w}),[_,w]),I=x.useMemo(()=>({reference:j,floating:C}),[j,C]),B=x.useMemo(()=>{const z={position:r,left:0,top:0};if(!I.floating)return z;const q=zs(I.floating,u.x),ae=zs(I.floating,u.y);return l?{...z,transform:"translate("+q+"px, "+ae+"px)",...Is(I.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:q,top:ae}},[r,l,I.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:L,refs:M,elements:I,floatingStyles:B}),[u,L,M,I,B])}const yg=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Ls({element:n.current,padding:o}).fn(r):{}:n?Ls({element:n,padding:o}).fn(r):{}}}},wg=(e,t)=>({...ug(e),options:[e,t]}),jg=(e,t)=>({...pg(e),options:[e,t]}),Sg=(e,t)=>({...gg(e),options:[e,t]}),Cg=(e,t)=>({...mg(e),options:[e,t]}),kg=(e,t)=>({...fg(e),options:[e,t]}),Ng=(e,t)=>({...hg(e),options:[e,t]}),Eg=(e,t)=>({...yg(e),options:[e,t]});var Tg="Arrow",Ms=x.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return a.jsx(W.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ms.displayName=Tg;var Ag=Ms;function Pg(e){const[t,r]=x.useState(void 0);return le(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const d=i.borderBoxSize,c=Array.isArray(d)?d[0]:d;s=c.inlineSize,l=c.blockSize}else s=e.offsetWidth,l=e.offsetHeight;r({width:s,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Po="Popper",[Ds,an]=Ve(Po),[Og,Fs]=Ds(Po),$s=e=>{const{__scopePopper:t,children:r}=e,[n,o]=x.useState(null);return a.jsx(Og,{scope:t,anchor:n,onAnchorChange:o,children:r})};$s.displayName=Po;var Bs="PopperAnchor",Us=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Fs(Bs,r),s=x.useRef(null),l=J(t,s),d=x.useRef(null);return x.useEffect(()=>{const c=d.current;d.current=n?.current||s.current,c!==d.current&&i.onAnchorChange(d.current)}),n?null:a.jsx(W.div,{...o,ref:l})});Us.displayName=Bs;var Oo="PopperContent",[Rg,Lg]=Ds(Oo),Hs=x.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:d=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...f}=e,h=Fs(Oo,r),[v,_]=x.useState(null),w=J(t,$=>_($)),[j,C]=x.useState(null),N=Pg(j),k=N?.width??0,E=N?.height??0,T=n+(i!=="center"?"-"+i:""),A=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(c)?c:[c],R=O.length>0,L={padding:A,boundary:O.filter(zg),altBoundary:R},{refs:P,floatingStyles:M,placement:I,isPositioned:B,middlewareData:z}=_g({strategy:"fixed",placement:T,whileElementsMounted:(...$)=>dg(...$,{animationFrame:g==="always"}),elements:{reference:h.anchor},middleware:[wg({mainAxis:o+E,alignmentAxis:s}),d&&jg({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Sg():void 0,...L}),d&&Cg({...L}),kg({...L,apply:({elements:$,rects:Y,availableWidth:oe,availableHeight:Z})=>{const{width:Q,height:re}=Y.reference,_e=$.floating.style;_e.setProperty("--radix-popper-available-width",`${oe}px`),_e.setProperty("--radix-popper-available-height",`${Z}px`),_e.setProperty("--radix-popper-anchor-width",`${Q}px`),_e.setProperty("--radix-popper-anchor-height",`${re}px`)}}),j&&Eg({element:j,padding:l}),Mg({arrowWidth:k,arrowHeight:E}),m&&Ng({strategy:"referenceHidden",...L})]}),[q,ae]=qs(I),ie=We(b);le(()=>{B&&ie?.()},[B,ie]);const ge=z.arrow?.x,ve=z.arrow?.y,pe=z.arrow?.centerOffset!==0,[G,ce]=x.useState();return le(()=>{v&&ce(window.getComputedStyle(v).zIndex)},[v]),a.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:B?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(" "),...z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Rg,{scope:r,placedSide:q,onArrowChange:C,arrowX:ge,arrowY:ve,shouldHideArrow:pe,children:a.jsx(W.div,{"data-side":q,"data-align":ae,...f,ref:w,style:{...f.style,animation:B?void 0:"none"}})})})});Hs.displayName=Oo;var Vs="PopperArrow",Ig={top:"bottom",right:"left",bottom:"top",left:"right"},Ws=x.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Lg(Vs,n),s=Ig[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(Ag,{...o,ref:r,style:{...o.style,display:"block"}})})});Ws.displayName=Vs;function zg(e){return e!==null}var Mg=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,l=s?0:e.arrowWidth,d=s?0:e.arrowHeight,[c,u]=qs(r),p={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+l/2,g=(o.arrow?.y??0)+d/2;let b="",f="";return c==="bottom"?(b=s?p:`${m}px`,f=`${-d}px`):c==="top"?(b=s?p:`${m}px`,f=`${n.floating.height+d}px`):c==="right"?(b=`${-d}px`,f=s?p:`${g}px`):c==="left"&&(b=`${n.floating.width+d}px`,f=s?p:`${g}px`),{data:{x:b,y:f}}}});function qs(e){const[t,r="center"]=e.split("-");return[t,r]}var Gs=$s,Ro=Us,Ks=Hs,Ys=Ws,Dg="Portal",sn=x.forwardRef((e,t)=>{const{container:r,...n}=e,[o,i]=x.useState(!1);le(()=>i(!0),[]);const s=r||o&&globalThis?.document?.body;return s?_a.createPortal(a.jsx(W.div,{...n,ref:t}),s):null});sn.displayName=Dg;function Fg(e,t){return x.useReducer((r,n)=>t[r][n]??r,e)}var Ye=e=>{const{present:t,children:r}=e,n=$g(t),o=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),i=J(n.ref,Bg(o));return typeof r=="function"||n.isPresent?x.cloneElement(o,{ref:i}):null};Ye.displayName="Presence";function $g(e){const[t,r]=x.useState(),n=x.useRef(null),o=x.useRef(e),i=x.useRef("none"),s=e?"mounted":"unmounted",[l,d]=Fg(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const c=ln(n.current);i.current=l==="mounted"?c:"none"},[l]),le(()=>{const c=n.current,u=o.current;if(u!==e){const m=i.current,g=ln(c);e?d("MOUNT"):g==="none"||c?.display==="none"?d("UNMOUNT"):d(u&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),le(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,p=g=>{const f=ln(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&f&&(d("ANIMATION_END"),!o.current)){const h=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h)})}},m=g=>{g.target===t&&(i.current=ln(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function ln(e){return e?.animationName||"none"}function Bg(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Ug=x[" useInsertionEffect ".trim().toString()]||le;function ct({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Hg({defaultProp:t,onChange:r}),l=e!==void 0,d=l?e:o;{const u=x.useRef(e!==void 0);x.useEffect(()=>{const p=u.current;p!==l&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,n])}const c=x.useCallback(u=>{if(l){const p=Vg(u)?u(e):u;p!==e&&s.current?.(p)}else i(u)},[l,e,i,s]);return[d,c]}function Hg({defaultProp:e,onChange:t}){const[r,n]=x.useState(e),o=x.useRef(r),i=x.useRef(t);return Ug(()=>{i.current=t},[t]),x.useEffect(()=>{o.current!==r&&(i.current?.(r),o.current=r)},[r,o]),[r,n,i]}function Vg(e){return typeof e=="function"}var Wg=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Et=new WeakMap,cn=new WeakMap,dn={},Lo=0,Xs=function(e){return e&&(e.host||Xs(e.parentNode))},qg=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Xs(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Gg=function(e,t,r,n){var o=qg(t,Array.isArray(e)?e:[e]);dn[r]||(dn[r]=new WeakMap);var i=dn[r],s=[],l=new Set,d=new Set(o),c=function(p){!p||l.has(p)||(l.add(p),c(p.parentNode))};o.forEach(c);var u=function(p){!p||d.has(p)||Array.prototype.forEach.call(p.children,function(m){if(l.has(m))u(m);else try{var g=m.getAttribute(n),b=g!==null&&g!=="false",f=(Et.get(m)||0)+1,h=(i.get(m)||0)+1;Et.set(m,f),i.set(m,h),s.push(m),f===1&&b&&cn.set(m,!0),h===1&&m.setAttribute(r,"true"),b||m.setAttribute(n,"true")}catch(v){console.error("aria-hidden: cannot operate on ",m,v)}})};return u(t),l.clear(),Lo++,function(){s.forEach(function(p){var m=Et.get(p)-1,g=i.get(p)-1;Et.set(p,m),i.set(p,g),m||(cn.has(p)||p.removeAttribute(n),cn.delete(p)),g||p.removeAttribute(r)}),Lo--,Lo||(Et=new WeakMap,Et=new WeakMap,cn=new WeakMap,dn={})}},Io=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Wg(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Gg(n,o,r,"aria-hidden")):function(){return null}},Ie=function(){return Ie=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Ie.apply(this,arguments)};function Js(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Kg(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var un="right-scroll-bar-position",pn="width-before-scroll-bar",Yg="with-scroll-bars-hidden",Xg="--removed-body-scroll-bar-size";function zo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Jg(e,t){var r=y.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var Zg=typeof window<"u"?x.useLayoutEffect:x.useEffect,Zs=new WeakMap;function Qg(e,t){var r=Jg(null,function(n){return e.forEach(function(o){return zo(o,n)})});return Zg(function(){var n=Zs.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(l){i.has(l)||zo(l,null)}),i.forEach(function(l){o.has(l)||zo(l,s)})}Zs.set(r,e)},[e]),r}function ex(e){return e}function tx(e,t){t===void 0&&(t=ex);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var s=t(i,n);return r.push(s),function(){r=r.filter(function(l){return l!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var l=r;r=[],l.forEach(i),s=r}var d=function(){var u=s;s=[],u.forEach(i)},c=function(){return Promise.resolve().then(d)};c(),r={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),r}}}};return o}function rx(e){e===void 0&&(e={});var t=tx(null);return t.options=Ie({async:!0,ssr:!1},e),t}var Qs=function(e){var t=e.sideCar,r=Js(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return x.createElement(n,Ie({},r))};Qs.isSideCarExport=!0;function nx(e,t){return e.useMedium(t),Qs}var el=rx(),Mo=function(){},mn=x.forwardRef(function(e,t){var r=x.useRef(null),n=x.useState({onScrollCapture:Mo,onWheelCapture:Mo,onTouchMoveCapture:Mo}),o=n[0],i=n[1],s=e.forwardProps,l=e.children,d=e.className,c=e.removeScrollBar,u=e.enabled,p=e.shards,m=e.sideCar,g=e.noRelative,b=e.noIsolation,f=e.inert,h=e.allowPinchZoom,v=e.as,_=v===void 0?"div":v,w=e.gapMode,j=Js(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,N=Qg([r,t]),k=Ie(Ie({},j),o);return x.createElement(x.Fragment,null,u&&x.createElement(C,{sideCar:el,removeScrollBar:c,shards:p,noRelative:g,noIsolation:b,inert:f,setCallbacks:i,allowPinchZoom:!!h,lockRef:r,gapMode:w}),s?x.cloneElement(x.Children.only(l),Ie(Ie({},k),{ref:N})):x.createElement(_,Ie({},k,{className:d,ref:N}),l))});mn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},mn.classNames={fullWidth:pn,zeroRight:un};var ox=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ax(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ox();return t&&e.setAttribute("nonce",t),e}function ix(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function sx(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var lx=function(){var e=0,t=null;return{add:function(r){e==0&&(t=ax())&&(ix(t,r),sx(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},cx=function(){var e=lx();return function(t,r){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},tl=function(){var e=cx(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},dx={left:0,top:0,right:0,gap:0},Do=function(e){return parseInt(e||"",10)||0},ux=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Do(r),Do(n),Do(o)]},px=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return dx;var t=ux(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},mx=tl(),Tt="data-scroll-locked",fx=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,l=e.gap;return r===void 0&&(r="margin"),`
    319   .`.concat(Yg,` {
     217`):" "+Wi(s[0]):"as no adapter specified";throw new U("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o}const qi={getAdapter:vf,adapters:io};function so(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Nt(null,e)}function Gi(e){return so(e),e.headers=fe.from(e.headers),e.data=ao.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),qi.getAdapter(e.adapter||sr.adapter,e)(e).then(function(n){return so(e),n.data=ao.call(e,e.transformResponse,n),n.headers=fe.from(n.headers),n},function(n){return Oi(n)||(so(e),n&&n.response&&(n.response.data=ao.call(e,e.transformResponse,n.response),n.response.headers=fe.from(n.response.headers))),Promise.reject(n)})}const Ki="1.13.1",Wr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Wr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Yi={};Wr.transitional=function(t,r,n){function o(i,s){return"[Axios v"+Ki+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,l)=>{if(t===!1)throw new U(o(s," has been removed"+(r?" in "+r:"")),U.ERR_DEPRECATED);return r&&!Yi[s]&&(Yi[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,l):!0}},Wr.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function yf(e,t,r){if(typeof e!="object")throw new U("options must be an object",U.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],s=t[i];if(s){const l=e[i],c=l===void 0||s(l,i,e);if(c!==!0)throw new U("option "+i+" must be "+c,U.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new U("Unknown option "+i,U.ERR_BAD_OPTION)}}const qr={assertOptions:yf,validators:Wr},Te=qr.validators;let st=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ei,response:new Ei}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
     218`+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=it(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&qr.assertOptions(n,{silentJSONParsing:Te.transitional(Te.boolean),forcedJSONParsing:Te.transitional(Te.boolean),clarifyTimeoutError:Te.transitional(Te.boolean)},!1),o!=null&&(S.isFunction(o)?r.paramsSerializer={serialize:o}:qr.assertOptions(o,{encode:Te.function,serialize:Te.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),qr.assertOptions(r,{baseUrl:Te.spelling("baseURL"),withXsrfToken:Te.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&S.merge(i.common,i[r.method]);i&&S.forEach(["delete","get","head","post","put","patch","common"],b=>{delete i[b]}),r.headers=fe.concat(s,i);const l=[];let c=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(c=c&&f.synchronous,l.unshift(f.fulfilled,f.rejected))});const d=[];this.interceptors.response.forEach(function(f){d.push(f.fulfilled,f.rejected)});let u,p=0,m;if(!c){const b=[Gi.bind(this),void 0];for(b.unshift(...l),b.push(...d),m=b.length,u=Promise.resolve(r);p<m;)u=u.then(b[p++],b[p++]);return u}m=l.length;let g=r;for(;p<m;){const b=l[p++],f=l[p++];try{g=b(g)}catch(h){f.call(this,h);break}}try{u=Gi.call(this,g)}catch(b){return Promise.reject(b)}for(p=0,m=d.length;p<m;)u=u.then(d[p++],d[p++]);return u}getUri(t){t=it(this.defaults,t);const r=zi(t.baseURL,t.url,t.allowAbsoluteUrls);return Ni(r,t.params,t.paramsSerializer)}};S.forEach(["delete","get","head","options"],function(t){st.prototype[t]=function(r,n){return this.request(it(n||{},{method:t,url:r,data:(n||{}).data}))}}),S.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,l){return this.request(it(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}st.prototype[t]=r(),st.prototype[t+"Form"]=r(!0)});let wf=class Sd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(l=>{n.subscribe(l),i=l}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,l){n.reason||(n.reason=new Nt(i,s,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Sd(function(o){t=o}),cancel:t}}};function jf(e){return function(r){return e.apply(null,r)}}function Sf(e){return S.isObject(e)&&e.isAxiosError===!0}const lo={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(lo).forEach(([e,t])=>{lo[t]=e});function Xi(e){const t=new st(e),r=pi(st.prototype.request,t);return S.extend(r,st.prototype,t,{allOwnKeys:!0}),S.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return Xi(it(e,o))},r}const ee=Xi(sr);ee.Axios=st,ee.CanceledError=Nt,ee.CancelToken=wf,ee.isCancel=Oi,ee.VERSION=Ki,ee.toFormData=Br,ee.AxiosError=U,ee.Cancel=ee.CanceledError,ee.all=function(t){return Promise.all(t)},ee.spread=jf,ee.isAxiosError=Sf,ee.mergeConfig=it,ee.AxiosHeaders=fe,ee.formToJSON=e=>Ai(S.isHTMLForm(e)?new FormData(e):e),ee.getAdapter=qi.getAdapter,ee.HttpStatusCode=lo,ee.default=ee;const{Axios:Rv,AxiosError:Lv,CanceledError:Iv,isCancel:zv,CancelToken:Mv,VERSION:Dv,all:Fv,Cancel:$v,isAxiosError:Bv,spread:Uv,toFormData:Hv,AxiosHeaders:Vv,HttpStatusCode:Wv,formToJSON:qv,getAdapter:Gv,mergeConfig:Kv}=ee,Ji=ecommreelsInfo,he=ee.create({baseURL:`${Ji.apiBase}`,headers:{"X-WP-Nonce":Ji.nonce,"Content-Type":"application/json"}}),Cf=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState(!1),o=y.useCallback(async s=>{try{t(!0);const l={styles:tt,story_ids:s},c=await he.post("stories/manage-group-stories",l);return K.success("Group created successfully!"),c.data.group_id}catch(l){return l instanceof Error?K.error(l.message):K.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]),i=y.useCallback(async(s,l,c)=>{try{return n(!0),await he.delete(`story/${s}`),l(d=>d.filter(u=>u.id!==s)),c?.silent||K.success("Reel deleted successfully!"),{ok:!0}}catch(d){const u=d instanceof Error?d.message:"Something went wrong. Try again later!";return c?.silent||K.error(u),{ok:!1,message:u}}finally{n(!1)}},[]);return{styles:tt,isCreating:e,isDeleting:r,createGroup:o,deleteReel:i}};function co(e,t){const[r,n]=y.useState(e);return y.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const Zi=e=>{const[t,r]=y.useState([]),[n,o]=y.useState(1),[i,s]=y.useState(!0),[l,c]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(""),g=co(p,500),b=y.useRef(!0),f=y.useCallback(async w=>{w===1&&b.current?u(!0):c(!0);try{const j={page:w,per_page:20};e&&(j.group_id=e),g&&(j.search=g);const C=await he.get("stories",{params:j}),N=C.data,k=parseInt(C.headers["x-wp-totalpages"]);r(E=>w===1?N:[...E,...N]),o(w+1),s(w<k)}catch(j){j instanceof Error?K.error(j.message):K.error("Something went wrong. Try again later!")}finally{b.current&&(b.current=!1),c(!1),u(!1)}},[e,g]),h=y.useCallback(()=>{o(1),r([]),f(1)},[f]);y.useEffect(()=>{h()},[g,h]);const _=y.useRef(null),v=y.useCallback(w=>{l||(_.current&&_.current.disconnect(),_.current=new IntersectionObserver(j=>{j[0].isIntersecting&&i&&f(n)}),w&&_.current.observe(w))},[l,i,n,f]);return y.useEffect(()=>()=>{_.current&&_.current.disconnect()},[]),{allReels:t,setAllReels:r,searchTerm:p,setSearchTerm:m,isSearching:l,isLoading:d,lastStoryElementRef:v,refreshReels:h}};function kf(){const e=Ne(),{allReels:t,setAllReels:r,isSearching:n,lastStoryElementRef:o,searchTerm:i,setSearchTerm:s,isLoading:l}=Zi(null),{styles:c,isCreating:d,isDeleting:u,createGroup:p,deleteReel:m}=Cf(),[g,b]=y.useState(null),[f,h]=y.useState(null),[_,v]=y.useState(null),[w,j]=y.useState([]),C=async()=>{const A=await p(w);A&&e(`?view=${X.mg}&gid=${A}`)},N=()=>{j(t.map(A=>A.id))},k=A=>{j(O=>O.includes(A)?O.filter(R=>R!==A):[...O,A])},E=()=>{w.length&&h(w)},T=y.useCallback(async()=>{if(g){await m(g,r),b(null);return}if(f?.length){const A=await Promise.all(f.map(P=>m(P,r,{silent:!0}))),O=f.filter((P,M)=>A[M]?.ok),R=O.length,L=f.length-R;R&&(r(P=>P.filter(M=>!O.includes(M.id))),j(P=>P.filter(M=>!O.includes(M)))),R&&K.success(`${R} reels deleted successfully!`),L&&K.error(`${L} reels failed to delete.`),h(null)}},[m,g,f,r]);return l&&!t.length?a.jsx(Ir,{}):a.jsxs(a.Fragment,{children:[(g||f)&&a.jsx(Rr,{onReject:()=>{b(null),h(null)},onAccept:T,isLoading:u,message:f?.length?`Are you sure you want to remove ${f.length} reels?`:"Are you sure you want to remove this reel?"}),a.jsx(jt,{left:[a.jsx(St,{name:"All Reels",Icon:np},"page"),a.jsx(rr,{cb:()=>e(`?view=${X.ag}`)},"back")],center:[a.jsx(zr,{},"reel-wp")],right:[a.jsx(Lr,{to:`?view=${X.cr}&from=${X.ar}`,text:"Add Reel",Icon:vt},"add-reel-all-reel")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"All Reels"}]}),a.jsxs("div",{className:"ecr-admin-panel ecr-admin-panel--reels",children:[a.jsx(jp,{selectedReelIds:w,handleSelectAll:N,clearSelection:()=>j([]),searchTerm:i,setSearchTerm:s,isCreating:d,handleCreateGroup:C,handleBulkDelete:E}),t.length?a.jsx(Zp,{reels:t,styles:c,selectedReelIds:w,onSelectReel:k,onDeleteReel:b,onPreviewReel:v,lastStoryElementRef:o}):!n&&!l?a.jsx(kp,{}):null,n&&a.jsx(Np,{isFullScreen:!t.length})]}),!!_&&a.jsx($p,{previewReel:_,setPreviewReel:v})]})}const Nf=()=>{const[e,t]=y.useState(!1),r=y.useCallback(async({storyId:n,storyTitle:o,uploadedFiles:i,links:s,thumbnail:l})=>{try{t(!0);const c={story_title:o,files:i,links:s};typeof l=="string"&&l.trim().length>0&&(c.thumbnail=l),n&&(c.story_id=n);const d=await he.post("files",c);return K.success(`Story ${n?"updated":"created"} successfully!`),d.data.story_id}catch(c){return c instanceof Error?K.error(c.message):K.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]);return{isSaving:e,saveStory:r}},uo=({isSaving:e,onSave:t,text:r="Save",className:n,...o})=>a.jsxs(te,{onClick:t,className:F("ecr-admin-save-button",n),...o,children:[e?a.jsx(rt,{className:"ecr-admin-save-button__icon ecr-admin-save-button__icon--spin"}):a.jsx(ip,{className:"ecr-admin-save-button__icon"})," ",r]}),Qi=({setIsEdited:e,title:t,setTitle:r,placeholder:n,style:o})=>a.jsx("div",{children:a.jsx("input",{style:o,className:"ecr-admin-title-input",type:"text",value:t,placeholder:n,onChange:i=>{e&&e(!0),r(i.target.value)}})}),Ef=({uploadedFiles:e,links:t,storyTitle:r,setStoryTitle:n,thumbnail:o})=>{const i=Ne(),[s]=Jt(),l=s.get("sid"),c=s.get("from")||X.ag,d=s.get("gid"),{isSaving:u,saveStory:p}=Nf(),m=async()=>{u||!await p({storyId:l,storyTitle:r,uploadedFiles:e,links:t,thumbnail:o})||i(`?view=${c}${d?`&gid=${d}`:""}`,{replace:!0})};return a.jsxs(a.Fragment,{children:[a.jsx(jt,{left:[a.jsx(St,{name:l?"Update Reel":"Add Reel",Icon:vt},"page"),a.jsx(rr,{},"back")],center:[a.jsx(Qi,{placeholder:"Enter reel title",title:r,setTitle:n},"title")],right:[a.jsx(uo,{onSave:m,isSaving:u,disabled:!e.length},"save")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:"?view=my-reels"},{label:l?"Update Reel":"Add Reel"}]})]})},se=[];for(let e=0;e<256;++e)se.push((e+256).toString(16).slice(1));function Tf(e,t=0){return(se[e[t+0]]+se[e[t+1]]+se[e[t+2]]+se[e[t+3]]+"-"+se[e[t+4]]+se[e[t+5]]+"-"+se[e[t+6]]+se[e[t+7]]+"-"+se[e[t+8]]+se[e[t+9]]+"-"+se[e[t+10]]+se[e[t+11]]+se[e[t+12]]+se[e[t+13]]+se[e[t+14]]+se[e[t+15]]).toLowerCase()}let po;const Af=new Uint8Array(16);function Pf(){if(!po){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");po=crypto.getRandomValues.bind(crypto)}return po(Af)}const es={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Of(e,t,r){e=e||{};const n=e.random??e.rng?.()??Pf();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Tf(n)}function mo(e,t,r){return es.randomUUID&&!e?es.randomUUID():Of(e)}const ts="data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23919191'%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20stroke='%23919191'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cg%20data-name='Layer%202'%3e%3cg%20data-name='file-add'%3e%3crect%20width='24'%20height='24'%20opacity='0'/%3e%3cpath%20d='M19.74%207.33l-4.44-5a1%201%200%200%200-.74-.33h-8A2.53%202.53%200%200%200%204%204.5v15A2.53%202.53%200%200%200%206.56%2022h10.88A2.53%202.53%200%200%200%2020%2019.5V8a1%201%200%200%200-.26-.67zM14%2015h-1v1a1%201%200%200%201-2%200v-1h-1a1%201%200%200%201%200-2h1v-1a1%201%200%200%201%202%200v1h1a1%201%200%200%201%200%202zm.71-7a.79.79%200%200%201-.71-.85V4l3.74%204z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",rs=({setUploadedFiles:e,setThumbnail:t,usedFor:r="video",mode:n="files",multiple:o=!1,className:i})=>{const[s,l]=y.useState(!1),c=()=>{const d=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:o,library:{type:[r]}});d.on("select",()=>{const u=d.state().get("selection").toJSON();if(n==="thumbnail"){const m=u[0];m&&t&&t(m.url);return}if(!e)return;const p=u.map(m=>({url:m.url,mime_type:m.mime,file_uuid:mo()}));e(m=>[...m,...p])}),d.open()};return a.jsx("div",{className:F("ecr-admin-upload",s?"ecr-admin-upload--active":"ecr-admin-upload--idle",i),onDragOver:d=>{d.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:d=>{d.preventDefault(),l(!1),c()},children:a.jsxs("label",{className:"ecr-admin-upload__label",htmlFor:"file",onClick:c,children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:ts,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:s?a.jsx("span",{className:"ecr-admin-upload__text-strong",children:"Drop files here..."}):a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsxs("span",{className:"ecr-admin-upload__text-item",children:["Upload ",r]}),n==="files"?a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click or Drag and drop files here"}):null]})})]})})};/**
     219 * @license lucide-react v0.552.0 - ISC
     220 *
     221 * This source code is licensed under the ISC license.
     222 * See the LICENSE file in the root directory of this source tree.
     223 */const Rf=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Lf=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),ns=e=>{const t=Lf(e);return t.charAt(0).toUpperCase()+t.slice(1)},os=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),If=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
     224 * @license lucide-react v0.552.0 - ISC
     225 *
     226 * This source code is licensed under the ISC license.
     227 * See the LICENSE file in the root directory of this source tree.
     228 */var zf={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
     229 * @license lucide-react v0.552.0 - ISC
     230 *
     231 * This source code is licensed under the ISC license.
     232 * See the LICENSE file in the root directory of this source tree.
     233 */const Mf=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:s,...l},c)=>y.createElement("svg",{ref:c,...zf,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:os("lucide",o),...!i&&!If(l)&&{"aria-hidden":"true"},...l},[...s.map(([d,u])=>y.createElement(d,u)),...Array.isArray(i)?i:[i]]));/**
     234 * @license lucide-react v0.552.0 - ISC
     235 *
     236 * This source code is licensed under the ISC license.
     237 * See the LICENSE file in the root directory of this source tree.
     238 */const le=(e,t)=>{const r=y.forwardRef(({className:n,...o},i)=>y.createElement(Mf,{ref:i,iconNode:t,className:os(`lucide-${Rf(ns(e))}`,`lucide-${e}`,n),...o}));return r.displayName=ns(e),r};/**
     239 * @license lucide-react v0.552.0 - ISC
     240 *
     241 * This source code is licensed under the ISC license.
     242 * See the LICENSE file in the root directory of this source tree.
     243 */const Df=le("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
     244 * @license lucide-react v0.552.0 - ISC
     245 *
     246 * This source code is licensed under the ISC license.
     247 * See the LICENSE file in the root directory of this source tree.
     248 */const fo=le("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
     249 * @license lucide-react v0.552.0 - ISC
     250 *
     251 * This source code is licensed under the ISC license.
     252 * See the LICENSE file in the root directory of this source tree.
     253 */const Ff=le("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
     254 * @license lucide-react v0.552.0 - ISC
     255 *
     256 * This source code is licensed under the ISC license.
     257 * See the LICENSE file in the root directory of this source tree.
     258 */const $f=le("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
     259 * @license lucide-react v0.552.0 - ISC
     260 *
     261 * This source code is licensed under the ISC license.
     262 * See the LICENSE file in the root directory of this source tree.
     263 */const Bf=le("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
     264 * @license lucide-react v0.552.0 - ISC
     265 *
     266 * This source code is licensed under the ISC license.
     267 * See the LICENSE file in the root directory of this source tree.
     268 */const Uf=le("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
     269 * @license lucide-react v0.552.0 - ISC
     270 *
     271 * This source code is licensed under the ISC license.
     272 * See the LICENSE file in the root directory of this source tree.
     273 */const Hf=le("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
     274 * @license lucide-react v0.552.0 - ISC
     275 *
     276 * This source code is licensed under the ISC license.
     277 * See the LICENSE file in the root directory of this source tree.
     278 */const Vf=le("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
     279 * @license lucide-react v0.552.0 - ISC
     280 *
     281 * This source code is licensed under the ISC license.
     282 * See the LICENSE file in the root directory of this source tree.
     283 */const Wf=le("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
     284 * @license lucide-react v0.552.0 - ISC
     285 *
     286 * This source code is licensed under the ISC license.
     287 * See the LICENSE file in the root directory of this source tree.
     288 */const qf=le("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);/**
     289 * @license lucide-react v0.552.0 - ISC
     290 *
     291 * This source code is licensed under the ISC license.
     292 * See the LICENSE file in the root directory of this source tree.
     293 */const Gf=le("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
     294 * @license lucide-react v0.552.0 - ISC
     295 *
     296 * This source code is licensed under the ISC license.
     297 * See the LICENSE file in the root directory of this source tree.
     298 */const Kf=le("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
     299 * @license lucide-react v0.552.0 - ISC
     300 *
     301 * This source code is licensed under the ISC license.
     302 * See the LICENSE file in the root directory of this source tree.
     303 */const Yf=le("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
     304 * @license lucide-react v0.552.0 - ISC
     305 *
     306 * This source code is licensed under the ISC license.
     307 * See the LICENSE file in the root directory of this source tree.
     308 */const Xf=le("tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);/**
     309 * @license lucide-react v0.552.0 - ISC
     310 *
     311 * This source code is licensed under the ISC license.
     312 * See the LICENSE file in the root directory of this source tree.
     313 */const Jf=le("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
     314 * @license lucide-react v0.552.0 - ISC
     315 *
     316 * This source code is licensed under the ISC license.
     317 * See the LICENSE file in the root directory of this source tree.
     318 */const Zf=le("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/**
     319 * @license lucide-react v0.552.0 - ISC
     320 *
     321 * This source code is licensed under the ISC license.
     322 * See the LICENSE file in the root directory of this source tree.
     323 */const Qf=le("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function V(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function eh(e,t){const r=x.createContext(t),n=i=>{const{children:s,...l}=i,c=x.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:c,children:s})};n.displayName=e+"Provider";function o(i){const s=x.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,o]}function Ve(e,t=[]){let r=[];function n(i,s){const l=x.createContext(s),c=r.length;r=[...r,s];const d=p=>{const{scope:m,children:g,...b}=p,f=m?.[e]?.[c]||l,h=x.useMemo(()=>b,Object.values(b));return a.jsx(f.Provider,{value:h,children:g})};d.displayName=i+"Provider";function u(p,m){const g=m?.[e]?.[c]||l,b=x.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[d,u]}const o=()=>{const i=r.map(s=>x.createContext(s));return function(l){const c=l?.[e]||i;return x.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[n,th(o,...t)]}function th(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=n.reduce((l,{useScope:c,scopeName:d})=>{const p=c(i)[`__scope${d}`];return{...l,...p}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var rh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],W=rh.reduce((e,t)=>{const r=nt(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function nh(e,t){e&&_r.flushSync(()=>e.dispatchEvent(t))}function We(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...r)=>t.current?.(...r),[])}function oh(e,t=globalThis?.document){const r=We(e);x.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var ah="DismissableLayer",ho="dismissableLayer.update",ih="dismissableLayer.pointerDownOutside",sh="dismissableLayer.focusOutside",as,is=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gr=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...c}=e,d=x.useContext(is),[u,p]=x.useState(null),m=u?.ownerDocument??globalThis?.document,[,g]=x.useState({}),b=J(t,k=>p(k)),f=Array.from(d.layers),[h]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),_=f.indexOf(h),v=u?f.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,j=v>=_,C=dh(k=>{const E=k.target,T=[...d.branches].some(A=>A.contains(E));!j||T||(o?.(k),s?.(k),k.defaultPrevented||l?.())},m),N=uh(k=>{const E=k.target;[...d.branches].some(A=>A.contains(E))||(i?.(k),s?.(k),k.defaultPrevented||l?.())},m);return oh(k=>{v===d.layers.size-1&&(n?.(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},m),x.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(as=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),ss(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=as)}},[u,m,r,d]),x.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),ss())},[u,d]),x.useEffect(()=>{const k=()=>g({});return document.addEventListener(ho,k),()=>document.removeEventListener(ho,k)},[]),a.jsx(W.div,{...c,ref:b,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:V(e.onFocusCapture,N.onFocusCapture),onBlurCapture:V(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,C.onPointerDownCapture)})});Gr.displayName=ah;var lh="DismissableLayerBranch",ch=x.forwardRef((e,t)=>{const r=x.useContext(is),n=x.useRef(null),o=J(t,n);return x.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),a.jsx(W.div,{...e,ref:o})});ch.displayName=lh;function dh(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let c=function(){ls(ih,r,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function uh(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1);return x.useEffect(()=>{const o=i=>{i.target&&!n.current&&ls(sh,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function ss(){const e=new CustomEvent(ho);document.dispatchEvent(e)}function ls(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?nh(o,i):o.dispatchEvent(i)}var go=0;function xo(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??cs()),document.body.insertAdjacentElement("beforeend",e[1]??cs()),go++,()=>{go===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),go--}},[])}function cs(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var bo="focusScope.autoFocusOnMount",_o="focusScope.autoFocusOnUnmount",ds={bubbles:!1,cancelable:!0},ph="FocusScope",Kr=x.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[l,c]=x.useState(null),d=We(o),u=We(i),p=x.useRef(null),m=J(t,f=>c(f)),g=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(n){let f=function(w){if(g.paused||!l)return;const j=w.target;l.contains(j)?p.current=j:qe(p.current,{select:!0})},h=function(w){if(g.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||qe(p.current,{select:!0}))},_=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&qe(l)};document.addEventListener("focusin",f),document.addEventListener("focusout",h);const v=new MutationObserver(_);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",h),v.disconnect()}}},[n,l,g.paused]),x.useEffect(()=>{if(l){ms.add(g);const f=document.activeElement;if(!l.contains(f)){const _=new CustomEvent(bo,ds);l.addEventListener(bo,d),l.dispatchEvent(_),_.defaultPrevented||(mh(bh(us(l)),{select:!0}),document.activeElement===f&&qe(l))}return()=>{l.removeEventListener(bo,d),setTimeout(()=>{const _=new CustomEvent(_o,ds);l.addEventListener(_o,u),l.dispatchEvent(_),_.defaultPrevented||qe(f??document.body,{select:!0}),l.removeEventListener(_o,u),ms.remove(g)},0)}}},[l,d,u,g]);const b=x.useCallback(f=>{if(!r&&!n||g.paused)return;const h=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,_=document.activeElement;if(h&&_){const v=f.currentTarget,[w,j]=fh(v);w&&j?!f.shiftKey&&_===j?(f.preventDefault(),r&&qe(w,{select:!0})):f.shiftKey&&_===w&&(f.preventDefault(),r&&qe(j,{select:!0})):_===v&&f.preventDefault()}},[r,n,g.paused]);return a.jsx(W.div,{tabIndex:-1,...s,ref:m,onKeyDown:b})});Kr.displayName=ph;function mh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(qe(n,{select:t}),document.activeElement!==r)return}function fh(e){const t=us(e),r=ps(t,e),n=ps(t.reverse(),e);return[r,n]}function us(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function ps(e,t){for(const r of e)if(!hh(r,{upTo:t}))return r}function hh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function gh(e){return e instanceof HTMLInputElement&&"select"in e}function qe(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&gh(e)&&t&&e.select()}}var ms=xh();function xh(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=fs(e,t),e.unshift(t)},remove(t){e=fs(e,t),e[0]?.resume()}}}function fs(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function bh(e){return e.filter(t=>t.tagName!=="A")}var ce=globalThis?.document?x.useLayoutEffect:()=>{},_h=x[" useId ".trim().toString()]||(()=>{}),vh=0;function Ae(e){const[t,r]=x.useState(_h());return ce(()=>{r(n=>n??String(vh++))},[e]),e||(t?`radix-${t}`:"")}const yh=["top","right","bottom","left"],Ge=Math.min,xe=Math.max,Yr=Math.round,Xr=Math.floor,Pe=e=>({x:e,y:e}),wh={left:"right",right:"left",bottom:"top",top:"bottom"},jh={start:"end",end:"start"};function vo(e,t,r){return xe(e,Ge(t,r))}function Fe(e,t){return typeof e=="function"?e(t):e}function $e(e){return e.split("-")[0]}function Et(e){return e.split("-")[1]}function yo(e){return e==="x"?"y":"x"}function wo(e){return e==="y"?"height":"width"}const Sh=new Set(["top","bottom"]);function Oe(e){return Sh.has($e(e))?"y":"x"}function jo(e){return yo(Oe(e))}function Ch(e,t,r){r===void 0&&(r=!1);const n=Et(e),o=jo(e),i=wo(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Jr(s)),[s,Jr(s)]}function kh(e){const t=Jr(e);return[So(e),t,So(t)]}function So(e){return e.replace(/start|end/g,t=>jh[t])}const hs=["left","right"],gs=["right","left"],Nh=["top","bottom"],Eh=["bottom","top"];function Th(e,t,r){switch(e){case"top":case"bottom":return r?t?gs:hs:t?hs:gs;case"left":case"right":return t?Nh:Eh;default:return[]}}function Ah(e,t,r,n){const o=Et(e);let i=Th($e(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(So)))),i}function Jr(e){return e.replace(/left|right|bottom|top/g,t=>wh[t])}function Ph(e){return{top:0,right:0,bottom:0,left:0,...e}}function xs(e){return typeof e!="number"?Ph(e):{top:e,right:e,bottom:e,left:e}}function Zr(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function bs(e,t,r){let{reference:n,floating:o}=e;const i=Oe(t),s=jo(t),l=wo(s),c=$e(t),d=i==="y",u=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,m=n[l]/2-o[l]/2;let g;switch(c){case"top":g={x:u,y:n.y-o.height};break;case"bottom":g={x:u,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:p};break;case"left":g={x:n.x-o.width,y:p};break;default:g={x:n.x,y:n.y}}switch(Et(t)){case"start":g[s]-=m*(r&&d?-1:1);break;case"end":g[s]+=m*(r&&d?-1:1);break}return g}const Oh=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:p}=bs(d,n,c),m=n,g={},b=0;for(let f=0;f<l.length;f++){const{name:h,fn:_}=l[f],{x:v,y:w,data:j,reset:C}=await _({x:u,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:g,rects:d,platform:s,elements:{reference:e,floating:t}});u=v??u,p=w??p,g={...g,[h]:{...g[h],...j}},C&&b<=50&&(b++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(d=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:p}=bs(d,m,c)),f=-1)}return{x:u,y:p,placement:m,strategy:o,middlewareData:g}};async function cr(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:s,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=Fe(t,e),b=xs(g),h=l[m?p==="floating"?"reference":"floating":p],_=Zr(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(h)))==null||r?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),v=p==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),j=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Zr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:w,strategy:c}):v);return{top:(_.top-C.top+b.top)/j.y,bottom:(C.bottom-_.bottom+b.bottom)/j.y,left:(_.left-C.left+b.left)/j.x,right:(C.right-_.right+b.right)/j.x}}const Rh=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=Fe(e,t)||{};if(d==null)return{};const p=xs(u),m={x:r,y:n},g=jo(o),b=wo(g),f=await s.getDimensions(d),h=g==="y",_=h?"top":"left",v=h?"bottom":"right",w=h?"clientHeight":"clientWidth",j=i.reference[b]+i.reference[g]-m[g]-i.floating[b],C=m[g]-i.reference[g],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let k=N?N[w]:0;(!k||!await(s.isElement==null?void 0:s.isElement(N)))&&(k=l.floating[w]||i.floating[b]);const E=j/2-C/2,T=k/2-f[b]/2-1,A=Ge(p[_],T),O=Ge(p[v],T),R=A,L=k-f[b]-O,P=k/2-f[b]/2+E,M=vo(R,P,L),I=!c.arrow&&Et(o)!=null&&P!==M&&i.reference[b]/2-(P<R?A:O)-f[b]/2<0,B=I?P<R?P-R:P-L:0;return{[g]:m[g]+B,data:{[g]:M,centerOffset:P-M-B,...I&&{alignmentOffset:B}},reset:I}}}),Lh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:f=!0,...h}=Fe(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const _=$e(o),v=Oe(l),w=$e(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(d.floating)),C=m||(w||!f?[Jr(l)]:kh(l)),N=b!=="none";!m&&N&&C.push(...Ah(l,f,b,j));const k=[l,...C],E=await cr(t,h),T=[];let A=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&T.push(E[_]),p){const P=Ch(o,s,j);T.push(E[P[0]],E[P[1]])}if(A=[...A,{placement:o,overflows:T}],!T.every(P=>P<=0)){var O,R;const P=(((O=i.flip)==null?void 0:O.index)||0)+1,M=k[P];if(M&&(!(p==="alignment"?v!==Oe(M):!1)||A.every(z=>Oe(z.placement)===v?z.overflows[0]>0:!0)))return{data:{index:P,overflows:A},reset:{placement:M}};let I=(R=A.filter(B=>B.overflows[0]<=0).sort((B,z)=>B.overflows[1]-z.overflows[1])[0])==null?void 0:R.placement;if(!I)switch(g){case"bestFit":{var L;const B=(L=A.filter(z=>{if(N){const q=Oe(z.placement);return q===v||q==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(q=>q>0).reduce((q,ae)=>q+ae,0)]).sort((z,q)=>z[1]-q[1])[0])==null?void 0:L[0];B&&(I=B);break}case"initialPlacement":I=l;break}if(o!==I)return{reset:{placement:I}}}return{}}}};function _s(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vs(e){return yh.some(t=>e[t]>=0)}const Ih=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Fe(e,t);switch(n){case"referenceHidden":{const i=await cr(t,{...o,elementContext:"reference"}),s=_s(i,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:vs(s)}}}case"escaped":{const i=await cr(t,{...o,altBoundary:!0}),s=_s(i,r.floating);return{data:{escapedOffsets:s,escaped:vs(s)}}}default:return{}}}}},ys=new Set(["left","top"]);async function zh(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=$e(r),l=Et(r),c=Oe(r)==="y",d=ys.has(s)?-1:1,u=i&&c?-1:1,p=Fe(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof b=="number"&&(g=l==="end"?b*-1:b),c?{x:g*u,y:m*d}:{x:m*d,y:g*u}}const Mh=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:l}=t,c=await zh(t,e);return s===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},Dh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:h=>{let{x:_,y:v}=h;return{x:_,y:v}}},...c}=Fe(e,t),d={x:r,y:n},u=await cr(t,c),p=Oe($e(o)),m=yo(p);let g=d[m],b=d[p];if(i){const h=m==="y"?"top":"left",_=m==="y"?"bottom":"right",v=g+u[h],w=g-u[_];g=vo(v,g,w)}if(s){const h=p==="y"?"top":"left",_=p==="y"?"bottom":"right",v=b+u[h],w=b-u[_];b=vo(v,b,w)}const f=l.fn({...t,[m]:g,[p]:b});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[m]:i,[p]:s}}}}}},Fh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=Fe(e,t),u={x:r,y:n},p=Oe(o),m=yo(p);let g=u[m],b=u[p];const f=Fe(l,t),h=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const w=m==="y"?"height":"width",j=i.reference[m]-i.floating[w]+h.mainAxis,C=i.reference[m]+i.reference[w]-h.mainAxis;g<j?g=j:g>C&&(g=C)}if(d){var _,v;const w=m==="y"?"width":"height",j=ys.has($e(o)),C=i.reference[p]-i.floating[w]+(j&&((_=s.offset)==null?void 0:_[p])||0)+(j?0:h.crossAxis),N=i.reference[p]+i.reference[w]+(j?0:((v=s.offset)==null?void 0:v[p])||0)-(j?h.crossAxis:0);b<C?b=C:b>N&&(b=N)}return{[m]:g,[p]:b}}}},$h=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:l}=t,{apply:c=()=>{},...d}=Fe(e,t),u=await cr(t,d),p=$e(o),m=Et(o),g=Oe(o)==="y",{width:b,height:f}=i.floating;let h,_;p==="top"||p==="bottom"?(h=p,_=m===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(_=p,h=m==="end"?"top":"bottom");const v=f-u.top-u.bottom,w=b-u.left-u.right,j=Ge(f-u[h],v),C=Ge(b-u[_],w),N=!t.middlewareData.shift;let k=j,E=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(k=v),N&&!m){const A=xe(u.left,0),O=xe(u.right,0),R=xe(u.top,0),L=xe(u.bottom,0);g?E=b-2*(A!==0||O!==0?A+O:xe(u.left,u.right)):k=f-2*(R!==0||L!==0?R+L:xe(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:k});const T=await s.getDimensions(l.floating);return b!==T.width||f!==T.height?{reset:{rects:!0}}:{}}}};function Qr(){return typeof window<"u"}function Tt(e){return ws(e)?(e.nodeName||"").toLowerCase():"#document"}function be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Re(e){var t;return(t=(ws(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ws(e){return Qr()?e instanceof Node||e instanceof be(e).Node:!1}function je(e){return Qr()?e instanceof Element||e instanceof be(e).Element:!1}function Le(e){return Qr()?e instanceof HTMLElement||e instanceof be(e).HTMLElement:!1}function js(e){return!Qr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof be(e).ShadowRoot}const Bh=new Set(["inline","contents"]);function dr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Se(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Bh.has(o)}const Uh=new Set(["table","td","th"]);function Hh(e){return Uh.has(Tt(e))}const Vh=[":popover-open",":modal"];function en(e){return Vh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Wh=["transform","translate","scale","rotate","perspective"],qh=["transform","translate","scale","rotate","perspective","filter"],Gh=["paint","layout","strict","content"];function Co(e){const t=ko(),r=je(e)?Se(e):e;return Wh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||qh.some(n=>(r.willChange||"").includes(n))||Gh.some(n=>(r.contain||"").includes(n))}function Kh(e){let t=Ke(e);for(;Le(t)&&!At(t);){if(Co(t))return t;if(en(t))return null;t=Ke(t)}return null}function ko(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Yh=new Set(["html","body","#document"]);function At(e){return Yh.has(Tt(e))}function Se(e){return be(e).getComputedStyle(e)}function tn(e){return je(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ke(e){if(Tt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||js(e)&&e.host||Re(e);return js(t)?t.host:t}function Ss(e){const t=Ke(e);return At(t)?e.ownerDocument?e.ownerDocument.body:e.body:Le(t)&&dr(t)?t:Ss(t)}function ur(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=Ss(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=be(o);if(i){const l=No(s);return t.concat(s,s.visualViewport||[],dr(o)?o:[],l&&r?ur(l):[])}return t.concat(o,ur(o,[],r))}function No(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Cs(e){const t=Se(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Le(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,l=Yr(r)!==i||Yr(n)!==s;return l&&(r=i,n=s),{width:r,height:n,$:l}}function Eo(e){return je(e)?e:e.contextElement}function Pt(e){const t=Eo(e);if(!Le(t))return Pe(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=Cs(t);let s=(i?Yr(r.width):r.width)/n,l=(i?Yr(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Xh=Pe(0);function ks(e){const t=be(e);return!ko()||!t.visualViewport?Xh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Jh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==be(e)?!1:t}function lt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=Eo(e);let s=Pe(1);t&&(n?je(n)&&(s=Pt(n)):s=Pt(e));const l=Jh(i,r,n)?ks(i):Pe(0);let c=(o.left+l.x)/s.x,d=(o.top+l.y)/s.y,u=o.width/s.x,p=o.height/s.y;if(i){const m=be(i),g=n&&je(n)?be(n):n;let b=m,f=No(b);for(;f&&n&&g!==b;){const h=Pt(f),_=f.getBoundingClientRect(),v=Se(f),w=_.left+(f.clientLeft+parseFloat(v.paddingLeft))*h.x,j=_.top+(f.clientTop+parseFloat(v.paddingTop))*h.y;c*=h.x,d*=h.y,u*=h.x,p*=h.y,c+=w,d+=j,b=be(f),f=No(b)}}return Zr({width:u,height:p,x:c,y:d})}function rn(e,t){const r=tn(e).scrollLeft;return t?t.left+r:lt(Re(e)).left+r}function Ns(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-rn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function Zh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=Re(n),l=t?en(t.floating):!1;if(n===s||l&&i)return r;let c={scrollLeft:0,scrollTop:0},d=Pe(1);const u=Pe(0),p=Le(n);if((p||!p&&!i)&&((Tt(n)!=="body"||dr(s))&&(c=tn(n)),Le(n))){const g=lt(n);d=Pt(n),u.x=g.x+n.clientLeft,u.y=g.y+n.clientTop}const m=s&&!p&&!i?Ns(s,c):Pe(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+u.x+m.x,y:r.y*d.y-c.scrollTop*d.y+u.y+m.y}}function Qh(e){return Array.from(e.getClientRects())}function eg(e){const t=Re(e),r=tn(e),n=e.ownerDocument.body,o=xe(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=xe(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+rn(e);const l=-r.scrollTop;return Se(n).direction==="rtl"&&(s+=xe(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:l}}const Es=25;function tg(e,t){const r=be(e),n=Re(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,l=0,c=0;if(o){i=o.width,s=o.height;const u=ko();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const d=rn(n);if(d<=0){const u=n.ownerDocument,p=u.body,m=getComputedStyle(p),g=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(n.clientWidth-p.clientWidth-g);b<=Es&&(i-=b)}else d<=Es&&(i+=d);return{width:i,height:s,x:l,y:c}}const rg=new Set(["absolute","fixed"]);function ng(e,t){const r=lt(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=Le(e)?Pt(e):Pe(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,d=n*i.y;return{width:s,height:l,x:c,y:d}}function Ts(e,t,r){let n;if(t==="viewport")n=tg(e,r);else if(t==="document")n=eg(Re(e));else if(je(t))n=ng(t,r);else{const o=ks(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Zr(n)}function As(e,t){const r=Ke(e);return r===t||!je(r)||At(r)?!1:Se(r).position==="fixed"||As(r,t)}function og(e,t){const r=t.get(e);if(r)return r;let n=ur(e,[],!1).filter(l=>je(l)&&Tt(l)!=="body"),o=null;const i=Se(e).position==="fixed";let s=i?Ke(e):e;for(;je(s)&&!At(s);){const l=Se(s),c=Co(s);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&rg.has(o.position)||dr(s)&&!c&&As(e,s))?n=n.filter(u=>u!==s):o=l,s=Ke(s)}return t.set(e,n),n}function ag(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?en(t)?[]:og(t,this._c):[].concat(r),n],l=s[0],c=s.reduce((d,u)=>{const p=Ts(t,u,o);return d.top=xe(p.top,d.top),d.right=Ge(p.right,d.right),d.bottom=Ge(p.bottom,d.bottom),d.left=xe(p.left,d.left),d},Ts(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ig(e){const{width:t,height:r}=Cs(e);return{width:t,height:r}}function sg(e,t,r){const n=Le(t),o=Re(t),i=r==="fixed",s=lt(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Pe(0);function d(){c.x=rn(o)}if(n||!n&&!i)if((Tt(t)!=="body"||dr(o))&&(l=tn(t)),n){const g=lt(t,!0,i,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&d();i&&!n&&o&&d();const u=o&&!n&&!i?Ns(o,l):Pe(0),p=s.left+l.scrollLeft-c.x-u.x,m=s.top+l.scrollTop-c.y-u.y;return{x:p,y:m,width:s.width,height:s.height}}function To(e){return Se(e).position==="static"}function Ps(e,t){if(!Le(e)||Se(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Re(e)===r&&(r=r.ownerDocument.body),r}function Os(e,t){const r=be(e);if(en(e))return r;if(!Le(e)){let o=Ke(e);for(;o&&!At(o);){if(je(o)&&!To(o))return o;o=Ke(o)}return r}let n=Ps(e,t);for(;n&&Hh(n)&&To(n);)n=Ps(n,t);return n&&At(n)&&To(n)&&!Co(n)?r:n||Kh(e)||r}const lg=async function(e){const t=this.getOffsetParent||Os,r=this.getDimensions,n=await r(e.floating);return{reference:sg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function cg(e){return Se(e).direction==="rtl"}const dg={convertOffsetParentRelativeRectToViewportRelativeRect:Zh,getDocumentElement:Re,getClippingRect:ag,getOffsetParent:Os,getElementRects:lg,getClientRects:Qh,getDimensions:ig,getScale:Pt,isElement:je,isRTL:cg};function Rs(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ug(e,t){let r=null,n;const o=Re(e);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:u,top:p,width:m,height:g}=d;if(l||t(),!m||!g)return;const b=Xr(p),f=Xr(o.clientWidth-(u+m)),h=Xr(o.clientHeight-(p+g)),_=Xr(u),w={rootMargin:-b+"px "+-f+"px "+-h+"px "+-_+"px",threshold:xe(0,Ge(1,c))||1};let j=!0;function C(N){const k=N[0].intersectionRatio;if(k!==c){if(!j)return s();k?s(!1,k):n=setTimeout(()=>{s(!1,1e-7)},1e3)}k===1&&!Rs(d,e.getBoundingClientRect())&&s(),j=!1}try{r=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,w)}r.observe(e)}return s(!0),i}function pg(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=Eo(e),u=o||i?[...d?ur(d):[],...ur(t)]:[];u.forEach(_=>{o&&_.addEventListener("scroll",r,{passive:!0}),i&&_.addEventListener("resize",r)});const p=d&&l?ug(d,r):null;let m=-1,g=null;s&&(g=new ResizeObserver(_=>{let[v]=_;v&&v.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),r()}),d&&!c&&g.observe(d),g.observe(t));let b,f=c?lt(e):null;c&&h();function h(){const _=lt(e);f&&!Rs(f,_)&&r(),f=_,b=requestAnimationFrame(h)}return r(),()=>{var _;u.forEach(v=>{o&&v.removeEventListener("scroll",r),i&&v.removeEventListener("resize",r)}),p?.(),(_=g)==null||_.disconnect(),g=null,c&&cancelAnimationFrame(b)}}const mg=Mh,fg=Dh,hg=Lh,gg=$h,xg=Ih,Ls=Rh,bg=Fh,_g=(e,t,r)=>{const n=new Map,o={platform:dg,...r},i={...o.platform,_c:n};return Oh(e,t,{...o,platform:i})};var vg=typeof document<"u",yg=function(){},nn=vg?y.useLayoutEffect:yg;function on(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!on(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!on(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Is(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zs(e,t){const r=Is(e);return Math.round(t*r)/r}function Ao(e){const t=x.useRef(e);return nn(()=>{t.current=e}),t}function wg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,p]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=x.useState(n);on(m,n)||g(n);const[b,f]=x.useState(null),[h,_]=x.useState(null),v=x.useCallback(z=>{z!==N.current&&(N.current=z,f(z))},[]),w=x.useCallback(z=>{z!==k.current&&(k.current=z,_(z))},[]),j=i||b,C=s||h,N=x.useRef(null),k=x.useRef(null),E=x.useRef(u),T=c!=null,A=Ao(c),O=Ao(o),R=Ao(d),L=x.useCallback(()=>{if(!N.current||!k.current)return;const z={placement:t,strategy:r,middleware:m};O.current&&(z.platform=O.current),_g(N.current,k.current,z).then(q=>{const ae={...q,isPositioned:R.current!==!1};P.current&&!on(E.current,ae)&&(E.current=ae,_r.flushSync(()=>{p(ae)}))})},[m,t,r,O,R]);nn(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(z=>({...z,isPositioned:!1})))},[d]);const P=x.useRef(!1);nn(()=>(P.current=!0,()=>{P.current=!1}),[]),nn(()=>{if(j&&(N.current=j),C&&(k.current=C),j&&C){if(A.current)return A.current(j,C,L);L()}},[j,C,L,A,T]);const M=x.useMemo(()=>({reference:N,floating:k,setReference:v,setFloating:w}),[v,w]),I=x.useMemo(()=>({reference:j,floating:C}),[j,C]),B=x.useMemo(()=>{const z={position:r,left:0,top:0};if(!I.floating)return z;const q=zs(I.floating,u.x),ae=zs(I.floating,u.y);return l?{...z,transform:"translate("+q+"px, "+ae+"px)",...Is(I.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:q,top:ae}},[r,l,I.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:L,refs:M,elements:I,floatingStyles:B}),[u,L,M,I,B])}const jg=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Ls({element:n.current,padding:o}).fn(r):{}:n?Ls({element:n,padding:o}).fn(r):{}}}},Sg=(e,t)=>({...mg(e),options:[e,t]}),Cg=(e,t)=>({...fg(e),options:[e,t]}),kg=(e,t)=>({...bg(e),options:[e,t]}),Ng=(e,t)=>({...hg(e),options:[e,t]}),Eg=(e,t)=>({...gg(e),options:[e,t]}),Tg=(e,t)=>({...xg(e),options:[e,t]}),Ag=(e,t)=>({...jg(e),options:[e,t]});var Pg="Arrow",Ms=x.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return a.jsx(W.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ms.displayName=Pg;var Og=Ms;function Rg(e){const[t,r]=x.useState(void 0);return ce(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;r({width:s,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Po="Popper",[Ds,an]=Ve(Po),[Lg,Fs]=Ds(Po),$s=e=>{const{__scopePopper:t,children:r}=e,[n,o]=x.useState(null);return a.jsx(Lg,{scope:t,anchor:n,onAnchorChange:o,children:r})};$s.displayName=Po;var Bs="PopperAnchor",Us=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Fs(Bs,r),s=x.useRef(null),l=J(t,s),c=x.useRef(null);return x.useEffect(()=>{const d=c.current;c.current=n?.current||s.current,d!==c.current&&i.onAnchorChange(c.current)}),n?null:a.jsx(W.div,{...o,ref:l})});Us.displayName=Bs;var Oo="PopperContent",[Ig,zg]=Ds(Oo),Hs=x.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...f}=e,h=Fs(Oo,r),[_,v]=x.useState(null),w=J(t,$=>v($)),[j,C]=x.useState(null),N=Rg(j),k=N?.width??0,E=N?.height??0,T=n+(i!=="center"?"-"+i:""),A=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(d)?d:[d],R=O.length>0,L={padding:A,boundary:O.filter(Dg),altBoundary:R},{refs:P,floatingStyles:M,placement:I,isPositioned:B,middlewareData:z}=wg({strategy:"fixed",placement:T,whileElementsMounted:(...$)=>pg(...$,{animationFrame:g==="always"}),elements:{reference:h.anchor},middleware:[Sg({mainAxis:o+E,alignmentAxis:s}),c&&Cg({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?kg():void 0,...L}),c&&Ng({...L}),Eg({...L,apply:({elements:$,rects:Y,availableWidth:oe,availableHeight:Z})=>{const{width:Q,height:re}=Y.reference,ve=$.floating.style;ve.setProperty("--radix-popper-available-width",`${oe}px`),ve.setProperty("--radix-popper-available-height",`${Z}px`),ve.setProperty("--radix-popper-anchor-width",`${Q}px`),ve.setProperty("--radix-popper-anchor-height",`${re}px`)}}),j&&Ag({element:j,padding:l}),Fg({arrowWidth:k,arrowHeight:E}),m&&Tg({strategy:"referenceHidden",...L})]}),[q,ae]=qs(I),ie=We(b);ce(()=>{B&&ie?.()},[B,ie]);const ge=z.arrow?.x,_e=z.arrow?.y,pe=z.arrow?.centerOffset!==0,[G,de]=x.useState();return ce(()=>{_&&de(window.getComputedStyle(_).zIndex)},[_]),a.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:B?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(" "),...z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Ig,{scope:r,placedSide:q,onArrowChange:C,arrowX:ge,arrowY:_e,shouldHideArrow:pe,children:a.jsx(W.div,{"data-side":q,"data-align":ae,...f,ref:w,style:{...f.style,animation:B?void 0:"none"}})})})});Hs.displayName=Oo;var Vs="PopperArrow",Mg={top:"bottom",right:"left",bottom:"top",left:"right"},Ws=x.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=zg(Vs,n),s=Mg[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(Og,{...o,ref:r,style:{...o.style,display:"block"}})})});Ws.displayName=Vs;function Dg(e){return e!==null}var Fg=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,l=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[d,u]=qs(r),p={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+l/2,g=(o.arrow?.y??0)+c/2;let b="",f="";return d==="bottom"?(b=s?p:`${m}px`,f=`${-c}px`):d==="top"?(b=s?p:`${m}px`,f=`${n.floating.height+c}px`):d==="right"?(b=`${-c}px`,f=s?p:`${g}px`):d==="left"&&(b=`${n.floating.width+c}px`,f=s?p:`${g}px`),{data:{x:b,y:f}}}});function qs(e){const[t,r="center"]=e.split("-");return[t,r]}var Gs=$s,Ro=Us,Ks=Hs,Ys=Ws,$g="Portal",sn=x.forwardRef((e,t)=>{const{container:r,...n}=e,[o,i]=x.useState(!1);ce(()=>i(!0),[]);const s=r||o&&globalThis?.document?.body;return s?va.createPortal(a.jsx(W.div,{...n,ref:t}),s):null});sn.displayName=$g;function Bg(e,t){return x.useReducer((r,n)=>t[r][n]??r,e)}var Ye=e=>{const{present:t,children:r}=e,n=Ug(t),o=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),i=J(n.ref,Hg(o));return typeof r=="function"||n.isPresent?x.cloneElement(o,{ref:i}):null};Ye.displayName="Presence";function Ug(e){const[t,r]=x.useState(),n=x.useRef(null),o=x.useRef(e),i=x.useRef("none"),s=e?"mounted":"unmounted",[l,c]=Bg(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const d=ln(n.current);i.current=l==="mounted"?d:"none"},[l]),ce(()=>{const d=n.current,u=o.current;if(u!==e){const m=i.current,g=ln(d);e?c("MOUNT"):g==="none"||d?.display==="none"?c("UNMOUNT"):c(u&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),ce(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,p=g=>{const f=ln(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&f&&(c("ANIMATION_END"),!o.current)){const h=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h)})}},m=g=>{g.target===t&&(i.current=ln(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function ln(e){return e?.animationName||"none"}function Hg(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Vg=x[" useInsertionEffect ".trim().toString()]||ce;function ct({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Wg({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:o;{const u=x.useRef(e!==void 0);x.useEffect(()=>{const p=u.current;p!==l&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,n])}const d=x.useCallback(u=>{if(l){const p=qg(u)?u(e):u;p!==e&&s.current?.(p)}else i(u)},[l,e,i,s]);return[c,d]}function Wg({defaultProp:e,onChange:t}){const[r,n]=x.useState(e),o=x.useRef(r),i=x.useRef(t);return Vg(()=>{i.current=t},[t]),x.useEffect(()=>{o.current!==r&&(i.current?.(r),o.current=r)},[r,o]),[r,n,i]}function qg(e){return typeof e=="function"}var Gg=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ot=new WeakMap,cn=new WeakMap,dn={},Lo=0,Xs=function(e){return e&&(e.host||Xs(e.parentNode))},Kg=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Xs(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Yg=function(e,t,r,n){var o=Kg(t,Array.isArray(e)?e:[e]);dn[r]||(dn[r]=new WeakMap);var i=dn[r],s=[],l=new Set,c=new Set(o),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};o.forEach(d);var u=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(l.has(m))u(m);else try{var g=m.getAttribute(n),b=g!==null&&g!=="false",f=(Ot.get(m)||0)+1,h=(i.get(m)||0)+1;Ot.set(m,f),i.set(m,h),s.push(m),f===1&&b&&cn.set(m,!0),h===1&&m.setAttribute(r,"true"),b||m.setAttribute(n,"true")}catch(_){console.error("aria-hidden: cannot operate on ",m,_)}})};return u(t),l.clear(),Lo++,function(){s.forEach(function(p){var m=Ot.get(p)-1,g=i.get(p)-1;Ot.set(p,m),i.set(p,g),m||(cn.has(p)||p.removeAttribute(n),cn.delete(p)),g||p.removeAttribute(r)}),Lo--,Lo||(Ot=new WeakMap,Ot=new WeakMap,cn=new WeakMap,dn={})}},Io=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Gg(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Yg(n,o,r,"aria-hidden")):function(){return null}},Ie=function(){return Ie=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Ie.apply(this,arguments)};function Js(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Xg(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var un="right-scroll-bar-position",pn="width-before-scroll-bar",Jg="with-scroll-bars-hidden",Zg="--removed-body-scroll-bar-size";function zo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Qg(e,t){var r=y.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var ex=typeof window<"u"?x.useLayoutEffect:x.useEffect,Zs=new WeakMap;function tx(e,t){var r=Qg(null,function(n){return e.forEach(function(o){return zo(o,n)})});return ex(function(){var n=Zs.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(l){i.has(l)||zo(l,null)}),i.forEach(function(l){o.has(l)||zo(l,s)})}Zs.set(r,e)},[e]),r}function rx(e){return e}function nx(e,t){t===void 0&&(t=rx);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var s=t(i,n);return r.push(s),function(){r=r.filter(function(l){return l!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var l=r;r=[],l.forEach(i),s=r}var c=function(){var u=s;s=[],u.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(u){s.push(u),d()},filter:function(u){return s=s.filter(u),r}}}};return o}function ox(e){e===void 0&&(e={});var t=nx(null);return t.options=Ie({async:!0,ssr:!1},e),t}var Qs=function(e){var t=e.sideCar,r=Js(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return x.createElement(n,Ie({},r))};Qs.isSideCarExport=!0;function ax(e,t){return e.useMedium(t),Qs}var el=ox(),Mo=function(){},mn=x.forwardRef(function(e,t){var r=x.useRef(null),n=x.useState({onScrollCapture:Mo,onWheelCapture:Mo,onTouchMoveCapture:Mo}),o=n[0],i=n[1],s=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,m=e.sideCar,g=e.noRelative,b=e.noIsolation,f=e.inert,h=e.allowPinchZoom,_=e.as,v=_===void 0?"div":_,w=e.gapMode,j=Js(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,N=tx([r,t]),k=Ie(Ie({},j),o);return x.createElement(x.Fragment,null,u&&x.createElement(C,{sideCar:el,removeScrollBar:d,shards:p,noRelative:g,noIsolation:b,inert:f,setCallbacks:i,allowPinchZoom:!!h,lockRef:r,gapMode:w}),s?x.cloneElement(x.Children.only(l),Ie(Ie({},k),{ref:N})):x.createElement(v,Ie({},k,{className:c,ref:N}),l))});mn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},mn.classNames={fullWidth:pn,zeroRight:un};var ix=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function sx(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ix();return t&&e.setAttribute("nonce",t),e}function lx(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function cx(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var dx=function(){var e=0,t=null;return{add:function(r){e==0&&(t=sx())&&(lx(t,r),cx(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ux=function(){var e=dx();return function(t,r){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},tl=function(){var e=ux(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},px={left:0,top:0,right:0,gap:0},Do=function(e){return parseInt(e||"",10)||0},mx=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Do(r),Do(n),Do(o)]},fx=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return px;var t=mx(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},hx=tl(),Rt="data-scroll-locked",gx=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,l=e.gap;return r===void 0&&(r="margin"),`
     324  .`.concat(Jg,` {
    320325   overflow: hidden `).concat(n,`;
    321326   padding-right: `).concat(l,"px ").concat(n,`;
    322327  }
    323   body[`).concat(Tt,`] {
     328  body[`).concat(Rt,`] {
    324329    overflow: hidden `).concat(n,`;
    325330    overscroll-behavior: contain;
     
    350355  }
    351356 
    352   body[`).concat(Tt,`] {
    353     `).concat(Xg,": ").concat(l,`px;
    354   }
    355 `)},rl=function(){var e=parseInt(document.body.getAttribute(Tt)||"0",10);return isFinite(e)?e:0},hx=function(){x.useEffect(function(){return document.body.setAttribute(Tt,(rl()+1).toString()),function(){var e=rl()-1;e<=0?document.body.removeAttribute(Tt):document.body.setAttribute(Tt,e.toString())}},[])},gx=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;hx();var i=x.useMemo(function(){return px(o)},[o]);return x.createElement(mx,{styles:fx(i,!t,o,r?"":"!important")})},Fo=!1;if(typeof window<"u")try{var fn=Object.defineProperty({},"passive",{get:function(){return Fo=!0,!0}});window.addEventListener("test",fn,fn),window.removeEventListener("test",fn,fn)}catch{Fo=!1}var At=Fo?{passive:!1}:!1,xx=function(e){return e.tagName==="TEXTAREA"},nl=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!xx(e)&&r[t]==="visible")},bx=function(e){return nl(e,"overflowY")},vx=function(e){return nl(e,"overflowX")},ol=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=al(e,n);if(o){var i=il(e,n),s=i[1],l=i[2];if(s>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},_x=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},yx=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},al=function(e,t){return e==="v"?bx(t):vx(t)},il=function(e,t){return e==="v"?_x(t):yx(t)},wx=function(e,t){return e==="h"&&t==="rtl"?-1:1},jx=function(e,t,r,n,o){var i=wx(e,window.getComputedStyle(t).direction),s=i*n,l=r.target,d=t.contains(l),c=!1,u=s>0,p=0,m=0;do{if(!l)break;var g=il(e,l),b=g[0],f=g[1],h=g[2],v=f-h-i*b;(b||v)&&al(e,l)&&(p+=v,m+=b);var _=l.parentNode;l=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!d&&l!==document.body||d&&(t.contains(l)||t===l));return(u&&Math.abs(p)<1||!u&&Math.abs(m)<1)&&(c=!0),c},hn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sl=function(e){return[e.deltaX,e.deltaY]},ll=function(e){return e&&"current"in e?e.current:e},Sx=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Cx=function(e){return`
     357  body[`).concat(Rt,`] {
     358    `).concat(Zg,": ").concat(l,`px;
     359  }
     360`)},rl=function(){var e=parseInt(document.body.getAttribute(Rt)||"0",10);return isFinite(e)?e:0},xx=function(){x.useEffect(function(){return document.body.setAttribute(Rt,(rl()+1).toString()),function(){var e=rl()-1;e<=0?document.body.removeAttribute(Rt):document.body.setAttribute(Rt,e.toString())}},[])},bx=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;xx();var i=x.useMemo(function(){return fx(o)},[o]);return x.createElement(hx,{styles:gx(i,!t,o,r?"":"!important")})},Fo=!1;if(typeof window<"u")try{var fn=Object.defineProperty({},"passive",{get:function(){return Fo=!0,!0}});window.addEventListener("test",fn,fn),window.removeEventListener("test",fn,fn)}catch{Fo=!1}var Lt=Fo?{passive:!1}:!1,_x=function(e){return e.tagName==="TEXTAREA"},nl=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!_x(e)&&r[t]==="visible")},vx=function(e){return nl(e,"overflowY")},yx=function(e){return nl(e,"overflowX")},ol=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=al(e,n);if(o){var i=il(e,n),s=i[1],l=i[2];if(s>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},wx=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},jx=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},al=function(e,t){return e==="v"?vx(t):yx(t)},il=function(e,t){return e==="v"?wx(t):jx(t)},Sx=function(e,t){return e==="h"&&t==="rtl"?-1:1},Cx=function(e,t,r,n,o){var i=Sx(e,window.getComputedStyle(t).direction),s=i*n,l=r.target,c=t.contains(l),d=!1,u=s>0,p=0,m=0;do{if(!l)break;var g=il(e,l),b=g[0],f=g[1],h=g[2],_=f-h-i*b;(b||_)&&al(e,l)&&(p+=_,m+=b);var v=l.parentNode;l=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(u&&Math.abs(p)<1||!u&&Math.abs(m)<1)&&(d=!0),d},hn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sl=function(e){return[e.deltaX,e.deltaY]},ll=function(e){return e&&"current"in e?e.current:e},kx=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Nx=function(e){return`
    356361  .block-interactivity-`.concat(e,` {pointer-events: none;}
    357362  .allow-interactivity-`).concat(e,` {pointer-events: all;}
    358 `)},kx=0,Pt=[];function Nx(e){var t=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),o=x.useState(kx++)[0],i=x.useState(tl)[0],s=x.useRef(e);x.useEffect(function(){s.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var f=Kg([e.lockRef.current],(e.shards||[]).map(ll),!0).filter(Boolean);return f.forEach(function(h){return h.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),f.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=x.useCallback(function(f,h){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!s.current.allowPinchZoom;var v=hn(f),_=r.current,w="deltaX"in f?f.deltaX:_[0]-v[0],j="deltaY"in f?f.deltaY:_[1]-v[1],C,N=f.target,k=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in f&&k==="h"&&N.type==="range")return!1;var E=ol(k,N);if(!E)return!0;if(E?C=k:(C=k==="v"?"h":"v",E=ol(k,N)),!E)return!1;if(!n.current&&"changedTouches"in f&&(w||j)&&(n.current=C),!C)return!0;var T=n.current||C;return jx(T,h,f,T==="h"?w:j)},[]),d=x.useCallback(function(f){var h=f;if(!(!Pt.length||Pt[Pt.length-1]!==i)){var v="deltaY"in h?sl(h):hn(h),_=t.current.filter(function(C){return C.name===h.type&&(C.target===h.target||h.target===C.shadowParent)&&Sx(C.delta,v)})[0];if(_&&_.should){h.cancelable&&h.preventDefault();return}if(!_){var w=(s.current.shards||[]).map(ll).filter(Boolean).filter(function(C){return C.contains(h.target)}),j=w.length>0?l(h,w[0]):!s.current.noIsolation;j&&h.cancelable&&h.preventDefault()}}},[]),c=x.useCallback(function(f,h,v,_){var w={name:f,delta:h,target:v,should:_,shadowParent:Ex(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(j){return j!==w})},1)},[]),u=x.useCallback(function(f){r.current=hn(f),n.current=void 0},[]),p=x.useCallback(function(f){c(f.type,sl(f),f.target,l(f,e.lockRef.current))},[]),m=x.useCallback(function(f){c(f.type,hn(f),f.target,l(f,e.lockRef.current))},[]);x.useEffect(function(){return Pt.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",d,At),document.addEventListener("touchmove",d,At),document.addEventListener("touchstart",u,At),function(){Pt=Pt.filter(function(f){return f!==i}),document.removeEventListener("wheel",d,At),document.removeEventListener("touchmove",d,At),document.removeEventListener("touchstart",u,At)}},[]);var g=e.removeScrollBar,b=e.inert;return x.createElement(x.Fragment,null,b?x.createElement(i,{styles:Cx(o)}):null,g?x.createElement(gx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ex(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Tx=nx(el,Nx);var gn=x.forwardRef(function(e,t){return x.createElement(mn,Ie({},e,{ref:t,sideCar:Tx}))});gn.classNames=mn.classNames;var xn="Popover",[cl]=Ve(xn,[an]),ur=an(),[Ax,Xe]=cl(xn),dl=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,l=ur(t),d=x.useRef(null),[c,u]=x.useState(!1),[p,m]=ct({prop:n,defaultProp:o??!1,onChange:i,caller:xn});return a.jsx(Gs,{...l,children:a.jsx(Ax,{scope:t,contentId:Ae(),triggerRef:d,open:p,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:c,onCustomAnchorAdd:x.useCallback(()=>u(!0),[]),onCustomAnchorRemove:x.useCallback(()=>u(!1),[]),modal:s,children:r})})};dl.displayName=xn;var ul="PopoverAnchor",Px=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(ul,r),i=ur(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=o;return x.useEffect(()=>(s(),()=>l()),[s,l]),a.jsx(Ro,{...i,...n,ref:t})});Px.displayName=ul;var pl="PopoverTrigger",ml=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(pl,r),i=ur(r),s=J(t,o.triggerRef),l=a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":bl(o.open),...n,ref:s,onClick:V(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:a.jsx(Ro,{asChild:!0,...i,children:l})});ml.displayName=pl;var $o="PopoverPortal",[Ox,Rx]=cl($o,{forceMount:void 0}),fl=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=Xe($o,t);return a.jsx(Ox,{scope:t,forceMount:r,children:a.jsx(Ye,{present:r||i.open,children:a.jsx(sn,{asChild:!0,container:o,children:n})})})};fl.displayName=$o;var Ot="PopoverContent",hl=x.forwardRef((e,t)=>{const r=Rx(Ot,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=Xe(Ot,e.__scopePopover);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx(Ix,{...o,ref:t}):a.jsx(zx,{...o,ref:t})})});hl.displayName=Ot;var Lx=nt("PopoverContent.RemoveScroll"),Ix=x.forwardRef((e,t)=>{const r=Xe(Ot,e.__scopePopover),n=x.useRef(null),o=J(t,n),i=x.useRef(!1);return x.useEffect(()=>{const s=n.current;if(s)return Io(s)},[]),a.jsx(gn,{as:Lx,allowPinchZoom:!0,children:a.jsx(gl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,s=>{s.preventDefault(),i.current||r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,d=l.button===0&&l.ctrlKey===!0,c=l.button===2||d;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:V(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),zx=x.forwardRef((e,t)=>{const r=Xe(Ot,e.__scopePopover),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(gl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),gl=x.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:c,onInteractOutside:u,...p}=e,m=Xe(Ot,r),g=ur(r);return xo(),a.jsx(Kr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(Gr,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:c,onDismiss:()=>m.onOpenChange(!1),children:a.jsx(Ks,{"data-state":bl(m.open),role:"dialog",id:m.contentId,...g,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),xl="PopoverClose",Mx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(xl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Mx.displayName=xl;var Dx="PopoverArrow",Fx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=ur(r);return a.jsx(Ys,{...o,...n,ref:t})});Fx.displayName=Dx;function bl(e){return e?"open":"closed"}var $x=dl,Bx=ml,Ux=fl,Hx=hl;function Rt({...e}){return a.jsx($x,{"data-slot":"popover",...e})}function Lt({...e}){return a.jsx(Bx,{"data-slot":"popover-trigger",...e})}function It({className:e,align:t="center",sideOffset:r=4,...n}){const o=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(Ux,{container:o,children:a.jsx(Hx,{"data-slot":"popover-content",align:t,sideOffset:r,className:F("ecr-popover",e),...n})})}var Vx=Symbol.for("react.lazy"),bn=x[" use ".trim().toString()];function Wx(e){return typeof e=="object"&&e!==null&&"then"in e}function vl(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Vx&&"_payload"in e&&Wx(e._payload)}function qx(e){const t=Gx(e),r=x.forwardRef((n,o)=>{let{children:i,...s}=n;vl(i)&&typeof bn=="function"&&(i=bn(i._payload));const l=x.Children.toArray(i),d=l.find(Yx);if(d){const c=d.props.children,u=l.map(p=>p===d?x.Children.count(c)>1?x.Children.only(null):x.isValidElement(c)?c.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(c)?x.cloneElement(c,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function Gx(e){const t=x.forwardRef((r,n)=>{let{children:o,...i}=r;if(vl(o)&&typeof bn=="function"&&(o=bn(o._payload)),x.isValidElement(o)){const s=Jx(o),l=Xx(i,o.props);return o.type!==x.Fragment&&(l.ref=n?Wn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Kx=Symbol("radix.slottable");function Yx(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Kx}function Xx(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const d=i(...l);return o(...l),d}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function Jx(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Zx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Qx=Zx.reduce((e,t)=>{const r=qx(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,d=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),e0="Separator",_l="horizontal",t0=["horizontal","vertical"],yl=x.forwardRef((e,t)=>{const{decorative:r,orientation:n=_l,...o}=e,i=r0(n)?n:_l,l=r?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(Qx.div,{"data-orientation":i,...l,...o,ref:t})});yl.displayName=e0;function r0(e){return t0.includes(e)}var n0=yl;function vn({className:e,orientation:t="horizontal",decorative:r=!0,...n}){return a.jsx(n0,{"data-slot":"separator",decorative:r,orientation:t,className:F("ecr-separator",e),...n})}const pr=({name:e,text:t})=>{const r=ecommreelsInfo.isProActive,n=ecommreelsInfo.isLicenseActive,o=ecommreelsInfo.license_page;return a.jsxs("div",{className:"ecr-admin-upgrade__modal",children:[a.jsxs("h4",{className:"ecr-admin-upgrade__title",children:[a.jsx("span",{className:"ecr-admin-upgrade__name",children:e}),a.jsx("span",{className:"ecr-admin-upgrade__tag",children:"PRO"})]}),a.jsx(vn,{className:"ecr-admin-separator"}),a.jsx("p",{className:"ecr-admin-upgrade__text",children:t}),a.jsx(vn,{className:"ecr-admin-separator"}),a.jsx("div",{className:"ecr-admin-upgrade__actions",children:a.jsx(te,{asChild:!0,className:"ecr-admin-upgrade__button",size:"sm",children:a.jsx("a",{href:r&&!n?o:"https://reelswp.com/pricing/",style:{color:"#fff"},target:"_blank",rel:"noreferrer",className:"ecr-admin-upgrade__link",children:r&&!n?"Active":"Upgrade to Pro"})})})]})};var _n="Dialog",[wl]=Ve(_n),[o0,Ce]=wl(_n),jl=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,l=x.useRef(null),d=x.useRef(null),[c,u]=ct({prop:n,defaultProp:o??!1,onChange:i,caller:_n});return a.jsx(o0,{scope:t,triggerRef:l,contentRef:d,contentId:Ae(),titleId:Ae(),descriptionId:Ae(),open:c,onOpenChange:u,onOpenToggle:x.useCallback(()=>u(p=>!p),[u]),modal:s,children:r})};jl.displayName=_n;var Sl="DialogTrigger",Cl=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ce(Sl,r),i=J(t,o.triggerRef);return a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ho(o.open),...n,ref:i,onClick:V(e.onClick,o.onOpenToggle)})});Cl.displayName=Sl;var Bo="DialogPortal",[a0,kl]=wl(Bo,{forceMount:void 0}),Nl=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,i=Ce(Bo,t);return a.jsx(a0,{scope:t,forceMount:r,children:x.Children.map(n,s=>a.jsx(Ye,{present:r||i.open,children:a.jsx(sn,{asChild:!0,container:o,children:s})}))})};Nl.displayName=Bo;var yn="DialogOverlay",El=x.forwardRef((e,t)=>{const r=kl(yn,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=Ce(yn,e.__scopeDialog);return i.modal?a.jsx(Ye,{present:n||i.open,children:a.jsx(s0,{...o,ref:t})}):null});El.displayName=yn;var i0=nt("DialogOverlay.RemoveScroll"),s0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ce(yn,r);return a.jsx(gn,{as:i0,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(W.div,{"data-state":Ho(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),dt="DialogContent",Tl=x.forwardRef((e,t)=>{const r=kl(dt,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=Ce(dt,e.__scopeDialog);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx(l0,{...o,ref:t}):a.jsx(c0,{...o,ref:t})})});Tl.displayName=dt;var l0=x.forwardRef((e,t)=>{const r=Ce(dt,e.__scopeDialog),n=x.useRef(null),o=J(t,r.contentRef,n);return x.useEffect(()=>{const i=n.current;if(i)return Io(i)},[]),a.jsx(Al,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,i=>{i.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&i.preventDefault()}),onFocusOutside:V(e.onFocusOutside,i=>i.preventDefault())})}),c0=x.forwardRef((e,t)=>{const r=Ce(dt,e.__scopeDialog),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(Al,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Al=x.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,l=Ce(dt,r),d=x.useRef(null),c=J(t,d);return xo(),a.jsxs(a.Fragment,{children:[a.jsx(Kr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(Gr,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Ho(l.open),...s,ref:c,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(u0,{titleId:l.titleId}),a.jsx(m0,{contentRef:d,descriptionId:l.descriptionId})]})]})}),Uo="DialogTitle",Pl=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ce(Uo,r);return a.jsx(W.h2,{id:o.titleId,...n,ref:t})});Pl.displayName=Uo;var Ol="DialogDescription",d0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ce(Ol,r);return a.jsx(W.p,{id:o.descriptionId,...n,ref:t})});d0.displayName=Ol;var Rl="DialogClose",Ll=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ce(Rl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Ll.displayName=Rl;function Ho(e){return e?"open":"closed"}var Il="DialogTitleWarning",[c1,zl]=Zf(Il,{contentName:dt,titleName:Uo,docsSlug:"dialog"}),u0=({titleId:e})=>{const t=zl(Il),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
     363`)},Ex=0,It=[];function Tx(e){var t=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),o=x.useState(Ex++)[0],i=x.useState(tl)[0],s=x.useRef(e);x.useEffect(function(){s.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var f=Xg([e.lockRef.current],(e.shards||[]).map(ll),!0).filter(Boolean);return f.forEach(function(h){return h.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),f.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=x.useCallback(function(f,h){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!s.current.allowPinchZoom;var _=hn(f),v=r.current,w="deltaX"in f?f.deltaX:v[0]-_[0],j="deltaY"in f?f.deltaY:v[1]-_[1],C,N=f.target,k=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in f&&k==="h"&&N.type==="range")return!1;var E=ol(k,N);if(!E)return!0;if(E?C=k:(C=k==="v"?"h":"v",E=ol(k,N)),!E)return!1;if(!n.current&&"changedTouches"in f&&(w||j)&&(n.current=C),!C)return!0;var T=n.current||C;return Cx(T,h,f,T==="h"?w:j)},[]),c=x.useCallback(function(f){var h=f;if(!(!It.length||It[It.length-1]!==i)){var _="deltaY"in h?sl(h):hn(h),v=t.current.filter(function(C){return C.name===h.type&&(C.target===h.target||h.target===C.shadowParent)&&kx(C.delta,_)})[0];if(v&&v.should){h.cancelable&&h.preventDefault();return}if(!v){var w=(s.current.shards||[]).map(ll).filter(Boolean).filter(function(C){return C.contains(h.target)}),j=w.length>0?l(h,w[0]):!s.current.noIsolation;j&&h.cancelable&&h.preventDefault()}}},[]),d=x.useCallback(function(f,h,_,v){var w={name:f,delta:h,target:_,should:v,shadowParent:Ax(_)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(j){return j!==w})},1)},[]),u=x.useCallback(function(f){r.current=hn(f),n.current=void 0},[]),p=x.useCallback(function(f){d(f.type,sl(f),f.target,l(f,e.lockRef.current))},[]),m=x.useCallback(function(f){d(f.type,hn(f),f.target,l(f,e.lockRef.current))},[]);x.useEffect(function(){return It.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Lt),document.addEventListener("touchmove",c,Lt),document.addEventListener("touchstart",u,Lt),function(){It=It.filter(function(f){return f!==i}),document.removeEventListener("wheel",c,Lt),document.removeEventListener("touchmove",c,Lt),document.removeEventListener("touchstart",u,Lt)}},[]);var g=e.removeScrollBar,b=e.inert;return x.createElement(x.Fragment,null,b?x.createElement(i,{styles:Nx(o)}):null,g?x.createElement(bx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ax(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Px=ax(el,Tx);var gn=x.forwardRef(function(e,t){return x.createElement(mn,Ie({},e,{ref:t,sideCar:Px}))});gn.classNames=mn.classNames;var xn="Popover",[cl]=Ve(xn,[an]),pr=an(),[Ox,Xe]=cl(xn),dl=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,l=pr(t),c=x.useRef(null),[d,u]=x.useState(!1),[p,m]=ct({prop:n,defaultProp:o??!1,onChange:i,caller:xn});return a.jsx(Gs,{...l,children:a.jsx(Ox,{scope:t,contentId:Ae(),triggerRef:c,open:p,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:d,onCustomAnchorAdd:x.useCallback(()=>u(!0),[]),onCustomAnchorRemove:x.useCallback(()=>u(!1),[]),modal:s,children:r})})};dl.displayName=xn;var ul="PopoverAnchor",Rx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(ul,r),i=pr(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=o;return x.useEffect(()=>(s(),()=>l()),[s,l]),a.jsx(Ro,{...i,...n,ref:t})});Rx.displayName=ul;var pl="PopoverTrigger",ml=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(pl,r),i=pr(r),s=J(t,o.triggerRef),l=a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":bl(o.open),...n,ref:s,onClick:V(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:a.jsx(Ro,{asChild:!0,...i,children:l})});ml.displayName=pl;var $o="PopoverPortal",[Lx,Ix]=cl($o,{forceMount:void 0}),fl=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=Xe($o,t);return a.jsx(Lx,{scope:t,forceMount:r,children:a.jsx(Ye,{present:r||i.open,children:a.jsx(sn,{asChild:!0,container:o,children:n})})})};fl.displayName=$o;var zt="PopoverContent",hl=x.forwardRef((e,t)=>{const r=Ix(zt,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=Xe(zt,e.__scopePopover);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx(Mx,{...o,ref:t}):a.jsx(Dx,{...o,ref:t})})});hl.displayName=zt;var zx=nt("PopoverContent.RemoveScroll"),Mx=x.forwardRef((e,t)=>{const r=Xe(zt,e.__scopePopover),n=x.useRef(null),o=J(t,n),i=x.useRef(!1);return x.useEffect(()=>{const s=n.current;if(s)return Io(s)},[]),a.jsx(gn,{as:zx,allowPinchZoom:!0,children:a.jsx(gl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,s=>{s.preventDefault(),i.current||r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:V(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),Dx=x.forwardRef((e,t)=>{const r=Xe(zt,e.__scopePopover),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(gl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),gl=x.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...p}=e,m=Xe(zt,r),g=pr(r);return xo(),a.jsx(Kr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(Gr,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:a.jsx(Ks,{"data-state":bl(m.open),role:"dialog",id:m.contentId,...g,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),xl="PopoverClose",Fx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(xl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Fx.displayName=xl;var $x="PopoverArrow",Bx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=pr(r);return a.jsx(Ys,{...o,...n,ref:t})});Bx.displayName=$x;function bl(e){return e?"open":"closed"}var Ux=dl,Hx=ml,Vx=fl,Wx=hl;function dt({...e}){return a.jsx(Ux,{"data-slot":"popover",...e})}function ut({...e}){return a.jsx(Hx,{"data-slot":"popover-trigger",...e})}function pt({className:e,align:t="center",sideOffset:r=4,...n}){const o=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(Vx,{container:o,children:a.jsx(Wx,{"data-slot":"popover-content",align:t,sideOffset:r,className:F("ecr-popover",e),...n})})}var qx=Symbol.for("react.lazy"),bn=x[" use ".trim().toString()];function Gx(e){return typeof e=="object"&&e!==null&&"then"in e}function _l(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===qx&&"_payload"in e&&Gx(e._payload)}function Kx(e){const t=Yx(e),r=x.forwardRef((n,o)=>{let{children:i,...s}=n;_l(i)&&typeof bn=="function"&&(i=bn(i._payload));const l=x.Children.toArray(i),c=l.find(Jx);if(c){const d=c.props.children,u=l.map(p=>p===c?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function Yx(e){const t=x.forwardRef((r,n)=>{let{children:o,...i}=r;if(_l(o)&&typeof bn=="function"&&(o=bn(o._payload)),x.isValidElement(o)){const s=Qx(o),l=Zx(i,o.props);return o.type!==x.Fragment&&(l.ref=n?Wn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xx=Symbol("radix.slottable");function Jx(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xx}function Zx(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function Qx(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var e0=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],t0=e0.reduce((e,t)=>{const r=Kx(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),r0="Separator",vl="horizontal",n0=["horizontal","vertical"],yl=x.forwardRef((e,t)=>{const{decorative:r,orientation:n=vl,...o}=e,i=o0(n)?n:vl,l=r?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(t0.div,{"data-orientation":i,...l,...o,ref:t})});yl.displayName=r0;function o0(e){return n0.includes(e)}var a0=yl;function _n({className:e,orientation:t="horizontal",decorative:r=!0,...n}){return a.jsx(a0,{"data-slot":"separator",decorative:r,orientation:t,className:F("ecr-separator",e),...n})}const Mt=({name:e,text:t})=>{const r=ecommreelsInfo.isProActive,n=ecommreelsInfo.isLicenseActive,o=ecommreelsInfo.license_page;return a.jsxs("div",{className:"ecr-admin-upgrade__modal",children:[a.jsxs("h4",{className:"ecr-admin-upgrade__title",children:[a.jsx("span",{className:"ecr-admin-upgrade__name",children:e}),a.jsx("span",{className:"ecr-admin-upgrade__tag",children:"PRO"})]}),a.jsx(_n,{className:"ecr-admin-separator"}),a.jsx("p",{className:"ecr-admin-upgrade__text",children:t}),a.jsx(_n,{className:"ecr-admin-separator"}),a.jsx("div",{className:"ecr-admin-upgrade__actions",children:a.jsx(te,{asChild:!0,className:"ecr-admin-upgrade__button",size:"sm",children:a.jsx("a",{href:r&&!n?o:"https://reelswp.com/pricing/",style:{color:"#fff"},target:"_blank",rel:"noreferrer",className:"ecr-admin-upgrade__link",children:r&&!n?"Active":"Upgrade to Pro"})})})]})};var vn="Dialog",[wl]=Ve(vn),[i0,Ce]=wl(vn),jl=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,l=x.useRef(null),c=x.useRef(null),[d,u]=ct({prop:n,defaultProp:o??!1,onChange:i,caller:vn});return a.jsx(i0,{scope:t,triggerRef:l,contentRef:c,contentId:Ae(),titleId:Ae(),descriptionId:Ae(),open:d,onOpenChange:u,onOpenToggle:x.useCallback(()=>u(p=>!p),[u]),modal:s,children:r})};jl.displayName=vn;var Sl="DialogTrigger",Cl=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ce(Sl,r),i=J(t,o.triggerRef);return a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ho(o.open),...n,ref:i,onClick:V(e.onClick,o.onOpenToggle)})});Cl.displayName=Sl;var Bo="DialogPortal",[s0,kl]=wl(Bo,{forceMount:void 0}),Nl=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,i=Ce(Bo,t);return a.jsx(s0,{scope:t,forceMount:r,children:x.Children.map(n,s=>a.jsx(Ye,{present:r||i.open,children:a.jsx(sn,{asChild:!0,container:o,children:s})}))})};Nl.displayName=Bo;var yn="DialogOverlay",El=x.forwardRef((e,t)=>{const r=kl(yn,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=Ce(yn,e.__scopeDialog);return i.modal?a.jsx(Ye,{present:n||i.open,children:a.jsx(c0,{...o,ref:t})}):null});El.displayName=yn;var l0=nt("DialogOverlay.RemoveScroll"),c0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ce(yn,r);return a.jsx(gn,{as:l0,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(W.div,{"data-state":Ho(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),mt="DialogContent",Tl=x.forwardRef((e,t)=>{const r=kl(mt,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=Ce(mt,e.__scopeDialog);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx(d0,{...o,ref:t}):a.jsx(u0,{...o,ref:t})})});Tl.displayName=mt;var d0=x.forwardRef((e,t)=>{const r=Ce(mt,e.__scopeDialog),n=x.useRef(null),o=J(t,r.contentRef,n);return x.useEffect(()=>{const i=n.current;if(i)return Io(i)},[]),a.jsx(Al,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,i=>{i.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&i.preventDefault()}),onFocusOutside:V(e.onFocusOutside,i=>i.preventDefault())})}),u0=x.forwardRef((e,t)=>{const r=Ce(mt,e.__scopeDialog),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(Al,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Al=x.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,l=Ce(mt,r),c=x.useRef(null),d=J(t,c);return xo(),a.jsxs(a.Fragment,{children:[a.jsx(Kr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(Gr,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Ho(l.open),...s,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(m0,{titleId:l.titleId}),a.jsx(h0,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Uo="DialogTitle",Pl=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ce(Uo,r);return a.jsx(W.h2,{id:o.titleId,...n,ref:t})});Pl.displayName=Uo;var Ol="DialogDescription",p0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ce(Ol,r);return a.jsx(W.p,{id:o.descriptionId,...n,ref:t})});p0.displayName=Ol;var Rl="DialogClose",Ll=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ce(Rl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Ll.displayName=Rl;function Ho(e){return e?"open":"closed"}var Il="DialogTitleWarning",[m1,zl]=eh(Il,{contentName:mt,titleName:Uo,docsSlug:"dialog"}),m0=({titleId:e})=>{const t=zl(Il),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
    359364
    360365If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
    361366
    362 For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},p0="DialogDescriptionWarning",m0=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${zl(p0).contentName}}.`;return x.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},f0=jl,h0=Cl,g0=Nl,x0=El,b0=Tl,v0=Pl,Ml=Ll;function Vo({...e}){return a.jsx(f0,{"data-slot":"dialog",...e})}function Wo({...e}){return a.jsx(h0,{"data-slot":"dialog-trigger",...e})}function _0({...e}){const t=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(g0,{"data-slot":"dialog-portal",container:t,...e})}function y0({className:e,...t}){return a.jsx(x0,{"data-slot":"dialog-overlay",className:F("ecr-dialog__overlay",e),...t})}function qo({className:e,children:t,...r}){return a.jsxs(_0,{children:[a.jsx(y0,{}),a.jsxs(b0,{"data-slot":"dialog-content",className:F("ecr-dialog__content",e),...r,children:[t,a.jsx(Ml,{className:"ecr-dialog__close","aria-label":"Close dialog",children:a.jsx(Jf,{className:"ecr-dialog__close-icon"})})]})]})}function Go({className:e,...t}){return a.jsx("div",{className:F("ecr-dialog__header",e),...t})}function Ko({className:e,...t}){return a.jsx(v0,{"data-slot":"dialog-title",className:F("ecr-dialog__title",e),...t})}function w0({...e}){return a.jsx(Ml,{"data-slot":"dialog-close",...e})}const j0=(e={})=>{const{enabled:t=!0}=e,r=typeof ecommreelsInfo<"u"?ecommreelsInfo?.url:"",n=typeof ecommreelsInfo<"u"?ecommreelsInfo?.nonce:"",[o,i]=y.useState([]),[s,l]=y.useState(1),[d,c]=y.useState(!0),[u,p]=y.useState(!1),[m,g]=y.useState(!1),[b,f]=y.useState(""),h=co(b,500),v=y.useRef(!0),_=y.useRef(0),w=y.useRef(null),[j,C]=y.useState(null),N=y.useCallback(async T=>{if(!r||!n){C("Missing API configuration."),g(!1),p(!1);return}const A=++_.current;w.current&&w.current.abort();const O=new AbortController;w.current=O,T===1&&v.current?g(!0):p(!0);try{const R={page:T,per_page:50};h&&(R.search=h);const L=await ee.get(`${r}wc/v3/products`,{headers:{"X-WP-Nonce":n},withCredentials:!0,params:R,signal:O.signal}),P=L.data,M=parseInt(L.headers["x-wp-totalpages"]||"1",10);A===_.current&&(i(I=>T===1?P:[...I,...P]),l(T+1),c(T<M))}catch(R){if(O.signal.aborted)return;R instanceof Error?C(R.message):C("An unknown error occurred")}finally{v.current&&(v.current=!1),A===_.current&&!O.signal.aborted&&(p(!1),g(!1))}},[h,n,r]);y.useEffect(()=>{t&&(l(1),i([]),C(null),v.current=!0,N(1))},[h,N,t]);const k=y.useRef(null),E=y.useCallback(T=>{u||(k.current&&k.current.disconnect(),k.current=new IntersectionObserver(A=>{A[0].isIntersecting&&d&&N(s)}),T&&k.current.observe(T))},[u,d,s,N]);return y.useEffect(()=>()=>{k.current&&k.current.disconnect(),w.current&&w.current.abort()},[]),{products:o,setProducts:i,searchTerm:b,setSearchTerm:f,isSearching:u,isLoading:m,error:j,lastProductElementRef:E}},wn="data:image/webp;base64,UklGRrYCAABXRUJQVlA4IKoCAAAQDgCdASpkAEMAAAAAJaQDTXX09L/D3HZzPbW8/T59Tq2V1f9x4QZUkPFMe8XfzV/1/cA/U3/e+qB5s3stfrGmnzI3LSXH12rz2O2VKFiQhcbIwmUHTRPSh2VO/qyrsEp8zYYljZlwfgijGvud/SarxFjfxEew4IAAAP7/ti48OT/Oya3x+X1pd0VKczR2pok8Ci8XRszNhGh0y5UiQtxf1xZl/3jvki/LfqRs3vrkqKO+RR3ax2yhGPzf/uMJqz6MmyKZ75prVit6Eu2kyiVhUvihA/zLTt4PvMG3YOlFXZJRTk9Zz1SB9/gGf8x4hu9/9Fz/JZ63KGECMtEG58t43wKZFRr2piHRIZQT76htB+3yWUaqjW/9r5PNawz37RxBI1wHwj1o4cbmVBENdq85+fOSQapp04WZhajKbzXhRwSwcxZI01XL2O35Gs53AKgwVjlqhKBXmU5RK0/N1qmQ8h7bn4+Dgm4fguH/nDOEx63rpdXh50ZJgbckzvlWp65XCscQ+Z90pb/bzQAYUI5YPYyk20I93Q8IjMbbafY+FumPz2rofTi71XKY3kDqTc0uBkqjYSUfFMUKxgw1NrzD+Wbnnu2IM+Qd4VS0LEDgJPgKfQ7ibiPABUBtu3G+7MUdxJwAkJmmQoJaL1guZuZ05cbqVsGknyIqlaio4CV14KH5qn4pmkuDfSxtqzn9mhCN+TzF0t4TaR8ogb3/yo30guRPtF+g5KYFVA2UDcRWPUEzW14M0OZ3fHminXd6FGdr5AvpJFRrKwXRhN3HGAgFUI0Kz+1aaiktbCubMvxjbQen+JdPvxDhRzgIgdUC5WTRnTMOZEM6XsqjihAbcx04mA92SCnBZNJtBpRioadBJLj6D4Dd/wEDbmI9KaZM56h8czAAAAAAAAAA",Dl=({name:e,handleClick:t})=>a.jsx("button",{onClick:t,className:F("ecr-button ecr-button--sm",e==="add"?"ecr-button--primary":"ecr-button--danger"),children:e}),S0=({handleLinks:e,taggedProducts:t,products:r,isSearching:n,isLoading:o,lastProductElementRef:i,searchTerm:s,setSearchTerm:l,error:d})=>{const[c,u]=y.useState(t.map(f=>f.product_id)),[p,m]=y.useState(!1),g=f=>{m(!1),u(h=>h.includes(f.id)?h.filter(v=>v!==f.id):[f.id])},b=f=>{if(f.preventDefault(),c.length===0){m(!0);return}const h=new Set(c),v=[];for(const _ of r)h.has(_.id)&&v.push({btn_type:"product",btn_uuid:mo(),buttonText:_.name,buttonUrl:_.permalink,rating:_.average_rating,price:_.price_html,thumbnail:_.images?.[0]?.thumbnail||_.images?.[0]?.src||wn,product_id:_.id});e(v),u([])};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"ecr-admin-product-link__search",children:a.jsx("input",{type:"text",placeholder:"Search products...",value:s,onChange:f=>l(f.target.value),className:"ecr-admin-product-link__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-product-link__list",children:o&&r.length===0?a.jsx(Fl,{}):a.jsxs("div",{className:"ecr-admin-product-link__list-inner",children:[r.length===0?a.jsx("p",{className:"ecr-admin-product-link__empty",children:d||"No products are available to add."}):r.map((f,h)=>{const v=c.includes(f.id);return a.jsx("div",{ref:r.length===h+1?i:null,className:"ecr-admin-product-link__item",style:c.length>0&&!v?{opacity:.5,pointerEvents:"none"}:{},children:a.jsxs(te,{type:"button",onClick:()=>g(f),className:F("ecr-admin-product-link__button",v?"ecr-admin-product-link__button--selected":"ecr-admin-product-link__button--unselected"),children:[v?a.jsx(Gf,{size:20,color:"#2563eb"}):a.jsx(Kf,{size:20,color:"#8c95a9"}),a.jsx("img",{className:"ecr-admin-product-link__thumb",src:f.images?.[0]?.thumbnail||f.images?.[0]?.src||wn,alt:"Product thumbnail"}),a.jsx("span",{children:f.name||`Product #${f.id}`})]})},f.id)}),n&&r.length>0&&a.jsx(Fl,{})]})}),a.jsxs("div",{className:"ecr-admin-product-link__footer",children:[p&&a.jsx("p",{className:"ecr-admin-product-link__error",children:"You did not select any product!"}),a.jsx("div",{className:"ecr-admin-product-link__actions",children:a.jsx(Dl,{name:"add",handleClick:b})})]})]})},Fl=()=>a.jsx("div",{className:"ecr-admin-product-link__loader",children:a.jsx("div",{className:"ecr-admin-product-link__spinner"})}),C0=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i,k0=({handleLinks:e})=>{const[t,r]=y.useState(""),[n,o]=y.useState(""),[i,s]=y.useState(""),[l,d]=y.useState(!0),[c,u]=y.useState(""),[p,m]=y.useState([]),g=()=>{const b=[];t||b.push("text"),n&&C0.test(n)||b.push("url"),i||b.push("campaign"),m(b),!(b.length>0)&&e({btn_type:"custom",btn_uuid:mo(),buttonText:t,buttonUrl:n,openInNewTab:l,campaignName:i,customClass:c,clickCount:0})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx(jn,{error:p.includes("text"),type:"text",name:"buttonText",label:"Button Text",placeholder:"e.g Buy Now",value:t,setValue:r}),p.includes("text")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Button text is required!"})]}),a.jsxs("div",{children:[a.jsx(jn,{error:p.includes("url"),type:"url",name:"url",label:"Url",placeholder:"e.g https://example.com",value:n,setValue:o}),p.includes("url")&&a.jsx("p",{className:"ecr-admin-link__error",children:"A valid url is required!"})]}),a.jsxs("div",{children:[a.jsx(jn,{error:p.includes("campaign"),type:"text",name:"campaignName",label:"Campaign Name",placeholder:"e.g Summer sale",value:i,setValue:s}),p.includes("campaign")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Campaign name is required!"})]}),a.jsxs("div",{className:"ecr-admin-link__toggle",children:[a.jsx("input",{checked:l,onChange:b=>d(b.target.checked),className:"ecr-admin-link__checkbox",type:"checkbox",name:"",id:"newTab"}),a.jsx("label",{className:"ecr-admin-link__toggle-label",htmlFor:"newTab",children:"Open in new tab"})]}),a.jsx("div",{children:a.jsx(jn,{error:p.includes("customClass"),type:"text",name:"customClass",label:"Custom class",placeholder:"custom-class",value:c,setValue:u})}),a.jsx("div",{className:"ecr-admin-link__actions",children:a.jsx(Dl,{name:"add",handleClick:g})})]})};function jn({error:e,type:t,name:r,label:n,placeholder:o,value:i,setValue:s}){return a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"ecr-admin-link__label",htmlFor:r,children:n}),a.jsx("input",{id:r,name:r,type:t,placeholder:o,value:i,onChange:l=>s(l.target.value),className:F("ecr-admin-link__input",e?"ecr-admin-link__input--error":"ecr-admin-link__input--normal")})]})}const N0=({setLinks:e,linkCount:t,linkType:r,links:n})=>{const[o,i]=y.useState(null),[s,l]=y.useState(!1),d=j0({enabled:s}),c=t===0||r==="Link",u=t===0||r==="Product",p=n.filter(g=>g.btn_type==="product"),m=()=>l(!0);return a.jsxs(a.Fragment,{children:[t?a.jsx(vn,{}):null,a.jsx("div",{className:"ecr-admin-link-tabs",children:a.jsxs("div",{className:"ecr-admin-link-tabs__list",children:[c&&a.jsxs(Vo,{open:o==="custom",onOpenChange:g=>i(g?"custom":null),children:[a.jsxs(Wo,{className:"ecr-admin-link-tabs__trigger",children:[a.jsx(Uf,{size:20})," Add Custom Link"]}),a.jsxs(qo,{className:"ecr-admin-link-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Add Custom Link"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(k0,{handleLinks:g=>{e(b=>[...b,g]),i(null)}})})]})]}),u&&a.jsxs(Vo,{open:o==="product",onOpenChange:g=>i(g?"product":null),children:[a.jsxs(Wo,{className:"ecr-admin-link-tabs__trigger",onMouseEnter:m,children:[a.jsx(Yf,{size:20})," Tag Products"]}),a.jsxs(qo,{className:"ecr-admin-link-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Select Products"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(S0,{handleLinks:g=>{e(g),i(null)},taggedProducts:p,products:d.products,isSearching:d.isSearching,isLoading:d.isLoading,lastProductElementRef:d.lastProductElementRef,searchTerm:d.searchTerm,setSearchTerm:d.setSearchTerm,error:d.error})})]})]})]})})]})},E0=({links:e,onLinksChange:t})=>{const r=o=>{t(i=>i.filter(s=>s.btn_uuid!==o))},n=e[0]?.btn_type==="product"?"Product":"Link";return a.jsxs("div",{className:"ecr-admin-links",children:[a.jsx("p",{className:"ecr-admin-links__title",children:`${n}${e.length>1?"s":""}`}),e.length>0?a.jsxs(a.Fragment,{children:[e.map(o=>a.jsxs("div",{className:`ecr-admin-links__item ${o.btn_type==="custom"?o.customClass??"":""}`,children:[a.jsx("span",{children:o.buttonText}),a.jsx(te,{onClick:()=>r(o.btn_uuid),size:"icon-sm",variant:"link",className:"ecr-admin-links__remove",children:a.jsx(Xf,{size:16})})]},o.btn_uuid)),a.jsxs(Rt,{children:[a.jsxs(Lt,{className:"ecr-admin-links__upgrade",children:["+ Add Another ",a.jsx(Jt,{size:20})]}),a.jsx(It,{className:"ecr-admin-links__popover",children:a.jsx(pr,{name:"Multiple Links",text:a.jsx(a.Fragment,{children:"Unlock the ability to add multiple custom links, seamlessly redirecting users to your pages from the videos!"})})})]})]}):a.jsx(N0,{setLinks:t,linkCount:e.length,linkType:n,links:e})]})};function $l(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(e)}const T0=({togglePlayPause:e,isMuted:t,file:r,videoRef:n,onEnded:o})=>{const[i,s]=y.useState(!1);return a.jsx("video",{ref:n,className:F("ecr-admin-reelvideo",i?"ecr-admin-reelvideo--portrait":"ecr-admin-reelvideo--landscape"),src:r?.url,muted:t,onClick:e,autoPlay:!0,draggable:!1,onEnded:o,onLoadedMetadata:l=>{const d=l.currentTarget,c=d.videoWidth,u=d.videoHeight;s(()=>u>c)}})},A0=({index:e,setIsAttemptingDelete:t,file:r,file_uuid:n,dragStart:o,dragEnter:i,dragEnd:s})=>{const[l,d]=y.useState(!0),[c,u]=y.useState(!1),p=y.useRef(null),m=()=>{p.current&&(c?p.current.play():p.current.pause(),u(b=>!b))},g=()=>{p.current&&(p.current.muted=!l,d(b=>!b))};return a.jsxs("div",{draggable:!0,onDragStart:()=>o(e),onDragEnter:()=>i(e),onDragEnd:s,className:F("ecr-admin-customization__panel"),children:[a.jsx($l,{className:"ecr-admin-customization__remove",size:20,onClick:()=>t(n)}),a.jsx(T0,{togglePlayPause:m,isMuted:l,file:r,videoRef:p,onEnded:()=>u(!0)}),a.jsxs("div",{className:"ecr-admin-customization__controls",children:[c?a.jsx(Kn,{size:16,className:"ecr-admin-customization__control",onClick:m}):a.jsx(qn,{size:16,className:"ecr-admin-customization__control",onClick:m}),l?a.jsx(Gn,{size:16,className:"ecr-admin-customization__control",onClick:g}):a.jsx(Yn,{size:16,className:"ecr-admin-customization__control",onClick:g})]})]})},P0=({uploadedFiles:e,setIsAttemptingDelete:t,setUploadedFiles:r})=>{const n=y.useRef(null),o=y.useRef(null),i=d=>{n.current=d},s=d=>{o.current=d},l=()=>{if(n.current===null||o.current===null)return;const d=[...e],c=d[n.current];d.splice(n.current,1),d.splice(o.current,0,c),n.current=null,o.current=null,r(d)};return a.jsxs("div",{className:"ecr-admin-customization",children:[e.map((d,c)=>a.jsx(A0,{setIsAttemptingDelete:t,file:d,file_uuid:d.file_uuid,index:c,dragStart:i,dragEnter:s,dragEnd:l},c)),a.jsxs(Rt,{children:[a.jsxs(Lt,{className:"ecr-admin-customization__add",children:[a.jsx("img",{className:"ecr-admin-customization__icon",src:ts,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-customization__label",children:"Upload another video"}),a.jsx(Jt,{size:20,className:"ecr-admin-customization__lock"})]}),a.jsx(It,{side:"right",className:"ecr-admin-customization__popover",children:a.jsx(pr,{name:"Multiple Videos",text:a.jsxs(a.Fragment,{children:["Unlock the power of ",a.jsx("strong",{children:"Multiple Video"})," uploads, boosting engagement and variety in every Reels!"]})})})]})]})},O0=({thumbnail:e,onThumbnailChange:t})=>a.jsxs("div",{className:"ecr-admin-thumbnail",children:[a.jsx("p",{className:"ecr-admin-thumbnail__title",children:"Thumbnail"}),e?a.jsxs("div",{className:"ecr-admin-thumbnail__preview",children:[a.jsx("img",{src:e,alt:"Thumbnail",className:"ecr-admin-thumbnail__image"}),a.jsx($l,{className:"ecr-admin-thumbnail__remove",size:20,onClick:()=>t(null)})]}):a.jsx(rs,{mode:"thumbnail",usedFor:"image",setThumbnail:t,className:"ecr-admin-thumbnail__uploader"})]}),R0=()=>{const e=Ne(),[t]=Yt(),r=y.useMemo(()=>t.get("sid"),[t]),n=y.useRef(null),[o,i]=y.useState({files:[],title:"",links:[],thumbnail:null}),[s,l]=y.useState(!1),[d,c]=y.useState(null),u=y.useCallback(h=>{i(v=>({...v,title:typeof h=="function"?h(v.title):h}))},[]),p=y.useCallback(h=>{i(v=>({...v,files:typeof h=="function"?h(v.files):h}))},[]),m=y.useCallback(h=>{i(v=>({...v,links:typeof h=="function"?h(v.links):h}))},[]),g=y.useCallback(h=>{i(v=>({...v,thumbnail:typeof h=="function"?h(v.thumbnail):h}))},[]),b=()=>{d&&(p(h=>h.filter(v=>v.file_uuid!==d)),c(null))},f=y.useCallback(async h=>{try{l(!0);const v=await he.get(`story/${h}`);i({title:v.data.title,files:v.data.files,links:v.data.links,thumbnail:v.data.thumbnail})}catch(v){v instanceof Error?K.error(v.message):K.error("Something went wrong. Try again later!"),n.current=setTimeout(()=>e(-1),1e3)}finally{l(!1)}},[e]);return y.useEffect(()=>{r&&f(r)},[r,f]),y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),s?a.jsx(Ir,{}):a.jsxs(a.Fragment,{children:[a.jsx(Nf,{uploadedFiles:o.files,links:o.links,thumbnail:o.thumbnail,storyTitle:o.title,setStoryTitle:u}),a.jsxs("div",{className:"ecr-admin-create",children:[a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--main",children:[a.jsx("p",{className:"ecr-admin-create__title",children:"Select video"}),d&&a.jsx(Rr,{onReject:()=>c(null),onAccept:b,isLoading:!1,message:"Are you sure, You want to remove this file?"}),o.files.length>0?a.jsx(P0,{uploadedFiles:o.files,setUploadedFiles:p,setIsAttemptingDelete:c}):a.jsx(rs,{setUploadedFiles:p})]}),a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--side",children:[a.jsx(O0,{thumbnail:o.thumbnail,onThumbnailChange:g}),a.jsx(vn,{className:"ecr-admin-create__separator"}),a.jsx(E0,{links:o.links,onLinksChange:m})]})]})]})},Bl=({message:e="Something went wrong. Please try again."})=>a.jsxs("div",{className:"ecr-admin-error",children:[a.jsx(lp,{className:"ecr-admin-error__icon"}),a.jsx("p",{className:"ecr-admin-error__text",children:e})]});var Yo,Ul;function L0(){return Ul||(Ul=1,Yo=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||r.forEach(function(o){e.addRange(o)}),t&&t.focus()}}),Yo}var Xo,Hl;function I0(){if(Hl)return Xo;Hl=1;var e=L0(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(i){var s=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return i.replace(/#{\s*key\s*}/g,s)}function o(i,s){var l,d,c,u,p,m,g=!1;s||(s={}),l=s.debug||!1;try{c=e(),u=document.createRange(),p=document.getSelection(),m=document.createElement("span"),m.textContent=i,m.ariaHidden="true",m.style.all="unset",m.style.position="fixed",m.style.top=0,m.style.clip="rect(0, 0, 0, 0)",m.style.whiteSpace="pre",m.style.webkitUserSelect="text",m.style.MozUserSelect="text",m.style.msUserSelect="text",m.style.userSelect="text",m.addEventListener("copy",function(f){if(f.stopPropagation(),s.format)if(f.preventDefault(),typeof f.clipboardData>"u"){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=t[s.format]||t.default;window.clipboardData.setData(h,i)}else f.clipboardData.clearData(),f.clipboardData.setData(s.format,i);s.onCopy&&(f.preventDefault(),s.onCopy(f.clipboardData))}),document.body.appendChild(m),u.selectNodeContents(m),p.addRange(u);var b=document.execCommand("copy");if(!b)throw new Error("copy command was unsuccessful");g=!0}catch(f){l&&console.error("unable to copy using execCommand: ",f),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(s.format||"text",i),s.onCopy&&s.onCopy(window.clipboardData),g=!0}catch(h){l&&console.error("unable to copy using clipboardData: ",h),l&&console.error("falling back to prompt"),d=n("message"in s?s.message:r),window.prompt(d,i)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(u):p.removeAllRanges()),m&&document.body.removeChild(m),c()}return g}return Xo=o,Xo}var z0=I0();const Vl=Cd(z0);function Wl({className:e,...t}){return a.jsx("div",{"data-slot":"table-container",className:"ecr-table__container",children:a.jsx("table",{"data-slot":"table",className:F("ecr-table",e),...t})})}function ql({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:F("ecr-table__header",e),...t})}function Gl({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:F("ecr-table__body",e),...t})}function Sn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:F("ecr-table__row",e),...t})}function Kl({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:F("ecr-table__head",e),...t})}function ze({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:F("ecr-table__cell",e),...t})}function Yl({className:e,...t}){return a.jsx("caption",{"data-slot":"table-caption",className:F("ecr-table__caption",e),...t})}const M0=[{label:"No.",width:80,align:"center"},{label:"Group Name",width:250,align:"start"},{label:"Short Code",align:"start"},{label:"Action",width:150,align:"center"}],D0=({tableData:e,setIsAttemptingDelete:t})=>{const[r,n]=y.useState(null),o=y.useRef(null),i=(s,l)=>{Vl(s),n(l),o.current=setTimeout(()=>{n(null)},700)};return y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(Wl,{className:"ecr-admin-groups__table",children:[!e.length&&a.jsx(Yl,{className:"ecr-admin-groups__caption",children:a.jsxs("div",{className:"ecr-admin-groups__empty",children:[a.jsx(ot,{className:"ecr-admin-groups__empty-icon"}),"You did not create any reel group yet!"]})}),e.length?a.jsxs(a.Fragment,{children:[a.jsx(ql,{children:a.jsx(Sn,{children:M0.map((s,l)=>a.jsx(Kl,{className:"ecr-admin-groups__head",style:{width:s?.width||"auto",textAlign:s?.align},children:s.label},l))})}),a.jsx(Gl,{children:e.map((s,l)=>a.jsxs(Sn,{className:F("ecr-admin-groups__row",l%2===0&&"ecr-admin-groups__row--alt"),children:[a.jsx(ze,{className:"ecr-admin-groups__cell ecr-admin-groups__cell--center ecr-admin-groups__cell--strong",children:l+1}),a.jsx(ze,{children:a.jsx("div",{className:"ecr-admin-groups__name",children:s.group_name})}),a.jsx(ze,{children:a.jsxs("div",{className:"ecr-admin-groups__shortcode",children:[a.jsx("span",{className:"ecr-admin-groups__shortcode-text",children:`[reelswp-group id='${s.id}']`}),a.jsxs("div",{className:"ecr-admin-groups__copy",children:[a.jsx("button",{onClick:()=>i(`[reelswp-group id='${s.id}']`,l),className:"ecr-admin-groups__copy-button",title:"Copy",children:a.jsx(np,{className:"ecr-admin-groups__copy-icon"})}),a.jsx("span",{className:F("ecr-admin-groups__copy-tooltip",r===l&&"ecr-admin-groups__copy-tooltip--visible"),children:"Copied!"})]})]})}),a.jsx(ze,{children:a.jsxs("div",{className:"ecr-admin-groups__actions",children:[a.jsx(te,{title:"Statistics",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(ht,{to:`?view=${X.stat}&group=${s.id}&name=${s.group_name}`,children:a.jsx(ui,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(te,{title:"Update Stories",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(ht,{to:`?view=${X.mg}&gid=${s.id}`,children:a.jsx(Or,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(te,{title:"Delete Group",onClick:()=>t(s.id),variant:"link",size:"icon-sm",className:"ecr-admin-groups__action-button",children:a.jsx(sp,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--danger"})})]})})]},s.id??l))})]}):null]})},Xl=()=>a.jsxs("table",{className:"ecr-admin-groups__skeleton-table",children:[a.jsx("thead",{className:"ecr-admin-groups__skeleton-head",children:a.jsxs("tr",{children:[a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--tiny"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--medium"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--large"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--small"})})]})}),a.jsx("tbody",{children:Array.from({length:5}).map((e,t)=>a.jsxs("tr",{className:t%2===0?"ecr-admin-groups__skeleton-row ecr-admin-groups__skeleton-row--alt":"ecr-admin-groups__skeleton-row",children:[a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--tiny"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--medium"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--large"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell ecr-admin-groups__skeleton-cell--center",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--small"})})]},t))})]}),F0=()=>{const[e,t]=y.useState([]),[r,n]=y.useState(""),[o,i]=y.useState(!1),[s,l]=y.useState(!1),[d,c]=y.useState(!1),[u,p]=y.useState(""),[m,g]=y.useState(1),[b]=y.useState(20),[f,h]=y.useState(0),[v,_]=y.useState(1),w=co(u,500),j=y.useCallback(async E=>{const T=new AbortController,A=E===1;try{A?i(!0):l(!0),n("");const O=await he.get("groups",{params:{page:E,per_page:b,...w&&{q:w}},signal:T.signal}),R=Number(O.headers?.["x-wp-total"]??0),L=Number(O.headers?.["x-wp-totalpages"]??1),P=Math.max(1,L||1);t(M=>{if(A)return O.data;const I=new Set(M.map(z=>z.id)),B=O.data.filter(z=>!I.has(z.id));return[...M,...B]}),h(R),_(P),E>P&&g(P)}catch(O){if(T.signal.aborted)return;O instanceof Error?n(O.message):n("Something went wrong. Try again later!")}finally{T.signal.aborted||(A?i(!1):l(!1))}},[b,w]),C=y.useCallback(()=>{g(E=>o||s||E>=v?E:E+1)},[o,s,v]),N=y.useCallback(async()=>{if(m!==1){g(1);return}await j(1)},[m,j]),k=y.useCallback(async E=>{try{c(!0),await he.delete(`group/${E}`),await N(),K.success("Group deleted successfully!")}catch(T){T instanceof Error?K.error(T.message):K.error("Failed to delete group.")}finally{c(!1)}},[N]);return y.useEffect(()=>{j(m)},[m,j,w]),{groups:e,groupError:r,isLoading:o,isLoadingMore:s,isDeleting:d,searchTerm:u,setSearchTerm:p,perPage:b,total:f,totalPages:v,hasMore:m<=v,loadMore:C,refreshGroups:N,deleteGroup:k}},$0={docs:"https://reelswp.com/docs/"},B0=()=>{const[e,t]=y.useState(null),{groups:r,groupError:n,isLoading:o,isLoadingMore:i,isDeleting:s,deleteGroup:l,hasMore:d,loadMore:c,searchTerm:u,setSearchTerm:p}=F0(),m=y.useRef(null),g=async()=>{e&&(await l(e),t(null))};return y.useEffect(()=>{if(!m.current||!d)return;const b=new IntersectionObserver(f=>{const[h]=f;h.isIntersecting&&c()},{root:null,rootMargin:"200px",threshold:0});return b.observe(m.current),()=>b.disconnect()},[d,c]),a.jsxs(a.Fragment,{children:[a.jsx(vt,{left:[a.jsx(_t,{name:"All Widgets",Icon:cp},"page")],center:[a.jsx(zr,{},"reel-wp")],right:[a.jsxs("a",{href:$0.docs,className:"ecr-admin-docs-link",target:"_blank",children:[a.jsx($f,{size:14}),a.jsx("span",{children:"Documentation"})]},"view-documentation"),a.jsx(Lr,{to:`?view=${X.cr}`,text:"Add Reel",Icon:gt},"add-reel-reel-group")]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-groups",children:[e&&a.jsx(Rr,{onAccept:g,onReject:()=>t(null),isLoading:s}),a.jsxs("div",{className:"ecr-admin-groups__header",children:[a.jsx("h2",{className:"ecr-admin-groups__title",children:"Reel Widgets"}),a.jsxs("div",{className:"ecr-admin-groups_action_wrapper",children:[a.jsxs("div",{className:"ecr-admin-groups-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search widgets...",value:u,onChange:b=>p(b.target.value),className:"ecr-admin-groups-search-input"}),a.jsxs("div",{className:"ecr-admin-groups-header__icon-wrapper",children:[u&&a.jsx(te,{onClick:()=>p(""),variant:"link",size:"icon-sm",children:a.jsx(er,{size:16,className:"ecr-admin-groups-header__clear-icon"})}),a.jsx(ni,{size:16,className:"ecr-admin-groups-header__search-icon"})]})]}),a.jsx(Lr,{to:`?view=${X.mg}`,text:"Create Widget",Icon:gt,className:"ecr-admin-groups__create-button",textColor:"#2563eb"})]})]}),o?a.jsx(Xl,{}):n?a.jsx(Bl,{}):a.jsxs(a.Fragment,{children:[a.jsx(D0,{tableData:r,setIsAttemptingDelete:t}),d&&a.jsx("div",{ref:m,className:"ecr-admin-groups__load-more","aria-live":"polite",children:i?a.jsx(Hf,{className:"ecr-admin-groups__load-more__icon"}):null})]})]})]})},U0=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState({rateLimit:2,timeLimit:1}),[o,i]=y.useState(!1),[s,l]=y.useState(!1),[d,c]=y.useState(!1),u=y.useCallback((m,g)=>{t(!0),n(b=>({...b,[m]:g}))},[]),p=y.useCallback(async()=>{const m=Number(r.rateLimit),g=Number(r.timeLimit);if(!Number.isFinite(m)||!Number.isFinite(g)){K.error("Please enter valid numbers.");return}try{l(!0),c(!1),await he.post("settings",{rate_limit:m,time_limit:g}),K.success("Settings updated successfully."),t(!1)}catch(b){b instanceof Error?K.error(b.message):K.error("Something went wrong. Try again later!"),c(!0)}finally{l(!1)}},[r.rateLimit,r.timeLimit]);return y.useEffect(()=>{const m=new AbortController;return(async()=>{try{i(!0),c(!1);const b=await he.get("settings",{signal:m.signal});n({rateLimit:b.data.rate_limit,timeLimit:b.data.time_limit}),t(!1)}catch(b){if(m.signal.aborted)return;b instanceof Error?K.error(b.message):K.error("Something went wrong. Try again later!"),c(!0)}finally{m.signal.aborted||i(!1)}})(),()=>m.abort()},[]),{limit:r,isEdited:e,isLoading:o,isSaving:s,isError:d,handleOnChange:u,handleSave:p}},H0=()=>{const{limit:e,isEdited:t,isLoading:r,isSaving:n,isError:o,handleOnChange:i,handleSave:s}=U0();return a.jsxs(a.Fragment,{children:[r&&a.jsx(Ir,{}),a.jsx(vt,{left:[a.jsx(_t,{name:"Settings",Icon:Sp},"Settings"),a.jsx(tr,{},"back-settings")],center:[a.jsx(zr,{},"Settings-widget-name")],right:[a.jsx(uo,{onSave:s,isSaving:n,disabled:!t},"save")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Settings"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-card--settings",children:[a.jsx("div",{className:"ecr-admin-card__header",children:a.jsx("h2",{className:"ecr-admin-card__title",children:"ReelsWP Settings"})}),o&&a.jsx("div",{className:"ecr-admin-form__row",children:a.jsx("span",{children:"Unable to load settings. Please try again."})}),a.jsxs("form",{action:"",className:"ecr-admin-form",children:[a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_rate_limit",className:"ecr-admin-form__label",children:"Rate Limit:"}),a.jsx("input",{type:"number",id:"ecommreels_rate_limit",name:"ecommreels_rate_limit",value:e.rateLimit,onChange:l=>i("rateLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]}),a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_time_limit",className:"ecr-admin-form__label",children:"Time Limit (minutes):"}),a.jsx("input",{type:"number",id:"ecommreels_time_limit",name:"ecommreels_time_limit",value:e.timeLimit,onChange:l=>i("timeLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]})]})]})]})},V0=[{label:"No.",width:80,align:"center"},{label:"Story Title",width:150,align:"left"},{label:"Campaign Name",width:150,align:"left"},{label:"Button Text",width:150,align:"left"},{label:"URL",align:"left"},{label:"Click",width:80,align:"center"}],W0=({tableData:e})=>a.jsxs(Wl,{className:"ecr-admin-stats__table",children:[!e.length&&a.jsx(Yl,{className:"ecr-admin-stats__caption",children:a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(ot,{className:"ecr-admin-stats__empty-icon"}),"You did not create any reel group yet!"]})}),a.jsx(ql,{children:a.jsx(Sn,{children:V0.map((t,r)=>a.jsx(Kl,{className:"ecr-admin-stats__head",style:{...t.width&&{width:`${t.width}px`},textAlign:t.align},children:t.label},r))})}),!!e.length&&a.jsx(Gl,{children:e.map((t,r)=>a.jsxs(Sn,{className:F("ecr-admin-stats__row",r%2===0&&"ecr-admin-stats__row--alt"),children:[a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:r+1}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.storyTitle}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.campaignName}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.buttonText}),a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--link",children:a.jsx("a",{href:t.buttonUrl,target:"_blank",rel:"noopener noreferrer",className:"ecr-admin-stats__link",children:t.buttonUrl})}),a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:t.clickCount})]},t.id))})]}),q0=()=>{const[e]=Yt(),t=e.get("group"),r=e.get("name"),[n,o]=y.useState([]),[i,s]=y.useState([]),[l,d]=y.useState(!1),[c,u]=y.useState(!1);y.useEffect(()=>{t&&(async()=>{try{d(!0);const g=await he.get(`/group/${t}/stats`);o(g.data.stories),s(g.data.buttons)}catch(g){g instanceof Error?K.error(g.message):K.error("Something went wrong. Try again later!"),u(!0)}finally{d(!1)}})()},[t]);const p=n.length>0?n.reduce((m,g)=>m+=g.view_count??0,0):0;return a.jsxs(a.Fragment,{children:[a.jsx(vt,{left:[a.jsx(_t,{name:"Statistics",Icon:ui},"Statistics"),a.jsx(tr,{},"Statistics-back")],center:[a.jsx(zr,{},"Statistics-widget-name")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Statistics"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-stats",children:[a.jsxs("div",{className:"ecr-admin-stats__header",children:[a.jsxs("h2",{className:"ecr-admin-stats__title",children:["Group: ",r]}),l?a.jsx("div",{className:"ecr-admin-stats__summary-skeleton"}):a.jsxs("div",{className:"ecr-admin-stats__summary",children:[a.jsx("span",{children:"Total View:"})," ",a.jsx("span",{children:p})]})]}),a.jsx("div",{className:"ecr-admin-stats__body",children:l?a.jsx(Xl,{}):c?a.jsx(Bl,{}):i.length===0?a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(ot,{className:"ecr-admin-stats__empty-icon"}),a.jsx("span",{children:"No Stats available for this group"})]}):a.jsx(W0,{tableData:i})})]})]})};function G0(e){return H({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 3a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2zm-5-1v12H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm1 0h2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-2z"},child:[]}]})(e)}function K0(e){return H({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11 4a4 4 0 0 1 0 8H8a5 5 0 0 0 2-4 5 5 0 0 0-2-4zm-6 8a4 4 0 1 1 0-8 4 4 0 0 1 0 8M0 8a5 5 0 0 0 5 5h6a5 5 0 0 0 0-10H5a5 5 0 0 0-5 5"},child:[]}]})(e)}const Y0=({isExpanded:e,setIsExpanded:t})=>a.jsx("button",{onClick:()=>t(r=>!r),className:F("ecr-admin-side-toggle",e?"ecr-admin-side-toggle--active":""),title:"Side Panel",children:a.jsx(G0,{size:24})}),X0=({...e})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",...e,children:a.jsxs("g",{fill:"none","fill-rule":"evenodd",children:[a.jsx("path",{d:"m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z"}),a.jsx("path",{fill:"currentColor",d:"M16 15c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 1 1 0-2h9.17A3 3 0 0 1 16 15m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2M8 9a3 3 0 0 1 2.762 1.828l.067.172H20a1 1 0 0 1 .117 1.993L20 13h-9.17a3.001 3.001 0 0 1-5.592.172L5.17 13H4a1 1 0 0 1-.117-1.993L4 11h1.17A3 3 0 0 1 8 9m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2m8-8c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 0 1 0-2h9.17A3 3 0 0 1 16 3m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2"})]})}),Jo=y.forwardRef(({className:e,type:t,...r},n)=>a.jsx(W.input,{ref:n,type:t,"data-slot":"input",className:F("ecr-input",e),...r}));Jo.displayName="Input";const Zo=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:d})=>{const[c,u]=y.useState(n),p=y.useRef(null);y.useEffect(()=>{u(n)},[n]);const m=b=>{const f=Math.min(r,Math.max(t,Number(b)));o(f)},g=b=>{const f=Number(b);u(f),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{m(f>r?r:f<t?t:f)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":"]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!d&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:b=>{const f=Number(b.target.value);u(f),m(f)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(Jo,{type:"number",min:t,max:r,value:c,onChange:b=>g(b.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})};function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},D.apply(null,arguments)}function Be(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var zt=255,Je=100,mr=e=>{var{r:t,g:r,b:n,a:o}=e,i=Math.max(t,r,n),s=i-Math.min(t,r,n),l=s?i===t?(r-n)/s:i===r?2+(n-t)/s:4+(t-r)/s:0;return{h:60*(l<0?l+6:l),s:i?s/i*Je:0,v:i/zt*Je,a:o}},Jl=e=>{var{h:t,s:r,l:n,a:o}=Zl(e);return"hsla("+t+", "+r+"%, "+n+"%, "+o+")"},Zl=e=>{var{h:t,s:r,v:n,a:o}=e,i=(200-r)*n/Je;return{h:t,s:i>0&&i<200?r*n/Je/(i<=Je?i:200-i)*Je:0,l:i/2,a:o}},Ql=e=>{var{r:t,g:r,b:n}=e,o=t<<16|r<<8|n;return"#"+(i=>new Array(7-i.length).join("0")+i)(o.toString(16))},J0=e=>{var{r:t,g:r,b:n,a:o}=e,i=typeof o=="number"&&(o*255|256).toString(16).slice(1);return""+Ql({r:t,g:r,b:n})+(i||"")},fr=e=>mr(Z0(e)),Z0=e=>{var t=e.replace("#","");/^#?/.test(e)&&t.length===3&&(e="#"+t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var r=new RegExp("[A-Za-z0-9]{2}","g"),[n,o,i=0,s]=e.match(r).map(l=>parseInt(l,16));return{r:n,g:o,b:i,a:(s??255)/zt}},Cn=e=>{var{h:t,s:r,v:n,a:o}=e,i=t/60,s=r/Je,l=n/Je,d=Math.floor(i)%6,c=i-Math.floor(i),u=zt*l*(1-s),p=zt*l*(1-s*c),m=zt*l*(1-s*(1-c));l*=zt;var g={};switch(d){case 0:g.r=l,g.g=m,g.b=u;break;case 1:g.r=p,g.g=l,g.b=u;break;case 2:g.r=u,g.g=l,g.b=m;break;case 3:g.r=u,g.g=p,g.b=l;break;case 4:g.r=m,g.g=u,g.b=l;break;case 5:g.r=l,g.g=u,g.b=p;break}return g.r=Math.round(g.r),g.g=Math.round(g.g),g.b=Math.round(g.b),D({},g,{a:o})},Q0=e=>{var{r:t,g:r,b:n,a:o}=Cn(e);return"rgba("+t+", "+r+", "+n+", "+o+")"},eb=e=>{var{r:t,g:r,b:n}=e;return{r:t,g:r,b:n}},tb=e=>{var{h:t,s:r,l:n}=e;return{h:t,s:r,l:n}},Qo=e=>Ql(Cn(e)),rb=e=>{var{h:t,s:r,v:n}=e;return{h:t,s:r,v:n}},nb=e=>{var{r:t,g:r,b:n}=e,o=function(u){return u<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)},i=o(t/255),s=o(r/255),l=o(n/255),d={};return d.x=i*.4124+s*.3576+l*.1805,d.y=i*.2126+s*.7152+l*.0722,d.bri=i*.0193+s*.1192+l*.9505,d},Mt=e=>{var t,r,n,o,i,s,l,d,c;return typeof e=="string"&&ea(e)?(s=fr(e),d=e):typeof e!="string"&&(s=e),s&&(n=rb(s),i=Zl(s),o=Cn(s),c=J0(o),d=Qo(s),r=tb(i),t=eb(o),l=nb(t)),{rgb:t,hsl:r,hsv:n,rgba:o,hsla:i,hsva:s,hex:d,hexa:c,xy:l}},ea=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e);function ec(e){var t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useCallback((r,n)=>t.current&&t.current(r,n),[])}var hr=e=>"touches"in e,tc=e=>{!hr(e)&&e.preventDefault&&e.preventDefault()},rc=function(t,r,n){return r===void 0&&(r=0),n===void 0&&(n=1),t>n?n:t<r?r:t},nc=(e,t)=>{var r=e.getBoundingClientRect(),n=hr(t)?t.touches[0]:t;return{left:rc((n.pageX-(r.left+window.pageXOffset))/r.width),top:rc((n.pageY-(r.top+window.pageYOffset))/r.height),width:r.width,height:r.height,x:n.pageX-(r.left+window.pageXOffset),y:n.pageY-(r.top+window.pageYOffset)}},ob=["prefixCls","className","onMove","onDown"],ta=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-interactive",className:n,onMove:o,onDown:i}=e,s=Be(e,ob),l=y.useRef(null),d=y.useRef(!1),[c,u]=y.useState(!1),p=ec(o),m=ec(i),g=_=>d.current&&!hr(_)?!1:(d.current=hr(_),!0),b=y.useCallback(_=>{if(tc(_),!!l.current){var w=hr(_)?_.touches.length>0:_.buttons>0;if(!w){u(!1);return}p?.(nc(l.current,_),_)}},[p]),f=y.useCallback(()=>u(!1),[]),h=y.useCallback(_=>{_?(window.addEventListener(d.current?"touchmove":"mousemove",b),window.addEventListener(d.current?"touchend":"mouseup",f)):(window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",f),window.removeEventListener("touchmove",b),window.removeEventListener("touchend",f))},[b,f]);y.useEffect(()=>(h(c),()=>{h(!1)}),[c,b,f,h]);var v=y.useCallback(_=>{var w=document.activeElement;w?.blur(),tc(_.nativeEvent),g(_.nativeEvent)&&l.current&&(m?.(nc(l.current,_.nativeEvent),_.nativeEvent),u(!0))},[m]);return a.jsx("div",D({},s,{className:[r,n||""].filter(Boolean).join(" "),style:D({},s.style,{touchAction:"none"}),ref:l,tabIndex:0,onMouseDown:v,onTouchStart:v}))});ta.displayName="Interactive";var ab=e=>{var{className:t,color:r,left:n,top:o,prefixCls:i}=e,s={position:"absolute",top:o,left:n},l={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:r};return y.useMemo(()=>a.jsx("div",{className:i+"-pointer "+(t||""),style:s,children:a.jsx("div",{className:i+"-fill",style:l})}),[o,n,r,t,i])},ib=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],oc=y.forwardRef((e,t)=>{var r,{prefixCls:n="w-color-saturation",radius:o=0,pointer:i,className:s,hue:l=0,style:d,hsva:c,onChange:u}=e,p=Be(e,ib),m=D({width:200,height:200,borderRadius:o},d,{position:"relative"}),g=(v,_)=>{u&&c&&u({h:c.h,s:v.left*100,v:(1-v.top)*100,a:c.a})},b=y.useCallback(v=>{if(!(!c||!u)){var _=1,w=c.s,j=c.v,C=!1;switch(v.key){case"ArrowLeft":w=Math.max(0,c.s-_),C=!0,v.preventDefault();break;case"ArrowRight":w=Math.min(100,c.s+_),C=!0,v.preventDefault();break;case"ArrowUp":j=Math.min(100,c.v+_),C=!0,v.preventDefault();break;case"ArrowDown":j=Math.max(0,c.v-_),C=!0,v.preventDefault();break;default:return}C&&u({h:c.h,s:w,v:j,a:c.a})}},[c,u]),f=y.useMemo(()=>{if(!c)return null;var v={top:100-c.v+"%",left:c.s+"%",color:Jl(c)};return i&&typeof i=="function"?i(D({prefixCls:n},v)):a.jsx(ab,D({prefixCls:n},v))},[c,i,n]),h=y.useCallback(v=>{v.target.focus()},[]);return a.jsx(ta,D({className:[n,s||""].filter(Boolean).join(" ")},p,{style:D({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+((r=c?.h)!=null?r:l)+", 100%, 50%))"},m,{outline:"none"}),ref:t,onMove:g,onDown:g,onKeyDown:b,onClick:h,children:f}))});oc.displayName="Saturation";var sb=["className","prefixCls","left","top","style","fillProps"],lb=e=>{var{className:t,prefixCls:r,left:n,top:o,style:i,fillProps:s}=e,l=Be(e,sb),d=D({},i,{position:"absolute",left:n,top:o}),c=D({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},s?.style,{transform:n?"translate(-9px, -1px)":"translate(-1px, -9px)"});return a.jsx("div",D({className:r+"-pointer "+(t||""),style:d},l,{children:a.jsx("div",D({className:r+"-fill"},s,{style:c}))}))},cb=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],db="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",kn=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-alpha",className:n,hsva:o,background:i,bgProps:s={},innerProps:l={},pointerProps:d={},radius:c=0,width:u,height:p=16,direction:m="horizontal",style:g,onChange:b,pointer:f}=e,h=Be(e,cb),v=T=>{b&&b(D({},o,{a:m==="horizontal"?T.left:T.top}),T)},_=Jl(Object.assign({},o,{a:1})),w="linear-gradient(to "+(m==="horizontal"?"right":"bottom")+", rgba(244, 67, 54, 0) 0%, "+_+" 100%)",j={};m==="horizontal"?j.left=o.a*100+"%":j.top=o.a*100+"%";var C=D({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:c,background:"url("+db+") left center",backgroundColor:"var(--alpha-background-color)"},{width:u,height:p},g,{position:"relative"}),N=y.useCallback(T=>{var A=.01,O=o.a,R=O;switch(T.key){case"ArrowLeft":m==="horizontal"&&(R=Math.max(0,O-A),T.preventDefault());break;case"ArrowRight":m==="horizontal"&&(R=Math.min(1,O+A),T.preventDefault());break;case"ArrowUp":m==="vertical"&&(R=Math.max(0,O-A),T.preventDefault());break;case"ArrowDown":m==="vertical"&&(R=Math.min(1,O+A),T.preventDefault());break;default:return}if(R!==O){var L={left:m==="horizontal"?R:o.a,top:m==="vertical"?R:o.a,width:0,height:0,x:0,y:0};b&&b(D({},o,{a:R}),L)}},[o,m,b]),k=y.useCallback(T=>{T.target.focus()},[]),E=f&&typeof f=="function"?f(D({prefixCls:r},d,j)):a.jsx(lb,D({},d,{prefixCls:r},j));return a.jsxs("div",D({},h,{className:[r,r+"-"+m,n||""].filter(Boolean).join(" "),style:C,ref:t,children:[a.jsx("div",D({},s,{style:D({inset:0,position:"absolute",background:i||w,borderRadius:c},s.style)})),a.jsx(ta,D({},l,{style:D({},l.style,{inset:0,zIndex:1,position:"absolute",outline:"none"}),onMove:v,onDown:v,onClick:k,onKeyDown:N,children:E}))]}))});kn.displayName="Alpha";var ub=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur","renderInput"],pb=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e),mb=e=>Number(String(e).replace(/%/g,"")),Dt=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input",placement:n="bottom",label:o,value:i,className:s,style:l,labelStyle:d,inputStyle:c,onChange:u,onBlur:p,renderInput:m}=e,g=Be(e,ub),[b,f]=y.useState(i),h=y.useRef(!1);y.useEffect(()=>{e.value!==b&&(h.current||f(e.value))},[e.value]);function v(k,E){var T=(E||k.target.value).trim().replace(/^#/,"");pb(T)&&u&&u(k,T);var A=mb(T);isNaN(A)||u&&u(k,A),f(T)}function _(k){h.current=!1,f(e.value),p&&p(k)}var w={};n==="bottom"&&(w.flexDirection="column"),n==="top"&&(w.flexDirection="column-reverse"),n==="left"&&(w.flexDirection="row-reverse");var j=D({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},w,l),C=D({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},c),N=D({value:b,onChange:v,onBlur:_,autoComplete:"off",onFocus:()=>h.current=!0},g,{style:C,onFocusCapture:k=>{var E=k.target;E.setSelectionRange(E.value.length,E.value.length)}});return a.jsxs("div",{className:[r,s||""].filter(Boolean).join(" "),style:j,children:[m?m(N,t):a.jsx("input",D({ref:t},N)),o&&a.jsx("span",{style:D({color:"var(--editable-input-label-color)",textTransform:"capitalize"},d),children:o})]})});Dt.displayName="EditableInput";var fb=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],ac=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input-rgba",hsva:n,placement:o="bottom",rProps:i={},gProps:s={},bProps:l={},aProps:d={},className:c,style:u,onChange:p}=e,m=Be(e,fb),g=n?Cn(n):{};function b(_){var w=Number(_.target.value);w&&w>255&&(_.target.value="255"),w&&w<0&&(_.target.value="0")}var f=_=>{var w=Number(_.target.value);w&&w>100&&(_.target.value="100"),w&&w<0&&(_.target.value="0")},h=(_,w,j)=>{typeof _=="number"&&(w==="a"&&(_<0&&(_=0),_>100&&(_=100),p&&p(Mt(mr(D({},g,{a:_/100}))))),_>255&&(_=255,j.target.value="255"),_<0&&(_=0,j.target.value="0"),w==="r"&&p&&p(Mt(mr(D({},g,{r:_})))),w==="g"&&p&&p(Mt(mr(D({},g,{g:_})))),w==="b"&&p&&p(Mt(mr(D({},g,{b:_})))))},v=g.a?Math.round(g.a*100)/100:0;return a.jsxs("div",D({ref:t,className:[r,c||""].filter(Boolean).join(" ")},m,{style:D({fontSize:11,display:"flex"},u),children:[a.jsx(Dt,D({label:"R",value:g.r||0,onBlur:b,placement:o,onChange:(_,w)=>h(w,"r",_)},i,{style:D({},i.style)})),a.jsx(Dt,D({label:"G",value:g.g||0,onBlur:b,placement:o,onChange:(_,w)=>h(w,"g",_)},s,{style:D({marginLeft:5},i.style)})),a.jsx(Dt,D({label:"B",value:g.b||0,onBlur:b,placement:o,onChange:(_,w)=>h(w,"b",_)},l,{style:D({marginLeft:5},l.style)})),d&&a.jsx(Dt,D({label:"A",value:parseInt(String(v*100),10),onBlur:f,placement:o,onChange:(_,w)=>h(w,"a",_)},d,{style:D({marginLeft:5},d.style)}))]}))});ac.displayName="EditableInputRGBA";var hb=["prefixCls","className","hue","onChange","direction"],ic=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-hue",className:n,hue:o=0,onChange:i,direction:s="horizontal"}=e,l=Be(e,hb);return a.jsx(kn,D({ref:t,className:r+" "+(n||"")},l,{direction:s,background:"linear-gradient(to "+(s==="horizontal"?"right":"bottom")+", rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)",hsva:{h:o,s:100,v:100,a:o/360},onChange:(d,c)=>{i&&i({h:s==="horizontal"?360*c.left:360*c.top})}}))});ic.displayName="Hue";var gb=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],sc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-swatch",className:n,color:o,colors:i=[],style:s,rectProps:l={},onChange:d,addonAfter:c,addonBefore:u,rectRender:p}=e,m=Be(e,gb),g=D({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},l.style),b=(f,h)=>{d&&d(fr(f),Mt(fr(f)),h)};return a.jsxs("div",D({ref:t},m,{className:[r,n||""].filter(Boolean).join(" "),style:D({display:"flex",flexWrap:"wrap",position:"relative"},s),children:[u&&y.isValidElement(u)&&u,i&&Array.isArray(i)&&i.map((f,h)=>{var v="",_="";typeof f=="string"&&(v=f,_=f),typeof f=="object"&&f.color&&(v=f.title||f.color,_=f.color);var w=o&&o.toLocaleLowerCase()===_.toLocaleLowerCase(),j=p&&p({title:v,color:_,checked:!!w,style:D({},g,{background:_}),onClick:N=>b(_,N)});if(j)return a.jsx(y.Fragment,{children:j},h);var C=l.children&&y.isValidElement(l.children)?y.cloneElement(l.children,{color:_,checked:w}):null;return a.jsx("div",D({tabIndex:0,title:v,onClick:N=>b(_,N)},l,{children:C,style:D({},g,{background:_})}),h)}),c&&y.isValidElement(c)&&c]}))});sc.displayName="Swatch";var xb=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],bb=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],lc=e=>a.jsx("div",{style:{boxShadow:"rgb(0 0 0 / 60%) 0px 0px 2px",width:4,top:1,bottom:1,left:e.left,borderRadius:1,position:"absolute",backgroundColor:"#fff"}}),cc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-sketch",className:n,onChange:o,width:i=218,presetColors:s=bb,color:l,editableDisable:d=!0,disableAlpha:c=!1,style:u}=e,p=Be(e,xb),[m,g]=y.useState({h:209,s:36,v:90,a:1});y.useEffect(()=>{typeof l=="string"&&ea(l)&&g(fr(l)),typeof l=="object"&&g(l)},[l]);var b=N=>{g(N),o&&o(Mt(N))},f=(N,k)=>{typeof N=="string"&&ea(N)&&/(3|6)/.test(String(N.length))&&b(fr(N))},h=N=>b(D({},m,{a:N.a})),v=N=>b(D({},m,N,{a:m.a})),_=D({"--sketch-background":"rgb(255, 255, 255)","--sketch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px, rgb(0 0 0 / 15%) 0px 8px 16px","--sketch-swatch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset","--sketch-alpha-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset, rgb(0 0 0 / 25%) 0px 0px 4px inset","--sketch-swatch-border-top":"1px solid rgb(238, 238, 238)",background:"var(--sketch-background)",borderRadius:4,boxShadow:"var(--sketch-box-shadow)",width:i},u),w={borderRadius:2,background:Q0(m),boxShadow:"var(--sketch-alpha-box-shadow)"},j={borderTop:"var(--sketch-swatch-border-top)",paddingTop:10,paddingLeft:10},C={marginRight:10,marginBottom:10,borderRadius:3,boxShadow:"var(--sketch-swatch-box-shadow)"};return a.jsxs("div",D({},p,{className:r+" "+(n||""),ref:t,style:_,children:[a.jsxs("div",{style:{padding:"10px 10px 8px"},children:[a.jsx(oc,{hsva:m,style:{width:"auto",height:150},onChange:v}),a.jsxs("div",{style:{display:"flex",marginTop:4},children:[a.jsxs("div",{style:{flex:1},children:[a.jsx(ic,{width:"auto",height:10,hue:m.h,pointer:lc,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:N=>b(D({},m,N))}),!c&&a.jsx(kn,{width:"auto",height:10,hsva:m,pointer:lc,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:h})]}),!c&&a.jsx(kn,{width:24,height:24,hsva:m,radius:2,style:{marginLeft:4},bgProps:{style:{background:"transparent"}},innerProps:{style:w},pointer:()=>a.jsx(y.Fragment,{})})]})]}),d&&a.jsxs("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[a.jsx(Dt,{label:"Hex",value:Qo(m).replace(/^#/,"").toLocaleUpperCase(),onChange:(N,k)=>f(k),style:{minWidth:58}}),a.jsx(ac,{hsva:m,style:{marginLeft:6},aProps:c?!1:{},onChange:N=>b(N.hsva)})]}),s&&s.length>0&&a.jsx(sc,{style:j,colors:s,color:Qo(m),onChange:N=>b(N),rectProps:{style:C}})]}))});cc.displayName="Sketch";const dc=({selectedColor:e,handleColor:t,text:r,wrapperStyles:n})=>a.jsxs("div",{style:n,className:"ecr-admin-control",children:[a.jsxs("p",{className:"ecr-admin-control__label",children:[r,":"]}),a.jsxs("div",{className:"ecr-admin-control__row ecr-admin-control__row--color",children:[a.jsxs(Rt,{children:[a.jsx(Lt,{style:{padding:0,backgroundColor:"transparent"},children:a.jsx("div",{style:{backgroundColor:e},className:"ecr-admin-control__swatch"})}),a.jsx(It,{className:"ecr-admin-popover ecr-admin-color-selector-popover",children:a.jsx(cc,{color:e,disableAlpha:!0,onChange:o=>{t(o.hex)}})})]}),a.jsx("input",{className:"ecr-admin-control__hex",type:"text",value:e,onChange:o=>t(o.target.value)})]})]}),vb=[{value:"left",title:"Align Left",Icon:$p},{value:"center",title:"Align Center",Icon:Bp},{value:"right",title:"Align Right",Icon:Up},{value:"hidden",title:"Hidden",Icon:Hp}],_b=({alignment:e,handleWidgetTitleAlignment:t})=>a.jsxs("div",{className:"ecr-admin-group-title_alignment",children:[a.jsx("p",{className:"ecr-admin-group-title_alignment-label",children:"Alignment:"}),a.jsx("div",{className:"ecr-admin-group-title_alignment-options",children:vb.map(({value:r,title:n,Icon:o})=>a.jsx(te,{onClick:()=>t(r),style:{width:40,...e===r?{backgroundColor:"#2563eb",color:"#fff"}:{}},size:"icon-sm",variant:"ghost",title:n,children:a.jsx(o,{size:18})},r))})]}),yb=({styles:e,setStyles:t,setIsEdited:r})=>{const n=o=>{t(i=>{const s=o(i);return r(!0),s})};return a.jsxs("div",{className:"ecr-admin-group-title-customization__content",children:[a.jsx(_b,{alignment:e.widgetTitle?.alignment??"hidden",handleWidgetTitleAlignment:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,alignment:o}}))}),a.jsx(dc,{selectedColor:e.widgetTitle?.color??"#000000",handleColor:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,color:o}})),text:"Title Color",wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}}),a.jsx(Zo,{label:"Font size",min:10,max:200,value:e?.widgetTitle?.fontSize??24,onChange:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,fontSize:o}})),name:"font_size",id:"font-size",hideSlider:!0,wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}})]})},wb=(e=700)=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useCallback(i=>{Vl(i),r(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r(!1)},e)},[e]);return y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),[t,o]},jb=({gid:e})=>{const[t,r]=wb(),n=`[reelswp-group id='${e}']`;return a.jsxs("div",{className:"ecr-admin-shortcode",children:[a.jsx("span",{className:"ecr-admin-shortcode__badge",children:n}),a.jsxs("div",{className:"ecr-admin-shortcode__copy",children:[a.jsx("button",{onClick:()=>r(n),className:"ecr-admin-shortcode__button",title:"Copy",children:a.jsx(Ff,{color:"#ffffff",size:12})}),a.jsx("span",{className:F("ecr-admin-shortcode__tooltip",t?"ecr-admin-shortcode__tooltip--visible":"ecr-admin-shortcode__tooltip--hidden"),children:"Copied!"})]})]})},uc=y.createContext({requestLeave:e=>e()}),Sb=({value:e,children:t})=>a.jsx(uc.Provider,{value:e,children:t}),pc=()=>y.useContext(uc);function Cb(e){return H({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"},child:[]}]})(e)}const kb=({link:e,usedFor:t})=>a.jsx("div",{className:"ecr-product-card-one",style:{width:"100%"},children:a.jsx(Nb,{link:e,usedFor:t})}),Nb=({link:e,usedFor:t})=>a.jsx(a.Fragment,{children:a.jsxs("div",{className:"ecr-product-card-one-content-wrapper",children:[t==="admin"?a.jsx("img",{className:"ecr-product-card-one__thumb",src:e.thumbnail||wn,alt:"Product thumbnail"}):a.jsx("a",{href:e.buttonUrl,target:"_blank",draggable:!1,children:a.jsx("img",{className:"ecr-product-card-one__thumb",src:e.thumbnail||wn,alt:"Product thumbnail",draggable:!1})}),a.jsxs("div",{className:"ecr-product-card-one__content",children:[t==="admin"?a.jsx("p",{className:"ecr-product-card-one__title",children:e.buttonText}):a.jsx("a",{className:"ecr-product-card-one__title",href:e.buttonUrl,target:"_blank",draggable:!1,children:e.buttonText}),a.jsxs("div",{className:"ecr-product-card-one__meta",children:[Number(e.rating)>0?a.jsxs("span",{className:"ecr-product-card-one__rating",children:[a.jsx(Cb,{className:"ecr-product-card-one__star"}),e.rating]}):null,a.jsx("div",{className:"ecr-product-card-one__price",dangerouslySetInnerHTML:{__html:e.price}})]})]})]})}),Eb=({link:e,usedFor:t})=>{const r=t==="admin";return a.jsx("div",{style:{width:"100%"},className:"ecr-thumb__link-wrapper",children:a.jsx("a",{href:r?void 0:e.buttonUrl,target:r?void 0:"_blank",rel:r?void 0:"noopener noreferrer",className:`ecr-thumb__link ${e.customClass??""}`,onClick:r?n=>n.preventDefault():void 0,"aria-disabled":r,tabIndex:r?-1:void 0,draggable:!1,children:e.buttonText})})},Nn=({link:e,usedFor:t,style:r})=>a.jsx("div",{className:"ecr-admin-reelitem-links",style:r,children:e.btn_type==="product"?a.jsx(kb,{link:e,usedFor:t},e.btn_uuid):a.jsx(Eb,{link:e,usedFor:t},e.btn_uuid)}),Ft=({title:e,styles:t})=>a.jsx("p",{className:"ecr-reel_title",style:t,children:e}),mc=({reel:e,styles:t,gid:r,togglingId:n,onRemove:o})=>{const i=Ne(),{requestLeave:s}=pc(),l=n===e.story_uuid,d=`?view=${X.cr}&from=${X.mg}&sid=${e.id}${r?`&gid=${r}`:""}`,c=t.appearance??"overlay",u={border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t?.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},p=t.border.border_radius,m=p>50?p+16:p>20?p:0,g=e.links&&e.links.length>0?e.links[0]:null,b=c==="none",f=c==="title",h=t.shape==="rectangle",v=!b&&!f&&g;return a.jsxs("div",{className:F("ecr-admin-reelitem",t?.hoverEffect),children:[a.jsxs("div",{style:u,className:"ecr-admin-reelitem__frame",children:[a.jsx(Jn,{story:e,styles:t}),!b&&!f&&h?v?a.jsx(Nn,{link:g,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Ft,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null,a.jsxs("div",{className:"ecr-admin-reelitem__actions",children:[a.jsx(te,{title:"Edit Story",size:"icon-sm",asChild:!0,className:"ecr-admin-reelitem__button",disabled:l,children:a.jsx(ht,{to:d,className:F("ecr-admin-reelitem__link",l?"ecr-admin-reelitem__link--disabled":"ecr-admin-reelitem__link--active"),onClick:_=>{_.preventDefault(),s(()=>i(d))},children:a.jsx(Or,{className:"ecr-admin-reelitem__icon"})})}),a.jsx(te,{onClick:()=>o(e,"remove"),className:"ecr-admin-reelitem__button ecr-admin-reelitem__button--danger",size:"icon-sm",title:"Remove Story",disabled:l,children:l?a.jsx(rt,{className:"ecr-admin-reelitem__spinner",size:18}):a.jsx(Vn,{size:18})})]})]}),f?a.jsx("p",{className:"ecr-admin-reel__title",children:e.title}):null]})},fc=(e,t)=>{const r=y.useRef(null),n=y.useRef(null),o=y.useRef(null),[i,s]=y.useState(!1),[l,d]=y.useState(!1),[c,u]=y.useState(!1),[p,m]=y.useState(300),g=()=>{const f=r.current;if(!f)return;const h=f.scrollLeft,v=f.scrollWidth,_=f.clientWidth;d(h>0),u(h+_<v-1)};y.useEffect(()=>{const f=r.current,h=n.current;f&&h&&(s(h.scrollWidth>f.clientWidth),m(f.clientWidth-100),g())},[e,t]);const b=f=>{const h=r.current;h&&(h.scrollBy({left:f,behavior:"smooth"}),o.current&&clearTimeout(o.current),o.current=setTimeout(g,300))};return y.useEffect(()=>{const f=r.current;if(!f)return;let h=!1,v,_;const w=A=>{h=!0,v=A.pageX-f.offsetLeft,_=f.scrollLeft,f.style.cursor="grabbing"},j=()=>{h=!1,f.style.cursor="default"},C=()=>{h=!1,f.style.cursor="default"},N=A=>{if(!h)return;A.preventDefault();const R=(A.pageX-f.offsetLeft-v)*1.5;f.scrollLeft=_-R,g()},k=A=>{h=!0,v=A.touches[0].pageX-f.offsetLeft,_=f.scrollLeft},E=()=>{h=!1},T=A=>{if(!h)return;const R=(A.touches[0].pageX-f.offsetLeft-v)*1.5;f.scrollLeft=_-R,g()};return f.addEventListener("mousedown",w),f.addEventListener("mouseleave",j),f.addEventListener("mouseup",C),f.addEventListener("mousemove",N),f.addEventListener("touchstart",k,{passive:!0}),f.addEventListener("touchend",E),f.addEventListener("touchmove",T,{passive:!0}),()=>{f.removeEventListener("mousedown",w),f.removeEventListener("mouseleave",j),f.removeEventListener("mouseup",C),f.removeEventListener("mousemove",N),f.removeEventListener("touchstart",k),f.removeEventListener("touchend",E),f.removeEventListener("touchmove",T)}},[t]),y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{thumbsContainerRef:r,thumbsWrapperRef:n,isOverflowing:i,canScrollLeft:l,canScrollRight:c,scrollBy:b,scrollStep:p}},hc=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:d,canScrollRight:c,scrollBy:u,scrollStep:p}=fc([e],!0);return a.jsxs("div",{className:"ecr-admin-editor-carousel",children:[a.jsx("div",{ref:i,className:"ecr-admin-editor-carousel__viewport",children:a.jsx("div",{ref:s,style:{...!e.length&&{margin:"auto"}},className:F("ecr-admin-editor-carousel__track",t.hoverEffect==="zoom-in"&&"ecr-admin-editor-carousel__track--padded"),children:e.length>0?e.map(m=>a.jsx(mc,{reel:m,styles:t,gid:r,togglingId:n,onRemove:o},m.id)):a.jsx("div",{className:"ecr-admin-editor-carousel__empty",children:a.jsxs("p",{className:"ecr-admin-editor-carousel__empty-text",children:[a.jsx(ot,{className:"ecr-admin-editor-carousel__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})})}),l&&d&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--left",children:a.jsx(Zt,{size:20})}),l&&c&&a.jsx("button",{onClick:()=>u(p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--right",children:a.jsx(Qt,{size:20})})]})},Tb=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>a.jsx("div",{className:F("ecr-admin-editor-grid",t?.hoverEffect==="zoom-in"&&"ecr-admin-editor-grid--padded"),children:e.length>0?e.map(i=>a.jsx(mc,{reel:i,styles:t,gid:r,togglingId:n,onRemove:o},i.id)):a.jsx("div",{className:"ecr-admin-editor-grid__empty",children:a.jsxs("p",{className:"ecr-admin-editor-grid__empty-text",children:[a.jsx(ot,{className:"ecr-admin-editor-grid__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})}),Ab=({reel:e,styles:t})=>{const r=e?.files?.[0],n=!!r?.mime_type?.startsWith("image"),[o,i]=y.useState(!1),[s,l]=y.useState(!0),[d,c]=y.useState(!1),u=y.useRef(null);y.useEffect(()=>{u.current&&(u.current.muted=s)},[s]),y.useEffect(()=>{u.current&&(o?u.current.pause():u.current.play().catch(()=>{}))},[o]);const p=()=>{u.current&&i(f=>!f)},m=()=>{u.current&&l(f=>!f)},g=t?.playerAppearance??"overlay",b=e.links&&e.links.length>0?e.links[0]:null;return a.jsx("div",{className:"ecr-preview-player",children:a.jsxs("div",{className:"ecr-preview-player__stage",children:[a.jsx(xt,{className:"ecr-player__nav--left ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Zt,{size:24})}),a.jsx(xt,{className:"ecr-player__nav--right ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Qt,{size:24})}),a.jsxs("div",{className:"ecr-player__frame",style:{backgroundColor:d?"transparent":"#000"},children:[a.jsx("button",{type:"button",className:"ecr-player__close","aria-label":"Close preview",children:a.jsx(er,{className:"ecr-player__close-icon"})}),r?a.jsx("div",{className:"ecr-player__media-frame",children:n?a.jsx("img",{src:r.url,alt:e?.title||"Reel preview",className:"ecr-preview-player__media-item",loading:"lazy"}):a.jsxs(a.Fragment,{children:[a.jsx("video",{style:{height:d?"100%":"auto"},ref:u,className:"ecr-preview-player__media-item",src:r.url,poster:e?.thumbnail,autoPlay:!0,muted:s,loop:!0,playsInline:!0,onClick:p,onLoadedMetadata:f=>{const h=f.currentTarget,v=h.videoWidth,_=h.videoHeight;c(()=>_>v)}}),a.jsxs("div",{className:"ecr-player__controls",children:[o?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:p}):a.jsx(qn,{size:20,className:"ecr-player__control-icon",onClick:p}),s?a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:m}):a.jsx(Yn,{size:20,className:"ecr-player__control-icon",onClick:m})]})]})}):a.jsx("div",{className:"ecr-preview-player__empty",children:"No preview available"})]}),g==="overlay"?b?a.jsx(Nn,{link:b,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Ft,{title:e.title}):null,g==="title"?a.jsx(Ft,{title:e.title}):null]})})},Pb={carousel:hc,grid:Tb},Ob=({gid:e,reels:t,styles:r,handleRemoveReel:n,togglingId:o,currentTab:i})=>{const s=r.template??"carousel",l=Pb[s]||hc;return a.jsxs("div",{className:"ecr-admin-existing",children:[a.jsxs("div",{className:"ecr-admin-existing__header",children:[a.jsxs("div",{className:"ecr-admin-existing__title-wrapper",children:[a.jsx("p",{className:"ecr-admin-existing__title",children:"Attached videos"}),a.jsx("small",{className:"ecr-admin-existing__subtitle",children:"These reels will be shown in this reel widget"})]}),e&&a.jsx(jb,{gid:e})]}),a.jsx("div",{style:{"--thumbnail-size":`${r?.size}px`,"--thumbnail-size-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},className:"scrollbarThin ecr-admin-existing__body",children:i==="thumbnail"?a.jsx(l,{reels:t,styles:r,gid:e,togglingId:o,handleRemoveReel:n}):t.length>0?a.jsx(Ab,{reel:t[0],styles:r}):a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[a.jsx(ot,{style:{width:"40px",height:"40px",color:"#f59e0b"}}),"No reels available for preview."]})})]})},gc=()=>a.jsx("div",{className:"ecr-admin-reellist__loader",children:a.jsx("div",{className:"ecr-admin-reellist__spinner"})}),Rb=({gid:e,allReels:t,handleSelectReel:r,searchTerm:n,setSearchTerm:o,isSearching:i,togglingId:s,lastStoryElementRef:l})=>{const d=Ne(),{requestLeave:c}=pc(),u=`?view=${X.cr}&from=${X.mg}${e?`&gid=${e}`:""}`,p=t.filter(m=>!m?.files[0]?.mime_type.startsWith("image"));return a.jsxs("div",{className:"ecr-admin-reellist",children:[a.jsxs("div",{className:"ecr-admin-reellist__header",children:[a.jsx("p",{className:"ecr-admin-reellist__title",children:"All reels"}),a.jsx("small",{className:"ecr-admin-reellist__subtitle",children:"Choose reels to attach in this widget"})]}),a.jsxs("div",{className:"ecr-admin-reellist__body",children:[a.jsx(Lr,{to:u,text:"Add Reel",Icon:gt,className:"ecr-admin-reellist__add-button",textColor:"#2563eb",onNavigate:m=>c(()=>d(m))}),a.jsx("div",{className:"ecr-admin-reellist__search",children:a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:m=>o(m.target.value),className:"ecr-admin-reellist__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-reellist__grid",children:i&&t.length===0?a.jsx(gc,{}):a.jsxs("div",{className:"ecr-admin-reellist__items",children:[p.length===0?a.jsx("p",{className:"ecr-admin-reellist__empty",children:"No reels are available to add."}):p.map((m,g)=>a.jsx("div",{ref:p.length===g+1?l:null,className:"ecr-admin-reellist__item",children:a.jsxs("button",{title:"Click to add this reel",onClick:()=>r(m,"add"),disabled:s==m.story_uuid,className:"ecr-admin-reellist__card",children:[a.jsx("div",{className:"ecr-admin-reellist__media",children:a.jsx("video",{className:"ecr-admin-reellist__thumb",src:m?.files[0]?.url,poster:m?.thumbnail})}),a.jsx("span",{className:"ecr-admin-reellist__label",children:m.title||`Reel #${m.id}`}),s==m.story_uuid?a.jsx("div",{className:"ecr-admin-reellist__overlay",children:a.jsx(rt,{className:"ecr-admin-reellist__overlay-icon"})}):null]})},m.id)),i&&t.length>0&&a.jsx(gc,{})]})})]})]})};function xc(e){const t=e+"CollectionProvider",[r,n]=Ve(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=f=>{const{scope:h,children:v}=f,_=y.useRef(null),w=y.useRef(new Map).current;return a.jsx(o,{scope:h,itemMap:w,collectionRef:_,children:v})};s.displayName=t;const l=e+"CollectionSlot",d=nt(l),c=y.forwardRef((f,h)=>{const{scope:v,children:_}=f,w=i(l,v),j=J(h,w.collectionRef);return a.jsx(d,{ref:j,children:_})});c.displayName=l;const u=e+"CollectionItemSlot",p="data-radix-collection-item",m=nt(u),g=y.forwardRef((f,h)=>{const{scope:v,children:_,...w}=f,j=y.useRef(null),C=J(h,j),N=i(u,v);return y.useEffect(()=>(N.itemMap.set(j,{ref:j,...w}),()=>void N.itemMap.delete(j))),a.jsx(m,{[p]:"",ref:C,children:_})});g.displayName=u;function b(f){const h=i(e+"CollectionConsumer",f);return y.useCallback(()=>{const _=h.collectionRef.current;if(!_)return[];const w=Array.from(_.querySelectorAll(`[${p}]`));return Array.from(h.itemMap.values()).sort((N,k)=>w.indexOf(N.ref.current)-w.indexOf(k.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:s,Slot:c,ItemSlot:g},b,n]}var Lb=x.createContext(void 0);function ra(e){const t=x.useContext(Lb);return e||t||"ltr"}var na="rovingFocusGroup.onEntryFocus",Ib={bubbles:!1,cancelable:!0},gr="RovingFocusGroup",[oa,bc,zb]=xc(gr),[Mb,vc]=Ve(gr,[zb]),[Db,Fb]=Mb(gr),_c=x.forwardRef((e,t)=>a.jsx(oa.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(oa.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx($b,{...e,ref:t})})}));_c.displayName=gr;var $b=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:d,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...p}=e,m=x.useRef(null),g=J(t,m),b=ra(i),[f,h]=ct({prop:s,defaultProp:l??null,onChange:d,caller:gr}),[v,_]=x.useState(!1),w=We(c),j=bc(r),C=x.useRef(!1),[N,k]=x.useState(0);return x.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(na,w),()=>E.removeEventListener(na,w)},[w]),a.jsx(Db,{scope:r,orientation:n,dir:b,loop:o,currentTabStopId:f,onItemFocus:x.useCallback(E=>h(E),[h]),onItemShiftTab:x.useCallback(()=>_(!0),[]),onFocusableItemAdd:x.useCallback(()=>k(E=>E+1),[]),onFocusableItemRemove:x.useCallback(()=>k(E=>E-1),[]),children:a.jsx(W.div,{tabIndex:v||N===0?-1:0,"data-orientation":n,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:V(e.onMouseDown,()=>{C.current=!0}),onFocus:V(e.onFocus,E=>{const T=!C.current;if(E.target===E.currentTarget&&T&&!v){const A=new CustomEvent(na,Ib);if(E.currentTarget.dispatchEvent(A),!A.defaultPrevented){const O=j().filter(I=>I.focusable),R=O.find(I=>I.active),L=O.find(I=>I.id===f),M=[R,L,...O].filter(Boolean).map(I=>I.ref.current);jc(M,u)}}C.current=!1}),onBlur:V(e.onBlur,()=>_(!1))})})}),yc="RovingFocusGroupItem",wc=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:i,children:s,...l}=e,d=Ae(),c=i||d,u=Fb(yc,r),p=u.currentTabStopId===c,m=bc(r),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:f}=u;return x.useEffect(()=>{if(n)return g(),()=>b()},[n,g,b]),a.jsx(oa.ItemSlot,{scope:r,id:c,focusable:n,active:o,children:a.jsx(W.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:V(e.onMouseDown,h=>{n?u.onItemFocus(c):h.preventDefault()}),onFocus:V(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:V(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){u.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const v=Hb(h,u.orientation,u.dir);if(v!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let w=m().filter(j=>j.focusable).map(j=>j.ref.current);if(v==="last")w.reverse();else if(v==="prev"||v==="next"){v==="prev"&&w.reverse();const j=w.indexOf(h.currentTarget);w=u.loop?Vb(w,j+1):w.slice(j+1)}setTimeout(()=>jc(w))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:f!=null}):s})})});wc.displayName=yc;var Bb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ub(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Hb(e,t,r){const n=Ub(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Bb[n]}function jc(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function Vb(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Wb=_c,qb=wc,En="Tabs",[Gb]=Ve(En,[vc]),Sc=vc(),[Kb,aa]=Gb(En),Cc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:d="automatic",...c}=e,u=ra(l),[p,m]=ct({prop:n,onChange:o,defaultProp:i??"",caller:En});return a.jsx(Kb,{scope:r,baseId:Ae(),value:p,onValueChange:m,orientation:s,dir:u,activationMode:d,children:a.jsx(W.div,{dir:u,"data-orientation":s,...c,ref:t})})});Cc.displayName=En;var kc="TabsList",Nc=x.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,i=aa(kc,r),s=Sc(r);return a.jsx(Wb,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:n,children:a.jsx(W.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});Nc.displayName=kc;var Ec="TabsTrigger",Tc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...i}=e,s=aa(Ec,r),l=Sc(r),d=Oc(s.baseId,n),c=Rc(s.baseId,n),u=n===s.value;return a.jsx(qb,{asChild:!0,...l,focusable:!o,active:u,children:a.jsx(W.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:d,...i,ref:t,onMouseDown:V(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?s.onValueChange(n):p.preventDefault()}),onKeyDown:V(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&s.onValueChange(n)}),onFocus:V(e.onFocus,()=>{const p=s.activationMode!=="manual";!u&&!o&&p&&s.onValueChange(n)})})})});Tc.displayName=Ec;var Ac="TabsContent",Pc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:i,...s}=e,l=aa(Ac,r),d=Oc(l.baseId,n),c=Rc(l.baseId,n),u=n===l.value,p=x.useRef(u);return x.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(Ye,{present:o||u,children:({present:m})=>a.jsx(W.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":d,hidden:!m,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&i})})});Pc.displayName=Ac;function Oc(e,t){return`${e}-trigger-${t}`}function Rc(e,t){return`${e}-content-${t}`}var Yb=Cc,Xb=Nc,Jb=Tc,Zb=Pc;function Qb({className:e,...t}){return a.jsx(Yb,{"data-slot":"tabs",className:F("ecr-tabs",e),...t})}function ev({className:e,...t}){return a.jsx(Xb,{"data-slot":"tabs-list",className:F("ecr-tabs__list",e),...t})}function Lc({className:e,...t}){return a.jsx(Jb,{"data-slot":"tabs-trigger",className:F("ecr-tabs__trigger",e),...t})}function Ic({className:e,...t}){return a.jsx(Zb,{"data-slot":"tabs-content",className:F("ecr-tabs__content",e),...t})}const xr=({label:e,text:t})=>a.jsxs(Rt,{children:[a.jsx(Lt,{style:{textAlign:"left",padding:0,backgroundColor:"transparent"},children:a.jsxs("label",{className:"ecr-admin-switch",children:[a.jsxs("span",{className:"ecr-admin-switch__label",children:[e,": ",a.jsx(Jt,{size:20})]}),a.jsx(K0,{className:"ecr-admin-switch__icon",size:24})]})}),a.jsx(It,{className:"ecr-admin-popover",children:a.jsx(pr,{name:e,text:t})})]});function zc(e,[t,r]){return Math.min(r,Math.max(t,e))}function tv(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Mc=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),rv="VisuallyHidden",nv=x.forwardRef((e,t)=>a.jsx(W.span,{...e,ref:t,style:{...Mc,...e.style}}));nv.displayName=rv;var ov=[" ","Enter","ArrowUp","ArrowDown"],av=[" ","Enter"],ut="Select",[Tn,An,iv]=xc(ut),[$t]=Ve(ut,[iv,an]),Pn=an(),[sv,Ze]=$t(ut),[lv,cv]=$t(ut),Dc=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:l,onValueChange:d,dir:c,name:u,autoComplete:p,disabled:m,required:g,form:b}=e,f=Pn(t),[h,v]=x.useState(null),[_,w]=x.useState(null),[j,C]=x.useState(!1),N=ra(c),[k,E]=ct({prop:n,defaultProp:o??!1,onChange:i,caller:ut}),[T,A]=ct({prop:s,defaultProp:l,onChange:d,caller:ut}),O=x.useRef(null),R=h?b||!!h.closest("form"):!0,[L,P]=x.useState(new Set),M=Array.from(L).map(I=>I.props.value).join(";");return a.jsx(Gs,{...f,children:a.jsxs(sv,{required:g,scope:t,trigger:h,onTriggerChange:v,valueNode:_,onValueNodeChange:w,valueNodeHasChildren:j,onValueNodeHasChildrenChange:C,contentId:Ae(),value:T,onValueChange:A,open:k,onOpenChange:E,dir:N,triggerPointerDownPosRef:O,disabled:m,children:[a.jsx(Tn.Provider,{scope:t,children:a.jsx(lv,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(I=>{P(B=>new Set(B).add(I))},[]),onNativeOptionRemove:x.useCallback(I=>{P(B=>{const z=new Set(B);return z.delete(I),z})},[]),children:r})}),R?a.jsxs(id,{"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:p,value:T,onChange:I=>A(I.target.value),disabled:m,form:b,children:[T===void 0?a.jsx("option",{value:""}):null,Array.from(L)]},M):null]})})};Dc.displayName=ut;var Fc="SelectTrigger",$c=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=Pn(r),s=Ze(Fc,r),l=s.disabled||n,d=J(t,s.onTriggerChange),c=An(r),u=x.useRef("touch"),[p,m,g]=ld(f=>{const h=c().filter(w=>!w.disabled),v=h.find(w=>w.value===s.value),_=cd(h,f,v);_!==void 0&&s.onValueChange(_.value)}),b=f=>{l||(s.onOpenChange(!0),g()),f&&(s.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return a.jsx(Ro,{asChild:!0,...i,children:a.jsx(W.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":sd(s.value)?"":void 0,...o,ref:d,onClick:V(o.onClick,f=>{f.currentTarget.focus(),u.current!=="mouse"&&b(f)}),onPointerDown:V(o.onPointerDown,f=>{u.current=f.pointerType;const h=f.target;h.hasPointerCapture(f.pointerId)&&h.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&f.pointerType==="mouse"&&(b(f),f.preventDefault())}),onKeyDown:V(o.onKeyDown,f=>{const h=p.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&m(f.key),!(h&&f.key===" ")&&ov.includes(f.key)&&(b(),f.preventDefault())})})})});$c.displayName=Fc;var Bc="SelectValue",Uc=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...l}=e,d=Ze(Bc,r),{onValueNodeHasChildrenChange:c}=d,u=i!==void 0,p=J(t,d.onValueNodeChange);return le(()=>{c(u)},[c,u]),a.jsx(W.span,{...l,ref:p,style:{pointerEvents:"none"},children:sd(d.value)?a.jsx(a.Fragment,{children:s}):i})});Uc.displayName=Bc;var dv="SelectIcon",Hc=x.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return a.jsx(W.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Hc.displayName=dv;var uv="SelectPortal",Vc=e=>a.jsx(sn,{asChild:!0,...e});Vc.displayName=uv;var pt="SelectContent",Wc=x.forwardRef((e,t)=>{const r=Ze(pt,e.__scopeSelect),[n,o]=x.useState();if(le(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?vr.createPortal(a.jsx(qc,{scope:e.__scopeSelect,children:a.jsx(Tn.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(Gc,{...e,ref:t})});Wc.displayName=pt;var ke=10,[qc,Qe]=$t(pt),pv="SelectContentImpl",mv=nt("SelectContent.RemoveScroll"),Gc=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:d,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h,...v}=e,_=Ze(pt,r),[w,j]=x.useState(null),[C,N]=x.useState(null),k=J(t,$=>j($)),[E,T]=x.useState(null),[A,O]=x.useState(null),R=An(r),[L,P]=x.useState(!1),M=x.useRef(!1);x.useEffect(()=>{if(w)return Io(w)},[w]),xo();const I=x.useCallback($=>{const[Y,...oe]=R().map(re=>re.ref.current),[Z]=oe.slice(-1),Q=document.activeElement;for(const re of $)if(re===Q||(re?.scrollIntoView({block:"nearest"}),re===Y&&C&&(C.scrollTop=0),re===Z&&C&&(C.scrollTop=C.scrollHeight),re?.focus(),document.activeElement!==Q))return},[R,C]),B=x.useCallback(()=>I([E,w]),[I,E,w]);x.useEffect(()=>{L&&B()},[L,B]);const{onOpenChange:z,triggerPointerDownPosRef:q}=_;x.useEffect(()=>{if(w){let $={x:0,y:0};const Y=Z=>{$={x:Math.abs(Math.round(Z.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(Z.pageY)-(q.current?.y??0))}},oe=Z=>{$.x<=10&&$.y<=10?Z.preventDefault():w.contains(Z.target)||z(!1),document.removeEventListener("pointermove",Y),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",Y),document.addEventListener("pointerup",oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",oe,{capture:!0})}}},[w,z,q]),x.useEffect(()=>{const $=()=>z(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[z]);const[ae,ie]=ld($=>{const Y=R().filter(Q=>!Q.disabled),oe=Y.find(Q=>Q.ref.current===document.activeElement),Z=cd(Y,$,oe);Z&&setTimeout(()=>Z.ref.current.focus())}),ge=x.useCallback(($,Y,oe)=>{const Z=!M.current&&!oe;(_.value!==void 0&&_.value===Y||Z)&&(T($),Z&&(M.current=!0))},[_.value]),ve=x.useCallback(()=>w?.focus(),[w]),pe=x.useCallback(($,Y,oe)=>{const Z=!M.current&&!oe;(_.value!==void 0&&_.value===Y||Z)&&O($)},[_.value]),G=n==="popper"?ia:Kc,ce=G===ia?{side:l,sideOffset:d,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h}:{};return a.jsx(qc,{scope:r,content:w,viewport:C,onViewportChange:N,itemRefCallback:ge,selectedItem:E,onItemLeave:ve,itemTextRefCallback:pe,focusSelectedItem:B,selectedItemText:A,position:n,isPositioned:L,searchRef:ae,children:a.jsx(gn,{as:mv,allowPinchZoom:!0,children:a.jsx(Kr,{asChild:!0,trapped:_.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:V(o,$=>{_.trigger?.focus({preventScroll:!0}),$.preventDefault()}),children:a.jsx(Gr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:a.jsx(G,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:$=>$.preventDefault(),...v,...ce,onPlaced:()=>P(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:V(v.onKeyDown,$=>{const Y=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!Y&&$.key.length===1&&ie($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let Z=R().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes($.key)&&(Z=Z.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const Q=$.target,re=Z.indexOf(Q);Z=Z.slice(re+1)}setTimeout(()=>I(Z)),$.preventDefault()}})})})})})})});Gc.displayName=pv;var fv="SelectItemAlignedPosition",Kc=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=Ze(pt,r),s=Qe(pt,r),[l,d]=x.useState(null),[c,u]=x.useState(null),p=J(t,k=>u(k)),m=An(r),g=x.useRef(!1),b=x.useRef(!0),{viewport:f,selectedItem:h,selectedItemText:v,focusSelectedItem:_}=s,w=x.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&c&&f&&h&&v){const k=i.trigger.getBoundingClientRect(),E=c.getBoundingClientRect(),T=i.valueNode.getBoundingClientRect(),A=v.getBoundingClientRect();if(i.dir!=="rtl"){const Q=A.left-E.left,re=T.left-Q,_e=k.left-re,mt=k.width+_e,ga=Math.max(mt,E.width),xa=window.innerWidth-ke,ba=zc(re,[ke,Math.max(ke,xa-ga)]);l.style.minWidth=mt+"px",l.style.left=ba+"px"}else{const Q=E.right-A.right,re=window.innerWidth-T.right-Q,_e=window.innerWidth-k.right-re,mt=k.width+_e,ga=Math.max(mt,E.width),xa=window.innerWidth-ke,ba=zc(re,[ke,Math.max(ke,xa-ga)]);l.style.minWidth=mt+"px",l.style.right=ba+"px"}const O=m(),R=window.innerHeight-ke*2,L=f.scrollHeight,P=window.getComputedStyle(c),M=parseInt(P.borderTopWidth,10),I=parseInt(P.paddingTop,10),B=parseInt(P.borderBottomWidth,10),z=parseInt(P.paddingBottom,10),q=M+I+L+z+B,ae=Math.min(h.offsetHeight*5,q),ie=window.getComputedStyle(f),ge=parseInt(ie.paddingTop,10),ve=parseInt(ie.paddingBottom,10),pe=k.top+k.height/2-ke,G=R-pe,ce=h.offsetHeight/2,$=h.offsetTop+ce,Y=M+I+$,oe=q-Y;if(Y<=pe){const Q=O.length>0&&h===O[O.length-1].ref.current;l.style.bottom="0px";const re=c.clientHeight-f.offsetTop-f.offsetHeight,_e=Math.max(G,ce+(Q?ve:0)+re+B),mt=Y+_e;l.style.height=mt+"px"}else{const Q=O.length>0&&h===O[0].ref.current;l.style.top="0px";const _e=Math.max(pe,M+f.offsetTop+(Q?ge:0)+ce)+oe;l.style.height=_e+"px",f.scrollTop=Y-pe+f.offsetTop}l.style.margin=`${ke}px 0`,l.style.minHeight=ae+"px",l.style.maxHeight=R+"px",n?.(),requestAnimationFrame(()=>g.current=!0)}},[m,i.trigger,i.valueNode,l,c,f,h,v,i.dir,n]);le(()=>w(),[w]);const[j,C]=x.useState();le(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const N=x.useCallback(k=>{k&&b.current===!0&&(w(),_?.(),b.current=!1)},[w,_]);return a.jsx(gv,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:N,children:a.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:a.jsx(W.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Kc.displayName=fv;var hv="SelectPopperPosition",ia=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=ke,...i}=e,s=Pn(r);return a.jsx(Ks,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ia.displayName=hv;var[gv,sa]=$t(pt,{}),la="SelectViewport",Yc=x.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=Qe(la,r),s=sa(la,r),l=J(t,i.onViewportChange),d=x.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),a.jsx(Tn.Slot,{scope:r,children:a.jsx(W.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:V(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=s;if(m?.current&&p){const g=Math.abs(d.current-u.scrollTop);if(g>0){const b=window.innerHeight-ke*2,f=parseFloat(p.style.minHeight),h=parseFloat(p.style.height),v=Math.max(f,h);if(v<b){const _=v+g,w=Math.min(b,_),j=_-w;p.style.height=w+"px",p.style.bottom==="0px"&&(u.scrollTop=j>0?j:0,p.style.justifyContent="flex-end")}}}d.current=u.scrollTop})})})]})});Yc.displayName=la;var Xc="SelectGroup",[xv,bv]=$t(Xc),vv=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ae();return a.jsx(xv,{scope:r,id:o,children:a.jsx(W.div,{role:"group","aria-labelledby":o,...n,ref:t})})});vv.displayName=Xc;var Jc="SelectLabel",_v=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=bv(Jc,r);return a.jsx(W.div,{id:o.id,...n,ref:t})});_v.displayName=Jc;var On="SelectItem",[yv,Zc]=$t(On),Qc=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,l=Ze(On,r),d=Qe(On,r),c=l.value===n,[u,p]=x.useState(i??""),[m,g]=x.useState(!1),b=J(t,_=>d.itemRefCallback?.(_,n,o)),f=Ae(),h=x.useRef("touch"),v=()=>{o||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(yv,{scope:r,value:n,disabled:o,textId:f,isSelected:c,onItemTextChange:x.useCallback(_=>{p(w=>w||(_?.textContent??"").trim())},[]),children:a.jsx(Tn.ItemSlot,{scope:r,value:n,disabled:o,textValue:u,children:a.jsx(W.div,{role:"option","aria-labelledby":f,"data-highlighted":m?"":void 0,"aria-selected":c&&m,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:b,onFocus:V(s.onFocus,()=>g(!0)),onBlur:V(s.onBlur,()=>g(!1)),onClick:V(s.onClick,()=>{h.current!=="mouse"&&v()}),onPointerUp:V(s.onPointerUp,()=>{h.current==="mouse"&&v()}),onPointerDown:V(s.onPointerDown,_=>{h.current=_.pointerType}),onPointerMove:V(s.onPointerMove,_=>{h.current=_.pointerType,o?d.onItemLeave?.():h.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:V(s.onPointerLeave,_=>{_.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:V(s.onKeyDown,_=>{d.searchRef?.current!==""&&_.key===" "||(av.includes(_.key)&&v(),_.key===" "&&_.preventDefault())})})})})});Qc.displayName=On;var br="SelectItemText",ed=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=Ze(br,r),l=Qe(br,r),d=Zc(br,r),c=cv(br,r),[u,p]=x.useState(null),m=J(t,v=>p(v),d.onItemTextChange,v=>l.itemTextRefCallback?.(v,d.value,d.disabled)),g=u?.textContent,b=x.useMemo(()=>a.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:f,onNativeOptionRemove:h}=c;return le(()=>(f(b),()=>h(b)),[f,h,b]),a.jsxs(a.Fragment,{children:[a.jsx(W.span,{id:d.textId,...i,ref:m}),d.isSelected&&s.valueNode&&!s.valueNodeHasChildren?vr.createPortal(i.children,s.valueNode):null]})});ed.displayName=br;var td="SelectItemIndicator",rd=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Zc(td,r).isSelected?a.jsx(W.span,{"aria-hidden":!0,...n,ref:t}):null});rd.displayName=td;var ca="SelectScrollUpButton",nd=x.forwardRef((e,t)=>{const r=Qe(ca,e.__scopeSelect),n=sa(ca,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return le(()=>{if(r.viewport&&r.isPositioned){let l=function(){const c=d.scrollTop>0;i(c)};const d=r.viewport;return l(),d.addEventListener("scroll",l),()=>d.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:d}=r;l&&d&&(l.scrollTop=l.scrollTop-d.offsetHeight)}}):null});nd.displayName=ca;var da="SelectScrollDownButton",od=x.forwardRef((e,t)=>{const r=Qe(da,e.__scopeSelect),n=sa(da,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return le(()=>{if(r.viewport&&r.isPositioned){let l=function(){const c=d.scrollHeight-d.clientHeight,u=Math.ceil(d.scrollTop)<c;i(u)};const d=r.viewport;return l(),d.addEventListener("scroll",l),()=>d.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:d}=r;l&&d&&(l.scrollTop=l.scrollTop+d.offsetHeight)}}):null});od.displayName=da;var ad=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=Qe("SelectScrollButton",r),s=x.useRef(null),l=An(r),d=x.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return x.useEffect(()=>()=>d(),[d]),le(()=>{l().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),a.jsx(W.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:V(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:V(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:V(o.onPointerLeave,()=>{d()})})}),wv="SelectSeparator",jv=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(W.div,{"aria-hidden":!0,...n,ref:t})});jv.displayName=wv;var ua="SelectArrow",Sv=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Pn(r),i=Ze(ua,r),s=Qe(ua,r);return i.open&&s.position==="popper"?a.jsx(Ys,{...o,...n,ref:t}):null});Sv.displayName=ua;var Cv="SelectBubbleInput",id=x.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=x.useRef(null),i=J(n,o),s=tv(t);return x.useEffect(()=>{const l=o.current;if(!l)return;const d=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(d,"value").set;if(s!==t&&u){const p=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(p)}},[s,t]),a.jsx(W.select,{...r,style:{...Mc,...r.style},ref:i,defaultValue:t})});id.displayName=Cv;function sd(e){return e===""||e===void 0}function ld(e){const t=We(e),r=x.useRef(""),n=x.useRef(0),o=x.useCallback(s=>{const l=r.current+s;t(l),(function d(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>d(""),1e3))})(l)},[t]),i=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function cd(e,t,r){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=kv(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==r));const d=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return d!==r?d:void 0}function kv(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Nv=Dc,Ev=$c,Tv=Uc,Av=Hc,Pv=Vc,Ov=Wc,Rv=Yc,Lv=Qc,Iv=ed,zv=rd,Mv=nd,Dv=od;function Bt({...e}){return a.jsx(Nv,{"data-slot":"select",...e})}function Ut({...e}){return a.jsx(Tv,{"data-slot":"select-value",...e})}function Ht({className:e,size:t="default",children:r,...n}){return a.jsxs(Ev,{"data-slot":"select-trigger","data-size":t,className:F("ecr-select__trigger",e),...n,children:[r,a.jsx(Av,{asChild:!0,children:a.jsx(fo,{className:"ecr-select__icon"})})]})}function Vt({className:e,children:t,position:r="popper",align:n="center",...o}){const i=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(Pv,{container:i,children:a.jsxs(Ov,{"data-slot":"select-content",className:F("ecr-select__content",e),position:r,align:n,...o,children:[a.jsx(Fv,{}),a.jsx(Rv,{className:F("ecr-select__viewport"),children:t}),a.jsx($v,{})]})})}function Wt({className:e,children:t,...r}){return a.jsxs(Lv,{"data-slot":"select-item",className:F("ecr-select__item",e),...r,children:[a.jsx("span",{className:"ecr-select__check",children:a.jsx(zv,{children:a.jsx(Mf,{className:"ecr-select__check-icon"})})}),a.jsx(Iv,{children:t})]})}function Fv({className:e,...t}){return a.jsx(Mv,{"data-slot":"select-scroll-up-button",className:F("ecr-select__scroll-button",e),...t,children:a.jsx(Df,{className:"ecr-select__icon"})})}function $v({className:e,...t}){return a.jsx(Dv,{"data-slot":"select-scroll-down-button",className:F("ecr-select__scroll-button",e),...t,children:a.jsx(fo,{className:"ecr-select__icon"})})}const Bv=({appearance:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(Bt,{value:e,onValueChange:t,children:[a.jsx(Ht,{className:"ecr-admin-control__trigger",children:a.jsx(Ut,{placeholder:"Layout"})}),a.jsx(Vt,{children:Ku.map(r=>a.jsx(Wt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),Uv={vertical:a.jsx(a.Fragment,{children:"Offer a mobile-first experience with vertical scroll Reels in your widget for better engagement and infinite scrolling!"})};function Hv(){return a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Slide Direction:"}),a.jsxs(Bt,{defaultValue:Za[0].value,children:[a.jsx(Ht,{className:"ecr-admin-control__trigger",children:a.jsx(Ut,{placeholder:"Layout"})}),a.jsxs(Vt,{children:[Za.map(e=>a.jsx(Wt,{value:e.value,className:"ecr-admin-control__option",children:e.label},e.value)),qu.map(e=>a.jsx("div",{children:a.jsxs(Rt,{modal:!0,children:[a.jsxs(Lt,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:e.label}),a.jsx(Jt,{size:18})]}),a.jsx(It,{className:"ecr-admin-control__popover",children:a.jsx(pr,{name:e.label,text:Uv[e.value]})})]})},e.value))]})]})]})}const Vv=({styles:e,updateStyles:t})=>a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(xr,{label:"Disable Preview",text:a.jsx(a.Fragment,{children:"Turn off previews for a cleaner look and a more focused browsing experience!"})}),a.jsx(Hv,{}),a.jsx(Bv,{appearance:e?.playerAppearance??"overlay",handleLinkLayout:r=>t(n=>({...n,playerAppearance:r}))})]});var Rn="Collapsible",[Wv]=Ve(Rn),[qv,pa]=Wv(Rn),dd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:i,onOpenChange:s,...l}=e,[d,c]=ct({prop:n,defaultProp:o??!1,onChange:s,caller:Rn});return a.jsx(qv,{scope:r,disabled:i,contentId:Ae(),open:d,onOpenToggle:x.useCallback(()=>c(u=>!u),[c]),children:a.jsx(W.div,{"data-state":fa(d),"data-disabled":i?"":void 0,...l,ref:t})})});dd.displayName=Rn;var ud="CollapsibleTrigger",pd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=pa(ud,r);return a.jsx(W.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":fa(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:V(e.onClick,o.onOpenToggle)})});pd.displayName=ud;var ma="CollapsibleContent",md=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=pa(ma,e.__scopeCollapsible);return a.jsx(Ye,{present:r||o.open,children:({present:i})=>a.jsx(Gv,{...n,ref:t,present:i})})});md.displayName=ma;var Gv=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...i}=e,s=pa(ma,r),[l,d]=x.useState(n),c=x.useRef(null),u=J(t,c),p=x.useRef(0),m=p.current,g=x.useRef(0),b=g.current,f=s.open||l,h=x.useRef(f),v=x.useRef(void 0);return x.useEffect(()=>{const _=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(_)},[]),le(()=>{const _=c.current;if(_){v.current=v.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const w=_.getBoundingClientRect();p.current=w.height,g.current=w.width,h.current||(_.style.transitionDuration=v.current.transitionDuration,_.style.animationName=v.current.animationName),d(n)}},[s.open,n]),a.jsx(W.div,{"data-state":fa(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!f,...i,ref:u,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:f&&o})});function fa(e){return e?"open":"closed"}var Kv=dd,Yv=pd,Xv=md;function fd({className:e,...t}){return a.jsx(Kv,{"data-slot":"collapsible",className:F("ecr-collapsible",e),...t})}function hd({className:e,children:t,...r}){return a.jsxs(Yv,{"data-slot":"collapsible-trigger",className:F("ecr-collapsible__trigger",e),...r,children:[a.jsx("span",{className:"ecr-collapsible__trigger-label",children:t}),a.jsx(fo,{className:"ecr-collapsible__trigger-icon"})]})}function gd({className:e,...t}){return a.jsx(Xv,{"data-slot":"collapsible-content",className:F("ecr-collapsible__content",e),...t})}const Jv=({linkLayout:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(Bt,{value:e,onValueChange:t,children:[a.jsx(Ht,{className:"ecr-admin-control__trigger",children:a.jsx(Ut,{placeholder:"Layout"})}),a.jsx(Vt,{children:Gu.map(r=>a.jsx(Wt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),Zv=[{Icon:Vf,value:"desktop"},{Icon:qf,value:"mobile"}],xd=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:d,device:c,setDevice:u})=>{const[p,m]=y.useState(n),g=y.useRef(null);y.useEffect(()=>{m(n)},[n]);const b=h=>{const v=Math.min(r,Math.max(t,Number(h)));o(v)},f=h=>{const v=Number(h);m(v),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{b(v>r?r:v<t?t:v)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":",a.jsxs(Bt,{value:c,onValueChange:u,children:[a.jsx(Ht,{style:{padding:"4px 4px 0px",height:"24px",gap:"4px"},children:a.jsx(Ut,{})}),a.jsx(Vt,{style:{minWidth:"60px"},children:Zv.map(h=>a.jsx(Wt,{value:h.value,children:a.jsx(h.Icon,{size:16})},h.value))})]})]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!d&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:h=>{const v=Number(h.target.value);m(v),b(v)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(Jo,{type:"number",min:t,max:r,value:p,onChange:h=>f(h.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})},Qv=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("desktop");return a.jsx(xd,{label:"Gap",min:0,max:80,value:(r==="mobile"?e?.gapOnMobile:e?.gap)??16,onChange:r==="mobile"?o=>t(i=>({...i,gapOnMobile:o})):o=>t(i=>({...i,gap:o})),name:"column_gap",id:"column-gap",device:r,setDevice:n})},e_=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("desktop");return a.jsx(xd,{label:"Size",min:150,max:400,value:(r==="mobile"?e?.sizeOnMobile:e?.size)??150,onChange:r==="mobile"?o=>t(i=>({...i,sizeOnMobile:o})):o=>t(i=>({...i,size:o})),name:"size",id:"size",device:r,setDevice:n})},t_=[{value:"rectangle",label:"Rectangle"},{value:"circle",label:"Circle"}],r_=({selectedShape:e,handleShape:t})=>{const r=n=>{t(n.target.id)};return a.jsxs("div",{className:"ecr-admin-control",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Shape:"}),a.jsx("div",{className:"ecr-admin-control__row",children:t_.map(n=>a.jsxs("div",{className:"ecr-admin-control__choice",children:[a.jsx("input",{type:"radio",name:"shape",id:n.value,checked:e===n.value,onChange:r,style:{display:"none"}}),a.jsxs("label",{className:"ecr-admin-control__choice-label",htmlFor:n.value,children:[e===n.value?a.jsx(qp,{color:"#2563eb",size:16}):a.jsx(Gp,{color:"#8c95a9",size:16}),n.label]})]},n.value))})]})},n_=Object.values(Ja),o_={marquee:a.jsx(a.Fragment,{children:"Create infinite, auto-scrolling video playlists with the Marquee layout template for endless engagement!"}),stacked:a.jsx(a.Fragment,{children:"Display Reels in a stacked layout for an interactive and shopable video experience!"})},a_=({selectedLayout:e,handleLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Template:"}),a.jsxs(Bt,{value:e,onValueChange:t,children:[a.jsx(Ht,{className:"ecr-admin-control__trigger",children:a.jsx(Ut,{placeholder:"Layout"})}),a.jsxs(Vt,{children:[n_.map(r=>a.jsx(Wt,{value:r,className:"ecr-admin-control__option",children:r},r)),Vu.map(r=>a.jsx("div",{children:a.jsxs(Rt,{modal:!0,children:[a.jsxs(Lt,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r}),a.jsx(Jt,{size:18})]}),a.jsx(It,{className:"ecr-admin-control__popover",children:a.jsx(pr,{name:r,text:o_[r]})})]})},r))]})]})]}),i_=({isLayoutOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(fd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(hd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("layout"),children:[a.jsx(Bf,{size:16})," ",a.jsx("span",{children:"Layout"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(r_,{selectedShape:r?.shape,handleShape:o=>n(i=>({...i,shape:o}))}),a.jsx(a_,{selectedLayout:r?.template??"carousel",handleLayout:o=>n(i=>({...i,template:o}))}),a.jsx(Jv,{linkLayout:r?.appearance??"overlay",handleLinkLayout:o=>n(i=>({...i,appearance:o}))}),a.jsx(e_,{styles:r,updateStyles:n}),a.jsx(Qv,{styles:r,updateStyles:n}),a.jsx(xr,{label:"Show Views",text:a.jsx(a.Fragment,{children:"Hide view counts to remove distractions and provide a cleaner, more focused visual experience!"})}),a.jsx(xr,{label:"Autoplay",text:a.jsx(a.Fragment,{children:"Enable autoplay for videos on your product and pages, capturing users' attention instantly!"})}),a.jsx(xr,{label:"Show Add to Cart",text:a.jsx(a.Fragment,{children:"Show a clear “Add to Cart” button on your tagged product to encourage quick purchases and boost conversions."})}),a.jsx(xr,{label:"Drag to Sort",text:a.jsx(a.Fragment,{children:"Easily rearrange your best-performing Reels to keep your content fresh and in the right order!"})})]})]}),s_=({hoverEffect:e,handleHoverEffect:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Hove Effect:"}),a.jsxs(Bt,{value:e,onValueChange:t,children:[a.jsx(Ht,{className:"ecr-admin-control__trigger",children:a.jsx(Ut,{placeholder:"Layout"})}),a.jsx(Vt,{children:Wu.map(r=>a.jsx(Wt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),l_=({isStyleOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(fd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(hd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("style"),children:[a.jsx(Wf,{size:16}),a.jsx("span",{children:"Styles"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(Zo,{label:"Border Width",min:0,max:12,value:r?.border?.border_width??0,onChange:o=>n(i=>({...i,border:{...i.border,border_width:o}})),name:"border_width",id:"border-width"}),a.jsx(dc,{selectedColor:r?.border?.border_color,handleColor:o=>n(i=>({...i,border:{...i.border,border_color:o}})),text:"Border Color"}),r?.shape==="rectangle"&&a.jsx(Zo,{label:"Border Radius",min:0,max:99,value:r?.border?.border_radius??0,onChange:o=>n(i=>({...i,border:{...i.border,border_radius:o}})),name:"border_radius",id:"border-radius"}),a.jsx(s_,{hoverEffect:r?.hoverEffect||"none",handleHoverEffect:o=>n(i=>({...i,hoverEffect:o}))})]})]}),c_=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("layout"),o=r==="layout",i=r==="style",s=l=>{n(r!==l?l:null)};return a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(i_,{handleSectionOpen:s,isLayoutOpen:o,styles:e,updateStyles:t}),a.jsx(l_,{isStyleOpen:i,handleSectionOpen:s,styles:e,updateStyles:t})]})},d_=({styles:e,setStyles:t,isExpanded:r,setIsExpanded:n,setIsEdited:o,tabs:i,currentTab:s,setCurrentTab:l})=>{const d=u=>{t(p=>{const m=u(p);return o(!0),m})},c=u=>{(u===i.thumbnail||u===i.preview)&&l(u)};return a.jsxs("div",{className:F("ecr-admin-sidepanel",r?"ecr-admin-sidepanel--expanded":"ecr-admin-sidepanel--collapsed"),children:[r&&a.jsx("div",{className:"ecr-admin-mobile-overlay",onClick:()=>n(!1)}),a.jsxs("div",{className:"ecr-admin-sidepanel-content",children:[a.jsxs("div",{className:"ecr-admin-sidepanel__header",children:[a.jsx("p",{className:"ecr-admin-sidepanel__title",children:"Customization"}),a.jsx("small",{className:"ecr-admin-sidepanel__subtitle",children:"Customize your widget however you like"})]}),a.jsx("div",{className:"ecr-admin-sidepanel__body",children:a.jsxs(Qb,{value:s,onValueChange:c,className:"ecr-admin-sidepanel__tabs",children:[a.jsxs(ev,{className:"ecr-admin-sidepanel__tabs-list",children:[a.jsx(Lc,{value:i.thumbnail,children:"Thumbnail"}),a.jsx(Lc,{value:i.preview,children:"Preview"})]}),a.jsx(Ic,{value:i.thumbnail,children:a.jsx(c_,{styles:e,updateStyles:d})}),a.jsx(Ic,{value:i.preview,children:a.jsx(Vv,{styles:e,updateStyles:d})})]})})]})]})},u_=e=>{const t=Ne(),[r,n]=y.useState(""),[o,i]=y.useState([]),[s,l]=y.useState(tt),[d,c]=y.useState(!0),[u,p]=y.useState(!1),[m,g]=y.useState(!1);y.useEffect(()=>{(async()=>{if(!e){c(!1);return}c(!0);try{const _=(await he.get(`stories/${e}`)).data;n(_.group_name),i(_.stories),l(_.styles??tt)}catch(v){v instanceof Error?K.error(v.message):K.error("Something went wrong. Try again later!")}finally{c(!1)}})()},[e]);const b=async h=>{const v=o.map(j=>j.id),_={group_name:r,styles:s,story_ids:v};e&&(_.group_id=e);const w=await he.post("stories/manage-group-stories",_);if(!e){const j=w.data.group_id;t(`?view=${X.mg}&gid=${j}`,{replace:!0})}return{...w.data,isNewGroup:!e}};return{groupTitle:r,setGroupTitle:n,thisGroupReels:o,setThisGroupReels:i,styles:s,setStyles:l,isLoading:d,isSaving:u,isEdited:m,setIsEdited:g,handleSave:async()=>{try{p(!0);const h=await b();return g(!1),K.success("Changes saved successfully!"),h}catch(h){return h instanceof Error?K.error(h.message):K.error("Something went wrong. Try again later!"),null}finally{p(!1)}}}},p_=e=>{const[t,r]=y.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return y.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia(e),o=i=>{r(i.matches)};return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[e]),t},m_=e=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useRef(null),i=y.useRef(!1),s=y.useRef(typeof window<"u"?window.location.hash:"");return y.useEffect(()=>{e||(n.current=null,o.current=null,r(!1))},[e]),y.useEffect(()=>{if(!e)return;const p=m=>{m.preventDefault(),m.returnValue=""};return window.addEventListener("beforeunload",p),()=>window.removeEventListener("beforeunload",p)},[e]),y.useEffect(()=>{const p=()=>{const m=window.location.hash;if(!e){s.current=m;return}if(i.current){i.current=!1,s.current=m;return}m!==s.current&&(o.current=m,window.location.hash=s.current,r(!0))};return window.addEventListener("hashchange",p),()=>window.removeEventListener("hashchange",p)},[e]),{showLeaveModal:t,requestLeave:p=>{if(!e){p();return}n.current=p,r(!0)},confirmLeave:()=>{if(r(!1),n.current){const p=n.current;n.current=null,i.current=!0,p();return}if(o.current){const p=o.current;o.current=null,i.current=!0,window.location.hash=p}},cancelLeave:()=>{n.current=null,o.current=null,r(!1)},allowNextNavigation:p=>{i.current=!0,p()}}},bd={thumbnail:"thumbnail",preview:"preview"},f_=()=>{const e=Ne(),[t]=Yt(),r=t.get("gid"),n=p_("(min-width: 1024px)"),{groupTitle:o,setGroupTitle:i,thisGroupReels:s,setThisGroupReels:l,styles:d,setStyles:c,isLoading:u,isSaving:p,isEdited:m,setIsEdited:g,handleSave:b}=u_(r),{allReels:f,searchTerm:h,setSearchTerm:v,isSearching:_,lastStoryElementRef:w,refreshReels:j}=Zi(r),[C,N]=y.useState(""),[k,E]=y.useState(n),[T,A]=y.useState(bd.thumbnail),[O,R]=y.useState([]),L=y.useMemo(()=>new Set(s.map(G=>G.story_uuid)),[s]),P=y.useMemo(()=>h.trim().toLowerCase(),[h]),M=y.useMemo(()=>P?O.filter(G=>G.title.toLowerCase().includes(P)):O,[O,P]),I=y.useMemo(()=>{const G=new Map;for(const ce of M)G.set(ce.story_uuid,ce);for(const ce of f)G.has(ce.story_uuid)||G.set(ce.story_uuid,ce);return Array.from(G.values())},[M,f]),B=y.useMemo(()=>I.filter(G=>!L.has(G.story_uuid)),[I,L]);y.useEffect(()=>{E(n)},[n]),y.useEffect(()=>{R([])},[r]);const{showLeaveModal:z,requestLeave:q,confirmLeave:ae,cancelLeave:ie,allowNextNavigation:ge}=m_(m),ve=async(G,ce)=>{try{N(G.story_uuid);const $=ce==="add"?[G,...s]:s.filter(Y=>Y.story_uuid!==G.story_uuid);l($),R(ce==="add"?Y=>Y.filter(oe=>oe.story_uuid!==G.story_uuid):Y=>Y.some(oe=>oe.story_uuid===G.story_uuid)?Y:[G,...Y]),g(!0)}catch($){$ instanceof Error?K.error($.message):K.error("Something went wrong. Please try again later!")}finally{N("")}},pe=async()=>{const G=await b();G&&(R([]),j()),G?.isNewGroup&&ge(()=>{e(`?view=${X.mg}&gid=${G.group_id}`,{replace:!0})})};return u?a.jsx(Ir,{}):a.jsxs(Sb,{value:{requestLeave:q},children:[a.jsx(vt,{left:[a.jsx(_t,{name:"Manage Widget",Icon:Or},"page"),a.jsx(tr,{cb:()=>q(()=>e(`?view=${X.ag}`))},"back")],center:[a.jsxs("div",{className:"ecr-admin-group-title__wrapper",children:[a.jsx(Qi,{placeholder:"Enter group title",title:o,setTitle:i,setIsEdited:g,style:{paddingInline:"32px"}}),o&&a.jsxs(Vo,{children:[a.jsx(Wo,{className:"ecr-admin-group-title-customization__trigger",children:a.jsx(X0,{})}),a.jsxs(qo,{className:"ecr-admin-group-title-customization-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Customize title appearance"})}),a.jsx(yb,{styles:d,setStyles:c,setIsEdited:g}),a.jsx("div",{style:{display:"flex",justifyContent:"end",marginTop:40},children:a.jsx(w0,{asChild:!0,children:a.jsx(te,{style:{paddingInline:40},variant:"outline",children:"Ok"})})})]})]})]},"title")],right:[a.jsx(Y0,{isExpanded:k,setIsExpanded:E},"toggle"),a.jsx(uo,{onSave:pe,isSaving:p,disabled:!m},"save")],rightClass:"ecr-admin-nav-btn-reverse"}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Manage Widget"}],onNavigate:G=>q(()=>e(G))}),a.jsxs("div",{className:"ecr-admin-group-edit",children:[a.jsx(Rb,{allReels:B,gid:r,handleSelectReel:ve,searchTerm:h,setSearchTerm:v,isSearching:_,togglingId:C,lastStoryElementRef:w}),a.jsx(Ob,{gid:r,reels:s,styles:d,handleRemoveReel:ve,togglingId:C,currentTab:T}),k&&a.jsx(d_,{isExpanded:k,setIsExpanded:E,setIsEdited:g,styles:d,setStyles:c,tabs:bd,setCurrentTab:A,currentTab:T})]}),z&&a.jsx(Rr,{onReject:ie,onAccept:ae,isLoading:!1,message:"You have unsaved changes. Leave this page without saving?"})]})};function h_(){const[e]=Yt(),t=e.get("view")||X.ag;let r;switch(t){case X.settings:r=a.jsx(H0,{});break;case X.ar:r=a.jsx(Cf,{});break;case X.stat:r=a.jsx(q0,{});break;case X.cr:r=a.jsx(R0,{});break;case X.mg:r=a.jsx(f_,{});break;default:r=a.jsx(B0,{})}return a.jsxs("div",{children:[r,a.jsx(Hu,{position:"top-right",toastOptions:{style:{padding:"16px",marginTop:"24px",fontSize:"16px"}}})]})}const vd=async(e,t,r,n={})=>{try{if(await he.post(`group/${e}/story/${t}/view`),n.isActive&&!n.isActive())return;r(o=>({...o,[t]:Number(o[t]||0)+1}))}catch{}},_d=e=>!!e?.files?.[0]?.mime_type?.startsWith("video"),g_=()=>{const e=y.useContext(ha);if(!e)throw new Error("useVideoPlayer must be used inside PublicStoryContext");const{styles:t,stories:r,groupId:n,isPlaying:o,setIsPlaying:i,setStoryViews:s}=e,[l,d]=y.useState(r.length-1),[c,u]=y.useState(null),[p,m]=y.useState(!0),[g,b]=y.useState(0),[f,h]=y.useState(!1),[v,_]=y.useState({index:0,story_uuid:r[0]?.story_uuid??""}),w=c?.links&&c.links.length>0?c.links[0]:null,j=t?.playerAppearance??"overlay",C=y.useRef(""),N=y.useCallback((L,P=1)=>{if(r.length===0)return null;let M=L;for(let I=0;I<r.length;I+=1){const B=r[M];if(_d(B))return{story:B,index:M};M=(M+P+r.length)%r.length}return null},[r]),k=y.useCallback(()=>{d(r.length-1);const L=r.findIndex(I=>String(I.story_uuid)===o),P=L>=0?r[L]:null,M=_d(P)?{story:P,index:L}:N(Math.max(L,0),1);if(!M?.story){u(null),m(!1);return}u(M.story),L!==M.index&&M.story.story_uuid!==o&&i(M.story.story_uuid),_({index:0,story_uuid:M.story.story_uuid}),m(!1)},[N,o,i,r]);y.useEffect(()=>{k()},[k]),y.useEffect(()=>(C.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=C.current}),[]);const E=y.useCallback(()=>{i(null)},[i]),T=y.useCallback((L=1)=>{m(!0);const P=r.findIndex(q=>String(q.story_uuid)===String(o)),M=L>0?1:-1,I=L>0?l>P?P+1:0:P>0?P-1:l,B=N(I,M);if(!B?.story){m(!1);return}const z=B.story;if(z.story_uuid===o){m(!1),E();return}_({index:0,story_uuid:z.story_uuid}),n&&vd(n,z.id,s),i(z.story_uuid),m(!1)},[E,N,n,o,l,i,s,r]),A=y.useCallback(()=>{const L=c?.files??[];if(v.index>0){_(P=>({index:P.index-1,story_uuid:L[P.index-1].story_uuid??""}));return}T(-1)},[v.index,T,c?.files]),O=y.useCallback(()=>{const L=c?.files??[];if(v.index+1<L.length){_(P=>({index:P.index+1,story_uuid:L[P.index+1].story_uuid??""}));return}T(1)},[v.index,T,c?.files]),R=y.useCallback(L=>{L.target===L.currentTarget&&E()},[E]);return{closePlayer:E,currentFileIndex:v,duration:g,handleBackdropClick:R,handleNextFile:O,handlePrevFile:A,isLoadingNext:p,isPaused:f,playingStory:c,setDuration:b,setIsPaused:h,setIsPlaying:i,firstLink:w,playerAppearance:j}},x_=()=>a.jsx(a.Fragment,{children:a.jsx("div",{className:"ecr-player__loader",children:a.jsxs("div",{className:"ecr-loader",children:[a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"})]})})}),b_=()=>{const{closePlayer:e,currentFileIndex:t,duration:r,handleBackdropClick:n,handleNextFile:o,handlePrevFile:i,isLoadingNext:s,isPaused:l,playerAppearance:d,playingStory:c,firstLink:u,setDuration:p,setIsPaused:m,setIsPlaying:g}=g_();return a.jsx("div",{onClick:n,className:"ecommreels-story-modal ecr-player",children:c&&a.jsxs("div",{className:"ecr-player__stage",children:[a.jsx(xt,{onClick:i,className:"ecr-player__nav--left",children:a.jsx(Zt,{size:24})}),a.jsx(xt,{onClick:o,className:"ecr-player__nav--right",children:a.jsx(Qt,{size:24})}),a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[c&&a.jsx(ii,{playingStory:c,duration:r,currentFileIndex:t,isPaused:l},`${c.story_uuid}-${t.index}`),a.jsx("div",{onClick:e,className:"ecr-player__close",children:a.jsx(er,{className:"ecr-player__close-icon"})}),s?a.jsx(x_,{}):c?.files.length>0&&a.jsx(di,{currentFileIndex:t,files:c?.files,setDuration:p,setIsPlaying:g,isPaused:l,setIsPaused:m,handlePrevFile:i,handleNextFile:o,storyId:c.id,storyTitle:c?.title}),d==="overlay"?u?a.jsx(Nn,{link:u,usedFor:"user",usedIn:"player",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Ft,{title:c.title}):null,d==="title"?a.jsx(Ft,{title:c.title}):null]})]})})},yd=({story:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const i=t.appearance??"overlay",s=e.links&&e.links.length>0?e.links[0]:null,l=i==="none",d=i==="title",c=t.shape==="rectangle",u=!l&&!d&&s,p=t.border.border_radius,m=p>50?p+16:p>20?p:0;return a.jsxs("div",{className:`ecr-thumb ${t.hoverEffect??""}`,children:[a.jsxs("div",{onClick:()=>r({sid:e.id,story_uuid:e.story_uuid}),className:"ecr-thumb__frame",style:{border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t.shape==="rectangle"?"9/16":"1/1"},children:[a.jsx(Jn,{story:e,styles:t,storyViews:n,setStoryViews:o}),!l&&!d&&c?u?a.jsx(Nn,{link:s,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Ft,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null]}),d?a.jsx("p",{className:"ecr-reel__title",children:e.title}):null]})},v_=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:d,canScrollRight:c,scrollBy:u,scrollStep:p}=fc([e],!0);return a.jsxs("div",{className:"ecr-front-carousel",children:[a.jsx("div",{ref:i,className:"ecr-front-carousel__viewport",children:a.jsx("div",{ref:s,className:t.hoverEffect==="zoom-in"?"ecr-front-carousel__track ecr-front-carousel__track--zoom":"ecr-front-carousel__track",children:e?.map(m=>m?.files[0]?.mime_type.startsWith("video")?a.jsx(yd,{story:m,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},m.story_uuid):null)})}),l&&d&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--left",children:a.jsx(Zt,{size:20,style:{width:"20px",height:"20px"}})}),l&&c&&a.jsx("button",{onClick:()=>u(p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--right",children:a.jsx(Qt,{size:20,style:{width:"20px",height:"20px"}})})]})},wd=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>a.jsx("div",{className:"ecr-front-grid",children:a.jsx("div",{style:{paddingBlock:`${t.topBottomSpacing}px`},className:"ecr-front-grid__list",children:e?.map(i=>i?.files[0]?.mime_type.startsWith("video")?a.jsx(yd,{story:i,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},i.story_uuid):null)})}),__={carousel:v_,grid:wd},y_=()=>{const e=y.useContext(ha),{groupTitle:t,styles:r,stories:n,groupId:o,setIsPlaying:i,storyViews:s,setStoryViews:l}=e,d=y.useRef(!0);y.useEffect(()=>(d.current=!0,()=>{d.current=!1}),[]);const c=r.template??"carousel",u=__[c]||wd,p=({sid:m,story_uuid:g})=>{i(g),o&&vd(o,m,l,{isActive:()=>d.current})};return a.jsxs("div",{style:{"--thumbnail-size":r.template==="grid"?"auto":`${r?.size}px`,"--thumbnail-size-grid":`${r?.size}px`,"--thumbnail-size-mobile":r.template==="grid"?"auto":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-size-grid-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},children:[r?.widgetTitle&&r?.widgetTitle?.alignment!=="hidden"&&t?a.jsx("h2",{style:{textAlign:r.widgetTitle?.alignment,fontSize:r.widgetTitle?.fontSize,color:r.widgetTitle?.color,marginBottom:24},children:t}):null,a.jsx(u,{stories:n,styles:r,handlePlaying:p,storyViews:s,setStoryViews:l})]})},w_=e=>{const[t,r]=y.useState(""),[n,o]=y.useState([]),[i,s]=y.useState(tt),[l,d]=y.useState(!1),[c,u]=y.useState(null),p=y.useCallback(async()=>{const m=e?.trim();if(!m){o([]),s(tt),d(!1),u(null);return}const g=new AbortController;d(!0),u(null);try{const b=await he.get(`stories/${m}`,{signal:g.signal});if(g.signal.aborted)return;r(b.data.group_name),o(b.data.stories),s(b.data.styles||tt)}catch(b){if(g.signal.aborted)return;u(b)}finally{d(!1)}return()=>{g.abort()}},[e]);return y.useEffect(()=>{p()},[e]),{groupTitle:t,stories:n,styles:i,isLoading:l,error:c}},ha=y.createContext(void 0),jd=({groupId:e})=>{const[t,r]=y.useState(null),[n,o]=y.useState({}),{groupTitle:i,stories:s,styles:l}=w_(e);return a.jsxs(ha.Provider,{value:{groupTitle:i,groupId:e,stories:s,styles:l,isPlaying:t,setIsPlaying:r,storyViews:n,setStoryViews:o},children:[t&&a.jsx(b_,{}),a.jsx(y_,{})]})};va(()=>{const e=document.getElementById("ecommreels-admin-app");e&&Ln.createRoot(e).render(a.jsx(Zd,{children:a.jsx(h_,{})}))}),va(()=>{const e=document.querySelectorAll(".ecommreels-short-code"),t=document.querySelectorAll(".reelswp-group-short-code");e.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;Ln.createRoot(n).render(a.jsx(jd,{groupId:o}))}),t.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;Ln.createRoot(n).render(a.jsx(jd,{groupId:o}))})})})(React,wp.domReady,wp.element,ReactDOM);
     367For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},f0="DialogDescriptionWarning",h0=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${zl(f0).contentName}}.`;return x.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},g0=jl,x0=Cl,b0=Nl,_0=El,v0=Tl,y0=Pl,Ml=Ll;function Vo({...e}){return a.jsx(g0,{"data-slot":"dialog",...e})}function Wo({...e}){return a.jsx(x0,{"data-slot":"dialog-trigger",...e})}function w0({...e}){const t=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(b0,{"data-slot":"dialog-portal",container:t,...e})}function j0({className:e,...t}){return a.jsx(_0,{"data-slot":"dialog-overlay",className:F("ecr-dialog__overlay",e),...t})}function qo({className:e,children:t,...r}){return a.jsxs(w0,{children:[a.jsx(j0,{}),a.jsxs(v0,{"data-slot":"dialog-content",className:F("ecr-dialog__content",e),...r,children:[t,a.jsx(Ml,{className:"ecr-dialog__close","aria-label":"Close dialog",children:a.jsx(Qf,{className:"ecr-dialog__close-icon"})})]})]})}function Go({className:e,...t}){return a.jsx("div",{className:F("ecr-dialog__header",e),...t})}function Ko({className:e,...t}){return a.jsx(y0,{"data-slot":"dialog-title",className:F("ecr-dialog__title",e),...t})}function S0({...e}){return a.jsx(Ml,{"data-slot":"dialog-close",...e})}const C0=(e={})=>{const{enabled:t=!0}=e,r=typeof ecommreelsInfo<"u"?ecommreelsInfo?.url:"",n=typeof ecommreelsInfo<"u"?ecommreelsInfo?.nonce:"",[o,i]=y.useState([]),[s,l]=y.useState(1),[c,d]=y.useState(!0),[u,p]=y.useState(!1),[m,g]=y.useState(!1),[b,f]=y.useState(""),h=co(b,500),_=y.useRef(!0),v=y.useRef(0),w=y.useRef(null),[j,C]=y.useState(null),N=y.useCallback(async T=>{if(!r||!n){C("Missing API configuration."),g(!1),p(!1);return}const A=++v.current;w.current&&w.current.abort();const O=new AbortController;w.current=O,T===1&&_.current?g(!0):p(!0);try{const R={page:T,per_page:50};h&&(R.search=h);const L=await ee.get(`${r}wc/v3/products`,{headers:{"X-WP-Nonce":n},withCredentials:!0,params:R,signal:O.signal}),P=L.data,M=parseInt(L.headers["x-wp-totalpages"]||"1",10);A===v.current&&(i(I=>T===1?P:[...I,...P]),l(T+1),d(T<M))}catch(R){if(O.signal.aborted)return;R instanceof Error?C(R.message):C("An unknown error occurred")}finally{_.current&&(_.current=!1),A===v.current&&!O.signal.aborted&&(p(!1),g(!1))}},[h,n,r]);y.useEffect(()=>{t&&(l(1),i([]),C(null),_.current=!0,N(1))},[h,N,t]);const k=y.useRef(null),E=y.useCallback(T=>{u||(k.current&&k.current.disconnect(),k.current=new IntersectionObserver(A=>{A[0].isIntersecting&&c&&N(s)}),T&&k.current.observe(T))},[u,c,s,N]);return y.useEffect(()=>()=>{k.current&&k.current.disconnect(),w.current&&w.current.abort()},[]),{products:o,setProducts:i,searchTerm:b,setSearchTerm:f,isSearching:u,isLoading:m,error:j,lastProductElementRef:E}},wn="data:image/webp;base64,UklGRrYCAABXRUJQVlA4IKoCAAAQDgCdASpkAEMAAAAAJaQDTXX09L/D3HZzPbW8/T59Tq2V1f9x4QZUkPFMe8XfzV/1/cA/U3/e+qB5s3stfrGmnzI3LSXH12rz2O2VKFiQhcbIwmUHTRPSh2VO/qyrsEp8zYYljZlwfgijGvud/SarxFjfxEew4IAAAP7/ti48OT/Oya3x+X1pd0VKczR2pok8Ci8XRszNhGh0y5UiQtxf1xZl/3jvki/LfqRs3vrkqKO+RR3ax2yhGPzf/uMJqz6MmyKZ75prVit6Eu2kyiVhUvihA/zLTt4PvMG3YOlFXZJRTk9Zz1SB9/gGf8x4hu9/9Fz/JZ63KGECMtEG58t43wKZFRr2piHRIZQT76htB+3yWUaqjW/9r5PNawz37RxBI1wHwj1o4cbmVBENdq85+fOSQapp04WZhajKbzXhRwSwcxZI01XL2O35Gs53AKgwVjlqhKBXmU5RK0/N1qmQ8h7bn4+Dgm4fguH/nDOEx63rpdXh50ZJgbckzvlWp65XCscQ+Z90pb/bzQAYUI5YPYyk20I93Q8IjMbbafY+FumPz2rofTi71XKY3kDqTc0uBkqjYSUfFMUKxgw1NrzD+Wbnnu2IM+Qd4VS0LEDgJPgKfQ7ibiPABUBtu3G+7MUdxJwAkJmmQoJaL1guZuZ05cbqVsGknyIqlaio4CV14KH5qn4pmkuDfSxtqzn9mhCN+TzF0t4TaR8ogb3/yo30guRPtF+g5KYFVA2UDcRWPUEzW14M0OZ3fHminXd6FGdr5AvpJFRrKwXRhN3HGAgFUI0Kz+1aaiktbCubMvxjbQen+JdPvxDhRzgIgdUC5WTRnTMOZEM6XsqjihAbcx04mA92SCnBZNJtBpRioadBJLj6D4Dd/wEDbmI9KaZM56h8czAAAAAAAAAA",Dl=({name:e,handleClick:t})=>a.jsx("button",{onClick:t,className:F("ecr-button ecr-button--sm",e==="add"?"ecr-button--primary":"ecr-button--danger"),children:e}),k0=({handleLinks:e,taggedProducts:t,products:r,isSearching:n,isLoading:o,lastProductElementRef:i,searchTerm:s,setSearchTerm:l,error:c})=>{const[d,u]=y.useState(t.map(f=>f.product_id)),[p,m]=y.useState(!1),g=f=>{m(!1),u(h=>h.includes(f.id)?h.filter(_=>_!==f.id):[f.id])},b=f=>{if(f.preventDefault(),d.length===0){m(!0);return}const h=new Set(d),_=[];for(const v of r)h.has(v.id)&&_.push({btn_type:"product",btn_uuid:mo(),buttonText:v.name,buttonUrl:v.permalink,rating:v.average_rating,price:v.price_html,thumbnail:v.images?.[0]?.thumbnail||v.images?.[0]?.src||wn,product_id:v.id});e(_),u([])};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"ecr-admin-product-link__search",children:a.jsx("input",{type:"text",placeholder:"Search products...",value:s,onChange:f=>l(f.target.value),className:"ecr-admin-product-link__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-product-link__list",children:o&&r.length===0?a.jsx(Fl,{}):a.jsxs("div",{className:"ecr-admin-product-link__list-inner",children:[r.length===0?a.jsx("p",{className:"ecr-admin-product-link__empty",children:c||"No products are available to add."}):r.map((f,h)=>{const _=d.includes(f.id);return a.jsx("div",{ref:r.length===h+1?i:null,className:"ecr-admin-product-link__item",style:d.length>0&&!_?{opacity:.5,pointerEvents:"none"}:{},children:a.jsxs(te,{type:"button",onClick:()=>g(f),className:F("ecr-admin-product-link__button",_?"ecr-admin-product-link__button--selected":"ecr-admin-product-link__button--unselected"),children:[_?a.jsx(Kf,{size:20,color:"#2563eb"}):a.jsx(Yf,{size:20,color:"#8c95a9"}),a.jsx("img",{className:"ecr-admin-product-link__thumb",src:f.images?.[0]?.thumbnail||f.images?.[0]?.src||wn,alt:"Product thumbnail"}),a.jsx("span",{children:f.name||`Product #${f.id}`})]})},f.id)}),n&&r.length>0&&a.jsx(Fl,{})]})}),a.jsxs("div",{className:"ecr-admin-product-link__footer",children:[p&&a.jsx("p",{className:"ecr-admin-product-link__error",children:"You did not select any product!"}),a.jsx("div",{className:"ecr-admin-product-link__actions",children:a.jsx(Dl,{name:"add",handleClick:b})})]})]})},Fl=()=>a.jsx("div",{className:"ecr-admin-product-link__loader",children:a.jsx("div",{className:"ecr-admin-product-link__spinner"})}),N0=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i,E0=({handleLinks:e})=>{const[t,r]=y.useState(""),[n,o]=y.useState(""),[i,s]=y.useState(""),[l,c]=y.useState(!0),[d,u]=y.useState(""),[p,m]=y.useState([]),g=()=>{const b=[];t||b.push("text"),n&&N0.test(n)||b.push("url"),i||b.push("campaign"),m(b),!(b.length>0)&&e({btn_type:"custom",btn_uuid:mo(),buttonText:t,buttonUrl:n,openInNewTab:l,campaignName:i,customClass:d,clickCount:0})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx(jn,{error:p.includes("text"),type:"text",name:"buttonText",label:"Button Text",placeholder:"e.g Buy Now",value:t,setValue:r}),p.includes("text")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Button text is required!"})]}),a.jsxs("div",{children:[a.jsx(jn,{error:p.includes("url"),type:"url",name:"url",label:"Url",placeholder:"e.g https://example.com",value:n,setValue:o}),p.includes("url")&&a.jsx("p",{className:"ecr-admin-link__error",children:"A valid url is required!"})]}),a.jsxs("div",{children:[a.jsx(jn,{error:p.includes("campaign"),type:"text",name:"campaignName",label:"Campaign Name",placeholder:"e.g Summer sale",value:i,setValue:s}),p.includes("campaign")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Campaign name is required!"})]}),a.jsxs("div",{className:"ecr-admin-link__toggle",children:[a.jsx("input",{checked:l,onChange:b=>c(b.target.checked),className:"ecr-admin-link__checkbox",type:"checkbox",name:"",id:"newTab"}),a.jsx("label",{className:"ecr-admin-link__toggle-label",htmlFor:"newTab",children:"Open in new tab"})]}),a.jsx("div",{children:a.jsx(jn,{error:p.includes("customClass"),type:"text",name:"customClass",label:"Custom class",placeholder:"custom-class",value:d,setValue:u})}),a.jsx("div",{className:"ecr-admin-link__actions",children:a.jsx(Dl,{name:"add",handleClick:g})})]})};function jn({error:e,type:t,name:r,label:n,placeholder:o,value:i,setValue:s}){return a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"ecr-admin-link__label",htmlFor:r,children:n}),a.jsx("input",{id:r,name:r,type:t,placeholder:o,value:i,onChange:l=>s(l.target.value),className:F("ecr-admin-link__input",e?"ecr-admin-link__input--error":"ecr-admin-link__input--normal")})]})}const T0=({setLinks:e,linkCount:t,linkType:r,links:n})=>{const[o,i]=y.useState(null),[s,l]=y.useState(!1),c=C0({enabled:s}),d=t===0||r==="Link",u=t===0||r==="Product",p=n.filter(g=>g.btn_type==="product"),m=()=>l(!0);return a.jsxs(a.Fragment,{children:[t?a.jsx(_n,{}):null,a.jsx("div",{className:"ecr-admin-link-tabs",children:a.jsxs("div",{className:"ecr-admin-link-tabs__list",children:[d&&a.jsxs(Vo,{open:o==="custom",onOpenChange:g=>i(g?"custom":null),children:[a.jsxs(Wo,{className:"ecr-admin-link-tabs__trigger",children:[a.jsx(Hf,{size:20})," Add Custom Link"]}),a.jsxs(qo,{className:"ecr-admin-link-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Add Custom Link"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(E0,{handleLinks:g=>{e(b=>[...b,g]),i(null)}})})]})]}),u&&a.jsxs(Vo,{open:o==="product",onOpenChange:g=>i(g?"product":null),children:[a.jsxs(Wo,{className:"ecr-admin-link-tabs__trigger",onMouseEnter:m,children:[a.jsx(Jf,{size:20})," Tag Products"]}),a.jsxs(qo,{className:"ecr-admin-link-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Select Products"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(k0,{handleLinks:g=>{e(g),i(null)},taggedProducts:p,products:c.products,isSearching:c.isSearching,isLoading:c.isLoading,lastProductElementRef:c.lastProductElementRef,searchTerm:c.searchTerm,setSearchTerm:c.setSearchTerm,error:c.error})})]})]})]})})]})},A0=({links:e,onLinksChange:t})=>{const r=o=>{t(i=>i.filter(s=>s.btn_uuid!==o))},n=e[0]?.btn_type==="product"?"Product":"Link";return a.jsxs("div",{className:"ecr-admin-links",children:[a.jsx("p",{className:"ecr-admin-links__title",children:`${n}${e.length>1?"s":""}`}),e.length>0?a.jsxs(a.Fragment,{children:[e.map(o=>a.jsxs("div",{className:`ecr-admin-links__item ${o.btn_type==="custom"?o.customClass??"":""}`,children:[a.jsx("span",{children:o.buttonText}),a.jsx(te,{onClick:()=>r(o.btn_uuid),size:"icon-sm",variant:"link",className:"ecr-admin-links__remove",children:a.jsx(Zf,{size:16})})]},o.btn_uuid)),a.jsxs(dt,{children:[a.jsxs(ut,{className:"ecr-admin-links__upgrade",children:["+ Add Another ",a.jsx(_t,{size:20})]}),a.jsx(pt,{className:"ecr-admin-links__popover",children:a.jsx(Mt,{name:"Multiple Links",text:a.jsx(a.Fragment,{children:"Unlock the ability to add multiple custom links, seamlessly redirecting users to your pages from the videos!"})})})]})]}):a.jsx(T0,{setLinks:t,linkCount:e.length,linkType:n,links:e})]})};function $l(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(e)}const P0=({togglePlayPause:e,isMuted:t,file:r,videoRef:n,onEnded:o})=>{const[i,s]=y.useState(!1);return a.jsx("video",{ref:n,className:F("ecr-admin-reelvideo",i?"ecr-admin-reelvideo--portrait":"ecr-admin-reelvideo--landscape"),src:r?.url,muted:t,onClick:e,autoPlay:!0,draggable:!1,onEnded:o,onLoadedMetadata:l=>{const c=l.currentTarget,d=c.videoWidth,u=c.videoHeight;s(()=>u>d)}})},O0=({index:e,setIsAttemptingDelete:t,file:r,file_uuid:n,dragStart:o,dragEnter:i,dragEnd:s})=>{const[l,c]=y.useState(!0),[d,u]=y.useState(!1),p=y.useRef(null),m=()=>{p.current&&(d?p.current.play():p.current.pause(),u(b=>!b))},g=()=>{p.current&&(p.current.muted=!l,c(b=>!b))};return a.jsxs("div",{draggable:!0,onDragStart:()=>o(e),onDragEnter:()=>i(e),onDragEnd:s,className:F("ecr-admin-customization__panel"),children:[a.jsx($l,{className:"ecr-admin-customization__remove",size:20,onClick:()=>t(n)}),a.jsx(P0,{togglePlayPause:m,isMuted:l,file:r,videoRef:p,onEnded:()=>u(!0)}),a.jsxs("div",{className:"ecr-admin-customization__controls",children:[d?a.jsx(Kn,{size:16,className:"ecr-admin-customization__control",onClick:m}):a.jsx(qn,{size:16,className:"ecr-admin-customization__control",onClick:m}),l?a.jsx(Gn,{size:16,className:"ecr-admin-customization__control",onClick:g}):a.jsx(Yn,{size:16,className:"ecr-admin-customization__control",onClick:g})]})]})},R0=({uploadedFiles:e,setIsAttemptingDelete:t,setUploadedFiles:r})=>{const n=y.useRef(null),o=y.useRef(null),i=c=>{n.current=c},s=c=>{o.current=c},l=()=>{if(n.current===null||o.current===null)return;const c=[...e],d=c[n.current];c.splice(n.current,1),c.splice(o.current,0,d),n.current=null,o.current=null,r(c)};return a.jsxs("div",{className:"ecr-admin-customization",children:[e.map((c,d)=>a.jsx(O0,{setIsAttemptingDelete:t,file:c,file_uuid:c.file_uuid,index:d,dragStart:i,dragEnter:s,dragEnd:l},d)),a.jsxs(dt,{children:[a.jsxs(ut,{className:"ecr-admin-customization__add",children:[a.jsx("img",{className:"ecr-admin-customization__icon",src:ts,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-customization__label",children:"Upload another video"}),a.jsx(_t,{size:20,className:"ecr-admin-customization__lock"})]}),a.jsx(pt,{side:"right",className:"ecr-admin-customization__popover",children:a.jsx(Mt,{name:"Multiple Videos",text:a.jsxs(a.Fragment,{children:["Unlock the power of ",a.jsx("strong",{children:"Multiple Video"})," uploads, boosting engagement and variety in every Reels!"]})})})]})]})},L0=({thumbnail:e,onThumbnailChange:t})=>a.jsxs("div",{className:"ecr-admin-thumbnail",children:[a.jsx("p",{className:"ecr-admin-thumbnail__title",children:"Thumbnail"}),e?a.jsxs("div",{className:"ecr-admin-thumbnail__preview",children:[a.jsx("img",{src:e,alt:"Thumbnail",className:"ecr-admin-thumbnail__image"}),a.jsx($l,{className:"ecr-admin-thumbnail__remove",size:20,onClick:()=>t(null)})]}):a.jsx(rs,{mode:"thumbnail",usedFor:"image",setThumbnail:t,className:"ecr-admin-thumbnail__uploader"})]}),I0=()=>{const e=Ne(),[t]=Jt(),r=y.useMemo(()=>t.get("sid"),[t]),n=y.useRef(null),[o,i]=y.useState({files:[],title:"",links:[],thumbnail:null}),[s,l]=y.useState(!1),[c,d]=y.useState(null),u=y.useCallback(h=>{i(_=>({..._,title:typeof h=="function"?h(_.title):h}))},[]),p=y.useCallback(h=>{i(_=>({..._,files:typeof h=="function"?h(_.files):h}))},[]),m=y.useCallback(h=>{i(_=>({..._,links:typeof h=="function"?h(_.links):h}))},[]),g=y.useCallback(h=>{i(_=>({..._,thumbnail:typeof h=="function"?h(_.thumbnail):h}))},[]),b=()=>{c&&(p(h=>h.filter(_=>_.file_uuid!==c)),d(null))},f=y.useCallback(async h=>{try{l(!0);const _=await he.get(`story/${h}`);i({title:_.data.title,files:_.data.files,links:_.data.links,thumbnail:_.data.thumbnail})}catch(_){_ instanceof Error?K.error(_.message):K.error("Something went wrong. Try again later!"),n.current=setTimeout(()=>e(-1),1e3)}finally{l(!1)}},[e]);return y.useEffect(()=>{r&&f(r)},[r,f]),y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),s?a.jsx(Ir,{}):a.jsxs(a.Fragment,{children:[a.jsx(Ef,{uploadedFiles:o.files,links:o.links,thumbnail:o.thumbnail,storyTitle:o.title,setStoryTitle:u}),a.jsxs("div",{className:"ecr-admin-create",children:[a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--main",children:[a.jsx("p",{className:"ecr-admin-create__title",children:"Select video"}),c&&a.jsx(Rr,{onReject:()=>d(null),onAccept:b,isLoading:!1,message:"Are you sure, You want to remove this file?"}),o.files.length>0?a.jsx(R0,{uploadedFiles:o.files,setUploadedFiles:p,setIsAttemptingDelete:d}):a.jsx(rs,{setUploadedFiles:p})]}),a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--side",children:[a.jsx(L0,{thumbnail:o.thumbnail,onThumbnailChange:g}),a.jsx(_n,{className:"ecr-admin-create__separator"}),a.jsx(A0,{links:o.links,onLinksChange:m})]})]})]})},Bl=({message:e="Something went wrong. Please try again."})=>a.jsxs("div",{className:"ecr-admin-error",children:[a.jsx(cp,{className:"ecr-admin-error__icon"}),a.jsx("p",{className:"ecr-admin-error__text",children:e})]});var Yo,Ul;function z0(){return Ul||(Ul=1,Yo=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||r.forEach(function(o){e.addRange(o)}),t&&t.focus()}}),Yo}var Xo,Hl;function M0(){if(Hl)return Xo;Hl=1;var e=z0(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(i){var s=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return i.replace(/#{\s*key\s*}/g,s)}function o(i,s){var l,c,d,u,p,m,g=!1;s||(s={}),l=s.debug||!1;try{d=e(),u=document.createRange(),p=document.getSelection(),m=document.createElement("span"),m.textContent=i,m.ariaHidden="true",m.style.all="unset",m.style.position="fixed",m.style.top=0,m.style.clip="rect(0, 0, 0, 0)",m.style.whiteSpace="pre",m.style.webkitUserSelect="text",m.style.MozUserSelect="text",m.style.msUserSelect="text",m.style.userSelect="text",m.addEventListener("copy",function(f){if(f.stopPropagation(),s.format)if(f.preventDefault(),typeof f.clipboardData>"u"){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=t[s.format]||t.default;window.clipboardData.setData(h,i)}else f.clipboardData.clearData(),f.clipboardData.setData(s.format,i);s.onCopy&&(f.preventDefault(),s.onCopy(f.clipboardData))}),document.body.appendChild(m),u.selectNodeContents(m),p.addRange(u);var b=document.execCommand("copy");if(!b)throw new Error("copy command was unsuccessful");g=!0}catch(f){l&&console.error("unable to copy using execCommand: ",f),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(s.format||"text",i),s.onCopy&&s.onCopy(window.clipboardData),g=!0}catch(h){l&&console.error("unable to copy using clipboardData: ",h),l&&console.error("falling back to prompt"),c=n("message"in s?s.message:r),window.prompt(c,i)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(u):p.removeAllRanges()),m&&document.body.removeChild(m),d()}return g}return Xo=o,Xo}var D0=M0();const Vl=Cd(D0);function Wl({className:e,...t}){return a.jsx("div",{"data-slot":"table-container",className:"ecr-table__container",children:a.jsx("table",{"data-slot":"table",className:F("ecr-table",e),...t})})}function ql({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:F("ecr-table__header",e),...t})}function Gl({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:F("ecr-table__body",e),...t})}function Sn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:F("ecr-table__row",e),...t})}function Kl({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:F("ecr-table__head",e),...t})}function ze({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:F("ecr-table__cell",e),...t})}function Yl({className:e,...t}){return a.jsx("caption",{"data-slot":"table-caption",className:F("ecr-table__caption",e),...t})}const F0=[{label:"No.",width:80,align:"center"},{label:"Group Name",width:250,align:"start"},{label:"Short Code",align:"start"},{label:"Action",width:150,align:"center"}],$0=({tableData:e,setIsAttemptingDelete:t})=>{const[r,n]=y.useState(null),o=y.useRef(null),i=(s,l)=>{Vl(s),n(l),o.current=setTimeout(()=>{n(null)},700)};return y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(Wl,{className:"ecr-admin-groups__table",children:[!e.length&&a.jsx(Yl,{className:"ecr-admin-groups__caption",children:a.jsxs("div",{className:"ecr-admin-groups__empty",children:[a.jsx(ot,{className:"ecr-admin-groups__empty-icon"}),"You did not create any reel group yet!"]})}),e.length?a.jsxs(a.Fragment,{children:[a.jsx(ql,{children:a.jsx(Sn,{children:F0.map((s,l)=>a.jsx(Kl,{className:"ecr-admin-groups__head",style:{width:s?.width||"auto",textAlign:s?.align},children:s.label},l))})}),a.jsx(Gl,{children:e.map((s,l)=>a.jsxs(Sn,{className:F("ecr-admin-groups__row",l%2===0&&"ecr-admin-groups__row--alt"),children:[a.jsx(ze,{className:"ecr-admin-groups__cell ecr-admin-groups__cell--center ecr-admin-groups__cell--strong",children:l+1}),a.jsx(ze,{children:a.jsx("div",{className:"ecr-admin-groups__name",children:s.group_name})}),a.jsx(ze,{children:a.jsxs("div",{className:"ecr-admin-groups__shortcode",children:[a.jsx("span",{className:"ecr-admin-groups__shortcode-text",children:`[reelswp-group id='${s.id}']`}),a.jsxs("div",{className:"ecr-admin-groups__copy",children:[a.jsx("button",{onClick:()=>i(`[reelswp-group id='${s.id}']`,l),className:"ecr-admin-groups__copy-button",title:"Copy",children:a.jsx(op,{className:"ecr-admin-groups__copy-icon"})}),a.jsx("span",{className:F("ecr-admin-groups__copy-tooltip",r===l&&"ecr-admin-groups__copy-tooltip--visible"),children:"Copied!"})]})]})}),a.jsx(ze,{children:a.jsxs("div",{className:"ecr-admin-groups__actions",children:[a.jsx(te,{title:"Statistics",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(bt,{to:`?view=${X.stat}&group=${s.id}&name=${s.group_name}`,children:a.jsx(ui,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(te,{title:"Update Stories",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(bt,{to:`?view=${X.mg}&gid=${s.id}`,children:a.jsx(Or,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(te,{title:"Delete Group",onClick:()=>t(s.id),variant:"link",size:"icon-sm",className:"ecr-admin-groups__action-button",children:a.jsx(lp,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--danger"})})]})})]},s.id??l))})]}):null]})},Xl=()=>a.jsxs("table",{className:"ecr-admin-groups__skeleton-table",children:[a.jsx("thead",{className:"ecr-admin-groups__skeleton-head",children:a.jsxs("tr",{children:[a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--tiny"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--medium"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--large"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--small"})})]})}),a.jsx("tbody",{children:Array.from({length:5}).map((e,t)=>a.jsxs("tr",{className:t%2===0?"ecr-admin-groups__skeleton-row ecr-admin-groups__skeleton-row--alt":"ecr-admin-groups__skeleton-row",children:[a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--tiny"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--medium"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--large"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell ecr-admin-groups__skeleton-cell--center",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--small"})})]},t))})]}),B0=()=>{const[e,t]=y.useState([]),[r,n]=y.useState(""),[o,i]=y.useState(!1),[s,l]=y.useState(!1),[c,d]=y.useState(!1),[u,p]=y.useState(""),[m,g]=y.useState(1),[b]=y.useState(20),[f,h]=y.useState(0),[_,v]=y.useState(1),w=co(u,500),j=y.useCallback(async E=>{const T=new AbortController,A=E===1;try{A?i(!0):l(!0),n("");const O=await he.get("groups",{params:{page:E,per_page:b,...w&&{q:w}},signal:T.signal}),R=Number(O.headers?.["x-wp-total"]??0),L=Number(O.headers?.["x-wp-totalpages"]??1),P=Math.max(1,L||1);t(M=>{if(A)return O.data;const I=new Set(M.map(z=>z.id)),B=O.data.filter(z=>!I.has(z.id));return[...M,...B]}),h(R),v(P),E>P&&g(P)}catch(O){if(T.signal.aborted)return;O instanceof Error?n(O.message):n("Something went wrong. Try again later!")}finally{T.signal.aborted||(A?i(!1):l(!1))}},[b,w]),C=y.useCallback(()=>{g(E=>o||s||E>=_?E:E+1)},[o,s,_]),N=y.useCallback(async()=>{if(m!==1){g(1);return}await j(1)},[m,j]),k=y.useCallback(async E=>{try{d(!0),await he.delete(`group/${E}`),await N(),K.success("Group deleted successfully!")}catch(T){T instanceof Error?K.error(T.message):K.error("Failed to delete group.")}finally{d(!1)}},[N]);return y.useEffect(()=>{j(m)},[m,j,w]),{groups:e,groupError:r,isLoading:o,isLoadingMore:s,isDeleting:c,searchTerm:u,setSearchTerm:p,perPage:b,total:f,totalPages:_,hasMore:m<=_,loadMore:C,refreshGroups:N,deleteGroup:k}},U0={docs:"https://reelswp.com/docs/"},H0=()=>{const[e,t]=y.useState(null),{groups:r,groupError:n,isLoading:o,isLoadingMore:i,isDeleting:s,deleteGroup:l,hasMore:c,loadMore:d,searchTerm:u,setSearchTerm:p}=B0(),m=y.useRef(null),g=async()=>{e&&(await l(e),t(null))};return y.useEffect(()=>{if(!m.current||!c)return;const b=new IntersectionObserver(f=>{const[h]=f;h.isIntersecting&&d()},{root:null,rootMargin:"200px",threshold:0});return b.observe(m.current),()=>b.disconnect()},[c,d]),a.jsxs(a.Fragment,{children:[a.jsx(jt,{left:[a.jsx(St,{name:"All Widgets",Icon:dp},"page")],center:[a.jsx(zr,{},"reel-wp")],right:[a.jsxs("a",{href:U0.docs,className:"ecr-admin-docs-link",target:"_blank",children:[a.jsx(Bf,{size:14}),a.jsx("span",{children:"Documentation"})]},"view-documentation"),a.jsx(Lr,{to:`?view=${X.cr}`,text:"Add Reel",Icon:vt},"add-reel-reel-group")]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-groups",children:[e&&a.jsx(Rr,{onAccept:g,onReject:()=>t(null),isLoading:s}),a.jsxs("div",{className:"ecr-admin-groups__header",children:[a.jsx("h2",{className:"ecr-admin-groups__title",children:"Reel Widgets"}),a.jsxs("div",{className:"ecr-admin-groups_action_wrapper",children:[a.jsxs("div",{className:"ecr-admin-groups-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search widgets...",value:u,onChange:b=>p(b.target.value),className:"ecr-admin-groups-search-input"}),a.jsxs("div",{className:"ecr-admin-groups-header__icon-wrapper",children:[u&&a.jsx(te,{onClick:()=>p(""),variant:"link",size:"icon-sm",children:a.jsx(tr,{size:16,className:"ecr-admin-groups-header__clear-icon"})}),a.jsx(ni,{size:16,className:"ecr-admin-groups-header__search-icon"})]})]}),a.jsx(Lr,{to:`?view=${X.mg}`,text:"Create Widget",Icon:vt,className:"ecr-admin-groups__create-button",textColor:"#2563eb"})]})]}),o?a.jsx(Xl,{}):n?a.jsx(Bl,{}):a.jsxs(a.Fragment,{children:[a.jsx($0,{tableData:r,setIsAttemptingDelete:t}),c&&a.jsx("div",{ref:m,className:"ecr-admin-groups__load-more","aria-live":"polite",children:i?a.jsx(Vf,{className:"ecr-admin-groups__load-more__icon"}):null})]})]})]})},V0=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState({rateLimit:2,timeLimit:1}),[o,i]=y.useState(!1),[s,l]=y.useState(!1),[c,d]=y.useState(!1),u=y.useCallback((m,g)=>{t(!0),n(b=>({...b,[m]:g}))},[]),p=y.useCallback(async()=>{const m=Number(r.rateLimit),g=Number(r.timeLimit);if(!Number.isFinite(m)||!Number.isFinite(g)){K.error("Please enter valid numbers.");return}try{l(!0),d(!1),await he.post("settings",{rate_limit:m,time_limit:g}),K.success("Settings updated successfully."),t(!1)}catch(b){b instanceof Error?K.error(b.message):K.error("Something went wrong. Try again later!"),d(!0)}finally{l(!1)}},[r.rateLimit,r.timeLimit]);return y.useEffect(()=>{const m=new AbortController;return(async()=>{try{i(!0),d(!1);const b=await he.get("settings",{signal:m.signal});n({rateLimit:b.data.rate_limit,timeLimit:b.data.time_limit}),t(!1)}catch(b){if(m.signal.aborted)return;b instanceof Error?K.error(b.message):K.error("Something went wrong. Try again later!"),d(!0)}finally{m.signal.aborted||i(!1)}})(),()=>m.abort()},[]),{limit:r,isEdited:e,isLoading:o,isSaving:s,isError:c,handleOnChange:u,handleSave:p}},W0=()=>{const{limit:e,isEdited:t,isLoading:r,isSaving:n,isError:o,handleOnChange:i,handleSave:s}=V0();return a.jsxs(a.Fragment,{children:[r&&a.jsx(Ir,{}),a.jsx(jt,{left:[a.jsx(St,{name:"Settings",Icon:Cp},"Settings"),a.jsx(rr,{},"back-settings")],center:[a.jsx(zr,{},"Settings-widget-name")],right:[a.jsx(uo,{onSave:s,isSaving:n,disabled:!t},"save")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Settings"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-card--settings",children:[a.jsx("div",{className:"ecr-admin-card__header",children:a.jsx("h2",{className:"ecr-admin-card__title",children:"ReelsWP Settings"})}),o&&a.jsx("div",{className:"ecr-admin-form__row",children:a.jsx("span",{children:"Unable to load settings. Please try again."})}),a.jsxs("form",{action:"",className:"ecr-admin-form",children:[a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_rate_limit",className:"ecr-admin-form__label",children:"Rate Limit:"}),a.jsx("input",{type:"number",id:"ecommreels_rate_limit",name:"ecommreels_rate_limit",value:e.rateLimit,onChange:l=>i("rateLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]}),a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_time_limit",className:"ecr-admin-form__label",children:"Time Limit (minutes):"}),a.jsx("input",{type:"number",id:"ecommreels_time_limit",name:"ecommreels_time_limit",value:e.timeLimit,onChange:l=>i("timeLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]})]})]})]})},q0=[{label:"No.",width:80,align:"center"},{label:"Story Title",width:150,align:"left"},{label:"Campaign Name",width:150,align:"left"},{label:"Button Text",width:150,align:"left"},{label:"URL",align:"left"},{label:"Click",width:80,align:"center"}],G0=({tableData:e})=>a.jsxs(Wl,{className:"ecr-admin-stats__table",children:[!e.length&&a.jsx(Yl,{className:"ecr-admin-stats__caption",children:a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(ot,{className:"ecr-admin-stats__empty-icon"}),"You did not create any reel group yet!"]})}),a.jsx(ql,{children:a.jsx(Sn,{children:q0.map((t,r)=>a.jsx(Kl,{className:"ecr-admin-stats__head",style:{...t.width&&{width:`${t.width}px`},textAlign:t.align},children:t.label},r))})}),!!e.length&&a.jsx(Gl,{children:e.map((t,r)=>a.jsxs(Sn,{className:F("ecr-admin-stats__row",r%2===0&&"ecr-admin-stats__row--alt"),children:[a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:r+1}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.storyTitle}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.campaignName}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.buttonText}),a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--link",children:a.jsx("a",{href:t.buttonUrl,target:"_blank",rel:"noopener noreferrer",className:"ecr-admin-stats__link",children:t.buttonUrl})}),a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:t.clickCount})]},t.id))})]}),K0=()=>{const[e]=Jt(),t=e.get("group"),r=e.get("name"),[n,o]=y.useState([]),[i,s]=y.useState([]),[l,c]=y.useState(!1),[d,u]=y.useState(!1);y.useEffect(()=>{t&&(async()=>{try{c(!0);const g=await he.get(`/group/${t}/stats`);o(g.data.stories),s(g.data.buttons)}catch(g){g instanceof Error?K.error(g.message):K.error("Something went wrong. Try again later!"),u(!0)}finally{c(!1)}})()},[t]);const p=n.length>0?n.reduce((m,g)=>m+=g.view_count??0,0):0;return a.jsxs(a.Fragment,{children:[a.jsx(jt,{left:[a.jsx(St,{name:"Statistics",Icon:ui},"Statistics"),a.jsx(rr,{},"Statistics-back")],center:[a.jsx(zr,{},"Statistics-widget-name")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Statistics"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-stats",children:[a.jsxs("div",{className:"ecr-admin-stats__header",children:[a.jsxs("h2",{className:"ecr-admin-stats__title",children:["Group: ",r]}),l?a.jsx("div",{className:"ecr-admin-stats__summary-skeleton"}):a.jsxs("div",{className:"ecr-admin-stats__summary",children:[a.jsx("span",{children:"Total View:"})," ",a.jsx("span",{children:p})]})]}),a.jsx("div",{className:"ecr-admin-stats__body",children:l?a.jsx(Xl,{}):d?a.jsx(Bl,{}):i.length===0?a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(ot,{className:"ecr-admin-stats__empty-icon"}),a.jsx("span",{children:"No Stats available for this group"})]}):a.jsx(G0,{tableData:i})})]})]})};function Y0(e){return H({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 3a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2zm-5-1v12H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm1 0h2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-2z"},child:[]}]})(e)}function X0(e){return H({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11 4a4 4 0 0 1 0 8H8a5 5 0 0 0 2-4 5 5 0 0 0-2-4zm-6 8a4 4 0 1 1 0-8 4 4 0 0 1 0 8M0 8a5 5 0 0 0 5 5h6a5 5 0 0 0 0-10H5a5 5 0 0 0-5 5"},child:[]}]})(e)}const J0=({isExpanded:e,setIsExpanded:t})=>a.jsx("button",{onClick:()=>t(r=>!r),className:F("ecr-admin-side-toggle",e?"ecr-admin-side-toggle--active":""),title:"Side Panel",children:a.jsx(Y0,{size:24})}),Z0=({...e})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",...e,children:a.jsxs("g",{fill:"none","fill-rule":"evenodd",children:[a.jsx("path",{d:"m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z"}),a.jsx("path",{fill:"currentColor",d:"M16 15c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 1 1 0-2h9.17A3 3 0 0 1 16 15m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2M8 9a3 3 0 0 1 2.762 1.828l.067.172H20a1 1 0 0 1 .117 1.993L20 13h-9.17a3.001 3.001 0 0 1-5.592.172L5.17 13H4a1 1 0 0 1-.117-1.993L4 11h1.17A3 3 0 0 1 8 9m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2m8-8c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 0 1 0-2h9.17A3 3 0 0 1 16 3m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2"})]})}),Jo=y.forwardRef(({className:e,type:t,...r},n)=>a.jsx(W.input,{ref:n,type:t,"data-slot":"input",className:F("ecr-input",e),...r}));Jo.displayName="Input";const Zo=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:c})=>{const[d,u]=y.useState(n),p=y.useRef(null);y.useEffect(()=>{u(n)},[n]);const m=b=>{const f=Math.min(r,Math.max(t,Number(b)));o(f)},g=b=>{const f=Number(b);u(f),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{m(f>r?r:f<t?t:f)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":"]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:b=>{const f=Number(b.target.value);u(f),m(f)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(Jo,{type:"number",min:t,max:r,value:d,onChange:b=>g(b.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})};function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},D.apply(null,arguments)}function Be(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Dt=255,Je=100,mr=e=>{var{r:t,g:r,b:n,a:o}=e,i=Math.max(t,r,n),s=i-Math.min(t,r,n),l=s?i===t?(r-n)/s:i===r?2+(n-t)/s:4+(t-r)/s:0;return{h:60*(l<0?l+6:l),s:i?s/i*Je:0,v:i/Dt*Je,a:o}},Jl=e=>{var{h:t,s:r,l:n,a:o}=Zl(e);return"hsla("+t+", "+r+"%, "+n+"%, "+o+")"},Zl=e=>{var{h:t,s:r,v:n,a:o}=e,i=(200-r)*n/Je;return{h:t,s:i>0&&i<200?r*n/Je/(i<=Je?i:200-i)*Je:0,l:i/2,a:o}},Ql=e=>{var{r:t,g:r,b:n}=e,o=t<<16|r<<8|n;return"#"+(i=>new Array(7-i.length).join("0")+i)(o.toString(16))},Q0=e=>{var{r:t,g:r,b:n,a:o}=e,i=typeof o=="number"&&(o*255|256).toString(16).slice(1);return""+Ql({r:t,g:r,b:n})+(i||"")},fr=e=>mr(eb(e)),eb=e=>{var t=e.replace("#","");/^#?/.test(e)&&t.length===3&&(e="#"+t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var r=new RegExp("[A-Za-z0-9]{2}","g"),[n,o,i=0,s]=e.match(r).map(l=>parseInt(l,16));return{r:n,g:o,b:i,a:(s??255)/Dt}},Cn=e=>{var{h:t,s:r,v:n,a:o}=e,i=t/60,s=r/Je,l=n/Je,c=Math.floor(i)%6,d=i-Math.floor(i),u=Dt*l*(1-s),p=Dt*l*(1-s*d),m=Dt*l*(1-s*(1-d));l*=Dt;var g={};switch(c){case 0:g.r=l,g.g=m,g.b=u;break;case 1:g.r=p,g.g=l,g.b=u;break;case 2:g.r=u,g.g=l,g.b=m;break;case 3:g.r=u,g.g=p,g.b=l;break;case 4:g.r=m,g.g=u,g.b=l;break;case 5:g.r=l,g.g=u,g.b=p;break}return g.r=Math.round(g.r),g.g=Math.round(g.g),g.b=Math.round(g.b),D({},g,{a:o})},tb=e=>{var{r:t,g:r,b:n,a:o}=Cn(e);return"rgba("+t+", "+r+", "+n+", "+o+")"},rb=e=>{var{r:t,g:r,b:n}=e;return{r:t,g:r,b:n}},nb=e=>{var{h:t,s:r,l:n}=e;return{h:t,s:r,l:n}},Qo=e=>Ql(Cn(e)),ob=e=>{var{h:t,s:r,v:n}=e;return{h:t,s:r,v:n}},ab=e=>{var{r:t,g:r,b:n}=e,o=function(u){return u<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)},i=o(t/255),s=o(r/255),l=o(n/255),c={};return c.x=i*.4124+s*.3576+l*.1805,c.y=i*.2126+s*.7152+l*.0722,c.bri=i*.0193+s*.1192+l*.9505,c},Ft=e=>{var t,r,n,o,i,s,l,c,d;return typeof e=="string"&&ea(e)?(s=fr(e),c=e):typeof e!="string"&&(s=e),s&&(n=ob(s),i=Zl(s),o=Cn(s),d=Q0(o),c=Qo(s),r=nb(i),t=rb(o),l=ab(t)),{rgb:t,hsl:r,hsv:n,rgba:o,hsla:i,hsva:s,hex:c,hexa:d,xy:l}},ea=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e);function ec(e){var t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useCallback((r,n)=>t.current&&t.current(r,n),[])}var hr=e=>"touches"in e,tc=e=>{!hr(e)&&e.preventDefault&&e.preventDefault()},rc=function(t,r,n){return r===void 0&&(r=0),n===void 0&&(n=1),t>n?n:t<r?r:t},nc=(e,t)=>{var r=e.getBoundingClientRect(),n=hr(t)?t.touches[0]:t;return{left:rc((n.pageX-(r.left+window.pageXOffset))/r.width),top:rc((n.pageY-(r.top+window.pageYOffset))/r.height),width:r.width,height:r.height,x:n.pageX-(r.left+window.pageXOffset),y:n.pageY-(r.top+window.pageYOffset)}},ib=["prefixCls","className","onMove","onDown"],ta=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-interactive",className:n,onMove:o,onDown:i}=e,s=Be(e,ib),l=y.useRef(null),c=y.useRef(!1),[d,u]=y.useState(!1),p=ec(o),m=ec(i),g=v=>c.current&&!hr(v)?!1:(c.current=hr(v),!0),b=y.useCallback(v=>{if(tc(v),!!l.current){var w=hr(v)?v.touches.length>0:v.buttons>0;if(!w){u(!1);return}p?.(nc(l.current,v),v)}},[p]),f=y.useCallback(()=>u(!1),[]),h=y.useCallback(v=>{v?(window.addEventListener(c.current?"touchmove":"mousemove",b),window.addEventListener(c.current?"touchend":"mouseup",f)):(window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",f),window.removeEventListener("touchmove",b),window.removeEventListener("touchend",f))},[b,f]);y.useEffect(()=>(h(d),()=>{h(!1)}),[d,b,f,h]);var _=y.useCallback(v=>{var w=document.activeElement;w?.blur(),tc(v.nativeEvent),g(v.nativeEvent)&&l.current&&(m?.(nc(l.current,v.nativeEvent),v.nativeEvent),u(!0))},[m]);return a.jsx("div",D({},s,{className:[r,n||""].filter(Boolean).join(" "),style:D({},s.style,{touchAction:"none"}),ref:l,tabIndex:0,onMouseDown:_,onTouchStart:_}))});ta.displayName="Interactive";var sb=e=>{var{className:t,color:r,left:n,top:o,prefixCls:i}=e,s={position:"absolute",top:o,left:n},l={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:r};return y.useMemo(()=>a.jsx("div",{className:i+"-pointer "+(t||""),style:s,children:a.jsx("div",{className:i+"-fill",style:l})}),[o,n,r,t,i])},lb=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],oc=y.forwardRef((e,t)=>{var r,{prefixCls:n="w-color-saturation",radius:o=0,pointer:i,className:s,hue:l=0,style:c,hsva:d,onChange:u}=e,p=Be(e,lb),m=D({width:200,height:200,borderRadius:o},c,{position:"relative"}),g=(_,v)=>{u&&d&&u({h:d.h,s:_.left*100,v:(1-_.top)*100,a:d.a})},b=y.useCallback(_=>{if(!(!d||!u)){var v=1,w=d.s,j=d.v,C=!1;switch(_.key){case"ArrowLeft":w=Math.max(0,d.s-v),C=!0,_.preventDefault();break;case"ArrowRight":w=Math.min(100,d.s+v),C=!0,_.preventDefault();break;case"ArrowUp":j=Math.min(100,d.v+v),C=!0,_.preventDefault();break;case"ArrowDown":j=Math.max(0,d.v-v),C=!0,_.preventDefault();break;default:return}C&&u({h:d.h,s:w,v:j,a:d.a})}},[d,u]),f=y.useMemo(()=>{if(!d)return null;var _={top:100-d.v+"%",left:d.s+"%",color:Jl(d)};return i&&typeof i=="function"?i(D({prefixCls:n},_)):a.jsx(sb,D({prefixCls:n},_))},[d,i,n]),h=y.useCallback(_=>{_.target.focus()},[]);return a.jsx(ta,D({className:[n,s||""].filter(Boolean).join(" ")},p,{style:D({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+((r=d?.h)!=null?r:l)+", 100%, 50%))"},m,{outline:"none"}),ref:t,onMove:g,onDown:g,onKeyDown:b,onClick:h,children:f}))});oc.displayName="Saturation";var cb=["className","prefixCls","left","top","style","fillProps"],db=e=>{var{className:t,prefixCls:r,left:n,top:o,style:i,fillProps:s}=e,l=Be(e,cb),c=D({},i,{position:"absolute",left:n,top:o}),d=D({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},s?.style,{transform:n?"translate(-9px, -1px)":"translate(-1px, -9px)"});return a.jsx("div",D({className:r+"-pointer "+(t||""),style:c},l,{children:a.jsx("div",D({className:r+"-fill"},s,{style:d}))}))},ub=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],pb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",kn=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-alpha",className:n,hsva:o,background:i,bgProps:s={},innerProps:l={},pointerProps:c={},radius:d=0,width:u,height:p=16,direction:m="horizontal",style:g,onChange:b,pointer:f}=e,h=Be(e,ub),_=T=>{b&&b(D({},o,{a:m==="horizontal"?T.left:T.top}),T)},v=Jl(Object.assign({},o,{a:1})),w="linear-gradient(to "+(m==="horizontal"?"right":"bottom")+", rgba(244, 67, 54, 0) 0%, "+v+" 100%)",j={};m==="horizontal"?j.left=o.a*100+"%":j.top=o.a*100+"%";var C=D({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:d,background:"url("+pb+") left center",backgroundColor:"var(--alpha-background-color)"},{width:u,height:p},g,{position:"relative"}),N=y.useCallback(T=>{var A=.01,O=o.a,R=O;switch(T.key){case"ArrowLeft":m==="horizontal"&&(R=Math.max(0,O-A),T.preventDefault());break;case"ArrowRight":m==="horizontal"&&(R=Math.min(1,O+A),T.preventDefault());break;case"ArrowUp":m==="vertical"&&(R=Math.max(0,O-A),T.preventDefault());break;case"ArrowDown":m==="vertical"&&(R=Math.min(1,O+A),T.preventDefault());break;default:return}if(R!==O){var L={left:m==="horizontal"?R:o.a,top:m==="vertical"?R:o.a,width:0,height:0,x:0,y:0};b&&b(D({},o,{a:R}),L)}},[o,m,b]),k=y.useCallback(T=>{T.target.focus()},[]),E=f&&typeof f=="function"?f(D({prefixCls:r},c,j)):a.jsx(db,D({},c,{prefixCls:r},j));return a.jsxs("div",D({},h,{className:[r,r+"-"+m,n||""].filter(Boolean).join(" "),style:C,ref:t,children:[a.jsx("div",D({},s,{style:D({inset:0,position:"absolute",background:i||w,borderRadius:d},s.style)})),a.jsx(ta,D({},l,{style:D({},l.style,{inset:0,zIndex:1,position:"absolute",outline:"none"}),onMove:_,onDown:_,onClick:k,onKeyDown:N,children:E}))]}))});kn.displayName="Alpha";var mb=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur","renderInput"],fb=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e),hb=e=>Number(String(e).replace(/%/g,"")),$t=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input",placement:n="bottom",label:o,value:i,className:s,style:l,labelStyle:c,inputStyle:d,onChange:u,onBlur:p,renderInput:m}=e,g=Be(e,mb),[b,f]=y.useState(i),h=y.useRef(!1);y.useEffect(()=>{e.value!==b&&(h.current||f(e.value))},[e.value]);function _(k,E){var T=(E||k.target.value).trim().replace(/^#/,"");fb(T)&&u&&u(k,T);var A=hb(T);isNaN(A)||u&&u(k,A),f(T)}function v(k){h.current=!1,f(e.value),p&&p(k)}var w={};n==="bottom"&&(w.flexDirection="column"),n==="top"&&(w.flexDirection="column-reverse"),n==="left"&&(w.flexDirection="row-reverse");var j=D({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},w,l),C=D({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},d),N=D({value:b,onChange:_,onBlur:v,autoComplete:"off",onFocus:()=>h.current=!0},g,{style:C,onFocusCapture:k=>{var E=k.target;E.setSelectionRange(E.value.length,E.value.length)}});return a.jsxs("div",{className:[r,s||""].filter(Boolean).join(" "),style:j,children:[m?m(N,t):a.jsx("input",D({ref:t},N)),o&&a.jsx("span",{style:D({color:"var(--editable-input-label-color)",textTransform:"capitalize"},c),children:o})]})});$t.displayName="EditableInput";var gb=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],ac=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input-rgba",hsva:n,placement:o="bottom",rProps:i={},gProps:s={},bProps:l={},aProps:c={},className:d,style:u,onChange:p}=e,m=Be(e,gb),g=n?Cn(n):{};function b(v){var w=Number(v.target.value);w&&w>255&&(v.target.value="255"),w&&w<0&&(v.target.value="0")}var f=v=>{var w=Number(v.target.value);w&&w>100&&(v.target.value="100"),w&&w<0&&(v.target.value="0")},h=(v,w,j)=>{typeof v=="number"&&(w==="a"&&(v<0&&(v=0),v>100&&(v=100),p&&p(Ft(mr(D({},g,{a:v/100}))))),v>255&&(v=255,j.target.value="255"),v<0&&(v=0,j.target.value="0"),w==="r"&&p&&p(Ft(mr(D({},g,{r:v})))),w==="g"&&p&&p(Ft(mr(D({},g,{g:v})))),w==="b"&&p&&p(Ft(mr(D({},g,{b:v})))))},_=g.a?Math.round(g.a*100)/100:0;return a.jsxs("div",D({ref:t,className:[r,d||""].filter(Boolean).join(" ")},m,{style:D({fontSize:11,display:"flex"},u),children:[a.jsx($t,D({label:"R",value:g.r||0,onBlur:b,placement:o,onChange:(v,w)=>h(w,"r",v)},i,{style:D({},i.style)})),a.jsx($t,D({label:"G",value:g.g||0,onBlur:b,placement:o,onChange:(v,w)=>h(w,"g",v)},s,{style:D({marginLeft:5},i.style)})),a.jsx($t,D({label:"B",value:g.b||0,onBlur:b,placement:o,onChange:(v,w)=>h(w,"b",v)},l,{style:D({marginLeft:5},l.style)})),c&&a.jsx($t,D({label:"A",value:parseInt(String(_*100),10),onBlur:f,placement:o,onChange:(v,w)=>h(w,"a",v)},c,{style:D({marginLeft:5},c.style)}))]}))});ac.displayName="EditableInputRGBA";var xb=["prefixCls","className","hue","onChange","direction"],ic=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-hue",className:n,hue:o=0,onChange:i,direction:s="horizontal"}=e,l=Be(e,xb);return a.jsx(kn,D({ref:t,className:r+" "+(n||"")},l,{direction:s,background:"linear-gradient(to "+(s==="horizontal"?"right":"bottom")+", rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)",hsva:{h:o,s:100,v:100,a:o/360},onChange:(c,d)=>{i&&i({h:s==="horizontal"?360*d.left:360*d.top})}}))});ic.displayName="Hue";var bb=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],sc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-swatch",className:n,color:o,colors:i=[],style:s,rectProps:l={},onChange:c,addonAfter:d,addonBefore:u,rectRender:p}=e,m=Be(e,bb),g=D({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},l.style),b=(f,h)=>{c&&c(fr(f),Ft(fr(f)),h)};return a.jsxs("div",D({ref:t},m,{className:[r,n||""].filter(Boolean).join(" "),style:D({display:"flex",flexWrap:"wrap",position:"relative"},s),children:[u&&y.isValidElement(u)&&u,i&&Array.isArray(i)&&i.map((f,h)=>{var _="",v="";typeof f=="string"&&(_=f,v=f),typeof f=="object"&&f.color&&(_=f.title||f.color,v=f.color);var w=o&&o.toLocaleLowerCase()===v.toLocaleLowerCase(),j=p&&p({title:_,color:v,checked:!!w,style:D({},g,{background:v}),onClick:N=>b(v,N)});if(j)return a.jsx(y.Fragment,{children:j},h);var C=l.children&&y.isValidElement(l.children)?y.cloneElement(l.children,{color:v,checked:w}):null;return a.jsx("div",D({tabIndex:0,title:_,onClick:N=>b(v,N)},l,{children:C,style:D({},g,{background:v})}),h)}),d&&y.isValidElement(d)&&d]}))});sc.displayName="Swatch";var _b=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],vb=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],lc=e=>a.jsx("div",{style:{boxShadow:"rgb(0 0 0 / 60%) 0px 0px 2px",width:4,top:1,bottom:1,left:e.left,borderRadius:1,position:"absolute",backgroundColor:"#fff"}}),cc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-sketch",className:n,onChange:o,width:i=218,presetColors:s=vb,color:l,editableDisable:c=!0,disableAlpha:d=!1,style:u}=e,p=Be(e,_b),[m,g]=y.useState({h:209,s:36,v:90,a:1});y.useEffect(()=>{typeof l=="string"&&ea(l)&&g(fr(l)),typeof l=="object"&&g(l)},[l]);var b=N=>{g(N),o&&o(Ft(N))},f=(N,k)=>{typeof N=="string"&&ea(N)&&/(3|6)/.test(String(N.length))&&b(fr(N))},h=N=>b(D({},m,{a:N.a})),_=N=>b(D({},m,N,{a:m.a})),v=D({"--sketch-background":"rgb(255, 255, 255)","--sketch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px, rgb(0 0 0 / 15%) 0px 8px 16px","--sketch-swatch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset","--sketch-alpha-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset, rgb(0 0 0 / 25%) 0px 0px 4px inset","--sketch-swatch-border-top":"1px solid rgb(238, 238, 238)",background:"var(--sketch-background)",borderRadius:4,boxShadow:"var(--sketch-box-shadow)",width:i},u),w={borderRadius:2,background:tb(m),boxShadow:"var(--sketch-alpha-box-shadow)"},j={borderTop:"var(--sketch-swatch-border-top)",paddingTop:10,paddingLeft:10},C={marginRight:10,marginBottom:10,borderRadius:3,boxShadow:"var(--sketch-swatch-box-shadow)"};return a.jsxs("div",D({},p,{className:r+" "+(n||""),ref:t,style:v,children:[a.jsxs("div",{style:{padding:"10px 10px 8px"},children:[a.jsx(oc,{hsva:m,style:{width:"auto",height:150},onChange:_}),a.jsxs("div",{style:{display:"flex",marginTop:4},children:[a.jsxs("div",{style:{flex:1},children:[a.jsx(ic,{width:"auto",height:10,hue:m.h,pointer:lc,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:N=>b(D({},m,N))}),!d&&a.jsx(kn,{width:"auto",height:10,hsva:m,pointer:lc,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:h})]}),!d&&a.jsx(kn,{width:24,height:24,hsva:m,radius:2,style:{marginLeft:4},bgProps:{style:{background:"transparent"}},innerProps:{style:w},pointer:()=>a.jsx(y.Fragment,{})})]})]}),c&&a.jsxs("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[a.jsx($t,{label:"Hex",value:Qo(m).replace(/^#/,"").toLocaleUpperCase(),onChange:(N,k)=>f(k),style:{minWidth:58}}),a.jsx(ac,{hsva:m,style:{marginLeft:6},aProps:d?!1:{},onChange:N=>b(N.hsva)})]}),s&&s.length>0&&a.jsx(sc,{style:j,colors:s,color:Qo(m),onChange:N=>b(N),rectProps:{style:C}})]}))});cc.displayName="Sketch";const dc=({selectedColor:e,handleColor:t,text:r,wrapperStyles:n})=>a.jsxs("div",{style:n,className:"ecr-admin-control",children:[a.jsxs("p",{className:"ecr-admin-control__label",children:[r,":"]}),a.jsxs("div",{className:"ecr-admin-control__row ecr-admin-control__row--color",children:[a.jsxs(dt,{children:[a.jsx(ut,{style:{padding:0,backgroundColor:"transparent"},children:a.jsx("div",{style:{backgroundColor:e},className:"ecr-admin-control__swatch"})}),a.jsx(pt,{className:"ecr-admin-popover ecr-admin-color-selector-popover",children:a.jsx(cc,{color:e,disableAlpha:!0,onChange:o=>{t(o.hex)}})})]}),a.jsx("input",{className:"ecr-admin-control__hex",type:"text",value:e,onChange:o=>t(o.target.value)})]})]}),yb=[{value:"left",title:"Align Left",Icon:Bp},{value:"center",title:"Align Center",Icon:Up},{value:"right",title:"Align Right",Icon:Hp},{value:"hidden",title:"Hidden",Icon:Vp}],wb=({alignment:e,handleWidgetTitleAlignment:t})=>a.jsxs("div",{className:"ecr-admin-group-title_alignment",children:[a.jsx("p",{className:"ecr-admin-group-title_alignment-label",children:"Alignment:"}),a.jsx("div",{className:"ecr-admin-group-title_alignment-options",children:yb.map(({value:r,title:n,Icon:o})=>a.jsx(te,{onClick:()=>t(r),style:{width:40,...e===r?{backgroundColor:"#2563eb",color:"#fff"}:{}},size:"icon-sm",variant:"ghost",title:n,children:a.jsx(o,{size:18})},r))})]}),jb=({styles:e,setStyles:t,setIsEdited:r})=>{const n=o=>{t(i=>{const s=o(i);return r(!0),s})};return a.jsxs("div",{className:"ecr-admin-group-title-customization__content",children:[a.jsx(wb,{alignment:e.widgetTitle?.alignment??"hidden",handleWidgetTitleAlignment:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,alignment:o}}))}),a.jsx(dc,{selectedColor:e.widgetTitle?.color??"#000000",handleColor:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,color:o}})),text:"Title Color",wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}}),a.jsx(Zo,{label:"Font size",min:10,max:200,value:e?.widgetTitle?.fontSize??24,onChange:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,fontSize:o}})),name:"font_size",id:"font-size",hideSlider:!0,wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}})]})},Sb=(e=700)=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useCallback(i=>{Vl(i),r(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r(!1)},e)},[e]);return y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),[t,o]},Cb=({gid:e})=>{const[t,r]=Sb(),n=`[reelswp-group id='${e}']`;return a.jsxs("div",{className:"ecr-admin-shortcode",children:[a.jsx("span",{className:"ecr-admin-shortcode__badge",children:n}),a.jsxs("div",{className:"ecr-admin-shortcode__copy",children:[a.jsx("button",{onClick:()=>r(n),className:"ecr-admin-shortcode__button",title:"Copy",children:a.jsx($f,{color:"#ffffff",size:12})}),a.jsx("span",{className:F("ecr-admin-shortcode__tooltip",t?"ecr-admin-shortcode__tooltip--visible":"ecr-admin-shortcode__tooltip--hidden"),children:"Copied!"})]})]})},uc=y.createContext({requestLeave:e=>e()}),kb=({value:e,children:t})=>a.jsx(uc.Provider,{value:e,children:t}),pc=()=>y.useContext(uc);function Nb(e){return H({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"},child:[]}]})(e)}const Eb=({link:e,usedFor:t})=>a.jsx("div",{className:"ecr-product-card-one",style:{width:"100%"},children:a.jsx(Tb,{link:e,usedFor:t})}),Tb=({link:e,usedFor:t})=>a.jsx(a.Fragment,{children:a.jsxs("div",{className:"ecr-product-card-one-content-wrapper",children:[t==="admin"?a.jsx("img",{className:"ecr-product-card-one__thumb",src:e.thumbnail||wn,alt:"Product thumbnail"}):a.jsx("a",{href:e.buttonUrl,target:"_blank",draggable:!1,children:a.jsx("img",{className:"ecr-product-card-one__thumb",src:e.thumbnail||wn,alt:"Product thumbnail",draggable:!1})}),a.jsxs("div",{className:"ecr-product-card-one__content",children:[t==="admin"?a.jsx("p",{className:"ecr-product-card-one__title",children:e.buttonText}):a.jsx("a",{className:"ecr-product-card-one__title",href:e.buttonUrl,target:"_blank",draggable:!1,children:e.buttonText}),a.jsxs("div",{className:"ecr-product-card-one__meta",children:[Number(e.rating)>0?a.jsxs("span",{className:"ecr-product-card-one__rating",children:[a.jsx(Nb,{className:"ecr-product-card-one__star"}),e.rating]}):null,a.jsx("div",{className:"ecr-product-card-one__price",dangerouslySetInnerHTML:{__html:e.price}})]})]})]})}),Ab=({link:e,usedFor:t})=>{const r=t==="admin";return a.jsx("div",{style:{width:"100%"},className:"ecr-thumb__link-wrapper",children:a.jsx("a",{href:r?void 0:e.buttonUrl,target:r?void 0:"_blank",rel:r?void 0:"noopener noreferrer",className:`ecr-thumb__link ${e.customClass??""}`,onClick:r?n=>n.preventDefault():void 0,"aria-disabled":r,tabIndex:r?-1:void 0,draggable:!1,children:e.buttonText})})},Nn=({link:e,usedFor:t,style:r})=>a.jsx("div",{className:"ecr-admin-reelitem-links",style:r,children:e.btn_type==="product"?a.jsx(Eb,{link:e,usedFor:t},e.btn_uuid):a.jsx(Ab,{link:e,usedFor:t},e.btn_uuid)}),Bt=({title:e,styles:t})=>a.jsx("p",{className:"ecr-reel_title",style:t,children:e}),mc=({reel:e,styles:t,gid:r,togglingId:n,onRemove:o})=>{const i=Ne(),{requestLeave:s}=pc(),l=n===e.story_uuid,c=`?view=${X.cr}&from=${X.mg}&sid=${e.id}${r?`&gid=${r}`:""}`,d=t.appearance??"overlay",u={border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t?.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},p=t.border.border_radius,m=p>50?p+16:p>20?p:0,g=e.links&&e.links.length>0?e.links[0]:null,b=d==="none",f=d==="title",h=t.shape==="rectangle",_=!b&&!f&&g;return a.jsxs("div",{className:F("ecr-admin-reelitem",t?.hoverEffect),children:[a.jsxs("div",{style:u,className:"ecr-admin-reelitem__frame",children:[a.jsx(Jn,{story:e,styles:t}),!b&&!f&&h?_?a.jsx(Nn,{link:g,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null,a.jsxs("div",{className:"ecr-admin-reelitem__actions",children:[a.jsx(te,{title:"Edit Story",size:"icon-sm",asChild:!0,className:"ecr-admin-reelitem__button",disabled:l,children:a.jsx(bt,{to:c,className:F("ecr-admin-reelitem__link",l?"ecr-admin-reelitem__link--disabled":"ecr-admin-reelitem__link--active"),onClick:v=>{v.preventDefault(),s(()=>i(c))},children:a.jsx(Or,{className:"ecr-admin-reelitem__icon"})})}),a.jsx(te,{onClick:()=>o(e,"remove"),className:"ecr-admin-reelitem__button ecr-admin-reelitem__button--danger",size:"icon-sm",title:"Remove Story",disabled:l,children:l?a.jsx(rt,{className:"ecr-admin-reelitem__spinner",size:18}):a.jsx(Vn,{size:18})})]})]}),f?a.jsx("p",{className:"ecr-admin-reel__title",children:e.title}):null]})},fc=(e,t)=>{const r=y.useRef(null),n=y.useRef(null),o=y.useRef(null),[i,s]=y.useState(!1),[l,c]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(300),g=()=>{const f=r.current;if(!f)return;const h=f.scrollLeft,_=f.scrollWidth,v=f.clientWidth;c(h>0),u(h+v<_-1)};y.useEffect(()=>{const f=r.current,h=n.current;f&&h&&(s(h.scrollWidth>f.clientWidth),m(f.clientWidth-100),g())},[e,t]);const b=f=>{const h=r.current;h&&(h.scrollBy({left:f,behavior:"smooth"}),o.current&&clearTimeout(o.current),o.current=setTimeout(g,300))};return y.useEffect(()=>{const f=r.current;if(!f)return;let h=!1,_,v;const w=A=>{h=!0,_=A.pageX-f.offsetLeft,v=f.scrollLeft,f.style.cursor="grabbing"},j=()=>{h=!1,f.style.cursor="default"},C=()=>{h=!1,f.style.cursor="default"},N=A=>{if(!h)return;A.preventDefault();const R=(A.pageX-f.offsetLeft-_)*1.5;f.scrollLeft=v-R,g()},k=A=>{h=!0,_=A.touches[0].pageX-f.offsetLeft,v=f.scrollLeft},E=()=>{h=!1},T=A=>{if(!h)return;const R=(A.touches[0].pageX-f.offsetLeft-_)*1.5;f.scrollLeft=v-R,g()};return f.addEventListener("mousedown",w),f.addEventListener("mouseleave",j),f.addEventListener("mouseup",C),f.addEventListener("mousemove",N),f.addEventListener("touchstart",k,{passive:!0}),f.addEventListener("touchend",E),f.addEventListener("touchmove",T,{passive:!0}),()=>{f.removeEventListener("mousedown",w),f.removeEventListener("mouseleave",j),f.removeEventListener("mouseup",C),f.removeEventListener("mousemove",N),f.removeEventListener("touchstart",k),f.removeEventListener("touchend",E),f.removeEventListener("touchmove",T)}},[t]),y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{thumbsContainerRef:r,thumbsWrapperRef:n,isOverflowing:i,canScrollLeft:l,canScrollRight:d,scrollBy:b,scrollStep:p}},hc=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=fc([e],!0);return a.jsxs("div",{className:"ecr-admin-editor-carousel",children:[a.jsx("div",{ref:i,className:"ecr-admin-editor-carousel__viewport",children:a.jsx("div",{ref:s,style:{...!e.length&&{margin:"auto"}},className:F("ecr-admin-editor-carousel__track",t.hoverEffect==="zoom-in"&&"ecr-admin-editor-carousel__track--padded"),children:e.length>0?e.map(m=>a.jsx(mc,{reel:m,styles:t,gid:r,togglingId:n,onRemove:o},m.id)):a.jsx("div",{className:"ecr-admin-editor-carousel__empty",children:a.jsxs("p",{className:"ecr-admin-editor-carousel__empty-text",children:[a.jsx(ot,{className:"ecr-admin-editor-carousel__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--left",children:a.jsx(Qt,{size:20})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--right",children:a.jsx(er,{size:20})})]})},Pb=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>a.jsx("div",{className:F("ecr-admin-editor-grid",t?.hoverEffect==="zoom-in"&&"ecr-admin-editor-grid--padded"),children:e.length>0?e.map(i=>a.jsx(mc,{reel:i,styles:t,gid:r,togglingId:n,onRemove:o},i.id)):a.jsx("div",{className:"ecr-admin-editor-grid__empty",children:a.jsxs("p",{className:"ecr-admin-editor-grid__empty-text",children:[a.jsx(ot,{className:"ecr-admin-editor-grid__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})}),Ob=({reel:e,styles:t})=>{const r=e?.files?.[0],n=!!r?.mime_type?.startsWith("image"),[o,i]=y.useState(!1),[s,l]=y.useState(!0),[c,d]=y.useState(!1),u=y.useRef(null);y.useEffect(()=>{u.current&&(u.current.muted=s)},[s]),y.useEffect(()=>{u.current&&(o?u.current.pause():u.current.play().catch(()=>{}))},[o]);const p=()=>{u.current&&i(f=>!f)},m=()=>{u.current&&l(f=>!f)},g=t?.playerAppearance??"overlay",b=e.links&&e.links.length>0?e.links[0]:null;return a.jsx("div",{className:"ecr-preview-player",children:a.jsxs("div",{className:"ecr-preview-player__stage",children:[a.jsx(yt,{className:"ecr-player__nav--left ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Qt,{size:24})}),a.jsx(yt,{className:"ecr-player__nav--right ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(er,{size:24})}),a.jsxs("div",{className:"ecr-player__frame",style:{backgroundColor:c?"transparent":"#000"},children:[a.jsx("button",{type:"button",className:"ecr-player__close","aria-label":"Close preview",children:a.jsx(tr,{className:"ecr-player__close-icon"})}),r?a.jsx("div",{className:"ecr-player__media-frame",children:n?a.jsx("img",{src:r.url,alt:e?.title||"Reel preview",className:"ecr-preview-player__media-item",loading:"lazy"}):a.jsxs(a.Fragment,{children:[a.jsx("video",{style:{height:c?"100%":"auto"},ref:u,className:"ecr-preview-player__media-item",src:r.url,poster:e?.thumbnail,autoPlay:!0,muted:s,loop:!0,playsInline:!0,onClick:p,onLoadedMetadata:f=>{const h=f.currentTarget,_=h.videoWidth,v=h.videoHeight;d(()=>v>_)}}),a.jsxs("div",{className:"ecr-player__controls",children:[o?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:p}):a.jsx(qn,{size:20,className:"ecr-player__control-icon",onClick:p}),s?a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:m}):a.jsx(Yn,{size:20,className:"ecr-player__control-icon",onClick:m})]})]})}):a.jsx("div",{className:"ecr-preview-player__empty",children:"No preview available"})]}),g==="overlay"?b?a.jsx(Nn,{link:b,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title}):null,g==="title"?a.jsx(Bt,{title:e.title}):null]})})},Rb={carousel:hc,grid:Pb},Lb=({gid:e,reels:t,styles:r,handleRemoveReel:n,togglingId:o,currentTab:i})=>{const s=r.template??"carousel",l=Rb[s]||hc;return a.jsxs("div",{className:"ecr-admin-existing",children:[a.jsxs("div",{className:"ecr-admin-existing__header",children:[a.jsxs("div",{className:"ecr-admin-existing__title-wrapper",children:[a.jsx("p",{className:"ecr-admin-existing__title",children:"Attached videos"}),a.jsx("small",{className:"ecr-admin-existing__subtitle",children:"These reels will be shown in this reel widget"})]}),e&&a.jsx(Cb,{gid:e})]}),a.jsx("div",{style:{"--thumbnail-size":`${r?.size}px`,"--thumbnail-size-tab":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-tab":`${r?.gapOnTab??r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},className:"scrollbarThin ecr-admin-existing__body",children:i==="thumbnail"?a.jsx(l,{reels:t,styles:r,gid:e,togglingId:o,handleRemoveReel:n}):t.length>0?a.jsx(Ob,{reel:t[0],styles:r}):a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[a.jsx(ot,{style:{width:"40px",height:"40px",color:"#f59e0b"}}),"No reels available for preview."]})})]})},gc=()=>a.jsx("div",{className:"ecr-admin-reellist__loader",children:a.jsx("div",{className:"ecr-admin-reellist__spinner"})}),Ib=({gid:e,allReels:t,handleSelectReel:r,searchTerm:n,setSearchTerm:o,isSearching:i,togglingId:s,lastStoryElementRef:l})=>{const c=Ne(),{requestLeave:d}=pc(),u=`?view=${X.cr}&from=${X.mg}${e?`&gid=${e}`:""}`,p=t.filter(m=>!m?.files[0]?.mime_type.startsWith("image"));return a.jsxs("div",{className:"ecr-admin-reellist",children:[a.jsxs("div",{className:"ecr-admin-reellist__header",children:[a.jsx("p",{className:"ecr-admin-reellist__title",children:"All reels"}),a.jsx("small",{className:"ecr-admin-reellist__subtitle",children:"Choose reels to attach in this widget"})]}),a.jsxs("div",{className:"ecr-admin-reellist__body",children:[a.jsx(Lr,{to:u,text:"Add Reel",Icon:vt,className:"ecr-admin-reellist__add-button",textColor:"#2563eb",onNavigate:m=>d(()=>c(m))}),a.jsx("div",{className:"ecr-admin-reellist__search",children:a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:m=>o(m.target.value),className:"ecr-admin-reellist__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-reellist__grid",children:i&&t.length===0?a.jsx(gc,{}):a.jsxs("div",{className:"ecr-admin-reellist__items",children:[p.length===0?a.jsx("p",{className:"ecr-admin-reellist__empty",children:"No reels are available to add."}):p.map((m,g)=>a.jsx("div",{ref:p.length===g+1?l:null,className:"ecr-admin-reellist__item",children:a.jsxs("button",{title:"Click to add this reel",onClick:()=>r(m,"add"),disabled:s==m.story_uuid,className:"ecr-admin-reellist__card",children:[a.jsx("div",{className:"ecr-admin-reellist__media",children:a.jsx("video",{className:"ecr-admin-reellist__thumb",src:m?.files[0]?.url,poster:m?.thumbnail})}),a.jsx("span",{className:"ecr-admin-reellist__label",children:m.title||`Reel #${m.id}`}),s==m.story_uuid?a.jsx("div",{className:"ecr-admin-reellist__overlay",children:a.jsx(rt,{className:"ecr-admin-reellist__overlay-icon"})}):null]})},m.id)),i&&t.length>0&&a.jsx(gc,{})]})})]})]})};function xc(e){const t=e+"CollectionProvider",[r,n]=Ve(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=f=>{const{scope:h,children:_}=f,v=y.useRef(null),w=y.useRef(new Map).current;return a.jsx(o,{scope:h,itemMap:w,collectionRef:v,children:_})};s.displayName=t;const l=e+"CollectionSlot",c=nt(l),d=y.forwardRef((f,h)=>{const{scope:_,children:v}=f,w=i(l,_),j=J(h,w.collectionRef);return a.jsx(c,{ref:j,children:v})});d.displayName=l;const u=e+"CollectionItemSlot",p="data-radix-collection-item",m=nt(u),g=y.forwardRef((f,h)=>{const{scope:_,children:v,...w}=f,j=y.useRef(null),C=J(h,j),N=i(u,_);return y.useEffect(()=>(N.itemMap.set(j,{ref:j,...w}),()=>void N.itemMap.delete(j))),a.jsx(m,{[p]:"",ref:C,children:v})});g.displayName=u;function b(f){const h=i(e+"CollectionConsumer",f);return y.useCallback(()=>{const v=h.collectionRef.current;if(!v)return[];const w=Array.from(v.querySelectorAll(`[${p}]`));return Array.from(h.itemMap.values()).sort((N,k)=>w.indexOf(N.ref.current)-w.indexOf(k.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:s,Slot:d,ItemSlot:g},b,n]}var zb=x.createContext(void 0);function ra(e){const t=x.useContext(zb);return e||t||"ltr"}var na="rovingFocusGroup.onEntryFocus",Mb={bubbles:!1,cancelable:!0},gr="RovingFocusGroup",[oa,bc,Db]=xc(gr),[Fb,_c]=Ve(gr,[Db]),[$b,Bb]=Fb(gr),vc=x.forwardRef((e,t)=>a.jsx(oa.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(oa.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Ub,{...e,ref:t})})}));vc.displayName=gr;var Ub=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...p}=e,m=x.useRef(null),g=J(t,m),b=ra(i),[f,h]=ct({prop:s,defaultProp:l??null,onChange:c,caller:gr}),[_,v]=x.useState(!1),w=We(d),j=bc(r),C=x.useRef(!1),[N,k]=x.useState(0);return x.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(na,w),()=>E.removeEventListener(na,w)},[w]),a.jsx($b,{scope:r,orientation:n,dir:b,loop:o,currentTabStopId:f,onItemFocus:x.useCallback(E=>h(E),[h]),onItemShiftTab:x.useCallback(()=>v(!0),[]),onFocusableItemAdd:x.useCallback(()=>k(E=>E+1),[]),onFocusableItemRemove:x.useCallback(()=>k(E=>E-1),[]),children:a.jsx(W.div,{tabIndex:_||N===0?-1:0,"data-orientation":n,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:V(e.onMouseDown,()=>{C.current=!0}),onFocus:V(e.onFocus,E=>{const T=!C.current;if(E.target===E.currentTarget&&T&&!_){const A=new CustomEvent(na,Mb);if(E.currentTarget.dispatchEvent(A),!A.defaultPrevented){const O=j().filter(I=>I.focusable),R=O.find(I=>I.active),L=O.find(I=>I.id===f),M=[R,L,...O].filter(Boolean).map(I=>I.ref.current);jc(M,u)}}C.current=!1}),onBlur:V(e.onBlur,()=>v(!1))})})}),yc="RovingFocusGroupItem",wc=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:i,children:s,...l}=e,c=Ae(),d=i||c,u=Bb(yc,r),p=u.currentTabStopId===d,m=bc(r),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:f}=u;return x.useEffect(()=>{if(n)return g(),()=>b()},[n,g,b]),a.jsx(oa.ItemSlot,{scope:r,id:d,focusable:n,active:o,children:a.jsx(W.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:V(e.onMouseDown,h=>{n?u.onItemFocus(d):h.preventDefault()}),onFocus:V(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:V(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){u.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const _=Wb(h,u.orientation,u.dir);if(_!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let w=m().filter(j=>j.focusable).map(j=>j.ref.current);if(_==="last")w.reverse();else if(_==="prev"||_==="next"){_==="prev"&&w.reverse();const j=w.indexOf(h.currentTarget);w=u.loop?qb(w,j+1):w.slice(j+1)}setTimeout(()=>jc(w))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:f!=null}):s})})});wc.displayName=yc;var Hb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Vb(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Wb(e,t,r){const n=Vb(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Hb[n]}function jc(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function qb(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Gb=vc,Kb=wc,En="Tabs",[Yb]=Ve(En,[_c]),Sc=_c(),[Xb,aa]=Yb(En),Cc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=ra(l),[p,m]=ct({prop:n,onChange:o,defaultProp:i??"",caller:En});return a.jsx(Xb,{scope:r,baseId:Ae(),value:p,onValueChange:m,orientation:s,dir:u,activationMode:c,children:a.jsx(W.div,{dir:u,"data-orientation":s,...d,ref:t})})});Cc.displayName=En;var kc="TabsList",Nc=x.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,i=aa(kc,r),s=Sc(r);return a.jsx(Gb,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:n,children:a.jsx(W.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});Nc.displayName=kc;var Ec="TabsTrigger",Tc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...i}=e,s=aa(Ec,r),l=Sc(r),c=Oc(s.baseId,n),d=Rc(s.baseId,n),u=n===s.value;return a.jsx(Kb,{asChild:!0,...l,focusable:!o,active:u,children:a.jsx(W.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...i,ref:t,onMouseDown:V(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?s.onValueChange(n):p.preventDefault()}),onKeyDown:V(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&s.onValueChange(n)}),onFocus:V(e.onFocus,()=>{const p=s.activationMode!=="manual";!u&&!o&&p&&s.onValueChange(n)})})})});Tc.displayName=Ec;var Ac="TabsContent",Pc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:i,...s}=e,l=aa(Ac,r),c=Oc(l.baseId,n),d=Rc(l.baseId,n),u=n===l.value,p=x.useRef(u);return x.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(Ye,{present:o||u,children:({present:m})=>a.jsx(W.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&i})})});Pc.displayName=Ac;function Oc(e,t){return`${e}-trigger-${t}`}function Rc(e,t){return`${e}-content-${t}`}var Jb=Cc,Zb=Nc,Qb=Tc,e_=Pc;function t_({className:e,...t}){return a.jsx(Jb,{"data-slot":"tabs",className:F("ecr-tabs",e),...t})}function r_({className:e,...t}){return a.jsx(Zb,{"data-slot":"tabs-list",className:F("ecr-tabs__list",e),...t})}function Lc({className:e,...t}){return a.jsx(Qb,{"data-slot":"tabs-trigger",className:F("ecr-tabs__trigger",e),...t})}function Ic({className:e,...t}){return a.jsx(e_,{"data-slot":"tabs-content",className:F("ecr-tabs__content",e),...t})}const xr=({label:e,text:t})=>a.jsxs(dt,{children:[a.jsx(ut,{style:{textAlign:"left",padding:0,backgroundColor:"transparent"},children:a.jsxs("label",{className:"ecr-admin-switch",children:[a.jsxs("span",{className:"ecr-admin-switch__label",children:[e,": ",a.jsx(_t,{size:20})]}),a.jsx(X0,{className:"ecr-admin-switch__icon",size:24})]})}),a.jsx(pt,{className:"ecr-admin-popover",children:a.jsx(Mt,{name:e,text:t})})]});function zc(e,[t,r]){return Math.min(r,Math.max(t,e))}function n_(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Mc=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),o_="VisuallyHidden",a_=x.forwardRef((e,t)=>a.jsx(W.span,{...e,ref:t,style:{...Mc,...e.style}}));a_.displayName=o_;var i_=[" ","Enter","ArrowUp","ArrowDown"],s_=[" ","Enter"],ft="Select",[Tn,An,l_]=xc(ft),[Ut]=Ve(ft,[l_,an]),Pn=an(),[c_,Ze]=Ut(ft),[d_,u_]=Ut(ft),Dc=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:p,disabled:m,required:g,form:b}=e,f=Pn(t),[h,_]=x.useState(null),[v,w]=x.useState(null),[j,C]=x.useState(!1),N=ra(d),[k,E]=ct({prop:n,defaultProp:o??!1,onChange:i,caller:ft}),[T,A]=ct({prop:s,defaultProp:l,onChange:c,caller:ft}),O=x.useRef(null),R=h?b||!!h.closest("form"):!0,[L,P]=x.useState(new Set),M=Array.from(L).map(I=>I.props.value).join(";");return a.jsx(Gs,{...f,children:a.jsxs(c_,{required:g,scope:t,trigger:h,onTriggerChange:_,valueNode:v,onValueNodeChange:w,valueNodeHasChildren:j,onValueNodeHasChildrenChange:C,contentId:Ae(),value:T,onValueChange:A,open:k,onOpenChange:E,dir:N,triggerPointerDownPosRef:O,disabled:m,children:[a.jsx(Tn.Provider,{scope:t,children:a.jsx(d_,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(I=>{P(B=>new Set(B).add(I))},[]),onNativeOptionRemove:x.useCallback(I=>{P(B=>{const z=new Set(B);return z.delete(I),z})},[]),children:r})}),R?a.jsxs(id,{"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:p,value:T,onChange:I=>A(I.target.value),disabled:m,form:b,children:[T===void 0?a.jsx("option",{value:""}):null,Array.from(L)]},M):null]})})};Dc.displayName=ft;var Fc="SelectTrigger",$c=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=Pn(r),s=Ze(Fc,r),l=s.disabled||n,c=J(t,s.onTriggerChange),d=An(r),u=x.useRef("touch"),[p,m,g]=ld(f=>{const h=d().filter(w=>!w.disabled),_=h.find(w=>w.value===s.value),v=cd(h,f,_);v!==void 0&&s.onValueChange(v.value)}),b=f=>{l||(s.onOpenChange(!0),g()),f&&(s.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return a.jsx(Ro,{asChild:!0,...i,children:a.jsx(W.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":sd(s.value)?"":void 0,...o,ref:c,onClick:V(o.onClick,f=>{f.currentTarget.focus(),u.current!=="mouse"&&b(f)}),onPointerDown:V(o.onPointerDown,f=>{u.current=f.pointerType;const h=f.target;h.hasPointerCapture(f.pointerId)&&h.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&f.pointerType==="mouse"&&(b(f),f.preventDefault())}),onKeyDown:V(o.onKeyDown,f=>{const h=p.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&m(f.key),!(h&&f.key===" ")&&i_.includes(f.key)&&(b(),f.preventDefault())})})})});$c.displayName=Fc;var Bc="SelectValue",Uc=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...l}=e,c=Ze(Bc,r),{onValueNodeHasChildrenChange:d}=c,u=i!==void 0,p=J(t,c.onValueNodeChange);return ce(()=>{d(u)},[d,u]),a.jsx(W.span,{...l,ref:p,style:{pointerEvents:"none"},children:sd(c.value)?a.jsx(a.Fragment,{children:s}):i})});Uc.displayName=Bc;var p_="SelectIcon",Hc=x.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return a.jsx(W.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Hc.displayName=p_;var m_="SelectPortal",Vc=e=>a.jsx(sn,{asChild:!0,...e});Vc.displayName=m_;var ht="SelectContent",Wc=x.forwardRef((e,t)=>{const r=Ze(ht,e.__scopeSelect),[n,o]=x.useState();if(ce(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?_r.createPortal(a.jsx(qc,{scope:e.__scopeSelect,children:a.jsx(Tn.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(Gc,{...e,ref:t})});Wc.displayName=ht;var ke=10,[qc,Qe]=Ut(ht),f_="SelectContentImpl",h_=nt("SelectContent.RemoveScroll"),Gc=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h,..._}=e,v=Ze(ht,r),[w,j]=x.useState(null),[C,N]=x.useState(null),k=J(t,$=>j($)),[E,T]=x.useState(null),[A,O]=x.useState(null),R=An(r),[L,P]=x.useState(!1),M=x.useRef(!1);x.useEffect(()=>{if(w)return Io(w)},[w]),xo();const I=x.useCallback($=>{const[Y,...oe]=R().map(re=>re.ref.current),[Z]=oe.slice(-1),Q=document.activeElement;for(const re of $)if(re===Q||(re?.scrollIntoView({block:"nearest"}),re===Y&&C&&(C.scrollTop=0),re===Z&&C&&(C.scrollTop=C.scrollHeight),re?.focus(),document.activeElement!==Q))return},[R,C]),B=x.useCallback(()=>I([E,w]),[I,E,w]);x.useEffect(()=>{L&&B()},[L,B]);const{onOpenChange:z,triggerPointerDownPosRef:q}=v;x.useEffect(()=>{if(w){let $={x:0,y:0};const Y=Z=>{$={x:Math.abs(Math.round(Z.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(Z.pageY)-(q.current?.y??0))}},oe=Z=>{$.x<=10&&$.y<=10?Z.preventDefault():w.contains(Z.target)||z(!1),document.removeEventListener("pointermove",Y),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",Y),document.addEventListener("pointerup",oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",oe,{capture:!0})}}},[w,z,q]),x.useEffect(()=>{const $=()=>z(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[z]);const[ae,ie]=ld($=>{const Y=R().filter(Q=>!Q.disabled),oe=Y.find(Q=>Q.ref.current===document.activeElement),Z=cd(Y,$,oe);Z&&setTimeout(()=>Z.ref.current.focus())}),ge=x.useCallback(($,Y,oe)=>{const Z=!M.current&&!oe;(v.value!==void 0&&v.value===Y||Z)&&(T($),Z&&(M.current=!0))},[v.value]),_e=x.useCallback(()=>w?.focus(),[w]),pe=x.useCallback(($,Y,oe)=>{const Z=!M.current&&!oe;(v.value!==void 0&&v.value===Y||Z)&&O($)},[v.value]),G=n==="popper"?ia:Kc,de=G===ia?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h}:{};return a.jsx(qc,{scope:r,content:w,viewport:C,onViewportChange:N,itemRefCallback:ge,selectedItem:E,onItemLeave:_e,itemTextRefCallback:pe,focusSelectedItem:B,selectedItemText:A,position:n,isPositioned:L,searchRef:ae,children:a.jsx(gn,{as:h_,allowPinchZoom:!0,children:a.jsx(Kr,{asChild:!0,trapped:v.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:V(o,$=>{v.trigger?.focus({preventScroll:!0}),$.preventDefault()}),children:a.jsx(Gr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:a.jsx(G,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:$=>$.preventDefault(),..._,...de,onPlaced:()=>P(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:V(_.onKeyDown,$=>{const Y=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!Y&&$.key.length===1&&ie($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let Z=R().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes($.key)&&(Z=Z.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const Q=$.target,re=Z.indexOf(Q);Z=Z.slice(re+1)}setTimeout(()=>I(Z)),$.preventDefault()}})})})})})})});Gc.displayName=f_;var g_="SelectItemAlignedPosition",Kc=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=Ze(ht,r),s=Qe(ht,r),[l,c]=x.useState(null),[d,u]=x.useState(null),p=J(t,k=>u(k)),m=An(r),g=x.useRef(!1),b=x.useRef(!0),{viewport:f,selectedItem:h,selectedItemText:_,focusSelectedItem:v}=s,w=x.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&f&&h&&_){const k=i.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),T=i.valueNode.getBoundingClientRect(),A=_.getBoundingClientRect();if(i.dir!=="rtl"){const Q=A.left-E.left,re=T.left-Q,ve=k.left-re,gt=k.width+ve,ga=Math.max(gt,E.width),xa=window.innerWidth-ke,ba=zc(re,[ke,Math.max(ke,xa-ga)]);l.style.minWidth=gt+"px",l.style.left=ba+"px"}else{const Q=E.right-A.right,re=window.innerWidth-T.right-Q,ve=window.innerWidth-k.right-re,gt=k.width+ve,ga=Math.max(gt,E.width),xa=window.innerWidth-ke,ba=zc(re,[ke,Math.max(ke,xa-ga)]);l.style.minWidth=gt+"px",l.style.right=ba+"px"}const O=m(),R=window.innerHeight-ke*2,L=f.scrollHeight,P=window.getComputedStyle(d),M=parseInt(P.borderTopWidth,10),I=parseInt(P.paddingTop,10),B=parseInt(P.borderBottomWidth,10),z=parseInt(P.paddingBottom,10),q=M+I+L+z+B,ae=Math.min(h.offsetHeight*5,q),ie=window.getComputedStyle(f),ge=parseInt(ie.paddingTop,10),_e=parseInt(ie.paddingBottom,10),pe=k.top+k.height/2-ke,G=R-pe,de=h.offsetHeight/2,$=h.offsetTop+de,Y=M+I+$,oe=q-Y;if(Y<=pe){const Q=O.length>0&&h===O[O.length-1].ref.current;l.style.bottom="0px";const re=d.clientHeight-f.offsetTop-f.offsetHeight,ve=Math.max(G,de+(Q?_e:0)+re+B),gt=Y+ve;l.style.height=gt+"px"}else{const Q=O.length>0&&h===O[0].ref.current;l.style.top="0px";const ve=Math.max(pe,M+f.offsetTop+(Q?ge:0)+de)+oe;l.style.height=ve+"px",f.scrollTop=Y-pe+f.offsetTop}l.style.margin=`${ke}px 0`,l.style.minHeight=ae+"px",l.style.maxHeight=R+"px",n?.(),requestAnimationFrame(()=>g.current=!0)}},[m,i.trigger,i.valueNode,l,d,f,h,_,i.dir,n]);ce(()=>w(),[w]);const[j,C]=x.useState();ce(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);const N=x.useCallback(k=>{k&&b.current===!0&&(w(),v?.(),b.current=!1)},[w,v]);return a.jsx(b_,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:N,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:a.jsx(W.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Kc.displayName=g_;var x_="SelectPopperPosition",ia=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=ke,...i}=e,s=Pn(r);return a.jsx(Ks,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ia.displayName=x_;var[b_,sa]=Ut(ht,{}),la="SelectViewport",Yc=x.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=Qe(la,r),s=sa(la,r),l=J(t,i.onViewportChange),c=x.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),a.jsx(Tn.Slot,{scope:r,children:a.jsx(W.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:V(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=s;if(m?.current&&p){const g=Math.abs(c.current-u.scrollTop);if(g>0){const b=window.innerHeight-ke*2,f=parseFloat(p.style.minHeight),h=parseFloat(p.style.height),_=Math.max(f,h);if(_<b){const v=_+g,w=Math.min(b,v),j=v-w;p.style.height=w+"px",p.style.bottom==="0px"&&(u.scrollTop=j>0?j:0,p.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Yc.displayName=la;var Xc="SelectGroup",[__,v_]=Ut(Xc),y_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ae();return a.jsx(__,{scope:r,id:o,children:a.jsx(W.div,{role:"group","aria-labelledby":o,...n,ref:t})})});y_.displayName=Xc;var Jc="SelectLabel",w_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=v_(Jc,r);return a.jsx(W.div,{id:o.id,...n,ref:t})});w_.displayName=Jc;var On="SelectItem",[j_,Zc]=Ut(On),Qc=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,l=Ze(On,r),c=Qe(On,r),d=l.value===n,[u,p]=x.useState(i??""),[m,g]=x.useState(!1),b=J(t,v=>c.itemRefCallback?.(v,n,o)),f=Ae(),h=x.useRef("touch"),_=()=>{o||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(j_,{scope:r,value:n,disabled:o,textId:f,isSelected:d,onItemTextChange:x.useCallback(v=>{p(w=>w||(v?.textContent??"").trim())},[]),children:a.jsx(Tn.ItemSlot,{scope:r,value:n,disabled:o,textValue:u,children:a.jsx(W.div,{role:"option","aria-labelledby":f,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:b,onFocus:V(s.onFocus,()=>g(!0)),onBlur:V(s.onBlur,()=>g(!1)),onClick:V(s.onClick,()=>{h.current!=="mouse"&&_()}),onPointerUp:V(s.onPointerUp,()=>{h.current==="mouse"&&_()}),onPointerDown:V(s.onPointerDown,v=>{h.current=v.pointerType}),onPointerMove:V(s.onPointerMove,v=>{h.current=v.pointerType,o?c.onItemLeave?.():h.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:V(s.onPointerLeave,v=>{v.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:V(s.onKeyDown,v=>{c.searchRef?.current!==""&&v.key===" "||(s_.includes(v.key)&&_(),v.key===" "&&v.preventDefault())})})})})});Qc.displayName=On;var br="SelectItemText",ed=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=Ze(br,r),l=Qe(br,r),c=Zc(br,r),d=u_(br,r),[u,p]=x.useState(null),m=J(t,_=>p(_),c.onItemTextChange,_=>l.itemTextRefCallback?.(_,c.value,c.disabled)),g=u?.textContent,b=x.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:f,onNativeOptionRemove:h}=d;return ce(()=>(f(b),()=>h(b)),[f,h,b]),a.jsxs(a.Fragment,{children:[a.jsx(W.span,{id:c.textId,...i,ref:m}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?_r.createPortal(i.children,s.valueNode):null]})});ed.displayName=br;var td="SelectItemIndicator",rd=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Zc(td,r).isSelected?a.jsx(W.span,{"aria-hidden":!0,...n,ref:t}):null});rd.displayName=td;var ca="SelectScrollUpButton",nd=x.forwardRef((e,t)=>{const r=Qe(ca,e.__scopeSelect),n=sa(ca,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return ce(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollTop>0;i(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});nd.displayName=ca;var da="SelectScrollDownButton",od=x.forwardRef((e,t)=>{const r=Qe(da,e.__scopeSelect),n=sa(da,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return ce(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;i(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});od.displayName=da;var ad=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=Qe("SelectScrollButton",r),s=x.useRef(null),l=An(r),c=x.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return x.useEffect(()=>()=>c(),[c]),ce(()=>{l().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),a.jsx(W.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:V(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:V(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:V(o.onPointerLeave,()=>{c()})})}),S_="SelectSeparator",C_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(W.div,{"aria-hidden":!0,...n,ref:t})});C_.displayName=S_;var ua="SelectArrow",k_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Pn(r),i=Ze(ua,r),s=Qe(ua,r);return i.open&&s.position==="popper"?a.jsx(Ys,{...o,...n,ref:t}):null});k_.displayName=ua;var N_="SelectBubbleInput",id=x.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=x.useRef(null),i=J(n,o),s=n_(t);return x.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(s!==t&&u){const p=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(p)}},[s,t]),a.jsx(W.select,{...r,style:{...Mc,...r.style},ref:i,defaultValue:t})});id.displayName=N_;function sd(e){return e===""||e===void 0}function ld(e){const t=We(e),r=x.useRef(""),n=x.useRef(0),o=x.useCallback(s=>{const l=r.current+s;t(l),(function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),i=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function cd(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=E_(e,Math.max(i,0));o.length===1&&(s=s.filter(d=>d!==r));const c=s.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function E_(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var T_=Dc,A_=$c,P_=Uc,O_=Hc,R_=Vc,L_=Wc,I_=Yc,z_=Qc,M_=ed,D_=rd,F_=nd,$_=od;function Ht({...e}){return a.jsx(T_,{"data-slot":"select",...e})}function Vt({...e}){return a.jsx(P_,{"data-slot":"select-value",...e})}function Wt({className:e,size:t="default",children:r,...n}){return a.jsxs(A_,{"data-slot":"select-trigger","data-size":t,className:F("ecr-select__trigger",e),...n,children:[r,a.jsx(O_,{asChild:!0,children:a.jsx(fo,{className:"ecr-select__icon"})})]})}function qt({className:e,children:t,position:r="popper",align:n="center",...o}){const i=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(R_,{container:i,children:a.jsxs(L_,{"data-slot":"select-content",className:F("ecr-select__content",e),position:r,align:n,...o,children:[a.jsx(B_,{}),a.jsx(I_,{className:F("ecr-select__viewport"),children:t}),a.jsx(U_,{})]})})}function Gt({className:e,children:t,...r}){return a.jsxs(z_,{"data-slot":"select-item",className:F("ecr-select__item",e),...r,children:[a.jsx("span",{className:"ecr-select__check",children:a.jsx(D_,{children:a.jsx(Df,{className:"ecr-select__check-icon"})})}),a.jsx(M_,{children:t})]})}function B_({className:e,...t}){return a.jsx(F_,{"data-slot":"select-scroll-up-button",className:F("ecr-select__scroll-button",e),...t,children:a.jsx(Ff,{className:"ecr-select__icon"})})}function U_({className:e,...t}){return a.jsx($_,{"data-slot":"select-scroll-down-button",className:F("ecr-select__scroll-button",e),...t,children:a.jsx(fo,{className:"ecr-select__icon"})})}const H_=({appearance:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsx(qt,{children:Yu.map(r=>a.jsx(Gt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),V_={vertical:a.jsx(a.Fragment,{children:"Offer a mobile-first experience with vertical scroll Reels in your widget for better engagement and infinite scrolling!"})};function W_(){return a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Slide Direction:"}),a.jsxs(Ht,{defaultValue:Za[0].value,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsxs(qt,{children:[Za.map(e=>a.jsx(Gt,{value:e.value,className:"ecr-admin-control__option",children:e.label},e.value)),qu.map(e=>a.jsx("div",{children:a.jsxs(dt,{modal:!0,children:[a.jsxs(ut,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:e.label}),a.jsx(_t,{size:18})]}),a.jsx(pt,{className:"ecr-admin-control__popover",children:a.jsx(Mt,{name:e.label,text:V_[e.value]})})]})},e.value))]})]})]})}const q_=({styles:e,updateStyles:t})=>a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(xr,{label:"Disable Preview",text:a.jsx(a.Fragment,{children:"Turn off previews for a cleaner look and a more focused browsing experience!"})}),a.jsx(W_,{}),a.jsx(H_,{appearance:e?.playerAppearance??"overlay",handleLinkLayout:r=>t(n=>({...n,playerAppearance:r}))})]});var Rn="Collapsible",[G_]=Ve(Rn),[K_,pa]=G_(Rn),dd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:i,onOpenChange:s,...l}=e,[c,d]=ct({prop:n,defaultProp:o??!1,onChange:s,caller:Rn});return a.jsx(K_,{scope:r,disabled:i,contentId:Ae(),open:c,onOpenToggle:x.useCallback(()=>d(u=>!u),[d]),children:a.jsx(W.div,{"data-state":fa(c),"data-disabled":i?"":void 0,...l,ref:t})})});dd.displayName=Rn;var ud="CollapsibleTrigger",pd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=pa(ud,r);return a.jsx(W.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":fa(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:V(e.onClick,o.onOpenToggle)})});pd.displayName=ud;var ma="CollapsibleContent",md=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=pa(ma,e.__scopeCollapsible);return a.jsx(Ye,{present:r||o.open,children:({present:i})=>a.jsx(Y_,{...n,ref:t,present:i})})});md.displayName=ma;var Y_=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...i}=e,s=pa(ma,r),[l,c]=x.useState(n),d=x.useRef(null),u=J(t,d),p=x.useRef(0),m=p.current,g=x.useRef(0),b=g.current,f=s.open||l,h=x.useRef(f),_=x.useRef(void 0);return x.useEffect(()=>{const v=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(v)},[]),ce(()=>{const v=d.current;if(v){_.current=_.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();p.current=w.height,g.current=w.width,h.current||(v.style.transitionDuration=_.current.transitionDuration,v.style.animationName=_.current.animationName),c(n)}},[s.open,n]),a.jsx(W.div,{"data-state":fa(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!f,...i,ref:u,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:f&&o})});function fa(e){return e?"open":"closed"}var X_=dd,J_=pd,Z_=md;function fd({className:e,...t}){return a.jsx(X_,{"data-slot":"collapsible",className:F("ecr-collapsible",e),...t})}function hd({className:e,children:t,...r}){return a.jsxs(J_,{"data-slot":"collapsible-trigger",className:F("ecr-collapsible__trigger",e),...r,children:[a.jsx("span",{className:"ecr-collapsible__trigger-label",children:t}),a.jsx(fo,{className:"ecr-collapsible__trigger-icon"})]})}function gd({className:e,...t}){return a.jsx(Z_,{"data-slot":"collapsible-content",className:F("ecr-collapsible__content",e),...t})}const Q_={modern:a.jsx(a.Fragment,{children:"Give your reel’s product card a sleek, modern appearance that feels fresh, clean, and visually engaging."}),classic:a.jsx(a.Fragment,{children:"Give your reel’s product card a timeless, classic appearance that feels familiar, simple, and easy to recognize."})},ev=({linkLayout:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsxs(qt,{children:[Gu.map(r=>a.jsx(Gt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value)),Ku.map(r=>a.jsx("div",{children:a.jsxs(dt,{modal:!0,children:[a.jsxs(ut,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r.label}),a.jsx(_t,{size:18})]}),a.jsx(pt,{className:"ecr-admin-control__popover",children:a.jsx(Mt,{name:r.label,text:Q_[r.value]})})]})},r.value))]})]})]}),tv=[{Icon:Wf,label:"Desktop",value:"desktop"},{Icon:Xf,label:"Tab",value:"tab"},{Icon:Gf,label:"Mobile",value:"mobile"}],xd=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:c,device:d,setDevice:u})=>{const[p,m]=y.useState(n),g=y.useRef(null);y.useEffect(()=>{m(n)},[n]);const b=h=>{const _=Math.min(r,Math.max(t,Number(h)));o(_)},f=h=>{const _=Number(h);m(_),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{b(_>r?r:_<t?t:_)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":",a.jsxs(Ht,{value:d,onValueChange:h=>u(h),children:[a.jsx(Wt,{style:{padding:"4px 4px 0px",height:"24px",gap:"4px"},children:a.jsx(Vt,{})}),a.jsx(qt,{style:{minWidth:"60px"},children:tv.map(h=>a.jsx(Gt,{value:h.value,title:h.label,children:a.jsx(h.Icon,{size:16})},h.value))})]})]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:h=>{const _=Number(h.target.value);m(_),b(_)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(Jo,{type:"number",min:t,max:r,value:p,onChange:h=>f(h.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})},rv=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("desktop"),i={mobile:e?.gapOnMobile,tab:e?.gapOnTab,desktop:e?.gap}[r]??e?.gap,s=l=>{switch(r){case"mobile":t(c=>({...c,gapOnMobile:l}));break;case"tab":t(c=>({...c,gapOnTab:l}));break;default:t(c=>({...c,gap:l}));break}};return a.jsx(xd,{label:"Gap",min:0,max:80,value:i,onChange:s,name:"column_gap",id:"column-gap",device:r,setDevice:n})},nv=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("desktop"),i={mobile:e?.sizeOnMobile,tab:e?.sizeOnTab,desktop:e?.size}[r]??e?.size,s=l=>{switch(r){case"mobile":t(c=>({...c,sizeOnMobile:l}));break;case"tab":t(c=>({...c,sizeOnTab:l}));break;default:t(c=>({...c,size:l}));break}};return a.jsx(xd,{label:"Size",min:150,max:400,value:i,onChange:s,name:"size",id:"size",device:r,setDevice:n})},ov=[{value:"rectangle",label:"Rectangle"},{value:"circle",label:"Circle"}],av=({selectedShape:e,handleShape:t})=>{const r=n=>{t(n.target.id)};return a.jsxs("div",{className:"ecr-admin-control",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Shape:"}),a.jsx("div",{className:"ecr-admin-control__row",children:ov.map(n=>a.jsxs("div",{className:"ecr-admin-control__choice",children:[a.jsx("input",{type:"radio",name:"shape",id:n.value,checked:e===n.value,onChange:r,style:{display:"none"}}),a.jsxs("label",{className:"ecr-admin-control__choice-label",htmlFor:n.value,children:[e===n.value?a.jsx(Gp,{color:"#2563eb",size:16}):a.jsx(Kp,{color:"#8c95a9",size:16}),n.label]})]},n.value))})]})},iv=Object.values(Ja),sv={marquee:a.jsx(a.Fragment,{children:"Create infinite, auto-scrolling video playlists with the Marquee layout template for endless engagement!"}),stacked:a.jsx(a.Fragment,{children:"Display Reels in a stacked layout for an interactive and shopable video experience!"})},lv=({selectedLayout:e,handleLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Template:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsxs(qt,{children:[iv.map(r=>a.jsx(Gt,{value:r,className:"ecr-admin-control__option",children:r},r)),Vu.map(r=>a.jsx("div",{children:a.jsxs(dt,{modal:!0,children:[a.jsxs(ut,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r}),a.jsx(_t,{size:18})]}),a.jsx(pt,{className:"ecr-admin-control__popover",children:a.jsx(Mt,{name:r,text:sv[r]})})]})},r))]})]})]}),cv=({isLayoutOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(fd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(hd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("layout"),children:[a.jsx(Uf,{size:16})," ",a.jsx("span",{children:"Layout"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(av,{selectedShape:r?.shape,handleShape:o=>n(i=>({...i,shape:o}))}),a.jsx(lv,{selectedLayout:r?.template??"carousel",handleLayout:o=>n(i=>({...i,template:o}))}),a.jsx(ev,{linkLayout:r?.appearance??"overlay",handleLinkLayout:o=>n(i=>({...i,appearance:o}))}),a.jsx(nv,{styles:r,updateStyles:n}),a.jsx(rv,{styles:r,updateStyles:n}),a.jsx(xr,{label:"Show Views",text:a.jsx(a.Fragment,{children:"Hide view counts to remove distractions and provide a cleaner, more focused visual experience!"})}),a.jsx(xr,{label:"Autoplay",text:a.jsx(a.Fragment,{children:"Enable autoplay for videos on your product and pages, capturing users' attention instantly!"})}),a.jsx(xr,{label:"Show Add to Cart",text:a.jsx(a.Fragment,{children:"Show a clear “Add to Cart” button on your tagged product to encourage quick purchases and boost conversions."})}),a.jsx(xr,{label:"Drag to Sort",text:a.jsx(a.Fragment,{children:"Easily rearrange your best-performing Reels to keep your content fresh and in the right order!"})})]})]}),dv=({hoverEffect:e,handleHoverEffect:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Hove Effect:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsx(qt,{children:Wu.map(r=>a.jsx(Gt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),uv=({isStyleOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(fd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(hd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("style"),children:[a.jsx(qf,{size:16}),a.jsx("span",{children:"Styles"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(Zo,{label:"Border Width",min:0,max:12,value:r?.border?.border_width??0,onChange:o=>n(i=>({...i,border:{...i.border,border_width:o}})),name:"border_width",id:"border-width"}),a.jsx(dc,{selectedColor:r?.border?.border_color,handleColor:o=>n(i=>({...i,border:{...i.border,border_color:o}})),text:"Border Color"}),r?.shape==="rectangle"&&a.jsx(Zo,{label:"Border Radius",min:0,max:99,value:r?.border?.border_radius??0,onChange:o=>n(i=>({...i,border:{...i.border,border_radius:o}})),name:"border_radius",id:"border-radius"}),a.jsx(dv,{hoverEffect:r?.hoverEffect||"none",handleHoverEffect:o=>n(i=>({...i,hoverEffect:o}))})]})]}),pv=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("layout"),o=r==="layout",i=r==="style",s=l=>{n(r!==l?l:null)};return a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(cv,{handleSectionOpen:s,isLayoutOpen:o,styles:e,updateStyles:t}),a.jsx(uv,{isStyleOpen:i,handleSectionOpen:s,styles:e,updateStyles:t})]})},mv=({styles:e,setStyles:t,isExpanded:r,setIsExpanded:n,setIsEdited:o,tabs:i,currentTab:s,setCurrentTab:l})=>{const c=u=>{t(p=>{const m=u(p);return o(!0),m})},d=u=>{(u===i.thumbnail||u===i.preview)&&l(u)};return a.jsxs("div",{className:F("ecr-admin-sidepanel",r?"ecr-admin-sidepanel--expanded":"ecr-admin-sidepanel--collapsed"),children:[r&&a.jsx("div",{className:"ecr-admin-mobile-overlay",onClick:()=>n(!1)}),a.jsxs("div",{className:"ecr-admin-sidepanel-content",children:[a.jsxs("div",{className:"ecr-admin-sidepanel__header",children:[a.jsx("p",{className:"ecr-admin-sidepanel__title",children:"Customization"}),a.jsx("small",{className:"ecr-admin-sidepanel__subtitle",children:"Customize your widget however you like"})]}),a.jsx("div",{className:"ecr-admin-sidepanel__body",children:a.jsxs(t_,{value:s,onValueChange:d,className:"ecr-admin-sidepanel__tabs",children:[a.jsxs(r_,{className:"ecr-admin-sidepanel__tabs-list",children:[a.jsx(Lc,{value:i.thumbnail,children:"Thumbnail"}),a.jsx(Lc,{value:i.preview,children:"Preview"})]}),a.jsx(Ic,{value:i.thumbnail,children:a.jsx(pv,{styles:e,updateStyles:c})}),a.jsx(Ic,{value:i.preview,children:a.jsx(q_,{styles:e,updateStyles:c})})]})})]})]})},fv=e=>{const t=Ne(),[r,n]=y.useState(""),[o,i]=y.useState([]),[s,l]=y.useState(tt),[c,d]=y.useState(!0),[u,p]=y.useState(!1),[m,g]=y.useState(!1);y.useEffect(()=>{(async()=>{if(!e){d(!1);return}d(!0);try{const v=(await he.get(`stories/${e}`)).data;n(v.group_name),i(v.stories),l(v.styles??tt)}catch(_){_ instanceof Error?K.error(_.message):K.error("Something went wrong. Try again later!")}finally{d(!1)}})()},[e]);const b=async h=>{const _=o.map(j=>j.id),v={group_name:r,styles:s,story_ids:_};e&&(v.group_id=e);const w=await he.post("stories/manage-group-stories",v);if(!e){const j=w.data.group_id;t(`?view=${X.mg}&gid=${j}`,{replace:!0})}return{...w.data,isNewGroup:!e}};return{groupTitle:r,setGroupTitle:n,thisGroupReels:o,setThisGroupReels:i,styles:s,setStyles:l,isLoading:c,isSaving:u,isEdited:m,setIsEdited:g,handleSave:async()=>{try{p(!0);const h=await b();return g(!1),K.success("Changes saved successfully!"),h}catch(h){return h instanceof Error?K.error(h.message):K.error("Something went wrong. Try again later!"),null}finally{p(!1)}}}},hv=e=>{const[t,r]=y.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return y.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia(e),o=i=>{r(i.matches)};return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[e]),t},gv=e=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useRef(null),i=y.useRef(!1),s=y.useRef(typeof window<"u"?window.location.hash:"");return y.useEffect(()=>{e||(n.current=null,o.current=null,r(!1))},[e]),y.useEffect(()=>{if(!e)return;const p=m=>{m.preventDefault(),m.returnValue=""};return window.addEventListener("beforeunload",p),()=>window.removeEventListener("beforeunload",p)},[e]),y.useEffect(()=>{const p=()=>{const m=window.location.hash;if(!e){s.current=m;return}if(i.current){i.current=!1,s.current=m;return}m!==s.current&&(o.current=m,window.location.hash=s.current,r(!0))};return window.addEventListener("hashchange",p),()=>window.removeEventListener("hashchange",p)},[e]),{showLeaveModal:t,requestLeave:p=>{if(!e){p();return}n.current=p,r(!0)},confirmLeave:()=>{if(r(!1),n.current){const p=n.current;n.current=null,i.current=!0,p();return}if(o.current){const p=o.current;o.current=null,i.current=!0,window.location.hash=p}},cancelLeave:()=>{n.current=null,o.current=null,r(!1)},allowNextNavigation:p=>{i.current=!0,p()}}},bd={thumbnail:"thumbnail",preview:"preview"},xv=()=>{const e=Ne(),[t]=Jt(),r=t.get("gid"),n=hv("(min-width: 1024px)"),{groupTitle:o,setGroupTitle:i,thisGroupReels:s,setThisGroupReels:l,styles:c,setStyles:d,isLoading:u,isSaving:p,isEdited:m,setIsEdited:g,handleSave:b}=fv(r),{allReels:f,searchTerm:h,setSearchTerm:_,isSearching:v,lastStoryElementRef:w,refreshReels:j}=Zi(r),[C,N]=y.useState(""),[k,E]=y.useState(n),[T,A]=y.useState(bd.thumbnail),[O,R]=y.useState([]),L=y.useMemo(()=>new Set(s.map(G=>G.story_uuid)),[s]),P=y.useMemo(()=>h.trim().toLowerCase(),[h]),M=y.useMemo(()=>P?O.filter(G=>G.title.toLowerCase().includes(P)):O,[O,P]),I=y.useMemo(()=>{const G=new Map;for(const de of M)G.set(de.story_uuid,de);for(const de of f)G.has(de.story_uuid)||G.set(de.story_uuid,de);return Array.from(G.values())},[M,f]),B=y.useMemo(()=>I.filter(G=>!L.has(G.story_uuid)),[I,L]);y.useEffect(()=>{E(n)},[n]),y.useEffect(()=>{R([])},[r]);const{showLeaveModal:z,requestLeave:q,confirmLeave:ae,cancelLeave:ie,allowNextNavigation:ge}=gv(m),_e=async(G,de)=>{try{N(G.story_uuid);const $=de==="add"?[G,...s]:s.filter(Y=>Y.story_uuid!==G.story_uuid);l($),R(de==="add"?Y=>Y.filter(oe=>oe.story_uuid!==G.story_uuid):Y=>Y.some(oe=>oe.story_uuid===G.story_uuid)?Y:[G,...Y]),g(!0)}catch($){$ instanceof Error?K.error($.message):K.error("Something went wrong. Please try again later!")}finally{N("")}},pe=async()=>{const G=await b();G&&(R([]),j()),G?.isNewGroup&&ge(()=>{e(`?view=${X.mg}&gid=${G.group_id}`,{replace:!0})})};return u?a.jsx(Ir,{}):a.jsxs(kb,{value:{requestLeave:q},children:[a.jsx(jt,{left:[a.jsx(St,{name:"Manage Widget",Icon:Or},"page"),a.jsx(rr,{cb:()=>q(()=>e(`?view=${X.ag}`))},"back")],center:[a.jsxs("div",{className:"ecr-admin-group-title__wrapper",children:[a.jsx(Qi,{placeholder:"Enter group title",title:o,setTitle:i,setIsEdited:g,style:{paddingInline:"32px"}}),o&&a.jsxs(Vo,{children:[a.jsx(Wo,{className:"ecr-admin-group-title-customization__trigger",children:a.jsx(Z0,{})}),a.jsxs(qo,{className:"ecr-admin-group-title-customization-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Customize title appearance"})}),a.jsx(jb,{styles:c,setStyles:d,setIsEdited:g}),a.jsx("div",{style:{display:"flex",justifyContent:"end",marginTop:40},children:a.jsx(S0,{asChild:!0,children:a.jsx(te,{style:{paddingInline:40},variant:"outline",children:"Ok"})})})]})]})]},"title")],right:[a.jsx(J0,{isExpanded:k,setIsExpanded:E},"toggle"),a.jsx(uo,{onSave:pe,isSaving:p,disabled:!m},"save")],rightClass:"ecr-admin-nav-btn-reverse"}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Manage Widget"}],onNavigate:G=>q(()=>e(G))}),a.jsxs("div",{className:"ecr-admin-group-edit",children:[a.jsx(Ib,{allReels:B,gid:r,handleSelectReel:_e,searchTerm:h,setSearchTerm:_,isSearching:v,togglingId:C,lastStoryElementRef:w}),a.jsx(Lb,{gid:r,reels:s,styles:c,handleRemoveReel:_e,togglingId:C,currentTab:T}),k&&a.jsx(mv,{isExpanded:k,setIsExpanded:E,setIsEdited:g,styles:c,setStyles:d,tabs:bd,setCurrentTab:A,currentTab:T})]}),z&&a.jsx(Rr,{onReject:ie,onAccept:ae,isLoading:!1,message:"You have unsaved changes. Leave this page without saving?"})]})};function bv(){const[e]=Jt(),t=e.get("view")||X.ag;let r;switch(t){case X.settings:r=a.jsx(W0,{});break;case X.ar:r=a.jsx(kf,{});break;case X.stat:r=a.jsx(K0,{});break;case X.cr:r=a.jsx(I0,{});break;case X.mg:r=a.jsx(xv,{});break;default:r=a.jsx(H0,{})}return a.jsxs("div",{children:[r,a.jsx(Hu,{position:"top-right",toastOptions:{style:{padding:"16px",marginTop:"24px",fontSize:"16px"}}})]})}const _d=async(e,t,r,n={})=>{try{if(await he.post(`group/${e}/story/${t}/view`),n.isActive&&!n.isActive())return;r(o=>({...o,[t]:Number(o[t]||0)+1}))}catch{}},vd=e=>!!e?.files?.[0]?.mime_type?.startsWith("video"),_v=()=>{const e=y.useContext(ha);if(!e)throw new Error("useVideoPlayer must be used inside PublicStoryContext");const{styles:t,stories:r,groupId:n,isPlaying:o,setIsPlaying:i,setStoryViews:s}=e,[l,c]=y.useState(r.length-1),[d,u]=y.useState(null),[p,m]=y.useState(!0),[g,b]=y.useState(0),[f,h]=y.useState(!1),[_,v]=y.useState({index:0,story_uuid:r[0]?.story_uuid??""}),w=d?.links&&d.links.length>0?d.links[0]:null,j=t?.playerAppearance??"overlay",C=y.useRef(""),N=y.useCallback((L,P=1)=>{if(r.length===0)return null;let M=L;for(let I=0;I<r.length;I+=1){const B=r[M];if(vd(B))return{story:B,index:M};M=(M+P+r.length)%r.length}return null},[r]),k=y.useCallback(()=>{c(r.length-1);const L=r.findIndex(I=>String(I.story_uuid)===o),P=L>=0?r[L]:null,M=vd(P)?{story:P,index:L}:N(Math.max(L,0),1);if(!M?.story){u(null),m(!1);return}u(M.story),L!==M.index&&M.story.story_uuid!==o&&i(M.story.story_uuid),v({index:0,story_uuid:M.story.story_uuid}),m(!1)},[N,o,i,r]);y.useEffect(()=>{k()},[k]),y.useEffect(()=>(C.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=C.current}),[]);const E=y.useCallback(()=>{i(null)},[i]),T=y.useCallback((L=1)=>{m(!0);const P=r.findIndex(q=>String(q.story_uuid)===String(o)),M=L>0?1:-1,I=L>0?l>P?P+1:0:P>0?P-1:l,B=N(I,M);if(!B?.story){m(!1);return}const z=B.story;if(z.story_uuid===o){m(!1),E();return}v({index:0,story_uuid:z.story_uuid}),n&&_d(n,z.id,s),i(z.story_uuid),m(!1)},[E,N,n,o,l,i,s,r]),A=y.useCallback(()=>{const L=d?.files??[];if(_.index>0){v(P=>({index:P.index-1,story_uuid:L[P.index-1].story_uuid??""}));return}T(-1)},[_.index,T,d?.files]),O=y.useCallback(()=>{const L=d?.files??[];if(_.index+1<L.length){v(P=>({index:P.index+1,story_uuid:L[P.index+1].story_uuid??""}));return}T(1)},[_.index,T,d?.files]),R=y.useCallback(L=>{L.target===L.currentTarget&&E()},[E]);return{closePlayer:E,currentFileIndex:_,duration:g,handleBackdropClick:R,handleNextFile:O,handlePrevFile:A,isLoadingNext:p,isPaused:f,playingStory:d,setDuration:b,setIsPaused:h,setIsPlaying:i,firstLink:w,playerAppearance:j}},vv=()=>a.jsx(a.Fragment,{children:a.jsx("div",{className:"ecr-player__loader",children:a.jsxs("div",{className:"ecr-loader",children:[a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"})]})})}),yv=()=>{const{closePlayer:e,currentFileIndex:t,duration:r,handleBackdropClick:n,handleNextFile:o,handlePrevFile:i,isLoadingNext:s,isPaused:l,playerAppearance:c,playingStory:d,firstLink:u,setDuration:p,setIsPaused:m,setIsPlaying:g}=_v();return a.jsx("div",{onClick:n,className:"ecommreels-story-modal ecr-player",children:d&&a.jsxs("div",{className:"ecr-player__stage",children:[a.jsx(yt,{onClick:i,className:"ecr-player__nav--left",children:a.jsx(Qt,{size:24})}),a.jsx(yt,{onClick:o,className:"ecr-player__nav--right",children:a.jsx(er,{size:24})}),a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[d&&a.jsx(ii,{playingStory:d,duration:r,currentFileIndex:t,isPaused:l},`${d.story_uuid}-${t.index}`),a.jsx("div",{onClick:e,className:"ecr-player__close",children:a.jsx(tr,{className:"ecr-player__close-icon"})}),s?a.jsx(vv,{}):d?.files.length>0&&a.jsx(di,{currentFileIndex:t,files:d?.files,setDuration:p,setIsPlaying:g,isPaused:l,setIsPaused:m,handlePrevFile:i,handleNextFile:o,storyId:d.id,storyTitle:d?.title}),c==="overlay"?u?a.jsx(Nn,{link:u,usedFor:"user",usedIn:"player",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Bt,{title:d.title}):null,c==="title"?a.jsx(Bt,{title:d.title}):null]})]})})},yd=({story:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const i=t.appearance??"overlay",s=e.links&&e.links.length>0?e.links[0]:null,l=i==="none",c=i==="title",d=t.shape==="rectangle",u=!l&&!c&&s,p=t.border.border_radius,m=p>50?p+16:p>20?p:0;return a.jsxs("div",{className:`ecr-thumb ${t.hoverEffect??""}`,children:[a.jsxs("div",{onClick:()=>r({sid:e.id,story_uuid:e.story_uuid}),className:"ecr-thumb__frame",style:{border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t.shape==="rectangle"?"9/16":"1/1"},children:[a.jsx(Jn,{story:e,styles:t,storyViews:n,setStoryViews:o}),!l&&!c&&d?u?a.jsx(Nn,{link:s,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null]}),c?a.jsx("p",{className:"ecr-reel__title",children:e.title}):null]})},wv=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=fc([e],!0);return a.jsxs("div",{className:"ecr-front-carousel",children:[a.jsx("div",{ref:i,className:"ecr-front-carousel__viewport",children:a.jsx("div",{ref:s,className:t.hoverEffect==="zoom-in"?"ecr-front-carousel__track ecr-front-carousel__track--zoom":"ecr-front-carousel__track",children:e?.map(m=>m?.files[0]?.mime_type.startsWith("video")?a.jsx(yd,{story:m,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},m.story_uuid):null)})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--left",children:a.jsx(Qt,{size:20,style:{width:"20px",height:"20px"}})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--right",children:a.jsx(er,{size:20,style:{width:"20px",height:"20px"}})})]})},wd=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>a.jsx("div",{className:"ecr-front-grid",children:a.jsx("div",{style:{paddingBlock:`${t.topBottomSpacing}px`},className:"ecr-front-grid__list",children:e?.map(i=>i?.files[0]?.mime_type.startsWith("video")?a.jsx(yd,{story:i,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},i.story_uuid):null)})}),jv={carousel:wv,grid:wd},Sv=()=>{const e=y.useContext(ha),{groupTitle:t,styles:r,stories:n,groupId:o,setIsPlaying:i,storyViews:s,setStoryViews:l}=e,c=y.useRef(!0);y.useEffect(()=>(c.current=!0,()=>{c.current=!1}),[]);const d=r.template??"carousel",u=jv[d]||wd,p=({sid:m,story_uuid:g})=>{i(g),o&&_d(o,m,l,{isActive:()=>c.current})};return a.jsxs("div",{style:{"--thumbnail-size":r.template==="grid"?"auto":`${r?.size}px`,"--thumbnail-size-grid":`${r?.size}px`,"--thumbnail-size-tab":r.template==="grid"?"auto":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-grid-tab":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-mobile":r.template==="grid"?"auto":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-size-grid-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-tab":`${r?.gapOnTab??r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},children:[r?.widgetTitle&&r?.widgetTitle?.alignment!=="hidden"&&t?a.jsx("h2",{style:{textAlign:r.widgetTitle?.alignment,fontSize:r.widgetTitle?.fontSize,color:r.widgetTitle?.color,marginBottom:24},children:t}):null,a.jsx(u,{stories:n,styles:r,handlePlaying:p,storyViews:s,setStoryViews:l})]})},Cv=e=>{const[t,r]=y.useState(""),[n,o]=y.useState([]),[i,s]=y.useState(tt),[l,c]=y.useState(!1),[d,u]=y.useState(null),p=y.useCallback(async()=>{const m=e?.trim();if(!m){o([]),s(tt),c(!1),u(null);return}const g=new AbortController;c(!0),u(null);try{const b=await he.get(`stories/${m}`,{signal:g.signal});if(g.signal.aborted)return;r(b.data.group_name),o(b.data.stories),s(b.data.styles||tt)}catch(b){if(g.signal.aborted)return;u(b)}finally{c(!1)}return()=>{g.abort()}},[e]);return y.useEffect(()=>{p()},[e]),{groupTitle:t,stories:n,styles:i,isLoading:l,error:d}},ha=y.createContext(void 0),jd=({groupId:e})=>{const[t,r]=y.useState(null),[n,o]=y.useState({}),{groupTitle:i,stories:s,styles:l}=Cv(e);return a.jsxs(ha.Provider,{value:{groupTitle:i,groupId:e,stories:s,styles:l,isPlaying:t,setIsPlaying:r,storyViews:n,setStoryViews:o},children:[t&&a.jsx(yv,{}),a.jsx(Sv,{})]})};_a(()=>{const e=document.getElementById("ecommreels-admin-app");e&&Ln.createRoot(e).render(a.jsx(Zd,{children:a.jsx(bv,{})}))}),_a(()=>{const e=document.querySelectorAll(".ecommreels-short-code"),t=document.querySelectorAll(".reelswp-group-short-code");e.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;Ln.createRoot(n).render(a.jsx(jd,{groupId:o}))}),t.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;Ln.createRoot(n).render(a.jsx(jd,{groupId:o}))})})})(React,wp.domReady,wp.element,ReactDOM);
  • ecomm-reels/tags/4.0.15/ecomm-reels.php

    r3457000 r3457881  
    33 * Plugin Name:       ReelsWp - Shoppable Videos & Vertical Reels Carousels
    44 * Description:       Create Insta style reels and stories with ReelsWP and add them anywhere on your WordPress site. Add fast, mobile friendly video grid and carousel layouts to your homepage, blog or news articles, and product pages.
    5  * Version:           4.0.14
     5 * Version:           4.0.15
    66 * Requires at least: 5.8
    77 * Requires PHP:      7.4
     
    2020define('ECOMMREELS_ASSETS', plugins_url('/', __FILE__));
    2121define('ECOMMREELS_FILE_PREFIX', 'class-');
    22 define('WP_REELS_VER', '4.0.14');
     22define('WP_REELS_VER', '4.0.15');
    2323
    2424// 1) Composer autoloader (optional, guarded)
  • ecomm-reels/tags/4.0.15/readme.txt

    r3457000 r3457881  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 4.0.14
     7Stable tag: 4.0.15
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    100100== Changelog ==
    101101
     102= 4.0.15 - 2026-02-10 =
     103- New: Added a tablet device option to responsive controls for managing size and spacing.
     104
    102105= 4.0.14 - 2026-02-09 =
    103106- Fix: Fixed several UI inconsistencies across the app for a more consistent user experience.
  • ecomm-reels/trunk/CHANGELOG.md

    r3457000 r3457881  
    11# Changelog
     2
     3## [4.0.15](https://github.com/dstudio-asia/reels-wp/compare/v4.0.14...v4.0.15) (2026-02-10)
     4
     5
     6### Features
     7
     8* **ui:** add locked pro appearance options with upgrade prompt ([f37782e](https://github.com/dstudio-asia/reels-wp/commit/f37782e43b3db942fd7e7e5d29ca12c30e539961))
     9* **ui:** add tablet responsive size and gap support ([7ba09ba](https://github.com/dstudio-asia/reels-wp/commit/7ba09bae224fb4e5a01befb480243e661a4e9b3d))
     10
     11
     12### Bug Fixes
     13
     14* **side-panel:** adjust z-index behavior for responsive layouts ([32bf56a](https://github.com/dstudio-asia/reels-wp/commit/32bf56a4786c1d419481811a9acf2abb7ee71d15))
     15* **thumbnail:** remove pointer cursor from frame ([41591dc](https://github.com/dstudio-asia/reels-wp/commit/41591dcf70697b9b52fe3f1a5642904245aad153))
     16* **ui:** correct side panel height and padding behavior ([571c1b3](https://github.com/dstudio-asia/reels-wp/commit/571c1b390531e0f6e5877f8d92be5adfeb64e9a5))
    217
    318## [4.0.14](https://github.com/dstudio-asia/reels-wp/compare/v4.0.13...v4.0.14) (2026-02-09)
  • ecomm-reels/trunk/build/index.js

    r3457000 r3457881  
    1 (function(y,va,Ln,_a){"use strict";var ya=document.createElement("style");ya.textContent=`:root{--color-primary: #2563eb;--color-primary-foreground: #ffffff;--color-secondary: #e5e7eb;--color-secondary-foreground: #111827;--color-foreground: #111827;--color-muted: #f3f4f6;--color-muted-foreground: #6b7280;--color-accent: #f3f4f6;--color-border: #e5e7eb;--color-ring: #60a5fa}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{box-sizing:border-box;color:var(--color-foreground, #111);font-family:Inter,Segoe UI,system-ui,-apple-system,sans-serif}#ecommreels-admin-app *,#ecommreels-admin-app *:before,#ecommreels-admin-app *:after,.ecommreels-short-code *,.ecommreels-short-code *:before,.ecommreels-short-code *:after,.reelswp-group-short-code *,.reelswp-group-short-code *:before,.reelswp-group-short-code *:after,.reelswp-reel-short-code *,.reelswp-reel-short-code *:before,.reelswp-reel-short-code *:after{box-sizing:inherit}#ecommreels-admin-app input,#ecommreels-admin-app select,#ecommreels-admin-app textarea,.ecommreels-short-code input,.ecommreels-short-code select,.ecommreels-short-code textarea,.reelswp-group-short-code input,.reelswp-group-short-code select,.reelswp-group-short-code textarea,.reelswp-reel-short-code input,.reelswp-reel-short-code select,.reelswp-reel-short-code textarea{font:inherit;color:inherit}#ecommreels-admin-app button,.ecommreels-short-code button,.reelswp-group-short-code button,.reelswp-reel-short-code button{border:none}#ecommreels-admin-app input[type=checkbox],#ecommreels-admin-app input[type=radio],.ecommreels-short-code input[type=checkbox],.ecommreels-short-code input[type=radio],.reelswp-group-short-code input[type=checkbox],.reelswp-group-short-code input[type=radio],.reelswp-reel-short-code input[type=checkbox],.reelswp-reel-short-code input[type=radio]{margin:0}#ecommreels-admin-app input[type=number]::-webkit-inner-spin-button,#ecommreels-admin-app input[type=number]::-webkit-outer-spin-button,.ecommreels-short-code input[type=number]::-webkit-inner-spin-button,.ecommreels-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-group-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-group-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}#ecommreels-admin-app input[type=number],.ecommreels-short-code input[type=number],.reelswp-group-short-code input[type=number],.reelswp-reel-short-code input[type=number]{-moz-appearance:textfield}#ecommreels-admin-app input,.ecommreels-short-code input,.reelswp-group-short-code input,.reelswp-reel-short-code input{min-height:auto}#ecommreels-admin-app img,.ecommreels-short-code img,.reelswp-group-short-code img,.reelswp-reel-short-code img{max-width:100%;display:block}#ecommreels-admin-app h1,#ecommreels-admin-app h2,#ecommreels-admin-app h3,#ecommreels-admin-app h4,#ecommreels-admin-app h5,#ecommreels-admin-app h6,.ecommreels-short-code h1,.ecommreels-short-code h2,.ecommreels-short-code h3,.ecommreels-short-code h4,.ecommreels-short-code h5,.ecommreels-short-code h6,.reelswp-group-short-code h1,.reelswp-group-short-code h2,.reelswp-group-short-code h3,.reelswp-group-short-code h4,.reelswp-group-short-code h5,.reelswp-group-short-code h6,.reelswp-reel-short-code h1,.reelswp-reel-short-code h2,.reelswp-reel-short-code h3,.reelswp-reel-short-code h4,.reelswp-reel-short-code h5,.reelswp-reel-short-code h6{margin:0;font-weight:600}#ecommreels-admin-app p,.ecommreels-short-code p,.reelswp-group-short-code p,.reelswp-reel-short-code p{margin:0}#ecommreels-admin-app .ecr-admin-panel{position:relative;margin:24px;min-height:50vh;border-radius:6px;border:1px solid #d1d5db;background:#fff;padding:16px}#ecommreels-admin-app .ecr-admin-panel--reels{padding:16px}#ecommreels-admin-app .ecr-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid transparent;border-radius:6px;font-size:14px;font-weight:600;line-height:1;padding:8px 16px;background:#111;color:#fff;cursor:pointer;transition:background-color .2s ease,border-color .2s ease,color .2s ease,box-shadow .2s ease,transform .2s ease}#ecommreels-admin-app .ecr-button:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-button--primary{background:#2563eb;color:#fff}#ecommreels-admin-app .ecr-button--primary:hover{background:#1f29371a}#ecommreels-admin-app .ecr-button--secondary{background:#e5e7eb;color:#111827}#ecommreels-admin-app .ecr-button--secondary:hover{background:#e5e7eb1a}#ecommreels-admin-app .ecr-button--outline{background:transparent;border-color:#2563eb;color:#2563eb}#ecommreels-admin-app .ecr-button--outline:hover{background:#2563eb1a}#ecommreels-admin-app .ecr-button--outline-danger{background:transparent;border-color:#dc2626;color:#dc2626}#ecommreels-admin-app .ecr-button--outline-danger:hover{background:#dc26261a}#ecommreels-admin-app .ecr-button--ghost{background:transparent;color:#111827}#ecommreels-admin-app .ecr-button--ghost:hover{background:#f3f4f6}#ecommreels-admin-app .ecr-button--link{background:none;border-color:transparent;padding:0;color:#2563eb;text-decoration:none}#ecommreels-admin-app .ecr-button--link:hover{text-decoration:underline}#ecommreels-admin-app .ecr-button--danger{background:#dc2626;color:#fff}#ecommreels-admin-app .ecr-button--danger:hover{background:#b91c1c}#ecommreels-admin-app .ecr-button--sm{height:32px;padding:0 12px;font-size:13px}#ecommreels-admin-app .ecr-button--md{height:36px;padding:0 16px}#ecommreels-admin-app .ecr-button--lg{height:40px;padding:0 20px;font-size:15px}#ecommreels-admin-app .ecr-button--icon,#ecommreels-admin-app .ecr-button--icon-sm,#ecommreels-admin-app .ecr-button--icon-lg{padding:0;width:36px;height:36px}#ecommreels-admin-app .ecr-button--icon-sm{width:32px;height:32px}#ecommreels-admin-app .ecr-button--icon-lg{width:40px;height:40px}#ecommreels-admin-app .ecr-admin-reels-header{margin-bottom:16px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__left{display:flex;align-items:center;gap:32px}#ecommreels-admin-app .ecr-admin-reels-header__right{display:flex;flex-wrap:wrap;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__title{margin:0;padding:6px 0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-reels-header__actions{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__action{padding:0;font-weight:600;background:none;border:none;box-shadow:none}#ecommreels-admin-app .ecr-admin-reels-header__action--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reels-header__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reels-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-reels-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-reels-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-reels-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__create{border:1px solid #3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-reels-header__create:hover{background:#ffffffe6}#ecommreels-admin-app .ecr-admin-reels-header__spinner{animation:ecr-reels-spin 1s linear infinite}@keyframes ecr-reels-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-reels-empty{display:flex;align-items:center;justify-content:center;padding-top:50px}#ecommreels-admin-app .ecr-admin-reels-empty__text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:14px}#ecommreels-admin-app .ecr-admin-reels-loading{display:flex;align-items:center;justify-content:center;padding:16px 0}#ecommreels-admin-app .ecr-admin-reels-loading--fullscreen{position:absolute;inset:0}#ecommreels-admin-app .ecr-admin-reels-loading__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-reels-loading-spin 1s linear infinite}@keyframes ecr-reels-loading-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-player__progress,.ecommreels-short-code .ecr-player__progress,.reelswp-group-short-code .ecr-player__progress,.reelswp-reel-short-code .ecr-player__progress{position:absolute;top:4px;left:50%;z-index:2;display:flex;width:90%;transform:translate(-50%);gap:4px;overflow:hidden;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-track,.ecommreels-short-code .ecr-player__progress-track,.reelswp-group-short-code .ecr-player__progress-track,.reelswp-reel-short-code .ecr-player__progress-track{width:100%;height:3px;background:#ffffff80;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-fill,.ecommreels-short-code .ecr-player__progress-fill,.reelswp-group-short-code .ecr-player__progress-fill,.reelswp-reel-short-code .ecr-player__progress-fill{height:3px;background:#fff;border-radius:999px;width:0}#ecommreels-admin-app .ecr-player__progress-fill--active,.ecommreels-short-code .ecr-player__progress-fill--active,.reelswp-group-short-code .ecr-player__progress-fill--active,.reelswp-reel-short-code .ecr-player__progress-fill--active{animation:ecr-progress var(--reels-wp-animation-time) linear forwards}#ecommreels-admin-app .ecr-player__progress-fill--complete,.ecommreels-short-code .ecr-player__progress-fill--complete,.reelswp-group-short-code .ecr-player__progress-fill--complete,.reelswp-reel-short-code .ecr-player__progress-fill--complete{width:100%}#ecommreels-admin-app .ecr-player__progress-fill--empty,.ecommreels-short-code .ecr-player__progress-fill--empty,.reelswp-group-short-code .ecr-player__progress-fill--empty,.reelswp-reel-short-code .ecr-player__progress-fill--empty{width:0}@keyframes ecr-progress{0%{width:0}to{width:100%}}#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{position:absolute;top:50%;z-index:5;display:none;width:40px;height:40px;padding:0;transform:translateY(-50%);border:none;border-radius:999px;background:#ffffffd9;color:#374151;cursor:pointer;align-items:center;justify-content:center}@media(min-width:1024px){#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{display:grid}}#ecommreels-admin-app .ecr-player__nav--left,.ecommreels-short-code .ecr-player__nav--left,.reelswp-group-short-code .ecr-player__nav--left,.reelswp-reel-short-code .ecr-player__nav--left{left:0;transform:translate(-120%,-50%)}#ecommreels-admin-app .ecr-player__nav--right,.ecommreels-short-code .ecr-player__nav--right,.reelswp-group-short-code .ecr-player__nav--right,.reelswp-reel-short-code .ecr-player__nav--right{right:0;transform:translate(120%,-50%)}#ecommreels-admin-app .ecr-player__nav:hover,.ecommreels-short-code .ecr-player__nav:hover,.reelswp-group-short-code .ecr-player__nav:hover,.reelswp-reel-short-code .ecr-player__nav:hover{background:#fff}#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{position:relative;display:flex;width:100%;height:100%;align-items:center;justify-content:center;overflow:hidden;border-radius:16px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{border-radius:0}}#ecommreels-admin-app .ecr-player__media,.ecommreels-short-code .ecr-player__media,.reelswp-group-short-code .ecr-player__media,.reelswp-reel-short-code .ecr-player__media{width:100%;height:auto}#ecommreels-admin-app .ecr-player__media--portrait,.ecommreels-short-code .ecr-player__media--portrait,.reelswp-group-short-code .ecr-player__media--portrait,.reelswp-reel-short-code .ecr-player__media--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-player__media--auto,.ecommreels-short-code .ecr-player__media--auto,.reelswp-group-short-code .ecr-player__media--auto,.reelswp-reel-short-code .ecr-player__media--auto{height:auto}#ecommreels-admin-app .ecr-player__slider,.ecommreels-short-code .ecr-player__slider,.reelswp-group-short-code .ecr-player__slider,.reelswp-reel-short-code .ecr-player__slider{position:absolute;top:0;display:flex;background:#000;transition:left .2s ease}#ecommreels-admin-app .ecr-player__slide,.ecommreels-short-code .ecr-player__slide,.reelswp-group-short-code .ecr-player__slide,.reelswp-reel-short-code .ecr-player__slide{position:relative;display:flex;align-items:center;justify-content:center;height:90vh;max-width:100vw;aspect-ratio:9 / 16}#ecommreels-admin-app .ecr-player__controls,.ecommreels-short-code .ecr-player__controls,.reelswp-group-short-code .ecr-player__controls,.reelswp-reel-short-code .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:5;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon,.ecommreels-short-code .ecr-player__control-icon,.reelswp-group-short-code .ecr-player__control-icon,.reelswp-reel-short-code .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecommreels-story-modal,.ecommreels-short-code .ecommreels-story-modal,.reelswp-group-short-code .ecommreels-story-modal,.reelswp-reel-short-code .ecommreels-story-modal{max-width:100%!important;z-index:2147483647;background-color:#000c;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}#ecommreels-admin-app #player *,.ecommreels-short-code #player *,.reelswp-group-short-code #player *,.reelswp-reel-short-code #player *{scrollbar-width:none;-ms-overflow-style:none}#ecommreels-admin-app #player *::-webkit-scrollbar,.ecommreels-short-code #player *::-webkit-scrollbar,.reelswp-group-short-code #player *::-webkit-scrollbar,.reelswp-reel-short-code #player *::-webkit-scrollbar{display:none}#ecommreels-admin-app .ecr-player,.ecommreels-short-code .ecr-player,.reelswp-group-short-code .ecr-player,.reelswp-reel-short-code .ecr-player{position:fixed!important;top:0!important;left:0!important;display:grid;place-items:center;width:100vw!important;height:100vh!important}#ecommreels-admin-app .ecr-player__stage,.ecommreels-short-code .ecr-player__stage,.reelswp-group-short-code .ecr-player__stage,.reelswp-reel-short-code .ecr-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:90vh;max-width:100vw;overflow:hidden;border-radius:24px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{height:100vh;border-radius:0}}#ecommreels-admin-app .ecr-player__close,.ecommreels-short-code .ecr-player__close,.reelswp-group-short-code .ecr-player__close,.reelswp-reel-short-code .ecr-player__close{position:absolute;top:8px;right:8px;z-index:5;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1}#ecommreels-admin-app .ecr-player__close-icon,.ecommreels-short-code .ecr-player__close-icon,.reelswp-group-short-code .ecr-player__close-icon,.reelswp-reel-short-code .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-admin-reels-grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}#ecommreels-admin-app .ecr-thumb__media,.ecommreels-short-code .ecr-thumb__media,.reelswp-group-short-code .ecr-thumb__media,.reelswp-reel-short-code .ecr-thumb__media{position:relative;width:100%;height:100%}#ecommreels-admin-app .ecr-thumb__video,.ecommreels-short-code .ecr-thumb__video,.reelswp-group-short-code .ecr-thumb__video,.reelswp-reel-short-code .ecr-thumb__video{pointer-events:none;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-thumb__placeholder,.ecommreels-short-code .ecr-thumb__placeholder,.reelswp-group-short-code .ecr-thumb__placeholder,.reelswp-reel-short-code .ecr-thumb__placeholder{display:flex;width:100%;height:100%;align-items:center;justify-content:center;background:#e5e7eb;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-thumb__views,.ecommreels-short-code .ecr-thumb__views,.reelswp-group-short-code .ecr-thumb__views,.reelswp-reel-short-code .ecr-thumb__views{position:absolute;top:8px;z-index:4;display:inline-flex;align-items:center;gap:4px;background:#6b7280;color:#fff;padding:2.4px 5.6px;font-size:11px;border-radius:4px}#ecommreels-admin-app .ecr-admin-reel-card{display:block}#ecommreels-admin-app .ecr-admin-reel-card__frame{position:relative;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease,box-shadow .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame--selected{border-color:#3b82f6;box-shadow:0 0 0 2px #2b7fff}#ecommreels-admin-app .ecr-admin-reel-card__actions{position:absolute;top:100%;z-index:5;display:flex;width:100%;height:50%;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__actions--hover{top:50%}#ecommreels-admin-app .ecr-admin-reel-card__action{background:#fff;color:#111827}#ecommreels-admin-app .ecr-admin-reel-card__action:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reel-card__icon--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reel-card__icon--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__corner{position:absolute;display:flex;top:-2px;right:-2px;z-index:6;width:42px;height:42px;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__corner--hidden{transform:translate(100%,-100%)}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__corner--hidden{transform:translate(0)}#ecommreels-admin-app .ecr-admin-reel-card__corner--selected{background:#3b82f6}#ecommreels-admin-app .ecr-admin-reel-card__corner--idle{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__select{margin-left:auto;width:24px;height:24px;border-radius:4px;background:transparent;padding:4px}#ecommreels-admin-app .ecr-admin-reel-card__select:hover{background:none}#ecommreels-admin-app .ecr-admin-reel-card__check{color:#6b7280}#ecommreels-admin-app .ecr-admin-reel-card__check--active{color:#fff}#ecommreels-admin-app .ecr-admin-reel-card__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-back-button{background:none;border:none;padding:0;color:#6b7280;cursor:pointer;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-back-button:hover{color:#2563eb}#ecommreels-admin-app .ecr-admin-breadcrumb{margin-top:12px;padding:0 24px;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-breadcrumb__list{display:flex;flex-wrap:wrap;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-breadcrumb__item{display:inline-flex;align-items:center}#ecommreels-admin-app .ecr-admin-breadcrumb__link{color:#2563eb;text-decoration:none;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-breadcrumb__current{font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-breadcrumb__separator{margin:0 4px;font-size:18px;color:#9ca3af}#ecommreels-admin-app .ecr-admin-modal{position:fixed;inset:0;z-index:2147483647;display:grid;place-items:center;background:#000c}#ecommreels-admin-app .ecr-admin-modal__panel{border-radius:8px;background:#fff;padding:24px;min-width:320px;max-width:500px}#ecommreels-admin-app .ecr-admin-modal__content{margin-bottom:16px}#ecommreels-admin-app .ecr-admin-modal__icon{margin-bottom:8px;display:flex;justify-content:center}#ecommreels-admin-app .ecr-admin-modal__message{margin:0;font-size:16px;font-weight:600;color:#111827;text-align:center}#ecommreels-admin-app .ecr-admin-modal__actions{display:flex;width:100%;align-items:center;justify-content:center;gap:8px}#ecommreels-admin-app .ecr-admin-modal__button{border-radius:6px;border:1px solid transparent;padding:6px 24px;font-size:14px;font-weight:600;cursor:pointer}#ecommreels-admin-app .ecr-admin-modal__button:disabled{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-modal__button--cancel{border-color:#3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-modal__button--danger{display:inline-flex;align-items:center;gap:6px;border-color:#ef4444;background:#ef4444;color:#fff}#ecommreels-admin-app .ecr-admin-modal__spinner{animation:ecr-modal-spin 1s linear infinite}@keyframes ecr-modal-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-link-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:6px;background:#3b82f6;padding:8px 16px;font-size:14px;font-weight:600;text-decoration:none;transition:background-color .15s ease;margin-inline-start:auto;white-space:nowrap}#ecommreels-admin-app .ecr-admin-link-button:hover{background:#1d4ed8}#ecommreels-admin-app .ecr-admin-loader{position:fixed;inset:0;z-index:5;display:grid;place-items:center;background:#fffc;color:#3b82f6}#ecommreels-admin-app .ecr-admin-loader__icon{animation:ecr-admin-spin 1s linear infinite}@keyframes ecr-admin-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-navbar{display:flex;align-items:center;justify-content:space-between;background:#fff;padding:16px 24px;gap:16px;flex-wrap:wrap}#ecommreels-admin-app .ecr-admin-navbar__section{display:flex;align-items:center;gap:16px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-navbar{justify-content:center}}#ecommreels-admin-app .ecr-admin-page-name{margin:0;display:inline-flex;align-items:center;gap:4px;font-size:20px;font-weight:600;-webkit-user-select:none;user-select:none;white-space:nowrap}#ecommreels-admin-app .ecr-admin-widget-name{display:inline-flex;align-items:center;justify-content:center;gap:4px;width:320px;border-radius:6px;background:#e5e7eb;padding:8px;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create{margin:16px 24px 0;display:flex;gap:24px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create{flex-direction:column}}#ecommreels-admin-app .ecr-admin-create__panel{position:relative;overflow-x:hidden;border-radius:16px;background:#fff;padding:16px 20px 20px}#ecommreels-admin-app .ecr-admin-create__panel--main{flex:1;min-width:0}#ecommreels-admin-app .ecr-admin-create__panel--side{width:300px;flex-shrink:0}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create__panel--side{width:100%}}#ecommreels-admin-app .ecr-admin-create__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create__separator{margin:12px 0}#ecommreels-admin-app .ecr-admin-save-button{background:#3b82f6;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-save-button:hover{background:#2563eb}#ecommreels-admin-app .ecr-admin-save-button:disabled{background:#6b7280}#ecommreels-admin-app .ecr-admin-save-button__icon{font-size:16px}#ecommreels-admin-app .ecr-admin-save-button__icon--spin{animation:ecr-save-spin 1s linear infinite}@keyframes ecr-save-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-title-input{width:320px;border-radius:6px;border:1px solid transparent;background:#e5e7eb;padding:8px;text-align:center;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-upload{display:grid;width:260px;aspect-ratio:9 / 16;place-items:center;border-radius:12px;border:2px dashed #d1d5db;background:#eff6ff;padding:20px}#ecommreels-admin-app .ecr-admin-upload--active{border-color:#3b82f6;background:#eff6ff}#ecommreels-admin-app .ecr-admin-upload--idle{border-color:#d1d5db}#ecommreels-admin-app .ecr-admin-upload__label{display:grid;cursor:pointer;place-items:center;text-align:center}#ecommreels-admin-app .ecr-admin-upload__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-upload__label:hover .ecr-admin-upload__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-upload__text{margin:8px 0 0;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-stack{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-upload__text-item{font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-strong{font-weight:600}#ecommreels-admin-app .ecr-popover{border-radius:10px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding-block:16px;width:288px;box-shadow:0 10px 30px #00000026;z-index:9}#ecommreels-admin-app .ecr-popover[data-state=open]{animation:ecr-popover-in .15s ease-out}@keyframes ecr-popover-in{0%{opacity:0;transform:translateY(4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.ecr-separator{background:var(--color-border, #e5e7eb);flex-shrink:0}.ecr-separator[data-orientation=horizontal]{height:1px;width:100%}.ecr-separator[data-orientation=vertical]{width:1px;height:100%}.ecr-admin-upgrade__title{margin:0;display:inline-flex;align-items:center;gap:6px;font-weight:600;padding-inline:16px}.ecr-admin-upgrade__name{text-transform:capitalize}.ecr-admin-upgrade__tag{display:inline-block;padding:0 4px;border-radius:2px;background:#2563eb;color:#fff;font-size:10px;letter-spacing:.32px}.ecr-admin-upgrade__text{margin:0;font-size:13px;color:#374151;line-height:1.4;padding-inline:16px}.ecr-admin-upgrade__actions{display:flex;justify-content:flex-end;padding-inline:16px}.ecr-admin-upgrade__button{background:#3b82f6;color:#fff}.ecr-admin-upgrade__button:hover{background:#2563eb}.ecr-admin-upgrade__link{font-size:13px;text-decoration:none}.ecr-admin-separator{margin:12px 0}#ecommreels-admin-app .ecr-dialog__overlay{position:fixed;inset:0;background:#0f172abf;z-index:5}#ecommreels-admin-app .ecr-dialog__overlay[data-state=open]{animation:ecr-dialog-overlay-in .15s ease-out}#ecommreels-admin-app .ecr-dialog__content{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(500px,92vw);max-height:85vh;overflow:auto;border-radius:12px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding:20px;box-shadow:0 25px 60px #0f172a40;z-index:6}#ecommreels-admin-app .ecr-dialog__content[data-state=open]{animation:ecr-dialog-content-in .2s ease-out}#ecommreels-admin-app .ecr-dialog__close{position:absolute;right:12px;top:12px;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-muted-foreground, #6b7280);cursor:pointer}#ecommreels-admin-app .ecr-dialog__close:hover{color:var(--color-foreground, #111827)}#ecommreels-admin-app .ecr-dialog__close-icon{width:16px;height:16px}#ecommreels-admin-app .ecr-dialog__header{display:flex;flex-direction:column;gap:6px;padding-right:36px;margin-bottom:16px}#ecommreels-admin-app .ecr-dialog__title{font-size:16px;font-weight:600;text-transform:none}#ecommreels-admin-app .ecr-dialog__description{font-size:13px;color:var(--color-muted-foreground, #6b7280)}@keyframes ecr-dialog-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes ecr-dialog-content-in{0%{opacity:0;transform:translate(-50%,-48%) scale(.98)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}#ecommreels-admin-app .ecr-admin-link-tabs{width:100%;max-height:550px}#ecommreels-admin-app .ecr-admin-link-tabs__list{width:100%;display:grid;grid-template-columns:1fr;gap:8px;border-radius:10px;padding:3px}#ecommreels-admin-app .ecr-admin-link-tabs__trigger,#ecommreels-admin-app .ecr-admin-link-tabs__lock{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;border:1px solid #3b82f6;border-radius:8px;padding:8px;font-size:13px;font-weight:600;background:#fff;color:#6b7280;text-transform:none}#ecommreels-admin-app .ecr-admin-link-tabs__lock{border-color:#969eab}#ecommreels-admin-app .ecr-admin-link-tabs__trigger{color:#3b82f6}#ecommreels-admin-app .ecr-admin-link-tabs__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-link-tabs__content{display:flex;flex-direction:column;gap:20px}#ecommreels-admin-app .ecr-admin-link-dialog{max-width:560px}#ecommreels-admin-app .ecr-admin-product-link__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-product-link__list{height:100%;max-height:300px;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-product-link__list-inner{display:flex;flex-direction:column;gap:8px;width:100%}#ecommreels-admin-app .ecr-admin-product-link__empty{padding:24px 0;text-align:center;font-size:14px;color:#6b7280}#ecommreels-admin-app .ecr-admin-product-link__item{width:100%}#ecommreels-admin-app .ecr-admin-product-link__button{height:auto;width:100%;justify-content:flex-start;border:1px solid #e5e7eb;background:#f7f7f7;color:#111827;padding:8px;font-weight:400;text-align:left;font-size:13px;display:flex;align-items:center;gap:8px;border-radius:6px}#ecommreels-admin-app .ecr-admin-product-link__button--selected{border-color:#2563eb;background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__button--unselected:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__thumb{pointer-events:none;width:40px;height:40px;flex:0 0 auto}#ecommreels-admin-app .ecr-admin-product-link__error{margin:0 0 8px;text-align:left;font-size:14px;color:#ef4444}#ecommreels-admin-app .ecr-admin-product-link__actions{display:flex;justify-content:end}#ecommreels-admin-app .ecr-admin-product-link__actions .ecr-button{text-transform:capitalize;padding:12px 32px}#ecommreels-admin-app .ecr-admin-product-link__loader{display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-product-link__spinner{width:24px;height:24px;border-radius:999px;border-bottom:2px solid #3b82f6;animation:ecr-admin-product-link-spin 1s linear infinite}@keyframes ecr-admin-product-link-spin{to{transform:rotate(360deg)}}.scrollbarThin{--sb-track: transparent;--sb-thumb: rgba(0, 0, 0, .35);--sb-thumb-hover: rgba(0, 0, 0, .5);--sb-thumb-radius: 6px;--sb-size: 8px;scrollbar-width:thin;scrollbar-color:var(--sb-thumb) var(--sb-track);-ms-overflow-style:auto}.scrollbarThin::-webkit-scrollbar{width:var(--sb-size);height:var(--sb-size)}.scrollbarThin::-webkit-scrollbar-track{background:var(--sb-track)}.scrollbarThin::-webkit-scrollbar-thumb{background-color:var(--sb-thumb);border-radius:var(--sb-thumb-radius);border:2px solid transparent;background-clip:padding-box}.scrollbarThin::-webkit-scrollbar-thumb:hover{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-thumb:active{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-corner{background:var(--sb-track)}.scrollbarThin:focus-within::-webkit-scrollbar-thumb{box-shadow:0 0 0 1px #0000000f inset}#ecommreels-admin-app .ecr-admin-link__label{display:block;text-align:left;font-size:14px;font-weight:600;text-transform:capitalize;margin-bottom:4px}#ecommreels-admin-app .ecr-admin-link__input{width:100%;border-radius:6px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app .ecr-admin-link__input--normal{border-color:#6b7280}#ecommreels-admin-app .ecr-admin-link__input--error{border-color:#ef4444}#ecommreels-admin-app .ecr-admin-link__input:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-link__error{margin:4px 0 0;text-align:left;font-size:12px;color:#ef4444}#ecommreels-admin-app .ecr-admin-link__toggle{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-link__checkbox{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-link__toggle-label{cursor:pointer;font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-link__actions{margin-top:12px;display:flex;gap:8px}#ecommreels-admin-app .ecr-admin-link__actions .ecr-button{text-transform:capitalize;width:100%}#ecommreels-admin-app .ecr-admin-links{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-links__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-links__wrapper{display:flex;flex-direction:column;gap:4px;max-height:380px;overflow-y:auto}#ecommreels-admin-app .ecr-admin-links__item{display:flex;align-items:center;justify-content:space-between;border-radius:6px;background:#eff6ff;padding:2px 8px 2px 16px}#ecommreels-admin-app .ecr-admin-links__remove{color:#ef4444}#ecommreels-admin-app .ecr-admin-links__add-more_btn{margin-top:8px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6;padding:8px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__upgrade{margin-top:12px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6b3;padding:6px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reelvideo{width:100%;border-radius:12px;display:block}#ecommreels-admin-app .ecr-admin-reelvideo--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reelvideo--landscape{width:100%}#ecommreels-admin-app .ecr-admin-customization__panel{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;cursor:grab;align-items:center;justify-content:center;overflow:hidden;border-radius:12px;background:#000;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-customization__panel:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-customization__remove{position:absolute;top:8px;left:8px;z-index:3;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__controls{position:absolute;top:8px;right:8px;z-index:5;display:flex;gap:8px;font-size:18px;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__control{cursor:pointer}#ecommreels-admin-app .ecr-admin-customization{display:flex;width:fit-content;flex-wrap:wrap;gap:16px}#ecommreels-admin-app .ecr-admin-customization__add{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:12px;border:2px dashed #d1d5db;background:#e5e7eb;padding:20px;cursor:pointer}#ecommreels-admin-app .ecr-admin-customization__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-customization__add:hover .ecr-admin-customization__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-customization__label{font-size:13px;color:#4b5563}#ecommreels-admin-app .ecr-admin-customization__lock{position:absolute;top:8px;right:8px;color:#6b7280}#ecommreels-admin-app .ecr-admin-customization__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-thumbnail{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumbnail__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-thumbnail__preview{position:relative;margin:0 auto;width:100%;aspect-ratio:9 / 16;overflow:hidden;border-radius:12px}#ecommreels-admin-app .ecr-admin-thumbnail__image{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-thumbnail__remove{position:absolute;top:8px;right:8px;z-index:3;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-thumbnail__uploader{margin:0 auto;width:100%}#ecommreels-admin-app .ecr-admin-card{margin:24px auto 0;max-width:1024px;border:1px solid #6b7280;border-radius:6px;background:#fff;padding:24px;box-shadow:0 0 8px #aaa}#ecommreels-admin-app .ecr-admin-card--settings{width:fit-content}#ecommreels-admin-app .ecr-admin-card__header{display:flex;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-card__title{margin:0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-groups{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-groups__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-groups__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-groups__create-button{border:1px solid #2563eb;background:#fff;color:#2563eb}#ecommreels-admin-app .ecr-admin-groups__create-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-groups__load-more{display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-groups__load-more__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-load-more-spin 1s linear infinite}@keyframes ecr-load-more-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-groups_action_wrapper{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-groups-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-groups-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-groups-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-groups-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-groups-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-groups-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-groups-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-docs-link{color:#2563eb;display:flex;align-items:center;text-decoration:none;gap:4px;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-docs-link:focus{box-shadow:none}#ecommreels-admin-app .ecr-admin-error{margin-top:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:6px;border:1px solid #fecaca;background:#fef2f2;padding:24px;color:#dc2626}#ecommreels-admin-app .ecr-admin-error__icon{width:28px;height:28px}#ecommreels-admin-app .ecr-admin-error__text{margin:0;text-align:center;font-weight:600}.ecr-table__container{width:100%;overflow-x:auto}.ecr-table{width:100%;border-collapse:collapse;font-size:13px}.ecr-table__header tr{border-bottom:1px solid var(--color-border, #e5e7eb)}.ecr-table__row{border-bottom:1px solid var(--color-border, #e5e7eb);transition:background-color .2s ease}.ecr-table__row:hover,.ecr-table__row[data-state=selected]{background:var(--color-muted, #f3f4f6)}.ecr-table__head,.ecr-table__cell{padding:8px;text-align:left;vertical-align:middle;white-space:nowrap}.ecr-table__head{font-weight:600;color:var(--color-foreground, #111827)}.ecr-table__footer{border-top:1px solid var(--color-border, #e5e7eb);font-weight:600;background:var(--color-muted, #f3f4f6)}.ecr-table__caption{margin-top:16px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-admin-groups__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-groups__row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-groups__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__cell--strong{font-weight:600}#ecommreels-admin-app .ecr-admin-groups__name{display:flex;align-items:center;gap:8px;font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-groups__shortcode{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-groups__shortcode-text{font-family:Courier New,monospace;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-groups__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-groups__copy-button{border:none;border-radius:4px;background:#1f2937;color:#fff;padding:4px 6px;cursor:pointer;transition:transform .15s ease}#ecommreels-admin-app .ecr-admin-groups__copy-button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-groups__copy-icon{display:block;width:12px;height:12px}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip{position:absolute;top:-8px;right:8px;transform:translate(33%,-100%) scale(0);transform-origin:bottom right;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip:after{content:"";position:absolute;bottom:-4px;left:50%;width:12px;height:12px;transform:translate(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip--visible{transform:translate(33%,-100%) scale(1)}#ecommreels-admin-app .ecr-admin-groups__actions{display:flex;align-items:center;justify-content:center;gap:6px}#ecommreels-admin-app .ecr-admin-groups__action-button{color:inherit}#ecommreels-admin-app .ecr-admin-groups__icon{width:18px;height:18px}#ecommreels-admin-app .ecr-admin-groups__icon--neutral{color:#475569}#ecommreels-admin-app .ecr-admin-groups__icon--danger{color:#f43f5e}#ecommreels-admin-app .ecr-admin-groups__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-groups__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:15px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-groups__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-groups__skeleton-table{width:100%;border-collapse:collapse}#ecommreels-admin-app .ecr-admin-groups__skeleton-head{background:#1f2937}#ecommreels-admin-app .ecr-admin-groups__skeleton-row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__skeleton-row--alt{background:#f9fafb}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell{border:1px solid #e5e7eb;padding:8px}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__skeleton-block,#ecommreels-admin-app .ecr-admin-groups__skeleton-line{border-radius:4px;background:#d1d5db;animation:ecr-groups-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-groups__skeleton-block{height:24px}#ecommreels-admin-app .ecr-admin-groups__skeleton-line{height:16px;margin:4px 0}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--tiny,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--tiny{width:32px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--small,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--small{width:96px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--medium,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--medium{width:160px}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--large,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--large{width:220px}@keyframes ecr-groups-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-form{margin-top:24px;display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-form__row{display:grid;grid-template-columns:1fr;align-items:center;gap:24px}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-form__row{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-form__label{font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-form__input{width:128px;border-radius:6px;border:1px solid #d1d5db;padding:8px;font-size:14px}#ecommreels-admin-app .ecr-admin-stats{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-stats__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-stats__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary{font-size:15px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary-skeleton{width:64px;height:24px;border-radius:6px;background:#d1d5db;animation:ecr-stats-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-stats__body{margin-top:16px}@keyframes ecr-stats-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-stats__table{margin-top:8px}#ecommreels-admin-app .ecr-admin-stats__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-stats__row{background:#fff}#ecommreels-admin-app .ecr-admin-stats__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-stats__cell{border:1px solid #e5e7eb;padding:8px;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-stats__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-stats__cell--link{word-break:break-word}#ecommreels-admin-app .ecr-admin-stats__link{color:#2563eb;text-decoration:underline}#ecommreels-admin-app .ecr-admin-stats__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-stats__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-stats__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-group-edit{margin-top:24px;padding:0 24px;display:flex;flex-direction:column;gap:16px;position:relative}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-group-edit{flex-direction:row}}#ecommreels-admin-app .ecr-admin-group-title__wrapper{position:relative}#ecommreels-admin-app .ecr-admin-group-title-customization__trigger{position:absolute;top:50%;translate:0 -50%;right:0;background-color:transparent;color:gray;padding:0 8px}#ecommreels-admin-app .ecr-admin-group-title-customization-dialog{max-width:350px}#ecommreels-admin-app .ecr-admin-nav-btn-reverse{flex-direction:row-reverse}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-nav-btn-reverse{flex-direction:row}}#ecommreels-admin-app .ecr-admin-side-toggle{background:none;border:none;padding:0;color:#6b7280;cursor:pointer}#ecommreels-admin-app .ecr-admin-side-toggle--active{color:#2563eb}.ecr-input{width:100%;min-width:0;border:1px solid transparent;border-radius:6px;background:#f3f4f6;color:inherit;padding:6.4px 12px;font-size:14px;line-height:1.4;transition:border-color .2s ease,box-shadow .2s ease,background-color .2s ease}.ecr-input:focus{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent);background:#fff}.ecr-input::placeholder{color:var(--color-muted-foreground, #9ca3af)}.ecr-input:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-range{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-range__label{font-size:13px;font-weight:600;white-space:nowrap;color:#374151;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-range__row{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-range__slider{width:112px;cursor:pointer;accent-color:#2563eb}#ecommreels-admin-app .ecr-admin-range__value{display:inline-flex;align-items:center;gap:6px}#ecommreels-admin-app .ecr-admin-range__value .ecr-input{width:80px;padding:6px 8px}#ecommreels-admin-app .ecr-admin-range__unit{font-size:12px;color:#6b7280}#ecommreels-admin-app .ecr-admin-group-title_alignment{display:flex;align-items:center;flex-wrap:wrap;gap:8px;justify-content:space-between}#ecommreels-admin-app .ecr-admin-group-title_alignment-label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-group-title_alignment-options{display:flex;align-items:center;gap:0;background-color:#dfdfdf;border-radius:8px;overflow:hidden}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button{border-radius:0;color:#3d3d3d}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button:not(:last-child){border-right:1px solid gray}#ecommreels-admin-app .ecr-admin-group-title-customization__content{display:flex;flex-direction:column;gap:16px;margin-top:40px}#ecommreels-admin-app .ecr-admin-color-selector-popover{width:auto;padding:0;z-index:9}#ecommreels-admin-app .ecr-admin-shortcode{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-shortcode__badge{border-radius:4px;background:#e5e7eb;padding:4px 8px;font-family:Courier New,monospace;font-size:14px;color:#111827;font-weight:900}#ecommreels-admin-app .ecr-admin-shortcode__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-shortcode__button{cursor:pointer;border:none;border-radius:4px;background:#1f2937;padding:4px 6px;color:#fff}#ecommreels-admin-app .ecr-admin-shortcode__button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip{position:absolute;top:50%;right:150%;transform:translateY(-50%) scale(0);transform-origin:center;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-shortcode__tooltip:after{content:"";position:absolute;top:50%;right:-4px;width:12px;height:12px;transform:translateY(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--visible{transform:translateY(-50%) scale(1)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--hidden{transform:translateY(-50%) scale(0)}#ecommreels-admin-app .ecr-admin-reelitem{display:inline-flex;flex-direction:column;width:var(--thumbnail-size, 150px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-reelitem{width:var(--thumbnail-size-mobile, 150px)}}#ecommreels-admin-app .ecr-admin-reelitem__frame{position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:aspect-ratio .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__actions{position:absolute;top:100%;left:0;z-index:1;display:flex;height:50%;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__frame:hover .ecr-admin-reelitem__actions{top:50%}#ecommreels-admin-app .ecr-admin-reelitem__button{background:#fff;color:#111827;padding:4px;border-radius:6px}#ecommreels-admin-app .ecr-admin-reelitem__button:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reelitem__button--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reelitem__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reelitem__spinner{animation:ecr-reelitem-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reelitem__link{display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-reelitem__link--disabled{pointer-events:none}#ecommreels-admin-app .ecr-admin-reelitem__link--active{pointer-events:auto}#ecommreels-admin-app .zoom-in,#ecommreels-admin-app .zoom-out{transition:transform .2s ease}#ecommreels-admin-app .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-reel__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes ecr-reelitem-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-product-card-one,.ecommreels-short-code .ecr-product-card-one,.reelswp-group-short-code .ecr-product-card-one,.reelswp-reel-short-code .ecr-product-card-one{display:flex;flex-direction:column;align-items:stretch;gap:16px;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:8px;padding:8px;overflow:hidden;border:1px solid #fff;flex-shrink:0;border-bottom-left-radius:max(calc(var(--thumbnail-border-radius, 0px) - 4px),8px);border-bottom-right-radius:max(calc(var(--thumbnail-border-radius, 0px) - 4px),8px);transition:all .3s ease-in-out;min-height:var(--thumbnail-border-radius);padding-inline:max(var(--thumbnail-border-radius) / 5,8px)}#ecommreels-admin-app .ecr-product-card-one-content-wrapper,.ecommreels-short-code .ecr-product-card-one-content-wrapper,.reelswp-group-short-code .ecr-product-card-one-content-wrapper,.reelswp-reel-short-code .ecr-product-card-one-content-wrapper{display:flex;align-items:center;gap:8px;flex-shrink:0}#ecommreels-admin-app .ecr-product-card-one__thumb,.ecommreels-short-code .ecr-product-card-one__thumb,.reelswp-group-short-code .ecr-product-card-one__thumb,.reelswp-reel-short-code .ecr-product-card-one__thumb{pointer-events:none;width:40px;height:40px;flex-shrink:0;border-radius:4px}#ecommreels-admin-app .ecr-product-card-one__content,.ecommreels-short-code .ecr-product-card-one__content,.reelswp-group-short-code .ecr-product-card-one__content,.reelswp-reel-short-code .ecr-product-card-one__content{flex-grow:1;display:flex;flex-direction:column;align-items:flex-start;gap:4px;overflow:hidden}#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title{max-width:100%;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:1.2;color:#fff;text-decoration:none}:is(#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title):hover{text-decoration:underline}#ecommreels-admin-app .ecr-product-card-one__meta,.ecommreels-short-code .ecr-product-card-one__meta,.reelswp-group-short-code .ecr-product-card-one__meta,.reelswp-reel-short-code .ecr-product-card-one__meta{display:flex;flex-wrap:wrap;column-gap:8px;row-gap:4px}#ecommreels-admin-app .ecr-product-card-one__rating,.ecommreels-short-code .ecr-product-card-one__rating,.reelswp-group-short-code .ecr-product-card-one__rating,.reelswp-reel-short-code .ecr-product-card-one__rating{margin-left:4px;display:flex;align-items:center;gap:4px;font-size:12px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__star,.ecommreels-short-code .ecr-product-card-one__star,.reelswp-group-short-code .ecr-product-card-one__star,.reelswp-reel-short-code .ecr-product-card-one__star{width:16px;height:16px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price,.ecommreels-short-code .ecr-product-card-one__price,.reelswp-group-short-code .ecr-product-card-one__price,.reelswp-reel-short-code .ecr-product-card-one__price{display:flex;align-items:center;gap:.25ch;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price *,.ecommreels-short-code .ecr-product-card-one__price *,.reelswp-group-short-code .ecr-product-card-one__price *,.reelswp-reel-short-code .ecr-product-card-one__price *{line-height:1;background-color:transparent;color:#fff;font-size:12px}#ecommreels-admin-app .ecr-product-card-one__price span.woocommerce-Price-amount,.ecommreels-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-group-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-reel-short-code .ecr-product-card-one__price span.woocommerce-Price-amount{line-height:normal}#ecommreels-admin-app .ecr-product-card-one__price ins,.ecommreels-short-code .ecr-product-card-one__price ins,.reelswp-group-short-code .ecr-product-card-one__price ins,.reelswp-reel-short-code .ecr-product-card-one__price ins{text-decoration:none}#ecommreels-admin-app .ecr-thumb__link-wrapper,.ecommreels-short-code .ecr-thumb__link-wrapper,.reelswp-group-short-code .ecr-thumb__link-wrapper,.reelswp-reel-short-code .ecr-thumb__link-wrapper{display:flex;flex-direction:column;gap:4px;flex-shrink:0}#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link{display:grid;place-items:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-radius:8px;background-color:transparent;position:relative;min-height:max(var(--thumbnail-border-radius, 48px),48px);text-align:center;font-size:16px;font-weight:600;color:#fff;text-decoration:none;border:1px solid #fff;border-bottom-left-radius:max(var(--thumbnail-border-radius, 8px),8px);border-bottom-right-radius:max(var(--thumbnail-border-radius, 8px),8px);transition:all .3s ease-in-out;isolation:isolate}:is(#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link):hover{text-decoration:underline}:is(#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link):before{content:"";position:absolute;inset:0;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:8px;border-bottom-left-radius:max(var(--thumbnail-border-radius, 8px),8px);border-bottom-right-radius:max(var(--thumbnail-border-radius, 8px),8px);overflow:hidden;z-index:-1;transition:all .3s ease-in-out}#ecommreels-admin-app .ecr-admin-reelitem-links,.ecommreels-short-code .ecr-admin-reelitem-links,.reelswp-group-short-code .ecr-admin-reelitem-links,.reelswp-reel-short-code .ecr-admin-reelitem-links{display:flex;align-items:center;gap:8px;overflow:hidden;margin-top:8px;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-reelitem-links[data-dragging=true] *,.ecommreels-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-group-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-reel-short-code .ecr-admin-reelitem-links[data-dragging=true] *{pointer-events:none}#ecommreels-admin-app .ecr-reel_title,.ecommreels-short-code .ecr-reel_title,.reelswp-group-short-code .ecr-reel_title,.reelswp-reel-short-code .ecr-reel_title{position:absolute;left:50%;transform:translate(-50%);bottom:8px;text-transform:capitalize;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);padding:4px 8px;color:#fff;width:95%;border-radius:8px;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-editor-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-editor-carousel__track{display:flex;width:max-content;flex-wrap:nowrap;padding:16px 0;gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-editor-carousel__track{gap:var(--thumbnail-gap-mobile, 16px)}}#ecommreels-admin-app .ecr-admin-editor-carousel__track--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-carousel__empty{display:flex;width:100%;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-editor-carousel__nav{position:absolute;top:50%;z-index:2;transform:translateY(-50%);border:none;background:#fff;padding:6px 8px;color:#374151;cursor:pointer;width:32px;height:40px;transition:background-color .2s ease;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--left{left:0;border-radius:0 999px 999px 0}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--right{right:0;border-radius:999px 0 0 999px}#ecommreels-admin-app .ecr-admin-editor-grid{display:flex;flex-wrap:wrap;row-gap:16px;column-gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-editor-grid{column-gap:var(--thumbnail-gap-mobile, 16px)}}#ecommreels-admin-app .ecr-admin-editor-grid--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-grid__empty{display:flex;width:100%;justify-content:center;padding-top:160px}#ecommreels-admin-app .ecr-admin-editor-grid__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-grid__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-existing{width:100%;flex:1;overflow:hidden;border-radius:8px;border:1px solid #e5e7eb;background:#fff}#ecommreels-admin-app .ecr-admin-existing__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-existing__title-wrapper{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-existing__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-existing__body{max-height:800px;overflow-y:auto;padding:8px 16px 16px}#ecommreels-admin-app .ecr-preview-player{background-color:#000000b3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);display:grid;place-items:center;padding:24px;width:100%;min-height:320px;border-radius:4px}#ecommreels-admin-app .ecr-preview-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-preview-player .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:min(70vh,560px);max-width:90vw;overflow:hidden;border-radius:24px}#ecommreels-admin-app .ecr-preview-player__media{width:100%;height:100%}#ecommreels-admin-app .ecr-preview-player__media-item{width:100%;object-fit:cover;display:block}#ecommreels-admin-app .ecr-preview-player__nav--disabled{opacity:.4;cursor:not-allowed}#ecommreels-admin-app .ecr-player__close{position:absolute;top:8px;right:8px;z-index:5;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1;background:transparent;border:none}#ecommreels-admin-app .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:5;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecr-preview-player__empty{display:grid;place-items:center;color:#fff;font-size:14px;height:100%;width:100%}#ecommreels-admin-app .ecr-admin-reellist{display:flex;flex-direction:column;min-height:100%;width:100%;flex-shrink:0;overflow-y:auto;border-radius:8px;border:1px solid #e5e7eb;background:#fff;box-shadow:0 1px 2px #0000000d}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-reellist{width:280px}}#ecommreels-admin-app .ecr-admin-reellist__header{border-bottom:1px solid #e5e7eb;padding:16px 16px 8px;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-reellist__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-reellist__body{margin-top:8px;display:flex;flex-direction:column;gap:12px;padding:0 16px 16px}#ecommreels-admin-app .ecr-admin-reellist__add-button{width:100%;flex-shrink:0;margin-inline-start:0;border:1px solid #2563eb;background:#fff}#ecommreels-admin-app .ecr-admin-reellist__add-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reellist__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-reellist__search-input:focus{outline:none;border-color:#93c5fd;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-reellist__grid{margin-top:16px;max-height:60vh;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-reellist__items{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}@media(min-width:767px)and (max-width:1199px){#ecommreels-admin-app .ecr-admin-reellist__items{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-reellist__items{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-reellist__empty{grid-column:1 / -1;padding:24px 0;text-align:center;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-reellist__item{width:100%}#ecommreels-admin-app .ecr-admin-reellist__card{position:relative;width:100%;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease;padding:0}#ecommreels-admin-app .ecr-admin-reellist__card:hover{border-color:#3b82f6}#ecommreels-admin-app .ecr-admin-reellist__media{aspect-ratio:9 / 16;width:100%}#ecommreels-admin-app .ecr-admin-reellist__thumb{pointer-events:none;display:block;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reellist__label{position:absolute;bottom:0;left:0;width:100%;padding:4px;background:linear-gradient(0deg,#fff 20%,#fff0);font-size:13px;font-weight:600;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-reellist__overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#ffffffbf}#ecommreels-admin-app .ecr-admin-reellist__overlay-icon{width:24px;height:24px;color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reellist__loader{grid-column:1 / -1;display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-reellist__spinner{width:24px;height:24px;border-radius:999px;border:2px solid #cbd5e1;border-top-color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}@keyframes ecr-reellist-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-tabs{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-tabs__list{display:inline-flex;align-items:center;background:var(--color-muted, #f3f4f6);border-radius:10px;padding:3px;width:fit-content}#ecommreels-admin-app .ecr-tabs__trigger{border:1px solid transparent;border-radius:8px;padding:8px;font-size:13px;font-weight:600;color:var(--color-muted-foreground, #6b7280);background:transparent;transition:background-color .2s ease,color .2s ease,border-color .2s ease}#ecommreels-admin-app .ecr-tabs__trigger[data-state=active]{background:#fff;color:var(--color-foreground, #111827);border-color:var(--color-border, #e5e7eb);box-shadow:0 1px 2px #0000000f}#ecommreels-admin-app .ecr-tabs__content{outline:none}#ecommreels-admin-app .ecr-admin-sidepanel{position:relative;display:flex;flex-direction:column;min-height:100%;max-height:100%;flex-shrink:0;overflow:hidden;border-radius:8px;transition:width .2s ease}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:100%;height:100%;position:absolute;right:16px;top:0}#ecommreels-admin-app .ecr-admin-mobile-overlay{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#0f172abf;z-index:5}#ecommreels-admin-app .ecr-admin-sidepanel-content{width:280px;background:#fff;margin-left:auto;border:2px solid #e5e7eb;z-index:6;height:100vh;position:fixed;top:0;padding-bottom:64px;right:0}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-sidepanel--expanded{position:static}#ecommreels-admin-app .ecr-admin-mobile-overlay{display:none}#ecommreels-admin-app .ecr-admin-sidepanel-content{position:static;width:280px;background:#fff;margin-left:0;border:2px solid #e5e7eb;height:100%;border-radius:8px}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:fit-content}}#ecommreels-admin-app .ecr-admin-sidepanel--collapsed{width:0;border:0;pointer-events:none}#ecommreels-admin-app .ecr-admin-sidepanel__header{position:relative;display:flex;flex-direction:column;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-sidepanel__title{margin:0;font-size:15px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-sidepanel__body{height:100%;overflow-x:hidden;padding:8px 16px 16px}#ecommreels-admin-app .ecr-admin-sidepanel__tabs,#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{width:100%}#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{display:grid;grid-template-columns:1fr 1fr}#ecommreels-admin-app .ecr-admin-sidepanel__lock-trigger{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;font-size:13px;color:#6b7280;text-transform:capitalize;padding:8px}#ecommreels-admin-app .ecr-admin-sidepanel__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-switch{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:14px;font-weight:500;color:#6b7280}#ecommreels-admin-app .ecr-admin-switch__label{display:inline-flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-switch__icon{color:#6b7280}#ecommreels-admin-app .ecr-admin-popover{background:#eff6ff;z-index:9}#ecommreels-admin-app .ecr-select__trigger{display:inline-flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid var(--color-border, #d1d5db);border-radius:6px;padding:7.2px 12px;font-size:13px;background:#fff;color:var(--color-foreground, #111827);min-width:fit-content}#ecommreels-admin-app .ecr-select__trigger[data-size=sm]{height:32px}#ecommreels-admin-app .ecr-select__trigger[data-size=default]{height:36px}#ecommreels-admin-app .ecr-select__trigger:focus-visible{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent)}#ecommreels-admin-app .ecr-select__icon{width:16px;height:16px;opacity:.6}#ecommreels-admin-app .ecr-select__content{background:#fff;color:var(--color-foreground, #111827);border:1px solid var(--color-border, #d1d5db);border-radius:8px;box-shadow:0 10px 30px #00000026;overflow:hidden;min-width:140px;z-index:9}#ecommreels-admin-app .ecr-select__content[data-side=bottom]{animation:ecr-fade-down .15s ease-out}#ecommreels-admin-app .ecr-select__content[data-side=top]{animation:ecr-fade-up .15s ease-out}#ecommreels-admin-app .ecr-select__viewport{padding:5.6px}#ecommreels-admin-app .ecr-select__item{display:flex;align-items:center;gap:8px;border-radius:6px;padding:8px;font-size:13px;cursor:pointer;text-transform:capitalize}#ecommreels-admin-app .ecr-select__item[data-highlighted]{background:var(--color-accent, #f3f4f6)}#ecommreels-admin-app .ecr-select__item[data-disabled]{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-select__label{padding:5.6px 8px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-select__separator{height:1px;margin:4px 0;background:var(--color-border, #e5e7eb)}#ecommreels-admin-app .ecr-select__check{position:absolute;right:8px;width:14px;height:14px;display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-select__check-icon{width:14px;height:14px}#ecommreels-admin-app .ecr-select__scroll-button{display:flex;align-items:center;justify-content:center;padding:4px 0;cursor:default}@keyframes ecr-fade-down{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}@keyframes ecr-fade-up{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}#ecommreels-admin-app .ecr-admin-thumb-controls{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section{border:1px solid var(--color-border, #e5e7eb);border-radius:10px;padding:12px;background:#fff;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumb-controls__section-trigger{align-items:center;background:transparent;border:none;color:var(--color-foreground, #111827);cursor:pointer;display:flex;font-size:13px;font-weight:600;justify-content:space-between;padding:0;text-align:left}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content[data-state=open]{margin-top:12px;padding-top:12px;border-top:1px solid #e5e7eb}#ecommreels-admin-app .ecr-collapsible__trigger{align-items:center;display:inline-flex;gap:8px;justify-content:space-between;width:100%}#ecommreels-admin-app .ecr-collapsible__trigger-label{align-items:center;display:inline-flex;gap:4px}#ecommreels-admin-app .ecr-collapsible__trigger-icon{height:16px;width:16px;transition:transform .2s ease}#ecommreels-admin-app .ecr-collapsible__trigger[data-state=open] .ecr-collapsible__trigger-icon{transform:rotate(180deg)}#ecommreels-admin-app .ecr-admin-control{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-control--row,#ecommreels-admin-app .ecr-admin-control--inline{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px}#ecommreels-admin-app .ecr-admin-control__label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-control__row{display:flex;align-items:center;gap:12px}#ecommreels-admin-app .ecr-admin-control__row--color{position:relative}#ecommreels-admin-app .ecr-admin-control__choice{display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__choice-label{cursor:pointer;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__trigger,#ecommreels-admin-app .ecr-admin-control__option{text-transform:capitalize}.ecr-admin-control__lock-trigger{display:flex;width:100%;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;font-size:13px;color:#6b7280;cursor:pointer;border:none}.ecr-admin-control__lock-trigger:hover{background:#f3f4f6}.ecr-admin-control__popover{background:#eff6ff}.ecr-admin-control__swatch{width:24px;height:24px;cursor:pointer;border-radius:4px;border:2px solid #6b7280}#ecommreels-admin-app .ecr-admin-control__picker{position:absolute;top:100%;left:0;z-index:9;box-shadow:0 8px 16px #0000001f;outline:none}#ecommreels-admin-app .ecr-admin-control__hex{width:80px;border-radius:4px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{--reels-wp-animation-time: 3s;--reels-wp-marquee-time: 20s}#ecommreels-admin-app .ecr-player__loader,.ecommreels-short-code .ecr-player__loader,.reelswp-group-short-code .ecr-player__loader,.reelswp-reel-short-code .ecr-player__loader{height:90vh;max-width:100vw;aspect-ratio:9 / 16;border-radius:16px;border:1px solid #e5e7eb;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-loader,.ecommreels-short-code .ecr-loader,.reelswp-group-short-code .ecr-loader,.reelswp-reel-short-code .ecr-loader{width:100%;height:100%;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px}#ecommreels-admin-app .ecr-loader__ball,.ecommreels-short-code .ecr-loader__ball,.reelswp-group-short-code .ecr-loader__ball,.reelswp-reel-short-code .ecr-loader__ball{width:20px;height:20px;border-radius:50%;background:#919191;animation:ecr-bounce 1s alternate infinite}#ecommreels-admin-app .ecr-loader__ball:nth-child(2),.ecommreels-short-code .ecr-loader__ball:nth-child(2),.reelswp-group-short-code .ecr-loader__ball:nth-child(2),.reelswp-reel-short-code .ecr-loader__ball:nth-child(2){animation-delay:.25s}#ecommreels-admin-app .ecr-loader__ball:nth-child(3),.ecommreels-short-code .ecr-loader__ball:nth-child(3),.reelswp-group-short-code .ecr-loader__ball:nth-child(3),.reelswp-reel-short-code .ecr-loader__ball:nth-child(3){animation-delay:.5s}@keyframes ecr-bounce{0%{transform:scale(2)}to{transform:scale(1)}}#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{display:block;width:var(--thumbnail-size, 150px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{width:var(--thumbnail-size-mobile, 150px)}}#ecommreels-admin-app .ecr-thumb__frame,.ecommreels-short-code .ecr-thumb__frame,.reelswp-group-short-code .ecr-thumb__frame,.reelswp-reel-short-code .ecr-thumb__frame{cursor:pointer;overflow:hidden;width:100%;position:relative}#ecommreels-admin-app .zoom-in,.ecommreels-short-code .zoom-in,.reelswp-group-short-code .zoom-in,.reelswp-reel-short-code .zoom-in,#ecommreels-admin-app .zoom-out,.ecommreels-short-code .zoom-out,.reelswp-group-short-code .zoom-out,.reelswp-reel-short-code .zoom-out{transition:transform .2s ease-in-out}#ecommreels-admin-app .zoom-in:hover,.ecommreels-short-code .zoom-in:hover,.reelswp-group-short-code .zoom-in:hover,.reelswp-reel-short-code .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover,.ecommreels-short-code .zoom-out:hover,.reelswp-group-short-code .zoom-out:hover,.reelswp-reel-short-code .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-reel__title,.ecommreels-short-code .ecr-reel__title,.reelswp-group-short-code .ecr-reel__title,.reelswp-reel-short-code .ecr-reel__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-front-carousel,.ecommreels-short-code .ecr-front-carousel,.reelswp-group-short-code .ecr-front-carousel,.reelswp-reel-short-code .ecr-front-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-front-carousel__viewport,.ecommreels-short-code .ecr-front-carousel__viewport,.reelswp-group-short-code .ecr-front-carousel__viewport,.reelswp-reel-short-code .ecr-front-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{display:flex;flex-wrap:nowrap;width:max-content;gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{gap:var(--thumbnail-gap-mobile, 16px)}}#ecommreels-admin-app .ecr-front-carousel__track--zoom,.ecommreels-short-code .ecr-front-carousel__track--zoom,.reelswp-group-short-code .ecr-front-carousel__track--zoom,.reelswp-reel-short-code .ecr-front-carousel__track--zoom{padding:16px}#ecommreels-admin-app .ecr-front-carousel__nav,.ecommreels-short-code .ecr-front-carousel__nav,.reelswp-group-short-code .ecr-front-carousel__nav,.reelswp-reel-short-code .ecr-front-carousel__nav{position:absolute;top:50%;z-index:1;transform:translateY(-50%);border:none;background:#fff;color:#1f2937;cursor:pointer;width:32px;height:40px;padding:0;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-front-carousel__nav--left,.ecommreels-short-code .ecr-front-carousel__nav--left,.reelswp-group-short-code .ecr-front-carousel__nav--left,.reelswp-reel-short-code .ecr-front-carousel__nav--left{left:0;border-top-right-radius:999px;border-bottom-right-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav--right,.ecommreels-short-code .ecr-front-carousel__nav--right,.reelswp-group-short-code .ecr-front-carousel__nav--right,.reelswp-reel-short-code .ecr-front-carousel__nav--right{right:0;border-top-left-radius:999px;border-bottom-left-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav:hover,.ecommreels-short-code .ecr-front-carousel__nav:hover,.reelswp-group-short-code .ecr-front-carousel__nav:hover,.reelswp-reel-short-code .ecr-front-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-front-grid,.ecommreels-short-code .ecr-front-grid,.reelswp-group-short-code .ecr-front-grid,.reelswp-reel-short-code .ecr-front-grid{cursor:default;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid, 150px),1fr));row-gap:16px;column-gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{column-gap:var(--thumbnail-gap-mobile, 16px);grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid-mobile, 150px),1fr))}}
    2 /*$vite$:1*/`,document.head.appendChild(ya);function wa(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const x=wa(y),vr=wa(_a);function Cd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var In={exports:{}},qt={};/**
     1(function(y,_a,Ln,va){"use strict";var ya=document.createElement("style");ya.textContent=`:root{--color-primary: #2563eb;--color-primary-foreground: #ffffff;--color-secondary: #e5e7eb;--color-secondary-foreground: #111827;--color-foreground: #111827;--color-muted: #f3f4f6;--color-muted-foreground: #6b7280;--color-accent: #f3f4f6;--color-border: #e5e7eb;--color-ring: #60a5fa}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{box-sizing:border-box;color:var(--color-foreground, #111);font-family:Inter,Segoe UI,system-ui,-apple-system,sans-serif}#ecommreels-admin-app *,#ecommreels-admin-app *:before,#ecommreels-admin-app *:after,.ecommreels-short-code *,.ecommreels-short-code *:before,.ecommreels-short-code *:after,.reelswp-group-short-code *,.reelswp-group-short-code *:before,.reelswp-group-short-code *:after,.reelswp-reel-short-code *,.reelswp-reel-short-code *:before,.reelswp-reel-short-code *:after{box-sizing:inherit}#ecommreels-admin-app input,#ecommreels-admin-app select,#ecommreels-admin-app textarea,.ecommreels-short-code input,.ecommreels-short-code select,.ecommreels-short-code textarea,.reelswp-group-short-code input,.reelswp-group-short-code select,.reelswp-group-short-code textarea,.reelswp-reel-short-code input,.reelswp-reel-short-code select,.reelswp-reel-short-code textarea{font:inherit;color:inherit}#ecommreels-admin-app button,.ecommreels-short-code button,.reelswp-group-short-code button,.reelswp-reel-short-code button{border:none}#ecommreels-admin-app input[type=checkbox],#ecommreels-admin-app input[type=radio],.ecommreels-short-code input[type=checkbox],.ecommreels-short-code input[type=radio],.reelswp-group-short-code input[type=checkbox],.reelswp-group-short-code input[type=radio],.reelswp-reel-short-code input[type=checkbox],.reelswp-reel-short-code input[type=radio]{margin:0}#ecommreels-admin-app input[type=number]::-webkit-inner-spin-button,#ecommreels-admin-app input[type=number]::-webkit-outer-spin-button,.ecommreels-short-code input[type=number]::-webkit-inner-spin-button,.ecommreels-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-group-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-group-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}#ecommreels-admin-app input[type=number],.ecommreels-short-code input[type=number],.reelswp-group-short-code input[type=number],.reelswp-reel-short-code input[type=number]{-moz-appearance:textfield}#ecommreels-admin-app input,.ecommreels-short-code input,.reelswp-group-short-code input,.reelswp-reel-short-code input{min-height:auto}#ecommreels-admin-app img,.ecommreels-short-code img,.reelswp-group-short-code img,.reelswp-reel-short-code img{max-width:100%;display:block}#ecommreels-admin-app h1,#ecommreels-admin-app h2,#ecommreels-admin-app h3,#ecommreels-admin-app h4,#ecommreels-admin-app h5,#ecommreels-admin-app h6,.ecommreels-short-code h1,.ecommreels-short-code h2,.ecommreels-short-code h3,.ecommreels-short-code h4,.ecommreels-short-code h5,.ecommreels-short-code h6,.reelswp-group-short-code h1,.reelswp-group-short-code h2,.reelswp-group-short-code h3,.reelswp-group-short-code h4,.reelswp-group-short-code h5,.reelswp-group-short-code h6,.reelswp-reel-short-code h1,.reelswp-reel-short-code h2,.reelswp-reel-short-code h3,.reelswp-reel-short-code h4,.reelswp-reel-short-code h5,.reelswp-reel-short-code h6{margin:0;font-weight:600}#ecommreels-admin-app p,.ecommreels-short-code p,.reelswp-group-short-code p,.reelswp-reel-short-code p{margin:0}#ecommreels-admin-app .ecr-admin-panel{position:relative;margin:24px;min-height:50vh;border-radius:6px;border:1px solid #d1d5db;background:#fff;padding:16px}#ecommreels-admin-app .ecr-admin-panel--reels{padding:16px}#ecommreels-admin-app .ecr-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid transparent;border-radius:6px;font-size:14px;font-weight:600;line-height:1;padding:8px 16px;background:#111;color:#fff;cursor:pointer;transition:background-color .2s ease,border-color .2s ease,color .2s ease,box-shadow .2s ease,transform .2s ease}#ecommreels-admin-app .ecr-button:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-button--primary{background:#2563eb;color:#fff}#ecommreels-admin-app .ecr-button--primary:hover{background:#1f29371a}#ecommreels-admin-app .ecr-button--secondary{background:#e5e7eb;color:#111827}#ecommreels-admin-app .ecr-button--secondary:hover{background:#e5e7eb1a}#ecommreels-admin-app .ecr-button--outline{background:transparent;border-color:#2563eb;color:#2563eb}#ecommreels-admin-app .ecr-button--outline:hover{background:#2563eb1a}#ecommreels-admin-app .ecr-button--outline-danger{background:transparent;border-color:#dc2626;color:#dc2626}#ecommreels-admin-app .ecr-button--outline-danger:hover{background:#dc26261a}#ecommreels-admin-app .ecr-button--ghost{background:transparent;color:#111827}#ecommreels-admin-app .ecr-button--ghost:hover{background:#f3f4f6}#ecommreels-admin-app .ecr-button--link{background:none;border-color:transparent;padding:0;color:#2563eb;text-decoration:none}#ecommreels-admin-app .ecr-button--link:hover{text-decoration:underline}#ecommreels-admin-app .ecr-button--danger{background:#dc2626;color:#fff}#ecommreels-admin-app .ecr-button--danger:hover{background:#b91c1c}#ecommreels-admin-app .ecr-button--sm{height:32px;padding:0 12px;font-size:13px}#ecommreels-admin-app .ecr-button--md{height:36px;padding:0 16px}#ecommreels-admin-app .ecr-button--lg{height:40px;padding:0 20px;font-size:15px}#ecommreels-admin-app .ecr-button--icon,#ecommreels-admin-app .ecr-button--icon-sm,#ecommreels-admin-app .ecr-button--icon-lg{padding:0;width:36px;height:36px}#ecommreels-admin-app .ecr-button--icon-sm{width:32px;height:32px}#ecommreels-admin-app .ecr-button--icon-lg{width:40px;height:40px}#ecommreels-admin-app .ecr-admin-reels-header{margin-bottom:16px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__left{display:flex;align-items:center;gap:32px}#ecommreels-admin-app .ecr-admin-reels-header__right{display:flex;flex-wrap:wrap;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__title{margin:0;padding:6px 0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-reels-header__actions{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__action{padding:0;font-weight:600;background:none;border:none;box-shadow:none}#ecommreels-admin-app .ecr-admin-reels-header__action--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reels-header__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reels-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-reels-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-reels-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-reels-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__create{border:1px solid #3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-reels-header__create:hover{background:#ffffffe6}#ecommreels-admin-app .ecr-admin-reels-header__spinner{animation:ecr-reels-spin 1s linear infinite}@keyframes ecr-reels-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-reels-empty{display:flex;align-items:center;justify-content:center;padding-top:50px}#ecommreels-admin-app .ecr-admin-reels-empty__text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:14px}#ecommreels-admin-app .ecr-admin-reels-loading{display:flex;align-items:center;justify-content:center;padding:16px 0}#ecommreels-admin-app .ecr-admin-reels-loading--fullscreen{position:absolute;inset:0}#ecommreels-admin-app .ecr-admin-reels-loading__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-reels-loading-spin 1s linear infinite}@keyframes ecr-reels-loading-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-player__progress,.ecommreels-short-code .ecr-player__progress,.reelswp-group-short-code .ecr-player__progress,.reelswp-reel-short-code .ecr-player__progress{position:absolute;top:4px;left:50%;z-index:2;display:flex;width:90%;transform:translate(-50%);gap:4px;overflow:hidden;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-track,.ecommreels-short-code .ecr-player__progress-track,.reelswp-group-short-code .ecr-player__progress-track,.reelswp-reel-short-code .ecr-player__progress-track{width:100%;height:3px;background:#ffffff80;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-fill,.ecommreels-short-code .ecr-player__progress-fill,.reelswp-group-short-code .ecr-player__progress-fill,.reelswp-reel-short-code .ecr-player__progress-fill{height:3px;background:#fff;border-radius:999px;width:0}#ecommreels-admin-app .ecr-player__progress-fill--active,.ecommreels-short-code .ecr-player__progress-fill--active,.reelswp-group-short-code .ecr-player__progress-fill--active,.reelswp-reel-short-code .ecr-player__progress-fill--active{animation:ecr-progress var(--reels-wp-animation-time) linear forwards}#ecommreels-admin-app .ecr-player__progress-fill--complete,.ecommreels-short-code .ecr-player__progress-fill--complete,.reelswp-group-short-code .ecr-player__progress-fill--complete,.reelswp-reel-short-code .ecr-player__progress-fill--complete{width:100%}#ecommreels-admin-app .ecr-player__progress-fill--empty,.ecommreels-short-code .ecr-player__progress-fill--empty,.reelswp-group-short-code .ecr-player__progress-fill--empty,.reelswp-reel-short-code .ecr-player__progress-fill--empty{width:0}@keyframes ecr-progress{0%{width:0}to{width:100%}}#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{position:absolute;top:50%;z-index:5;display:none;width:40px;height:40px;padding:0;transform:translateY(-50%);border:none;border-radius:999px;background:#ffffffd9;color:#374151;cursor:pointer;align-items:center;justify-content:center}@media(min-width:1024px){#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{display:grid}}#ecommreels-admin-app .ecr-player__nav--left,.ecommreels-short-code .ecr-player__nav--left,.reelswp-group-short-code .ecr-player__nav--left,.reelswp-reel-short-code .ecr-player__nav--left{left:0;transform:translate(-120%,-50%)}#ecommreels-admin-app .ecr-player__nav--right,.ecommreels-short-code .ecr-player__nav--right,.reelswp-group-short-code .ecr-player__nav--right,.reelswp-reel-short-code .ecr-player__nav--right{right:0;transform:translate(120%,-50%)}#ecommreels-admin-app .ecr-player__nav:hover,.ecommreels-short-code .ecr-player__nav:hover,.reelswp-group-short-code .ecr-player__nav:hover,.reelswp-reel-short-code .ecr-player__nav:hover{background:#fff}#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{position:relative;display:flex;width:100%;height:100%;align-items:center;justify-content:center;overflow:hidden;border-radius:16px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{border-radius:0}}#ecommreels-admin-app .ecr-player__media,.ecommreels-short-code .ecr-player__media,.reelswp-group-short-code .ecr-player__media,.reelswp-reel-short-code .ecr-player__media{width:100%;height:auto}#ecommreels-admin-app .ecr-player__media--portrait,.ecommreels-short-code .ecr-player__media--portrait,.reelswp-group-short-code .ecr-player__media--portrait,.reelswp-reel-short-code .ecr-player__media--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-player__media--auto,.ecommreels-short-code .ecr-player__media--auto,.reelswp-group-short-code .ecr-player__media--auto,.reelswp-reel-short-code .ecr-player__media--auto{height:auto}#ecommreels-admin-app .ecr-player__slider,.ecommreels-short-code .ecr-player__slider,.reelswp-group-short-code .ecr-player__slider,.reelswp-reel-short-code .ecr-player__slider{position:absolute;top:0;display:flex;background:#000;transition:left .2s ease}#ecommreels-admin-app .ecr-player__slide,.ecommreels-short-code .ecr-player__slide,.reelswp-group-short-code .ecr-player__slide,.reelswp-reel-short-code .ecr-player__slide{position:relative;display:flex;align-items:center;justify-content:center;height:90vh;max-width:100vw;aspect-ratio:9 / 16}#ecommreels-admin-app .ecr-player__controls,.ecommreels-short-code .ecr-player__controls,.reelswp-group-short-code .ecr-player__controls,.reelswp-reel-short-code .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:5;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon,.ecommreels-short-code .ecr-player__control-icon,.reelswp-group-short-code .ecr-player__control-icon,.reelswp-reel-short-code .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecommreels-story-modal,.ecommreels-short-code .ecommreels-story-modal,.reelswp-group-short-code .ecommreels-story-modal,.reelswp-reel-short-code .ecommreels-story-modal{max-width:100%!important;z-index:2147483647;background-color:#000c;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}#ecommreels-admin-app #player *,.ecommreels-short-code #player *,.reelswp-group-short-code #player *,.reelswp-reel-short-code #player *{scrollbar-width:none;-ms-overflow-style:none}#ecommreels-admin-app #player *::-webkit-scrollbar,.ecommreels-short-code #player *::-webkit-scrollbar,.reelswp-group-short-code #player *::-webkit-scrollbar,.reelswp-reel-short-code #player *::-webkit-scrollbar{display:none}#ecommreels-admin-app .ecr-player,.ecommreels-short-code .ecr-player,.reelswp-group-short-code .ecr-player,.reelswp-reel-short-code .ecr-player{position:fixed!important;top:0!important;left:0!important;display:grid;place-items:center;width:100vw!important;height:100vh!important}#ecommreels-admin-app .ecr-player__stage,.ecommreels-short-code .ecr-player__stage,.reelswp-group-short-code .ecr-player__stage,.reelswp-reel-short-code .ecr-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:90vh;max-width:100vw;overflow:hidden;border-radius:24px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{height:100vh;border-radius:0}}#ecommreels-admin-app .ecr-player__close,.ecommreels-short-code .ecr-player__close,.reelswp-group-short-code .ecr-player__close,.reelswp-reel-short-code .ecr-player__close{position:absolute;top:8px;right:8px;z-index:5;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1}#ecommreels-admin-app .ecr-player__close-icon,.ecommreels-short-code .ecr-player__close-icon,.reelswp-group-short-code .ecr-player__close-icon,.reelswp-reel-short-code .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-admin-reels-grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}#ecommreels-admin-app .ecr-thumb__media,.ecommreels-short-code .ecr-thumb__media,.reelswp-group-short-code .ecr-thumb__media,.reelswp-reel-short-code .ecr-thumb__media{position:relative;width:100%;height:100%}#ecommreels-admin-app .ecr-thumb__video,.ecommreels-short-code .ecr-thumb__video,.reelswp-group-short-code .ecr-thumb__video,.reelswp-reel-short-code .ecr-thumb__video{pointer-events:none;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-thumb__placeholder,.ecommreels-short-code .ecr-thumb__placeholder,.reelswp-group-short-code .ecr-thumb__placeholder,.reelswp-reel-short-code .ecr-thumb__placeholder{display:flex;width:100%;height:100%;align-items:center;justify-content:center;background:#e5e7eb;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-thumb__views,.ecommreels-short-code .ecr-thumb__views,.reelswp-group-short-code .ecr-thumb__views,.reelswp-reel-short-code .ecr-thumb__views{position:absolute;top:8px;z-index:4;display:inline-flex;align-items:center;gap:4px;background:#6b7280;color:#fff;padding:2.4px 5.6px;font-size:11px;border-radius:4px}#ecommreels-admin-app .ecr-admin-reel-card{display:block}#ecommreels-admin-app .ecr-admin-reel-card__frame{position:relative;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease,box-shadow .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame--selected{border-color:#3b82f6;box-shadow:0 0 0 2px #2b7fff}#ecommreels-admin-app .ecr-admin-reel-card__actions{position:absolute;top:100%;z-index:5;display:flex;width:100%;height:50%;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__actions--hover{top:50%}#ecommreels-admin-app .ecr-admin-reel-card__action{background:#fff;color:#111827}#ecommreels-admin-app .ecr-admin-reel-card__action:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reel-card__icon--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reel-card__icon--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__corner{position:absolute;display:flex;top:-2px;right:-2px;z-index:6;width:42px;height:42px;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__corner--hidden{transform:translate(100%,-100%)}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__corner--hidden{transform:translate(0)}#ecommreels-admin-app .ecr-admin-reel-card__corner--selected{background:#3b82f6}#ecommreels-admin-app .ecr-admin-reel-card__corner--idle{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__select{margin-left:auto;width:24px;height:24px;border-radius:4px;background:transparent;padding:4px}#ecommreels-admin-app .ecr-admin-reel-card__select:hover{background:none}#ecommreels-admin-app .ecr-admin-reel-card__check{color:#6b7280}#ecommreels-admin-app .ecr-admin-reel-card__check--active{color:#fff}#ecommreels-admin-app .ecr-admin-reel-card__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-back-button{background:none;border:none;padding:0;color:#6b7280;cursor:pointer;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-back-button:hover{color:#2563eb}#ecommreels-admin-app .ecr-admin-breadcrumb{margin-top:12px;padding:0 24px;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-breadcrumb__list{display:flex;flex-wrap:wrap;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-breadcrumb__item{display:inline-flex;align-items:center}#ecommreels-admin-app .ecr-admin-breadcrumb__link{color:#2563eb;text-decoration:none;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-breadcrumb__current{font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-breadcrumb__separator{margin:0 4px;font-size:18px;color:#9ca3af}#ecommreels-admin-app .ecr-admin-modal{position:fixed;inset:0;z-index:2147483647;display:grid;place-items:center;background:#000c}#ecommreels-admin-app .ecr-admin-modal__panel{border-radius:8px;background:#fff;padding:24px;min-width:320px;max-width:500px}#ecommreels-admin-app .ecr-admin-modal__content{margin-bottom:16px}#ecommreels-admin-app .ecr-admin-modal__icon{margin-bottom:8px;display:flex;justify-content:center}#ecommreels-admin-app .ecr-admin-modal__message{margin:0;font-size:16px;font-weight:600;color:#111827;text-align:center}#ecommreels-admin-app .ecr-admin-modal__actions{display:flex;width:100%;align-items:center;justify-content:center;gap:8px}#ecommreels-admin-app .ecr-admin-modal__button{border-radius:6px;border:1px solid transparent;padding:6px 24px;font-size:14px;font-weight:600;cursor:pointer}#ecommreels-admin-app .ecr-admin-modal__button:disabled{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-modal__button--cancel{border-color:#3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-modal__button--danger{display:inline-flex;align-items:center;gap:6px;border-color:#ef4444;background:#ef4444;color:#fff}#ecommreels-admin-app .ecr-admin-modal__spinner{animation:ecr-modal-spin 1s linear infinite}@keyframes ecr-modal-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-link-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:6px;background:#3b82f6;padding:8px 16px;font-size:14px;font-weight:600;text-decoration:none;transition:background-color .15s ease;margin-inline-start:auto;white-space:nowrap}#ecommreels-admin-app .ecr-admin-link-button:hover{background:#1d4ed8}#ecommreels-admin-app .ecr-admin-loader{position:fixed;inset:0;z-index:5;display:grid;place-items:center;background:#fffc;color:#3b82f6}#ecommreels-admin-app .ecr-admin-loader__icon{animation:ecr-admin-spin 1s linear infinite}@keyframes ecr-admin-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-navbar{display:flex;align-items:center;justify-content:space-between;background:#fff;padding:16px 24px;gap:16px;flex-wrap:wrap}#ecommreels-admin-app .ecr-admin-navbar__section{display:flex;align-items:center;gap:16px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-navbar{justify-content:center}}#ecommreels-admin-app .ecr-admin-page-name{margin:0;display:inline-flex;align-items:center;gap:4px;font-size:20px;font-weight:600;-webkit-user-select:none;user-select:none;white-space:nowrap}#ecommreels-admin-app .ecr-admin-widget-name{display:inline-flex;align-items:center;justify-content:center;gap:4px;width:320px;border-radius:6px;background:#e5e7eb;padding:8px;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create{margin:16px 24px 0;display:flex;gap:24px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create{flex-direction:column}}#ecommreels-admin-app .ecr-admin-create__panel{position:relative;overflow-x:hidden;border-radius:16px;background:#fff;padding:16px 20px 20px}#ecommreels-admin-app .ecr-admin-create__panel--main{flex:1;min-width:0}#ecommreels-admin-app .ecr-admin-create__panel--side{width:300px;flex-shrink:0}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create__panel--side{width:100%}}#ecommreels-admin-app .ecr-admin-create__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create__separator{margin:12px 0}#ecommreels-admin-app .ecr-admin-save-button{background:#3b82f6;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-save-button:hover{background:#2563eb}#ecommreels-admin-app .ecr-admin-save-button:disabled{background:#6b7280}#ecommreels-admin-app .ecr-admin-save-button__icon{font-size:16px}#ecommreels-admin-app .ecr-admin-save-button__icon--spin{animation:ecr-save-spin 1s linear infinite}@keyframes ecr-save-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-title-input{width:320px;border-radius:6px;border:1px solid transparent;background:#e5e7eb;padding:8px;text-align:center;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-upload{display:grid;width:260px;aspect-ratio:9 / 16;place-items:center;border-radius:12px;border:2px dashed #d1d5db;background:#eff6ff;padding:20px}#ecommreels-admin-app .ecr-admin-upload--active{border-color:#3b82f6;background:#eff6ff}#ecommreels-admin-app .ecr-admin-upload--idle{border-color:#d1d5db}#ecommreels-admin-app .ecr-admin-upload__label{display:grid;cursor:pointer;place-items:center;text-align:center}#ecommreels-admin-app .ecr-admin-upload__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-upload__label:hover .ecr-admin-upload__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-upload__text{margin:8px 0 0;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-stack{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-upload__text-item{font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-strong{font-weight:600}#ecommreels-admin-app .ecr-popover{border-radius:10px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding-block:16px;width:288px;box-shadow:0 10px 30px #00000026;z-index:999}#ecommreels-admin-app .ecr-popover[data-state=open]{animation:ecr-popover-in .15s ease-out}@keyframes ecr-popover-in{0%{opacity:0;transform:translateY(4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.ecr-separator{background:var(--color-border, #e5e7eb);flex-shrink:0}.ecr-separator[data-orientation=horizontal]{height:1px;width:100%}.ecr-separator[data-orientation=vertical]{width:1px;height:100%}.ecr-admin-upgrade__title{margin:0;display:inline-flex;align-items:center;gap:6px;font-weight:600;padding-inline:16px}.ecr-admin-upgrade__name{text-transform:capitalize}.ecr-admin-upgrade__tag{display:inline-block;padding:0 4px;border-radius:2px;background:#2563eb;color:#fff;font-size:10px;letter-spacing:.32px}.ecr-admin-upgrade__text{margin:0;font-size:13px;color:#374151;line-height:1.4;padding-inline:16px}.ecr-admin-upgrade__actions{display:flex;justify-content:flex-end;padding-inline:16px}.ecr-admin-upgrade__button{background:#3b82f6;color:#fff}.ecr-admin-upgrade__button:hover{background:#2563eb}.ecr-admin-upgrade__link{font-size:13px;text-decoration:none}.ecr-admin-separator{margin:12px 0}#ecommreels-admin-app .ecr-dialog__overlay{position:fixed;inset:0;background:#0f172abf;z-index:5}#ecommreels-admin-app .ecr-dialog__overlay[data-state=open]{animation:ecr-dialog-overlay-in .15s ease-out}#ecommreels-admin-app .ecr-dialog__content{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(500px,92vw);max-height:85vh;overflow:auto;border-radius:12px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding:20px;box-shadow:0 25px 60px #0f172a40;z-index:6}#ecommreels-admin-app .ecr-dialog__content[data-state=open]{animation:ecr-dialog-content-in .2s ease-out}#ecommreels-admin-app .ecr-dialog__close{position:absolute;right:12px;top:12px;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-muted-foreground, #6b7280);cursor:pointer}#ecommreels-admin-app .ecr-dialog__close:hover{color:var(--color-foreground, #111827)}#ecommreels-admin-app .ecr-dialog__close-icon{width:16px;height:16px}#ecommreels-admin-app .ecr-dialog__header{display:flex;flex-direction:column;gap:6px;padding-right:36px;margin-bottom:16px}#ecommreels-admin-app .ecr-dialog__title{font-size:16px;font-weight:600;text-transform:none}#ecommreels-admin-app .ecr-dialog__description{font-size:13px;color:var(--color-muted-foreground, #6b7280)}@keyframes ecr-dialog-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes ecr-dialog-content-in{0%{opacity:0;transform:translate(-50%,-48%) scale(.98)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}#ecommreels-admin-app .ecr-admin-link-tabs{width:100%;max-height:550px}#ecommreels-admin-app .ecr-admin-link-tabs__list{width:100%;display:grid;grid-template-columns:1fr;gap:8px;border-radius:10px;padding:3px}#ecommreels-admin-app .ecr-admin-link-tabs__trigger,#ecommreels-admin-app .ecr-admin-link-tabs__lock{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;border:1px solid #3b82f6;border-radius:8px;padding:8px;font-size:13px;font-weight:600;background:#fff;color:#6b7280;text-transform:none}#ecommreels-admin-app .ecr-admin-link-tabs__lock{border-color:#969eab}#ecommreels-admin-app .ecr-admin-link-tabs__trigger{color:#3b82f6}#ecommreels-admin-app .ecr-admin-link-tabs__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-link-tabs__content{display:flex;flex-direction:column;gap:20px}#ecommreels-admin-app .ecr-admin-link-dialog{max-width:560px}#ecommreels-admin-app .ecr-admin-product-link__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-product-link__list{height:100%;max-height:300px;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-product-link__list-inner{display:flex;flex-direction:column;gap:8px;width:100%}#ecommreels-admin-app .ecr-admin-product-link__empty{padding:24px 0;text-align:center;font-size:14px;color:#6b7280}#ecommreels-admin-app .ecr-admin-product-link__item{width:100%}#ecommreels-admin-app .ecr-admin-product-link__button{height:auto;width:100%;justify-content:flex-start;border:1px solid #e5e7eb;background:#f7f7f7;color:#111827;padding:8px;font-weight:400;text-align:left;font-size:13px;display:flex;align-items:center;gap:8px;border-radius:6px}#ecommreels-admin-app .ecr-admin-product-link__button--selected{border-color:#2563eb;background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__button--unselected:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__thumb{pointer-events:none;width:40px;height:40px;flex:0 0 auto}#ecommreels-admin-app .ecr-admin-product-link__error{margin:0 0 8px;text-align:left;font-size:14px;color:#ef4444}#ecommreels-admin-app .ecr-admin-product-link__actions{display:flex;justify-content:end}#ecommreels-admin-app .ecr-admin-product-link__actions .ecr-button{text-transform:capitalize;padding:12px 32px}#ecommreels-admin-app .ecr-admin-product-link__loader{display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-product-link__spinner{width:24px;height:24px;border-radius:999px;border-bottom:2px solid #3b82f6;animation:ecr-admin-product-link-spin 1s linear infinite}@keyframes ecr-admin-product-link-spin{to{transform:rotate(360deg)}}.scrollbarThin{--sb-track: transparent;--sb-thumb: rgba(0, 0, 0, .35);--sb-thumb-hover: rgba(0, 0, 0, .5);--sb-thumb-radius: 6px;--sb-size: 8px;scrollbar-width:thin;scrollbar-color:var(--sb-thumb) var(--sb-track);-ms-overflow-style:auto}.scrollbarThin::-webkit-scrollbar{width:var(--sb-size);height:var(--sb-size)}.scrollbarThin::-webkit-scrollbar-track{background:var(--sb-track)}.scrollbarThin::-webkit-scrollbar-thumb{background-color:var(--sb-thumb);border-radius:var(--sb-thumb-radius);border:2px solid transparent;background-clip:padding-box}.scrollbarThin::-webkit-scrollbar-thumb:hover{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-thumb:active{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-corner{background:var(--sb-track)}.scrollbarThin:focus-within::-webkit-scrollbar-thumb{box-shadow:0 0 0 1px #0000000f inset}#ecommreels-admin-app .ecr-admin-link__label{display:block;text-align:left;font-size:14px;font-weight:600;text-transform:capitalize;margin-bottom:4px}#ecommreels-admin-app .ecr-admin-link__input{width:100%;border-radius:6px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app .ecr-admin-link__input--normal{border-color:#6b7280}#ecommreels-admin-app .ecr-admin-link__input--error{border-color:#ef4444}#ecommreels-admin-app .ecr-admin-link__input:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-link__error{margin:4px 0 0;text-align:left;font-size:12px;color:#ef4444}#ecommreels-admin-app .ecr-admin-link__toggle{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-link__checkbox{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-link__toggle-label{cursor:pointer;font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-link__actions{margin-top:12px;display:flex;gap:8px}#ecommreels-admin-app .ecr-admin-link__actions .ecr-button{text-transform:capitalize;width:100%}#ecommreels-admin-app .ecr-admin-links{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-links__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-links__wrapper{display:flex;flex-direction:column;gap:4px;max-height:380px;overflow-y:auto}#ecommreels-admin-app .ecr-admin-links__item{display:flex;align-items:center;justify-content:space-between;border-radius:6px;background:#eff6ff;padding:2px 8px 2px 16px}#ecommreels-admin-app .ecr-admin-links__remove{color:#ef4444}#ecommreels-admin-app .ecr-admin-links__add-more_btn{margin-top:8px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6;padding:8px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__upgrade{margin-top:12px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6b3;padding:6px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reelvideo{width:100%;border-radius:12px;display:block}#ecommreels-admin-app .ecr-admin-reelvideo--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reelvideo--landscape{width:100%}#ecommreels-admin-app .ecr-admin-customization__panel{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;cursor:grab;align-items:center;justify-content:center;overflow:hidden;border-radius:12px;background:#000;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-customization__panel:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-customization__remove{position:absolute;top:8px;left:8px;z-index:3;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__controls{position:absolute;top:8px;right:8px;z-index:5;display:flex;gap:8px;font-size:18px;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__control{cursor:pointer}#ecommreels-admin-app .ecr-admin-customization{display:flex;width:fit-content;flex-wrap:wrap;gap:16px}#ecommreels-admin-app .ecr-admin-customization__add{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:12px;border:2px dashed #d1d5db;background:#e5e7eb;padding:20px;cursor:pointer}#ecommreels-admin-app .ecr-admin-customization__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-customization__add:hover .ecr-admin-customization__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-customization__label{font-size:13px;color:#4b5563}#ecommreels-admin-app .ecr-admin-customization__lock{position:absolute;top:8px;right:8px;color:#6b7280}#ecommreels-admin-app .ecr-admin-customization__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-thumbnail{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumbnail__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-thumbnail__preview{position:relative;margin:0 auto;width:100%;aspect-ratio:9 / 16;overflow:hidden;border-radius:12px}#ecommreels-admin-app .ecr-admin-thumbnail__image{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-thumbnail__remove{position:absolute;top:8px;right:8px;z-index:3;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-thumbnail__uploader{margin:0 auto;width:100%}#ecommreels-admin-app .ecr-admin-card{margin:24px auto 0;max-width:1024px;border:1px solid #6b7280;border-radius:6px;background:#fff;padding:24px;box-shadow:0 0 8px #aaa}#ecommreels-admin-app .ecr-admin-card--settings{width:fit-content}#ecommreels-admin-app .ecr-admin-card__header{display:flex;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-card__title{margin:0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-groups{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-groups__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-groups__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-groups__create-button{border:1px solid #2563eb;background:#fff;color:#2563eb}#ecommreels-admin-app .ecr-admin-groups__create-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-groups__load-more{display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-groups__load-more__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-load-more-spin 1s linear infinite}@keyframes ecr-load-more-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-groups_action_wrapper{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-groups-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-groups-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-groups-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-groups-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-groups-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-groups-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-groups-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-docs-link{color:#2563eb;display:flex;align-items:center;text-decoration:none;gap:4px;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-docs-link:focus{box-shadow:none}#ecommreels-admin-app .ecr-admin-error{margin-top:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:6px;border:1px solid #fecaca;background:#fef2f2;padding:24px;color:#dc2626}#ecommreels-admin-app .ecr-admin-error__icon{width:28px;height:28px}#ecommreels-admin-app .ecr-admin-error__text{margin:0;text-align:center;font-weight:600}.ecr-table__container{width:100%;overflow-x:auto}.ecr-table{width:100%;border-collapse:collapse;font-size:13px}.ecr-table__header tr{border-bottom:1px solid var(--color-border, #e5e7eb)}.ecr-table__row{border-bottom:1px solid var(--color-border, #e5e7eb);transition:background-color .2s ease}.ecr-table__row:hover,.ecr-table__row[data-state=selected]{background:var(--color-muted, #f3f4f6)}.ecr-table__head,.ecr-table__cell{padding:8px;text-align:left;vertical-align:middle;white-space:nowrap}.ecr-table__head{font-weight:600;color:var(--color-foreground, #111827)}.ecr-table__footer{border-top:1px solid var(--color-border, #e5e7eb);font-weight:600;background:var(--color-muted, #f3f4f6)}.ecr-table__caption{margin-top:16px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-admin-groups__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-groups__row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-groups__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__cell--strong{font-weight:600}#ecommreels-admin-app .ecr-admin-groups__name{display:flex;align-items:center;gap:8px;font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-groups__shortcode{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-groups__shortcode-text{font-family:Courier New,monospace;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-groups__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-groups__copy-button{border:none;border-radius:4px;background:#1f2937;color:#fff;padding:4px 6px;cursor:pointer;transition:transform .15s ease}#ecommreels-admin-app .ecr-admin-groups__copy-button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-groups__copy-icon{display:block;width:12px;height:12px}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip{position:absolute;top:-8px;right:8px;transform:translate(33%,-100%) scale(0);transform-origin:bottom right;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip:after{content:"";position:absolute;bottom:-4px;left:50%;width:12px;height:12px;transform:translate(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip--visible{transform:translate(33%,-100%) scale(1)}#ecommreels-admin-app .ecr-admin-groups__actions{display:flex;align-items:center;justify-content:center;gap:6px}#ecommreels-admin-app .ecr-admin-groups__action-button{color:inherit}#ecommreels-admin-app .ecr-admin-groups__icon{width:18px;height:18px}#ecommreels-admin-app .ecr-admin-groups__icon--neutral{color:#475569}#ecommreels-admin-app .ecr-admin-groups__icon--danger{color:#f43f5e}#ecommreels-admin-app .ecr-admin-groups__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-groups__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:15px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-groups__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-groups__skeleton-table{width:100%;border-collapse:collapse}#ecommreels-admin-app .ecr-admin-groups__skeleton-head{background:#1f2937}#ecommreels-admin-app .ecr-admin-groups__skeleton-row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__skeleton-row--alt{background:#f9fafb}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell{border:1px solid #e5e7eb;padding:8px}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__skeleton-block,#ecommreels-admin-app .ecr-admin-groups__skeleton-line{border-radius:4px;background:#d1d5db;animation:ecr-groups-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-groups__skeleton-block{height:24px}#ecommreels-admin-app .ecr-admin-groups__skeleton-line{height:16px;margin:4px 0}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--tiny,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--tiny{width:32px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--small,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--small{width:96px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--medium,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--medium{width:160px}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--large,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--large{width:220px}@keyframes ecr-groups-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-form{margin-top:24px;display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-form__row{display:grid;grid-template-columns:1fr;align-items:center;gap:24px}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-form__row{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-form__label{font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-form__input{width:128px;border-radius:6px;border:1px solid #d1d5db;padding:8px;font-size:14px}#ecommreels-admin-app .ecr-admin-stats{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-stats__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-stats__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary{font-size:15px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary-skeleton{width:64px;height:24px;border-radius:6px;background:#d1d5db;animation:ecr-stats-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-stats__body{margin-top:16px}@keyframes ecr-stats-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-stats__table{margin-top:8px}#ecommreels-admin-app .ecr-admin-stats__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-stats__row{background:#fff}#ecommreels-admin-app .ecr-admin-stats__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-stats__cell{border:1px solid #e5e7eb;padding:8px;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-stats__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-stats__cell--link{word-break:break-word}#ecommreels-admin-app .ecr-admin-stats__link{color:#2563eb;text-decoration:underline}#ecommreels-admin-app .ecr-admin-stats__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-stats__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-stats__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-group-edit{margin-top:24px;padding:0 24px;display:flex;flex-direction:column;gap:16px;position:relative}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-group-edit{flex-direction:row}}#ecommreels-admin-app .ecr-admin-group-title__wrapper{position:relative}#ecommreels-admin-app .ecr-admin-group-title-customization__trigger{position:absolute;top:50%;translate:0 -50%;right:0;background-color:transparent;color:gray;padding:0 8px}#ecommreels-admin-app .ecr-admin-group-title-customization-dialog{max-width:350px}#ecommreels-admin-app .ecr-admin-nav-btn-reverse{flex-direction:row-reverse}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-nav-btn-reverse{flex-direction:row}}#ecommreels-admin-app .ecr-admin-side-toggle{background:none;border:none;padding:0;color:#6b7280;cursor:pointer}#ecommreels-admin-app .ecr-admin-side-toggle--active{color:#2563eb}.ecr-input{width:100%;min-width:0;border:1px solid transparent;border-radius:6px;background:#f3f4f6;color:inherit;padding:6.4px 12px;font-size:14px;line-height:1.4;transition:border-color .2s ease,box-shadow .2s ease,background-color .2s ease}.ecr-input:focus{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent);background:#fff}.ecr-input::placeholder{color:var(--color-muted-foreground, #9ca3af)}.ecr-input:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-range{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-range__label{font-size:13px;font-weight:600;white-space:nowrap;color:#374151;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-range__row{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-range__slider{width:112px;cursor:pointer;accent-color:#2563eb}#ecommreels-admin-app .ecr-admin-range__value{display:inline-flex;align-items:center;gap:6px}#ecommreels-admin-app .ecr-admin-range__value .ecr-input{width:80px;padding:6px 8px}#ecommreels-admin-app .ecr-admin-range__unit{font-size:12px;color:#6b7280}#ecommreels-admin-app .ecr-admin-group-title_alignment{display:flex;align-items:center;flex-wrap:wrap;gap:8px;justify-content:space-between}#ecommreels-admin-app .ecr-admin-group-title_alignment-label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-group-title_alignment-options{display:flex;align-items:center;gap:0;background-color:#dfdfdf;border-radius:8px;overflow:hidden}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button{border-radius:0;color:#3d3d3d}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button:not(:last-child){border-right:1px solid gray}#ecommreels-admin-app .ecr-admin-group-title-customization__content{display:flex;flex-direction:column;gap:16px;margin-top:40px}#ecommreels-admin-app .ecr-admin-color-selector-popover{width:auto;padding:0;z-index:9}#ecommreels-admin-app .ecr-admin-shortcode{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-shortcode__badge{border-radius:4px;background:#e5e7eb;padding:4px 8px;font-family:Courier New,monospace;font-size:14px;color:#111827;font-weight:900}#ecommreels-admin-app .ecr-admin-shortcode__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-shortcode__button{cursor:pointer;border:none;border-radius:4px;background:#1f2937;padding:4px 6px;color:#fff}#ecommreels-admin-app .ecr-admin-shortcode__button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip{position:absolute;top:50%;right:150%;transform:translateY(-50%) scale(0);transform-origin:center;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-shortcode__tooltip:after{content:"";position:absolute;top:50%;right:-4px;width:12px;height:12px;transform:translateY(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--visible{transform:translateY(-50%) scale(1)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--hidden{transform:translateY(-50%) scale(0)}#ecommreels-admin-app .ecr-admin-reelitem{display:inline-flex;flex-direction:column;width:var(--thumbnail-size, 150px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-reelitem{width:var(--thumbnail-size-mobile, 150px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-reelitem{width:var(--thumbnail-size-tab, 150px)}}#ecommreels-admin-app .ecr-admin-reelitem__frame{position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:aspect-ratio .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__actions{position:absolute;top:100%;left:0;z-index:1;display:flex;height:50%;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__frame:hover .ecr-admin-reelitem__actions{top:50%}#ecommreels-admin-app .ecr-admin-reelitem__button{background:#fff;color:#111827;padding:4px;border-radius:6px}#ecommreels-admin-app .ecr-admin-reelitem__button:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reelitem__button--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reelitem__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reelitem__spinner{animation:ecr-reelitem-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reelitem__link{display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-reelitem__link--disabled{pointer-events:none}#ecommreels-admin-app .ecr-admin-reelitem__link--active{pointer-events:auto}#ecommreels-admin-app .zoom-in,#ecommreels-admin-app .zoom-out{transition:transform .2s ease}#ecommreels-admin-app .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-reel__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes ecr-reelitem-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-product-card-one,.ecommreels-short-code .ecr-product-card-one,.reelswp-group-short-code .ecr-product-card-one,.reelswp-reel-short-code .ecr-product-card-one{display:flex;flex-direction:column;align-items:stretch;gap:16px;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:8px;padding:8px;overflow:hidden;border:1px solid #fff;flex-shrink:0;border-bottom-left-radius:max(calc(var(--thumbnail-border-radius, 0px) - 4px),8px);border-bottom-right-radius:max(calc(var(--thumbnail-border-radius, 0px) - 4px),8px);transition:all .3s ease-in-out;min-height:var(--thumbnail-border-radius);padding-inline:max(var(--thumbnail-border-radius) / 5,8px)}#ecommreels-admin-app .ecr-product-card-one-content-wrapper,.ecommreels-short-code .ecr-product-card-one-content-wrapper,.reelswp-group-short-code .ecr-product-card-one-content-wrapper,.reelswp-reel-short-code .ecr-product-card-one-content-wrapper{display:flex;align-items:center;gap:8px;flex-shrink:0}#ecommreels-admin-app .ecr-product-card-one__thumb,.ecommreels-short-code .ecr-product-card-one__thumb,.reelswp-group-short-code .ecr-product-card-one__thumb,.reelswp-reel-short-code .ecr-product-card-one__thumb{pointer-events:none;width:40px;height:40px;flex-shrink:0;border-radius:4px}#ecommreels-admin-app .ecr-product-card-one__content,.ecommreels-short-code .ecr-product-card-one__content,.reelswp-group-short-code .ecr-product-card-one__content,.reelswp-reel-short-code .ecr-product-card-one__content{flex-grow:1;display:flex;flex-direction:column;align-items:flex-start;gap:4px;overflow:hidden}#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title{max-width:100%;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:1.2;color:#fff;text-decoration:none}:is(#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title):hover{text-decoration:underline}#ecommreels-admin-app .ecr-product-card-one__meta,.ecommreels-short-code .ecr-product-card-one__meta,.reelswp-group-short-code .ecr-product-card-one__meta,.reelswp-reel-short-code .ecr-product-card-one__meta{display:flex;flex-wrap:wrap;column-gap:8px;row-gap:4px}#ecommreels-admin-app .ecr-product-card-one__rating,.ecommreels-short-code .ecr-product-card-one__rating,.reelswp-group-short-code .ecr-product-card-one__rating,.reelswp-reel-short-code .ecr-product-card-one__rating{margin-left:4px;display:flex;align-items:center;gap:4px;font-size:12px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__star,.ecommreels-short-code .ecr-product-card-one__star,.reelswp-group-short-code .ecr-product-card-one__star,.reelswp-reel-short-code .ecr-product-card-one__star{width:16px;height:16px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price,.ecommreels-short-code .ecr-product-card-one__price,.reelswp-group-short-code .ecr-product-card-one__price,.reelswp-reel-short-code .ecr-product-card-one__price{display:flex;align-items:center;gap:.25ch;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price *,.ecommreels-short-code .ecr-product-card-one__price *,.reelswp-group-short-code .ecr-product-card-one__price *,.reelswp-reel-short-code .ecr-product-card-one__price *{line-height:1;background-color:transparent;color:#fff;font-size:12px}#ecommreels-admin-app .ecr-product-card-one__price span.woocommerce-Price-amount,.ecommreels-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-group-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-reel-short-code .ecr-product-card-one__price span.woocommerce-Price-amount{line-height:normal}#ecommreels-admin-app .ecr-product-card-one__price ins,.ecommreels-short-code .ecr-product-card-one__price ins,.reelswp-group-short-code .ecr-product-card-one__price ins,.reelswp-reel-short-code .ecr-product-card-one__price ins{text-decoration:none}#ecommreels-admin-app .ecr-thumb__link-wrapper,.ecommreels-short-code .ecr-thumb__link-wrapper,.reelswp-group-short-code .ecr-thumb__link-wrapper,.reelswp-reel-short-code .ecr-thumb__link-wrapper{display:flex;flex-direction:column;gap:4px;flex-shrink:0}#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link{display:grid;place-items:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-radius:8px;background-color:transparent;position:relative;min-height:max(var(--thumbnail-border-radius, 48px),48px);text-align:center;font-size:16px;font-weight:600;color:#fff;text-decoration:none;border:1px solid #fff;border-bottom-left-radius:max(var(--thumbnail-border-radius, 8px),8px);border-bottom-right-radius:max(var(--thumbnail-border-radius, 8px),8px);transition:all .3s ease-in-out;isolation:isolate}:is(#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link):hover{text-decoration:underline}:is(#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link):before{content:"";position:absolute;inset:0;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:8px;border-bottom-left-radius:max(var(--thumbnail-border-radius, 8px),8px);border-bottom-right-radius:max(var(--thumbnail-border-radius, 8px),8px);overflow:hidden;z-index:-1;transition:all .3s ease-in-out}#ecommreels-admin-app .ecr-admin-reelitem-links,.ecommreels-short-code .ecr-admin-reelitem-links,.reelswp-group-short-code .ecr-admin-reelitem-links,.reelswp-reel-short-code .ecr-admin-reelitem-links{display:flex;align-items:center;gap:8px;overflow:hidden;margin-top:8px;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-reelitem-links[data-dragging=true] *,.ecommreels-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-group-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-reel-short-code .ecr-admin-reelitem-links[data-dragging=true] *{pointer-events:none}#ecommreels-admin-app .ecr-reel_title,.ecommreels-short-code .ecr-reel_title,.reelswp-group-short-code .ecr-reel_title,.reelswp-reel-short-code .ecr-reel_title{position:absolute;left:50%;transform:translate(-50%);bottom:8px;text-transform:capitalize;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);padding:4px 8px;color:#fff;width:95%;border-radius:8px;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-editor-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-editor-carousel__track{display:flex;width:max-content;flex-wrap:nowrap;padding:16px 0;gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-editor-carousel__track{gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-editor-carousel__track{gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-admin-editor-carousel__track--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-carousel__empty{display:flex;width:100%;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-editor-carousel__nav{position:absolute;top:50%;z-index:2;transform:translateY(-50%);border:none;background:#fff;padding:6px 8px;color:#374151;cursor:pointer;width:32px;height:40px;transition:background-color .2s ease;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--left{left:0;border-radius:0 999px 999px 0}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--right{right:0;border-radius:999px 0 0 999px}#ecommreels-admin-app .ecr-admin-editor-grid{display:flex;flex-wrap:wrap;row-gap:16px;column-gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-editor-grid{column-gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-editor-grid{column-gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-admin-editor-grid--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-grid__empty{display:flex;width:100%;justify-content:center;padding-top:160px}#ecommreels-admin-app .ecr-admin-editor-grid__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-grid__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-existing{width:100%;flex:1;overflow:hidden;border-radius:8px;border:1px solid #e5e7eb;background:#fff}#ecommreels-admin-app .ecr-admin-existing__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-existing__title-wrapper{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-existing__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-existing__body{max-height:800px;overflow-y:auto;padding:8px 16px 16px}#ecommreels-admin-app .ecr-preview-player{background-color:#000000b3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);display:grid;place-items:center;padding:24px;width:100%;min-height:320px;border-radius:4px}#ecommreels-admin-app .ecr-preview-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-preview-player .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:min(70vh,560px);max-width:90vw;overflow:hidden;border-radius:24px}#ecommreels-admin-app .ecr-preview-player__media{width:100%;height:100%}#ecommreels-admin-app .ecr-preview-player__media-item{width:100%;object-fit:cover;display:block}#ecommreels-admin-app .ecr-preview-player__nav--disabled{opacity:.4;cursor:not-allowed}#ecommreels-admin-app .ecr-player__close{position:absolute;top:8px;right:8px;z-index:5;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1;background:transparent;border:none}#ecommreels-admin-app .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:5;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecr-preview-player__empty{display:grid;place-items:center;color:#fff;font-size:14px;height:100%;width:100%}#ecommreels-admin-app .ecr-admin-reellist{display:flex;flex-direction:column;min-height:100%;width:100%;flex-shrink:0;overflow-y:auto;border-radius:8px;border:1px solid #e5e7eb;background:#fff;box-shadow:0 1px 2px #0000000d}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-reellist{width:280px}}#ecommreels-admin-app .ecr-admin-reellist__header{border-bottom:1px solid #e5e7eb;padding:16px 16px 8px;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-reellist__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-reellist__body{margin-top:8px;display:flex;flex-direction:column;gap:12px;padding:0 16px 16px}#ecommreels-admin-app .ecr-admin-reellist__add-button{width:100%;flex-shrink:0;margin-inline-start:0;border:1px solid #2563eb;background:#fff}#ecommreels-admin-app .ecr-admin-reellist__add-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reellist__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-reellist__search-input:focus{outline:none;border-color:#93c5fd;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-reellist__grid{margin-top:16px;max-height:60vh;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-reellist__items{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}@media(min-width:767px)and (max-width:1199px){#ecommreels-admin-app .ecr-admin-reellist__items{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-reellist__items{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-reellist__empty{grid-column:1 / -1;padding:24px 0;text-align:center;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-reellist__item{width:100%}#ecommreels-admin-app .ecr-admin-reellist__card{position:relative;width:100%;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease;padding:0}#ecommreels-admin-app .ecr-admin-reellist__card:hover{border-color:#3b82f6}#ecommreels-admin-app .ecr-admin-reellist__media{aspect-ratio:9 / 16;width:100%}#ecommreels-admin-app .ecr-admin-reellist__thumb{pointer-events:none;display:block;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reellist__label{position:absolute;bottom:0;left:0;width:100%;padding:4px;background:linear-gradient(0deg,#fff 20%,#fff0);font-size:13px;font-weight:600;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-reellist__overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#ffffffbf}#ecommreels-admin-app .ecr-admin-reellist__overlay-icon{width:24px;height:24px;color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reellist__loader{grid-column:1 / -1;display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-reellist__spinner{width:24px;height:24px;border-radius:999px;border:2px solid #cbd5e1;border-top-color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}@keyframes ecr-reellist-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-tabs{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-tabs__list{display:inline-flex;align-items:center;background:var(--color-muted, #f3f4f6);border-radius:10px;padding:3px;width:fit-content}#ecommreels-admin-app .ecr-tabs__trigger{border:1px solid transparent;border-radius:8px;padding:8px;font-size:13px;font-weight:600;color:var(--color-muted-foreground, #6b7280);background:transparent;transition:background-color .2s ease,color .2s ease,border-color .2s ease}#ecommreels-admin-app .ecr-tabs__trigger[data-state=active]{background:#fff;color:var(--color-foreground, #111827);border-color:var(--color-border, #e5e7eb);box-shadow:0 1px 2px #0000000f}#ecommreels-admin-app .ecr-tabs__content{outline:none}#ecommreels-admin-app .ecr-admin-sidepanel{position:relative;display:flex;flex-direction:column;min-height:100%;max-height:100%;flex-shrink:0;overflow:hidden;border-radius:8px;transition:width .2s ease}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:100%;max-height:100%;position:absolute;right:16px;top:0}#ecommreels-admin-app .ecr-admin-mobile-overlay{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#0f172abf;z-index:5}#ecommreels-admin-app .ecr-admin-sidepanel-content{width:280px;background:#fff;margin-left:auto;border:2px solid #e5e7eb;height:100vh;position:fixed;top:0;right:0}@media(max-width:1024px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-sidepanel-content{padding-top:32px}}@media(max-width:1200px){#ecommreels-admin-app .ecr-admin-sidepanel-content{z-index:999}}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-sidepanel--expanded{position:static}#ecommreels-admin-app .ecr-admin-mobile-overlay{display:none}#ecommreels-admin-app .ecr-admin-sidepanel-content{position:static;width:280px;background:#fff;margin-left:0;border:2px solid #e5e7eb;height:100%;border-radius:8px}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:fit-content}}#ecommreels-admin-app .ecr-admin-sidepanel--collapsed{width:0;border:0;pointer-events:none}#ecommreels-admin-app .ecr-admin-sidepanel__header{position:relative;display:flex;flex-direction:column;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-sidepanel__title{margin:0;font-size:15px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-sidepanel__body{height:100%;overflow-x:hidden;padding:8px 16px 16px}#ecommreels-admin-app .ecr-admin-sidepanel__tabs,#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{width:100%}#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{display:grid;grid-template-columns:1fr 1fr}#ecommreels-admin-app .ecr-admin-sidepanel__lock-trigger{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;font-size:13px;color:#6b7280;text-transform:capitalize;padding:8px}#ecommreels-admin-app .ecr-admin-sidepanel__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-switch{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:14px;font-weight:500;color:#6b7280}#ecommreels-admin-app .ecr-admin-switch__label{display:inline-flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-switch__icon{color:#6b7280}#ecommreels-admin-app .ecr-admin-popover{background:#eff6ff}#ecommreels-admin-app .ecr-select__trigger{display:inline-flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid var(--color-border, #d1d5db);border-radius:6px;padding:7.2px 12px;font-size:13px;background:#fff;color:var(--color-foreground, #111827);min-width:fit-content}#ecommreels-admin-app .ecr-select__trigger[data-size=sm]{height:32px}#ecommreels-admin-app .ecr-select__trigger[data-size=default]{height:36px}#ecommreels-admin-app .ecr-select__trigger:focus-visible{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent)}#ecommreels-admin-app .ecr-select__icon{width:16px;height:16px;opacity:.6}#ecommreels-admin-app .ecr-select__content{background:#fff;color:var(--color-foreground, #111827);border:1px solid var(--color-border, #d1d5db);border-radius:8px;box-shadow:0 10px 30px #00000026;overflow:hidden;min-width:140px;z-index:999}#ecommreels-admin-app .ecr-select__content[data-side=bottom]{animation:ecr-fade-down .15s ease-out}#ecommreels-admin-app .ecr-select__content[data-side=top]{animation:ecr-fade-up .15s ease-out}#ecommreels-admin-app .ecr-select__viewport{padding:5.6px}#ecommreels-admin-app .ecr-select__item{display:flex;align-items:center;gap:8px;border-radius:6px;padding:8px;font-size:13px;cursor:pointer;text-transform:capitalize}#ecommreels-admin-app .ecr-select__item[data-highlighted]{background:var(--color-accent, #f3f4f6)}#ecommreels-admin-app .ecr-select__item[data-disabled]{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-select__label{padding:5.6px 8px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-select__separator{height:1px;margin:4px 0;background:var(--color-border, #e5e7eb)}#ecommreels-admin-app .ecr-select__check{position:absolute;right:8px;width:14px;height:14px;display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-select__check-icon{width:14px;height:14px}#ecommreels-admin-app .ecr-select__scroll-button{display:flex;align-items:center;justify-content:center;padding:4px 0;cursor:default}@keyframes ecr-fade-down{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}@keyframes ecr-fade-up{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}#ecommreels-admin-app .ecr-admin-thumb-controls{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section{border:1px solid var(--color-border, #e5e7eb);border-radius:10px;padding:12px;background:#fff;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumb-controls__section-trigger{align-items:center;background:transparent;border:none;color:var(--color-foreground, #111827);cursor:pointer;display:flex;font-size:13px;font-weight:600;justify-content:space-between;padding:0;text-align:left}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content[data-state=open]{margin-top:12px;padding-top:12px;border-top:1px solid #e5e7eb}#ecommreels-admin-app .ecr-collapsible__trigger{align-items:center;display:inline-flex;gap:8px;justify-content:space-between;width:100%}#ecommreels-admin-app .ecr-collapsible__trigger-label{align-items:center;display:inline-flex;gap:4px}#ecommreels-admin-app .ecr-collapsible__trigger-icon{height:16px;width:16px;transition:transform .2s ease}#ecommreels-admin-app .ecr-collapsible__trigger[data-state=open] .ecr-collapsible__trigger-icon{transform:rotate(180deg)}#ecommreels-admin-app .ecr-admin-control{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-control--row,#ecommreels-admin-app .ecr-admin-control--inline{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px}#ecommreels-admin-app .ecr-admin-control__label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-control__row{display:flex;align-items:center;gap:12px}#ecommreels-admin-app .ecr-admin-control__row--color{position:relative}#ecommreels-admin-app .ecr-admin-control__choice{display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__choice-label{cursor:pointer;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__trigger,#ecommreels-admin-app .ecr-admin-control__option{text-transform:capitalize}.ecr-admin-control__lock-trigger{display:flex;width:100%;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;font-size:13px;color:#6b7280;cursor:pointer;border:none}.ecr-admin-control__lock-trigger:hover{background:#f3f4f6}.ecr-admin-control__popover{background:#eff6ff}.ecr-admin-control__swatch{width:24px;height:24px;cursor:pointer;border-radius:4px;border:2px solid #6b7280}#ecommreels-admin-app .ecr-admin-control__picker{position:absolute;top:100%;left:0;z-index:9;box-shadow:0 8px 16px #0000001f;outline:none}#ecommreels-admin-app .ecr-admin-control__hex{width:80px;border-radius:4px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{--reels-wp-animation-time: 3s;--reels-wp-marquee-time: 20s}#ecommreels-admin-app .ecr-player__loader,.ecommreels-short-code .ecr-player__loader,.reelswp-group-short-code .ecr-player__loader,.reelswp-reel-short-code .ecr-player__loader{height:90vh;max-width:100vw;aspect-ratio:9 / 16;border-radius:16px;border:1px solid #e5e7eb;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-loader,.ecommreels-short-code .ecr-loader,.reelswp-group-short-code .ecr-loader,.reelswp-reel-short-code .ecr-loader{width:100%;height:100%;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px}#ecommreels-admin-app .ecr-loader__ball,.ecommreels-short-code .ecr-loader__ball,.reelswp-group-short-code .ecr-loader__ball,.reelswp-reel-short-code .ecr-loader__ball{width:20px;height:20px;border-radius:50%;background:#919191;animation:ecr-bounce 1s alternate infinite}#ecommreels-admin-app .ecr-loader__ball:nth-child(2),.ecommreels-short-code .ecr-loader__ball:nth-child(2),.reelswp-group-short-code .ecr-loader__ball:nth-child(2),.reelswp-reel-short-code .ecr-loader__ball:nth-child(2){animation-delay:.25s}#ecommreels-admin-app .ecr-loader__ball:nth-child(3),.ecommreels-short-code .ecr-loader__ball:nth-child(3),.reelswp-group-short-code .ecr-loader__ball:nth-child(3),.reelswp-reel-short-code .ecr-loader__ball:nth-child(3){animation-delay:.5s}@keyframes ecr-bounce{0%{transform:scale(2)}to{transform:scale(1)}}#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{display:block;width:var(--thumbnail-size, 150px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{width:var(--thumbnail-size-mobile, 150px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{width:var(--thumbnail-size-tab, 150px)}}#ecommreels-admin-app .ecr-thumb__frame,.ecommreels-short-code .ecr-thumb__frame,.reelswp-group-short-code .ecr-thumb__frame,.reelswp-reel-short-code .ecr-thumb__frame{overflow:hidden;width:100%;position:relative}#ecommreels-admin-app .zoom-in,.ecommreels-short-code .zoom-in,.reelswp-group-short-code .zoom-in,.reelswp-reel-short-code .zoom-in,#ecommreels-admin-app .zoom-out,.ecommreels-short-code .zoom-out,.reelswp-group-short-code .zoom-out,.reelswp-reel-short-code .zoom-out{transition:transform .2s ease-in-out}#ecommreels-admin-app .zoom-in:hover,.ecommreels-short-code .zoom-in:hover,.reelswp-group-short-code .zoom-in:hover,.reelswp-reel-short-code .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover,.ecommreels-short-code .zoom-out:hover,.reelswp-group-short-code .zoom-out:hover,.reelswp-reel-short-code .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-reel__title,.ecommreels-short-code .ecr-reel__title,.reelswp-group-short-code .ecr-reel__title,.reelswp-reel-short-code .ecr-reel__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-front-carousel,.ecommreels-short-code .ecr-front-carousel,.reelswp-group-short-code .ecr-front-carousel,.reelswp-reel-short-code .ecr-front-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-front-carousel__viewport,.ecommreels-short-code .ecr-front-carousel__viewport,.reelswp-group-short-code .ecr-front-carousel__viewport,.reelswp-reel-short-code .ecr-front-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{display:flex;flex-wrap:nowrap;width:max-content;gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-front-carousel__track--zoom,.ecommreels-short-code .ecr-front-carousel__track--zoom,.reelswp-group-short-code .ecr-front-carousel__track--zoom,.reelswp-reel-short-code .ecr-front-carousel__track--zoom{padding:16px}#ecommreels-admin-app .ecr-front-carousel__nav,.ecommreels-short-code .ecr-front-carousel__nav,.reelswp-group-short-code .ecr-front-carousel__nav,.reelswp-reel-short-code .ecr-front-carousel__nav{position:absolute;top:50%;z-index:1;transform:translateY(-50%);border:none;background:#fff;color:#1f2937;cursor:pointer;width:32px;height:40px;padding:0;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-front-carousel__nav--left,.ecommreels-short-code .ecr-front-carousel__nav--left,.reelswp-group-short-code .ecr-front-carousel__nav--left,.reelswp-reel-short-code .ecr-front-carousel__nav--left{left:0;border-top-right-radius:999px;border-bottom-right-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav--right,.ecommreels-short-code .ecr-front-carousel__nav--right,.reelswp-group-short-code .ecr-front-carousel__nav--right,.reelswp-reel-short-code .ecr-front-carousel__nav--right{right:0;border-top-left-radius:999px;border-bottom-left-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav:hover,.ecommreels-short-code .ecr-front-carousel__nav:hover,.reelswp-group-short-code .ecr-front-carousel__nav:hover,.reelswp-reel-short-code .ecr-front-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-front-grid,.ecommreels-short-code .ecr-front-grid,.reelswp-group-short-code .ecr-front-grid,.reelswp-reel-short-code .ecr-front-grid{cursor:default;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid, 150px),1fr));row-gap:16px;column-gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{column-gap:var(--thumbnail-gap-mobile, 16px);grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid-mobile, 150px),1fr))}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{column-gap:var(--thumbnail-gap-tab, 16px);grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid-tab, 150px),1fr))}}
     2/*$vite$:1*/`,document.head.appendChild(ya);function wa(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const x=wa(y),_r=wa(va);function Cd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var In={exports:{}},Kt={};/**
    33 * @license React
    44 * react-jsx-runtime.production.min.js
     
    88 * This source code is licensed under the MIT license found in the
    99 * LICENSE file in the root directory of this source tree.
    10  */var ja;function kd(){if(ja)return qt;ja=1;var e=y,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(l,d,c){var u,p={},m=null,g=null;c!==void 0&&(m=""+c),d.key!==void 0&&(m=""+d.key),d.ref!==void 0&&(g=d.ref);for(u in d)n.call(d,u)&&!i.hasOwnProperty(u)&&(p[u]=d[u]);if(l&&l.defaultProps)for(u in d=l.defaultProps,d)p[u]===void 0&&(p[u]=d[u]);return{$$typeof:t,type:l,key:m,ref:g,props:p,_owner:o.current}}return qt.Fragment=r,qt.jsx=s,qt.jsxs=s,qt}var Sa;function Nd(){return Sa||(Sa=1,In.exports=kd()),In.exports}var a=Nd();/**
     10 */var ja;function kd(){if(ja)return Kt;ja=1;var e=y,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(l,c,d){var u,p={},m=null,g=null;d!==void 0&&(m=""+d),c.key!==void 0&&(m=""+c.key),c.ref!==void 0&&(g=c.ref);for(u in c)n.call(c,u)&&!i.hasOwnProperty(u)&&(p[u]=c[u]);if(l&&l.defaultProps)for(u in c=l.defaultProps,c)p[u]===void 0&&(p[u]=c[u]);return{$$typeof:t,type:l,key:m,ref:g,props:p,_owner:o.current}}return Kt.Fragment=r,Kt.jsx=s,Kt.jsxs=s,Kt}var Sa;function Nd(){return Sa||(Sa=1,In.exports=kd()),In.exports}var a=Nd();/**
    1111 * @remix-run/router v1.23.2
    1212 *
     
    1717 *
    1818 * @license MIT
    19  */function Gt(){return Gt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gt.apply(this,arguments)}var et;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(et||(et={}));const Ca="popstate";function Ed(e){e===void 0&&(e={});function t(o,i){let{pathname:s="/",search:l="",hash:d=""}=Kt(o.location.hash.substr(1));return!s.startsWith("/")&&!s.startsWith(".")&&(s="/"+s),zn("",{pathname:s,search:l,hash:d},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(o,i){let s=o.document.querySelector("base"),l="";if(s&&s.getAttribute("href")){let d=o.location.href,c=d.indexOf("#");l=c===-1?d:d.slice(0,c)}return l+"#"+(typeof i=="string"?i:_r(i))}function n(o,i){ka(o.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(i)+")")}return Ad(t,r,n,e)}function ye(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ka(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Td(){return Math.random().toString(36).substr(2,8)}function Na(e,t){return{usr:e.state,key:e.key,idx:t}}function zn(e,t,r,n){return r===void 0&&(r=null),Gt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Kt(t):t,{state:r,key:t&&t.key||n||Td()})}function _r(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Kt(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Ad(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:i=!1}=n,s=o.history,l=et.Pop,d=null,c=u();c==null&&(c=0,s.replaceState(Gt({},s.state,{idx:c}),""));function u(){return(s.state||{idx:null}).idx}function p(){l=et.Pop;let h=u(),v=h==null?null:h-c;c=h,d&&d({action:l,location:f.location,delta:v})}function m(h,v){l=et.Push;let _=zn(f.location,h,v);r&&r(_,h),c=u()+1;let w=Na(_,c),j=f.createHref(_);try{s.pushState(w,"",j)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(j)}i&&d&&d({action:l,location:f.location,delta:1})}function g(h,v){l=et.Replace;let _=zn(f.location,h,v);r&&r(_,h),c=u();let w=Na(_,c),j=f.createHref(_);s.replaceState(w,"",j),i&&d&&d({action:l,location:f.location,delta:0})}function b(h){let v=o.location.origin!=="null"?o.location.origin:o.location.href,_=typeof h=="string"?h:_r(h);return _=_.replace(/ $/,"%20"),ye(v,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,v)}let f={get action(){return l},get location(){return e(o,s)},listen(h){if(d)throw new Error("A history only accepts one active listener");return o.addEventListener(Ca,p),d=h,()=>{o.removeEventListener(Ca,p),d=null}},createHref(h){return t(o,h)},createURL:b,encodeLocation(h){let v=b(h);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:m,replace:g,go(h){return s.go(h)}};return f}var Ea;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ea||(Ea={}));function Ta(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const Pd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Od=e=>Pd.test(e);function Rd(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Kt(e):e,i;if(r)if(Od(r))i=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),ka(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+r))}r.startsWith("/")?i=Aa(r.substring(1),"/"):i=Aa(r,t)}else i=t;return{pathname:i,search:Id(n),hash:zd(o)}}function Aa(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Mn(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Ld(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Pa(e,t){let r=Ld(e);return t?r.map((n,o)=>o===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Oa(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Kt(e):(o=Gt({},e),ye(!o.pathname||!o.pathname.includes("?"),Mn("?","pathname","search",o)),ye(!o.pathname||!o.pathname.includes("#"),Mn("#","pathname","hash",o)),ye(!o.search||!o.search.includes("#"),Mn("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,l;if(s==null)l=r;else{let p=t.length-1;if(!n&&s.startsWith("..")){let m=s.split("/");for(;m[0]==="..";)m.shift(),p-=1;o.pathname=m.join("/")}l=p>=0?t[p]:"/"}let d=Rd(o,l),c=s&&s!=="/"&&s.endsWith("/"),u=(i||s===".")&&r.endsWith("/");return!d.pathname.endsWith("/")&&(c||u)&&(d.pathname+="/"),d}const Ra=e=>e.join("/").replace(/\/\/+/g,"/"),Id=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,zd=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,La=["post","put","patch","delete"];new Set(La);const Md=["get",...La];new Set(Md);/**
     19 */function Yt(){return Yt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yt.apply(this,arguments)}var et;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(et||(et={}));const Ca="popstate";function Ed(e){e===void 0&&(e={});function t(o,i){let{pathname:s="/",search:l="",hash:c=""}=Xt(o.location.hash.substr(1));return!s.startsWith("/")&&!s.startsWith(".")&&(s="/"+s),zn("",{pathname:s,search:l,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(o,i){let s=o.document.querySelector("base"),l="";if(s&&s.getAttribute("href")){let c=o.location.href,d=c.indexOf("#");l=d===-1?c:c.slice(0,d)}return l+"#"+(typeof i=="string"?i:vr(i))}function n(o,i){ka(o.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(i)+")")}return Ad(t,r,n,e)}function ye(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ka(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Td(){return Math.random().toString(36).substr(2,8)}function Na(e,t){return{usr:e.state,key:e.key,idx:t}}function zn(e,t,r,n){return r===void 0&&(r=null),Yt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Xt(t):t,{state:r,key:t&&t.key||n||Td()})}function vr(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Xt(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Ad(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:i=!1}=n,s=o.history,l=et.Pop,c=null,d=u();d==null&&(d=0,s.replaceState(Yt({},s.state,{idx:d}),""));function u(){return(s.state||{idx:null}).idx}function p(){l=et.Pop;let h=u(),_=h==null?null:h-d;d=h,c&&c({action:l,location:f.location,delta:_})}function m(h,_){l=et.Push;let v=zn(f.location,h,_);r&&r(v,h),d=u()+1;let w=Na(v,d),j=f.createHref(v);try{s.pushState(w,"",j)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(j)}i&&c&&c({action:l,location:f.location,delta:1})}function g(h,_){l=et.Replace;let v=zn(f.location,h,_);r&&r(v,h),d=u();let w=Na(v,d),j=f.createHref(v);s.replaceState(w,"",j),i&&c&&c({action:l,location:f.location,delta:0})}function b(h){let _=o.location.origin!=="null"?o.location.origin:o.location.href,v=typeof h=="string"?h:vr(h);return v=v.replace(/ $/,"%20"),ye(_,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,_)}let f={get action(){return l},get location(){return e(o,s)},listen(h){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(Ca,p),c=h,()=>{o.removeEventListener(Ca,p),c=null}},createHref(h){return t(o,h)},createURL:b,encodeLocation(h){let _=b(h);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:m,replace:g,go(h){return s.go(h)}};return f}var Ea;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ea||(Ea={}));function Ta(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const Pd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Od=e=>Pd.test(e);function Rd(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Xt(e):e,i;if(r)if(Od(r))i=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),ka(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+r))}r.startsWith("/")?i=Aa(r.substring(1),"/"):i=Aa(r,t)}else i=t;return{pathname:i,search:Id(n),hash:zd(o)}}function Aa(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Mn(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Ld(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Pa(e,t){let r=Ld(e);return t?r.map((n,o)=>o===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Oa(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Xt(e):(o=Yt({},e),ye(!o.pathname||!o.pathname.includes("?"),Mn("?","pathname","search",o)),ye(!o.pathname||!o.pathname.includes("#"),Mn("#","pathname","hash",o)),ye(!o.search||!o.search.includes("#"),Mn("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,l;if(s==null)l=r;else{let p=t.length-1;if(!n&&s.startsWith("..")){let m=s.split("/");for(;m[0]==="..";)m.shift(),p-=1;o.pathname=m.join("/")}l=p>=0?t[p]:"/"}let c=Rd(o,l),d=s&&s!=="/"&&s.endsWith("/"),u=(i||s===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const Ra=e=>e.join("/").replace(/\/\/+/g,"/"),Id=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,zd=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,La=["post","put","patch","delete"];new Set(La);const Md=["get",...La];new Set(Md);/**
    2020 * React Router v6.30.3
    2121 *
     
    2626 *
    2727 * @license MIT
    28  */function yr(){return yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yr.apply(this,arguments)}const Ia=x.createContext(null),ft=x.createContext(null),Dn=x.createContext(null),wr=x.createContext({outlet:null,matches:[],isDataRoute:!1});function Dd(e,t){let{relative:r}=t===void 0?{}:t;jr()||ye(!1);let{basename:n,navigator:o}=x.useContext(ft),{hash:i,pathname:s,search:l}=Ma(e,{relative:r}),d=s;return n!=="/"&&(d=s==="/"?n:Ra([n,s])),o.createHref({pathname:d,search:l,hash:i})}function jr(){return x.useContext(Dn)!=null}function Sr(){return jr()||ye(!1),x.useContext(Dn).location}function za(e){x.useContext(ft).static||x.useLayoutEffect(e)}function Ne(){let{isDataRoute:e}=x.useContext(wr);return e?Hd():Fd()}function Fd(){jr()||ye(!1);let e=x.useContext(Ia),{basename:t,future:r,navigator:n}=x.useContext(ft),{matches:o}=x.useContext(wr),{pathname:i}=Sr(),s=JSON.stringify(Pa(o,r.v7_relativeSplatPath)),l=x.useRef(!1);return za(()=>{l.current=!0}),x.useCallback(function(c,u){if(u===void 0&&(u={}),!l.current)return;if(typeof c=="number"){n.go(c);return}let p=Oa(c,JSON.parse(s),i,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Ra([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,s,i,e])}function Ma(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=x.useContext(ft),{matches:o}=x.useContext(wr),{pathname:i}=Sr(),s=JSON.stringify(Pa(o,n.v7_relativeSplatPath));return x.useMemo(()=>Oa(e,JSON.parse(s),i,r==="path"),[e,s,i,r])}var Da=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Da||{}),Fa=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(Fa||{});function $d(e){let t=x.useContext(Ia);return t||ye(!1),t}function Bd(e){let t=x.useContext(wr);return t||ye(!1),t}function Ud(e){let t=Bd(),r=t.matches[t.matches.length-1];return r.route.id||ye(!1),r.route.id}function Hd(){let{router:e}=$d(Da.UseNavigateStable),t=Ud(Fa.UseNavigateStable),r=x.useRef(!1);return za(()=>{r.current=!0}),x.useCallback(function(o,i){i===void 0&&(i={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,yr({fromRouteId:t},i)))},[e,t])}function Vd(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function Wd(e){let{basename:t="/",children:r=null,location:n,navigationType:o=et.Pop,navigator:i,static:s=!1,future:l}=e;jr()&&ye(!1);let d=t.replace(/^\/*/,"/"),c=x.useMemo(()=>({basename:d,navigator:i,static:s,future:yr({v7_relativeSplatPath:!1},l)}),[d,l,i,s]);typeof n=="string"&&(n=Kt(n));let{pathname:u="/",search:p="",hash:m="",state:g=null,key:b="default"}=n,f=x.useMemo(()=>{let h=Ta(u,d);return h==null?null:{location:{pathname:h,search:p,hash:m,state:g,key:b},navigationType:o}},[d,u,p,m,g,b,o]);return f==null?null:x.createElement(ft.Provider,{value:c},x.createElement(Dn.Provider,{children:r,value:f}))}new Promise(()=>{});/**
     28 */function yr(){return yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yr.apply(this,arguments)}const Ia=x.createContext(null),xt=x.createContext(null),Dn=x.createContext(null),wr=x.createContext({outlet:null,matches:[],isDataRoute:!1});function Dd(e,t){let{relative:r}=t===void 0?{}:t;jr()||ye(!1);let{basename:n,navigator:o}=x.useContext(xt),{hash:i,pathname:s,search:l}=Ma(e,{relative:r}),c=s;return n!=="/"&&(c=s==="/"?n:Ra([n,s])),o.createHref({pathname:c,search:l,hash:i})}function jr(){return x.useContext(Dn)!=null}function Sr(){return jr()||ye(!1),x.useContext(Dn).location}function za(e){x.useContext(xt).static||x.useLayoutEffect(e)}function Ne(){let{isDataRoute:e}=x.useContext(wr);return e?Hd():Fd()}function Fd(){jr()||ye(!1);let e=x.useContext(Ia),{basename:t,future:r,navigator:n}=x.useContext(xt),{matches:o}=x.useContext(wr),{pathname:i}=Sr(),s=JSON.stringify(Pa(o,r.v7_relativeSplatPath)),l=x.useRef(!1);return za(()=>{l.current=!0}),x.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let p=Oa(d,JSON.parse(s),i,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Ra([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,s,i,e])}function Ma(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=x.useContext(xt),{matches:o}=x.useContext(wr),{pathname:i}=Sr(),s=JSON.stringify(Pa(o,n.v7_relativeSplatPath));return x.useMemo(()=>Oa(e,JSON.parse(s),i,r==="path"),[e,s,i,r])}var Da=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Da||{}),Fa=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(Fa||{});function $d(e){let t=x.useContext(Ia);return t||ye(!1),t}function Bd(e){let t=x.useContext(wr);return t||ye(!1),t}function Ud(e){let t=Bd(),r=t.matches[t.matches.length-1];return r.route.id||ye(!1),r.route.id}function Hd(){let{router:e}=$d(Da.UseNavigateStable),t=Ud(Fa.UseNavigateStable),r=x.useRef(!1);return za(()=>{r.current=!0}),x.useCallback(function(o,i){i===void 0&&(i={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,yr({fromRouteId:t},i)))},[e,t])}function Vd(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function Wd(e){let{basename:t="/",children:r=null,location:n,navigationType:o=et.Pop,navigator:i,static:s=!1,future:l}=e;jr()&&ye(!1);let c=t.replace(/^\/*/,"/"),d=x.useMemo(()=>({basename:c,navigator:i,static:s,future:yr({v7_relativeSplatPath:!1},l)}),[c,l,i,s]);typeof n=="string"&&(n=Xt(n));let{pathname:u="/",search:p="",hash:m="",state:g=null,key:b="default"}=n,f=x.useMemo(()=>{let h=Ta(u,c);return h==null?null:{location:{pathname:h,search:p,hash:m,state:g,key:b},navigationType:o}},[c,u,p,m,g,b,o]);return f==null?null:x.createElement(xt.Provider,{value:d},x.createElement(Dn.Provider,{children:r,value:f}))}new Promise(()=>{});/**
    2929 * React Router DOM v6.30.3
    3030 *
     
    3535 *
    3636 * @license MIT
    37  */function Fn(){return Fn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fn.apply(this,arguments)}function qd(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i<n.length;i++)o=n[i],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function Gd(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Kd(e,t){return e.button===0&&(!t||t==="_self")&&!Gd(e)}function $n(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}function Yd(e,t){let r=$n(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(i=>{r.append(o,i)})}),r}const Xd=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Jd="6";try{window.__reactRouterVersion=Jd}catch{}const $a=x["startTransition"];function Zd(e){let{basename:t,children:r,future:n,window:o}=e,i=x.useRef();i.current==null&&(i.current=Ed({window:o,v5Compat:!0}));let s=i.current,[l,d]=x.useState({action:s.action,location:s.location}),{v7_startTransition:c}=n||{},u=x.useCallback(p=>{c&&$a?$a(()=>d(p)):d(p)},[d,c]);return x.useLayoutEffect(()=>s.listen(u),[s,u]),x.useEffect(()=>Vd(n),[n]),x.createElement(Wd,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}const Qd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",eu=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ht=x.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:i,replace:s,state:l,target:d,to:c,preventScrollReset:u,viewTransition:p}=t,m=qd(t,Xd),{basename:g}=x.useContext(ft),b,f=!1;if(typeof c=="string"&&eu.test(c)&&(b=c,Qd))try{let w=new URL(window.location.href),j=c.startsWith("//")?new URL(w.protocol+c):new URL(c),C=Ta(j.pathname,g);j.origin===w.origin&&C!=null?c=C+j.search+j.hash:f=!0}catch{}let h=Dd(c,{relative:o}),v=tu(c,{replace:s,state:l,target:d,preventScrollReset:u,relative:o,viewTransition:p});function _(w){n&&n(w),w.defaultPrevented||v(w)}return x.createElement("a",Fn({},m,{href:b||h,onClick:f||i?n:_,ref:r,target:d}))});var Ba;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ba||(Ba={}));var Ua;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ua||(Ua={}));function tu(e,t){let{target:r,replace:n,state:o,preventScrollReset:i,relative:s,viewTransition:l}=t===void 0?{}:t,d=Ne(),c=Sr(),u=Ma(e,{relative:s});return x.useCallback(p=>{if(Kd(p,r)){p.preventDefault();let m=n!==void 0?n:_r(c)===_r(u);d(e,{replace:m,state:o,preventScrollReset:i,relative:s,viewTransition:l})}},[c,d,u,n,o,r,e,i,s,l])}function Yt(e){let t=x.useRef($n(e)),r=x.useRef(!1),n=Sr(),o=x.useMemo(()=>Yd(n.search,r.current?null:t.current),[n.search]),i=Ne(),s=x.useCallback((l,d)=>{const c=$n(typeof l=="function"?l(o):l);r.current=!0,i("?"+c,d)},[i,o]);return[o,s]}let ru={data:""},nu=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||ru},ou=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,au=/\/\*[^]*?\*\/|  +/g,Ha=/\n+/g,Ue=(e,t)=>{let r="",n="",o="";for(let i in e){let s=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+s+";":n+=i[1]=="f"?Ue(s,i):i+"{"+Ue(s,i[1]=="k"?"":t)+"}":typeof s=="object"?n+=Ue(s,t?t.replace(/([^,])+/g,l=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,d=>/&/.test(d)?d.replace(/&/g,l):l?l+" "+d:d)):i):s!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Ue.p?Ue.p(i,s):i+":"+s+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Me={},Va=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Va(e[r]);return t}return e},iu=(e,t,r,n,o)=>{let i=Va(e),s=Me[i]||(Me[i]=(d=>{let c=0,u=11;for(;c<d.length;)u=101*u+d.charCodeAt(c++)>>>0;return"go"+u})(i));if(!Me[s]){let d=i!==e?e:(c=>{let u,p,m=[{}];for(;u=ou.exec(c.replace(au,""));)u[4]?m.shift():u[3]?(p=u[3].replace(Ha," ").trim(),m.unshift(m[0][p]=m[0][p]||{})):m[0][u[1]]=u[2].replace(Ha," ").trim();return m[0]})(e);Me[s]=Ue(o?{["@keyframes "+s]:d}:d,r?"":"."+s)}let l=r&&Me.g?Me.g:null;return r&&(Me.g=Me[s]),((d,c,u,p)=>{p?c.data=c.data.replace(p,d):c.data.indexOf(d)===-1&&(c.data=u?d+c.data:c.data+d)})(Me[s],t,n,l),s},su=(e,t,r)=>e.reduce((n,o,i)=>{let s=t[i];if(s&&s.call){let l=s(r),d=l&&l.props&&l.props.className||/^go/.test(l)&&l;s=d?"."+d:l&&typeof l=="object"?l.props?"":Ue(l,""):l===!1?"":l}return n+o+(s??"")},"");function Cr(e){let t=this||{},r=e.call?e(t.p):e;return iu(r.unshift?r.raw?su(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,nu(t.target),t.g,t.o,t.k)}let Wa,Bn,Un;Cr.bind({g:1});let De=Cr.bind({k:1});function lu(e,t,r,n){Ue.p=t,Wa=e,Bn=r,Un=n}function He(e,t){let r=this||{};return function(){let n=arguments;function o(i,s){let l=Object.assign({},i),d=l.className||o.className;r.p=Object.assign({theme:Bn&&Bn()},l),r.o=/ *go\d+/.test(d),l.className=Cr.apply(r,n)+(d?" "+d:"");let c=e;return e[0]&&(c=l.as||e,delete l.as),Un&&c[0]&&Un(l),Wa(c,l)}return o}}var cu=e=>typeof e=="function",kr=(e,t)=>cu(e)?e(t):e,du=(()=>{let e=0;return()=>(++e).toString()})(),qa=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),uu=20,Hn="default",Ga=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return Ga(e,{type:e.toasts.find(s=>s.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(s=>s.id===o||o===void 0?{...s,dismissed:!0,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(s=>({...s,pauseDuration:s.pauseDuration+i}))}}},Nr=[],Ka={toasts:[],pausedAt:void 0,settings:{toastLimit:uu}},Ee={},Ya=(e,t=Hn)=>{Ee[t]=Ga(Ee[t]||Ka,e),Nr.forEach(([r,n])=>{r===t&&n(Ee[t])})},Xa=e=>Object.keys(Ee).forEach(t=>Ya(e,t)),pu=e=>Object.keys(Ee).find(t=>Ee[t].toasts.some(r=>r.id===e)),Er=(e=Hn)=>t=>{Ya(t,e)},mu={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},fu=(e={},t=Hn)=>{let[r,n]=y.useState(Ee[t]||Ka),o=y.useRef(Ee[t]);y.useEffect(()=>(o.current!==Ee[t]&&n(Ee[t]),Nr.push([t,n]),()=>{let s=Nr.findIndex(([l])=>l===t);s>-1&&Nr.splice(s,1)}),[t]);let i=r.toasts.map(s=>{var l,d,c;return{...e,...e[s.type],...s,removeDelay:s.removeDelay||((l=e[s.type])==null?void 0:l.removeDelay)||e?.removeDelay,duration:s.duration||((d=e[s.type])==null?void 0:d.duration)||e?.duration||mu[s.type],style:{...e.style,...(c=e[s.type])==null?void 0:c.style,...s.style}}});return{...r,toasts:i}},hu=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:r?.id||du()}),Xt=e=>(t,r)=>{let n=hu(t,e,r);return Er(n.toasterId||pu(n.id))({type:2,toast:n}),n.id},ne=(e,t)=>Xt("blank")(e,t);ne.error=Xt("error"),ne.success=Xt("success"),ne.loading=Xt("loading"),ne.custom=Xt("custom"),ne.dismiss=(e,t)=>{let r={type:3,toastId:e};t?Er(t)(r):Xa(r)},ne.dismissAll=e=>ne.dismiss(void 0,e),ne.remove=(e,t)=>{let r={type:4,toastId:e};t?Er(t)(r):Xa(r)},ne.removeAll=e=>ne.remove(void 0,e),ne.promise=(e,t,r)=>{let n=ne.loading(t.loading,{...r,...r?.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let i=t.success?kr(t.success,o):void 0;return i?ne.success(i,{id:n,...r,...r?.success}):ne.dismiss(n),o}).catch(o=>{let i=t.error?kr(t.error,o):void 0;i?ne.error(i,{id:n,...r,...r?.error}):ne.dismiss(n)}),e};var gu=1e3,xu=(e,t="default")=>{let{toasts:r,pausedAt:n}=fu(e,t),o=y.useRef(new Map).current,i=y.useCallback((p,m=gu)=>{if(o.has(p))return;let g=setTimeout(()=>{o.delete(p),s({type:4,toastId:p})},m);o.set(p,g)},[]);y.useEffect(()=>{if(n)return;let p=Date.now(),m=r.map(g=>{if(g.duration===1/0)return;let b=(g.duration||0)+g.pauseDuration-(p-g.createdAt);if(b<0){g.visible&&ne.dismiss(g.id);return}return setTimeout(()=>ne.dismiss(g.id,t),b)});return()=>{m.forEach(g=>g&&clearTimeout(g))}},[r,n,t]);let s=y.useCallback(Er(t),[t]),l=y.useCallback(()=>{s({type:5,time:Date.now()})},[s]),d=y.useCallback((p,m)=>{s({type:1,toast:{id:p,height:m}})},[s]),c=y.useCallback(()=>{n&&s({type:6,time:Date.now()})},[n,s]),u=y.useCallback((p,m)=>{let{reverseOrder:g=!1,gutter:b=8,defaultPosition:f}=m||{},h=r.filter(w=>(w.position||f)===(p.position||f)&&w.height),v=h.findIndex(w=>w.id===p.id),_=h.filter((w,j)=>j<v&&w.visible).length;return h.filter(w=>w.visible).slice(...g?[_+1]:[0,_]).reduce((w,j)=>w+(j.height||0)+b,0)},[r]);return y.useEffect(()=>{r.forEach(p=>{if(p.dismissed)i(p.id,p.removeDelay);else{let m=o.get(p.id);m&&(clearTimeout(m),o.delete(p.id))}})},[r,i]),{toasts:r,handlers:{updateHeight:d,startPause:l,endPause:c,calculateOffset:u}}},bu=De`
     37 */function Fn(){return Fn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fn.apply(this,arguments)}function qd(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i<n.length;i++)o=n[i],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function Gd(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Kd(e,t){return e.button===0&&(!t||t==="_self")&&!Gd(e)}function $n(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}function Yd(e,t){let r=$n(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(i=>{r.append(o,i)})}),r}const Xd=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Jd="6";try{window.__reactRouterVersion=Jd}catch{}const $a=x["startTransition"];function Zd(e){let{basename:t,children:r,future:n,window:o}=e,i=x.useRef();i.current==null&&(i.current=Ed({window:o,v5Compat:!0}));let s=i.current,[l,c]=x.useState({action:s.action,location:s.location}),{v7_startTransition:d}=n||{},u=x.useCallback(p=>{d&&$a?$a(()=>c(p)):c(p)},[c,d]);return x.useLayoutEffect(()=>s.listen(u),[s,u]),x.useEffect(()=>Vd(n),[n]),x.createElement(Wd,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}const Qd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",eu=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bt=x.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:i,replace:s,state:l,target:c,to:d,preventScrollReset:u,viewTransition:p}=t,m=qd(t,Xd),{basename:g}=x.useContext(xt),b,f=!1;if(typeof d=="string"&&eu.test(d)&&(b=d,Qd))try{let w=new URL(window.location.href),j=d.startsWith("//")?new URL(w.protocol+d):new URL(d),C=Ta(j.pathname,g);j.origin===w.origin&&C!=null?d=C+j.search+j.hash:f=!0}catch{}let h=Dd(d,{relative:o}),_=tu(d,{replace:s,state:l,target:c,preventScrollReset:u,relative:o,viewTransition:p});function v(w){n&&n(w),w.defaultPrevented||_(w)}return x.createElement("a",Fn({},m,{href:b||h,onClick:f||i?n:v,ref:r,target:c}))});var Ba;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ba||(Ba={}));var Ua;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ua||(Ua={}));function tu(e,t){let{target:r,replace:n,state:o,preventScrollReset:i,relative:s,viewTransition:l}=t===void 0?{}:t,c=Ne(),d=Sr(),u=Ma(e,{relative:s});return x.useCallback(p=>{if(Kd(p,r)){p.preventDefault();let m=n!==void 0?n:vr(d)===vr(u);c(e,{replace:m,state:o,preventScrollReset:i,relative:s,viewTransition:l})}},[d,c,u,n,o,r,e,i,s,l])}function Jt(e){let t=x.useRef($n(e)),r=x.useRef(!1),n=Sr(),o=x.useMemo(()=>Yd(n.search,r.current?null:t.current),[n.search]),i=Ne(),s=x.useCallback((l,c)=>{const d=$n(typeof l=="function"?l(o):l);r.current=!0,i("?"+d,c)},[i,o]);return[o,s]}let ru={data:""},nu=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||ru},ou=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,au=/\/\*[^]*?\*\/|  +/g,Ha=/\n+/g,Ue=(e,t)=>{let r="",n="",o="";for(let i in e){let s=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+s+";":n+=i[1]=="f"?Ue(s,i):i+"{"+Ue(s,i[1]=="k"?"":t)+"}":typeof s=="object"?n+=Ue(s,t?t.replace(/([^,])+/g,l=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):i):s!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Ue.p?Ue.p(i,s):i+":"+s+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Me={},Va=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Va(e[r]);return t}return e},iu=(e,t,r,n,o)=>{let i=Va(e),s=Me[i]||(Me[i]=(c=>{let d=0,u=11;for(;d<c.length;)u=101*u+c.charCodeAt(d++)>>>0;return"go"+u})(i));if(!Me[s]){let c=i!==e?e:(d=>{let u,p,m=[{}];for(;u=ou.exec(d.replace(au,""));)u[4]?m.shift():u[3]?(p=u[3].replace(Ha," ").trim(),m.unshift(m[0][p]=m[0][p]||{})):m[0][u[1]]=u[2].replace(Ha," ").trim();return m[0]})(e);Me[s]=Ue(o?{["@keyframes "+s]:c}:c,r?"":"."+s)}let l=r&&Me.g?Me.g:null;return r&&(Me.g=Me[s]),((c,d,u,p)=>{p?d.data=d.data.replace(p,c):d.data.indexOf(c)===-1&&(d.data=u?c+d.data:d.data+c)})(Me[s],t,n,l),s},su=(e,t,r)=>e.reduce((n,o,i)=>{let s=t[i];if(s&&s.call){let l=s(r),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;s=c?"."+c:l&&typeof l=="object"?l.props?"":Ue(l,""):l===!1?"":l}return n+o+(s??"")},"");function Cr(e){let t=this||{},r=e.call?e(t.p):e;return iu(r.unshift?r.raw?su(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,nu(t.target),t.g,t.o,t.k)}let Wa,Bn,Un;Cr.bind({g:1});let De=Cr.bind({k:1});function lu(e,t,r,n){Ue.p=t,Wa=e,Bn=r,Un=n}function He(e,t){let r=this||{};return function(){let n=arguments;function o(i,s){let l=Object.assign({},i),c=l.className||o.className;r.p=Object.assign({theme:Bn&&Bn()},l),r.o=/ *go\d+/.test(c),l.className=Cr.apply(r,n)+(c?" "+c:"");let d=e;return e[0]&&(d=l.as||e,delete l.as),Un&&d[0]&&Un(l),Wa(d,l)}return o}}var cu=e=>typeof e=="function",kr=(e,t)=>cu(e)?e(t):e,du=(()=>{let e=0;return()=>(++e).toString()})(),qa=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),uu=20,Hn="default",Ga=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return Ga(e,{type:e.toasts.find(s=>s.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(s=>s.id===o||o===void 0?{...s,dismissed:!0,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(s=>({...s,pauseDuration:s.pauseDuration+i}))}}},Nr=[],Ka={toasts:[],pausedAt:void 0,settings:{toastLimit:uu}},Ee={},Ya=(e,t=Hn)=>{Ee[t]=Ga(Ee[t]||Ka,e),Nr.forEach(([r,n])=>{r===t&&n(Ee[t])})},Xa=e=>Object.keys(Ee).forEach(t=>Ya(e,t)),pu=e=>Object.keys(Ee).find(t=>Ee[t].toasts.some(r=>r.id===e)),Er=(e=Hn)=>t=>{Ya(t,e)},mu={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},fu=(e={},t=Hn)=>{let[r,n]=y.useState(Ee[t]||Ka),o=y.useRef(Ee[t]);y.useEffect(()=>(o.current!==Ee[t]&&n(Ee[t]),Nr.push([t,n]),()=>{let s=Nr.findIndex(([l])=>l===t);s>-1&&Nr.splice(s,1)}),[t]);let i=r.toasts.map(s=>{var l,c,d;return{...e,...e[s.type],...s,removeDelay:s.removeDelay||((l=e[s.type])==null?void 0:l.removeDelay)||e?.removeDelay,duration:s.duration||((c=e[s.type])==null?void 0:c.duration)||e?.duration||mu[s.type],style:{...e.style,...(d=e[s.type])==null?void 0:d.style,...s.style}}});return{...r,toasts:i}},hu=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:r?.id||du()}),Zt=e=>(t,r)=>{let n=hu(t,e,r);return Er(n.toasterId||pu(n.id))({type:2,toast:n}),n.id},ne=(e,t)=>Zt("blank")(e,t);ne.error=Zt("error"),ne.success=Zt("success"),ne.loading=Zt("loading"),ne.custom=Zt("custom"),ne.dismiss=(e,t)=>{let r={type:3,toastId:e};t?Er(t)(r):Xa(r)},ne.dismissAll=e=>ne.dismiss(void 0,e),ne.remove=(e,t)=>{let r={type:4,toastId:e};t?Er(t)(r):Xa(r)},ne.removeAll=e=>ne.remove(void 0,e),ne.promise=(e,t,r)=>{let n=ne.loading(t.loading,{...r,...r?.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let i=t.success?kr(t.success,o):void 0;return i?ne.success(i,{id:n,...r,...r?.success}):ne.dismiss(n),o}).catch(o=>{let i=t.error?kr(t.error,o):void 0;i?ne.error(i,{id:n,...r,...r?.error}):ne.dismiss(n)}),e};var gu=1e3,xu=(e,t="default")=>{let{toasts:r,pausedAt:n}=fu(e,t),o=y.useRef(new Map).current,i=y.useCallback((p,m=gu)=>{if(o.has(p))return;let g=setTimeout(()=>{o.delete(p),s({type:4,toastId:p})},m);o.set(p,g)},[]);y.useEffect(()=>{if(n)return;let p=Date.now(),m=r.map(g=>{if(g.duration===1/0)return;let b=(g.duration||0)+g.pauseDuration-(p-g.createdAt);if(b<0){g.visible&&ne.dismiss(g.id);return}return setTimeout(()=>ne.dismiss(g.id,t),b)});return()=>{m.forEach(g=>g&&clearTimeout(g))}},[r,n,t]);let s=y.useCallback(Er(t),[t]),l=y.useCallback(()=>{s({type:5,time:Date.now()})},[s]),c=y.useCallback((p,m)=>{s({type:1,toast:{id:p,height:m}})},[s]),d=y.useCallback(()=>{n&&s({type:6,time:Date.now()})},[n,s]),u=y.useCallback((p,m)=>{let{reverseOrder:g=!1,gutter:b=8,defaultPosition:f}=m||{},h=r.filter(w=>(w.position||f)===(p.position||f)&&w.height),_=h.findIndex(w=>w.id===p.id),v=h.filter((w,j)=>j<_&&w.visible).length;return h.filter(w=>w.visible).slice(...g?[v+1]:[0,v]).reduce((w,j)=>w+(j.height||0)+b,0)},[r]);return y.useEffect(()=>{r.forEach(p=>{if(p.dismissed)i(p.id,p.removeDelay);else{let m=o.get(p.id);m&&(clearTimeout(m),o.delete(p.id))}})},[r,i]),{toasts:r,handlers:{updateHeight:c,startPause:l,endPause:d,calculateOffset:u}}},bu=De`
    3838from {
    3939  transform: scale(0) rotate(45deg);
     
    4343 transform: scale(1) rotate(45deg);
    4444  opacity: 1;
    45 }`,vu=De`
     45}`,_u=De`
    4646from {
    4747  transform: scale(0);
     
    5151  transform: scale(1);
    5252  opacity: 1;
    53 }`,_u=De`
     53}`,vu=De`
    5454from {
    5555  transform: scale(0) rotate(90deg);
     
    7575  &:before {
    7676    content: '';
    77     animation: ${vu} 0.15s ease-out forwards;
     77    animation: ${_u} 0.15s ease-out forwards;
    7878    animation-delay: 150ms;
    7979    position: absolute;
     
    8888
    8989  &:before {
    90     animation: ${_u} 0.15s ease-out forwards;
     90    animation: ${vu} 0.15s ease-out forwards;
    9191    animation-delay: 180ms;
    9292    transform: rotate(90deg);
     
    206206  flex: 1 1 auto;
    207207  white-space: pre-line;
    208 `,Du=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=qa()?[Lu,Iu]:[Ou(r),Ru(r)];return{animation:t?`${De(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${De(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Fu=x.memo(({toast:e,position:t,style:r,children:n})=>{let o=e.height?Du(e.position||t||"top-center",e.visible):{opacity:0},i=x.createElement(Pu,{toast:e}),s=x.createElement(Mu,{...e.ariaProps},kr(e.message,e));return x.createElement(zu,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:i,message:s}):x.createElement(x.Fragment,null,i,s))});lu(x.createElement);var $u=({id:e,className:t,style:r,onHeightUpdate:n,children:o})=>{let i=x.useCallback(s=>{if(s){let l=()=>{let d=s.getBoundingClientRect().height;n(e,d)};l(),new MutationObserver(l).observe(s,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return x.createElement("div",{ref:i,className:t,style:r},o)},Bu=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:qa()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},Uu=Cr`
     208`,Du=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=qa()?[Lu,Iu]:[Ou(r),Ru(r)];return{animation:t?`${De(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${De(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Fu=x.memo(({toast:e,position:t,style:r,children:n})=>{let o=e.height?Du(e.position||t||"top-center",e.visible):{opacity:0},i=x.createElement(Pu,{toast:e}),s=x.createElement(Mu,{...e.ariaProps},kr(e.message,e));return x.createElement(zu,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:i,message:s}):x.createElement(x.Fragment,null,i,s))});lu(x.createElement);var $u=({id:e,className:t,style:r,onHeightUpdate:n,children:o})=>{let i=x.useCallback(s=>{if(s){let l=()=>{let c=s.getBoundingClientRect().height;n(e,c)};l(),new MutationObserver(l).observe(s,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return x.createElement("div",{ref:i,className:t,style:r},o)},Bu=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:qa()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},Uu=Cr`
    209209  z-index: 9999;
    210210  > * {
    211211    pointer-events: auto;
    212212  }
    213 `,Tr=16,Hu=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:i,containerStyle:s,containerClassName:l})=>{let{toasts:d,handlers:c}=xu(r,i);return x.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:Tr,left:Tr,right:Tr,bottom:Tr,pointerEvents:"none",...s},className:l,onMouseEnter:c.startPause,onMouseLeave:c.endPause},d.map(u=>{let p=u.position||t,m=c.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),g=Bu(p,m);return x.createElement($u,{id:u.id,key:u.id,onHeightUpdate:c.updateHeight,className:u.visible?Uu:"",style:g},u.type==="custom"?kr(u.message,u):o?o(u):x.createElement(Fu,{toast:u,position:p}))}))},K=ne;const Ja={carousel:"carousel",grid:"grid"},Vu=["marquee","stacked"],tt={topBottomSpacing:0,gap:16,gapOnMobile:16,shape:"rectangle",size:150,sizeOnMobile:150,hoverEffect:"none",border:{border_width:2,border_color:"#9ca3af",border_radius:6},shadow:{shadow_size:16},template:Ja.carousel,appearance:"overlay",widgetTitle:{alignment:"hidden",fontSize:24,color:"#000000"},playerAppearance:"overlay"},X={settings:"settings",stat:"statistics",cr:"create-reel",mg:"manage-group",ag:"all-groups",ar:"all-reels"},Wu=[{label:"None",value:"none"},{label:"zoom in",value:"zoom-in"},{label:"zoom out",value:"zoom-out"}],Za=[{label:"Horizontal",value:"horizontal"}],qu=[{label:"Vertical",value:"vertical"}],Gu=[{label:"Overlay",value:"overlay"},{label:"Only Title",value:"title"},{label:"None",value:"none"}],Ku=[{label:"Overlay",value:"overlay"},{label:"Only Tile",value:"title"},{label:"None",value:"none"}];var Qa={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ei=y.createContext&&y.createContext(Qa),Yu=["attr","size","title"];function Xu(e,t){if(e==null)return{};var r=Ju(e,t),n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ju(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ar(){return Ar=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ar.apply(this,arguments)}function ti(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Pr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ti(Object(r),!0).forEach(function(n){Zu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ti(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Zu(e,t,r){return t=Qu(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qu(e){var t=ep(e,"string");return typeof t=="symbol"?t:t+""}function ep(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ri(e){return e&&e.map((t,r)=>y.createElement(t.tag,Pr({key:r},t.attr),ri(t.child)))}function H(e){return t=>y.createElement(tp,Ar({attr:Pr({},e.attr)},t),ri(e.child))}function tp(e){var t=r=>{var{attr:n,size:o,title:i}=e,s=Xu(e,Yu),l=o||r.size||"1em",d;return r.className&&(d=r.className),e.className&&(d=(d?d+" ":"")+e.className),y.createElement("svg",Ar({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:d,style:Pr(Pr({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&y.createElement("title",null,i),e.children)};return ei!==void 0?y.createElement(ei.Consumer,null,r=>t(r)):t(Qa)}function rp(e){return H({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M164.44,105.34l-48-32A8,8,0,0,0,104,80v64a8,8,0,0,0,12.44,6.66l48-32a8,8,0,0,0,0-13.32ZM120,129.05V95l25.58,17ZM216,40H40A16,16,0,0,0,24,56V168a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,128H40V56H216V168Zm16,40a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16H224A8,8,0,0,1,232,208Z"},child:[]}]})(e)}function Jt(e){return H({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17 10h-1v-2c0-2.205-1.794-4-4-4s-4 1.795-4 4v2h-1c-1.103 0-2 .896-2 2v7c0 1.104.897 2 2 2h10c1.103 0 2-.896 2-2v-7c0-1.104-.897-2-2-2zm-5 8.299c-.719 0-1.3-.58-1.3-1.299s.581-1.301 1.3-1.301 1.3.582 1.3 1.301-.581 1.299-1.3 1.299zm2-7.299h-4v-3c0-1.104.897-2 2-2s2 .896 2 2v3z"},child:[]}]})(e)}function gt(e){return H({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18 10h-4v-4c0-1.104-.896-2-2-2s-2 .896-2 2l.071 4h-4.071c-1.104 0-2 .896-2 2s.896 2 2 2l4.071-.071-.071 4.071c0 1.104.896 2 2 2s2-.896 2-2v-4.071l4 .071c1.104 0 2-.896 2-2s-.896-2-2-2z"},child:[]}]})(e)}function Zt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m15 18-6-6 6-6"},child:[]}]})(e)}function Qt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m9 18 6-6-6-6"},child:[]}]})(e)}function np(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"},child:[]}]})(e)}function op(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]}]})(e)}function rt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12a9 9 0 1 1-6.219-8.56"},child:[]}]})(e)}function ap(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"},child:[]},{tag:"path",attr:{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7"},child:[]},{tag:"path",attr:{d:"M7 3v4a1 1 0 0 0 1 1h7"},child:[]}]})(e)}function ni(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"path",attr:{d:"m21 21-4.3-4.3"},child:[]}]})(e)}function ip(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},child:[]},{tag:"path",attr:{d:"M12 9v4"},child:[]},{tag:"path",attr:{d:"M12 17h.01"},child:[]}]})(e)}function er(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18 6 6 18"},child:[]},{tag:"path",attr:{d:"m6 6 12 12"},child:[]}]})(e)}function Vn(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function sp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function lp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},child:[]}]})(e)}function cp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM12 5.5v9l6-4.5z"},child:[]}]})(e)}function dp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M12 6.5a9.77 9.77 0 0 1 8.82 5.5c-1.65 3.37-5.02 5.5-8.82 5.5S4.83 15.37 3.18 12A9.77 9.77 0 0 1 12 6.5m0-2C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zm0 5a2.5 2.5 0 0 1 0 5 2.5 2.5 0 0 1 0-5m0-2c-2.48 0-4.5 2.02-4.5 4.5s2.02 4.5 4.5 4.5 4.5-2.02 4.5-4.5-2.02-4.5-4.5-4.5z"},child:[]}]})(e)}function oi(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Wn(...e){return t=>{let r=!1;const n=e.map(o=>{const i=oi(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():oi(e[o],null)}}}}function J(...e){return x.useCallback(Wn(...e),e)}function nt(e){const t=pp(e),r=x.forwardRef((n,o)=>{const{children:i,...s}=n,l=x.Children.toArray(i),d=l.find(fp);if(d){const c=d.props.children,u=l.map(p=>p===d?x.Children.count(c)>1?x.Children.only(null):x.isValidElement(c)?c.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(c)?x.cloneElement(c,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var up=nt("Slot");function pp(e){const t=x.forwardRef((r,n)=>{const{children:o,...i}=r;if(x.isValidElement(o)){const s=gp(o),l=hp(i,o.props);return o.type!==x.Fragment&&(l.ref=n?Wn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var mp=Symbol("radix.slottable");function fp(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mp}function hp(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const d=i(...l);return o(...l),d}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function gp(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function ai(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=ai(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function xp(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=ai(e))&&(n&&(n+=" "),n+=t);return n}function F(...e){return xp(e)}const bp="ecr-button",vp={default:"ecr-button--primary",destructive:"ecr-button--danger",outline:"ecr-button--outline","outline-danger":"ecr-button--outline-danger",secondary:"ecr-button--secondary",ghost:"ecr-button--ghost",link:"ecr-button--link"},_p={default:"ecr-button--md",sm:"ecr-button--sm",lg:"ecr-button--lg",icon:"ecr-button--icon","icon-sm":"ecr-button--icon-sm","icon-lg":"ecr-button--icon-lg"};function te({className:e,variant:t="default",size:r="default",asChild:n=!1,...o}){const i=n?up:"button";return a.jsx(i,{"data-slot":"button","data-variant":t,"data-size":r,className:F(bp,vp[t],_p[r],e),...o})}function yp({selectedReelIds:e,handleSelectAll:t,clearSelection:r,searchTerm:n,setSearchTerm:o,isCreating:i,handleCreateGroup:s,handleBulkDelete:l}){return a.jsxs("div",{className:"ecr-admin-reels-header",children:[a.jsxs("div",{className:"ecr-admin-reels-header__left",children:[a.jsx("h2",{className:"ecr-admin-reels-header__title",children:"Reels"}),e.length?a.jsxs("div",{className:"ecr-admin-reels-header__actions",children:[a.jsx(te,{onClick:t,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--primary",children:"Select all"}),a.jsx(te,{onClick:r,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--danger",children:"Clear"}),a.jsxs(te,{variant:"outline-danger",size:"sm",onClick:l,children:[a.jsx(Vn,{size:22,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"}),"Delete Selected"]})]}):null]}),a.jsxs("div",{className:"ecr-admin-reels-header__right",children:[a.jsxs("div",{className:"ecr-admin-reels-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:d=>o(d.target.value),className:"ecr-admin-search-input"}),a.jsxs("div",{className:"ecr-admin-reels-header__icon-wrapper",children:[n&&a.jsx(te,{onClick:()=>o(""),variant:"link",size:"icon-sm",children:a.jsx(er,{size:16,className:"ecr-admin-reels-header__clear-icon"})}),a.jsx(ni,{size:16,className:"ecr-admin-reels-header__search-icon"})]})," "]}),e.length?a.jsxs(te,{disabled:i,onClick:s,className:"ecr-admin-reels-header__create",children:[i?a.jsx(rt,{className:"ecr-admin-reels-header__spinner"}):a.jsx(gt,{})," ","Create Widget"]}):null]})]})}function jp(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m112 160-64 64 64 64"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M64 224h294c58.76 0 106 49.33 106 108v20"},child:[]}]})(e)}function Sp(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M262.29 192.31a64 64 0 1 0 57.4 57.4 64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22 155.3 155.3 0 0 1-21.46-12.57 16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22 155.3 155.3 0 0 1 21.46 12.57 16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z"},child:[]}]})(e)}function ot(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M85.57 446.25h340.86a32 32 0 0 0 28.17-47.17L284.18 82.58c-12.09-22.44-44.27-22.44-56.36 0L57.4 399.08a32 32 0 0 0 28.17 47.17z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m250.26 195.39 5.74 122 5.73-121.95a5.74 5.74 0 0 0-5.79-6h0a5.74 5.74 0 0 0-5.68 5.95z"},child:[]},{tag:"path",attr:{d:"M256 397.25a20 20 0 1 1 20-20 20 20 0 0 1-20 20z"},child:[]}]})(e)}function Cp(){return a.jsx("div",{className:"ecr-admin-reels-empty",children:a.jsxs("p",{className:"ecr-admin-reels-empty__text",children:[a.jsx(ot,{color:"#FFA500",size:40}),a.jsx("span",{children:"You did not have any reel yet."})]})})}function kp({isFullScreen:e}){return a.jsx("div",{className:F("ecr-admin-reels-loading",e&&"ecr-admin-reels-loading--fullscreen"),children:a.jsx(rt,{className:"ecr-admin-reels-loading__icon"})})}const ii=({playingStory:e,duration:t,currentFileIndex:r,isPaused:n})=>a.jsx("div",{className:"ecr-player__progress",children:e?.files?.map((o,i)=>a.jsx("div",{className:"ecr-player__progress-track",children:a.jsx("div",{style:{"--reels-wp-animation-time":`${t}s`,animationPlayState:n?"paused":"running"},className:F("ecr-player__progress-fill",i===r?.index?"ecr-player__progress-fill--active":i<r?.index?"ecr-player__progress-fill--complete":"ecr-player__progress-fill--empty")})},i))}),xt=({className:e,children:t,...r})=>a.jsx("button",{className:F("ecr-player__nav",e),...r,children:t});function qn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4.5 3H6v10H4.5V3zm7 0v10H10V3h1.5z"},child:[]}]})(e)}function Gn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 5h2.79l3.86-3.83.85.35v13l-.85.33L4.29 11H1.5l-.5-.5v-5l.5-.5zm3.35 5.17L8 13.31V2.73L4.85 5.85 4.5 6H2v4h2.5l.35.17zm9.381-4.108l.707.707L13.207 8.5l1.731 1.732-.707.707L12.5 9.207l-1.732 1.732-.707-.707L11.793 8.5 10.06 6.77l.707-.707 1.733 1.73 1.731-1.731z"},child:[]}]})(e)}function Kn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3.78 2L3 2.41v12l.78.42 9-6V8l-9-6zM4 13.48V3.35l7.6 5.07L4 13.48z"},child:[]}]})(e)}function Yn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 4.83h2.79L8.15 1l.85.35v13l-.85.33-3.86-3.85H1.5l-.5-.5v-5l.5-.5zM4.85 10L8 13.14V2.56L4.85 5.68l-.35.15H2v4h2.5l.35.17zM15 7.83a6.97 6.97 0 0 1-1.578 4.428l-.712-.71A5.975 5.975 0 0 0 14 7.83c0-1.4-.48-2.689-1.284-3.71l.712-.71A6.971 6.971 0 0 1 15 7.83zm-2 0a4.978 4.978 0 0 1-1.002 3.004l-.716-.716A3.982 3.982 0 0 0 12 7.83a3.98 3.98 0 0 0-.713-2.28l.716-.716c.626.835.997 1.872.997 2.996zm-2 0c0 .574-.16 1.11-.44 1.566l-.739-.738a1.993 1.993 0 0 0 .005-1.647l.739-.739c.276.454.435.988.435 1.558z"},child:[]}]})(e)}const Np="Left",Ep="Right",Tp="Up",Ap="Down",bt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Xn={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},si="mousemove",li="mouseup",Pp="touchend",Op="touchmove",Rp="touchstart";function Lp(e,t,r,n){return e>t?r>0?Ep:Np:n>0?Ap:Tp}function ci(e,t){if(t===0)return e;const r=Math.PI/180*t,n=e[0]*Math.cos(r)+e[1]*Math.sin(r),o=e[1]*Math.cos(r)-e[0]*Math.sin(r);return[n,o]}function Ip(e,t){const r=u=>{const p="touches"in u;p&&u.touches.length>1||e((m,g)=>{g.trackMouse&&!p&&(document.addEventListener(si,n),document.addEventListener(li,s));const{clientX:b,clientY:f}=p?u.touches[0]:u,h=ci([b,f],g.rotationAngle);return g.onTouchStartOrOnMouseDown&&g.onTouchStartOrOnMouseDown({event:u}),Object.assign(Object.assign(Object.assign({},m),Xn),{initial:h.slice(),xy:h,start:u.timeStamp||0})})},n=u=>{e((p,m)=>{const g="touches"in u;if(g&&u.touches.length>1)return p;if(u.timeStamp-p.start>m.swipeDuration)return p.swiping?Object.assign(Object.assign({},p),{swiping:!1}):p;const{clientX:b,clientY:f}=g?u.touches[0]:u,[h,v]=ci([b,f],m.rotationAngle),_=h-p.xy[0],w=v-p.xy[1],j=Math.abs(_),C=Math.abs(w),N=(u.timeStamp||0)-p.start,k=Math.sqrt(j*j+C*C)/(N||1),E=[_/(N||1),w/(N||1)],T=Lp(j,C,_,w),A=typeof m.delta=="number"?m.delta:m.delta[T.toLowerCase()]||bt.delta;if(j<A&&C<A&&!p.swiping)return p;const O={absX:j,absY:C,deltaX:_,deltaY:w,dir:T,event:u,first:p.first,initial:p.initial,velocity:k,vxvy:E};O.first&&m.onSwipeStart&&m.onSwipeStart(O),m.onSwiping&&m.onSwiping(O);let R=!1;return(m.onSwiping||m.onSwiped||m[`onSwiped${T}`])&&(R=!0),R&&m.preventScrollOnSwipe&&m.trackTouch&&u.cancelable&&u.preventDefault(),Object.assign(Object.assign({},p),{first:!1,eventData:O,swiping:!0})})},o=u=>{e((p,m)=>{let g;if(p.swiping&&p.eventData){if(u.timeStamp-p.start<m.swipeDuration){g=Object.assign(Object.assign({},p.eventData),{event:u}),m.onSwiped&&m.onSwiped(g);const b=m[`onSwiped${g.dir}`];b&&b(g)}}else m.onTap&&m.onTap({event:u});return m.onTouchEndOrOnMouseUp&&m.onTouchEndOrOnMouseUp({event:u}),Object.assign(Object.assign(Object.assign({},p),Xn),{eventData:g})})},i=()=>{document.removeEventListener(si,n),document.removeEventListener(li,s)},s=u=>{i(),o(u)},l=(u,p)=>{let m=()=>{};if(u&&u.addEventListener){const g=Object.assign(Object.assign({},bt.touchEventOptions),p.touchEventOptions),b=[[Rp,r,g],[Op,n,Object.assign(Object.assign({},g),p.preventScrollOnSwipe?{passive:!1}:{})],[Pp,o,g]];b.forEach(([f,h,v])=>u.addEventListener(f,h,v)),m=()=>b.forEach(([f,h])=>u.removeEventListener(f,h))}return m},c={ref:u=>{u!==null&&e((p,m)=>{if(p.el===u)return p;const g={};return p.el&&p.el!==u&&p.cleanUpTouch&&(p.cleanUpTouch(),g.cleanUpTouch=void 0),m.trackTouch&&u&&(g.cleanUpTouch=l(u,m)),Object.assign(Object.assign(Object.assign({},p),{el:u}),g)})}};return t.trackMouse&&(c.onMouseDown=r),[c,l]}function zp(e,t,r,n){return!t.trackTouch||!e.el?(e.cleanUpTouch&&e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:void 0})):e.cleanUpTouch?t.preventScrollOnSwipe!==r.preventScrollOnSwipe||t.touchEventOptions.passive!==r.touchEventOptions.passive?(e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})):e:Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})}function Mp(e){const{trackMouse:t}=e,r=x.useRef(Object.assign({},Xn)),n=x.useRef(Object.assign({},bt)),o=x.useRef(Object.assign({},n.current));o.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},bt),e);let i;for(i in bt)n.current[i]===void 0&&(n.current[i]=bt[i]);const[s,l]=x.useMemo(()=>Ip(d=>r.current=d(r.current,n.current),{trackMouse:t}),[t]);return r.current=zp(r.current,n.current,o.current,l),s}const Dp=({videoRefs:e,file:t,isMuted:r,isPaused:n,i:o,togglePlayPause:i,handleNextFile:s,setDuration:l})=>{const[d,c]=y.useState(!1);return a.jsx("div",{className:"ecr-player__media-frame",children:a.jsx("video",{preload:"none",playsInline:!0,muted:r,autoPlay:!n,controls:!1,loop:!1,disablePictureInPicture:!0,controlsList:"nodownload noplaybackrate noremoteplayback",ref:u=>{u&&(e.current[o]=u,u.setAttribute("webkit-playsinline","true"),u.setAttribute("x-webkit-airplay","allow"),u.setAttribute("airplay","allow"))},className:d?"ecr-player__media ecr-player__media--portrait":"ecr-player__media",src:t?.url,onClick:()=>i(o),onEnded:s,onLoadedMetadata:u=>{const p=u.currentTarget,m=p.videoWidth,g=p.videoHeight;c(g>m),l(p.duration)}})})},di=({currentFileIndex:e,files:t,setDuration:r,setIsPlaying:n,setPreviewReel:o,isPaused:i,setIsPaused:s,handlePrevFile:l,handleNextFile:d})=>{const[c,u]=y.useState(!1),p=y.useRef([]);y.useEffect(()=>{p.current=[]},[t]);const m=h=>{const v=p.current[h];v&&(i?v.play():v.pause(),s(_=>!_))},g=h=>{const v=p.current[h];v&&(v.muted=!c,u(_=>!_))},b=typeof window<"u"&&window.matchMedia("(max-width: 767px)").matches,f=Mp({trackMouse:!0,onSwipedRight:l,onSwipedLeft:d,onSwipedUp:()=>{b&&d()},onSwipedDown:()=>{if(b){l();return}n&&n(null),o&&o(null)}});return a.jsx("div",{style:{left:`${-100*e?.index}%`},className:"ecr-player__slider",...f,children:Array.isArray(t)&&t.map((h,v)=>a.jsx("div",{className:"ecr-player__slide",children:h?.mime_type?.startsWith("image")?null:a.jsxs("div",{className:"ecr-player__media-frame",children:[a.jsx(Dp,{videoRefs:p,file:h,isMuted:c,i:v,togglePlayPause:m,handleNextFile:d,setDuration:r,isPaused:i},h.file_uuid),a.jsxs("div",{className:"ecr-player__controls",children:[i?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(v)}):a.jsx(qn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(v)}),c?a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(v)}):a.jsx(Yn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(v)})]})]})},v))})},Fp=({previewReel:e,setPreviewReel:t})=>{const[r,n]=y.useState({index:0,story_uuid:e?.story_uuid}),[o,i]=y.useState(!1),[s,l]=y.useState(3);y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const d=()=>{const m=e?.files??[];r?.index>0?n(g=>({index:g.index-1,story_uuid:m[g.index-1].story_uuid})):t(null)},c=()=>{const m=e?.files??[];r?.index+1<m.length?n(g=>({index:g.index+1,story_uuid:m[g.index+1].story_uuid})):t(null)},u=e.files.length,p=m=>{m.target===m.currentTarget&&t(null)};return a.jsx("div",{onClick:p,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:e&&a.jsxs("div",{className:"ecr-player__stage",children:[u>1?a.jsxs(a.Fragment,{children:[r.index>0?a.jsx(xt,{onClick:d,className:"ecr-player__nav--left",children:a.jsx(Zt,{size:24})}):null,r.index<u-1?a.jsx(xt,{onClick:c,className:"ecr-player__nav--right",children:a.jsx(Qt,{size:24})}):null]}):null,a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[e&&a.jsx(ii,{playingStory:e,duration:s,currentFileIndex:r,isPaused:o},`${e.story_uuid}-${r.index}`),a.jsx("div",{onClick:()=>t(null),className:"ecr-player__close",children:a.jsx(er,{className:"ecr-player__close-icon"})}),e?.files.length>0&&a.jsx(di,{currentFileIndex:r,files:e?.files,setDuration:l,setPreviewReel:t,isPaused:o,setIsPaused:i,handlePrevFile:d,handleNextFile:c,storyId:e.id,storyTitle:e?.title})]})]})})};function $p(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z"},child:[]}]})(e)}function Bp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z"},child:[]}]})(e)}function Up(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z"},child:[]}]})(e)}function Or(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.045 7.401c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.378-.378-.88-.586-1.414-.586s-1.036.208-1.413.585L4 13.585V18h4.413L19.045 7.401zm-3-3 1.587 1.585-1.59 1.584-1.586-1.585 1.589-1.584zM6 16v-1.585l7.04-7.018 1.586 1.586L7.587 16H6zm-2 4h16v2H4z"},child:[]}]})(e)}function Hp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 19c.946 0 1.81-.103 2.598-.281l-1.757-1.757c-.273.021-.55.038-.841.038-5.351 0-7.424-3.846-7.926-5a8.642 8.642 0 0 1 1.508-2.297L4.184 8.305c-1.538 1.667-2.121 3.346-2.132 3.379a.994.994 0 0 0 0 .633C2.073 12.383 4.367 19 12 19zm0-14c-1.837 0-3.346.396-4.604.981L3.707 2.293 2.293 3.707l18 18 1.414-1.414-3.319-3.319c2.614-1.951 3.547-4.615 3.561-4.657a.994.994 0 0 0 0-.633C21.927 11.617 19.633 5 12 5zm4.972 10.558-2.28-2.28c.19-.39.308-.819.308-1.278 0-1.641-1.359-3-3-3-.459 0-.888.118-1.277.309L8.915 7.501A9.26 9.26 0 0 1 12 7c5.351 0 7.424 3.846 7.926 5-.302.692-1.166 2.342-2.954 3.558z"},child:[]}]})(e)}function ui(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 12a2 2 0 0 0-.703.133l-2.398-1.963c.059-.214.101-.436.101-.67C17 8.114 15.886 7 14.5 7S12 8.114 12 9.5c0 .396.1.765.262 1.097l-2.909 3.438A2.06 2.06 0 0 0 9 14c-.179 0-.348.03-.512.074l-2.563-2.563C5.97 11.348 6 11.179 6 11c0-1.108-.892-2-2-2s-2 .892-2 2 .892 2 2 2c.179 0 .348-.03.512-.074l2.563 2.563A1.906 1.906 0 0 0 7 16c0 1.108.892 2 2 2s2-.892 2-2c0-.237-.048-.46-.123-.671l2.913-3.442c.227.066.462.113.71.113a2.48 2.48 0 0 0 1.133-.281l2.399 1.963A2.077 2.077 0 0 0 18 14c0 1.108.892 2 2 2s2-.892 2-2-.892-2-2-2z"},child:[]}]})(e)}function Vp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM7 12.414l-3.707-3.707 1.414-1.414 2.293 2.293 4.793-4.793 1.414 1.414-6.207 6.207z"},child:[]}]})(e)}function Wp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM14 14h-12v-12h12v12z"},child:[]}]})(e)}function qp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 10c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2s-0.895 2-2 2z"},child:[]}]})(e)}function Gp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 14c-3.314 0-6-2.686-6-6s2.686-6 6-6c3.314 0 6 2.686 6 6s-2.686 6-6 6z"},child:[]}]})(e)}const Kp=e=>{if(e<1e3)return e;if(e<1e6){const r=e/1e3;return r%1===0?`${r}k`:`${r.toFixed(1)}k`}if(e<1e9){const r=e/1e6;return r%1===0?`${r}m`:`${r.toFixed(1)}m`}const t=e/1e9;return t%1===0?`${t}b`:`${t.toFixed(1)}b`},Yp=({story:e,styles:t,storyViews:r,setStoryViews:n})=>{y.useEffect(()=>{n&&n(s=>({...s,[e.id]:e.view_count}))},[e]);const o=e?.files[0]?.mime_type.startsWith("video"),i=e.thumbnail||void 0;return a.jsxs("div",{className:"ecr-thumb__media",children:[o?a.jsx("video",{className:"ecr-thumb__video",src:e?.files[0]?.url,poster:i}):a.jsx("div",{className:"ecr-thumb__placeholder",children:"No Video"}),(r?.[e.id]??e.view_count)>0&&a.jsxs("div",{style:{left:t?.shape==="circle"?"50%":"100%",transform:`translateX(${t?.shape==="circle"?"-50%":`calc(-120% - ${t.border.border_radius/2}px)`})`,transition:"all 0.3s ease-in-out"},className:"ecr-thumb__views",children:[a.jsx("span",{children:Kp(r?.[e.id]??e.view_count)}),a.jsx(op,{size:14})]})]})},Jn=y.memo(Yp);function Xp({reel:e,styles:t,isSelected:r,onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:s}){return a.jsxs("div",{className:`ecr-admin-reel-card ${t?.hoverEffect??""}`,children:[a.jsxs("div",{style:{aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},className:F("ecr-admin-reel-card__frame",r?"ecr-admin-reel-card__frame--selected":""),children:[a.jsx(Jn,{story:e,styles:t}),a.jsxs("div",{className:F("ecr-admin-reel-card__actions",s?"":"ecr-admin-reel-card__actions--hover"),children:[e.files[0]?.mime_type.startsWith("image")?null:a.jsx(te,{onClick:()=>i(e),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--primary",size:"icon-sm",title:"Preview Reel",children:a.jsx(dp,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--primary"})}),a.jsx(te,{title:"Edit Reel",size:"icon-sm",asChild:!0,className:"ecr-admin-reel-card__action",children:a.jsx(ht,{to:`?view=${X.cr}&from=${X.ar}&sid=${e.id}`,children:a.jsx(Or,{className:"ecr-admin-reel-card__icon"})})}),a.jsx(te,{onClick:()=>o(e.id),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--danger",size:"icon-sm",title:"Remove Reel",children:a.jsx(Vn,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"})})]}),a.jsx("div",{style:{clipPath:"polygon(0% 0, 100% 100%, 100% 0)"},className:F("ecr-admin-reel-card__corner",s?"":"ecr-admin-reel-card__corner--hidden",r?"ecr-admin-reel-card__corner--selected":"ecr-admin-reel-card__corner--idle"),children:a.jsx(te,{onClick:()=>n(e.id),size:"icon-sm",className:"ecr-admin-reel-card__select",children:r?a.jsx(Vp,{size:18,className:"ecr-admin-reel-card__check ecr-admin-reel-card__check--active"}):a.jsx(Wp,{size:18,className:"ecr-admin-reel-card__check"})})})]}),e.title&&a.jsx("p",{className:"ecr-admin-reel-card__title",children:e.title})]})}function Jp({reels:e,styles:t,selectedReelIds:r,onSelectReel:n,onDeleteReel:o,onPreviewReel:i,lastStoryElementRef:s}){return a.jsx("div",{className:"ecr-admin-reels-grid",children:e?.map((l,d)=>a.jsx("div",{ref:e.length===d+1?s:null,children:a.jsx(Xp,{reel:l,styles:t,isSelected:r.includes(l.id),onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:r.length>0})},l.id))})}const tr=({cb:e})=>{const t=Ne(),r=()=>{e?e():t(-1)};return a.jsx("button",{title:"Back",onClick:r,className:"ecr-admin-back-button",children:a.jsx(jp,{size:24})})};function Zp(e){return H({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"},child:[]}]})(e)}const rr=({breads:e=[],onNavigate:t})=>a.jsx("nav",{className:"ecr-admin-breadcrumb","aria-label":"Breadcrumb",children:a.jsx("ul",{className:"ecr-admin-breadcrumb__list",children:e.map((r,n)=>{const o=!r.href;return a.jsxs("li",{className:"ecr-admin-breadcrumb__item",children:[r.href&&!o?a.jsx(ht,{to:r.href,className:"ecr-admin-breadcrumb__link",onClick:i=>{if(!t)return;const s=r.href;s&&(i.preventDefault(),t(s))},children:r.label}):a.jsx("span",{className:"ecr-admin-breadcrumb__current",children:r.label}),n<e.length-1&&a.jsx(Zp,{className:"ecr-admin-breadcrumb__separator"})]},n)})})}),Rr=({onReject:e,onAccept:t,isLoading:r,message:n="Are you sure, You want to delete this story?"})=>{const o=y.useRef(null);return y.useEffect(()=>{o.current&&o.current.focus()},[]),a.jsx("div",{className:"ecr-admin-modal",children:a.jsxs("div",{ref:o,tabIndex:-1,className:"ecr-admin-modal__panel",onBlur:i=>{i.currentTarget.contains(i.relatedTarget)||e(null)},children:[a.jsxs("div",{className:"ecr-admin-modal__content",children:[a.jsx("div",{className:"ecr-admin-modal__icon",children:a.jsx(ip,{size:40,color:"#ffa500"})}),a.jsx("p",{className:"ecr-admin-modal__message",children:n})]}),a.jsxs("div",{className:"ecr-admin-modal__actions",children:[a.jsx("button",{disabled:r,onClick:()=>e(null),className:"ecr-admin-modal__button ecr-admin-modal__button--cancel",children:"No"}),a.jsxs("button",{disabled:r,onClick:t,className:"ecr-admin-modal__button ecr-admin-modal__button--danger",children:[r&&a.jsx(rt,{className:"ecr-admin-modal__spinner"}),"Yes"]})]})]})})},Lr=({to:e,Icon:t,textColor:r="#fff",text:n,className:o,onNavigate:i})=>a.jsxs(ht,{style:{color:r},to:e,className:F("ecr-admin-link-button",o),onClick:s=>{i&&(s.preventDefault(),i(e))},children:[t&&a.jsx(t,{}),n]}),Ir=({className:e})=>a.jsx("div",{className:F("ecr-admin-loader",e),children:a.jsx(rt,{className:"ecr-admin-loader__icon",size:64})}),vt=({left:e=[],center:t=[],right:r=[],leftClass:n="",centerClass:o="",rightClass:i=""})=>a.jsxs("div",{className:"ecr-admin-navbar",children:[a.jsx("div",{className:`ecr-admin-navbar__section ${n}`.trim(),children:e.map((s,l)=>a.jsx(y.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${o}`.trim(),children:t.map((s,l)=>a.jsx(y.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${i}`.trim(),children:r.map((s,l)=>a.jsx(y.Fragment,{children:s},l))})]}),_t=({name:e,Icon:t})=>a.jsxs("h1",{className:"ecr-admin-page-name",children:[a.jsx(t,{}),e]});function Qp(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M55 18v476h18v-37h46v37h274v-37h46v37h18V18h-18v37h-46V18h-18v60H137V18h-18v37H73V18H55zm18 55h46v46H73V73zm320 0h46v46h-46V73zm-256 41h238v156H137V114zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 201h46v46H73v-46zm320 0h46v46h-46v-46zM73 265h46v46H73v-46zm320 0h46v46h-46v-46zm-256 41h238v156H137V306zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 393h46v46H73v-46zm320 0h46v46h-46v-46z"},child:[]}]})(e)}const zr=()=>a.jsxs("div",{className:"ecr-admin-widget-name",children:[a.jsx(Qp,{}),"ReelsWP"]});function pi(e,t){return function(){return e.apply(t,arguments)}}const{toString:em}=Object.prototype,{getPrototypeOf:Zn}=Object,{iterator:Mr,toStringTag:mi}=Symbol,Dr=(e=>t=>{const r=em.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),we=e=>(e=e.toLowerCase(),t=>Dr(t)===e),Fr=e=>t=>typeof t===e,{isArray:yt}=Array,wt=Fr("undefined");function nr(e){return e!==null&&!wt(e)&&e.constructor!==null&&!wt(e.constructor)&&me(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const fi=we("ArrayBuffer");function tm(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&fi(e.buffer),t}const rm=Fr("string"),me=Fr("function"),hi=Fr("number"),or=e=>e!==null&&typeof e=="object",nm=e=>e===!0||e===!1,$r=e=>{if(Dr(e)!=="object")return!1;const t=Zn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(mi in e)&&!(Mr in e)},om=e=>{if(!or(e)||nr(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},am=we("Date"),im=we("File"),sm=we("Blob"),lm=we("FileList"),cm=e=>or(e)&&me(e.pipe),dm=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||me(e.append)&&((t=Dr(e))==="formdata"||t==="object"&&me(e.toString)&&e.toString()==="[object FormData]"))},um=we("URLSearchParams"),[pm,mm,fm,hm]=["ReadableStream","Request","Response","Headers"].map(we),gm=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ar(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),yt(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(nr(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let l;for(n=0;n<s;n++)l=i[n],t.call(null,e[l],l,e)}}function gi(e,t){if(nr(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const at=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,xi=e=>!wt(e)&&e!==at;function Qn(){const{caseless:e,skipUndefined:t}=xi(this)&&this||{},r={},n=(o,i)=>{const s=e&&gi(r,i)||i;$r(r[s])&&$r(o)?r[s]=Qn(r[s],o):$r(o)?r[s]=Qn({},o):yt(o)?r[s]=o.slice():(!t||!wt(o))&&(r[s]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&ar(arguments[o],n);return r}const xm=(e,t,r,{allOwnKeys:n}={})=>(ar(t,(o,i)=>{r&&me(o)?e[i]=pi(o,r):e[i]=o},{allOwnKeys:n}),e),bm=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),vm=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},_m=(e,t,r,n)=>{let o,i,s;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!l[s]&&(t[s]=e[s],l[s]=!0);e=r!==!1&&Zn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},ym=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},wm=e=>{if(!e)return null;if(yt(e))return e;let t=e.length;if(!hi(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},jm=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Zn(Uint8Array)),Sm=(e,t)=>{const n=(e&&e[Mr]).call(e);let o;for(;(o=n.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},Cm=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},km=we("HTMLFormElement"),Nm=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),bi=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Em=we("RegExp"),vi=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ar(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},Tm=e=>{vi(e,(t,r)=>{if(me(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(me(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Am=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return yt(e)?n(e):n(String(e).split(t)),r},Pm=()=>{},Om=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Rm(e){return!!(e&&me(e.append)&&e[mi]==="FormData"&&e[Mr])}const Lm=e=>{const t=new Array(10),r=(n,o)=>{if(or(n)){if(t.indexOf(n)>=0)return;if(nr(n))return n;if(!("toJSON"in n)){t[o]=n;const i=yt(n)?[]:{};return ar(n,(s,l)=>{const d=r(s,o+1);!wt(d)&&(i[l]=d)}),t[o]=void 0,i}}return n};return r(e,0)},Im=we("AsyncFunction"),zm=e=>e&&(or(e)||me(e))&&me(e.then)&&me(e.catch),_i=((e,t)=>e?setImmediate:t?((r,n)=>(at.addEventListener("message",({source:o,data:i})=>{o===at&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),at.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",me(at.postMessage)),Mm=typeof queueMicrotask<"u"?queueMicrotask.bind(at):typeof process<"u"&&process.nextTick||_i,S={isArray:yt,isArrayBuffer:fi,isBuffer:nr,isFormData:dm,isArrayBufferView:tm,isString:rm,isNumber:hi,isBoolean:nm,isObject:or,isPlainObject:$r,isEmptyObject:om,isReadableStream:pm,isRequest:mm,isResponse:fm,isHeaders:hm,isUndefined:wt,isDate:am,isFile:im,isBlob:sm,isRegExp:Em,isFunction:me,isStream:cm,isURLSearchParams:um,isTypedArray:jm,isFileList:lm,forEach:ar,merge:Qn,extend:xm,trim:gm,stripBOM:bm,inherits:vm,toFlatObject:_m,kindOf:Dr,kindOfTest:we,endsWith:ym,toArray:wm,forEachEntry:Sm,matchAll:Cm,isHTMLForm:km,hasOwnProperty:bi,hasOwnProp:bi,reduceDescriptors:vi,freezeMethods:Tm,toObjectSet:Am,toCamelCase:Nm,noop:Pm,toFiniteNumber:Om,findKey:gi,global:at,isContextDefined:xi,isSpecCompliantForm:Rm,toJSONObject:Lm,isAsyncFn:Im,isThenable:zm,setImmediate:_i,asap:Mm,isIterable:e=>e!=null&&me(e[Mr])};function U(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}S.inherits(U,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:S.toJSONObject(this.config),code:this.code,status:this.status}}});const yi=U.prototype,wi={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{wi[e]={value:e}}),Object.defineProperties(U,wi),Object.defineProperty(yi,"isAxiosError",{value:!0}),U.from=(e,t,r,n,o,i)=>{const s=Object.create(yi);S.toFlatObject(e,s,function(u){return u!==Error.prototype},c=>c!=="isAxiosError");const l=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return U.call(s,l,d,r,n,o),e&&s.cause==null&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const Dm=null;function eo(e){return S.isPlainObject(e)||S.isArray(e)}function ji(e){return S.endsWith(e,"[]")?e.slice(0,-2):e}function Si(e,t,r){return e?e.concat(t).map(function(o,i){return o=ji(o),!r&&i?"["+o+"]":o}).join(r?".":""):t}function Fm(e){return S.isArray(e)&&!e.some(eo)}const $m=S.toFlatObject(S,{},null,function(t){return/^is[A-Z]/.test(t)});function Br(e,t,r){if(!S.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=S.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,h){return!S.isUndefined(h[f])});const n=r.metaTokens,o=r.visitor||u,i=r.dots,s=r.indexes,d=(r.Blob||typeof Blob<"u"&&Blob)&&S.isSpecCompliantForm(t);if(!S.isFunction(o))throw new TypeError("visitor must be a function");function c(b){if(b===null)return"";if(S.isDate(b))return b.toISOString();if(S.isBoolean(b))return b.toString();if(!d&&S.isBlob(b))throw new U("Blob is not supported. Use a Buffer instead.");return S.isArrayBuffer(b)||S.isTypedArray(b)?d&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function u(b,f,h){let v=b;if(b&&!h&&typeof b=="object"){if(S.endsWith(f,"{}"))f=n?f:f.slice(0,-2),b=JSON.stringify(b);else if(S.isArray(b)&&Fm(b)||(S.isFileList(b)||S.endsWith(f,"[]"))&&(v=S.toArray(b)))return f=ji(f),v.forEach(function(w,j){!(S.isUndefined(w)||w===null)&&t.append(s===!0?Si([f],j,i):s===null?f:f+"[]",c(w))}),!1}return eo(b)?!0:(t.append(Si(h,f,i),c(b)),!1)}const p=[],m=Object.assign($m,{defaultVisitor:u,convertValue:c,isVisitable:eo});function g(b,f){if(!S.isUndefined(b)){if(p.indexOf(b)!==-1)throw Error("Circular reference detected in "+f.join("."));p.push(b),S.forEach(b,function(v,_){(!(S.isUndefined(v)||v===null)&&o.call(t,v,S.isString(_)?_.trim():_,f,m))===!0&&g(v,f?f.concat(_):[_])}),p.pop()}}if(!S.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Ci(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function to(e,t){this._pairs=[],e&&Br(e,this,t)}const ki=to.prototype;ki.append=function(t,r){this._pairs.push([t,r])},ki.toString=function(t){const r=t?function(n){return t.call(this,n,Ci)}:Ci;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Bm(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ni(e,t,r){if(!t)return e;const n=r&&r.encode||Bm;S.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(o?i=o(t,r):i=S.isURLSearchParams(t)?t.toString():new to(t,r).toString(n),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ei{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){S.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Ti={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Um={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:to,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ro=typeof window<"u"&&typeof document<"u",no=typeof navigator=="object"&&navigator||void 0,Hm=ro&&(!no||["ReactNative","NativeScript","NS"].indexOf(no.product)<0),Vm=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Wm=ro&&window.location.href||"http://localhost",de={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ro,hasStandardBrowserEnv:Hm,hasStandardBrowserWebWorkerEnv:Vm,navigator:no,origin:Wm},Symbol.toStringTag,{value:"Module"})),...Um};function qm(e,t){return Br(e,new de.classes.URLSearchParams,{visitor:function(r,n,o,i){return de.isNode&&S.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function Gm(e){return S.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Km(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}function Ai(e){function t(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const l=Number.isFinite(+s),d=i>=r.length;return s=!s&&S.isArray(o)?o.length:s,d?(S.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!l):((!o[s]||!S.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&S.isArray(o[s])&&(o[s]=Km(o[s])),!l)}if(S.isFormData(e)&&S.isFunction(e.entries)){const r={};return S.forEachEntry(e,(n,o)=>{t(Gm(n),o,r,0)}),r}return null}function Ym(e,t,r){if(S.isString(e))try{return(t||JSON.parse)(e),S.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const ir={transitional:Ti,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=S.isObject(t);if(i&&S.isHTMLForm(t)&&(t=new FormData(t)),S.isFormData(t))return o?JSON.stringify(Ai(t)):t;if(S.isArrayBuffer(t)||S.isBuffer(t)||S.isStream(t)||S.isFile(t)||S.isBlob(t)||S.isReadableStream(t))return t;if(S.isArrayBufferView(t))return t.buffer;if(S.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return qm(t,this.formSerializer).toString();if((l=S.isFileList(t))||n.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Br(l?{"files[]":t}:t,d&&new d,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),Ym(t)):t}],transformResponse:[function(t){const r=this.transitional||ir.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(S.isResponse(t)||S.isReadableStream(t))return t;if(t&&S.isString(t)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(l){if(s)throw l.name==="SyntaxError"?U.from(l,U.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:de.classes.FormData,Blob:de.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};S.forEach(["delete","get","head","post","put","patch"],e=>{ir.headers[e]={}});const Xm=S.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Jm=e=>{const t={};let r,n,o;return e&&e.split(`
    214 `).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||t[r]&&Xm[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Pi=Symbol("internals");function sr(e){return e&&String(e).trim().toLowerCase()}function Ur(e){return e===!1||e==null?e:S.isArray(e)?e.map(Ur):String(e)}function Zm(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const Qm=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function oo(e,t,r,n,o){if(S.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!S.isString(t)){if(S.isString(n))return t.indexOf(n)!==-1;if(S.isRegExp(n))return n.test(t)}}function ef(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function tf(e,t){const r=S.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,i,s){return this[n].call(this,t,o,i,s)},configurable:!0})})}let fe=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function i(l,d,c){const u=sr(d);if(!u)throw new Error("header name must be a non-empty string");const p=S.findKey(o,u);(!p||o[p]===void 0||c===!0||c===void 0&&o[p]!==!1)&&(o[p||d]=Ur(l))}const s=(l,d)=>S.forEach(l,(c,u)=>i(c,u,d));if(S.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(S.isString(t)&&(t=t.trim())&&!Qm(t))s(Jm(t),r);else if(S.isObject(t)&&S.isIterable(t)){let l={},d,c;for(const u of t){if(!S.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[c=u[0]]=(d=l[c])?S.isArray(d)?[...d,u[1]]:[d,u[1]]:u[1]}s(l,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=sr(t),t){const n=S.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return Zm(o);if(S.isFunction(r))return r.call(this,o,n);if(S.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=sr(t),t){const n=S.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||oo(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function i(s){if(s=sr(s),s){const l=S.findKey(n,s);l&&(!r||oo(n,n[l],l,r))&&(delete n[l],o=!0)}}return S.isArray(t)?t.forEach(i):i(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const i=r[n];(!t||oo(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const r=this,n={};return S.forEach(this,(o,i)=>{const s=S.findKey(n,i);if(s){r[s]=Ur(o),delete r[i];return}const l=t?ef(i):String(i).trim();l!==i&&delete r[i],r[l]=Ur(o),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return S.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&S.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
    215 `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Pi]=this[Pi]={accessors:{}}).accessors,o=this.prototype;function i(s){const l=sr(s);n[l]||(tf(o,s),n[l]=!0)}return S.isArray(t)?t.forEach(i):i(t),this}};fe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),S.reduceDescriptors(fe.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),S.freezeMethods(fe);function ao(e,t){const r=this||ir,n=t||r,o=fe.from(n.headers);let i=n.data;return S.forEach(e,function(l){i=l.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Oi(e){return!!(e&&e.__CANCEL__)}function jt(e,t,r){U.call(this,e??"canceled",U.ERR_CANCELED,t,r),this.name="CanceledError"}S.inherits(jt,U,{__CANCEL__:!0});function Ri(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new U("Request failed with status code "+r.status,[U.ERR_BAD_REQUEST,U.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function rf(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function nf(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(d){const c=Date.now(),u=n[i];s||(s=c),r[o]=d,n[o]=c;let p=i,m=0;for(;p!==o;)m+=r[p++],p=p%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-s<t)return;const g=u&&c-u;return g?Math.round(m*1e3/g):void 0}}function of(e,t){let r=0,n=1e3/t,o,i;const s=(c,u=Date.now())=>{r=u,o=null,i&&(clearTimeout(i),i=null),e(...c)};return[(...c)=>{const u=Date.now(),p=u-r;p>=n?s(c,u):(o=c,i||(i=setTimeout(()=>{i=null,s(o)},n-p)))},()=>o&&s(o)]}const Hr=(e,t,r=3)=>{let n=0;const o=nf(50,250);return of(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,d=s-n,c=o(d),u=s<=l;n=s;const p={loaded:s,total:l,progress:l?s/l:void 0,bytes:d,rate:c||void 0,estimated:c&&l&&u?(l-s)/c:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(p)},r)},Li=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ii=e=>(...t)=>S.asap(()=>e(...t)),af=de.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,de.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(de.origin),de.navigator&&/(msie|trident)/i.test(de.navigator.userAgent)):()=>!0,sf=de.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];S.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),S.isString(n)&&l.push(`path=${n}`),S.isString(o)&&l.push(`domain=${o}`),i===!0&&l.push("secure"),S.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function lf(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function cf(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function zi(e,t,r){let n=!lf(t);return e&&(n||r==!1)?cf(e,t):t}const Mi=e=>e instanceof fe?{...e}:e;function it(e,t){t=t||{};const r={};function n(c,u,p,m){return S.isPlainObject(c)&&S.isPlainObject(u)?S.merge.call({caseless:m},c,u):S.isPlainObject(u)?S.merge({},u):S.isArray(u)?u.slice():u}function o(c,u,p,m){if(S.isUndefined(u)){if(!S.isUndefined(c))return n(void 0,c,p,m)}else return n(c,u,p,m)}function i(c,u){if(!S.isUndefined(u))return n(void 0,u)}function s(c,u){if(S.isUndefined(u)){if(!S.isUndefined(c))return n(void 0,c)}else return n(void 0,u)}function l(c,u,p){if(p in t)return n(c,u);if(p in e)return n(void 0,c)}const d={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(c,u,p)=>o(Mi(c),Mi(u),p,!0)};return S.forEach(Object.keys({...e,...t}),function(u){const p=d[u]||o,m=p(e[u],t[u],u);S.isUndefined(m)&&p!==l||(r[u]=m)}),r}const Di=e=>{const t=it({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:l}=t;if(t.headers=s=fe.from(s),t.url=Ni(zi(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),S.isFormData(r)){if(de.hasStandardBrowserEnv||de.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(S.isFunction(r.getHeaders)){const d=r.getHeaders(),c=["content-type","content-length"];Object.entries(d).forEach(([u,p])=>{c.includes(u.toLowerCase())&&s.set(u,p)})}}if(de.hasStandardBrowserEnv&&(n&&S.isFunction(n)&&(n=n(t)),n||n!==!1&&af(t.url))){const d=o&&i&&sf.read(i);d&&s.set(o,d)}return t},df=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Di(e);let i=o.data;const s=fe.from(o.headers).normalize();let{responseType:l,onUploadProgress:d,onDownloadProgress:c}=o,u,p,m,g,b;function f(){g&&g(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let h=new XMLHttpRequest;h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout;function v(){if(!h)return;const w=fe.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),C={data:!l||l==="text"||l==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:w,config:e,request:h};Ri(function(k){r(k),f()},function(k){n(k),f()},C),h=null}"onloadend"in h?h.onloadend=v:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(v)},h.onabort=function(){h&&(n(new U("Request aborted",U.ECONNABORTED,e,h)),h=null)},h.onerror=function(j){const C=j&&j.message?j.message:"Network Error",N=new U(C,U.ERR_NETWORK,e,h);N.event=j||null,n(N),h=null},h.ontimeout=function(){let j=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const C=o.transitional||Ti;o.timeoutErrorMessage&&(j=o.timeoutErrorMessage),n(new U(j,C.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,e,h)),h=null},i===void 0&&s.setContentType(null),"setRequestHeader"in h&&S.forEach(s.toJSON(),function(j,C){h.setRequestHeader(C,j)}),S.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),l&&l!=="json"&&(h.responseType=o.responseType),c&&([m,b]=Hr(c,!0),h.addEventListener("progress",m)),d&&h.upload&&([p,g]=Hr(d),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(u=w=>{h&&(n(!w||w.type?new jt(null,e,h):w),h.abort(),h=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const _=rf(o.url);if(_&&de.protocols.indexOf(_)===-1){n(new U("Unsupported protocol "+_+":",U.ERR_BAD_REQUEST,e));return}h.send(i||null)})},uf=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const i=function(c){if(!o){o=!0,l();const u=c instanceof Error?c:this.reason;n.abort(u instanceof U?u:new jt(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,i(new U(`timeout ${t} of ms exceeded`,U.ETIMEDOUT))},t);const l=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),e=null)};e.forEach(c=>c.addEventListener("abort",i));const{signal:d}=n;return d.unsubscribe=()=>S.asap(l),d}},pf=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},mf=async function*(e,t){for await(const r of ff(e))yield*pf(r,t)},ff=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Fi=(e,t,r,n)=>{const o=mf(e,t);let i=0,s,l=d=>{s||(s=!0,n&&n(d))};return new ReadableStream({async pull(d){try{const{done:c,value:u}=await o.next();if(c){l(),d.close();return}let p=u.byteLength;if(r){let m=i+=p;r(m)}d.enqueue(new Uint8Array(u))}catch(c){throw l(c),c}},cancel(d){return l(d),o.return()}},{highWaterMark:2})},$i=64*1024,{isFunction:Vr}=S,hf=(({Request:e,Response:t})=>({Request:e,Response:t}))(S.global),{ReadableStream:Bi,TextEncoder:Ui}=S.global,Hi=(e,...t)=>{try{return!!e(...t)}catch{return!1}},gf=e=>{e=S.merge.call({skipUndefined:!0},hf,e);const{fetch:t,Request:r,Response:n}=e,o=t?Vr(t):typeof fetch=="function",i=Vr(r),s=Vr(n);if(!o)return!1;const l=o&&Vr(Bi),d=o&&(typeof Ui=="function"?(b=>f=>b.encode(f))(new Ui):async b=>new Uint8Array(await new r(b).arrayBuffer())),c=i&&l&&Hi(()=>{let b=!1;const f=new r(de.origin,{body:new Bi,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!f}),u=s&&l&&Hi(()=>S.isReadableStream(new n("").body)),p={stream:u&&(b=>b.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!p[b]&&(p[b]=(f,h)=>{let v=f&&f[b];if(v)return v.call(f);throw new U(`Response type '${b}' is not supported`,U.ERR_NOT_SUPPORT,h)})});const m=async b=>{if(b==null)return 0;if(S.isBlob(b))return b.size;if(S.isSpecCompliantForm(b))return(await new r(de.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(S.isArrayBufferView(b)||S.isArrayBuffer(b))return b.byteLength;if(S.isURLSearchParams(b)&&(b=b+""),S.isString(b))return(await d(b)).byteLength},g=async(b,f)=>{const h=S.toFiniteNumber(b.getContentLength());return h??m(f)};return async b=>{let{url:f,method:h,data:v,signal:_,cancelToken:w,timeout:j,onDownloadProgress:C,onUploadProgress:N,responseType:k,headers:E,withCredentials:T="same-origin",fetchOptions:A}=Di(b),O=t||fetch;k=k?(k+"").toLowerCase():"text";let R=uf([_,w&&w.toAbortSignal()],j),L=null;const P=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let M;try{if(N&&c&&h!=="get"&&h!=="head"&&(M=await g(E,v))!==0){let ie=new r(f,{method:"POST",body:v,duplex:"half"}),ge;if(S.isFormData(v)&&(ge=ie.headers.get("content-type"))&&E.setContentType(ge),ie.body){const[ve,pe]=Li(M,Hr(Ii(N)));v=Fi(ie.body,$i,ve,pe)}}S.isString(T)||(T=T?"include":"omit");const I=i&&"credentials"in r.prototype,B={...A,signal:R,method:h.toUpperCase(),headers:E.normalize().toJSON(),body:v,duplex:"half",credentials:I?T:void 0};L=i&&new r(f,B);let z=await(i?O(L,A):O(f,B));const q=u&&(k==="stream"||k==="response");if(u&&(C||q&&P)){const ie={};["status","statusText","headers"].forEach(G=>{ie[G]=z[G]});const ge=S.toFiniteNumber(z.headers.get("content-length")),[ve,pe]=C&&Li(ge,Hr(Ii(C),!0))||[];z=new n(Fi(z.body,$i,ve,()=>{pe&&pe(),P&&P()}),ie)}k=k||"text";let ae=await p[S.findKey(p,k)||"text"](z,b);return!q&&P&&P(),await new Promise((ie,ge)=>{Ri(ie,ge,{data:ae,headers:fe.from(z.headers),status:z.status,statusText:z.statusText,config:b,request:L})})}catch(I){throw P&&P(),I&&I.name==="TypeError"&&/Load failed|fetch/i.test(I.message)?Object.assign(new U("Network Error",U.ERR_NETWORK,b,L),{cause:I.cause||I}):U.from(I,I&&I.code,b,L)}}},xf=new Map,Vi=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s=i.length,l=s,d,c,u=xf;for(;l--;)d=i[l],c=u.get(d),c===void 0&&u.set(d,c=l?new Map:gf(t)),u=c;return c};Vi();const io={http:Dm,xhr:df,fetch:{get:Vi}};S.forEach(io,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Wi=e=>`- ${e}`,bf=e=>S.isFunction(e)||e===null||e===!1;function vf(e,t){e=S.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){n=e[s];let l;if(o=n,!bf(n)&&(o=io[(l=String(n)).toLowerCase()],o===void 0))throw new U(`Unknown adapter '${l}'`);if(o&&(S.isFunction(o)||(o=o.get(t))))break;i[l||"#"+s]=o}if(!o){const s=Object.entries(i).map(([d,c])=>`adapter ${d} `+(c===!1?"is not supported by the environment":"is not available in the build"));let l=r?s.length>1?`since :
     213`,Tr=16,Hu=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:i,containerStyle:s,containerClassName:l})=>{let{toasts:c,handlers:d}=xu(r,i);return x.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:Tr,left:Tr,right:Tr,bottom:Tr,pointerEvents:"none",...s},className:l,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(u=>{let p=u.position||t,m=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),g=Bu(p,m);return x.createElement($u,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?Uu:"",style:g},u.type==="custom"?kr(u.message,u):o?o(u):x.createElement(Fu,{toast:u,position:p}))}))},K=ne;const Ja={carousel:"carousel",grid:"grid"},Vu=["marquee","stacked"],tt={topBottomSpacing:0,gap:16,gapOnTab:16,gapOnMobile:16,shape:"rectangle",size:200,sizeOnTab:150,sizeOnMobile:150,hoverEffect:"none",border:{border_width:2,border_color:"#9ca3af",border_radius:6},shadow:{shadow_size:16},template:Ja.carousel,appearance:"overlay",widgetTitle:{alignment:"hidden",fontSize:24,color:"#000000"},playerAppearance:"overlay"},X={settings:"settings",stat:"statistics",cr:"create-reel",mg:"manage-group",ag:"all-groups",ar:"all-reels"},Wu=[{label:"None",value:"none"},{label:"zoom in",value:"zoom-in"},{label:"zoom out",value:"zoom-out"}],Za=[{label:"Horizontal",value:"horizontal"}],qu=[{label:"Vertical",value:"vertical"}],Gu=[{label:"Overlay",value:"overlay"},{label:"Only Title",value:"title"},{label:"None",value:"none"}],Ku=[{label:"Modern",value:"modern"},{label:"Classic",value:"classic"}],Yu=[{label:"Overlay",value:"overlay"},{label:"Only Tile",value:"title"},{label:"None",value:"none"}];var Qa={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ei=y.createContext&&y.createContext(Qa),Xu=["attr","size","title"];function Ju(e,t){if(e==null)return{};var r=Zu(e,t),n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Zu(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ar(){return Ar=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ar.apply(this,arguments)}function ti(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Pr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ti(Object(r),!0).forEach(function(n){Qu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ti(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Qu(e,t,r){return t=ep(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ep(e){var t=tp(e,"string");return typeof t=="symbol"?t:t+""}function tp(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ri(e){return e&&e.map((t,r)=>y.createElement(t.tag,Pr({key:r},t.attr),ri(t.child)))}function H(e){return t=>y.createElement(rp,Ar({attr:Pr({},e.attr)},t),ri(e.child))}function rp(e){var t=r=>{var{attr:n,size:o,title:i}=e,s=Ju(e,Xu),l=o||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),y.createElement("svg",Ar({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:c,style:Pr(Pr({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&y.createElement("title",null,i),e.children)};return ei!==void 0?y.createElement(ei.Consumer,null,r=>t(r)):t(Qa)}function np(e){return H({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M164.44,105.34l-48-32A8,8,0,0,0,104,80v64a8,8,0,0,0,12.44,6.66l48-32a8,8,0,0,0,0-13.32ZM120,129.05V95l25.58,17ZM216,40H40A16,16,0,0,0,24,56V168a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,128H40V56H216V168Zm16,40a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16H224A8,8,0,0,1,232,208Z"},child:[]}]})(e)}function _t(e){return H({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17 10h-1v-2c0-2.205-1.794-4-4-4s-4 1.795-4 4v2h-1c-1.103 0-2 .896-2 2v7c0 1.104.897 2 2 2h10c1.103 0 2-.896 2-2v-7c0-1.104-.897-2-2-2zm-5 8.299c-.719 0-1.3-.58-1.3-1.299s.581-1.301 1.3-1.301 1.3.582 1.3 1.301-.581 1.299-1.3 1.299zm2-7.299h-4v-3c0-1.104.897-2 2-2s2 .896 2 2v3z"},child:[]}]})(e)}function vt(e){return H({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18 10h-4v-4c0-1.104-.896-2-2-2s-2 .896-2 2l.071 4h-4.071c-1.104 0-2 .896-2 2s.896 2 2 2l4.071-.071-.071 4.071c0 1.104.896 2 2 2s2-.896 2-2v-4.071l4 .071c1.104 0 2-.896 2-2s-.896-2-2-2z"},child:[]}]})(e)}function Qt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m15 18-6-6 6-6"},child:[]}]})(e)}function er(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m9 18 6-6-6-6"},child:[]}]})(e)}function op(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"},child:[]}]})(e)}function ap(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]}]})(e)}function rt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12a9 9 0 1 1-6.219-8.56"},child:[]}]})(e)}function ip(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"},child:[]},{tag:"path",attr:{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7"},child:[]},{tag:"path",attr:{d:"M7 3v4a1 1 0 0 0 1 1h7"},child:[]}]})(e)}function ni(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"path",attr:{d:"m21 21-4.3-4.3"},child:[]}]})(e)}function sp(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},child:[]},{tag:"path",attr:{d:"M12 9v4"},child:[]},{tag:"path",attr:{d:"M12 17h.01"},child:[]}]})(e)}function tr(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18 6 6 18"},child:[]},{tag:"path",attr:{d:"m6 6 12 12"},child:[]}]})(e)}function Vn(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function lp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function cp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},child:[]}]})(e)}function dp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM12 5.5v9l6-4.5z"},child:[]}]})(e)}function up(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M12 6.5a9.77 9.77 0 0 1 8.82 5.5c-1.65 3.37-5.02 5.5-8.82 5.5S4.83 15.37 3.18 12A9.77 9.77 0 0 1 12 6.5m0-2C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zm0 5a2.5 2.5 0 0 1 0 5 2.5 2.5 0 0 1 0-5m0-2c-2.48 0-4.5 2.02-4.5 4.5s2.02 4.5 4.5 4.5 4.5-2.02 4.5-4.5-2.02-4.5-4.5-4.5z"},child:[]}]})(e)}function oi(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Wn(...e){return t=>{let r=!1;const n=e.map(o=>{const i=oi(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():oi(e[o],null)}}}}function J(...e){return x.useCallback(Wn(...e),e)}function nt(e){const t=mp(e),r=x.forwardRef((n,o)=>{const{children:i,...s}=n,l=x.Children.toArray(i),c=l.find(hp);if(c){const d=c.props.children,u=l.map(p=>p===c?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var pp=nt("Slot");function mp(e){const t=x.forwardRef((r,n)=>{const{children:o,...i}=r;if(x.isValidElement(o)){const s=xp(o),l=gp(i,o.props);return o.type!==x.Fragment&&(l.ref=n?Wn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fp=Symbol("radix.slottable");function hp(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fp}function gp(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function xp(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function ai(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=ai(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function bp(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=ai(e))&&(n&&(n+=" "),n+=t);return n}function F(...e){return bp(e)}const _p="ecr-button",vp={default:"ecr-button--primary",destructive:"ecr-button--danger",outline:"ecr-button--outline","outline-danger":"ecr-button--outline-danger",secondary:"ecr-button--secondary",ghost:"ecr-button--ghost",link:"ecr-button--link"},yp={default:"ecr-button--md",sm:"ecr-button--sm",lg:"ecr-button--lg",icon:"ecr-button--icon","icon-sm":"ecr-button--icon-sm","icon-lg":"ecr-button--icon-lg"};function te({className:e,variant:t="default",size:r="default",asChild:n=!1,...o}){const i=n?pp:"button";return a.jsx(i,{"data-slot":"button","data-variant":t,"data-size":r,className:F(_p,vp[t],yp[r],e),...o})}function jp({selectedReelIds:e,handleSelectAll:t,clearSelection:r,searchTerm:n,setSearchTerm:o,isCreating:i,handleCreateGroup:s,handleBulkDelete:l}){return a.jsxs("div",{className:"ecr-admin-reels-header",children:[a.jsxs("div",{className:"ecr-admin-reels-header__left",children:[a.jsx("h2",{className:"ecr-admin-reels-header__title",children:"Reels"}),e.length?a.jsxs("div",{className:"ecr-admin-reels-header__actions",children:[a.jsx(te,{onClick:t,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--primary",children:"Select all"}),a.jsx(te,{onClick:r,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--danger",children:"Clear"}),a.jsxs(te,{variant:"outline-danger",size:"sm",onClick:l,children:[a.jsx(Vn,{size:22,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"}),"Delete Selected"]})]}):null]}),a.jsxs("div",{className:"ecr-admin-reels-header__right",children:[a.jsxs("div",{className:"ecr-admin-reels-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:c=>o(c.target.value),className:"ecr-admin-search-input"}),a.jsxs("div",{className:"ecr-admin-reels-header__icon-wrapper",children:[n&&a.jsx(te,{onClick:()=>o(""),variant:"link",size:"icon-sm",children:a.jsx(tr,{size:16,className:"ecr-admin-reels-header__clear-icon"})}),a.jsx(ni,{size:16,className:"ecr-admin-reels-header__search-icon"})]})," "]}),e.length?a.jsxs(te,{disabled:i,onClick:s,className:"ecr-admin-reels-header__create",children:[i?a.jsx(rt,{className:"ecr-admin-reels-header__spinner"}):a.jsx(vt,{})," ","Create Widget"]}):null]})]})}function Sp(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m112 160-64 64 64 64"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M64 224h294c58.76 0 106 49.33 106 108v20"},child:[]}]})(e)}function Cp(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M262.29 192.31a64 64 0 1 0 57.4 57.4 64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22 155.3 155.3 0 0 1-21.46-12.57 16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22 155.3 155.3 0 0 1 21.46 12.57 16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z"},child:[]}]})(e)}function ot(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M85.57 446.25h340.86a32 32 0 0 0 28.17-47.17L284.18 82.58c-12.09-22.44-44.27-22.44-56.36 0L57.4 399.08a32 32 0 0 0 28.17 47.17z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m250.26 195.39 5.74 122 5.73-121.95a5.74 5.74 0 0 0-5.79-6h0a5.74 5.74 0 0 0-5.68 5.95z"},child:[]},{tag:"path",attr:{d:"M256 397.25a20 20 0 1 1 20-20 20 20 0 0 1-20 20z"},child:[]}]})(e)}function kp(){return a.jsx("div",{className:"ecr-admin-reels-empty",children:a.jsxs("p",{className:"ecr-admin-reels-empty__text",children:[a.jsx(ot,{color:"#FFA500",size:40}),a.jsx("span",{children:"You did not have any reel yet."})]})})}function Np({isFullScreen:e}){return a.jsx("div",{className:F("ecr-admin-reels-loading",e&&"ecr-admin-reels-loading--fullscreen"),children:a.jsx(rt,{className:"ecr-admin-reels-loading__icon"})})}const ii=({playingStory:e,duration:t,currentFileIndex:r,isPaused:n})=>a.jsx("div",{className:"ecr-player__progress",children:e?.files?.map((o,i)=>a.jsx("div",{className:"ecr-player__progress-track",children:a.jsx("div",{style:{"--reels-wp-animation-time":`${t}s`,animationPlayState:n?"paused":"running"},className:F("ecr-player__progress-fill",i===r?.index?"ecr-player__progress-fill--active":i<r?.index?"ecr-player__progress-fill--complete":"ecr-player__progress-fill--empty")})},i))}),yt=({className:e,children:t,...r})=>a.jsx("button",{className:F("ecr-player__nav",e),...r,children:t});function qn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4.5 3H6v10H4.5V3zm7 0v10H10V3h1.5z"},child:[]}]})(e)}function Gn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 5h2.79l3.86-3.83.85.35v13l-.85.33L4.29 11H1.5l-.5-.5v-5l.5-.5zm3.35 5.17L8 13.31V2.73L4.85 5.85 4.5 6H2v4h2.5l.35.17zm9.381-4.108l.707.707L13.207 8.5l1.731 1.732-.707.707L12.5 9.207l-1.732 1.732-.707-.707L11.793 8.5 10.06 6.77l.707-.707 1.733 1.73 1.731-1.731z"},child:[]}]})(e)}function Kn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3.78 2L3 2.41v12l.78.42 9-6V8l-9-6zM4 13.48V3.35l7.6 5.07L4 13.48z"},child:[]}]})(e)}function Yn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 4.83h2.79L8.15 1l.85.35v13l-.85.33-3.86-3.85H1.5l-.5-.5v-5l.5-.5zM4.85 10L8 13.14V2.56L4.85 5.68l-.35.15H2v4h2.5l.35.17zM15 7.83a6.97 6.97 0 0 1-1.578 4.428l-.712-.71A5.975 5.975 0 0 0 14 7.83c0-1.4-.48-2.689-1.284-3.71l.712-.71A6.971 6.971 0 0 1 15 7.83zm-2 0a4.978 4.978 0 0 1-1.002 3.004l-.716-.716A3.982 3.982 0 0 0 12 7.83a3.98 3.98 0 0 0-.713-2.28l.716-.716c.626.835.997 1.872.997 2.996zm-2 0c0 .574-.16 1.11-.44 1.566l-.739-.738a1.993 1.993 0 0 0 .005-1.647l.739-.739c.276.454.435.988.435 1.558z"},child:[]}]})(e)}const Ep="Left",Tp="Right",Ap="Up",Pp="Down",wt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Xn={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},si="mousemove",li="mouseup",Op="touchend",Rp="touchmove",Lp="touchstart";function Ip(e,t,r,n){return e>t?r>0?Tp:Ep:n>0?Pp:Ap}function ci(e,t){if(t===0)return e;const r=Math.PI/180*t,n=e[0]*Math.cos(r)+e[1]*Math.sin(r),o=e[1]*Math.cos(r)-e[0]*Math.sin(r);return[n,o]}function zp(e,t){const r=u=>{const p="touches"in u;p&&u.touches.length>1||e((m,g)=>{g.trackMouse&&!p&&(document.addEventListener(si,n),document.addEventListener(li,s));const{clientX:b,clientY:f}=p?u.touches[0]:u,h=ci([b,f],g.rotationAngle);return g.onTouchStartOrOnMouseDown&&g.onTouchStartOrOnMouseDown({event:u}),Object.assign(Object.assign(Object.assign({},m),Xn),{initial:h.slice(),xy:h,start:u.timeStamp||0})})},n=u=>{e((p,m)=>{const g="touches"in u;if(g&&u.touches.length>1)return p;if(u.timeStamp-p.start>m.swipeDuration)return p.swiping?Object.assign(Object.assign({},p),{swiping:!1}):p;const{clientX:b,clientY:f}=g?u.touches[0]:u,[h,_]=ci([b,f],m.rotationAngle),v=h-p.xy[0],w=_-p.xy[1],j=Math.abs(v),C=Math.abs(w),N=(u.timeStamp||0)-p.start,k=Math.sqrt(j*j+C*C)/(N||1),E=[v/(N||1),w/(N||1)],T=Ip(j,C,v,w),A=typeof m.delta=="number"?m.delta:m.delta[T.toLowerCase()]||wt.delta;if(j<A&&C<A&&!p.swiping)return p;const O={absX:j,absY:C,deltaX:v,deltaY:w,dir:T,event:u,first:p.first,initial:p.initial,velocity:k,vxvy:E};O.first&&m.onSwipeStart&&m.onSwipeStart(O),m.onSwiping&&m.onSwiping(O);let R=!1;return(m.onSwiping||m.onSwiped||m[`onSwiped${T}`])&&(R=!0),R&&m.preventScrollOnSwipe&&m.trackTouch&&u.cancelable&&u.preventDefault(),Object.assign(Object.assign({},p),{first:!1,eventData:O,swiping:!0})})},o=u=>{e((p,m)=>{let g;if(p.swiping&&p.eventData){if(u.timeStamp-p.start<m.swipeDuration){g=Object.assign(Object.assign({},p.eventData),{event:u}),m.onSwiped&&m.onSwiped(g);const b=m[`onSwiped${g.dir}`];b&&b(g)}}else m.onTap&&m.onTap({event:u});return m.onTouchEndOrOnMouseUp&&m.onTouchEndOrOnMouseUp({event:u}),Object.assign(Object.assign(Object.assign({},p),Xn),{eventData:g})})},i=()=>{document.removeEventListener(si,n),document.removeEventListener(li,s)},s=u=>{i(),o(u)},l=(u,p)=>{let m=()=>{};if(u&&u.addEventListener){const g=Object.assign(Object.assign({},wt.touchEventOptions),p.touchEventOptions),b=[[Lp,r,g],[Rp,n,Object.assign(Object.assign({},g),p.preventScrollOnSwipe?{passive:!1}:{})],[Op,o,g]];b.forEach(([f,h,_])=>u.addEventListener(f,h,_)),m=()=>b.forEach(([f,h])=>u.removeEventListener(f,h))}return m},d={ref:u=>{u!==null&&e((p,m)=>{if(p.el===u)return p;const g={};return p.el&&p.el!==u&&p.cleanUpTouch&&(p.cleanUpTouch(),g.cleanUpTouch=void 0),m.trackTouch&&u&&(g.cleanUpTouch=l(u,m)),Object.assign(Object.assign(Object.assign({},p),{el:u}),g)})}};return t.trackMouse&&(d.onMouseDown=r),[d,l]}function Mp(e,t,r,n){return!t.trackTouch||!e.el?(e.cleanUpTouch&&e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:void 0})):e.cleanUpTouch?t.preventScrollOnSwipe!==r.preventScrollOnSwipe||t.touchEventOptions.passive!==r.touchEventOptions.passive?(e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})):e:Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})}function Dp(e){const{trackMouse:t}=e,r=x.useRef(Object.assign({},Xn)),n=x.useRef(Object.assign({},wt)),o=x.useRef(Object.assign({},n.current));o.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},wt),e);let i;for(i in wt)n.current[i]===void 0&&(n.current[i]=wt[i]);const[s,l]=x.useMemo(()=>zp(c=>r.current=c(r.current,n.current),{trackMouse:t}),[t]);return r.current=Mp(r.current,n.current,o.current,l),s}const Fp=({videoRefs:e,file:t,isMuted:r,isPaused:n,i:o,togglePlayPause:i,handleNextFile:s,setDuration:l})=>{const[c,d]=y.useState(!1);return a.jsx("div",{className:"ecr-player__media-frame",children:a.jsx("video",{preload:"none",playsInline:!0,muted:r,autoPlay:!n,controls:!1,loop:!1,disablePictureInPicture:!0,controlsList:"nodownload noplaybackrate noremoteplayback",ref:u=>{u&&(e.current[o]=u,u.setAttribute("webkit-playsinline","true"),u.setAttribute("x-webkit-airplay","allow"),u.setAttribute("airplay","allow"))},className:c?"ecr-player__media ecr-player__media--portrait":"ecr-player__media",src:t?.url,onClick:()=>i(o),onEnded:s,onLoadedMetadata:u=>{const p=u.currentTarget,m=p.videoWidth,g=p.videoHeight;d(g>m),l(p.duration)}})})},di=({currentFileIndex:e,files:t,setDuration:r,setIsPlaying:n,setPreviewReel:o,isPaused:i,setIsPaused:s,handlePrevFile:l,handleNextFile:c})=>{const[d,u]=y.useState(!1),p=y.useRef([]);y.useEffect(()=>{p.current=[]},[t]);const m=h=>{const _=p.current[h];_&&(i?_.play():_.pause(),s(v=>!v))},g=h=>{const _=p.current[h];_&&(_.muted=!d,u(v=>!v))},b=typeof window<"u"&&window.matchMedia("(max-width: 767px)").matches,f=Dp({trackMouse:!0,onSwipedRight:l,onSwipedLeft:c,onSwipedUp:()=>{b&&c()},onSwipedDown:()=>{if(b){l();return}n&&n(null),o&&o(null)}});return a.jsx("div",{style:{left:`${-100*e?.index}%`},className:"ecr-player__slider",...f,children:Array.isArray(t)&&t.map((h,_)=>a.jsx("div",{className:"ecr-player__slide",children:h?.mime_type?.startsWith("image")?null:a.jsxs("div",{className:"ecr-player__media-frame",children:[a.jsx(Fp,{videoRefs:p,file:h,isMuted:d,i:_,togglePlayPause:m,handleNextFile:c,setDuration:r,isPaused:i},h.file_uuid),a.jsxs("div",{className:"ecr-player__controls",children:[i?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(_)}):a.jsx(qn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(_)}),d?a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(_)}):a.jsx(Yn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(_)})]})]})},_))})},$p=({previewReel:e,setPreviewReel:t})=>{const[r,n]=y.useState({index:0,story_uuid:e?.story_uuid}),[o,i]=y.useState(!1),[s,l]=y.useState(3);y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const c=()=>{const m=e?.files??[];r?.index>0?n(g=>({index:g.index-1,story_uuid:m[g.index-1].story_uuid})):t(null)},d=()=>{const m=e?.files??[];r?.index+1<m.length?n(g=>({index:g.index+1,story_uuid:m[g.index+1].story_uuid})):t(null)},u=e.files.length,p=m=>{m.target===m.currentTarget&&t(null)};return a.jsx("div",{onClick:p,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:e&&a.jsxs("div",{className:"ecr-player__stage",children:[u>1?a.jsxs(a.Fragment,{children:[r.index>0?a.jsx(yt,{onClick:c,className:"ecr-player__nav--left",children:a.jsx(Qt,{size:24})}):null,r.index<u-1?a.jsx(yt,{onClick:d,className:"ecr-player__nav--right",children:a.jsx(er,{size:24})}):null]}):null,a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[e&&a.jsx(ii,{playingStory:e,duration:s,currentFileIndex:r,isPaused:o},`${e.story_uuid}-${r.index}`),a.jsx("div",{onClick:()=>t(null),className:"ecr-player__close",children:a.jsx(tr,{className:"ecr-player__close-icon"})}),e?.files.length>0&&a.jsx(di,{currentFileIndex:r,files:e?.files,setDuration:l,setPreviewReel:t,isPaused:o,setIsPaused:i,handlePrevFile:c,handleNextFile:d,storyId:e.id,storyTitle:e?.title})]})]})})};function Bp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z"},child:[]}]})(e)}function Up(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z"},child:[]}]})(e)}function Hp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z"},child:[]}]})(e)}function Or(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.045 7.401c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.378-.378-.88-.586-1.414-.586s-1.036.208-1.413.585L4 13.585V18h4.413L19.045 7.401zm-3-3 1.587 1.585-1.59 1.584-1.586-1.585 1.589-1.584zM6 16v-1.585l7.04-7.018 1.586 1.586L7.587 16H6zm-2 4h16v2H4z"},child:[]}]})(e)}function Vp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 19c.946 0 1.81-.103 2.598-.281l-1.757-1.757c-.273.021-.55.038-.841.038-5.351 0-7.424-3.846-7.926-5a8.642 8.642 0 0 1 1.508-2.297L4.184 8.305c-1.538 1.667-2.121 3.346-2.132 3.379a.994.994 0 0 0 0 .633C2.073 12.383 4.367 19 12 19zm0-14c-1.837 0-3.346.396-4.604.981L3.707 2.293 2.293 3.707l18 18 1.414-1.414-3.319-3.319c2.614-1.951 3.547-4.615 3.561-4.657a.994.994 0 0 0 0-.633C21.927 11.617 19.633 5 12 5zm4.972 10.558-2.28-2.28c.19-.39.308-.819.308-1.278 0-1.641-1.359-3-3-3-.459 0-.888.118-1.277.309L8.915 7.501A9.26 9.26 0 0 1 12 7c5.351 0 7.424 3.846 7.926 5-.302.692-1.166 2.342-2.954 3.558z"},child:[]}]})(e)}function ui(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 12a2 2 0 0 0-.703.133l-2.398-1.963c.059-.214.101-.436.101-.67C17 8.114 15.886 7 14.5 7S12 8.114 12 9.5c0 .396.1.765.262 1.097l-2.909 3.438A2.06 2.06 0 0 0 9 14c-.179 0-.348.03-.512.074l-2.563-2.563C5.97 11.348 6 11.179 6 11c0-1.108-.892-2-2-2s-2 .892-2 2 .892 2 2 2c.179 0 .348-.03.512-.074l2.563 2.563A1.906 1.906 0 0 0 7 16c0 1.108.892 2 2 2s2-.892 2-2c0-.237-.048-.46-.123-.671l2.913-3.442c.227.066.462.113.71.113a2.48 2.48 0 0 0 1.133-.281l2.399 1.963A2.077 2.077 0 0 0 18 14c0 1.108.892 2 2 2s2-.892 2-2-.892-2-2-2z"},child:[]}]})(e)}function Wp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM7 12.414l-3.707-3.707 1.414-1.414 2.293 2.293 4.793-4.793 1.414 1.414-6.207 6.207z"},child:[]}]})(e)}function qp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM14 14h-12v-12h12v12z"},child:[]}]})(e)}function Gp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 10c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2s-0.895 2-2 2z"},child:[]}]})(e)}function Kp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 14c-3.314 0-6-2.686-6-6s2.686-6 6-6c3.314 0 6 2.686 6 6s-2.686 6-6 6z"},child:[]}]})(e)}const Yp=e=>{if(e<1e3)return e;if(e<1e6){const r=e/1e3;return r%1===0?`${r}k`:`${r.toFixed(1)}k`}if(e<1e9){const r=e/1e6;return r%1===0?`${r}m`:`${r.toFixed(1)}m`}const t=e/1e9;return t%1===0?`${t}b`:`${t.toFixed(1)}b`},Xp=({story:e,styles:t,storyViews:r,setStoryViews:n})=>{y.useEffect(()=>{n&&n(s=>({...s,[e.id]:e.view_count}))},[e]);const o=e?.files[0]?.mime_type.startsWith("video"),i=e.thumbnail||void 0;return a.jsxs("div",{className:"ecr-thumb__media",children:[o?a.jsx("video",{className:"ecr-thumb__video",src:e?.files[0]?.url,poster:i}):a.jsx("div",{className:"ecr-thumb__placeholder",children:"No Video"}),(r?.[e.id]??e.view_count)>0&&a.jsxs("div",{style:{left:t?.shape==="circle"?"50%":"100%",transform:`translateX(${t?.shape==="circle"?"-50%":`calc(-120% - ${t.border.border_radius/2}px)`})`,transition:"all 0.3s ease-in-out"},className:"ecr-thumb__views",children:[a.jsx("span",{children:Yp(r?.[e.id]??e.view_count)}),a.jsx(ap,{size:14})]})]})},Jn=y.memo(Xp);function Jp({reel:e,styles:t,isSelected:r,onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:s}){return a.jsxs("div",{className:`ecr-admin-reel-card ${t?.hoverEffect??""}`,children:[a.jsxs("div",{style:{aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},className:F("ecr-admin-reel-card__frame",r?"ecr-admin-reel-card__frame--selected":""),children:[a.jsx(Jn,{story:e,styles:t}),a.jsxs("div",{className:F("ecr-admin-reel-card__actions",s?"":"ecr-admin-reel-card__actions--hover"),children:[e.files[0]?.mime_type.startsWith("image")?null:a.jsx(te,{onClick:()=>i(e),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--primary",size:"icon-sm",title:"Preview Reel",children:a.jsx(up,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--primary"})}),a.jsx(te,{title:"Edit Reel",size:"icon-sm",asChild:!0,className:"ecr-admin-reel-card__action",children:a.jsx(bt,{to:`?view=${X.cr}&from=${X.ar}&sid=${e.id}`,children:a.jsx(Or,{className:"ecr-admin-reel-card__icon"})})}),a.jsx(te,{onClick:()=>o(e.id),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--danger",size:"icon-sm",title:"Remove Reel",children:a.jsx(Vn,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"})})]}),a.jsx("div",{style:{clipPath:"polygon(0% 0, 100% 100%, 100% 0)"},className:F("ecr-admin-reel-card__corner",s?"":"ecr-admin-reel-card__corner--hidden",r?"ecr-admin-reel-card__corner--selected":"ecr-admin-reel-card__corner--idle"),children:a.jsx(te,{onClick:()=>n(e.id),size:"icon-sm",className:"ecr-admin-reel-card__select",children:r?a.jsx(Wp,{size:18,className:"ecr-admin-reel-card__check ecr-admin-reel-card__check--active"}):a.jsx(qp,{size:18,className:"ecr-admin-reel-card__check"})})})]}),e.title&&a.jsx("p",{className:"ecr-admin-reel-card__title",children:e.title})]})}function Zp({reels:e,styles:t,selectedReelIds:r,onSelectReel:n,onDeleteReel:o,onPreviewReel:i,lastStoryElementRef:s}){return a.jsx("div",{className:"ecr-admin-reels-grid",children:e?.map((l,c)=>a.jsx("div",{ref:e.length===c+1?s:null,children:a.jsx(Jp,{reel:l,styles:t,isSelected:r.includes(l.id),onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:r.length>0})},l.id))})}const rr=({cb:e})=>{const t=Ne(),r=()=>{e?e():t(-1)};return a.jsx("button",{title:"Back",onClick:r,className:"ecr-admin-back-button",children:a.jsx(Sp,{size:24})})};function Qp(e){return H({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"},child:[]}]})(e)}const nr=({breads:e=[],onNavigate:t})=>a.jsx("nav",{className:"ecr-admin-breadcrumb","aria-label":"Breadcrumb",children:a.jsx("ul",{className:"ecr-admin-breadcrumb__list",children:e.map((r,n)=>{const o=!r.href;return a.jsxs("li",{className:"ecr-admin-breadcrumb__item",children:[r.href&&!o?a.jsx(bt,{to:r.href,className:"ecr-admin-breadcrumb__link",onClick:i=>{if(!t)return;const s=r.href;s&&(i.preventDefault(),t(s))},children:r.label}):a.jsx("span",{className:"ecr-admin-breadcrumb__current",children:r.label}),n<e.length-1&&a.jsx(Qp,{className:"ecr-admin-breadcrumb__separator"})]},n)})})}),Rr=({onReject:e,onAccept:t,isLoading:r,message:n="Are you sure, You want to delete this story?"})=>{const o=y.useRef(null);return y.useEffect(()=>{o.current&&o.current.focus()},[]),a.jsx("div",{className:"ecr-admin-modal",children:a.jsxs("div",{ref:o,tabIndex:-1,className:"ecr-admin-modal__panel",onBlur:i=>{i.currentTarget.contains(i.relatedTarget)||e(null)},children:[a.jsxs("div",{className:"ecr-admin-modal__content",children:[a.jsx("div",{className:"ecr-admin-modal__icon",children:a.jsx(sp,{size:40,color:"#ffa500"})}),a.jsx("p",{className:"ecr-admin-modal__message",children:n})]}),a.jsxs("div",{className:"ecr-admin-modal__actions",children:[a.jsx("button",{disabled:r,onClick:()=>e(null),className:"ecr-admin-modal__button ecr-admin-modal__button--cancel",children:"No"}),a.jsxs("button",{disabled:r,onClick:t,className:"ecr-admin-modal__button ecr-admin-modal__button--danger",children:[r&&a.jsx(rt,{className:"ecr-admin-modal__spinner"}),"Yes"]})]})]})})},Lr=({to:e,Icon:t,textColor:r="#fff",text:n,className:o,onNavigate:i})=>a.jsxs(bt,{style:{color:r},to:e,className:F("ecr-admin-link-button",o),onClick:s=>{i&&(s.preventDefault(),i(e))},children:[t&&a.jsx(t,{}),n]}),Ir=({className:e})=>a.jsx("div",{className:F("ecr-admin-loader",e),children:a.jsx(rt,{className:"ecr-admin-loader__icon",size:64})}),jt=({left:e=[],center:t=[],right:r=[],leftClass:n="",centerClass:o="",rightClass:i=""})=>a.jsxs("div",{className:"ecr-admin-navbar",children:[a.jsx("div",{className:`ecr-admin-navbar__section ${n}`.trim(),children:e.map((s,l)=>a.jsx(y.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${o}`.trim(),children:t.map((s,l)=>a.jsx(y.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${i}`.trim(),children:r.map((s,l)=>a.jsx(y.Fragment,{children:s},l))})]}),St=({name:e,Icon:t})=>a.jsxs("h1",{className:"ecr-admin-page-name",children:[a.jsx(t,{}),e]});function em(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M55 18v476h18v-37h46v37h274v-37h46v37h18V18h-18v37h-46V18h-18v60H137V18h-18v37H73V18H55zm18 55h46v46H73V73zm320 0h46v46h-46V73zm-256 41h238v156H137V114zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 201h46v46H73v-46zm320 0h46v46h-46v-46zM73 265h46v46H73v-46zm320 0h46v46h-46v-46zm-256 41h238v156H137V306zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 393h46v46H73v-46zm320 0h46v46h-46v-46z"},child:[]}]})(e)}const zr=()=>a.jsxs("div",{className:"ecr-admin-widget-name",children:[a.jsx(em,{}),"ReelsWP"]});function pi(e,t){return function(){return e.apply(t,arguments)}}const{toString:tm}=Object.prototype,{getPrototypeOf:Zn}=Object,{iterator:Mr,toStringTag:mi}=Symbol,Dr=(e=>t=>{const r=tm.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),we=e=>(e=e.toLowerCase(),t=>Dr(t)===e),Fr=e=>t=>typeof t===e,{isArray:Ct}=Array,kt=Fr("undefined");function or(e){return e!==null&&!kt(e)&&e.constructor!==null&&!kt(e.constructor)&&me(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const fi=we("ArrayBuffer");function rm(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&fi(e.buffer),t}const nm=Fr("string"),me=Fr("function"),hi=Fr("number"),ar=e=>e!==null&&typeof e=="object",om=e=>e===!0||e===!1,$r=e=>{if(Dr(e)!=="object")return!1;const t=Zn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(mi in e)&&!(Mr in e)},am=e=>{if(!ar(e)||or(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},im=we("Date"),sm=we("File"),lm=we("Blob"),cm=we("FileList"),dm=e=>ar(e)&&me(e.pipe),um=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||me(e.append)&&((t=Dr(e))==="formdata"||t==="object"&&me(e.toString)&&e.toString()==="[object FormData]"))},pm=we("URLSearchParams"),[mm,fm,hm,gm]=["ReadableStream","Request","Response","Headers"].map(we),xm=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ir(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),Ct(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(or(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let l;for(n=0;n<s;n++)l=i[n],t.call(null,e[l],l,e)}}function gi(e,t){if(or(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const at=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,xi=e=>!kt(e)&&e!==at;function Qn(){const{caseless:e,skipUndefined:t}=xi(this)&&this||{},r={},n=(o,i)=>{const s=e&&gi(r,i)||i;$r(r[s])&&$r(o)?r[s]=Qn(r[s],o):$r(o)?r[s]=Qn({},o):Ct(o)?r[s]=o.slice():(!t||!kt(o))&&(r[s]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&ir(arguments[o],n);return r}const bm=(e,t,r,{allOwnKeys:n}={})=>(ir(t,(o,i)=>{r&&me(o)?e[i]=pi(o,r):e[i]=o},{allOwnKeys:n}),e),_m=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),vm=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},ym=(e,t,r,n)=>{let o,i,s;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!l[s]&&(t[s]=e[s],l[s]=!0);e=r!==!1&&Zn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},wm=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},jm=e=>{if(!e)return null;if(Ct(e))return e;let t=e.length;if(!hi(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Sm=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Zn(Uint8Array)),Cm=(e,t)=>{const n=(e&&e[Mr]).call(e);let o;for(;(o=n.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},km=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Nm=we("HTMLFormElement"),Em=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),bi=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Tm=we("RegExp"),_i=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ir(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},Am=e=>{_i(e,(t,r)=>{if(me(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(me(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Pm=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return Ct(e)?n(e):n(String(e).split(t)),r},Om=()=>{},Rm=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Lm(e){return!!(e&&me(e.append)&&e[mi]==="FormData"&&e[Mr])}const Im=e=>{const t=new Array(10),r=(n,o)=>{if(ar(n)){if(t.indexOf(n)>=0)return;if(or(n))return n;if(!("toJSON"in n)){t[o]=n;const i=Ct(n)?[]:{};return ir(n,(s,l)=>{const c=r(s,o+1);!kt(c)&&(i[l]=c)}),t[o]=void 0,i}}return n};return r(e,0)},zm=we("AsyncFunction"),Mm=e=>e&&(ar(e)||me(e))&&me(e.then)&&me(e.catch),vi=((e,t)=>e?setImmediate:t?((r,n)=>(at.addEventListener("message",({source:o,data:i})=>{o===at&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),at.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",me(at.postMessage)),Dm=typeof queueMicrotask<"u"?queueMicrotask.bind(at):typeof process<"u"&&process.nextTick||vi,S={isArray:Ct,isArrayBuffer:fi,isBuffer:or,isFormData:um,isArrayBufferView:rm,isString:nm,isNumber:hi,isBoolean:om,isObject:ar,isPlainObject:$r,isEmptyObject:am,isReadableStream:mm,isRequest:fm,isResponse:hm,isHeaders:gm,isUndefined:kt,isDate:im,isFile:sm,isBlob:lm,isRegExp:Tm,isFunction:me,isStream:dm,isURLSearchParams:pm,isTypedArray:Sm,isFileList:cm,forEach:ir,merge:Qn,extend:bm,trim:xm,stripBOM:_m,inherits:vm,toFlatObject:ym,kindOf:Dr,kindOfTest:we,endsWith:wm,toArray:jm,forEachEntry:Cm,matchAll:km,isHTMLForm:Nm,hasOwnProperty:bi,hasOwnProp:bi,reduceDescriptors:_i,freezeMethods:Am,toObjectSet:Pm,toCamelCase:Em,noop:Om,toFiniteNumber:Rm,findKey:gi,global:at,isContextDefined:xi,isSpecCompliantForm:Lm,toJSONObject:Im,isAsyncFn:zm,isThenable:Mm,setImmediate:vi,asap:Dm,isIterable:e=>e!=null&&me(e[Mr])};function U(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}S.inherits(U,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:S.toJSONObject(this.config),code:this.code,status:this.status}}});const yi=U.prototype,wi={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{wi[e]={value:e}}),Object.defineProperties(U,wi),Object.defineProperty(yi,"isAxiosError",{value:!0}),U.from=(e,t,r,n,o,i)=>{const s=Object.create(yi);S.toFlatObject(e,s,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const l=e&&e.message?e.message:"Error",c=t==null&&e?e.code:t;return U.call(s,l,c,r,n,o),e&&s.cause==null&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const Fm=null;function eo(e){return S.isPlainObject(e)||S.isArray(e)}function ji(e){return S.endsWith(e,"[]")?e.slice(0,-2):e}function Si(e,t,r){return e?e.concat(t).map(function(o,i){return o=ji(o),!r&&i?"["+o+"]":o}).join(r?".":""):t}function $m(e){return S.isArray(e)&&!e.some(eo)}const Bm=S.toFlatObject(S,{},null,function(t){return/^is[A-Z]/.test(t)});function Br(e,t,r){if(!S.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=S.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,h){return!S.isUndefined(h[f])});const n=r.metaTokens,o=r.visitor||u,i=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&S.isSpecCompliantForm(t);if(!S.isFunction(o))throw new TypeError("visitor must be a function");function d(b){if(b===null)return"";if(S.isDate(b))return b.toISOString();if(S.isBoolean(b))return b.toString();if(!c&&S.isBlob(b))throw new U("Blob is not supported. Use a Buffer instead.");return S.isArrayBuffer(b)||S.isTypedArray(b)?c&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function u(b,f,h){let _=b;if(b&&!h&&typeof b=="object"){if(S.endsWith(f,"{}"))f=n?f:f.slice(0,-2),b=JSON.stringify(b);else if(S.isArray(b)&&$m(b)||(S.isFileList(b)||S.endsWith(f,"[]"))&&(_=S.toArray(b)))return f=ji(f),_.forEach(function(w,j){!(S.isUndefined(w)||w===null)&&t.append(s===!0?Si([f],j,i):s===null?f:f+"[]",d(w))}),!1}return eo(b)?!0:(t.append(Si(h,f,i),d(b)),!1)}const p=[],m=Object.assign(Bm,{defaultVisitor:u,convertValue:d,isVisitable:eo});function g(b,f){if(!S.isUndefined(b)){if(p.indexOf(b)!==-1)throw Error("Circular reference detected in "+f.join("."));p.push(b),S.forEach(b,function(_,v){(!(S.isUndefined(_)||_===null)&&o.call(t,_,S.isString(v)?v.trim():v,f,m))===!0&&g(_,f?f.concat(v):[v])}),p.pop()}}if(!S.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Ci(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function to(e,t){this._pairs=[],e&&Br(e,this,t)}const ki=to.prototype;ki.append=function(t,r){this._pairs.push([t,r])},ki.toString=function(t){const r=t?function(n){return t.call(this,n,Ci)}:Ci;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Um(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ni(e,t,r){if(!t)return e;const n=r&&r.encode||Um;S.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(o?i=o(t,r):i=S.isURLSearchParams(t)?t.toString():new to(t,r).toString(n),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ei{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){S.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Ti={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Hm={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:to,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ro=typeof window<"u"&&typeof document<"u",no=typeof navigator=="object"&&navigator||void 0,Vm=ro&&(!no||["ReactNative","NativeScript","NS"].indexOf(no.product)<0),Wm=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",qm=ro&&window.location.href||"http://localhost",ue={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ro,hasStandardBrowserEnv:Vm,hasStandardBrowserWebWorkerEnv:Wm,navigator:no,origin:qm},Symbol.toStringTag,{value:"Module"})),...Hm};function Gm(e,t){return Br(e,new ue.classes.URLSearchParams,{visitor:function(r,n,o,i){return ue.isNode&&S.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function Km(e){return S.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Ym(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}function Ai(e){function t(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const l=Number.isFinite(+s),c=i>=r.length;return s=!s&&S.isArray(o)?o.length:s,c?(S.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!l):((!o[s]||!S.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&S.isArray(o[s])&&(o[s]=Ym(o[s])),!l)}if(S.isFormData(e)&&S.isFunction(e.entries)){const r={};return S.forEachEntry(e,(n,o)=>{t(Km(n),o,r,0)}),r}return null}function Xm(e,t,r){if(S.isString(e))try{return(t||JSON.parse)(e),S.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const sr={transitional:Ti,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=S.isObject(t);if(i&&S.isHTMLForm(t)&&(t=new FormData(t)),S.isFormData(t))return o?JSON.stringify(Ai(t)):t;if(S.isArrayBuffer(t)||S.isBuffer(t)||S.isStream(t)||S.isFile(t)||S.isBlob(t)||S.isReadableStream(t))return t;if(S.isArrayBufferView(t))return t.buffer;if(S.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Gm(t,this.formSerializer).toString();if((l=S.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Br(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),Xm(t)):t}],transformResponse:[function(t){const r=this.transitional||sr.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(S.isResponse(t)||S.isReadableStream(t))return t;if(t&&S.isString(t)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(l){if(s)throw l.name==="SyntaxError"?U.from(l,U.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ue.classes.FormData,Blob:ue.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};S.forEach(["delete","get","head","post","put","patch"],e=>{sr.headers[e]={}});const Jm=S.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Zm=e=>{const t={};let r,n,o;return e&&e.split(`
     214`).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||t[r]&&Jm[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Pi=Symbol("internals");function lr(e){return e&&String(e).trim().toLowerCase()}function Ur(e){return e===!1||e==null?e:S.isArray(e)?e.map(Ur):String(e)}function Qm(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const ef=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function oo(e,t,r,n,o){if(S.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!S.isString(t)){if(S.isString(n))return t.indexOf(n)!==-1;if(S.isRegExp(n))return n.test(t)}}function tf(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function rf(e,t){const r=S.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,i,s){return this[n].call(this,t,o,i,s)},configurable:!0})})}let fe=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function i(l,c,d){const u=lr(c);if(!u)throw new Error("header name must be a non-empty string");const p=S.findKey(o,u);(!p||o[p]===void 0||d===!0||d===void 0&&o[p]!==!1)&&(o[p||c]=Ur(l))}const s=(l,c)=>S.forEach(l,(d,u)=>i(d,u,c));if(S.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(S.isString(t)&&(t=t.trim())&&!ef(t))s(Zm(t),r);else if(S.isObject(t)&&S.isIterable(t)){let l={},c,d;for(const u of t){if(!S.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[d=u[0]]=(c=l[d])?S.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}s(l,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=lr(t),t){const n=S.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return Qm(o);if(S.isFunction(r))return r.call(this,o,n);if(S.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=lr(t),t){const n=S.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||oo(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function i(s){if(s=lr(s),s){const l=S.findKey(n,s);l&&(!r||oo(n,n[l],l,r))&&(delete n[l],o=!0)}}return S.isArray(t)?t.forEach(i):i(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const i=r[n];(!t||oo(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const r=this,n={};return S.forEach(this,(o,i)=>{const s=S.findKey(n,i);if(s){r[s]=Ur(o),delete r[i];return}const l=t?tf(i):String(i).trim();l!==i&&delete r[i],r[l]=Ur(o),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return S.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&S.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
     215`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Pi]=this[Pi]={accessors:{}}).accessors,o=this.prototype;function i(s){const l=lr(s);n[l]||(rf(o,s),n[l]=!0)}return S.isArray(t)?t.forEach(i):i(t),this}};fe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),S.reduceDescriptors(fe.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),S.freezeMethods(fe);function ao(e,t){const r=this||sr,n=t||r,o=fe.from(n.headers);let i=n.data;return S.forEach(e,function(l){i=l.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Oi(e){return!!(e&&e.__CANCEL__)}function Nt(e,t,r){U.call(this,e??"canceled",U.ERR_CANCELED,t,r),this.name="CanceledError"}S.inherits(Nt,U,{__CANCEL__:!0});function Ri(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new U("Request failed with status code "+r.status,[U.ERR_BAD_REQUEST,U.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function nf(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function of(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=n[i];s||(s=d),r[o]=c,n[o]=d;let p=i,m=0;for(;p!==o;)m+=r[p++],p=p%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),d-s<t)return;const g=u&&d-u;return g?Math.round(m*1e3/g):void 0}}function af(e,t){let r=0,n=1e3/t,o,i;const s=(d,u=Date.now())=>{r=u,o=null,i&&(clearTimeout(i),i=null),e(...d)};return[(...d)=>{const u=Date.now(),p=u-r;p>=n?s(d,u):(o=d,i||(i=setTimeout(()=>{i=null,s(o)},n-p)))},()=>o&&s(o)]}const Hr=(e,t,r=3)=>{let n=0;const o=of(50,250);return af(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,c=s-n,d=o(c),u=s<=l;n=s;const p={loaded:s,total:l,progress:l?s/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-s)/d:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(p)},r)},Li=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ii=e=>(...t)=>S.asap(()=>e(...t)),sf=ue.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ue.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ue.origin),ue.navigator&&/(msie|trident)/i.test(ue.navigator.userAgent)):()=>!0,lf=ue.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];S.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),S.isString(n)&&l.push(`path=${n}`),S.isString(o)&&l.push(`domain=${o}`),i===!0&&l.push("secure"),S.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function cf(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function df(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function zi(e,t,r){let n=!cf(t);return e&&(n||r==!1)?df(e,t):t}const Mi=e=>e instanceof fe?{...e}:e;function it(e,t){t=t||{};const r={};function n(d,u,p,m){return S.isPlainObject(d)&&S.isPlainObject(u)?S.merge.call({caseless:m},d,u):S.isPlainObject(u)?S.merge({},u):S.isArray(u)?u.slice():u}function o(d,u,p,m){if(S.isUndefined(u)){if(!S.isUndefined(d))return n(void 0,d,p,m)}else return n(d,u,p,m)}function i(d,u){if(!S.isUndefined(u))return n(void 0,u)}function s(d,u){if(S.isUndefined(u)){if(!S.isUndefined(d))return n(void 0,d)}else return n(void 0,u)}function l(d,u,p){if(p in t)return n(d,u);if(p in e)return n(void 0,d)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(d,u,p)=>o(Mi(d),Mi(u),p,!0)};return S.forEach(Object.keys({...e,...t}),function(u){const p=c[u]||o,m=p(e[u],t[u],u);S.isUndefined(m)&&p!==l||(r[u]=m)}),r}const Di=e=>{const t=it({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:l}=t;if(t.headers=s=fe.from(s),t.url=Ni(zi(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),S.isFormData(r)){if(ue.hasStandardBrowserEnv||ue.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(S.isFunction(r.getHeaders)){const c=r.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([u,p])=>{d.includes(u.toLowerCase())&&s.set(u,p)})}}if(ue.hasStandardBrowserEnv&&(n&&S.isFunction(n)&&(n=n(t)),n||n!==!1&&sf(t.url))){const c=o&&i&&lf.read(i);c&&s.set(o,c)}return t},uf=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Di(e);let i=o.data;const s=fe.from(o.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=o,u,p,m,g,b;function f(){g&&g(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let h=new XMLHttpRequest;h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout;function _(){if(!h)return;const w=fe.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),C={data:!l||l==="text"||l==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:w,config:e,request:h};Ri(function(k){r(k),f()},function(k){n(k),f()},C),h=null}"onloadend"in h?h.onloadend=_:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(_)},h.onabort=function(){h&&(n(new U("Request aborted",U.ECONNABORTED,e,h)),h=null)},h.onerror=function(j){const C=j&&j.message?j.message:"Network Error",N=new U(C,U.ERR_NETWORK,e,h);N.event=j||null,n(N),h=null},h.ontimeout=function(){let j=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const C=o.transitional||Ti;o.timeoutErrorMessage&&(j=o.timeoutErrorMessage),n(new U(j,C.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,e,h)),h=null},i===void 0&&s.setContentType(null),"setRequestHeader"in h&&S.forEach(s.toJSON(),function(j,C){h.setRequestHeader(C,j)}),S.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),l&&l!=="json"&&(h.responseType=o.responseType),d&&([m,b]=Hr(d,!0),h.addEventListener("progress",m)),c&&h.upload&&([p,g]=Hr(c),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(u=w=>{h&&(n(!w||w.type?new Nt(null,e,h):w),h.abort(),h=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const v=nf(o.url);if(v&&ue.protocols.indexOf(v)===-1){n(new U("Unsupported protocol "+v+":",U.ERR_BAD_REQUEST,e));return}h.send(i||null)})},pf=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const i=function(d){if(!o){o=!0,l();const u=d instanceof Error?d:this.reason;n.abort(u instanceof U?u:new Nt(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,i(new U(`timeout ${t} of ms exceeded`,U.ETIMEDOUT))},t);const l=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),e=null)};e.forEach(d=>d.addEventListener("abort",i));const{signal:c}=n;return c.unsubscribe=()=>S.asap(l),c}},mf=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},ff=async function*(e,t){for await(const r of hf(e))yield*mf(r,t)},hf=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Fi=(e,t,r,n)=>{const o=ff(e,t);let i=0,s,l=c=>{s||(s=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await o.next();if(d){l(),c.close();return}let p=u.byteLength;if(r){let m=i+=p;r(m)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),o.return()}},{highWaterMark:2})},$i=64*1024,{isFunction:Vr}=S,gf=(({Request:e,Response:t})=>({Request:e,Response:t}))(S.global),{ReadableStream:Bi,TextEncoder:Ui}=S.global,Hi=(e,...t)=>{try{return!!e(...t)}catch{return!1}},xf=e=>{e=S.merge.call({skipUndefined:!0},gf,e);const{fetch:t,Request:r,Response:n}=e,o=t?Vr(t):typeof fetch=="function",i=Vr(r),s=Vr(n);if(!o)return!1;const l=o&&Vr(Bi),c=o&&(typeof Ui=="function"?(b=>f=>b.encode(f))(new Ui):async b=>new Uint8Array(await new r(b).arrayBuffer())),d=i&&l&&Hi(()=>{let b=!1;const f=new r(ue.origin,{body:new Bi,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!f}),u=s&&l&&Hi(()=>S.isReadableStream(new n("").body)),p={stream:u&&(b=>b.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!p[b]&&(p[b]=(f,h)=>{let _=f&&f[b];if(_)return _.call(f);throw new U(`Response type '${b}' is not supported`,U.ERR_NOT_SUPPORT,h)})});const m=async b=>{if(b==null)return 0;if(S.isBlob(b))return b.size;if(S.isSpecCompliantForm(b))return(await new r(ue.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(S.isArrayBufferView(b)||S.isArrayBuffer(b))return b.byteLength;if(S.isURLSearchParams(b)&&(b=b+""),S.isString(b))return(await c(b)).byteLength},g=async(b,f)=>{const h=S.toFiniteNumber(b.getContentLength());return h??m(f)};return async b=>{let{url:f,method:h,data:_,signal:v,cancelToken:w,timeout:j,onDownloadProgress:C,onUploadProgress:N,responseType:k,headers:E,withCredentials:T="same-origin",fetchOptions:A}=Di(b),O=t||fetch;k=k?(k+"").toLowerCase():"text";let R=pf([v,w&&w.toAbortSignal()],j),L=null;const P=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let M;try{if(N&&d&&h!=="get"&&h!=="head"&&(M=await g(E,_))!==0){let ie=new r(f,{method:"POST",body:_,duplex:"half"}),ge;if(S.isFormData(_)&&(ge=ie.headers.get("content-type"))&&E.setContentType(ge),ie.body){const[_e,pe]=Li(M,Hr(Ii(N)));_=Fi(ie.body,$i,_e,pe)}}S.isString(T)||(T=T?"include":"omit");const I=i&&"credentials"in r.prototype,B={...A,signal:R,method:h.toUpperCase(),headers:E.normalize().toJSON(),body:_,duplex:"half",credentials:I?T:void 0};L=i&&new r(f,B);let z=await(i?O(L,A):O(f,B));const q=u&&(k==="stream"||k==="response");if(u&&(C||q&&P)){const ie={};["status","statusText","headers"].forEach(G=>{ie[G]=z[G]});const ge=S.toFiniteNumber(z.headers.get("content-length")),[_e,pe]=C&&Li(ge,Hr(Ii(C),!0))||[];z=new n(Fi(z.body,$i,_e,()=>{pe&&pe(),P&&P()}),ie)}k=k||"text";let ae=await p[S.findKey(p,k)||"text"](z,b);return!q&&P&&P(),await new Promise((ie,ge)=>{Ri(ie,ge,{data:ae,headers:fe.from(z.headers),status:z.status,statusText:z.statusText,config:b,request:L})})}catch(I){throw P&&P(),I&&I.name==="TypeError"&&/Load failed|fetch/i.test(I.message)?Object.assign(new U("Network Error",U.ERR_NETWORK,b,L),{cause:I.cause||I}):U.from(I,I&&I.code,b,L)}}},bf=new Map,Vi=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s=i.length,l=s,c,d,u=bf;for(;l--;)c=i[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:xf(t)),u=d;return d};Vi();const io={http:Fm,xhr:uf,fetch:{get:Vi}};S.forEach(io,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Wi=e=>`- ${e}`,_f=e=>S.isFunction(e)||e===null||e===!1;function vf(e,t){e=S.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){n=e[s];let l;if(o=n,!_f(n)&&(o=io[(l=String(n)).toLowerCase()],o===void 0))throw new U(`Unknown adapter '${l}'`);if(o&&(S.isFunction(o)||(o=o.get(t))))break;i[l||"#"+s]=o}if(!o){const s=Object.entries(i).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=r?s.length>1?`since :
    216216`+s.map(Wi).join(`
    217 `):" "+Wi(s[0]):"as no adapter specified";throw new U("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o}const qi={getAdapter:vf,adapters:io};function so(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new jt(null,e)}function Gi(e){return so(e),e.headers=fe.from(e.headers),e.data=ao.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),qi.getAdapter(e.adapter||ir.adapter,e)(e).then(function(n){return so(e),n.data=ao.call(e,e.transformResponse,n),n.headers=fe.from(n.headers),n},function(n){return Oi(n)||(so(e),n&&n.response&&(n.response.data=ao.call(e,e.transformResponse,n.response),n.response.headers=fe.from(n.response.headers))),Promise.reject(n)})}const Ki="1.13.1",Wr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Wr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Yi={};Wr.transitional=function(t,r,n){function o(i,s){return"[Axios v"+Ki+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,l)=>{if(t===!1)throw new U(o(s," has been removed"+(r?" in "+r:"")),U.ERR_DEPRECATED);return r&&!Yi[s]&&(Yi[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,l):!0}},Wr.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function _f(e,t,r){if(typeof e!="object")throw new U("options must be an object",U.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],s=t[i];if(s){const l=e[i],d=l===void 0||s(l,i,e);if(d!==!0)throw new U("option "+i+" must be "+d,U.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new U("Unknown option "+i,U.ERR_BAD_OPTION)}}const qr={assertOptions:_f,validators:Wr},Te=qr.validators;let st=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ei,response:new Ei}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
    218 `+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=it(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&qr.assertOptions(n,{silentJSONParsing:Te.transitional(Te.boolean),forcedJSONParsing:Te.transitional(Te.boolean),clarifyTimeoutError:Te.transitional(Te.boolean)},!1),o!=null&&(S.isFunction(o)?r.paramsSerializer={serialize:o}:qr.assertOptions(o,{encode:Te.function,serialize:Te.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),qr.assertOptions(r,{baseUrl:Te.spelling("baseURL"),withXsrfToken:Te.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&S.merge(i.common,i[r.method]);i&&S.forEach(["delete","get","head","post","put","patch","common"],b=>{delete i[b]}),r.headers=fe.concat(s,i);const l=[];let d=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(d=d&&f.synchronous,l.unshift(f.fulfilled,f.rejected))});const c=[];this.interceptors.response.forEach(function(f){c.push(f.fulfilled,f.rejected)});let u,p=0,m;if(!d){const b=[Gi.bind(this),void 0];for(b.unshift(...l),b.push(...c),m=b.length,u=Promise.resolve(r);p<m;)u=u.then(b[p++],b[p++]);return u}m=l.length;let g=r;for(;p<m;){const b=l[p++],f=l[p++];try{g=b(g)}catch(h){f.call(this,h);break}}try{u=Gi.call(this,g)}catch(b){return Promise.reject(b)}for(p=0,m=c.length;p<m;)u=u.then(c[p++],c[p++]);return u}getUri(t){t=it(this.defaults,t);const r=zi(t.baseURL,t.url,t.allowAbsoluteUrls);return Ni(r,t.params,t.paramsSerializer)}};S.forEach(["delete","get","head","options"],function(t){st.prototype[t]=function(r,n){return this.request(it(n||{},{method:t,url:r,data:(n||{}).data}))}}),S.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,l){return this.request(it(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}st.prototype[t]=r(),st.prototype[t+"Form"]=r(!0)});let yf=class Sd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(l=>{n.subscribe(l),i=l}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,l){n.reason||(n.reason=new jt(i,s,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Sd(function(o){t=o}),cancel:t}}};function wf(e){return function(r){return e.apply(null,r)}}function jf(e){return S.isObject(e)&&e.isAxiosError===!0}const lo={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(lo).forEach(([e,t])=>{lo[t]=e});function Xi(e){const t=new st(e),r=pi(st.prototype.request,t);return S.extend(r,st.prototype,t,{allOwnKeys:!0}),S.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return Xi(it(e,o))},r}const ee=Xi(ir);ee.Axios=st,ee.CanceledError=jt,ee.CancelToken=yf,ee.isCancel=Oi,ee.VERSION=Ki,ee.toFormData=Br,ee.AxiosError=U,ee.Cancel=ee.CanceledError,ee.all=function(t){return Promise.all(t)},ee.spread=wf,ee.isAxiosError=jf,ee.mergeConfig=it,ee.AxiosHeaders=fe,ee.formToJSON=e=>Ai(S.isHTMLForm(e)?new FormData(e):e),ee.getAdapter=qi.getAdapter,ee.HttpStatusCode=lo,ee.default=ee;const{Axios:A_,AxiosError:P_,CanceledError:O_,isCancel:R_,CancelToken:L_,VERSION:I_,all:z_,Cancel:M_,isAxiosError:D_,spread:F_,toFormData:$_,AxiosHeaders:B_,HttpStatusCode:U_,formToJSON:H_,getAdapter:V_,mergeConfig:W_}=ee,Ji=ecommreelsInfo,he=ee.create({baseURL:`${Ji.apiBase}`,headers:{"X-WP-Nonce":Ji.nonce,"Content-Type":"application/json"}}),Sf=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState(!1),o=y.useCallback(async s=>{try{t(!0);const l={styles:tt,story_ids:s},d=await he.post("stories/manage-group-stories",l);return K.success("Group created successfully!"),d.data.group_id}catch(l){return l instanceof Error?K.error(l.message):K.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]),i=y.useCallback(async(s,l,d)=>{try{return n(!0),await he.delete(`story/${s}`),l(c=>c.filter(u=>u.id!==s)),d?.silent||K.success("Reel deleted successfully!"),{ok:!0}}catch(c){const u=c instanceof Error?c.message:"Something went wrong. Try again later!";return d?.silent||K.error(u),{ok:!1,message:u}}finally{n(!1)}},[]);return{styles:tt,isCreating:e,isDeleting:r,createGroup:o,deleteReel:i}};function co(e,t){const[r,n]=y.useState(e);return y.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const Zi=e=>{const[t,r]=y.useState([]),[n,o]=y.useState(1),[i,s]=y.useState(!0),[l,d]=y.useState(!1),[c,u]=y.useState(!1),[p,m]=y.useState(""),g=co(p,500),b=y.useRef(!0),f=y.useCallback(async w=>{w===1&&b.current?u(!0):d(!0);try{const j={page:w,per_page:20};e&&(j.group_id=e),g&&(j.search=g);const C=await he.get("stories",{params:j}),N=C.data,k=parseInt(C.headers["x-wp-totalpages"]);r(E=>w===1?N:[...E,...N]),o(w+1),s(w<k)}catch(j){j instanceof Error?K.error(j.message):K.error("Something went wrong. Try again later!")}finally{b.current&&(b.current=!1),d(!1),u(!1)}},[e,g]),h=y.useCallback(()=>{o(1),r([]),f(1)},[f]);y.useEffect(()=>{h()},[g,h]);const v=y.useRef(null),_=y.useCallback(w=>{l||(v.current&&v.current.disconnect(),v.current=new IntersectionObserver(j=>{j[0].isIntersecting&&i&&f(n)}),w&&v.current.observe(w))},[l,i,n,f]);return y.useEffect(()=>()=>{v.current&&v.current.disconnect()},[]),{allReels:t,setAllReels:r,searchTerm:p,setSearchTerm:m,isSearching:l,isLoading:c,lastStoryElementRef:_,refreshReels:h}};function Cf(){const e=Ne(),{allReels:t,setAllReels:r,isSearching:n,lastStoryElementRef:o,searchTerm:i,setSearchTerm:s,isLoading:l}=Zi(null),{styles:d,isCreating:c,isDeleting:u,createGroup:p,deleteReel:m}=Sf(),[g,b]=y.useState(null),[f,h]=y.useState(null),[v,_]=y.useState(null),[w,j]=y.useState([]),C=async()=>{const A=await p(w);A&&e(`?view=${X.mg}&gid=${A}`)},N=()=>{j(t.map(A=>A.id))},k=A=>{j(O=>O.includes(A)?O.filter(R=>R!==A):[...O,A])},E=()=>{w.length&&h(w)},T=y.useCallback(async()=>{if(g){await m(g,r),b(null);return}if(f?.length){const A=await Promise.all(f.map(P=>m(P,r,{silent:!0}))),O=f.filter((P,M)=>A[M]?.ok),R=O.length,L=f.length-R;R&&(r(P=>P.filter(M=>!O.includes(M.id))),j(P=>P.filter(M=>!O.includes(M)))),R&&K.success(`${R} reels deleted successfully!`),L&&K.error(`${L} reels failed to delete.`),h(null)}},[m,g,f,r]);return l&&!t.length?a.jsx(Ir,{}):a.jsxs(a.Fragment,{children:[(g||f)&&a.jsx(Rr,{onReject:()=>{b(null),h(null)},onAccept:T,isLoading:u,message:f?.length?`Are you sure you want to remove ${f.length} reels?`:"Are you sure you want to remove this reel?"}),a.jsx(vt,{left:[a.jsx(_t,{name:"All Reels",Icon:rp},"page"),a.jsx(tr,{cb:()=>e(`?view=${X.ag}`)},"back")],center:[a.jsx(zr,{},"reel-wp")],right:[a.jsx(Lr,{to:`?view=${X.cr}&from=${X.ar}`,text:"Add Reel",Icon:gt},"add-reel-all-reel")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"All Reels"}]}),a.jsxs("div",{className:"ecr-admin-panel ecr-admin-panel--reels",children:[a.jsx(yp,{selectedReelIds:w,handleSelectAll:N,clearSelection:()=>j([]),searchTerm:i,setSearchTerm:s,isCreating:c,handleCreateGroup:C,handleBulkDelete:E}),t.length?a.jsx(Jp,{reels:t,styles:d,selectedReelIds:w,onSelectReel:k,onDeleteReel:b,onPreviewReel:_,lastStoryElementRef:o}):!n&&!l?a.jsx(Cp,{}):null,n&&a.jsx(kp,{isFullScreen:!t.length})]}),!!v&&a.jsx(Fp,{previewReel:v,setPreviewReel:_})]})}const kf=()=>{const[e,t]=y.useState(!1),r=y.useCallback(async({storyId:n,storyTitle:o,uploadedFiles:i,links:s,thumbnail:l})=>{try{t(!0);const d={story_title:o,files:i,links:s};typeof l=="string"&&l.trim().length>0&&(d.thumbnail=l),n&&(d.story_id=n);const c=await he.post("files",d);return K.success(`Story ${n?"updated":"created"} successfully!`),c.data.story_id}catch(d){return d instanceof Error?K.error(d.message):K.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]);return{isSaving:e,saveStory:r}},uo=({isSaving:e,onSave:t,text:r="Save",className:n,...o})=>a.jsxs(te,{onClick:t,className:F("ecr-admin-save-button",n),...o,children:[e?a.jsx(rt,{className:"ecr-admin-save-button__icon ecr-admin-save-button__icon--spin"}):a.jsx(ap,{className:"ecr-admin-save-button__icon"})," ",r]}),Qi=({setIsEdited:e,title:t,setTitle:r,placeholder:n,style:o})=>a.jsx("div",{children:a.jsx("input",{style:o,className:"ecr-admin-title-input",type:"text",value:t,placeholder:n,onChange:i=>{e&&e(!0),r(i.target.value)}})}),Nf=({uploadedFiles:e,links:t,storyTitle:r,setStoryTitle:n,thumbnail:o})=>{const i=Ne(),[s]=Yt(),l=s.get("sid"),d=s.get("from")||X.ag,c=s.get("gid"),{isSaving:u,saveStory:p}=kf(),m=async()=>{u||!await p({storyId:l,storyTitle:r,uploadedFiles:e,links:t,thumbnail:o})||i(`?view=${d}${c?`&gid=${c}`:""}`,{replace:!0})};return a.jsxs(a.Fragment,{children:[a.jsx(vt,{left:[a.jsx(_t,{name:l?"Update Reel":"Add Reel",Icon:gt},"page"),a.jsx(tr,{},"back")],center:[a.jsx(Qi,{placeholder:"Enter reel title",title:r,setTitle:n},"title")],right:[a.jsx(uo,{onSave:m,isSaving:u,disabled:!e.length},"save")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:"?view=my-reels"},{label:l?"Update Reel":"Add Reel"}]})]})},se=[];for(let e=0;e<256;++e)se.push((e+256).toString(16).slice(1));function Ef(e,t=0){return(se[e[t+0]]+se[e[t+1]]+se[e[t+2]]+se[e[t+3]]+"-"+se[e[t+4]]+se[e[t+5]]+"-"+se[e[t+6]]+se[e[t+7]]+"-"+se[e[t+8]]+se[e[t+9]]+"-"+se[e[t+10]]+se[e[t+11]]+se[e[t+12]]+se[e[t+13]]+se[e[t+14]]+se[e[t+15]]).toLowerCase()}let po;const Tf=new Uint8Array(16);function Af(){if(!po){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");po=crypto.getRandomValues.bind(crypto)}return po(Tf)}const es={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Pf(e,t,r){e=e||{};const n=e.random??e.rng?.()??Af();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Ef(n)}function mo(e,t,r){return es.randomUUID&&!e?es.randomUUID():Pf(e)}const ts="data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23919191'%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20stroke='%23919191'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cg%20data-name='Layer%202'%3e%3cg%20data-name='file-add'%3e%3crect%20width='24'%20height='24'%20opacity='0'/%3e%3cpath%20d='M19.74%207.33l-4.44-5a1%201%200%200%200-.74-.33h-8A2.53%202.53%200%200%200%204%204.5v15A2.53%202.53%200%200%200%206.56%2022h10.88A2.53%202.53%200%200%200%2020%2019.5V8a1%201%200%200%200-.26-.67zM14%2015h-1v1a1%201%200%200%201-2%200v-1h-1a1%201%200%200%201%200-2h1v-1a1%201%200%200%201%202%200v1h1a1%201%200%200%201%200%202zm.71-7a.79.79%200%200%201-.71-.85V4l3.74%204z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",rs=({setUploadedFiles:e,setThumbnail:t,usedFor:r="video",mode:n="files",multiple:o=!1,className:i})=>{const[s,l]=y.useState(!1),d=()=>{const c=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:o,library:{type:[r]}});c.on("select",()=>{const u=c.state().get("selection").toJSON();if(n==="thumbnail"){const m=u[0];m&&t&&t(m.url);return}if(!e)return;const p=u.map(m=>({url:m.url,mime_type:m.mime,file_uuid:mo()}));e(m=>[...m,...p])}),c.open()};return a.jsx("div",{className:F("ecr-admin-upload",s?"ecr-admin-upload--active":"ecr-admin-upload--idle",i),onDragOver:c=>{c.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:c=>{c.preventDefault(),l(!1),d()},children:a.jsxs("label",{className:"ecr-admin-upload__label",htmlFor:"file",onClick:d,children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:ts,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:s?a.jsx("span",{className:"ecr-admin-upload__text-strong",children:"Drop files here..."}):a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsxs("span",{className:"ecr-admin-upload__text-item",children:["Upload ",r]}),n==="files"?a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click or Drag and drop files here"}):null]})})]})})};/**
    219  * @license lucide-react v0.552.0 - ISC
    220  *
    221  * This source code is licensed under the ISC license.
    222  * See the LICENSE file in the root directory of this source tree.
    223  */const Of=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Rf=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),ns=e=>{const t=Rf(e);return t.charAt(0).toUpperCase()+t.slice(1)},os=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),Lf=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
    224  * @license lucide-react v0.552.0 - ISC
    225  *
    226  * This source code is licensed under the ISC license.
    227  * See the LICENSE file in the root directory of this source tree.
    228  */var If={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
    229  * @license lucide-react v0.552.0 - ISC
    230  *
    231  * This source code is licensed under the ISC license.
    232  * See the LICENSE file in the root directory of this source tree.
    233  */const zf=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:s,...l},d)=>y.createElement("svg",{ref:d,...If,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:os("lucide",o),...!i&&!Lf(l)&&{"aria-hidden":"true"},...l},[...s.map(([c,u])=>y.createElement(c,u)),...Array.isArray(i)?i:[i]]));/**
    234  * @license lucide-react v0.552.0 - ISC
    235  *
    236  * This source code is licensed under the ISC license.
    237  * See the LICENSE file in the root directory of this source tree.
    238  */const ue=(e,t)=>{const r=y.forwardRef(({className:n,...o},i)=>y.createElement(zf,{ref:i,iconNode:t,className:os(`lucide-${Of(ns(e))}`,`lucide-${e}`,n),...o}));return r.displayName=ns(e),r};/**
    239  * @license lucide-react v0.552.0 - ISC
    240  *
    241  * This source code is licensed under the ISC license.
    242  * See the LICENSE file in the root directory of this source tree.
    243  */const Mf=ue("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
    244  * @license lucide-react v0.552.0 - ISC
    245  *
    246  * This source code is licensed under the ISC license.
    247  * See the LICENSE file in the root directory of this source tree.
    248  */const fo=ue("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
    249  * @license lucide-react v0.552.0 - ISC
    250  *
    251  * This source code is licensed under the ISC license.
    252  * See the LICENSE file in the root directory of this source tree.
    253  */const Df=ue("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
    254  * @license lucide-react v0.552.0 - ISC
    255  *
    256  * This source code is licensed under the ISC license.
    257  * See the LICENSE file in the root directory of this source tree.
    258  */const Ff=ue("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
    259  * @license lucide-react v0.552.0 - ISC
    260  *
    261  * This source code is licensed under the ISC license.
    262  * See the LICENSE file in the root directory of this source tree.
    263  */const $f=ue("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
    264  * @license lucide-react v0.552.0 - ISC
    265  *
    266  * This source code is licensed under the ISC license.
    267  * See the LICENSE file in the root directory of this source tree.
    268  */const Bf=ue("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
    269  * @license lucide-react v0.552.0 - ISC
    270  *
    271  * This source code is licensed under the ISC license.
    272  * See the LICENSE file in the root directory of this source tree.
    273  */const Uf=ue("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
    274  * @license lucide-react v0.552.0 - ISC
    275  *
    276  * This source code is licensed under the ISC license.
    277  * See the LICENSE file in the root directory of this source tree.
    278  */const Hf=ue("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
    279  * @license lucide-react v0.552.0 - ISC
    280  *
    281  * This source code is licensed under the ISC license.
    282  * See the LICENSE file in the root directory of this source tree.
    283  */const Vf=ue("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
    284  * @license lucide-react v0.552.0 - ISC
    285  *
    286  * This source code is licensed under the ISC license.
    287  * See the LICENSE file in the root directory of this source tree.
    288  */const Wf=ue("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);/**
    289  * @license lucide-react v0.552.0 - ISC
    290  *
    291  * This source code is licensed under the ISC license.
    292  * See the LICENSE file in the root directory of this source tree.
    293  */const qf=ue("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
    294  * @license lucide-react v0.552.0 - ISC
    295  *
    296  * This source code is licensed under the ISC license.
    297  * See the LICENSE file in the root directory of this source tree.
    298  */const Gf=ue("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
    299  * @license lucide-react v0.552.0 - ISC
    300  *
    301  * This source code is licensed under the ISC license.
    302  * See the LICENSE file in the root directory of this source tree.
    303  */const Kf=ue("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
    304  * @license lucide-react v0.552.0 - ISC
    305  *
    306  * This source code is licensed under the ISC license.
    307  * See the LICENSE file in the root directory of this source tree.
    308  */const Yf=ue("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
    309  * @license lucide-react v0.552.0 - ISC
    310  *
    311  * This source code is licensed under the ISC license.
    312  * See the LICENSE file in the root directory of this source tree.
    313  */const Xf=ue("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/**
    314  * @license lucide-react v0.552.0 - ISC
    315  *
    316  * This source code is licensed under the ISC license.
    317  * See the LICENSE file in the root directory of this source tree.
    318  */const Jf=ue("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function V(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function Zf(e,t){const r=x.createContext(t),n=i=>{const{children:s,...l}=i,d=x.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:d,children:s})};n.displayName=e+"Provider";function o(i){const s=x.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,o]}function Ve(e,t=[]){let r=[];function n(i,s){const l=x.createContext(s),d=r.length;r=[...r,s];const c=p=>{const{scope:m,children:g,...b}=p,f=m?.[e]?.[d]||l,h=x.useMemo(()=>b,Object.values(b));return a.jsx(f.Provider,{value:h,children:g})};c.displayName=i+"Provider";function u(p,m){const g=m?.[e]?.[d]||l,b=x.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=r.map(s=>x.createContext(s));return function(l){const d=l?.[e]||i;return x.useMemo(()=>({[`__scope${e}`]:{...l,[e]:d}}),[l,d])}};return o.scopeName=e,[n,Qf(o,...t)]}function Qf(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=n.reduce((l,{useScope:d,scopeName:c})=>{const p=d(i)[`__scope${c}`];return{...l,...p}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var eh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],W=eh.reduce((e,t)=>{const r=nt(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,d=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function th(e,t){e&&vr.flushSync(()=>e.dispatchEvent(t))}function We(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...r)=>t.current?.(...r),[])}function rh(e,t=globalThis?.document){const r=We(e);x.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var nh="DismissableLayer",ho="dismissableLayer.update",oh="dismissableLayer.pointerDownOutside",ah="dismissableLayer.focusOutside",as,is=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gr=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...d}=e,c=x.useContext(is),[u,p]=x.useState(null),m=u?.ownerDocument??globalThis?.document,[,g]=x.useState({}),b=J(t,k=>p(k)),f=Array.from(c.layers),[h]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=f.indexOf(h),_=u?f.indexOf(u):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,j=_>=v,C=lh(k=>{const E=k.target,T=[...c.branches].some(A=>A.contains(E));!j||T||(o?.(k),s?.(k),k.defaultPrevented||l?.())},m),N=ch(k=>{const E=k.target;[...c.branches].some(A=>A.contains(E))||(i?.(k),s?.(k),k.defaultPrevented||l?.())},m);return rh(k=>{_===c.layers.size-1&&(n?.(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},m),x.useEffect(()=>{if(u)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(as=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),ss(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=as)}},[u,m,r,c]),x.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),ss())},[u,c]),x.useEffect(()=>{const k=()=>g({});return document.addEventListener(ho,k),()=>document.removeEventListener(ho,k)},[]),a.jsx(W.div,{...d,ref:b,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:V(e.onFocusCapture,N.onFocusCapture),onBlurCapture:V(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,C.onPointerDownCapture)})});Gr.displayName=nh;var ih="DismissableLayerBranch",sh=x.forwardRef((e,t)=>{const r=x.useContext(is),n=x.useRef(null),o=J(t,n);return x.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),a.jsx(W.div,{...e,ref:o})});sh.displayName=ih;function lh(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let d=function(){ls(oh,r,c,{discrete:!0})};const c={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function ch(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1);return x.useEffect(()=>{const o=i=>{i.target&&!n.current&&ls(ah,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function ss(){const e=new CustomEvent(ho);document.dispatchEvent(e)}function ls(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?th(o,i):o.dispatchEvent(i)}var go=0;function xo(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??cs()),document.body.insertAdjacentElement("beforeend",e[1]??cs()),go++,()=>{go===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),go--}},[])}function cs(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var bo="focusScope.autoFocusOnMount",vo="focusScope.autoFocusOnUnmount",ds={bubbles:!1,cancelable:!0},dh="FocusScope",Kr=x.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[l,d]=x.useState(null),c=We(o),u=We(i),p=x.useRef(null),m=J(t,f=>d(f)),g=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(n){let f=function(w){if(g.paused||!l)return;const j=w.target;l.contains(j)?p.current=j:qe(p.current,{select:!0})},h=function(w){if(g.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||qe(p.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&qe(l)};document.addEventListener("focusin",f),document.addEventListener("focusout",h);const _=new MutationObserver(v);return l&&_.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",h),_.disconnect()}}},[n,l,g.paused]),x.useEffect(()=>{if(l){ms.add(g);const f=document.activeElement;if(!l.contains(f)){const v=new CustomEvent(bo,ds);l.addEventListener(bo,c),l.dispatchEvent(v),v.defaultPrevented||(uh(gh(us(l)),{select:!0}),document.activeElement===f&&qe(l))}return()=>{l.removeEventListener(bo,c),setTimeout(()=>{const v=new CustomEvent(vo,ds);l.addEventListener(vo,u),l.dispatchEvent(v),v.defaultPrevented||qe(f??document.body,{select:!0}),l.removeEventListener(vo,u),ms.remove(g)},0)}}},[l,c,u,g]);const b=x.useCallback(f=>{if(!r&&!n||g.paused)return;const h=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,v=document.activeElement;if(h&&v){const _=f.currentTarget,[w,j]=ph(_);w&&j?!f.shiftKey&&v===j?(f.preventDefault(),r&&qe(w,{select:!0})):f.shiftKey&&v===w&&(f.preventDefault(),r&&qe(j,{select:!0})):v===_&&f.preventDefault()}},[r,n,g.paused]);return a.jsx(W.div,{tabIndex:-1,...s,ref:m,onKeyDown:b})});Kr.displayName=dh;function uh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(qe(n,{select:t}),document.activeElement!==r)return}function ph(e){const t=us(e),r=ps(t,e),n=ps(t.reverse(),e);return[r,n]}function us(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function ps(e,t){for(const r of e)if(!mh(r,{upTo:t}))return r}function mh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function fh(e){return e instanceof HTMLInputElement&&"select"in e}function qe(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&fh(e)&&t&&e.select()}}var ms=hh();function hh(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=fs(e,t),e.unshift(t)},remove(t){e=fs(e,t),e[0]?.resume()}}}function fs(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function gh(e){return e.filter(t=>t.tagName!=="A")}var le=globalThis?.document?x.useLayoutEffect:()=>{},xh=x[" useId ".trim().toString()]||(()=>{}),bh=0;function Ae(e){const[t,r]=x.useState(xh());return le(()=>{r(n=>n??String(bh++))},[e]),e||(t?`radix-${t}`:"")}const vh=["top","right","bottom","left"],Ge=Math.min,xe=Math.max,Yr=Math.round,Xr=Math.floor,Pe=e=>({x:e,y:e}),_h={left:"right",right:"left",bottom:"top",top:"bottom"},yh={start:"end",end:"start"};function _o(e,t,r){return xe(e,Ge(t,r))}function Fe(e,t){return typeof e=="function"?e(t):e}function $e(e){return e.split("-")[0]}function St(e){return e.split("-")[1]}function yo(e){return e==="x"?"y":"x"}function wo(e){return e==="y"?"height":"width"}const wh=new Set(["top","bottom"]);function Oe(e){return wh.has($e(e))?"y":"x"}function jo(e){return yo(Oe(e))}function jh(e,t,r){r===void 0&&(r=!1);const n=St(e),o=jo(e),i=wo(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Jr(s)),[s,Jr(s)]}function Sh(e){const t=Jr(e);return[So(e),t,So(t)]}function So(e){return e.replace(/start|end/g,t=>yh[t])}const hs=["left","right"],gs=["right","left"],Ch=["top","bottom"],kh=["bottom","top"];function Nh(e,t,r){switch(e){case"top":case"bottom":return r?t?gs:hs:t?hs:gs;case"left":case"right":return t?Ch:kh;default:return[]}}function Eh(e,t,r,n){const o=St(e);let i=Nh($e(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(So)))),i}function Jr(e){return e.replace(/left|right|bottom|top/g,t=>_h[t])}function Th(e){return{top:0,right:0,bottom:0,left:0,...e}}function xs(e){return typeof e!="number"?Th(e):{top:e,right:e,bottom:e,left:e}}function Zr(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function bs(e,t,r){let{reference:n,floating:o}=e;const i=Oe(t),s=jo(t),l=wo(s),d=$e(t),c=i==="y",u=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,m=n[l]/2-o[l]/2;let g;switch(d){case"top":g={x:u,y:n.y-o.height};break;case"bottom":g={x:u,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:p};break;case"left":g={x:n.x-o.width,y:p};break;default:g={x:n.x,y:n.y}}switch(St(t)){case"start":g[s]-=m*(r&&c?-1:1);break;case"end":g[s]+=m*(r&&c?-1:1);break}return g}const Ah=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,l=i.filter(Boolean),d=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:p}=bs(c,n,d),m=n,g={},b=0;for(let f=0;f<l.length;f++){const{name:h,fn:v}=l[f],{x:_,y:w,data:j,reset:C}=await v({x:u,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:g,rects:c,platform:s,elements:{reference:e,floating:t}});u=_??u,p=w??p,g={...g,[h]:{...g[h],...j}},C&&b<=50&&(b++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(c=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:p}=bs(c,m,d)),f=-1)}return{x:u,y:p,placement:m,strategy:o,middlewareData:g}};async function lr(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:s,elements:l,strategy:d}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=Fe(t,e),b=xs(g),h=l[m?p==="floating"?"reference":"floating":p],v=Zr(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(h)))==null||r?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:d})),_=p==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),j=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Zr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:_,offsetParent:w,strategy:d}):_);return{top:(v.top-C.top+b.top)/j.y,bottom:(C.bottom-v.bottom+b.bottom)/j.y,left:(v.left-C.left+b.left)/j.x,right:(C.right-v.right+b.right)/j.x}}const Ph=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:l,middlewareData:d}=t,{element:c,padding:u=0}=Fe(e,t)||{};if(c==null)return{};const p=xs(u),m={x:r,y:n},g=jo(o),b=wo(g),f=await s.getDimensions(c),h=g==="y",v=h?"top":"left",_=h?"bottom":"right",w=h?"clientHeight":"clientWidth",j=i.reference[b]+i.reference[g]-m[g]-i.floating[b],C=m[g]-i.reference[g],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let k=N?N[w]:0;(!k||!await(s.isElement==null?void 0:s.isElement(N)))&&(k=l.floating[w]||i.floating[b]);const E=j/2-C/2,T=k/2-f[b]/2-1,A=Ge(p[v],T),O=Ge(p[_],T),R=A,L=k-f[b]-O,P=k/2-f[b]/2+E,M=_o(R,P,L),I=!d.arrow&&St(o)!=null&&P!==M&&i.reference[b]/2-(P<R?A:O)-f[b]/2<0,B=I?P<R?P-R:P-L:0;return{[g]:m[g]+B,data:{[g]:M,centerOffset:P-M-B,...I&&{alignmentOffset:B}},reset:I}}}),Oh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:d,elements:c}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:f=!0,...h}=Fe(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const v=$e(o),_=Oe(l),w=$e(l)===l,j=await(d.isRTL==null?void 0:d.isRTL(c.floating)),C=m||(w||!f?[Jr(l)]:Sh(l)),N=b!=="none";!m&&N&&C.push(...Eh(l,f,b,j));const k=[l,...C],E=await lr(t,h),T=[];let A=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&T.push(E[v]),p){const P=jh(o,s,j);T.push(E[P[0]],E[P[1]])}if(A=[...A,{placement:o,overflows:T}],!T.every(P=>P<=0)){var O,R;const P=(((O=i.flip)==null?void 0:O.index)||0)+1,M=k[P];if(M&&(!(p==="alignment"?_!==Oe(M):!1)||A.every(z=>Oe(z.placement)===_?z.overflows[0]>0:!0)))return{data:{index:P,overflows:A},reset:{placement:M}};let I=(R=A.filter(B=>B.overflows[0]<=0).sort((B,z)=>B.overflows[1]-z.overflows[1])[0])==null?void 0:R.placement;if(!I)switch(g){case"bestFit":{var L;const B=(L=A.filter(z=>{if(N){const q=Oe(z.placement);return q===_||q==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(q=>q>0).reduce((q,ae)=>q+ae,0)]).sort((z,q)=>z[1]-q[1])[0])==null?void 0:L[0];B&&(I=B);break}case"initialPlacement":I=l;break}if(o!==I)return{reset:{placement:I}}}return{}}}};function vs(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _s(e){return vh.some(t=>e[t]>=0)}const Rh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Fe(e,t);switch(n){case"referenceHidden":{const i=await lr(t,{...o,elementContext:"reference"}),s=vs(i,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:_s(s)}}}case"escaped":{const i=await lr(t,{...o,altBoundary:!0}),s=vs(i,r.floating);return{data:{escapedOffsets:s,escaped:_s(s)}}}default:return{}}}}},ys=new Set(["left","top"]);async function Lh(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=$e(r),l=St(r),d=Oe(r)==="y",c=ys.has(s)?-1:1,u=i&&d?-1:1,p=Fe(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof b=="number"&&(g=l==="end"?b*-1:b),d?{x:g*u,y:m*c}:{x:m*c,y:g*u}}const Ih=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:l}=t,d=await Lh(t,e);return s===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+d.x,y:i+d.y,data:{...d,placement:s}}}}},zh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:h=>{let{x:v,y:_}=h;return{x:v,y:_}}},...d}=Fe(e,t),c={x:r,y:n},u=await lr(t,d),p=Oe($e(o)),m=yo(p);let g=c[m],b=c[p];if(i){const h=m==="y"?"top":"left",v=m==="y"?"bottom":"right",_=g+u[h],w=g-u[v];g=_o(_,g,w)}if(s){const h=p==="y"?"top":"left",v=p==="y"?"bottom":"right",_=b+u[h],w=b-u[v];b=_o(_,b,w)}const f=l.fn({...t,[m]:g,[p]:b});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[m]:i,[p]:s}}}}}},Mh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:d=!0,crossAxis:c=!0}=Fe(e,t),u={x:r,y:n},p=Oe(o),m=yo(p);let g=u[m],b=u[p];const f=Fe(l,t),h=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(d){const w=m==="y"?"height":"width",j=i.reference[m]-i.floating[w]+h.mainAxis,C=i.reference[m]+i.reference[w]-h.mainAxis;g<j?g=j:g>C&&(g=C)}if(c){var v,_;const w=m==="y"?"width":"height",j=ys.has($e(o)),C=i.reference[p]-i.floating[w]+(j&&((v=s.offset)==null?void 0:v[p])||0)+(j?0:h.crossAxis),N=i.reference[p]+i.reference[w]+(j?0:((_=s.offset)==null?void 0:_[p])||0)-(j?h.crossAxis:0);b<C?b=C:b>N&&(b=N)}return{[m]:g,[p]:b}}}},Dh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:l}=t,{apply:d=()=>{},...c}=Fe(e,t),u=await lr(t,c),p=$e(o),m=St(o),g=Oe(o)==="y",{width:b,height:f}=i.floating;let h,v;p==="top"||p==="bottom"?(h=p,v=m===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(v=p,h=m==="end"?"top":"bottom");const _=f-u.top-u.bottom,w=b-u.left-u.right,j=Ge(f-u[h],_),C=Ge(b-u[v],w),N=!t.middlewareData.shift;let k=j,E=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(k=_),N&&!m){const A=xe(u.left,0),O=xe(u.right,0),R=xe(u.top,0),L=xe(u.bottom,0);g?E=b-2*(A!==0||O!==0?A+O:xe(u.left,u.right)):k=f-2*(R!==0||L!==0?R+L:xe(u.top,u.bottom))}await d({...t,availableWidth:E,availableHeight:k});const T=await s.getDimensions(l.floating);return b!==T.width||f!==T.height?{reset:{rects:!0}}:{}}}};function Qr(){return typeof window<"u"}function Ct(e){return ws(e)?(e.nodeName||"").toLowerCase():"#document"}function be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Re(e){var t;return(t=(ws(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ws(e){return Qr()?e instanceof Node||e instanceof be(e).Node:!1}function je(e){return Qr()?e instanceof Element||e instanceof be(e).Element:!1}function Le(e){return Qr()?e instanceof HTMLElement||e instanceof be(e).HTMLElement:!1}function js(e){return!Qr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof be(e).ShadowRoot}const Fh=new Set(["inline","contents"]);function cr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Se(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Fh.has(o)}const $h=new Set(["table","td","th"]);function Bh(e){return $h.has(Ct(e))}const Uh=[":popover-open",":modal"];function en(e){return Uh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Hh=["transform","translate","scale","rotate","perspective"],Vh=["transform","translate","scale","rotate","perspective","filter"],Wh=["paint","layout","strict","content"];function Co(e){const t=ko(),r=je(e)?Se(e):e;return Hh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Vh.some(n=>(r.willChange||"").includes(n))||Wh.some(n=>(r.contain||"").includes(n))}function qh(e){let t=Ke(e);for(;Le(t)&&!kt(t);){if(Co(t))return t;if(en(t))return null;t=Ke(t)}return null}function ko(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Gh=new Set(["html","body","#document"]);function kt(e){return Gh.has(Ct(e))}function Se(e){return be(e).getComputedStyle(e)}function tn(e){return je(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ke(e){if(Ct(e)==="html")return e;const t=e.assignedSlot||e.parentNode||js(e)&&e.host||Re(e);return js(t)?t.host:t}function Ss(e){const t=Ke(e);return kt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Le(t)&&cr(t)?t:Ss(t)}function dr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=Ss(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=be(o);if(i){const l=No(s);return t.concat(s,s.visualViewport||[],cr(o)?o:[],l&&r?dr(l):[])}return t.concat(o,dr(o,[],r))}function No(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Cs(e){const t=Se(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Le(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,l=Yr(r)!==i||Yr(n)!==s;return l&&(r=i,n=s),{width:r,height:n,$:l}}function Eo(e){return je(e)?e:e.contextElement}function Nt(e){const t=Eo(e);if(!Le(t))return Pe(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=Cs(t);let s=(i?Yr(r.width):r.width)/n,l=(i?Yr(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Kh=Pe(0);function ks(e){const t=be(e);return!ko()||!t.visualViewport?Kh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Yh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==be(e)?!1:t}function lt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=Eo(e);let s=Pe(1);t&&(n?je(n)&&(s=Nt(n)):s=Nt(e));const l=Yh(i,r,n)?ks(i):Pe(0);let d=(o.left+l.x)/s.x,c=(o.top+l.y)/s.y,u=o.width/s.x,p=o.height/s.y;if(i){const m=be(i),g=n&&je(n)?be(n):n;let b=m,f=No(b);for(;f&&n&&g!==b;){const h=Nt(f),v=f.getBoundingClientRect(),_=Se(f),w=v.left+(f.clientLeft+parseFloat(_.paddingLeft))*h.x,j=v.top+(f.clientTop+parseFloat(_.paddingTop))*h.y;d*=h.x,c*=h.y,u*=h.x,p*=h.y,d+=w,c+=j,b=be(f),f=No(b)}}return Zr({width:u,height:p,x:d,y:c})}function rn(e,t){const r=tn(e).scrollLeft;return t?t.left+r:lt(Re(e)).left+r}function Ns(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-rn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function Xh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=Re(n),l=t?en(t.floating):!1;if(n===s||l&&i)return r;let d={scrollLeft:0,scrollTop:0},c=Pe(1);const u=Pe(0),p=Le(n);if((p||!p&&!i)&&((Ct(n)!=="body"||cr(s))&&(d=tn(n)),Le(n))){const g=lt(n);c=Nt(n),u.x=g.x+n.clientLeft,u.y=g.y+n.clientTop}const m=s&&!p&&!i?Ns(s,d):Pe(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-d.scrollLeft*c.x+u.x+m.x,y:r.y*c.y-d.scrollTop*c.y+u.y+m.y}}function Jh(e){return Array.from(e.getClientRects())}function Zh(e){const t=Re(e),r=tn(e),n=e.ownerDocument.body,o=xe(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=xe(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+rn(e);const l=-r.scrollTop;return Se(n).direction==="rtl"&&(s+=xe(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:l}}const Es=25;function Qh(e,t){const r=be(e),n=Re(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,l=0,d=0;if(o){i=o.width,s=o.height;const u=ko();(!u||u&&t==="fixed")&&(l=o.offsetLeft,d=o.offsetTop)}const c=rn(n);if(c<=0){const u=n.ownerDocument,p=u.body,m=getComputedStyle(p),g=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(n.clientWidth-p.clientWidth-g);b<=Es&&(i-=b)}else c<=Es&&(i+=c);return{width:i,height:s,x:l,y:d}}const eg=new Set(["absolute","fixed"]);function tg(e,t){const r=lt(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=Le(e)?Nt(e):Pe(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,d=o*i.x,c=n*i.y;return{width:s,height:l,x:d,y:c}}function Ts(e,t,r){let n;if(t==="viewport")n=Qh(e,r);else if(t==="document")n=Zh(Re(e));else if(je(t))n=tg(t,r);else{const o=ks(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Zr(n)}function As(e,t){const r=Ke(e);return r===t||!je(r)||kt(r)?!1:Se(r).position==="fixed"||As(r,t)}function rg(e,t){const r=t.get(e);if(r)return r;let n=dr(e,[],!1).filter(l=>je(l)&&Ct(l)!=="body"),o=null;const i=Se(e).position==="fixed";let s=i?Ke(e):e;for(;je(s)&&!kt(s);){const l=Se(s),d=Co(s);!d&&l.position==="fixed"&&(o=null),(i?!d&&!o:!d&&l.position==="static"&&!!o&&eg.has(o.position)||cr(s)&&!d&&As(e,s))?n=n.filter(u=>u!==s):o=l,s=Ke(s)}return t.set(e,n),n}function ng(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?en(t)?[]:rg(t,this._c):[].concat(r),n],l=s[0],d=s.reduce((c,u)=>{const p=Ts(t,u,o);return c.top=xe(p.top,c.top),c.right=Ge(p.right,c.right),c.bottom=Ge(p.bottom,c.bottom),c.left=xe(p.left,c.left),c},Ts(t,l,o));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function og(e){const{width:t,height:r}=Cs(e);return{width:t,height:r}}function ag(e,t,r){const n=Le(t),o=Re(t),i=r==="fixed",s=lt(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const d=Pe(0);function c(){d.x=rn(o)}if(n||!n&&!i)if((Ct(t)!=="body"||cr(o))&&(l=tn(t)),n){const g=lt(t,!0,i,t);d.x=g.x+t.clientLeft,d.y=g.y+t.clientTop}else o&&c();i&&!n&&o&&c();const u=o&&!n&&!i?Ns(o,l):Pe(0),p=s.left+l.scrollLeft-d.x-u.x,m=s.top+l.scrollTop-d.y-u.y;return{x:p,y:m,width:s.width,height:s.height}}function To(e){return Se(e).position==="static"}function Ps(e,t){if(!Le(e)||Se(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Re(e)===r&&(r=r.ownerDocument.body),r}function Os(e,t){const r=be(e);if(en(e))return r;if(!Le(e)){let o=Ke(e);for(;o&&!kt(o);){if(je(o)&&!To(o))return o;o=Ke(o)}return r}let n=Ps(e,t);for(;n&&Bh(n)&&To(n);)n=Ps(n,t);return n&&kt(n)&&To(n)&&!Co(n)?r:n||qh(e)||r}const ig=async function(e){const t=this.getOffsetParent||Os,r=this.getDimensions,n=await r(e.floating);return{reference:ag(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function sg(e){return Se(e).direction==="rtl"}const lg={convertOffsetParentRelativeRectToViewportRelativeRect:Xh,getDocumentElement:Re,getClippingRect:ng,getOffsetParent:Os,getElementRects:ig,getClientRects:Jh,getDimensions:og,getScale:Nt,isElement:je,isRTL:sg};function Rs(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cg(e,t){let r=null,n;const o=Re(e);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function s(l,d){l===void 0&&(l=!1),d===void 0&&(d=1),i();const c=e.getBoundingClientRect(),{left:u,top:p,width:m,height:g}=c;if(l||t(),!m||!g)return;const b=Xr(p),f=Xr(o.clientWidth-(u+m)),h=Xr(o.clientHeight-(p+g)),v=Xr(u),w={rootMargin:-b+"px "+-f+"px "+-h+"px "+-v+"px",threshold:xe(0,Ge(1,d))||1};let j=!0;function C(N){const k=N[0].intersectionRatio;if(k!==d){if(!j)return s();k?s(!1,k):n=setTimeout(()=>{s(!1,1e-7)},1e3)}k===1&&!Rs(c,e.getBoundingClientRect())&&s(),j=!1}try{r=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,w)}r.observe(e)}return s(!0),i}function dg(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:d=!1}=n,c=Eo(e),u=o||i?[...c?dr(c):[],...dr(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",r,{passive:!0}),i&&v.addEventListener("resize",r)});const p=c&&l?cg(c,r):null;let m=-1,g=null;s&&(g=new ResizeObserver(v=>{let[_]=v;_&&_.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),r()}),c&&!d&&g.observe(c),g.observe(t));let b,f=d?lt(e):null;d&&h();function h(){const v=lt(e);f&&!Rs(f,v)&&r(),f=v,b=requestAnimationFrame(h)}return r(),()=>{var v;u.forEach(_=>{o&&_.removeEventListener("scroll",r),i&&_.removeEventListener("resize",r)}),p?.(),(v=g)==null||v.disconnect(),g=null,d&&cancelAnimationFrame(b)}}const ug=Ih,pg=zh,mg=Oh,fg=Dh,hg=Rh,Ls=Ph,gg=Mh,xg=(e,t,r)=>{const n=new Map,o={platform:lg,...r},i={...o.platform,_c:n};return Ah(e,t,{...o,platform:i})};var bg=typeof document<"u",vg=function(){},nn=bg?y.useLayoutEffect:vg;function on(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!on(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!on(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Is(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zs(e,t){const r=Is(e);return Math.round(t*r)/r}function Ao(e){const t=x.useRef(e);return nn(()=>{t.current=e}),t}function _g(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:d,open:c}=e,[u,p]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=x.useState(n);on(m,n)||g(n);const[b,f]=x.useState(null),[h,v]=x.useState(null),_=x.useCallback(z=>{z!==N.current&&(N.current=z,f(z))},[]),w=x.useCallback(z=>{z!==k.current&&(k.current=z,v(z))},[]),j=i||b,C=s||h,N=x.useRef(null),k=x.useRef(null),E=x.useRef(u),T=d!=null,A=Ao(d),O=Ao(o),R=Ao(c),L=x.useCallback(()=>{if(!N.current||!k.current)return;const z={placement:t,strategy:r,middleware:m};O.current&&(z.platform=O.current),xg(N.current,k.current,z).then(q=>{const ae={...q,isPositioned:R.current!==!1};P.current&&!on(E.current,ae)&&(E.current=ae,vr.flushSync(()=>{p(ae)}))})},[m,t,r,O,R]);nn(()=>{c===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(z=>({...z,isPositioned:!1})))},[c]);const P=x.useRef(!1);nn(()=>(P.current=!0,()=>{P.current=!1}),[]),nn(()=>{if(j&&(N.current=j),C&&(k.current=C),j&&C){if(A.current)return A.current(j,C,L);L()}},[j,C,L,A,T]);const M=x.useMemo(()=>({reference:N,floating:k,setReference:_,setFloating:w}),[_,w]),I=x.useMemo(()=>({reference:j,floating:C}),[j,C]),B=x.useMemo(()=>{const z={position:r,left:0,top:0};if(!I.floating)return z;const q=zs(I.floating,u.x),ae=zs(I.floating,u.y);return l?{...z,transform:"translate("+q+"px, "+ae+"px)",...Is(I.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:q,top:ae}},[r,l,I.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:L,refs:M,elements:I,floatingStyles:B}),[u,L,M,I,B])}const yg=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Ls({element:n.current,padding:o}).fn(r):{}:n?Ls({element:n,padding:o}).fn(r):{}}}},wg=(e,t)=>({...ug(e),options:[e,t]}),jg=(e,t)=>({...pg(e),options:[e,t]}),Sg=(e,t)=>({...gg(e),options:[e,t]}),Cg=(e,t)=>({...mg(e),options:[e,t]}),kg=(e,t)=>({...fg(e),options:[e,t]}),Ng=(e,t)=>({...hg(e),options:[e,t]}),Eg=(e,t)=>({...yg(e),options:[e,t]});var Tg="Arrow",Ms=x.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return a.jsx(W.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ms.displayName=Tg;var Ag=Ms;function Pg(e){const[t,r]=x.useState(void 0);return le(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const d=i.borderBoxSize,c=Array.isArray(d)?d[0]:d;s=c.inlineSize,l=c.blockSize}else s=e.offsetWidth,l=e.offsetHeight;r({width:s,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Po="Popper",[Ds,an]=Ve(Po),[Og,Fs]=Ds(Po),$s=e=>{const{__scopePopper:t,children:r}=e,[n,o]=x.useState(null);return a.jsx(Og,{scope:t,anchor:n,onAnchorChange:o,children:r})};$s.displayName=Po;var Bs="PopperAnchor",Us=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Fs(Bs,r),s=x.useRef(null),l=J(t,s),d=x.useRef(null);return x.useEffect(()=>{const c=d.current;d.current=n?.current||s.current,c!==d.current&&i.onAnchorChange(d.current)}),n?null:a.jsx(W.div,{...o,ref:l})});Us.displayName=Bs;var Oo="PopperContent",[Rg,Lg]=Ds(Oo),Hs=x.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:d=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...f}=e,h=Fs(Oo,r),[v,_]=x.useState(null),w=J(t,$=>_($)),[j,C]=x.useState(null),N=Pg(j),k=N?.width??0,E=N?.height??0,T=n+(i!=="center"?"-"+i:""),A=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(c)?c:[c],R=O.length>0,L={padding:A,boundary:O.filter(zg),altBoundary:R},{refs:P,floatingStyles:M,placement:I,isPositioned:B,middlewareData:z}=_g({strategy:"fixed",placement:T,whileElementsMounted:(...$)=>dg(...$,{animationFrame:g==="always"}),elements:{reference:h.anchor},middleware:[wg({mainAxis:o+E,alignmentAxis:s}),d&&jg({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Sg():void 0,...L}),d&&Cg({...L}),kg({...L,apply:({elements:$,rects:Y,availableWidth:oe,availableHeight:Z})=>{const{width:Q,height:re}=Y.reference,_e=$.floating.style;_e.setProperty("--radix-popper-available-width",`${oe}px`),_e.setProperty("--radix-popper-available-height",`${Z}px`),_e.setProperty("--radix-popper-anchor-width",`${Q}px`),_e.setProperty("--radix-popper-anchor-height",`${re}px`)}}),j&&Eg({element:j,padding:l}),Mg({arrowWidth:k,arrowHeight:E}),m&&Ng({strategy:"referenceHidden",...L})]}),[q,ae]=qs(I),ie=We(b);le(()=>{B&&ie?.()},[B,ie]);const ge=z.arrow?.x,ve=z.arrow?.y,pe=z.arrow?.centerOffset!==0,[G,ce]=x.useState();return le(()=>{v&&ce(window.getComputedStyle(v).zIndex)},[v]),a.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:B?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(" "),...z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Rg,{scope:r,placedSide:q,onArrowChange:C,arrowX:ge,arrowY:ve,shouldHideArrow:pe,children:a.jsx(W.div,{"data-side":q,"data-align":ae,...f,ref:w,style:{...f.style,animation:B?void 0:"none"}})})})});Hs.displayName=Oo;var Vs="PopperArrow",Ig={top:"bottom",right:"left",bottom:"top",left:"right"},Ws=x.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Lg(Vs,n),s=Ig[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(Ag,{...o,ref:r,style:{...o.style,display:"block"}})})});Ws.displayName=Vs;function zg(e){return e!==null}var Mg=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,l=s?0:e.arrowWidth,d=s?0:e.arrowHeight,[c,u]=qs(r),p={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+l/2,g=(o.arrow?.y??0)+d/2;let b="",f="";return c==="bottom"?(b=s?p:`${m}px`,f=`${-d}px`):c==="top"?(b=s?p:`${m}px`,f=`${n.floating.height+d}px`):c==="right"?(b=`${-d}px`,f=s?p:`${g}px`):c==="left"&&(b=`${n.floating.width+d}px`,f=s?p:`${g}px`),{data:{x:b,y:f}}}});function qs(e){const[t,r="center"]=e.split("-");return[t,r]}var Gs=$s,Ro=Us,Ks=Hs,Ys=Ws,Dg="Portal",sn=x.forwardRef((e,t)=>{const{container:r,...n}=e,[o,i]=x.useState(!1);le(()=>i(!0),[]);const s=r||o&&globalThis?.document?.body;return s?_a.createPortal(a.jsx(W.div,{...n,ref:t}),s):null});sn.displayName=Dg;function Fg(e,t){return x.useReducer((r,n)=>t[r][n]??r,e)}var Ye=e=>{const{present:t,children:r}=e,n=$g(t),o=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),i=J(n.ref,Bg(o));return typeof r=="function"||n.isPresent?x.cloneElement(o,{ref:i}):null};Ye.displayName="Presence";function $g(e){const[t,r]=x.useState(),n=x.useRef(null),o=x.useRef(e),i=x.useRef("none"),s=e?"mounted":"unmounted",[l,d]=Fg(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const c=ln(n.current);i.current=l==="mounted"?c:"none"},[l]),le(()=>{const c=n.current,u=o.current;if(u!==e){const m=i.current,g=ln(c);e?d("MOUNT"):g==="none"||c?.display==="none"?d("UNMOUNT"):d(u&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),le(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,p=g=>{const f=ln(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&f&&(d("ANIMATION_END"),!o.current)){const h=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h)})}},m=g=>{g.target===t&&(i.current=ln(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function ln(e){return e?.animationName||"none"}function Bg(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Ug=x[" useInsertionEffect ".trim().toString()]||le;function ct({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Hg({defaultProp:t,onChange:r}),l=e!==void 0,d=l?e:o;{const u=x.useRef(e!==void 0);x.useEffect(()=>{const p=u.current;p!==l&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,n])}const c=x.useCallback(u=>{if(l){const p=Vg(u)?u(e):u;p!==e&&s.current?.(p)}else i(u)},[l,e,i,s]);return[d,c]}function Hg({defaultProp:e,onChange:t}){const[r,n]=x.useState(e),o=x.useRef(r),i=x.useRef(t);return Ug(()=>{i.current=t},[t]),x.useEffect(()=>{o.current!==r&&(i.current?.(r),o.current=r)},[r,o]),[r,n,i]}function Vg(e){return typeof e=="function"}var Wg=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Et=new WeakMap,cn=new WeakMap,dn={},Lo=0,Xs=function(e){return e&&(e.host||Xs(e.parentNode))},qg=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Xs(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Gg=function(e,t,r,n){var o=qg(t,Array.isArray(e)?e:[e]);dn[r]||(dn[r]=new WeakMap);var i=dn[r],s=[],l=new Set,d=new Set(o),c=function(p){!p||l.has(p)||(l.add(p),c(p.parentNode))};o.forEach(c);var u=function(p){!p||d.has(p)||Array.prototype.forEach.call(p.children,function(m){if(l.has(m))u(m);else try{var g=m.getAttribute(n),b=g!==null&&g!=="false",f=(Et.get(m)||0)+1,h=(i.get(m)||0)+1;Et.set(m,f),i.set(m,h),s.push(m),f===1&&b&&cn.set(m,!0),h===1&&m.setAttribute(r,"true"),b||m.setAttribute(n,"true")}catch(v){console.error("aria-hidden: cannot operate on ",m,v)}})};return u(t),l.clear(),Lo++,function(){s.forEach(function(p){var m=Et.get(p)-1,g=i.get(p)-1;Et.set(p,m),i.set(p,g),m||(cn.has(p)||p.removeAttribute(n),cn.delete(p)),g||p.removeAttribute(r)}),Lo--,Lo||(Et=new WeakMap,Et=new WeakMap,cn=new WeakMap,dn={})}},Io=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Wg(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Gg(n,o,r,"aria-hidden")):function(){return null}},Ie=function(){return Ie=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Ie.apply(this,arguments)};function Js(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Kg(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var un="right-scroll-bar-position",pn="width-before-scroll-bar",Yg="with-scroll-bars-hidden",Xg="--removed-body-scroll-bar-size";function zo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Jg(e,t){var r=y.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var Zg=typeof window<"u"?x.useLayoutEffect:x.useEffect,Zs=new WeakMap;function Qg(e,t){var r=Jg(null,function(n){return e.forEach(function(o){return zo(o,n)})});return Zg(function(){var n=Zs.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(l){i.has(l)||zo(l,null)}),i.forEach(function(l){o.has(l)||zo(l,s)})}Zs.set(r,e)},[e]),r}function ex(e){return e}function tx(e,t){t===void 0&&(t=ex);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var s=t(i,n);return r.push(s),function(){r=r.filter(function(l){return l!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var l=r;r=[],l.forEach(i),s=r}var d=function(){var u=s;s=[],u.forEach(i)},c=function(){return Promise.resolve().then(d)};c(),r={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),r}}}};return o}function rx(e){e===void 0&&(e={});var t=tx(null);return t.options=Ie({async:!0,ssr:!1},e),t}var Qs=function(e){var t=e.sideCar,r=Js(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return x.createElement(n,Ie({},r))};Qs.isSideCarExport=!0;function nx(e,t){return e.useMedium(t),Qs}var el=rx(),Mo=function(){},mn=x.forwardRef(function(e,t){var r=x.useRef(null),n=x.useState({onScrollCapture:Mo,onWheelCapture:Mo,onTouchMoveCapture:Mo}),o=n[0],i=n[1],s=e.forwardProps,l=e.children,d=e.className,c=e.removeScrollBar,u=e.enabled,p=e.shards,m=e.sideCar,g=e.noRelative,b=e.noIsolation,f=e.inert,h=e.allowPinchZoom,v=e.as,_=v===void 0?"div":v,w=e.gapMode,j=Js(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,N=Qg([r,t]),k=Ie(Ie({},j),o);return x.createElement(x.Fragment,null,u&&x.createElement(C,{sideCar:el,removeScrollBar:c,shards:p,noRelative:g,noIsolation:b,inert:f,setCallbacks:i,allowPinchZoom:!!h,lockRef:r,gapMode:w}),s?x.cloneElement(x.Children.only(l),Ie(Ie({},k),{ref:N})):x.createElement(_,Ie({},k,{className:d,ref:N}),l))});mn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},mn.classNames={fullWidth:pn,zeroRight:un};var ox=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ax(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ox();return t&&e.setAttribute("nonce",t),e}function ix(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function sx(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var lx=function(){var e=0,t=null;return{add:function(r){e==0&&(t=ax())&&(ix(t,r),sx(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},cx=function(){var e=lx();return function(t,r){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},tl=function(){var e=cx(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},dx={left:0,top:0,right:0,gap:0},Do=function(e){return parseInt(e||"",10)||0},ux=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Do(r),Do(n),Do(o)]},px=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return dx;var t=ux(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},mx=tl(),Tt="data-scroll-locked",fx=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,l=e.gap;return r===void 0&&(r="margin"),`
    319   .`.concat(Yg,` {
     217`):" "+Wi(s[0]):"as no adapter specified";throw new U("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o}const qi={getAdapter:vf,adapters:io};function so(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Nt(null,e)}function Gi(e){return so(e),e.headers=fe.from(e.headers),e.data=ao.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),qi.getAdapter(e.adapter||sr.adapter,e)(e).then(function(n){return so(e),n.data=ao.call(e,e.transformResponse,n),n.headers=fe.from(n.headers),n},function(n){return Oi(n)||(so(e),n&&n.response&&(n.response.data=ao.call(e,e.transformResponse,n.response),n.response.headers=fe.from(n.response.headers))),Promise.reject(n)})}const Ki="1.13.1",Wr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Wr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Yi={};Wr.transitional=function(t,r,n){function o(i,s){return"[Axios v"+Ki+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,l)=>{if(t===!1)throw new U(o(s," has been removed"+(r?" in "+r:"")),U.ERR_DEPRECATED);return r&&!Yi[s]&&(Yi[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,l):!0}},Wr.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function yf(e,t,r){if(typeof e!="object")throw new U("options must be an object",U.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],s=t[i];if(s){const l=e[i],c=l===void 0||s(l,i,e);if(c!==!0)throw new U("option "+i+" must be "+c,U.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new U("Unknown option "+i,U.ERR_BAD_OPTION)}}const qr={assertOptions:yf,validators:Wr},Te=qr.validators;let st=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ei,response:new Ei}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
     218`+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=it(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&qr.assertOptions(n,{silentJSONParsing:Te.transitional(Te.boolean),forcedJSONParsing:Te.transitional(Te.boolean),clarifyTimeoutError:Te.transitional(Te.boolean)},!1),o!=null&&(S.isFunction(o)?r.paramsSerializer={serialize:o}:qr.assertOptions(o,{encode:Te.function,serialize:Te.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),qr.assertOptions(r,{baseUrl:Te.spelling("baseURL"),withXsrfToken:Te.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&S.merge(i.common,i[r.method]);i&&S.forEach(["delete","get","head","post","put","patch","common"],b=>{delete i[b]}),r.headers=fe.concat(s,i);const l=[];let c=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(c=c&&f.synchronous,l.unshift(f.fulfilled,f.rejected))});const d=[];this.interceptors.response.forEach(function(f){d.push(f.fulfilled,f.rejected)});let u,p=0,m;if(!c){const b=[Gi.bind(this),void 0];for(b.unshift(...l),b.push(...d),m=b.length,u=Promise.resolve(r);p<m;)u=u.then(b[p++],b[p++]);return u}m=l.length;let g=r;for(;p<m;){const b=l[p++],f=l[p++];try{g=b(g)}catch(h){f.call(this,h);break}}try{u=Gi.call(this,g)}catch(b){return Promise.reject(b)}for(p=0,m=d.length;p<m;)u=u.then(d[p++],d[p++]);return u}getUri(t){t=it(this.defaults,t);const r=zi(t.baseURL,t.url,t.allowAbsoluteUrls);return Ni(r,t.params,t.paramsSerializer)}};S.forEach(["delete","get","head","options"],function(t){st.prototype[t]=function(r,n){return this.request(it(n||{},{method:t,url:r,data:(n||{}).data}))}}),S.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,l){return this.request(it(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}st.prototype[t]=r(),st.prototype[t+"Form"]=r(!0)});let wf=class Sd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(l=>{n.subscribe(l),i=l}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,l){n.reason||(n.reason=new Nt(i,s,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Sd(function(o){t=o}),cancel:t}}};function jf(e){return function(r){return e.apply(null,r)}}function Sf(e){return S.isObject(e)&&e.isAxiosError===!0}const lo={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(lo).forEach(([e,t])=>{lo[t]=e});function Xi(e){const t=new st(e),r=pi(st.prototype.request,t);return S.extend(r,st.prototype,t,{allOwnKeys:!0}),S.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return Xi(it(e,o))},r}const ee=Xi(sr);ee.Axios=st,ee.CanceledError=Nt,ee.CancelToken=wf,ee.isCancel=Oi,ee.VERSION=Ki,ee.toFormData=Br,ee.AxiosError=U,ee.Cancel=ee.CanceledError,ee.all=function(t){return Promise.all(t)},ee.spread=jf,ee.isAxiosError=Sf,ee.mergeConfig=it,ee.AxiosHeaders=fe,ee.formToJSON=e=>Ai(S.isHTMLForm(e)?new FormData(e):e),ee.getAdapter=qi.getAdapter,ee.HttpStatusCode=lo,ee.default=ee;const{Axios:Rv,AxiosError:Lv,CanceledError:Iv,isCancel:zv,CancelToken:Mv,VERSION:Dv,all:Fv,Cancel:$v,isAxiosError:Bv,spread:Uv,toFormData:Hv,AxiosHeaders:Vv,HttpStatusCode:Wv,formToJSON:qv,getAdapter:Gv,mergeConfig:Kv}=ee,Ji=ecommreelsInfo,he=ee.create({baseURL:`${Ji.apiBase}`,headers:{"X-WP-Nonce":Ji.nonce,"Content-Type":"application/json"}}),Cf=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState(!1),o=y.useCallback(async s=>{try{t(!0);const l={styles:tt,story_ids:s},c=await he.post("stories/manage-group-stories",l);return K.success("Group created successfully!"),c.data.group_id}catch(l){return l instanceof Error?K.error(l.message):K.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]),i=y.useCallback(async(s,l,c)=>{try{return n(!0),await he.delete(`story/${s}`),l(d=>d.filter(u=>u.id!==s)),c?.silent||K.success("Reel deleted successfully!"),{ok:!0}}catch(d){const u=d instanceof Error?d.message:"Something went wrong. Try again later!";return c?.silent||K.error(u),{ok:!1,message:u}}finally{n(!1)}},[]);return{styles:tt,isCreating:e,isDeleting:r,createGroup:o,deleteReel:i}};function co(e,t){const[r,n]=y.useState(e);return y.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const Zi=e=>{const[t,r]=y.useState([]),[n,o]=y.useState(1),[i,s]=y.useState(!0),[l,c]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(""),g=co(p,500),b=y.useRef(!0),f=y.useCallback(async w=>{w===1&&b.current?u(!0):c(!0);try{const j={page:w,per_page:20};e&&(j.group_id=e),g&&(j.search=g);const C=await he.get("stories",{params:j}),N=C.data,k=parseInt(C.headers["x-wp-totalpages"]);r(E=>w===1?N:[...E,...N]),o(w+1),s(w<k)}catch(j){j instanceof Error?K.error(j.message):K.error("Something went wrong. Try again later!")}finally{b.current&&(b.current=!1),c(!1),u(!1)}},[e,g]),h=y.useCallback(()=>{o(1),r([]),f(1)},[f]);y.useEffect(()=>{h()},[g,h]);const _=y.useRef(null),v=y.useCallback(w=>{l||(_.current&&_.current.disconnect(),_.current=new IntersectionObserver(j=>{j[0].isIntersecting&&i&&f(n)}),w&&_.current.observe(w))},[l,i,n,f]);return y.useEffect(()=>()=>{_.current&&_.current.disconnect()},[]),{allReels:t,setAllReels:r,searchTerm:p,setSearchTerm:m,isSearching:l,isLoading:d,lastStoryElementRef:v,refreshReels:h}};function kf(){const e=Ne(),{allReels:t,setAllReels:r,isSearching:n,lastStoryElementRef:o,searchTerm:i,setSearchTerm:s,isLoading:l}=Zi(null),{styles:c,isCreating:d,isDeleting:u,createGroup:p,deleteReel:m}=Cf(),[g,b]=y.useState(null),[f,h]=y.useState(null),[_,v]=y.useState(null),[w,j]=y.useState([]),C=async()=>{const A=await p(w);A&&e(`?view=${X.mg}&gid=${A}`)},N=()=>{j(t.map(A=>A.id))},k=A=>{j(O=>O.includes(A)?O.filter(R=>R!==A):[...O,A])},E=()=>{w.length&&h(w)},T=y.useCallback(async()=>{if(g){await m(g,r),b(null);return}if(f?.length){const A=await Promise.all(f.map(P=>m(P,r,{silent:!0}))),O=f.filter((P,M)=>A[M]?.ok),R=O.length,L=f.length-R;R&&(r(P=>P.filter(M=>!O.includes(M.id))),j(P=>P.filter(M=>!O.includes(M)))),R&&K.success(`${R} reels deleted successfully!`),L&&K.error(`${L} reels failed to delete.`),h(null)}},[m,g,f,r]);return l&&!t.length?a.jsx(Ir,{}):a.jsxs(a.Fragment,{children:[(g||f)&&a.jsx(Rr,{onReject:()=>{b(null),h(null)},onAccept:T,isLoading:u,message:f?.length?`Are you sure you want to remove ${f.length} reels?`:"Are you sure you want to remove this reel?"}),a.jsx(jt,{left:[a.jsx(St,{name:"All Reels",Icon:np},"page"),a.jsx(rr,{cb:()=>e(`?view=${X.ag}`)},"back")],center:[a.jsx(zr,{},"reel-wp")],right:[a.jsx(Lr,{to:`?view=${X.cr}&from=${X.ar}`,text:"Add Reel",Icon:vt},"add-reel-all-reel")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"All Reels"}]}),a.jsxs("div",{className:"ecr-admin-panel ecr-admin-panel--reels",children:[a.jsx(jp,{selectedReelIds:w,handleSelectAll:N,clearSelection:()=>j([]),searchTerm:i,setSearchTerm:s,isCreating:d,handleCreateGroup:C,handleBulkDelete:E}),t.length?a.jsx(Zp,{reels:t,styles:c,selectedReelIds:w,onSelectReel:k,onDeleteReel:b,onPreviewReel:v,lastStoryElementRef:o}):!n&&!l?a.jsx(kp,{}):null,n&&a.jsx(Np,{isFullScreen:!t.length})]}),!!_&&a.jsx($p,{previewReel:_,setPreviewReel:v})]})}const Nf=()=>{const[e,t]=y.useState(!1),r=y.useCallback(async({storyId:n,storyTitle:o,uploadedFiles:i,links:s,thumbnail:l})=>{try{t(!0);const c={story_title:o,files:i,links:s};typeof l=="string"&&l.trim().length>0&&(c.thumbnail=l),n&&(c.story_id=n);const d=await he.post("files",c);return K.success(`Story ${n?"updated":"created"} successfully!`),d.data.story_id}catch(c){return c instanceof Error?K.error(c.message):K.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]);return{isSaving:e,saveStory:r}},uo=({isSaving:e,onSave:t,text:r="Save",className:n,...o})=>a.jsxs(te,{onClick:t,className:F("ecr-admin-save-button",n),...o,children:[e?a.jsx(rt,{className:"ecr-admin-save-button__icon ecr-admin-save-button__icon--spin"}):a.jsx(ip,{className:"ecr-admin-save-button__icon"})," ",r]}),Qi=({setIsEdited:e,title:t,setTitle:r,placeholder:n,style:o})=>a.jsx("div",{children:a.jsx("input",{style:o,className:"ecr-admin-title-input",type:"text",value:t,placeholder:n,onChange:i=>{e&&e(!0),r(i.target.value)}})}),Ef=({uploadedFiles:e,links:t,storyTitle:r,setStoryTitle:n,thumbnail:o})=>{const i=Ne(),[s]=Jt(),l=s.get("sid"),c=s.get("from")||X.ag,d=s.get("gid"),{isSaving:u,saveStory:p}=Nf(),m=async()=>{u||!await p({storyId:l,storyTitle:r,uploadedFiles:e,links:t,thumbnail:o})||i(`?view=${c}${d?`&gid=${d}`:""}`,{replace:!0})};return a.jsxs(a.Fragment,{children:[a.jsx(jt,{left:[a.jsx(St,{name:l?"Update Reel":"Add Reel",Icon:vt},"page"),a.jsx(rr,{},"back")],center:[a.jsx(Qi,{placeholder:"Enter reel title",title:r,setTitle:n},"title")],right:[a.jsx(uo,{onSave:m,isSaving:u,disabled:!e.length},"save")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:"?view=my-reels"},{label:l?"Update Reel":"Add Reel"}]})]})},se=[];for(let e=0;e<256;++e)se.push((e+256).toString(16).slice(1));function Tf(e,t=0){return(se[e[t+0]]+se[e[t+1]]+se[e[t+2]]+se[e[t+3]]+"-"+se[e[t+4]]+se[e[t+5]]+"-"+se[e[t+6]]+se[e[t+7]]+"-"+se[e[t+8]]+se[e[t+9]]+"-"+se[e[t+10]]+se[e[t+11]]+se[e[t+12]]+se[e[t+13]]+se[e[t+14]]+se[e[t+15]]).toLowerCase()}let po;const Af=new Uint8Array(16);function Pf(){if(!po){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");po=crypto.getRandomValues.bind(crypto)}return po(Af)}const es={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Of(e,t,r){e=e||{};const n=e.random??e.rng?.()??Pf();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Tf(n)}function mo(e,t,r){return es.randomUUID&&!e?es.randomUUID():Of(e)}const ts="data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23919191'%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20stroke='%23919191'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cg%20data-name='Layer%202'%3e%3cg%20data-name='file-add'%3e%3crect%20width='24'%20height='24'%20opacity='0'/%3e%3cpath%20d='M19.74%207.33l-4.44-5a1%201%200%200%200-.74-.33h-8A2.53%202.53%200%200%200%204%204.5v15A2.53%202.53%200%200%200%206.56%2022h10.88A2.53%202.53%200%200%200%2020%2019.5V8a1%201%200%200%200-.26-.67zM14%2015h-1v1a1%201%200%200%201-2%200v-1h-1a1%201%200%200%201%200-2h1v-1a1%201%200%200%201%202%200v1h1a1%201%200%200%201%200%202zm.71-7a.79.79%200%200%201-.71-.85V4l3.74%204z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",rs=({setUploadedFiles:e,setThumbnail:t,usedFor:r="video",mode:n="files",multiple:o=!1,className:i})=>{const[s,l]=y.useState(!1),c=()=>{const d=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:o,library:{type:[r]}});d.on("select",()=>{const u=d.state().get("selection").toJSON();if(n==="thumbnail"){const m=u[0];m&&t&&t(m.url);return}if(!e)return;const p=u.map(m=>({url:m.url,mime_type:m.mime,file_uuid:mo()}));e(m=>[...m,...p])}),d.open()};return a.jsx("div",{className:F("ecr-admin-upload",s?"ecr-admin-upload--active":"ecr-admin-upload--idle",i),onDragOver:d=>{d.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:d=>{d.preventDefault(),l(!1),c()},children:a.jsxs("label",{className:"ecr-admin-upload__label",htmlFor:"file",onClick:c,children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:ts,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:s?a.jsx("span",{className:"ecr-admin-upload__text-strong",children:"Drop files here..."}):a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsxs("span",{className:"ecr-admin-upload__text-item",children:["Upload ",r]}),n==="files"?a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click or Drag and drop files here"}):null]})})]})})};/**
     219 * @license lucide-react v0.552.0 - ISC
     220 *
     221 * This source code is licensed under the ISC license.
     222 * See the LICENSE file in the root directory of this source tree.
     223 */const Rf=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Lf=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),ns=e=>{const t=Lf(e);return t.charAt(0).toUpperCase()+t.slice(1)},os=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),If=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
     224 * @license lucide-react v0.552.0 - ISC
     225 *
     226 * This source code is licensed under the ISC license.
     227 * See the LICENSE file in the root directory of this source tree.
     228 */var zf={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
     229 * @license lucide-react v0.552.0 - ISC
     230 *
     231 * This source code is licensed under the ISC license.
     232 * See the LICENSE file in the root directory of this source tree.
     233 */const Mf=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:s,...l},c)=>y.createElement("svg",{ref:c,...zf,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:os("lucide",o),...!i&&!If(l)&&{"aria-hidden":"true"},...l},[...s.map(([d,u])=>y.createElement(d,u)),...Array.isArray(i)?i:[i]]));/**
     234 * @license lucide-react v0.552.0 - ISC
     235 *
     236 * This source code is licensed under the ISC license.
     237 * See the LICENSE file in the root directory of this source tree.
     238 */const le=(e,t)=>{const r=y.forwardRef(({className:n,...o},i)=>y.createElement(Mf,{ref:i,iconNode:t,className:os(`lucide-${Rf(ns(e))}`,`lucide-${e}`,n),...o}));return r.displayName=ns(e),r};/**
     239 * @license lucide-react v0.552.0 - ISC
     240 *
     241 * This source code is licensed under the ISC license.
     242 * See the LICENSE file in the root directory of this source tree.
     243 */const Df=le("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
     244 * @license lucide-react v0.552.0 - ISC
     245 *
     246 * This source code is licensed under the ISC license.
     247 * See the LICENSE file in the root directory of this source tree.
     248 */const fo=le("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
     249 * @license lucide-react v0.552.0 - ISC
     250 *
     251 * This source code is licensed under the ISC license.
     252 * See the LICENSE file in the root directory of this source tree.
     253 */const Ff=le("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
     254 * @license lucide-react v0.552.0 - ISC
     255 *
     256 * This source code is licensed under the ISC license.
     257 * See the LICENSE file in the root directory of this source tree.
     258 */const $f=le("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
     259 * @license lucide-react v0.552.0 - ISC
     260 *
     261 * This source code is licensed under the ISC license.
     262 * See the LICENSE file in the root directory of this source tree.
     263 */const Bf=le("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
     264 * @license lucide-react v0.552.0 - ISC
     265 *
     266 * This source code is licensed under the ISC license.
     267 * See the LICENSE file in the root directory of this source tree.
     268 */const Uf=le("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
     269 * @license lucide-react v0.552.0 - ISC
     270 *
     271 * This source code is licensed under the ISC license.
     272 * See the LICENSE file in the root directory of this source tree.
     273 */const Hf=le("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
     274 * @license lucide-react v0.552.0 - ISC
     275 *
     276 * This source code is licensed under the ISC license.
     277 * See the LICENSE file in the root directory of this source tree.
     278 */const Vf=le("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
     279 * @license lucide-react v0.552.0 - ISC
     280 *
     281 * This source code is licensed under the ISC license.
     282 * See the LICENSE file in the root directory of this source tree.
     283 */const Wf=le("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
     284 * @license lucide-react v0.552.0 - ISC
     285 *
     286 * This source code is licensed under the ISC license.
     287 * See the LICENSE file in the root directory of this source tree.
     288 */const qf=le("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);/**
     289 * @license lucide-react v0.552.0 - ISC
     290 *
     291 * This source code is licensed under the ISC license.
     292 * See the LICENSE file in the root directory of this source tree.
     293 */const Gf=le("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
     294 * @license lucide-react v0.552.0 - ISC
     295 *
     296 * This source code is licensed under the ISC license.
     297 * See the LICENSE file in the root directory of this source tree.
     298 */const Kf=le("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
     299 * @license lucide-react v0.552.0 - ISC
     300 *
     301 * This source code is licensed under the ISC license.
     302 * See the LICENSE file in the root directory of this source tree.
     303 */const Yf=le("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
     304 * @license lucide-react v0.552.0 - ISC
     305 *
     306 * This source code is licensed under the ISC license.
     307 * See the LICENSE file in the root directory of this source tree.
     308 */const Xf=le("tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);/**
     309 * @license lucide-react v0.552.0 - ISC
     310 *
     311 * This source code is licensed under the ISC license.
     312 * See the LICENSE file in the root directory of this source tree.
     313 */const Jf=le("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
     314 * @license lucide-react v0.552.0 - ISC
     315 *
     316 * This source code is licensed under the ISC license.
     317 * See the LICENSE file in the root directory of this source tree.
     318 */const Zf=le("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/**
     319 * @license lucide-react v0.552.0 - ISC
     320 *
     321 * This source code is licensed under the ISC license.
     322 * See the LICENSE file in the root directory of this source tree.
     323 */const Qf=le("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function V(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function eh(e,t){const r=x.createContext(t),n=i=>{const{children:s,...l}=i,c=x.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:c,children:s})};n.displayName=e+"Provider";function o(i){const s=x.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,o]}function Ve(e,t=[]){let r=[];function n(i,s){const l=x.createContext(s),c=r.length;r=[...r,s];const d=p=>{const{scope:m,children:g,...b}=p,f=m?.[e]?.[c]||l,h=x.useMemo(()=>b,Object.values(b));return a.jsx(f.Provider,{value:h,children:g})};d.displayName=i+"Provider";function u(p,m){const g=m?.[e]?.[c]||l,b=x.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[d,u]}const o=()=>{const i=r.map(s=>x.createContext(s));return function(l){const c=l?.[e]||i;return x.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[n,th(o,...t)]}function th(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=n.reduce((l,{useScope:c,scopeName:d})=>{const p=c(i)[`__scope${d}`];return{...l,...p}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var rh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],W=rh.reduce((e,t)=>{const r=nt(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function nh(e,t){e&&_r.flushSync(()=>e.dispatchEvent(t))}function We(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...r)=>t.current?.(...r),[])}function oh(e,t=globalThis?.document){const r=We(e);x.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var ah="DismissableLayer",ho="dismissableLayer.update",ih="dismissableLayer.pointerDownOutside",sh="dismissableLayer.focusOutside",as,is=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gr=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...c}=e,d=x.useContext(is),[u,p]=x.useState(null),m=u?.ownerDocument??globalThis?.document,[,g]=x.useState({}),b=J(t,k=>p(k)),f=Array.from(d.layers),[h]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),_=f.indexOf(h),v=u?f.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,j=v>=_,C=dh(k=>{const E=k.target,T=[...d.branches].some(A=>A.contains(E));!j||T||(o?.(k),s?.(k),k.defaultPrevented||l?.())},m),N=uh(k=>{const E=k.target;[...d.branches].some(A=>A.contains(E))||(i?.(k),s?.(k),k.defaultPrevented||l?.())},m);return oh(k=>{v===d.layers.size-1&&(n?.(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},m),x.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(as=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),ss(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=as)}},[u,m,r,d]),x.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),ss())},[u,d]),x.useEffect(()=>{const k=()=>g({});return document.addEventListener(ho,k),()=>document.removeEventListener(ho,k)},[]),a.jsx(W.div,{...c,ref:b,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:V(e.onFocusCapture,N.onFocusCapture),onBlurCapture:V(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,C.onPointerDownCapture)})});Gr.displayName=ah;var lh="DismissableLayerBranch",ch=x.forwardRef((e,t)=>{const r=x.useContext(is),n=x.useRef(null),o=J(t,n);return x.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),a.jsx(W.div,{...e,ref:o})});ch.displayName=lh;function dh(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let c=function(){ls(ih,r,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function uh(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1);return x.useEffect(()=>{const o=i=>{i.target&&!n.current&&ls(sh,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function ss(){const e=new CustomEvent(ho);document.dispatchEvent(e)}function ls(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?nh(o,i):o.dispatchEvent(i)}var go=0;function xo(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??cs()),document.body.insertAdjacentElement("beforeend",e[1]??cs()),go++,()=>{go===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),go--}},[])}function cs(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var bo="focusScope.autoFocusOnMount",_o="focusScope.autoFocusOnUnmount",ds={bubbles:!1,cancelable:!0},ph="FocusScope",Kr=x.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[l,c]=x.useState(null),d=We(o),u=We(i),p=x.useRef(null),m=J(t,f=>c(f)),g=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(n){let f=function(w){if(g.paused||!l)return;const j=w.target;l.contains(j)?p.current=j:qe(p.current,{select:!0})},h=function(w){if(g.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||qe(p.current,{select:!0}))},_=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&qe(l)};document.addEventListener("focusin",f),document.addEventListener("focusout",h);const v=new MutationObserver(_);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",h),v.disconnect()}}},[n,l,g.paused]),x.useEffect(()=>{if(l){ms.add(g);const f=document.activeElement;if(!l.contains(f)){const _=new CustomEvent(bo,ds);l.addEventListener(bo,d),l.dispatchEvent(_),_.defaultPrevented||(mh(bh(us(l)),{select:!0}),document.activeElement===f&&qe(l))}return()=>{l.removeEventListener(bo,d),setTimeout(()=>{const _=new CustomEvent(_o,ds);l.addEventListener(_o,u),l.dispatchEvent(_),_.defaultPrevented||qe(f??document.body,{select:!0}),l.removeEventListener(_o,u),ms.remove(g)},0)}}},[l,d,u,g]);const b=x.useCallback(f=>{if(!r&&!n||g.paused)return;const h=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,_=document.activeElement;if(h&&_){const v=f.currentTarget,[w,j]=fh(v);w&&j?!f.shiftKey&&_===j?(f.preventDefault(),r&&qe(w,{select:!0})):f.shiftKey&&_===w&&(f.preventDefault(),r&&qe(j,{select:!0})):_===v&&f.preventDefault()}},[r,n,g.paused]);return a.jsx(W.div,{tabIndex:-1,...s,ref:m,onKeyDown:b})});Kr.displayName=ph;function mh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(qe(n,{select:t}),document.activeElement!==r)return}function fh(e){const t=us(e),r=ps(t,e),n=ps(t.reverse(),e);return[r,n]}function us(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function ps(e,t){for(const r of e)if(!hh(r,{upTo:t}))return r}function hh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function gh(e){return e instanceof HTMLInputElement&&"select"in e}function qe(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&gh(e)&&t&&e.select()}}var ms=xh();function xh(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=fs(e,t),e.unshift(t)},remove(t){e=fs(e,t),e[0]?.resume()}}}function fs(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function bh(e){return e.filter(t=>t.tagName!=="A")}var ce=globalThis?.document?x.useLayoutEffect:()=>{},_h=x[" useId ".trim().toString()]||(()=>{}),vh=0;function Ae(e){const[t,r]=x.useState(_h());return ce(()=>{r(n=>n??String(vh++))},[e]),e||(t?`radix-${t}`:"")}const yh=["top","right","bottom","left"],Ge=Math.min,xe=Math.max,Yr=Math.round,Xr=Math.floor,Pe=e=>({x:e,y:e}),wh={left:"right",right:"left",bottom:"top",top:"bottom"},jh={start:"end",end:"start"};function vo(e,t,r){return xe(e,Ge(t,r))}function Fe(e,t){return typeof e=="function"?e(t):e}function $e(e){return e.split("-")[0]}function Et(e){return e.split("-")[1]}function yo(e){return e==="x"?"y":"x"}function wo(e){return e==="y"?"height":"width"}const Sh=new Set(["top","bottom"]);function Oe(e){return Sh.has($e(e))?"y":"x"}function jo(e){return yo(Oe(e))}function Ch(e,t,r){r===void 0&&(r=!1);const n=Et(e),o=jo(e),i=wo(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Jr(s)),[s,Jr(s)]}function kh(e){const t=Jr(e);return[So(e),t,So(t)]}function So(e){return e.replace(/start|end/g,t=>jh[t])}const hs=["left","right"],gs=["right","left"],Nh=["top","bottom"],Eh=["bottom","top"];function Th(e,t,r){switch(e){case"top":case"bottom":return r?t?gs:hs:t?hs:gs;case"left":case"right":return t?Nh:Eh;default:return[]}}function Ah(e,t,r,n){const o=Et(e);let i=Th($e(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(So)))),i}function Jr(e){return e.replace(/left|right|bottom|top/g,t=>wh[t])}function Ph(e){return{top:0,right:0,bottom:0,left:0,...e}}function xs(e){return typeof e!="number"?Ph(e):{top:e,right:e,bottom:e,left:e}}function Zr(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function bs(e,t,r){let{reference:n,floating:o}=e;const i=Oe(t),s=jo(t),l=wo(s),c=$e(t),d=i==="y",u=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,m=n[l]/2-o[l]/2;let g;switch(c){case"top":g={x:u,y:n.y-o.height};break;case"bottom":g={x:u,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:p};break;case"left":g={x:n.x-o.width,y:p};break;default:g={x:n.x,y:n.y}}switch(Et(t)){case"start":g[s]-=m*(r&&d?-1:1);break;case"end":g[s]+=m*(r&&d?-1:1);break}return g}const Oh=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:p}=bs(d,n,c),m=n,g={},b=0;for(let f=0;f<l.length;f++){const{name:h,fn:_}=l[f],{x:v,y:w,data:j,reset:C}=await _({x:u,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:g,rects:d,platform:s,elements:{reference:e,floating:t}});u=v??u,p=w??p,g={...g,[h]:{...g[h],...j}},C&&b<=50&&(b++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(d=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:p}=bs(d,m,c)),f=-1)}return{x:u,y:p,placement:m,strategy:o,middlewareData:g}};async function cr(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:s,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=Fe(t,e),b=xs(g),h=l[m?p==="floating"?"reference":"floating":p],_=Zr(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(h)))==null||r?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),v=p==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),j=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Zr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:w,strategy:c}):v);return{top:(_.top-C.top+b.top)/j.y,bottom:(C.bottom-_.bottom+b.bottom)/j.y,left:(_.left-C.left+b.left)/j.x,right:(C.right-_.right+b.right)/j.x}}const Rh=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=Fe(e,t)||{};if(d==null)return{};const p=xs(u),m={x:r,y:n},g=jo(o),b=wo(g),f=await s.getDimensions(d),h=g==="y",_=h?"top":"left",v=h?"bottom":"right",w=h?"clientHeight":"clientWidth",j=i.reference[b]+i.reference[g]-m[g]-i.floating[b],C=m[g]-i.reference[g],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let k=N?N[w]:0;(!k||!await(s.isElement==null?void 0:s.isElement(N)))&&(k=l.floating[w]||i.floating[b]);const E=j/2-C/2,T=k/2-f[b]/2-1,A=Ge(p[_],T),O=Ge(p[v],T),R=A,L=k-f[b]-O,P=k/2-f[b]/2+E,M=vo(R,P,L),I=!c.arrow&&Et(o)!=null&&P!==M&&i.reference[b]/2-(P<R?A:O)-f[b]/2<0,B=I?P<R?P-R:P-L:0;return{[g]:m[g]+B,data:{[g]:M,centerOffset:P-M-B,...I&&{alignmentOffset:B}},reset:I}}}),Lh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:f=!0,...h}=Fe(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const _=$e(o),v=Oe(l),w=$e(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(d.floating)),C=m||(w||!f?[Jr(l)]:kh(l)),N=b!=="none";!m&&N&&C.push(...Ah(l,f,b,j));const k=[l,...C],E=await cr(t,h),T=[];let A=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&T.push(E[_]),p){const P=Ch(o,s,j);T.push(E[P[0]],E[P[1]])}if(A=[...A,{placement:o,overflows:T}],!T.every(P=>P<=0)){var O,R;const P=(((O=i.flip)==null?void 0:O.index)||0)+1,M=k[P];if(M&&(!(p==="alignment"?v!==Oe(M):!1)||A.every(z=>Oe(z.placement)===v?z.overflows[0]>0:!0)))return{data:{index:P,overflows:A},reset:{placement:M}};let I=(R=A.filter(B=>B.overflows[0]<=0).sort((B,z)=>B.overflows[1]-z.overflows[1])[0])==null?void 0:R.placement;if(!I)switch(g){case"bestFit":{var L;const B=(L=A.filter(z=>{if(N){const q=Oe(z.placement);return q===v||q==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(q=>q>0).reduce((q,ae)=>q+ae,0)]).sort((z,q)=>z[1]-q[1])[0])==null?void 0:L[0];B&&(I=B);break}case"initialPlacement":I=l;break}if(o!==I)return{reset:{placement:I}}}return{}}}};function _s(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vs(e){return yh.some(t=>e[t]>=0)}const Ih=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Fe(e,t);switch(n){case"referenceHidden":{const i=await cr(t,{...o,elementContext:"reference"}),s=_s(i,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:vs(s)}}}case"escaped":{const i=await cr(t,{...o,altBoundary:!0}),s=_s(i,r.floating);return{data:{escapedOffsets:s,escaped:vs(s)}}}default:return{}}}}},ys=new Set(["left","top"]);async function zh(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=$e(r),l=Et(r),c=Oe(r)==="y",d=ys.has(s)?-1:1,u=i&&c?-1:1,p=Fe(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof b=="number"&&(g=l==="end"?b*-1:b),c?{x:g*u,y:m*d}:{x:m*d,y:g*u}}const Mh=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:l}=t,c=await zh(t,e);return s===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},Dh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:h=>{let{x:_,y:v}=h;return{x:_,y:v}}},...c}=Fe(e,t),d={x:r,y:n},u=await cr(t,c),p=Oe($e(o)),m=yo(p);let g=d[m],b=d[p];if(i){const h=m==="y"?"top":"left",_=m==="y"?"bottom":"right",v=g+u[h],w=g-u[_];g=vo(v,g,w)}if(s){const h=p==="y"?"top":"left",_=p==="y"?"bottom":"right",v=b+u[h],w=b-u[_];b=vo(v,b,w)}const f=l.fn({...t,[m]:g,[p]:b});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[m]:i,[p]:s}}}}}},Fh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=Fe(e,t),u={x:r,y:n},p=Oe(o),m=yo(p);let g=u[m],b=u[p];const f=Fe(l,t),h=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const w=m==="y"?"height":"width",j=i.reference[m]-i.floating[w]+h.mainAxis,C=i.reference[m]+i.reference[w]-h.mainAxis;g<j?g=j:g>C&&(g=C)}if(d){var _,v;const w=m==="y"?"width":"height",j=ys.has($e(o)),C=i.reference[p]-i.floating[w]+(j&&((_=s.offset)==null?void 0:_[p])||0)+(j?0:h.crossAxis),N=i.reference[p]+i.reference[w]+(j?0:((v=s.offset)==null?void 0:v[p])||0)-(j?h.crossAxis:0);b<C?b=C:b>N&&(b=N)}return{[m]:g,[p]:b}}}},$h=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:l}=t,{apply:c=()=>{},...d}=Fe(e,t),u=await cr(t,d),p=$e(o),m=Et(o),g=Oe(o)==="y",{width:b,height:f}=i.floating;let h,_;p==="top"||p==="bottom"?(h=p,_=m===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(_=p,h=m==="end"?"top":"bottom");const v=f-u.top-u.bottom,w=b-u.left-u.right,j=Ge(f-u[h],v),C=Ge(b-u[_],w),N=!t.middlewareData.shift;let k=j,E=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(k=v),N&&!m){const A=xe(u.left,0),O=xe(u.right,0),R=xe(u.top,0),L=xe(u.bottom,0);g?E=b-2*(A!==0||O!==0?A+O:xe(u.left,u.right)):k=f-2*(R!==0||L!==0?R+L:xe(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:k});const T=await s.getDimensions(l.floating);return b!==T.width||f!==T.height?{reset:{rects:!0}}:{}}}};function Qr(){return typeof window<"u"}function Tt(e){return ws(e)?(e.nodeName||"").toLowerCase():"#document"}function be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Re(e){var t;return(t=(ws(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ws(e){return Qr()?e instanceof Node||e instanceof be(e).Node:!1}function je(e){return Qr()?e instanceof Element||e instanceof be(e).Element:!1}function Le(e){return Qr()?e instanceof HTMLElement||e instanceof be(e).HTMLElement:!1}function js(e){return!Qr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof be(e).ShadowRoot}const Bh=new Set(["inline","contents"]);function dr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Se(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Bh.has(o)}const Uh=new Set(["table","td","th"]);function Hh(e){return Uh.has(Tt(e))}const Vh=[":popover-open",":modal"];function en(e){return Vh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Wh=["transform","translate","scale","rotate","perspective"],qh=["transform","translate","scale","rotate","perspective","filter"],Gh=["paint","layout","strict","content"];function Co(e){const t=ko(),r=je(e)?Se(e):e;return Wh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||qh.some(n=>(r.willChange||"").includes(n))||Gh.some(n=>(r.contain||"").includes(n))}function Kh(e){let t=Ke(e);for(;Le(t)&&!At(t);){if(Co(t))return t;if(en(t))return null;t=Ke(t)}return null}function ko(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Yh=new Set(["html","body","#document"]);function At(e){return Yh.has(Tt(e))}function Se(e){return be(e).getComputedStyle(e)}function tn(e){return je(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ke(e){if(Tt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||js(e)&&e.host||Re(e);return js(t)?t.host:t}function Ss(e){const t=Ke(e);return At(t)?e.ownerDocument?e.ownerDocument.body:e.body:Le(t)&&dr(t)?t:Ss(t)}function ur(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=Ss(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=be(o);if(i){const l=No(s);return t.concat(s,s.visualViewport||[],dr(o)?o:[],l&&r?ur(l):[])}return t.concat(o,ur(o,[],r))}function No(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Cs(e){const t=Se(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Le(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,l=Yr(r)!==i||Yr(n)!==s;return l&&(r=i,n=s),{width:r,height:n,$:l}}function Eo(e){return je(e)?e:e.contextElement}function Pt(e){const t=Eo(e);if(!Le(t))return Pe(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=Cs(t);let s=(i?Yr(r.width):r.width)/n,l=(i?Yr(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Xh=Pe(0);function ks(e){const t=be(e);return!ko()||!t.visualViewport?Xh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Jh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==be(e)?!1:t}function lt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=Eo(e);let s=Pe(1);t&&(n?je(n)&&(s=Pt(n)):s=Pt(e));const l=Jh(i,r,n)?ks(i):Pe(0);let c=(o.left+l.x)/s.x,d=(o.top+l.y)/s.y,u=o.width/s.x,p=o.height/s.y;if(i){const m=be(i),g=n&&je(n)?be(n):n;let b=m,f=No(b);for(;f&&n&&g!==b;){const h=Pt(f),_=f.getBoundingClientRect(),v=Se(f),w=_.left+(f.clientLeft+parseFloat(v.paddingLeft))*h.x,j=_.top+(f.clientTop+parseFloat(v.paddingTop))*h.y;c*=h.x,d*=h.y,u*=h.x,p*=h.y,c+=w,d+=j,b=be(f),f=No(b)}}return Zr({width:u,height:p,x:c,y:d})}function rn(e,t){const r=tn(e).scrollLeft;return t?t.left+r:lt(Re(e)).left+r}function Ns(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-rn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function Zh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=Re(n),l=t?en(t.floating):!1;if(n===s||l&&i)return r;let c={scrollLeft:0,scrollTop:0},d=Pe(1);const u=Pe(0),p=Le(n);if((p||!p&&!i)&&((Tt(n)!=="body"||dr(s))&&(c=tn(n)),Le(n))){const g=lt(n);d=Pt(n),u.x=g.x+n.clientLeft,u.y=g.y+n.clientTop}const m=s&&!p&&!i?Ns(s,c):Pe(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+u.x+m.x,y:r.y*d.y-c.scrollTop*d.y+u.y+m.y}}function Qh(e){return Array.from(e.getClientRects())}function eg(e){const t=Re(e),r=tn(e),n=e.ownerDocument.body,o=xe(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=xe(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+rn(e);const l=-r.scrollTop;return Se(n).direction==="rtl"&&(s+=xe(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:l}}const Es=25;function tg(e,t){const r=be(e),n=Re(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,l=0,c=0;if(o){i=o.width,s=o.height;const u=ko();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const d=rn(n);if(d<=0){const u=n.ownerDocument,p=u.body,m=getComputedStyle(p),g=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(n.clientWidth-p.clientWidth-g);b<=Es&&(i-=b)}else d<=Es&&(i+=d);return{width:i,height:s,x:l,y:c}}const rg=new Set(["absolute","fixed"]);function ng(e,t){const r=lt(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=Le(e)?Pt(e):Pe(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,d=n*i.y;return{width:s,height:l,x:c,y:d}}function Ts(e,t,r){let n;if(t==="viewport")n=tg(e,r);else if(t==="document")n=eg(Re(e));else if(je(t))n=ng(t,r);else{const o=ks(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Zr(n)}function As(e,t){const r=Ke(e);return r===t||!je(r)||At(r)?!1:Se(r).position==="fixed"||As(r,t)}function og(e,t){const r=t.get(e);if(r)return r;let n=ur(e,[],!1).filter(l=>je(l)&&Tt(l)!=="body"),o=null;const i=Se(e).position==="fixed";let s=i?Ke(e):e;for(;je(s)&&!At(s);){const l=Se(s),c=Co(s);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&rg.has(o.position)||dr(s)&&!c&&As(e,s))?n=n.filter(u=>u!==s):o=l,s=Ke(s)}return t.set(e,n),n}function ag(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?en(t)?[]:og(t,this._c):[].concat(r),n],l=s[0],c=s.reduce((d,u)=>{const p=Ts(t,u,o);return d.top=xe(p.top,d.top),d.right=Ge(p.right,d.right),d.bottom=Ge(p.bottom,d.bottom),d.left=xe(p.left,d.left),d},Ts(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ig(e){const{width:t,height:r}=Cs(e);return{width:t,height:r}}function sg(e,t,r){const n=Le(t),o=Re(t),i=r==="fixed",s=lt(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Pe(0);function d(){c.x=rn(o)}if(n||!n&&!i)if((Tt(t)!=="body"||dr(o))&&(l=tn(t)),n){const g=lt(t,!0,i,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&d();i&&!n&&o&&d();const u=o&&!n&&!i?Ns(o,l):Pe(0),p=s.left+l.scrollLeft-c.x-u.x,m=s.top+l.scrollTop-c.y-u.y;return{x:p,y:m,width:s.width,height:s.height}}function To(e){return Se(e).position==="static"}function Ps(e,t){if(!Le(e)||Se(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Re(e)===r&&(r=r.ownerDocument.body),r}function Os(e,t){const r=be(e);if(en(e))return r;if(!Le(e)){let o=Ke(e);for(;o&&!At(o);){if(je(o)&&!To(o))return o;o=Ke(o)}return r}let n=Ps(e,t);for(;n&&Hh(n)&&To(n);)n=Ps(n,t);return n&&At(n)&&To(n)&&!Co(n)?r:n||Kh(e)||r}const lg=async function(e){const t=this.getOffsetParent||Os,r=this.getDimensions,n=await r(e.floating);return{reference:sg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function cg(e){return Se(e).direction==="rtl"}const dg={convertOffsetParentRelativeRectToViewportRelativeRect:Zh,getDocumentElement:Re,getClippingRect:ag,getOffsetParent:Os,getElementRects:lg,getClientRects:Qh,getDimensions:ig,getScale:Pt,isElement:je,isRTL:cg};function Rs(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ug(e,t){let r=null,n;const o=Re(e);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:u,top:p,width:m,height:g}=d;if(l||t(),!m||!g)return;const b=Xr(p),f=Xr(o.clientWidth-(u+m)),h=Xr(o.clientHeight-(p+g)),_=Xr(u),w={rootMargin:-b+"px "+-f+"px "+-h+"px "+-_+"px",threshold:xe(0,Ge(1,c))||1};let j=!0;function C(N){const k=N[0].intersectionRatio;if(k!==c){if(!j)return s();k?s(!1,k):n=setTimeout(()=>{s(!1,1e-7)},1e3)}k===1&&!Rs(d,e.getBoundingClientRect())&&s(),j=!1}try{r=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,w)}r.observe(e)}return s(!0),i}function pg(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=Eo(e),u=o||i?[...d?ur(d):[],...ur(t)]:[];u.forEach(_=>{o&&_.addEventListener("scroll",r,{passive:!0}),i&&_.addEventListener("resize",r)});const p=d&&l?ug(d,r):null;let m=-1,g=null;s&&(g=new ResizeObserver(_=>{let[v]=_;v&&v.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),r()}),d&&!c&&g.observe(d),g.observe(t));let b,f=c?lt(e):null;c&&h();function h(){const _=lt(e);f&&!Rs(f,_)&&r(),f=_,b=requestAnimationFrame(h)}return r(),()=>{var _;u.forEach(v=>{o&&v.removeEventListener("scroll",r),i&&v.removeEventListener("resize",r)}),p?.(),(_=g)==null||_.disconnect(),g=null,c&&cancelAnimationFrame(b)}}const mg=Mh,fg=Dh,hg=Lh,gg=$h,xg=Ih,Ls=Rh,bg=Fh,_g=(e,t,r)=>{const n=new Map,o={platform:dg,...r},i={...o.platform,_c:n};return Oh(e,t,{...o,platform:i})};var vg=typeof document<"u",yg=function(){},nn=vg?y.useLayoutEffect:yg;function on(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!on(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!on(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Is(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zs(e,t){const r=Is(e);return Math.round(t*r)/r}function Ao(e){const t=x.useRef(e);return nn(()=>{t.current=e}),t}function wg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,p]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=x.useState(n);on(m,n)||g(n);const[b,f]=x.useState(null),[h,_]=x.useState(null),v=x.useCallback(z=>{z!==N.current&&(N.current=z,f(z))},[]),w=x.useCallback(z=>{z!==k.current&&(k.current=z,_(z))},[]),j=i||b,C=s||h,N=x.useRef(null),k=x.useRef(null),E=x.useRef(u),T=c!=null,A=Ao(c),O=Ao(o),R=Ao(d),L=x.useCallback(()=>{if(!N.current||!k.current)return;const z={placement:t,strategy:r,middleware:m};O.current&&(z.platform=O.current),_g(N.current,k.current,z).then(q=>{const ae={...q,isPositioned:R.current!==!1};P.current&&!on(E.current,ae)&&(E.current=ae,_r.flushSync(()=>{p(ae)}))})},[m,t,r,O,R]);nn(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(z=>({...z,isPositioned:!1})))},[d]);const P=x.useRef(!1);nn(()=>(P.current=!0,()=>{P.current=!1}),[]),nn(()=>{if(j&&(N.current=j),C&&(k.current=C),j&&C){if(A.current)return A.current(j,C,L);L()}},[j,C,L,A,T]);const M=x.useMemo(()=>({reference:N,floating:k,setReference:v,setFloating:w}),[v,w]),I=x.useMemo(()=>({reference:j,floating:C}),[j,C]),B=x.useMemo(()=>{const z={position:r,left:0,top:0};if(!I.floating)return z;const q=zs(I.floating,u.x),ae=zs(I.floating,u.y);return l?{...z,transform:"translate("+q+"px, "+ae+"px)",...Is(I.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:q,top:ae}},[r,l,I.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:L,refs:M,elements:I,floatingStyles:B}),[u,L,M,I,B])}const jg=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Ls({element:n.current,padding:o}).fn(r):{}:n?Ls({element:n,padding:o}).fn(r):{}}}},Sg=(e,t)=>({...mg(e),options:[e,t]}),Cg=(e,t)=>({...fg(e),options:[e,t]}),kg=(e,t)=>({...bg(e),options:[e,t]}),Ng=(e,t)=>({...hg(e),options:[e,t]}),Eg=(e,t)=>({...gg(e),options:[e,t]}),Tg=(e,t)=>({...xg(e),options:[e,t]}),Ag=(e,t)=>({...jg(e),options:[e,t]});var Pg="Arrow",Ms=x.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return a.jsx(W.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ms.displayName=Pg;var Og=Ms;function Rg(e){const[t,r]=x.useState(void 0);return ce(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;r({width:s,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Po="Popper",[Ds,an]=Ve(Po),[Lg,Fs]=Ds(Po),$s=e=>{const{__scopePopper:t,children:r}=e,[n,o]=x.useState(null);return a.jsx(Lg,{scope:t,anchor:n,onAnchorChange:o,children:r})};$s.displayName=Po;var Bs="PopperAnchor",Us=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Fs(Bs,r),s=x.useRef(null),l=J(t,s),c=x.useRef(null);return x.useEffect(()=>{const d=c.current;c.current=n?.current||s.current,d!==c.current&&i.onAnchorChange(c.current)}),n?null:a.jsx(W.div,{...o,ref:l})});Us.displayName=Bs;var Oo="PopperContent",[Ig,zg]=Ds(Oo),Hs=x.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...f}=e,h=Fs(Oo,r),[_,v]=x.useState(null),w=J(t,$=>v($)),[j,C]=x.useState(null),N=Rg(j),k=N?.width??0,E=N?.height??0,T=n+(i!=="center"?"-"+i:""),A=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(d)?d:[d],R=O.length>0,L={padding:A,boundary:O.filter(Dg),altBoundary:R},{refs:P,floatingStyles:M,placement:I,isPositioned:B,middlewareData:z}=wg({strategy:"fixed",placement:T,whileElementsMounted:(...$)=>pg(...$,{animationFrame:g==="always"}),elements:{reference:h.anchor},middleware:[Sg({mainAxis:o+E,alignmentAxis:s}),c&&Cg({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?kg():void 0,...L}),c&&Ng({...L}),Eg({...L,apply:({elements:$,rects:Y,availableWidth:oe,availableHeight:Z})=>{const{width:Q,height:re}=Y.reference,ve=$.floating.style;ve.setProperty("--radix-popper-available-width",`${oe}px`),ve.setProperty("--radix-popper-available-height",`${Z}px`),ve.setProperty("--radix-popper-anchor-width",`${Q}px`),ve.setProperty("--radix-popper-anchor-height",`${re}px`)}}),j&&Ag({element:j,padding:l}),Fg({arrowWidth:k,arrowHeight:E}),m&&Tg({strategy:"referenceHidden",...L})]}),[q,ae]=qs(I),ie=We(b);ce(()=>{B&&ie?.()},[B,ie]);const ge=z.arrow?.x,_e=z.arrow?.y,pe=z.arrow?.centerOffset!==0,[G,de]=x.useState();return ce(()=>{_&&de(window.getComputedStyle(_).zIndex)},[_]),a.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:B?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(" "),...z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Ig,{scope:r,placedSide:q,onArrowChange:C,arrowX:ge,arrowY:_e,shouldHideArrow:pe,children:a.jsx(W.div,{"data-side":q,"data-align":ae,...f,ref:w,style:{...f.style,animation:B?void 0:"none"}})})})});Hs.displayName=Oo;var Vs="PopperArrow",Mg={top:"bottom",right:"left",bottom:"top",left:"right"},Ws=x.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=zg(Vs,n),s=Mg[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(Og,{...o,ref:r,style:{...o.style,display:"block"}})})});Ws.displayName=Vs;function Dg(e){return e!==null}var Fg=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,l=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[d,u]=qs(r),p={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+l/2,g=(o.arrow?.y??0)+c/2;let b="",f="";return d==="bottom"?(b=s?p:`${m}px`,f=`${-c}px`):d==="top"?(b=s?p:`${m}px`,f=`${n.floating.height+c}px`):d==="right"?(b=`${-c}px`,f=s?p:`${g}px`):d==="left"&&(b=`${n.floating.width+c}px`,f=s?p:`${g}px`),{data:{x:b,y:f}}}});function qs(e){const[t,r="center"]=e.split("-");return[t,r]}var Gs=$s,Ro=Us,Ks=Hs,Ys=Ws,$g="Portal",sn=x.forwardRef((e,t)=>{const{container:r,...n}=e,[o,i]=x.useState(!1);ce(()=>i(!0),[]);const s=r||o&&globalThis?.document?.body;return s?va.createPortal(a.jsx(W.div,{...n,ref:t}),s):null});sn.displayName=$g;function Bg(e,t){return x.useReducer((r,n)=>t[r][n]??r,e)}var Ye=e=>{const{present:t,children:r}=e,n=Ug(t),o=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),i=J(n.ref,Hg(o));return typeof r=="function"||n.isPresent?x.cloneElement(o,{ref:i}):null};Ye.displayName="Presence";function Ug(e){const[t,r]=x.useState(),n=x.useRef(null),o=x.useRef(e),i=x.useRef("none"),s=e?"mounted":"unmounted",[l,c]=Bg(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const d=ln(n.current);i.current=l==="mounted"?d:"none"},[l]),ce(()=>{const d=n.current,u=o.current;if(u!==e){const m=i.current,g=ln(d);e?c("MOUNT"):g==="none"||d?.display==="none"?c("UNMOUNT"):c(u&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),ce(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,p=g=>{const f=ln(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&f&&(c("ANIMATION_END"),!o.current)){const h=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h)})}},m=g=>{g.target===t&&(i.current=ln(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function ln(e){return e?.animationName||"none"}function Hg(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Vg=x[" useInsertionEffect ".trim().toString()]||ce;function ct({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Wg({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:o;{const u=x.useRef(e!==void 0);x.useEffect(()=>{const p=u.current;p!==l&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,n])}const d=x.useCallback(u=>{if(l){const p=qg(u)?u(e):u;p!==e&&s.current?.(p)}else i(u)},[l,e,i,s]);return[c,d]}function Wg({defaultProp:e,onChange:t}){const[r,n]=x.useState(e),o=x.useRef(r),i=x.useRef(t);return Vg(()=>{i.current=t},[t]),x.useEffect(()=>{o.current!==r&&(i.current?.(r),o.current=r)},[r,o]),[r,n,i]}function qg(e){return typeof e=="function"}var Gg=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ot=new WeakMap,cn=new WeakMap,dn={},Lo=0,Xs=function(e){return e&&(e.host||Xs(e.parentNode))},Kg=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Xs(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Yg=function(e,t,r,n){var o=Kg(t,Array.isArray(e)?e:[e]);dn[r]||(dn[r]=new WeakMap);var i=dn[r],s=[],l=new Set,c=new Set(o),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};o.forEach(d);var u=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(l.has(m))u(m);else try{var g=m.getAttribute(n),b=g!==null&&g!=="false",f=(Ot.get(m)||0)+1,h=(i.get(m)||0)+1;Ot.set(m,f),i.set(m,h),s.push(m),f===1&&b&&cn.set(m,!0),h===1&&m.setAttribute(r,"true"),b||m.setAttribute(n,"true")}catch(_){console.error("aria-hidden: cannot operate on ",m,_)}})};return u(t),l.clear(),Lo++,function(){s.forEach(function(p){var m=Ot.get(p)-1,g=i.get(p)-1;Ot.set(p,m),i.set(p,g),m||(cn.has(p)||p.removeAttribute(n),cn.delete(p)),g||p.removeAttribute(r)}),Lo--,Lo||(Ot=new WeakMap,Ot=new WeakMap,cn=new WeakMap,dn={})}},Io=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Gg(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Yg(n,o,r,"aria-hidden")):function(){return null}},Ie=function(){return Ie=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Ie.apply(this,arguments)};function Js(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Xg(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var un="right-scroll-bar-position",pn="width-before-scroll-bar",Jg="with-scroll-bars-hidden",Zg="--removed-body-scroll-bar-size";function zo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Qg(e,t){var r=y.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var ex=typeof window<"u"?x.useLayoutEffect:x.useEffect,Zs=new WeakMap;function tx(e,t){var r=Qg(null,function(n){return e.forEach(function(o){return zo(o,n)})});return ex(function(){var n=Zs.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(l){i.has(l)||zo(l,null)}),i.forEach(function(l){o.has(l)||zo(l,s)})}Zs.set(r,e)},[e]),r}function rx(e){return e}function nx(e,t){t===void 0&&(t=rx);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var s=t(i,n);return r.push(s),function(){r=r.filter(function(l){return l!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var l=r;r=[],l.forEach(i),s=r}var c=function(){var u=s;s=[],u.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(u){s.push(u),d()},filter:function(u){return s=s.filter(u),r}}}};return o}function ox(e){e===void 0&&(e={});var t=nx(null);return t.options=Ie({async:!0,ssr:!1},e),t}var Qs=function(e){var t=e.sideCar,r=Js(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return x.createElement(n,Ie({},r))};Qs.isSideCarExport=!0;function ax(e,t){return e.useMedium(t),Qs}var el=ox(),Mo=function(){},mn=x.forwardRef(function(e,t){var r=x.useRef(null),n=x.useState({onScrollCapture:Mo,onWheelCapture:Mo,onTouchMoveCapture:Mo}),o=n[0],i=n[1],s=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,m=e.sideCar,g=e.noRelative,b=e.noIsolation,f=e.inert,h=e.allowPinchZoom,_=e.as,v=_===void 0?"div":_,w=e.gapMode,j=Js(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,N=tx([r,t]),k=Ie(Ie({},j),o);return x.createElement(x.Fragment,null,u&&x.createElement(C,{sideCar:el,removeScrollBar:d,shards:p,noRelative:g,noIsolation:b,inert:f,setCallbacks:i,allowPinchZoom:!!h,lockRef:r,gapMode:w}),s?x.cloneElement(x.Children.only(l),Ie(Ie({},k),{ref:N})):x.createElement(v,Ie({},k,{className:c,ref:N}),l))});mn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},mn.classNames={fullWidth:pn,zeroRight:un};var ix=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function sx(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ix();return t&&e.setAttribute("nonce",t),e}function lx(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function cx(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var dx=function(){var e=0,t=null;return{add:function(r){e==0&&(t=sx())&&(lx(t,r),cx(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ux=function(){var e=dx();return function(t,r){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},tl=function(){var e=ux(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},px={left:0,top:0,right:0,gap:0},Do=function(e){return parseInt(e||"",10)||0},mx=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Do(r),Do(n),Do(o)]},fx=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return px;var t=mx(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},hx=tl(),Rt="data-scroll-locked",gx=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,l=e.gap;return r===void 0&&(r="margin"),`
     324  .`.concat(Jg,` {
    320325   overflow: hidden `).concat(n,`;
    321326   padding-right: `).concat(l,"px ").concat(n,`;
    322327  }
    323   body[`).concat(Tt,`] {
     328  body[`).concat(Rt,`] {
    324329    overflow: hidden `).concat(n,`;
    325330    overscroll-behavior: contain;
     
    350355  }
    351356 
    352   body[`).concat(Tt,`] {
    353     `).concat(Xg,": ").concat(l,`px;
    354   }
    355 `)},rl=function(){var e=parseInt(document.body.getAttribute(Tt)||"0",10);return isFinite(e)?e:0},hx=function(){x.useEffect(function(){return document.body.setAttribute(Tt,(rl()+1).toString()),function(){var e=rl()-1;e<=0?document.body.removeAttribute(Tt):document.body.setAttribute(Tt,e.toString())}},[])},gx=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;hx();var i=x.useMemo(function(){return px(o)},[o]);return x.createElement(mx,{styles:fx(i,!t,o,r?"":"!important")})},Fo=!1;if(typeof window<"u")try{var fn=Object.defineProperty({},"passive",{get:function(){return Fo=!0,!0}});window.addEventListener("test",fn,fn),window.removeEventListener("test",fn,fn)}catch{Fo=!1}var At=Fo?{passive:!1}:!1,xx=function(e){return e.tagName==="TEXTAREA"},nl=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!xx(e)&&r[t]==="visible")},bx=function(e){return nl(e,"overflowY")},vx=function(e){return nl(e,"overflowX")},ol=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=al(e,n);if(o){var i=il(e,n),s=i[1],l=i[2];if(s>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},_x=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},yx=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},al=function(e,t){return e==="v"?bx(t):vx(t)},il=function(e,t){return e==="v"?_x(t):yx(t)},wx=function(e,t){return e==="h"&&t==="rtl"?-1:1},jx=function(e,t,r,n,o){var i=wx(e,window.getComputedStyle(t).direction),s=i*n,l=r.target,d=t.contains(l),c=!1,u=s>0,p=0,m=0;do{if(!l)break;var g=il(e,l),b=g[0],f=g[1],h=g[2],v=f-h-i*b;(b||v)&&al(e,l)&&(p+=v,m+=b);var _=l.parentNode;l=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!d&&l!==document.body||d&&(t.contains(l)||t===l));return(u&&Math.abs(p)<1||!u&&Math.abs(m)<1)&&(c=!0),c},hn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sl=function(e){return[e.deltaX,e.deltaY]},ll=function(e){return e&&"current"in e?e.current:e},Sx=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Cx=function(e){return`
     357  body[`).concat(Rt,`] {
     358    `).concat(Zg,": ").concat(l,`px;
     359  }
     360`)},rl=function(){var e=parseInt(document.body.getAttribute(Rt)||"0",10);return isFinite(e)?e:0},xx=function(){x.useEffect(function(){return document.body.setAttribute(Rt,(rl()+1).toString()),function(){var e=rl()-1;e<=0?document.body.removeAttribute(Rt):document.body.setAttribute(Rt,e.toString())}},[])},bx=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;xx();var i=x.useMemo(function(){return fx(o)},[o]);return x.createElement(hx,{styles:gx(i,!t,o,r?"":"!important")})},Fo=!1;if(typeof window<"u")try{var fn=Object.defineProperty({},"passive",{get:function(){return Fo=!0,!0}});window.addEventListener("test",fn,fn),window.removeEventListener("test",fn,fn)}catch{Fo=!1}var Lt=Fo?{passive:!1}:!1,_x=function(e){return e.tagName==="TEXTAREA"},nl=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!_x(e)&&r[t]==="visible")},vx=function(e){return nl(e,"overflowY")},yx=function(e){return nl(e,"overflowX")},ol=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=al(e,n);if(o){var i=il(e,n),s=i[1],l=i[2];if(s>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},wx=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},jx=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},al=function(e,t){return e==="v"?vx(t):yx(t)},il=function(e,t){return e==="v"?wx(t):jx(t)},Sx=function(e,t){return e==="h"&&t==="rtl"?-1:1},Cx=function(e,t,r,n,o){var i=Sx(e,window.getComputedStyle(t).direction),s=i*n,l=r.target,c=t.contains(l),d=!1,u=s>0,p=0,m=0;do{if(!l)break;var g=il(e,l),b=g[0],f=g[1],h=g[2],_=f-h-i*b;(b||_)&&al(e,l)&&(p+=_,m+=b);var v=l.parentNode;l=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(u&&Math.abs(p)<1||!u&&Math.abs(m)<1)&&(d=!0),d},hn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sl=function(e){return[e.deltaX,e.deltaY]},ll=function(e){return e&&"current"in e?e.current:e},kx=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Nx=function(e){return`
    356361  .block-interactivity-`.concat(e,` {pointer-events: none;}
    357362  .allow-interactivity-`).concat(e,` {pointer-events: all;}
    358 `)},kx=0,Pt=[];function Nx(e){var t=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),o=x.useState(kx++)[0],i=x.useState(tl)[0],s=x.useRef(e);x.useEffect(function(){s.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var f=Kg([e.lockRef.current],(e.shards||[]).map(ll),!0).filter(Boolean);return f.forEach(function(h){return h.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),f.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=x.useCallback(function(f,h){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!s.current.allowPinchZoom;var v=hn(f),_=r.current,w="deltaX"in f?f.deltaX:_[0]-v[0],j="deltaY"in f?f.deltaY:_[1]-v[1],C,N=f.target,k=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in f&&k==="h"&&N.type==="range")return!1;var E=ol(k,N);if(!E)return!0;if(E?C=k:(C=k==="v"?"h":"v",E=ol(k,N)),!E)return!1;if(!n.current&&"changedTouches"in f&&(w||j)&&(n.current=C),!C)return!0;var T=n.current||C;return jx(T,h,f,T==="h"?w:j)},[]),d=x.useCallback(function(f){var h=f;if(!(!Pt.length||Pt[Pt.length-1]!==i)){var v="deltaY"in h?sl(h):hn(h),_=t.current.filter(function(C){return C.name===h.type&&(C.target===h.target||h.target===C.shadowParent)&&Sx(C.delta,v)})[0];if(_&&_.should){h.cancelable&&h.preventDefault();return}if(!_){var w=(s.current.shards||[]).map(ll).filter(Boolean).filter(function(C){return C.contains(h.target)}),j=w.length>0?l(h,w[0]):!s.current.noIsolation;j&&h.cancelable&&h.preventDefault()}}},[]),c=x.useCallback(function(f,h,v,_){var w={name:f,delta:h,target:v,should:_,shadowParent:Ex(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(j){return j!==w})},1)},[]),u=x.useCallback(function(f){r.current=hn(f),n.current=void 0},[]),p=x.useCallback(function(f){c(f.type,sl(f),f.target,l(f,e.lockRef.current))},[]),m=x.useCallback(function(f){c(f.type,hn(f),f.target,l(f,e.lockRef.current))},[]);x.useEffect(function(){return Pt.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",d,At),document.addEventListener("touchmove",d,At),document.addEventListener("touchstart",u,At),function(){Pt=Pt.filter(function(f){return f!==i}),document.removeEventListener("wheel",d,At),document.removeEventListener("touchmove",d,At),document.removeEventListener("touchstart",u,At)}},[]);var g=e.removeScrollBar,b=e.inert;return x.createElement(x.Fragment,null,b?x.createElement(i,{styles:Cx(o)}):null,g?x.createElement(gx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ex(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Tx=nx(el,Nx);var gn=x.forwardRef(function(e,t){return x.createElement(mn,Ie({},e,{ref:t,sideCar:Tx}))});gn.classNames=mn.classNames;var xn="Popover",[cl]=Ve(xn,[an]),ur=an(),[Ax,Xe]=cl(xn),dl=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,l=ur(t),d=x.useRef(null),[c,u]=x.useState(!1),[p,m]=ct({prop:n,defaultProp:o??!1,onChange:i,caller:xn});return a.jsx(Gs,{...l,children:a.jsx(Ax,{scope:t,contentId:Ae(),triggerRef:d,open:p,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:c,onCustomAnchorAdd:x.useCallback(()=>u(!0),[]),onCustomAnchorRemove:x.useCallback(()=>u(!1),[]),modal:s,children:r})})};dl.displayName=xn;var ul="PopoverAnchor",Px=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(ul,r),i=ur(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=o;return x.useEffect(()=>(s(),()=>l()),[s,l]),a.jsx(Ro,{...i,...n,ref:t})});Px.displayName=ul;var pl="PopoverTrigger",ml=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(pl,r),i=ur(r),s=J(t,o.triggerRef),l=a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":bl(o.open),...n,ref:s,onClick:V(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:a.jsx(Ro,{asChild:!0,...i,children:l})});ml.displayName=pl;var $o="PopoverPortal",[Ox,Rx]=cl($o,{forceMount:void 0}),fl=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=Xe($o,t);return a.jsx(Ox,{scope:t,forceMount:r,children:a.jsx(Ye,{present:r||i.open,children:a.jsx(sn,{asChild:!0,container:o,children:n})})})};fl.displayName=$o;var Ot="PopoverContent",hl=x.forwardRef((e,t)=>{const r=Rx(Ot,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=Xe(Ot,e.__scopePopover);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx(Ix,{...o,ref:t}):a.jsx(zx,{...o,ref:t})})});hl.displayName=Ot;var Lx=nt("PopoverContent.RemoveScroll"),Ix=x.forwardRef((e,t)=>{const r=Xe(Ot,e.__scopePopover),n=x.useRef(null),o=J(t,n),i=x.useRef(!1);return x.useEffect(()=>{const s=n.current;if(s)return Io(s)},[]),a.jsx(gn,{as:Lx,allowPinchZoom:!0,children:a.jsx(gl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,s=>{s.preventDefault(),i.current||r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,d=l.button===0&&l.ctrlKey===!0,c=l.button===2||d;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:V(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),zx=x.forwardRef((e,t)=>{const r=Xe(Ot,e.__scopePopover),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(gl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),gl=x.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:c,onInteractOutside:u,...p}=e,m=Xe(Ot,r),g=ur(r);return xo(),a.jsx(Kr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(Gr,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:c,onDismiss:()=>m.onOpenChange(!1),children:a.jsx(Ks,{"data-state":bl(m.open),role:"dialog",id:m.contentId,...g,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),xl="PopoverClose",Mx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(xl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Mx.displayName=xl;var Dx="PopoverArrow",Fx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=ur(r);return a.jsx(Ys,{...o,...n,ref:t})});Fx.displayName=Dx;function bl(e){return e?"open":"closed"}var $x=dl,Bx=ml,Ux=fl,Hx=hl;function Rt({...e}){return a.jsx($x,{"data-slot":"popover",...e})}function Lt({...e}){return a.jsx(Bx,{"data-slot":"popover-trigger",...e})}function It({className:e,align:t="center",sideOffset:r=4,...n}){const o=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(Ux,{container:o,children:a.jsx(Hx,{"data-slot":"popover-content",align:t,sideOffset:r,className:F("ecr-popover",e),...n})})}var Vx=Symbol.for("react.lazy"),bn=x[" use ".trim().toString()];function Wx(e){return typeof e=="object"&&e!==null&&"then"in e}function vl(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Vx&&"_payload"in e&&Wx(e._payload)}function qx(e){const t=Gx(e),r=x.forwardRef((n,o)=>{let{children:i,...s}=n;vl(i)&&typeof bn=="function"&&(i=bn(i._payload));const l=x.Children.toArray(i),d=l.find(Yx);if(d){const c=d.props.children,u=l.map(p=>p===d?x.Children.count(c)>1?x.Children.only(null):x.isValidElement(c)?c.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(c)?x.cloneElement(c,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function Gx(e){const t=x.forwardRef((r,n)=>{let{children:o,...i}=r;if(vl(o)&&typeof bn=="function"&&(o=bn(o._payload)),x.isValidElement(o)){const s=Jx(o),l=Xx(i,o.props);return o.type!==x.Fragment&&(l.ref=n?Wn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Kx=Symbol("radix.slottable");function Yx(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Kx}function Xx(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const d=i(...l);return o(...l),d}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function Jx(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Zx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Qx=Zx.reduce((e,t)=>{const r=qx(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,d=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),e0="Separator",_l="horizontal",t0=["horizontal","vertical"],yl=x.forwardRef((e,t)=>{const{decorative:r,orientation:n=_l,...o}=e,i=r0(n)?n:_l,l=r?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(Qx.div,{"data-orientation":i,...l,...o,ref:t})});yl.displayName=e0;function r0(e){return t0.includes(e)}var n0=yl;function vn({className:e,orientation:t="horizontal",decorative:r=!0,...n}){return a.jsx(n0,{"data-slot":"separator",decorative:r,orientation:t,className:F("ecr-separator",e),...n})}const pr=({name:e,text:t})=>{const r=ecommreelsInfo.isProActive,n=ecommreelsInfo.isLicenseActive,o=ecommreelsInfo.license_page;return a.jsxs("div",{className:"ecr-admin-upgrade__modal",children:[a.jsxs("h4",{className:"ecr-admin-upgrade__title",children:[a.jsx("span",{className:"ecr-admin-upgrade__name",children:e}),a.jsx("span",{className:"ecr-admin-upgrade__tag",children:"PRO"})]}),a.jsx(vn,{className:"ecr-admin-separator"}),a.jsx("p",{className:"ecr-admin-upgrade__text",children:t}),a.jsx(vn,{className:"ecr-admin-separator"}),a.jsx("div",{className:"ecr-admin-upgrade__actions",children:a.jsx(te,{asChild:!0,className:"ecr-admin-upgrade__button",size:"sm",children:a.jsx("a",{href:r&&!n?o:"https://reelswp.com/pricing/",style:{color:"#fff"},target:"_blank",rel:"noreferrer",className:"ecr-admin-upgrade__link",children:r&&!n?"Active":"Upgrade to Pro"})})})]})};var _n="Dialog",[wl]=Ve(_n),[o0,Ce]=wl(_n),jl=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,l=x.useRef(null),d=x.useRef(null),[c,u]=ct({prop:n,defaultProp:o??!1,onChange:i,caller:_n});return a.jsx(o0,{scope:t,triggerRef:l,contentRef:d,contentId:Ae(),titleId:Ae(),descriptionId:Ae(),open:c,onOpenChange:u,onOpenToggle:x.useCallback(()=>u(p=>!p),[u]),modal:s,children:r})};jl.displayName=_n;var Sl="DialogTrigger",Cl=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ce(Sl,r),i=J(t,o.triggerRef);return a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ho(o.open),...n,ref:i,onClick:V(e.onClick,o.onOpenToggle)})});Cl.displayName=Sl;var Bo="DialogPortal",[a0,kl]=wl(Bo,{forceMount:void 0}),Nl=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,i=Ce(Bo,t);return a.jsx(a0,{scope:t,forceMount:r,children:x.Children.map(n,s=>a.jsx(Ye,{present:r||i.open,children:a.jsx(sn,{asChild:!0,container:o,children:s})}))})};Nl.displayName=Bo;var yn="DialogOverlay",El=x.forwardRef((e,t)=>{const r=kl(yn,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=Ce(yn,e.__scopeDialog);return i.modal?a.jsx(Ye,{present:n||i.open,children:a.jsx(s0,{...o,ref:t})}):null});El.displayName=yn;var i0=nt("DialogOverlay.RemoveScroll"),s0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ce(yn,r);return a.jsx(gn,{as:i0,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(W.div,{"data-state":Ho(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),dt="DialogContent",Tl=x.forwardRef((e,t)=>{const r=kl(dt,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=Ce(dt,e.__scopeDialog);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx(l0,{...o,ref:t}):a.jsx(c0,{...o,ref:t})})});Tl.displayName=dt;var l0=x.forwardRef((e,t)=>{const r=Ce(dt,e.__scopeDialog),n=x.useRef(null),o=J(t,r.contentRef,n);return x.useEffect(()=>{const i=n.current;if(i)return Io(i)},[]),a.jsx(Al,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,i=>{i.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&i.preventDefault()}),onFocusOutside:V(e.onFocusOutside,i=>i.preventDefault())})}),c0=x.forwardRef((e,t)=>{const r=Ce(dt,e.__scopeDialog),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(Al,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Al=x.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,l=Ce(dt,r),d=x.useRef(null),c=J(t,d);return xo(),a.jsxs(a.Fragment,{children:[a.jsx(Kr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(Gr,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Ho(l.open),...s,ref:c,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(u0,{titleId:l.titleId}),a.jsx(m0,{contentRef:d,descriptionId:l.descriptionId})]})]})}),Uo="DialogTitle",Pl=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ce(Uo,r);return a.jsx(W.h2,{id:o.titleId,...n,ref:t})});Pl.displayName=Uo;var Ol="DialogDescription",d0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ce(Ol,r);return a.jsx(W.p,{id:o.descriptionId,...n,ref:t})});d0.displayName=Ol;var Rl="DialogClose",Ll=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ce(Rl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Ll.displayName=Rl;function Ho(e){return e?"open":"closed"}var Il="DialogTitleWarning",[c1,zl]=Zf(Il,{contentName:dt,titleName:Uo,docsSlug:"dialog"}),u0=({titleId:e})=>{const t=zl(Il),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
     363`)},Ex=0,It=[];function Tx(e){var t=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),o=x.useState(Ex++)[0],i=x.useState(tl)[0],s=x.useRef(e);x.useEffect(function(){s.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var f=Xg([e.lockRef.current],(e.shards||[]).map(ll),!0).filter(Boolean);return f.forEach(function(h){return h.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),f.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=x.useCallback(function(f,h){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!s.current.allowPinchZoom;var _=hn(f),v=r.current,w="deltaX"in f?f.deltaX:v[0]-_[0],j="deltaY"in f?f.deltaY:v[1]-_[1],C,N=f.target,k=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in f&&k==="h"&&N.type==="range")return!1;var E=ol(k,N);if(!E)return!0;if(E?C=k:(C=k==="v"?"h":"v",E=ol(k,N)),!E)return!1;if(!n.current&&"changedTouches"in f&&(w||j)&&(n.current=C),!C)return!0;var T=n.current||C;return Cx(T,h,f,T==="h"?w:j)},[]),c=x.useCallback(function(f){var h=f;if(!(!It.length||It[It.length-1]!==i)){var _="deltaY"in h?sl(h):hn(h),v=t.current.filter(function(C){return C.name===h.type&&(C.target===h.target||h.target===C.shadowParent)&&kx(C.delta,_)})[0];if(v&&v.should){h.cancelable&&h.preventDefault();return}if(!v){var w=(s.current.shards||[]).map(ll).filter(Boolean).filter(function(C){return C.contains(h.target)}),j=w.length>0?l(h,w[0]):!s.current.noIsolation;j&&h.cancelable&&h.preventDefault()}}},[]),d=x.useCallback(function(f,h,_,v){var w={name:f,delta:h,target:_,should:v,shadowParent:Ax(_)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(j){return j!==w})},1)},[]),u=x.useCallback(function(f){r.current=hn(f),n.current=void 0},[]),p=x.useCallback(function(f){d(f.type,sl(f),f.target,l(f,e.lockRef.current))},[]),m=x.useCallback(function(f){d(f.type,hn(f),f.target,l(f,e.lockRef.current))},[]);x.useEffect(function(){return It.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Lt),document.addEventListener("touchmove",c,Lt),document.addEventListener("touchstart",u,Lt),function(){It=It.filter(function(f){return f!==i}),document.removeEventListener("wheel",c,Lt),document.removeEventListener("touchmove",c,Lt),document.removeEventListener("touchstart",u,Lt)}},[]);var g=e.removeScrollBar,b=e.inert;return x.createElement(x.Fragment,null,b?x.createElement(i,{styles:Nx(o)}):null,g?x.createElement(bx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ax(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Px=ax(el,Tx);var gn=x.forwardRef(function(e,t){return x.createElement(mn,Ie({},e,{ref:t,sideCar:Px}))});gn.classNames=mn.classNames;var xn="Popover",[cl]=Ve(xn,[an]),pr=an(),[Ox,Xe]=cl(xn),dl=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,l=pr(t),c=x.useRef(null),[d,u]=x.useState(!1),[p,m]=ct({prop:n,defaultProp:o??!1,onChange:i,caller:xn});return a.jsx(Gs,{...l,children:a.jsx(Ox,{scope:t,contentId:Ae(),triggerRef:c,open:p,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:d,onCustomAnchorAdd:x.useCallback(()=>u(!0),[]),onCustomAnchorRemove:x.useCallback(()=>u(!1),[]),modal:s,children:r})})};dl.displayName=xn;var ul="PopoverAnchor",Rx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(ul,r),i=pr(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=o;return x.useEffect(()=>(s(),()=>l()),[s,l]),a.jsx(Ro,{...i,...n,ref:t})});Rx.displayName=ul;var pl="PopoverTrigger",ml=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(pl,r),i=pr(r),s=J(t,o.triggerRef),l=a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":bl(o.open),...n,ref:s,onClick:V(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:a.jsx(Ro,{asChild:!0,...i,children:l})});ml.displayName=pl;var $o="PopoverPortal",[Lx,Ix]=cl($o,{forceMount:void 0}),fl=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=Xe($o,t);return a.jsx(Lx,{scope:t,forceMount:r,children:a.jsx(Ye,{present:r||i.open,children:a.jsx(sn,{asChild:!0,container:o,children:n})})})};fl.displayName=$o;var zt="PopoverContent",hl=x.forwardRef((e,t)=>{const r=Ix(zt,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=Xe(zt,e.__scopePopover);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx(Mx,{...o,ref:t}):a.jsx(Dx,{...o,ref:t})})});hl.displayName=zt;var zx=nt("PopoverContent.RemoveScroll"),Mx=x.forwardRef((e,t)=>{const r=Xe(zt,e.__scopePopover),n=x.useRef(null),o=J(t,n),i=x.useRef(!1);return x.useEffect(()=>{const s=n.current;if(s)return Io(s)},[]),a.jsx(gn,{as:zx,allowPinchZoom:!0,children:a.jsx(gl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,s=>{s.preventDefault(),i.current||r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:V(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),Dx=x.forwardRef((e,t)=>{const r=Xe(zt,e.__scopePopover),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(gl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),gl=x.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...p}=e,m=Xe(zt,r),g=pr(r);return xo(),a.jsx(Kr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(Gr,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:a.jsx(Ks,{"data-state":bl(m.open),role:"dialog",id:m.contentId,...g,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),xl="PopoverClose",Fx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(xl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Fx.displayName=xl;var $x="PopoverArrow",Bx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=pr(r);return a.jsx(Ys,{...o,...n,ref:t})});Bx.displayName=$x;function bl(e){return e?"open":"closed"}var Ux=dl,Hx=ml,Vx=fl,Wx=hl;function dt({...e}){return a.jsx(Ux,{"data-slot":"popover",...e})}function ut({...e}){return a.jsx(Hx,{"data-slot":"popover-trigger",...e})}function pt({className:e,align:t="center",sideOffset:r=4,...n}){const o=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(Vx,{container:o,children:a.jsx(Wx,{"data-slot":"popover-content",align:t,sideOffset:r,className:F("ecr-popover",e),...n})})}var qx=Symbol.for("react.lazy"),bn=x[" use ".trim().toString()];function Gx(e){return typeof e=="object"&&e!==null&&"then"in e}function _l(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===qx&&"_payload"in e&&Gx(e._payload)}function Kx(e){const t=Yx(e),r=x.forwardRef((n,o)=>{let{children:i,...s}=n;_l(i)&&typeof bn=="function"&&(i=bn(i._payload));const l=x.Children.toArray(i),c=l.find(Jx);if(c){const d=c.props.children,u=l.map(p=>p===c?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function Yx(e){const t=x.forwardRef((r,n)=>{let{children:o,...i}=r;if(_l(o)&&typeof bn=="function"&&(o=bn(o._payload)),x.isValidElement(o)){const s=Qx(o),l=Zx(i,o.props);return o.type!==x.Fragment&&(l.ref=n?Wn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xx=Symbol("radix.slottable");function Jx(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xx}function Zx(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function Qx(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var e0=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],t0=e0.reduce((e,t)=>{const r=Kx(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),r0="Separator",vl="horizontal",n0=["horizontal","vertical"],yl=x.forwardRef((e,t)=>{const{decorative:r,orientation:n=vl,...o}=e,i=o0(n)?n:vl,l=r?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(t0.div,{"data-orientation":i,...l,...o,ref:t})});yl.displayName=r0;function o0(e){return n0.includes(e)}var a0=yl;function _n({className:e,orientation:t="horizontal",decorative:r=!0,...n}){return a.jsx(a0,{"data-slot":"separator",decorative:r,orientation:t,className:F("ecr-separator",e),...n})}const Mt=({name:e,text:t})=>{const r=ecommreelsInfo.isProActive,n=ecommreelsInfo.isLicenseActive,o=ecommreelsInfo.license_page;return a.jsxs("div",{className:"ecr-admin-upgrade__modal",children:[a.jsxs("h4",{className:"ecr-admin-upgrade__title",children:[a.jsx("span",{className:"ecr-admin-upgrade__name",children:e}),a.jsx("span",{className:"ecr-admin-upgrade__tag",children:"PRO"})]}),a.jsx(_n,{className:"ecr-admin-separator"}),a.jsx("p",{className:"ecr-admin-upgrade__text",children:t}),a.jsx(_n,{className:"ecr-admin-separator"}),a.jsx("div",{className:"ecr-admin-upgrade__actions",children:a.jsx(te,{asChild:!0,className:"ecr-admin-upgrade__button",size:"sm",children:a.jsx("a",{href:r&&!n?o:"https://reelswp.com/pricing/",style:{color:"#fff"},target:"_blank",rel:"noreferrer",className:"ecr-admin-upgrade__link",children:r&&!n?"Active":"Upgrade to Pro"})})})]})};var vn="Dialog",[wl]=Ve(vn),[i0,Ce]=wl(vn),jl=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,l=x.useRef(null),c=x.useRef(null),[d,u]=ct({prop:n,defaultProp:o??!1,onChange:i,caller:vn});return a.jsx(i0,{scope:t,triggerRef:l,contentRef:c,contentId:Ae(),titleId:Ae(),descriptionId:Ae(),open:d,onOpenChange:u,onOpenToggle:x.useCallback(()=>u(p=>!p),[u]),modal:s,children:r})};jl.displayName=vn;var Sl="DialogTrigger",Cl=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ce(Sl,r),i=J(t,o.triggerRef);return a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ho(o.open),...n,ref:i,onClick:V(e.onClick,o.onOpenToggle)})});Cl.displayName=Sl;var Bo="DialogPortal",[s0,kl]=wl(Bo,{forceMount:void 0}),Nl=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,i=Ce(Bo,t);return a.jsx(s0,{scope:t,forceMount:r,children:x.Children.map(n,s=>a.jsx(Ye,{present:r||i.open,children:a.jsx(sn,{asChild:!0,container:o,children:s})}))})};Nl.displayName=Bo;var yn="DialogOverlay",El=x.forwardRef((e,t)=>{const r=kl(yn,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=Ce(yn,e.__scopeDialog);return i.modal?a.jsx(Ye,{present:n||i.open,children:a.jsx(c0,{...o,ref:t})}):null});El.displayName=yn;var l0=nt("DialogOverlay.RemoveScroll"),c0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ce(yn,r);return a.jsx(gn,{as:l0,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(W.div,{"data-state":Ho(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),mt="DialogContent",Tl=x.forwardRef((e,t)=>{const r=kl(mt,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=Ce(mt,e.__scopeDialog);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx(d0,{...o,ref:t}):a.jsx(u0,{...o,ref:t})})});Tl.displayName=mt;var d0=x.forwardRef((e,t)=>{const r=Ce(mt,e.__scopeDialog),n=x.useRef(null),o=J(t,r.contentRef,n);return x.useEffect(()=>{const i=n.current;if(i)return Io(i)},[]),a.jsx(Al,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,i=>{i.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&i.preventDefault()}),onFocusOutside:V(e.onFocusOutside,i=>i.preventDefault())})}),u0=x.forwardRef((e,t)=>{const r=Ce(mt,e.__scopeDialog),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(Al,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Al=x.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,l=Ce(mt,r),c=x.useRef(null),d=J(t,c);return xo(),a.jsxs(a.Fragment,{children:[a.jsx(Kr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(Gr,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Ho(l.open),...s,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(m0,{titleId:l.titleId}),a.jsx(h0,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Uo="DialogTitle",Pl=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ce(Uo,r);return a.jsx(W.h2,{id:o.titleId,...n,ref:t})});Pl.displayName=Uo;var Ol="DialogDescription",p0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ce(Ol,r);return a.jsx(W.p,{id:o.descriptionId,...n,ref:t})});p0.displayName=Ol;var Rl="DialogClose",Ll=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ce(Rl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Ll.displayName=Rl;function Ho(e){return e?"open":"closed"}var Il="DialogTitleWarning",[m1,zl]=eh(Il,{contentName:mt,titleName:Uo,docsSlug:"dialog"}),m0=({titleId:e})=>{const t=zl(Il),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
    359364
    360365If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
    361366
    362 For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},p0="DialogDescriptionWarning",m0=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${zl(p0).contentName}}.`;return x.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},f0=jl,h0=Cl,g0=Nl,x0=El,b0=Tl,v0=Pl,Ml=Ll;function Vo({...e}){return a.jsx(f0,{"data-slot":"dialog",...e})}function Wo({...e}){return a.jsx(h0,{"data-slot":"dialog-trigger",...e})}function _0({...e}){const t=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(g0,{"data-slot":"dialog-portal",container:t,...e})}function y0({className:e,...t}){return a.jsx(x0,{"data-slot":"dialog-overlay",className:F("ecr-dialog__overlay",e),...t})}function qo({className:e,children:t,...r}){return a.jsxs(_0,{children:[a.jsx(y0,{}),a.jsxs(b0,{"data-slot":"dialog-content",className:F("ecr-dialog__content",e),...r,children:[t,a.jsx(Ml,{className:"ecr-dialog__close","aria-label":"Close dialog",children:a.jsx(Jf,{className:"ecr-dialog__close-icon"})})]})]})}function Go({className:e,...t}){return a.jsx("div",{className:F("ecr-dialog__header",e),...t})}function Ko({className:e,...t}){return a.jsx(v0,{"data-slot":"dialog-title",className:F("ecr-dialog__title",e),...t})}function w0({...e}){return a.jsx(Ml,{"data-slot":"dialog-close",...e})}const j0=(e={})=>{const{enabled:t=!0}=e,r=typeof ecommreelsInfo<"u"?ecommreelsInfo?.url:"",n=typeof ecommreelsInfo<"u"?ecommreelsInfo?.nonce:"",[o,i]=y.useState([]),[s,l]=y.useState(1),[d,c]=y.useState(!0),[u,p]=y.useState(!1),[m,g]=y.useState(!1),[b,f]=y.useState(""),h=co(b,500),v=y.useRef(!0),_=y.useRef(0),w=y.useRef(null),[j,C]=y.useState(null),N=y.useCallback(async T=>{if(!r||!n){C("Missing API configuration."),g(!1),p(!1);return}const A=++_.current;w.current&&w.current.abort();const O=new AbortController;w.current=O,T===1&&v.current?g(!0):p(!0);try{const R={page:T,per_page:50};h&&(R.search=h);const L=await ee.get(`${r}wc/v3/products`,{headers:{"X-WP-Nonce":n},withCredentials:!0,params:R,signal:O.signal}),P=L.data,M=parseInt(L.headers["x-wp-totalpages"]||"1",10);A===_.current&&(i(I=>T===1?P:[...I,...P]),l(T+1),c(T<M))}catch(R){if(O.signal.aborted)return;R instanceof Error?C(R.message):C("An unknown error occurred")}finally{v.current&&(v.current=!1),A===_.current&&!O.signal.aborted&&(p(!1),g(!1))}},[h,n,r]);y.useEffect(()=>{t&&(l(1),i([]),C(null),v.current=!0,N(1))},[h,N,t]);const k=y.useRef(null),E=y.useCallback(T=>{u||(k.current&&k.current.disconnect(),k.current=new IntersectionObserver(A=>{A[0].isIntersecting&&d&&N(s)}),T&&k.current.observe(T))},[u,d,s,N]);return y.useEffect(()=>()=>{k.current&&k.current.disconnect(),w.current&&w.current.abort()},[]),{products:o,setProducts:i,searchTerm:b,setSearchTerm:f,isSearching:u,isLoading:m,error:j,lastProductElementRef:E}},wn="data:image/webp;base64,UklGRrYCAABXRUJQVlA4IKoCAAAQDgCdASpkAEMAAAAAJaQDTXX09L/D3HZzPbW8/T59Tq2V1f9x4QZUkPFMe8XfzV/1/cA/U3/e+qB5s3stfrGmnzI3LSXH12rz2O2VKFiQhcbIwmUHTRPSh2VO/qyrsEp8zYYljZlwfgijGvud/SarxFjfxEew4IAAAP7/ti48OT/Oya3x+X1pd0VKczR2pok8Ci8XRszNhGh0y5UiQtxf1xZl/3jvki/LfqRs3vrkqKO+RR3ax2yhGPzf/uMJqz6MmyKZ75prVit6Eu2kyiVhUvihA/zLTt4PvMG3YOlFXZJRTk9Zz1SB9/gGf8x4hu9/9Fz/JZ63KGECMtEG58t43wKZFRr2piHRIZQT76htB+3yWUaqjW/9r5PNawz37RxBI1wHwj1o4cbmVBENdq85+fOSQapp04WZhajKbzXhRwSwcxZI01XL2O35Gs53AKgwVjlqhKBXmU5RK0/N1qmQ8h7bn4+Dgm4fguH/nDOEx63rpdXh50ZJgbckzvlWp65XCscQ+Z90pb/bzQAYUI5YPYyk20I93Q8IjMbbafY+FumPz2rofTi71XKY3kDqTc0uBkqjYSUfFMUKxgw1NrzD+Wbnnu2IM+Qd4VS0LEDgJPgKfQ7ibiPABUBtu3G+7MUdxJwAkJmmQoJaL1guZuZ05cbqVsGknyIqlaio4CV14KH5qn4pmkuDfSxtqzn9mhCN+TzF0t4TaR8ogb3/yo30guRPtF+g5KYFVA2UDcRWPUEzW14M0OZ3fHminXd6FGdr5AvpJFRrKwXRhN3HGAgFUI0Kz+1aaiktbCubMvxjbQen+JdPvxDhRzgIgdUC5WTRnTMOZEM6XsqjihAbcx04mA92SCnBZNJtBpRioadBJLj6D4Dd/wEDbmI9KaZM56h8czAAAAAAAAAA",Dl=({name:e,handleClick:t})=>a.jsx("button",{onClick:t,className:F("ecr-button ecr-button--sm",e==="add"?"ecr-button--primary":"ecr-button--danger"),children:e}),S0=({handleLinks:e,taggedProducts:t,products:r,isSearching:n,isLoading:o,lastProductElementRef:i,searchTerm:s,setSearchTerm:l,error:d})=>{const[c,u]=y.useState(t.map(f=>f.product_id)),[p,m]=y.useState(!1),g=f=>{m(!1),u(h=>h.includes(f.id)?h.filter(v=>v!==f.id):[f.id])},b=f=>{if(f.preventDefault(),c.length===0){m(!0);return}const h=new Set(c),v=[];for(const _ of r)h.has(_.id)&&v.push({btn_type:"product",btn_uuid:mo(),buttonText:_.name,buttonUrl:_.permalink,rating:_.average_rating,price:_.price_html,thumbnail:_.images?.[0]?.thumbnail||_.images?.[0]?.src||wn,product_id:_.id});e(v),u([])};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"ecr-admin-product-link__search",children:a.jsx("input",{type:"text",placeholder:"Search products...",value:s,onChange:f=>l(f.target.value),className:"ecr-admin-product-link__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-product-link__list",children:o&&r.length===0?a.jsx(Fl,{}):a.jsxs("div",{className:"ecr-admin-product-link__list-inner",children:[r.length===0?a.jsx("p",{className:"ecr-admin-product-link__empty",children:d||"No products are available to add."}):r.map((f,h)=>{const v=c.includes(f.id);return a.jsx("div",{ref:r.length===h+1?i:null,className:"ecr-admin-product-link__item",style:c.length>0&&!v?{opacity:.5,pointerEvents:"none"}:{},children:a.jsxs(te,{type:"button",onClick:()=>g(f),className:F("ecr-admin-product-link__button",v?"ecr-admin-product-link__button--selected":"ecr-admin-product-link__button--unselected"),children:[v?a.jsx(Gf,{size:20,color:"#2563eb"}):a.jsx(Kf,{size:20,color:"#8c95a9"}),a.jsx("img",{className:"ecr-admin-product-link__thumb",src:f.images?.[0]?.thumbnail||f.images?.[0]?.src||wn,alt:"Product thumbnail"}),a.jsx("span",{children:f.name||`Product #${f.id}`})]})},f.id)}),n&&r.length>0&&a.jsx(Fl,{})]})}),a.jsxs("div",{className:"ecr-admin-product-link__footer",children:[p&&a.jsx("p",{className:"ecr-admin-product-link__error",children:"You did not select any product!"}),a.jsx("div",{className:"ecr-admin-product-link__actions",children:a.jsx(Dl,{name:"add",handleClick:b})})]})]})},Fl=()=>a.jsx("div",{className:"ecr-admin-product-link__loader",children:a.jsx("div",{className:"ecr-admin-product-link__spinner"})}),C0=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i,k0=({handleLinks:e})=>{const[t,r]=y.useState(""),[n,o]=y.useState(""),[i,s]=y.useState(""),[l,d]=y.useState(!0),[c,u]=y.useState(""),[p,m]=y.useState([]),g=()=>{const b=[];t||b.push("text"),n&&C0.test(n)||b.push("url"),i||b.push("campaign"),m(b),!(b.length>0)&&e({btn_type:"custom",btn_uuid:mo(),buttonText:t,buttonUrl:n,openInNewTab:l,campaignName:i,customClass:c,clickCount:0})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx(jn,{error:p.includes("text"),type:"text",name:"buttonText",label:"Button Text",placeholder:"e.g Buy Now",value:t,setValue:r}),p.includes("text")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Button text is required!"})]}),a.jsxs("div",{children:[a.jsx(jn,{error:p.includes("url"),type:"url",name:"url",label:"Url",placeholder:"e.g https://example.com",value:n,setValue:o}),p.includes("url")&&a.jsx("p",{className:"ecr-admin-link__error",children:"A valid url is required!"})]}),a.jsxs("div",{children:[a.jsx(jn,{error:p.includes("campaign"),type:"text",name:"campaignName",label:"Campaign Name",placeholder:"e.g Summer sale",value:i,setValue:s}),p.includes("campaign")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Campaign name is required!"})]}),a.jsxs("div",{className:"ecr-admin-link__toggle",children:[a.jsx("input",{checked:l,onChange:b=>d(b.target.checked),className:"ecr-admin-link__checkbox",type:"checkbox",name:"",id:"newTab"}),a.jsx("label",{className:"ecr-admin-link__toggle-label",htmlFor:"newTab",children:"Open in new tab"})]}),a.jsx("div",{children:a.jsx(jn,{error:p.includes("customClass"),type:"text",name:"customClass",label:"Custom class",placeholder:"custom-class",value:c,setValue:u})}),a.jsx("div",{className:"ecr-admin-link__actions",children:a.jsx(Dl,{name:"add",handleClick:g})})]})};function jn({error:e,type:t,name:r,label:n,placeholder:o,value:i,setValue:s}){return a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"ecr-admin-link__label",htmlFor:r,children:n}),a.jsx("input",{id:r,name:r,type:t,placeholder:o,value:i,onChange:l=>s(l.target.value),className:F("ecr-admin-link__input",e?"ecr-admin-link__input--error":"ecr-admin-link__input--normal")})]})}const N0=({setLinks:e,linkCount:t,linkType:r,links:n})=>{const[o,i]=y.useState(null),[s,l]=y.useState(!1),d=j0({enabled:s}),c=t===0||r==="Link",u=t===0||r==="Product",p=n.filter(g=>g.btn_type==="product"),m=()=>l(!0);return a.jsxs(a.Fragment,{children:[t?a.jsx(vn,{}):null,a.jsx("div",{className:"ecr-admin-link-tabs",children:a.jsxs("div",{className:"ecr-admin-link-tabs__list",children:[c&&a.jsxs(Vo,{open:o==="custom",onOpenChange:g=>i(g?"custom":null),children:[a.jsxs(Wo,{className:"ecr-admin-link-tabs__trigger",children:[a.jsx(Uf,{size:20})," Add Custom Link"]}),a.jsxs(qo,{className:"ecr-admin-link-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Add Custom Link"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(k0,{handleLinks:g=>{e(b=>[...b,g]),i(null)}})})]})]}),u&&a.jsxs(Vo,{open:o==="product",onOpenChange:g=>i(g?"product":null),children:[a.jsxs(Wo,{className:"ecr-admin-link-tabs__trigger",onMouseEnter:m,children:[a.jsx(Yf,{size:20})," Tag Products"]}),a.jsxs(qo,{className:"ecr-admin-link-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Select Products"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(S0,{handleLinks:g=>{e(g),i(null)},taggedProducts:p,products:d.products,isSearching:d.isSearching,isLoading:d.isLoading,lastProductElementRef:d.lastProductElementRef,searchTerm:d.searchTerm,setSearchTerm:d.setSearchTerm,error:d.error})})]})]})]})})]})},E0=({links:e,onLinksChange:t})=>{const r=o=>{t(i=>i.filter(s=>s.btn_uuid!==o))},n=e[0]?.btn_type==="product"?"Product":"Link";return a.jsxs("div",{className:"ecr-admin-links",children:[a.jsx("p",{className:"ecr-admin-links__title",children:`${n}${e.length>1?"s":""}`}),e.length>0?a.jsxs(a.Fragment,{children:[e.map(o=>a.jsxs("div",{className:`ecr-admin-links__item ${o.btn_type==="custom"?o.customClass??"":""}`,children:[a.jsx("span",{children:o.buttonText}),a.jsx(te,{onClick:()=>r(o.btn_uuid),size:"icon-sm",variant:"link",className:"ecr-admin-links__remove",children:a.jsx(Xf,{size:16})})]},o.btn_uuid)),a.jsxs(Rt,{children:[a.jsxs(Lt,{className:"ecr-admin-links__upgrade",children:["+ Add Another ",a.jsx(Jt,{size:20})]}),a.jsx(It,{className:"ecr-admin-links__popover",children:a.jsx(pr,{name:"Multiple Links",text:a.jsx(a.Fragment,{children:"Unlock the ability to add multiple custom links, seamlessly redirecting users to your pages from the videos!"})})})]})]}):a.jsx(N0,{setLinks:t,linkCount:e.length,linkType:n,links:e})]})};function $l(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(e)}const T0=({togglePlayPause:e,isMuted:t,file:r,videoRef:n,onEnded:o})=>{const[i,s]=y.useState(!1);return a.jsx("video",{ref:n,className:F("ecr-admin-reelvideo",i?"ecr-admin-reelvideo--portrait":"ecr-admin-reelvideo--landscape"),src:r?.url,muted:t,onClick:e,autoPlay:!0,draggable:!1,onEnded:o,onLoadedMetadata:l=>{const d=l.currentTarget,c=d.videoWidth,u=d.videoHeight;s(()=>u>c)}})},A0=({index:e,setIsAttemptingDelete:t,file:r,file_uuid:n,dragStart:o,dragEnter:i,dragEnd:s})=>{const[l,d]=y.useState(!0),[c,u]=y.useState(!1),p=y.useRef(null),m=()=>{p.current&&(c?p.current.play():p.current.pause(),u(b=>!b))},g=()=>{p.current&&(p.current.muted=!l,d(b=>!b))};return a.jsxs("div",{draggable:!0,onDragStart:()=>o(e),onDragEnter:()=>i(e),onDragEnd:s,className:F("ecr-admin-customization__panel"),children:[a.jsx($l,{className:"ecr-admin-customization__remove",size:20,onClick:()=>t(n)}),a.jsx(T0,{togglePlayPause:m,isMuted:l,file:r,videoRef:p,onEnded:()=>u(!0)}),a.jsxs("div",{className:"ecr-admin-customization__controls",children:[c?a.jsx(Kn,{size:16,className:"ecr-admin-customization__control",onClick:m}):a.jsx(qn,{size:16,className:"ecr-admin-customization__control",onClick:m}),l?a.jsx(Gn,{size:16,className:"ecr-admin-customization__control",onClick:g}):a.jsx(Yn,{size:16,className:"ecr-admin-customization__control",onClick:g})]})]})},P0=({uploadedFiles:e,setIsAttemptingDelete:t,setUploadedFiles:r})=>{const n=y.useRef(null),o=y.useRef(null),i=d=>{n.current=d},s=d=>{o.current=d},l=()=>{if(n.current===null||o.current===null)return;const d=[...e],c=d[n.current];d.splice(n.current,1),d.splice(o.current,0,c),n.current=null,o.current=null,r(d)};return a.jsxs("div",{className:"ecr-admin-customization",children:[e.map((d,c)=>a.jsx(A0,{setIsAttemptingDelete:t,file:d,file_uuid:d.file_uuid,index:c,dragStart:i,dragEnter:s,dragEnd:l},c)),a.jsxs(Rt,{children:[a.jsxs(Lt,{className:"ecr-admin-customization__add",children:[a.jsx("img",{className:"ecr-admin-customization__icon",src:ts,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-customization__label",children:"Upload another video"}),a.jsx(Jt,{size:20,className:"ecr-admin-customization__lock"})]}),a.jsx(It,{side:"right",className:"ecr-admin-customization__popover",children:a.jsx(pr,{name:"Multiple Videos",text:a.jsxs(a.Fragment,{children:["Unlock the power of ",a.jsx("strong",{children:"Multiple Video"})," uploads, boosting engagement and variety in every Reels!"]})})})]})]})},O0=({thumbnail:e,onThumbnailChange:t})=>a.jsxs("div",{className:"ecr-admin-thumbnail",children:[a.jsx("p",{className:"ecr-admin-thumbnail__title",children:"Thumbnail"}),e?a.jsxs("div",{className:"ecr-admin-thumbnail__preview",children:[a.jsx("img",{src:e,alt:"Thumbnail",className:"ecr-admin-thumbnail__image"}),a.jsx($l,{className:"ecr-admin-thumbnail__remove",size:20,onClick:()=>t(null)})]}):a.jsx(rs,{mode:"thumbnail",usedFor:"image",setThumbnail:t,className:"ecr-admin-thumbnail__uploader"})]}),R0=()=>{const e=Ne(),[t]=Yt(),r=y.useMemo(()=>t.get("sid"),[t]),n=y.useRef(null),[o,i]=y.useState({files:[],title:"",links:[],thumbnail:null}),[s,l]=y.useState(!1),[d,c]=y.useState(null),u=y.useCallback(h=>{i(v=>({...v,title:typeof h=="function"?h(v.title):h}))},[]),p=y.useCallback(h=>{i(v=>({...v,files:typeof h=="function"?h(v.files):h}))},[]),m=y.useCallback(h=>{i(v=>({...v,links:typeof h=="function"?h(v.links):h}))},[]),g=y.useCallback(h=>{i(v=>({...v,thumbnail:typeof h=="function"?h(v.thumbnail):h}))},[]),b=()=>{d&&(p(h=>h.filter(v=>v.file_uuid!==d)),c(null))},f=y.useCallback(async h=>{try{l(!0);const v=await he.get(`story/${h}`);i({title:v.data.title,files:v.data.files,links:v.data.links,thumbnail:v.data.thumbnail})}catch(v){v instanceof Error?K.error(v.message):K.error("Something went wrong. Try again later!"),n.current=setTimeout(()=>e(-1),1e3)}finally{l(!1)}},[e]);return y.useEffect(()=>{r&&f(r)},[r,f]),y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),s?a.jsx(Ir,{}):a.jsxs(a.Fragment,{children:[a.jsx(Nf,{uploadedFiles:o.files,links:o.links,thumbnail:o.thumbnail,storyTitle:o.title,setStoryTitle:u}),a.jsxs("div",{className:"ecr-admin-create",children:[a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--main",children:[a.jsx("p",{className:"ecr-admin-create__title",children:"Select video"}),d&&a.jsx(Rr,{onReject:()=>c(null),onAccept:b,isLoading:!1,message:"Are you sure, You want to remove this file?"}),o.files.length>0?a.jsx(P0,{uploadedFiles:o.files,setUploadedFiles:p,setIsAttemptingDelete:c}):a.jsx(rs,{setUploadedFiles:p})]}),a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--side",children:[a.jsx(O0,{thumbnail:o.thumbnail,onThumbnailChange:g}),a.jsx(vn,{className:"ecr-admin-create__separator"}),a.jsx(E0,{links:o.links,onLinksChange:m})]})]})]})},Bl=({message:e="Something went wrong. Please try again."})=>a.jsxs("div",{className:"ecr-admin-error",children:[a.jsx(lp,{className:"ecr-admin-error__icon"}),a.jsx("p",{className:"ecr-admin-error__text",children:e})]});var Yo,Ul;function L0(){return Ul||(Ul=1,Yo=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||r.forEach(function(o){e.addRange(o)}),t&&t.focus()}}),Yo}var Xo,Hl;function I0(){if(Hl)return Xo;Hl=1;var e=L0(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(i){var s=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return i.replace(/#{\s*key\s*}/g,s)}function o(i,s){var l,d,c,u,p,m,g=!1;s||(s={}),l=s.debug||!1;try{c=e(),u=document.createRange(),p=document.getSelection(),m=document.createElement("span"),m.textContent=i,m.ariaHidden="true",m.style.all="unset",m.style.position="fixed",m.style.top=0,m.style.clip="rect(0, 0, 0, 0)",m.style.whiteSpace="pre",m.style.webkitUserSelect="text",m.style.MozUserSelect="text",m.style.msUserSelect="text",m.style.userSelect="text",m.addEventListener("copy",function(f){if(f.stopPropagation(),s.format)if(f.preventDefault(),typeof f.clipboardData>"u"){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=t[s.format]||t.default;window.clipboardData.setData(h,i)}else f.clipboardData.clearData(),f.clipboardData.setData(s.format,i);s.onCopy&&(f.preventDefault(),s.onCopy(f.clipboardData))}),document.body.appendChild(m),u.selectNodeContents(m),p.addRange(u);var b=document.execCommand("copy");if(!b)throw new Error("copy command was unsuccessful");g=!0}catch(f){l&&console.error("unable to copy using execCommand: ",f),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(s.format||"text",i),s.onCopy&&s.onCopy(window.clipboardData),g=!0}catch(h){l&&console.error("unable to copy using clipboardData: ",h),l&&console.error("falling back to prompt"),d=n("message"in s?s.message:r),window.prompt(d,i)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(u):p.removeAllRanges()),m&&document.body.removeChild(m),c()}return g}return Xo=o,Xo}var z0=I0();const Vl=Cd(z0);function Wl({className:e,...t}){return a.jsx("div",{"data-slot":"table-container",className:"ecr-table__container",children:a.jsx("table",{"data-slot":"table",className:F("ecr-table",e),...t})})}function ql({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:F("ecr-table__header",e),...t})}function Gl({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:F("ecr-table__body",e),...t})}function Sn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:F("ecr-table__row",e),...t})}function Kl({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:F("ecr-table__head",e),...t})}function ze({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:F("ecr-table__cell",e),...t})}function Yl({className:e,...t}){return a.jsx("caption",{"data-slot":"table-caption",className:F("ecr-table__caption",e),...t})}const M0=[{label:"No.",width:80,align:"center"},{label:"Group Name",width:250,align:"start"},{label:"Short Code",align:"start"},{label:"Action",width:150,align:"center"}],D0=({tableData:e,setIsAttemptingDelete:t})=>{const[r,n]=y.useState(null),o=y.useRef(null),i=(s,l)=>{Vl(s),n(l),o.current=setTimeout(()=>{n(null)},700)};return y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(Wl,{className:"ecr-admin-groups__table",children:[!e.length&&a.jsx(Yl,{className:"ecr-admin-groups__caption",children:a.jsxs("div",{className:"ecr-admin-groups__empty",children:[a.jsx(ot,{className:"ecr-admin-groups__empty-icon"}),"You did not create any reel group yet!"]})}),e.length?a.jsxs(a.Fragment,{children:[a.jsx(ql,{children:a.jsx(Sn,{children:M0.map((s,l)=>a.jsx(Kl,{className:"ecr-admin-groups__head",style:{width:s?.width||"auto",textAlign:s?.align},children:s.label},l))})}),a.jsx(Gl,{children:e.map((s,l)=>a.jsxs(Sn,{className:F("ecr-admin-groups__row",l%2===0&&"ecr-admin-groups__row--alt"),children:[a.jsx(ze,{className:"ecr-admin-groups__cell ecr-admin-groups__cell--center ecr-admin-groups__cell--strong",children:l+1}),a.jsx(ze,{children:a.jsx("div",{className:"ecr-admin-groups__name",children:s.group_name})}),a.jsx(ze,{children:a.jsxs("div",{className:"ecr-admin-groups__shortcode",children:[a.jsx("span",{className:"ecr-admin-groups__shortcode-text",children:`[reelswp-group id='${s.id}']`}),a.jsxs("div",{className:"ecr-admin-groups__copy",children:[a.jsx("button",{onClick:()=>i(`[reelswp-group id='${s.id}']`,l),className:"ecr-admin-groups__copy-button",title:"Copy",children:a.jsx(np,{className:"ecr-admin-groups__copy-icon"})}),a.jsx("span",{className:F("ecr-admin-groups__copy-tooltip",r===l&&"ecr-admin-groups__copy-tooltip--visible"),children:"Copied!"})]})]})}),a.jsx(ze,{children:a.jsxs("div",{className:"ecr-admin-groups__actions",children:[a.jsx(te,{title:"Statistics",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(ht,{to:`?view=${X.stat}&group=${s.id}&name=${s.group_name}`,children:a.jsx(ui,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(te,{title:"Update Stories",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(ht,{to:`?view=${X.mg}&gid=${s.id}`,children:a.jsx(Or,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(te,{title:"Delete Group",onClick:()=>t(s.id),variant:"link",size:"icon-sm",className:"ecr-admin-groups__action-button",children:a.jsx(sp,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--danger"})})]})})]},s.id??l))})]}):null]})},Xl=()=>a.jsxs("table",{className:"ecr-admin-groups__skeleton-table",children:[a.jsx("thead",{className:"ecr-admin-groups__skeleton-head",children:a.jsxs("tr",{children:[a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--tiny"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--medium"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--large"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--small"})})]})}),a.jsx("tbody",{children:Array.from({length:5}).map((e,t)=>a.jsxs("tr",{className:t%2===0?"ecr-admin-groups__skeleton-row ecr-admin-groups__skeleton-row--alt":"ecr-admin-groups__skeleton-row",children:[a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--tiny"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--medium"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--large"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell ecr-admin-groups__skeleton-cell--center",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--small"})})]},t))})]}),F0=()=>{const[e,t]=y.useState([]),[r,n]=y.useState(""),[o,i]=y.useState(!1),[s,l]=y.useState(!1),[d,c]=y.useState(!1),[u,p]=y.useState(""),[m,g]=y.useState(1),[b]=y.useState(20),[f,h]=y.useState(0),[v,_]=y.useState(1),w=co(u,500),j=y.useCallback(async E=>{const T=new AbortController,A=E===1;try{A?i(!0):l(!0),n("");const O=await he.get("groups",{params:{page:E,per_page:b,...w&&{q:w}},signal:T.signal}),R=Number(O.headers?.["x-wp-total"]??0),L=Number(O.headers?.["x-wp-totalpages"]??1),P=Math.max(1,L||1);t(M=>{if(A)return O.data;const I=new Set(M.map(z=>z.id)),B=O.data.filter(z=>!I.has(z.id));return[...M,...B]}),h(R),_(P),E>P&&g(P)}catch(O){if(T.signal.aborted)return;O instanceof Error?n(O.message):n("Something went wrong. Try again later!")}finally{T.signal.aborted||(A?i(!1):l(!1))}},[b,w]),C=y.useCallback(()=>{g(E=>o||s||E>=v?E:E+1)},[o,s,v]),N=y.useCallback(async()=>{if(m!==1){g(1);return}await j(1)},[m,j]),k=y.useCallback(async E=>{try{c(!0),await he.delete(`group/${E}`),await N(),K.success("Group deleted successfully!")}catch(T){T instanceof Error?K.error(T.message):K.error("Failed to delete group.")}finally{c(!1)}},[N]);return y.useEffect(()=>{j(m)},[m,j,w]),{groups:e,groupError:r,isLoading:o,isLoadingMore:s,isDeleting:d,searchTerm:u,setSearchTerm:p,perPage:b,total:f,totalPages:v,hasMore:m<=v,loadMore:C,refreshGroups:N,deleteGroup:k}},$0={docs:"https://reelswp.com/docs/"},B0=()=>{const[e,t]=y.useState(null),{groups:r,groupError:n,isLoading:o,isLoadingMore:i,isDeleting:s,deleteGroup:l,hasMore:d,loadMore:c,searchTerm:u,setSearchTerm:p}=F0(),m=y.useRef(null),g=async()=>{e&&(await l(e),t(null))};return y.useEffect(()=>{if(!m.current||!d)return;const b=new IntersectionObserver(f=>{const[h]=f;h.isIntersecting&&c()},{root:null,rootMargin:"200px",threshold:0});return b.observe(m.current),()=>b.disconnect()},[d,c]),a.jsxs(a.Fragment,{children:[a.jsx(vt,{left:[a.jsx(_t,{name:"All Widgets",Icon:cp},"page")],center:[a.jsx(zr,{},"reel-wp")],right:[a.jsxs("a",{href:$0.docs,className:"ecr-admin-docs-link",target:"_blank",children:[a.jsx($f,{size:14}),a.jsx("span",{children:"Documentation"})]},"view-documentation"),a.jsx(Lr,{to:`?view=${X.cr}`,text:"Add Reel",Icon:gt},"add-reel-reel-group")]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-groups",children:[e&&a.jsx(Rr,{onAccept:g,onReject:()=>t(null),isLoading:s}),a.jsxs("div",{className:"ecr-admin-groups__header",children:[a.jsx("h2",{className:"ecr-admin-groups__title",children:"Reel Widgets"}),a.jsxs("div",{className:"ecr-admin-groups_action_wrapper",children:[a.jsxs("div",{className:"ecr-admin-groups-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search widgets...",value:u,onChange:b=>p(b.target.value),className:"ecr-admin-groups-search-input"}),a.jsxs("div",{className:"ecr-admin-groups-header__icon-wrapper",children:[u&&a.jsx(te,{onClick:()=>p(""),variant:"link",size:"icon-sm",children:a.jsx(er,{size:16,className:"ecr-admin-groups-header__clear-icon"})}),a.jsx(ni,{size:16,className:"ecr-admin-groups-header__search-icon"})]})]}),a.jsx(Lr,{to:`?view=${X.mg}`,text:"Create Widget",Icon:gt,className:"ecr-admin-groups__create-button",textColor:"#2563eb"})]})]}),o?a.jsx(Xl,{}):n?a.jsx(Bl,{}):a.jsxs(a.Fragment,{children:[a.jsx(D0,{tableData:r,setIsAttemptingDelete:t}),d&&a.jsx("div",{ref:m,className:"ecr-admin-groups__load-more","aria-live":"polite",children:i?a.jsx(Hf,{className:"ecr-admin-groups__load-more__icon"}):null})]})]})]})},U0=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState({rateLimit:2,timeLimit:1}),[o,i]=y.useState(!1),[s,l]=y.useState(!1),[d,c]=y.useState(!1),u=y.useCallback((m,g)=>{t(!0),n(b=>({...b,[m]:g}))},[]),p=y.useCallback(async()=>{const m=Number(r.rateLimit),g=Number(r.timeLimit);if(!Number.isFinite(m)||!Number.isFinite(g)){K.error("Please enter valid numbers.");return}try{l(!0),c(!1),await he.post("settings",{rate_limit:m,time_limit:g}),K.success("Settings updated successfully."),t(!1)}catch(b){b instanceof Error?K.error(b.message):K.error("Something went wrong. Try again later!"),c(!0)}finally{l(!1)}},[r.rateLimit,r.timeLimit]);return y.useEffect(()=>{const m=new AbortController;return(async()=>{try{i(!0),c(!1);const b=await he.get("settings",{signal:m.signal});n({rateLimit:b.data.rate_limit,timeLimit:b.data.time_limit}),t(!1)}catch(b){if(m.signal.aborted)return;b instanceof Error?K.error(b.message):K.error("Something went wrong. Try again later!"),c(!0)}finally{m.signal.aborted||i(!1)}})(),()=>m.abort()},[]),{limit:r,isEdited:e,isLoading:o,isSaving:s,isError:d,handleOnChange:u,handleSave:p}},H0=()=>{const{limit:e,isEdited:t,isLoading:r,isSaving:n,isError:o,handleOnChange:i,handleSave:s}=U0();return a.jsxs(a.Fragment,{children:[r&&a.jsx(Ir,{}),a.jsx(vt,{left:[a.jsx(_t,{name:"Settings",Icon:Sp},"Settings"),a.jsx(tr,{},"back-settings")],center:[a.jsx(zr,{},"Settings-widget-name")],right:[a.jsx(uo,{onSave:s,isSaving:n,disabled:!t},"save")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Settings"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-card--settings",children:[a.jsx("div",{className:"ecr-admin-card__header",children:a.jsx("h2",{className:"ecr-admin-card__title",children:"ReelsWP Settings"})}),o&&a.jsx("div",{className:"ecr-admin-form__row",children:a.jsx("span",{children:"Unable to load settings. Please try again."})}),a.jsxs("form",{action:"",className:"ecr-admin-form",children:[a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_rate_limit",className:"ecr-admin-form__label",children:"Rate Limit:"}),a.jsx("input",{type:"number",id:"ecommreels_rate_limit",name:"ecommreels_rate_limit",value:e.rateLimit,onChange:l=>i("rateLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]}),a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_time_limit",className:"ecr-admin-form__label",children:"Time Limit (minutes):"}),a.jsx("input",{type:"number",id:"ecommreels_time_limit",name:"ecommreels_time_limit",value:e.timeLimit,onChange:l=>i("timeLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]})]})]})]})},V0=[{label:"No.",width:80,align:"center"},{label:"Story Title",width:150,align:"left"},{label:"Campaign Name",width:150,align:"left"},{label:"Button Text",width:150,align:"left"},{label:"URL",align:"left"},{label:"Click",width:80,align:"center"}],W0=({tableData:e})=>a.jsxs(Wl,{className:"ecr-admin-stats__table",children:[!e.length&&a.jsx(Yl,{className:"ecr-admin-stats__caption",children:a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(ot,{className:"ecr-admin-stats__empty-icon"}),"You did not create any reel group yet!"]})}),a.jsx(ql,{children:a.jsx(Sn,{children:V0.map((t,r)=>a.jsx(Kl,{className:"ecr-admin-stats__head",style:{...t.width&&{width:`${t.width}px`},textAlign:t.align},children:t.label},r))})}),!!e.length&&a.jsx(Gl,{children:e.map((t,r)=>a.jsxs(Sn,{className:F("ecr-admin-stats__row",r%2===0&&"ecr-admin-stats__row--alt"),children:[a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:r+1}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.storyTitle}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.campaignName}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.buttonText}),a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--link",children:a.jsx("a",{href:t.buttonUrl,target:"_blank",rel:"noopener noreferrer",className:"ecr-admin-stats__link",children:t.buttonUrl})}),a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:t.clickCount})]},t.id))})]}),q0=()=>{const[e]=Yt(),t=e.get("group"),r=e.get("name"),[n,o]=y.useState([]),[i,s]=y.useState([]),[l,d]=y.useState(!1),[c,u]=y.useState(!1);y.useEffect(()=>{t&&(async()=>{try{d(!0);const g=await he.get(`/group/${t}/stats`);o(g.data.stories),s(g.data.buttons)}catch(g){g instanceof Error?K.error(g.message):K.error("Something went wrong. Try again later!"),u(!0)}finally{d(!1)}})()},[t]);const p=n.length>0?n.reduce((m,g)=>m+=g.view_count??0,0):0;return a.jsxs(a.Fragment,{children:[a.jsx(vt,{left:[a.jsx(_t,{name:"Statistics",Icon:ui},"Statistics"),a.jsx(tr,{},"Statistics-back")],center:[a.jsx(zr,{},"Statistics-widget-name")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Statistics"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-stats",children:[a.jsxs("div",{className:"ecr-admin-stats__header",children:[a.jsxs("h2",{className:"ecr-admin-stats__title",children:["Group: ",r]}),l?a.jsx("div",{className:"ecr-admin-stats__summary-skeleton"}):a.jsxs("div",{className:"ecr-admin-stats__summary",children:[a.jsx("span",{children:"Total View:"})," ",a.jsx("span",{children:p})]})]}),a.jsx("div",{className:"ecr-admin-stats__body",children:l?a.jsx(Xl,{}):c?a.jsx(Bl,{}):i.length===0?a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(ot,{className:"ecr-admin-stats__empty-icon"}),a.jsx("span",{children:"No Stats available for this group"})]}):a.jsx(W0,{tableData:i})})]})]})};function G0(e){return H({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 3a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2zm-5-1v12H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm1 0h2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-2z"},child:[]}]})(e)}function K0(e){return H({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11 4a4 4 0 0 1 0 8H8a5 5 0 0 0 2-4 5 5 0 0 0-2-4zm-6 8a4 4 0 1 1 0-8 4 4 0 0 1 0 8M0 8a5 5 0 0 0 5 5h6a5 5 0 0 0 0-10H5a5 5 0 0 0-5 5"},child:[]}]})(e)}const Y0=({isExpanded:e,setIsExpanded:t})=>a.jsx("button",{onClick:()=>t(r=>!r),className:F("ecr-admin-side-toggle",e?"ecr-admin-side-toggle--active":""),title:"Side Panel",children:a.jsx(G0,{size:24})}),X0=({...e})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",...e,children:a.jsxs("g",{fill:"none","fill-rule":"evenodd",children:[a.jsx("path",{d:"m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z"}),a.jsx("path",{fill:"currentColor",d:"M16 15c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 1 1 0-2h9.17A3 3 0 0 1 16 15m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2M8 9a3 3 0 0 1 2.762 1.828l.067.172H20a1 1 0 0 1 .117 1.993L20 13h-9.17a3.001 3.001 0 0 1-5.592.172L5.17 13H4a1 1 0 0 1-.117-1.993L4 11h1.17A3 3 0 0 1 8 9m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2m8-8c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 0 1 0-2h9.17A3 3 0 0 1 16 3m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2"})]})}),Jo=y.forwardRef(({className:e,type:t,...r},n)=>a.jsx(W.input,{ref:n,type:t,"data-slot":"input",className:F("ecr-input",e),...r}));Jo.displayName="Input";const Zo=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:d})=>{const[c,u]=y.useState(n),p=y.useRef(null);y.useEffect(()=>{u(n)},[n]);const m=b=>{const f=Math.min(r,Math.max(t,Number(b)));o(f)},g=b=>{const f=Number(b);u(f),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{m(f>r?r:f<t?t:f)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":"]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!d&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:b=>{const f=Number(b.target.value);u(f),m(f)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(Jo,{type:"number",min:t,max:r,value:c,onChange:b=>g(b.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})};function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},D.apply(null,arguments)}function Be(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var zt=255,Je=100,mr=e=>{var{r:t,g:r,b:n,a:o}=e,i=Math.max(t,r,n),s=i-Math.min(t,r,n),l=s?i===t?(r-n)/s:i===r?2+(n-t)/s:4+(t-r)/s:0;return{h:60*(l<0?l+6:l),s:i?s/i*Je:0,v:i/zt*Je,a:o}},Jl=e=>{var{h:t,s:r,l:n,a:o}=Zl(e);return"hsla("+t+", "+r+"%, "+n+"%, "+o+")"},Zl=e=>{var{h:t,s:r,v:n,a:o}=e,i=(200-r)*n/Je;return{h:t,s:i>0&&i<200?r*n/Je/(i<=Je?i:200-i)*Je:0,l:i/2,a:o}},Ql=e=>{var{r:t,g:r,b:n}=e,o=t<<16|r<<8|n;return"#"+(i=>new Array(7-i.length).join("0")+i)(o.toString(16))},J0=e=>{var{r:t,g:r,b:n,a:o}=e,i=typeof o=="number"&&(o*255|256).toString(16).slice(1);return""+Ql({r:t,g:r,b:n})+(i||"")},fr=e=>mr(Z0(e)),Z0=e=>{var t=e.replace("#","");/^#?/.test(e)&&t.length===3&&(e="#"+t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var r=new RegExp("[A-Za-z0-9]{2}","g"),[n,o,i=0,s]=e.match(r).map(l=>parseInt(l,16));return{r:n,g:o,b:i,a:(s??255)/zt}},Cn=e=>{var{h:t,s:r,v:n,a:o}=e,i=t/60,s=r/Je,l=n/Je,d=Math.floor(i)%6,c=i-Math.floor(i),u=zt*l*(1-s),p=zt*l*(1-s*c),m=zt*l*(1-s*(1-c));l*=zt;var g={};switch(d){case 0:g.r=l,g.g=m,g.b=u;break;case 1:g.r=p,g.g=l,g.b=u;break;case 2:g.r=u,g.g=l,g.b=m;break;case 3:g.r=u,g.g=p,g.b=l;break;case 4:g.r=m,g.g=u,g.b=l;break;case 5:g.r=l,g.g=u,g.b=p;break}return g.r=Math.round(g.r),g.g=Math.round(g.g),g.b=Math.round(g.b),D({},g,{a:o})},Q0=e=>{var{r:t,g:r,b:n,a:o}=Cn(e);return"rgba("+t+", "+r+", "+n+", "+o+")"},eb=e=>{var{r:t,g:r,b:n}=e;return{r:t,g:r,b:n}},tb=e=>{var{h:t,s:r,l:n}=e;return{h:t,s:r,l:n}},Qo=e=>Ql(Cn(e)),rb=e=>{var{h:t,s:r,v:n}=e;return{h:t,s:r,v:n}},nb=e=>{var{r:t,g:r,b:n}=e,o=function(u){return u<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)},i=o(t/255),s=o(r/255),l=o(n/255),d={};return d.x=i*.4124+s*.3576+l*.1805,d.y=i*.2126+s*.7152+l*.0722,d.bri=i*.0193+s*.1192+l*.9505,d},Mt=e=>{var t,r,n,o,i,s,l,d,c;return typeof e=="string"&&ea(e)?(s=fr(e),d=e):typeof e!="string"&&(s=e),s&&(n=rb(s),i=Zl(s),o=Cn(s),c=J0(o),d=Qo(s),r=tb(i),t=eb(o),l=nb(t)),{rgb:t,hsl:r,hsv:n,rgba:o,hsla:i,hsva:s,hex:d,hexa:c,xy:l}},ea=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e);function ec(e){var t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useCallback((r,n)=>t.current&&t.current(r,n),[])}var hr=e=>"touches"in e,tc=e=>{!hr(e)&&e.preventDefault&&e.preventDefault()},rc=function(t,r,n){return r===void 0&&(r=0),n===void 0&&(n=1),t>n?n:t<r?r:t},nc=(e,t)=>{var r=e.getBoundingClientRect(),n=hr(t)?t.touches[0]:t;return{left:rc((n.pageX-(r.left+window.pageXOffset))/r.width),top:rc((n.pageY-(r.top+window.pageYOffset))/r.height),width:r.width,height:r.height,x:n.pageX-(r.left+window.pageXOffset),y:n.pageY-(r.top+window.pageYOffset)}},ob=["prefixCls","className","onMove","onDown"],ta=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-interactive",className:n,onMove:o,onDown:i}=e,s=Be(e,ob),l=y.useRef(null),d=y.useRef(!1),[c,u]=y.useState(!1),p=ec(o),m=ec(i),g=_=>d.current&&!hr(_)?!1:(d.current=hr(_),!0),b=y.useCallback(_=>{if(tc(_),!!l.current){var w=hr(_)?_.touches.length>0:_.buttons>0;if(!w){u(!1);return}p?.(nc(l.current,_),_)}},[p]),f=y.useCallback(()=>u(!1),[]),h=y.useCallback(_=>{_?(window.addEventListener(d.current?"touchmove":"mousemove",b),window.addEventListener(d.current?"touchend":"mouseup",f)):(window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",f),window.removeEventListener("touchmove",b),window.removeEventListener("touchend",f))},[b,f]);y.useEffect(()=>(h(c),()=>{h(!1)}),[c,b,f,h]);var v=y.useCallback(_=>{var w=document.activeElement;w?.blur(),tc(_.nativeEvent),g(_.nativeEvent)&&l.current&&(m?.(nc(l.current,_.nativeEvent),_.nativeEvent),u(!0))},[m]);return a.jsx("div",D({},s,{className:[r,n||""].filter(Boolean).join(" "),style:D({},s.style,{touchAction:"none"}),ref:l,tabIndex:0,onMouseDown:v,onTouchStart:v}))});ta.displayName="Interactive";var ab=e=>{var{className:t,color:r,left:n,top:o,prefixCls:i}=e,s={position:"absolute",top:o,left:n},l={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:r};return y.useMemo(()=>a.jsx("div",{className:i+"-pointer "+(t||""),style:s,children:a.jsx("div",{className:i+"-fill",style:l})}),[o,n,r,t,i])},ib=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],oc=y.forwardRef((e,t)=>{var r,{prefixCls:n="w-color-saturation",radius:o=0,pointer:i,className:s,hue:l=0,style:d,hsva:c,onChange:u}=e,p=Be(e,ib),m=D({width:200,height:200,borderRadius:o},d,{position:"relative"}),g=(v,_)=>{u&&c&&u({h:c.h,s:v.left*100,v:(1-v.top)*100,a:c.a})},b=y.useCallback(v=>{if(!(!c||!u)){var _=1,w=c.s,j=c.v,C=!1;switch(v.key){case"ArrowLeft":w=Math.max(0,c.s-_),C=!0,v.preventDefault();break;case"ArrowRight":w=Math.min(100,c.s+_),C=!0,v.preventDefault();break;case"ArrowUp":j=Math.min(100,c.v+_),C=!0,v.preventDefault();break;case"ArrowDown":j=Math.max(0,c.v-_),C=!0,v.preventDefault();break;default:return}C&&u({h:c.h,s:w,v:j,a:c.a})}},[c,u]),f=y.useMemo(()=>{if(!c)return null;var v={top:100-c.v+"%",left:c.s+"%",color:Jl(c)};return i&&typeof i=="function"?i(D({prefixCls:n},v)):a.jsx(ab,D({prefixCls:n},v))},[c,i,n]),h=y.useCallback(v=>{v.target.focus()},[]);return a.jsx(ta,D({className:[n,s||""].filter(Boolean).join(" ")},p,{style:D({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+((r=c?.h)!=null?r:l)+", 100%, 50%))"},m,{outline:"none"}),ref:t,onMove:g,onDown:g,onKeyDown:b,onClick:h,children:f}))});oc.displayName="Saturation";var sb=["className","prefixCls","left","top","style","fillProps"],lb=e=>{var{className:t,prefixCls:r,left:n,top:o,style:i,fillProps:s}=e,l=Be(e,sb),d=D({},i,{position:"absolute",left:n,top:o}),c=D({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},s?.style,{transform:n?"translate(-9px, -1px)":"translate(-1px, -9px)"});return a.jsx("div",D({className:r+"-pointer "+(t||""),style:d},l,{children:a.jsx("div",D({className:r+"-fill"},s,{style:c}))}))},cb=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],db="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",kn=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-alpha",className:n,hsva:o,background:i,bgProps:s={},innerProps:l={},pointerProps:d={},radius:c=0,width:u,height:p=16,direction:m="horizontal",style:g,onChange:b,pointer:f}=e,h=Be(e,cb),v=T=>{b&&b(D({},o,{a:m==="horizontal"?T.left:T.top}),T)},_=Jl(Object.assign({},o,{a:1})),w="linear-gradient(to "+(m==="horizontal"?"right":"bottom")+", rgba(244, 67, 54, 0) 0%, "+_+" 100%)",j={};m==="horizontal"?j.left=o.a*100+"%":j.top=o.a*100+"%";var C=D({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:c,background:"url("+db+") left center",backgroundColor:"var(--alpha-background-color)"},{width:u,height:p},g,{position:"relative"}),N=y.useCallback(T=>{var A=.01,O=o.a,R=O;switch(T.key){case"ArrowLeft":m==="horizontal"&&(R=Math.max(0,O-A),T.preventDefault());break;case"ArrowRight":m==="horizontal"&&(R=Math.min(1,O+A),T.preventDefault());break;case"ArrowUp":m==="vertical"&&(R=Math.max(0,O-A),T.preventDefault());break;case"ArrowDown":m==="vertical"&&(R=Math.min(1,O+A),T.preventDefault());break;default:return}if(R!==O){var L={left:m==="horizontal"?R:o.a,top:m==="vertical"?R:o.a,width:0,height:0,x:0,y:0};b&&b(D({},o,{a:R}),L)}},[o,m,b]),k=y.useCallback(T=>{T.target.focus()},[]),E=f&&typeof f=="function"?f(D({prefixCls:r},d,j)):a.jsx(lb,D({},d,{prefixCls:r},j));return a.jsxs("div",D({},h,{className:[r,r+"-"+m,n||""].filter(Boolean).join(" "),style:C,ref:t,children:[a.jsx("div",D({},s,{style:D({inset:0,position:"absolute",background:i||w,borderRadius:c},s.style)})),a.jsx(ta,D({},l,{style:D({},l.style,{inset:0,zIndex:1,position:"absolute",outline:"none"}),onMove:v,onDown:v,onClick:k,onKeyDown:N,children:E}))]}))});kn.displayName="Alpha";var ub=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur","renderInput"],pb=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e),mb=e=>Number(String(e).replace(/%/g,"")),Dt=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input",placement:n="bottom",label:o,value:i,className:s,style:l,labelStyle:d,inputStyle:c,onChange:u,onBlur:p,renderInput:m}=e,g=Be(e,ub),[b,f]=y.useState(i),h=y.useRef(!1);y.useEffect(()=>{e.value!==b&&(h.current||f(e.value))},[e.value]);function v(k,E){var T=(E||k.target.value).trim().replace(/^#/,"");pb(T)&&u&&u(k,T);var A=mb(T);isNaN(A)||u&&u(k,A),f(T)}function _(k){h.current=!1,f(e.value),p&&p(k)}var w={};n==="bottom"&&(w.flexDirection="column"),n==="top"&&(w.flexDirection="column-reverse"),n==="left"&&(w.flexDirection="row-reverse");var j=D({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},w,l),C=D({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},c),N=D({value:b,onChange:v,onBlur:_,autoComplete:"off",onFocus:()=>h.current=!0},g,{style:C,onFocusCapture:k=>{var E=k.target;E.setSelectionRange(E.value.length,E.value.length)}});return a.jsxs("div",{className:[r,s||""].filter(Boolean).join(" "),style:j,children:[m?m(N,t):a.jsx("input",D({ref:t},N)),o&&a.jsx("span",{style:D({color:"var(--editable-input-label-color)",textTransform:"capitalize"},d),children:o})]})});Dt.displayName="EditableInput";var fb=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],ac=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input-rgba",hsva:n,placement:o="bottom",rProps:i={},gProps:s={},bProps:l={},aProps:d={},className:c,style:u,onChange:p}=e,m=Be(e,fb),g=n?Cn(n):{};function b(_){var w=Number(_.target.value);w&&w>255&&(_.target.value="255"),w&&w<0&&(_.target.value="0")}var f=_=>{var w=Number(_.target.value);w&&w>100&&(_.target.value="100"),w&&w<0&&(_.target.value="0")},h=(_,w,j)=>{typeof _=="number"&&(w==="a"&&(_<0&&(_=0),_>100&&(_=100),p&&p(Mt(mr(D({},g,{a:_/100}))))),_>255&&(_=255,j.target.value="255"),_<0&&(_=0,j.target.value="0"),w==="r"&&p&&p(Mt(mr(D({},g,{r:_})))),w==="g"&&p&&p(Mt(mr(D({},g,{g:_})))),w==="b"&&p&&p(Mt(mr(D({},g,{b:_})))))},v=g.a?Math.round(g.a*100)/100:0;return a.jsxs("div",D({ref:t,className:[r,c||""].filter(Boolean).join(" ")},m,{style:D({fontSize:11,display:"flex"},u),children:[a.jsx(Dt,D({label:"R",value:g.r||0,onBlur:b,placement:o,onChange:(_,w)=>h(w,"r",_)},i,{style:D({},i.style)})),a.jsx(Dt,D({label:"G",value:g.g||0,onBlur:b,placement:o,onChange:(_,w)=>h(w,"g",_)},s,{style:D({marginLeft:5},i.style)})),a.jsx(Dt,D({label:"B",value:g.b||0,onBlur:b,placement:o,onChange:(_,w)=>h(w,"b",_)},l,{style:D({marginLeft:5},l.style)})),d&&a.jsx(Dt,D({label:"A",value:parseInt(String(v*100),10),onBlur:f,placement:o,onChange:(_,w)=>h(w,"a",_)},d,{style:D({marginLeft:5},d.style)}))]}))});ac.displayName="EditableInputRGBA";var hb=["prefixCls","className","hue","onChange","direction"],ic=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-hue",className:n,hue:o=0,onChange:i,direction:s="horizontal"}=e,l=Be(e,hb);return a.jsx(kn,D({ref:t,className:r+" "+(n||"")},l,{direction:s,background:"linear-gradient(to "+(s==="horizontal"?"right":"bottom")+", rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)",hsva:{h:o,s:100,v:100,a:o/360},onChange:(d,c)=>{i&&i({h:s==="horizontal"?360*c.left:360*c.top})}}))});ic.displayName="Hue";var gb=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],sc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-swatch",className:n,color:o,colors:i=[],style:s,rectProps:l={},onChange:d,addonAfter:c,addonBefore:u,rectRender:p}=e,m=Be(e,gb),g=D({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},l.style),b=(f,h)=>{d&&d(fr(f),Mt(fr(f)),h)};return a.jsxs("div",D({ref:t},m,{className:[r,n||""].filter(Boolean).join(" "),style:D({display:"flex",flexWrap:"wrap",position:"relative"},s),children:[u&&y.isValidElement(u)&&u,i&&Array.isArray(i)&&i.map((f,h)=>{var v="",_="";typeof f=="string"&&(v=f,_=f),typeof f=="object"&&f.color&&(v=f.title||f.color,_=f.color);var w=o&&o.toLocaleLowerCase()===_.toLocaleLowerCase(),j=p&&p({title:v,color:_,checked:!!w,style:D({},g,{background:_}),onClick:N=>b(_,N)});if(j)return a.jsx(y.Fragment,{children:j},h);var C=l.children&&y.isValidElement(l.children)?y.cloneElement(l.children,{color:_,checked:w}):null;return a.jsx("div",D({tabIndex:0,title:v,onClick:N=>b(_,N)},l,{children:C,style:D({},g,{background:_})}),h)}),c&&y.isValidElement(c)&&c]}))});sc.displayName="Swatch";var xb=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],bb=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],lc=e=>a.jsx("div",{style:{boxShadow:"rgb(0 0 0 / 60%) 0px 0px 2px",width:4,top:1,bottom:1,left:e.left,borderRadius:1,position:"absolute",backgroundColor:"#fff"}}),cc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-sketch",className:n,onChange:o,width:i=218,presetColors:s=bb,color:l,editableDisable:d=!0,disableAlpha:c=!1,style:u}=e,p=Be(e,xb),[m,g]=y.useState({h:209,s:36,v:90,a:1});y.useEffect(()=>{typeof l=="string"&&ea(l)&&g(fr(l)),typeof l=="object"&&g(l)},[l]);var b=N=>{g(N),o&&o(Mt(N))},f=(N,k)=>{typeof N=="string"&&ea(N)&&/(3|6)/.test(String(N.length))&&b(fr(N))},h=N=>b(D({},m,{a:N.a})),v=N=>b(D({},m,N,{a:m.a})),_=D({"--sketch-background":"rgb(255, 255, 255)","--sketch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px, rgb(0 0 0 / 15%) 0px 8px 16px","--sketch-swatch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset","--sketch-alpha-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset, rgb(0 0 0 / 25%) 0px 0px 4px inset","--sketch-swatch-border-top":"1px solid rgb(238, 238, 238)",background:"var(--sketch-background)",borderRadius:4,boxShadow:"var(--sketch-box-shadow)",width:i},u),w={borderRadius:2,background:Q0(m),boxShadow:"var(--sketch-alpha-box-shadow)"},j={borderTop:"var(--sketch-swatch-border-top)",paddingTop:10,paddingLeft:10},C={marginRight:10,marginBottom:10,borderRadius:3,boxShadow:"var(--sketch-swatch-box-shadow)"};return a.jsxs("div",D({},p,{className:r+" "+(n||""),ref:t,style:_,children:[a.jsxs("div",{style:{padding:"10px 10px 8px"},children:[a.jsx(oc,{hsva:m,style:{width:"auto",height:150},onChange:v}),a.jsxs("div",{style:{display:"flex",marginTop:4},children:[a.jsxs("div",{style:{flex:1},children:[a.jsx(ic,{width:"auto",height:10,hue:m.h,pointer:lc,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:N=>b(D({},m,N))}),!c&&a.jsx(kn,{width:"auto",height:10,hsva:m,pointer:lc,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:h})]}),!c&&a.jsx(kn,{width:24,height:24,hsva:m,radius:2,style:{marginLeft:4},bgProps:{style:{background:"transparent"}},innerProps:{style:w},pointer:()=>a.jsx(y.Fragment,{})})]})]}),d&&a.jsxs("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[a.jsx(Dt,{label:"Hex",value:Qo(m).replace(/^#/,"").toLocaleUpperCase(),onChange:(N,k)=>f(k),style:{minWidth:58}}),a.jsx(ac,{hsva:m,style:{marginLeft:6},aProps:c?!1:{},onChange:N=>b(N.hsva)})]}),s&&s.length>0&&a.jsx(sc,{style:j,colors:s,color:Qo(m),onChange:N=>b(N),rectProps:{style:C}})]}))});cc.displayName="Sketch";const dc=({selectedColor:e,handleColor:t,text:r,wrapperStyles:n})=>a.jsxs("div",{style:n,className:"ecr-admin-control",children:[a.jsxs("p",{className:"ecr-admin-control__label",children:[r,":"]}),a.jsxs("div",{className:"ecr-admin-control__row ecr-admin-control__row--color",children:[a.jsxs(Rt,{children:[a.jsx(Lt,{style:{padding:0,backgroundColor:"transparent"},children:a.jsx("div",{style:{backgroundColor:e},className:"ecr-admin-control__swatch"})}),a.jsx(It,{className:"ecr-admin-popover ecr-admin-color-selector-popover",children:a.jsx(cc,{color:e,disableAlpha:!0,onChange:o=>{t(o.hex)}})})]}),a.jsx("input",{className:"ecr-admin-control__hex",type:"text",value:e,onChange:o=>t(o.target.value)})]})]}),vb=[{value:"left",title:"Align Left",Icon:$p},{value:"center",title:"Align Center",Icon:Bp},{value:"right",title:"Align Right",Icon:Up},{value:"hidden",title:"Hidden",Icon:Hp}],_b=({alignment:e,handleWidgetTitleAlignment:t})=>a.jsxs("div",{className:"ecr-admin-group-title_alignment",children:[a.jsx("p",{className:"ecr-admin-group-title_alignment-label",children:"Alignment:"}),a.jsx("div",{className:"ecr-admin-group-title_alignment-options",children:vb.map(({value:r,title:n,Icon:o})=>a.jsx(te,{onClick:()=>t(r),style:{width:40,...e===r?{backgroundColor:"#2563eb",color:"#fff"}:{}},size:"icon-sm",variant:"ghost",title:n,children:a.jsx(o,{size:18})},r))})]}),yb=({styles:e,setStyles:t,setIsEdited:r})=>{const n=o=>{t(i=>{const s=o(i);return r(!0),s})};return a.jsxs("div",{className:"ecr-admin-group-title-customization__content",children:[a.jsx(_b,{alignment:e.widgetTitle?.alignment??"hidden",handleWidgetTitleAlignment:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,alignment:o}}))}),a.jsx(dc,{selectedColor:e.widgetTitle?.color??"#000000",handleColor:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,color:o}})),text:"Title Color",wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}}),a.jsx(Zo,{label:"Font size",min:10,max:200,value:e?.widgetTitle?.fontSize??24,onChange:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,fontSize:o}})),name:"font_size",id:"font-size",hideSlider:!0,wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}})]})},wb=(e=700)=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useCallback(i=>{Vl(i),r(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r(!1)},e)},[e]);return y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),[t,o]},jb=({gid:e})=>{const[t,r]=wb(),n=`[reelswp-group id='${e}']`;return a.jsxs("div",{className:"ecr-admin-shortcode",children:[a.jsx("span",{className:"ecr-admin-shortcode__badge",children:n}),a.jsxs("div",{className:"ecr-admin-shortcode__copy",children:[a.jsx("button",{onClick:()=>r(n),className:"ecr-admin-shortcode__button",title:"Copy",children:a.jsx(Ff,{color:"#ffffff",size:12})}),a.jsx("span",{className:F("ecr-admin-shortcode__tooltip",t?"ecr-admin-shortcode__tooltip--visible":"ecr-admin-shortcode__tooltip--hidden"),children:"Copied!"})]})]})},uc=y.createContext({requestLeave:e=>e()}),Sb=({value:e,children:t})=>a.jsx(uc.Provider,{value:e,children:t}),pc=()=>y.useContext(uc);function Cb(e){return H({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"},child:[]}]})(e)}const kb=({link:e,usedFor:t})=>a.jsx("div",{className:"ecr-product-card-one",style:{width:"100%"},children:a.jsx(Nb,{link:e,usedFor:t})}),Nb=({link:e,usedFor:t})=>a.jsx(a.Fragment,{children:a.jsxs("div",{className:"ecr-product-card-one-content-wrapper",children:[t==="admin"?a.jsx("img",{className:"ecr-product-card-one__thumb",src:e.thumbnail||wn,alt:"Product thumbnail"}):a.jsx("a",{href:e.buttonUrl,target:"_blank",draggable:!1,children:a.jsx("img",{className:"ecr-product-card-one__thumb",src:e.thumbnail||wn,alt:"Product thumbnail",draggable:!1})}),a.jsxs("div",{className:"ecr-product-card-one__content",children:[t==="admin"?a.jsx("p",{className:"ecr-product-card-one__title",children:e.buttonText}):a.jsx("a",{className:"ecr-product-card-one__title",href:e.buttonUrl,target:"_blank",draggable:!1,children:e.buttonText}),a.jsxs("div",{className:"ecr-product-card-one__meta",children:[Number(e.rating)>0?a.jsxs("span",{className:"ecr-product-card-one__rating",children:[a.jsx(Cb,{className:"ecr-product-card-one__star"}),e.rating]}):null,a.jsx("div",{className:"ecr-product-card-one__price",dangerouslySetInnerHTML:{__html:e.price}})]})]})]})}),Eb=({link:e,usedFor:t})=>{const r=t==="admin";return a.jsx("div",{style:{width:"100%"},className:"ecr-thumb__link-wrapper",children:a.jsx("a",{href:r?void 0:e.buttonUrl,target:r?void 0:"_blank",rel:r?void 0:"noopener noreferrer",className:`ecr-thumb__link ${e.customClass??""}`,onClick:r?n=>n.preventDefault():void 0,"aria-disabled":r,tabIndex:r?-1:void 0,draggable:!1,children:e.buttonText})})},Nn=({link:e,usedFor:t,style:r})=>a.jsx("div",{className:"ecr-admin-reelitem-links",style:r,children:e.btn_type==="product"?a.jsx(kb,{link:e,usedFor:t},e.btn_uuid):a.jsx(Eb,{link:e,usedFor:t},e.btn_uuid)}),Ft=({title:e,styles:t})=>a.jsx("p",{className:"ecr-reel_title",style:t,children:e}),mc=({reel:e,styles:t,gid:r,togglingId:n,onRemove:o})=>{const i=Ne(),{requestLeave:s}=pc(),l=n===e.story_uuid,d=`?view=${X.cr}&from=${X.mg}&sid=${e.id}${r?`&gid=${r}`:""}`,c=t.appearance??"overlay",u={border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t?.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},p=t.border.border_radius,m=p>50?p+16:p>20?p:0,g=e.links&&e.links.length>0?e.links[0]:null,b=c==="none",f=c==="title",h=t.shape==="rectangle",v=!b&&!f&&g;return a.jsxs("div",{className:F("ecr-admin-reelitem",t?.hoverEffect),children:[a.jsxs("div",{style:u,className:"ecr-admin-reelitem__frame",children:[a.jsx(Jn,{story:e,styles:t}),!b&&!f&&h?v?a.jsx(Nn,{link:g,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Ft,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null,a.jsxs("div",{className:"ecr-admin-reelitem__actions",children:[a.jsx(te,{title:"Edit Story",size:"icon-sm",asChild:!0,className:"ecr-admin-reelitem__button",disabled:l,children:a.jsx(ht,{to:d,className:F("ecr-admin-reelitem__link",l?"ecr-admin-reelitem__link--disabled":"ecr-admin-reelitem__link--active"),onClick:_=>{_.preventDefault(),s(()=>i(d))},children:a.jsx(Or,{className:"ecr-admin-reelitem__icon"})})}),a.jsx(te,{onClick:()=>o(e,"remove"),className:"ecr-admin-reelitem__button ecr-admin-reelitem__button--danger",size:"icon-sm",title:"Remove Story",disabled:l,children:l?a.jsx(rt,{className:"ecr-admin-reelitem__spinner",size:18}):a.jsx(Vn,{size:18})})]})]}),f?a.jsx("p",{className:"ecr-admin-reel__title",children:e.title}):null]})},fc=(e,t)=>{const r=y.useRef(null),n=y.useRef(null),o=y.useRef(null),[i,s]=y.useState(!1),[l,d]=y.useState(!1),[c,u]=y.useState(!1),[p,m]=y.useState(300),g=()=>{const f=r.current;if(!f)return;const h=f.scrollLeft,v=f.scrollWidth,_=f.clientWidth;d(h>0),u(h+_<v-1)};y.useEffect(()=>{const f=r.current,h=n.current;f&&h&&(s(h.scrollWidth>f.clientWidth),m(f.clientWidth-100),g())},[e,t]);const b=f=>{const h=r.current;h&&(h.scrollBy({left:f,behavior:"smooth"}),o.current&&clearTimeout(o.current),o.current=setTimeout(g,300))};return y.useEffect(()=>{const f=r.current;if(!f)return;let h=!1,v,_;const w=A=>{h=!0,v=A.pageX-f.offsetLeft,_=f.scrollLeft,f.style.cursor="grabbing"},j=()=>{h=!1,f.style.cursor="default"},C=()=>{h=!1,f.style.cursor="default"},N=A=>{if(!h)return;A.preventDefault();const R=(A.pageX-f.offsetLeft-v)*1.5;f.scrollLeft=_-R,g()},k=A=>{h=!0,v=A.touches[0].pageX-f.offsetLeft,_=f.scrollLeft},E=()=>{h=!1},T=A=>{if(!h)return;const R=(A.touches[0].pageX-f.offsetLeft-v)*1.5;f.scrollLeft=_-R,g()};return f.addEventListener("mousedown",w),f.addEventListener("mouseleave",j),f.addEventListener("mouseup",C),f.addEventListener("mousemove",N),f.addEventListener("touchstart",k,{passive:!0}),f.addEventListener("touchend",E),f.addEventListener("touchmove",T,{passive:!0}),()=>{f.removeEventListener("mousedown",w),f.removeEventListener("mouseleave",j),f.removeEventListener("mouseup",C),f.removeEventListener("mousemove",N),f.removeEventListener("touchstart",k),f.removeEventListener("touchend",E),f.removeEventListener("touchmove",T)}},[t]),y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{thumbsContainerRef:r,thumbsWrapperRef:n,isOverflowing:i,canScrollLeft:l,canScrollRight:c,scrollBy:b,scrollStep:p}},hc=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:d,canScrollRight:c,scrollBy:u,scrollStep:p}=fc([e],!0);return a.jsxs("div",{className:"ecr-admin-editor-carousel",children:[a.jsx("div",{ref:i,className:"ecr-admin-editor-carousel__viewport",children:a.jsx("div",{ref:s,style:{...!e.length&&{margin:"auto"}},className:F("ecr-admin-editor-carousel__track",t.hoverEffect==="zoom-in"&&"ecr-admin-editor-carousel__track--padded"),children:e.length>0?e.map(m=>a.jsx(mc,{reel:m,styles:t,gid:r,togglingId:n,onRemove:o},m.id)):a.jsx("div",{className:"ecr-admin-editor-carousel__empty",children:a.jsxs("p",{className:"ecr-admin-editor-carousel__empty-text",children:[a.jsx(ot,{className:"ecr-admin-editor-carousel__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})})}),l&&d&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--left",children:a.jsx(Zt,{size:20})}),l&&c&&a.jsx("button",{onClick:()=>u(p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--right",children:a.jsx(Qt,{size:20})})]})},Tb=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>a.jsx("div",{className:F("ecr-admin-editor-grid",t?.hoverEffect==="zoom-in"&&"ecr-admin-editor-grid--padded"),children:e.length>0?e.map(i=>a.jsx(mc,{reel:i,styles:t,gid:r,togglingId:n,onRemove:o},i.id)):a.jsx("div",{className:"ecr-admin-editor-grid__empty",children:a.jsxs("p",{className:"ecr-admin-editor-grid__empty-text",children:[a.jsx(ot,{className:"ecr-admin-editor-grid__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})}),Ab=({reel:e,styles:t})=>{const r=e?.files?.[0],n=!!r?.mime_type?.startsWith("image"),[o,i]=y.useState(!1),[s,l]=y.useState(!0),[d,c]=y.useState(!1),u=y.useRef(null);y.useEffect(()=>{u.current&&(u.current.muted=s)},[s]),y.useEffect(()=>{u.current&&(o?u.current.pause():u.current.play().catch(()=>{}))},[o]);const p=()=>{u.current&&i(f=>!f)},m=()=>{u.current&&l(f=>!f)},g=t?.playerAppearance??"overlay",b=e.links&&e.links.length>0?e.links[0]:null;return a.jsx("div",{className:"ecr-preview-player",children:a.jsxs("div",{className:"ecr-preview-player__stage",children:[a.jsx(xt,{className:"ecr-player__nav--left ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Zt,{size:24})}),a.jsx(xt,{className:"ecr-player__nav--right ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Qt,{size:24})}),a.jsxs("div",{className:"ecr-player__frame",style:{backgroundColor:d?"transparent":"#000"},children:[a.jsx("button",{type:"button",className:"ecr-player__close","aria-label":"Close preview",children:a.jsx(er,{className:"ecr-player__close-icon"})}),r?a.jsx("div",{className:"ecr-player__media-frame",children:n?a.jsx("img",{src:r.url,alt:e?.title||"Reel preview",className:"ecr-preview-player__media-item",loading:"lazy"}):a.jsxs(a.Fragment,{children:[a.jsx("video",{style:{height:d?"100%":"auto"},ref:u,className:"ecr-preview-player__media-item",src:r.url,poster:e?.thumbnail,autoPlay:!0,muted:s,loop:!0,playsInline:!0,onClick:p,onLoadedMetadata:f=>{const h=f.currentTarget,v=h.videoWidth,_=h.videoHeight;c(()=>_>v)}}),a.jsxs("div",{className:"ecr-player__controls",children:[o?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:p}):a.jsx(qn,{size:20,className:"ecr-player__control-icon",onClick:p}),s?a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:m}):a.jsx(Yn,{size:20,className:"ecr-player__control-icon",onClick:m})]})]})}):a.jsx("div",{className:"ecr-preview-player__empty",children:"No preview available"})]}),g==="overlay"?b?a.jsx(Nn,{link:b,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Ft,{title:e.title}):null,g==="title"?a.jsx(Ft,{title:e.title}):null]})})},Pb={carousel:hc,grid:Tb},Ob=({gid:e,reels:t,styles:r,handleRemoveReel:n,togglingId:o,currentTab:i})=>{const s=r.template??"carousel",l=Pb[s]||hc;return a.jsxs("div",{className:"ecr-admin-existing",children:[a.jsxs("div",{className:"ecr-admin-existing__header",children:[a.jsxs("div",{className:"ecr-admin-existing__title-wrapper",children:[a.jsx("p",{className:"ecr-admin-existing__title",children:"Attached videos"}),a.jsx("small",{className:"ecr-admin-existing__subtitle",children:"These reels will be shown in this reel widget"})]}),e&&a.jsx(jb,{gid:e})]}),a.jsx("div",{style:{"--thumbnail-size":`${r?.size}px`,"--thumbnail-size-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},className:"scrollbarThin ecr-admin-existing__body",children:i==="thumbnail"?a.jsx(l,{reels:t,styles:r,gid:e,togglingId:o,handleRemoveReel:n}):t.length>0?a.jsx(Ab,{reel:t[0],styles:r}):a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[a.jsx(ot,{style:{width:"40px",height:"40px",color:"#f59e0b"}}),"No reels available for preview."]})})]})},gc=()=>a.jsx("div",{className:"ecr-admin-reellist__loader",children:a.jsx("div",{className:"ecr-admin-reellist__spinner"})}),Rb=({gid:e,allReels:t,handleSelectReel:r,searchTerm:n,setSearchTerm:o,isSearching:i,togglingId:s,lastStoryElementRef:l})=>{const d=Ne(),{requestLeave:c}=pc(),u=`?view=${X.cr}&from=${X.mg}${e?`&gid=${e}`:""}`,p=t.filter(m=>!m?.files[0]?.mime_type.startsWith("image"));return a.jsxs("div",{className:"ecr-admin-reellist",children:[a.jsxs("div",{className:"ecr-admin-reellist__header",children:[a.jsx("p",{className:"ecr-admin-reellist__title",children:"All reels"}),a.jsx("small",{className:"ecr-admin-reellist__subtitle",children:"Choose reels to attach in this widget"})]}),a.jsxs("div",{className:"ecr-admin-reellist__body",children:[a.jsx(Lr,{to:u,text:"Add Reel",Icon:gt,className:"ecr-admin-reellist__add-button",textColor:"#2563eb",onNavigate:m=>c(()=>d(m))}),a.jsx("div",{className:"ecr-admin-reellist__search",children:a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:m=>o(m.target.value),className:"ecr-admin-reellist__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-reellist__grid",children:i&&t.length===0?a.jsx(gc,{}):a.jsxs("div",{className:"ecr-admin-reellist__items",children:[p.length===0?a.jsx("p",{className:"ecr-admin-reellist__empty",children:"No reels are available to add."}):p.map((m,g)=>a.jsx("div",{ref:p.length===g+1?l:null,className:"ecr-admin-reellist__item",children:a.jsxs("button",{title:"Click to add this reel",onClick:()=>r(m,"add"),disabled:s==m.story_uuid,className:"ecr-admin-reellist__card",children:[a.jsx("div",{className:"ecr-admin-reellist__media",children:a.jsx("video",{className:"ecr-admin-reellist__thumb",src:m?.files[0]?.url,poster:m?.thumbnail})}),a.jsx("span",{className:"ecr-admin-reellist__label",children:m.title||`Reel #${m.id}`}),s==m.story_uuid?a.jsx("div",{className:"ecr-admin-reellist__overlay",children:a.jsx(rt,{className:"ecr-admin-reellist__overlay-icon"})}):null]})},m.id)),i&&t.length>0&&a.jsx(gc,{})]})})]})]})};function xc(e){const t=e+"CollectionProvider",[r,n]=Ve(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=f=>{const{scope:h,children:v}=f,_=y.useRef(null),w=y.useRef(new Map).current;return a.jsx(o,{scope:h,itemMap:w,collectionRef:_,children:v})};s.displayName=t;const l=e+"CollectionSlot",d=nt(l),c=y.forwardRef((f,h)=>{const{scope:v,children:_}=f,w=i(l,v),j=J(h,w.collectionRef);return a.jsx(d,{ref:j,children:_})});c.displayName=l;const u=e+"CollectionItemSlot",p="data-radix-collection-item",m=nt(u),g=y.forwardRef((f,h)=>{const{scope:v,children:_,...w}=f,j=y.useRef(null),C=J(h,j),N=i(u,v);return y.useEffect(()=>(N.itemMap.set(j,{ref:j,...w}),()=>void N.itemMap.delete(j))),a.jsx(m,{[p]:"",ref:C,children:_})});g.displayName=u;function b(f){const h=i(e+"CollectionConsumer",f);return y.useCallback(()=>{const _=h.collectionRef.current;if(!_)return[];const w=Array.from(_.querySelectorAll(`[${p}]`));return Array.from(h.itemMap.values()).sort((N,k)=>w.indexOf(N.ref.current)-w.indexOf(k.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:s,Slot:c,ItemSlot:g},b,n]}var Lb=x.createContext(void 0);function ra(e){const t=x.useContext(Lb);return e||t||"ltr"}var na="rovingFocusGroup.onEntryFocus",Ib={bubbles:!1,cancelable:!0},gr="RovingFocusGroup",[oa,bc,zb]=xc(gr),[Mb,vc]=Ve(gr,[zb]),[Db,Fb]=Mb(gr),_c=x.forwardRef((e,t)=>a.jsx(oa.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(oa.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx($b,{...e,ref:t})})}));_c.displayName=gr;var $b=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:d,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...p}=e,m=x.useRef(null),g=J(t,m),b=ra(i),[f,h]=ct({prop:s,defaultProp:l??null,onChange:d,caller:gr}),[v,_]=x.useState(!1),w=We(c),j=bc(r),C=x.useRef(!1),[N,k]=x.useState(0);return x.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(na,w),()=>E.removeEventListener(na,w)},[w]),a.jsx(Db,{scope:r,orientation:n,dir:b,loop:o,currentTabStopId:f,onItemFocus:x.useCallback(E=>h(E),[h]),onItemShiftTab:x.useCallback(()=>_(!0),[]),onFocusableItemAdd:x.useCallback(()=>k(E=>E+1),[]),onFocusableItemRemove:x.useCallback(()=>k(E=>E-1),[]),children:a.jsx(W.div,{tabIndex:v||N===0?-1:0,"data-orientation":n,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:V(e.onMouseDown,()=>{C.current=!0}),onFocus:V(e.onFocus,E=>{const T=!C.current;if(E.target===E.currentTarget&&T&&!v){const A=new CustomEvent(na,Ib);if(E.currentTarget.dispatchEvent(A),!A.defaultPrevented){const O=j().filter(I=>I.focusable),R=O.find(I=>I.active),L=O.find(I=>I.id===f),M=[R,L,...O].filter(Boolean).map(I=>I.ref.current);jc(M,u)}}C.current=!1}),onBlur:V(e.onBlur,()=>_(!1))})})}),yc="RovingFocusGroupItem",wc=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:i,children:s,...l}=e,d=Ae(),c=i||d,u=Fb(yc,r),p=u.currentTabStopId===c,m=bc(r),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:f}=u;return x.useEffect(()=>{if(n)return g(),()=>b()},[n,g,b]),a.jsx(oa.ItemSlot,{scope:r,id:c,focusable:n,active:o,children:a.jsx(W.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:V(e.onMouseDown,h=>{n?u.onItemFocus(c):h.preventDefault()}),onFocus:V(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:V(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){u.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const v=Hb(h,u.orientation,u.dir);if(v!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let w=m().filter(j=>j.focusable).map(j=>j.ref.current);if(v==="last")w.reverse();else if(v==="prev"||v==="next"){v==="prev"&&w.reverse();const j=w.indexOf(h.currentTarget);w=u.loop?Vb(w,j+1):w.slice(j+1)}setTimeout(()=>jc(w))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:f!=null}):s})})});wc.displayName=yc;var Bb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ub(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Hb(e,t,r){const n=Ub(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Bb[n]}function jc(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function Vb(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Wb=_c,qb=wc,En="Tabs",[Gb]=Ve(En,[vc]),Sc=vc(),[Kb,aa]=Gb(En),Cc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:d="automatic",...c}=e,u=ra(l),[p,m]=ct({prop:n,onChange:o,defaultProp:i??"",caller:En});return a.jsx(Kb,{scope:r,baseId:Ae(),value:p,onValueChange:m,orientation:s,dir:u,activationMode:d,children:a.jsx(W.div,{dir:u,"data-orientation":s,...c,ref:t})})});Cc.displayName=En;var kc="TabsList",Nc=x.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,i=aa(kc,r),s=Sc(r);return a.jsx(Wb,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:n,children:a.jsx(W.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});Nc.displayName=kc;var Ec="TabsTrigger",Tc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...i}=e,s=aa(Ec,r),l=Sc(r),d=Oc(s.baseId,n),c=Rc(s.baseId,n),u=n===s.value;return a.jsx(qb,{asChild:!0,...l,focusable:!o,active:u,children:a.jsx(W.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:d,...i,ref:t,onMouseDown:V(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?s.onValueChange(n):p.preventDefault()}),onKeyDown:V(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&s.onValueChange(n)}),onFocus:V(e.onFocus,()=>{const p=s.activationMode!=="manual";!u&&!o&&p&&s.onValueChange(n)})})})});Tc.displayName=Ec;var Ac="TabsContent",Pc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:i,...s}=e,l=aa(Ac,r),d=Oc(l.baseId,n),c=Rc(l.baseId,n),u=n===l.value,p=x.useRef(u);return x.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(Ye,{present:o||u,children:({present:m})=>a.jsx(W.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":d,hidden:!m,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&i})})});Pc.displayName=Ac;function Oc(e,t){return`${e}-trigger-${t}`}function Rc(e,t){return`${e}-content-${t}`}var Yb=Cc,Xb=Nc,Jb=Tc,Zb=Pc;function Qb({className:e,...t}){return a.jsx(Yb,{"data-slot":"tabs",className:F("ecr-tabs",e),...t})}function ev({className:e,...t}){return a.jsx(Xb,{"data-slot":"tabs-list",className:F("ecr-tabs__list",e),...t})}function Lc({className:e,...t}){return a.jsx(Jb,{"data-slot":"tabs-trigger",className:F("ecr-tabs__trigger",e),...t})}function Ic({className:e,...t}){return a.jsx(Zb,{"data-slot":"tabs-content",className:F("ecr-tabs__content",e),...t})}const xr=({label:e,text:t})=>a.jsxs(Rt,{children:[a.jsx(Lt,{style:{textAlign:"left",padding:0,backgroundColor:"transparent"},children:a.jsxs("label",{className:"ecr-admin-switch",children:[a.jsxs("span",{className:"ecr-admin-switch__label",children:[e,": ",a.jsx(Jt,{size:20})]}),a.jsx(K0,{className:"ecr-admin-switch__icon",size:24})]})}),a.jsx(It,{className:"ecr-admin-popover",children:a.jsx(pr,{name:e,text:t})})]});function zc(e,[t,r]){return Math.min(r,Math.max(t,e))}function tv(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Mc=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),rv="VisuallyHidden",nv=x.forwardRef((e,t)=>a.jsx(W.span,{...e,ref:t,style:{...Mc,...e.style}}));nv.displayName=rv;var ov=[" ","Enter","ArrowUp","ArrowDown"],av=[" ","Enter"],ut="Select",[Tn,An,iv]=xc(ut),[$t]=Ve(ut,[iv,an]),Pn=an(),[sv,Ze]=$t(ut),[lv,cv]=$t(ut),Dc=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:l,onValueChange:d,dir:c,name:u,autoComplete:p,disabled:m,required:g,form:b}=e,f=Pn(t),[h,v]=x.useState(null),[_,w]=x.useState(null),[j,C]=x.useState(!1),N=ra(c),[k,E]=ct({prop:n,defaultProp:o??!1,onChange:i,caller:ut}),[T,A]=ct({prop:s,defaultProp:l,onChange:d,caller:ut}),O=x.useRef(null),R=h?b||!!h.closest("form"):!0,[L,P]=x.useState(new Set),M=Array.from(L).map(I=>I.props.value).join(";");return a.jsx(Gs,{...f,children:a.jsxs(sv,{required:g,scope:t,trigger:h,onTriggerChange:v,valueNode:_,onValueNodeChange:w,valueNodeHasChildren:j,onValueNodeHasChildrenChange:C,contentId:Ae(),value:T,onValueChange:A,open:k,onOpenChange:E,dir:N,triggerPointerDownPosRef:O,disabled:m,children:[a.jsx(Tn.Provider,{scope:t,children:a.jsx(lv,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(I=>{P(B=>new Set(B).add(I))},[]),onNativeOptionRemove:x.useCallback(I=>{P(B=>{const z=new Set(B);return z.delete(I),z})},[]),children:r})}),R?a.jsxs(id,{"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:p,value:T,onChange:I=>A(I.target.value),disabled:m,form:b,children:[T===void 0?a.jsx("option",{value:""}):null,Array.from(L)]},M):null]})})};Dc.displayName=ut;var Fc="SelectTrigger",$c=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=Pn(r),s=Ze(Fc,r),l=s.disabled||n,d=J(t,s.onTriggerChange),c=An(r),u=x.useRef("touch"),[p,m,g]=ld(f=>{const h=c().filter(w=>!w.disabled),v=h.find(w=>w.value===s.value),_=cd(h,f,v);_!==void 0&&s.onValueChange(_.value)}),b=f=>{l||(s.onOpenChange(!0),g()),f&&(s.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return a.jsx(Ro,{asChild:!0,...i,children:a.jsx(W.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":sd(s.value)?"":void 0,...o,ref:d,onClick:V(o.onClick,f=>{f.currentTarget.focus(),u.current!=="mouse"&&b(f)}),onPointerDown:V(o.onPointerDown,f=>{u.current=f.pointerType;const h=f.target;h.hasPointerCapture(f.pointerId)&&h.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&f.pointerType==="mouse"&&(b(f),f.preventDefault())}),onKeyDown:V(o.onKeyDown,f=>{const h=p.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&m(f.key),!(h&&f.key===" ")&&ov.includes(f.key)&&(b(),f.preventDefault())})})})});$c.displayName=Fc;var Bc="SelectValue",Uc=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...l}=e,d=Ze(Bc,r),{onValueNodeHasChildrenChange:c}=d,u=i!==void 0,p=J(t,d.onValueNodeChange);return le(()=>{c(u)},[c,u]),a.jsx(W.span,{...l,ref:p,style:{pointerEvents:"none"},children:sd(d.value)?a.jsx(a.Fragment,{children:s}):i})});Uc.displayName=Bc;var dv="SelectIcon",Hc=x.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return a.jsx(W.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Hc.displayName=dv;var uv="SelectPortal",Vc=e=>a.jsx(sn,{asChild:!0,...e});Vc.displayName=uv;var pt="SelectContent",Wc=x.forwardRef((e,t)=>{const r=Ze(pt,e.__scopeSelect),[n,o]=x.useState();if(le(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?vr.createPortal(a.jsx(qc,{scope:e.__scopeSelect,children:a.jsx(Tn.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(Gc,{...e,ref:t})});Wc.displayName=pt;var ke=10,[qc,Qe]=$t(pt),pv="SelectContentImpl",mv=nt("SelectContent.RemoveScroll"),Gc=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:d,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h,...v}=e,_=Ze(pt,r),[w,j]=x.useState(null),[C,N]=x.useState(null),k=J(t,$=>j($)),[E,T]=x.useState(null),[A,O]=x.useState(null),R=An(r),[L,P]=x.useState(!1),M=x.useRef(!1);x.useEffect(()=>{if(w)return Io(w)},[w]),xo();const I=x.useCallback($=>{const[Y,...oe]=R().map(re=>re.ref.current),[Z]=oe.slice(-1),Q=document.activeElement;for(const re of $)if(re===Q||(re?.scrollIntoView({block:"nearest"}),re===Y&&C&&(C.scrollTop=0),re===Z&&C&&(C.scrollTop=C.scrollHeight),re?.focus(),document.activeElement!==Q))return},[R,C]),B=x.useCallback(()=>I([E,w]),[I,E,w]);x.useEffect(()=>{L&&B()},[L,B]);const{onOpenChange:z,triggerPointerDownPosRef:q}=_;x.useEffect(()=>{if(w){let $={x:0,y:0};const Y=Z=>{$={x:Math.abs(Math.round(Z.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(Z.pageY)-(q.current?.y??0))}},oe=Z=>{$.x<=10&&$.y<=10?Z.preventDefault():w.contains(Z.target)||z(!1),document.removeEventListener("pointermove",Y),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",Y),document.addEventListener("pointerup",oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",oe,{capture:!0})}}},[w,z,q]),x.useEffect(()=>{const $=()=>z(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[z]);const[ae,ie]=ld($=>{const Y=R().filter(Q=>!Q.disabled),oe=Y.find(Q=>Q.ref.current===document.activeElement),Z=cd(Y,$,oe);Z&&setTimeout(()=>Z.ref.current.focus())}),ge=x.useCallback(($,Y,oe)=>{const Z=!M.current&&!oe;(_.value!==void 0&&_.value===Y||Z)&&(T($),Z&&(M.current=!0))},[_.value]),ve=x.useCallback(()=>w?.focus(),[w]),pe=x.useCallback(($,Y,oe)=>{const Z=!M.current&&!oe;(_.value!==void 0&&_.value===Y||Z)&&O($)},[_.value]),G=n==="popper"?ia:Kc,ce=G===ia?{side:l,sideOffset:d,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h}:{};return a.jsx(qc,{scope:r,content:w,viewport:C,onViewportChange:N,itemRefCallback:ge,selectedItem:E,onItemLeave:ve,itemTextRefCallback:pe,focusSelectedItem:B,selectedItemText:A,position:n,isPositioned:L,searchRef:ae,children:a.jsx(gn,{as:mv,allowPinchZoom:!0,children:a.jsx(Kr,{asChild:!0,trapped:_.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:V(o,$=>{_.trigger?.focus({preventScroll:!0}),$.preventDefault()}),children:a.jsx(Gr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:a.jsx(G,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:$=>$.preventDefault(),...v,...ce,onPlaced:()=>P(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:V(v.onKeyDown,$=>{const Y=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!Y&&$.key.length===1&&ie($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let Z=R().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes($.key)&&(Z=Z.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const Q=$.target,re=Z.indexOf(Q);Z=Z.slice(re+1)}setTimeout(()=>I(Z)),$.preventDefault()}})})})})})})});Gc.displayName=pv;var fv="SelectItemAlignedPosition",Kc=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=Ze(pt,r),s=Qe(pt,r),[l,d]=x.useState(null),[c,u]=x.useState(null),p=J(t,k=>u(k)),m=An(r),g=x.useRef(!1),b=x.useRef(!0),{viewport:f,selectedItem:h,selectedItemText:v,focusSelectedItem:_}=s,w=x.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&c&&f&&h&&v){const k=i.trigger.getBoundingClientRect(),E=c.getBoundingClientRect(),T=i.valueNode.getBoundingClientRect(),A=v.getBoundingClientRect();if(i.dir!=="rtl"){const Q=A.left-E.left,re=T.left-Q,_e=k.left-re,mt=k.width+_e,ga=Math.max(mt,E.width),xa=window.innerWidth-ke,ba=zc(re,[ke,Math.max(ke,xa-ga)]);l.style.minWidth=mt+"px",l.style.left=ba+"px"}else{const Q=E.right-A.right,re=window.innerWidth-T.right-Q,_e=window.innerWidth-k.right-re,mt=k.width+_e,ga=Math.max(mt,E.width),xa=window.innerWidth-ke,ba=zc(re,[ke,Math.max(ke,xa-ga)]);l.style.minWidth=mt+"px",l.style.right=ba+"px"}const O=m(),R=window.innerHeight-ke*2,L=f.scrollHeight,P=window.getComputedStyle(c),M=parseInt(P.borderTopWidth,10),I=parseInt(P.paddingTop,10),B=parseInt(P.borderBottomWidth,10),z=parseInt(P.paddingBottom,10),q=M+I+L+z+B,ae=Math.min(h.offsetHeight*5,q),ie=window.getComputedStyle(f),ge=parseInt(ie.paddingTop,10),ve=parseInt(ie.paddingBottom,10),pe=k.top+k.height/2-ke,G=R-pe,ce=h.offsetHeight/2,$=h.offsetTop+ce,Y=M+I+$,oe=q-Y;if(Y<=pe){const Q=O.length>0&&h===O[O.length-1].ref.current;l.style.bottom="0px";const re=c.clientHeight-f.offsetTop-f.offsetHeight,_e=Math.max(G,ce+(Q?ve:0)+re+B),mt=Y+_e;l.style.height=mt+"px"}else{const Q=O.length>0&&h===O[0].ref.current;l.style.top="0px";const _e=Math.max(pe,M+f.offsetTop+(Q?ge:0)+ce)+oe;l.style.height=_e+"px",f.scrollTop=Y-pe+f.offsetTop}l.style.margin=`${ke}px 0`,l.style.minHeight=ae+"px",l.style.maxHeight=R+"px",n?.(),requestAnimationFrame(()=>g.current=!0)}},[m,i.trigger,i.valueNode,l,c,f,h,v,i.dir,n]);le(()=>w(),[w]);const[j,C]=x.useState();le(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const N=x.useCallback(k=>{k&&b.current===!0&&(w(),_?.(),b.current=!1)},[w,_]);return a.jsx(gv,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:N,children:a.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:a.jsx(W.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Kc.displayName=fv;var hv="SelectPopperPosition",ia=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=ke,...i}=e,s=Pn(r);return a.jsx(Ks,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ia.displayName=hv;var[gv,sa]=$t(pt,{}),la="SelectViewport",Yc=x.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=Qe(la,r),s=sa(la,r),l=J(t,i.onViewportChange),d=x.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),a.jsx(Tn.Slot,{scope:r,children:a.jsx(W.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:V(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=s;if(m?.current&&p){const g=Math.abs(d.current-u.scrollTop);if(g>0){const b=window.innerHeight-ke*2,f=parseFloat(p.style.minHeight),h=parseFloat(p.style.height),v=Math.max(f,h);if(v<b){const _=v+g,w=Math.min(b,_),j=_-w;p.style.height=w+"px",p.style.bottom==="0px"&&(u.scrollTop=j>0?j:0,p.style.justifyContent="flex-end")}}}d.current=u.scrollTop})})})]})});Yc.displayName=la;var Xc="SelectGroup",[xv,bv]=$t(Xc),vv=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ae();return a.jsx(xv,{scope:r,id:o,children:a.jsx(W.div,{role:"group","aria-labelledby":o,...n,ref:t})})});vv.displayName=Xc;var Jc="SelectLabel",_v=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=bv(Jc,r);return a.jsx(W.div,{id:o.id,...n,ref:t})});_v.displayName=Jc;var On="SelectItem",[yv,Zc]=$t(On),Qc=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,l=Ze(On,r),d=Qe(On,r),c=l.value===n,[u,p]=x.useState(i??""),[m,g]=x.useState(!1),b=J(t,_=>d.itemRefCallback?.(_,n,o)),f=Ae(),h=x.useRef("touch"),v=()=>{o||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(yv,{scope:r,value:n,disabled:o,textId:f,isSelected:c,onItemTextChange:x.useCallback(_=>{p(w=>w||(_?.textContent??"").trim())},[]),children:a.jsx(Tn.ItemSlot,{scope:r,value:n,disabled:o,textValue:u,children:a.jsx(W.div,{role:"option","aria-labelledby":f,"data-highlighted":m?"":void 0,"aria-selected":c&&m,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:b,onFocus:V(s.onFocus,()=>g(!0)),onBlur:V(s.onBlur,()=>g(!1)),onClick:V(s.onClick,()=>{h.current!=="mouse"&&v()}),onPointerUp:V(s.onPointerUp,()=>{h.current==="mouse"&&v()}),onPointerDown:V(s.onPointerDown,_=>{h.current=_.pointerType}),onPointerMove:V(s.onPointerMove,_=>{h.current=_.pointerType,o?d.onItemLeave?.():h.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:V(s.onPointerLeave,_=>{_.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:V(s.onKeyDown,_=>{d.searchRef?.current!==""&&_.key===" "||(av.includes(_.key)&&v(),_.key===" "&&_.preventDefault())})})})})});Qc.displayName=On;var br="SelectItemText",ed=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=Ze(br,r),l=Qe(br,r),d=Zc(br,r),c=cv(br,r),[u,p]=x.useState(null),m=J(t,v=>p(v),d.onItemTextChange,v=>l.itemTextRefCallback?.(v,d.value,d.disabled)),g=u?.textContent,b=x.useMemo(()=>a.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:f,onNativeOptionRemove:h}=c;return le(()=>(f(b),()=>h(b)),[f,h,b]),a.jsxs(a.Fragment,{children:[a.jsx(W.span,{id:d.textId,...i,ref:m}),d.isSelected&&s.valueNode&&!s.valueNodeHasChildren?vr.createPortal(i.children,s.valueNode):null]})});ed.displayName=br;var td="SelectItemIndicator",rd=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Zc(td,r).isSelected?a.jsx(W.span,{"aria-hidden":!0,...n,ref:t}):null});rd.displayName=td;var ca="SelectScrollUpButton",nd=x.forwardRef((e,t)=>{const r=Qe(ca,e.__scopeSelect),n=sa(ca,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return le(()=>{if(r.viewport&&r.isPositioned){let l=function(){const c=d.scrollTop>0;i(c)};const d=r.viewport;return l(),d.addEventListener("scroll",l),()=>d.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:d}=r;l&&d&&(l.scrollTop=l.scrollTop-d.offsetHeight)}}):null});nd.displayName=ca;var da="SelectScrollDownButton",od=x.forwardRef((e,t)=>{const r=Qe(da,e.__scopeSelect),n=sa(da,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return le(()=>{if(r.viewport&&r.isPositioned){let l=function(){const c=d.scrollHeight-d.clientHeight,u=Math.ceil(d.scrollTop)<c;i(u)};const d=r.viewport;return l(),d.addEventListener("scroll",l),()=>d.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:d}=r;l&&d&&(l.scrollTop=l.scrollTop+d.offsetHeight)}}):null});od.displayName=da;var ad=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=Qe("SelectScrollButton",r),s=x.useRef(null),l=An(r),d=x.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return x.useEffect(()=>()=>d(),[d]),le(()=>{l().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),a.jsx(W.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:V(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:V(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:V(o.onPointerLeave,()=>{d()})})}),wv="SelectSeparator",jv=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(W.div,{"aria-hidden":!0,...n,ref:t})});jv.displayName=wv;var ua="SelectArrow",Sv=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Pn(r),i=Ze(ua,r),s=Qe(ua,r);return i.open&&s.position==="popper"?a.jsx(Ys,{...o,...n,ref:t}):null});Sv.displayName=ua;var Cv="SelectBubbleInput",id=x.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=x.useRef(null),i=J(n,o),s=tv(t);return x.useEffect(()=>{const l=o.current;if(!l)return;const d=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(d,"value").set;if(s!==t&&u){const p=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(p)}},[s,t]),a.jsx(W.select,{...r,style:{...Mc,...r.style},ref:i,defaultValue:t})});id.displayName=Cv;function sd(e){return e===""||e===void 0}function ld(e){const t=We(e),r=x.useRef(""),n=x.useRef(0),o=x.useCallback(s=>{const l=r.current+s;t(l),(function d(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>d(""),1e3))})(l)},[t]),i=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function cd(e,t,r){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=kv(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==r));const d=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return d!==r?d:void 0}function kv(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Nv=Dc,Ev=$c,Tv=Uc,Av=Hc,Pv=Vc,Ov=Wc,Rv=Yc,Lv=Qc,Iv=ed,zv=rd,Mv=nd,Dv=od;function Bt({...e}){return a.jsx(Nv,{"data-slot":"select",...e})}function Ut({...e}){return a.jsx(Tv,{"data-slot":"select-value",...e})}function Ht({className:e,size:t="default",children:r,...n}){return a.jsxs(Ev,{"data-slot":"select-trigger","data-size":t,className:F("ecr-select__trigger",e),...n,children:[r,a.jsx(Av,{asChild:!0,children:a.jsx(fo,{className:"ecr-select__icon"})})]})}function Vt({className:e,children:t,position:r="popper",align:n="center",...o}){const i=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(Pv,{container:i,children:a.jsxs(Ov,{"data-slot":"select-content",className:F("ecr-select__content",e),position:r,align:n,...o,children:[a.jsx(Fv,{}),a.jsx(Rv,{className:F("ecr-select__viewport"),children:t}),a.jsx($v,{})]})})}function Wt({className:e,children:t,...r}){return a.jsxs(Lv,{"data-slot":"select-item",className:F("ecr-select__item",e),...r,children:[a.jsx("span",{className:"ecr-select__check",children:a.jsx(zv,{children:a.jsx(Mf,{className:"ecr-select__check-icon"})})}),a.jsx(Iv,{children:t})]})}function Fv({className:e,...t}){return a.jsx(Mv,{"data-slot":"select-scroll-up-button",className:F("ecr-select__scroll-button",e),...t,children:a.jsx(Df,{className:"ecr-select__icon"})})}function $v({className:e,...t}){return a.jsx(Dv,{"data-slot":"select-scroll-down-button",className:F("ecr-select__scroll-button",e),...t,children:a.jsx(fo,{className:"ecr-select__icon"})})}const Bv=({appearance:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(Bt,{value:e,onValueChange:t,children:[a.jsx(Ht,{className:"ecr-admin-control__trigger",children:a.jsx(Ut,{placeholder:"Layout"})}),a.jsx(Vt,{children:Ku.map(r=>a.jsx(Wt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),Uv={vertical:a.jsx(a.Fragment,{children:"Offer a mobile-first experience with vertical scroll Reels in your widget for better engagement and infinite scrolling!"})};function Hv(){return a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Slide Direction:"}),a.jsxs(Bt,{defaultValue:Za[0].value,children:[a.jsx(Ht,{className:"ecr-admin-control__trigger",children:a.jsx(Ut,{placeholder:"Layout"})}),a.jsxs(Vt,{children:[Za.map(e=>a.jsx(Wt,{value:e.value,className:"ecr-admin-control__option",children:e.label},e.value)),qu.map(e=>a.jsx("div",{children:a.jsxs(Rt,{modal:!0,children:[a.jsxs(Lt,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:e.label}),a.jsx(Jt,{size:18})]}),a.jsx(It,{className:"ecr-admin-control__popover",children:a.jsx(pr,{name:e.label,text:Uv[e.value]})})]})},e.value))]})]})]})}const Vv=({styles:e,updateStyles:t})=>a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(xr,{label:"Disable Preview",text:a.jsx(a.Fragment,{children:"Turn off previews for a cleaner look and a more focused browsing experience!"})}),a.jsx(Hv,{}),a.jsx(Bv,{appearance:e?.playerAppearance??"overlay",handleLinkLayout:r=>t(n=>({...n,playerAppearance:r}))})]});var Rn="Collapsible",[Wv]=Ve(Rn),[qv,pa]=Wv(Rn),dd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:i,onOpenChange:s,...l}=e,[d,c]=ct({prop:n,defaultProp:o??!1,onChange:s,caller:Rn});return a.jsx(qv,{scope:r,disabled:i,contentId:Ae(),open:d,onOpenToggle:x.useCallback(()=>c(u=>!u),[c]),children:a.jsx(W.div,{"data-state":fa(d),"data-disabled":i?"":void 0,...l,ref:t})})});dd.displayName=Rn;var ud="CollapsibleTrigger",pd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=pa(ud,r);return a.jsx(W.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":fa(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:V(e.onClick,o.onOpenToggle)})});pd.displayName=ud;var ma="CollapsibleContent",md=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=pa(ma,e.__scopeCollapsible);return a.jsx(Ye,{present:r||o.open,children:({present:i})=>a.jsx(Gv,{...n,ref:t,present:i})})});md.displayName=ma;var Gv=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...i}=e,s=pa(ma,r),[l,d]=x.useState(n),c=x.useRef(null),u=J(t,c),p=x.useRef(0),m=p.current,g=x.useRef(0),b=g.current,f=s.open||l,h=x.useRef(f),v=x.useRef(void 0);return x.useEffect(()=>{const _=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(_)},[]),le(()=>{const _=c.current;if(_){v.current=v.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const w=_.getBoundingClientRect();p.current=w.height,g.current=w.width,h.current||(_.style.transitionDuration=v.current.transitionDuration,_.style.animationName=v.current.animationName),d(n)}},[s.open,n]),a.jsx(W.div,{"data-state":fa(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!f,...i,ref:u,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:f&&o})});function fa(e){return e?"open":"closed"}var Kv=dd,Yv=pd,Xv=md;function fd({className:e,...t}){return a.jsx(Kv,{"data-slot":"collapsible",className:F("ecr-collapsible",e),...t})}function hd({className:e,children:t,...r}){return a.jsxs(Yv,{"data-slot":"collapsible-trigger",className:F("ecr-collapsible__trigger",e),...r,children:[a.jsx("span",{className:"ecr-collapsible__trigger-label",children:t}),a.jsx(fo,{className:"ecr-collapsible__trigger-icon"})]})}function gd({className:e,...t}){return a.jsx(Xv,{"data-slot":"collapsible-content",className:F("ecr-collapsible__content",e),...t})}const Jv=({linkLayout:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(Bt,{value:e,onValueChange:t,children:[a.jsx(Ht,{className:"ecr-admin-control__trigger",children:a.jsx(Ut,{placeholder:"Layout"})}),a.jsx(Vt,{children:Gu.map(r=>a.jsx(Wt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),Zv=[{Icon:Vf,value:"desktop"},{Icon:qf,value:"mobile"}],xd=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:d,device:c,setDevice:u})=>{const[p,m]=y.useState(n),g=y.useRef(null);y.useEffect(()=>{m(n)},[n]);const b=h=>{const v=Math.min(r,Math.max(t,Number(h)));o(v)},f=h=>{const v=Number(h);m(v),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{b(v>r?r:v<t?t:v)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":",a.jsxs(Bt,{value:c,onValueChange:u,children:[a.jsx(Ht,{style:{padding:"4px 4px 0px",height:"24px",gap:"4px"},children:a.jsx(Ut,{})}),a.jsx(Vt,{style:{minWidth:"60px"},children:Zv.map(h=>a.jsx(Wt,{value:h.value,children:a.jsx(h.Icon,{size:16})},h.value))})]})]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!d&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:h=>{const v=Number(h.target.value);m(v),b(v)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(Jo,{type:"number",min:t,max:r,value:p,onChange:h=>f(h.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})},Qv=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("desktop");return a.jsx(xd,{label:"Gap",min:0,max:80,value:(r==="mobile"?e?.gapOnMobile:e?.gap)??16,onChange:r==="mobile"?o=>t(i=>({...i,gapOnMobile:o})):o=>t(i=>({...i,gap:o})),name:"column_gap",id:"column-gap",device:r,setDevice:n})},e_=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("desktop");return a.jsx(xd,{label:"Size",min:150,max:400,value:(r==="mobile"?e?.sizeOnMobile:e?.size)??150,onChange:r==="mobile"?o=>t(i=>({...i,sizeOnMobile:o})):o=>t(i=>({...i,size:o})),name:"size",id:"size",device:r,setDevice:n})},t_=[{value:"rectangle",label:"Rectangle"},{value:"circle",label:"Circle"}],r_=({selectedShape:e,handleShape:t})=>{const r=n=>{t(n.target.id)};return a.jsxs("div",{className:"ecr-admin-control",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Shape:"}),a.jsx("div",{className:"ecr-admin-control__row",children:t_.map(n=>a.jsxs("div",{className:"ecr-admin-control__choice",children:[a.jsx("input",{type:"radio",name:"shape",id:n.value,checked:e===n.value,onChange:r,style:{display:"none"}}),a.jsxs("label",{className:"ecr-admin-control__choice-label",htmlFor:n.value,children:[e===n.value?a.jsx(qp,{color:"#2563eb",size:16}):a.jsx(Gp,{color:"#8c95a9",size:16}),n.label]})]},n.value))})]})},n_=Object.values(Ja),o_={marquee:a.jsx(a.Fragment,{children:"Create infinite, auto-scrolling video playlists with the Marquee layout template for endless engagement!"}),stacked:a.jsx(a.Fragment,{children:"Display Reels in a stacked layout for an interactive and shopable video experience!"})},a_=({selectedLayout:e,handleLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Template:"}),a.jsxs(Bt,{value:e,onValueChange:t,children:[a.jsx(Ht,{className:"ecr-admin-control__trigger",children:a.jsx(Ut,{placeholder:"Layout"})}),a.jsxs(Vt,{children:[n_.map(r=>a.jsx(Wt,{value:r,className:"ecr-admin-control__option",children:r},r)),Vu.map(r=>a.jsx("div",{children:a.jsxs(Rt,{modal:!0,children:[a.jsxs(Lt,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r}),a.jsx(Jt,{size:18})]}),a.jsx(It,{className:"ecr-admin-control__popover",children:a.jsx(pr,{name:r,text:o_[r]})})]})},r))]})]})]}),i_=({isLayoutOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(fd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(hd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("layout"),children:[a.jsx(Bf,{size:16})," ",a.jsx("span",{children:"Layout"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(r_,{selectedShape:r?.shape,handleShape:o=>n(i=>({...i,shape:o}))}),a.jsx(a_,{selectedLayout:r?.template??"carousel",handleLayout:o=>n(i=>({...i,template:o}))}),a.jsx(Jv,{linkLayout:r?.appearance??"overlay",handleLinkLayout:o=>n(i=>({...i,appearance:o}))}),a.jsx(e_,{styles:r,updateStyles:n}),a.jsx(Qv,{styles:r,updateStyles:n}),a.jsx(xr,{label:"Show Views",text:a.jsx(a.Fragment,{children:"Hide view counts to remove distractions and provide a cleaner, more focused visual experience!"})}),a.jsx(xr,{label:"Autoplay",text:a.jsx(a.Fragment,{children:"Enable autoplay for videos on your product and pages, capturing users' attention instantly!"})}),a.jsx(xr,{label:"Show Add to Cart",text:a.jsx(a.Fragment,{children:"Show a clear “Add to Cart” button on your tagged product to encourage quick purchases and boost conversions."})}),a.jsx(xr,{label:"Drag to Sort",text:a.jsx(a.Fragment,{children:"Easily rearrange your best-performing Reels to keep your content fresh and in the right order!"})})]})]}),s_=({hoverEffect:e,handleHoverEffect:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Hove Effect:"}),a.jsxs(Bt,{value:e,onValueChange:t,children:[a.jsx(Ht,{className:"ecr-admin-control__trigger",children:a.jsx(Ut,{placeholder:"Layout"})}),a.jsx(Vt,{children:Wu.map(r=>a.jsx(Wt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),l_=({isStyleOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(fd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(hd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("style"),children:[a.jsx(Wf,{size:16}),a.jsx("span",{children:"Styles"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(Zo,{label:"Border Width",min:0,max:12,value:r?.border?.border_width??0,onChange:o=>n(i=>({...i,border:{...i.border,border_width:o}})),name:"border_width",id:"border-width"}),a.jsx(dc,{selectedColor:r?.border?.border_color,handleColor:o=>n(i=>({...i,border:{...i.border,border_color:o}})),text:"Border Color"}),r?.shape==="rectangle"&&a.jsx(Zo,{label:"Border Radius",min:0,max:99,value:r?.border?.border_radius??0,onChange:o=>n(i=>({...i,border:{...i.border,border_radius:o}})),name:"border_radius",id:"border-radius"}),a.jsx(s_,{hoverEffect:r?.hoverEffect||"none",handleHoverEffect:o=>n(i=>({...i,hoverEffect:o}))})]})]}),c_=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("layout"),o=r==="layout",i=r==="style",s=l=>{n(r!==l?l:null)};return a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(i_,{handleSectionOpen:s,isLayoutOpen:o,styles:e,updateStyles:t}),a.jsx(l_,{isStyleOpen:i,handleSectionOpen:s,styles:e,updateStyles:t})]})},d_=({styles:e,setStyles:t,isExpanded:r,setIsExpanded:n,setIsEdited:o,tabs:i,currentTab:s,setCurrentTab:l})=>{const d=u=>{t(p=>{const m=u(p);return o(!0),m})},c=u=>{(u===i.thumbnail||u===i.preview)&&l(u)};return a.jsxs("div",{className:F("ecr-admin-sidepanel",r?"ecr-admin-sidepanel--expanded":"ecr-admin-sidepanel--collapsed"),children:[r&&a.jsx("div",{className:"ecr-admin-mobile-overlay",onClick:()=>n(!1)}),a.jsxs("div",{className:"ecr-admin-sidepanel-content",children:[a.jsxs("div",{className:"ecr-admin-sidepanel__header",children:[a.jsx("p",{className:"ecr-admin-sidepanel__title",children:"Customization"}),a.jsx("small",{className:"ecr-admin-sidepanel__subtitle",children:"Customize your widget however you like"})]}),a.jsx("div",{className:"ecr-admin-sidepanel__body",children:a.jsxs(Qb,{value:s,onValueChange:c,className:"ecr-admin-sidepanel__tabs",children:[a.jsxs(ev,{className:"ecr-admin-sidepanel__tabs-list",children:[a.jsx(Lc,{value:i.thumbnail,children:"Thumbnail"}),a.jsx(Lc,{value:i.preview,children:"Preview"})]}),a.jsx(Ic,{value:i.thumbnail,children:a.jsx(c_,{styles:e,updateStyles:d})}),a.jsx(Ic,{value:i.preview,children:a.jsx(Vv,{styles:e,updateStyles:d})})]})})]})]})},u_=e=>{const t=Ne(),[r,n]=y.useState(""),[o,i]=y.useState([]),[s,l]=y.useState(tt),[d,c]=y.useState(!0),[u,p]=y.useState(!1),[m,g]=y.useState(!1);y.useEffect(()=>{(async()=>{if(!e){c(!1);return}c(!0);try{const _=(await he.get(`stories/${e}`)).data;n(_.group_name),i(_.stories),l(_.styles??tt)}catch(v){v instanceof Error?K.error(v.message):K.error("Something went wrong. Try again later!")}finally{c(!1)}})()},[e]);const b=async h=>{const v=o.map(j=>j.id),_={group_name:r,styles:s,story_ids:v};e&&(_.group_id=e);const w=await he.post("stories/manage-group-stories",_);if(!e){const j=w.data.group_id;t(`?view=${X.mg}&gid=${j}`,{replace:!0})}return{...w.data,isNewGroup:!e}};return{groupTitle:r,setGroupTitle:n,thisGroupReels:o,setThisGroupReels:i,styles:s,setStyles:l,isLoading:d,isSaving:u,isEdited:m,setIsEdited:g,handleSave:async()=>{try{p(!0);const h=await b();return g(!1),K.success("Changes saved successfully!"),h}catch(h){return h instanceof Error?K.error(h.message):K.error("Something went wrong. Try again later!"),null}finally{p(!1)}}}},p_=e=>{const[t,r]=y.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return y.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia(e),o=i=>{r(i.matches)};return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[e]),t},m_=e=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useRef(null),i=y.useRef(!1),s=y.useRef(typeof window<"u"?window.location.hash:"");return y.useEffect(()=>{e||(n.current=null,o.current=null,r(!1))},[e]),y.useEffect(()=>{if(!e)return;const p=m=>{m.preventDefault(),m.returnValue=""};return window.addEventListener("beforeunload",p),()=>window.removeEventListener("beforeunload",p)},[e]),y.useEffect(()=>{const p=()=>{const m=window.location.hash;if(!e){s.current=m;return}if(i.current){i.current=!1,s.current=m;return}m!==s.current&&(o.current=m,window.location.hash=s.current,r(!0))};return window.addEventListener("hashchange",p),()=>window.removeEventListener("hashchange",p)},[e]),{showLeaveModal:t,requestLeave:p=>{if(!e){p();return}n.current=p,r(!0)},confirmLeave:()=>{if(r(!1),n.current){const p=n.current;n.current=null,i.current=!0,p();return}if(o.current){const p=o.current;o.current=null,i.current=!0,window.location.hash=p}},cancelLeave:()=>{n.current=null,o.current=null,r(!1)},allowNextNavigation:p=>{i.current=!0,p()}}},bd={thumbnail:"thumbnail",preview:"preview"},f_=()=>{const e=Ne(),[t]=Yt(),r=t.get("gid"),n=p_("(min-width: 1024px)"),{groupTitle:o,setGroupTitle:i,thisGroupReels:s,setThisGroupReels:l,styles:d,setStyles:c,isLoading:u,isSaving:p,isEdited:m,setIsEdited:g,handleSave:b}=u_(r),{allReels:f,searchTerm:h,setSearchTerm:v,isSearching:_,lastStoryElementRef:w,refreshReels:j}=Zi(r),[C,N]=y.useState(""),[k,E]=y.useState(n),[T,A]=y.useState(bd.thumbnail),[O,R]=y.useState([]),L=y.useMemo(()=>new Set(s.map(G=>G.story_uuid)),[s]),P=y.useMemo(()=>h.trim().toLowerCase(),[h]),M=y.useMemo(()=>P?O.filter(G=>G.title.toLowerCase().includes(P)):O,[O,P]),I=y.useMemo(()=>{const G=new Map;for(const ce of M)G.set(ce.story_uuid,ce);for(const ce of f)G.has(ce.story_uuid)||G.set(ce.story_uuid,ce);return Array.from(G.values())},[M,f]),B=y.useMemo(()=>I.filter(G=>!L.has(G.story_uuid)),[I,L]);y.useEffect(()=>{E(n)},[n]),y.useEffect(()=>{R([])},[r]);const{showLeaveModal:z,requestLeave:q,confirmLeave:ae,cancelLeave:ie,allowNextNavigation:ge}=m_(m),ve=async(G,ce)=>{try{N(G.story_uuid);const $=ce==="add"?[G,...s]:s.filter(Y=>Y.story_uuid!==G.story_uuid);l($),R(ce==="add"?Y=>Y.filter(oe=>oe.story_uuid!==G.story_uuid):Y=>Y.some(oe=>oe.story_uuid===G.story_uuid)?Y:[G,...Y]),g(!0)}catch($){$ instanceof Error?K.error($.message):K.error("Something went wrong. Please try again later!")}finally{N("")}},pe=async()=>{const G=await b();G&&(R([]),j()),G?.isNewGroup&&ge(()=>{e(`?view=${X.mg}&gid=${G.group_id}`,{replace:!0})})};return u?a.jsx(Ir,{}):a.jsxs(Sb,{value:{requestLeave:q},children:[a.jsx(vt,{left:[a.jsx(_t,{name:"Manage Widget",Icon:Or},"page"),a.jsx(tr,{cb:()=>q(()=>e(`?view=${X.ag}`))},"back")],center:[a.jsxs("div",{className:"ecr-admin-group-title__wrapper",children:[a.jsx(Qi,{placeholder:"Enter group title",title:o,setTitle:i,setIsEdited:g,style:{paddingInline:"32px"}}),o&&a.jsxs(Vo,{children:[a.jsx(Wo,{className:"ecr-admin-group-title-customization__trigger",children:a.jsx(X0,{})}),a.jsxs(qo,{className:"ecr-admin-group-title-customization-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Customize title appearance"})}),a.jsx(yb,{styles:d,setStyles:c,setIsEdited:g}),a.jsx("div",{style:{display:"flex",justifyContent:"end",marginTop:40},children:a.jsx(w0,{asChild:!0,children:a.jsx(te,{style:{paddingInline:40},variant:"outline",children:"Ok"})})})]})]})]},"title")],right:[a.jsx(Y0,{isExpanded:k,setIsExpanded:E},"toggle"),a.jsx(uo,{onSave:pe,isSaving:p,disabled:!m},"save")],rightClass:"ecr-admin-nav-btn-reverse"}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Manage Widget"}],onNavigate:G=>q(()=>e(G))}),a.jsxs("div",{className:"ecr-admin-group-edit",children:[a.jsx(Rb,{allReels:B,gid:r,handleSelectReel:ve,searchTerm:h,setSearchTerm:v,isSearching:_,togglingId:C,lastStoryElementRef:w}),a.jsx(Ob,{gid:r,reels:s,styles:d,handleRemoveReel:ve,togglingId:C,currentTab:T}),k&&a.jsx(d_,{isExpanded:k,setIsExpanded:E,setIsEdited:g,styles:d,setStyles:c,tabs:bd,setCurrentTab:A,currentTab:T})]}),z&&a.jsx(Rr,{onReject:ie,onAccept:ae,isLoading:!1,message:"You have unsaved changes. Leave this page without saving?"})]})};function h_(){const[e]=Yt(),t=e.get("view")||X.ag;let r;switch(t){case X.settings:r=a.jsx(H0,{});break;case X.ar:r=a.jsx(Cf,{});break;case X.stat:r=a.jsx(q0,{});break;case X.cr:r=a.jsx(R0,{});break;case X.mg:r=a.jsx(f_,{});break;default:r=a.jsx(B0,{})}return a.jsxs("div",{children:[r,a.jsx(Hu,{position:"top-right",toastOptions:{style:{padding:"16px",marginTop:"24px",fontSize:"16px"}}})]})}const vd=async(e,t,r,n={})=>{try{if(await he.post(`group/${e}/story/${t}/view`),n.isActive&&!n.isActive())return;r(o=>({...o,[t]:Number(o[t]||0)+1}))}catch{}},_d=e=>!!e?.files?.[0]?.mime_type?.startsWith("video"),g_=()=>{const e=y.useContext(ha);if(!e)throw new Error("useVideoPlayer must be used inside PublicStoryContext");const{styles:t,stories:r,groupId:n,isPlaying:o,setIsPlaying:i,setStoryViews:s}=e,[l,d]=y.useState(r.length-1),[c,u]=y.useState(null),[p,m]=y.useState(!0),[g,b]=y.useState(0),[f,h]=y.useState(!1),[v,_]=y.useState({index:0,story_uuid:r[0]?.story_uuid??""}),w=c?.links&&c.links.length>0?c.links[0]:null,j=t?.playerAppearance??"overlay",C=y.useRef(""),N=y.useCallback((L,P=1)=>{if(r.length===0)return null;let M=L;for(let I=0;I<r.length;I+=1){const B=r[M];if(_d(B))return{story:B,index:M};M=(M+P+r.length)%r.length}return null},[r]),k=y.useCallback(()=>{d(r.length-1);const L=r.findIndex(I=>String(I.story_uuid)===o),P=L>=0?r[L]:null,M=_d(P)?{story:P,index:L}:N(Math.max(L,0),1);if(!M?.story){u(null),m(!1);return}u(M.story),L!==M.index&&M.story.story_uuid!==o&&i(M.story.story_uuid),_({index:0,story_uuid:M.story.story_uuid}),m(!1)},[N,o,i,r]);y.useEffect(()=>{k()},[k]),y.useEffect(()=>(C.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=C.current}),[]);const E=y.useCallback(()=>{i(null)},[i]),T=y.useCallback((L=1)=>{m(!0);const P=r.findIndex(q=>String(q.story_uuid)===String(o)),M=L>0?1:-1,I=L>0?l>P?P+1:0:P>0?P-1:l,B=N(I,M);if(!B?.story){m(!1);return}const z=B.story;if(z.story_uuid===o){m(!1),E();return}_({index:0,story_uuid:z.story_uuid}),n&&vd(n,z.id,s),i(z.story_uuid),m(!1)},[E,N,n,o,l,i,s,r]),A=y.useCallback(()=>{const L=c?.files??[];if(v.index>0){_(P=>({index:P.index-1,story_uuid:L[P.index-1].story_uuid??""}));return}T(-1)},[v.index,T,c?.files]),O=y.useCallback(()=>{const L=c?.files??[];if(v.index+1<L.length){_(P=>({index:P.index+1,story_uuid:L[P.index+1].story_uuid??""}));return}T(1)},[v.index,T,c?.files]),R=y.useCallback(L=>{L.target===L.currentTarget&&E()},[E]);return{closePlayer:E,currentFileIndex:v,duration:g,handleBackdropClick:R,handleNextFile:O,handlePrevFile:A,isLoadingNext:p,isPaused:f,playingStory:c,setDuration:b,setIsPaused:h,setIsPlaying:i,firstLink:w,playerAppearance:j}},x_=()=>a.jsx(a.Fragment,{children:a.jsx("div",{className:"ecr-player__loader",children:a.jsxs("div",{className:"ecr-loader",children:[a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"})]})})}),b_=()=>{const{closePlayer:e,currentFileIndex:t,duration:r,handleBackdropClick:n,handleNextFile:o,handlePrevFile:i,isLoadingNext:s,isPaused:l,playerAppearance:d,playingStory:c,firstLink:u,setDuration:p,setIsPaused:m,setIsPlaying:g}=g_();return a.jsx("div",{onClick:n,className:"ecommreels-story-modal ecr-player",children:c&&a.jsxs("div",{className:"ecr-player__stage",children:[a.jsx(xt,{onClick:i,className:"ecr-player__nav--left",children:a.jsx(Zt,{size:24})}),a.jsx(xt,{onClick:o,className:"ecr-player__nav--right",children:a.jsx(Qt,{size:24})}),a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[c&&a.jsx(ii,{playingStory:c,duration:r,currentFileIndex:t,isPaused:l},`${c.story_uuid}-${t.index}`),a.jsx("div",{onClick:e,className:"ecr-player__close",children:a.jsx(er,{className:"ecr-player__close-icon"})}),s?a.jsx(x_,{}):c?.files.length>0&&a.jsx(di,{currentFileIndex:t,files:c?.files,setDuration:p,setIsPlaying:g,isPaused:l,setIsPaused:m,handlePrevFile:i,handleNextFile:o,storyId:c.id,storyTitle:c?.title}),d==="overlay"?u?a.jsx(Nn,{link:u,usedFor:"user",usedIn:"player",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Ft,{title:c.title}):null,d==="title"?a.jsx(Ft,{title:c.title}):null]})]})})},yd=({story:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const i=t.appearance??"overlay",s=e.links&&e.links.length>0?e.links[0]:null,l=i==="none",d=i==="title",c=t.shape==="rectangle",u=!l&&!d&&s,p=t.border.border_radius,m=p>50?p+16:p>20?p:0;return a.jsxs("div",{className:`ecr-thumb ${t.hoverEffect??""}`,children:[a.jsxs("div",{onClick:()=>r({sid:e.id,story_uuid:e.story_uuid}),className:"ecr-thumb__frame",style:{border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t.shape==="rectangle"?"9/16":"1/1"},children:[a.jsx(Jn,{story:e,styles:t,storyViews:n,setStoryViews:o}),!l&&!d&&c?u?a.jsx(Nn,{link:s,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Ft,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null]}),d?a.jsx("p",{className:"ecr-reel__title",children:e.title}):null]})},v_=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:d,canScrollRight:c,scrollBy:u,scrollStep:p}=fc([e],!0);return a.jsxs("div",{className:"ecr-front-carousel",children:[a.jsx("div",{ref:i,className:"ecr-front-carousel__viewport",children:a.jsx("div",{ref:s,className:t.hoverEffect==="zoom-in"?"ecr-front-carousel__track ecr-front-carousel__track--zoom":"ecr-front-carousel__track",children:e?.map(m=>m?.files[0]?.mime_type.startsWith("video")?a.jsx(yd,{story:m,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},m.story_uuid):null)})}),l&&d&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--left",children:a.jsx(Zt,{size:20,style:{width:"20px",height:"20px"}})}),l&&c&&a.jsx("button",{onClick:()=>u(p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--right",children:a.jsx(Qt,{size:20,style:{width:"20px",height:"20px"}})})]})},wd=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>a.jsx("div",{className:"ecr-front-grid",children:a.jsx("div",{style:{paddingBlock:`${t.topBottomSpacing}px`},className:"ecr-front-grid__list",children:e?.map(i=>i?.files[0]?.mime_type.startsWith("video")?a.jsx(yd,{story:i,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},i.story_uuid):null)})}),__={carousel:v_,grid:wd},y_=()=>{const e=y.useContext(ha),{groupTitle:t,styles:r,stories:n,groupId:o,setIsPlaying:i,storyViews:s,setStoryViews:l}=e,d=y.useRef(!0);y.useEffect(()=>(d.current=!0,()=>{d.current=!1}),[]);const c=r.template??"carousel",u=__[c]||wd,p=({sid:m,story_uuid:g})=>{i(g),o&&vd(o,m,l,{isActive:()=>d.current})};return a.jsxs("div",{style:{"--thumbnail-size":r.template==="grid"?"auto":`${r?.size}px`,"--thumbnail-size-grid":`${r?.size}px`,"--thumbnail-size-mobile":r.template==="grid"?"auto":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-size-grid-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},children:[r?.widgetTitle&&r?.widgetTitle?.alignment!=="hidden"&&t?a.jsx("h2",{style:{textAlign:r.widgetTitle?.alignment,fontSize:r.widgetTitle?.fontSize,color:r.widgetTitle?.color,marginBottom:24},children:t}):null,a.jsx(u,{stories:n,styles:r,handlePlaying:p,storyViews:s,setStoryViews:l})]})},w_=e=>{const[t,r]=y.useState(""),[n,o]=y.useState([]),[i,s]=y.useState(tt),[l,d]=y.useState(!1),[c,u]=y.useState(null),p=y.useCallback(async()=>{const m=e?.trim();if(!m){o([]),s(tt),d(!1),u(null);return}const g=new AbortController;d(!0),u(null);try{const b=await he.get(`stories/${m}`,{signal:g.signal});if(g.signal.aborted)return;r(b.data.group_name),o(b.data.stories),s(b.data.styles||tt)}catch(b){if(g.signal.aborted)return;u(b)}finally{d(!1)}return()=>{g.abort()}},[e]);return y.useEffect(()=>{p()},[e]),{groupTitle:t,stories:n,styles:i,isLoading:l,error:c}},ha=y.createContext(void 0),jd=({groupId:e})=>{const[t,r]=y.useState(null),[n,o]=y.useState({}),{groupTitle:i,stories:s,styles:l}=w_(e);return a.jsxs(ha.Provider,{value:{groupTitle:i,groupId:e,stories:s,styles:l,isPlaying:t,setIsPlaying:r,storyViews:n,setStoryViews:o},children:[t&&a.jsx(b_,{}),a.jsx(y_,{})]})};va(()=>{const e=document.getElementById("ecommreels-admin-app");e&&Ln.createRoot(e).render(a.jsx(Zd,{children:a.jsx(h_,{})}))}),va(()=>{const e=document.querySelectorAll(".ecommreels-short-code"),t=document.querySelectorAll(".reelswp-group-short-code");e.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;Ln.createRoot(n).render(a.jsx(jd,{groupId:o}))}),t.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;Ln.createRoot(n).render(a.jsx(jd,{groupId:o}))})})})(React,wp.domReady,wp.element,ReactDOM);
     367For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},f0="DialogDescriptionWarning",h0=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${zl(f0).contentName}}.`;return x.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},g0=jl,x0=Cl,b0=Nl,_0=El,v0=Tl,y0=Pl,Ml=Ll;function Vo({...e}){return a.jsx(g0,{"data-slot":"dialog",...e})}function Wo({...e}){return a.jsx(x0,{"data-slot":"dialog-trigger",...e})}function w0({...e}){const t=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(b0,{"data-slot":"dialog-portal",container:t,...e})}function j0({className:e,...t}){return a.jsx(_0,{"data-slot":"dialog-overlay",className:F("ecr-dialog__overlay",e),...t})}function qo({className:e,children:t,...r}){return a.jsxs(w0,{children:[a.jsx(j0,{}),a.jsxs(v0,{"data-slot":"dialog-content",className:F("ecr-dialog__content",e),...r,children:[t,a.jsx(Ml,{className:"ecr-dialog__close","aria-label":"Close dialog",children:a.jsx(Qf,{className:"ecr-dialog__close-icon"})})]})]})}function Go({className:e,...t}){return a.jsx("div",{className:F("ecr-dialog__header",e),...t})}function Ko({className:e,...t}){return a.jsx(y0,{"data-slot":"dialog-title",className:F("ecr-dialog__title",e),...t})}function S0({...e}){return a.jsx(Ml,{"data-slot":"dialog-close",...e})}const C0=(e={})=>{const{enabled:t=!0}=e,r=typeof ecommreelsInfo<"u"?ecommreelsInfo?.url:"",n=typeof ecommreelsInfo<"u"?ecommreelsInfo?.nonce:"",[o,i]=y.useState([]),[s,l]=y.useState(1),[c,d]=y.useState(!0),[u,p]=y.useState(!1),[m,g]=y.useState(!1),[b,f]=y.useState(""),h=co(b,500),_=y.useRef(!0),v=y.useRef(0),w=y.useRef(null),[j,C]=y.useState(null),N=y.useCallback(async T=>{if(!r||!n){C("Missing API configuration."),g(!1),p(!1);return}const A=++v.current;w.current&&w.current.abort();const O=new AbortController;w.current=O,T===1&&_.current?g(!0):p(!0);try{const R={page:T,per_page:50};h&&(R.search=h);const L=await ee.get(`${r}wc/v3/products`,{headers:{"X-WP-Nonce":n},withCredentials:!0,params:R,signal:O.signal}),P=L.data,M=parseInt(L.headers["x-wp-totalpages"]||"1",10);A===v.current&&(i(I=>T===1?P:[...I,...P]),l(T+1),d(T<M))}catch(R){if(O.signal.aborted)return;R instanceof Error?C(R.message):C("An unknown error occurred")}finally{_.current&&(_.current=!1),A===v.current&&!O.signal.aborted&&(p(!1),g(!1))}},[h,n,r]);y.useEffect(()=>{t&&(l(1),i([]),C(null),_.current=!0,N(1))},[h,N,t]);const k=y.useRef(null),E=y.useCallback(T=>{u||(k.current&&k.current.disconnect(),k.current=new IntersectionObserver(A=>{A[0].isIntersecting&&c&&N(s)}),T&&k.current.observe(T))},[u,c,s,N]);return y.useEffect(()=>()=>{k.current&&k.current.disconnect(),w.current&&w.current.abort()},[]),{products:o,setProducts:i,searchTerm:b,setSearchTerm:f,isSearching:u,isLoading:m,error:j,lastProductElementRef:E}},wn="data:image/webp;base64,UklGRrYCAABXRUJQVlA4IKoCAAAQDgCdASpkAEMAAAAAJaQDTXX09L/D3HZzPbW8/T59Tq2V1f9x4QZUkPFMe8XfzV/1/cA/U3/e+qB5s3stfrGmnzI3LSXH12rz2O2VKFiQhcbIwmUHTRPSh2VO/qyrsEp8zYYljZlwfgijGvud/SarxFjfxEew4IAAAP7/ti48OT/Oya3x+X1pd0VKczR2pok8Ci8XRszNhGh0y5UiQtxf1xZl/3jvki/LfqRs3vrkqKO+RR3ax2yhGPzf/uMJqz6MmyKZ75prVit6Eu2kyiVhUvihA/zLTt4PvMG3YOlFXZJRTk9Zz1SB9/gGf8x4hu9/9Fz/JZ63KGECMtEG58t43wKZFRr2piHRIZQT76htB+3yWUaqjW/9r5PNawz37RxBI1wHwj1o4cbmVBENdq85+fOSQapp04WZhajKbzXhRwSwcxZI01XL2O35Gs53AKgwVjlqhKBXmU5RK0/N1qmQ8h7bn4+Dgm4fguH/nDOEx63rpdXh50ZJgbckzvlWp65XCscQ+Z90pb/bzQAYUI5YPYyk20I93Q8IjMbbafY+FumPz2rofTi71XKY3kDqTc0uBkqjYSUfFMUKxgw1NrzD+Wbnnu2IM+Qd4VS0LEDgJPgKfQ7ibiPABUBtu3G+7MUdxJwAkJmmQoJaL1guZuZ05cbqVsGknyIqlaio4CV14KH5qn4pmkuDfSxtqzn9mhCN+TzF0t4TaR8ogb3/yo30guRPtF+g5KYFVA2UDcRWPUEzW14M0OZ3fHminXd6FGdr5AvpJFRrKwXRhN3HGAgFUI0Kz+1aaiktbCubMvxjbQen+JdPvxDhRzgIgdUC5WTRnTMOZEM6XsqjihAbcx04mA92SCnBZNJtBpRioadBJLj6D4Dd/wEDbmI9KaZM56h8czAAAAAAAAAA",Dl=({name:e,handleClick:t})=>a.jsx("button",{onClick:t,className:F("ecr-button ecr-button--sm",e==="add"?"ecr-button--primary":"ecr-button--danger"),children:e}),k0=({handleLinks:e,taggedProducts:t,products:r,isSearching:n,isLoading:o,lastProductElementRef:i,searchTerm:s,setSearchTerm:l,error:c})=>{const[d,u]=y.useState(t.map(f=>f.product_id)),[p,m]=y.useState(!1),g=f=>{m(!1),u(h=>h.includes(f.id)?h.filter(_=>_!==f.id):[f.id])},b=f=>{if(f.preventDefault(),d.length===0){m(!0);return}const h=new Set(d),_=[];for(const v of r)h.has(v.id)&&_.push({btn_type:"product",btn_uuid:mo(),buttonText:v.name,buttonUrl:v.permalink,rating:v.average_rating,price:v.price_html,thumbnail:v.images?.[0]?.thumbnail||v.images?.[0]?.src||wn,product_id:v.id});e(_),u([])};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"ecr-admin-product-link__search",children:a.jsx("input",{type:"text",placeholder:"Search products...",value:s,onChange:f=>l(f.target.value),className:"ecr-admin-product-link__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-product-link__list",children:o&&r.length===0?a.jsx(Fl,{}):a.jsxs("div",{className:"ecr-admin-product-link__list-inner",children:[r.length===0?a.jsx("p",{className:"ecr-admin-product-link__empty",children:c||"No products are available to add."}):r.map((f,h)=>{const _=d.includes(f.id);return a.jsx("div",{ref:r.length===h+1?i:null,className:"ecr-admin-product-link__item",style:d.length>0&&!_?{opacity:.5,pointerEvents:"none"}:{},children:a.jsxs(te,{type:"button",onClick:()=>g(f),className:F("ecr-admin-product-link__button",_?"ecr-admin-product-link__button--selected":"ecr-admin-product-link__button--unselected"),children:[_?a.jsx(Kf,{size:20,color:"#2563eb"}):a.jsx(Yf,{size:20,color:"#8c95a9"}),a.jsx("img",{className:"ecr-admin-product-link__thumb",src:f.images?.[0]?.thumbnail||f.images?.[0]?.src||wn,alt:"Product thumbnail"}),a.jsx("span",{children:f.name||`Product #${f.id}`})]})},f.id)}),n&&r.length>0&&a.jsx(Fl,{})]})}),a.jsxs("div",{className:"ecr-admin-product-link__footer",children:[p&&a.jsx("p",{className:"ecr-admin-product-link__error",children:"You did not select any product!"}),a.jsx("div",{className:"ecr-admin-product-link__actions",children:a.jsx(Dl,{name:"add",handleClick:b})})]})]})},Fl=()=>a.jsx("div",{className:"ecr-admin-product-link__loader",children:a.jsx("div",{className:"ecr-admin-product-link__spinner"})}),N0=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i,E0=({handleLinks:e})=>{const[t,r]=y.useState(""),[n,o]=y.useState(""),[i,s]=y.useState(""),[l,c]=y.useState(!0),[d,u]=y.useState(""),[p,m]=y.useState([]),g=()=>{const b=[];t||b.push("text"),n&&N0.test(n)||b.push("url"),i||b.push("campaign"),m(b),!(b.length>0)&&e({btn_type:"custom",btn_uuid:mo(),buttonText:t,buttonUrl:n,openInNewTab:l,campaignName:i,customClass:d,clickCount:0})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx(jn,{error:p.includes("text"),type:"text",name:"buttonText",label:"Button Text",placeholder:"e.g Buy Now",value:t,setValue:r}),p.includes("text")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Button text is required!"})]}),a.jsxs("div",{children:[a.jsx(jn,{error:p.includes("url"),type:"url",name:"url",label:"Url",placeholder:"e.g https://example.com",value:n,setValue:o}),p.includes("url")&&a.jsx("p",{className:"ecr-admin-link__error",children:"A valid url is required!"})]}),a.jsxs("div",{children:[a.jsx(jn,{error:p.includes("campaign"),type:"text",name:"campaignName",label:"Campaign Name",placeholder:"e.g Summer sale",value:i,setValue:s}),p.includes("campaign")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Campaign name is required!"})]}),a.jsxs("div",{className:"ecr-admin-link__toggle",children:[a.jsx("input",{checked:l,onChange:b=>c(b.target.checked),className:"ecr-admin-link__checkbox",type:"checkbox",name:"",id:"newTab"}),a.jsx("label",{className:"ecr-admin-link__toggle-label",htmlFor:"newTab",children:"Open in new tab"})]}),a.jsx("div",{children:a.jsx(jn,{error:p.includes("customClass"),type:"text",name:"customClass",label:"Custom class",placeholder:"custom-class",value:d,setValue:u})}),a.jsx("div",{className:"ecr-admin-link__actions",children:a.jsx(Dl,{name:"add",handleClick:g})})]})};function jn({error:e,type:t,name:r,label:n,placeholder:o,value:i,setValue:s}){return a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"ecr-admin-link__label",htmlFor:r,children:n}),a.jsx("input",{id:r,name:r,type:t,placeholder:o,value:i,onChange:l=>s(l.target.value),className:F("ecr-admin-link__input",e?"ecr-admin-link__input--error":"ecr-admin-link__input--normal")})]})}const T0=({setLinks:e,linkCount:t,linkType:r,links:n})=>{const[o,i]=y.useState(null),[s,l]=y.useState(!1),c=C0({enabled:s}),d=t===0||r==="Link",u=t===0||r==="Product",p=n.filter(g=>g.btn_type==="product"),m=()=>l(!0);return a.jsxs(a.Fragment,{children:[t?a.jsx(_n,{}):null,a.jsx("div",{className:"ecr-admin-link-tabs",children:a.jsxs("div",{className:"ecr-admin-link-tabs__list",children:[d&&a.jsxs(Vo,{open:o==="custom",onOpenChange:g=>i(g?"custom":null),children:[a.jsxs(Wo,{className:"ecr-admin-link-tabs__trigger",children:[a.jsx(Hf,{size:20})," Add Custom Link"]}),a.jsxs(qo,{className:"ecr-admin-link-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Add Custom Link"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(E0,{handleLinks:g=>{e(b=>[...b,g]),i(null)}})})]})]}),u&&a.jsxs(Vo,{open:o==="product",onOpenChange:g=>i(g?"product":null),children:[a.jsxs(Wo,{className:"ecr-admin-link-tabs__trigger",onMouseEnter:m,children:[a.jsx(Jf,{size:20})," Tag Products"]}),a.jsxs(qo,{className:"ecr-admin-link-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Select Products"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(k0,{handleLinks:g=>{e(g),i(null)},taggedProducts:p,products:c.products,isSearching:c.isSearching,isLoading:c.isLoading,lastProductElementRef:c.lastProductElementRef,searchTerm:c.searchTerm,setSearchTerm:c.setSearchTerm,error:c.error})})]})]})]})})]})},A0=({links:e,onLinksChange:t})=>{const r=o=>{t(i=>i.filter(s=>s.btn_uuid!==o))},n=e[0]?.btn_type==="product"?"Product":"Link";return a.jsxs("div",{className:"ecr-admin-links",children:[a.jsx("p",{className:"ecr-admin-links__title",children:`${n}${e.length>1?"s":""}`}),e.length>0?a.jsxs(a.Fragment,{children:[e.map(o=>a.jsxs("div",{className:`ecr-admin-links__item ${o.btn_type==="custom"?o.customClass??"":""}`,children:[a.jsx("span",{children:o.buttonText}),a.jsx(te,{onClick:()=>r(o.btn_uuid),size:"icon-sm",variant:"link",className:"ecr-admin-links__remove",children:a.jsx(Zf,{size:16})})]},o.btn_uuid)),a.jsxs(dt,{children:[a.jsxs(ut,{className:"ecr-admin-links__upgrade",children:["+ Add Another ",a.jsx(_t,{size:20})]}),a.jsx(pt,{className:"ecr-admin-links__popover",children:a.jsx(Mt,{name:"Multiple Links",text:a.jsx(a.Fragment,{children:"Unlock the ability to add multiple custom links, seamlessly redirecting users to your pages from the videos!"})})})]})]}):a.jsx(T0,{setLinks:t,linkCount:e.length,linkType:n,links:e})]})};function $l(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(e)}const P0=({togglePlayPause:e,isMuted:t,file:r,videoRef:n,onEnded:o})=>{const[i,s]=y.useState(!1);return a.jsx("video",{ref:n,className:F("ecr-admin-reelvideo",i?"ecr-admin-reelvideo--portrait":"ecr-admin-reelvideo--landscape"),src:r?.url,muted:t,onClick:e,autoPlay:!0,draggable:!1,onEnded:o,onLoadedMetadata:l=>{const c=l.currentTarget,d=c.videoWidth,u=c.videoHeight;s(()=>u>d)}})},O0=({index:e,setIsAttemptingDelete:t,file:r,file_uuid:n,dragStart:o,dragEnter:i,dragEnd:s})=>{const[l,c]=y.useState(!0),[d,u]=y.useState(!1),p=y.useRef(null),m=()=>{p.current&&(d?p.current.play():p.current.pause(),u(b=>!b))},g=()=>{p.current&&(p.current.muted=!l,c(b=>!b))};return a.jsxs("div",{draggable:!0,onDragStart:()=>o(e),onDragEnter:()=>i(e),onDragEnd:s,className:F("ecr-admin-customization__panel"),children:[a.jsx($l,{className:"ecr-admin-customization__remove",size:20,onClick:()=>t(n)}),a.jsx(P0,{togglePlayPause:m,isMuted:l,file:r,videoRef:p,onEnded:()=>u(!0)}),a.jsxs("div",{className:"ecr-admin-customization__controls",children:[d?a.jsx(Kn,{size:16,className:"ecr-admin-customization__control",onClick:m}):a.jsx(qn,{size:16,className:"ecr-admin-customization__control",onClick:m}),l?a.jsx(Gn,{size:16,className:"ecr-admin-customization__control",onClick:g}):a.jsx(Yn,{size:16,className:"ecr-admin-customization__control",onClick:g})]})]})},R0=({uploadedFiles:e,setIsAttemptingDelete:t,setUploadedFiles:r})=>{const n=y.useRef(null),o=y.useRef(null),i=c=>{n.current=c},s=c=>{o.current=c},l=()=>{if(n.current===null||o.current===null)return;const c=[...e],d=c[n.current];c.splice(n.current,1),c.splice(o.current,0,d),n.current=null,o.current=null,r(c)};return a.jsxs("div",{className:"ecr-admin-customization",children:[e.map((c,d)=>a.jsx(O0,{setIsAttemptingDelete:t,file:c,file_uuid:c.file_uuid,index:d,dragStart:i,dragEnter:s,dragEnd:l},d)),a.jsxs(dt,{children:[a.jsxs(ut,{className:"ecr-admin-customization__add",children:[a.jsx("img",{className:"ecr-admin-customization__icon",src:ts,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-customization__label",children:"Upload another video"}),a.jsx(_t,{size:20,className:"ecr-admin-customization__lock"})]}),a.jsx(pt,{side:"right",className:"ecr-admin-customization__popover",children:a.jsx(Mt,{name:"Multiple Videos",text:a.jsxs(a.Fragment,{children:["Unlock the power of ",a.jsx("strong",{children:"Multiple Video"})," uploads, boosting engagement and variety in every Reels!"]})})})]})]})},L0=({thumbnail:e,onThumbnailChange:t})=>a.jsxs("div",{className:"ecr-admin-thumbnail",children:[a.jsx("p",{className:"ecr-admin-thumbnail__title",children:"Thumbnail"}),e?a.jsxs("div",{className:"ecr-admin-thumbnail__preview",children:[a.jsx("img",{src:e,alt:"Thumbnail",className:"ecr-admin-thumbnail__image"}),a.jsx($l,{className:"ecr-admin-thumbnail__remove",size:20,onClick:()=>t(null)})]}):a.jsx(rs,{mode:"thumbnail",usedFor:"image",setThumbnail:t,className:"ecr-admin-thumbnail__uploader"})]}),I0=()=>{const e=Ne(),[t]=Jt(),r=y.useMemo(()=>t.get("sid"),[t]),n=y.useRef(null),[o,i]=y.useState({files:[],title:"",links:[],thumbnail:null}),[s,l]=y.useState(!1),[c,d]=y.useState(null),u=y.useCallback(h=>{i(_=>({..._,title:typeof h=="function"?h(_.title):h}))},[]),p=y.useCallback(h=>{i(_=>({..._,files:typeof h=="function"?h(_.files):h}))},[]),m=y.useCallback(h=>{i(_=>({..._,links:typeof h=="function"?h(_.links):h}))},[]),g=y.useCallback(h=>{i(_=>({..._,thumbnail:typeof h=="function"?h(_.thumbnail):h}))},[]),b=()=>{c&&(p(h=>h.filter(_=>_.file_uuid!==c)),d(null))},f=y.useCallback(async h=>{try{l(!0);const _=await he.get(`story/${h}`);i({title:_.data.title,files:_.data.files,links:_.data.links,thumbnail:_.data.thumbnail})}catch(_){_ instanceof Error?K.error(_.message):K.error("Something went wrong. Try again later!"),n.current=setTimeout(()=>e(-1),1e3)}finally{l(!1)}},[e]);return y.useEffect(()=>{r&&f(r)},[r,f]),y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),s?a.jsx(Ir,{}):a.jsxs(a.Fragment,{children:[a.jsx(Ef,{uploadedFiles:o.files,links:o.links,thumbnail:o.thumbnail,storyTitle:o.title,setStoryTitle:u}),a.jsxs("div",{className:"ecr-admin-create",children:[a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--main",children:[a.jsx("p",{className:"ecr-admin-create__title",children:"Select video"}),c&&a.jsx(Rr,{onReject:()=>d(null),onAccept:b,isLoading:!1,message:"Are you sure, You want to remove this file?"}),o.files.length>0?a.jsx(R0,{uploadedFiles:o.files,setUploadedFiles:p,setIsAttemptingDelete:d}):a.jsx(rs,{setUploadedFiles:p})]}),a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--side",children:[a.jsx(L0,{thumbnail:o.thumbnail,onThumbnailChange:g}),a.jsx(_n,{className:"ecr-admin-create__separator"}),a.jsx(A0,{links:o.links,onLinksChange:m})]})]})]})},Bl=({message:e="Something went wrong. Please try again."})=>a.jsxs("div",{className:"ecr-admin-error",children:[a.jsx(cp,{className:"ecr-admin-error__icon"}),a.jsx("p",{className:"ecr-admin-error__text",children:e})]});var Yo,Ul;function z0(){return Ul||(Ul=1,Yo=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||r.forEach(function(o){e.addRange(o)}),t&&t.focus()}}),Yo}var Xo,Hl;function M0(){if(Hl)return Xo;Hl=1;var e=z0(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(i){var s=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return i.replace(/#{\s*key\s*}/g,s)}function o(i,s){var l,c,d,u,p,m,g=!1;s||(s={}),l=s.debug||!1;try{d=e(),u=document.createRange(),p=document.getSelection(),m=document.createElement("span"),m.textContent=i,m.ariaHidden="true",m.style.all="unset",m.style.position="fixed",m.style.top=0,m.style.clip="rect(0, 0, 0, 0)",m.style.whiteSpace="pre",m.style.webkitUserSelect="text",m.style.MozUserSelect="text",m.style.msUserSelect="text",m.style.userSelect="text",m.addEventListener("copy",function(f){if(f.stopPropagation(),s.format)if(f.preventDefault(),typeof f.clipboardData>"u"){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=t[s.format]||t.default;window.clipboardData.setData(h,i)}else f.clipboardData.clearData(),f.clipboardData.setData(s.format,i);s.onCopy&&(f.preventDefault(),s.onCopy(f.clipboardData))}),document.body.appendChild(m),u.selectNodeContents(m),p.addRange(u);var b=document.execCommand("copy");if(!b)throw new Error("copy command was unsuccessful");g=!0}catch(f){l&&console.error("unable to copy using execCommand: ",f),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(s.format||"text",i),s.onCopy&&s.onCopy(window.clipboardData),g=!0}catch(h){l&&console.error("unable to copy using clipboardData: ",h),l&&console.error("falling back to prompt"),c=n("message"in s?s.message:r),window.prompt(c,i)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(u):p.removeAllRanges()),m&&document.body.removeChild(m),d()}return g}return Xo=o,Xo}var D0=M0();const Vl=Cd(D0);function Wl({className:e,...t}){return a.jsx("div",{"data-slot":"table-container",className:"ecr-table__container",children:a.jsx("table",{"data-slot":"table",className:F("ecr-table",e),...t})})}function ql({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:F("ecr-table__header",e),...t})}function Gl({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:F("ecr-table__body",e),...t})}function Sn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:F("ecr-table__row",e),...t})}function Kl({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:F("ecr-table__head",e),...t})}function ze({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:F("ecr-table__cell",e),...t})}function Yl({className:e,...t}){return a.jsx("caption",{"data-slot":"table-caption",className:F("ecr-table__caption",e),...t})}const F0=[{label:"No.",width:80,align:"center"},{label:"Group Name",width:250,align:"start"},{label:"Short Code",align:"start"},{label:"Action",width:150,align:"center"}],$0=({tableData:e,setIsAttemptingDelete:t})=>{const[r,n]=y.useState(null),o=y.useRef(null),i=(s,l)=>{Vl(s),n(l),o.current=setTimeout(()=>{n(null)},700)};return y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(Wl,{className:"ecr-admin-groups__table",children:[!e.length&&a.jsx(Yl,{className:"ecr-admin-groups__caption",children:a.jsxs("div",{className:"ecr-admin-groups__empty",children:[a.jsx(ot,{className:"ecr-admin-groups__empty-icon"}),"You did not create any reel group yet!"]})}),e.length?a.jsxs(a.Fragment,{children:[a.jsx(ql,{children:a.jsx(Sn,{children:F0.map((s,l)=>a.jsx(Kl,{className:"ecr-admin-groups__head",style:{width:s?.width||"auto",textAlign:s?.align},children:s.label},l))})}),a.jsx(Gl,{children:e.map((s,l)=>a.jsxs(Sn,{className:F("ecr-admin-groups__row",l%2===0&&"ecr-admin-groups__row--alt"),children:[a.jsx(ze,{className:"ecr-admin-groups__cell ecr-admin-groups__cell--center ecr-admin-groups__cell--strong",children:l+1}),a.jsx(ze,{children:a.jsx("div",{className:"ecr-admin-groups__name",children:s.group_name})}),a.jsx(ze,{children:a.jsxs("div",{className:"ecr-admin-groups__shortcode",children:[a.jsx("span",{className:"ecr-admin-groups__shortcode-text",children:`[reelswp-group id='${s.id}']`}),a.jsxs("div",{className:"ecr-admin-groups__copy",children:[a.jsx("button",{onClick:()=>i(`[reelswp-group id='${s.id}']`,l),className:"ecr-admin-groups__copy-button",title:"Copy",children:a.jsx(op,{className:"ecr-admin-groups__copy-icon"})}),a.jsx("span",{className:F("ecr-admin-groups__copy-tooltip",r===l&&"ecr-admin-groups__copy-tooltip--visible"),children:"Copied!"})]})]})}),a.jsx(ze,{children:a.jsxs("div",{className:"ecr-admin-groups__actions",children:[a.jsx(te,{title:"Statistics",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(bt,{to:`?view=${X.stat}&group=${s.id}&name=${s.group_name}`,children:a.jsx(ui,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(te,{title:"Update Stories",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(bt,{to:`?view=${X.mg}&gid=${s.id}`,children:a.jsx(Or,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(te,{title:"Delete Group",onClick:()=>t(s.id),variant:"link",size:"icon-sm",className:"ecr-admin-groups__action-button",children:a.jsx(lp,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--danger"})})]})})]},s.id??l))})]}):null]})},Xl=()=>a.jsxs("table",{className:"ecr-admin-groups__skeleton-table",children:[a.jsx("thead",{className:"ecr-admin-groups__skeleton-head",children:a.jsxs("tr",{children:[a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--tiny"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--medium"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--large"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--small"})})]})}),a.jsx("tbody",{children:Array.from({length:5}).map((e,t)=>a.jsxs("tr",{className:t%2===0?"ecr-admin-groups__skeleton-row ecr-admin-groups__skeleton-row--alt":"ecr-admin-groups__skeleton-row",children:[a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--tiny"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--medium"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--large"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell ecr-admin-groups__skeleton-cell--center",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--small"})})]},t))})]}),B0=()=>{const[e,t]=y.useState([]),[r,n]=y.useState(""),[o,i]=y.useState(!1),[s,l]=y.useState(!1),[c,d]=y.useState(!1),[u,p]=y.useState(""),[m,g]=y.useState(1),[b]=y.useState(20),[f,h]=y.useState(0),[_,v]=y.useState(1),w=co(u,500),j=y.useCallback(async E=>{const T=new AbortController,A=E===1;try{A?i(!0):l(!0),n("");const O=await he.get("groups",{params:{page:E,per_page:b,...w&&{q:w}},signal:T.signal}),R=Number(O.headers?.["x-wp-total"]??0),L=Number(O.headers?.["x-wp-totalpages"]??1),P=Math.max(1,L||1);t(M=>{if(A)return O.data;const I=new Set(M.map(z=>z.id)),B=O.data.filter(z=>!I.has(z.id));return[...M,...B]}),h(R),v(P),E>P&&g(P)}catch(O){if(T.signal.aborted)return;O instanceof Error?n(O.message):n("Something went wrong. Try again later!")}finally{T.signal.aborted||(A?i(!1):l(!1))}},[b,w]),C=y.useCallback(()=>{g(E=>o||s||E>=_?E:E+1)},[o,s,_]),N=y.useCallback(async()=>{if(m!==1){g(1);return}await j(1)},[m,j]),k=y.useCallback(async E=>{try{d(!0),await he.delete(`group/${E}`),await N(),K.success("Group deleted successfully!")}catch(T){T instanceof Error?K.error(T.message):K.error("Failed to delete group.")}finally{d(!1)}},[N]);return y.useEffect(()=>{j(m)},[m,j,w]),{groups:e,groupError:r,isLoading:o,isLoadingMore:s,isDeleting:c,searchTerm:u,setSearchTerm:p,perPage:b,total:f,totalPages:_,hasMore:m<=_,loadMore:C,refreshGroups:N,deleteGroup:k}},U0={docs:"https://reelswp.com/docs/"},H0=()=>{const[e,t]=y.useState(null),{groups:r,groupError:n,isLoading:o,isLoadingMore:i,isDeleting:s,deleteGroup:l,hasMore:c,loadMore:d,searchTerm:u,setSearchTerm:p}=B0(),m=y.useRef(null),g=async()=>{e&&(await l(e),t(null))};return y.useEffect(()=>{if(!m.current||!c)return;const b=new IntersectionObserver(f=>{const[h]=f;h.isIntersecting&&d()},{root:null,rootMargin:"200px",threshold:0});return b.observe(m.current),()=>b.disconnect()},[c,d]),a.jsxs(a.Fragment,{children:[a.jsx(jt,{left:[a.jsx(St,{name:"All Widgets",Icon:dp},"page")],center:[a.jsx(zr,{},"reel-wp")],right:[a.jsxs("a",{href:U0.docs,className:"ecr-admin-docs-link",target:"_blank",children:[a.jsx(Bf,{size:14}),a.jsx("span",{children:"Documentation"})]},"view-documentation"),a.jsx(Lr,{to:`?view=${X.cr}`,text:"Add Reel",Icon:vt},"add-reel-reel-group")]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-groups",children:[e&&a.jsx(Rr,{onAccept:g,onReject:()=>t(null),isLoading:s}),a.jsxs("div",{className:"ecr-admin-groups__header",children:[a.jsx("h2",{className:"ecr-admin-groups__title",children:"Reel Widgets"}),a.jsxs("div",{className:"ecr-admin-groups_action_wrapper",children:[a.jsxs("div",{className:"ecr-admin-groups-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search widgets...",value:u,onChange:b=>p(b.target.value),className:"ecr-admin-groups-search-input"}),a.jsxs("div",{className:"ecr-admin-groups-header__icon-wrapper",children:[u&&a.jsx(te,{onClick:()=>p(""),variant:"link",size:"icon-sm",children:a.jsx(tr,{size:16,className:"ecr-admin-groups-header__clear-icon"})}),a.jsx(ni,{size:16,className:"ecr-admin-groups-header__search-icon"})]})]}),a.jsx(Lr,{to:`?view=${X.mg}`,text:"Create Widget",Icon:vt,className:"ecr-admin-groups__create-button",textColor:"#2563eb"})]})]}),o?a.jsx(Xl,{}):n?a.jsx(Bl,{}):a.jsxs(a.Fragment,{children:[a.jsx($0,{tableData:r,setIsAttemptingDelete:t}),c&&a.jsx("div",{ref:m,className:"ecr-admin-groups__load-more","aria-live":"polite",children:i?a.jsx(Vf,{className:"ecr-admin-groups__load-more__icon"}):null})]})]})]})},V0=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState({rateLimit:2,timeLimit:1}),[o,i]=y.useState(!1),[s,l]=y.useState(!1),[c,d]=y.useState(!1),u=y.useCallback((m,g)=>{t(!0),n(b=>({...b,[m]:g}))},[]),p=y.useCallback(async()=>{const m=Number(r.rateLimit),g=Number(r.timeLimit);if(!Number.isFinite(m)||!Number.isFinite(g)){K.error("Please enter valid numbers.");return}try{l(!0),d(!1),await he.post("settings",{rate_limit:m,time_limit:g}),K.success("Settings updated successfully."),t(!1)}catch(b){b instanceof Error?K.error(b.message):K.error("Something went wrong. Try again later!"),d(!0)}finally{l(!1)}},[r.rateLimit,r.timeLimit]);return y.useEffect(()=>{const m=new AbortController;return(async()=>{try{i(!0),d(!1);const b=await he.get("settings",{signal:m.signal});n({rateLimit:b.data.rate_limit,timeLimit:b.data.time_limit}),t(!1)}catch(b){if(m.signal.aborted)return;b instanceof Error?K.error(b.message):K.error("Something went wrong. Try again later!"),d(!0)}finally{m.signal.aborted||i(!1)}})(),()=>m.abort()},[]),{limit:r,isEdited:e,isLoading:o,isSaving:s,isError:c,handleOnChange:u,handleSave:p}},W0=()=>{const{limit:e,isEdited:t,isLoading:r,isSaving:n,isError:o,handleOnChange:i,handleSave:s}=V0();return a.jsxs(a.Fragment,{children:[r&&a.jsx(Ir,{}),a.jsx(jt,{left:[a.jsx(St,{name:"Settings",Icon:Cp},"Settings"),a.jsx(rr,{},"back-settings")],center:[a.jsx(zr,{},"Settings-widget-name")],right:[a.jsx(uo,{onSave:s,isSaving:n,disabled:!t},"save")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Settings"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-card--settings",children:[a.jsx("div",{className:"ecr-admin-card__header",children:a.jsx("h2",{className:"ecr-admin-card__title",children:"ReelsWP Settings"})}),o&&a.jsx("div",{className:"ecr-admin-form__row",children:a.jsx("span",{children:"Unable to load settings. Please try again."})}),a.jsxs("form",{action:"",className:"ecr-admin-form",children:[a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_rate_limit",className:"ecr-admin-form__label",children:"Rate Limit:"}),a.jsx("input",{type:"number",id:"ecommreels_rate_limit",name:"ecommreels_rate_limit",value:e.rateLimit,onChange:l=>i("rateLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]}),a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_time_limit",className:"ecr-admin-form__label",children:"Time Limit (minutes):"}),a.jsx("input",{type:"number",id:"ecommreels_time_limit",name:"ecommreels_time_limit",value:e.timeLimit,onChange:l=>i("timeLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]})]})]})]})},q0=[{label:"No.",width:80,align:"center"},{label:"Story Title",width:150,align:"left"},{label:"Campaign Name",width:150,align:"left"},{label:"Button Text",width:150,align:"left"},{label:"URL",align:"left"},{label:"Click",width:80,align:"center"}],G0=({tableData:e})=>a.jsxs(Wl,{className:"ecr-admin-stats__table",children:[!e.length&&a.jsx(Yl,{className:"ecr-admin-stats__caption",children:a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(ot,{className:"ecr-admin-stats__empty-icon"}),"You did not create any reel group yet!"]})}),a.jsx(ql,{children:a.jsx(Sn,{children:q0.map((t,r)=>a.jsx(Kl,{className:"ecr-admin-stats__head",style:{...t.width&&{width:`${t.width}px`},textAlign:t.align},children:t.label},r))})}),!!e.length&&a.jsx(Gl,{children:e.map((t,r)=>a.jsxs(Sn,{className:F("ecr-admin-stats__row",r%2===0&&"ecr-admin-stats__row--alt"),children:[a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:r+1}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.storyTitle}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.campaignName}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.buttonText}),a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--link",children:a.jsx("a",{href:t.buttonUrl,target:"_blank",rel:"noopener noreferrer",className:"ecr-admin-stats__link",children:t.buttonUrl})}),a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:t.clickCount})]},t.id))})]}),K0=()=>{const[e]=Jt(),t=e.get("group"),r=e.get("name"),[n,o]=y.useState([]),[i,s]=y.useState([]),[l,c]=y.useState(!1),[d,u]=y.useState(!1);y.useEffect(()=>{t&&(async()=>{try{c(!0);const g=await he.get(`/group/${t}/stats`);o(g.data.stories),s(g.data.buttons)}catch(g){g instanceof Error?K.error(g.message):K.error("Something went wrong. Try again later!"),u(!0)}finally{c(!1)}})()},[t]);const p=n.length>0?n.reduce((m,g)=>m+=g.view_count??0,0):0;return a.jsxs(a.Fragment,{children:[a.jsx(jt,{left:[a.jsx(St,{name:"Statistics",Icon:ui},"Statistics"),a.jsx(rr,{},"Statistics-back")],center:[a.jsx(zr,{},"Statistics-widget-name")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Statistics"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-stats",children:[a.jsxs("div",{className:"ecr-admin-stats__header",children:[a.jsxs("h2",{className:"ecr-admin-stats__title",children:["Group: ",r]}),l?a.jsx("div",{className:"ecr-admin-stats__summary-skeleton"}):a.jsxs("div",{className:"ecr-admin-stats__summary",children:[a.jsx("span",{children:"Total View:"})," ",a.jsx("span",{children:p})]})]}),a.jsx("div",{className:"ecr-admin-stats__body",children:l?a.jsx(Xl,{}):d?a.jsx(Bl,{}):i.length===0?a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(ot,{className:"ecr-admin-stats__empty-icon"}),a.jsx("span",{children:"No Stats available for this group"})]}):a.jsx(G0,{tableData:i})})]})]})};function Y0(e){return H({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 3a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2zm-5-1v12H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm1 0h2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-2z"},child:[]}]})(e)}function X0(e){return H({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11 4a4 4 0 0 1 0 8H8a5 5 0 0 0 2-4 5 5 0 0 0-2-4zm-6 8a4 4 0 1 1 0-8 4 4 0 0 1 0 8M0 8a5 5 0 0 0 5 5h6a5 5 0 0 0 0-10H5a5 5 0 0 0-5 5"},child:[]}]})(e)}const J0=({isExpanded:e,setIsExpanded:t})=>a.jsx("button",{onClick:()=>t(r=>!r),className:F("ecr-admin-side-toggle",e?"ecr-admin-side-toggle--active":""),title:"Side Panel",children:a.jsx(Y0,{size:24})}),Z0=({...e})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",...e,children:a.jsxs("g",{fill:"none","fill-rule":"evenodd",children:[a.jsx("path",{d:"m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z"}),a.jsx("path",{fill:"currentColor",d:"M16 15c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 1 1 0-2h9.17A3 3 0 0 1 16 15m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2M8 9a3 3 0 0 1 2.762 1.828l.067.172H20a1 1 0 0 1 .117 1.993L20 13h-9.17a3.001 3.001 0 0 1-5.592.172L5.17 13H4a1 1 0 0 1-.117-1.993L4 11h1.17A3 3 0 0 1 8 9m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2m8-8c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 0 1 0-2h9.17A3 3 0 0 1 16 3m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2"})]})}),Jo=y.forwardRef(({className:e,type:t,...r},n)=>a.jsx(W.input,{ref:n,type:t,"data-slot":"input",className:F("ecr-input",e),...r}));Jo.displayName="Input";const Zo=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:c})=>{const[d,u]=y.useState(n),p=y.useRef(null);y.useEffect(()=>{u(n)},[n]);const m=b=>{const f=Math.min(r,Math.max(t,Number(b)));o(f)},g=b=>{const f=Number(b);u(f),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{m(f>r?r:f<t?t:f)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":"]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:b=>{const f=Number(b.target.value);u(f),m(f)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(Jo,{type:"number",min:t,max:r,value:d,onChange:b=>g(b.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})};function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},D.apply(null,arguments)}function Be(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Dt=255,Je=100,mr=e=>{var{r:t,g:r,b:n,a:o}=e,i=Math.max(t,r,n),s=i-Math.min(t,r,n),l=s?i===t?(r-n)/s:i===r?2+(n-t)/s:4+(t-r)/s:0;return{h:60*(l<0?l+6:l),s:i?s/i*Je:0,v:i/Dt*Je,a:o}},Jl=e=>{var{h:t,s:r,l:n,a:o}=Zl(e);return"hsla("+t+", "+r+"%, "+n+"%, "+o+")"},Zl=e=>{var{h:t,s:r,v:n,a:o}=e,i=(200-r)*n/Je;return{h:t,s:i>0&&i<200?r*n/Je/(i<=Je?i:200-i)*Je:0,l:i/2,a:o}},Ql=e=>{var{r:t,g:r,b:n}=e,o=t<<16|r<<8|n;return"#"+(i=>new Array(7-i.length).join("0")+i)(o.toString(16))},Q0=e=>{var{r:t,g:r,b:n,a:o}=e,i=typeof o=="number"&&(o*255|256).toString(16).slice(1);return""+Ql({r:t,g:r,b:n})+(i||"")},fr=e=>mr(eb(e)),eb=e=>{var t=e.replace("#","");/^#?/.test(e)&&t.length===3&&(e="#"+t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var r=new RegExp("[A-Za-z0-9]{2}","g"),[n,o,i=0,s]=e.match(r).map(l=>parseInt(l,16));return{r:n,g:o,b:i,a:(s??255)/Dt}},Cn=e=>{var{h:t,s:r,v:n,a:o}=e,i=t/60,s=r/Je,l=n/Je,c=Math.floor(i)%6,d=i-Math.floor(i),u=Dt*l*(1-s),p=Dt*l*(1-s*d),m=Dt*l*(1-s*(1-d));l*=Dt;var g={};switch(c){case 0:g.r=l,g.g=m,g.b=u;break;case 1:g.r=p,g.g=l,g.b=u;break;case 2:g.r=u,g.g=l,g.b=m;break;case 3:g.r=u,g.g=p,g.b=l;break;case 4:g.r=m,g.g=u,g.b=l;break;case 5:g.r=l,g.g=u,g.b=p;break}return g.r=Math.round(g.r),g.g=Math.round(g.g),g.b=Math.round(g.b),D({},g,{a:o})},tb=e=>{var{r:t,g:r,b:n,a:o}=Cn(e);return"rgba("+t+", "+r+", "+n+", "+o+")"},rb=e=>{var{r:t,g:r,b:n}=e;return{r:t,g:r,b:n}},nb=e=>{var{h:t,s:r,l:n}=e;return{h:t,s:r,l:n}},Qo=e=>Ql(Cn(e)),ob=e=>{var{h:t,s:r,v:n}=e;return{h:t,s:r,v:n}},ab=e=>{var{r:t,g:r,b:n}=e,o=function(u){return u<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)},i=o(t/255),s=o(r/255),l=o(n/255),c={};return c.x=i*.4124+s*.3576+l*.1805,c.y=i*.2126+s*.7152+l*.0722,c.bri=i*.0193+s*.1192+l*.9505,c},Ft=e=>{var t,r,n,o,i,s,l,c,d;return typeof e=="string"&&ea(e)?(s=fr(e),c=e):typeof e!="string"&&(s=e),s&&(n=ob(s),i=Zl(s),o=Cn(s),d=Q0(o),c=Qo(s),r=nb(i),t=rb(o),l=ab(t)),{rgb:t,hsl:r,hsv:n,rgba:o,hsla:i,hsva:s,hex:c,hexa:d,xy:l}},ea=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e);function ec(e){var t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useCallback((r,n)=>t.current&&t.current(r,n),[])}var hr=e=>"touches"in e,tc=e=>{!hr(e)&&e.preventDefault&&e.preventDefault()},rc=function(t,r,n){return r===void 0&&(r=0),n===void 0&&(n=1),t>n?n:t<r?r:t},nc=(e,t)=>{var r=e.getBoundingClientRect(),n=hr(t)?t.touches[0]:t;return{left:rc((n.pageX-(r.left+window.pageXOffset))/r.width),top:rc((n.pageY-(r.top+window.pageYOffset))/r.height),width:r.width,height:r.height,x:n.pageX-(r.left+window.pageXOffset),y:n.pageY-(r.top+window.pageYOffset)}},ib=["prefixCls","className","onMove","onDown"],ta=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-interactive",className:n,onMove:o,onDown:i}=e,s=Be(e,ib),l=y.useRef(null),c=y.useRef(!1),[d,u]=y.useState(!1),p=ec(o),m=ec(i),g=v=>c.current&&!hr(v)?!1:(c.current=hr(v),!0),b=y.useCallback(v=>{if(tc(v),!!l.current){var w=hr(v)?v.touches.length>0:v.buttons>0;if(!w){u(!1);return}p?.(nc(l.current,v),v)}},[p]),f=y.useCallback(()=>u(!1),[]),h=y.useCallback(v=>{v?(window.addEventListener(c.current?"touchmove":"mousemove",b),window.addEventListener(c.current?"touchend":"mouseup",f)):(window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",f),window.removeEventListener("touchmove",b),window.removeEventListener("touchend",f))},[b,f]);y.useEffect(()=>(h(d),()=>{h(!1)}),[d,b,f,h]);var _=y.useCallback(v=>{var w=document.activeElement;w?.blur(),tc(v.nativeEvent),g(v.nativeEvent)&&l.current&&(m?.(nc(l.current,v.nativeEvent),v.nativeEvent),u(!0))},[m]);return a.jsx("div",D({},s,{className:[r,n||""].filter(Boolean).join(" "),style:D({},s.style,{touchAction:"none"}),ref:l,tabIndex:0,onMouseDown:_,onTouchStart:_}))});ta.displayName="Interactive";var sb=e=>{var{className:t,color:r,left:n,top:o,prefixCls:i}=e,s={position:"absolute",top:o,left:n},l={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:r};return y.useMemo(()=>a.jsx("div",{className:i+"-pointer "+(t||""),style:s,children:a.jsx("div",{className:i+"-fill",style:l})}),[o,n,r,t,i])},lb=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],oc=y.forwardRef((e,t)=>{var r,{prefixCls:n="w-color-saturation",radius:o=0,pointer:i,className:s,hue:l=0,style:c,hsva:d,onChange:u}=e,p=Be(e,lb),m=D({width:200,height:200,borderRadius:o},c,{position:"relative"}),g=(_,v)=>{u&&d&&u({h:d.h,s:_.left*100,v:(1-_.top)*100,a:d.a})},b=y.useCallback(_=>{if(!(!d||!u)){var v=1,w=d.s,j=d.v,C=!1;switch(_.key){case"ArrowLeft":w=Math.max(0,d.s-v),C=!0,_.preventDefault();break;case"ArrowRight":w=Math.min(100,d.s+v),C=!0,_.preventDefault();break;case"ArrowUp":j=Math.min(100,d.v+v),C=!0,_.preventDefault();break;case"ArrowDown":j=Math.max(0,d.v-v),C=!0,_.preventDefault();break;default:return}C&&u({h:d.h,s:w,v:j,a:d.a})}},[d,u]),f=y.useMemo(()=>{if(!d)return null;var _={top:100-d.v+"%",left:d.s+"%",color:Jl(d)};return i&&typeof i=="function"?i(D({prefixCls:n},_)):a.jsx(sb,D({prefixCls:n},_))},[d,i,n]),h=y.useCallback(_=>{_.target.focus()},[]);return a.jsx(ta,D({className:[n,s||""].filter(Boolean).join(" ")},p,{style:D({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+((r=d?.h)!=null?r:l)+", 100%, 50%))"},m,{outline:"none"}),ref:t,onMove:g,onDown:g,onKeyDown:b,onClick:h,children:f}))});oc.displayName="Saturation";var cb=["className","prefixCls","left","top","style","fillProps"],db=e=>{var{className:t,prefixCls:r,left:n,top:o,style:i,fillProps:s}=e,l=Be(e,cb),c=D({},i,{position:"absolute",left:n,top:o}),d=D({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},s?.style,{transform:n?"translate(-9px, -1px)":"translate(-1px, -9px)"});return a.jsx("div",D({className:r+"-pointer "+(t||""),style:c},l,{children:a.jsx("div",D({className:r+"-fill"},s,{style:d}))}))},ub=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],pb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",kn=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-alpha",className:n,hsva:o,background:i,bgProps:s={},innerProps:l={},pointerProps:c={},radius:d=0,width:u,height:p=16,direction:m="horizontal",style:g,onChange:b,pointer:f}=e,h=Be(e,ub),_=T=>{b&&b(D({},o,{a:m==="horizontal"?T.left:T.top}),T)},v=Jl(Object.assign({},o,{a:1})),w="linear-gradient(to "+(m==="horizontal"?"right":"bottom")+", rgba(244, 67, 54, 0) 0%, "+v+" 100%)",j={};m==="horizontal"?j.left=o.a*100+"%":j.top=o.a*100+"%";var C=D({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:d,background:"url("+pb+") left center",backgroundColor:"var(--alpha-background-color)"},{width:u,height:p},g,{position:"relative"}),N=y.useCallback(T=>{var A=.01,O=o.a,R=O;switch(T.key){case"ArrowLeft":m==="horizontal"&&(R=Math.max(0,O-A),T.preventDefault());break;case"ArrowRight":m==="horizontal"&&(R=Math.min(1,O+A),T.preventDefault());break;case"ArrowUp":m==="vertical"&&(R=Math.max(0,O-A),T.preventDefault());break;case"ArrowDown":m==="vertical"&&(R=Math.min(1,O+A),T.preventDefault());break;default:return}if(R!==O){var L={left:m==="horizontal"?R:o.a,top:m==="vertical"?R:o.a,width:0,height:0,x:0,y:0};b&&b(D({},o,{a:R}),L)}},[o,m,b]),k=y.useCallback(T=>{T.target.focus()},[]),E=f&&typeof f=="function"?f(D({prefixCls:r},c,j)):a.jsx(db,D({},c,{prefixCls:r},j));return a.jsxs("div",D({},h,{className:[r,r+"-"+m,n||""].filter(Boolean).join(" "),style:C,ref:t,children:[a.jsx("div",D({},s,{style:D({inset:0,position:"absolute",background:i||w,borderRadius:d},s.style)})),a.jsx(ta,D({},l,{style:D({},l.style,{inset:0,zIndex:1,position:"absolute",outline:"none"}),onMove:_,onDown:_,onClick:k,onKeyDown:N,children:E}))]}))});kn.displayName="Alpha";var mb=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur","renderInput"],fb=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e),hb=e=>Number(String(e).replace(/%/g,"")),$t=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input",placement:n="bottom",label:o,value:i,className:s,style:l,labelStyle:c,inputStyle:d,onChange:u,onBlur:p,renderInput:m}=e,g=Be(e,mb),[b,f]=y.useState(i),h=y.useRef(!1);y.useEffect(()=>{e.value!==b&&(h.current||f(e.value))},[e.value]);function _(k,E){var T=(E||k.target.value).trim().replace(/^#/,"");fb(T)&&u&&u(k,T);var A=hb(T);isNaN(A)||u&&u(k,A),f(T)}function v(k){h.current=!1,f(e.value),p&&p(k)}var w={};n==="bottom"&&(w.flexDirection="column"),n==="top"&&(w.flexDirection="column-reverse"),n==="left"&&(w.flexDirection="row-reverse");var j=D({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},w,l),C=D({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},d),N=D({value:b,onChange:_,onBlur:v,autoComplete:"off",onFocus:()=>h.current=!0},g,{style:C,onFocusCapture:k=>{var E=k.target;E.setSelectionRange(E.value.length,E.value.length)}});return a.jsxs("div",{className:[r,s||""].filter(Boolean).join(" "),style:j,children:[m?m(N,t):a.jsx("input",D({ref:t},N)),o&&a.jsx("span",{style:D({color:"var(--editable-input-label-color)",textTransform:"capitalize"},c),children:o})]})});$t.displayName="EditableInput";var gb=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],ac=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input-rgba",hsva:n,placement:o="bottom",rProps:i={},gProps:s={},bProps:l={},aProps:c={},className:d,style:u,onChange:p}=e,m=Be(e,gb),g=n?Cn(n):{};function b(v){var w=Number(v.target.value);w&&w>255&&(v.target.value="255"),w&&w<0&&(v.target.value="0")}var f=v=>{var w=Number(v.target.value);w&&w>100&&(v.target.value="100"),w&&w<0&&(v.target.value="0")},h=(v,w,j)=>{typeof v=="number"&&(w==="a"&&(v<0&&(v=0),v>100&&(v=100),p&&p(Ft(mr(D({},g,{a:v/100}))))),v>255&&(v=255,j.target.value="255"),v<0&&(v=0,j.target.value="0"),w==="r"&&p&&p(Ft(mr(D({},g,{r:v})))),w==="g"&&p&&p(Ft(mr(D({},g,{g:v})))),w==="b"&&p&&p(Ft(mr(D({},g,{b:v})))))},_=g.a?Math.round(g.a*100)/100:0;return a.jsxs("div",D({ref:t,className:[r,d||""].filter(Boolean).join(" ")},m,{style:D({fontSize:11,display:"flex"},u),children:[a.jsx($t,D({label:"R",value:g.r||0,onBlur:b,placement:o,onChange:(v,w)=>h(w,"r",v)},i,{style:D({},i.style)})),a.jsx($t,D({label:"G",value:g.g||0,onBlur:b,placement:o,onChange:(v,w)=>h(w,"g",v)},s,{style:D({marginLeft:5},i.style)})),a.jsx($t,D({label:"B",value:g.b||0,onBlur:b,placement:o,onChange:(v,w)=>h(w,"b",v)},l,{style:D({marginLeft:5},l.style)})),c&&a.jsx($t,D({label:"A",value:parseInt(String(_*100),10),onBlur:f,placement:o,onChange:(v,w)=>h(w,"a",v)},c,{style:D({marginLeft:5},c.style)}))]}))});ac.displayName="EditableInputRGBA";var xb=["prefixCls","className","hue","onChange","direction"],ic=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-hue",className:n,hue:o=0,onChange:i,direction:s="horizontal"}=e,l=Be(e,xb);return a.jsx(kn,D({ref:t,className:r+" "+(n||"")},l,{direction:s,background:"linear-gradient(to "+(s==="horizontal"?"right":"bottom")+", rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)",hsva:{h:o,s:100,v:100,a:o/360},onChange:(c,d)=>{i&&i({h:s==="horizontal"?360*d.left:360*d.top})}}))});ic.displayName="Hue";var bb=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],sc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-swatch",className:n,color:o,colors:i=[],style:s,rectProps:l={},onChange:c,addonAfter:d,addonBefore:u,rectRender:p}=e,m=Be(e,bb),g=D({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},l.style),b=(f,h)=>{c&&c(fr(f),Ft(fr(f)),h)};return a.jsxs("div",D({ref:t},m,{className:[r,n||""].filter(Boolean).join(" "),style:D({display:"flex",flexWrap:"wrap",position:"relative"},s),children:[u&&y.isValidElement(u)&&u,i&&Array.isArray(i)&&i.map((f,h)=>{var _="",v="";typeof f=="string"&&(_=f,v=f),typeof f=="object"&&f.color&&(_=f.title||f.color,v=f.color);var w=o&&o.toLocaleLowerCase()===v.toLocaleLowerCase(),j=p&&p({title:_,color:v,checked:!!w,style:D({},g,{background:v}),onClick:N=>b(v,N)});if(j)return a.jsx(y.Fragment,{children:j},h);var C=l.children&&y.isValidElement(l.children)?y.cloneElement(l.children,{color:v,checked:w}):null;return a.jsx("div",D({tabIndex:0,title:_,onClick:N=>b(v,N)},l,{children:C,style:D({},g,{background:v})}),h)}),d&&y.isValidElement(d)&&d]}))});sc.displayName="Swatch";var _b=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],vb=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],lc=e=>a.jsx("div",{style:{boxShadow:"rgb(0 0 0 / 60%) 0px 0px 2px",width:4,top:1,bottom:1,left:e.left,borderRadius:1,position:"absolute",backgroundColor:"#fff"}}),cc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-sketch",className:n,onChange:o,width:i=218,presetColors:s=vb,color:l,editableDisable:c=!0,disableAlpha:d=!1,style:u}=e,p=Be(e,_b),[m,g]=y.useState({h:209,s:36,v:90,a:1});y.useEffect(()=>{typeof l=="string"&&ea(l)&&g(fr(l)),typeof l=="object"&&g(l)},[l]);var b=N=>{g(N),o&&o(Ft(N))},f=(N,k)=>{typeof N=="string"&&ea(N)&&/(3|6)/.test(String(N.length))&&b(fr(N))},h=N=>b(D({},m,{a:N.a})),_=N=>b(D({},m,N,{a:m.a})),v=D({"--sketch-background":"rgb(255, 255, 255)","--sketch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px, rgb(0 0 0 / 15%) 0px 8px 16px","--sketch-swatch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset","--sketch-alpha-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset, rgb(0 0 0 / 25%) 0px 0px 4px inset","--sketch-swatch-border-top":"1px solid rgb(238, 238, 238)",background:"var(--sketch-background)",borderRadius:4,boxShadow:"var(--sketch-box-shadow)",width:i},u),w={borderRadius:2,background:tb(m),boxShadow:"var(--sketch-alpha-box-shadow)"},j={borderTop:"var(--sketch-swatch-border-top)",paddingTop:10,paddingLeft:10},C={marginRight:10,marginBottom:10,borderRadius:3,boxShadow:"var(--sketch-swatch-box-shadow)"};return a.jsxs("div",D({},p,{className:r+" "+(n||""),ref:t,style:v,children:[a.jsxs("div",{style:{padding:"10px 10px 8px"},children:[a.jsx(oc,{hsva:m,style:{width:"auto",height:150},onChange:_}),a.jsxs("div",{style:{display:"flex",marginTop:4},children:[a.jsxs("div",{style:{flex:1},children:[a.jsx(ic,{width:"auto",height:10,hue:m.h,pointer:lc,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:N=>b(D({},m,N))}),!d&&a.jsx(kn,{width:"auto",height:10,hsva:m,pointer:lc,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:h})]}),!d&&a.jsx(kn,{width:24,height:24,hsva:m,radius:2,style:{marginLeft:4},bgProps:{style:{background:"transparent"}},innerProps:{style:w},pointer:()=>a.jsx(y.Fragment,{})})]})]}),c&&a.jsxs("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[a.jsx($t,{label:"Hex",value:Qo(m).replace(/^#/,"").toLocaleUpperCase(),onChange:(N,k)=>f(k),style:{minWidth:58}}),a.jsx(ac,{hsva:m,style:{marginLeft:6},aProps:d?!1:{},onChange:N=>b(N.hsva)})]}),s&&s.length>0&&a.jsx(sc,{style:j,colors:s,color:Qo(m),onChange:N=>b(N),rectProps:{style:C}})]}))});cc.displayName="Sketch";const dc=({selectedColor:e,handleColor:t,text:r,wrapperStyles:n})=>a.jsxs("div",{style:n,className:"ecr-admin-control",children:[a.jsxs("p",{className:"ecr-admin-control__label",children:[r,":"]}),a.jsxs("div",{className:"ecr-admin-control__row ecr-admin-control__row--color",children:[a.jsxs(dt,{children:[a.jsx(ut,{style:{padding:0,backgroundColor:"transparent"},children:a.jsx("div",{style:{backgroundColor:e},className:"ecr-admin-control__swatch"})}),a.jsx(pt,{className:"ecr-admin-popover ecr-admin-color-selector-popover",children:a.jsx(cc,{color:e,disableAlpha:!0,onChange:o=>{t(o.hex)}})})]}),a.jsx("input",{className:"ecr-admin-control__hex",type:"text",value:e,onChange:o=>t(o.target.value)})]})]}),yb=[{value:"left",title:"Align Left",Icon:Bp},{value:"center",title:"Align Center",Icon:Up},{value:"right",title:"Align Right",Icon:Hp},{value:"hidden",title:"Hidden",Icon:Vp}],wb=({alignment:e,handleWidgetTitleAlignment:t})=>a.jsxs("div",{className:"ecr-admin-group-title_alignment",children:[a.jsx("p",{className:"ecr-admin-group-title_alignment-label",children:"Alignment:"}),a.jsx("div",{className:"ecr-admin-group-title_alignment-options",children:yb.map(({value:r,title:n,Icon:o})=>a.jsx(te,{onClick:()=>t(r),style:{width:40,...e===r?{backgroundColor:"#2563eb",color:"#fff"}:{}},size:"icon-sm",variant:"ghost",title:n,children:a.jsx(o,{size:18})},r))})]}),jb=({styles:e,setStyles:t,setIsEdited:r})=>{const n=o=>{t(i=>{const s=o(i);return r(!0),s})};return a.jsxs("div",{className:"ecr-admin-group-title-customization__content",children:[a.jsx(wb,{alignment:e.widgetTitle?.alignment??"hidden",handleWidgetTitleAlignment:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,alignment:o}}))}),a.jsx(dc,{selectedColor:e.widgetTitle?.color??"#000000",handleColor:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,color:o}})),text:"Title Color",wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}}),a.jsx(Zo,{label:"Font size",min:10,max:200,value:e?.widgetTitle?.fontSize??24,onChange:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,fontSize:o}})),name:"font_size",id:"font-size",hideSlider:!0,wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}})]})},Sb=(e=700)=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useCallback(i=>{Vl(i),r(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r(!1)},e)},[e]);return y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),[t,o]},Cb=({gid:e})=>{const[t,r]=Sb(),n=`[reelswp-group id='${e}']`;return a.jsxs("div",{className:"ecr-admin-shortcode",children:[a.jsx("span",{className:"ecr-admin-shortcode__badge",children:n}),a.jsxs("div",{className:"ecr-admin-shortcode__copy",children:[a.jsx("button",{onClick:()=>r(n),className:"ecr-admin-shortcode__button",title:"Copy",children:a.jsx($f,{color:"#ffffff",size:12})}),a.jsx("span",{className:F("ecr-admin-shortcode__tooltip",t?"ecr-admin-shortcode__tooltip--visible":"ecr-admin-shortcode__tooltip--hidden"),children:"Copied!"})]})]})},uc=y.createContext({requestLeave:e=>e()}),kb=({value:e,children:t})=>a.jsx(uc.Provider,{value:e,children:t}),pc=()=>y.useContext(uc);function Nb(e){return H({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"},child:[]}]})(e)}const Eb=({link:e,usedFor:t})=>a.jsx("div",{className:"ecr-product-card-one",style:{width:"100%"},children:a.jsx(Tb,{link:e,usedFor:t})}),Tb=({link:e,usedFor:t})=>a.jsx(a.Fragment,{children:a.jsxs("div",{className:"ecr-product-card-one-content-wrapper",children:[t==="admin"?a.jsx("img",{className:"ecr-product-card-one__thumb",src:e.thumbnail||wn,alt:"Product thumbnail"}):a.jsx("a",{href:e.buttonUrl,target:"_blank",draggable:!1,children:a.jsx("img",{className:"ecr-product-card-one__thumb",src:e.thumbnail||wn,alt:"Product thumbnail",draggable:!1})}),a.jsxs("div",{className:"ecr-product-card-one__content",children:[t==="admin"?a.jsx("p",{className:"ecr-product-card-one__title",children:e.buttonText}):a.jsx("a",{className:"ecr-product-card-one__title",href:e.buttonUrl,target:"_blank",draggable:!1,children:e.buttonText}),a.jsxs("div",{className:"ecr-product-card-one__meta",children:[Number(e.rating)>0?a.jsxs("span",{className:"ecr-product-card-one__rating",children:[a.jsx(Nb,{className:"ecr-product-card-one__star"}),e.rating]}):null,a.jsx("div",{className:"ecr-product-card-one__price",dangerouslySetInnerHTML:{__html:e.price}})]})]})]})}),Ab=({link:e,usedFor:t})=>{const r=t==="admin";return a.jsx("div",{style:{width:"100%"},className:"ecr-thumb__link-wrapper",children:a.jsx("a",{href:r?void 0:e.buttonUrl,target:r?void 0:"_blank",rel:r?void 0:"noopener noreferrer",className:`ecr-thumb__link ${e.customClass??""}`,onClick:r?n=>n.preventDefault():void 0,"aria-disabled":r,tabIndex:r?-1:void 0,draggable:!1,children:e.buttonText})})},Nn=({link:e,usedFor:t,style:r})=>a.jsx("div",{className:"ecr-admin-reelitem-links",style:r,children:e.btn_type==="product"?a.jsx(Eb,{link:e,usedFor:t},e.btn_uuid):a.jsx(Ab,{link:e,usedFor:t},e.btn_uuid)}),Bt=({title:e,styles:t})=>a.jsx("p",{className:"ecr-reel_title",style:t,children:e}),mc=({reel:e,styles:t,gid:r,togglingId:n,onRemove:o})=>{const i=Ne(),{requestLeave:s}=pc(),l=n===e.story_uuid,c=`?view=${X.cr}&from=${X.mg}&sid=${e.id}${r?`&gid=${r}`:""}`,d=t.appearance??"overlay",u={border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t?.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},p=t.border.border_radius,m=p>50?p+16:p>20?p:0,g=e.links&&e.links.length>0?e.links[0]:null,b=d==="none",f=d==="title",h=t.shape==="rectangle",_=!b&&!f&&g;return a.jsxs("div",{className:F("ecr-admin-reelitem",t?.hoverEffect),children:[a.jsxs("div",{style:u,className:"ecr-admin-reelitem__frame",children:[a.jsx(Jn,{story:e,styles:t}),!b&&!f&&h?_?a.jsx(Nn,{link:g,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null,a.jsxs("div",{className:"ecr-admin-reelitem__actions",children:[a.jsx(te,{title:"Edit Story",size:"icon-sm",asChild:!0,className:"ecr-admin-reelitem__button",disabled:l,children:a.jsx(bt,{to:c,className:F("ecr-admin-reelitem__link",l?"ecr-admin-reelitem__link--disabled":"ecr-admin-reelitem__link--active"),onClick:v=>{v.preventDefault(),s(()=>i(c))},children:a.jsx(Or,{className:"ecr-admin-reelitem__icon"})})}),a.jsx(te,{onClick:()=>o(e,"remove"),className:"ecr-admin-reelitem__button ecr-admin-reelitem__button--danger",size:"icon-sm",title:"Remove Story",disabled:l,children:l?a.jsx(rt,{className:"ecr-admin-reelitem__spinner",size:18}):a.jsx(Vn,{size:18})})]})]}),f?a.jsx("p",{className:"ecr-admin-reel__title",children:e.title}):null]})},fc=(e,t)=>{const r=y.useRef(null),n=y.useRef(null),o=y.useRef(null),[i,s]=y.useState(!1),[l,c]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(300),g=()=>{const f=r.current;if(!f)return;const h=f.scrollLeft,_=f.scrollWidth,v=f.clientWidth;c(h>0),u(h+v<_-1)};y.useEffect(()=>{const f=r.current,h=n.current;f&&h&&(s(h.scrollWidth>f.clientWidth),m(f.clientWidth-100),g())},[e,t]);const b=f=>{const h=r.current;h&&(h.scrollBy({left:f,behavior:"smooth"}),o.current&&clearTimeout(o.current),o.current=setTimeout(g,300))};return y.useEffect(()=>{const f=r.current;if(!f)return;let h=!1,_,v;const w=A=>{h=!0,_=A.pageX-f.offsetLeft,v=f.scrollLeft,f.style.cursor="grabbing"},j=()=>{h=!1,f.style.cursor="default"},C=()=>{h=!1,f.style.cursor="default"},N=A=>{if(!h)return;A.preventDefault();const R=(A.pageX-f.offsetLeft-_)*1.5;f.scrollLeft=v-R,g()},k=A=>{h=!0,_=A.touches[0].pageX-f.offsetLeft,v=f.scrollLeft},E=()=>{h=!1},T=A=>{if(!h)return;const R=(A.touches[0].pageX-f.offsetLeft-_)*1.5;f.scrollLeft=v-R,g()};return f.addEventListener("mousedown",w),f.addEventListener("mouseleave",j),f.addEventListener("mouseup",C),f.addEventListener("mousemove",N),f.addEventListener("touchstart",k,{passive:!0}),f.addEventListener("touchend",E),f.addEventListener("touchmove",T,{passive:!0}),()=>{f.removeEventListener("mousedown",w),f.removeEventListener("mouseleave",j),f.removeEventListener("mouseup",C),f.removeEventListener("mousemove",N),f.removeEventListener("touchstart",k),f.removeEventListener("touchend",E),f.removeEventListener("touchmove",T)}},[t]),y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{thumbsContainerRef:r,thumbsWrapperRef:n,isOverflowing:i,canScrollLeft:l,canScrollRight:d,scrollBy:b,scrollStep:p}},hc=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=fc([e],!0);return a.jsxs("div",{className:"ecr-admin-editor-carousel",children:[a.jsx("div",{ref:i,className:"ecr-admin-editor-carousel__viewport",children:a.jsx("div",{ref:s,style:{...!e.length&&{margin:"auto"}},className:F("ecr-admin-editor-carousel__track",t.hoverEffect==="zoom-in"&&"ecr-admin-editor-carousel__track--padded"),children:e.length>0?e.map(m=>a.jsx(mc,{reel:m,styles:t,gid:r,togglingId:n,onRemove:o},m.id)):a.jsx("div",{className:"ecr-admin-editor-carousel__empty",children:a.jsxs("p",{className:"ecr-admin-editor-carousel__empty-text",children:[a.jsx(ot,{className:"ecr-admin-editor-carousel__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--left",children:a.jsx(Qt,{size:20})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--right",children:a.jsx(er,{size:20})})]})},Pb=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>a.jsx("div",{className:F("ecr-admin-editor-grid",t?.hoverEffect==="zoom-in"&&"ecr-admin-editor-grid--padded"),children:e.length>0?e.map(i=>a.jsx(mc,{reel:i,styles:t,gid:r,togglingId:n,onRemove:o},i.id)):a.jsx("div",{className:"ecr-admin-editor-grid__empty",children:a.jsxs("p",{className:"ecr-admin-editor-grid__empty-text",children:[a.jsx(ot,{className:"ecr-admin-editor-grid__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})}),Ob=({reel:e,styles:t})=>{const r=e?.files?.[0],n=!!r?.mime_type?.startsWith("image"),[o,i]=y.useState(!1),[s,l]=y.useState(!0),[c,d]=y.useState(!1),u=y.useRef(null);y.useEffect(()=>{u.current&&(u.current.muted=s)},[s]),y.useEffect(()=>{u.current&&(o?u.current.pause():u.current.play().catch(()=>{}))},[o]);const p=()=>{u.current&&i(f=>!f)},m=()=>{u.current&&l(f=>!f)},g=t?.playerAppearance??"overlay",b=e.links&&e.links.length>0?e.links[0]:null;return a.jsx("div",{className:"ecr-preview-player",children:a.jsxs("div",{className:"ecr-preview-player__stage",children:[a.jsx(yt,{className:"ecr-player__nav--left ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Qt,{size:24})}),a.jsx(yt,{className:"ecr-player__nav--right ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(er,{size:24})}),a.jsxs("div",{className:"ecr-player__frame",style:{backgroundColor:c?"transparent":"#000"},children:[a.jsx("button",{type:"button",className:"ecr-player__close","aria-label":"Close preview",children:a.jsx(tr,{className:"ecr-player__close-icon"})}),r?a.jsx("div",{className:"ecr-player__media-frame",children:n?a.jsx("img",{src:r.url,alt:e?.title||"Reel preview",className:"ecr-preview-player__media-item",loading:"lazy"}):a.jsxs(a.Fragment,{children:[a.jsx("video",{style:{height:c?"100%":"auto"},ref:u,className:"ecr-preview-player__media-item",src:r.url,poster:e?.thumbnail,autoPlay:!0,muted:s,loop:!0,playsInline:!0,onClick:p,onLoadedMetadata:f=>{const h=f.currentTarget,_=h.videoWidth,v=h.videoHeight;d(()=>v>_)}}),a.jsxs("div",{className:"ecr-player__controls",children:[o?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:p}):a.jsx(qn,{size:20,className:"ecr-player__control-icon",onClick:p}),s?a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:m}):a.jsx(Yn,{size:20,className:"ecr-player__control-icon",onClick:m})]})]})}):a.jsx("div",{className:"ecr-preview-player__empty",children:"No preview available"})]}),g==="overlay"?b?a.jsx(Nn,{link:b,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title}):null,g==="title"?a.jsx(Bt,{title:e.title}):null]})})},Rb={carousel:hc,grid:Pb},Lb=({gid:e,reels:t,styles:r,handleRemoveReel:n,togglingId:o,currentTab:i})=>{const s=r.template??"carousel",l=Rb[s]||hc;return a.jsxs("div",{className:"ecr-admin-existing",children:[a.jsxs("div",{className:"ecr-admin-existing__header",children:[a.jsxs("div",{className:"ecr-admin-existing__title-wrapper",children:[a.jsx("p",{className:"ecr-admin-existing__title",children:"Attached videos"}),a.jsx("small",{className:"ecr-admin-existing__subtitle",children:"These reels will be shown in this reel widget"})]}),e&&a.jsx(Cb,{gid:e})]}),a.jsx("div",{style:{"--thumbnail-size":`${r?.size}px`,"--thumbnail-size-tab":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-tab":`${r?.gapOnTab??r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},className:"scrollbarThin ecr-admin-existing__body",children:i==="thumbnail"?a.jsx(l,{reels:t,styles:r,gid:e,togglingId:o,handleRemoveReel:n}):t.length>0?a.jsx(Ob,{reel:t[0],styles:r}):a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[a.jsx(ot,{style:{width:"40px",height:"40px",color:"#f59e0b"}}),"No reels available for preview."]})})]})},gc=()=>a.jsx("div",{className:"ecr-admin-reellist__loader",children:a.jsx("div",{className:"ecr-admin-reellist__spinner"})}),Ib=({gid:e,allReels:t,handleSelectReel:r,searchTerm:n,setSearchTerm:o,isSearching:i,togglingId:s,lastStoryElementRef:l})=>{const c=Ne(),{requestLeave:d}=pc(),u=`?view=${X.cr}&from=${X.mg}${e?`&gid=${e}`:""}`,p=t.filter(m=>!m?.files[0]?.mime_type.startsWith("image"));return a.jsxs("div",{className:"ecr-admin-reellist",children:[a.jsxs("div",{className:"ecr-admin-reellist__header",children:[a.jsx("p",{className:"ecr-admin-reellist__title",children:"All reels"}),a.jsx("small",{className:"ecr-admin-reellist__subtitle",children:"Choose reels to attach in this widget"})]}),a.jsxs("div",{className:"ecr-admin-reellist__body",children:[a.jsx(Lr,{to:u,text:"Add Reel",Icon:vt,className:"ecr-admin-reellist__add-button",textColor:"#2563eb",onNavigate:m=>d(()=>c(m))}),a.jsx("div",{className:"ecr-admin-reellist__search",children:a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:m=>o(m.target.value),className:"ecr-admin-reellist__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-reellist__grid",children:i&&t.length===0?a.jsx(gc,{}):a.jsxs("div",{className:"ecr-admin-reellist__items",children:[p.length===0?a.jsx("p",{className:"ecr-admin-reellist__empty",children:"No reels are available to add."}):p.map((m,g)=>a.jsx("div",{ref:p.length===g+1?l:null,className:"ecr-admin-reellist__item",children:a.jsxs("button",{title:"Click to add this reel",onClick:()=>r(m,"add"),disabled:s==m.story_uuid,className:"ecr-admin-reellist__card",children:[a.jsx("div",{className:"ecr-admin-reellist__media",children:a.jsx("video",{className:"ecr-admin-reellist__thumb",src:m?.files[0]?.url,poster:m?.thumbnail})}),a.jsx("span",{className:"ecr-admin-reellist__label",children:m.title||`Reel #${m.id}`}),s==m.story_uuid?a.jsx("div",{className:"ecr-admin-reellist__overlay",children:a.jsx(rt,{className:"ecr-admin-reellist__overlay-icon"})}):null]})},m.id)),i&&t.length>0&&a.jsx(gc,{})]})})]})]})};function xc(e){const t=e+"CollectionProvider",[r,n]=Ve(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=f=>{const{scope:h,children:_}=f,v=y.useRef(null),w=y.useRef(new Map).current;return a.jsx(o,{scope:h,itemMap:w,collectionRef:v,children:_})};s.displayName=t;const l=e+"CollectionSlot",c=nt(l),d=y.forwardRef((f,h)=>{const{scope:_,children:v}=f,w=i(l,_),j=J(h,w.collectionRef);return a.jsx(c,{ref:j,children:v})});d.displayName=l;const u=e+"CollectionItemSlot",p="data-radix-collection-item",m=nt(u),g=y.forwardRef((f,h)=>{const{scope:_,children:v,...w}=f,j=y.useRef(null),C=J(h,j),N=i(u,_);return y.useEffect(()=>(N.itemMap.set(j,{ref:j,...w}),()=>void N.itemMap.delete(j))),a.jsx(m,{[p]:"",ref:C,children:v})});g.displayName=u;function b(f){const h=i(e+"CollectionConsumer",f);return y.useCallback(()=>{const v=h.collectionRef.current;if(!v)return[];const w=Array.from(v.querySelectorAll(`[${p}]`));return Array.from(h.itemMap.values()).sort((N,k)=>w.indexOf(N.ref.current)-w.indexOf(k.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:s,Slot:d,ItemSlot:g},b,n]}var zb=x.createContext(void 0);function ra(e){const t=x.useContext(zb);return e||t||"ltr"}var na="rovingFocusGroup.onEntryFocus",Mb={bubbles:!1,cancelable:!0},gr="RovingFocusGroup",[oa,bc,Db]=xc(gr),[Fb,_c]=Ve(gr,[Db]),[$b,Bb]=Fb(gr),vc=x.forwardRef((e,t)=>a.jsx(oa.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(oa.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Ub,{...e,ref:t})})}));vc.displayName=gr;var Ub=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...p}=e,m=x.useRef(null),g=J(t,m),b=ra(i),[f,h]=ct({prop:s,defaultProp:l??null,onChange:c,caller:gr}),[_,v]=x.useState(!1),w=We(d),j=bc(r),C=x.useRef(!1),[N,k]=x.useState(0);return x.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(na,w),()=>E.removeEventListener(na,w)},[w]),a.jsx($b,{scope:r,orientation:n,dir:b,loop:o,currentTabStopId:f,onItemFocus:x.useCallback(E=>h(E),[h]),onItemShiftTab:x.useCallback(()=>v(!0),[]),onFocusableItemAdd:x.useCallback(()=>k(E=>E+1),[]),onFocusableItemRemove:x.useCallback(()=>k(E=>E-1),[]),children:a.jsx(W.div,{tabIndex:_||N===0?-1:0,"data-orientation":n,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:V(e.onMouseDown,()=>{C.current=!0}),onFocus:V(e.onFocus,E=>{const T=!C.current;if(E.target===E.currentTarget&&T&&!_){const A=new CustomEvent(na,Mb);if(E.currentTarget.dispatchEvent(A),!A.defaultPrevented){const O=j().filter(I=>I.focusable),R=O.find(I=>I.active),L=O.find(I=>I.id===f),M=[R,L,...O].filter(Boolean).map(I=>I.ref.current);jc(M,u)}}C.current=!1}),onBlur:V(e.onBlur,()=>v(!1))})})}),yc="RovingFocusGroupItem",wc=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:i,children:s,...l}=e,c=Ae(),d=i||c,u=Bb(yc,r),p=u.currentTabStopId===d,m=bc(r),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:f}=u;return x.useEffect(()=>{if(n)return g(),()=>b()},[n,g,b]),a.jsx(oa.ItemSlot,{scope:r,id:d,focusable:n,active:o,children:a.jsx(W.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:V(e.onMouseDown,h=>{n?u.onItemFocus(d):h.preventDefault()}),onFocus:V(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:V(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){u.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const _=Wb(h,u.orientation,u.dir);if(_!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let w=m().filter(j=>j.focusable).map(j=>j.ref.current);if(_==="last")w.reverse();else if(_==="prev"||_==="next"){_==="prev"&&w.reverse();const j=w.indexOf(h.currentTarget);w=u.loop?qb(w,j+1):w.slice(j+1)}setTimeout(()=>jc(w))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:f!=null}):s})})});wc.displayName=yc;var Hb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Vb(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Wb(e,t,r){const n=Vb(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Hb[n]}function jc(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function qb(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Gb=vc,Kb=wc,En="Tabs",[Yb]=Ve(En,[_c]),Sc=_c(),[Xb,aa]=Yb(En),Cc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=ra(l),[p,m]=ct({prop:n,onChange:o,defaultProp:i??"",caller:En});return a.jsx(Xb,{scope:r,baseId:Ae(),value:p,onValueChange:m,orientation:s,dir:u,activationMode:c,children:a.jsx(W.div,{dir:u,"data-orientation":s,...d,ref:t})})});Cc.displayName=En;var kc="TabsList",Nc=x.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,i=aa(kc,r),s=Sc(r);return a.jsx(Gb,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:n,children:a.jsx(W.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});Nc.displayName=kc;var Ec="TabsTrigger",Tc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...i}=e,s=aa(Ec,r),l=Sc(r),c=Oc(s.baseId,n),d=Rc(s.baseId,n),u=n===s.value;return a.jsx(Kb,{asChild:!0,...l,focusable:!o,active:u,children:a.jsx(W.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...i,ref:t,onMouseDown:V(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?s.onValueChange(n):p.preventDefault()}),onKeyDown:V(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&s.onValueChange(n)}),onFocus:V(e.onFocus,()=>{const p=s.activationMode!=="manual";!u&&!o&&p&&s.onValueChange(n)})})})});Tc.displayName=Ec;var Ac="TabsContent",Pc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:i,...s}=e,l=aa(Ac,r),c=Oc(l.baseId,n),d=Rc(l.baseId,n),u=n===l.value,p=x.useRef(u);return x.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(Ye,{present:o||u,children:({present:m})=>a.jsx(W.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&i})})});Pc.displayName=Ac;function Oc(e,t){return`${e}-trigger-${t}`}function Rc(e,t){return`${e}-content-${t}`}var Jb=Cc,Zb=Nc,Qb=Tc,e_=Pc;function t_({className:e,...t}){return a.jsx(Jb,{"data-slot":"tabs",className:F("ecr-tabs",e),...t})}function r_({className:e,...t}){return a.jsx(Zb,{"data-slot":"tabs-list",className:F("ecr-tabs__list",e),...t})}function Lc({className:e,...t}){return a.jsx(Qb,{"data-slot":"tabs-trigger",className:F("ecr-tabs__trigger",e),...t})}function Ic({className:e,...t}){return a.jsx(e_,{"data-slot":"tabs-content",className:F("ecr-tabs__content",e),...t})}const xr=({label:e,text:t})=>a.jsxs(dt,{children:[a.jsx(ut,{style:{textAlign:"left",padding:0,backgroundColor:"transparent"},children:a.jsxs("label",{className:"ecr-admin-switch",children:[a.jsxs("span",{className:"ecr-admin-switch__label",children:[e,": ",a.jsx(_t,{size:20})]}),a.jsx(X0,{className:"ecr-admin-switch__icon",size:24})]})}),a.jsx(pt,{className:"ecr-admin-popover",children:a.jsx(Mt,{name:e,text:t})})]});function zc(e,[t,r]){return Math.min(r,Math.max(t,e))}function n_(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Mc=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),o_="VisuallyHidden",a_=x.forwardRef((e,t)=>a.jsx(W.span,{...e,ref:t,style:{...Mc,...e.style}}));a_.displayName=o_;var i_=[" ","Enter","ArrowUp","ArrowDown"],s_=[" ","Enter"],ft="Select",[Tn,An,l_]=xc(ft),[Ut]=Ve(ft,[l_,an]),Pn=an(),[c_,Ze]=Ut(ft),[d_,u_]=Ut(ft),Dc=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:p,disabled:m,required:g,form:b}=e,f=Pn(t),[h,_]=x.useState(null),[v,w]=x.useState(null),[j,C]=x.useState(!1),N=ra(d),[k,E]=ct({prop:n,defaultProp:o??!1,onChange:i,caller:ft}),[T,A]=ct({prop:s,defaultProp:l,onChange:c,caller:ft}),O=x.useRef(null),R=h?b||!!h.closest("form"):!0,[L,P]=x.useState(new Set),M=Array.from(L).map(I=>I.props.value).join(";");return a.jsx(Gs,{...f,children:a.jsxs(c_,{required:g,scope:t,trigger:h,onTriggerChange:_,valueNode:v,onValueNodeChange:w,valueNodeHasChildren:j,onValueNodeHasChildrenChange:C,contentId:Ae(),value:T,onValueChange:A,open:k,onOpenChange:E,dir:N,triggerPointerDownPosRef:O,disabled:m,children:[a.jsx(Tn.Provider,{scope:t,children:a.jsx(d_,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(I=>{P(B=>new Set(B).add(I))},[]),onNativeOptionRemove:x.useCallback(I=>{P(B=>{const z=new Set(B);return z.delete(I),z})},[]),children:r})}),R?a.jsxs(id,{"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:p,value:T,onChange:I=>A(I.target.value),disabled:m,form:b,children:[T===void 0?a.jsx("option",{value:""}):null,Array.from(L)]},M):null]})})};Dc.displayName=ft;var Fc="SelectTrigger",$c=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=Pn(r),s=Ze(Fc,r),l=s.disabled||n,c=J(t,s.onTriggerChange),d=An(r),u=x.useRef("touch"),[p,m,g]=ld(f=>{const h=d().filter(w=>!w.disabled),_=h.find(w=>w.value===s.value),v=cd(h,f,_);v!==void 0&&s.onValueChange(v.value)}),b=f=>{l||(s.onOpenChange(!0),g()),f&&(s.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return a.jsx(Ro,{asChild:!0,...i,children:a.jsx(W.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":sd(s.value)?"":void 0,...o,ref:c,onClick:V(o.onClick,f=>{f.currentTarget.focus(),u.current!=="mouse"&&b(f)}),onPointerDown:V(o.onPointerDown,f=>{u.current=f.pointerType;const h=f.target;h.hasPointerCapture(f.pointerId)&&h.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&f.pointerType==="mouse"&&(b(f),f.preventDefault())}),onKeyDown:V(o.onKeyDown,f=>{const h=p.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&m(f.key),!(h&&f.key===" ")&&i_.includes(f.key)&&(b(),f.preventDefault())})})})});$c.displayName=Fc;var Bc="SelectValue",Uc=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...l}=e,c=Ze(Bc,r),{onValueNodeHasChildrenChange:d}=c,u=i!==void 0,p=J(t,c.onValueNodeChange);return ce(()=>{d(u)},[d,u]),a.jsx(W.span,{...l,ref:p,style:{pointerEvents:"none"},children:sd(c.value)?a.jsx(a.Fragment,{children:s}):i})});Uc.displayName=Bc;var p_="SelectIcon",Hc=x.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return a.jsx(W.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Hc.displayName=p_;var m_="SelectPortal",Vc=e=>a.jsx(sn,{asChild:!0,...e});Vc.displayName=m_;var ht="SelectContent",Wc=x.forwardRef((e,t)=>{const r=Ze(ht,e.__scopeSelect),[n,o]=x.useState();if(ce(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?_r.createPortal(a.jsx(qc,{scope:e.__scopeSelect,children:a.jsx(Tn.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(Gc,{...e,ref:t})});Wc.displayName=ht;var ke=10,[qc,Qe]=Ut(ht),f_="SelectContentImpl",h_=nt("SelectContent.RemoveScroll"),Gc=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h,..._}=e,v=Ze(ht,r),[w,j]=x.useState(null),[C,N]=x.useState(null),k=J(t,$=>j($)),[E,T]=x.useState(null),[A,O]=x.useState(null),R=An(r),[L,P]=x.useState(!1),M=x.useRef(!1);x.useEffect(()=>{if(w)return Io(w)},[w]),xo();const I=x.useCallback($=>{const[Y,...oe]=R().map(re=>re.ref.current),[Z]=oe.slice(-1),Q=document.activeElement;for(const re of $)if(re===Q||(re?.scrollIntoView({block:"nearest"}),re===Y&&C&&(C.scrollTop=0),re===Z&&C&&(C.scrollTop=C.scrollHeight),re?.focus(),document.activeElement!==Q))return},[R,C]),B=x.useCallback(()=>I([E,w]),[I,E,w]);x.useEffect(()=>{L&&B()},[L,B]);const{onOpenChange:z,triggerPointerDownPosRef:q}=v;x.useEffect(()=>{if(w){let $={x:0,y:0};const Y=Z=>{$={x:Math.abs(Math.round(Z.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(Z.pageY)-(q.current?.y??0))}},oe=Z=>{$.x<=10&&$.y<=10?Z.preventDefault():w.contains(Z.target)||z(!1),document.removeEventListener("pointermove",Y),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",Y),document.addEventListener("pointerup",oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",oe,{capture:!0})}}},[w,z,q]),x.useEffect(()=>{const $=()=>z(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[z]);const[ae,ie]=ld($=>{const Y=R().filter(Q=>!Q.disabled),oe=Y.find(Q=>Q.ref.current===document.activeElement),Z=cd(Y,$,oe);Z&&setTimeout(()=>Z.ref.current.focus())}),ge=x.useCallback(($,Y,oe)=>{const Z=!M.current&&!oe;(v.value!==void 0&&v.value===Y||Z)&&(T($),Z&&(M.current=!0))},[v.value]),_e=x.useCallback(()=>w?.focus(),[w]),pe=x.useCallback(($,Y,oe)=>{const Z=!M.current&&!oe;(v.value!==void 0&&v.value===Y||Z)&&O($)},[v.value]),G=n==="popper"?ia:Kc,de=G===ia?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h}:{};return a.jsx(qc,{scope:r,content:w,viewport:C,onViewportChange:N,itemRefCallback:ge,selectedItem:E,onItemLeave:_e,itemTextRefCallback:pe,focusSelectedItem:B,selectedItemText:A,position:n,isPositioned:L,searchRef:ae,children:a.jsx(gn,{as:h_,allowPinchZoom:!0,children:a.jsx(Kr,{asChild:!0,trapped:v.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:V(o,$=>{v.trigger?.focus({preventScroll:!0}),$.preventDefault()}),children:a.jsx(Gr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:a.jsx(G,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:$=>$.preventDefault(),..._,...de,onPlaced:()=>P(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:V(_.onKeyDown,$=>{const Y=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!Y&&$.key.length===1&&ie($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let Z=R().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes($.key)&&(Z=Z.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const Q=$.target,re=Z.indexOf(Q);Z=Z.slice(re+1)}setTimeout(()=>I(Z)),$.preventDefault()}})})})})})})});Gc.displayName=f_;var g_="SelectItemAlignedPosition",Kc=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=Ze(ht,r),s=Qe(ht,r),[l,c]=x.useState(null),[d,u]=x.useState(null),p=J(t,k=>u(k)),m=An(r),g=x.useRef(!1),b=x.useRef(!0),{viewport:f,selectedItem:h,selectedItemText:_,focusSelectedItem:v}=s,w=x.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&f&&h&&_){const k=i.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),T=i.valueNode.getBoundingClientRect(),A=_.getBoundingClientRect();if(i.dir!=="rtl"){const Q=A.left-E.left,re=T.left-Q,ve=k.left-re,gt=k.width+ve,ga=Math.max(gt,E.width),xa=window.innerWidth-ke,ba=zc(re,[ke,Math.max(ke,xa-ga)]);l.style.minWidth=gt+"px",l.style.left=ba+"px"}else{const Q=E.right-A.right,re=window.innerWidth-T.right-Q,ve=window.innerWidth-k.right-re,gt=k.width+ve,ga=Math.max(gt,E.width),xa=window.innerWidth-ke,ba=zc(re,[ke,Math.max(ke,xa-ga)]);l.style.minWidth=gt+"px",l.style.right=ba+"px"}const O=m(),R=window.innerHeight-ke*2,L=f.scrollHeight,P=window.getComputedStyle(d),M=parseInt(P.borderTopWidth,10),I=parseInt(P.paddingTop,10),B=parseInt(P.borderBottomWidth,10),z=parseInt(P.paddingBottom,10),q=M+I+L+z+B,ae=Math.min(h.offsetHeight*5,q),ie=window.getComputedStyle(f),ge=parseInt(ie.paddingTop,10),_e=parseInt(ie.paddingBottom,10),pe=k.top+k.height/2-ke,G=R-pe,de=h.offsetHeight/2,$=h.offsetTop+de,Y=M+I+$,oe=q-Y;if(Y<=pe){const Q=O.length>0&&h===O[O.length-1].ref.current;l.style.bottom="0px";const re=d.clientHeight-f.offsetTop-f.offsetHeight,ve=Math.max(G,de+(Q?_e:0)+re+B),gt=Y+ve;l.style.height=gt+"px"}else{const Q=O.length>0&&h===O[0].ref.current;l.style.top="0px";const ve=Math.max(pe,M+f.offsetTop+(Q?ge:0)+de)+oe;l.style.height=ve+"px",f.scrollTop=Y-pe+f.offsetTop}l.style.margin=`${ke}px 0`,l.style.minHeight=ae+"px",l.style.maxHeight=R+"px",n?.(),requestAnimationFrame(()=>g.current=!0)}},[m,i.trigger,i.valueNode,l,d,f,h,_,i.dir,n]);ce(()=>w(),[w]);const[j,C]=x.useState();ce(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);const N=x.useCallback(k=>{k&&b.current===!0&&(w(),v?.(),b.current=!1)},[w,v]);return a.jsx(b_,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:N,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:a.jsx(W.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Kc.displayName=g_;var x_="SelectPopperPosition",ia=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=ke,...i}=e,s=Pn(r);return a.jsx(Ks,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ia.displayName=x_;var[b_,sa]=Ut(ht,{}),la="SelectViewport",Yc=x.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=Qe(la,r),s=sa(la,r),l=J(t,i.onViewportChange),c=x.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),a.jsx(Tn.Slot,{scope:r,children:a.jsx(W.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:V(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=s;if(m?.current&&p){const g=Math.abs(c.current-u.scrollTop);if(g>0){const b=window.innerHeight-ke*2,f=parseFloat(p.style.minHeight),h=parseFloat(p.style.height),_=Math.max(f,h);if(_<b){const v=_+g,w=Math.min(b,v),j=v-w;p.style.height=w+"px",p.style.bottom==="0px"&&(u.scrollTop=j>0?j:0,p.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Yc.displayName=la;var Xc="SelectGroup",[__,v_]=Ut(Xc),y_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ae();return a.jsx(__,{scope:r,id:o,children:a.jsx(W.div,{role:"group","aria-labelledby":o,...n,ref:t})})});y_.displayName=Xc;var Jc="SelectLabel",w_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=v_(Jc,r);return a.jsx(W.div,{id:o.id,...n,ref:t})});w_.displayName=Jc;var On="SelectItem",[j_,Zc]=Ut(On),Qc=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,l=Ze(On,r),c=Qe(On,r),d=l.value===n,[u,p]=x.useState(i??""),[m,g]=x.useState(!1),b=J(t,v=>c.itemRefCallback?.(v,n,o)),f=Ae(),h=x.useRef("touch"),_=()=>{o||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(j_,{scope:r,value:n,disabled:o,textId:f,isSelected:d,onItemTextChange:x.useCallback(v=>{p(w=>w||(v?.textContent??"").trim())},[]),children:a.jsx(Tn.ItemSlot,{scope:r,value:n,disabled:o,textValue:u,children:a.jsx(W.div,{role:"option","aria-labelledby":f,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:b,onFocus:V(s.onFocus,()=>g(!0)),onBlur:V(s.onBlur,()=>g(!1)),onClick:V(s.onClick,()=>{h.current!=="mouse"&&_()}),onPointerUp:V(s.onPointerUp,()=>{h.current==="mouse"&&_()}),onPointerDown:V(s.onPointerDown,v=>{h.current=v.pointerType}),onPointerMove:V(s.onPointerMove,v=>{h.current=v.pointerType,o?c.onItemLeave?.():h.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:V(s.onPointerLeave,v=>{v.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:V(s.onKeyDown,v=>{c.searchRef?.current!==""&&v.key===" "||(s_.includes(v.key)&&_(),v.key===" "&&v.preventDefault())})})})})});Qc.displayName=On;var br="SelectItemText",ed=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=Ze(br,r),l=Qe(br,r),c=Zc(br,r),d=u_(br,r),[u,p]=x.useState(null),m=J(t,_=>p(_),c.onItemTextChange,_=>l.itemTextRefCallback?.(_,c.value,c.disabled)),g=u?.textContent,b=x.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:f,onNativeOptionRemove:h}=d;return ce(()=>(f(b),()=>h(b)),[f,h,b]),a.jsxs(a.Fragment,{children:[a.jsx(W.span,{id:c.textId,...i,ref:m}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?_r.createPortal(i.children,s.valueNode):null]})});ed.displayName=br;var td="SelectItemIndicator",rd=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Zc(td,r).isSelected?a.jsx(W.span,{"aria-hidden":!0,...n,ref:t}):null});rd.displayName=td;var ca="SelectScrollUpButton",nd=x.forwardRef((e,t)=>{const r=Qe(ca,e.__scopeSelect),n=sa(ca,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return ce(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollTop>0;i(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});nd.displayName=ca;var da="SelectScrollDownButton",od=x.forwardRef((e,t)=>{const r=Qe(da,e.__scopeSelect),n=sa(da,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return ce(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;i(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});od.displayName=da;var ad=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=Qe("SelectScrollButton",r),s=x.useRef(null),l=An(r),c=x.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return x.useEffect(()=>()=>c(),[c]),ce(()=>{l().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),a.jsx(W.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:V(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:V(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:V(o.onPointerLeave,()=>{c()})})}),S_="SelectSeparator",C_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(W.div,{"aria-hidden":!0,...n,ref:t})});C_.displayName=S_;var ua="SelectArrow",k_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Pn(r),i=Ze(ua,r),s=Qe(ua,r);return i.open&&s.position==="popper"?a.jsx(Ys,{...o,...n,ref:t}):null});k_.displayName=ua;var N_="SelectBubbleInput",id=x.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=x.useRef(null),i=J(n,o),s=n_(t);return x.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(s!==t&&u){const p=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(p)}},[s,t]),a.jsx(W.select,{...r,style:{...Mc,...r.style},ref:i,defaultValue:t})});id.displayName=N_;function sd(e){return e===""||e===void 0}function ld(e){const t=We(e),r=x.useRef(""),n=x.useRef(0),o=x.useCallback(s=>{const l=r.current+s;t(l),(function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),i=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function cd(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=E_(e,Math.max(i,0));o.length===1&&(s=s.filter(d=>d!==r));const c=s.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function E_(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var T_=Dc,A_=$c,P_=Uc,O_=Hc,R_=Vc,L_=Wc,I_=Yc,z_=Qc,M_=ed,D_=rd,F_=nd,$_=od;function Ht({...e}){return a.jsx(T_,{"data-slot":"select",...e})}function Vt({...e}){return a.jsx(P_,{"data-slot":"select-value",...e})}function Wt({className:e,size:t="default",children:r,...n}){return a.jsxs(A_,{"data-slot":"select-trigger","data-size":t,className:F("ecr-select__trigger",e),...n,children:[r,a.jsx(O_,{asChild:!0,children:a.jsx(fo,{className:"ecr-select__icon"})})]})}function qt({className:e,children:t,position:r="popper",align:n="center",...o}){const i=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(R_,{container:i,children:a.jsxs(L_,{"data-slot":"select-content",className:F("ecr-select__content",e),position:r,align:n,...o,children:[a.jsx(B_,{}),a.jsx(I_,{className:F("ecr-select__viewport"),children:t}),a.jsx(U_,{})]})})}function Gt({className:e,children:t,...r}){return a.jsxs(z_,{"data-slot":"select-item",className:F("ecr-select__item",e),...r,children:[a.jsx("span",{className:"ecr-select__check",children:a.jsx(D_,{children:a.jsx(Df,{className:"ecr-select__check-icon"})})}),a.jsx(M_,{children:t})]})}function B_({className:e,...t}){return a.jsx(F_,{"data-slot":"select-scroll-up-button",className:F("ecr-select__scroll-button",e),...t,children:a.jsx(Ff,{className:"ecr-select__icon"})})}function U_({className:e,...t}){return a.jsx($_,{"data-slot":"select-scroll-down-button",className:F("ecr-select__scroll-button",e),...t,children:a.jsx(fo,{className:"ecr-select__icon"})})}const H_=({appearance:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsx(qt,{children:Yu.map(r=>a.jsx(Gt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),V_={vertical:a.jsx(a.Fragment,{children:"Offer a mobile-first experience with vertical scroll Reels in your widget for better engagement and infinite scrolling!"})};function W_(){return a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Slide Direction:"}),a.jsxs(Ht,{defaultValue:Za[0].value,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsxs(qt,{children:[Za.map(e=>a.jsx(Gt,{value:e.value,className:"ecr-admin-control__option",children:e.label},e.value)),qu.map(e=>a.jsx("div",{children:a.jsxs(dt,{modal:!0,children:[a.jsxs(ut,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:e.label}),a.jsx(_t,{size:18})]}),a.jsx(pt,{className:"ecr-admin-control__popover",children:a.jsx(Mt,{name:e.label,text:V_[e.value]})})]})},e.value))]})]})]})}const q_=({styles:e,updateStyles:t})=>a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(xr,{label:"Disable Preview",text:a.jsx(a.Fragment,{children:"Turn off previews for a cleaner look and a more focused browsing experience!"})}),a.jsx(W_,{}),a.jsx(H_,{appearance:e?.playerAppearance??"overlay",handleLinkLayout:r=>t(n=>({...n,playerAppearance:r}))})]});var Rn="Collapsible",[G_]=Ve(Rn),[K_,pa]=G_(Rn),dd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:i,onOpenChange:s,...l}=e,[c,d]=ct({prop:n,defaultProp:o??!1,onChange:s,caller:Rn});return a.jsx(K_,{scope:r,disabled:i,contentId:Ae(),open:c,onOpenToggle:x.useCallback(()=>d(u=>!u),[d]),children:a.jsx(W.div,{"data-state":fa(c),"data-disabled":i?"":void 0,...l,ref:t})})});dd.displayName=Rn;var ud="CollapsibleTrigger",pd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=pa(ud,r);return a.jsx(W.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":fa(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:V(e.onClick,o.onOpenToggle)})});pd.displayName=ud;var ma="CollapsibleContent",md=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=pa(ma,e.__scopeCollapsible);return a.jsx(Ye,{present:r||o.open,children:({present:i})=>a.jsx(Y_,{...n,ref:t,present:i})})});md.displayName=ma;var Y_=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...i}=e,s=pa(ma,r),[l,c]=x.useState(n),d=x.useRef(null),u=J(t,d),p=x.useRef(0),m=p.current,g=x.useRef(0),b=g.current,f=s.open||l,h=x.useRef(f),_=x.useRef(void 0);return x.useEffect(()=>{const v=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(v)},[]),ce(()=>{const v=d.current;if(v){_.current=_.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();p.current=w.height,g.current=w.width,h.current||(v.style.transitionDuration=_.current.transitionDuration,v.style.animationName=_.current.animationName),c(n)}},[s.open,n]),a.jsx(W.div,{"data-state":fa(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!f,...i,ref:u,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:f&&o})});function fa(e){return e?"open":"closed"}var X_=dd,J_=pd,Z_=md;function fd({className:e,...t}){return a.jsx(X_,{"data-slot":"collapsible",className:F("ecr-collapsible",e),...t})}function hd({className:e,children:t,...r}){return a.jsxs(J_,{"data-slot":"collapsible-trigger",className:F("ecr-collapsible__trigger",e),...r,children:[a.jsx("span",{className:"ecr-collapsible__trigger-label",children:t}),a.jsx(fo,{className:"ecr-collapsible__trigger-icon"})]})}function gd({className:e,...t}){return a.jsx(Z_,{"data-slot":"collapsible-content",className:F("ecr-collapsible__content",e),...t})}const Q_={modern:a.jsx(a.Fragment,{children:"Give your reel’s product card a sleek, modern appearance that feels fresh, clean, and visually engaging."}),classic:a.jsx(a.Fragment,{children:"Give your reel’s product card a timeless, classic appearance that feels familiar, simple, and easy to recognize."})},ev=({linkLayout:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsxs(qt,{children:[Gu.map(r=>a.jsx(Gt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value)),Ku.map(r=>a.jsx("div",{children:a.jsxs(dt,{modal:!0,children:[a.jsxs(ut,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r.label}),a.jsx(_t,{size:18})]}),a.jsx(pt,{className:"ecr-admin-control__popover",children:a.jsx(Mt,{name:r.label,text:Q_[r.value]})})]})},r.value))]})]})]}),tv=[{Icon:Wf,label:"Desktop",value:"desktop"},{Icon:Xf,label:"Tab",value:"tab"},{Icon:Gf,label:"Mobile",value:"mobile"}],xd=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:c,device:d,setDevice:u})=>{const[p,m]=y.useState(n),g=y.useRef(null);y.useEffect(()=>{m(n)},[n]);const b=h=>{const _=Math.min(r,Math.max(t,Number(h)));o(_)},f=h=>{const _=Number(h);m(_),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{b(_>r?r:_<t?t:_)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":",a.jsxs(Ht,{value:d,onValueChange:h=>u(h),children:[a.jsx(Wt,{style:{padding:"4px 4px 0px",height:"24px",gap:"4px"},children:a.jsx(Vt,{})}),a.jsx(qt,{style:{minWidth:"60px"},children:tv.map(h=>a.jsx(Gt,{value:h.value,title:h.label,children:a.jsx(h.Icon,{size:16})},h.value))})]})]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:h=>{const _=Number(h.target.value);m(_),b(_)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(Jo,{type:"number",min:t,max:r,value:p,onChange:h=>f(h.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})},rv=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("desktop"),i={mobile:e?.gapOnMobile,tab:e?.gapOnTab,desktop:e?.gap}[r]??e?.gap,s=l=>{switch(r){case"mobile":t(c=>({...c,gapOnMobile:l}));break;case"tab":t(c=>({...c,gapOnTab:l}));break;default:t(c=>({...c,gap:l}));break}};return a.jsx(xd,{label:"Gap",min:0,max:80,value:i,onChange:s,name:"column_gap",id:"column-gap",device:r,setDevice:n})},nv=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("desktop"),i={mobile:e?.sizeOnMobile,tab:e?.sizeOnTab,desktop:e?.size}[r]??e?.size,s=l=>{switch(r){case"mobile":t(c=>({...c,sizeOnMobile:l}));break;case"tab":t(c=>({...c,sizeOnTab:l}));break;default:t(c=>({...c,size:l}));break}};return a.jsx(xd,{label:"Size",min:150,max:400,value:i,onChange:s,name:"size",id:"size",device:r,setDevice:n})},ov=[{value:"rectangle",label:"Rectangle"},{value:"circle",label:"Circle"}],av=({selectedShape:e,handleShape:t})=>{const r=n=>{t(n.target.id)};return a.jsxs("div",{className:"ecr-admin-control",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Shape:"}),a.jsx("div",{className:"ecr-admin-control__row",children:ov.map(n=>a.jsxs("div",{className:"ecr-admin-control__choice",children:[a.jsx("input",{type:"radio",name:"shape",id:n.value,checked:e===n.value,onChange:r,style:{display:"none"}}),a.jsxs("label",{className:"ecr-admin-control__choice-label",htmlFor:n.value,children:[e===n.value?a.jsx(Gp,{color:"#2563eb",size:16}):a.jsx(Kp,{color:"#8c95a9",size:16}),n.label]})]},n.value))})]})},iv=Object.values(Ja),sv={marquee:a.jsx(a.Fragment,{children:"Create infinite, auto-scrolling video playlists with the Marquee layout template for endless engagement!"}),stacked:a.jsx(a.Fragment,{children:"Display Reels in a stacked layout for an interactive and shopable video experience!"})},lv=({selectedLayout:e,handleLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Template:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsxs(qt,{children:[iv.map(r=>a.jsx(Gt,{value:r,className:"ecr-admin-control__option",children:r},r)),Vu.map(r=>a.jsx("div",{children:a.jsxs(dt,{modal:!0,children:[a.jsxs(ut,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r}),a.jsx(_t,{size:18})]}),a.jsx(pt,{className:"ecr-admin-control__popover",children:a.jsx(Mt,{name:r,text:sv[r]})})]})},r))]})]})]}),cv=({isLayoutOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(fd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(hd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("layout"),children:[a.jsx(Uf,{size:16})," ",a.jsx("span",{children:"Layout"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(av,{selectedShape:r?.shape,handleShape:o=>n(i=>({...i,shape:o}))}),a.jsx(lv,{selectedLayout:r?.template??"carousel",handleLayout:o=>n(i=>({...i,template:o}))}),a.jsx(ev,{linkLayout:r?.appearance??"overlay",handleLinkLayout:o=>n(i=>({...i,appearance:o}))}),a.jsx(nv,{styles:r,updateStyles:n}),a.jsx(rv,{styles:r,updateStyles:n}),a.jsx(xr,{label:"Show Views",text:a.jsx(a.Fragment,{children:"Hide view counts to remove distractions and provide a cleaner, more focused visual experience!"})}),a.jsx(xr,{label:"Autoplay",text:a.jsx(a.Fragment,{children:"Enable autoplay for videos on your product and pages, capturing users' attention instantly!"})}),a.jsx(xr,{label:"Show Add to Cart",text:a.jsx(a.Fragment,{children:"Show a clear “Add to Cart” button on your tagged product to encourage quick purchases and boost conversions."})}),a.jsx(xr,{label:"Drag to Sort",text:a.jsx(a.Fragment,{children:"Easily rearrange your best-performing Reels to keep your content fresh and in the right order!"})})]})]}),dv=({hoverEffect:e,handleHoverEffect:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Hove Effect:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsx(qt,{children:Wu.map(r=>a.jsx(Gt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),uv=({isStyleOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(fd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(hd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("style"),children:[a.jsx(qf,{size:16}),a.jsx("span",{children:"Styles"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(Zo,{label:"Border Width",min:0,max:12,value:r?.border?.border_width??0,onChange:o=>n(i=>({...i,border:{...i.border,border_width:o}})),name:"border_width",id:"border-width"}),a.jsx(dc,{selectedColor:r?.border?.border_color,handleColor:o=>n(i=>({...i,border:{...i.border,border_color:o}})),text:"Border Color"}),r?.shape==="rectangle"&&a.jsx(Zo,{label:"Border Radius",min:0,max:99,value:r?.border?.border_radius??0,onChange:o=>n(i=>({...i,border:{...i.border,border_radius:o}})),name:"border_radius",id:"border-radius"}),a.jsx(dv,{hoverEffect:r?.hoverEffect||"none",handleHoverEffect:o=>n(i=>({...i,hoverEffect:o}))})]})]}),pv=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("layout"),o=r==="layout",i=r==="style",s=l=>{n(r!==l?l:null)};return a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(cv,{handleSectionOpen:s,isLayoutOpen:o,styles:e,updateStyles:t}),a.jsx(uv,{isStyleOpen:i,handleSectionOpen:s,styles:e,updateStyles:t})]})},mv=({styles:e,setStyles:t,isExpanded:r,setIsExpanded:n,setIsEdited:o,tabs:i,currentTab:s,setCurrentTab:l})=>{const c=u=>{t(p=>{const m=u(p);return o(!0),m})},d=u=>{(u===i.thumbnail||u===i.preview)&&l(u)};return a.jsxs("div",{className:F("ecr-admin-sidepanel",r?"ecr-admin-sidepanel--expanded":"ecr-admin-sidepanel--collapsed"),children:[r&&a.jsx("div",{className:"ecr-admin-mobile-overlay",onClick:()=>n(!1)}),a.jsxs("div",{className:"ecr-admin-sidepanel-content",children:[a.jsxs("div",{className:"ecr-admin-sidepanel__header",children:[a.jsx("p",{className:"ecr-admin-sidepanel__title",children:"Customization"}),a.jsx("small",{className:"ecr-admin-sidepanel__subtitle",children:"Customize your widget however you like"})]}),a.jsx("div",{className:"ecr-admin-sidepanel__body",children:a.jsxs(t_,{value:s,onValueChange:d,className:"ecr-admin-sidepanel__tabs",children:[a.jsxs(r_,{className:"ecr-admin-sidepanel__tabs-list",children:[a.jsx(Lc,{value:i.thumbnail,children:"Thumbnail"}),a.jsx(Lc,{value:i.preview,children:"Preview"})]}),a.jsx(Ic,{value:i.thumbnail,children:a.jsx(pv,{styles:e,updateStyles:c})}),a.jsx(Ic,{value:i.preview,children:a.jsx(q_,{styles:e,updateStyles:c})})]})})]})]})},fv=e=>{const t=Ne(),[r,n]=y.useState(""),[o,i]=y.useState([]),[s,l]=y.useState(tt),[c,d]=y.useState(!0),[u,p]=y.useState(!1),[m,g]=y.useState(!1);y.useEffect(()=>{(async()=>{if(!e){d(!1);return}d(!0);try{const v=(await he.get(`stories/${e}`)).data;n(v.group_name),i(v.stories),l(v.styles??tt)}catch(_){_ instanceof Error?K.error(_.message):K.error("Something went wrong. Try again later!")}finally{d(!1)}})()},[e]);const b=async h=>{const _=o.map(j=>j.id),v={group_name:r,styles:s,story_ids:_};e&&(v.group_id=e);const w=await he.post("stories/manage-group-stories",v);if(!e){const j=w.data.group_id;t(`?view=${X.mg}&gid=${j}`,{replace:!0})}return{...w.data,isNewGroup:!e}};return{groupTitle:r,setGroupTitle:n,thisGroupReels:o,setThisGroupReels:i,styles:s,setStyles:l,isLoading:c,isSaving:u,isEdited:m,setIsEdited:g,handleSave:async()=>{try{p(!0);const h=await b();return g(!1),K.success("Changes saved successfully!"),h}catch(h){return h instanceof Error?K.error(h.message):K.error("Something went wrong. Try again later!"),null}finally{p(!1)}}}},hv=e=>{const[t,r]=y.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return y.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia(e),o=i=>{r(i.matches)};return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[e]),t},gv=e=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useRef(null),i=y.useRef(!1),s=y.useRef(typeof window<"u"?window.location.hash:"");return y.useEffect(()=>{e||(n.current=null,o.current=null,r(!1))},[e]),y.useEffect(()=>{if(!e)return;const p=m=>{m.preventDefault(),m.returnValue=""};return window.addEventListener("beforeunload",p),()=>window.removeEventListener("beforeunload",p)},[e]),y.useEffect(()=>{const p=()=>{const m=window.location.hash;if(!e){s.current=m;return}if(i.current){i.current=!1,s.current=m;return}m!==s.current&&(o.current=m,window.location.hash=s.current,r(!0))};return window.addEventListener("hashchange",p),()=>window.removeEventListener("hashchange",p)},[e]),{showLeaveModal:t,requestLeave:p=>{if(!e){p();return}n.current=p,r(!0)},confirmLeave:()=>{if(r(!1),n.current){const p=n.current;n.current=null,i.current=!0,p();return}if(o.current){const p=o.current;o.current=null,i.current=!0,window.location.hash=p}},cancelLeave:()=>{n.current=null,o.current=null,r(!1)},allowNextNavigation:p=>{i.current=!0,p()}}},bd={thumbnail:"thumbnail",preview:"preview"},xv=()=>{const e=Ne(),[t]=Jt(),r=t.get("gid"),n=hv("(min-width: 1024px)"),{groupTitle:o,setGroupTitle:i,thisGroupReels:s,setThisGroupReels:l,styles:c,setStyles:d,isLoading:u,isSaving:p,isEdited:m,setIsEdited:g,handleSave:b}=fv(r),{allReels:f,searchTerm:h,setSearchTerm:_,isSearching:v,lastStoryElementRef:w,refreshReels:j}=Zi(r),[C,N]=y.useState(""),[k,E]=y.useState(n),[T,A]=y.useState(bd.thumbnail),[O,R]=y.useState([]),L=y.useMemo(()=>new Set(s.map(G=>G.story_uuid)),[s]),P=y.useMemo(()=>h.trim().toLowerCase(),[h]),M=y.useMemo(()=>P?O.filter(G=>G.title.toLowerCase().includes(P)):O,[O,P]),I=y.useMemo(()=>{const G=new Map;for(const de of M)G.set(de.story_uuid,de);for(const de of f)G.has(de.story_uuid)||G.set(de.story_uuid,de);return Array.from(G.values())},[M,f]),B=y.useMemo(()=>I.filter(G=>!L.has(G.story_uuid)),[I,L]);y.useEffect(()=>{E(n)},[n]),y.useEffect(()=>{R([])},[r]);const{showLeaveModal:z,requestLeave:q,confirmLeave:ae,cancelLeave:ie,allowNextNavigation:ge}=gv(m),_e=async(G,de)=>{try{N(G.story_uuid);const $=de==="add"?[G,...s]:s.filter(Y=>Y.story_uuid!==G.story_uuid);l($),R(de==="add"?Y=>Y.filter(oe=>oe.story_uuid!==G.story_uuid):Y=>Y.some(oe=>oe.story_uuid===G.story_uuid)?Y:[G,...Y]),g(!0)}catch($){$ instanceof Error?K.error($.message):K.error("Something went wrong. Please try again later!")}finally{N("")}},pe=async()=>{const G=await b();G&&(R([]),j()),G?.isNewGroup&&ge(()=>{e(`?view=${X.mg}&gid=${G.group_id}`,{replace:!0})})};return u?a.jsx(Ir,{}):a.jsxs(kb,{value:{requestLeave:q},children:[a.jsx(jt,{left:[a.jsx(St,{name:"Manage Widget",Icon:Or},"page"),a.jsx(rr,{cb:()=>q(()=>e(`?view=${X.ag}`))},"back")],center:[a.jsxs("div",{className:"ecr-admin-group-title__wrapper",children:[a.jsx(Qi,{placeholder:"Enter group title",title:o,setTitle:i,setIsEdited:g,style:{paddingInline:"32px"}}),o&&a.jsxs(Vo,{children:[a.jsx(Wo,{className:"ecr-admin-group-title-customization__trigger",children:a.jsx(Z0,{})}),a.jsxs(qo,{className:"ecr-admin-group-title-customization-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Customize title appearance"})}),a.jsx(jb,{styles:c,setStyles:d,setIsEdited:g}),a.jsx("div",{style:{display:"flex",justifyContent:"end",marginTop:40},children:a.jsx(S0,{asChild:!0,children:a.jsx(te,{style:{paddingInline:40},variant:"outline",children:"Ok"})})})]})]})]},"title")],right:[a.jsx(J0,{isExpanded:k,setIsExpanded:E},"toggle"),a.jsx(uo,{onSave:pe,isSaving:p,disabled:!m},"save")],rightClass:"ecr-admin-nav-btn-reverse"}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Manage Widget"}],onNavigate:G=>q(()=>e(G))}),a.jsxs("div",{className:"ecr-admin-group-edit",children:[a.jsx(Ib,{allReels:B,gid:r,handleSelectReel:_e,searchTerm:h,setSearchTerm:_,isSearching:v,togglingId:C,lastStoryElementRef:w}),a.jsx(Lb,{gid:r,reels:s,styles:c,handleRemoveReel:_e,togglingId:C,currentTab:T}),k&&a.jsx(mv,{isExpanded:k,setIsExpanded:E,setIsEdited:g,styles:c,setStyles:d,tabs:bd,setCurrentTab:A,currentTab:T})]}),z&&a.jsx(Rr,{onReject:ie,onAccept:ae,isLoading:!1,message:"You have unsaved changes. Leave this page without saving?"})]})};function bv(){const[e]=Jt(),t=e.get("view")||X.ag;let r;switch(t){case X.settings:r=a.jsx(W0,{});break;case X.ar:r=a.jsx(kf,{});break;case X.stat:r=a.jsx(K0,{});break;case X.cr:r=a.jsx(I0,{});break;case X.mg:r=a.jsx(xv,{});break;default:r=a.jsx(H0,{})}return a.jsxs("div",{children:[r,a.jsx(Hu,{position:"top-right",toastOptions:{style:{padding:"16px",marginTop:"24px",fontSize:"16px"}}})]})}const _d=async(e,t,r,n={})=>{try{if(await he.post(`group/${e}/story/${t}/view`),n.isActive&&!n.isActive())return;r(o=>({...o,[t]:Number(o[t]||0)+1}))}catch{}},vd=e=>!!e?.files?.[0]?.mime_type?.startsWith("video"),_v=()=>{const e=y.useContext(ha);if(!e)throw new Error("useVideoPlayer must be used inside PublicStoryContext");const{styles:t,stories:r,groupId:n,isPlaying:o,setIsPlaying:i,setStoryViews:s}=e,[l,c]=y.useState(r.length-1),[d,u]=y.useState(null),[p,m]=y.useState(!0),[g,b]=y.useState(0),[f,h]=y.useState(!1),[_,v]=y.useState({index:0,story_uuid:r[0]?.story_uuid??""}),w=d?.links&&d.links.length>0?d.links[0]:null,j=t?.playerAppearance??"overlay",C=y.useRef(""),N=y.useCallback((L,P=1)=>{if(r.length===0)return null;let M=L;for(let I=0;I<r.length;I+=1){const B=r[M];if(vd(B))return{story:B,index:M};M=(M+P+r.length)%r.length}return null},[r]),k=y.useCallback(()=>{c(r.length-1);const L=r.findIndex(I=>String(I.story_uuid)===o),P=L>=0?r[L]:null,M=vd(P)?{story:P,index:L}:N(Math.max(L,0),1);if(!M?.story){u(null),m(!1);return}u(M.story),L!==M.index&&M.story.story_uuid!==o&&i(M.story.story_uuid),v({index:0,story_uuid:M.story.story_uuid}),m(!1)},[N,o,i,r]);y.useEffect(()=>{k()},[k]),y.useEffect(()=>(C.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=C.current}),[]);const E=y.useCallback(()=>{i(null)},[i]),T=y.useCallback((L=1)=>{m(!0);const P=r.findIndex(q=>String(q.story_uuid)===String(o)),M=L>0?1:-1,I=L>0?l>P?P+1:0:P>0?P-1:l,B=N(I,M);if(!B?.story){m(!1);return}const z=B.story;if(z.story_uuid===o){m(!1),E();return}v({index:0,story_uuid:z.story_uuid}),n&&_d(n,z.id,s),i(z.story_uuid),m(!1)},[E,N,n,o,l,i,s,r]),A=y.useCallback(()=>{const L=d?.files??[];if(_.index>0){v(P=>({index:P.index-1,story_uuid:L[P.index-1].story_uuid??""}));return}T(-1)},[_.index,T,d?.files]),O=y.useCallback(()=>{const L=d?.files??[];if(_.index+1<L.length){v(P=>({index:P.index+1,story_uuid:L[P.index+1].story_uuid??""}));return}T(1)},[_.index,T,d?.files]),R=y.useCallback(L=>{L.target===L.currentTarget&&E()},[E]);return{closePlayer:E,currentFileIndex:_,duration:g,handleBackdropClick:R,handleNextFile:O,handlePrevFile:A,isLoadingNext:p,isPaused:f,playingStory:d,setDuration:b,setIsPaused:h,setIsPlaying:i,firstLink:w,playerAppearance:j}},vv=()=>a.jsx(a.Fragment,{children:a.jsx("div",{className:"ecr-player__loader",children:a.jsxs("div",{className:"ecr-loader",children:[a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"})]})})}),yv=()=>{const{closePlayer:e,currentFileIndex:t,duration:r,handleBackdropClick:n,handleNextFile:o,handlePrevFile:i,isLoadingNext:s,isPaused:l,playerAppearance:c,playingStory:d,firstLink:u,setDuration:p,setIsPaused:m,setIsPlaying:g}=_v();return a.jsx("div",{onClick:n,className:"ecommreels-story-modal ecr-player",children:d&&a.jsxs("div",{className:"ecr-player__stage",children:[a.jsx(yt,{onClick:i,className:"ecr-player__nav--left",children:a.jsx(Qt,{size:24})}),a.jsx(yt,{onClick:o,className:"ecr-player__nav--right",children:a.jsx(er,{size:24})}),a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[d&&a.jsx(ii,{playingStory:d,duration:r,currentFileIndex:t,isPaused:l},`${d.story_uuid}-${t.index}`),a.jsx("div",{onClick:e,className:"ecr-player__close",children:a.jsx(tr,{className:"ecr-player__close-icon"})}),s?a.jsx(vv,{}):d?.files.length>0&&a.jsx(di,{currentFileIndex:t,files:d?.files,setDuration:p,setIsPlaying:g,isPaused:l,setIsPaused:m,handlePrevFile:i,handleNextFile:o,storyId:d.id,storyTitle:d?.title}),c==="overlay"?u?a.jsx(Nn,{link:u,usedFor:"user",usedIn:"player",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Bt,{title:d.title}):null,c==="title"?a.jsx(Bt,{title:d.title}):null]})]})})},yd=({story:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const i=t.appearance??"overlay",s=e.links&&e.links.length>0?e.links[0]:null,l=i==="none",c=i==="title",d=t.shape==="rectangle",u=!l&&!c&&s,p=t.border.border_radius,m=p>50?p+16:p>20?p:0;return a.jsxs("div",{className:`ecr-thumb ${t.hoverEffect??""}`,children:[a.jsxs("div",{onClick:()=>r({sid:e.id,story_uuid:e.story_uuid}),className:"ecr-thumb__frame",style:{border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t.shape==="rectangle"?"9/16":"1/1"},children:[a.jsx(Jn,{story:e,styles:t,storyViews:n,setStoryViews:o}),!l&&!c&&d?u?a.jsx(Nn,{link:s,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null]}),c?a.jsx("p",{className:"ecr-reel__title",children:e.title}):null]})},wv=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=fc([e],!0);return a.jsxs("div",{className:"ecr-front-carousel",children:[a.jsx("div",{ref:i,className:"ecr-front-carousel__viewport",children:a.jsx("div",{ref:s,className:t.hoverEffect==="zoom-in"?"ecr-front-carousel__track ecr-front-carousel__track--zoom":"ecr-front-carousel__track",children:e?.map(m=>m?.files[0]?.mime_type.startsWith("video")?a.jsx(yd,{story:m,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},m.story_uuid):null)})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--left",children:a.jsx(Qt,{size:20,style:{width:"20px",height:"20px"}})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--right",children:a.jsx(er,{size:20,style:{width:"20px",height:"20px"}})})]})},wd=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>a.jsx("div",{className:"ecr-front-grid",children:a.jsx("div",{style:{paddingBlock:`${t.topBottomSpacing}px`},className:"ecr-front-grid__list",children:e?.map(i=>i?.files[0]?.mime_type.startsWith("video")?a.jsx(yd,{story:i,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},i.story_uuid):null)})}),jv={carousel:wv,grid:wd},Sv=()=>{const e=y.useContext(ha),{groupTitle:t,styles:r,stories:n,groupId:o,setIsPlaying:i,storyViews:s,setStoryViews:l}=e,c=y.useRef(!0);y.useEffect(()=>(c.current=!0,()=>{c.current=!1}),[]);const d=r.template??"carousel",u=jv[d]||wd,p=({sid:m,story_uuid:g})=>{i(g),o&&_d(o,m,l,{isActive:()=>c.current})};return a.jsxs("div",{style:{"--thumbnail-size":r.template==="grid"?"auto":`${r?.size}px`,"--thumbnail-size-grid":`${r?.size}px`,"--thumbnail-size-tab":r.template==="grid"?"auto":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-grid-tab":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-mobile":r.template==="grid"?"auto":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-size-grid-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-tab":`${r?.gapOnTab??r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},children:[r?.widgetTitle&&r?.widgetTitle?.alignment!=="hidden"&&t?a.jsx("h2",{style:{textAlign:r.widgetTitle?.alignment,fontSize:r.widgetTitle?.fontSize,color:r.widgetTitle?.color,marginBottom:24},children:t}):null,a.jsx(u,{stories:n,styles:r,handlePlaying:p,storyViews:s,setStoryViews:l})]})},Cv=e=>{const[t,r]=y.useState(""),[n,o]=y.useState([]),[i,s]=y.useState(tt),[l,c]=y.useState(!1),[d,u]=y.useState(null),p=y.useCallback(async()=>{const m=e?.trim();if(!m){o([]),s(tt),c(!1),u(null);return}const g=new AbortController;c(!0),u(null);try{const b=await he.get(`stories/${m}`,{signal:g.signal});if(g.signal.aborted)return;r(b.data.group_name),o(b.data.stories),s(b.data.styles||tt)}catch(b){if(g.signal.aborted)return;u(b)}finally{c(!1)}return()=>{g.abort()}},[e]);return y.useEffect(()=>{p()},[e]),{groupTitle:t,stories:n,styles:i,isLoading:l,error:d}},ha=y.createContext(void 0),jd=({groupId:e})=>{const[t,r]=y.useState(null),[n,o]=y.useState({}),{groupTitle:i,stories:s,styles:l}=Cv(e);return a.jsxs(ha.Provider,{value:{groupTitle:i,groupId:e,stories:s,styles:l,isPlaying:t,setIsPlaying:r,storyViews:n,setStoryViews:o},children:[t&&a.jsx(yv,{}),a.jsx(Sv,{})]})};_a(()=>{const e=document.getElementById("ecommreels-admin-app");e&&Ln.createRoot(e).render(a.jsx(Zd,{children:a.jsx(bv,{})}))}),_a(()=>{const e=document.querySelectorAll(".ecommreels-short-code"),t=document.querySelectorAll(".reelswp-group-short-code");e.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;Ln.createRoot(n).render(a.jsx(jd,{groupId:o}))}),t.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;Ln.createRoot(n).render(a.jsx(jd,{groupId:o}))})})})(React,wp.domReady,wp.element,ReactDOM);
  • ecomm-reels/trunk/ecomm-reels.php

    r3457000 r3457881  
    33 * Plugin Name:       ReelsWp - Shoppable Videos & Vertical Reels Carousels
    44 * Description:       Create Insta style reels and stories with ReelsWP and add them anywhere on your WordPress site. Add fast, mobile friendly video grid and carousel layouts to your homepage, blog or news articles, and product pages.
    5  * Version:           4.0.14
     5 * Version:           4.0.15
    66 * Requires at least: 5.8
    77 * Requires PHP:      7.4
     
    2020define('ECOMMREELS_ASSETS', plugins_url('/', __FILE__));
    2121define('ECOMMREELS_FILE_PREFIX', 'class-');
    22 define('WP_REELS_VER', '4.0.14');
     22define('WP_REELS_VER', '4.0.15');
    2323
    2424// 1) Composer autoloader (optional, guarded)
  • ecomm-reels/trunk/readme.txt

    r3457000 r3457881  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 4.0.14
     7Stable tag: 4.0.15
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    100100== Changelog ==
    101101
     102= 4.0.15 - 2026-02-10 =
     103- New: Added a tablet device option to responsive controls for managing size and spacing.
     104
    102105= 4.0.14 - 2026-02-09 =
    103106- Fix: Fixed several UI inconsistencies across the app for a more consistent user experience.
Note: See TracChangeset for help on using the changeset viewer.