diff --git a/.cursor/mcp.json b/.cursor/mcp.json index 45babc8..c5f953d 100644 --- a/.cursor/mcp.json +++ b/.cursor/mcp.json @@ -5,7 +5,7 @@ "args": [ "--yes", "@davewind/mysql-mcp-server", - "mysql://netteam:netteam@rm-bp19ohrgc6111ynzh1o.mysql.rds.aliyuncs.com:3306/antis-foodlabeling-us" + "mysql://javateam:javateam2026@rm-bp19ohrgc6111ynzh1o.mysql.rds.aliyuncs.com:3306/antis-foodlabeling-us" ] }, "my-api-spec": { diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/RbacMenu/RbacMenuCreateInputVo.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/RbacMenu/RbacMenuCreateInputVo.cs index ee5d658..1969e87 100644 --- a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/RbacMenu/RbacMenuCreateInputVo.cs +++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/RbacMenu/RbacMenuCreateInputVo.cs @@ -7,7 +7,10 @@ public class RbacMenuCreateInputVo { public string MenuName { get; set; } = string.Empty; - public Guid ParentId { get; set; } + /// + /// 父级ID(menu 表为字符串ID,可能是数字;根节点默认 0) + /// + public string ParentId { get; set; } = "0"; public int MenuType { get; set; } diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/RbacMenu/RbacMenuGetListOutputDto.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/RbacMenu/RbacMenuGetListOutputDto.cs index 6970d00..4a59a70 100644 --- a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/RbacMenu/RbacMenuGetListOutputDto.cs +++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/RbacMenu/RbacMenuGetListOutputDto.cs @@ -5,9 +5,9 @@ namespace FoodLabeling.Application.Contracts.Dtos.RbacMenu; /// public class RbacMenuGetListOutputDto { - public Guid Id { get; set; } + public string Id { get; set; } = string.Empty; - public Guid ParentId { get; set; } + public string ParentId { get; set; } = string.Empty; public string MenuName { get; set; } = string.Empty; diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/RbacMenu/RbacMenuTreeDto.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/RbacMenu/RbacMenuTreeDto.cs new file mode 100644 index 0000000..c0fbe0f --- /dev/null +++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/Dtos/RbacMenu/RbacMenuTreeDto.cs @@ -0,0 +1,56 @@ +namespace FoodLabeling.Application.Contracts.Dtos.RbacMenu; + +/// +/// 权限树节点(返回菜单表全部字段) +/// +public class RbacMenuTreeDto +{ + public string Id { get; set; } = string.Empty; + + public bool IsDeleted { get; set; } + + public DateTime CreationTime { get; set; } + + public string? CreatorId { get; set; } + + public string? LastModifierId { get; set; } + + public DateTime? LastModificationTime { get; set; } + + public int OrderNum { get; set; } + + public bool State { get; set; } + + public string MenuName { get; set; } = string.Empty; + + public string? RouterName { get; set; } + + public int MenuType { get; set; } + + public string? PermissionCode { get; set; } + + public string ParentId { get; set; } = string.Empty; + + public string? MenuIcon { get; set; } + + public string? Router { get; set; } + + public bool IsLink { get; set; } + + public bool IsCache { get; set; } + + public bool IsShow { get; set; } + + public string? Remark { get; set; } + + public string? Component { get; set; } + + public int MenuSource { get; set; } + + public string? Query { get; set; } + + public string? ConcurrencyStamp { get; set; } + + public List? Children { get; set; } +} + diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/IServices/IRbacMenuAppService.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/IServices/IRbacMenuAppService.cs index 2eba979..cf0e7c7 100644 --- a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/IServices/IRbacMenuAppService.cs +++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application.Contracts/IServices/IRbacMenuAppService.cs @@ -1,6 +1,4 @@ using FoodLabeling.Application.Contracts.Dtos.RbacMenu; -using FoodLabeling.Application.Contracts.Dtos.Common; -using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; namespace FoodLabeling.Application.Contracts.IServices; @@ -11,14 +9,14 @@ namespace FoodLabeling.Application.Contracts.IServices; public interface IRbacMenuAppService : IApplicationService { /// - /// 权限分页列表 + /// 权限列表(不分页) /// - Task> GetListAsync(RbacMenuGetListInputVo input); + Task> GetListAsync(RbacMenuGetListInputVo input); /// /// 权限详情 /// - Task GetAsync(Guid id); + Task GetAsync(string id); /// /// 新增权限 @@ -28,11 +26,17 @@ public interface IRbacMenuAppService : IApplicationService /// /// 编辑权限 /// - Task UpdateAsync(Guid id, RbacMenuUpdateInputVo input); + Task UpdateAsync(string id, RbacMenuUpdateInputVo input); /// /// 删除权限(逻辑删除) /// - Task DeleteAsync(List ids); + Task DeleteAsync(List ids); + + /// + /// 获取全部权限树(GET) + /// + /// 树状权限列表 + Task> GetTreeAsync(); } diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/DbModels/MenuDbEntity.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/DbModels/MenuDbEntity.cs new file mode 100644 index 0000000..b5ed547 --- /dev/null +++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/DbModels/MenuDbEntity.cs @@ -0,0 +1,58 @@ +using SqlSugar; + +namespace FoodLabeling.Application.Services.DbModels; + +/// +/// menu 表映射(兼容数字/字符串类型的 Id、ParentId) +/// +[SugarTable("menu")] +public class MenuDbEntity +{ + [SugarColumn(IsPrimaryKey = true)] + public string Id { get; set; } = string.Empty; + + public bool IsDeleted { get; set; } + + public DateTime CreationTime { get; set; } + + public string? CreatorId { get; set; } + + public string? LastModifierId { get; set; } + + public DateTime? LastModificationTime { get; set; } + + public int OrderNum { get; set; } + + public bool State { get; set; } + + public string MenuName { get; set; } = string.Empty; + + public string? RouterName { get; set; } + + public int MenuType { get; set; } + + public string? PermissionCode { get; set; } + + public string ParentId { get; set; } = "0"; + + public string? MenuIcon { get; set; } + + public string? Router { get; set; } + + public bool IsLink { get; set; } + + public bool IsCache { get; set; } + + public bool IsShow { get; set; } + + public string? Remark { get; set; } + + public string? Component { get; set; } + + public int MenuSource { get; set; } + + public string? Query { get; set; } + + public string? ConcurrencyStamp { get; set; } +} + diff --git a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/RbacMenuAppService.cs b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/RbacMenuAppService.cs index f4f8a4a..e23abcd 100644 --- a/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/RbacMenuAppService.cs +++ b/美国版/Food Labeling Management Code/Yi.Abp.Net8/module/food-labeling-us/FoodLabeling.Application/Services/RbacMenuAppService.cs @@ -1,12 +1,10 @@ using FoodLabeling.Application.Contracts.Dtos.RbacMenu; -using FoodLabeling.Application.Contracts.Dtos.Common; using FoodLabeling.Application.Contracts.IServices; +using FoodLabeling.Application.Services.DbModels; using Microsoft.AspNetCore.Mvc; using SqlSugar; using Volo.Abp; using Volo.Abp.Application.Services; -using Volo.Abp.Domain.Entities; -using Yi.Framework.Rbac.Domain.Entities; using Yi.Framework.SqlSugarCore.Abstractions; namespace FoodLabeling.Application.Services; @@ -16,57 +14,44 @@ namespace FoodLabeling.Application.Services; /// public class RbacMenuAppService : ApplicationService, IRbacMenuAppService { - private readonly ISqlSugarRepository _menuRepository; + private readonly ISqlSugarDbContext _dbContext; - public RbacMenuAppService(ISqlSugarRepository menuRepository) + public RbacMenuAppService(ISqlSugarDbContext dbContext) { - _menuRepository = menuRepository; + _dbContext = dbContext; } /// - public async Task> GetListAsync([FromQuery] RbacMenuGetListInputVo input) + public async Task> GetListAsync([FromQuery] RbacMenuGetListInputVo input) { - RefAsync total = 0; - - var query = _menuRepository._DbQueryable + var query = _dbContext.SqlSugarClient.Queryable() .Where(x => x.IsDeleted == false) .WhereIF(!string.IsNullOrWhiteSpace(input.MenuName), x => x.MenuName.Contains(input.MenuName!.Trim())) .WhereIF(input.State is not null, x => x.State == input.State) - .WhereIF(input.MenuSource is not null, x => x.MenuSource == (Yi.Framework.Rbac.Domain.Shared.Enums.MenuSourceEnum)input.MenuSource!.Value) + .WhereIF(input.MenuSource is not null, x => x.MenuSource == input.MenuSource!.Value) .OrderBy(x => x.OrderNum, OrderByType.Desc); - var entities = await query.ToPageListAsync(input.SkipCount, input.MaxResultCount, total); + var entities = await query.ToListAsync(); - var items = entities.Select(x => new RbacMenuGetListOutputDto + return entities.Select(x => new RbacMenuGetListOutputDto { Id = x.Id, ParentId = x.ParentId, MenuName = x.MenuName ?? string.Empty, PermissionCode = x.PermissionCode, - MenuType = (int)x.MenuType, - MenuSource = (int)x.MenuSource, + MenuType = x.MenuType, + MenuSource = x.MenuSource, OrderNum = x.OrderNum, State = x.State }).ToList(); - - var pageSize = input.MaxResultCount <= 0 ? items.Count : input.MaxResultCount; - var pageIndex = pageSize <= 0 ? 1 : (input.SkipCount / pageSize) + 1; - var totalPages = pageSize <= 0 ? 0 : (int)Math.Ceiling(total / (double)pageSize); - - return new PagedResultWithPageDto - { - PageIndex = pageIndex, - PageSize = pageSize, - TotalCount = total, - TotalPages = totalPages, - Items = items - }; } /// - public async Task GetAsync(Guid id) + public async Task GetAsync(string id) { - var entity = await _menuRepository.GetSingleAsync(x => x.Id == id && x.IsDeleted == false); + var entity = await _dbContext.SqlSugarClient.Queryable() + .Where(x => x.Id == id && x.IsDeleted == false) + .SingleAsync(); if (entity is null) { throw new UserFriendlyException("权限不存在"); @@ -78,8 +63,8 @@ public class RbacMenuAppService : ApplicationService, IRbacMenuAppService ParentId = entity.ParentId, MenuName = entity.MenuName ?? string.Empty, PermissionCode = entity.PermissionCode, - MenuType = (int)entity.MenuType, - MenuSource = (int)entity.MenuSource, + MenuType = entity.MenuType, + MenuSource = entity.MenuSource, OrderNum = entity.OrderNum, State = entity.State }; @@ -94,28 +79,35 @@ public class RbacMenuAppService : ApplicationService, IRbacMenuAppService throw new UserFriendlyException("权限名称不能为空"); } - var entity = new MenuAggregateRoot + var entity = new MenuDbEntity { + Id = GuidGenerator.Create().ToString(), MenuName = name, - ParentId = input.ParentId, - MenuType = (Yi.Framework.Rbac.Domain.Shared.Enums.MenuTypeEnum)input.MenuType, - MenuSource = (Yi.Framework.Rbac.Domain.Shared.Enums.MenuSourceEnum)input.MenuSource, + ParentId = string.IsNullOrWhiteSpace(input.ParentId) ? "0" : input.ParentId.Trim(), + MenuType = input.MenuType, + MenuSource = input.MenuSource, PermissionCode = input.PermissionCode?.Trim(), Router = input.Router?.Trim(), Component = input.Component?.Trim(), OrderNum = input.OrderNum, - State = input.State + State = input.State, + IsDeleted = false, + CreationTime = DateTime.Now, + IsCache = false, + IsLink = false, + IsShow = true, + ConcurrencyStamp = string.Empty }; - EntityHelper.TrySetId(entity, () => GuidGenerator.Create()); - - await _menuRepository.InsertAsync(entity); + await _dbContext.SqlSugarClient.Insertable(entity).ExecuteCommandAsync(); return await GetAsync(entity.Id); } /// - public async Task UpdateAsync(Guid id, [FromBody] RbacMenuUpdateInputVo input) + public async Task UpdateAsync(string id, [FromBody] RbacMenuUpdateInputVo input) { - var entity = await _menuRepository.GetSingleAsync(x => x.Id == id && x.IsDeleted == false); + var entity = await _dbContext.SqlSugarClient.Queryable() + .Where(x => x.Id == id && x.IsDeleted == false) + .SingleAsync(); if (entity is null) { throw new UserFriendlyException("权限不存在"); @@ -128,30 +120,118 @@ public class RbacMenuAppService : ApplicationService, IRbacMenuAppService } entity.MenuName = name; - entity.ParentId = input.ParentId; - entity.MenuType = (Yi.Framework.Rbac.Domain.Shared.Enums.MenuTypeEnum)input.MenuType; - entity.MenuSource = (Yi.Framework.Rbac.Domain.Shared.Enums.MenuSourceEnum)input.MenuSource; + entity.ParentId = string.IsNullOrWhiteSpace(input.ParentId) ? "0" : input.ParentId.Trim(); + entity.MenuType = input.MenuType; + entity.MenuSource = input.MenuSource; entity.PermissionCode = input.PermissionCode?.Trim(); entity.Router = input.Router?.Trim(); entity.Component = input.Component?.Trim(); entity.OrderNum = input.OrderNum; entity.State = input.State; + entity.LastModificationTime = DateTime.Now; - await _menuRepository.UpdateAsync(entity); + await _dbContext.SqlSugarClient.Updateable(entity) + .Where(x => x.Id == entity.Id) + .ExecuteCommandAsync(); return await GetAsync(entity.Id); } /// - public async Task DeleteAsync([FromBody] List ids) + public async Task DeleteAsync([FromBody] List ids) { - var idList = ids?.Distinct().ToList() ?? new List(); + var idList = ids?.Where(x => !string.IsNullOrWhiteSpace(x)).Select(x => x.Trim()).Distinct().ToList() ?? new List(); if (idList.Count == 0) { return; } - // 权限表为软删(ISoftDelete) - await _menuRepository.DeleteAsync(x => idList.Contains(x.Id)); + await _dbContext.SqlSugarClient.Updateable() + .SetColumns(x => new MenuDbEntity { IsDeleted = true }) + .Where(x => idList.Contains(x.Id)) + .ExecuteCommandAsync(); + } + + /// + public async Task> GetTreeAsync() + { + // 返回所有字段,但过滤逻辑删除数据 + var menus = await _dbContext.SqlSugarClient.Queryable() + .Where(x => x.IsDeleted == false) + .OrderBy(x => x.OrderNum, OrderByType.Desc) + .ToListAsync(); + + var nodes = menus.Select(m => new RbacMenuTreeDto + { + Id = m.Id, + IsDeleted = m.IsDeleted, + CreationTime = m.CreationTime, + CreatorId = m.CreatorId, + LastModifierId = m.LastModifierId, + LastModificationTime = m.LastModificationTime, + OrderNum = m.OrderNum, + State = m.State, + MenuName = m.MenuName ?? string.Empty, + RouterName = m.RouterName, + MenuType = m.MenuType, + PermissionCode = m.PermissionCode, + ParentId = m.ParentId, + MenuIcon = m.MenuIcon, + Router = m.Router, + IsLink = m.IsLink, + IsCache = m.IsCache, + IsShow = m.IsShow, + Remark = m.Remark, + Component = m.Component, + MenuSource = m.MenuSource, + Query = m.Query, + ConcurrencyStamp = m.ConcurrencyStamp, + Children = new List() + }).ToList(); + + // TreeHelper 仅支持 Guid Id/ParentId,这里使用字符串 ParentId 自行构建树 + var nodeById = nodes + .Where(x => !string.IsNullOrWhiteSpace(x.Id)) + .GroupBy(x => x.Id) + .ToDictionary(g => g.Key, g => g.First()); + + foreach (var node in nodes) + { + node.Children ??= new List(); + var parentId = string.IsNullOrWhiteSpace(node.ParentId) ? "0" : node.ParentId.Trim(); + if (parentId == "0" || parentId == "00000000-0000-0000-0000-000000000000") + { + continue; + } + + if (nodeById.TryGetValue(parentId, out var parent)) + { + parent.Children ??= new List(); + parent.Children.Add(node); + } + } + + var roots = nodes + .Where(n => + { + var pid = string.IsNullOrWhiteSpace(n.ParentId) ? "0" : n.ParentId.Trim(); + return pid == "0" || pid == "00000000-0000-0000-0000-000000000000" || !nodeById.ContainsKey(pid); + }) + .ToList(); + + SortTree(roots); + return roots; + } + + private static void SortTree(List nodes) + { + nodes.Sort((a, b) => b.OrderNum.CompareTo(a.OrderNum)); + foreach (var node in nodes) + { + if (node.Children is { Count: > 0 }) + { + SortTree(node.Children); + } + } } } diff --git a/美国版/Food Labeling Management Platform/.env.local b/美国版/Food Labeling Management Platform/.env.local new file mode 100644 index 0000000..7330fd9 --- /dev/null +++ b/美国版/Food Labeling Management Platform/.env.local @@ -0,0 +1,2 @@ +VITE_API_BASE_URL=http://192.168.31.88:19001 + diff --git a/美国版/Food Labeling Management Platform/build/assets/index-2Xatwc8-.js b/美国版/Food Labeling Management Platform/build/assets/index-2Xatwc8-.js new file mode 100644 index 0000000..1a73eb8 --- /dev/null +++ b/美国版/Food Labeling Management Platform/build/assets/index-2Xatwc8-.js @@ -0,0 +1,463 @@ +function e8(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();var Mf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ot(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fg={exports:{}},ql={},dg={exports:{}},Ve={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var JO;function t8(){if(JO)return Ve;JO=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.iterator;function m(M){return M===null||typeof M!="object"?null:(M=p&&M[p]||M["@@iterator"],typeof M=="function"?M:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,y={};function w(M,B,Z){this.props=M,this.context=B,this.refs=y,this.updater=Z||g}w.prototype.isReactComponent={},w.prototype.setState=function(M,B){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,B,"setState")},w.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function j(){}j.prototype=w.prototype;function O(M,B,Z){this.props=M,this.context=B,this.refs=y,this.updater=Z||g}var E=O.prototype=new j;E.constructor=O,b(E,w.prototype),E.isPureReactComponent=!0;var N=Array.isArray,A=Object.prototype.hasOwnProperty,C={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function R(M,B,Z){var te,ve={},xe=null,X=null;if(B!=null)for(te in B.ref!==void 0&&(X=B.ref),B.key!==void 0&&(xe=""+B.key),B)A.call(B,te)&&!T.hasOwnProperty(te)&&(ve[te]=B[te]);var ue=arguments.length-2;if(ue===1)ve.children=Z;else if(1>>1,B=D[M];if(0>>1;Mi(ve,J))xei(X,ve)?(D[M]=X,D[xe]=J,M=xe):(D[M]=ve,D[te]=J,M=te);else if(xei(X,J))D[M]=X,D[xe]=J,M=xe;else break e}}return Q}function i(D,Q){var J=D.sortIndex-Q.sortIndex;return J!==0?J:D.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,u=s.now();e.unstable_now=function(){return s.now()-u}}var f=[],l=[],d=1,p=null,m=3,g=!1,b=!1,y=!1,w=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(D){for(var Q=r(l);Q!==null;){if(Q.callback===null)n(l);else if(Q.startTime<=D)n(l),Q.sortIndex=Q.expirationTime,t(f,Q);else break;Q=r(l)}}function N(D){if(y=!1,E(D),!b)if(r(f)!==null)b=!0,G(A);else{var Q=r(l);Q!==null&&Y(N,Q.startTime-D)}}function A(D,Q){b=!1,y&&(y=!1,j(R),R=-1),g=!0;var J=m;try{for(E(Q),p=r(f);p!==null&&(!(p.expirationTime>Q)||D&&!$());){var M=p.callback;if(typeof M=="function"){p.callback=null,m=p.priorityLevel;var B=M(p.expirationTime<=Q);Q=e.unstable_now(),typeof B=="function"?p.callback=B:p===r(f)&&n(f),E(Q)}else n(f);p=r(f)}if(p!==null)var Z=!0;else{var te=r(l);te!==null&&Y(N,te.startTime-Q),Z=!1}return Z}finally{p=null,m=J,g=!1}}var C=!1,T=null,R=-1,I=5,z=-1;function $(){return!(e.unstable_now()-zD||125M?(D.sortIndex=J,t(l,D),r(f)===null&&D===r(l)&&(y?(j(R),R=-1):y=!0,Y(N,J-M))):(D.sortIndex=B,t(f,D),b||g||(b=!0,G(A))),D},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(D){var Q=m;return function(){var J=m;m=Q;try{return D.apply(this,arguments)}finally{m=J}}}})(mg)),mg}var iE;function o8(){return iE||(iE=1,pg.exports=i8()),pg.exports}/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var oE;function a8(){if(oE)return Sr;oE=1;var e=cp(),t=o8();function r(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,v=1;v"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,l=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d={},p={};function m(a){return f.call(p,a)?!0:f.call(d,a)?!1:l.test(a)?p[a]=!0:(d[a]=!0,!1)}function g(a,c,v,x){if(v!==null&&v.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return x?!1:v!==null?!v.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function b(a,c,v,x){if(c===null||typeof c>"u"||g(a,c,v,x))return!0;if(x)return!1;if(v!==null)switch(v.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function y(a,c,v,x,S,P,k){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=x,this.attributeNamespace=S,this.mustUseProperty=v,this.propertyName=a,this.type=c,this.sanitizeURL=P,this.removeEmptyString=k}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){w[a]=new y(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var c=a[0];w[c]=new y(c,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){w[a]=new y(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){w[a]=new y(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){w[a]=new y(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){w[a]=new y(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){w[a]=new y(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){w[a]=new y(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){w[a]=new y(a,5,!1,a.toLowerCase(),null,!1,!1)});var j=/[\-:]([a-z])/g;function O(a){return a[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var c=a.replace(j,O);w[c]=new y(c,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var c=a.replace(j,O);w[c]=new y(c,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var c=a.replace(j,O);w[c]=new y(c,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){w[a]=new y(a,1,!1,a.toLowerCase(),null,!1,!1)}),w.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){w[a]=new y(a,1,!1,a.toLowerCase(),null,!0,!0)});function E(a,c,v,x){var S=w.hasOwnProperty(c)?w[c]:null;(S!==null?S.type!==0:x||!(2q||S[k]!==P[q]){var H=` +`+S[k].replace(" at new "," at ");return a.displayName&&H.includes("")&&(H=H.replace("",a.displayName)),H}while(1<=k&&0<=q);break}}}finally{Z=!1,Error.prepareStackTrace=v}return(a=a?a.displayName||a.name:"")?B(a):""}function ve(a){switch(a.tag){case 5:return B(a.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 2:case 15:return a=te(a.type,!1),a;case 11:return a=te(a.type.render,!1),a;case 1:return a=te(a.type,!0),a;default:return""}}function xe(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case T:return"Fragment";case C:return"Portal";case I:return"Profiler";case R:return"StrictMode";case U:return"Suspense";case W:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case $:return(a.displayName||"Context")+".Consumer";case z:return(a._context.displayName||"Context")+".Provider";case L:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case V:return c=a.displayName||null,c!==null?c:xe(a.type)||"Memo";case G:c=a._payload,a=a._init;try{return xe(a(c))}catch{}}return null}function X(a){var c=a.type;switch(a.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return xe(c);case 8:return c===R?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function ue(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function ie(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function de(a){var c=ie(a)?"checked":"value",v=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),x=""+a[c];if(!a.hasOwnProperty(c)&&typeof v<"u"&&typeof v.get=="function"&&typeof v.set=="function"){var S=v.get,P=v.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return S.call(this)},set:function(k){x=""+k,P.call(this,k)}}),Object.defineProperty(a,c,{enumerable:v.enumerable}),{getValue:function(){return x},setValue:function(k){x=""+k},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function ye(a){a._valueTracker||(a._valueTracker=de(a))}function oe(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var v=c.getValue(),x="";return a&&(x=ie(a)?a.checked?"true":"false":a.value),a=x,a!==v?(c.setValue(a),!0):!1}function $e(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function Me(a,c){var v=c.checked;return J({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:v??a._wrapperState.initialChecked})}function Ye(a,c){var v=c.defaultValue==null?"":c.defaultValue,x=c.checked!=null?c.checked:c.defaultChecked;v=ue(c.value!=null?c.value:v),a._wrapperState={initialChecked:x,initialValue:v,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function lt(a,c){c=c.checked,c!=null&&E(a,"checked",c,!1)}function vt(a,c){lt(a,c);var v=ue(c.value),x=c.type;if(v!=null)x==="number"?(v===0&&a.value===""||a.value!=v)&&(a.value=""+v):a.value!==""+v&&(a.value=""+v);else if(x==="submit"||x==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?Pr(a,c.type,v):c.hasOwnProperty("defaultValue")&&Pr(a,c.type,ue(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function vr(a,c,v){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var x=c.type;if(!(x!=="submit"&&x!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,v||c===a.value||(a.value=c),a.defaultValue=c}v=a.name,v!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,v!==""&&(a.name=v)}function Pr(a,c,v){(c!=="number"||$e(a.ownerDocument)!==a)&&(v==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+v&&(a.defaultValue=""+v))}var Ar=Array.isArray;function Kt(a,c,v,x){if(a=a.options,c){c={};for(var S=0;S"+c.valueOf().toString()+"",c=Ou.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function il(a,c){if(c){var v=a.firstChild;if(v&&v===a.lastChild&&v.nodeType===3){v.nodeValue=c;return}}a.textContent=c}var ol={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},i5=["Webkit","ms","Moz","O"];Object.keys(ol).forEach(function(a){i5.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),ol[c]=ol[a]})});function p_(a,c,v){return c==null||typeof c=="boolean"||c===""?"":v||typeof c!="number"||c===0||ol.hasOwnProperty(a)&&ol[a]?(""+c).trim():c+"px"}function m_(a,c){a=a.style;for(var v in c)if(c.hasOwnProperty(v)){var x=v.indexOf("--")===0,S=p_(v,c[v],x);v==="float"&&(v="cssFloat"),x?a.setProperty(v,S):a[v]=S}}var o5=J({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _m(a,c){if(c){if(o5[a]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(r(137,a));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(r(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(r(61))}if(c.style!=null&&typeof c.style!="object")throw Error(r(62))}}function jm(a,c){if(a.indexOf("-")===-1)return typeof c.is=="string";switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Om=null;function Em(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Pm=null,da=null,ha=null;function v_(a){if(a=Pl(a)){if(typeof Pm!="function")throw Error(r(280));var c=a.stateNode;c&&(c=Ku(c),Pm(a.stateNode,a.type,c))}}function g_(a){da?ha?ha.push(a):ha=[a]:da=a}function y_(){if(da){var a=da,c=ha;if(ha=da=null,v_(a),c)for(a=0;a>>=0,a===0?32:31-(v5(a)/g5|0)|0}var Nu=64,Tu=4194304;function cl(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function ku(a,c){var v=a.pendingLanes;if(v===0)return 0;var x=0,S=a.suspendedLanes,P=a.pingedLanes,k=v&268435455;if(k!==0){var q=k&~S;q!==0?x=cl(q):(P&=k,P!==0&&(x=cl(P)))}else k=v&~S,k!==0?x=cl(k):P!==0&&(x=cl(P));if(x===0)return 0;if(c!==0&&c!==x&&(c&S)===0&&(S=x&-x,P=c&-c,S>=P||S===16&&(P&4194240)!==0))return c;if((x&4)!==0&&(x|=v&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=x;0v;v++)c.push(a);return c}function ul(a,c,v){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-pn(c),a[c]=v}function w5(a,c){var v=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var x=a.eventTimes;for(a=a.expirationTimes;0=yl),V_=" ",G_=!1;function K_(a,c){switch(a){case"keyup":return X5.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function X_(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var va=!1;function Q5(a,c){switch(a){case"compositionend":return X_(c);case"keypress":return c.which!==32?null:(G_=!0,V_);case"textInput":return a=c.data,a===V_&&G_?null:a;default:return null}}function Z5(a,c){if(va)return a==="compositionend"||!Hm&&K_(a,c)?(a=F_(),Lu=Bm=Li=null,va=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1=c)return{node:v,offset:c-a};a=x}e:{for(;v;){if(v.nextSibling){v=v.nextSibling;break e}v=v.parentNode}v=void 0}v=rj(v)}}function ij(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?ij(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function oj(){for(var a=window,c=$e();c instanceof a.HTMLIFrameElement;){try{var v=typeof c.contentWindow.location.href=="string"}catch{v=!1}if(v)a=c.contentWindow;else break;c=$e(a.document)}return c}function Km(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}function sB(a){var c=oj(),v=a.focusedElem,x=a.selectionRange;if(c!==v&&v&&v.ownerDocument&&ij(v.ownerDocument.documentElement,v)){if(x!==null&&Km(v)){if(c=x.start,a=x.end,a===void 0&&(a=c),"selectionStart"in v)v.selectionStart=c,v.selectionEnd=Math.min(a,v.value.length);else if(a=(c=v.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var S=v.textContent.length,P=Math.min(x.start,S);x=x.end===void 0?P:Math.min(x.end,S),!a.extend&&P>x&&(S=x,x=P,P=S),S=nj(v,P);var k=nj(v,x);S&&k&&(a.rangeCount!==1||a.anchorNode!==S.node||a.anchorOffset!==S.offset||a.focusNode!==k.node||a.focusOffset!==k.offset)&&(c=c.createRange(),c.setStart(S.node,S.offset),a.removeAllRanges(),P>x?(a.addRange(c),a.extend(k.node,k.offset)):(c.setEnd(k.node,k.offset),a.addRange(c)))}}for(c=[],a=v;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v=document.documentMode,ga=null,Xm=null,Sl=null,Ym=!1;function aj(a,c,v){var x=v.window===v?v.document:v.nodeType===9?v:v.ownerDocument;Ym||ga==null||ga!==$e(x)||(x=ga,"selectionStart"in x&&Km(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),Sl&&wl(Sl,x)||(Sl=x,x=Hu(Xm,"onSelect"),0Sa||(a.current=lv[Sa],lv[Sa]=null,Sa--)}function dt(a,c){Sa++,lv[Sa]=a.current,a.current=c}var zi={},er=Fi(zi),gr=Fi(!1),yo=zi;function _a(a,c){var v=a.type.contextTypes;if(!v)return zi;var x=a.stateNode;if(x&&x.__reactInternalMemoizedUnmaskedChildContext===c)return x.__reactInternalMemoizedMaskedChildContext;var S={},P;for(P in v)S[P]=c[P];return x&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=S),S}function yr(a){return a=a.childContextTypes,a!=null}function Xu(){yt(gr),yt(er)}function wj(a,c,v){if(er.current!==zi)throw Error(r(168));dt(er,c),dt(gr,v)}function Sj(a,c,v){var x=a.stateNode;if(c=c.childContextTypes,typeof x.getChildContext!="function")return v;x=x.getChildContext();for(var S in x)if(!(S in c))throw Error(r(108,X(a)||"Unknown",S));return J({},v,x)}function Yu(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||zi,yo=er.current,dt(er,a),dt(gr,gr.current),!0}function _j(a,c,v){var x=a.stateNode;if(!x)throw Error(r(169));v?(a=Sj(a,c,yo),x.__reactInternalMemoizedMergedChildContext=a,yt(gr),yt(er),dt(er,a)):yt(gr),dt(gr,v)}var oi=null,Qu=!1,cv=!1;function jj(a){oi===null?oi=[a]:oi.push(a)}function xB(a){Qu=!0,jj(a)}function qi(){if(!cv&&oi!==null){cv=!0;var a=0,c=ct;try{var v=oi;for(ct=1;a>=k,S-=k,ai=1<<32-pn(c)+S|v<Fe?(Wt=De,De=null):Wt=De.sibling;var tt=le(ee,De,re[Fe],pe);if(tt===null){De===null&&(De=Wt);break}a&&De&&tt.alternate===null&&c(ee,De),K=P(tt,K,Fe),Ie===null?Ne=tt:Ie.sibling=tt,Ie=tt,De=Wt}if(Fe===re.length)return v(ee,De),bt&&bo(ee,Fe),Ne;if(De===null){for(;FeFe?(Wt=De,De=null):Wt=De.sibling;var Qi=le(ee,De,tt.value,pe);if(Qi===null){De===null&&(De=Wt);break}a&&De&&Qi.alternate===null&&c(ee,De),K=P(Qi,K,Fe),Ie===null?Ne=Qi:Ie.sibling=Qi,Ie=Qi,De=Wt}if(tt.done)return v(ee,De),bt&&bo(ee,Fe),Ne;if(De===null){for(;!tt.done;Fe++,tt=re.next())tt=fe(ee,tt.value,pe),tt!==null&&(K=P(tt,K,Fe),Ie===null?Ne=tt:Ie.sibling=tt,Ie=tt);return bt&&bo(ee,Fe),Ne}for(De=x(ee,De);!tt.done;Fe++,tt=re.next())tt=Se(De,ee,Fe,tt.value,pe),tt!==null&&(a&&tt.alternate!==null&&De.delete(tt.key===null?Fe:tt.key),K=P(tt,K,Fe),Ie===null?Ne=tt:Ie.sibling=tt,Ie=tt);return a&&De.forEach(function(JB){return c(ee,JB)}),bt&&bo(ee,Fe),Ne}function Ct(ee,K,re,pe){if(typeof re=="object"&&re!==null&&re.type===T&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case A:e:{for(var Ne=re.key,Ie=K;Ie!==null;){if(Ie.key===Ne){if(Ne=re.type,Ne===T){if(Ie.tag===7){v(ee,Ie.sibling),K=S(Ie,re.props.children),K.return=ee,ee=K;break e}}else if(Ie.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===G&&Nj(Ne)===Ie.type){v(ee,Ie.sibling),K=S(Ie,re.props),K.ref=Al(ee,Ie,re),K.return=ee,ee=K;break e}v(ee,Ie);break}else c(ee,Ie);Ie=Ie.sibling}re.type===T?(K=Ao(re.props.children,ee.mode,pe,re.key),K.return=ee,ee=K):(pe=Ef(re.type,re.key,re.props,null,ee.mode,pe),pe.ref=Al(ee,K,re),pe.return=ee,ee=pe)}return k(ee);case C:e:{for(Ie=re.key;K!==null;){if(K.key===Ie)if(K.tag===4&&K.stateNode.containerInfo===re.containerInfo&&K.stateNode.implementation===re.implementation){v(ee,K.sibling),K=S(K,re.children||[]),K.return=ee,ee=K;break e}else{v(ee,K);break}else c(ee,K);K=K.sibling}K=ag(re,ee.mode,pe),K.return=ee,ee=K}return k(ee);case G:return Ie=re._init,Ct(ee,K,Ie(re._payload),pe)}if(Ar(re))return Oe(ee,K,re,pe);if(Q(re))return Ce(ee,K,re,pe);tf(ee,re)}return typeof re=="string"&&re!==""||typeof re=="number"?(re=""+re,K!==null&&K.tag===6?(v(ee,K.sibling),K=S(K,re),K.return=ee,ee=K):(v(ee,K),K=og(re,ee.mode,pe),K.return=ee,ee=K),k(ee)):v(ee,K)}return Ct}var Pa=Tj(!0),kj=Tj(!1),rf=Fi(null),nf=null,Aa=null,mv=null;function vv(){mv=Aa=nf=null}function gv(a){var c=rf.current;yt(rf),a._currentValue=c}function yv(a,c,v){for(;a!==null;){var x=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,x!==null&&(x.childLanes|=c)):x!==null&&(x.childLanes&c)!==c&&(x.childLanes|=c),a===v)break;a=a.return}}function Ca(a,c){nf=a,mv=Aa=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&c)!==0&&(xr=!0),a.firstContext=null)}function Xr(a){var c=a._currentValue;if(mv!==a)if(a={context:a,memoizedValue:c,next:null},Aa===null){if(nf===null)throw Error(r(308));Aa=a,nf.dependencies={lanes:0,firstContext:a}}else Aa=Aa.next=a;return c}var wo=null;function xv(a){wo===null?wo=[a]:wo.push(a)}function Rj(a,c,v,x){var S=c.interleaved;return S===null?(v.next=v,xv(c)):(v.next=S.next,S.next=v),c.interleaved=v,li(a,x)}function li(a,c){a.lanes|=c;var v=a.alternate;for(v!==null&&(v.lanes|=c),v=a,a=a.return;a!==null;)a.childLanes|=c,v=a.alternate,v!==null&&(v.childLanes|=c),v=a,a=a.return;return v.tag===3?v.stateNode:null}var Ui=!1;function bv(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Mj(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function ci(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function Wi(a,c,v){var x=a.updateQueue;if(x===null)return null;if(x=x.shared,(Qe&2)!==0){var S=x.pending;return S===null?c.next=c:(c.next=S.next,S.next=c),x.pending=c,li(a,v)}return S=x.interleaved,S===null?(c.next=c,xv(x)):(c.next=S.next,S.next=c),x.interleaved=c,li(a,v)}function of(a,c,v){if(c=c.updateQueue,c!==null&&(c=c.shared,(v&4194240)!==0)){var x=c.lanes;x&=a.pendingLanes,v|=x,c.lanes=v,Mm(a,v)}}function Ij(a,c){var v=a.updateQueue,x=a.alternate;if(x!==null&&(x=x.updateQueue,v===x)){var S=null,P=null;if(v=v.firstBaseUpdate,v!==null){do{var k={eventTime:v.eventTime,lane:v.lane,tag:v.tag,payload:v.payload,callback:v.callback,next:null};P===null?S=P=k:P=P.next=k,v=v.next}while(v!==null);P===null?S=P=c:P=P.next=c}else S=P=c;v={baseState:x.baseState,firstBaseUpdate:S,lastBaseUpdate:P,shared:x.shared,effects:x.effects},a.updateQueue=v;return}a=v.lastBaseUpdate,a===null?v.firstBaseUpdate=c:a.next=c,v.lastBaseUpdate=c}function af(a,c,v,x){var S=a.updateQueue;Ui=!1;var P=S.firstBaseUpdate,k=S.lastBaseUpdate,q=S.shared.pending;if(q!==null){S.shared.pending=null;var H=q,ne=H.next;H.next=null,k===null?P=ne:k.next=ne,k=H;var ce=a.alternate;ce!==null&&(ce=ce.updateQueue,q=ce.lastBaseUpdate,q!==k&&(q===null?ce.firstBaseUpdate=ne:q.next=ne,ce.lastBaseUpdate=H))}if(P!==null){var fe=S.baseState;k=0,ce=ne=H=null,q=P;do{var le=q.lane,Se=q.eventTime;if((x&le)===le){ce!==null&&(ce=ce.next={eventTime:Se,lane:0,tag:q.tag,payload:q.payload,callback:q.callback,next:null});e:{var Oe=a,Ce=q;switch(le=c,Se=v,Ce.tag){case 1:if(Oe=Ce.payload,typeof Oe=="function"){fe=Oe.call(Se,fe,le);break e}fe=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Ce.payload,le=typeof Oe=="function"?Oe.call(Se,fe,le):Oe,le==null)break e;fe=J({},fe,le);break e;case 2:Ui=!0}}q.callback!==null&&q.lane!==0&&(a.flags|=64,le=S.effects,le===null?S.effects=[q]:le.push(q))}else Se={eventTime:Se,lane:le,tag:q.tag,payload:q.payload,callback:q.callback,next:null},ce===null?(ne=ce=Se,H=fe):ce=ce.next=Se,k|=le;if(q=q.next,q===null){if(q=S.shared.pending,q===null)break;le=q,q=le.next,le.next=null,S.lastBaseUpdate=le,S.shared.pending=null}}while(!0);if(ce===null&&(H=fe),S.baseState=H,S.firstBaseUpdate=ne,S.lastBaseUpdate=ce,c=S.shared.interleaved,c!==null){S=c;do k|=S.lane,S=S.next;while(S!==c)}else P===null&&(S.shared.lanes=0);jo|=k,a.lanes=k,a.memoizedState=fe}}function Dj(a,c,v){if(a=c.effects,c.effects=null,a!==null)for(c=0;cv?v:4,a(!0);var x=Ov.transition;Ov.transition={};try{a(!1),c()}finally{ct=v,Ov.transition=x}}function tO(){return Yr().memoizedState}function _B(a,c,v){var x=Ki(a);if(v={lane:x,action:v,hasEagerState:!1,eagerState:null,next:null},rO(a))nO(c,v);else if(v=Rj(a,c,v,x),v!==null){var S=lr();bn(v,a,x,S),iO(v,c,x)}}function jB(a,c,v){var x=Ki(a),S={lane:x,action:v,hasEagerState:!1,eagerState:null,next:null};if(rO(a))nO(c,S);else{var P=a.alternate;if(a.lanes===0&&(P===null||P.lanes===0)&&(P=c.lastRenderedReducer,P!==null))try{var k=c.lastRenderedState,q=P(k,v);if(S.hasEagerState=!0,S.eagerState=q,mn(q,k)){var H=c.interleaved;H===null?(S.next=S,xv(c)):(S.next=H.next,H.next=S),c.interleaved=S;return}}catch{}finally{}v=Rj(a,c,S,x),v!==null&&(S=lr(),bn(v,a,x,S),iO(v,c,x))}}function rO(a){var c=a.alternate;return a===_t||c!==null&&c===_t}function nO(a,c){kl=cf=!0;var v=a.pending;v===null?c.next=c:(c.next=v.next,v.next=c),a.pending=c}function iO(a,c,v){if((v&4194240)!==0){var x=c.lanes;x&=a.pendingLanes,v|=x,c.lanes=v,Mm(a,v)}}var df={readContext:Xr,useCallback:tr,useContext:tr,useEffect:tr,useImperativeHandle:tr,useInsertionEffect:tr,useLayoutEffect:tr,useMemo:tr,useReducer:tr,useRef:tr,useState:tr,useDebugValue:tr,useDeferredValue:tr,useTransition:tr,useMutableSource:tr,useSyncExternalStore:tr,useId:tr,unstable_isNewReconciler:!1},OB={readContext:Xr,useCallback:function(a,c){return qn().memoizedState=[a,c===void 0?null:c],a},useContext:Xr,useEffect:Gj,useImperativeHandle:function(a,c,v){return v=v!=null?v.concat([a]):null,uf(4194308,4,Yj.bind(null,c,a),v)},useLayoutEffect:function(a,c){return uf(4194308,4,a,c)},useInsertionEffect:function(a,c){return uf(4,2,a,c)},useMemo:function(a,c){var v=qn();return c=c===void 0?null:c,a=a(),v.memoizedState=[a,c],a},useReducer:function(a,c,v){var x=qn();return c=v!==void 0?v(c):c,x.memoizedState=x.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},x.queue=a,a=a.dispatch=_B.bind(null,_t,a),[x.memoizedState,a]},useRef:function(a){var c=qn();return a={current:a},c.memoizedState=a},useState:Hj,useDebugValue:kv,useDeferredValue:function(a){return qn().memoizedState=a},useTransition:function(){var a=Hj(!1),c=a[0];return a=SB.bind(null,a[1]),qn().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,v){var x=_t,S=qn();if(bt){if(v===void 0)throw Error(r(407));v=v()}else{if(v=c(),Ut===null)throw Error(r(349));(_o&30)!==0||Fj(x,c,v)}S.memoizedState=v;var P={value:v,getSnapshot:c};return S.queue=P,Gj(qj.bind(null,x,P,a),[a]),x.flags|=2048,Il(9,zj.bind(null,x,P,v,c),void 0,null),v},useId:function(){var a=qn(),c=Ut.identifierPrefix;if(bt){var v=si,x=ai;v=(x&~(1<<32-pn(x)-1)).toString(32)+v,c=":"+c+"R"+v,v=Rl++,0<\/script>",a=a.removeChild(a.firstChild)):typeof x.is=="string"?a=k.createElement(v,{is:x.is}):(a=k.createElement(v),v==="select"&&(k=a,x.multiple?k.multiple=!0:x.size&&(k.size=x.size))):a=k.createElementNS(a,v),a[Fn]=c,a[El]=x,jO(a,c,!1,!1),c.stateNode=a;e:{switch(k=jm(v,x),v){case"dialog":gt("cancel",a),gt("close",a),S=x;break;case"iframe":case"object":case"embed":gt("load",a),S=x;break;case"video":case"audio":for(S=0;S<_l.length;S++)gt(_l[S],a);S=x;break;case"source":gt("error",a),S=x;break;case"img":case"image":case"link":gt("error",a),gt("load",a),S=x;break;case"details":gt("toggle",a),S=x;break;case"input":Ye(a,x),S=Me(a,x),gt("invalid",a);break;case"option":S=x;break;case"select":a._wrapperState={wasMultiple:!!x.multiple},S=J({},x,{value:void 0}),gt("invalid",a);break;case"textarea":fa(a,x),S=Xt(a,x),gt("invalid",a);break;default:S=x}_m(v,S),q=S;for(P in q)if(q.hasOwnProperty(P)){var H=q[P];P==="style"?m_(a,H):P==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,H!=null&&h_(a,H)):P==="children"?typeof H=="string"?(v!=="textarea"||H!=="")&&il(a,H):typeof H=="number"&&il(a,""+H):P!=="suppressContentEditableWarning"&&P!=="suppressHydrationWarning"&&P!=="autoFocus"&&(i.hasOwnProperty(P)?H!=null&&P==="onScroll"&>("scroll",a):H!=null&&E(a,P,H,k))}switch(v){case"input":ye(a),vr(a,x,!1);break;case"textarea":ye(a),nl(a);break;case"option":x.value!=null&&a.setAttribute("value",""+ue(x.value));break;case"select":a.multiple=!!x.multiple,P=x.value,P!=null?Kt(a,!!x.multiple,P,!1):x.defaultValue!=null&&Kt(a,!!x.multiple,x.defaultValue,!0);break;default:typeof S.onClick=="function"&&(a.onclick=Gu)}switch(v){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}}x&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return rr(c),null;case 6:if(a&&c.stateNode!=null)EO(a,c,a.memoizedProps,x);else{if(typeof x!="string"&&c.stateNode===null)throw Error(r(166));if(v=So(Tl.current),So(zn.current),ef(c)){if(x=c.stateNode,v=c.memoizedProps,x[Fn]=c,(P=x.nodeValue!==v)&&(a=Nr,a!==null))switch(a.tag){case 3:Vu(x.nodeValue,v,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&Vu(x.nodeValue,v,(a.mode&1)!==0)}P&&(c.flags|=4)}else x=(v.nodeType===9?v:v.ownerDocument).createTextNode(x),x[Fn]=c,c.stateNode=x}return rr(c),null;case 13:if(yt(St),x=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(bt&&Tr!==null&&(c.mode&1)!==0&&(c.flags&128)===0)Cj(),Ea(),c.flags|=98560,P=!1;else if(P=ef(c),x!==null&&x.dehydrated!==null){if(a===null){if(!P)throw Error(r(318));if(P=c.memoizedState,P=P!==null?P.dehydrated:null,!P)throw Error(r(317));P[Fn]=c}else Ea(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;rr(c),P=!1}else vn!==null&&(eg(vn),vn=null),P=!0;if(!P)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=v,c):(x=x!==null,x!==(a!==null&&a.memoizedState!==null)&&x&&(c.child.flags|=8192,(c.mode&1)!==0&&(a===null||(St.current&1)!==0?It===0&&(It=3):ng())),c.updateQueue!==null&&(c.flags|=4),rr(c),null);case 4:return Na(),Uv(a,c),a===null&&jl(c.stateNode.containerInfo),rr(c),null;case 10:return gv(c.type._context),rr(c),null;case 17:return yr(c.type)&&Xu(),rr(c),null;case 19:if(yt(St),P=c.memoizedState,P===null)return rr(c),null;if(x=(c.flags&128)!==0,k=P.rendering,k===null)if(x)Dl(P,!1);else{if(It!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(k=sf(a),k!==null){for(c.flags|=128,Dl(P,!1),x=k.updateQueue,x!==null&&(c.updateQueue=x,c.flags|=4),c.subtreeFlags=0,x=v,v=c.child;v!==null;)P=v,a=x,P.flags&=14680066,k=P.alternate,k===null?(P.childLanes=0,P.lanes=a,P.child=null,P.subtreeFlags=0,P.memoizedProps=null,P.memoizedState=null,P.updateQueue=null,P.dependencies=null,P.stateNode=null):(P.childLanes=k.childLanes,P.lanes=k.lanes,P.child=k.child,P.subtreeFlags=0,P.deletions=null,P.memoizedProps=k.memoizedProps,P.memoizedState=k.memoizedState,P.updateQueue=k.updateQueue,P.type=k.type,a=k.dependencies,P.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),v=v.sibling;return dt(St,St.current&1|2),c.child}a=a.sibling}P.tail!==null&&At()>Ma&&(c.flags|=128,x=!0,Dl(P,!1),c.lanes=4194304)}else{if(!x)if(a=sf(k),a!==null){if(c.flags|=128,x=!0,v=a.updateQueue,v!==null&&(c.updateQueue=v,c.flags|=4),Dl(P,!0),P.tail===null&&P.tailMode==="hidden"&&!k.alternate&&!bt)return rr(c),null}else 2*At()-P.renderingStartTime>Ma&&v!==1073741824&&(c.flags|=128,x=!0,Dl(P,!1),c.lanes=4194304);P.isBackwards?(k.sibling=c.child,c.child=k):(v=P.last,v!==null?v.sibling=k:c.child=k,P.last=k)}return P.tail!==null?(c=P.tail,P.rendering=c,P.tail=c.sibling,P.renderingStartTime=At(),c.sibling=null,v=St.current,dt(St,x?v&1|2:v&1),c):(rr(c),null);case 22:case 23:return rg(),x=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==x&&(c.flags|=8192),x&&(c.mode&1)!==0?(kr&1073741824)!==0&&(rr(c),c.subtreeFlags&6&&(c.flags|=8192)):rr(c),null;case 24:return null;case 25:return null}throw Error(r(156,c.tag))}function RB(a,c){switch(fv(c),c.tag){case 1:return yr(c.type)&&Xu(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return Na(),yt(gr),yt(er),jv(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 5:return Sv(c),null;case 13:if(yt(St),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Ea()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return yt(St),null;case 4:return Na(),null;case 10:return gv(c.type._context),null;case 22:case 23:return rg(),null;case 24:return null;default:return null}}var vf=!1,nr=!1,MB=typeof WeakSet=="function"?WeakSet:Set,_e=null;function ka(a,c){var v=a.ref;if(v!==null)if(typeof v=="function")try{v(null)}catch(x){jt(a,c,x)}else v.current=null}function Wv(a,c,v){try{v()}catch(x){jt(a,c,x)}}var PO=!1;function IB(a,c){if(rv=Iu,a=oj(),Km(a)){if("selectionStart"in a)var v={start:a.selectionStart,end:a.selectionEnd};else e:{v=(v=a.ownerDocument)&&v.defaultView||window;var x=v.getSelection&&v.getSelection();if(x&&x.rangeCount!==0){v=x.anchorNode;var S=x.anchorOffset,P=x.focusNode;x=x.focusOffset;try{v.nodeType,P.nodeType}catch{v=null;break e}var k=0,q=-1,H=-1,ne=0,ce=0,fe=a,le=null;t:for(;;){for(var Se;fe!==v||S!==0&&fe.nodeType!==3||(q=k+S),fe!==P||x!==0&&fe.nodeType!==3||(H=k+x),fe.nodeType===3&&(k+=fe.nodeValue.length),(Se=fe.firstChild)!==null;)le=fe,fe=Se;for(;;){if(fe===a)break t;if(le===v&&++ne===S&&(q=k),le===P&&++ce===x&&(H=k),(Se=fe.nextSibling)!==null)break;fe=le,le=fe.parentNode}fe=Se}v=q===-1||H===-1?null:{start:q,end:H}}else v=null}v=v||{start:0,end:0}}else v=null;for(nv={focusedElem:a,selectionRange:v},Iu=!1,_e=c;_e!==null;)if(c=_e,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,_e=a;else for(;_e!==null;){c=_e;try{var Oe=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Oe!==null){var Ce=Oe.memoizedProps,Ct=Oe.memoizedState,ee=c.stateNode,K=ee.getSnapshotBeforeUpdate(c.elementType===c.type?Ce:gn(c.type,Ce),Ct);ee.__reactInternalSnapshotBeforeUpdate=K}break;case 3:var re=c.stateNode.containerInfo;re.nodeType===1?re.textContent="":re.nodeType===9&&re.documentElement&&re.removeChild(re.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(pe){jt(c,c.return,pe)}if(a=c.sibling,a!==null){a.return=c.return,_e=a;break}_e=c.return}return Oe=PO,PO=!1,Oe}function Ll(a,c,v){var x=c.updateQueue;if(x=x!==null?x.lastEffect:null,x!==null){var S=x=x.next;do{if((S.tag&a)===a){var P=S.destroy;S.destroy=void 0,P!==void 0&&Wv(c,v,P)}S=S.next}while(S!==x)}}function gf(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var v=c=c.next;do{if((v.tag&a)===a){var x=v.create;v.destroy=x()}v=v.next}while(v!==c)}}function Hv(a){var c=a.ref;if(c!==null){var v=a.stateNode;switch(a.tag){case 5:a=v;break;default:a=v}typeof c=="function"?c(a):c.current=a}}function AO(a){var c=a.alternate;c!==null&&(a.alternate=null,AO(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[Fn],delete c[El],delete c[sv],delete c[gB],delete c[yB])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function CO(a){return a.tag===5||a.tag===3||a.tag===4}function NO(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||CO(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Vv(a,c,v){var x=a.tag;if(x===5||x===6)a=a.stateNode,c?v.nodeType===8?v.parentNode.insertBefore(a,c):v.insertBefore(a,c):(v.nodeType===8?(c=v.parentNode,c.insertBefore(a,v)):(c=v,c.appendChild(a)),v=v._reactRootContainer,v!=null||c.onclick!==null||(c.onclick=Gu));else if(x!==4&&(a=a.child,a!==null))for(Vv(a,c,v),a=a.sibling;a!==null;)Vv(a,c,v),a=a.sibling}function Gv(a,c,v){var x=a.tag;if(x===5||x===6)a=a.stateNode,c?v.insertBefore(a,c):v.appendChild(a);else if(x!==4&&(a=a.child,a!==null))for(Gv(a,c,v),a=a.sibling;a!==null;)Gv(a,c,v),a=a.sibling}var Yt=null,yn=!1;function Hi(a,c,v){for(v=v.child;v!==null;)TO(a,c,v),v=v.sibling}function TO(a,c,v){if(Bn&&typeof Bn.onCommitFiberUnmount=="function")try{Bn.onCommitFiberUnmount(Cu,v)}catch{}switch(v.tag){case 5:nr||ka(v,c);case 6:var x=Yt,S=yn;Yt=null,Hi(a,c,v),Yt=x,yn=S,Yt!==null&&(yn?(a=Yt,v=v.stateNode,a.nodeType===8?a.parentNode.removeChild(v):a.removeChild(v)):Yt.removeChild(v.stateNode));break;case 18:Yt!==null&&(yn?(a=Yt,v=v.stateNode,a.nodeType===8?av(a.parentNode,v):a.nodeType===1&&av(a,v),ml(a)):av(Yt,v.stateNode));break;case 4:x=Yt,S=yn,Yt=v.stateNode.containerInfo,yn=!0,Hi(a,c,v),Yt=x,yn=S;break;case 0:case 11:case 14:case 15:if(!nr&&(x=v.updateQueue,x!==null&&(x=x.lastEffect,x!==null))){S=x=x.next;do{var P=S,k=P.destroy;P=P.tag,k!==void 0&&((P&2)!==0||(P&4)!==0)&&Wv(v,c,k),S=S.next}while(S!==x)}Hi(a,c,v);break;case 1:if(!nr&&(ka(v,c),x=v.stateNode,typeof x.componentWillUnmount=="function"))try{x.props=v.memoizedProps,x.state=v.memoizedState,x.componentWillUnmount()}catch(q){jt(v,c,q)}Hi(a,c,v);break;case 21:Hi(a,c,v);break;case 22:v.mode&1?(nr=(x=nr)||v.memoizedState!==null,Hi(a,c,v),nr=x):Hi(a,c,v);break;default:Hi(a,c,v)}}function kO(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var v=a.stateNode;v===null&&(v=a.stateNode=new MB),c.forEach(function(x){var S=WB.bind(null,a,x);v.has(x)||(v.add(x),x.then(S,S))})}}function xn(a,c){var v=c.deletions;if(v!==null)for(var x=0;xS&&(S=k),x&=~P}if(x=S,x=At()-x,x=(120>x?120:480>x?480:1080>x?1080:1920>x?1920:3e3>x?3e3:4320>x?4320:1960*LB(x/1960))-x,10a?16:a,Gi===null)var x=!1;else{if(a=Gi,Gi=null,Sf=0,(Qe&6)!==0)throw Error(r(331));var S=Qe;for(Qe|=4,_e=a.current;_e!==null;){var P=_e,k=P.child;if((_e.flags&16)!==0){var q=P.deletions;if(q!==null){for(var H=0;HAt()-Yv?Eo(a,0):Xv|=v),wr(a,c)}function HO(a,c){c===0&&((a.mode&1)===0?c=1:(c=Tu,Tu<<=1,(Tu&130023424)===0&&(Tu=4194304)));var v=lr();a=li(a,c),a!==null&&(ul(a,c,v),wr(a,v))}function UB(a){var c=a.memoizedState,v=0;c!==null&&(v=c.retryLane),HO(a,v)}function WB(a,c){var v=0;switch(a.tag){case 13:var x=a.stateNode,S=a.memoizedState;S!==null&&(v=S.retryLane);break;case 19:x=a.stateNode;break;default:throw Error(r(314))}x!==null&&x.delete(c),HO(a,v)}var VO;VO=function(a,c,v){if(a!==null)if(a.memoizedProps!==c.pendingProps||gr.current)xr=!0;else{if((a.lanes&v)===0&&(c.flags&128)===0)return xr=!1,TB(a,c,v);xr=(a.flags&131072)!==0}else xr=!1,bt&&(c.flags&1048576)!==0&&Oj(c,Ju,c.index);switch(c.lanes=0,c.tag){case 2:var x=c.type;mf(a,c),a=c.pendingProps;var S=_a(c,er.current);Ca(c,v),S=Pv(null,c,x,a,S,v);var P=Av();return c.flags|=1,typeof S=="object"&&S!==null&&typeof S.render=="function"&&S.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,yr(x)?(P=!0,Yu(c)):P=!1,c.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,bv(c),S.updater=hf,c.stateNode=S,S._reactInternals=c,Mv(c,x,a,v),c=$v(null,c,x,!0,P,v)):(c.tag=0,bt&&P&&uv(c),sr(null,c,S,v),c=c.child),c;case 16:x=c.elementType;e:{switch(mf(a,c),a=c.pendingProps,S=x._init,x=S(x._payload),c.type=x,S=c.tag=VB(x),a=gn(x,a),S){case 0:c=Lv(null,c,x,a,v);break e;case 1:c=yO(null,c,x,a,v);break e;case 11:c=hO(null,c,x,a,v);break e;case 14:c=pO(null,c,x,gn(x.type,a),v);break e}throw Error(r(306,x,""))}return c;case 0:return x=c.type,S=c.pendingProps,S=c.elementType===x?S:gn(x,S),Lv(a,c,x,S,v);case 1:return x=c.type,S=c.pendingProps,S=c.elementType===x?S:gn(x,S),yO(a,c,x,S,v);case 3:e:{if(xO(c),a===null)throw Error(r(387));x=c.pendingProps,P=c.memoizedState,S=P.element,Mj(a,c),af(c,x,null,v);var k=c.memoizedState;if(x=k.element,P.isDehydrated)if(P={element:x,isDehydrated:!1,cache:k.cache,pendingSuspenseBoundaries:k.pendingSuspenseBoundaries,transitions:k.transitions},c.updateQueue.baseState=P,c.memoizedState=P,c.flags&256){S=Ta(Error(r(423)),c),c=bO(a,c,x,v,S);break e}else if(x!==S){S=Ta(Error(r(424)),c),c=bO(a,c,x,v,S);break e}else for(Tr=Bi(c.stateNode.containerInfo.firstChild),Nr=c,bt=!0,vn=null,v=kj(c,null,x,v),c.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(Ea(),x===S){c=ui(a,c,v);break e}sr(a,c,x,v)}c=c.child}return c;case 5:return Lj(c),a===null&&hv(c),x=c.type,S=c.pendingProps,P=a!==null?a.memoizedProps:null,k=S.children,iv(x,S)?k=null:P!==null&&iv(x,P)&&(c.flags|=32),gO(a,c),sr(a,c,k,v),c.child;case 6:return a===null&&hv(c),null;case 13:return wO(a,c,v);case 4:return wv(c,c.stateNode.containerInfo),x=c.pendingProps,a===null?c.child=Pa(c,null,x,v):sr(a,c,x,v),c.child;case 11:return x=c.type,S=c.pendingProps,S=c.elementType===x?S:gn(x,S),hO(a,c,x,S,v);case 7:return sr(a,c,c.pendingProps,v),c.child;case 8:return sr(a,c,c.pendingProps.children,v),c.child;case 12:return sr(a,c,c.pendingProps.children,v),c.child;case 10:e:{if(x=c.type._context,S=c.pendingProps,P=c.memoizedProps,k=S.value,dt(rf,x._currentValue),x._currentValue=k,P!==null)if(mn(P.value,k)){if(P.children===S.children&&!gr.current){c=ui(a,c,v);break e}}else for(P=c.child,P!==null&&(P.return=c);P!==null;){var q=P.dependencies;if(q!==null){k=P.child;for(var H=q.firstContext;H!==null;){if(H.context===x){if(P.tag===1){H=ci(-1,v&-v),H.tag=2;var ne=P.updateQueue;if(ne!==null){ne=ne.shared;var ce=ne.pending;ce===null?H.next=H:(H.next=ce.next,ce.next=H),ne.pending=H}}P.lanes|=v,H=P.alternate,H!==null&&(H.lanes|=v),yv(P.return,v,c),q.lanes|=v;break}H=H.next}}else if(P.tag===10)k=P.type===c.type?null:P.child;else if(P.tag===18){if(k=P.return,k===null)throw Error(r(341));k.lanes|=v,q=k.alternate,q!==null&&(q.lanes|=v),yv(k,v,c),k=P.sibling}else k=P.child;if(k!==null)k.return=P;else for(k=P;k!==null;){if(k===c){k=null;break}if(P=k.sibling,P!==null){P.return=k.return,k=P;break}k=k.return}P=k}sr(a,c,S.children,v),c=c.child}return c;case 9:return S=c.type,x=c.pendingProps.children,Ca(c,v),S=Xr(S),x=x(S),c.flags|=1,sr(a,c,x,v),c.child;case 14:return x=c.type,S=gn(x,c.pendingProps),S=gn(x.type,S),pO(a,c,x,S,v);case 15:return mO(a,c,c.type,c.pendingProps,v);case 17:return x=c.type,S=c.pendingProps,S=c.elementType===x?S:gn(x,S),mf(a,c),c.tag=1,yr(x)?(a=!0,Yu(c)):a=!1,Ca(c,v),aO(c,x,S),Mv(c,x,S,v),$v(null,c,x,!0,a,v);case 19:return _O(a,c,v);case 22:return vO(a,c,v)}throw Error(r(156,c.tag))};function GO(a,c){return E_(a,c)}function HB(a,c,v,x){this.tag=a,this.key=v,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zr(a,c,v,x){return new HB(a,c,v,x)}function ig(a){return a=a.prototype,!(!a||!a.isReactComponent)}function VB(a){if(typeof a=="function")return ig(a)?1:0;if(a!=null){if(a=a.$$typeof,a===L)return 11;if(a===V)return 14}return 2}function Yi(a,c){var v=a.alternate;return v===null?(v=Zr(a.tag,c,a.key,a.mode),v.elementType=a.elementType,v.type=a.type,v.stateNode=a.stateNode,v.alternate=a,a.alternate=v):(v.pendingProps=c,v.type=a.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=a.flags&14680064,v.childLanes=a.childLanes,v.lanes=a.lanes,v.child=a.child,v.memoizedProps=a.memoizedProps,v.memoizedState=a.memoizedState,v.updateQueue=a.updateQueue,c=a.dependencies,v.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},v.sibling=a.sibling,v.index=a.index,v.ref=a.ref,v}function Ef(a,c,v,x,S,P){var k=2;if(x=a,typeof a=="function")ig(a)&&(k=1);else if(typeof a=="string")k=5;else e:switch(a){case T:return Ao(v.children,S,P,c);case R:k=8,S|=8;break;case I:return a=Zr(12,v,c,S|2),a.elementType=I,a.lanes=P,a;case U:return a=Zr(13,v,c,S),a.elementType=U,a.lanes=P,a;case W:return a=Zr(19,v,c,S),a.elementType=W,a.lanes=P,a;case Y:return Pf(v,S,P,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case z:k=10;break e;case $:k=9;break e;case L:k=11;break e;case V:k=14;break e;case G:k=16,x=null;break e}throw Error(r(130,a==null?a:typeof a,""))}return c=Zr(k,v,c,S),c.elementType=a,c.type=x,c.lanes=P,c}function Ao(a,c,v,x){return a=Zr(7,a,x,c),a.lanes=v,a}function Pf(a,c,v,x){return a=Zr(22,a,x,c),a.elementType=Y,a.lanes=v,a.stateNode={isHidden:!1},a}function og(a,c,v){return a=Zr(6,a,null,c),a.lanes=v,a}function ag(a,c,v){return c=Zr(4,a.children!==null?a.children:[],a.key,c),c.lanes=v,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function GB(a,c,v,x,S){this.tag=c,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Rm(0),this.expirationTimes=Rm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rm(0),this.identifierPrefix=x,this.onRecoverableError=S,this.mutableSourceEagerHydrationData=null}function sg(a,c,v,x,S,P,k,q,H){return a=new GB(a,c,v,q,H),c===1?(c=1,P===!0&&(c|=8)):c=0,P=Zr(3,null,null,c),a.current=P,P.stateNode=a,P.memoizedState={element:x,isDehydrated:v,cache:null,transitions:null,pendingSuspenseBoundaries:null},bv(P),a}function KB(a,c,v){var x=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),hg.exports=a8(),hg.exports}var sE;function s8(){if(sE)return If;sE=1;var e=GR();return If.createRoot=e.createRoot,If.hydrateRoot=e.hydrateRoot,If}var l8=s8(),_=cp();const F=ot(_),Ew=e8({__proto__:null,default:F},[_]);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const c8=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),u8=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),lE=e=>{const t=u8(e);return t.charAt(0).toUpperCase()+t.slice(1)},KR=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var f8={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"};/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const d8=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:o,iconNode:s,...u},f)=>_.createElement("svg",{ref:f,...f8,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:KR("lucide",i),...u},[...s.map(([l,d])=>_.createElement(l,d)),...Array.isArray(o)?o:[o]]));/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Re=(e,t)=>{const r=_.forwardRef(({className:n,...i},o)=>_.createElement(d8,{ref:o,iconNode:t,className:KR(`lucide-${c8(lE(e))}`,`lucide-${e}`,n),...i}));return r.displayName=lE(e),r};/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const h8=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]],p8=Re("arrow-down-a-z",h8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const m8=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],v8=Re("arrow-down-right",m8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const g8=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],y8=Re("arrow-left",g8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const x8=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],b8=Re("arrow-up-down",x8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const w8=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],XR=Re("arrow-up-right",w8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const S8=[["path",{d:"M3 5v14",key:"1nt18q"}],["path",{d:"M8 5v14",key:"1ybrkv"}],["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"M17 5v14",key:"ycjyhj"}],["path",{d:"M21 5v14",key:"nzette"}]],_8=Re("barcode",S8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const j8=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],O8=Re("bell",j8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const E8=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],P8=Re("calendar",E8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const A8=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],C8=Re("chart-column",A8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const N8=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],YR=Re("check",N8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const T8=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],xc=Re("chevron-down",T8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const k8=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],QR=Re("chevron-left",k8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const R8=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],bc=Re("chevron-right",R8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const M8=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],I8=Re("chevron-up",M8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const D8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Wd=Re("circle-help",D8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const L8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],$8=Re("circle-user",L8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const B8=[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]],F8=Re("coffee",B8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const z8=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Pw=Re("download",z8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const q8=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Aw=Re("ellipsis",q8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const U8=[["path",{d:"M14.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"16lz6z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 13.1a2 2 0 0 0-1 1.76v3.24a2 2 0 0 0 .97 1.78L6 21.7a2 2 0 0 0 2.03.01L11 19.9a2 2 0 0 0 1-1.76V14.9a2 2 0 0 0-.97-1.78L8 11.3a2 2 0 0 0-2.03-.01Z",key:"99pj1s"}],["path",{d:"M7 17v5",key:"1yj1jh"}],["path",{d:"M11.7 14.2 7 17l-4.7-2.8",key:"1yk8tc"}]],ZR=Re("file-box",U8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const W8=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],us=Re("file-text",W8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const H8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],V8=Re("grid-3x3",H8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const G8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Wo=Re("image",G8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const K8=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],JR=Re("layers",K8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const X8=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],eM=Re("layout-dashboard",X8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Y8=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],Q8=Re("list",Y8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Z8=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],J8=Re("log-out",Z8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const e6=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Fs=Re("map-pin",e6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const t6=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],r6=Re("menu",t6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const n6=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Hd=Re("package",n6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const i6=[["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:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]],tM=Re("palette",i6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const o6=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Bd=Re("pencil",o6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const a6=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],s6=Re("pin",a6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const l6=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],jr=Re("plus",l6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const c6=[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]],rM=Re("printer",c6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const u6=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],f6=Re("refresh-cw",u6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const d6=[["path",{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",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],h6=Re("save",d6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const p6=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Cw=Re("search",p6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const m6=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Vd=Re("settings",m6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const v6=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],g6=Re("shield",v6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const y6=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],ro=Re("square-pen",y6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const x6=[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7",key:"6c3vgh"}]],b6=Re("store",x6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const w6=[["path",{d:"m18 2 4 4",key:"22kx64"}],["path",{d:"m17 7 3-3",key:"1w1zoj"}],["path",{d:"M19 9 8.7 19.3c-1 1-2.5 1-3.4 0l-.6-.6c-1-1-1-2.5 0-3.4L15 5",key:"1exhtz"}],["path",{d:"m9 11 4 4",key:"rovt3i"}],["path",{d:"m5 19-3 3",key:"59f2uf"}],["path",{d:"m14 4 6 6",key:"yqp9t2"}]],vg=Re("syringe",w6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const S6=[["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"}]],_6=Re("tablet",S6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const j6=[["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"}]],Gd=Re("tag",j6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const O6=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],E6=Re("timer",O6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const P6=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Fb=Re("trash-2",P6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const A6=[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]],C6=Re("trending-up",A6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const N6=[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]],up=Re("type",N6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const T6=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],k6=Re("upload",T6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const R6=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],M6=Re("user",R6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const I6=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],Nw=Re("users",I6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const D6=[["path",{d:"M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2",key:"cjf0a3"}],["path",{d:"M7 2v20",key:"1473qp"}],["path",{d:"M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7",key:"j28e5"}]],L6=Re("utensils",D6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $6=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],uc=Re("x",$6);function nM(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const r=new Array(e.length+t.length);for(let n=0;n({classGroupId:e,validator:t}),iM=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Kd="-",cE=[],z6="arbitrary..",q6=e=>{const t=W6(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return U6(s);const u=s.split(Kd),f=u[0]===""&&u.length>1?1:0;return oM(u,f,t)},getConflictingClassGroupIds:(s,u)=>{if(u){const f=n[s],l=r[s];return f?l?B6(l,f):f:l||cE}return r[s]||cE}}},oM=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const i=e[t],o=r.nextPart.get(i);if(o){const l=oM(e,t+1,o);if(l)return l}const s=r.validators;if(s===null)return;const u=t===0?e.join(Kd):e.slice(t).join(Kd),f=s.length;for(let l=0;le.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?z6+n:void 0})(),W6=e=>{const{theme:t,classGroups:r}=e;return H6(r,t)},H6=(e,t)=>{const r=iM();for(const n in e){const i=e[n];Tw(i,r,n,t)}return r},Tw=(e,t,r,n)=>{const i=e.length;for(let o=0;o{if(typeof e=="string"){G6(e,t,r);return}if(typeof e=="function"){K6(e,t,r,n);return}X6(e,t,r,n)},G6=(e,t,r)=>{const n=e===""?t:aM(t,e);n.classGroupId=r},K6=(e,t,r,n)=>{if(Y6(e)){Tw(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(F6(r,e))},X6=(e,t,r,n)=>{const i=Object.entries(e),o=i.length;for(let s=0;s{let r=e;const n=t.split(Kd),i=n.length;for(let o=0;o"isThemeGetter"in e&&e.isThemeGetter===!0,Q6=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const i=(o,s)=>{r[o]=s,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(o){let s=r[o];if(s!==void 0)return s;if((s=n[o])!==void 0)return i(o,s),s},set(o,s){o in r?r[o]=s:i(o,s)}}},zb="!",uE=":",Z6=[],fE=(e,t,r,n,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:i}),J6=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=i=>{const o=[];let s=0,u=0,f=0,l;const d=i.length;for(let y=0;yf?l-f:void 0;return fE(o,g,m,b)};if(t){const i=t+uE,o=n;n=s=>s.startsWith(i)?o(s.slice(i.length)):fE(Z6,!1,s,void 0,!0)}if(r){const i=n;n=o=>r({className:o,parseClassName:i})}return n},eF=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let i=[];for(let o=0;o0&&(i.sort(),n.push(...i),i=[]),n.push(s)):i.push(s)}return i.length>0&&(i.sort(),n.push(...i)),n}},tF=e=>({cache:Q6(e.cacheSize),parseClassName:J6(e),sortModifiers:eF(e),...q6(e)}),rF=/\s+/,nF=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:o}=t,s=[],u=e.trim().split(rF);let f="";for(let l=u.length-1;l>=0;l-=1){const d=u[l],{isExternal:p,modifiers:m,hasImportantModifier:g,baseClassName:b,maybePostfixModifierPosition:y}=r(d);if(p){f=d+(f.length>0?" "+f:f);continue}let w=!!y,j=n(w?b.substring(0,y):b);if(!j){if(!w){f=d+(f.length>0?" "+f:f);continue}if(j=n(b),!j){f=d+(f.length>0?" "+f:f);continue}w=!1}const O=m.length===0?"":m.length===1?m[0]:o(m).join(":"),E=g?O+zb:O,N=E+j;if(s.indexOf(N)>-1)continue;s.push(N);const A=i(j,w);for(let C=0;C0?" "+f:f)}return f},iF=(...e)=>{let t=0,r,n,i="";for(;t{if(typeof e=="string")return e;let t,r="";for(let n=0;n{let r,n,i,o;const s=f=>{const l=t.reduce((d,p)=>p(d),e());return r=tF(l),n=r.cache.get,i=r.cache.set,o=u,u(f)},u=f=>{const l=n(f);if(l)return l;const d=nF(f,r);return i(f,d),d};return o=s,(...f)=>o(iF(...f))},aF=[],Dt=e=>{const t=r=>r[e]||aF;return t.isThemeGetter=!0,t},lM=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,cM=/^\((?:(\w[\w-]*):)?(.+)\)$/i,sF=/^\d+\/\d+$/,lF=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cF=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,uF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Da=e=>sF.test(e),He=e=>!!e&&!Number.isNaN(Number(e)),Zi=e=>!!e&&Number.isInteger(Number(e)),gg=e=>e.endsWith("%")&&He(e.slice(0,-1)),di=e=>lF.test(e),hF=()=>!0,pF=e=>cF.test(e)&&!uF.test(e),uM=()=>!1,mF=e=>fF.test(e),vF=e=>dF.test(e),gF=e=>!Ee(e)&&!Pe(e),yF=e=>zs(e,hM,uM),Ee=e=>lM.test(e),Co=e=>zs(e,pM,pF),yg=e=>zs(e,_F,He),dE=e=>zs(e,fM,uM),xF=e=>zs(e,dM,vF),Df=e=>zs(e,mM,mF),Pe=e=>cM.test(e),Ul=e=>qs(e,pM),bF=e=>qs(e,jF),hE=e=>qs(e,fM),wF=e=>qs(e,hM),SF=e=>qs(e,dM),Lf=e=>qs(e,mM,!0),zs=(e,t,r)=>{const n=lM.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},qs=(e,t,r=!1)=>{const n=cM.exec(e);return n?n[1]?t(n[1]):r:!1},fM=e=>e==="position"||e==="percentage",dM=e=>e==="image"||e==="url",hM=e=>e==="length"||e==="size"||e==="bg-size",pM=e=>e==="length",_F=e=>e==="number",jF=e=>e==="family-name",mM=e=>e==="shadow",OF=()=>{const e=Dt("color"),t=Dt("font"),r=Dt("text"),n=Dt("font-weight"),i=Dt("tracking"),o=Dt("leading"),s=Dt("breakpoint"),u=Dt("container"),f=Dt("spacing"),l=Dt("radius"),d=Dt("shadow"),p=Dt("inset-shadow"),m=Dt("text-shadow"),g=Dt("drop-shadow"),b=Dt("blur"),y=Dt("perspective"),w=Dt("aspect"),j=Dt("ease"),O=Dt("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...N(),Pe,Ee],C=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],R=()=>[Pe,Ee,f],I=()=>[Da,"full","auto",...R()],z=()=>[Zi,"none","subgrid",Pe,Ee],$=()=>["auto",{span:["full",Zi,Pe,Ee]},Zi,Pe,Ee],L=()=>[Zi,"auto",Pe,Ee],U=()=>["auto","min","max","fr",Pe,Ee],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...R()],Y=()=>[Da,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],D=()=>[e,Pe,Ee],Q=()=>[...N(),hE,dE,{position:[Pe,Ee]}],J=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",wF,yF,{size:[Pe,Ee]}],B=()=>[gg,Ul,Co],Z=()=>["","none","full",l,Pe,Ee],te=()=>["",He,Ul,Co],ve=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>[He,gg,hE,dE],ue=()=>["","none",b,Pe,Ee],ie=()=>["none",He,Pe,Ee],de=()=>["none",He,Pe,Ee],ye=()=>[He,Pe,Ee],oe=()=>[Da,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[di],breakpoint:[di],color:[hF],container:[di],"drop-shadow":[di],ease:["in","out","in-out"],font:[gF],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[di],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[di],shadow:[di],spacing:["px",He],text:[di],"text-shadow":[di],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Da,Ee,Pe,w]}],container:["container"],columns:[{columns:[He,Ee,Pe,u]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Zi,"auto",Pe,Ee]}],basis:[{basis:[Da,"full","auto",u,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[He,Da,"auto","initial","none",Ee]}],grow:[{grow:["",He,Pe,Ee]}],shrink:[{shrink:["",He,Pe,Ee]}],order:[{order:[Zi,"first","last","none",Pe,Ee]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],w:[{w:[u,"screen",...Y()]}],"min-w":[{"min-w":[u,"screen","none",...Y()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[s]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",r,Ul,Co]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Pe,yg]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",gg,Ee]}],"font-family":[{font:[bF,Ee,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Pe,Ee]}],"line-clamp":[{"line-clamp":[He,"none",Pe,yg]}],leading:[{leading:[o,...R()]}],"list-image":[{"list-image":["none",Pe,Ee]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Pe,Ee]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ve(),"wavy"]}],"text-decoration-thickness":[{decoration:[He,"from-font","auto",Pe,Co]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[He,"auto",Pe,Ee]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Pe,Ee]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Pe,Ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Q()}],"bg-repeat":[{bg:J()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Zi,Pe,Ee],radial:["",Pe,Ee],conic:[Zi,Pe,Ee]},SF,xF]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:Z()}],"rounded-s":[{"rounded-s":Z()}],"rounded-e":[{"rounded-e":Z()}],"rounded-t":[{"rounded-t":Z()}],"rounded-r":[{"rounded-r":Z()}],"rounded-b":[{"rounded-b":Z()}],"rounded-l":[{"rounded-l":Z()}],"rounded-ss":[{"rounded-ss":Z()}],"rounded-se":[{"rounded-se":Z()}],"rounded-ee":[{"rounded-ee":Z()}],"rounded-es":[{"rounded-es":Z()}],"rounded-tl":[{"rounded-tl":Z()}],"rounded-tr":[{"rounded-tr":Z()}],"rounded-br":[{"rounded-br":Z()}],"rounded-bl":[{"rounded-bl":Z()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ve(),"hidden","none"]}],"divide-style":[{divide:[...ve(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...ve(),"none","hidden"]}],"outline-offset":[{"outline-offset":[He,Pe,Ee]}],"outline-w":[{outline:["",He,Ul,Co]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",d,Lf,Df]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",p,Lf,Df]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[He,Co]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",m,Lf,Df]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[He,Pe,Ee]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[He]}],"mask-image-linear-from-pos":[{"mask-linear-from":X()}],"mask-image-linear-to-pos":[{"mask-linear-to":X()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":X()}],"mask-image-t-to-pos":[{"mask-t-to":X()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":X()}],"mask-image-r-to-pos":[{"mask-r-to":X()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":X()}],"mask-image-b-to-pos":[{"mask-b-to":X()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":X()}],"mask-image-l-to-pos":[{"mask-l-to":X()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":X()}],"mask-image-x-to-pos":[{"mask-x-to":X()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":X()}],"mask-image-y-to-pos":[{"mask-y-to":X()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[Pe,Ee]}],"mask-image-radial-from-pos":[{"mask-radial-from":X()}],"mask-image-radial-to-pos":[{"mask-radial-to":X()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":N()}],"mask-image-conic-pos":[{"mask-conic":[He]}],"mask-image-conic-from-pos":[{"mask-conic-from":X()}],"mask-image-conic-to-pos":[{"mask-conic-to":X()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Q()}],"mask-repeat":[{mask:J()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Pe,Ee]}],filter:[{filter:["","none",Pe,Ee]}],blur:[{blur:ue()}],brightness:[{brightness:[He,Pe,Ee]}],contrast:[{contrast:[He,Pe,Ee]}],"drop-shadow":[{"drop-shadow":["","none",g,Lf,Df]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",He,Pe,Ee]}],"hue-rotate":[{"hue-rotate":[He,Pe,Ee]}],invert:[{invert:["",He,Pe,Ee]}],saturate:[{saturate:[He,Pe,Ee]}],sepia:[{sepia:["",He,Pe,Ee]}],"backdrop-filter":[{"backdrop-filter":["","none",Pe,Ee]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[He,Pe,Ee]}],"backdrop-contrast":[{"backdrop-contrast":[He,Pe,Ee]}],"backdrop-grayscale":[{"backdrop-grayscale":["",He,Pe,Ee]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[He,Pe,Ee]}],"backdrop-invert":[{"backdrop-invert":["",He,Pe,Ee]}],"backdrop-opacity":[{"backdrop-opacity":[He,Pe,Ee]}],"backdrop-saturate":[{"backdrop-saturate":[He,Pe,Ee]}],"backdrop-sepia":[{"backdrop-sepia":["",He,Pe,Ee]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Pe,Ee]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[He,"initial",Pe,Ee]}],ease:[{ease:["linear","initial",j,Pe,Ee]}],delay:[{delay:[He,Pe,Ee]}],animate:[{animate:["none",O,Pe,Ee]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,Pe,Ee]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":["scale-3d"],skew:[{skew:ye()}],"skew-x":[{"skew-x":ye()}],"skew-y":[{"skew-y":ye()}],transform:[{transform:[Pe,Ee,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Pe,Ee]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Pe,Ee]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[He,Ul,Co,yg]}],stroke:[{stroke:["none",...D()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},EF=oF(OF);function Te(...e){return EF(We(e))}var ou=GR();const PF=ot(ou);function pE(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ia(...e){return t=>{let r=!1;const n=e.map(i=>{const o=pE(i,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let i=0;i{const{children:o,...s}=n,u=_.Children.toArray(o),f=u.find(TF);if(f){const l=f.props.children,d=u.map(p=>p===f?_.Children.count(l)>1?_.Children.only(null):_.isValidElement(l)?l.props.children:null:p);return h.jsx(t,{...s,ref:i,children:_.isValidElement(l)?_.cloneElement(l,void 0,d):null})}return h.jsx(t,{...s,ref:i,children:o})});return r.displayName=`${e}.Slot`,r}function CF(e){const t=_.forwardRef((r,n)=>{const{children:i,...o}=r;if(_.isValidElement(i)){const s=RF(i),u=kF(o,i.props);return i.type!==_.Fragment&&(u.ref=n?ia(n,s):s),_.cloneElement(i,u)}return _.Children.count(i)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var NF=Symbol("radix.slottable");function TF(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===NF}function kF(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...u)=>{const f=o(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function RF(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 MF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qe=MF.reduce((e,t)=>{const r=AF(`Primitive.${t}`),n=_.forwardRef((i,o)=>{const{asChild:s,...u}=i,f=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(f,{...u,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function IF(e,t){e&&ou.flushSync(()=>e.dispatchEvent(t))}var Rt=globalThis?.document?_.useLayoutEffect:()=>{};function DF(e,t){return _.useReducer((r,n)=>t[r][n]??r,e)}var Or=e=>{const{present:t,children:r}=e,n=LF(t),i=typeof r=="function"?r({present:n.isPresent}):_.Children.only(r),o=Xe(n.ref,$F(i));return typeof r=="function"||n.isPresent?_.cloneElement(i,{ref:o}):null};Or.displayName="Presence";function LF(e){const[t,r]=_.useState(),n=_.useRef(null),i=_.useRef(e),o=_.useRef("none"),s=e?"mounted":"unmounted",[u,f]=DF(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const l=$f(n.current);o.current=u==="mounted"?l:"none"},[u]),Rt(()=>{const l=n.current,d=i.current;if(d!==e){const m=o.current,g=$f(l);e?f("MOUNT"):g==="none"||l?.display==="none"?f("UNMOUNT"):f(d&&m!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,f]),Rt(()=>{if(t){let l;const d=t.ownerDocument.defaultView??window,p=g=>{const y=$f(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&y&&(f("ANIMATION_END"),!i.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",l=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},m=g=>{g.target===t&&(o.current=$f(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{d.clearTimeout(l),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:_.useCallback(l=>{n.current=l?getComputedStyle(l):null,r(l)},[])}}function $f(e){return e?.animationName||"none"}function $F(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 BF(e,t){const r=_.createContext(t),n=o=>{const{children:s,...u}=o,f=_.useMemo(()=>u,Object.values(u));return h.jsx(r.Provider,{value:f,children:s})};n.displayName=e+"Provider";function i(o){const s=_.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[n,i]}function In(e,t=[]){let r=[];function n(o,s){const u=_.createContext(s),f=r.length;r=[...r,s];const l=p=>{const{scope:m,children:g,...b}=p,y=m?.[e]?.[f]||u,w=_.useMemo(()=>b,Object.values(b));return h.jsx(y.Provider,{value:w,children:g})};l.displayName=o+"Provider";function d(p,m){const g=m?.[e]?.[f]||u,b=_.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[l,d]}const i=()=>{const o=r.map(s=>_.createContext(s));return function(u){const f=u?.[e]||o;return _.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return i.scopeName=e,[n,FF(i,...t)]}function FF(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=n.reduce((u,{useScope:f,scopeName:l})=>{const p=f(o)[`__scope${l}`];return{...u,...p}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}function ar(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...r)=>t.current?.(...r),[])}var zF=_.createContext(void 0);function fp(e){const t=_.useContext(zF);return e||t||"ltr"}function qb(e,[t,r]){return Math.min(r,Math.max(t,e))}function ke(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e?.(i),r===!1||!i.defaultPrevented)return t?.(i)}}function qF(e,t){return _.useReducer((r,n)=>t[r][n]??r,e)}var kw="ScrollArea",[vM]=In(kw),[UF,ln]=vM(kw),gM=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:i,scrollHideDelay:o=600,...s}=e,[u,f]=_.useState(null),[l,d]=_.useState(null),[p,m]=_.useState(null),[g,b]=_.useState(null),[y,w]=_.useState(null),[j,O]=_.useState(0),[E,N]=_.useState(0),[A,C]=_.useState(!1),[T,R]=_.useState(!1),I=Xe(t,$=>f($)),z=fp(i);return h.jsx(UF,{scope:r,type:n,dir:z,scrollHideDelay:o,scrollArea:u,viewport:l,onViewportChange:d,content:p,onContentChange:m,scrollbarX:g,onScrollbarXChange:b,scrollbarXEnabled:A,onScrollbarXEnabledChange:C,scrollbarY:y,onScrollbarYChange:w,scrollbarYEnabled:T,onScrollbarYEnabledChange:R,onCornerWidthChange:O,onCornerHeightChange:N,children:h.jsx(qe.div,{dir:z,...s,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":j+"px","--radix-scroll-area-corner-height":E+"px",...e.style}})})});gM.displayName=kw;var yM="ScrollAreaViewport",xM=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:i,...o}=e,s=ln(yM,r),u=_.useRef(null),f=Xe(t,u,s.onViewportChange);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),h.jsx(qe.div,{"data-radix-scroll-area-viewport":"",...o,ref:f,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:h.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});xM.displayName=yM;var ei="ScrollAreaScrollbar",bM=_.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=ln(ei,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,u=e.orientation==="horizontal";return _.useEffect(()=>(u?o(!0):s(!0),()=>{u?o(!1):s(!1)}),[u,o,s]),i.type==="hover"?h.jsx(WF,{...n,ref:t,forceMount:r}):i.type==="scroll"?h.jsx(HF,{...n,ref:t,forceMount:r}):i.type==="auto"?h.jsx(wM,{...n,ref:t,forceMount:r}):i.type==="always"?h.jsx(Rw,{...n,ref:t}):null});bM.displayName=ei;var WF=_.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=ln(ei,e.__scopeScrollArea),[o,s]=_.useState(!1);return _.useEffect(()=>{const u=i.scrollArea;let f=0;if(u){const l=()=>{window.clearTimeout(f),s(!0)},d=()=>{f=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return u.addEventListener("pointerenter",l),u.addEventListener("pointerleave",d),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",l),u.removeEventListener("pointerleave",d)}}},[i.scrollArea,i.scrollHideDelay]),h.jsx(Or,{present:r||o,children:h.jsx(wM,{"data-state":o?"visible":"hidden",...n,ref:t})})}),HF=_.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=ln(ei,e.__scopeScrollArea),o=e.orientation==="horizontal",s=hp(()=>f("SCROLL_END"),100),[u,f]=qF("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return _.useEffect(()=>{if(u==="idle"){const l=window.setTimeout(()=>f("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(l)}},[u,i.scrollHideDelay,f]),_.useEffect(()=>{const l=i.viewport,d=o?"scrollLeft":"scrollTop";if(l){let p=l[d];const m=()=>{const g=l[d];p!==g&&(f("SCROLL"),s()),p=g};return l.addEventListener("scroll",m),()=>l.removeEventListener("scroll",m)}},[i.viewport,o,f,s]),h.jsx(Or,{present:r||u!=="hidden",children:h.jsx(Rw,{"data-state":u==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:ke(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:ke(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),wM=_.forwardRef((e,t)=>{const r=ln(ei,e.__scopeScrollArea),{forceMount:n,...i}=e,[o,s]=_.useState(!1),u=e.orientation==="horizontal",f=hp(()=>{if(r.viewport){const l=r.viewport.offsetWidth{const{orientation:r="vertical",...n}=e,i=ln(ei,e.__scopeScrollArea),o=_.useRef(null),s=_.useRef(0),[u,f]=_.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=EM(u.viewport,u.content),d={...n,sizes:u,onSizesChange:f,hasThumb:l>0&&l<1,onThumbChange:m=>o.current=m,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:m=>s.current=m};function p(m,g){return QF(m,s.current,u,g)}return r==="horizontal"?h.jsx(VF,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const m=i.viewport.scrollLeft,g=mE(m,u,i.dir);o.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollLeft=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollLeft=p(m,i.dir))}}):r==="vertical"?h.jsx(GF,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const m=i.viewport.scrollTop,g=mE(m,u);o.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollTop=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollTop=p(m))}}):null}),VF=_.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...i}=e,o=ln(ei,e.__scopeScrollArea),[s,u]=_.useState(),f=_.useRef(null),l=Xe(t,f,o.onScrollbarXChange);return _.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),h.jsx(_M,{"data-orientation":"horizontal",...i,ref:l,sizes:r,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":dp(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,p)=>{if(o.viewport){const m=o.viewport.scrollLeft+d.deltaX;e.onWheelScroll(m),AM(m,p)&&d.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&n({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:Yd(s.paddingLeft),paddingEnd:Yd(s.paddingRight)}})}})}),GF=_.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...i}=e,o=ln(ei,e.__scopeScrollArea),[s,u]=_.useState(),f=_.useRef(null),l=Xe(t,f,o.onScrollbarYChange);return _.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),h.jsx(_M,{"data-orientation":"vertical",...i,ref:l,sizes:r,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":dp(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,p)=>{if(o.viewport){const m=o.viewport.scrollTop+d.deltaY;e.onWheelScroll(m),AM(m,p)&&d.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&n({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:Yd(s.paddingTop),paddingEnd:Yd(s.paddingBottom)}})}})}),[KF,SM]=vM(ei),_M=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:u,onThumbPositionChange:f,onDragScroll:l,onWheelScroll:d,onResize:p,...m}=e,g=ln(ei,r),[b,y]=_.useState(null),w=Xe(t,I=>y(I)),j=_.useRef(null),O=_.useRef(""),E=g.viewport,N=n.content-n.viewport,A=ar(d),C=ar(f),T=hp(p,10);function R(I){if(j.current){const z=I.clientX-j.current.left,$=I.clientY-j.current.top;l({x:z,y:$})}}return _.useEffect(()=>{const I=z=>{const $=z.target;b?.contains($)&&A(z,N)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[E,b,N,A]),_.useEffect(C,[n,C]),fs(b,T),fs(g.content,T),h.jsx(KF,{scope:r,scrollbar:b,hasThumb:i,onThumbChange:ar(o),onThumbPointerUp:ar(s),onThumbPositionChange:C,onThumbPointerDown:ar(u),children:h.jsx(qe.div,{...m,ref:w,style:{position:"absolute",...m.style},onPointerDown:ke(e.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),j.current=b.getBoundingClientRect(),O.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),R(I))}),onPointerMove:ke(e.onPointerMove,R),onPointerUp:ke(e.onPointerUp,I=>{const z=I.target;z.hasPointerCapture(I.pointerId)&&z.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=O.current,g.viewport&&(g.viewport.style.scrollBehavior=""),j.current=null})})})}),Xd="ScrollAreaThumb",jM=_.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=SM(Xd,e.__scopeScrollArea);return h.jsx(Or,{present:r||i.hasThumb,children:h.jsx(XF,{ref:t,...n})})}),XF=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...i}=e,o=ln(Xd,r),s=SM(Xd,r),{onThumbPositionChange:u}=s,f=Xe(t,p=>s.onThumbChange(p)),l=_.useRef(void 0),d=hp(()=>{l.current&&(l.current(),l.current=void 0)},100);return _.useEffect(()=>{const p=o.viewport;if(p){const m=()=>{if(d(),!l.current){const g=ZF(p,u);l.current=g,u()}};return u(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[o.viewport,d,u]),h.jsx(qe.div,{"data-state":s.hasThumb?"visible":"hidden",...i,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:ke(e.onPointerDownCapture,p=>{const g=p.target.getBoundingClientRect(),b=p.clientX-g.left,y=p.clientY-g.top;s.onThumbPointerDown({x:b,y})}),onPointerUp:ke(e.onPointerUp,s.onThumbPointerUp)})});jM.displayName=Xd;var Mw="ScrollAreaCorner",OM=_.forwardRef((e,t)=>{const r=ln(Mw,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?h.jsx(YF,{...e,ref:t}):null});OM.displayName=Mw;var YF=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,i=ln(Mw,r),[o,s]=_.useState(0),[u,f]=_.useState(0),l=!!(o&&u);return fs(i.scrollbarX,()=>{const d=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(d),f(d)}),fs(i.scrollbarY,()=>{const d=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(d),s(d)}),l?h.jsx(qe.div,{...n,ref:t,style:{width:o,height:u,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Yd(e){return e?parseInt(e,10):0}function EM(e,t){const r=e/t;return isNaN(r)?0:r}function dp(e){const t=EM(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function QF(e,t,r,n="ltr"){const i=dp(r),o=i/2,s=t||o,u=i-s,f=r.scrollbar.paddingStart+s,l=r.scrollbar.size-r.scrollbar.paddingEnd-u,d=r.content-r.viewport,p=n==="ltr"?[0,d]:[d*-1,0];return PM([f,l],p)(e)}function mE(e,t,r="ltr"){const n=dp(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,u=o-n,f=r==="ltr"?[0,s]:[s*-1,0],l=qb(e,f);return PM([0,s],[0,u])(l)}function PM(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function AM(e,t){return e>0&&e{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return(function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=r.left!==o.left,u=r.top!==o.top;(s||u)&&t(),r=o,n=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(n)};function hp(e,t){const r=ar(e),n=_.useRef(0);return _.useEffect(()=>()=>window.clearTimeout(n.current),[]),_.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function fs(e,t){const r=ar(t);Rt(()=>{let n=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return i.observe(e),()=>{window.cancelAnimationFrame(n),i.unobserve(e)}}},[e,r])}var JF=gM,ez=xM,tz=OM;function wc({className:e,children:t,...r}){return h.jsxs(JF,{"data-slot":"scroll-area",className:Te("relative",e),...r,children:[h.jsx(ez,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),h.jsx(rz,{}),h.jsx(tz,{})]})}function rz({className:e,orientation:t="vertical",...r}){return h.jsx(bM,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Te("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...r,children:h.jsx(jM,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}const nz="/assets/773f0c39e1986271e9144596caac519f934a6ae6-Cou8J2R8.png";function iz({currentView:e,setCurrentView:t}){const[r,n]=_.useState(!0),i=[{name:"Dashboard",icon:eM,type:"item"},{type:"header",name:"MODULES"},{name:"Labeling",icon:Gd,type:"sub",isOpen:r,toggle:()=>n(!r),children:[{name:"Labels",icon:Gd},{name:"Label Categories",icon:JR},{name:"Label Types",icon:up},{name:"Label Templates",icon:ZR},{name:"Multiple Options",icon:Vd}]},{type:"header",name:"MANAGEMENT"},{name:"Location Manager",icon:Fs,type:"item"},{type:"header",name:"SYSTEM MANAGEMENT"},{name:"Account Management",icon:Nw,type:"item"},{name:"Menu Management",icon:Hd,type:"item"},{name:"System Menu",icon:Vd,type:"item"},{name:"Reports",icon:us,type:"item"},{name:"Support",icon:Wd,type:"item"},{name:"Log Out",icon:J8,type:"item"}];return h.jsxs("div",{className:"w-64 bg-[#1e3a8a] text-white flex flex-col h-screen border-r border-blue-800 shadow-xl z-20 shrink-0",children:[h.jsx("div",{className:"flex items-center justify-center border-b border-blue-800/50 bg-white px-4 shrink-0",style:{height:90},children:h.jsx("img",{src:nz,alt:"MedVantage",className:"h-16 w-auto object-contain"})}),h.jsx(wc,{className:"flex-1 py-4",children:h.jsx("div",{className:"px-3 space-y-1",children:i.map((o,s)=>o.type==="header"?h.jsx("div",{className:"px-4 py-2 mt-4 text-xs font-semibold text-blue-300 uppercase tracking-wider",children:o.name},s):o.type==="sub"?h.jsxs("div",{className:"space-y-1",children:[h.jsxs("button",{onClick:o.toggle,className:Te("w-full flex items-center justify-between px-4 py-2.5 text-sm font-medium rounded-lg transition-colors","hover:bg-blue-800/50 text-blue-100"),children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(o.icon,{className:"w-4 h-4"}),o.name]}),o.isOpen?h.jsx(xc,{className:"w-4 h-4"}):h.jsx(bc,{className:"w-4 h-4"})]}),o.isOpen&&h.jsx("div",{className:"pl-4 space-y-1",children:o.children?.map((u,f)=>h.jsxs("button",{onClick:()=>t(u.name),className:Te("w-full flex items-center gap-3 px-4 py-2 text-sm font-medium rounded-lg transition-colors border-l-2",e===u.name?"bg-blue-800 border-blue-400 text-white":"border-transparent hover:bg-blue-800/30 text-blue-200 hover:text-white"),children:[h.jsx("div",{className:"w-1 h-1 rounded-full bg-current"}),u.name]},f))})]},s):h.jsxs("button",{onClick:()=>t(o.name),className:Te("w-full flex items-center gap-3 px-4 py-2.5 text-sm font-medium rounded-lg transition-colors",e===o.name?"bg-blue-700 text-white shadow-md shadow-blue-900/20":o.name==="Log Out"?"text-red-300 hover:bg-red-900/20 hover:text-red-200":"text-blue-100 hover:bg-blue-800 hover:text-white"),children:[h.jsx(o.icon,{className:"w-4 h-4"}),o.name]},s))})})]})}function be({className:e,type:t,...r}){return h.jsx("input",{type:t,"data-slot":"input",className:Te("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}var oz=Symbol.for("react.lazy"),Qd=Ew[" use ".trim().toString()];function az(e){return typeof e=="object"&&e!==null&&"then"in e}function CM(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===oz&&"_payload"in e&&az(e._payload)}function Iw(e){const t=sz(e),r=_.forwardRef((n,i)=>{let{children:o,...s}=n;CM(o)&&typeof Qd=="function"&&(o=Qd(o._payload));const u=_.Children.toArray(o),f=u.find(cz);if(f){const l=f.props.children,d=u.map(p=>p===f?_.Children.count(l)>1?_.Children.only(null):_.isValidElement(l)?l.props.children:null:p);return h.jsx(t,{...s,ref:i,children:_.isValidElement(l)?_.cloneElement(l,void 0,d):null})}return h.jsx(t,{...s,ref:i,children:o})});return r.displayName=`${e}.Slot`,r}var NM=Iw("Slot");function sz(e){const t=_.forwardRef((r,n)=>{let{children:i,...o}=r;if(CM(i)&&typeof Qd=="function"&&(i=Qd(i._payload)),_.isValidElement(i)){const s=fz(i),u=uz(o,i.props);return i.type!==_.Fragment&&(u.ref=n?ia(n,s):s),_.cloneElement(i,u)}return _.Children.count(i)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var lz=Symbol("radix.slottable");function cz(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===lz}function uz(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...u)=>{const f=o(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function fz(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)}const vE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,gE=We,TM=(e,t)=>r=>{var n;if(t?.variants==null)return gE(e,r?.class,r?.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(l=>{const d=r?.[l],p=o?.[l];if(d===null)return null;const m=vE(d)||vE(p);return i[l][m]}),u=r&&Object.entries(r).reduce((l,d)=>{let[p,m]=d;return m===void 0||(l[p]=m),l},{}),f=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((l,d)=>{let{class:p,className:m,...g}=d;return Object.entries(g).every(b=>{let[y,w]=b;return Array.isArray(w)?w.includes({...o,...u}[y]):{...o,...u}[y]===w})?[...l,p,m]:l},[]);return gE(e,s,f,r?.class,r?.className)},kM=TM("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background text-foreground hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9 rounded-md"}},defaultVariants:{variant:"default",size:"default"}}),we=_.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...i},o)=>{const s=n?NM:"button";return h.jsx(s,{ref:o,"data-slot":"button",className:Te(kM({variant:t,size:r,className:e})),...i})});we.displayName="Button";function dz(e,t=[]){let r=[];function n(o,s){const u=_.createContext(s);u.displayName=o+"Context";const f=r.length;r=[...r,s];const l=p=>{const{scope:m,children:g,...b}=p,y=m?.[e]?.[f]||u,w=_.useMemo(()=>b,Object.values(b));return h.jsx(y.Provider,{value:w,children:g})};l.displayName=o+"Provider";function d(p,m){const g=m?.[e]?.[f]||u,b=_.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[l,d]}const i=()=>{const o=r.map(s=>_.createContext(s));return function(u){const f=u?.[e]||o;return _.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return i.scopeName=e,[n,hz(i,...t)]}function hz(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=n.reduce((u,{useScope:f,scopeName:l})=>{const p=f(o)[`__scope${l}`];return{...u,...p}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var pz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Dw=pz.reduce((e,t)=>{const r=Iw(`Primitive.${t}`),n=_.forwardRef((i,o)=>{const{asChild:s,...u}=i,f=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(f,{...u,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),xg={exports:{}},bg={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var yE;function mz(){if(yE)return bg;yE=1;var e=cp();function t(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function u(p,m){var g=m(),b=n({inst:{value:g,getSnapshot:m}}),y=b[0].inst,w=b[1];return o(function(){y.value=g,y.getSnapshot=m,f(y)&&w({inst:y})},[p,g,m]),i(function(){return f(y)&&w({inst:y}),p(function(){f(y)&&w({inst:y})})},[p]),s(g),g}function f(p){var m=p.getSnapshot;p=p.value;try{var g=m();return!r(p,g)}catch{return!0}}function l(p,m){return m()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:u;return bg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,bg}var xE;function vz(){return xE||(xE=1,xg.exports=mz()),xg.exports}var gz=vz();function yz(){return gz.useSyncExternalStore(xz,()=>!0,()=>!1)}function xz(){return()=>{}}var Lw="Avatar",[bz]=dz(Lw),[wz,RM]=bz(Lw),MM=_.forwardRef((e,t)=>{const{__scopeAvatar:r,...n}=e,[i,o]=_.useState("idle");return h.jsx(wz,{scope:r,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:h.jsx(Dw.span,{...n,ref:t})})});MM.displayName=Lw;var IM="AvatarImage",DM=_.forwardRef((e,t)=>{const{__scopeAvatar:r,src:n,onLoadingStatusChange:i=()=>{},...o}=e,s=RM(IM,r),u=Sz(n,o),f=ar(l=>{i(l),s.onImageLoadingStatusChange(l)});return Rt(()=>{u!=="idle"&&f(u)},[u,f]),u==="loaded"?h.jsx(Dw.img,{...o,ref:t,src:n}):null});DM.displayName=IM;var LM="AvatarFallback",$M=_.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:n,...i}=e,o=RM(LM,r),[s,u]=_.useState(n===void 0);return _.useEffect(()=>{if(n!==void 0){const f=window.setTimeout(()=>u(!0),n);return()=>window.clearTimeout(f)}},[n]),s&&o.imageLoadingStatus!=="loaded"?h.jsx(Dw.span,{...i,ref:t}):null});$M.displayName=LM;function bE(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function Sz(e,{referrerPolicy:t,crossOrigin:r}){const n=yz(),i=_.useRef(null),o=n?(i.current||(i.current=new window.Image),i.current):null,[s,u]=_.useState(()=>bE(o,e));return Rt(()=>{u(bE(o,e))},[o,e]),Rt(()=>{const f=p=>()=>{u(p)};if(!o)return;const l=f("loaded"),d=f("error");return o.addEventListener("load",l),o.addEventListener("error",d),t&&(o.referrerPolicy=t),typeof r=="string"&&(o.crossOrigin=r),()=>{o.removeEventListener("load",l),o.removeEventListener("error",d)}},[o,r,t]),s}var _z=MM,jz=DM,Oz=$M;function Ez({className:e,...t}){return h.jsx(_z,{"data-slot":"avatar",className:Te("relative flex size-10 shrink-0 overflow-hidden rounded-full",e),...t})}function Pz({className:e,...t}){return h.jsx(jz,{"data-slot":"avatar-image",className:Te("aspect-square size-full",e),...t})}function Az({className:e,...t}){return h.jsx(Oz,{"data-slot":"avatar-fallback",className:Te("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}function Cz({title:e}){const t=new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"});return h.jsxs("header",{className:"bg-white border-b border-gray-200 px-8 flex items-center justify-between shadow-sm sticky top-0 z-10 shrink-0",style:{height:90},children:[h.jsxs("div",{children:[h.jsxs("h1",{className:"text-2xl font-bold",style:{color:"rgb(43, 50, 143)"},children:[e," Overview"]}),h.jsxs("p",{className:"text-sm text-gray-500 mt-1 flex items-center gap-2",children:[t," | Last updated: Just now"]})]}),h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("div",{className:"flex items-center w-64 h-9 rounded-md border border-gray-200 bg-gray-50 focus-within:bg-white focus-within:ring-2 focus-within:ring-ring/50 focus-within:border-ring transition-colors overflow-hidden",children:[h.jsx(Cw,{className:"h-4 w-4 text-gray-400 shrink-0 ml-3 pointer-events-none"}),h.jsx(be,{type:"search",placeholder:"Search...",className:"flex-1 min-w-0 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 py-2 px-2 h-full"})]}),h.jsx(we,{variant:"ghost",size:"icon",className:"text-gray-500 hover:text-gray-700",children:h.jsx(Vd,{className:"w-5 h-5"})}),h.jsx("div",{className:"h-8 w-px bg-gray-200 mx-2"}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("div",{className:"text-right hidden md:block",children:[h.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Admin User"}),h.jsx("div",{className:"text-xs text-gray-500",children:"Administrator"})]}),h.jsxs(Ez,{className:"h-10 w-10 border border-gray-200",children:[h.jsx(Pz,{src:"https://github.com/shadcn.png"}),h.jsx(Az,{children:"AD"})]})]})]})]})}function Nz({children:e,currentView:t,setCurrentView:r}){return h.jsxs("div",{className:"flex h-screen bg-gray-50 overflow-hidden font-sans",children:[h.jsx(iz,{currentView:t,setCurrentView:r}),h.jsxs("div",{className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:[h.jsx(Cz,{title:t}),h.jsx("div",{className:"px-8 mt-8 shrink-0",children:h.jsxs("nav",{className:"flex items-center gap-2 text-sm font-normal","aria-label":"Breadcrumb",children:[h.jsx("button",{type:"button",onClick:()=>r("Dashboard"),className:"text-gray-500 hover:text-gray-700 transition-colors",children:"Home"}),h.jsx(bc,{className:"w-4 h-4 text-gray-500 shrink-0"}),h.jsx("span",{style:{color:"rgb(43, 50, 143)"},children:t})]})}),h.jsx("main",{className:"flex-1 overflow-y-auto p-8",children:h.jsx("div",{className:"w-full h-full",children:e})})]})]})}function $r({className:e,...t}){return h.jsx("div",{"data-slot":"card",className:Te("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border",e),...t})}function On({className:e,...t}){return h.jsx("div",{"data-slot":"card-header",className:Te("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 pt-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function En({className:e,...t}){return h.jsx("h4",{"data-slot":"card-title",className:Te("leading-none",e),...t})}function Zd({className:e,...t}){return h.jsx("p",{"data-slot":"card-description",className:Te("text-muted-foreground",e),...t})}function nn({className:e,...t}){return h.jsx("div",{"data-slot":"card-content",className:Te("px-6 [&:last-child]:pb-6",e),...t})}const Tz=TM("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Cn({className:e,variant:t,asChild:r=!1,...n}){const i=r?NM:"span";return h.jsx(i,{"data-slot":"badge",className:Te(Tz({variant:t}),e),...n})}var wg,wE;function Er(){if(wE)return wg;wE=1;var e=Array.isArray;return wg=e,wg}var Sg,SE;function BM(){if(SE)return Sg;SE=1;var e=typeof Mf=="object"&&Mf&&Mf.Object===Object&&Mf;return Sg=e,Sg}var _g,_E;function ti(){if(_E)return _g;_E=1;var e=BM(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return _g=r,_g}var jg,jE;function au(){if(jE)return jg;jE=1;var e=ti(),t=e.Symbol;return jg=t,jg}var Og,OE;function kz(){if(OE)return Og;OE=1;var e=au(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;function o(s){var u=r.call(s,i),f=s[i];try{s[i]=void 0;var l=!0}catch{}var d=n.call(s);return l&&(u?s[i]=f:delete s[i]),d}return Og=o,Og}var Eg,EE;function Rz(){if(EE)return Eg;EE=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return Eg=r,Eg}var Pg,PE;function Ai(){if(PE)return Pg;PE=1;var e=au(),t=kz(),r=Rz(),n="[object Null]",i="[object Undefined]",o=e?e.toStringTag:void 0;function s(u){return u==null?u===void 0?i:n:o&&o in Object(u)?t(u):r(u)}return Pg=s,Pg}var Ag,AE;function Ci(){if(AE)return Ag;AE=1;function e(t){return t!=null&&typeof t=="object"}return Ag=e,Ag}var Cg,CE;function Us(){if(CE)return Cg;CE=1;var e=Ai(),t=Ci(),r="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&e(i)==r}return Cg=n,Cg}var Ng,NE;function $w(){if(NE)return Ng;NE=1;var e=Er(),t=Us(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(o,s){if(e(o))return!1;var u=typeof o;return u=="number"||u=="symbol"||u=="boolean"||o==null||t(o)?!0:n.test(o)||!r.test(o)||s!=null&&o in Object(s)}return Ng=i,Ng}var Tg,TE;function lo(){if(TE)return Tg;TE=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return Tg=e,Tg}var kg,kE;function Bw(){if(kE)return kg;kE=1;var e=Ai(),t=lo(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",o="[object Proxy]";function s(u){if(!t(u))return!1;var f=e(u);return f==n||f==i||f==r||f==o}return kg=s,kg}var Rg,RE;function Mz(){if(RE)return Rg;RE=1;var e=ti(),t=e["__core-js_shared__"];return Rg=t,Rg}var Mg,ME;function Iz(){if(ME)return Mg;ME=1;var e=Mz(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return Mg=r,Mg}var Ig,IE;function FM(){if(IE)return Ig;IE=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return Ig=r,Ig}var Dg,DE;function Dz(){if(DE)return Dg;DE=1;var e=Bw(),t=Iz(),r=lo(),n=FM(),i=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,s=Function.prototype,u=Object.prototype,f=s.toString,l=u.hasOwnProperty,d=RegExp("^"+f.call(l).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(m){if(!r(m)||t(m))return!1;var g=e(m)?d:o;return g.test(n(m))}return Dg=p,Dg}var Lg,LE;function Lz(){if(LE)return Lg;LE=1;function e(t,r){return t?.[r]}return Lg=e,Lg}var $g,$E;function oa(){if($E)return $g;$E=1;var e=Dz(),t=Lz();function r(n,i){var o=t(n,i);return e(o)?o:void 0}return $g=r,$g}var Bg,BE;function pp(){if(BE)return Bg;BE=1;var e=oa(),t=e(Object,"create");return Bg=t,Bg}var Fg,FE;function $z(){if(FE)return Fg;FE=1;var e=pp();function t(){this.__data__=e?e(null):{},this.size=0}return Fg=t,Fg}var zg,zE;function Bz(){if(zE)return zg;zE=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return zg=e,zg}var qg,qE;function Fz(){if(qE)return qg;qE=1;var e=pp(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(o){var s=this.__data__;if(e){var u=s[o];return u===t?void 0:u}return n.call(s,o)?s[o]:void 0}return qg=i,qg}var Ug,UE;function zz(){if(UE)return Ug;UE=1;var e=pp(),t=Object.prototype,r=t.hasOwnProperty;function n(i){var o=this.__data__;return e?o[i]!==void 0:r.call(o,i)}return Ug=n,Ug}var Wg,WE;function qz(){if(WE)return Wg;WE=1;var e=pp(),t="__lodash_hash_undefined__";function r(n,i){var o=this.__data__;return this.size+=this.has(n)?0:1,o[n]=e&&i===void 0?t:i,this}return Wg=r,Wg}var Hg,HE;function Uz(){if(HE)return Hg;HE=1;var e=$z(),t=Bz(),r=Fz(),n=zz(),i=qz();function o(s){var u=-1,f=s==null?0:s.length;for(this.clear();++u-1}return Qg=t,Qg}var Zg,ZE;function Kz(){if(ZE)return Zg;ZE=1;var e=mp();function t(r,n){var i=this.__data__,o=e(i,r);return o<0?(++this.size,i.push([r,n])):i[o][1]=n,this}return Zg=t,Zg}var Jg,JE;function vp(){if(JE)return Jg;JE=1;var e=Wz(),t=Hz(),r=Vz(),n=Gz(),i=Kz();function o(s){var u=-1,f=s==null?0:s.length;for(this.clear();++u0?1:-1},$o=function(t){return Ho(t)&&t.indexOf("%")===t.length-1},ge=function(t){return gq(t)&&!su(t)},yq=function(t){return Ue(t)},Ft=function(t){return ge(t)||Ho(t)},xq=0,Hs=function(t){var r=++xq;return"".concat(t||"").concat(r)},fr=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ge(t)&&!Ho(t))return n;var o;if($o(t)){var s=t.indexOf("%");o=r*parseFloat(t.slice(0,s))/100}else o=+t;return su(o)&&(o=n),i&&o>r&&(o=r),o},to=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},bq=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Pq(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 Wb(e){"@babel/helpers - typeof";return Wb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wb(e)}var P2={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},xi=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},A2=null,Oy=null,Vw=function e(t){if(t===A2&&Array.isArray(Oy))return Oy;var r=[];return _.Children.forEach(t,function(n){Ue(n)||(hq.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),Oy=r,A2=t,r};function Wr(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return xi(i)}):n=[xi(t)],Vw(e).forEach(function(i){var o=Ur(i,"type.displayName")||Ur(i,"type.name");n.indexOf(o)!==-1&&r.push(i)}),r}function Lr(e,t){var r=Wr(e,t);return r&&r[0]}var C2=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!ge(n)||n<=0||!ge(i)||i<=0)},Aq=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Cq=function(t){return t&&t.type&&Ho(t.type)&&Aq.indexOf(t.type)>=0},Nq=function(t){return t&&Wb(t)==="object"&&"clipDot"in t},Tq=function(t,r,n,i){var o,s=(o=jy?.[i])!==null&&o!==void 0?o:[];return r.startsWith("data-")||!ze(t)&&(i&&s.includes(r)||_q.includes(r))||n&&Hw.includes(r)},Le=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(_.isValidElement(t)&&(i=t.props),!Ws(i))return null;var o={};return Object.keys(i).forEach(function(s){var u;Tq((u=i)===null||u===void 0?void 0:u[s],s,r,n)&&(o[s]=i[s])}),o},Hb=function e(t,r){if(t===r)return!0;var n=_.Children.count(t);if(n!==_.Children.count(r))return!1;if(n===0)return!0;if(n===1)return N2(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Dq(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 Gb(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,o=e.className,s=e.style,u=e.title,f=e.desc,l=Iq(e,Mq),d=i||{width:r,height:n,x:0,y:0},p=We("recharts-surface",o);return F.createElement("svg",Vb({},Le(l,!0,"svg"),{className:p,width:r,height:n,style:s,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),F.createElement("title",null,u),F.createElement("desc",null,f),t)}var Lq=["children","className"];function Kb(){return Kb=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Bq(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}var rt=F.forwardRef(function(e,t){var r=e.children,n=e.className,i=$q(e,Lq),o=We("recharts-layer",n);return F.createElement("g",Kb({className:o},Le(i,!0),{ref:t}),r)}),Tn=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;oo?0:o+r),n=n>o?o:n,n<0&&(n+=o),o=r>n?0:n-r>>>0,r>>>=0;for(var s=Array(o);++i=o?r:e(r,n,i)}return Py=t,Py}var Ay,M2;function VM(){if(M2)return Ay;M2=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,o="\\ufe0e\\ufe0f",s="\\u200d",u=RegExp("["+s+e+i+o+"]");function f(l){return u.test(l)}return Ay=f,Ay}var Cy,I2;function qq(){if(I2)return Cy;I2=1;function e(t){return t.split("")}return Cy=e,Cy}var Ny,D2;function Uq(){if(D2)return Ny;D2=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,o="\\ufe0e\\ufe0f",s="["+e+"]",u="["+i+"]",f="\\ud83c[\\udffb-\\udfff]",l="(?:"+u+"|"+f+")",d="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",m="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",b=l+"?",y="["+o+"]?",w="(?:"+g+"(?:"+[d,p,m].join("|")+")"+y+b+")*",j=y+b+w,O="(?:"+[d+u+"?",u,p,m,s].join("|")+")",E=RegExp(f+"(?="+f+")|"+O+j,"g");function N(A){return A.match(E)||[]}return Ny=N,Ny}var Ty,L2;function Wq(){if(L2)return Ty;L2=1;var e=qq(),t=VM(),r=Uq();function n(i){return t(i)?r(i):e(i)}return Ty=n,Ty}var ky,$2;function Hq(){if($2)return ky;$2=1;var e=zq(),t=VM(),r=Wq(),n=qM();function i(o){return function(s){s=n(s);var u=t(s)?r(s):void 0,f=u?u[0]:s.charAt(0),l=u?e(u,1).join(""):s.slice(1);return f[o]()+l}}return ky=i,ky}var Ry,B2;function Vq(){if(B2)return Ry;B2=1;var e=Hq(),t=e("toUpperCase");return Ry=t,Ry}var Gq=Vq();const xp=ot(Gq);function pt(e){return function(){return e}}const GM=Math.cos,th=Math.sin,Dn=Math.sqrt,rh=Math.PI,bp=2*rh,Xb=Math.PI,Yb=2*Xb,Io=1e-6,Kq=Yb-Io;function KM(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return KM;const r=10**t;return function(n){this._+=n[0];for(let i=1,o=n.length;iIo)if(!(Math.abs(p*f-l*d)>Io)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let g=n-s,b=i-u,y=f*f+l*l,w=g*g+b*b,j=Math.sqrt(y),O=Math.sqrt(m),E=o*Math.tan((Xb-Math.acos((y+m-w)/(2*j*O)))/2),N=E/O,A=E/j;Math.abs(N-1)>Io&&this._append`L${t+N*d},${r+N*p}`,this._append`A${o},${o},0,0,${+(p*g>d*b)},${this._x1=t+A*f},${this._y1=r+A*l}`}}arc(t,r,n,i,o,s){if(t=+t,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(i),f=n*Math.sin(i),l=t+u,d=r+f,p=1^s,m=s?i-o:o-i;this._x1===null?this._append`M${l},${d}`:(Math.abs(this._x1-l)>Io||Math.abs(this._y1-d)>Io)&&this._append`L${l},${d}`,n&&(m<0&&(m=m%Yb+Yb),m>Kq?this._append`A${n},${n},0,1,${p},${t-u},${r-f}A${n},${n},0,1,${p},${this._x1=l},${this._y1=d}`:m>Io&&this._append`A${n},${n},0,${+(m>=Xb)},${p},${this._x1=t+n*Math.cos(o)},${this._y1=r+n*Math.sin(o)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function Gw(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new Yq(t)}function Kw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function XM(e){this._context=e}XM.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function wp(e){return new XM(e)}function YM(e){return e[0]}function QM(e){return e[1]}function ZM(e,t){var r=pt(!0),n=null,i=wp,o=null,s=Gw(u);e=typeof e=="function"?e:e===void 0?YM:pt(e),t=typeof t=="function"?t:t===void 0?QM:pt(t);function u(f){var l,d=(f=Kw(f)).length,p,m=!1,g;for(n==null&&(o=i(g=s())),l=0;l<=d;++l)!(l=g;--b)u.point(E[b],N[b]);u.lineEnd(),u.areaEnd()}j&&(E[m]=+e(w,m,p),N[m]=+t(w,m,p),u.point(n?+n(w,m,p):E[m],r?+r(w,m,p):N[m]))}if(O)return u=null,O+""||null}function d(){return ZM().defined(i).curve(s).context(o)}return l.x=function(p){return arguments.length?(e=typeof p=="function"?p:pt(+p),n=null,l):e},l.x0=function(p){return arguments.length?(e=typeof p=="function"?p:pt(+p),l):e},l.x1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:pt(+p),l):n},l.y=function(p){return arguments.length?(t=typeof p=="function"?p:pt(+p),r=null,l):t},l.y0=function(p){return arguments.length?(t=typeof p=="function"?p:pt(+p),l):t},l.y1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:pt(+p),l):r},l.lineX0=l.lineY0=function(){return d().x(e).y(t)},l.lineY1=function(){return d().x(e).y(r)},l.lineX1=function(){return d().x(n).y(t)},l.defined=function(p){return arguments.length?(i=typeof p=="function"?p:pt(!!p),l):i},l.curve=function(p){return arguments.length?(s=p,o!=null&&(u=s(o)),l):s},l.context=function(p){return arguments.length?(p==null?o=u=null:u=s(o=p),l):o},l}class JM{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Qq(e){return new JM(e,!0)}function Zq(e){return new JM(e,!1)}const Xw={draw(e,t){const r=Dn(t/rh);e.moveTo(r,0),e.arc(0,0,r,0,bp)}},Jq={draw(e,t){const r=Dn(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},eI=Dn(1/3),e9=eI*2,t9={draw(e,t){const r=Dn(t/e9),n=r*eI;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},r9={draw(e,t){const r=Dn(t),n=-r/2;e.rect(n,n,r,r)}},n9=.8908130915292852,tI=th(rh/10)/th(7*rh/10),i9=th(bp/10)*tI,o9=-GM(bp/10)*tI,a9={draw(e,t){const r=Dn(t*n9),n=i9*r,i=o9*r;e.moveTo(0,-r),e.lineTo(n,i);for(let o=1;o<5;++o){const s=bp*o/5,u=GM(s),f=th(s);e.lineTo(f*r,-u*r),e.lineTo(u*n-f*i,f*n+u*i)}e.closePath()}},My=Dn(3),s9={draw(e,t){const r=-Dn(t/(My*3));e.moveTo(0,r*2),e.lineTo(-My*r,-r),e.lineTo(My*r,-r),e.closePath()}},Jr=-.5,en=Dn(3)/2,Qb=1/Dn(12),l9=(Qb/2+1)*3,c9={draw(e,t){const r=Dn(t/l9),n=r/2,i=r*Qb,o=n,s=r*Qb+r,u=-o,f=s;e.moveTo(n,i),e.lineTo(o,s),e.lineTo(u,f),e.lineTo(Jr*n-en*i,en*n+Jr*i),e.lineTo(Jr*o-en*s,en*o+Jr*s),e.lineTo(Jr*u-en*f,en*u+Jr*f),e.lineTo(Jr*n+en*i,Jr*i-en*n),e.lineTo(Jr*o+en*s,Jr*s-en*o),e.lineTo(Jr*u+en*f,Jr*f-en*u),e.closePath()}};function u9(e,t){let r=null,n=Gw(i);e=typeof e=="function"?e:pt(e||Xw),t=typeof t=="function"?t:pt(t===void 0?64:+t);function i(){let o;if(r||(r=o=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),o)return r=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:pt(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:pt(+o),i):t},i.context=function(o){return arguments.length?(r=o??null,i):r},i}function nh(){}function ih(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function rI(e){this._context=e}rI.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ih(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ih(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function f9(e){return new rI(e)}function nI(e){this._context=e}nI.prototype={areaStart:nh,areaEnd:nh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ih(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function d9(e){return new nI(e)}function iI(e){this._context=e}iI.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:ih(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function h9(e){return new iI(e)}function oI(e){this._context=e}oI.prototype={areaStart:nh,areaEnd:nh,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function p9(e){return new oI(e)}function F2(e){return e<0?-1:1}function z2(e,t,r){var n=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(n||i<0&&-0),s=(r-e._y1)/(i||n<0&&-0),u=(o*i+s*n)/(n+i);return(F2(o)+F2(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(u))||0}function q2(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Iy(e,t,r){var n=e._x0,i=e._y0,o=e._x1,s=e._y1,u=(o-n)/3;e._context.bezierCurveTo(n+u,i+u*t,o-u,s-u*r,o,s)}function oh(e){this._context=e}oh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Iy(this,this._t0,q2(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Iy(this,q2(this,r=z2(this,e,t)),r);break;default:Iy(this,this._t0,r=z2(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function aI(e){this._context=new sI(e)}(aI.prototype=Object.create(oh.prototype)).point=function(e,t){oh.prototype.point.call(this,t,e)};function sI(e){this._context=e}sI.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,o){this._context.bezierCurveTo(t,e,n,r,o,i)}};function m9(e){return new oh(e)}function v9(e){return new aI(e)}function lI(e){this._context=e}lI.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=U2(e),i=U2(t),o=0,s=1;s=0;--t)i[t]=(s[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function y9(e){return new Sp(e,.5)}function x9(e){return new Sp(e,0)}function b9(e){return new Sp(e,1)}function ds(e,t){if((s=e.length)>1)for(var r=1,n,i,o=e[t[0]],s,u=o.length;r=0;)r[t]=t;return r}function w9(e,t){return e[t]}function S9(e){const t=[];return t.key=e,t}function _9(){var e=pt([]),t=Zb,r=ds,n=w9;function i(o){var s=Array.from(e.apply(this,arguments),S9),u,f=s.length,l=-1,d;for(const p of o)for(u=0,++l;u0){for(var r,n,i=0,o=e[0].length,s;i0){for(var r=0,n=e[t[0]],i,o=n.length;r0)||!((o=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,o,s;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function k9(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}var cI={symbolCircle:Xw,symbolCross:Jq,symbolDiamond:t9,symbolSquare:r9,symbolStar:a9,symbolTriangle:s9,symbolWye:c9},R9=Math.PI/180,M9=function(t){var r="symbol".concat(xp(t));return cI[r]||Xw},I9=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*R9;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},D9=function(t,r){cI["symbol".concat(xp(t))]=r},Yw=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,o=i===void 0?64:i,s=t.sizeType,u=s===void 0?"area":s,f=T9(t,P9),l=H2(H2({},f),{},{type:n,size:o,sizeType:u}),d=function(){var w=M9(n),j=u9().type(w).size(I9(o,u,n));return j()},p=l.className,m=l.cx,g=l.cy,b=Le(l,!0);return m===+m&&g===+g&&o===+o?F.createElement("path",Jb({},b,{className:We("recharts-symbols",p),transform:"translate(".concat(m,", ").concat(g,")"),d:d()})):null};Yw.registerSymbol=D9;function hs(e){"@babel/helpers - typeof";return hs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hs(e)}function e1(){return e1=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var O=g.inactive?l:g.color;return F.createElement("li",e1({className:w,style:p,key:"legend-item-".concat(b)},Vo(n.props,g,b)),F.createElement(Gb,{width:s,height:s,viewBox:d,style:m},n.renderIcon(g)),F.createElement("span",{className:"recharts-legend-item-text",style:{color:O}},y?y(j,g,b):j))})}},{key:"render",value:function(){var n=this.props,i=n.payload,o=n.layout,s=n.align;if(!i||!i.length)return null;var u={padding:0,margin:0,textAlign:o==="horizontal"?s:"left"};return F.createElement("ul",{className:"recharts-default-legend",style:u},this.renderItems())}}])})(_.PureComponent);_c(Qw,"displayName","Legend");_c(Qw,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Dy,G2;function V9(){if(G2)return Dy;G2=1;var e=vp();function t(){this.__data__=new e,this.size=0}return Dy=t,Dy}var Ly,K2;function G9(){if(K2)return Ly;K2=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return Ly=e,Ly}var $y,X2;function K9(){if(X2)return $y;X2=1;function e(t){return this.__data__.get(t)}return $y=e,$y}var By,Y2;function X9(){if(Y2)return By;Y2=1;function e(t){return this.__data__.has(t)}return By=e,By}var Fy,Q2;function Y9(){if(Q2)return Fy;Q2=1;var e=vp(),t=zw(),r=qw(),n=200;function i(o,s){var u=this.__data__;if(u instanceof e){var f=u.__data__;if(!t||f.lengthg))return!1;var y=p.get(s),w=p.get(u);if(y&&w)return y==u&&w==s;var j=-1,O=!0,E=f&i?new e:void 0;for(p.set(s,u),p.set(u,s);++j-1&&n%1==0&&n-1&&r%1==0&&r<=e}return l0=t,l0}var c0,wP;function cU(){if(wP)return c0;wP=1;var e=Ai(),t=tS(),r=Ci(),n="[object Arguments]",i="[object Array]",o="[object Boolean]",s="[object Date]",u="[object Error]",f="[object Function]",l="[object Map]",d="[object Number]",p="[object Object]",m="[object RegExp]",g="[object Set]",b="[object String]",y="[object WeakMap]",w="[object ArrayBuffer]",j="[object DataView]",O="[object Float32Array]",E="[object Float64Array]",N="[object Int8Array]",A="[object Int16Array]",C="[object Int32Array]",T="[object Uint8Array]",R="[object Uint8ClampedArray]",I="[object Uint16Array]",z="[object Uint32Array]",$={};$[O]=$[E]=$[N]=$[A]=$[C]=$[T]=$[R]=$[I]=$[z]=!0,$[n]=$[i]=$[w]=$[o]=$[j]=$[s]=$[u]=$[f]=$[l]=$[d]=$[p]=$[m]=$[g]=$[b]=$[y]=!1;function L(U){return r(U)&&t(U.length)&&!!$[e(U)]}return c0=L,c0}var u0,SP;function xI(){if(SP)return u0;SP=1;function e(t){return function(r){return t(r)}}return u0=e,u0}var ac={exports:{}};ac.exports;var _P;function uU(){return _P||(_P=1,(function(e,t){var r=BM(),n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===n,s=o&&r.process,u=(function(){try{var f=i&&i.require&&i.require("util").types;return f||s&&s.binding&&s.binding("util")}catch{}})();e.exports=u})(ac,ac.exports)),ac.exports}var f0,jP;function bI(){if(jP)return f0;jP=1;var e=cU(),t=xI(),r=uU(),n=r&&r.isTypedArray,i=n?t(n):e;return f0=i,f0}var d0,OP;function fU(){if(OP)return d0;OP=1;var e=aU(),t=Jw(),r=Er(),n=yI(),i=eS(),o=bI(),s=Object.prototype,u=s.hasOwnProperty;function f(l,d){var p=r(l),m=!p&&t(l),g=!p&&!m&&n(l),b=!p&&!m&&!g&&o(l),y=p||m||g||b,w=y?e(l.length,String):[],j=w.length;for(var O in l)(d||u.call(l,O))&&!(y&&(O=="length"||g&&(O=="offset"||O=="parent")||b&&(O=="buffer"||O=="byteLength"||O=="byteOffset")||i(O,j)))&&w.push(O);return w}return d0=f,d0}var h0,EP;function dU(){if(EP)return h0;EP=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||e;return r===i}return h0=t,h0}var p0,PP;function wI(){if(PP)return p0;PP=1;function e(t,r){return function(n){return t(r(n))}}return p0=e,p0}var m0,AP;function hU(){if(AP)return m0;AP=1;var e=wI(),t=e(Object.keys,Object);return m0=t,m0}var v0,CP;function pU(){if(CP)return v0;CP=1;var e=dU(),t=hU(),r=Object.prototype,n=r.hasOwnProperty;function i(o){if(!e(o))return t(o);var s=[];for(var u in Object(o))n.call(o,u)&&u!="constructor"&&s.push(u);return s}return v0=i,v0}var g0,NP;function lu(){if(NP)return g0;NP=1;var e=Bw(),t=tS();function r(n){return n!=null&&t(n.length)&&!e(n)}return g0=r,g0}var y0,TP;function _p(){if(TP)return y0;TP=1;var e=fU(),t=pU(),r=lu();function n(i){return r(i)?e(i):t(i)}return y0=n,y0}var x0,kP;function mU(){if(kP)return x0;kP=1;var e=rU(),t=oU(),r=_p();function n(i){return e(i,r,t)}return x0=n,x0}var b0,RP;function vU(){if(RP)return b0;RP=1;var e=mU(),t=1,r=Object.prototype,n=r.hasOwnProperty;function i(o,s,u,f,l,d){var p=u&t,m=e(o),g=m.length,b=e(s),y=b.length;if(g!=y&&!p)return!1;for(var w=g;w--;){var j=m[w];if(!(p?j in s:n.call(s,j)))return!1}var O=d.get(o),E=d.get(s);if(O&&E)return O==s&&E==o;var N=!0;d.set(o,s),d.set(s,o);for(var A=p;++w-1}return V0=t,V0}var G0,aA;function DU(){if(aA)return G0;aA=1;function e(t,r,n){for(var i=-1,o=t==null?0:t.length;++i=s){var j=l?null:i(f);if(j)return o(j);b=!1,m=n,w=new e}else w=l?[]:y;e:for(;++p=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function QU(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 ZU(e){return e.value}function JU(e,t){if(F.isValidElement(e))return F.cloneElement(e,t);if(typeof e=="function")return F.createElement(e,t);t.ref;var r=YU(t,qU);return F.createElement(Qw,r)}var pA=1,rs=(function(e){function t(){var r;UU(this,t);for(var n=arguments.length,i=new Array(n),o=0;opA||Math.abs(i.height-this.lastBoundingBox.height)>pA)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?hi({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,o=i.layout,s=i.align,u=i.verticalAlign,f=i.margin,l=i.chartWidth,d=i.chartHeight,p,m;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(s==="center"&&o==="vertical"){var g=this.getBBoxSnapshot();p={left:((l||0)-g.width)/2}}else p=s==="right"?{right:f&&f.right||0}:{left:f&&f.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(u==="middle"){var b=this.getBBoxSnapshot();m={top:((d||0)-b.height)/2}}else m=u==="bottom"?{bottom:f&&f.bottom||0}:{top:f&&f.top||0};return hi(hi({},p),m)}},{key:"render",value:function(){var n=this,i=this.props,o=i.content,s=i.width,u=i.height,f=i.wrapperStyle,l=i.payloadUniqBy,d=i.payload,p=hi(hi({position:"absolute",width:s||"auto",height:u||"auto"},this.getDefaultPosition(f)),f);return F.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(g){n.wrapperNode=g}},JU(o,hi(hi({},this.props),{},{payload:EI(d,l,ZU)})))}}],[{key:"getWithHeight",value:function(n,i){var o=hi(hi({},this.defaultProps),n.props),s=o.layout;return s==="vertical"&&ge(n.props.height)?{height:n.props.height}:s==="horizontal"?{width:n.props.width||i}:null}}])})(_.PureComponent);jp(rs,"displayName","Legend");jp(rs,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Z0,mA;function e7(){if(mA)return Z0;mA=1;var e=au(),t=Jw(),r=Er(),n=e?e.isConcatSpreadable:void 0;function i(o){return r(o)||t(o)||!!(n&&o&&o[n])}return Z0=i,Z0}var J0,vA;function CI(){if(vA)return J0;vA=1;var e=gI(),t=e7();function r(n,i,o,s,u){var f=-1,l=n.length;for(o||(o=t),u||(u=[]);++f0&&o(d)?i>1?r(d,i-1,o,s,u):e(u,d):s||(u[u.length]=d)}return u}return J0=r,J0}var ex,gA;function t7(){if(gA)return ex;gA=1;function e(t){return function(r,n,i){for(var o=-1,s=Object(r),u=i(r),f=u.length;f--;){var l=u[t?f:++o];if(n(s[l],l,s)===!1)break}return r}}return ex=e,ex}var tx,yA;function r7(){if(yA)return tx;yA=1;var e=t7(),t=e();return tx=t,tx}var rx,xA;function NI(){if(xA)return rx;xA=1;var e=r7(),t=_p();function r(n,i){return n&&e(n,i,t)}return rx=r,rx}var nx,bA;function n7(){if(bA)return nx;bA=1;var e=lu();function t(r,n){return function(i,o){if(i==null)return i;if(!e(i))return r(i,o);for(var s=i.length,u=n?s:-1,f=Object(i);(n?u--:++un||u&&f&&d&&!l&&!p||o&&f&&d||!i&&d||!s)return 1;if(!o&&!u&&!p&&r=l)return d;var p=i[o];return d*(p=="desc"?-1:1)}}return r.index-n.index}return lx=t,lx}var cx,EA;function s7(){if(EA)return cx;EA=1;var e=Uw(),t=Ww(),r=ri(),n=TI(),i=i7(),o=xI(),s=a7(),u=Vs(),f=Er();function l(d,p,m){p.length?p=e(p,function(y){return f(y)?function(w){return t(w,y.length===1?y[0]:y)}:y}):p=[u];var g=-1;p=e(p,o(r));var b=n(d,function(y,w,j){var O=e(p,function(E){return E(y)});return{criteria:O,index:++g,value:y}});return i(b,function(y,w){return s(y,w,m)})}return cx=l,cx}var ux,PA;function l7(){if(PA)return ux;PA=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return ux=e,ux}var fx,AA;function c7(){if(AA)return fx;AA=1;var e=l7(),t=Math.max;function r(n,i,o){return i=t(i===void 0?n.length-1:i,0),function(){for(var s=arguments,u=-1,f=t(s.length-i,0),l=Array(f);++u0){if(++o>=e)return arguments[0]}else o=0;return i.apply(void 0,arguments)}}return mx=n,mx}var vx,RA;function h7(){if(RA)return vx;RA=1;var e=f7(),t=d7(),r=t(e);return vx=r,vx}var gx,MA;function p7(){if(MA)return gx;MA=1;var e=Vs(),t=c7(),r=h7();function n(i,o){return r(t(i,o,e),i+"")}return gx=n,gx}var yx,IA;function Op(){if(IA)return yx;IA=1;var e=Fw(),t=lu(),r=eS(),n=lo();function i(o,s,u){if(!n(u))return!1;var f=typeof s;return(f=="number"?t(u)&&r(s,u.length):f=="string"&&s in u)?e(u[s],o):!1}return yx=i,yx}var xx,DA;function m7(){if(DA)return xx;DA=1;var e=CI(),t=s7(),r=p7(),n=Op(),i=r(function(o,s){if(o==null)return[];var u=s.length;return u>1&&n(o,s[0],s[1])?s=[]:u>2&&n(s[0],s[1],s[2])&&(s=[s[0]]),t(o,e(s,1),[])});return xx=i,xx}var v7=m7();const iS=ot(v7);function jc(e){"@babel/helpers - typeof";return jc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jc(e)}function n1(){return n1=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(Wl,"-left"),ge(r)&&t&&ge(t.x)&&r=t.y),"".concat(Wl,"-top"),ge(n)&&t&&ge(t.y)&&ny?Math.max(d,f[n]):Math.max(p,f[n])}function T7(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function k7(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,o=e.reverseDirection,s=e.tooltipBox,u=e.useTranslate3d,f=e.viewBox,l,d,p;return s.height>0&&s.width>0&&r?(d=BA({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:o,tooltipDimension:s.width,viewBox:f,viewBoxDimension:f.width}),p=BA({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:o,tooltipDimension:s.height,viewBox:f,viewBoxDimension:f.height}),l=T7({translateX:d,translateY:p,useTranslate3d:u})):l=C7,{cssProperties:l,cssClasses:N7({translateX:d,translateY:p,coordinate:r})}}function ms(e){"@babel/helpers - typeof";return ms=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ms(e)}function FA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function zA(e){for(var t=1;tqA||Math.abs(n.height-this.state.lastBoundingBox.height)>qA)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,o=i.active,s=i.allowEscapeViewBox,u=i.animationDuration,f=i.animationEasing,l=i.children,d=i.coordinate,p=i.hasPayload,m=i.isAnimationActive,g=i.offset,b=i.position,y=i.reverseDirection,w=i.useTranslate3d,j=i.viewBox,O=i.wrapperStyle,E=k7({allowEscapeViewBox:s,coordinate:d,offsetTopLeft:g,position:b,reverseDirection:y,tooltipBox:this.state.lastBoundingBox,useTranslate3d:w,viewBox:j}),N=E.cssClasses,A=E.cssProperties,C=zA(zA({transition:m&&o?"transform ".concat(u,"ms ").concat(f):void 0},A),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&p?"visible":"hidden",position:"absolute",top:0,left:0},O);return F.createElement("div",{tabIndex:-1,className:N,style:C,ref:function(R){n.wrapperNode=R}},l)}}])})(_.PureComponent),q7=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},aa={isSsr:q7()};function vs(e){"@babel/helpers - typeof";return vs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vs(e)}function UA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function WA(e){for(var t=1;t0;return F.createElement(z7,{allowEscapeViewBox:s,animationDuration:u,animationEasing:f,isAnimationActive:m,active:o,coordinate:d,hasPayload:C,offset:g,position:w,reverseDirection:j,useTranslate3d:O,viewBox:E,wrapperStyle:N},Z7(l,WA(WA({},this.props),{},{payload:A})))}}])})(_.PureComponent);oS(Br,"displayName","Tooltip");oS(Br,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!aa.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var wx,HA;function J7(){if(HA)return wx;HA=1;var e=ti(),t=function(){return e.Date.now()};return wx=t,wx}var Sx,VA;function eW(){if(VA)return Sx;VA=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return Sx=t,Sx}var _x,GA;function tW(){if(GA)return _x;GA=1;var e=eW(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return _x=r,_x}var jx,KA;function LI(){if(KA)return jx;KA=1;var e=tW(),t=lo(),r=Us(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,u=parseInt;function f(l){if(typeof l=="number")return l;if(r(l))return n;if(t(l)){var d=typeof l.valueOf=="function"?l.valueOf():l;l=t(d)?d+"":d}if(typeof l!="string")return l===0?l:+l;l=e(l);var p=o.test(l);return p||s.test(l)?u(l.slice(2),p?2:8):i.test(l)?n:+l}return jx=f,jx}var Ox,XA;function rW(){if(XA)return Ox;XA=1;var e=lo(),t=J7(),r=LI(),n="Expected a function",i=Math.max,o=Math.min;function s(u,f,l){var d,p,m,g,b,y,w=0,j=!1,O=!1,E=!0;if(typeof u!="function")throw new TypeError(n);f=r(f)||0,e(l)&&(j=!!l.leading,O="maxWait"in l,m=O?i(r(l.maxWait)||0,f):m,E="trailing"in l?!!l.trailing:E);function N(U){var W=d,V=p;return d=p=void 0,w=U,g=u.apply(V,W),g}function A(U){return w=U,b=setTimeout(R,f),j?N(U):g}function C(U){var W=U-y,V=U-w,G=f-W;return O?o(G,m-V):G}function T(U){var W=U-y,V=U-w;return y===void 0||W>=f||W<0||O&&V>=m}function R(){var U=t();if(T(U))return I(U);b=setTimeout(R,C(U))}function I(U){return b=void 0,E&&d?N(U):(d=p=void 0,g)}function z(){b!==void 0&&clearTimeout(b),w=0,d=y=p=b=void 0}function $(){return b===void 0?g:I(t())}function L(){var U=t(),W=T(U);if(d=arguments,p=this,y=U,W){if(b===void 0)return A(y);if(O)return clearTimeout(b),b=setTimeout(R,f),N(y)}return b===void 0&&(b=setTimeout(R,f)),g}return L.cancel=z,L.flush=$,L}return Ox=s,Ox}var Ex,YA;function nW(){if(YA)return Ex;YA=1;var e=rW(),t=lo(),r="Expected a function";function n(i,o,s){var u=!0,f=!0;if(typeof i!="function")throw new TypeError(r);return t(s)&&(u="leading"in s?!!s.leading:u,f="trailing"in s?!!s.trailing:f),e(i,o,{leading:u,maxWait:o,trailing:f})}return Ex=n,Ex}var iW=nW();const $I=ot(iW);function Ec(e){"@babel/helpers - typeof";return Ec=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ec(e)}function QA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function zf(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(U=$I(U,y,{trailing:!0,leading:!1}));var W=new ResizeObserver(U),V=A.current.getBoundingClientRect(),G=V.width,Y=V.height;return $(G,Y),W.observe(A.current),function(){W.disconnect()}},[$,y]);var L=_.useMemo(function(){var U=I.containerWidth,W=I.containerHeight;if(U<0||W<0)return null;Tn($o(s)||$o(f),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,s,f),Tn(!r||r>0,"The aspect(%s) must be greater than zero.",r);var V=$o(s)?U:s,G=$o(f)?W:f;r&&r>0&&(V?G=V/r:G&&(V=G*r),m&&G>m&&(G=m)),Tn(V>0||G>0,`The width(%s) and height(%s) of chart should be greater than 0, + please check the style of container, or the props width(%s) and height(%s), + or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the + height and width.`,V,G,s,f,d,p,r);var Y=!Array.isArray(g)&&xi(g.type).endsWith("Chart");return F.Children.map(g,function(D){return F.isValidElement(D)?_.cloneElement(D,zf({width:V,height:G},Y?{style:zf({height:"100%",width:"100%",maxHeight:G,maxWidth:V},D.props.style)}:{})):D})},[r,g,f,m,p,d,I,s]);return F.createElement("div",{id:w?"".concat(w):void 0,className:We("recharts-responsive-container",j),style:zf(zf({},N),{},{width:s,height:f,minWidth:d,minHeight:p,maxHeight:m}),ref:A},L)}),Ep=function(t){return null};Ep.displayName="Cell";function Pc(e){"@babel/helpers - typeof";return Pc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pc(e)}function JA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function s1(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||aa.isSsr)return{width:0,height:0};var n=yW(r),i=JSON.stringify({text:t,copyStyle:n});if(La.widthCache[i])return La.widthCache[i];try{var o=document.getElementById(eC);o||(o=document.createElement("span"),o.setAttribute("id",eC),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var s=s1(s1({},gW),n);Object.assign(o.style,s),o.textContent="".concat(t);var u=o.getBoundingClientRect(),f={width:u.width,height:u.height};return La.widthCache[i]=f,++La.cacheCount>vW&&(La.cacheCount=0,La.widthCache={}),f}catch{return{width:0,height:0}}},xW=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Ac(e){"@babel/helpers - typeof";return Ac=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ac(e)}function fh(e,t){return _W(e)||SW(e,t)||wW(e,t)||bW()}function bW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wW(e,t){if(e){if(typeof e=="string")return tC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tC(e,t)}}function tC(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function LW(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 sC(e,t){return zW(e)||FW(e,t)||BW(e,t)||$W()}function $W(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BW(e,t){if(e){if(typeof e=="string")return lC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lC(e,t)}}function lC(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return V.reduce(function(G,Y){var D=Y.word,Q=Y.width,J=G[G.length-1];if(J&&(i==null||o||J.width+Q+nY.width?G:Y})};if(!d)return g;for(var y="…",w=function(V){var G=p.slice(0,V),Y=qI({breakAll:l,style:f,children:G+y}).wordsWithComputedWidth,D=m(Y),Q=D.length>s||b(D).width>Number(i);return[Q,D]},j=0,O=p.length-1,E=0,N;j<=O&&E<=p.length-1;){var A=Math.floor((j+O)/2),C=A-1,T=w(C),R=sC(T,2),I=R[0],z=R[1],$=w(A),L=sC($,1),U=L[0];if(!I&&!U&&(j=A+1),I&&U&&(O=A-1),!I&&U){N=z;break}E++}return N||g},cC=function(t){var r=Ue(t)?[]:t.toString().split(zI);return[{words:r}]},UW=function(t){var r=t.width,n=t.scaleToFit,i=t.children,o=t.style,s=t.breakAll,u=t.maxLines;if((r||n)&&!aa.isSsr){var f,l,d=qI({breakAll:s,children:i,style:o});if(d){var p=d.wordsWithComputedWidth,m=d.spaceWidth;f=p,l=m}else return cC(i);return qW({breakAll:s,children:i,maxLines:u,style:o},f,l,r,n)}return cC(i)},uC="#808080",Go=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,o=i===void 0?0:i,s=t.lineHeight,u=s===void 0?"1em":s,f=t.capHeight,l=f===void 0?"0.71em":f,d=t.scaleToFit,p=d===void 0?!1:d,m=t.textAnchor,g=m===void 0?"start":m,b=t.verticalAnchor,y=b===void 0?"end":b,w=t.fill,j=w===void 0?uC:w,O=aC(t,IW),E=_.useMemo(function(){return UW({breakAll:O.breakAll,children:O.children,maxLines:O.maxLines,scaleToFit:p,style:O.style,width:O.width})},[O.breakAll,O.children,O.maxLines,p,O.style,O.width]),N=O.dx,A=O.dy,C=O.angle,T=O.className,R=O.breakAll,I=aC(O,DW);if(!Ft(n)||!Ft(o))return null;var z=n+(ge(N)?N:0),$=o+(ge(A)?A:0),L;switch(y){case"start":L=Px("calc(".concat(l,")"));break;case"middle":L=Px("calc(".concat((E.length-1)/2," * -").concat(u," + (").concat(l," / 2))"));break;default:L=Px("calc(".concat(E.length-1," * -").concat(u,")"));break}var U=[];if(p){var W=E[0].width,V=O.width;U.push("scale(".concat((ge(V)?V/W:1)/W,")"))}return C&&U.push("rotate(".concat(C,", ").concat(z,", ").concat($,")")),U.length&&(I.transform=U.join(" ")),F.createElement("text",l1({},Le(I,!0),{x:z,y:$,className:We("recharts-text",T),textAnchor:g,fill:j.includes("url")?uC:j}),E.map(function(G,Y){var D=G.words.join(R?"":" ");return F.createElement("tspan",{x:z,dy:Y===0?L:u,key:"".concat(D,"-").concat(Y)},D)}))};function io(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function WW(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function aS(e){let t,r,n;e.length!==2?(t=io,r=(u,f)=>io(e(u),f),n=(u,f)=>e(u)-f):(t=e===io||e===WW?e:HW,r=e,n=e);function i(u,f,l=0,d=u.length){if(l>>1;r(u[p],f)<0?l=p+1:d=p}while(l>>1;r(u[p],f)<=0?l=p+1:d=p}while(ll&&n(u[p-1],f)>-n(u[p],f)?p-1:p}return{left:i,center:s,right:o}}function HW(){return 0}function UI(e){return e===null?NaN:+e}function*VW(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const GW=aS(io),cu=GW.right;aS(UI).center;class fC extends Map{constructor(t,r=YW){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(dC(this,t))}has(t){return super.has(dC(this,t))}set(t,r){return super.set(KW(this,t),r)}delete(t){return super.delete(XW(this,t))}}function dC({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function KW({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function XW({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function YW(e){return e!==null&&typeof e=="object"?e.valueOf():e}function QW(e=io){if(e===io)return WI;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function WI(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const ZW=Math.sqrt(50),JW=Math.sqrt(10),eH=Math.sqrt(2);function dh(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),o=n/Math.pow(10,i),s=o>=ZW?10:o>=JW?5:o>=eH?2:1;let u,f,l;return i<0?(l=Math.pow(10,-i)/s,u=Math.round(e*l),f=Math.round(t*l),u/lt&&--f,l=-l):(l=Math.pow(10,i)*s,u=Math.round(e/l),f=Math.round(t/l),u*lt&&--f),f0))return[];if(e===t)return[e];const n=t=i))return[];const u=o-i+1,f=new Array(u);if(n)if(s<0)for(let l=0;l=n)&&(r=n);return r}function pC(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function HI(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?WI:QW(i);n>r;){if(n-r>600){const f=n-r+1,l=t-r+1,d=Math.log(f),p=.5*Math.exp(2*d/3),m=.5*Math.sqrt(d*p*(f-p)/f)*(l-f/2<0?-1:1),g=Math.max(r,Math.floor(t-l*p/f+m)),b=Math.min(n,Math.floor(t+(f-l)*p/f+m));HI(e,t,g,b,i)}const o=e[t];let s=r,u=n;for(Hl(e,r,t),i(e[n],o)>0&&Hl(e,r,n);s0;)--u}i(e[r],o)===0?Hl(e,r,u):(++u,Hl(e,u,n)),u<=t&&(r=u+1),t<=u&&(n=u-1)}return e}function Hl(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function tH(e,t,r){if(e=Float64Array.from(VW(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return pC(e);if(t>=1)return hC(e);var n,i=(n-1)*t,o=Math.floor(i),s=hC(HI(e,o).subarray(0,o+1)),u=pC(e.subarray(o+1));return s+(u-s)*(i-o)}}function rH(e,t,r=UI){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,o=Math.floor(i),s=+r(e[o],o,e),u=+r(e[o+1],o+1,e);return s+(u-s)*(i-o)}}function nH(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,o=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Uf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Uf(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=oH.exec(e))?new _r(t[1],t[2],t[3],1):(t=aH.exec(e))?new _r(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=sH.exec(e))?Uf(t[1],t[2],t[3],t[4]):(t=lH.exec(e))?Uf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=cH.exec(e))?wC(t[1],t[2]/100,t[3]/100,1):(t=uH.exec(e))?wC(t[1],t[2]/100,t[3]/100,t[4]):mC.hasOwnProperty(e)?yC(mC[e]):e==="transparent"?new _r(NaN,NaN,NaN,0):null}function yC(e){return new _r(e>>16&255,e>>8&255,e&255,1)}function Uf(e,t,r,n){return n<=0&&(e=t=r=NaN),new _r(e,t,r,n)}function hH(e){return e instanceof uu||(e=kc(e)),e?(e=e.rgb(),new _r(e.r,e.g,e.b,e.opacity)):new _r}function h1(e,t,r,n){return arguments.length===1?hH(e):new _r(e,t,r,n??1)}function _r(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}lS(_r,h1,GI(uu,{brighter(e){return e=e==null?hh:Math.pow(hh,e),new _r(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Nc:Math.pow(Nc,e),new _r(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new _r(qo(this.r),qo(this.g),qo(this.b),ph(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:xC,formatHex:xC,formatHex8:pH,formatRgb:bC,toString:bC}));function xC(){return`#${Bo(this.r)}${Bo(this.g)}${Bo(this.b)}`}function pH(){return`#${Bo(this.r)}${Bo(this.g)}${Bo(this.b)}${Bo((isNaN(this.opacity)?1:this.opacity)*255)}`}function bC(){const e=ph(this.opacity);return`${e===1?"rgb(":"rgba("}${qo(this.r)}, ${qo(this.g)}, ${qo(this.b)}${e===1?")":`, ${e})`}`}function ph(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function qo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Bo(e){return e=qo(e),(e<16?"0":"")+e.toString(16)}function wC(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Nn(e,t,r,n)}function KI(e){if(e instanceof Nn)return new Nn(e.h,e.s,e.l,e.opacity);if(e instanceof uu||(e=kc(e)),!e)return new Nn;if(e instanceof Nn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),s=NaN,u=o-i,f=(o+i)/2;return u?(t===o?s=(r-n)/u+(r0&&f<1?0:s,new Nn(s,u,f,e.opacity)}function mH(e,t,r,n){return arguments.length===1?KI(e):new Nn(e,t,r,n??1)}function Nn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}lS(Nn,mH,GI(uu,{brighter(e){return e=e==null?hh:Math.pow(hh,e),new Nn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Nc:Math.pow(Nc,e),new Nn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new _r(Ax(e>=240?e-240:e+120,i,n),Ax(e,i,n),Ax(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Nn(SC(this.h),Wf(this.s),Wf(this.l),ph(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=ph(this.opacity);return`${e===1?"hsl(":"hsla("}${SC(this.h)}, ${Wf(this.s)*100}%, ${Wf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function SC(e){return e=(e||0)%360,e<0?e+360:e}function Wf(e){return Math.max(0,Math.min(1,e||0))}function Ax(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const cS=e=>()=>e;function vH(e,t){return function(r){return e+r*t}}function gH(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function yH(e){return(e=+e)==1?XI:function(t,r){return r-t?gH(t,r,e):cS(isNaN(t)?r:t)}}function XI(e,t){var r=t-e;return r?vH(e,r):cS(isNaN(e)?t:e)}const _C=(function e(t){var r=yH(t);function n(i,o){var s=r((i=h1(i)).r,(o=h1(o)).r),u=r(i.g,o.g),f=r(i.b,o.b),l=XI(i.opacity,o.opacity);return function(d){return i.r=s(d),i.g=u(d),i.b=f(d),i.opacity=l(d),i+""}}return n.gamma=e,n})(1);function xH(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(o){for(i=0;ir&&(o=t.slice(r,o),u[s]?u[s]+=o:u[++s]=o),(n=n[0])===(i=i[0])?u[s]?u[s]+=i:u[++s]=i:(u[++s]=null,f.push({i:s,x:mh(n,i)})),r=Cx.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function NH(e,t,r){var n=e[0],i=e[1],o=t[0],s=t[1];return i2?TH:NH,f=l=null,p}function p(m){return m==null||isNaN(m=+m)?o:(f||(f=u(e.map(n),t,r)))(n(s(m)))}return p.invert=function(m){return s(i((l||(l=u(t,e.map(n),mh)))(m)))},p.domain=function(m){return arguments.length?(e=Array.from(m,vh),d()):e.slice()},p.range=function(m){return arguments.length?(t=Array.from(m),d()):t.slice()},p.rangeRound=function(m){return t=Array.from(m),r=uS,d()},p.clamp=function(m){return arguments.length?(s=m?!0:dr,d()):s!==dr},p.interpolate=function(m){return arguments.length?(r=m,d()):r},p.unknown=function(m){return arguments.length?(o=m,p):o},function(m,g){return n=m,i=g,d()}}function fS(){return Pp()(dr,dr)}function kH(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function gh(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function gs(e){return e=gh(Math.abs(e)),e?e[1]:NaN}function RH(e,t){return function(r,n){for(var i=r.length,o=[],s=0,u=e[0],f=0;i>0&&u>0&&(f+u+1>n&&(u=Math.max(1,n-f)),o.push(r.substring(i-=u,i+u)),!((f+=u+1)>n));)u=e[s=(s+1)%e.length];return o.reverse().join(t)}}function MH(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var IH=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Rc(e){if(!(t=IH.exec(e)))throw new Error("invalid format: "+e);var t;return new dS({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Rc.prototype=dS.prototype;function dS(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}dS.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function DH(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var yh;function LH(e,t){var r=gh(e,t);if(!r)return yh=void 0,e.toPrecision(t);var n=r[0],i=r[1],o=i-(yh=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return o===s?n:o>s?n+new Array(o-s+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+gh(e,Math.max(0,t+o-1))[0]}function OC(e,t){var r=gh(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const EC={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:kH,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>OC(e*100,t),r:OC,s:LH,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function PC(e){return e}var AC=Array.prototype.map,CC=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function $H(e){var t=e.grouping===void 0||e.thousands===void 0?PC:RH(AC.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?PC:MH(AC.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function l(p,m){p=Rc(p);var g=p.fill,b=p.align,y=p.sign,w=p.symbol,j=p.zero,O=p.width,E=p.comma,N=p.precision,A=p.trim,C=p.type;C==="n"?(E=!0,C="g"):EC[C]||(N===void 0&&(N=12),A=!0,C="g"),(j||g==="0"&&b==="=")&&(j=!0,g="0",b="=");var T=(m&&m.prefix!==void 0?m.prefix:"")+(w==="$"?r:w==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():""),R=(w==="$"?n:/[%p]/.test(C)?s:"")+(m&&m.suffix!==void 0?m.suffix:""),I=EC[C],z=/[defgprs%]/.test(C);N=N===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,N)):Math.max(0,Math.min(20,N));function $(L){var U=T,W=R,V,G,Y;if(C==="c")W=I(L)+W,L="";else{L=+L;var D=L<0||1/L<0;if(L=isNaN(L)?f:I(Math.abs(L),N),A&&(L=DH(L)),D&&+L==0&&y!=="+"&&(D=!1),U=(D?y==="("?y:u:y==="-"||y==="("?"":y)+U,W=(C==="s"&&!isNaN(L)&&yh!==void 0?CC[8+yh/3]:"")+W+(D&&y==="("?")":""),z){for(V=-1,G=L.length;++VY||Y>57){W=(Y===46?i+L.slice(V+1):L.slice(V))+W,L=L.slice(0,V);break}}}E&&!j&&(L=t(L,1/0));var Q=U.length+L.length+W.length,J=Q>1)+U+L+W+J.slice(Q);break;default:L=J+U+L+W;break}return o(L)}return $.toString=function(){return p+""},$}function d(p,m){var g=Math.max(-8,Math.min(8,Math.floor(gs(m)/3)))*3,b=Math.pow(10,-g),y=l((p=Rc(p),p.type="f",p),{suffix:CC[8+g/3]});return function(w){return y(b*w)}}return{format:l,formatPrefix:d}}var Hf,hS,YI;BH({thousands:",",grouping:[3],currency:["$",""]});function BH(e){return Hf=$H(e),hS=Hf.format,YI=Hf.formatPrefix,Hf}function FH(e){return Math.max(0,-gs(Math.abs(e)))}function zH(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(gs(t)/3)))*3-gs(Math.abs(e)))}function qH(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,gs(t)-gs(e))+1}function QI(e,t,r,n){var i=f1(e,t,r),o;switch(n=Rc(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=zH(i,s))&&(n.precision=o),YI(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=qH(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=FH(i))&&(n.precision=o-(n.type==="%")*2);break}}return hS(n)}function co(e){var t=e.domain;return e.ticks=function(r){var n=t();return c1(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return QI(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,o=n.length-1,s=n[i],u=n[o],f,l,d=10;for(u0;){if(l=u1(s,u,r),l===f)return n[i]=s,n[o]=u,t(n);if(l>0)s=Math.floor(s/l)*l,u=Math.ceil(u/l)*l;else if(l<0)s=Math.ceil(s*l)/l,u=Math.floor(u*l)/l;else break;f=l}return e},e}function xh(){var e=fS();return e.copy=function(){return fu(e,xh())},cn.apply(e,arguments),co(e)}function ZI(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,vh),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return ZI(e).unknown(t)},e=arguments.length?Array.from(e,vh):[0,1],co(r)}function JI(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],o=e[n],s;return oMath.pow(e,t)}function GH(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function kC(e){return(t,r)=>-e(-t,r)}function pS(e){const t=e(NC,TC),r=t.domain;let n=10,i,o;function s(){return i=GH(n),o=VH(n),r()[0]<0?(i=kC(i),o=kC(o),e(UH,WH)):e(NC,TC),t}return t.base=function(u){return arguments.length?(n=+u,s()):n},t.domain=function(u){return arguments.length?(r(u),s()):r()},t.ticks=u=>{const f=r();let l=f[0],d=f[f.length-1];const p=d0){for(;m<=g;++m)for(b=1;bd)break;j.push(y)}}else for(;m<=g;++m)for(b=n-1;b>=1;--b)if(y=m>0?b/o(-m):b*o(m),!(yd)break;j.push(y)}j.length*2{if(u==null&&(u=10),f==null&&(f=n===10?"s":","),typeof f!="function"&&(!(n%1)&&(f=Rc(f)).precision==null&&(f.trim=!0),f=hS(f)),u===1/0)return f;const l=Math.max(1,n*u/t.ticks().length);return d=>{let p=d/o(Math.round(i(d)));return p*nr(JI(r(),{floor:u=>o(Math.floor(i(u))),ceil:u=>o(Math.ceil(i(u)))})),t}function eD(){const e=pS(Pp()).domain([1,10]);return e.copy=()=>fu(e,eD()).base(e.base()),cn.apply(e,arguments),e}function RC(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function MC(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function mS(e){var t=1,r=e(RC(t),MC(t));return r.constant=function(n){return arguments.length?e(RC(t=+n),MC(t)):t},co(r)}function tD(){var e=mS(Pp());return e.copy=function(){return fu(e,tD()).constant(e.constant())},cn.apply(e,arguments)}function IC(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function KH(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function XH(e){return e<0?-e*e:e*e}function vS(e){var t=e(dr,dr),r=1;function n(){return r===1?e(dr,dr):r===.5?e(KH,XH):e(IC(r),IC(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},co(t)}function gS(){var e=vS(Pp());return e.copy=function(){return fu(e,gS()).exponent(e.exponent())},cn.apply(e,arguments),e}function YH(){return gS.apply(null,arguments).exponent(.5)}function DC(e){return Math.sign(e)*e*e}function QH(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function rD(){var e=fS(),t=[0,1],r=!1,n;function i(o){var s=QH(e(o));return isNaN(s)?n:r?Math.round(s):s}return i.invert=function(o){return e.invert(DC(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,vh)).map(DC)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(r=!!o,i):r},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return rD(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},cn.apply(i,arguments),co(i)}function nD(){var e=[],t=[],r=[],n;function i(){var s=0,u=Math.max(1,t.length);for(r=new Array(u-1);++s0?r[u-1]:e[0],u=r?[n[r-1],t]:[n[l-1],n[l]]},s.unknown=function(f){return arguments.length&&(o=f),s},s.thresholds=function(){return n.slice()},s.copy=function(){return iD().domain([e,t]).range(i).unknown(o)},cn.apply(co(s),arguments)}function oD(){var e=[.5],t=[0,1],r,n=1;function i(o){return o!=null&&o<=o?t[cu(e,o,0,n)]:r}return i.domain=function(o){return arguments.length?(e=Array.from(o),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var s=t.indexOf(o);return[e[s-1],e[s]]},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return oD().domain(e).range(t).unknown(r)},cn.apply(i,arguments)}const Nx=new Date,Tx=new Date;function zt(e,t,r,n){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const s=i(o),u=i.ceil(o);return o-s(t(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,u)=>{const f=[];if(o=i.ceil(o),u=u==null?1:Math.floor(u),!(o0))return f;let l;do f.push(l=new Date(+o)),t(o,u),e(o);while(lzt(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,u)=>{if(s>=s)if(u<0)for(;++u<=0;)for(;t(s,-1),!o(s););else for(;--u>=0;)for(;t(s,1),!o(s););}),r&&(i.count=(o,s)=>(Nx.setTime(+o),Tx.setTime(+s),e(Nx),e(Tx),Math.floor(r(Nx,Tx))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(n?s=>n(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const bh=zt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);bh.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?zt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):bh);bh.range;const vi=1e3,an=vi*60,gi=an*60,Si=gi*24,yS=Si*7,LC=Si*30,kx=Si*365,Fo=zt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*vi)},(e,t)=>(t-e)/vi,e=>e.getUTCSeconds());Fo.range;const xS=zt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*vi)},(e,t)=>{e.setTime(+e+t*an)},(e,t)=>(t-e)/an,e=>e.getMinutes());xS.range;const bS=zt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*an)},(e,t)=>(t-e)/an,e=>e.getUTCMinutes());bS.range;const wS=zt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*vi-e.getMinutes()*an)},(e,t)=>{e.setTime(+e+t*gi)},(e,t)=>(t-e)/gi,e=>e.getHours());wS.range;const SS=zt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*gi)},(e,t)=>(t-e)/gi,e=>e.getUTCHours());SS.range;const du=zt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*an)/Si,e=>e.getDate()-1);du.range;const Ap=zt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Si,e=>e.getUTCDate()-1);Ap.range;const aD=zt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Si,e=>Math.floor(e/Si));aD.range;function sa(e){return zt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*an)/yS)}const Cp=sa(0),wh=sa(1),ZH=sa(2),JH=sa(3),ys=sa(4),eV=sa(5),tV=sa(6);Cp.range;wh.range;ZH.range;JH.range;ys.range;eV.range;tV.range;function la(e){return zt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/yS)}const Np=la(0),Sh=la(1),rV=la(2),nV=la(3),xs=la(4),iV=la(5),oV=la(6);Np.range;Sh.range;rV.range;nV.range;xs.range;iV.range;oV.range;const _S=zt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());_S.range;const jS=zt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());jS.range;const _i=zt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());_i.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:zt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});_i.range;const ji=zt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ji.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:zt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});ji.range;function sD(e,t,r,n,i,o){const s=[[Fo,1,vi],[Fo,5,5*vi],[Fo,15,15*vi],[Fo,30,30*vi],[o,1,an],[o,5,5*an],[o,15,15*an],[o,30,30*an],[i,1,gi],[i,3,3*gi],[i,6,6*gi],[i,12,12*gi],[n,1,Si],[n,2,2*Si],[r,1,yS],[t,1,LC],[t,3,3*LC],[e,1,kx]];function u(l,d,p){const m=dw).right(s,m);if(g===s.length)return e.every(f1(l/kx,d/kx,p));if(g===0)return bh.every(Math.max(f1(l,d,p),1));const[b,y]=s[m/s[g-1][2]53)return null;"w"in oe||(oe.w=1),"Z"in oe?(Me=Mx(Vl(oe.y,0,1)),Ye=Me.getUTCDay(),Me=Ye>4||Ye===0?Sh.ceil(Me):Sh(Me),Me=Ap.offset(Me,(oe.V-1)*7),oe.y=Me.getUTCFullYear(),oe.m=Me.getUTCMonth(),oe.d=Me.getUTCDate()+(oe.w+6)%7):(Me=Rx(Vl(oe.y,0,1)),Ye=Me.getDay(),Me=Ye>4||Ye===0?wh.ceil(Me):wh(Me),Me=du.offset(Me,(oe.V-1)*7),oe.y=Me.getFullYear(),oe.m=Me.getMonth(),oe.d=Me.getDate()+(oe.w+6)%7)}else("W"in oe||"U"in oe)&&("w"in oe||(oe.w="u"in oe?oe.u%7:"W"in oe?1:0),Ye="Z"in oe?Mx(Vl(oe.y,0,1)).getUTCDay():Rx(Vl(oe.y,0,1)).getDay(),oe.m=0,oe.d="W"in oe?(oe.w+6)%7+oe.W*7-(Ye+5)%7:oe.w+oe.U*7-(Ye+6)%7);return"Z"in oe?(oe.H+=oe.Z/100|0,oe.M+=oe.Z%100,Mx(oe)):Rx(oe)}}function R(ie,de,ye,oe){for(var $e=0,Me=de.length,Ye=ye.length,lt,vt;$e=Ye)return-1;if(lt=de.charCodeAt($e++),lt===37){if(lt=de.charAt($e++),vt=A[lt in $C?de.charAt($e++):lt],!vt||(oe=vt(ie,ye,oe))<0)return-1}else if(lt!=ye.charCodeAt(oe++))return-1}return oe}function I(ie,de,ye){var oe=l.exec(de.slice(ye));return oe?(ie.p=d.get(oe[0].toLowerCase()),ye+oe[0].length):-1}function z(ie,de,ye){var oe=g.exec(de.slice(ye));return oe?(ie.w=b.get(oe[0].toLowerCase()),ye+oe[0].length):-1}function $(ie,de,ye){var oe=p.exec(de.slice(ye));return oe?(ie.w=m.get(oe[0].toLowerCase()),ye+oe[0].length):-1}function L(ie,de,ye){var oe=j.exec(de.slice(ye));return oe?(ie.m=O.get(oe[0].toLowerCase()),ye+oe[0].length):-1}function U(ie,de,ye){var oe=y.exec(de.slice(ye));return oe?(ie.m=w.get(oe[0].toLowerCase()),ye+oe[0].length):-1}function W(ie,de,ye){return R(ie,t,de,ye)}function V(ie,de,ye){return R(ie,r,de,ye)}function G(ie,de,ye){return R(ie,n,de,ye)}function Y(ie){return s[ie.getDay()]}function D(ie){return o[ie.getDay()]}function Q(ie){return f[ie.getMonth()]}function J(ie){return u[ie.getMonth()]}function M(ie){return i[+(ie.getHours()>=12)]}function B(ie){return 1+~~(ie.getMonth()/3)}function Z(ie){return s[ie.getUTCDay()]}function te(ie){return o[ie.getUTCDay()]}function ve(ie){return f[ie.getUTCMonth()]}function xe(ie){return u[ie.getUTCMonth()]}function X(ie){return i[+(ie.getUTCHours()>=12)]}function ue(ie){return 1+~~(ie.getUTCMonth()/3)}return{format:function(ie){var de=C(ie+="",E);return de.toString=function(){return ie},de},parse:function(ie){var de=T(ie+="",!1);return de.toString=function(){return ie},de},utcFormat:function(ie){var de=C(ie+="",N);return de.toString=function(){return ie},de},utcParse:function(ie){var de=T(ie+="",!0);return de.toString=function(){return ie},de}}}var $C={"-":"",_:" ",0:"0"},Gt=/^\s*\d+/,fV=/^%/,dV=/[\\^$*+?|[\]().{}]/g;function it(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",o=i.length;return n+(o[t.toLowerCase(),r]))}function pV(e,t,r){var n=Gt.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function mV(e,t,r){var n=Gt.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function vV(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function gV(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function yV(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function BC(e,t,r){var n=Gt.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function FC(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function xV(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function bV(e,t,r){var n=Gt.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function wV(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function zC(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function SV(e,t,r){var n=Gt.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function qC(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function _V(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function jV(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function OV(e,t,r){var n=Gt.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function EV(e,t,r){var n=Gt.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function PV(e,t,r){var n=fV.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function AV(e,t,r){var n=Gt.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function CV(e,t,r){var n=Gt.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function UC(e,t){return it(e.getDate(),t,2)}function NV(e,t){return it(e.getHours(),t,2)}function TV(e,t){return it(e.getHours()%12||12,t,2)}function kV(e,t){return it(1+du.count(_i(e),e),t,3)}function lD(e,t){return it(e.getMilliseconds(),t,3)}function RV(e,t){return lD(e,t)+"000"}function MV(e,t){return it(e.getMonth()+1,t,2)}function IV(e,t){return it(e.getMinutes(),t,2)}function DV(e,t){return it(e.getSeconds(),t,2)}function LV(e){var t=e.getDay();return t===0?7:t}function $V(e,t){return it(Cp.count(_i(e)-1,e),t,2)}function cD(e){var t=e.getDay();return t>=4||t===0?ys(e):ys.ceil(e)}function BV(e,t){return e=cD(e),it(ys.count(_i(e),e)+(_i(e).getDay()===4),t,2)}function FV(e){return e.getDay()}function zV(e,t){return it(wh.count(_i(e)-1,e),t,2)}function qV(e,t){return it(e.getFullYear()%100,t,2)}function UV(e,t){return e=cD(e),it(e.getFullYear()%100,t,2)}function WV(e,t){return it(e.getFullYear()%1e4,t,4)}function HV(e,t){var r=e.getDay();return e=r>=4||r===0?ys(e):ys.ceil(e),it(e.getFullYear()%1e4,t,4)}function VV(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+it(t/60|0,"0",2)+it(t%60,"0",2)}function WC(e,t){return it(e.getUTCDate(),t,2)}function GV(e,t){return it(e.getUTCHours(),t,2)}function KV(e,t){return it(e.getUTCHours()%12||12,t,2)}function XV(e,t){return it(1+Ap.count(ji(e),e),t,3)}function uD(e,t){return it(e.getUTCMilliseconds(),t,3)}function YV(e,t){return uD(e,t)+"000"}function QV(e,t){return it(e.getUTCMonth()+1,t,2)}function ZV(e,t){return it(e.getUTCMinutes(),t,2)}function JV(e,t){return it(e.getUTCSeconds(),t,2)}function eG(e){var t=e.getUTCDay();return t===0?7:t}function tG(e,t){return it(Np.count(ji(e)-1,e),t,2)}function fD(e){var t=e.getUTCDay();return t>=4||t===0?xs(e):xs.ceil(e)}function rG(e,t){return e=fD(e),it(xs.count(ji(e),e)+(ji(e).getUTCDay()===4),t,2)}function nG(e){return e.getUTCDay()}function iG(e,t){return it(Sh.count(ji(e)-1,e),t,2)}function oG(e,t){return it(e.getUTCFullYear()%100,t,2)}function aG(e,t){return e=fD(e),it(e.getUTCFullYear()%100,t,2)}function sG(e,t){return it(e.getUTCFullYear()%1e4,t,4)}function lG(e,t){var r=e.getUTCDay();return e=r>=4||r===0?xs(e):xs.ceil(e),it(e.getUTCFullYear()%1e4,t,4)}function cG(){return"+0000"}function HC(){return"%"}function VC(e){return+e}function GC(e){return Math.floor(+e/1e3)}var $a,dD,hD;uG({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function uG(e){return $a=uV(e),dD=$a.format,$a.parse,hD=$a.utcFormat,$a.utcParse,$a}function fG(e){return new Date(e)}function dG(e){return e instanceof Date?+e:+new Date(+e)}function OS(e,t,r,n,i,o,s,u,f,l){var d=fS(),p=d.invert,m=d.domain,g=l(".%L"),b=l(":%S"),y=l("%I:%M"),w=l("%I %p"),j=l("%a %d"),O=l("%b %d"),E=l("%B"),N=l("%Y");function A(C){return(f(C)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,o)=>tH(e,o/n))},r.copy=function(){return gD(t).domain(e)},Ni.apply(r,arguments)}function kp(){var e=0,t=.5,r=1,n=1,i,o,s,u,f,l=dr,d,p=!1,m;function g(y){return isNaN(y=+y)?m:(y=.5+((y=+d(y))-o)*(n*yr}return Dx=e,Dx}var Lx,QC;function gG(){if(QC)return Lx;QC=1;var e=Rp(),t=wD(),r=Vs();function n(i){return i&&i.length?e(i,r,t):void 0}return Lx=n,Lx}var yG=gG();const Mp=ot(yG);var $x,ZC;function SD(){if(ZC)return $x;ZC=1;function e(t,r){return te.e^o.s<0?1:-1;for(n=o.d.length,i=e.d.length,t=0,r=ne.d[t]^o.s<0?1:-1;return n===i?0:n>i^o.s<0?1:-1};je.decimalPlaces=je.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*xt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};je.dividedBy=je.div=function(e){return bi(this,new this.constructor(e))};je.dividedToIntegerBy=je.idiv=function(e){var t=this,r=t.constructor;return ft(bi(t,new r(e),0,1),r.precision)};je.equals=je.eq=function(e){return!this.cmp(e)};je.exponent=function(){return kt(this)};je.greaterThan=je.gt=function(e){return this.cmp(e)>0};je.greaterThanOrEqualTo=je.gte=function(e){return this.cmp(e)>=0};je.isInteger=je.isint=function(){return this.e>this.d.length-2};je.isNegative=je.isneg=function(){return this.s<0};je.isPositive=je.ispos=function(){return this.s>0};je.isZero=function(){return this.s===0};je.lessThan=je.lt=function(e){return this.cmp(e)<0};je.lessThanOrEqualTo=je.lte=function(e){return this.cmp(e)<1};je.logarithm=je.log=function(e){var t,r=this,n=r.constructor,i=n.precision,o=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(qr))throw Error(sn+"NaN");if(r.s<1)throw Error(sn+(r.s?"NaN":"-Infinity"));return r.eq(qr)?new n(0):(wt=!1,t=bi(Mc(r,o),Mc(e,o),o),wt=!0,ft(t,i))};je.minus=je.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?ED(t,e):jD(t,(e.s=-e.s,e))};je.modulo=je.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(sn+"NaN");return r.s?(wt=!1,t=bi(r,e,0,1).times(e),wt=!0,r.minus(t)):ft(new n(r),i)};je.naturalExponential=je.exp=function(){return OD(this)};je.naturalLogarithm=je.ln=function(){return Mc(this)};je.negated=je.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};je.plus=je.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?jD(t,e):ED(t,(e.s=-e.s,e))};je.precision=je.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Uo+e);if(t=kt(i)+1,n=i.d.length-1,r=n*xt+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};je.squareRoot=je.sqrt=function(){var e,t,r,n,i,o,s,u=this,f=u.constructor;if(u.s<1){if(!u.s)return new f(0);throw Error(sn+"NaN")}for(e=kt(u),wt=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=Hn(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Xs((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new f(t)):n=new f(i.toString()),r=f.precision,i=s=r+3;;)if(o=n,n=o.plus(bi(u,o,s+2)).times(.5),Hn(o.d).slice(0,s)===(t=Hn(n.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(ft(o,r+1,0),o.times(o).eq(u)){n=o;break}}else if(t!="9999")break;s+=4}return wt=!0,ft(n,r)};je.times=je.mul=function(e){var t,r,n,i,o,s,u,f,l,d=this,p=d.constructor,m=d.d,g=(e=new p(e)).d;if(!d.s||!e.s)return new p(0);for(e.s*=d.s,r=d.e+e.e,f=m.length,l=g.length,f=0;){for(t=0,i=f+n;i>n;)u=o[i]+g[n]*m[i-n-1]+t,o[i--]=u%Ht|0,t=u/Ht|0;o[i]=(o[i]+t)%Ht|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=r,wt?ft(e,p.precision):e};je.toDecimalPlaces=je.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Qn(e,0,Ks),t===void 0?t=n.rounding:Qn(t,0,8),ft(r,e+kt(r)+1,t))};je.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Ko(n,!0):(Qn(e,0,Ks),t===void 0?t=i.rounding:Qn(t,0,8),n=ft(new i(n),e+1,t),r=Ko(n,!0,e+1)),r};je.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?Ko(i):(Qn(e,0,Ks),t===void 0?t=o.rounding:Qn(t,0,8),n=ft(new o(i),e+kt(i)+1,t),r=Ko(n.abs(),!1,e+kt(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};je.toInteger=je.toint=function(){var e=this,t=e.constructor;return ft(new t(e),kt(e)+1,t.rounding)};je.toNumber=function(){return+this};je.toPower=je.pow=function(e){var t,r,n,i,o,s,u=this,f=u.constructor,l=12,d=+(e=new f(e));if(!e.s)return new f(qr);if(u=new f(u),!u.s){if(e.s<1)throw Error(sn+"Infinity");return u}if(u.eq(qr))return u;if(n=f.precision,e.eq(qr))return ft(u,n);if(t=e.e,r=e.d.length-1,s=t>=r,o=u.s,s){if((r=d<0?-d:d)<=_D){for(i=new f(qr),t=Math.ceil(n/xt+4),wt=!1;r%2&&(i=i.times(u),iN(i.d,t)),r=Xs(r/2),r!==0;)u=u.times(u),iN(u.d,t);return wt=!0,e.s<0?new f(qr).div(i):ft(i,n)}}else if(o<0)throw Error(sn+"NaN");return o=o<0&&e.d[Math.max(t,r)]&1?-1:1,u.s=1,wt=!1,i=e.times(Mc(u,n+l)),wt=!0,i=OD(i),i.s=o,i};je.toPrecision=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?(r=kt(i),n=Ko(i,r<=o.toExpNeg||r>=o.toExpPos)):(Qn(e,1,Ks),t===void 0?t=o.rounding:Qn(t,0,8),i=ft(new o(i),e,t),r=kt(i),n=Ko(i,e<=r||r<=o.toExpNeg,e)),n};je.toSignificantDigits=je.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Qn(e,1,Ks),t===void 0?t=n.rounding:Qn(t,0,8)),ft(new n(r),e,t)};je.toString=je.valueOf=je.val=je.toJSON=je[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=kt(e),r=e.constructor;return Ko(e,t<=r.toExpNeg||t>=r.toExpPos)};function jD(e,t){var r,n,i,o,s,u,f,l,d=e.constructor,p=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),wt?ft(t,p):t;if(f=e.d,l=t.d,s=e.e,i=t.e,f=f.slice(),o=s-i,o){for(o<0?(n=f,o=-o,u=l.length):(n=l,i=s,u=f.length),s=Math.ceil(p/xt),u=s>u?s+1:u+1,o>u&&(o=u,n.length=1),n.reverse();o--;)n.push(0);n.reverse()}for(u=f.length,o=l.length,u-o<0&&(o=u,n=l,l=f,f=n),r=0;o;)r=(f[--o]=f[o]+l[o]+r)/Ht|0,f[o]%=Ht;for(r&&(f.unshift(r),++i),u=f.length;f[--u]==0;)f.pop();return t.d=f,t.e=i,wt?ft(t,p):t}function Qn(e,t,r){if(e!==~~e||er)throw Error(Uo+e)}function Hn(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;ts?1:-1;else for(u=f=0;ui[u]?1:-1;break}return f}function r(n,i,o){for(var s=0;o--;)n[o]-=s,s=n[o]1;)n.shift()}return function(n,i,o,s){var u,f,l,d,p,m,g,b,y,w,j,O,E,N,A,C,T,R,I=n.constructor,z=n.s==i.s?1:-1,$=n.d,L=i.d;if(!n.s)return new I(n);if(!i.s)throw Error(sn+"Division by zero");for(f=n.e-i.e,T=L.length,A=$.length,g=new I(z),b=g.d=[],l=0;L[l]==($[l]||0);)++l;if(L[l]>($[l]||0)&&--f,o==null?O=o=I.precision:s?O=o+(kt(n)-kt(i))+1:O=o,O<0)return new I(0);if(O=O/xt+2|0,l=0,T==1)for(d=0,L=L[0],O++;(l1&&(L=e(L,d),$=e($,d),T=L.length,A=$.length),N=T,y=$.slice(0,T),w=y.length;w=Ht/2&&++C;do d=0,u=t(L,y,T,w),u<0?(j=y[0],T!=w&&(j=j*Ht+(y[1]||0)),d=j/C|0,d>1?(d>=Ht&&(d=Ht-1),p=e(L,d),m=p.length,w=y.length,u=t(p,y,m,w),u==1&&(d--,r(p,T16)throw Error(AS+kt(e));if(!e.s)return new d(qr);for(wt=!1,u=p,s=new d(.03125);e.abs().gte(.1);)e=e.times(s),l+=5;for(n=Math.log(Do(2,l))/Math.LN10*2+5|0,u+=n,r=i=o=new d(qr),d.precision=u;;){if(i=ft(i.times(e),u),r=r.times(++f),s=o.plus(bi(i,r,u)),Hn(s.d).slice(0,u)===Hn(o.d).slice(0,u)){for(;l--;)o=ft(o.times(o),u);return d.precision=p,t==null?(wt=!0,ft(o,p)):o}o=s}}function kt(e){for(var t=e.e*xt,r=e.d[0];r>=10;r/=10)t++;return t}function Ux(e,t,r){if(t>e.LN10.sd())throw wt=!0,r&&(e.precision=r),Error(sn+"LN10 precision limit exceeded");return ft(new e(e.LN10),t)}function eo(e){for(var t="";e--;)t+="0";return t}function Mc(e,t){var r,n,i,o,s,u,f,l,d,p=1,m=10,g=e,b=g.d,y=g.constructor,w=y.precision;if(g.s<1)throw Error(sn+(g.s?"NaN":"-Infinity"));if(g.eq(qr))return new y(0);if(t==null?(wt=!1,l=w):l=t,g.eq(10))return t==null&&(wt=!0),Ux(y,l);if(l+=m,y.precision=l,r=Hn(b),n=r.charAt(0),o=kt(g),Math.abs(o)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)g=g.times(e),r=Hn(g.d),n=r.charAt(0),p++;o=kt(g),n>1?(g=new y("0."+r),o++):g=new y(n+"."+r.slice(1))}else return f=Ux(y,l+2,w).times(o+""),g=Mc(new y(n+"."+r.slice(1)),l-m).plus(f),y.precision=w,t==null?(wt=!0,ft(g,w)):g;for(u=s=g=bi(g.minus(qr),g.plus(qr),l),d=ft(g.times(g),l),i=3;;){if(s=ft(s.times(d),l),f=u.plus(bi(s,new y(i),l)),Hn(f.d).slice(0,l)===Hn(u.d).slice(0,l))return u=u.times(2),o!==0&&(u=u.plus(Ux(y,l+2,w).times(o+""))),u=bi(u,new y(p),l),y.precision=w,t==null?(wt=!0,ft(u,w)):u;u=f,i+=2}}function nN(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Xs(r/xt),e.d=[],n=(r+1)%xt,r<0&&(n+=xt),n_h||e.e<-_h))throw Error(AS+r)}else e.s=0,e.e=0,e.d=[0];return e}function ft(e,t,r){var n,i,o,s,u,f,l,d,p=e.d;for(s=1,o=p[0];o>=10;o/=10)s++;if(n=t-s,n<0)n+=xt,i=t,l=p[d=0];else{if(d=Math.ceil((n+1)/xt),o=p.length,d>=o)return e;for(l=o=p[d],s=1;o>=10;o/=10)s++;n%=xt,i=n-xt+s}if(r!==void 0&&(o=Do(10,s-i-1),u=l/o%10|0,f=t<0||p[d+1]!==void 0||l%o,f=r<4?(u||f)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||f||r==6&&(n>0?i>0?l/Do(10,s-i):0:p[d-1])%10&1||r==(e.s<0?8:7))),t<1||!p[0])return f?(o=kt(e),p.length=1,t=t-o-1,p[0]=Do(10,(xt-t%xt)%xt),e.e=Xs(-t/xt)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(n==0?(p.length=d,o=1,d--):(p.length=d+1,o=Do(10,xt-n),p[d]=i>0?(l/Do(10,s-i)%Do(10,i)|0)*o:0),f)for(;;)if(d==0){(p[0]+=o)==Ht&&(p[0]=1,++e.e);break}else{if(p[d]+=o,p[d]!=Ht)break;p[d--]=0,o=1}for(n=p.length;p[--n]===0;)p.pop();if(wt&&(e.e>_h||e.e<-_h))throw Error(AS+kt(e));return e}function ED(e,t){var r,n,i,o,s,u,f,l,d,p,m=e.constructor,g=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),wt?ft(t,g):t;if(f=e.d,p=t.d,n=t.e,l=e.e,f=f.slice(),s=l-n,s){for(d=s<0,d?(r=f,s=-s,u=p.length):(r=p,n=l,u=f.length),i=Math.max(Math.ceil(g/xt),u)+2,s>i&&(s=i,r.length=1),r.reverse(),i=s;i--;)r.push(0);r.reverse()}else{for(i=f.length,u=p.length,d=i0;--i)f[u++]=0;for(i=p.length;i>s;){if(f[--i]0?o=o.charAt(0)+"."+o.slice(1)+eo(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+eo(-i-1)+o,r&&(n=r-s)>0&&(o+=eo(n))):i>=s?(o+=eo(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+eo(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=eo(n))),e.s<0?"-"+o:o}function iN(e,t){if(e.length>t)return e.length=t,!0}function PD(e){var t,r,n;function i(o){var s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,o instanceof i){s.s=o.s,s.e=o.e,s.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(Uo+o);if(o>0)s.s=1;else if(o<0)o=-o,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(o===~~o&&o<1e7){s.e=0,s.d=[o];return}return nN(s,o.toString())}else if(typeof o!="string")throw Error(Uo+o);if(o.charCodeAt(0)===45?(o=o.slice(1),s.s=-1):s.s=1,AG.test(o))nN(s,o);else throw Error(Uo+o)}if(i.prototype=je,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=PD,i.config=i.set=CG,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Uo+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Uo+r+": "+n);return this}var CS=PD(PG);qr=new CS(1);const ut=CS;function NG(e){return MG(e)||RG(e)||kG(e)||TG()}function TG(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kG(e,t){if(e){if(typeof e=="string")return v1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v1(e,t)}}function RG(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function MG(e){if(Array.isArray(e))return v1(e)}function v1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-s,oN(function(){for(var u=arguments.length,f=new Array(u),l=0;le.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,o=void 0;try{for(var s=e[Symbol.iterator](),u;!(n=(u=s.next()).done)&&(r.push(u.value),!(t&&r.length===t));n=!0);}catch(f){i=!0,o=f}finally{try{!n&&s.return!=null&&s.return()}finally{if(i)throw o}}return r}}function XG(e){if(Array.isArray(e))return e}function kD(e){var t=Ic(e,2),r=t[0],n=t[1],i=r,o=n;return r>n&&(i=n,o=r),[i,o]}function RD(e,t,r){if(e.lte(0))return new ut(0);var n=Lp.getDigitCount(e.toNumber()),i=new ut(10).pow(n),o=e.div(i),s=n!==1?.05:.1,u=new ut(Math.ceil(o.div(s).toNumber())).add(r).mul(s),f=u.mul(i);return t?f:new ut(Math.ceil(f))}function YG(e,t,r){var n=1,i=new ut(e);if(!i.isint()&&r){var o=Math.abs(e);o<1?(n=new ut(10).pow(Lp.getDigitCount(e)-1),i=new ut(Math.floor(i.div(n).toNumber())).mul(n)):o>1&&(i=new ut(Math.floor(e)))}else e===0?i=new ut(Math.floor((t-1)/2)):r||(i=new ut(Math.floor(e)));var s=Math.floor((t-1)/2),u=$G(LG(function(f){return i.add(new ut(f-s).mul(n)).toNumber()}),g1);return u(0,t)}function MD(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new ut(0),tickMin:new ut(0),tickMax:new ut(0)};var o=RD(new ut(t).sub(e).div(r-1),n,i),s;e<=0&&t>=0?s=new ut(0):(s=new ut(e).add(t).div(2),s=s.sub(new ut(s).mod(o)));var u=Math.ceil(s.sub(e).div(o).toNumber()),f=Math.ceil(new ut(t).sub(s).div(o).toNumber()),l=u+f+1;return l>r?MD(e,t,r,n,i+1):(l0?f+(r-l):f,u=t>0?u:u+(r-l)),{step:o,tickMin:s.sub(new ut(u).mul(o)),tickMax:s.add(new ut(f).mul(o))})}function QG(e){var t=Ic(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(i,2),u=kD([r,n]),f=Ic(u,2),l=f[0],d=f[1];if(l===-1/0||d===1/0){var p=d===1/0?[l].concat(x1(g1(0,i-1).map(function(){return 1/0}))):[].concat(x1(g1(0,i-1).map(function(){return-1/0})),[d]);return r>n?y1(p):p}if(l===d)return YG(l,i,o);var m=MD(l,d,s,o),g=m.step,b=m.tickMin,y=m.tickMax,w=Lp.rangeStep(b,y.add(new ut(.1).mul(g)),g);return r>n?y1(w):w}function ZG(e,t){var r=Ic(e,2),n=r[0],i=r[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=kD([n,i]),u=Ic(s,2),f=u[0],l=u[1];if(f===-1/0||l===1/0)return[n,i];if(f===l)return[f];var d=Math.max(t,2),p=RD(new ut(l).sub(f).div(d-1),o,0),m=[].concat(x1(Lp.rangeStep(new ut(f),new ut(l).sub(new ut(.99).mul(p)),p)),[l]);return n>i?y1(m):m}var JG=ND(QG),eK=ND(ZG),tK="Invariant failed";function Xo(e,t){throw new Error(tK)}var rK=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function bs(e){"@babel/helpers - typeof";return bs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bs(e)}function jh(){return jh=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function cK(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 uK(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fK(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,s=-1,u=(r=n?.length)!==null&&r!==void 0?r:0;if(u<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var f=o.range,l=0;l0?i[l-1].coordinate:i[u-1].coordinate,p=i[l].coordinate,m=l>=u-1?i[0].coordinate:i[l+1].coordinate,g=void 0;if(ur(p-d)!==ur(m-p)){var b=[];if(ur(m-p)===ur(f[1]-f[0])){g=m;var y=p+f[1]-f[0];b[0]=Math.min(y,(y+d)/2),b[1]=Math.max(y,(y+d)/2)}else{g=d;var w=m+f[1]-f[0];b[0]=Math.min(p,(w+p)/2),b[1]=Math.max(p,(w+p)/2)}var j=[Math.min(p,(g+p)/2),Math.max(p,(g+p)/2)];if(t>j[0]&&t<=j[1]||t>=b[0]&&t<=b[1]){s=i[l].index;break}}else{var O=Math.min(d,m),E=Math.max(d,m);if(t>(O+p)/2&&t<=(E+p)/2){s=i[l].index;break}}}else for(var N=0;N0&&N(n[N].coordinate+n[N-1].coordinate)/2&&t<=(n[N].coordinate+n[N+1].coordinate)/2||N===u-1&&t>(n[N].coordinate+n[N-1].coordinate)/2){s=n[N].index;break}return s},NS=function(t){var r,n=t,i=n.type.displayName,o=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Pt(Pt({},t.type.defaultProps),t.props):t.props,s=o.stroke,u=o.fill,f;switch(i){case"Line":f=s;break;case"Area":case"Radar":f=s&&s!=="none"?s:u;break;default:f=u;break}return f},AK=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,o=i===void 0?{}:i;if(!o)return{};for(var s={},u=Object.keys(o),f=0,l=u.length;f=0});if(j&&j.length){var O=j[0].type.defaultProps,E=O!==void 0?Pt(Pt({},O),j[0].props):j[0].props,N=E.barSize,A=E[w];s[A]||(s[A]=[]);var C=Ue(N)?r:N;s[A].push({item:j[0],stackList:j.slice(1),barSize:Ue(C)?void 0:fr(C,n,0)})}}return s},CK=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,o=t.sizeList,s=o===void 0?[]:o,u=t.maxBarSize,f=s.length;if(f<1)return null;var l=fr(r,i,0,!0),d,p=[];if(s[0].barSize===+s[0].barSize){var m=!1,g=i/f,b=s.reduce(function(N,A){return N+A.barSize||0},0);b+=(f-1)*l,b>=i&&(b-=(f-1)*l,l=0),b>=i&&g>0&&(m=!0,g*=.9,b=f*g);var y=(i-b)/2>>0,w={offset:y-l,size:0};d=s.reduce(function(N,A){var C={item:A.item,position:{offset:w.offset+w.size+l,size:m?g:A.barSize}},T=[].concat(lN(N),[C]);return w=T[T.length-1].position,A.stackList&&A.stackList.length&&A.stackList.forEach(function(R){T.push({item:R,position:w})}),T},p)}else{var j=fr(n,i,0,!0);i-2*j-(f-1)*l<=0&&(l=0);var O=(i-2*j-(f-1)*l)/f;O>1&&(O>>=0);var E=u===+u?Math.min(O,u):O;d=s.reduce(function(N,A,C){var T=[].concat(lN(N),[{item:A.item,position:{offset:j+(O+l)*C+(O-E)/2,size:E}}]);return A.stackList&&A.stackList.length&&A.stackList.forEach(function(R){T.push({item:R,position:T[T.length-1].position})}),T},p)}return d},NK=function(t,r,n,i){var o=n.children,s=n.width,u=n.margin,f=s-(u.left||0)-(u.right||0),l=$D({children:o,legendWidth:f});if(l){var d=i||{},p=d.width,m=d.height,g=l.align,b=l.verticalAlign,y=l.layout;if((y==="vertical"||y==="horizontal"&&b==="middle")&&g!=="center"&&ge(t[g]))return Pt(Pt({},t),{},is({},g,t[g]+(p||0)));if((y==="horizontal"||y==="vertical"&&g==="center")&&b!=="middle"&&ge(t[b]))return Pt(Pt({},t),{},is({},b,t[b]+(m||0)))}return t},TK=function(t,r,n){return Ue(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},BD=function(t,r,n,i,o){var s=r.props.children,u=Wr(s,pu).filter(function(l){return TK(i,o,l.props.direction)});if(u&&u.length){var f=u.map(function(l){return l.props.dataKey});return t.reduce(function(l,d){var p=Bt(d,n);if(Ue(p))return l;var m=Array.isArray(p)?[Ip(p),Mp(p)]:[p,p],g=f.reduce(function(b,y){var w=Bt(d,y,0),j=m[0]-Math.abs(Array.isArray(w)?w[0]:w),O=m[1]+Math.abs(Array.isArray(w)?w[1]:w);return[Math.min(j,b[0]),Math.max(O,b[1])]},[1/0,-1/0]);return[Math.min(g[0],l[0]),Math.max(g[1],l[1])]},[1/0,-1/0])}return null},kK=function(t,r,n,i,o){var s=r.map(function(u){return BD(t,u,n,o,i)}).filter(function(u){return!Ue(u)});return s&&s.length?s.reduce(function(u,f){return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]):null},FD=function(t,r,n,i,o){var s=r.map(function(f){var l=f.props.dataKey;return n==="number"&&l&&BD(t,f,l,i)||hc(t,l,n,o)});if(n==="number")return s.reduce(function(f,l){return[Math.min(f[0],l[0]),Math.max(f[1],l[1])]},[1/0,-1/0]);var u={};return s.reduce(function(f,l){for(var d=0,p=l.length;d=2?ur(u[0]-u[1])*2*l:l,r&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(p){var m=o?o.indexOf(p):p;return{coordinate:i(m)+l,value:p,offset:l}});return d.filter(function(p){return!su(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,m){return{coordinate:i(p)+l,value:p,index:m,offset:l}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(p){return{coordinate:i(p)+l,value:p,offset:l}}):i.domain().map(function(p,m){return{coordinate:i(p)+l,value:o?o[p]:p,index:m,offset:l}})},Wx=new WeakMap,Vf=function(t,r){if(typeof r!="function")return t;Wx.has(t)||Wx.set(t,new WeakMap);var n=Wx.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},UD=function(t,r,n){var i=t.scale,o=t.type,s=t.layout,u=t.axisType;if(i==="auto")return s==="radial"&&u==="radiusAxis"?{scale:Cc(),realScaleType:"band"}:s==="radial"&&u==="angleAxis"?{scale:xh(),realScaleType:"linear"}:o==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:dc(),realScaleType:"point"}:o==="category"?{scale:Cc(),realScaleType:"band"}:{scale:xh(),realScaleType:"linear"};if(Ho(i)){var f="scale".concat(xp(i));return{scale:(KC[f]||dc)(),realScaleType:KC[f]?f:"point"}}return ze(i)?{scale:i}:{scale:dc(),realScaleType:"point"}},uN=1e-4,WD=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),o=Math.min(i[0],i[1])-uN,s=Math.max(i[0],i[1])+uN,u=t(r[0]),f=t(r[n-1]);(us||fs)&&t.domain([r[0],r[n-1]])}},RK=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(o[1]=i),o[0]>i&&(o[0]=i),o[1]=0?(t[u][n][0]=o,t[u][n][1]=o+f,o=t[u][n][1]):(t[u][n][0]=s,t[u][n][1]=s+f,s=t[u][n][1])}},DK=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[s][n][0]=o,t[s][n][1]=o+u,o=t[s][n][1]):(t[s][n][0]=0,t[s][n][1]=0)}},LK={sign:IK,expand:j9,none:ds,silhouette:O9,wiggle:E9,positive:DK},$K=function(t,r,n){var i=r.map(function(u){return u.props.dataKey}),o=LK[n],s=_9().keys(i).value(function(u,f){return+Bt(u,f,0)}).order(Zb).offset(o);return s(t)},BK=function(t,r,n,i,o,s){if(!t)return null;var u=s?r.reverse():r,f={},l=u.reduce(function(p,m){var g,b=(g=m.type)!==null&&g!==void 0&&g.defaultProps?Pt(Pt({},m.type.defaultProps),m.props):m.props,y=b.stackId,w=b.hide;if(w)return p;var j=b[n],O=p[j]||{hasStack:!1,stackGroups:{}};if(Ft(y)){var E=O.stackGroups[y]||{numericAxisId:n,cateAxisId:i,items:[]};E.items.push(m),O.hasStack=!0,O.stackGroups[y]=E}else O.stackGroups[Hs("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[m]};return Pt(Pt({},p),{},is({},j,O))},f),d={};return Object.keys(l).reduce(function(p,m){var g=l[m];if(g.hasStack){var b={};g.stackGroups=Object.keys(g.stackGroups).reduce(function(y,w){var j=g.stackGroups[w];return Pt(Pt({},y),{},is({},w,{numericAxisId:n,cateAxisId:i,items:j.items,stackedData:$K(t,j.items,o)}))},b)}return Pt(Pt({},p),{},is({},m,g))},d)},HD=function(t,r){var n=r.realScaleType,i=r.type,o=r.tickCount,s=r.originalDomain,u=r.allowDecimals,f=n||r.scale;if(f!=="auto"&&f!=="linear")return null;if(o&&i==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var l=t.domain();if(!l.length)return null;var d=JG(l,o,u);return t.domain([Ip(d),Mp(d)]),{niceTicks:d}}if(o&&i==="number"){var p=t.domain(),m=eK(p,o,u);return{niceTicks:m}}return null};function fN(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,o=e.index,s=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ue(i[t.dataKey])){var u=Jd(r,"value",i[t.dataKey]);if(u)return u.coordinate+n/2}return r[o]?r[o].coordinate+n/2:null}var f=Bt(i,Ue(s)?t.dataKey:s);return Ue(f)?null:t.scale(f)}var dN=function(t){var r=t.axis,n=t.ticks,i=t.offset,o=t.bandSize,s=t.entry,u=t.index;if(r.type==="category")return n[u]?n[u].coordinate+i:null;var f=Bt(s,r.dataKey,r.domain[u]);return Ue(f)?null:r.scale(f)-o/2+i},FK=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),o=Math.max(n[0],n[1]);return i<=0&&o>=0?0:o<0?o:i}return n[0]},zK=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Pt(Pt({},t.type.defaultProps),t.props):t.props,o=i.stackId;if(Ft(o)){var s=r[o];if(s){var u=s.items.indexOf(t);return u>=0?s.stackedData[u]:null}}return null},qK=function(t){return t.reduce(function(r,n){return[Ip(n.concat([r[0]]).filter(ge)),Mp(n.concat([r[1]]).filter(ge))]},[1/0,-1/0])},VD=function(t,r,n){return Object.keys(t).reduce(function(i,o){var s=t[o],u=s.stackedData,f=u.reduce(function(l,d){var p=qK(d.slice(r,n+1));return[Math.min(l[0],p[0]),Math.max(l[1],p[1])]},[1/0,-1/0]);return[Math.min(f[0],i[0]),Math.max(f[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},hN=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,pN=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,_1=function(t,r,n){if(ze(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(ge(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(hN.test(t[0])){var o=+hN.exec(t[0])[1];i[0]=r[0]-o}else ze(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(ge(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(pN.test(t[1])){var s=+pN.exec(t[1])[1];i[1]=r[1]+s}else ze(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},Eh=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var o=iS(r,function(p){return p.coordinate}),s=1/0,u=1,f=o.length;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},QK=function(t,r,n,i,o){var s=t.width,u=t.height,f=t.startAngle,l=t.endAngle,d=fr(t.cx,s,s/2),p=fr(t.cy,u,u/2),m=XD(s,u,n),g=fr(t.innerRadius,m,0),b=fr(t.outerRadius,m,m*.8),y=Object.keys(r);return y.reduce(function(w,j){var O=r[j],E=O.domain,N=O.reversed,A;if(Ue(O.range))i==="angleAxis"?A=[f,l]:i==="radiusAxis"&&(A=[g,b]),N&&(A=[A[1],A[0]]);else{A=O.range;var C=A,T=HK(C,2);f=T[0],l=T[1]}var R=UD(O,o),I=R.realScaleType,z=R.scale;z.domain(E).range(A),WD(z);var $=HD(z,mi(mi({},O),{},{realScaleType:I})),L=mi(mi(mi({},O),$),{},{range:A,radius:b,realScaleType:I,scale:z,cx:d,cy:p,innerRadius:g,outerRadius:b,startAngle:f,endAngle:l});return mi(mi({},w),{},KD({},j,L))},{})},ZK=function(t,r){var n=t.x,i=t.y,o=r.x,s=r.y;return Math.sqrt(Math.pow(n-o,2)+Math.pow(i-s,2))},JK=function(t,r){var n=t.x,i=t.y,o=r.cx,s=r.cy,u=ZK({x:n,y:i},{x:o,y:s});if(u<=0)return{radius:u};var f=(n-o)/u,l=Math.acos(f);return i>s&&(l=2*Math.PI-l),{radius:u,angle:YK(l),angleInRadian:l}},eX=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),o=Math.floor(n/360),s=Math.min(i,o);return{startAngle:r-s*360,endAngle:n-s*360}},tX=function(t,r){var n=r.startAngle,i=r.endAngle,o=Math.floor(n/360),s=Math.floor(i/360),u=Math.min(o,s);return t+u*360},yN=function(t,r){var n=t.x,i=t.y,o=JK({x:n,y:i},r),s=o.radius,u=o.angle,f=r.innerRadius,l=r.outerRadius;if(sl)return!1;if(s===0)return!0;var d=eX(r),p=d.startAngle,m=d.endAngle,g=u,b;if(p<=m){for(;g>m;)g-=360;for(;g=p&&g<=m}else{for(;g>p;)g-=360;for(;g=m&&g<=p}return b?mi(mi({},r),{},{radius:s,angle:tX(g,r)}):null},YD=function(t){return!_.isValidElement(t)&&!ze(t)&&typeof t!="boolean"?t.className:""};function Bc(e){"@babel/helpers - typeof";return Bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bc(e)}var rX=["offset"];function nX(e){return sX(e)||aX(e)||oX(e)||iX()}function iX(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oX(e,t){if(e){if(typeof e=="string")return j1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j1(e,t)}}function aX(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function sX(e){if(Array.isArray(e))return j1(e)}function j1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function cX(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 xN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $t(e){for(var t=1;t=0?1:-1,E,N;i==="insideStart"?(E=g+O*s,N=y):i==="insideEnd"?(E=b-O*s,N=!y):i==="end"&&(E=b+O*s,N=y),N=j<=0?N:!N;var A=mt(l,d,w,E),C=mt(l,d,w,E+(N?1:-1)*359),T="M".concat(A.x,",").concat(A.y,` + A`).concat(w,",").concat(w,",0,1,").concat(N?0:1,`, + `).concat(C.x,",").concat(C.y),R=Ue(t.id)?Hs("recharts-radial-line-"):t.id;return F.createElement("text",Fc({},n,{dominantBaseline:"central",className:We("recharts-radial-bar-label",u)}),F.createElement("defs",null,F.createElement("path",{id:R,d:T})),F.createElement("textPath",{xlinkHref:"#".concat(R)},r))},vX=function(t){var r=t.viewBox,n=t.offset,i=t.position,o=r,s=o.cx,u=o.cy,f=o.innerRadius,l=o.outerRadius,d=o.startAngle,p=o.endAngle,m=(d+p)/2;if(i==="outside"){var g=mt(s,u,l+n,m),b=g.x,y=g.y;return{x:b,y,textAnchor:b>=s?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:s,y:u,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:s,y:u,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:s,y:u,textAnchor:"middle",verticalAnchor:"end"};var w=(f+l)/2,j=mt(s,u,w,m),O=j.x,E=j.y;return{x:O,y:E,textAnchor:"middle",verticalAnchor:"middle"}},gX=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,o=t.position,s=r,u=s.x,f=s.y,l=s.width,d=s.height,p=d>=0?1:-1,m=p*i,g=p>0?"end":"start",b=p>0?"start":"end",y=l>=0?1:-1,w=y*i,j=y>0?"end":"start",O=y>0?"start":"end";if(o==="top"){var E={x:u+l/2,y:f-p*i,textAnchor:"middle",verticalAnchor:g};return $t($t({},E),n?{height:Math.max(f-n.y,0),width:l}:{})}if(o==="bottom"){var N={x:u+l/2,y:f+d+m,textAnchor:"middle",verticalAnchor:b};return $t($t({},N),n?{height:Math.max(n.y+n.height-(f+d),0),width:l}:{})}if(o==="left"){var A={x:u-w,y:f+d/2,textAnchor:j,verticalAnchor:"middle"};return $t($t({},A),n?{width:Math.max(A.x-n.x,0),height:d}:{})}if(o==="right"){var C={x:u+l+w,y:f+d/2,textAnchor:O,verticalAnchor:"middle"};return $t($t({},C),n?{width:Math.max(n.x+n.width-C.x,0),height:d}:{})}var T=n?{width:l,height:d}:{};return o==="insideLeft"?$t({x:u+w,y:f+d/2,textAnchor:O,verticalAnchor:"middle"},T):o==="insideRight"?$t({x:u+l-w,y:f+d/2,textAnchor:j,verticalAnchor:"middle"},T):o==="insideTop"?$t({x:u+l/2,y:f+m,textAnchor:"middle",verticalAnchor:b},T):o==="insideBottom"?$t({x:u+l/2,y:f+d-m,textAnchor:"middle",verticalAnchor:g},T):o==="insideTopLeft"?$t({x:u+w,y:f+m,textAnchor:O,verticalAnchor:b},T):o==="insideTopRight"?$t({x:u+l-w,y:f+m,textAnchor:j,verticalAnchor:b},T):o==="insideBottomLeft"?$t({x:u+w,y:f+d-m,textAnchor:O,verticalAnchor:g},T):o==="insideBottomRight"?$t({x:u+l-w,y:f+d-m,textAnchor:j,verticalAnchor:g},T):Ws(o)&&(ge(o.x)||$o(o.x))&&(ge(o.y)||$o(o.y))?$t({x:u+fr(o.x,l),y:f+fr(o.y,d),textAnchor:"end",verticalAnchor:"end"},T):$t({x:u+l/2,y:f+d/2,textAnchor:"middle",verticalAnchor:"middle"},T)},yX=function(t){return"cx"in t&&ge(t.cx)};function Vt(e){var t=e.offset,r=t===void 0?5:t,n=lX(e,rX),i=$t({offset:r},n),o=i.viewBox,s=i.position,u=i.value,f=i.children,l=i.content,d=i.className,p=d===void 0?"":d,m=i.textBreakAll;if(!o||Ue(u)&&Ue(f)&&!_.isValidElement(l)&&!ze(l))return null;if(_.isValidElement(l))return _.cloneElement(l,i);var g;if(ze(l)){if(g=_.createElement(l,i),_.isValidElement(g))return g}else g=hX(i);var b=yX(o),y=Le(i,!0);if(b&&(s==="insideStart"||s==="insideEnd"||s==="end"))return mX(i,g,y);var w=b?vX(i):gX(i);return F.createElement(Go,Fc({className:We("recharts-label",p)},y,w,{breakAll:m}),g)}Vt.displayName="Label";var QD=function(t){var r=t.cx,n=t.cy,i=t.angle,o=t.startAngle,s=t.endAngle,u=t.r,f=t.radius,l=t.innerRadius,d=t.outerRadius,p=t.x,m=t.y,g=t.top,b=t.left,y=t.width,w=t.height,j=t.clockWise,O=t.labelViewBox;if(O)return O;if(ge(y)&&ge(w)){if(ge(p)&&ge(m))return{x:p,y:m,width:y,height:w};if(ge(g)&&ge(b))return{x:g,y:b,width:y,height:w}}return ge(p)&&ge(m)?{x:p,y:m,width:0,height:0}:ge(r)&&ge(n)?{cx:r,cy:n,startAngle:o||i||0,endAngle:s||i||0,innerRadius:l||0,outerRadius:d||f||u||0,clockWise:j}:t.viewBox?t.viewBox:{}},xX=function(t,r){return t?t===!0?F.createElement(Vt,{key:"label-implicit",viewBox:r}):Ft(t)?F.createElement(Vt,{key:"label-implicit",viewBox:r,value:t}):_.isValidElement(t)?t.type===Vt?_.cloneElement(t,{key:"label-implicit",viewBox:r}):F.createElement(Vt,{key:"label-implicit",content:t,viewBox:r}):ze(t)?F.createElement(Vt,{key:"label-implicit",content:t,viewBox:r}):Ws(t)?F.createElement(Vt,Fc({viewBox:r},t,{key:"label-implicit"})):null:null},bX=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,o=QD(t),s=Wr(i,Vt).map(function(f,l){return _.cloneElement(f,{viewBox:r||o,key:"label-".concat(l)})});if(!n)return s;var u=xX(t.label,r||o);return[u].concat(nX(s))};Vt.parseViewBox=QD;Vt.renderCallByParent=bX;var Hx,bN;function wX(){if(bN)return Hx;bN=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return Hx=e,Hx}var SX=wX();const _X=ot(SX);function zc(e){"@babel/helpers - typeof";return zc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zc(e)}var jX=["valueAccessor"],OX=["data","dataKey","clockWise","id","textBreakAll"];function EX(e){return NX(e)||CX(e)||AX(e)||PX()}function PX(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AX(e,t){if(e){if(typeof e=="string")return O1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return O1(e,t)}}function CX(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function NX(e){if(Array.isArray(e))return O1(e)}function O1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function MX(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}var IX=function(t){return Array.isArray(t.value)?_X(t.value):t.value};function wi(e){var t=e.valueAccessor,r=t===void 0?IX:t,n=_N(e,jX),i=n.data,o=n.dataKey,s=n.clockWise,u=n.id,f=n.textBreakAll,l=_N(n,OX);return!i||!i.length?null:F.createElement(rt,{className:"recharts-label-list"},i.map(function(d,p){var m=Ue(o)?r(d,p):Bt(d&&d.payload,o),g=Ue(u)?{}:{id:"".concat(u,"-").concat(p)};return F.createElement(Vt,Ah({},Le(d,!0),l,g,{parentViewBox:d.parentViewBox,value:m,textBreakAll:f,viewBox:Vt.parseViewBox(Ue(s)?d:SN(SN({},d),{},{clockWise:s})),key:"label-".concat(p),index:p}))}))}wi.displayName="LabelList";function DX(e,t){return e?e===!0?F.createElement(wi,{key:"labelList-implicit",data:t}):F.isValidElement(e)||ze(e)?F.createElement(wi,{key:"labelList-implicit",data:t,content:e}):Ws(e)?F.createElement(wi,Ah({data:t},e,{key:"labelList-implicit"})):null:null}function LX(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Wr(n,wi).map(function(s,u){return _.cloneElement(s,{data:t,key:"labelList-".concat(u)})});if(!r)return i;var o=DX(e.label,t);return[o].concat(EX(i))}wi.renderCallByParent=LX;function qc(e){"@babel/helpers - typeof";return qc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qc(e)}function E1(){return E1=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(s>l),`, + `).concat(p.x,",").concat(p.y,` + `);if(i>0){var g=mt(r,n,i,s),b=mt(r,n,i,l);m+="L ".concat(b.x,",").concat(b.y,` + A `).concat(i,",").concat(i,`,0, + `).concat(+(Math.abs(f)>180),",").concat(+(s<=l),`, + `).concat(g.x,",").concat(g.y," Z")}else m+="L ".concat(r,",").concat(n," Z");return m},qX=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,o=t.outerRadius,s=t.cornerRadius,u=t.forceCornerRadius,f=t.cornerIsExternal,l=t.startAngle,d=t.endAngle,p=ur(d-l),m=Gf({cx:r,cy:n,radius:o,angle:l,sign:p,cornerRadius:s,cornerIsExternal:f}),g=m.circleTangency,b=m.lineTangency,y=m.theta,w=Gf({cx:r,cy:n,radius:o,angle:d,sign:-p,cornerRadius:s,cornerIsExternal:f}),j=w.circleTangency,O=w.lineTangency,E=w.theta,N=f?Math.abs(l-d):Math.abs(l-d)-y-E;if(N<0)return u?"M ".concat(b.x,",").concat(b.y,` + a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0 + a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0 + `):ZD({cx:r,cy:n,innerRadius:i,outerRadius:o,startAngle:l,endAngle:d});var A="M ".concat(b.x,",").concat(b.y,` + A`).concat(s,",").concat(s,",0,0,").concat(+(p<0),",").concat(g.x,",").concat(g.y,` + A`).concat(o,",").concat(o,",0,").concat(+(N>180),",").concat(+(p<0),",").concat(j.x,",").concat(j.y,` + A`).concat(s,",").concat(s,",0,0,").concat(+(p<0),",").concat(O.x,",").concat(O.y,` + `);if(i>0){var C=Gf({cx:r,cy:n,radius:i,angle:l,sign:p,isExternal:!0,cornerRadius:s,cornerIsExternal:f}),T=C.circleTangency,R=C.lineTangency,I=C.theta,z=Gf({cx:r,cy:n,radius:i,angle:d,sign:-p,isExternal:!0,cornerRadius:s,cornerIsExternal:f}),$=z.circleTangency,L=z.lineTangency,U=z.theta,W=f?Math.abs(l-d):Math.abs(l-d)-I-U;if(W<0&&s===0)return"".concat(A,"L").concat(r,",").concat(n,"Z");A+="L".concat(L.x,",").concat(L.y,` + A`).concat(s,",").concat(s,",0,0,").concat(+(p<0),",").concat($.x,",").concat($.y,` + A`).concat(i,",").concat(i,",0,").concat(+(W>180),",").concat(+(p>0),",").concat(T.x,",").concat(T.y,` + A`).concat(s,",").concat(s,",0,0,").concat(+(p<0),",").concat(R.x,",").concat(R.y,"Z")}else A+="L".concat(r,",").concat(n,"Z");return A},UX={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},JD=function(t){var r=ON(ON({},UX),t),n=r.cx,i=r.cy,o=r.innerRadius,s=r.outerRadius,u=r.cornerRadius,f=r.forceCornerRadius,l=r.cornerIsExternal,d=r.startAngle,p=r.endAngle,m=r.className;if(s0&&Math.abs(d-p)<360?w=qX({cx:n,cy:i,innerRadius:o,outerRadius:s,cornerRadius:Math.min(y,b/2),forceCornerRadius:f,cornerIsExternal:l,startAngle:d,endAngle:p}):w=ZD({cx:n,cy:i,innerRadius:o,outerRadius:s,startAngle:d,endAngle:p}),F.createElement("path",E1({},Le(r,!0),{className:g,d:w,role:"img"}))};function Uc(e){"@babel/helpers - typeof";return Uc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uc(e)}function P1(){return P1=Object.assign?Object.assign.bind():function(e){for(var t=1;ttY.call(e,t));function ca(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const iY="__v",oY="__o",aY="_owner",{getOwnPropertyDescriptor:RN,keys:MN}=Object;function sY(e,t){return e.byteLength===t.byteLength&&Nh(new Uint8Array(e),new Uint8Array(t))}function lY(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function cY(e,t){return e.byteLength===t.byteLength&&Nh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function uY(e,t){return ca(e.getTime(),t.getTime())}function fY(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function dY(e,t){return e===t}function IN(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),o=e.entries();let s,u,f=0;for(;(s=o.next())&&!s.done;){const l=t.entries();let d=!1,p=0;for(;(u=l.next())&&!u.done;){if(i[p]){p++;continue}const m=s.value,g=u.value;if(r.equals(m[0],g[0],f,p,e,t,r)&&r.equals(m[1],g[1],m[0],g[0],e,t,r)){d=i[p]=!0;break}p++}if(!d)return!1;f++}return!0}const hY=ca;function pY(e,t,r){const n=MN(e);let i=n.length;if(MN(t).length!==i)return!1;for(;i-- >0;)if(!eL(e,t,r,n[i]))return!1;return!0}function Ql(e,t,r){const n=kN(e);let i=n.length;if(kN(t).length!==i)return!1;let o,s,u;for(;i-- >0;)if(o=n[i],!eL(e,t,r,o)||(s=RN(e,o),u=RN(t,o),(s||u)&&(!s||!u||s.configurable!==u.configurable||s.enumerable!==u.enumerable||s.writable!==u.writable)))return!1;return!0}function mY(e,t){return ca(e.valueOf(),t.valueOf())}function vY(e,t){return e.source===t.source&&e.flags===t.flags}function DN(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),o=e.values();let s,u;for(;(s=o.next())&&!s.done;){const f=t.values();let l=!1,d=0;for(;(u=f.next())&&!u.done;){if(!i[d]&&r.equals(s.value,u.value,s.value,u.value,e,t,r)){l=i[d]=!0;break}d++}if(!l)return!1}return!0}function Nh(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function gY(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function eL(e,t,r,n){return(n===aY||n===oY||n===iY)&&(e.$$typeof||t.$$typeof)?!0:nY(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const yY="[object ArrayBuffer]",xY="[object Arguments]",bY="[object Boolean]",wY="[object DataView]",SY="[object Date]",_Y="[object Error]",jY="[object Map]",OY="[object Number]",EY="[object Object]",PY="[object RegExp]",AY="[object Set]",CY="[object String]",NY={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},TY="[object URL]",kY=Object.prototype.toString;function RY({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:s,areNumbersEqual:u,areObjectsEqual:f,arePrimitiveWrappersEqual:l,areRegExpsEqual:d,areSetsEqual:p,areTypedArraysEqual:m,areUrlsEqual:g,unknownTagComparators:b}){return function(w,j,O){if(w===j)return!0;if(w==null||j==null)return!1;const E=typeof w;if(E!==typeof j)return!1;if(E!=="object")return E==="number"?u(w,j,O):E==="function"?o(w,j,O):!1;const N=w.constructor;if(N!==j.constructor)return!1;if(N===Object)return f(w,j,O);if(Array.isArray(w))return t(w,j,O);if(N===Date)return n(w,j,O);if(N===RegExp)return d(w,j,O);if(N===Map)return s(w,j,O);if(N===Set)return p(w,j,O);const A=kY.call(w);if(A===SY)return n(w,j,O);if(A===PY)return d(w,j,O);if(A===jY)return s(w,j,O);if(A===AY)return p(w,j,O);if(A===EY)return typeof w.then!="function"&&typeof j.then!="function"&&f(w,j,O);if(A===TY)return g(w,j,O);if(A===_Y)return i(w,j,O);if(A===xY)return f(w,j,O);if(NY[A])return m(w,j,O);if(A===yY)return e(w,j,O);if(A===wY)return r(w,j,O);if(A===bY||A===OY||A===CY)return l(w,j,O);if(b){let C=b[A];if(!C){const T=rY(w);T&&(C=b[T])}if(C)return C(w,j,O)}return!1}}function MY({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:sY,areArraysEqual:r?Ql:lY,areDataViewsEqual:cY,areDatesEqual:uY,areErrorsEqual:fY,areFunctionsEqual:dY,areMapsEqual:r?Xx(IN,Ql):IN,areNumbersEqual:hY,areObjectsEqual:r?Ql:pY,arePrimitiveWrappersEqual:mY,areRegExpsEqual:vY,areSetsEqual:r?Xx(DN,Ql):DN,areTypedArraysEqual:r?Xx(Nh,Ql):Nh,areUrlsEqual:gY,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const i=Xf(n.areArraysEqual),o=Xf(n.areMapsEqual),s=Xf(n.areObjectsEqual),u=Xf(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:u})}return n}function IY(e){return function(t,r,n,i,o,s,u){return e(t,r,u)}}function DY({circular:e,comparator:t,createState:r,equals:n,strict:i}){if(r)return function(u,f){const{cache:l=e?new WeakMap:void 0,meta:d}=r();return t(u,f,{cache:l,equals:n,meta:d,strict:i})};if(e)return function(u,f){return t(u,f,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const o={cache:void 0,equals:n,meta:void 0,strict:i};return function(u,f){return t(u,f,o)}}const LY=fo();fo({strict:!0});fo({circular:!0});fo({circular:!0,strict:!0});fo({createInternalComparator:()=>ca});fo({strict:!0,createInternalComparator:()=>ca});fo({circular:!0,createInternalComparator:()=>ca});fo({circular:!0,createInternalComparator:()=>ca,strict:!0});function fo(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:i=!1}=e,o=MY(e),s=RY(o),u=r?r(s):IY(s);return DY({circular:t,comparator:s,createState:n,equals:u,strict:i})}function $Y(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function LN(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(o){r<0&&(r=o),o-r>t?(e(o),r=-1):$Y(i)};requestAnimationFrame(n)}function A1(e){"@babel/helpers - typeof";return A1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A1(e)}function BY(e){return UY(e)||qY(e)||zY(e)||FY()}function FY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zY(e,t){if(e){if(typeof e=="string")return $N(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $N(e,t)}}function $N(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:j<0?0:j},y=function(j){for(var O=j>1?1:j,E=O,N=0;N<8;++N){var A=p(E)-O,C=g(E);if(Math.abs(A-O)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,o=i===void 0?8:i,s=t.dt,u=s===void 0?17:s,f=function(d,p,m){var g=-(d-p)*n,b=m*o,y=m+(g-b)*u/1e3,w=m*u/1e3+d;return Math.abs(w-p)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bQ(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o=0)&&(r[i]=e[i]);return r}function Yx(e){return jQ(e)||_Q(e)||SQ(e)||wQ()}function wQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SQ(e,t){if(e){if(typeof e=="string")return R1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return R1(e,t)}}function _Q(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function jQ(e){if(Array.isArray(e))return R1(e)}function R1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Rh(e){return Rh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Rh(e)}var Zn=(function(e){CQ(r,e);var t=NQ(r);function r(n,i){var o;OQ(this,r),o=t.call(this,n,i);var s=o.props,u=s.isActive,f=s.attributeName,l=s.from,d=s.to,p=s.steps,m=s.children,g=s.duration;if(o.handleStyleChange=o.handleStyleChange.bind(D1(o)),o.changeStyle=o.changeStyle.bind(D1(o)),!u||g<=0)return o.state={style:{}},typeof m=="function"&&(o.state={style:d}),I1(o);if(p&&p.length)o.state={style:p[0].style};else if(l){if(typeof m=="function")return o.state={style:l},I1(o);o.state={style:f?sc({},f,l):l}}else o.state={style:{}};return o}return PQ(r,[{key:"componentDidMount",value:function(){var i=this.props,o=i.isActive,s=i.canBegin;this.mounted=!0,!(!o||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var o=this.props,s=o.isActive,u=o.canBegin,f=o.attributeName,l=o.shouldReAnimate,d=o.to,p=o.from,m=this.state.style;if(u){if(!s){var g={style:f?sc({},f,d):d};this.state&&m&&(f&&m[f]!==d||!f&&m!==d)&&this.setState(g);return}if(!(LY(i.to,d)&&i.canBegin&&i.isActive)){var b=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var y=b||l?p:i.to;if(this.state&&m){var w={style:f?sc({},f,y):y};(f&&m[f]!==y||!f&&m!==y)&&this.setState(w)}this.runAnimation(wn(wn({},this.props),{},{from:y,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var o=this,s=i.from,u=i.to,f=i.duration,l=i.easing,d=i.begin,p=i.onAnimationEnd,m=i.onAnimationStart,g=gQ(s,u,aQ(l),f,this.changeStyle),b=function(){o.stopJSAnimation=g()};this.manager.start([m,d,b,f,p])}},{key:"runStepAnimation",value:function(i){var o=this,s=i.steps,u=i.begin,f=i.onAnimationStart,l=s[0],d=l.style,p=l.duration,m=p===void 0?0:p,g=function(y,w,j){if(j===0)return y;var O=w.duration,E=w.easing,N=E===void 0?"ease":E,A=w.style,C=w.properties,T=w.onAnimationEnd,R=j>0?s[j-1]:w,I=C||Object.keys(A);if(typeof N=="function"||N==="spring")return[].concat(Yx(y),[o.runJSAnimation.bind(o,{from:R.style,to:A,duration:O,easing:N}),O]);var z=zN(I,O,N),$=wn(wn(wn({},R.style),A),{},{transition:z});return[].concat(Yx(y),[$,O,T]).filter(KY)};return this.manager.start([f].concat(Yx(s.reduce(g,[d,Math.max(m,u)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=WY());var o=i.begin,s=i.duration,u=i.attributeName,f=i.to,l=i.easing,d=i.onAnimationStart,p=i.onAnimationEnd,m=i.steps,g=i.children,b=this.manager;if(this.unSubscribe=b.subscribe(this.handleStyleChange),typeof l=="function"||typeof g=="function"||l==="spring"){this.runJSAnimation(i);return}if(m.length>1){this.runStepAnimation(i);return}var y=u?sc({},u,f):f,w=zN(Object.keys(y),s,l);b.start([d,o,wn(wn({},y),{},{transition:w}),s,p])}},{key:"render",value:function(){var i=this.props,o=i.children;i.begin;var s=i.duration;i.attributeName,i.easing;var u=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var f=xQ(i,yQ),l=_.Children.count(o),d=this.state.style;if(typeof o=="function")return o(d);if(!u||l===0||s<=0)return o;var p=function(g){var b=g.props,y=b.style,w=y===void 0?{}:y,j=b.className,O=_.cloneElement(g,wn(wn({},f),{},{style:wn(wn({},w),d),className:j}));return O};return l===1?p(_.Children.only(o)):F.createElement("div",null,_.Children.map(o,function(m){return p(m)}))}}]),r})(_.PureComponent);Zn.displayName="Animate";Zn.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Zn.propTypes={from:st.oneOfType([st.object,st.string]),to:st.oneOfType([st.object,st.string]),attributeName:st.string,duration:st.number,begin:st.number,easing:st.oneOfType([st.string,st.func]),steps:st.arrayOf(st.shape({duration:st.number.isRequired,style:st.object.isRequired,easing:st.oneOfType([st.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),st.func]),properties:st.arrayOf("string"),onAnimationEnd:st.func})),children:st.oneOfType([st.node,st.func]),isActive:st.bool,canBegin:st.bool,onAnimationEnd:st.func,shouldReAnimate:st.bool,onAnimationStart:st.func,onAnimationReStart:st.func};function Vc(e){"@babel/helpers - typeof";return Vc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vc(e)}function Mh(){return Mh=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,f=n>=0?1:-1,l=i>=0&&n>=0||i<0&&n<0?1:0,d;if(s>0&&o instanceof Array){for(var p=[0,0,0,0],m=0,g=4;ms?s:o[m];d="M".concat(t,",").concat(r+u*p[0]),p[0]>0&&(d+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(l,",").concat(t+f*p[0],",").concat(r)),d+="L ".concat(t+n-f*p[1],",").concat(r),p[1]>0&&(d+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(l,`, + `).concat(t+n,",").concat(r+u*p[1])),d+="L ".concat(t+n,",").concat(r+i-u*p[2]),p[2]>0&&(d+="A ".concat(p[2],",").concat(p[2],",0,0,").concat(l,`, + `).concat(t+n-f*p[2],",").concat(r+i)),d+="L ".concat(t+f*p[3],",").concat(r+i),p[3]>0&&(d+="A ".concat(p[3],",").concat(p[3],",0,0,").concat(l,`, + `).concat(t,",").concat(r+i-u*p[3])),d+="Z"}else if(s>0&&o===+o&&o>0){var b=Math.min(s,o);d="M ".concat(t,",").concat(r+u*b,` + A `).concat(b,",").concat(b,",0,0,").concat(l,",").concat(t+f*b,",").concat(r,` + L `).concat(t+n-f*b,",").concat(r,` + A `).concat(b,",").concat(b,",0,0,").concat(l,",").concat(t+n,",").concat(r+u*b,` + L `).concat(t+n,",").concat(r+i-u*b,` + A `).concat(b,",").concat(b,",0,0,").concat(l,",").concat(t+n-f*b,",").concat(r+i,` + L `).concat(t+f*b,",").concat(r+i,` + A `).concat(b,",").concat(b,",0,0,").concat(l,",").concat(t,",").concat(r+i-u*b," Z")}else d="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return d},FQ=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,o=r.x,s=r.y,u=r.width,f=r.height;if(Math.abs(u)>0&&Math.abs(f)>0){var l=Math.min(o,o+u),d=Math.max(o,o+u),p=Math.min(s,s+f),m=Math.max(s,s+f);return n>=l&&n<=d&&i>=p&&i<=m}return!1},zQ={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},TS=function(t){var r=XN(XN({},zQ),t),n=_.useRef(),i=_.useState(-1),o=kQ(i,2),s=o[0],u=o[1];_.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var N=n.current.getTotalLength();N&&u(N)}catch{}},[]);var f=r.x,l=r.y,d=r.width,p=r.height,m=r.radius,g=r.className,b=r.animationEasing,y=r.animationDuration,w=r.animationBegin,j=r.isAnimationActive,O=r.isUpdateAnimationActive;if(f!==+f||l!==+l||d!==+d||p!==+p||d===0||p===0)return null;var E=We("recharts-rectangle",g);return O?F.createElement(Zn,{canBegin:s>0,from:{width:d,height:p,x:f,y:l},to:{width:d,height:p,x:f,y:l},duration:y,animationEasing:b,isActive:O},function(N){var A=N.width,C=N.height,T=N.x,R=N.y;return F.createElement(Zn,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:y,isActive:j,easing:b},F.createElement("path",Mh({},Le(r,!0),{className:E,d:YN(T,R,A,C,m),ref:n})))}):F.createElement("path",Mh({},Le(r,!0),{className:E,d:YN(f,l,d,p,m)}))},qQ=["points","className","baseLinePoints","connectNulls"];function Ya(){return Ya=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function WQ(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 QN(e){return KQ(e)||GQ(e)||VQ(e)||HQ()}function HQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VQ(e,t){if(e){if(typeof e=="string")return L1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return L1(e,t)}}function GQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function KQ(e){if(Array.isArray(e))return L1(e)}function L1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){ZN(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),ZN(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},mc=function(t,r){var n=XQ(t);r&&(n=[n.reduce(function(o,s){return[].concat(QN(o),QN(s))},[])]);var i=n.map(function(o){return o.reduce(function(s,u,f){return"".concat(s).concat(f===0?"M":"L").concat(u.x,",").concat(u.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},YQ=function(t,r,n){var i=mc(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(mc(r.reverse(),n).slice(1))},QQ=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,o=t.connectNulls,s=UQ(t,qQ);if(!r||!r.length)return null;var u=We("recharts-polygon",n);if(i&&i.length){var f=s.stroke&&s.stroke!=="none",l=YQ(r,i,o);return F.createElement("g",{className:u},F.createElement("path",Ya({},Le(s,!0),{fill:l.slice(-1)==="Z"?s.fill:"none",stroke:"none",d:l})),f?F.createElement("path",Ya({},Le(s,!0),{fill:"none",d:mc(r,o)})):null,f?F.createElement("path",Ya({},Le(s,!0),{fill:"none",d:mc(i,o)})):null)}var d=mc(r,o);return F.createElement("path",Ya({},Le(s,!0),{fill:d.slice(-1)==="Z"?s.fill:"none",className:u,d}))};function $1(){return $1=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function iZ(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}var oZ=function(t,r,n,i,o,s){return"M".concat(t,",").concat(o,"v").concat(i,"M").concat(s,",").concat(r,"h").concat(n)},aZ=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,o=i===void 0?0:i,s=t.top,u=s===void 0?0:s,f=t.left,l=f===void 0?0:f,d=t.width,p=d===void 0?0:d,m=t.height,g=m===void 0?0:m,b=t.className,y=nZ(t,ZQ),w=JQ({x:n,y:o,top:u,left:l,width:p,height:g},y);return!ge(n)||!ge(o)||!ge(p)||!ge(g)||!ge(u)||!ge(l)?null:F.createElement("path",B1({},Le(w,!0),{className:We("recharts-cross",b),d:oZ(n,o,p,g,u,l)}))},Qx,eT;function sZ(){if(eT)return Qx;eT=1;var e=Rp(),t=wD(),r=ri();function n(i,o){return i&&i.length?e(i,r(o,2),t):void 0}return Qx=n,Qx}var lZ=sZ();const cZ=ot(lZ);var Zx,tT;function uZ(){if(tT)return Zx;tT=1;var e=Rp(),t=ri(),r=SD();function n(i,o){return i&&i.length?e(i,t(o,2),r):void 0}return Zx=n,Zx}var fZ=uZ();const dZ=ot(fZ);var hZ=["cx","cy","angle","ticks","axisLine"],pZ=["ticks","tick","angle","tickFormatter","stroke"];function Ss(e){"@babel/helpers - typeof";return Ss=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ss(e)}function vc(){return vc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function mZ(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 vZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iT(e,t){for(var r=0;rsT?s=i==="outer"?"start":"end":o<-sT?s=i==="outer"?"end":"start":s="middle",s}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,o=n.cy,s=n.radius,u=n.axisLine,f=n.axisLineType,l=ko(ko({},Le(this.props,!1)),{},{fill:"none"},Le(u,!1));if(f==="circle")return F.createElement($p,Lo({className:"recharts-polar-angle-axis-line"},l,{cx:i,cy:o,r:s}));var d=this.props.ticks,p=d.map(function(m){return mt(i,o,s,m.coordinate)});return F.createElement(QQ,Lo({className:"recharts-polar-angle-axis-line"},l,{points:p}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,o=i.ticks,s=i.tick,u=i.tickLine,f=i.tickFormatter,l=i.stroke,d=Le(this.props,!1),p=Le(s,!1),m=ko(ko({},d),{},{fill:"none"},Le(u,!1)),g=o.map(function(b,y){var w=n.getTickLineCoord(b),j=n.getTickTextAnchor(b),O=ko(ko(ko({textAnchor:j},d),{},{stroke:"none",fill:l},p),{},{index:y,payload:b,x:w.x2,y:w.y2});return F.createElement(rt,Lo({className:We("recharts-polar-angle-axis-tick",YD(s)),key:"tick-".concat(b.coordinate)},Vo(n.props,b,y)),u&&F.createElement("line",Lo({className:"recharts-polar-angle-axis-tick-line"},m,w)),s&&t.renderTickItem(s,O,f?f(b.value,y):b.value))});return F.createElement(rt,{className:"recharts-polar-angle-axis-ticks"},g)}},{key:"render",value:function(){var n=this.props,i=n.ticks,o=n.radius,s=n.axisLine;return o<=0||!i||!i.length?null:F.createElement(rt,{className:We("recharts-polar-angle-axis",this.props.className)},s&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,o){var s;return F.isValidElement(n)?s=F.cloneElement(n,i):ze(n)?s=n(i):s=F.createElement(Go,Lo({},i,{className:"recharts-polar-angle-axis-tick-value"}),o),s}}])})(_.PureComponent);zp(qp,"displayName","PolarAngleAxis");zp(qp,"axisType","angleAxis");zp(qp,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var Jx,lT;function TZ(){if(lT)return Jx;lT=1;var e=wI(),t=e(Object.getPrototypeOf,Object);return Jx=t,Jx}var eb,cT;function kZ(){if(cT)return eb;cT=1;var e=Ai(),t=TZ(),r=Ci(),n="[object Object]",i=Function.prototype,o=Object.prototype,s=i.toString,u=o.hasOwnProperty,f=s.call(Object);function l(d){if(!r(d)||e(d)!=n)return!1;var p=t(d);if(p===null)return!0;var m=u.call(p,"constructor")&&p.constructor;return typeof m=="function"&&m instanceof m&&s.call(m)==f}return eb=l,eb}var RZ=kZ();const MZ=ot(RZ);var tb,uT;function IZ(){if(uT)return tb;uT=1;var e=Ai(),t=Ci(),r="[object Boolean]";function n(i){return i===!0||i===!1||t(i)&&e(i)==r}return tb=n,tb}var DZ=IZ();const LZ=ot(DZ);function Kc(e){"@babel/helpers - typeof";return Kc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kc(e)}function Lh(){return Lh=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:m,x:f,y:l},to:{upperWidth:d,lowerWidth:p,height:m,x:f,y:l},duration:y,animationEasing:b,isActive:j},function(E){var N=E.upperWidth,A=E.lowerWidth,C=E.height,T=E.x,R=E.y;return F.createElement(Zn,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:y,easing:b},F.createElement("path",Lh({},Le(r,!0),{className:O,d:pT(T,R,N,A,C),ref:n})))}):F.createElement("g",null,F.createElement("path",Lh({},Le(r,!0),{className:O,d:pT(f,l,d,p,m)})))},KZ=["option","shapeType","propTransformer","activeClassName","isActive"];function Xc(e){"@babel/helpers - typeof";return Xc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xc(e)}function XZ(e,t){if(e==null)return{};var r=YZ(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function YZ(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 mT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $h(e){for(var t=1;t0?Ur(E,"paddingAngle",0):0;if(A){var T=Fr(A.endAngle-A.startAngle,E.endAngle-E.startAngle),R=ht(ht({},E),{},{startAngle:O+C,endAngle:O+T(y)+C});w.push(R),O=R.endAngle}else{var I=E.endAngle,z=E.startAngle,$=Fr(0,I-z),L=$(y),U=ht(ht({},E),{},{startAngle:O+C,endAngle:O+L+C});w.push(U),O=U.endAngle}}),F.createElement(rt,null,n.renderSectorsStatically(w))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(o){if(!o.altKey)switch(o.key){case"ArrowLeft":{var s=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"ArrowRight":{var u=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[u].focus(),i.setState({sectorToFocus:u});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,o=n.isAnimationActive,s=this.state.prevSectors;return o&&i&&i.length&&(!s||!hu(s,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,o=i.hide,s=i.sectors,u=i.className,f=i.label,l=i.cx,d=i.cy,p=i.innerRadius,m=i.outerRadius,g=i.isAnimationActive,b=this.state.isAnimationFinished;if(o||!s||!s.length||!ge(l)||!ge(d)||!ge(p)||!ge(m))return null;var y=We("recharts-pie",u);return F.createElement(rt,{tabIndex:this.props.rootTabIndex,className:y,ref:function(j){n.pieRef=j}},this.renderSectors(),f&&this.renderLabels(s),Vt.renderCallByParent(this.props,null,!1),(!g||b)&&wi.renderCallByParent(this.props,s,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n=360?O:O-1)*f,N=w-O*g-E,A=i.reduce(function(R,I){var z=Bt(I,j,0);return R+(ge(z)?z:0)},0),C;if(A>0){var T;C=i.map(function(R,I){var z=Bt(R,j,0),$=Bt(R,d,I),L=(ge(z)?z:0)/A,U;I?U=T.endAngle+ur(y)*f*(z!==0?1:0):U=s;var W=U+ur(y)*((z!==0?g:0)+L*N),V=(U+W)/2,G=(b.innerRadius+b.outerRadius)/2,Y=[{name:$,value:z,payload:R,dataKey:j,type:m}],D=mt(b.cx,b.cy,G,V);return T=ht(ht(ht({percent:L,cornerRadius:o,name:$,tooltipPayload:Y,midAngle:V,middleRadius:G,tooltipPosition:D},R),b),{},{value:Bt(R,j),startAngle:U,endAngle:W,payload:R,paddingAngle:ur(y)*f}),T})}return ht(ht({},b),{},{sectors:C,data:i})});var rb,xT;function gJ(){if(xT)return rb;xT=1;var e=Math.ceil,t=Math.max;function r(n,i,o,s){for(var u=-1,f=t(e((i-n)/(o||1)),0),l=Array(f);f--;)l[s?f:++u]=n,n+=o;return l}return rb=r,rb}var nb,bT;function pL(){if(bT)return nb;bT=1;var e=LI(),t=1/0,r=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=e(i),i===t||i===-t){var o=i<0?-1:1;return o*r}return i===i?i:0}return nb=n,nb}var ib,wT;function yJ(){if(wT)return ib;wT=1;var e=gJ(),t=Op(),r=pL();function n(i){return function(o,s,u){return u&&typeof u!="number"&&t(o,s,u)&&(s=u=void 0),o=r(o),s===void 0?(s=o,o=0):s=r(s),u=u===void 0?o0&&n.handleDrag(i.changedTouches[0])}),Dr(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,o=i.endIndex,s=i.onDragEnd,u=i.startIndex;s?.({endIndex:o,startIndex:u})}),n.detachDragEndListener()}),Dr(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Dr(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Dr(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Dr(n,"handleSlideDragStart",function(i){var o=PT(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return NJ(t,e),EJ(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,o=n.endX,s=this.state.scaleValues,u=this.props,f=u.gap,l=u.data,d=l.length-1,p=Math.min(i,o),m=Math.max(i,o),g=t.getIndexInRange(s,p),b=t.getIndexInRange(s,m);return{startIndex:g-g%f,endIndex:b===d?d:b-b%f}}},{key:"getTextOfTick",value:function(n){var i=this.props,o=i.data,s=i.tickFormatter,u=i.dataKey,f=Bt(o[n],u,n);return ze(s)?s(f,n):f}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,o=i.slideMoveStartX,s=i.startX,u=i.endX,f=this.props,l=f.x,d=f.width,p=f.travellerWidth,m=f.startIndex,g=f.endIndex,b=f.onChange,y=n.pageX-o;y>0?y=Math.min(y,l+d-p-u,l+d-p-s):y<0&&(y=Math.max(y,l-s,l-u));var w=this.getIndex({startX:s+y,endX:u+y});(w.startIndex!==m||w.endIndex!==g)&&b&&b(w),this.setState({startX:s+y,endX:u+y,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var o=PT(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,o=i.brushMoveStartX,s=i.movingTravellerId,u=i.endX,f=i.startX,l=this.state[s],d=this.props,p=d.x,m=d.width,g=d.travellerWidth,b=d.onChange,y=d.gap,w=d.data,j={startX:this.state.startX,endX:this.state.endX},O=n.pageX-o;O>0?O=Math.min(O,p+m-g-l):O<0&&(O=Math.max(O,p-l)),j[s]=l+O;var E=this.getIndex(j),N=E.startIndex,A=E.endIndex,C=function(){var R=w.length-1;return s==="startX"&&(u>f?N%y===0:A%y===0)||uf?A%y===0:N%y===0)||u>f&&A===R};this.setState(Dr(Dr({},s,l+O),"brushMoveStartX",n.pageX),function(){b&&C()&&b(E)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var o=this,s=this.state,u=s.scaleValues,f=s.startX,l=s.endX,d=this.state[i],p=u.indexOf(d);if(p!==-1){var m=p+n;if(!(m===-1||m>=u.length)){var g=u[m];i==="startX"&&g>=l||i==="endX"&&g<=f||this.setState(Dr({},i,g),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,o=n.y,s=n.width,u=n.height,f=n.fill,l=n.stroke;return F.createElement("rect",{stroke:l,fill:f,x:i,y:o,width:s,height:u})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,o=n.y,s=n.width,u=n.height,f=n.data,l=n.children,d=n.padding,p=_.Children.only(l);return p?F.cloneElement(p,{x:i,y:o,width:s,height:u,margin:d,compact:!0,data:f}):null}},{key:"renderTravellerLayer",value:function(n,i){var o,s,u=this,f=this.props,l=f.y,d=f.travellerWidth,p=f.height,m=f.traveller,g=f.ariaLabel,b=f.data,y=f.startIndex,w=f.endIndex,j=Math.max(n,this.props.x),O=ab(ab({},Le(this.props,!1)),{},{x:j,y:l,width:d,height:p}),E=g||"Min value: ".concat((o=b[y])===null||o===void 0?void 0:o.name,", Max value: ").concat((s=b[w])===null||s===void 0?void 0:s.name);return F.createElement(rt,{tabIndex:0,role:"slider","aria-label":E,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(A){["ArrowLeft","ArrowRight"].includes(A.key)&&(A.preventDefault(),A.stopPropagation(),u.handleTravellerMoveKeyboard(A.key==="ArrowRight"?1:-1,i))},onFocus:function(){u.setState({isTravellerFocused:!0})},onBlur:function(){u.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(m,O))}},{key:"renderSlide",value:function(n,i){var o=this.props,s=o.y,u=o.height,f=o.stroke,l=o.travellerWidth,d=Math.min(n,i)+l,p=Math.max(Math.abs(i-n)-l,0);return F.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:f,fillOpacity:.2,x:d,y:s,width:p,height:u})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,o=n.endIndex,s=n.y,u=n.height,f=n.travellerWidth,l=n.stroke,d=this.state,p=d.startX,m=d.endX,g=5,b={pointerEvents:"none",fill:l};return F.createElement(rt,{className:"recharts-brush-texts"},F.createElement(Go,zh({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,m)-g,y:s+u/2},b),this.getTextOfTick(i)),F.createElement(Go,zh({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,m)+f+g,y:s+u/2},b),this.getTextOfTick(o)))}},{key:"render",value:function(){var n=this.props,i=n.data,o=n.className,s=n.children,u=n.x,f=n.y,l=n.width,d=n.height,p=n.alwaysShowText,m=this.state,g=m.startX,b=m.endX,y=m.isTextActive,w=m.isSlideMoving,j=m.isTravellerMoving,O=m.isTravellerFocused;if(!i||!i.length||!ge(u)||!ge(f)||!ge(l)||!ge(d)||l<=0||d<=0)return null;var E=We("recharts-brush",o),N=F.Children.count(s)===1,A=jJ("userSelect","none");return F.createElement(rt,{className:E,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:A},this.renderBackground(),N&&this.renderPanorama(),this.renderSlide(g,b),this.renderTravellerLayer(g,"startX"),this.renderTravellerLayer(b,"endX"),(y||w||j||O||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,o=n.y,s=n.width,u=n.height,f=n.stroke,l=Math.floor(o+u/2)-1;return F.createElement(F.Fragment,null,F.createElement("rect",{x:i,y:o,width:s,height:u,fill:f,stroke:"none"}),F.createElement("line",{x1:i+1,y1:l,x2:i+s-1,y2:l,fill:"none",stroke:"#fff"}),F.createElement("line",{x1:i+1,y1:l+2,x2:i+s-1,y2:l+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var o;return F.isValidElement(n)?o=F.cloneElement(n,i):ze(n)?o=n(i):o=t.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(n,i){var o=n.data,s=n.width,u=n.x,f=n.travellerWidth,l=n.updateId,d=n.startIndex,p=n.endIndex;if(o!==i.prevData||l!==i.prevUpdateId)return ab({prevData:o,prevTravellerWidth:f,prevUpdateId:l,prevX:u,prevWidth:s},o&&o.length?kJ({data:o,width:s,x:u,travellerWidth:f,startIndex:d,endIndex:p}):{scale:null,scaleValues:null});if(i.scale&&(s!==i.prevWidth||u!==i.prevX||f!==i.prevTravellerWidth)){i.scale.range([u,u+s-f]);var m=i.scale.domain().map(function(g){return i.scale(g)});return{prevData:o,prevTravellerWidth:f,prevUpdateId:l,prevX:u,prevWidth:s,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:m}}return null}},{key:"getIndexInRange",value:function(n,i){for(var o=n.length,s=0,u=o-1;u-s>1;){var f=Math.floor((s+u)/2);n[f]>i?u=f:s=f}return i>=n[u]?u:s}}])})(_.PureComponent);Dr(Es,"displayName","Brush");Dr(Es,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var sb,AT;function RJ(){if(AT)return sb;AT=1;var e=nS();function t(r,n){var i;return e(r,function(o,s,u){return i=n(o,s,u),!i}),!!i}return sb=t,sb}var lb,CT;function MJ(){if(CT)return lb;CT=1;var e=pI(),t=ri(),r=RJ(),n=Er(),i=Op();function o(s,u,f){var l=n(s)?e:r;return f&&i(s,u,f)&&(u=void 0),l(s,t(u,3))}return lb=o,lb}var IJ=MJ();const DJ=ot(IJ);var Kn=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},cb,NT;function LJ(){if(NT)return cb;NT=1;var e=kI();function t(r,n,i){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return cb=t,cb}var ub,TT;function $J(){if(TT)return ub;TT=1;var e=LJ(),t=NI(),r=ri();function n(i,o){var s={};return o=r(o,3),t(i,function(u,f,l){e(s,f,o(u,f,l))}),s}return ub=n,ub}var BJ=$J();const FJ=ot(BJ);var fb,kT;function zJ(){if(kT)return fb;kT=1;function e(t,r){for(var n=-1,i=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function YJ(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 QJ(e,t){var r=e.x,n=e.y,i=XJ(e,HJ),o="".concat(r),s=parseInt(o,10),u="".concat(n),f=parseInt(u,10),l="".concat(t.height||i.height),d=parseInt(l,10),p="".concat(t.width||i.width),m=parseInt(p,10);return Zl(Zl(Zl(Zl(Zl({},t),i),s?{x:s}:{}),f?{y:f}:{}),{},{height:d,width:m,name:t.name,radius:t.radius})}function DT(e){return F.createElement(fL,W1({shapeType:"rectangle",propTransformer:QJ,activeClassName:"recharts-active-bar"},e))}var ZJ=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var o=ge(n)||yq(n);return o?t(n,i):(o||Xo(),r)}},JJ=["value","background"],xL;function Ps(e){"@babel/helpers - typeof";return Ps=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ps(e)}function eee(e,t){if(e==null)return{};var r=tee(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function tee(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 Uh(){return Uh=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(V)0&&Math.abs(W)0&&(U=Math.min((te||0)-(W[ve-1]||0),U))}),Number.isFinite(U)){var V=U/L,G=y.layout==="vertical"?n.height:n.width;if(y.padding==="gap"&&(T=V*G/2),y.padding==="no-gap"){var Y=fr(t.barCategoryGap,V*G),D=V*G/2;T=D-Y-(D-Y)/G*Y}}}i==="xAxis"?R=[n.left+(E.left||0)+(T||0),n.left+n.width-(E.right||0)-(T||0)]:i==="yAxis"?R=f==="horizontal"?[n.top+n.height-(E.bottom||0),n.top+(E.top||0)]:[n.top+(E.top||0)+(T||0),n.top+n.height-(E.bottom||0)-(T||0)]:R=y.range,A&&(R=[R[1],R[0]]);var Q=UD(y,o,m),J=Q.scale,M=Q.realScaleType;J.domain(j).range(R),WD(J);var B=HD(J,Pn(Pn({},y),{},{realScaleType:M}));i==="xAxis"?($=w==="top"&&!N||w==="bottom"&&N,I=n.left,z=p[C]-$*y.height):i==="yAxis"&&($=w==="left"&&!N||w==="right"&&N,I=p[C]-$*y.width,z=n.top);var Z=Pn(Pn(Pn({},y),B),{},{realScaleType:M,x:I,y:z,scale:J,width:i==="xAxis"?n.width:y.width,height:i==="yAxis"?n.height:y.height});return Z.bandSize=Eh(Z,B),!y.hide&&i==="xAxis"?p[C]+=($?-1:1)*Z.height:y.hide||(p[C]+=($?-1:1)*Z.width),Pn(Pn({},g),{},Hp({},b,Z))},{})},jL=function(t,r){var n=t.x,i=t.y,o=r.x,s=r.y;return{x:Math.min(n,o),y:Math.min(i,s),width:Math.abs(o-n),height:Math.abs(s-i)}},dee=function(t){var r=t.x1,n=t.y1,i=t.x2,o=t.y2;return jL({x:r,y:n},{x:i,y:o})},OL=(function(){function e(t){cee(this,e),this.scale=t}return uee(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,o=n.position;if(r!==void 0){if(o)switch(o){case"start":return this.scale(r);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+s}case"end":{var u=this.bandwidth?this.bandwidth():0;return this.scale(r)+u}default:return this.scale(r)}if(i){var f=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+f}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],o=n[n.length-1];return i<=o?r>=i&&r<=o:r>=o&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])})();Hp(OL,"EPS",1e-4);var kS=function(t){var r=Object.keys(t).reduce(function(n,i){return Pn(Pn({},n),{},Hp({},i,OL.create(t[i])))},{});return Pn(Pn({},r),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.bandAware,u=o.position;return FJ(i,function(f,l){return r[l].apply(f,{bandAware:s,position:u})})},isInRange:function(i){return yL(i,function(o,s){return r[s].isInRange(o)})}})};function hee(e){return(e%180+180)%180}var pee=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=hee(i),s=o*Math.PI/180,u=Math.atan(n/r),f=s>u&&s-1?f[l?o[d]:d]:void 0}}return pb=n,pb}var mb,qT;function vee(){if(qT)return mb;qT=1;var e=pL();function t(r){var n=e(r),i=n%1;return n===n?i?n-i:n:0}return mb=t,mb}var vb,UT;function gee(){if(UT)return vb;UT=1;var e=OI(),t=ri(),r=vee(),n=Math.max;function i(o,s,u){var f=o==null?0:o.length;if(!f)return-1;var l=u==null?0:r(u);return l<0&&(l=n(f+l,0)),e(o,t(s,3),l)}return vb=i,vb}var gb,WT;function yee(){if(WT)return gb;WT=1;var e=mee(),t=gee(),r=e(t);return gb=r,gb}var xee=yee();const bee=ot(xee);var wee=zM();const See=ot(wee);var _ee=See(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),RS=_.createContext(void 0),MS=_.createContext(void 0),EL=_.createContext(void 0),PL=_.createContext({}),AL=_.createContext(void 0),CL=_.createContext(0),NL=_.createContext(0),HT=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,o=r.offset,s=t.clipPathId,u=t.children,f=t.width,l=t.height,d=_ee(o);return F.createElement(RS.Provider,{value:n},F.createElement(MS.Provider,{value:i},F.createElement(PL.Provider,{value:o},F.createElement(EL.Provider,{value:d},F.createElement(AL.Provider,{value:s},F.createElement(CL.Provider,{value:l},F.createElement(NL.Provider,{value:f},u)))))))},jee=function(){return _.useContext(AL)},TL=function(t){var r=_.useContext(RS);r==null&&Xo();var n=r[t];return n==null&&Xo(),n},Oee=function(){var t=_.useContext(RS);return to(t)},Eee=function(){var t=_.useContext(MS),r=bee(t,function(n){return yL(n.domain,Number.isFinite)});return r||to(t)},kL=function(t){var r=_.useContext(MS);r==null&&Xo();var n=r[t];return n==null&&Xo(),n},Pee=function(){var t=_.useContext(EL);return t},Aee=function(){return _.useContext(PL)},IS=function(){return _.useContext(NL)},DS=function(){return _.useContext(CL)};function As(e){"@babel/helpers - typeof";return As=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},As(e)}function Cee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nee(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var o=r();return e*(t-e*o/2-n)>=0&&e*(t+e*o/2-i)<=0}function fte(e,t){return BL(e,t+1)}function dte(e,t,r,n,i){for(var o=(n||[]).slice(),s=t.start,u=t.end,f=0,l=1,d=s,p=function(){var b=n?.[f];if(b===void 0)return{v:BL(n,l)};var y=f,w,j=function(){return w===void 0&&(w=r(b,y)),w},O=b.coordinate,E=f===0||Kh(e,O,j,d,u);E||(f=0,d=s,l+=1),E&&(d=O+e*(j()/2+i),f+=l)},m;l<=o.length;)if(m=p(),m)return m.v;return[]}function eu(e){"@babel/helpers - typeof";return eu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eu(e)}function JT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ir(e){for(var t=1;t0?g.coordinate-w*e:g.coordinate})}else o[m]=g=ir(ir({},g),{},{tickCoord:g.coordinate});var j=Kh(e,g.tickCoord,y,u,f);j&&(f=g.tickCoord-e*(y()/2+i),o[m]=ir(ir({},g),{},{isShow:!0}))},d=s-1;d>=0;d--)l(d);return o}function gte(e,t,r,n,i,o){var s=(n||[]).slice(),u=s.length,f=t.start,l=t.end;if(o){var d=n[u-1],p=r(d,u-1),m=e*(d.coordinate+e*p/2-l);s[u-1]=d=ir(ir({},d),{},{tickCoord:m>0?d.coordinate-m*e:d.coordinate});var g=Kh(e,d.tickCoord,function(){return p},f,l);g&&(l=d.tickCoord-e*(p/2+i),s[u-1]=ir(ir({},d),{},{isShow:!0}))}for(var b=o?u-1:u,y=function(O){var E=s[O],N,A=function(){return N===void 0&&(N=r(E,O)),N};if(O===0){var C=e*(E.coordinate-e*A()/2-f);s[O]=E=ir(ir({},E),{},{tickCoord:C<0?E.coordinate-C*e:E.coordinate})}else s[O]=E=ir(ir({},E),{},{tickCoord:E.coordinate});var T=Kh(e,E.tickCoord,A,f,l);T&&(f=E.tickCoord+e*(A()/2+i),s[O]=ir(ir({},E),{},{isShow:!0}))},w=0;w=2?ur(i[1].coordinate-i[0].coordinate):1,j=ute(o,w,g);return f==="equidistantPreserveStart"?dte(w,j,y,i,s):(f==="preserveStart"||f==="preserveStartEnd"?m=gte(w,j,y,i,s,f==="preserveStartEnd"):m=vte(w,j,y,i,s),m.filter(function(O){return O.isShow}))}var yte=["viewBox"],xte=["viewBox"],bte=["ticks"];function Ts(e){"@babel/helpers - typeof";return Ts=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ts(e)}function Za(){return Za=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function wte(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 Ste(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tk(e,t){for(var r=0;r0?f(this.props):f(g)),s<=0||u<=0||!b||!b.length?null:F.createElement(rt,{className:We("recharts-cartesian-axis",l),ref:function(w){n.layerReference=w}},o&&this.renderAxisLine(),this.renderTicks(b,this.state.fontSize,this.state.letterSpacing),Vt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,o){var s,u=We(i.className,"recharts-cartesian-axis-tick-value");return F.isValidElement(n)?s=F.cloneElement(n,Lt(Lt({},i),{},{className:u})):ze(n)?s=n(Lt(Lt({},i),{},{className:u})):s=F.createElement(Go,Za({},i,{className:"recharts-cartesian-axis-tick-value"}),o),s}}])})(_.Component);FS(Ys,"displayName","CartesianAxis");FS(Ys,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Cte=["x1","y1","x2","y2","key"],Nte=["offset"];function Yo(e){"@babel/helpers - typeof";return Yo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yo(e)}function rk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function or(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Mte(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}var Ite=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,i=t.x,o=t.y,s=t.width,u=t.height,f=t.ry;return F.createElement("rect",{x:i,y:o,ry:f,width:s,height:u,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function qL(e,t){var r;if(F.isValidElement(e))r=F.cloneElement(e,t);else if(ze(e))r=e(t);else{var n=t.x1,i=t.y1,o=t.x2,s=t.y2,u=t.key,f=nk(t,Cte),l=Le(f,!1);l.offset;var d=nk(l,Nte);r=F.createElement("line",zo({},d,{x1:n,y1:i,x2:o,y2:s,fill:"none",key:u}))}return r}function Dte(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,o=e.horizontalPoints;if(!i||!o||!o.length)return null;var s=o.map(function(u,f){var l=or(or({},e),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(f),index:f});return qL(i,l)});return F.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function Lte(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,o=e.verticalPoints;if(!i||!o||!o.length)return null;var s=o.map(function(u,f){var l=or(or({},e),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(f),index:f});return qL(i,l)});return F.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function $te(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,o=e.width,s=e.height,u=e.horizontalPoints,f=e.horizontal,l=f===void 0?!0:f;if(!l||!t||!t.length)return null;var d=u.map(function(m){return Math.round(m+i-i)}).sort(function(m,g){return m-g});i!==d[0]&&d.unshift(0);var p=d.map(function(m,g){var b=!d[g+1],y=b?i+s-m:d[g+1]-m;if(y<=0)return null;var w=g%t.length;return F.createElement("rect",{key:"react-".concat(g),y:m,x:n,height:y,width:o,stroke:"none",fill:t[w],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return F.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function Bte(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,o=e.x,s=e.y,u=e.width,f=e.height,l=e.verticalPoints;if(!r||!n||!n.length)return null;var d=l.map(function(m){return Math.round(m+o-o)}).sort(function(m,g){return m-g});o!==d[0]&&d.unshift(0);var p=d.map(function(m,g){var b=!d[g+1],y=b?o+u-m:d[g+1]-m;if(y<=0)return null;var w=g%n.length;return F.createElement("rect",{key:"react-".concat(g),x:m,y:s,width:y,height:f,stroke:"none",fill:n[w],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return F.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var Fte=function(t,r){var n=t.xAxis,i=t.width,o=t.height,s=t.offset;return qD(BS(or(or(or({},Ys.defaultProps),n),{},{ticks:yi(n,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.left,s.left+s.width,r)},zte=function(t,r){var n=t.yAxis,i=t.width,o=t.height,s=t.offset;return qD(BS(or(or(or({},Ys.defaultProps),n),{},{ticks:yi(n,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.top,s.top+s.height,r)},Ba={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Yh(e){var t,r,n,i,o,s,u=IS(),f=DS(),l=Aee(),d=or(or({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Ba.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Ba.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Ba.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:Ba.horizontalFill,vertical:(o=e.vertical)!==null&&o!==void 0?o:Ba.vertical,verticalFill:(s=e.verticalFill)!==null&&s!==void 0?s:Ba.verticalFill,x:ge(e.x)?e.x:l.left,y:ge(e.y)?e.y:l.top,width:ge(e.width)?e.width:l.width,height:ge(e.height)?e.height:l.height}),p=d.x,m=d.y,g=d.width,b=d.height,y=d.syncWithTicks,w=d.horizontalValues,j=d.verticalValues,O=Oee(),E=Eee();if(!ge(g)||g<=0||!ge(b)||b<=0||!ge(p)||p!==+p||!ge(m)||m!==+m)return null;var N=d.verticalCoordinatesGenerator||Fte,A=d.horizontalCoordinatesGenerator||zte,C=d.horizontalPoints,T=d.verticalPoints;if((!C||!C.length)&&ze(A)){var R=w&&w.length,I=A({yAxis:E?or(or({},E),{},{ticks:R?w:E.ticks}):void 0,width:u,height:f,offset:l},R?!0:y);Tn(Array.isArray(I),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Yo(I),"]")),Array.isArray(I)&&(C=I)}if((!T||!T.length)&&ze(N)){var z=j&&j.length,$=N({xAxis:O?or(or({},O),{},{ticks:z?j:O.ticks}):void 0,width:u,height:f,offset:l},z?!0:y);Tn(Array.isArray($),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Yo($),"]")),Array.isArray($)&&(T=$)}return F.createElement("g",{className:"recharts-cartesian-grid"},F.createElement(Ite,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),F.createElement(Dte,zo({},d,{offset:l,horizontalPoints:C,xAxis:O,yAxis:E})),F.createElement(Lte,zo({},d,{offset:l,verticalPoints:T,xAxis:O,yAxis:E})),F.createElement($te,zo({},d,{horizontalPoints:C})),F.createElement(Bte,zo({},d,{verticalPoints:T})))}Yh.displayName="CartesianGrid";var qte=["type","layout","connectNulls","ref"],Ute=["key"];function ks(e){"@babel/helpers - typeof";return ks=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ks(e)}function ik(e,t){if(e==null)return{};var r=Wte(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Wte(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 gc(){return gc=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rp){g=[].concat(Fa(f.slice(0,b)),[p-y]);break}var w=g.length%2===0?[0,m]:[m];return[].concat(Fa(t.repeat(f,d)),Fa(g),w).map(function(j){return"".concat(j,"px")}).join(", ")}),An(r,"id",Hs("recharts-line-")),An(r,"pathRef",function(s){r.mainCurve=s}),An(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),An(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return ere(t,e),Yte(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,s=o.points,u=o.xAxis,f=o.yAxis,l=o.layout,d=o.children,p=Wr(d,pu);if(!p)return null;var m=function(y,w){return{x:y.x,y:y.y,value:y.value,errorVal:Bt(y.payload,w)}},g={clipPath:n?"url(#clipPath-".concat(i,")"):null};return F.createElement(rt,g,p.map(function(b){return F.cloneElement(b,{key:"bar-".concat(b.props.dataKey),data:s,xAxis:u,yAxis:f,layout:l,dataPointFormatter:m})}))}},{key:"renderDots",value:function(n,i,o){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var u=this.props,f=u.dot,l=u.points,d=u.dataKey,p=Le(this.props,!1),m=Le(f,!0),g=l.map(function(y,w){var j=Ir(Ir(Ir({key:"dot-".concat(w),r:3},p),m),{},{index:w,cx:y.x,cy:y.y,value:y.value,dataKey:d,payload:y.payload,points:l});return t.renderDotItem(f,j)}),b={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return F.createElement(rt,gc({className:"recharts-line-dots",key:"dots"},b),g)}},{key:"renderCurveStatically",value:function(n,i,o,s){var u=this.props,f=u.type,l=u.layout,d=u.connectNulls;u.ref;var p=ik(u,qte),m=Ir(Ir(Ir({},Le(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:n},s),{},{type:f,layout:l,connectNulls:d});return F.createElement(Ch,gc({},m,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var o=this,s=this.props,u=s.points,f=s.strokeDasharray,l=s.isAnimationActive,d=s.animationBegin,p=s.animationDuration,m=s.animationEasing,g=s.animationId,b=s.animateNewValues,y=s.width,w=s.height,j=this.state,O=j.prevPoints,E=j.totalLength;return F.createElement(Zn,{begin:d,duration:p,isActive:l,easing:m,from:{t:0},to:{t:1},key:"line-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(N){var A=N.t;if(O){var C=O.length/u.length,T=u.map(function(L,U){var W=Math.floor(U*C);if(O[W]){var V=O[W],G=Fr(V.x,L.x),Y=Fr(V.y,L.y);return Ir(Ir({},L),{},{x:G(A),y:Y(A)})}if(b){var D=Fr(y*2,L.x),Q=Fr(w/2,L.y);return Ir(Ir({},L),{},{x:D(A),y:Q(A)})}return Ir(Ir({},L),{},{x:L.x,y:L.y})});return o.renderCurveStatically(T,n,i)}var R=Fr(0,E),I=R(A),z;if(f){var $="".concat(f).split(/[,\s]+/gim).map(function(L){return parseFloat(L)});z=o.getStrokeDasharray(I,E,$)}else z=o.generateSimpleStrokeDasharray(E,I);return o.renderCurveStatically(u,n,i,{strokeDasharray:z})})}},{key:"renderCurve",value:function(n,i){var o=this.props,s=o.points,u=o.isAnimationActive,f=this.state,l=f.prevPoints,d=f.totalLength;return u&&s&&s.length&&(!l&&d>0||!hu(l,s))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(s,n,i)}},{key:"render",value:function(){var n,i=this.props,o=i.hide,s=i.dot,u=i.points,f=i.className,l=i.xAxis,d=i.yAxis,p=i.top,m=i.left,g=i.width,b=i.height,y=i.isAnimationActive,w=i.id;if(o||!u||!u.length)return null;var j=this.state.isAnimationFinished,O=u.length===1,E=We("recharts-line",f),N=l&&l.allowDataOverflow,A=d&&d.allowDataOverflow,C=N||A,T=Ue(w)?this.id:w,R=(n=Le(s,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},I=R.r,z=I===void 0?3:I,$=R.strokeWidth,L=$===void 0?2:$,U=Nq(s)?s:{},W=U.clipDot,V=W===void 0?!0:W,G=z*2+L;return F.createElement(rt,{className:E},N||A?F.createElement("defs",null,F.createElement("clipPath",{id:"clipPath-".concat(T)},F.createElement("rect",{x:N?m:m-g/2,y:A?p:p-b/2,width:N?g:g*2,height:A?b:b*2})),!V&&F.createElement("clipPath",{id:"clipPath-dots-".concat(T)},F.createElement("rect",{x:m-G/2,y:p-G/2,width:g+G,height:b+G}))):null,!O&&this.renderCurve(C,T),this.renderErrorBar(C,T),(O||s)&&this.renderDots(C,V,T),(!y||j)&&wi.renderCallByParent(this.props,u))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var o=n.length%2!==0?[].concat(Fa(n),[0]):n,s=[],u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Wre(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 Hre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vre(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?s:t&&t.length&&ge(i)&&ge(o)?t.slice(i,o+1):[]};function n$(e){return e==="number"?[0,"auto"]:void 0}var cw=function(t,r,n,i){var o=t.graphicalItems,s=t.tooltipAxis,u=Yp(r,t);return n<0||!o||!o.length||n>=u.length?null:o.reduce(function(f,l){var d,p=(d=l.props.data)!==null&&d!==void 0?d:r;p&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(p=p.slice(t.dataStartIndex,t.dataEndIndex+1));var m;if(s.dataKey&&!s.allowDuplicatedCategory){var g=p===void 0?u:p;m=Jd(g,s.dataKey,i)}else m=p&&p[n]||u[n];return m?[].concat(Ds(f),[GD(l,m)]):f},[])},hk=function(t,r,n,i){var o=i||{x:t.chartX,y:t.chartY},s=ine(o,n),u=t.orderedTooltipTicks,f=t.tooltipAxis,l=t.tooltipTicks,d=PK(s,u,l,f);if(d>=0&&l){var p=l[d]&&l[d].value,m=cw(t,r,d,p),g=one(n,u,d,o);return{activeTooltipIndex:d,activeLabel:p,activePayload:m,activeCoordinate:g}}return null},ane=function(t,r){var n=r.axes,i=r.graphicalItems,o=r.axisType,s=r.axisIdKey,u=r.stackGroups,f=r.dataStartIndex,l=r.dataEndIndex,d=t.layout,p=t.children,m=t.stackOffset,g=zD(d,o);return n.reduce(function(b,y){var w,j=y.type.defaultProps!==void 0?ae(ae({},y.type.defaultProps),y.props):y.props,O=j.type,E=j.dataKey,N=j.allowDataOverflow,A=j.allowDuplicatedCategory,C=j.scale,T=j.ticks,R=j.includeHidden,I=j[s];if(b[I])return b;var z=Yp(t.data,{graphicalItems:i.filter(function(B){var Z,te=s in B.props?B.props[s]:(Z=B.type.defaultProps)===null||Z===void 0?void 0:Z[s];return te===I}),dataStartIndex:f,dataEndIndex:l}),$=z.length,L,U,W;kre(j.domain,N,O)&&(L=_1(j.domain,null,N),g&&(O==="number"||C!=="auto")&&(W=hc(z,E,"category")));var V=n$(O);if(!L||L.length===0){var G,Y=(G=j.domain)!==null&&G!==void 0?G:V;if(E){if(L=hc(z,E,O),O==="category"&&g){var D=bq(L);A&&D?(U=L,L=Fh(0,$)):A||(L=mN(Y,L,y).reduce(function(B,Z){return B.indexOf(Z)>=0?B:[].concat(Ds(B),[Z])},[]))}else if(O==="category")A?L=L.filter(function(B){return B!==""&&!Ue(B)}):L=mN(Y,L,y).reduce(function(B,Z){return B.indexOf(Z)>=0||Z===""||Ue(Z)?B:[].concat(Ds(B),[Z])},[]);else if(O==="number"){var Q=kK(z,i.filter(function(B){var Z,te,ve=s in B.props?B.props[s]:(Z=B.type.defaultProps)===null||Z===void 0?void 0:Z[s],xe="hide"in B.props?B.props.hide:(te=B.type.defaultProps)===null||te===void 0?void 0:te.hide;return ve===I&&(R||!xe)}),E,o,d);Q&&(L=Q)}g&&(O==="number"||C!=="auto")&&(W=hc(z,E,"category"))}else g?L=Fh(0,$):u&&u[I]&&u[I].hasStack&&O==="number"?L=m==="expand"?[0,1]:VD(u[I].stackGroups,f,l):L=FD(z,i.filter(function(B){var Z=s in B.props?B.props[s]:B.type.defaultProps[s],te="hide"in B.props?B.props.hide:B.type.defaultProps.hide;return Z===I&&(R||!te)}),O,d,!0);if(O==="number")L=aw(p,L,I,o,T),Y&&(L=_1(Y,L,N));else if(O==="category"&&Y){var J=Y,M=L.every(function(B){return J.indexOf(B)>=0});M&&(L=J)}}return ae(ae({},b),{},Be({},I,ae(ae({},j),{},{axisType:o,domain:L,categoricalDomain:W,duplicateDomain:U,originalDomain:(w=j.domain)!==null&&w!==void 0?w:V,isCategorical:g,layout:d})))},{})},sne=function(t,r){var n=r.graphicalItems,i=r.Axis,o=r.axisType,s=r.axisIdKey,u=r.stackGroups,f=r.dataStartIndex,l=r.dataEndIndex,d=t.layout,p=t.children,m=Yp(t.data,{graphicalItems:n,dataStartIndex:f,dataEndIndex:l}),g=m.length,b=zD(d,o),y=-1;return n.reduce(function(w,j){var O=j.type.defaultProps!==void 0?ae(ae({},j.type.defaultProps),j.props):j.props,E=O[s],N=n$("number");if(!w[E]){y++;var A;return b?A=Fh(0,g):u&&u[E]&&u[E].hasStack?(A=VD(u[E].stackGroups,f,l),A=aw(p,A,E,o)):(A=_1(N,FD(m,n.filter(function(C){var T,R,I=s in C.props?C.props[s]:(T=C.type.defaultProps)===null||T===void 0?void 0:T[s],z="hide"in C.props?C.props.hide:(R=C.type.defaultProps)===null||R===void 0?void 0:R.hide;return I===E&&!z}),"number",d),i.defaultProps.allowDataOverflow),A=aw(p,A,E,o)),ae(ae({},w),{},Be({},E,ae(ae({axisType:o},i.defaultProps),{},{hide:!0,orientation:Ur(rne,"".concat(o,".").concat(y%2),null),domain:A,originalDomain:N,isCategorical:b,layout:d})))}return w},{})},lne=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,o=r.AxisComp,s=r.graphicalItems,u=r.stackGroups,f=r.dataStartIndex,l=r.dataEndIndex,d=t.children,p="".concat(i,"Id"),m=Wr(d,o),g={};return m&&m.length?g=ane(t,{axes:m,graphicalItems:s,axisType:i,axisIdKey:p,stackGroups:u,dataStartIndex:f,dataEndIndex:l}):s&&s.length&&(g=sne(t,{Axis:o,graphicalItems:s,axisType:i,axisIdKey:p,stackGroups:u,dataStartIndex:f,dataEndIndex:l})),g},cne=function(t){var r=to(t),n=yi(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:iS(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Eh(r,n)}},pk=function(t){var r=t.children,n=t.defaultShowTooltip,i=Lr(r,Es),o=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!n}},une=function(t){return!t||!t.length?!1:t.some(function(r){var n=xi(r&&r.type);return n&&n.indexOf("Bar")>=0})},mk=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},fne=function(t,r){var n=t.props,i=t.graphicalItems,o=t.xAxisMap,s=o===void 0?{}:o,u=t.yAxisMap,f=u===void 0?{}:u,l=n.width,d=n.height,p=n.children,m=n.margin||{},g=Lr(p,Es),b=Lr(p,rs),y=Object.keys(f).reduce(function(A,C){var T=f[C],R=T.orientation;return!T.mirror&&!T.hide?ae(ae({},A),{},Be({},R,A[R]+T.width)):A},{left:m.left||0,right:m.right||0}),w=Object.keys(s).reduce(function(A,C){var T=s[C],R=T.orientation;return!T.mirror&&!T.hide?ae(ae({},A),{},Be({},R,Ur(A,"".concat(R))+T.height)):A},{top:m.top||0,bottom:m.bottom||0}),j=ae(ae({},w),y),O=j.bottom;g&&(j.bottom+=g.props.height||Es.defaultProps.height),b&&r&&(j=NK(j,i,n,r));var E=l-j.left-j.right,N=d-j.top-j.bottom;return ae(ae({brushBottom:O},j),{},{width:Math.max(E,0),height:Math.max(N,0)})},dne=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},zS=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,s=t.validateTooltipEventTypes,u=s===void 0?["axis"]:s,f=t.axisComponents,l=t.legendContent,d=t.formatAxisMap,p=t.defaultProps,m=function(j,O){var E=O.graphicalItems,N=O.stackGroups,A=O.offset,C=O.updateId,T=O.dataStartIndex,R=O.dataEndIndex,I=j.barSize,z=j.layout,$=j.barGap,L=j.barCategoryGap,U=j.maxBarSize,W=mk(z),V=W.numericAxisName,G=W.cateAxisName,Y=une(E),D=[];return E.forEach(function(Q,J){var M=Yp(j.data,{graphicalItems:[Q],dataStartIndex:T,dataEndIndex:R}),B=Q.type.defaultProps!==void 0?ae(ae({},Q.type.defaultProps),Q.props):Q.props,Z=B.dataKey,te=B.maxBarSize,ve=B["".concat(V,"Id")],xe=B["".concat(G,"Id")],X={},ue=f.reduce(function(Kt,Xt){var fa=O["".concat(Xt.axisType,"Map")],rl=B["".concat(Xt.axisType,"Id")];fa&&fa[rl]||Xt.axisType==="zAxis"||Xo();var nl=fa[rl];return ae(ae({},Kt),{},Be(Be({},Xt.axisType,nl),"".concat(Xt.axisType,"Ticks"),yi(nl)))},X),ie=ue[G],de=ue["".concat(G,"Ticks")],ye=N&&N[ve]&&N[ve].hasStack&&zK(Q,N[ve].stackGroups),oe=xi(Q.type).indexOf("Bar")>=0,$e=Eh(ie,de),Me=[],Ye=Y&&AK({barSize:I,stackGroups:N,totalSize:dne(ue,G)});if(oe){var lt,vt,vr=Ue(te)?U:te,Pr=(lt=(vt=Eh(ie,de,!0))!==null&&vt!==void 0?vt:vr)!==null&<!==void 0?lt:0;Me=CK({barGap:$,barCategoryGap:L,bandSize:Pr!==$e?Pr:$e,sizeList:Ye[xe],maxBarSize:vr}),Pr!==$e&&(Me=Me.map(function(Kt){return ae(ae({},Kt),{},{position:ae(ae({},Kt.position),{},{offset:Kt.position.offset-Pr/2})})}))}var Ar=Q&&Q.type&&Q.type.getComposedData;Ar&&D.push({props:ae(ae({},Ar(ae(ae({},ue),{},{displayedData:M,props:j,dataKey:Z,item:Q,bandSize:$e,barPosition:Me,offset:A,stackedData:ye,layout:z,dataStartIndex:T,dataEndIndex:R}))),{},Be(Be(Be({key:Q.key||"item-".concat(J)},V,ue[V]),G,ue[G]),"animationId",C)),childIndex:Rq(Q,j.children),item:Q})}),D},g=function(j,O){var E=j.props,N=j.dataStartIndex,A=j.dataEndIndex,C=j.updateId;if(!C2({props:E}))return null;var T=E.children,R=E.layout,I=E.stackOffset,z=E.data,$=E.reverseStackOrder,L=mk(R),U=L.numericAxisName,W=L.cateAxisName,V=Wr(T,n),G=BK(z,V,"".concat(U,"Id"),"".concat(W,"Id"),I,$),Y=f.reduce(function(B,Z){var te="".concat(Z.axisType,"Map");return ae(ae({},B),{},Be({},te,lne(E,ae(ae({},Z),{},{graphicalItems:V,stackGroups:Z.axisType===U&&G,dataStartIndex:N,dataEndIndex:A}))))},{}),D=fne(ae(ae({},Y),{},{props:E,graphicalItems:V}),O?.legendBBox);Object.keys(Y).forEach(function(B){Y[B]=d(E,Y[B],D,B.replace("Map",""),r)});var Q=Y["".concat(W,"Map")],J=cne(Q),M=m(E,ae(ae({},Y),{},{dataStartIndex:N,dataEndIndex:A,updateId:C,graphicalItems:V,stackGroups:G,offset:D}));return ae(ae({formattedGraphicalItems:M,graphicalItems:V,offset:D,stackGroups:G},J),Y)},b=(function(w){function j(O){var E,N,A;return Hre(this,j),A=Kre(this,j,[O]),Be(A,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Be(A,"accessibilityManager",new Tre),Be(A,"handleLegendBBoxUpdate",function(C){if(C){var T=A.state,R=T.dataStartIndex,I=T.dataEndIndex,z=T.updateId;A.setState(ae({legendBBox:C},g({props:A.props,dataStartIndex:R,dataEndIndex:I,updateId:z},ae(ae({},A.state),{},{legendBBox:C}))))}}),Be(A,"handleReceiveSyncEvent",function(C,T,R){if(A.props.syncId===C){if(R===A.eventEmitterSymbol&&typeof A.props.syncMethod!="function")return;A.applySyncEvent(T)}}),Be(A,"handleBrushChange",function(C){var T=C.startIndex,R=C.endIndex;if(T!==A.state.dataStartIndex||R!==A.state.dataEndIndex){var I=A.state.updateId;A.setState(function(){return ae({dataStartIndex:T,dataEndIndex:R},g({props:A.props,dataStartIndex:T,dataEndIndex:R,updateId:I},A.state))}),A.triggerSyncEvent({dataStartIndex:T,dataEndIndex:R})}}),Be(A,"handleMouseEnter",function(C){var T=A.getMouseInfo(C);if(T){var R=ae(ae({},T),{},{isTooltipActive:!0});A.setState(R),A.triggerSyncEvent(R);var I=A.props.onMouseEnter;ze(I)&&I(R,C)}}),Be(A,"triggeredAfterMouseMove",function(C){var T=A.getMouseInfo(C),R=T?ae(ae({},T),{},{isTooltipActive:!0}):{isTooltipActive:!1};A.setState(R),A.triggerSyncEvent(R);var I=A.props.onMouseMove;ze(I)&&I(R,C)}),Be(A,"handleItemMouseEnter",function(C){A.setState(function(){return{isTooltipActive:!0,activeItem:C,activePayload:C.tooltipPayload,activeCoordinate:C.tooltipPosition||{x:C.cx,y:C.cy}}})}),Be(A,"handleItemMouseLeave",function(){A.setState(function(){return{isTooltipActive:!1}})}),Be(A,"handleMouseMove",function(C){C.persist(),A.throttleTriggeredAfterMouseMove(C)}),Be(A,"handleMouseLeave",function(C){A.throttleTriggeredAfterMouseMove.cancel();var T={isTooltipActive:!1};A.setState(T),A.triggerSyncEvent(T);var R=A.props.onMouseLeave;ze(R)&&R(T,C)}),Be(A,"handleOuterEvent",function(C){var T=kq(C),R=Ur(A.props,"".concat(T));if(T&&ze(R)){var I,z;/.*touch.*/i.test(T)?z=A.getMouseInfo(C.changedTouches[0]):z=A.getMouseInfo(C),R((I=z)!==null&&I!==void 0?I:{},C)}}),Be(A,"handleClick",function(C){var T=A.getMouseInfo(C);if(T){var R=ae(ae({},T),{},{isTooltipActive:!0});A.setState(R),A.triggerSyncEvent(R);var I=A.props.onClick;ze(I)&&I(R,C)}}),Be(A,"handleMouseDown",function(C){var T=A.props.onMouseDown;if(ze(T)){var R=A.getMouseInfo(C);T(R,C)}}),Be(A,"handleMouseUp",function(C){var T=A.props.onMouseUp;if(ze(T)){var R=A.getMouseInfo(C);T(R,C)}}),Be(A,"handleTouchMove",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&A.throttleTriggeredAfterMouseMove(C.changedTouches[0])}),Be(A,"handleTouchStart",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&A.handleMouseDown(C.changedTouches[0])}),Be(A,"handleTouchEnd",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&A.handleMouseUp(C.changedTouches[0])}),Be(A,"handleDoubleClick",function(C){var T=A.props.onDoubleClick;if(ze(T)){var R=A.getMouseInfo(C);T(R,C)}}),Be(A,"handleContextMenu",function(C){var T=A.props.onContextMenu;if(ze(T)){var R=A.getMouseInfo(C);T(R,C)}}),Be(A,"triggerSyncEvent",function(C){A.props.syncId!==void 0&&bb.emit(wb,A.props.syncId,C,A.eventEmitterSymbol)}),Be(A,"applySyncEvent",function(C){var T=A.props,R=T.layout,I=T.syncMethod,z=A.state.updateId,$=C.dataStartIndex,L=C.dataEndIndex;if(C.dataStartIndex!==void 0||C.dataEndIndex!==void 0)A.setState(ae({dataStartIndex:$,dataEndIndex:L},g({props:A.props,dataStartIndex:$,dataEndIndex:L,updateId:z},A.state)));else if(C.activeTooltipIndex!==void 0){var U=C.chartX,W=C.chartY,V=C.activeTooltipIndex,G=A.state,Y=G.offset,D=G.tooltipTicks;if(!Y)return;if(typeof I=="function")V=I(D,C);else if(I==="value"){V=-1;for(var Q=0;Q=0){var ye,oe;if(U.dataKey&&!U.allowDuplicatedCategory){var $e=typeof U.dataKey=="function"?de:"payload.".concat(U.dataKey.toString());ye=Jd(Q,$e,V),oe=J&&M&&Jd(M,$e,V)}else ye=Q?.[W],oe=J&&M&&M[W];if(xe||ve){var Me=C.props.activeIndex!==void 0?C.props.activeIndex:W;return[_.cloneElement(C,ae(ae(ae({},I.props),ue),{},{activeIndex:Me})),null,null]}if(!Ue(ye))return[ie].concat(Ds(A.renderActivePoints({item:I,activePoint:ye,basePoint:oe,childIndex:W,isRange:J})))}else{var Ye,lt=(Ye=A.getItemByXY(A.state.activeCoordinate))!==null&&Ye!==void 0?Ye:{graphicalItem:ie},vt=lt.graphicalItem,vr=vt.item,Pr=vr===void 0?C:vr,Ar=vt.childIndex,Kt=ae(ae(ae({},I.props),ue),{},{activeIndex:Ar});return[_.cloneElement(Pr,Kt),null,null]}return J?[ie,null,null]:[ie,null]}),Be(A,"renderCustomized",function(C,T,R){return _.cloneElement(C,ae(ae({key:"recharts-customized-".concat(R)},A.props),A.state))}),Be(A,"renderMap",{CartesianGrid:{handler:Qf,once:!0},ReferenceArea:{handler:A.renderReferenceElement},ReferenceLine:{handler:Qf},ReferenceDot:{handler:A.renderReferenceElement},XAxis:{handler:Qf},YAxis:{handler:Qf},Brush:{handler:A.renderBrush,once:!0},Bar:{handler:A.renderGraphicChild},Line:{handler:A.renderGraphicChild},Area:{handler:A.renderGraphicChild},Radar:{handler:A.renderGraphicChild},RadialBar:{handler:A.renderGraphicChild},Scatter:{handler:A.renderGraphicChild},Pie:{handler:A.renderGraphicChild},Funnel:{handler:A.renderGraphicChild},Tooltip:{handler:A.renderCursor,once:!0},PolarGrid:{handler:A.renderPolarGrid,once:!0},PolarAngleAxis:{handler:A.renderPolarAxis},PolarRadiusAxis:{handler:A.renderPolarAxis},Customized:{handler:A.renderCustomized}}),A.clipPathId="".concat((E=O.id)!==null&&E!==void 0?E:Hs("recharts"),"-clip"),A.throttleTriggeredAfterMouseMove=$I(A.triggeredAfterMouseMove,(N=O.throttleDelay)!==null&&N!==void 0?N:1e3/60),A.state={},A}return Qre(j,w),Gre(j,[{key:"componentDidMount",value:function(){var E,N;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(E=this.props.margin.left)!==null&&E!==void 0?E:0,top:(N=this.props.margin.top)!==null&&N!==void 0?N:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var E=this.props,N=E.children,A=E.data,C=E.height,T=E.layout,R=Lr(N,Br);if(R){var I=R.props.defaultIndex;if(!(typeof I!="number"||I<0||I>this.state.tooltipTicks.length-1)){var z=this.state.tooltipTicks[I]&&this.state.tooltipTicks[I].value,$=cw(this.state,A,I,z),L=this.state.tooltipTicks[I].coordinate,U=(this.state.offset.top+C)/2,W=T==="horizontal",V=W?{x:L,y:U}:{y:L,x:U},G=this.state.formattedGraphicalItems.find(function(D){var Q=D.item;return Q.type.name==="Scatter"});G&&(V=ae(ae({},V),G.props.points[I].tooltipPosition),$=G.props.points[I].tooltipPayload);var Y={activeTooltipIndex:I,isTooltipActive:!0,activeLabel:z,activePayload:$,activeCoordinate:V};this.setState(Y),this.renderCursor(R),this.accessibilityManager.setIndex(I)}}}},{key:"getSnapshotBeforeUpdate",value:function(E,N){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==N.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==E.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==E.margin){var A,C;this.accessibilityManager.setDetails({offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0}})}return null}},{key:"componentDidUpdate",value:function(E){Hb([Lr(E.children,Br)],[Lr(this.props.children,Br)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var E=Lr(this.props.children,Br);if(E&&typeof E.props.shared=="boolean"){var N=E.props.shared?"axis":"item";return u.indexOf(N)>=0?N:o}return o}},{key:"getMouseInfo",value:function(E){if(!this.container)return null;var N=this.container,A=N.getBoundingClientRect(),C=xW(A),T={chartX:Math.round(E.pageX-C.left),chartY:Math.round(E.pageY-C.top)},R=A.width/N.offsetWidth||1,I=this.inRange(T.chartX,T.chartY,R);if(!I)return null;var z=this.state,$=z.xAxisMap,L=z.yAxisMap,U=this.getTooltipEventType(),W=hk(this.state,this.props.data,this.props.layout,I);if(U!=="axis"&&$&&L){var V=to($).scale,G=to(L).scale,Y=V&&V.invert?V.invert(T.chartX):null,D=G&&G.invert?G.invert(T.chartY):null;return ae(ae({},T),{},{xValue:Y,yValue:D},W)}return W?ae(ae({},T),W):null}},{key:"inRange",value:function(E,N){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,C=this.props.layout,T=E/A,R=N/A;if(C==="horizontal"||C==="vertical"){var I=this.state.offset,z=T>=I.left&&T<=I.left+I.width&&R>=I.top&&R<=I.top+I.height;return z?{x:T,y:R}:null}var $=this.state,L=$.angleAxisMap,U=$.radiusAxisMap;if(L&&U){var W=to(L);return yN({x:T,y:R},W)}return null}},{key:"parseEventsOfWrapper",value:function(){var E=this.props.children,N=this.getTooltipEventType(),A=Lr(E,Br),C={};A&&N==="axis"&&(A.props.trigger==="click"?C={onClick:this.handleClick}:C={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var T=eh(this.props,this.handleOuterEvent);return ae(ae({},T),C)}},{key:"addListener",value:function(){bb.on(wb,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){bb.removeListener(wb,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(E,N,A){for(var C=this.state.formattedGraphicalItems,T=0,R=C.length;Th.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg border border-gray-100 hover:bg-gray-100 transition-colors",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center text-blue-600 font-bold text-xs",children:e.template.substring(0,2)}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-semibold text-gray-900",children:e.product}),h.jsxs("p",{className:"text-xs text-gray-500",children:[e.id," • ",e.user]})]})]}),h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsx("span",{className:"text-xs text-gray-500 font-medium",children:e.time}),h.jsx(Cn,{variant:"secondary",className:e.status==="expired"?"bg-red-100 text-red-700":"bg-green-100 text-green-700",children:e.status})]})]},e.id))})})]})]}),h.jsx("div",{className:"space-y-6",children:h.jsxs($r,{className:"shadow-sm border-gray-200",children:[h.jsx(On,{children:h.jsxs(En,{className:"text-base font-bold text-gray-800 flex items-center gap-2",children:[h.jsx(Hd,{className:"w-5 h-5 text-gray-500"}),"By Category"]})}),h.jsxs(nn,{children:[h.jsxs("div",{className:"h-[200px] relative",children:[h.jsx(uh,{width:"100%",height:"100%",children:h.jsxs(pne,{children:[h.jsx(Ti,{data:_b,cx:"50%",cy:"50%",innerRadius:60,outerRadius:80,paddingAngle:5,dataKey:"value",children:_b.map((e,t)=>h.jsx(Ep,{fill:e.color},`cell-${t}`))}),h.jsx(Br,{})]})}),h.jsxs("div",{className:"absolute inset-0 flex items-center justify-center flex-col pointer-events-none",children:[h.jsx("span",{className:"text-2xl font-bold text-gray-900",children:"1000"}),h.jsx("span",{className:"text-xs text-gray-500",children:"Total"})]})]}),h.jsx("div",{className:"mt-4 space-y-2",children:_b.map(e=>h.jsxs("div",{className:"flex items-center justify-between text-sm",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:e.color}}),h.jsx("span",{className:"text-gray-600",children:e.name})]}),h.jsx("span",{className:"font-medium text-gray-900",children:e.value})]},e.name))})]})]})})]})]})}function za({title:e,value:t,trend:r,trendUp:n,icon:i,color:o,bgColor:s}){return h.jsx($r,{className:"border-gray-200 shadow-sm hover:shadow-md transition-shadow",children:h.jsxs(nn,{className:"p-6",children:[h.jsxs("div",{className:"flex justify-between items-start",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-medium text-gray-500 mb-1",children:e}),h.jsx("h3",{className:"text-2xl font-bold text-gray-900",children:t})]}),h.jsx("div",{className:`p-2 rounded-lg ${s}`,children:h.jsx(i,{className:`w-5 h-5 ${o}`})})]}),h.jsxs("div",{className:"mt-4 flex items-center text-sm",children:[n?h.jsx(XR,{className:"w-4 h-4 text-green-500 mr-1"}):h.jsx(v8,{className:"w-4 h-4 text-red-500 mr-1"}),h.jsx("span",{className:n?"text-green-600 font-medium":"text-red-600 font-medium",children:r}),h.jsx("span",{className:"text-gray-400 ml-1",children:"Vs. last period"})]})]})})}function yne({title:e}){return h.jsxs("div",{className:"space-y-6",children:[h.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[1,2,3,4].map(t=>h.jsxs($r,{children:[h.jsx(On,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:h.jsxs(En,{className:"text-sm font-medium",children:["Metric ",t]})}),h.jsxs(nn,{children:[h.jsx("div",{className:"text-2xl font-bold",children:"000"}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"+0.0% from last month"})]})]},t))}),h.jsx($r,{className:"min-h-[400px] flex items-center justify-center border-dashed",children:h.jsxs("div",{className:"text-center text-muted-foreground",children:[h.jsxs("h3",{className:"text-lg font-medium",children:[e," Module"]}),h.jsx("p",{children:"This module is currently under development."})]})})]})}function hr({className:e,...t}){return h.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:h.jsx("table",{"data-slot":"table",className:Te("w-full caption-bottom text-sm",e),...t})})}function pr({className:e,...t}){return h.jsx("thead",{"data-slot":"table-header",className:Te("[&_tr]:border-b",e),...t})}function mr({className:e,...t}){return h.jsx("tbody",{"data-slot":"table-body",className:Te("[&_tr:last-child]:border-0",e),...t})}function Ke({className:e,...t}){return h.jsx("tr",{"data-slot":"table-row",className:Te("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function me({className:e,...t}){return h.jsx("th",{"data-slot":"table-head",className:Te("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function se({className:e,...t}){return h.jsx("td",{"data-slot":"table-cell",className:Te("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function vk(e){const t=xne(e),r=_.forwardRef((n,i)=>{const{children:o,...s}=n,u=_.Children.toArray(o),f=u.find(wne);if(f){const l=f.props.children,d=u.map(p=>p===f?_.Children.count(l)>1?_.Children.only(null):_.isValidElement(l)?l.props.children:null:p);return h.jsx(t,{...s,ref:i,children:_.isValidElement(l)?_.cloneElement(l,void 0,d):null})}return h.jsx(t,{...s,ref:i,children:o})});return r.displayName=`${e}.Slot`,r}function xne(e){const t=_.forwardRef((r,n)=>{const{children:i,...o}=r;if(_.isValidElement(i)){const s=_ne(i),u=Sne(o,i.props);return i.type!==_.Fragment&&(u.ref=n?ia(n,s):s),_.cloneElement(i,u)}return _.Children.count(i)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bne=Symbol("radix.slottable");function wne(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bne}function Sne(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...u)=>{const f=o(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function _ne(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 o$(e){const t=e+"CollectionProvider",[r,n]=In(t),[i,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=y=>{const{scope:w,children:j}=y,O=F.useRef(null),E=F.useRef(new Map).current;return h.jsx(i,{scope:w,itemMap:E,collectionRef:O,children:j})};s.displayName=t;const u=e+"CollectionSlot",f=vk(u),l=F.forwardRef((y,w)=>{const{scope:j,children:O}=y,E=o(u,j),N=Xe(w,E.collectionRef);return h.jsx(f,{ref:N,children:O})});l.displayName=u;const d=e+"CollectionItemSlot",p="data-radix-collection-item",m=vk(d),g=F.forwardRef((y,w)=>{const{scope:j,children:O,...E}=y,N=F.useRef(null),A=Xe(w,N),C=o(d,j);return F.useEffect(()=>(C.itemMap.set(N,{ref:N,...E}),()=>void C.itemMap.delete(N))),h.jsx(m,{[p]:"",ref:A,children:O})});g.displayName=d;function b(y){const w=o(e+"CollectionConsumer",y);return F.useCallback(()=>{const O=w.collectionRef.current;if(!O)return[];const E=Array.from(O.querySelectorAll(`[${p}]`));return Array.from(w.itemMap.values()).sort((C,T)=>E.indexOf(C.ref.current)-E.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:s,Slot:l,ItemSlot:g},b,n]}function jne(e,t=globalThis?.document){const r=ar(e);_.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var One="DismissableLayer",uw="dismissableLayer.update",Ene="dismissableLayer.pointerDownOutside",Pne="dismissableLayer.focusOutside",gk,a$=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),mu=_.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:u,...f}=e,l=_.useContext(a$),[d,p]=_.useState(null),m=d?.ownerDocument??globalThis?.document,[,g]=_.useState({}),b=Xe(t,T=>p(T)),y=Array.from(l.layers),[w]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),j=y.indexOf(w),O=d?y.indexOf(d):-1,E=l.layersWithOutsidePointerEventsDisabled.size>0,N=O>=j,A=Nne(T=>{const R=T.target,I=[...l.branches].some(z=>z.contains(R));!N||I||(i?.(T),s?.(T),T.defaultPrevented||u?.())},m),C=Tne(T=>{const R=T.target;[...l.branches].some(z=>z.contains(R))||(o?.(T),s?.(T),T.defaultPrevented||u?.())},m);return jne(T=>{O===l.layers.size-1&&(n?.(T),!T.defaultPrevented&&u&&(T.preventDefault(),u()))},m),_.useEffect(()=>{if(d)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(gk=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(d)),l.layers.add(d),yk(),()=>{r&&l.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=gk)}},[d,m,r,l]),_.useEffect(()=>()=>{d&&(l.layers.delete(d),l.layersWithOutsidePointerEventsDisabled.delete(d),yk())},[d,l]),_.useEffect(()=>{const T=()=>g({});return document.addEventListener(uw,T),()=>document.removeEventListener(uw,T)},[]),h.jsx(qe.div,{...f,ref:b,style:{pointerEvents:E?N?"auto":"none":void 0,...e.style},onFocusCapture:ke(e.onFocusCapture,C.onFocusCapture),onBlurCapture:ke(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:ke(e.onPointerDownCapture,A.onPointerDownCapture)})});mu.displayName=One;var Ane="DismissableLayerBranch",Cne=_.forwardRef((e,t)=>{const r=_.useContext(a$),n=_.useRef(null),i=Xe(t,n);return _.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),h.jsx(qe.div,{...e,ref:i})});Cne.displayName=Ane;function Nne(e,t=globalThis?.document){const r=ar(e),n=_.useRef(!1),i=_.useRef(()=>{});return _.useEffect(()=>{const o=u=>{if(u.target&&!n.current){let f=function(){s$(Ene,r,l,{discrete:!0})};const l={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=f,t.addEventListener("click",i.current,{once:!0})):f()}else t.removeEventListener("click",i.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function Tne(e,t=globalThis?.document){const r=ar(e),n=_.useRef(!1);return _.useEffect(()=>{const i=o=>{o.target&&!n.current&&s$(Pne,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function yk(){const e=new CustomEvent(uw);document.dispatchEvent(e)}function s$(e,t,r,{discrete:n}){const i=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?IF(i,o):i.dispatchEvent(o)}var jb=0;function qS(){_.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??xk()),document.body.insertAdjacentElement("beforeend",e[1]??xk()),jb++,()=>{jb===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),jb--}},[])}function xk(){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 Ob="focusScope.autoFocusOnMount",Eb="focusScope.autoFocusOnUnmount",bk={bubbles:!1,cancelable:!0},kne="FocusScope",Qp=_.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[u,f]=_.useState(null),l=ar(i),d=ar(o),p=_.useRef(null),m=Xe(t,y=>f(y)),g=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(n){let y=function(E){if(g.paused||!u)return;const N=E.target;u.contains(N)?p.current=N:Ji(p.current,{select:!0})},w=function(E){if(g.paused||!u)return;const N=E.relatedTarget;N!==null&&(u.contains(N)||Ji(p.current,{select:!0}))},j=function(E){if(document.activeElement===document.body)for(const A of E)A.removedNodes.length>0&&Ji(u)};document.addEventListener("focusin",y),document.addEventListener("focusout",w);const O=new MutationObserver(j);return u&&O.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",w),O.disconnect()}}},[n,u,g.paused]),_.useEffect(()=>{if(u){Sk.add(g);const y=document.activeElement;if(!u.contains(y)){const j=new CustomEvent(Ob,bk);u.addEventListener(Ob,l),u.dispatchEvent(j),j.defaultPrevented||(Rne($ne(l$(u)),{select:!0}),document.activeElement===y&&Ji(u))}return()=>{u.removeEventListener(Ob,l),setTimeout(()=>{const j=new CustomEvent(Eb,bk);u.addEventListener(Eb,d),u.dispatchEvent(j),j.defaultPrevented||Ji(y??document.body,{select:!0}),u.removeEventListener(Eb,d),Sk.remove(g)},0)}}},[u,l,d,g]);const b=_.useCallback(y=>{if(!r&&!n||g.paused)return;const w=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,j=document.activeElement;if(w&&j){const O=y.currentTarget,[E,N]=Mne(O);E&&N?!y.shiftKey&&j===N?(y.preventDefault(),r&&Ji(E,{select:!0})):y.shiftKey&&j===E&&(y.preventDefault(),r&&Ji(N,{select:!0})):j===O&&y.preventDefault()}},[r,n,g.paused]);return h.jsx(qe.div,{tabIndex:-1,...s,ref:m,onKeyDown:b})});Qp.displayName=kne;function Rne(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Ji(n,{select:t}),document.activeElement!==r)return}function Mne(e){const t=l$(e),r=wk(t,e),n=wk(t.reverse(),e);return[r,n]}function l$(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function wk(e,t){for(const r of e)if(!Ine(r,{upTo:t}))return r}function Ine(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 Dne(e){return e instanceof HTMLInputElement&&"select"in e}function Ji(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Dne(e)&&t&&e.select()}}var Sk=Lne();function Lne(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=_k(e,t),e.unshift(t)},remove(t){e=_k(e,t),e[0]?.resume()}}}function _k(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function $ne(e){return e.filter(t=>t.tagName!=="A")}var Bne=Ew[" useId ".trim().toString()]||(()=>{}),Fne=0;function Xn(e){const[t,r]=_.useState(Bne());return Rt(()=>{r(n=>n??String(Fne++))},[e]),e||(t?`radix-${t}`:"")}const zne=["top","right","bottom","left"],ao=Math.min,zr=Math.max,tp=Math.round,Zf=Math.floor,Yn=e=>({x:e,y:e}),qne={left:"right",right:"left",bottom:"top",top:"bottom"},Une={start:"end",end:"start"};function fw(e,t,r){return zr(e,ao(t,r))}function Oi(e,t){return typeof e=="function"?e(t):e}function Ei(e){return e.split("-")[0]}function Zs(e){return e.split("-")[1]}function US(e){return e==="x"?"y":"x"}function WS(e){return e==="y"?"height":"width"}const Wne=new Set(["top","bottom"]);function Vn(e){return Wne.has(Ei(e))?"y":"x"}function HS(e){return US(Vn(e))}function Hne(e,t,r){r===void 0&&(r=!1);const n=Zs(e),i=HS(e),o=WS(i);let s=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=rp(s)),[s,rp(s)]}function Vne(e){const t=rp(e);return[dw(e),t,dw(t)]}function dw(e){return e.replace(/start|end/g,t=>Une[t])}const jk=["left","right"],Ok=["right","left"],Gne=["top","bottom"],Kne=["bottom","top"];function Xne(e,t,r){switch(e){case"top":case"bottom":return r?t?Ok:jk:t?jk:Ok;case"left":case"right":return t?Gne:Kne;default:return[]}}function Yne(e,t,r,n){const i=Zs(e);let o=Xne(Ei(e),r==="start",n);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(dw)))),o}function rp(e){return e.replace(/left|right|bottom|top/g,t=>qne[t])}function Qne(e){return{top:0,right:0,bottom:0,left:0,...e}}function c$(e){return typeof e!="number"?Qne(e):{top:e,right:e,bottom:e,left:e}}function np(e){const{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function Ek(e,t,r){let{reference:n,floating:i}=e;const o=Vn(t),s=HS(t),u=WS(s),f=Ei(t),l=o==="y",d=n.x+n.width/2-i.width/2,p=n.y+n.height/2-i.height/2,m=n[u]/2-i[u]/2;let g;switch(f){case"top":g={x:d,y:n.y-i.height};break;case"bottom":g={x:d,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:p};break;case"left":g={x:n.x-i.width,y:p};break;default:g={x:n.x,y:n.y}}switch(Zs(t)){case"start":g[s]-=m*(r&&l?-1:1);break;case"end":g[s]+=m*(r&&l?-1:1);break}return g}async function Zne(e,t){var r;t===void 0&&(t={});const{x:n,y:i,platform:o,rects:s,elements:u,strategy:f}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=Oi(t,e),b=c$(g),w=u[m?p==="floating"?"reference":"floating":p],j=np(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(w)))==null||r?w:w.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:l,rootBoundary:d,strategy:f})),O=p==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),N=await(o.isElement==null?void 0:o.isElement(E))?await(o.getScale==null?void 0:o.getScale(E))||{x:1,y:1}:{x:1,y:1},A=np(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:O,offsetParent:E,strategy:f}):O);return{top:(j.top-A.top+b.top)/N.y,bottom:(A.bottom-j.bottom+b.bottom)/N.y,left:(j.left-A.left+b.left)/N.x,right:(A.right-j.right+b.right)/N.x}}const Jne=async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:s}=r,u=o.filter(Boolean),f=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:p}=Ek(l,n,f),m=n,g={},b=0;for(let w=0;w({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:o,platform:s,elements:u,middlewareData:f}=t,{element:l,padding:d=0}=Oi(e,t)||{};if(l==null)return{};const p=c$(d),m={x:r,y:n},g=HS(i),b=WS(g),y=await s.getDimensions(l),w=g==="y",j=w?"top":"left",O=w?"bottom":"right",E=w?"clientHeight":"clientWidth",N=o.reference[b]+o.reference[g]-m[g]-o.floating[b],A=m[g]-o.reference[g],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let T=C?C[E]:0;(!T||!await(s.isElement==null?void 0:s.isElement(C)))&&(T=u.floating[E]||o.floating[b]);const R=N/2-A/2,I=T/2-y[b]/2-1,z=ao(p[j],I),$=ao(p[O],I),L=z,U=T-y[b]-$,W=T/2-y[b]/2+R,V=fw(L,W,U),G=!f.arrow&&Zs(i)!=null&&W!==V&&o.reference[b]/2-(WW<=0)){var $,L;const W=((($=o.flip)==null?void 0:$.index)||0)+1,V=T[W];if(V&&(!(p==="alignment"?O!==Vn(V):!1)||z.every(D=>Vn(D.placement)===O?D.overflows[0]>0:!0)))return{data:{index:W,overflows:z},reset:{placement:V}};let G=(L=z.filter(Y=>Y.overflows[0]<=0).sort((Y,D)=>Y.overflows[1]-D.overflows[1])[0])==null?void 0:L.placement;if(!G)switch(g){case"bestFit":{var U;const Y=(U=z.filter(D=>{if(C){const Q=Vn(D.placement);return Q===O||Q==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(Q=>Q>0).reduce((Q,J)=>Q+J,0)]).sort((D,Q)=>D[1]-Q[1])[0])==null?void 0:U[0];Y&&(G=Y);break}case"initialPlacement":G=u;break}if(i!==G)return{reset:{placement:G}}}return{}}}};function Pk(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ak(e){return zne.some(t=>e[t]>=0)}const rie=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:i="referenceHidden",...o}=Oi(e,t);switch(i){case"referenceHidden":{const s=await n.detectOverflow(t,{...o,elementContext:"reference"}),u=Pk(s,r.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:Ak(u)}}}case"escaped":{const s=await n.detectOverflow(t,{...o,altBoundary:!0}),u=Pk(s,r.floating);return{data:{escapedOffsets:u,escaped:Ak(u)}}}default:return{}}}}},u$=new Set(["left","top"]);async function nie(e,t){const{placement:r,platform:n,elements:i}=e,o=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=Ei(r),u=Zs(r),f=Vn(r)==="y",l=u$.has(s)?-1:1,d=o&&f?-1:1,p=Oi(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 u&&typeof b=="number"&&(g=u==="end"?b*-1:b),f?{x:g*d,y:m*l}:{x:m*l,y:g*d}}const iie=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:i,y:o,placement:s,middlewareData:u}=t,f=await nie(t,e);return s===((r=u.offset)==null?void 0:r.placement)&&(n=u.arrow)!=null&&n.alignmentOffset?{}:{x:i+f.x,y:o+f.y,data:{...f,placement:s}}}}},oie=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i,platform:o}=t,{mainAxis:s=!0,crossAxis:u=!1,limiter:f={fn:j=>{let{x:O,y:E}=j;return{x:O,y:E}}},...l}=Oi(e,t),d={x:r,y:n},p=await o.detectOverflow(t,l),m=Vn(Ei(i)),g=US(m);let b=d[g],y=d[m];if(s){const j=g==="y"?"top":"left",O=g==="y"?"bottom":"right",E=b+p[j],N=b-p[O];b=fw(E,b,N)}if(u){const j=m==="y"?"top":"left",O=m==="y"?"bottom":"right",E=y+p[j],N=y-p[O];y=fw(E,y,N)}const w=f.fn({...t,[g]:b,[m]:y});return{...w,data:{x:w.x-r,y:w.y-n,enabled:{[g]:s,[m]:u}}}}}},aie=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:i,rects:o,middlewareData:s}=t,{offset:u=0,mainAxis:f=!0,crossAxis:l=!0}=Oi(e,t),d={x:r,y:n},p=Vn(i),m=US(p);let g=d[m],b=d[p];const y=Oi(u,t),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(f){const E=m==="y"?"height":"width",N=o.reference[m]-o.floating[E]+w.mainAxis,A=o.reference[m]+o.reference[E]-w.mainAxis;gA&&(g=A)}if(l){var j,O;const E=m==="y"?"width":"height",N=u$.has(Ei(i)),A=o.reference[p]-o.floating[E]+(N&&((j=s.offset)==null?void 0:j[p])||0)+(N?0:w.crossAxis),C=o.reference[p]+o.reference[E]+(N?0:((O=s.offset)==null?void 0:O[p])||0)-(N?w.crossAxis:0);bC&&(b=C)}return{[m]:g,[p]:b}}}},sie=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:i,rects:o,platform:s,elements:u}=t,{apply:f=()=>{},...l}=Oi(e,t),d=await s.detectOverflow(t,l),p=Ei(i),m=Zs(i),g=Vn(i)==="y",{width:b,height:y}=o.floating;let w,j;p==="top"||p==="bottom"?(w=p,j=m===(await(s.isRTL==null?void 0:s.isRTL(u.floating))?"start":"end")?"left":"right"):(j=p,w=m==="end"?"top":"bottom");const O=y-d.top-d.bottom,E=b-d.left-d.right,N=ao(y-d[w],O),A=ao(b-d[j],E),C=!t.middlewareData.shift;let T=N,R=A;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(R=E),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(T=O),C&&!m){const z=zr(d.left,0),$=zr(d.right,0),L=zr(d.top,0),U=zr(d.bottom,0);g?R=b-2*(z!==0||$!==0?z+$:zr(d.left,d.right)):T=y-2*(L!==0||U!==0?L+U:zr(d.top,d.bottom))}await f({...t,availableWidth:R,availableHeight:T});const I=await s.getDimensions(u.floating);return b!==I.width||y!==I.height?{reset:{rects:!0}}:{}}}};function Zp(){return typeof window<"u"}function Js(e){return f$(e)?(e.nodeName||"").toLowerCase():"#document"}function Hr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ni(e){var t;return(t=(f$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function f$(e){return Zp()?e instanceof Node||e instanceof Hr(e).Node:!1}function Rn(e){return Zp()?e instanceof Element||e instanceof Hr(e).Element:!1}function Jn(e){return Zp()?e instanceof HTMLElement||e instanceof Hr(e).HTMLElement:!1}function Ck(e){return!Zp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Hr(e).ShadowRoot}const lie=new Set(["inline","contents"]);function vu(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=Mn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!lie.has(i)}const cie=new Set(["table","td","th"]);function uie(e){return cie.has(Js(e))}const fie=[":popover-open",":modal"];function Jp(e){return fie.some(t=>{try{return e.matches(t)}catch{return!1}})}const die=["transform","translate","scale","rotate","perspective"],hie=["transform","translate","scale","rotate","perspective","filter"],pie=["paint","layout","strict","content"];function VS(e){const t=GS(),r=Rn(e)?Mn(e):e;return die.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)||hie.some(n=>(r.willChange||"").includes(n))||pie.some(n=>(r.contain||"").includes(n))}function mie(e){let t=so(e);for(;Jn(t)&&!Ls(t);){if(VS(t))return t;if(Jp(t))return null;t=so(t)}return null}function GS(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const vie=new Set(["html","body","#document"]);function Ls(e){return vie.has(Js(e))}function Mn(e){return Hr(e).getComputedStyle(e)}function em(e){return Rn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function so(e){if(Js(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ck(e)&&e.host||ni(e);return Ck(t)?t.host:t}function d$(e){const t=so(e);return Ls(t)?e.ownerDocument?e.ownerDocument.body:e.body:Jn(t)&&vu(t)?t:d$(t)}function nu(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const i=d$(e),o=i===((n=e.ownerDocument)==null?void 0:n.body),s=Hr(i);if(o){const u=hw(s);return t.concat(s,s.visualViewport||[],vu(i)?i:[],u&&r?nu(u):[])}return t.concat(i,nu(i,[],r))}function hw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function h$(e){const t=Mn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=Jn(e),o=i?e.offsetWidth:r,s=i?e.offsetHeight:n,u=tp(r)!==o||tp(n)!==s;return u&&(r=o,n=s),{width:r,height:n,$:u}}function KS(e){return Rn(e)?e:e.contextElement}function os(e){const t=KS(e);if(!Jn(t))return Yn(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:o}=h$(t);let s=(o?tp(r.width):r.width)/n,u=(o?tp(r.height):r.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!u||!Number.isFinite(u))&&(u=1),{x:s,y:u}}const gie=Yn(0);function p$(e){const t=Hr(e);return!GS()||!t.visualViewport?gie:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function yie(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Hr(e)?!1:t}function Jo(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),o=KS(e);let s=Yn(1);t&&(n?Rn(n)&&(s=os(n)):s=os(e));const u=yie(o,r,n)?p$(o):Yn(0);let f=(i.left+u.x)/s.x,l=(i.top+u.y)/s.y,d=i.width/s.x,p=i.height/s.y;if(o){const m=Hr(o),g=n&&Rn(n)?Hr(n):n;let b=m,y=hw(b);for(;y&&n&&g!==b;){const w=os(y),j=y.getBoundingClientRect(),O=Mn(y),E=j.left+(y.clientLeft+parseFloat(O.paddingLeft))*w.x,N=j.top+(y.clientTop+parseFloat(O.paddingTop))*w.y;f*=w.x,l*=w.y,d*=w.x,p*=w.y,f+=E,l+=N,b=Hr(y),y=hw(b)}}return np({width:d,height:p,x:f,y:l})}function tm(e,t){const r=em(e).scrollLeft;return t?t.left+r:Jo(ni(e)).left+r}function m$(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-tm(e,r),i=r.top+t.scrollTop;return{x:n,y:i}}function xie(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e;const o=i==="fixed",s=ni(n),u=t?Jp(t.floating):!1;if(n===s||u&&o)return r;let f={scrollLeft:0,scrollTop:0},l=Yn(1);const d=Yn(0),p=Jn(n);if((p||!p&&!o)&&((Js(n)!=="body"||vu(s))&&(f=em(n)),Jn(n))){const g=Jo(n);l=os(n),d.x=g.x+n.clientLeft,d.y=g.y+n.clientTop}const m=s&&!p&&!o?m$(s,f):Yn(0);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-f.scrollLeft*l.x+d.x+m.x,y:r.y*l.y-f.scrollTop*l.y+d.y+m.y}}function bie(e){return Array.from(e.getClientRects())}function wie(e){const t=ni(e),r=em(e),n=e.ownerDocument.body,i=zr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=zr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+tm(e);const u=-r.scrollTop;return Mn(n).direction==="rtl"&&(s+=zr(t.clientWidth,n.clientWidth)-i),{width:i,height:o,x:s,y:u}}const Nk=25;function Sie(e,t){const r=Hr(e),n=ni(e),i=r.visualViewport;let o=n.clientWidth,s=n.clientHeight,u=0,f=0;if(i){o=i.width,s=i.height;const d=GS();(!d||d&&t==="fixed")&&(u=i.offsetLeft,f=i.offsetTop)}const l=tm(n);if(l<=0){const d=n.ownerDocument,p=d.body,m=getComputedStyle(p),g=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(n.clientWidth-p.clientWidth-g);b<=Nk&&(o-=b)}else l<=Nk&&(o+=l);return{width:o,height:s,x:u,y:f}}const _ie=new Set(["absolute","fixed"]);function jie(e,t){const r=Jo(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,o=Jn(e)?os(e):Yn(1),s=e.clientWidth*o.x,u=e.clientHeight*o.y,f=i*o.x,l=n*o.y;return{width:s,height:u,x:f,y:l}}function Tk(e,t,r){let n;if(t==="viewport")n=Sie(e,r);else if(t==="document")n=wie(ni(e));else if(Rn(t))n=jie(t,r);else{const i=p$(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return np(n)}function v$(e,t){const r=so(e);return r===t||!Rn(r)||Ls(r)?!1:Mn(r).position==="fixed"||v$(r,t)}function Oie(e,t){const r=t.get(e);if(r)return r;let n=nu(e,[],!1).filter(u=>Rn(u)&&Js(u)!=="body"),i=null;const o=Mn(e).position==="fixed";let s=o?so(e):e;for(;Rn(s)&&!Ls(s);){const u=Mn(s),f=VS(s);!f&&u.position==="fixed"&&(i=null),(o?!f&&!i:!f&&u.position==="static"&&!!i&&_ie.has(i.position)||vu(s)&&!f&&v$(e,s))?n=n.filter(d=>d!==s):i=u,s=so(s)}return t.set(e,n),n}function Eie(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const s=[...r==="clippingAncestors"?Jp(t)?[]:Oie(t,this._c):[].concat(r),n],u=s[0],f=s.reduce((l,d)=>{const p=Tk(t,d,i);return l.top=zr(p.top,l.top),l.right=ao(p.right,l.right),l.bottom=ao(p.bottom,l.bottom),l.left=zr(p.left,l.left),l},Tk(t,u,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function Pie(e){const{width:t,height:r}=h$(e);return{width:t,height:r}}function Aie(e,t,r){const n=Jn(t),i=ni(t),o=r==="fixed",s=Jo(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const f=Yn(0);function l(){f.x=tm(i)}if(n||!n&&!o)if((Js(t)!=="body"||vu(i))&&(u=em(t)),n){const g=Jo(t,!0,o,t);f.x=g.x+t.clientLeft,f.y=g.y+t.clientTop}else i&&l();o&&!n&&i&&l();const d=i&&!n&&!o?m$(i,u):Yn(0),p=s.left+u.scrollLeft-f.x-d.x,m=s.top+u.scrollTop-f.y-d.y;return{x:p,y:m,width:s.width,height:s.height}}function Pb(e){return Mn(e).position==="static"}function kk(e,t){if(!Jn(e)||Mn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return ni(e)===r&&(r=r.ownerDocument.body),r}function g$(e,t){const r=Hr(e);if(Jp(e))return r;if(!Jn(e)){let i=so(e);for(;i&&!Ls(i);){if(Rn(i)&&!Pb(i))return i;i=so(i)}return r}let n=kk(e,t);for(;n&&uie(n)&&Pb(n);)n=kk(n,t);return n&&Ls(n)&&Pb(n)&&!VS(n)?r:n||mie(e)||r}const Cie=async function(e){const t=this.getOffsetParent||g$,r=this.getDimensions,n=await r(e.floating);return{reference:Aie(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Nie(e){return Mn(e).direction==="rtl"}const Tie={convertOffsetParentRelativeRectToViewportRelativeRect:xie,getDocumentElement:ni,getClippingRect:Eie,getOffsetParent:g$,getElementRects:Cie,getClientRects:bie,getDimensions:Pie,getScale:os,isElement:Rn,isRTL:Nie};function y$(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function kie(e,t){let r=null,n;const i=ni(e);function o(){var u;clearTimeout(n),(u=r)==null||u.disconnect(),r=null}function s(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),o();const l=e.getBoundingClientRect(),{left:d,top:p,width:m,height:g}=l;if(u||t(),!m||!g)return;const b=Zf(p),y=Zf(i.clientWidth-(d+m)),w=Zf(i.clientHeight-(p+g)),j=Zf(d),E={rootMargin:-b+"px "+-y+"px "+-w+"px "+-j+"px",threshold:zr(0,ao(1,f))||1};let N=!0;function A(C){const T=C[0].intersectionRatio;if(T!==f){if(!N)return s();T?s(!1,T):n=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!y$(l,e.getBoundingClientRect())&&s(),N=!1}try{r=new IntersectionObserver(A,{...E,root:i.ownerDocument})}catch{r=new IntersectionObserver(A,E)}r.observe(e)}return s(!0),o}function Rie(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=n,l=KS(e),d=i||o?[...l?nu(l):[],...nu(t)]:[];d.forEach(j=>{i&&j.addEventListener("scroll",r,{passive:!0}),o&&j.addEventListener("resize",r)});const p=l&&u?kie(l,r):null;let m=-1,g=null;s&&(g=new ResizeObserver(j=>{let[O]=j;O&&O.target===l&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var E;(E=g)==null||E.observe(t)})),r()}),l&&!f&&g.observe(l),g.observe(t));let b,y=f?Jo(e):null;f&&w();function w(){const j=Jo(e);y&&!y$(y,j)&&r(),y=j,b=requestAnimationFrame(w)}return r(),()=>{var j;d.forEach(O=>{i&&O.removeEventListener("scroll",r),o&&O.removeEventListener("resize",r)}),p?.(),(j=g)==null||j.disconnect(),g=null,f&&cancelAnimationFrame(b)}}const Mie=iie,Iie=oie,Die=tie,Lie=sie,$ie=rie,Rk=eie,Bie=aie,Fie=(e,t,r)=>{const n=new Map,i={platform:Tie,...r},o={...i.platform,_c:n};return Jne(e,t,{...i,platform:o})};var zie=typeof document<"u",qie=function(){},zd=zie?_.useLayoutEffect:qie;function ip(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,i;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(!ip(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=r;n--!==0;){const o=i[n];if(!(o==="_owner"&&e.$$typeof)&&!ip(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function x$(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Mk(e,t){const r=x$(e);return Math.round(t*r)/r}function Ab(e){const t=_.useRef(e);return zd(()=>{t.current=e}),t}function Uie(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:o,floating:s}={},transform:u=!0,whileElementsMounted:f,open:l}=e,[d,p]=_.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=_.useState(n);ip(m,n)||g(n);const[b,y]=_.useState(null),[w,j]=_.useState(null),O=_.useCallback(D=>{D!==C.current&&(C.current=D,y(D))},[]),E=_.useCallback(D=>{D!==T.current&&(T.current=D,j(D))},[]),N=o||b,A=s||w,C=_.useRef(null),T=_.useRef(null),R=_.useRef(d),I=f!=null,z=Ab(f),$=Ab(i),L=Ab(l),U=_.useCallback(()=>{if(!C.current||!T.current)return;const D={placement:t,strategy:r,middleware:m};$.current&&(D.platform=$.current),Fie(C.current,T.current,D).then(Q=>{const J={...Q,isPositioned:L.current!==!1};W.current&&!ip(R.current,J)&&(R.current=J,ou.flushSync(()=>{p(J)}))})},[m,t,r,$,L]);zd(()=>{l===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p(D=>({...D,isPositioned:!1})))},[l]);const W=_.useRef(!1);zd(()=>(W.current=!0,()=>{W.current=!1}),[]),zd(()=>{if(N&&(C.current=N),A&&(T.current=A),N&&A){if(z.current)return z.current(N,A,U);U()}},[N,A,U,z,I]);const V=_.useMemo(()=>({reference:C,floating:T,setReference:O,setFloating:E}),[O,E]),G=_.useMemo(()=>({reference:N,floating:A}),[N,A]),Y=_.useMemo(()=>{const D={position:r,left:0,top:0};if(!G.floating)return D;const Q=Mk(G.floating,d.x),J=Mk(G.floating,d.y);return u?{...D,transform:"translate("+Q+"px, "+J+"px)",...x$(G.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:Q,top:J}},[r,u,G.floating,d.x,d.y]);return _.useMemo(()=>({...d,update:U,refs:V,elements:G,floatingStyles:Y}),[d,U,V,G,Y])}const Wie=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:i}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Rk({element:n.current,padding:i}).fn(r):{}:n?Rk({element:n,padding:i}).fn(r):{}}}},Hie=(e,t)=>({...Mie(e),options:[e,t]}),Vie=(e,t)=>({...Iie(e),options:[e,t]}),Gie=(e,t)=>({...Bie(e),options:[e,t]}),Kie=(e,t)=>({...Die(e),options:[e,t]}),Xie=(e,t)=>({...Lie(e),options:[e,t]}),Yie=(e,t)=>({...$ie(e),options:[e,t]}),Qie=(e,t)=>({...Wie(e),options:[e,t]});var Zie="Arrow",b$=_.forwardRef((e,t)=>{const{children:r,width:n=10,height:i=5,...o}=e;return h.jsx(qe.svg,{...o,ref:t,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});b$.displayName=Zie;var Jie=b$;function XS(e){const[t,r]=_.useState(void 0);return Rt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,u;if("borderBoxSize"in o){const f=o.borderBoxSize,l=Array.isArray(f)?f[0]:f;s=l.inlineSize,u=l.blockSize}else s=e.offsetWidth,u=e.offsetHeight;r({width:s,height:u})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var YS="Popper",[w$,el]=In(YS),[eoe,S$]=w$(YS),_$=e=>{const{__scopePopper:t,children:r}=e,[n,i]=_.useState(null);return h.jsx(eoe,{scope:t,anchor:n,onAnchorChange:i,children:r})};_$.displayName=YS;var j$="PopperAnchor",O$=_.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...i}=e,o=S$(j$,r),s=_.useRef(null),u=Xe(t,s),f=_.useRef(null);return _.useEffect(()=>{const l=f.current;f.current=n?.current||s.current,l!==f.current&&o.onAnchorChange(f.current)}),n?null:h.jsx(qe.div,{...i,ref:u})});O$.displayName=j$;var QS="PopperContent",[toe,roe]=w$(QS),E$=_.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:i=0,align:o="center",alignOffset:s=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:l=[],collisionPadding:d=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...y}=e,w=S$(QS,r),[j,O]=_.useState(null),E=Xe(t,X=>O(X)),[N,A]=_.useState(null),C=XS(N),T=C?.width??0,R=C?.height??0,I=n+(o!=="center"?"-"+o:""),z=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},$=Array.isArray(l)?l:[l],L=$.length>0,U={padding:z,boundary:$.filter(ioe),altBoundary:L},{refs:W,floatingStyles:V,placement:G,isPositioned:Y,middlewareData:D}=Uie({strategy:"fixed",placement:I,whileElementsMounted:(...X)=>Rie(...X,{animationFrame:g==="always"}),elements:{reference:w.anchor},middleware:[Hie({mainAxis:i+R,alignmentAxis:s}),f&&Vie({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Gie():void 0,...U}),f&&Kie({...U}),Xie({...U,apply:({elements:X,rects:ue,availableWidth:ie,availableHeight:de})=>{const{width:ye,height:oe}=ue.reference,$e=X.floating.style;$e.setProperty("--radix-popper-available-width",`${ie}px`),$e.setProperty("--radix-popper-available-height",`${de}px`),$e.setProperty("--radix-popper-anchor-width",`${ye}px`),$e.setProperty("--radix-popper-anchor-height",`${oe}px`)}}),N&&Qie({element:N,padding:u}),ooe({arrowWidth:T,arrowHeight:R}),m&&Yie({strategy:"referenceHidden",...U})]}),[Q,J]=C$(G),M=ar(b);Rt(()=>{Y&&M?.()},[Y,M]);const B=D.arrow?.x,Z=D.arrow?.y,te=D.arrow?.centerOffset!==0,[ve,xe]=_.useState();return Rt(()=>{j&&xe(window.getComputedStyle(j).zIndex)},[j]),h.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:Y?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[D.transformOrigin?.x,D.transformOrigin?.y].join(" "),...D.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(toe,{scope:r,placedSide:Q,onArrowChange:A,arrowX:B,arrowY:Z,shouldHideArrow:te,children:h.jsx(qe.div,{"data-side":Q,"data-align":J,...y,ref:E,style:{...y.style,animation:Y?void 0:"none"}})})})});E$.displayName=QS;var P$="PopperArrow",noe={top:"bottom",right:"left",bottom:"top",left:"right"},A$=_.forwardRef(function(t,r){const{__scopePopper:n,...i}=t,o=roe(P$,n),s=noe[o.placedSide];return h.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:h.jsx(Jie,{...i,ref:r,style:{...i.style,display:"block"}})})});A$.displayName=P$;function ioe(e){return e!==null}var ooe=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:i}=t,s=i.arrow?.centerOffset!==0,u=s?0:e.arrowWidth,f=s?0:e.arrowHeight,[l,d]=C$(r),p={start:"0%",center:"50%",end:"100%"}[d],m=(i.arrow?.x??0)+u/2,g=(i.arrow?.y??0)+f/2;let b="",y="";return l==="bottom"?(b=s?p:`${m}px`,y=`${-f}px`):l==="top"?(b=s?p:`${m}px`,y=`${n.floating.height+f}px`):l==="right"?(b=`${-f}px`,y=s?p:`${g}px`):l==="left"&&(b=`${n.floating.width+f}px`,y=s?p:`${g}px`),{data:{x:b,y}}}});function C$(e){const[t,r="center"]=e.split("-");return[t,r]}var ZS=_$,rm=O$,JS=E$,e_=A$,aoe="Portal",gu=_.forwardRef((e,t)=>{const{container:r,...n}=e,[i,o]=_.useState(!1);Rt(()=>o(!0),[]);const s=r||i&&globalThis?.document?.body;return s?PF.createPortal(h.jsx(qe.div,{...n,ref:t}),s):null});gu.displayName=aoe;function soe(e){const t=loe(e),r=_.forwardRef((n,i)=>{const{children:o,...s}=n,u=_.Children.toArray(o),f=u.find(uoe);if(f){const l=f.props.children,d=u.map(p=>p===f?_.Children.count(l)>1?_.Children.only(null):_.isValidElement(l)?l.props.children:null:p);return h.jsx(t,{...s,ref:i,children:_.isValidElement(l)?_.cloneElement(l,void 0,d):null})}return h.jsx(t,{...s,ref:i,children:o})});return r.displayName=`${e}.Slot`,r}function loe(e){const t=_.forwardRef((r,n)=>{const{children:i,...o}=r;if(_.isValidElement(i)){const s=doe(i),u=foe(o,i.props);return i.type!==_.Fragment&&(u.ref=n?ia(n,s):s),_.cloneElement(i,u)}return _.Children.count(i)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var coe=Symbol("radix.slottable");function uoe(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===coe}function foe(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...u)=>{const f=o(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function doe(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 hoe=Ew[" useInsertionEffect ".trim().toString()]||Rt;function Pi({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[i,o,s]=poe({defaultProp:t,onChange:r}),u=e!==void 0,f=u?e:i;{const d=_.useRef(e!==void 0);_.useEffect(()=>{const p=d.current;p!==u&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${u?"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.`),d.current=u},[u,n])}const l=_.useCallback(d=>{if(u){const p=moe(d)?d(e):d;p!==e&&s.current?.(p)}else o(d)},[u,e,o,s]);return[f,l]}function poe({defaultProp:e,onChange:t}){const[r,n]=_.useState(e),i=_.useRef(r),o=_.useRef(t);return hoe(()=>{o.current=t},[t]),_.useEffect(()=>{i.current!==r&&(o.current?.(r),i.current=r)},[r,i]),[r,n,o]}function moe(e){return typeof e=="function"}function t_(e){const t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var N$=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"}),voe="VisuallyHidden",T$=_.forwardRef((e,t)=>h.jsx(qe.span,{...e,ref:t,style:{...N$,...e.style}}));T$.displayName=voe;var goe=T$,yoe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},qa=new WeakMap,Jf=new WeakMap,ed={},Cb=0,k$=function(e){return e&&(e.host||k$(e.parentNode))},xoe=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=k$(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})},boe=function(e,t,r,n){var i=xoe(t,Array.isArray(e)?e:[e]);ed[r]||(ed[r]=new WeakMap);var o=ed[r],s=[],u=new Set,f=new Set(i),l=function(p){!p||u.has(p)||(u.add(p),l(p.parentNode))};i.forEach(l);var d=function(p){!p||f.has(p)||Array.prototype.forEach.call(p.children,function(m){if(u.has(m))d(m);else try{var g=m.getAttribute(n),b=g!==null&&g!=="false",y=(qa.get(m)||0)+1,w=(o.get(m)||0)+1;qa.set(m,y),o.set(m,w),s.push(m),y===1&&b&&Jf.set(m,!0),w===1&&m.setAttribute(r,"true"),b||m.setAttribute(n,"true")}catch(j){console.error("aria-hidden: cannot operate on ",m,j)}})};return d(t),u.clear(),Cb++,function(){s.forEach(function(p){var m=qa.get(p)-1,g=o.get(p)-1;qa.set(p,m),o.set(p,g),m||(Jf.has(p)||p.removeAttribute(n),Jf.delete(p)),g||p.removeAttribute(r)}),Cb--,Cb||(qa=new WeakMap,qa=new WeakMap,Jf=new WeakMap,ed={})}},r_=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=yoe(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live], script"))),boe(n,i,r,"aria-hidden")):function(){return null}},Wn=function(){return Wn=Object.assign||function(t){for(var r,n=1,i=arguments.length;n"u")return Loe;var t=$oe(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])}},Foe=D$(),as="data-scroll-locked",zoe=function(e,t,r,n){var i=e.left,o=e.top,s=e.right,u=e.gap;return r===void 0&&(r="margin"),` + .`.concat(Soe,` { + overflow: hidden `).concat(n,`; + padding-right: `).concat(u,"px ").concat(n,`; + } + body[`).concat(as,`] { + overflow: hidden `).concat(n,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` + padding-left: `.concat(i,`px; + padding-top: `).concat(o,`px; + padding-right: `).concat(s,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(u,"px ").concat(n,`; + `),r==="padding"&&"padding-right: ".concat(u,"px ").concat(n,";")].filter(Boolean).join(""),` + } + + .`).concat(qd,` { + right: `).concat(u,"px ").concat(n,`; + } + + .`).concat(Ud,` { + margin-right: `).concat(u,"px ").concat(n,`; + } + + .`).concat(qd," .").concat(qd,` { + right: 0 `).concat(n,`; + } + + .`).concat(Ud," .").concat(Ud,` { + margin-right: 0 `).concat(n,`; + } + + body[`).concat(as,`] { + `).concat(_oe,": ").concat(u,`px; + } +`)},Dk=function(){var e=parseInt(document.body.getAttribute(as)||"0",10);return isFinite(e)?e:0},qoe=function(){_.useEffect(function(){return document.body.setAttribute(as,(Dk()+1).toString()),function(){var e=Dk()-1;e<=0?document.body.removeAttribute(as):document.body.setAttribute(as,e.toString())}},[])},Uoe=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=n===void 0?"margin":n;qoe();var o=_.useMemo(function(){return Boe(i)},[i]);return _.createElement(Foe,{styles:zoe(o,!t,i,r?"":"!important")})},pw=!1;if(typeof window<"u")try{var td=Object.defineProperty({},"passive",{get:function(){return pw=!0,!0}});window.addEventListener("test",td,td),window.removeEventListener("test",td,td)}catch{pw=!1}var Ua=pw?{passive:!1}:!1,Woe=function(e){return e.tagName==="TEXTAREA"},L$=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Woe(e)&&r[t]==="visible")},Hoe=function(e){return L$(e,"overflowY")},Voe=function(e){return L$(e,"overflowX")},Lk=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=$$(e,n);if(i){var o=B$(e,n),s=o[1],u=o[2];if(s>u)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Goe=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Koe=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},$$=function(e,t){return e==="v"?Hoe(t):Voe(t)},B$=function(e,t){return e==="v"?Goe(t):Koe(t)},Xoe=function(e,t){return e==="h"&&t==="rtl"?-1:1},Yoe=function(e,t,r,n,i){var o=Xoe(e,window.getComputedStyle(t).direction),s=o*n,u=r.target,f=t.contains(u),l=!1,d=s>0,p=0,m=0;do{if(!u)break;var g=B$(e,u),b=g[0],y=g[1],w=g[2],j=y-w-o*b;(b||j)&&$$(e,u)&&(p+=j,m+=b);var O=u.parentNode;u=O&&O.nodeType===Node.DOCUMENT_FRAGMENT_NODE?O.host:O}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(d&&Math.abs(p)<1||!d&&Math.abs(m)<1)&&(l=!0),l},rd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$k=function(e){return[e.deltaX,e.deltaY]},Bk=function(e){return e&&"current"in e?e.current:e},Qoe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Zoe=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},Joe=0,Wa=[];function eae(e){var t=_.useRef([]),r=_.useRef([0,0]),n=_.useRef(),i=_.useState(Joe++)[0],o=_.useState(D$)[0],s=_.useRef(e);_.useEffect(function(){s.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=woe([e.lockRef.current],(e.shards||[]).map(Bk),!0).filter(Boolean);return y.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=_.useCallback(function(y,w){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!s.current.allowPinchZoom;var j=rd(y),O=r.current,E="deltaX"in y?y.deltaX:O[0]-j[0],N="deltaY"in y?y.deltaY:O[1]-j[1],A,C=y.target,T=Math.abs(E)>Math.abs(N)?"h":"v";if("touches"in y&&T==="h"&&C.type==="range")return!1;var R=window.getSelection(),I=R&&R.anchorNode,z=I?I===C||I.contains(C):!1;if(z)return!1;var $=Lk(T,C);if(!$)return!0;if($?A=T:(A=T==="v"?"h":"v",$=Lk(T,C)),!$)return!1;if(!n.current&&"changedTouches"in y&&(E||N)&&(n.current=A),!A)return!0;var L=n.current||A;return Yoe(L,w,y,L==="h"?E:N)},[]),f=_.useCallback(function(y){var w=y;if(!(!Wa.length||Wa[Wa.length-1]!==o)){var j="deltaY"in w?$k(w):rd(w),O=t.current.filter(function(A){return A.name===w.type&&(A.target===w.target||w.target===A.shadowParent)&&Qoe(A.delta,j)})[0];if(O&&O.should){w.cancelable&&w.preventDefault();return}if(!O){var E=(s.current.shards||[]).map(Bk).filter(Boolean).filter(function(A){return A.contains(w.target)}),N=E.length>0?u(w,E[0]):!s.current.noIsolation;N&&w.cancelable&&w.preventDefault()}}},[]),l=_.useCallback(function(y,w,j,O){var E={name:y,delta:w,target:j,should:O,shadowParent:tae(j)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(N){return N!==E})},1)},[]),d=_.useCallback(function(y){r.current=rd(y),n.current=void 0},[]),p=_.useCallback(function(y){l(y.type,$k(y),y.target,u(y,e.lockRef.current))},[]),m=_.useCallback(function(y){l(y.type,rd(y),y.target,u(y,e.lockRef.current))},[]);_.useEffect(function(){return Wa.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",f,Ua),document.addEventListener("touchmove",f,Ua),document.addEventListener("touchstart",d,Ua),function(){Wa=Wa.filter(function(y){return y!==o}),document.removeEventListener("wheel",f,Ua),document.removeEventListener("touchmove",f,Ua),document.removeEventListener("touchstart",d,Ua)}},[]);var g=e.removeScrollBar,b=e.inert;return _.createElement(_.Fragment,null,b?_.createElement(o,{styles:Zoe(i)}):null,g?_.createElement(Uoe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function tae(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const rae=Noe(I$,eae);var im=_.forwardRef(function(e,t){return _.createElement(nm,Wn({},e,{ref:t,sideCar:rae}))});im.classNames=nm.classNames;var nae=[" ","Enter","ArrowUp","ArrowDown"],iae=[" ","Enter"],ea="Select",[om,am,oae]=o$(ea),[tl]=In(ea,[oae,el]),sm=el(),[aae,ho]=tl(ea),[sae,lae]=tl(ea),F$=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:i,onOpenChange:o,value:s,defaultValue:u,onValueChange:f,dir:l,name:d,autoComplete:p,disabled:m,required:g,form:b}=e,y=sm(t),[w,j]=_.useState(null),[O,E]=_.useState(null),[N,A]=_.useState(!1),C=fp(l),[T,R]=Pi({prop:n,defaultProp:i??!1,onChange:o,caller:ea}),[I,z]=Pi({prop:s,defaultProp:u,onChange:f,caller:ea}),$=_.useRef(null),L=w?b||!!w.closest("form"):!0,[U,W]=_.useState(new Set),V=Array.from(U).map(G=>G.props.value).join(";");return h.jsx(ZS,{...y,children:h.jsxs(aae,{required:g,scope:t,trigger:w,onTriggerChange:j,valueNode:O,onValueNodeChange:E,valueNodeHasChildren:N,onValueNodeHasChildrenChange:A,contentId:Xn(),value:I,onValueChange:z,open:T,onOpenChange:R,dir:C,triggerPointerDownPosRef:$,disabled:m,children:[h.jsx(om.Provider,{scope:t,children:h.jsx(sae,{scope:e.__scopeSelect,onNativeOptionAdd:_.useCallback(G=>{W(Y=>new Set(Y).add(G))},[]),onNativeOptionRemove:_.useCallback(G=>{W(Y=>{const D=new Set(Y);return D.delete(G),D})},[]),children:r})}),L?h.jsxs(l3,{"aria-hidden":!0,required:g,tabIndex:-1,name:d,autoComplete:p,value:I,onChange:G=>z(G.target.value),disabled:m,form:b,children:[I===void 0?h.jsx("option",{value:""}):null,Array.from(U)]},V):null]})})};F$.displayName=ea;var z$="SelectTrigger",q$=_.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...i}=e,o=sm(r),s=ho(z$,r),u=s.disabled||n,f=Xe(t,s.onTriggerChange),l=am(r),d=_.useRef("touch"),[p,m,g]=u3(y=>{const w=l().filter(E=>!E.disabled),j=w.find(E=>E.value===s.value),O=f3(w,y,j);O!==void 0&&s.onValueChange(O.value)}),b=y=>{u||(s.onOpenChange(!0),g()),y&&(s.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return h.jsx(rm,{asChild:!0,...o,children:h.jsx(qe.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:u,"data-disabled":u?"":void 0,"data-placeholder":c3(s.value)?"":void 0,...i,ref:f,onClick:ke(i.onClick,y=>{y.currentTarget.focus(),d.current!=="mouse"&&b(y)}),onPointerDown:ke(i.onPointerDown,y=>{d.current=y.pointerType;const w=y.target;w.hasPointerCapture(y.pointerId)&&w.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(b(y),y.preventDefault())}),onKeyDown:ke(i.onKeyDown,y=>{const w=p.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&m(y.key),!(w&&y.key===" ")&&nae.includes(y.key)&&(b(),y.preventDefault())})})})});q$.displayName=z$;var U$="SelectValue",W$=_.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,children:o,placeholder:s="",...u}=e,f=ho(U$,r),{onValueNodeHasChildrenChange:l}=f,d=o!==void 0,p=Xe(t,f.onValueNodeChange);return Rt(()=>{l(d)},[l,d]),h.jsx(qe.span,{...u,ref:p,style:{pointerEvents:"none"},children:c3(f.value)?h.jsx(h.Fragment,{children:s}):o})});W$.displayName=U$;var cae="SelectIcon",H$=_.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...i}=e;return h.jsx(qe.span,{"aria-hidden":!0,...i,ref:t,children:n||"▼"})});H$.displayName=cae;var uae="SelectPortal",V$=e=>h.jsx(gu,{asChild:!0,...e});V$.displayName=uae;var ta="SelectContent",G$=_.forwardRef((e,t)=>{const r=ho(ta,e.__scopeSelect),[n,i]=_.useState();if(Rt(()=>{i(new DocumentFragment)},[]),!r.open){const o=n;return o?ou.createPortal(h.jsx(K$,{scope:e.__scopeSelect,children:h.jsx(om.Slot,{scope:e.__scopeSelect,children:h.jsx("div",{children:e.children})})}),o):null}return h.jsx(X$,{...e,ref:t})});G$.displayName=ta;var jn=10,[K$,po]=tl(ta),fae="SelectContentImpl",dae=soe("SelectContent.RemoveScroll"),X$=_.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:u,sideOffset:f,align:l,alignOffset:d,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:y,avoidCollisions:w,...j}=e,O=ho(ta,r),[E,N]=_.useState(null),[A,C]=_.useState(null),T=Xe(t,X=>N(X)),[R,I]=_.useState(null),[z,$]=_.useState(null),L=am(r),[U,W]=_.useState(!1),V=_.useRef(!1);_.useEffect(()=>{if(E)return r_(E)},[E]),qS();const G=_.useCallback(X=>{const[ue,...ie]=L().map(oe=>oe.ref.current),[de]=ie.slice(-1),ye=document.activeElement;for(const oe of X)if(oe===ye||(oe?.scrollIntoView({block:"nearest"}),oe===ue&&A&&(A.scrollTop=0),oe===de&&A&&(A.scrollTop=A.scrollHeight),oe?.focus(),document.activeElement!==ye))return},[L,A]),Y=_.useCallback(()=>G([R,E]),[G,R,E]);_.useEffect(()=>{U&&Y()},[U,Y]);const{onOpenChange:D,triggerPointerDownPosRef:Q}=O;_.useEffect(()=>{if(E){let X={x:0,y:0};const ue=de=>{X={x:Math.abs(Math.round(de.pageX)-(Q.current?.x??0)),y:Math.abs(Math.round(de.pageY)-(Q.current?.y??0))}},ie=de=>{X.x<=10&&X.y<=10?de.preventDefault():E.contains(de.target)||D(!1),document.removeEventListener("pointermove",ue),Q.current=null};return Q.current!==null&&(document.addEventListener("pointermove",ue),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ue),document.removeEventListener("pointerup",ie,{capture:!0})}}},[E,D,Q]),_.useEffect(()=>{const X=()=>D(!1);return window.addEventListener("blur",X),window.addEventListener("resize",X),()=>{window.removeEventListener("blur",X),window.removeEventListener("resize",X)}},[D]);const[J,M]=u3(X=>{const ue=L().filter(ye=>!ye.disabled),ie=ue.find(ye=>ye.ref.current===document.activeElement),de=f3(ue,X,ie);de&&setTimeout(()=>de.ref.current.focus())}),B=_.useCallback((X,ue,ie)=>{const de=!V.current&&!ie;(O.value!==void 0&&O.value===ue||de)&&(I(X),de&&(V.current=!0))},[O.value]),Z=_.useCallback(()=>E?.focus(),[E]),te=_.useCallback((X,ue,ie)=>{const de=!V.current&&!ie;(O.value!==void 0&&O.value===ue||de)&&$(X)},[O.value]),ve=n==="popper"?mw:Y$,xe=ve===mw?{side:u,sideOffset:f,align:l,alignOffset:d,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:y,avoidCollisions:w}:{};return h.jsx(K$,{scope:r,content:E,viewport:A,onViewportChange:C,itemRefCallback:B,selectedItem:R,onItemLeave:Z,itemTextRefCallback:te,focusSelectedItem:Y,selectedItemText:z,position:n,isPositioned:U,searchRef:J,children:h.jsx(im,{as:dae,allowPinchZoom:!0,children:h.jsx(Qp,{asChild:!0,trapped:O.open,onMountAutoFocus:X=>{X.preventDefault()},onUnmountAutoFocus:ke(i,X=>{O.trigger?.focus({preventScroll:!0}),X.preventDefault()}),children:h.jsx(mu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:X=>X.preventDefault(),onDismiss:()=>O.onOpenChange(!1),children:h.jsx(ve,{role:"listbox",id:O.contentId,"data-state":O.open?"open":"closed",dir:O.dir,onContextMenu:X=>X.preventDefault(),...j,...xe,onPlaced:()=>W(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:ke(j.onKeyDown,X=>{const ue=X.ctrlKey||X.altKey||X.metaKey;if(X.key==="Tab"&&X.preventDefault(),!ue&&X.key.length===1&&M(X.key),["ArrowUp","ArrowDown","Home","End"].includes(X.key)){let de=L().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(X.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(X.key)){const ye=X.target,oe=de.indexOf(ye);de=de.slice(oe+1)}setTimeout(()=>G(de)),X.preventDefault()}})})})})})})});X$.displayName=fae;var hae="SelectItemAlignedPosition",Y$=_.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...i}=e,o=ho(ta,r),s=po(ta,r),[u,f]=_.useState(null),[l,d]=_.useState(null),p=Xe(t,T=>d(T)),m=am(r),g=_.useRef(!1),b=_.useRef(!0),{viewport:y,selectedItem:w,selectedItemText:j,focusSelectedItem:O}=s,E=_.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&l&&y&&w&&j){const T=o.trigger.getBoundingClientRect(),R=l.getBoundingClientRect(),I=o.valueNode.getBoundingClientRect(),z=j.getBoundingClientRect();if(o.dir!=="rtl"){const ye=z.left-R.left,oe=I.left-ye,$e=T.left-oe,Me=T.width+$e,Ye=Math.max(Me,R.width),lt=window.innerWidth-jn,vt=qb(oe,[jn,Math.max(jn,lt-Ye)]);u.style.minWidth=Me+"px",u.style.left=vt+"px"}else{const ye=R.right-z.right,oe=window.innerWidth-I.right-ye,$e=window.innerWidth-T.right-oe,Me=T.width+$e,Ye=Math.max(Me,R.width),lt=window.innerWidth-jn,vt=qb(oe,[jn,Math.max(jn,lt-Ye)]);u.style.minWidth=Me+"px",u.style.right=vt+"px"}const $=m(),L=window.innerHeight-jn*2,U=y.scrollHeight,W=window.getComputedStyle(l),V=parseInt(W.borderTopWidth,10),G=parseInt(W.paddingTop,10),Y=parseInt(W.borderBottomWidth,10),D=parseInt(W.paddingBottom,10),Q=V+G+U+D+Y,J=Math.min(w.offsetHeight*5,Q),M=window.getComputedStyle(y),B=parseInt(M.paddingTop,10),Z=parseInt(M.paddingBottom,10),te=T.top+T.height/2-jn,ve=L-te,xe=w.offsetHeight/2,X=w.offsetTop+xe,ue=V+G+X,ie=Q-ue;if(ue<=te){const ye=$.length>0&&w===$[$.length-1].ref.current;u.style.bottom="0px";const oe=l.clientHeight-y.offsetTop-y.offsetHeight,$e=Math.max(ve,xe+(ye?Z:0)+oe+Y),Me=ue+$e;u.style.height=Me+"px"}else{const ye=$.length>0&&w===$[0].ref.current;u.style.top="0px";const $e=Math.max(te,V+y.offsetTop+(ye?B:0)+xe)+ie;u.style.height=$e+"px",y.scrollTop=ue-te+y.offsetTop}u.style.margin=`${jn}px 0`,u.style.minHeight=J+"px",u.style.maxHeight=L+"px",n?.(),requestAnimationFrame(()=>g.current=!0)}},[m,o.trigger,o.valueNode,u,l,y,w,j,o.dir,n]);Rt(()=>E(),[E]);const[N,A]=_.useState();Rt(()=>{l&&A(window.getComputedStyle(l).zIndex)},[l]);const C=_.useCallback(T=>{T&&b.current===!0&&(E(),O?.(),b.current=!1)},[E,O]);return h.jsx(mae,{scope:r,contentWrapper:u,shouldExpandOnScrollRef:g,onScrollButtonChange:C,children:h.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:h.jsx(qe.div,{...i,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Y$.displayName=hae;var pae="SelectPopperPosition",mw=_.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=jn,...o}=e,s=sm(r);return h.jsx(JS,{...s,...o,ref:t,align:n,collisionPadding:i,style:{boxSizing:"border-box",...o.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)"}})});mw.displayName=pae;var[mae,n_]=tl(ta,{}),vw="SelectViewport",Q$=_.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...i}=e,o=po(vw,r),s=n_(vw,r),u=Xe(t,o.onViewportChange),f=_.useRef(0);return h.jsxs(h.Fragment,{children:[h.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}),h.jsx(om.Slot,{scope:r,children:h.jsx(qe.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ke(i.onScroll,l=>{const d=l.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=s;if(m?.current&&p){const g=Math.abs(f.current-d.scrollTop);if(g>0){const b=window.innerHeight-jn*2,y=parseFloat(p.style.minHeight),w=parseFloat(p.style.height),j=Math.max(y,w);if(j0?N:0,p.style.justifyContent="flex-end")}}}f.current=d.scrollTop})})})]})});Q$.displayName=vw;var Z$="SelectGroup",[vae,gae]=tl(Z$),yae=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=Xn();return h.jsx(vae,{scope:r,id:i,children:h.jsx(qe.div,{role:"group","aria-labelledby":i,...n,ref:t})})});yae.displayName=Z$;var J$="SelectLabel",xae=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=gae(J$,r);return h.jsx(qe.div,{id:i.id,...n,ref:t})});xae.displayName=J$;var op="SelectItem",[bae,e3]=tl(op),t3=_.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:o,...s}=e,u=ho(op,r),f=po(op,r),l=u.value===n,[d,p]=_.useState(o??""),[m,g]=_.useState(!1),b=Xe(t,O=>f.itemRefCallback?.(O,n,i)),y=Xn(),w=_.useRef("touch"),j=()=>{i||(u.onValueChange(n),u.onOpenChange(!1))};if(n==="")throw new Error("A 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 h.jsx(bae,{scope:r,value:n,disabled:i,textId:y,isSelected:l,onItemTextChange:_.useCallback(O=>{p(E=>E||(O?.textContent??"").trim())},[]),children:h.jsx(om.ItemSlot,{scope:r,value:n,disabled:i,textValue:d,children:h.jsx(qe.div,{role:"option","aria-labelledby":y,"data-highlighted":m?"":void 0,"aria-selected":l&&m,"data-state":l?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:b,onFocus:ke(s.onFocus,()=>g(!0)),onBlur:ke(s.onBlur,()=>g(!1)),onClick:ke(s.onClick,()=>{w.current!=="mouse"&&j()}),onPointerUp:ke(s.onPointerUp,()=>{w.current==="mouse"&&j()}),onPointerDown:ke(s.onPointerDown,O=>{w.current=O.pointerType}),onPointerMove:ke(s.onPointerMove,O=>{w.current=O.pointerType,i?f.onItemLeave?.():w.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ke(s.onPointerLeave,O=>{O.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:ke(s.onKeyDown,O=>{f.searchRef?.current!==""&&O.key===" "||(iae.includes(O.key)&&j(),O.key===" "&&O.preventDefault())})})})})});t3.displayName=op;var lc="SelectItemText",r3=_.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,...o}=e,s=ho(lc,r),u=po(lc,r),f=e3(lc,r),l=lae(lc,r),[d,p]=_.useState(null),m=Xe(t,j=>p(j),f.onItemTextChange,j=>u.itemTextRefCallback?.(j,f.value,f.disabled)),g=d?.textContent,b=_.useMemo(()=>h.jsx("option",{value:f.value,disabled:f.disabled,children:g},f.value),[f.disabled,f.value,g]),{onNativeOptionAdd:y,onNativeOptionRemove:w}=l;return Rt(()=>(y(b),()=>w(b)),[y,w,b]),h.jsxs(h.Fragment,{children:[h.jsx(qe.span,{id:f.textId,...o,ref:m}),f.isSelected&&s.valueNode&&!s.valueNodeHasChildren?ou.createPortal(o.children,s.valueNode):null]})});r3.displayName=lc;var n3="SelectItemIndicator",i3=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return e3(n3,r).isSelected?h.jsx(qe.span,{"aria-hidden":!0,...n,ref:t}):null});i3.displayName=n3;var gw="SelectScrollUpButton",o3=_.forwardRef((e,t)=>{const r=po(gw,e.__scopeSelect),n=n_(gw,e.__scopeSelect),[i,o]=_.useState(!1),s=Xe(t,n.onScrollButtonChange);return Rt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const l=f.scrollTop>0;o(l)};const f=r.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),i?h.jsx(s3,{...e,ref:s,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=r;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});o3.displayName=gw;var yw="SelectScrollDownButton",a3=_.forwardRef((e,t)=>{const r=po(yw,e.__scopeSelect),n=n_(yw,e.__scopeSelect),[i,o]=_.useState(!1),s=Xe(t,n.onScrollButtonChange);return Rt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const l=f.scrollHeight-f.clientHeight,d=Math.ceil(f.scrollTop)f.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),i?h.jsx(s3,{...e,ref:s,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=r;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});a3.displayName=yw;var s3=_.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...i}=e,o=po("SelectScrollButton",r),s=_.useRef(null),u=am(r),f=_.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return _.useEffect(()=>()=>f(),[f]),Rt(()=>{u().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),h.jsx(qe.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:ke(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:ke(i.onPointerMove,()=>{o.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:ke(i.onPointerLeave,()=>{f()})})}),wae="SelectSeparator",Sae=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return h.jsx(qe.div,{"aria-hidden":!0,...n,ref:t})});Sae.displayName=wae;var xw="SelectArrow",_ae=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=sm(r),o=ho(xw,r),s=po(xw,r);return o.open&&s.position==="popper"?h.jsx(e_,{...i,...n,ref:t}):null});_ae.displayName=xw;var jae="SelectBubbleInput",l3=_.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const i=_.useRef(null),o=Xe(n,i),s=t_(t);return _.useEffect(()=>{const u=i.current;if(!u)return;const f=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(f,"value").set;if(s!==t&&d){const p=new Event("change",{bubbles:!0});d.call(u,t),u.dispatchEvent(p)}},[s,t]),h.jsx(qe.select,{...r,style:{...N$,...r.style},ref:o,defaultValue:t})});l3.displayName=jae;function c3(e){return e===""||e===void 0}function u3(e){const t=ar(e),r=_.useRef(""),n=_.useRef(0),i=_.useCallback(s=>{const u=r.current+s;t(u),(function f(l){r.current=l,window.clearTimeout(n.current),l!==""&&(n.current=window.setTimeout(()=>f(""),1e3))})(u)},[t]),o=_.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,o]}function f3(e,t,r){const i=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let s=Oae(e,Math.max(o,0));i.length===1&&(s=s.filter(l=>l!==r));const f=s.find(l=>l.textValue.toLowerCase().startsWith(i.toLowerCase()));return f!==r?f:void 0}function Oae(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Eae=F$,Pae=q$,Aae=W$,Cae=H$,Nae=V$,Tae=G$,kae=Q$,Rae=t3,Mae=r3,Iae=i3,Dae=o3,Lae=a3;function Ze({...e}){return h.jsx(Eae,{"data-slot":"select",...e})}function Je({...e}){return h.jsx(Aae,{"data-slot":"select-value",...e})}function et({className:e,size:t="default",children:r,...n}){return h.jsxs(Pae,{"data-slot":"select-trigger","data-size":t,className:Te("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full items-center justify-between gap-2 rounded-md border bg-input-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[r,h.jsx(Cae,{asChild:!0,children:h.jsx(xc,{className:"size-4 opacity-50"})})]})}function nt({className:e,children:t,position:r="popper",...n}){return h.jsx(Nae,{children:h.jsxs(Tae,{"data-slot":"select-content",className:Te("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[h.jsx($ae,{}),h.jsx(kae,{className:Te("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),h.jsx(Bae,{})]})})}function Ae({className:e,children:t,...r}){return h.jsxs(Rae,{"data-slot":"select-item",className:Te("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[h.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:h.jsx(Iae,{children:h.jsx(YR,{className:"size-4"})})}),h.jsx(Mae,{children:t})]})}function $ae({className:e,...t}){return h.jsx(Dae,{"data-slot":"select-scroll-up-button",className:Te("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(I8,{className:"size-4"})})}function Bae({className:e,...t}){return h.jsx(Lae,{"data-slot":"select-scroll-down-button",className:Te("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(xc,{className:"size-4"})})}function Fae(){const e=[{id:1,location:"Location A",labelCategory:"Prep",productCategory:"Meat",product:"Chicken",template:'2"x2" Basic',labelType:"Defrost",lastEdited:"2025.12.03.11:45",hasError:!1},{id:2,location:"Location A",labelCategory:"Prep",productCategory:"Meat",product:"Chicken",template:'2"x2" Basic',labelType:"Opened/Preped",lastEdited:"2025.12.03.11:45",hasError:!1},{id:3,location:"Location A",labelCategory:"Prep",productCategory:"Meat",product:"Chicken",template:'2"x2" Basic',labelType:"Heated",lastEdited:"2025.12.03.11:45",hasError:!1},{id:4,location:"Location A",labelCategory:"Grab'n'Go",productCategory:"Sandwich",product:"Chicken Sandwich",template:`2"x6" G'n'G`,labelType:"",lastEdited:"2025.12.03.11:45",hasError:!0}];return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[h.jsx(be,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 text-gray-900 placeholder:text-gray-500"}),h.jsxs(Ze,{defaultValue:"all",children:[h.jsx(et,{className:"bg-white border border-gray-300 rounded-md w-[200px] shrink-0 text-gray-900",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Location"})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"all",children:"All Locations"}),h.jsx(Ae,{value:"loc-a",children:"Location A"}),h.jsx(Ae,{value:"loc-b",children:"Location B"})]})]}),h.jsxs("div",{className:"flex rounded-md border border-gray-300 bg-white h-10 overflow-hidden shrink-0",children:[h.jsx("button",{type:"button",className:"px-4 h-full border-r border-gray-200 text-sm font-medium text-gray-900 hover:bg-gray-50 transition-colors",children:"Bulk Import"}),h.jsx("button",{type:"button",className:"px-4 h-full border-r border-gray-200 text-sm font-medium text-gray-900 hover:bg-gray-50 transition-colors",children:"Bulk Export"}),h.jsx("button",{type:"button",className:"px-4 h-full text-sm font-medium text-gray-900 hover:bg-gray-50 transition-colors",children:"Bulk Edit"})]}),h.jsxs(we,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0 ml-auto",children:["New Label ",h.jsx(jr,{className:"ml-1 h-4 w-4"})]})]}),h.jsx("div",{className:"text-red-600 font-bold italic text-lg",children:"One or more of your labels are missing fields from their templates (! ! ! 1 in total)."}),h.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-50 hover:bg-gray-50",children:[h.jsx(me,{className:"font-bold text-gray-900 w-[120px]",children:"Location"}),h.jsx(me,{className:"font-bold text-gray-900 w-[140px]",children:"Label Category"}),h.jsx(me,{className:"font-bold text-gray-900 w-[140px]",children:"Product Category"}),h.jsx(me,{className:"font-bold text-gray-900",children:"Product"}),h.jsx(me,{className:"font-bold text-gray-900",children:"Template"}),h.jsx(me,{className:"font-bold text-gray-900",children:"Label Type"}),h.jsx(me,{className:"font-bold text-gray-900",children:"Last Edited"})]})}),h.jsx(mr,{children:e.map(t=>h.jsxs(Ke,{className:"hover:bg-gray-50",children:[h.jsx(se,{className:"font-medium",children:t.location}),h.jsx(se,{children:t.labelCategory}),h.jsx(se,{children:t.productCategory}),h.jsx(se,{children:t.product}),h.jsxs(se,{className:"font-medium",children:[t.template,t.hasError&&h.jsx("span",{className:"text-red-600 font-bold ml-2",children:"! ! !"})]}),h.jsx(se,{children:t.labelType||"-"}),h.jsx(se,{className:"text-gray-500 tabular-nums font-numeric",children:t.lastEdited})]},t.id))})]})})]})}function zae(){const e=[{id:1,category:"Prep",count:54,photo:"XXX",lastEdited:"2025.12.03.11:45"},{id:2,category:"Green",count:33,photo:"XXX",lastEdited:"2025.12.03.11:45"},{id:3,category:"Red",count:44,photo:"XXX",lastEdited:"2025.12.03.11:45"}];return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[h.jsx(be,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500"}),h.jsx("span",{className:"text-sm font-medium text-gray-900 whitespace-nowrap shrink-0",children:"Search"}),h.jsxs(Ze,{defaultValue:"all",children:[h.jsx(et,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Location"})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"all",children:"All Locations"}),h.jsx(Ae,{value:"loc-a",children:"Location A"}),h.jsx(Ae,{value:"loc-b",children:"Location B"})]})]}),h.jsx("span",{className:"text-sm font-medium text-gray-900 whitespace-nowrap shrink-0",children:"Location"}),h.jsxs(we,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0 ml-auto",children:["New Label Category ",h.jsx(jr,{className:"ml-1 h-4 w-4"})]})]}),h.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-50 hover:bg-gray-50",children:[h.jsx(me,{className:"font-bold text-gray-900 w-[250px]",children:"Label Category"}),h.jsx(me,{className:"font-bold text-gray-900 w-[200px]",children:"No. of Labels"}),h.jsx(me,{className:"font-bold text-gray-900 w-[200px]",children:"Category Photo"}),h.jsx(me,{className:"font-bold text-gray-900",children:"Last Edited"})]})}),h.jsx(mr,{children:e.map(t=>h.jsxs(Ke,{className:"hover:bg-gray-50",children:[h.jsx(se,{className:"font-medium",children:t.category}),h.jsx(se,{className:"font-numeric",children:t.count}),h.jsx(se,{className:"text-gray-500",children:t.photo}),h.jsx(se,{className:"text-gray-500 tabular-nums font-numeric",children:t.lastEdited})]},t.id))})]})})]})}function qae(){const e=[{id:1,type:"Defrost",count:54,lastEdited:"2025.12.03.11:45"},{id:2,type:"Thawed",count:33,lastEdited:"2025.12.03.11:45"},{id:3,type:"Opened",count:44,lastEdited:"2025.12.03.11:45"},{id:4,type:"Preped",count:17,lastEdited:"2025.12.03.11:45"},{id:5,type:"Heated",count:67,lastEdited:"2025.12.03.11:45"}];return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[h.jsx(be,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500"}),h.jsx("span",{className:"text-sm font-medium text-gray-900 whitespace-nowrap shrink-0",children:"Search"}),h.jsxs(Ze,{defaultValue:"all",children:[h.jsx(et,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Location"})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"all",children:"all"}),h.jsx(Ae,{value:"loc-a",children:"Location A"}),h.jsx(Ae,{value:"loc-b",children:"Location B"})]})]}),h.jsx("span",{className:"text-sm font-medium text-gray-900 whitespace-nowrap shrink-0",children:"Location"}),h.jsxs(we,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0 ml-auto",children:["New Label Type ",h.jsx(jr,{className:"ml-1 h-4 w-4"})]})]}),h.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-50 hover:bg-gray-50",children:[h.jsx(me,{className:"font-bold text-gray-900 w-[250px]",children:"Label Types"}),h.jsx(me,{className:"font-bold text-gray-900 w-[200px]",children:"No. of Labels"}),h.jsx(me,{className:"font-bold text-gray-900",children:"Last Edited"})]})}),h.jsx(mr,{children:e.map(t=>h.jsxs(Ke,{className:"hover:bg-gray-50",children:[h.jsx(se,{className:"font-medium",children:t.type}),h.jsx(se,{className:"font-numeric",children:t.count}),h.jsx(se,{className:"text-gray-500 tabular-nums font-numeric",children:t.lastEdited})]},t.id))})]})})]})}const Uae="label-template-",Wae="label-template-ids";function d3(e){return`${Uae}${e}`}function h3(){return Wae}function Hae(){return`template-${Date.now()}`}function Vae(){return`el-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Gae(e){return{id:e??Hae(),name:"未命名模板",labelType:"PRICE",unit:"cm",width:6,height:4,appliedLocation:"ALL",showRuler:!0,showGrid:!0,elements:[]}}const Rb=[{name:'2"×1"',width:2,height:1,unit:"inch"},{name:'2"×2"',width:2,height:2,unit:"inch"},{name:'3"×1"',width:3,height:1,unit:"inch"},{name:'3"×2"',width:3,height:2,unit:"inch"},{name:'4"×2"',width:4,height:2,unit:"inch"},{name:'4"×6"',width:4,height:6,unit:"inch"},{name:"6cm×4cm",width:6,height:4,unit:"cm"},{name:"10cm×6cm",width:10,height:6,unit:"cm"},{name:"A4",width:21,height:29.7,unit:"cm"},{name:"A5",width:14.8,height:21,unit:"cm"}];function Kae(e,t=20,r=20){const n=Vae(),o={TEXT_STATIC:{width:120,height:24,config:{text:"文本",fontFamily:"Arial",fontSize:14,fontWeight:"normal",textAlign:"left"}},TEXT_PRODUCT:{width:120,height:24,config:{text:"商品名",fontFamily:"Arial",fontSize:14,fontWeight:"normal",textAlign:"left"}},TEXT_PRICE:{width:80,height:24,config:{text:"0.00",prefix:"¥",decimal:2,fontFamily:"Arial",fontSize:14,fontWeight:"bold",textAlign:"right"}},BARCODE:{width:160,height:48,config:{barcodeType:"CODE128",data:"123456789",showText:!0,orientation:"horizontal"}},QRCODE:{width:80,height:80,config:{data:"https://example.com",errorLevel:"M"}},IMAGE:{width:60,height:60,config:{src:"",scaleMode:"contain"}},DATE:{width:120,height:24,config:{format:"YYYY-MM-DD",offsetDays:0}},TIME:{width:100,height:24,config:{format:"HH:mm",offsetDays:0}},DURATION:{width:120,height:24,config:{format:"YYYY-MM-DD",offsetDays:3}},WEIGHT:{width:80,height:24,config:{unit:"g",value:500}},WEIGHT_PRICE:{width:100,height:24,config:{unitPrice:10,weight:.5,currency:"¥"}},BLANK:{width:40,height:24,config:{}},NUTRITION:{width:200,height:120,config:{calories:120,fat:"5g",protein:"3g",carbs:"10g",layout:"standard"}}}[e];return{id:n,type:e,x:t,y:r,width:o.width,height:o.height,rotation:"horizontal",border:"none",config:{...o.config}}}function p3(){try{const e=localStorage.getItem(h3());if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function m3(e){try{const t=localStorage.getItem(d3(e));return t?JSON.parse(t):null}catch{return null}}function Fk(){const e=p3(),t=[];for(const r of e){const n=m3(r);n&&t.push(n)}return t.sort((r,n)=>n.id>r.id?1:-1)}function Xae(e){localStorage.setItem(h3(),JSON.stringify(e))}function Yae(e){const t=d3(e.id);localStorage.setItem(t,JSON.stringify(e));const r=p3();r.includes(e.id)||(r.push(e.id),Xae(r))}function Qae(e){const t=Zae(e),r=_.forwardRef((n,i)=>{const{children:o,...s}=n,u=_.Children.toArray(o),f=u.find(ese);if(f){const l=f.props.children,d=u.map(p=>p===f?_.Children.count(l)>1?_.Children.only(null):_.isValidElement(l)?l.props.children:null:p);return h.jsx(t,{...s,ref:i,children:_.isValidElement(l)?_.cloneElement(l,void 0,d):null})}return h.jsx(t,{...s,ref:i,children:o})});return r.displayName=`${e}.Slot`,r}function Zae(e){const t=_.forwardRef((r,n)=>{const{children:i,...o}=r;if(_.isValidElement(i)){const s=rse(i),u=tse(o,i.props);return i.type!==_.Fragment&&(u.ref=n?ia(n,s):s),_.cloneElement(i,u)}return _.Children.count(i)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Jae=Symbol("radix.slottable");function ese(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Jae}function tse(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...u)=>{const f=o(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function rse(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 lm="Dialog",[v3]=In(lm),[nse,Ln]=v3(lm),g3=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,u=_.useRef(null),f=_.useRef(null),[l,d]=Pi({prop:n,defaultProp:i??!1,onChange:o,caller:lm});return h.jsx(nse,{scope:t,triggerRef:u,contentRef:f,contentId:Xn(),titleId:Xn(),descriptionId:Xn(),open:l,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(p=>!p),[d]),modal:s,children:r})};g3.displayName=lm;var y3="DialogTrigger",ise=_.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Ln(y3,r),o=Xe(t,i.triggerRef);return h.jsx(qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":a_(i.open),...n,ref:o,onClick:ke(e.onClick,i.onOpenToggle)})});ise.displayName=y3;var i_="DialogPortal",[ose,x3]=v3(i_,{forceMount:void 0}),b3=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:i}=e,o=Ln(i_,t);return h.jsx(ose,{scope:t,forceMount:r,children:_.Children.map(n,s=>h.jsx(Or,{present:r||o.open,children:h.jsx(gu,{asChild:!0,container:i,children:s})}))})};b3.displayName=i_;var ap="DialogOverlay",w3=_.forwardRef((e,t)=>{const r=x3(ap,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,o=Ln(ap,e.__scopeDialog);return o.modal?h.jsx(Or,{present:n||o.open,children:h.jsx(sse,{...i,ref:t})}):null});w3.displayName=ap;var ase=Qae("DialogOverlay.RemoveScroll"),sse=_.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Ln(ap,r);return h.jsx(im,{as:ase,allowPinchZoom:!0,shards:[i.contentRef],children:h.jsx(qe.div,{"data-state":a_(i.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),ra="DialogContent",S3=_.forwardRef((e,t)=>{const r=x3(ra,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,o=Ln(ra,e.__scopeDialog);return h.jsx(Or,{present:n||o.open,children:o.modal?h.jsx(lse,{...i,ref:t}):h.jsx(cse,{...i,ref:t})})});S3.displayName=ra;var lse=_.forwardRef((e,t)=>{const r=Ln(ra,e.__scopeDialog),n=_.useRef(null),i=Xe(t,r.contentRef,n);return _.useEffect(()=>{const o=n.current;if(o)return r_(o)},[]),h.jsx(_3,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ke(e.onCloseAutoFocus,o=>{o.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:ke(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,u=s.button===0&&s.ctrlKey===!0;(s.button===2||u)&&o.preventDefault()}),onFocusOutside:ke(e.onFocusOutside,o=>o.preventDefault())})}),cse=_.forwardRef((e,t)=>{const r=Ln(ra,e.__scopeDialog),n=_.useRef(!1),i=_.useRef(!1);return h.jsx(_3,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(n.current||r.triggerRef.current?.focus(),o.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;r.triggerRef.current?.contains(s)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),_3=_.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,u=Ln(ra,r),f=_.useRef(null),l=Xe(t,f);return qS(),h.jsxs(h.Fragment,{children:[h.jsx(Qp,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:o,children:h.jsx(mu,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":a_(u.open),...s,ref:l,onDismiss:()=>u.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(use,{titleId:u.titleId}),h.jsx(dse,{contentRef:f,descriptionId:u.descriptionId})]})]})}),o_="DialogTitle",j3=_.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Ln(o_,r);return h.jsx(qe.h2,{id:i.titleId,...n,ref:t})});j3.displayName=o_;var O3="DialogDescription",E3=_.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Ln(O3,r);return h.jsx(qe.p,{id:i.descriptionId,...n,ref:t})});E3.displayName=O3;var P3="DialogClose",A3=_.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Ln(P3,r);return h.jsx(qe.button,{type:"button",...n,ref:t,onClick:ke(e.onClick,()=>i.onOpenChange(!1))})});A3.displayName=P3;function a_(e){return e?"open":"closed"}var C3="DialogTitleWarning",[Zue,N3]=BF(C3,{contentName:ra,titleName:o_,docsSlug:"dialog"}),use=({titleId:e})=>{const t=N3(C3),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return _.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},fse="DialogDescriptionWarning",dse=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${N3(fse).contentName}}.`;return _.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},hse=g3,pse=b3,mse=w3,vse=S3,gse=j3,yse=E3,xse=A3;function un({...e}){return h.jsx(hse,{"data-slot":"dialog",...e})}function bse({...e}){return h.jsx(pse,{"data-slot":"dialog-portal",...e})}function wse({className:e,...t}){return h.jsx(mse,{"data-slot":"dialog-overlay",className:Te("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function fn({className:e,children:t,...r}){return h.jsxs(bse,{"data-slot":"dialog-portal",children:[h.jsx(wse,{}),h.jsxs(vse,{"data-slot":"dialog-content",className:Te("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,h.jsxs(xse,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[h.jsx(uc,{}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function dn({className:e,...t}){return h.jsx("div",{"data-slot":"dialog-header",className:Te("flex flex-col gap-2 text-center sm:text-left",e),...t})}function $n({className:e,...t}){return h.jsx("div",{"data-slot":"dialog-footer",className:Te("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function hn({className:e,...t}){return h.jsx(gse,{"data-slot":"dialog-title",className:Te("text-lg leading-none font-semibold",e),...t})}function ki({className:e,...t}){return h.jsx(yse,{"data-slot":"dialog-description",className:Te("text-muted-foreground text-sm",e),...t})}const Sse=[{title:"模版信息",items:[{label:"Text",type:"TEXT_STATIC"},{label:"QR Code",type:"QRCODE"},{label:"Barcode",type:"BARCODE"},{label:"Blank Space",type:"BLANK"},{label:"Price",type:"TEXT_PRICE"},{label:"Image",type:"IMAGE"},{label:"Logo",type:"IMAGE"}]},{title:"标签信息",items:[{label:"Label Name",type:"TEXT_PRODUCT"},{label:"Text",type:"TEXT_STATIC"},{label:"QR Code",type:"QRCODE"},{label:"Barcode",type:"BARCODE"},{label:"Nutrition Facts",type:"NUTRITION"},{label:"Price",type:"TEXT_PRICE"},{label:"Duration Date",type:"DATE"},{label:"Duration Time",type:"TIME"},{label:"Duration",type:"DURATION"},{label:"Image",type:"IMAGE"},{label:"Label Type",type:"TEXT_STATIC"},{label:"How-to",type:"TEXT_STATIC"},{label:"Expiration Alert",type:"TEXT_STATIC"}]},{title:"自动生成",items:[{label:"Company",type:"TEXT_STATIC"},{label:"Employee",type:"TEXT_STATIC"},{label:"Current Date",type:"DATE"},{label:"Current Time",type:"TIME"},{label:"Label ID",type:"TEXT_STATIC"}]},{title:"打印时输入",subtitle:"点击添加到画布",items:[{label:"Text",type:"TEXT_STATIC",config:{inputType:"text"}},{label:"Weight",type:"WEIGHT"},{label:"Number",type:"TEXT_STATIC",config:{inputType:"number",text:"0"}},{label:"Date & Time",type:"DATE",config:{inputType:"datetime"}},{label:"Multiple Options",type:"TEXT_STATIC",config:{inputType:"options"}}]}];function _se({onAddElement:e}){return h.jsxs("div",{className:"w-44 shrink-0 border-r border-gray-200 bg-white flex flex-col h-full",children:[h.jsx("div",{className:"px-2 py-2 border-b border-gray-200 font-semibold text-gray-800 text-sm",children:"Elements"}),h.jsx(wc,{className:"flex-1",children:h.jsx("div",{className:"p-1.5 space-y-3",children:Sse.map(t=>h.jsxs("div",{children:[h.jsx("div",{className:"px-2 py-1 text-xs font-medium text-gray-500 uppercase tracking-wide",children:t.title}),t.subtitle&&h.jsx("div",{className:"px-2 py-0.5 text-[10px] text-gray-400",children:t.subtitle}),h.jsx("div",{className:"grid grid-cols-2 gap-1 mt-0.5",children:t.items.map((r,n)=>h.jsx("button",{type:"button",onClick:()=>e(r.type,r.config),className:"text-left px-2 py-1 text-xs rounded hover:bg-gray-100 border border-transparent hover:border-gray-200 truncate",children:r.label},`${t.title}-${r.label}-${n}`))})]},t.title))})})]})}var nd={},Jl={},id={},zk;function Vr(){if(zk)return id;zk=1,Object.defineProperty(id,"__esModule",{value:!0});function e(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}var t=function r(n,i){e(this,r),this.data=n,this.text=i.text||n,this.options=i};return id.default=t,id}var qk;function jse(){if(qk)return Jl;qk=1,Object.defineProperty(Jl,"__esModule",{value:!0}),Jl.CODE39=void 0;var e=(function(){function y(w,j){for(var O=0;O=200){w=m.shift()-105;var j=n.SWAP[w];j!==void 0?y=d.next(m,g+1,j):((b===n.SET_A||b===n.SET_B)&&w===n.SHIFT&&(m[0]=b===n.SET_A?m[0]>95?m[0]-96:m[0]:m[0]<32?m[0]+96:m[0]),y=d.next(m,g+1,b))}else w=d.correctIndex(m,b),y=d.next(m,g+1,b);var O=d.getBar(w),E=w*g;return{result:O+y.result,checksum:E+y.checksum}}}]),d})(r.default);return ad.default=f,ad}var sd={},Hk;function Ose(){if(Hk)return sd;Hk=1,Object.defineProperty(sd,"__esModule",{value:!0});var e=yu(),t=function(u){return u.match(new RegExp("^"+e.A_CHARS+"*"))[0].length},r=function(u){return u.match(new RegExp("^"+e.B_CHARS+"*"))[0].length},n=function(u){return u.match(new RegExp("^"+e.C_CHARS+"*"))[0]};function i(s,u){var f=u?e.A_CHARS:e.B_CHARS,l=s.match(new RegExp("^("+f+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(l)return l[1]+"Ì"+o(s.substring(l[1].length));var d=s.match(new RegExp("^"+f+"+"))[0];return d.length===s.length?s:d+String.fromCharCode(u?205:206)+i(s.substring(d.length),!u)}function o(s){var u=n(s),f=u.length;if(f===s.length)return s;s=s.substring(f);var l=t(s)>=r(s);return u+String.fromCharCode(l?206:205)+i(s,l)}return sd.default=function(s){var u=void 0,f=n(s).length;if(f>=2)u=e.C_START_CHAR+o(s);else{var l=t(s)>r(s);u=(l?e.A_START_CHAR:e.B_START_CHAR)+i(s,l)}return u.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(d,p){return"Ë"+p})},sd}var Vk;function Ese(){if(Vk)return od;Vk=1,Object.defineProperty(od,"__esModule",{value:!0});var e=cm(),t=i(e),r=Ose(),n=i(r);function i(l){return l&&l.__esModule?l:{default:l}}function o(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}function s(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:l}function u(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}var f=(function(l){u(d,l);function d(p,m){if(o(this,d),/^[\x00-\x7F\xC8-\xD3]+$/.test(p))var g=s(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,(0,n.default)(p),m));else var g=s(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,p,m));return s(g)}return d})(t.default);return od.default=f,od}var ld={},Gk;function Pse(){if(Gk)return ld;Gk=1,Object.defineProperty(ld,"__esModule",{value:!0});var e=(function(){function l(d,p){for(var m=0;mb.width*10?b.width*10:b.fontSize,y.guardHeight=b.height+y.fontSize/2+b.textMargin,y}return e(m,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(b,y){return this.text.substr(b,y)}},{key:"leftEncode",value:function(b,y){return(0,n.default)(b,y)}},{key:"rightText",value:function(b,y){return this.text.substr(b,y)}},{key:"rightEncode",value:function(b,y){return(0,n.default)(b,y)}},{key:"encodeGuarded",value:function(){var b={fontSize:this.fontSize},y={height:this.guardHeight};return[{data:t.SIDE_BIN,options:y},{data:this.leftEncode(),text:this.leftText(),options:b},{data:t.MIDDLE_BIN,options:y},{data:this.rightEncode(),text:this.rightText(),options:b},{data:t.SIDE_BIN,options:y}]}},{key:"encodeFlat",value:function(){var b=[t.SIDE_BIN,this.leftEncode(),t.MIDDLE_BIN,this.rightEncode(),t.SIDE_BIN];return{data:b.join(""),text:this.text}}}]),m})(o.default);return dd.default=d,dd}var eR;function Tse(){if(eR)return fd;eR=1,Object.defineProperty(fd,"__esModule",{value:!0});var e=(function(){function p(m,g){for(var b=0;bb.width*10?y.fontSize=b.width*10:y.fontSize=b.fontSize,y.guardHeight=b.height+y.fontSize/2+b.textMargin,y}return e(m,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==d(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var b="";return b+="101",b+=(0,r.default)(this.data.substr(0,6),"LLLLLL"),b+="01010",b+=(0,r.default)(this.data.substr(6,6),"RRRRRR"),b+="101",{data:b,text:this.text}}},{key:"guardedEncoding",value:function(){var b=[];return this.displayValue&&b.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),b.push({data:"101"+(0,r.default)(this.data[0],"L"),options:{height:this.guardHeight}}),b.push({data:(0,r.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),b.push({data:"01010",options:{height:this.guardHeight}}),b.push({data:(0,r.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),b.push({data:(0,r.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&b.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),b}}]),m})(i.default);function d(p){var m=0,g;for(g=1;g<11;g+=2)m+=parseInt(p[g]);for(g=0;g<11;g+=2)m+=parseInt(p[g])*3;return(10-m%10)%10}return ec.default=l,ec}var gd={},oR;function Ise(){if(oR)return gd;oR=1,Object.defineProperty(gd,"__esModule",{value:!0});var e=(function(){function b(y,w){for(var j=0;jj.width*10?O.fontSize=j.width*10:O.fontSize=j.fontSize,O.guardHeight=j.height+O.fontSize/2+j.textMargin,O}return e(y,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var j="";return j+="101",j+=this.encodeMiddleDigits(),j+="010101",{data:j,text:this.text}}},{key:"guardedEncoding",value:function(){var j=[];return this.displayValue&&j.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),j.push({data:"101",options:{height:this.guardHeight}}),j.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),j.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&j.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),j}},{key:"encodeMiddleDigits",value:function(){var j=this.upcA[0],O=this.upcA[this.upcA.length-1],E=p[parseInt(O)][parseInt(j)];return(0,r.default)(this.middleDigits,E)}}]),y})(i.default);function g(b,y){for(var w=parseInt(b[b.length-1]),j=d[w],O="",E=0,N=0;N=3&&this.number<=131070}}]),l})(r.default);return rc.pharmacode=u,rc}var nc={},xR;function Vse(){if(xR)return nc;xR=1,Object.defineProperty(nc,"__esModule",{value:!0}),nc.codabar=void 0;var e=(function(){function f(l,d){for(var p=0;p":["(%)","I"],"?":["(%)","J"],"@":["(%)","V"],"[":["(%)","K"],"\\":["(%)","L"],"]":["(%)","M"],"^":["(%)","N"],_:["(%)","O"],"`":["(%)","W"],a:["(+)","A"],b:["(+)","B"],c:["(+)","C"],d:["(+)","D"],e:["(+)","E"],f:["(+)","F"],g:["(+)","G"],h:["(+)","H"],i:["(+)","I"],j:["(+)","J"],k:["(+)","K"],l:["(+)","L"],m:["(+)","M"],n:["(+)","N"],o:["(+)","O"],p:["(+)","P"],q:["(+)","Q"],r:["(+)","R"],s:["(+)","S"],t:["(+)","T"],u:["(+)","U"],v:["(+)","V"],w:["(+)","W"],x:["(+)","X"],y:["(+)","Y"],z:["(+)","Z"],"{":["(%)","P"],"|":["(%)","Q"],"}":["(%)","R"],"~":["(%)","S"],"":["(%)","T"]}),Va}var wR;function M3(){if(wR)return Od;wR=1,Object.defineProperty(Od,"__esModule",{value:!0});var e=(function(){function l(d,p){for(var m=0;m0?d.fontSize+d.textMargin:0)+d.marginTop+d.marginBottom}function i(l,d,p){if(p.displayValue&&dd&&(d=l[p].height);return d}function f(l,d,p){var m;if(p)m=p;else if(typeof document<"u")m=document.createElement("canvas").getContext("2d");else return 0;m.font=d.fontOptions+" "+d.fontSize+"px "+d.font;var g=m.measureText(l);if(!g)return 0;var b=g.width;return b}return Mr.getMaximumHeightOfEncodings=u,Mr.getEncodingHeight=n,Mr.getBarcodePadding=i,Mr.calculateEncodingAttributes=o,Mr.getTotalWidthOfEncodings=s,Mr}var RR;function tle(){if(RR)return Id;RR=1,Object.defineProperty(Id,"__esModule",{value:!0});var e=(function(){function u(f,l){for(var d=0;d0?(g=0,p.textAlign="left"):l.textAlign=="right"?(g=d.width-1,p.textAlign="right"):(g=d.width/2,p.textAlign="center"),p.fillText(d.text,g,b)}}},{key:"moveCanvasDrawing",value:function(l){var d=this.canvas.getContext("2d");d.translate(l.width,0)}},{key:"restoreCanvas",value:function(){var l=this.canvas.getContext("2d");l.restore()}}]),u})();return Id.default=s,Id}var Dd={},MR;function rle(){if(MR)return Dd;MR=1,Object.defineProperty(Dd,"__esModule",{value:!0});var e=(function(){function f(l,d){for(var p=0;p0&&(this.drawRect(w-p.width*y,b,p.width*y,p.height,d),y=0);y>0&&this.drawRect(w-p.width*(y-1),b,p.width*y,p.height,d)}},{key:"drawSVGText",value:function(d,p,m){var g=this.document.createElementNS(s,"text");if(p.displayValue){var b,y;g.setAttribute("font-family",p.font),g.setAttribute("font-size",p.fontSize),p.fontOptions.includes("bold")&&g.setAttribute("font-weight","bold"),p.fontOptions.includes("italic")&&g.setAttribute("font-style","italic"),p.textPosition=="top"?y=p.fontSize-p.textMargin:y=p.height+p.textMargin+p.fontSize,p.textAlign=="left"||m.barcodePadding>0?(b=0,g.setAttribute("text-anchor","start")):p.textAlign=="right"?(b=m.width-1,g.setAttribute("text-anchor","end")):(b=m.width/2,g.setAttribute("text-anchor","middle")),g.setAttribute("x",b),g.setAttribute("y",y),g.appendChild(this.document.createTextNode(m.text)),d.appendChild(g)}}},{key:"setSvgAttributes",value:function(d,p){var m=this.svg;m.setAttribute("width",d+"px"),m.setAttribute("height",p+"px"),m.setAttribute("x","0px"),m.setAttribute("y","0px"),m.setAttribute("viewBox","0 0 "+d+" "+p),m.setAttribute("xmlns",s),m.setAttribute("version","1.1")}},{key:"createGroup",value:function(d,p,m){var g=this.document.createElementNS(s,"g");return g.setAttribute("transform","translate("+d+", "+p+")"),m.appendChild(g),g}},{key:"setGroupOptions",value:function(d,p){d.setAttribute("fill",p.lineColor)}},{key:"drawRect",value:function(d,p,m,g,b){var y=this.document.createElementNS(s,"rect");return y.setAttribute("x",d),y.setAttribute("y",p),y.setAttribute("width",m),y.setAttribute("height",g),b.appendChild(y),y}}]),f})();return Dd.default=u,Dd}var Ld={},IR;function nle(){if(IR)return Ld;IR=1,Object.defineProperty(Ld,"__esModule",{value:!0});var e=(function(){function n(i,o){for(var s=0;s"u"?"undefined":e(d))==="object"&&!d.nodeName)return{element:d,renderer:i.default.ObjectRenderer};throw new o.InvalidElementException}}function f(d){var p=document.querySelectorAll(d);if(p.length!==0){for(var m=[],g=0;g"u")throw Error("No element to render on was provided.");return U._renderProperties=(0,l.default)(z),U._encodings=[],U._options=w.default,U._errorHandler=new g.default(U),typeof $<"u"&&(L=L||{},L.format||(L.format=T()),U.options(L)[L.format]($,L).render()),U};E.getModule=function(I){return t.default[I]};for(var N in t.default)t.default.hasOwnProperty(N)&&A(t.default,N);function A(I,z){O.prototype[z]=O.prototype[z.toUpperCase()]=O.prototype[z.toLowerCase()]=function($,L){var U=this;return U._errorHandler.wrapBarcodeCall(function(){L.text=typeof L.text>"u"?void 0:""+L.text;var W=(0,n.default)(U._options,L);W=(0,p.default)(W);var V=I[z],G=C($,V,W);return U._encodings.push(G),U})}}function C(I,z,$){I=""+I;var L=new z(I,$);if(!L.valid())throw new b.InvalidInputException(L.constructor.name,I);var U=L.encode();U=(0,o.default)(U);for(var W=0;Wt in e?ule(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bw=(e,t)=>{for(var r in t||(t={}))B3.call(t,r)&&zR(e,r,t[r]);if(sp)for(var r of sp(t))F3.call(t,r)&&zR(e,r,t[r]);return e},ww=(e,t)=>{var r={};for(var n in e)B3.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&sp)for(var n of sp(e))t.indexOf(n)<0&&F3.call(e,n)&&(r[n]=e[n]);return r};/** + * @license QR Code generator library (TypeScript) + * Copyright (c) Project Nayuki. + * SPDX-License-Identifier: MIT + */var na;(e=>{const t=class Ge{constructor(f,l,d,p){if(this.version=f,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],fGe.MAX_VERSION)throw new RangeError("Version value out of range");if(p<-1||p>7)throw new RangeError("Mask value out of range");this.size=f*4+17;let m=[];for(let b=0;b7)throw new RangeError("Invalid value");let b,y;for(b=d;;b++){const E=Ge.getNumDataCodewords(b,l)*8,N=s.getTotalBits(f,b);if(N<=E){y=N;break}if(b>=p)throw new RangeError("Data too long")}for(const E of[Ge.Ecc.MEDIUM,Ge.Ecc.QUARTILE,Ge.Ecc.HIGH])g&&y<=Ge.getNumDataCodewords(b,E)*8&&(l=E);let w=[];for(const E of f){r(E.mode.modeBits,4,w),r(E.numChars,E.mode.numCharCountBits(b),w);for(const N of E.getData())w.push(N)}i(w.length==y);const j=Ge.getNumDataCodewords(b,l)*8;i(w.length<=j),r(0,Math.min(4,j-w.length),w),r(0,(8-w.length%8)%8,w),i(w.length%8==0);for(let E=236;w.lengthO[N>>>3]|=E<<7-(N&7)),new Ge(b,l,O,m)}getModule(f,l){return 0<=f&&f>>9)*1335;const p=(l<<10|d)^21522;i(p>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,n(p,m));this.setFunctionModule(8,7,n(p,6)),this.setFunctionModule(8,8,n(p,7)),this.setFunctionModule(7,8,n(p,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,n(p,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,n(p,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,n(p,m));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let f=this.version;for(let d=0;d<12;d++)f=f<<1^(f>>>11)*7973;const l=this.version<<12|f;i(l>>>18==0);for(let d=0;d<18;d++){const p=n(l,d),m=this.size-11+d%3,g=Math.floor(d/3);this.setFunctionModule(m,g,p),this.setFunctionModule(g,m,p)}}drawFinderPattern(f,l){for(let d=-4;d<=4;d++)for(let p=-4;p<=4;p++){const m=Math.max(Math.abs(p),Math.abs(d)),g=f+p,b=l+d;0<=g&&g{(E!=y-m||A>=b)&&O.push(N[E])});return i(O.length==g),O}drawCodewords(f){if(f.length!=Math.floor(Ge.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let d=this.size-1;d>=1;d-=2){d==6&&(d=5);for(let p=0;p>>3],7-(l&7)),l++)}}i(l==f.length*8)}applyMask(f){if(f<0||f>7)throw new RangeError("Mask value out of range");for(let l=0;l5&&f++):(this.finderPenaltyAddHistory(b,y),g||(f+=this.finderPenaltyCountPatterns(y)*Ge.PENALTY_N3),g=this.modules[m][w],b=1);f+=this.finderPenaltyTerminateAndCount(g,b,y)*Ge.PENALTY_N3}for(let m=0;m5&&f++):(this.finderPenaltyAddHistory(b,y),g||(f+=this.finderPenaltyCountPatterns(y)*Ge.PENALTY_N3),g=this.modules[w][m],b=1);f+=this.finderPenaltyTerminateAndCount(g,b,y)*Ge.PENALTY_N3}for(let m=0;mg+(b?1:0),l);const d=this.size*this.size,p=Math.ceil(Math.abs(l*20-d*10)/d)-1;return i(0<=p&&p<=9),f+=p*Ge.PENALTY_N4,i(0<=f&&f<=2568888),f}getAlignmentPatternPositions(){if(this.version==1)return[];{const f=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(f*2-2))*2;let d=[6];for(let p=this.size-7;d.lengthGe.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*f+128)*f+64;if(f>=2){const d=Math.floor(f/7)+2;l-=(25*d-10)*d-55,f>=7&&(l-=36)}return i(208<=l&&l<=29648),l}static getNumDataCodewords(f,l){return Math.floor(Ge.getNumRawDataModules(f)/8)-Ge.ECC_CODEWORDS_PER_BLOCK[l.ordinal][f]*Ge.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][f]}static reedSolomonComputeDivisor(f){if(f<1||f>255)throw new RangeError("Degree out of range");let l=[];for(let p=0;p0);for(const p of f){const m=p^d.shift();d.push(0),l.forEach((g,b)=>d[b]^=Ge.reedSolomonMultiply(g,m))}return d}static reedSolomonMultiply(f,l){if(f>>>8||l>>>8)throw new RangeError("Byte out of range");let d=0;for(let p=7;p>=0;p--)d=d<<1^(d>>>7)*285,d^=(l>>>p&1)*f;return i(d>>>8==0),d}finderPenaltyCountPatterns(f){const l=f[1];i(l<=this.size*3);const d=l>0&&f[2]==l&&f[3]==l*3&&f[4]==l&&f[5]==l;return(d&&f[0]>=l*4&&f[6]>=l?1:0)+(d&&f[6]>=l*4&&f[0]>=l?1:0)}finderPenaltyTerminateAndCount(f,l,d){return f&&(this.finderPenaltyAddHistory(l,d),l=0),l+=this.size,this.finderPenaltyAddHistory(l,d),this.finderPenaltyCountPatterns(d)}finderPenaltyAddHistory(f,l){l[0]==0&&(f+=this.size),l.pop(),l.unshift(f)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function r(u,f,l){if(f<0||f>31||u>>>f)throw new RangeError("Value out of range");for(let d=f-1;d>=0;d--)l.push(u>>>d&1)}function n(u,f){return(u>>>f&1)!=0}function i(u){if(!u)throw new Error("Assertion error")}const o=class Et{constructor(f,l,d){if(this.mode=f,this.numChars=l,this.bitData=d,l<0)throw new RangeError("Invalid argument");this.bitData=d.slice()}static makeBytes(f){let l=[];for(const d of f)r(d,8,l);return new Et(Et.Mode.BYTE,f.length,l)}static makeNumeric(f){if(!Et.isNumeric(f))throw new RangeError("String contains non-numeric characters");let l=[];for(let d=0;d=1<{(t=>{const r=class{constructor(i,o){this.ordinal=i,this.formatBits=o}};r.LOW=new r(0,1),r.MEDIUM=new r(1,0),r.QUARTILE=new r(2,3),r.HIGH=new r(3,2),t.Ecc=r})(e.QrCode||(e.QrCode={}))})(na||(na={}));(e=>{(t=>{const r=class{constructor(i,o){this.modeBits=i,this.numBitsCharCount=o}numCharCountBits(i){return this.numBitsCharCount[Math.floor((i+7)/17)]}};r.NUMERIC=new r(1,[10,12,14]),r.ALPHANUMERIC=new r(2,[9,11,13]),r.BYTE=new r(4,[8,16,16]),r.KANJI=new r(8,[8,10,12]),r.ECI=new r(7,[0,0,0]),t.Mode=r})(e.QrSegment||(e.QrSegment={}))})(na||(na={}));var es=na;/** + * @license qrcode.react + * Copyright (c) Paul O'Shannessy + * SPDX-License-Identifier: ISC + */var fle={L:es.QrCode.Ecc.LOW,M:es.QrCode.Ecc.MEDIUM,Q:es.QrCode.Ecc.QUARTILE,H:es.QrCode.Ecc.HIGH},z3=128,q3="L",U3="#FFFFFF",W3="#000000",H3=!1,V3=1,dle=4,hle=0,ple=.1;function G3(e,t=0){const r=[];return e.forEach(function(n,i){let o=null;n.forEach(function(s,u){if(!s&&o!==null){r.push(`M${o+t} ${i+t}h${u-o}v1H${o+t}z`),o=null;return}if(u===n.length-1){if(!s)return;o===null?r.push(`M${u+t},${i+t} h1v1H${u+t}z`):r.push(`M${o+t},${i+t} h${u+1-o}v1H${o+t}z`);return}s&&o===null&&(o=u)})}),r.join("")}function K3(e,t){return e.slice().map((r,n)=>n=t.y+t.h?r:r.map((i,o)=>o=t.x+t.w?i:!1))}function mle(e,t,r,n){if(n==null)return null;const i=e.length+r*2,o=Math.floor(t*ple),s=i/t,u=(n.width||o)*s,f=(n.height||o)*s,l=n.x==null?e.length/2-u/2:n.x*s,d=n.y==null?e.length/2-f/2:n.y*s,p=n.opacity==null?1:n.opacity;let m=null;if(n.excavate){let b=Math.floor(l),y=Math.floor(d),w=Math.ceil(u+l-b),j=Math.ceil(f+d-y);m={x:b,y,w,h:j}}const g=n.crossOrigin;return{x:l,y:d,h:f,w:u,excavation:m,opacity:p,crossOrigin:g}}function vle(e,t){return t!=null?Math.max(Math.floor(t),0):e?dle:hle}function X3({value:e,level:t,minVersion:r,includeMargin:n,marginSize:i,imageSettings:o,size:s,boostLevel:u}){let f=F.useMemo(()=>{const b=(Array.isArray(e)?e:[e]).reduce((y,w)=>(y.push(...es.QrSegment.makeSegments(w)),y),[]);return es.QrCode.encodeSegments(b,fle[t],r,void 0,void 0,u)},[e,t,r,u]);const{cells:l,margin:d,numCells:p,calculatedImageSettings:m}=F.useMemo(()=>{let g=f.getModules();const b=vle(n,i),y=g.length+b*2,w=mle(g,s,b,o);return{cells:g,margin:b,numCells:y,calculatedImageSettings:w}},[f,s,o,n,i]);return{qrcode:f,margin:d,cells:l,numCells:p,calculatedImageSettings:m}}var gle=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),yle=F.forwardRef(function(t,r){const n=t,{value:i,size:o=z3,level:s=q3,bgColor:u=U3,fgColor:f=W3,includeMargin:l=H3,minVersion:d=V3,boostLevel:p,marginSize:m,imageSettings:g}=n,y=ww(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:w}=y,j=ww(y,["style"]),O=g?.src,E=F.useRef(null),N=F.useRef(null),A=F.useCallback(W=>{E.current=W,typeof r=="function"?r(W):r&&(r.current=W)},[r]),[C,T]=F.useState(!1),{margin:R,cells:I,numCells:z,calculatedImageSettings:$}=X3({value:i,level:s,minVersion:d,boostLevel:p,includeMargin:l,marginSize:m,imageSettings:g,size:o});F.useEffect(()=>{if(E.current!=null){const W=E.current,V=W.getContext("2d");if(!V)return;let G=I;const Y=N.current,D=$!=null&&Y!==null&&Y.complete&&Y.naturalHeight!==0&&Y.naturalWidth!==0;D&&$.excavation!=null&&(G=K3(I,$.excavation));const Q=window.devicePixelRatio||1;W.height=W.width=o*Q;const J=o/z*Q;V.scale(J,J),V.fillStyle=u,V.fillRect(0,0,z,z),V.fillStyle=f,gle?V.fill(new Path2D(G3(G,R))):I.forEach(function(M,B){M.forEach(function(Z,te){Z&&V.fillRect(te+R,B+R,1,1)})}),$&&(V.globalAlpha=$.opacity),D&&V.drawImage(Y,$.x+R,$.y+R,$.w,$.h)}}),F.useEffect(()=>{T(!1)},[O]);const L=bw({height:o,width:o},w);let U=null;return O!=null&&(U=F.createElement("img",{src:O,key:O,style:{display:"none"},onLoad:()=>{T(!0)},ref:N,crossOrigin:$?.crossOrigin})),F.createElement(F.Fragment,null,F.createElement("canvas",bw({style:L,height:o,width:o,ref:A,role:"img"},j)),U)});yle.displayName="QRCodeCanvas";var Y3=F.forwardRef(function(t,r){const n=t,{value:i,size:o=z3,level:s=q3,bgColor:u=U3,fgColor:f=W3,includeMargin:l=H3,minVersion:d=V3,boostLevel:p,title:m,marginSize:g,imageSettings:b}=n,y=ww(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:w,cells:j,numCells:O,calculatedImageSettings:E}=X3({value:i,level:s,minVersion:d,boostLevel:p,includeMargin:l,marginSize:g,imageSettings:b,size:o});let N=j,A=null;b!=null&&E!=null&&(E.excavation!=null&&(N=K3(j,E.excavation)),A=F.createElement("image",{href:b.src,height:E.h,width:E.w,x:E.x+w,y:E.y+w,preserveAspectRatio:"none",opacity:E.opacity,crossOrigin:E.crossOrigin}));const C=G3(N,w);return F.createElement("svg",bw({height:o,width:o,viewBox:`0 0 ${O} ${O}`,ref:r,role:"img"},y),!!m&&F.createElement("title",null,m),F.createElement("path",{fill:u,d:`M0,0 h${O}v${O}H0z`,shapeRendering:"crispEdges"}),F.createElement("path",{fill:f,d:C,shapeRendering:"crispEdges"}),A)});Y3.displayName="QRCodeSVG";function xle({data:e,width:t,height:r,showText:n,orientation:i="horizontal"}){const o=_.useRef(null),s=i==="vertical",u=Math.max(20,(s?t:r)-(n?14:4));_.useEffect(()=>{if(o.current&&e)try{cle(o.current,e,{format:"CODE128",width:1,height:u,displayValue:n!==!1,margin:2,fontOptions:"",fontSize:10})}catch{}},[e,u,n]);const f=h.jsx("svg",{ref:o,className:"w-full h-full min-h-0",style:{maxHeight:s?t:r}});return s?h.jsx("div",{className:"w-full h-full flex items-center justify-center",children:h.jsx("div",{style:{transform:"rotate(-90deg)",transformOrigin:"center center",width:r,height:t,display:"flex",alignItems:"center",justifyContent:"center"},children:f})}):f}const yc=8;function Ka(e){return Math.round(e/yc)*yc}function lp(e,t){return t==="cm"?e*37.8:e*96}function qR(e,t){return t==="cm"?e/37.8:e/96}function Q3({el:e}){const t=e.config,r=e.type,n={fontSize:t?.fontSize??14,fontFamily:t?.fontFamily??"Arial",fontWeight:t?.fontWeight??"normal",textAlign:t?.textAlign??"left",color:t?.color??"#000"},i=t?.inputType;if(r==="TEXT_STATIC"){const o=t?.text??"文本";return i==="number"?h.jsx("input",{type:"number",readOnly:!0,value:t?.text??"0",className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 pointer-events-none",style:{...n,textAlign:"right"}}):i==="options"?h.jsxs("div",{className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 flex items-center pointer-events-none text-gray-500",style:n,children:[h.jsx("span",{className:"truncate flex-1",children:o||"请选择..."}),h.jsx("span",{className:"ml-auto text-gray-400",children:"▼"})]}):i==="text"?h.jsx("input",{type:"text",readOnly:!0,value:o,className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 pointer-events-none",style:n}):h.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-pre-wrap break-all leading-tight",style:n,children:o})}if(r==="TEXT_PRODUCT"){const o=t?.text??"商品名";return h.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-pre-wrap break-all leading-tight",style:n,children:o})}if(r==="TEXT_PRICE"){const o=t?.prefix??"¥",s=t?.text??"0.00";return h.jsxs("div",{className:"w-full h-full px-1 overflow-hidden flex items-center",style:{...n,justifyContent:n.textAlign==="center"?"center":n.textAlign==="right"?"flex-end":"flex-start"},children:[h.jsx("span",{children:o}),h.jsx("span",{children:s})]})}if(r==="BARCODE"){const o=t?.data??"123456789",s=t?.showText!==!1,u=t?.orientation==="vertical"?"vertical":"horizontal";return h.jsx("div",{className:"flex flex-col items-center justify-center w-full h-full overflow-hidden p-0.5",children:h.jsx("div",{className:"flex-1 w-full min-h-0 flex items-center justify-center",children:h.jsx(xle,{data:o,width:e.width,height:e.height,showText:s,orientation:u})})})}if(r==="QRCODE"){const o=t?.data??"https://example.com",s=Math.min(e.width,e.height)-4;return h.jsx("div",{className:"w-full h-full flex items-center justify-center p-0.5",children:h.jsx(Y3,{value:o,size:Math.max(20,s),level:"M",includeMargin:!1})})}if(r==="IMAGE"){const o=t?.src;return o?h.jsx("img",{src:o,alt:"",className:"w-full h-full object-contain"}):h.jsx("div",{className:"w-full h-full flex flex-col items-center justify-center bg-gray-100 text-gray-500 text-[10px] border border-dashed border-gray-300",children:h.jsx("span",{className:"font-medium",children:"Logo"})})}if(r==="DATE"){const s=(t?.format??"YYYY-MM-DD").replace("YYYY","2025").replace("MM","02").replace("DD","01");return t?.inputType==="datetime"||t?.inputType==="date"?h.jsx("input",{type:"date",readOnly:!0,value:"2025-02-01",className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 pointer-events-none text-[10px]",style:n}):h.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:s})}if(r==="TIME"){const s=(t?.format??"HH:mm").replace("HH","12").replace("mm","30");return h.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:s})}if(r==="DURATION")return h.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:"保质期 2025-02-04"});if(r==="WEIGHT"){const o=t?.value??500,s=t?.unit??"g";return h.jsxs("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:[o,s]})}if(r==="WEIGHT_PRICE"){const o=t?.unitPrice??10,s=t?.weight??.5,u=t?.currency??"¥";return h.jsxs("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:[u,(o*s).toFixed(2)]})}if(r==="NUTRITION"){const o=t?.calories??120;return h.jsxs("div",{className:"text-[8px] p-0.5 w-full h-full overflow-hidden flex flex-col",children:[h.jsx("div",{className:"font-semibold border-b border-black",children:"Nutrition Facts"}),h.jsxs("div",{children:["Calories ",o]})]})}return r==="BLANK"?h.jsx("div",{className:"w-full h-full border border-dashed border-gray-200"}):h.jsx("div",{className:"text-gray-500 text-[10px] px-1 truncate w-full flex items-center justify-center",children:e.type.replace(/_/g," ")})}function ble({template:e,selectedId:t,onSelect:r,onUpdateElement:n,onDeleteElement:i,onTemplateChange:o,scale:s=1,onZoomIn:u,onZoomOut:f,onPreview:l}){const d=_.useRef(null),p=_.useRef(null),m=_.useRef(null),g=_.useRef(null),b=_.useRef(null),y=_.useRef(null),w=_.useRef(null),[j,O]=F.useState(!1),[E,N]=F.useState(!1),A=_.useRef(null),[C,T]=F.useState({x:0,y:0}),R=_.useRef(null),I=lp(e.width,e.unit),z=lp(e.height,e.unit),$=e.showGrid!==!1,L=_.useCallback((M,B)=>{if(j||M.button===1)return;M.stopPropagation(),r(B),p.current?.focus();const Z=e.elements.find(ve=>ve.id===B);if(!Z)return;const te=document.getElementById(`element-${B}`);te&&(te.classList.add("z-50","opacity-90","shadow-xl","ring-2","ring-blue-400","ring-offset-2"),te.style.cursor="grabbing"),m.current={id:B,startX:M.clientX,startY:M.clientY,elX:Z.x,elY:Z.y},y.current={id:B,x:Z.x,y:Z.y},M.currentTarget.setPointerCapture?.(M.pointerId)},[e.elements,r,j]),U=_.useCallback(M=>{w.current!==null&&cancelAnimationFrame(w.current),w.current=requestAnimationFrame(()=>{M(),w.current=null})},[]),W=_.useCallback(M=>{if(E&&R.current){const B=M.clientX-R.current.startX,Z=M.clientY-R.current.startY;T({x:R.current.x+B,y:R.current.y+Z});return}if(E&&A.current&&d.current){const B=M.clientX-A.current.x,Z=M.clientY-A.current.y;d.current.scrollLeft=A.current.scrollLeft-B,d.current.scrollTop=A.current.scrollTop-Z;return}if(m.current){const{id:B,startX:Z,startY:te,elX:ve,elY:xe}=m.current,X=M.clientX,ue=M.clientY;U(()=>{const ie=(X-Z)/s,de=(ue-te)/s,ye=Math.max(0,ve+ie),oe=Math.max(0,xe+de),$e=Ka(ye),Me=Ka(oe),Ye=document.getElementById(`element-${B}`);Ye&&(Ye.style.left=`${$e}px`,Ye.style.top=`${Me}px`),y.current={id:B,x:$e,y:Me}})}if(g.current){const{id:B,corner:Z,startX:te,startY:ve,w:xe,h:X,elX:ue,elY:ie}=g.current,de=M.clientX,ye=M.clientY;U(()=>{const oe=(de-te)/s,$e=(ye-ve)/s;let Me=xe,Ye=X,lt=ue,vt=ie;Z.includes("e")&&(Me=Math.max(20,xe+oe)),Z.includes("w")&&(Me=Math.max(20,xe-oe),lt=ue+oe),Z.includes("s")&&(Ye=Math.max(12,X+$e)),Z.includes("n")&&(Ye=Math.max(12,X-$e),vt=ie+$e);const vr=Ka(Me),Pr=Ka(Ye),Ar=Ka(lt),Kt=Ka(vt),Xt=document.getElementById(`element-${B}`);Xt&&(Xt.style.width=`${vr}px`,Xt.style.height=`${Pr}px`,Xt.style.left=`${Ar}px`,Xt.style.top=`${Kt}px`),y.current={id:B,width:vr,height:Pr,x:Ar,y:Kt}})}if(b.current&&o){const{edge:B,startX:Z,startY:te,startW:ve,startH:xe}=b.current,X=M.clientX,ue=M.clientY;U(()=>{const ie=(X-Z)/s,de=(ue-te)/s,ye=qR(ie,e.unit),oe=qR(de,e.unit);if(B==="bottom"){const $e=Math.max(1,xe+oe);o({height:$e})}else{const $e=Math.max(1,ve+ye);o({width:$e})}})}},[E,o,s,e.unit,U]),V=_.useCallback(()=>{E&&(N(!1),A.current=null,R.current=null),w.current!==null&&(cancelAnimationFrame(w.current),w.current=null);const M=m.current?.id||g.current?.id;if(M){const B=document.getElementById(`element-${M}`);B&&(B.classList.remove("z-50","opacity-90","shadow-xl","ring-2","ring-blue-400","ring-offset-2"),B.style.cursor="")}if(y.current){const{id:B,...Z}=y.current;n(B,Z),y.current=null}m.current=null,g.current=null,b.current=null},[n]);_.useEffect(()=>{const M=Z=>{Z.code==="Space"&&!Z.repeat&&O(!0)},B=Z=>{Z.code==="Space"&&(O(!1),N(!1),A.current=null,R.current=null)};return window.addEventListener("keydown",M),window.addEventListener("keyup",B),()=>{window.removeEventListener("keydown",M),window.removeEventListener("keyup",B)}},[]),_.useEffect(()=>{const M=d.current;if(!M)return;const B=()=>{M.scrollLeft=Math.max(0,(M.scrollWidth-M.clientWidth)/2),M.scrollTop=Math.max(0,(M.scrollHeight-M.clientHeight)/2)},Z=requestAnimationFrame(B),te=setTimeout(B,100);return()=>{cancelAnimationFrame(Z),clearTimeout(te)}},[s,I,z]);const G=_.useCallback(M=>{if(!t)return;if(M.key==="Delete"||M.key==="Backspace"){M.preventDefault();const xe=e.elements.findIndex(X=>X.id===t);if(xe>=0){const X=e.elements.filter(ue=>ue.id!==t);i(t),r(X[xe]?.id??X[xe-1]?.id??null)}return}const B=e.elements.find(xe=>xe.id===t);if(!B)return;const Z=M.shiftKey?1:yc;let te=0,ve=0;switch(M.key){case"ArrowLeft":te=-Z;break;case"ArrowRight":te=Z;break;case"ArrowUp":ve=-Z;break;case"ArrowDown":ve=-Z;break;default:return}M.key==="ArrowDown"&&(ve=Z),M.preventDefault(),n(B.id,{x:Math.max(0,B.x+te),y:Math.max(0,B.y+ve)})},[t,e.elements,n,i,r]),Y=()=>r(null),D=M=>{(j||M.button===1)&&(M.preventDefault(),N(!0),A.current={x:M.clientX,y:M.clientY,scrollLeft:d.current?.scrollLeft||0,scrollTop:d.current?.scrollTop||0},M.currentTarget.setPointerCapture(M.pointerId))},Q=M=>{if(E&&A.current&&d.current){const B=M.clientX-A.current.x,Z=M.clientY-A.current.y;d.current.scrollLeft=A.current.scrollLeft-B,d.current.scrollTop=A.current.scrollTop-Z}},J=M=>{E&&(N(!1),A.current=null)};return h.jsxs("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden bg-gray-100",children:[h.jsxs("div",{className:"shrink-0 px-4 py-2 border-b border-gray-200 bg-white flex items-center justify-between gap-2 flex-wrap z-10",children:[h.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Label Preview"}),h.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l&&h.jsx("button",{type:"button",onClick:l,className:"h-8 px-3 rounded border border-gray-300 bg-white text-gray-700 hover:bg-gray-50 text-xs font-medium shadow-sm transition-all active:scale-95",children:"预览"}),o&&h.jsxs(h.Fragment,{children:[h.jsxs(Ze,{value:(()=>{const M=Rb.findIndex(B=>B.width===e.width&&B.height===e.height&&B.unit===e.unit);return M>=0?String(M):"custom"})(),onValueChange:M=>{if(M==="custom")return;const B=Rb[Number(M)];B&&o({width:B.width,height:B.height,unit:B.unit})},children:[h.jsx(et,{className:"h-8 w-[130px] text-xs",children:h.jsx(Je,{placeholder:"画布大小"})}),h.jsxs(nt,{children:[Rb.map((M,B)=>h.jsx(Ae,{value:String(B),className:"text-xs",children:M.name},B)),h.jsx(Ae,{value:"custom",className:"text-xs text-gray-500",children:"自定义"})]})]}),h.jsx("button",{type:"button",onClick:()=>o({showGrid:!$}),className:Te("h-8 px-3 rounded border text-xs font-medium shadow-sm transition-colors",$?"border-gray-300 bg-white text-gray-700 hover:bg-gray-50":"border-gray-300 bg-gray-100 text-gray-500"),children:$?"隐藏网格":"显示网格"})]}),h.jsxs("div",{className:"flex items-center gap-1 bg-white rounded border border-gray-300 p-0.5 shadow-sm h-8",children:[h.jsx("button",{type:"button",onClick:f,disabled:!f,className:"h-6 w-6 rounded hover:bg-gray-100 text-gray-600 disabled:opacity-50 disabled:pointer-events-none flex items-center justify-center text-sm font-medium active:scale-90 transition-transform",title:"缩小",children:"−"}),h.jsxs("span",{className:"min-w-[3rem] text-center text-xs text-gray-600 font-medium",children:[Math.round(s*100),"%"]}),h.jsx("button",{type:"button",onClick:u,disabled:!u,className:"h-6 w-6 rounded hover:bg-gray-100 text-gray-600 disabled:opacity-50 disabled:pointer-events-none flex items-center justify-center text-sm font-medium active:scale-90 transition-transform",title:"放大",children:"+"})]})]})]}),h.jsx("div",{ref:d,className:Te("flex-1 overflow-auto bg-gray-100 relative",j?"cursor-grab active:cursor-grabbing":""),onClick:Y,onPointerDown:D,onPointerMove:Q,onPointerUp:J,onPointerLeave:J,children:h.jsx("div",{style:{minWidth:"100%",minHeight:"100%",width:"fit-content",height:"fit-content",display:"flex",padding:50,boxSizing:"border-box",transform:`translate(${C.x}px, ${C.y}px)`},children:h.jsxs("div",{ref:p,tabIndex:0,className:Te("relative bg-white shadow-lg border border-dashed border-gray-300 origin-top-left outline-none m-auto",E?"cursor-grabbing":"cursor-grab"),style:{width:I,height:z,transform:`scale(${s})`,backgroundImage:$?`linear-gradient(to right, rgba(0,0,0,0.06) 1px, transparent 1px), + linear-gradient(to bottom, rgba(0,0,0,0.06) 1px, transparent 1px)`:void 0,backgroundSize:$?`${yc}px ${yc}px`:void 0,pointerEvents:j?"none":"auto"},onPointerDown:M=>{const B=M.target,Z=B.closest('[id^="element-"]'),te=B.closest('[title*="拖拽拉高"]')||B.closest('[title*="拖拽拉宽"]');p.current?.contains(B)&&!Z&&!te&&!m.current&&!g.current&&(M.preventDefault(),M.stopPropagation(),N(!0),R.current={x:C.x,y:C.y,startX:M.clientX,startY:M.clientY},A.current={x:M.clientX,y:M.clientY,scrollLeft:d.current?.scrollLeft??0,scrollTop:d.current?.scrollTop??0},M.currentTarget.setPointerCapture?.(M.pointerId))},onPointerMove:W,onPointerUp:V,onKeyDown:G,children:[e.showRuler&&h.jsxs("div",{className:"absolute top-0 left-0 right-0 h-5 border-b border-gray-300 bg-gray-50 text-[10px] text-gray-500 flex items-center px-1 pointer-events-none select-none",children:[e.unit," ",e.width," × ",e.height]}),o&&h.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-3 cursor-ns-resize flex items-center justify-center bg-gray-200/80 hover:bg-blue-400/30 border-t border-gray-300 text-[10px] text-gray-500 transition-colors",title:"拖拽拉高纸张",onPointerDown:M=>{M.stopPropagation(),b.current={edge:"bottom",startX:M.clientX,startY:M.clientY,startW:e.width,startH:e.height},M.target.setPointerCapture?.(M.pointerId)},children:"⋮"}),o&&h.jsx("div",{className:"absolute top-0 right-0 bottom-0 w-3 cursor-ew-resize flex items-center justify-center bg-gray-200/80 hover:bg-blue-400/30 border-l border-gray-300 text-[10px] text-gray-500 transition-colors",title:"拖拽拉宽纸张",onPointerDown:M=>{M.stopPropagation(),b.current={edge:"right",startX:M.clientX,startY:M.clientY,startW:e.width,startH:e.height},M.target.setPointerCapture?.(M.pointerId)},children:"⋮"}),e.elements.map(M=>h.jsxs("div",{id:`element-${M.id}`,className:Te("absolute box-border cursor-move overflow-hidden transition-shadow",M.border==="line"&&"border border-gray-400",M.border==="dotted"&&"border border-dotted border-gray-400",t===M.id&&"ring-2 ring-blue-500 ring-offset-1 z-10"),style:{left:M.x,top:M.y,width:M.width,height:M.height},onClick:B=>{B.stopPropagation(),r(M.id)},onPointerDown:B=>L(B,M.id),children:[h.jsx(Q3,{el:M}),t===M.id&&h.jsxs(h.Fragment,{children:[["nw","ne","sw","se"].map(B=>h.jsx("div",{className:"absolute w-4 h-4 bg-white border-2 border-blue-500 rounded-full z-20 shadow-md hover:scale-110 transition-transform",style:{cursor:"nwse-resize",top:B.startsWith("n")?-6:void 0,bottom:B.startsWith("s")?-6:void 0,left:B.endsWith("w")?-6:void 0,right:B.endsWith("e")?-6:void 0},onPointerDown:Z=>{Z.stopPropagation();const te=e.elements.find(ve=>ve.id===M.id);g.current={id:M.id,corner:B,startX:Z.clientX,startY:Z.clientY,w:te.width,h:te.height,elX:te.x,elY:te.y},Z.currentTarget.setPointerCapture?.(Z.pointerId)}},B)),["n","s","w","e"].map(B=>h.jsx("div",{className:"absolute bg-blue-500/50 border border-white/50 rounded-sm z-10 shadow-sm hover:bg-blue-600",style:{cursor:B==="n"||B==="s"?"ns-resize":"ew-resize",width:B==="n"||B==="s"?"20px":"6px",height:B==="n"||B==="s"?"6px":"20px",top:B==="n"?-3:B==="s"?void 0:"50%",bottom:B==="s"?-3:void 0,left:B==="w"?-3:B==="e"?void 0:"50%",right:B==="e"?-3:void 0,transform:B==="n"||B==="s"?"translateX(-50%)":"translateY(-50%)"},onPointerDown:Z=>{Z.stopPropagation();const te=e.elements.find(xe=>xe.id===M.id),ve=document.getElementById(`element-${M.id}`);ve&&ve.classList.add("z-50","opacity-90"),g.current={id:M.id,corner:B,startX:Z.clientX,startY:Z.clientY,w:te.width,h:te.height,elX:te.x,elY:te.y},Z.currentTarget.setPointerCapture?.(Z.pointerId)}},B))]})]},M.id))]})})})]})}function wle({template:e,maxWidth:t=480}){const r=lp(e.width,e.unit),n=lp(e.height,e.unit),i=t?Math.min(t/r,t/n,2):1,o=r*i,s=n*i;return h.jsx("div",{className:"flex items-center justify-center p-4 bg-gray-100 rounded",children:h.jsx("div",{style:{width:o,height:s},className:"relative bg-white shadow-lg overflow-hidden",children:h.jsx("div",{className:"origin-top-left",style:{position:"absolute",left:0,top:0,width:r,height:n,transform:`scale(${i})`,transformOrigin:"0 0"},children:e.elements.map(u=>h.jsx("div",{className:"absolute box-border overflow-hidden pointer-events-none flex items-center justify-center text-xs",style:{left:u.x,top:u.y,width:u.width,height:u.height,border:u.border==="line"?"1px solid #999":u.border==="dotted"?"1px dotted #999":void 0},children:h.jsx(Q3,{el:u})},u.id))})})})}var Sle=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_le=Sle.reduce((e,t)=>{const r=Iw(`Primitive.${t}`),n=_.forwardRef((i,o)=>{const{asChild:s,...u}=i,f=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(f,{...u,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),jle="Label",Z3=_.forwardRef((e,t)=>h.jsx(_le.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Z3.displayName=jle;var Ole=Z3;function he({className:e,...t}){return h.jsx(Ole,{"data-slot":"label",className:Te("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}var dm="Switch",[Ele]=In(dm),[Ple,Ale]=Ele(dm),J3=_.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:i,defaultChecked:o,required:s,disabled:u,value:f="on",onCheckedChange:l,form:d,...p}=e,[m,g]=_.useState(null),b=Xe(t,E=>g(E)),y=_.useRef(!1),w=m?d||!!m.closest("form"):!0,[j,O]=Pi({prop:i,defaultProp:o??!1,onChange:l,caller:dm});return h.jsxs(Ple,{scope:r,checked:j,disabled:u,children:[h.jsx(qe.button,{type:"button",role:"switch","aria-checked":j,"aria-required":s,"data-state":n4(j),"data-disabled":u?"":void 0,disabled:u,value:f,...p,ref:b,onClick:ke(e.onClick,E=>{O(N=>!N),w&&(y.current=E.isPropagationStopped(),y.current||E.stopPropagation())})}),w&&h.jsx(r4,{control:m,bubbles:!y.current,name:n,value:f,checked:j,required:s,disabled:u,form:d,style:{transform:"translateX(-100%)"}})]})});J3.displayName=dm;var e4="SwitchThumb",t4=_.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,i=Ale(e4,r);return h.jsx(qe.span,{"data-state":n4(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:t})});t4.displayName=e4;var Cle="SwitchBubbleInput",r4=_.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...i},o)=>{const s=_.useRef(null),u=Xe(s,o),f=t_(r),l=XS(t);return _.useEffect(()=>{const d=s.current;if(!d)return;const p=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==r&&g){const b=new Event("click",{bubbles:n});g.call(d,r),d.dispatchEvent(b)}},[f,r,n]),h.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:u,style:{...i.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});r4.displayName=Cle;function n4(e){return e?"checked":"unchecked"}var Nle=J3,Tle=t4;function kn({className:e,...t}){return h.jsx(Nle,{"data-slot":"switch",className:Te("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-switch-background focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:h.jsx(Tle,{"data-slot":"switch-thumb",className:Te("bg-card dark:data-[state=unchecked]:bg-card-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function kle({template:e,selectedElement:t,onTemplateChange:r,onElementChange:n,onDeleteElement:i}){return t?h.jsxs("div",{className:"w-72 shrink-0 border-l border-gray-200 bg-white flex flex-col h-full",children:[h.jsx("div",{className:"px-3 py-2 border-b border-gray-200 font-semibold text-gray-800",children:"Properties (Element)"}),h.jsx(wc,{className:"flex-1",children:h.jsxs("div",{className:"p-3 space-y-3",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"X"}),h.jsx(be,{type:"number",value:t.x,onChange:o=>n(t.id,{x:Number(o.target.value)||0}),className:"h-8 text-sm"})]}),h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Y"}),h.jsx(be,{type:"number",value:t.y,onChange:o=>n(t.id,{y:Number(o.target.value)||0}),className:"h-8 text-sm"})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Width"}),h.jsx(be,{type:"number",value:t.width,onChange:o=>n(t.id,{width:Math.max(1,Number(o.target.value)||0)}),className:"h-8 text-sm"})]}),h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Height"}),h.jsx(be,{type:"number",value:t.height,onChange:o=>n(t.id,{height:Math.max(1,Number(o.target.value)||0)}),className:"h-8 text-sm"})]})]}),h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Rotation"}),h.jsxs(Ze,{value:t.rotation,onValueChange:o=>n(t.id,{rotation:o}),children:[h.jsx(et,{className:"h-8 text-sm",children:h.jsx(Je,{})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"horizontal",children:"horizontal"}),h.jsx(Ae,{value:"vertical",children:"vertical"})]})]})]}),h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Border"}),h.jsxs(Ze,{value:t.border,onValueChange:o=>n(t.id,{border:o}),children:[h.jsx(et,{className:"h-8 text-sm",children:h.jsx(Je,{})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"none",children:"none"}),h.jsx(Ae,{value:"line",children:"line"}),h.jsx(Ae,{value:"dotted",children:"dotted"})]})]})]}),h.jsx(Rle,{element:t,onChange:o=>n(t.id,{config:{...t.config,...o}})}),i&&h.jsx("div",{className:"pt-4 border-t border-gray-100",children:h.jsx(we,{variant:"destructive",className:"w-full",onClick:()=>i(t.id),children:"Delete Element"})})]})})]}):h.jsxs("div",{className:"w-72 shrink-0 border-l border-gray-200 bg-white flex flex-col h-full",children:[h.jsx("div",{className:"px-3 py-2 border-b border-gray-200 font-semibold text-gray-800",children:"Properties (Template)"}),h.jsx(wc,{className:"flex-1",children:h.jsxs("div",{className:"p-3 space-y-3",children:[h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Template Name"}),h.jsx(be,{value:e.name,onChange:o=>r({name:o.target.value}),className:"h-8 text-sm mt-1"})]}),h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Label Type"}),h.jsxs(Ze,{value:e.labelType,onValueChange:o=>r({labelType:o}),children:[h.jsx(et,{className:"h-8 text-sm mt-1",children:h.jsx(Je,{})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"PRICE",children:"PRICE"}),h.jsx(Ae,{value:"NUTRITION",children:"NUTRITION"}),h.jsx(Ae,{value:"SHIPPING",children:"SHIPPING"})]})]})]}),h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Applied Location"}),h.jsxs(Ze,{value:e.appliedLocation,onValueChange:o=>r({appliedLocation:o}),children:[h.jsx(et,{className:"h-8 text-sm mt-1",children:h.jsx(Je,{})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"ALL",children:"All Locations"}),h.jsx(Ae,{value:"loc-a",children:"Location A"}),h.jsx(Ae,{value:"loc-b",children:"Location B"})]})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Width"}),h.jsx(be,{type:"number",value:e.width,onChange:o=>r({width:Math.max(.1,Number(o.target.value)||0)}),className:"h-8 text-sm"})]}),h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Height"}),h.jsx(be,{type:"number",value:e.height,onChange:o=>r({height:Math.max(.1,Number(o.target.value)||0)}),className:"h-8 text-sm"})]})]}),h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Unit"}),h.jsxs(Ze,{value:e.unit,onValueChange:o=>r({unit:o}),children:[h.jsx(et,{className:"h-8 text-sm mt-1",children:h.jsx(Je,{})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"cm",children:"cm"}),h.jsx(Ae,{value:"inch",children:"inch"})]})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(kn,{checked:e.showRuler,onCheckedChange:o=>r({showRuler:o})}),h.jsx(he,{className:"text-xs",children:"Show Ruler"})]})]})})]})}function Rle({element:e,onChange:t}){const r=e.config,n=(i,o)=>t({[i]:o});switch(e.type){case"TEXT_STATIC":case"TEXT_PRODUCT":case"TEXT_PRICE":return h.jsxs(h.Fragment,{children:[h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Text"}),h.jsx(be,{value:r.text??"",onChange:i=>n("text",i.target.value),className:"h-8 text-sm mt-1"})]}),h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Font Size"}),h.jsx(be,{type:"number",value:r.fontSize??14,onChange:i=>n("fontSize",Number(i.target.value)||14),className:"h-8 text-sm mt-1"})]}),h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Text Align"}),h.jsxs(Ze,{value:r.textAlign??"left",onValueChange:i=>n("textAlign",i),children:[h.jsx(et,{className:"h-8 text-sm mt-1",children:h.jsx(Je,{})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"left",children:"Left"}),h.jsx(Ae,{value:"center",children:"Center"}),h.jsx(Ae,{value:"right",children:"Right"})]})]})]})]});case"BARCODE":return h.jsxs(h.Fragment,{children:[h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Data"}),h.jsx(be,{value:r.data??"",onChange:i=>n("data",i.target.value),className:"h-8 text-sm mt-1"})]}),h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"方向"}),h.jsxs(Ze,{value:r.orientation??"horizontal",onValueChange:i=>n("orientation",i),children:[h.jsx(et,{className:"h-8 text-sm mt-1",children:h.jsx(Je,{})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"horizontal",children:"水平"}),h.jsx(Ae,{value:"vertical",children:"竖排"})]})]})]})]});case"QRCODE":return h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Data (URL)"}),h.jsx(be,{value:r.data??"",onChange:i=>n("data",i.target.value),className:"h-8 text-sm mt-1"})]});case"WEIGHT":return h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Value"}),h.jsx(be,{type:"number",value:r.value??0,onChange:i=>n("value",Number(i.target.value)||0),className:"h-8 text-sm mt-1"})]});default:return h.jsxs("div",{className:"text-xs text-gray-500",children:["Config for ",e.type," (edit in code if needed)"]})}}const Mle=.5,Ile=2,UR=.25,Dle=1;function Lle({templateId:e,initialTemplate:t,onClose:r,onSaved:n}){const[i,o]=_.useState(()=>t?{...t}:Gae(e??void 0)),[s,u]=_.useState(null),[f,l]=_.useState(Dle),[d,p]=_.useState(!1),m=i.elements.find(E=>E.id===s)??null,g=_.useCallback((E,N)=>{const A=Kae(E,30,30);N&&Object.keys(N).length>0&&(A.config={...A.config,...N}),o(C=>({...C,elements:[...C.elements,A]})),u(A.id)},[]),b=_.useCallback((E,N)=>{o(A=>({...A,elements:A.elements.map(C=>C.id===E?{...C,...N}:C)}))},[]),y=_.useCallback(E=>{o(N=>({...N,elements:N.elements.filter(A=>A.id!==E)})),u(null)},[]),w=_.useCallback(E=>{o(N=>({...N,...E}))},[]),j=_.useCallback(()=>{Yae(i),n(),r()},[i,n,r]),O=_.useCallback(()=>{const E=new Blob([JSON.stringify(i,null,2)],{type:"application/json"}),N=URL.createObjectURL(E),A=document.createElement("a");A.href=N,A.download=`label-template-${i.id}.json`,A.click(),URL.revokeObjectURL(N)},[i]);return h.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[h.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-gray-200 bg-white shrink-0",children:[h.jsxs(we,{variant:"outline",size:"sm",onClick:r,children:[h.jsx(y8,{className:"w-4 h-4 mr-1"}),"Back"]}),h.jsx("span",{className:"text-sm font-medium text-gray-700 truncate flex-1",children:i.name}),h.jsxs(we,{size:"sm",onClick:O,variant:"outline",children:[h.jsx(Pw,{className:"w-4 h-4 mr-1"}),"Export JSON"]}),h.jsxs(we,{size:"sm",className:"bg-blue-600 hover:bg-blue-700 text-white",onClick:j,children:[h.jsx(h6,{className:"w-4 h-4 mr-1"}),"Save"]})]}),h.jsxs("div",{className:"flex flex-1 min-h-0",children:[h.jsx(_se,{onAddElement:g}),h.jsx(ble,{template:i,selectedId:s,onSelect:u,onUpdateElement:b,onDeleteElement:y,onTemplateChange:w,scale:f,onZoomIn:()=>l(E=>Math.min(Ile,E+UR)),onZoomOut:()=>l(E=>Math.max(Mle,E-UR)),onPreview:()=>p(!0)}),h.jsx(un,{open:d,onOpenChange:p,children:h.jsxs(fn,{className:"max-w-[90vw] max-h-[90vh] overflow-auto",children:[h.jsx(dn,{children:h.jsx(hn,{children:"标签预览"})}),h.jsx(wle,{template:i,maxWidth:500})]})}),h.jsx(kle,{template:i,selectedElement:m,onTemplateChange:w,onElementChange:b,onDeleteElement:y})]})]})}function $le(){const[e,t]=_.useState(()=>Fk()),[r,n]=_.useState("list"),[i,o]=_.useState(null),[s,u]=_.useState(""),[f,l]=_.useState("all"),d=_.useCallback(()=>{t(Fk())},[]);_.useEffect(()=>{r==="list"&&d()},[r,d]);const p=e.filter(y=>{const w=!s||y.name.toLowerCase().includes(s.toLowerCase()),j=f==="all"||y.appliedLocation===f;return w&&j}),m=()=>{},g=y=>{o(y),n("editor")},b=()=>{n("list"),o(null)};if(r==="editor"){const y=i?m3(i):null;return h.jsx("div",{className:"h-[calc(100vh-8rem)] min-h-[500px] flex flex-col",children:h.jsx(Lle,{templateId:i,initialTemplate:y,onClose:b,onSaved:d})})}return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[h.jsx(be,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500",value:s,onChange:y=>u(y.target.value)}),h.jsxs(Ze,{value:f,onValueChange:l,children:[h.jsx(et,{className:"bg-white border border-gray-300 rounded-md w-[200px] shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Location"})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"all",children:"All Locations"}),h.jsx(Ae,{value:"ALL",children:"ALL"}),h.jsx(Ae,{value:"loc-a",children:"Location A"}),h.jsx(Ae,{value:"loc-b",children:"Location B"})]})]}),h.jsxs(we,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0 ml-auto",onClick:m,children:["New Label Template ",h.jsx(jr,{className:"ml-1 w-4 h-4"})]})]}),h.jsxs("div",{className:"text-red-600 font-bold italic text-sm md:text-base",children:["***One or more templates have incomplete labels attached to them.",h.jsx("br",{}),"Go to Labels view to see which labels are missing fields."]}),h.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-50 hover:bg-gray-50",children:[h.jsx(me,{className:"font-bold text-gray-900 w-[180px]",children:"Label Template"}),h.jsx(me,{className:"font-bold text-gray-900 w-[120px]",children:"Location"}),h.jsx(me,{className:"font-bold text-gray-900",children:"Contents"}),h.jsx(me,{className:"font-bold text-gray-900 w-[150px]",children:"Size"}),h.jsx(me,{className:"font-bold text-gray-900 w-[100px]",children:"Actions"})]})}),h.jsx(mr,{children:p.length===0?h.jsx(Ke,{children:h.jsx(se,{colSpan:5,className:"text-center text-gray-500 py-8",children:'No templates yet. Click "New Label Template" to create one.'})}):p.map(y=>h.jsxs(Ke,{className:"hover:bg-gray-50 cursor-pointer",onClick:()=>g(y.id),children:[h.jsx(se,{className:"font-medium",children:y.name}),h.jsx(se,{children:y.appliedLocation}),h.jsxs(se,{className:"text-sm text-gray-600",children:[y.elements.length," element(s)"]}),h.jsxs(se,{children:[y.width,"×",y.height," ",y.unit]}),h.jsx(se,{onClick:w=>w.stopPropagation(),children:h.jsxs(we,{variant:"outline",size:"sm",onClick:()=>g(y.id),children:[h.jsx(Bd,{className:"w-3 h-3 mr-1"}),"Edit"]})})]},y.id))})]})})]})}function Ble(){const e=[{id:1,name:"Prepped By",contents:"A. Smith; B. Doe; C. Borne",lastEdited:"2025.12.03.11:45"},{id:2,name:"Checked By",contents:"D. Manager; E. Supervisor",lastEdited:"2025.12.04.09:30"},{id:3,name:"Allergens",contents:"Peanuts; Dairy; Gluten; Soy",lastEdited:"2025.12.05.14:15"}];return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[h.jsx(be,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500"}),h.jsxs(Ze,{defaultValue:"all",children:[h.jsx(et,{className:"bg-white border border-gray-300 rounded-md w-[200px] shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Location"})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"all",children:"All Locations"}),h.jsx(Ae,{value:"loc-a",children:"Location A"}),h.jsx(Ae,{value:"loc-b",children:"Location B"})]})]}),h.jsxs(we,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0 ml-auto",children:["New Multiple Options ",h.jsx(jr,{className:"ml-1 h-4 w-4"})]})]}),h.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-50 hover:bg-gray-50",children:[h.jsx(me,{className:"font-bold text-gray-900 w-[200px]",children:"Multiple Option Name"}),h.jsx(me,{className:"font-bold text-gray-900",children:"Contents"}),h.jsx(me,{className:"font-bold text-gray-900 w-[180px]",children:"Last Edited"})]})}),h.jsx(mr,{children:e.map(t=>h.jsxs(Ke,{className:"hover:bg-gray-50",children:[h.jsx(se,{className:"font-medium",children:t.name}),h.jsx(se,{className:"text-gray-600",children:t.contents}),h.jsx(se,{className:"text-gray-500 tabular-nums font-numeric",children:t.lastEdited})]},t.id))})]})})]})}function Fle({currentView:e="Labels",onViewChange:t}){const r=["Labels","Label Categories","Label Types","Label Templates","Multiple Options"],n=i=>{t&&t(i)};return h.jsxs("div",{className:"space-y-6",children:[h.jsx("div",{className:"w-full border-b border-gray-200",children:h.jsx("div",{className:"flex overflow-x-auto bg-white",children:r.map(i=>h.jsx("div",{onClick:()=>n(i),style:e===i?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:`px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px ${e===i?"text-blue-600":"border-b-2 border-b-transparent text-gray-600 hover:text-gray-800"}`,children:i},i))})}),h.jsxs("div",{className:"min-h-[400px]",children:[e==="Labels"&&h.jsx(Fae,{}),e==="Label Categories"&&h.jsx(zae,{}),e==="Label Types"&&h.jsx(qae,{}),e==="Label Templates"&&h.jsx($le,{}),e==="Multiple Options"&&h.jsx(Ble,{}),!["Labels","Label Categories","Label Types","Label Templates","Multiple Options"].includes(e)&&h.jsxs("div",{className:"flex items-center justify-center h-64 text-gray-400",children:[e," content coming soon..."]})]})]})}function zle(){const[e,t]=_.useState([{id:"1",name:"Pop",isOpen:!0,subcategories:[{id:"1-1",name:"2024",isOpen:!0,files:[{id:"f1",name:"uuuuu",date:"10/23/24, 12:21 AM",type:"image"},{id:"f2",name:"664EF167-DFCE-49C1-A417-DC09FEDF78D7.jpg",date:"11/24/25, 8:40 PM",type:"image"}]}]},{id:"2",name:"Training",isOpen:!0,subcategories:[{id:"2-1",name:"BOH",isOpen:!1,files:[]},{id:"2-2",name:"FOH",isOpen:!0,files:[]}]},{id:"3",name:"ww",isOpen:!1,subcategories:[]}]),r=i=>{t(o=>o.map(s=>s.id===i?{...s,isOpen:!s.isOpen}:s))},n=(i,o)=>{t(s=>s.map(u=>u.id!==i?u:{...u,subcategories:u.subcategories.map(f=>f.id===o?{...f,isOpen:!f.isOpen}:f)}))};return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-center",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(be,{className:"bg-white border border-black rounded-md h-10 w-[150px]"}),h.jsx("span",{className:"text-sm text-black whitespace-nowrap",children:"Search"})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(Ze,{defaultValue:"all",children:[h.jsx(et,{className:"bg-white border border-black rounded-md h-10 w-[100px]",children:h.jsx(Je,{placeholder:"Location"})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"all",children:"all"}),h.jsx(Ae,{value:"loc-a",children:"Location A"})]})]}),h.jsx("span",{className:"text-sm text-black whitespace-nowrap",children:"Location"})]})]}),h.jsxs("div",{className:"bg-gray-100 p-2 flex justify-between items-center border-b border-gray-200",children:[h.jsx("h1",{className:"text-xl font-medium text-gray-700",children:"Information"}),h.jsxs("div",{className:"flex items-center gap-4 text-gray-600",children:[h.jsx("div",{className:"flex items-center gap-1 bg-gray-700 text-white text-[10px] px-1 py-0.5 rounded-sm font-bold",children:"NEW"}),h.jsx(b6,{className:"h-5 w-5"}),h.jsx("span",{className:"font-medium",children:"55789"})]})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsxs("button",{className:"w-full bg-[#2c7bb6] hover:bg-[#256b9e] text-white py-2 px-4 flex items-center gap-2 text-sm font-medium rounded-sm",children:[h.jsx(jr,{className:"h-4 w-4"}),"New Category",h.jsx(Wd,{className:"h-4 w-4 opacity-70"})]}),h.jsx("div",{className:"space-y-4",children:e.map(i=>h.jsxs("div",{className:"border border-gray-300 rounded-sm overflow-hidden",children:[h.jsxs("div",{className:"bg-gradient-to-b from-gray-50 to-gray-100 border-b border-gray-200 p-2 flex items-center justify-between",children:[h.jsxs("button",{onClick:()=>r(i.id),className:"flex items-center gap-2 text-gray-700 font-medium text-sm flex-1 text-left",children:[i.isOpen?h.jsx(xc,{className:"h-4 w-4 text-[#2c7bb6]"}):h.jsx(bc,{className:"h-4 w-4 text-[#2c7bb6]"}),i.name]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:h.jsx(Bd,{className:"h-4 w-4"})}),h.jsx("button",{className:"text-red-400 hover:text-red-600",children:h.jsx(uc,{className:"h-4 w-4"})})]})]}),i.isOpen&&h.jsxs("div",{className:"p-2 space-y-3 bg-white",children:[h.jsxs("button",{className:"w-full bg-[#2c7bb6] hover:bg-[#256b9e] text-white py-2 px-4 flex items-center gap-2 text-sm font-medium rounded-sm",children:[h.jsx(jr,{className:"h-4 w-4"}),"New Subcategory",h.jsx(Wd,{className:"h-4 w-4 opacity-70"})]}),h.jsxs("div",{className:"space-y-3",children:[i.subcategories.map(o=>h.jsxs("div",{className:"border border-gray-200 rounded-sm",children:[h.jsxs("div",{className:"bg-white border-b border-gray-200 p-2 flex items-center justify-between",children:[h.jsxs("button",{onClick:()=>n(i.id,o.id),className:"flex items-center gap-2 text-gray-700 font-medium text-sm flex-1 text-left",children:[o.isOpen?h.jsx(xc,{className:"h-4 w-4 text-[#2c7bb6]"}):h.jsx(bc,{className:"h-4 w-4 text-[#2c7bb6]"}),o.name]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:h.jsx(Bd,{className:"h-4 w-4"})}),h.jsx("button",{className:"text-red-400 hover:text-red-600",children:h.jsx(uc,{className:"h-4 w-4"})})]})]}),o.isOpen&&h.jsxs("div",{className:"p-3 bg-gray-50/50",children:[h.jsx("div",{className:"mb-2 text-xs font-bold text-gray-500 uppercase tracking-wide",children:"Files"}),h.jsxs("div",{className:"flex flex-wrap gap-2 mb-3 justify-end",children:[h.jsx(we,{size:"sm",className:"h-8 bg-[#4CAF50] hover:bg-[#43a047] text-white text-xs border-none rounded-sm",children:"Upload Your Own File(s)"}),h.jsx(we,{size:"sm",className:"h-8 bg-[#4CAF50] hover:bg-[#43a047] text-white text-xs border-none rounded-sm",children:"Create A Custom File"}),h.jsx(we,{size:"sm",className:"h-8 bg-[#2c7bb6] hover:bg-[#256b9e] text-white text-xs border-none rounded-sm",children:"Edit File Permissions"}),h.jsxs(we,{size:"sm",className:"h-8 bg-[#2c7bb6] hover:bg-[#256b9e] text-white text-xs border-none rounded-sm gap-1",children:["Sort (A-Z) ",h.jsx(b8,{className:"h-3 w-3"})]})]}),h.jsx("div",{className:"space-y-1",children:o.files.length>0?o.files.map(s=>h.jsxs("div",{className:"flex items-center bg-gray-200/50 p-2 border border-gray-200 rounded-sm text-sm hover:bg-gray-200 transition-colors",children:[h.jsx("div",{className:"flex-shrink-0 mr-3",children:s.type==="image"?h.jsx(Wo,{className:"h-5 w-5 text-[#2c7bb6]"}):h.jsx(us,{className:"h-5 w-5 text-[#2c7bb6]"})}),h.jsx("div",{className:"flex-1 min-w-0",children:h.jsx("div",{className:"font-medium text-gray-700 truncate",children:s.name})}),h.jsx("div",{className:"text-xs text-gray-500 mr-4 whitespace-nowrap",children:s.date}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("button",{className:"p-1 text-gray-400 hover:text-gray-600 bg-white border border-gray-300 rounded-sm",children:h.jsx(us,{className:"h-3 w-3"})}),h.jsx("button",{className:"p-1 text-gray-400 hover:text-gray-600 bg-white border border-gray-300 rounded-sm",children:h.jsx(Bd,{className:"h-3 w-3"})}),h.jsx("button",{className:"p-1 text-red-400 hover:text-red-600 bg-white border border-gray-300 rounded-sm",children:h.jsx(uc,{className:"h-3 w-3"})})]})]},s.id)):h.jsx("div",{className:"p-4 border-2 border-dashed border-gray-300 rounded-sm text-center text-gray-400 text-sm",children:"No files in this subcategory"})})]})]},o.id)),i.subcategories.length===0&&h.jsx("div",{className:"p-2 text-sm text-gray-400 italic",children:"No subcategories"})]})]})]},i.id))})]})]})}const qle=[{id:1,title:"Coffee - 2 hrs",subtitle:"1 min - Completes at 12:05 PM",totalTime:7200,remainingTime:0,status:"expired",icon:F8},{id:2,title:"Clean Tablet",subtitle:"1 hrs - Completes at 12:37 PM",totalTime:3600,remainingTime:237,status:"running",icon:_6},{id:3,title:"Replace Sanitizer Towels",subtitle:"1 hrs - Completes at 12:37 PM",totalTime:3600,remainingTime:238,status:"running",icon:Fb},{id:4,title:"Take Out Trash",subtitle:"1 hrs - Completes at 01:03 PM",totalTime:3600,remainingTime:58,status:"running",icon:Fb},{id:5,title:"Change Utensils",subtitle:"1 hrs - Completes at 01:03 PM",totalTime:3600,remainingTime:58,status:"running",icon:L6},{id:6,title:"Sanitize Surfaces",subtitle:"1 hrs - Completes at 02:00 PM",totalTime:3600,remainingTime:2157,status:"running",icon:vg},{id:7,title:"Check Temperatures",subtitle:"1 hrs - Completes at 02:00 PM",totalTime:3600,remainingTime:2158,status:"running",icon:vg},{id:8,title:"Ranch 4 hrs",subtitle:"4 hrs - Completes at 04:04 PM",totalTime:14400,remainingTime:2158,status:"running",icon:vg}];function Ule({timer:e}){const t=(e.totalTime-e.remainingTime)/e.totalTime*100,r=e.remainingTime===0,n=i=>{if(i<=0)return"0s";const o=Math.floor(i/60),s=i%60;return`${o.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`};return h.jsxs("div",{className:"bg-gray-200 rounded-xl p-4 flex flex-col items-center relative shadow-sm h-[280px]",children:[h.jsxs("div",{className:"text-center mb-2",children:[h.jsx("h3",{className:"text-lg font-medium text-gray-800 leading-tight",children:e.title}),h.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.subtitle})]}),h.jsxs("div",{className:"relative w-32 h-32 my-auto flex items-center justify-center",children:[h.jsxs("svg",{className:"w-full h-full transform -rotate-90",children:[h.jsx("circle",{cx:"64",cy:"64",r:"56",stroke:"white",strokeWidth:"12",fill:"transparent"}),h.jsx("circle",{cx:"64",cy:"64",r:"56",stroke:r?"#ef4444":"#3b82f6",strokeWidth:"12",fill:"transparent",strokeDasharray:351.86,strokeDashoffset:r?0:351.86*(t/100),className:"transition-all duration-1000 ease-linear"})]}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[h.jsx("span",{className:Te("text-3xl font-bold",r?"text-red-500":"text-gray-800"),children:r?"0s":n(e.remainingTime)}),h.jsx("span",{className:Te("text-[10px] font-medium uppercase mt-1",r?"text-red-400":"text-gray-400"),children:"Remaining"})]})]}),h.jsxs("div",{className:"w-full flex justify-between items-end mt-2",children:[h.jsx(s6,{className:"w-5 h-5 text-blue-700 fill-current"}),h.jsx("div",{className:"flex flex-col items-center",children:h.jsx("div",{className:"w-10 h-10 rounded-full border-2 border-gray-300 flex items-center justify-center text-gray-400 mb-1",children:h.jsx(e.icon,{className:"w-5 h-5"})})}),h.jsx("div",{className:"flex flex-col items-end",children:h.jsx("span",{className:"text-xs text-blue-600 font-bold mb-2 cursor-pointer",children:"EDIT"})})]}),h.jsx("button",{className:"absolute bottom-12 right-4 bg-blue-600 rounded-full p-1 text-white hover:bg-blue-700 shadow-md",children:h.jsx(uc,{className:"w-4 h-4"})})]})}function Wle(){const[e,t]=_.useState(!0);return h.jsxs("div",{className:"h-full flex flex-col bg-gray-50 relative",children:[h.jsxs("div",{className:"bg-white border-b border-gray-200 px-4 py-3 flex items-center justify-between shadow-sm z-10",children:[h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("button",{className:"flex items-center text-blue-500 text-lg font-medium",children:[h.jsx(QR,{className:"w-6 h-6"}),"Back"]}),h.jsx(r6,{className:"w-6 h-6 text-gray-500"})]}),h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"bg-blue-600 p-1.5 rounded-md",children:h.jsx(E6,{className:"w-5 h-5 text-white"})}),h.jsx("h1",{className:"text-xl font-bold text-blue-900",children:"Timers"})]}),h.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600 font-medium",children:[h.jsx("span",{children:"86016"}),h.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"})]})]}),h.jsxs("div",{className:"flex items-center gap-4 text-blue-500 font-medium",children:[h.jsx(M6,{className:"w-6 h-6 text-gray-400"}),h.jsxs("button",{className:"flex items-center gap-1",children:[h.jsx(jr,{className:"w-5 h-5"}),"Add Timer"]})]})]}),h.jsxs("div",{className:"bg-gray-700 text-white px-6 py-2 flex items-center justify-between",children:[h.jsx("div",{className:"flex-1"})," ",h.jsx("div",{className:"font-medium",children:"Today, December 15"}),h.jsxs("div",{className:"flex-1 flex justify-end items-center gap-4",children:[h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(V8,{className:"w-5 h-5 text-gray-300"}),h.jsx(Q8,{className:"w-5 h-5 text-gray-500"})]}),h.jsx(p8,{className:"w-5 h-5 text-blue-400"})]})]}),h.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:qle.map(r=>h.jsx(Ule,{timer:r},r.id))})}),e&&h.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-[1px]",children:h.jsx("div",{className:"bg-black text-white rounded-xl shadow-2xl w-[600px] max-w-full overflow-hidden border border-gray-800",children:h.jsxs("div",{className:"p-8 text-center space-y-6",children:[h.jsx("h2",{className:"text-3xl font-medium text-blue-500",children:"Coffee - 2 hrs"}),h.jsxs("div",{className:"space-y-4 py-4",children:[h.jsx("p",{className:"text-2xl font-light",children:"Timer expired at 12:05 PM"}),h.jsx("p",{className:"text-2xl font-light",children:"Please discard the coffee"})]}),h.jsx("div",{className:"flex justify-end",children:h.jsx("span",{className:"bg-gray-200 text-black text-[10px] px-1 rounded-sm opacity-50",children:"TACT_Img_Timer-Notification@2x"})}),h.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-8",children:[h.jsx(we,{onClick:()=>t(!1),className:"bg-blue-700 hover:bg-blue-600 text-white h-14 text-xl font-medium rounded-lg",children:"Mute"}),h.jsx(we,{onClick:()=>t(!1),className:"bg-blue-600 hover:bg-blue-500 text-white h-14 text-xl font-medium rounded-lg",children:"Restart"}),h.jsx(we,{onClick:()=>t(!1),className:"bg-blue-800 hover:bg-blue-700 text-white h-14 text-xl font-medium rounded-lg",children:"Acknowledge"})]})]})})})]})}var Ib="rovingFocusGroup.onEntryFocus",Hle={bubbles:!1,cancelable:!0},Su="RovingFocusGroup",[Sw,i4,Vle]=o$(Su),[Gle,o4]=In(Su,[Vle]),[Kle,Xle]=Gle(Su),a4=_.forwardRef((e,t)=>h.jsx(Sw.Provider,{scope:e.__scopeRovingFocusGroup,children:h.jsx(Sw.Slot,{scope:e.__scopeRovingFocusGroup,children:h.jsx(Yle,{...e,ref:t})})}));a4.displayName=Su;var Yle=_.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:l,preventScrollOnEntryFocus:d=!1,...p}=e,m=_.useRef(null),g=Xe(t,m),b=fp(o),[y,w]=Pi({prop:s,defaultProp:u??null,onChange:f,caller:Su}),[j,O]=_.useState(!1),E=ar(l),N=i4(r),A=_.useRef(!1),[C,T]=_.useState(0);return _.useEffect(()=>{const R=m.current;if(R)return R.addEventListener(Ib,E),()=>R.removeEventListener(Ib,E)},[E]),h.jsx(Kle,{scope:r,orientation:n,dir:b,loop:i,currentTabStopId:y,onItemFocus:_.useCallback(R=>w(R),[w]),onItemShiftTab:_.useCallback(()=>O(!0),[]),onFocusableItemAdd:_.useCallback(()=>T(R=>R+1),[]),onFocusableItemRemove:_.useCallback(()=>T(R=>R-1),[]),children:h.jsx(qe.div,{tabIndex:j||C===0?-1:0,"data-orientation":n,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:ke(e.onMouseDown,()=>{A.current=!0}),onFocus:ke(e.onFocus,R=>{const I=!A.current;if(R.target===R.currentTarget&&I&&!j){const z=new CustomEvent(Ib,Hle);if(R.currentTarget.dispatchEvent(z),!z.defaultPrevented){const $=N().filter(G=>G.focusable),L=$.find(G=>G.active),U=$.find(G=>G.id===y),V=[L,U,...$].filter(Boolean).map(G=>G.ref.current);c4(V,d)}}A.current=!1}),onBlur:ke(e.onBlur,()=>O(!1))})})}),s4="RovingFocusGroupItem",l4=_.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:o,children:s,...u}=e,f=Xn(),l=o||f,d=Xle(s4,r),p=d.currentTabStopId===l,m=i4(r),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:y}=d;return _.useEffect(()=>{if(n)return g(),()=>b()},[n,g,b]),h.jsx(Sw.ItemSlot,{scope:r,id:l,focusable:n,active:i,children:h.jsx(qe.span,{tabIndex:p?0:-1,"data-orientation":d.orientation,...u,ref:t,onMouseDown:ke(e.onMouseDown,w=>{n?d.onItemFocus(l):w.preventDefault()}),onFocus:ke(e.onFocus,()=>d.onItemFocus(l)),onKeyDown:ke(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){d.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const j=Jle(w,d.orientation,d.dir);if(j!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let E=m().filter(N=>N.focusable).map(N=>N.ref.current);if(j==="last")E.reverse();else if(j==="prev"||j==="next"){j==="prev"&&E.reverse();const N=E.indexOf(w.currentTarget);E=d.loop?ece(E,N+1):E.slice(N+1)}setTimeout(()=>c4(E))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:y!=null}):s})})});l4.displayName=s4;var Qle={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Zle(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Jle(e,t,r){const n=Zle(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Qle[n]}function c4(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function ece(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var tce=a4,rce=l4,hm="Tabs",[nce]=In(hm,[o4]),u4=o4(),[ice,s_]=nce(hm),f4=_.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:u,activationMode:f="automatic",...l}=e,d=fp(u),[p,m]=Pi({prop:n,onChange:i,defaultProp:o??"",caller:hm});return h.jsx(ice,{scope:r,baseId:Xn(),value:p,onValueChange:m,orientation:s,dir:d,activationMode:f,children:h.jsx(qe.div,{dir:d,"data-orientation":s,...l,ref:t})})});f4.displayName=hm;var d4="TabsList",h4=_.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...i}=e,o=s_(d4,r),s=u4(r);return h.jsx(tce,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:n,children:h.jsx(qe.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});h4.displayName=d4;var p4="TabsTrigger",m4=_.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:i=!1,...o}=e,s=s_(p4,r),u=u4(r),f=y4(s.baseId,n),l=x4(s.baseId,n),d=n===s.value;return h.jsx(rce,{asChild:!0,...u,focusable:!i,active:d,children:h.jsx(qe.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":l,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:f,...o,ref:t,onMouseDown:ke(e.onMouseDown,p=>{!i&&p.button===0&&p.ctrlKey===!1?s.onValueChange(n):p.preventDefault()}),onKeyDown:ke(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&s.onValueChange(n)}),onFocus:ke(e.onFocus,()=>{const p=s.activationMode!=="manual";!d&&!i&&p&&s.onValueChange(n)})})})});m4.displayName=p4;var v4="TabsContent",g4=_.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:i,children:o,...s}=e,u=s_(v4,r),f=y4(u.baseId,n),l=x4(u.baseId,n),d=n===u.value,p=_.useRef(d);return _.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),h.jsx(Or,{present:i||d,children:({present:m})=>h.jsx(qe.div,{"data-state":d?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!m,id:l,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&o})})});g4.displayName=v4;function y4(e,t){return`${e}-trigger-${t}`}function x4(e,t){return`${e}-content-${t}`}var oce=f4,ace=h4,sce=m4,lce=g4;function b4({className:e,...t}){return h.jsx(oce,{"data-slot":"tabs",className:Te("flex flex-col gap-2",e),...t})}function w4({className:e,...t}){return h.jsx(ace,{"data-slot":"tabs-list",className:Te("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-xl p-[3px] flex",e),...t})}function ss({className:e,...t}){return h.jsx(sce,{"data-slot":"tabs-trigger",className:Te("data-[state=active]:bg-card dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-xl border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function ls({className:e,...t}){return h.jsx(lce,{"data-slot":"tabs-content",className:Te("flex-1 outline-none",e),...t})}const cce=[{id:"cat1",name:"Dairy",type:"color",value:"#bfdbfe",status:"active"},{id:"cat2",name:"Meat",type:"image",value:"meat.png",status:"active"},{id:"cat3",name:"Bakery",type:"text",value:"Bakery",status:"active"}],uce=[{id:"prod1",locationId:"12345",categoryId:"cat1",categoryName:"Dairy",name:"Whole Milk",productId:"2222222",barcode:"123456789",barcodeType:"EAN-13",status:"active",appearance:{type:"text",value:"Whole Milk"}},{id:"prod2",locationId:"12345",categoryId:"cat2",categoryName:"Meat",name:"Ground Beef",productId:"3333333",barcode:"113456789",barcodeType:"UPC-A",status:"active",appearance:{type:"color",value:"#ef4444"}},{id:"prod3",locationId:"67890",categoryId:"cat3",categoryName:"Bakery",name:"Croissant",productId:"4444444",barcode:"998877665",barcodeType:"EAN-8",status:"inactive",appearance:{type:"image",value:"croissant.jpg"}}];function fce(){const[e,t]=_.useState("products"),[r,n]=_.useState(uce),[i,o]=_.useState(cce),[s,u]=_.useState(!1),[f,l]=_.useState(!1);return h.jsxs("div",{className:"h-full flex flex-col",children:[h.jsxs("div",{className:"pb-4",children:[h.jsxs("div",{className:"flex flex-nowrap items-center gap-3 flex-wrap",children:[h.jsxs("div",{className:"flex items-center w-40 shrink-0 rounded-md border border-gray-300 bg-white overflow-hidden",style:{height:40},children:[h.jsx(Cw,{className:"h-4 w-4 text-gray-400 shrink-0 ml-2.5 pointer-events-none"}),h.jsx(be,{placeholder:"Search...",className:"flex-1 min-w-0 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 py-2 px-2 h-full placeholder:text-gray-500"})]}),h.jsxs(Ze,{defaultValue:"partner-a",children:[h.jsx(et,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Partner"})}),h.jsx(nt,{children:h.jsx(Ae,{value:"partner-a",children:"Partner A"})})]}),h.jsxs(Ze,{defaultValue:"group-b",children:[h.jsx(et,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Group"})}),h.jsx(nt,{children:h.jsx(Ae,{value:"group-b",children:"Group B"})})]}),h.jsxs(Ze,{defaultValue:"loc-12345",children:[h.jsx(et,{className:"w-[160px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Location"})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"loc-12345",children:"Location 12345"}),h.jsx(Ae,{value:"all",children:"All Locations"})]})]}),h.jsxs(Ze,{children:[h.jsx(et,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Category"})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"all",children:"All Categories"}),i.map(d=>h.jsx(Ae,{value:d.id,children:d.name},d.id))]})]}),h.jsx("div",{className:"flex-1 min-w-2"}),h.jsxs(we,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",children:[h.jsx(k6,{className:"w-4 h-4"})," Bulk Import"]}),h.jsxs(we,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",children:[h.jsx(Pw,{className:"w-4 h-4"})," Bulk Export"]}),h.jsxs(we,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",children:[h.jsx(ro,{className:"w-4 h-4"})," Bulk Edit"]}),e==="products"?h.jsxs(we,{className:"h-10 rounded-md bg-blue-600 text-white hover:bg-blue-700 font-medium gap-1 shrink-0",onClick:()=>u(!0),children:["New Product ",h.jsx(jr,{className:"w-4 h-4"})]}):h.jsxs(we,{className:"h-10 rounded-md bg-blue-600 text-white hover:bg-blue-700 font-medium gap-1 shrink-0",onClick:()=>l(!0),children:["New Category ",h.jsx(jr,{className:"w-4 h-4"})]})]}),h.jsx("div",{className:"w-full border-b border-gray-200 mt-4",children:h.jsxs("div",{className:"flex overflow-x-auto w-fit",children:[h.jsx("button",{onClick:()=>t("products"),style:e==="products"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:`px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2 ${e==="products"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"}`,children:"Products"}),h.jsx("button",{onClick:()=>t("categories"),style:e==="categories"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:`px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2 ${e==="categories"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"}`,children:"Categories"})]})})]}),h.jsx("div",{className:"flex-1 overflow-auto pt-6",children:e==="products"?h.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-100 hover:bg-gray-100",children:[h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Location ID"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Product Category"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Product"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Product ID"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Product Barcode"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Status"}),h.jsx(me,{className:"text-gray-900 font-bold text-center",children:"Actions"})]})}),h.jsx(mr,{children:r.map(d=>h.jsxs(Ke,{children:[h.jsx(se,{className:"border-r font-numeric",children:d.locationId}),h.jsx(se,{className:"border-r text-gray-900 font-medium",children:d.categoryName}),h.jsx(se,{className:"border-r text-gray-900 font-medium",children:h.jsxs("div",{className:"flex items-center gap-2",children:[d.appearance.type==="color"&&h.jsx("div",{className:"w-4 h-4 rounded-full border border-gray-300 shadow-sm",style:{backgroundColor:d.appearance.value}}),d.appearance.type==="image"&&h.jsx(Wo,{className:"w-4 h-4 text-gray-500"}),d.name]})}),h.jsx(se,{className:"border-r font-numeric text-gray-600",children:d.productId}),h.jsx(se,{className:"border-r font-numeric",children:h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{className:"text-xs text-gray-400",children:d.barcodeType}),h.jsx("span",{children:d.barcode})]})}),h.jsx(se,{className:"border-r",children:h.jsx(Cn,{variant:d.status==="active"?"default":"secondary",className:d.status==="active"?"bg-green-600":"bg-gray-400",children:d.status})}),h.jsx(se,{className:"text-center",children:h.jsx(we,{variant:"ghost",size:"icon",className:"h-8 w-8",children:h.jsx(Aw,{className:"h-4 w-4"})})})]},d.id))})]})}):h.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-100 hover:bg-gray-100",children:[h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Category Name"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Display Type"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Preview"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Status"}),h.jsx(me,{className:"text-gray-900 font-bold text-center",children:"Actions"})]})}),h.jsx(mr,{children:i.map(d=>h.jsxs(Ke,{children:[h.jsx(se,{className:"border-r font-medium",children:d.name}),h.jsx(se,{className:"border-r capitalize",children:d.type}),h.jsxs(se,{className:"border-r",children:[d.type==="color"&&h.jsx("div",{className:"w-8 h-8 rounded-md border border-gray-200 shadow-sm",style:{backgroundColor:d.value}}),d.type==="image"&&h.jsx("div",{className:"w-8 h-8 bg-gray-100 flex items-center justify-center rounded-md border border-gray-200",children:h.jsx(Wo,{className:"w-4 h-4 text-gray-500"})}),d.type==="text"&&h.jsx("div",{className:"w-auto px-2 py-1 bg-gray-100 rounded-md border border-gray-200 text-xs font-medium inline-block",children:d.value})]}),h.jsx(se,{className:"border-r",children:h.jsx(Cn,{variant:d.status==="active"?"default":"secondary",className:d.status==="active"?"bg-green-600":"bg-gray-400",children:d.status})}),h.jsx(se,{className:"text-center",children:h.jsx(we,{variant:"ghost",size:"icon",className:"h-8 w-8",children:h.jsx(ro,{className:"h-4 w-4"})})})]},d.id))})]})})}),h.jsx(dce,{open:s,onOpenChange:u,categories:i}),h.jsx(hce,{open:f,onOpenChange:l})]})}function dce({open:e,onOpenChange:t,categories:r}){const[n,i]=_.useState("text");return h.jsx(un,{open:e,onOpenChange:t,children:h.jsxs(fn,{className:"sm:max-w-[600px] max-h-[90vh] overflow-y-auto",children:[h.jsxs(dn,{children:[h.jsx(hn,{children:"Add New Product"}),h.jsx(ki,{children:"Create a new product. Fill in the details below."})]}),h.jsxs("div",{className:"grid gap-6 py-4",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Product Category"}),h.jsxs(Ze,{children:[h.jsx(et,{children:h.jsx(Je,{placeholder:"Select Category"})}),h.jsx(nt,{children:r.map(o=>h.jsx(Ae,{value:o.id,children:o.name},o.id))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Product Name"}),h.jsx(be,{placeholder:"e.g. Whole Milk"})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Product ID"}),h.jsx(be,{placeholder:"Internal ID"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Status"}),h.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[h.jsx(kn,{defaultChecked:!0}),h.jsx("span",{className:"text-sm text-gray-500",children:"Active"})]})]})]}),h.jsxs("div",{className:"space-y-3 p-4 bg-gray-50 rounded-md border border-gray-100",children:[h.jsxs(he,{className:"flex items-center gap-2",children:[h.jsx(_8,{className:"w-4 h-4"})," Barcode Settings"]}),h.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[h.jsx("div",{className:"col-span-1",children:h.jsxs(Ze,{defaultValue:"ean13",children:[h.jsx(et,{children:h.jsx(Je,{placeholder:"Format"})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"ean13",children:"EAN-13"}),h.jsx(Ae,{value:"upc-a",children:"UPC-A"}),h.jsx(Ae,{value:"code128",children:"Code 128"}),h.jsx(Ae,{value:"qr",children:"QR Code"})]})]})}),h.jsx("div",{className:"col-span-2",children:h.jsx(be,{placeholder:"Barcode Value"})})]}),h.jsx(we,{variant:"link",className:"px-0 text-xs h-auto",children:"+ Add another barcode standard"})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsx(he,{children:"App Appearance"}),h.jsxs(b4,{value:n,onValueChange:i,className:"w-full",children:[h.jsxs(w4,{className:"grid w-full grid-cols-3",children:[h.jsxs(ss,{value:"text",className:"flex items-center gap-2",children:[h.jsx(up,{className:"w-3 h-3"})," Text"]}),h.jsxs(ss,{value:"color",className:"flex items-center gap-2",children:[h.jsx(tM,{className:"w-3 h-3"})," Color"]}),h.jsxs(ss,{value:"image",className:"flex items-center gap-2",children:[h.jsx(Wo,{className:"w-3 h-3"})," Image"]})]}),h.jsxs(ls,{value:"text",className:"mt-4 space-y-2",children:[h.jsx(he,{children:"Display Text"}),h.jsx(be,{placeholder:"Text to display on button"})]}),h.jsxs(ls,{value:"color",className:"mt-4 space-y-2",children:[h.jsx(he,{children:"Select Color"}),h.jsxs("div",{className:"flex gap-2 flex-wrap",children:[["#ef4444","#f97316","#f59e0b","#84cc16","#10b981","#06b6d4","#3b82f6","#6366f1","#a855f7","#ec4899"].map(o=>h.jsx("button",{className:"w-8 h-8 rounded-full border border-gray-200 shadow-sm hover:scale-110 transition-transform",style:{backgroundColor:o}},o)),h.jsx("button",{className:"w-8 h-8 rounded-full border border-dashed border-gray-400 flex items-center justify-center hover:bg-gray-50",children:h.jsx(jr,{className:"w-4 h-4 text-gray-400"})})]})]}),h.jsxs(ls,{value:"image",className:"mt-4 space-y-2",children:[h.jsx(he,{children:"Upload Image"}),h.jsxs("div",{className:"border-2 border-dashed border-gray-300 rounded-md p-6 flex flex-col items-center justify-center text-gray-500 hover:bg-gray-50 cursor-pointer",children:[h.jsx(Wo,{className:"w-8 h-8 mb-2 opacity-50"}),h.jsx("span",{className:"text-xs",children:"Click to upload or drag and drop"})]})]})]})]}),h.jsxs("div",{className:"space-y-3 pt-2 border-t border-gray-100",children:[h.jsx(he,{children:"Store Availability"}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("input",{type:"radio",id:"all-stores",name:"scope",className:"text-blue-600 focus:ring-blue-500",defaultChecked:!0}),h.jsx("label",{htmlFor:"all-stores",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"All Stores in Group"})]}),h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("input",{type:"radio",id:"specific-stores",name:"scope",className:"text-blue-600 focus:ring-blue-500"}),h.jsx("label",{htmlFor:"specific-stores",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Specific Location(s)"})]})]}),h.jsx("div",{className:"pl-6 pt-2",children:h.jsx(Ze,{disabled:!0,children:h.jsx(et,{className:"h-8 text-sm",children:h.jsx(Je,{placeholder:"Select Locations..."})})})})]})]}),h.jsxs($n,{children:[h.jsx(we,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(we,{onClick:()=>t(!1),className:"bg-blue-600 hover:bg-blue-700 text-white",children:"Create Product"})]})]})})}function hce({open:e,onOpenChange:t}){const[r,n]=_.useState("text");return h.jsx(un,{open:e,onOpenChange:t,children:h.jsxs(fn,{className:"sm:max-w-[500px]",children:[h.jsxs(dn,{children:[h.jsx(hn,{children:"Add New Category"}),h.jsx(ki,{children:"Create a product category to organize your items."})]}),h.jsxs("div",{className:"grid gap-6 py-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Category Name"}),h.jsx(be,{placeholder:"e.g. Dairy, Meat, Bakery"})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsx(he,{children:"Button Appearance"}),h.jsxs(b4,{value:r,onValueChange:n,className:"w-full",children:[h.jsxs(w4,{className:"grid w-full grid-cols-3",children:[h.jsxs(ss,{value:"text",className:"flex items-center gap-2",children:[h.jsx(up,{className:"w-3 h-3"})," Text"]}),h.jsxs(ss,{value:"color",className:"flex items-center gap-2",children:[h.jsx(tM,{className:"w-3 h-3"})," Color"]}),h.jsxs(ss,{value:"image",className:"flex items-center gap-2",children:[h.jsx(Wo,{className:"w-3 h-3"})," Image"]})]}),h.jsxs(ls,{value:"text",className:"mt-4 space-y-2",children:[h.jsx(he,{children:"Display Text"}),h.jsx(be,{placeholder:"Category Name"})]}),h.jsxs(ls,{value:"color",className:"mt-4 space-y-2",children:[h.jsx(he,{children:"Select Color"}),h.jsxs("div",{className:"flex gap-2 flex-wrap",children:[["#bfdbfe","#bbf7d0","#fecaca","#ddd6fe","#fde68a"].map(i=>h.jsx("button",{className:"w-8 h-8 rounded-full border border-gray-200 shadow-sm hover:scale-110 transition-transform",style:{backgroundColor:i}},i)),h.jsx("button",{className:"w-8 h-8 rounded-full border border-dashed border-gray-400 flex items-center justify-center hover:bg-gray-50",children:h.jsx(jr,{className:"w-4 h-4 text-gray-400"})})]})]}),h.jsxs(ls,{value:"image",className:"mt-4 space-y-2",children:[h.jsx(he,{children:"Upload Icon/Image"}),h.jsxs("div",{className:"border-2 border-dashed border-gray-300 rounded-md p-6 flex flex-col items-center justify-center text-gray-500 hover:bg-gray-50 cursor-pointer",children:[h.jsx(Wo,{className:"w-8 h-8 mb-2 opacity-50"}),h.jsx("span",{className:"text-xs",children:"Click to upload"})]})]})]})]}),h.jsx("div",{className:"grid grid-cols-2 gap-4",children:h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Status"}),h.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[h.jsx(kn,{defaultChecked:!0}),h.jsx("span",{className:"text-sm text-gray-500",children:"Active"})]})]})}),h.jsxs("div",{className:"space-y-3 pt-2 border-t border-gray-100",children:[h.jsx(he,{children:"Store Availability"}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("input",{type:"radio",id:"cat-all-stores",name:"cat-scope",className:"text-blue-600 focus:ring-blue-500",defaultChecked:!0}),h.jsx("label",{htmlFor:"cat-all-stores",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"All Stores in Group"})]}),h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("input",{type:"radio",id:"cat-specific-stores",name:"cat-scope",className:"text-blue-600 focus:ring-blue-500"}),h.jsx("label",{htmlFor:"cat-specific-stores",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Specific Location(s)"})]})]})]})]}),h.jsxs($n,{children:[h.jsx(we,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(we,{onClick:()=>t(!1),className:"bg-blue-600 hover:bg-blue-700 text-white",children:"Create Category"})]})]})})}var pm="Checkbox",[pce]=In(pm),[mce,l_]=pce(pm);function vce(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:i,disabled:o,form:s,name:u,onCheckedChange:f,required:l,value:d="on",internal_do_not_use_render:p}=e,[m,g]=Pi({prop:r,defaultProp:i??!1,onChange:f,caller:pm}),[b,y]=_.useState(null),[w,j]=_.useState(null),O=_.useRef(!1),E=b?!!s||!!b.closest("form"):!0,N={checked:m,disabled:o,setChecked:g,control:b,setControl:y,name:u,form:s,value:d,hasConsumerStoppedPropagationRef:O,required:l,defaultChecked:oo(i)?!1:i,isFormControl:E,bubbleInput:w,setBubbleInput:j};return h.jsx(mce,{scope:t,...N,children:gce(p)?p(N):n})}var S4="CheckboxTrigger",_4=_.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},i)=>{const{control:o,value:s,disabled:u,checked:f,required:l,setControl:d,setChecked:p,hasConsumerStoppedPropagationRef:m,isFormControl:g,bubbleInput:b}=l_(S4,e),y=Xe(i,d),w=_.useRef(f);return _.useEffect(()=>{const j=o?.form;if(j){const O=()=>p(w.current);return j.addEventListener("reset",O),()=>j.removeEventListener("reset",O)}},[o,p]),h.jsx(qe.button,{type:"button",role:"checkbox","aria-checked":oo(f)?"mixed":f,"aria-required":l,"data-state":C4(f),"data-disabled":u?"":void 0,disabled:u,value:s,...n,ref:y,onKeyDown:ke(t,j=>{j.key==="Enter"&&j.preventDefault()}),onClick:ke(r,j=>{p(O=>oo(O)?!0:!O),b&&g&&(m.current=j.isPropagationStopped(),m.current||j.stopPropagation())})})});_4.displayName=S4;var j4=_.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:o,required:s,disabled:u,value:f,onCheckedChange:l,form:d,...p}=e;return h.jsx(vce,{__scopeCheckbox:r,checked:i,defaultChecked:o,disabled:u,required:s,onCheckedChange:l,name:n,form:d,value:f,internal_do_not_use_render:({isFormControl:m})=>h.jsxs(h.Fragment,{children:[h.jsx(_4,{...p,ref:t,__scopeCheckbox:r}),m&&h.jsx(A4,{__scopeCheckbox:r})]})})});j4.displayName=pm;var O4="CheckboxIndicator",E4=_.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...i}=e,o=l_(O4,r);return h.jsx(Or,{present:n||oo(o.checked)||o.checked===!0,children:h.jsx(qe.span,{"data-state":C4(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});E4.displayName=O4;var P4="CheckboxBubbleInput",A4=_.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:s,required:u,disabled:f,name:l,value:d,form:p,bubbleInput:m,setBubbleInput:g}=l_(P4,e),b=Xe(r,g),y=t_(o),w=XS(n);_.useEffect(()=>{const O=m;if(!O)return;const E=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(E,"checked").set,C=!i.current;if(y!==o&&A){const T=new Event("click",{bubbles:C});O.indeterminate=oo(o),A.call(O,oo(o)?!1:o),O.dispatchEvent(T)}},[m,y,o,i]);const j=_.useRef(oo(o)?!1:o);return h.jsx(qe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??j.current,required:u,disabled:f,name:l,value:d,form:p,...t,tabIndex:-1,ref:b,style:{...t.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});A4.displayName=P4;function gce(e){return typeof e=="function"}function oo(e){return e==="indeterminate"}function C4(e){return oo(e)?"indeterminate":e?"checked":"unchecked"}function cc({className:e,...t}){return h.jsx(j4,{"data-slot":"checkbox",className:Te("peer border bg-input-background dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:h.jsx(E4,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:h.jsx(YR,{className:"size-3.5"})})})}const yce=[{id:"1",name:"Downtown Store (101)"},{id:"2",name:"Uptown Store (102)"},{id:"3",name:"Airport Kiosk (201)"},{id:"4",name:"Mall Outlet (305)"}],xce=[{id:"r1",name:"Partner Admin",permissions:["all"],notifications:["system_updates","billing"]},{id:"r2",name:"Group Admin",permissions:["manage_users","manage_products","view_reports"],notifications:["new_users"]},{id:"r3",name:"Manager",permissions:["manage_store","view_reports","manage_inventory"],notifications:["label_expiry","low_stock"]},{id:"r4",name:"Team Member",permissions:["view_tasks","print_labels"],notifications:["task_assignment"]}],N4=[{id:"p1",name:"Global Foods Inc.",status:"active",contact:"admin@globalfoods.com",phone:"+1 (555) 100-2000"},{id:"p2",name:"Local Eateries Co.",status:"active",contact:"support@localeateries.com",phone:"+1 (555) 200-3000"}],bce=[{id:"g1",name:"West Coast Region",partner:"Global Foods Inc.",status:"active"},{id:"g2",name:"East Coast Region",partner:"Global Foods Inc.",status:"inactive"}],wce=[{id:"m1",name:"Alice Johnson",role:"Manager",locations:["Downtown Store (101)","Uptown Store (102)"],email:"alice@example.com",phone:"+1 (555) 111-2222",status:"active"},{id:"m2",name:"Bob Smith",role:"Team Member",locations:["Airport Kiosk (201)"],email:"bob@example.com",phone:"+1 (555) 222-3333",status:"active"},{id:"m3",name:"Charlie Brown",role:"Team Member",locations:["Downtown Store (101)"],email:"charlie@example.com",phone:"+1 (555) 333-4444",status:"inactive"}];function Sce(){const[e,t]=_.useState("Roles"),[r,n]=_.useState(xce),[i,o]=_.useState(N4),[s,u]=_.useState(bce),[f,l]=_.useState(wce),[d,p]=_.useState(!1),[m,g]=_.useState(!1),[b,y]=_.useState(!1),[w,j]=_.useState(!1),O=()=>{alert(`Exporting ${e} list to PDF...`)},E=()=>{switch(e){case"Roles":p(!0);break;case"Partner":g(!0);break;case"Group":y(!0);break;case"Team Member":j(!0);break}},N=()=>{const C=e==="Team Member";return h.jsxs("div",{className:"flex flex-col gap-4 pb-4",children:[h.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[h.jsx(be,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"border border-gray-300 rounded-md w-40 shrink-0 bg-white placeholder:text-gray-500"}),h.jsx("div",{className:"flex-1"}),C&&h.jsxs(h.Fragment,{children:[h.jsx(we,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Import"}),h.jsx(we,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Edit"})]}),h.jsx(we,{variant:"outline",onClick:O,className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Export (PDF)"}),h.jsx(we,{className:"h-10 bg-blue-600 hover:bg-blue-700 text-white rounded-md px-6 font-medium shrink-0",onClick:E,children:"New+"})]}),h.jsx("div",{className:"w-full border-b border-gray-200",children:h.jsx("div",{className:"flex overflow-x-auto w-fit",children:["Roles","Partner","Group","Team Member"].map(T=>h.jsx("button",{onClick:()=>t(T),style:e===T?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:Te("px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2",e===T?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"),children:T},T))})})]})},A=()=>{switch(e){case"Roles":return h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-100",children:[h.jsx(me,{className:"font-bold text-black border-r",children:"Role Name"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Access Permissions"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Notifications"}),h.jsx(me,{className:"font-bold text-black text-center",children:"Actions"})]})}),h.jsx(mr,{children:r.map(C=>h.jsxs(Ke,{children:[h.jsx(se,{className:"font-medium border-r",children:C.name}),h.jsx(se,{className:"border-r",children:h.jsx("div",{className:"flex flex-wrap gap-1",children:C.permissions.map(T=>h.jsx(Cn,{variant:"secondary",className:"text-xs bg-blue-100 text-blue-800 hover:bg-blue-100",children:T},T))})}),h.jsx(se,{className:"border-r",children:h.jsx("div",{className:"flex flex-wrap gap-1",children:C.notifications.map(T=>h.jsx(Cn,{variant:"outline",className:"text-xs border-orange-200 text-orange-700 bg-orange-50",children:T},T))})}),h.jsx(se,{className:"text-center",children:h.jsx(we,{variant:"ghost",size:"sm",children:h.jsx(ro,{className:"w-4 h-4 text-gray-500"})})})]},C.id))})]});case"Partner":return h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-100",children:[h.jsx(me,{className:"font-bold text-black border-r",children:"Partner Name"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Contact"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Phone"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Status"}),h.jsx(me,{className:"font-bold text-black text-center",children:"Actions"})]})}),h.jsx(mr,{children:i.map(C=>h.jsxs(Ke,{children:[h.jsx(se,{className:"font-medium border-r",children:C.name}),h.jsx(se,{className:"border-r",children:C.contact}),h.jsx(se,{className:"border-r text-gray-600",children:C.phone}),h.jsx(se,{className:"border-r",children:h.jsx(Cn,{className:C.status==="active"?"bg-green-600":"bg-gray-400",children:C.status})}),h.jsx(se,{className:"text-center",children:h.jsx(we,{variant:"ghost",size:"sm",children:h.jsx(ro,{className:"w-4 h-4 text-gray-500"})})})]},C.id))})]});case"Group":return h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-100",children:[h.jsx(me,{className:"font-bold text-black border-r",children:"Group Name"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Parent Partner"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Status"}),h.jsx(me,{className:"font-bold text-black text-center",children:"Actions"})]})}),h.jsx(mr,{children:s.map(C=>h.jsxs(Ke,{children:[h.jsx(se,{className:"font-medium border-r",children:C.name}),h.jsx(se,{className:"border-r",children:C.partner}),h.jsx(se,{className:"border-r",children:h.jsx(Cn,{className:C.status==="active"?"bg-green-600":"bg-gray-400",children:C.status})}),h.jsx(se,{className:"text-center",children:h.jsx(we,{variant:"ghost",size:"sm",children:h.jsx(ro,{className:"w-4 h-4 text-gray-500"})})})]},C.id))})]});case"Team Member":return h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-100",children:[h.jsx(me,{className:"font-bold text-black border-r",children:"Name"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Email"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Phone"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Role"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Assigned Locations"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Status"}),h.jsx(me,{className:"font-bold text-black text-center",children:"Actions"})]})}),h.jsx(mr,{children:f.map(C=>h.jsxs(Ke,{children:[h.jsx(se,{className:"font-medium border-r",children:C.name}),h.jsx(se,{className:"border-r text-gray-600",children:C.email}),h.jsx(se,{className:"border-r text-gray-600",children:C.phone}),h.jsx(se,{className:"border-r",children:h.jsx(Cn,{variant:"outline",className:"font-normal",children:C.role})}),h.jsx(se,{className:"border-r",children:h.jsx("div",{className:"flex flex-col gap-1",children:C.locations.map(T=>h.jsxs("div",{className:"flex items-center gap-1 text-xs text-gray-600",children:[h.jsx(Fs,{className:"w-3 h-3"})," ",T]},T))})}),h.jsx(se,{className:"border-r",children:h.jsx(Cn,{className:C.status==="active"?"bg-green-600":"bg-gray-400",children:C.status})}),h.jsx(se,{className:"text-center",children:h.jsx(we,{variant:"ghost",size:"sm",children:h.jsx(ro,{className:"w-4 h-4 text-gray-500"})})})]},C.id))})]})}};return h.jsxs("div",{className:"h-full flex flex-col",children:[N(),h.jsx("div",{className:"flex-1 overflow-auto pt-6",children:h.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md",children:A()})}),h.jsx(_ce,{open:d,onOpenChange:p}),h.jsx(jce,{open:m,onOpenChange:g}),h.jsx(Oce,{open:b,onOpenChange:y}),h.jsx(Ece,{open:w,onOpenChange:j,roles:r})]})}function _ce({open:e,onOpenChange:t}){return h.jsx(un,{open:e,onOpenChange:t,children:h.jsxs(fn,{className:"sm:max-w-[600px]",children:[h.jsxs(dn,{children:[h.jsx(hn,{children:"Create New Role"}),h.jsx(ki,{children:"Define permissions and notification settings for this role."})]}),h.jsxs("div",{className:"space-y-4 py-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Role Name"}),h.jsx(be,{placeholder:"e.g. Inventory Specialist"})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs(he,{className:"flex items-center gap-2",children:[h.jsx(g6,{className:"w-4 h-4"})," Access Permissions"]}),h.jsx("div",{className:"grid grid-cols-2 gap-2 p-3 bg-gray-50 rounded border border-gray-100",children:["Manage Labels","Manage Products","Manage People","View Reports","Edit Settings","Approve Batches"].map(r=>h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx(cc,{id:`perm-${r}`}),h.jsx("label",{htmlFor:`perm-${r}`,className:"text-sm font-medium leading-none cursor-pointer",children:r})]},r))})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs(he,{className:"flex items-center gap-2",children:[h.jsx(O8,{className:"w-4 h-4"})," Notifications (Alerts)"]}),h.jsxs("div",{className:"grid grid-cols-1 gap-2 p-3 bg-gray-50 rounded border border-gray-100",children:[h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx(cc,{id:"notif-expiry",defaultChecked:!0}),h.jsx("label",{htmlFor:"notif-expiry",className:"text-sm font-medium leading-none cursor-pointer",children:"Label Expiry Alerts"})]}),h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx(cc,{id:"notif-stock"}),h.jsx("label",{htmlFor:"notif-stock",className:"text-sm font-medium leading-none cursor-pointer",children:"Low Stock Alerts"})]}),h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx(cc,{id:"notif-tasks"}),h.jsx("label",{htmlFor:"notif-tasks",className:"text-sm font-medium leading-none cursor-pointer",children:"New Task Assignments"})]})]})]})]}),h.jsxs($n,{children:[h.jsx(we,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(we,{onClick:()=>t(!1),className:"bg-blue-600 text-white hover:bg-blue-700",children:"Save Role"})]})]})})}function jce({open:e,onOpenChange:t}){return h.jsx(un,{open:e,onOpenChange:t,children:h.jsxs(fn,{children:[h.jsx(dn,{children:h.jsx(hn,{children:"Create New Partner"})}),h.jsxs("div",{className:"space-y-4 py-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Partner Name"}),h.jsx(be,{placeholder:"Company Name"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Contact Email"}),h.jsx(be,{placeholder:"admin@partner.com"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Phone Number"}),h.jsx(be,{type:"tel",placeholder:"+1 (555) 000-0000"})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(kn,{id:"partner-status",defaultChecked:!0}),h.jsx(he,{htmlFor:"partner-status",children:"Active"})]})]}),h.jsxs($n,{children:[h.jsx(we,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(we,{onClick:()=>t(!1),className:"bg-blue-600 text-white hover:bg-blue-700",children:"Save Partner"})]})]})})}function Oce({open:e,onOpenChange:t}){return h.jsx(un,{open:e,onOpenChange:t,children:h.jsxs(fn,{children:[h.jsx(dn,{children:h.jsx(hn,{children:"Create New Group"})}),h.jsxs("div",{className:"space-y-4 py-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Group Name"}),h.jsx(be,{placeholder:"e.g. West Coast Region"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Assign to Partner"}),h.jsxs(Ze,{children:[h.jsx(et,{children:h.jsx(Je,{placeholder:"Select Partner"})}),h.jsx(nt,{children:N4.map(r=>h.jsx(Ae,{value:r.id,children:r.name},r.id))})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(kn,{id:"group-status",defaultChecked:!0}),h.jsx(he,{htmlFor:"group-status",children:"Active"})]})]}),h.jsxs($n,{children:[h.jsx(we,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(we,{onClick:()=>t(!1),className:"bg-blue-600 text-white hover:bg-blue-700",children:"Save Group"})]})]})})}function Ece({open:e,onOpenChange:t,roles:r}){return h.jsx(un,{open:e,onOpenChange:t,children:h.jsxs(fn,{className:"sm:max-w-[500px]",children:[h.jsxs(dn,{children:[h.jsx(hn,{children:"Add Team Member / Manager"}),h.jsx(ki,{children:"Create a user account and assign them to locations."})]}),h.jsxs("div",{className:"space-y-4 py-4 max-h-[60vh] overflow-y-auto pr-1",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Full Name"}),h.jsx(be,{placeholder:"John Doe"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Role"}),h.jsxs(Ze,{children:[h.jsx(et,{children:h.jsx(Je,{placeholder:"Select Role"})}),h.jsx(nt,{children:r.map(n=>h.jsx(Ae,{value:n.name,children:n.name},n.id))})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Password"}),h.jsx(be,{type:"password",placeholder:"Enter password",autoComplete:"new-password",className:"w-full"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Email Address"}),h.jsx(be,{type:"email",placeholder:"john@example.com"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Phone Number"}),h.jsx(be,{type:"tel",placeholder:"+1 (555) 000-0000"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(wc,{className:"h-[120px] w-full border rounded-md p-2",children:h.jsx("div",{className:"space-y-2",children:yce.map(n=>h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx(cc,{id:`loc-${n.id}`}),h.jsx("label",{htmlFor:`loc-${n.id}`,className:"text-sm cursor-pointer w-full hover:bg-gray-50 p-1 rounded",children:n.name})]},n.id))})}),h.jsx("p",{className:"text-xs text-gray-500",children:"* Users must be assigned to at least one location."})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(kn,{id:"member-status",defaultChecked:!0}),h.jsx(he,{htmlFor:"member-status",children:"Active Account"})]})]}),h.jsxs($n,{children:[h.jsx(we,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(we,{onClick:()=>t(!1),className:"bg-blue-600 text-white hover:bg-blue-700",children:"Create User"})]})]})})}function Pce(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Array(12).fill(0);let _w=1;class Ace{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:n,...i}=t,o=typeof t?.id=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:_w++,s=this.toasts.find(f=>f.id===o),u=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),s?this.toasts=this.toasts.map(f=>f.id===o?(this.publish({...f,...t,id:o,title:n}),{...f,...t,id:o,dismissible:u,title:n}):f):this.addToast({title:n,...i,dismissible:u,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let o=n!==void 0,s;const u=i.then(async l=>{if(s=["resolve",l],F.isValidElement(l))o=!1,this.create({id:n,type:"default",message:l});else if(Nce(l)&&!l.ok){o=!1;const p=typeof r.error=="function"?await r.error(`HTTP error! status: ${l.status}`):r.error,m=typeof r.description=="function"?await r.description(`HTTP error! status: ${l.status}`):r.description,b=typeof p=="object"&&!F.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:m,...b})}else if(l instanceof Error){o=!1;const p=typeof r.error=="function"?await r.error(l):r.error,m=typeof r.description=="function"?await r.description(l):r.description,b=typeof p=="object"&&!F.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:m,...b})}else if(r.success!==void 0){o=!1;const p=typeof r.success=="function"?await r.success(l):r.success,m=typeof r.description=="function"?await r.description(l):r.description,b=typeof p=="object"&&!F.isValidElement(p)?p:{message:p};this.create({id:n,type:"success",description:m,...b})}}).catch(async l=>{if(s=["reject",l],r.error!==void 0){o=!1;const d=typeof r.error=="function"?await r.error(l):r.error,p=typeof r.description=="function"?await r.description(l):r.description,g=typeof d=="object"&&!F.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:p,...g})}}).finally(()=>{o&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),f=()=>new Promise((l,d)=>u.then(()=>s[0]==="reject"?d(s[1]):l(s[1])).catch(d));return typeof n!="string"&&typeof n!="number"?{unwrap:f}:Object.assign(n,{unwrap:f})},this.custom=(t,r)=>{const n=r?.id||_w++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const rn=new Ace,Cce=(e,t)=>{const r=t?.id||_w++;return rn.addToast({title:e,...t,id:r}),r},Nce=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Tce=Cce,kce=()=>rn.toasts,Rce=()=>rn.getActiveToasts(),Jt=Object.assign(Tce,{success:rn.success,info:rn.info,warning:rn.warning,error:rn.error,custom:rn.custom,message:rn.message,promise:rn.promise,dismiss:rn.dismiss,loading:rn.loading},{getHistory:kce,getToasts:Rce});Pce("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");const Mce=[{id:"1-251201",productName:"Whole Milk",category:"Dairy",template:'2"x2" Basic',printedAt:"2024-03-20 09:30 AM",printedBy:"Alice Johnson",location:"Downtown Store (101)",expiryDate:"2024-03-27",status:"Valid"},{id:"2-251201",productName:"Ground Beef",category:"Meat",template:'2"x2" Basic',printedAt:"2024-03-20 10:15 AM",printedBy:"Bob Smith",location:"Uptown Store (102)",expiryDate:"2024-03-23",status:"Valid"},{id:"3-251201",productName:"Croissant",category:"Bakery",template:'2"x2" Basic',printedAt:"2024-03-19 14:00 PM",printedBy:"Charlie Brown",location:"Downtown Store (101)",expiryDate:"2024-03-20",status:"Expired"},{id:"4-251201",productName:"Caesar Salad",category:"Deli",template:`2"x6" G'n'G !!!`,printedAt:"2024-03-18 11:45 AM",printedBy:"Alice Johnson",location:"Downtown Store (101)",expiryDate:"2024-03-21",status:"Expiring Soon"},{id:"5-251201",productName:"Orange Juice",category:"Beverage",template:'2"x2" Basic',printedAt:"2024-03-18 08:20 AM",printedBy:"Bob Smith",location:"Airport Kiosk (201)",expiryDate:"2024-03-25",status:"Valid"}],Ice=[{name:"Dairy",count:450},{name:"Meat",count:320},{name:"Bakery",count:280},{name:"Deli",count:190},{name:"Produce",count:150},{name:"Beverage",count:120}],Dce=[{date:"Mon",count:120},{date:"Tue",count:132},{date:"Wed",count:101},{date:"Thu",count:134},{date:"Fri",count:190},{date:"Sat",count:230},{date:"Sun",count:210}];function Lce(){const[e,t]=_.useState("print-log"),r=n=>{Jt.success(`Reprinting label ${n}`,{description:"Watermark 'RePrint' applied."})};return h.jsxs("div",{className:"h-full flex flex-col",children:[h.jsxs("div",{className:"pb-4",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[h.jsxs(Ze,{defaultValue:"partner-a",children:[h.jsx(et,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Partner"})}),h.jsx(nt,{children:h.jsx(Ae,{value:"partner-a",children:"Partner A"})})]}),h.jsxs(Ze,{defaultValue:"group-b",children:[h.jsx(et,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Group"})}),h.jsx(nt,{children:h.jsx(Ae,{value:"group-b",children:"Group B"})})]}),h.jsxs(Ze,{defaultValue:"loc-12345",children:[h.jsx(et,{className:"w-[160px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Location"})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"loc-12345",children:"Downtown Store"}),h.jsx(Ae,{value:"all",children:"All Locations"})]})]}),h.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[h.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Period Search:"}),h.jsxs("div",{className:"flex items-center bg-white border border-gray-300 rounded-md h-10 px-2",style:{minHeight:40},children:[h.jsx(P8,{className:"w-4 h-4 text-gray-500 mr-2 shrink-0"}),h.jsx("input",{type:"date",className:"text-sm outline-none w-32 bg-transparent"}),h.jsx("span",{className:"mx-2 text-gray-400",children:"-"}),h.jsx("input",{type:"date",className:"text-sm outline-none w-32 bg-transparent"})]})]}),h.jsxs("div",{className:"flex items-center w-64 rounded-md border border-gray-300 bg-white overflow-hidden shrink-0",style:{height:40},children:[h.jsx(Cw,{className:"h-4 w-4 text-gray-400 shrink-0 ml-3 pointer-events-none"}),h.jsx(be,{placeholder:"Search Product or Category...",className:"flex-1 min-w-0 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 py-2 px-2 h-full placeholder:text-gray-500"})]}),h.jsx("div",{className:"flex-1 min-w-2"}),h.jsxs(we,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",children:[h.jsx(Pw,{className:"w-4 h-4"})," Export Report"]})]}),h.jsx("div",{className:"w-full border-b border-gray-200 mt-4",children:h.jsxs("div",{className:"flex overflow-x-auto w-fit",children:[h.jsx("button",{onClick:()=>t("print-log"),style:e==="print-log"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:Te("px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2",e==="print-log"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"),children:"Print Log"}),h.jsx("button",{onClick:()=>t("label-report"),style:e==="label-report"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:Te("px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2",e==="label-report"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"),children:"Label Report"})]})})]}),h.jsxs("div",{className:"flex-1 overflow-auto pt-6",children:[e==="print-log"&&h.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-100 hover:bg-gray-100",children:[h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Label ID"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Product Name"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Category"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Template"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Printed At"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Printed By"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Location"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Expiry Date"}),h.jsx(me,{className:"text-gray-900 font-bold text-center",children:"Action"})]})}),h.jsx(mr,{children:Mce.map(n=>h.jsxs(Ke,{children:[h.jsx(se,{className:"border-r font-numeric text-gray-600",children:n.id}),h.jsx(se,{className:"border-r font-medium",children:n.productName}),h.jsx(se,{className:"border-r",children:h.jsx(Cn,{variant:"secondary",className:"bg-blue-50 text-blue-700 hover:bg-blue-50 border-blue-200",children:n.category})}),h.jsx(se,{className:"border-r text-gray-600 text-sm",children:(()=>{const i=n.template.endsWith(" !!!"),o=i?n.template.slice(0,-4):n.template,s=o.lastIndexOf(" "),u=o.slice(0,s+1),f=o.slice(s+1);return h.jsxs(h.Fragment,{children:[u,h.jsx("span",{className:"font-bold text-gray-900",children:f}),i&&h.jsx("span",{className:"text-red-600",children:" !!!"})]})})()}),h.jsx(se,{className:"border-r text-gray-600 text-sm font-numeric",children:n.printedAt}),h.jsx(se,{className:"border-r text-gray-600 text-sm",children:n.printedBy}),h.jsx(se,{className:"border-r text-gray-600 text-sm font-numeric",children:n.location}),h.jsx(se,{className:"border-r",children:h.jsx("span",{className:Te("text-sm font-medium font-numeric",n.status==="Expired"?"text-red-600":n.status==="Expiring Soon"?"text-orange-500":"text-green-600"),children:n.expiryDate})}),h.jsx(se,{className:"text-center",children:h.jsxs(we,{size:"sm",variant:"outline",className:"h-8 gap-1 hover:bg-gray-100 border-gray-300",onClick:()=>r(n.id),children:[h.jsx(rM,{className:"w-3 h-3"})," Reprint"]})})]},n.id))})]})}),e==="label-report"&&h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[h.jsxs($r,{children:[h.jsxs(On,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[h.jsx(En,{className:"text-sm font-medium",children:"Total Labels Printed"}),h.jsx(us,{className:"h-4 w-4 text-muted-foreground"})]}),h.jsxs(nn,{children:[h.jsx("div",{className:"text-2xl font-bold",children:"2,543"}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"+20.1% from last month"})]})]}),h.jsxs($r,{children:[h.jsxs(On,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[h.jsx(En,{className:"text-sm font-medium",children:"Most Printed Category"}),h.jsx(C8,{className:"h-4 w-4 text-muted-foreground"})]}),h.jsxs(nn,{children:[h.jsx("div",{className:"text-2xl font-bold",children:"Dairy"}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"450 labels generated"})]})]}),h.jsxs($r,{children:[h.jsxs(On,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[h.jsx(En,{className:"text-sm font-medium",children:"Top Product"}),h.jsx(XR,{className:"h-4 w-4 text-muted-foreground"})]}),h.jsxs(nn,{children:[h.jsx("div",{className:"text-2xl font-bold",children:"Whole Milk"}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"182 labels generated"})]})]}),h.jsxs($r,{children:[h.jsxs(On,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[h.jsx(En,{className:"text-sm font-medium",children:"Avg. Daily Prints"}),h.jsx(f6,{className:"h-4 w-4 text-muted-foreground"})]}),h.jsxs(nn,{children:[h.jsx("div",{className:"text-2xl font-bold",children:"85"}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"+12% from last week"})]})]})]}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsxs($r,{className:"col-span-1",children:[h.jsxs(On,{children:[h.jsx(En,{children:"Labels by Category"}),h.jsx(Zd,{children:"Distribution of printed labels across product categories."})]}),h.jsx(nn,{className:"h-[300px]",children:h.jsx(uh,{width:"100%",height:"100%",children:h.jsxs(hne,{data:Ice,children:[h.jsx(Yh,{strokeDasharray:"3 3",vertical:!1}),h.jsx(Qo,{dataKey:"name",fontSize:12,tickLine:!1,axisLine:!1}),h.jsx(Zo,{fontSize:12,tickLine:!1,axisLine:!1,tickFormatter:n=>`${n}`}),h.jsx(Br,{}),h.jsx(ua,{dataKey:"count",fill:"#facc15",radius:[4,4,0,0]})]})})})]}),h.jsxs($r,{className:"col-span-1",children:[h.jsxs(On,{children:[h.jsx(En,{children:"Print Volume Trends"}),h.jsx(Zd,{children:"Daily label printing volume for the last 7 days."})]}),h.jsx(nn,{className:"h-[300px]",children:h.jsx(uh,{width:"100%",height:"100%",children:h.jsxs(i$,{data:Dce,children:[h.jsx(Yh,{strokeDasharray:"3 3",vertical:!1}),h.jsx(Qo,{dataKey:"date",fontSize:12,tickLine:!1,axisLine:!1}),h.jsx(Zo,{fontSize:12,tickLine:!1,axisLine:!1}),h.jsx(Br,{}),h.jsx(Qs,{type:"monotone",dataKey:"count",stroke:"#dc2626",strokeWidth:2,dot:{r:4},activeDot:{r:6}})]})})})]})]}),h.jsxs($r,{children:[h.jsx(On,{children:h.jsx(En,{children:"Most Used Products"})}),h.jsx(nn,{children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{children:[h.jsx(me,{children:"Product Name"}),h.jsx(me,{children:"Category"}),h.jsx(me,{className:"text-right",children:"Total Printed"}),h.jsx(me,{className:"text-right",children:"Usage %"})]})}),h.jsxs(mr,{children:[h.jsxs(Ke,{children:[h.jsx(se,{className:"font-medium",children:"Whole Milk"}),h.jsx(se,{children:"Dairy"}),h.jsx(se,{className:"text-right",children:"182"}),h.jsx(se,{className:"text-right",children:"7.2%"})]}),h.jsxs(Ke,{children:[h.jsx(se,{className:"font-medium",children:"Ground Beef 80/20"}),h.jsx(se,{children:"Meat"}),h.jsx(se,{className:"text-right",children:"145"}),h.jsx(se,{className:"text-right",children:"5.7%"})]}),h.jsxs(Ke,{children:[h.jsx(se,{className:"font-medium",children:"Chicken Breast"}),h.jsx(se,{children:"Meat"}),h.jsx(se,{className:"text-right",children:"132"}),h.jsx(se,{className:"text-right",children:"5.2%"})]}),h.jsxs(Ke,{children:[h.jsx(se,{className:"font-medium",children:"Sliced Ham"}),h.jsx(se,{children:"Deli"}),h.jsx(se,{className:"text-right",children:"98"}),h.jsx(se,{className:"text-right",children:"3.8%"})]})]})]})})]})]})]})]})}var $ce=Symbol("radix.slottable");function Bce(e){const t=({children:r})=>h.jsx(h.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=$ce,t}var[mm]=In("Tooltip",[el]),vm=el(),T4="TooltipProvider",Fce=700,jw="tooltip.open",[zce,c_]=mm(T4),k4=e=>{const{__scopeTooltip:t,delayDuration:r=Fce,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:o}=e,s=_.useRef(!0),u=_.useRef(!1),f=_.useRef(0);return _.useEffect(()=>{const l=f.current;return()=>window.clearTimeout(l)},[]),h.jsx(zce,{scope:t,isOpenDelayedRef:s,delayDuration:r,onOpen:_.useCallback(()=>{window.clearTimeout(f.current),s.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>s.current=!0,n)},[n]),isPointerInTransitRef:u,onPointerInTransitChange:_.useCallback(l=>{u.current=l},[]),disableHoverableContent:i,children:o})};k4.displayName=T4;var iu="Tooltip",[qce,_u]=mm(iu),R4=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:i,onOpenChange:o,disableHoverableContent:s,delayDuration:u}=e,f=c_(iu,e.__scopeTooltip),l=vm(t),[d,p]=_.useState(null),m=Xn(),g=_.useRef(0),b=s??f.disableHoverableContent,y=u??f.delayDuration,w=_.useRef(!1),[j,O]=Pi({prop:n,defaultProp:i??!1,onChange:T=>{T?(f.onOpen(),document.dispatchEvent(new CustomEvent(jw))):f.onClose(),o?.(T)},caller:iu}),E=_.useMemo(()=>j?w.current?"delayed-open":"instant-open":"closed",[j]),N=_.useCallback(()=>{window.clearTimeout(g.current),g.current=0,w.current=!1,O(!0)},[O]),A=_.useCallback(()=>{window.clearTimeout(g.current),g.current=0,O(!1)},[O]),C=_.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{w.current=!0,O(!0),g.current=0},y)},[y,O]);return _.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),h.jsx(ZS,{...l,children:h.jsx(qce,{scope:t,contentId:m,open:j,stateAttribute:E,trigger:d,onTriggerChange:p,onTriggerEnter:_.useCallback(()=>{f.isOpenDelayedRef.current?C():N()},[f.isOpenDelayedRef,C,N]),onTriggerLeave:_.useCallback(()=>{b?A():(window.clearTimeout(g.current),g.current=0)},[A,b]),onOpen:N,onClose:A,disableHoverableContent:b,children:r})})};R4.displayName=iu;var Ow="TooltipTrigger",M4=_.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,i=_u(Ow,r),o=c_(Ow,r),s=vm(r),u=_.useRef(null),f=Xe(t,u,i.onTriggerChange),l=_.useRef(!1),d=_.useRef(!1),p=_.useCallback(()=>l.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),h.jsx(rm,{asChild:!0,...s,children:h.jsx(qe.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...n,ref:f,onPointerMove:ke(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:ke(e.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:ke(e.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:ke(e.onFocus,()=>{l.current||i.onOpen()}),onBlur:ke(e.onBlur,i.onClose),onClick:ke(e.onClick,i.onClose)})})});M4.displayName=Ow;var u_="TooltipPortal",[Uce,Wce]=mm(u_,{forceMount:void 0}),I4=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:i}=e,o=_u(u_,t);return h.jsx(Uce,{scope:t,forceMount:r,children:h.jsx(Or,{present:r||o.open,children:h.jsx(gu,{asChild:!0,container:i,children:n})})})};I4.displayName=u_;var $s="TooltipContent",D4=_.forwardRef((e,t)=>{const r=Wce($s,e.__scopeTooltip),{forceMount:n=r.forceMount,side:i="top",...o}=e,s=_u($s,e.__scopeTooltip);return h.jsx(Or,{present:n||s.open,children:s.disableHoverableContent?h.jsx(L4,{side:i,...o,ref:t}):h.jsx(Hce,{side:i,...o,ref:t})})}),Hce=_.forwardRef((e,t)=>{const r=_u($s,e.__scopeTooltip),n=c_($s,e.__scopeTooltip),i=_.useRef(null),o=Xe(t,i),[s,u]=_.useState(null),{trigger:f,onClose:l}=r,d=i.current,{onPointerInTransitChange:p}=n,m=_.useCallback(()=>{u(null),p(!1)},[p]),g=_.useCallback((b,y)=>{const w=b.currentTarget,j={x:b.clientX,y:b.clientY},O=Xce(j,w.getBoundingClientRect()),E=Yce(j,O),N=Qce(y.getBoundingClientRect()),A=Jce([...E,...N]);u(A),p(!0)},[p]);return _.useEffect(()=>()=>m(),[m]),_.useEffect(()=>{if(f&&d){const b=w=>g(w,d),y=w=>g(w,f);return f.addEventListener("pointerleave",b),d.addEventListener("pointerleave",y),()=>{f.removeEventListener("pointerleave",b),d.removeEventListener("pointerleave",y)}}},[f,d,g,m]),_.useEffect(()=>{if(s){const b=y=>{const w=y.target,j={x:y.clientX,y:y.clientY},O=f?.contains(w)||d?.contains(w),E=!Zce(j,s);O?m():E&&(m(),l())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[f,d,s,l,m]),h.jsx(L4,{...e,ref:o})}),[Vce,Gce]=mm(iu,{isInside:!1}),Kce=Bce("TooltipContent"),L4=_.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...u}=e,f=_u($s,r),l=vm(r),{onClose:d}=f;return _.useEffect(()=>(document.addEventListener(jw,d),()=>document.removeEventListener(jw,d)),[d]),_.useEffect(()=>{if(f.trigger){const p=m=>{m.target?.contains(f.trigger)&&d()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[f.trigger,d]),h.jsx(mu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:p=>p.preventDefault(),onDismiss:d,children:h.jsxs(JS,{"data-state":f.stateAttribute,...l,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(Kce,{children:n}),h.jsx(Vce,{scope:r,isInside:!0,children:h.jsx(goe,{id:f.contentId,role:"tooltip",children:i||n})})]})})});D4.displayName=$s;var $4="TooltipArrow",B4=_.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,i=vm(r);return Gce($4,r).isInside?null:h.jsx(e_,{...i,...n,ref:t})});B4.displayName=$4;function Xce(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,i,o)){case o:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Yce(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function Qce(e){const{top:t,right:r,bottom:n,left:i}=e;return[{x:i,y:t},{x:r,y:t},{x:r,y:n},{x:i,y:n}]}function Zce(e,t){const{x:r,y:n}=e;let i=!1;for(let o=0,s=t.length-1;on!=m>n&&r<(p-l)*(n-d)/(m-d)+l&&(i=!i)}return i}function Jce(e){const t=e.slice();return t.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),eue(t)}function eue(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n=2;){const o=t[t.length-1],s=t[t.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))t.pop();else break}t.push(i)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const i=e[n];for(;r.length>=2;){const o=r[r.length-1],s=r[r.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))r.pop();else break}r.push(i)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var tue=k4,rue=R4,nue=M4,iue=I4,oue=D4,aue=B4;function sue({delayDuration:e=0,...t}){return h.jsx(tue,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Db({...e}){return h.jsx(sue,{children:h.jsx(rue,{"data-slot":"tooltip",...e})})}function Lb({...e}){return h.jsx(nue,{"data-slot":"tooltip-trigger",...e})}function $b({className:e,sideOffset:t=0,children:r,...n}){return h.jsx(iue,{children:h.jsxs(oue,{"data-slot":"tooltip-content",sideOffset:t,className:Te("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...n,children:[r,h.jsx(aue,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function lue(e){const t=cue(e),r=_.forwardRef((n,i)=>{const{children:o,...s}=n,u=_.Children.toArray(o),f=u.find(fue);if(f){const l=f.props.children,d=u.map(p=>p===f?_.Children.count(l)>1?_.Children.only(null):_.isValidElement(l)?l.props.children:null:p);return h.jsx(t,{...s,ref:i,children:_.isValidElement(l)?_.cloneElement(l,void 0,d):null})}return h.jsx(t,{...s,ref:i,children:o})});return r.displayName=`${e}.Slot`,r}function cue(e){const t=_.forwardRef((r,n)=>{const{children:i,...o}=r;if(_.isValidElement(i)){const s=hue(i),u=due(o,i.props);return i.type!==_.Fragment&&(u.ref=n?ia(n,s):s),_.cloneElement(i,u)}return _.Children.count(i)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uue=Symbol("radix.slottable");function fue(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uue}function due(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...u)=>{const f=o(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function hue(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 gm="Popover",[F4]=In(gm,[el]),ju=el(),[pue,mo]=F4(gm),z4=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:i,onOpenChange:o,modal:s=!1}=e,u=ju(t),f=_.useRef(null),[l,d]=_.useState(!1),[p,m]=Pi({prop:n,defaultProp:i??!1,onChange:o,caller:gm});return h.jsx(ZS,{...u,children:h.jsx(pue,{scope:t,contentId:Xn(),triggerRef:f,open:p,onOpenChange:m,onOpenToggle:_.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:l,onCustomAnchorAdd:_.useCallback(()=>d(!0),[]),onCustomAnchorRemove:_.useCallback(()=>d(!1),[]),modal:s,children:r})})};z4.displayName=gm;var q4="PopoverAnchor",mue=_.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=mo(q4,r),o=ju(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:u}=i;return _.useEffect(()=>(s(),()=>u()),[s,u]),h.jsx(rm,{...o,...n,ref:t})});mue.displayName=q4;var U4="PopoverTrigger",W4=_.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=mo(U4,r),o=ju(r),s=Xe(t,i.triggerRef),u=h.jsx(qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":X4(i.open),...n,ref:s,onClick:ke(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:h.jsx(rm,{asChild:!0,...o,children:u})});W4.displayName=U4;var f_="PopoverPortal",[vue,gue]=F4(f_,{forceMount:void 0}),H4=e=>{const{__scopePopover:t,forceMount:r,children:n,container:i}=e,o=mo(f_,t);return h.jsx(vue,{scope:t,forceMount:r,children:h.jsx(Or,{present:r||o.open,children:h.jsx(gu,{asChild:!0,container:i,children:n})})})};H4.displayName=f_;var Bs="PopoverContent",V4=_.forwardRef((e,t)=>{const r=gue(Bs,e.__scopePopover),{forceMount:n=r.forceMount,...i}=e,o=mo(Bs,e.__scopePopover);return h.jsx(Or,{present:n||o.open,children:o.modal?h.jsx(xue,{...i,ref:t}):h.jsx(bue,{...i,ref:t})})});V4.displayName=Bs;var yue=lue("PopoverContent.RemoveScroll"),xue=_.forwardRef((e,t)=>{const r=mo(Bs,e.__scopePopover),n=_.useRef(null),i=Xe(t,n),o=_.useRef(!1);return _.useEffect(()=>{const s=n.current;if(s)return r_(s)},[]),h.jsx(im,{as:yue,allowPinchZoom:!0,children:h.jsx(G4,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ke(e.onCloseAutoFocus,s=>{s.preventDefault(),o.current||r.triggerRef.current?.focus()}),onPointerDownOutside:ke(e.onPointerDownOutside,s=>{const u=s.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,l=u.button===2||f;o.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:ke(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),bue=_.forwardRef((e,t)=>{const r=mo(Bs,e.__scopePopover),n=_.useRef(!1),i=_.useRef(!1);return h.jsx(G4,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(n.current||r.triggerRef.current?.focus(),o.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;r.triggerRef.current?.contains(s)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),G4=_.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:l,onInteractOutside:d,...p}=e,m=mo(Bs,r),g=ju(r);return qS(),h.jsx(Qp,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:o,children:h.jsx(mu,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:l,onDismiss:()=>m.onOpenChange(!1),children:h.jsx(JS,{"data-state":X4(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)"}})})})}),K4="PopoverClose",wue=_.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=mo(K4,r);return h.jsx(qe.button,{type:"button",...n,ref:t,onClick:ke(e.onClick,()=>i.onOpenChange(!1))})});wue.displayName=K4;var Sue="PopoverArrow",_ue=_.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=ju(r);return h.jsx(e_,{...i,...n,ref:t})});_ue.displayName=Sue;function X4(e){return e?"open":"closed"}var jue=z4,Oue=W4,Eue=H4,Pue=V4;function Y4({...e}){return h.jsx(jue,{"data-slot":"popover",...e})}function Q4({...e}){return h.jsx(Oue,{"data-slot":"popover-trigger",...e})}function Z4({className:e,align:t="center",sideOffset:r=4,...n}){return h.jsx(Eue,{children:h.jsx(Pue,{"data-slot":"popover-content",align:t,sideOffset:r,className:Te("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...n})})}function J4({className:e,...t}){return h.jsx("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:Te("mx-auto flex w-full justify-center",e),...t})}function e5({className:e,...t}){return h.jsx("ul",{"data-slot":"pagination-content",className:Te("flex flex-row items-center gap-1",e),...t})}function cs({...e}){return h.jsx("li",{"data-slot":"pagination-item",...e})}function ym({className:e,isActive:t,size:r="icon",...n}){return h.jsx("a",{"aria-current":t?"page":void 0,"data-slot":"pagination-link","data-active":t,className:Te(kM({variant:t?"outline":"ghost",size:r}),e),...n})}function t5({className:e,...t}){return h.jsxs(ym,{"aria-label":"Go to previous page",size:"default",className:Te("gap-1 px-2.5 sm:pl-2.5",e),...t,children:[h.jsx(QR,{}),h.jsx("span",{className:"hidden sm:block",children:"Previous"})]})}function r5({className:e,...t}){return h.jsxs(ym,{"aria-label":"Go to next page",size:"default",className:Te("gap-1 px-2.5 sm:pr-2.5",e),...t,children:[h.jsx("span",{className:"hidden sm:block",children:"Next"}),h.jsx(bc,{})]})}class Aue extends Error{status;payload;constructor(t,r,n){super(t),this.name="ApiError",this.status=r,this.payload=n}}function Cue(e,t){if(!e)return t;const r=e.endsWith("/")?e.slice(0,-1):e,n=t.startsWith("/")?t:`/${t}`;return`${r}${n}`}function Nue(e){const t=new URLSearchParams;for(const[n,i]of Object.entries(e))if(!(i==null||i==="")){if(typeof i=="boolean"){t.set(n,i?"true":"false");continue}t.set(n,String(i))}const r=t.toString();return r?`?${r}`:""}function Tue(e){const r=e?.error?.message?.trim();return r||null}function WR(e){if(!e||typeof e!="object")return e;const t=e,r="TotalCount"in t||"Items"in t,n="totalCount"in t||"items"in t;return r&&!n?{...t,totalCount:t.TotalCount,items:t.Items}:e}function n5(e={}){const t=e.baseUrl??"http://192.168.31.88:19001"??"http://localhost:19001",r=e.getToken;async function n(i){const o=i.prefix??"/api/app",s=Cue(t,`${o}${i.path}${Nue(i.query??{})}`),u={"Content-Type":"application/json"},f=r?.();f&&(u.Authorization=`Bearer ${f}`);const l=await fetch(s,{method:i.method,headers:u,body:i.body===void 0?void 0:JSON.stringify(i.body),signal:i.signal}),m=(l.headers.get("content-type")??"").includes("application/json")?await l.json().catch(()=>null):await l.text().catch(()=>"");if(!l.ok){const b=Tue(m)??(typeof m=="string"&&m.trim()?m:"Request failed.");throw new Aue(b,l.status,m)}return m&&typeof m=="object"&&"data"in m?WR(m.data??null):WR(m)}return{requestJson:n}}const xm=n5({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}});async function kue(e,t){return xm.requestJson({path:"/location",method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,Keyword:e.keyword,Partner:e.partner,GroupName:e.groupName,State:e.state},signal:t})}async function Rue(e){return xm.requestJson({path:"/location",method:"POST",body:{partner:e.partner,groupName:e.groupName,locationCode:e.locationCode,locationName:e.locationName,street:e.street,city:e.city,stateCode:e.stateCode,country:e.country,zipCode:e.zipCode,phone:e.phone,email:e.email,latitude:e.latitude,longitude:e.longitude,state:e.state??!0}})}async function Mue(e,t){return xm.requestJson({path:`/location/${encodeURIComponent(e)}`,method:"PUT",body:{partner:t.partner,groupName:t.groupName,locationCode:t.locationCode,locationName:t.locationName,street:t.street,city:t.city,stateCode:t.stateCode,country:t.country,zipCode:t.zipCode,phone:t.phone,email:t.email,latitude:t.latitude,longitude:t.longitude,state:t.state??!0}})}async function Iue(e){await xm.requestJson({path:`/location/${encodeURIComponent(e)}`,method:"DELETE"})}function _n(e){const t=(e??"").trim();return t||"N/A"}function Due(e,t){return e==null||t===null||t===void 0||!Number.isFinite(e)||!Number.isFinite(t)?"N/A":`${e}, ${t}`}function Lue(){const[e,t]=_.useState(!1),[r,n]=_.useState(!1),[i,o]=_.useState(!1),[s,u]=_.useState(null),[f,l]=_.useState(null),[d,p]=_.useState([]),[m,g]=_.useState(!1),[b,y]=_.useState(0),[w,j]=_.useState(0),[O,E]=_.useState(null),[N,A]=_.useState(""),[C,T]=_.useState("all"),[R,I]=_.useState("all"),[z,$]=_.useState("all"),[L,U]=_.useState(1),[W,V]=_.useState(10),G=_.useRef(null),Y=_.useRef(null),[D,Q]=_.useState("");_.useEffect(()=>(Y.current&&window.clearTimeout(Y.current),Y.current=window.setTimeout(()=>Q(N.trim()),300),()=>{Y.current&&window.clearTimeout(Y.current)}),[N]);const J=_.useMemo(()=>{const X=new Set;for(const ue of d){const ie=(ue.partner??"").trim();ie&&X.add(ie)}return["all",...Array.from(X).sort((ue,ie)=>ue.localeCompare(ie))]},[d]),M=_.useMemo(()=>{const X=new Set;for(const ue of d){const ie=(ue.groupName??"").trim();ie&&X.add(ie)}return["all",...Array.from(X).sort((ue,ie)=>ue.localeCompare(ie))]},[d]),B=_.useMemo(()=>{const X=new Set;for(const ue of d){const ie=(ue.locationCode??"").trim();ie&&X.add(ie)}return["all",...Array.from(X).sort((ue,ie)=>ue.localeCompare(ie))]},[d]),Z=Math.max(1,Math.ceil(b/W));_.useEffect(()=>{U(1)},[D,C,R,z,W]),_.useEffect(()=>((async()=>{G.current?.abort();const ue=new AbortController;G.current=ue,g(!0);try{const ie=Math.max(1,L),ye=await kue({skipCount:ie,maxResultCount:W,keyword:(z!=="all"?z:D)||void 0,partner:C!=="all"?C:void 0,groupName:R!=="all"?R:void 0},ue.signal);p(ye.items??[]),y(ye.totalCount??0)}catch(ie){if(ie?.name==="AbortError")return;Jt.error("Failed to load locations.",{description:ie?.message?String(ie.message):"Please try again."}),p([]),y(0)}finally{g(!1)}})(),()=>G.current?.abort()),[D,C,R,z,L,W,w]);const te=()=>j(X=>X+1),ve=X=>{E(null),u(X),n(!0)},xe=X=>{E(null),l(X),o(!0)};return h.jsxs("div",{className:"h-full flex flex-col",children:[h.jsx("div",{className:"pb-4",children:h.jsx("div",{className:"flex flex-col gap-4",children:h.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[h.jsx(be,{placeholder:"Search",value:N,onChange:X=>A(X.target.value),style:{height:40,boxSizing:"border-box"},className:"border border-gray-300 rounded-md w-40 shrink-0 bg-white placeholder:text-gray-500"}),h.jsxs(Ze,{value:C,onValueChange:T,children:[h.jsx(et,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Partner"})}),h.jsx(nt,{children:J.map(X=>h.jsx(Ae,{value:X,children:X==="all"?"Partner (All)":X},X))})]}),h.jsxs(Ze,{value:R,onValueChange:I,children:[h.jsx(et,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Group"})}),h.jsx(nt,{children:M.map(X=>h.jsx(Ae,{value:X,children:X==="all"?"Group (All)":X},X))})]}),h.jsxs(Ze,{value:z,onValueChange:$,children:[h.jsx(et,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Location"})}),h.jsx(nt,{children:B.map(X=>h.jsx(Ae,{value:X,children:X==="all"?"All Locations":X},X))})]}),h.jsx("div",{className:"flex-1"}),h.jsxs(Db,{children:[h.jsx(Lb,{asChild:!0,children:h.jsx("span",{children:h.jsx(we,{disabled:!0,variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Import"})})}),h.jsx($b,{children:"Not supported yet"})]}),h.jsxs(Db,{children:[h.jsx(Lb,{asChild:!0,children:h.jsx("span",{children:h.jsx(we,{disabled:!0,variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Export"})})}),h.jsx($b,{children:"Not supported yet"})]}),h.jsxs(Db,{children:[h.jsx(Lb,{asChild:!0,children:h.jsx("span",{children:h.jsx(we,{disabled:!0,variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Edit"})})}),h.jsx($b,{children:"Not supported yet"})]}),h.jsx(we,{className:"h-10 bg-blue-600 hover:bg-blue-700 text-white rounded-md px-6 font-medium shrink-0",onClick:()=>t(!0),children:"New"})]})})}),h.jsx("div",{className:"flex-1 overflow-auto pt-6",children:h.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-100 hover:bg-gray-100",children:[h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Partner"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Group"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Location ID"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Location Name"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Street"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"City"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"State"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Country"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Zip Code"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Phone"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Email"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"GPS"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Active"}),h.jsx(me,{className:"text-gray-900 font-bold text-center",children:"Actions"})]})}),h.jsx(mr,{children:m?h.jsx(Ke,{children:h.jsx(se,{colSpan:14,className:"text-center text-sm text-gray-500 py-10",children:"Loading..."})}):d.length===0?h.jsx(Ke,{children:h.jsx(se,{colSpan:14,className:"text-center text-sm text-gray-500 py-10",children:"No results."})}):d.map(X=>h.jsxs(Ke,{children:[h.jsx(se,{className:"border-r text-gray-600 max-w-[140px] truncate",children:_n(X.partner)}),h.jsx(se,{className:"border-r text-gray-600 max-w-[140px] truncate",children:_n(X.groupName)}),h.jsx(se,{className:"border-r font-numeric text-gray-600",children:_n(X.locationCode??X.id)}),h.jsx(se,{className:"border-r font-medium text-black",children:_n(X.locationName)}),h.jsx(se,{className:"border-r text-gray-600 max-w-[140px] truncate",children:_n(X.street)}),h.jsx(se,{className:"border-r text-gray-600",children:_n(X.city)}),h.jsx(se,{className:"border-r text-gray-600",children:_n(X.stateCode)}),h.jsx(se,{className:"border-r text-gray-600",children:_n(X.country)}),h.jsx(se,{className:"border-r text-gray-600 font-numeric",children:_n(X.zipCode)}),h.jsx(se,{className:"border-r text-gray-600 whitespace-nowrap",children:_n(X.phone)}),h.jsx(se,{className:"border-r text-gray-600 text-sm max-w-[180px] truncate",children:_n(X.email)}),h.jsx(se,{className:"border-r text-gray-500 font-numeric text-xs",children:Due(X.latitude,X.longitude)}),h.jsx(se,{className:"border-r",children:h.jsx(Cn,{className:X.state?"bg-green-600":"bg-gray-400",children:X.state?"Yes":"No"})}),h.jsx(se,{className:"text-center",children:h.jsxs(Y4,{open:O===X.id,onOpenChange:ue=>E(ue?X.id:null),children:[h.jsx(Q4,{asChild:!0,children:h.jsx(we,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Row actions",children:h.jsx(Aw,{className:"h-4 w-4 text-gray-500"})})}),h.jsxs(Z4,{align:"end",className:"w-40 p-1",children:[h.jsxs(we,{type:"button",variant:"ghost",className:"w-full justify-start gap-2 h-9 px-2 font-normal",onClick:()=>ve(X),children:[h.jsx(ro,{className:"w-4 h-4"}),"Edit"]}),h.jsx(we,{type:"button",variant:"ghost",className:"w-full justify-start h-9 px-2 font-normal text-red-600 hover:text-red-700 hover:bg-red-50",onClick:()=>xe(X),children:"Delete"})]})]})})]},X.id))})]})})}),h.jsx("div",{className:"pt-4",children:h.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[h.jsxs("div",{children:["Showing ",b===0?0:(L-1)*W+1,"-",Math.min(L*W,b)," of ",b]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs(Ze,{value:String(W),onValueChange:X=>V(Number(X)),children:[h.jsx(et,{className:"w-[110px] h-9 rounded-md border border-gray-300 bg-white text-gray-900",children:h.jsx(Je,{})}),h.jsx(nt,{children:[10,20,50].map(X=>h.jsxs(Ae,{value:String(X),children:[X," / page"]},X))})]}),h.jsx(J4,{className:"mx-0 w-auto justify-end",children:h.jsxs(e5,{children:[h.jsx(cs,{children:h.jsx(t5,{href:"#",size:"default",onClick:X=>{X.preventDefault(),U(ue=>Math.max(1,ue-1))},"aria-disabled":L<=1,className:L<=1?"pointer-events-none opacity-50":""})}),h.jsx(cs,{children:h.jsxs(ym,{href:"#",isActive:!0,size:"default",onClick:X=>X.preventDefault(),children:["Page ",L," / ",Z]})}),h.jsx(cs,{children:h.jsx(r5,{href:"#",size:"default",onClick:X=>{X.preventDefault(),U(ue=>Math.min(Z,ue+1))},"aria-disabled":L>=Z,className:L>=Z?"pointer-events-none opacity-50":""})})]})})]})]})}),h.jsx($ue,{open:e,onOpenChange:t,onCreated:()=>{U(1),te()}}),h.jsx(Fue,{open:r,location:s,onOpenChange:X=>{n(X),X||u(null)},onUpdated:()=>{te()}}),h.jsx(zue,{open:i,location:f,onOpenChange:X=>{o(X),X||l(null)},onDeleted:()=>{te()}})]})}function $ue({open:e,onOpenChange:t,onCreated:r}){const[n,i]=_.useState(!1),[o,s]=_.useState({partner:"",groupName:"",locationCode:"",locationName:"",street:"",city:"",stateCode:"",country:"",zipCode:"",phone:"",email:"",latitude:null,longitude:null,state:!0}),u=()=>{s({partner:"",groupName:"",locationCode:"",locationName:"",street:"",city:"",stateCode:"",country:"",zipCode:"",phone:"",email:"",latitude:null,longitude:null,state:!0})};_.useEffect(()=>{e||(u(),i(!1))},[e]);const f=_.useMemo(()=>o.locationCode.trim().length>0&&o.locationName.trim().length>0,[o.locationCode,o.locationName]),l=async()=>{if(!f){Jt.error("Please fill in required fields.",{description:"Location ID and Location Name are required."});return}i(!0);try{await Rue({...o,locationCode:o.locationCode.trim(),locationName:o.locationName.trim(),partner:o.partner?.trim()?o.partner.trim():null,groupName:o.groupName?.trim()?o.groupName.trim():null,street:o.street?.trim()?o.street.trim():null,city:o.city?.trim()?o.city.trim():null,stateCode:o.stateCode?.trim()?o.stateCode.trim():null,country:o.country?.trim()?o.country.trim():null,zipCode:o.zipCode?.trim()?o.zipCode.trim():null,phone:o.phone?.trim()?o.phone.trim():null,email:o.email?.trim()?o.email.trim():null}),Jt.success("Location created.",{description:"The location has been added successfully."}),t(!1),r()}catch(d){Jt.error("Failed to create location.",{description:d?.message?String(d.message):"Please try again."})}finally{i(!1)}};return h.jsx(un,{open:e,onOpenChange:t,children:h.jsxs(fn,{className:"sm:max-w-[600px]",children:[h.jsxs(dn,{children:[h.jsx(hn,{children:"Add New Location"}),h.jsx(ki,{children:"Enter the details for the new store location."})]}),h.jsxs("div",{className:"grid gap-4 py-4",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Partner"}),h.jsx(be,{placeholder:"e.g. Global Foods Inc.",value:o.partner??"",onChange:d=>s(p=>({...p,partner:d.target.value}))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Group"}),h.jsx(be,{placeholder:"e.g. East Coast Region",value:o.groupName??"",onChange:d=>s(p=>({...p,groupName:d.target.value}))})]})]}),h.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[h.jsxs("div",{className:"space-y-2 col-span-1",children:[h.jsx(he,{children:"Location ID"}),h.jsx(be,{placeholder:"e.g. 12345",value:o.locationCode,onChange:d=>s(p=>({...p,locationCode:d.target.value}))})]}),h.jsxs("div",{className:"space-y-2 col-span-2",children:[h.jsx(he,{children:"Location Name"}),h.jsx(be,{placeholder:"e.g. Downtown Store",value:o.locationName,onChange:d=>s(p=>({...p,locationName:d.target.value}))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Street"}),h.jsx(be,{placeholder:"e.g. 123 Main St",value:o.street??"",onChange:d=>s(p=>({...p,street:d.target.value}))})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"City"}),h.jsx(be,{placeholder:"e.g. New York",value:o.city??"",onChange:d=>s(p=>({...p,city:d.target.value}))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"State"}),h.jsx(be,{placeholder:"e.g. NY",value:o.stateCode??"",onChange:d=>s(p=>({...p,stateCode:d.target.value}))})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Country"}),h.jsx(be,{placeholder:"e.g. USA",value:o.country??"",onChange:d=>s(p=>({...p,country:d.target.value}))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Zip Code"}),h.jsx(be,{placeholder:"e.g. 10001",value:o.zipCode??"",onChange:d=>s(p=>({...p,zipCode:d.target.value}))})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Phone Number"}),h.jsx(be,{placeholder:"+1 (555) 000-0000",value:o.phone??"",onChange:d=>s(p=>({...p,phone:d.target.value}))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Email"}),h.jsx(be,{placeholder:"store@example.com",value:o.email??"",onChange:d=>s(p=>({...p,email:d.target.value}))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs(he,{className:"flex items-center gap-2",children:[h.jsx(Fs,{className:"w-4 h-4"})," GPS Coordinates"]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsx(be,{placeholder:"Latitude (e.g. 40.7128)",value:o.latitude===null||o.latitude===void 0?"":String(o.latitude),onChange:d=>{const p=d.target.value.trim();s(m=>({...m,latitude:p?Number(p):null}))}}),h.jsx(be,{placeholder:"Longitude (e.g. -74.0060)",value:o.longitude===null||o.longitude===void 0?"":String(o.longitude),onChange:d=>{const p=d.target.value.trim();s(m=>({...m,longitude:p?Number(p):null}))}})]})]}),h.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[h.jsx(kn,{id:"loc-status",checked:!!o.state,onCheckedChange:d=>s(p=>({...p,state:d}))}),h.jsx(he,{htmlFor:"loc-status",children:"Active Location"})]})]}),h.jsxs($n,{children:[h.jsx(we,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(we,{disabled:n,onClick:l,className:"bg-blue-600 text-white hover:bg-blue-700",children:n?"Creating...":"Create Location"})]})]})})}function Bue(e){return{partner:e.partner??"",groupName:e.groupName??"",locationCode:e.locationCode??"",locationName:e.locationName??"",street:e.street??"",city:e.city??"",stateCode:e.stateCode??"",country:e.country??"",zipCode:e.zipCode??"",phone:e.phone??"",email:e.email??"",latitude:e.latitude??null,longitude:e.longitude??null,state:!!e.state}}function Fue({open:e,location:t,onOpenChange:r,onUpdated:n}){const[i,o]=_.useState(!1),[s,u]=_.useState({partner:"",groupName:"",locationCode:"",locationName:"",street:"",city:"",stateCode:"",country:"",zipCode:"",phone:"",email:"",latitude:null,longitude:null,state:!0});_.useEffect(()=>{e&&t&&(u(Bue(t)),o(!1)),e||o(!1)},[e,t]);const f=_.useMemo(()=>s.locationCode.trim().length>0&&s.locationName.trim().length>0,[s.locationCode,s.locationName]),l=async()=>{if(t?.id){if(!f){Jt.error("Please fill in required fields.",{description:"Location ID and Location Name are required."});return}o(!0);try{await Mue(t.id,{...s,locationCode:s.locationCode.trim(),locationName:s.locationName.trim(),partner:s.partner?.trim()?s.partner.trim():null,groupName:s.groupName?.trim()?s.groupName.trim():null,street:s.street?.trim()?s.street.trim():null,city:s.city?.trim()?s.city.trim():null,stateCode:s.stateCode?.trim()?s.stateCode.trim():null,country:s.country?.trim()?s.country.trim():null,zipCode:s.zipCode?.trim()?s.zipCode.trim():null,phone:s.phone?.trim()?s.phone.trim():null,email:s.email?.trim()?s.email.trim():null}),Jt.success("Location updated.",{description:"The changes have been saved successfully."}),r(!1),n()}catch(d){Jt.error("Failed to update location.",{description:d?.message?String(d.message):"Please try again."})}finally{o(!1)}}};return h.jsx(un,{open:e,onOpenChange:r,children:h.jsxs(fn,{className:"sm:max-w-[600px]",children:[h.jsxs(dn,{children:[h.jsx(hn,{children:"Edit Location"}),h.jsx(ki,{children:"Update the details for this store location."})]}),h.jsxs("div",{className:"grid gap-4 py-4",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Partner"}),h.jsx(be,{placeholder:"e.g. Global Foods Inc.",value:s.partner??"",onChange:d=>u(p=>({...p,partner:d.target.value}))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Group"}),h.jsx(be,{placeholder:"e.g. East Coast Region",value:s.groupName??"",onChange:d=>u(p=>({...p,groupName:d.target.value}))})]})]}),h.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[h.jsxs("div",{className:"space-y-2 col-span-1",children:[h.jsx(he,{children:"Location ID"}),h.jsx(be,{placeholder:"e.g. 12345",value:s.locationCode,onChange:d=>u(p=>({...p,locationCode:d.target.value}))})]}),h.jsxs("div",{className:"space-y-2 col-span-2",children:[h.jsx(he,{children:"Location Name"}),h.jsx(be,{placeholder:"e.g. Downtown Store",value:s.locationName,onChange:d=>u(p=>({...p,locationName:d.target.value}))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Street"}),h.jsx(be,{placeholder:"e.g. 123 Main St",value:s.street??"",onChange:d=>u(p=>({...p,street:d.target.value}))})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"City"}),h.jsx(be,{placeholder:"e.g. New York",value:s.city??"",onChange:d=>u(p=>({...p,city:d.target.value}))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"State"}),h.jsx(be,{placeholder:"e.g. NY",value:s.stateCode??"",onChange:d=>u(p=>({...p,stateCode:d.target.value}))})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Country"}),h.jsx(be,{placeholder:"e.g. USA",value:s.country??"",onChange:d=>u(p=>({...p,country:d.target.value}))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Zip Code"}),h.jsx(be,{placeholder:"e.g. 10001",value:s.zipCode??"",onChange:d=>u(p=>({...p,zipCode:d.target.value}))})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Phone Number"}),h.jsx(be,{placeholder:"+1 (555) 000-0000",value:s.phone??"",onChange:d=>u(p=>({...p,phone:d.target.value}))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Email"}),h.jsx(be,{placeholder:"store@example.com",value:s.email??"",onChange:d=>u(p=>({...p,email:d.target.value}))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs(he,{className:"flex items-center gap-2",children:[h.jsx(Fs,{className:"w-4 h-4"})," GPS Coordinates"]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsx(be,{placeholder:"Latitude (e.g. 40.7128)",value:s.latitude===null||s.latitude===void 0?"":String(s.latitude),onChange:d=>{const p=d.target.value.trim();u(m=>({...m,latitude:p?Number(p):null}))}}),h.jsx(be,{placeholder:"Longitude (e.g. -74.0060)",value:s.longitude===null||s.longitude===void 0?"":String(s.longitude),onChange:d=>{const p=d.target.value.trim();u(m=>({...m,longitude:p?Number(p):null}))}})]})]}),h.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[h.jsx(kn,{id:"loc-status-edit",checked:!!s.state,onCheckedChange:d=>u(p=>({...p,state:d}))}),h.jsx(he,{htmlFor:"loc-status-edit",children:"Active Location"})]})]}),h.jsxs($n,{children:[h.jsx(we,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),h.jsx(we,{disabled:i,onClick:l,className:"bg-blue-600 text-white hover:bg-blue-700",children:i?"Saving...":"Save Changes"})]})]})})}function zue({open:e,location:t,onOpenChange:r,onDeleted:n}){const[i,o]=_.useState(!1),s=_.useMemo(()=>{const f=(t?.locationCode??"").trim(),l=(t?.locationName??"").trim();return f&&l?`${f} - ${l}`:f||l||"this location"},[t?.locationCode,t?.locationName]),u=async()=>{if(t?.id){o(!0);try{await Iue(t.id),Jt.success("Location deleted.",{description:"The location has been removed successfully."}),r(!1),n()}catch(f){Jt.error("Failed to delete location.",{description:f?.message?String(f.message):"Please try again."})}finally{o(!1)}}};return h.jsx(un,{open:e,onOpenChange:r,children:h.jsxs(fn,{className:"sm:max-w-none",style:{width:"30%"},children:[h.jsxs(dn,{children:[h.jsx(hn,{children:"Delete Location"}),h.jsx(ki,{children:"This action cannot be undone."})]}),h.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",h.jsx("span",{className:"font-medium",children:s}),"?"]}),h.jsxs($n,{className:"flex-row flex-wrap justify-end",children:[h.jsx(we,{className:"min-w-24",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),h.jsx(we,{className:"min-w-24",variant:"destructive",disabled:i,onClick:u,children:i?"Deleting...":"Delete"})]})]})})}function que({className:e,...t}){return h.jsx("textarea",{"data-slot":"textarea",className:Te("resize-none border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-input-background px-3 py-2 text-base transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}const bm=n5({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),wm="/rbac-menu";async function Uue(e,t){return bm.requestJson({path:wm,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,Keyword:e.keyword}})}async function Wue(e){return bm.requestJson({path:wm,method:"POST",body:e})}async function Hue(e,t){return bm.requestJson({path:`${wm}/${encodeURIComponent(e)}`,method:"PUT",body:t})}async function Vue(e){e.length&&await bm.requestJson({path:wm,method:"DELETE",body:e})}async function Gue(e){await Vue([e])}const HR={Settings:Vd,LayoutDashboard:eM,Tag:Gd,MapPin:Fs,Users:Nw,Package:Hd,FileText:us,HelpCircle:Wd,Layers:JR,Type:up,FileBox:ZR};function Bb(e){const t=(e??"").trim();return t||"N/A"}function Kue(e){const t=e.trim();if(!t)return null;const r=Number.parseInt(t,10);return Number.isFinite(r)?r:null}function Xue(){const[e,t]=_.useState([]),[r,n]=_.useState(!1),[i,o]=_.useState(0),[s,u]=_.useState(0),[f,l]=_.useState(null),[d,p]=_.useState(""),m=_.useRef(null),[g,b]=_.useState(""),[y,w]=_.useState(1),[j,O]=_.useState(10),E=Math.max(1,Math.ceil(i/j)),[N,A]=_.useState(!1),[C,T]=_.useState(!1),[R,I]=_.useState(!1),[z,$]=_.useState(null),[L,U]=_.useState(null),W=_.useRef(null);_.useEffect(()=>(m.current&&window.clearTimeout(m.current),m.current=window.setTimeout(()=>b(d.trim()),300),()=>{m.current&&window.clearTimeout(m.current)}),[d]),_.useEffect(()=>w(1),[g,j]),_.useEffect(()=>((async()=>{W.current?.abort();const Q=new AbortController;W.current=Q,n(!0);try{const J=Math.max(1,y),M=await Uue({skipCount:J,maxResultCount:j,keyword:g||void 0},Q.signal);t(M.items??[]),o(M.totalCount??0)}catch(J){if(J?.name==="AbortError")return;Jt.error("Failed to load system menus.",{description:J?.message?String(J.message):"Please try again."}),t([]),o(0)}finally{n(!1)}})(),()=>W.current?.abort()),[g,y,j,s]);const V=()=>u(D=>D+1),G=D=>{l(null),$(D),T(!0)},Y=D=>{l(null),U(D),I(!0)};return h.jsxs("div",{className:"h-full flex flex-col",children:[h.jsx("div",{className:"pb-4",children:h.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[h.jsx(be,{placeholder:"Search",value:d,onChange:D=>p(D.target.value),style:{height:40,boxSizing:"border-box"},className:"border border-gray-300 rounded-md w-40 shrink-0 bg-white placeholder:text-gray-500"}),h.jsx("div",{className:"flex-1"}),h.jsxs(we,{className:"bg-blue-600 text-white hover:bg-blue-700",onClick:()=>A(!0),children:[h.jsx(jr,{className:"w-4 h-4 mr-2"}),"New Menu"]})]})}),h.jsxs("div",{className:"flex-1 flex flex-col min-h-0 bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden",children:[h.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:h.jsxs(hr,{children:[h.jsx(pr,{className:"bg-gray-50 sticky top-0 z-10",children:h.jsxs(Ke,{className:"hover:bg-gray-50",children:[h.jsx(me,{className:"font-semibold text-gray-900",children:"Menu Name"}),h.jsx(me,{className:"font-semibold text-gray-900",children:"Route URL"}),h.jsx(me,{className:"font-semibold text-gray-900",children:"Router Name"}),h.jsx(me,{className:"font-semibold text-gray-900",children:"Type"}),h.jsx(me,{className:"font-semibold text-gray-900",children:"Order"}),h.jsx(me,{className:"font-semibold text-gray-900",children:"Visible"}),h.jsx(me,{className:"font-semibold text-gray-900",children:"Enabled"}),h.jsx(me,{className:"font-semibold text-gray-900 w-16 text-right",children:"Actions"})]})}),h.jsx(mr,{children:e.length===0?h.jsx(Ke,{children:h.jsx(se,{colSpan:8,className:"text-center py-10 text-gray-500",children:r?"Loading...":"No data"})}):e.map(D=>h.jsxs(Ke,{className:"hover:bg-gray-50",children:[h.jsx(se,{className:"font-medium text-gray-900",children:Bb(D.menuName)}),h.jsx(se,{className:"text-gray-700",children:Bb(D.routeUrl)}),h.jsx(se,{className:"text-gray-700",children:Bb(D.routerName)}),h.jsx(se,{className:"text-gray-700",children:D.menuType??"N/A"}),h.jsx(se,{className:"text-gray-700",children:D.orderNum??"N/A"}),h.jsx(se,{className:"text-gray-700",children:D.isShow?"Yes":"No"}),h.jsx(se,{className:"text-gray-700",children:D.state?"Yes":"No"}),h.jsx(se,{className:"text-right",children:h.jsxs(Y4,{open:f===D.id,onOpenChange:Q=>l(Q?D.id:null),children:[h.jsx(Q4,{asChild:!0,children:h.jsx(we,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Row actions",children:h.jsx(Aw,{className:"h-4 w-4"})})}),h.jsx(Z4,{className:"w-44 p-2",align:"end",children:h.jsxs("div",{className:"flex flex-col",children:[h.jsxs(we,{variant:"ghost",className:"justify-start",onClick:()=>G(D),children:[h.jsx(ro,{className:"w-4 h-4 mr-2"}),"Edit"]}),h.jsxs(we,{variant:"ghost",className:"justify-start text-red-600 hover:text-red-700",onClick:()=>Y(D),children:[h.jsx(Fb,{className:"w-4 h-4 mr-2"}),"Delete"]})]})})]})})]},D.id))})]})}),h.jsxs("div",{className:"shrink-0 px-4 py-3 border-t border-gray-200 bg-white flex flex-wrap items-center justify-between gap-3",children:[h.jsxs("div",{className:"text-sm text-gray-600",children:["Showing ",i===0?0:(y-1)*j+1,"-",Math.min(y*j,i)," of"," ",i]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs(Ze,{value:String(j),onValueChange:D=>O(Number(D)),children:[h.jsx(et,{className:"w-[110px] h-9 rounded-md border border-gray-300 bg-white text-gray-900",children:h.jsx(Je,{})}),h.jsx(nt,{children:[10,20,50].map(D=>h.jsxs(Ae,{value:String(D),children:[D," / page"]},D))})]}),h.jsx(J4,{className:"mx-0 w-auto justify-end",children:h.jsxs(e5,{children:[h.jsx(cs,{children:h.jsx(t5,{href:"#",size:"default",onClick:D=>{D.preventDefault(),w(Q=>Math.max(1,Q-1))},"aria-disabled":y<=1,className:y<=1?"pointer-events-none opacity-50":""})}),h.jsx(cs,{children:h.jsxs(ym,{href:"#",isActive:!0,size:"default",onClick:D=>D.preventDefault(),children:["Page ",y," / ",E]})}),h.jsx(cs,{children:h.jsx(r5,{href:"#",size:"default",onClick:D=>{D.preventDefault(),w(Q=>Math.min(E,Q+1))},"aria-disabled":y>=E,className:y>=E?"pointer-events-none opacity-50":""})})]})})]})]})]}),h.jsx(VR,{mode:"create",open:N,menu:null,onOpenChange:A,onSaved:V}),h.jsx(VR,{mode:"edit",open:C,menu:z,onOpenChange:T,onSaved:V}),h.jsx(Yue,{open:R,menu:L,onOpenChange:I,onDeleted:V})]})}function VR({mode:e,open:t,menu:r,onOpenChange:n,onSaved:i}){const o=e==="edit",[s,u]=_.useState(!1),[f,l]=_.useState(""),[d,p]=_.useState(""),[m,g]=_.useState(""),[b,y]=_.useState("menu"),[w,j]=_.useState(""),[O,E]=_.useState(""),[N,A]=_.useState(""),[C,T]=_.useState(""),[R,I]=_.useState(""),[z,$]=_.useState(""),[L,U]=_.useState(""),[W,V]=_.useState(""),[G,Y]=_.useState(!1),[D,Q]=_.useState(!0),[J,M]=_.useState(!0);_.useEffect(()=>{t&&(u(!1),l(r?.menuName??""),p(r?.routerName??""),g(r?.routeUrl??""),y(r?.menuType===0?"directory":"menu"),j(r?.permissionCode??""),E(r?.parentId??""),A(r?.menuIcon??""),T(r?.orderNum===null||r?.orderNum===void 0?"":String(r.orderNum)),I(r?.link??""),$(r?.component??""),U(r?.query??""),V(r?.remark??""),Y(!!r?.isCache),Q(r?.isShow??!0),M(r?.state??!0))},[t,r]);const B=_.useMemo(()=>!!(f.trim()&&m.trim()),[f,m]),Z=async()=>{if(!B){Jt.error("Please fill in required fields.",{description:"Menu Name and Route URL are required."});return}u(!0);try{const te={menuName:f.trim(),routerName:d.trim()?d.trim():null,routeUrl:m.trim(),menuType:b==="directory"?0:1,permissionCode:w.trim()?w.trim():null,parentId:O.trim()?O.trim():null,menuIcon:N||null,orderNum:Kue(C),link:R.trim()?R.trim():null,component:z.trim()?z.trim():null,query:L.trim()?L.trim():null,remark:W.trim()?W.trim():null,isCache:G,isShow:D,state:J};if(o){if(!r?.id)throw new Error("Missing id.");await Hue(r.id,te),Jt.success("Menu updated.",{description:"Changes have been saved successfully."})}else await Wue(te),Jt.success("Menu created.",{description:"A new menu has been created successfully."});n(!1),i()}catch(te){Jt.error(o?"Failed to update menu.":"Failed to create menu.",{description:te?.message?String(te.message):"Please try again."})}finally{u(!1)}};return h.jsx(un,{open:t,onOpenChange:n,children:h.jsxs(fn,{className:"sm:max-w-none",style:{width:"70%"},children:[h.jsxs(dn,{children:[h.jsx(hn,{children:o?"Edit System Menu":"New System Menu"}),h.jsx(ki,{children:o?"Update system menu fields and save changes.":"Fill out the form to create a new system menu."})]}),h.jsxs("div",{className:"grid grid-cols-3 gap-6 py-2",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Menu Name *"}),h.jsx(be,{value:f,onChange:te=>l(te.target.value),placeholder:"e.g. Location Manager"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Route URL *"}),h.jsx(be,{value:m,onChange:te=>g(te.target.value),placeholder:"e.g. /location"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Router Name"}),h.jsx(be,{value:d,onChange:te=>p(te.target.value),placeholder:"e.g. location"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Menu Type"}),h.jsxs(Ze,{value:b,onValueChange:te=>y(te),children:[h.jsx(et,{className:"h-10 rounded-md border border-gray-200 bg-white",children:h.jsx(Je,{})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"directory",children:"Directory"}),h.jsx(Ae,{value:"menu",children:"Menu"})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Permission Code"}),h.jsx(be,{value:w,onChange:te=>j(te.target.value),placeholder:"e.g. sys:menu"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Parent ID"}),h.jsx(be,{value:O,onChange:te=>E(te.target.value),placeholder:"Optional"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Menu Icon"}),h.jsxs(Ze,{value:N||"none",onValueChange:te=>A(te==="none"?"":te),children:[h.jsx(et,{className:"h-10 rounded-md border border-gray-200 bg-white",children:h.jsx(Je,{placeholder:"Select an icon"})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"none",children:"None"}),Object.keys(HR).map(te=>{const ve=HR[te];return h.jsx(Ae,{value:te,children:h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(ve,{className:"h-4 w-4"}),te]})},te)})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Order"}),h.jsx(be,{value:C,onChange:te=>T(te.target.value),placeholder:"e.g. 10"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Link"}),h.jsx(be,{value:R,onChange:te=>I(te.target.value),placeholder:"Optional"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Component"}),h.jsx(be,{value:z,onChange:te=>$(te.target.value),placeholder:"Optional"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Query"}),h.jsx(be,{value:L,onChange:te=>U(te.target.value),placeholder:"Optional"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Remark"}),h.jsx(que,{value:W,onChange:te=>V(te.target.value),placeholder:"Optional"})]}),h.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[h.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Cache"}),h.jsx(kn,{checked:G,onCheckedChange:Y})]}),h.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[h.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Visible"}),h.jsx(kn,{checked:D,onCheckedChange:Q})]}),h.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[h.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),h.jsx(kn,{checked:J,onCheckedChange:M})]})]}),h.jsxs($n,{className:"flex-row flex-wrap justify-end",children:[h.jsx(we,{className:"min-w-24",variant:"outline",onClick:()=>n(!1),children:"Cancel"}),h.jsx(we,{className:"min-w-24 bg-blue-600 text-white hover:bg-blue-700",disabled:s,onClick:Z,children:s?"Saving...":o?"Save Changes":"Create"})]})]})})}function Yue({open:e,menu:t,onOpenChange:r,onDeleted:n}){const[i,o]=_.useState(!1),s=_.useMemo(()=>{const f=(t?.menuName??"").trim(),l=(t?.routeUrl??"").trim();return f&&l?`${f} (${l})`:f||l||"this menu"},[t?.menuName,t?.routeUrl]),u=async()=>{if(t?.id){o(!0);try{await Gue(t.id),Jt.success("Menu deleted.",{description:"The menu has been removed successfully."}),r(!1),n()}catch(f){Jt.error("Failed to delete menu.",{description:f?.message?String(f.message):"Please try again."})}finally{o(!1)}}};return h.jsx(un,{open:e,onOpenChange:r,children:h.jsxs(fn,{className:"sm:max-w-none",style:{width:"30%"},children:[h.jsxs(dn,{children:[h.jsx(hn,{children:"Delete System Menu"}),h.jsx(ki,{children:"This action cannot be undone."})]}),h.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",h.jsx("span",{className:"font-medium",children:s}),"?"]}),h.jsxs($n,{className:"flex-row flex-wrap justify-end",children:[h.jsx(we,{className:"min-w-24",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),h.jsx(we,{className:"min-w-24",variant:"destructive",disabled:i,onClick:u,children:i?"Deleting...":"Delete"})]})]})})}function Que(){const[e,t]=_.useState("Dashboard"),r=()=>{switch(e){case"Dashboard":return h.jsx(gne,{});case"Training":return h.jsx(zle,{});case"Alerts":return h.jsx(Wle,{});case"Menu Management":return h.jsx(fce,{});case"System Menu":return h.jsx(Xue,{});case"Account Management":return h.jsx(Sce,{});case"Reports":return h.jsx(Lce,{});case"Location Manager":return h.jsx(Lue,{});case"Labels":case"Label Categories":case"Label Types":case"Label Templates":case"Multiple Options":return h.jsx(Fle,{currentView:e,onViewChange:t});default:return h.jsx(yne,{title:e})}};return h.jsx(Nz,{currentView:e,setCurrentView:t,children:r()})}l8.createRoot(document.getElementById("root")).render(h.jsx(Que,{})); diff --git a/美国版/Food Labeling Management Platform/build/assets/index-ChMXTsCq.js b/美国版/Food Labeling Management Platform/build/assets/index-ChMXTsCq.js deleted file mode 100644 index ad7e990..0000000 --- a/美国版/Food Labeling Management Platform/build/assets/index-ChMXTsCq.js +++ /dev/null @@ -1,463 +0,0 @@ -function U5(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var bf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function it(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $v={exports:{}},kl={},Bv={exports:{}},Ve={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var gj;function W5(){if(gj)return Ve;gj=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.iterator;function m(M){return M===null||typeof M!="object"?null:(M=h&&M[h]||M["@@iterator"],typeof M=="function"?M:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,y={};function w(M,$,Q){this.props=M,this.context=$,this.refs=y,this.updater=Q||g}w.prototype.isReactComponent={},w.prototype.setState=function(M,$){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,$,"setState")},w.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function S(){}S.prototype=w.prototype;function O(M,$,Q){this.props=M,this.context=$,this.refs=y,this.updater=Q||g}var E=O.prototype=new S;E.constructor=O,b(E,w.prototype),E.isPureReactComponent=!0;var C=Array.isArray,A=Object.prototype.hasOwnProperty,N={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function R(M,$,Q){var ae,pe={},ye=null,oe=null;if($!=null)for(ae in $.ref!==void 0&&(oe=$.ref),$.key!==void 0&&(ye=""+$.key),$)A.call($,ae)&&!T.hasOwnProperty(ae)&&(pe[ae]=$[ae]);var me=arguments.length-2;if(me===1)pe.children=Q;else if(1>>1,$=B[M];if(0>>1;Mi(pe,ee))ye<$&&0>i(oe,pe)?(B[M]=oe,B[ye]=ee,M=ye):(B[M]=pe,B[ae]=ee,M=ae);else if(ye<$&&0>i(oe,ee))B[M]=oe,B[ye]=ee,M=ye;else break e}}return Z}function i(B,Z){var ee=B.sortIndex-Z.sortIndex;return ee!==0?ee:B.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var s=Date,u=s.now();e.unstable_now=function(){return s.now()-u}}var f=[],c=[],d=1,h=null,m=3,g=!1,b=!1,y=!1,w=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(B){for(var Z=r(c);Z!==null;){if(Z.callback===null)n(c);else if(Z.startTime<=B)n(c),Z.sortIndex=Z.expirationTime,t(f,Z);else break;Z=r(c)}}function C(B){if(y=!1,E(B),!b)if(r(f)!==null)b=!0,K(A);else{var Z=r(c);Z!==null&&X(C,Z.startTime-B)}}function A(B,Z){b=!1,y&&(y=!1,S(R),R=-1),g=!0;var ee=m;try{for(E(Z),h=r(f);h!==null&&(!(h.expirationTime>Z)||B&&!L());){var M=h.callback;if(typeof M=="function"){h.callback=null,m=h.priorityLevel;var $=M(h.expirationTime<=Z);Z=e.unstable_now(),typeof $=="function"?h.callback=$:h===r(f)&&n(f),E(Z)}else n(f);h=r(f)}if(h!==null)var Q=!0;else{var ae=r(c);ae!==null&&X(C,ae.startTime-Z),Q=!1}return Q}finally{h=null,m=ee,g=!1}}var N=!1,T=null,R=-1,I=5,q=-1;function L(){return!(e.unstable_now()-qB||125M?(B.sortIndex=ee,t(c,B),r(f)===null&&B===r(c)&&(y?(S(R),R=-1):y=!0,X(C,ee-M))):(B.sortIndex=$,t(f,B),b||g||(b=!0,K(A))),B},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(B){var Z=m;return function(){var ee=m;m=Z;try{return B.apply(this,arguments)}finally{m=ee}}}})(qv)),qv}var _j;function K5(){return _j||(_j=1,Fv.exports=G5()),Fv.exports}/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Sj;function X5(){if(Sj)return yr;Sj=1;var e=Vh(),t=K5();function r(o){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+o,v=1;v"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,c=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d={},h={};function m(o){return f.call(h,o)?!0:f.call(d,o)?!1:c.test(o)?h[o]=!0:(d[o]=!0,!1)}function g(o,l,v,x){if(v!==null&&v.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return x?!1:v!==null?!v.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function b(o,l,v,x){if(l===null||typeof l>"u"||g(o,l,v,x))return!0;if(x)return!1;if(v!==null)switch(v.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function y(o,l,v,x,_,j,k){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=x,this.attributeNamespace=_,this.mustUseProperty=v,this.propertyName=o,this.type=l,this.sanitizeURL=j,this.removeEmptyString=k}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){w[o]=new y(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var l=o[0];w[l]=new y(l,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){w[o]=new y(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){w[o]=new y(o,2,!1,o,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(o){w[o]=new y(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){w[o]=new y(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){w[o]=new y(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){w[o]=new y(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){w[o]=new y(o,5,!1,o.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function O(o){return o[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(o){var l=o.replace(S,O);w[l]=new y(l,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var l=o.replace(S,O);w[l]=new y(l,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var l=o.replace(S,O);w[l]=new y(l,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){w[o]=new y(o,1,!1,o.toLowerCase(),null,!1,!1)}),w.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){w[o]=new y(o,1,!1,o.toLowerCase(),null,!0,!0)});function E(o,l,v,x){var _=w.hasOwnProperty(l)?w[l]:null;(_!==null?_.type!==0:x||!(2F||_[k]!==j[F]){var W=` -`+_[k].replace(" at new "," at ");return o.displayName&&W.includes("")&&(W=W.replace("",o.displayName)),W}while(1<=k&&0<=F);break}}}finally{Q=!1,Error.prepareStackTrace=v}return(o=o?o.displayName||o.name:"")?$(o):""}function pe(o){switch(o.tag){case 5:return $(o.type);case 16:return $("Lazy");case 13:return $("Suspense");case 19:return $("SuspenseList");case 0:case 2:case 15:return o=ae(o.type,!1),o;case 11:return o=ae(o.type.render,!1),o;case 1:return o=ae(o.type,!0),o;default:return""}}function ye(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case T:return"Fragment";case N:return"Portal";case I:return"Profiler";case R:return"StrictMode";case U:return"Suspense";case H:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case L:return(o.displayName||"Context")+".Consumer";case q:return(o._context.displayName||"Context")+".Provider";case D:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case V:return l=o.displayName||null,l!==null?l:ye(o.type)||"Memo";case K:l=o._payload,o=o._init;try{return ye(o(l))}catch{}}return null}function oe(o){var l=o.type;switch(o.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=l.render,o=o.displayName||o.name||"",l.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ye(l);case 8:return l===R?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function me(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function ie(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function ue(o){var l=ie(o)?"checked":"value",v=Object.getOwnPropertyDescriptor(o.constructor.prototype,l),x=""+o[l];if(!o.hasOwnProperty(l)&&typeof v<"u"&&typeof v.get=="function"&&typeof v.set=="function"){var _=v.get,j=v.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return _.call(this)},set:function(k){x=""+k,j.call(this,k)}}),Object.defineProperty(o,l,{enumerable:v.enumerable}),{getValue:function(){return x},setValue:function(k){x=""+k},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function ve(o){o._valueTracker||(o._valueTracker=ue(o))}function re(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var v=l.getValue(),x="";return o&&(x=ie(o)?o.checked?"true":"false":o.value),o=x,o!==v?(l.setValue(o),!0):!1}function De(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function Te(o,l){var v=l.checked;return ee({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:v??o._wrapperState.initialChecked})}function Ke(o,l){var v=l.defaultValue==null?"":l.defaultValue,x=l.checked!=null?l.checked:l.defaultChecked;v=me(l.value!=null?l.value:v),o._wrapperState={initialChecked:x,initialValue:v,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function lt(o,l){l=l.checked,l!=null&&E(o,"checked",l,!1)}function vt(o,l){lt(o,l);var v=me(l.value),x=l.type;if(v!=null)x==="number"?(v===0&&o.value===""||o.value!=v)&&(o.value=""+v):o.value!==""+v&&(o.value=""+v);else if(x==="submit"||x==="reset"){o.removeAttribute("value");return}l.hasOwnProperty("value")?Or(o,l.type,v):l.hasOwnProperty("defaultValue")&&Or(o,l.type,me(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(o.defaultChecked=!!l.defaultChecked)}function dr(o,l,v){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var x=l.type;if(!(x!=="submit"&&x!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+o._wrapperState.initialValue,v||l===o.value||(o.value=l),o.defaultValue=l}v=o.name,v!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,v!==""&&(o.name=v)}function Or(o,l,v){(l!=="number"||De(o.ownerDocument)!==o)&&(v==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+v&&(o.defaultValue=""+v))}var jr=Array.isArray;function Kt(o,l,v,x){if(o=o.options,l){l={};for(var _=0;_"+l.valueOf().toString()+"",l=fu.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;l.firstChild;)o.appendChild(l.firstChild)}});function Ks(o,l){if(l){var v=o.firstChild;if(v&&v===o.lastChild&&v.nodeType===3){v.nodeValue=l;return}}o.textContent=l}var Xs={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},G3=["Webkit","ms","Moz","O"];Object.keys(Xs).forEach(function(o){G3.forEach(function(l){l=l+o.charAt(0).toUpperCase()+o.substring(1),Xs[l]=Xs[o]})});function k_(o,l,v){return l==null||typeof l=="boolean"||l===""?"":v||typeof l!="number"||l===0||Xs.hasOwnProperty(o)&&Xs[o]?(""+l).trim():l+"px"}function R_(o,l){o=o.style;for(var v in l)if(l.hasOwnProperty(v)){var x=v.indexOf("--")===0,_=k_(v,l[v],x);v==="float"&&(v="cssFloat"),x?o.setProperty(v,_):o[v]=_}}var K3=ee({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Yp(o,l){if(l){if(K3[o]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(r(137,o));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(r(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(r(61))}if(l.style!=null&&typeof l.style!="object")throw Error(r(62))}}function Qp(o,l){if(o.indexOf("-")===-1)return typeof l.is=="string";switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Zp=null;function Jp(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var em=null,ao=null,oo=null;function M_(o){if(o=gl(o)){if(typeof em!="function")throw Error(r(280));var l=o.stateNode;l&&(l=Mu(l),em(o.stateNode,o.type,l))}}function I_(o){ao?oo?oo.push(o):oo=[o]:ao=o}function D_(){if(ao){var o=ao,l=oo;if(oo=ao=null,M_(o),l)for(o=0;o>>=0,o===0?32:31-(a4(o)/o4|0)|0}var vu=64,gu=4194304;function Js(o){switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function yu(o,l){var v=o.pendingLanes;if(v===0)return 0;var x=0,_=o.suspendedLanes,j=o.pingedLanes,k=v&268435455;if(k!==0){var F=k&~_;F!==0?x=Js(F):(j&=k,j!==0&&(x=Js(j)))}else k=v&~_,k!==0?x=Js(k):j!==0&&(x=Js(j));if(x===0)return 0;if(l!==0&&l!==x&&(l&_)===0&&(_=x&-x,j=l&-l,_>=j||_===16&&(j&4194240)!==0))return l;if((x&4)!==0&&(x|=v&16),l=o.entangledLanes,l!==0)for(o=o.entanglements,l&=x;0v;v++)l.push(o);return l}function el(o,l,v){o.pendingLanes|=l,l!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,l=31-ln(l),o[l]=v}function u4(o,l){var v=o.pendingLanes&~l;o.pendingLanes=l,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=l,o.mutableReadLanes&=l,o.entangledLanes&=l,l=o.entanglements;var x=o.eventTimes;for(o=o.expirationTimes;0=ll),uS=" ",fS=!1;function dS(o,l){switch(o){case"keyup":return $4.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hS(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var co=!1;function z4(o,l){switch(o){case"compositionend":return hS(l);case"keypress":return l.which!==32?null:(fS=!0,uS);case"textInput":return o=l.data,o===uS&&fS?null:o;default:return null}}function F4(o,l){if(co)return o==="compositionend"||!ym&&dS(o,l)?(o=iS(),Su=dm=Ei=null,co=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1=l)return{node:v,offset:l-o};o=x}e:{for(;v;){if(v.nextSibling){v=v.nextSibling;break e}v=v.parentNode}v=void 0}v=bS(v)}}function _S(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?_S(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function SS(){for(var o=window,l=De();l instanceof o.HTMLIFrameElement;){try{var v=typeof l.contentWindow.location.href=="string"}catch{v=!1}if(v)o=l.contentWindow;else break;l=De(o.document)}return l}function wm(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}function Y4(o){var l=SS(),v=o.focusedElem,x=o.selectionRange;if(l!==v&&v&&v.ownerDocument&&_S(v.ownerDocument.documentElement,v)){if(x!==null&&wm(v)){if(l=x.start,o=x.end,o===void 0&&(o=l),"selectionStart"in v)v.selectionStart=l,v.selectionEnd=Math.min(o,v.value.length);else if(o=(l=v.ownerDocument||document)&&l.defaultView||window,o.getSelection){o=o.getSelection();var _=v.textContent.length,j=Math.min(x.start,_);x=x.end===void 0?j:Math.min(x.end,_),!o.extend&&j>x&&(_=x,x=j,j=_),_=wS(v,j);var k=wS(v,x);_&&k&&(o.rangeCount!==1||o.anchorNode!==_.node||o.anchorOffset!==_.offset||o.focusNode!==k.node||o.focusOffset!==k.offset)&&(l=l.createRange(),l.setStart(_.node,_.offset),o.removeAllRanges(),j>x?(o.addRange(l),o.extend(k.node,k.offset)):(l.setEnd(k.node,k.offset),o.addRange(l)))}}for(l=[],o=v;o=o.parentNode;)o.nodeType===1&&l.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v=document.documentMode,uo=null,_m=null,dl=null,Sm=!1;function OS(o,l,v){var x=v.window===v?v.document:v.nodeType===9?v:v.ownerDocument;Sm||uo==null||uo!==De(x)||(x=uo,"selectionStart"in x&&wm(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),dl&&fl(dl,x)||(dl=x,x=Tu(_m,"onSelect"),0vo||(o.current=Im[vo],Im[vo]=null,vo--)}function dt(o,l){vo++,Im[vo]=o.current,o.current=l}var Ci={},Jt=Ni(Ci),hr=Ni(!1),ca=Ci;function go(o,l){var v=o.type.contextTypes;if(!v)return Ci;var x=o.stateNode;if(x&&x.__reactInternalMemoizedUnmaskedChildContext===l)return x.__reactInternalMemoizedMaskedChildContext;var _={},j;for(j in v)_[j]=l[j];return x&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=l,o.__reactInternalMemoizedMaskedChildContext=_),_}function pr(o){return o=o.childContextTypes,o!=null}function Iu(){yt(hr),yt(Jt)}function BS(o,l,v){if(Jt.current!==Ci)throw Error(r(168));dt(Jt,l),dt(hr,v)}function zS(o,l,v){var x=o.stateNode;if(l=l.childContextTypes,typeof x.getChildContext!="function")return v;x=x.getChildContext();for(var _ in x)if(!(_ in l))throw Error(r(108,oe(o)||"Unknown",_));return ee({},v,x)}function Du(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Ci,ca=Jt.current,dt(Jt,o),dt(hr,hr.current),!0}function FS(o,l,v){var x=o.stateNode;if(!x)throw Error(r(169));v?(o=zS(o,l,ca),x.__reactInternalMemoizedMergedChildContext=o,yt(hr),yt(Jt),dt(Jt,o)):yt(hr),dt(hr,v)}var Xn=null,Lu=!1,Dm=!1;function qS(o){Xn===null?Xn=[o]:Xn.push(o)}function l5(o){Lu=!0,qS(o)}function Ti(){if(!Dm&&Xn!==null){Dm=!0;var o=0,l=ct;try{var v=Xn;for(ct=1;o>=k,_-=k,Yn=1<<32-ln(l)+_|v<<_|x,Qn=j+o}else Yn=1<Be?(Wt=Re,Re=null):Wt=Re.sibling;var Ye=se(Y,Re,J[Be],de);if(Ye===null){Re===null&&(Re=Wt);break}o&&Re&&Ye.alternate===null&&l(Y,Re),G=j(Ye,G,Be),ke===null?Pe=Ye:ke.sibling=Ye,ke=Ye,Re=Wt}if(Be===J.length)return v(Y,Re),bt&&fa(Y,Be),Pe;if(Re===null){for(;BeBe?(Wt=Re,Re=null):Wt=Re.sibling;var zi=se(Y,Re,Ye.value,de);if(zi===null){Re===null&&(Re=Wt);break}o&&Re&&zi.alternate===null&&l(Y,Re),G=j(zi,G,Be),ke===null?Pe=zi:ke.sibling=zi,ke=zi,Re=Wt}if(Ye.done)return v(Y,Re),bt&&fa(Y,Be),Pe;if(Re===null){for(;!Ye.done;Be++,Ye=J.next())Ye=ce(Y,Ye.value,de),Ye!==null&&(G=j(Ye,G,Be),ke===null?Pe=Ye:ke.sibling=Ye,ke=Ye);return bt&&fa(Y,Be),Pe}for(Re=x(Y,Re);!Ye.done;Be++,Ye=J.next())Ye=xe(Re,Y,Be,Ye.value,de),Ye!==null&&(o&&Ye.alternate!==null&&Re.delete(Ye.key===null?Be:Ye.key),G=j(Ye,G,Be),ke===null?Pe=Ye:ke.sibling=Ye,ke=Ye);return o&&Re.forEach(function(q5){return l(Y,q5)}),bt&&fa(Y,Be),Pe}function Nt(Y,G,J,de){if(typeof J=="object"&&J!==null&&J.type===T&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case A:e:{for(var Pe=J.key,ke=G;ke!==null;){if(ke.key===Pe){if(Pe=J.type,Pe===T){if(ke.tag===7){v(Y,ke.sibling),G=_(ke,J.props.children),G.return=Y,Y=G;break e}}else if(ke.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===K&&KS(Pe)===ke.type){v(Y,ke.sibling),G=_(ke,J.props),G.ref=yl(Y,ke,J),G.return=Y,Y=G;break e}v(Y,ke);break}else l(Y,ke);ke=ke.sibling}J.type===T?(G=xa(J.props.children,Y.mode,de,J.key),G.return=Y,Y=G):(de=df(J.type,J.key,J.props,null,Y.mode,de),de.ref=yl(Y,G,J),de.return=Y,Y=de)}return k(Y);case N:e:{for(ke=J.key;G!==null;){if(G.key===ke)if(G.tag===4&&G.stateNode.containerInfo===J.containerInfo&&G.stateNode.implementation===J.implementation){v(Y,G.sibling),G=_(G,J.children||[]),G.return=Y,Y=G;break e}else{v(Y,G);break}else l(Y,G);G=G.sibling}G=Rv(J,Y.mode,de),G.return=Y,Y=G}return k(Y);case K:return ke=J._init,Nt(Y,G,ke(J._payload),de)}if(jr(J))return Se(Y,G,J,de);if(Z(J))return Ee(Y,G,J,de);Fu(Y,J)}return typeof J=="string"&&J!==""||typeof J=="number"?(J=""+J,G!==null&&G.tag===6?(v(Y,G.sibling),G=_(G,J),G.return=Y,Y=G):(v(Y,G),G=kv(J,Y.mode,de),G.return=Y,Y=G),k(Y)):v(Y,G)}return Nt}var wo=XS(!0),YS=XS(!1),qu=Ni(null),Uu=null,_o=null,qm=null;function Um(){qm=_o=Uu=null}function Wm(o){var l=qu.current;yt(qu),o._currentValue=l}function Hm(o,l,v){for(;o!==null;){var x=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,x!==null&&(x.childLanes|=l)):x!==null&&(x.childLanes&l)!==l&&(x.childLanes|=l),o===v)break;o=o.return}}function So(o,l){Uu=o,qm=_o=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&l)!==0&&(mr=!0),o.firstContext=null)}function Gr(o){var l=o._currentValue;if(qm!==o)if(o={context:o,memoizedValue:l,next:null},_o===null){if(Uu===null)throw Error(r(308));_o=o,Uu.dependencies={lanes:0,firstContext:o}}else _o=_o.next=o;return l}var da=null;function Vm(o){da===null?da=[o]:da.push(o)}function QS(o,l,v,x){var _=l.interleaved;return _===null?(v.next=v,Vm(l)):(v.next=_.next,_.next=v),l.interleaved=v,Zn(o,x)}function Zn(o,l){o.lanes|=l;var v=o.alternate;for(v!==null&&(v.lanes|=l),v=o,o=o.return;o!==null;)o.childLanes|=l,v=o.alternate,v!==null&&(v.childLanes|=l),v=o,o=o.return;return v.tag===3?v.stateNode:null}var ki=!1;function Gm(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ZS(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function Jn(o,l){return{eventTime:o,lane:l,tag:0,payload:null,callback:null,next:null}}function Ri(o,l,v){var x=o.updateQueue;if(x===null)return null;if(x=x.shared,(Xe&2)!==0){var _=x.pending;return _===null?l.next=l:(l.next=_.next,_.next=l),x.pending=l,Zn(o,v)}return _=x.interleaved,_===null?(l.next=l,Vm(x)):(l.next=_.next,_.next=l),x.interleaved=l,Zn(o,v)}function Wu(o,l,v){if(l=l.updateQueue,l!==null&&(l=l.shared,(v&4194240)!==0)){var x=l.lanes;x&=o.pendingLanes,v|=x,l.lanes=v,sm(o,v)}}function JS(o,l){var v=o.updateQueue,x=o.alternate;if(x!==null&&(x=x.updateQueue,v===x)){var _=null,j=null;if(v=v.firstBaseUpdate,v!==null){do{var k={eventTime:v.eventTime,lane:v.lane,tag:v.tag,payload:v.payload,callback:v.callback,next:null};j===null?_=j=k:j=j.next=k,v=v.next}while(v!==null);j===null?_=j=l:j=j.next=l}else _=j=l;v={baseState:x.baseState,firstBaseUpdate:_,lastBaseUpdate:j,shared:x.shared,effects:x.effects},o.updateQueue=v;return}o=v.lastBaseUpdate,o===null?v.firstBaseUpdate=l:o.next=l,v.lastBaseUpdate=l}function Hu(o,l,v,x){var _=o.updateQueue;ki=!1;var j=_.firstBaseUpdate,k=_.lastBaseUpdate,F=_.shared.pending;if(F!==null){_.shared.pending=null;var W=F,te=W.next;W.next=null,k===null?j=te:k.next=te,k=W;var le=o.alternate;le!==null&&(le=le.updateQueue,F=le.lastBaseUpdate,F!==k&&(F===null?le.firstBaseUpdate=te:F.next=te,le.lastBaseUpdate=W))}if(j!==null){var ce=_.baseState;k=0,le=te=W=null,F=j;do{var se=F.lane,xe=F.eventTime;if((x&se)===se){le!==null&&(le=le.next={eventTime:xe,lane:0,tag:F.tag,payload:F.payload,callback:F.callback,next:null});e:{var Se=o,Ee=F;switch(se=l,xe=v,Ee.tag){case 1:if(Se=Ee.payload,typeof Se=="function"){ce=Se.call(xe,ce,se);break e}ce=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Ee.payload,se=typeof Se=="function"?Se.call(xe,ce,se):Se,se==null)break e;ce=ee({},ce,se);break e;case 2:ki=!0}}F.callback!==null&&F.lane!==0&&(o.flags|=64,se=_.effects,se===null?_.effects=[F]:se.push(F))}else xe={eventTime:xe,lane:se,tag:F.tag,payload:F.payload,callback:F.callback,next:null},le===null?(te=le=xe,W=ce):le=le.next=xe,k|=se;if(F=F.next,F===null){if(F=_.shared.pending,F===null)break;se=F,F=se.next,se.next=null,_.lastBaseUpdate=se,_.shared.pending=null}}while(!0);if(le===null&&(W=ce),_.baseState=W,_.firstBaseUpdate=te,_.lastBaseUpdate=le,l=_.shared.interleaved,l!==null){_=l;do k|=_.lane,_=_.next;while(_!==l)}else j===null&&(_.shared.lanes=0);ma|=k,o.lanes=k,o.memoizedState=ce}}function eO(o,l,v){if(o=l.effects,l.effects=null,o!==null)for(l=0;lv?v:4,o(!0);var x=Zm.transition;Zm.transition={};try{o(!1),l()}finally{ct=v,Zm.transition=x}}function xO(){return Kr().memoizedState}function d5(o,l,v){var x=Li(o);if(v={lane:x,action:v,hasEagerState:!1,eagerState:null,next:null},bO(o))wO(l,v);else if(v=QS(o,l,v,x),v!==null){var _=sr();pn(v,o,x,_),_O(v,l,x)}}function h5(o,l,v){var x=Li(o),_={lane:x,action:v,hasEagerState:!1,eagerState:null,next:null};if(bO(o))wO(l,_);else{var j=o.alternate;if(o.lanes===0&&(j===null||j.lanes===0)&&(j=l.lastRenderedReducer,j!==null))try{var k=l.lastRenderedState,F=j(k,v);if(_.hasEagerState=!0,_.eagerState=F,cn(F,k)){var W=l.interleaved;W===null?(_.next=_,Vm(l)):(_.next=W.next,W.next=_),l.interleaved=_;return}}catch{}finally{}v=QS(o,l,_,x),v!==null&&(_=sr(),pn(v,o,x,_),_O(v,l,x))}}function bO(o){var l=o.alternate;return o===St||l!==null&&l===St}function wO(o,l){_l=Ku=!0;var v=o.pending;v===null?l.next=l:(l.next=v.next,v.next=l),o.pending=l}function _O(o,l,v){if((v&4194240)!==0){var x=l.lanes;x&=o.pendingLanes,v|=x,l.lanes=v,sm(o,v)}}var Qu={readContext:Gr,useCallback:er,useContext:er,useEffect:er,useImperativeHandle:er,useInsertionEffect:er,useLayoutEffect:er,useMemo:er,useReducer:er,useRef:er,useState:er,useDebugValue:er,useDeferredValue:er,useTransition:er,useMutableSource:er,useSyncExternalStore:er,useId:er,unstable_isNewReconciler:!1},p5={readContext:Gr,useCallback:function(o,l){return Tn().memoizedState=[o,l===void 0?null:l],o},useContext:Gr,useEffect:fO,useImperativeHandle:function(o,l,v){return v=v!=null?v.concat([o]):null,Xu(4194308,4,pO.bind(null,l,o),v)},useLayoutEffect:function(o,l){return Xu(4194308,4,o,l)},useInsertionEffect:function(o,l){return Xu(4,2,o,l)},useMemo:function(o,l){var v=Tn();return l=l===void 0?null:l,o=o(),v.memoizedState=[o,l],o},useReducer:function(o,l,v){var x=Tn();return l=v!==void 0?v(l):l,x.memoizedState=x.baseState=l,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:l},x.queue=o,o=o.dispatch=d5.bind(null,St,o),[x.memoizedState,o]},useRef:function(o){var l=Tn();return o={current:o},l.memoizedState=o},useState:cO,useDebugValue:av,useDeferredValue:function(o){return Tn().memoizedState=o},useTransition:function(){var o=cO(!1),l=o[0];return o=f5.bind(null,o[1]),Tn().memoizedState=o,[l,o]},useMutableSource:function(){},useSyncExternalStore:function(o,l,v){var x=St,_=Tn();if(bt){if(v===void 0)throw Error(r(407));v=v()}else{if(v=l(),Ut===null)throw Error(r(349));(pa&30)!==0||iO(x,l,v)}_.memoizedState=v;var j={value:v,getSnapshot:l};return _.queue=j,fO(oO.bind(null,x,j,o),[o]),x.flags|=2048,jl(9,aO.bind(null,x,j,v,l),void 0,null),v},useId:function(){var o=Tn(),l=Ut.identifierPrefix;if(bt){var v=Qn,x=Yn;v=(x&~(1<<32-ln(x)-1)).toString(32)+v,l=":"+l+"R"+v,v=Sl++,0<\/script>",o=o.removeChild(o.firstChild)):typeof x.is=="string"?o=k.createElement(v,{is:x.is}):(o=k.createElement(v),v==="select"&&(k=o,x.multiple?k.multiple=!0:x.size&&(k.size=x.size))):o=k.createElementNS(o,v),o[Nn]=l,o[vl]=x,qO(o,l,!1,!1),l.stateNode=o;e:{switch(k=Qp(v,x),v){case"dialog":gt("cancel",o),gt("close",o),_=x;break;case"iframe":case"object":case"embed":gt("load",o),_=x;break;case"video":case"audio":for(_=0;_Po&&(l.flags|=128,x=!0,El(j,!1),l.lanes=4194304)}else{if(!x)if(o=Vu(k),o!==null){if(l.flags|=128,x=!0,v=o.updateQueue,v!==null&&(l.updateQueue=v,l.flags|=4),El(j,!0),j.tail===null&&j.tailMode==="hidden"&&!k.alternate&&!bt)return tr(l),null}else 2*Pt()-j.renderingStartTime>Po&&v!==1073741824&&(l.flags|=128,x=!0,El(j,!1),l.lanes=4194304);j.isBackwards?(k.sibling=l.child,l.child=k):(v=j.last,v!==null?v.sibling=k:l.child=k,j.last=k)}return j.tail!==null?(l=j.tail,j.rendering=l,j.tail=l.sibling,j.renderingStartTime=Pt(),l.sibling=null,v=_t.current,dt(_t,x?v&1|2:v&1),l):(tr(l),null);case 22:case 23:return Nv(),x=l.memoizedState!==null,o!==null&&o.memoizedState!==null!==x&&(l.flags|=8192),x&&(l.mode&1)!==0?(Nr&1073741824)!==0&&(tr(l),l.subtreeFlags&6&&(l.flags|=8192)):tr(l),null;case 24:return null;case 25:return null}throw Error(r(156,l.tag))}function _5(o,l){switch($m(l),l.tag){case 1:return pr(l.type)&&Iu(),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return Oo(),yt(hr),yt(Jt),Qm(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 5:return Xm(l),null;case 13:if(yt(_t),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(r(340));bo()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return yt(_t),null;case 4:return Oo(),null;case 10:return Wm(l.type._context),null;case 22:case 23:return Nv(),null;case 24:return null;default:return null}}var tf=!1,rr=!1,S5=typeof WeakSet=="function"?WeakSet:Set,be=null;function Eo(o,l){var v=o.ref;if(v!==null)if(typeof v=="function")try{v(null)}catch(x){Ot(o,l,x)}else v.current=null}function gv(o,l,v){try{v()}catch(x){Ot(o,l,x)}}var HO=!1;function O5(o,l){if(Nm=wu,o=SS(),wm(o)){if("selectionStart"in o)var v={start:o.selectionStart,end:o.selectionEnd};else e:{v=(v=o.ownerDocument)&&v.defaultView||window;var x=v.getSelection&&v.getSelection();if(x&&x.rangeCount!==0){v=x.anchorNode;var _=x.anchorOffset,j=x.focusNode;x=x.focusOffset;try{v.nodeType,j.nodeType}catch{v=null;break e}var k=0,F=-1,W=-1,te=0,le=0,ce=o,se=null;t:for(;;){for(var xe;ce!==v||_!==0&&ce.nodeType!==3||(F=k+_),ce!==j||x!==0&&ce.nodeType!==3||(W=k+x),ce.nodeType===3&&(k+=ce.nodeValue.length),(xe=ce.firstChild)!==null;)se=ce,ce=xe;for(;;){if(ce===o)break t;if(se===v&&++te===_&&(F=k),se===j&&++le===x&&(W=k),(xe=ce.nextSibling)!==null)break;ce=se,se=ce.parentNode}ce=xe}v=F===-1||W===-1?null:{start:F,end:W}}else v=null}v=v||{start:0,end:0}}else v=null;for(Cm={focusedElem:o,selectionRange:v},wu=!1,be=l;be!==null;)if(l=be,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,be=o;else for(;be!==null;){l=be;try{var Se=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(Se!==null){var Ee=Se.memoizedProps,Nt=Se.memoizedState,Y=l.stateNode,G=Y.getSnapshotBeforeUpdate(l.elementType===l.type?Ee:fn(l.type,Ee),Nt);Y.__reactInternalSnapshotBeforeUpdate=G}break;case 3:var J=l.stateNode.containerInfo;J.nodeType===1?J.textContent="":J.nodeType===9&&J.documentElement&&J.removeChild(J.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(de){Ot(l,l.return,de)}if(o=l.sibling,o!==null){o.return=l.return,be=o;break}be=l.return}return Se=HO,HO=!1,Se}function Al(o,l,v){var x=l.updateQueue;if(x=x!==null?x.lastEffect:null,x!==null){var _=x=x.next;do{if((_.tag&o)===o){var j=_.destroy;_.destroy=void 0,j!==void 0&&gv(l,v,j)}_=_.next}while(_!==x)}}function rf(o,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var v=l=l.next;do{if((v.tag&o)===o){var x=v.create;v.destroy=x()}v=v.next}while(v!==l)}}function yv(o){var l=o.ref;if(l!==null){var v=o.stateNode;switch(o.tag){case 5:o=v;break;default:o=v}typeof l=="function"?l(o):l.current=o}}function VO(o){var l=o.alternate;l!==null&&(o.alternate=null,VO(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&(delete l[Nn],delete l[vl],delete l[Mm],delete l[o5],delete l[s5])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function GO(o){return o.tag===5||o.tag===3||o.tag===4}function KO(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||GO(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function xv(o,l,v){var x=o.tag;if(x===5||x===6)o=o.stateNode,l?v.nodeType===8?v.parentNode.insertBefore(o,l):v.insertBefore(o,l):(v.nodeType===8?(l=v.parentNode,l.insertBefore(o,v)):(l=v,l.appendChild(o)),v=v._reactRootContainer,v!=null||l.onclick!==null||(l.onclick=Ru));else if(x!==4&&(o=o.child,o!==null))for(xv(o,l,v),o=o.sibling;o!==null;)xv(o,l,v),o=o.sibling}function bv(o,l,v){var x=o.tag;if(x===5||x===6)o=o.stateNode,l?v.insertBefore(o,l):v.appendChild(o);else if(x!==4&&(o=o.child,o!==null))for(bv(o,l,v),o=o.sibling;o!==null;)bv(o,l,v),o=o.sibling}var Yt=null,dn=!1;function Mi(o,l,v){for(v=v.child;v!==null;)XO(o,l,v),v=v.sibling}function XO(o,l,v){if(Pn&&typeof Pn.onCommitFiberUnmount=="function")try{Pn.onCommitFiberUnmount(mu,v)}catch{}switch(v.tag){case 5:rr||Eo(v,l);case 6:var x=Yt,_=dn;Yt=null,Mi(o,l,v),Yt=x,dn=_,Yt!==null&&(dn?(o=Yt,v=v.stateNode,o.nodeType===8?o.parentNode.removeChild(v):o.removeChild(v)):Yt.removeChild(v.stateNode));break;case 18:Yt!==null&&(dn?(o=Yt,v=v.stateNode,o.nodeType===8?Rm(o.parentNode,v):o.nodeType===1&&Rm(o,v),al(o)):Rm(Yt,v.stateNode));break;case 4:x=Yt,_=dn,Yt=v.stateNode.containerInfo,dn=!0,Mi(o,l,v),Yt=x,dn=_;break;case 0:case 11:case 14:case 15:if(!rr&&(x=v.updateQueue,x!==null&&(x=x.lastEffect,x!==null))){_=x=x.next;do{var j=_,k=j.destroy;j=j.tag,k!==void 0&&((j&2)!==0||(j&4)!==0)&&gv(v,l,k),_=_.next}while(_!==x)}Mi(o,l,v);break;case 1:if(!rr&&(Eo(v,l),x=v.stateNode,typeof x.componentWillUnmount=="function"))try{x.props=v.memoizedProps,x.state=v.memoizedState,x.componentWillUnmount()}catch(F){Ot(v,l,F)}Mi(o,l,v);break;case 21:Mi(o,l,v);break;case 22:v.mode&1?(rr=(x=rr)||v.memoizedState!==null,Mi(o,l,v),rr=x):Mi(o,l,v);break;default:Mi(o,l,v)}}function YO(o){var l=o.updateQueue;if(l!==null){o.updateQueue=null;var v=o.stateNode;v===null&&(v=o.stateNode=new S5),l.forEach(function(x){var _=R5.bind(null,o,x);v.has(x)||(v.add(x),x.then(_,_))})}}function hn(o,l){var v=l.deletions;if(v!==null)for(var x=0;x_&&(_=k),x&=~j}if(x=_,x=Pt()-x,x=(120>x?120:480>x?480:1080>x?1080:1920>x?1920:3e3>x?3e3:4320>x?4320:1960*E5(x/1960))-x,10o?16:o,Di===null)var x=!1;else{if(o=Di,Di=null,lf=0,(Xe&6)!==0)throw Error(r(331));var _=Xe;for(Xe|=4,be=o.current;be!==null;){var j=be,k=j.child;if((be.flags&16)!==0){var F=j.deletions;if(F!==null){for(var W=0;WPt()-Sv?ga(o,0):_v|=v),gr(o,l)}function cj(o,l){l===0&&((o.mode&1)===0?l=1:(l=gu,gu<<=1,(gu&130023424)===0&&(gu=4194304)));var v=sr();o=Zn(o,l),o!==null&&(el(o,l,v),gr(o,v))}function k5(o){var l=o.memoizedState,v=0;l!==null&&(v=l.retryLane),cj(o,v)}function R5(o,l){var v=0;switch(o.tag){case 13:var x=o.stateNode,_=o.memoizedState;_!==null&&(v=_.retryLane);break;case 19:x=o.stateNode;break;default:throw Error(r(314))}x!==null&&x.delete(l),cj(o,v)}var uj;uj=function(o,l,v){if(o!==null)if(o.memoizedProps!==l.pendingProps||hr.current)mr=!0;else{if((o.lanes&v)===0&&(l.flags&128)===0)return mr=!1,b5(o,l,v);mr=(o.flags&131072)!==0}else mr=!1,bt&&(l.flags&1048576)!==0&&US(l,Bu,l.index);switch(l.lanes=0,l.tag){case 2:var x=l.type;ef(o,l),o=l.pendingProps;var _=go(l,Jt.current);So(l,v),_=ev(null,l,x,o,_,v);var j=tv();return l.flags|=1,typeof _=="object"&&_!==null&&typeof _.render=="function"&&_.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,pr(x)?(j=!0,Du(l)):j=!1,l.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,Gm(l),_.updater=Zu,l.stateNode=_,_._reactInternals=l,sv(l,x,o,v),l=fv(null,l,x,!0,j,v)):(l.tag=0,bt&&j&&Lm(l),or(null,l,_,v),l=l.child),l;case 16:x=l.elementType;e:{switch(ef(o,l),o=l.pendingProps,_=x._init,x=_(x._payload),l.type=x,_=l.tag=I5(x),o=fn(x,o),_){case 0:l=uv(null,l,x,o,v);break e;case 1:l=DO(null,l,x,o,v);break e;case 11:l=TO(null,l,x,o,v);break e;case 14:l=kO(null,l,x,fn(x.type,o),v);break e}throw Error(r(306,x,""))}return l;case 0:return x=l.type,_=l.pendingProps,_=l.elementType===x?_:fn(x,_),uv(o,l,x,_,v);case 1:return x=l.type,_=l.pendingProps,_=l.elementType===x?_:fn(x,_),DO(o,l,x,_,v);case 3:e:{if(LO(l),o===null)throw Error(r(387));x=l.pendingProps,j=l.memoizedState,_=j.element,ZS(o,l),Hu(l,x,null,v);var k=l.memoizedState;if(x=k.element,j.isDehydrated)if(j={element:x,isDehydrated:!1,cache:k.cache,pendingSuspenseBoundaries:k.pendingSuspenseBoundaries,transitions:k.transitions},l.updateQueue.baseState=j,l.memoizedState=j,l.flags&256){_=jo(Error(r(423)),l),l=$O(o,l,x,v,_);break e}else if(x!==_){_=jo(Error(r(424)),l),l=$O(o,l,x,v,_);break e}else for(Pr=Pi(l.stateNode.containerInfo.firstChild),Ar=l,bt=!0,un=null,v=YS(l,null,x,v),l.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(bo(),x===_){l=ei(o,l,v);break e}or(o,l,x,v)}l=l.child}return l;case 5:return tO(l),o===null&&zm(l),x=l.type,_=l.pendingProps,j=o!==null?o.memoizedProps:null,k=_.children,Tm(x,_)?k=null:j!==null&&Tm(x,j)&&(l.flags|=32),IO(o,l),or(o,l,k,v),l.child;case 6:return o===null&&zm(l),null;case 13:return BO(o,l,v);case 4:return Km(l,l.stateNode.containerInfo),x=l.pendingProps,o===null?l.child=wo(l,null,x,v):or(o,l,x,v),l.child;case 11:return x=l.type,_=l.pendingProps,_=l.elementType===x?_:fn(x,_),TO(o,l,x,_,v);case 7:return or(o,l,l.pendingProps,v),l.child;case 8:return or(o,l,l.pendingProps.children,v),l.child;case 12:return or(o,l,l.pendingProps.children,v),l.child;case 10:e:{if(x=l.type._context,_=l.pendingProps,j=l.memoizedProps,k=_.value,dt(qu,x._currentValue),x._currentValue=k,j!==null)if(cn(j.value,k)){if(j.children===_.children&&!hr.current){l=ei(o,l,v);break e}}else for(j=l.child,j!==null&&(j.return=l);j!==null;){var F=j.dependencies;if(F!==null){k=j.child;for(var W=F.firstContext;W!==null;){if(W.context===x){if(j.tag===1){W=Jn(-1,v&-v),W.tag=2;var te=j.updateQueue;if(te!==null){te=te.shared;var le=te.pending;le===null?W.next=W:(W.next=le.next,le.next=W),te.pending=W}}j.lanes|=v,W=j.alternate,W!==null&&(W.lanes|=v),Hm(j.return,v,l),F.lanes|=v;break}W=W.next}}else if(j.tag===10)k=j.type===l.type?null:j.child;else if(j.tag===18){if(k=j.return,k===null)throw Error(r(341));k.lanes|=v,F=k.alternate,F!==null&&(F.lanes|=v),Hm(k,v,l),k=j.sibling}else k=j.child;if(k!==null)k.return=j;else for(k=j;k!==null;){if(k===l){k=null;break}if(j=k.sibling,j!==null){j.return=k.return,k=j;break}k=k.return}j=k}or(o,l,_.children,v),l=l.child}return l;case 9:return _=l.type,x=l.pendingProps.children,So(l,v),_=Gr(_),x=x(_),l.flags|=1,or(o,l,x,v),l.child;case 14:return x=l.type,_=fn(x,l.pendingProps),_=fn(x.type,_),kO(o,l,x,_,v);case 15:return RO(o,l,l.type,l.pendingProps,v);case 17:return x=l.type,_=l.pendingProps,_=l.elementType===x?_:fn(x,_),ef(o,l),l.tag=1,pr(x)?(o=!0,Du(l)):o=!1,So(l,v),OO(l,x,_),sv(l,x,_,v),fv(null,l,x,!0,o,v);case 19:return FO(o,l,v);case 22:return MO(o,l,v)}throw Error(r(156,l.tag))};function fj(o,l){return W_(o,l)}function M5(o,l,v,x){this.tag=o,this.key=v,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yr(o,l,v,x){return new M5(o,l,v,x)}function Tv(o){return o=o.prototype,!(!o||!o.isReactComponent)}function I5(o){if(typeof o=="function")return Tv(o)?1:0;if(o!=null){if(o=o.$$typeof,o===D)return 11;if(o===V)return 14}return 2}function Bi(o,l){var v=o.alternate;return v===null?(v=Yr(o.tag,l,o.key,o.mode),v.elementType=o.elementType,v.type=o.type,v.stateNode=o.stateNode,v.alternate=o,o.alternate=v):(v.pendingProps=l,v.type=o.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=o.flags&14680064,v.childLanes=o.childLanes,v.lanes=o.lanes,v.child=o.child,v.memoizedProps=o.memoizedProps,v.memoizedState=o.memoizedState,v.updateQueue=o.updateQueue,l=o.dependencies,v.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},v.sibling=o.sibling,v.index=o.index,v.ref=o.ref,v}function df(o,l,v,x,_,j){var k=2;if(x=o,typeof o=="function")Tv(o)&&(k=1);else if(typeof o=="string")k=5;else e:switch(o){case T:return xa(v.children,_,j,l);case R:k=8,_|=8;break;case I:return o=Yr(12,v,l,_|2),o.elementType=I,o.lanes=j,o;case U:return o=Yr(13,v,l,_),o.elementType=U,o.lanes=j,o;case H:return o=Yr(19,v,l,_),o.elementType=H,o.lanes=j,o;case X:return hf(v,_,j,l);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case q:k=10;break e;case L:k=9;break e;case D:k=11;break e;case V:k=14;break e;case K:k=16,x=null;break e}throw Error(r(130,o==null?o:typeof o,""))}return l=Yr(k,v,l,_),l.elementType=o,l.type=x,l.lanes=j,l}function xa(o,l,v,x){return o=Yr(7,o,x,l),o.lanes=v,o}function hf(o,l,v,x){return o=Yr(22,o,x,l),o.elementType=X,o.lanes=v,o.stateNode={isHidden:!1},o}function kv(o,l,v){return o=Yr(6,o,null,l),o.lanes=v,o}function Rv(o,l,v){return l=Yr(4,o.children!==null?o.children:[],o.key,l),l.lanes=v,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}function D5(o,l,v,x,_){this.tag=l,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=om(0),this.expirationTimes=om(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=om(0),this.identifierPrefix=x,this.onRecoverableError=_,this.mutableSourceEagerHydrationData=null}function Mv(o,l,v,x,_,j,k,F,W){return o=new D5(o,l,v,F,W),l===1?(l=1,j===!0&&(l|=8)):l=0,j=Yr(3,null,null,l),o.current=j,j.stateNode=o,j.memoizedState={element:x,isDehydrated:v,cache:null,transitions:null,pendingSuspenseBoundaries:null},Gm(j),o}function L5(o,l,v){var x=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),zv.exports=X5(),zv.exports}var jj;function Y5(){if(jj)return wf;jj=1;var e=cR();return wf.createRoot=e.createRoot,wf.hydrateRoot=e.hydrateRoot,wf}var Q5=Y5(),P=Vh();const z=it(P),X1=U5({__proto__:null,default:z},[P]);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Z5=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),J5=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),Ej=e=>{const t=J5(e);return t.charAt(0).toUpperCase()+t.slice(1)},uR=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var eB={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"};/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const tB=P.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:a,iconNode:s,...u},f)=>P.createElement("svg",{ref:f,...eB,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:uR("lucide",i),...u},[...s.map(([c,d])=>P.createElement(c,d)),...Array.isArray(a)?a:[a]]));/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ce=(e,t)=>{const r=P.forwardRef(({className:n,...i},a)=>P.createElement(tB,{ref:a,iconNode:t,className:uR(`lucide-${Z5(Ej(e))}`,`lucide-${e}`,n),...i}));return r.displayName=Ej(e),r};/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rB=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]],nB=Ce("arrow-down-a-z",rB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const iB=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],aB=Ce("arrow-down-right",iB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const oB=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],sB=Ce("arrow-left",oB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const lB=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],cB=Ce("arrow-up-down",lB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const uB=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],fR=Ce("arrow-up-right",uB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const fB=[["path",{d:"M3 5v14",key:"1nt18q"}],["path",{d:"M8 5v14",key:"1ybrkv"}],["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"M17 5v14",key:"ycjyhj"}],["path",{d:"M21 5v14",key:"nzette"}]],dB=Ce("barcode",fB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hB=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],pB=Ce("bell",hB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mB=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],vB=Ce("calendar",mB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gB=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],yB=Ce("chart-column",gB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xB=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],dR=Ce("check",xB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const bB=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],cc=Ce("chevron-down",bB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wB=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],_B=Ce("chevron-left",wB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const SB=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Cd=Ce("chevron-right",SB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const OB=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],jB=Ce("chevron-up",OB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const EB=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],cb=Ce("circle-help",EB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const AB=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],PB=Ce("circle-user",AB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const NB=[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]],CB=Ce("coffee",NB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const TB=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Y1=Ce("download",TB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const kB=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],hR=Ce("ellipsis",kB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const RB=[["path",{d:"M14.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"16lz6z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 13.1a2 2 0 0 0-1 1.76v3.24a2 2 0 0 0 .97 1.78L6 21.7a2 2 0 0 0 2.03.01L11 19.9a2 2 0 0 0 1-1.76V14.9a2 2 0 0 0-.97-1.78L8 11.3a2 2 0 0 0-2.03-.01Z",key:"99pj1s"}],["path",{d:"M7 17v5",key:"1yj1jh"}],["path",{d:"M11.7 14.2 7 17l-4.7-2.8",key:"1yk8tc"}]],MB=Ce("file-box",RB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const IB=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],uc=Ce("file-text",IB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const DB=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],LB=Ce("grid-3x3",DB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $B=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Ia=Ce("image",$B);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const BB=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],zB=Ce("layers",BB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const FB=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],qB=Ce("layout-dashboard",FB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const UB=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],WB=Ce("list",UB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const HB=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],VB=Ce("log-out",HB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const GB=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Gh=Ce("map-pin",GB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const KB=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],XB=Ce("menu",KB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const YB=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],ub=Ce("package",YB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const QB=[["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:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]],pR=Ce("palette",QB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ZB=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],jd=Ce("pencil",ZB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const JB=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],e8=Ce("pin",JB);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const t8=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ur=Ce("plus",t8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const r8=[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]],mR=Ce("printer",r8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const n8=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],i8=Ce("refresh-cw",n8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const a8=[["path",{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",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],o8=Ce("save",a8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const s8=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Q1=Ce("search",s8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const l8=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],vR=Ce("settings",l8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const c8=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],u8=Ce("shield",c8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const f8=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Uo=Ce("square-pen",f8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const d8=[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7",key:"6c3vgh"}]],h8=Ce("store",d8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const p8=[["path",{d:"m18 2 4 4",key:"22kx64"}],["path",{d:"m17 7 3-3",key:"1w1zoj"}],["path",{d:"M19 9 8.7 19.3c-1 1-2.5 1-3.4 0l-.6-.6c-1-1-1-2.5 0-3.4L15 5",key:"1exhtz"}],["path",{d:"m9 11 4 4",key:"rovt3i"}],["path",{d:"m5 19-3 3",key:"59f2uf"}],["path",{d:"m14 4 6 6",key:"yqp9t2"}]],Uv=Ce("syringe",p8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const m8=[["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"}]],v8=Ce("tablet",m8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const g8=[["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"}]],fb=Ce("tag",g8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const y8=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],x8=Ce("timer",y8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const b8=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Aj=Ce("trash-2",b8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const w8=[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]],_8=Ce("trending-up",w8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const S8=[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]],Z1=Ce("type",S8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const O8=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],j8=Ce("upload",O8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const E8=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],A8=Ce("user",E8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const P8=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],gR=Ce("users",P8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const N8=[["path",{d:"M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2",key:"cjf0a3"}],["path",{d:"M7 2v20",key:"1473qp"}],["path",{d:"M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7",key:"j28e5"}]],C8=Ce("utensils",N8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const T8=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ec=Ce("x",T8);function yR(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const r=new Array(e.length+t.length);for(let n=0;n({classGroupId:e,validator:t}),xR=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Td="-",Pj=[],M8="arbitrary..",I8=e=>{const t=L8(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return D8(s);const u=s.split(Td),f=u[0]===""&&u.length>1?1:0;return bR(u,f,t)},getConflictingClassGroupIds:(s,u)=>{if(u){const f=n[s],c=r[s];return f?c?k8(c,f):f:c||Pj}return r[s]||Pj}}},bR=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const i=e[t],a=r.nextPart.get(i);if(a){const c=bR(e,t+1,a);if(c)return c}const s=r.validators;if(s===null)return;const u=t===0?e.join(Td):e.slice(t).join(Td),f=s.length;for(let c=0;ce.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?M8+n:void 0})(),L8=e=>{const{theme:t,classGroups:r}=e;return $8(r,t)},$8=(e,t)=>{const r=xR();for(const n in e){const i=e[n];J1(i,r,n,t)}return r},J1=(e,t,r,n)=>{const i=e.length;for(let a=0;a{if(typeof e=="string"){z8(e,t,r);return}if(typeof e=="function"){F8(e,t,r,n);return}q8(e,t,r,n)},z8=(e,t,r)=>{const n=e===""?t:wR(t,e);n.classGroupId=r},F8=(e,t,r,n)=>{if(U8(e)){J1(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(R8(r,e))},q8=(e,t,r,n)=>{const i=Object.entries(e),a=i.length;for(let s=0;s{let r=e;const n=t.split(Td),i=n.length;for(let a=0;a"isThemeGetter"in e&&e.isThemeGetter===!0,W8=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const i=(a,s)=>{r[a]=s,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(a){let s=r[a];if(s!==void 0)return s;if((s=n[a])!==void 0)return i(a,s),s},set(a,s){a in r?r[a]=s:i(a,s)}}},db="!",Nj=":",H8=[],Cj=(e,t,r,n,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:i}),V8=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=i=>{const a=[];let s=0,u=0,f=0,c;const d=i.length;for(let y=0;yf?c-f:void 0;return Cj(a,g,m,b)};if(t){const i=t+Nj,a=n;n=s=>s.startsWith(i)?a(s.slice(i.length)):Cj(H8,!1,s,void 0,!0)}if(r){const i=n;n=a=>r({className:a,parseClassName:i})}return n},G8=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let i=[];for(let a=0;a0&&(i.sort(),n.push(...i),i=[]),n.push(s)):i.push(s)}return i.length>0&&(i.sort(),n.push(...i)),n}},K8=e=>({cache:W8(e.cacheSize),parseClassName:V8(e),sortModifiers:G8(e),...I8(e)}),X8=/\s+/,Y8=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:a}=t,s=[],u=e.trim().split(X8);let f="";for(let c=u.length-1;c>=0;c-=1){const d=u[c],{isExternal:h,modifiers:m,hasImportantModifier:g,baseClassName:b,maybePostfixModifierPosition:y}=r(d);if(h){f=d+(f.length>0?" "+f:f);continue}let w=!!y,S=n(w?b.substring(0,y):b);if(!S){if(!w){f=d+(f.length>0?" "+f:f);continue}if(S=n(b),!S){f=d+(f.length>0?" "+f:f);continue}w=!1}const O=m.length===0?"":m.length===1?m[0]:a(m).join(":"),E=g?O+db:O,C=E+S;if(s.indexOf(C)>-1)continue;s.push(C);const A=i(S,w);for(let N=0;N0?" "+f:f)}return f},Q8=(...e)=>{let t=0,r,n,i="";for(;t{if(typeof e=="string")return e;let t,r="";for(let n=0;n{let r,n,i,a;const s=f=>{const c=t.reduce((d,h)=>h(d),e());return r=K8(c),n=r.cache.get,i=r.cache.set,a=u,u(f)},u=f=>{const c=n(f);if(c)return c;const d=Y8(f,r);return i(f,d),d};return a=s,(...f)=>a(Q8(...f))},J8=[],Dt=e=>{const t=r=>r[e]||J8;return t.isThemeGetter=!0,t},SR=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,OR=/^\((?:(\w[\w-]*):)?(.+)\)$/i,e6=/^\d+\/\d+$/,t6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,r6=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,n6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,i6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,a6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Co=e=>e6.test(e),He=e=>!!e&&!Number.isNaN(Number(e)),Fi=e=>!!e&&Number.isInteger(Number(e)),Wv=e=>e.endsWith("%")&&He(e.slice(0,-1)),ri=e=>t6.test(e),o6=()=>!0,s6=e=>r6.test(e)&&!n6.test(e),jR=()=>!1,l6=e=>i6.test(e),c6=e=>a6.test(e),u6=e=>!Oe(e)&&!je(e),f6=e=>Ts(e,PR,jR),Oe=e=>SR.test(e),ba=e=>Ts(e,NR,s6),Hv=e=>Ts(e,v6,He),Tj=e=>Ts(e,ER,jR),d6=e=>Ts(e,AR,c6),_f=e=>Ts(e,CR,l6),je=e=>OR.test(e),Rl=e=>ks(e,NR),h6=e=>ks(e,g6),kj=e=>ks(e,ER),p6=e=>ks(e,PR),m6=e=>ks(e,AR),Sf=e=>ks(e,CR,!0),Ts=(e,t,r)=>{const n=SR.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},ks=(e,t,r=!1)=>{const n=OR.exec(e);return n?n[1]?t(n[1]):r:!1},ER=e=>e==="position"||e==="percentage",AR=e=>e==="image"||e==="url",PR=e=>e==="length"||e==="size"||e==="bg-size",NR=e=>e==="length",v6=e=>e==="number",g6=e=>e==="family-name",CR=e=>e==="shadow",y6=()=>{const e=Dt("color"),t=Dt("font"),r=Dt("text"),n=Dt("font-weight"),i=Dt("tracking"),a=Dt("leading"),s=Dt("breakpoint"),u=Dt("container"),f=Dt("spacing"),c=Dt("radius"),d=Dt("shadow"),h=Dt("inset-shadow"),m=Dt("text-shadow"),g=Dt("drop-shadow"),b=Dt("blur"),y=Dt("perspective"),w=Dt("aspect"),S=Dt("ease"),O=Dt("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...C(),je,Oe],N=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],R=()=>[je,Oe,f],I=()=>[Co,"full","auto",...R()],q=()=>[Fi,"none","subgrid",je,Oe],L=()=>["auto",{span:["full",Fi,je,Oe]},Fi,je,Oe],D=()=>[Fi,"auto",je,Oe],U=()=>["auto","min","max","fr",je,Oe],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],K=()=>["auto",...R()],X=()=>[Co,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],B=()=>[e,je,Oe],Z=()=>[...C(),kj,Tj,{position:[je,Oe]}],ee=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",p6,f6,{size:[je,Oe]}],$=()=>[Wv,Rl,ba],Q=()=>["","none","full",c,je,Oe],ae=()=>["",He,Rl,ba],pe=()=>["solid","dashed","dotted","double"],ye=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],oe=()=>[He,Wv,kj,Tj],me=()=>["","none",b,je,Oe],ie=()=>["none",He,je,Oe],ue=()=>["none",He,je,Oe],ve=()=>[He,je,Oe],re=()=>[Co,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ri],breakpoint:[ri],color:[o6],container:[ri],"drop-shadow":[ri],ease:["in","out","in-out"],font:[u6],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ri],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ri],shadow:[ri],spacing:["px",He],text:[ri],"text-shadow":[ri],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Co,Oe,je,w]}],container:["container"],columns:[{columns:[He,Oe,je,u]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Fi,"auto",je,Oe]}],basis:[{basis:[Co,"full","auto",u,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[He,Co,"auto","initial","none",Oe]}],grow:[{grow:["",He,je,Oe]}],shrink:[{shrink:["",He,je,Oe]}],order:[{order:[Fi,"first","last","none",je,Oe]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:K()}],mx:[{mx:K()}],my:[{my:K()}],ms:[{ms:K()}],me:[{me:K()}],mt:[{mt:K()}],mr:[{mr:K()}],mb:[{mb:K()}],ml:[{ml:K()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],w:[{w:[u,"screen",...X()]}],"min-w":[{"min-w":[u,"screen","none",...X()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[s]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",r,Rl,ba]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,je,Hv]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Wv,Oe]}],"font-family":[{font:[h6,Oe,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,je,Oe]}],"line-clamp":[{"line-clamp":[He,"none",je,Hv]}],leading:[{leading:[a,...R()]}],"list-image":[{"list-image":["none",je,Oe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",je,Oe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...pe(),"wavy"]}],"text-decoration-thickness":[{decoration:[He,"from-font","auto",je,ba]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[He,"auto",je,Oe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",je,Oe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",je,Oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Z()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Fi,je,Oe],radial:["",je,Oe],conic:[Fi,je,Oe]},m6,d6]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:$()}],"gradient-via-pos":[{via:$()}],"gradient-to-pos":[{to:$()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:Q()}],"rounded-s":[{"rounded-s":Q()}],"rounded-e":[{"rounded-e":Q()}],"rounded-t":[{"rounded-t":Q()}],"rounded-r":[{"rounded-r":Q()}],"rounded-b":[{"rounded-b":Q()}],"rounded-l":[{"rounded-l":Q()}],"rounded-ss":[{"rounded-ss":Q()}],"rounded-se":[{"rounded-se":Q()}],"rounded-ee":[{"rounded-ee":Q()}],"rounded-es":[{"rounded-es":Q()}],"rounded-tl":[{"rounded-tl":Q()}],"rounded-tr":[{"rounded-tr":Q()}],"rounded-br":[{"rounded-br":Q()}],"rounded-bl":[{"rounded-bl":Q()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...pe(),"hidden","none"]}],"divide-style":[{divide:[...pe(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...pe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[He,je,Oe]}],"outline-w":[{outline:["",He,Rl,ba]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",d,Sf,_f]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",h,Sf,_f]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[He,ba]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",m,Sf,_f]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[He,je,Oe]}],"mix-blend":[{"mix-blend":[...ye(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ye()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[He]}],"mask-image-linear-from-pos":[{"mask-linear-from":oe()}],"mask-image-linear-to-pos":[{"mask-linear-to":oe()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":oe()}],"mask-image-t-to-pos":[{"mask-t-to":oe()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":oe()}],"mask-image-r-to-pos":[{"mask-r-to":oe()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":oe()}],"mask-image-b-to-pos":[{"mask-b-to":oe()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":oe()}],"mask-image-l-to-pos":[{"mask-l-to":oe()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":oe()}],"mask-image-x-to-pos":[{"mask-x-to":oe()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":oe()}],"mask-image-y-to-pos":[{"mask-y-to":oe()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[je,Oe]}],"mask-image-radial-from-pos":[{"mask-radial-from":oe()}],"mask-image-radial-to-pos":[{"mask-radial-to":oe()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[He]}],"mask-image-conic-from-pos":[{"mask-conic-from":oe()}],"mask-image-conic-to-pos":[{"mask-conic-to":oe()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Z()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",je,Oe]}],filter:[{filter:["","none",je,Oe]}],blur:[{blur:me()}],brightness:[{brightness:[He,je,Oe]}],contrast:[{contrast:[He,je,Oe]}],"drop-shadow":[{"drop-shadow":["","none",g,Sf,_f]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",He,je,Oe]}],"hue-rotate":[{"hue-rotate":[He,je,Oe]}],invert:[{invert:["",He,je,Oe]}],saturate:[{saturate:[He,je,Oe]}],sepia:[{sepia:["",He,je,Oe]}],"backdrop-filter":[{"backdrop-filter":["","none",je,Oe]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[He,je,Oe]}],"backdrop-contrast":[{"backdrop-contrast":[He,je,Oe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",He,je,Oe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[He,je,Oe]}],"backdrop-invert":[{"backdrop-invert":["",He,je,Oe]}],"backdrop-opacity":[{"backdrop-opacity":[He,je,Oe]}],"backdrop-saturate":[{"backdrop-saturate":[He,je,Oe]}],"backdrop-sepia":[{"backdrop-sepia":["",He,je,Oe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",je,Oe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[He,"initial",je,Oe]}],ease:[{ease:["linear","initial",S,je,Oe]}],delay:[{delay:[He,je,Oe]}],animate:[{animate:["none",O,je,Oe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,je,Oe]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:ue()}],"scale-x":[{"scale-x":ue()}],"scale-y":[{"scale-y":ue()}],"scale-z":[{"scale-z":ue()}],"scale-3d":["scale-3d"],skew:[{skew:ve()}],"skew-x":[{"skew-x":ve()}],"skew-y":[{"skew-y":ve()}],transform:[{transform:[je,Oe,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:re()}],"translate-x":[{"translate-x":re()}],"translate-y":[{"translate-y":re()}],"translate-z":[{"translate-z":re()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",je,Oe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",je,Oe]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[He,Rl,ba,Hv]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},x6=Z8(y6);function Ie(...e){return x6(Ue(e))}var Kc=cR();const b6=it(Kc);function Rj(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Rs(...e){return t=>{let r=!1;const n=e.map(i=>{const a=Rj(i,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let i=0;i{const{children:a,...s}=n,u=P.Children.toArray(a),f=u.find(O6);if(f){const c=f.props.children,d=u.map(h=>h===f?P.Children.count(c)>1?P.Children.only(null):P.isValidElement(c)?c.props.children:null:h);return p.jsx(t,{...s,ref:i,children:P.isValidElement(c)?P.cloneElement(c,void 0,d):null})}return p.jsx(t,{...s,ref:i,children:a})});return r.displayName=`${e}.Slot`,r}function _6(e){const t=P.forwardRef((r,n)=>{const{children:i,...a}=r;if(P.isValidElement(i)){const s=E6(i),u=j6(a,i.props);return i.type!==P.Fragment&&(u.ref=n?Rs(n,s):s),P.cloneElement(i,u)}return P.Children.count(i)>1?P.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var S6=Symbol("radix.slottable");function O6(e){return P.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===S6}function j6(e,t){const r={...t};for(const n in t){const i=e[n],a=t[n];/^on[A-Z]/.test(n)?i&&a?r[n]=(...u)=>{const f=a(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...a}:n==="className"&&(r[n]=[i,a].filter(Boolean).join(" "))}return{...e,...r}}function E6(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 A6=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],We=A6.reduce((e,t)=>{const r=w6(`Primitive.${t}`),n=P.forwardRef((i,a)=>{const{asChild:s,...u}=i,f=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(f,{...u,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function P6(e,t){e&&Kc.flushSync(()=>e.dispatchEvent(t))}var Rt=globalThis?.document?P.useLayoutEffect:()=>{};function N6(e,t){return P.useReducer((r,n)=>t[r][n]??r,e)}var Un=e=>{const{present:t,children:r}=e,n=C6(t),i=typeof r=="function"?r({present:n.isPresent}):P.Children.only(r),a=Je(n.ref,T6(i));return typeof r=="function"||n.isPresent?P.cloneElement(i,{ref:a}):null};Un.displayName="Presence";function C6(e){const[t,r]=P.useState(),n=P.useRef(null),i=P.useRef(e),a=P.useRef("none"),s=e?"mounted":"unmounted",[u,f]=N6(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return P.useEffect(()=>{const c=Of(n.current);a.current=u==="mounted"?c:"none"},[u]),Rt(()=>{const c=n.current,d=i.current;if(d!==e){const m=a.current,g=Of(c);e?f("MOUNT"):g==="none"||c?.display==="none"?f("UNMOUNT"):f(d&&m!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,f]),Rt(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,h=g=>{const y=Of(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&y&&(f("ANIMATION_END"),!i.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},m=g=>{g.target===t&&(a.current=Of(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:P.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function Of(e){return e?.animationName||"none"}function T6(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 k6(e,t){const r=P.createContext(t),n=a=>{const{children:s,...u}=a,f=P.useMemo(()=>u,Object.values(u));return p.jsx(r.Provider,{value:f,children:s})};n.displayName=e+"Provider";function i(a){const s=P.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[n,i]}function gi(e,t=[]){let r=[];function n(a,s){const u=P.createContext(s),f=r.length;r=[...r,s];const c=h=>{const{scope:m,children:g,...b}=h,y=m?.[e]?.[f]||u,w=P.useMemo(()=>b,Object.values(b));return p.jsx(y.Provider,{value:w,children:g})};c.displayName=a+"Provider";function d(h,m){const g=m?.[e]?.[f]||u,b=P.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${a}\``)}return[c,d]}const i=()=>{const a=r.map(s=>P.createContext(s));return function(u){const f=u?.[e]||a;return P.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return i.scopeName=e,[n,R6(i,...t)]}function R6(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=n.reduce((u,{useScope:f,scopeName:c})=>{const h=f(a)[`__scope${c}`];return{...u,...h}},{});return P.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}function ar(e){const t=P.useRef(e);return P.useEffect(()=>{t.current=e}),P.useMemo(()=>(...r)=>t.current?.(...r),[])}var M6=P.createContext(void 0);function Kh(e){const t=P.useContext(M6);return e||t||"ltr"}function hb(e,[t,r]){return Math.min(r,Math.max(t,e))}function Fe(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e?.(i),r===!1||!i.defaultPrevented)return t?.(i)}}function I6(e,t){return P.useReducer((r,n)=>t[r][n]??r,e)}var ew="ScrollArea",[TR]=gi(ew),[D6,on]=TR(ew),kR=P.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:i,scrollHideDelay:a=600,...s}=e,[u,f]=P.useState(null),[c,d]=P.useState(null),[h,m]=P.useState(null),[g,b]=P.useState(null),[y,w]=P.useState(null),[S,O]=P.useState(0),[E,C]=P.useState(0),[A,N]=P.useState(!1),[T,R]=P.useState(!1),I=Je(t,L=>f(L)),q=Kh(i);return p.jsx(D6,{scope:r,type:n,dir:q,scrollHideDelay:a,scrollArea:u,viewport:c,onViewportChange:d,content:h,onContentChange:m,scrollbarX:g,onScrollbarXChange:b,scrollbarXEnabled:A,onScrollbarXEnabledChange:N,scrollbarY:y,onScrollbarYChange:w,scrollbarYEnabled:T,onScrollbarYEnabledChange:R,onCornerWidthChange:O,onCornerHeightChange:C,children:p.jsx(We.div,{dir:q,...s,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":E+"px",...e.style}})})});kR.displayName=ew;var RR="ScrollAreaViewport",MR=P.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:i,...a}=e,s=on(RR,r),u=P.useRef(null),f=Je(t,u,s.onViewportChange);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),p.jsx(We.div,{"data-radix-scroll-area-viewport":"",...a,ref:f,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:p.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});MR.displayName=RR;var Wn="ScrollAreaScrollbar",IR=P.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=on(Wn,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:s}=i,u=e.orientation==="horizontal";return P.useEffect(()=>(u?a(!0):s(!0),()=>{u?a(!1):s(!1)}),[u,a,s]),i.type==="hover"?p.jsx(L6,{...n,ref:t,forceMount:r}):i.type==="scroll"?p.jsx($6,{...n,ref:t,forceMount:r}):i.type==="auto"?p.jsx(DR,{...n,ref:t,forceMount:r}):i.type==="always"?p.jsx(tw,{...n,ref:t}):null});IR.displayName=Wn;var L6=P.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=on(Wn,e.__scopeScrollArea),[a,s]=P.useState(!1);return P.useEffect(()=>{const u=i.scrollArea;let f=0;if(u){const c=()=>{window.clearTimeout(f),s(!0)},d=()=>{f=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return u.addEventListener("pointerenter",c),u.addEventListener("pointerleave",d),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",c),u.removeEventListener("pointerleave",d)}}},[i.scrollArea,i.scrollHideDelay]),p.jsx(Un,{present:r||a,children:p.jsx(DR,{"data-state":a?"visible":"hidden",...n,ref:t})})}),$6=P.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=on(Wn,e.__scopeScrollArea),a=e.orientation==="horizontal",s=Yh(()=>f("SCROLL_END"),100),[u,f]=I6("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return P.useEffect(()=>{if(u==="idle"){const c=window.setTimeout(()=>f("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(c)}},[u,i.scrollHideDelay,f]),P.useEffect(()=>{const c=i.viewport,d=a?"scrollLeft":"scrollTop";if(c){let h=c[d];const m=()=>{const g=c[d];h!==g&&(f("SCROLL"),s()),h=g};return c.addEventListener("scroll",m),()=>c.removeEventListener("scroll",m)}},[i.viewport,a,f,s]),p.jsx(Un,{present:r||u!=="hidden",children:p.jsx(tw,{"data-state":u==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:Fe(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:Fe(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),DR=P.forwardRef((e,t)=>{const r=on(Wn,e.__scopeScrollArea),{forceMount:n,...i}=e,[a,s]=P.useState(!1),u=e.orientation==="horizontal",f=Yh(()=>{if(r.viewport){const c=r.viewport.offsetWidth{const{orientation:r="vertical",...n}=e,i=on(Wn,e.__scopeScrollArea),a=P.useRef(null),s=P.useRef(0),[u,f]=P.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=FR(u.viewport,u.content),d={...n,sizes:u,onSizesChange:f,hasThumb:c>0&&c<1,onThumbChange:m=>a.current=m,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:m=>s.current=m};function h(m,g){return W6(m,s.current,u,g)}return r==="horizontal"?p.jsx(B6,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const m=i.viewport.scrollLeft,g=Mj(m,u,i.dir);a.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollLeft=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollLeft=h(m,i.dir))}}):r==="vertical"?p.jsx(z6,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const m=i.viewport.scrollTop,g=Mj(m,u);a.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollTop=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollTop=h(m))}}):null}),B6=P.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...i}=e,a=on(Wn,e.__scopeScrollArea),[s,u]=P.useState(),f=P.useRef(null),c=Je(t,f,a.onScrollbarXChange);return P.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),p.jsx($R,{"data-orientation":"horizontal",...i,ref:c,sizes:r,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Xh(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,h)=>{if(a.viewport){const m=a.viewport.scrollLeft+d.deltaX;e.onWheelScroll(m),UR(m,h)&&d.preventDefault()}},onResize:()=>{f.current&&a.viewport&&s&&n({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:Rd(s.paddingLeft),paddingEnd:Rd(s.paddingRight)}})}})}),z6=P.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...i}=e,a=on(Wn,e.__scopeScrollArea),[s,u]=P.useState(),f=P.useRef(null),c=Je(t,f,a.onScrollbarYChange);return P.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),p.jsx($R,{"data-orientation":"vertical",...i,ref:c,sizes:r,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Xh(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,h)=>{if(a.viewport){const m=a.viewport.scrollTop+d.deltaY;e.onWheelScroll(m),UR(m,h)&&d.preventDefault()}},onResize:()=>{f.current&&a.viewport&&s&&n({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:Rd(s.paddingTop),paddingEnd:Rd(s.paddingBottom)}})}})}),[F6,LR]=TR(Wn),$R=P.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:i,onThumbChange:a,onThumbPointerUp:s,onThumbPointerDown:u,onThumbPositionChange:f,onDragScroll:c,onWheelScroll:d,onResize:h,...m}=e,g=on(Wn,r),[b,y]=P.useState(null),w=Je(t,I=>y(I)),S=P.useRef(null),O=P.useRef(""),E=g.viewport,C=n.content-n.viewport,A=ar(d),N=ar(f),T=Yh(h,10);function R(I){if(S.current){const q=I.clientX-S.current.left,L=I.clientY-S.current.top;c({x:q,y:L})}}return P.useEffect(()=>{const I=q=>{const L=q.target;b?.contains(L)&&A(q,C)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[E,b,C,A]),P.useEffect(N,[n,N]),is(b,T),is(g.content,T),p.jsx(F6,{scope:r,scrollbar:b,hasThumb:i,onThumbChange:ar(a),onThumbPointerUp:ar(s),onThumbPositionChange:N,onThumbPointerDown:ar(u),children:p.jsx(We.div,{...m,ref:w,style:{position:"absolute",...m.style},onPointerDown:Fe(e.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),S.current=b.getBoundingClientRect(),O.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),R(I))}),onPointerMove:Fe(e.onPointerMove,R),onPointerUp:Fe(e.onPointerUp,I=>{const q=I.target;q.hasPointerCapture(I.pointerId)&&q.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=O.current,g.viewport&&(g.viewport.style.scrollBehavior=""),S.current=null})})})}),kd="ScrollAreaThumb",BR=P.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=LR(kd,e.__scopeScrollArea);return p.jsx(Un,{present:r||i.hasThumb,children:p.jsx(q6,{ref:t,...n})})}),q6=P.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...i}=e,a=on(kd,r),s=LR(kd,r),{onThumbPositionChange:u}=s,f=Je(t,h=>s.onThumbChange(h)),c=P.useRef(void 0),d=Yh(()=>{c.current&&(c.current(),c.current=void 0)},100);return P.useEffect(()=>{const h=a.viewport;if(h){const m=()=>{if(d(),!c.current){const g=H6(h,u);c.current=g,u()}};return u(),h.addEventListener("scroll",m),()=>h.removeEventListener("scroll",m)}},[a.viewport,d,u]),p.jsx(We.div,{"data-state":s.hasThumb?"visible":"hidden",...i,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:Fe(e.onPointerDownCapture,h=>{const g=h.target.getBoundingClientRect(),b=h.clientX-g.left,y=h.clientY-g.top;s.onThumbPointerDown({x:b,y})}),onPointerUp:Fe(e.onPointerUp,s.onThumbPointerUp)})});BR.displayName=kd;var rw="ScrollAreaCorner",zR=P.forwardRef((e,t)=>{const r=on(rw,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?p.jsx(U6,{...e,ref:t}):null});zR.displayName=rw;var U6=P.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,i=on(rw,r),[a,s]=P.useState(0),[u,f]=P.useState(0),c=!!(a&&u);return is(i.scrollbarX,()=>{const d=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(d),f(d)}),is(i.scrollbarY,()=>{const d=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(d),s(d)}),c?p.jsx(We.div,{...n,ref:t,style:{width:a,height:u,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Rd(e){return e?parseInt(e,10):0}function FR(e,t){const r=e/t;return isNaN(r)?0:r}function Xh(e){const t=FR(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function W6(e,t,r,n="ltr"){const i=Xh(r),a=i/2,s=t||a,u=i-s,f=r.scrollbar.paddingStart+s,c=r.scrollbar.size-r.scrollbar.paddingEnd-u,d=r.content-r.viewport,h=n==="ltr"?[0,d]:[d*-1,0];return qR([f,c],h)(e)}function Mj(e,t,r="ltr"){const n=Xh(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,s=t.content-t.viewport,u=a-n,f=r==="ltr"?[0,s]:[s*-1,0],c=hb(e,f);return qR([0,s],[0,u])(c)}function qR(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function UR(e,t){return e>0&&e{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return(function i(){const a={left:e.scrollLeft,top:e.scrollTop},s=r.left!==a.left,u=r.top!==a.top;(s||u)&&t(),r=a,n=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(n)};function Yh(e,t){const r=ar(e),n=P.useRef(0);return P.useEffect(()=>()=>window.clearTimeout(n.current),[]),P.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function is(e,t){const r=ar(t);Rt(()=>{let n=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return i.observe(e),()=>{window.cancelAnimationFrame(n),i.unobserve(e)}}},[e,r])}var V6=kR,G6=MR,K6=zR;function fc({className:e,children:t,...r}){return p.jsxs(V6,{"data-slot":"scroll-area",className:Ie("relative",e),...r,children:[p.jsx(G6,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),p.jsx(X6,{}),p.jsx(K6,{})]})}function X6({className:e,orientation:t="vertical",...r}){return p.jsx(IR,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Ie("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...r,children:p.jsx(BR,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}const Y6="/assets/773f0c39e1986271e9144596caac519f934a6ae6-Cou8J2R8.png";function Q6({currentView:e,setCurrentView:t}){const[r,n]=P.useState(!0),i=[{name:"Dashboard",icon:qB,type:"item"},{type:"header",name:"MODULES"},{name:"Labeling",icon:fb,type:"sub",isOpen:r,toggle:()=>n(!r),children:[{name:"Labels",icon:fb},{name:"Label Categories",icon:zB},{name:"Label Types",icon:Z1},{name:"Label Templates",icon:MB},{name:"Multiple Options",icon:vR}]},{type:"header",name:"MANAGEMENT"},{name:"Location Manager",icon:Gh,type:"item"},{name:"Account Management",icon:gR,type:"item"},{name:"Menu Manager",icon:ub,type:"item"},{name:"Reports",icon:uc,type:"item"},{name:"Support",icon:cb,type:"item"},{name:"Log Out",icon:VB,type:"item"}];return p.jsxs("div",{className:"w-64 bg-[#1e3a8a] text-white flex flex-col h-screen border-r border-blue-800 shadow-xl z-20 shrink-0",children:[p.jsx("div",{className:"flex items-center justify-center border-b border-blue-800/50 bg-white px-4 shrink-0",style:{height:90},children:p.jsx("img",{src:Y6,alt:"MedVantage",className:"h-16 w-auto object-contain"})}),p.jsx(fc,{className:"flex-1 py-4",children:p.jsx("div",{className:"px-3 space-y-1",children:i.map((a,s)=>a.type==="header"?p.jsx("div",{className:"px-4 py-2 mt-4 text-xs font-semibold text-blue-300 uppercase tracking-wider",children:a.name},s):a.type==="sub"?p.jsxs("div",{className:"space-y-1",children:[p.jsxs("button",{onClick:a.toggle,className:Ie("w-full flex items-center justify-between px-4 py-2.5 text-sm font-medium rounded-lg transition-colors","hover:bg-blue-800/50 text-blue-100"),children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(a.icon,{className:"w-4 h-4"}),a.name]}),a.isOpen?p.jsx(cc,{className:"w-4 h-4"}):p.jsx(Cd,{className:"w-4 h-4"})]}),a.isOpen&&p.jsx("div",{className:"pl-4 space-y-1",children:a.children?.map((u,f)=>p.jsxs("button",{onClick:()=>t(u.name),className:Ie("w-full flex items-center gap-3 px-4 py-2 text-sm font-medium rounded-lg transition-colors border-l-2",e===u.name?"bg-blue-800 border-blue-400 text-white":"border-transparent hover:bg-blue-800/30 text-blue-200 hover:text-white"),children:[p.jsx("div",{className:"w-1 h-1 rounded-full bg-current"}),u.name]},f))})]},s):p.jsxs("button",{onClick:()=>t(a.name),className:Ie("w-full flex items-center gap-3 px-4 py-2.5 text-sm font-medium rounded-lg transition-colors",e===a.name?"bg-blue-700 text-white shadow-md shadow-blue-900/20":a.name==="Log Out"?"text-red-300 hover:bg-red-900/20 hover:text-red-200":"text-blue-100 hover:bg-blue-800 hover:text-white"),children:[p.jsx(a.icon,{className:"w-4 h-4"}),a.name]},s))})})]})}function $e({className:e,type:t,...r}){return p.jsx("input",{type:t,"data-slot":"input",className:Ie("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}var Z6=Symbol.for("react.lazy"),Md=X1[" use ".trim().toString()];function J6(e){return typeof e=="object"&&e!==null&&"then"in e}function WR(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Z6&&"_payload"in e&&J6(e._payload)}function nw(e){const t=ez(e),r=P.forwardRef((n,i)=>{let{children:a,...s}=n;WR(a)&&typeof Md=="function"&&(a=Md(a._payload));const u=P.Children.toArray(a),f=u.find(rz);if(f){const c=f.props.children,d=u.map(h=>h===f?P.Children.count(c)>1?P.Children.only(null):P.isValidElement(c)?c.props.children:null:h);return p.jsx(t,{...s,ref:i,children:P.isValidElement(c)?P.cloneElement(c,void 0,d):null})}return p.jsx(t,{...s,ref:i,children:a})});return r.displayName=`${e}.Slot`,r}var HR=nw("Slot");function ez(e){const t=P.forwardRef((r,n)=>{let{children:i,...a}=r;if(WR(i)&&typeof Md=="function"&&(i=Md(i._payload)),P.isValidElement(i)){const s=iz(i),u=nz(a,i.props);return i.type!==P.Fragment&&(u.ref=n?Rs(n,s):s),P.cloneElement(i,u)}return P.Children.count(i)>1?P.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tz=Symbol("radix.slottable");function rz(e){return P.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tz}function nz(e,t){const r={...t};for(const n in t){const i=e[n],a=t[n];/^on[A-Z]/.test(n)?i&&a?r[n]=(...u)=>{const f=a(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...a}:n==="className"&&(r[n]=[i,a].filter(Boolean).join(" "))}return{...e,...r}}function iz(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)}const Ij=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Dj=Ue,VR=(e,t)=>r=>{var n;if(t?.variants==null)return Dj(e,r?.class,r?.className);const{variants:i,defaultVariants:a}=t,s=Object.keys(i).map(c=>{const d=r?.[c],h=a?.[c];if(d===null)return null;const m=Ij(d)||Ij(h);return i[c][m]}),u=r&&Object.entries(r).reduce((c,d)=>{let[h,m]=d;return m===void 0||(c[h]=m),c},{}),f=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,d)=>{let{class:h,className:m,...g}=d;return Object.entries(g).every(b=>{let[y,w]=b;return Array.isArray(w)?w.includes({...a,...u}[y]):{...a,...u}[y]===w})?[...c,h,m]:c},[]);return Dj(e,s,f,r?.class,r?.className)},az=VR("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background text-foreground hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9 rounded-md"}},defaultVariants:{variant:"default",size:"default"}});function Ne({className:e,variant:t,size:r,asChild:n=!1,...i}){const a=n?HR:"button";return p.jsx(a,{"data-slot":"button",className:Ie(az({variant:t,size:r,className:e})),...i})}function oz(e,t=[]){let r=[];function n(a,s){const u=P.createContext(s);u.displayName=a+"Context";const f=r.length;r=[...r,s];const c=h=>{const{scope:m,children:g,...b}=h,y=m?.[e]?.[f]||u,w=P.useMemo(()=>b,Object.values(b));return p.jsx(y.Provider,{value:w,children:g})};c.displayName=a+"Provider";function d(h,m){const g=m?.[e]?.[f]||u,b=P.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${a}\``)}return[c,d]}const i=()=>{const a=r.map(s=>P.createContext(s));return function(u){const f=u?.[e]||a;return P.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return i.scopeName=e,[n,sz(i,...t)]}function sz(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=n.reduce((u,{useScope:f,scopeName:c})=>{const h=f(a)[`__scope${c}`];return{...u,...h}},{});return P.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var lz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],iw=lz.reduce((e,t)=>{const r=nw(`Primitive.${t}`),n=P.forwardRef((i,a)=>{const{asChild:s,...u}=i,f=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(f,{...u,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Vv={exports:{}},Gv={};/** - * @license React - * use-sync-external-store-shim.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Lj;function cz(){if(Lj)return Gv;Lj=1;var e=Vh();function t(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,i=e.useEffect,a=e.useLayoutEffect,s=e.useDebugValue;function u(h,m){var g=m(),b=n({inst:{value:g,getSnapshot:m}}),y=b[0].inst,w=b[1];return a(function(){y.value=g,y.getSnapshot=m,f(y)&&w({inst:y})},[h,g,m]),i(function(){return f(y)&&w({inst:y}),h(function(){f(y)&&w({inst:y})})},[h]),s(g),g}function f(h){var m=h.getSnapshot;h=h.value;try{var g=m();return!r(h,g)}catch{return!0}}function c(h,m){return m()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:u;return Gv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,Gv}var $j;function uz(){return $j||($j=1,Vv.exports=cz()),Vv.exports}var fz=uz();function dz(){return fz.useSyncExternalStore(hz,()=>!0,()=>!1)}function hz(){return()=>{}}var aw="Avatar",[pz]=oz(aw),[mz,GR]=pz(aw),KR=P.forwardRef((e,t)=>{const{__scopeAvatar:r,...n}=e,[i,a]=P.useState("idle");return p.jsx(mz,{scope:r,imageLoadingStatus:i,onImageLoadingStatusChange:a,children:p.jsx(iw.span,{...n,ref:t})})});KR.displayName=aw;var XR="AvatarImage",YR=P.forwardRef((e,t)=>{const{__scopeAvatar:r,src:n,onLoadingStatusChange:i=()=>{},...a}=e,s=GR(XR,r),u=vz(n,a),f=ar(c=>{i(c),s.onImageLoadingStatusChange(c)});return Rt(()=>{u!=="idle"&&f(u)},[u,f]),u==="loaded"?p.jsx(iw.img,{...a,ref:t,src:n}):null});YR.displayName=XR;var QR="AvatarFallback",ZR=P.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:n,...i}=e,a=GR(QR,r),[s,u]=P.useState(n===void 0);return P.useEffect(()=>{if(n!==void 0){const f=window.setTimeout(()=>u(!0),n);return()=>window.clearTimeout(f)}},[n]),s&&a.imageLoadingStatus!=="loaded"?p.jsx(iw.span,{...i,ref:t}):null});ZR.displayName=QR;function Bj(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function vz(e,{referrerPolicy:t,crossOrigin:r}){const n=dz(),i=P.useRef(null),a=n?(i.current||(i.current=new window.Image),i.current):null,[s,u]=P.useState(()=>Bj(a,e));return Rt(()=>{u(Bj(a,e))},[a,e]),Rt(()=>{const f=h=>()=>{u(h)};if(!a)return;const c=f("loaded"),d=f("error");return a.addEventListener("load",c),a.addEventListener("error",d),t&&(a.referrerPolicy=t),typeof r=="string"&&(a.crossOrigin=r),()=>{a.removeEventListener("load",c),a.removeEventListener("error",d)}},[a,r,t]),s}var gz=KR,yz=YR,xz=ZR;function bz({className:e,...t}){return p.jsx(gz,{"data-slot":"avatar",className:Ie("relative flex size-10 shrink-0 overflow-hidden rounded-full",e),...t})}function wz({className:e,...t}){return p.jsx(yz,{"data-slot":"avatar-image",className:Ie("aspect-square size-full",e),...t})}function _z({className:e,...t}){return p.jsx(xz,{"data-slot":"avatar-fallback",className:Ie("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}function Sz({title:e}){const t=new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"});return p.jsxs("header",{className:"bg-white border-b border-gray-200 px-8 flex items-center justify-between shadow-sm sticky top-0 z-10 shrink-0",style:{height:90},children:[p.jsxs("div",{children:[p.jsxs("h1",{className:"text-2xl font-bold",style:{color:"rgb(43, 50, 143)"},children:[e," Overview"]}),p.jsxs("p",{className:"text-sm text-gray-500 mt-1 flex items-center gap-2",children:[t," | Last updated: Just now"]})]}),p.jsxs("div",{className:"flex items-center gap-4",children:[p.jsxs("div",{className:"flex items-center w-64 h-9 rounded-md border border-gray-200 bg-gray-50 focus-within:bg-white focus-within:ring-2 focus-within:ring-ring/50 focus-within:border-ring transition-colors overflow-hidden",children:[p.jsx(Q1,{className:"h-4 w-4 text-gray-400 shrink-0 ml-3 pointer-events-none"}),p.jsx($e,{type:"search",placeholder:"Search...",className:"flex-1 min-w-0 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 py-2 px-2 h-full"})]}),p.jsx(Ne,{variant:"ghost",size:"icon",className:"text-gray-500 hover:text-gray-700",children:p.jsx(vR,{className:"w-5 h-5"})}),p.jsx("div",{className:"h-8 w-px bg-gray-200 mx-2"}),p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsxs("div",{className:"text-right hidden md:block",children:[p.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Admin User"}),p.jsx("div",{className:"text-xs text-gray-500",children:"Administrator"})]}),p.jsxs(bz,{className:"h-10 w-10 border border-gray-200",children:[p.jsx(wz,{src:"https://github.com/shadcn.png"}),p.jsx(_z,{children:"AD"})]})]})]})]})}function Oz({children:e,currentView:t,setCurrentView:r}){return p.jsxs("div",{className:"flex h-screen bg-gray-50 overflow-hidden font-sans",children:[p.jsx(Q6,{currentView:t,setCurrentView:r}),p.jsxs("div",{className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:[p.jsx(Sz,{title:t}),p.jsx("div",{className:"px-8 mt-8 shrink-0",children:p.jsxs("nav",{className:"flex items-center gap-2 text-sm font-normal","aria-label":"Breadcrumb",children:[p.jsx("button",{type:"button",onClick:()=>r("Dashboard"),className:"text-gray-500 hover:text-gray-700 transition-colors",children:"Home"}),p.jsx(Cd,{className:"w-4 h-4 text-gray-500 shrink-0"}),p.jsx("span",{style:{color:"rgb(43, 50, 143)"},children:t})]})}),p.jsx("main",{className:"flex-1 overflow-y-auto p-8",children:p.jsx("div",{className:"w-full h-full",children:e})})]})]})}function Ir({className:e,...t}){return p.jsx("div",{"data-slot":"card",className:Ie("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border",e),...t})}function yn({className:e,...t}){return p.jsx("div",{"data-slot":"card-header",className:Ie("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 pt-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function xn({className:e,...t}){return p.jsx("h4",{"data-slot":"card-title",className:Ie("leading-none",e),...t})}function Id({className:e,...t}){return p.jsx("p",{"data-slot":"card-description",className:Ie("text-muted-foreground",e),...t})}function tn({className:e,...t}){return p.jsx("div",{"data-slot":"card-content",className:Ie("px-6 [&:last-child]:pb-6",e),...t})}const jz=VR("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Rn({className:e,variant:t,asChild:r=!1,...n}){const i=r?HR:"span";return p.jsx(i,{"data-slot":"badge",className:Ie(jz({variant:t}),e),...n})}var Kv,zj;function Sr(){if(zj)return Kv;zj=1;var e=Array.isArray;return Kv=e,Kv}var Xv,Fj;function JR(){if(Fj)return Xv;Fj=1;var e=typeof bf=="object"&&bf&&bf.Object===Object&&bf;return Xv=e,Xv}var Yv,qj;function Hn(){if(qj)return Yv;qj=1;var e=JR(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return Yv=r,Yv}var Qv,Uj;function Xc(){if(Uj)return Qv;Uj=1;var e=Hn(),t=e.Symbol;return Qv=t,Qv}var Zv,Wj;function Ez(){if(Wj)return Zv;Wj=1;var e=Xc(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;function a(s){var u=r.call(s,i),f=s[i];try{s[i]=void 0;var c=!0}catch{}var d=n.call(s);return c&&(u?s[i]=f:delete s[i]),d}return Zv=a,Zv}var Jv,Hj;function Az(){if(Hj)return Jv;Hj=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return Jv=r,Jv}var eg,Vj;function yi(){if(Vj)return eg;Vj=1;var e=Xc(),t=Ez(),r=Az(),n="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function s(u){return u==null?u===void 0?i:n:a&&a in Object(u)?t(u):r(u)}return eg=s,eg}var tg,Gj;function xi(){if(Gj)return tg;Gj=1;function e(t){return t!=null&&typeof t=="object"}return tg=e,tg}var rg,Kj;function Ms(){if(Kj)return rg;Kj=1;var e=yi(),t=xi(),r="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&e(i)==r}return rg=n,rg}var ng,Xj;function ow(){if(Xj)return ng;Xj=1;var e=Sr(),t=Ms(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,s){if(e(a))return!1;var u=typeof a;return u=="number"||u=="symbol"||u=="boolean"||a==null||t(a)?!0:n.test(a)||!r.test(a)||s!=null&&a in Object(s)}return ng=i,ng}var ig,Yj;function Qi(){if(Yj)return ig;Yj=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return ig=e,ig}var ag,Qj;function sw(){if(Qj)return ag;Qj=1;var e=yi(),t=Qi(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function s(u){if(!t(u))return!1;var f=e(u);return f==n||f==i||f==r||f==a}return ag=s,ag}var og,Zj;function Pz(){if(Zj)return og;Zj=1;var e=Hn(),t=e["__core-js_shared__"];return og=t,og}var sg,Jj;function Nz(){if(Jj)return sg;Jj=1;var e=Pz(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return sg=r,sg}var lg,eE;function eM(){if(eE)return lg;eE=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return lg=r,lg}var cg,tE;function Cz(){if(tE)return cg;tE=1;var e=sw(),t=Nz(),r=Qi(),n=eM(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,s=Function.prototype,u=Object.prototype,f=s.toString,c=u.hasOwnProperty,d=RegExp("^"+f.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(m){if(!r(m)||t(m))return!1;var g=e(m)?d:a;return g.test(n(m))}return cg=h,cg}var ug,rE;function Tz(){if(rE)return ug;rE=1;function e(t,r){return t?.[r]}return ug=e,ug}var fg,nE;function Ya(){if(nE)return fg;nE=1;var e=Cz(),t=Tz();function r(n,i){var a=t(n,i);return e(a)?a:void 0}return fg=r,fg}var dg,iE;function Qh(){if(iE)return dg;iE=1;var e=Ya(),t=e(Object,"create");return dg=t,dg}var hg,aE;function kz(){if(aE)return hg;aE=1;var e=Qh();function t(){this.__data__=e?e(null):{},this.size=0}return hg=t,hg}var pg,oE;function Rz(){if(oE)return pg;oE=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return pg=e,pg}var mg,sE;function Mz(){if(sE)return mg;sE=1;var e=Qh(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var s=this.__data__;if(e){var u=s[a];return u===t?void 0:u}return n.call(s,a)?s[a]:void 0}return mg=i,mg}var vg,lE;function Iz(){if(lE)return vg;lE=1;var e=Qh(),t=Object.prototype,r=t.hasOwnProperty;function n(i){var a=this.__data__;return e?a[i]!==void 0:r.call(a,i)}return vg=n,vg}var gg,cE;function Dz(){if(cE)return gg;cE=1;var e=Qh(),t="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=e&&i===void 0?t:i,this}return gg=r,gg}var yg,uE;function Lz(){if(uE)return yg;uE=1;var e=kz(),t=Rz(),r=Mz(),n=Iz(),i=Dz();function a(s){var u=-1,f=s==null?0:s.length;for(this.clear();++u-1}return Og=t,Og}var jg,gE;function qz(){if(gE)return jg;gE=1;var e=Zh();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return jg=t,jg}var Eg,yE;function Jh(){if(yE)return Eg;yE=1;var e=$z(),t=Bz(),r=zz(),n=Fz(),i=qz();function a(s){var u=-1,f=s==null?0:s.length;for(this.clear();++u0?1:-1},Na=function(t){return Da(t)&&t.indexOf("%")===t.length-1},he=function(t){return fF(t)&&!Yc(t)},dF=function(t){return qe(t)},zt=function(t){return he(t)||Da(t)},hF=0,Ds=function(t){var r=++hF;return"".concat(t||"").concat(r)},ur=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!he(t)&&!Da(t))return n;var a;if(Na(t)){var s=t.indexOf("%");a=r*parseFloat(t.slice(0,s))/100}else a=+t;return Yc(a)&&(a=n),i&&a>r&&(a=r),a},Wi=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},pF=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function wF(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 mb(e){"@babel/helpers - typeof";return mb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mb(e)}var VE={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},ci=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},GE=null,Zg=null,pw=function e(t){if(t===GE&&Array.isArray(Zg))return Zg;var r=[];return P.Children.forEach(t,function(n){qe(n)||(sF.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),Zg=r,GE=t,r};function Fr(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return ci(i)}):n=[ci(t)],pw(e).forEach(function(i){var a=zr(i,"type.displayName")||zr(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function Mr(e,t){var r=Fr(e,t);return r&&r[0]}var KE=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!he(n)||n<=0||!he(i)||i<=0)},_F=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],SF=function(t){return t&&t.type&&Da(t.type)&&_F.indexOf(t.type)>=0},OF=function(t){return t&&mb(t)==="object"&&"clipDot"in t},jF=function(t,r,n,i){var a,s=(a=Qg?.[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!ze(t)&&(i&&s.includes(r)||gF.includes(r))||n&&hw.includes(r)},Me=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(P.isValidElement(t)&&(i=t.props),!Is(i))return null;var a={};return Object.keys(i).forEach(function(s){var u;jF((u=i)===null||u===void 0?void 0:u[s],s,r,n)&&(a[s]=i[s])}),a},vb=function e(t,r){if(t===r)return!0;var n=P.Children.count(t);if(n!==P.Children.count(r))return!1;if(n===0)return!0;if(n===1)return XE(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function CF(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 yb(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,s=e.style,u=e.title,f=e.desc,c=NF(e,PF),d=i||{width:r,height:n,x:0,y:0},h=Ue("recharts-surface",a);return z.createElement("svg",gb({},Me(c,!0,"svg"),{className:h,width:r,height:n,style:s,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),z.createElement("title",null,u),z.createElement("desc",null,f),t)}var TF=["children","className"];function xb(){return xb=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function RF(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}var Ze=z.forwardRef(function(e,t){var r=e.children,n=e.className,i=kF(e,TF),a=Ue("recharts-layer",n);return z.createElement("g",xb({className:a},Me(i,!0),{ref:t}),r)}),Sn=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;aa?0:a+r),n=n>a?a:n,n<0&&(n+=a),a=r>n?0:n-r>>>0,r>>>=0;for(var s=Array(a);++i=a?r:e(r,n,i)}return ey=t,ey}var ty,JE;function oM(){if(JE)return ty;JE=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,a="\\ufe0e\\ufe0f",s="\\u200d",u=RegExp("["+s+e+i+a+"]");function f(c){return u.test(c)}return ty=f,ty}var ry,e2;function DF(){if(e2)return ry;e2=1;function e(t){return t.split("")}return ry=e,ry}var ny,t2;function LF(){if(t2)return ny;t2=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,a="\\ufe0e\\ufe0f",s="["+e+"]",u="["+i+"]",f="\\ud83c[\\udffb-\\udfff]",c="(?:"+u+"|"+f+")",d="[^"+e+"]",h="(?:\\ud83c[\\udde6-\\uddff]){2}",m="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",b=c+"?",y="["+a+"]?",w="(?:"+g+"(?:"+[d,h,m].join("|")+")"+y+b+")*",S=y+b+w,O="(?:"+[d+u+"?",u,h,m,s].join("|")+")",E=RegExp(f+"(?="+f+")|"+O+S,"g");function C(A){return A.match(E)||[]}return ny=C,ny}var iy,r2;function $F(){if(r2)return iy;r2=1;var e=DF(),t=oM(),r=LF();function n(i){return t(i)?r(i):e(i)}return iy=n,iy}var ay,n2;function BF(){if(n2)return ay;n2=1;var e=IF(),t=oM(),r=$F(),n=rM();function i(a){return function(s){s=n(s);var u=t(s)?r(s):void 0,f=u?u[0]:s.charAt(0),c=u?e(u,1).join(""):s.slice(1);return f[a]()+c}}return ay=i,ay}var oy,i2;function zF(){if(i2)return oy;i2=1;var e=BF(),t=e("toUpperCase");return oy=t,oy}var FF=zF();const rp=it(FF);function pt(e){return function(){return e}}const sM=Math.cos,$d=Math.sin,En=Math.sqrt,Bd=Math.PI,np=2*Bd,bb=Math.PI,wb=2*bb,Ea=1e-6,qF=wb-Ea;function lM(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return lM;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;iEa)if(!(Math.abs(h*f-c*d)>Ea)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let g=n-s,b=i-u,y=f*f+c*c,w=g*g+b*b,S=Math.sqrt(y),O=Math.sqrt(m),E=a*Math.tan((bb-Math.acos((y+m-w)/(2*S*O)))/2),C=E/O,A=E/S;Math.abs(C-1)>Ea&&this._append`L${t+C*d},${r+C*h}`,this._append`A${a},${a},0,0,${+(h*g>d*b)},${this._x1=t+A*f},${this._y1=r+A*c}`}}arc(t,r,n,i,a,s){if(t=+t,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(i),f=n*Math.sin(i),c=t+u,d=r+f,h=1^s,m=s?i-a:a-i;this._x1===null?this._append`M${c},${d}`:(Math.abs(this._x1-c)>Ea||Math.abs(this._y1-d)>Ea)&&this._append`L${c},${d}`,n&&(m<0&&(m=m%wb+wb),m>qF?this._append`A${n},${n},0,1,${h},${t-u},${r-f}A${n},${n},0,1,${h},${this._x1=c},${this._y1=d}`:m>Ea&&this._append`A${n},${n},0,${+(m>=bb)},${h},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function mw(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new WF(t)}function vw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function cM(e){this._context=e}cM.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function ip(e){return new cM(e)}function uM(e){return e[0]}function fM(e){return e[1]}function dM(e,t){var r=pt(!0),n=null,i=ip,a=null,s=mw(u);e=typeof e=="function"?e:e===void 0?uM:pt(e),t=typeof t=="function"?t:t===void 0?fM:pt(t);function u(f){var c,d=(f=vw(f)).length,h,m=!1,g;for(n==null&&(a=i(g=s())),c=0;c<=d;++c)!(c=g;--b)u.point(E[b],C[b]);u.lineEnd(),u.areaEnd()}S&&(E[m]=+e(w,m,h),C[m]=+t(w,m,h),u.point(n?+n(w,m,h):E[m],r?+r(w,m,h):C[m]))}if(O)return u=null,O+""||null}function d(){return dM().defined(i).curve(s).context(a)}return c.x=function(h){return arguments.length?(e=typeof h=="function"?h:pt(+h),n=null,c):e},c.x0=function(h){return arguments.length?(e=typeof h=="function"?h:pt(+h),c):e},c.x1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:pt(+h),c):n},c.y=function(h){return arguments.length?(t=typeof h=="function"?h:pt(+h),r=null,c):t},c.y0=function(h){return arguments.length?(t=typeof h=="function"?h:pt(+h),c):t},c.y1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:pt(+h),c):r},c.lineX0=c.lineY0=function(){return d().x(e).y(t)},c.lineY1=function(){return d().x(e).y(r)},c.lineX1=function(){return d().x(n).y(t)},c.defined=function(h){return arguments.length?(i=typeof h=="function"?h:pt(!!h),c):i},c.curve=function(h){return arguments.length?(s=h,a!=null&&(u=s(a)),c):s},c.context=function(h){return arguments.length?(h==null?a=u=null:u=s(a=h),c):a},c}class hM{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function HF(e){return new hM(e,!0)}function VF(e){return new hM(e,!1)}const gw={draw(e,t){const r=En(t/Bd);e.moveTo(r,0),e.arc(0,0,r,0,np)}},GF={draw(e,t){const r=En(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},pM=En(1/3),KF=pM*2,XF={draw(e,t){const r=En(t/KF),n=r*pM;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},YF={draw(e,t){const r=En(t),n=-r/2;e.rect(n,n,r,r)}},QF=.8908130915292852,mM=$d(Bd/10)/$d(7*Bd/10),ZF=$d(np/10)*mM,JF=-sM(np/10)*mM,eq={draw(e,t){const r=En(t*QF),n=ZF*r,i=JF*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const s=np*a/5,u=sM(s),f=$d(s);e.lineTo(f*r,-u*r),e.lineTo(u*n-f*i,f*n+u*i)}e.closePath()}},sy=En(3),tq={draw(e,t){const r=-En(t/(sy*3));e.moveTo(0,r*2),e.lineTo(-sy*r,-r),e.lineTo(sy*r,-r),e.closePath()}},Qr=-.5,Zr=En(3)/2,_b=1/En(12),rq=(_b/2+1)*3,nq={draw(e,t){const r=En(t/rq),n=r/2,i=r*_b,a=n,s=r*_b+r,u=-a,f=s;e.moveTo(n,i),e.lineTo(a,s),e.lineTo(u,f),e.lineTo(Qr*n-Zr*i,Zr*n+Qr*i),e.lineTo(Qr*a-Zr*s,Zr*a+Qr*s),e.lineTo(Qr*u-Zr*f,Zr*u+Qr*f),e.lineTo(Qr*n+Zr*i,Qr*i-Zr*n),e.lineTo(Qr*a+Zr*s,Qr*s-Zr*a),e.lineTo(Qr*u+Zr*f,Qr*f-Zr*u),e.closePath()}};function iq(e,t){let r=null,n=mw(i);e=typeof e=="function"?e:pt(e||gw),t=typeof t=="function"?t:pt(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:pt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:pt(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function zd(){}function Fd(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function vM(e){this._context=e}vM.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Fd(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Fd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function aq(e){return new vM(e)}function gM(e){this._context=e}gM.prototype={areaStart:zd,areaEnd:zd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Fd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function oq(e){return new gM(e)}function yM(e){this._context=e}yM.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Fd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function sq(e){return new yM(e)}function xM(e){this._context=e}xM.prototype={areaStart:zd,areaEnd:zd,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function lq(e){return new xM(e)}function a2(e){return e<0?-1:1}function o2(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),s=(r-e._y1)/(i||n<0&&-0),u=(a*i+s*n)/(n+i);return(a2(a)+a2(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(u))||0}function s2(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function ly(e,t,r){var n=e._x0,i=e._y0,a=e._x1,s=e._y1,u=(a-n)/3;e._context.bezierCurveTo(n+u,i+u*t,a-u,s-u*r,a,s)}function qd(e){this._context=e}qd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:ly(this,this._t0,s2(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,ly(this,s2(this,r=o2(this,e,t)),r);break;default:ly(this,this._t0,r=o2(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function bM(e){this._context=new wM(e)}(bM.prototype=Object.create(qd.prototype)).point=function(e,t){qd.prototype.point.call(this,t,e)};function wM(e){this._context=e}wM.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function cq(e){return new qd(e)}function uq(e){return new bM(e)}function _M(e){this._context=e}_M.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=l2(e),i=l2(t),a=0,s=1;s=0;--t)i[t]=(s[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function dq(e){return new ap(e,.5)}function hq(e){return new ap(e,0)}function pq(e){return new ap(e,1)}function as(e,t){if((s=e.length)>1)for(var r=1,n,i,a=e[t[0]],s,u=a.length;r=0;)r[t]=t;return r}function mq(e,t){return e[t]}function vq(e){const t=[];return t.key=e,t}function gq(){var e=pt([]),t=Sb,r=as,n=mq;function i(a){var s=Array.from(e.apply(this,arguments),vq),u,f=s.length,c=-1,d;for(const h of a)for(u=0,++c;u0){for(var r,n,i=0,a=e[0].length,s;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,s;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Eq(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}var SM={symbolCircle:gw,symbolCross:GF,symbolDiamond:XF,symbolSquare:YF,symbolStar:eq,symbolTriangle:tq,symbolWye:nq},Aq=Math.PI/180,Pq=function(t){var r="symbol".concat(rp(t));return SM[r]||gw},Nq=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*Aq;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},Cq=function(t,r){SM["symbol".concat(rp(t))]=r},yw=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,s=t.sizeType,u=s===void 0?"area":s,f=jq(t,wq),c=u2(u2({},f),{},{type:n,size:a,sizeType:u}),d=function(){var w=Pq(n),S=iq().type(w).size(Nq(a,u,n));return S()},h=c.className,m=c.cx,g=c.cy,b=Me(c,!0);return m===+m&&g===+g&&a===+a?z.createElement("path",Ob({},b,{className:Ue("recharts-symbols",h),transform:"translate(".concat(m,", ").concat(g,")"),d:d()})):null};yw.registerSymbol=Cq;function os(e){"@babel/helpers - typeof";return os=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},os(e)}function jb(){return jb=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var O=g.inactive?c:g.color;return z.createElement("li",jb({className:w,style:h,key:"legend-item-".concat(b)},La(n.props,g,b)),z.createElement(yb,{width:s,height:s,viewBox:d,style:m},n.renderIcon(g)),z.createElement("span",{className:"recharts-legend-item-text",style:{color:O}},y?y(S,g,b):S))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,s=n.align;if(!i||!i.length)return null;var u={padding:0,margin:0,textAlign:a==="horizontal"?s:"left"};return z.createElement("ul",{className:"recharts-default-legend",style:u},this.renderItems())}}])})(P.PureComponent);hc(xw,"displayName","Legend");hc(xw,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var cy,d2;function zq(){if(d2)return cy;d2=1;var e=Jh();function t(){this.__data__=new e,this.size=0}return cy=t,cy}var uy,h2;function Fq(){if(h2)return uy;h2=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return uy=e,uy}var fy,p2;function qq(){if(p2)return fy;p2=1;function e(t){return this.__data__.get(t)}return fy=e,fy}var dy,m2;function Uq(){if(m2)return dy;m2=1;function e(t){return this.__data__.has(t)}return dy=e,dy}var hy,v2;function Wq(){if(v2)return hy;v2=1;var e=Jh(),t=cw(),r=uw(),n=200;function i(a,s){var u=this.__data__;if(u instanceof e){var f=u.__data__;if(!t||f.lengthg))return!1;var y=h.get(s),w=h.get(u);if(y&&w)return y==u&&w==s;var S=-1,O=!0,E=f&i?new e:void 0;for(h.set(s,u),h.set(u,s);++S-1&&n%1==0&&n-1&&r%1==0&&r<=e}return Iy=t,Iy}var Dy,z2;function n9(){if(z2)return Dy;z2=1;var e=yi(),t=Sw(),r=xi(),n="[object Arguments]",i="[object Array]",a="[object Boolean]",s="[object Date]",u="[object Error]",f="[object Function]",c="[object Map]",d="[object Number]",h="[object Object]",m="[object RegExp]",g="[object Set]",b="[object String]",y="[object WeakMap]",w="[object ArrayBuffer]",S="[object DataView]",O="[object Float32Array]",E="[object Float64Array]",C="[object Int8Array]",A="[object Int16Array]",N="[object Int32Array]",T="[object Uint8Array]",R="[object Uint8ClampedArray]",I="[object Uint16Array]",q="[object Uint32Array]",L={};L[O]=L[E]=L[C]=L[A]=L[N]=L[T]=L[R]=L[I]=L[q]=!0,L[n]=L[i]=L[w]=L[a]=L[S]=L[s]=L[u]=L[f]=L[c]=L[d]=L[h]=L[m]=L[g]=L[b]=L[y]=!1;function D(U){return r(U)&&t(U.length)&&!!L[e(U)]}return Dy=D,Dy}var Ly,F2;function RM(){if(F2)return Ly;F2=1;function e(t){return function(r){return t(r)}}return Ly=e,Ly}var Yl={exports:{}};Yl.exports;var q2;function i9(){return q2||(q2=1,(function(e,t){var r=JR(),n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,s=a&&r.process,u=(function(){try{var f=i&&i.require&&i.require("util").types;return f||s&&s.binding&&s.binding("util")}catch{}})();e.exports=u})(Yl,Yl.exports)),Yl.exports}var $y,U2;function MM(){if(U2)return $y;U2=1;var e=n9(),t=RM(),r=i9(),n=r&&r.isTypedArray,i=n?t(n):e;return $y=i,$y}var By,W2;function a9(){if(W2)return By;W2=1;var e=e9(),t=ww(),r=Sr(),n=kM(),i=_w(),a=MM(),s=Object.prototype,u=s.hasOwnProperty;function f(c,d){var h=r(c),m=!h&&t(c),g=!h&&!m&&n(c),b=!h&&!m&&!g&&a(c),y=h||m||g||b,w=y?e(c.length,String):[],S=w.length;for(var O in c)(d||u.call(c,O))&&!(y&&(O=="length"||g&&(O=="offset"||O=="parent")||b&&(O=="buffer"||O=="byteLength"||O=="byteOffset")||i(O,S)))&&w.push(O);return w}return By=f,By}var zy,H2;function o9(){if(H2)return zy;H2=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||e;return r===i}return zy=t,zy}var Fy,V2;function IM(){if(V2)return Fy;V2=1;function e(t,r){return function(n){return t(r(n))}}return Fy=e,Fy}var qy,G2;function s9(){if(G2)return qy;G2=1;var e=IM(),t=e(Object.keys,Object);return qy=t,qy}var Uy,K2;function l9(){if(K2)return Uy;K2=1;var e=o9(),t=s9(),r=Object.prototype,n=r.hasOwnProperty;function i(a){if(!e(a))return t(a);var s=[];for(var u in Object(a))n.call(a,u)&&u!="constructor"&&s.push(u);return s}return Uy=i,Uy}var Wy,X2;function Qc(){if(X2)return Wy;X2=1;var e=sw(),t=Sw();function r(n){return n!=null&&t(n.length)&&!e(n)}return Wy=r,Wy}var Hy,Y2;function op(){if(Y2)return Hy;Y2=1;var e=a9(),t=l9(),r=Qc();function n(i){return r(i)?e(i):t(i)}return Hy=n,Hy}var Vy,Q2;function c9(){if(Q2)return Vy;Q2=1;var e=Yq(),t=Jq(),r=op();function n(i){return e(i,r,t)}return Vy=n,Vy}var Gy,Z2;function u9(){if(Z2)return Gy;Z2=1;var e=c9(),t=1,r=Object.prototype,n=r.hasOwnProperty;function i(a,s,u,f,c,d){var h=u&t,m=e(a),g=m.length,b=e(s),y=b.length;if(g!=y&&!h)return!1;for(var w=g;w--;){var S=m[w];if(!(h?S in s:n.call(s,S)))return!1}var O=d.get(a),E=d.get(s);if(O&&E)return O==s&&E==a;var C=!0;d.set(a,s),d.set(s,a);for(var A=h;++w-1}return x0=t,x0}var b0,jA;function C9(){if(jA)return b0;jA=1;function e(t,r,n){for(var i=-1,a=t==null?0:t.length;++i=s){var S=c?null:i(f);if(S)return a(S);b=!1,m=n,w=new e}else w=c?[]:y;e:for(;++h=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function H9(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 V9(e){return e.value}function G9(e,t){if(z.isValidElement(e))return z.cloneElement(e,t);if(typeof e=="function")return z.createElement(e,t);t.ref;var r=W9(t,D9);return z.createElement(xw,r)}var RA=1,Qo=(function(e){function t(){var r;L9(this,t);for(var n=arguments.length,i=new Array(n),a=0;aRA||Math.abs(i.height-this.lastBoundingBox.height)>RA)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?ni({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,s=i.align,u=i.verticalAlign,f=i.margin,c=i.chartWidth,d=i.chartHeight,h,m;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(s==="center"&&a==="vertical"){var g=this.getBBoxSnapshot();h={left:((c||0)-g.width)/2}}else h=s==="right"?{right:f&&f.right||0}:{left:f&&f.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(u==="middle"){var b=this.getBBoxSnapshot();m={top:((d||0)-b.height)/2}}else m=u==="bottom"?{bottom:f&&f.bottom||0}:{top:f&&f.top||0};return ni(ni({},h),m)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,s=i.width,u=i.height,f=i.wrapperStyle,c=i.payloadUniqBy,d=i.payload,h=ni(ni({position:"absolute",width:s||"auto",height:u||"auto"},this.getDefaultPosition(f)),f);return z.createElement("div",{className:"recharts-legend-wrapper",style:h,ref:function(g){n.wrapperNode=g}},G9(a,ni(ni({},this.props),{},{payload:zM(d,c,V9)})))}}],[{key:"getWithHeight",value:function(n,i){var a=ni(ni({},this.defaultProps),n.props),s=a.layout;return s==="vertical"&&he(n.props.height)?{height:n.props.height}:s==="horizontal"?{width:n.props.width||i}:null}}])})(P.PureComponent);sp(Qo,"displayName","Legend");sp(Qo,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var j0,MA;function K9(){if(MA)return j0;MA=1;var e=Xc(),t=ww(),r=Sr(),n=e?e.isConcatSpreadable:void 0;function i(a){return r(a)||t(a)||!!(n&&a&&a[n])}return j0=i,j0}var E0,IA;function UM(){if(IA)return E0;IA=1;var e=TM(),t=K9();function r(n,i,a,s,u){var f=-1,c=n.length;for(a||(a=t),u||(u=[]);++f0&&a(d)?i>1?r(d,i-1,a,s,u):e(u,d):s||(u[u.length]=d)}return u}return E0=r,E0}var A0,DA;function X9(){if(DA)return A0;DA=1;function e(t){return function(r,n,i){for(var a=-1,s=Object(r),u=i(r),f=u.length;f--;){var c=u[t?f:++a];if(n(s[c],c,s)===!1)break}return r}}return A0=e,A0}var P0,LA;function Y9(){if(LA)return P0;LA=1;var e=X9(),t=e();return P0=t,P0}var N0,$A;function WM(){if($A)return N0;$A=1;var e=Y9(),t=op();function r(n,i){return n&&e(n,i,t)}return N0=r,N0}var C0,BA;function Q9(){if(BA)return C0;BA=1;var e=Qc();function t(r,n){return function(i,a){if(i==null)return i;if(!e(i))return r(i,a);for(var s=i.length,u=n?s:-1,f=Object(i);(n?u--:++un||u&&f&&d&&!c&&!h||a&&f&&d||!i&&d||!s)return 1;if(!a&&!u&&!h&&r=c)return d;var h=i[a];return d*(h=="desc"?-1:1)}}return r.index-n.index}return I0=t,I0}var D0,HA;function t7(){if(HA)return D0;HA=1;var e=fw(),t=dw(),r=Vn(),n=HM(),i=Z9(),a=RM(),s=e7(),u=Ls(),f=Sr();function c(d,h,m){h.length?h=e(h,function(y){return f(y)?function(w){return t(w,y.length===1?y[0]:y)}:y}):h=[u];var g=-1;h=e(h,a(r));var b=n(d,function(y,w,S){var O=e(h,function(E){return E(y)});return{criteria:O,index:++g,value:y}});return i(b,function(y,w){return s(y,w,m)})}return D0=c,D0}var L0,VA;function r7(){if(VA)return L0;VA=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return L0=e,L0}var $0,GA;function n7(){if(GA)return $0;GA=1;var e=r7(),t=Math.max;function r(n,i,a){return i=t(i===void 0?n.length-1:i,0),function(){for(var s=arguments,u=-1,f=t(s.length-i,0),c=Array(f);++u0){if(++a>=e)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return q0=n,q0}var U0,ZA;function s7(){if(ZA)return U0;ZA=1;var e=a7(),t=o7(),r=t(e);return U0=r,U0}var W0,JA;function l7(){if(JA)return W0;JA=1;var e=Ls(),t=n7(),r=s7();function n(i,a){return r(t(i,a,e),i+"")}return W0=n,W0}var H0,eP;function lp(){if(eP)return H0;eP=1;var e=lw(),t=Qc(),r=_w(),n=Qi();function i(a,s,u){if(!n(u))return!1;var f=typeof s;return(f=="number"?t(u)&&r(s,u.length):f=="string"&&s in u)?e(u[s],a):!1}return H0=i,H0}var V0,tP;function c7(){if(tP)return V0;tP=1;var e=UM(),t=t7(),r=l7(),n=lp(),i=r(function(a,s){if(a==null)return[];var u=s.length;return u>1&&n(a,s[0],s[1])?s=[]:u>2&&n(s[0],s[1],s[2])&&(s=[s[0]]),t(a,e(s,1),[])});return V0=i,V0}var u7=c7();const Ew=it(u7);function pc(e){"@babel/helpers - typeof";return pc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pc(e)}function Pb(){return Pb=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(Ml,"-left"),he(r)&&t&&he(t.x)&&r=t.y),"".concat(Ml,"-top"),he(n)&&t&&he(t.y)&&ny?Math.max(d,f[n]):Math.max(h,f[n])}function j7(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function E7(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,s=e.tooltipBox,u=e.useTranslate3d,f=e.viewBox,c,d,h;return s.height>0&&s.width>0&&r?(d=iP({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:s.width,viewBox:f,viewBoxDimension:f.width}),h=iP({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:s.height,viewBox:f,viewBoxDimension:f.height}),c=j7({translateX:d,translateY:h,useTranslate3d:u})):c=S7,{cssProperties:c,cssClasses:O7({translateX:d,translateY:h,coordinate:r})}}function ls(e){"@babel/helpers - typeof";return ls=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ls(e)}function aP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function oP(e){for(var t=1;tsP||Math.abs(n.height-this.state.lastBoundingBox.height)>sP)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,s=i.allowEscapeViewBox,u=i.animationDuration,f=i.animationEasing,c=i.children,d=i.coordinate,h=i.hasPayload,m=i.isAnimationActive,g=i.offset,b=i.position,y=i.reverseDirection,w=i.useTranslate3d,S=i.viewBox,O=i.wrapperStyle,E=E7({allowEscapeViewBox:s,coordinate:d,offsetTopLeft:g,position:b,reverseDirection:y,tooltipBox:this.state.lastBoundingBox,useTranslate3d:w,viewBox:S}),C=E.cssClasses,A=E.cssProperties,N=oP(oP({transition:m&&a?"transform ".concat(u,"ms ").concat(f):void 0},A),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&h?"visible":"hidden",position:"absolute",top:0,left:0},O);return z.createElement("div",{tabIndex:-1,className:C,style:N,ref:function(R){n.wrapperNode=R}},c)}}])})(P.PureComponent),D7=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Qa={isSsr:D7()};function cs(e){"@babel/helpers - typeof";return cs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cs(e)}function lP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function cP(e){for(var t=1;t0;return z.createElement(I7,{allowEscapeViewBox:s,animationDuration:u,animationEasing:f,isAnimationActive:m,active:a,coordinate:d,hasPayload:N,offset:g,position:w,reverseDirection:S,useTranslate3d:O,viewBox:E,wrapperStyle:C},V7(c,cP(cP({},this.props),{},{payload:A})))}}])})(P.PureComponent);Aw(Dr,"displayName","Tooltip");Aw(Dr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Qa.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var K0,uP;function G7(){if(uP)return K0;uP=1;var e=Hn(),t=function(){return e.Date.now()};return K0=t,K0}var X0,fP;function K7(){if(fP)return X0;fP=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return X0=t,X0}var Y0,dP;function X7(){if(dP)return Y0;dP=1;var e=K7(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return Y0=r,Y0}var Q0,hP;function QM(){if(hP)return Q0;hP=1;var e=X7(),t=Qi(),r=Ms(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,u=parseInt;function f(c){if(typeof c=="number")return c;if(r(c))return n;if(t(c)){var d=typeof c.valueOf=="function"?c.valueOf():c;c=t(d)?d+"":d}if(typeof c!="string")return c===0?c:+c;c=e(c);var h=a.test(c);return h||s.test(c)?u(c.slice(2),h?2:8):i.test(c)?n:+c}return Q0=f,Q0}var Z0,pP;function Y7(){if(pP)return Z0;pP=1;var e=Qi(),t=G7(),r=QM(),n="Expected a function",i=Math.max,a=Math.min;function s(u,f,c){var d,h,m,g,b,y,w=0,S=!1,O=!1,E=!0;if(typeof u!="function")throw new TypeError(n);f=r(f)||0,e(c)&&(S=!!c.leading,O="maxWait"in c,m=O?i(r(c.maxWait)||0,f):m,E="trailing"in c?!!c.trailing:E);function C(U){var H=d,V=h;return d=h=void 0,w=U,g=u.apply(V,H),g}function A(U){return w=U,b=setTimeout(R,f),S?C(U):g}function N(U){var H=U-y,V=U-w,K=f-H;return O?a(K,m-V):K}function T(U){var H=U-y,V=U-w;return y===void 0||H>=f||H<0||O&&V>=m}function R(){var U=t();if(T(U))return I(U);b=setTimeout(R,N(U))}function I(U){return b=void 0,E&&d?C(U):(d=h=void 0,g)}function q(){b!==void 0&&clearTimeout(b),w=0,d=y=h=b=void 0}function L(){return b===void 0?g:I(t())}function D(){var U=t(),H=T(U);if(d=arguments,h=this,y=U,H){if(b===void 0)return A(y);if(O)return clearTimeout(b),b=setTimeout(R,f),C(y)}return b===void 0&&(b=setTimeout(R,f)),g}return D.cancel=q,D.flush=L,D}return Z0=s,Z0}var J0,mP;function Q7(){if(mP)return J0;mP=1;var e=Y7(),t=Qi(),r="Expected a function";function n(i,a,s){var u=!0,f=!0;if(typeof i!="function")throw new TypeError(r);return t(s)&&(u="leading"in s?!!s.leading:u,f="trailing"in s?!!s.trailing:f),e(i,a,{leading:u,maxWait:a,trailing:f})}return J0=n,J0}var Z7=Q7();const ZM=it(Z7);function vc(e){"@babel/helpers - typeof";return vc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vc(e)}function vP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Af(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(U=ZM(U,y,{trailing:!0,leading:!1}));var H=new ResizeObserver(U),V=A.current.getBoundingClientRect(),K=V.width,X=V.height;return L(K,X),H.observe(A.current),function(){H.disconnect()}},[L,y]);var D=P.useMemo(function(){var U=I.containerWidth,H=I.containerHeight;if(U<0||H<0)return null;Sn(Na(s)||Na(f),`The width(%s) and height(%s) are both fixed numbers, - maybe you don't need to use a ResponsiveContainer.`,s,f),Sn(!r||r>0,"The aspect(%s) must be greater than zero.",r);var V=Na(s)?U:s,K=Na(f)?H:f;r&&r>0&&(V?K=V/r:K&&(V=K*r),m&&K>m&&(K=m)),Sn(V>0||K>0,`The width(%s) and height(%s) of chart should be greater than 0, - please check the style of container, or the props width(%s) and height(%s), - or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,V,K,s,f,d,h,r);var X=!Array.isArray(g)&&ci(g.type).endsWith("Chart");return z.Children.map(g,function(B){return z.isValidElement(B)?P.cloneElement(B,Af({width:V,height:K},X?{style:Af({height:"100%",width:"100%",maxHeight:K,maxWidth:V},B.props.style)}:{})):B})},[r,g,f,m,h,d,I,s]);return z.createElement("div",{id:w?"".concat(w):void 0,className:Ue("recharts-responsive-container",S),style:Af(Af({},C),{},{width:s,height:f,minWidth:d,minHeight:h,maxHeight:m}),ref:A},D)}),cp=function(t){return null};cp.displayName="Cell";function gc(e){"@babel/helpers - typeof";return gc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gc(e)}function yP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function kb(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Qa.isSsr)return{width:0,height:0};var n=dU(r),i=JSON.stringify({text:t,copyStyle:n});if(To.widthCache[i])return To.widthCache[i];try{var a=document.getElementById(xP);a||(a=document.createElement("span"),a.setAttribute("id",xP),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var s=kb(kb({},fU),n);Object.assign(a.style,s),a.textContent="".concat(t);var u=a.getBoundingClientRect(),f={width:u.width,height:u.height};return To.widthCache[i]=f,++To.cacheCount>uU&&(To.cacheCount=0,To.widthCache={}),f}catch{return{width:0,height:0}}},hU=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function yc(e){"@babel/helpers - typeof";return yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yc(e)}function Kd(e,t){return gU(e)||vU(e,t)||mU(e,t)||pU()}function pU(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mU(e,t){if(e){if(typeof e=="string")return bP(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bP(e,t)}}function bP(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function TU(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 EP(e,t){return IU(e)||MU(e,t)||RU(e,t)||kU()}function kU(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RU(e,t){if(e){if(typeof e=="string")return AP(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return AP(e,t)}}function AP(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return V.reduce(function(K,X){var B=X.word,Z=X.width,ee=K[K.length-1];if(ee&&(i==null||a||ee.width+Z+nX.width?K:X})};if(!d)return g;for(var y="…",w=function(V){var K=h.slice(0,V),X=rI({breakAll:c,style:f,children:K+y}).wordsWithComputedWidth,B=m(X),Z=B.length>s||b(B).width>Number(i);return[Z,B]},S=0,O=h.length-1,E=0,C;S<=O&&E<=h.length-1;){var A=Math.floor((S+O)/2),N=A-1,T=w(N),R=EP(T,2),I=R[0],q=R[1],L=w(A),D=EP(L,1),U=D[0];if(!I&&!U&&(S=A+1),I&&U&&(O=A-1),!I&&U){C=q;break}E++}return C||g},PP=function(t){var r=qe(t)?[]:t.toString().split(tI);return[{words:r}]},LU=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,s=t.breakAll,u=t.maxLines;if((r||n)&&!Qa.isSsr){var f,c,d=rI({breakAll:s,children:i,style:a});if(d){var h=d.wordsWithComputedWidth,m=d.spaceWidth;f=h,c=m}else return PP(i);return DU({breakAll:s,children:i,maxLines:u,style:a},f,c,r,n)}return PP(i)},NP="#808080",$a=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,s=t.lineHeight,u=s===void 0?"1em":s,f=t.capHeight,c=f===void 0?"0.71em":f,d=t.scaleToFit,h=d===void 0?!1:d,m=t.textAnchor,g=m===void 0?"start":m,b=t.verticalAnchor,y=b===void 0?"end":b,w=t.fill,S=w===void 0?NP:w,O=jP(t,NU),E=P.useMemo(function(){return LU({breakAll:O.breakAll,children:O.children,maxLines:O.maxLines,scaleToFit:h,style:O.style,width:O.width})},[O.breakAll,O.children,O.maxLines,h,O.style,O.width]),C=O.dx,A=O.dy,N=O.angle,T=O.className,R=O.breakAll,I=jP(O,CU);if(!zt(n)||!zt(a))return null;var q=n+(he(C)?C:0),L=a+(he(A)?A:0),D;switch(y){case"start":D=ex("calc(".concat(c,")"));break;case"middle":D=ex("calc(".concat((E.length-1)/2," * -").concat(u," + (").concat(c," / 2))"));break;default:D=ex("calc(".concat(E.length-1," * -").concat(u,")"));break}var U=[];if(h){var H=E[0].width,V=O.width;U.push("scale(".concat((he(V)?V/H:1)/H,")"))}return N&&U.push("rotate(".concat(N,", ").concat(q,", ").concat(L,")")),U.length&&(I.transform=U.join(" ")),z.createElement("text",Rb({},Me(I,!0),{x:q,y:L,className:Ue("recharts-text",T),textAnchor:g,fill:S.includes("url")?NP:S}),E.map(function(K,X){var B=K.words.join(R?"":" ");return z.createElement("tspan",{x:q,dy:X===0?D:u,key:"".concat(B,"-").concat(X)},B)}))};function Vi(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function $U(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Pw(e){let t,r,n;e.length!==2?(t=Vi,r=(u,f)=>Vi(e(u),f),n=(u,f)=>e(u)-f):(t=e===Vi||e===$U?e:BU,r=e,n=e);function i(u,f,c=0,d=u.length){if(c>>1;r(u[h],f)<0?c=h+1:d=h}while(c>>1;r(u[h],f)<=0?c=h+1:d=h}while(cc&&n(u[h-1],f)>-n(u[h],f)?h-1:h}return{left:i,center:s,right:a}}function BU(){return 0}function nI(e){return e===null?NaN:+e}function*zU(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const FU=Pw(Vi),Zc=FU.right;Pw(nI).center;class CP extends Map{constructor(t,r=WU){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(TP(this,t))}has(t){return super.has(TP(this,t))}set(t,r){return super.set(qU(this,t),r)}delete(t){return super.delete(UU(this,t))}}function TP({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function qU({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function UU({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function WU(e){return e!==null&&typeof e=="object"?e.valueOf():e}function HU(e=Vi){if(e===Vi)return iI;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function iI(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const VU=Math.sqrt(50),GU=Math.sqrt(10),KU=Math.sqrt(2);function Xd(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=VU?10:a>=GU?5:a>=KU?2:1;let u,f,c;return i<0?(c=Math.pow(10,-i)/s,u=Math.round(e*c),f=Math.round(t*c),u/ct&&--f,c=-c):(c=Math.pow(10,i)*s,u=Math.round(e/c),f=Math.round(t/c),u*ct&&--f),f0))return[];if(e===t)return[e];const n=t=i))return[];const u=a-i+1,f=new Array(u);if(n)if(s<0)for(let c=0;c=n)&&(r=n);return r}function RP(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function aI(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?iI:HU(i);n>r;){if(n-r>600){const f=n-r+1,c=t-r+1,d=Math.log(f),h=.5*Math.exp(2*d/3),m=.5*Math.sqrt(d*h*(f-h)/f)*(c-f/2<0?-1:1),g=Math.max(r,Math.floor(t-c*h/f+m)),b=Math.min(n,Math.floor(t+(f-c)*h/f+m));aI(e,t,g,b,i)}const a=e[t];let s=r,u=n;for(Il(e,r,t),i(e[n],a)>0&&Il(e,r,n);s0;)--u}i(e[r],a)===0?Il(e,r,u):(++u,Il(e,u,n)),u<=t&&(r=u+1),t<=u&&(n=u-1)}return e}function Il(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function XU(e,t,r){if(e=Float64Array.from(zU(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return RP(e);if(t>=1)return kP(e);var n,i=(n-1)*t,a=Math.floor(i),s=kP(aI(e,a).subarray(0,a+1)),u=RP(e.subarray(a+1));return s+(u-s)*(i-a)}}function YU(e,t,r=nI){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),s=+r(e[a],a,e),u=+r(e[a+1],a+1,e);return s+(u-s)*(i-a)}}function QU(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Nf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Nf(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=JU.exec(e))?new xr(t[1],t[2],t[3],1):(t=eW.exec(e))?new xr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=tW.exec(e))?Nf(t[1],t[2],t[3],t[4]):(t=rW.exec(e))?Nf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=nW.exec(e))?zP(t[1],t[2]/100,t[3]/100,1):(t=iW.exec(e))?zP(t[1],t[2]/100,t[3]/100,t[4]):MP.hasOwnProperty(e)?LP(MP[e]):e==="transparent"?new xr(NaN,NaN,NaN,0):null}function LP(e){return new xr(e>>16&255,e>>8&255,e&255,1)}function Nf(e,t,r,n){return n<=0&&(e=t=r=NaN),new xr(e,t,r,n)}function sW(e){return e instanceof Jc||(e=_c(e)),e?(e=e.rgb(),new xr(e.r,e.g,e.b,e.opacity)):new xr}function $b(e,t,r,n){return arguments.length===1?sW(e):new xr(e,t,r,n??1)}function xr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Cw(xr,$b,sI(Jc,{brighter(e){return e=e==null?Yd:Math.pow(Yd,e),new xr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?bc:Math.pow(bc,e),new xr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new xr(Ra(this.r),Ra(this.g),Ra(this.b),Qd(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:$P,formatHex:$P,formatHex8:lW,formatRgb:BP,toString:BP}));function $P(){return`#${Ca(this.r)}${Ca(this.g)}${Ca(this.b)}`}function lW(){return`#${Ca(this.r)}${Ca(this.g)}${Ca(this.b)}${Ca((isNaN(this.opacity)?1:this.opacity)*255)}`}function BP(){const e=Qd(this.opacity);return`${e===1?"rgb(":"rgba("}${Ra(this.r)}, ${Ra(this.g)}, ${Ra(this.b)}${e===1?")":`, ${e})`}`}function Qd(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ra(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ca(e){return e=Ra(e),(e<16?"0":"")+e.toString(16)}function zP(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new _n(e,t,r,n)}function lI(e){if(e instanceof _n)return new _n(e.h,e.s,e.l,e.opacity);if(e instanceof Jc||(e=_c(e)),!e)return new _n;if(e instanceof _n)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),s=NaN,u=a-i,f=(a+i)/2;return u?(t===a?s=(r-n)/u+(r0&&f<1?0:s,new _n(s,u,f,e.opacity)}function cW(e,t,r,n){return arguments.length===1?lI(e):new _n(e,t,r,n??1)}function _n(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Cw(_n,cW,sI(Jc,{brighter(e){return e=e==null?Yd:Math.pow(Yd,e),new _n(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?bc:Math.pow(bc,e),new _n(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new xr(tx(e>=240?e-240:e+120,i,n),tx(e,i,n),tx(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new _n(FP(this.h),Cf(this.s),Cf(this.l),Qd(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Qd(this.opacity);return`${e===1?"hsl(":"hsla("}${FP(this.h)}, ${Cf(this.s)*100}%, ${Cf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function FP(e){return e=(e||0)%360,e<0?e+360:e}function Cf(e){return Math.max(0,Math.min(1,e||0))}function tx(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Tw=e=>()=>e;function uW(e,t){return function(r){return e+r*t}}function fW(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function dW(e){return(e=+e)==1?cI:function(t,r){return r-t?fW(t,r,e):Tw(isNaN(t)?r:t)}}function cI(e,t){var r=t-e;return r?uW(e,r):Tw(isNaN(e)?t:e)}const qP=(function e(t){var r=dW(t);function n(i,a){var s=r((i=$b(i)).r,(a=$b(a)).r),u=r(i.g,a.g),f=r(i.b,a.b),c=cI(i.opacity,a.opacity);return function(d){return i.r=s(d),i.g=u(d),i.b=f(d),i.opacity=c(d),i+""}}return n.gamma=e,n})(1);function hW(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),u[s]?u[s]+=a:u[++s]=a),(n=n[0])===(i=i[0])?u[s]?u[s]+=i:u[++s]=i:(u[++s]=null,f.push({i:s,x:Zd(n,i)})),r=rx.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function OW(e,t,r){var n=e[0],i=e[1],a=t[0],s=t[1];return i2?jW:OW,f=c=null,h}function h(m){return m==null||isNaN(m=+m)?a:(f||(f=u(e.map(n),t,r)))(n(s(m)))}return h.invert=function(m){return s(i((c||(c=u(t,e.map(n),Zd)))(m)))},h.domain=function(m){return arguments.length?(e=Array.from(m,Jd),d()):e.slice()},h.range=function(m){return arguments.length?(t=Array.from(m),d()):t.slice()},h.rangeRound=function(m){return t=Array.from(m),r=kw,d()},h.clamp=function(m){return arguments.length?(s=m?!0:fr,d()):s!==fr},h.interpolate=function(m){return arguments.length?(r=m,d()):r},h.unknown=function(m){return arguments.length?(a=m,h):a},function(m,g){return n=m,i=g,d()}}function Rw(){return up()(fr,fr)}function EW(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function eh(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function us(e){return e=eh(Math.abs(e)),e?e[1]:NaN}function AW(e,t){return function(r,n){for(var i=r.length,a=[],s=0,u=e[0],f=0;i>0&&u>0&&(f+u+1>n&&(u=Math.max(1,n-f)),a.push(r.substring(i-=u,i+u)),!((f+=u+1)>n));)u=e[s=(s+1)%e.length];return a.reverse().join(t)}}function PW(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var NW=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Sc(e){if(!(t=NW.exec(e)))throw new Error("invalid format: "+e);var t;return new Mw({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Sc.prototype=Mw.prototype;function Mw(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Mw.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function CW(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var th;function TW(e,t){var r=eh(e,t);if(!r)return th=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(th=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+eh(e,Math.max(0,t+a-1))[0]}function WP(e,t){var r=eh(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const HP={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:EW,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>WP(e*100,t),r:WP,s:TW,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function VP(e){return e}var GP=Array.prototype.map,KP=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function kW(e){var t=e.grouping===void 0||e.thousands===void 0?VP:AW(GP.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?VP:PW(GP.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function c(h,m){h=Sc(h);var g=h.fill,b=h.align,y=h.sign,w=h.symbol,S=h.zero,O=h.width,E=h.comma,C=h.precision,A=h.trim,N=h.type;N==="n"?(E=!0,N="g"):HP[N]||(C===void 0&&(C=12),A=!0,N="g"),(S||g==="0"&&b==="=")&&(S=!0,g="0",b="=");var T=(m&&m.prefix!==void 0?m.prefix:"")+(w==="$"?r:w==="#"&&/[boxX]/.test(N)?"0"+N.toLowerCase():""),R=(w==="$"?n:/[%p]/.test(N)?s:"")+(m&&m.suffix!==void 0?m.suffix:""),I=HP[N],q=/[defgprs%]/.test(N);C=C===void 0?6:/[gprs]/.test(N)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function L(D){var U=T,H=R,V,K,X;if(N==="c")H=I(D)+H,D="";else{D=+D;var B=D<0||1/D<0;if(D=isNaN(D)?f:I(Math.abs(D),C),A&&(D=CW(D)),B&&+D==0&&y!=="+"&&(B=!1),U=(B?y==="("?y:u:y==="-"||y==="("?"":y)+U,H=(N==="s"&&!isNaN(D)&&th!==void 0?KP[8+th/3]:"")+H+(B&&y==="("?")":""),q){for(V=-1,K=D.length;++VX||X>57){H=(X===46?i+D.slice(V+1):D.slice(V))+H,D=D.slice(0,V);break}}}E&&!S&&(D=t(D,1/0));var Z=U.length+D.length+H.length,ee=Z>1)+U+D+H+ee.slice(Z);break;default:D=ee+U+D+H;break}return a(D)}return L.toString=function(){return h+""},L}function d(h,m){var g=Math.max(-8,Math.min(8,Math.floor(us(m)/3)))*3,b=Math.pow(10,-g),y=c((h=Sc(h),h.type="f",h),{suffix:KP[8+g/3]});return function(w){return y(b*w)}}return{format:c,formatPrefix:d}}var Tf,Iw,uI;RW({thousands:",",grouping:[3],currency:["$",""]});function RW(e){return Tf=kW(e),Iw=Tf.format,uI=Tf.formatPrefix,Tf}function MW(e){return Math.max(0,-us(Math.abs(e)))}function IW(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(us(t)/3)))*3-us(Math.abs(e)))}function DW(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,us(t)-us(e))+1}function fI(e,t,r,n){var i=Db(e,t,r),a;switch(n=Sc(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=IW(i,s))&&(n.precision=a),uI(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=DW(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=MW(i))&&(n.precision=a-(n.type==="%")*2);break}}return Iw(n)}function Zi(e){var t=e.domain;return e.ticks=function(r){var n=t();return Mb(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return fI(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,s=n[i],u=n[a],f,c,d=10;for(u0;){if(c=Ib(s,u,r),c===f)return n[i]=s,n[a]=u,t(n);if(c>0)s=Math.floor(s/c)*c,u=Math.ceil(u/c)*c;else if(c<0)s=Math.ceil(s*c)/c,u=Math.floor(u*c)/c;else break;f=c}return e},e}function rh(){var e=Rw();return e.copy=function(){return eu(e,rh())},sn.apply(e,arguments),Zi(e)}function dI(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,Jd),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return dI(e).unknown(t)},e=arguments.length?Array.from(e,Jd):[0,1],Zi(r)}function hI(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],s;return aMath.pow(e,t)}function FW(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function QP(e){return(t,r)=>-e(-t,r)}function Dw(e){const t=e(XP,YP),r=t.domain;let n=10,i,a;function s(){return i=FW(n),a=zW(n),r()[0]<0?(i=QP(i),a=QP(a),e(LW,$W)):e(XP,YP),t}return t.base=function(u){return arguments.length?(n=+u,s()):n},t.domain=function(u){return arguments.length?(r(u),s()):r()},t.ticks=u=>{const f=r();let c=f[0],d=f[f.length-1];const h=d0){for(;m<=g;++m)for(b=1;bd)break;S.push(y)}}else for(;m<=g;++m)for(b=n-1;b>=1;--b)if(y=m>0?b/a(-m):b*a(m),!(yd)break;S.push(y)}S.length*2{if(u==null&&(u=10),f==null&&(f=n===10?"s":","),typeof f!="function"&&(!(n%1)&&(f=Sc(f)).precision==null&&(f.trim=!0),f=Iw(f)),u===1/0)return f;const c=Math.max(1,n*u/t.ticks().length);return d=>{let h=d/a(Math.round(i(d)));return h*nr(hI(r(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function pI(){const e=Dw(up()).domain([1,10]);return e.copy=()=>eu(e,pI()).base(e.base()),sn.apply(e,arguments),e}function ZP(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function JP(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Lw(e){var t=1,r=e(ZP(t),JP(t));return r.constant=function(n){return arguments.length?e(ZP(t=+n),JP(t)):t},Zi(r)}function mI(){var e=Lw(up());return e.copy=function(){return eu(e,mI()).constant(e.constant())},sn.apply(e,arguments)}function eN(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function qW(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function UW(e){return e<0?-e*e:e*e}function $w(e){var t=e(fr,fr),r=1;function n(){return r===1?e(fr,fr):r===.5?e(qW,UW):e(eN(r),eN(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Zi(t)}function Bw(){var e=$w(up());return e.copy=function(){return eu(e,Bw()).exponent(e.exponent())},sn.apply(e,arguments),e}function WW(){return Bw.apply(null,arguments).exponent(.5)}function tN(e){return Math.sign(e)*e*e}function HW(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function vI(){var e=Rw(),t=[0,1],r=!1,n;function i(a){var s=HW(e(a));return isNaN(s)?n:r?Math.round(s):s}return i.invert=function(a){return e.invert(tN(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,Jd)).map(tN)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return vI(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},sn.apply(i,arguments),Zi(i)}function gI(){var e=[],t=[],r=[],n;function i(){var s=0,u=Math.max(1,t.length);for(r=new Array(u-1);++s0?r[u-1]:e[0],u=r?[n[r-1],t]:[n[c-1],n[c]]},s.unknown=function(f){return arguments.length&&(a=f),s},s.thresholds=function(){return n.slice()},s.copy=function(){return yI().domain([e,t]).range(i).unknown(a)},sn.apply(Zi(s),arguments)}function xI(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[Zc(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var s=t.indexOf(a);return[e[s-1],e[s]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return xI().domain(e).range(t).unknown(r)},sn.apply(i,arguments)}const nx=new Date,ix=new Date;function Ft(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const s=i(a),u=i.ceil(a);return a-s(t(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,u)=>{const f=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a0))return f;let c;do f.push(c=new Date(+a)),t(a,u),e(a);while(cFt(s=>{if(s>=s)for(;e(s),!a(s);)s.setTime(s-1)},(s,u)=>{if(s>=s)if(u<0)for(;++u<=0;)for(;t(s,-1),!a(s););else for(;--u>=0;)for(;t(s,1),!a(s););}),r&&(i.count=(a,s)=>(nx.setTime(+a),ix.setTime(+s),e(nx),e(ix),Math.floor(r(nx,ix))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const nh=Ft(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);nh.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Ft(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):nh);nh.range;const oi=1e3,nn=oi*60,si=nn*60,di=si*24,zw=di*7,rN=di*30,ax=di*365,Ta=Ft(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*oi)},(e,t)=>(t-e)/oi,e=>e.getUTCSeconds());Ta.range;const Fw=Ft(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*oi)},(e,t)=>{e.setTime(+e+t*nn)},(e,t)=>(t-e)/nn,e=>e.getMinutes());Fw.range;const qw=Ft(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*nn)},(e,t)=>(t-e)/nn,e=>e.getUTCMinutes());qw.range;const Uw=Ft(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*oi-e.getMinutes()*nn)},(e,t)=>{e.setTime(+e+t*si)},(e,t)=>(t-e)/si,e=>e.getHours());Uw.range;const Ww=Ft(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*si)},(e,t)=>(t-e)/si,e=>e.getUTCHours());Ww.range;const tu=Ft(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*nn)/di,e=>e.getDate()-1);tu.range;const fp=Ft(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/di,e=>e.getUTCDate()-1);fp.range;const bI=Ft(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/di,e=>Math.floor(e/di));bI.range;function Za(e){return Ft(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*nn)/zw)}const dp=Za(0),ih=Za(1),VW=Za(2),GW=Za(3),fs=Za(4),KW=Za(5),XW=Za(6);dp.range;ih.range;VW.range;GW.range;fs.range;KW.range;XW.range;function Ja(e){return Ft(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/zw)}const hp=Ja(0),ah=Ja(1),YW=Ja(2),QW=Ja(3),ds=Ja(4),ZW=Ja(5),JW=Ja(6);hp.range;ah.range;YW.range;QW.range;ds.range;ZW.range;JW.range;const Hw=Ft(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Hw.range;const Vw=Ft(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Vw.range;const hi=Ft(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());hi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ft(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});hi.range;const pi=Ft(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());pi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ft(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});pi.range;function wI(e,t,r,n,i,a){const s=[[Ta,1,oi],[Ta,5,5*oi],[Ta,15,15*oi],[Ta,30,30*oi],[a,1,nn],[a,5,5*nn],[a,15,15*nn],[a,30,30*nn],[i,1,si],[i,3,3*si],[i,6,6*si],[i,12,12*si],[n,1,di],[n,2,2*di],[r,1,zw],[t,1,rN],[t,3,3*rN],[e,1,ax]];function u(c,d,h){const m=dw).right(s,m);if(g===s.length)return e.every(Db(c/ax,d/ax,h));if(g===0)return nh.every(Math.max(Db(c,d,h),1));const[b,y]=s[m/s[g-1][2]53)return null;"w"in re||(re.w=1),"Z"in re?(Te=sx(Dl(re.y,0,1)),Ke=Te.getUTCDay(),Te=Ke>4||Ke===0?ah.ceil(Te):ah(Te),Te=fp.offset(Te,(re.V-1)*7),re.y=Te.getUTCFullYear(),re.m=Te.getUTCMonth(),re.d=Te.getUTCDate()+(re.w+6)%7):(Te=ox(Dl(re.y,0,1)),Ke=Te.getDay(),Te=Ke>4||Ke===0?ih.ceil(Te):ih(Te),Te=tu.offset(Te,(re.V-1)*7),re.y=Te.getFullYear(),re.m=Te.getMonth(),re.d=Te.getDate()+(re.w+6)%7)}else("W"in re||"U"in re)&&("w"in re||(re.w="u"in re?re.u%7:"W"in re?1:0),Ke="Z"in re?sx(Dl(re.y,0,1)).getUTCDay():ox(Dl(re.y,0,1)).getDay(),re.m=0,re.d="W"in re?(re.w+6)%7+re.W*7-(Ke+5)%7:re.w+re.U*7-(Ke+6)%7);return"Z"in re?(re.H+=re.Z/100|0,re.M+=re.Z%100,sx(re)):ox(re)}}function R(ie,ue,ve,re){for(var De=0,Te=ue.length,Ke=ve.length,lt,vt;De=Ke)return-1;if(lt=ue.charCodeAt(De++),lt===37){if(lt=ue.charAt(De++),vt=A[lt in nN?ue.charAt(De++):lt],!vt||(re=vt(ie,ve,re))<0)return-1}else if(lt!=ve.charCodeAt(re++))return-1}return re}function I(ie,ue,ve){var re=c.exec(ue.slice(ve));return re?(ie.p=d.get(re[0].toLowerCase()),ve+re[0].length):-1}function q(ie,ue,ve){var re=g.exec(ue.slice(ve));return re?(ie.w=b.get(re[0].toLowerCase()),ve+re[0].length):-1}function L(ie,ue,ve){var re=h.exec(ue.slice(ve));return re?(ie.w=m.get(re[0].toLowerCase()),ve+re[0].length):-1}function D(ie,ue,ve){var re=S.exec(ue.slice(ve));return re?(ie.m=O.get(re[0].toLowerCase()),ve+re[0].length):-1}function U(ie,ue,ve){var re=y.exec(ue.slice(ve));return re?(ie.m=w.get(re[0].toLowerCase()),ve+re[0].length):-1}function H(ie,ue,ve){return R(ie,t,ue,ve)}function V(ie,ue,ve){return R(ie,r,ue,ve)}function K(ie,ue,ve){return R(ie,n,ue,ve)}function X(ie){return s[ie.getDay()]}function B(ie){return a[ie.getDay()]}function Z(ie){return f[ie.getMonth()]}function ee(ie){return u[ie.getMonth()]}function M(ie){return i[+(ie.getHours()>=12)]}function $(ie){return 1+~~(ie.getMonth()/3)}function Q(ie){return s[ie.getUTCDay()]}function ae(ie){return a[ie.getUTCDay()]}function pe(ie){return f[ie.getUTCMonth()]}function ye(ie){return u[ie.getUTCMonth()]}function oe(ie){return i[+(ie.getUTCHours()>=12)]}function me(ie){return 1+~~(ie.getUTCMonth()/3)}return{format:function(ie){var ue=N(ie+="",E);return ue.toString=function(){return ie},ue},parse:function(ie){var ue=T(ie+="",!1);return ue.toString=function(){return ie},ue},utcFormat:function(ie){var ue=N(ie+="",C);return ue.toString=function(){return ie},ue},utcParse:function(ie){var ue=T(ie+="",!0);return ue.toString=function(){return ie},ue}}}var nN={"-":"",_:" ",0:"0"},Gt=/^\s*\d+/,aH=/^%/,oH=/[\\^$*+?|[\]().{}]/g;function et(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function lH(e,t,r){var n=Gt.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function cH(e,t,r){var n=Gt.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function uH(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function fH(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function dH(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function iN(e,t,r){var n=Gt.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function aN(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function hH(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function pH(e,t,r){var n=Gt.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function mH(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function oN(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function vH(e,t,r){var n=Gt.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function sN(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function gH(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function yH(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function xH(e,t,r){var n=Gt.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function bH(e,t,r){var n=Gt.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function wH(e,t,r){var n=aH.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function _H(e,t,r){var n=Gt.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function SH(e,t,r){var n=Gt.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function lN(e,t){return et(e.getDate(),t,2)}function OH(e,t){return et(e.getHours(),t,2)}function jH(e,t){return et(e.getHours()%12||12,t,2)}function EH(e,t){return et(1+tu.count(hi(e),e),t,3)}function _I(e,t){return et(e.getMilliseconds(),t,3)}function AH(e,t){return _I(e,t)+"000"}function PH(e,t){return et(e.getMonth()+1,t,2)}function NH(e,t){return et(e.getMinutes(),t,2)}function CH(e,t){return et(e.getSeconds(),t,2)}function TH(e){var t=e.getDay();return t===0?7:t}function kH(e,t){return et(dp.count(hi(e)-1,e),t,2)}function SI(e){var t=e.getDay();return t>=4||t===0?fs(e):fs.ceil(e)}function RH(e,t){return e=SI(e),et(fs.count(hi(e),e)+(hi(e).getDay()===4),t,2)}function MH(e){return e.getDay()}function IH(e,t){return et(ih.count(hi(e)-1,e),t,2)}function DH(e,t){return et(e.getFullYear()%100,t,2)}function LH(e,t){return e=SI(e),et(e.getFullYear()%100,t,2)}function $H(e,t){return et(e.getFullYear()%1e4,t,4)}function BH(e,t){var r=e.getDay();return e=r>=4||r===0?fs(e):fs.ceil(e),et(e.getFullYear()%1e4,t,4)}function zH(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+et(t/60|0,"0",2)+et(t%60,"0",2)}function cN(e,t){return et(e.getUTCDate(),t,2)}function FH(e,t){return et(e.getUTCHours(),t,2)}function qH(e,t){return et(e.getUTCHours()%12||12,t,2)}function UH(e,t){return et(1+fp.count(pi(e),e),t,3)}function OI(e,t){return et(e.getUTCMilliseconds(),t,3)}function WH(e,t){return OI(e,t)+"000"}function HH(e,t){return et(e.getUTCMonth()+1,t,2)}function VH(e,t){return et(e.getUTCMinutes(),t,2)}function GH(e,t){return et(e.getUTCSeconds(),t,2)}function KH(e){var t=e.getUTCDay();return t===0?7:t}function XH(e,t){return et(hp.count(pi(e)-1,e),t,2)}function jI(e){var t=e.getUTCDay();return t>=4||t===0?ds(e):ds.ceil(e)}function YH(e,t){return e=jI(e),et(ds.count(pi(e),e)+(pi(e).getUTCDay()===4),t,2)}function QH(e){return e.getUTCDay()}function ZH(e,t){return et(ah.count(pi(e)-1,e),t,2)}function JH(e,t){return et(e.getUTCFullYear()%100,t,2)}function eV(e,t){return e=jI(e),et(e.getUTCFullYear()%100,t,2)}function tV(e,t){return et(e.getUTCFullYear()%1e4,t,4)}function rV(e,t){var r=e.getUTCDay();return e=r>=4||r===0?ds(e):ds.ceil(e),et(e.getUTCFullYear()%1e4,t,4)}function nV(){return"+0000"}function uN(){return"%"}function fN(e){return+e}function dN(e){return Math.floor(+e/1e3)}var ko,EI,AI;iV({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function iV(e){return ko=iH(e),EI=ko.format,ko.parse,AI=ko.utcFormat,ko.utcParse,ko}function aV(e){return new Date(e)}function oV(e){return e instanceof Date?+e:+new Date(+e)}function Gw(e,t,r,n,i,a,s,u,f,c){var d=Rw(),h=d.invert,m=d.domain,g=c(".%L"),b=c(":%S"),y=c("%I:%M"),w=c("%I %p"),S=c("%a %d"),O=c("%b %d"),E=c("%B"),C=c("%Y");function A(N){return(f(N)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>XU(e,a/n))},r.copy=function(){return TI(t).domain(e)},bi.apply(r,arguments)}function mp(){var e=0,t=.5,r=1,n=1,i,a,s,u,f,c=fr,d,h=!1,m;function g(y){return isNaN(y=+y)?m:(y=.5+((y=+d(y))-a)*(n*yr}return cx=e,cx}var ux,vN;function fV(){if(vN)return ux;vN=1;var e=vp(),t=II(),r=Ls();function n(i){return i&&i.length?e(i,r,t):void 0}return ux=n,ux}var dV=fV();const gp=it(dV);var fx,gN;function DI(){if(gN)return fx;gN=1;function e(t,r){return te.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};_e.decimalPlaces=_e.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*xt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};_e.dividedBy=_e.div=function(e){return ui(this,new this.constructor(e))};_e.dividedToIntegerBy=_e.idiv=function(e){var t=this,r=t.constructor;return ft(ui(t,new r(e),0,1),r.precision)};_e.equals=_e.eq=function(e){return!this.cmp(e)};_e.exponent=function(){return kt(this)};_e.greaterThan=_e.gt=function(e){return this.cmp(e)>0};_e.greaterThanOrEqualTo=_e.gte=function(e){return this.cmp(e)>=0};_e.isInteger=_e.isint=function(){return this.e>this.d.length-2};_e.isNegative=_e.isneg=function(){return this.s<0};_e.isPositive=_e.ispos=function(){return this.s>0};_e.isZero=function(){return this.s===0};_e.lessThan=_e.lt=function(e){return this.cmp(e)<0};_e.lessThanOrEqualTo=_e.lte=function(e){return this.cmp(e)<1};_e.logarithm=_e.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Br))throw Error(an+"NaN");if(r.s<1)throw Error(an+(r.s?"NaN":"-Infinity"));return r.eq(Br)?new n(0):(wt=!1,t=ui(Oc(r,a),Oc(e,a),a),wt=!0,ft(t,i))};_e.minus=_e.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?zI(t,e):$I(t,(e.s=-e.s,e))};_e.modulo=_e.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(an+"NaN");return r.s?(wt=!1,t=ui(r,e,0,1).times(e),wt=!0,r.minus(t)):ft(new n(r),i)};_e.naturalExponential=_e.exp=function(){return BI(this)};_e.naturalLogarithm=_e.ln=function(){return Oc(this)};_e.negated=_e.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};_e.plus=_e.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?$I(t,e):zI(t,(e.s=-e.s,e))};_e.precision=_e.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ma+e);if(t=kt(i)+1,n=i.d.length-1,r=n*xt+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};_e.squareRoot=_e.sqrt=function(){var e,t,r,n,i,a,s,u=this,f=u.constructor;if(u.s<1){if(!u.s)return new f(0);throw Error(an+"NaN")}for(e=kt(u),wt=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=In(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=zs((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new f(t)):n=new f(i.toString()),r=f.precision,i=s=r+3;;)if(a=n,n=a.plus(ui(u,a,s+2)).times(.5),In(a.d).slice(0,s)===(t=In(n.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(ft(a,r+1,0),a.times(a).eq(u)){n=a;break}}else if(t!="9999")break;s+=4}return wt=!0,ft(n,r)};_e.times=_e.mul=function(e){var t,r,n,i,a,s,u,f,c,d=this,h=d.constructor,m=d.d,g=(e=new h(e)).d;if(!d.s||!e.s)return new h(0);for(e.s*=d.s,r=d.e+e.e,f=m.length,c=g.length,f=0;){for(t=0,i=f+n;i>n;)u=a[i]+g[n]*m[i-n-1]+t,a[i--]=u%Ht|0,t=u/Ht|0;a[i]=(a[i]+t)%Ht|0}for(;!a[--s];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,wt?ft(e,h.precision):e};_e.toDecimalPlaces=_e.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(zn(e,0,Bs),t===void 0?t=n.rounding:zn(t,0,8),ft(r,e+kt(r)+1,t))};_e.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Ba(n,!0):(zn(e,0,Bs),t===void 0?t=i.rounding:zn(t,0,8),n=ft(new i(n),e+1,t),r=Ba(n,!0,e+1)),r};_e.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?Ba(i):(zn(e,0,Bs),t===void 0?t=a.rounding:zn(t,0,8),n=ft(new a(i),e+kt(i)+1,t),r=Ba(n.abs(),!1,e+kt(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};_e.toInteger=_e.toint=function(){var e=this,t=e.constructor;return ft(new t(e),kt(e)+1,t.rounding)};_e.toNumber=function(){return+this};_e.toPower=_e.pow=function(e){var t,r,n,i,a,s,u=this,f=u.constructor,c=12,d=+(e=new f(e));if(!e.s)return new f(Br);if(u=new f(u),!u.s){if(e.s<1)throw Error(an+"Infinity");return u}if(u.eq(Br))return u;if(n=f.precision,e.eq(Br))return ft(u,n);if(t=e.e,r=e.d.length-1,s=t>=r,a=u.s,s){if((r=d<0?-d:d)<=LI){for(i=new f(Br),t=Math.ceil(n/xt+4),wt=!1;r%2&&(i=i.times(u),SN(i.d,t)),r=zs(r/2),r!==0;)u=u.times(u),SN(u.d,t);return wt=!0,e.s<0?new f(Br).div(i):ft(i,n)}}else if(a<0)throw Error(an+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,u.s=1,wt=!1,i=e.times(Oc(u,n+c)),wt=!0,i=BI(i),i.s=a,i};_e.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=kt(i),n=Ba(i,r<=a.toExpNeg||r>=a.toExpPos)):(zn(e,1,Bs),t===void 0?t=a.rounding:zn(t,0,8),i=ft(new a(i),e,t),r=kt(i),n=Ba(i,e<=r||r<=a.toExpNeg,e)),n};_e.toSignificantDigits=_e.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(zn(e,1,Bs),t===void 0?t=n.rounding:zn(t,0,8)),ft(new n(r),e,t)};_e.toString=_e.valueOf=_e.val=_e.toJSON=_e[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=kt(e),r=e.constructor;return Ba(e,t<=r.toExpNeg||t>=r.toExpPos)};function $I(e,t){var r,n,i,a,s,u,f,c,d=e.constructor,h=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),wt?ft(t,h):t;if(f=e.d,c=t.d,s=e.e,i=t.e,f=f.slice(),a=s-i,a){for(a<0?(n=f,a=-a,u=c.length):(n=c,i=s,u=f.length),s=Math.ceil(h/xt),u=s>u?s+1:u+1,a>u&&(a=u,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(u=f.length,a=c.length,u-a<0&&(a=u,n=c,c=f,f=n),r=0;a;)r=(f[--a]=f[a]+c[a]+r)/Ht|0,f[a]%=Ht;for(r&&(f.unshift(r),++i),u=f.length;f[--u]==0;)f.pop();return t.d=f,t.e=i,wt?ft(t,h):t}function zn(e,t,r){if(e!==~~e||er)throw Error(Ma+e)}function In(e){var t,r,n,i=e.length-1,a="",s=e[0];if(i>0){for(a+=s,t=1;ts?1:-1;else for(u=f=0;ui[u]?1:-1;break}return f}function r(n,i,a){for(var s=0;a--;)n[a]-=s,s=n[a]1;)n.shift()}return function(n,i,a,s){var u,f,c,d,h,m,g,b,y,w,S,O,E,C,A,N,T,R,I=n.constructor,q=n.s==i.s?1:-1,L=n.d,D=i.d;if(!n.s)return new I(n);if(!i.s)throw Error(an+"Division by zero");for(f=n.e-i.e,T=D.length,A=L.length,g=new I(q),b=g.d=[],c=0;D[c]==(L[c]||0);)++c;if(D[c]>(L[c]||0)&&--f,a==null?O=a=I.precision:s?O=a+(kt(n)-kt(i))+1:O=a,O<0)return new I(0);if(O=O/xt+2|0,c=0,T==1)for(d=0,D=D[0],O++;(c1&&(D=e(D,d),L=e(L,d),T=D.length,A=L.length),C=T,y=L.slice(0,T),w=y.length;w=Ht/2&&++N;do d=0,u=t(D,y,T,w),u<0?(S=y[0],T!=w&&(S=S*Ht+(y[1]||0)),d=S/N|0,d>1?(d>=Ht&&(d=Ht-1),h=e(D,d),m=h.length,w=y.length,u=t(h,y,m,w),u==1&&(d--,r(h,T16)throw Error(Yw+kt(e));if(!e.s)return new d(Br);for(wt=!1,u=h,s=new d(.03125);e.abs().gte(.1);)e=e.times(s),c+=5;for(n=Math.log(Aa(2,c))/Math.LN10*2+5|0,u+=n,r=i=a=new d(Br),d.precision=u;;){if(i=ft(i.times(e),u),r=r.times(++f),s=a.plus(ui(i,r,u)),In(s.d).slice(0,u)===In(a.d).slice(0,u)){for(;c--;)a=ft(a.times(a),u);return d.precision=h,t==null?(wt=!0,ft(a,h)):a}a=s}}function kt(e){for(var t=e.e*xt,r=e.d[0];r>=10;r/=10)t++;return t}function vx(e,t,r){if(t>e.LN10.sd())throw wt=!0,r&&(e.precision=r),Error(an+"LN10 precision limit exceeded");return ft(new e(e.LN10),t)}function Ui(e){for(var t="";e--;)t+="0";return t}function Oc(e,t){var r,n,i,a,s,u,f,c,d,h=1,m=10,g=e,b=g.d,y=g.constructor,w=y.precision;if(g.s<1)throw Error(an+(g.s?"NaN":"-Infinity"));if(g.eq(Br))return new y(0);if(t==null?(wt=!1,c=w):c=t,g.eq(10))return t==null&&(wt=!0),vx(y,c);if(c+=m,y.precision=c,r=In(b),n=r.charAt(0),a=kt(g),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)g=g.times(e),r=In(g.d),n=r.charAt(0),h++;a=kt(g),n>1?(g=new y("0."+r),a++):g=new y(n+"."+r.slice(1))}else return f=vx(y,c+2,w).times(a+""),g=Oc(new y(n+"."+r.slice(1)),c-m).plus(f),y.precision=w,t==null?(wt=!0,ft(g,w)):g;for(u=s=g=ui(g.minus(Br),g.plus(Br),c),d=ft(g.times(g),c),i=3;;){if(s=ft(s.times(d),c),f=u.plus(ui(s,new y(i),c)),In(f.d).slice(0,c)===In(u.d).slice(0,c))return u=u.times(2),a!==0&&(u=u.plus(vx(y,c+2,w).times(a+""))),u=ui(u,new y(h),c),y.precision=w,t==null?(wt=!0,ft(u,w)):u;u=f,i+=2}}function _N(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=zs(r/xt),e.d=[],n=(r+1)%xt,r<0&&(n+=xt),noh||e.e<-oh))throw Error(Yw+r)}else e.s=0,e.e=0,e.d=[0];return e}function ft(e,t,r){var n,i,a,s,u,f,c,d,h=e.d;for(s=1,a=h[0];a>=10;a/=10)s++;if(n=t-s,n<0)n+=xt,i=t,c=h[d=0];else{if(d=Math.ceil((n+1)/xt),a=h.length,d>=a)return e;for(c=a=h[d],s=1;a>=10;a/=10)s++;n%=xt,i=n-xt+s}if(r!==void 0&&(a=Aa(10,s-i-1),u=c/a%10|0,f=t<0||h[d+1]!==void 0||c%a,f=r<4?(u||f)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||f||r==6&&(n>0?i>0?c/Aa(10,s-i):0:h[d-1])%10&1||r==(e.s<0?8:7))),t<1||!h[0])return f?(a=kt(e),h.length=1,t=t-a-1,h[0]=Aa(10,(xt-t%xt)%xt),e.e=zs(-t/xt)||0):(h.length=1,h[0]=e.e=e.s=0),e;if(n==0?(h.length=d,a=1,d--):(h.length=d+1,a=Aa(10,xt-n),h[d]=i>0?(c/Aa(10,s-i)%Aa(10,i)|0)*a:0),f)for(;;)if(d==0){(h[0]+=a)==Ht&&(h[0]=1,++e.e);break}else{if(h[d]+=a,h[d]!=Ht)break;h[d--]=0,a=1}for(n=h.length;h[--n]===0;)h.pop();if(wt&&(e.e>oh||e.e<-oh))throw Error(Yw+kt(e));return e}function zI(e,t){var r,n,i,a,s,u,f,c,d,h,m=e.constructor,g=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),wt?ft(t,g):t;if(f=e.d,h=t.d,n=t.e,c=e.e,f=f.slice(),s=c-n,s){for(d=s<0,d?(r=f,s=-s,u=h.length):(r=h,n=c,u=f.length),i=Math.max(Math.ceil(g/xt),u)+2,s>i&&(s=i,r.length=1),r.reverse(),i=s;i--;)r.push(0);r.reverse()}else{for(i=f.length,u=h.length,d=i0;--i)f[u++]=0;for(i=h.length;i>s;){if(f[--i]0?a=a.charAt(0)+"."+a.slice(1)+Ui(n):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Ui(-i-1)+a,r&&(n=r-s)>0&&(a+=Ui(n))):i>=s?(a+=Ui(i+1-s),r&&(n=r-i-1)>0&&(a=a+"."+Ui(n))):((n=i+1)0&&(i+1===s&&(a+="."),a+=Ui(n))),e.s<0?"-"+a:a}function SN(e,t){if(e.length>t)return e.length=t,!0}function FI(e){var t,r,n;function i(a){var s=this;if(!(s instanceof i))return new i(a);if(s.constructor=i,a instanceof i){s.s=a.s,s.e=a.e,s.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Ma+a);if(a>0)s.s=1;else if(a<0)a=-a,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(a===~~a&&a<1e7){s.e=0,s.d=[a];return}return _N(s,a.toString())}else if(typeof a!="string")throw Error(Ma+a);if(a.charCodeAt(0)===45?(a=a.slice(1),s.s=-1):s.s=1,_V.test(a))_N(s,a);else throw Error(Ma+a)}if(i.prototype=_e,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=FI,i.config=i.set=SV,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Ma+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Ma+r+": "+n);return this}var Qw=FI(wV);Br=new Qw(1);const ut=Qw;function OV(e){return PV(e)||AV(e)||EV(e)||jV()}function jV(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function EV(e,t){if(e){if(typeof e=="string")return Fb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fb(e,t)}}function AV(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function PV(e){if(Array.isArray(e))return Fb(e)}function Fb(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-s,ON(function(){for(var u=arguments.length,f=new Array(u),c=0;ce.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var s=e[Symbol.iterator](),u;!(n=(u=s.next()).done)&&(r.push(u.value),!(t&&r.length===t));n=!0);}catch(f){i=!0,a=f}finally{try{!n&&s.return!=null&&s.return()}finally{if(i)throw a}}return r}}function UV(e){if(Array.isArray(e))return e}function VI(e){var t=jc(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function GI(e,t,r){if(e.lte(0))return new ut(0);var n=bp.getDigitCount(e.toNumber()),i=new ut(10).pow(n),a=e.div(i),s=n!==1?.05:.1,u=new ut(Math.ceil(a.div(s).toNumber())).add(r).mul(s),f=u.mul(i);return t?f:new ut(Math.ceil(f))}function WV(e,t,r){var n=1,i=new ut(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new ut(10).pow(bp.getDigitCount(e)-1),i=new ut(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new ut(Math.floor(e)))}else e===0?i=new ut(Math.floor((t-1)/2)):r||(i=new ut(Math.floor(e)));var s=Math.floor((t-1)/2),u=kV(TV(function(f){return i.add(new ut(f-s).mul(n)).toNumber()}),qb);return u(0,t)}function KI(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new ut(0),tickMin:new ut(0),tickMax:new ut(0)};var a=GI(new ut(t).sub(e).div(r-1),n,i),s;e<=0&&t>=0?s=new ut(0):(s=new ut(e).add(t).div(2),s=s.sub(new ut(s).mod(a)));var u=Math.ceil(s.sub(e).div(a).toNumber()),f=Math.ceil(new ut(t).sub(s).div(a).toNumber()),c=u+f+1;return c>r?KI(e,t,r,n,i+1):(c0?f+(r-c):f,u=t>0?u:u+(r-c)),{step:a,tickMin:s.sub(new ut(u).mul(a)),tickMax:s.add(new ut(f).mul(a))})}function HV(e){var t=jc(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(i,2),u=VI([r,n]),f=jc(u,2),c=f[0],d=f[1];if(c===-1/0||d===1/0){var h=d===1/0?[c].concat(Wb(qb(0,i-1).map(function(){return 1/0}))):[].concat(Wb(qb(0,i-1).map(function(){return-1/0})),[d]);return r>n?Ub(h):h}if(c===d)return WV(c,i,a);var m=KI(c,d,s,a),g=m.step,b=m.tickMin,y=m.tickMax,w=bp.rangeStep(b,y.add(new ut(.1).mul(g)),g);return r>n?Ub(w):w}function VV(e,t){var r=jc(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=VI([n,i]),u=jc(s,2),f=u[0],c=u[1];if(f===-1/0||c===1/0)return[n,i];if(f===c)return[f];var d=Math.max(t,2),h=GI(new ut(c).sub(f).div(d-1),a,0),m=[].concat(Wb(bp.rangeStep(new ut(f),new ut(c).sub(new ut(.99).mul(h)),h)),[c]);return n>i?Ub(m):m}var GV=WI(HV),KV=WI(VV),XV="Invariant failed";function za(e,t){throw new Error(XV)}var YV=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function hs(e){"@babel/helpers - typeof";return hs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hs(e)}function sh(){return sh=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nG(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 iG(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aG(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,s=-1,u=(r=n?.length)!==null&&r!==void 0?r:0;if(u<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var f=a.range,c=0;c0?i[c-1].coordinate:i[u-1].coordinate,h=i[c].coordinate,m=c>=u-1?i[0].coordinate:i[c+1].coordinate,g=void 0;if(cr(h-d)!==cr(m-h)){var b=[];if(cr(m-h)===cr(f[1]-f[0])){g=m;var y=h+f[1]-f[0];b[0]=Math.min(y,(y+d)/2),b[1]=Math.max(y,(y+d)/2)}else{g=d;var w=m+f[1]-f[0];b[0]=Math.min(h,(w+h)/2),b[1]=Math.max(h,(w+h)/2)}var S=[Math.min(h,(g+h)/2),Math.max(h,(g+h)/2)];if(t>S[0]&&t<=S[1]||t>=b[0]&&t<=b[1]){s=i[c].index;break}}else{var O=Math.min(d,m),E=Math.max(d,m);if(t>(O+h)/2&&t<=(E+h)/2){s=i[c].index;break}}}else for(var C=0;C0&&C(n[C].coordinate+n[C-1].coordinate)/2&&t<=(n[C].coordinate+n[C+1].coordinate)/2||C===u-1&&t>(n[C].coordinate+n[C-1].coordinate)/2){s=n[C].index;break}return s},Zw=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?At(At({},t.type.defaultProps),t.props):t.props,s=a.stroke,u=a.fill,f;switch(i){case"Line":f=s;break;case"Area":case"Radar":f=s&&s!=="none"?s:u;break;default:f=u;break}return f},_G=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var s={},u=Object.keys(a),f=0,c=u.length;f=0});if(S&&S.length){var O=S[0].type.defaultProps,E=O!==void 0?At(At({},O),S[0].props):S[0].props,C=E.barSize,A=E[w];s[A]||(s[A]=[]);var N=qe(C)?r:C;s[A].push({item:S[0],stackList:S.slice(1),barSize:qe(N)?void 0:ur(N,n,0)})}}return s},SG=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,s=a===void 0?[]:a,u=t.maxBarSize,f=s.length;if(f<1)return null;var c=ur(r,i,0,!0),d,h=[];if(s[0].barSize===+s[0].barSize){var m=!1,g=i/f,b=s.reduce(function(C,A){return C+A.barSize||0},0);b+=(f-1)*c,b>=i&&(b-=(f-1)*c,c=0),b>=i&&g>0&&(m=!0,g*=.9,b=f*g);var y=(i-b)/2>>0,w={offset:y-c,size:0};d=s.reduce(function(C,A){var N={item:A.item,position:{offset:w.offset+w.size+c,size:m?g:A.barSize}},T=[].concat(AN(C),[N]);return w=T[T.length-1].position,A.stackList&&A.stackList.length&&A.stackList.forEach(function(R){T.push({item:R,position:w})}),T},h)}else{var S=ur(n,i,0,!0);i-2*S-(f-1)*c<=0&&(c=0);var O=(i-2*S-(f-1)*c)/f;O>1&&(O>>=0);var E=u===+u?Math.min(O,u):O;d=s.reduce(function(C,A,N){var T=[].concat(AN(C),[{item:A.item,position:{offset:S+(O+c)*N+(O-E)/2,size:E}}]);return A.stackList&&A.stackList.length&&A.stackList.forEach(function(R){T.push({item:R,position:T[T.length-1].position})}),T},h)}return d},OG=function(t,r,n,i){var a=n.children,s=n.width,u=n.margin,f=s-(u.left||0)-(u.right||0),c=ZI({children:a,legendWidth:f});if(c){var d=i||{},h=d.width,m=d.height,g=c.align,b=c.verticalAlign,y=c.layout;if((y==="vertical"||y==="horizontal"&&b==="middle")&&g!=="center"&&he(t[g]))return At(At({},t),{},Jo({},g,t[g]+(h||0)));if((y==="horizontal"||y==="vertical"&&g==="center")&&b!=="middle"&&he(t[b]))return At(At({},t),{},Jo({},b,t[b]+(m||0)))}return t},jG=function(t,r,n){return qe(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},JI=function(t,r,n,i,a){var s=r.props.children,u=Fr(s,nu).filter(function(c){return jG(i,a,c.props.direction)});if(u&&u.length){var f=u.map(function(c){return c.props.dataKey});return t.reduce(function(c,d){var h=Bt(d,n);if(qe(h))return c;var m=Array.isArray(h)?[yp(h),gp(h)]:[h,h],g=f.reduce(function(b,y){var w=Bt(d,y,0),S=m[0]-Math.abs(Array.isArray(w)?w[0]:w),O=m[1]+Math.abs(Array.isArray(w)?w[1]:w);return[Math.min(S,b[0]),Math.max(O,b[1])]},[1/0,-1/0]);return[Math.min(g[0],c[0]),Math.max(g[1],c[1])]},[1/0,-1/0])}return null},EG=function(t,r,n,i,a){var s=r.map(function(u){return JI(t,u,n,a,i)}).filter(function(u){return!qe(u)});return s&&s.length?s.reduce(function(u,f){return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]):null},eD=function(t,r,n,i,a){var s=r.map(function(f){var c=f.props.dataKey;return n==="number"&&c&&JI(t,f,c,i)||nc(t,c,n,a)});if(n==="number")return s.reduce(function(f,c){return[Math.min(f[0],c[0]),Math.max(f[1],c[1])]},[1/0,-1/0]);var u={};return s.reduce(function(f,c){for(var d=0,h=c.length;d=2?cr(u[0]-u[1])*2*c:c,r&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(h){var m=a?a.indexOf(h):h;return{coordinate:i(m)+c,value:h,offset:c}});return d.filter(function(h){return!Yc(h.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(h,m){return{coordinate:i(h)+c,value:h,index:m,offset:c}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(h){return{coordinate:i(h)+c,value:h,offset:c}}):i.domain().map(function(h,m){return{coordinate:i(h)+c,value:a?a[h]:h,index:m,offset:c}})},gx=new WeakMap,kf=function(t,r){if(typeof r!="function")return t;gx.has(t)||gx.set(t,new WeakMap);var n=gx.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},nD=function(t,r,n){var i=t.scale,a=t.type,s=t.layout,u=t.axisType;if(i==="auto")return s==="radial"&&u==="radiusAxis"?{scale:xc(),realScaleType:"band"}:s==="radial"&&u==="angleAxis"?{scale:rh(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:rc(),realScaleType:"point"}:a==="category"?{scale:xc(),realScaleType:"band"}:{scale:rh(),realScaleType:"linear"};if(Da(i)){var f="scale".concat(rp(i));return{scale:(hN[f]||rc)(),realScaleType:hN[f]?f:"point"}}return ze(i)?{scale:i}:{scale:rc(),realScaleType:"point"}},NN=1e-4,iD=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-NN,s=Math.max(i[0],i[1])+NN,u=t(r[0]),f=t(r[n-1]);(us||fs)&&t.domain([r[0],r[n-1]])}},AG=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(t[u][n][0]=a,t[u][n][1]=a+f,a=t[u][n][1]):(t[u][n][0]=s,t[u][n][1]=s+f,s=t[u][n][1])}},CG=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[s][n][0]=a,t[s][n][1]=a+u,a=t[s][n][1]):(t[s][n][0]=0,t[s][n][1]=0)}},TG={sign:NG,expand:yq,none:as,silhouette:xq,wiggle:bq,positive:CG},kG=function(t,r,n){var i=r.map(function(u){return u.props.dataKey}),a=TG[n],s=gq().keys(i).value(function(u,f){return+Bt(u,f,0)}).order(Sb).offset(a);return s(t)},RG=function(t,r,n,i,a,s){if(!t)return null;var u=s?r.reverse():r,f={},c=u.reduce(function(h,m){var g,b=(g=m.type)!==null&&g!==void 0&&g.defaultProps?At(At({},m.type.defaultProps),m.props):m.props,y=b.stackId,w=b.hide;if(w)return h;var S=b[n],O=h[S]||{hasStack:!1,stackGroups:{}};if(zt(y)){var E=O.stackGroups[y]||{numericAxisId:n,cateAxisId:i,items:[]};E.items.push(m),O.hasStack=!0,O.stackGroups[y]=E}else O.stackGroups[Ds("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[m]};return At(At({},h),{},Jo({},S,O))},f),d={};return Object.keys(c).reduce(function(h,m){var g=c[m];if(g.hasStack){var b={};g.stackGroups=Object.keys(g.stackGroups).reduce(function(y,w){var S=g.stackGroups[w];return At(At({},y),{},Jo({},w,{numericAxisId:n,cateAxisId:i,items:S.items,stackedData:kG(t,S.items,a)}))},b)}return At(At({},h),{},Jo({},m,g))},d)},aD=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,s=r.originalDomain,u=r.allowDecimals,f=n||r.scale;if(f!=="auto"&&f!=="linear")return null;if(a&&i==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var c=t.domain();if(!c.length)return null;var d=GV(c,a,u);return t.domain([yp(d),gp(d)]),{niceTicks:d}}if(a&&i==="number"){var h=t.domain(),m=KV(h,a,u);return{niceTicks:m}}return null};function CN(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,a=e.index,s=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!qe(i[t.dataKey])){var u=Dd(r,"value",i[t.dataKey]);if(u)return u.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var f=Bt(i,qe(s)?t.dataKey:s);return qe(f)?null:t.scale(f)}var TN=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,s=t.entry,u=t.index;if(r.type==="category")return n[u]?n[u].coordinate+i:null;var f=Bt(s,r.dataKey,r.domain[u]);return qe(f)?null:r.scale(f)-a/2+i},MG=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},IG=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?At(At({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(zt(a)){var s=r[a];if(s){var u=s.items.indexOf(t);return u>=0?s.stackedData[u]:null}}return null},DG=function(t){return t.reduce(function(r,n){return[yp(n.concat([r[0]]).filter(he)),gp(n.concat([r[1]]).filter(he))]},[1/0,-1/0])},oD=function(t,r,n){return Object.keys(t).reduce(function(i,a){var s=t[a],u=s.stackedData,f=u.reduce(function(c,d){var h=DG(d.slice(r,n+1));return[Math.min(c[0],h[0]),Math.max(c[1],h[1])]},[1/0,-1/0]);return[Math.min(f[0],i[0]),Math.max(f[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},kN=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,RN=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Kb=function(t,r,n){if(ze(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(he(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(kN.test(t[0])){var a=+kN.exec(t[0])[1];i[0]=r[0]-a}else ze(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(he(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(RN.test(t[1])){var s=+RN.exec(t[1])[1];i[1]=r[1]+s}else ze(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},ch=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=Ew(r,function(h){return h.coordinate}),s=1/0,u=1,f=a.length;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},HG=function(t,r,n,i,a){var s=t.width,u=t.height,f=t.startAngle,c=t.endAngle,d=ur(t.cx,s,s/2),h=ur(t.cy,u,u/2),m=cD(s,u,n),g=ur(t.innerRadius,m,0),b=ur(t.outerRadius,m,m*.8),y=Object.keys(r);return y.reduce(function(w,S){var O=r[S],E=O.domain,C=O.reversed,A;if(qe(O.range))i==="angleAxis"?A=[f,c]:i==="radiusAxis"&&(A=[g,b]),C&&(A=[A[1],A[0]]);else{A=O.range;var N=A,T=BG(N,2);f=T[0],c=T[1]}var R=nD(O,a),I=R.realScaleType,q=R.scale;q.domain(E).range(A),iD(q);var L=aD(q,ai(ai({},O),{},{realScaleType:I})),D=ai(ai(ai({},O),L),{},{range:A,radius:b,realScaleType:I,scale:q,cx:d,cy:h,innerRadius:g,outerRadius:b,startAngle:f,endAngle:c});return ai(ai({},w),{},lD({},S,D))},{})},VG=function(t,r){var n=t.x,i=t.y,a=r.x,s=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-s,2))},GG=function(t,r){var n=t.x,i=t.y,a=r.cx,s=r.cy,u=VG({x:n,y:i},{x:a,y:s});if(u<=0)return{radius:u};var f=(n-a)/u,c=Math.acos(f);return i>s&&(c=2*Math.PI-c),{radius:u,angle:WG(c),angleInRadian:c}},KG=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),s=Math.min(i,a);return{startAngle:r-s*360,endAngle:n-s*360}},XG=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),s=Math.floor(i/360),u=Math.min(a,s);return t+u*360},LN=function(t,r){var n=t.x,i=t.y,a=GG({x:n,y:i},r),s=a.radius,u=a.angle,f=r.innerRadius,c=r.outerRadius;if(sc)return!1;if(s===0)return!0;var d=KG(r),h=d.startAngle,m=d.endAngle,g=u,b;if(h<=m){for(;g>m;)g-=360;for(;g=h&&g<=m}else{for(;g>h;)g-=360;for(;g=m&&g<=h}return b?ai(ai({},r),{},{radius:s,angle:XG(g,r)}):null},uD=function(t){return!P.isValidElement(t)&&!ze(t)&&typeof t!="boolean"?t.className:""};function Nc(e){"@babel/helpers - typeof";return Nc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nc(e)}var YG=["offset"];function QG(e){return tK(e)||eK(e)||JG(e)||ZG()}function ZG(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JG(e,t){if(e){if(typeof e=="string")return Xb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xb(e,t)}}function eK(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function tK(e){if(Array.isArray(e))return Xb(e)}function Xb(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nK(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 $N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $t(e){for(var t=1;t=0?1:-1,E,C;i==="insideStart"?(E=g+O*s,C=y):i==="insideEnd"?(E=b-O*s,C=!y):i==="end"&&(E=b+O*s,C=y),C=S<=0?C:!C;var A=mt(c,d,w,E),N=mt(c,d,w,E+(C?1:-1)*359),T="M".concat(A.x,",").concat(A.y,` - A`).concat(w,",").concat(w,",0,1,").concat(C?0:1,`, - `).concat(N.x,",").concat(N.y),R=qe(t.id)?Ds("recharts-radial-line-"):t.id;return z.createElement("text",Cc({},n,{dominantBaseline:"central",className:Ue("recharts-radial-bar-label",u)}),z.createElement("defs",null,z.createElement("path",{id:R,d:T})),z.createElement("textPath",{xlinkHref:"#".concat(R)},r))},uK=function(t){var r=t.viewBox,n=t.offset,i=t.position,a=r,s=a.cx,u=a.cy,f=a.innerRadius,c=a.outerRadius,d=a.startAngle,h=a.endAngle,m=(d+h)/2;if(i==="outside"){var g=mt(s,u,c+n,m),b=g.x,y=g.y;return{x:b,y,textAnchor:b>=s?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:s,y:u,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:s,y:u,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:s,y:u,textAnchor:"middle",verticalAnchor:"end"};var w=(f+c)/2,S=mt(s,u,w,m),O=S.x,E=S.y;return{x:O,y:E,textAnchor:"middle",verticalAnchor:"middle"}},fK=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,s=r,u=s.x,f=s.y,c=s.width,d=s.height,h=d>=0?1:-1,m=h*i,g=h>0?"end":"start",b=h>0?"start":"end",y=c>=0?1:-1,w=y*i,S=y>0?"end":"start",O=y>0?"start":"end";if(a==="top"){var E={x:u+c/2,y:f-h*i,textAnchor:"middle",verticalAnchor:g};return $t($t({},E),n?{height:Math.max(f-n.y,0),width:c}:{})}if(a==="bottom"){var C={x:u+c/2,y:f+d+m,textAnchor:"middle",verticalAnchor:b};return $t($t({},C),n?{height:Math.max(n.y+n.height-(f+d),0),width:c}:{})}if(a==="left"){var A={x:u-w,y:f+d/2,textAnchor:S,verticalAnchor:"middle"};return $t($t({},A),n?{width:Math.max(A.x-n.x,0),height:d}:{})}if(a==="right"){var N={x:u+c+w,y:f+d/2,textAnchor:O,verticalAnchor:"middle"};return $t($t({},N),n?{width:Math.max(n.x+n.width-N.x,0),height:d}:{})}var T=n?{width:c,height:d}:{};return a==="insideLeft"?$t({x:u+w,y:f+d/2,textAnchor:O,verticalAnchor:"middle"},T):a==="insideRight"?$t({x:u+c-w,y:f+d/2,textAnchor:S,verticalAnchor:"middle"},T):a==="insideTop"?$t({x:u+c/2,y:f+m,textAnchor:"middle",verticalAnchor:b},T):a==="insideBottom"?$t({x:u+c/2,y:f+d-m,textAnchor:"middle",verticalAnchor:g},T):a==="insideTopLeft"?$t({x:u+w,y:f+m,textAnchor:O,verticalAnchor:b},T):a==="insideTopRight"?$t({x:u+c-w,y:f+m,textAnchor:S,verticalAnchor:b},T):a==="insideBottomLeft"?$t({x:u+w,y:f+d-m,textAnchor:O,verticalAnchor:g},T):a==="insideBottomRight"?$t({x:u+c-w,y:f+d-m,textAnchor:S,verticalAnchor:g},T):Is(a)&&(he(a.x)||Na(a.x))&&(he(a.y)||Na(a.y))?$t({x:u+ur(a.x,c),y:f+ur(a.y,d),textAnchor:"end",verticalAnchor:"end"},T):$t({x:u+c/2,y:f+d/2,textAnchor:"middle",verticalAnchor:"middle"},T)},dK=function(t){return"cx"in t&&he(t.cx)};function Vt(e){var t=e.offset,r=t===void 0?5:t,n=rK(e,YG),i=$t({offset:r},n),a=i.viewBox,s=i.position,u=i.value,f=i.children,c=i.content,d=i.className,h=d===void 0?"":d,m=i.textBreakAll;if(!a||qe(u)&&qe(f)&&!P.isValidElement(c)&&!ze(c))return null;if(P.isValidElement(c))return P.cloneElement(c,i);var g;if(ze(c)){if(g=P.createElement(c,i),P.isValidElement(g))return g}else g=sK(i);var b=dK(a),y=Me(i,!0);if(b&&(s==="insideStart"||s==="insideEnd"||s==="end"))return cK(i,g,y);var w=b?uK(i):fK(i);return z.createElement($a,Cc({className:Ue("recharts-label",h)},y,w,{breakAll:m}),g)}Vt.displayName="Label";var fD=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,s=t.endAngle,u=t.r,f=t.radius,c=t.innerRadius,d=t.outerRadius,h=t.x,m=t.y,g=t.top,b=t.left,y=t.width,w=t.height,S=t.clockWise,O=t.labelViewBox;if(O)return O;if(he(y)&&he(w)){if(he(h)&&he(m))return{x:h,y:m,width:y,height:w};if(he(g)&&he(b))return{x:g,y:b,width:y,height:w}}return he(h)&&he(m)?{x:h,y:m,width:0,height:0}:he(r)&&he(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:s||i||0,innerRadius:c||0,outerRadius:d||f||u||0,clockWise:S}:t.viewBox?t.viewBox:{}},hK=function(t,r){return t?t===!0?z.createElement(Vt,{key:"label-implicit",viewBox:r}):zt(t)?z.createElement(Vt,{key:"label-implicit",viewBox:r,value:t}):P.isValidElement(t)?t.type===Vt?P.cloneElement(t,{key:"label-implicit",viewBox:r}):z.createElement(Vt,{key:"label-implicit",content:t,viewBox:r}):ze(t)?z.createElement(Vt,{key:"label-implicit",content:t,viewBox:r}):Is(t)?z.createElement(Vt,Cc({viewBox:r},t,{key:"label-implicit"})):null:null},pK=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=fD(t),s=Fr(i,Vt).map(function(f,c){return P.cloneElement(f,{viewBox:r||a,key:"label-".concat(c)})});if(!n)return s;var u=hK(t.label,r||a);return[u].concat(QG(s))};Vt.parseViewBox=fD;Vt.renderCallByParent=pK;var yx,BN;function mK(){if(BN)return yx;BN=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return yx=e,yx}var vK=mK();const gK=it(vK);function Tc(e){"@babel/helpers - typeof";return Tc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tc(e)}var yK=["valueAccessor"],xK=["data","dataKey","clockWise","id","textBreakAll"];function bK(e){return OK(e)||SK(e)||_K(e)||wK()}function wK(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _K(e,t){if(e){if(typeof e=="string")return Yb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yb(e,t)}}function SK(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function OK(e){if(Array.isArray(e))return Yb(e)}function Yb(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function PK(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}var NK=function(t){return Array.isArray(t.value)?gK(t.value):t.value};function fi(e){var t=e.valueAccessor,r=t===void 0?NK:t,n=qN(e,yK),i=n.data,a=n.dataKey,s=n.clockWise,u=n.id,f=n.textBreakAll,c=qN(n,xK);return!i||!i.length?null:z.createElement(Ze,{className:"recharts-label-list"},i.map(function(d,h){var m=qe(a)?r(d,h):Bt(d&&d.payload,a),g=qe(u)?{}:{id:"".concat(u,"-").concat(h)};return z.createElement(Vt,fh({},Me(d,!0),c,g,{parentViewBox:d.parentViewBox,value:m,textBreakAll:f,viewBox:Vt.parseViewBox(qe(s)?d:FN(FN({},d),{},{clockWise:s})),key:"label-".concat(h),index:h}))}))}fi.displayName="LabelList";function CK(e,t){return e?e===!0?z.createElement(fi,{key:"labelList-implicit",data:t}):z.isValidElement(e)||ze(e)?z.createElement(fi,{key:"labelList-implicit",data:t,content:e}):Is(e)?z.createElement(fi,fh({data:t},e,{key:"labelList-implicit"})):null:null}function TK(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Fr(n,fi).map(function(s,u){return P.cloneElement(s,{data:t,key:"labelList-".concat(u)})});if(!r)return i;var a=CK(e.label,t);return[a].concat(bK(i))}fi.renderCallByParent=TK;function kc(e){"@babel/helpers - typeof";return kc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kc(e)}function Qb(){return Qb=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(s>c),`, - `).concat(h.x,",").concat(h.y,` - `);if(i>0){var g=mt(r,n,i,s),b=mt(r,n,i,c);m+="L ".concat(b.x,",").concat(b.y,` - A `).concat(i,",").concat(i,`,0, - `).concat(+(Math.abs(f)>180),",").concat(+(s<=c),`, - `).concat(g.x,",").concat(g.y," Z")}else m+="L ".concat(r,",").concat(n," Z");return m},DK=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,s=t.cornerRadius,u=t.forceCornerRadius,f=t.cornerIsExternal,c=t.startAngle,d=t.endAngle,h=cr(d-c),m=Rf({cx:r,cy:n,radius:a,angle:c,sign:h,cornerRadius:s,cornerIsExternal:f}),g=m.circleTangency,b=m.lineTangency,y=m.theta,w=Rf({cx:r,cy:n,radius:a,angle:d,sign:-h,cornerRadius:s,cornerIsExternal:f}),S=w.circleTangency,O=w.lineTangency,E=w.theta,C=f?Math.abs(c-d):Math.abs(c-d)-y-E;if(C<0)return u?"M ".concat(b.x,",").concat(b.y,` - a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0 - a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0 - `):dD({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:c,endAngle:d});var A="M ".concat(b.x,",").concat(b.y,` - A`).concat(s,",").concat(s,",0,0,").concat(+(h<0),",").concat(g.x,",").concat(g.y,` - A`).concat(a,",").concat(a,",0,").concat(+(C>180),",").concat(+(h<0),",").concat(S.x,",").concat(S.y,` - A`).concat(s,",").concat(s,",0,0,").concat(+(h<0),",").concat(O.x,",").concat(O.y,` - `);if(i>0){var N=Rf({cx:r,cy:n,radius:i,angle:c,sign:h,isExternal:!0,cornerRadius:s,cornerIsExternal:f}),T=N.circleTangency,R=N.lineTangency,I=N.theta,q=Rf({cx:r,cy:n,radius:i,angle:d,sign:-h,isExternal:!0,cornerRadius:s,cornerIsExternal:f}),L=q.circleTangency,D=q.lineTangency,U=q.theta,H=f?Math.abs(c-d):Math.abs(c-d)-I-U;if(H<0&&s===0)return"".concat(A,"L").concat(r,",").concat(n,"Z");A+="L".concat(D.x,",").concat(D.y,` - A`).concat(s,",").concat(s,",0,0,").concat(+(h<0),",").concat(L.x,",").concat(L.y,` - A`).concat(i,",").concat(i,",0,").concat(+(H>180),",").concat(+(h>0),",").concat(T.x,",").concat(T.y,` - A`).concat(s,",").concat(s,",0,0,").concat(+(h<0),",").concat(R.x,",").concat(R.y,"Z")}else A+="L".concat(r,",").concat(n,"Z");return A},LK={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},hD=function(t){var r=WN(WN({},LK),t),n=r.cx,i=r.cy,a=r.innerRadius,s=r.outerRadius,u=r.cornerRadius,f=r.forceCornerRadius,c=r.cornerIsExternal,d=r.startAngle,h=r.endAngle,m=r.className;if(s0&&Math.abs(d-h)<360?w=DK({cx:n,cy:i,innerRadius:a,outerRadius:s,cornerRadius:Math.min(y,b/2),forceCornerRadius:f,cornerIsExternal:c,startAngle:d,endAngle:h}):w=dD({cx:n,cy:i,innerRadius:a,outerRadius:s,startAngle:d,endAngle:h}),z.createElement("path",Qb({},Me(r,!0),{className:g,d:w,role:"img"}))};function Rc(e){"@babel/helpers - typeof";return Rc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rc(e)}function Zb(){return Zb=Object.assign?Object.assign.bind():function(e){for(var t=1;tXK.call(e,t));function eo(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const ZK="__v",JK="__o",eX="_owner",{getOwnPropertyDescriptor:ZN,keys:JN}=Object;function tX(e,t){return e.byteLength===t.byteLength&&hh(new Uint8Array(e),new Uint8Array(t))}function rX(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function nX(e,t){return e.byteLength===t.byteLength&&hh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function iX(e,t){return eo(e.getTime(),t.getTime())}function aX(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function oX(e,t){return e===t}function eC(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.entries();let s,u,f=0;for(;(s=a.next())&&!s.done;){const c=t.entries();let d=!1,h=0;for(;(u=c.next())&&!u.done;){if(i[h]){h++;continue}const m=s.value,g=u.value;if(r.equals(m[0],g[0],f,h,e,t,r)&&r.equals(m[1],g[1],m[0],g[0],e,t,r)){d=i[h]=!0;break}h++}if(!d)return!1;f++}return!0}const sX=eo;function lX(e,t,r){const n=JN(e);let i=n.length;if(JN(t).length!==i)return!1;for(;i-- >0;)if(!pD(e,t,r,n[i]))return!1;return!0}function Fl(e,t,r){const n=QN(e);let i=n.length;if(QN(t).length!==i)return!1;let a,s,u;for(;i-- >0;)if(a=n[i],!pD(e,t,r,a)||(s=ZN(e,a),u=ZN(t,a),(s||u)&&(!s||!u||s.configurable!==u.configurable||s.enumerable!==u.enumerable||s.writable!==u.writable)))return!1;return!0}function cX(e,t){return eo(e.valueOf(),t.valueOf())}function uX(e,t){return e.source===t.source&&e.flags===t.flags}function tC(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.values();let s,u;for(;(s=a.next())&&!s.done;){const f=t.values();let c=!1,d=0;for(;(u=f.next())&&!u.done;){if(!i[d]&&r.equals(s.value,u.value,s.value,u.value,e,t,r)){c=i[d]=!0;break}d++}if(!c)return!1}return!0}function hh(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function fX(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function pD(e,t,r,n){return(n===eX||n===JK||n===ZK)&&(e.$$typeof||t.$$typeof)?!0:QK(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const dX="[object ArrayBuffer]",hX="[object Arguments]",pX="[object Boolean]",mX="[object DataView]",vX="[object Date]",gX="[object Error]",yX="[object Map]",xX="[object Number]",bX="[object Object]",wX="[object RegExp]",_X="[object Set]",SX="[object String]",OX={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},jX="[object URL]",EX=Object.prototype.toString;function AX({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:s,areNumbersEqual:u,areObjectsEqual:f,arePrimitiveWrappersEqual:c,areRegExpsEqual:d,areSetsEqual:h,areTypedArraysEqual:m,areUrlsEqual:g,unknownTagComparators:b}){return function(w,S,O){if(w===S)return!0;if(w==null||S==null)return!1;const E=typeof w;if(E!==typeof S)return!1;if(E!=="object")return E==="number"?u(w,S,O):E==="function"?a(w,S,O):!1;const C=w.constructor;if(C!==S.constructor)return!1;if(C===Object)return f(w,S,O);if(Array.isArray(w))return t(w,S,O);if(C===Date)return n(w,S,O);if(C===RegExp)return d(w,S,O);if(C===Map)return s(w,S,O);if(C===Set)return h(w,S,O);const A=EX.call(w);if(A===vX)return n(w,S,O);if(A===wX)return d(w,S,O);if(A===yX)return s(w,S,O);if(A===_X)return h(w,S,O);if(A===bX)return typeof w.then!="function"&&typeof S.then!="function"&&f(w,S,O);if(A===jX)return g(w,S,O);if(A===gX)return i(w,S,O);if(A===hX)return f(w,S,O);if(OX[A])return m(w,S,O);if(A===dX)return e(w,S,O);if(A===mX)return r(w,S,O);if(A===pX||A===xX||A===SX)return c(w,S,O);if(b){let N=b[A];if(!N){const T=YK(w);T&&(N=b[T])}if(N)return N(w,S,O)}return!1}}function PX({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:tX,areArraysEqual:r?Fl:rX,areDataViewsEqual:nX,areDatesEqual:iX,areErrorsEqual:aX,areFunctionsEqual:oX,areMapsEqual:r?_x(eC,Fl):eC,areNumbersEqual:sX,areObjectsEqual:r?Fl:lX,arePrimitiveWrappersEqual:cX,areRegExpsEqual:uX,areSetsEqual:r?_x(tC,Fl):tC,areTypedArraysEqual:r?_x(hh,Fl):hh,areUrlsEqual:fX,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const i=If(n.areArraysEqual),a=If(n.areMapsEqual),s=If(n.areObjectsEqual),u=If(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:u})}return n}function NX(e){return function(t,r,n,i,a,s,u){return e(t,r,u)}}function CX({circular:e,comparator:t,createState:r,equals:n,strict:i}){if(r)return function(u,f){const{cache:c=e?new WeakMap:void 0,meta:d}=r();return t(u,f,{cache:c,equals:n,meta:d,strict:i})};if(e)return function(u,f){return t(u,f,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const a={cache:void 0,equals:n,meta:void 0,strict:i};return function(u,f){return t(u,f,a)}}const TX=ea();ea({strict:!0});ea({circular:!0});ea({circular:!0,strict:!0});ea({createInternalComparator:()=>eo});ea({strict:!0,createInternalComparator:()=>eo});ea({circular:!0,createInternalComparator:()=>eo});ea({circular:!0,createInternalComparator:()=>eo,strict:!0});function ea(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:i=!1}=e,a=PX(e),s=AX(a),u=r?r(s):NX(s);return CX({circular:t,comparator:s,createState:n,equals:u,strict:i})}function kX(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function rC(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):kX(i)};requestAnimationFrame(n)}function Jb(e){"@babel/helpers - typeof";return Jb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jb(e)}function RX(e){return LX(e)||DX(e)||IX(e)||MX()}function MX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function IX(e,t){if(e){if(typeof e=="string")return nC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nC(e,t)}}function nC(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:S<0?0:S},y=function(S){for(var O=S>1?1:S,E=O,C=0;C<8;++C){var A=h(E)-O,N=g(E);if(Math.abs(A-O)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,s=t.dt,u=s===void 0?17:s,f=function(d,h,m){var g=-(d-h)*n,b=m*a,y=m+(g-b)*u/1e3,w=m*u/1e3+d;return Math.abs(w-h)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function pY(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function Sx(e){return yY(e)||gY(e)||vY(e)||mY()}function mY(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vY(e,t){if(e){if(typeof e=="string")return i1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i1(e,t)}}function gY(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function yY(e){if(Array.isArray(e))return i1(e)}function i1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function vh(e){return vh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},vh(e)}var Fn=(function(e){SY(r,e);var t=OY(r);function r(n,i){var a;xY(this,r),a=t.call(this,n,i);var s=a.props,u=s.isActive,f=s.attributeName,c=s.from,d=s.to,h=s.steps,m=s.children,g=s.duration;if(a.handleStyleChange=a.handleStyleChange.bind(s1(a)),a.changeStyle=a.changeStyle.bind(s1(a)),!u||g<=0)return a.state={style:{}},typeof m=="function"&&(a.state={style:d}),o1(a);if(h&&h.length)a.state={style:h[0].style};else if(c){if(typeof m=="function")return a.state={style:c},o1(a);a.state={style:f?Ql({},f,c):c}}else a.state={style:{}};return a}return wY(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,s=i.canBegin;this.mounted=!0,!(!a||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,s=a.isActive,u=a.canBegin,f=a.attributeName,c=a.shouldReAnimate,d=a.to,h=a.from,m=this.state.style;if(u){if(!s){var g={style:f?Ql({},f,d):d};this.state&&m&&(f&&m[f]!==d||!f&&m!==d)&&this.setState(g);return}if(!(TX(i.to,d)&&i.canBegin&&i.isActive)){var b=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var y=b||c?h:i.to;if(this.state&&m){var w={style:f?Ql({},f,y):y};(f&&m[f]!==y||!f&&m!==y)&&this.setState(w)}this.runAnimation(mn(mn({},this.props),{},{from:y,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,s=i.from,u=i.to,f=i.duration,c=i.easing,d=i.begin,h=i.onAnimationEnd,m=i.onAnimationStart,g=fY(s,u,eY(c),f,this.changeStyle),b=function(){a.stopJSAnimation=g()};this.manager.start([m,d,b,f,h])}},{key:"runStepAnimation",value:function(i){var a=this,s=i.steps,u=i.begin,f=i.onAnimationStart,c=s[0],d=c.style,h=c.duration,m=h===void 0?0:h,g=function(y,w,S){if(S===0)return y;var O=w.duration,E=w.easing,C=E===void 0?"ease":E,A=w.style,N=w.properties,T=w.onAnimationEnd,R=S>0?s[S-1]:w,I=N||Object.keys(A);if(typeof C=="function"||C==="spring")return[].concat(Sx(y),[a.runJSAnimation.bind(a,{from:R.style,to:A,duration:O,easing:C}),O]);var q=oC(I,O,C),L=mn(mn(mn({},R.style),A),{},{transition:q});return[].concat(Sx(y),[L,O,T]).filter(qX)};return this.manager.start([f].concat(Sx(s.reduce(g,[d,Math.max(m,u)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=$X());var a=i.begin,s=i.duration,u=i.attributeName,f=i.to,c=i.easing,d=i.onAnimationStart,h=i.onAnimationEnd,m=i.steps,g=i.children,b=this.manager;if(this.unSubscribe=b.subscribe(this.handleStyleChange),typeof c=="function"||typeof g=="function"||c==="spring"){this.runJSAnimation(i);return}if(m.length>1){this.runStepAnimation(i);return}var y=u?Ql({},u,f):f,w=oC(Object.keys(y),s,c);b.start([d,a,mn(mn({},y),{},{transition:w}),s,h])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var s=i.duration;i.attributeName,i.easing;var u=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var f=hY(i,dY),c=P.Children.count(a),d=this.state.style;if(typeof a=="function")return a(d);if(!u||c===0||s<=0)return a;var h=function(g){var b=g.props,y=b.style,w=y===void 0?{}:y,S=b.className,O=P.cloneElement(g,mn(mn({},f),{},{style:mn(mn({},w),d),className:S}));return O};return c===1?h(P.Children.only(a)):z.createElement("div",null,P.Children.map(a,function(m){return h(m)}))}}]),r})(P.PureComponent);Fn.displayName="Animate";Fn.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Fn.propTypes={from:ot.oneOfType([ot.object,ot.string]),to:ot.oneOfType([ot.object,ot.string]),attributeName:ot.string,duration:ot.number,begin:ot.number,easing:ot.oneOfType([ot.string,ot.func]),steps:ot.arrayOf(ot.shape({duration:ot.number.isRequired,style:ot.object.isRequired,easing:ot.oneOfType([ot.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),ot.func]),properties:ot.arrayOf("string"),onAnimationEnd:ot.func})),children:ot.oneOfType([ot.node,ot.func]),isActive:ot.bool,canBegin:ot.bool,onAnimationEnd:ot.func,shouldReAnimate:ot.bool,onAnimationStart:ot.func,onAnimationReStart:ot.func};function Dc(e){"@babel/helpers - typeof";return Dc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dc(e)}function gh(){return gh=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,f=n>=0?1:-1,c=i>=0&&n>=0||i<0&&n<0?1:0,d;if(s>0&&a instanceof Array){for(var h=[0,0,0,0],m=0,g=4;ms?s:a[m];d="M".concat(t,",").concat(r+u*h[0]),h[0]>0&&(d+="A ".concat(h[0],",").concat(h[0],",0,0,").concat(c,",").concat(t+f*h[0],",").concat(r)),d+="L ".concat(t+n-f*h[1],",").concat(r),h[1]>0&&(d+="A ".concat(h[1],",").concat(h[1],",0,0,").concat(c,`, - `).concat(t+n,",").concat(r+u*h[1])),d+="L ".concat(t+n,",").concat(r+i-u*h[2]),h[2]>0&&(d+="A ".concat(h[2],",").concat(h[2],",0,0,").concat(c,`, - `).concat(t+n-f*h[2],",").concat(r+i)),d+="L ".concat(t+f*h[3],",").concat(r+i),h[3]>0&&(d+="A ".concat(h[3],",").concat(h[3],",0,0,").concat(c,`, - `).concat(t,",").concat(r+i-u*h[3])),d+="Z"}else if(s>0&&a===+a&&a>0){var b=Math.min(s,a);d="M ".concat(t,",").concat(r+u*b,` - A `).concat(b,",").concat(b,",0,0,").concat(c,",").concat(t+f*b,",").concat(r,` - L `).concat(t+n-f*b,",").concat(r,` - A `).concat(b,",").concat(b,",0,0,").concat(c,",").concat(t+n,",").concat(r+u*b,` - L `).concat(t+n,",").concat(r+i-u*b,` - A `).concat(b,",").concat(b,",0,0,").concat(c,",").concat(t+n-f*b,",").concat(r+i,` - L `).concat(t+f*b,",").concat(r+i,` - A `).concat(b,",").concat(b,",0,0,").concat(c,",").concat(t,",").concat(r+i-u*b," Z")}else d="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return d},MY=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,a=r.x,s=r.y,u=r.width,f=r.height;if(Math.abs(u)>0&&Math.abs(f)>0){var c=Math.min(a,a+u),d=Math.max(a,a+u),h=Math.min(s,s+f),m=Math.max(s,s+f);return n>=c&&n<=d&&i>=h&&i<=m}return!1},IY={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Jw=function(t){var r=pC(pC({},IY),t),n=P.useRef(),i=P.useState(-1),a=EY(i,2),s=a[0],u=a[1];P.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var C=n.current.getTotalLength();C&&u(C)}catch{}},[]);var f=r.x,c=r.y,d=r.width,h=r.height,m=r.radius,g=r.className,b=r.animationEasing,y=r.animationDuration,w=r.animationBegin,S=r.isAnimationActive,O=r.isUpdateAnimationActive;if(f!==+f||c!==+c||d!==+d||h!==+h||d===0||h===0)return null;var E=Ue("recharts-rectangle",g);return O?z.createElement(Fn,{canBegin:s>0,from:{width:d,height:h,x:f,y:c},to:{width:d,height:h,x:f,y:c},duration:y,animationEasing:b,isActive:O},function(C){var A=C.width,N=C.height,T=C.x,R=C.y;return z.createElement(Fn,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:y,isActive:S,easing:b},z.createElement("path",gh({},Me(r,!0),{className:E,d:mC(T,R,A,N,m),ref:n})))}):z.createElement("path",gh({},Me(r,!0),{className:E,d:mC(f,c,d,h,m)}))},DY=["points","className","baseLinePoints","connectNulls"];function Ho(){return Ho=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $Y(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 vC(e){return qY(e)||FY(e)||zY(e)||BY()}function BY(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zY(e,t){if(e){if(typeof e=="string")return l1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l1(e,t)}}function FY(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function qY(e){if(Array.isArray(e))return l1(e)}function l1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){gC(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),gC(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},ac=function(t,r){var n=UY(t);r&&(n=[n.reduce(function(a,s){return[].concat(vC(a),vC(s))},[])]);var i=n.map(function(a){return a.reduce(function(s,u,f){return"".concat(s).concat(f===0?"M":"L").concat(u.x,",").concat(u.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},WY=function(t,r,n){var i=ac(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(ac(r.reverse(),n).slice(1))},HY=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,a=t.connectNulls,s=LY(t,DY);if(!r||!r.length)return null;var u=Ue("recharts-polygon",n);if(i&&i.length){var f=s.stroke&&s.stroke!=="none",c=WY(r,i,a);return z.createElement("g",{className:u},z.createElement("path",Ho({},Me(s,!0),{fill:c.slice(-1)==="Z"?s.fill:"none",stroke:"none",d:c})),f?z.createElement("path",Ho({},Me(s,!0),{fill:"none",d:ac(r,a)})):null,f?z.createElement("path",Ho({},Me(s,!0),{fill:"none",d:ac(i,a)})):null)}var d=ac(r,a);return z.createElement("path",Ho({},Me(s,!0),{fill:d.slice(-1)==="Z"?s.fill:"none",className:u,d}))};function c1(){return c1=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ZY(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}var JY=function(t,r,n,i,a,s){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(s,",").concat(r,"h").concat(n)},eQ=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,s=t.top,u=s===void 0?0:s,f=t.left,c=f===void 0?0:f,d=t.width,h=d===void 0?0:d,m=t.height,g=m===void 0?0:m,b=t.className,y=QY(t,VY),w=GY({x:n,y:a,top:u,left:c,width:h,height:g},y);return!he(n)||!he(a)||!he(h)||!he(g)||!he(u)||!he(c)?null:z.createElement("path",u1({},Me(w,!0),{className:Ue("recharts-cross",b),d:JY(n,a,h,g,u,c)}))},Ox,xC;function tQ(){if(xC)return Ox;xC=1;var e=vp(),t=II(),r=Vn();function n(i,a){return i&&i.length?e(i,r(a,2),t):void 0}return Ox=n,Ox}var rQ=tQ();const nQ=it(rQ);var jx,bC;function iQ(){if(bC)return jx;bC=1;var e=vp(),t=Vn(),r=DI();function n(i,a){return i&&i.length?e(i,t(a,2),r):void 0}return jx=n,jx}var aQ=iQ();const oQ=it(aQ);var sQ=["cx","cy","angle","ticks","axisLine"],lQ=["ticks","tick","angle","tickFormatter","stroke"];function ms(e){"@babel/helpers - typeof";return ms=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ms(e)}function oc(){return oc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function cQ(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 uQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SC(e,t){for(var r=0;rEC?s=i==="outer"?"start":"end":a<-EC?s=i==="outer"?"end":"start":s="middle",s}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,s=n.radius,u=n.axisLine,f=n.axisLineType,c=Sa(Sa({},Me(this.props,!1)),{},{fill:"none"},Me(u,!1));if(f==="circle")return z.createElement(wp,Pa({className:"recharts-polar-angle-axis-line"},c,{cx:i,cy:a,r:s}));var d=this.props.ticks,h=d.map(function(m){return mt(i,a,s,m.coordinate)});return z.createElement(HY,Pa({className:"recharts-polar-angle-axis-line"},c,{points:h}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,s=i.tick,u=i.tickLine,f=i.tickFormatter,c=i.stroke,d=Me(this.props,!1),h=Me(s,!1),m=Sa(Sa({},d),{},{fill:"none"},Me(u,!1)),g=a.map(function(b,y){var w=n.getTickLineCoord(b),S=n.getTickTextAnchor(b),O=Sa(Sa(Sa({textAnchor:S},d),{},{stroke:"none",fill:c},h),{},{index:y,payload:b,x:w.x2,y:w.y2});return z.createElement(Ze,Pa({className:Ue("recharts-polar-angle-axis-tick",uD(s)),key:"tick-".concat(b.coordinate)},La(n.props,b,y)),u&&z.createElement("line",Pa({className:"recharts-polar-angle-axis-tick-line"},m,w)),s&&t.renderTickItem(s,O,f?f(b.value,y):b.value))});return z.createElement(Ze,{className:"recharts-polar-angle-axis-ticks"},g)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.radius,s=n.axisLine;return a<=0||!i||!i.length?null:z.createElement(Ze,{className:Ue("recharts-polar-angle-axis",this.props.className)},s&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,a){var s;return z.isValidElement(n)?s=z.cloneElement(n,i):ze(n)?s=n(i):s=z.createElement($a,Pa({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),s}}])})(P.PureComponent);Op(jp,"displayName","PolarAngleAxis");Op(jp,"axisType","angleAxis");Op(jp,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var Ex,AC;function jQ(){if(AC)return Ex;AC=1;var e=IM(),t=e(Object.getPrototypeOf,Object);return Ex=t,Ex}var Ax,PC;function EQ(){if(PC)return Ax;PC=1;var e=yi(),t=jQ(),r=xi(),n="[object Object]",i=Function.prototype,a=Object.prototype,s=i.toString,u=a.hasOwnProperty,f=s.call(Object);function c(d){if(!r(d)||e(d)!=n)return!1;var h=t(d);if(h===null)return!0;var m=u.call(h,"constructor")&&h.constructor;return typeof m=="function"&&m instanceof m&&s.call(m)==f}return Ax=c,Ax}var AQ=EQ();const PQ=it(AQ);var Px,NC;function NQ(){if(NC)return Px;NC=1;var e=yi(),t=xi(),r="[object Boolean]";function n(i){return i===!0||i===!1||t(i)&&e(i)==r}return Px=n,Px}var CQ=NQ();const TQ=it(CQ);function $c(e){"@babel/helpers - typeof";return $c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$c(e)}function bh(){return bh=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:m,x:f,y:c},to:{upperWidth:d,lowerWidth:h,height:m,x:f,y:c},duration:y,animationEasing:b,isActive:S},function(E){var C=E.upperWidth,A=E.lowerWidth,N=E.height,T=E.x,R=E.y;return z.createElement(Fn,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:y,easing:b},z.createElement("path",bh({},Me(r,!0),{className:O,d:RC(T,R,C,A,N),ref:n})))}):z.createElement("g",null,z.createElement("path",bh({},Me(r,!0),{className:O,d:RC(f,c,d,h,m)})))},qQ=["option","shapeType","propTransformer","activeClassName","isActive"];function Bc(e){"@babel/helpers - typeof";return Bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bc(e)}function UQ(e,t){if(e==null)return{};var r=WQ(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function WQ(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 MC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function wh(e){for(var t=1;t0?zr(E,"paddingAngle",0):0;if(A){var T=Lr(A.endAngle-A.startAngle,E.endAngle-E.startAngle),R=ht(ht({},E),{},{startAngle:O+N,endAngle:O+T(y)+N});w.push(R),O=R.endAngle}else{var I=E.endAngle,q=E.startAngle,L=Lr(0,I-q),D=L(y),U=ht(ht({},E),{},{startAngle:O+N,endAngle:O+D+N});w.push(U),O=U.endAngle}}),z.createElement(Ze,null,n.renderSectorsStatically(w))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var s=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"ArrowRight":{var u=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[u].focus(),i.setState({sectorToFocus:u});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,a=n.isAnimationActive,s=this.state.prevSectors;return a&&i&&i.length&&(!s||!ru(s,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,a=i.hide,s=i.sectors,u=i.className,f=i.label,c=i.cx,d=i.cy,h=i.innerRadius,m=i.outerRadius,g=i.isAnimationActive,b=this.state.isAnimationFinished;if(a||!s||!s.length||!he(c)||!he(d)||!he(h)||!he(m))return null;var y=Ue("recharts-pie",u);return z.createElement(Ze,{tabIndex:this.props.rootTabIndex,className:y,ref:function(S){n.pieRef=S}},this.renderSectors(),f&&this.renderLabels(s),Vt.renderCallByParent(this.props,null,!1),(!g||b)&&fi.renderCallByParent(this.props,s,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n=360?O:O-1)*f,C=w-O*g-E,A=i.reduce(function(R,I){var q=Bt(I,S,0);return R+(he(q)?q:0)},0),N;if(A>0){var T;N=i.map(function(R,I){var q=Bt(R,S,0),L=Bt(R,d,I),D=(he(q)?q:0)/A,U;I?U=T.endAngle+cr(y)*f*(q!==0?1:0):U=s;var H=U+cr(y)*((q!==0?g:0)+D*C),V=(U+H)/2,K=(b.innerRadius+b.outerRadius)/2,X=[{name:L,value:q,payload:R,dataKey:S,type:m}],B=mt(b.cx,b.cy,K,V);return T=ht(ht(ht({percent:D,cornerRadius:a,name:L,tooltipPayload:X,midAngle:V,middleRadius:K,tooltipPosition:B},R),b),{},{value:Bt(R,S),startAngle:U,endAngle:H,payload:R,paddingAngle:cr(y)*f}),T})}return ht(ht({},b),{},{sectors:N,data:i})});var Nx,$C;function fZ(){if($C)return Nx;$C=1;var e=Math.ceil,t=Math.max;function r(n,i,a,s){for(var u=-1,f=t(e((i-n)/(a||1)),0),c=Array(f);f--;)c[s?f:++u]=n,n+=a;return c}return Nx=r,Nx}var Cx,BC;function PD(){if(BC)return Cx;BC=1;var e=QM(),t=1/0,r=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=e(i),i===t||i===-t){var a=i<0?-1:1;return a*r}return i===i?i:0}return Cx=n,Cx}var Tx,zC;function dZ(){if(zC)return Tx;zC=1;var e=fZ(),t=lp(),r=PD();function n(i){return function(a,s,u){return u&&typeof u!="number"&&t(a,s,u)&&(s=u=void 0),a=r(a),s===void 0?(s=a,a=0):s=r(s),u=u===void 0?a0&&n.handleDrag(i.changedTouches[0])}),Rr(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,s=i.onDragEnd,u=i.startIndex;s?.({endIndex:a,startIndex:u})}),n.detachDragEndListener()}),Rr(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Rr(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Rr(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Rr(n,"handleSlideDragStart",function(i){var a=VC(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return OZ(t,e),bZ(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,s=this.state.scaleValues,u=this.props,f=u.gap,c=u.data,d=c.length-1,h=Math.min(i,a),m=Math.max(i,a),g=t.getIndexInRange(s,h),b=t.getIndexInRange(s,m);return{startIndex:g-g%f,endIndex:b===d?d:b-b%f}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,s=i.tickFormatter,u=i.dataKey,f=Bt(a[n],u,n);return ze(s)?s(f,n):f}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,s=i.startX,u=i.endX,f=this.props,c=f.x,d=f.width,h=f.travellerWidth,m=f.startIndex,g=f.endIndex,b=f.onChange,y=n.pageX-a;y>0?y=Math.min(y,c+d-h-u,c+d-h-s):y<0&&(y=Math.max(y,c-s,c-u));var w=this.getIndex({startX:s+y,endX:u+y});(w.startIndex!==m||w.endIndex!==g)&&b&&b(w),this.setState({startX:s+y,endX:u+y,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=VC(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,s=i.movingTravellerId,u=i.endX,f=i.startX,c=this.state[s],d=this.props,h=d.x,m=d.width,g=d.travellerWidth,b=d.onChange,y=d.gap,w=d.data,S={startX:this.state.startX,endX:this.state.endX},O=n.pageX-a;O>0?O=Math.min(O,h+m-g-c):O<0&&(O=Math.max(O,h-c)),S[s]=c+O;var E=this.getIndex(S),C=E.startIndex,A=E.endIndex,N=function(){var R=w.length-1;return s==="startX"&&(u>f?C%y===0:A%y===0)||uf?A%y===0:C%y===0)||u>f&&A===R};this.setState(Rr(Rr({},s,c+O),"brushMoveStartX",n.pageX),function(){b&&N()&&b(E)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,s=this.state,u=s.scaleValues,f=s.startX,c=s.endX,d=this.state[i],h=u.indexOf(d);if(h!==-1){var m=h+n;if(!(m===-1||m>=u.length)){var g=u[m];i==="startX"&&g>=c||i==="endX"&&g<=f||this.setState(Rr({},i,g),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,s=n.width,u=n.height,f=n.fill,c=n.stroke;return z.createElement("rect",{stroke:c,fill:f,x:i,y:a,width:s,height:u})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,s=n.width,u=n.height,f=n.data,c=n.children,d=n.padding,h=P.Children.only(c);return h?z.cloneElement(h,{x:i,y:a,width:s,height:u,margin:d,compact:!0,data:f}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,s,u=this,f=this.props,c=f.y,d=f.travellerWidth,h=f.height,m=f.traveller,g=f.ariaLabel,b=f.data,y=f.startIndex,w=f.endIndex,S=Math.max(n,this.props.x),O=Rx(Rx({},Me(this.props,!1)),{},{x:S,y:c,width:d,height:h}),E=g||"Min value: ".concat((a=b[y])===null||a===void 0?void 0:a.name,", Max value: ").concat((s=b[w])===null||s===void 0?void 0:s.name);return z.createElement(Ze,{tabIndex:0,role:"slider","aria-label":E,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(A){["ArrowLeft","ArrowRight"].includes(A.key)&&(A.preventDefault(),A.stopPropagation(),u.handleTravellerMoveKeyboard(A.key==="ArrowRight"?1:-1,i))},onFocus:function(){u.setState({isTravellerFocused:!0})},onBlur:function(){u.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(m,O))}},{key:"renderSlide",value:function(n,i){var a=this.props,s=a.y,u=a.height,f=a.stroke,c=a.travellerWidth,d=Math.min(n,i)+c,h=Math.max(Math.abs(i-n)-c,0);return z.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:f,fillOpacity:.2,x:d,y:s,width:h,height:u})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,s=n.y,u=n.height,f=n.travellerWidth,c=n.stroke,d=this.state,h=d.startX,m=d.endX,g=5,b={pointerEvents:"none",fill:c};return z.createElement(Ze,{className:"recharts-brush-texts"},z.createElement($a,Oh({textAnchor:"end",verticalAnchor:"middle",x:Math.min(h,m)-g,y:s+u/2},b),this.getTextOfTick(i)),z.createElement($a,Oh({textAnchor:"start",verticalAnchor:"middle",x:Math.max(h,m)+f+g,y:s+u/2},b),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,s=n.children,u=n.x,f=n.y,c=n.width,d=n.height,h=n.alwaysShowText,m=this.state,g=m.startX,b=m.endX,y=m.isTextActive,w=m.isSlideMoving,S=m.isTravellerMoving,O=m.isTravellerFocused;if(!i||!i.length||!he(u)||!he(f)||!he(c)||!he(d)||c<=0||d<=0)return null;var E=Ue("recharts-brush",a),C=z.Children.count(s)===1,A=yZ("userSelect","none");return z.createElement(Ze,{className:E,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:A},this.renderBackground(),C&&this.renderPanorama(),this.renderSlide(g,b),this.renderTravellerLayer(g,"startX"),this.renderTravellerLayer(b,"endX"),(y||w||S||O||h)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,s=n.width,u=n.height,f=n.stroke,c=Math.floor(a+u/2)-1;return z.createElement(z.Fragment,null,z.createElement("rect",{x:i,y:a,width:s,height:u,fill:f,stroke:"none"}),z.createElement("line",{x1:i+1,y1:c,x2:i+s-1,y2:c,fill:"none",stroke:"#fff"}),z.createElement("line",{x1:i+1,y1:c+2,x2:i+s-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return z.isValidElement(n)?a=z.cloneElement(n,i):ze(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,s=n.width,u=n.x,f=n.travellerWidth,c=n.updateId,d=n.startIndex,h=n.endIndex;if(a!==i.prevData||c!==i.prevUpdateId)return Rx({prevData:a,prevTravellerWidth:f,prevUpdateId:c,prevX:u,prevWidth:s},a&&a.length?EZ({data:a,width:s,x:u,travellerWidth:f,startIndex:d,endIndex:h}):{scale:null,scaleValues:null});if(i.scale&&(s!==i.prevWidth||u!==i.prevX||f!==i.prevTravellerWidth)){i.scale.range([u,u+s-f]);var m=i.scale.domain().map(function(g){return i.scale(g)});return{prevData:a,prevTravellerWidth:f,prevUpdateId:c,prevX:u,prevWidth:s,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:m}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,s=0,u=a-1;u-s>1;){var f=Math.floor((s+u)/2);n[f]>i?u=f:s=f}return i>=n[u]?u:s}}])})(P.PureComponent);Rr(xs,"displayName","Brush");Rr(xs,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Mx,GC;function AZ(){if(GC)return Mx;GC=1;var e=jw();function t(r,n){var i;return e(r,function(a,s,u){return i=n(a,s,u),!i}),!!i}return Mx=t,Mx}var Ix,KC;function PZ(){if(KC)return Ix;KC=1;var e=PM(),t=Vn(),r=AZ(),n=Sr(),i=lp();function a(s,u,f){var c=n(s)?e:r;return f&&i(s,u,f)&&(u=void 0),c(s,t(u,3))}return Ix=a,Ix}var NZ=PZ();const CZ=it(NZ);var $n=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},Dx,XC;function TZ(){if(XC)return Dx;XC=1;var e=VM();function t(r,n,i){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return Dx=t,Dx}var Lx,YC;function kZ(){if(YC)return Lx;YC=1;var e=TZ(),t=WM(),r=Vn();function n(i,a){var s={};return a=r(a,3),t(i,function(u,f,c){e(s,f,a(u,f,c))}),s}return Lx=n,Lx}var RZ=kZ();const MZ=it(RZ);var $x,QC;function IZ(){if(QC)return $x;QC=1;function e(t,r){for(var n=-1,i=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function WZ(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 HZ(e,t){var r=e.x,n=e.y,i=UZ(e,BZ),a="".concat(r),s=parseInt(a,10),u="".concat(n),f=parseInt(u,10),c="".concat(t.height||i.height),d=parseInt(c,10),h="".concat(t.width||i.width),m=parseInt(h,10);return ql(ql(ql(ql(ql({},t),i),s?{x:s}:{}),f?{y:f}:{}),{},{height:d,width:m,name:t.name,radius:t.radius})}function tT(e){return z.createElement(jD,m1({shapeType:"rectangle",propTransformer:HZ,activeClassName:"recharts-active-bar"},e))}var VZ=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=he(n)||dF(n);return a?t(n,i):(a||za(),r)}},GZ=["value","background"],RD;function bs(e){"@babel/helpers - typeof";return bs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bs(e)}function KZ(e,t){if(e==null)return{};var r=XZ(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function XZ(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 Eh(){return Eh=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(V)0&&Math.abs(H)0&&(U=Math.min((ae||0)-(H[pe-1]||0),U))}),Number.isFinite(U)){var V=U/D,K=y.layout==="vertical"?n.height:n.width;if(y.padding==="gap"&&(T=V*K/2),y.padding==="no-gap"){var X=ur(t.barCategoryGap,V*K),B=V*K/2;T=B-X-(B-X)/K*X}}}i==="xAxis"?R=[n.left+(E.left||0)+(T||0),n.left+n.width-(E.right||0)-(T||0)]:i==="yAxis"?R=f==="horizontal"?[n.top+n.height-(E.bottom||0),n.top+(E.top||0)]:[n.top+(E.top||0)+(T||0),n.top+n.height-(E.bottom||0)-(T||0)]:R=y.range,A&&(R=[R[1],R[0]]);var Z=nD(y,a,m),ee=Z.scale,M=Z.realScaleType;ee.domain(S).range(R),iD(ee);var $=aD(ee,bn(bn({},y),{},{realScaleType:M}));i==="xAxis"?(L=w==="top"&&!C||w==="bottom"&&C,I=n.left,q=h[N]-L*y.height):i==="yAxis"&&(L=w==="left"&&!C||w==="right"&&C,I=h[N]-L*y.width,q=n.top);var Q=bn(bn(bn({},y),$),{},{realScaleType:M,x:I,y:q,scale:ee,width:i==="xAxis"?n.width:y.width,height:i==="yAxis"?n.height:y.height});return Q.bandSize=ch(Q,$),!y.hide&&i==="xAxis"?h[N]+=(L?-1:1)*Q.height:y.hide||(h[N]+=(L?-1:1)*Q.width),bn(bn({},g),{},Pp({},b,Q))},{})},$D=function(t,r){var n=t.x,i=t.y,a=r.x,s=r.y;return{x:Math.min(n,a),y:Math.min(i,s),width:Math.abs(a-n),height:Math.abs(s-i)}},oJ=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return $D({x:r,y:n},{x:i,y:a})},BD=(function(){function e(t){nJ(this,e),this.scale=t}return iJ(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+s}case"end":{var u=this.bandwidth?this.bandwidth():0;return this.scale(r)+u}default:return this.scale(r)}if(i){var f=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+f}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])})();Pp(BD,"EPS",1e-4);var e_=function(t){var r=Object.keys(t).reduce(function(n,i){return bn(bn({},n),{},Pp({},i,BD.create(t[i])))},{});return bn(bn({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=a.bandAware,u=a.position;return MZ(i,function(f,c){return r[c].apply(f,{bandAware:s,position:u})})},isInRange:function(i){return kD(i,function(a,s){return r[s].isInRange(a)})}})};function sJ(e){return(e%180+180)%180}var lJ=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=sJ(i),s=a*Math.PI/180,u=Math.atan(n/r),f=s>u&&s-1?f[c?a[d]:d]:void 0}}return Fx=n,Fx}var qx,sT;function uJ(){if(sT)return qx;sT=1;var e=PD();function t(r){var n=e(r),i=n%1;return n===n?i?n-i:n:0}return qx=t,qx}var Ux,lT;function fJ(){if(lT)return Ux;lT=1;var e=BM(),t=Vn(),r=uJ(),n=Math.max;function i(a,s,u){var f=a==null?0:a.length;if(!f)return-1;var c=u==null?0:r(u);return c<0&&(c=n(f+c,0)),e(a,t(s,3),c)}return Ux=i,Ux}var Wx,cT;function dJ(){if(cT)return Wx;cT=1;var e=cJ(),t=fJ(),r=e(t);return Wx=r,Wx}var hJ=dJ();const pJ=it(hJ);var mJ=tM();const vJ=it(mJ);var gJ=vJ(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),t_=P.createContext(void 0),r_=P.createContext(void 0),zD=P.createContext(void 0),FD=P.createContext({}),qD=P.createContext(void 0),UD=P.createContext(0),WD=P.createContext(0),uT=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,a=r.offset,s=t.clipPathId,u=t.children,f=t.width,c=t.height,d=gJ(a);return z.createElement(t_.Provider,{value:n},z.createElement(r_.Provider,{value:i},z.createElement(FD.Provider,{value:a},z.createElement(zD.Provider,{value:d},z.createElement(qD.Provider,{value:s},z.createElement(UD.Provider,{value:c},z.createElement(WD.Provider,{value:f},u)))))))},yJ=function(){return P.useContext(qD)},HD=function(t){var r=P.useContext(t_);r==null&&za();var n=r[t];return n==null&&za(),n},xJ=function(){var t=P.useContext(t_);return Wi(t)},bJ=function(){var t=P.useContext(r_),r=pJ(t,function(n){return kD(n.domain,Number.isFinite)});return r||Wi(t)},VD=function(t){var r=P.useContext(r_);r==null&&za();var n=r[t];return n==null&&za(),n},wJ=function(){var t=P.useContext(zD);return t},_J=function(){return P.useContext(FD)},n_=function(){return P.useContext(WD)},i_=function(){return P.useContext(UD)};function ws(e){"@babel/helpers - typeof";return ws=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ws(e)}function SJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OJ(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function aee(e,t){return JD(e,t+1)}function oee(e,t,r,n,i){for(var a=(n||[]).slice(),s=t.start,u=t.end,f=0,c=1,d=s,h=function(){var b=n?.[f];if(b===void 0)return{v:JD(n,c)};var y=f,w,S=function(){return w===void 0&&(w=r(b,y)),w},O=b.coordinate,E=f===0||Th(e,O,S,d,u);E||(f=0,d=s,c+=1),E&&(d=O+e*(S()/2+i),f+=c)},m;c<=a.length;)if(m=h(),m)return m.v;return[]}function Wc(e){"@babel/helpers - typeof";return Wc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wc(e)}function yT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function nr(e){for(var t=1;t0?g.coordinate-w*e:g.coordinate})}else a[m]=g=nr(nr({},g),{},{tickCoord:g.coordinate});var S=Th(e,g.tickCoord,y,u,f);S&&(f=g.tickCoord-e*(y()/2+i),a[m]=nr(nr({},g),{},{isShow:!0}))},d=s-1;d>=0;d--)c(d);return a}function fee(e,t,r,n,i,a){var s=(n||[]).slice(),u=s.length,f=t.start,c=t.end;if(a){var d=n[u-1],h=r(d,u-1),m=e*(d.coordinate+e*h/2-c);s[u-1]=d=nr(nr({},d),{},{tickCoord:m>0?d.coordinate-m*e:d.coordinate});var g=Th(e,d.tickCoord,function(){return h},f,c);g&&(c=d.tickCoord-e*(h/2+i),s[u-1]=nr(nr({},d),{},{isShow:!0}))}for(var b=a?u-1:u,y=function(O){var E=s[O],C,A=function(){return C===void 0&&(C=r(E,O)),C};if(O===0){var N=e*(E.coordinate-e*A()/2-f);s[O]=E=nr(nr({},E),{},{tickCoord:N<0?E.coordinate-N*e:E.coordinate})}else s[O]=E=nr(nr({},E),{},{tickCoord:E.coordinate});var T=Th(e,E.tickCoord,A,f,c);T&&(f=E.tickCoord+e*(A()/2+i),s[O]=nr(nr({},E),{},{isShow:!0}))},w=0;w=2?cr(i[1].coordinate-i[0].coordinate):1,S=iee(a,w,g);return f==="equidistantPreserveStart"?oee(w,S,y,i,s):(f==="preserveStart"||f==="preserveStartEnd"?m=fee(w,S,y,i,s,f==="preserveStartEnd"):m=uee(w,S,y,i,s),m.filter(function(O){return O.isShow}))}var dee=["viewBox"],hee=["viewBox"],pee=["ticks"];function Os(e){"@babel/helpers - typeof";return Os=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Os(e)}function Go(){return Go=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function mee(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 vee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bT(e,t){for(var r=0;r0?f(this.props):f(g)),s<=0||u<=0||!b||!b.length?null:z.createElement(Ze,{className:Ue("recharts-cartesian-axis",c),ref:function(w){n.layerReference=w}},a&&this.renderAxisLine(),this.renderTicks(b,this.state.fontSize,this.state.letterSpacing),Vt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var s,u=Ue(i.className,"recharts-cartesian-axis-tick-value");return z.isValidElement(n)?s=z.cloneElement(n,Lt(Lt({},i),{},{className:u})):ze(n)?s=n(Lt(Lt({},i),{},{className:u})):s=z.createElement($a,Go({},i,{className:"recharts-cartesian-axis-tick-value"}),a),s}}])})(P.Component);l_(Fs,"displayName","CartesianAxis");l_(Fs,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var See=["x1","y1","x2","y2","key"],Oee=["offset"];function Fa(e){"@babel/helpers - typeof";return Fa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fa(e)}function wT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ir(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Pee(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}var Nee=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,i=t.x,a=t.y,s=t.width,u=t.height,f=t.ry;return z.createElement("rect",{x:i,y:a,ry:f,width:s,height:u,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function rL(e,t){var r;if(z.isValidElement(e))r=z.cloneElement(e,t);else if(ze(e))r=e(t);else{var n=t.x1,i=t.y1,a=t.x2,s=t.y2,u=t.key,f=_T(t,See),c=Me(f,!1);c.offset;var d=_T(c,Oee);r=z.createElement("line",ka({},d,{x1:n,y1:i,x2:a,y2:s,fill:"none",key:u}))}return r}function Cee(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,a=e.horizontalPoints;if(!i||!a||!a.length)return null;var s=a.map(function(u,f){var c=ir(ir({},e),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(f),index:f});return rL(i,c)});return z.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function Tee(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,a=e.verticalPoints;if(!i||!a||!a.length)return null;var s=a.map(function(u,f){var c=ir(ir({},e),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(f),index:f});return rL(i,c)});return z.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function kee(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,a=e.width,s=e.height,u=e.horizontalPoints,f=e.horizontal,c=f===void 0?!0:f;if(!c||!t||!t.length)return null;var d=u.map(function(m){return Math.round(m+i-i)}).sort(function(m,g){return m-g});i!==d[0]&&d.unshift(0);var h=d.map(function(m,g){var b=!d[g+1],y=b?i+s-m:d[g+1]-m;if(y<=0)return null;var w=g%t.length;return z.createElement("rect",{key:"react-".concat(g),y:m,x:n,height:y,width:a,stroke:"none",fill:t[w],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return z.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},h)}function Ree(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,a=e.x,s=e.y,u=e.width,f=e.height,c=e.verticalPoints;if(!r||!n||!n.length)return null;var d=c.map(function(m){return Math.round(m+a-a)}).sort(function(m,g){return m-g});a!==d[0]&&d.unshift(0);var h=d.map(function(m,g){var b=!d[g+1],y=b?a+u-m:d[g+1]-m;if(y<=0)return null;var w=g%n.length;return z.createElement("rect",{key:"react-".concat(g),x:m,y:s,width:y,height:f,stroke:"none",fill:n[w],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return z.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},h)}var Mee=function(t,r){var n=t.xAxis,i=t.width,a=t.height,s=t.offset;return rD(s_(ir(ir(ir({},Fs.defaultProps),n),{},{ticks:li(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),s.left,s.left+s.width,r)},Iee=function(t,r){var n=t.yAxis,i=t.width,a=t.height,s=t.offset;return rD(s_(ir(ir(ir({},Fs.defaultProps),n),{},{ticks:li(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),s.top,s.top+s.height,r)},Ro={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Rh(e){var t,r,n,i,a,s,u=n_(),f=i_(),c=_J(),d=ir(ir({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Ro.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Ro.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Ro.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:Ro.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:Ro.vertical,verticalFill:(s=e.verticalFill)!==null&&s!==void 0?s:Ro.verticalFill,x:he(e.x)?e.x:c.left,y:he(e.y)?e.y:c.top,width:he(e.width)?e.width:c.width,height:he(e.height)?e.height:c.height}),h=d.x,m=d.y,g=d.width,b=d.height,y=d.syncWithTicks,w=d.horizontalValues,S=d.verticalValues,O=xJ(),E=bJ();if(!he(g)||g<=0||!he(b)||b<=0||!he(h)||h!==+h||!he(m)||m!==+m)return null;var C=d.verticalCoordinatesGenerator||Mee,A=d.horizontalCoordinatesGenerator||Iee,N=d.horizontalPoints,T=d.verticalPoints;if((!N||!N.length)&&ze(A)){var R=w&&w.length,I=A({yAxis:E?ir(ir({},E),{},{ticks:R?w:E.ticks}):void 0,width:u,height:f,offset:c},R?!0:y);Sn(Array.isArray(I),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Fa(I),"]")),Array.isArray(I)&&(N=I)}if((!T||!T.length)&&ze(C)){var q=S&&S.length,L=C({xAxis:O?ir(ir({},O),{},{ticks:q?S:O.ticks}):void 0,width:u,height:f,offset:c},q?!0:y);Sn(Array.isArray(L),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Fa(L),"]")),Array.isArray(L)&&(T=L)}return z.createElement("g",{className:"recharts-cartesian-grid"},z.createElement(Nee,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),z.createElement(Cee,ka({},d,{offset:c,horizontalPoints:N,xAxis:O,yAxis:E})),z.createElement(Tee,ka({},d,{offset:c,verticalPoints:T,xAxis:O,yAxis:E})),z.createElement(kee,ka({},d,{horizontalPoints:N})),z.createElement(Ree,ka({},d,{verticalPoints:T})))}Rh.displayName="CartesianGrid";var Dee=["type","layout","connectNulls","ref"],Lee=["key"];function js(e){"@babel/helpers - typeof";return js=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},js(e)}function ST(e,t){if(e==null)return{};var r=$ee(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $ee(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 sc(){return sc=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rh){g=[].concat(Mo(f.slice(0,b)),[h-y]);break}var w=g.length%2===0?[0,m]:[m];return[].concat(Mo(t.repeat(f,d)),Mo(g),w).map(function(S){return"".concat(S,"px")}).join(", ")}),wn(r,"id",Ds("recharts-line-")),wn(r,"pathRef",function(s){r.mainCurve=s}),wn(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),wn(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return Kee(t,e),Wee(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,s=a.points,u=a.xAxis,f=a.yAxis,c=a.layout,d=a.children,h=Fr(d,nu);if(!h)return null;var m=function(y,w){return{x:y.x,y:y.y,value:y.value,errorVal:Bt(y.payload,w)}},g={clipPath:n?"url(#clipPath-".concat(i,")"):null};return z.createElement(Ze,g,h.map(function(b){return z.cloneElement(b,{key:"bar-".concat(b.props.dataKey),data:s,xAxis:u,yAxis:f,layout:c,dataPointFormatter:m})}))}},{key:"renderDots",value:function(n,i,a){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var u=this.props,f=u.dot,c=u.points,d=u.dataKey,h=Me(this.props,!1),m=Me(f,!0),g=c.map(function(y,w){var S=kr(kr(kr({key:"dot-".concat(w),r:3},h),m),{},{index:w,cx:y.x,cy:y.y,value:y.value,dataKey:d,payload:y.payload,points:c});return t.renderDotItem(f,S)}),b={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return z.createElement(Ze,sc({className:"recharts-line-dots",key:"dots"},b),g)}},{key:"renderCurveStatically",value:function(n,i,a,s){var u=this.props,f=u.type,c=u.layout,d=u.connectNulls;u.ref;var h=ST(u,Dee),m=kr(kr(kr({},Me(h,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},s),{},{type:f,layout:c,connectNulls:d});return z.createElement(dh,sc({},m,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,s=this.props,u=s.points,f=s.strokeDasharray,c=s.isAnimationActive,d=s.animationBegin,h=s.animationDuration,m=s.animationEasing,g=s.animationId,b=s.animateNewValues,y=s.width,w=s.height,S=this.state,O=S.prevPoints,E=S.totalLength;return z.createElement(Fn,{begin:d,duration:h,isActive:c,easing:m,from:{t:0},to:{t:1},key:"line-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(C){var A=C.t;if(O){var N=O.length/u.length,T=u.map(function(D,U){var H=Math.floor(U*N);if(O[H]){var V=O[H],K=Lr(V.x,D.x),X=Lr(V.y,D.y);return kr(kr({},D),{},{x:K(A),y:X(A)})}if(b){var B=Lr(y*2,D.x),Z=Lr(w/2,D.y);return kr(kr({},D),{},{x:B(A),y:Z(A)})}return kr(kr({},D),{},{x:D.x,y:D.y})});return a.renderCurveStatically(T,n,i)}var R=Lr(0,E),I=R(A),q;if(f){var L="".concat(f).split(/[,\s]+/gim).map(function(D){return parseFloat(D)});q=a.getStrokeDasharray(I,E,L)}else q=a.generateSimpleStrokeDasharray(E,I);return a.renderCurveStatically(u,n,i,{strokeDasharray:q})})}},{key:"renderCurve",value:function(n,i){var a=this.props,s=a.points,u=a.isAnimationActive,f=this.state,c=f.prevPoints,d=f.totalLength;return u&&s&&s.length&&(!c&&d>0||!ru(c,s))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(s,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,s=i.dot,u=i.points,f=i.className,c=i.xAxis,d=i.yAxis,h=i.top,m=i.left,g=i.width,b=i.height,y=i.isAnimationActive,w=i.id;if(a||!u||!u.length)return null;var S=this.state.isAnimationFinished,O=u.length===1,E=Ue("recharts-line",f),C=c&&c.allowDataOverflow,A=d&&d.allowDataOverflow,N=C||A,T=qe(w)?this.id:w,R=(n=Me(s,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},I=R.r,q=I===void 0?3:I,L=R.strokeWidth,D=L===void 0?2:L,U=OF(s)?s:{},H=U.clipDot,V=H===void 0?!0:H,K=q*2+D;return z.createElement(Ze,{className:E},C||A?z.createElement("defs",null,z.createElement("clipPath",{id:"clipPath-".concat(T)},z.createElement("rect",{x:C?m:m-g/2,y:A?h:h-b/2,width:C?g:g*2,height:A?b:b*2})),!V&&z.createElement("clipPath",{id:"clipPath-dots-".concat(T)},z.createElement("rect",{x:m-K/2,y:h-K/2,width:g+K,height:b+K}))):null,!O&&this.renderCurve(N,T),this.renderErrorBar(N,T),(O||s)&&this.renderDots(N,V,T),(!y||S)&&fi.renderCallByParent(this.props,u))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var a=n.length%2!==0?[].concat(Mo(n),[0]):n,s=[],u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $te(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 Bte(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zte(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?s:t&&t.length&&he(i)&&he(a)?t.slice(i,a+1):[]};function gL(e){return e==="number"?[0,"auto"]:void 0}var M1=function(t,r,n,i){var a=t.graphicalItems,s=t.tooltipAxis,u=Rp(r,t);return n<0||!a||!a.length||n>=u.length?null:a.reduce(function(f,c){var d,h=(d=c.props.data)!==null&&d!==void 0?d:r;h&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(h=h.slice(t.dataStartIndex,t.dataEndIndex+1));var m;if(s.dataKey&&!s.allowDuplicatedCategory){var g=h===void 0?u:h;m=Dd(g,s.dataKey,i)}else m=h&&h[n]||u[n];return m?[].concat(Ns(f),[sD(c,m)]):f},[])},kT=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},s=Zte(a,n),u=t.orderedTooltipTicks,f=t.tooltipAxis,c=t.tooltipTicks,d=wG(s,u,c,f);if(d>=0&&c){var h=c[d]&&c[d].value,m=M1(t,r,d,h),g=Jte(n,u,d,a);return{activeTooltipIndex:d,activeLabel:h,activePayload:m,activeCoordinate:g}}return null},ere=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,s=r.axisIdKey,u=r.stackGroups,f=r.dataStartIndex,c=r.dataEndIndex,d=t.layout,h=t.children,m=t.stackOffset,g=tD(d,a);return n.reduce(function(b,y){var w,S=y.type.defaultProps!==void 0?ne(ne({},y.type.defaultProps),y.props):y.props,O=S.type,E=S.dataKey,C=S.allowDataOverflow,A=S.allowDuplicatedCategory,N=S.scale,T=S.ticks,R=S.includeHidden,I=S[s];if(b[I])return b;var q=Rp(t.data,{graphicalItems:i.filter(function($){var Q,ae=s in $.props?$.props[s]:(Q=$.type.defaultProps)===null||Q===void 0?void 0:Q[s];return ae===I}),dataStartIndex:f,dataEndIndex:c}),L=q.length,D,U,H;Ete(S.domain,C,O)&&(D=Kb(S.domain,null,C),g&&(O==="number"||N!=="auto")&&(H=nc(q,E,"category")));var V=gL(O);if(!D||D.length===0){var K,X=(K=S.domain)!==null&&K!==void 0?K:V;if(E){if(D=nc(q,E,O),O==="category"&&g){var B=pF(D);A&&B?(U=D,D=Sh(0,L)):A||(D=MN(X,D,y).reduce(function($,Q){return $.indexOf(Q)>=0?$:[].concat(Ns($),[Q])},[]))}else if(O==="category")A?D=D.filter(function($){return $!==""&&!qe($)}):D=MN(X,D,y).reduce(function($,Q){return $.indexOf(Q)>=0||Q===""||qe(Q)?$:[].concat(Ns($),[Q])},[]);else if(O==="number"){var Z=EG(q,i.filter(function($){var Q,ae,pe=s in $.props?$.props[s]:(Q=$.type.defaultProps)===null||Q===void 0?void 0:Q[s],ye="hide"in $.props?$.props.hide:(ae=$.type.defaultProps)===null||ae===void 0?void 0:ae.hide;return pe===I&&(R||!ye)}),E,a,d);Z&&(D=Z)}g&&(O==="number"||N!=="auto")&&(H=nc(q,E,"category"))}else g?D=Sh(0,L):u&&u[I]&&u[I].hasStack&&O==="number"?D=m==="expand"?[0,1]:oD(u[I].stackGroups,f,c):D=eD(q,i.filter(function($){var Q=s in $.props?$.props[s]:$.type.defaultProps[s],ae="hide"in $.props?$.props.hide:$.type.defaultProps.hide;return Q===I&&(R||!ae)}),O,d,!0);if(O==="number")D=T1(h,D,I,a,T),X&&(D=Kb(X,D,C));else if(O==="category"&&X){var ee=X,M=D.every(function($){return ee.indexOf($)>=0});M&&(D=ee)}}return ne(ne({},b),{},Le({},I,ne(ne({},S),{},{axisType:a,domain:D,categoricalDomain:H,duplicateDomain:U,originalDomain:(w=S.domain)!==null&&w!==void 0?w:V,isCategorical:g,layout:d})))},{})},tre=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,s=r.axisIdKey,u=r.stackGroups,f=r.dataStartIndex,c=r.dataEndIndex,d=t.layout,h=t.children,m=Rp(t.data,{graphicalItems:n,dataStartIndex:f,dataEndIndex:c}),g=m.length,b=tD(d,a),y=-1;return n.reduce(function(w,S){var O=S.type.defaultProps!==void 0?ne(ne({},S.type.defaultProps),S.props):S.props,E=O[s],C=gL("number");if(!w[E]){y++;var A;return b?A=Sh(0,g):u&&u[E]&&u[E].hasStack?(A=oD(u[E].stackGroups,f,c),A=T1(h,A,E,a)):(A=Kb(C,eD(m,n.filter(function(N){var T,R,I=s in N.props?N.props[s]:(T=N.type.defaultProps)===null||T===void 0?void 0:T[s],q="hide"in N.props?N.props.hide:(R=N.type.defaultProps)===null||R===void 0?void 0:R.hide;return I===E&&!q}),"number",d),i.defaultProps.allowDataOverflow),A=T1(h,A,E,a)),ne(ne({},w),{},Le({},E,ne(ne({axisType:a},i.defaultProps),{},{hide:!0,orientation:zr(Yte,"".concat(a,".").concat(y%2),null),domain:A,originalDomain:C,isCategorical:b,layout:d})))}return w},{})},rre=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,s=r.graphicalItems,u=r.stackGroups,f=r.dataStartIndex,c=r.dataEndIndex,d=t.children,h="".concat(i,"Id"),m=Fr(d,a),g={};return m&&m.length?g=ere(t,{axes:m,graphicalItems:s,axisType:i,axisIdKey:h,stackGroups:u,dataStartIndex:f,dataEndIndex:c}):s&&s.length&&(g=tre(t,{Axis:a,graphicalItems:s,axisType:i,axisIdKey:h,stackGroups:u,dataStartIndex:f,dataEndIndex:c})),g},nre=function(t){var r=Wi(t),n=li(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Ew(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:ch(r,n)}},RT=function(t){var r=t.children,n=t.defaultShowTooltip,i=Mr(r,xs),a=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!n}},ire=function(t){return!t||!t.length?!1:t.some(function(r){var n=ci(r&&r.type);return n&&n.indexOf("Bar")>=0})},MT=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},are=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,s=a===void 0?{}:a,u=t.yAxisMap,f=u===void 0?{}:u,c=n.width,d=n.height,h=n.children,m=n.margin||{},g=Mr(h,xs),b=Mr(h,Qo),y=Object.keys(f).reduce(function(A,N){var T=f[N],R=T.orientation;return!T.mirror&&!T.hide?ne(ne({},A),{},Le({},R,A[R]+T.width)):A},{left:m.left||0,right:m.right||0}),w=Object.keys(s).reduce(function(A,N){var T=s[N],R=T.orientation;return!T.mirror&&!T.hide?ne(ne({},A),{},Le({},R,zr(A,"".concat(R))+T.height)):A},{top:m.top||0,bottom:m.bottom||0}),S=ne(ne({},w),y),O=S.bottom;g&&(S.bottom+=g.props.height||xs.defaultProps.height),b&&r&&(S=OG(S,i,n,r));var E=c-S.left-S.right,C=d-S.top-S.bottom;return ne(ne({brushBottom:O},S),{},{width:Math.max(E,0),height:Math.max(C,0)})},ore=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},c_=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,s=t.validateTooltipEventTypes,u=s===void 0?["axis"]:s,f=t.axisComponents,c=t.legendContent,d=t.formatAxisMap,h=t.defaultProps,m=function(S,O){var E=O.graphicalItems,C=O.stackGroups,A=O.offset,N=O.updateId,T=O.dataStartIndex,R=O.dataEndIndex,I=S.barSize,q=S.layout,L=S.barGap,D=S.barCategoryGap,U=S.maxBarSize,H=MT(q),V=H.numericAxisName,K=H.cateAxisName,X=ire(E),B=[];return E.forEach(function(Z,ee){var M=Rp(S.data,{graphicalItems:[Z],dataStartIndex:T,dataEndIndex:R}),$=Z.type.defaultProps!==void 0?ne(ne({},Z.type.defaultProps),Z.props):Z.props,Q=$.dataKey,ae=$.maxBarSize,pe=$["".concat(V,"Id")],ye=$["".concat(K,"Id")],oe={},me=f.reduce(function(Kt,Xt){var io=O["".concat(Xt.axisType,"Map")],Vs=$["".concat(Xt.axisType,"Id")];io&&io[Vs]||Xt.axisType==="zAxis"||za();var Gs=io[Vs];return ne(ne({},Kt),{},Le(Le({},Xt.axisType,Gs),"".concat(Xt.axisType,"Ticks"),li(Gs)))},oe),ie=me[K],ue=me["".concat(K,"Ticks")],ve=C&&C[pe]&&C[pe].hasStack&&IG(Z,C[pe].stackGroups),re=ci(Z.type).indexOf("Bar")>=0,De=ch(ie,ue),Te=[],Ke=X&&_G({barSize:I,stackGroups:C,totalSize:ore(me,K)});if(re){var lt,vt,dr=qe(ae)?U:ae,Or=(lt=(vt=ch(ie,ue,!0))!==null&&vt!==void 0?vt:dr)!==null&<!==void 0?lt:0;Te=SG({barGap:L,barCategoryGap:D,bandSize:Or!==De?Or:De,sizeList:Ke[ye],maxBarSize:dr}),Or!==De&&(Te=Te.map(function(Kt){return ne(ne({},Kt),{},{position:ne(ne({},Kt.position),{},{offset:Kt.position.offset-Or/2})})}))}var jr=Z&&Z.type&&Z.type.getComposedData;jr&&B.push({props:ne(ne({},jr(ne(ne({},me),{},{displayedData:M,props:S,dataKey:Q,item:Z,bandSize:De,barPosition:Te,offset:A,stackedData:ve,layout:q,dataStartIndex:T,dataEndIndex:R}))),{},Le(Le(Le({key:Z.key||"item-".concat(ee)},V,me[V]),K,me[K]),"animationId",N)),childIndex:AF(Z,S.children),item:Z})}),B},g=function(S,O){var E=S.props,C=S.dataStartIndex,A=S.dataEndIndex,N=S.updateId;if(!KE({props:E}))return null;var T=E.children,R=E.layout,I=E.stackOffset,q=E.data,L=E.reverseStackOrder,D=MT(R),U=D.numericAxisName,H=D.cateAxisName,V=Fr(T,n),K=RG(q,V,"".concat(U,"Id"),"".concat(H,"Id"),I,L),X=f.reduce(function($,Q){var ae="".concat(Q.axisType,"Map");return ne(ne({},$),{},Le({},ae,rre(E,ne(ne({},Q),{},{graphicalItems:V,stackGroups:Q.axisType===U&&K,dataStartIndex:C,dataEndIndex:A}))))},{}),B=are(ne(ne({},X),{},{props:E,graphicalItems:V}),O?.legendBBox);Object.keys(X).forEach(function($){X[$]=d(E,X[$],B,$.replace("Map",""),r)});var Z=X["".concat(H,"Map")],ee=nre(Z),M=m(E,ne(ne({},X),{},{dataStartIndex:C,dataEndIndex:A,updateId:N,graphicalItems:V,stackGroups:K,offset:B}));return ne(ne({formattedGraphicalItems:M,graphicalItems:V,offset:B,stackGroups:K},ee),X)},b=(function(w){function S(O){var E,C,A;return Bte(this,S),A=qte(this,S,[O]),Le(A,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Le(A,"accessibilityManager",new jte),Le(A,"handleLegendBBoxUpdate",function(N){if(N){var T=A.state,R=T.dataStartIndex,I=T.dataEndIndex,q=T.updateId;A.setState(ne({legendBBox:N},g({props:A.props,dataStartIndex:R,dataEndIndex:I,updateId:q},ne(ne({},A.state),{},{legendBBox:N}))))}}),Le(A,"handleReceiveSyncEvent",function(N,T,R){if(A.props.syncId===N){if(R===A.eventEmitterSymbol&&typeof A.props.syncMethod!="function")return;A.applySyncEvent(T)}}),Le(A,"handleBrushChange",function(N){var T=N.startIndex,R=N.endIndex;if(T!==A.state.dataStartIndex||R!==A.state.dataEndIndex){var I=A.state.updateId;A.setState(function(){return ne({dataStartIndex:T,dataEndIndex:R},g({props:A.props,dataStartIndex:T,dataEndIndex:R,updateId:I},A.state))}),A.triggerSyncEvent({dataStartIndex:T,dataEndIndex:R})}}),Le(A,"handleMouseEnter",function(N){var T=A.getMouseInfo(N);if(T){var R=ne(ne({},T),{},{isTooltipActive:!0});A.setState(R),A.triggerSyncEvent(R);var I=A.props.onMouseEnter;ze(I)&&I(R,N)}}),Le(A,"triggeredAfterMouseMove",function(N){var T=A.getMouseInfo(N),R=T?ne(ne({},T),{},{isTooltipActive:!0}):{isTooltipActive:!1};A.setState(R),A.triggerSyncEvent(R);var I=A.props.onMouseMove;ze(I)&&I(R,N)}),Le(A,"handleItemMouseEnter",function(N){A.setState(function(){return{isTooltipActive:!0,activeItem:N,activePayload:N.tooltipPayload,activeCoordinate:N.tooltipPosition||{x:N.cx,y:N.cy}}})}),Le(A,"handleItemMouseLeave",function(){A.setState(function(){return{isTooltipActive:!1}})}),Le(A,"handleMouseMove",function(N){N.persist(),A.throttleTriggeredAfterMouseMove(N)}),Le(A,"handleMouseLeave",function(N){A.throttleTriggeredAfterMouseMove.cancel();var T={isTooltipActive:!1};A.setState(T),A.triggerSyncEvent(T);var R=A.props.onMouseLeave;ze(R)&&R(T,N)}),Le(A,"handleOuterEvent",function(N){var T=EF(N),R=zr(A.props,"".concat(T));if(T&&ze(R)){var I,q;/.*touch.*/i.test(T)?q=A.getMouseInfo(N.changedTouches[0]):q=A.getMouseInfo(N),R((I=q)!==null&&I!==void 0?I:{},N)}}),Le(A,"handleClick",function(N){var T=A.getMouseInfo(N);if(T){var R=ne(ne({},T),{},{isTooltipActive:!0});A.setState(R),A.triggerSyncEvent(R);var I=A.props.onClick;ze(I)&&I(R,N)}}),Le(A,"handleMouseDown",function(N){var T=A.props.onMouseDown;if(ze(T)){var R=A.getMouseInfo(N);T(R,N)}}),Le(A,"handleMouseUp",function(N){var T=A.props.onMouseUp;if(ze(T)){var R=A.getMouseInfo(N);T(R,N)}}),Le(A,"handleTouchMove",function(N){N.changedTouches!=null&&N.changedTouches.length>0&&A.throttleTriggeredAfterMouseMove(N.changedTouches[0])}),Le(A,"handleTouchStart",function(N){N.changedTouches!=null&&N.changedTouches.length>0&&A.handleMouseDown(N.changedTouches[0])}),Le(A,"handleTouchEnd",function(N){N.changedTouches!=null&&N.changedTouches.length>0&&A.handleMouseUp(N.changedTouches[0])}),Le(A,"handleDoubleClick",function(N){var T=A.props.onDoubleClick;if(ze(T)){var R=A.getMouseInfo(N);T(R,N)}}),Le(A,"handleContextMenu",function(N){var T=A.props.onContextMenu;if(ze(T)){var R=A.getMouseInfo(N);T(R,N)}}),Le(A,"triggerSyncEvent",function(N){A.props.syncId!==void 0&&Gx.emit(Kx,A.props.syncId,N,A.eventEmitterSymbol)}),Le(A,"applySyncEvent",function(N){var T=A.props,R=T.layout,I=T.syncMethod,q=A.state.updateId,L=N.dataStartIndex,D=N.dataEndIndex;if(N.dataStartIndex!==void 0||N.dataEndIndex!==void 0)A.setState(ne({dataStartIndex:L,dataEndIndex:D},g({props:A.props,dataStartIndex:L,dataEndIndex:D,updateId:q},A.state)));else if(N.activeTooltipIndex!==void 0){var U=N.chartX,H=N.chartY,V=N.activeTooltipIndex,K=A.state,X=K.offset,B=K.tooltipTicks;if(!X)return;if(typeof I=="function")V=I(B,N);else if(I==="value"){V=-1;for(var Z=0;Z=0){var ve,re;if(U.dataKey&&!U.allowDuplicatedCategory){var De=typeof U.dataKey=="function"?ue:"payload.".concat(U.dataKey.toString());ve=Dd(Z,De,V),re=ee&&M&&Dd(M,De,V)}else ve=Z?.[H],re=ee&&M&&M[H];if(ye||pe){var Te=N.props.activeIndex!==void 0?N.props.activeIndex:H;return[P.cloneElement(N,ne(ne(ne({},I.props),me),{},{activeIndex:Te})),null,null]}if(!qe(ve))return[ie].concat(Ns(A.renderActivePoints({item:I,activePoint:ve,basePoint:re,childIndex:H,isRange:ee})))}else{var Ke,lt=(Ke=A.getItemByXY(A.state.activeCoordinate))!==null&&Ke!==void 0?Ke:{graphicalItem:ie},vt=lt.graphicalItem,dr=vt.item,Or=dr===void 0?N:dr,jr=vt.childIndex,Kt=ne(ne(ne({},I.props),me),{},{activeIndex:jr});return[P.cloneElement(Or,Kt),null,null]}return ee?[ie,null,null]:[ie,null]}),Le(A,"renderCustomized",function(N,T,R){return P.cloneElement(N,ne(ne({key:"recharts-customized-".concat(R)},A.props),A.state))}),Le(A,"renderMap",{CartesianGrid:{handler:Lf,once:!0},ReferenceArea:{handler:A.renderReferenceElement},ReferenceLine:{handler:Lf},ReferenceDot:{handler:A.renderReferenceElement},XAxis:{handler:Lf},YAxis:{handler:Lf},Brush:{handler:A.renderBrush,once:!0},Bar:{handler:A.renderGraphicChild},Line:{handler:A.renderGraphicChild},Area:{handler:A.renderGraphicChild},Radar:{handler:A.renderGraphicChild},RadialBar:{handler:A.renderGraphicChild},Scatter:{handler:A.renderGraphicChild},Pie:{handler:A.renderGraphicChild},Funnel:{handler:A.renderGraphicChild},Tooltip:{handler:A.renderCursor,once:!0},PolarGrid:{handler:A.renderPolarGrid,once:!0},PolarAngleAxis:{handler:A.renderPolarAxis},PolarRadiusAxis:{handler:A.renderPolarAxis},Customized:{handler:A.renderCustomized}}),A.clipPathId="".concat((E=O.id)!==null&&E!==void 0?E:Ds("recharts"),"-clip"),A.throttleTriggeredAfterMouseMove=ZM(A.triggeredAfterMouseMove,(C=O.throttleDelay)!==null&&C!==void 0?C:1e3/60),A.state={},A}return Hte(S,w),Fte(S,[{key:"componentDidMount",value:function(){var E,C;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(E=this.props.margin.left)!==null&&E!==void 0?E:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var E=this.props,C=E.children,A=E.data,N=E.height,T=E.layout,R=Mr(C,Dr);if(R){var I=R.props.defaultIndex;if(!(typeof I!="number"||I<0||I>this.state.tooltipTicks.length-1)){var q=this.state.tooltipTicks[I]&&this.state.tooltipTicks[I].value,L=M1(this.state,A,I,q),D=this.state.tooltipTicks[I].coordinate,U=(this.state.offset.top+N)/2,H=T==="horizontal",V=H?{x:D,y:U}:{y:D,x:U},K=this.state.formattedGraphicalItems.find(function(B){var Z=B.item;return Z.type.name==="Scatter"});K&&(V=ne(ne({},V),K.props.points[I].tooltipPosition),L=K.props.points[I].tooltipPayload);var X={activeTooltipIndex:I,isTooltipActive:!0,activeLabel:q,activePayload:L,activeCoordinate:V};this.setState(X),this.renderCursor(R),this.accessibilityManager.setIndex(I)}}}},{key:"getSnapshotBeforeUpdate",value:function(E,C){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==C.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==E.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==E.margin){var A,N;this.accessibilityManager.setDetails({offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(N=this.props.margin.top)!==null&&N!==void 0?N:0}})}return null}},{key:"componentDidUpdate",value:function(E){vb([Mr(E.children,Dr)],[Mr(this.props.children,Dr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var E=Mr(this.props.children,Dr);if(E&&typeof E.props.shared=="boolean"){var C=E.props.shared?"axis":"item";return u.indexOf(C)>=0?C:a}return a}},{key:"getMouseInfo",value:function(E){if(!this.container)return null;var C=this.container,A=C.getBoundingClientRect(),N=hU(A),T={chartX:Math.round(E.pageX-N.left),chartY:Math.round(E.pageY-N.top)},R=A.width/C.offsetWidth||1,I=this.inRange(T.chartX,T.chartY,R);if(!I)return null;var q=this.state,L=q.xAxisMap,D=q.yAxisMap,U=this.getTooltipEventType(),H=kT(this.state,this.props.data,this.props.layout,I);if(U!=="axis"&&L&&D){var V=Wi(L).scale,K=Wi(D).scale,X=V&&V.invert?V.invert(T.chartX):null,B=K&&K.invert?K.invert(T.chartY):null;return ne(ne({},T),{},{xValue:X,yValue:B},H)}return H?ne(ne({},T),H):null}},{key:"inRange",value:function(E,C){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,N=this.props.layout,T=E/A,R=C/A;if(N==="horizontal"||N==="vertical"){var I=this.state.offset,q=T>=I.left&&T<=I.left+I.width&&R>=I.top&&R<=I.top+I.height;return q?{x:T,y:R}:null}var L=this.state,D=L.angleAxisMap,U=L.radiusAxisMap;if(D&&U){var H=Wi(D);return LN({x:T,y:R},H)}return null}},{key:"parseEventsOfWrapper",value:function(){var E=this.props.children,C=this.getTooltipEventType(),A=Mr(E,Dr),N={};A&&C==="axis"&&(A.props.trigger==="click"?N={onClick:this.handleClick}:N={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var T=Ld(this.props,this.handleOuterEvent);return ne(ne({},T),N)}},{key:"addListener",value:function(){Gx.on(Kx,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Gx.removeListener(Kx,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(E,C,A){for(var N=this.state.formattedGraphicalItems,T=0,R=N.length;Tp.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg border border-gray-100 hover:bg-gray-100 transition-colors",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("div",{className:"w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center text-blue-600 font-bold text-xs",children:e.template.substring(0,2)}),p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-semibold text-gray-900",children:e.product}),p.jsxs("p",{className:"text-xs text-gray-500",children:[e.id," • ",e.user]})]})]}),p.jsxs("div",{className:"flex items-center gap-4",children:[p.jsx("span",{className:"text-xs text-gray-500 font-medium",children:e.time}),p.jsx(Rn,{variant:"secondary",className:e.status==="expired"?"bg-red-100 text-red-700":"bg-green-100 text-green-700",children:e.status})]})]},e.id))})})]})]}),p.jsx("div",{className:"space-y-6",children:p.jsxs(Ir,{className:"shadow-sm border-gray-200",children:[p.jsx(yn,{children:p.jsxs(xn,{className:"text-base font-bold text-gray-800 flex items-center gap-2",children:[p.jsx(ub,{className:"w-5 h-5 text-gray-500"}),"By Category"]})}),p.jsxs(tn,{children:[p.jsxs("div",{className:"h-[200px] relative",children:[p.jsx(Gd,{width:"100%",height:"100%",children:p.jsxs(lre,{children:[p.jsx(wi,{data:Yx,cx:"50%",cy:"50%",innerRadius:60,outerRadius:80,paddingAngle:5,dataKey:"value",children:Yx.map((e,t)=>p.jsx(cp,{fill:e.color},`cell-${t}`))}),p.jsx(Dr,{})]})}),p.jsxs("div",{className:"absolute inset-0 flex items-center justify-center flex-col pointer-events-none",children:[p.jsx("span",{className:"text-2xl font-bold text-gray-900",children:"1000"}),p.jsx("span",{className:"text-xs text-gray-500",children:"Total"})]})]}),p.jsx("div",{className:"mt-4 space-y-2",children:Yx.map(e=>p.jsxs("div",{className:"flex items-center justify-between text-sm",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:e.color}}),p.jsx("span",{className:"text-gray-600",children:e.name})]}),p.jsx("span",{className:"font-medium text-gray-900",children:e.value})]},e.name))})]})]})})]})]})}function Io({title:e,value:t,trend:r,trendUp:n,icon:i,color:a,bgColor:s}){return p.jsx(Ir,{className:"border-gray-200 shadow-sm hover:shadow-md transition-shadow",children:p.jsxs(tn,{className:"p-6",children:[p.jsxs("div",{className:"flex justify-between items-start",children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-medium text-gray-500 mb-1",children:e}),p.jsx("h3",{className:"text-2xl font-bold text-gray-900",children:t})]}),p.jsx("div",{className:`p-2 rounded-lg ${s}`,children:p.jsx(i,{className:`w-5 h-5 ${a}`})})]}),p.jsxs("div",{className:"mt-4 flex items-center text-sm",children:[n?p.jsx(fR,{className:"w-4 h-4 text-green-500 mr-1"}):p.jsx(aB,{className:"w-4 h-4 text-red-500 mr-1"}),p.jsx("span",{className:n?"text-green-600 font-medium":"text-red-600 font-medium",children:r}),p.jsx("span",{className:"text-gray-400 ml-1",children:"Vs. last period"})]})]})})}function dre({title:e}){return p.jsxs("div",{className:"space-y-6",children:[p.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[1,2,3,4].map(t=>p.jsxs(Ir,{children:[p.jsx(yn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:p.jsxs(xn,{className:"text-sm font-medium",children:["Metric ",t]})}),p.jsxs(tn,{children:[p.jsx("div",{className:"text-2xl font-bold",children:"000"}),p.jsx("p",{className:"text-xs text-muted-foreground",children:"+0.0% from last month"})]})]},t))}),p.jsx(Ir,{className:"min-h-[400px] flex items-center justify-center border-dashed",children:p.jsxs("div",{className:"text-center text-muted-foreground",children:[p.jsxs("h3",{className:"text-lg font-medium",children:[e," Module"]}),p.jsx("p",{children:"This module is currently under development."})]})})]})}function br({className:e,...t}){return p.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:p.jsx("table",{"data-slot":"table",className:Ie("w-full caption-bottom text-sm",e),...t})})}function wr({className:e,...t}){return p.jsx("thead",{"data-slot":"table-header",className:Ie("[&_tr]:border-b",e),...t})}function _r({className:e,...t}){return p.jsx("tbody",{"data-slot":"table-body",className:Ie("[&_tr:last-child]:border-0",e),...t})}function Qe({className:e,...t}){return p.jsx("tr",{"data-slot":"table-row",className:Ie("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function ge({className:e,...t}){return p.jsx("th",{"data-slot":"table-head",className:Ie("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function fe({className:e,...t}){return p.jsx("td",{"data-slot":"table-cell",className:Ie("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function IT(e){const t=hre(e),r=P.forwardRef((n,i)=>{const{children:a,...s}=n,u=P.Children.toArray(a),f=u.find(mre);if(f){const c=f.props.children,d=u.map(h=>h===f?P.Children.count(c)>1?P.Children.only(null):P.isValidElement(c)?c.props.children:null:h);return p.jsx(t,{...s,ref:i,children:P.isValidElement(c)?P.cloneElement(c,void 0,d):null})}return p.jsx(t,{...s,ref:i,children:a})});return r.displayName=`${e}.Slot`,r}function hre(e){const t=P.forwardRef((r,n)=>{const{children:i,...a}=r;if(P.isValidElement(i)){const s=gre(i),u=vre(a,i.props);return i.type!==P.Fragment&&(u.ref=n?Rs(n,s):s),P.cloneElement(i,u)}return P.Children.count(i)>1?P.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var pre=Symbol("radix.slottable");function mre(e){return P.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pre}function vre(e,t){const r={...t};for(const n in t){const i=e[n],a=t[n];/^on[A-Z]/.test(n)?i&&a?r[n]=(...u)=>{const f=a(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...a}:n==="className"&&(r[n]=[i,a].filter(Boolean).join(" "))}return{...e,...r}}function gre(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 xL(e){const t=e+"CollectionProvider",[r,n]=gi(t),[i,a]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=y=>{const{scope:w,children:S}=y,O=z.useRef(null),E=z.useRef(new Map).current;return p.jsx(i,{scope:w,itemMap:E,collectionRef:O,children:S})};s.displayName=t;const u=e+"CollectionSlot",f=IT(u),c=z.forwardRef((y,w)=>{const{scope:S,children:O}=y,E=a(u,S),C=Je(w,E.collectionRef);return p.jsx(f,{ref:C,children:O})});c.displayName=u;const d=e+"CollectionItemSlot",h="data-radix-collection-item",m=IT(d),g=z.forwardRef((y,w)=>{const{scope:S,children:O,...E}=y,C=z.useRef(null),A=Je(w,C),N=a(d,S);return z.useEffect(()=>(N.itemMap.set(C,{ref:C,...E}),()=>void N.itemMap.delete(C))),p.jsx(m,{[h]:"",ref:A,children:O})});g.displayName=d;function b(y){const w=a(e+"CollectionConsumer",y);return z.useCallback(()=>{const O=w.collectionRef.current;if(!O)return[];const E=Array.from(O.querySelectorAll(`[${h}]`));return Array.from(w.itemMap.values()).sort((N,T)=>E.indexOf(N.ref.current)-E.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:s,Slot:c,ItemSlot:g},b,n]}function yre(e,t=globalThis?.document){const r=ar(e);P.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var xre="DismissableLayer",I1="dismissableLayer.update",bre="dismissableLayer.pointerDownOutside",wre="dismissableLayer.focusOutside",DT,bL=P.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),u_=P.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:u,...f}=e,c=P.useContext(bL),[d,h]=P.useState(null),m=d?.ownerDocument??globalThis?.document,[,g]=P.useState({}),b=Je(t,T=>h(T)),y=Array.from(c.layers),[w]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),S=y.indexOf(w),O=d?y.indexOf(d):-1,E=c.layersWithOutsidePointerEventsDisabled.size>0,C=O>=S,A=Ore(T=>{const R=T.target,I=[...c.branches].some(q=>q.contains(R));!C||I||(i?.(T),s?.(T),T.defaultPrevented||u?.())},m),N=jre(T=>{const R=T.target;[...c.branches].some(q=>q.contains(R))||(a?.(T),s?.(T),T.defaultPrevented||u?.())},m);return yre(T=>{O===c.layers.size-1&&(n?.(T),!T.defaultPrevented&&u&&(T.preventDefault(),u()))},m),P.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(DT=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),LT(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=DT)}},[d,m,r,c]),P.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),LT())},[d,c]),P.useEffect(()=>{const T=()=>g({});return document.addEventListener(I1,T),()=>document.removeEventListener(I1,T)},[]),p.jsx(We.div,{...f,ref:b,style:{pointerEvents:E?C?"auto":"none":void 0,...e.style},onFocusCapture:Fe(e.onFocusCapture,N.onFocusCapture),onBlurCapture:Fe(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:Fe(e.onPointerDownCapture,A.onPointerDownCapture)})});u_.displayName=xre;var _re="DismissableLayerBranch",Sre=P.forwardRef((e,t)=>{const r=P.useContext(bL),n=P.useRef(null),i=Je(t,n);return P.useEffect(()=>{const a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),p.jsx(We.div,{...e,ref:i})});Sre.displayName=_re;function Ore(e,t=globalThis?.document){const r=ar(e),n=P.useRef(!1),i=P.useRef(()=>{});return P.useEffect(()=>{const a=u=>{if(u.target&&!n.current){let f=function(){wL(bre,r,c,{discrete:!0})};const c={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=f,t.addEventListener("click",i.current,{once:!0})):f()}else t.removeEventListener("click",i.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function jre(e,t=globalThis?.document){const r=ar(e),n=P.useRef(!1);return P.useEffect(()=>{const i=a=>{a.target&&!n.current&&wL(wre,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function LT(){const e=new CustomEvent(I1);document.dispatchEvent(e)}function wL(e,t,r,{discrete:n}){const i=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?P6(i,a):i.dispatchEvent(a)}var Qx=0;function _L(){P.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??$T()),document.body.insertAdjacentElement("beforeend",e[1]??$T()),Qx++,()=>{Qx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Qx--}},[])}function $T(){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 Zx="focusScope.autoFocusOnMount",Jx="focusScope.autoFocusOnUnmount",BT={bubbles:!1,cancelable:!0},Ere="FocusScope",f_=P.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...s}=e,[u,f]=P.useState(null),c=ar(i),d=ar(a),h=P.useRef(null),m=Je(t,y=>f(y)),g=P.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;P.useEffect(()=>{if(n){let y=function(E){if(g.paused||!u)return;const C=E.target;u.contains(C)?h.current=C:qi(h.current,{select:!0})},w=function(E){if(g.paused||!u)return;const C=E.relatedTarget;C!==null&&(u.contains(C)||qi(h.current,{select:!0}))},S=function(E){if(document.activeElement===document.body)for(const A of E)A.removedNodes.length>0&&qi(u)};document.addEventListener("focusin",y),document.addEventListener("focusout",w);const O=new MutationObserver(S);return u&&O.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",w),O.disconnect()}}},[n,u,g.paused]),P.useEffect(()=>{if(u){FT.add(g);const y=document.activeElement;if(!u.contains(y)){const S=new CustomEvent(Zx,BT);u.addEventListener(Zx,c),u.dispatchEvent(S),S.defaultPrevented||(Are(kre(SL(u)),{select:!0}),document.activeElement===y&&qi(u))}return()=>{u.removeEventListener(Zx,c),setTimeout(()=>{const S=new CustomEvent(Jx,BT);u.addEventListener(Jx,d),u.dispatchEvent(S),S.defaultPrevented||qi(y??document.body,{select:!0}),u.removeEventListener(Jx,d),FT.remove(g)},0)}}},[u,c,d,g]);const b=P.useCallback(y=>{if(!r&&!n||g.paused)return;const w=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,S=document.activeElement;if(w&&S){const O=y.currentTarget,[E,C]=Pre(O);E&&C?!y.shiftKey&&S===C?(y.preventDefault(),r&&qi(E,{select:!0})):y.shiftKey&&S===E&&(y.preventDefault(),r&&qi(C,{select:!0})):S===O&&y.preventDefault()}},[r,n,g.paused]);return p.jsx(We.div,{tabIndex:-1,...s,ref:m,onKeyDown:b})});f_.displayName=Ere;function Are(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(qi(n,{select:t}),document.activeElement!==r)return}function Pre(e){const t=SL(e),r=zT(t,e),n=zT(t.reverse(),e);return[r,n]}function SL(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function zT(e,t){for(const r of e)if(!Nre(r,{upTo:t}))return r}function Nre(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 Cre(e){return e instanceof HTMLInputElement&&"select"in e}function qi(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Cre(e)&&t&&e.select()}}var FT=Tre();function Tre(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=qT(e,t),e.unshift(t)},remove(t){e=qT(e,t),e[0]?.resume()}}}function qT(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function kre(e){return e.filter(t=>t.tagName!=="A")}var Rre=X1[" useId ".trim().toString()]||(()=>{}),Mre=0;function Gi(e){const[t,r]=P.useState(Rre());return Rt(()=>{r(n=>n??String(Mre++))},[e]),e||(t?`radix-${t}`:"")}const Ire=["top","right","bottom","left"],Xi=Math.min,$r=Math.max,$h=Math.round,$f=Math.floor,Bn=e=>({x:e,y:e}),Dre={left:"right",right:"left",bottom:"top",top:"bottom"},Lre={start:"end",end:"start"};function D1(e,t,r){return $r(e,Xi(t,r))}function mi(e,t){return typeof e=="function"?e(t):e}function vi(e){return e.split("-")[0]}function Us(e){return e.split("-")[1]}function d_(e){return e==="x"?"y":"x"}function h_(e){return e==="y"?"height":"width"}const $re=new Set(["top","bottom"]);function Dn(e){return $re.has(vi(e))?"y":"x"}function p_(e){return d_(Dn(e))}function Bre(e,t,r){r===void 0&&(r=!1);const n=Us(e),i=p_(e),a=h_(i);let s=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(s=Bh(s)),[s,Bh(s)]}function zre(e){const t=Bh(e);return[L1(e),t,L1(t)]}function L1(e){return e.replace(/start|end/g,t=>Lre[t])}const UT=["left","right"],WT=["right","left"],Fre=["top","bottom"],qre=["bottom","top"];function Ure(e,t,r){switch(e){case"top":case"bottom":return r?t?WT:UT:t?UT:WT;case"left":case"right":return t?Fre:qre;default:return[]}}function Wre(e,t,r,n){const i=Us(e);let a=Ure(vi(e),r==="start",n);return i&&(a=a.map(s=>s+"-"+i),t&&(a=a.concat(a.map(L1)))),a}function Bh(e){return e.replace(/left|right|bottom|top/g,t=>Dre[t])}function Hre(e){return{top:0,right:0,bottom:0,left:0,...e}}function OL(e){return typeof e!="number"?Hre(e):{top:e,right:e,bottom:e,left:e}}function zh(e){const{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function HT(e,t,r){let{reference:n,floating:i}=e;const a=Dn(t),s=p_(t),u=h_(s),f=vi(t),c=a==="y",d=n.x+n.width/2-i.width/2,h=n.y+n.height/2-i.height/2,m=n[u]/2-i[u]/2;let g;switch(f){case"top":g={x:d,y:n.y-i.height};break;case"bottom":g={x:d,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:h};break;case"left":g={x:n.x-i.width,y:h};break;default:g={x:n.x,y:n.y}}switch(Us(t)){case"start":g[s]-=m*(r&&c?-1:1);break;case"end":g[s]+=m*(r&&c?-1:1);break}return g}async function Vre(e,t){var r;t===void 0&&(t={});const{x:n,y:i,platform:a,rects:s,elements:u,strategy:f}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:m=!1,padding:g=0}=mi(t,e),b=OL(g),w=u[m?h==="floating"?"reference":"floating":h],S=zh(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(w)))==null||r?w:w.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(u.floating)),boundary:c,rootBoundary:d,strategy:f})),O=h==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u.floating)),C=await(a.isElement==null?void 0:a.isElement(E))?await(a.getScale==null?void 0:a.getScale(E))||{x:1,y:1}:{x:1,y:1},A=zh(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:O,offsetParent:E,strategy:f}):O);return{top:(S.top-A.top+b.top)/C.y,bottom:(A.bottom-S.bottom+b.bottom)/C.y,left:(S.left-A.left+b.left)/C.x,right:(A.right-S.right+b.right)/C.x}}const Gre=async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:a=[],platform:s}=r,u=a.filter(Boolean),f=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:h}=HT(c,n,f),m=n,g={},b=0;for(let w=0;w({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:a,platform:s,elements:u,middlewareData:f}=t,{element:c,padding:d=0}=mi(e,t)||{};if(c==null)return{};const h=OL(d),m={x:r,y:n},g=p_(i),b=h_(g),y=await s.getDimensions(c),w=g==="y",S=w?"top":"left",O=w?"bottom":"right",E=w?"clientHeight":"clientWidth",C=a.reference[b]+a.reference[g]-m[g]-a.floating[b],A=m[g]-a.reference[g],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let T=N?N[E]:0;(!T||!await(s.isElement==null?void 0:s.isElement(N)))&&(T=u.floating[E]||a.floating[b]);const R=C/2-A/2,I=T/2-y[b]/2-1,q=Xi(h[S],I),L=Xi(h[O],I),D=q,U=T-y[b]-L,H=T/2-y[b]/2+R,V=D1(D,H,U),K=!f.arrow&&Us(i)!=null&&H!==V&&a.reference[b]/2-(HH<=0)){var L,D;const H=(((L=a.flip)==null?void 0:L.index)||0)+1,V=T[H];if(V&&(!(h==="alignment"?O!==Dn(V):!1)||q.every(B=>Dn(B.placement)===O?B.overflows[0]>0:!0)))return{data:{index:H,overflows:q},reset:{placement:V}};let K=(D=q.filter(X=>X.overflows[0]<=0).sort((X,B)=>X.overflows[1]-B.overflows[1])[0])==null?void 0:D.placement;if(!K)switch(g){case"bestFit":{var U;const X=(U=q.filter(B=>{if(N){const Z=Dn(B.placement);return Z===O||Z==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(Z=>Z>0).reduce((Z,ee)=>Z+ee,0)]).sort((B,Z)=>B[1]-Z[1])[0])==null?void 0:U[0];X&&(K=X);break}case"initialPlacement":K=u;break}if(i!==K)return{reset:{placement:K}}}return{}}}};function VT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function GT(e){return Ire.some(t=>e[t]>=0)}const Yre=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:i="referenceHidden",...a}=mi(e,t);switch(i){case"referenceHidden":{const s=await n.detectOverflow(t,{...a,elementContext:"reference"}),u=VT(s,r.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:GT(u)}}}case"escaped":{const s=await n.detectOverflow(t,{...a,altBoundary:!0}),u=VT(s,r.floating);return{data:{escapedOffsets:u,escaped:GT(u)}}}default:return{}}}}},jL=new Set(["left","top"]);async function Qre(e,t){const{placement:r,platform:n,elements:i}=e,a=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=vi(r),u=Us(r),f=Dn(r)==="y",c=jL.has(s)?-1:1,d=a&&f?-1:1,h=mi(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return u&&typeof b=="number"&&(g=u==="end"?b*-1:b),f?{x:g*d,y:m*c}:{x:m*c,y:g*d}}const Zre=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:i,y:a,placement:s,middlewareData:u}=t,f=await Qre(t,e);return s===((r=u.offset)==null?void 0:r.placement)&&(n=u.arrow)!=null&&n.alignmentOffset?{}:{x:i+f.x,y:a+f.y,data:{...f,placement:s}}}}},Jre=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i,platform:a}=t,{mainAxis:s=!0,crossAxis:u=!1,limiter:f={fn:S=>{let{x:O,y:E}=S;return{x:O,y:E}}},...c}=mi(e,t),d={x:r,y:n},h=await a.detectOverflow(t,c),m=Dn(vi(i)),g=d_(m);let b=d[g],y=d[m];if(s){const S=g==="y"?"top":"left",O=g==="y"?"bottom":"right",E=b+h[S],C=b-h[O];b=D1(E,b,C)}if(u){const S=m==="y"?"top":"left",O=m==="y"?"bottom":"right",E=y+h[S],C=y-h[O];y=D1(E,y,C)}const w=f.fn({...t,[g]:b,[m]:y});return{...w,data:{x:w.x-r,y:w.y-n,enabled:{[g]:s,[m]:u}}}}}},ene=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:i,rects:a,middlewareData:s}=t,{offset:u=0,mainAxis:f=!0,crossAxis:c=!0}=mi(e,t),d={x:r,y:n},h=Dn(i),m=d_(h);let g=d[m],b=d[h];const y=mi(u,t),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(f){const E=m==="y"?"height":"width",C=a.reference[m]-a.floating[E]+w.mainAxis,A=a.reference[m]+a.reference[E]-w.mainAxis;gA&&(g=A)}if(c){var S,O;const E=m==="y"?"width":"height",C=jL.has(vi(i)),A=a.reference[h]-a.floating[E]+(C&&((S=s.offset)==null?void 0:S[h])||0)+(C?0:w.crossAxis),N=a.reference[h]+a.reference[E]+(C?0:((O=s.offset)==null?void 0:O[h])||0)-(C?w.crossAxis:0);bN&&(b=N)}return{[m]:g,[h]:b}}}},tne=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:i,rects:a,platform:s,elements:u}=t,{apply:f=()=>{},...c}=mi(e,t),d=await s.detectOverflow(t,c),h=vi(i),m=Us(i),g=Dn(i)==="y",{width:b,height:y}=a.floating;let w,S;h==="top"||h==="bottom"?(w=h,S=m===(await(s.isRTL==null?void 0:s.isRTL(u.floating))?"start":"end")?"left":"right"):(S=h,w=m==="end"?"top":"bottom");const O=y-d.top-d.bottom,E=b-d.left-d.right,C=Xi(y-d[w],O),A=Xi(b-d[S],E),N=!t.middlewareData.shift;let T=C,R=A;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(R=E),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(T=O),N&&!m){const q=$r(d.left,0),L=$r(d.right,0),D=$r(d.top,0),U=$r(d.bottom,0);g?R=b-2*(q!==0||L!==0?q+L:$r(d.left,d.right)):T=y-2*(D!==0||U!==0?D+U:$r(d.top,d.bottom))}await f({...t,availableWidth:R,availableHeight:T});const I=await s.getDimensions(u.floating);return b!==I.width||y!==I.height?{reset:{rects:!0}}:{}}}};function Mp(){return typeof window<"u"}function Ws(e){return EL(e)?(e.nodeName||"").toLowerCase():"#document"}function qr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Gn(e){var t;return(t=(EL(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function EL(e){return Mp()?e instanceof Node||e instanceof qr(e).Node:!1}function On(e){return Mp()?e instanceof Element||e instanceof qr(e).Element:!1}function qn(e){return Mp()?e instanceof HTMLElement||e instanceof qr(e).HTMLElement:!1}function KT(e){return!Mp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof qr(e).ShadowRoot}const rne=new Set(["inline","contents"]);function iu(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=jn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!rne.has(i)}const nne=new Set(["table","td","th"]);function ine(e){return nne.has(Ws(e))}const ane=[":popover-open",":modal"];function Ip(e){return ane.some(t=>{try{return e.matches(t)}catch{return!1}})}const one=["transform","translate","scale","rotate","perspective"],sne=["transform","translate","scale","rotate","perspective","filter"],lne=["paint","layout","strict","content"];function m_(e){const t=v_(),r=On(e)?jn(e):e;return one.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)||sne.some(n=>(r.willChange||"").includes(n))||lne.some(n=>(r.contain||"").includes(n))}function cne(e){let t=Yi(e);for(;qn(t)&&!Cs(t);){if(m_(t))return t;if(Ip(t))return null;t=Yi(t)}return null}function v_(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const une=new Set(["html","body","#document"]);function Cs(e){return une.has(Ws(e))}function jn(e){return qr(e).getComputedStyle(e)}function Dp(e){return On(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yi(e){if(Ws(e)==="html")return e;const t=e.assignedSlot||e.parentNode||KT(e)&&e.host||Gn(e);return KT(t)?t.host:t}function AL(e){const t=Yi(e);return Cs(t)?e.ownerDocument?e.ownerDocument.body:e.body:qn(t)&&iu(t)?t:AL(t)}function Gc(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const i=AL(e),a=i===((n=e.ownerDocument)==null?void 0:n.body),s=qr(i);if(a){const u=$1(s);return t.concat(s,s.visualViewport||[],iu(i)?i:[],u&&r?Gc(u):[])}return t.concat(i,Gc(i,[],r))}function $1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function PL(e){const t=jn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=qn(e),a=i?e.offsetWidth:r,s=i?e.offsetHeight:n,u=$h(r)!==a||$h(n)!==s;return u&&(r=a,n=s),{width:r,height:n,$:u}}function g_(e){return On(e)?e:e.contextElement}function es(e){const t=g_(e);if(!qn(t))return Bn(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:a}=PL(t);let s=(a?$h(r.width):r.width)/n,u=(a?$h(r.height):r.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!u||!Number.isFinite(u))&&(u=1),{x:s,y:u}}const fne=Bn(0);function NL(e){const t=qr(e);return!v_()||!t.visualViewport?fne:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dne(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==qr(e)?!1:t}function Wa(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),a=g_(e);let s=Bn(1);t&&(n?On(n)&&(s=es(n)):s=es(e));const u=dne(a,r,n)?NL(a):Bn(0);let f=(i.left+u.x)/s.x,c=(i.top+u.y)/s.y,d=i.width/s.x,h=i.height/s.y;if(a){const m=qr(a),g=n&&On(n)?qr(n):n;let b=m,y=$1(b);for(;y&&n&&g!==b;){const w=es(y),S=y.getBoundingClientRect(),O=jn(y),E=S.left+(y.clientLeft+parseFloat(O.paddingLeft))*w.x,C=S.top+(y.clientTop+parseFloat(O.paddingTop))*w.y;f*=w.x,c*=w.y,d*=w.x,h*=w.y,f+=E,c+=C,b=qr(y),y=$1(b)}}return zh({width:d,height:h,x:f,y:c})}function Lp(e,t){const r=Dp(e).scrollLeft;return t?t.left+r:Wa(Gn(e)).left+r}function CL(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Lp(e,r),i=r.top+t.scrollTop;return{x:n,y:i}}function hne(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e;const a=i==="fixed",s=Gn(n),u=t?Ip(t.floating):!1;if(n===s||u&&a)return r;let f={scrollLeft:0,scrollTop:0},c=Bn(1);const d=Bn(0),h=qn(n);if((h||!h&&!a)&&((Ws(n)!=="body"||iu(s))&&(f=Dp(n)),qn(n))){const g=Wa(n);c=es(n),d.x=g.x+n.clientLeft,d.y=g.y+n.clientTop}const m=s&&!h&&!a?CL(s,f):Bn(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-f.scrollLeft*c.x+d.x+m.x,y:r.y*c.y-f.scrollTop*c.y+d.y+m.y}}function pne(e){return Array.from(e.getClientRects())}function mne(e){const t=Gn(e),r=Dp(e),n=e.ownerDocument.body,i=$r(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=$r(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+Lp(e);const u=-r.scrollTop;return jn(n).direction==="rtl"&&(s+=$r(t.clientWidth,n.clientWidth)-i),{width:i,height:a,x:s,y:u}}const XT=25;function vne(e,t){const r=qr(e),n=Gn(e),i=r.visualViewport;let a=n.clientWidth,s=n.clientHeight,u=0,f=0;if(i){a=i.width,s=i.height;const d=v_();(!d||d&&t==="fixed")&&(u=i.offsetLeft,f=i.offsetTop)}const c=Lp(n);if(c<=0){const d=n.ownerDocument,h=d.body,m=getComputedStyle(h),g=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(n.clientWidth-h.clientWidth-g);b<=XT&&(a-=b)}else c<=XT&&(a+=c);return{width:a,height:s,x:u,y:f}}const gne=new Set(["absolute","fixed"]);function yne(e,t){const r=Wa(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,a=qn(e)?es(e):Bn(1),s=e.clientWidth*a.x,u=e.clientHeight*a.y,f=i*a.x,c=n*a.y;return{width:s,height:u,x:f,y:c}}function YT(e,t,r){let n;if(t==="viewport")n=vne(e,r);else if(t==="document")n=mne(Gn(e));else if(On(t))n=yne(t,r);else{const i=NL(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return zh(n)}function TL(e,t){const r=Yi(e);return r===t||!On(r)||Cs(r)?!1:jn(r).position==="fixed"||TL(r,t)}function xne(e,t){const r=t.get(e);if(r)return r;let n=Gc(e,[],!1).filter(u=>On(u)&&Ws(u)!=="body"),i=null;const a=jn(e).position==="fixed";let s=a?Yi(e):e;for(;On(s)&&!Cs(s);){const u=jn(s),f=m_(s);!f&&u.position==="fixed"&&(i=null),(a?!f&&!i:!f&&u.position==="static"&&!!i&&gne.has(i.position)||iu(s)&&!f&&TL(e,s))?n=n.filter(d=>d!==s):i=u,s=Yi(s)}return t.set(e,n),n}function bne(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const s=[...r==="clippingAncestors"?Ip(t)?[]:xne(t,this._c):[].concat(r),n],u=s[0],f=s.reduce((c,d)=>{const h=YT(t,d,i);return c.top=$r(h.top,c.top),c.right=Xi(h.right,c.right),c.bottom=Xi(h.bottom,c.bottom),c.left=$r(h.left,c.left),c},YT(t,u,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function wne(e){const{width:t,height:r}=PL(e);return{width:t,height:r}}function _ne(e,t,r){const n=qn(t),i=Gn(t),a=r==="fixed",s=Wa(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const f=Bn(0);function c(){f.x=Lp(i)}if(n||!n&&!a)if((Ws(t)!=="body"||iu(i))&&(u=Dp(t)),n){const g=Wa(t,!0,a,t);f.x=g.x+t.clientLeft,f.y=g.y+t.clientTop}else i&&c();a&&!n&&i&&c();const d=i&&!n&&!a?CL(i,u):Bn(0),h=s.left+u.scrollLeft-f.x-d.x,m=s.top+u.scrollTop-f.y-d.y;return{x:h,y:m,width:s.width,height:s.height}}function eb(e){return jn(e).position==="static"}function QT(e,t){if(!qn(e)||jn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Gn(e)===r&&(r=r.ownerDocument.body),r}function kL(e,t){const r=qr(e);if(Ip(e))return r;if(!qn(e)){let i=Yi(e);for(;i&&!Cs(i);){if(On(i)&&!eb(i))return i;i=Yi(i)}return r}let n=QT(e,t);for(;n&&ine(n)&&eb(n);)n=QT(n,t);return n&&Cs(n)&&eb(n)&&!m_(n)?r:n||cne(e)||r}const Sne=async function(e){const t=this.getOffsetParent||kL,r=this.getDimensions,n=await r(e.floating);return{reference:_ne(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function One(e){return jn(e).direction==="rtl"}const jne={convertOffsetParentRelativeRectToViewportRelativeRect:hne,getDocumentElement:Gn,getClippingRect:bne,getOffsetParent:kL,getElementRects:Sne,getClientRects:pne,getDimensions:wne,getScale:es,isElement:On,isRTL:One};function RL(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ene(e,t){let r=null,n;const i=Gn(e);function a(){var u;clearTimeout(n),(u=r)==null||u.disconnect(),r=null}function s(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),a();const c=e.getBoundingClientRect(),{left:d,top:h,width:m,height:g}=c;if(u||t(),!m||!g)return;const b=$f(h),y=$f(i.clientWidth-(d+m)),w=$f(i.clientHeight-(h+g)),S=$f(d),E={rootMargin:-b+"px "+-y+"px "+-w+"px "+-S+"px",threshold:$r(0,Xi(1,f))||1};let C=!0;function A(N){const T=N[0].intersectionRatio;if(T!==f){if(!C)return s();T?s(!1,T):n=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!RL(c,e.getBoundingClientRect())&&s(),C=!1}try{r=new IntersectionObserver(A,{...E,root:i.ownerDocument})}catch{r=new IntersectionObserver(A,E)}r.observe(e)}return s(!0),a}function Ane(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=n,c=g_(e),d=i||a?[...c?Gc(c):[],...Gc(t)]:[];d.forEach(S=>{i&&S.addEventListener("scroll",r,{passive:!0}),a&&S.addEventListener("resize",r)});const h=c&&u?Ene(c,r):null;let m=-1,g=null;s&&(g=new ResizeObserver(S=>{let[O]=S;O&&O.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var E;(E=g)==null||E.observe(t)})),r()}),c&&!f&&g.observe(c),g.observe(t));let b,y=f?Wa(e):null;f&&w();function w(){const S=Wa(e);y&&!RL(y,S)&&r(),y=S,b=requestAnimationFrame(w)}return r(),()=>{var S;d.forEach(O=>{i&&O.removeEventListener("scroll",r),a&&O.removeEventListener("resize",r)}),h?.(),(S=g)==null||S.disconnect(),g=null,f&&cancelAnimationFrame(b)}}const Pne=Zre,Nne=Jre,Cne=Xre,Tne=tne,kne=Yre,ZT=Kre,Rne=ene,Mne=(e,t,r)=>{const n=new Map,i={platform:jne,...r},a={...i.platform,_c:n};return Gre(e,t,{...i,platform:a})};var Ine=typeof document<"u",Dne=function(){},Ad=Ine?P.useLayoutEffect:Dne;function Fh(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,i;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(!Fh(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=r;n--!==0;){const a=i[n];if(!(a==="_owner"&&e.$$typeof)&&!Fh(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function ML(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function JT(e,t){const r=ML(e);return Math.round(t*r)/r}function tb(e){const t=P.useRef(e);return Ad(()=>{t.current=e}),t}function Lne(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:a,floating:s}={},transform:u=!0,whileElementsMounted:f,open:c}=e,[d,h]=P.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=P.useState(n);Fh(m,n)||g(n);const[b,y]=P.useState(null),[w,S]=P.useState(null),O=P.useCallback(B=>{B!==N.current&&(N.current=B,y(B))},[]),E=P.useCallback(B=>{B!==T.current&&(T.current=B,S(B))},[]),C=a||b,A=s||w,N=P.useRef(null),T=P.useRef(null),R=P.useRef(d),I=f!=null,q=tb(f),L=tb(i),D=tb(c),U=P.useCallback(()=>{if(!N.current||!T.current)return;const B={placement:t,strategy:r,middleware:m};L.current&&(B.platform=L.current),Mne(N.current,T.current,B).then(Z=>{const ee={...Z,isPositioned:D.current!==!1};H.current&&!Fh(R.current,ee)&&(R.current=ee,Kc.flushSync(()=>{h(ee)}))})},[m,t,r,L,D]);Ad(()=>{c===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,h(B=>({...B,isPositioned:!1})))},[c]);const H=P.useRef(!1);Ad(()=>(H.current=!0,()=>{H.current=!1}),[]),Ad(()=>{if(C&&(N.current=C),A&&(T.current=A),C&&A){if(q.current)return q.current(C,A,U);U()}},[C,A,U,q,I]);const V=P.useMemo(()=>({reference:N,floating:T,setReference:O,setFloating:E}),[O,E]),K=P.useMemo(()=>({reference:C,floating:A}),[C,A]),X=P.useMemo(()=>{const B={position:r,left:0,top:0};if(!K.floating)return B;const Z=JT(K.floating,d.x),ee=JT(K.floating,d.y);return u?{...B,transform:"translate("+Z+"px, "+ee+"px)",...ML(K.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:Z,top:ee}},[r,u,K.floating,d.x,d.y]);return P.useMemo(()=>({...d,update:U,refs:V,elements:K,floatingStyles:X}),[d,U,V,K,X])}const $ne=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:i}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?ZT({element:n.current,padding:i}).fn(r):{}:n?ZT({element:n,padding:i}).fn(r):{}}}},Bne=(e,t)=>({...Pne(e),options:[e,t]}),zne=(e,t)=>({...Nne(e),options:[e,t]}),Fne=(e,t)=>({...Rne(e),options:[e,t]}),qne=(e,t)=>({...Cne(e),options:[e,t]}),Une=(e,t)=>({...Tne(e),options:[e,t]}),Wne=(e,t)=>({...kne(e),options:[e,t]}),Hne=(e,t)=>({...$ne(e),options:[e,t]});var Vne="Arrow",IL=P.forwardRef((e,t)=>{const{children:r,width:n=10,height:i=5,...a}=e;return p.jsx(We.svg,{...a,ref:t,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});IL.displayName=Vne;var Gne=IL;function y_(e){const[t,r]=P.useState(void 0);return Rt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let s,u;if("borderBoxSize"in a){const f=a.borderBoxSize,c=Array.isArray(f)?f[0]:f;s=c.inlineSize,u=c.blockSize}else s=e.offsetWidth,u=e.offsetHeight;r({width:s,height:u})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var x_="Popper",[DL,LL]=gi(x_),[Kne,$L]=DL(x_),BL=e=>{const{__scopePopper:t,children:r}=e,[n,i]=P.useState(null);return p.jsx(Kne,{scope:t,anchor:n,onAnchorChange:i,children:r})};BL.displayName=x_;var zL="PopperAnchor",FL=P.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...i}=e,a=$L(zL,r),s=P.useRef(null),u=Je(t,s),f=P.useRef(null);return P.useEffect(()=>{const c=f.current;f.current=n?.current||s.current,c!==f.current&&a.onAnchorChange(f.current)}),n?null:p.jsx(We.div,{...i,ref:u})});FL.displayName=zL;var b_="PopperContent",[Xne,Yne]=DL(b_),qL=P.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:i=0,align:a="center",alignOffset:s=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...y}=e,w=$L(b_,r),[S,O]=P.useState(null),E=Je(t,oe=>O(oe)),[C,A]=P.useState(null),N=y_(C),T=N?.width??0,R=N?.height??0,I=n+(a!=="center"?"-"+a:""),q=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},L=Array.isArray(c)?c:[c],D=L.length>0,U={padding:q,boundary:L.filter(Zne),altBoundary:D},{refs:H,floatingStyles:V,placement:K,isPositioned:X,middlewareData:B}=Lne({strategy:"fixed",placement:I,whileElementsMounted:(...oe)=>Ane(...oe,{animationFrame:g==="always"}),elements:{reference:w.anchor},middleware:[Bne({mainAxis:i+R,alignmentAxis:s}),f&&zne({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Fne():void 0,...U}),f&&qne({...U}),Une({...U,apply:({elements:oe,rects:me,availableWidth:ie,availableHeight:ue})=>{const{width:ve,height:re}=me.reference,De=oe.floating.style;De.setProperty("--radix-popper-available-width",`${ie}px`),De.setProperty("--radix-popper-available-height",`${ue}px`),De.setProperty("--radix-popper-anchor-width",`${ve}px`),De.setProperty("--radix-popper-anchor-height",`${re}px`)}}),C&&Hne({element:C,padding:u}),Jne({arrowWidth:T,arrowHeight:R}),m&&Wne({strategy:"referenceHidden",...U})]}),[Z,ee]=HL(K),M=ar(b);Rt(()=>{X&&M?.()},[X,M]);const $=B.arrow?.x,Q=B.arrow?.y,ae=B.arrow?.centerOffset!==0,[pe,ye]=P.useState();return Rt(()=>{S&&ye(window.getComputedStyle(S).zIndex)},[S]),p.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:X?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:pe,"--radix-popper-transform-origin":[B.transformOrigin?.x,B.transformOrigin?.y].join(" "),...B.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(Xne,{scope:r,placedSide:Z,onArrowChange:A,arrowX:$,arrowY:Q,shouldHideArrow:ae,children:p.jsx(We.div,{"data-side":Z,"data-align":ee,...y,ref:E,style:{...y.style,animation:X?void 0:"none"}})})})});qL.displayName=b_;var UL="PopperArrow",Qne={top:"bottom",right:"left",bottom:"top",left:"right"},WL=P.forwardRef(function(t,r){const{__scopePopper:n,...i}=t,a=Yne(UL,n),s=Qne[a.placedSide];return p.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:p.jsx(Gne,{...i,ref:r,style:{...i.style,display:"block"}})})});WL.displayName=UL;function Zne(e){return e!==null}var Jne=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:i}=t,s=i.arrow?.centerOffset!==0,u=s?0:e.arrowWidth,f=s?0:e.arrowHeight,[c,d]=HL(r),h={start:"0%",center:"50%",end:"100%"}[d],m=(i.arrow?.x??0)+u/2,g=(i.arrow?.y??0)+f/2;let b="",y="";return c==="bottom"?(b=s?h:`${m}px`,y=`${-f}px`):c==="top"?(b=s?h:`${m}px`,y=`${n.floating.height+f}px`):c==="right"?(b=`${-f}px`,y=s?h:`${g}px`):c==="left"&&(b=`${n.floating.width+f}px`,y=s?h:`${g}px`),{data:{x:b,y}}}});function HL(e){const[t,r="center"]=e.split("-");return[t,r]}var eie=BL,tie=FL,rie=qL,nie=WL,iie="Portal",w_=P.forwardRef((e,t)=>{const{container:r,...n}=e,[i,a]=P.useState(!1);Rt(()=>a(!0),[]);const s=r||i&&globalThis?.document?.body;return s?b6.createPortal(p.jsx(We.div,{...n,ref:t}),s):null});w_.displayName=iie;function aie(e){const t=oie(e),r=P.forwardRef((n,i)=>{const{children:a,...s}=n,u=P.Children.toArray(a),f=u.find(lie);if(f){const c=f.props.children,d=u.map(h=>h===f?P.Children.count(c)>1?P.Children.only(null):P.isValidElement(c)?c.props.children:null:h);return p.jsx(t,{...s,ref:i,children:P.isValidElement(c)?P.cloneElement(c,void 0,d):null})}return p.jsx(t,{...s,ref:i,children:a})});return r.displayName=`${e}.Slot`,r}function oie(e){const t=P.forwardRef((r,n)=>{const{children:i,...a}=r;if(P.isValidElement(i)){const s=uie(i),u=cie(a,i.props);return i.type!==P.Fragment&&(u.ref=n?Rs(n,s):s),P.cloneElement(i,u)}return P.Children.count(i)>1?P.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sie=Symbol("radix.slottable");function lie(e){return P.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sie}function cie(e,t){const r={...t};for(const n in t){const i=e[n],a=t[n];/^on[A-Z]/.test(n)?i&&a?r[n]=(...u)=>{const f=a(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...a}:n==="className"&&(r[n]=[i,a].filter(Boolean).join(" "))}return{...e,...r}}function uie(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 fie=X1[" useInsertionEffect ".trim().toString()]||Rt;function Ha({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[i,a,s]=die({defaultProp:t,onChange:r}),u=e!==void 0,f=u?e:i;{const d=P.useRef(e!==void 0);P.useEffect(()=>{const h=d.current;h!==u&&console.warn(`${n} is changing from ${h?"controlled":"uncontrolled"} to ${u?"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.`),d.current=u},[u,n])}const c=P.useCallback(d=>{if(u){const h=hie(d)?d(e):d;h!==e&&s.current?.(h)}else a(d)},[u,e,a,s]);return[f,c]}function die({defaultProp:e,onChange:t}){const[r,n]=P.useState(e),i=P.useRef(r),a=P.useRef(t);return fie(()=>{a.current=t},[t]),P.useEffect(()=>{i.current!==r&&(a.current?.(r),i.current=r)},[r,i]),[r,n,a]}function hie(e){return typeof e=="function"}function __(e){const t=P.useRef({value:e,previous:e});return P.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var VL=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"}),pie="VisuallyHidden",mie=P.forwardRef((e,t)=>p.jsx(We.span,{...e,ref:t,style:{...VL,...e.style}}));mie.displayName=pie;var vie=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Do=new WeakMap,Bf=new WeakMap,zf={},rb=0,GL=function(e){return e&&(e.host||GL(e.parentNode))},gie=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=GL(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})},yie=function(e,t,r,n){var i=gie(t,Array.isArray(e)?e:[e]);zf[r]||(zf[r]=new WeakMap);var a=zf[r],s=[],u=new Set,f=new Set(i),c=function(h){!h||u.has(h)||(u.add(h),c(h.parentNode))};i.forEach(c);var d=function(h){!h||f.has(h)||Array.prototype.forEach.call(h.children,function(m){if(u.has(m))d(m);else try{var g=m.getAttribute(n),b=g!==null&&g!=="false",y=(Do.get(m)||0)+1,w=(a.get(m)||0)+1;Do.set(m,y),a.set(m,w),s.push(m),y===1&&b&&Bf.set(m,!0),w===1&&m.setAttribute(r,"true"),b||m.setAttribute(n,"true")}catch(S){console.error("aria-hidden: cannot operate on ",m,S)}})};return d(t),u.clear(),rb++,function(){s.forEach(function(h){var m=Do.get(h)-1,g=a.get(h)-1;Do.set(h,m),a.set(h,g),m||(Bf.has(h)||h.removeAttribute(n),Bf.delete(h)),g||h.removeAttribute(r)}),rb--,rb||(Do=new WeakMap,Do=new WeakMap,Bf=new WeakMap,zf={})}},KL=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=vie(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live], script"))),yie(n,i,r,"aria-hidden")):function(){return null}},Mn=function(){return Mn=Object.assign||function(t){for(var r,n=1,i=arguments.length;n"u")return Iie;var t=Die(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])}},$ie=ZL(),ts="data-scroll-locked",Bie=function(e,t,r,n){var i=e.left,a=e.top,s=e.right,u=e.gap;return r===void 0&&(r="margin"),` - .`.concat(bie,` { - overflow: hidden `).concat(n,`; - padding-right: `).concat(u,"px ").concat(n,`; - } - body[`).concat(ts,`] { - overflow: hidden `).concat(n,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` - padding-left: `.concat(i,`px; - padding-top: `).concat(a,`px; - padding-right: `).concat(s,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(u,"px ").concat(n,`; - `),r==="padding"&&"padding-right: ".concat(u,"px ").concat(n,";")].filter(Boolean).join(""),` - } - - .`).concat(Pd,` { - right: `).concat(u,"px ").concat(n,`; - } - - .`).concat(Nd,` { - margin-right: `).concat(u,"px ").concat(n,`; - } - - .`).concat(Pd," .").concat(Pd,` { - right: 0 `).concat(n,`; - } - - .`).concat(Nd," .").concat(Nd,` { - margin-right: 0 `).concat(n,`; - } - - body[`).concat(ts,`] { - `).concat(wie,": ").concat(u,`px; - } -`)},tk=function(){var e=parseInt(document.body.getAttribute(ts)||"0",10);return isFinite(e)?e:0},zie=function(){P.useEffect(function(){return document.body.setAttribute(ts,(tk()+1).toString()),function(){var e=tk()-1;e<=0?document.body.removeAttribute(ts):document.body.setAttribute(ts,e.toString())}},[])},Fie=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=n===void 0?"margin":n;zie();var a=P.useMemo(function(){return Lie(i)},[i]);return P.createElement($ie,{styles:Bie(a,!t,i,r?"":"!important")})},B1=!1;if(typeof window<"u")try{var Ff=Object.defineProperty({},"passive",{get:function(){return B1=!0,!0}});window.addEventListener("test",Ff,Ff),window.removeEventListener("test",Ff,Ff)}catch{B1=!1}var Lo=B1?{passive:!1}:!1,qie=function(e){return e.tagName==="TEXTAREA"},JL=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!qie(e)&&r[t]==="visible")},Uie=function(e){return JL(e,"overflowY")},Wie=function(e){return JL(e,"overflowX")},rk=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=e$(e,n);if(i){var a=t$(e,n),s=a[1],u=a[2];if(s>u)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Hie=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Vie=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},e$=function(e,t){return e==="v"?Uie(t):Wie(t)},t$=function(e,t){return e==="v"?Hie(t):Vie(t)},Gie=function(e,t){return e==="h"&&t==="rtl"?-1:1},Kie=function(e,t,r,n,i){var a=Gie(e,window.getComputedStyle(t).direction),s=a*n,u=r.target,f=t.contains(u),c=!1,d=s>0,h=0,m=0;do{if(!u)break;var g=t$(e,u),b=g[0],y=g[1],w=g[2],S=y-w-a*b;(b||S)&&e$(e,u)&&(h+=S,m+=b);var O=u.parentNode;u=O&&O.nodeType===Node.DOCUMENT_FRAGMENT_NODE?O.host:O}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(d&&Math.abs(h)<1||!d&&Math.abs(m)<1)&&(c=!0),c},qf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},nk=function(e){return[e.deltaX,e.deltaY]},ik=function(e){return e&&"current"in e?e.current:e},Xie=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Yie=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},Qie=0,$o=[];function Zie(e){var t=P.useRef([]),r=P.useRef([0,0]),n=P.useRef(),i=P.useState(Qie++)[0],a=P.useState(ZL)[0],s=P.useRef(e);P.useEffect(function(){s.current=e},[e]),P.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=xie([e.lockRef.current],(e.shards||[]).map(ik),!0).filter(Boolean);return y.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=P.useCallback(function(y,w){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!s.current.allowPinchZoom;var S=qf(y),O=r.current,E="deltaX"in y?y.deltaX:O[0]-S[0],C="deltaY"in y?y.deltaY:O[1]-S[1],A,N=y.target,T=Math.abs(E)>Math.abs(C)?"h":"v";if("touches"in y&&T==="h"&&N.type==="range")return!1;var R=window.getSelection(),I=R&&R.anchorNode,q=I?I===N||I.contains(N):!1;if(q)return!1;var L=rk(T,N);if(!L)return!0;if(L?A=T:(A=T==="v"?"h":"v",L=rk(T,N)),!L)return!1;if(!n.current&&"changedTouches"in y&&(E||C)&&(n.current=A),!A)return!0;var D=n.current||A;return Kie(D,w,y,D==="h"?E:C)},[]),f=P.useCallback(function(y){var w=y;if(!(!$o.length||$o[$o.length-1]!==a)){var S="deltaY"in w?nk(w):qf(w),O=t.current.filter(function(A){return A.name===w.type&&(A.target===w.target||w.target===A.shadowParent)&&Xie(A.delta,S)})[0];if(O&&O.should){w.cancelable&&w.preventDefault();return}if(!O){var E=(s.current.shards||[]).map(ik).filter(Boolean).filter(function(A){return A.contains(w.target)}),C=E.length>0?u(w,E[0]):!s.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),c=P.useCallback(function(y,w,S,O){var E={name:y,delta:w,target:S,should:O,shadowParent:Jie(S)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(C){return C!==E})},1)},[]),d=P.useCallback(function(y){r.current=qf(y),n.current=void 0},[]),h=P.useCallback(function(y){c(y.type,nk(y),y.target,u(y,e.lockRef.current))},[]),m=P.useCallback(function(y){c(y.type,qf(y),y.target,u(y,e.lockRef.current))},[]);P.useEffect(function(){return $o.push(a),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",f,Lo),document.addEventListener("touchmove",f,Lo),document.addEventListener("touchstart",d,Lo),function(){$o=$o.filter(function(y){return y!==a}),document.removeEventListener("wheel",f,Lo),document.removeEventListener("touchmove",f,Lo),document.removeEventListener("touchstart",d,Lo)}},[]);var g=e.removeScrollBar,b=e.inert;return P.createElement(P.Fragment,null,b?P.createElement(a,{styles:Yie(i)}):null,g?P.createElement(Fie,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Jie(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const eae=Pie(QL,Zie);var S_=P.forwardRef(function(e,t){return P.createElement($p,Mn({},e,{ref:t,sideCar:eae}))});S_.classNames=$p.classNames;var tae=[" ","Enter","ArrowUp","ArrowDown"],rae=[" ","Enter"],Va="Select",[Bp,zp,nae]=xL(Va),[Hs]=gi(Va,[nae,LL]),Fp=LL(),[iae,ta]=Hs(Va),[aae,oae]=Hs(Va),r$=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:i,onOpenChange:a,value:s,defaultValue:u,onValueChange:f,dir:c,name:d,autoComplete:h,disabled:m,required:g,form:b}=e,y=Fp(t),[w,S]=P.useState(null),[O,E]=P.useState(null),[C,A]=P.useState(!1),N=Kh(c),[T,R]=Ha({prop:n,defaultProp:i??!1,onChange:a,caller:Va}),[I,q]=Ha({prop:s,defaultProp:u,onChange:f,caller:Va}),L=P.useRef(null),D=w?b||!!w.closest("form"):!0,[U,H]=P.useState(new Set),V=Array.from(U).map(K=>K.props.value).join(";");return p.jsx(eie,{...y,children:p.jsxs(iae,{required:g,scope:t,trigger:w,onTriggerChange:S,valueNode:O,onValueNodeChange:E,valueNodeHasChildren:C,onValueNodeHasChildrenChange:A,contentId:Gi(),value:I,onValueChange:q,open:T,onOpenChange:R,dir:N,triggerPointerDownPosRef:L,disabled:m,children:[p.jsx(Bp.Provider,{scope:t,children:p.jsx(aae,{scope:e.__scopeSelect,onNativeOptionAdd:P.useCallback(K=>{H(X=>new Set(X).add(K))},[]),onNativeOptionRemove:P.useCallback(K=>{H(X=>{const B=new Set(X);return B.delete(K),B})},[]),children:r})}),D?p.jsxs(O$,{"aria-hidden":!0,required:g,tabIndex:-1,name:d,autoComplete:h,value:I,onChange:K=>q(K.target.value),disabled:m,form:b,children:[I===void 0?p.jsx("option",{value:""}):null,Array.from(U)]},V):null]})})};r$.displayName=Va;var n$="SelectTrigger",i$=P.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...i}=e,a=Fp(r),s=ta(n$,r),u=s.disabled||n,f=Je(t,s.onTriggerChange),c=zp(r),d=P.useRef("touch"),[h,m,g]=E$(y=>{const w=c().filter(E=>!E.disabled),S=w.find(E=>E.value===s.value),O=A$(w,y,S);O!==void 0&&s.onValueChange(O.value)}),b=y=>{u||(s.onOpenChange(!0),g()),y&&(s.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return p.jsx(tie,{asChild:!0,...a,children:p.jsx(We.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:u,"data-disabled":u?"":void 0,"data-placeholder":j$(s.value)?"":void 0,...i,ref:f,onClick:Fe(i.onClick,y=>{y.currentTarget.focus(),d.current!=="mouse"&&b(y)}),onPointerDown:Fe(i.onPointerDown,y=>{d.current=y.pointerType;const w=y.target;w.hasPointerCapture(y.pointerId)&&w.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(b(y),y.preventDefault())}),onKeyDown:Fe(i.onKeyDown,y=>{const w=h.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&m(y.key),!(w&&y.key===" ")&&tae.includes(y.key)&&(b(),y.preventDefault())})})})});i$.displayName=n$;var a$="SelectValue",o$=P.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,children:a,placeholder:s="",...u}=e,f=ta(a$,r),{onValueNodeHasChildrenChange:c}=f,d=a!==void 0,h=Je(t,f.onValueNodeChange);return Rt(()=>{c(d)},[c,d]),p.jsx(We.span,{...u,ref:h,style:{pointerEvents:"none"},children:j$(f.value)?p.jsx(p.Fragment,{children:s}):a})});o$.displayName=a$;var sae="SelectIcon",s$=P.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...i}=e;return p.jsx(We.span,{"aria-hidden":!0,...i,ref:t,children:n||"▼"})});s$.displayName=sae;var lae="SelectPortal",l$=e=>p.jsx(w_,{asChild:!0,...e});l$.displayName=lae;var Ga="SelectContent",c$=P.forwardRef((e,t)=>{const r=ta(Ga,e.__scopeSelect),[n,i]=P.useState();if(Rt(()=>{i(new DocumentFragment)},[]),!r.open){const a=n;return a?Kc.createPortal(p.jsx(u$,{scope:e.__scopeSelect,children:p.jsx(Bp.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),a):null}return p.jsx(f$,{...e,ref:t})});c$.displayName=Ga;var gn=10,[u$,ra]=Hs(Ga),cae="SelectContentImpl",uae=aie("SelectContent.RemoveScroll"),f$=P.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:s,side:u,sideOffset:f,align:c,alignOffset:d,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:y,avoidCollisions:w,...S}=e,O=ta(Ga,r),[E,C]=P.useState(null),[A,N]=P.useState(null),T=Je(t,oe=>C(oe)),[R,I]=P.useState(null),[q,L]=P.useState(null),D=zp(r),[U,H]=P.useState(!1),V=P.useRef(!1);P.useEffect(()=>{if(E)return KL(E)},[E]),_L();const K=P.useCallback(oe=>{const[me,...ie]=D().map(re=>re.ref.current),[ue]=ie.slice(-1),ve=document.activeElement;for(const re of oe)if(re===ve||(re?.scrollIntoView({block:"nearest"}),re===me&&A&&(A.scrollTop=0),re===ue&&A&&(A.scrollTop=A.scrollHeight),re?.focus(),document.activeElement!==ve))return},[D,A]),X=P.useCallback(()=>K([R,E]),[K,R,E]);P.useEffect(()=>{U&&X()},[U,X]);const{onOpenChange:B,triggerPointerDownPosRef:Z}=O;P.useEffect(()=>{if(E){let oe={x:0,y:0};const me=ue=>{oe={x:Math.abs(Math.round(ue.pageX)-(Z.current?.x??0)),y:Math.abs(Math.round(ue.pageY)-(Z.current?.y??0))}},ie=ue=>{oe.x<=10&&oe.y<=10?ue.preventDefault():E.contains(ue.target)||B(!1),document.removeEventListener("pointermove",me),Z.current=null};return Z.current!==null&&(document.addEventListener("pointermove",me),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",ie,{capture:!0})}}},[E,B,Z]),P.useEffect(()=>{const oe=()=>B(!1);return window.addEventListener("blur",oe),window.addEventListener("resize",oe),()=>{window.removeEventListener("blur",oe),window.removeEventListener("resize",oe)}},[B]);const[ee,M]=E$(oe=>{const me=D().filter(ve=>!ve.disabled),ie=me.find(ve=>ve.ref.current===document.activeElement),ue=A$(me,oe,ie);ue&&setTimeout(()=>ue.ref.current.focus())}),$=P.useCallback((oe,me,ie)=>{const ue=!V.current&&!ie;(O.value!==void 0&&O.value===me||ue)&&(I(oe),ue&&(V.current=!0))},[O.value]),Q=P.useCallback(()=>E?.focus(),[E]),ae=P.useCallback((oe,me,ie)=>{const ue=!V.current&&!ie;(O.value!==void 0&&O.value===me||ue)&&L(oe)},[O.value]),pe=n==="popper"?z1:d$,ye=pe===z1?{side:u,sideOffset:f,align:c,alignOffset:d,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:y,avoidCollisions:w}:{};return p.jsx(u$,{scope:r,content:E,viewport:A,onViewportChange:N,itemRefCallback:$,selectedItem:R,onItemLeave:Q,itemTextRefCallback:ae,focusSelectedItem:X,selectedItemText:q,position:n,isPositioned:U,searchRef:ee,children:p.jsx(S_,{as:uae,allowPinchZoom:!0,children:p.jsx(f_,{asChild:!0,trapped:O.open,onMountAutoFocus:oe=>{oe.preventDefault()},onUnmountAutoFocus:Fe(i,oe=>{O.trigger?.focus({preventScroll:!0}),oe.preventDefault()}),children:p.jsx(u_,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:oe=>oe.preventDefault(),onDismiss:()=>O.onOpenChange(!1),children:p.jsx(pe,{role:"listbox",id:O.contentId,"data-state":O.open?"open":"closed",dir:O.dir,onContextMenu:oe=>oe.preventDefault(),...S,...ye,onPlaced:()=>H(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Fe(S.onKeyDown,oe=>{const me=oe.ctrlKey||oe.altKey||oe.metaKey;if(oe.key==="Tab"&&oe.preventDefault(),!me&&oe.key.length===1&&M(oe.key),["ArrowUp","ArrowDown","Home","End"].includes(oe.key)){let ue=D().filter(ve=>!ve.disabled).map(ve=>ve.ref.current);if(["ArrowUp","End"].includes(oe.key)&&(ue=ue.slice().reverse()),["ArrowUp","ArrowDown"].includes(oe.key)){const ve=oe.target,re=ue.indexOf(ve);ue=ue.slice(re+1)}setTimeout(()=>K(ue)),oe.preventDefault()}})})})})})})});f$.displayName=cae;var fae="SelectItemAlignedPosition",d$=P.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...i}=e,a=ta(Ga,r),s=ra(Ga,r),[u,f]=P.useState(null),[c,d]=P.useState(null),h=Je(t,T=>d(T)),m=zp(r),g=P.useRef(!1),b=P.useRef(!0),{viewport:y,selectedItem:w,selectedItemText:S,focusSelectedItem:O}=s,E=P.useCallback(()=>{if(a.trigger&&a.valueNode&&u&&c&&y&&w&&S){const T=a.trigger.getBoundingClientRect(),R=c.getBoundingClientRect(),I=a.valueNode.getBoundingClientRect(),q=S.getBoundingClientRect();if(a.dir!=="rtl"){const ve=q.left-R.left,re=I.left-ve,De=T.left-re,Te=T.width+De,Ke=Math.max(Te,R.width),lt=window.innerWidth-gn,vt=hb(re,[gn,Math.max(gn,lt-Ke)]);u.style.minWidth=Te+"px",u.style.left=vt+"px"}else{const ve=R.right-q.right,re=window.innerWidth-I.right-ve,De=window.innerWidth-T.right-re,Te=T.width+De,Ke=Math.max(Te,R.width),lt=window.innerWidth-gn,vt=hb(re,[gn,Math.max(gn,lt-Ke)]);u.style.minWidth=Te+"px",u.style.right=vt+"px"}const L=m(),D=window.innerHeight-gn*2,U=y.scrollHeight,H=window.getComputedStyle(c),V=parseInt(H.borderTopWidth,10),K=parseInt(H.paddingTop,10),X=parseInt(H.borderBottomWidth,10),B=parseInt(H.paddingBottom,10),Z=V+K+U+B+X,ee=Math.min(w.offsetHeight*5,Z),M=window.getComputedStyle(y),$=parseInt(M.paddingTop,10),Q=parseInt(M.paddingBottom,10),ae=T.top+T.height/2-gn,pe=D-ae,ye=w.offsetHeight/2,oe=w.offsetTop+ye,me=V+K+oe,ie=Z-me;if(me<=ae){const ve=L.length>0&&w===L[L.length-1].ref.current;u.style.bottom="0px";const re=c.clientHeight-y.offsetTop-y.offsetHeight,De=Math.max(pe,ye+(ve?Q:0)+re+X),Te=me+De;u.style.height=Te+"px"}else{const ve=L.length>0&&w===L[0].ref.current;u.style.top="0px";const De=Math.max(ae,V+y.offsetTop+(ve?$:0)+ye)+ie;u.style.height=De+"px",y.scrollTop=me-ae+y.offsetTop}u.style.margin=`${gn}px 0`,u.style.minHeight=ee+"px",u.style.maxHeight=D+"px",n?.(),requestAnimationFrame(()=>g.current=!0)}},[m,a.trigger,a.valueNode,u,c,y,w,S,a.dir,n]);Rt(()=>E(),[E]);const[C,A]=P.useState();Rt(()=>{c&&A(window.getComputedStyle(c).zIndex)},[c]);const N=P.useCallback(T=>{T&&b.current===!0&&(E(),O?.(),b.current=!1)},[E,O]);return p.jsx(hae,{scope:r,contentWrapper:u,shouldExpandOnScrollRef:g,onScrollButtonChange:N,children:p.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:p.jsx(We.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});d$.displayName=fae;var dae="SelectPopperPosition",z1=P.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=gn,...a}=e,s=Fp(r);return p.jsx(rie,{...s,...a,ref:t,align:n,collisionPadding:i,style:{boxSizing:"border-box",...a.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)"}})});z1.displayName=dae;var[hae,O_]=Hs(Ga,{}),F1="SelectViewport",h$=P.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...i}=e,a=ra(F1,r),s=O_(F1,r),u=Je(t,a.onViewportChange),f=P.useRef(0);return p.jsxs(p.Fragment,{children:[p.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}),p.jsx(Bp.Slot,{scope:r,children:p.jsx(We.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Fe(i.onScroll,c=>{const d=c.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:m}=s;if(m?.current&&h){const g=Math.abs(f.current-d.scrollTop);if(g>0){const b=window.innerHeight-gn*2,y=parseFloat(h.style.minHeight),w=parseFloat(h.style.height),S=Math.max(y,w);if(S0?C:0,h.style.justifyContent="flex-end")}}}f.current=d.scrollTop})})})]})});h$.displayName=F1;var p$="SelectGroup",[pae,mae]=Hs(p$),vae=P.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=Gi();return p.jsx(pae,{scope:r,id:i,children:p.jsx(We.div,{role:"group","aria-labelledby":i,...n,ref:t})})});vae.displayName=p$;var m$="SelectLabel",gae=P.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=mae(m$,r);return p.jsx(We.div,{id:i.id,...n,ref:t})});gae.displayName=m$;var qh="SelectItem",[yae,v$]=Hs(qh),g$=P.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:a,...s}=e,u=ta(qh,r),f=ra(qh,r),c=u.value===n,[d,h]=P.useState(a??""),[m,g]=P.useState(!1),b=Je(t,O=>f.itemRefCallback?.(O,n,i)),y=Gi(),w=P.useRef("touch"),S=()=>{i||(u.onValueChange(n),u.onOpenChange(!1))};if(n==="")throw new Error("A 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 p.jsx(yae,{scope:r,value:n,disabled:i,textId:y,isSelected:c,onItemTextChange:P.useCallback(O=>{h(E=>E||(O?.textContent??"").trim())},[]),children:p.jsx(Bp.ItemSlot,{scope:r,value:n,disabled:i,textValue:d,children:p.jsx(We.div,{role:"option","aria-labelledby":y,"data-highlighted":m?"":void 0,"aria-selected":c&&m,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:b,onFocus:Fe(s.onFocus,()=>g(!0)),onBlur:Fe(s.onBlur,()=>g(!1)),onClick:Fe(s.onClick,()=>{w.current!=="mouse"&&S()}),onPointerUp:Fe(s.onPointerUp,()=>{w.current==="mouse"&&S()}),onPointerDown:Fe(s.onPointerDown,O=>{w.current=O.pointerType}),onPointerMove:Fe(s.onPointerMove,O=>{w.current=O.pointerType,i?f.onItemLeave?.():w.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Fe(s.onPointerLeave,O=>{O.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:Fe(s.onKeyDown,O=>{f.searchRef?.current!==""&&O.key===" "||(rae.includes(O.key)&&S(),O.key===" "&&O.preventDefault())})})})})});g$.displayName=qh;var Zl="SelectItemText",y$=P.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,...a}=e,s=ta(Zl,r),u=ra(Zl,r),f=v$(Zl,r),c=oae(Zl,r),[d,h]=P.useState(null),m=Je(t,S=>h(S),f.onItemTextChange,S=>u.itemTextRefCallback?.(S,f.value,f.disabled)),g=d?.textContent,b=P.useMemo(()=>p.jsx("option",{value:f.value,disabled:f.disabled,children:g},f.value),[f.disabled,f.value,g]),{onNativeOptionAdd:y,onNativeOptionRemove:w}=c;return Rt(()=>(y(b),()=>w(b)),[y,w,b]),p.jsxs(p.Fragment,{children:[p.jsx(We.span,{id:f.textId,...a,ref:m}),f.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Kc.createPortal(a.children,s.valueNode):null]})});y$.displayName=Zl;var x$="SelectItemIndicator",b$=P.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return v$(x$,r).isSelected?p.jsx(We.span,{"aria-hidden":!0,...n,ref:t}):null});b$.displayName=x$;var q1="SelectScrollUpButton",w$=P.forwardRef((e,t)=>{const r=ra(q1,e.__scopeSelect),n=O_(q1,e.__scopeSelect),[i,a]=P.useState(!1),s=Je(t,n.onScrollButtonChange);return Rt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const c=f.scrollTop>0;a(c)};const f=r.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),i?p.jsx(S$,{...e,ref:s,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=r;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});w$.displayName=q1;var U1="SelectScrollDownButton",_$=P.forwardRef((e,t)=>{const r=ra(U1,e.__scopeSelect),n=O_(U1,e.__scopeSelect),[i,a]=P.useState(!1),s=Je(t,n.onScrollButtonChange);return Rt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const c=f.scrollHeight-f.clientHeight,d=Math.ceil(f.scrollTop)f.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),i?p.jsx(S$,{...e,ref:s,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=r;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});_$.displayName=U1;var S$=P.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...i}=e,a=ra("SelectScrollButton",r),s=P.useRef(null),u=zp(r),f=P.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return P.useEffect(()=>()=>f(),[f]),Rt(()=>{u().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),p.jsx(We.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Fe(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:Fe(i.onPointerMove,()=>{a.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:Fe(i.onPointerLeave,()=>{f()})})}),xae="SelectSeparator",bae=P.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return p.jsx(We.div,{"aria-hidden":!0,...n,ref:t})});bae.displayName=xae;var W1="SelectArrow",wae=P.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=Fp(r),a=ta(W1,r),s=ra(W1,r);return a.open&&s.position==="popper"?p.jsx(nie,{...i,...n,ref:t}):null});wae.displayName=W1;var _ae="SelectBubbleInput",O$=P.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const i=P.useRef(null),a=Je(n,i),s=__(t);return P.useEffect(()=>{const u=i.current;if(!u)return;const f=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(f,"value").set;if(s!==t&&d){const h=new Event("change",{bubbles:!0});d.call(u,t),u.dispatchEvent(h)}},[s,t]),p.jsx(We.select,{...r,style:{...VL,...r.style},ref:a,defaultValue:t})});O$.displayName=_ae;function j$(e){return e===""||e===void 0}function E$(e){const t=ar(e),r=P.useRef(""),n=P.useRef(0),i=P.useCallback(s=>{const u=r.current+s;t(u),(function f(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>f(""),1e3))})(u)},[t]),a=P.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return P.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,a]}function A$(e,t,r){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,a=r?e.indexOf(r):-1;let s=Sae(e,Math.max(a,0));i.length===1&&(s=s.filter(c=>c!==r));const f=s.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return f!==r?f:void 0}function Sae(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Oae=r$,jae=i$,Eae=o$,Aae=s$,Pae=l$,Nae=c$,Cae=h$,Tae=g$,kae=y$,Rae=b$,Mae=w$,Iae=_$;function tt({...e}){return p.jsx(Oae,{"data-slot":"select",...e})}function rt({...e}){return p.jsx(Eae,{"data-slot":"select-value",...e})}function nt({className:e,size:t="default",children:r,...n}){return p.jsxs(jae,{"data-slot":"select-trigger","data-size":t,className:Ie("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full items-center justify-between gap-2 rounded-md border bg-input-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[r,p.jsx(Aae,{asChild:!0,children:p.jsx(cc,{className:"size-4 opacity-50"})})]})}function st({className:e,children:t,position:r="popper",...n}){return p.jsx(Pae,{children:p.jsxs(Nae,{"data-slot":"select-content",className:Ie("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[p.jsx(Dae,{}),p.jsx(Cae,{className:Ie("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),p.jsx(Lae,{})]})})}function Ae({className:e,children:t,...r}){return p.jsxs(Tae,{"data-slot":"select-item",className:Ie("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[p.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:p.jsx(Rae,{children:p.jsx(dR,{className:"size-4"})})}),p.jsx(kae,{children:t})]})}function Dae({className:e,...t}){return p.jsx(Mae,{"data-slot":"select-scroll-up-button",className:Ie("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(jB,{className:"size-4"})})}function Lae({className:e,...t}){return p.jsx(Iae,{"data-slot":"select-scroll-down-button",className:Ie("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(cc,{className:"size-4"})})}function $ae(){const e=[{id:1,location:"Location A",labelCategory:"Prep",productCategory:"Meat",product:"Chicken",template:'2"x2" Basic',labelType:"Defrost",lastEdited:"2025.12.03.11:45",hasError:!1},{id:2,location:"Location A",labelCategory:"Prep",productCategory:"Meat",product:"Chicken",template:'2"x2" Basic',labelType:"Opened/Preped",lastEdited:"2025.12.03.11:45",hasError:!1},{id:3,location:"Location A",labelCategory:"Prep",productCategory:"Meat",product:"Chicken",template:'2"x2" Basic',labelType:"Heated",lastEdited:"2025.12.03.11:45",hasError:!1},{id:4,location:"Location A",labelCategory:"Grab'n'Go",productCategory:"Sandwich",product:"Chicken Sandwich",template:`2"x6" G'n'G`,labelType:"",lastEdited:"2025.12.03.11:45",hasError:!0}];return p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[p.jsx($e,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 text-gray-900 placeholder:text-gray-500"}),p.jsxs(tt,{defaultValue:"all",children:[p.jsx(nt,{className:"bg-white border border-gray-300 rounded-md w-[200px] shrink-0 text-gray-900",style:{height:40,boxSizing:"border-box"},children:p.jsx(rt,{placeholder:"Location"})}),p.jsxs(st,{children:[p.jsx(Ae,{value:"all",children:"All Locations"}),p.jsx(Ae,{value:"loc-a",children:"Location A"}),p.jsx(Ae,{value:"loc-b",children:"Location B"})]})]}),p.jsxs("div",{className:"flex rounded-md border border-gray-300 bg-white h-10 overflow-hidden shrink-0",children:[p.jsx("button",{type:"button",className:"px-4 h-full border-r border-gray-200 text-sm font-medium text-gray-900 hover:bg-gray-50 transition-colors",children:"Bulk Import"}),p.jsx("button",{type:"button",className:"px-4 h-full border-r border-gray-200 text-sm font-medium text-gray-900 hover:bg-gray-50 transition-colors",children:"Bulk Export"}),p.jsx("button",{type:"button",className:"px-4 h-full text-sm font-medium text-gray-900 hover:bg-gray-50 transition-colors",children:"Bulk Edit"})]}),p.jsxs(Ne,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0 ml-auto",children:["New Label ",p.jsx(Ur,{className:"ml-1 h-4 w-4"})]})]}),p.jsx("div",{className:"text-red-600 font-bold italic text-lg",children:"One or more of your labels are missing fields from their templates (! ! ! 1 in total)."}),p.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:p.jsxs(br,{children:[p.jsx(wr,{children:p.jsxs(Qe,{className:"bg-gray-50 hover:bg-gray-50",children:[p.jsx(ge,{className:"font-bold text-gray-900 w-[120px]",children:"Location"}),p.jsx(ge,{className:"font-bold text-gray-900 w-[140px]",children:"Label Category"}),p.jsx(ge,{className:"font-bold text-gray-900 w-[140px]",children:"Product Category"}),p.jsx(ge,{className:"font-bold text-gray-900",children:"Product"}),p.jsx(ge,{className:"font-bold text-gray-900",children:"Template"}),p.jsx(ge,{className:"font-bold text-gray-900",children:"Label Type"}),p.jsx(ge,{className:"font-bold text-gray-900",children:"Last Edited"})]})}),p.jsx(_r,{children:e.map(t=>p.jsxs(Qe,{className:"hover:bg-gray-50",children:[p.jsx(fe,{className:"font-medium",children:t.location}),p.jsx(fe,{children:t.labelCategory}),p.jsx(fe,{children:t.productCategory}),p.jsx(fe,{children:t.product}),p.jsxs(fe,{className:"font-medium",children:[t.template,t.hasError&&p.jsx("span",{className:"text-red-600 font-bold ml-2",children:"! ! !"})]}),p.jsx(fe,{children:t.labelType||"-"}),p.jsx(fe,{className:"text-gray-500 tabular-nums font-numeric",children:t.lastEdited})]},t.id))})]})})]})}function Bae(){const e=[{id:1,category:"Prep",count:54,photo:"XXX",lastEdited:"2025.12.03.11:45"},{id:2,category:"Green",count:33,photo:"XXX",lastEdited:"2025.12.03.11:45"},{id:3,category:"Red",count:44,photo:"XXX",lastEdited:"2025.12.03.11:45"}];return p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[p.jsx($e,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500"}),p.jsx("span",{className:"text-sm font-medium text-gray-900 whitespace-nowrap shrink-0",children:"Search"}),p.jsxs(tt,{defaultValue:"all",children:[p.jsx(nt,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:p.jsx(rt,{placeholder:"Location"})}),p.jsxs(st,{children:[p.jsx(Ae,{value:"all",children:"All Locations"}),p.jsx(Ae,{value:"loc-a",children:"Location A"}),p.jsx(Ae,{value:"loc-b",children:"Location B"})]})]}),p.jsx("span",{className:"text-sm font-medium text-gray-900 whitespace-nowrap shrink-0",children:"Location"}),p.jsxs(Ne,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0 ml-auto",children:["New Label Category ",p.jsx(Ur,{className:"ml-1 h-4 w-4"})]})]}),p.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:p.jsxs(br,{children:[p.jsx(wr,{children:p.jsxs(Qe,{className:"bg-gray-50 hover:bg-gray-50",children:[p.jsx(ge,{className:"font-bold text-gray-900 w-[250px]",children:"Label Category"}),p.jsx(ge,{className:"font-bold text-gray-900 w-[200px]",children:"No. of Labels"}),p.jsx(ge,{className:"font-bold text-gray-900 w-[200px]",children:"Category Photo"}),p.jsx(ge,{className:"font-bold text-gray-900",children:"Last Edited"})]})}),p.jsx(_r,{children:e.map(t=>p.jsxs(Qe,{className:"hover:bg-gray-50",children:[p.jsx(fe,{className:"font-medium",children:t.category}),p.jsx(fe,{className:"font-numeric",children:t.count}),p.jsx(fe,{className:"text-gray-500",children:t.photo}),p.jsx(fe,{className:"text-gray-500 tabular-nums font-numeric",children:t.lastEdited})]},t.id))})]})})]})}function zae(){const e=[{id:1,type:"Defrost",count:54,lastEdited:"2025.12.03.11:45"},{id:2,type:"Thawed",count:33,lastEdited:"2025.12.03.11:45"},{id:3,type:"Opened",count:44,lastEdited:"2025.12.03.11:45"},{id:4,type:"Preped",count:17,lastEdited:"2025.12.03.11:45"},{id:5,type:"Heated",count:67,lastEdited:"2025.12.03.11:45"}];return p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[p.jsx($e,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500"}),p.jsx("span",{className:"text-sm font-medium text-gray-900 whitespace-nowrap shrink-0",children:"Search"}),p.jsxs(tt,{defaultValue:"all",children:[p.jsx(nt,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:p.jsx(rt,{placeholder:"Location"})}),p.jsxs(st,{children:[p.jsx(Ae,{value:"all",children:"all"}),p.jsx(Ae,{value:"loc-a",children:"Location A"}),p.jsx(Ae,{value:"loc-b",children:"Location B"})]})]}),p.jsx("span",{className:"text-sm font-medium text-gray-900 whitespace-nowrap shrink-0",children:"Location"}),p.jsxs(Ne,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0 ml-auto",children:["New Label Type ",p.jsx(Ur,{className:"ml-1 h-4 w-4"})]})]}),p.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:p.jsxs(br,{children:[p.jsx(wr,{children:p.jsxs(Qe,{className:"bg-gray-50 hover:bg-gray-50",children:[p.jsx(ge,{className:"font-bold text-gray-900 w-[250px]",children:"Label Types"}),p.jsx(ge,{className:"font-bold text-gray-900 w-[200px]",children:"No. of Labels"}),p.jsx(ge,{className:"font-bold text-gray-900",children:"Last Edited"})]})}),p.jsx(_r,{children:e.map(t=>p.jsxs(Qe,{className:"hover:bg-gray-50",children:[p.jsx(fe,{className:"font-medium",children:t.type}),p.jsx(fe,{className:"font-numeric",children:t.count}),p.jsx(fe,{className:"text-gray-500 tabular-nums font-numeric",children:t.lastEdited})]},t.id))})]})})]})}const Fae="label-template-",qae="label-template-ids";function P$(e){return`${Fae}${e}`}function N$(){return qae}function Uae(){return`template-${Date.now()}`}function Wae(){return`el-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Hae(e){return{id:e??Uae(),name:"未命名模板",labelType:"PRICE",unit:"cm",width:6,height:4,appliedLocation:"ALL",showRuler:!0,showGrid:!0,elements:[]}}const ob=[{name:'2"×1"',width:2,height:1,unit:"inch"},{name:'2"×2"',width:2,height:2,unit:"inch"},{name:'3"×1"',width:3,height:1,unit:"inch"},{name:'3"×2"',width:3,height:2,unit:"inch"},{name:'4"×2"',width:4,height:2,unit:"inch"},{name:'4"×6"',width:4,height:6,unit:"inch"},{name:"6cm×4cm",width:6,height:4,unit:"cm"},{name:"10cm×6cm",width:10,height:6,unit:"cm"},{name:"A4",width:21,height:29.7,unit:"cm"},{name:"A5",width:14.8,height:21,unit:"cm"}];function Vae(e,t=20,r=20){const n=Wae(),a={TEXT_STATIC:{width:120,height:24,config:{text:"文本",fontFamily:"Arial",fontSize:14,fontWeight:"normal",textAlign:"left"}},TEXT_PRODUCT:{width:120,height:24,config:{text:"商品名",fontFamily:"Arial",fontSize:14,fontWeight:"normal",textAlign:"left"}},TEXT_PRICE:{width:80,height:24,config:{text:"0.00",prefix:"¥",decimal:2,fontFamily:"Arial",fontSize:14,fontWeight:"bold",textAlign:"right"}},BARCODE:{width:160,height:48,config:{barcodeType:"CODE128",data:"123456789",showText:!0,orientation:"horizontal"}},QRCODE:{width:80,height:80,config:{data:"https://example.com",errorLevel:"M"}},IMAGE:{width:60,height:60,config:{src:"",scaleMode:"contain"}},DATE:{width:120,height:24,config:{format:"YYYY-MM-DD",offsetDays:0}},TIME:{width:100,height:24,config:{format:"HH:mm",offsetDays:0}},DURATION:{width:120,height:24,config:{format:"YYYY-MM-DD",offsetDays:3}},WEIGHT:{width:80,height:24,config:{unit:"g",value:500}},WEIGHT_PRICE:{width:100,height:24,config:{unitPrice:10,weight:.5,currency:"¥"}},BLANK:{width:40,height:24,config:{}},NUTRITION:{width:200,height:120,config:{calories:120,fat:"5g",protein:"3g",carbs:"10g",layout:"standard"}}}[e];return{id:n,type:e,x:t,y:r,width:a.width,height:a.height,rotation:"horizontal",border:"none",config:{...a.config}}}function C$(){try{const e=localStorage.getItem(N$());if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function T$(e){try{const t=localStorage.getItem(P$(e));return t?JSON.parse(t):null}catch{return null}}function ak(){const e=C$(),t=[];for(const r of e){const n=T$(r);n&&t.push(n)}return t.sort((r,n)=>n.id>r.id?1:-1)}function Gae(e){localStorage.setItem(N$(),JSON.stringify(e))}function Kae(e){const t=P$(e.id);localStorage.setItem(t,JSON.stringify(e));const r=C$();r.includes(e.id)||(r.push(e.id),Gae(r))}function Xae(e){const t=Yae(e),r=P.forwardRef((n,i)=>{const{children:a,...s}=n,u=P.Children.toArray(a),f=u.find(Zae);if(f){const c=f.props.children,d=u.map(h=>h===f?P.Children.count(c)>1?P.Children.only(null):P.isValidElement(c)?c.props.children:null:h);return p.jsx(t,{...s,ref:i,children:P.isValidElement(c)?P.cloneElement(c,void 0,d):null})}return p.jsx(t,{...s,ref:i,children:a})});return r.displayName=`${e}.Slot`,r}function Yae(e){const t=P.forwardRef((r,n)=>{const{children:i,...a}=r;if(P.isValidElement(i)){const s=eoe(i),u=Jae(a,i.props);return i.type!==P.Fragment&&(u.ref=n?Rs(n,s):s),P.cloneElement(i,u)}return P.Children.count(i)>1?P.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Qae=Symbol("radix.slottable");function Zae(e){return P.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Qae}function Jae(e,t){const r={...t};for(const n in t){const i=e[n],a=t[n];/^on[A-Z]/.test(n)?i&&a?r[n]=(...u)=>{const f=a(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...a}:n==="className"&&(r[n]=[i,a].filter(Boolean).join(" "))}return{...e,...r}}function eoe(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 qp="Dialog",[k$]=gi(qp),[toe,An]=k$(qp),R$=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,u=P.useRef(null),f=P.useRef(null),[c,d]=Ha({prop:n,defaultProp:i??!1,onChange:a,caller:qp});return p.jsx(toe,{scope:t,triggerRef:u,contentRef:f,contentId:Gi(),titleId:Gi(),descriptionId:Gi(),open:c,onOpenChange:d,onOpenToggle:P.useCallback(()=>d(h=>!h),[d]),modal:s,children:r})};R$.displayName=qp;var M$="DialogTrigger",roe=P.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=An(M$,r),a=Je(t,i.triggerRef);return p.jsx(We.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":A_(i.open),...n,ref:a,onClick:Fe(e.onClick,i.onOpenToggle)})});roe.displayName=M$;var j_="DialogPortal",[noe,I$]=k$(j_,{forceMount:void 0}),D$=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:i}=e,a=An(j_,t);return p.jsx(noe,{scope:t,forceMount:r,children:P.Children.map(n,s=>p.jsx(Un,{present:r||a.open,children:p.jsx(w_,{asChild:!0,container:i,children:s})}))})};D$.displayName=j_;var Uh="DialogOverlay",L$=P.forwardRef((e,t)=>{const r=I$(Uh,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,a=An(Uh,e.__scopeDialog);return a.modal?p.jsx(Un,{present:n||a.open,children:p.jsx(aoe,{...i,ref:t})}):null});L$.displayName=Uh;var ioe=Xae("DialogOverlay.RemoveScroll"),aoe=P.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=An(Uh,r);return p.jsx(S_,{as:ioe,allowPinchZoom:!0,shards:[i.contentRef],children:p.jsx(We.div,{"data-state":A_(i.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Ka="DialogContent",$$=P.forwardRef((e,t)=>{const r=I$(Ka,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,a=An(Ka,e.__scopeDialog);return p.jsx(Un,{present:n||a.open,children:a.modal?p.jsx(ooe,{...i,ref:t}):p.jsx(soe,{...i,ref:t})})});$$.displayName=Ka;var ooe=P.forwardRef((e,t)=>{const r=An(Ka,e.__scopeDialog),n=P.useRef(null),i=Je(t,r.contentRef,n);return P.useEffect(()=>{const a=n.current;if(a)return KL(a)},[]),p.jsx(B$,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Fe(e.onCloseAutoFocus,a=>{a.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Fe(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,u=s.button===0&&s.ctrlKey===!0;(s.button===2||u)&&a.preventDefault()}),onFocusOutside:Fe(e.onFocusOutside,a=>a.preventDefault())})}),soe=P.forwardRef((e,t)=>{const r=An(Ka,e.__scopeDialog),n=P.useRef(!1),i=P.useRef(!1);return p.jsx(B$,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(n.current||r.triggerRef.current?.focus(),a.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=a.target;r.triggerRef.current?.contains(s)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),B$=P.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:a,...s}=e,u=An(Ka,r),f=P.useRef(null),c=Je(t,f);return _L(),p.jsxs(p.Fragment,{children:[p.jsx(f_,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:a,children:p.jsx(u_,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":A_(u.open),...s,ref:c,onDismiss:()=>u.onOpenChange(!1)})}),p.jsxs(p.Fragment,{children:[p.jsx(loe,{titleId:u.titleId}),p.jsx(uoe,{contentRef:f,descriptionId:u.descriptionId})]})]})}),E_="DialogTitle",z$=P.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=An(E_,r);return p.jsx(We.h2,{id:i.titleId,...n,ref:t})});z$.displayName=E_;var F$="DialogDescription",q$=P.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=An(F$,r);return p.jsx(We.p,{id:i.descriptionId,...n,ref:t})});q$.displayName=F$;var U$="DialogClose",W$=P.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=An(U$,r);return p.jsx(We.button,{type:"button",...n,ref:t,onClick:Fe(e.onClick,()=>i.onOpenChange(!1))})});W$.displayName=U$;function A_(e){return e?"open":"closed"}var H$="DialogTitleWarning",[Fle,V$]=k6(H$,{contentName:Ka,titleName:E_,docsSlug:"dialog"}),loe=({titleId:e})=>{const t=V$(H$),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. - -If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. - -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return P.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},coe="DialogDescriptionWarning",uoe=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${V$(coe).contentName}}.`;return P.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},foe=R$,doe=D$,hoe=L$,poe=$$,moe=z$,voe=q$,goe=W$;function na({...e}){return p.jsx(foe,{"data-slot":"dialog",...e})}function yoe({...e}){return p.jsx(doe,{"data-slot":"dialog-portal",...e})}function xoe({className:e,...t}){return p.jsx(hoe,{"data-slot":"dialog-overlay",className:Ie("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function ia({className:e,children:t,...r}){return p.jsxs(yoe,{"data-slot":"dialog-portal",children:[p.jsx(xoe,{}),p.jsxs(poe,{"data-slot":"dialog-content",className:Ie("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,p.jsxs(goe,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[p.jsx(ec,{}),p.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function aa({className:e,...t}){return p.jsx("div",{"data-slot":"dialog-header",className:Ie("flex flex-col gap-2 text-center sm:text-left",e),...t})}function ro({className:e,...t}){return p.jsx("div",{"data-slot":"dialog-footer",className:Ie("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function oa({className:e,...t}){return p.jsx(moe,{"data-slot":"dialog-title",className:Ie("text-lg leading-none font-semibold",e),...t})}function au({className:e,...t}){return p.jsx(voe,{"data-slot":"dialog-description",className:Ie("text-muted-foreground text-sm",e),...t})}const boe=[{title:"模版信息",items:[{label:"Text",type:"TEXT_STATIC"},{label:"QR Code",type:"QRCODE"},{label:"Barcode",type:"BARCODE"},{label:"Blank Space",type:"BLANK"},{label:"Price",type:"TEXT_PRICE"},{label:"Image",type:"IMAGE"},{label:"Logo",type:"IMAGE"}]},{title:"标签信息",items:[{label:"Label Name",type:"TEXT_PRODUCT"},{label:"Text",type:"TEXT_STATIC"},{label:"QR Code",type:"QRCODE"},{label:"Barcode",type:"BARCODE"},{label:"Nutrition Facts",type:"NUTRITION"},{label:"Price",type:"TEXT_PRICE"},{label:"Duration Date",type:"DATE"},{label:"Duration Time",type:"TIME"},{label:"Duration",type:"DURATION"},{label:"Image",type:"IMAGE"},{label:"Label Type",type:"TEXT_STATIC"},{label:"How-to",type:"TEXT_STATIC"},{label:"Expiration Alert",type:"TEXT_STATIC"}]},{title:"自动生成",items:[{label:"Company",type:"TEXT_STATIC"},{label:"Employee",type:"TEXT_STATIC"},{label:"Current Date",type:"DATE"},{label:"Current Time",type:"TIME"},{label:"Label ID",type:"TEXT_STATIC"}]},{title:"打印时输入",subtitle:"点击添加到画布",items:[{label:"Text",type:"TEXT_STATIC",config:{inputType:"text"}},{label:"Weight",type:"WEIGHT"},{label:"Number",type:"TEXT_STATIC",config:{inputType:"number",text:"0"}},{label:"Date & Time",type:"DATE",config:{inputType:"datetime"}},{label:"Multiple Options",type:"TEXT_STATIC",config:{inputType:"options"}}]}];function woe({onAddElement:e}){return p.jsxs("div",{className:"w-44 shrink-0 border-r border-gray-200 bg-white flex flex-col h-full",children:[p.jsx("div",{className:"px-2 py-2 border-b border-gray-200 font-semibold text-gray-800 text-sm",children:"Elements"}),p.jsx(fc,{className:"flex-1",children:p.jsx("div",{className:"p-1.5 space-y-3",children:boe.map(t=>p.jsxs("div",{children:[p.jsx("div",{className:"px-2 py-1 text-xs font-medium text-gray-500 uppercase tracking-wide",children:t.title}),t.subtitle&&p.jsx("div",{className:"px-2 py-0.5 text-[10px] text-gray-400",children:t.subtitle}),p.jsx("div",{className:"grid grid-cols-2 gap-1 mt-0.5",children:t.items.map((r,n)=>p.jsx("button",{type:"button",onClick:()=>e(r.type,r.config),className:"text-left px-2 py-1 text-xs rounded hover:bg-gray-100 border border-transparent hover:border-gray-200 truncate",children:r.label},`${t.title}-${r.label}-${n}`))})]},t.title))})})]})}var Uf={},Ul={},Wf={},ok;function Wr(){if(ok)return Wf;ok=1,Object.defineProperty(Wf,"__esModule",{value:!0});function e(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}var t=function r(n,i){e(this,r),this.data=n,this.text=i.text||n,this.options=i};return Wf.default=t,Wf}var sk;function _oe(){if(sk)return Ul;sk=1,Object.defineProperty(Ul,"__esModule",{value:!0}),Ul.CODE39=void 0;var e=(function(){function y(w,S){for(var O=0;O=200){w=m.shift()-105;var S=n.SWAP[w];S!==void 0?y=d.next(m,g+1,S):((b===n.SET_A||b===n.SET_B)&&w===n.SHIFT&&(m[0]=b===n.SET_A?m[0]>95?m[0]-96:m[0]:m[0]<32?m[0]+96:m[0]),y=d.next(m,g+1,b))}else w=d.correctIndex(m,b),y=d.next(m,g+1,b);var O=d.getBar(w),E=w*g;return{result:O+y.result,checksum:E+y.checksum}}}]),d})(r.default);return Vf.default=f,Vf}var Gf={},uk;function Soe(){if(uk)return Gf;uk=1,Object.defineProperty(Gf,"__esModule",{value:!0});var e=ou(),t=function(u){return u.match(new RegExp("^"+e.A_CHARS+"*"))[0].length},r=function(u){return u.match(new RegExp("^"+e.B_CHARS+"*"))[0].length},n=function(u){return u.match(new RegExp("^"+e.C_CHARS+"*"))[0]};function i(s,u){var f=u?e.A_CHARS:e.B_CHARS,c=s.match(new RegExp("^("+f+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(c)return c[1]+"Ì"+a(s.substring(c[1].length));var d=s.match(new RegExp("^"+f+"+"))[0];return d.length===s.length?s:d+String.fromCharCode(u?205:206)+i(s.substring(d.length),!u)}function a(s){var u=n(s),f=u.length;if(f===s.length)return s;s=s.substring(f);var c=t(s)>=r(s);return u+String.fromCharCode(c?206:205)+i(s,c)}return Gf.default=function(s){var u=void 0,f=n(s).length;if(f>=2)u=e.C_START_CHAR+a(s);else{var c=t(s)>r(s);u=(c?e.A_START_CHAR:e.B_START_CHAR)+i(s,c)}return u.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(d,h){return"Ë"+h})},Gf}var fk;function Ooe(){if(fk)return Hf;fk=1,Object.defineProperty(Hf,"__esModule",{value:!0});var e=Up(),t=i(e),r=Soe(),n=i(r);function i(c){return c&&c.__esModule?c:{default:c}}function a(c,d){if(!(c instanceof d))throw new TypeError("Cannot call a class as a function")}function s(c,d){if(!c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:c}function u(c,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);c.prototype=Object.create(d&&d.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(c,d):c.__proto__=d)}var f=(function(c){u(d,c);function d(h,m){if(a(this,d),/^[\x00-\x7F\xC8-\xD3]+$/.test(h))var g=s(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,(0,n.default)(h),m));else var g=s(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,h,m));return s(g)}return d})(t.default);return Hf.default=f,Hf}var Kf={},dk;function joe(){if(dk)return Kf;dk=1,Object.defineProperty(Kf,"__esModule",{value:!0});var e=(function(){function c(d,h){for(var m=0;mb.width*10?b.width*10:b.fontSize,y.guardHeight=b.height+y.fontSize/2+b.textMargin,y}return e(m,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(b,y){return this.text.substr(b,y)}},{key:"leftEncode",value:function(b,y){return(0,n.default)(b,y)}},{key:"rightText",value:function(b,y){return this.text.substr(b,y)}},{key:"rightEncode",value:function(b,y){return(0,n.default)(b,y)}},{key:"encodeGuarded",value:function(){var b={fontSize:this.fontSize},y={height:this.guardHeight};return[{data:t.SIDE_BIN,options:y},{data:this.leftEncode(),text:this.leftText(),options:b},{data:t.MIDDLE_BIN,options:y},{data:this.rightEncode(),text:this.rightText(),options:b},{data:t.SIDE_BIN,options:y}]}},{key:"encodeFlat",value:function(){var b=[t.SIDE_BIN,this.leftEncode(),t.MIDDLE_BIN,this.rightEncode(),t.SIDE_BIN];return{data:b.join(""),text:this.text}}}]),m})(a.default);return Zf.default=d,Zf}var xk;function Noe(){if(xk)return Qf;xk=1,Object.defineProperty(Qf,"__esModule",{value:!0});var e=(function(){function h(m,g){for(var b=0;bb.width*10?y.fontSize=b.width*10:y.fontSize=b.fontSize,y.guardHeight=b.height+y.fontSize/2+b.textMargin,y}return e(m,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==d(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var b="";return b+="101",b+=(0,r.default)(this.data.substr(0,6),"LLLLLL"),b+="01010",b+=(0,r.default)(this.data.substr(6,6),"RRRRRR"),b+="101",{data:b,text:this.text}}},{key:"guardedEncoding",value:function(){var b=[];return this.displayValue&&b.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),b.push({data:"101"+(0,r.default)(this.data[0],"L"),options:{height:this.guardHeight}}),b.push({data:(0,r.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),b.push({data:"01010",options:{height:this.guardHeight}}),b.push({data:(0,r.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),b.push({data:(0,r.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&b.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),b}}]),m})(i.default);function d(h){var m=0,g;for(g=1;g<11;g+=2)m+=parseInt(h[g]);for(g=0;g<11;g+=2)m+=parseInt(h[g])*3;return(10-m%10)%10}return Wl.default=c,Wl}var nd={},Ok;function Roe(){if(Ok)return nd;Ok=1,Object.defineProperty(nd,"__esModule",{value:!0});var e=(function(){function b(y,w){for(var S=0;SS.width*10?O.fontSize=S.width*10:O.fontSize=S.fontSize,O.guardHeight=S.height+O.fontSize/2+S.textMargin,O}return e(y,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var S="";return S+="101",S+=this.encodeMiddleDigits(),S+="010101",{data:S,text:this.text}}},{key:"guardedEncoding",value:function(){var S=[];return this.displayValue&&S.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),S.push({data:"101",options:{height:this.guardHeight}}),S.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),S.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&S.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),S}},{key:"encodeMiddleDigits",value:function(){var S=this.upcA[0],O=this.upcA[this.upcA.length-1],E=h[parseInt(O)][parseInt(S)];return(0,r.default)(this.middleDigits,E)}}]),y})(i.default);function g(b,y){for(var w=parseInt(b[b.length-1]),S=d[w],O="",E=0,C=0;C=3&&this.number<=131070}}]),c})(r.default);return Vl.pharmacode=u,Vl}var Gl={},$k;function Woe(){if($k)return Gl;$k=1,Object.defineProperty(Gl,"__esModule",{value:!0}),Gl.codabar=void 0;var e=(function(){function f(c,d){for(var h=0;h":["(%)","I"],"?":["(%)","J"],"@":["(%)","V"],"[":["(%)","K"],"\\":["(%)","L"],"]":["(%)","M"],"^":["(%)","N"],_:["(%)","O"],"`":["(%)","W"],a:["(+)","A"],b:["(+)","B"],c:["(+)","C"],d:["(+)","D"],e:["(+)","E"],f:["(+)","F"],g:["(+)","G"],h:["(+)","H"],i:["(+)","I"],j:["(+)","J"],k:["(+)","K"],l:["(+)","L"],m:["(+)","M"],n:["(+)","N"],o:["(+)","O"],p:["(+)","P"],q:["(+)","Q"],r:["(+)","R"],s:["(+)","S"],t:["(+)","T"],u:["(+)","U"],v:["(+)","V"],w:["(+)","W"],x:["(+)","X"],y:["(+)","Y"],z:["(+)","Z"],"{":["(%)","P"],"|":["(%)","Q"],"}":["(%)","R"],"~":["(%)","S"],"":["(%)","T"]}),zo}var zk;function Y$(){if(zk)return fd;zk=1,Object.defineProperty(fd,"__esModule",{value:!0});var e=(function(){function c(d,h){for(var m=0;m0?d.fontSize+d.textMargin:0)+d.marginTop+d.marginBottom}function i(c,d,h){if(h.displayValue&&dd&&(d=c[h].height);return d}function f(c,d,h){var m;if(h)m=h;else if(typeof document<"u")m=document.createElement("canvas").getContext("2d");else return 0;m.font=d.fontOptions+" "+d.fontSize+"px "+d.font;var g=m.measureText(c);if(!g)return 0;var b=g.width;return b}return Tr.getMaximumHeightOfEncodings=u,Tr.getEncodingHeight=n,Tr.getBarcodePadding=i,Tr.calculateEncodingAttributes=a,Tr.getTotalWidthOfEncodings=s,Tr}var Zk;function Joe(){if(Zk)return wd;Zk=1,Object.defineProperty(wd,"__esModule",{value:!0});var e=(function(){function u(f,c){for(var d=0;d0?(g=0,h.textAlign="left"):c.textAlign=="right"?(g=d.width-1,h.textAlign="right"):(g=d.width/2,h.textAlign="center"),h.fillText(d.text,g,b)}}},{key:"moveCanvasDrawing",value:function(c){var d=this.canvas.getContext("2d");d.translate(c.width,0)}},{key:"restoreCanvas",value:function(){var c=this.canvas.getContext("2d");c.restore()}}]),u})();return wd.default=s,wd}var _d={},Jk;function ese(){if(Jk)return _d;Jk=1,Object.defineProperty(_d,"__esModule",{value:!0});var e=(function(){function f(c,d){for(var h=0;h0&&(this.drawRect(w-h.width*y,b,h.width*y,h.height,d),y=0);y>0&&this.drawRect(w-h.width*(y-1),b,h.width*y,h.height,d)}},{key:"drawSVGText",value:function(d,h,m){var g=this.document.createElementNS(s,"text");if(h.displayValue){var b,y;g.setAttribute("font-family",h.font),g.setAttribute("font-size",h.fontSize),h.fontOptions.includes("bold")&&g.setAttribute("font-weight","bold"),h.fontOptions.includes("italic")&&g.setAttribute("font-style","italic"),h.textPosition=="top"?y=h.fontSize-h.textMargin:y=h.height+h.textMargin+h.fontSize,h.textAlign=="left"||m.barcodePadding>0?(b=0,g.setAttribute("text-anchor","start")):h.textAlign=="right"?(b=m.width-1,g.setAttribute("text-anchor","end")):(b=m.width/2,g.setAttribute("text-anchor","middle")),g.setAttribute("x",b),g.setAttribute("y",y),g.appendChild(this.document.createTextNode(m.text)),d.appendChild(g)}}},{key:"setSvgAttributes",value:function(d,h){var m=this.svg;m.setAttribute("width",d+"px"),m.setAttribute("height",h+"px"),m.setAttribute("x","0px"),m.setAttribute("y","0px"),m.setAttribute("viewBox","0 0 "+d+" "+h),m.setAttribute("xmlns",s),m.setAttribute("version","1.1")}},{key:"createGroup",value:function(d,h,m){var g=this.document.createElementNS(s,"g");return g.setAttribute("transform","translate("+d+", "+h+")"),m.appendChild(g),g}},{key:"setGroupOptions",value:function(d,h){d.setAttribute("fill",h.lineColor)}},{key:"drawRect",value:function(d,h,m,g,b){var y=this.document.createElementNS(s,"rect");return y.setAttribute("x",d),y.setAttribute("y",h),y.setAttribute("width",m),y.setAttribute("height",g),b.appendChild(y),y}}]),f})();return _d.default=u,_d}var Sd={},eR;function tse(){if(eR)return Sd;eR=1,Object.defineProperty(Sd,"__esModule",{value:!0});var e=(function(){function n(i,a){for(var s=0;s"u"?"undefined":e(d))==="object"&&!d.nodeName)return{element:d,renderer:i.default.ObjectRenderer};throw new a.InvalidElementException}}function f(d){var h=document.querySelectorAll(d);if(h.length!==0){for(var m=[],g=0;g"u")throw Error("No element to render on was provided.");return U._renderProperties=(0,c.default)(q),U._encodings=[],U._options=w.default,U._errorHandler=new g.default(U),typeof L<"u"&&(D=D||{},D.format||(D.format=T()),U.options(D)[D.format](L,D).render()),U};E.getModule=function(I){return t.default[I]};for(var C in t.default)t.default.hasOwnProperty(C)&&A(t.default,C);function A(I,q){O.prototype[q]=O.prototype[q.toUpperCase()]=O.prototype[q.toLowerCase()]=function(L,D){var U=this;return U._errorHandler.wrapBarcodeCall(function(){D.text=typeof D.text>"u"?void 0:""+D.text;var H=(0,n.default)(U._options,D);H=(0,h.default)(H);var V=I[q],K=N(L,V,H);return U._encodings.push(K),U})}}function N(I,q,L){I=""+I;var D=new q(I,L);if(!D.valid())throw new b.InvalidInputException(D.constructor.name,I);var U=D.encode();U=(0,a.default)(U);for(var H=0;Ht in e?lse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,H1=(e,t)=>{for(var r in t||(t={}))t3.call(t,r)&&oR(e,r,t[r]);if(Wh)for(var r of Wh(t))r3.call(t,r)&&oR(e,r,t[r]);return e},V1=(e,t)=>{var r={};for(var n in e)t3.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Wh)for(var n of Wh(e))t.indexOf(n)<0&&r3.call(e,n)&&(r[n]=e[n]);return r};/** - * @license QR Code generator library (TypeScript) - * Copyright (c) Project Nayuki. - * SPDX-License-Identifier: MIT - */var Xa;(e=>{const t=class Ge{constructor(f,c,d,h){if(this.version=f,this.errorCorrectionLevel=c,this.modules=[],this.isFunction=[],fGe.MAX_VERSION)throw new RangeError("Version value out of range");if(h<-1||h>7)throw new RangeError("Mask value out of range");this.size=f*4+17;let m=[];for(let b=0;b7)throw new RangeError("Invalid value");let b,y;for(b=d;;b++){const E=Ge.getNumDataCodewords(b,c)*8,C=s.getTotalBits(f,b);if(C<=E){y=C;break}if(b>=h)throw new RangeError("Data too long")}for(const E of[Ge.Ecc.MEDIUM,Ge.Ecc.QUARTILE,Ge.Ecc.HIGH])g&&y<=Ge.getNumDataCodewords(b,E)*8&&(c=E);let w=[];for(const E of f){r(E.mode.modeBits,4,w),r(E.numChars,E.mode.numCharCountBits(b),w);for(const C of E.getData())w.push(C)}i(w.length==y);const S=Ge.getNumDataCodewords(b,c)*8;i(w.length<=S),r(0,Math.min(4,S-w.length),w),r(0,(8-w.length%8)%8,w),i(w.length%8==0);for(let E=236;w.lengthO[C>>>3]|=E<<7-(C&7)),new Ge(b,c,O,m)}getModule(f,c){return 0<=f&&f>>9)*1335;const h=(c<<10|d)^21522;i(h>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,n(h,m));this.setFunctionModule(8,7,n(h,6)),this.setFunctionModule(8,8,n(h,7)),this.setFunctionModule(7,8,n(h,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,n(h,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,n(h,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,n(h,m));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let f=this.version;for(let d=0;d<12;d++)f=f<<1^(f>>>11)*7973;const c=this.version<<12|f;i(c>>>18==0);for(let d=0;d<18;d++){const h=n(c,d),m=this.size-11+d%3,g=Math.floor(d/3);this.setFunctionModule(m,g,h),this.setFunctionModule(g,m,h)}}drawFinderPattern(f,c){for(let d=-4;d<=4;d++)for(let h=-4;h<=4;h++){const m=Math.max(Math.abs(h),Math.abs(d)),g=f+h,b=c+d;0<=g&&g{(E!=y-m||A>=b)&&O.push(C[E])});return i(O.length==g),O}drawCodewords(f){if(f.length!=Math.floor(Ge.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let c=0;for(let d=this.size-1;d>=1;d-=2){d==6&&(d=5);for(let h=0;h>>3],7-(c&7)),c++)}}i(c==f.length*8)}applyMask(f){if(f<0||f>7)throw new RangeError("Mask value out of range");for(let c=0;c5&&f++):(this.finderPenaltyAddHistory(b,y),g||(f+=this.finderPenaltyCountPatterns(y)*Ge.PENALTY_N3),g=this.modules[m][w],b=1);f+=this.finderPenaltyTerminateAndCount(g,b,y)*Ge.PENALTY_N3}for(let m=0;m5&&f++):(this.finderPenaltyAddHistory(b,y),g||(f+=this.finderPenaltyCountPatterns(y)*Ge.PENALTY_N3),g=this.modules[w][m],b=1);f+=this.finderPenaltyTerminateAndCount(g,b,y)*Ge.PENALTY_N3}for(let m=0;mg+(b?1:0),c);const d=this.size*this.size,h=Math.ceil(Math.abs(c*20-d*10)/d)-1;return i(0<=h&&h<=9),f+=h*Ge.PENALTY_N4,i(0<=f&&f<=2568888),f}getAlignmentPatternPositions(){if(this.version==1)return[];{const f=Math.floor(this.version/7)+2,c=this.version==32?26:Math.ceil((this.version*4+4)/(f*2-2))*2;let d=[6];for(let h=this.size-7;d.lengthGe.MAX_VERSION)throw new RangeError("Version number out of range");let c=(16*f+128)*f+64;if(f>=2){const d=Math.floor(f/7)+2;c-=(25*d-10)*d-55,f>=7&&(c-=36)}return i(208<=c&&c<=29648),c}static getNumDataCodewords(f,c){return Math.floor(Ge.getNumRawDataModules(f)/8)-Ge.ECC_CODEWORDS_PER_BLOCK[c.ordinal][f]*Ge.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][f]}static reedSolomonComputeDivisor(f){if(f<1||f>255)throw new RangeError("Degree out of range");let c=[];for(let h=0;h0);for(const h of f){const m=h^d.shift();d.push(0),c.forEach((g,b)=>d[b]^=Ge.reedSolomonMultiply(g,m))}return d}static reedSolomonMultiply(f,c){if(f>>>8||c>>>8)throw new RangeError("Byte out of range");let d=0;for(let h=7;h>=0;h--)d=d<<1^(d>>>7)*285,d^=(c>>>h&1)*f;return i(d>>>8==0),d}finderPenaltyCountPatterns(f){const c=f[1];i(c<=this.size*3);const d=c>0&&f[2]==c&&f[3]==c*3&&f[4]==c&&f[5]==c;return(d&&f[0]>=c*4&&f[6]>=c?1:0)+(d&&f[6]>=c*4&&f[0]>=c?1:0)}finderPenaltyTerminateAndCount(f,c,d){return f&&(this.finderPenaltyAddHistory(c,d),c=0),c+=this.size,this.finderPenaltyAddHistory(c,d),this.finderPenaltyCountPatterns(d)}finderPenaltyAddHistory(f,c){c[0]==0&&(f+=this.size),c.pop(),c.unshift(f)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function r(u,f,c){if(f<0||f>31||u>>>f)throw new RangeError("Value out of range");for(let d=f-1;d>=0;d--)c.push(u>>>d&1)}function n(u,f){return(u>>>f&1)!=0}function i(u){if(!u)throw new Error("Assertion error")}const a=class Et{constructor(f,c,d){if(this.mode=f,this.numChars=c,this.bitData=d,c<0)throw new RangeError("Invalid argument");this.bitData=d.slice()}static makeBytes(f){let c=[];for(const d of f)r(d,8,c);return new Et(Et.Mode.BYTE,f.length,c)}static makeNumeric(f){if(!Et.isNumeric(f))throw new RangeError("String contains non-numeric characters");let c=[];for(let d=0;d=1<{(t=>{const r=class{constructor(i,a){this.ordinal=i,this.formatBits=a}};r.LOW=new r(0,1),r.MEDIUM=new r(1,0),r.QUARTILE=new r(2,3),r.HIGH=new r(3,2),t.Ecc=r})(e.QrCode||(e.QrCode={}))})(Xa||(Xa={}));(e=>{(t=>{const r=class{constructor(i,a){this.modeBits=i,this.numBitsCharCount=a}numCharCountBits(i){return this.numBitsCharCount[Math.floor((i+7)/17)]}};r.NUMERIC=new r(1,[10,12,14]),r.ALPHANUMERIC=new r(2,[9,11,13]),r.BYTE=new r(4,[8,16,16]),r.KANJI=new r(8,[8,10,12]),r.ECI=new r(7,[0,0,0]),t.Mode=r})(e.QrSegment||(e.QrSegment={}))})(Xa||(Xa={}));var Xo=Xa;/** - * @license qrcode.react - * Copyright (c) Paul O'Shannessy - * SPDX-License-Identifier: ISC - */var cse={L:Xo.QrCode.Ecc.LOW,M:Xo.QrCode.Ecc.MEDIUM,Q:Xo.QrCode.Ecc.QUARTILE,H:Xo.QrCode.Ecc.HIGH},n3=128,i3="L",a3="#FFFFFF",o3="#000000",s3=!1,l3=1,use=4,fse=0,dse=.1;function c3(e,t=0){const r=[];return e.forEach(function(n,i){let a=null;n.forEach(function(s,u){if(!s&&a!==null){r.push(`M${a+t} ${i+t}h${u-a}v1H${a+t}z`),a=null;return}if(u===n.length-1){if(!s)return;a===null?r.push(`M${u+t},${i+t} h1v1H${u+t}z`):r.push(`M${a+t},${i+t} h${u+1-a}v1H${a+t}z`);return}s&&a===null&&(a=u)})}),r.join("")}function u3(e,t){return e.slice().map((r,n)=>n=t.y+t.h?r:r.map((i,a)=>a=t.x+t.w?i:!1))}function hse(e,t,r,n){if(n==null)return null;const i=e.length+r*2,a=Math.floor(t*dse),s=i/t,u=(n.width||a)*s,f=(n.height||a)*s,c=n.x==null?e.length/2-u/2:n.x*s,d=n.y==null?e.length/2-f/2:n.y*s,h=n.opacity==null?1:n.opacity;let m=null;if(n.excavate){let b=Math.floor(c),y=Math.floor(d),w=Math.ceil(u+c-b),S=Math.ceil(f+d-y);m={x:b,y,w,h:S}}const g=n.crossOrigin;return{x:c,y:d,h:f,w:u,excavation:m,opacity:h,crossOrigin:g}}function pse(e,t){return t!=null?Math.max(Math.floor(t),0):e?use:fse}function f3({value:e,level:t,minVersion:r,includeMargin:n,marginSize:i,imageSettings:a,size:s,boostLevel:u}){let f=z.useMemo(()=>{const b=(Array.isArray(e)?e:[e]).reduce((y,w)=>(y.push(...Xo.QrSegment.makeSegments(w)),y),[]);return Xo.QrCode.encodeSegments(b,cse[t],r,void 0,void 0,u)},[e,t,r,u]);const{cells:c,margin:d,numCells:h,calculatedImageSettings:m}=z.useMemo(()=>{let g=f.getModules();const b=pse(n,i),y=g.length+b*2,w=hse(g,s,b,a);return{cells:g,margin:b,numCells:y,calculatedImageSettings:w}},[f,s,a,n,i]);return{qrcode:f,margin:d,cells:c,numCells:h,calculatedImageSettings:m}}var mse=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),vse=z.forwardRef(function(t,r){const n=t,{value:i,size:a=n3,level:s=i3,bgColor:u=a3,fgColor:f=o3,includeMargin:c=s3,minVersion:d=l3,boostLevel:h,marginSize:m,imageSettings:g}=n,y=V1(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:w}=y,S=V1(y,["style"]),O=g?.src,E=z.useRef(null),C=z.useRef(null),A=z.useCallback(H=>{E.current=H,typeof r=="function"?r(H):r&&(r.current=H)},[r]),[N,T]=z.useState(!1),{margin:R,cells:I,numCells:q,calculatedImageSettings:L}=f3({value:i,level:s,minVersion:d,boostLevel:h,includeMargin:c,marginSize:m,imageSettings:g,size:a});z.useEffect(()=>{if(E.current!=null){const H=E.current,V=H.getContext("2d");if(!V)return;let K=I;const X=C.current,B=L!=null&&X!==null&&X.complete&&X.naturalHeight!==0&&X.naturalWidth!==0;B&&L.excavation!=null&&(K=u3(I,L.excavation));const Z=window.devicePixelRatio||1;H.height=H.width=a*Z;const ee=a/q*Z;V.scale(ee,ee),V.fillStyle=u,V.fillRect(0,0,q,q),V.fillStyle=f,mse?V.fill(new Path2D(c3(K,R))):I.forEach(function(M,$){M.forEach(function(Q,ae){Q&&V.fillRect(ae+R,$+R,1,1)})}),L&&(V.globalAlpha=L.opacity),B&&V.drawImage(X,L.x+R,L.y+R,L.w,L.h)}}),z.useEffect(()=>{T(!1)},[O]);const D=H1({height:a,width:a},w);let U=null;return O!=null&&(U=z.createElement("img",{src:O,key:O,style:{display:"none"},onLoad:()=>{T(!0)},ref:C,crossOrigin:L?.crossOrigin})),z.createElement(z.Fragment,null,z.createElement("canvas",H1({style:D,height:a,width:a,ref:A,role:"img"},S)),U)});vse.displayName="QRCodeCanvas";var d3=z.forwardRef(function(t,r){const n=t,{value:i,size:a=n3,level:s=i3,bgColor:u=a3,fgColor:f=o3,includeMargin:c=s3,minVersion:d=l3,boostLevel:h,title:m,marginSize:g,imageSettings:b}=n,y=V1(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:w,cells:S,numCells:O,calculatedImageSettings:E}=f3({value:i,level:s,minVersion:d,boostLevel:h,includeMargin:c,marginSize:g,imageSettings:b,size:a});let C=S,A=null;b!=null&&E!=null&&(E.excavation!=null&&(C=u3(S,E.excavation)),A=z.createElement("image",{href:b.src,height:E.h,width:E.w,x:E.x+w,y:E.y+w,preserveAspectRatio:"none",opacity:E.opacity,crossOrigin:E.crossOrigin}));const N=c3(C,w);return z.createElement("svg",H1({height:a,width:a,viewBox:`0 0 ${O} ${O}`,ref:r,role:"img"},y),!!m&&z.createElement("title",null,m),z.createElement("path",{fill:u,d:`M0,0 h${O}v${O}H0z`,shapeRendering:"crispEdges"}),z.createElement("path",{fill:f,d:N,shapeRendering:"crispEdges"}),A)});d3.displayName="QRCodeSVG";function gse({data:e,width:t,height:r,showText:n,orientation:i="horizontal"}){const a=P.useRef(null),s=i==="vertical",u=Math.max(20,(s?t:r)-(n?14:4));P.useEffect(()=>{if(a.current&&e)try{sse(a.current,e,{format:"CODE128",width:1,height:u,displayValue:n!==!1,margin:2,fontOptions:"",fontSize:10})}catch{}},[e,u,n]);const f=p.jsx("svg",{ref:a,className:"w-full h-full min-h-0",style:{maxHeight:s?t:r}});return s?p.jsx("div",{className:"w-full h-full flex items-center justify-center",children:p.jsx("div",{style:{transform:"rotate(-90deg)",transformOrigin:"center center",width:r,height:t,display:"flex",alignItems:"center",justifyContent:"center"},children:f})}):f}const lc=8;function qo(e){return Math.round(e/lc)*lc}function Hh(e,t){return t==="cm"?e*37.8:e*96}function sR(e,t){return t==="cm"?e/37.8:e/96}function h3({el:e}){const t=e.config,r=e.type,n={fontSize:t?.fontSize??14,fontFamily:t?.fontFamily??"Arial",fontWeight:t?.fontWeight??"normal",textAlign:t?.textAlign??"left",color:t?.color??"#000"},i=t?.inputType;if(r==="TEXT_STATIC"){const a=t?.text??"文本";return i==="number"?p.jsx("input",{type:"number",readOnly:!0,value:t?.text??"0",className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 pointer-events-none",style:{...n,textAlign:"right"}}):i==="options"?p.jsxs("div",{className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 flex items-center pointer-events-none text-gray-500",style:n,children:[p.jsx("span",{className:"truncate flex-1",children:a||"请选择..."}),p.jsx("span",{className:"ml-auto text-gray-400",children:"▼"})]}):i==="text"?p.jsx("input",{type:"text",readOnly:!0,value:a,className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 pointer-events-none",style:n}):p.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-pre-wrap break-all leading-tight",style:n,children:a})}if(r==="TEXT_PRODUCT"){const a=t?.text??"商品名";return p.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-pre-wrap break-all leading-tight",style:n,children:a})}if(r==="TEXT_PRICE"){const a=t?.prefix??"¥",s=t?.text??"0.00";return p.jsxs("div",{className:"w-full h-full px-1 overflow-hidden flex items-center",style:{...n,justifyContent:n.textAlign==="center"?"center":n.textAlign==="right"?"flex-end":"flex-start"},children:[p.jsx("span",{children:a}),p.jsx("span",{children:s})]})}if(r==="BARCODE"){const a=t?.data??"123456789",s=t?.showText!==!1,u=t?.orientation==="vertical"?"vertical":"horizontal";return p.jsx("div",{className:"flex flex-col items-center justify-center w-full h-full overflow-hidden p-0.5",children:p.jsx("div",{className:"flex-1 w-full min-h-0 flex items-center justify-center",children:p.jsx(gse,{data:a,width:e.width,height:e.height,showText:s,orientation:u})})})}if(r==="QRCODE"){const a=t?.data??"https://example.com",s=Math.min(e.width,e.height)-4;return p.jsx("div",{className:"w-full h-full flex items-center justify-center p-0.5",children:p.jsx(d3,{value:a,size:Math.max(20,s),level:"M",includeMargin:!1})})}if(r==="IMAGE"){const a=t?.src;return a?p.jsx("img",{src:a,alt:"",className:"w-full h-full object-contain"}):p.jsx("div",{className:"w-full h-full flex flex-col items-center justify-center bg-gray-100 text-gray-500 text-[10px] border border-dashed border-gray-300",children:p.jsx("span",{className:"font-medium",children:"Logo"})})}if(r==="DATE"){const s=(t?.format??"YYYY-MM-DD").replace("YYYY","2025").replace("MM","02").replace("DD","01");return t?.inputType==="datetime"||t?.inputType==="date"?p.jsx("input",{type:"date",readOnly:!0,value:"2025-02-01",className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 pointer-events-none text-[10px]",style:n}):p.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:s})}if(r==="TIME"){const s=(t?.format??"HH:mm").replace("HH","12").replace("mm","30");return p.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:s})}if(r==="DURATION")return p.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:"保质期 2025-02-04"});if(r==="WEIGHT"){const a=t?.value??500,s=t?.unit??"g";return p.jsxs("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:[a,s]})}if(r==="WEIGHT_PRICE"){const a=t?.unitPrice??10,s=t?.weight??.5,u=t?.currency??"¥";return p.jsxs("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:[u,(a*s).toFixed(2)]})}if(r==="NUTRITION"){const a=t?.calories??120;return p.jsxs("div",{className:"text-[8px] p-0.5 w-full h-full overflow-hidden flex flex-col",children:[p.jsx("div",{className:"font-semibold border-b border-black",children:"Nutrition Facts"}),p.jsxs("div",{children:["Calories ",a]})]})}return r==="BLANK"?p.jsx("div",{className:"w-full h-full border border-dashed border-gray-200"}):p.jsx("div",{className:"text-gray-500 text-[10px] px-1 truncate w-full flex items-center justify-center",children:e.type.replace(/_/g," ")})}function yse({template:e,selectedId:t,onSelect:r,onUpdateElement:n,onDeleteElement:i,onTemplateChange:a,scale:s=1,onZoomIn:u,onZoomOut:f,onPreview:c}){const d=P.useRef(null),h=P.useRef(null),m=P.useRef(null),g=P.useRef(null),b=P.useRef(null),y=P.useRef(null),w=P.useRef(null),[S,O]=z.useState(!1),[E,C]=z.useState(!1),A=P.useRef(null),[N,T]=z.useState({x:0,y:0}),R=P.useRef(null),I=Hh(e.width,e.unit),q=Hh(e.height,e.unit),L=e.showGrid!==!1,D=P.useCallback((M,$)=>{if(S||M.button===1)return;M.stopPropagation(),r($),h.current?.focus();const Q=e.elements.find(pe=>pe.id===$);if(!Q)return;const ae=document.getElementById(`element-${$}`);ae&&(ae.classList.add("z-50","opacity-90","shadow-xl","ring-2","ring-blue-400","ring-offset-2"),ae.style.cursor="grabbing"),m.current={id:$,startX:M.clientX,startY:M.clientY,elX:Q.x,elY:Q.y},y.current={id:$,x:Q.x,y:Q.y},M.currentTarget.setPointerCapture?.(M.pointerId)},[e.elements,r,S]),U=P.useCallback(M=>{w.current!==null&&cancelAnimationFrame(w.current),w.current=requestAnimationFrame(()=>{M(),w.current=null})},[]),H=P.useCallback(M=>{if(E&&R.current){const $=M.clientX-R.current.startX,Q=M.clientY-R.current.startY;T({x:R.current.x+$,y:R.current.y+Q});return}if(E&&A.current&&d.current){const $=M.clientX-A.current.x,Q=M.clientY-A.current.y;d.current.scrollLeft=A.current.scrollLeft-$,d.current.scrollTop=A.current.scrollTop-Q;return}if(m.current){const{id:$,startX:Q,startY:ae,elX:pe,elY:ye}=m.current,oe=M.clientX,me=M.clientY;U(()=>{const ie=(oe-Q)/s,ue=(me-ae)/s,ve=Math.max(0,pe+ie),re=Math.max(0,ye+ue),De=qo(ve),Te=qo(re),Ke=document.getElementById(`element-${$}`);Ke&&(Ke.style.left=`${De}px`,Ke.style.top=`${Te}px`),y.current={id:$,x:De,y:Te}})}if(g.current){const{id:$,corner:Q,startX:ae,startY:pe,w:ye,h:oe,elX:me,elY:ie}=g.current,ue=M.clientX,ve=M.clientY;U(()=>{const re=(ue-ae)/s,De=(ve-pe)/s;let Te=ye,Ke=oe,lt=me,vt=ie;Q.includes("e")&&(Te=Math.max(20,ye+re)),Q.includes("w")&&(Te=Math.max(20,ye-re),lt=me+re),Q.includes("s")&&(Ke=Math.max(12,oe+De)),Q.includes("n")&&(Ke=Math.max(12,oe-De),vt=ie+De);const dr=qo(Te),Or=qo(Ke),jr=qo(lt),Kt=qo(vt),Xt=document.getElementById(`element-${$}`);Xt&&(Xt.style.width=`${dr}px`,Xt.style.height=`${Or}px`,Xt.style.left=`${jr}px`,Xt.style.top=`${Kt}px`),y.current={id:$,width:dr,height:Or,x:jr,y:Kt}})}if(b.current&&a){const{edge:$,startX:Q,startY:ae,startW:pe,startH:ye}=b.current,oe=M.clientX,me=M.clientY;U(()=>{const ie=(oe-Q)/s,ue=(me-ae)/s,ve=sR(ie,e.unit),re=sR(ue,e.unit);if($==="bottom"){const De=Math.max(1,ye+re);a({height:De})}else{const De=Math.max(1,pe+ve);a({width:De})}})}},[E,a,s,e.unit,U]),V=P.useCallback(()=>{E&&(C(!1),A.current=null,R.current=null),w.current!==null&&(cancelAnimationFrame(w.current),w.current=null);const M=m.current?.id||g.current?.id;if(M){const $=document.getElementById(`element-${M}`);$&&($.classList.remove("z-50","opacity-90","shadow-xl","ring-2","ring-blue-400","ring-offset-2"),$.style.cursor="")}if(y.current){const{id:$,...Q}=y.current;n($,Q),y.current=null}m.current=null,g.current=null,b.current=null},[n]);P.useEffect(()=>{const M=Q=>{Q.code==="Space"&&!Q.repeat&&O(!0)},$=Q=>{Q.code==="Space"&&(O(!1),C(!1),A.current=null,R.current=null)};return window.addEventListener("keydown",M),window.addEventListener("keyup",$),()=>{window.removeEventListener("keydown",M),window.removeEventListener("keyup",$)}},[]),P.useEffect(()=>{const M=d.current;if(!M)return;const $=()=>{M.scrollLeft=Math.max(0,(M.scrollWidth-M.clientWidth)/2),M.scrollTop=Math.max(0,(M.scrollHeight-M.clientHeight)/2)},Q=requestAnimationFrame($),ae=setTimeout($,100);return()=>{cancelAnimationFrame(Q),clearTimeout(ae)}},[s,I,q]);const K=P.useCallback(M=>{if(!t)return;if(M.key==="Delete"||M.key==="Backspace"){M.preventDefault();const ye=e.elements.findIndex(oe=>oe.id===t);if(ye>=0){const oe=e.elements.filter(me=>me.id!==t);i(t),r(oe[ye]?.id??oe[ye-1]?.id??null)}return}const $=e.elements.find(ye=>ye.id===t);if(!$)return;const Q=M.shiftKey?1:lc;let ae=0,pe=0;switch(M.key){case"ArrowLeft":ae=-Q;break;case"ArrowRight":ae=Q;break;case"ArrowUp":pe=-Q;break;case"ArrowDown":pe=-Q;break;default:return}M.key==="ArrowDown"&&(pe=Q),M.preventDefault(),n($.id,{x:Math.max(0,$.x+ae),y:Math.max(0,$.y+pe)})},[t,e.elements,n,i,r]),X=()=>r(null),B=M=>{(S||M.button===1)&&(M.preventDefault(),C(!0),A.current={x:M.clientX,y:M.clientY,scrollLeft:d.current?.scrollLeft||0,scrollTop:d.current?.scrollTop||0},M.currentTarget.setPointerCapture(M.pointerId))},Z=M=>{if(E&&A.current&&d.current){const $=M.clientX-A.current.x,Q=M.clientY-A.current.y;d.current.scrollLeft=A.current.scrollLeft-$,d.current.scrollTop=A.current.scrollTop-Q}},ee=M=>{E&&(C(!1),A.current=null)};return p.jsxs("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden bg-gray-100",children:[p.jsxs("div",{className:"shrink-0 px-4 py-2 border-b border-gray-200 bg-white flex items-center justify-between gap-2 flex-wrap z-10",children:[p.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Label Preview"}),p.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c&&p.jsx("button",{type:"button",onClick:c,className:"h-8 px-3 rounded border border-gray-300 bg-white text-gray-700 hover:bg-gray-50 text-xs font-medium shadow-sm transition-all active:scale-95",children:"预览"}),a&&p.jsxs(p.Fragment,{children:[p.jsxs(tt,{value:(()=>{const M=ob.findIndex($=>$.width===e.width&&$.height===e.height&&$.unit===e.unit);return M>=0?String(M):"custom"})(),onValueChange:M=>{if(M==="custom")return;const $=ob[Number(M)];$&&a({width:$.width,height:$.height,unit:$.unit})},children:[p.jsx(nt,{className:"h-8 w-[130px] text-xs",children:p.jsx(rt,{placeholder:"画布大小"})}),p.jsxs(st,{children:[ob.map((M,$)=>p.jsx(Ae,{value:String($),className:"text-xs",children:M.name},$)),p.jsx(Ae,{value:"custom",className:"text-xs text-gray-500",children:"自定义"})]})]}),p.jsx("button",{type:"button",onClick:()=>a({showGrid:!L}),className:Ie("h-8 px-3 rounded border text-xs font-medium shadow-sm transition-colors",L?"border-gray-300 bg-white text-gray-700 hover:bg-gray-50":"border-gray-300 bg-gray-100 text-gray-500"),children:L?"隐藏网格":"显示网格"})]}),p.jsxs("div",{className:"flex items-center gap-1 bg-white rounded border border-gray-300 p-0.5 shadow-sm h-8",children:[p.jsx("button",{type:"button",onClick:f,disabled:!f,className:"h-6 w-6 rounded hover:bg-gray-100 text-gray-600 disabled:opacity-50 disabled:pointer-events-none flex items-center justify-center text-sm font-medium active:scale-90 transition-transform",title:"缩小",children:"−"}),p.jsxs("span",{className:"min-w-[3rem] text-center text-xs text-gray-600 font-medium",children:[Math.round(s*100),"%"]}),p.jsx("button",{type:"button",onClick:u,disabled:!u,className:"h-6 w-6 rounded hover:bg-gray-100 text-gray-600 disabled:opacity-50 disabled:pointer-events-none flex items-center justify-center text-sm font-medium active:scale-90 transition-transform",title:"放大",children:"+"})]})]})]}),p.jsx("div",{ref:d,className:Ie("flex-1 overflow-auto bg-gray-100 relative",S?"cursor-grab active:cursor-grabbing":""),onClick:X,onPointerDown:B,onPointerMove:Z,onPointerUp:ee,onPointerLeave:ee,children:p.jsx("div",{style:{minWidth:"100%",minHeight:"100%",width:"fit-content",height:"fit-content",display:"flex",padding:50,boxSizing:"border-box",transform:`translate(${N.x}px, ${N.y}px)`},children:p.jsxs("div",{ref:h,tabIndex:0,className:Ie("relative bg-white shadow-lg border border-dashed border-gray-300 origin-top-left outline-none m-auto",E?"cursor-grabbing":"cursor-grab"),style:{width:I,height:q,transform:`scale(${s})`,backgroundImage:L?`linear-gradient(to right, rgba(0,0,0,0.06) 1px, transparent 1px), - linear-gradient(to bottom, rgba(0,0,0,0.06) 1px, transparent 1px)`:void 0,backgroundSize:L?`${lc}px ${lc}px`:void 0,pointerEvents:S?"none":"auto"},onPointerDown:M=>{const $=M.target,Q=$.closest('[id^="element-"]'),ae=$.closest('[title*="拖拽拉高"]')||$.closest('[title*="拖拽拉宽"]');h.current?.contains($)&&!Q&&!ae&&!m.current&&!g.current&&(M.preventDefault(),M.stopPropagation(),C(!0),R.current={x:N.x,y:N.y,startX:M.clientX,startY:M.clientY},A.current={x:M.clientX,y:M.clientY,scrollLeft:d.current?.scrollLeft??0,scrollTop:d.current?.scrollTop??0},M.currentTarget.setPointerCapture?.(M.pointerId))},onPointerMove:H,onPointerUp:V,onKeyDown:K,children:[e.showRuler&&p.jsxs("div",{className:"absolute top-0 left-0 right-0 h-5 border-b border-gray-300 bg-gray-50 text-[10px] text-gray-500 flex items-center px-1 pointer-events-none select-none",children:[e.unit," ",e.width," × ",e.height]}),a&&p.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-3 cursor-ns-resize flex items-center justify-center bg-gray-200/80 hover:bg-blue-400/30 border-t border-gray-300 text-[10px] text-gray-500 transition-colors",title:"拖拽拉高纸张",onPointerDown:M=>{M.stopPropagation(),b.current={edge:"bottom",startX:M.clientX,startY:M.clientY,startW:e.width,startH:e.height},M.target.setPointerCapture?.(M.pointerId)},children:"⋮"}),a&&p.jsx("div",{className:"absolute top-0 right-0 bottom-0 w-3 cursor-ew-resize flex items-center justify-center bg-gray-200/80 hover:bg-blue-400/30 border-l border-gray-300 text-[10px] text-gray-500 transition-colors",title:"拖拽拉宽纸张",onPointerDown:M=>{M.stopPropagation(),b.current={edge:"right",startX:M.clientX,startY:M.clientY,startW:e.width,startH:e.height},M.target.setPointerCapture?.(M.pointerId)},children:"⋮"}),e.elements.map(M=>p.jsxs("div",{id:`element-${M.id}`,className:Ie("absolute box-border cursor-move overflow-hidden transition-shadow",M.border==="line"&&"border border-gray-400",M.border==="dotted"&&"border border-dotted border-gray-400",t===M.id&&"ring-2 ring-blue-500 ring-offset-1 z-10"),style:{left:M.x,top:M.y,width:M.width,height:M.height},onClick:$=>{$.stopPropagation(),r(M.id)},onPointerDown:$=>D($,M.id),children:[p.jsx(h3,{el:M}),t===M.id&&p.jsxs(p.Fragment,{children:[["nw","ne","sw","se"].map($=>p.jsx("div",{className:"absolute w-4 h-4 bg-white border-2 border-blue-500 rounded-full z-20 shadow-md hover:scale-110 transition-transform",style:{cursor:"nwse-resize",top:$.startsWith("n")?-6:void 0,bottom:$.startsWith("s")?-6:void 0,left:$.endsWith("w")?-6:void 0,right:$.endsWith("e")?-6:void 0},onPointerDown:Q=>{Q.stopPropagation();const ae=e.elements.find(pe=>pe.id===M.id);g.current={id:M.id,corner:$,startX:Q.clientX,startY:Q.clientY,w:ae.width,h:ae.height,elX:ae.x,elY:ae.y},Q.currentTarget.setPointerCapture?.(Q.pointerId)}},$)),["n","s","w","e"].map($=>p.jsx("div",{className:"absolute bg-blue-500/50 border border-white/50 rounded-sm z-10 shadow-sm hover:bg-blue-600",style:{cursor:$==="n"||$==="s"?"ns-resize":"ew-resize",width:$==="n"||$==="s"?"20px":"6px",height:$==="n"||$==="s"?"6px":"20px",top:$==="n"?-3:$==="s"?void 0:"50%",bottom:$==="s"?-3:void 0,left:$==="w"?-3:$==="e"?void 0:"50%",right:$==="e"?-3:void 0,transform:$==="n"||$==="s"?"translateX(-50%)":"translateY(-50%)"},onPointerDown:Q=>{Q.stopPropagation();const ae=e.elements.find(ye=>ye.id===M.id),pe=document.getElementById(`element-${M.id}`);pe&&pe.classList.add("z-50","opacity-90"),g.current={id:M.id,corner:$,startX:Q.clientX,startY:Q.clientY,w:ae.width,h:ae.height,elX:ae.x,elY:ae.y},Q.currentTarget.setPointerCapture?.(Q.pointerId)}},$))]})]},M.id))]})})})]})}function xse({template:e,maxWidth:t=480}){const r=Hh(e.width,e.unit),n=Hh(e.height,e.unit),i=t?Math.min(t/r,t/n,2):1,a=r*i,s=n*i;return p.jsx("div",{className:"flex items-center justify-center p-4 bg-gray-100 rounded",children:p.jsx("div",{style:{width:a,height:s},className:"relative bg-white shadow-lg overflow-hidden",children:p.jsx("div",{className:"origin-top-left",style:{position:"absolute",left:0,top:0,width:r,height:n,transform:`scale(${i})`,transformOrigin:"0 0"},children:e.elements.map(u=>p.jsx("div",{className:"absolute box-border overflow-hidden pointer-events-none flex items-center justify-center text-xs",style:{left:u.x,top:u.y,width:u.width,height:u.height,border:u.border==="line"?"1px solid #999":u.border==="dotted"?"1px dotted #999":void 0},children:p.jsx(h3,{el:u})},u.id))})})})}var bse=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wse=bse.reduce((e,t)=>{const r=nw(`Primitive.${t}`),n=P.forwardRef((i,a)=>{const{asChild:s,...u}=i,f=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(f,{...u,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),_se="Label",p3=P.forwardRef((e,t)=>p.jsx(wse.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));p3.displayName=_se;var Sse=p3;function we({className:e,...t}){return p.jsx(Sse,{"data-slot":"label",className:Ie("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}var Vp="Switch",[Ose]=gi(Vp),[jse,Ese]=Ose(Vp),m3=P.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:i,defaultChecked:a,required:s,disabled:u,value:f="on",onCheckedChange:c,form:d,...h}=e,[m,g]=P.useState(null),b=Je(t,E=>g(E)),y=P.useRef(!1),w=m?d||!!m.closest("form"):!0,[S,O]=Ha({prop:i,defaultProp:a??!1,onChange:c,caller:Vp});return p.jsxs(jse,{scope:r,checked:S,disabled:u,children:[p.jsx(We.button,{type:"button",role:"switch","aria-checked":S,"aria-required":s,"data-state":x3(S),"data-disabled":u?"":void 0,disabled:u,value:f,...h,ref:b,onClick:Fe(e.onClick,E=>{O(C=>!C),w&&(y.current=E.isPropagationStopped(),y.current||E.stopPropagation())})}),w&&p.jsx(y3,{control:m,bubbles:!y.current,name:n,value:f,checked:S,required:s,disabled:u,form:d,style:{transform:"translateX(-100%)"}})]})});m3.displayName=Vp;var v3="SwitchThumb",g3=P.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,i=Ese(v3,r);return p.jsx(We.span,{"data-state":x3(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:t})});g3.displayName=v3;var Ase="SwitchBubbleInput",y3=P.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...i},a)=>{const s=P.useRef(null),u=Je(s,a),f=__(r),c=y_(t);return P.useEffect(()=>{const d=s.current;if(!d)return;const h=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(h,"checked").set;if(f!==r&&g){const b=new Event("click",{bubbles:n});g.call(d,r),d.dispatchEvent(b)}},[f,r,n]),p.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:u,style:{...i.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});y3.displayName=Ase;function x3(e){return e?"checked":"unchecked"}var Pse=m3,Nse=g3;function no({className:e,...t}){return p.jsx(Pse,{"data-slot":"switch",className:Ie("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-switch-background focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:p.jsx(Nse,{"data-slot":"switch-thumb",className:Ie("bg-card dark:data-[state=unchecked]:bg-card-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function Cse({template:e,selectedElement:t,onTemplateChange:r,onElementChange:n,onDeleteElement:i}){return t?p.jsxs("div",{className:"w-72 shrink-0 border-l border-gray-200 bg-white flex flex-col h-full",children:[p.jsx("div",{className:"px-3 py-2 border-b border-gray-200 font-semibold text-gray-800",children:"Properties (Element)"}),p.jsx(fc,{className:"flex-1",children:p.jsxs("div",{className:"p-3 space-y-3",children:[p.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[p.jsxs("div",{children:[p.jsx(we,{className:"text-xs",children:"X"}),p.jsx($e,{type:"number",value:t.x,onChange:a=>n(t.id,{x:Number(a.target.value)||0}),className:"h-8 text-sm"})]}),p.jsxs("div",{children:[p.jsx(we,{className:"text-xs",children:"Y"}),p.jsx($e,{type:"number",value:t.y,onChange:a=>n(t.id,{y:Number(a.target.value)||0}),className:"h-8 text-sm"})]})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[p.jsxs("div",{children:[p.jsx(we,{className:"text-xs",children:"Width"}),p.jsx($e,{type:"number",value:t.width,onChange:a=>n(t.id,{width:Math.max(1,Number(a.target.value)||0)}),className:"h-8 text-sm"})]}),p.jsxs("div",{children:[p.jsx(we,{className:"text-xs",children:"Height"}),p.jsx($e,{type:"number",value:t.height,onChange:a=>n(t.id,{height:Math.max(1,Number(a.target.value)||0)}),className:"h-8 text-sm"})]})]}),p.jsxs("div",{children:[p.jsx(we,{className:"text-xs",children:"Rotation"}),p.jsxs(tt,{value:t.rotation,onValueChange:a=>n(t.id,{rotation:a}),children:[p.jsx(nt,{className:"h-8 text-sm",children:p.jsx(rt,{})}),p.jsxs(st,{children:[p.jsx(Ae,{value:"horizontal",children:"horizontal"}),p.jsx(Ae,{value:"vertical",children:"vertical"})]})]})]}),p.jsxs("div",{children:[p.jsx(we,{className:"text-xs",children:"Border"}),p.jsxs(tt,{value:t.border,onValueChange:a=>n(t.id,{border:a}),children:[p.jsx(nt,{className:"h-8 text-sm",children:p.jsx(rt,{})}),p.jsxs(st,{children:[p.jsx(Ae,{value:"none",children:"none"}),p.jsx(Ae,{value:"line",children:"line"}),p.jsx(Ae,{value:"dotted",children:"dotted"})]})]})]}),p.jsx(Tse,{element:t,onChange:a=>n(t.id,{config:{...t.config,...a}})}),i&&p.jsx("div",{className:"pt-4 border-t border-gray-100",children:p.jsx(Ne,{variant:"destructive",className:"w-full",onClick:()=>i(t.id),children:"Delete Element"})})]})})]}):p.jsxs("div",{className:"w-72 shrink-0 border-l border-gray-200 bg-white flex flex-col h-full",children:[p.jsx("div",{className:"px-3 py-2 border-b border-gray-200 font-semibold text-gray-800",children:"Properties (Template)"}),p.jsx(fc,{className:"flex-1",children:p.jsxs("div",{className:"p-3 space-y-3",children:[p.jsxs("div",{children:[p.jsx(we,{className:"text-xs",children:"Template Name"}),p.jsx($e,{value:e.name,onChange:a=>r({name:a.target.value}),className:"h-8 text-sm mt-1"})]}),p.jsxs("div",{children:[p.jsx(we,{className:"text-xs",children:"Label Type"}),p.jsxs(tt,{value:e.labelType,onValueChange:a=>r({labelType:a}),children:[p.jsx(nt,{className:"h-8 text-sm mt-1",children:p.jsx(rt,{})}),p.jsxs(st,{children:[p.jsx(Ae,{value:"PRICE",children:"PRICE"}),p.jsx(Ae,{value:"NUTRITION",children:"NUTRITION"}),p.jsx(Ae,{value:"SHIPPING",children:"SHIPPING"})]})]})]}),p.jsxs("div",{children:[p.jsx(we,{className:"text-xs",children:"Applied Location"}),p.jsxs(tt,{value:e.appliedLocation,onValueChange:a=>r({appliedLocation:a}),children:[p.jsx(nt,{className:"h-8 text-sm mt-1",children:p.jsx(rt,{})}),p.jsxs(st,{children:[p.jsx(Ae,{value:"ALL",children:"All Locations"}),p.jsx(Ae,{value:"loc-a",children:"Location A"}),p.jsx(Ae,{value:"loc-b",children:"Location B"})]})]})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[p.jsxs("div",{children:[p.jsx(we,{className:"text-xs",children:"Width"}),p.jsx($e,{type:"number",value:e.width,onChange:a=>r({width:Math.max(.1,Number(a.target.value)||0)}),className:"h-8 text-sm"})]}),p.jsxs("div",{children:[p.jsx(we,{className:"text-xs",children:"Height"}),p.jsx($e,{type:"number",value:e.height,onChange:a=>r({height:Math.max(.1,Number(a.target.value)||0)}),className:"h-8 text-sm"})]})]}),p.jsxs("div",{children:[p.jsx(we,{className:"text-xs",children:"Unit"}),p.jsxs(tt,{value:e.unit,onValueChange:a=>r({unit:a}),children:[p.jsx(nt,{className:"h-8 text-sm mt-1",children:p.jsx(rt,{})}),p.jsxs(st,{children:[p.jsx(Ae,{value:"cm",children:"cm"}),p.jsx(Ae,{value:"inch",children:"inch"})]})]})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(no,{checked:e.showRuler,onCheckedChange:a=>r({showRuler:a})}),p.jsx(we,{className:"text-xs",children:"Show Ruler"})]})]})})]})}function Tse({element:e,onChange:t}){const r=e.config,n=(i,a)=>t({[i]:a});switch(e.type){case"TEXT_STATIC":case"TEXT_PRODUCT":case"TEXT_PRICE":return p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx(we,{className:"text-xs",children:"Text"}),p.jsx($e,{value:r.text??"",onChange:i=>n("text",i.target.value),className:"h-8 text-sm mt-1"})]}),p.jsxs("div",{children:[p.jsx(we,{className:"text-xs",children:"Font Size"}),p.jsx($e,{type:"number",value:r.fontSize??14,onChange:i=>n("fontSize",Number(i.target.value)||14),className:"h-8 text-sm mt-1"})]}),p.jsxs("div",{children:[p.jsx(we,{className:"text-xs",children:"Text Align"}),p.jsxs(tt,{value:r.textAlign??"left",onValueChange:i=>n("textAlign",i),children:[p.jsx(nt,{className:"h-8 text-sm mt-1",children:p.jsx(rt,{})}),p.jsxs(st,{children:[p.jsx(Ae,{value:"left",children:"Left"}),p.jsx(Ae,{value:"center",children:"Center"}),p.jsx(Ae,{value:"right",children:"Right"})]})]})]})]});case"BARCODE":return p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx(we,{className:"text-xs",children:"Data"}),p.jsx($e,{value:r.data??"",onChange:i=>n("data",i.target.value),className:"h-8 text-sm mt-1"})]}),p.jsxs("div",{children:[p.jsx(we,{className:"text-xs",children:"方向"}),p.jsxs(tt,{value:r.orientation??"horizontal",onValueChange:i=>n("orientation",i),children:[p.jsx(nt,{className:"h-8 text-sm mt-1",children:p.jsx(rt,{})}),p.jsxs(st,{children:[p.jsx(Ae,{value:"horizontal",children:"水平"}),p.jsx(Ae,{value:"vertical",children:"竖排"})]})]})]})]});case"QRCODE":return p.jsxs("div",{children:[p.jsx(we,{className:"text-xs",children:"Data (URL)"}),p.jsx($e,{value:r.data??"",onChange:i=>n("data",i.target.value),className:"h-8 text-sm mt-1"})]});case"WEIGHT":return p.jsxs("div",{children:[p.jsx(we,{className:"text-xs",children:"Value"}),p.jsx($e,{type:"number",value:r.value??0,onChange:i=>n("value",Number(i.target.value)||0),className:"h-8 text-sm mt-1"})]});default:return p.jsxs("div",{className:"text-xs text-gray-500",children:["Config for ",e.type," (edit in code if needed)"]})}}const kse=.5,Rse=2,lR=.25,Mse=1;function Ise({templateId:e,initialTemplate:t,onClose:r,onSaved:n}){const[i,a]=P.useState(()=>t?{...t}:Hae(e??void 0)),[s,u]=P.useState(null),[f,c]=P.useState(Mse),[d,h]=P.useState(!1),m=i.elements.find(E=>E.id===s)??null,g=P.useCallback((E,C)=>{const A=Vae(E,30,30);C&&Object.keys(C).length>0&&(A.config={...A.config,...C}),a(N=>({...N,elements:[...N.elements,A]})),u(A.id)},[]),b=P.useCallback((E,C)=>{a(A=>({...A,elements:A.elements.map(N=>N.id===E?{...N,...C}:N)}))},[]),y=P.useCallback(E=>{a(C=>({...C,elements:C.elements.filter(A=>A.id!==E)})),u(null)},[]),w=P.useCallback(E=>{a(C=>({...C,...E}))},[]),S=P.useCallback(()=>{Kae(i),n(),r()},[i,n,r]),O=P.useCallback(()=>{const E=new Blob([JSON.stringify(i,null,2)],{type:"application/json"}),C=URL.createObjectURL(E),A=document.createElement("a");A.href=C,A.download=`label-template-${i.id}.json`,A.click(),URL.revokeObjectURL(C)},[i]);return p.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[p.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-gray-200 bg-white shrink-0",children:[p.jsxs(Ne,{variant:"outline",size:"sm",onClick:r,children:[p.jsx(sB,{className:"w-4 h-4 mr-1"}),"Back"]}),p.jsx("span",{className:"text-sm font-medium text-gray-700 truncate flex-1",children:i.name}),p.jsxs(Ne,{size:"sm",onClick:O,variant:"outline",children:[p.jsx(Y1,{className:"w-4 h-4 mr-1"}),"Export JSON"]}),p.jsxs(Ne,{size:"sm",className:"bg-blue-600 hover:bg-blue-700 text-white",onClick:S,children:[p.jsx(o8,{className:"w-4 h-4 mr-1"}),"Save"]})]}),p.jsxs("div",{className:"flex flex-1 min-h-0",children:[p.jsx(woe,{onAddElement:g}),p.jsx(yse,{template:i,selectedId:s,onSelect:u,onUpdateElement:b,onDeleteElement:y,onTemplateChange:w,scale:f,onZoomIn:()=>c(E=>Math.min(Rse,E+lR)),onZoomOut:()=>c(E=>Math.max(kse,E-lR)),onPreview:()=>h(!0)}),p.jsx(na,{open:d,onOpenChange:h,children:p.jsxs(ia,{className:"max-w-[90vw] max-h-[90vh] overflow-auto",children:[p.jsx(aa,{children:p.jsx(oa,{children:"标签预览"})}),p.jsx(xse,{template:i,maxWidth:500})]})}),p.jsx(Cse,{template:i,selectedElement:m,onTemplateChange:w,onElementChange:b,onDeleteElement:y})]})]})}function Dse(){const[e,t]=P.useState(()=>ak()),[r,n]=P.useState("list"),[i,a]=P.useState(null),[s,u]=P.useState(""),[f,c]=P.useState("all"),d=P.useCallback(()=>{t(ak())},[]);P.useEffect(()=>{r==="list"&&d()},[r,d]);const h=e.filter(y=>{const w=!s||y.name.toLowerCase().includes(s.toLowerCase()),S=f==="all"||y.appliedLocation===f;return w&&S}),m=()=>{},g=y=>{a(y),n("editor")},b=()=>{n("list"),a(null)};if(r==="editor"){const y=i?T$(i):null;return p.jsx("div",{className:"h-[calc(100vh-8rem)] min-h-[500px] flex flex-col",children:p.jsx(Ise,{templateId:i,initialTemplate:y,onClose:b,onSaved:d})})}return p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[p.jsx($e,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500",value:s,onChange:y=>u(y.target.value)}),p.jsxs(tt,{value:f,onValueChange:c,children:[p.jsx(nt,{className:"bg-white border border-gray-300 rounded-md w-[200px] shrink-0",style:{height:40,boxSizing:"border-box"},children:p.jsx(rt,{placeholder:"Location"})}),p.jsxs(st,{children:[p.jsx(Ae,{value:"all",children:"All Locations"}),p.jsx(Ae,{value:"ALL",children:"ALL"}),p.jsx(Ae,{value:"loc-a",children:"Location A"}),p.jsx(Ae,{value:"loc-b",children:"Location B"})]})]}),p.jsxs(Ne,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0 ml-auto",onClick:m,children:["New Label Template ",p.jsx(Ur,{className:"ml-1 w-4 h-4"})]})]}),p.jsxs("div",{className:"text-red-600 font-bold italic text-sm md:text-base",children:["***One or more templates have incomplete labels attached to them.",p.jsx("br",{}),"Go to Labels view to see which labels are missing fields."]}),p.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:p.jsxs(br,{children:[p.jsx(wr,{children:p.jsxs(Qe,{className:"bg-gray-50 hover:bg-gray-50",children:[p.jsx(ge,{className:"font-bold text-gray-900 w-[180px]",children:"Label Template"}),p.jsx(ge,{className:"font-bold text-gray-900 w-[120px]",children:"Location"}),p.jsx(ge,{className:"font-bold text-gray-900",children:"Contents"}),p.jsx(ge,{className:"font-bold text-gray-900 w-[150px]",children:"Size"}),p.jsx(ge,{className:"font-bold text-gray-900 w-[100px]",children:"Actions"})]})}),p.jsx(_r,{children:h.length===0?p.jsx(Qe,{children:p.jsx(fe,{colSpan:5,className:"text-center text-gray-500 py-8",children:'No templates yet. Click "New Label Template" to create one.'})}):h.map(y=>p.jsxs(Qe,{className:"hover:bg-gray-50 cursor-pointer",onClick:()=>g(y.id),children:[p.jsx(fe,{className:"font-medium",children:y.name}),p.jsx(fe,{children:y.appliedLocation}),p.jsxs(fe,{className:"text-sm text-gray-600",children:[y.elements.length," element(s)"]}),p.jsxs(fe,{children:[y.width,"×",y.height," ",y.unit]}),p.jsx(fe,{onClick:w=>w.stopPropagation(),children:p.jsxs(Ne,{variant:"outline",size:"sm",onClick:()=>g(y.id),children:[p.jsx(jd,{className:"w-3 h-3 mr-1"}),"Edit"]})})]},y.id))})]})})]})}function Lse(){const e=[{id:1,name:"Prepped By",contents:"A. Smith; B. Doe; C. Borne",lastEdited:"2025.12.03.11:45"},{id:2,name:"Checked By",contents:"D. Manager; E. Supervisor",lastEdited:"2025.12.04.09:30"},{id:3,name:"Allergens",contents:"Peanuts; Dairy; Gluten; Soy",lastEdited:"2025.12.05.14:15"}];return p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[p.jsx($e,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500"}),p.jsxs(tt,{defaultValue:"all",children:[p.jsx(nt,{className:"bg-white border border-gray-300 rounded-md w-[200px] shrink-0",style:{height:40,boxSizing:"border-box"},children:p.jsx(rt,{placeholder:"Location"})}),p.jsxs(st,{children:[p.jsx(Ae,{value:"all",children:"All Locations"}),p.jsx(Ae,{value:"loc-a",children:"Location A"}),p.jsx(Ae,{value:"loc-b",children:"Location B"})]})]}),p.jsxs(Ne,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0 ml-auto",children:["New Multiple Options ",p.jsx(Ur,{className:"ml-1 h-4 w-4"})]})]}),p.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:p.jsxs(br,{children:[p.jsx(wr,{children:p.jsxs(Qe,{className:"bg-gray-50 hover:bg-gray-50",children:[p.jsx(ge,{className:"font-bold text-gray-900 w-[200px]",children:"Multiple Option Name"}),p.jsx(ge,{className:"font-bold text-gray-900",children:"Contents"}),p.jsx(ge,{className:"font-bold text-gray-900 w-[180px]",children:"Last Edited"})]})}),p.jsx(_r,{children:e.map(t=>p.jsxs(Qe,{className:"hover:bg-gray-50",children:[p.jsx(fe,{className:"font-medium",children:t.name}),p.jsx(fe,{className:"text-gray-600",children:t.contents}),p.jsx(fe,{className:"text-gray-500 tabular-nums font-numeric",children:t.lastEdited})]},t.id))})]})})]})}function $se({currentView:e="Labels",onViewChange:t}){const r=["Labels","Label Categories","Label Types","Label Templates","Multiple Options"],n=i=>{t&&t(i)};return p.jsxs("div",{className:"space-y-6",children:[p.jsx("div",{className:"w-full border-b border-gray-200",children:p.jsx("div",{className:"flex overflow-x-auto bg-white",children:r.map(i=>p.jsx("div",{onClick:()=>n(i),style:e===i?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:`px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px ${e===i?"text-blue-600":"border-b-2 border-b-transparent text-gray-600 hover:text-gray-800"}`,children:i},i))})}),p.jsxs("div",{className:"min-h-[400px]",children:[e==="Labels"&&p.jsx($ae,{}),e==="Label Categories"&&p.jsx(Bae,{}),e==="Label Types"&&p.jsx(zae,{}),e==="Label Templates"&&p.jsx(Dse,{}),e==="Multiple Options"&&p.jsx(Lse,{}),!["Labels","Label Categories","Label Types","Label Templates","Multiple Options"].includes(e)&&p.jsxs("div",{className:"flex items-center justify-center h-64 text-gray-400",children:[e," content coming soon..."]})]})]})}function Bse(){const[e,t]=P.useState([{id:"1",name:"Pop",isOpen:!0,subcategories:[{id:"1-1",name:"2024",isOpen:!0,files:[{id:"f1",name:"uuuuu",date:"10/23/24, 12:21 AM",type:"image"},{id:"f2",name:"664EF167-DFCE-49C1-A417-DC09FEDF78D7.jpg",date:"11/24/25, 8:40 PM",type:"image"}]}]},{id:"2",name:"Training",isOpen:!0,subcategories:[{id:"2-1",name:"BOH",isOpen:!1,files:[]},{id:"2-2",name:"FOH",isOpen:!0,files:[]}]},{id:"3",name:"ww",isOpen:!1,subcategories:[]}]),r=i=>{t(a=>a.map(s=>s.id===i?{...s,isOpen:!s.isOpen}:s))},n=(i,a)=>{t(s=>s.map(u=>u.id!==i?u:{...u,subcategories:u.subcategories.map(f=>f.id===a?{...f,isOpen:!f.isOpen}:f)}))};return p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-center",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx($e,{className:"bg-white border border-black rounded-md h-10 w-[150px]"}),p.jsx("span",{className:"text-sm text-black whitespace-nowrap",children:"Search"})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs(tt,{defaultValue:"all",children:[p.jsx(nt,{className:"bg-white border border-black rounded-md h-10 w-[100px]",children:p.jsx(rt,{placeholder:"Location"})}),p.jsxs(st,{children:[p.jsx(Ae,{value:"all",children:"all"}),p.jsx(Ae,{value:"loc-a",children:"Location A"})]})]}),p.jsx("span",{className:"text-sm text-black whitespace-nowrap",children:"Location"})]})]}),p.jsxs("div",{className:"bg-gray-100 p-2 flex justify-between items-center border-b border-gray-200",children:[p.jsx("h1",{className:"text-xl font-medium text-gray-700",children:"Information"}),p.jsxs("div",{className:"flex items-center gap-4 text-gray-600",children:[p.jsx("div",{className:"flex items-center gap-1 bg-gray-700 text-white text-[10px] px-1 py-0.5 rounded-sm font-bold",children:"NEW"}),p.jsx(h8,{className:"h-5 w-5"}),p.jsx("span",{className:"font-medium",children:"55789"})]})]}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("button",{className:"w-full bg-[#2c7bb6] hover:bg-[#256b9e] text-white py-2 px-4 flex items-center gap-2 text-sm font-medium rounded-sm",children:[p.jsx(Ur,{className:"h-4 w-4"}),"New Category",p.jsx(cb,{className:"h-4 w-4 opacity-70"})]}),p.jsx("div",{className:"space-y-4",children:e.map(i=>p.jsxs("div",{className:"border border-gray-300 rounded-sm overflow-hidden",children:[p.jsxs("div",{className:"bg-gradient-to-b from-gray-50 to-gray-100 border-b border-gray-200 p-2 flex items-center justify-between",children:[p.jsxs("button",{onClick:()=>r(i.id),className:"flex items-center gap-2 text-gray-700 font-medium text-sm flex-1 text-left",children:[i.isOpen?p.jsx(cc,{className:"h-4 w-4 text-[#2c7bb6]"}):p.jsx(Cd,{className:"h-4 w-4 text-[#2c7bb6]"}),i.name]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:p.jsx(jd,{className:"h-4 w-4"})}),p.jsx("button",{className:"text-red-400 hover:text-red-600",children:p.jsx(ec,{className:"h-4 w-4"})})]})]}),i.isOpen&&p.jsxs("div",{className:"p-2 space-y-3 bg-white",children:[p.jsxs("button",{className:"w-full bg-[#2c7bb6] hover:bg-[#256b9e] text-white py-2 px-4 flex items-center gap-2 text-sm font-medium rounded-sm",children:[p.jsx(Ur,{className:"h-4 w-4"}),"New Subcategory",p.jsx(cb,{className:"h-4 w-4 opacity-70"})]}),p.jsxs("div",{className:"space-y-3",children:[i.subcategories.map(a=>p.jsxs("div",{className:"border border-gray-200 rounded-sm",children:[p.jsxs("div",{className:"bg-white border-b border-gray-200 p-2 flex items-center justify-between",children:[p.jsxs("button",{onClick:()=>n(i.id,a.id),className:"flex items-center gap-2 text-gray-700 font-medium text-sm flex-1 text-left",children:[a.isOpen?p.jsx(cc,{className:"h-4 w-4 text-[#2c7bb6]"}):p.jsx(Cd,{className:"h-4 w-4 text-[#2c7bb6]"}),a.name]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:p.jsx(jd,{className:"h-4 w-4"})}),p.jsx("button",{className:"text-red-400 hover:text-red-600",children:p.jsx(ec,{className:"h-4 w-4"})})]})]}),a.isOpen&&p.jsxs("div",{className:"p-3 bg-gray-50/50",children:[p.jsx("div",{className:"mb-2 text-xs font-bold text-gray-500 uppercase tracking-wide",children:"Files"}),p.jsxs("div",{className:"flex flex-wrap gap-2 mb-3 justify-end",children:[p.jsx(Ne,{size:"sm",className:"h-8 bg-[#4CAF50] hover:bg-[#43a047] text-white text-xs border-none rounded-sm",children:"Upload Your Own File(s)"}),p.jsx(Ne,{size:"sm",className:"h-8 bg-[#4CAF50] hover:bg-[#43a047] text-white text-xs border-none rounded-sm",children:"Create A Custom File"}),p.jsx(Ne,{size:"sm",className:"h-8 bg-[#2c7bb6] hover:bg-[#256b9e] text-white text-xs border-none rounded-sm",children:"Edit File Permissions"}),p.jsxs(Ne,{size:"sm",className:"h-8 bg-[#2c7bb6] hover:bg-[#256b9e] text-white text-xs border-none rounded-sm gap-1",children:["Sort (A-Z) ",p.jsx(cB,{className:"h-3 w-3"})]})]}),p.jsx("div",{className:"space-y-1",children:a.files.length>0?a.files.map(s=>p.jsxs("div",{className:"flex items-center bg-gray-200/50 p-2 border border-gray-200 rounded-sm text-sm hover:bg-gray-200 transition-colors",children:[p.jsx("div",{className:"flex-shrink-0 mr-3",children:s.type==="image"?p.jsx(Ia,{className:"h-5 w-5 text-[#2c7bb6]"}):p.jsx(uc,{className:"h-5 w-5 text-[#2c7bb6]"})}),p.jsx("div",{className:"flex-1 min-w-0",children:p.jsx("div",{className:"font-medium text-gray-700 truncate",children:s.name})}),p.jsx("div",{className:"text-xs text-gray-500 mr-4 whitespace-nowrap",children:s.date}),p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("button",{className:"p-1 text-gray-400 hover:text-gray-600 bg-white border border-gray-300 rounded-sm",children:p.jsx(uc,{className:"h-3 w-3"})}),p.jsx("button",{className:"p-1 text-gray-400 hover:text-gray-600 bg-white border border-gray-300 rounded-sm",children:p.jsx(jd,{className:"h-3 w-3"})}),p.jsx("button",{className:"p-1 text-red-400 hover:text-red-600 bg-white border border-gray-300 rounded-sm",children:p.jsx(ec,{className:"h-3 w-3"})})]})]},s.id)):p.jsx("div",{className:"p-4 border-2 border-dashed border-gray-300 rounded-sm text-center text-gray-400 text-sm",children:"No files in this subcategory"})})]})]},a.id)),i.subcategories.length===0&&p.jsx("div",{className:"p-2 text-sm text-gray-400 italic",children:"No subcategories"})]})]})]},i.id))})]})]})}const zse=[{id:1,title:"Coffee - 2 hrs",subtitle:"1 min - Completes at 12:05 PM",totalTime:7200,remainingTime:0,status:"expired",icon:CB},{id:2,title:"Clean Tablet",subtitle:"1 hrs - Completes at 12:37 PM",totalTime:3600,remainingTime:237,status:"running",icon:v8},{id:3,title:"Replace Sanitizer Towels",subtitle:"1 hrs - Completes at 12:37 PM",totalTime:3600,remainingTime:238,status:"running",icon:Aj},{id:4,title:"Take Out Trash",subtitle:"1 hrs - Completes at 01:03 PM",totalTime:3600,remainingTime:58,status:"running",icon:Aj},{id:5,title:"Change Utensils",subtitle:"1 hrs - Completes at 01:03 PM",totalTime:3600,remainingTime:58,status:"running",icon:C8},{id:6,title:"Sanitize Surfaces",subtitle:"1 hrs - Completes at 02:00 PM",totalTime:3600,remainingTime:2157,status:"running",icon:Uv},{id:7,title:"Check Temperatures",subtitle:"1 hrs - Completes at 02:00 PM",totalTime:3600,remainingTime:2158,status:"running",icon:Uv},{id:8,title:"Ranch 4 hrs",subtitle:"4 hrs - Completes at 04:04 PM",totalTime:14400,remainingTime:2158,status:"running",icon:Uv}];function Fse({timer:e}){const t=(e.totalTime-e.remainingTime)/e.totalTime*100,r=e.remainingTime===0,n=i=>{if(i<=0)return"0s";const a=Math.floor(i/60),s=i%60;return`${a.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`};return p.jsxs("div",{className:"bg-gray-200 rounded-xl p-4 flex flex-col items-center relative shadow-sm h-[280px]",children:[p.jsxs("div",{className:"text-center mb-2",children:[p.jsx("h3",{className:"text-lg font-medium text-gray-800 leading-tight",children:e.title}),p.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.subtitle})]}),p.jsxs("div",{className:"relative w-32 h-32 my-auto flex items-center justify-center",children:[p.jsxs("svg",{className:"w-full h-full transform -rotate-90",children:[p.jsx("circle",{cx:"64",cy:"64",r:"56",stroke:"white",strokeWidth:"12",fill:"transparent"}),p.jsx("circle",{cx:"64",cy:"64",r:"56",stroke:r?"#ef4444":"#3b82f6",strokeWidth:"12",fill:"transparent",strokeDasharray:351.86,strokeDashoffset:r?0:351.86*(t/100),className:"transition-all duration-1000 ease-linear"})]}),p.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[p.jsx("span",{className:Ie("text-3xl font-bold",r?"text-red-500":"text-gray-800"),children:r?"0s":n(e.remainingTime)}),p.jsx("span",{className:Ie("text-[10px] font-medium uppercase mt-1",r?"text-red-400":"text-gray-400"),children:"Remaining"})]})]}),p.jsxs("div",{className:"w-full flex justify-between items-end mt-2",children:[p.jsx(e8,{className:"w-5 h-5 text-blue-700 fill-current"}),p.jsx("div",{className:"flex flex-col items-center",children:p.jsx("div",{className:"w-10 h-10 rounded-full border-2 border-gray-300 flex items-center justify-center text-gray-400 mb-1",children:p.jsx(e.icon,{className:"w-5 h-5"})})}),p.jsx("div",{className:"flex flex-col items-end",children:p.jsx("span",{className:"text-xs text-blue-600 font-bold mb-2 cursor-pointer",children:"EDIT"})})]}),p.jsx("button",{className:"absolute bottom-12 right-4 bg-blue-600 rounded-full p-1 text-white hover:bg-blue-700 shadow-md",children:p.jsx(ec,{className:"w-4 h-4"})})]})}function qse(){const[e,t]=P.useState(!0);return p.jsxs("div",{className:"h-full flex flex-col bg-gray-50 relative",children:[p.jsxs("div",{className:"bg-white border-b border-gray-200 px-4 py-3 flex items-center justify-between shadow-sm z-10",children:[p.jsxs("div",{className:"flex items-center gap-4",children:[p.jsxs("button",{className:"flex items-center text-blue-500 text-lg font-medium",children:[p.jsx(_B,{className:"w-6 h-6"}),"Back"]}),p.jsx(XB,{className:"w-6 h-6 text-gray-500"})]}),p.jsxs("div",{className:"flex flex-col items-center",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"bg-blue-600 p-1.5 rounded-md",children:p.jsx(x8,{className:"w-5 h-5 text-white"})}),p.jsx("h1",{className:"text-xl font-bold text-blue-900",children:"Timers"})]}),p.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600 font-medium",children:[p.jsx("span",{children:"86016"}),p.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"})]})]}),p.jsxs("div",{className:"flex items-center gap-4 text-blue-500 font-medium",children:[p.jsx(A8,{className:"w-6 h-6 text-gray-400"}),p.jsxs("button",{className:"flex items-center gap-1",children:[p.jsx(Ur,{className:"w-5 h-5"}),"Add Timer"]})]})]}),p.jsxs("div",{className:"bg-gray-700 text-white px-6 py-2 flex items-center justify-between",children:[p.jsx("div",{className:"flex-1"})," ",p.jsx("div",{className:"font-medium",children:"Today, December 15"}),p.jsxs("div",{className:"flex-1 flex justify-end items-center gap-4",children:[p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx(LB,{className:"w-5 h-5 text-gray-300"}),p.jsx(WB,{className:"w-5 h-5 text-gray-500"})]}),p.jsx(nB,{className:"w-5 h-5 text-blue-400"})]})]}),p.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:p.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:zse.map(r=>p.jsx(Fse,{timer:r},r.id))})}),e&&p.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-[1px]",children:p.jsx("div",{className:"bg-black text-white rounded-xl shadow-2xl w-[600px] max-w-full overflow-hidden border border-gray-800",children:p.jsxs("div",{className:"p-8 text-center space-y-6",children:[p.jsx("h2",{className:"text-3xl font-medium text-blue-500",children:"Coffee - 2 hrs"}),p.jsxs("div",{className:"space-y-4 py-4",children:[p.jsx("p",{className:"text-2xl font-light",children:"Timer expired at 12:05 PM"}),p.jsx("p",{className:"text-2xl font-light",children:"Please discard the coffee"})]}),p.jsx("div",{className:"flex justify-end",children:p.jsx("span",{className:"bg-gray-200 text-black text-[10px] px-1 rounded-sm opacity-50",children:"TACT_Img_Timer-Notification@2x"})}),p.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-8",children:[p.jsx(Ne,{onClick:()=>t(!1),className:"bg-blue-700 hover:bg-blue-600 text-white h-14 text-xl font-medium rounded-lg",children:"Mute"}),p.jsx(Ne,{onClick:()=>t(!1),className:"bg-blue-600 hover:bg-blue-500 text-white h-14 text-xl font-medium rounded-lg",children:"Restart"}),p.jsx(Ne,{onClick:()=>t(!1),className:"bg-blue-800 hover:bg-blue-700 text-white h-14 text-xl font-medium rounded-lg",children:"Acknowledge"})]})]})})})]})}var lb="rovingFocusGroup.onEntryFocus",Use={bubbles:!1,cancelable:!0},uu="RovingFocusGroup",[G1,b3,Wse]=xL(uu),[Hse,w3]=gi(uu,[Wse]),[Vse,Gse]=Hse(uu),_3=P.forwardRef((e,t)=>p.jsx(G1.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(G1.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(Kse,{...e,ref:t})})}));_3.displayName=uu;var Kse=P.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...h}=e,m=P.useRef(null),g=Je(t,m),b=Kh(a),[y,w]=Ha({prop:s,defaultProp:u??null,onChange:f,caller:uu}),[S,O]=P.useState(!1),E=ar(c),C=b3(r),A=P.useRef(!1),[N,T]=P.useState(0);return P.useEffect(()=>{const R=m.current;if(R)return R.addEventListener(lb,E),()=>R.removeEventListener(lb,E)},[E]),p.jsx(Vse,{scope:r,orientation:n,dir:b,loop:i,currentTabStopId:y,onItemFocus:P.useCallback(R=>w(R),[w]),onItemShiftTab:P.useCallback(()=>O(!0),[]),onFocusableItemAdd:P.useCallback(()=>T(R=>R+1),[]),onFocusableItemRemove:P.useCallback(()=>T(R=>R-1),[]),children:p.jsx(We.div,{tabIndex:S||N===0?-1:0,"data-orientation":n,...h,ref:g,style:{outline:"none",...e.style},onMouseDown:Fe(e.onMouseDown,()=>{A.current=!0}),onFocus:Fe(e.onFocus,R=>{const I=!A.current;if(R.target===R.currentTarget&&I&&!S){const q=new CustomEvent(lb,Use);if(R.currentTarget.dispatchEvent(q),!q.defaultPrevented){const L=C().filter(K=>K.focusable),D=L.find(K=>K.active),U=L.find(K=>K.id===y),V=[D,U,...L].filter(Boolean).map(K=>K.ref.current);j3(V,d)}}A.current=!1}),onBlur:Fe(e.onBlur,()=>O(!1))})})}),S3="RovingFocusGroupItem",O3=P.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:a,children:s,...u}=e,f=Gi(),c=a||f,d=Gse(S3,r),h=d.currentTabStopId===c,m=b3(r),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:y}=d;return P.useEffect(()=>{if(n)return g(),()=>b()},[n,g,b]),p.jsx(G1.ItemSlot,{scope:r,id:c,focusable:n,active:i,children:p.jsx(We.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...u,ref:t,onMouseDown:Fe(e.onMouseDown,w=>{n?d.onItemFocus(c):w.preventDefault()}),onFocus:Fe(e.onFocus,()=>d.onItemFocus(c)),onKeyDown:Fe(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){d.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const S=Qse(w,d.orientation,d.dir);if(S!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let E=m().filter(C=>C.focusable).map(C=>C.ref.current);if(S==="last")E.reverse();else if(S==="prev"||S==="next"){S==="prev"&&E.reverse();const C=E.indexOf(w.currentTarget);E=d.loop?Zse(E,C+1):E.slice(C+1)}setTimeout(()=>j3(E))}}),children:typeof s=="function"?s({isCurrentTabStop:h,hasTabStop:y!=null}):s})})});O3.displayName=S3;var Xse={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Yse(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Qse(e,t,r){const n=Yse(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Xse[n]}function j3(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function Zse(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Jse=_3,ele=O3,Gp="Tabs",[tle]=gi(Gp,[w3]),E3=w3(),[rle,P_]=tle(Gp),A3=P.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:i,defaultValue:a,orientation:s="horizontal",dir:u,activationMode:f="automatic",...c}=e,d=Kh(u),[h,m]=Ha({prop:n,onChange:i,defaultProp:a??"",caller:Gp});return p.jsx(rle,{scope:r,baseId:Gi(),value:h,onValueChange:m,orientation:s,dir:d,activationMode:f,children:p.jsx(We.div,{dir:d,"data-orientation":s,...c,ref:t})})});A3.displayName=Gp;var P3="TabsList",N3=P.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...i}=e,a=P_(P3,r),s=E3(r);return p.jsx(Jse,{asChild:!0,...s,orientation:a.orientation,dir:a.dir,loop:n,children:p.jsx(We.div,{role:"tablist","aria-orientation":a.orientation,...i,ref:t})})});N3.displayName=P3;var C3="TabsTrigger",T3=P.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:i=!1,...a}=e,s=P_(C3,r),u=E3(r),f=M3(s.baseId,n),c=I3(s.baseId,n),d=n===s.value;return p.jsx(ele,{asChild:!0,...u,focusable:!i,active:d,children:p.jsx(We.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:f,...a,ref:t,onMouseDown:Fe(e.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?s.onValueChange(n):h.preventDefault()}),onKeyDown:Fe(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&s.onValueChange(n)}),onFocus:Fe(e.onFocus,()=>{const h=s.activationMode!=="manual";!d&&!i&&h&&s.onValueChange(n)})})})});T3.displayName=C3;var k3="TabsContent",R3=P.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:i,children:a,...s}=e,u=P_(k3,r),f=M3(u.baseId,n),c=I3(u.baseId,n),d=n===u.value,h=P.useRef(d);return P.useEffect(()=>{const m=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(m)},[]),p.jsx(Un,{present:i||d,children:({present:m})=>p.jsx(We.div,{"data-state":d?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!m,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:m&&a})})});R3.displayName=k3;function M3(e,t){return`${e}-trigger-${t}`}function I3(e,t){return`${e}-content-${t}`}var nle=A3,ile=N3,ale=T3,ole=R3;function D3({className:e,...t}){return p.jsx(nle,{"data-slot":"tabs",className:Ie("flex flex-col gap-2",e),...t})}function L3({className:e,...t}){return p.jsx(ile,{"data-slot":"tabs-list",className:Ie("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-xl p-[3px] flex",e),...t})}function rs({className:e,...t}){return p.jsx(ale,{"data-slot":"tabs-trigger",className:Ie("data-[state=active]:bg-card dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-xl border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function ns({className:e,...t}){return p.jsx(ole,{"data-slot":"tabs-content",className:Ie("flex-1 outline-none",e),...t})}const sle=[{id:"cat1",name:"Dairy",type:"color",value:"#bfdbfe",status:"active"},{id:"cat2",name:"Meat",type:"image",value:"meat.png",status:"active"},{id:"cat3",name:"Bakery",type:"text",value:"Bakery",status:"active"}],lle=[{id:"prod1",locationId:"12345",categoryId:"cat1",categoryName:"Dairy",name:"Whole Milk",productId:"2222222",barcode:"123456789",barcodeType:"EAN-13",status:"active",appearance:{type:"text",value:"Whole Milk"}},{id:"prod2",locationId:"12345",categoryId:"cat2",categoryName:"Meat",name:"Ground Beef",productId:"3333333",barcode:"113456789",barcodeType:"UPC-A",status:"active",appearance:{type:"color",value:"#ef4444"}},{id:"prod3",locationId:"67890",categoryId:"cat3",categoryName:"Bakery",name:"Croissant",productId:"4444444",barcode:"998877665",barcodeType:"EAN-8",status:"inactive",appearance:{type:"image",value:"croissant.jpg"}}];function cle(){const[e,t]=P.useState("products"),[r,n]=P.useState(lle),[i,a]=P.useState(sle),[s,u]=P.useState(!1),[f,c]=P.useState(!1);return p.jsxs("div",{className:"h-full flex flex-col",children:[p.jsxs("div",{className:"pb-4",children:[p.jsxs("div",{className:"flex flex-nowrap items-center gap-3 flex-wrap",children:[p.jsxs("div",{className:"flex items-center w-40 shrink-0 rounded-md border border-gray-300 bg-white overflow-hidden",style:{height:40},children:[p.jsx(Q1,{className:"h-4 w-4 text-gray-400 shrink-0 ml-2.5 pointer-events-none"}),p.jsx($e,{placeholder:"Search...",className:"flex-1 min-w-0 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 py-2 px-2 h-full placeholder:text-gray-500"})]}),p.jsxs(tt,{defaultValue:"partner-a",children:[p.jsx(nt,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:p.jsx(rt,{placeholder:"Partner"})}),p.jsx(st,{children:p.jsx(Ae,{value:"partner-a",children:"Partner A"})})]}),p.jsxs(tt,{defaultValue:"group-b",children:[p.jsx(nt,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:p.jsx(rt,{placeholder:"Group"})}),p.jsx(st,{children:p.jsx(Ae,{value:"group-b",children:"Group B"})})]}),p.jsxs(tt,{defaultValue:"loc-12345",children:[p.jsx(nt,{className:"w-[160px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:p.jsx(rt,{placeholder:"Location"})}),p.jsxs(st,{children:[p.jsx(Ae,{value:"loc-12345",children:"Location 12345"}),p.jsx(Ae,{value:"all",children:"All Locations"})]})]}),p.jsxs(tt,{children:[p.jsx(nt,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:p.jsx(rt,{placeholder:"Category"})}),p.jsxs(st,{children:[p.jsx(Ae,{value:"all",children:"All Categories"}),i.map(d=>p.jsx(Ae,{value:d.id,children:d.name},d.id))]})]}),p.jsx("div",{className:"flex-1 min-w-2"}),p.jsxs(Ne,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",children:[p.jsx(j8,{className:"w-4 h-4"})," Bulk Import"]}),p.jsxs(Ne,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",children:[p.jsx(Y1,{className:"w-4 h-4"})," Bulk Export"]}),p.jsxs(Ne,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",children:[p.jsx(Uo,{className:"w-4 h-4"})," Bulk Edit"]}),e==="products"?p.jsxs(Ne,{className:"h-10 rounded-md bg-blue-600 text-white hover:bg-blue-700 font-medium gap-1 shrink-0",onClick:()=>u(!0),children:["New Product ",p.jsx(Ur,{className:"w-4 h-4"})]}):p.jsxs(Ne,{className:"h-10 rounded-md bg-blue-600 text-white hover:bg-blue-700 font-medium gap-1 shrink-0",onClick:()=>c(!0),children:["New Category ",p.jsx(Ur,{className:"w-4 h-4"})]})]}),p.jsx("div",{className:"w-full border-b border-gray-200 mt-4",children:p.jsxs("div",{className:"flex overflow-x-auto w-fit",children:[p.jsx("button",{onClick:()=>t("products"),style:e==="products"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:`px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2 ${e==="products"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"}`,children:"Products"}),p.jsx("button",{onClick:()=>t("categories"),style:e==="categories"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:`px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2 ${e==="categories"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"}`,children:"Categories"})]})})]}),p.jsx("div",{className:"flex-1 overflow-auto pt-6",children:e==="products"?p.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:p.jsxs(br,{children:[p.jsx(wr,{children:p.jsxs(Qe,{className:"bg-gray-100 hover:bg-gray-100",children:[p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Location ID"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Product Category"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Product"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Product ID"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Product Barcode"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Status"}),p.jsx(ge,{className:"text-gray-900 font-bold text-center",children:"Actions"})]})}),p.jsx(_r,{children:r.map(d=>p.jsxs(Qe,{children:[p.jsx(fe,{className:"border-r font-numeric",children:d.locationId}),p.jsx(fe,{className:"border-r text-gray-900 font-medium",children:d.categoryName}),p.jsx(fe,{className:"border-r text-gray-900 font-medium",children:p.jsxs("div",{className:"flex items-center gap-2",children:[d.appearance.type==="color"&&p.jsx("div",{className:"w-4 h-4 rounded-full border border-gray-300 shadow-sm",style:{backgroundColor:d.appearance.value}}),d.appearance.type==="image"&&p.jsx(Ia,{className:"w-4 h-4 text-gray-500"}),d.name]})}),p.jsx(fe,{className:"border-r font-numeric text-gray-600",children:d.productId}),p.jsx(fe,{className:"border-r font-numeric",children:p.jsxs("div",{className:"flex flex-col",children:[p.jsx("span",{className:"text-xs text-gray-400",children:d.barcodeType}),p.jsx("span",{children:d.barcode})]})}),p.jsx(fe,{className:"border-r",children:p.jsx(Rn,{variant:d.status==="active"?"default":"secondary",className:d.status==="active"?"bg-green-600":"bg-gray-400",children:d.status})}),p.jsx(fe,{className:"text-center",children:p.jsx(Ne,{variant:"ghost",size:"icon",className:"h-8 w-8",children:p.jsx(hR,{className:"h-4 w-4"})})})]},d.id))})]})}):p.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:p.jsxs(br,{children:[p.jsx(wr,{children:p.jsxs(Qe,{className:"bg-gray-100 hover:bg-gray-100",children:[p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Category Name"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Display Type"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Preview"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Status"}),p.jsx(ge,{className:"text-gray-900 font-bold text-center",children:"Actions"})]})}),p.jsx(_r,{children:i.map(d=>p.jsxs(Qe,{children:[p.jsx(fe,{className:"border-r font-medium",children:d.name}),p.jsx(fe,{className:"border-r capitalize",children:d.type}),p.jsxs(fe,{className:"border-r",children:[d.type==="color"&&p.jsx("div",{className:"w-8 h-8 rounded-md border border-gray-200 shadow-sm",style:{backgroundColor:d.value}}),d.type==="image"&&p.jsx("div",{className:"w-8 h-8 bg-gray-100 flex items-center justify-center rounded-md border border-gray-200",children:p.jsx(Ia,{className:"w-4 h-4 text-gray-500"})}),d.type==="text"&&p.jsx("div",{className:"w-auto px-2 py-1 bg-gray-100 rounded-md border border-gray-200 text-xs font-medium inline-block",children:d.value})]}),p.jsx(fe,{className:"border-r",children:p.jsx(Rn,{variant:d.status==="active"?"default":"secondary",className:d.status==="active"?"bg-green-600":"bg-gray-400",children:d.status})}),p.jsx(fe,{className:"text-center",children:p.jsx(Ne,{variant:"ghost",size:"icon",className:"h-8 w-8",children:p.jsx(Uo,{className:"h-4 w-4"})})})]},d.id))})]})})}),p.jsx(ule,{open:s,onOpenChange:u,categories:i}),p.jsx(fle,{open:f,onOpenChange:c})]})}function ule({open:e,onOpenChange:t,categories:r}){const[n,i]=P.useState("text");return p.jsx(na,{open:e,onOpenChange:t,children:p.jsxs(ia,{className:"sm:max-w-[600px] max-h-[90vh] overflow-y-auto",children:[p.jsxs(aa,{children:[p.jsx(oa,{children:"Add New Product"}),p.jsx(au,{children:"Create a new product. Fill in the details below."})]}),p.jsxs("div",{className:"grid gap-6 py-4",children:[p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Product Category"}),p.jsxs(tt,{children:[p.jsx(nt,{children:p.jsx(rt,{placeholder:"Select Category"})}),p.jsx(st,{children:r.map(a=>p.jsx(Ae,{value:a.id,children:a.name},a.id))})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Product Name"}),p.jsx($e,{placeholder:"e.g. Whole Milk"})]})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Product ID"}),p.jsx($e,{placeholder:"Internal ID"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Status"}),p.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[p.jsx(no,{defaultChecked:!0}),p.jsx("span",{className:"text-sm text-gray-500",children:"Active"})]})]})]}),p.jsxs("div",{className:"space-y-3 p-4 bg-gray-50 rounded-md border border-gray-100",children:[p.jsxs(we,{className:"flex items-center gap-2",children:[p.jsx(dB,{className:"w-4 h-4"})," Barcode Settings"]}),p.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[p.jsx("div",{className:"col-span-1",children:p.jsxs(tt,{defaultValue:"ean13",children:[p.jsx(nt,{children:p.jsx(rt,{placeholder:"Format"})}),p.jsxs(st,{children:[p.jsx(Ae,{value:"ean13",children:"EAN-13"}),p.jsx(Ae,{value:"upc-a",children:"UPC-A"}),p.jsx(Ae,{value:"code128",children:"Code 128"}),p.jsx(Ae,{value:"qr",children:"QR Code"})]})]})}),p.jsx("div",{className:"col-span-2",children:p.jsx($e,{placeholder:"Barcode Value"})})]}),p.jsx(Ne,{variant:"link",className:"px-0 text-xs h-auto",children:"+ Add another barcode standard"})]}),p.jsxs("div",{className:"space-y-3",children:[p.jsx(we,{children:"App Appearance"}),p.jsxs(D3,{value:n,onValueChange:i,className:"w-full",children:[p.jsxs(L3,{className:"grid w-full grid-cols-3",children:[p.jsxs(rs,{value:"text",className:"flex items-center gap-2",children:[p.jsx(Z1,{className:"w-3 h-3"})," Text"]}),p.jsxs(rs,{value:"color",className:"flex items-center gap-2",children:[p.jsx(pR,{className:"w-3 h-3"})," Color"]}),p.jsxs(rs,{value:"image",className:"flex items-center gap-2",children:[p.jsx(Ia,{className:"w-3 h-3"})," Image"]})]}),p.jsxs(ns,{value:"text",className:"mt-4 space-y-2",children:[p.jsx(we,{children:"Display Text"}),p.jsx($e,{placeholder:"Text to display on button"})]}),p.jsxs(ns,{value:"color",className:"mt-4 space-y-2",children:[p.jsx(we,{children:"Select Color"}),p.jsxs("div",{className:"flex gap-2 flex-wrap",children:[["#ef4444","#f97316","#f59e0b","#84cc16","#10b981","#06b6d4","#3b82f6","#6366f1","#a855f7","#ec4899"].map(a=>p.jsx("button",{className:"w-8 h-8 rounded-full border border-gray-200 shadow-sm hover:scale-110 transition-transform",style:{backgroundColor:a}},a)),p.jsx("button",{className:"w-8 h-8 rounded-full border border-dashed border-gray-400 flex items-center justify-center hover:bg-gray-50",children:p.jsx(Ur,{className:"w-4 h-4 text-gray-400"})})]})]}),p.jsxs(ns,{value:"image",className:"mt-4 space-y-2",children:[p.jsx(we,{children:"Upload Image"}),p.jsxs("div",{className:"border-2 border-dashed border-gray-300 rounded-md p-6 flex flex-col items-center justify-center text-gray-500 hover:bg-gray-50 cursor-pointer",children:[p.jsx(Ia,{className:"w-8 h-8 mb-2 opacity-50"}),p.jsx("span",{className:"text-xs",children:"Click to upload or drag and drop"})]})]})]})]}),p.jsxs("div",{className:"space-y-3 pt-2 border-t border-gray-100",children:[p.jsx(we,{children:"Store Availability"}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx("input",{type:"radio",id:"all-stores",name:"scope",className:"text-blue-600 focus:ring-blue-500",defaultChecked:!0}),p.jsx("label",{htmlFor:"all-stores",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"All Stores in Group"})]}),p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx("input",{type:"radio",id:"specific-stores",name:"scope",className:"text-blue-600 focus:ring-blue-500"}),p.jsx("label",{htmlFor:"specific-stores",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Specific Location(s)"})]})]}),p.jsx("div",{className:"pl-6 pt-2",children:p.jsx(tt,{disabled:!0,children:p.jsx(nt,{className:"h-8 text-sm",children:p.jsx(rt,{placeholder:"Select Locations..."})})})})]})]}),p.jsxs(ro,{children:[p.jsx(Ne,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),p.jsx(Ne,{onClick:()=>t(!1),className:"bg-blue-600 hover:bg-blue-700 text-white",children:"Create Product"})]})]})})}function fle({open:e,onOpenChange:t}){const[r,n]=P.useState("text");return p.jsx(na,{open:e,onOpenChange:t,children:p.jsxs(ia,{className:"sm:max-w-[500px]",children:[p.jsxs(aa,{children:[p.jsx(oa,{children:"Add New Category"}),p.jsx(au,{children:"Create a product category to organize your items."})]}),p.jsxs("div",{className:"grid gap-6 py-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Category Name"}),p.jsx($e,{placeholder:"e.g. Dairy, Meat, Bakery"})]}),p.jsxs("div",{className:"space-y-3",children:[p.jsx(we,{children:"Button Appearance"}),p.jsxs(D3,{value:r,onValueChange:n,className:"w-full",children:[p.jsxs(L3,{className:"grid w-full grid-cols-3",children:[p.jsxs(rs,{value:"text",className:"flex items-center gap-2",children:[p.jsx(Z1,{className:"w-3 h-3"})," Text"]}),p.jsxs(rs,{value:"color",className:"flex items-center gap-2",children:[p.jsx(pR,{className:"w-3 h-3"})," Color"]}),p.jsxs(rs,{value:"image",className:"flex items-center gap-2",children:[p.jsx(Ia,{className:"w-3 h-3"})," Image"]})]}),p.jsxs(ns,{value:"text",className:"mt-4 space-y-2",children:[p.jsx(we,{children:"Display Text"}),p.jsx($e,{placeholder:"Category Name"})]}),p.jsxs(ns,{value:"color",className:"mt-4 space-y-2",children:[p.jsx(we,{children:"Select Color"}),p.jsxs("div",{className:"flex gap-2 flex-wrap",children:[["#bfdbfe","#bbf7d0","#fecaca","#ddd6fe","#fde68a"].map(i=>p.jsx("button",{className:"w-8 h-8 rounded-full border border-gray-200 shadow-sm hover:scale-110 transition-transform",style:{backgroundColor:i}},i)),p.jsx("button",{className:"w-8 h-8 rounded-full border border-dashed border-gray-400 flex items-center justify-center hover:bg-gray-50",children:p.jsx(Ur,{className:"w-4 h-4 text-gray-400"})})]})]}),p.jsxs(ns,{value:"image",className:"mt-4 space-y-2",children:[p.jsx(we,{children:"Upload Icon/Image"}),p.jsxs("div",{className:"border-2 border-dashed border-gray-300 rounded-md p-6 flex flex-col items-center justify-center text-gray-500 hover:bg-gray-50 cursor-pointer",children:[p.jsx(Ia,{className:"w-8 h-8 mb-2 opacity-50"}),p.jsx("span",{className:"text-xs",children:"Click to upload"})]})]})]})]}),p.jsx("div",{className:"grid grid-cols-2 gap-4",children:p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Status"}),p.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[p.jsx(no,{defaultChecked:!0}),p.jsx("span",{className:"text-sm text-gray-500",children:"Active"})]})]})}),p.jsxs("div",{className:"space-y-3 pt-2 border-t border-gray-100",children:[p.jsx(we,{children:"Store Availability"}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx("input",{type:"radio",id:"cat-all-stores",name:"cat-scope",className:"text-blue-600 focus:ring-blue-500",defaultChecked:!0}),p.jsx("label",{htmlFor:"cat-all-stores",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"All Stores in Group"})]}),p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx("input",{type:"radio",id:"cat-specific-stores",name:"cat-scope",className:"text-blue-600 focus:ring-blue-500"}),p.jsx("label",{htmlFor:"cat-specific-stores",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Specific Location(s)"})]})]})]})]}),p.jsxs(ro,{children:[p.jsx(Ne,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),p.jsx(Ne,{onClick:()=>t(!1),className:"bg-blue-600 hover:bg-blue-700 text-white",children:"Create Category"})]})]})})}var Kp="Checkbox",[dle]=gi(Kp),[hle,N_]=dle(Kp);function ple(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:i,disabled:a,form:s,name:u,onCheckedChange:f,required:c,value:d="on",internal_do_not_use_render:h}=e,[m,g]=Ha({prop:r,defaultProp:i??!1,onChange:f,caller:Kp}),[b,y]=P.useState(null),[w,S]=P.useState(null),O=P.useRef(!1),E=b?!!s||!!b.closest("form"):!0,C={checked:m,disabled:a,setChecked:g,control:b,setControl:y,name:u,form:s,value:d,hasConsumerStoppedPropagationRef:O,required:c,defaultChecked:Ki(i)?!1:i,isFormControl:E,bubbleInput:w,setBubbleInput:S};return p.jsx(hle,{scope:t,...C,children:mle(h)?h(C):n})}var $3="CheckboxTrigger",B3=P.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},i)=>{const{control:a,value:s,disabled:u,checked:f,required:c,setControl:d,setChecked:h,hasConsumerStoppedPropagationRef:m,isFormControl:g,bubbleInput:b}=N_($3,e),y=Je(i,d),w=P.useRef(f);return P.useEffect(()=>{const S=a?.form;if(S){const O=()=>h(w.current);return S.addEventListener("reset",O),()=>S.removeEventListener("reset",O)}},[a,h]),p.jsx(We.button,{type:"button",role:"checkbox","aria-checked":Ki(f)?"mixed":f,"aria-required":c,"data-state":H3(f),"data-disabled":u?"":void 0,disabled:u,value:s,...n,ref:y,onKeyDown:Fe(t,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Fe(r,S=>{h(O=>Ki(O)?!0:!O),b&&g&&(m.current=S.isPropagationStopped(),m.current||S.stopPropagation())})})});B3.displayName=$3;var z3=P.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:a,required:s,disabled:u,value:f,onCheckedChange:c,form:d,...h}=e;return p.jsx(ple,{__scopeCheckbox:r,checked:i,defaultChecked:a,disabled:u,required:s,onCheckedChange:c,name:n,form:d,value:f,internal_do_not_use_render:({isFormControl:m})=>p.jsxs(p.Fragment,{children:[p.jsx(B3,{...h,ref:t,__scopeCheckbox:r}),m&&p.jsx(W3,{__scopeCheckbox:r})]})})});z3.displayName=Kp;var F3="CheckboxIndicator",q3=P.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...i}=e,a=N_(F3,r);return p.jsx(Un,{present:n||Ki(a.checked)||a.checked===!0,children:p.jsx(We.span,{"data-state":H3(a.checked),"data-disabled":a.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});q3.displayName=F3;var U3="CheckboxBubbleInput",W3=P.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:s,required:u,disabled:f,name:c,value:d,form:h,bubbleInput:m,setBubbleInput:g}=N_(U3,e),b=Je(r,g),y=__(a),w=y_(n);P.useEffect(()=>{const O=m;if(!O)return;const E=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(E,"checked").set,N=!i.current;if(y!==a&&A){const T=new Event("click",{bubbles:N});O.indeterminate=Ki(a),A.call(O,Ki(a)?!1:a),O.dispatchEvent(T)}},[m,y,a,i]);const S=P.useRef(Ki(a)?!1:a);return p.jsx(We.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??S.current,required:u,disabled:f,name:c,value:d,form:h,...t,tabIndex:-1,ref:b,style:{...t.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});W3.displayName=U3;function mle(e){return typeof e=="function"}function Ki(e){return e==="indeterminate"}function H3(e){return Ki(e)?"indeterminate":e?"checked":"unchecked"}function Jl({className:e,...t}){return p.jsx(z3,{"data-slot":"checkbox",className:Ie("peer border bg-input-background dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:p.jsx(q3,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:p.jsx(dR,{className:"size-3.5"})})})}const vle=[{id:"1",name:"Downtown Store (101)"},{id:"2",name:"Uptown Store (102)"},{id:"3",name:"Airport Kiosk (201)"},{id:"4",name:"Mall Outlet (305)"}],gle=[{id:"r1",name:"Partner Admin",permissions:["all"],notifications:["system_updates","billing"]},{id:"r2",name:"Group Admin",permissions:["manage_users","manage_products","view_reports"],notifications:["new_users"]},{id:"r3",name:"Manager",permissions:["manage_store","view_reports","manage_inventory"],notifications:["label_expiry","low_stock"]},{id:"r4",name:"Team Member",permissions:["view_tasks","print_labels"],notifications:["task_assignment"]}],V3=[{id:"p1",name:"Global Foods Inc.",status:"active",contact:"admin@globalfoods.com",phone:"+1 (555) 100-2000"},{id:"p2",name:"Local Eateries Co.",status:"active",contact:"support@localeateries.com",phone:"+1 (555) 200-3000"}],yle=[{id:"g1",name:"West Coast Region",partner:"Global Foods Inc.",status:"active"},{id:"g2",name:"East Coast Region",partner:"Global Foods Inc.",status:"inactive"}],xle=[{id:"m1",name:"Alice Johnson",role:"Manager",locations:["Downtown Store (101)","Uptown Store (102)"],email:"alice@example.com",phone:"+1 (555) 111-2222",status:"active"},{id:"m2",name:"Bob Smith",role:"Team Member",locations:["Airport Kiosk (201)"],email:"bob@example.com",phone:"+1 (555) 222-3333",status:"active"},{id:"m3",name:"Charlie Brown",role:"Team Member",locations:["Downtown Store (101)"],email:"charlie@example.com",phone:"+1 (555) 333-4444",status:"inactive"}];function ble(){const[e,t]=P.useState("Roles"),[r,n]=P.useState(gle),[i,a]=P.useState(V3),[s,u]=P.useState(yle),[f,c]=P.useState(xle),[d,h]=P.useState(!1),[m,g]=P.useState(!1),[b,y]=P.useState(!1),[w,S]=P.useState(!1),O=()=>{alert(`Exporting ${e} list to PDF...`)},E=()=>{switch(e){case"Roles":h(!0);break;case"Partner":g(!0);break;case"Group":y(!0);break;case"Team Member":S(!0);break}},C=()=>{const N=e==="Team Member";return p.jsxs("div",{className:"flex flex-col gap-4 pb-4",children:[p.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[p.jsx($e,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"border border-gray-300 rounded-md w-40 shrink-0 bg-white placeholder:text-gray-500"}),p.jsx("div",{className:"flex-1"}),N&&p.jsxs(p.Fragment,{children:[p.jsx(Ne,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Import"}),p.jsx(Ne,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Edit"})]}),p.jsx(Ne,{variant:"outline",onClick:O,className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Export (PDF)"}),p.jsx(Ne,{className:"h-10 bg-blue-600 hover:bg-blue-700 text-white rounded-md px-6 font-medium shrink-0",onClick:E,children:"New+"})]}),p.jsx("div",{className:"w-full border-b border-gray-200",children:p.jsx("div",{className:"flex overflow-x-auto w-fit",children:["Roles","Partner","Group","Team Member"].map(T=>p.jsx("button",{onClick:()=>t(T),style:e===T?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:Ie("px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2",e===T?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"),children:T},T))})})]})},A=()=>{switch(e){case"Roles":return p.jsxs(br,{children:[p.jsx(wr,{children:p.jsxs(Qe,{className:"bg-gray-100",children:[p.jsx(ge,{className:"font-bold text-black border-r",children:"Role Name"}),p.jsx(ge,{className:"font-bold text-black border-r",children:"Access Permissions"}),p.jsx(ge,{className:"font-bold text-black border-r",children:"Notifications"}),p.jsx(ge,{className:"font-bold text-black text-center",children:"Actions"})]})}),p.jsx(_r,{children:r.map(N=>p.jsxs(Qe,{children:[p.jsx(fe,{className:"font-medium border-r",children:N.name}),p.jsx(fe,{className:"border-r",children:p.jsx("div",{className:"flex flex-wrap gap-1",children:N.permissions.map(T=>p.jsx(Rn,{variant:"secondary",className:"text-xs bg-blue-100 text-blue-800 hover:bg-blue-100",children:T},T))})}),p.jsx(fe,{className:"border-r",children:p.jsx("div",{className:"flex flex-wrap gap-1",children:N.notifications.map(T=>p.jsx(Rn,{variant:"outline",className:"text-xs border-orange-200 text-orange-700 bg-orange-50",children:T},T))})}),p.jsx(fe,{className:"text-center",children:p.jsx(Ne,{variant:"ghost",size:"sm",children:p.jsx(Uo,{className:"w-4 h-4 text-gray-500"})})})]},N.id))})]});case"Partner":return p.jsxs(br,{children:[p.jsx(wr,{children:p.jsxs(Qe,{className:"bg-gray-100",children:[p.jsx(ge,{className:"font-bold text-black border-r",children:"Partner Name"}),p.jsx(ge,{className:"font-bold text-black border-r",children:"Contact"}),p.jsx(ge,{className:"font-bold text-black border-r",children:"Phone"}),p.jsx(ge,{className:"font-bold text-black border-r",children:"Status"}),p.jsx(ge,{className:"font-bold text-black text-center",children:"Actions"})]})}),p.jsx(_r,{children:i.map(N=>p.jsxs(Qe,{children:[p.jsx(fe,{className:"font-medium border-r",children:N.name}),p.jsx(fe,{className:"border-r",children:N.contact}),p.jsx(fe,{className:"border-r text-gray-600",children:N.phone}),p.jsx(fe,{className:"border-r",children:p.jsx(Rn,{className:N.status==="active"?"bg-green-600":"bg-gray-400",children:N.status})}),p.jsx(fe,{className:"text-center",children:p.jsx(Ne,{variant:"ghost",size:"sm",children:p.jsx(Uo,{className:"w-4 h-4 text-gray-500"})})})]},N.id))})]});case"Group":return p.jsxs(br,{children:[p.jsx(wr,{children:p.jsxs(Qe,{className:"bg-gray-100",children:[p.jsx(ge,{className:"font-bold text-black border-r",children:"Group Name"}),p.jsx(ge,{className:"font-bold text-black border-r",children:"Parent Partner"}),p.jsx(ge,{className:"font-bold text-black border-r",children:"Status"}),p.jsx(ge,{className:"font-bold text-black text-center",children:"Actions"})]})}),p.jsx(_r,{children:s.map(N=>p.jsxs(Qe,{children:[p.jsx(fe,{className:"font-medium border-r",children:N.name}),p.jsx(fe,{className:"border-r",children:N.partner}),p.jsx(fe,{className:"border-r",children:p.jsx(Rn,{className:N.status==="active"?"bg-green-600":"bg-gray-400",children:N.status})}),p.jsx(fe,{className:"text-center",children:p.jsx(Ne,{variant:"ghost",size:"sm",children:p.jsx(Uo,{className:"w-4 h-4 text-gray-500"})})})]},N.id))})]});case"Team Member":return p.jsxs(br,{children:[p.jsx(wr,{children:p.jsxs(Qe,{className:"bg-gray-100",children:[p.jsx(ge,{className:"font-bold text-black border-r",children:"Name"}),p.jsx(ge,{className:"font-bold text-black border-r",children:"Email"}),p.jsx(ge,{className:"font-bold text-black border-r",children:"Phone"}),p.jsx(ge,{className:"font-bold text-black border-r",children:"Role"}),p.jsx(ge,{className:"font-bold text-black border-r",children:"Assigned Locations"}),p.jsx(ge,{className:"font-bold text-black border-r",children:"Status"}),p.jsx(ge,{className:"font-bold text-black text-center",children:"Actions"})]})}),p.jsx(_r,{children:f.map(N=>p.jsxs(Qe,{children:[p.jsx(fe,{className:"font-medium border-r",children:N.name}),p.jsx(fe,{className:"border-r text-gray-600",children:N.email}),p.jsx(fe,{className:"border-r text-gray-600",children:N.phone}),p.jsx(fe,{className:"border-r",children:p.jsx(Rn,{variant:"outline",className:"font-normal",children:N.role})}),p.jsx(fe,{className:"border-r",children:p.jsx("div",{className:"flex flex-col gap-1",children:N.locations.map(T=>p.jsxs("div",{className:"flex items-center gap-1 text-xs text-gray-600",children:[p.jsx(Gh,{className:"w-3 h-3"})," ",T]},T))})}),p.jsx(fe,{className:"border-r",children:p.jsx(Rn,{className:N.status==="active"?"bg-green-600":"bg-gray-400",children:N.status})}),p.jsx(fe,{className:"text-center",children:p.jsx(Ne,{variant:"ghost",size:"sm",children:p.jsx(Uo,{className:"w-4 h-4 text-gray-500"})})})]},N.id))})]})}};return p.jsxs("div",{className:"h-full flex flex-col",children:[C(),p.jsx("div",{className:"flex-1 overflow-auto pt-6",children:p.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md",children:A()})}),p.jsx(wle,{open:d,onOpenChange:h}),p.jsx(_le,{open:m,onOpenChange:g}),p.jsx(Sle,{open:b,onOpenChange:y}),p.jsx(Ole,{open:w,onOpenChange:S,roles:r})]})}function wle({open:e,onOpenChange:t}){return p.jsx(na,{open:e,onOpenChange:t,children:p.jsxs(ia,{className:"sm:max-w-[600px]",children:[p.jsxs(aa,{children:[p.jsx(oa,{children:"Create New Role"}),p.jsx(au,{children:"Define permissions and notification settings for this role."})]}),p.jsxs("div",{className:"space-y-4 py-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Role Name"}),p.jsx($e,{placeholder:"e.g. Inventory Specialist"})]}),p.jsxs("div",{className:"space-y-3",children:[p.jsxs(we,{className:"flex items-center gap-2",children:[p.jsx(u8,{className:"w-4 h-4"})," Access Permissions"]}),p.jsx("div",{className:"grid grid-cols-2 gap-2 p-3 bg-gray-50 rounded border border-gray-100",children:["Manage Labels","Manage Products","Manage People","View Reports","Edit Settings","Approve Batches"].map(r=>p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx(Jl,{id:`perm-${r}`}),p.jsx("label",{htmlFor:`perm-${r}`,className:"text-sm font-medium leading-none cursor-pointer",children:r})]},r))})]}),p.jsxs("div",{className:"space-y-3",children:[p.jsxs(we,{className:"flex items-center gap-2",children:[p.jsx(pB,{className:"w-4 h-4"})," Notifications (Alerts)"]}),p.jsxs("div",{className:"grid grid-cols-1 gap-2 p-3 bg-gray-50 rounded border border-gray-100",children:[p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx(Jl,{id:"notif-expiry",defaultChecked:!0}),p.jsx("label",{htmlFor:"notif-expiry",className:"text-sm font-medium leading-none cursor-pointer",children:"Label Expiry Alerts"})]}),p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx(Jl,{id:"notif-stock"}),p.jsx("label",{htmlFor:"notif-stock",className:"text-sm font-medium leading-none cursor-pointer",children:"Low Stock Alerts"})]}),p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx(Jl,{id:"notif-tasks"}),p.jsx("label",{htmlFor:"notif-tasks",className:"text-sm font-medium leading-none cursor-pointer",children:"New Task Assignments"})]})]})]})]}),p.jsxs(ro,{children:[p.jsx(Ne,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),p.jsx(Ne,{onClick:()=>t(!1),className:"bg-blue-600 text-white hover:bg-blue-700",children:"Save Role"})]})]})})}function _le({open:e,onOpenChange:t}){return p.jsx(na,{open:e,onOpenChange:t,children:p.jsxs(ia,{children:[p.jsx(aa,{children:p.jsx(oa,{children:"Create New Partner"})}),p.jsxs("div",{className:"space-y-4 py-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Partner Name"}),p.jsx($e,{placeholder:"Company Name"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Contact Email"}),p.jsx($e,{placeholder:"admin@partner.com"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Phone Number"}),p.jsx($e,{type:"tel",placeholder:"+1 (555) 000-0000"})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(no,{id:"partner-status",defaultChecked:!0}),p.jsx(we,{htmlFor:"partner-status",children:"Active"})]})]}),p.jsxs(ro,{children:[p.jsx(Ne,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),p.jsx(Ne,{onClick:()=>t(!1),className:"bg-blue-600 text-white hover:bg-blue-700",children:"Save Partner"})]})]})})}function Sle({open:e,onOpenChange:t}){return p.jsx(na,{open:e,onOpenChange:t,children:p.jsxs(ia,{children:[p.jsx(aa,{children:p.jsx(oa,{children:"Create New Group"})}),p.jsxs("div",{className:"space-y-4 py-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Group Name"}),p.jsx($e,{placeholder:"e.g. West Coast Region"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Assign to Partner"}),p.jsxs(tt,{children:[p.jsx(nt,{children:p.jsx(rt,{placeholder:"Select Partner"})}),p.jsx(st,{children:V3.map(r=>p.jsx(Ae,{value:r.id,children:r.name},r.id))})]})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(no,{id:"group-status",defaultChecked:!0}),p.jsx(we,{htmlFor:"group-status",children:"Active"})]})]}),p.jsxs(ro,{children:[p.jsx(Ne,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),p.jsx(Ne,{onClick:()=>t(!1),className:"bg-blue-600 text-white hover:bg-blue-700",children:"Save Group"})]})]})})}function Ole({open:e,onOpenChange:t,roles:r}){return p.jsx(na,{open:e,onOpenChange:t,children:p.jsxs(ia,{className:"sm:max-w-[500px]",children:[p.jsxs(aa,{children:[p.jsx(oa,{children:"Add Team Member / Manager"}),p.jsx(au,{children:"Create a user account and assign them to locations."})]}),p.jsxs("div",{className:"space-y-4 py-4 max-h-[60vh] overflow-y-auto pr-1",children:[p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Full Name"}),p.jsx($e,{placeholder:"John Doe"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Role"}),p.jsxs(tt,{children:[p.jsx(nt,{children:p.jsx(rt,{placeholder:"Select Role"})}),p.jsx(st,{children:r.map(n=>p.jsx(Ae,{value:n.name,children:n.name},n.id))})]})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Password"}),p.jsx($e,{type:"password",placeholder:"Enter password",autoComplete:"new-password",className:"w-full"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Email Address"}),p.jsx($e,{type:"email",placeholder:"john@example.com"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Phone Number"}),p.jsx($e,{type:"tel",placeholder:"+1 (555) 000-0000"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(fc,{className:"h-[120px] w-full border rounded-md p-2",children:p.jsx("div",{className:"space-y-2",children:vle.map(n=>p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx(Jl,{id:`loc-${n.id}`}),p.jsx("label",{htmlFor:`loc-${n.id}`,className:"text-sm cursor-pointer w-full hover:bg-gray-50 p-1 rounded",children:n.name})]},n.id))})}),p.jsx("p",{className:"text-xs text-gray-500",children:"* Users must be assigned to at least one location."})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(no,{id:"member-status",defaultChecked:!0}),p.jsx(we,{htmlFor:"member-status",children:"Active Account"})]})]}),p.jsxs(ro,{children:[p.jsx(Ne,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),p.jsx(Ne,{onClick:()=>t(!1),className:"bg-blue-600 text-white hover:bg-blue-700",children:"Create User"})]})]})})}function jle(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Array(12).fill(0);let K1=1;class Ele{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:n,...i}=t,a=typeof t?.id=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:K1++,s=this.toasts.find(f=>f.id===a),u=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),s?this.toasts=this.toasts.map(f=>f.id===a?(this.publish({...f,...t,id:a,title:n}),{...f,...t,id:a,dismissible:u,title:n}):f):this.addToast({title:n,...i,dismissible:u,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let a=n!==void 0,s;const u=i.then(async c=>{if(s=["resolve",c],z.isValidElement(c))a=!1,this.create({id:n,type:"default",message:c});else if(Ple(c)&&!c.ok){a=!1;const h=typeof r.error=="function"?await r.error(`HTTP error! status: ${c.status}`):r.error,m=typeof r.description=="function"?await r.description(`HTTP error! status: ${c.status}`):r.description,b=typeof h=="object"&&!z.isValidElement(h)?h:{message:h};this.create({id:n,type:"error",description:m,...b})}else if(c instanceof Error){a=!1;const h=typeof r.error=="function"?await r.error(c):r.error,m=typeof r.description=="function"?await r.description(c):r.description,b=typeof h=="object"&&!z.isValidElement(h)?h:{message:h};this.create({id:n,type:"error",description:m,...b})}else if(r.success!==void 0){a=!1;const h=typeof r.success=="function"?await r.success(c):r.success,m=typeof r.description=="function"?await r.description(c):r.description,b=typeof h=="object"&&!z.isValidElement(h)?h:{message:h};this.create({id:n,type:"success",description:m,...b})}}).catch(async c=>{if(s=["reject",c],r.error!==void 0){a=!1;const d=typeof r.error=="function"?await r.error(c):r.error,h=typeof r.description=="function"?await r.description(c):r.description,g=typeof d=="object"&&!z.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:h,...g})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),f=()=>new Promise((c,d)=>u.then(()=>s[0]==="reject"?d(s[1]):c(s[1])).catch(d));return typeof n!="string"&&typeof n!="number"?{unwrap:f}:Object.assign(n,{unwrap:f})},this.custom=(t,r)=>{const n=r?.id||K1++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const en=new Ele,Ale=(e,t)=>{const r=t?.id||K1++;return en.addToast({title:e,...t,id:r}),r},Ple=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Nle=Ale,Cle=()=>en.toasts,Tle=()=>en.getActiveToasts(),kle=Object.assign(Nle,{success:en.success,info:en.info,warning:en.warning,error:en.error,custom:en.custom,message:en.message,promise:en.promise,dismiss:en.dismiss,loading:en.loading},{getHistory:Cle,getToasts:Tle});jle("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");const Rle=[{id:"1-251201",productName:"Whole Milk",category:"Dairy",template:'2"x2" Basic',printedAt:"2024-03-20 09:30 AM",printedBy:"Alice Johnson",location:"Downtown Store (101)",expiryDate:"2024-03-27",status:"Valid"},{id:"2-251201",productName:"Ground Beef",category:"Meat",template:'2"x2" Basic',printedAt:"2024-03-20 10:15 AM",printedBy:"Bob Smith",location:"Uptown Store (102)",expiryDate:"2024-03-23",status:"Valid"},{id:"3-251201",productName:"Croissant",category:"Bakery",template:'2"x2" Basic',printedAt:"2024-03-19 14:00 PM",printedBy:"Charlie Brown",location:"Downtown Store (101)",expiryDate:"2024-03-20",status:"Expired"},{id:"4-251201",productName:"Caesar Salad",category:"Deli",template:`2"x6" G'n'G !!!`,printedAt:"2024-03-18 11:45 AM",printedBy:"Alice Johnson",location:"Downtown Store (101)",expiryDate:"2024-03-21",status:"Expiring Soon"},{id:"5-251201",productName:"Orange Juice",category:"Beverage",template:'2"x2" Basic',printedAt:"2024-03-18 08:20 AM",printedBy:"Bob Smith",location:"Airport Kiosk (201)",expiryDate:"2024-03-25",status:"Valid"}],Mle=[{name:"Dairy",count:450},{name:"Meat",count:320},{name:"Bakery",count:280},{name:"Deli",count:190},{name:"Produce",count:150},{name:"Beverage",count:120}],Ile=[{date:"Mon",count:120},{date:"Tue",count:132},{date:"Wed",count:101},{date:"Thu",count:134},{date:"Fri",count:190},{date:"Sat",count:230},{date:"Sun",count:210}];function Dle(){const[e,t]=P.useState("print-log"),r=n=>{kle.success(`Reprinting label ${n}`,{description:"Watermark 'RePrint' applied."})};return p.jsxs("div",{className:"h-full flex flex-col",children:[p.jsxs("div",{className:"pb-4",children:[p.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[p.jsxs(tt,{defaultValue:"partner-a",children:[p.jsx(nt,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:p.jsx(rt,{placeholder:"Partner"})}),p.jsx(st,{children:p.jsx(Ae,{value:"partner-a",children:"Partner A"})})]}),p.jsxs(tt,{defaultValue:"group-b",children:[p.jsx(nt,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:p.jsx(rt,{placeholder:"Group"})}),p.jsx(st,{children:p.jsx(Ae,{value:"group-b",children:"Group B"})})]}),p.jsxs(tt,{defaultValue:"loc-12345",children:[p.jsx(nt,{className:"w-[160px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:p.jsx(rt,{placeholder:"Location"})}),p.jsxs(st,{children:[p.jsx(Ae,{value:"loc-12345",children:"Downtown Store"}),p.jsx(Ae,{value:"all",children:"All Locations"})]})]}),p.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[p.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Period Search:"}),p.jsxs("div",{className:"flex items-center bg-white border border-gray-300 rounded-md h-10 px-2",style:{minHeight:40},children:[p.jsx(vB,{className:"w-4 h-4 text-gray-500 mr-2 shrink-0"}),p.jsx("input",{type:"date",className:"text-sm outline-none w-32 bg-transparent"}),p.jsx("span",{className:"mx-2 text-gray-400",children:"-"}),p.jsx("input",{type:"date",className:"text-sm outline-none w-32 bg-transparent"})]})]}),p.jsxs("div",{className:"flex items-center w-64 rounded-md border border-gray-300 bg-white overflow-hidden shrink-0",style:{height:40},children:[p.jsx(Q1,{className:"h-4 w-4 text-gray-400 shrink-0 ml-3 pointer-events-none"}),p.jsx($e,{placeholder:"Search Product or Category...",className:"flex-1 min-w-0 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 py-2 px-2 h-full placeholder:text-gray-500"})]}),p.jsx("div",{className:"flex-1 min-w-2"}),p.jsxs(Ne,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",children:[p.jsx(Y1,{className:"w-4 h-4"})," Export Report"]})]}),p.jsx("div",{className:"w-full border-b border-gray-200 mt-4",children:p.jsxs("div",{className:"flex overflow-x-auto w-fit",children:[p.jsx("button",{onClick:()=>t("print-log"),style:e==="print-log"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:Ie("px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2",e==="print-log"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"),children:"Print Log"}),p.jsx("button",{onClick:()=>t("label-report"),style:e==="label-report"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:Ie("px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2",e==="label-report"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"),children:"Label Report"})]})})]}),p.jsxs("div",{className:"flex-1 overflow-auto pt-6",children:[e==="print-log"&&p.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:p.jsxs(br,{children:[p.jsx(wr,{children:p.jsxs(Qe,{className:"bg-gray-100 hover:bg-gray-100",children:[p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Label ID"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Product Name"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Category"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Template"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Printed At"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Printed By"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Location"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Expiry Date"}),p.jsx(ge,{className:"text-gray-900 font-bold text-center",children:"Action"})]})}),p.jsx(_r,{children:Rle.map(n=>p.jsxs(Qe,{children:[p.jsx(fe,{className:"border-r font-numeric text-gray-600",children:n.id}),p.jsx(fe,{className:"border-r font-medium",children:n.productName}),p.jsx(fe,{className:"border-r",children:p.jsx(Rn,{variant:"secondary",className:"bg-blue-50 text-blue-700 hover:bg-blue-50 border-blue-200",children:n.category})}),p.jsx(fe,{className:"border-r text-gray-600 text-sm",children:(()=>{const i=n.template.endsWith(" !!!"),a=i?n.template.slice(0,-4):n.template,s=a.lastIndexOf(" "),u=a.slice(0,s+1),f=a.slice(s+1);return p.jsxs(p.Fragment,{children:[u,p.jsx("span",{className:"font-bold text-gray-900",children:f}),i&&p.jsx("span",{className:"text-red-600",children:" !!!"})]})})()}),p.jsx(fe,{className:"border-r text-gray-600 text-sm font-numeric",children:n.printedAt}),p.jsx(fe,{className:"border-r text-gray-600 text-sm",children:n.printedBy}),p.jsx(fe,{className:"border-r text-gray-600 text-sm font-numeric",children:n.location}),p.jsx(fe,{className:"border-r",children:p.jsx("span",{className:Ie("text-sm font-medium font-numeric",n.status==="Expired"?"text-red-600":n.status==="Expiring Soon"?"text-orange-500":"text-green-600"),children:n.expiryDate})}),p.jsx(fe,{className:"text-center",children:p.jsxs(Ne,{size:"sm",variant:"outline",className:"h-8 gap-1 hover:bg-gray-100 border-gray-300",onClick:()=>r(n.id),children:[p.jsx(mR,{className:"w-3 h-3"})," Reprint"]})})]},n.id))})]})}),e==="label-report"&&p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[p.jsxs(Ir,{children:[p.jsxs(yn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[p.jsx(xn,{className:"text-sm font-medium",children:"Total Labels Printed"}),p.jsx(uc,{className:"h-4 w-4 text-muted-foreground"})]}),p.jsxs(tn,{children:[p.jsx("div",{className:"text-2xl font-bold",children:"2,543"}),p.jsx("p",{className:"text-xs text-muted-foreground",children:"+20.1% from last month"})]})]}),p.jsxs(Ir,{children:[p.jsxs(yn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[p.jsx(xn,{className:"text-sm font-medium",children:"Most Printed Category"}),p.jsx(yB,{className:"h-4 w-4 text-muted-foreground"})]}),p.jsxs(tn,{children:[p.jsx("div",{className:"text-2xl font-bold",children:"Dairy"}),p.jsx("p",{className:"text-xs text-muted-foreground",children:"450 labels generated"})]})]}),p.jsxs(Ir,{children:[p.jsxs(yn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[p.jsx(xn,{className:"text-sm font-medium",children:"Top Product"}),p.jsx(fR,{className:"h-4 w-4 text-muted-foreground"})]}),p.jsxs(tn,{children:[p.jsx("div",{className:"text-2xl font-bold",children:"Whole Milk"}),p.jsx("p",{className:"text-xs text-muted-foreground",children:"182 labels generated"})]})]}),p.jsxs(Ir,{children:[p.jsxs(yn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[p.jsx(xn,{className:"text-sm font-medium",children:"Avg. Daily Prints"}),p.jsx(i8,{className:"h-4 w-4 text-muted-foreground"})]}),p.jsxs(tn,{children:[p.jsx("div",{className:"text-2xl font-bold",children:"85"}),p.jsx("p",{className:"text-xs text-muted-foreground",children:"+12% from last week"})]})]})]}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[p.jsxs(Ir,{className:"col-span-1",children:[p.jsxs(yn,{children:[p.jsx(xn,{children:"Labels by Category"}),p.jsx(Id,{children:"Distribution of printed labels across product categories."})]}),p.jsx(tn,{className:"h-[300px]",children:p.jsx(Gd,{width:"100%",height:"100%",children:p.jsxs(sre,{data:Mle,children:[p.jsx(Rh,{strokeDasharray:"3 3",vertical:!1}),p.jsx(qa,{dataKey:"name",fontSize:12,tickLine:!1,axisLine:!1}),p.jsx(Ua,{fontSize:12,tickLine:!1,axisLine:!1,tickFormatter:n=>`${n}`}),p.jsx(Dr,{}),p.jsx(to,{dataKey:"count",fill:"#facc15",radius:[4,4,0,0]})]})})})]}),p.jsxs(Ir,{className:"col-span-1",children:[p.jsxs(yn,{children:[p.jsx(xn,{children:"Print Volume Trends"}),p.jsx(Id,{children:"Daily label printing volume for the last 7 days."})]}),p.jsx(tn,{className:"h-[300px]",children:p.jsx(Gd,{width:"100%",height:"100%",children:p.jsxs(yL,{data:Ile,children:[p.jsx(Rh,{strokeDasharray:"3 3",vertical:!1}),p.jsx(qa,{dataKey:"date",fontSize:12,tickLine:!1,axisLine:!1}),p.jsx(Ua,{fontSize:12,tickLine:!1,axisLine:!1}),p.jsx(Dr,{}),p.jsx(qs,{type:"monotone",dataKey:"count",stroke:"#dc2626",strokeWidth:2,dot:{r:4},activeDot:{r:6}})]})})})]})]}),p.jsxs(Ir,{children:[p.jsx(yn,{children:p.jsx(xn,{children:"Most Used Products"})}),p.jsx(tn,{children:p.jsxs(br,{children:[p.jsx(wr,{children:p.jsxs(Qe,{children:[p.jsx(ge,{children:"Product Name"}),p.jsx(ge,{children:"Category"}),p.jsx(ge,{className:"text-right",children:"Total Printed"}),p.jsx(ge,{className:"text-right",children:"Usage %"})]})}),p.jsxs(_r,{children:[p.jsxs(Qe,{children:[p.jsx(fe,{className:"font-medium",children:"Whole Milk"}),p.jsx(fe,{children:"Dairy"}),p.jsx(fe,{className:"text-right",children:"182"}),p.jsx(fe,{className:"text-right",children:"7.2%"})]}),p.jsxs(Qe,{children:[p.jsx(fe,{className:"font-medium",children:"Ground Beef 80/20"}),p.jsx(fe,{children:"Meat"}),p.jsx(fe,{className:"text-right",children:"145"}),p.jsx(fe,{className:"text-right",children:"5.7%"})]}),p.jsxs(Qe,{children:[p.jsx(fe,{className:"font-medium",children:"Chicken Breast"}),p.jsx(fe,{children:"Meat"}),p.jsx(fe,{className:"text-right",children:"132"}),p.jsx(fe,{className:"text-right",children:"5.2%"})]}),p.jsxs(Qe,{children:[p.jsx(fe,{className:"font-medium",children:"Sliced Ham"}),p.jsx(fe,{children:"Deli"}),p.jsx(fe,{className:"text-right",children:"98"}),p.jsx(fe,{className:"text-right",children:"3.8%"})]})]})]})})]})]})]})]})}const Lle=[{id:"12345",name:"Downtown Store",street:"123 Main St",city:"New York",state:"NY",country:"USA",zipCode:"10001",phone:"+1 (555) 123-4567",email:"downtown@example.com",gps:"40.7128° N, 74.0060° W",status:"active"},{id:"12335",name:"Uptown Market",street:"456 High St",city:"New York",state:"NY",country:"USA",zipCode:"10002",phone:"+1 (555) 987-6543",email:"uptown@example.com",gps:"40.7580° N, 73.9855° W",status:"active"},{id:"12445",name:"Airport Kiosk",street:"Terminal 4, JFK Airport",city:"Jamaica",state:"NY",country:"USA",zipCode:"11430",phone:"+1 (555) 555-5555",email:"jfk@example.com",gps:"40.6413° N, 73.7781° W",status:"active"},{id:"12555",name:"Suburban Outlet",street:"789 Country Rd",city:"Long Island",state:"NY",country:"USA",zipCode:"11901",phone:"+1 (555) 111-2222",email:"suburb@example.com",gps:"40.8500° N, 73.2000° W",status:"inactive"}];function $le(){const[e,t]=P.useState(!1),[r,n]=P.useState(Lle);return p.jsxs("div",{className:"h-full flex flex-col",children:[p.jsx("div",{className:"pb-4",children:p.jsx("div",{className:"flex flex-col gap-4",children:p.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[p.jsx($e,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"border border-gray-300 rounded-md w-40 shrink-0 bg-white placeholder:text-gray-500"}),p.jsxs(tt,{defaultValue:"partner-a",children:[p.jsx(nt,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:p.jsx(rt,{placeholder:"Partner"})}),p.jsx(st,{children:p.jsx(Ae,{value:"partner-a",children:"Partner A"})})]}),p.jsxs(tt,{defaultValue:"group-b",children:[p.jsx(nt,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:p.jsx(rt,{placeholder:"Group"})}),p.jsx(st,{children:p.jsx(Ae,{value:"group-b",children:"Group B"})})]}),p.jsxs(tt,{defaultValue:"all",children:[p.jsx(nt,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:p.jsx(rt,{placeholder:"Location"})}),p.jsxs(st,{children:[p.jsx(Ae,{value:"all",children:"All Locations"}),p.jsx(Ae,{value:"loc-1",children:"Location 1"})]})]}),p.jsx("div",{className:"flex-1"}),p.jsx(Ne,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Import"}),p.jsx(Ne,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Export"}),p.jsx(Ne,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Edit"}),p.jsx(Ne,{className:"h-10 bg-blue-600 hover:bg-blue-700 text-white rounded-md px-6 font-medium shrink-0",onClick:()=>t(!0),children:"New+"})]})})}),p.jsx("div",{className:"flex-1 overflow-auto pt-6",children:p.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:p.jsxs(br,{children:[p.jsx(wr,{children:p.jsxs(Qe,{className:"bg-gray-100 hover:bg-gray-100",children:[p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Location ID"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Location Name"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Street"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"City"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"State"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Country"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Zip Code"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Phone"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"Email"}),p.jsx(ge,{className:"text-gray-900 font-bold border-r",children:"GPS"}),p.jsx(ge,{className:"text-gray-900 font-bold text-center",children:"Actions"})]})}),p.jsx(_r,{children:r.map(i=>p.jsxs(Qe,{children:[p.jsx(fe,{className:"border-r font-numeric text-gray-600",children:i.id}),p.jsx(fe,{className:"border-r font-medium text-black",children:i.name}),p.jsx(fe,{className:"border-r text-gray-600 max-w-[140px] truncate",children:i.street}),p.jsx(fe,{className:"border-r text-gray-600",children:i.city}),p.jsx(fe,{className:"border-r text-gray-600",children:i.state}),p.jsx(fe,{className:"border-r text-gray-600",children:i.country}),p.jsx(fe,{className:"border-r text-gray-600 font-numeric",children:i.zipCode}),p.jsx(fe,{className:"border-r text-gray-600 whitespace-nowrap",children:i.phone}),p.jsx(fe,{className:"border-r text-gray-600 text-sm",children:i.email}),p.jsx(fe,{className:"border-r text-gray-500 font-numeric text-xs",children:i.gps}),p.jsx(fe,{className:"text-center",children:p.jsx(Ne,{variant:"ghost",size:"icon",className:"h-8 w-8",children:p.jsx(hR,{className:"h-4 w-4 text-gray-500"})})})]},i.id))})]})})}),p.jsx(Ble,{open:e,onOpenChange:t})]})}function Ble({open:e,onOpenChange:t}){return p.jsx(na,{open:e,onOpenChange:t,children:p.jsxs(ia,{className:"sm:max-w-[600px]",children:[p.jsxs(aa,{children:[p.jsx(oa,{children:"Add New Location"}),p.jsx(au,{children:"Enter the details for the new store location."})]}),p.jsxs("div",{className:"grid gap-4 py-4",children:[p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Partner"}),p.jsxs(tt,{defaultValue:"partner-a",children:[p.jsx(nt,{children:p.jsx(rt,{})}),p.jsx(st,{children:p.jsx(Ae,{value:"partner-a",children:"Partner A"})})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Group"}),p.jsxs(tt,{defaultValue:"group-b",children:[p.jsx(nt,{children:p.jsx(rt,{})}),p.jsx(st,{children:p.jsx(Ae,{value:"group-b",children:"Group B"})})]})]})]}),p.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[p.jsxs("div",{className:"space-y-2 col-span-1",children:[p.jsx(we,{children:"Location ID"}),p.jsx($e,{placeholder:"e.g. 12345"})]}),p.jsxs("div",{className:"space-y-2 col-span-2",children:[p.jsx(we,{children:"Location Name"}),p.jsx($e,{placeholder:"e.g. Downtown Store"})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Street"}),p.jsx($e,{placeholder:"e.g. 123 Main St"})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"City"}),p.jsx($e,{placeholder:"e.g. New York"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"State"}),p.jsx($e,{placeholder:"e.g. NY"})]})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Country"}),p.jsx($e,{placeholder:"e.g. USA"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Zip Code"}),p.jsx($e,{placeholder:"e.g. 10001"})]})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Phone Number"}),p.jsx($e,{placeholder:"+1 (555) 000-0000"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(we,{children:"Email"}),p.jsx($e,{placeholder:"store@example.com"})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs(we,{className:"flex items-center gap-2",children:[p.jsx(Gh,{className:"w-4 h-4"})," GPS Coordinates"]}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx($e,{placeholder:"Latitude (e.g. 40.7128)"}),p.jsx($e,{placeholder:"Longitude (e.g. -74.0060)"})]})]}),p.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[p.jsx(no,{id:"loc-status",defaultChecked:!0}),p.jsx(we,{htmlFor:"loc-status",children:"Active Location"})]})]}),p.jsxs(ro,{children:[p.jsx(Ne,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),p.jsx(Ne,{onClick:()=>t(!1),className:"bg-blue-600 text-white hover:bg-blue-700",children:"Create Location"})]})]})})}function zle(){const[e,t]=P.useState("Dashboard"),r=()=>{switch(e){case"Dashboard":return p.jsx(fre,{});case"Training":return p.jsx(Bse,{});case"Alerts":return p.jsx(qse,{});case"Menu Manager":return p.jsx(cle,{});case"Account Management":return p.jsx(ble,{});case"Reports":return p.jsx(Dle,{});case"Location Manager":return p.jsx($le,{});case"Labels":case"Label Categories":case"Label Types":case"Label Templates":case"Multiple Options":return p.jsx($se,{currentView:e,onViewChange:t});default:return p.jsx(dre,{title:e})}};return p.jsx(Oz,{currentView:e,setCurrentView:t,children:r()})}Q5.createRoot(document.getElementById("root")).render(p.jsx(zle,{})); diff --git a/美国版/Food Labeling Management Platform/build/index.html b/美国版/Food Labeling Management Platform/build/index.html index 7b059d5..2866fb4 100644 --- a/美国版/Food Labeling Management Platform/build/index.html +++ b/美国版/Food Labeling Management Platform/build/index.html @@ -1,16 +1,16 @@ - - - - - - - Food Labeling Management Platform - + + + + + + + Food Labeling Management Platform + - - - -
- - + + + +
+ + \ No newline at end of file diff --git a/美国版/Food Labeling Management Platform/src/App.tsx b/美国版/Food Labeling Management Platform/src/App.tsx index 09e0cec..b02f655 100755 --- a/美国版/Food Labeling Management Platform/src/App.tsx +++ b/美国版/Food Labeling Management Platform/src/App.tsx @@ -10,6 +10,7 @@ import { ProductsView } from './components/products/ProductsView'; import { PeopleView } from './components/people/PeopleView'; import { ReportsView } from './components/reports/ReportsView'; import { LocationsView } from './components/locations/LocationsView'; +import { SystemMenuView } from './components/system-menu/SystemMenuView'; export default function App() { const [currentView, setCurrentView] = useState('Dashboard'); @@ -22,8 +23,11 @@ export default function App() { return ; case 'Alerts': return ; - case 'Menu Manager': + case 'Menu Management': + // 还原:Menu Management 对应“商品管理/新增”页面 return ; + case 'System Menu': + return ; case 'Account Management': return ; case 'Reports': diff --git a/美国版/Food Labeling Management Platform/src/components/layout/Sidebar.tsx b/美国版/Food Labeling Management Platform/src/components/layout/Sidebar.tsx index 8749960..f4356f4 100755 --- a/美国版/Food Labeling Management Platform/src/components/layout/Sidebar.tsx +++ b/美国版/Food Labeling Management Platform/src/components/layout/Sidebar.tsx @@ -46,8 +46,10 @@ export function Sidebar({ currentView, setCurrentView }: SidebarProps) { }, { type: 'header', name: 'MANAGEMENT' }, { name: 'Location Manager', icon: MapPin, type: 'item' }, + { type: 'header', name: 'SYSTEM MANAGEMENT' }, { name: 'Account Management', icon: Users, type: 'item' }, - { name: 'Menu Manager', icon: Package, type: 'item' }, + { name: 'Menu Management', icon: Package, type: 'item' }, + { name: 'System Menu', icon: Settings, type: 'item' }, { name: 'Reports', icon: FileText, type: 'item' }, { name: 'Support', icon: HelpCircle, type: 'item' }, { name: 'Log Out', icon: LogOut, type: 'item' }, diff --git a/美国版/Food Labeling Management Platform/src/components/locations/LocationsView.tsx b/美国版/Food Labeling Management Platform/src/components/locations/LocationsView.tsx index 0ed0004..f2ef0e0 100755 --- a/美国版/Food Labeling Management Platform/src/components/locations/LocationsView.tsx +++ b/美国版/Food Labeling Management Platform/src/components/locations/LocationsView.tsx @@ -1,15 +1,5 @@ -import React, { useState } from 'react'; -import { - Search, - Plus, - Download, - Upload, - Edit, - MapPin, - Phone, - Mail, - MoreHorizontal -} from 'lucide-react'; +import React, { useEffect, useMemo, useRef, useState } from "react"; +import { Edit, MapPin, MoreHorizontal } from "lucide-react"; import { Button } from "../ui/button"; import { Input } from "../ui/input"; import { @@ -38,67 +28,152 @@ import { import { Label } from "../ui/label"; import { Badge } from "../ui/badge"; import { Switch } from "../ui/switch"; +import { toast } from "sonner"; +import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip"; +import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover"; +import { + Pagination, + PaginationContent, + PaginationItem, + PaginationLink, + PaginationNext, + PaginationPrevious, +} from "../ui/pagination"; +import { createLocation, deleteLocation, getLocations, updateLocation } from "../../services/locationService"; +import type { LocationCreateInput, LocationDto } from "../../types/location"; -// --- Mock Data --- - -const MOCK_LOCATIONS = [ - { - id: '12345', - name: 'Downtown Store', - street: '123 Main St', - city: 'New York', - state: 'NY', - country: 'USA', - zipCode: '10001', - phone: '+1 (555) 123-4567', - email: 'downtown@example.com', - gps: '40.7128° N, 74.0060° W', - status: 'active' - }, - { - id: '12335', - name: 'Uptown Market', - street: '456 High St', - city: 'New York', - state: 'NY', - country: 'USA', - zipCode: '10002', - phone: '+1 (555) 987-6543', - email: 'uptown@example.com', - gps: '40.7580° N, 73.9855° W', - status: 'active' - }, - { - id: '12445', - name: 'Airport Kiosk', - street: 'Terminal 4, JFK Airport', - city: 'Jamaica', - state: 'NY', - country: 'USA', - zipCode: '11430', - phone: '+1 (555) 555-5555', - email: 'jfk@example.com', - gps: '40.6413° N, 73.7781° W', - status: 'active' - }, - { - id: '12555', - name: 'Suburban Outlet', - street: '789 Country Rd', - city: 'Long Island', - state: 'NY', - country: 'USA', - zipCode: '11901', - phone: '+1 (555) 111-2222', - email: 'suburb@example.com', - gps: '40.8500° N, 73.2000° W', - status: 'inactive' - }, -]; +function toDisplay(v: string | null | undefined): string { + const s = (v ?? "").trim(); + return s ? s : "N/A"; +} + +function formatGps(lat: number | null | undefined, lng: number | null | undefined): string { + if (lat === null || lat === undefined || lng === null || lng === undefined) return "N/A"; + if (!Number.isFinite(lat) || !Number.isFinite(lng)) return "N/A"; + return `${lat}, ${lng}`; +} export function LocationsView() { const [isCreateDialogOpen, setIsCreateDialogOpen] = useState(false); - const [locations, setLocations] = useState(MOCK_LOCATIONS); + const [isEditDialogOpen, setIsEditDialogOpen] = useState(false); + const [isDeleteDialogOpen, setIsDeleteDialogOpen] = useState(false); + const [editingLocation, setEditingLocation] = useState(null); + const [deletingLocation, setDeletingLocation] = useState(null); + const [locations, setLocations] = useState([]); + const [loading, setLoading] = useState(false); + const [total, setTotal] = useState(0); + const [refreshSeq, setRefreshSeq] = useState(0); + const [actionsOpenForId, setActionsOpenForId] = useState(null); + + const [keyword, setKeyword] = useState(""); + const [partner, setPartner] = useState("all"); + const [groupName, setGroupName] = useState("all"); + const [locationPick, setLocationPick] = useState("all"); + + const [pageIndex, setPageIndex] = useState(1); + const [pageSize, setPageSize] = useState(10); + + const abortRef = useRef(null); + const keywordTimerRef = useRef(null); + const [debouncedKeyword, setDebouncedKeyword] = useState(""); + + useEffect(() => { + if (keywordTimerRef.current) window.clearTimeout(keywordTimerRef.current); + keywordTimerRef.current = window.setTimeout(() => setDebouncedKeyword(keyword.trim()), 300); + return () => { + if (keywordTimerRef.current) window.clearTimeout(keywordTimerRef.current); + }; + }, [keyword]); + + // Options derived from current result set (no dedicated endpoints provided in doc). + const partnerOptions = useMemo(() => { + const s = new Set(); + for (const x of locations) { + const v = (x.partner ?? "").trim(); + if (v) s.add(v); + } + return ["all", ...Array.from(s).sort((a, b) => a.localeCompare(b))]; + }, [locations]); + + const groupOptions = useMemo(() => { + const s = new Set(); + for (const x of locations) { + const v = (x.groupName ?? "").trim(); + if (v) s.add(v); + } + return ["all", ...Array.from(s).sort((a, b) => a.localeCompare(b))]; + }, [locations]); + + const locationOptions = useMemo(() => { + const s = new Set(); + for (const x of locations) { + const v = (x.locationCode ?? "").trim(); + if (v) s.add(v); + } + return ["all", ...Array.from(s).sort((a, b) => a.localeCompare(b))]; + }, [locations]); + + const totalPages = Math.max(1, Math.ceil(total / pageSize)); + + useEffect(() => { + // When filter changes, reset to first page. + setPageIndex(1); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [debouncedKeyword, partner, groupName, locationPick, pageSize]); + + useEffect(() => { + const run = async () => { + abortRef.current?.abort(); + const ac = new AbortController(); + abortRef.current = ac; + + setLoading(true); + try { + // 统一约定:SkipCount 传“页码(从1开始)” + const skipCount = Math.max(1, pageIndex); + const effectiveKeyword = locationPick !== "all" ? locationPick : debouncedKeyword; + const res = await getLocations( + { + skipCount, + maxResultCount: pageSize, + keyword: effectiveKeyword || undefined, + partner: partner !== "all" ? partner : undefined, + groupName: groupName !== "all" ? groupName : undefined, + }, + ac.signal, + ); + + setLocations(res.items ?? []); + setTotal(res.totalCount ?? 0); + } catch (e: any) { + if (e?.name === "AbortError") return; + toast.error("Failed to load locations.", { + description: e?.message ? String(e.message) : "Please try again.", + }); + setLocations([]); + setTotal(0); + } finally { + setLoading(false); + } + }; + + run(); + return () => abortRef.current?.abort(); + }, [debouncedKeyword, partner, groupName, locationPick, pageIndex, pageSize, refreshSeq]); + + const refreshList = () => setRefreshSeq((x) => x + 1); + + const openEdit = (loc: LocationDto) => { + setActionsOpenForId(null); + setEditingLocation(loc); + setIsEditDialogOpen(true); + }; + + const openDelete = (loc: LocationDto) => { + setActionsOpenForId(null); + setDeletingLocation(loc); + setIsDeleteDialogOpen(true); + }; return (
@@ -109,49 +184,83 @@ export function LocationsView() {
setKeyword(e.target.value)} style={{ height: 40, boxSizing: 'border-box' }} className="border border-gray-300 rounded-md w-40 shrink-0 bg-white placeholder:text-gray-500" /> - - Partner A + {partnerOptions.map((p) => ( + + {p === "all" ? "Partner (All)" : p} + + ))} - - Group B + {groupOptions.map((g) => ( + + {g === "all" ? "Group (All)" : g} + + ))} - - All Locations - Location 1 + {locationOptions.map((x) => ( + + {x === "all" ? "All Locations" : x} + + ))}
- - - + + + + + + + Not supported yet + + + + + + + + Not supported yet + + + + + + + + Not supported yet +
@@ -163,6 +272,8 @@ export function LocationsView() { + Partner + Group Location ID Location Name Street @@ -173,42 +284,283 @@ export function LocationsView() { Phone Email GPS + Active Actions - {locations.map((loc) => ( - - {loc.id} - {loc.name} - {loc.street} - {loc.city} - {loc.state} - {loc.country} - {loc.zipCode} - {loc.phone} - {loc.email} - {loc.gps} - - + {loading ? ( + + + Loading... + + + ) : locations.length === 0 ? ( + + + No results. - ))} + ) : ( + locations.map((loc) => ( + + {toDisplay(loc.partner)} + {toDisplay(loc.groupName)} + {toDisplay(loc.locationCode ?? loc.id)} + {toDisplay(loc.locationName)} + {toDisplay(loc.street)} + {toDisplay(loc.city)} + {toDisplay(loc.stateCode)} + {toDisplay(loc.country)} + {toDisplay(loc.zipCode)} + {toDisplay(loc.phone)} + {toDisplay(loc.email)} + {formatGps(loc.latitude, loc.longitude)} + + + {loc.state ? "Yes" : "No"} + + + + setActionsOpenForId(open ? loc.id : null)} + > + + + + + + + + + + + )) + )}
- +
+
+
+ Showing {total === 0 ? 0 : (pageIndex - 1) * pageSize + 1}- + {Math.min(pageIndex * pageSize, total)} of {total} +
+
+ + + + + { + e.preventDefault(); + setPageIndex((p) => Math.max(1, p - 1)); + }} + aria-disabled={pageIndex <= 1} + className={pageIndex <= 1 ? "pointer-events-none opacity-50" : ""} + /> + + + e.preventDefault()} + > + Page {pageIndex} / {totalPages} + + + + { + e.preventDefault(); + setPageIndex((p) => Math.min(totalPages, p + 1)); + }} + aria-disabled={pageIndex >= totalPages} + className={pageIndex >= totalPages ? "pointer-events-none opacity-50" : ""} + /> + + + +
+
+
+ + { + // 新增后强制刷新一次列表;如果当前已在第一页也能刷新。 + setPageIndex(1); + refreshList(); + }} + /> + + { + setIsEditDialogOpen(open); + if (!open) setEditingLocation(null); + }} + onUpdated={() => { + // 编辑后强制刷新一次列表 + refreshList(); + }} + /> + + { + setIsDeleteDialogOpen(open); + if (!open) setDeletingLocation(null); + }} + onDeleted={() => { + refreshList(); + }} + /> ); } // --- Sub-components --- -function CreateLocationDialog({ open, onOpenChange }: { open: boolean; onOpenChange: (open: boolean) => void }) { +function CreateLocationDialog({ + open, + onOpenChange, + onCreated, +}: { + open: boolean; + onOpenChange: (open: boolean) => void; + onCreated: () => void; +}) { + const [submitting, setSubmitting] = useState(false); + const [form, setForm] = useState({ + partner: "", + groupName: "", + locationCode: "", + locationName: "", + street: "", + city: "", + stateCode: "", + country: "", + zipCode: "", + phone: "", + email: "", + latitude: null, + longitude: null, + state: true, + }); + + const resetForm = () => { + setForm({ + partner: "", + groupName: "", + locationCode: "", + locationName: "", + street: "", + city: "", + stateCode: "", + country: "", + zipCode: "", + phone: "", + email: "", + latitude: null, + longitude: null, + state: true, + }); + }; + + useEffect(() => { + if (!open) { + resetForm(); + setSubmitting(false); + } + }, [open]); + + const canSubmit = useMemo(() => { + return form.locationCode.trim().length > 0 && form.locationName.trim().length > 0; + }, [form.locationCode, form.locationName]); + + const submit = async () => { + if (!canSubmit) { + toast.error("Please fill in required fields.", { + description: "Location ID and Location Name are required.", + }); + return; + } + setSubmitting(true); + try { + await createLocation({ + ...form, + locationCode: form.locationCode.trim(), + locationName: form.locationName.trim(), + partner: form.partner?.trim() ? form.partner.trim() : null, + groupName: form.groupName?.trim() ? form.groupName.trim() : null, + street: form.street?.trim() ? form.street.trim() : null, + city: form.city?.trim() ? form.city.trim() : null, + stateCode: form.stateCode?.trim() ? form.stateCode.trim() : null, + country: form.country?.trim() ? form.country.trim() : null, + zipCode: form.zipCode?.trim() ? form.zipCode.trim() : null, + phone: form.phone?.trim() ? form.phone.trim() : null, + email: form.email?.trim() ? form.email.trim() : null, + }); + toast.success("Location created.", { + description: "The location has been added successfully.", + }); + onOpenChange(false); + onCreated(); + } catch (e: any) { + toast.error("Failed to create location.", { + description: e?.message ? String(e.message) : "Please try again.", + }); + } finally { + setSubmitting(false); + } + }; + return ( @@ -223,70 +575,104 @@ function CreateLocationDialog({ open, onOpenChange }: { open: boolean; onOpenCha
- + setForm((p) => ({ ...p, partner: e.target.value }))} + />
- + setForm((p) => ({ ...p, groupName: e.target.value }))} + />
- + setForm((p) => ({ ...p, locationCode: e.target.value }))} + />
- + setForm((p) => ({ ...p, locationName: e.target.value }))} + />
- + setForm((p) => ({ ...p, street: e.target.value }))} + />
- + setForm((p) => ({ ...p, city: e.target.value }))} + />
- + setForm((p) => ({ ...p, stateCode: e.target.value }))} + />
- + setForm((p) => ({ ...p, country: e.target.value }))} + />
- + setForm((p) => ({ ...p, zipCode: e.target.value }))} + />
- + setForm((p) => ({ ...p, phone: e.target.value }))} + />
- + setForm((p) => ({ ...p, email: e.target.value }))} + />
@@ -295,13 +681,31 @@ function CreateLocationDialog({ open, onOpenChange }: { open: boolean; onOpenCha GPS Coordinates
- - + { + const raw = e.target.value.trim(); + setForm((p) => ({ ...p, latitude: raw ? Number(raw) : null })); + }} + /> + { + const raw = e.target.value.trim(); + setForm((p) => ({ ...p, longitude: raw ? Number(raw) : null })); + }} + />
- + setForm((p) => ({ ...p, state: v }))} + />
@@ -309,7 +713,346 @@ function CreateLocationDialog({ open, onOpenChange }: { open: boolean; onOpenCha - + + +
+
+ ); +} + +function fromDtoToForm(loc: LocationDto): LocationCreateInput { + return { + partner: loc.partner ?? "", + groupName: loc.groupName ?? "", + locationCode: loc.locationCode ?? "", + locationName: loc.locationName ?? "", + street: loc.street ?? "", + city: loc.city ?? "", + stateCode: loc.stateCode ?? "", + country: loc.country ?? "", + zipCode: loc.zipCode ?? "", + phone: loc.phone ?? "", + email: loc.email ?? "", + latitude: loc.latitude ?? null, + longitude: loc.longitude ?? null, + state: !!loc.state, + }; +} + +function EditLocationDialog({ + open, + location, + onOpenChange, + onUpdated, +}: { + open: boolean; + location: LocationDto | null; + onOpenChange: (open: boolean) => void; + onUpdated: () => void; +}) { + const [submitting, setSubmitting] = useState(false); + const [form, setForm] = useState({ + partner: "", + groupName: "", + locationCode: "", + locationName: "", + street: "", + city: "", + stateCode: "", + country: "", + zipCode: "", + phone: "", + email: "", + latitude: null, + longitude: null, + state: true, + }); + + useEffect(() => { + if (open && location) { + setForm(fromDtoToForm(location)); + setSubmitting(false); + } + if (!open) setSubmitting(false); + }, [open, location]); + + const canSubmit = useMemo(() => { + return form.locationCode.trim().length > 0 && form.locationName.trim().length > 0; + }, [form.locationCode, form.locationName]); + + const submit = async () => { + if (!location?.id) return; + if (!canSubmit) { + toast.error("Please fill in required fields.", { + description: "Location ID and Location Name are required.", + }); + return; + } + + setSubmitting(true); + try { + await updateLocation(location.id, { + ...form, + locationCode: form.locationCode.trim(), + locationName: form.locationName.trim(), + partner: form.partner?.trim() ? form.partner.trim() : null, + groupName: form.groupName?.trim() ? form.groupName.trim() : null, + street: form.street?.trim() ? form.street.trim() : null, + city: form.city?.trim() ? form.city.trim() : null, + stateCode: form.stateCode?.trim() ? form.stateCode.trim() : null, + country: form.country?.trim() ? form.country.trim() : null, + zipCode: form.zipCode?.trim() ? form.zipCode.trim() : null, + phone: form.phone?.trim() ? form.phone.trim() : null, + email: form.email?.trim() ? form.email.trim() : null, + }); + + toast.success("Location updated.", { + description: "The changes have been saved successfully.", + }); + onOpenChange(false); + onUpdated(); + } catch (e: any) { + toast.error("Failed to update location.", { + description: e?.message ? String(e.message) : "Please try again.", + }); + } finally { + setSubmitting(false); + } + }; + + return ( + + + + Edit Location + + Update the details for this store location. + + + +
+
+
+ + setForm((p) => ({ ...p, partner: e.target.value }))} + /> +
+
+ + setForm((p) => ({ ...p, groupName: e.target.value }))} + /> +
+
+ +
+
+ + setForm((p) => ({ ...p, locationCode: e.target.value }))} + /> +
+
+ + setForm((p) => ({ ...p, locationName: e.target.value }))} + /> +
+
+ +
+ + setForm((p) => ({ ...p, street: e.target.value }))} + /> +
+ +
+
+ + setForm((p) => ({ ...p, city: e.target.value }))} + /> +
+
+ + setForm((p) => ({ ...p, stateCode: e.target.value }))} + /> +
+
+ +
+
+ + setForm((p) => ({ ...p, country: e.target.value }))} + /> +
+
+ + setForm((p) => ({ ...p, zipCode: e.target.value }))} + /> +
+
+ +
+
+ + setForm((p) => ({ ...p, phone: e.target.value }))} + /> +
+
+ + setForm((p) => ({ ...p, email: e.target.value }))} + /> +
+
+ +
+ +
+ { + const raw = e.target.value.trim(); + setForm((p) => ({ ...p, latitude: raw ? Number(raw) : null })); + }} + /> + { + const raw = e.target.value.trim(); + setForm((p) => ({ ...p, longitude: raw ? Number(raw) : null })); + }} + /> +
+
+ +
+ setForm((p) => ({ ...p, state: v }))} + /> + +
+
+ + + + + +
+
+ ); +} + +function DeleteLocationDialog({ + open, + location, + onOpenChange, + onDeleted, +}: { + open: boolean; + location: LocationDto | null; + onOpenChange: (open: boolean) => void; + onDeleted: () => void; +}) { + const [submitting, setSubmitting] = useState(false); + + const name = useMemo(() => { + const code = (location?.locationCode ?? "").trim(); + const n = (location?.locationName ?? "").trim(); + if (code && n) return `${code} - ${n}`; + return code || n || "this location"; + }, [location?.locationCode, location?.locationName]); + + const submit = async () => { + if (!location?.id) return; + setSubmitting(true); + try { + await deleteLocation(location.id); + toast.success("Location deleted.", { + description: "The location has been removed successfully.", + }); + onOpenChange(false); + onDeleted(); + } catch (e: any) { + toast.error("Failed to delete location.", { + description: e?.message ? String(e.message) : "Please try again.", + }); + } finally { + setSubmitting(false); + } + }; + + return ( + + + + Delete Location + + This action cannot be undone. + + + +
+ Are you sure you want to delete {name}? +
+ + + +
diff --git a/美国版/Food Labeling Management Platform/src/components/menus/MenuManagementView.tsx b/美国版/Food Labeling Management Platform/src/components/menus/MenuManagementView.tsx new file mode 100644 index 0000000..6bb5dac --- /dev/null +++ b/美国版/Food Labeling Management Platform/src/components/menus/MenuManagementView.tsx @@ -0,0 +1,508 @@ +import React, { useEffect, useMemo, useRef, useState } from "react"; +import { Edit, MoreHorizontal, Plus, Trash2 } from "lucide-react"; +import { toast } from "sonner"; + +import { Button } from "../ui/button"; +import { Input } from "../ui/input"; +import { Label } from "../ui/label"; +import { Switch } from "../ui/switch"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, +} from "../ui/dialog"; +import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover"; +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from "../ui/table"; +import { + Pagination, + PaginationContent, + PaginationItem, + PaginationLink, + PaginationNext, + PaginationPrevious, +} from "../ui/pagination"; + +import { createMenu, deleteMenu, getMenus, updateMenu } from "../../services/menuService"; +import type { MenuCreateInput, MenuDto } from "../../types/menu"; + +function toDisplay(v: string | null | undefined): string { + const s = (v ?? "").trim(); + return s ? s : "N/A"; +} + +function toNumberOrNull(v: string): number | null { + const s = v.trim(); + if (!s) return null; + const n = Number(s); + return Number.isFinite(n) ? n : null; +} + +function formatDateTime(v: string | null | undefined): string { + const s = (v ?? "").trim(); + if (!s) return "N/A"; + const d = new Date(s); + if (Number.isNaN(d.getTime())) return s; + return d.toLocaleString(); +} + +export function MenuManagementView() { + const [menus, setMenus] = useState([]); + const [loading, setLoading] = useState(false); + const [total, setTotal] = useState(0); + const [refreshSeq, setRefreshSeq] = useState(0); + const [actionsOpenForId, setActionsOpenForId] = useState(null); + + const [keyword, setKeyword] = useState(""); + const keywordTimerRef = useRef(null); + const [debouncedKeyword, setDebouncedKeyword] = useState(""); + + const [pageIndex, setPageIndex] = useState(1); + const [pageSize] = useState(10); + + const [isCreateOpen, setIsCreateOpen] = useState(false); + const [isEditOpen, setIsEditOpen] = useState(false); + const [isDeleteOpen, setIsDeleteOpen] = useState(false); + const [editing, setEditing] = useState(null); + const [deleting, setDeleting] = useState(null); + + const abortRef = useRef(null); + + useEffect(() => { + if (keywordTimerRef.current) window.clearTimeout(keywordTimerRef.current); + keywordTimerRef.current = window.setTimeout(() => setDebouncedKeyword(keyword.trim()), 300); + return () => { + if (keywordTimerRef.current) window.clearTimeout(keywordTimerRef.current); + }; + }, [keyword]); + + useEffect(() => { + setPageIndex(1); + }, [debouncedKeyword]); + + const totalPages = Math.max(1, Math.ceil(total / pageSize)); + + useEffect(() => { + const run = async () => { + abortRef.current?.abort(); + const ac = new AbortController(); + abortRef.current = ac; + + setLoading(true); + try { + const skipCount = (pageIndex - 1) * pageSize; + const res = await getMenus( + { + skipCount, + maxResultCount: pageSize, + keyword: debouncedKeyword || undefined, + }, + ac.signal, + ); + setMenus(res.items ?? []); + setTotal(res.totalCount ?? 0); + } catch (e: any) { + if (e?.name === "AbortError") return; + toast.error("Failed to load menus.", { + description: e?.message ? String(e.message) : "Please try again.", + }); + setMenus([]); + setTotal(0); + } finally { + setLoading(false); + } + }; + + run(); + return () => abortRef.current?.abort(); + }, [debouncedKeyword, pageIndex, pageSize, refreshSeq]); + + const refreshList = () => setRefreshSeq((x) => x + 1); + + const openEdit = (m: MenuDto) => { + setActionsOpenForId(null); + setEditing(m); + setIsEditOpen(true); + }; + + const openDelete = (m: MenuDto) => { + setActionsOpenForId(null); + setDeleting(m); + setIsDeleteOpen(true); + }; + + return ( +
+
+
+
+ setKeyword(e.target.value)} + style={{ height: 40, boxSizing: "border-box" }} + className="border border-gray-300 rounded-md w-40 shrink-0 bg-white placeholder:text-gray-500" + /> + +
+ + +
+
+
+ +
+
+ + + + Name + Path + Icon + Order + Parent ID + Enabled + Created At + Actions + + + + + {menus.length === 0 ? ( + + + {loading ? "Loading..." : "No data"} + + + ) : ( + menus.map((m) => ( + + {toDisplay(m.name)} + {toDisplay(m.path)} + {toDisplay(m.icon)} + {m.order ?? "N/A"} + {toDisplay(m.parentId)} + {m.isEnabled ? "Yes" : "No"} + {formatDateTime(m.createdAt)} + + setActionsOpenForId(open ? m.id : null)} + > + + + + +
+ + +
+
+
+
+
+ )) + )} +
+
+
+ +
+
+ {total === 0 ? "0 results" : `${total} results`} +
+ + + + + { + e.preventDefault(); + setPageIndex((p) => Math.max(1, p - 1)); + }} + /> + + {Array.from({ length: Math.min(5, totalPages) }, (_, i) => { + const page = i + 1; + return ( + + { + e.preventDefault(); + setPageIndex(page); + }} + > + {page} + + + ); + })} + + { + e.preventDefault(); + setPageIndex((p) => Math.min(totalPages, p + 1)); + }} + /> + + + +
+
+ + setIsCreateOpen(open)} + onSaved={refreshList} + /> + + setIsEditOpen(open)} + onSaved={refreshList} + /> + + setIsDeleteOpen(open)} + onDeleted={refreshList} + /> +
+ ); +} + +function CreateOrEditMenuDialog({ + mode, + open, + menu, + onOpenChange, + onSaved, +}: { + mode: "create" | "edit"; + open: boolean; + menu: MenuDto | null; + onOpenChange: (open: boolean) => void; + onSaved: () => void; +}) { + const isEdit = mode === "edit"; + const [submitting, setSubmitting] = useState(false); + + const [name, setName] = useState(""); + const [path, setPath] = useState(""); + const [icon, setIcon] = useState(""); + const [order, setOrder] = useState(""); + const [parentId, setParentId] = useState(""); + const [isEnabled, setIsEnabled] = useState(true); + + useEffect(() => { + if (!open) return; + setName(menu?.name ?? ""); + setPath(menu?.path ?? ""); + setIcon(menu?.icon ?? ""); + setOrder(menu?.order === null || menu?.order === undefined ? "" : String(menu.order)); + setParentId(menu?.parentId ?? ""); + setIsEnabled(menu?.isEnabled ?? true); + }, [open, menu]); + + const canSubmit = useMemo(() => { + return Boolean(name.trim() && path.trim()); + }, [name, path]); + + const submit = async () => { + if (!canSubmit) { + toast.error("Please fill in required fields.", { + description: "Name and Path are required.", + }); + return; + } + setSubmitting(true); + try { + const payload: MenuCreateInput = { + name: name.trim(), + path: path.trim(), + icon: icon.trim() ? icon.trim() : null, + order: toNumberOrNull(order), + parentId: parentId.trim() ? parentId.trim() : null, + isEnabled, + }; + + if (isEdit) { + if (!menu?.id) throw new Error("Missing menu id."); + await updateMenu(menu.id, payload); + toast.success("Menu updated.", { description: "Changes have been saved successfully." }); + } else { + await createMenu(payload); + toast.success("Menu created.", { description: "A new menu has been created successfully." }); + } + onOpenChange(false); + onSaved(); + } catch (e: any) { + toast.error(isEdit ? "Failed to update menu." : "Failed to create menu.", { + description: e?.message ? String(e.message) : "Please try again.", + }); + } finally { + setSubmitting(false); + } + }; + + return ( + + + + {isEdit ? "Edit Menu" : "New Menu"} + + {isEdit ? "Update menu fields and save changes." : "Fill out the form to create a new menu."} + + + +
+
+ + setName(e.target.value)} placeholder="e.g. Dashboard" /> +
+ +
+ + setPath(e.target.value)} placeholder="e.g. /dashboard" /> +
+ +
+ + setIcon(e.target.value)} placeholder="e.g. LayoutDashboard" /> +
+ +
+ + setOrder(e.target.value)} placeholder="e.g. 10" /> +
+ +
+ + setParentId(e.target.value)} placeholder="Optional" /> +
+ +
+
Enabled
+ +
+
+ + + + + +
+
+ ); +} + +function DeleteMenuDialog({ + open, + menu, + onOpenChange, + onDeleted, +}: { + open: boolean; + menu: MenuDto | null; + onOpenChange: (open: boolean) => void; + onDeleted: () => void; +}) { + const [submitting, setSubmitting] = useState(false); + + const name = useMemo(() => { + const n = (menu?.name ?? "").trim(); + const p = (menu?.path ?? "").trim(); + if (n && p) return `${n} (${p})`; + return n || p || "this menu"; + }, [menu?.name, menu?.path]); + + const submit = async () => { + if (!menu?.id) return; + setSubmitting(true); + try { + await deleteMenu(menu.id); + toast.success("Menu deleted.", { description: "The menu has been removed successfully." }); + onOpenChange(false); + onDeleted(); + } catch (e: any) { + toast.error("Failed to delete menu.", { + description: e?.message ? String(e.message) : "Please try again.", + }); + } finally { + setSubmitting(false); + } + }; + + return ( + + + + Delete Menu + This action cannot be undone. + + +
+ Are you sure you want to delete {name}? +
+ + + + + +
+
+ ); +} + diff --git a/美国版/Food Labeling Management Platform/src/components/people/PeopleView.tsx b/美国版/Food Labeling Management Platform/src/components/people/PeopleView.tsx index 4b07dee..cc4befa 100755 --- a/美国版/Food Labeling Management Platform/src/components/people/PeopleView.tsx +++ b/美国版/Food Labeling Management Platform/src/components/people/PeopleView.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useEffect, useMemo, useRef, useState } from "react"; import { Search, Plus, @@ -6,13 +6,16 @@ import { Upload, Edit, MoreHorizontal, + ChevronDown, + ChevronRight, + Trash2, FileText, MapPin, Shield, Bell, Check, X -} from 'lucide-react'; +} from "lucide-react"; import { Button } from "../ui/button"; import { Input } from "../ui/input"; import { @@ -39,12 +42,28 @@ import { SelectTrigger, SelectValue, } from "../ui/select"; +import { + Pagination, + PaginationContent, + PaginationItem, + PaginationLink, + PaginationNext, + PaginationPrevious, +} from "../ui/pagination"; import { Label } from "../ui/label"; import { Switch } from "../ui/switch"; import { Badge } from "../ui/badge"; import { Checkbox } from "../ui/checkbox"; import { ScrollArea } from "../ui/scroll-area"; import { cn } from "../ui/utils"; +import { toast } from "sonner"; + +import { getRbacMenuTree } from "../../services/systemMenuService"; +import { deleteRoleMenus, getRoleMenuIds, setRoleMenus } from "../../services/rbacRoleMenuService"; +import type { RbacMenuTreeNode } from "../../types/systemMenu"; +import { getRoles } from "../../services/roleService"; +import { createRbacRole, deleteRbacRole, updateRbacRole } from "../../services/rbacRoleService"; +import type { RoleDto } from "../../types/role"; // --- Mock Data --- @@ -129,13 +148,26 @@ export function PeopleView() { const [activeTab, setActiveTab] = useState('Roles'); // Data States - const [roles, setRoles] = useState(MOCK_ROLES); + const [roles, setRoles] = useState([]); + const [roleTotal, setRoleTotal] = useState(0); + const [rolesLoading, setRolesLoading] = useState(false); + const [roleRefreshSeq, setRoleRefreshSeq] = useState(0); + const [rolePageIndex, setRolePageIndex] = useState(1); + const [rolePageSize, setRolePageSize] = useState(10); + const roleTotalPages = Math.max(1, Math.ceil(roleTotal / rolePageSize)); + const rolesAbortRef = useRef(null); + const [roleKeyword, setRoleKeyword] = useState(""); + const roleKeywordTimerRef = useRef(null); + const [debouncedRoleKeyword, setDebouncedRoleKeyword] = useState(""); const [partners, setPartners] = useState(MOCK_PARTNERS); const [groups, setGroups] = useState(MOCK_GROUPS); const [members, setMembers] = useState(MOCK_MEMBERS); // Dialog States const [isRoleDialogOpen, setIsRoleDialogOpen] = useState(false); + const [editingRole, setEditingRole] = useState(null); + const [isRoleMenuDialogOpen, setIsRoleMenuDialogOpen] = useState(false); + const [menuRole, setMenuRole] = useState(null); const [isPartnerDialogOpen, setIsPartnerDialogOpen] = useState(false); const [isGroupDialogOpen, setIsGroupDialogOpen] = useState(false); const [isMemberDialogOpen, setIsMemberDialogOpen] = useState(false); @@ -145,9 +177,59 @@ export function PeopleView() { alert(`Exporting ${activeTab} list to PDF...`); }; + useEffect(() => { + if (roleKeywordTimerRef.current) window.clearTimeout(roleKeywordTimerRef.current); + roleKeywordTimerRef.current = window.setTimeout(() => setDebouncedRoleKeyword(roleKeyword.trim()), 300); + return () => { + if (roleKeywordTimerRef.current) window.clearTimeout(roleKeywordTimerRef.current); + }; + }, [roleKeyword]); + + useEffect(() => { + setRolePageIndex(1); + }, [debouncedRoleKeyword, rolePageSize]); + + useEffect(() => { + if (activeTab !== "Roles") return; + const run = async () => { + rolesAbortRef.current?.abort(); + const ac = new AbortController(); + rolesAbortRef.current = ac; + + setRolesLoading(true); + try { + const res = await getRoles( + { + skipCount: Math.max(1, rolePageIndex), + maxResultCount: rolePageSize, + roleName: debouncedRoleKeyword || undefined, + }, + ac.signal, + ); + setRoles(res.items ?? []); + setRoleTotal(res.totalCount ?? 0); + } catch (e: any) { + if (e?.name === "AbortError") return; + toast.error("Failed to load roles.", { + description: e?.message ? String(e.message) : "Please try again.", + }); + setRoles([]); + setRoleTotal(0); + } finally { + setRolesLoading(false); + } + }; + + run(); + return () => rolesAbortRef.current?.abort(); + }, [activeTab, debouncedRoleKeyword, rolePageIndex, rolePageSize, roleRefreshSeq]); + const openCreateDialog = () => { switch (activeTab) { - case 'Roles': setIsRoleDialogOpen(true); break; + case 'Roles': + setEditingRole(null); + setIsRoleDialogOpen(true); + break; case 'Partner': setIsPartnerDialogOpen(true); break; case 'Group': setIsGroupDialogOpen(true); break; case 'Team Member': setIsMemberDialogOpen(true); break; @@ -163,6 +245,10 @@ export function PeopleView() {
{ + if (activeTab === "Roles") setRoleKeyword(e.target.value); + }} style={{ height: 40, boxSizing: 'border-box' }} className="border border-gray-300 rounded-md w-40 shrink-0 bg-white placeholder:text-gray-500" /> @@ -216,40 +302,140 @@ export function PeopleView() { switch (activeTab) { case 'Roles': return ( - - - - Role Name - Access Permissions - Notifications - Actions - - - - {roles.map(role => ( - - {role.name} - -
- {role.permissions.map(p => ( - {p} - ))} -
-
- -
- {role.notifications.map(n => ( - {n} - ))} -
-
- - - +
+
+ + + Role Name + Role Code + Status + Order + Actions - ))} - -
+ + + {roles.length === 0 ? ( + + + {rolesLoading ? "Loading..." : "No data"} + + + ) : ( + roles.map((r) => ( + + {r.roleName ?? "N/A"} + {r.roleCode ?? "N/A"} + + + {r.state ? "Active" : "Inactive"} + + + {r.orderNum ?? "N/A"} + + + + + + + )) + )} + + + +
+
+ Showing {roleTotal === 0 ? 0 : (rolePageIndex - 1) * rolePageSize + 1}- + {Math.min(rolePageIndex * rolePageSize, roleTotal)} of {roleTotal} +
+ +
+ + + + + + { + e.preventDefault(); + setRolePageIndex((p) => Math.max(1, p - 1)); + }} + aria-disabled={rolePageIndex <= 1} + className={rolePageIndex <= 1 ? "pointer-events-none opacity-50" : ""} + /> + + + e.preventDefault()}> + Page {rolePageIndex} / {roleTotalPages} + + + + { + e.preventDefault(); + setRolePageIndex((p) => Math.min(roleTotalPages, p + 1)); + }} + aria-disabled={rolePageIndex >= roleTotalPages} + className={rolePageIndex >= roleTotalPages ? "pointer-events-none opacity-50" : ""} + /> + + + +
+
+
); case 'Partner': @@ -373,7 +559,26 @@ export function PeopleView() {
{/* --- Dialogs --- */} - + { + setIsRoleDialogOpen(open); + if (!open) setEditingRole(null); + }} + onSaved={() => { + setRolePageIndex(1); + setRoleRefreshSeq((x) => x + 1); + }} + /> + { + setIsRoleMenuDialogOpen(open); + if (!open) setMenuRole(null); + }} + /> @@ -383,53 +588,414 @@ export function PeopleView() { // --- Sub-Components (Dialogs) --- -function CreateRoleDialog({ open, onOpenChange }: { open: boolean; onOpenChange: (open: boolean) => void }) { +function RoleDialog({ + open, + role, + onOpenChange, + onSaved, +}: { + open: boolean; + role: RoleDto | null; + onOpenChange: (open: boolean) => void; + onSaved: () => void; +}) { + const isEdit = !!role?.id; + const [submitting, setSubmitting] = useState(false); + const [roleName, setRoleName] = useState(""); + const [roleCode, setRoleCode] = useState(""); + const [remark, setRemark] = useState(""); + const [orderNum, setOrderNum] = useState(""); + const [state, setState] = useState(true); + + useEffect(() => { + if (!open) return; + setSubmitting(false); + setRoleName(role?.roleName ?? ""); + setRoleCode(role?.roleCode ?? ""); + setRemark(role?.remark ?? ""); + setOrderNum(role?.orderNum === null || role?.orderNum === undefined ? "" : String(role.orderNum)); + setState(role?.state ?? true); + }, [open, role]); + + const canSubmit = useMemo(() => { + return Boolean(roleName.trim() && roleCode.trim()); + }, [roleName, roleCode]); + + const toIntOrNullLocal = (v: string): number | null => { + const s = v.trim(); + if (!s) return null; + const n = Number.parseInt(s, 10); + return Number.isFinite(n) ? n : null; + }; + + const submit = async () => { + if (!canSubmit) { + toast.error("Please fill in required fields.", { + description: "Role Name and Role Code are required.", + }); + return; + } + setSubmitting(true); + try { + const payload = { + roleName: roleName.trim(), + roleCode: roleCode.trim(), + remark: remark.trim() ? remark.trim() : null, + state: !!state, + orderNum: toIntOrNullLocal(orderNum), + }; + if (isEdit && role?.id) { + await updateRbacRole(role.id, payload); + toast.success("Role updated.", { description: "Role fields have been saved successfully." }); + } else { + await createRbacRole(payload); + toast.success("Role created.", { description: "A new role has been created successfully." }); + } + onOpenChange(false); + onSaved(); + } catch (e: any) { + toast.error(isEdit ? "Failed to update role." : "Failed to create role.", { + description: e?.message ? String(e.message) : "Please try again.", + }); + } finally { + setSubmitting(false); + } + }; + return ( - Create New Role - Define permissions and notification settings for this role. + {isEdit ? "Edit Role" : "Create Role"} + + {isEdit ? "Update role fields and save changes." : "Fill out the form to create a new role."} +
- - + + setRoleName(e.target.value)} placeholder="e.g. Inventory Specialist" />
- -
- -
- {['Manage Labels', 'Manage Products', 'Manage People', 'View Reports', 'Edit Settings', 'Approve Batches'].map(perm => ( -
- - -
- ))} -
+ +
+ + setRoleCode(e.target.value)} placeholder="e.g. inventory_specialist" />
-
- -
-
- - -
-
- - -
-
- - -
+
+ + setRemark(e.target.value)} placeholder="Optional" /> +
+ +
+
+ + setOrderNum(e.target.value)} placeholder="e.g. 10" /> +
+
+
Enabled
+
- + + + +
+ ); +} + +function RoleMenuPermissionsDialog({ + open, + role, + onOpenChange, +}: { + open: boolean; + role: RoleDto | null; + onOpenChange: (open: boolean) => void; +}) { + const roleId = role?.id ?? ""; + const roleName = role?.roleName ?? ""; + const [submitting, setSubmitting] = useState(false); + + const [menuTree, setMenuTree] = useState([]); + const [menuExpandedIds, setMenuExpandedIds] = useState>(new Set()); + const [selectedIds, setSelectedIds] = useState>(new Set()); + const [loadingMenus, setLoadingMenus] = useState(false); + const abortRef = useRef(null); + + const [menuKeyword, setMenuKeyword] = useState(""); + const menuKeywordTimerRef = useRef(null); + const [debouncedMenuKeyword, setDebouncedMenuKeyword] = useState(""); + + useEffect(() => { + if (menuKeywordTimerRef.current) window.clearTimeout(menuKeywordTimerRef.current); + menuKeywordTimerRef.current = window.setTimeout(() => setDebouncedMenuKeyword(menuKeyword.trim()), 300); + return () => { + if (menuKeywordTimerRef.current) window.clearTimeout(menuKeywordTimerRef.current); + }; + }, [menuKeyword]); + + useEffect(() => { + if (!open) return; + setSubmitting(false); + setSelectedIds(new Set()); + setMenuExpandedIds(new Set()); + + const run = async () => { + abortRef.current?.abort(); + const ac = new AbortController(); + abortRef.current = ac; + setLoadingMenus(true); + try { + const tree = await getRbacMenuTree(ac.signal); + setMenuTree(tree ?? []); + if (roleId) { + const checked = await getRoleMenuIds(roleId); + setSelectedIds(new Set(checked)); + } + } catch (e: any) { + if (e?.name === "AbortError") return; + toast.error("Failed to load menus.", { description: e?.message ? String(e.message) : "Please try again." }); + setMenuTree([]); + setSelectedIds(new Set()); + } finally { + setLoadingMenus(false); + } + }; + + run(); + return () => abortRef.current?.abort(); + }, [open, roleId]); + + const menuTotal = useMemo(() => { + const walk = (nodes: RbacMenuTreeNode[]): number => + nodes.reduce((acc, n) => acc + 1 + (n.children ? walk(n.children) : 0), 0); + return walk(menuTree); + }, [menuTree]); + + const filterTree = useMemo(() => { + const kw = debouncedMenuKeyword.trim().toLowerCase(); + if (!kw) return menuTree; + const match = (n: RbacMenuTreeNode) => { + const name = (n.menuName ?? "").toLowerCase(); + const url = (n.routeUrl ?? "").toLowerCase(); + return name.includes(kw) || url.includes(kw); + }; + const recur = (nodes: RbacMenuTreeNode[]): RbacMenuTreeNode[] => { + const out: RbacMenuTreeNode[] = []; + for (const n of nodes) { + const children = n.children ? recur(n.children) : []; + if (match(n) || children.length) out.push({ ...n, children: children.length ? children : undefined }); + } + return out; + }; + return recur(menuTree); + }, [menuTree, debouncedMenuKeyword]); + + useEffect(() => { + const kw = debouncedMenuKeyword.trim(); + if (!kw) return; + const next = new Set(); + const walk = (nodes: RbacMenuTreeNode[]) => { + for (const n of nodes) { + if (n.children?.length) next.add(n.id); + if (n.children?.length) walk(n.children); + } + }; + walk(filterTree); + setMenuExpandedIds(next); + }, [debouncedMenuKeyword, filterTree]); + + const getNodeAllIds = (node: RbacMenuTreeNode): string[] => { + const ids: string[] = []; + const walk = (n: RbacMenuTreeNode) => { + if (n.id) ids.push(n.id); + if (n.children?.length) n.children.forEach(walk); + }; + walk(node); + return ids; + }; + + const isCheckedState = (node: RbacMenuTreeNode): { checked: boolean; indeterminate: boolean } => { + const ids = getNodeAllIds(node); + if (!ids.length) return { checked: false, indeterminate: false }; + let hit = 0; + for (const id of ids) if (selectedIds.has(id)) hit += 1; + if (hit === 0) return { checked: false, indeterminate: false }; + if (hit === ids.length) return { checked: true, indeterminate: false }; + return { checked: false, indeterminate: true }; + }; + + const toggleNode = (node: RbacMenuTreeNode, checked: boolean) => { + setSelectedIds((prev) => { + const next = new Set(prev); + const ids = getNodeAllIds(node); + if (checked) ids.forEach((id) => next.add(id)); + else ids.forEach((id) => next.delete(id)); + return next; + }); + }; + + const toggleExpanded = (id: string) => { + setMenuExpandedIds((prev) => { + const next = new Set(prev); + if (next.has(id)) next.delete(id); + else next.add(id); + return next; + }); + }; + + const highlight = (text: string | null | undefined) => { + const kw = debouncedMenuKeyword.trim(); + const t = text ?? ""; + if (!kw) return t || "N/A"; + const idx = t.toLowerCase().indexOf(kw.toLowerCase()); + if (idx < 0) return t || "N/A"; + const a = t.slice(0, idx); + const b = t.slice(idx, idx + kw.length); + const c = t.slice(idx + kw.length); + return ( + + {a} + {b} + {c} + + ); + }; + + const TreeNodeRow = ({ node, depth }: { node: RbacMenuTreeNode; depth: number }) => { + const hasChildren = !!node.children?.length; + const expanded = menuExpandedIds.has(node.id); + const { checked, indeterminate } = isCheckedState(node); + return ( +
+
+ + toggleNode(node, !!v)} + /> + +
+ {hasChildren && expanded && ( +
+ {node.children!.map((c) => ( + + ))} +
+ )} +
+ ); + }; + + const submit = async () => { + if (!roleId) return; + setSubmitting(true); + try { + await setRoleMenus({ + roleId, + menuIds: Array.from(selectedIds), + }); + toast.success("Role menu permissions saved.", { + description: "Menu permissions have been updated successfully.", + }); + onOpenChange(false); + } catch (e: any) { + toast.error("Failed to save menu permissions.", { + description: e?.message ? String(e.message) : "Please try again.", + }); + } finally { + setSubmitting(false); + } + }; + + const clearAll = async () => { + if (!roleId || selectedIds.size === 0) return; + setSubmitting(true); + try { + await deleteRoleMenus({ + roleId, + menuIds: Array.from(selectedIds), + }); + setSelectedIds(new Set()); + toast.success("Role menu permissions cleared.", { + description: "Selected permissions have been removed.", + }); + } catch (e: any) { + toast.error("Failed to delete menu permissions.", { + description: e?.message ? String(e.message) : "Please try again.", + }); + } finally { + setSubmitting(false); + } + }; + + return ( + + + + Menu Permissions + + {roleName ? `Set menu permissions for role: ${roleName}` : "Set menu permissions for this role."} + + +
+
+
+
+
{loadingMenus ? "Loading menus..." : `Total ${menuTotal} menus`}
+ setMenuKeyword(e.target.value)} + placeholder="Search menus" + className="h-8 w-44 bg-white" + /> +
+
+ +
+ {filterTree.map((n) => ( + + ))} + {!loadingMenus && filterTree.length === 0 && ( +
No menus.
+ )} +
+
+
+
+ + + +
diff --git a/美国版/Food Labeling Management Platform/src/components/system-menu/SystemMenuView.tsx b/美国版/Food Labeling Management Platform/src/components/system-menu/SystemMenuView.tsx new file mode 100644 index 0000000..6a6389f --- /dev/null +++ b/美国版/Food Labeling Management Platform/src/components/system-menu/SystemMenuView.tsx @@ -0,0 +1,625 @@ +import React, { useEffect, useMemo, useRef, useState } from "react"; +import { + Edit, + FileBox, + FileText, + HelpCircle, + Layers, + LayoutDashboard, + MapPin, + MoreHorizontal, + Package, + Plus, + Settings, + Tag, + Trash2, + Type, + Users, +} from "lucide-react"; +import { toast } from "sonner"; + +import { Button } from "../ui/button"; +import { Input } from "../ui/input"; +import { Label } from "../ui/label"; +import { Switch } from "../ui/switch"; +import { Textarea } from "../ui/textarea"; +import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover"; +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/select"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, +} from "../ui/dialog"; +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from "../ui/table"; + +import { + createSystemMenu, + deleteSystemMenu, + getDirectoryMenusForParentSelect, + getSystemMenus, + updateSystemMenu, +} from "../../services/systemMenuService"; +import type { SystemMenuDto, SystemMenuUpsertInput } from "../../types/systemMenu"; + +type IconKey = + | "Settings" + | "LayoutDashboard" + | "Tag" + | "MapPin" + | "Users" + | "Package" + | "FileText" + | "HelpCircle" + | "Layers" + | "Type" + | "FileBox"; + +const ICONS: Record> = { + Settings, + LayoutDashboard, + Tag, + MapPin, + Users, + Package, + FileText, + HelpCircle, + Layers, + Type, + FileBox, +}; + +function toDisplay(v: string | null | undefined): string { + const s = (v ?? "").trim(); + return s ? s : "N/A"; +} + +function toIntOrNull(v: string): number | null { + const s = v.trim(); + if (!s) return null; + const n = Number.parseInt(s, 10); + return Number.isFinite(n) ? n : null; +} + +export function SystemMenuView() { + const [items, setItems] = useState([]); + const [loading, setLoading] = useState(false); + const [refreshSeq, setRefreshSeq] = useState(0); + const [actionsOpenForId, setActionsOpenForId] = useState(null); + + const [keyword, setKeyword] = useState(""); + const keywordTimerRef = useRef(null); + const [debouncedKeyword, setDebouncedKeyword] = useState(""); + + const [isCreateOpen, setIsCreateOpen] = useState(false); + const [isEditOpen, setIsEditOpen] = useState(false); + const [isDeleteOpen, setIsDeleteOpen] = useState(false); + const [editing, setEditing] = useState(null); + const [deleting, setDeleting] = useState(null); + + const abortRef = useRef(null); + + useEffect(() => { + if (keywordTimerRef.current) window.clearTimeout(keywordTimerRef.current); + keywordTimerRef.current = window.setTimeout(() => setDebouncedKeyword(keyword.trim()), 300); + return () => { + if (keywordTimerRef.current) window.clearTimeout(keywordTimerRef.current); + }; + }, [keyword]); + + useEffect(() => { + const run = async () => { + abortRef.current?.abort(); + const ac = new AbortController(); + abortRef.current = ac; + + setLoading(true); + try { + const res = await getSystemMenus( + { + // 这里不分页展示:一次性拉大页数据 + skipCount: 1, + maxResultCount: 5000, + keyword: debouncedKeyword || undefined, + }, + ac.signal, + ); + setItems(res.items ?? []); + } catch (e: any) { + if (e?.name === "AbortError") return; + toast.error("Failed to load system menus.", { + description: e?.message ? String(e.message) : "Please try again.", + }); + setItems([]); + } finally { + setLoading(false); + } + }; + + run(); + return () => abortRef.current?.abort(); + }, [debouncedKeyword, refreshSeq]); + + const refreshList = () => setRefreshSeq((x) => x + 1); + + const openEdit = (m: SystemMenuDto) => { + setActionsOpenForId(null); + setEditing(m); + setIsEditOpen(true); + }; + + const openDelete = (m: SystemMenuDto) => { + setActionsOpenForId(null); + setDeleting(m); + setIsDeleteOpen(true); + }; + + return ( +
+
+
+ setKeyword(e.target.value)} + style={{ height: 40, boxSizing: "border-box" }} + className="border border-gray-300 rounded-md w-40 shrink-0 bg-white placeholder:text-gray-500" + /> +
+ +
+
+ + {/* flex-col + min-h-0:表格区域滚动,底部分页栏始终可见(避免被 overflow-hidden 裁掉) */} +
+
+ + + + Menu Name + Route URL + Router Name + Type + Order + Visible + Enabled + Actions + + + + {items.length === 0 ? ( + + + {loading ? "Loading..." : "No data"} + + + ) : ( + items.map((m) => ( + + {toDisplay(m.menuName)} + {toDisplay(m.routeUrl)} + {toDisplay(m.routerName)} + {m.menuType ?? "N/A"} + {m.orderNum ?? "N/A"} + {m.isShow ? "Yes" : "No"} + {m.state ? "Yes" : "No"} + + setActionsOpenForId(open ? m.id : null)} + > + + + + +
+ + +
+
+
+
+
+ )) + )} +
+
+
+
+ + + + + + +
+ ); +} + +function SystemMenuDialog({ + mode, + open, + menu, + onOpenChange, + onSaved, +}: { + mode: "create" | "edit"; + open: boolean; + menu: SystemMenuDto | null; + onOpenChange: (open: boolean) => void; + onSaved: () => void; +}) { + const isEdit = mode === "edit"; + const [submitting, setSubmitting] = useState(false); + + // 按图二字段(英文展示) + const [menuName, setMenuName] = useState(""); + const [routerName, setRouterName] = useState(""); + const [routeUrl, setRouteUrl] = useState(""); + const [menuType, setMenuType] = useState<"directory" | "menu">("menu"); + const [permissionCode, setPermissionCode] = useState(""); + const [parentId, setParentId] = useState(""); + const [parentDirectories, setParentDirectories] = useState([]); + const [parentDirsLoading, setParentDirsLoading] = useState(false); + const [menuIcon, setMenuIcon] = useState(""); + const [orderNum, setOrderNum] = useState(""); + const [link, setLink] = useState(""); + const [component, setComponent] = useState(""); + const [query, setQuery] = useState(""); + const [remark, setRemark] = useState(""); + + const [isCache, setIsCache] = useState(false); + const [isShow, setIsShow] = useState(true); + const [state, setState] = useState(true); + + useEffect(() => { + if (!open) return; + setSubmitting(false); + + setMenuName(menu?.menuName ?? ""); + setRouterName(menu?.routerName ?? ""); + setRouteUrl(menu?.routeUrl ?? ""); + // menuType: 目录/菜单(默认菜单) + // 这里按常见约定:0=Directory, 1=Menu;若后端枚举不同,再按 Swagger 调整 + setMenuType(menu?.menuType === 0 ? "directory" : "menu"); + setPermissionCode(menu?.permissionCode ?? ""); + const rawPid = String(menu?.parentId ?? "").trim(); + setParentId( + !rawPid || rawPid === "00000000-0000-0000-0000-000000000000" ? "" : rawPid, + ); + setMenuIcon((menu?.menuIcon as IconKey | null) ?? ""); + setOrderNum(menu?.orderNum === null || menu?.orderNum === undefined ? "" : String(menu.orderNum)); + setLink(menu?.link ?? ""); + setComponent(menu?.component ?? ""); + setQuery(menu?.query ?? ""); + setRemark(menu?.remark ?? ""); + + setIsCache(!!menu?.isCache); + setIsShow(menu?.isShow ?? true); + setState(menu?.state ?? true); + }, [open, menu]); + + const PARENT_ROOT = "__parent_root__"; + + useEffect(() => { + if (!open) return; + let cancelled = false; + setParentDirsLoading(true); + getDirectoryMenusForParentSelect() + .then((list) => { + if (!cancelled) setParentDirectories(list); + }) + .catch(() => { + if (!cancelled) setParentDirectories([]); + }) + .finally(() => { + if (!cancelled) setParentDirsLoading(false); + }); + return () => { + cancelled = true; + }; + }, [open]); + + const isRootParentId = (id: string) => + !id.trim() || id === "00000000-0000-0000-0000-000000000000"; + + const parentSelectOptions = useMemo(() => { + const dirs = parentDirectories.filter((d) => d.id && d.id !== menu?.id); + const pid = (parentId || "").trim(); + if (pid && !isRootParentId(pid) && !dirs.some((d) => d.id === pid)) { + return [ + ...dirs, + { id: pid, menuName: `(Current parent) ${pid}` } as SystemMenuDto, + ]; + } + return dirs; + }, [parentDirectories, parentId, menu?.id]); + + const parentSelectValue = isRootParentId(parentId) ? PARENT_ROOT : parentId; + + const canSubmit = useMemo(() => { + return Boolean(menuName.trim() && routeUrl.trim()); + }, [menuName, routeUrl]); + + const submit = async () => { + if (!canSubmit) { + toast.error("Please fill in required fields.", { + description: "Menu Name and Route URL are required.", + }); + return; + } + + setSubmitting(true); + try { + const payload: SystemMenuUpsertInput = { + menuName: menuName.trim(), + routerName: routerName.trim() ? routerName.trim() : null, + routeUrl: routeUrl.trim(), + // 0=Directory, 1=Menu + menuType: menuType === "directory" ? 0 : 1, + permissionCode: permissionCode.trim() ? permissionCode.trim() : null, + parentId: isRootParentId(parentId) ? null : parentId.trim(), + menuIcon: menuIcon ? menuIcon : null, + orderNum: toIntOrNull(orderNum), + link: link.trim() ? link.trim() : null, + component: component.trim() ? component.trim() : null, + query: query.trim() ? query.trim() : null, + remark: remark.trim() ? remark.trim() : null, + isCache, + isShow, + state, + }; + + if (isEdit) { + if (!menu?.id) throw new Error("Missing id."); + await updateSystemMenu(menu.id, payload); + toast.success("Menu updated.", { description: "Changes have been saved successfully." }); + } else { + await createSystemMenu(payload); + toast.success("Menu created.", { description: "A new menu has been created successfully." }); + } + + onOpenChange(false); + onSaved(); + } catch (e: any) { + toast.error(isEdit ? "Failed to update menu." : "Failed to create menu.", { + description: e?.message ? String(e.message) : "Please try again.", + }); + } finally { + setSubmitting(false); + } + }; + + return ( + + + + {isEdit ? "Edit System Menu" : "New System Menu"} + + {isEdit ? "Update system menu fields and save changes." : "Fill out the form to create a new system menu."} + + + +
+
+ + setMenuName(e.target.value)} placeholder="e.g. Location Manager" /> +
+
+ + setRouteUrl(e.target.value)} placeholder="e.g. /location" /> +
+
+ + setRouterName(e.target.value)} placeholder="e.g. location" /> +
+ +
+ + +
+
+ + setPermissionCode(e.target.value)} placeholder="e.g. sys:menu" /> +
+
+ + +
+ +
+ + +
+
+ + setOrderNum(e.target.value)} placeholder="e.g. 10" /> +
+
+ + setLink(e.target.value)} placeholder="Optional" /> +
+ +
+ + setComponent(e.target.value)} placeholder="Optional" /> +
+
+ + setQuery(e.target.value)} placeholder="Optional" /> +
+
+ +