diff --git a/apps/web/src/components/common/editor/graph/GraphEditor.tsx b/apps/web/src/components/common/editor/graph/GraphEditor.tsx deleted file mode 100755 index 633bab7..0000000 --- a/apps/web/src/components/common/editor/graph/GraphEditor.tsx +++ /dev/null @@ -1,105 +0,0 @@ -import React, { useCallback, useEffect, useMemo, useState } from 'react'; -import { addEdge, ReactFlow, Background, Controls, Edge, Node, ReactFlowProvider, useEdgesState, useNodesState, MiniMap, Panel, BackgroundVariant, ControlButton, applyNodeChanges, applyEdgeChanges, SelectionMode, OnNodesChange, OnEdgesChange, useReactFlow, useOnSelectionChange, useNodesInitialized } from '@xyflow/react'; -import { Button } from '../../element/Button'; -import '@xyflow/react/dist/style.css'; -import { edgeTypes, GraphState, nodeTypes } from './types'; -import useGraphStore from './store'; -import { shallow } from 'zustand/shallow'; -import { useKeyboardCtrl } from './useKeyboardCtrl'; -import { getMindMapLayout } from './layout'; - - - - -const selector = (store: GraphState) => ({ - nodes: store.present.nodes, - edges: store.present.edges, - setNodes: store.setNodes, - setEdges: store.setEdges, - record: store.record, - onNodesChange: store.onNodesChange, - onEdgesChange: store.onEdgesChange, -}); - -const panOnDrag = [1, 2]; - -const Flow: React.FC = () => { - - const store = useGraphStore(selector, shallow); - useKeyboardCtrl() - const nodesInitialized = useNodesInitialized(); - const onLayout = useCallback(async () => { - const layouted = getMindMapLayout({ nodes: store.nodes, edges: store.edges }) - store.setNodes(layouted.nodes) - store.setEdges(layouted.edges) - }, [store.nodes, store.edges]); - useEffect(() => { - if (nodesInitialized && store.nodes.length) { - console.log('layout') - onLayout() - } - }, [nodesInitialized, store.nodes.length]); - - return ( - { - const recordTypes = new Set(['remove', 'select']); - const undoChanges = changes.filter(change => recordTypes.has(change.type)) - const otherChanges = changes.filter(change => !recordTypes.has(change.type)) - if (undoChanges.length) - store.record(() => { - store.onNodesChange(undoChanges); - }); - store.onNodesChange(otherChanges); - }} - onEdgesChange={(changes) => { - const recordTypes = new Set(['remove', 'select']); - changes.forEach((change) => { - if (recordTypes.has(change.type)) { - store.record(() => { - store.onEdgesChange([change]); - }); - } else { - store.onEdgesChange([change]); - } - }); - }} - selectionOnDrag - panOnDrag={panOnDrag} - nodeTypes={nodeTypes} - edgeTypes={edgeTypes} - selectionMode={SelectionMode.Partial} - fitView - minZoom={0.001} - maxZoom={1000} - > - - - 自动布局 - 节点个数{store.nodes.length} - 边条数{store.edges.length} - - - - - - 测试 - - - - ); -}; - -const GraphEditor: React.FC = () => { - return ( - - - - ); -}; - -export default GraphEditor; \ No newline at end of file diff --git a/apps/web/src/components/common/editor/graph/data.ts b/apps/web/src/components/common/editor/graph/data.ts deleted file mode 100755 index c358f7a..0000000 --- a/apps/web/src/components/common/editor/graph/data.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { MarkerType } from "@xyflow/react"; - -// 生成思维导图数据的函数 -function generateMindMapData(levels: number, nodesPerLevel: number) { - const nodes = []; - const edges = []; - - // 添加根节点 - nodes.push({ - id: 'root', - data: { label: '核心主题', level: 0 }, - type: 'graph-node', - position: { x: 0, y: 0 } - }); - - // 为每一层生成节点 - for (let level = 1; level <= levels; level++) { - const angleStep = (2 * Math.PI) / nodesPerLevel; - const radius = level * 200; // 每层的半径 - - for (let i = 0; i < nodesPerLevel; i++) { - const angle = i * angleStep; - const nodeId = `node-${level}-${i}`; - - // 计算节点位置 - const x = Math.cos(angle) * radius; - const y = Math.sin(angle) * radius; - - // 添加节点 - nodes.push({ - id: nodeId, - data: { label: `主题${level}-${i}`, level }, - type: 'graph-node', - position: { x, y } - }); - - // 添加边 - // 第一层连接到根节点,其他层连接到上一层的节点 - const sourceId = level === 1 ? 'root' : `node-${level - 1}-${Math.floor(i / 2)}`; - edges.push({ - id: `edge-${level}-${i}`, - source: sourceId, - target: nodeId, - type: 'graph-edge', - }); - } - } - - return { nodes, edges }; -} - -// 生成测试数据 - 可以调整参数来控制规模 -// 参数1: 层级数量 -// 参数2: 每层节点数量 -const { nodes: initialNodes, edges: initialEdges } = generateMindMapData(2, 3); - -export { initialNodes, initialEdges }; \ No newline at end of file diff --git a/apps/web/src/components/common/editor/graph/edges/GraphEdge.tsx b/apps/web/src/components/common/editor/graph/edges/GraphEdge.tsx deleted file mode 100755 index 15e2224..0000000 --- a/apps/web/src/components/common/editor/graph/edges/GraphEdge.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import { BaseEdge, Node, Edge, EdgeLabelRenderer, EdgeProps, getBezierPath, getSmoothStepPath, getStraightPath, Position, useReactFlow, useInternalNode, InternalNode } from '@xyflow/react'; - -export type GraphEdge = Edge<{ text: string }, 'graph-edge'>; - -function getEdgeParams(sourceNode: InternalNode, targetNode: InternalNode) { - console.log(sourceNode) - const sourceCenter = { - x: sourceNode.position.x + sourceNode.width / 2, - y: sourceNode.position.y + sourceNode.height / 2, - }; - const targetCenter = { - x: targetNode.position.x + targetNode.width / 2, - y: targetNode.position.y + targetNode.height / 2, - }; - - const dx = targetCenter.x - sourceCenter.x; - - // 简化连接逻辑:只基于x轴方向判断 - let sourcePos: Position; - let targetPos: Position; - - // 如果目标在源节点右边,源节点用右侧连接点,目标节点用左侧连接点 - if (dx > 0) { - sourcePos = Position.Right; - targetPos = Position.Left; - } else { - // 如果目标在源节点左边,源节点用左侧连接点,目标节点用右侧连接点 - sourcePos = Position.Left; - targetPos = Position.Right; - } - - // 使用节点中心的y坐标 - return { - sourcePos, - targetPos, - sx: sourceCenter.x + sourceNode.measured.width / 2, - sy: sourceCenter.y, - tx: targetCenter.x - targetNode.measured.width / 2, - ty: targetCenter.y, - }; -} -export const GraphEdge = ({ id, source, target, sourceX, sourceY, targetX, targetY, data, ...props }: EdgeProps) => { - const sourceNode = useInternalNode(source); - const targetNode = useInternalNode(target); - const { sx, sy, tx, ty, targetPos, sourcePos } = getEdgeParams(sourceNode, targetNode) - const [edgePath, labelX, labelY] = getBezierPath({ - sourceX: sx, - sourceY: sy, - targetX: tx, - targetY: ty, - sourcePosition: sourcePos, - targetPosition: targetPos, - curvature: 0.3, - - }); - return ( - <> - - - {data?.text && ( - - {data.text} - - )} - - > - ); -}; \ No newline at end of file diff --git a/apps/web/src/components/common/editor/graph/edges/algorithms/a-star.ts b/apps/web/src/components/common/editor/graph/edges/algorithms/a-star.ts deleted file mode 100755 index c167657..0000000 --- a/apps/web/src/components/common/editor/graph/edges/algorithms/a-star.ts +++ /dev/null @@ -1,219 +0,0 @@ -import { areLinesReverseDirection, areLinesSameDirection } from "../edge"; -import { - ControlPoint, - NodeRect, - isEqualPoint, - isSegmentCrossingRect, -} from "../point"; - -interface GetAStarPathParams { - /** - * Collection of potential control points between `sourceOffset` and `targetOffset`, excluding the `source` and `target` points. - */ - points: ControlPoint[]; - source: ControlPoint; - target: ControlPoint; - /** - * Node size information for the `source` and `target`, used to optimize edge routing without intersecting nodes. - */ - sourceRect: NodeRect; - targetRect: NodeRect; -} - -/** - * Utilizes the [A\* search algorithm](https://en.wikipedia.org/wiki/A*_search_algorithm) combined with - * [Manhattan Distance](https://simple.wikipedia.org/wiki/Manhattan_distance) to find the optimal path for edges. - * - * @returns Control points including sourceOffset and targetOffset (not including source and target points). - */ -export const getAStarPath = ({ - points, - source, - target, - sourceRect, - targetRect, -}: GetAStarPathParams): ControlPoint[] => { - if (points.length < 3) { - return points; - } - const start = points[0]; - const end = points[points.length - 1]; - const openSet: ControlPoint[] = [start]; - const closedSet: Set = new Set(); - const cameFrom: Map = new Map(); - const gScore: Map = new Map().set(start, 0); - const fScore: Map = new Map().set( - start, - heuristicCostEstimate({ - from: start, - to: start, - start, - end, - source, - target, - }) - ); - - while (openSet.length) { - let current; - let currentIdx; - let lowestFScore = Infinity; - openSet.forEach((p, idx) => { - const score = fScore.get(p) ?? 0; - if (score < lowestFScore) { - lowestFScore = score; - current = p; - currentIdx = idx; - } - }); - - if (!current) { - break; - } - - if (current === end) { - return buildPath(cameFrom, current); - } - - openSet.splice(currentIdx!, 1); - closedSet.add(current); - - const curFScore = fScore.get(current) ?? 0; - const previous = cameFrom.get(current); - const neighbors = getNextNeighborPoints({ - points, - previous, - current, - sourceRect, - targetRect, - }); - for (const neighbor of neighbors) { - if (closedSet.has(neighbor)) { - continue; - } - const neighborGScore = gScore.get(neighbor) ?? 0; - const tentativeGScore = curFScore + estimateDistance(current, neighbor); - if (openSet.includes(neighbor) && tentativeGScore >= neighborGScore) { - continue; - } - openSet.push(neighbor); - cameFrom.set(neighbor, current); - gScore.set(neighbor, tentativeGScore); - fScore.set( - neighbor, - neighborGScore + - heuristicCostEstimate({ - from: current, - to: neighbor, - start, - end, - source, - target, - }) - ); - } - } - return [start, end]; -}; - -const buildPath = ( - cameFrom: Map, - current: ControlPoint -): ControlPoint[] => { - const path = [current]; - - let previous = cameFrom.get(current); - while (previous) { - path.push(previous); - previous = cameFrom.get(previous); - } - - return path.reverse(); -}; - -interface GetNextNeighborPointsParams { - points: ControlPoint[]; - previous?: ControlPoint; - current: ControlPoint; - sourceRect: NodeRect; - targetRect: NodeRect; -} - -/** - * Get the set of possible neighboring points for the current control point - * - * - The line is in a horizontal or vertical direction - * - The line does not intersect with the two end nodes - * - The line does not overlap with the previous line segment in reverse direction - */ -export const getNextNeighborPoints = ({ - points, - previous, - current, - sourceRect, - targetRect, -}: GetNextNeighborPointsParams): ControlPoint[] => { - return points.filter((p) => { - if (p === current) { - return false; - } - // The connection is in the horizontal or vertical direction - const rightDirection = p.x === current.x || p.y === current.y; - // Reverse direction with the previous line segment (overlap) - const reverseDirection = previous - ? areLinesReverseDirection(previous, current, current, p) - : false; - return ( - rightDirection && // The line is in a horizontal or vertical direction - !reverseDirection && // The line does not overlap with the previous line segment in reverse direction - !isSegmentCrossingRect(p, current, sourceRect) && // Does not intersect with sourceNode - !isSegmentCrossingRect(p, current, targetRect) // Does not intersect with targetNode - ); - }); -}; - -interface HeuristicCostParams { - from: ControlPoint; - to: ControlPoint; - start: ControlPoint; - end: ControlPoint; - source: ControlPoint; - target: ControlPoint; -} - -/** - * Connection point distance loss function - * - * - The smaller the sum of distances, the better - * - The closer the start and end line segments are in direction, the better - * - The better the inflection point is symmetric or centered in the line segment - */ -const heuristicCostEstimate = ({ - from, - to, - start, - end, - source, - target, -}: HeuristicCostParams): number => { - const base = estimateDistance(to, start) + estimateDistance(to, end); - const startCost = isEqualPoint(from, start) - ? areLinesSameDirection(from, to, source, start) - ? -base / 2 - : 0 - : 0; - const endCost = isEqualPoint(to, end) - ? areLinesSameDirection(from, to, end, target) - ? -base / 2 - : 0 - : 0; - return base + startCost + endCost; -}; - -/** - * Calculate the estimated distance between two points - * - * Manhattan distance: the sum of horizontal and vertical distances, faster calculation speed - */ -const estimateDistance = (p1: ControlPoint, p2: ControlPoint): number => - Math.abs(p1.x - p2.x) + Math.abs(p1.y - p2.y); diff --git a/apps/web/src/components/common/editor/graph/edges/algorithms/index.ts b/apps/web/src/components/common/editor/graph/edges/algorithms/index.ts deleted file mode 100755 index a9fd894..0000000 --- a/apps/web/src/components/common/editor/graph/edges/algorithms/index.ts +++ /dev/null @@ -1,127 +0,0 @@ -import { areLinesSameDirection, isHorizontalFromPosition } from "../edge"; -import { - ControlPoint, - HandlePosition, - NodeRect, - getCenterPoints, - getExpandedRect, - getOffsetPoint, - getSidesFromPoints, - getVerticesFromRectVertex, - optimizeInputPoints, - reducePoints, -} from "../point"; -import { getAStarPath } from "./a-star"; -import { getSimplePath } from "./simple"; - -export interface GetControlPointsParams { - source: HandlePosition; - target: HandlePosition; - sourceRect: NodeRect; - targetRect: NodeRect; - /** - * Minimum spacing between edges and nodes - */ - offset: number; -} - -/** - * Calculate control points on the optimal path of an edge. - * - * Reference article: https://juejin.cn/post/6942727734518874142 - */ -export const getControlPoints = ({ - source: oldSource, - target: oldTarget, - sourceRect, - targetRect, - offset = 20, -}: GetControlPointsParams) => { - const source: ControlPoint = oldSource; - const target: ControlPoint = oldTarget; - let edgePoints: ControlPoint[] = []; - let optimized: ReturnType; - - // 1. Find the starting and ending points after applying the offset - const sourceOffset = getOffsetPoint(oldSource, offset); - const targetOffset = getOffsetPoint(oldTarget, offset); - const expandedSource = getExpandedRect(sourceRect, offset); - const expandedTarget = getExpandedRect(targetRect, offset); - - // 2. Determine if the two Rects are relatively close or should directly connected - const minOffset = 2 * offset + 10; - const isHorizontalLayout = isHorizontalFromPosition(oldSource.position); - const isSameDirection = areLinesSameDirection( - source, - sourceOffset, - targetOffset, - target - ); - const sides = getSidesFromPoints([ - source, - target, - sourceOffset, - targetOffset, - ]); - const isTooClose = isHorizontalLayout - ? sides.right - sides.left < minOffset - : sides.bottom - sides.top < minOffset; - const isDirectConnect = isHorizontalLayout - ? isSameDirection && source.x < target.x - : isSameDirection && source.y < target.y; - - if (isTooClose || isDirectConnect) { - // 3. If the two Rects are relatively close or directly connected, return a simple Path - edgePoints = getSimplePath({ - source, - target, - sourceOffset, - targetOffset, - isDirectConnect, - }); - optimized = optimizeInputPoints({ - source: oldSource, - target: oldTarget, - sourceOffset, - targetOffset, - edgePoints, - }); - edgePoints = optimized.edgePoints; - } else { - // 3. Find the vertices of the two expanded Rects - edgePoints = [ - ...getVerticesFromRectVertex(expandedSource, targetOffset), - ...getVerticesFromRectVertex(expandedTarget, sourceOffset), - ]; - // 4. Find possible midpoints and intersections - edgePoints = edgePoints.concat( - getCenterPoints({ - source: expandedSource, - target: expandedTarget, - sourceOffset, - targetOffset, - }) - ); - // 5. Merge nearby coordinate points and remove duplicate coordinate points - optimized = optimizeInputPoints({ - source: oldSource, - target: oldTarget, - sourceOffset, - targetOffset, - edgePoints, - }); - // 6. Find the optimal path - edgePoints = getAStarPath({ - points: optimized.edgePoints, - source: optimized.source, - target: optimized.target, - sourceRect: getExpandedRect(sourceRect, offset / 2), - targetRect: getExpandedRect(targetRect, offset / 2), - }); - } - - return { - points: reducePoints([optimized.source, ...edgePoints, optimized.target]), - inputPoints: optimized.edgePoints, - }; -}; diff --git a/apps/web/src/components/common/editor/graph/edges/algorithms/simple.ts b/apps/web/src/components/common/editor/graph/edges/algorithms/simple.ts deleted file mode 100755 index 4526ef4..0000000 --- a/apps/web/src/components/common/editor/graph/edges/algorithms/simple.ts +++ /dev/null @@ -1,113 +0,0 @@ -import { uuid } from "@/utils/uuid"; - -import { LayoutDirection } from "../../node"; -import { ControlPoint, isInLine, isOnLine } from "../point"; - -interface GetSimplePathParams { - isDirectConnect?: boolean; - source: ControlPoint; - target: ControlPoint; - sourceOffset: ControlPoint; - targetOffset: ControlPoint; -} - -const getLineDirection = ( - start: ControlPoint, - end: ControlPoint -): LayoutDirection => (start.x === end.x ? "vertical" : "horizontal"); - -/** - * When two nodes are too close, use the simple path - * - * @returns Control points including sourceOffset and targetOffset (not including source and target points). - */ -export const getSimplePath = ({ - isDirectConnect, - source, - target, - sourceOffset, - targetOffset, -}: GetSimplePathParams): ControlPoint[] => { - const points: ControlPoint[] = []; - const sourceDirection = getLineDirection(source, sourceOffset); - const targetDirection = getLineDirection(target, targetOffset); - const isHorizontalLayout = sourceDirection === "horizontal"; - if (isDirectConnect) { - // Direct connection, return a simple Path - if (isHorizontalLayout) { - if (sourceOffset.x <= targetOffset.x) { - const centerX = (sourceOffset.x + targetOffset.x) / 2; - return [ - { id: uuid(), x: centerX, y: sourceOffset.y }, - { id: uuid(), x: centerX, y: targetOffset.y }, - ]; - } else { - const centerY = (sourceOffset.y + targetOffset.y) / 2; - return [ - sourceOffset, - { id: uuid(), x: sourceOffset.x, y: centerY }, - { id: uuid(), x: targetOffset.x, y: centerY }, - targetOffset, - ]; - } - } else { - if (sourceOffset.y <= targetOffset.y) { - const centerY = (sourceOffset.y + targetOffset.y) / 2; - return [ - { id: uuid(), x: sourceOffset.x, y: centerY }, - { id: uuid(), x: targetOffset.x, y: centerY }, - ]; - } else { - const centerX = (sourceOffset.x + targetOffset.x) / 2; - return [ - sourceOffset, - { id: uuid(), x: centerX, y: sourceOffset.y }, - { id: uuid(), x: centerX, y: targetOffset.y }, - targetOffset, - ]; - } - } - } - if (sourceDirection === targetDirection) { - // Same direction, add two points, two endpoints of parallel lines at half the vertical distance - if (source.y === sourceOffset.y) { - points.push({ - id: uuid(), - x: sourceOffset.x, - y: (sourceOffset.y + targetOffset.y) / 2, - }); - points.push({ - id: uuid(), - x: targetOffset.x, - y: (sourceOffset.y + targetOffset.y) / 2, - }); - } else { - points.push({ - id: uuid(), - x: (sourceOffset.x + targetOffset.x) / 2, - y: sourceOffset.y, - }); - points.push({ - id: uuid(), - x: (sourceOffset.x + targetOffset.x) / 2, - y: targetOffset.y, - }); - } - } else { - // Different directions, add one point, ensure it's not on the current line segment (to avoid overlap), and there are no turns - let point = { id: uuid(), x: sourceOffset.x, y: targetOffset.y }; - const inStart = isInLine(point, source, sourceOffset); - const inEnd = isInLine(point, target, targetOffset); - if (inStart || inEnd) { - point = { id: uuid(), x: targetOffset.x, y: sourceOffset.y }; - } else { - const onStart = isOnLine(point, source, sourceOffset); - const onEnd = isOnLine(point, target, targetOffset); - if (onStart && onEnd) { - point = { id: uuid(), x: targetOffset.x, y: sourceOffset.y }; - } - } - points.push(point); - } - return [sourceOffset, ...points, targetOffset]; -}; diff --git a/apps/web/src/components/common/editor/graph/layout/BaseLayout.ts b/apps/web/src/components/common/editor/graph/layout/BaseLayout.ts deleted file mode 100755 index 74d5378..0000000 --- a/apps/web/src/components/common/editor/graph/layout/BaseLayout.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { LayoutOptions, LayoutStrategy, NodeWithLayout } from "./types"; -import { Edge, Node } from "@xyflow/react"; -// 抽象布局类,包含共用的工具方法 -export abstract class BaseLayout implements LayoutStrategy { - protected buildNodeMap(nodes: Node[]): Map { - const nodeMap = new Map(); - nodes.forEach(node => { - nodeMap.set(node.id, { ...node, children: [], width: 150, height: 40 }); - }); - return nodeMap; - } - - protected buildTreeStructure(nodeMap: Map, edges: Edge[]): NodeWithLayout | undefined { - edges.forEach(edge => { - const source = nodeMap.get(edge.source); - const target = nodeMap.get(edge.target); - if (source && target) { - source.children?.push(target); - target.parent = source; - } - }); - return Array.from(nodeMap.values()).find(node => !node.parent); - } - - abstract layout(options: LayoutOptions): { nodes: Node[], edges: Edge[] }; -} diff --git a/apps/web/src/components/common/editor/graph/layout/MindMapLayout.ts b/apps/web/src/components/common/editor/graph/layout/MindMapLayout.ts deleted file mode 100755 index 42779ca..0000000 --- a/apps/web/src/components/common/editor/graph/layout/MindMapLayout.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { Edge,Node } from "@xyflow/react"; -import { BaseLayout } from "./BaseLayout"; -import { LayoutOptions, NodeWithLayout } from "./types"; - -// 思维导图布局实现 -export class MindMapLayout extends BaseLayout { - layout(options: LayoutOptions): { nodes: Node[], edges: Edge[] } { - const { - nodes, - edges, - levelSeparation = 200, - nodeSeparation = 60 - } = options; - - const nodeMap = this.buildNodeMap(nodes); - const rootNode = this.buildTreeStructure(nodeMap, edges); - if (!rootNode) return { nodes, edges }; - - this.assignSides(rootNode); - this.calculateSubtreeHeight(rootNode, nodeSeparation); - this.calculateLayout(rootNode, 0, 0, levelSeparation, nodeSeparation); - - const layoutedNodes = Array.from(nodeMap.values()).map(node => ({ - ...node, - position: node.position, - })); - - return { nodes: layoutedNodes, edges }; - } - - private assignSides(node: NodeWithLayout, isRight: boolean = true): void { - if (!node.children?.length) return; - - const len = node.children.length; - const midIndex = Math.floor(len / 2); - - if (!node.parent) { - for (let i = 0; i < len; i++) { - const child = node.children[i]; - this.assignSides(child, i < midIndex); - child.isRight = i < midIndex; - } - } else { - node.children.forEach(child => { - this.assignSides(child, isRight); - child.isRight = isRight; - }); - } - } - - private calculateSubtreeHeight(node: NodeWithLayout, nodeSeparation: number): number { - if (!node.children?.length) { - node.subtreeHeight = node.height || 40; - return node.subtreeHeight; - } - - const childrenHeight = node.children.reduce((sum, child) => { - return sum + this.calculateSubtreeHeight(child, nodeSeparation); - }, 0); - - const totalGaps = (node.children.length - 1) * nodeSeparation; - node.subtreeHeight = Math.max(node.height || 40, childrenHeight + totalGaps); - return node.subtreeHeight; - } - - private calculateLayout( - node: NodeWithLayout, - x: number, - y: number, - levelSeparation: number, - nodeSeparation: number - ): void { - node.position = { x, y }; - if (!node.children?.length) return; - - let currentY = y - (node.subtreeHeight || 0) / 2; - - node.children.forEach(child => { - const direction = child.isRight ? 1 : -1; - const childX = x + (levelSeparation * direction); - const childY = currentY + (child.subtreeHeight || 0) / 2; - - this.calculateLayout(child, childX, childY, levelSeparation, nodeSeparation); - currentY += (child.subtreeHeight || 0) + nodeSeparation; - }); - } -} \ No newline at end of file diff --git a/apps/web/src/components/common/editor/graph/layout/SingleMapLayout.ts b/apps/web/src/components/common/editor/graph/layout/SingleMapLayout.ts deleted file mode 100755 index 2d7d68c..0000000 --- a/apps/web/src/components/common/editor/graph/layout/SingleMapLayout.ts +++ /dev/null @@ -1,127 +0,0 @@ -import { Edge, Node } from "@xyflow/react"; -import { BaseLayout } from "./BaseLayout"; -import { LayoutOptions, NodeWithLayout } from "./types"; - -/** - * SingleMapLayout 类继承自 BaseLayout,用于实现单图布局。 - * 该类主要负责将节点和边按照一定的规则进行布局,使得节点在视觉上呈现出层次分明、结构清晰的效果。 - */ -export class SingleMapLayout extends BaseLayout { - /** - * 布局方法,根据提供的选项对节点和边进行布局。 - * @param options 布局选项,包含节点、边、层级间距和节点间距等信息。 - * @returns 返回布局后的节点和边。 - */ - layout(options: LayoutOptions): { nodes: Node[], edges: Edge[] } { - const { nodes, edges, levelSeparation = 100, nodeSeparation = 30 } = options; - const nodeMap = this.buildNodeMap(nodes); - const root = this.buildTreeStructure(nodeMap, edges); - - if (!root) { - return { nodes: [], edges: [] }; - } - - // 计算子树的尺寸 - this.calculateSubtreeDimensions(root); - - // 第一遍:分配垂直位置 - this.assignInitialVerticalPositions(root, 0); - - // 第二遍:使用平衡布局定位节点 - this.positionNodes(root, 0, 0, levelSeparation, nodeSeparation, 'right'); - - return { - nodes: Array.from(nodeMap.values()), - edges - }; - } - - /** - * 计算子树的尺寸,包括高度和宽度。 - * @param node 当前节点。 - */ - private calculateSubtreeDimensions(node: NodeWithLayout): void { - - node.subtreeHeight = node.height || 40; - node.subtreeWidth = node.width || 150; - - if (node.children && node.children.length > 0) { - // 首先计算所有子节点的尺寸 - node.children.forEach(child => this.calculateSubtreeDimensions(child)); - - // 计算子节点所需的总高度,包括间距 - const totalChildrenHeight = this.calculateTotalChildrenHeight(node.children, 30); - - // 更新节点的子树尺寸 - node.subtreeHeight = Math.max(node.subtreeHeight, totalChildrenHeight); - node.subtreeWidth += Math.max(...node.children.map(child => child.subtreeWidth || 0)); - } - } - - /** - * 计算子节点的总高度。 - * @param children 子节点数组。 - * @param spacing 子节点之间的间距。 - * @returns 返回子节点的总高度。 - */ - private calculateTotalChildrenHeight(children: NodeWithLayout[], spacing: number): number { - if (!children.length) return 0; - const totalHeight = children.reduce((sum, child) => sum + (child.subtreeHeight || 0), 0); - return totalHeight + (spacing * (children.length - 1)); - } - - /** - * 分配初始垂直位置。 - * @param node 当前节点。 - * @param level 当前层级。 - */ - private assignInitialVerticalPositions(node: NodeWithLayout, level: number): void { - if (!node.children?.length) return; - const totalHeight = this.calculateTotalChildrenHeight(node.children, 30); - let currentY = -(totalHeight / 2); - node.children.forEach(child => { - const childHeight = child.subtreeHeight || 0; - child.verticalLevel = level + 1; - child.relativeY = currentY + (childHeight / 2); - this.assignInitialVerticalPositions(child, level + 1); - currentY += childHeight + 30; // 30 是垂直间距 - }); - } - - /** - * 定位节点。 - * @param node 当前节点。 - * @param x 当前节点的水平位置。 - * @param y 当前节点的垂直位置。 - * @param levelSeparation 层级间距。 - * @param nodeSeparation 节点间距。 - * @param direction 布局方向,'left' 或 'right'。 - */ - private positionNodes( - node: NodeWithLayout, - x: number, - y: number, - levelSeparation: number, - nodeSeparation: number, - direction: 'left' | 'right' - ): void { - node.position = { x, y }; - if (!node.children?.length) return; - // 计算子节点的水平位置 - const nextX = direction === 'right' - ? x + (node.width || 0) + levelSeparation - : x - (node.width || 0) - levelSeparation; - // 定位每个子节点 - node.children.forEach(child => { - const childY = y + (child.relativeY || 0); - this.positionNodes( - child, - nextX, - childY, - levelSeparation, - nodeSeparation, - direction - ); - }); - } -} \ No newline at end of file diff --git a/apps/web/src/components/common/editor/graph/layout/TreeLayout.ts b/apps/web/src/components/common/editor/graph/layout/TreeLayout.ts deleted file mode 100755 index 31fe186..0000000 --- a/apps/web/src/components/common/editor/graph/layout/TreeLayout.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { BaseLayout } from "./BaseLayout"; -import { LayoutOptions, LayoutStrategy, NodeWithLayout } from "./types"; -import { Edge, Node } from "@xyflow/react"; -export class TreeLayout extends BaseLayout { - layout(options: LayoutOptions): { nodes: Node[], edges: Edge[] } { - const { - nodes, - edges, - levelSeparation = 100, // 层级间垂直距离 - nodeSeparation = 50 // 节点间水平距离 - } = options; - - const nodeMap = this.buildNodeMap(nodes); - const rootNode = this.buildTreeStructure(nodeMap, edges); - if (!rootNode) return { nodes, edges }; - // 计算每个节点的子树宽度 - this.calculateSubtreeWidth(rootNode, nodeSeparation); - // 计算布局位置 - this.calculateTreeLayout(rootNode, 0, 0, levelSeparation); - const layoutedNodes = Array.from(nodeMap.values()).map(node => ({ - ...node, - position: node.position, - })); - return { nodes: layoutedNodes, edges }; - } - - private calculateSubtreeWidth(node: NodeWithLayout, nodeSeparation: number): number { - if (!node.children?.length) { - node.subtreeWidth = node.width || 150; - return node.subtreeWidth; - } - - const childrenWidth = node.children.reduce((sum, child) => { - return sum + this.calculateSubtreeWidth(child, nodeSeparation); - }, 0); - - const totalGaps = (node.children.length - 1) * nodeSeparation; - node.subtreeWidth = Math.max(node.width || 150, childrenWidth + totalGaps); - return node.subtreeWidth; - } - - private calculateTreeLayout( - node: NodeWithLayout, - x: number, - y: number, - levelSeparation: number - ): void { - node.position = { x, y }; - - if (!node.children?.length) return; - - const totalChildrenWidth = node.children.reduce((sum, child) => - sum + (child.subtreeWidth || 0), 0); - const totalGaps = (node.children.length - 1) * (node.width || 150); - - // 计算最左侧子节点的起始x坐标 - let startX = x - (totalChildrenWidth + totalGaps) / 2; - - node.children.forEach(child => { - const childX = startX + (child.subtreeWidth || 0) / 2; - const childY = y + levelSeparation; - - this.calculateTreeLayout(child, childX, childY, levelSeparation); - - startX += (child.subtreeWidth || 0) + (node.width || 150); - }); - } -} \ No newline at end of file diff --git a/apps/web/src/components/common/editor/graph/layout/edge/algorithms/a-star.ts b/apps/web/src/components/common/editor/graph/layout/edge/algorithms/a-star.ts deleted file mode 100755 index 4b71dea..0000000 --- a/apps/web/src/components/common/editor/graph/layout/edge/algorithms/a-star.ts +++ /dev/null @@ -1,248 +0,0 @@ -import { areLinesReverseDirection, areLinesSameDirection } from "../edge"; -import { - ControlPoint, - NodeRect, - isEqualPoint, - isSegmentCrossingRect, -} from "../point"; - -interface GetAStarPathParams { - /** - * Collection of potential control points between `sourceOffset` and `targetOffset`, excluding the `source` and `target` points. - */ - points: ControlPoint[]; - source: ControlPoint; - target: ControlPoint; - /** - * Node size information for the `source` and `target`, used to optimize edge routing without intersecting nodes. - */ - sourceRect: NodeRect; - targetRect: NodeRect; -} - -/** - * Utilizes the [A\* search algorithm](https://en.wikipedia.org/wiki/A*_search_algorithm) combined with - * [Manhattan Distance](https://simple.wikipedia.org/wiki/Manhattan_distance) to find the optimal path for edges. - * - * @returns Control points including sourceOffset and targetOffset (not including source and target points). - */ -export const getAStarPath = ({ - points, - source, - target, - sourceRect, - targetRect, -}: GetAStarPathParams): ControlPoint[] => { - if (points.length < 3) { - return points; - } - const start = points[0]; - const end = points[points.length - 1]; - const openSet: ControlPoint[] = [start]; - const closedSet: Set = new Set(); - const cameFrom: Map = new Map(); - const gScore: Map = new Map().set(start, 0); - const fScore: Map = new Map().set( - start, - heuristicCostEstimate({ - from: start, - to: start, - start, - end, - source, - target, - }) - ); - - while (openSet.length) { - let current; - let currentIdx; - let lowestFScore = Infinity; - openSet.forEach((p, idx) => { - const score = fScore.get(p) ?? 0; - if (score < lowestFScore) { - lowestFScore = score; - current = p; - currentIdx = idx; - } - }); - - if (!current) { - break; - } - - if (current === end) { - return buildPath(cameFrom, current); - } - - openSet.splice(currentIdx!, 1); - closedSet.add(current); - - const curFScore = fScore.get(current) ?? 0; - const previous = cameFrom.get(current); - const neighbors = getNextNeighborPoints({ - points, - previous, - current, - sourceRect, - targetRect, - }); - for (const neighbor of neighbors) { - if (closedSet.has(neighbor)) { - continue; - } - const neighborGScore = gScore.get(neighbor) ?? 0; - const tentativeGScore = curFScore + estimateDistance(current, neighbor); - if (openSet.includes(neighbor) && tentativeGScore >= neighborGScore) { - continue; - } - openSet.push(neighbor); - cameFrom.set(neighbor, current); - gScore.set(neighbor, tentativeGScore); - fScore.set( - neighbor, - neighborGScore + - heuristicCostEstimate({ - from: current, - to: neighbor, - start, - end, - source, - target, - }) - ); - } - } - return [start, end]; -}; - -const buildPath = ( - cameFrom: Map, - current: ControlPoint -): ControlPoint[] => { - const path = [current]; - - let previous = cameFrom.get(current); - while (previous) { - path.push(previous); - previous = cameFrom.get(previous); - } - - return path.reverse(); -}; - -interface GetNextNeighborPointsParams { - points: ControlPoint[]; - previous?: ControlPoint; - current: ControlPoint; - sourceRect: NodeRect; - targetRect: NodeRect; -} - -/** - * Get the set of possible neighboring points for the current control point - * - * - The line is in a horizontal or vertical direction - * - The line does not intersect with the two end nodes - * - The line does not overlap with the previous line segment in reverse direction - */ -export const getNextNeighborPoints = ({ - points, - previous, - current, - sourceRect, - targetRect, -}: GetNextNeighborPointsParams): ControlPoint[] => { - return points.filter((p) => { - if (p === current) { - return false; - } - // The connection is in the horizontal or vertical direction - const rightDirection = p.x === current.x || p.y === current.y; - // Reverse direction with the previous line segment (overlap) - const reverseDirection = previous - ? areLinesReverseDirection(previous, current, current, p) - : false; - return ( - rightDirection && // The line is in a horizontal or vertical direction - !reverseDirection && // The line does not overlap with the previous line segment in reverse direction - !isSegmentCrossingRect(p, current, sourceRect) && // Does not intersect with sourceNode - !isSegmentCrossingRect(p, current, targetRect) // Does not intersect with targetNode - ); - }); -}; - -/** - * 路径规划所需的启发式代价计算参数接口 - * 包含了计算路径代价所需的所有控制点信息: - * - from/to: 当前路径段的起点和终点 - * - start/end: 整条路径的起点和终点 - * - source/target: 连接的源节点和目标节点位置 - */ -interface HeuristicCostParams { - from: ControlPoint; // 当前路径段的起点 - to: ControlPoint; // 当前路径段的终点 - start: ControlPoint; // 整条路径的起始点 - end: ControlPoint; // 整条路径的终点 - source: ControlPoint; // 源节点的连接点 - target: ControlPoint; // 目标节点的连接点 -} - -/** - * 启发式路径代价估算函数 - * - * 该函数通过多个因素综合评估路径的优劣程度: - * 1. 基础代价: 当前点到起点和终点的曼哈顿距离之和 - * 2. 起点优化: 如果是起始段,判断方向一致性给予奖励 - * 3. 终点优化: 如果是结束段,判断方向一致性给予奖励 - * - * 优化目标: - * - 减少路径总长度 - * - 保持路径走向的连续性 - * - 使拐点在路径中更均匀分布 - * - * @param params 包含所有必要控制点的参数对象 - * @returns 计算得到的启发式代价值,值越小路径越优 - */ -const heuristicCostEstimate = ({ - from, - to, - start, - end, - source, - target, -}: HeuristicCostParams): number => { - // 计算基础代价 - 到起点和终点的距离之和 - const base = estimateDistance(to, start) + estimateDistance(to, end); - - // 起点方向优化 - 如果是起始段且方向一致,给予奖励 - const startCost = isEqualPoint(from, start) - ? areLinesSameDirection(from, to, source, start) - ? -base / 2 // 方向一致时减少代价 - : 0 - : 0; - - // 终点方向优化 - 如果是结束段且方向一致,给予奖励 - const endCost = isEqualPoint(to, end) - ? areLinesSameDirection(from, to, end, target) - ? -base / 2 // 方向一致时减少代价 - : 0 - : 0; - - return base + startCost + endCost; -}; - -/** - * 计算两点间的估计距离 - * - * 采用曼哈顿距离(Manhattan distance)计算: - * - 只计算水平和垂直方向的距离之和 - * - 避免使用欧几里得距离的开方运算 - * - 在网格化的路径规划中性能更优 - * - * @param p1 第一个控制点 - * @param p2 第二个控制点 - * @returns 两点间的曼哈顿距离 - */ -const estimateDistance = (p1: ControlPoint, p2: ControlPoint): number => - Math.abs(p1.x - p2.x) + Math.abs(p1.y - p2.y); \ No newline at end of file diff --git a/apps/web/src/components/common/editor/graph/layout/edge/algorithms/index.ts b/apps/web/src/components/common/editor/graph/layout/edge/algorithms/index.ts deleted file mode 100755 index 8530033..0000000 --- a/apps/web/src/components/common/editor/graph/layout/edge/algorithms/index.ts +++ /dev/null @@ -1,142 +0,0 @@ -import { areLinesSameDirection, isHorizontalFromPosition } from "../edge"; -import { - ControlPoint, - HandlePosition, - NodeRect, - getCenterPoints, - getExpandedRect, - getOffsetPoint, - getSidesFromPoints, - getVerticesFromRectVertex, - optimizeInputPoints, - reducePoints, -} from "../point"; -import { getAStarPath } from "./a-star"; -import { getSimplePath } from "./simple"; - -/** - * 边缘控制点计算模块 - * 用于计算图形边缘连接线的控制点,以实现平滑的连接效果 - * 主要应用于流程图、思维导图等需要节点间连线的场景 - */ - -/** - * 控制点计算所需的输入参数接口 - */ -export interface GetControlPointsParams { - source: HandlePosition; // 起始连接点位置 - target: HandlePosition; // 目标连接点位置 - sourceRect: NodeRect; // 起始节点的矩形区域 - targetRect: NodeRect; // 目标节点的矩形区域 - /** - * 边缘与节点之间的最小间距 - * @default 20 - */ - offset: number; -} - -/** - * 计算两个节点之间连接线的控制点 - * @param params 控制点计算参数 - * @returns 返回优化后的路径点和输入点集合 - */ -export const getControlPoints = ({ - source: oldSource, - target: oldTarget, - sourceRect, - targetRect, - offset = 20, -}: GetControlPointsParams) => { - const source: ControlPoint = oldSource; - const target: ControlPoint = oldTarget; - let edgePoints: ControlPoint[] = []; - let optimized: ReturnType; - - // 1. 计算考虑偏移量后的起始和结束点 - const sourceOffset = getOffsetPoint(oldSource, offset); - const targetOffset = getOffsetPoint(oldTarget, offset); - const expandedSource = getExpandedRect(sourceRect, offset); - const expandedTarget = getExpandedRect(targetRect, offset); - - // 2. 判断两个矩形是否靠得较近或应该直接连接 - const minOffset = 2 * offset + 10; // 最小间距阈值 - const isHorizontalLayout = isHorizontalFromPosition(oldSource.position); // 是否为水平布局 - const isSameDirection = areLinesSameDirection( - source, - sourceOffset, - targetOffset, - target - ); // 判断是否同向 - const sides = getSidesFromPoints([ - source, - target, - sourceOffset, - targetOffset, - ]); // 获取边界信息 - - // 判断节点是否过近 - const isTooClose = isHorizontalLayout - ? sides.right - sides.left < minOffset - : sides.bottom - sides.top < minOffset; - // 判断是否可以直接连接 - const isDirectConnect = isHorizontalLayout - ? isSameDirection && source.x < target.x - : isSameDirection && source.y < target.y; - - if (isTooClose || isDirectConnect) { - // 3. 如果节点较近或可直接连接,返回简单路径 - edgePoints = getSimplePath({ - source, - target, - sourceOffset, - targetOffset, - isDirectConnect, - }); - // 优化输入点 - optimized = optimizeInputPoints({ - source: oldSource, - target: oldTarget, - sourceOffset, - targetOffset, - edgePoints, - }); - edgePoints = optimized.edgePoints; - } else { - // 3. 获取两个扩展矩形的顶点 - edgePoints = [ - ...getVerticesFromRectVertex(expandedSource, targetOffset), - ...getVerticesFromRectVertex(expandedTarget, sourceOffset), - ]; - // 4. 计算可能的中点和交点 - edgePoints = edgePoints.concat( - getCenterPoints({ - source: expandedSource, - target: expandedTarget, - sourceOffset, - targetOffset, - }) - ); - // 5. 合并临近坐标点并去除重复点 - optimized = optimizeInputPoints({ - source: oldSource, - target: oldTarget, - sourceOffset, - targetOffset, - edgePoints, - }); - // 6. 使用A*算法寻找最优路径 - edgePoints = getAStarPath({ - points: optimized.edgePoints, - source: optimized.source, - target: optimized.target, - sourceRect: getExpandedRect(sourceRect, offset / 2), - targetRect: getExpandedRect(targetRect, offset / 2), - }); - } - - // 返回简化后的路径点和输入点集合 - return { - points: reducePoints([optimized.source, ...edgePoints, optimized.target]), - inputPoints: optimized.edgePoints, - }; -}; \ No newline at end of file diff --git a/apps/web/src/components/common/editor/graph/layout/edge/algorithms/simple.ts b/apps/web/src/components/common/editor/graph/layout/edge/algorithms/simple.ts deleted file mode 100755 index 8545fd2..0000000 --- a/apps/web/src/components/common/editor/graph/layout/edge/algorithms/simple.ts +++ /dev/null @@ -1,112 +0,0 @@ -import { uuid } from "../../../utils/uuid"; -import { LayoutDirection } from "../../node"; -import { ControlPoint, isInLine, isOnLine } from "../point"; - -interface GetSimplePathParams { - isDirectConnect?: boolean; - source: ControlPoint; - target: ControlPoint; - sourceOffset: ControlPoint; - targetOffset: ControlPoint; -} - -const getLineDirection = ( - start: ControlPoint, - end: ControlPoint -): LayoutDirection => (start.x === end.x ? "vertical" : "horizontal"); - -/** - * When two nodes are too close, use the simple path - * - * @returns Control points including sourceOffset and targetOffset (not including source and target points). - */ -export const getSimplePath = ({ - isDirectConnect, - source, - target, - sourceOffset, - targetOffset, -}: GetSimplePathParams): ControlPoint[] => { - const points: ControlPoint[] = []; - const sourceDirection = getLineDirection(source, sourceOffset); - const targetDirection = getLineDirection(target, targetOffset); - const isHorizontalLayout = sourceDirection === "horizontal"; - if (isDirectConnect) { - // Direct connection, return a simple Path - if (isHorizontalLayout) { - if (sourceOffset.x <= targetOffset.x) { - const centerX = (sourceOffset.x + targetOffset.x) / 2; - return [ - { id: uuid(), x: centerX, y: sourceOffset.y }, - { id: uuid(), x: centerX, y: targetOffset.y }, - ]; - } else { - const centerY = (sourceOffset.y + targetOffset.y) / 2; - return [ - sourceOffset, - { id: uuid(), x: sourceOffset.x, y: centerY }, - { id: uuid(), x: targetOffset.x, y: centerY }, - targetOffset, - ]; - } - } else { - if (sourceOffset.y <= targetOffset.y) { - const centerY = (sourceOffset.y + targetOffset.y) / 2; - return [ - { id: uuid(), x: sourceOffset.x, y: centerY }, - { id: uuid(), x: targetOffset.x, y: centerY }, - ]; - } else { - const centerX = (sourceOffset.x + targetOffset.x) / 2; - return [ - sourceOffset, - { id: uuid(), x: centerX, y: sourceOffset.y }, - { id: uuid(), x: centerX, y: targetOffset.y }, - targetOffset, - ]; - } - } - } - if (sourceDirection === targetDirection) { - // Same direction, add two points, two endpoints of parallel lines at half the vertical distance - if (source.y === sourceOffset.y) { - points.push({ - id: uuid(), - x: sourceOffset.x, - y: (sourceOffset.y + targetOffset.y) / 2, - }); - points.push({ - id: uuid(), - x: targetOffset.x, - y: (sourceOffset.y + targetOffset.y) / 2, - }); - } else { - points.push({ - id: uuid(), - x: (sourceOffset.x + targetOffset.x) / 2, - y: sourceOffset.y, - }); - points.push({ - id: uuid(), - x: (sourceOffset.x + targetOffset.x) / 2, - y: targetOffset.y, - }); - } - } else { - // Different directions, add one point, ensure it's not on the current line segment (to avoid overlap), and there are no turns - let point = { id: uuid(), x: sourceOffset.x, y: targetOffset.y }; - const inStart = isInLine(point, source, sourceOffset); - const inEnd = isInLine(point, target, targetOffset); - if (inStart || inEnd) { - point = { id: uuid(), x: targetOffset.x, y: sourceOffset.y }; - } else { - const onStart = isOnLine(point, source, sourceOffset); - const onEnd = isOnLine(point, target, targetOffset); - if (onStart && onEnd) { - point = { id: uuid(), x: targetOffset.x, y: sourceOffset.y }; - } - } - points.push(point); - } - return [sourceOffset, ...points, targetOffset]; -}; diff --git a/apps/web/src/components/common/editor/graph/layout/edge/edge.ts b/apps/web/src/components/common/editor/graph/layout/edge/edge.ts deleted file mode 100755 index 0f25f05..0000000 --- a/apps/web/src/components/common/editor/graph/layout/edge/edge.ts +++ /dev/null @@ -1,389 +0,0 @@ -import { Position, XYPosition } from "@xyflow/react"; -import { ControlPoint, HandlePosition } from "./point"; -import { uuid } from "../../utils/uuid"; - -export interface ILine { - start: ControlPoint; - end: ControlPoint; -} - -/** - * 判断给定位置是否为水平方向 - * @param position - 位置枚举值 - * @returns 如果是左侧或右侧位置则返回true,否则返回false - */ -export const isHorizontalFromPosition = (position: Position) => { - return [Position.Left, Position.Right].includes(position); -}; - -/** - * 判断连接是否为反向 - * 在图形布局中,通常希望连线从左到右或从上到下。当连线方向与此相反时,即为反向连接 - * @param props - 包含源点和目标点位置信息的对象 - * @param props.source - 源节点的位置信息 - * @param props.target - 目标节点的位置信息 - * @returns 如果是反向连接则返回true,否则返回false - */ -export const isConnectionBackward = (props: { - source: HandlePosition; - target: HandlePosition; -}) => { - const { source, target } = props; - // 判断是水平还是垂直方向的连接 - const isHorizontal = isHorizontalFromPosition(source.position); - let isBackward = false; - - // 水平方向时,如果源点x坐标大于目标点,则为反向 - if (isHorizontal) { - if (source.x > target.x) { - isBackward = true; - } - } - // 垂直方向时,如果源点y坐标大于目标点,则为反向 - else { - if (source.y > target.y) { - isBackward = true; - } - } - return isBackward; -}; - -/** - * 计算两点之间的欧几里得距离 - * 使用勾股定理(Math.hypot)计算两点间的直线距离 - * @param p1 - 第一个控制点 - * @param p2 - 第二个控制点 - * @returns 两点间的距离 - */ -export const distance = (p1: ControlPoint, p2: ControlPoint) => { - return Math.hypot(p2.x - p1.x, p2.y - p1.y); -}; - -/** - * 计算线段的中点坐标 - * 通过取两端点坐标的算术平均值来确定中点位置 - * @param p1 - 第一个控制点 - * @param p2 - 第二个控制点 - * @returns 包含中点坐标和唯一标识的控制点对象 - */ -export const getLineCenter = ( - p1: ControlPoint, - p2: ControlPoint -): ControlPoint => { - return { - id: uuid(), - x: (p1.x + p2.x) / 2, // x坐标取两端点x坐标的平均值 - y: (p1.y + p2.y) / 2, // y坐标取两端点y坐标的平均值 - }; -}; - -/** - * 判断点是否在线段上 - * - * @description - * 该函数用于检测给定的点是否位于由两个控制点构成的线段上。 - * 判断逻辑分为两种情况: - * 1. 垂直线段: 当起点和终点的x坐标相同时,判断目标点的x坐标是否等于线段x坐标,且y坐标在线段y坐标范围内 - * 2. 水平线段: 当起点和终点的y坐标相同时,判断目标点的y坐标是否等于线段y坐标,且x坐标在线段x坐标范围内 - * - * @param start - 线段起点坐标 - * @param end - 线段终点坐标 - * @param p - 待检测点的坐标 - * @returns {boolean} 如果点在线段上返回true,否则返回false - */ -export const isLineContainsPoint = ( - start: ControlPoint, - end: ControlPoint, - p: ControlPoint -) => { - return ( - // 判断垂直线段 - (start.x === end.x && // 起点终点x坐标相同 - p.x === start.x && // 目标点x坐标与线段相同 - p.y <= Math.max(start.y, end.y) && // 目标点y坐标不超过线段y坐标最大值 - p.y >= Math.min(start.y, end.y)) || // 目标点y坐标不小于线段y坐标最小值 - // 判断水平线段 - (start.y === end.y && // 起点终点y坐标相同 - p.y === start.y && // 目标点y坐标与线段相同 - p.x <= Math.max(start.x, end.x) && // 目标点x坐标不超过线段x坐标最大值 - p.x >= Math.min(start.x, end.x)) // 目标点x坐标不小于线段x坐标最小值 - ); -}; -/** -/** - * 生成带圆角转角的SVG路径 - * - * 该函数用于在图形编辑器中生成连接两点之间的边线路径。路径具有以下特点: - * 1. 两个控制点之间为直线段 - * 2. 在转折点处生成圆角过渡 - * 3. 支持垂直和水平方向的转角 - * - * @param points 控制点数组,包含边的起点、终点和中间的转折点 - * - 至少需要2个点(起点和终点) - * - 点的顺序应从输入端点开始到输出端点结束 - * @param radius 转角处的圆角半径 - * @returns 返回SVG路径字符串 - * @throws 当points数组长度小于2时抛出错误 - */ -export function getPathWithRoundCorners( - points: ControlPoint[], - radius: number -): string { - if (points.length < 2) { - throw new Error("At least 2 points are required."); - } - - /** - * 计算两条线段交点处的圆角路径 - * @param center 转折点坐标 - * @param p1 前一个点的坐标 - * @param p2 后一个点的坐标 - * @param radius 圆角半径 - * @returns SVG路径命令字符串 - */ - function getRoundCorner( - center: ControlPoint, - p1: ControlPoint, - p2: ControlPoint, - radius: number - ) { - const { x, y } = center; - - // 如果两条线段不垂直,则直接返回直线路径 - if (!areLinesPerpendicular(p1, center, center, p2)) { - return `L ${x} ${y}`; - } - - // 计算实际可用的圆角半径,取三个值中的最小值: - // 1. 与前一个点的距离的一半 - // 2. 与后一个点的距离的一半 - // 3. 传入的目标半径 - const d1 = distance(center, p1); - const d2 = distance(center, p2); - radius = Math.min(d1 / 2, d2 / 2, radius); - - // 判断第一条线段是否为水平线 - const isHorizontal = p1.y === y; - - // 根据点的相对位置确定圆角绘制方向 - const xDir = isHorizontal ? (p1.x < p2.x ? -1 : 1) : p1.x < p2.x ? 1 : -1; - const yDir = isHorizontal ? (p1.y < p2.y ? 1 : -1) : p1.y < p2.y ? -1 : 1; - - // 根据线段方向生成不同的圆角路径 - if (isHorizontal) { - return `L ${x + radius * xDir},${y}Q ${x},${y} ${x},${y + radius * yDir}`; - } - return `L ${x},${y + radius * yDir}Q ${x},${y} ${x + radius * xDir},${y}`; - } - - // 构建完整的SVG路径 - const path: string[] = []; - for (let i = 0; i < points.length; i++) { - if (i === 0) { - // 起点使用移动命令M - path.push(`M ${points[i].x} ${points[i].y}`); - } else if (i === points.length - 1) { - // 终点使用直线命令L - path.push(`L ${points[i].x} ${points[i].y}`); - } else { - // 中间点使用圆角转角 - path.push( - getRoundCorner(points[i], points[i - 1], points[i + 1], radius) - ); - } - } - - // 将所有路径命令连接成完整的路径字符串 - return path.join(" "); -} -/** - * 获取折线中最长的线段 - * @param points 控制点数组,每个点包含x和y坐标 - * @returns 返回最长线段的起点和终点坐标 - * - * 实现原理: - * 1. 初始化第一条线段为最长线段 - * 2. 遍历所有相邻点对,计算线段长度 - * 3. 如果找到更长的线段,则更新最长线段记录 - * 4. 返回最长线段的两个端点 - */ -export function getLongestLine( - points: ControlPoint[] -): [ControlPoint, ControlPoint] { - let longestLine: [ControlPoint, ControlPoint] = [points[0], points[1]]; - let longestDistance = distance(...longestLine); - for (let i = 1; i < points.length - 1; i++) { - const _distance = distance(points[i], points[i + 1]); - if (_distance > longestDistance) { - longestDistance = _distance; - longestLine = [points[i], points[i + 1]]; - } - } - return longestLine; -} - -/** - * 计算折线上标签的位置 - * @param points 控制点数组 - * @param minGap 最小间隔距离,默认为20 - * @returns 标签的坐标位置 - * - * 计算逻辑: - * 1. 如果折线点数为偶数: - * - 取中间两个点 - * - 如果这两点间距大于最小间隔,返回它们的中点 - * 2. 如果折线点数为奇数或中间段太短: - * - 找出最长的线段 - * - 返回最长线段的中点作为标签位置 - */ -export function getLabelPosition( - points: ControlPoint[], - minGap = 20 -): XYPosition { - if (points.length % 2 === 0) { - const middleP1 = points[points.length / 2 - 1]; - const middleP2 = points[points.length / 2]; - if (distance(middleP1, middleP2) > minGap) { - return getLineCenter(middleP1, middleP2); - } - } - const [start, end] = getLongestLine(points); - return { - x: (start.x + end.x) / 2, - y: (start.y + end.y) / 2, - }; -} - -/** - * 判断两条线段是否垂直 - * @param p1,p2 第一条线段的起点和终点 - * @param p3,p4 第二条线段的起点和终点 - * @returns 如果两线段垂直则返回true - * - * 判断依据: - * - 假设线段要么水平要么垂直 - * - 当一条线段水平(y相等)而另一条垂直(x相等)时,两线段垂直 - */ -export function areLinesPerpendicular( - p1: ControlPoint, - p2: ControlPoint, - p3: ControlPoint, - p4: ControlPoint -): boolean { - return (p1.x === p2.x && p3.y === p4.y) || (p1.y === p2.y && p3.x === p4.x); -} - -/** - * 判断两条线段是否平行 - * @param p1,p2 第一条线段的起点和终点 - * @param p3,p4 第二条线段的起点和终点 - * @returns 如果两线段平行则返回true - * - * 判断依据: - * - 假设线段要么水平要么垂直 - * - 当两条线段都是水平的(x相等)或都是垂直的(y相等)时,两线段平行 - */ -export function areLinesParallel( - p1: ControlPoint, - p2: ControlPoint, - p3: ControlPoint, - p4: ControlPoint -) { - return (p1.x === p2.x && p3.x === p4.x) || (p1.y === p2.y && p3.y === p4.y); -} - -/** - * 判断两条线段是否同向 - * @param p1 第一条线段的起点 - * @param p2 第一条线段的终点 - * @param p3 第二条线段的起点 - * @param p4 第二条线段的终点 - * @returns boolean 如果两线段同向返回true,否则返回false - * - * 判断逻辑: - * 1. 对于水平线段(y坐标相等),判断x方向的变化是否同向 - * 2. 对于垂直线段(x坐标相等),判断y方向的变化是否同向 - */ -export function areLinesSameDirection( - p1: ControlPoint, - p2: ControlPoint, - p3: ControlPoint, - p4: ControlPoint -) { - return ( - // 判断垂直线段是否同向 - (p1.x === p2.x && p3.x === p4.x && (p1.y - p2.y) * (p3.y - p4.y) > 0) || - // 判断水平线段是否同向 - (p1.y === p2.y && p3.y === p4.y && (p1.x - p2.x) * (p3.x - p4.x) > 0) - ); -} - -/** - * 判断两条线段是否反向 - * @param p1 第一条线段的起点 - * @param p2 第一条线段的终点 - * @param p3 第二条线段的起点 - * @param p4 第二条线段的终点 - * @returns boolean 如果两线段反向返回true,否则返回false - * - * 判断逻辑: - * 1. 对于水平线段(y坐标相等),判断x方向的变化是否反向 - * 2. 对于垂直线段(x坐标相等),判断y方向的变化是否反向 - */ -export function areLinesReverseDirection( - p1: ControlPoint, - p2: ControlPoint, - p3: ControlPoint, - p4: ControlPoint -) { - return ( - // 判断垂直线段是否反向 - (p1.x === p2.x && p3.x === p4.x && (p1.y - p2.y) * (p3.y - p4.y) < 0) || - // 判断水平线段是否反向 - (p1.y === p2.y && p3.y === p4.y && (p1.x - p2.x) * (p3.x - p4.x) < 0) - ); -} - -/** - * 计算两条线段之间的夹角 - * @param p1 第一条线段的起点 - * @param p2 第一条线段的终点 - * @param p3 第二条线段的起点 - * @param p4 第二条线段的终点 - * @returns number 两线段之间的夹角(单位:度) - * - * 计算步骤: - * 1. 计算两个向量 - * 2. 计算向量的点积 - * 3. 计算向量的模长 - * 4. 使用反余弦函数计算弧度 - * 5. 将弧度转换为角度 - */ -export function getAngleBetweenLines( - p1: ControlPoint, - p2: ControlPoint, - p3: ControlPoint, - p4: ControlPoint -) { - // 计算两条线段对应的向量 - const v1 = { x: p2.x - p1.x, y: p2.y - p1.y }; - const v2 = { x: p4.x - p3.x, y: p4.y - p3.y }; - - // 计算向量的点积 - const dotProduct = v1.x * v2.x + v1.y * v2.y; - - // 计算两个向量的模长 - const magnitude1 = Math.sqrt(v1.x ** 2 + v1.y ** 2); - const magnitude2 = Math.sqrt(v2.x ** 2 + v2.y ** 2); - - // 计算夹角的余弦值 - const cosine = dotProduct / (magnitude1 * magnitude2); - - // 使用反余弦函数计算弧度 - const angleInRadians = Math.acos(cosine); - - // 将弧度转换为角度并返回 - const angleInDegrees = (angleInRadians * 180) / Math.PI; - - return angleInDegrees; -} \ No newline at end of file diff --git a/apps/web/src/components/common/editor/graph/layout/edge/index.ts b/apps/web/src/components/common/editor/graph/layout/edge/index.ts deleted file mode 100755 index 8e3f699..0000000 --- a/apps/web/src/components/common/editor/graph/layout/edge/index.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { EdgeLayout } from "../../types"; -import { getControlPoints, GetControlPointsParams } from "./algorithms"; -import { getLabelPosition, getPathWithRoundCorners } from "./edge"; -import { InternalNode, Node } from "@xyflow/react" -interface GetBasePathParams extends GetControlPointsParams { - borderRadius: number; -} - -export function getBasePath({ - id, - offset, - borderRadius, - source, - target, - sourceX, - sourceY, - targetX, - targetY, - sourcePosition, - targetPosition, -}: any) { - const sourceNode: InternalNode = - kReactFlow.instance!.getNode(source)!; - const targetNode: InternalNode = - kReactFlow.instance!.getNode(target)!; - return getPathWithPoints({ - offset, - borderRadius, - source: { - id: "source-" + id, - x: sourceX, - y: sourceY, - position: sourcePosition, - }, - target: { - id: "target-" + id, - x: targetX, - y: targetY, - position: targetPosition, - }, - sourceRect: { - ...(sourceNode.internals.positionAbsolute || sourceNode.position), - width: sourceNode.width!, - height: sourceNode.height!, - }, - targetRect: { - ...(targetNode.internals.positionAbsolute || targetNode.position), - width: targetNode.width!, - height: targetNode.height!, - }, - }); -} - -export function getPathWithPoints({ - source, - target, - sourceRect, - targetRect, - offset = 20, - borderRadius = 16, -}: GetBasePathParams): EdgeLayout { - const { points, inputPoints } = getControlPoints({ - source, - target, - offset, - sourceRect, - targetRect, - }); - const labelPosition = getLabelPosition(points); - const path = getPathWithRoundCorners(points, borderRadius); - return { path, points, inputPoints, labelPosition }; -} diff --git a/apps/web/src/components/common/editor/graph/layout/edge/point.ts b/apps/web/src/components/common/editor/graph/layout/edge/point.ts deleted file mode 100755 index 7c0fdf1..0000000 --- a/apps/web/src/components/common/editor/graph/layout/edge/point.ts +++ /dev/null @@ -1,623 +0,0 @@ -import { Position } from "@xyflow/react"; -import { isHorizontalFromPosition } from "./edge"; -import { uuid } from "../../utils/uuid"; - -export interface ControlPoint { - id: string; - x: number; - y: number; -} - -export interface NodeRect { - x: number; // left - y: number; // top - width: number; - height: number; -} - -export interface RectSides { - top: number; - right: number; - bottom: number; - left: number; -} - -export interface HandlePosition extends ControlPoint { - position: Position; -} - -export interface GetVerticesParams { - source: NodeRect; - target: NodeRect; - sourceOffset: ControlPoint; - targetOffset: ControlPoint; -} - -/** - * 计算两个节点之间的控制点位置 - * - * 该函数用于在图形编辑器中确定边的控制点,以实现更自然的边布局。 - * 主要应用于: - * 1. 节点之间连线的路径规划 - * 2. 边的弯曲程度控制 - * 3. 避免边与节点重叠 - * - * 实现原理: - * 1. 基于源节点和目标节点构建外部边界矩形 - * 2. 基于偏移点构建内部边界矩形 - * 3. 在两个矩形的边上生成候选控制点 - * 4. 过滤掉无效的控制点 - * - * @param {GetVerticesParams} params - 计算所需的参数 - * @param {Rect} params.source - 源节点的矩形区域,包含x、y、width、height - * @param {Rect} params.target - 目标节点的矩形区域 - * @param {Point} params.sourceOffset - 源节点上的连接点坐标 - * @param {Point} params.targetOffset - 目标节点上的连接点坐标 - * @returns {ControlPoint[]} 有效的控制点数组,每个点包含唯一ID和坐标 - */ -export const getCenterPoints = ({ - source, - target, - sourceOffset, - targetOffset, -}: GetVerticesParams): ControlPoint[] => { - // 特殊情况处理:当源点和目标点在同一直线上时,无法构成有效的控制区域 - if (sourceOffset.x === targetOffset.x || sourceOffset.y === targetOffset.y) { - return []; - } - - // 步骤1: 获取外部边界 - // 收集两个节点的所有顶点,用于构建外部最大矩形 - const vertices = [...getRectVertices(source), ...getRectVertices(target)]; - const outerSides = getSidesFromPoints(vertices); - - // 步骤2: 获取内部边界 - // 根据偏移点(实际连接点)计算内部矩形的四条边 - const { left, right, top, bottom } = getSidesFromPoints([ - sourceOffset, - targetOffset, - ]); - - // 步骤3: 计算中心参考线 - const centerX = (left + right) / 2; // 水平中心线 - const centerY = (top + bottom) / 2; // 垂直中心线 - - // 步骤4: 生成候选控制点 - // 在内外两个矩形的边上各生成4个控制点,共8个候选点 - const points = [ - { id: uuid(), x: centerX, y: top }, // 内矩形-上 - { id: uuid(), x: right, y: centerY }, // 内矩形-右 - { id: uuid(), x: centerX, y: bottom }, // 内矩形-下 - { id: uuid(), x: left, y: centerY }, // 内矩形-左 - { id: uuid(), x: centerX, y: outerSides.top }, // 外矩形-上 - { id: uuid(), x: outerSides.right, y: centerY }, // 外矩形-右 - { id: uuid(), x: centerX, y: outerSides.bottom },// 外矩形-下 - { id: uuid(), x: outerSides.left, y: centerY }, // 外矩形-左 - ]; - - // 步骤5: 过滤无效控制点 - // 移除落在源节点或目标节点内部的控制点,避免边穿过节点 - return points.filter((p) => { - return !isPointInRect(p, source) && !isPointInRect(p, target); - }); -}; - -/** - * 扩展矩形区域 - * @param rect 原始矩形区域 - * @param offset 扩展偏移量 - * @returns 扩展后的新矩形区域 - * - * 该函数将一个矩形区域向四周扩展指定的偏移量。 - * 扩展规则: - * 1. x和y坐标各向外偏移offset距离 - * 2. 宽度和高度各增加2*offset - */ -export const getExpandedRect = (rect: NodeRect, offset: number): NodeRect => { - return { - x: rect.x - offset, - y: rect.y - offset, - width: rect.width + 2 * offset, - height: rect.height + 2 * offset, - }; -}; - -/** - * 检测两个矩形是否重叠 - * @param rect1 第一个矩形 - * @param rect2 第二个矩形 - * @returns 布尔值,true表示重叠,false表示不重叠 - * - * 使用AABB(轴对齐包围盒)碰撞检测算法: - * 1. 计算x轴投影是否重叠 - * 2. 计算y轴投影是否重叠 - * 两个轴向都重叠则矩形重叠 - */ -export const isRectOverLapping = (rect1: NodeRect, rect2: NodeRect) => { - return ( - Math.abs(rect1.x - rect2.x) < (rect1.width + rect2.width) / 2 && - Math.abs(rect1.y - rect2.y) < (rect1.height + rect2.height) / 2 - ); -}; - -/** - * 判断点是否在矩形内 - * @param p 待检测的控制点 - * @param box 矩形区域 - * @returns 布尔值,true表示点在矩形内,false表示点在矩形外 - * - * 点在矩形内的条件: - * 1. x坐标在矩形左右边界之间 - * 2. y坐标在矩形上下边界之间 - */ -export const isPointInRect = (p: ControlPoint, box: NodeRect) => { - const sides = getRectSides(box); - return ( - p.x >= sides.left && - p.x <= sides.right && - p.y >= sides.top && - p.y <= sides.bottom - ); -}; - -/** - * 矩形顶点计算模块 - * 用于处理图形编辑器中矩形节点的顶点、边界等几何计算 - * 主要应用于连线路径规划和节点定位 - */ - -/** - * 根据矩形和外部顶点计算包围矩形的顶点坐标 - * @param box 原始矩形的位置和尺寸信息 - * @param vertex 外部控制点 - * @returns 包围矩形的四个顶点坐标 - * 算法思路: - * 1. 合并外部顶点和原矩形的顶点 - * 2. 计算所有点的边界范围 - * 3. 根据边界生成新的矩形顶点 - */ -export const getVerticesFromRectVertex = ( - box: NodeRect, - vertex: ControlPoint -): ControlPoint[] => { - const points = [vertex, ...getRectVertices(box)]; - const { top, right, bottom, left } = getSidesFromPoints(points); - return [ - { id: uuid(), x: left, y: top }, // 左上角顶点 - { id: uuid(), x: right, y: top }, // 右上角顶点 - { id: uuid(), x: right, y: bottom }, // 右下角顶点 - { id: uuid(), x: left, y: bottom }, // 左下角顶点 - ]; -}; - -/** - * 计算一组点的边界范围 - * @param points 控制点数组 - * @returns 返回边界的上下左右极值 - * 实现方式: - * - 使用数组map和Math.min/max计算坐标的最值 - */ -export const getSidesFromPoints = (points: ControlPoint[]) => { - const left = Math.min(...points.map((p) => p.x)); // 最左侧x坐标 - const right = Math.max(...points.map((p) => p.x)); // 最右侧x坐标 - const top = Math.min(...points.map((p) => p.y)); // 最上方y坐标 - const bottom = Math.max(...points.map((p) => p.y)); // 最下方y坐标 - return { top, right, bottom, left }; -}; - -/** - * 获取矩形的四条边界位置 - * @param box 矩形的位置和尺寸信息 - * @returns 矩形的上下左右边界坐标 - * 计算方式: - * - 左边界 = x坐标 - * - 右边界 = x + width - * - 上边界 = y坐标 - * - 下边界 = y + height - */ -export const getRectSides = (box: NodeRect): RectSides => { - const { x: left, y: top, width, height } = box; - const right = left + width; - const bottom = top + height; - return { top, right, bottom, left }; -}; - -/** - * 根据边界信息生成矩形的四个顶点 - * @param sides 矩形的上下左右边界坐标 - * @returns 返回四个顶点的坐标信息 - * 顶点顺序: 左上 -> 右上 -> 右下 -> 左下 - */ -export const getRectVerticesFromSides = ({ - top, - right, - bottom, - left, -}: RectSides): ControlPoint[] => { - return [ - { id: uuid(), x: left, y: top }, // 左上角顶点 - { id: uuid(), x: right, y: top }, // 右上角顶点 - { id: uuid(), x: right, y: bottom }, // 右下角顶点 - { id: uuid(), x: left, y: bottom }, // 左下角顶点 - ]; -}; - -/** - * 获取矩形的四个顶点坐标 - * @param box 矩形的位置和尺寸信息 - * @returns 返回矩形四个顶点的坐标 - * 实现流程: - * 1. 先计算矩形的边界 - * 2. 根据边界生成顶点 - */ -export const getRectVertices = (box: NodeRect) => { - const sides = getRectSides(box); - return getRectVerticesFromSides(sides); -}; -/** - * 合并多个矩形区域,返回一个能包含所有输入矩形的最小矩形 - * @param boxes 需要合并的矩形数组,每个矩形包含 x,y 坐标和宽高信息 - * @returns 合并后的最小包围矩形 - * - * 实现原理: - * 1. 找出所有矩形中最左边的 x 坐标(left)和最右边的 x 坐标(right) - * 2. 找出所有矩形中最上边的 y 坐标(top)和最下边的 y 坐标(bottom) - * 3. 用这四个边界值构造出新的矩形 - */ -export const mergeRects = (...boxes: NodeRect[]): NodeRect => { - // 计算所有矩形的最左边界 - const left = Math.min( - ...boxes.reduce((pre, e) => [...pre, e.x, e.x + e.width], [] as number[]) - ); - // 计算所有矩形的最右边界 - const right = Math.max( - ...boxes.reduce((pre, e) => [...pre, e.x, e.x + e.width], [] as number[]) - ); - // 计算所有矩形的最上边界 - const top = Math.min( - ...boxes.reduce((pre, e) => [...pre, e.y, e.y + e.height], [] as number[]) - ); - // 计算所有矩形的最下边界 - const bottom = Math.max( - ...boxes.reduce((pre, e) => [...pre, e.y, e.y + e.height], [] as number[]) - ); - - // 返回能包含所有输入矩形的最小矩形 - return { - x: left, // 左上角 x 坐标 - y: top, // 左上角 y 坐标 - width: right - left, // 宽度 = 最右边界 - 最左边界 - height: bottom - top, // 高度 = 最下边界 - 最上边界 - }; -}; - -/** - * 根据给定的位置和偏移量计算控制点坐标 - * @param box - 起始位置信息,包含x、y坐标和位置类型(上下左右) - * @param offset - 偏移距离 - * @returns 返回计算后的控制点对象,包含唯一id和新的x、y坐标 - */ -export const getOffsetPoint = ( - box: HandlePosition, - offset: number -): ControlPoint => { - // 根据不同的位置类型计算偏移后的坐标 - switch (box.position) { - case Position.Top: // 顶部位置,y坐标向上偏移 - return { - id: uuid(), - x: box.x, - y: box.y - offset, - }; - case Position.Bottom: // 底部位置,y坐标向下偏移 - return { id: uuid(), x: box.x, y: box.y + offset }; - case Position.Left: // 左侧位置,x坐标向左偏移 - return { id: uuid(), x: box.x - offset, y: box.y }; - case Position.Right: // 右侧位置,x坐标向右偏移 - return { id: uuid(), x: box.x + offset, y: box.y }; - } -}; - -/** - * 判断一个点是否在线段上 - * @param p - 待判断的点 - * @param p1 - 线段起点 - * @param p2 - 线段终点 - * @returns 如果点在线段上返回true,否则返回false - * - * 判断逻辑: - * 1. 点必须在线段所在的直线上(x坐标相等或y坐标相等) - * 2. 点的坐标必须在线段两端点坐标范围内 - */ -export const isInLine = ( - p: ControlPoint, - p1: ControlPoint, - p2: ControlPoint -) => { - // 获取x坐标的范围区间[min, max] - const xPoints = p1.x < p2.x ? [p1.x, p2.x] : [p2.x, p1.x]; - // 获取y坐标的范围区间[min, max] - const yPoints = p1.y < p2.y ? [p1.y, p2.y] : [p2.y, p1.y]; - - return ( - // 垂直线段:三点x坐标相等,且待判断点的y坐标在范围内 - (p1.x === p.x && p.x === p2.x && p.y >= yPoints[0] && p.y <= yPoints[1]) || - // 水平线段:三点y坐标相等,且待判断点的x坐标在范围内 - (p1.y === p.y && p.y === p2.y && p.x >= xPoints[0] && p.x <= xPoints[1]) - ); -}; - -/** - * 判断一个点是否在直线上(不考虑线段端点限制) - * @param p - 待判断的点 - * @param p1 - 直线上的点1 - * @param p2 - 直线上的点2 - * @returns 如果点在直线上返回true,否则返回false - * - * 判断逻辑: - * 仅判断点是否与直线上的两点共线(x坐标相等或y坐标相等) - */ -export const isOnLine = ( - p: ControlPoint, - p1: ControlPoint, - p2: ControlPoint -) => { - return (p1.x === p.x && p.x === p2.x) || (p1.y === p.y && p.y === p2.y); -}; -export interface OptimizePointsParams { - edgePoints: ControlPoint[]; - source: HandlePosition; - target: HandlePosition; - sourceOffset: ControlPoint; - targetOffset: ControlPoint; -} - -/** - * 优化边的控制点 - * - * 主要功能: - * 1. 合并坐标相近的点 - * 2. 删除重复的坐标点 - * 3. 修正起点和终点的位置 - * - * @param p 包含边的起点、终点、偏移点和中间控制点等信息的参数对象 - * @returns 优化后的控制点信息,包含起点、终点、起点偏移、终点偏移和中间控制点 - */ -export const optimizeInputPoints = (p: OptimizePointsParams) => { - // 合并坐标相近的点,将所有点放入一个数组进行处理 - let edgePoints = mergeClosePoints([ - p.source, - p.sourceOffset, - ...p.edgePoints, - p.targetOffset, - p.target, - ]); - - // 从合并后的点中提取起点和终点 - const source = edgePoints.shift()!; - const target = edgePoints.pop()!; - const sourceOffset = edgePoints[0]; - const targetOffset = edgePoints[edgePoints.length - 1]; - - // 根据起点和终点的位置类型修正其坐标 - // 如果是水平方向,则保持x坐标不变;否则保持y坐标不变 - if (isHorizontalFromPosition(p.source.position)) { - source.x = p.source.x; - } else { - source.y = p.source.y; - } - if (isHorizontalFromPosition(p.target.position)) { - target.x = p.target.x; - } else { - target.y = p.target.y; - } - - // 移除重复的坐标点,并为每个点分配唯一ID - edgePoints = removeRepeatPoints(edgePoints).map((p, idx) => ({ - ...p, - id: `${idx + 1}`, - })); - - return { source, target, sourceOffset, targetOffset, edgePoints }; -}; - -/** - * 简化边的控制点 - * - * 主要功能: - * 1. 确保直线上只保留两个端点 - * 2. 移除位于直线内部的控制点 - * - * 实现原理: - * - 遍历所有中间点 - * - 判断每个点是否在其相邻两点形成的直线上 - * - 如果在直线上则移除该点 - * - * @param points 原始控制点数组 - * @returns 简化后的控制点数组 - */ -export function reducePoints(points: ControlPoint[]): ControlPoint[] { - const optimizedPoints = [points[0]]; - - // 遍历除首尾点外的所有点 - for (let i = 1; i < points.length - 1; i++) { - // 判断当前点是否在前后两点形成的直线上 - const inSegment = isInLine(points[i], points[i - 1], points[i + 1]); - // 如果不在直线上,则保留该点 - if (!inSegment) { - optimizedPoints.push(points[i]); - } - } - - optimizedPoints.push(points[points.length - 1]); - return optimizedPoints; -} -/** - * 坐标点处理工具函数集合 - * 主要用于图形边缘控制点的坐标处理,包括合并、去重等操作 - */ - -/** - * 合并临近坐标点,同时将坐标值取整 - * @param points 控制点数组 - * @param threshold 合并阈值,默认为4个像素 - * @returns 处理后的控制点数组 - * - * 实现原理: - * 1. 分别记录x和y轴上的所有坐标值 - * 2. 对每个新坐标,在阈值范围内查找已存在的相近值 - * 3. 如果找到相近值则使用已存在值,否则添加新值 - */ -export function mergeClosePoints( - points: ControlPoint[], - threshold = 4 -): ControlPoint[] { - // 存储已处理的离散坐标值 - const positions = { x: [] as number[], y: [] as number[] }; - - /** - * 查找或添加坐标值 - * @param axis 坐标轴('x'|'y') - * @param v 待处理的坐标值 - * @returns 最终使用的坐标值 - */ - const findPosition = (axis: "x" | "y", v: number) => { - // 向下取整,确保坐标为整数 - v = Math.floor(v); - const ps = positions[axis]; - // 在阈值范围内查找已存在的相近值 - let p = ps.find((e) => Math.abs(v - e) < threshold); - // 如果没找到相近值,则添加新值 - if (p == null) { - p = v; - positions[axis].push(v); - } - return p; - }; - - // 处理每个控制点的坐标 - const finalPoints = points.map((point) => { - return { - ...point, - x: findPosition("x", point.x), - y: findPosition("y", point.y), - }; - }); - - return finalPoints; -} - -/** - * 判断两个控制点是否重合 - * @param p1 控制点1 - * @param p2 控制点2 - * @returns 是否重合 - */ -export function isEqualPoint(p1: ControlPoint, p2: ControlPoint) { - return p1.x === p2.x && p1.y === p2.y; -} - -/** - * 移除重复的控制点,但保留起点和终点 - * @param points 控制点数组 - * @returns 去重后的控制点数组 - * - * 实现思路: - * 1. 使用Set存储已处理的坐标字符串(格式:"x-y") - * 2. 保留最后一个点(终点) - * 3. 遍历时跳过重复坐标,但保留第一次出现的点 - */ -export function removeRepeatPoints(points: ControlPoint[]): ControlPoint[] { - // 先添加终点坐标,确保终点被保留 - const lastP = points[points.length - 1]; - const uniquePoints = new Set([`${lastP.x}-${lastP.y}`]); - const finalPoints: ControlPoint[] = []; - - points.forEach((p, idx) => { - // 处理终点 - if (idx === points.length - 1) { - return finalPoints.push(p); - } - // 使用坐标字符串作为唯一标识 - const key = `${p.x}-${p.y}`; - if (!uniquePoints.has(key)) { - uniquePoints.add(key); - finalPoints.push(p); - } - }); - return finalPoints; -} -/** - * 判断两条线段是否相交 - * @param p0 第一条线段的起点 - * @param p1 第一条线段的终点 - * @param p2 第二条线段的起点 - * @param p3 第二条线段的终点 - * @returns 如果两线段相交返回true,否则返回false - * - * 实现原理: - * 1. 使用向量叉积判断两线段是否平行 - * 2. 使用参数方程求解交点参数s和t - * 3. 判断参数是否在[0,1]区间内来确定是否相交 - */ -const isSegmentsIntersected = ( - p0: ControlPoint, - p1: ControlPoint, - p2: ControlPoint, - p3: ControlPoint -): boolean => { - // 计算两条线段的方向向量 - const s1x = p1.x - p0.x; - const s1y = p1.y - p0.y; - const s2x = p3.x - p2.x; - const s2y = p3.y - p2.y; - - // 使用向量叉积判断两线段是否平行 - if (s1x * s2y - s1y * s2x === 0) { - // 平行线段必不相交 - return false; - } - - // 求解参数方程,获取交点参数s和t - const denominator = -s2x * s1y + s1x * s2y; - const s = (s1y * (p2.x - p0.x) - s1x * (p2.y - p0.y)) / denominator; - const t = (s2x * (p0.y - p2.y) - s2y * (p0.x - p2.x)) / denominator; - - // 当且仅当s和t都在[0,1]区间内时,两线段相交 - return s >= 0 && s <= 1 && t >= 0 && t <= 1; -}; - -/** - * 判断线段是否与矩形相交 - * @param p1 线段起点 - * @param p2 线段终点 - * @param box 矩形区域 - * @returns 如果线段与矩形有交点返回true,否则返回false - * - * 实现思路: - * 1. 首先处理特殊情况:矩形退化为点时必不相交 - * 2. 将矩形分解为四条边 - * 3. 判断线段是否与任意一条矩形边相交 - * 4. 只要与任意一边相交,则与矩形相交 - */ -export const isSegmentCrossingRect = ( - p1: ControlPoint, - p2: ControlPoint, - box: NodeRect -): boolean => { - // 处理特殊情况:矩形退化为点 - if (box.width === 0 && box.height === 0) { - return false; - } - - // 获取矩形的四个顶点 - const [topLeft, topRight, bottomRight, bottomLeft] = getRectVertices(box); - - // 判断线段是否与矩形的任意一条边相交 - return ( - isSegmentsIntersected(p1, p2, topLeft, topRight) || // 上边 - isSegmentsIntersected(p1, p2, topRight, bottomRight) || // 右边 - isSegmentsIntersected(p1, p2, bottomRight, bottomLeft) || // 下边 - isSegmentsIntersected(p1, p2, bottomLeft, topLeft) // 左边 - ); -}; \ No newline at end of file diff --git a/apps/web/src/components/common/editor/graph/layout/edge/style.ts b/apps/web/src/components/common/editor/graph/layout/edge/style.ts deleted file mode 100755 index 2ff26cf..0000000 --- a/apps/web/src/components/common/editor/graph/layout/edge/style.ts +++ /dev/null @@ -1,200 +0,0 @@ -import { deepClone, lastOf } from "@/utils/base"; -import { Position, getBezierPath } from "reactflow"; - -import { getBasePath } from "."; -import { - kBaseMarkerColor, - kBaseMarkerColors, - kNoMarkerColor, - kYesMarkerColor, -} from "../../components/Edges/Marker"; -import { isEqual } from "../../utils/diff"; -import { EdgeLayout, ReactFlowEdgeWithData } from "../../data/types"; -import { kReactFlow } from "../../states/reactflow"; -import { getPathWithRoundCorners } from "./edge"; - -interface EdgeStyle { - color: string; - edgeType: "solid" | "dashed"; - pathType: "base" | "bezier"; -} - -/** - * Get the style of the connection line - * - * 1. When there are more than 3 edges connecting to both ends of the Node, use multiple colors to distinguish the edges. - * 2. When the connection line goes backward or connects to a hub Node, use dashed lines to distinguish the edges. - * 3. When the connection line goes from a hub to a Node, use bezier path. - */ -export const getEdgeStyles = (props: { - id: string; - isBackward: boolean; -}): EdgeStyle => { - const { id, isBackward } = props; - const idx = parseInt(lastOf(id.split("#")) ?? "0", 10); - if (isBackward) { - // Use dashed lines to distinguish the edges when the connection line goes backward or connects to a hub Node - return { color: kNoMarkerColor, edgeType: "dashed", pathType: "base" }; - } - const edge: ReactFlowEdgeWithData = kReactFlow.instance!.getEdge(id)!; - if (edge.data!.targetPort.edges > 2) { - // Use dashed bezier path when the connection line connects to a hub Node - return { - color: kYesMarkerColor, - edgeType: "dashed", - pathType: "bezier", - }; - } - if (edge.data!.sourcePort.edges > 2) { - // Use multiple colors to distinguish the edges when there are more than 3 edges connecting to both ends of the Node - return { - color: kBaseMarkerColors[idx % kBaseMarkerColors.length], - edgeType: "solid", - pathType: "base", - }; - } - return { color: kBaseMarkerColor, edgeType: "solid", pathType: "base" }; -}; - -interface ILayoutEdge { - id: string; - layout?: EdgeLayout; - offset: number; - borderRadius: number; - pathType: EdgeStyle["pathType"]; - source: string; - target: string; - sourceX: number; - sourceY: number; - targetX: number; - targetY: number; - sourcePosition: Position; - targetPosition: Position; -} - -export function layoutEdge({ - id, - layout, - offset, - borderRadius, - pathType, - source, - target, - sourceX, - sourceY, - targetX, - targetY, - sourcePosition, - targetPosition, -}: ILayoutEdge): EdgeLayout { - const relayoutDeps = [sourceX, sourceY, targetX, targetY]; - const needRelayout = !isEqual(relayoutDeps, layout?.deps?.relayoutDeps); - const reBuildPathDeps = layout?.points; - const needReBuildPath = !isEqual( - reBuildPathDeps, - layout?.deps?.reBuildPathDeps - ); - let newLayout = layout; - if (needRelayout) { - newLayout = _layoutEdge({ - id, - offset, - borderRadius, - pathType, - source, - target, - sourceX, - sourceY, - targetX, - targetY, - sourcePosition, - targetPosition, - }); - } else if (needReBuildPath) { - newLayout = _layoutEdge({ - layout, - id, - offset, - borderRadius, - pathType, - source, - target, - sourceX, - sourceY, - targetX, - targetY, - sourcePosition, - targetPosition, - }); - } - newLayout!.deps = deepClone({ relayoutDeps, reBuildPathDeps }); - return newLayout!; -} - -function _layoutEdge({ - id, - layout, - offset, - borderRadius, - pathType, - source, - target, - sourceX, - sourceY, - targetX, - targetY, - sourcePosition, - targetPosition, -}: ILayoutEdge): EdgeLayout { - const _pathType: EdgeStyle["pathType"] = pathType; - if (_pathType === "bezier") { - const [path, labelX, labelY] = getBezierPath({ - sourceX, - sourceY, - targetX, - targetY, - sourcePosition, - targetPosition, - }); - const points = [ - { - id: "source-" + id, - x: sourceX, - y: sourceY, - }, - { - id: "target-" + id, - x: targetX, - y: targetY, - }, - ]; - return { - path, - points, - inputPoints: points, - labelPosition: { - x: labelX, - y: labelY, - }, - }; - } - - if ((layout?.points?.length ?? 0) > 1) { - layout!.path = getPathWithRoundCorners(layout!.points, borderRadius); - return layout!; - } - - return getBasePath({ - id, - offset, - borderRadius, - source, - target, - sourceX, - sourceY, - targetX, - targetY, - sourcePosition, - targetPosition, - }); -} diff --git a/apps/web/src/components/common/editor/graph/layout/index.ts b/apps/web/src/components/common/editor/graph/layout/index.ts deleted file mode 100755 index 45022e5..0000000 --- a/apps/web/src/components/common/editor/graph/layout/index.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Node, Edge } from "@xyflow/react"; -import { LayoutOptions, LayoutStrategy } from "./types"; -import { TreeLayout } from "./TreeLayout"; -import { MindMapLayout } from "./MindMapLayout"; -import { SingleMapLayout } from "./SingleMapLayout"; - -// 布局工厂类 -class LayoutFactory { - static createLayout(type: 'mindmap' | 'tree' | 'force' | 'single'): LayoutStrategy { - switch (type) { - case 'mindmap': - return new MindMapLayout(); - case 'tree': - return new TreeLayout(); - case 'single': - return new SingleMapLayout() - case 'force': - // return new ForceLayout(); // 待实现 - default: - return new MindMapLayout(); - } - } -} - -// 导出布局函数 -export function getLayout(type: 'mindmap' | 'tree' | 'force' | 'single', options: LayoutOptions) { - const layoutStrategy = LayoutFactory.createLayout(type); - return layoutStrategy.layout(options); -} - -// 为了保持向后兼容,保留原有的导出 -export function getMindMapLayout(options: LayoutOptions) { - return getLayout("single", options); -} \ No newline at end of file diff --git a/apps/web/src/components/common/editor/graph/layout/metadata.ts b/apps/web/src/components/common/editor/graph/layout/metadata.ts deleted file mode 100755 index 992f95a..0000000 --- a/apps/web/src/components/common/editor/graph/layout/metadata.ts +++ /dev/null @@ -1,148 +0,0 @@ -import { MarkerType, Position, useInternalNode, Node, Edge } from "@xyflow/react"; -import { LayoutDirection, LayoutVisibility } from "./node"; - -/** - * 获取流程图中的根节点 - * @param nodes - 所有节点数组 - * @param edges - 所有边的数组 - * @returns 根节点数组(没有入边的节点) - */ -export const getRootNodes = (nodes: Node[], edges: Edge[]): Node[] => { - // 创建一个Set来存储所有有入边的节点ID - const nodesWithIncoming = new Set( - edges.map((edge) => edge.target) - ); - - // 过滤出没有入边的节点 - const rootNodes = nodes.filter( - (node) => !nodesWithIncoming.has(node.id) - ); - - return rootNodes; -}; -/** - * 获取节点尺寸信息的工具函数 - * @param node 需要获取尺寸的节点对象 - * @param defaultSize 默认尺寸配置,包含默认宽度(150px)和高度(36px) - * @returns 返回节点的尺寸信息对象,包含: - * - hasDimension: 是否已设置实际尺寸 - * - width: 节点实际宽度 - * - height: 节点实际高度 - * - widthWithDefault: 实际宽度或默认宽度 - * - heightWithDefault: 实际高度或默认高度 - */ -export const getNodeSize = ( - node: Node, - defaultSize = { width: 150, height: 36 } -) => { - // 获取节点的实际宽高 - const nodeWith = node?.width; - const nodeHeight = node?.height; - // 检查节点是否同时设置了宽度和高度 - const hasDimension = [nodeWith, nodeHeight].every((e) => e != null); - - // 返回包含完整尺寸信息的对象 - // 使用空值合并运算符(??)在实际尺寸未设置时使用默认值 - return { - hasDimension, - width: nodeWith, - height: nodeHeight, - widthWithDefault: nodeWith ?? defaultSize.width, - heightWithDefault: nodeHeight ?? defaultSize.height, - }; -}; - -export type IFixPosition = (pros: { - x: number; - y: number; - width: number; - height: number; -}) => { - x: number; - y: number; -}; -/** - * 节点布局计算函数 - * @description 根据给定的节点信息和布局参数,计算节点的最终布局属性 - * @param props 布局参数对象 - * @param props.node 需要布局的节点对象 - * @param props.position 节点的初始位置坐标 - * @param props.direction 布局方向,'horizontal'表示水平布局,'vertical'表示垂直布局 - * @param props.visibility 节点可见性,'visible'表示可见,其他值表示隐藏 - * @param props.fixPosition 可选的位置修正函数,用于调整最终位置 - * @returns 返回计算好布局属性的节点对象 - */ -export const getNodeLayouted = (props: { - node: Node; - position: { x: number; y: number }; - direction: LayoutDirection; - visibility: LayoutVisibility; - fixPosition?: IFixPosition; -}) => { - // 解构布局参数,设置位置修正函数的默认值 - const { - node, - position, - direction, - visibility, - fixPosition = (p) => ({ x: p.x, y: p.y }), - } = props; - - // 计算节点的显示状态和布局方向 - const hidden = visibility !== "visible"; - const isHorizontal = direction === "horizontal"; - - // 获取节点尺寸信息 - const { width, height, widthWithDefault, heightWithDefault } = - getNodeSize(node); - - // 根据布局方向设置节点的连接点位置 - node.targetPosition = isHorizontal ? Position.Left : Position.Top; - node.sourcePosition = isHorizontal ? Position.Right : Position.Bottom; - - // 返回带有完整布局属性的节点对象 - return { - ...node, - width, - height, - hidden, - position: fixPosition({ - ...position, - width: widthWithDefault, - height: heightWithDefault, - }), - style: { - ...node.style, - opacity: hidden ? 0 : 1, - }, - }; -}; - -/** - * 边布局计算函数 - * @description 根据给定的边信息和可见性参数,计算边的最终布局属性 - * @param props 布局参数对象 - * @param props.edge 需要布局的边对象 - * @param props.visibility 边的可见性,'visible'表示可见,其他值表示隐藏 - * @returns 返回计算好布局属性的边对象 - */ -export const getEdgeLayouted = (props: { - edge: Edge; - visibility: LayoutVisibility; -}) => { - const { edge, visibility } = props; - const hidden = visibility !== "visible"; - - // 返回带有完整布局属性的边对象 - return { - ...edge, - hidden, - markerEnd: { - type: MarkerType.ArrowClosed, // 设置箭头样式为闭合箭头 - }, - style: { - ...edge.style, - opacity: hidden ? 0 : 1, - }, - }; -}; \ No newline at end of file diff --git a/apps/web/src/components/common/editor/graph/layout/node/algorithms/d3-dag.ts b/apps/web/src/components/common/editor/graph/layout/node/algorithms/d3-dag.ts deleted file mode 100755 index 92ec51f..0000000 --- a/apps/web/src/components/common/editor/graph/layout/node/algorithms/d3-dag.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { graphStratify, sugiyama } from "d3-dag"; -import { getIncomers, type Node } from "@xyflow/react"; -import { getEdgeLayouted, getNodeLayouted, getNodeSize } from "../../metadata"; -import { LayoutAlgorithm, LayoutAlgorithmProps } from ".."; -type NodeWithPosition = Node & { x: number; y: number }; - -// Since d3-dag layout algorithm does not support multiple root nodes, -// we attach the sub-workflows to the global rootNode. -const rootNode: NodeWithPosition = { - id: "#root", - x: 0, - y: 0, - position: { x: 0, y: 0 }, - data: {} as any, -}; - -const algorithms = { - "d3-dag": "d3-dag", - "ds-dag(s)": "ds-dag(s)", -}; - -export type D3DAGLayoutAlgorithms = "d3-dag" | "ds-dag(s)"; - -export const layoutD3DAG = async ( - props: LayoutAlgorithmProps & { algorithm?: D3DAGLayoutAlgorithms } -) => { - const { - nodes, - edges, - direction, - visibility, - spacing, - algorithm = "d3-dag", - } = props; - const isHorizontal = direction === "horizontal"; - - const initialNodes = [] as NodeWithPosition[]; - let maxNodeWidth = 0; - let maxNodeHeight = 0; - for (const node of nodes) { - const { widthWithDefault, heightWithDefault } = getNodeSize(node); - initialNodes.push({ - ...node, - ...node.position, - width: widthWithDefault, - height: heightWithDefault, - }); - maxNodeWidth = Math.max(maxNodeWidth, widthWithDefault); - maxNodeHeight = Math.max(maxNodeHeight, heightWithDefault); - } - - // Since d3-dag does not support horizontal layout, - // we swap the width and height of nodes and interchange x and y mappings based on the layout direction. - const nodeSize: any = isHorizontal - ? [maxNodeHeight + spacing.y, maxNodeWidth + spacing.x] - : [maxNodeWidth + spacing.x, maxNodeHeight + spacing.y]; - - const getParentIds = (node: Node) => { - if (node.id === rootNode.id) { - return undefined; - } - // Node without input is the root node of sub-workflow, and we should connect it to the rootNode - const incomers = getIncomers(node, nodes, edges); - if (incomers.length < 1) { - return [rootNode.id]; - } - return algorithm === "d3-dag" - ? [incomers[0]?.id] - : incomers.map((e) => e.id); - }; - - const stratify = graphStratify(); - const dag = stratify( - [rootNode, ...initialNodes].map((node) => { - return { - id: node.id, - parentIds: getParentIds(node), - }; - }) - ); - - const layout = sugiyama().nodeSize(nodeSize); - layout(dag); - - const layoutNodes = new Map(); - for (const node of dag.nodes()) { - layoutNodes.set(node.data.id, node); - } - - return { - nodes: nodes.map((node) => { - const { x, y } = layoutNodes.get(node.id); - // Interchange x and y mappings based on the layout direction. - const position = isHorizontal ? { x: y, y: x } : { x, y }; - return getNodeLayouted({ - node, - position, - direction, - visibility, - fixPosition: ({ x, y, width, height }) => { - // This algorithm uses the center coordinate of the node as the reference point, - // which needs adjustment for ReactFlow's topLeft coordinate system. - return { - x: x - width / 2, - y: y - height / 2, - }; - }, - }); - }), - edges: edges.map((edge) => getEdgeLayouted({ edge, visibility })), - }; -}; - -export const kD3DAGAlgorithms: Record = Object.keys( - algorithms -).reduce((pre, algorithm) => { - pre[algorithm] = (props: any) => { - return layoutD3DAG({ ...props, algorithm }); - }; - return pre; -}, {} as any); diff --git a/apps/web/src/components/common/editor/graph/layout/node/algorithms/d3-hierarchy.ts b/apps/web/src/components/common/editor/graph/layout/node/algorithms/d3-hierarchy.ts deleted file mode 100755 index eae2813..0000000 --- a/apps/web/src/components/common/editor/graph/layout/node/algorithms/d3-hierarchy.ts +++ /dev/null @@ -1,89 +0,0 @@ -// Based on: https://github.com/flanksource/flanksource-ui/blob/75b35591d3bbc7d446fa326d0ca7536790f38d88/src/ui/Graphs/Layouts/algorithms/d3-hierarchy.ts - -import { stratify, tree, type HierarchyPointNode } from "d3-hierarchy"; -import {getIncomers, Node} from "@xyflow/react" -import { LayoutAlgorithm } from ".."; -import { getEdgeLayouted, getNodeLayouted, getNodeSize } from "../../metadata"; -type NodeWithPosition = Node & { x: number; y: number }; - -const layout = tree().separation(() => 1); - -// Since d3-hierarchy layout algorithm does not support multiple root nodes, -// we attach the sub-workflows to the global rootNode. -const rootNode: NodeWithPosition = { - id: "#root", - x: 0, - y: 0, - position: { x: 0, y: 0 }, - data: {} as any, -}; - -export const layoutD3Hierarchy: LayoutAlgorithm = async (props) => { - const { nodes, edges, direction, visibility, spacing } = props; - const isHorizontal = direction === "horizontal"; - - const initialNodes = [] as NodeWithPosition[]; - let maxNodeWidth = 0; - let maxNodeHeight = 0; - for (const node of nodes) { - const { widthWithDefault, heightWithDefault } = getNodeSize(node); - initialNodes.push({ - ...node, - ...node.position, - width: widthWithDefault, - height: heightWithDefault, - }); - maxNodeWidth = Math.max(maxNodeWidth, widthWithDefault); - maxNodeHeight = Math.max(maxNodeHeight, heightWithDefault); - } - - // Since d3-hierarchy does not support horizontal layout, - // we swap the width and height of nodes and interchange x and y mappings based on the layout direction. - const nodeSize: [number, number] = isHorizontal - ? [maxNodeHeight + spacing.y, maxNodeWidth + spacing.x] - : [maxNodeWidth + spacing.x, maxNodeHeight + spacing.y]; - - layout.nodeSize(nodeSize); - - const getParentId = (node: Node) => { - if (node.id === rootNode.id) { - return undefined; - } - // Node without input is the root node of sub-workflow, and we should connect it to the rootNode - const incomers = getIncomers(node, nodes, edges); - return incomers[0]?.id || rootNode.id; - }; - - const hierarchy = stratify() - .id((d) => d.id) - .parentId(getParentId)([rootNode, ...initialNodes]); - - const root = layout(hierarchy); - const layoutNodes = new Map>(); - for (const node of root) { - layoutNodes.set(node.id!, node); - } - - return { - nodes: nodes.map((node) => { - const { x, y } = layoutNodes.get(node.id)!; - // Interchange x and y mappings based on the layout direction. - const position = isHorizontal ? { x: y, y: x } : { x, y }; - return getNodeLayouted({ - node, - position, - direction, - visibility, - fixPosition: ({ x, y, width, height }) => { - // This algorithm uses the center coordinate of the node as the reference point, - // which needs adjustment for ReactFlow's topLeft coordinate system. - return { - x: x - width / 2, - y: y - height / 2, - }; - }, - }); - }), - edges: edges.map((edge) => getEdgeLayouted({ edge, visibility })), - }; -}; diff --git a/apps/web/src/components/common/editor/graph/layout/node/algorithms/dagre-tree.ts b/apps/web/src/components/common/editor/graph/layout/node/algorithms/dagre-tree.ts deleted file mode 100755 index 000b560..0000000 --- a/apps/web/src/components/common/editor/graph/layout/node/algorithms/dagre-tree.ts +++ /dev/null @@ -1,122 +0,0 @@ -import dagre from "@dagrejs/dagre"; -import { LayoutAlgorithm } from ".."; -import { getIncomers, Node } from "@xyflow/react"; -import { getEdgeLayouted, getNodeLayouted, getNodeSize } from "../../metadata"; -import { randomInt } from "../../../utils/base"; - -// 布局配置常量 -const LAYOUT_CONFIG = { - VIRTUAL_ROOT_ID: '#root', - VIRTUAL_NODE_SIZE: 1, - RANKER: 'tight-tree', -} as const; - -// 创建并配置 dagre 图实例 -const createDagreGraph = () => { - const graph = new dagre.graphlib.Graph(); - graph.setDefaultEdgeLabel(() => ({})); - return graph; -}; - -// 获取布局方向配置 -const getLayoutConfig = ( - direction: 'horizontal' | 'vertical', - spacing: { x: number, y: number }, - graph: dagre.graphlib.Graph -) => ({ - nodesep: direction === 'horizontal' ? spacing.y : spacing.x, - ranksep: direction === 'horizontal' ? spacing.x : spacing.y, - ranker: LAYOUT_CONFIG.RANKER, - rankdir: direction === 'horizontal' ? 'LR' : 'TB', - -}); - -// 查找根节点 -const findRootNodes = (nodes: Node[], edges: any[]): Node[] => - nodes.filter(node => getIncomers(node, nodes, edges).length < 1); - -// 计算节点边界 -const calculateBounds = (nodes: Node[], graph: dagre.graphlib.Graph) => { - const bounds = { - minX: Number.POSITIVE_INFINITY, - minY: Number.POSITIVE_INFINITY, - maxX: Number.NEGATIVE_INFINITY, - maxY: Number.NEGATIVE_INFINITY, - }; - - nodes.forEach(node => { - const pos = graph.node(node.id); - if (pos) { - bounds.minX = Math.min(bounds.minX, pos.x); - bounds.minY = Math.min(bounds.minY, pos.y); - bounds.maxX = Math.max(bounds.maxX, pos.x); - bounds.maxY = Math.max(bounds.maxY, pos.y); - } - }); - - return bounds; -}; - -export const layoutDagreTree: LayoutAlgorithm = async ({ - nodes, - edges, - direction, - visibility, - spacing -}) => { - const dagreGraph = createDagreGraph(); - - // 设置图的布局参数 - dagreGraph.setGraph(getLayoutConfig(direction, spacing, dagreGraph)); - - // 添加节点 - nodes.forEach((node) => { - const { widthWithDefault, heightWithDefault } = getNodeSize(node); - dagreGraph.setNode(node.id, { - width: widthWithDefault, - height: heightWithDefault, - order: randomInt(0, 10) - }); - }); - - // 添加边 - edges.forEach(edge => dagreGraph.setEdge(edge.source, edge.target)); - - // 处理多个子工作流的情况 - const rootNodes = findRootNodes(nodes, edges); - if (rootNodes.length > 1) { - dagreGraph.setNode(LAYOUT_CONFIG.VIRTUAL_ROOT_ID, { - width: LAYOUT_CONFIG.VIRTUAL_NODE_SIZE, - height: LAYOUT_CONFIG.VIRTUAL_NODE_SIZE, - rank: -1 // 确保虚拟根节点排在最前面 - }); - rootNodes.forEach(node => - dagreGraph.setEdge(LAYOUT_CONFIG.VIRTUAL_ROOT_ID, node.id) - ); - } - - // 执行布局 - dagre.layout(dagreGraph); - - // 移除虚拟根节点 - if (rootNodes.length > 1) { - dagreGraph.removeNode(LAYOUT_CONFIG.VIRTUAL_ROOT_ID); - } - - // 计算边界并返回布局结果 - const bounds = calculateBounds(nodes, dagreGraph); - - return { - nodes: nodes.map(node => getNodeLayouted({ - node, - position: dagreGraph.node(node.id), - direction, - visibility, - fixPosition: ({ x, y, width, height }) => ({ - x: x - width / 2 - bounds.minX, - y: y - height / 2 - bounds.minY, - }), - })), - edges: edges.map(edge => getEdgeLayouted({ edge, visibility })), - }; -}; \ No newline at end of file diff --git a/apps/web/src/components/common/editor/graph/layout/node/algorithms/elk.ts b/apps/web/src/components/common/editor/graph/layout/node/algorithms/elk.ts deleted file mode 100755 index 0238b71..0000000 --- a/apps/web/src/components/common/editor/graph/layout/node/algorithms/elk.ts +++ /dev/null @@ -1,128 +0,0 @@ -import ELK, { ElkNode } from "elkjs/lib/elk.bundled.js"; -import { getIncomers,Node } from "@xyflow/react"; -import { LayoutAlgorithm, LayoutAlgorithmProps } from ".."; -import { getEdgeLayouted, getNodeLayouted, getNodeSize } from "../../metadata"; - -const algorithms = { - "elk-layered": "layered", - "elk-mr-tree": "mrtree", -}; - -const elk = new ELK({ algorithms: Object.values(algorithms) }); - -export type ELKLayoutAlgorithms = "elk-layered" | "elk-mr-tree"; - -export const layoutELK = async ( - props: LayoutAlgorithmProps & { algorithm?: ELKLayoutAlgorithms } -) => { - const { - nodes, - edges, - direction, - visibility, - spacing, - algorithm = "elk-mr-tree", - } = props; - const isHorizontal = direction === "horizontal"; - - const subWorkflowRootNodes: Node[] = []; - const layoutNodes = nodes.map((node) => { - const incomers = getIncomers(node, nodes, edges); - if (incomers.length < 1) { - // Node without input is the root node of sub-workflow - subWorkflowRootNodes.push(node); - } - const { widthWithDefault, heightWithDefault } = getNodeSize(node); - const sourcePorts = node.data.sourceHandles.map((id) => ({ - id, - properties: { - side: isHorizontal ? "EAST" : "SOUTH", - }, - })); - const targetPorts = node.data.targetHandles.map((id) => ({ - id, - properties: { - side: isHorizontal ? "WEST" : "NORTH", - }, - })); - return { - id: node.id, - width: widthWithDefault, - height: heightWithDefault, - ports: [...targetPorts, ...sourcePorts], - properties: { - "org.eclipse.elk.portConstraints": "FIXED_ORDER", - }, - }; - }); - - const layoutEdges = edges.map((edge) => { - return { - id: edge.id, - sources: [edge.sourceHandle || edge.source], - targets: [edge.targetHandle || edge.target], - }; - }); - - // Connect sub-workflows' root nodes to the rootNode - const rootNode: any = { id: "#root", width: 1, height: 1 }; - layoutNodes.push(rootNode); - for (const subWorkflowRootNode of subWorkflowRootNodes) { - layoutEdges.push({ - id: `${rootNode.id}-${subWorkflowRootNode.id}`, - sources: [rootNode.id], - targets: [subWorkflowRootNode.id], - }); - } - - const layouted = await elk - .layout({ - id: "@root", - children: layoutNodes, - edges: layoutEdges, - layoutOptions: { - // - https://www.eclipse.org/elk/reference/algorithms.html - "elk.algorithm": algorithms[algorithm], - "elk.direction": isHorizontal ? "RIGHT" : "DOWN", - // - https://www.eclipse.org/elk/reference/options.html - "elk.spacing.nodeNode": isHorizontal - ? spacing.y.toString() - : spacing.x.toString(), - "elk.layered.spacing.nodeNodeBetweenLayers": isHorizontal - ? spacing.x.toString() - : spacing.y.toString(), - }, - }) - .catch((e) => { - console.log("❌ ELK layout failed", e); - }) as ElkNode - - if (!layouted?.children) { - return; - } - - const layoutedNodePositions = layouted.children.reduce((pre, v) => { - pre[v.id] = { - x: v.x ?? 0, - y: v.y ?? 0, - }; - return pre; - }, {} as Record); - - return { - nodes: nodes.map((node) => { - const position = layoutedNodePositions[node.id]; - return getNodeLayouted({ node, position, direction, visibility }); - }), - edges: edges.map((edge) => getEdgeLayouted({ edge, visibility })), - }; -}; - -export const kElkAlgorithms: Record = Object.keys( - algorithms -).reduce((pre, algorithm) => { - pre[algorithm] = (props: any) => { - return layoutELK({ ...props, algorithm }); - }; - return pre; -}, {} as any); diff --git a/apps/web/src/components/common/editor/graph/layout/node/algorithms/origin.ts b/apps/web/src/components/common/editor/graph/layout/node/algorithms/origin.ts deleted file mode 100755 index 25099ba..0000000 --- a/apps/web/src/components/common/editor/graph/layout/node/algorithms/origin.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { LayoutAlgorithm } from ".."; -import { getEdgeLayouted, getNodeLayouted } from "../../metadata"; - -/** - * Positions all nodes at the origin (0,0) in the layout. - */ -export const layoutOrigin: LayoutAlgorithm = async (props) => { - const { nodes, edges, direction, visibility } = props; - return { - nodes: nodes.map((node) => { - return getNodeLayouted({ - node, - direction, - visibility, - position: { x: 0, y: 0 }, - }); - }), - edges: edges.map((edge) => getEdgeLayouted({ edge, visibility })), - }; -}; diff --git a/apps/web/src/components/common/editor/graph/layout/node/index.ts b/apps/web/src/components/common/editor/graph/layout/node/index.ts deleted file mode 100755 index 477b766..0000000 --- a/apps/web/src/components/common/editor/graph/layout/node/index.ts +++ /dev/null @@ -1,149 +0,0 @@ -/** - * 图形布局模块 - * - * 该模块提供了一系列用于处理 ReactFlow 图形布局的工具和算法。 - * 支持多种布局算法,包括原始布局、树形布局、层次布局等。 - * 主要用于自动计算和调整图形中节点和边的位置。 - */ - -import { ReactFlowGraph } from "../../types"; -import { removeEmpty } from "../../utils/base"; -import { D3DAGLayoutAlgorithms, kD3DAGAlgorithms } from "./algorithms/d3-dag"; -import { layoutD3Hierarchy } from "./algorithms/d3-hierarchy"; -import { layoutDagreTree } from "./algorithms/dagre-tree"; -import { ELKLayoutAlgorithms, kElkAlgorithms } from "./algorithms/elk"; -import { layoutOrigin } from "./algorithms/origin"; - -/** - * 布局方向类型 - * vertical: 垂直布局 - * horizontal: 水平布局 - */ -export type LayoutDirection = "vertical" | "horizontal"; - -/** - * 布局可见性类型 - * visible: 可见 - * hidden: 隐藏 - */ -export type LayoutVisibility = "visible" | "hidden"; - -/** - * 布局间距配置接口 - * x: 水平间距 - * y: 垂直间距 - */ -export interface LayoutSpacing { - x: number; - y: number; -} - -/** - * ReactFlow 布局配置接口 - * 定义了布局所需的各项参数 - */ -export type ReactFlowLayoutConfig = { - algorithm: LayoutAlgorithms; // 使用的布局算法 - direction: LayoutDirection; // 布局方向 - spacing: LayoutSpacing; // 节点间距 - /** - * 布局可见性配置 - * 在首次布局时如果节点大小不可用,可能需要隐藏布局 - */ - visibility: LayoutVisibility; - /** - * 是否反转源节点手柄顺序 - */ - reverseSourceHandles: boolean; - autoCenterRoot: boolean -}; - -/** - * 布局算法所需的属性类型 - * 继承自 ReactFlowGraph 并包含布局配置(除算法外) - */ -export type LayoutAlgorithmProps = ReactFlowGraph & - Omit; - -/** - * 布局算法函数类型定义 - * 接收布局属性作为参数,返回布局后的图形数据 - */ -export type LayoutAlgorithm = ( - props: LayoutAlgorithmProps -) => Promise; - -/** - * 可用的布局算法映射表 - * 包含所有支持的布局算法实现 - */ -export const layoutAlgorithms: Record = { - origin: layoutOrigin, - "dagre-tree": layoutDagreTree, - "d3-hierarchy": layoutD3Hierarchy, - ...kElkAlgorithms, - ...kD3DAGAlgorithms, -}; - -/** - * 默认布局配置 - */ -export const defaultLayoutConfig: ReactFlowLayoutConfig = { - algorithm: "dagre-tree", // 默认使用 elk-mr-tree 算法 - direction: "horizontal", // 默认垂直布局 - visibility: "visible", // 默认可见 - spacing: { x: 120, y: 120 }, // 默认间距 - reverseSourceHandles: false, // 默认不反转源节点手柄 - autoCenterRoot: false -}; - -/** - * 支持的布局算法类型联合 - */ -export type LayoutAlgorithms = - | "origin" - | "dagre-tree" - | "d3-hierarchy" - | ELKLayoutAlgorithms - | D3DAGLayoutAlgorithms; - -/** - * ReactFlow 布局类型 - * 包含图形数据和可选的布局配置 - */ -export type ReactFlowLayout = ReactFlowGraph & Partial; - -/** - * 执行 ReactFlow 图形布局的主函数 - * - * @param options - 布局选项,包含图形数据和布局配置 - * @returns 返回布局后的图形数据 - * - * 函数流程: - * 1. 合并默认配置和用户配置 - * 2. 获取对应的布局算法 - * 3. 执行布局计算 - * 4. 如果布局失败,回退到原始布局 - */ -export const layoutReactFlow = async ( - options: ReactFlowLayout -): Promise => { - // 合并配置,移除空值 - const config = { ...defaultLayoutConfig, ...removeEmpty(options) }; - const { nodes = [], edges = [] } = config; - - // 获取并执行布局算法 - const layout = layoutAlgorithms[config.algorithm]; - let result = await layout({ ...config, nodes, edges }); - - // 布局失败时回退处理 - if (!result) { - result = await layoutReactFlow({ - ...config, - nodes, - edges, - algorithm: "origin", - }); - } - return result!; -}; \ No newline at end of file diff --git a/apps/web/src/components/common/editor/graph/layout/types.ts b/apps/web/src/components/common/editor/graph/layout/types.ts deleted file mode 100755 index b46b4df..0000000 --- a/apps/web/src/components/common/editor/graph/layout/types.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Node, Edge } from "@xyflow/react"; -// 基础接口和类型定义 -export interface LayoutOptions { - nodes: Node[]; - edges: Edge[]; - levelSeparation?: number; - nodeSeparation?: number; -} - -export interface NodeWithLayout extends Node { - children?: NodeWithLayout[]; - parent?: NodeWithLayout; - subtreeHeight?: number; - subtreeWidth?: number; - isRight?: boolean; - relativeY?: number - verticalLevel?: number -} - -// 布局策略接口 -export interface LayoutStrategy { - layout(options: LayoutOptions): { nodes: Node[], edges: Edge[] }; -} \ No newline at end of file diff --git a/apps/web/src/components/common/editor/graph/nodes/GraphNode.tsx b/apps/web/src/components/common/editor/graph/nodes/GraphNode.tsx deleted file mode 100755 index d4aec7b..0000000 --- a/apps/web/src/components/common/editor/graph/nodes/GraphNode.tsx +++ /dev/null @@ -1,179 +0,0 @@ -import { memo, useCallback, useEffect, useRef, useState } from 'react'; -import { Handle, Position, NodeProps, Node, useUpdateNodeInternals } from '@xyflow/react'; -import useGraphStore from '../store'; -import { shallow } from 'zustand/shallow'; -import { GraphState } from '../types'; -import { cn } from '@web/src/utils/classname'; -import { LEVEL_STYLES, NODE_BASE_STYLES, TEXTAREA_BASE_STYLES } from './style'; - -export type GraphNode = Node<{ - label: string; - color?: string; - level?: number; -}, 'graph-node'>; - - - -interface TextMeasurerProps { - element: HTMLTextAreaElement; - minWidth?: number; - maxWidth?: number; - padding?: number; -} - -const measureTextWidth = ({ - element, - minWidth = 60, - maxWidth = 400, - padding = 16, -}: TextMeasurerProps): number => { - const span = document.createElement('span'); - const styles = { - visibility: 'hidden', - position: 'absolute', - whiteSpace: 'pre', - fontSize: window.getComputedStyle(element).fontSize, - } as const; - - Object.assign(span.style, styles); - span.textContent = element.value || element.placeholder; - document.body.appendChild(span); - - const contentWidth = Math.min(Math.max(span.offsetWidth + padding, minWidth), maxWidth); - document.body.removeChild(span); - - return contentWidth; -}; - -const selector = (store: GraphState) => ({ - updateNode: store.updateNode, -}); - -export const GraphNode = memo(({ id, selected, width, height, data, isConnectable }: NodeProps) => { - const { updateNode } = useGraphStore(selector, shallow); - const [isEditing, setIsEditing] = useState(false); - const [inputValue, setInputValue] = useState(data.label); - const [isComposing, setIsComposing] = useState(false); - const containerRef = useRef(null); - const textareaRef = useRef(null); - const updateNodeInternals = useUpdateNodeInternals(); - // const [nodeWidth, setNodeWidth] = useState(width) - // const [nodeHeight, setNodeHeight] = useState(height) - const updateTextareaSize = useCallback((element: HTMLTextAreaElement) => { - const contentWidth = measureTextWidth({ element }); - element.style.whiteSpace = contentWidth >= 400 ? 'pre-wrap' : 'pre'; - element.style.width = `${contentWidth}px`; - element.style.height = 'auto'; - element.style.height = `${element.scrollHeight}px`; - - }, []); - - const handleChange = useCallback((evt: React.ChangeEvent) => { - const newValue = evt.target.value; - setInputValue(newValue); - updateNode(id, { label: newValue }); - updateTextareaSize(evt.target); - }, [updateNode, id, updateTextareaSize]); - - useEffect(() => { - if (textareaRef.current) { - updateTextareaSize(textareaRef.current); - } - }, [isEditing, inputValue, updateTextareaSize]); - - const handleKeyDown = useCallback((evt: React.KeyboardEvent) => { - const isAlphanumeric = /^[a-zA-Z0-9]$/.test(evt.key); - const isSpaceKey = evt.key === ' '; - - if (!isEditing && (isAlphanumeric || isSpaceKey)) { - evt.preventDefault(); - evt.stopPropagation(); - - const newValue = isAlphanumeric ? evt.key : data.label; - setIsEditing(true); - setInputValue(newValue); - updateNode(id, { label: newValue }); - return; - } - - if (isEditing && evt.key === 'Enter' && !evt.shiftKey && !isComposing) { - evt.preventDefault(); - setIsEditing(false); - } - }, [isEditing, isComposing, data.label, id, updateNode]); - - const handleDoubleClick = useCallback(() => { - setIsEditing(true); - }, []); - - const handleBlur = useCallback(() => { - setIsEditing(false); - }, []); - useEffect(() => { - const resizeObserver = new ResizeObserver((entries) => { - for (const entry of entries) { - const { width, height } = entry.contentRect; - updateNodeInternals(id); - } - }); - - if (containerRef.current) { - resizeObserver.observe(containerRef.current); - } - - return () => { - resizeObserver.disconnect(); - }; - }, []); - return ( - - setIsComposing(true)} - onCompositionEnd={() => setIsComposing(false)} - className={cn( - TEXTAREA_BASE_STYLES, - LEVEL_STYLES[data.level ?? 2].fontSize, - isEditing ? 'nodrag' : 'cursor-default' - )} - placeholder={isEditing ? "输入节点内容..." : "双击编辑"} - rows={1} - readOnly={!isEditing} - aria-label="节点内容" - /> - - - - - ); -}); - -GraphNode.displayName = 'GraphNode'; \ No newline at end of file diff --git a/apps/web/src/components/common/editor/graph/nodes/style.ts b/apps/web/src/components/common/editor/graph/nodes/style.ts deleted file mode 100755 index ee1cffa..0000000 --- a/apps/web/src/components/common/editor/graph/nodes/style.ts +++ /dev/null @@ -1,49 +0,0 @@ -export const LEVEL_STYLES = { - 0: { - container: ` - bg-gradient-to-br from-blue-500 to-blue-600 - text-white px-8 py-4 - `, - fontSize: 'text-xl font-semibold' - }, - 1: { - container: ` - bg-white - border-2 border-blue-400 - text-gray-700 px-4 py-2 - hover:border-blue-500 - `, - fontSize: 'text-lg' - }, - 2: { - container: ` - bg-gray-50 - border border-gray-200 - text-gray-600 px-2 py-1 - hover:border-blue-300 - hover:bg-gray-100 - `, - fontSize: 'text-base' - } -} as const; - -export const NODE_BASE_STYLES = ` - flex items-center justify-center - rounded-xl - min-w-[60px] - w-fit - relative -`; - -export const TEXTAREA_BASE_STYLES = ` - bg-transparent - text-center - break-words - whitespace-pre-wrap - resize-none - overflow-hidden - outline-none - min-w-0 - w-auto - flex-shrink -`; \ No newline at end of file diff --git a/apps/web/src/components/common/editor/graph/store.ts b/apps/web/src/components/common/editor/graph/store.ts deleted file mode 100755 index 240bbc4..0000000 --- a/apps/web/src/components/common/editor/graph/store.ts +++ /dev/null @@ -1,142 +0,0 @@ -import { addEdge, applyNodeChanges, applyEdgeChanges, Node, Edge, Connection, NodeChange, EdgeChange } from '@xyflow/react'; -import { createWithEqualityFn } from 'zustand/traditional'; -import { nanoid } from 'nanoid'; -import debounce from 'lodash/debounce'; -import { GraphState } from './types'; -import { initialEdges, initialNodes } from './data'; - -const MAX_HISTORY_LENGTH = 100; -const HISTORY_DEBOUNCE_MS = 100; - -const useGraphStore = createWithEqualityFn((set, get) => { - return { - past: [], - future: [], - present: { - nodes: initialNodes, - edges: initialEdges, - }, - record: (callback: () => void) => { - const currentState = get().present; - - console.group('Recording new state'); - console.log('Current state:', currentState); - console.log('Past states count:', get().past.length); - console.log('Future states count:', get().future.length); - - set(state => { - const newPast = [...state.past.slice(-MAX_HISTORY_LENGTH), currentState]; - console.log('New past states count:', newPast.length); - console.groupEnd(); - return { - past: newPast, - future: [], - }; - }); - - callback(); - }, - - undo: () => { - const { past, present } = get(); - console.group('Undo operation'); - console.log('Current state:', present); - console.log('Past states count:', past.length); - - if (past.length === 0) { - console.warn('Cannot undo - no past states available'); - console.groupEnd(); - return; - } - - const previous = past[past.length - 1]; - const newPast = past.slice(0, past.length - 1); - - console.log('Reverting to previous state:', previous); - console.log('New past states count:', newPast.length); - console.log('New future states count:', get().future.length + 1); - console.groupEnd(); - - set({ - past: newPast, - present: previous, - future: [present, ...get().future], - }); - }, - - redo: () => { - const { future, present } = get(); - console.group('Redo operation'); - console.log('Current state:', present); - console.log('Future states count:', future.length); - - if (future.length === 0) { - console.warn('Cannot redo - no future states available'); - console.groupEnd(); - return; - } - - const next = future[0]; - const newFuture = future.slice(1); - - console.log('Moving to next state:', next); - console.log('New past states count:', get().past.length + 1); - console.log('New future states count:', newFuture.length); - console.groupEnd(); - - set({ - past: [...get().past, present], - present: next, - future: newFuture, - }); - }, - setNodes: (nodes: Node[]) => { - set(state => ({ - present: { - nodes: nodes, - edges: state.present.edges - } - })); - }, - setEdges: (edges: Edge[]) => { - set(state => ({ - present: { - nodes: state.present.nodes, - edges: edges - } - })); - }, - onNodesChange: (changes: NodeChange[]) => { - set(state => ({ - present: { - nodes: applyNodeChanges(changes, state.present.nodes), - edges: state.present.edges - } - })) - }, - onEdgesChange: (changes: EdgeChange[]) => { - set(state => ({ - present: { - nodes: state.present.nodes, - edges: applyEdgeChanges(changes, state.present.edges) - } - })) - }, - canUndo: () => get().past.length > 0, - canRedo: () => get().future.length > 0, - updateNode: (nodeId: string, data: any) => { - const newNodes = get().present.nodes.map(node => - node.id === nodeId ? { ...node, data: { ...node.data, ...data } } : node - ); - set({ - present: { - nodes: newNodes, - edges: get().present.edges - } - }); - }, - - }; -}); - -export default useGraphStore; \ No newline at end of file diff --git a/apps/web/src/components/common/editor/graph/types.ts b/apps/web/src/components/common/editor/graph/types.ts deleted file mode 100755 index ac167ee..0000000 --- a/apps/web/src/components/common/editor/graph/types.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { Edge, NodeProps, Node, OnConnect, OnEdgesChange, OnNodesChange, Connection, NodeChange, EdgeChange, OnSelectionChangeParams, XYPosition } from "@xyflow/react"; -import { GraphEdge } from "./edges/GraphEdge"; -import { GraphNode } from "./nodes/GraphNode"; -import { ControlPoint } from "./layout/edge/point"; -import { ReactFlowLayout, ReactFlowLayoutConfig } from "./layout/node"; -// 添加新的类型定义 -export type HistoryState = { - nodes: Node[]; - edges: Edge[]; - type: string; // 记录操作类型 - timestamp: number; -}; - -export type GraphState = { - past: Array<{ nodes: Node[], edges: Edge[] }>; - present: { - nodes: Node[]; - edges: Edge[]; - }; - future: Array<{ nodes: Node[], edges: Edge[] }>; - canUndo: () => boolean; - canRedo: () => boolean; - onNodesChange: (changes: NodeChange[]) => void; - onEdgesChange: (changes: EdgeChange[]) => void; - updateNode: (id: string, data: any) => void; - undo: () => void; - redo: () => void; - setNodes: (nodes: Node[]) => void; - setEdges: (edges: Edge[]) => void; - record: (callback: () => void) => void -}; -export const nodeTypes = { - 'graph-node': GraphNode -} - -export const edgeTypes = { - 'graph-edge': GraphEdge -} - -export interface ReactFlowGraph { - nodes: Node[] - edges: Edge[] -} -export interface ReactFlowEdgePort { - /** - * Total number of edges in this direction (source or target). - */ - edges: number; - /** - * Number of ports - */ - portCount: number; - /** - * Port's index. - */ - portIndex: number; - /** - * Total number of Edges under the current port. - */ - edgeCount: number; - /** - * Index of the Edge under the current port. - */ - edgeIndex: number; -} - -export interface EdgeLayout { - /** - * SVG path for edge rendering - */ - path: string; - /** - * Control points on the edge. - */ - points: ControlPoint[]; - labelPosition: XYPosition; - /** - * Current layout dependent variables (re-layout when changed). - */ - deps?: any; - /** - * Potential control points on the edge, for debugging purposes only. - */ - inputPoints: ControlPoint[]; -} - -export interface ReactFlowEdgeData { - /** - * Data related to the current edge's layout, such as control points. - */ - layout?: EdgeLayout; - sourcePort: ReactFlowEdgePort; - targetPort: ReactFlowEdgePort; -} diff --git a/apps/web/src/components/common/editor/graph/useGraphOperation.ts b/apps/web/src/components/common/editor/graph/useGraphOperation.ts deleted file mode 100755 index 0d85e58..0000000 --- a/apps/web/src/components/common/editor/graph/useGraphOperation.ts +++ /dev/null @@ -1,144 +0,0 @@ -import { useCallback, useMemo } from "react"; -import { nanoid } from 'nanoid'; -import { shallow } from 'zustand/shallow'; -import { throttle } from 'lodash'; -import { Edge, Node, useReactFlow } from "@xyflow/react"; -import { GraphState } from "./types"; -import useGraphStore from "./store"; - -// Store selector -const selector = (store: GraphState) => ({ - nodes: store.present.nodes, - edges: store.present.edges, - setNodes: store.setNodes, - setEdges: store.setEdges, - record: store.record -}); - -// Helper functions -const createNode = (label: string): Node => ({ - id: nanoid(6), - type: 'graph-node', - data: { label }, - position: { x: 0, y: 0 }, -}); - -const createEdge = (source: string, target: string): Edge => ({ - id: nanoid(6), - source, - target, - type: 'graph-edge', -}); - -export function useGraphOperation() { - const store = useGraphStore(selector, shallow); - const { addEdges, addNodes } = useReactFlow(); - - const selectedNodes = useMemo(() => - store.nodes.filter(node => node.selected), - [store.nodes] - ); - - // Find parent node ID for a given node - const findParentId = useCallback((nodeId: string) => { - const parentEdge = store.edges.find(edge => edge.target === nodeId); - return parentEdge?.source; - }, [store.edges]); - - // Update node selection - const updateNodeSelection = useCallback((nodeIds: string[]) => { - return store.nodes.map(node => ({ - ...node, - selected: nodeIds.includes(node.id) - })); - }, [store.nodes]); - - // Create new node and connect it - const createConnectedNode = useCallback((parentId: string, deselectOthers = true) => { - const newNode = createNode(`新节点${store.nodes.length}`); - const newEdge = createEdge(parentId, newNode.id); - - store.record(() => { - addNodes({ ...newNode, selected: true }); - addEdges(newEdge); - - if (deselectOthers) { - store.setNodes(updateNodeSelection([newNode.id])); - } - }); - }, [store, addNodes, addEdges, updateNodeSelection]); - - // Handle node creation operations - const handleCreateChildNodes = useCallback(() => { - if (selectedNodes.length === 0) return; - - throttle(() => { - selectedNodes.forEach(node => { - if (node.id) createConnectedNode(node.id); - }); - }, 300)(); - }, [selectedNodes, createConnectedNode]); - - const handleCreateSiblingNodes = useCallback(() => { - if (selectedNodes.length === 0) return; - - throttle(() => { - selectedNodes.forEach(node => { - const parentId = findParentId(node.id) || node.id; - createConnectedNode(parentId); - }); - }, 300)(); - }, [selectedNodes, findParentId, createConnectedNode]); - - const handleDeleteNodes = useCallback(() => { - if (selectedNodes.length === 0) return; - - const nodesToDelete = new Set(); - - // Collect all nodes to delete including children - const collectNodesToDelete = (nodeId: string) => { - nodesToDelete.add(nodeId); - store.edges - .filter(edge => edge.source === nodeId) - .forEach(edge => collectNodesToDelete(edge.target)); - }; - - selectedNodes.forEach(node => collectNodesToDelete(node.id)); - - store.record(() => { - // Filter out deleted nodes and their edges - const remainingNodes = store.nodes.filter(node => !nodesToDelete.has(node.id)); - const remainingEdges = store.edges.filter(edge => - !nodesToDelete.has(edge.source) && !nodesToDelete.has(edge.target) - ); - - // Select next node (sibling or parent of first deleted node) - const firstDeletedNode = selectedNodes[0]; - const parentId = findParentId(firstDeletedNode.id); - - let nextSelectedId: string | undefined; - if (parentId) { - const siblingEdge = store.edges.find(edge => - edge.source === parentId && - !nodesToDelete.has(edge.target) && - edge.target !== firstDeletedNode.id - ); - nextSelectedId = siblingEdge?.target || parentId; - } - - // Update nodes with new selection and set the remaining nodes - const updatedNodes = remainingNodes.map(node => ({ - ...node, - selected: node.id === nextSelectedId - })); - - store.setNodes(updatedNodes); - store.setEdges(remainingEdges); - }); - }, [selectedNodes, store, findParentId]); - return { - handleCreateChildNodes, - handleCreateSiblingNodes, - handleDeleteNodes - }; -} \ No newline at end of file diff --git a/apps/web/src/components/common/editor/graph/useKeyboardCtrl.ts b/apps/web/src/components/common/editor/graph/useKeyboardCtrl.ts deleted file mode 100755 index 23cf61b..0000000 --- a/apps/web/src/components/common/editor/graph/useKeyboardCtrl.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { useHotkeys } from 'react-hotkeys-hook'; -import { shallow } from 'zustand/shallow'; -import { useGraphOperation } from './useGraphOperation'; -import useGraphStore from './store'; -import { GraphState } from './types'; - -const selector = (store: GraphState) => ({ - undo: store.undo, - redo: store.redo -}); - -export function useKeyboardCtrl() { - const { undo, redo } = useGraphStore(selector, shallow); - const { - handleCreateChildNodes, - handleCreateSiblingNodes, - handleDeleteNodes - } = useGraphOperation(); - - useHotkeys('tab', (e) => { - e.preventDefault(); - handleCreateChildNodes(); - }, [handleCreateChildNodes]); - - useHotkeys('enter', (e) => { - e.preventDefault(); - handleCreateSiblingNodes(); - }, [handleCreateSiblingNodes]); - - useHotkeys('ctrl+z', (e) => { - e.preventDefault(); - undo(); - }, [undo]); - - useHotkeys('ctrl+y', (e) => { - e.preventDefault(); - redo(); - }, [redo]); - - useHotkeys('delete', (e) => { - e.preventDefault(); - handleDeleteNodes(); - }, [handleDeleteNodes]); -} \ No newline at end of file diff --git a/apps/web/src/components/common/editor/graph/useUndoRedo.tsx b/apps/web/src/components/common/editor/graph/useUndoRedo.tsx deleted file mode 100755 index e69de29..0000000 diff --git a/apps/web/src/components/common/editor/graph/utils.ts b/apps/web/src/components/common/editor/graph/utils.ts deleted file mode 100755 index f3b096f..0000000 --- a/apps/web/src/components/common/editor/graph/utils.ts +++ /dev/null @@ -1,147 +0,0 @@ -import { Position, Node, InternalNode } from "@xyflow/react"; - -/** - * 定义交点的接口类型 - * 用于表示两条线段相交的坐标点 - */ -interface IntersectionPoint { - x: number; // 交点的x坐标 - y: number; // 交点的y坐标 -} - -/** - * 定义边缘连接参数的接口类型 - * 包含源节点和目标节点的连接位置信息 - */ -interface EdgeParams { - sx: number; // 源节点连接点x坐标 - sy: number; // 源节点连接点y坐标 - tx: number; // 目标节点连接点x坐标 - ty: number; // 目标节点连接点y坐标 - sourcePos: Position; // 源节点连接位置(上下左右) - targetPos: Position; // 目标节点连接位置(上下左右) -} - -/** - * 计算节点之间的交点坐标 - * - * 功能说明: - * 该函数用于计算两个节点之间连线与节点边界的精确交点位置。这在绘制流程图等图形时, - * 确保连接线能够准确地从节点边界开始和结束,而不是从节点中心点开始。 - * - * 算法原理: - * 1. 首先获取两个节点的位置和尺寸信息 - * 2. 计算节点的中心点坐标 - * 3. 使用几何算法计算连线与节点矩形边界的交点 - * 4. 返回交点的精确坐标 - * - * @param intersectionNode - 起始节点,需要计算交点的源节点 - * @param targetNode - 目标节点,与源节点相连的终点节点 - * @returns {IntersectionPoint} 返回交点坐标 {x, y} - */ -function getNodeIntersection(intersectionNode: InternalNode, targetNode: InternalNode): IntersectionPoint { - // 获取起始节点的宽度和高度 - const { width: intersectionNodeWidth, height: intersectionNodeHeight } = intersectionNode.measured; - // 获取两个节点的绝对位置信息 - const intersectionNodePosition = intersectionNode.internals.positionAbsolute; - const targetPosition = targetNode.internals.positionAbsolute; - - // 计算起始节点的半宽和半高,用于后续的坐标计算 - const w = intersectionNodeWidth / 2; - const h = intersectionNodeHeight / 2; - - // 计算两个节点的中心点坐标 - // (x2,y2)为起始节点的中心点 - const x2 = intersectionNodePosition.x + w; - const y2 = intersectionNodePosition.y + h; - // (x1,y1)为目标节点的中心点 - const x1 = targetPosition.x + targetNode.measured.width / 2; - const y1 = targetPosition.y + targetNode.measured.height / 2; - - // 使用数学公式计算交点坐标 - // 这里使用的是参数化方程,将节点边界视为矩形来计算交点 - const xx1 = (x1 - x2) / (2 * w) - (y1 - y2) / (2 * h); - const yy1 = (x1 - x2) / (2 * w) + (y1 - y2) / (2 * h); - // 通过标准化确保交点在节点边界上 - const a = 1 / (Math.abs(xx1) + Math.abs(yy1)); - const xx3 = a * xx1; - const yy3 = a * yy1; - // 计算最终的交点坐标 - const x = w * (xx3 + yy3) + x2; - const y = h * (-xx3 + yy3) + y2; - - return { x, y }; -} -/** - * 确定边缘连接点的位置(上下左右) - * - * 功能说明: - * 根据节点和交点的位置关系,计算边缘线应该连接到节点的哪个位置(上/下/左/右) - * - * 实现原理: - * 1. 获取节点的绝对定位信息和尺寸信息 - * 2. 将节点四条边界划分为不同区域 - * 3. 通过比较交点坐标与边界位置,确定最合适的连接点 - * - * @param node - 需要确定连接位置的节点对象 - * 包含节点的位置信息(x,y)和尺寸信息(width,height) - * @param intersectionPoint - 交点坐标对象 - * 包含交点的x,y坐标值 - * @returns Position - 返回枚举值,表示连接位置(Top/Right/Bottom/Left) - */ -function getEdgePosition(node: InternalNode, intersectionPoint: IntersectionPoint): Position { - // 合并节点的绝对定位信息,确保获取准确的节点位置 - const n = { ...node.internals.positionAbsolute, ...node }; - - // 对坐标进行取整,避免浮点数计算误差 - const nx = Math.round(n.x); // 节点左边界x坐标 - const ny = Math.round(n.y); // 节点上边界y坐标 - const px = Math.round(intersectionPoint.x); // 交点x坐标 - const py = Math.round(intersectionPoint.y); // 交点y坐标 - - // 判断逻辑:通过比较交点与节点各边界的位置关系确定连接位置 - // 添加1px的容差值,增强判断的容错性 - if (px <= nx + 1) { - return Position.Left; // 交点在节点左侧 - } - if (px >= nx + n.measured.width - 1) { - return Position.Right; // 交点在节点右侧 - } - if (py <= ny + 1) { - return Position.Top; // 交点在节点上方 - } - if (py >= n.y + n.measured.height - 1) { - return Position.Bottom; // 交点在节点下方 - } - - // 若都不满足,默认返回顶部位置作为连接点 - return Position.Top; -} - -/** - * 计算两个节点之间边缘连接的所有必要参数 - * @param source - 源节点 - * @param target - 目标节点 - * @returns 返回包含边缘连接所需所有参数的对象 - * - * 这是主要的导出函数,用于获取创建边缘连接线所需的所有参数 - */ -export function getEdgeParams(source: InternalNode, target: InternalNode): EdgeParams { - // 计算源节点和目标节点的交点 - const sourceIntersectionPoint = getNodeIntersection(source, target); - const targetIntersectionPoint = getNodeIntersection(target, source); - - // 确定连接点在各自节点上的位置 - const sourcePos = getEdgePosition(source, sourceIntersectionPoint); - const targetPos = getEdgePosition(target, targetIntersectionPoint); - - // 返回所有必要的参数 - return { - sx: sourceIntersectionPoint.x, - sy: sourceIntersectionPoint.y, - tx: targetIntersectionPoint.x, - ty: targetIntersectionPoint.y, - sourcePos, - targetPos, - }; -} \ No newline at end of file diff --git a/apps/web/src/components/common/editor/graph/utils/base.ts b/apps/web/src/components/common/editor/graph/utils/base.ts deleted file mode 100755 index b08fbf9..0000000 --- a/apps/web/src/components/common/editor/graph/utils/base.ts +++ /dev/null @@ -1,115 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ - -export const nextTick = async (frames = 1) => { - const _nextTick = async (idx: number) => { - return new Promise((resolve) => { - requestAnimationFrame(() => resolve(idx)); - }); - }; - for (let i = 0; i < frames; i++) { - await _nextTick(i); - } -}; - -export const firstOf = (datas?: T[]) => - datas ? (datas.length < 1 ? undefined : datas[0]) : undefined; - -export const lastOf = (datas?: T[]) => - datas ? (datas.length < 1 ? undefined : datas[datas.length - 1]) : undefined; - -export const randomInt = (min: number, max?: number) => { - if (!max) { - max = min; - min = 0; - } - return Math.floor(Math.random() * (max - min + 1) + min); -}; - -export const pickOne = (datas: T[]) => - datas.length < 1 ? undefined : datas[randomInt(datas.length - 1)]; - -export const range = (start: number, end?: number) => { - if (!end) { - end = start; - start = 0; - } - return Array.from({ length: end - start }, (_, index) => start + index); -}; - -/** - * clamp(-1,0,1)=0 - */ -export function clamp(num: number, min: number, max: number): number { - return num < max ? (num > min ? num : min) : max; -} - -export const toSet = (datas: T[], byKey?: (e: T) => any) => { - if (byKey) { - const keys: Record = {}; - const newDatas: T[] = []; - datas.forEach((e) => { - const key = jsonEncode({ key: byKey(e) }) as any; - if (!keys[key]) { - newDatas.push(e); - keys[key] = true; - } - }); - return newDatas; - } - return Array.from(new Set(datas)); -}; - -export function jsonEncode(obj: any, prettier = false) { - try { - return prettier ? JSON.stringify(obj, undefined, 4) : JSON.stringify(obj); - } catch (error) { - return undefined; - } -} - -export function jsonDecode(json: string | undefined) { - if (json == undefined) return undefined; - try { - return JSON.parse(json!); - } catch (error) { - return undefined; - } -} - -export function removeEmpty(data: T): T { - if (Array.isArray(data)) { - return data.filter((e) => e != undefined) as any; - } - const res = {} as any; - for (const key in data) { - if (data[key] != undefined) { - res[key] = data[key]; - } - } - return res; -} - -export const deepClone = (obj: T): T => { - if (obj === null || typeof obj !== "object") { - return obj; - } - - if (Array.isArray(obj)) { - const copy: any[] = []; - obj.forEach((item, index) => { - copy[index] = deepClone(item); - }); - - return copy as unknown as T; - } - - const copy = {} as T; - - for (const key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - (copy as any)[key] = deepClone((obj as any)[key]); - } - } - - return copy; -}; diff --git a/apps/web/src/components/common/editor/graph/utils/diff.ts b/apps/web/src/components/common/editor/graph/utils/diff.ts deleted file mode 100755 index 98412b6..0000000 --- a/apps/web/src/components/common/editor/graph/utils/diff.ts +++ /dev/null @@ -1,105 +0,0 @@ -// @ts-nocheck - -// Source: https://github.com/AsyncBanana/microdiff - -interface Difference { - type: "CREATE" | "REMOVE" | "CHANGE"; - path: (string | number)[]; - value?: any; -} -interface Options { - cyclesFix: boolean; -} - -const t = true; -const richTypes = { Date: t, RegExp: t, String: t, Number: t }; - -export function isEqual(oldObj: any, newObj: any): boolean { - return ( - diff( - { - obj: oldObj, - }, - { obj: newObj } - ).length < 1 - ); -} - -export const isNotEqual = (oldObj: any, newObj: any) => - !isEqual(oldObj, newObj); - -function diff( - obj: Record | any[], - newObj: Record | any[], - options: Partial = { cyclesFix: true }, - _stack: Record[] = [] -): Difference[] { - const diffs: Difference[] = []; - const isObjArray = Array.isArray(obj); - - for (const key in obj) { - const objKey = obj[key]; - const path = isObjArray ? Number(key) : key; - if (!(key in newObj)) { - diffs.push({ - type: "REMOVE", - path: [path], - }); - continue; - } - const newObjKey = newObj[key]; - const areObjects = - typeof objKey === "object" && typeof newObjKey === "object"; - if ( - objKey && - newObjKey && - areObjects && - !richTypes[Object.getPrototypeOf(objKey).constructor.name] && - (options.cyclesFix ? !_stack.includes(objKey) : true) - ) { - const nestedDiffs = diff( - objKey, - newObjKey, - options, - options.cyclesFix ? _stack.concat([objKey]) : [] - ); - // eslint-disable-next-line prefer-spread - diffs.push.apply( - diffs, - nestedDiffs.map((difference) => { - difference.path.unshift(path); - - return difference; - }) - ); - } else if ( - objKey !== newObjKey && - !( - areObjects && - (Number.isNaN(objKey) - ? String(objKey) === String(newObjKey) - : Number(objKey) === Number(newObjKey)) - ) - ) { - diffs.push({ - path: [path], - type: "CHANGE", - value: newObjKey, - }); - } - } - - const isNewObjArray = Array.isArray(newObj); - - for (const key in newObj) { - if (!(key in obj)) { - diffs.push({ - type: "CREATE", - path: [isNewObjArray ? Number(key) : key], - value: newObj[key], - }); - } - } - - return diffs; -} diff --git a/apps/web/src/components/common/editor/graph/utils/uuid.ts b/apps/web/src/components/common/editor/graph/utils/uuid.ts deleted file mode 100755 index a4661ce..0000000 --- a/apps/web/src/components/common/editor/graph/utils/uuid.ts +++ /dev/null @@ -1,11 +0,0 @@ -export function uuid(): string { - const uuid = new Array(36); - for (let i = 0; i < 36; i++) { - uuid[i] = Math.floor(Math.random() * 16); - } - uuid[14] = 4; - uuid[19] = uuid[19] &= ~(1 << 2); - uuid[19] = uuid[19] |= 1 << 3; - uuid[8] = uuid[13] = uuid[18] = uuid[23] = "-"; - return uuid.map((x) => x.toString(16)).join(""); -} diff --git a/apps/web/src/env.ts b/apps/web/src/env.ts index a7904db..956a74b 100755 --- a/apps/web/src/env.ts +++ b/apps/web/src/env.ts @@ -4,7 +4,6 @@ export const env: { VERSION: string; FILE_PORT: string; SERVER_PORT: string; - WEB_PORT: string; } = { APP_NAME: import.meta.env.PROD ? (window as any).env.VITE_APP_APP_NAME @@ -15,9 +14,6 @@ export const env: { FILE_PORT: import.meta.env.PROD ? (window as any).env.VITE_APP_FILE_PORT : import.meta.env.VITE_APP_FILE_PORT, - WEB_PORT: import.meta.env.PROD - ? (window as any).env.VITE_APP_WEB_PORT - : import.meta.env.VITE_APP_WEB_PORT, SERVER_PORT: import.meta.env.PROD ? (window as any).env.VITE_APP_SERVER_PORT : import.meta.env.VITE_APP_SERVER_PORT, diff --git a/web-dist/assets/account-location-BCNgMMMw-BQ7mU2Ng.js b/web-dist/assets/account-location-BCNgMMMw-BQ7mU2Ng.js new file mode 100644 index 0000000..090ae95 --- /dev/null +++ b/web-dist/assets/account-location-BCNgMMMw-BQ7mU2Ng.js @@ -0,0 +1 @@ +import{r as t}from"./index-C6LPy0O3.js";const r=e=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:40,height:40,viewBox:"0 0 24 24",...e},t.createElement("path",{fill:"currentColor",d:"M20 2H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h4l4 4l4-4h4a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2m-8 2.3c1.5 0 2.7 1.2 2.7 2.7S13.5 9.7 12 9.7S9.3 8.5 9.3 7s1.2-2.7 2.7-2.7M18 15H6v-.9c0-2 4-3.1 6-3.1s6 1.1 6 3.1z"}));export{r as default}; diff --git a/web-dist/assets/add-DBGs_LmH-UF_0ErRm.js b/web-dist/assets/add-DBGs_LmH-UF_0ErRm.js new file mode 100644 index 0000000..e2ad3bc --- /dev/null +++ b/web-dist/assets/add-DBGs_LmH-UF_0ErRm.js @@ -0,0 +1 @@ +import{r as e}from"./index-C6LPy0O3.js";const h=t=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t},e.createElement("path",{fill:"currentColor",d:"M11 13H5v-2h6V5h2v6h6v2h-6v6h-2z"}));export{h as default}; diff --git a/web-dist/assets/admin-outlined-DXTGKZe5-Bl5p60Yl.js b/web-dist/assets/admin-outlined-DXTGKZe5-Bl5p60Yl.js new file mode 100644 index 0000000..eeed787 --- /dev/null +++ b/web-dist/assets/admin-outlined-DXTGKZe5-Bl5p60Yl.js @@ -0,0 +1 @@ +import{r as e}from"./index-C6LPy0O3.js";const l=t=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t},e.createElement("path",{fill:"currentColor",d:"M12 23C6.443 21.765 2 16.522 2 11V5l10-4l10 4v6c0 5.524-4.443 10.765-10 12M4 6v5a10.58 10.58 0 0 0 8 10a10.58 10.58 0 0 0 8-10V6l-8-3Z"}),e.createElement("circle",{cx:12,cy:8.5,r:2.5,fill:"currentColor"}),e.createElement("path",{fill:"currentColor",d:"M7 15a5.78 5.78 0 0 0 5 3a5.78 5.78 0 0 0 5-3c-.025-1.896-3.342-3-5-3c-1.667 0-4.975 1.104-5 3"}));export{l as default}; diff --git a/web-dist/assets/airport-DmUdZQah-C_Zatqrq.js b/web-dist/assets/airport-DmUdZQah-C_Zatqrq.js new file mode 100644 index 0000000..c52da43 --- /dev/null +++ b/web-dist/assets/airport-DmUdZQah-C_Zatqrq.js @@ -0,0 +1 @@ +import{r as l}from"./index-C6LPy0O3.js";const h=t=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t},l.createElement("path",{fill:"currentColor",d:"m6.923 13.442l1.848-4.75H5.038l-1.267 1.904H3.02l.827-2.865l-.827-2.885h.752L5.04 6.75h3.73L6.923 2h1l3.335 4.75h3.146q.413 0 .697.284q.284.283.284.697t-.284.687q-.284.274-.697.274h-3.146l-3.335 4.75zM16.096 22l-3.335-4.75H9.617q-.414 0-.698-.284q-.283-.283-.283-.697t.283-.697t.698-.284h3.146l3.334-4.73h1l-1.848 4.73h3.733l1.267-1.884H21l-.827 2.865l.827 2.885h-.752l-1.267-1.904h-3.733L17.096 22z"}));export{h as default}; diff --git a/web-dist/assets/align-center-kIaj1t0E-BEGA2USP.js b/web-dist/assets/align-center-kIaj1t0E-BEGA2USP.js new file mode 100644 index 0000000..5b20e2e --- /dev/null +++ b/web-dist/assets/align-center-kIaj1t0E-BEGA2USP.js @@ -0,0 +1 @@ +import{r as t}from"./index-C6LPy0O3.js";const h=e=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},t.createElement("path",{fill:"currentColor",d:"M4.5 20q-.213 0-.356-.144T4 19.499t.144-.356T4.5 19h15q.213 0 .356.144t.144.357t-.144.356T19.5 20zm4-3.75q-.213 0-.356-.144T8 15.749t.144-.356t.356-.143h7q.213 0 .356.144t.144.357t-.144.356t-.356.143zm-4-3.75q-.213 0-.356-.144T4 11.999t.144-.356t.356-.143h15q.213 0 .356.144t.144.357t-.144.356t-.356.143zm4-3.75q-.213 0-.356-.144T8 8.249t.144-.356t.356-.143h7q.213 0 .356.144t.144.357t-.144.356t-.356.143zM4.5 5q-.213 0-.356-.144T4 4.499t.144-.356T4.5 4h15q.213 0 .356.144t.144.357t-.144.356T19.5 5z"}));export{h as default}; diff --git a/web-dist/assets/align-justify-DtkZpgWd-mprHBJss.js b/web-dist/assets/align-justify-DtkZpgWd-mprHBJss.js new file mode 100644 index 0000000..dfcdbba --- /dev/null +++ b/web-dist/assets/align-justify-DtkZpgWd-mprHBJss.js @@ -0,0 +1 @@ +import{r as t}from"./index-C6LPy0O3.js";const h=e=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},t.createElement("path",{fill:"currentColor",d:"M4.5 20q-.213 0-.356-.144T4 19.499t.144-.356T4.5 19h15q.213 0 .356.144t.144.357t-.144.356T19.5 20zm0-3.75q-.213 0-.356-.144T4 15.749t.144-.356t.356-.143h15q.213 0 .356.144t.144.357t-.144.356t-.356.143zm0-3.75q-.213 0-.356-.144T4 11.999t.144-.356t.356-.143h15q.213 0 .356.144t.144.357t-.144.356t-.356.143zm0-3.75q-.213 0-.356-.144T4 8.249t.144-.356t.356-.143h15q.213 0 .356.144t.144.357t-.144.356t-.356.143zM4.5 5q-.213 0-.356-.144T4 4.499t.144-.356T4.5 4h15q.213 0 .356.144t.144.357t-.144.356T19.5 5z"}));export{h as default}; diff --git a/web-dist/assets/align-left-nz355YSx-CLoUDUko.js b/web-dist/assets/align-left-nz355YSx-CLoUDUko.js new file mode 100644 index 0000000..e289558 --- /dev/null +++ b/web-dist/assets/align-left-nz355YSx-CLoUDUko.js @@ -0,0 +1 @@ +import{r as t}from"./index-C6LPy0O3.js";const h=e=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},t.createElement("path",{fill:"currentColor",d:"M4.5 20q-.213 0-.356-.144T4 19.499t.144-.356T4.5 19h15q.213 0 .356.144t.144.357t-.144.356T19.5 20zm0-3.75q-.213 0-.356-.144T4 15.749t.144-.356t.356-.143h9q.213 0 .356.144t.144.357t-.144.356t-.356.143zm0-3.75q-.213 0-.356-.144T4 11.999t.144-.356t.356-.143h15q.213 0 .356.144t.144.357t-.144.356t-.356.143zm0-3.75q-.213 0-.356-.144T4 8.249t.144-.356t.356-.143h9q.213 0 .356.144t.144.357t-.144.356t-.356.143zM4.5 5q-.213 0-.356-.144T4 4.499t.144-.356T4.5 4h15q.213 0 .356.144t.144.357t-.144.356T19.5 5z"}));export{h as default}; diff --git a/web-dist/assets/align-right-CuY2aKVp-BEBJPE9V.js b/web-dist/assets/align-right-CuY2aKVp-BEBJPE9V.js new file mode 100644 index 0000000..1c16c14 --- /dev/null +++ b/web-dist/assets/align-right-CuY2aKVp-BEBJPE9V.js @@ -0,0 +1 @@ +import{r as t}from"./index-C6LPy0O3.js";const h=e=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},t.createElement("path",{fill:"currentColor",d:"M4.5 5q-.213 0-.356-.144T4 4.499t.144-.356T4.5 4h15q.213 0 .356.144t.144.357t-.144.356T19.5 5zm6 3.75q-.213 0-.356-.144T10 8.249t.144-.356t.356-.143h9q.213 0 .356.144t.144.357t-.144.356t-.356.143zm-6 3.75q-.213 0-.356-.144T4 11.999t.144-.356t.356-.143h15q.213 0 .356.144t.144.357t-.144.356t-.356.143zm6 3.75q-.213 0-.356-.144T10 15.749t.144-.356t.356-.143h9q.213 0 .356.144t.144.357t-.144.356t-.356.143zM4.5 20q-.213 0-.356-.144T4 19.499t.144-.356T4.5 19h15q.213 0 .356.144t.144.357t-.144.356T19.5 20z"}));export{h as default}; diff --git a/web-dist/assets/approve-C2CuyqjZ-jcsnPM2k.js b/web-dist/assets/approve-C2CuyqjZ-jcsnPM2k.js new file mode 100644 index 0000000..0e26f37 --- /dev/null +++ b/web-dist/assets/approve-C2CuyqjZ-jcsnPM2k.js @@ -0,0 +1 @@ +import{r as l}from"./index-C6LPy0O3.js";const r=t=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t},l.createElement("path",{fill:"currentColor",d:"m23 12l-2.44-2.78l.34-3.68l-3.61-.82l-1.89-3.18L12 3L8.6 1.54L6.71 4.72l-3.61.81l.34 3.68L1 12l2.44 2.78l-.34 3.69l3.61.82l1.89 3.18L12 21l3.4 1.46l1.89-3.18l3.61-.82l-.34-3.68zm-13 5l-4-4l1.41-1.41L10 14.17l6.59-6.59L18 9z"}));export{r as default}; diff --git a/web-dist/assets/arrow-drop-down-C-Cm0O58-CGUufRb1.js b/web-dist/assets/arrow-drop-down-C-Cm0O58-CGUufRb1.js new file mode 100644 index 0000000..f76492b --- /dev/null +++ b/web-dist/assets/arrow-drop-down-C-Cm0O58-CGUufRb1.js @@ -0,0 +1 @@ +import{r as t}from"./index-C6LPy0O3.js";const l=e=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},t.createElement("path",{fill:"currentColor",d:"m11.565 13.873l-2.677-2.677q-.055-.055-.093-.129q-.037-.073-.037-.157q0-.168.11-.289q.112-.121.294-.121h5.677q.181 0 .292.124t.111.288q0 .042-.13.284l-2.677 2.677q-.093.093-.2.143t-.235.05t-.235-.05t-.2-.143"}));export{l as default}; diff --git a/web-dist/assets/assets/account-location-BCNgMMMw-BQ7mU2Ng.js b/web-dist/assets/assets/account-location-BCNgMMMw-BQ7mU2Ng.js new file mode 100644 index 0000000..090ae95 --- /dev/null +++ b/web-dist/assets/assets/account-location-BCNgMMMw-BQ7mU2Ng.js @@ -0,0 +1 @@ +import{r as t}from"./index-C6LPy0O3.js";const r=e=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:40,height:40,viewBox:"0 0 24 24",...e},t.createElement("path",{fill:"currentColor",d:"M20 2H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h4l4 4l4-4h4a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2m-8 2.3c1.5 0 2.7 1.2 2.7 2.7S13.5 9.7 12 9.7S9.3 8.5 9.3 7s1.2-2.7 2.7-2.7M18 15H6v-.9c0-2 4-3.1 6-3.1s6 1.1 6 3.1z"}));export{r as default}; diff --git a/web-dist/assets/assets/add-DBGs_LmH-UF_0ErRm.js b/web-dist/assets/assets/add-DBGs_LmH-UF_0ErRm.js new file mode 100644 index 0000000..e2ad3bc --- /dev/null +++ b/web-dist/assets/assets/add-DBGs_LmH-UF_0ErRm.js @@ -0,0 +1 @@ +import{r as e}from"./index-C6LPy0O3.js";const h=t=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t},e.createElement("path",{fill:"currentColor",d:"M11 13H5v-2h6V5h2v6h6v2h-6v6h-2z"}));export{h as default}; diff --git a/web-dist/assets/assets/admin-outlined-DXTGKZe5-Bl5p60Yl.js b/web-dist/assets/assets/admin-outlined-DXTGKZe5-Bl5p60Yl.js new file mode 100644 index 0000000..eeed787 --- /dev/null +++ b/web-dist/assets/assets/admin-outlined-DXTGKZe5-Bl5p60Yl.js @@ -0,0 +1 @@ +import{r as e}from"./index-C6LPy0O3.js";const l=t=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t},e.createElement("path",{fill:"currentColor",d:"M12 23C6.443 21.765 2 16.522 2 11V5l10-4l10 4v6c0 5.524-4.443 10.765-10 12M4 6v5a10.58 10.58 0 0 0 8 10a10.58 10.58 0 0 0 8-10V6l-8-3Z"}),e.createElement("circle",{cx:12,cy:8.5,r:2.5,fill:"currentColor"}),e.createElement("path",{fill:"currentColor",d:"M7 15a5.78 5.78 0 0 0 5 3a5.78 5.78 0 0 0 5-3c-.025-1.896-3.342-3-5-3c-1.667 0-4.975 1.104-5 3"}));export{l as default}; diff --git a/web-dist/assets/assets/airport-DmUdZQah-C_Zatqrq.js b/web-dist/assets/assets/airport-DmUdZQah-C_Zatqrq.js new file mode 100644 index 0000000..c52da43 --- /dev/null +++ b/web-dist/assets/assets/airport-DmUdZQah-C_Zatqrq.js @@ -0,0 +1 @@ +import{r as l}from"./index-C6LPy0O3.js";const h=t=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t},l.createElement("path",{fill:"currentColor",d:"m6.923 13.442l1.848-4.75H5.038l-1.267 1.904H3.02l.827-2.865l-.827-2.885h.752L5.04 6.75h3.73L6.923 2h1l3.335 4.75h3.146q.413 0 .697.284q.284.283.284.697t-.284.687q-.284.274-.697.274h-3.146l-3.335 4.75zM16.096 22l-3.335-4.75H9.617q-.414 0-.698-.284q-.283-.283-.283-.697t.283-.697t.698-.284h3.146l3.334-4.73h1l-1.848 4.73h3.733l1.267-1.884H21l-.827 2.865l.827 2.885h-.752l-1.267-1.904h-3.733L17.096 22z"}));export{h as default}; diff --git a/web-dist/assets/assets/align-center-kIaj1t0E-BEGA2USP.js b/web-dist/assets/assets/align-center-kIaj1t0E-BEGA2USP.js new file mode 100644 index 0000000..5b20e2e --- /dev/null +++ b/web-dist/assets/assets/align-center-kIaj1t0E-BEGA2USP.js @@ -0,0 +1 @@ +import{r as t}from"./index-C6LPy0O3.js";const h=e=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},t.createElement("path",{fill:"currentColor",d:"M4.5 20q-.213 0-.356-.144T4 19.499t.144-.356T4.5 19h15q.213 0 .356.144t.144.357t-.144.356T19.5 20zm4-3.75q-.213 0-.356-.144T8 15.749t.144-.356t.356-.143h7q.213 0 .356.144t.144.357t-.144.356t-.356.143zm-4-3.75q-.213 0-.356-.144T4 11.999t.144-.356t.356-.143h15q.213 0 .356.144t.144.357t-.144.356t-.356.143zm4-3.75q-.213 0-.356-.144T8 8.249t.144-.356t.356-.143h7q.213 0 .356.144t.144.357t-.144.356t-.356.143zM4.5 5q-.213 0-.356-.144T4 4.499t.144-.356T4.5 4h15q.213 0 .356.144t.144.357t-.144.356T19.5 5z"}));export{h as default}; diff --git a/web-dist/assets/assets/align-justify-DtkZpgWd-mprHBJss.js b/web-dist/assets/assets/align-justify-DtkZpgWd-mprHBJss.js new file mode 100644 index 0000000..dfcdbba --- /dev/null +++ b/web-dist/assets/assets/align-justify-DtkZpgWd-mprHBJss.js @@ -0,0 +1 @@ +import{r as t}from"./index-C6LPy0O3.js";const h=e=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},t.createElement("path",{fill:"currentColor",d:"M4.5 20q-.213 0-.356-.144T4 19.499t.144-.356T4.5 19h15q.213 0 .356.144t.144.357t-.144.356T19.5 20zm0-3.75q-.213 0-.356-.144T4 15.749t.144-.356t.356-.143h15q.213 0 .356.144t.144.357t-.144.356t-.356.143zm0-3.75q-.213 0-.356-.144T4 11.999t.144-.356t.356-.143h15q.213 0 .356.144t.144.357t-.144.356t-.356.143zm0-3.75q-.213 0-.356-.144T4 8.249t.144-.356t.356-.143h15q.213 0 .356.144t.144.357t-.144.356t-.356.143zM4.5 5q-.213 0-.356-.144T4 4.499t.144-.356T4.5 4h15q.213 0 .356.144t.144.357t-.144.356T19.5 5z"}));export{h as default}; diff --git a/web-dist/assets/assets/align-left-nz355YSx-CLoUDUko.js b/web-dist/assets/assets/align-left-nz355YSx-CLoUDUko.js new file mode 100644 index 0000000..e289558 --- /dev/null +++ b/web-dist/assets/assets/align-left-nz355YSx-CLoUDUko.js @@ -0,0 +1 @@ +import{r as t}from"./index-C6LPy0O3.js";const h=e=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},t.createElement("path",{fill:"currentColor",d:"M4.5 20q-.213 0-.356-.144T4 19.499t.144-.356T4.5 19h15q.213 0 .356.144t.144.357t-.144.356T19.5 20zm0-3.75q-.213 0-.356-.144T4 15.749t.144-.356t.356-.143h9q.213 0 .356.144t.144.357t-.144.356t-.356.143zm0-3.75q-.213 0-.356-.144T4 11.999t.144-.356t.356-.143h15q.213 0 .356.144t.144.357t-.144.356t-.356.143zm0-3.75q-.213 0-.356-.144T4 8.249t.144-.356t.356-.143h9q.213 0 .356.144t.144.357t-.144.356t-.356.143zM4.5 5q-.213 0-.356-.144T4 4.499t.144-.356T4.5 4h15q.213 0 .356.144t.144.357t-.144.356T19.5 5z"}));export{h as default}; diff --git a/web-dist/assets/assets/align-right-CuY2aKVp-BEBJPE9V.js b/web-dist/assets/assets/align-right-CuY2aKVp-BEBJPE9V.js new file mode 100644 index 0000000..1c16c14 --- /dev/null +++ b/web-dist/assets/assets/align-right-CuY2aKVp-BEBJPE9V.js @@ -0,0 +1 @@ +import{r as t}from"./index-C6LPy0O3.js";const h=e=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},t.createElement("path",{fill:"currentColor",d:"M4.5 5q-.213 0-.356-.144T4 4.499t.144-.356T4.5 4h15q.213 0 .356.144t.144.357t-.144.356T19.5 5zm6 3.75q-.213 0-.356-.144T10 8.249t.144-.356t.356-.143h9q.213 0 .356.144t.144.357t-.144.356t-.356.143zm-6 3.75q-.213 0-.356-.144T4 11.999t.144-.356t.356-.143h15q.213 0 .356.144t.144.357t-.144.356t-.356.143zm6 3.75q-.213 0-.356-.144T10 15.749t.144-.356t.356-.143h9q.213 0 .356.144t.144.357t-.144.356t-.356.143zM4.5 20q-.213 0-.356-.144T4 19.499t.144-.356T4.5 19h15q.213 0 .356.144t.144.357t-.144.356T19.5 20z"}));export{h as default}; diff --git a/web-dist/assets/assets/approve-C2CuyqjZ-jcsnPM2k.js b/web-dist/assets/assets/approve-C2CuyqjZ-jcsnPM2k.js new file mode 100644 index 0000000..0e26f37 --- /dev/null +++ b/web-dist/assets/assets/approve-C2CuyqjZ-jcsnPM2k.js @@ -0,0 +1 @@ +import{r as l}from"./index-C6LPy0O3.js";const r=t=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t},l.createElement("path",{fill:"currentColor",d:"m23 12l-2.44-2.78l.34-3.68l-3.61-.82l-1.89-3.18L12 3L8.6 1.54L6.71 4.72l-3.61.81l.34 3.68L1 12l2.44 2.78l-.34 3.69l3.61.82l1.89 3.18L12 21l3.4 1.46l1.89-3.18l3.61-.82l-.34-3.68zm-13 5l-4-4l1.41-1.41L10 14.17l6.59-6.59L18 9z"}));export{r as default}; diff --git a/web-dist/assets/assets/arrow-drop-down-C-Cm0O58-CGUufRb1.js b/web-dist/assets/assets/arrow-drop-down-C-Cm0O58-CGUufRb1.js new file mode 100644 index 0000000..f76492b --- /dev/null +++ b/web-dist/assets/assets/arrow-drop-down-C-Cm0O58-CGUufRb1.js @@ -0,0 +1 @@ +import{r as t}from"./index-C6LPy0O3.js";const l=e=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},t.createElement("path",{fill:"currentColor",d:"m11.565 13.873l-2.677-2.677q-.055-.055-.093-.129q-.037-.073-.037-.157q0-.168.11-.289q.112-.121.294-.121h5.677q.181 0 .292.124t.111.288q0 .042-.13.284l-2.677 2.677q-.093.093-.2.143t-.235.05t-.235-.05t-.2-.143"}));export{l as default}; diff --git a/web-dist/assets/assets/blocks-group-BnKCc4Rj-B3Y5c34l.js b/web-dist/assets/assets/blocks-group-BnKCc4Rj-B3Y5c34l.js new file mode 100644 index 0000000..c07dff2 --- /dev/null +++ b/web-dist/assets/assets/blocks-group-BnKCc4Rj-B3Y5c34l.js @@ -0,0 +1 @@ +import{r as l}from"./index-C6LPy0O3.js";const t=a=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:40,height:40,viewBox:"0 0 36 36",...a},l.createElement("path",{fill:"currentColor",d:"m33.53 18.76l-6.93-3.19V6.43a1 1 0 0 0-.6-.9l-7.5-3.45a1 1 0 0 0-.84 0l-7.5 3.45a1 1 0 0 0-.58.91v9.14l-6.9 3.18a1 1 0 0 0-.58.91v9.78a1 1 0 0 0 .58.91l7.5 3.45a1 1 0 0 0 .84 0l7.08-3.26l7.08 3.26a1 1 0 0 0 .84 0l7.5-3.45a1 1 0 0 0 .58-.91v-9.78a1 1 0 0 0-.57-.91M25.61 22l-5.11-2.33l5.11-2.35l5.11 2.35Zm-1-6.44l-6.44 3v-7.69a1 1 0 0 0 .35-.08L24.6 8v7.58ZM18.1 4.08l5.11 2.35l-5.11 2.35L13 6.43Zm-7.5 13.23l5.11 2.35L10.6 22l-5.11-2.33Zm6.5 11.49l-6.5 3v-7.69A1 1 0 0 0 11 24l6.08-2.8Zm15 0l-6.46 3v-7.69A1 1 0 0 0 26 24l6.08-2.8Z",className:"clr-i-solid clr-i-solid-path-1"}),l.createElement("path",{fill:"none",d:"M0 0h36v36H0z"}));export{t as default}; diff --git a/web-dist/assets/assets/bold-C7Q6mc6R-DyhVyGRn.js b/web-dist/assets/assets/bold-C7Q6mc6R-DyhVyGRn.js new file mode 100644 index 0000000..ad9b9ff --- /dev/null +++ b/web-dist/assets/assets/bold-C7Q6mc6R-DyhVyGRn.js @@ -0,0 +1 @@ +import{r as t}from"./index-C6LPy0O3.js";const r=e=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},t.createElement("path",{fill:"currentColor",d:"M8.916 18.25q-.441 0-.74-.299t-.299-.74V6.79q0-.441.299-.74t.74-.299h3.159q1.433 0 2.529.904T15.7 9.006q0 .967-.508 1.693t-1.257 1.065q.913.255 1.55 1.073t.638 1.97q0 1.61-1.202 2.527q-1.202.916-2.646.916zm.236-1.184h3.062q1.161 0 1.875-.7q.715-.699.715-1.627q0-.93-.714-1.629q-.715-.698-1.894-.698H9.152zm0-5.816h2.864q.997 0 1.69-.617t.692-1.546q0-.947-.704-1.553q-.704-.605-1.667-.605H9.152z"}));export{r as default}; diff --git a/web-dist/assets/assets/caret-right-Buv6m22q-BYgM_1dr.js b/web-dist/assets/assets/caret-right-Buv6m22q-BYgM_1dr.js new file mode 100644 index 0000000..18b6ced --- /dev/null +++ b/web-dist/assets/assets/caret-right-Buv6m22q-BYgM_1dr.js @@ -0,0 +1 @@ +import{r as e}from"./index-C6LPy0O3.js";const l=t=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",...t},e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.705 11.823a.73.73 0 0 1-1.205-.552V4.729a.73.73 0 0 1 1.205-.552L10.214 7.2a1 1 0 0 1 .347.757v.084a1 1 0 0 1-.347.757z",clipRule:"evenodd"}));export{l as default}; diff --git a/web-dist/assets/assets/category-outline-DFeZz2a4-B83QTCh_.js b/web-dist/assets/assets/category-outline-DFeZz2a4-B83QTCh_.js new file mode 100644 index 0000000..09efd74 --- /dev/null +++ b/web-dist/assets/assets/category-outline-DFeZz2a4-B83QTCh_.js @@ -0,0 +1 @@ +import{r as e}from"./index-C6LPy0O3.js";const r=t=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t},e.createElement("path",{fill:"currentColor",d:"M11 13.5v8H3v-8zm-2 2H5v4h4zM12 2l5.5 9h-11zm0 3.86L10.08 9h3.84zM17.5 13c2.5 0 4.5 2 4.5 4.5S20 22 17.5 22S13 20 13 17.5s2-4.5 4.5-4.5m0 2a2.5 2.5 0 0 0-2.5 2.5a2.5 2.5 0 0 0 2.5 2.5a2.5 2.5 0 0 0 2.5-2.5a2.5 2.5 0 0 0-2.5-2.5"}));export{r as default}; diff --git a/web-dist/assets/assets/check-CwiFW30S-C9pySFdl.js b/web-dist/assets/assets/check-CwiFW30S-C9pySFdl.js new file mode 100644 index 0000000..b03b70d --- /dev/null +++ b/web-dist/assets/assets/check-CwiFW30S-C9pySFdl.js @@ -0,0 +1 @@ +import{r as e}from"./index-C6LPy0O3.js";const l=t=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t},e.createElement("path",{fill:"currentColor",d:"m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"}));export{l as default}; diff --git a/web-dist/assets/assets/check-one-DZsEj4Rc-CtlZcAVF.js b/web-dist/assets/assets/check-one-DZsEj4Rc-CtlZcAVF.js new file mode 100644 index 0000000..d9414e2 --- /dev/null +++ b/web-dist/assets/assets/check-one-DZsEj4Rc-CtlZcAVF.js @@ -0,0 +1 @@ +import{r as e}from"./index-C6LPy0O3.js";const o=t=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 48 48",...t},e.createElement("g",{fill:"none",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:4},e.createElement("path",{d:"M24 44a19.94 19.94 0 0 0 14.142-5.858A19.94 19.94 0 0 0 44 24a19.94 19.94 0 0 0-5.858-14.142A19.94 19.94 0 0 0 24 4A19.94 19.94 0 0 0 9.858 9.858A19.94 19.94 0 0 0 4 24a19.94 19.94 0 0 0 5.858 14.142A19.94 19.94 0 0 0 24 44Z"}),e.createElement("path",{strokeLinecap:"round",d:"m16 24l6 6l12-12"})));export{o as default}; diff --git a/web-dist/assets/assets/config-HpgzD5LZ-Bh_fadfR.js b/web-dist/assets/assets/config-HpgzD5LZ-Bh_fadfR.js new file mode 100644 index 0000000..c59e187 --- /dev/null +++ b/web-dist/assets/assets/config-HpgzD5LZ-Bh_fadfR.js @@ -0,0 +1 @@ +import{r as a}from"./index-C6LPy0O3.js";const h=t=>a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:40,height:40,viewBox:"0 0 24 24",...t},a.createElement("path",{fill:"currentColor",d:"M13.75 2.25a.75.75 0 0 1 .75.75v4A.75.75 0 0 1 13 7V5.75H3a.75.75 0 0 1 0-1.5h10V3a.75.75 0 0 1 .75-.75M17.25 5a.75.75 0 0 1 .75-.75h3a.75.75 0 0 1 0 1.5h-3a.75.75 0 0 1-.75-.75m-6.5 4.25a.75.75 0 0 1 .75.75v1.25H21a.75.75 0 0 1 0 1.5h-9.5V14a.75.75 0 0 1-1.5 0v-4a.75.75 0 0 1 .75-.75M2.25 12a.75.75 0 0 1 .75-.75h4a.75.75 0 0 1 0 1.5H3a.75.75 0 0 1-.75-.75m11.5 4.25a.75.75 0 0 1 .75.75v4a.75.75 0 0 1-1.5 0v-1.25H3a.75.75 0 0 1 0-1.5h10V17a.75.75 0 0 1 .75-.75m3.5 2.75a.75.75 0 0 1 .75-.75h3a.75.75 0 0 1 0 1.5h-3a.75.75 0 0 1-.75-.75"}));export{h as default}; diff --git a/web-dist/assets/assets/content-CVv2xHwr-j5phXAKf.js b/web-dist/assets/assets/content-CVv2xHwr-j5phXAKf.js new file mode 100644 index 0000000..b4430f3 --- /dev/null +++ b/web-dist/assets/assets/content-CVv2xHwr-j5phXAKf.js @@ -0,0 +1 @@ +import{r as t}from"./index-C6LPy0O3.js";const h=e=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},t.createElement("path",{fill:"currentColor",d:"M5.73 15.885h12.54v-1H5.73zm0-3.385h12.54v-1H5.73zm0-3.384h8.77v-1H5.73zM4.616 19q-.69 0-1.153-.462T3 17.384V6.616q0-.691.463-1.153T4.615 5h14.77q.69 0 1.152.463T21 6.616v10.769q0 .69-.463 1.153T19.385 19zm0-1h14.77q.23 0 .423-.192t.192-.424V6.616q0-.231-.192-.424T19.385 6H4.615q-.23 0-.423.192T4 6.616v10.769q0 .23.192.423t.423.192M4 18V6z"}));export{h as default}; diff --git a/web-dist/assets/assets/copy-CVj4__by-DerdV2Ke.js b/web-dist/assets/assets/copy-CVj4__by-DerdV2Ke.js new file mode 100644 index 0000000..da3b79a --- /dev/null +++ b/web-dist/assets/assets/copy-CVj4__by-DerdV2Ke.js @@ -0,0 +1 @@ +import{r as t}from"./index-C6LPy0O3.js";const q=e=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},t.createElement("path",{fill:"currentColor",d:"M9.116 17q-.691 0-1.153-.462T7.5 15.385V4.615q0-.69.463-1.153T9.116 3h7.769q.69 0 1.153.462t.462 1.153v10.77q0 .69-.462 1.152T16.884 17zm0-1h7.769q.23 0 .423-.192t.192-.423V4.615q0-.23-.192-.423T16.884 4H9.116q-.231 0-.424.192t-.192.423v10.77q0 .23.192.423t.423.192m-3 4q-.69 0-1.153-.462T4.5 18.385V6.615h1v11.77q0 .23.192.423t.423.192h8.77v1zM8.5 16V4z"}));export{q as default}; diff --git a/web-dist/assets/assets/cube-duotone-C5nZlt1x-Fjdr6l_7.js b/web-dist/assets/assets/cube-duotone-C5nZlt1x-Fjdr6l_7.js new file mode 100644 index 0000000..eda3fc6 --- /dev/null +++ b/web-dist/assets/assets/cube-duotone-C5nZlt1x-Fjdr6l_7.js @@ -0,0 +1 @@ +import{r as e}from"./index-C6LPy0O3.js";const l=t=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 256",...t},e.createElement("g",{fill:"currentColor"},e.createElement("path",{d:"M128 129.09V232a8 8 0 0 1-3.84-1l-88-48.16a8 8 0 0 1-4.16-7V80.2a8 8 0 0 1 .7-3.27Z",opacity:.2}),e.createElement("path",{d:"m223.68 66.15l-88-48.15a15.88 15.88 0 0 0-15.36 0l-88 48.17a16 16 0 0 0-8.32 14v95.64a16 16 0 0 0 8.32 14l88 48.17a15.88 15.88 0 0 0 15.36 0l88-48.17a16 16 0 0 0 8.32-14V80.18a16 16 0 0 0-8.32-14.03M128 32l80.34 44L128 120L47.66 76ZM40 90l80 43.78v85.79l-80-43.75Zm96 129.57v-85.75L216 90v85.78Z"})));export{l as default}; diff --git a/web-dist/assets/assets/date-time-C-XupEct-Rpujkp0p.js b/web-dist/assets/assets/date-time-C-XupEct-Rpujkp0p.js new file mode 100644 index 0000000..852b92e --- /dev/null +++ b/web-dist/assets/assets/date-time-C-XupEct-Rpujkp0p.js @@ -0,0 +1 @@ +import{r as t}from"./index-C6LPy0O3.js";const m=h=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 2048 2048",...h},t.createElement("path",{fill:"currentColor",d:"M1792 993q60 41 107 93t81 114t50 131t18 141q0 119-45 224t-124 183t-183 123t-224 46q-91 0-176-27t-156-78t-126-122t-85-157H128V128h256V0h128v128h896V0h128v128h256zM256 256v256h1408V256h-128v128h-128V256H512v128H384V256zm643 1280q-3-31-3-64q0-86 24-167t73-153h-97v-128h128v86q41-51 91-90t108-67t121-42t128-15q100 0 192 33V640H256v896zm573 384q93 0 174-35t142-96t96-142t36-175q0-93-35-174t-96-142t-142-96t-175-36q-93 0-174 35t-142 96t-96 142t-36 175q0 93 35 174t96 142t142 96t175 36m64-512h192v128h-320v-384h128zM384 1024h128v128H384zm256 0h128v128H640zm0-256h128v128H640zm-256 512h128v128H384zm256 0h128v128H640zm384-384H896V768h128zm256 0h-128V768h128zm256 0h-128V768h128z"}));export{m as default}; diff --git a/web-dist/assets/assets/delete-B_03_u2H-DnXwO91y.js b/web-dist/assets/assets/delete-B_03_u2H-DnXwO91y.js new file mode 100644 index 0000000..00a345c --- /dev/null +++ b/web-dist/assets/assets/delete-B_03_u2H-DnXwO91y.js @@ -0,0 +1 @@ +import{r as t}from"./index-C6LPy0O3.js";const r=e=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:40,height:40,viewBox:"0 0 24 24",...e},t.createElement("path",{fill:"currentColor",d:"M7 21q-.825 0-1.412-.587T5 19V6H4V4h5V3h6v1h5v2h-1v13q0 .825-.587 1.413T17 21zM17 6H7v13h10zM9 17h2V8H9zm4 0h2V8h-2zM7 6v13z"}));export{r as default}; diff --git a/web-dist/assets/assets/edit-Dt4jUBOK-DdTniFpj.js b/web-dist/assets/assets/edit-Dt4jUBOK-DdTniFpj.js new file mode 100644 index 0000000..744cdf3 --- /dev/null +++ b/web-dist/assets/assets/edit-Dt4jUBOK-DdTniFpj.js @@ -0,0 +1 @@ +import{r as e}from"./index-C6LPy0O3.js";const o=t=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t},e.createElement("path",{fill:"currentColor",d:"M3 21v-4.25L17.625 2.175L21.8 6.45L7.25 21zM17.6 7.8L19 6.4L17.6 5l-1.4 1.4z"}));export{o as default}; diff --git a/web-dist/assets/assets/error-duotone-C1DxTjTu-DDLL2tFJ.js b/web-dist/assets/assets/error-duotone-C1DxTjTu-DDLL2tFJ.js new file mode 100644 index 0000000..0f04c51 --- /dev/null +++ b/web-dist/assets/assets/error-duotone-C1DxTjTu-DDLL2tFJ.js @@ -0,0 +1 @@ +import{r as e}from"./index-C6LPy0O3.js";const h=t=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t},e.createElement("path",{fill:"currentColor",d:"M12 4c-4.42 0-8 3.58-8 8s3.58 8 8 8s8-3.58 8-8s-3.58-8-8-8m1 13h-2v-2h2zm0-4h-2V7h2z",opacity:.3}),e.createElement("path",{fill:"currentColor",d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8s8 3.58 8 8s-3.58 8-8 8m-1-5h2v2h-2zm0-8h2v6h-2z"}));export{h as default}; diff --git a/web-dist/assets/assets/error-outline-BtU6WRxh-D0t99Ktq.js b/web-dist/assets/assets/error-outline-BtU6WRxh-D0t99Ktq.js new file mode 100644 index 0000000..cc0eebd --- /dev/null +++ b/web-dist/assets/assets/error-outline-BtU6WRxh-D0t99Ktq.js @@ -0,0 +1 @@ +import{r as t}from"./index-C6LPy0O3.js";const r=T=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...T},t.createElement("path",{fill:"currentColor",d:"M12 17q.425 0 .713-.288T13 16t-.288-.712T12 15t-.712.288T11 16t.288.713T12 17m-1-4h2V7h-2zm1 9q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m0-8"}));export{r as default}; diff --git a/web-dist/assets/assets/exit-BrT4707H-KWxeGyxW.js b/web-dist/assets/assets/exit-BrT4707H-KWxeGyxW.js new file mode 100644 index 0000000..1bff2b8 --- /dev/null +++ b/web-dist/assets/assets/exit-BrT4707H-KWxeGyxW.js @@ -0,0 +1 @@ +import{r as e}from"./index-C6LPy0O3.js";const l=t=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",...t},e.createElement("path",{fill:"currentColor",d:"M12 10V8H7V6h5V4l3 3zm-1-1v4H6v3l-6-3V0h11v5h-1V1H2l4 2v9h4V9z"}));export{l as default}; diff --git a/web-dist/assets/assets/filter-DjN42YHn-DOqAF-9O.js b/web-dist/assets/assets/filter-DjN42YHn-DOqAF-9O.js new file mode 100644 index 0000000..d2721d5 --- /dev/null +++ b/web-dist/assets/assets/filter-DjN42YHn-DOqAF-9O.js @@ -0,0 +1 @@ +import{r as e}from"./index-C6LPy0O3.js";const r=t=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...t},e.createElement("path",{fill:"currentColor",d:"M472 168H40a24 24 0 0 1 0-48h432a24 24 0 0 1 0 48m-80 112H120a24 24 0 0 1 0-48h272a24 24 0 0 1 0 48m-96 112h-80a24 24 0 0 1 0-48h80a24 24 0 0 1 0 48"}));export{r as default}; diff --git a/web-dist/assets/assets/fluent-person-CxE3zAkd-Be1G7Yhk.js b/web-dist/assets/assets/fluent-person-CxE3zAkd-Be1G7Yhk.js new file mode 100644 index 0000000..92c07fe --- /dev/null +++ b/web-dist/assets/assets/fluent-person-CxE3zAkd-Be1G7Yhk.js @@ -0,0 +1 @@ +import{r as e}from"./index-C6LPy0O3.js";const a=t=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 28 28",...t},e.createElement("path",{fill:"currentColor",d:"M13 20.5c0 2.098.862 3.995 2.25 5.357q-1.077.142-2.25.143c-5.79 0-10-2.567-10-6.285V19a3 3 0 0 1 3-3h8.5a7.47 7.47 0 0 0-1.5 4.5M13 2a6 6 0 1 1 0 12a6 6 0 0 1 0-12m14 18.5a6.5 6.5 0 1 1-13 0a6.5 6.5 0 0 1 13 0m-5.786-3.96a.742.742 0 0 0-1.428 0l-.716 2.298h-2.318c-.727 0-1.03.97-.441 1.416l1.875 1.42l-.716 2.298c-.225.721.567 1.32 1.155.875l1.875-1.42l1.875 1.42c.588.446 1.38-.154 1.155-.875l-.716-2.298l1.875-1.42c.588-.445.286-1.416-.441-1.416H21.93z"}));export{a as default}; diff --git a/web-dist/assets/assets/get-text-BQOd1CsX-47piR9b_.js b/web-dist/assets/assets/get-text-BQOd1CsX-47piR9b_.js new file mode 100644 index 0000000..0b3722d --- /dev/null +++ b/web-dist/assets/assets/get-text-BQOd1CsX-47piR9b_.js @@ -0,0 +1 @@ +import{r as h}from"./index-C6LPy0O3.js";const v=e=>h.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},h.createElement("path",{fill:"currentColor",d:"M11.5 16V9h-3V8h7v1h-3v7zm-9.115 5.616v-4.232H4V6.616H2.385V2.385h4.23V4h10.77V2.385h4.23v4.23H20v10.77h1.616v4.23h-4.232V20H6.616v1.616zM6.615 19h10.77v-1.616H19V6.616h-1.616V5H6.616v1.616H5v10.769h1.616z"}));export{v as default}; diff --git a/web-dist/assets/assets/group-work-CMKVD9ib-TFfy7y0z.js b/web-dist/assets/assets/group-work-CMKVD9ib-TFfy7y0z.js new file mode 100644 index 0000000..b1e73a6 --- /dev/null +++ b/web-dist/assets/assets/group-work-CMKVD9ib-TFfy7y0z.js @@ -0,0 +1 @@ +import{r as e}from"./index-C6LPy0O3.js";const t=r=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...r},e.createElement("path",{fill:"currentColor",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8"}),e.createElement("circle",{cx:8,cy:14,r:2,fill:"currentColor"}),e.createElement("circle",{cx:12,cy:8,r:2,fill:"currentColor"}),e.createElement("circle",{cx:16,cy:14,r:2,fill:"currentColor"}));export{t as default}; diff --git a/web-dist/assets/assets/health-circle-SAB-DqvX-BA_zpWhD.js b/web-dist/assets/assets/health-circle-SAB-DqvX-BA_zpWhD.js new file mode 100644 index 0000000..7306429 --- /dev/null +++ b/web-dist/assets/assets/health-circle-SAB-DqvX-BA_zpWhD.js @@ -0,0 +1 @@ +import{r as e}from"./index-C6LPy0O3.js";const o=t=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t},e.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5},e.createElement("path",{d:"M2.5 12.89H7l3-5l4 9l3-5h4.43"}),e.createElement("path",{d:"M12 21.5a9.5 9.5 0 1 0 0-19a9.5 9.5 0 0 0 0 19"})));export{o as default}; diff --git a/web-dist/assets/assets/history-DwvuvWV7-Bsw_jgPl.js b/web-dist/assets/assets/history-DwvuvWV7-Bsw_jgPl.js new file mode 100644 index 0000000..3456301 --- /dev/null +++ b/web-dist/assets/assets/history-DwvuvWV7-Bsw_jgPl.js @@ -0,0 +1 @@ +import{r as t}from"./index-C6LPy0O3.js";const o=e=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},t.createElement("path",{fill:"currentColor",d:"M12 21q-3.45 0-6.012-2.287T3.05 13H5.1q.35 2.6 2.313 4.3T12 19q2.925 0 4.963-2.037T19 12t-2.037-4.962T12 5q-1.725 0-3.225.8T6.25 8H9v2H3V4h2v2.35q1.275-1.6 3.113-2.475T12 3q1.875 0 3.513.713t2.85 1.924t1.925 2.85T21 12t-.712 3.513t-1.925 2.85t-2.85 1.925T12 21m2.8-4.8L11 12.4V7h2v4.6l3.2 3.2z"}));export{o as default}; diff --git a/web-dist/assets/assets/home-InqRf4oC-Bce4HR8O.js b/web-dist/assets/assets/home-InqRf4oC-Bce4HR8O.js new file mode 100644 index 0000000..3343435 --- /dev/null +++ b/web-dist/assets/assets/home-InqRf4oC-Bce4HR8O.js @@ -0,0 +1 @@ +import{r as t}from"./index-C6LPy0O3.js";const r=e=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:40,height:40,viewBox:"0 0 24 24",...e},t.createElement("path",{fill:"currentColor",d:"M12 3L2 12h3v8h6v-6h2v6h6v-8h3zm5 15h-2v-6H9v6H7v-7.81l5-4.5l5 4.5z"}),t.createElement("path",{fill:"currentColor",d:"M7 10.19V18h2v-6h6v6h2v-7.81l-5-4.5z",opacity:.3}));export{r as default}; diff --git a/web-dist/assets/assets/horizontal-rule-DqqTWGF1-BOHhXTVN.js b/web-dist/assets/assets/horizontal-rule-DqqTWGF1-BOHhXTVN.js new file mode 100644 index 0000000..8405b1c --- /dev/null +++ b/web-dist/assets/assets/horizontal-rule-DqqTWGF1-BOHhXTVN.js @@ -0,0 +1 @@ +import{r as t}from"./index-C6LPy0O3.js";const o=e=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},t.createElement("path",{fill:"currentColor",d:"M5.5 12.5q-.213 0-.356-.144T5 11.999t.144-.356t.356-.143h13q.213 0 .356.144t.144.357t-.144.356t-.356.143z"}));export{o as default}; diff --git a/web-dist/assets/assets/image-CnEjCzXp-DzvJXfen.js b/web-dist/assets/assets/image-CnEjCzXp-DzvJXfen.js new file mode 100644 index 0000000..2387255 --- /dev/null +++ b/web-dist/assets/assets/image-CnEjCzXp-DzvJXfen.js @@ -0,0 +1 @@ +import{r as e}from"./index-C6LPy0O3.js";const r=t=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 50 50",...t},e.createElement("path",{fill:"currentColor",d:"M39 38H11c-1.7 0-3-1.3-3-3V15c0-1.7 1.3-3 3-3h28c1.7 0 3 1.3 3 3v20c0 1.7-1.3 3-3 3M11 14c-.6 0-1 .4-1 1v20c0 .6.4 1 1 1h28c.6 0 1-.4 1-1V15c0-.6-.4-1-1-1z"}),e.createElement("path",{fill:"currentColor",d:"M30 24c-2.2 0-4-1.8-4-4s1.8-4 4-4s4 1.8 4 4s-1.8 4-4 4m0-6c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2m5.3 19.7L19 22.4L9.7 31l-1.4-1.4l10.7-10l17.7 16.7z"}),e.createElement("path",{fill:"currentColor",d:"M40.4 32.7L35 28.3L30.5 32l-1.3-1.6l5.8-4.7l6.6 5.4z"}));export{r as default}; diff --git a/web-dist/assets/assets/inbox-CQ1akO08-FUSm8m5e.js b/web-dist/assets/assets/inbox-CQ1akO08-FUSm8m5e.js new file mode 100644 index 0000000..b9c6f64 --- /dev/null +++ b/web-dist/assets/assets/inbox-CQ1akO08-FUSm8m5e.js @@ -0,0 +1 @@ +import{r as l}from"./index-C6LPy0O3.js";const a=e=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},l.createElement("g",{fill:"none",fillRule:"evenodd"},l.createElement("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),l.createElement("path",{fill:"currentColor",d:"M5.83 5.106A2 2 0 0 1 7.617 4h8.764a2 2 0 0 1 1.789 1.106l3.512 7.025a3 3 0 0 1 .318 1.34V19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.528a3 3 0 0 1 .317-1.341zM16.381 6H7.618L4.12 13H7.5A1.5 1.5 0 0 1 9 14.5v1a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-1a1.5 1.5 0 0 1 1.5-1.5h3.38z"})));export{a as default}; diff --git a/web-dist/assets/assets/index-C6LPy0O3.js b/web-dist/assets/assets/index-C6LPy0O3.js new file mode 100644 index 0000000..a630a69 --- /dev/null +++ b/web-dist/assets/assets/index-C6LPy0O3.js @@ -0,0 +1,1545 @@ +var R3t=Object.defineProperty;var VCe=e=>{throw TypeError(e)};var $3t=(e,t,n)=>t in e?R3t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Wt=(e,t,n)=>$3t(e,typeof t!="symbol"?t+"":t,n),SJ=(e,t,n)=>t.has(e)||VCe("Cannot "+n);var Ke=(e,t,n)=>(SJ(e,t,"read from private field"),n?n.call(e):t.get(e)),Un=(e,t,n)=>t.has(e)?VCe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),yn=(e,t,n,r)=>(SJ(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),gr=(e,t,n)=>(SJ(e,t,"access private method"),n);var BA=(e,t,n,r)=>({set _(i){yn(e,t,i,n)},get _(){return Ke(e,t,r)}});function SNe(e,t){for(var n=0;nr[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"]'))r(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"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(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 r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Jo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function _r(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var wNe={exports:{}},VH={},xNe={exports:{}},pi={};/** + * @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 PI=Symbol.for("react.element"),O3t=Symbol.for("react.portal"),T3t=Symbol.for("react.fragment"),I3t=Symbol.for("react.strict_mode"),M3t=Symbol.for("react.profiler"),P3t=Symbol.for("react.provider"),_3t=Symbol.for("react.context"),A3t=Symbol.for("react.forward_ref"),D3t=Symbol.for("react.suspense"),L3t=Symbol.for("react.memo"),F3t=Symbol.for("react.lazy"),GCe=Symbol.iterator;function N3t(e){return e===null||typeof e!="object"?null:(e=GCe&&e[GCe]||e["@@iterator"],typeof e=="function"?e:null)}var ENe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},RNe=Object.assign,$Ne={};function Ix(e,t,n){this.props=e,this.context=t,this.refs=$Ne,this.updater=n||ENe}Ix.prototype.isReactComponent={};Ix.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};Ix.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ONe(){}ONe.prototype=Ix.prototype;function Ffe(e,t,n){this.props=e,this.context=t,this.refs=$Ne,this.updater=n||ENe}var Nfe=Ffe.prototype=new ONe;Nfe.constructor=Ffe;RNe(Nfe,Ix.prototype);Nfe.isPureReactComponent=!0;var WCe=Array.isArray,TNe=Object.prototype.hasOwnProperty,kfe={current:null},INe={key:!0,ref:!0,__self:!0,__source:!0};function MNe(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)TNe.call(t,r)&&!INe.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1>>1,j=A[z];if(0>>1;zi(K,B))qi(X,K)?(A[z]=X,A[q]=B,z=q):(A[z]=K,A[G]=B,z=G);else if(qi(X,B))A[z]=X,A[q]=B,z=q;else break e}}return N}function i(A,N){var B=A.sortIndex-N.sortIndex;return B!==0?B:A.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,f=null,h=3,g=!1,p=!1,m=!1,v=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(A){for(var N=n(c);N!==null;){if(N.callback===null)r(c);else if(N.startTime<=A)r(c),N.sortIndex=N.expirationTime,t(l,N);else break;N=n(c)}}function S(A){if(m=!1,b(A),!p)if(n(l)!==null)p=!0,L(w);else{var N=n(c);N!==null&&I(S,N.startTime-A)}}function w(A,N){p=!1,m&&(m=!1,C(R),R=-1),g=!0;var B=h;try{for(b(N),f=n(l);f!==null&&(!(f.expirationTime>N)||A&&!M());){var z=f.callback;if(typeof z=="function"){f.callback=null,h=f.priorityLevel;var j=z(f.expirationTime<=N);N=e.unstable_now(),typeof j=="function"?f.callback=j:f===n(l)&&r(l),b(N)}else r(l);f=n(l)}if(f!==null)var W=!0;else{var G=n(c);G!==null&&I(S,G.startTime-N),W=!1}return W}finally{f=null,h=B,g=!1}}var x=!1,E=null,R=-1,O=5,T=-1;function M(){return!(e.unstable_now()-TA||125z?(A.sortIndex=B,t(c,A),n(l)===null&&A===n(c)&&(m?(C(R),R=-1):m=!0,I(S,B-z))):(A.sortIndex=j,t(l,A),p||g||(p=!0,L(w))),A},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(A){var N=h;return function(){var B=h;h=N;try{return A.apply(this,arguments)}finally{h=B}}}})(DNe);ANe.exports=DNe;var K3t=ANe.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 LNe=d,vd=K3t;function fn(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Poe=Object.prototype.hasOwnProperty,Y3t=/^[: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]*$/,qCe={},KCe={};function X3t(e){return Poe.call(KCe,e)?!0:Poe.call(qCe,e)?!1:Y3t.test(e)?KCe[e]=!0:(qCe[e]=!0,!1)}function Q3t(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Z3t(e,t,n,r){if(t===null||typeof t>"u"||Q3t(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Sc(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var cl={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){cl[e]=new Sc(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];cl[t]=new Sc(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){cl[e]=new Sc(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){cl[e]=new Sc(e,2,!1,e,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(e){cl[e]=new Sc(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){cl[e]=new Sc(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){cl[e]=new Sc(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){cl[e]=new Sc(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){cl[e]=new Sc(e,5,!1,e.toLowerCase(),null,!1,!1)});var Bfe=/[\-:]([a-z])/g;function Hfe(e){return e[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(e){var t=e.replace(Bfe,Hfe);cl[t]=new Sc(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Bfe,Hfe);cl[t]=new Sc(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Bfe,Hfe);cl[t]=new Sc(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){cl[e]=new Sc(e,1,!1,e.toLowerCase(),null,!1,!1)});cl.xlinkHref=new Sc("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){cl[e]=new Sc(e,1,!1,e.toLowerCase(),null,!0,!0)});function jfe(e,t,n,r){var i=cl.hasOwnProperty(t)?cl[t]:null;(i!==null?i.type!==0:r||!(2a||i[s]!==o[a]){var l=` +`+i[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{EJ=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?qR(e):""}function J3t(e){switch(e.tag){case 5:return qR(e.type);case 16:return qR("Lazy");case 13:return qR("Suspense");case 19:return qR("SuspenseList");case 0:case 2:case 15:return e=RJ(e.type,!1),e;case 11:return e=RJ(e.type.render,!1),e;case 1:return e=RJ(e.type,!0),e;default:return""}}function Loe(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case cS:return"Fragment";case lS:return"Portal";case _oe:return"Profiler";case Vfe:return"StrictMode";case Aoe:return"Suspense";case Doe:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case kNe:return(e.displayName||"Context")+".Consumer";case NNe:return(e._context.displayName||"Context")+".Provider";case Gfe:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Wfe:return t=e.displayName||null,t!==null?t:Loe(e.type)||"Memo";case x2:t=e._payload,e=e._init;try{return Loe(e(t))}catch{}}return null}function e6t(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Loe(t);case 8:return t===Vfe?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function L4(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function BNe(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function t6t(e){var t=BNe(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function VA(e){e._valueTracker||(e._valueTracker=t6t(e))}function HNe(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=BNe(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function vk(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Foe(e,t){var n=t.checked;return rs({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function XCe(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=L4(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function jNe(e,t){t=t.checked,t!=null&&jfe(e,"checked",t,!1)}function Noe(e,t){jNe(e,t);var n=L4(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?koe(e,t.type,n):t.hasOwnProperty("defaultValue")&&koe(e,t.type,L4(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function QCe(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function koe(e,t,n){(t!=="number"||vk(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var KR=Array.isArray;function kS(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=GA.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function TO(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var T$={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},n6t=["Webkit","ms","Moz","O"];Object.keys(T$).forEach(function(e){n6t.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),T$[t]=T$[e]})});function UNe(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||T$.hasOwnProperty(e)&&T$[e]?(""+t).trim():t+"px"}function qNe(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=UNe(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var r6t=rs({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 Hoe(e,t){if(t){if(r6t[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(fn(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(fn(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(fn(61))}if(t.style!=null&&typeof t.style!="object")throw Error(fn(62))}}function joe(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 Voe=null;function Ufe(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Goe=null,zS=null,BS=null;function eye(e){if(e=DI(e)){if(typeof Goe!="function")throw Error(fn(280));var t=e.stateNode;t&&(t=KH(t),Goe(e.stateNode,e.type,t))}}function KNe(e){zS?BS?BS.push(e):BS=[e]:zS=e}function YNe(){if(zS){var e=zS,t=BS;if(BS=zS=null,eye(e),t)for(e=0;e>>=0,e===0?32:31-(g6t(e)/p6t|0)|0}var WA=64,UA=4194304;function YR(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Sk(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=YR(a):(o&=s,o!==0&&(r=YR(o)))}else s=n&~i,s!==0?r=YR(s):o!==0&&(r=YR(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function _I(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-vg(t),e[t]=n}function y6t(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=M$),cye=" ",uye=!1;function pke(e,t){switch(e){case"keyup":return q6t.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mke(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var uS=!1;function Y6t(e,t){switch(e){case"compositionend":return mke(t);case"keypress":return t.which!==32?null:(uye=!0,cye);case"textInput":return e=t.data,e===cye&&uye?null:e;default:return null}}function X6t(e,t){if(uS)return e==="compositionend"||!ehe&&pke(e,t)?(e=hke(),LF=Qfe=X2=null,uS=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=gye(n)}}function bke(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?bke(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ske(){for(var e=window,t=vk();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=vk(e.document)}return t}function the(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function o8t(e){var t=Ske(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&bke(n.ownerDocument.documentElement,n)){if(r!==null&&the(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=pye(n,o);var s=pye(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,dS=null,Xoe=null,_$=null,Qoe=!1;function mye(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qoe||dS==null||dS!==vk(r)||(r=dS,"selectionStart"in r&&the(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),_$&&DO(_$,r)||(_$=r,r=Ek(Xoe,"onSelect"),0gS||(e.current=rse[gS],rse[gS]=null,gS--)}function Ro(e,t){gS++,rse[gS]=e.current,e.current=t}var F4={},Ul=h3(F4),uu=h3(!1),CC=F4;function Lw(e,t){var n=e.type.contextTypes;if(!n)return F4;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function du(e){return e=e.childContextTypes,e!=null}function $k(){Do(uu),Do(Ul)}function xye(e,t,n){if(Ul.current!==F4)throw Error(fn(168));Ro(Ul,t),Ro(uu,n)}function Mke(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(fn(108,e6t(e)||"Unknown",i));return rs({},n,r)}function Ok(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||F4,CC=Ul.current,Ro(Ul,e),Ro(uu,uu.current),!0}function Eye(e,t,n){var r=e.stateNode;if(!r)throw Error(fn(169));n?(e=Mke(e,t,CC),r.__reactInternalMemoizedMergedChildContext=e,Do(uu),Do(Ul),Ro(Ul,e)):Do(uu),Ro(uu,n)}var J1=null,YH=!1,zJ=!1;function Pke(e){J1===null?J1=[e]:J1.push(e)}function v8t(e){YH=!0,Pke(e)}function g3(){if(!zJ&&J1!==null){zJ=!0;var e=0,t=no;try{var n=J1;for(no=1;e>=s,i-=s,a0=1<<32-vg(t)+i|n<R?(O=E,E=null):O=E.sibling;var T=h(C,E,b[R],S);if(T===null){E===null&&(E=O);break}e&&E&&T.alternate===null&&t(C,E),y=o(T,y,R),x===null?w=T:x.sibling=T,x=T,E=O}if(R===b.length)return n(C,E),Ho&&X6(C,R),w;if(E===null){for(;RR?(O=E,E=null):O=E.sibling;var M=h(C,E,T.value,S);if(M===null){E===null&&(E=O);break}e&&E&&M.alternate===null&&t(C,E),y=o(M,y,R),x===null?w=M:x.sibling=M,x=M,E=O}if(T.done)return n(C,E),Ho&&X6(C,R),w;if(E===null){for(;!T.done;R++,T=b.next())T=f(C,T.value,S),T!==null&&(y=o(T,y,R),x===null?w=T:x.sibling=T,x=T);return Ho&&X6(C,R),w}for(E=r(C,E);!T.done;R++,T=b.next())T=g(E,C,R,T.value,S),T!==null&&(e&&T.alternate!==null&&E.delete(T.key===null?R:T.key),y=o(T,y,R),x===null?w=T:x.sibling=T,x=T);return e&&E.forEach(function(_){return t(C,_)}),Ho&&X6(C,R),w}function v(C,y,b,S){if(typeof b=="object"&&b!==null&&b.type===cS&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case jA:e:{for(var w=b.key,x=y;x!==null;){if(x.key===w){if(w=b.type,w===cS){if(x.tag===7){n(C,x.sibling),y=i(x,b.props.children),y.return=C,C=y;break e}}else if(x.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===x2&&Pye(w)===x.type){n(C,x.sibling),y=i(x,b.props),y.ref=kE(C,x,b),y.return=C,C=y;break e}n(C,x);break}else t(C,x);x=x.sibling}b.type===cS?(y=X8(b.props.children,C.mode,S,b.key),y.return=C,C=y):(S=VF(b.type,b.key,b.props,null,C.mode,S),S.ref=kE(C,y,b),S.return=C,C=S)}return s(C);case lS:e:{for(x=b.key;y!==null;){if(y.key===x)if(y.tag===4&&y.stateNode.containerInfo===b.containerInfo&&y.stateNode.implementation===b.implementation){n(C,y.sibling),y=i(y,b.children||[]),y.return=C,C=y;break e}else{n(C,y);break}else t(C,y);y=y.sibling}y=qJ(b,C.mode,S),y.return=C,C=y}return s(C);case x2:return x=b._init,v(C,y,x(b._payload),S)}if(KR(b))return p(C,y,b,S);if(AE(b))return m(C,y,b,S);JA(C,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,y!==null&&y.tag===6?(n(C,y.sibling),y=i(y,b),y.return=C,C=y):(n(C,y),y=UJ(b,C.mode,S),y.return=C,C=y),s(C)):n(C,y)}return v}var Nw=zke(!0),Bke=zke(!1),LI={},im=h3(LI),kO=h3(LI),zO=h3(LI);function E8(e){if(e===LI)throw Error(fn(174));return e}function uhe(e,t){switch(Ro(zO,t),Ro(kO,e),Ro(im,LI),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Boe(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Boe(t,e)}Do(im),Ro(im,t)}function kw(){Do(im),Do(kO),Do(zO)}function Hke(e){E8(zO.current);var t=E8(im.current),n=Boe(t,e.type);t!==n&&(Ro(kO,e),Ro(im,n))}function dhe(e){kO.current===e&&(Do(im),Do(kO))}var Qo=h3(0);function Ak(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var BJ=[];function fhe(){for(var e=0;en?n:4,e(!0);var r=HJ.transition;HJ.transition={};try{e(!1),t()}finally{no=n,HJ.transition=r}}function rze(){return Wf().memoizedState}function S8t(e,t,n){var r=g4(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ize(e))oze(t,n);else if(n=Lke(e,t,n,r),n!==null){var i=gc();Cg(n,e,r,i),sze(n,t,r)}}function w8t(e,t,n){var r=g4(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ize(e))oze(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,Pg(a,s)){var l=t.interleaved;l===null?(i.next=i,lhe(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=Lke(e,t,i,r),n!==null&&(i=gc(),Cg(n,e,r,i),sze(n,t,r))}}function ize(e){var t=e.alternate;return e===ns||t!==null&&t===ns}function oze(e,t){A$=Dk=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function sze(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Kfe(e,n)}}var Lk={readContext:Gf,useCallback:bl,useContext:bl,useEffect:bl,useImperativeHandle:bl,useInsertionEffect:bl,useLayoutEffect:bl,useMemo:bl,useReducer:bl,useRef:bl,useState:bl,useDebugValue:bl,useDeferredValue:bl,useTransition:bl,useMutableSource:bl,useSyncExternalStore:bl,useId:bl,unstable_isNewReconciler:!1},x8t={readContext:Gf,useCallback:function(e,t){return Mp().memoizedState=[e,t===void 0?null:t],e},useContext:Gf,useEffect:Aye,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,zF(4194308,4,Zke.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zF(4194308,4,e,t)},useInsertionEffect:function(e,t){return zF(4,2,e,t)},useMemo:function(e,t){var n=Mp();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Mp();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=S8t.bind(null,ns,e),[r.memoizedState,e]},useRef:function(e){var t=Mp();return e={current:e},t.memoizedState=e},useState:_ye,useDebugValue:vhe,useDeferredValue:function(e){return Mp().memoizedState=e},useTransition:function(){var e=_ye(!1),t=e[0];return e=b8t.bind(null,e[1]),Mp().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ns,i=Mp();if(Ho){if(n===void 0)throw Error(fn(407));n=n()}else{if(n=t(),Aa===null)throw Error(fn(349));bC&30||Gke(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Aye(Uke.bind(null,r,o,e),[e]),r.flags|=2048,jO(9,Wke.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Mp(),t=Aa.identifierPrefix;if(Ho){var n=l0,r=a0;n=(r&~(1<<32-vg(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=BO++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Vp]=t,e[NO]=r,pze(e,t,!1,!1),t.stateNode=e;e:{switch(s=joe(n,r),n){case"dialog":Mo("cancel",e),Mo("close",e),i=r;break;case"iframe":case"object":case"embed":Mo("load",e),i=r;break;case"video":case"audio":for(i=0;iBw&&(t.flags|=128,r=!0,zE(o,!1),t.lanes=4194304)}else{if(!r)if(e=Ak(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),zE(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!Ho)return Sl(t),null}else 2*xs()-o.renderingStartTime>Bw&&n!==1073741824&&(t.flags|=128,r=!0,zE(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=xs(),t.sibling=null,n=Qo.current,Ro(Qo,r?n&1|2:n&1),t):(Sl(t),null);case 22:case 23:return xhe(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Uu&1073741824&&(Sl(t),t.subtreeFlags&6&&(t.flags|=8192)):Sl(t),null;case 24:return null;case 25:return null}throw Error(fn(156,t.tag))}function P8t(e,t){switch(rhe(t),t.tag){case 1:return du(t.type)&&$k(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return kw(),Do(uu),Do(Ul),fhe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return dhe(t),null;case 13:if(Do(Qo),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(fn(340));Fw()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Do(Qo),null;case 4:return kw(),null;case 10:return ahe(t.type._context),null;case 22:case 23:return xhe(),null;case 24:return null;default:return null}}var tD=!1,Dl=!1,_8t=typeof WeakSet=="function"?WeakSet:Set,Nn=null;function CS(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ls(e,t,r)}else n.current=null}function pse(e,t,n){try{n()}catch(r){ls(e,t,r)}}var jye=!1;function A8t(e,t){if(Zoe=wk,e=Ske(),the(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,f=e,h=null;t:for(;;){for(var g;f!==n||i!==0&&f.nodeType!==3||(a=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(g=f.firstChild)!==null;)h=f,f=g;for(;;){if(f===e)break t;if(h===n&&++c===i&&(a=s),h===o&&++u===r&&(l=s),(g=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=g}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Joe={focusedElem:e,selectionRange:n},wk=!1,Nn=t;Nn!==null;)if(t=Nn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Nn=e;else for(;Nn!==null;){t=Nn;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,v=p.memoizedState,C=t.stateNode,y=C.getSnapshotBeforeUpdate(t.elementType===t.type?m:Vh(t.type,m),v);C.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(fn(163))}}catch(S){ls(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Nn=e;break}Nn=t.return}return p=jye,jye=!1,p}function D$(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&pse(t,n,o)}i=i.next}while(i!==r)}}function ZH(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function mse(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Cze(e){var t=e.alternate;t!==null&&(e.alternate=null,Cze(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Vp],delete t[NO],delete t[nse],delete t[p8t],delete t[m8t])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function yze(e){return e.tag===5||e.tag===3||e.tag===4}function Vye(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yze(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function vse(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Rk));else if(r!==4&&(e=e.child,e!==null))for(vse(e,t,n),e=e.sibling;e!==null;)vse(e,t,n),e=e.sibling}function Cse(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Cse(e,t,n),e=e.sibling;e!==null;)Cse(e,t,n),e=e.sibling}var Ka=null,Uh=!1;function Lv(e,t,n){for(n=n.child;n!==null;)bze(e,t,n),n=n.sibling}function bze(e,t,n){if(rm&&typeof rm.onCommitFiberUnmount=="function")try{rm.onCommitFiberUnmount(GH,n)}catch{}switch(n.tag){case 5:Dl||CS(n,t);case 6:var r=Ka,i=Uh;Ka=null,Lv(e,t,n),Ka=r,Uh=i,Ka!==null&&(Uh?(e=Ka,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ka.removeChild(n.stateNode));break;case 18:Ka!==null&&(Uh?(e=Ka,n=n.stateNode,e.nodeType===8?kJ(e.parentNode,n):e.nodeType===1&&kJ(e,n),_O(e)):kJ(Ka,n.stateNode));break;case 4:r=Ka,i=Uh,Ka=n.stateNode.containerInfo,Uh=!0,Lv(e,t,n),Ka=r,Uh=i;break;case 0:case 11:case 14:case 15:if(!Dl&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&pse(n,t,s),i=i.next}while(i!==r)}Lv(e,t,n);break;case 1:if(!Dl&&(CS(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ls(n,t,a)}Lv(e,t,n);break;case 21:Lv(e,t,n);break;case 22:n.mode&1?(Dl=(r=Dl)||n.memoizedState!==null,Lv(e,t,n),Dl=r):Lv(e,t,n);break;default:Lv(e,t,n)}}function Gye(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new _8t),t.forEach(function(r){var i=j8t.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function xh(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=xs()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*L8t(r/1960))-r,10e?16:e,Q2===null)var r=!1;else{if(e=Q2,Q2=null,kk=0,Di&6)throw Error(fn(331));var i=Di;for(Di|=4,Nn=e.current;Nn!==null;){var o=Nn,s=o.child;if(Nn.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lxs()-She?Y8(e,0):bhe|=n),fu(e,t)}function Tze(e,t){t===0&&(e.mode&1?(t=UA,UA<<=1,!(UA&130023424)&&(UA=4194304)):t=1);var n=gc();e=T0(e,t),e!==null&&(_I(e,t,n),fu(e,n))}function H8t(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Tze(e,n)}function j8t(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(fn(314))}r!==null&&r.delete(t),Tze(e,n)}var Ize;Ize=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||uu.current)ou=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ou=!1,I8t(e,t,n);ou=!!(e.flags&131072)}else ou=!1,Ho&&t.flags&1048576&&_ke(t,Ik,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;BF(e,t),e=t.pendingProps;var i=Lw(t,Ul.current);jS(t,n),i=ghe(null,t,r,e,i,n);var o=phe();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,du(r)?(o=!0,Ok(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,che(t),i.updater=XH,t.stateNode=i,i._reactInternals=t,lse(t,r,e,n),t=dse(null,t,r,!0,o,n)):(t.tag=0,Ho&&o&&nhe(t),uc(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(BF(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=G8t(r),e=Vh(r,e),i){case 0:t=use(null,t,r,e,n);break e;case 1:t=zye(null,t,r,e,n);break e;case 11:t=Nye(null,t,r,e,n);break e;case 14:t=kye(null,t,r,Vh(r.type,e),n);break e}throw Error(fn(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Vh(r,i),use(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Vh(r,i),zye(e,t,r,i,n);case 3:e:{if(fze(t),e===null)throw Error(fn(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Fke(e,t),_k(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=zw(Error(fn(423)),t),t=Bye(e,t,r,n,i);break e}else if(r!==i){i=zw(Error(fn(424)),t),t=Bye(e,t,r,n,i);break e}else for(nd=d4(t.stateNode.containerInfo.firstChild),ld=t,Ho=!0,Zh=null,n=Bke(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Fw(),r===i){t=I0(e,t,n);break e}uc(e,t,r,n)}t=t.child}return t;case 5:return Hke(t),e===null&&ose(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,ese(r,i)?s=null:o!==null&&ese(r,o)&&(t.flags|=32),dze(e,t),uc(e,t,s,n),t.child;case 6:return e===null&&ose(t),null;case 13:return hze(e,t,n);case 4:return uhe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Nw(t,null,r,n):uc(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Vh(r,i),Nye(e,t,r,i,n);case 7:return uc(e,t,t.pendingProps,n),t.child;case 8:return uc(e,t,t.pendingProps.children,n),t.child;case 12:return uc(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,Ro(Mk,r._currentValue),r._currentValue=s,o!==null)if(Pg(o.value,s)){if(o.children===i.children&&!uu.current){t=I0(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=f0(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),sse(o.return,n,t),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(fn(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),sse(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}uc(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,jS(t,n),i=Gf(i),r=r(i),t.flags|=1,uc(e,t,r,n),t.child;case 14:return r=t.type,i=Vh(r,t.pendingProps),i=Vh(r.type,i),kye(e,t,r,i,n);case 15:return cze(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Vh(r,i),BF(e,t),t.tag=1,du(r)?(e=!0,Ok(t)):e=!1,jS(t,n),kke(t,r,i),lse(t,r,i,n),dse(null,t,r,!0,e,n);case 19:return gze(e,t,n);case 22:return uze(e,t,n)}throw Error(fn(156,t.tag))};function Mze(e,t){return nke(e,t)}function V8t(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _f(e,t,n,r){return new V8t(e,t,n,r)}function Rhe(e){return e=e.prototype,!(!e||!e.isReactComponent)}function G8t(e){if(typeof e=="function")return Rhe(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Gfe)return 11;if(e===Wfe)return 14}return 2}function p4(e,t){var n=e.alternate;return n===null?(n=_f(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function VF(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")Rhe(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case cS:return X8(n.children,i,o,t);case Vfe:s=8,i|=8;break;case _oe:return e=_f(12,n,t,i|2),e.elementType=_oe,e.lanes=o,e;case Aoe:return e=_f(13,n,t,i),e.elementType=Aoe,e.lanes=o,e;case Doe:return e=_f(19,n,t,i),e.elementType=Doe,e.lanes=o,e;case zNe:return ej(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case NNe:s=10;break e;case kNe:s=9;break e;case Gfe:s=11;break e;case Wfe:s=14;break e;case x2:s=16,r=null;break e}throw Error(fn(130,e==null?e:typeof e,""))}return t=_f(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function X8(e,t,n,r){return e=_f(7,e,r,t),e.lanes=n,e}function ej(e,t,n,r){return e=_f(22,e,r,t),e.elementType=zNe,e.lanes=n,e.stateNode={isHidden:!1},e}function UJ(e,t,n){return e=_f(6,e,null,t),e.lanes=n,e}function qJ(e,t,n){return t=_f(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function W8t(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=OJ(0),this.expirationTimes=OJ(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=OJ(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function $he(e,t,n,r,i,o,s,a,l){return e=new W8t(e,t,n,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=_f(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},che(o),e}function U8t(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Dze)}catch(e){console.error(e)}}Dze(),_Ne.exports=Rd;var fo=_Ne.exports;const Hw=Bm(fo),Lze=SNe({__proto__:null,default:Hw},[fo]);var Zye=fo;Moe.createRoot=Zye.createRoot,Moe.hydrateRoot=Zye.hydrateRoot;/** + * @remix-run/router v1.21.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function ko(){return ko=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function jw(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Q8t(){return Math.random().toString(36).substr(2,8)}function ebe(e,t){return{usr:e.state,key:e.key,idx:t}}function GO(e,t,n,r){return n===void 0&&(n=null),ko({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?p3(t):t,{state:n,key:t&&t.key||r||Q8t()})}function xC(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function p3(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Z8t(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,s=i.history,a=Ps.Pop,l=null,c=u();c==null&&(c=0,s.replaceState(ko({},s.state,{idx:c}),""));function u(){return(s.state||{idx:null}).idx}function f(){a=Ps.Pop;let v=u(),C=v==null?null:v-c;c=v,l&&l({action:a,location:m.location,delta:C})}function h(v,C){a=Ps.Push;let y=GO(m.location,v,C);c=u()+1;let b=ebe(y,c),S=m.createHref(y);try{s.pushState(b,"",S)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;i.location.assign(S)}o&&l&&l({action:a,location:m.location,delta:1})}function g(v,C){a=Ps.Replace;let y=GO(m.location,v,C);c=u();let b=ebe(y,c),S=m.createHref(y);s.replaceState(b,"",S),o&&l&&l({action:a,location:m.location,delta:0})}function p(v){let C=i.location.origin!=="null"?i.location.origin:i.location.href,y=typeof v=="string"?v:xC(v);return y=y.replace(/ $/,"%20"),ni(C,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,C)}let m={get action(){return a},get location(){return e(i,s)},listen(v){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(Jye,f),l=v,()=>{i.removeEventListener(Jye,f),l=null}},createHref(v){return t(i,v)},createURL:p,encodeLocation(v){let C=p(v);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:h,replace:g,go(v){return s.go(v)}};return m}var lo;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(lo||(lo={}));const J8t=new Set(["lazy","caseSensitive","path","id","index","children"]);function eCt(e){return e.index===!0}function Hk(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,o)=>{let s=[...n,String(o)],a=typeof i.id=="string"?i.id:s.join("-");if(ni(i.index!==!0||!i.children,"Cannot specify children on an index route"),ni(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),eCt(i)){let l=ko({},i,t(i),{id:a});return r[a]=l,l}else{let l=ko({},i,t(i),{id:a,children:void 0});return r[a]=l,i.children&&(l.children=Hk(i.children,t,s,r)),l}})}function d8(e,t,n){return n===void 0&&(n="/"),GF(e,t,n,!1)}function GF(e,t,n,r){let i=typeof t=="string"?p3(t):t,o=M0(i.pathname||"/",n);if(o==null)return null;let s=Nze(e);tCt(s);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};l.relativePath.startsWith("/")&&(ni(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=h0([r,l.relativePath]),u=n.concat(l);o.children&&o.children.length>0&&(ni(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Nze(o.children,t,u,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:lCt(c,o.index),routesMeta:u})};return e.forEach((o,s)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))i(o,s);else for(let l of kze(o.path))i(o,s,l)}),t}function kze(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let s=kze(r.join("/")),a=[];return a.push(...s.map(l=>l===""?o:[o,l].join("/"))),i&&a.push(...s),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function tCt(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:cCt(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const nCt=/^:[\w-]+$/,rCt=3,iCt=2,oCt=1,sCt=10,aCt=-2,tbe=e=>e==="*";function lCt(e,t){let n=e.split("/"),r=n.length;return n.some(tbe)&&(r+=aCt),t&&(r+=iCt),n.filter(i=>!tbe(i)).reduce((i,o)=>i+(nCt.test(o)?rCt:o===""?oCt:sCt),r)}function cCt(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function uCt(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},o="/",s=[];for(let a=0;a{let{paramName:h,isOptional:g}=u;if(h==="*"){let m=a[f]||"";s=o.slice(0,o.length-m.length).replace(/(.)\/+$/,"$1")}const p=a[f];return g&&!p?c[h]=void 0:c[h]=(p||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:s,pattern:e}}function dCt(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),jw(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function fCt(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return jw(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function M0(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function hCt(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?p3(e):e;return{pathname:n?n.startsWith("/")?n:gCt(n,t):t,search:mCt(r),hash:vCt(i)}}function gCt(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function KJ(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function zze(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function oj(e,t){let n=zze(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function sj(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=p3(e):(i=ko({},e),ni(!i.pathname||!i.pathname.includes("?"),KJ("?","pathname","search",i)),ni(!i.pathname||!i.pathname.includes("#"),KJ("#","pathname","hash",i)),ni(!i.search||!i.search.includes("#"),KJ("#","search","hash",i)));let o=e===""||i.pathname==="",s=o?"/":i.pathname,a;if(s==null)a=n;else{let f=t.length-1;if(!r&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}a=f>=0?t[f]:"/"}let l=hCt(i,a),c=s&&s!=="/"&&s.endsWith("/"),u=(o||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const h0=e=>e.join("/").replace(/\/\/+/g,"/"),pCt=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),mCt=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,vCt=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Vk{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function aj(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Bze=["post","put","patch","delete"],CCt=new Set(Bze),yCt=["get",...Bze],bCt=new Set(yCt),SCt=new Set([301,302,303,307,308]),wCt=new Set([307,308]),YJ={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},xCt={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},HE={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Mhe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ECt=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Hze="remix-router-transitions";function RCt(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;ni(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let fe=e.detectErrorBoundary;i=Te=>({hasErrorBoundary:fe(Te)})}else i=ECt;let o={},s=Hk(e.routes,i,void 0,o),a,l=e.basename||"/",c=e.dataStrategy||ICt,u=e.patchRoutesOnNavigation,f=ko({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),h=null,g=new Set,p=null,m=null,v=null,C=e.hydrationData!=null,y=d8(s,e.history.location,l),b=null;if(y==null&&!u){let fe=Xc(404,{pathname:e.history.location.pathname}),{matches:Te,route:$e}=fbe(s);y=Te,b={[$e.id]:fe}}y&&!e.hydrationData&&It(y,s,e.history.location.pathname).active&&(y=null);let S;if(y)if(y.some(fe=>fe.route.lazy))S=!1;else if(!y.some(fe=>fe.route.loader))S=!0;else if(f.v7_partialHydration){let fe=e.hydrationData?e.hydrationData.loaderData:null,Te=e.hydrationData?e.hydrationData.errors:null;if(Te){let $e=y.findIndex(He=>Te[He.route.id]!==void 0);S=y.slice(0,$e+1).every(He=>!Ese(He.route,fe,Te))}else S=y.every($e=>!Ese($e.route,fe,Te))}else S=e.hydrationData!=null;else if(S=!1,y=[],f.v7_partialHydration){let fe=It(null,s,e.history.location.pathname);fe.active&&fe.matches&&(y=fe.matches)}let w,x={historyAction:e.history.action,location:e.history.location,matches:y,initialized:S,navigation:YJ,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},E=Ps.Pop,R=!1,O,T=!1,M=new Map,_=null,F=!1,D=!1,k=[],L=new Set,I=new Map,A=0,N=-1,B=new Map,z=new Set,j=new Map,W=new Map,G=new Set,K=new Map,q=new Map,X;function Q(){if(h=e.history.listen(fe=>{let{action:Te,location:$e,delta:He}=fe;if(X){X(),X=void 0;return}jw(q.size===0||He!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let it=Xe({currentLocation:x.location,nextLocation:$e,historyAction:Te});if(it&&He!=null){let at=new Promise(gt=>{X=gt});e.history.go(He*-1),je(it,{state:"blocked",location:$e,proceed(){je(it,{state:"proceeding",proceed:void 0,reset:void 0,location:$e}),at.then(()=>e.history.go(He))},reset(){let gt=new Map(x.blockers);gt.set(it,HE),Z({blockers:gt})}});return}return le(Te,$e)}),n){VCt(t,M);let fe=()=>GCt(t,M);t.addEventListener("pagehide",fe),_=()=>t.removeEventListener("pagehide",fe)}return x.initialized||le(Ps.Pop,x.location,{initialHydration:!0}),w}function te(){h&&h(),_&&_(),g.clear(),O&&O.abort(),x.fetchers.forEach((fe,Te)=>Fe(Te)),x.blockers.forEach((fe,Te)=>be(Te))}function ne(fe){return g.add(fe),()=>g.delete(fe)}function Z(fe,Te){Te===void 0&&(Te={}),x=ko({},x,fe);let $e=[],He=[];f.v7_fetcherPersist&&x.fetchers.forEach((it,at)=>{it.state==="idle"&&(G.has(at)?He.push(at):$e.push(at))}),[...g].forEach(it=>it(x,{deletedFetchers:He,viewTransitionOpts:Te.viewTransitionOpts,flushSync:Te.flushSync===!0})),f.v7_fetcherPersist&&($e.forEach(it=>x.fetchers.delete(it)),He.forEach(it=>Fe(it)))}function ee(fe,Te,$e){var He,it;let{flushSync:at}=$e===void 0?{}:$e,gt=x.actionData!=null&&x.navigation.formMethod!=null&&qh(x.navigation.formMethod)&&x.navigation.state==="loading"&&((He=fe.state)==null?void 0:He._isRedirect)!==!0,yt;Te.actionData?Object.keys(Te.actionData).length>0?yt=Te.actionData:yt=null:gt?yt=x.actionData:yt=null;let st=Te.loaderData?ube(x.loaderData,Te.loaderData,Te.matches||[],Te.errors):x.loaderData,Ze=x.blockers;Ze.size>0&&(Ze=new Map(Ze),Ze.forEach((kt,pn)=>Ze.set(pn,HE)));let dt=R===!0||x.navigation.formMethod!=null&&qh(x.navigation.formMethod)&&((it=fe.state)==null?void 0:it._isRedirect)!==!0;a&&(s=a,a=void 0),F||E===Ps.Pop||(E===Ps.Push?e.history.push(fe,fe.state):E===Ps.Replace&&e.history.replace(fe,fe.state));let At;if(E===Ps.Pop){let kt=M.get(x.location.pathname);kt&&kt.has(fe.pathname)?At={currentLocation:x.location,nextLocation:fe}:M.has(fe.pathname)&&(At={currentLocation:fe,nextLocation:x.location})}else if(T){let kt=M.get(x.location.pathname);kt?kt.add(fe.pathname):(kt=new Set([fe.pathname]),M.set(x.location.pathname,kt)),At={currentLocation:x.location,nextLocation:fe}}Z(ko({},Te,{actionData:yt,loaderData:st,historyAction:E,location:fe,initialized:!0,navigation:YJ,revalidation:"idle",restoreScrollPosition:wt(fe,Te.matches||x.matches),preventScrollReset:dt,blockers:Ze}),{viewTransitionOpts:At,flushSync:at===!0}),E=Ps.Pop,R=!1,T=!1,F=!1,D=!1,k=[]}async function J(fe,Te){if(typeof fe=="number"){e.history.go(fe);return}let $e=xse(x.location,x.matches,l,f.v7_prependBasename,fe,f.v7_relativeSplatPath,Te==null?void 0:Te.fromRouteId,Te==null?void 0:Te.relative),{path:He,submission:it,error:at}=nbe(f.v7_normalizeFormMethod,!1,$e,Te),gt=x.location,yt=GO(x.location,He,Te&&Te.state);yt=ko({},yt,e.history.encodeLocation(yt));let st=Te&&Te.replace!=null?Te.replace:void 0,Ze=Ps.Push;st===!0?Ze=Ps.Replace:st===!1||it!=null&&qh(it.formMethod)&&it.formAction===x.location.pathname+x.location.search&&(Ze=Ps.Replace);let dt=Te&&"preventScrollReset"in Te?Te.preventScrollReset===!0:void 0,At=(Te&&Te.flushSync)===!0,kt=Xe({currentLocation:gt,nextLocation:yt,historyAction:Ze});if(kt){je(kt,{state:"blocked",location:yt,proceed(){je(kt,{state:"proceeding",proceed:void 0,reset:void 0,location:yt}),J(fe,Te)},reset(){let pn=new Map(x.blockers);pn.set(kt,HE),Z({blockers:pn})}});return}return await le(Ze,yt,{submission:it,pendingError:at,preventScrollReset:dt,replace:Te&&Te.replace,enableViewTransition:Te&&Te.viewTransition,flushSync:At})}function oe(){if(Ge(),Z({revalidation:"loading"}),x.navigation.state!=="submitting"){if(x.navigation.state==="idle"){le(x.historyAction,x.location,{startUninterruptedRevalidation:!0});return}le(E||x.historyAction,x.navigation.location,{overrideNavigation:x.navigation,enableViewTransition:T===!0})}}async function le(fe,Te,$e){O&&O.abort(),O=null,E=fe,F=($e&&$e.startUninterruptedRevalidation)===!0,$t(x.location,x.matches),R=($e&&$e.preventScrollReset)===!0,T=($e&&$e.enableViewTransition)===!0;let He=a||s,it=$e&&$e.overrideNavigation,at=d8(He,Te,l),gt=($e&&$e.flushSync)===!0,yt=It(at,He,Te.pathname);if(yt.active&&yt.matches&&(at=yt.matches),!at){let{error:ln,notFoundMatches:Lt,route:xt}=ft(Te.pathname);ee(Te,{matches:Lt,loaderData:{},errors:{[xt.id]:ln}},{flushSync:gt});return}if(x.initialized&&!D&&LCt(x.location,Te)&&!($e&&$e.submission&&qh($e.submission.formMethod))){ee(Te,{matches:at},{flushSync:gt});return}O=new AbortController;let st=Jb(e.history,Te,O.signal,$e&&$e.submission),Ze;if($e&&$e.pendingError)Ze=[f8(at).route.id,{type:lo.error,error:$e.pendingError}];else if($e&&$e.submission&&qh($e.submission.formMethod)){let ln=await ge(st,Te,$e.submission,at,yt.active,{replace:$e.replace,flushSync:gt});if(ln.shortCircuited)return;if(ln.pendingActionResult){let[Lt,xt]=ln.pendingActionResult;if(Yu(xt)&&aj(xt.error)&&xt.error.status===404){O=null,ee(Te,{matches:ln.matches,loaderData:{},errors:{[Lt]:xt.error}});return}}at=ln.matches||at,Ze=ln.pendingActionResult,it=XJ(Te,$e.submission),gt=!1,yt.active=!1,st=Jb(e.history,st.url,st.signal)}let{shortCircuited:dt,matches:At,loaderData:kt,errors:pn}=await he(st,Te,at,yt.active,it,$e&&$e.submission,$e&&$e.fetcherSubmission,$e&&$e.replace,$e&&$e.initialHydration===!0,gt,Ze);dt||(O=null,ee(Te,ko({matches:At||at},dbe(Ze),{loaderData:kt,errors:pn})))}async function ge(fe,Te,$e,He,it,at){at===void 0&&(at={}),Ge();let gt=HCt(Te,$e);if(Z({navigation:gt},{flushSync:at.flushSync===!0}),it){let Ze=await Ct(He,Te.pathname,fe.signal);if(Ze.type==="aborted")return{shortCircuited:!0};if(Ze.type==="error"){let dt=f8(Ze.partialMatches).route.id;return{matches:Ze.partialMatches,pendingActionResult:[dt,{type:lo.error,error:Ze.error}]}}else if(Ze.matches)He=Ze.matches;else{let{notFoundMatches:dt,error:At,route:kt}=ft(Te.pathname);return{matches:dt,pendingActionResult:[kt.id,{type:lo.error,error:At}]}}}let yt,st=QR(He,Te);if(!st.route.action&&!st.route.lazy)yt={type:lo.error,error:Xc(405,{method:fe.method,pathname:Te.pathname,routeId:st.route.id})};else if(yt=(await De("action",x,fe,[st],He,null))[st.route.id],fe.signal.aborted)return{shortCircuited:!0};if(R8(yt)){let Ze;return at&&at.replace!=null?Ze=at.replace:Ze=abe(yt.response.headers.get("Location"),new URL(fe.url),l)===x.location.pathname+x.location.search,await Ee(fe,yt,!0,{submission:$e,replace:Ze}),{shortCircuited:!0}}if(Z2(yt))throw Xc(400,{type:"defer-action"});if(Yu(yt)){let Ze=f8(He,st.route.id);return(at&&at.replace)!==!0&&(E=Ps.Push),{matches:He,pendingActionResult:[Ze.route.id,yt]}}return{matches:He,pendingActionResult:[st.route.id,yt]}}async function he(fe,Te,$e,He,it,at,gt,yt,st,Ze,dt){let At=it||XJ(Te,at),kt=at||gt||gbe(At),pn=!F&&(!f.v7_partialHydration||!st);if(He){if(pn){let Dt=ye(dt);Z(ko({navigation:At},Dt!==void 0?{actionData:Dt}:{}),{flushSync:Ze})}let cn=await Ct($e,Te.pathname,fe.signal);if(cn.type==="aborted")return{shortCircuited:!0};if(cn.type==="error"){let Dt=f8(cn.partialMatches).route.id;return{matches:cn.partialMatches,loaderData:{},errors:{[Dt]:cn.error}}}else if(cn.matches)$e=cn.matches;else{let{error:Dt,notFoundMatches:sn,route:Sn}=ft(Te.pathname);return{matches:sn,loaderData:{},errors:{[Sn.id]:Dt}}}}let ln=a||s,[Lt,xt]=ibe(e.history,x,$e,kt,Te,f.v7_partialHydration&&st===!0,f.v7_skipActionErrorRevalidation,D,k,L,G,j,z,ln,l,dt);if(Tt(cn=>!($e&&$e.some(Dt=>Dt.route.id===cn))||Lt&&Lt.some(Dt=>Dt.route.id===cn)),N=++A,Lt.length===0&&xt.length===0){let cn=Re();return ee(Te,ko({matches:$e,loaderData:{},errors:dt&&Yu(dt[1])?{[dt[0]]:dt[1].error}:null},dbe(dt),cn?{fetchers:new Map(x.fetchers)}:{}),{flushSync:Ze}),{shortCircuited:!0}}if(pn){let cn={};if(!He){cn.navigation=At;let Dt=ye(dt);Dt!==void 0&&(cn.actionData=Dt)}xt.length>0&&(cn.fetchers=ue(xt)),Z(cn,{flushSync:Ze})}xt.forEach(cn=>{Ye(cn.key),cn.controller&&I.set(cn.key,cn.controller)});let Rt=()=>xt.forEach(cn=>Ye(cn.key));O&&O.signal.addEventListener("abort",Rt);let{loaderResults:Ft,fetcherResults:hn}=await Be(x,$e,Lt,xt,fe);if(fe.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener("abort",Rt),xt.forEach(cn=>I.delete(cn.key));let Mt=iD(Ft);if(Mt)return await Ee(fe,Mt.result,!0,{replace:yt}),{shortCircuited:!0};if(Mt=iD(hn),Mt)return z.add(Mt.key),await Ee(fe,Mt.result,!0,{replace:yt}),{shortCircuited:!0};let{loaderData:mt,errors:jt}=cbe(x,$e,Ft,dt,xt,hn,K);K.forEach((cn,Dt)=>{cn.subscribe(sn=>{(sn||cn.done)&&K.delete(Dt)})}),f.v7_partialHydration&&st&&x.errors&&(jt=ko({},x.errors,jt));let tn=Re(),Cn=Le(N),Ln=tn||Cn||xt.length>0;return ko({matches:$e,loaderData:mt,errors:jt},Ln?{fetchers:new Map(x.fetchers)}:{})}function ye(fe){if(fe&&!Yu(fe[1]))return{[fe[0]]:fe[1].data};if(x.actionData)return Object.keys(x.actionData).length===0?null:x.actionData}function ue(fe){return fe.forEach(Te=>{let $e=x.fetchers.get(Te.key),He=jE(void 0,$e?$e.data:void 0);x.fetchers.set(Te.key,He)}),new Map(x.fetchers)}function ve(fe,Te,$e,He){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Ye(fe);let it=(He&&He.flushSync)===!0,at=a||s,gt=xse(x.location,x.matches,l,f.v7_prependBasename,$e,f.v7_relativeSplatPath,Te,He==null?void 0:He.relative),yt=d8(at,gt,l),st=It(yt,at,gt);if(st.active&&st.matches&&(yt=st.matches),!yt){We(fe,Te,Xc(404,{pathname:gt}),{flushSync:it});return}let{path:Ze,submission:dt,error:At}=nbe(f.v7_normalizeFormMethod,!0,gt,He);if(At){We(fe,Te,At,{flushSync:it});return}let kt=QR(yt,Ze),pn=(He&&He.preventScrollReset)===!0;if(dt&&qh(dt.formMethod)){de(fe,Te,Ze,kt,yt,st.active,it,pn,dt);return}j.set(fe,{routeId:Te,path:Ze}),xe(fe,Te,Ze,kt,yt,st.active,it,pn,dt)}async function de(fe,Te,$e,He,it,at,gt,yt,st){Ge(),j.delete(fe);function Ze(Tn){if(!Tn.route.action&&!Tn.route.lazy){let Jn=Xc(405,{method:st.formMethod,pathname:$e,routeId:Te});return We(fe,Te,Jn,{flushSync:gt}),!0}return!1}if(!at&&Ze(He))return;let dt=x.fetchers.get(fe);Ue(fe,jCt(st,dt),{flushSync:gt});let At=new AbortController,kt=Jb(e.history,$e,At.signal,st);if(at){let Tn=await Ct(it,$e,kt.signal);if(Tn.type==="aborted")return;if(Tn.type==="error"){We(fe,Te,Tn.error,{flushSync:gt});return}else if(Tn.matches){if(it=Tn.matches,He=QR(it,$e),Ze(He))return}else{We(fe,Te,Xc(404,{pathname:$e}),{flushSync:gt});return}}I.set(fe,At);let pn=A,Lt=(await De("action",x,kt,[He],it,fe))[He.route.id];if(kt.signal.aborted){I.get(fe)===At&&I.delete(fe);return}if(f.v7_fetcherPersist&&G.has(fe)){if(R8(Lt)||Yu(Lt)){Ue(fe,u2(void 0));return}}else{if(R8(Lt))if(I.delete(fe),N>pn){Ue(fe,u2(void 0));return}else return z.add(fe),Ue(fe,jE(st)),Ee(kt,Lt,!1,{fetcherSubmission:st,preventScrollReset:yt});if(Yu(Lt)){We(fe,Te,Lt.error);return}}if(Z2(Lt))throw Xc(400,{type:"defer-action"});let xt=x.navigation.location||x.location,Rt=Jb(e.history,xt,At.signal),Ft=a||s,hn=x.navigation.state!=="idle"?d8(Ft,x.navigation.location,l):x.matches;ni(hn,"Didn't find any matches after fetcher action");let Mt=++A;B.set(fe,Mt);let mt=jE(st,Lt.data);x.fetchers.set(fe,mt);let[jt,tn]=ibe(e.history,x,hn,st,xt,!1,f.v7_skipActionErrorRevalidation,D,k,L,G,j,z,Ft,l,[He.route.id,Lt]);tn.filter(Tn=>Tn.key!==fe).forEach(Tn=>{let Jn=Tn.key,Ar=x.fetchers.get(Jn),Vr=jE(void 0,Ar?Ar.data:void 0);x.fetchers.set(Jn,Vr),Ye(Jn),Tn.controller&&I.set(Jn,Tn.controller)}),Z({fetchers:new Map(x.fetchers)});let Cn=()=>tn.forEach(Tn=>Ye(Tn.key));At.signal.addEventListener("abort",Cn);let{loaderResults:Ln,fetcherResults:cn}=await Be(x,hn,jt,tn,Rt);if(At.signal.aborted)return;At.signal.removeEventListener("abort",Cn),B.delete(fe),I.delete(fe),tn.forEach(Tn=>I.delete(Tn.key));let Dt=iD(Ln);if(Dt)return Ee(Rt,Dt.result,!1,{preventScrollReset:yt});if(Dt=iD(cn),Dt)return z.add(Dt.key),Ee(Rt,Dt.result,!1,{preventScrollReset:yt});let{loaderData:sn,errors:Sn}=cbe(x,hn,Ln,void 0,tn,cn,K);if(x.fetchers.has(fe)){let Tn=u2(Lt.data);x.fetchers.set(fe,Tn)}Le(Mt),x.navigation.state==="loading"&&Mt>N?(ni(E,"Expected pending action"),O&&O.abort(),ee(x.navigation.location,{matches:hn,loaderData:sn,errors:Sn,fetchers:new Map(x.fetchers)})):(Z({errors:Sn,loaderData:ube(x.loaderData,sn,hn,Sn),fetchers:new Map(x.fetchers)}),D=!1)}async function xe(fe,Te,$e,He,it,at,gt,yt,st){let Ze=x.fetchers.get(fe);Ue(fe,jE(st,Ze?Ze.data:void 0),{flushSync:gt});let dt=new AbortController,At=Jb(e.history,$e,dt.signal);if(at){let Lt=await Ct(it,$e,At.signal);if(Lt.type==="aborted")return;if(Lt.type==="error"){We(fe,Te,Lt.error,{flushSync:gt});return}else if(Lt.matches)it=Lt.matches,He=QR(it,$e);else{We(fe,Te,Xc(404,{pathname:$e}),{flushSync:gt});return}}I.set(fe,dt);let kt=A,ln=(await De("loader",x,At,[He],it,fe))[He.route.id];if(Z2(ln)&&(ln=await Phe(ln,At.signal,!0)||ln),I.get(fe)===dt&&I.delete(fe),!At.signal.aborted){if(G.has(fe)){Ue(fe,u2(void 0));return}if(R8(ln))if(N>kt){Ue(fe,u2(void 0));return}else{z.add(fe),await Ee(At,ln,!1,{preventScrollReset:yt});return}if(Yu(ln)){We(fe,Te,ln.error);return}ni(!Z2(ln),"Unhandled fetcher deferred data"),Ue(fe,u2(ln.data))}}async function Ee(fe,Te,$e,He){let{submission:it,fetcherSubmission:at,preventScrollReset:gt,replace:yt}=He===void 0?{}:He;Te.response.headers.has("X-Remix-Revalidate")&&(D=!0);let st=Te.response.headers.get("Location");ni(st,"Expected a Location header on the redirect Response"),st=abe(st,new URL(fe.url),l);let Ze=GO(x.location,st,{_isRedirect:!0});if(n){let Lt=!1;if(Te.response.headers.has("X-Remix-Reload-Document"))Lt=!0;else if(Mhe.test(st)){const xt=e.history.createURL(st);Lt=xt.origin!==t.location.origin||M0(xt.pathname,l)==null}if(Lt){yt?t.location.replace(st):t.location.assign(st);return}}O=null;let dt=yt===!0||Te.response.headers.has("X-Remix-Replace")?Ps.Replace:Ps.Push,{formMethod:At,formAction:kt,formEncType:pn}=x.navigation;!it&&!at&&At&&kt&&pn&&(it=gbe(x.navigation));let ln=it||at;if(wCt.has(Te.response.status)&&ln&&qh(ln.formMethod))await le(dt,Ze,{submission:ko({},ln,{formAction:st}),preventScrollReset:gt||R,enableViewTransition:$e?T:void 0});else{let Lt=XJ(Ze,it);await le(dt,Ze,{overrideNavigation:Lt,fetcherSubmission:at,preventScrollReset:gt||R,enableViewTransition:$e?T:void 0})}}async function De(fe,Te,$e,He,it,at){let gt,yt={};try{gt=await MCt(c,fe,Te,$e,He,it,at,o,i)}catch(st){return He.forEach(Ze=>{yt[Ze.route.id]={type:lo.error,error:st}}),yt}for(let[st,Ze]of Object.entries(gt))if(FCt(Ze)){let dt=Ze.result;yt[st]={type:lo.redirect,response:ACt(dt,$e,st,it,l,f.v7_relativeSplatPath)}}else yt[st]=await _Ct(Ze);return yt}async function Be(fe,Te,$e,He,it){let at=fe.matches,gt=De("loader",fe,it,$e,Te,null),yt=Promise.all(He.map(async dt=>{if(dt.matches&&dt.match&&dt.controller){let kt=(await De("loader",fe,Jb(e.history,dt.path,dt.controller.signal),[dt.match],dt.matches,dt.key))[dt.match.route.id];return{[dt.key]:kt}}else return Promise.resolve({[dt.key]:{type:lo.error,error:Xc(404,{pathname:dt.path})}})})),st=await gt,Ze=(await yt).reduce((dt,At)=>Object.assign(dt,At),{});return await Promise.all([zCt(Te,st,it.signal,at,fe.loaderData),BCt(Te,Ze,He)]),{loaderResults:st,fetcherResults:Ze}}function Ge(){D=!0,k.push(...Tt()),j.forEach((fe,Te)=>{I.has(Te)&&L.add(Te),Ye(Te)})}function Ue(fe,Te,$e){$e===void 0&&($e={}),x.fetchers.set(fe,Te),Z({fetchers:new Map(x.fetchers)},{flushSync:($e&&$e.flushSync)===!0})}function We(fe,Te,$e,He){He===void 0&&(He={});let it=f8(x.matches,Te);Fe(fe),Z({errors:{[it.route.id]:$e},fetchers:new Map(x.fetchers)},{flushSync:(He&&He.flushSync)===!0})}function Ve(fe){return f.v7_fetcherPersist&&(W.set(fe,(W.get(fe)||0)+1),G.has(fe)&&G.delete(fe)),x.fetchers.get(fe)||xCt}function Fe(fe){let Te=x.fetchers.get(fe);I.has(fe)&&!(Te&&Te.state==="loading"&&B.has(fe))&&Ye(fe),j.delete(fe),B.delete(fe),z.delete(fe),G.delete(fe),L.delete(fe),x.fetchers.delete(fe)}function ke(fe){if(f.v7_fetcherPersist){let Te=(W.get(fe)||0)-1;Te<=0?(W.delete(fe),G.add(fe)):W.set(fe,Te)}else Fe(fe);Z({fetchers:new Map(x.fetchers)})}function Ye(fe){let Te=I.get(fe);Te&&(Te.abort(),I.delete(fe))}function ze(fe){for(let Te of fe){let $e=Ve(Te),He=u2($e.data);x.fetchers.set(Te,He)}}function Re(){let fe=[],Te=!1;for(let $e of z){let He=x.fetchers.get($e);ni(He,"Expected fetcher: "+$e),He.state==="loading"&&(z.delete($e),fe.push($e),Te=!0)}return ze(fe),Te}function Le(fe){let Te=[];for(let[$e,He]of B)if(He0}function Me(fe,Te){let $e=x.blockers.get(fe)||HE;return q.get(fe)!==Te&&q.set(fe,Te),$e}function be(fe){x.blockers.delete(fe),q.delete(fe)}function je(fe,Te){let $e=x.blockers.get(fe)||HE;ni($e.state==="unblocked"&&Te.state==="blocked"||$e.state==="blocked"&&Te.state==="blocked"||$e.state==="blocked"&&Te.state==="proceeding"||$e.state==="blocked"&&Te.state==="unblocked"||$e.state==="proceeding"&&Te.state==="unblocked","Invalid blocker state transition: "+$e.state+" -> "+Te.state);let He=new Map(x.blockers);He.set(fe,Te),Z({blockers:He})}function Xe(fe){let{currentLocation:Te,nextLocation:$e,historyAction:He}=fe;if(q.size===0)return;q.size>1&&jw(!1,"A router only supports one blocker at a time");let it=Array.from(q.entries()),[at,gt]=it[it.length-1],yt=x.blockers.get(at);if(!(yt&&yt.state==="proceeding")&>({currentLocation:Te,nextLocation:$e,historyAction:He}))return at}function ft(fe){let Te=Xc(404,{pathname:fe}),$e=a||s,{matches:He,route:it}=fbe($e);return Tt(),{notFoundMatches:He,route:it,error:Te}}function Tt(fe){let Te=[];return K.forEach(($e,He)=>{(!fe||fe(He))&&($e.cancel(),Te.push(He),K.delete(He))}),Te}function tt(fe,Te,$e){if(p=fe,v=Te,m=$e||null,!C&&x.navigation===YJ){C=!0;let He=wt(x.location,x.matches);He!=null&&Z({restoreScrollPosition:He})}return()=>{p=null,v=null,m=null}}function pt(fe,Te){return m&&m(fe,Te.map(He=>Fze(He,x.loaderData)))||fe.key}function $t(fe,Te){if(p&&v){let $e=pt(fe,Te);p[$e]=v()}}function wt(fe,Te){if(p){let $e=pt(fe,Te),He=p[$e];if(typeof He=="number")return He}return null}function It(fe,Te,$e){if(u)if(fe){if(Object.keys(fe[0].params).length>0)return{active:!0,matches:GF(Te,$e,l,!0)}}else return{active:!0,matches:GF(Te,$e,l,!0)||[]};return{active:!1,matches:null}}async function Ct(fe,Te,$e){if(!u)return{type:"success",matches:fe};let He=fe;for(;;){let it=a==null,at=a||s,gt=o;try{await u({path:Te,matches:He,patch:(Ze,dt)=>{$e.aborted||sbe(Ze,dt,at,gt,i)}})}catch(Ze){return{type:"error",error:Ze,partialMatches:He}}finally{it&&!$e.aborted&&(s=[...s])}if($e.aborted)return{type:"aborted"};let yt=d8(at,Te,l);if(yt)return{type:"success",matches:yt};let st=GF(at,Te,l,!0);if(!st||He.length===st.length&&He.every((Ze,dt)=>Ze.route.id===st[dt].route.id))return{type:"success",matches:null};He=st}}function ot(fe){o={},a=Hk(fe,i,void 0,o)}function nt(fe,Te){let $e=a==null;sbe(fe,Te,a||s,o,i),$e&&(s=[...s],Z({}))}return w={get basename(){return l},get future(){return f},get state(){return x},get routes(){return s},get window(){return t},initialize:Q,subscribe:ne,enableScrollRestoration:tt,navigate:J,fetch:ve,revalidate:oe,createHref:fe=>e.history.createHref(fe),encodeLocation:fe=>e.history.encodeLocation(fe),getFetcher:Ve,deleteFetcher:ke,dispose:te,getBlocker:Me,deleteBlocker:be,patchRoutes:nt,_internalFetchControllers:I,_internalActiveDeferreds:K,_internalSetRoutes:ot},w}function $Ct(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function xse(e,t,n,r,i,o,s,a){let l,c;if(s){l=[];for(let f of t)if(l.push(f),f.route.id===s){c=f;break}}else l=t,c=t[t.length-1];let u=sj(i||".",oj(l,o),M0(e.pathname,n)||e.pathname,a==="path");if(i==null&&(u.search=e.search,u.hash=e.hash),(i==null||i===""||i===".")&&c){let f=_he(u.search);if(c.route.index&&!f)u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&f){let h=new URLSearchParams(u.search),g=h.getAll("index");h.delete("index"),g.filter(m=>m).forEach(m=>h.append("index",m));let p=h.toString();u.search=p?"?"+p:""}}return r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:h0([n,u.pathname])),xC(u)}function nbe(e,t,n,r){if(!r||!$Ct(r))return{path:n};if(r.formMethod&&!kCt(r.formMethod))return{path:n,error:Xc(405,{method:r.formMethod})};let i=()=>({path:n,error:Xc(400,{type:"invalid-body"})}),o=r.formMethod||"get",s=e?o.toUpperCase():o.toLowerCase(),a=Gze(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!qh(s))return i();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((g,p)=>{let[m,v]=p;return""+g+m+"="+v+` +`},""):String(r.body);return{path:n,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!qh(s))return i();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:h,text:void 0}}}catch{return i()}}}ni(typeof FormData=="function","FormData is not available in this environment");let l,c;if(r.formData)l=Rse(r.formData),c=r.formData;else if(r.body instanceof FormData)l=Rse(r.body),c=r.body;else if(r.body instanceof URLSearchParams)l=r.body,c=lbe(l);else if(r.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(r.body),c=lbe(l)}catch{return i()}let u={formMethod:s,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(qh(u.formMethod))return{path:n,submission:u};let f=p3(n);return t&&f.search&&_he(f.search)&&l.append("index",""),f.search="?"+l,{path:xC(f),submission:u}}function rbe(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(i=>i.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function ibe(e,t,n,r,i,o,s,a,l,c,u,f,h,g,p,m){let v=m?Yu(m[1])?m[1].error:m[1].data:void 0,C=e.createURL(t.location),y=e.createURL(i),b=n;o&&t.errors?b=rbe(n,Object.keys(t.errors)[0],!0):m&&Yu(m[1])&&(b=rbe(n,m[0]));let S=m?m[1].statusCode:void 0,w=s&&S&&S>=400,x=b.filter((R,O)=>{let{route:T}=R;if(T.lazy)return!0;if(T.loader==null)return!1;if(o)return Ese(T,t.loaderData,t.errors);if(OCt(t.loaderData,t.matches[O],R)||l.some(F=>F===R.route.id))return!0;let M=t.matches[O],_=R;return obe(R,ko({currentUrl:C,currentParams:M.params,nextUrl:y,nextParams:_.params},r,{actionResult:v,actionStatus:S,defaultShouldRevalidate:w?!1:a||C.pathname+C.search===y.pathname+y.search||C.search!==y.search||jze(M,_)}))}),E=[];return f.forEach((R,O)=>{if(o||!n.some(D=>D.route.id===R.routeId)||u.has(O))return;let T=d8(g,R.path,p);if(!T){E.push({key:O,routeId:R.routeId,path:R.path,matches:null,match:null,controller:null});return}let M=t.fetchers.get(O),_=QR(T,R.path),F=!1;h.has(O)?F=!1:c.has(O)?(c.delete(O),F=!0):M&&M.state!=="idle"&&M.data===void 0?F=a:F=obe(_,ko({currentUrl:C,currentParams:t.matches[t.matches.length-1].params,nextUrl:y,nextParams:n[n.length-1].params},r,{actionResult:v,actionStatus:S,defaultShouldRevalidate:w?!1:a})),F&&E.push({key:O,routeId:R.routeId,path:R.path,matches:T,match:_,controller:new AbortController})}),[x,E]}function Ese(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function OCt(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function jze(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function obe(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function sbe(e,t,n,r,i){var o;let s;if(e){let c=r[e];ni(c,"No route found to patch children into: routeId = "+e),c.children||(c.children=[]),s=c.children}else s=n;let a=t.filter(c=>!s.some(u=>Vze(c,u))),l=Hk(a,i,[e||"_","patch",String(((o=s)==null?void 0:o.length)||"0")],r);s.push(...l)}function Vze(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var i;return(i=t.children)==null?void 0:i.some(o=>Vze(n,o))}):!1}async function TCt(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];ni(i,"No route found in manifest");let o={};for(let s in r){let l=i[s]!==void 0&&s!=="hasErrorBoundary";jw(!l,'Route "'+i.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!l&&!J8t.has(s)&&(o[s]=r[s])}Object.assign(i,o),Object.assign(i,ko({},t(i),{lazy:void 0}))}async function ICt(e){let{matches:t}=e,n=t.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,o,s)=>Object.assign(i,{[n[s].route.id]:o}),{})}async function MCt(e,t,n,r,i,o,s,a,l,c){let u=o.map(g=>g.route.lazy?TCt(g.route,l,a):void 0),f=o.map((g,p)=>{let m=u[p],v=i.some(y=>y.route.id===g.route.id);return ko({},g,{shouldLoad:v,resolve:async y=>(y&&r.method==="GET"&&(g.route.lazy||g.route.loader)&&(v=!0),v?PCt(t,r,g,m,y,c):Promise.resolve({type:lo.data,result:void 0}))})}),h=await e({matches:f,request:r,params:o[0].params,fetcherKey:s,context:c});try{await Promise.all(u)}catch{}return h}async function PCt(e,t,n,r,i,o){let s,a,l=c=>{let u,f=new Promise((p,m)=>u=m);a=()=>u(),t.signal.addEventListener("abort",a);let h=p=>typeof c!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):c({request:t,params:n.params,context:o},...p!==void 0?[p]:[]),g=(async()=>{try{return{type:"data",result:await(i?i(m=>h(m)):h())}}catch(p){return{type:"error",result:p}}})();return Promise.race([g,f])};try{let c=n.route[e];if(r)if(c){let u,[f]=await Promise.all([l(c).catch(h=>{u=h}),r]);if(u!==void 0)throw u;s=f}else if(await r,c=n.route[e],c)s=await l(c);else if(e==="action"){let u=new URL(t.url),f=u.pathname+u.search;throw Xc(405,{method:t.method,pathname:f,routeId:n.route.id})}else return{type:lo.data,result:void 0};else if(c)s=await l(c);else{let u=new URL(t.url),f=u.pathname+u.search;throw Xc(404,{pathname:f})}ni(s.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(c){return{type:lo.error,result:c}}finally{a&&t.signal.removeEventListener("abort",a)}return s}async function _Ct(e){let{result:t,type:n}=e;if(Wze(t)){let c;try{let u=t.headers.get("Content-Type");u&&/\bapplication\/json\b/.test(u)?t.body==null?c=null:c=await t.json():c=await t.text()}catch(u){return{type:lo.error,error:u}}return n===lo.error?{type:lo.error,error:new Vk(t.status,t.statusText,c),statusCode:t.status,headers:t.headers}:{type:lo.data,data:c,statusCode:t.status,headers:t.headers}}if(n===lo.error){if(hbe(t)){var r;if(t.data instanceof Error){var i;return{type:lo.error,error:t.data,statusCode:(i=t.init)==null?void 0:i.status}}t=new Vk(((r=t.init)==null?void 0:r.status)||500,void 0,t.data)}return{type:lo.error,error:t,statusCode:aj(t)?t.status:void 0}}if(NCt(t)){var o,s;return{type:lo.deferred,deferredData:t,statusCode:(o=t.init)==null?void 0:o.status,headers:((s=t.init)==null?void 0:s.headers)&&new Headers(t.init.headers)}}if(hbe(t)){var a,l;return{type:lo.data,data:t.data,statusCode:(a=t.init)==null?void 0:a.status,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}}return{type:lo.data,data:t}}function ACt(e,t,n,r,i,o){let s=e.headers.get("Location");if(ni(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Mhe.test(s)){let a=r.slice(0,r.findIndex(l=>l.route.id===n)+1);s=xse(new URL(t.url),a,i,!0,s,o),e.headers.set("Location",s)}return e}function abe(e,t,n){if(Mhe.test(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r),o=M0(i.pathname,n)!=null;if(i.origin===t.origin&&o)return i.pathname+i.search+i.hash}return e}function Jb(e,t,n,r){let i=e.createURL(Gze(t)).toString(),o={signal:n};if(r&&qh(r.formMethod)){let{formMethod:s,formEncType:a}=r;o.method=s.toUpperCase(),a==="application/json"?(o.headers=new Headers({"Content-Type":a}),o.body=JSON.stringify(r.json)):a==="text/plain"?o.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?o.body=Rse(r.formData):o.body=r.formData}return new Request(i,o)}function Rse(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function lbe(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function DCt(e,t,n,r,i){let o={},s=null,a,l=!1,c={},u=n&&Yu(n[1])?n[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let h=f.route.id,g=t[h];if(ni(!R8(g),"Cannot handle redirect results in processLoaderData"),Yu(g)){let p=g.error;u!==void 0&&(p=u,u=void 0),s=s||{};{let m=f8(e,h);s[m.route.id]==null&&(s[m.route.id]=p)}o[h]=void 0,l||(l=!0,a=aj(g.error)?g.error.status:500),g.headers&&(c[h]=g.headers)}else Z2(g)?(r.set(h,g.deferredData),o[h]=g.deferredData.data,g.statusCode!=null&&g.statusCode!==200&&!l&&(a=g.statusCode),g.headers&&(c[h]=g.headers)):(o[h]=g.data,g.statusCode&&g.statusCode!==200&&!l&&(a=g.statusCode),g.headers&&(c[h]=g.headers))}),u!==void 0&&n&&(s={[n[0]]:u},o[n[0]]=void 0),{loaderData:o,errors:s,statusCode:a||200,loaderHeaders:c}}function cbe(e,t,n,r,i,o,s){let{loaderData:a,errors:l}=DCt(t,n,r,s);return i.forEach(c=>{let{key:u,match:f,controller:h}=c,g=o[u];if(ni(g,"Did not find corresponding fetcher result"),!(h&&h.signal.aborted))if(Yu(g)){let p=f8(e.matches,f==null?void 0:f.route.id);l&&l[p.route.id]||(l=ko({},l,{[p.route.id]:g.error})),e.fetchers.delete(u)}else if(R8(g))ni(!1,"Unhandled fetcher revalidation redirect");else if(Z2(g))ni(!1,"Unhandled fetcher deferred data");else{let p=u2(g.data);e.fetchers.set(u,p)}}),{loaderData:a,errors:l}}function ube(e,t,n,r){let i=ko({},t);for(let o of n){let s=o.route.id;if(t.hasOwnProperty(s)?t[s]!==void 0&&(i[s]=t[s]):e[s]!==void 0&&o.route.loader&&(i[s]=e[s]),r&&r.hasOwnProperty(s))break}return i}function dbe(e){return e?Yu(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function f8(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function fbe(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Xc(e,t){let{pathname:n,routeId:r,method:i,type:o,message:s}=t===void 0?{}:t,a="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(a="Bad Request",i&&n&&r?l="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?l="defer() is not supported in actions":o==="invalid-body"&&(l="Unable to encode submission body")):e===403?(a="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):e===404?(a="Not Found",l='No route matches URL "'+n+'"'):e===405&&(a="Method Not Allowed",i&&n&&r?l="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(l='Invalid request method "'+i.toUpperCase()+'"')),new Vk(e||500,a,new Error(l),!0)}function iD(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(R8(i))return{key:r,result:i}}}function Gze(e){let t=typeof e=="string"?p3(e):e;return xC(ko({},t,{hash:""}))}function LCt(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function FCt(e){return Wze(e.result)&&SCt.has(e.result.status)}function Z2(e){return e.type===lo.deferred}function Yu(e){return e.type===lo.error}function R8(e){return(e&&e.type)===lo.redirect}function hbe(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function NCt(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Wze(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function kCt(e){return bCt.has(e.toLowerCase())}function qh(e){return CCt.has(e.toLowerCase())}async function zCt(e,t,n,r,i){let o=Object.entries(t);for(let s=0;s(h==null?void 0:h.route.id)===a);if(!c)continue;let u=r.find(h=>h.route.id===c.route.id),f=u!=null&&!jze(u,c)&&(i&&i[c.route.id])!==void 0;Z2(l)&&f&&await Phe(l,n,!1).then(h=>{h&&(t[a]=h)})}}async function BCt(e,t,n){for(let r=0;r(c==null?void 0:c.route.id)===o)&&Z2(a)&&(ni(s,"Expected an AbortController for revalidating fetcher deferred result"),await Phe(a,s.signal,!0).then(c=>{c&&(t[i]=c)}))}}async function Phe(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:lo.data,data:e.deferredData.unwrappedData}}catch(i){return{type:lo.error,error:i}}return{type:lo.data,data:e.deferredData.data}}}function _he(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function QR(e,t){let n=typeof t=="string"?p3(t).search:t.search;if(e[e.length-1].route.index&&_he(n||""))return e[e.length-1];let r=zze(e);return r[r.length-1]}function gbe(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:o,json:s}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function XJ(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function HCt(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function jE(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function jCt(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function u2(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function VCt(e,t){try{let n=e.sessionStorage.getItem(Hze);if(n){let r=JSON.parse(n);for(let[i,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(i,new Set(o||[]))}}catch{}}function GCt(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(Hze,JSON.stringify(n))}catch(r){jw(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** + * React Router v6.28.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Gk(){return Gk=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),d.useCallback(function(c,u){if(u===void 0&&(u={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let f=sj(c,JSON.parse(s),o,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:h0([t,f.pathname])),(u.replace?r.replace:r.push)(f,u.state,u)},[t,r,s,o,e])}const qCt=d.createContext(null);function KCt(e){let t=d.useContext(Hm).outlet;return t&&d.createElement(qCt.Provider,{value:e},t)}function Z0(){let{matches:e}=d.useContext(Hm),t=e[e.length-1];return t?t.params:{}}function lj(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=d.useContext(Q0),{matches:i}=d.useContext(Hm),{pathname:o}=jm(),s=JSON.stringify(oj(i,r.v7_relativeSplatPath));return d.useMemo(()=>sj(e,JSON.parse(s),o,n==="path"),[e,s,o,n])}function YCt(e,t,n,r){Ax()||ni(!1);let{navigator:i}=d.useContext(Q0),{matches:o}=d.useContext(Hm),s=o[o.length-1],a=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let c=jm(),u;u=c;let f=u.pathname||"/",h=f;if(l!=="/"){let m=l.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(m.length).join("/")}let g=d8(e,{pathname:h});return eyt(g&&g.map(m=>Object.assign({},m,{params:Object.assign({},a,m.params),pathname:h0([l,i.encodeLocation?i.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?l:h0([l,i.encodeLocation?i.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),o,n,r)}function XCt(){let e=Zze(),t=aj(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return d.createElement(d.Fragment,null,d.createElement("h2",null,"Unexpected Application Error!"),d.createElement("h3",{style:{fontStyle:"italic"}},t),n?d.createElement("pre",{style:i},n):null,null)}const QCt=d.createElement(XCt,null);class ZCt extends d.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?d.createElement(Hm.Provider,{value:this.props.routeContext},d.createElement(Uze.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function JCt(e){let{routeContext:t,match:n,children:r}=e,i=d.useContext(FI);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),d.createElement(Hm.Provider,{value:t},r)}function eyt(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,a=(i=n)==null?void 0:i.errors;if(a!=null){let u=s.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);u>=0||ni(!1),s=s.slice(0,Math.min(s.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u=0?s=s.slice(0,c+1):s=[s[0]];break}}}return s.reduceRight((u,f,h)=>{let g,p=!1,m=null,v=null;n&&(g=a&&f.route.id?a[f.route.id]:void 0,m=f.route.errorElement||QCt,l&&(c<0&&h===0?(p=!0,v=null):c===h&&(p=!0,v=f.route.hydrateFallbackElement||null)));let C=t.concat(s.slice(0,h+1)),y=()=>{let b;return g?b=m:p?b=v:f.route.Component?b=d.createElement(f.route.Component,null):f.route.element?b=f.route.element:b=u,d.createElement(JCt,{match:f,routeContext:{outlet:u,matches:C,isDataRoute:n!=null},children:b})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?d.createElement(ZCt,{location:n.location,revalidation:n.revalidation,component:m,error:g,children:y(),routeContext:{outlet:null,matches:C,isDataRoute:!0}}):y()},null)}var Kze=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Kze||{}),WO=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(WO||{});function tyt(e){let t=d.useContext(FI);return t||ni(!1),t}function Yze(e){let t=d.useContext(Ahe);return t||ni(!1),t}function nyt(e){let t=d.useContext(Hm);return t||ni(!1),t}function Xze(e){let t=nyt(),n=t.matches[t.matches.length-1];return n.route.id||ni(!1),n.route.id}function Qze(){let{matches:e,loaderData:t}=Yze(WO.UseMatches);return d.useMemo(()=>e.map(n=>Fze(n,t)),[e,t])}function Zze(){var e;let t=d.useContext(Uze),n=Yze(WO.UseRouteError),r=Xze(WO.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function ryt(){let{router:e}=tyt(Kze.UseNavigateStable),t=Xze(WO.UseNavigateStable),n=d.useRef(!1);return qze(()=>{n.current=!0}),d.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Gk({fromRouteId:t},o)))},[e,t])}const pbe={};function iyt(e,t){pbe[t]||(pbe[t]=!0,console.warn(t))}const e5=(e,t,n)=>iyt(e,"⚠️ React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function oyt(e,t){(e==null?void 0:e.v7_startTransition)===void 0&&e5("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||!t.v7_relativeSplatPath)&&e5("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"),t&&(t.v7_fetcherPersist===void 0&&e5("v7_fetcherPersist","The persistence behavior of fetchers is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"),t.v7_normalizeFormMethod===void 0&&e5("v7_normalizeFormMethod","Casing of `formMethod` fields is being normalized to uppercase in v7","https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"),t.v7_partialHydration===void 0&&e5("v7_partialHydration","`RouterProvider` hydration behavior is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_partialhydration"),t.v7_skipActionErrorRevalidation===void 0&&e5("v7_skipActionErrorRevalidation","The revalidation behavior after 4xx/5xx `action` responses is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation"))}function syt(e){let{to:t,replace:n,state:r,relative:i}=e;Ax()||ni(!1);let{future:o,static:s}=d.useContext(Q0),{matches:a}=d.useContext(Hm),{pathname:l}=jm(),c=Gs(),u=sj(t,oj(a,o.v7_relativeSplatPath),l,i==="path"),f=JSON.stringify(u);return d.useEffect(()=>c(JSON.parse(f),{replace:n,state:r,relative:i}),[c,f,i,n,r]),null}function Lhe(e){return KCt(e.context)}function ayt(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Ps.Pop,navigator:o,static:s=!1,future:a}=e;Ax()&&ni(!1);let l=t.replace(/^\/*/,"/"),c=d.useMemo(()=>({basename:l,navigator:o,static:s,future:Gk({v7_relativeSplatPath:!1},a)}),[l,a,o,s]);typeof r=="string"&&(r=p3(r));let{pathname:u="/",search:f="",hash:h="",state:g=null,key:p="default"}=r,m=d.useMemo(()=>{let v=M0(u,l);return v==null?null:{location:{pathname:v,search:f,hash:h,state:g,key:p},navigationType:i}},[l,u,f,h,g,p,i]);return m==null?null:d.createElement(Q0.Provider,{value:c},d.createElement(Dhe.Provider,{children:n,value:m}))}new Promise(()=>{});function lyt(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:d.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:d.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:d.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** + * React Router DOM v6.28.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Vw(){return Vw=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function cyt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function uyt(e,t){return e.button===0&&(!t||t==="_self")&&!cyt(e)}const dyt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],fyt=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],hyt="6";try{window.__reactRouterVersion=hyt}catch{}function gyt(e,t){return RCt({basename:void 0,future:Vw({},void 0,{v7_prependBasename:!0}),history:X8t({window:void 0}),hydrationData:pyt(),routes:e,mapRouteProperties:lyt,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function pyt(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Vw({},t,{errors:myt(t.errors)})),t}function myt(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new Vk(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let o=window[i.__subType];if(typeof o=="function")try{let s=new o(i.message);s.stack="",n[r]=s}catch{}}if(n[r]==null){let o=new Error(i.message);o.stack="",n[r]=o}}else n[r]=i;return n}const eBe=d.createContext({isTransitioning:!1}),vyt=d.createContext(new Map),Cyt="startTransition",mbe=Mx[Cyt],yyt="flushSync",vbe=Lze[yyt];function byt(e){mbe?mbe(e):e()}function VE(e){vbe?vbe(e):e()}class Syt{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function wyt(e){let{fallbackElement:t,router:n,future:r}=e,[i,o]=d.useState(n.state),[s,a]=d.useState(),[l,c]=d.useState({isTransitioning:!1}),[u,f]=d.useState(),[h,g]=d.useState(),[p,m]=d.useState(),v=d.useRef(new Map),{v7_startTransition:C}=r||{},y=d.useCallback(R=>{C?byt(R):R()},[C]),b=d.useCallback((R,O)=>{let{deletedFetchers:T,flushSync:M,viewTransitionOpts:_}=O;T.forEach(D=>v.current.delete(D)),R.fetchers.forEach((D,k)=>{D.data!==void 0&&v.current.set(k,D.data)});let F=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!_||F){M?VE(()=>o(R)):y(()=>o(R));return}if(M){VE(()=>{h&&(u&&u.resolve(),h.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let D=n.window.document.startViewTransition(()=>{VE(()=>o(R))});D.finished.finally(()=>{VE(()=>{f(void 0),g(void 0),a(void 0),c({isTransitioning:!1})})}),VE(()=>g(D));return}h?(u&&u.resolve(),h.skipTransition(),m({state:R,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(a(R),c({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[n.window,h,u,v,y]);d.useLayoutEffect(()=>n.subscribe(b),[n,b]),d.useEffect(()=>{l.isTransitioning&&!l.flushSync&&f(new Syt)},[l]),d.useEffect(()=>{if(u&&s&&n.window){let R=s,O=u.promise,T=n.window.document.startViewTransition(async()=>{y(()=>o(R)),await O});T.finished.finally(()=>{f(void 0),g(void 0),a(void 0),c({isTransitioning:!1})}),g(T)}},[y,s,u,n.window]),d.useEffect(()=>{u&&s&&i.location.key===s.location.key&&u.resolve()},[u,h,i.location,s]),d.useEffect(()=>{!l.isTransitioning&&p&&(a(p.state),c({isTransitioning:!0,flushSync:!1,currentLocation:p.currentLocation,nextLocation:p.nextLocation}),m(void 0))},[l.isTransitioning,p]),d.useEffect(()=>{},[]);let S=d.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:R=>n.navigate(R),push:(R,O,T)=>n.navigate(R,{state:O,preventScrollReset:T==null?void 0:T.preventScrollReset}),replace:(R,O,T)=>n.navigate(R,{replace:!0,state:O,preventScrollReset:T==null?void 0:T.preventScrollReset})}),[n]),w=n.basename||"/",x=d.useMemo(()=>({router:n,navigator:S,static:!1,basename:w}),[n,S,w]),E=d.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return d.useEffect(()=>oyt(r,n.future),[r,n.future]),d.createElement(d.Fragment,null,d.createElement(FI.Provider,{value:x},d.createElement(Ahe.Provider,{value:i},d.createElement(vyt.Provider,{value:v.current},d.createElement(eBe.Provider,{value:l},d.createElement(ayt,{basename:w,location:i.location,navigationType:i.historyAction,navigator:S,future:E},i.initialized||n.future.v7_partialHydration?d.createElement(xyt,{routes:n.routes,future:n.future,state:i}):t))))),null)}const xyt=d.memo(Eyt);function Eyt(e){let{routes:t,future:n,state:r}=e;return YCt(t,void 0,r,n)}const Ryt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$yt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,h8=d.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:s,state:a,target:l,to:c,preventScrollReset:u,viewTransition:f}=t,h=Jze(t,dyt),{basename:g}=d.useContext(Q0),p,m=!1;if(typeof c=="string"&&$yt.test(c)&&(p=c,Ryt))try{let b=new URL(window.location.href),S=c.startsWith("//")?new URL(b.protocol+c):new URL(c),w=M0(S.pathname,g);S.origin===b.origin&&w!=null?c=w+S.search+S.hash:m=!0}catch{}let v=WCt(c,{relative:i}),C=Iyt(c,{replace:s,state:a,target:l,preventScrollReset:u,relative:i,viewTransition:f});function y(b){r&&r(b),b.defaultPrevented||C(b)}return d.createElement("a",Vw({},h,{href:p||v,onClick:m||o?r:y,ref:n,target:l}))}),Oyt=d.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:o="",end:s=!1,style:a,to:l,viewTransition:c,children:u}=t,f=Jze(t,fyt),h=lj(l,{relative:f.relative}),g=jm(),p=d.useContext(Ahe),{navigator:m,basename:v}=d.useContext(Q0),C=p!=null&&Myt(h)&&c===!0,y=m.encodeLocation?m.encodeLocation(h).pathname:h.pathname,b=g.pathname,S=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;i||(b=b.toLowerCase(),S=S?S.toLowerCase():null,y=y.toLowerCase()),S&&v&&(S=M0(S,v)||S);const w=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let x=b===y||!s&&b.startsWith(y)&&b.charAt(w)==="/",E=S!=null&&(S===y||!s&&S.startsWith(y)&&S.charAt(y.length)==="/"),R={isActive:x,isPending:E,isTransitioning:C},O=x?r:void 0,T;typeof o=="function"?T=o(R):T=[o,x?"active":null,E?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let M=typeof a=="function"?a(R):a;return d.createElement(h8,Vw({},f,{"aria-current":O,className:T,ref:n,style:M,to:l,viewTransition:c}),typeof u=="function"?u(R):u)});var $se;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})($se||($se={}));var Cbe;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Cbe||(Cbe={}));function Tyt(e){let t=d.useContext(FI);return t||ni(!1),t}function Iyt(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:s,viewTransition:a}=t===void 0?{}:t,l=Gs(),c=jm(),u=lj(e,{relative:s});return d.useCallback(f=>{if(uyt(f,n)){f.preventDefault();let h=r!==void 0?r:xC(c)===xC(u);l(e,{replace:h,state:i,preventScrollReset:o,relative:s,viewTransition:a})}},[c,l,u,r,i,n,e,o,s,a])}function Myt(e,t){t===void 0&&(t={});let n=d.useContext(eBe);n==null&&ni(!1);let{basename:r}=Tyt($se.useViewTransitionState),i=lj(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=M0(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=M0(n.nextLocation.pathname,r)||n.nextLocation.pathname;return jk(i.pathname,s)!=null||jk(i.pathname,o)!=null}var $y=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},EC=typeof window>"u"||"Deno"in globalThis;function pf(){}function Pyt(e,t){return typeof e=="function"?e(t):e}function Ose(e){return typeof e=="number"&&e>=0&&e!==1/0}function tBe(e,t){return Math.max(e+(t||0)-Date.now(),0)}function GS(e,t){return typeof e=="function"?e(t):e}function Jh(e,t){return typeof e=="function"?e(t):e}function ybe(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Fhe(s,t.options))return!1}else if(!UO(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||o&&!o(t))}function bbe(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(N4(t.options.mutationKey)!==N4(o))return!1}else if(!UO(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Fhe(e,t){return((t==null?void 0:t.queryKeyHashFn)||N4)(e)}function N4(e){return JSON.stringify(e,(t,n)=>Tse(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function UO(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!UO(e[n],t[n])):!1}function Nhe(e,t){if(e===t)return e;const n=Sbe(e)&&Sbe(t);if(n||Tse(e)&&Tse(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),s=o.length,a=n?[]:{};let l=0;for(let c=0;c{setTimeout(t,e)})}function Ise(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Nhe(e,t):t}function Ayt(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Dyt(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Q8=Symbol();function nBe(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Q8?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var H8,B2,Cw,nNe,Lyt=(nNe=class extends $y{constructor(){super();Un(this,H8);Un(this,B2);Un(this,Cw);yn(this,Cw,t=>{if(!EC&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Ke(this,B2)||this.setEventListener(Ke(this,Cw))}onUnsubscribe(){var t;this.hasListeners()||((t=Ke(this,B2))==null||t.call(this),yn(this,B2,void 0))}setEventListener(t){var n;yn(this,Cw,t),(n=Ke(this,B2))==null||n.call(this),yn(this,B2,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){Ke(this,H8)!==t&&(yn(this,H8,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof Ke(this,H8)=="boolean"?Ke(this,H8):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},H8=new WeakMap,B2=new WeakMap,Cw=new WeakMap,nNe),khe=new Lyt,yw,H2,bw,rNe,Fyt=(rNe=class extends $y{constructor(){super();Un(this,yw,!0);Un(this,H2);Un(this,bw);yn(this,bw,t=>{if(!EC&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){Ke(this,H2)||this.setEventListener(Ke(this,bw))}onUnsubscribe(){var t;this.hasListeners()||((t=Ke(this,H2))==null||t.call(this),yn(this,H2,void 0))}setEventListener(t){var n;yn(this,bw,t),(n=Ke(this,H2))==null||n.call(this),yn(this,H2,t(this.setOnline.bind(this)))}setOnline(t){Ke(this,yw)!==t&&(yn(this,yw,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return Ke(this,yw)}},yw=new WeakMap,H2=new WeakMap,bw=new WeakMap,rNe),Uk=new Fyt;function Mse(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function Nyt(e){return Math.min(1e3*2**e,3e4)}function rBe(e){return(e??"online")==="online"?Uk.isOnline():!0}var iBe=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function QJ(e){return e instanceof iBe}function oBe(e){let t=!1,n=0,r=!1,i;const o=Mse(),s=m=>{var v;r||(h(new iBe(m)),(v=e.abort)==null||v.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>khe.isFocused()&&(e.networkMode==="always"||Uk.isOnline())&&e.canRun(),u=()=>rBe(e.networkMode)&&e.canRun(),f=m=>{var v;r||(r=!0,(v=e.onSuccess)==null||v.call(e,m),i==null||i(),o.resolve(m))},h=m=>{var v;r||(r=!0,(v=e.onError)==null||v.call(e,m),i==null||i(),o.reject(m))},g=()=>new Promise(m=>{var v;i=C=>{(r||c())&&m(C)},(v=e.onPause)==null||v.call(e)}).then(()=>{var m;i=void 0,r||(m=e.onContinue)==null||m.call(e)}),p=()=>{if(r)return;let m;const v=n===0?e.initialPromise:void 0;try{m=v??e.fn()}catch(C){m=Promise.reject(C)}Promise.resolve(m).then(f).catch(C=>{var x;if(r)return;const y=e.retry??(EC?0:3),b=e.retryDelay??Nyt,S=typeof b=="function"?b(n,C):b,w=y===!0||typeof y=="number"&&nc()?void 0:g()).then(()=>{t?h(C):p()})})};return{promise:o,cancel:s,continue:()=>(i==null||i(),o),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?p():g().then(p),o)}}function kyt(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=a=>setTimeout(a,0);const o=a=>{t?e.push(a):i(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{o(()=>{a(...l)})},schedule:o,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var us=kyt(),j8,iNe,sBe=(iNe=class{constructor(){Un(this,j8)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ose(this.gcTime)&&yn(this,j8,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(EC?1/0:5*60*1e3))}clearGcTimeout(){Ke(this,j8)&&(clearTimeout(Ke(this,j8)),yn(this,j8,void 0))}},j8=new WeakMap,iNe),Sw,ww,ff,Rl,RI,V8,Gh,z1,oNe,zyt=(oNe=class extends sBe{constructor(t){super();Un(this,Gh);Un(this,Sw);Un(this,ww);Un(this,ff);Un(this,Rl);Un(this,RI);Un(this,V8);yn(this,V8,!1),yn(this,RI,t.defaultOptions),this.setOptions(t.options),this.observers=[],yn(this,ff,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,yn(this,Sw,Byt(this.options)),this.state=t.state??Ke(this,Sw),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=Ke(this,Rl))==null?void 0:t.promise}setOptions(t){this.options={...Ke(this,RI),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Ke(this,ff).remove(this)}setData(t,n){const r=Ise(this.state.data,t,this.options);return gr(this,Gh,z1).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){gr(this,Gh,z1).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=Ke(this,Rl))==null?void 0:r.promise;return(i=Ke(this,Rl))==null||i.cancel(t),n?n.then(pf).catch(pf):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Ke(this,Sw))}isActive(){return this.observers.some(t=>Jh(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Q8||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!tBe(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=Ke(this,Rl))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=Ke(this,Rl))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),Ke(this,ff).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(Ke(this,Rl)&&(Ke(this,V8)?Ke(this,Rl).cancel({revert:!0}):Ke(this,Rl).cancelRetry()),this.scheduleGc()),Ke(this,ff).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||gr(this,Gh,z1).call(this,{type:"invalidate"})}fetch(t,n){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Ke(this,Rl))return Ke(this,Rl).continueRetry(),Ke(this,Rl).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(h=>h.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(yn(this,V8,!0),r.signal)})},o=()=>{const f=nBe(this.options,n),h={queryKey:this.queryKey,meta:this.meta};return i(h),yn(this,V8,!1),this.options.persister?this.options.persister(f,h,this):f(h)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};i(s),(l=this.options.behavior)==null||l.onFetch(s,this),yn(this,ww,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=s.fetchOptions)==null?void 0:c.meta))&&gr(this,Gh,z1).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta});const a=f=>{var h,g,p,m;QJ(f)&&f.silent||gr(this,Gh,z1).call(this,{type:"error",error:f}),QJ(f)||((g=(h=Ke(this,ff).config).onError)==null||g.call(h,f,this),(m=(p=Ke(this,ff).config).onSettled)==null||m.call(p,this.state.data,f,this)),this.scheduleGc()};return yn(this,Rl,oBe({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var h,g,p,m;if(f===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(v){a(v);return}(g=(h=Ke(this,ff).config).onSuccess)==null||g.call(h,f,this),(m=(p=Ke(this,ff).config).onSettled)==null||m.call(p,f,this.state.error,this),this.scheduleGc()},onError:a,onFail:(f,h)=>{gr(this,Gh,z1).call(this,{type:"failed",failureCount:f,error:h})},onPause:()=>{gr(this,Gh,z1).call(this,{type:"pause"})},onContinue:()=>{gr(this,Gh,z1).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),Ke(this,Rl).start()}},Sw=new WeakMap,ww=new WeakMap,ff=new WeakMap,Rl=new WeakMap,RI=new WeakMap,V8=new WeakMap,Gh=new WeakSet,z1=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...aBe(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return QJ(i)&&i.revert&&Ke(this,ww)?{...Ke(this,ww),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),us.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),Ke(this,ff).notify({query:this,type:"updated",action:t})})},oNe);function aBe(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:rBe(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Byt(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var kp,sNe,Hyt=(sNe=class extends $y{constructor(t={}){super();Un(this,kp);this.config=t,yn(this,kp,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??Fhe(i,n);let s=this.get(o);return s||(s=new zyt({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){Ke(this,kp).has(t.queryHash)||(Ke(this,kp).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=Ke(this,kp).get(t.queryHash);n&&(t.destroy(),n===t&&Ke(this,kp).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){us.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Ke(this,kp).get(t)}getAll(){return[...Ke(this,kp).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>ybe(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>ybe(t,r)):n}notify(t){us.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){us.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){us.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},kp=new WeakMap,sNe),zp,lc,G8,Bp,d2,aNe,jyt=(aNe=class extends sBe{constructor(t){super();Un(this,Bp);Un(this,zp);Un(this,lc);Un(this,G8);this.mutationId=t.mutationId,yn(this,lc,t.mutationCache),yn(this,zp,[]),this.state=t.state||lBe(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Ke(this,zp).includes(t)||(Ke(this,zp).push(t),this.clearGcTimeout(),Ke(this,lc).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){yn(this,zp,Ke(this,zp).filter(n=>n!==t)),this.scheduleGc(),Ke(this,lc).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Ke(this,zp).length||(this.state.status==="pending"?this.scheduleGc():Ke(this,lc).remove(this))}continue(){var t;return((t=Ke(this,G8))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,s,a,l,c,u,f,h,g,p,m,v,C,y,b,S,w,x,E;yn(this,G8,oBe({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(R,O)=>{gr(this,Bp,d2).call(this,{type:"failed",failureCount:R,error:O})},onPause:()=>{gr(this,Bp,d2).call(this,{type:"pause"})},onContinue:()=>{gr(this,Bp,d2).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Ke(this,lc).canRun(this)}));const n=this.state.status==="pending",r=!Ke(this,G8).canStart();try{if(!n){gr(this,Bp,d2).call(this,{type:"pending",variables:t,isPaused:r}),await((o=(i=Ke(this,lc).config).onMutate)==null?void 0:o.call(i,t,this));const O=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));O!==this.state.context&&gr(this,Bp,d2).call(this,{type:"pending",context:O,variables:t,isPaused:r})}const R=await Ke(this,G8).start();return await((c=(l=Ke(this,lc).config).onSuccess)==null?void 0:c.call(l,R,t,this.state.context,this)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,R,t,this.state.context)),await((g=(h=Ke(this,lc).config).onSettled)==null?void 0:g.call(h,R,null,this.state.variables,this.state.context,this)),await((m=(p=this.options).onSettled)==null?void 0:m.call(p,R,null,t,this.state.context)),gr(this,Bp,d2).call(this,{type:"success",data:R}),R}catch(R){try{throw await((C=(v=Ke(this,lc).config).onError)==null?void 0:C.call(v,R,t,this.state.context,this)),await((b=(y=this.options).onError)==null?void 0:b.call(y,R,t,this.state.context)),await((w=(S=Ke(this,lc).config).onSettled)==null?void 0:w.call(S,void 0,R,this.state.variables,this.state.context,this)),await((E=(x=this.options).onSettled)==null?void 0:E.call(x,void 0,R,t,this.state.context)),R}finally{gr(this,Bp,d2).call(this,{type:"error",error:R})}}finally{Ke(this,lc).runNext(this)}}},zp=new WeakMap,lc=new WeakMap,G8=new WeakMap,Bp=new WeakSet,d2=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),us.batch(()=>{Ke(this,zp).forEach(r=>{r.onMutationUpdate(t)}),Ke(this,lc).notify({mutation:this,type:"updated",action:t})})},aNe);function lBe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var o0,Wh,$I,lNe,Vyt=(lNe=class extends $y{constructor(t={}){super();Un(this,o0);Un(this,Wh);Un(this,$I);this.config=t,yn(this,o0,new Set),yn(this,Wh,new Map),yn(this,$I,0)}build(t,n,r){const i=new jyt({mutationCache:this,mutationId:++BA(this,$I)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){Ke(this,o0).add(t);const n=oD(t);if(typeof n=="string"){const r=Ke(this,Wh).get(n);r?r.push(t):Ke(this,Wh).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(Ke(this,o0).delete(t)){const n=oD(t);if(typeof n=="string"){const r=Ke(this,Wh).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&Ke(this,Wh).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=oD(t);if(typeof n=="string"){const r=Ke(this,Wh).get(n),i=r==null?void 0:r.find(o=>o.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=oD(t);if(typeof n=="string"){const i=(r=Ke(this,Wh).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){us.batch(()=>{Ke(this,o0).forEach(t=>{this.notify({type:"removed",mutation:t})}),Ke(this,o0).clear(),Ke(this,Wh).clear()})}getAll(){return Array.from(Ke(this,o0))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>bbe(n,r))}findAll(t={}){return this.getAll().filter(n=>bbe(t,n))}notify(t){us.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return us.batch(()=>Promise.all(t.map(n=>n.continue().catch(pf))))}},o0=new WeakMap,Wh=new WeakMap,$I=new WeakMap,lNe);function oD(e){var t;return(t=e.options.scope)==null?void 0:t.id}function qk(e){return{onFetch:(t,n)=>{var u,f,h,g,p;const r=t.options,i=(h=(f=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,o=((g=t.state.data)==null?void 0:g.pages)||[],s=((p=t.state.data)==null?void 0:p.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let m=!1;const v=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},C=nBe(t.options,t.fetchOptions),y=async(b,S,w)=>{if(m)return Promise.reject();if(S==null&&b.pages.length)return Promise.resolve(b);const x={queryKey:t.queryKey,pageParam:S,direction:w?"backward":"forward",meta:t.options.meta};v(x);const E=await C(x),{maxPages:R}=t.options,O=w?Dyt:Ayt;return{pages:O(b.pages,E,R),pageParams:O(b.pageParams,S,R)}};if(i&&o.length){const b=i==="backward",S=b?cBe:Pse,w={pages:o,pageParams:s},x=S(r,w);a=await y(w,x,b)}else{const b=e??o.length;do{const S=l===0?s[0]??r.initialPageParam:Pse(r,a);if(l>0&&S==null)break;a=await y(a,S),l++}while(l{var m,v;return(v=(m=t.options).persister)==null?void 0:v.call(m,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Pse(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function cBe(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function Gyt(e,t){return t?Pse(e,t)!=null:!1}function Wyt(e,t){return!t||!e.getPreviousPageParam?!1:cBe(e,t)!=null}var os,j2,V2,xw,Ew,G2,Rw,$w,cNe,Uyt=(cNe=class{constructor(e={}){Un(this,os);Un(this,j2);Un(this,V2);Un(this,xw);Un(this,Ew);Un(this,G2);Un(this,Rw);Un(this,$w);yn(this,os,e.queryCache||new Hyt),yn(this,j2,e.mutationCache||new Vyt),yn(this,V2,e.defaultOptions||{}),yn(this,xw,new Map),yn(this,Ew,new Map),yn(this,G2,0)}mount(){BA(this,G2)._++,Ke(this,G2)===1&&(yn(this,Rw,khe.subscribe(async e=>{e&&(await this.resumePausedMutations(),Ke(this,os).onFocus())})),yn(this,$w,Uk.subscribe(async e=>{e&&(await this.resumePausedMutations(),Ke(this,os).onOnline())})))}unmount(){var e,t;BA(this,G2)._--,Ke(this,G2)===0&&((e=Ke(this,Rw))==null||e.call(this),yn(this,Rw,void 0),(t=Ke(this,$w))==null||t.call(this),yn(this,$w,void 0))}isFetching(e){return Ke(this,os).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Ke(this,j2).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Ke(this,os).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=Ke(this,os).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(GS(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return Ke(this,os).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=Ke(this,os).get(r.queryHash),o=i==null?void 0:i.state.data,s=Pyt(t,o);if(s!==void 0)return Ke(this,os).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return us.batch(()=>Ke(this,os).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Ke(this,os).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=Ke(this,os);us.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Ke(this,os),r={type:"active",...e};return us.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=us.batch(()=>Ke(this,os).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(pf).catch(pf)}invalidateQueries(e,t={}){return us.batch(()=>{if(Ke(this,os).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none")return Promise.resolve();const n={...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=us.batch(()=>Ke(this,os).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(pf)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(pf)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=Ke(this,os).build(this,t);return n.isStaleByTime(GS(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(pf).catch(pf)}fetchInfiniteQuery(e){return e.behavior=qk(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(pf).catch(pf)}ensureInfiniteQueryData(e){return e.behavior=qk(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Uk.isOnline()?Ke(this,j2).resumePausedMutations():Promise.resolve()}getQueryCache(){return Ke(this,os)}getMutationCache(){return Ke(this,j2)}getDefaultOptions(){return Ke(this,V2)}setDefaultOptions(e){yn(this,V2,e)}setQueryDefaults(e,t){Ke(this,xw).set(N4(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Ke(this,xw).values()],n={};return t.forEach(r=>{UO(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){Ke(this,Ew).set(N4(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Ke(this,Ew).values()];let n={};return t.forEach(r=>{UO(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...Ke(this,V2).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Fhe(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Q8&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Ke(this,V2).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Ke(this,os).clear(),Ke(this,j2).clear()}},os=new WeakMap,j2=new WeakMap,V2=new WeakMap,xw=new WeakMap,Ew=new WeakMap,G2=new WeakMap,Rw=new WeakMap,$w=new WeakMap,cNe),Kc,wi,OI,cc,W8,Ow,W2,Hp,TI,Tw,Iw,U8,q8,U2,Mw,Yi,ZR,_se,Ase,Dse,Lse,Fse,Nse,kse,uBe,uNe,NI=(uNe=class extends $y{constructor(t,n){super();Un(this,Yi);Un(this,Kc);Un(this,wi);Un(this,OI);Un(this,cc);Un(this,W8);Un(this,Ow);Un(this,W2);Un(this,Hp);Un(this,TI);Un(this,Tw);Un(this,Iw);Un(this,U8);Un(this,q8);Un(this,U2);Un(this,Mw,new Set);this.options=n,yn(this,Kc,t),yn(this,Hp,null),yn(this,W2,Mse()),this.options.experimental_prefetchInRender||Ke(this,W2).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Ke(this,wi).addObserver(this),xbe(Ke(this,wi),this.options)?gr(this,Yi,ZR).call(this):this.updateResult(),gr(this,Yi,Lse).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return zse(Ke(this,wi),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return zse(Ke(this,wi),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,gr(this,Yi,Fse).call(this),gr(this,Yi,Nse).call(this),Ke(this,wi).removeObserver(this)}setOptions(t,n){const r=this.options,i=Ke(this,wi);if(this.options=Ke(this,Kc).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Jh(this.options.enabled,Ke(this,wi))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");gr(this,Yi,kse).call(this),Ke(this,wi).setOptions(this.options),r._defaulted&&!Wk(this.options,r)&&Ke(this,Kc).getQueryCache().notify({type:"observerOptionsUpdated",query:Ke(this,wi),observer:this});const o=this.hasListeners();o&&Ebe(Ke(this,wi),i,this.options,r)&&gr(this,Yi,ZR).call(this),this.updateResult(n),o&&(Ke(this,wi)!==i||Jh(this.options.enabled,Ke(this,wi))!==Jh(r.enabled,Ke(this,wi))||GS(this.options.staleTime,Ke(this,wi))!==GS(r.staleTime,Ke(this,wi)))&&gr(this,Yi,_se).call(this);const s=gr(this,Yi,Ase).call(this);o&&(Ke(this,wi)!==i||Jh(this.options.enabled,Ke(this,wi))!==Jh(r.enabled,Ke(this,wi))||s!==Ke(this,U2))&&gr(this,Yi,Dse).call(this,s)}getOptimisticResult(t){const n=Ke(this,Kc).getQueryCache().build(Ke(this,Kc),t),r=this.createResult(n,t);return Kyt(this,r)&&(yn(this,cc,r),yn(this,Ow,this.options),yn(this,W8,Ke(this,wi).state)),r}getCurrentResult(){return Ke(this,cc)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){Ke(this,Mw).add(t)}getCurrentQuery(){return Ke(this,wi)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Ke(this,Kc).defaultQueryOptions(t),r=Ke(this,Kc).getQueryCache().build(Ke(this,Kc),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return gr(this,Yi,ZR).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Ke(this,cc)))}createResult(t,n){var R;const r=Ke(this,wi),i=this.options,o=Ke(this,cc),s=Ke(this,W8),a=Ke(this,Ow),c=t!==r?t.state:Ke(this,OI),{state:u}=t;let f={...u},h=!1,g;if(n._optimisticResults){const O=this.hasListeners(),T=!O&&xbe(t,n),M=O&&Ebe(t,r,n,i);(T||M)&&(f={...f,...aBe(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:p,errorUpdatedAt:m,status:v}=f;if(n.select&&f.data!==void 0)if(o&&f.data===(s==null?void 0:s.data)&&n.select===Ke(this,TI))g=Ke(this,Tw);else try{yn(this,TI,n.select),g=n.select(f.data),g=Ise(o==null?void 0:o.data,g,n),yn(this,Tw,g),yn(this,Hp,null)}catch(O){yn(this,Hp,O)}else g=f.data;if(n.placeholderData!==void 0&&g===void 0&&v==="pending"){let O;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))O=o.data;else if(O=typeof n.placeholderData=="function"?n.placeholderData((R=Ke(this,Iw))==null?void 0:R.state.data,Ke(this,Iw)):n.placeholderData,n.select&&O!==void 0)try{O=n.select(O),yn(this,Hp,null)}catch(T){yn(this,Hp,T)}O!==void 0&&(v="success",g=Ise(o==null?void 0:o.data,O,n),h=!0)}Ke(this,Hp)&&(p=Ke(this,Hp),g=Ke(this,Tw),m=Date.now(),v="error");const C=f.fetchStatus==="fetching",y=v==="pending",b=v==="error",S=y&&C,w=g!==void 0,E={status:v,fetchStatus:f.fetchStatus,isPending:y,isSuccess:v==="success",isError:b,isInitialLoading:S,isLoading:S,data:g,dataUpdatedAt:f.dataUpdatedAt,error:p,errorUpdatedAt:m,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:C,isRefetching:C&&!y,isLoadingError:b&&!w,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:b&&w,isStale:zhe(t,n),refetch:this.refetch,promise:Ke(this,W2)};if(this.options.experimental_prefetchInRender){const O=_=>{E.status==="error"?_.reject(E.error):E.data!==void 0&&_.resolve(E.data)},T=()=>{const _=yn(this,W2,E.promise=Mse());O(_)},M=Ke(this,W2);switch(M.status){case"pending":t.queryHash===r.queryHash&&O(M);break;case"fulfilled":(E.status==="error"||E.data!==M.value)&&T();break;case"rejected":(E.status!=="error"||E.error!==M.reason)&&T();break}}return E}updateResult(t){const n=Ke(this,cc),r=this.createResult(Ke(this,wi),this.options);if(yn(this,W8,Ke(this,wi).state),yn(this,Ow,this.options),Ke(this,W8).data!==void 0&&yn(this,Iw,Ke(this,wi)),Wk(r,n))return;yn(this,cc,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!Ke(this,Mw).size)return!0;const l=new Set(a??Ke(this,Mw));return this.options.throwOnError&&l.add("error"),Object.keys(Ke(this,cc)).some(c=>{const u=c;return Ke(this,cc)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),gr(this,Yi,uBe).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&gr(this,Yi,Lse).call(this)}},Kc=new WeakMap,wi=new WeakMap,OI=new WeakMap,cc=new WeakMap,W8=new WeakMap,Ow=new WeakMap,W2=new WeakMap,Hp=new WeakMap,TI=new WeakMap,Tw=new WeakMap,Iw=new WeakMap,U8=new WeakMap,q8=new WeakMap,U2=new WeakMap,Mw=new WeakMap,Yi=new WeakSet,ZR=function(t){gr(this,Yi,kse).call(this);let n=Ke(this,wi).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(pf)),n},_se=function(){gr(this,Yi,Fse).call(this);const t=GS(this.options.staleTime,Ke(this,wi));if(EC||Ke(this,cc).isStale||!Ose(t))return;const r=tBe(Ke(this,cc).dataUpdatedAt,t)+1;yn(this,U8,setTimeout(()=>{Ke(this,cc).isStale||this.updateResult()},r))},Ase=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Ke(this,wi)):this.options.refetchInterval)??!1},Dse=function(t){gr(this,Yi,Nse).call(this),yn(this,U2,t),!(EC||Jh(this.options.enabled,Ke(this,wi))===!1||!Ose(Ke(this,U2))||Ke(this,U2)===0)&&yn(this,q8,setInterval(()=>{(this.options.refetchIntervalInBackground||khe.isFocused())&&gr(this,Yi,ZR).call(this)},Ke(this,U2)))},Lse=function(){gr(this,Yi,_se).call(this),gr(this,Yi,Dse).call(this,gr(this,Yi,Ase).call(this))},Fse=function(){Ke(this,U8)&&(clearTimeout(Ke(this,U8)),yn(this,U8,void 0))},Nse=function(){Ke(this,q8)&&(clearInterval(Ke(this,q8)),yn(this,q8,void 0))},kse=function(){const t=Ke(this,Kc).getQueryCache().build(Ke(this,Kc),this.options);if(t===Ke(this,wi))return;const n=Ke(this,wi);yn(this,wi,t),yn(this,OI,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},uBe=function(t){us.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(Ke(this,cc))}),Ke(this,Kc).getQueryCache().notify({query:Ke(this,wi),type:"observerResultsUpdated"})})},uNe);function qyt(e,t){return Jh(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function xbe(e,t){return qyt(e,t)||e.state.data!==void 0&&zse(e,t,t.refetchOnMount)}function zse(e,t,n){if(Jh(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&zhe(e,t)}return!1}function Ebe(e,t,n,r){return(e!==t||Jh(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&zhe(e,n)}function zhe(e,t){return Jh(t.enabled,e)!==!1&&e.isStaleByTime(GS(t.staleTime,e))}function Kyt(e,t){return!Wk(e.getCurrentResult(),t)}function Rbe(e,t){return e.filter(n=>!t.includes(n))}function Yyt(e,t,n){const r=e.slice(0);return r[t]=n,r}var Pw,hf,K8,_w,gf,q2,II,MI,Fa,Bse,Hse,WF,jse,Vse,dNe,Xyt=(dNe=class extends $y{constructor(t,n,r){super();Un(this,Fa);Un(this,Pw);Un(this,hf);Un(this,K8);Un(this,_w);Un(this,gf);Un(this,q2);Un(this,II);Un(this,MI);yn(this,Pw,t),yn(this,_w,r),yn(this,K8,[]),yn(this,gf,[]),yn(this,hf,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&Ke(this,gf).forEach(t=>{t.subscribe(n=>{gr(this,Fa,jse).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,Ke(this,gf).forEach(t=>{t.destroy()})}setQueries(t,n,r){yn(this,K8,t),yn(this,_w,n),us.batch(()=>{const i=Ke(this,gf),o=gr(this,Fa,WF).call(this,Ke(this,K8));o.forEach(c=>c.observer.setOptions(c.defaultedQueryOptions,r));const s=o.map(c=>c.observer),a=s.map(c=>c.getCurrentResult()),l=s.some((c,u)=>c!==i[u]);i.length===s.length&&!l||(yn(this,gf,s),yn(this,hf,a),this.hasListeners()&&(Rbe(i,s).forEach(c=>{c.destroy()}),Rbe(s,i).forEach(c=>{c.subscribe(u=>{gr(this,Fa,jse).call(this,c,u)})}),gr(this,Fa,Vse).call(this)))})}getCurrentResult(){return Ke(this,hf)}getQueries(){return Ke(this,gf).map(t=>t.getCurrentQuery())}getObservers(){return Ke(this,gf)}getOptimisticResult(t,n){const i=gr(this,Fa,WF).call(this,t).map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions));return[i,o=>gr(this,Fa,Hse).call(this,o??i,n),()=>gr(this,Fa,Bse).call(this,i,t)]}},Pw=new WeakMap,hf=new WeakMap,K8=new WeakMap,_w=new WeakMap,gf=new WeakMap,q2=new WeakMap,II=new WeakMap,MI=new WeakMap,Fa=new WeakSet,Bse=function(t,n){const r=gr(this,Fa,WF).call(this,n);return r.map((i,o)=>{const s=t[o];return i.defaultedQueryOptions.notifyOnChangeProps?s:i.observer.trackResult(s,a=>{r.forEach(l=>{l.observer.trackProp(a)})})})},Hse=function(t,n){return n?((!Ke(this,q2)||Ke(this,hf)!==Ke(this,MI)||n!==Ke(this,II))&&(yn(this,II,n),yn(this,MI,Ke(this,hf)),yn(this,q2,Nhe(Ke(this,q2),n(t)))),Ke(this,q2)):t},WF=function(t){const n=new Map(Ke(this,gf).map(i=>[i.options.queryHash,i])),r=[];return t.forEach(i=>{const o=Ke(this,Pw).defaultQueryOptions(i),s=n.get(o.queryHash);s?r.push({defaultedQueryOptions:o,observer:s}):r.push({defaultedQueryOptions:o,observer:new NI(Ke(this,Pw),o)})}),r},jse=function(t,n){const r=Ke(this,gf).indexOf(t);r!==-1&&(yn(this,hf,Yyt(Ke(this,hf),r,n)),gr(this,Fa,Vse).call(this))},Vse=function(){var t;if(this.hasListeners()){const n=Ke(this,q2),r=gr(this,Fa,Hse).call(this,gr(this,Fa,Bse).call(this,Ke(this,hf),Ke(this,K8)),(t=Ke(this,_w))==null?void 0:t.combine);n!==r&&us.batch(()=>{this.listeners.forEach(i=>{i(Ke(this,hf))})})}},dNe),dBe=class extends NI{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e,t){super.setOptions({...e,behavior:qk()},t)}getOptimisticResult(e){return e.behavior=qk(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var p,m;const{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:o,isError:s,isRefetchError:a}=r,l=(m=(p=n.fetchMeta)==null?void 0:p.fetchMore)==null?void 0:m.direction,c=s&&l==="forward",u=i&&l==="forward",f=s&&l==="backward",h=i&&l==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Gyt(t,n.data),hasPreviousPage:Wyt(t,n.data),isFetchNextPageError:c,isFetchingNextPage:u,isFetchPreviousPageError:f,isFetchingPreviousPage:h,isRefetchError:a&&!c&&!f,isRefetching:o&&!u&&!h}}},K2,Y2,Yc,s0,R0,UF,Gse,fNe,Qyt=(fNe=class extends $y{constructor(n,r){super();Un(this,R0);Un(this,K2);Un(this,Y2);Un(this,Yc);Un(this,s0);yn(this,K2,n),this.setOptions(r),this.bindMethods(),gr(this,R0,UF).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=Ke(this,K2).defaultMutationOptions(n),Wk(this.options,r)||Ke(this,K2).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Ke(this,Yc),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&N4(r.mutationKey)!==N4(this.options.mutationKey)?this.reset():((i=Ke(this,Yc))==null?void 0:i.state.status)==="pending"&&Ke(this,Yc).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=Ke(this,Yc))==null||n.removeObserver(this)}onMutationUpdate(n){gr(this,R0,UF).call(this),gr(this,R0,Gse).call(this,n)}getCurrentResult(){return Ke(this,Y2)}reset(){var n;(n=Ke(this,Yc))==null||n.removeObserver(this),yn(this,Yc,void 0),gr(this,R0,UF).call(this),gr(this,R0,Gse).call(this)}mutate(n,r){var i;return yn(this,s0,r),(i=Ke(this,Yc))==null||i.removeObserver(this),yn(this,Yc,Ke(this,K2).getMutationCache().build(Ke(this,K2),this.options)),Ke(this,Yc).addObserver(this),Ke(this,Yc).execute(n)}},K2=new WeakMap,Y2=new WeakMap,Yc=new WeakMap,s0=new WeakMap,R0=new WeakSet,UF=function(){var r;const n=((r=Ke(this,Yc))==null?void 0:r.state)??lBe();yn(this,Y2,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Gse=function(n){us.batch(()=>{var r,i,o,s,a,l,c,u;if(Ke(this,s0)&&this.hasListeners()){const f=Ke(this,Y2).variables,h=Ke(this,Y2).context;(n==null?void 0:n.type)==="success"?((i=(r=Ke(this,s0)).onSuccess)==null||i.call(r,n.data,f,h),(s=(o=Ke(this,s0)).onSettled)==null||s.call(o,n.data,null,f,h)):(n==null?void 0:n.type)==="error"&&((l=(a=Ke(this,s0)).onError)==null||l.call(a,n.error,f,h),(u=(c=Ke(this,s0)).onSettled)==null||u.call(c,void 0,n.error,f,h))}this.listeners.forEach(f=>{f(Ke(this,Y2))})})},fNe),fBe=d.createContext(void 0),Vg=e=>{const t=d.useContext(fBe);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Zyt=({client:e,children:t})=>(d.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),H.jsx(fBe.Provider,{value:e,children:t})),hBe=d.createContext(!1),gBe=()=>d.useContext(hBe);hBe.Provider;function Jyt(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ebt=d.createContext(Jyt()),pBe=()=>d.useContext(ebt);function mBe(e,t){return typeof e=="function"?e(...t):!!e}function Kk(){}var vBe=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},CBe=e=>{d.useEffect(()=>{e.clearReset()},[e])},yBe=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&mBe(n,[e.error,r]),Bhe=(e,t)=>t.state.data===void 0,bBe=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},SBe=(e,t)=>e.isLoading&&e.isFetching&&!t,Wse=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Yk=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function wBe({queries:e,...t},n){const r=Vg(n),i=gBe(),o=pBe(),s=d.useMemo(()=>e.map(p=>{const m=r.defaultQueryOptions(p);return m._optimisticResults=i?"isRestoring":"optimistic",m}),[e,r,i]);s.forEach(p=>{bBe(p),vBe(p,o)}),CBe(o);const[a]=d.useState(()=>new Xyt(r,s,t)),[l,c,u]=a.getOptimisticResult(s,t.combine);d.useSyncExternalStore(d.useCallback(p=>i?Kk:a.subscribe(us.batchCalls(p)),[a,i]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),d.useEffect(()=>{a.setQueries(s,t,{listeners:!1})},[s,t,a]);const h=l.some((p,m)=>Wse(s[m],p))?l.flatMap((p,m)=>{const v=s[m];if(v){const C=new NI(r,v);if(Wse(v,p))return Yk(v,C,o);SBe(p,i)&&Yk(v,C,o)}return[]}):[];if(h.length>0)throw Promise.all(h);const g=l.find((p,m)=>{const v=s[m];return v&&yBe({result:p,errorResetBoundary:o,throwOnError:v.throwOnError,query:r.getQueryCache().get(v.queryHash)})});if(g!=null&&g.error)throw g.error;return c(u())}function cj(e,t,n){var u,f,h,g,p;const r=Vg(n),i=gBe(),o=pBe(),s=r.defaultQueryOptions(e);(f=(u=r.getDefaultOptions().queries)==null?void 0:u._experimental_beforeQuery)==null||f.call(u,s),s._optimisticResults=i?"isRestoring":"optimistic",bBe(s),vBe(s,o),CBe(o);const a=!r.getQueryCache().get(s.queryHash),[l]=d.useState(()=>new t(r,s)),c=l.getOptimisticResult(s);if(d.useSyncExternalStore(d.useCallback(m=>{const v=i?Kk:l.subscribe(us.batchCalls(m));return l.updateResult(),v},[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),d.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),Wse(s,c))throw Yk(s,l,o);if(yBe({result:c,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw c.error;if((g=(h=r.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||g.call(h,s,c),s.experimental_prefetchInRender&&!EC&&SBe(c,i)){const m=a?Yk(s,l,o):(p=r.getQueryCache().get(s.queryHash))==null?void 0:p.promise;m==null||m.catch(Kk).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?c:l.trackResult(c)}function tbt(e,t){return cj(e,NI,t)}function nbt(e,t){return cj({...e,enabled:!0,suspense:!0,throwOnError:Bhe,placeholderData:void 0},NI,t)}function rbt(e,t){return cj({...e,enabled:!0,suspense:!0,throwOnError:Bhe},dBe,t)}function ibt(e,t){return wBe({...e,queries:e.queries.map(n=>({...n,suspense:!0,throwOnError:Bhe,enabled:!0,placeholderData:void 0}))},t)}function obt(e,t){const n=Vg(t),[r]=d.useState(()=>new Qyt(n,e));d.useEffect(()=>{r.setOptions(e)},[r,e]);const i=d.useSyncExternalStore(d.useCallback(s=>r.subscribe(us.batchCalls(s)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=d.useCallback((s,a)=>{r.mutate(s,a).catch(Kk)},[r]);if(i.error&&mBe(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function sbt(e,t){return cj(e,dBe,t)}function Oy(e){const t={subscribe(n){let r=null,i=!1,o=!1,s=!1;function a(){if(r===null){s=!0;return}o||(o=!0,typeof r=="function"?r():r&&r.unsubscribe())}return r=e({next(l){var c;i||(c=n.next)==null||c.call(n,l)},error(l){var c;i||(i=!0,(c=n.error)==null||c.call(n,l),a())},complete(){var l;i||(i=!0,(l=n.complete)==null||l.call(n),a())}}),s&&a(),{unsubscribe:a}},pipe(...n){return n.reduce(abt,t)}};return t}function abt(e,t){return t(e)}function lbt(e){const t=new AbortController;return new Promise((r,i)=>{let o=!1;function s(){o||(o=!0,a.unsubscribe())}t.signal.addEventListener("abort",()=>{i(t.signal.reason)});const a=e.subscribe({next(l){o=!0,r(l),s()},error(l){i(l)},complete(){t.abort(),s()}})})}function cbt(e){return t=>{let n=0,r=null;const i=[];function o(){r||(r=t.subscribe({next(a){var l;for(const c of i)(l=c.next)==null||l.call(c,a)},error(a){var l;for(const c of i)(l=c.error)==null||l.call(c,a)},complete(){var a;for(const l of i)(a=l.complete)==null||a.call(l)}}))}function s(){if(n===0&&r){const a=r;r=null,a.unsubscribe()}}return Oy(a=>(n++,i.push(a),o(),{unsubscribe(){n--,s();const l=i.findIndex(c=>c===a);l>-1&&i.splice(l,1)}}))}}function ubt(e){return t=>Oy(n=>t.subscribe({next(r){var i;(i=e.next)==null||i.call(e,r),n.next(r)},error(r){var i;(i=e.error)==null||i.call(e,r),n.error(r)},complete(){var r;(r=e.complete)==null||r.call(e),n.complete()}}))}function xBe(e){return Oy(t=>{function n(i=0,o=e.op){const s=e.links[i];if(!s)throw new Error("No more links to execute - did you forget to add an ending link?");return s({op:o,next(l){return n(i+1,l)}})}return n().subscribe(t)})}var $be,Obe;const EBe=()=>{},Tbe=e=>{Object.freeze&&Object.freeze(e)};function RBe(e,t,n){const r=t.join(".");return($be=n)[Obe=r]??($be[Obe]=new Proxy(EBe,{get(i,o){if(!(typeof o!="string"||o==="then"))return RBe(e,[...t,o],n)},apply(i,o,s){const a=t[t.length-1];let l={args:s,path:t};return a==="call"?l={args:s.length>=2?[s[1]]:[],path:t.slice(0,-1)}:a==="apply"&&(l={args:s.length>=2?s[1]:[],path:t.slice(0,-1)}),Tbe(l.args),Tbe(l.path),e(l)}})),n[r]}const uj=e=>RBe(e,[],Object.create(null)),Hhe=e=>new Proxy(EBe,{get(t,n){if(!(typeof n!="string"||n==="then"))return e(n)}});function RC(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}const dbt=typeof Symbol=="function"&&!!Symbol.asyncIterator;function fbt(e){return dbt&&RC(e)&&Symbol.asyncIterator in e}function hbt(e,t){if("error"in e){const r=t.deserialize(e.error);return{ok:!1,error:{...e,error:r}}}return{ok:!0,result:{...e.result,...(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)}}}}class ZJ extends Error{constructor(){super("Unable to transform response from server")}}function $Be(e,t){let n;try{n=hbt(e,t)}catch{throw new ZJ}if(!n.ok&&(!RC(n.error.error)||typeof n.error.error.code!="number"))throw new ZJ;if(n.ok&&!RC(n.result))throw new ZJ;return n}var hNe,gNe,pNe,mNe,vNe,CNe;typeof window>"u"||"Deno"in window||((gNe=(hNe=globalThis.process)==null?void 0:hNe.env)==null?void 0:gNe.NODE_ENV)==="test"||(mNe=(pNe=globalThis.process)==null?void 0:pNe.env)!=null&&mNe.JEST_WORKER_ID||(CNe=(vNe=globalThis.process)==null?void 0:vNe.env)!=null&&CNe.VITEST_WORKER_ID;function gbt(e){return e instanceof yg||e instanceof Error&&e.name==="TRPCClientError"}function pbt(e){return RC(e)&&RC(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function mbt(e,t){return typeof e=="string"?e:RC(e)&&typeof e.message=="string"?e.message:t}class yg extends Error{static from(t,n={}){const r=t;return gbt(r)?(n.meta&&(r.meta={...r.meta,...n.meta}),r):pbt(r)?new yg(r.error.message,{...n,result:r}):new yg(mbt(r,"Unknown error"),{...n,cause:r})}constructor(t,n){var i,o;const r=n==null?void 0:n.cause;super(t,{cause:r}),this.meta=n==null?void 0:n.meta,this.cause=r,this.shape=(i=n==null?void 0:n.result)==null?void 0:i.error,this.data=(o=n==null?void 0:n.result)==null?void 0:o.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,yg.prototype)}}class OBe{$request(t){return xBe({links:this.links,op:{...t,context:t.context??{},id:++this.requestId}}).pipe(cbt())}async requestAsPromise(t){try{const n=this.$request(t);return(await lbt(n)).result.data}catch(n){throw yg.from(n)}}query(t,n,r){return this.requestAsPromise({type:"query",path:t,input:n,context:r==null?void 0:r.context,signal:r==null?void 0:r.signal})}mutation(t,n,r){return this.requestAsPromise({type:"mutation",path:t,input:n,context:r==null?void 0:r.context,signal:r==null?void 0:r.signal})}subscription(t,n,r){return this.$request({type:"subscription",path:t,input:n,context:r==null?void 0:r.context,signal:null}).subscribe({next(o){var s,a,l;o.result.type==="started"?(s=r.onStarted)==null||s.call(r,{context:o.context}):o.result.type==="stopped"?(a=r.onStopped)==null||a.call(r):(l=r.onData)==null||l.call(r,o.result.data)},error(o){var s;(s=r.onError)==null||s.call(r,o)},complete(){var o;(o=r.onComplete)==null||o.call(r)}})}constructor(t){this.requestId=0,this.runtime={},this.links=t.links.map(n=>n(this.runtime))}}function vbt(e){return new OBe(e)}const Cbt={query:"query",mutate:"mutation",subscribe:"subscription"},ybt=e=>Cbt[e];function bbt(e){const t=uj(({path:n,args:r})=>{const i=[...n],o=ybt(i.pop()),s=i.join(".");return e[o](s,...r)});return Hhe(n=>e.hasOwnProperty(n)?e[n]:n==="__untypedClient"?e:t[n])}function Sbt(e){return e.__untypedClient}const Ibe=e=>typeof e=="function";function wbt(e){if(e)return e;if(typeof window<"u"&&Ibe(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Ibe(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}const Mbe=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function Pbe(e){let t=null,n=null;const r=()=>{clearTimeout(n),n=null,t=null};function i(a){var u,f;const l=[[]];let c=0;for(;;){const h=a[c];if(!h)break;const g=l[l.length-1];if(h.aborted){(u=h.reject)==null||u.call(h,new Error("Aborted")),c++;continue}if(e.validate(g.concat(h).map(m=>m.key))){g.push(h),c++;continue}if(g.length===0){(f=h.reject)==null||f.call(h,new Error("Input is too big for a single dispatch")),c++;continue}l.push([])}return l}function o(){const a=i(t);r();for(const l of a){if(!l.length)continue;const c={items:l};for(const f of l)f.batch=c;e.fetch(c.items.map(f=>f.key)).then(async f=>{var h;await Promise.all(f.map(async(g,p)=>{var v,C;const m=c.items[p];try{const y=await Promise.resolve(g);(v=m.resolve)==null||v.call(m,y)}catch(y){(C=m.reject)==null||C.call(m,y)}m.batch=null,m.reject=null,m.resolve=null}));for(const g of c.items)(h=g.reject)==null||h.call(g,new Error("Missing result")),g.batch=null}).catch(f=>{var h;for(const g of c.items)(h=g.reject)==null||h.call(g,f),g.batch=null})}}function s(a){const l={aborted:!1,key:a,batch:null,resolve:Mbe,reject:Mbe},c=new Promise((u,f)=>{l.reject=f,l.resolve=u,t||(t=[]),t.push(l)});return n||(n=setTimeout(o)),c}return{load:s}}function TBe(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}}}function xbt(e){return{url:e.url.toString(),fetch:e.fetch,transformer:TBe(e.transformer),methodOverride:e.methodOverride}}function Ebt(e){const t={};for(let n=0;ne.transformer.input.serialize(t)))}const MBe=e=>{const t=e.url.split("?");let r=t[0].replace(/\/$/,"")+"/"+e.path;const i=[];if(t[1]&&i.push(t[1]),"inputs"in e&&i.push("batch=1"),e.type==="query"||e.type==="subscription"){const o=IBe(e);o!==void 0&&e.methodOverride!=="POST"&&i.push(`input=${encodeURIComponent(JSON.stringify(o))}`)}return i.length&&(r+="?"+i.join("&")),r},$bt=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=IBe(e);return t!==void 0?JSON.stringify(t):void 0},Obt=e=>Ibt({...e,contentTypeHeader:"application/json",getUrl:MBe,getBody:$bt});async function Tbt(e){var s;(s=e.signal)==null||s.throwIfAborted();const t=e.getUrl(e),n=e.getBody(e),{type:r}=e,i=await(async()=>{const a=await e.headers();return Symbol.iterator in a?Object.fromEntries(a):a})(),o={...e.contentTypeHeader?{"content-type":e.contentTypeHeader}:{},...e.trpcAcceptHeader?{"trpc-accept":e.trpcAcceptHeader}:void 0,...i};return wbt(e.fetch)(t,{method:e.methodOverride??Rbt[r],signal:e.signal,body:n,headers:o})}async function Ibt(e){const t={},n=await Tbt(e);t.response=n;const r=await n.json();return t.responseJSON=r,{json:r,meta:t}}function Mbt(e){const t=new AbortController;if(e.some(o=>!o.signal))return t;const n=e.length;let r=0;const i=()=>{++r===n&&t.abort()};for(const o of e){const s=o.signal;s.aborted?i():s.addEventListener("abort",i,{once:!0})}return t}function _be(e){const t=xbt(e),n=e.maxURLLength??1/0;return()=>{const r=a=>({validate(l){if(n===1/0)return!0;const c=l.map(h=>h.path).join(","),u=l.map(h=>h.input);return MBe({...t,type:a,path:c,inputs:u,signal:null}).length<=n},async fetch(l){const c=l.map(m=>m.path).join(","),u=l.map(m=>m.input),f=Mbt(l),h=await Obt({...t,path:c,inputs:u,type:a,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:l}):e.headers:{}},signal:f.signal});return(Array.isArray(h.json)?h.json:l.map(()=>h.json)).map(m=>({meta:h.meta,json:m}))}}),i=Pbe(r("query")),o=Pbe(r("mutation")),s={query:i,mutation:o};return({op:a})=>Oy(l=>{/* istanbul ignore if -- @preserve */if(a.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const u=s[a.type].load(a);let f;return u.then(h=>{f=h;const g=$Be(h.json,t.transformer.output);if(!g.ok){l.error(yg.from(g.error,{meta:h.meta}));return}l.next({context:h.meta,result:g.result}),l.complete()}).catch(h=>{l.error(yg.from(h,{meta:f==null?void 0:f.meta}))}),()=>{}})}}function Pbt(e){return typeof FormData>"u"?!1:e instanceof FormData}const JJ={css:{query:["72e3ff","3fb0d8"],mutation:["c5a3fc","904dfc"],subscription:["ff49e1","d83fbe"]},ansi:{regular:{query:["\x1B[30;46m","\x1B[97;46m"],mutation:["\x1B[30;45m","\x1B[97;45m"],subscription:["\x1B[30;42m","\x1B[97;42m"]},bold:{query:["\x1B[1;30;46m","\x1B[1;97;46m"],mutation:["\x1B[1;30;45m","\x1B[1;97;45m"],subscription:["\x1B[1;30;42m","\x1B[1;97;42m"]}}};function _bt(e){const{direction:t,type:n,withContext:r,path:i,id:o,input:s}=e,a=[],l=[];if(e.colorMode==="none")a.push(t==="up"?">>":"<<",n,`#${o}`,i);else if(e.colorMode==="ansi"){const[c,u]=JJ.ansi.regular[n],[f,h]=JJ.ansi.bold[n];a.push(t==="up"?c:u,t==="up"?">>":"<<",n,t==="up"?f:h,`#${o}`,i,"\x1B[0m")}else{const[c,u]=JJ.css[n],f=` + background-color: #${t==="up"?c:u}; + color: ${t==="up"?"black":"white"}; + padding: 2px; + `;a.push("%c",t==="up"?">>":"<<",n,`#${o}`,`%c${i}%c`,"%O"),l.push(f,`${f}; font-weight: bold;`,`${f}; font-weight: normal;`)}return t==="up"?l.push(r?{input:s,context:e.context}:{input:s}):l.push({input:s,result:e.result,elapsedMs:e.elapsedMs,...r&&{context:e.context}}),{parts:a,args:l}}const Abt=({c:e=console,colorMode:t="css",withContext:n})=>r=>{const i=r.input,o=Pbt(i)?Object.fromEntries(i):i,{parts:s,args:a}=_bt({...r,colorMode:t,input:o,withContext:n}),l=r.direction==="down"&&r.result&&(r.result instanceof Error||"error"in r.result.result)?"error":"log";e[l].apply(null,[s.join(" ")].concat(a))};function Dbt(e={}){const{enabled:t=()=>!0}=e,n=e.colorMode??(typeof window>"u"?"ansi":"css"),r=e.withContext??n==="css",{logger:i=Abt({c:e.console,colorMode:n,withContext:r})}=e;return()=>({op:o,next:s})=>Oy(a=>{t({...o,direction:"up"})&&i({...o,direction:"up"});const l=Date.now();function c(u){const f=Date.now()-l;t({...o,direction:"down",result:u})&&i({...o,direction:"down",elapsedMs:f,result:u})}return s(o).pipe(ubt({next(u){c(u)},error(u){c(u)}})).subscribe(a)})}function Abe(e){return Array.isArray(e)?e:[e]}function Lbt(e){return t=>{const n=Abe(e.true).map(i=>i(t)),r=Abe(e.false).map(i=>i(t));return i=>Oy(o=>{const s=e.condition(i.op)?n:r;return xBe({op:i.op,links:s}).subscribe(o)})}}const Dbe=e=>typeof e=="function"?e():e,Lbe=e=>e(),Fbt=e=>e===0?0:Math.min(1e3*2**e,3e4),Nbt={enabled:!1,closeMs:0};function kbt(e){const{WebSocket:t=WebSocket,retryDelayMs:n=Fbt,onOpen:r,onClose:i}=e,o={...Nbt,...e.lazy};/* istanbul ignore next -- @preserve */if(!t)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");let s=[];const a=Object.create(null);let l=0,c,u=0,f,h=o.enabled?null:w();function g(){if(!h){h=w();return}setTimeout(()=>{if((h==null?void 0:h.state)==="open"){for(const E of Object.values(a))E.connection||(E.connection=h);s.length===1?h.ws.send(JSON.stringify(s.pop())):h.ws.send(JSON.stringify(s)),s=[],S()}})}function p(E){if(c)return;E.state="connecting";const R=n(l++);C(R)}function m(E){const R=Object.values(a);return E?R.some(O=>O.connection===E):R.length>0}function v(){if(o.enabled&&!m())return;const E=h;h=w(),E&&y(E)}function C(E){c||(c=setTimeout(v,E))}function y(E){var R;m(E)||(R=E.ws)==null||R.close()}function b(E){s.some(R=>R.id===E.op.id)||x(E.op,E.callbacks)}const S=()=>{o.enabled&&(clearTimeout(f),f=setTimeout(()=>{var E;h&&(m(h)||((E=h.ws)==null||E.close(),h=null))},o.closeMs))};function w(){const E={id:++u,state:"connecting"};clearTimeout(f);const R=()=>{E.state="closed",E===h&&p(E)};return Lbe(async()=>{let O=await Dbe(e.url);if(e.connectionParams){const F=O.includes("?")?"&":"?";O+=F+"connectionParams=1"}const T=new t(O);E.ws=T,clearTimeout(c),c=void 0,T.addEventListener("open",()=>{Lbe(async()=>{/* istanbul ignore next -- @preserve */if((h==null?void 0:h.ws)===T){if(e.connectionParams){const F={method:"connectionParams",data:await Dbe(e.connectionParams)};T.send(JSON.stringify(F))}l=0,E.state="open",r==null||r(),g()}}).catch(F=>{T.close(3e3,F),R()})}),T.addEventListener("error",R);const M=F=>{if(E===h&&F.method==="reconnect"){v();for(const D of Object.values(a))D.type==="subscription"&&b(D)}},_=F=>{var k,L;const D=F.id!==null&&a[F.id];if(D){if((L=(k=D.callbacks).next)==null||L.call(k,F),E===h&&D.connection!==h){const I=D.connection;D.connection=E,I&&y(I)}"result"in F&&F.result.type==="stopped"&&h===E&&D.callbacks.complete()}};T.addEventListener("message",({data:F})=>{S();const D=JSON.parse(F);"method"in D?M(D):_(D),E!==h&&y(E)}),T.addEventListener("close",({code:F})=>{var D,k,L,I;E.state==="open"&&(i==null||i({code:F})),E.state="closed",h===E&&p(E);for(const[A,N]of Object.entries(a))if(N.connection===E){if(E.state==="closed"){delete a[A],(k=(D=N.callbacks).complete)==null||k.call(D);continue}N.type==="subscription"?b(N):(delete a[A],(I=(L=N.callbacks).error)==null||I.call(L,yg.from(new jhe("WebSocket closed prematurely"))))}})}).catch(R),E}function x(E,R){const{type:O,input:T,path:M,id:_}=E,F={id:_,method:O,params:{input:T,path:M}};return a[_]={connection:null,type:O,callbacks:R,op:E},s.push(F),g(),()=>{var k,L;const D=(k=a[_])==null?void 0:k.callbacks;delete a[_],s=s.filter(I=>I.id!==_),(L=D==null?void 0:D.complete)==null||L.call(D),(h==null?void 0:h.state)==="open"&&E.type==="subscription"&&(s.push({id:_,method:"subscription.stop"}),g()),S()}}return{close:()=>{l=0;for(const E of Object.values(a))E.type==="subscription"?E.callbacks.complete():E.connection||E.callbacks.error(yg.from(new Error("Closed before connection was established")));h&&y(h),clearTimeout(c),c=void 0,h=null},request:x,get connection(){return h},reconnect:v}}class jhe extends Error{constructor(t){super(t),this.name="TRPCWebSocketClosedError",Object.setPrototypeOf(this,jhe.prototype)}}function zbt(e){const t=TBe(e.transformer);return()=>{const{client:n}=e;return({op:r})=>Oy(i=>{const{type:o,path:s,id:a,context:l}=r,c=t.input.serialize(r.input),u=n.request({type:o,path:s,input:c,id:a,context:l,signal:null},{error(f){i.error(f),u()},complete(){i.complete()},next(f){const h=$Be(f,t.output);if(!h.ok){i.error(yg.from(h.error));return}i.next({result:h.result}),r.type!=="subscription"&&(u(),i.complete())}});return()=>{u()}})}}function F2(e,t,n){const r=e.flatMap(i=>i.split("."));if(!t&&(!n||n==="any"))return r.length?[r]:[];if(n==="infinite"&&RC(t)&&("direction"in t||"cursor"in t)){const{cursor:i,direction:o,...s}=t;return[r,{input:s,type:"infinite"}]}return[r,{...typeof t<"u"&&t!==Q8&&{input:t},...n&&n!=="any"&&{type:n}}]}function bg(e,...t){const[n,r]=t,i=e._def().path;return F2(i,n,r??"any")}function Bbt(e){return uj(({path:t,args:n})=>{const r=[...t],i=r.pop();if(i==="useMutation")return e[i](r,...n);if(i==="_def")return{path:r};const[o,...s]=n,a=s[0]||{};return e[i](r,o,a)})}const Hbt=["client","ssrContext","ssrState","abortOnUnmount"];var yNe;const jbt=(yNe=d.createContext)==null?void 0:yNe.call(d,null),Vbt=e=>{switch(e){case"fetch":case"ensureData":case"prefetch":case"getData":case"setData":case"setQueriesData":return"query";case"fetchInfinite":case"prefetchInfinite":case"getInfiniteData":case"setInfiniteData":return"infinite";case"cancel":case"invalidate":case"refetch":case"reset":return"any"}};function Gbt(e){return uj(t=>{const n=[...t.path],r=n.pop(),i=[...t.args],o=i.shift(),s=Vbt(r),a=F2(n,o,s);return{fetch:()=>e.fetchQuery(a,...i),fetchInfinite:()=>e.fetchInfiniteQuery(a,i[0]),prefetch:()=>e.prefetchQuery(a,...i),prefetchInfinite:()=>e.prefetchInfiniteQuery(a,i[0]),ensureData:()=>e.ensureQueryData(a,...i),invalidate:()=>e.invalidateQueries(a,...i),reset:()=>e.resetQueries(a,...i),refetch:()=>e.refetchQueries(a,...i),cancel:()=>e.cancelQuery(a,...i),setData:()=>{e.setQueryData(a,i[0],i[1])},setQueriesData:()=>e.setQueriesData(a,i[0],i[1],i[2]),setInfiniteData:()=>{e.setInfiniteQueryData(a,i[0],i[1])},getData:()=>e.getQueryData(a),getInfiniteData:()=>e.getInfiniteQueryData(a)}[r]()})}function Wbt(e){const t=bbt(e.client),n=Gbt(e);return Hhe(r=>{const i=r;return i==="client"?t:Hbt.includes(i)?e[i]:n[r]})}function Gp(e,t,n){var o;const r=e[0];let i=(o=e[1])==null?void 0:o.input;return n&&(i={...i??{},...n.pageParam?{cursor:n.pageParam}:{},direction:n.direction}),[r.join("."),i,t==null?void 0:t.trpc]}function GE(e){const t=e.path.join(".");return d.useMemo(()=>({path:t}),[t])}function Ubt(e){const{client:t,queryClient:n}=e,r=t instanceof OBe?t:Sbt(t);return{fetchQuery:(i,o)=>n.fetchQuery({...o,queryKey:i,queryFn:()=>r.query(...Gp(i,o))}),fetchInfiniteQuery:(i,o)=>n.fetchInfiniteQuery({...o,queryKey:i,queryFn:({pageParam:s,direction:a})=>r.query(...Gp(i,o,{pageParam:s,direction:a})),initialPageParam:(o==null?void 0:o.initialCursor)??null}),prefetchQuery:(i,o)=>n.prefetchQuery({...o,queryKey:i,queryFn:()=>r.query(...Gp(i,o))}),prefetchInfiniteQuery:(i,o)=>n.prefetchInfiniteQuery({...o,queryKey:i,queryFn:({pageParam:s,direction:a})=>r.query(...Gp(i,o,{pageParam:s,direction:a})),initialPageParam:(o==null?void 0:o.initialCursor)??null}),ensureQueryData:(i,o)=>n.ensureQueryData({...o,queryKey:i,queryFn:()=>r.query(...Gp(i,o))}),invalidateQueries:(i,o,s)=>n.invalidateQueries({...o,queryKey:i},s),resetQueries:(i,o,s)=>n.resetQueries({...o,queryKey:i},s),refetchQueries:(i,o,s)=>n.refetchQueries({...o,queryKey:i},s),cancelQuery:(i,o)=>n.cancelQueries({queryKey:i},o),setQueryData:(i,o,s)=>n.setQueryData(i,o,s),setQueriesData:(i,o,s,a)=>n.setQueriesData({...o,queryKey:i},s,a),getQueryData:i=>n.getQueryData(i),setInfiniteQueryData:(i,o,s)=>n.setQueryData(i,o,s),getInfiniteQueryData:i=>n.getQueryData(i)}}function Fbe(e){return uj(t=>{const n=t.path,r=n.join("."),[i,o]=t.args;return{queryKey:F2(n,i,"query"),queryFn:()=>e.query(r,i,o==null?void 0:o.trpc),...o}})}function qbt(e){const t=m=>m.originalFn(),n=jbt,r=m=>vbt(m),i=m=>{const{abortOnUnmount:v=!1,client:C,queryClient:y,ssrContext:b}=m,[S,w]=d.useState(m.ssrState??!1),x=d.useMemo(()=>Ubt({client:C,queryClient:y}),[C,y]),E=d.useMemo(()=>({abortOnUnmount:v,queryClient:y,client:C,ssrContext:b??null,ssrState:S,...x}),[v,C,x,y,b,S]);return d.useEffect(()=>{w(R=>R?"mounted":!1)},[]),d.createElement(n.Provider,{value:E},m.children)};function o(){const m=d.useContext(n);if(!m)throw new Error("Unable to find tRPC Context. Did you forget to wrap your App inside `withTRPC` HoC?");return m}function s(m,v){var b;const{queryClient:C,ssrState:y}=o();return y&&y!=="mounted"&&((b=C.getQueryCache().find({queryKey:m}))==null?void 0:b.state.status)==="error"?{retryOnMount:!1,...v}:v}function a(m,v,C){var D,k;const y=o(),{abortOnUnmount:b,client:S,ssrState:w,queryClient:x,prefetchQuery:E}=y,R=F2(m,v,"query"),O=x.getQueryDefaults(R),T=v===Q8;typeof window>"u"&&w==="prepass"&&((D=C==null?void 0:C.trpc)==null?void 0:D.ssr)!==!1&&((C==null?void 0:C.enabled)??(O==null?void 0:O.enabled))!==!1&&!T&&!x.getQueryCache().find({queryKey:R})&&E(R,C);const M=s(R,{...O,...C}),_=((k=C==null?void 0:C.trpc)==null?void 0:k.abortOnUnmount)??(e==null?void 0:e.abortOnUnmount)??b,F=tbt({...M,queryKey:R,queryFn:T?v:async L=>{const I={...M,trpc:{...M==null?void 0:M.trpc,..._?{signal:L.signal}:{signal:null}}},A=await S.query(...Gp(R,I));if(fbt(A)){const B=x.getQueryCache().build(L.queryKey,{queryKey:R});B.setState({data:[],status:"success"});const z=[];for await(const j of A)z.push(j),B.setState({data:[...z]});return z}return A}},x);return F.trpc=GE({path:m}),F}function l(m,v,C){var x;const y=o(),b=F2(m,v,"query"),S=((x=C==null?void 0:C.trpc)==null?void 0:x.abortOnUnmount)??(e==null?void 0:e.abortOnUnmount)??y.abortOnUnmount,w=nbt({...C,queryKey:b,queryFn:E=>{const R={trpc:{...S?{signal:E.signal}:{signal:null}}};return y.client.query(...Gp(b,R))}},y.queryClient);return w.trpc=GE({path:m}),[w.data,w]}function c(m,v){const{client:C}=o(),y=Vg(),b=[m],S=y.defaultMutationOptions(y.getMutationDefaults(b)),w=obt({...v,mutationKey:b,mutationFn:x=>C.mutation(...Gp([m,{input:x}],v)),onSuccess(...x){return t({originalFn:()=>{var R,O;return((R=v==null?void 0:v.onSuccess)==null?void 0:R.call(v,...x))??((O=S==null?void 0:S.onSuccess)==null?void 0:O.call(S,...x))},queryClient:y,meta:(v==null?void 0:v.meta)??(S==null?void 0:S.meta)??{}})}},y);return w.trpc=GE({path:m}),w}/* istanbul ignore next -- @preserve */function u(m,v,C){const y=(C==null?void 0:C.enabled)??v!==Q8,b=N4(F2(m,v,"any")),{client:S}=o(),w=d.useRef(C);w.current=C,d.useEffect(()=>{if(!y)return;let x=!1;const E=S.subscription(m.join("."),v??void 0,{onStarted:()=>{var R,O;x||(O=(R=w.current).onStarted)==null||O.call(R)},onData:R=>{x||w.current.onData(R)},onError:R=>{var O,T;x||(T=(O=w.current).onError)==null||T.call(O,R)}});return()=>{x=!0,E.unsubscribe()}},[b,y])}function f(m,v,C){var F,D;const{client:y,ssrState:b,prefetchInfiniteQuery:S,queryClient:w,abortOnUnmount:x}=o(),E=F2(m,v,"infinite"),R=w.getQueryDefaults(E),O=v===Q8;typeof window>"u"&&b==="prepass"&&((F=C==null?void 0:C.trpc)==null?void 0:F.ssr)!==!1&&((C==null?void 0:C.enabled)??(R==null?void 0:R.enabled))!==!1&&!O&&!w.getQueryCache().find({queryKey:E})&&S(E,{...R,...C});const T=s(E,{...R,...C}),M=((D=C==null?void 0:C.trpc)==null?void 0:D.abortOnUnmount)??x,_=sbt({...T,initialPageParam:C.initialCursor??null,persister:C.persister,queryKey:E,queryFn:O?v:k=>{const L={...T,trpc:{...T==null?void 0:T.trpc,...M?{signal:k.signal}:{signal:null}}};return y.query(...Gp(E,L,{pageParam:k.pageParam??C.initialCursor,direction:k.direction}))}},w);return _.trpc=GE({path:m}),_}function h(m,v,C){var R;const y=o(),b=F2(m,v,"infinite"),S=y.queryClient.getQueryDefaults(b),w=s(b,{...S,...C}),x=((R=C==null?void 0:C.trpc)==null?void 0:R.abortOnUnmount)??y.abortOnUnmount,E=rbt({...C,initialPageParam:C.initialCursor??null,queryKey:b,queryFn:O=>{const T={...w,trpc:{...w==null?void 0:w.trpc,...x?{signal:O.signal}:{}}};return y.client.query(...Gp(b,T,{pageParam:O.pageParam??C.initialCursor,direction:O.direction}))}},y.queryClient);return E.trpc=GE({path:m}),[E.data,E]}return{Provider:i,createClient:r,useContext:o,useUtils:o,useQuery:a,useSuspenseQuery:l,useQueries:m=>{var x;const{ssrState:v,queryClient:C,prefetchQuery:y,client:b}=o(),S=Fbe(b),w=m(S);if(typeof window>"u"&&v==="prepass")for(const E of w){const R=E;((x=R.trpc)==null?void 0:x.ssr)!==!1&&!C.getQueryCache().find({queryKey:R.queryKey})&&y(R.queryKey,R)}return wBe({queries:w.map(E=>({...E,queryKey:E.queryKey}))},C)},useSuspenseQueries:m=>{const{queryClient:v,client:C}=o(),y=Fbe(C),b=m(y),S=ibt({queries:b.map(w=>({...w,queryKey:w.queryKey}))},v);return[S.map(w=>w.data),S]},useMutation:c,useSubscription:u,useInfiniteQuery:f,useSuspenseInfiniteQuery:h}}function Kbt(e){const t=Bbt(e);return Hhe(n=>n==="useContext"||n==="useUtils"?()=>{const r=e.useUtils();return d.useMemo(()=>Wbt(r),[r])}:e.hasOwnProperty(n)?e[n]:t[n])}function Ybt(e){const t=qbt(e);return Kbt(t)}var Mi;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const s of i)o[s]=s;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(const a of o)s[a]=i[a];return e.objectValues(s)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},e.find=(i,o)=>{for(const s of i)if(o(s))return s},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Mi||(Mi={}));var Use;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Use||(Use={}));const An=Mi.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),e0=e=>{switch(typeof e){case"undefined":return An.undefined;case"string":return An.string;case"number":return isNaN(e)?An.nan:An.number;case"boolean":return An.boolean;case"function":return An.function;case"bigint":return An.bigint;case"symbol":return An.symbol;case"object":return Array.isArray(e)?An.array:e===null?An.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?An.promise:typeof Map<"u"&&e instanceof Map?An.map:typeof Set<"u"&&e instanceof Set?An.set:typeof Date<"u"&&e instanceof Date?An.date:An.object;default:return An.unknown}},un=Mi.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Xbt=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class cd extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;ln.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}cd.create=e=>new cd(e);const Gw=(e,t)=>{let n;switch(e.code){case un.invalid_type:e.received===An.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case un.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Mi.jsonStringifyReplacer)}`;break;case un.unrecognized_keys:n=`Unrecognized key(s) in object: ${Mi.joinValues(e.keys,", ")}`;break;case un.invalid_union:n="Invalid input";break;case un.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Mi.joinValues(e.options)}`;break;case un.invalid_enum_value:n=`Invalid enum value. Expected ${Mi.joinValues(e.options)}, received '${e.received}'`;break;case un.invalid_arguments:n="Invalid function arguments";break;case un.invalid_return_type:n="Invalid function return type";break;case un.invalid_date:n="Invalid date";break;case un.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Mi.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case un.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case un.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case un.custom:n="Invalid input";break;case un.invalid_intersection_types:n="Intersection results could not be merged";break;case un.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case un.not_finite:n="Number must be finite";break;default:n=t.defaultError,Mi.assertNever(e)}return{message:n}};let PBe=Gw;function Qbt(e){PBe=e}function Xk(){return PBe}const Qk=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(s,{data:t,defaultError:a}).message;return{...i,path:o,message:a}},Zbt=[];function On(e,t){const n=Xk(),r=Qk({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Gw?void 0:Gw].filter(i=>!!i)});e.common.issues.push(r)}class ql{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return Or;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const o=await i.key,s=await i.value;r.push({key:o,value:s})}return ql.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return Or;o.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:t.value,value:r}}}const Or=Object.freeze({status:"aborted"}),bS=e=>({status:"dirty",value:e}),Cc=e=>({status:"valid",value:e}),qse=e=>e.status==="aborted",Kse=e=>e.status==="dirty",$C=e=>e.status==="valid",qO=e=>typeof Promise<"u"&&e instanceof Promise;function Zk(e,t,n,r){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function _Be(e,t,n,r,i){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var Yn;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Yn||(Yn={}));var JR,e$;class bm{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Nbe=(e,t)=>{if($C(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new cd(e.common.issues);return this._error=n,this._error}}};function jr(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(s,a)=>{var l,c;const{message:u}=e;return s.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:(l=u??r)!==null&&l!==void 0?l:a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:(c=u??n)!==null&&c!==void 0?c:a.defaultError}},description:i}}class Zr{get description(){return this._def.description}_getType(t){return e0(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:e0(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ql,ctx:{common:t.parent.common,data:t.data,parsedType:e0(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(qO(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:e0(t)},o=this._parseSync({data:t,path:i.path,parent:i});return Nbe(i,o)}"~validate"(t){var n,r;const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:e0(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:i});return $C(o)?{value:o.value}:{issues:i.common.issues}}catch(o){!((r=(n=o==null?void 0:o.message)===null||n===void 0?void 0:n.toLowerCase())===null||r===void 0)&&r.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:i}).then(o=>$C(o)?{value:o.value}:{issues:i.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:e0(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(qO(i)?i:Promise.resolve(i));return Nbe(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const s=t(i),a=()=>o.addIssue({code:un.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new _g({schema:this,typeName:Er.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return om.create(this,this._def)}nullable(){return H4.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Sg.create(this)}promise(){return Uw.create(this,this._def)}or(t){return QO.create([this,t],this._def)}and(t){return ZO.create(this,t,this._def)}transform(t){return new _g({...jr(this._def),schema:this,typeName:Er.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new rT({...jr(this._def),innerType:this,defaultValue:n,typeName:Er.ZodDefault})}brand(){return new Vhe({typeName:Er.ZodBranded,type:this,...jr(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new iT({...jr(this._def),innerType:this,catchValue:n,typeName:Er.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return kI.create(this,t)}readonly(){return oT.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Jbt=/^c[^\s-]{8,}$/i,e5t=/^[0-9a-z]+$/,t5t=/^[0-9A-HJKMNP-TV-Z]{26}$/i,n5t=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,r5t=/^[a-z0-9_-]{21}$/i,i5t=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,o5t=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,s5t=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,a5t="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let eee;const l5t=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,c5t=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,u5t=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,d5t=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,f5t=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,h5t=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ABe="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",g5t=new RegExp(`^${ABe}$`);function DBe(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function p5t(e){return new RegExp(`^${DBe(e)}$`)}function LBe(e){let t=`${ABe}T${DBe(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function m5t(e,t){return!!((t==="v4"||!t)&&l5t.test(e)||(t==="v6"||!t)&&u5t.test(e))}function v5t(e,t){if(!i5t.test(e))return!1;try{const[n]=e.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||!i.typ||!i.alg||t&&i.alg!==t)}catch{return!1}}function C5t(e,t){return!!((t==="v4"||!t)&&c5t.test(e)||(t==="v6"||!t)&&d5t.test(e))}class fg extends Zr{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==An.string){const o=this._getOrReturnCtx(t);return On(o,{code:un.invalid_type,expected:An.string,received:o.parsedType}),Or}const r=new ql;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.lengtho.value&&(i=this._getOrReturnCtx(t,i),On(i,{code:un.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const s=t.data.length>o.value,a=t.data.lengtht.test(i),{validation:n,code:un.invalid_string,...Yn.errToObj(r)})}_addCheck(t){return new fg({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Yn.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Yn.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Yn.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Yn.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Yn.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Yn.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Yn.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Yn.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Yn.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Yn.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Yn.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Yn.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Yn.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...Yn.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Yn.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Yn.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Yn.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Yn.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Yn.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Yn.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Yn.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Yn.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Yn.errToObj(n)})}nonempty(t){return this.min(1,Yn.errToObj(t))}trim(){return new fg({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new fg({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new fg({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new fg({checks:[],typeName:Er.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...jr(e)})};function y5t(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),s=parseInt(t.toFixed(i).replace(".",""));return o%s/Math.pow(10,i)}class k4 extends Zr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==An.number){const o=this._getOrReturnCtx(t);return On(o,{code:un.invalid_type,expected:An.number,received:o.parsedType}),Or}let r;const i=new ql;for(const o of this._def.checks)o.kind==="int"?Mi.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),On(r,{code:un.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),On(r,{code:un.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?y5t(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),On(r,{code:un.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),On(r,{code:un.not_finite,message:o.message}),i.dirty()):Mi.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Yn.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Yn.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Yn.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Yn.toString(n))}setLimit(t,n,r,i){return new k4({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Yn.toString(i)}]})}_addCheck(t){return new k4({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Yn.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Yn.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Yn.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Yn.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Yn.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Yn.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Yn.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Yn.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Yn.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&Mi.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.valuenew k4({checks:[],typeName:Er.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...jr(e)});class z4 extends Zr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==An.bigint)return this._getInvalidInput(t);let r;const i=new ql;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),On(r,{code:un.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),On(r,{code:un.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Mi.assertNever(o);return{status:i.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return On(n,{code:un.invalid_type,expected:An.bigint,received:n.parsedType}),Or}gte(t,n){return this.setLimit("min",t,!0,Yn.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Yn.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Yn.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Yn.toString(n))}setLimit(t,n,r,i){return new z4({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Yn.toString(i)}]})}_addCheck(t){return new z4({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Yn.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Yn.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Yn.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Yn.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Yn.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new z4({checks:[],typeName:Er.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...jr(e)})};class KO extends Zr{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==An.boolean){const r=this._getOrReturnCtx(t);return On(r,{code:un.invalid_type,expected:An.boolean,received:r.parsedType}),Or}return Cc(t.data)}}KO.create=e=>new KO({typeName:Er.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...jr(e)});class OC extends Zr{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==An.date){const o=this._getOrReturnCtx(t);return On(o,{code:un.invalid_type,expected:An.date,received:o.parsedType}),Or}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return On(o,{code:un.invalid_date}),Or}const r=new ql;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()o.value&&(i=this._getOrReturnCtx(t,i),On(i,{code:un.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Mi.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new OC({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Yn.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Yn.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew OC({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Er.ZodDate,...jr(e)});class Jk extends Zr{_parse(t){if(this._getType(t)!==An.symbol){const r=this._getOrReturnCtx(t);return On(r,{code:un.invalid_type,expected:An.symbol,received:r.parsedType}),Or}return Cc(t.data)}}Jk.create=e=>new Jk({typeName:Er.ZodSymbol,...jr(e)});class YO extends Zr{_parse(t){if(this._getType(t)!==An.undefined){const r=this._getOrReturnCtx(t);return On(r,{code:un.invalid_type,expected:An.undefined,received:r.parsedType}),Or}return Cc(t.data)}}YO.create=e=>new YO({typeName:Er.ZodUndefined,...jr(e)});class XO extends Zr{_parse(t){if(this._getType(t)!==An.null){const r=this._getOrReturnCtx(t);return On(r,{code:un.invalid_type,expected:An.null,received:r.parsedType}),Or}return Cc(t.data)}}XO.create=e=>new XO({typeName:Er.ZodNull,...jr(e)});class Ww extends Zr{constructor(){super(...arguments),this._any=!0}_parse(t){return Cc(t.data)}}Ww.create=e=>new Ww({typeName:Er.ZodAny,...jr(e)});class Z8 extends Zr{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Cc(t.data)}}Z8.create=e=>new Z8({typeName:Er.ZodUnknown,...jr(e)});class P0 extends Zr{_parse(t){const n=this._getOrReturnCtx(t);return On(n,{code:un.invalid_type,expected:An.never,received:n.parsedType}),Or}}P0.create=e=>new P0({typeName:Er.ZodNever,...jr(e)});class ez extends Zr{_parse(t){if(this._getType(t)!==An.undefined){const r=this._getOrReturnCtx(t);return On(r,{code:un.invalid_type,expected:An.void,received:r.parsedType}),Or}return Cc(t.data)}}ez.create=e=>new ez({typeName:Er.ZodVoid,...jr(e)});class Sg extends Zr{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==An.array)return On(n,{code:un.invalid_type,expected:An.array,received:n.parsedType}),Or;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,a=n.data.lengthi.maxLength.value&&(On(n,{code:un.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new bm(n,s,n.path,a)))).then(s=>ql.mergeArray(r,s));const o=[...n.data].map((s,a)=>i.type._parseSync(new bm(n,s,n.path,a)));return ql.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Sg({...this._def,minLength:{value:t,message:Yn.toString(n)}})}max(t,n){return new Sg({...this._def,maxLength:{value:t,message:Yn.toString(n)}})}length(t,n){return new Sg({...this._def,exactLength:{value:t,message:Yn.toString(n)}})}nonempty(t){return this.min(1,t)}}Sg.create=(e,t)=>new Sg({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Er.ZodArray,...jr(t)});function U5(e){if(e instanceof Yo){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=om.create(U5(r))}return new Yo({...e._def,shape:()=>t})}else return e instanceof Sg?new Sg({...e._def,type:U5(e.element)}):e instanceof om?om.create(U5(e.unwrap())):e instanceof H4?H4.create(U5(e.unwrap())):e instanceof Sm?Sm.create(e.items.map(t=>U5(t))):e}class Yo extends Zr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Mi.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==An.object){const c=this._getOrReturnCtx(t);return On(c,{code:un.invalid_type,expected:An.object,received:c.parsedType}),Or}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof P0&&this._def.unknownKeys==="strip"))for(const c in i.data)s.includes(c)||a.push(c);const l=[];for(const c of s){const u=o[c],f=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new bm(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof P0){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")a.length>0&&(On(i,{code:un.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const f=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new bm(i,f,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const f=await u.key,h=await u.value;c.push({key:f,value:h,alwaysSet:u.alwaysSet})}return c}).then(c=>ql.mergeObjectSync(r,c)):ql.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return Yn.errToObj,new Yo({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,s,a;const l=(s=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=Yn.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Yo({...this._def,unknownKeys:"strip"})}passthrough(){return new Yo({...this._def,unknownKeys:"passthrough"})}extend(t){return new Yo({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Yo({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Er.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Yo({...this._def,catchall:t})}pick(t){const n={};return Mi.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Yo({...this._def,shape:()=>n})}omit(t){const n={};return Mi.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Yo({...this._def,shape:()=>n})}deepPartial(){return U5(this)}partial(t){const n={};return Mi.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new Yo({...this._def,shape:()=>n})}required(t){const n={};return Mi.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof om;)o=o._def.innerType;n[r]=o}}),new Yo({...this._def,shape:()=>n})}keyof(){return FBe(Mi.objectKeys(this.shape))}}Yo.create=(e,t)=>new Yo({shape:()=>e,unknownKeys:"strip",catchall:P0.create(),typeName:Er.ZodObject,...jr(t)});Yo.strictCreate=(e,t)=>new Yo({shape:()=>e,unknownKeys:"strict",catchall:P0.create(),typeName:Er.ZodObject,...jr(t)});Yo.lazycreate=(e,t)=>new Yo({shape:e,unknownKeys:"strip",catchall:P0.create(),typeName:Er.ZodObject,...jr(t)});class QO extends Zr{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(a=>new cd(a.ctx.common.issues));return On(n,{code:un.invalid_union,unionErrors:s}),Or}if(n.common.async)return Promise.all(r.map(async o=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o;const s=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(l=>new cd(l));return On(n,{code:un.invalid_union,unionErrors:a}),Or}}get options(){return this._def.options}}QO.create=(e,t)=>new QO({options:e,typeName:Er.ZodUnion,...jr(t)});const B1=e=>e instanceof eT?B1(e.schema):e instanceof _g?B1(e.innerType()):e instanceof tT?[e.value]:e instanceof B4?e.options:e instanceof nT?Mi.objectValues(e.enum):e instanceof rT?B1(e._def.innerType):e instanceof YO?[void 0]:e instanceof XO?[null]:e instanceof om?[void 0,...B1(e.unwrap())]:e instanceof H4?[null,...B1(e.unwrap())]:e instanceof Vhe||e instanceof oT?B1(e.unwrap()):e instanceof iT?B1(e._def.innerType):[];class dj extends Zr{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==An.object)return On(n,{code:un.invalid_type,expected:An.object,received:n.parsedType}),Or;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(On(n,{code:un.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Or)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const s=B1(o.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of s){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,o)}}return new dj({typeName:Er.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...jr(r)})}}function Yse(e,t){const n=e0(e),r=e0(t);if(e===t)return{valid:!0,data:e};if(n===An.object&&r===An.object){const i=Mi.objectKeys(t),o=Mi.objectKeys(e).filter(a=>i.indexOf(a)!==-1),s={...e,...t};for(const a of o){const l=Yse(e[a],t[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===An.array&&r===An.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o{if(qse(o)||qse(s))return Or;const a=Yse(o.value,s.value);return a.valid?((Kse(o)||Kse(s))&&n.dirty(),{status:n.value,value:a.data}):(On(r,{code:un.invalid_intersection_types}),Or)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ZO.create=(e,t,n)=>new ZO({left:e,right:t,typeName:Er.ZodIntersection,...jr(n)});class Sm extends Zr{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==An.array)return On(r,{code:un.invalid_type,expected:An.array,received:r.parsedType}),Or;if(r.data.lengththis._def.items.length&&(On(r,{code:un.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((s,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new bm(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>ql.mergeArray(n,s)):ql.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Sm({...this._def,rest:t})}}Sm.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Sm({items:e,typeName:Er.ZodTuple,rest:null,...jr(t)})};class JO extends Zr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==An.object)return On(r,{code:un.invalid_type,expected:An.object,received:r.parsedType}),Or;const i=[],o=this._def.keyType,s=this._def.valueType;for(const a in r.data)i.push({key:o._parse(new bm(r,a,r.path,a)),value:s._parse(new bm(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?ql.mergeObjectAsync(n,i):ql.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Zr?new JO({keyType:t,valueType:n,typeName:Er.ZodRecord,...jr(r)}):new JO({keyType:fg.create(),valueType:t,typeName:Er.ZodRecord,...jr(n)})}}class tz extends Zr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==An.map)return On(r,{code:un.invalid_type,expected:An.map,received:r.parsedType}),Or;const i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,l],c)=>({key:i._parse(new bm(r,a,r.path,[c,"key"])),value:o._parse(new bm(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of s){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Or;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of s){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Or;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}tz.create=(e,t,n)=>new tz({valueType:t,keyType:e,typeName:Er.ZodMap,...jr(n)});class TC extends Zr{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==An.set)return On(r,{code:un.invalid_type,expected:An.set,received:r.parsedType}),Or;const i=this._def;i.minSize!==null&&r.data.sizei.maxSize.value&&(On(r,{code:un.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function s(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Or;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>o._parse(new bm(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(t,n){return new TC({...this._def,minSize:{value:t,message:Yn.toString(n)}})}max(t,n){return new TC({...this._def,maxSize:{value:t,message:Yn.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}TC.create=(e,t)=>new TC({valueType:e,minSize:null,maxSize:null,typeName:Er.ZodSet,...jr(t)});class WS extends Zr{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==An.function)return On(n,{code:un.invalid_type,expected:An.function,received:n.parsedType}),Or;function r(a,l){return Qk({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Xk(),Gw].filter(c=>!!c),issueData:{code:un.invalid_arguments,argumentsError:l}})}function i(a,l){return Qk({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Xk(),Gw].filter(c=>!!c),issueData:{code:un.invalid_return_type,returnTypeError:l}})}const o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof Uw){const a=this;return Cc(async function(...l){const c=new cd([]),u=await a._def.args.parseAsync(l,o).catch(g=>{throw c.addIssue(r(l,g)),c}),f=await Reflect.apply(s,this,u);return await a._def.returns._def.type.parseAsync(f,o).catch(g=>{throw c.addIssue(i(f,g)),c})})}else{const a=this;return Cc(function(...l){const c=a._def.args.safeParse(l,o);if(!c.success)throw new cd([r(l,c.error)]);const u=Reflect.apply(s,this,c.data),f=a._def.returns.safeParse(u,o);if(!f.success)throw new cd([i(u,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new WS({...this._def,args:Sm.create(t).rest(Z8.create())})}returns(t){return new WS({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new WS({args:t||Sm.create([]).rest(Z8.create()),returns:n||Z8.create(),typeName:Er.ZodFunction,...jr(r)})}}class eT extends Zr{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}eT.create=(e,t)=>new eT({getter:e,typeName:Er.ZodLazy,...jr(t)});class tT extends Zr{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return On(n,{received:n.data,code:un.invalid_literal,expected:this._def.value}),Or}return{status:"valid",value:t.data}}get value(){return this._def.value}}tT.create=(e,t)=>new tT({value:e,typeName:Er.ZodLiteral,...jr(t)});function FBe(e,t){return new B4({values:e,typeName:Er.ZodEnum,...jr(t)})}class B4 extends Zr{constructor(){super(...arguments),JR.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return On(n,{expected:Mi.joinValues(r),received:n.parsedType,code:un.invalid_type}),Or}if(Zk(this,JR)||_Be(this,JR,new Set(this._def.values)),!Zk(this,JR).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return On(n,{received:n.data,code:un.invalid_enum_value,options:r}),Or}return Cc(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return B4.create(t,{...this._def,...n})}exclude(t,n=this._def){return B4.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}JR=new WeakMap;B4.create=FBe;class nT extends Zr{constructor(){super(...arguments),e$.set(this,void 0)}_parse(t){const n=Mi.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==An.string&&r.parsedType!==An.number){const i=Mi.objectValues(n);return On(r,{expected:Mi.joinValues(i),received:r.parsedType,code:un.invalid_type}),Or}if(Zk(this,e$)||_Be(this,e$,new Set(Mi.getValidEnumValues(this._def.values))),!Zk(this,e$).has(t.data)){const i=Mi.objectValues(n);return On(r,{received:r.data,code:un.invalid_enum_value,options:i}),Or}return Cc(t.data)}get enum(){return this._def.values}}e$=new WeakMap;nT.create=(e,t)=>new nT({values:e,typeName:Er.ZodNativeEnum,...jr(t)});class Uw extends Zr{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==An.promise&&n.common.async===!1)return On(n,{code:un.invalid_type,expected:An.promise,received:n.parsedType}),Or;const r=n.parsedType===An.promise?n.data:Promise.resolve(n.data);return Cc(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Uw.create=(e,t)=>new Uw({type:e,typeName:Er.ZodPromise,...jr(t)});class _g extends Zr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Er.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:s=>{On(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const s=i.transform(r.data,o);if(r.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return Or;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?Or:l.status==="dirty"||n.value==="dirty"?bS(l.value):l});{if(n.value==="aborted")return Or;const a=this._def.schema._parseSync({data:s,path:r.path,parent:r});return a.status==="aborted"?Or:a.status==="dirty"||n.value==="dirty"?bS(a.value):a}}if(i.type==="refinement"){const s=a=>{const l=i.refinement(a,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Or:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Or:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!$C(s))return s;const a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>$C(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):s);Mi.assertNever(i)}}_g.create=(e,t,n)=>new _g({schema:e,typeName:Er.ZodEffects,effect:t,...jr(n)});_g.createWithPreprocess=(e,t,n)=>new _g({schema:t,effect:{type:"preprocess",transform:e},typeName:Er.ZodEffects,...jr(n)});class om extends Zr{_parse(t){return this._getType(t)===An.undefined?Cc(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}om.create=(e,t)=>new om({innerType:e,typeName:Er.ZodOptional,...jr(t)});class H4 extends Zr{_parse(t){return this._getType(t)===An.null?Cc(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}H4.create=(e,t)=>new H4({innerType:e,typeName:Er.ZodNullable,...jr(t)});class rT extends Zr{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===An.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}rT.create=(e,t)=>new rT({innerType:e,typeName:Er.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...jr(t)});class iT extends Zr{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return qO(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new cd(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new cd(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}iT.create=(e,t)=>new iT({innerType:e,typeName:Er.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...jr(t)});class nz extends Zr{_parse(t){if(this._getType(t)!==An.nan){const r=this._getOrReturnCtx(t);return On(r,{code:un.invalid_type,expected:An.nan,received:r.parsedType}),Or}return{status:"valid",value:t.data}}}nz.create=e=>new nz({typeName:Er.ZodNaN,...jr(e)});const b5t=Symbol("zod_brand");class Vhe extends Zr{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class kI extends Zr{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Or:o.status==="dirty"?(n.dirty(),bS(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Or:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new kI({in:t,out:n,typeName:Er.ZodPipeline})}}class oT extends Zr{_parse(t){const n=this._def.innerType._parse(t),r=i=>($C(i)&&(i.value=Object.freeze(i.value)),i);return qO(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}oT.create=(e,t)=>new oT({innerType:e,typeName:Er.ZodReadonly,...jr(t)});function NBe(e,t={},n){return e?Ww.create().superRefine((r,i)=>{var o,s;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(s=(o=a.fatal)!==null&&o!==void 0?o:n)!==null&&s!==void 0?s:!0,c=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...c,fatal:l})}}):Ww.create()}const S5t={object:Yo.lazycreate};var Er;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Er||(Er={}));const w5t=(e,t={message:`Input not instance of ${e.name}`})=>NBe(n=>n instanceof e,t),kBe=fg.create,zBe=k4.create,x5t=nz.create,E5t=z4.create,BBe=KO.create,R5t=OC.create,$5t=Jk.create,O5t=YO.create,T5t=XO.create,I5t=Ww.create,M5t=Z8.create,P5t=P0.create,_5t=ez.create,A5t=Sg.create,D5t=Yo.create,L5t=Yo.strictCreate,F5t=QO.create,N5t=dj.create,k5t=ZO.create,z5t=Sm.create,B5t=JO.create,H5t=tz.create,j5t=TC.create,V5t=WS.create,G5t=eT.create,W5t=tT.create,U5t=B4.create,q5t=nT.create,K5t=Uw.create,kbe=_g.create,Y5t=om.create,X5t=H4.create,Q5t=_g.createWithPreprocess,Z5t=kI.create,J5t=()=>kBe().optional(),eSt=()=>zBe().optional(),tSt=()=>BBe().optional(),nSt={string:e=>fg.create({...e,coerce:!0}),number:e=>k4.create({...e,coerce:!0}),boolean:e=>KO.create({...e,coerce:!0}),bigint:e=>z4.create({...e,coerce:!0}),date:e=>OC.create({...e,coerce:!0})},rSt=Or;var Oe=Object.freeze({__proto__:null,defaultErrorMap:Gw,setErrorMap:Qbt,getErrorMap:Xk,makeIssue:Qk,EMPTY_PATH:Zbt,addIssueToContext:On,ParseStatus:ql,INVALID:Or,DIRTY:bS,OK:Cc,isAborted:qse,isDirty:Kse,isValid:$C,isAsync:qO,get util(){return Mi},get objectUtil(){return Use},ZodParsedType:An,getParsedType:e0,ZodType:Zr,datetimeRegex:LBe,ZodString:fg,ZodNumber:k4,ZodBigInt:z4,ZodBoolean:KO,ZodDate:OC,ZodSymbol:Jk,ZodUndefined:YO,ZodNull:XO,ZodAny:Ww,ZodUnknown:Z8,ZodNever:P0,ZodVoid:ez,ZodArray:Sg,ZodObject:Yo,ZodUnion:QO,ZodDiscriminatedUnion:dj,ZodIntersection:ZO,ZodTuple:Sm,ZodRecord:JO,ZodMap:tz,ZodSet:TC,ZodFunction:WS,ZodLazy:eT,ZodLiteral:tT,ZodEnum:B4,ZodNativeEnum:nT,ZodPromise:Uw,ZodEffects:_g,ZodTransformer:_g,ZodOptional:om,ZodNullable:H4,ZodDefault:rT,ZodCatch:iT,ZodNaN:nz,BRAND:b5t,ZodBranded:Vhe,ZodPipeline:kI,ZodReadonly:oT,custom:NBe,Schema:Zr,ZodSchema:Zr,late:S5t,get ZodFirstPartyTypeKind(){return Er},coerce:nSt,any:I5t,array:A5t,bigint:E5t,boolean:BBe,date:R5t,discriminatedUnion:N5t,effect:kbe,enum:U5t,function:V5t,instanceof:w5t,intersection:k5t,lazy:G5t,literal:W5t,map:H5t,nan:x5t,nativeEnum:q5t,never:P5t,null:T5t,nullable:X5t,number:zBe,object:D5t,oboolean:tSt,onumber:eSt,optional:Y5t,ostring:J5t,pipeline:Z5t,preprocess:Q5t,promise:K5t,record:B5t,set:j5t,strictObject:L5t,string:kBe,symbol:$5t,transformer:kbe,tuple:z5t,undefined:O5t,union:F5t,unknown:M5t,void:_5t,NEVER:rSt,ZodIssueCode:un,quotelessJson:Xbt,ZodError:cd});const j4=Math.floor,qF=Math.abs,Ghe=(e,t)=>ee>t?e:t,iSt=Math.pow,HBe=e=>e!==0?e<0:1/e<0,zbe=1,Bbe=2,tee=4,nee=8,sT=32,g0=64,ud=128,fj=31,Xse=63,J8=127,oSt=2147483647,jBe=Number.MAX_SAFE_INTEGER,sSt=Number.isInteger||(e=>typeof e=="number"&&isFinite(e)&&j4(e)===e),V4=()=>new Set,ree=e=>e[e.length-1],aSt=(e,t)=>{for(let n=0;ne.toLowerCase(),dSt=/^\s*/g,fSt=e=>e.replace(dSt,""),hSt=/([A-Z])/g,Hbe=(e,t)=>fSt(e.replace(hSt,n=>`${t}${uSt(n)}`)),gSt=e=>{const t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let i=0;iaT.encode(e),mSt=aT?pSt:gSt;let N$=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});N$&&N$.decode(new Uint8Array).length===1&&(N$=null);class zI{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const Il=()=>new zI,Whe=e=>{let t=e.cpos;for(let n=0;n{const t=new Uint8Array(Whe(e));let n=0;for(let r=0;r{const n=e.cbuf.length;n-e.cpos{const n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},Qse=Ea,or=(e,t)=>{for(;t>J8;)Ea(e,ud|J8&t),t=j4(t/128);Ea(e,J8&t)},Uhe=(e,t)=>{const n=HBe(t);for(n&&(t=-t),Ea(e,(t>Xse?ud:0)|(n?g0:0)|Xse&t),t=j4(t/64);t>0;)Ea(e,(t>J8?ud:0)|J8&t),t=j4(t/128)},Zse=new Uint8Array(3e4),CSt=Zse.length/3,ySt=(e,t)=>{if(t.length{const n=unescape(encodeURIComponent(t)),r=n.length;or(e,r);for(let i=0;i{const n=e.cbuf.length,r=e.cpos,i=Ghe(n-r,t.length),o=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,o>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(Ty(n*2,o)),e.cbuf.set(t.subarray(i)),e.cpos=o)},ws=(e,t)=>{or(e,t.byteLength),hj(e,t)},qhe=(e,t)=>{vSt(e,t);const n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},SSt=(e,t)=>qhe(e,4).setFloat32(0,t,!1),wSt=(e,t)=>qhe(e,8).setFloat64(0,t,!1),xSt=(e,t)=>qhe(e,8).setBigInt64(0,t,!1),jbe=new DataView(new ArrayBuffer(4)),ESt=e=>(jbe.setFloat32(0,e),jbe.getFloat32(0)===e),lT=(e,t)=>{switch(typeof t){case"string":Ea(e,119),eC(e,t);break;case"number":sSt(t)&&qF(t)<=oSt?(Ea(e,125),Uhe(e,t)):ESt(t)?(Ea(e,124),SSt(e,t)):(Ea(e,123),wSt(e,t));break;case"bigint":Ea(e,122),xSt(e,t);break;case"object":if(t===null)Ea(e,126);else if(lSt(t)){Ea(e,117),or(e,t.length);for(let n=0;n0&&or(this,this.count-1),this.count=1,this.w(this,t),this.s=t)}}const Gbe=e=>{e.count>0&&(Uhe(e.encoder,e.count===1?e.s:-e.s),e.count>1&&or(e.encoder,e.count-2))};class KF{constructor(){this.encoder=new zI,this.s=0,this.count=0}write(t){this.s===t?this.count++:(Gbe(this),this.count=1,this.s=t)}toUint8Array(){return Gbe(this),zo(this.encoder)}}const Wbe=e=>{if(e.count>0){const t=e.diff*2+(e.count===1?0:1);Uhe(e.encoder,t),e.count>1&&or(e.encoder,e.count-2)}};class iee{constructor(){this.encoder=new zI,this.s=0,this.count=0,this.diff=0}write(t){this.diff===t-this.s?(this.s=t,this.count++):(Wbe(this),this.count=1,this.diff=t-this.s,this.s=t)}toUint8Array(){return Wbe(this),zo(this.encoder)}}class RSt{constructor(){this.sarr=[],this.s="",this.lensE=new KF}write(t){this.s+=t,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(t.length)}toUint8Array(){const t=new zI;return this.sarr.push(this.s),this.s="",eC(t,this.sarr.join("")),hj(t,this.lensE.toUint8Array()),zo(t)}}const G4=e=>new Error(e),sm=()=>{throw G4("Method unimplemented")},wm=()=>{throw G4("Unexpected case")},VBe=G4("Unexpected end of array"),GBe=G4("Integer out of Range");class gj{constructor(t){this.arr=t,this.pos=0}}const m3=e=>new gj(e),$St=e=>e.pos!==e.arr.length,OSt=(e,t)=>{const n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},$l=e=>OSt(e,Lr(e)),qw=e=>e.arr[e.pos++],Lr=e=>{let t=0,n=1;const r=e.arr.length;for(;e.posjBe)throw GBe}throw VBe},Khe=e=>{let t=e.arr[e.pos++],n=t&Xse,r=64;const i=(t&g0)>0?-1:1;if(!(t&ud))return i*n;const o=e.arr.length;for(;e.posjBe)throw GBe}throw VBe},TSt=e=>{let t=Lr(e);if(t===0)return"";{let n=String.fromCodePoint(qw(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(qw(e));else for(;t>0;){const r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},ISt=e=>N$.decode($l(e)),m4=N$?ISt:TSt,Yhe=(e,t)=>{const n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},MSt=e=>Yhe(e,4).getFloat32(0,!1),PSt=e=>Yhe(e,8).getFloat64(0,!1),_St=e=>Yhe(e,8).getBigInt64(0,!1),ASt=[e=>{},e=>null,Khe,MSt,PSt,_St,e=>!1,e=>!0,m4,e=>{const t=Lr(e),n={};for(let r=0;r{const t=Lr(e),n=[];for(let r=0;rASt[127-qw(e)](e);class Ube extends gj{constructor(t,n){super(t),this.reader=n,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),$St(this)?this.count=Lr(this)+1:this.count=-1),this.count--,this.s}}class YF extends gj{constructor(t){super(t),this.s=0,this.count=0}read(){if(this.count===0){this.s=Khe(this);const t=HBe(this.s);this.count=1,t&&(this.s=-this.s,this.count=Lr(this)+2)}return this.count--,this.s}}class oee extends gj{constructor(t){super(t),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){const t=Khe(this),n=t&1;this.diff=j4(t/2),this.count=1,n&&(this.count=Lr(this)+2)}return this.s+=this.diff,this.count--,this.s}}let DSt=class{constructor(t){this.decoder=new YF(t),this.str=m4(this.decoder),this.spos=0}read(){const t=this.spos+this.decoder.read(),n=this.str.slice(this.spos,t);return this.spos=t,n}};const Kw=Date.now,hu=()=>new Map,Jse=e=>{const t=hu();return e.forEach((n,r)=>{t.set(r,n)}),t},Vm=(e,t,n)=>{let r=e.get(t);return r===void 0&&e.set(t,r=n()),r},LSt=(e,t)=>{const n=[];for(const[r,i]of e)n.push(t(i,r));return n},FSt=(e,t)=>{for(const[n,r]of e)if(t(r,n))return!0;return!1};class NSt{constructor(){this._observers=hu()}on(t,n){return Vm(this._observers,t,V4).add(n),n}once(t,n){const r=(...i)=>{this.off(t,r),n(...i)};this.on(t,r)}off(t,n){const r=this._observers.get(t);r!==void 0&&(r.delete(n),r.size===0&&this._observers.delete(t))}emit(t,n){return _0((this._observers.get(t)||hu()).values()).forEach(r=>r(...n))}destroy(){this._observers=hu()}}class WBe{constructor(){this._observers=hu()}on(t,n){Vm(this._observers,t,V4).add(n)}once(t,n){const r=(...i)=>{this.off(t,r),n(...i)};this.on(t,r)}off(t,n){const r=this._observers.get(t);r!==void 0&&(r.delete(n),r.size===0&&this._observers.delete(t))}emit(t,n){return _0((this._observers.get(t)||hu()).values()).forEach(r=>r(...n))}destroy(){this._observers=hu()}}const kSt=Object.assign,UBe=Object.keys,zSt=(e,t)=>{for(const n in e)t(e[n],n)},BSt=(e,t)=>{const n=[];for(const r in e)n.push(t(e[r],r));return n},qbe=e=>UBe(e).length,Kbe=e=>UBe(e).length,HSt=e=>{for(const t in e)return!1;return!0},jSt=(e,t)=>{for(const n in e)if(!t(e[n],n))return!1;return!0},qBe=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),VSt=(e,t)=>e===t||Kbe(e)===Kbe(t)&&jSt(e,(n,r)=>(n!==void 0||qBe(t,r))&&t[r]===n),GSt=Object.freeze,KBe=e=>{for(const t in e){const n=e[t];(typeof n=="object"||typeof n=="function")&&KBe(e[t])}return GSt(e)},Xhe=(e,t,n=0)=>{try{for(;ne,USt=(e,t)=>e===t,k$=(e,t)=>{if(e==null||t==null)return USt(e,t);if(e.constructor!==t.constructor)return!1;if(e===t)return!0;switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:{if(e.byteLength!==t.byteLength)return!1;for(let n=0;nt.includes(e),Ybe=e=>e===void 0?null:e;class KSt{constructor(){this.map=new Map}setItem(t,n){this.map.set(t,n)}getItem(t){return this.map.get(t)}}let YBe=new KSt,Qhe=!0;try{typeof localStorage<"u"&&localStorage&&(YBe=localStorage,Qhe=!1)}catch{}const XBe=YBe,YSt=e=>Qhe||addEventListener("storage",e),XSt=e=>Qhe||removeEventListener("storage",e);var QBe={};const W4=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]",ZBe=typeof window<"u"&&typeof document<"u"&&!W4;let vp;const QSt=()=>{if(vp===void 0)if(W4){vp=hu();const e=process.argv;let t=null;for(let n=0;n{if(e.length!==0){const[t,n]=e.split("=");vp.set(`--${Hbe(t,"-")}`,n),vp.set(`-${Hbe(t,"-")}`,n)}})):vp=hu();return vp},eae=e=>QSt().has(e),rz=e=>Ybe(W4?QBe[e.toUpperCase().replaceAll("-","_")]:XBe.getItem(e)),JBe=e=>eae("--"+e)||rz(e)!==null;JBe("production");const ZSt=W4&&qSt(QBe.FORCE_COLOR,["true","1","2"]),JSt=ZSt||!eae("--no-colors")&&!JBe("no-color")&&(!W4||process.stdout.isTTY)&&(!W4||eae("--color")||rz("COLORTERM")!==null||(rz("TERM")||"").includes("color")),eHe=e=>new Uint8Array(e),ewt=(e,t,n)=>new Uint8Array(e,t,n),twt=e=>new Uint8Array(e),nwt=e=>{let t="";for(let n=0;nBuffer.from(e.buffer,e.byteOffset,e.byteLength).toString("base64"),iwt=e=>{const t=atob(e),n=eHe(t.length);for(let r=0;r{const t=Buffer.from(e,"base64");return ewt(t.buffer,t.byteOffset,t.byteLength)},swt=ZBe?nwt:rwt,awt=ZBe?iwt:owt,lwt=e=>{const t=eHe(e.byteLength);return t.set(e),t},tHe=new Map;class cwt{constructor(t){this.room=t,this.onmessage=null,this._onChange=n=>n.key===t&&this.onmessage!==null&&this.onmessage({data:awt(n.newValue||"")}),YSt(this._onChange)}postMessage(t){XBe.setItem(this.room,swt(twt(t)))}close(){XSt(this._onChange)}}const uwt=typeof BroadcastChannel>"u"?cwt:BroadcastChannel,Zhe=e=>Vm(tHe,e,()=>{const t=V4(),n=new uwt(e);return n.onmessage=r=>t.forEach(i=>i(r.data,"broadcastchannel")),{bc:n,subs:t}}),dwt=(e,t)=>(Zhe(e).subs.add(t),t),fwt=(e,t)=>{const n=Zhe(e),r=n.subs.delete(t);return r&&n.subs.size===0&&(n.bc.close(),tHe.delete(e)),r},q5=(e,t,n=null)=>{const r=Zhe(e);r.bc.postMessage(t),r.subs.forEach(i=>i(t,n))},hwt=crypto.getRandomValues.bind(crypto),nHe=()=>hwt(new Uint32Array(1))[0],gwt="10000000-1000-4000-8000"+-1e11,pwt=()=>gwt.replace(/[018]/g,e=>(e^nHe()&15>>e/4).toString(16)),Xbe=e=>new Promise(e);Promise.all.bind(Promise);class mwt{constructor(t,n){this.left=t,this.right=n}}const b1=(e,t)=>new mwt(e,t);typeof DOMParser<"u"&&new DOMParser;const vwt=e=>LSt(e,(t,n)=>`${n}:${t};`).join(""),J0=Symbol,rHe=J0(),iHe=J0(),Cwt=J0(),ywt=J0(),bwt=J0(),oHe=J0(),Swt=J0(),Jhe=J0(),wwt=J0(),xwt=e=>{var i;e.length===1&&((i=e[0])==null?void 0:i.constructor)===Function&&(e=e[0]());const t=[],n=[];let r=0;for(;r0&&n.push(t.join(""));r{var s;e.length===1&&((s=e[0])==null?void 0:s.constructor)===Function&&(e=e[0]());const t=[],n=[],r=hu();let i=[],o=0;for(;o0||c.length>0?(t.push("%c"+a),n.push(c)):t.push(a)}else break}}for(o>0&&(i=n,i.unshift(t.join("")));o{console.log(...sHe(e)),aHe.forEach(t=>t.print(e))},Owt=(...e)=>{console.warn(...sHe(e)),e.unshift(Jhe),aHe.forEach(t=>t.print(e))},aHe=V4(),lHe=e=>({[Symbol.iterator](){return this},next:e}),Twt=(e,t)=>lHe(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),see=(e,t)=>lHe(()=>{const{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}});class ege{constructor(t,n){this.clock=t,this.len=n}}class BI{constructor(){this.clients=new Map}}const cHe=(e,t,n)=>t.clients.forEach((r,i)=>{const o=e.doc.store.clients.get(i);for(let s=0;s{let n=0,r=e.length-1;for(;n<=r;){const i=j4((n+r)/2),o=e[i],s=o.clock;if(s<=t){if(t{const n=e.clients.get(t.client);return n!==void 0&&Iwt(n,t.clock)!==null},tge=e=>{e.clients.forEach(t=>{t.sort((i,o)=>i.clock-o.clock);let n,r;for(n=1,r=1;n=o.clock?i.len=Ty(i.len,o.clock+o.len-i.clock):(r{const t=new BI;for(let n=0;n{if(!t.clients.has(i)){const o=r.slice();for(let s=n+1;s{Vm(e.clients,t,()=>[]).push(new ege(n,r))},Pwt=()=>new BI,_wt=e=>{const t=Pwt();return e.clients.forEach((n,r)=>{const i=[];for(let o=0;o0&&t.clients.set(r,i)}),t},Dx=(e,t)=>{or(e.restEncoder,t.clients.size),_0(t.clients.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{e.resetDsCurVal(),or(e.restEncoder,n);const i=r.length;or(e.restEncoder,i);for(let o=0;o{const t=new BI,n=Lr(e.restDecoder);for(let r=0;r0){const s=Vm(t.clients,i,()=>[]);for(let a=0;a{const r=new BI,i=Lr(e.restDecoder);for(let o=0;o0){const o=new IC;return or(o.restEncoder,0),Dx(o,r),o.toUint8Array()}return null},dHe=nHe;class Lx extends NSt{constructor({guid:t=pwt(),collectionid:n=null,gc:r=!0,gcFilter:i=()=>!0,meta:o=null,autoLoad:s=!1,shouldLoad:a=!0}={}){super(),this.gc=r,this.gcFilter=i,this.clientID=dHe(),this.guid=t,this.collectionid=n,this.share=new Map,this.store=new bHe,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=a,this.autoLoad=s,this.meta=o,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=Xbe(c=>{this.on("load",()=>{this.isLoaded=!0,c(this)})});const l=()=>Xbe(c=>{const u=f=>{(f===void 0||f===!0)&&(this.off("sync",u),c())};this.on("sync",u)});this.on("sync",c=>{c===!1&&this.isSynced&&(this.whenSynced=l()),this.isSynced=c===void 0||c===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=l()}load(){const t=this._item;t!==null&&!this.shouldLoad&&wo(t.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(_0(this.subdocs).map(t=>t.guid))}transact(t,n=null){return wo(this,t,n)}get(t,n=ol){const r=Vm(this.share,t,()=>{const o=new n;return o._integrate(this,null),o}),i=r.constructor;if(n!==ol&&i!==n)if(i===ol){const o=new n;o._map=r._map,r._map.forEach(s=>{for(;s!==null;s=s.left)s.parent=o}),o._start=r._start;for(let s=o._start;s!==null;s=s.right)s.parent=o;return o._length=r._length,this.share.set(t,o),o._integrate(this,null),o}else throw new Error(`Type with the name ${t} has already been defined with a different constructor`);return r}getArray(t=""){return this.get(t,qS)}getText(t=""){return this.get(t,Qw)}getMap(t=""){return this.get(t,Xw)}getXmlElement(t=""){return this.get(t,Zw)}getXmlFragment(t=""){return this.get(t,MC)}toJSON(){const t={};return this.share.forEach((n,r)=>{t[r]=n.toJSON()}),t}destroy(){this.isDestroyed=!0,_0(this.subdocs).forEach(n=>n.destroy());const t=this._item;if(t!==null){this._item=null;const n=t.content;n.doc=new Lx({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=t,wo(t.parent.doc,r=>{const i=n.doc;t.deleted||r.subdocsAdded.add(i),r.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class fHe{constructor(t){this.restDecoder=t}resetDsCurVal(){}readDsClock(){return Lr(this.restDecoder)}readDsLen(){return Lr(this.restDecoder)}}class hHe extends fHe{readLeftID(){return Ri(Lr(this.restDecoder),Lr(this.restDecoder))}readRightID(){return Ri(Lr(this.restDecoder),Lr(this.restDecoder))}readClient(){return Lr(this.restDecoder)}readInfo(){return qw(this.restDecoder)}readString(){return m4(this.restDecoder)}readParentInfo(){return Lr(this.restDecoder)===1}readTypeRef(){return Lr(this.restDecoder)}readLen(){return Lr(this.restDecoder)}readAny(){return cT(this.restDecoder)}readBuf(){return lwt($l(this.restDecoder))}readJSON(){return JSON.parse(m4(this.restDecoder))}readKey(){return m4(this.restDecoder)}}class Awt{constructor(t){this.dsCurrVal=0,this.restDecoder=t}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=Lr(this.restDecoder),this.dsCurrVal}readDsLen(){const t=Lr(this.restDecoder)+1;return this.dsCurrVal+=t,t}}class Yw extends Awt{constructor(t){super(t),this.keys=[],Lr(t),this.keyClockDecoder=new oee($l(t)),this.clientDecoder=new YF($l(t)),this.leftClockDecoder=new oee($l(t)),this.rightClockDecoder=new oee($l(t)),this.infoDecoder=new Ube($l(t),qw),this.stringDecoder=new DSt($l(t)),this.parentInfoDecoder=new Ube($l(t),qw),this.typeRefDecoder=new YF($l(t)),this.lenDecoder=new YF($l(t))}readLeftID(){return new US(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new US(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return cT(this.restDecoder)}readBuf(){return $l(this.restDecoder)}readJSON(){return cT(this.restDecoder)}readKey(){const t=this.keyClockDecoder.read();if(t{r=Ty(r,t[0].id.clock);const i=xm(t,r);or(e.restEncoder,t.length-i),e.writeClient(n),or(e.restEncoder,r);const o=t[i];o.write(e,r-o.id.clock);for(let s=i+1;s{const r=new Map;n.forEach((i,o)=>{Pa(t,o)>i&&r.set(o,i)}),pj(t).forEach((i,o)=>{n.has(o)||r.set(o,0)}),or(e.restEncoder,r.size),_0(r.entries()).sort((i,o)=>o[0]-i[0]).forEach(([i,o])=>{Dwt(e,t.clients.get(i),i,o)})},Lwt=(e,t)=>{const n=hu(),r=Lr(e.restDecoder);for(let i=0;i{const r=[];let i=_0(n.keys()).sort((g,p)=>g-p);if(i.length===0)return null;const o=()=>{if(i.length===0)return null;let g=n.get(i[i.length-1]);for(;g.refs.length===g.i;)if(i.pop(),i.length>0)g=n.get(i[i.length-1]);else return null;return g};let s=o();if(s===null)return null;const a=new bHe,l=new Map,c=(g,p)=>{const m=l.get(g);(m==null||m>p)&&l.set(g,p)};let u=s.refs[s.i++];const f=new Map,h=()=>{for(const g of r){const p=g.id.client,m=n.get(p);m?(m.i--,a.clients.set(p,m.refs.slice(m.i)),n.delete(p),m.i=0,m.refs=[]):a.clients.set(p,[g]),i=i.filter(v=>v!==p)}r.length=0};for(;;){if(u.constructor!==Tf){const p=Vm(f,u.id.client,()=>Pa(t,u.id.client))-u.id.clock;if(p<0)r.push(u),c(u.id.client,u.id.clock-1),h();else{const m=u.getMissing(e,t);if(m!==null){r.push(u);const v=n.get(m)||{refs:[],i:0};if(v.refs.length===v.i)c(m,Pa(t,m)),h();else{u=v.refs[v.i++];continue}}else(p===0||p0)u=r.pop();else if(s!==null&&s.i0){const g=new IC;return rge(g,a,new Map),or(g.restEncoder,0),{missing:l,update:g.toUint8Array()}}return null},Nwt=(e,t)=>rge(e,t.doc.store,t.beforeState),kwt=(e,t,n,r=new Yw(e))=>wo(t,i=>{i.local=!1;let o=!1;const s=i.doc,a=s.store,l=Lwt(r,s),c=Fwt(i,a,l),u=a.pendingStructs;if(u){for(const[h,g]of u.missing)if(gg)&&u.missing.set(h,g)}u.update=oz([u.update,c.update])}}else a.pendingStructs=c;const f=Qbe(r,i,a);if(a.pendingDs){const h=new Yw(m3(a.pendingDs));Lr(h.restDecoder);const g=Qbe(h,i,a);f&&g?a.pendingDs=oz([f,g]):a.pendingDs=f||g}else a.pendingDs=f;if(o){const h=a.pendingStructs.update;a.pendingStructs=null,mHe(i.doc,h)}},n,!1),mHe=(e,t,n,r=Yw)=>{const i=m3(t);kwt(i,e,n,new r(i))},zwt=(e,t,n)=>mHe(e,t,n,hHe),Bwt=(e,t,n=new Map)=>{rge(e,t.store,n),Dx(e,_wt(t.store))},Hwt=(e,t=new Uint8Array([0]),n=new IC)=>{const r=vHe(t);Bwt(n,e,r);const i=[n.toUint8Array()];if(e.store.pendingDs&&i.push(e.store.pendingDs),e.store.pendingStructs&&i.push(r7t(e.store.pendingStructs.update,t)),i.length>1){if(n.constructor===HI)return t7t(i.map((o,s)=>s===0?o:o7t(o)));if(n.constructor===IC)return oz(i)}return i[0]},jwt=(e,t)=>Hwt(e,t,new HI),Vwt=e=>{const t=new Map,n=Lr(e.restDecoder);for(let r=0;rVwt(new fHe(m3(e))),CHe=(e,t)=>(or(e.restEncoder,t.size),_0(t.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{or(e.restEncoder,n),or(e.restEncoder,r)}),e),Gwt=(e,t)=>CHe(e,pj(t.store)),Wwt=(e,t=new pHe)=>(e instanceof Map?CHe(t,e):Gwt(t,e),t.toUint8Array()),Uwt=e=>Wwt(e,new gHe);class qwt{constructor(){this.l=[]}}const Zbe=()=>new qwt,Jbe=(e,t)=>e.l.push(t),e5e=(e,t)=>{const n=e.l,r=n.length;e.l=n.filter(i=>t!==i),r===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},yHe=(e,t,n)=>Xhe(e.l,[t,n]);class US{constructor(t,n){this.client=t,this.clock=n}}const sD=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,Ri=(e,t)=>new US(e,t),Kwt=e=>{for(const[t,n]of e.doc.share.entries())if(n===e)return t;throw wm()},K5=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!uHe(t.ds,e.id),tae=(e,t)=>{const n=Vm(e.meta,tae,V4),r=e.doc.store;n.has(t)||(t.sv.forEach((i,o)=>{i{}),n.add(t))};class bHe{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const pj=e=>{const t=new Map;return e.clients.forEach((n,r)=>{const i=n[n.length-1];t.set(r,i.id.clock+i.length)}),t},Pa=(e,t)=>{const n=e.clients.get(t);if(n===void 0)return 0;const r=n[n.length-1];return r.id.clock+r.length},SHe=(e,t)=>{let n=e.clients.get(t.id.client);if(n===void 0)n=[],e.clients.set(t.id.client,n);else{const r=n[n.length-1];if(r.id.clock+r.length!==t.id.clock)throw wm()}n.push(t)},xm=(e,t)=>{let n=0,r=e.length-1,i=e[r],o=i.id.clock;if(o===t)return r;let s=j4(t/(o+i.length-1)*r);for(;n<=r;){if(i=e[s],o=i.id.clock,o<=t){if(t{const n=e.clients.get(t.client);return n[xm(n,t.clock)]},aee=Ywt,nae=(e,t,n)=>{const r=xm(t,n),i=t[r];return i.id.clock{const n=e.doc.store.clients.get(t.client);return n[nae(e,n,t.clock)]},t5e=(e,t,n)=>{const r=t.clients.get(n.client),i=xm(r,n.clock),o=r[i];return n.clock!==o.id.clock+o.length-1&&o.constructor!==Of&&r.splice(i+1,0,dz(e,o,n.clock-o.id.clock+1)),o},Xwt=(e,t,n)=>{const r=e.clients.get(t.id.client);r[xm(r,t.id.clock)]=n},wHe=(e,t,n,r,i)=>{if(r===0)return;const o=n+r;let s=nae(e,t,n),a;do a=t[s++],ot.deleteSet.clients.size===0&&!FSt(t.afterState,(n,r)=>t.beforeState.get(r)!==n)?!1:(tge(t.deleteSet),Nwt(e,t),Dx(e,t.deleteSet),!0),r5e=(e,t,n)=>{const r=t._item;(r===null||r.id.clock<(e.beforeState.get(r.id.client)||0)&&!r.deleted)&&Vm(e.changed,t,V4).add(n)},XF=(e,t)=>{let n=e[t],r=e[t-1],i=t;for(;i>0;n=r,r=e[--i-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof zl&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}const o=t-i;return o&&e.splice(t+1-o,o),o},Zwt=(e,t,n)=>{for(const[r,i]of e.clients.entries()){const o=t.clients.get(r);for(let s=i.length-1;s>=0;s--){const a=i[s],l=a.clock+a.len;for(let c=xm(o,a.clock),u=o[c];c{e.clients.forEach((n,r)=>{const i=t.clients.get(r);for(let o=n.length-1;o>=0;o--){const s=n[o],a=Ghe(i.length-1,1+xm(i,s.clock+s.len-1));for(let l=a,c=i[l];l>0&&c.id.clock>=s.clock;c=i[l])l-=1+XF(i,l)}})},xHe=(e,t)=>{if(ta.push(()=>{(c._item===null||!c._item.deleted)&&c._callObserver(n,l)})),a.push(()=>{n.changedParentTypes.forEach((l,c)=>{c._dEH.l.length>0&&(c._item===null||!c._item.deleted)&&(l=l.filter(u=>u.target._item===null||!u.target._item.deleted),l.forEach(u=>{u.currentTarget=c,u._path=null}),l.sort((u,f)=>u.path.length-f.path.length),yHe(c._dEH,l,n))})}),a.push(()=>r.emit("afterTransaction",[n,r])),Xhe(a,[]),n._needFormattingCleanup&&y7t(n)}finally{r.gc&&Zwt(o,i,r.gcFilter),Jwt(o,i),n.afterState.forEach((u,f)=>{const h=n.beforeState.get(f)||0;if(h!==u){const g=i.clients.get(f),p=Ty(xm(g,h),1);for(let m=g.length-1;m>=p;)m-=1+XF(g,m)}});for(let u=s.length-1;u>=0;u--){const{client:f,clock:h}=s[u].id,g=i.clients.get(f),p=xm(g,h);p+11||p>0&&XF(g,p)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&($wt(Jhe,rHe,"[yjs] ",iHe,oHe,"Changed the client-id because another client seems to be using it."),r.clientID=dHe()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const u=new HI;n5e(u,n)&&r.emit("update",[u.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const u=new IC;n5e(u,n)&&r.emit("updateV2",[u.toUint8Array(),n.origin,r,n])}const{subdocsAdded:a,subdocsLoaded:l,subdocsRemoved:c}=n;(a.size>0||c.size>0||l.size>0)&&(a.forEach(u=>{u.clientID=r.clientID,u.collectionid==null&&(u.collectionid=r.collectionid),r.subdocs.add(u)}),c.forEach(u=>r.subdocs.delete(u)),r.emit("subdocs",[{loaded:l,added:a,removed:c},r,n]),c.forEach(u=>u.destroy())),e.length<=t+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,e])):xHe(e,t+1)}}},wo=(e,t,n=null,r=!0)=>{const i=e._transactionCleanups;let o=!1,s=null;e._transaction===null&&(o=!0,e._transaction=new Qwt(e,n,r),i.push(e._transaction),i.length===1&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{s=t(e._transaction)}finally{if(o){const a=e._transaction===i[0];e._transaction=null,a&&xHe(i,0)}}return s};function*e7t(e){const t=Lr(e.restDecoder);for(let n=0;noz(e,hHe,HI),n7t=(e,t)=>{if(e.constructor===Of){const{client:n,clock:r}=e.id;return new Of(Ri(n,r+t),e.length-t)}else if(e.constructor===Tf){const{client:n,clock:r}=e.id;return new Tf(Ri(n,r+t),e.length-t)}else{const n=e,{client:r,clock:i}=n.id;return new zl(Ri(r,i+t),null,Ri(r,i+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},oz=(e,t=Yw,n=IC)=>{if(e.length===1)return e[0];const r=e.map(u=>new t(m3(u)));let i=r.map(u=>new ige(u,!0)),o=null;const s=new n,a=new oge(s);for(;i=i.filter(h=>h.curr!==null),i.sort((h,g)=>{if(h.curr.id.client===g.curr.id.client){const p=h.curr.id.clock-g.curr.id.clock;return p===0?h.curr.constructor===g.curr.constructor?0:h.curr.constructor===Tf?1:-1:p}else return g.curr.id.client-h.curr.id.client}),i.length!==0;){const u=i[0],f=u.curr.id.client;if(o!==null){let h=u.curr,g=!1;for(;h!==null&&h.id.clock+h.length<=o.struct.id.clock+o.struct.length&&h.id.client>=o.struct.id.client;)h=u.next(),g=!0;if(h===null||h.id.client!==f||g&&h.id.clock>o.struct.id.clock+o.struct.length)continue;if(f!==o.struct.id.client)N2(a,o.struct,o.offset),o={struct:h,offset:0},u.next();else if(o.struct.id.clock+o.struct.length0&&(o.struct.constructor===Tf?o.struct.length-=p:h=n7t(h,p)),o.struct.mergeWith(h)||(N2(a,o.struct,o.offset),o={struct:h,offset:0},u.next())}}else o={struct:u.curr,offset:0},u.next();for(let h=u.curr;h!==null&&h.id.client===f&&h.id.clock===o.struct.id.clock+o.struct.length&&h.constructor!==Tf;h=u.next())N2(a,o.struct,o.offset),o={struct:h,offset:0}}o!==null&&(N2(a,o.struct,o.offset),o=null),sge(a);const l=r.map(u=>nge(u)),c=Mwt(l);return Dx(s,c),s.toUint8Array()},r7t=(e,t,n=Yw,r=IC)=>{const i=vHe(t),o=new r,s=new oge(o),a=new n(m3(e)),l=new ige(a,!1);for(;l.curr;){const u=l.curr,f=u.id.client,h=i.get(f)||0;if(l.curr.constructor===Tf){l.next();continue}if(u.id.clock+u.length>h)for(N2(s,u,Ty(h-u.id.clock,0)),l.next();l.curr&&l.curr.id.client===f;)N2(s,l.curr,0),l.next();else for(;l.curr&&l.curr.id.client===f&&l.curr.id.clock+l.curr.length<=h;)l.next()}sge(s);const c=nge(a);return Dx(o,c),o.toUint8Array()},EHe=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:zo(e.encoder.restEncoder)}),e.encoder.restEncoder=Il(),e.written=0)},N2=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&EHe(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),or(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},sge=e=>{EHe(e);const t=e.encoder.restEncoder;or(t,e.clientStructs.length);for(let n=0;n{const i=new n(m3(e)),o=new ige(i,!1),s=new r,a=new oge(s);for(let c=o.curr;c!==null;c=o.next())N2(a,t(c),0);sge(a);const l=nge(i);return Dx(s,l),s.toUint8Array()},o7t=e=>i7t(e,WSt,Yw,HI),i5e="You must not compute changes after the event-handler fired.";class mj{constructor(t,n){this.target=t,this.currentTarget=t,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=s7t(this.currentTarget,this.target))}deletes(t){return uHe(this.transaction.deleteSet,t.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw G4(i5e);const t=new Map,n=this.target;this.transaction.changed.get(n).forEach(i=>{if(i!==null){const o=n._map.get(i);let s,a;if(this.adds(o)){let l=o.left;for(;l!==null&&this.adds(l);)l=l.left;if(this.deletes(o))if(l!==null&&this.deletes(l))s="delete",a=ree(l.content.getContent());else return;else l!==null&&this.deletes(l)?(s="update",a=ree(l.content.getContent())):(s="add",a=void 0)}else if(this.deletes(o))s="delete",a=ree(o.content.getContent());else return;t.set(i,{action:s,oldValue:a})}}),this._keys=t}return this._keys}get delta(){return this.changes.delta}adds(t){return t.id.clock>=(this.transaction.beforeState.get(t.id.client)||0)}get changes(){let t=this._changes;if(t===null){if(this.transaction.doc._transactionCleanups.length===0)throw G4(i5e);const n=this.target,r=V4(),i=V4(),o=[];if(t={added:r,deleted:i,delta:o,keys:this.keys},this.transaction.changed.get(n).has(null)){let a=null;const l=()=>{a&&o.push(a)};for(let c=n._start;c!==null;c=c.right)c.deleted?this.deletes(c)&&!this.adds(c)&&((a===null||a.delete===void 0)&&(l(),a={delete:0}),a.delete+=c.length,i.add(c)):this.adds(c)?((a===null||a.insert===void 0)&&(l(),a={insert:[]}),a.insert=a.insert.concat(c.content.getContent()),r.add(c)):((a===null||a.retain===void 0)&&(l(),a={retain:0}),a.retain+=c.length);a!==null&&a.retain===void 0&&l()}this._changes=t}return t}}const s7t=(e,t)=>{const n=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)n.unshift(t._item.parentSub);else{let r=0,i=t._item.parent._start;for(;i!==t._item&&i!==null;)!i.deleted&&i.countable&&(r+=i.length),i=i.right;n.unshift(r)}t=t._item.parent}return n},Vl=()=>{Owt("Invalid access: Add Yjs type to a document before reading data.")},RHe=80;let age=0;class a7t{constructor(t,n){t.marker=!0,this.p=t,this.index=n,this.timestamp=age++}}const l7t=e=>{e.timestamp=age++},$He=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=age++},c7t=(e,t,n)=>{if(e.length>=RHe){const r=e.reduce((i,o)=>i.timestamp{if(e._start===null||t===0||e._searchMarker===null)return null;const n=e._searchMarker.length===0?null:e._searchMarker.reduce((o,s)=>qF(t-o.index)t;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return n!==null&&qF(n.index-i){for(let r=e.length-1;r>=0;r--){const i=e[r];if(n>0){let o=i.p;for(o.marker=!1;o&&(o.deleted||!o.countable);)o=o.left,o&&!o.deleted&&o.countable&&(i.index-=o.length);if(o===null||o.marker===!0){e.splice(r,1);continue}i.p=o,o.marker=!0}(t0&&t===i.index)&&(i.index=Ty(t,i.index+n))}},Cj=(e,t,n)=>{const r=e,i=t.changedParentTypes;for(;Vm(i,e,()=>[]).push(n),e._item!==null;)e=e._item.parent;yHe(r._eH,n,t)};class ol{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=Zbe(),this._dEH=Zbe(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(t,n){this.doc=t,this._item=n}_copy(){throw sm()}clone(){throw sm()}_write(t){}get _first(){let t=this._start;for(;t!==null&&t.deleted;)t=t.right;return t}_callObserver(t,n){!t.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(t){Jbe(this._eH,t)}observeDeep(t){Jbe(this._dEH,t)}unobserve(t){e5e(this._eH,t)}unobserveDeep(t){e5e(this._dEH,t)}toJSON(){}}const OHe=(e,t,n)=>{e.doc??Vl(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let r=n-t;const i=[];let o=e._start;for(;o!==null&&r>0;){if(o.countable&&!o.deleted){const s=o.content.getContent();if(s.length<=t)t-=s.length;else{for(let a=t;a0;a++)i.push(s[a]),r--;t=0}}o=o.right}return i},THe=e=>{e.doc??Vl();const t=[];let n=e._start;for(;n!==null;){if(n.countable&&!n.deleted){const r=n.content.getContent();for(let i=0;i{let n=0,r=e._start;for(e.doc??Vl();r!==null;){if(r.countable&&!r.deleted){const i=r.content.getContent();for(let o=0;o{const n=[];return dT(e,(r,i)=>{n.push(t(r,i,e))}),n},u7t=e=>{let t=e._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};n=t.content.getContent(),r=0,t=t.right}const i=n[r++];return n.length<=r&&(n=null),{done:!1,value:i}}}},MHe=(e,t)=>{e.doc??Vl();const n=vj(e,t);let r=e._start;for(n!==null&&(r=n.p,t-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(t{let i=n;const o=e.doc,s=o.clientID,a=o.store,l=n===null?t._start:n.right;let c=[];const u=()=>{c.length>0&&(i=new zl(Ri(s,Pa(a,s)),i,i&&i.lastId,l,l&&l.id,t,null,new PC(c)),i.integrate(e,0),c=[])};r.forEach(f=>{if(f===null)c.push(f);else switch(f.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(f);break;default:switch(u(),f.constructor){case Uint8Array:case ArrayBuffer:i=new zl(Ri(s,Pa(a,s)),i,i&&i.lastId,l,l&&l.id,t,null,new jI(new Uint8Array(f))),i.integrate(e,0);break;case Lx:i=new zl(Ri(s,Pa(a,s)),i,i&&i.lastId,l,l&&l.id,t,null,new VI(f)),i.integrate(e,0);break;default:if(f instanceof ol)i=new zl(Ri(s,Pa(a,s)),i,i&&i.lastId,l,l&&l.id,t,null,new ev(f)),i.integrate(e,0);else throw new Error("Unexpected content type in insert operation")}}}),u()},PHe=()=>G4("Length exceeded!"),_He=(e,t,n,r)=>{if(n>t._length)throw PHe();if(n===0)return t._searchMarker&&uT(t._searchMarker,n,r.length),sz(e,t,null,r);const i=n,o=vj(t,n);let s=t._start;for(o!==null&&(s=o.p,n-=o.index,n===0&&(s=s.prev,n+=s&&s.countable&&!s.deleted?s.length:0));s!==null;s=s.right)if(!s.deleted&&s.countable){if(n<=s.length){n{let i=(t._searchMarker||[]).reduce((o,s)=>s.index>o.index?s:o,{index:0,p:t._start}).p;if(i)for(;i.right;)i=i.right;return sz(e,t,i,n)},AHe=(e,t,n,r)=>{if(r===0)return;const i=n,o=r,s=vj(t,n);let a=t._start;for(s!==null&&(a=s.p,n-=s.index);a!==null&&n>0;a=a.right)!a.deleted&&a.countable&&(n0&&a!==null;)a.deleted||(r0)throw PHe();t._searchMarker&&uT(t._searchMarker,i,-o+r)},az=(e,t,n)=>{const r=t._map.get(n);r!==void 0&&r.delete(e)},lge=(e,t,n,r)=>{const i=t._map.get(n)||null,o=e.doc,s=o.clientID;let a;if(r==null)a=new PC([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:a=new PC([r]);break;case Uint8Array:a=new jI(r);break;case Lx:a=new VI(r);break;default:if(r instanceof ol)a=new ev(r);else throw new Error("Unexpected content type")}new zl(Ri(s,Pa(o.store,s)),i,i&&i.lastId,null,null,t,n,a).integrate(e,0)},cge=(e,t)=>{e.doc??Vl();const n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},DHe=e=>{const t={};return e.doc??Vl(),e._map.forEach((n,r)=>{n.deleted||(t[r]=n.content.getContent()[n.length-1])}),t},LHe=(e,t)=>{e.doc??Vl();const n=e._map.get(t);return n!==void 0&&!n.deleted},f7t=(e,t)=>{const n={};return e._map.forEach((r,i)=>{let o=r;for(;o!==null&&(!t.sv.has(o.id.client)||o.id.clock>=(t.sv.get(o.id.client)||0));)o=o.left;o!==null&&K5(o,t)&&(n[i]=o.content.getContent()[o.length-1])}),n},aD=e=>(e.doc??Vl(),Twt(e._map.entries(),t=>!t[1].deleted));class h7t extends mj{}class qS extends ol{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){const n=new qS;return n.push(t),n}_integrate(t,n){super._integrate(t,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new qS}clone(){const t=new qS;return t.insert(0,this.toArray().map(n=>n instanceof ol?n.clone():n)),t}get length(){return this.doc??Vl(),this._length}_callObserver(t,n){super._callObserver(t,n),Cj(this,t,new h7t(this,t))}insert(t,n){this.doc!==null?wo(this.doc,r=>{_He(r,this,t,n)}):this._prelimContent.splice(t,0,...n)}push(t){this.doc!==null?wo(this.doc,n=>{d7t(n,this,t)}):this._prelimContent.push(...t)}unshift(t){this.insert(0,t)}delete(t,n=1){this.doc!==null?wo(this.doc,r=>{AHe(r,this,t,n)}):this._prelimContent.splice(t,n)}get(t){return MHe(this,t)}toArray(){return THe(this)}slice(t=0,n=this.length){return OHe(this,t,n)}toJSON(){return this.map(t=>t instanceof ol?t.toJSON():t)}map(t){return IHe(this,t)}forEach(t){dT(this,t)}[Symbol.iterator](){return u7t(this)}_write(t){t.writeTypeRef(k7t)}}const g7t=e=>new qS;class p7t extends mj{constructor(t,n,r){super(t,n),this.keysChanged=r}}class Xw extends ol{constructor(t){super(),this._prelimContent=null,t===void 0?this._prelimContent=new Map:this._prelimContent=new Map(t)}_integrate(t,n){super._integrate(t,n),this._prelimContent.forEach((r,i)=>{this.set(i,r)}),this._prelimContent=null}_copy(){return new Xw}clone(){const t=new Xw;return this.forEach((n,r)=>{t.set(r,n instanceof ol?n.clone():n)}),t}_callObserver(t,n){Cj(this,t,new p7t(this,t,n))}toJSON(){this.doc??Vl();const t={};return this._map.forEach((n,r)=>{if(!n.deleted){const i=n.content.getContent()[n.length-1];t[r]=i instanceof ol?i.toJSON():i}}),t}get size(){return[...aD(this)].length}keys(){return see(aD(this),t=>t[0])}values(){return see(aD(this),t=>t[1].content.getContent()[t[1].length-1])}entries(){return see(aD(this),t=>[t[0],t[1].content.getContent()[t[1].length-1]])}forEach(t){this.doc??Vl(),this._map.forEach((n,r)=>{n.deleted||t(n.content.getContent()[n.length-1],r,this)})}[Symbol.iterator](){return this.entries()}delete(t){this.doc!==null?wo(this.doc,n=>{az(n,this,t)}):this._prelimContent.delete(t)}set(t,n){return this.doc!==null?wo(this.doc,r=>{lge(r,this,t,n)}):this._prelimContent.set(t,n),n}get(t){return cge(this,t)}has(t){return LHe(this,t)}clear(){this.doc!==null?wo(this.doc,t=>{this.forEach(function(n,r,i){az(t,i,r)})}):this._prelimContent.clear()}_write(t){t.writeTypeRef(z7t)}}const m7t=e=>new Xw,J2=(e,t)=>e===t||typeof e=="object"&&typeof t=="object"&&e&&t&&VSt(e,t);class rae{constructor(t,n,r,i){this.left=t,this.right=n,this.index=r,this.currentAttributes=i}forward(){switch(this.right===null&&wm(),this.right.content.constructor){case sa:this.right.deleted||Fx(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const o5e=(e,t,n)=>{for(;t.right!==null&&n>0;){switch(t.right.content.constructor){case sa:t.right.deleted||Fx(t.currentAttributes,t.right.content);break;default:t.right.deleted||(n{const i=new Map,o=r?vj(t,n):null;if(o){const s=new rae(o.p.left,o.p,o.index,i);return o5e(e,s,n-o.index)}else{const s=new rae(null,t._start,0,i);return o5e(e,s,n)}},FHe=(e,t,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===sa&&J2(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();const i=e.doc,o=i.clientID;r.forEach((s,a)=>{const l=n.left,c=n.right,u=new zl(Ri(o,Pa(i.store,o)),l,l&&l.lastId,c,c&&c.id,t,null,new sa(a,s));u.integrate(e,0),n.right=u,n.forward()})},Fx=(e,t)=>{const{key:n,value:r}=t;r===null?e.delete(n):e.set(n,r)},NHe=(e,t)=>{for(;e.right!==null;){if(!(e.right.deleted||e.right.content.constructor===sa&&J2(t[e.right.content.key]??null,e.right.content.value)))break;e.forward()}},kHe=(e,t,n,r)=>{const i=e.doc,o=i.clientID,s=new Map;for(const a in r){const l=r[a],c=n.currentAttributes.get(a)??null;if(!J2(c,l)){s.set(a,c);const{left:u,right:f}=n;n.right=new zl(Ri(o,Pa(i.store,o)),u,u&&u.lastId,f,f&&f.id,t,null,new sa(a,l)),n.right.integrate(e,0),n.forward()}}return s},lee=(e,t,n,r,i)=>{n.currentAttributes.forEach((h,g)=>{i[g]===void 0&&(i[g]=null)});const o=e.doc,s=o.clientID;NHe(n,i);const a=kHe(e,t,n,i),l=r.constructor===String?new Em(r):r instanceof ol?new ev(r):new Iy(r);let{left:c,right:u,index:f}=n;t._searchMarker&&uT(t._searchMarker,n.index,l.getLength()),u=new zl(Ri(s,Pa(o.store,s)),c,c&&c.lastId,u,u&&u.id,t,null,l),u.integrate(e,0),n.right=u,n.index=f,n.forward(),FHe(e,t,n,a)},s5e=(e,t,n,r,i)=>{const o=e.doc,s=o.clientID;NHe(n,i);const a=kHe(e,t,n,i);e:for(;n.right!==null&&(r>0||a.size>0&&(n.right.deleted||n.right.content.constructor===sa));){if(!n.right.deleted)switch(n.right.content.constructor){case sa:{const{key:l,value:c}=n.right.content,u=i[l];if(u!==void 0){if(J2(u,c))a.delete(l);else{if(r===0)break e;a.set(l,c)}n.right.delete(e)}else n.currentAttributes.set(l,c);break}default:r0){let l="";for(;r>0;r--)l+=` +`;n.right=new zl(Ri(s,Pa(o.store,s)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new Em(l)),n.right.integrate(e,0),n.forward()}FHe(e,t,n,a)},zHe=(e,t,n,r,i)=>{let o=t;const s=hu();for(;o&&(!o.countable||o.deleted);){if(!o.deleted&&o.content.constructor===sa){const c=o.content;s.set(c.key,c)}o=o.right}let a=0,l=!1;for(;t!==o;){if(n===t&&(l=!0),!t.deleted){const c=t.content;switch(c.constructor){case sa:{const{key:u,value:f}=c,h=r.get(u)??null;(s.get(u)!==c||h===f)&&(t.delete(e),a++,!l&&(i.get(u)??null)===f&&h!==f&&(h===null?i.delete(u):i.set(u,h))),!l&&!t.deleted&&Fx(i,c);break}}}t=t.right}return a},v7t=(e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;const n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===sa){const r=t.content.key;n.has(r)?t.delete(e):n.add(r)}t=t.left}},C7t=e=>{let t=0;return wo(e.doc,n=>{let r=e._start,i=e._start,o=hu();const s=Jse(o);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case sa:Fx(s,i.content);break;default:t+=zHe(n,r,i,o,s),o=Jse(s),r=i;break}i=i.right}}),t},y7t=e=>{const t=new Set,n=e.doc;for(const[r,i]of e.afterState.entries()){const o=e.beforeState.get(r)||0;i!==o&&wHe(e,n.store.clients.get(r),o,i,s=>{!s.deleted&&s.content.constructor===sa&&s.constructor!==Of&&t.add(s.parent)})}wo(n,r=>{cHe(e,e.deleteSet,i=>{if(i instanceof Of||!i.parent._hasFormatting||t.has(i.parent))return;const o=i.parent;i.content.constructor===sa?t.add(o):v7t(r,i)});for(const i of t)C7t(i)})},a5e=(e,t,n)=>{const r=n,i=Jse(t.currentAttributes),o=t.right;for(;n>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case ev:case Iy:case Em:n{i===null?this.childListChanged=!0:this.keysChanged.add(i)})}get changes(){if(this._changes===null){const t={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=t}return this._changes}get delta(){if(this._delta===null){const t=this.target.doc,n=[];wo(t,r=>{const i=new Map,o=new Map;let s=this.target._start,a=null;const l={};let c="",u=0,f=0;const h=()=>{if(a!==null){let g=null;switch(a){case"delete":f>0&&(g={delete:f}),f=0;break;case"insert":(typeof c=="object"||c.length>0)&&(g={insert:c},i.size>0&&(g.attributes={},i.forEach((p,m)=>{p!==null&&(g.attributes[m]=p)}))),c="";break;case"retain":u>0&&(g={retain:u},HSt(l)||(g.attributes=kSt({},l))),u=0;break}g&&n.push(g),a=null}};for(;s!==null;){switch(s.content.constructor){case ev:case Iy:this.adds(s)?this.deletes(s)||(h(),a="insert",c=s.content.getContent()[0],h()):this.deletes(s)?(a!=="delete"&&(h(),a="delete"),f+=1):s.deleted||(a!=="retain"&&(h(),a="retain"),u+=1);break;case Em:this.adds(s)?this.deletes(s)||(a!=="insert"&&(h(),a="insert"),c+=s.content.str):this.deletes(s)?(a!=="delete"&&(h(),a="delete"),f+=s.length):s.deleted||(a!=="retain"&&(h(),a="retain"),u+=s.length);break;case sa:{const{key:g,value:p}=s.content;if(this.adds(s)){if(!this.deletes(s)){const m=i.get(g)??null;J2(m,p)?p!==null&&s.delete(r):(a==="retain"&&h(),J2(p,o.get(g)??null)?delete l[g]:l[g]=p)}}else if(this.deletes(s)){o.set(g,p);const m=i.get(g)??null;J2(m,p)||(a==="retain"&&h(),l[g]=m)}else if(!s.deleted){o.set(g,p);const m=l[g];m!==void 0&&(J2(m,p)?m!==null&&s.delete(r):(a==="retain"&&h(),p===null?delete l[g]:l[g]=p))}s.deleted||(a==="insert"&&h(),Fx(i,s.content));break}}s=s.right}for(h();n.length>0;){const g=n[n.length-1];if(g.retain!==void 0&&g.attributes===void 0)n.pop();else break}}),this._delta=n}return this._delta}}class Qw extends ol{constructor(t){super(),this._pending=t!==void 0?[()=>this.insert(0,t)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??Vl(),this._length}_integrate(t,n){super._integrate(t,n);try{this._pending.forEach(r=>r())}catch(r){console.error(r)}this._pending=null}_copy(){return new Qw}clone(){const t=new Qw;return t.applyDelta(this.toDelta()),t}_callObserver(t,n){super._callObserver(t,n);const r=new b7t(this,t,n);Cj(this,t,r),!t.local&&this._hasFormatting&&(t._needFormattingCleanup=!0)}toString(){this.doc??Vl();let t="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===Em&&(t+=n.content.str),n=n.right;return t}toJSON(){return this.toString()}applyDelta(t,{sanitize:n=!0}={}){this.doc!==null?wo(this.doc,r=>{const i=new rae(null,this._start,0,new Map);for(let o=0;o0)&&lee(r,this,i,a,s.attributes||{})}else s.retain!==void 0?s5e(r,this,i,s.retain,s.attributes||{}):s.delete!==void 0&&a5e(r,i,s.delete)}}):this._pending.push(()=>this.applyDelta(t))}toDelta(t,n,r){this.doc??Vl();const i=[],o=new Map,s=this.doc;let a="",l=this._start;function c(){if(a.length>0){const f={};let h=!1;o.forEach((p,m)=>{h=!0,f[m]=p});const g={insert:a};h&&(g.attributes=f),i.push(g),a=""}}const u=()=>{for(;l!==null;){if(K5(l,t)||n!==void 0&&K5(l,n))switch(l.content.constructor){case Em:{const f=o.get("ychange");t!==void 0&&!K5(l,t)?(f===void 0||f.user!==l.id.client||f.type!=="removed")&&(c(),o.set("ychange",r?r("removed",l.id):{type:"removed"})):n!==void 0&&!K5(l,n)?(f===void 0||f.user!==l.id.client||f.type!=="added")&&(c(),o.set("ychange",r?r("added",l.id):{type:"added"})):f!==void 0&&(c(),o.delete("ychange")),a+=l.content.str;break}case ev:case Iy:{c();const f={insert:l.content.getContent()[0]};if(o.size>0){const h={};f.attributes=h,o.forEach((g,p)=>{h[p]=g})}i.push(f);break}case sa:K5(l,t)&&(c(),Fx(o,l.content));break}l=l.right}c()};return t||n?wo(s,f=>{t&&tae(f,t),n&&tae(f,n),u()},"cleanup"):u(),i}insert(t,n,r){if(n.length<=0)return;const i=this.doc;i!==null?wo(i,o=>{const s=lD(o,this,t,!r);r||(r={},s.currentAttributes.forEach((a,l)=>{r[l]=a})),lee(o,this,s,n,r)}):this._pending.push(()=>this.insert(t,n,r))}insertEmbed(t,n,r){const i=this.doc;i!==null?wo(i,o=>{const s=lD(o,this,t,!r);lee(o,this,s,n,r||{})}):this._pending.push(()=>this.insertEmbed(t,n,r||{}))}delete(t,n){if(n===0)return;const r=this.doc;r!==null?wo(r,i=>{a5e(i,lD(i,this,t,!0),n)}):this._pending.push(()=>this.delete(t,n))}format(t,n,r){if(n===0)return;const i=this.doc;i!==null?wo(i,o=>{const s=lD(o,this,t,!1);s.right!==null&&s5e(o,this,s,n,r)}):this._pending.push(()=>this.format(t,n,r))}removeAttribute(t){this.doc!==null?wo(this.doc,n=>{az(n,this,t)}):this._pending.push(()=>this.removeAttribute(t))}setAttribute(t,n){this.doc!==null?wo(this.doc,r=>{lge(r,this,t,n)}):this._pending.push(()=>this.setAttribute(t,n))}getAttribute(t){return cge(this,t)}getAttributes(){return DHe(this)}_write(t){t.writeTypeRef(B7t)}}const S7t=e=>new Qw;class cee{constructor(t,n=()=>!0){this._filter=n,this._root=t,this._currentNode=t._start,this._firstCall=!0,t.doc??Vl()}[Symbol.iterator](){return this}next(){let t=this._currentNode,n=t&&t.content&&t.content.type;if(t!==null&&(!this._firstCall||t.deleted||!this._filter(n)))do if(n=t.content.type,!t.deleted&&(n.constructor===Zw||n.constructor===MC)&&n._start!==null)t=n._start;else for(;t!==null;)if(t.right!==null){t=t.right;break}else t.parent===this._root?t=null:t=t.parent._item;while(t!==null&&(t.deleted||!this._filter(t.content.type)));return this._firstCall=!1,t===null?{value:void 0,done:!0}:(this._currentNode=t,{value:t.content.type,done:!1})}}class MC extends ol{constructor(){super(),this._prelimContent=[]}get firstChild(){const t=this._first;return t?t.content.getContent()[0]:null}_integrate(t,n){super._integrate(t,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new MC}clone(){const t=new MC;return t.insert(0,this.toArray().map(n=>n instanceof ol?n.clone():n)),t}get length(){return this.doc??Vl(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(t){return new cee(this,t)}querySelector(t){t=t.toUpperCase();const r=new cee(this,i=>i.nodeName&&i.nodeName.toUpperCase()===t).next();return r.done?null:r.value}querySelectorAll(t){return t=t.toUpperCase(),_0(new cee(this,n=>n.nodeName&&n.nodeName.toUpperCase()===t))}_callObserver(t,n){Cj(this,t,new E7t(this,n,t))}toString(){return IHe(this,t=>t.toString()).join("")}toJSON(){return this.toString()}toDOM(t=document,n={},r){const i=t.createDocumentFragment();return r!==void 0&&r._createAssociation(i,this),dT(this,o=>{i.insertBefore(o.toDOM(t,n,r),null)}),i}insert(t,n){this.doc!==null?wo(this.doc,r=>{_He(r,this,t,n)}):this._prelimContent.splice(t,0,...n)}insertAfter(t,n){if(this.doc!==null)wo(this.doc,r=>{const i=t&&t instanceof ol?t._item:t;sz(r,this,i,n)});else{const r=this._prelimContent,i=t===null?0:r.findIndex(o=>o===t)+1;if(i===0&&t!==null)throw G4("Reference item not found");r.splice(i,0,...n)}}delete(t,n=1){this.doc!==null?wo(this.doc,r=>{AHe(r,this,t,n)}):this._prelimContent.splice(t,n)}toArray(){return THe(this)}push(t){this.insert(this.length,t)}unshift(t){this.insert(0,t)}get(t){return MHe(this,t)}slice(t=0,n=this.length){return OHe(this,t,n)}forEach(t){dT(this,t)}_write(t){t.writeTypeRef(j7t)}}const w7t=e=>new MC;class Zw extends MC{constructor(t="UNDEFINED"){super(),this.nodeName=t,this._prelimAttrs=new Map}get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_integrate(t,n){super._integrate(t,n),this._prelimAttrs.forEach((r,i)=>{this.setAttribute(i,r)}),this._prelimAttrs=null}_copy(){return new Zw(this.nodeName)}clone(){const t=new Zw(this.nodeName),n=this.getAttributes();return zSt(n,(r,i)=>{typeof r=="string"&&t.setAttribute(i,r)}),t.insert(0,this.toArray().map(r=>r instanceof ol?r.clone():r)),t}toString(){const t=this.getAttributes(),n=[],r=[];for(const a in t)r.push(a);r.sort();const i=r.length;for(let a=0;a0?" "+n.join(" "):"";return`<${o}${s}>${super.toString()}${o}>`}removeAttribute(t){this.doc!==null?wo(this.doc,n=>{az(n,this,t)}):this._prelimAttrs.delete(t)}setAttribute(t,n){this.doc!==null?wo(this.doc,r=>{lge(r,this,t,n)}):this._prelimAttrs.set(t,n)}getAttribute(t){return cge(this,t)}hasAttribute(t){return LHe(this,t)}getAttributes(t){return t?f7t(this,t):DHe(this)}toDOM(t=document,n={},r){const i=t.createElement(this.nodeName),o=this.getAttributes();for(const s in o){const a=o[s];typeof a=="string"&&i.setAttribute(s,a)}return dT(this,s=>{i.appendChild(s.toDOM(t,n,r))}),r!==void 0&&r._createAssociation(i,this),i}_write(t){t.writeTypeRef(H7t),t.writeKey(this.nodeName)}}const x7t=e=>new Zw(e.readKey());class E7t extends mj{constructor(t,n,r){super(t,r),this.childListChanged=!1,this.attributesChanged=new Set,n.forEach(i=>{i===null?this.childListChanged=!0:this.attributesChanged.add(i)})}}class lz extends Xw{constructor(t){super(),this.hookName=t}_copy(){return new lz(this.hookName)}clone(){const t=new lz(this.hookName);return this.forEach((n,r)=>{t.set(r,n)}),t}toDOM(t=document,n={},r){const i=n[this.hookName];let o;return i!==void 0?o=i.createDom(this):o=document.createElement(this.hookName),o.setAttribute("data-yjs-hook",this.hookName),r!==void 0&&r._createAssociation(o,this),o}_write(t){t.writeTypeRef(V7t),t.writeKey(this.hookName)}}const R7t=e=>new lz(e.readKey());class cz extends Qw{get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_copy(){return new cz}clone(){const t=new cz;return t.applyDelta(this.toDelta()),t}toDOM(t=document,n,r){const i=t.createTextNode(this.toString());return r!==void 0&&r._createAssociation(i,this),i}toString(){return this.toDelta().map(t=>{const n=[];for(const i in t.attributes){const o=[];for(const s in t.attributes[i])o.push({key:s,value:t.attributes[i][s]});o.sort((s,a)=>s.keyi.nodeName"}r+=t.insert;for(let i=n.length-1;i>=0;i--)r+=`${n[i].nodeName}>`;return r}).join("")}toJSON(){return this.toString()}_write(t){t.writeTypeRef(G7t)}}const $7t=e=>new cz;class uge{constructor(t,n){this.id=t,this.length=n}get deleted(){throw sm()}mergeWith(t){return!1}write(t,n,r){throw sm()}integrate(t,n){throw sm()}}const O7t=0;class Of extends uge{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}integrate(t,n){n>0&&(this.id.clock+=n,this.length-=n),SHe(t.doc.store,this)}write(t,n){t.writeInfo(O7t),t.writeLen(this.length-n)}getMissing(t,n){return null}}class jI{constructor(t){this.content=t}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new jI(this.content)}splice(t){throw sm()}mergeWith(t){return!1}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeBuf(this.content)}getRef(){return 3}}const T7t=e=>new jI(e.readBuf());class fT{constructor(t){this.len=t}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new fT(this.len)}splice(t){const n=new fT(this.len-t);return this.len=t,n}mergeWith(t){return this.len+=t.len,!0}integrate(t,n){iz(t.deleteSet,n.id.client,n.id.clock,this.len),n.markDeleted()}delete(t){}gc(t){}write(t,n){t.writeLen(this.len-n)}getRef(){return 1}}const I7t=e=>new fT(e.readLen()),BHe=(e,t)=>new Lx({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class VI{constructor(t){t._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=t;const n={};this.opts=n,t.gc||(n.gc=!1),t.autoLoad&&(n.autoLoad=!0),t.meta!==null&&(n.meta=t.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new VI(BHe(this.doc.guid,this.opts))}splice(t){throw sm()}mergeWith(t){return!1}integrate(t,n){this.doc._item=n,t.subdocsAdded.add(this.doc),this.doc.shouldLoad&&t.subdocsLoaded.add(this.doc)}delete(t){t.subdocsAdded.has(this.doc)?t.subdocsAdded.delete(this.doc):t.subdocsRemoved.add(this.doc)}gc(t){}write(t,n){t.writeString(this.doc.guid),t.writeAny(this.opts)}getRef(){return 9}}const M7t=e=>new VI(BHe(e.readString(),e.readAny()));class Iy{constructor(t){this.embed=t}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new Iy(this.embed)}splice(t){throw sm()}mergeWith(t){return!1}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeJSON(this.embed)}getRef(){return 5}}const P7t=e=>new Iy(e.readJSON());class sa{constructor(t,n){this.key=t,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new sa(this.key,this.value)}splice(t){throw sm()}mergeWith(t){return!1}integrate(t,n){const r=n.parent;r._searchMarker=null,r._hasFormatting=!0}delete(t){}gc(t){}write(t,n){t.writeKey(this.key),t.writeJSON(this.value)}getRef(){return 6}}const _7t=e=>new sa(e.readKey(),e.readJSON());class uz{constructor(t){this.arr=t}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new uz(this.arr)}splice(t){const n=new uz(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,n){}delete(t){}gc(t){}write(t,n){const r=this.arr.length;t.writeLen(r-n);for(let i=n;i{const t=e.readLen(),n=[];for(let r=0;r{const t=e.readLen(),n=[];for(let r=0;r=55296&&r<=56319&&(this.str=this.str.slice(0,t-1)+"�",n.str="�"+n.str.slice(1)),n}mergeWith(t){return this.str+=t.str,!0}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}}const F7t=e=>new Em(e.readString()),N7t=[g7t,m7t,S7t,x7t,w7t,R7t,$7t],k7t=0,z7t=1,B7t=2,H7t=3,j7t=4,V7t=5,G7t=6;class ev{constructor(t){this.type=t}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new ev(this.type._copy())}splice(t){throw sm()}mergeWith(t){return!1}integrate(t,n){this.type._integrate(t.doc,n)}delete(t){let n=this.type._start;for(;n!==null;)n.deleted?n.id.clock<(t.beforeState.get(n.id.client)||0)&&t._mergeStructs.push(n):n.delete(t),n=n.right;this.type._map.forEach(r=>{r.deleted?r.id.clock<(t.beforeState.get(r.id.client)||0)&&t._mergeStructs.push(r):r.delete(t)}),t.changed.delete(this.type)}gc(t){let n=this.type._start;for(;n!==null;)n.gc(t,!0),n=n.right;this.type._start=null,this.type._map.forEach(r=>{for(;r!==null;)r.gc(t,!0),r=r.left}),this.type._map=new Map}write(t,n){this.type._write(t)}getRef(){return 7}}const W7t=e=>new ev(N7t[e.readTypeRef()](e)),dz=(e,t,n)=>{const{client:r,clock:i}=t.id,o=new zl(Ri(r,i+n),t,Ri(r,i+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&o.markDeleted(),t.keep&&(o.keep=!0),t.redone!==null&&(o.redone=Ri(t.redone.client,t.redone.clock+n)),t.right=o,o.right!==null&&(o.right.left=o),e._mergeStructs.push(o),o.parentSub!==null&&o.right===null&&o.parent._map.set(o.parentSub,o),t.length=n,o};let zl=class iae extends uge{constructor(t,n,r,i,o,s,a,l){super(t,l.getLength()),this.origin=r,this.left=n,this.right=i,this.rightOrigin=o,this.parent=s,this.parentSub=a,this.redone=null,this.content=l,this.info=this.content.isCountable()?Bbe:0}set marker(t){(this.info&nee)>0!==t&&(this.info^=nee)}get marker(){return(this.info&nee)>0}get keep(){return(this.info&zbe)>0}set keep(t){this.keep!==t&&(this.info^=zbe)}get countable(){return(this.info&Bbe)>0}get deleted(){return(this.info&tee)>0}set deleted(t){this.deleted!==t&&(this.info^=tee)}markDeleted(){this.info|=tee}getMissing(t,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=Pa(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=Pa(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===US&&this.id.client!==this.parent.client&&this.parent.clock>=Pa(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=t5e(t,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=U4(t,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===Of||this.right&&this.right.constructor===Of)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===iae&&(this.parent=this.left.parent,this.parentSub=this.left.parentSub),this.right&&this.right.constructor===iae&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===US){const r=aee(n,this.parent);r.constructor===Of?this.parent=null:this.parent=r.content.type}return null}integrate(t,n){if(n>0&&(this.id.clock+=n,this.left=t5e(t,t.doc.store,Ri(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(n),this.length-=n),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let r=this.left,i;if(r!==null)i=r.right;else if(this.parentSub!==null)for(i=this.parent._map.get(this.parentSub)||null;i!==null&&i.left!==null;)i=i.left;else i=this.parent._start;const o=new Set,s=new Set;for(;i!==null&&i!==this.right;){if(s.add(i),o.add(i),sD(this.origin,i.origin)){if(i.id.client{r.p===t&&(r.p=this,!this.deleted&&this.countable&&(r.index-=this.length))}),t.keep&&(this.keep=!0),this.right=t.right,this.right!==null&&(this.right.left=this),this.length+=t.length,!0}return!1}delete(t){if(!this.deleted){const n=this.parent;this.countable&&this.parentSub===null&&(n._length-=this.length),this.markDeleted(),iz(t.deleteSet,this.id.client,this.id.clock,this.length),r5e(t,n,this.parentSub),this.content.delete(t)}}gc(t,n){if(!this.deleted)throw wm();this.content.gc(t),n?Xwt(t,this,new Of(this.id,this.length)):this.content=new fT(this.length)}write(t,n){const r=n>0?Ri(this.id.client,this.id.clock+n-1):this.origin,i=this.rightOrigin,o=this.parentSub,s=this.content.getRef()&fj|(r===null?0:ud)|(i===null?0:g0)|(o===null?0:sT);if(t.writeInfo(s),r!==null&&t.writeLeftID(r),i!==null&&t.writeRightID(i),r===null&&i===null){const a=this.parent;if(a._item!==void 0){const l=a._item;if(l===null){const c=Kwt(a);t.writeParentInfo(!0),t.writeString(c)}else t.writeParentInfo(!1),t.writeLeftID(l.id)}else a.constructor===String?(t.writeParentInfo(!0),t.writeString(a)):a.constructor===US?(t.writeParentInfo(!1),t.writeLeftID(a)):wm();o!==null&&t.writeString(o)}this.content.write(t,n)}};const HHe=(e,t)=>U7t[t&fj](e),U7t=[()=>{wm()},I7t,A7t,T7t,F7t,P7t,_7t,W7t,L7t,M7t,()=>{wm()}],q7t=10;class Tf extends uge{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}integrate(t,n){wm()}write(t,n){t.writeInfo(q7t),or(t.restEncoder,this.length-n)}getMissing(t,n){return null}}const jHe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},VHe="__ $YJS$ __";jHe[VHe]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");jHe[VHe]=!0;const K7t=e=>BSt(e,(t,n)=>`${encodeURIComponent(n)}=${encodeURIComponent(t)}`).join("&");var uee,l5e;function GHe(){return l5e||(l5e=1,uee=GHe()),uee}var Y7t=GHe(),vo=(e=>(e.POST="post",e.POST_COMMENT="post_comment",e.COURSE_REVIEW="course_review",e.COURSE="course",e.SECTION="section",e.LECTURE="lecture",e.PATH="path",e))(vo||{}),rg=(e=>(e.VIDEO="video",e.ARTICLE="article",e))(rg||{}),Jw=(e=>(e.CATEGORY="category",e.TAG="tag",e.LEVEL="level",e))(Jw||{}),fz=(e=>(e.STAR="star",e.READED="read",e.LIKE="like",e.HATE="hate",e.COURSE_REVIEW="course_review",e))(fz||{}),ri=(e=>(e.DEPARTMENT="department",e.STAFF="staff",e.COMMENT="comment",e.TERM="term",e.APP_CONFIG="app_config",e.ROLE="role",e.ROLE_MAP="rolemap",e.MESSAGE="message",e.POST="post",e.VISIT="visit",e.COURSE="course",e.SECTION="section",e.LECTURE="lecture",e.ENROLLMENT="enrollment",e.RESOURCE="resource",e))(ri||{}),Ki=(e=>(e.CREATE_ALERT="CREATE_ALERT",e.CREATE_INSTRUCTION="CREATE_INSTRUCTION",e.CREATE_TROUBLE="CREATE_TROUBLE",e.CREATE_WORKPROGRESS="CREATE_WORKPROGRESS",e.CREATE_ASSESSMENT="CREATE_ASSESSMENT",e.CREATE_TERM="CREATE_TERM",e.READ_ANY_TROUBLE="READ_ANY_TROUBLE",e.READ_DOM_TROUBLE="READ_DOM_TROUBLE",e.READ_AUDIT_TROUBLE="READ_AUDIT_TROUBLE",e.READ_ANY_CHART="READ_ANY_CHART",e.READ_DOM_CHART="READ_DOM_CHART",e.READ_ANY_ASSESSMENT="READ_ANY_ASSESSMENT",e.READ_DOM_ASSESSMENT="READ_DOM_ASSESSMENT",e.READ_ANY_TERM="READ_ANY_TERM",e.READ_DOM_TERM="READ_DOM_TERM",e.READ_ANY_POST="READ_ANY_POST",e.READ_DOM_POST="READ_DOM_POST",e.MANAGE_ANY_POST="MANAGE_ANY_POST",e.MANAGE_DOM_POST="MANAGE_DOM_POST",e.MANAGE_ANY_TROUBLE="MANAGE_ANY_TROUBLE",e.MANAGE_DOM_TROUBLE="MANAGE_DOM_TROUBLE",e.MANAGE_DOM_TERM="MANAGE_DOM_TERM",e.MANAGE_ANY_TERM="MANAGE_ANY_TERM",e.MANAGE_BASE_SETTING="MANAGE_BASE_SETTING",e.MANAGE_ANY_STAFF="MANAGE_ANY_STAFF",e.MANAGE_DOM_STAFF="MANAGE_DOM_STAFF",e.MANAGE_ANY_DEPT="MANAGE_ANY_DEPT",e.MANAGE_DOM_DEPT="MANAGE_DOM_DEPT",e.MANAGE_ANY_ROLE="MANAGE_ANY_ROLE",e.MANAGE_DOM_ROLE="MANAGE_DOM_ROLE",e))(Ki||{}),dge=(e=>(e.BASE_SETTING="base_setting",e))(dge||{}),t$=(e=>(e.DRAFT="draft",e.UNDER_REVIEW="under_review",e.PUBLISHED="published",e.ARCHIVED="archived",e))(t$||{}),X7t={beginner:"初级",intermediate:"中级",advanced:"高级",all_levels:"不限级别"},hz={video:"视频课程",article:"图文课程",quiz:"测验",assignment:"作业"},Q7t=Oe.any();Oe.object({username:Oe.string(),password:Oe.string(),deptId:Oe.string().nullish(),officerId:Oe.string().nullish(),showname:Oe.string().nullish(),phoneNumber:Oe.string().nullish()}),Oe.object({refreshToken:Oe.string(),sessionId:Oe.string()}),Oe.object({refreshToken:Oe.string(),sessionId:Oe.string()}),Oe.object({username:Oe.string().nullish(),password:Oe.string().nullish(),phoneNumber:Oe.string().nullish()}),Oe.object({phoneNumber:Oe.string().nullish(),newPassword:Oe.string(),renewPassword:Oe.string(),username:Oe.string().nullish()}),Oe.object({refreshToken:Oe.string()}),Oe.object({refreshToken:Oe.string()});var Z7t=Oe.object({colId:Oe.string(),sort:Oe.enum(["asc","desc"])});Oe.object({id:Oe.string(),overId:Oe.string()});var yj=Oe.object({startRow:Oe.number(),endRow:Oe.number(),rowGroupCols:Oe.array(Oe.object({id:Oe.string(),displayName:Oe.string(),field:Oe.string()})),valueCols:Oe.array(Oe.object({id:Oe.string().nullish(),displayName:Oe.string().nullish(),aggFunc:Oe.string().nullish(),field:Oe.string()})),pivotCols:Oe.array(Oe.any()).nullish(),pivotMode:Oe.boolean().nullish(),groupKeys:Oe.array(Oe.any()),filterModel:Oe.any().nullish(),sortModel:Oe.array(Z7t).nullish(),includeDeleted:Oe.boolean().nullish()});Oe.object({showname:Oe.string().nullish(),username:Oe.string(),phoneNumber:Oe.string().nullish(),domainId:Oe.string().nullish(),password:Oe.string().nullish(),deptId:Oe.string().nullish(),officerId:Oe.string().nullish(),emitChange:Oe.boolean().nullish(),hashedPassword:Oe.string().nullish()}),Oe.object({id:Oe.string(),showname:Oe.string().nullish(),username:Oe.string().nullish(),domainId:Oe.string().nullish(),deptId:Oe.string().nullish(),phoneNumber:Oe.string().nullish(),order:Oe.number().nullish(),registerToken:Oe.string().nullish(),password:Oe.string().nullish(),officerId:Oe.string().nullish()}),Oe.object({id:Oe.string()}),Oe.object({ids:Oe.array(Oe.string())}),Oe.object({deptId:Oe.string(),domainId:Oe.string().nullish()}),Oe.object({keyword:Oe.string().nullish(),domainId:Oe.string().nullish(),deptId:Oe.string().nullish(),limit:Oe.number().nullish(),ids:Oe.array(Oe.string()).nullish()}),Oe.object({phoneNumber:Oe.string().nullish(),id:Oe.string().nullish()}),Oe.object({page:Oe.number(),pageSize:Oe.number(),domainId:Oe.string().nullish(),deptId:Oe.string().nullish(),ids:Oe.array(Oe.string()).nullish()}),yj.extend({domainId:Oe.string().nullish()});Oe.object({name:Oe.string(),termIds:Oe.array(Oe.string()).nullish(),parentId:Oe.string().nullish(),isDomain:Oe.boolean().nullish()}),yj.extend({parentId:Oe.string().nullish()}),Oe.object({id:Oe.string(),name:Oe.string().nullish(),termIds:Oe.array(Oe.string()).nullish(),parentId:Oe.string().nullish(),deletedAt:Oe.date().nullish(),order:Oe.number().nullish(),isDomain:Oe.boolean().nullish()}),Oe.object({id:Oe.string()}),Oe.object({keyword:Oe.string().nullish(),ids:Oe.array(Oe.string()).nullish(),limit:Oe.number().nullish(),domain:Oe.boolean().nullish()}),Oe.object({id:Oe.string()}),Oe.object({page:Oe.number(),pageSize:Oe.number(),ids:Oe.array(Oe.string()).nullish()}),Oe.object({deptIds:Oe.array(Oe.string().nullish()).nullish(),parentId:Oe.string().nullish(),domain:Oe.boolean().nullish(),rootId:Oe.string().nullish()});Oe.object({base64:Oe.string(),domainId:Oe.string().nullish()}),Oe.object({base64:Oe.string(),domainId:Oe.string().nullish(),taxonomyId:Oe.string().nullish(),parentId:Oe.string().nullish()}),Oe.object({base64:Oe.string(),domainId:Oe.string().nullish(),parentId:Oe.string().nullish()});yj.extend({parentId:Oe.string().nullish(),domainId:Oe.string().nullish(),taxonomyId:Oe.string().nullish()}),Oe.object({name:Oe.string(),description:Oe.string().nullish(),domainId:Oe.string().nullish(),parentId:Oe.string().nullish(),taxonomyId:Oe.string(),watchStaffIds:Oe.array(Oe.string()).nullish(),watchDeptIds:Oe.array(Oe.string()).nullish()}),Oe.object({id:Oe.string(),description:Oe.string().nullish(),parentId:Oe.string().nullish(),domainId:Oe.string().nullish(),name:Oe.string().nullish(),taxonomyId:Oe.string().nullish(),order:Oe.number().nullish(),watchStaffIds:Oe.array(Oe.string()).nullish(),watchDeptIds:Oe.array(Oe.string()).nullish()}),Oe.object({id:Oe.string()}),Oe.object({page:Oe.number().min(1),pageSize:Oe.number().min(1)}),Oe.object({ids:Oe.array(Oe.string())}),Oe.object({cursor:Oe.string().nullish(),search:Oe.string().nullish(),limit:Oe.number().min(1).max(100).nullish(),taxonomyId:Oe.string().nullish(),taxonomySlug:Oe.string().nullish(),id:Oe.string().nullish(),initialIds:Oe.array(Oe.string()).nullish()}),Oe.object({parentId:Oe.string().nullish(),domainId:Oe.string().nullish(),taxonomyId:Oe.string().nullish(),cursor:Oe.string().nullish(),limit:Oe.number().min(1).max(100).nullish()}),Oe.object({termIds:Oe.array(Oe.string().nullish()).nullish(),parentId:Oe.string().nullish(),taxonomyId:Oe.string().nullish(),domainId:Oe.string().nullish()}),Oe.object({keyword:Oe.string().nullish(),ids:Oe.array(Oe.string()).nullish(),taxonomyId:Oe.string().nullish(),taxonomySlug:Oe.string().nullish(),limit:Oe.number().nullish()}),Oe.object({taxonomyId:Oe.string().nullish(),taxonomySlug:Oe.string().nullish(),domainId:Oe.string().nullish()});Oe.object({objectId:Oe.string(),roleId:Oe.string(),domainId:Oe.string(),objectType:Oe.nativeEnum(ri)}),Oe.object({id:Oe.string(),objectId:Oe.string().nullish(),roleId:Oe.string().nullish(),domainId:Oe.string().nullish(),objectType:Oe.nativeEnum(ri).nullish()}),Oe.object({objectId:Oe.string(),roleIds:Oe.array(Oe.string()),domainId:Oe.string(),objectType:Oe.nativeEnum(ri)}),Oe.object({objectIds:Oe.array(Oe.string()),roleId:Oe.string(),domainId:Oe.string().nullish(),objectType:Oe.nativeEnum(ri)}),Oe.object({ids:Oe.array(Oe.string())}),Oe.object({page:Oe.number().min(1),pageSize:Oe.number().min(1),domainId:Oe.string().nullish(),roleId:Oe.string().nullish()}),Oe.object({objectId:Oe.string()}),Oe.object({roleId:Oe.string(),domainId:Oe.string().nullish()}),Oe.object({domainId:Oe.string(),staffId:Oe.string(),deptId:Oe.string()}),yj.extend({roleId:Oe.string().nullish(),domainId:Oe.string().nullish()}),Oe.object({domainId:Oe.string().nullish(),roleId:Oe.string().nullish()});Oe.object({name:Oe.string(),permissions:Oe.array(Oe.string()).nullish()}),Oe.object({id:Oe.string(),name:Oe.string().nullish(),permissions:Oe.array(Oe.string()).nullish()}),Oe.object({ids:Oe.array(Oe.string())}),Oe.object({page:Oe.number().nullish(),pageSize:Oe.number().nullish()}),Oe.object({keyword:Oe.string().nullish()});Oe.object({name:Oe.string(),slug:Oe.string(),objectType:Oe.array(Oe.nativeEnum(ri)).nullish()}),Oe.object({id:Oe.string()}),Oe.object({name:Oe.string()}),Oe.object({slug:Oe.string()}),Oe.object({id:Oe.string()}),Oe.object({ids:Oe.array(Oe.string())}),Oe.object({id:Oe.string(),name:Oe.string().nullish(),slug:Oe.string().nullish(),order:Oe.number().nullish(),objectType:Oe.array(Oe.nativeEnum(ri)).nullish()}),Oe.object({page:Oe.number().min(1),pageSize:Oe.number().min(1)}),Oe.object({type:Oe.nativeEnum(ri).nullish()});Oe.object({cursor:Oe.string().nullish(),limit:Oe.number().min(-1).max(100).nullish(),keyword:Oe.string().nullish(),states:Oe.array(Oe.number()).nullish(),termIds:Oe.array(Oe.string()).nullish(),termIdFilters:Oe.map(Oe.string(),Oe.array(Oe.string())).nullish(),selectedIds:Oe.array(Oe.string()).nullish(),initialIds:Oe.array(Oe.string()).nullish(),excludeIds:Oe.array(Oe.string()).nullish(),createStartDate:Oe.date().nullish(),createEndDate:Oe.date().nullish(),deptId:Oe.string().nullish()});Oe.object({sectionId:Oe.string().nullish(),type:Oe.string().nullish(),title:Oe.string().nullish(),content:Oe.string().nullish(),resourceIds:Oe.array(Oe.string()).nullish()}),Oe.object({courseId:Oe.string().nullish(),title:Oe.string().nullish(),lectures:Oe.array(Oe.object({type:Oe.string().nullish(),title:Oe.string().nullish(),content:Oe.string().nullish(),resourceIds:Oe.array(Oe.string()).nullish()})).nullish()}),Oe.object({courseDetail:Q7t,sections:Oe.array(Oe.object({title:Oe.string(),lectures:Oe.array(Oe.object({type:Oe.string(),title:Oe.string(),content:Oe.string().optional(),resourceIds:Oe.array(Oe.string()).optional()})).optional()})).optional()});function QF(e,t=75,n=65){let r=0;for(let o=0;oArray.from(new Map(e.map(n=>[n[t]||null,n])).values()),c5e=(e,t="id")=>e.map(n=>({[t]:n}));Object.keys(Ki).filter(e=>!["READ_ANY_CHART","READ_ANY_TROUBLE","READ_ANY_TERM"].includes(e)),Object.keys(Ki);var J7t=["video/*","video/mp4","video/quicktime","video/x-msvideo","video/x-matroska","video/webm","video/ogg","video/mpeg","video/3gpp","video/3gpp2","video/x-flv","video/x-ms-wmv"],WHe=0,fge=1,UHe=2,oae=(e,t)=>{or(e,WHe);const n=Uwt(t);ws(e,n)},qHe=(e,t,n)=>{or(e,fge),ws(e,jwt(t,n))},ext=(e,t,n)=>qHe(t,n,$l(e)),KHe=(e,t,n)=>{try{zwt(t,$l(e),n)}catch(r){console.error("Caught error while handling a Yjs update",r)}},txt=(e,t)=>{or(e,UHe),ws(e,t)},nxt=KHe,rxt=(e,t,n,r)=>{const i=Lr(e);switch(i){case WHe:ext(e,t,n);break;case fge:KHe(e,n,r);break;case UHe:nxt(e,n,r);break;default:throw new Error("Unknown message type")}return i},ixt=0,oxt=(e,t,n)=>{switch(Lr(e)){case ixt:n(t,m4(e))}},GI=[];GI[0]=(e,t,n,r,i)=>{or(e,0);const o=rxt(t,e,n.doc,n);r&&o===fge&&!n.synced&&(n.synced=!0)};GI[3]=(e,t,n,r,i)=>{console.log("Handling messageQueryAwareness"),or(e,1),ws(e,z$(n.awareness,Array.from(n.awareness.getStates().keys()))),console.debug("Encoded awareness update for querying awareness state.")};GI[1]=(e,t,n,r,i)=>{const o=$l(t);lxt(n.awareness,o,n)};GI[2]=(e,t,n,r,i)=>{console.log("Handling messageAuth"),oxt(t,n.doc,(o,s)=>sxt(n,s))};var sxt=(e,t)=>console.warn(`Permission denied to access ${e.url}. +${t}`),ZF=()=>typeof navigator<"u"&&navigator.product==="ReactNative",YHe=(e,t,n)=>{const r=m3(t),i=Il(),o=Lr(r),s=e.messageHandlers[o];return s?s(i,r,e,n,o):console.error("Unable to compute message"),i},XHe=e=>{if(e.shouldConnect&&e.socket===null){const t=e.url.replace(/^http/,"ws"),n=new WebSocket(t);n.binaryType="arraybuffer",e.socket=n,e.wsconnecting=!0,e.wsconnected=!1,e.synced=!1,n.onmessage=r=>{e.wsLastMessageReceived=Kw();const i=YHe(e,new Uint8Array(r.data),!0);Whe(i)>1&&n.send(zo(i))},n.onerror=r=>{console.log("WebSocket connection error:",r),e.emit("connection-error",[r,e])},n.onclose=r=>{console.log("WebSocket closed",r),e.emit("connection-close",[r.reason,e]),e.socket=null,e.wsconnecting=!1,e.wsconnected?(e.wsconnected=!1,e.synced=!1,hge(e.awareness,Array.from(e.awareness.getStates().keys()).filter(i=>i!==e.doc.clientID),e),e.emit("status",[{status:"disconnected"}])):e.wsUnsuccessfulReconnects++,setTimeout(()=>XHe(e),Ghe(iSt(2,e.wsUnsuccessfulReconnects)*100,e.maxBackoffTime))},n.onopen=()=>{console.log("\x1B[32m%s\x1B[0m","WebSocket connected"),e.wsLastMessageReceived=Kw(),e.wsconnecting=!1,e.wsconnected=!0,e.wsUnsuccessfulReconnects=0,e.emit("status",[{status:"connected"}]);const r=Il();if(or(r,0),oae(r,e.doc),n.send(zo(r)),e.awareness.getLocalState()!==null){const i=Il();or(i,1),ws(i,z$(e.awareness,[e.doc.clientID])),n.send(zo(i))}},e.emit("status",[{status:"connecting"}])}},dee=(e,t)=>{e.wsconnected&&e.socket&&e.socket.send(t),!ZF()&&e.bcconnected&&q5(e.bcChannel,t,e)},QHe=class extends WBe{constructor(t,n,r,{connect:i=!0,awareness:o=new axt(r),params:s={},protocols:a=[],resyncInterval:l=-1,maxBackoffTime:c=2500,disableBc:u=!1}={}){super();Wt(this,"serverUrl");Wt(this,"bcChannel");Wt(this,"maxBackoffTime");Wt(this,"params");Wt(this,"protocols");Wt(this,"doc");Wt(this,"roomId");Wt(this,"socket");Wt(this,"awareness");Wt(this,"wsconnected");Wt(this,"wsconnecting");Wt(this,"bcconnected");Wt(this,"disableBc");Wt(this,"wsUnsuccessfulReconnects");Wt(this,"messageHandlers");Wt(this,"_synced");Wt(this,"wsLastMessageReceived");Wt(this,"shouldConnect");Wt(this,"_resyncInterval");Wt(this,"_bcSubscriber");Wt(this,"_updateHandler");Wt(this,"_awarenessUpdateHandler");Wt(this,"_exitHandler");for(;t[t.length-1]==="/";)t=t.slice(0,t.length-1);this.serverUrl=t,this.params={...s,roomId:n},this.bcChannel=t+"/"+n,this.maxBackoffTime=c,this.protocols=a,this.doc=r,this.socket=null,this.awareness=o,this.roomId=n,this.wsconnected=!1,this.wsconnecting=!1,this.bcconnected=!1,this.disableBc=ZF()?!0:u,this.wsUnsuccessfulReconnects=0,this.messageHandlers=GI.slice(),this._synced=!1,this.wsLastMessageReceived=0,this.shouldConnect=i,this._resyncInterval=0,l>0&&(this._resyncInterval=setInterval(()=>{if(this.socket&&this.socket.OPEN){const f=Il();or(f,0),oae(f,r),console.log(`Resyncing data on interval: ${zo(f)}`),this.socket.send(zo(f))}},l)),this._bcSubscriber=(f,h)=>{if(h!==this){const g=YHe(this,new Uint8Array(f),!1);Whe(g)>1&&q5(this.bcChannel,zo(g),this)}},this._updateHandler=(f,h)=>{if(h!==this){const g=Il();or(g,0),txt(g,f),dee(this,zo(g))}},this.doc.on("update",this._updateHandler),this._awarenessUpdateHandler=({added:f,updated:h,removed:g},p)=>{const m=f.concat(h).concat(g);console.log(`update awareness from ${p}`,m);const v=Il();or(v,1),ws(v,z$(o,m)),dee(this,zo(v))},this._exitHandler=()=>{hge(this.awareness,[r.clientID],"app closed"),console.log("App closed, removing awareness states.")},W4&&typeof process<"u"&&process.on("exit",this._exitHandler),o.on("update",this._awarenessUpdateHandler),i&&this.connect()}get url(){const t=K7t(this.params);return this.serverUrl+(t.length===0?"":"?"+t)}get synced(){return this._synced}set synced(t){this._synced!==t&&(this._synced=t,this.emit("synced",[t]),this.emit("sync",[t]))}destroy(){this._resyncInterval&&clearInterval(this._resyncInterval),this.disconnect(),W4&&typeof process<"u"&&process.off("exit",this._exitHandler),this.awareness.off("update",this._awarenessUpdateHandler),this.doc.off("update",this._updateHandler),console.log("Destroying provider and clearing intervals/subscriptions."),super.destroy()}connectBc(){if(ZF()||this.disableBc)return;this.bcconnected||(dwt(this.bcChannel,this._bcSubscriber),this.bcconnected=!0);const t=Il();or(t,0),oae(t,this.doc),q5(this.bcChannel,zo(t),this);const n=Il();or(n,0),qHe(n,this.doc),q5(this.bcChannel,zo(n),this);const r=Il();or(r,3),q5(this.bcChannel,zo(r),this);const i=Il();or(i,1),ws(i,z$(this.awareness,[this.doc.clientID])),q5(this.bcChannel,zo(i),this)}disconnectBc(){if(ZF())return;const t=Il();or(t,1),ws(t,z$(this.awareness,[this.doc.clientID],new Map)),dee(this,zo(t)),this.bcconnected&&(fwt(this.bcChannel,this._bcSubscriber),this.bcconnected=!1)}disconnect(){this.shouldConnect=!1,this.disconnectBc(),this.socket&&(console.log("Disconnecting socket"),this.socket.close())}connect(){this.shouldConnect=!0,!this.wsconnected&&this.socket===null&&(XHe(this),this.connectBc())}},fee=3e4,axt=class extends WBe{constructor(t){super();Wt(this,"doc");Wt(this,"clientID");Wt(this,"states");Wt(this,"meta");Wt(this,"_checkInterval");this.doc=t,this.clientID=t.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{var i;const n=Kw();this.getLocalState()!==null&&fee/2<=n-(((i=this.meta.get(this.clientID))==null?void 0:i.lastUpdated)||0)&&this.setLocalState(this.getLocalState());const r=[];this.meta.forEach((o,s)=>{s!==this.clientID&&fee<=n-o.lastUpdated&&this.states.has(s)&&r.push(s)}),r.length>0&&hge(this,r,"timeout")},Math.floor(fee/10)),t.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(t){const n=this.clientID,r=this.meta.get(n),i=r===void 0?0:r.clock+1,o=this.states.get(n);t===null?this.states.delete(n):this.states.set(n,t),this.meta.set(n,{clock:i,lastUpdated:Kw()});const s=[],a=[],l=[],c=[];t===null?c.push(n):o==null?t!=null&&s.push(n):(a.push(n),k$(o,t)||l.push(n)),(s.length>0||l.length>0||c.length>0)&&this.emit("change",[{added:s,updated:l,removed:c},"local"]),this.emit("update",[{added:s,updated:a,removed:c},"local"])}setLocalStateField(t,n){const r=this.getLocalState();r!==null&&this.setLocalState({...r,[t]:n})}getStates(){return this.states}},hge=(e,t,n)=>{const r=[];for(let i=0;i0&&(e.emit("change",[{added:[],updated:[],removed:r},n]),e.emit("update",[{added:[],updated:[],removed:r},n]))},z$=(e,t,n=e.states)=>{const r=t.length,i=Il();or(i,r);for(let o=0;o{const r=m3(t),i=Kw(),o=[],s=[],a=[],l=[],c=Lr(r);for(let u=0;u0||a.length>0||l.length>0)&&e.emit("change",[{added:o,updated:a,removed:l},n]),n instanceof QHe||e.emit("update",[{added:o,updated:s,removed:l},n])},hee=null,cxt=()=>new Y7t.PrismaClient({log:["error"]});(()=>{if(typeof window>"u")return hee||(hee=cxt()),hee})();var uxt={id:!0,type:!0,title:!0,content:!0,resources:!0,parent:!0,parentId:!0,updatedAt:!0,terms:{select:{id:!0,name:!0,taxonomyId:!0,taxonomy:{select:{id:!0,slug:!0}}}},depts:!0,author:{select:{id:!0,showname:!0,avatar:!0,department:{select:{id:!0,name:!0}},domain:{select:{id:!0,name:!0}}}},meta:!0,views:!0},gge={id:!0,title:!0,subTitle:!0,views:!0,type:!0,author:!0,authorId:!0,content:!0,depts:!0,createdAt:!0,updatedAt:!0,terms:{select:{id:!0,name:!0,taxonomyId:!0,taxonomy:{select:{id:!0,slug:!0}}}},enrollments:{select:{id:!0}},meta:!0,rating:!0},ZHe={id:!0,title:!0,subTitle:!0,content:!0,resources:!0,views:!0,createdAt:!0,updatedAt:!0,meta:!0};function dxt(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(i){i(n)}),(r=e.get("*"))&&r.slice().map(function(i){i(t,n)})}}}var gee={exports:{}},u5e;function pge(){return u5e||(u5e=1,function(e,t){(function(n,r){e.exports=r()})(Jo,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",s="second",a="minute",l="hour",c="day",u="week",f="month",h="quarter",g="year",p="date",m="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(D){var k=["th","st","nd","rd"],L=D%100;return"["+D+(k[(L-20)%10]||k[L]||k[0])+"]"}},b=function(D,k,L){var I=String(D);return!I||I.length>=k?D:""+Array(k+1-I.length).join(L)+D},S={s:b,z:function(D){var k=-D.utcOffset(),L=Math.abs(k),I=Math.floor(L/60),A=L%60;return(k<=0?"+":"-")+b(I,2,"0")+":"+b(A,2,"0")},m:function D(k,L){if(k.date()1)return D(B[0])}else{var z=k.name;x[z]=k,A=z}return!I&&A&&(w=A),A||!I&&w},T=function(D,k){if(R(D))return D.clone();var L=typeof k=="object"?k:{};return L.date=D,L.args=arguments,new _(L)},M=S;M.l=O,M.i=R,M.w=function(D,k){return T(D,{locale:k.$L,utc:k.$u,x:k.$x,$offset:k.$offset})};var _=function(){function D(L){this.$L=O(L.locale,null,!0),this.parse(L),this.$x=this.$x||L.x||{},this[E]=!0}var k=D.prototype;return k.parse=function(L){this.$d=function(I){var A=I.date,N=I.utc;if(A===null)return new Date(NaN);if(M.u(A))return new Date;if(A instanceof Date)return new Date(A);if(typeof A=="string"&&!/Z$/i.test(A)){var B=A.match(v);if(B){var z=B[2]-1||0,j=(B[7]||"0").substring(0,3);return N?new Date(Date.UTC(B[1],z,B[3]||1,B[4]||0,B[5]||0,B[6]||0,j)):new Date(B[1],z,B[3]||1,B[4]||0,B[5]||0,B[6]||0,j)}}return new Date(A)}(L),this.init()},k.init=function(){var L=this.$d;this.$y=L.getFullYear(),this.$M=L.getMonth(),this.$D=L.getDate(),this.$W=L.getDay(),this.$H=L.getHours(),this.$m=L.getMinutes(),this.$s=L.getSeconds(),this.$ms=L.getMilliseconds()},k.$utils=function(){return M},k.isValid=function(){return this.$d.toString()!==m},k.isSame=function(L,I){var A=T(L);return this.startOf(I)<=A&&A<=this.endOf(I)},k.isAfter=function(L,I){return T(L)=0,o=!n&&i&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return o?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return nr(this.toString())},_applyModification:function(t,n){var r=t.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(xxt,arguments)},brighten:function(){return this._applyModification(Ext,arguments)},darken:function(){return this._applyModification(Rxt,arguments)},desaturate:function(){return this._applyModification(bxt,arguments)},saturate:function(){return this._applyModification(Sxt,arguments)},greyscale:function(){return this._applyModification(wxt,arguments)},spin:function(){return this._applyModification($xt,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(Ixt,arguments)},complement:function(){return this._applyCombination(Oxt,arguments)},monochromatic:function(){return this._applyCombination(Mxt,arguments)},splitcomplement:function(){return this._applyCombination(Txt,arguments)},triad:function(){return this._applyCombination(p5e,[3])},tetrad:function(){return this._applyCombination(p5e,[4])}};nr.fromRatio=function(e,t){if(gz(e)=="object"){var n={};for(var r in e)e.hasOwnProperty(r)&&(r==="a"?n[r]=e[r]:n[r]=n$(e[r]));e=n}return nr(e,t)};function pxt(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,o=null,s=!1,a=!1;return typeof e=="string"&&(e=Lxt(e)),gz(e)=="object"&&(S1(e.r)&&S1(e.g)&&S1(e.b)?(t=mxt(e.r,e.g,e.b),s=!0,a=String(e.r).substr(-1)==="%"?"prgb":"rgb"):S1(e.h)&&S1(e.s)&&S1(e.v)?(r=n$(e.s),i=n$(e.v),t=Cxt(e.h,r,i),s=!0,a="hsv"):S1(e.h)&&S1(e.s)&&S1(e.l)&&(r=n$(e.s),o=n$(e.l),t=vxt(e.h,r,o),s=!0,a="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=JHe(n),{ok:s,format:e.format||a,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function mxt(e,t,n){return{r:Bo(e,255)*255,g:Bo(t,255)*255,b:Bo(n,255)*255}}function d5e(e,t,n){e=Bo(e,255),t=Bo(t,255),n=Bo(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o,s,a=(r+i)/2;if(r==i)o=s=0;else{var l=r-i;switch(s=a>.5?l/(2-r-i):l/(r+i),r){case e:o=(t-n)/l+(t1&&(f-=1),f<1/6?c+(u-c)*6*f:f<1/2?u:f<2/3?c+(u-c)*(2/3-f)*6:c}if(t===0)r=i=o=n;else{var a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;r=s(l,a,e+1/3),i=s(l,a,e),o=s(l,a,e-1/3)}return{r:r*255,g:i*255,b:o*255}}function f5e(e,t,n){e=Bo(e,255),t=Bo(t,255),n=Bo(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o,s,a=r,l=r-i;if(s=r===0?0:l/r,r==i)o=0;else{switch(r){case e:o=(t-n)/l+(t>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(nr(r));return o}function Mxt(e,t){t=t||6;for(var n=nr(e).toHsv(),r=n.h,i=n.s,o=n.v,s=[],a=1/t;t--;)s.push(nr({h:r,s:i,v:o})),o=(o+a)%1;return s}nr.mix=function(e,t,n){n=n===0?0:n||50;var r=nr(e).toRgb(),i=nr(t).toRgb(),o=n/100,s={r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a};return nr(s)};nr.readability=function(e,t){var n=nr(e),r=nr(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)};nr.isReadable=function(e,t,n){var r=nr.readability(e,t),i,o;switch(o=!1,i=Fxt(n),i.level+i.size){case"AAsmall":case"AAAlarge":o=r>=4.5;break;case"AAlarge":o=r>=3;break;case"AAAsmall":o=r>=7;break}return o};nr.mostReadable=function(e,t,n){var r=null,i=0,o,s,a,l;n=n||{},s=n.includeFallbackColors,a=n.level,l=n.size;for(var c=0;ci&&(i=o,r=nr(t[c]));return nr.isReadable(e,r,{level:a,size:l})||!s?r:(n.includeFallbackColors=!1,nr.mostReadable(e,["#fff","#000"],n))};var sae=nr.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Pxt=nr.hexNames=_xt(sae);function _xt(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function JHe(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Bo(e,t){Axt(e)&&(e="100%");var n=Dxt(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function bj(e){return Math.min(1,Math.max(0,e))}function zu(e){return parseInt(e,16)}function Axt(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function Dxt(e){return typeof e=="string"&&e.indexOf("%")!=-1}function hg(e){return e.length==1?"0"+e:""+e}function n$(e){return e<=1&&(e=e*100+"%"),e}function eje(e){return Math.round(parseFloat(e)*255).toString(16)}function m5e(e){return zu(e)/255}var Ph=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",i="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function S1(e){return!!Ph.CSS_UNIT.exec(e)}function Lxt(e){e=e.replace(hxt,"").replace(gxt,"").toLowerCase();var t=!1;if(sae[e])e=sae[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=Ph.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=Ph.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Ph.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=Ph.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Ph.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=Ph.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Ph.hex8.exec(e))?{r:zu(n[1]),g:zu(n[2]),b:zu(n[3]),a:m5e(n[4]),format:t?"name":"hex8"}:(n=Ph.hex6.exec(e))?{r:zu(n[1]),g:zu(n[2]),b:zu(n[3]),format:t?"name":"hex"}:(n=Ph.hex4.exec(e))?{r:zu(n[1]+""+n[1]),g:zu(n[2]+""+n[2]),b:zu(n[3]+""+n[3]),a:m5e(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=Ph.hex3.exec(e))?{r:zu(n[1]+""+n[1]),g:zu(n[2]+""+n[2]),b:zu(n[3]+""+n[3]),format:t?"name":"hex"}:!1}function Fxt(e){var t,n;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:t,size:n}}var Nxt=Object.defineProperty,mn=(e,t)=>Nxt(e,"name",{value:t,configurable:!0});function tje(e,t,n="id"){const i=e.getQueriesData({queryKey:bg(t)}).flatMap(s=>s.slice(1)).flat().filter(s=>s!==void 0),o=new Map;return i.forEach(s=>{s&&s[n]&&o.set(s[n],s)}),Array.from(o.values())}mn(tje,"getCacheDataFromQuery");function nje(e,t,n="id"){return e.find(r=>r[n]===t)}mn(nje,"findDataByKey");function Sj(e,t,n,r="id"){const i=tje(e,t,r);return nje(i,n,r)}mn(Sj,"findQueryData");var an=Ybt();function mge(){const e=an.useUtils(),[t,n]=d.useState(),{data:r,isLoading:i}=an.app_config.findFirst.useQuery({where:{slug:dge.BASE_SETTING}}),o=d.useCallback(()=>{e.app_config.invalidate()},[e]),s=an.app_config.create.useMutation({onSuccess:o}),a=an.app_config.update.useMutation({onSuccess:o}),l=an.app_config.deleteMany.useMutation({onSuccess:o});d.useEffect(()=>{r!=null&&r.meta&&n(r==null?void 0:r.meta)},[r,i]);const c=d.useMemo(()=>{var g;return(g=t==null?void 0:t.appConfig)==null?void 0:g.splashScreen},[t]),u=d.useMemo(()=>{var g;return(g=t==null?void 0:t.appConfig)==null?void 0:g.devDept},[t]),f=d.useMemo(()=>{var g;return((g=t==null?void 0:t.appConfig)==null?void 0:g.slides)||[]},[t]),h=d.useMemo(()=>{var g;return((g=t==null?void 0:t.appConfig)==null?void 0:g.statistics)||{reads:0,staffs:0,courses:0,lectures:0}},[t]);return{create:s,deleteMany:l,update:a,baseSetting:t,splashScreen:c,devDept:u,isLoading:i,slides:f,statistics:h}}mn(mge,"useAppConfig");var dd=function(e){return e[e.CREATED=0]="CREATED",e[e.UPDATED=1]="UPDATED",e[e.DELETED=2]="DELETED",e}({}),SS=dxt(),kxt={[ri.STAFF]:(e,t)=>{var r,i;const n={...e,officer_id:e.officerId,phone_number:e.phoneNumber,dept_name:(r=e.department)==null?void 0:r.name,domain_name:(i=e.domain)==null?void 0:i.name};SS.emit("dataChanged",{type:ri.STAFF,operation:t,data:[n]})},[ri.ROLE_MAP]:(e,t)=>{var r,i,o,s,a;const n={staff_username:(r=e.staff)==null?void 0:r.username,staff_showname:(i=e.staff)==null?void 0:i.showname,staff_officer_id:(o=e.staff)==null?void 0:o.officerId,department_name:(a=(s=e.staff)==null?void 0:s.department)==null?void 0:a.name,...e};SS.emit("dataChanged",{type:ri.ROLE_MAP,operation:t,data:[n]})},[ri.DEPARTMENT]:(e,t)=>{const n={is_domain:e.isDomain,parent_id:e.parentId,has_children:e.hasChildren,...e};SS.emit("dataChanged",{type:ri.DEPARTMENT,operation:t,data:[n]})},[ri.TERM]:(e,t)=>{const n={taxonomy_id:e.taxonomyId,parent_id:e.parentId,has_children:e.hasChildren,...e};SS.emit("dataChanged",{type:ri.TERM,operation:t,data:[n]})}};function gu(e,t,n){const r=kxt[e];r?r(t,n):console.warn(`No emit handler for type: ${e}`)}mn(gu,"emitDataChange");function vge(){const e=Vg(),t=bg(an.department),n=an.department.create.useMutation({onSuccess:mn(s=>{e.invalidateQueries({queryKey:t}),gu(ri.DEPARTMENT,s,dd.CREATED)},"onSuccess")}),r=an.department.update.useMutation({onSuccess:mn(s=>{e.invalidateQueries({queryKey:t}),gu(ri.DEPARTMENT,s,dd.UPDATED)},"onSuccess")});return{softDeleteByIds:an.department.softDeleteByIds.useMutation({onSuccess:mn(s=>{e.invalidateQueries({queryKey:t}),gu(ri.DEPARTMENT,s,dd.DELETED)},"onSuccess")}),update:r,create:n,getDept:mn(s=>Sj(e,an.department,s),"getDept")}}mn(vge,"useDepartment");function Nx(){const e=Vg(),t=bg(an.staff),n=an.staff.create.useMutation({onSuccess:mn(a=>{e.invalidateQueries({queryKey:t}),gu(ri.STAFF,a,dd.CREATED)},"onSuccess")}),r=an.staff.updateUserDomain.useMutation({onSuccess:mn(async a=>{e.invalidateQueries({queryKey:t})},"onSuccess")}),i=an.staff.update.useMutation({onSuccess:mn(a=>{e.invalidateQueries({queryKey:t}),e.invalidateQueries({queryKey:bg(an.post)}),gu(ri.STAFF,a,dd.UPDATED)},"onSuccess")}),o=an.staff.softDeleteByIds.useMutation({onSuccess:mn((a,l)=>{e.invalidateQueries({queryKey:t})},"onSuccess")});return{create:n,update:i,softDeleteByIds:o,getStaff:mn(a=>Sj(e,an.staff,a),"getStaff"),updateUserDomain:r}}mn(Nx,"useStaff");function Cge(){const e=Vg(),t=bg(an.term),n=an.term.create.useMutation({onSuccess:mn(a=>{e.invalidateQueries({queryKey:t}),gu(ri.TERM,a,dd.CREATED)},"onSuccess")}),r=an.term.upsertTags.useMutation({onSuccess:mn(()=>{e.invalidateQueries({queryKey:t})},"onSuccess")}),i=an.term.update.useMutation({onSuccess:mn(a=>{e.invalidateQueries({queryKey:t}),gu(ri.TERM,a,dd.UPDATED)},"onSuccess")}),o=an.term.softDeleteByIds.useMutation({onSuccess:mn((a,l)=>{e.invalidateQueries({queryKey:t})},"onSuccess")});return{create:n,update:i,softDeleteByIds:o,getTerm:mn(a=>Sj(e,an.term,a),"getTerm"),upsertTags:r}}mn(Cge,"useTerm");function yge(){const e=an.useUtils();return{create:an.role.create.useMutation({onSuccess:mn(()=>e.role.findMany.invalidate(),"onSuccess")}),createMany:an.role.createMany.useMutation({onSuccess:mn(()=>e.role.findMany.invalidate(),"onSuccess")}),update:an.role.update.useMutation({onSuccess:mn(()=>e.role.findMany.invalidate(),"onSuccess")}),softDeleteByIds:an.role.softDeleteByIds.useMutation({onSuccess:mn(()=>e.role.findMany.invalidate(),"onSuccess")}),updateOrder:an.role.updateOrder.useMutation({onSuccess:mn(()=>e.role.findMany.invalidate(),"onSuccess")}),findFirst:an.role.findFirst.useQuery,findMany:an.role.findMany.useQuery,findManyWithCursor:an.role.findManyWithCursor.useQuery,findManyWithPagination:an.role.findManyWithPagination.useQuery}}mn(yge,"useRole");function bge(){const e=Vg(),t=bg(an.rolemap),n=an.rolemap.setRoleForObject.useMutation({onSuccess:mn(()=>{e.invalidateQueries({queryKey:t})},"onSuccess")}),r=an.rolemap.setRoleForObjects.useMutation({onSuccess:mn(()=>{e.invalidateQueries({queryKey:t})},"onSuccess")}),i=an.rolemap.addRoleForObjects.useMutation({onSuccess:mn(a=>{e.invalidateQueries({queryKey:t}),gu(ri.ROLE_MAP,a,dd.CREATED)},"onSuccess")}),o=an.rolemap.update.useMutation({onSuccess:mn(()=>{e.invalidateQueries({queryKey:t})},"onSuccess")}),s=an.rolemap.deleteMany.useMutation({onSuccess:mn(a=>{e.invalidateQueries({queryKey:t}),gu(ri.ROLE_MAP,a,dd.DELETED)},"onSuccess")});return{create:n,update:o,setRoleForObjects:r,deleteMany:s,addRoleForObjects:i}}mn(bge,"useRoleMap");function Sge(){const e=Vg(),t=bg(an.transform),n=bg(an.term),r=bg(an.department),i=an.transform.importTerms.useMutation({onSuccess:mn(()=>{e.invalidateQueries({queryKey:t}),e.invalidateQueries({queryKey:n})},"onSuccess")}),o=an.transform.importDepts.useMutation({onSuccess:mn(()=>{e.invalidateQueries({queryKey:t}),e.invalidateQueries({queryKey:r})},"onSuccess")}),s=an.transform.importStaffs.useMutation({onSuccess:mn(()=>{e.invalidateQueries({queryKey:t})},"onSuccess")});return{importTerms:i,importDepts:o,importStaffs:s}}mn(Sge,"useTransform");function rje(){const e=Vg(),t=bg(an.taxonomy),n=an.taxonomy.create.useMutation({onSuccess:mn(()=>{e.invalidateQueries({queryKey:t})},"onSuccess")}),r=mn(l=>an.taxonomy.findById.useQuery({id:l}),"findById"),i=an.taxonomy.update.useMutation({onSuccess:mn(()=>{e.invalidateQueries({queryKey:t})},"onSuccess")}),o=an.taxonomy.delete.useMutation({onSuccess:mn(()=>{e.invalidateQueries({queryKey:t})},"onSuccess")}),s=an.taxonomy.deleteMany.useMutation({onSuccess:mn(()=>{e.invalidateQueries({queryKey:t})},"onSuccess")});return{create:n,findById:r,update:i,deleteItem:o,paginate:mn((l,c)=>an.taxonomy.paginate.useQuery({page:l,pageSize:c}),"paginate"),deleteMany:s}}mn(rje,"useTaxonomy");var dg,zxt=(dg=class{constructor(){Wt(this,"postParams");Wt(this,"postDetailParams");this.postParams=[],this.postDetailParams=[]}static getInstance(){return dg.instance||(dg.instance=new dg),dg.instance}addItem(t){this.postParams.some(r=>{if(t&&r){const i=t.where,o=r.where;return(i==null?void 0:i.parentId)===(o==null?void 0:o.parentId)&&(i==null?void 0:i.type)===(o==null?void 0:o.type)}return!1})||this.postParams.push(t)}addDetailItem(t){this.postDetailParams.some(r=>{if(t&&r){const i=t.where,o=r.where;return(i==null?void 0:i.id)===(o==null?void 0:o.id)}return!1})||this.postDetailParams.push(t)}removeItem(t){this.postParams=this.postParams.filter(n=>{if(t&&n){const r=t.where,i=n.where;return!((r==null?void 0:r.parentId)===(i==null?void 0:i.parentId)&&(r==null?void 0:r.type)===(i==null?void 0:i.type))}return!0})}removeDetailItem(t){this.postDetailParams=this.postDetailParams.filter(n=>{if(t&&n){const r=t.where,i=n.where;return(r==null?void 0:r.id)!==(i==null?void 0:i.id)}return!0})}getItems(){return[...this.postParams]}getDetailItems(){return[...this.postDetailParams]}},mn(dg,"PostParams"),Wt(dg,"instance"),dg);function wge(){const e=an.useUtils(),t=zxt.getInstance(),n=an.visitor.create.useMutation({onSuccess(){e.visitor.invalidate()}}),r=mn(g=>({onMutate:mn(async p=>{const m=[],v=[],C=t.getItems();for(const b of C){await e.post.findManyWithCursor.cancel();const S=e.post.findManyWithCursor.getInfiniteData({...b});m.push(S),e.post.findManyWithCursor.setInfiniteData({...b},w=>w&&{...w,pages:w.pages.map(x=>({...x,items:x.items.map(E=>E.id===(p==null?void 0:p.postId)?g(E,p):E)}))})}const y=t.getDetailItems();for(const b of y){await e.post.findFirst.cancel();const S=e.post.findFirst.getData(b);v.push(S),e.post.findFirst.setData(b,w=>w&&(w.id===(p==null?void 0:p.postId)?g(w,p):w))}return{previousDataList:m,previousDetailDataList:v}},"onMutate"),onError:mn((p,m,v)=>{t.getItems().forEach((y,b)=>{var S;(S=v==null?void 0:v.previousDataList)!=null&&S[b]&&e.post.findManyWithCursor.setInfiniteData({...y},v.previousDataList[b])})},"onError"),onSuccess:mn(async(p,m)=>{await Promise.all([e.visitor.invalidate(),e.post.findFirst.invalidate({where:{id:m==null?void 0:m.postId}}),e.post.findManyWithCursor.invalidate()])},"onSuccess")}),"createOptimisticMutation"),i=an.visitor.create.useMutation(r(g=>({...g,views:(g.views||0)+1,readed:!0}))),o=an.visitor.create.useMutation(r(g=>({...g,likes:(g.likes||0)+1,liked:!0}))),s=an.visitor.deleteMany.useMutation(r(g=>({...g,likes:g.likes-1||0,liked:!1}))),a=an.visitor.create.useMutation(r(g=>({...g,hates:(g.hates||0)+1,hated:!0}))),l=an.visitor.deleteMany.useMutation(r(g=>({...g,hates:g.hates-1||0,hated:!1}))),c=an.visitor.create.useMutation(r(g=>({...g,star:!0}))),u=an.visitor.deleteMany.useMutation(r(g=>({...g,star:!1}))),f=an.visitor.deleteMany.useMutation({onSuccess(){e.visitor.invalidate()}}),h=an.visitor.createMany.useMutation({onSuccess(){e.visitor.invalidate(),e.message.invalidate(),e.post.invalidate()}});return{postParams:t,create:n,createMany:h,deleteMany:f,read:i,addStar:c,deleteStar:u,like:o,unLike:s,hate:a,unHate:l}}mn(wge,"useVisitor");function xge(e,t){const n=an.useUtils(),r=mn(i=>an[e][i].useMutation({onSuccess:mn((s,a,l)=>{var c,u;n[e].invalidate(),(u=(c=t==null?void 0:t[i])==null?void 0:c.onSuccess)==null||u.call(c,s,a,l)},"onSuccess")}),"createMutationHandler");return{create:r("create"),createCourse:r("createCourse"),update:r("update"),deleteMany:r("deleteMany"),softDeleteByIds:r("softDeleteByIds"),restoreByIds:r("restoreByIds"),updateOrder:r("updateOrder"),updateOrderByIds:r("updateOrderByIds")}}mn(xge,"useEntity");function Bxt(){return xge("message")}mn(Bxt,"useMessage");function My(){return Vg(),bg(an.post),xge("post")}mn(My,"usePost");function Hxt(e,t){const n=e*t;return n>70?4:n>42?3:n>21?2:1}mn(Hxt,"getRiskLevel");function jxt(e){if(!e)return 0;const t=_C().diff(_C(e),"day");let n=25;return t>365?n=100:t>90?n=75:t>30&&(n=50),n}mn(jxt,"getDeadlineScore");function Vxt(e,t,n,r,i){const o=_C().diff(_C(i),"day");let s=25;o>365?s=100:o>90?s=75:o>30&&(s=50);let a=.257*e+.325*t+.269*n+.084*s+.065*r;return a>90?4:a>60?3:a>30?2:e*t*n*r!==1?1:0}mn(Vxt,"getTroubleLevel");function Gxt(e,t){return Object.entries(t).reduce((n,[r,i])=>(i!=null&&(n[r]=i),n),{...e})}mn(Gxt,"mergeIfDefined");function Wxt(e){return Object.entries(e).map(([t,n])=>({label:n,value:t}))}mn(Wxt,"convertToOptions");function ije(e,t){return e>t?t:e}mn(ije,"upperBound");function oje(e,t){return e{const r=new FileReader;r.onload=async i=>{var o;try{const s=(o=i.target)==null?void 0:o.result,a=await crypto.subtle.digest("SHA-256",s),c=Array.from(new Uint8Array(a)).map(u=>u.toString(16).padStart(2,"0")).join("");t(`${c}-${e.size}`)}catch(s){n(s)}},r.onerror=n,r.readAsArrayBuffer(e.slice(0,2*1024*1024))})}mn(qxt,"calculateFileIdentifier");function aae(e,t){return nr(e).lighten(t).toString()}mn(aae,"lightenColor");function Kxt(e={}){const[t,n]=d.useState(e.initialSelected??[]),r=e.mode??(e.maxSelection===1?"single":"multiple"),i=mn(u=>{r==="single"?n([u]):t.includes(u)||(e.maxSelection===void 0||t.length[...f,u])},"select"),o=mn(u=>{n(f=>f.filter(h=>h!==u))},"deselect"),s=mn(u=>{t.includes(u)?o(u):i(u)},"toggle"),a=mn(()=>{n([])},"clear"),l=mn(u=>t.includes(u),"isSelected"),c=d.useMemo(()=>t.length===0,[t]);return{selected:t,select:i,deselect:o,toggle:s,clear:a,isSelected:l,isEmpty:c,setSelected:n}}mn(Kxt,"useCheckBox");function Yxt(e){const[t,n]=d.useState(e?[e]:[]),r=mn(u=>n(f=>[...f,u]),"push"),i=mn(()=>n(u=>u.length>0?u.slice(0,-1):u),"pop"),o=mn(u=>{n(f=>{const h=f.lastIndexOf(u);return h>=0&&ht[t.length-1],"peek"),a=d.useMemo(()=>t.length===0,[t,e]),l=d.useMemo(()=>e!==void 0?t.length===1&&t[0]===e:t.length===0,[t,e]);return{stack:t,setStack:n,push:r,pop:i,popToItem:o,peek:s,isEmpty:a,clear:mn(()=>n(e?[e]:[]),"clear"),isOnlyDefaultItem:l}}mn(Yxt,"useStack");function Xxt(e,t=0){const n=ce.useRef(),r=ce.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=void 0)},[]),i=ce.useCallback(()=>{r(),n.current=setTimeout(()=>{e(),n.current=void 0},t)},[r,t,e]);return ce.useEffect(()=>()=>r(),[r]),{startTimer:i,clearTimer:r,isActive:n.current!==void 0}}mn(Xxt,"useTimeout");var t5=function(e){return e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED",e}({}),v5e=function(e){return e[e.NORMAL=1e3]="NORMAL",e[e.ABNORMAL=1006]="ABNORMAL",e[e.SERVICE_RESTART=1012]="SERVICE_RESTART",e[e.TRY_AGAIN_LATER=1013]="TRY_AGAIN_LATER",e}({}),Qxt={initialRetryDelay:1e3,maxRetryDelay:3e4,maxRetryAttempts:10,jitter:.1},Zxt={retryOnError:!0},Aw;Aw=class{constructor(t){Wt(this,"ws",null);Wt(this,"readyState",t5.CLOSED);Wt(this,"retryCount",0);Wt(this,"reconnectTimer");Wt(this,"messageQueue",[]);Wt(this,"destroyed",!1);Wt(this,"options");Wt(this,"config");Wt(this,"flushMessageQueue",mn(async()=>{var t;if(((t=this.ws)==null?void 0:t.readyState)===t5.OPEN){const n=[...this.messageQueue];this.messageQueue=[];for(const r of n)try{await this.send(r)}catch{this.messageQueue.push(r)}}},"flushMessageQueue"));Wt(this,"createWebSocket",mn(async()=>{try{console.log(`[WebSocket] Attempting to connect to ${this.getWebSocketUrl()}`);const t=new WebSocket(this.getWebSocketUrl(),this.options.protocols);return this.readyState=t5.CONNECTING,t.onopen=n=>{var r,i;console.log("[WebSocket] Connection established successfully"),this.ws=t,this.readyState=t5.OPEN,this.retryCount=0,this.flushMessageQueue(),(i=(r=this.options).onOpen)==null||i.call(r,n)},t.onclose=n=>{var r,i;console.log(`[WebSocket] Connection closed with code: ${n.code}, reason: ${n.reason}`),this.readyState=t5.CLOSED,(i=(r=this.options).onClose)==null||i.call(r,n),!this.destroyed&&this.options.retryOnError&&n.code!==v5e.NORMAL&&(console.log("[WebSocket] Abnormal closure, attempting to reconnect..."),this.handleReconnect())},t.onerror=n=>{var r,i;console.error("[WebSocket] Error occurred:",n),(i=(r=this.options).onError)==null||i.call(r,n)},t.onmessage=n=>{var i,o;console.debug("[WebSocket] Message received:",n.data);let r=typeof n.data=="string"?JSON.parse(n.data):n.data;(o=(i=this.options).onMessage)==null||o.call(i,r)},this.ws=t,t}catch(t){throw console.error("[WebSocket] Failed to create connection:",t),t}},"createWebSocket"));Wt(this,"handleReconnect",mn(async()=>{var n,r;if(this.destroyed){console.log("[WebSocket] Instance destroyed, skipping reconnection");return}if(this.retryCount>=this.config.maxRetryAttempts){console.warn(`[WebSocket] Max retry attempts (${this.config.maxRetryAttempts}) reached`),(r=(n=this.options).onMaxRetries)==null||r.call(n);return}if(this.reconnectTimer){console.log("[WebSocket] Reconnection already in progress");return}const t=this.getNextRetryDelay();console.log(`[WebSocket] Scheduling reconnection attempt ${this.retryCount+1}/${this.config.maxRetryAttempts} in ${t}ms`),this.reconnectTimer=setTimeout(async()=>{var i,o;try{this.retryCount++,this.ws&&(console.log("[WebSocket] Closing existing connection before reconnect"),this.ws.close(),this.ws=null),await this.createWebSocket(),console.log(`[WebSocket] Reconnection attempt ${this.retryCount+1} successful`),(o=(i=this.options).onReconnect)==null||o.call(i,this.retryCount+1)}catch(s){console.error(`[WebSocket] Reconnection attempt ${this.retryCount+1} failed:`,s),await this.handleReconnect()}finally{this.reconnectTimer=void 0}},t)},"handleReconnect"));Wt(this,"connect",mn(async()=>{if(!(this.ws||this.destroyed))try{await this.createWebSocket()}catch{this.options.retryOnError&&await this.handleReconnect()}},"connect"));Wt(this,"reconnect",mn(async()=>{this.ws&&(this.ws.close(),this.ws=null),await this.handleReconnect()},"reconnect"));Wt(this,"disconnect",mn(()=>{this.destroyed=!0,this.reconnectTimer&&(console.log("[WebSocket] Clearing reconnect timer"),clearTimeout(this.reconnectTimer),this.reconnectTimer=void 0),this.ws&&(console.log("[WebSocket] Closing connection"),this.ws.close(v5e.NORMAL),this.ws=null),this.retryCount=0,this.messageQueue=[]},"disconnect"));this.options={...Zxt,...t},this.config={...Qxt,...t},this.options.manualConnect||this.connect()}getWebSocketUrl(){if(!this.options.url)throw new Error("WebSocket URL is required");const t=this.options.url,n=this.options.params||{},r=Object.entries(n).map(([i,o])=>`${encodeURIComponent(i)}=${encodeURIComponent(o)}`).join("&");return r?`${t}${t.includes("?")?"&":"?"}${r}`:t}getNextRetryDelay(){const{initialRetryDelay:t,maxRetryDelay:n,jitter:r}=this.config,i=Math.min(t*Math.pow(2,this.retryCount),n),o=i*r*(Math.random()*2-1);return Math.max(0,Math.floor(i+o))}send(t){return new Promise((n,r)=>{if(!this.ws||this.ws.readyState!==t5.OPEN){console.warn("[WebSocket] Cannot send message - connection not open"),this.messageQueue.push(t),r(new Error("WebSocket is not connected or not open"));return}try{const i=typeof t=="string"?t:JSON.stringify(t);console.debug("[WebSocket] Sending message:",i),this.ws.send(i),n()}catch(i){console.error("[WebSocket] Failed to send message:",i),r(i)}})}getWs(){return this.ws}getReadyState(){return this.readyState}getRetryCount(){return this.retryCount}},mn(Aw,"WebSocketClient");class Jxt{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(t,n){this.keyToValue.set(t,n),this.valueToKey.set(n,t)}getByKey(t){return this.keyToValue.get(t)}getByValue(t){return this.valueToKey.get(t)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}}let sje=class{constructor(t){this.generateIdentifier=t,this.kv=new Jxt}register(t,n){this.kv.getByValue(t)||(n||(n=this.generateIdentifier(t)),this.kv.set(n,t))}clear(){this.kv.clear()}getIdentifier(t){return this.kv.getByValue(t)}getValue(t){return this.kv.getByKey(t)}};class e9t extends sje{constructor(){super(t=>t.name),this.classToAllowedProps=new Map}register(t,n){typeof n=="object"?(n.allowProps&&this.classToAllowedProps.set(t,n.allowProps),super.register(t,n.identifier)):super.register(t,n)}getAllowedProps(t){return this.classToAllowedProps.get(t)}}function t9t(e){if("values"in Object)return Object.values(e);const t=[];for(const n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function n9t(e,t){const n=t9t(e);if("find"in n)return n.find(t);const r=n;for(let i=0;it(r,n))}function JF(e,t){return e.indexOf(t)!==-1}function C5e(e,t){for(let n=0;nn.isApplicable(t))}findByName(t){return this.transfomers[t]}}const i9t=e=>Object.prototype.toString.call(e).slice(8,-1),aje=e=>typeof e>"u",o9t=e=>e===null,hT=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,lae=e=>hT(e)&&Object.keys(e).length===0,q4=e=>Array.isArray(e),s9t=e=>typeof e=="string",a9t=e=>typeof e=="number"&&!isNaN(e),l9t=e=>typeof e=="boolean",c9t=e=>e instanceof RegExp,gT=e=>e instanceof Map,pT=e=>e instanceof Set,lje=e=>i9t(e)==="Symbol",u9t=e=>e instanceof Date&&!isNaN(e.valueOf()),d9t=e=>e instanceof Error,y5e=e=>typeof e=="number"&&isNaN(e),f9t=e=>l9t(e)||o9t(e)||aje(e)||a9t(e)||s9t(e)||lje(e),h9t=e=>typeof e=="bigint",g9t=e=>e===1/0||e===-1/0,p9t=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),m9t=e=>e instanceof URL,cje=e=>e.replace(/\./g,"\\."),pee=e=>e.map(String).map(cje).join("."),B$=e=>{const t=[];let n="";for(let i=0;inull,()=>{}),Cp(h9t,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),Cp(u9t,"Date",e=>e.toISOString(),e=>new Date(e)),Cp(d9t,"Error",(e,t)=>{const n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(r=>{n[r]=e[r]}),n},(e,t)=>{const n=new Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(r=>{n[r]=e[r]}),n}),Cp(c9t,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),Cp(pT,"set",e=>[...e.values()],e=>new Set(e)),Cp(gT,"map",e=>[...e.entries()],e=>new Map(e)),Cp(e=>y5e(e)||g9t(e),"number",e=>y5e(e)?"NaN":e>0?"Infinity":"-Infinity",Number),Cp(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),Cp(m9t,"URL",e=>e.toString(),e=>new URL(e))];function wj(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}const dje=wj((e,t)=>lje(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{const r=n.symbolRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown symbol");return r}),v9t=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),fje=wj(p9t,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=v9t[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function hje(e,t){return e!=null&&e.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}const gje=wj(hje,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};const r={};return n.forEach(i=>{r[i]=e[i]}),r},(e,t,n)=>{const r=n.classRegistry.getValue(t[1]);if(!r)throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(r.prototype),e)}),pje=wj((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{const r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw new Error("Trying to deserialize unknown custom value");return r.deserialize(e)}),C9t=[gje,dje,pje,fje],b5e=(e,t)=>{const n=C5e(C9t,i=>i.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const r=C5e(uje,i=>i.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},mje={};uje.forEach(e=>{mje[e.annotation]=e});const y9t=(e,t,n)=>{if(q4(t))switch(t[0]){case"symbol":return dje.untransform(e,t,n);case"class":return gje.untransform(e,t,n);case"custom":return pje.untransform(e,t,n);case"typed-array":return fje.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const r=mje[t];if(!r)throw new Error("Unknown transformation: "+t);return r.untransform(e,n)}},wS=(e,t)=>{if(t>e.size)throw new Error("index out of bounds");const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function vje(e){if(JF(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(JF(e,"prototype"))throw new Error("prototype is not allowed as a property");if(JF(e,"constructor"))throw new Error("constructor is not allowed as a property")}const b9t=(e,t)=>{vje(t);for(let n=0;n{if(vje(t),t.length===0)return n(e);let r=e;for(let o=0;ouae(o,t,[...n,...B$(s)]));return}const[r,i]=e;i&&e7(i,(o,s)=>{uae(o,t,[...n,...B$(s)])}),t(r,n)}function S9t(e,t,n){return uae(t,(r,i)=>{e=cae(e,i,o=>y9t(o,r,n))}),e}function w9t(e,t){function n(r,i){const o=b9t(e,B$(i));r.map(B$).forEach(s=>{e=cae(e,s,()=>o)})}if(q4(t)){const[r,i]=t;r.forEach(o=>{e=cae(e,B$(o),()=>e)}),i&&e7(i,n)}else e7(t,n);return e}const x9t=(e,t)=>hT(e)||q4(e)||gT(e)||pT(e)||hje(e,t);function E9t(e,t,n){const r=n.get(e);r?r.push(t):n.set(e,[t])}function R9t(e,t){const n={};let r;return e.forEach(i=>{if(i.length<=1)return;t||(i=i.map(a=>a.map(String)).sort((a,l)=>a.length-l.length));const[o,...s]=i;o.length===0?r=s.map(pee):n[pee(o)]=s.map(pee)}),r?lae(n)?[r]:[r,n]:lae(n)?void 0:n}const Cje=(e,t,n,r,i=[],o=[],s=new Map)=>{const a=f9t(e);if(!a){E9t(e,i,t);const g=s.get(e);if(g)return r?{transformedValue:null}:g}if(!x9t(e,n)){const g=b5e(e,n),p=g?{transformedValue:g.value,annotations:[g.type]}:{transformedValue:e};return a||s.set(e,p),p}if(JF(o,e))return{transformedValue:null};const l=b5e(e,n),c=(l==null?void 0:l.value)??e,u=q4(c)?[]:{},f={};e7(c,(g,p)=>{if(p==="__proto__"||p==="constructor"||p==="prototype")throw new Error(`Detected property ${p}. This is a prototype pollution risk, please remove it from your object.`);const m=Cje(g,t,n,r,[...i,p],[...o,e],s);u[p]=m.transformedValue,q4(m.annotations)?f[p]=m.annotations:hT(m.annotations)&&e7(m.annotations,(v,C)=>{f[cje(p)+"."+C]=v})});const h=lae(f)?{transformedValue:u,annotations:l?[l.type]:void 0}:{transformedValue:u,annotations:l?[l.type,f]:f};return a||s.set(e,h),h};function yje(e){return Object.prototype.toString.call(e).slice(8,-1)}function S5e(e){return yje(e)==="Array"}function $9t(e){if(yje(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function O9t(e,t,n,r,i){const o={}.propertyIsEnumerable.call(r,t)?"enumerable":"nonenumerable";o==="enumerable"&&(e[t]=n),i&&o==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function dae(e,t={}){if(S5e(e))return e.map(i=>dae(i,t));if(!$9t(e))return e;const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((i,o)=>{if(S5e(t.props)&&!t.props.includes(o))return i;const s=e[o],a=dae(s,t);return O9t(i,o,a,e,t.nonenumerable),i},{})}class di{constructor({dedupe:t=!1}={}){this.classRegistry=new e9t,this.symbolRegistry=new sje(n=>n.description??""),this.customTransformerRegistry=new r9t,this.allowedErrorProps=[],this.dedupe=t}serialize(t){const n=new Map,r=Cje(t,n,this,this.dedupe),i={json:r.transformedValue};r.annotations&&(i.meta={...i.meta,values:r.annotations});const o=R9t(n,this.dedupe);return o&&(i.meta={...i.meta,referentialEqualities:o}),i}deserialize(t){const{json:n,meta:r}=t;let i=dae(n);return r!=null&&r.values&&(i=S9t(i,r.values,this)),r!=null&&r.referentialEqualities&&(i=w9t(i,r.referentialEqualities)),i}stringify(t){return JSON.stringify(this.serialize(t))}parse(t){return this.deserialize(JSON.parse(t))}registerClass(t,n){this.classRegistry.register(t,n)}registerSymbol(t,n){this.symbolRegistry.register(t,n)}registerCustom(t,n){this.customTransformerRegistry.register({name:n,...t})}allowErrorProps(...t){this.allowedErrorProps.push(...t)}}di.defaultInstance=new di;di.serialize=di.defaultInstance.serialize.bind(di.defaultInstance);di.deserialize=di.defaultInstance.deserialize.bind(di.defaultInstance);di.stringify=di.defaultInstance.stringify.bind(di.defaultInstance);di.parse=di.defaultInstance.parse.bind(di.defaultInstance);di.registerClass=di.defaultInstance.registerClass.bind(di.defaultInstance);di.registerSymbol=di.defaultInstance.registerSymbol.bind(di.defaultInstance);di.registerCustom=di.defaultInstance.registerCustom.bind(di.defaultInstance);di.allowErrorProps=di.defaultInstance.allowErrorProps.bind(di.defaultInstance);di.serialize;di.deserialize;di.stringify;di.parse;di.registerClass;di.registerCustom;di.registerSymbol;di.allowErrorProps;function bje(e,t){return function(){return e.apply(t,arguments)}}const{toString:T9t}=Object.prototype,{getPrototypeOf:Ege}=Object,xj=(e=>t=>{const n=T9t.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Gg=e=>(e=e.toLowerCase(),t=>xj(t)===e),Ej=e=>t=>typeof t===e,{isArray:kx}=Array,mT=Ej("undefined");function I9t(e){return e!==null&&!mT(e)&&e.constructor!==null&&!mT(e.constructor)&&fd(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Sje=Gg("ArrayBuffer");function M9t(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Sje(e.buffer),t}const P9t=Ej("string"),fd=Ej("function"),wje=Ej("number"),Rj=e=>e!==null&&typeof e=="object",_9t=e=>e===!0||e===!1,eN=e=>{if(xj(e)!=="object")return!1;const t=Ege(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},A9t=Gg("Date"),D9t=Gg("File"),L9t=Gg("Blob"),F9t=Gg("FileList"),N9t=e=>Rj(e)&&fd(e.pipe),k9t=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||fd(e.append)&&((t=xj(e))==="formdata"||t==="object"&&fd(e.toString)&&e.toString()==="[object FormData]"))},z9t=Gg("URLSearchParams"),[B9t,H9t,j9t,V9t]=["ReadableStream","Request","Response","Headers"].map(Gg),G9t=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function WI(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),kx(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}const $8=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Eje=e=>!mT(e)&&e!==$8;function fae(){const{caseless:e}=Eje(this)&&this||{},t={},n=(r,i)=>{const o=e&&xje(t,i)||i;eN(t[o])&&eN(r)?t[o]=fae(t[o],r):eN(r)?t[o]=fae({},r):kx(r)?t[o]=r.slice():t[o]=r};for(let r=0,i=arguments.length;r(WI(t,(i,o)=>{n&&fd(i)?e[o]=bje(i,n):e[o]=i},{allOwnKeys:r}),e),U9t=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),q9t=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},K9t=(e,t,n,r)=>{let i,o,s;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],(!r||r(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=n!==!1&&Ege(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Y9t=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},X9t=e=>{if(!e)return null;if(kx(e))return e;let t=e.length;if(!wje(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Q9t=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ege(Uint8Array)),Z9t=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},J9t=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},eEt=Gg("HTMLFormElement"),tEt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),w5e=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),nEt=Gg("RegExp"),Rje=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};WI(n,(i,o)=>{let s;(s=t(i,o,e))!==!1&&(r[o]=s||i)}),Object.defineProperties(e,r)},rEt=e=>{Rje(e,(t,n)=>{if(fd(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(fd(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},iEt=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return kx(e)?r(e):r(String(e).split(t)),n},oEt=()=>{},sEt=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,mee="abcdefghijklmnopqrstuvwxyz",x5e="0123456789",$je={DIGIT:x5e,ALPHA:mee,ALPHA_DIGIT:mee+mee.toUpperCase()+x5e},aEt=(e=16,t=$je.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function lEt(e){return!!(e&&fd(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const cEt=e=>{const t=new Array(10),n=(r,i)=>{if(Rj(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const o=kx(r)?[]:{};return WI(r,(s,a)=>{const l=n(s,i+1);!mT(l)&&(o[a]=l)}),t[i]=void 0,o}}return r};return n(e,0)},uEt=Gg("AsyncFunction"),dEt=e=>e&&(Rj(e)||fd(e))&&fd(e.then)&&fd(e.catch),Oje=((e,t)=>e?setImmediate:t?((n,r)=>($8.addEventListener("message",({source:i,data:o})=>{i===$8&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),$8.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",fd($8.postMessage)),fEt=typeof queueMicrotask<"u"?queueMicrotask.bind($8):typeof process<"u"&&process.nextTick||Oje,Nt={isArray:kx,isArrayBuffer:Sje,isBuffer:I9t,isFormData:k9t,isArrayBufferView:M9t,isString:P9t,isNumber:wje,isBoolean:_9t,isObject:Rj,isPlainObject:eN,isReadableStream:B9t,isRequest:H9t,isResponse:j9t,isHeaders:V9t,isUndefined:mT,isDate:A9t,isFile:D9t,isBlob:L9t,isRegExp:nEt,isFunction:fd,isStream:N9t,isURLSearchParams:z9t,isTypedArray:Q9t,isFileList:F9t,forEach:WI,merge:fae,extend:W9t,trim:G9t,stripBOM:U9t,inherits:q9t,toFlatObject:K9t,kindOf:xj,kindOfTest:Gg,endsWith:Y9t,toArray:X9t,forEachEntry:Z9t,matchAll:J9t,isHTMLForm:eEt,hasOwnProperty:w5e,hasOwnProp:w5e,reduceDescriptors:Rje,freezeMethods:rEt,toObjectSet:iEt,toCamelCase:tEt,noop:oEt,toFiniteNumber:sEt,findKey:xje,global:$8,isContextDefined:Eje,ALPHABET:$je,generateString:aEt,isSpecCompliantForm:lEt,toJSONObject:cEt,isAsyncFn:uEt,isThenable:dEt,setImmediate:Oje,asap:fEt};function Hr(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}Nt.inherits(Hr,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Nt.toJSONObject(this.config),code:this.code,status:this.status}}});const Tje=Hr.prototype,Ije={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Ije[e]={value:e}});Object.defineProperties(Hr,Ije);Object.defineProperty(Tje,"isAxiosError",{value:!0});Hr.from=(e,t,n,r,i,o)=>{const s=Object.create(Tje);return Nt.toFlatObject(e,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),Hr.call(s,e.message,t,n,r,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};const hEt=null;function hae(e){return Nt.isPlainObject(e)||Nt.isArray(e)}function Mje(e){return Nt.endsWith(e,"[]")?e.slice(0,-2):e}function E5e(e,t,n){return e?e.concat(t).map(function(i,o){return i=Mje(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function gEt(e){return Nt.isArray(e)&&!e.some(hae)}const pEt=Nt.toFlatObject(Nt,{},null,function(t){return/^is[A-Z]/.test(t)});function $j(e,t,n){if(!Nt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Nt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,v){return!Nt.isUndefined(v[m])});const r=n.metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&Nt.isSpecCompliantForm(t);if(!Nt.isFunction(i))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(Nt.isDate(p))return p.toISOString();if(!l&&Nt.isBlob(p))throw new Hr("Blob is not supported. Use a Buffer instead.");return Nt.isArrayBuffer(p)||Nt.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,m,v){let C=p;if(p&&!v&&typeof p=="object"){if(Nt.endsWith(m,"{}"))m=r?m:m.slice(0,-2),p=JSON.stringify(p);else if(Nt.isArray(p)&&gEt(p)||(Nt.isFileList(p)||Nt.endsWith(m,"[]"))&&(C=Nt.toArray(p)))return m=Mje(m),C.forEach(function(b,S){!(Nt.isUndefined(b)||b===null)&&t.append(s===!0?E5e([m],S,o):s===null?m:m+"[]",c(b))}),!1}return hae(p)?!0:(t.append(E5e(v,m,o),c(p)),!1)}const f=[],h=Object.assign(pEt,{defaultVisitor:u,convertValue:c,isVisitable:hae});function g(p,m){if(!Nt.isUndefined(p)){if(f.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));f.push(p),Nt.forEach(p,function(C,y){(!(Nt.isUndefined(C)||C===null)&&i.call(t,C,Nt.isString(y)?y.trim():y,m,h))===!0&&g(C,m?m.concat(y):[y])}),f.pop()}}if(!Nt.isObject(e))throw new TypeError("data must be an object");return g(e),t}function R5e(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Rge(e,t){this._pairs=[],e&&$j(e,this,t)}const Pje=Rge.prototype;Pje.append=function(t,n){this._pairs.push([t,n])};Pje.toString=function(t){const n=t?function(r){return t.call(this,r,R5e)}:R5e;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function mEt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function _je(e,t,n){if(!t)return e;const r=n&&n.encode||mEt;Nt.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(i?o=i(t,n):o=Nt.isURLSearchParams(t)?t.toString():new Rge(t,n).toString(r),o){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class $5e{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Nt.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Aje={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},vEt=typeof URLSearchParams<"u"?URLSearchParams:Rge,CEt=typeof FormData<"u"?FormData:null,yEt=typeof Blob<"u"?Blob:null,bEt={isBrowser:!0,classes:{URLSearchParams:vEt,FormData:CEt,Blob:yEt},protocols:["http","https","file","blob","url","data"]},$ge=typeof window<"u"&&typeof document<"u",gae=typeof navigator=="object"&&navigator||void 0,SEt=$ge&&(!gae||["ReactNative","NativeScript","NS"].indexOf(gae.product)<0),wEt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",xEt=$ge&&window.location.href||"http://localhost",EEt=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:$ge,hasStandardBrowserEnv:SEt,hasStandardBrowserWebWorkerEnv:wEt,navigator:gae,origin:xEt},Symbol.toStringTag,{value:"Module"})),Ll={...EEt,...bEt};function REt(e,t){return $j(e,new Ll.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return Ll.isNode&&Nt.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function $Et(e){return Nt.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function OEt(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r=n.length;return s=!s&&Nt.isArray(i)?i.length:s,l?(Nt.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!Nt.isObject(i[s]))&&(i[s]=[]),t(n,r,i[s],o)&&Nt.isArray(i[s])&&(i[s]=OEt(i[s])),!a)}if(Nt.isFormData(e)&&Nt.isFunction(e.entries)){const n={};return Nt.forEachEntry(e,(r,i)=>{t($Et(r),i,n,0)}),n}return null}function TEt(e,t,n){if(Nt.isString(e))try{return(t||JSON.parse)(e),Nt.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const UI={transitional:Aje,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=Nt.isObject(t);if(o&&Nt.isHTMLForm(t)&&(t=new FormData(t)),Nt.isFormData(t))return i?JSON.stringify(Dje(t)):t;if(Nt.isArrayBuffer(t)||Nt.isBuffer(t)||Nt.isStream(t)||Nt.isFile(t)||Nt.isBlob(t)||Nt.isReadableStream(t))return t;if(Nt.isArrayBufferView(t))return t.buffer;if(Nt.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return REt(t,this.formSerializer).toString();if((a=Nt.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return $j(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),TEt(t)):t}],transformResponse:[function(t){const n=this.transitional||UI.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(Nt.isResponse(t)||Nt.isReadableStream(t))return t;if(t&&Nt.isString(t)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?Hr.from(a,Hr.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ll.classes.FormData,Blob:Ll.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Nt.forEach(["delete","get","head","post","put","patch"],e=>{UI.headers[e]={}});const IEt=Nt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),MEt=e=>{const t={};let n,r,i;return e&&e.split(` +`).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||t[n]&&IEt[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},O5e=Symbol("internals");function WE(e){return e&&String(e).trim().toLowerCase()}function tN(e){return e===!1||e==null?e:Nt.isArray(e)?e.map(tN):String(e)}function PEt(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const _Et=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function vee(e,t,n,r,i){if(Nt.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!Nt.isString(t)){if(Nt.isString(r))return t.indexOf(r)!==-1;if(Nt.isRegExp(r))return r.test(t)}}function AEt(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function DEt(e,t){const n=Nt.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,o,s){return this[r].call(this,t,i,o,s)},configurable:!0})})}class pu{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(a,l,c){const u=WE(l);if(!u)throw new Error("header name must be a non-empty string");const f=Nt.findKey(i,u);(!f||i[f]===void 0||c===!0||c===void 0&&i[f]!==!1)&&(i[f||l]=tN(a))}const s=(a,l)=>Nt.forEach(a,(c,u)=>o(c,u,l));if(Nt.isPlainObject(t)||t instanceof this.constructor)s(t,n);else if(Nt.isString(t)&&(t=t.trim())&&!_Et(t))s(MEt(t),n);else if(Nt.isHeaders(t))for(const[a,l]of t.entries())o(l,a,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=WE(t),t){const r=Nt.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return PEt(i);if(Nt.isFunction(n))return n.call(this,i,r);if(Nt.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=WE(t),t){const r=Nt.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||vee(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(s){if(s=WE(s),s){const a=Nt.findKey(r,s);a&&(!n||vee(r,r[a],a,n))&&(delete r[a],i=!0)}}return Nt.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||vee(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return Nt.forEach(this,(i,o)=>{const s=Nt.findKey(r,o);if(s){n[s]=tN(i),delete n[o];return}const a=t?AEt(o):String(o).trim();a!==o&&delete n[o],n[a]=tN(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return Nt.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&Nt.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[O5e]=this[O5e]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=WE(s);r[a]||(DEt(i,s),r[a]=!0)}return Nt.isArray(t)?t.forEach(o):o(t),this}}pu.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Nt.reduceDescriptors(pu.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});Nt.freezeMethods(pu);function Cee(e,t){const n=this||UI,r=t||n,i=pu.from(r.headers);let o=r.data;return Nt.forEach(e,function(a){o=a.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function Lje(e){return!!(e&&e.__CANCEL__)}function zx(e,t,n){Hr.call(this,e??"canceled",Hr.ERR_CANCELED,t,n),this.name="CanceledError"}Nt.inherits(zx,Hr,{__CANCEL__:!0});function Fje(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Hr("Request failed with status code "+n.status,[Hr.ERR_BAD_REQUEST,Hr.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function LEt(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function FEt(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,s;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=r[o];s||(s=c),n[i]=l,r[i]=c;let f=o,h=0;for(;f!==i;)h+=n[f++],f=f%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),c-s{n=u,i=null,o&&(clearTimeout(o),o=null),e.apply(null,c)};return[(...c)=>{const u=Date.now(),f=u-n;f>=r?s(c,u):(i=c,o||(o=setTimeout(()=>{o=null,s(i)},r-f)))},()=>i&&s(i)]}const pz=(e,t,n=3)=>{let r=0;const i=FEt(50,250);return NEt(o=>{const s=o.loaded,a=o.lengthComputable?o.total:void 0,l=s-r,c=i(l),u=s<=a;r=s;const f={loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-s)/c:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(f)},n)},T5e=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},I5e=e=>(...t)=>Nt.asap(()=>e(...t)),kEt=Ll.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ll.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ll.origin),Ll.navigator&&/(msie|trident)/i.test(Ll.navigator.userAgent)):()=>!0,zEt=Ll.hasStandardBrowserEnv?{write(e,t,n,r,i,o){const s=[e+"="+encodeURIComponent(t)];Nt.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),Nt.isString(r)&&s.push("path="+r),Nt.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function BEt(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function HEt(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Nje(e,t){return e&&!BEt(t)?HEt(e,t):t}const M5e=e=>e instanceof pu?{...e}:e;function AC(e,t){t=t||{};const n={};function r(c,u,f,h){return Nt.isPlainObject(c)&&Nt.isPlainObject(u)?Nt.merge.call({caseless:h},c,u):Nt.isPlainObject(u)?Nt.merge({},u):Nt.isArray(u)?u.slice():u}function i(c,u,f,h){if(Nt.isUndefined(u)){if(!Nt.isUndefined(c))return r(void 0,c,f,h)}else return r(c,u,f,h)}function o(c,u){if(!Nt.isUndefined(u))return r(void 0,u)}function s(c,u){if(Nt.isUndefined(u)){if(!Nt.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,f){if(f in t)return r(c,u);if(f in e)return r(void 0,c)}const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,u,f)=>i(M5e(c),M5e(u),f,!0)};return Nt.forEach(Object.keys(Object.assign({},e,t)),function(u){const f=l[u]||i,h=f(e[u],t[u],u);Nt.isUndefined(h)&&f!==a||(n[u]=h)}),n}const kje=e=>{const t=AC({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=t;t.headers=s=pu.from(s),t.url=_je(Nje(t.baseURL,t.url),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(Nt.isFormData(n)){if(Ll.hasStandardBrowserEnv||Ll.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((l=s.getContentType())!==!1){const[c,...u]=l?l.split(";").map(f=>f.trim()).filter(Boolean):[];s.setContentType([c||"multipart/form-data",...u].join("; "))}}if(Ll.hasStandardBrowserEnv&&(r&&Nt.isFunction(r)&&(r=r(t)),r||r!==!1&&kEt(t.url))){const c=i&&o&&zEt.read(o);c&&s.set(i,c)}return t},jEt=typeof XMLHttpRequest<"u",VEt=jEt&&function(e){return new Promise(function(n,r){const i=kje(e);let o=i.data;const s=pu.from(i.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=i,u,f,h,g,p;function m(){g&&g(),p&&p(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let v=new XMLHttpRequest;v.open(i.method.toUpperCase(),i.url,!0),v.timeout=i.timeout;function C(){if(!v)return;const b=pu.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),w={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:b,config:e,request:v};Fje(function(E){n(E),m()},function(E){r(E),m()},w),v=null}"onloadend"in v?v.onloadend=C:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(C)},v.onabort=function(){v&&(r(new Hr("Request aborted",Hr.ECONNABORTED,e,v)),v=null)},v.onerror=function(){r(new Hr("Network Error",Hr.ERR_NETWORK,e,v)),v=null},v.ontimeout=function(){let S=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const w=i.transitional||Aje;i.timeoutErrorMessage&&(S=i.timeoutErrorMessage),r(new Hr(S,w.clarifyTimeoutError?Hr.ETIMEDOUT:Hr.ECONNABORTED,e,v)),v=null},o===void 0&&s.setContentType(null),"setRequestHeader"in v&&Nt.forEach(s.toJSON(),function(S,w){v.setRequestHeader(w,S)}),Nt.isUndefined(i.withCredentials)||(v.withCredentials=!!i.withCredentials),a&&a!=="json"&&(v.responseType=i.responseType),c&&([h,p]=pz(c,!0),v.addEventListener("progress",h)),l&&v.upload&&([f,g]=pz(l),v.upload.addEventListener("progress",f),v.upload.addEventListener("loadend",g)),(i.cancelToken||i.signal)&&(u=b=>{v&&(r(!b||b.type?new zx(null,e,v):b),v.abort(),v=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const y=LEt(i.url);if(y&&Ll.protocols.indexOf(y)===-1){r(new Hr("Unsupported protocol "+y+":",Hr.ERR_BAD_REQUEST,e));return}v.send(o||null)})},GEt=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const o=function(c){if(!i){i=!0,a();const u=c instanceof Error?c:this.reason;r.abort(u instanceof Hr?u:new zx(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,o(new Hr(`timeout ${t} of ms exceeded`,Hr.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(o):c.removeEventListener("abort",o)}),e=null)};e.forEach(c=>c.addEventListener("abort",o));const{signal:l}=r;return l.unsubscribe=()=>Nt.asap(a),l}},WEt=function*(e,t){let n=e.byteLength;if(n{const i=UEt(e,t);let o=0,s,a=l=>{s||(s=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await i.next();if(c){a(),l.close();return}let f=u.byteLength;if(n){let h=o+=f;n(h)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),i.return()}},{highWaterMark:2})},Oj=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",zje=Oj&&typeof ReadableStream=="function",KEt=Oj&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Bje=(e,...t)=>{try{return!!e(...t)}catch{return!1}},YEt=zje&&Bje(()=>{let e=!1;const t=new Request(Ll.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),_5e=64*1024,pae=zje&&Bje(()=>Nt.isReadableStream(new Response("").body)),mz={stream:pae&&(e=>e.body)};Oj&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!mz[t]&&(mz[t]=Nt.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Hr(`Response type '${t}' is not supported`,Hr.ERR_NOT_SUPPORT,r)})})})(new Response);const XEt=async e=>{if(e==null)return 0;if(Nt.isBlob(e))return e.size;if(Nt.isSpecCompliantForm(e))return(await new Request(Ll.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(Nt.isArrayBufferView(e)||Nt.isArrayBuffer(e))return e.byteLength;if(Nt.isURLSearchParams(e)&&(e=e+""),Nt.isString(e))return(await KEt(e)).byteLength},QEt=async(e,t)=>{const n=Nt.toFiniteNumber(e.getContentLength());return n??XEt(t)},ZEt=Oj&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:o,timeout:s,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:f="same-origin",fetchOptions:h}=kje(e);c=c?(c+"").toLowerCase():"text";let g=GEt([i,o&&o.toAbortSignal()],s),p;const m=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let v;try{if(l&&YEt&&n!=="get"&&n!=="head"&&(v=await QEt(u,r))!==0){let w=new Request(t,{method:"POST",body:r,duplex:"half"}),x;if(Nt.isFormData(r)&&(x=w.headers.get("content-type"))&&u.setContentType(x),w.body){const[E,R]=T5e(v,pz(I5e(l)));r=P5e(w.body,_5e,E,R)}}Nt.isString(f)||(f=f?"include":"omit");const C="credentials"in Request.prototype;p=new Request(t,{...h,signal:g,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:C?f:void 0});let y=await fetch(p);const b=pae&&(c==="stream"||c==="response");if(pae&&(a||b&&m)){const w={};["status","statusText","headers"].forEach(O=>{w[O]=y[O]});const x=Nt.toFiniteNumber(y.headers.get("content-length")),[E,R]=a&&T5e(x,pz(I5e(a),!0))||[];y=new Response(P5e(y.body,_5e,E,()=>{R&&R(),m&&m()}),w)}c=c||"text";let S=await mz[Nt.findKey(mz,c)||"text"](y,e);return!b&&m&&m(),await new Promise((w,x)=>{Fje(w,x,{data:S,headers:pu.from(y.headers),status:y.status,statusText:y.statusText,config:e,request:p})})}catch(C){throw m&&m(),C&&C.name==="TypeError"&&/fetch/i.test(C.message)?Object.assign(new Hr("Network Error",Hr.ERR_NETWORK,e,p),{cause:C.cause||C}):Hr.from(C,C&&C.code,e,p)}}),mae={http:hEt,xhr:VEt,fetch:ZEt};Nt.forEach(mae,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const A5e=e=>`- ${e}`,JEt=e=>Nt.isFunction(e)||e===null||e===!1,Hje={getAdapter:e=>{e=Nt.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let o=0;o`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let s=t?o.length>1?`since : +`+o.map(A5e).join(` +`):" "+A5e(o[0]):"as no adapter specified";throw new Hr("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:mae};function yee(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new zx(null,e)}function D5e(e){return yee(e),e.headers=pu.from(e.headers),e.data=Cee.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Hje.getAdapter(e.adapter||UI.adapter)(e).then(function(r){return yee(e),r.data=Cee.call(e,e.transformResponse,r),r.headers=pu.from(r.headers),r},function(r){return Lje(r)||(yee(e),r&&r.response&&(r.response.data=Cee.call(e,e.transformResponse,r.response),r.response.headers=pu.from(r.response.headers))),Promise.reject(r)})}const jje="1.7.9",Tj={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Tj[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const L5e={};Tj.transitional=function(t,n,r){function i(o,s){return"[Axios v"+jje+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,a)=>{if(t===!1)throw new Hr(i(s," has been removed"+(n?" in "+n:"")),Hr.ERR_DEPRECATED);return n&&!L5e[s]&&(L5e[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,s,a):!0}};Tj.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function eRt(e,t,n){if(typeof e!="object")throw new Hr("options must be an object",Hr.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const a=e[o],l=a===void 0||s(a,o,e);if(l!==!0)throw new Hr("option "+o+" must be "+l,Hr.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Hr("Unknown option "+o,Hr.ERR_BAD_OPTION)}}const nN={assertOptions:eRt,validators:Tj},yp=nN.validators;class tC{constructor(t){this.defaults=t,this.interceptors={request:new $5e,response:new $5e}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` +`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=AC(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&nN.assertOptions(r,{silentJSONParsing:yp.transitional(yp.boolean),forcedJSONParsing:yp.transitional(yp.boolean),clarifyTimeoutError:yp.transitional(yp.boolean)},!1),i!=null&&(Nt.isFunction(i)?n.paramsSerializer={serialize:i}:nN.assertOptions(i,{encode:yp.function,serialize:yp.function},!0)),nN.assertOptions(n,{baseUrl:yp.spelling("baseURL"),withXsrfToken:yp.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&Nt.merge(o.common,o[n.method]);o&&Nt.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=pu.concat(s,o);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,f=0,h;if(!l){const p=[D5e.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),h=p.length,u=Promise.resolve(n);f{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},t(function(o,s,a){r.reason||(r.reason=new zx(o,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Oge(function(i){t=i}),cancel:t}}}function tRt(e){return function(n){return e.apply(null,n)}}function nRt(e){return Nt.isObject(e)&&e.isAxiosError===!0}const vae={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(vae).forEach(([e,t])=>{vae[t]=e});function Vje(e){const t=new tC(e),n=bje(tC.prototype.request,t);return Nt.extend(n,tC.prototype,t,{allOwnKeys:!0}),Nt.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Vje(AC(e,i))},n}const zs=Vje(UI);zs.Axios=tC;zs.CanceledError=zx;zs.CancelToken=Oge;zs.isCancel=Lje;zs.VERSION=jje;zs.toFormData=$j;zs.AxiosError=Hr;zs.Cancel=zs.CanceledError;zs.all=function(t){return Promise.all(t)};zs.spread=tRt;zs.isAxiosError=nRt;zs.mergeConfig=AC;zs.AxiosHeaders=pu;zs.formToJSON=e=>Dje(Nt.isHTMLForm(e)?new FormData(e):e);zs.getAdapter=Hje.getAdapter;zs.HttpStatusCode=vae;zs.default=zs;const Fs={APP_NAME:window.env.VITE_APP_APP_NAME,SERVER_IP:window.env.VITE_APP_SERVER_IP,FILE_PORT:window.env.VITE_APP_FILE_PORT,SERVER_PORT:window.env.VITE_APP_SERVER_PORT,VERSION:window.env.VITE_APP_VERSION},rRt=`http://${Fs.SERVER_IP}:${Fs==null?void 0:Fs.SERVER_PORT}`,Y5=zs.create({baseURL:rRt});Y5.interceptors.request.use(e=>{const t=localStorage.getItem("access_token");return t&&(e.headers.Authorization=`Bearer ${t}`),e},e=>Promise.reject(e));const Gje=d.createContext(void 0);function Wi(){const e=d.useContext(Gje);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function iRt({children:e}){const[t,n]=d.useState(localStorage.getItem("access_token")),[r,i]=d.useState(localStorage.getItem("session_id")),[o,s]=d.useState(localStorage.getItem("refresh_token")),[a,l]=d.useState(!!localStorage.getItem("access_token")),[c,u]=d.useState(!1),[f,h]=d.useState(null),[g,p]=d.useState(JSON.parse(localStorage.getItem("user-profile")||"null")),[m,v]=d.useState(!1),C=d.useCallback(()=>{const _=localStorage.getItem("access_token"),F=localStorage.getItem("refresh_token"),D=localStorage.getItem("session_id");n(_),s(F),i(D),l(!!_),F&&D&&b(),_&&E()},[]),y=d.useCallback(async()=>{if(o)try{u(!0);const _=await Y5.post("/auth/refresh-token",{refreshToken:o,sessionId:r}),{access_token:F,access_token_expires_at:D}=_.data;localStorage.setItem("access_token",F),localStorage.setItem("access_token_expires_at",D),n(F),l(!0),E()}catch(_){console.error("Token refresh failed",_),x()}finally{u(!1)}},[o]),b=d.useCallback(async()=>{f&&clearInterval(f),await y();const _=setInterval(y,60*60*1e3);h(_)},[f,y]),S=async(_,F)=>{try{u(!0);const D=await Y5.post("/auth/login",{username:_,password:F}),{access_token:k,refresh_token:L,access_token_expires_at:I,refresh_token_expires_at:A,session_id:N}=D.data;localStorage.setItem("access_token",k),localStorage.setItem("refresh_token",L),localStorage.setItem("session_id",N),localStorage.setItem("access_token_expires_at",I),localStorage.setItem("refresh_token_expires_at",A),n(k),s(L),i(N),l(!0),b(),E()}catch(D){throw D}finally{u(!1)}},w=async _=>{try{u(!0),await Y5.post("/auth/signup",_)}catch(F){throw F}finally{u(!1)}};d.useEffect(()=>{g&&v(g.permissions.includes(Ki.MANAGE_ANY_STAFF))},[g]);const x=async()=>{try{u(!0);const _=localStorage.getItem("refresh_token"),F=localStorage.getItem("session_id");localStorage.removeItem("session_id"),localStorage.removeItem("refresh_token"),localStorage.removeItem("access_token_expires_at"),localStorage.removeItem("refresh_token_expires_at"),localStorage.removeItem("user-profile"),localStorage.removeItem("access_token"),await Y5.post("/auth/logout",{refreshToken:_,sessionId:F}),n(null),s(null),i(null),l(!1),p(null),v(!1),f&&(clearInterval(f),h(null))}catch(_){console.error("Logout failed",_)}finally{u(!1),window.location.reload()}},E=d.useCallback(async()=>{try{const F=(await Y5.get("/auth/user-profile")).data;p(F),localStorage.setItem("user-profile",JSON.stringify(F))}catch(_){console.error(_)}},[]);d.useEffect(()=>{C()},[C]);const M={hasSomePermissions:(..._)=>_.some(F=>{var D;return(D=g==null?void 0:g.permissions)==null?void 0:D.includes(F)}),hasEveryPermissions:(..._)=>_.every(F=>g==null?void 0:g.permissions.includes(F)),accessToken:t,isSameDomain:_=>(g==null?void 0:g.domainId)===_,refreshToken:o,isAuthenticated:a,isLoading:c,user:g,isRoot:m,login:S,logout:x,signup:w,refreshAccessToken:y,initializeAuth:C,startTokenRefreshInterval:b,fetchUserProfile:E,sessionId:r};return H.jsx(Gje.Provider,{value:M,children:e})}function Wje(){const e=d.useCallback((o,s)=>`${o}://${Fs.SERVER_IP}:${s}`,[]),t=d.useMemo(()=>e("http",8080),[e]),n=d.useMemo(()=>e("http",parseInt(Fs.SERVER_PORT)),[e]),r=d.useMemo(()=>e("ws",parseInt(Fs.SERVER_PORT)),[e]),i=d.useCallback(o=>o.startsWith(t),[t]);return{apiUrl:n,websocketUrl:r,checkIsTusUrl:i,tusUrl:t}}function oRt({children:e}){const{accessToken:t}=Wi(),{apiUrl:n,websocketUrl:r}=Wje(),[i]=d.useState(()=>new Uyt({defaultOptions:{queries:{staleTime:1e3*60*10}}})),o=d.useMemo(()=>kbt({url:`${r}/trpc`,connectionParams:t?{token:t}:{}}),[r,t]);d.useEffect(()=>()=>{o&&o.close()},[]);const s=d.useMemo(()=>{const a=async()=>({...t?{Authorization:`Bearer ${t}`}:{}}),l=[Lbt({condition:c=>c.type==="subscription",true:o?zbt({client:o,transformer:di}):_be({url:`${n}/trpc`,headers:a,transformer:di}),false:_be({url:`${n}/trpc`,headers:a,transformer:di})}),Dbt({enabled:c=>c.direction==="down"&&c.result instanceof Error})];return an.createClient({links:l})},[t,o,n]);return H.jsx(an.Provider,{client:s,queryClient:i,children:H.jsx(Zyt,{client:i,children:e})})}function sRt(){const e=Zze();return H.jsx("div",{className:"flex justify-center items-center pt-64",children:H.jsxs("div",{className:"flex flex-col gap-4",children:[H.jsx("div",{className:"text-xl font-bold text-primary",children:"哦?页面似乎出错了..."}),H.jsx("div",{className:"text-tertiary",children:(e==null?void 0:e.statusText)||(e==null?void 0:e.message)})]})})}var Uje={exports:{}};/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",s=0;s1&&arguments[1]!==void 0?arguments[1]:{},n=[];return ce.Children.forEach(e,function(r){r==null&&!t.keepEmpty||(Array.isArray(r)?n=n.concat(Rs(r)):qje(r)&&r.props?n=n.concat(Rs(r.props.children,t)):n.push(r))}),n}var Cae={},uRt=function(t){};function dRt(e,t){}function fRt(e,t){}function hRt(){Cae={}}function Kje(e,t,n){!t&&!Cae[n]&&(e(!1,n),Cae[n]=!0)}function ui(e,t){Kje(dRt,e,t)}function gRt(e,t){Kje(fRt,e,t)}ui.preMessage=uRt;ui.resetWarned=hRt;ui.noteOnce=gRt;function pRt(e,t){if(nn(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(nn(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yje(e){var t=pRt(e,"string");return nn(t)=="symbol"?t:t+""}function ie(e,t,n){return(t=Yje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function se(e){for(var t=1;t0},e.prototype.connect_=function(){!bae||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ERt?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!bae||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,i=xRt.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),eVe=function(e,t){for(var n=0,r=Object.keys(t);n"u"||!(Element instanceof Object))){if(!(t instanceof t7(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new ARt(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof t7(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new DRt(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),nVe=typeof WeakMap<"u"?new WeakMap:new Jje,rVe=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=RRt.getInstance(),r=new LRt(t,n,this);nVe.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){rVe.prototype[e]=function(){var t;return(t=nVe.get(this))[e].apply(t,arguments)}});var iVe=function(){return typeof vz.ResizeObserver<"u"?vz.ResizeObserver:rVe}(),t4=new Map;function FRt(e){e.forEach(function(t){var n,r=t.target;(n=t4.get(r))===null||n===void 0||n.forEach(function(i){return i(r)})})}var oVe=new iVe(FRt),NRt=null;function kRt(e,t){t4.has(e)||(t4.set(e,new Set),oVe.observe(e)),t4.get(e).add(t)}function zRt(e,t){t4.has(e)&&(t4.get(e).delete(t),t4.get(e).size||(oVe.unobserve(e),t4.delete(e)))}function qr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k5e(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&arguments[1]!==void 0?arguments[1]:1;z5e+=1;var r=z5e;function i(o){if(o===0)cVe(r),t();else{var s=aVe(function(){i(o-1)});_ge.set(r,s)}}return i(n),r};Rr.cancel=function(e){var t=_ge.get(e);return cVe(e),lVe(t)};function uVe(e){if(Array.isArray(e))return e}function KRt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}function dVe(){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 Ce(e,t){return uVe(e)||KRt(e,t)||Bj(e,t)||dVe()}function bT(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}function Bs(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function wae(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}var B5e="data-rc-order",H5e="data-rc-priority",YRt="rc-util-key",xae=new Map;function fVe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.mark;return t?t.startsWith("data-")?t:"data-".concat(t):YRt}function Hj(e){if(e.attachTo)return e.attachTo;var t=document.querySelector("head");return t||document.body}function XRt(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function Age(e){return Array.from((xae.get(e)||e).children).filter(function(t){return t.tagName==="STYLE"})}function hVe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Bs())return null;var n=t.csp,r=t.prepend,i=t.priority,o=i===void 0?0:i,s=XRt(r),a=s==="prependQueue",l=document.createElement("style");l.setAttribute(B5e,s),a&&o&&l.setAttribute(H5e,"".concat(o)),n!=null&&n.nonce&&(l.nonce=n==null?void 0:n.nonce),l.innerHTML=e;var c=Hj(t),u=c.firstChild;if(r){if(a){var f=(t.styles||Age(c)).filter(function(h){if(!["prepend","prependQueue"].includes(h.getAttribute(B5e)))return!1;var g=Number(h.getAttribute(H5e)||0);return o>=g});if(f.length)return c.insertBefore(l,f[f.length-1].nextSibling),l}c.insertBefore(l,u)}else c.appendChild(l);return l}function gVe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=Hj(t);return(t.styles||Age(n)).find(function(r){return r.getAttribute(fVe(t))===e})}function n7(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=gVe(e,t);if(n){var r=Hj(t);r.removeChild(n)}}function QRt(e,t){var n=xae.get(e);if(!n||!wae(document,n)){var r=hVe("",t),i=r.parentNode;xae.set(e,i),e.removeChild(r)}}function am(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=Hj(n),i=Age(r),o=se(se({},n),{},{styles:i});QRt(r,o);var s=gVe(t,o);if(s){var a,l;if((a=o.csp)!==null&&a!==void 0&&a.nonce&&s.nonce!==((l=o.csp)===null||l===void 0?void 0:l.nonce)){var c;s.nonce=(c=o.csp)===null||c===void 0?void 0:c.nonce}return s.innerHTML!==e&&(s.innerHTML=e),s}var u=hVe(e,o);return u.setAttribute(fVe(o),t),u}function ZRt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function on(e,t){if(e==null)return{};var n,r,i=ZRt(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r2&&arguments[2]!==void 0?arguments[2]:!1,r=new Set;function i(o,s){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,l=r.has(o);if(ui(!l,"Warning: There may be circular references"),l)return!1;if(o===s)return!0;if(n&&a>1)return!1;r.add(o);var c=a+1;if(Array.isArray(o)){if(!Array.isArray(s)||o.length!==s.length)return!1;for(var u=0;u1&&arguments[1]!==void 0?arguments[1]:!1,s={map:this.cache};return n.forEach(function(a){if(!s)s=void 0;else{var l;s=(l=s)===null||l===void 0||(l=l.map)===null||l===void 0?void 0:l.get(a)}}),(r=s)!==null&&r!==void 0&&r.value&&o&&(s.value[1]=this.cacheCallTimes++),(i=s)===null||i===void 0?void 0:i.value}},{key:"get",value:function(n){var r;return(r=this.internalGet(n,!0))===null||r===void 0?void 0:r[0]}},{key:"has",value:function(n){return!!this.internalGet(n)}},{key:"set",value:function(n,r){var i=this;if(!this.has(n)){if(this.size()+1>e.MAX_CACHE_SIZE+e.MAX_CACHE_OFFSET){var o=this.keys.reduce(function(c,u){var f=Ce(c,2),h=f[1];return i.internalGet(u)[1]0,void 0),j5e+=1}return Kr(e,[{key:"getDerivativeToken",value:function(n){return this.derivatives.reduce(function(r,i){return i(n,r)},void 0)}}]),e}(),See=new Lge;function o7(e){var t=Array.isArray(e)?e:[e];return See.has(t)||See.set(t,new Fge(t)),See.get(t)}var l$t=new WeakMap,wee={};function c$t(e,t){for(var n=l$t,r=0;r3&&arguments[3]!==void 0?arguments[3]:{},o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(o)return e;var s=se(se({},i),{},(r={},ie(r,r7,t),ie(r,wg,n),r)),a=Object.keys(s).map(function(l){var c=s[l];return c?"".concat(l,'="').concat(c,'"'):null}).filter(function(l){return l}).join(" ");return"")}var j$=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return"--".concat(n?"".concat(n,"-"):"").concat(t).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase()},f$t=function(t,n,r){return Object.keys(t).length?".".concat(n).concat(r!=null&&r.scope?".".concat(r.scope):"","{").concat(Object.entries(t).map(function(i){var o=Ce(i,2),s=o[0],a=o[1];return"".concat(s,":").concat(a,";")}).join(""),"}"):""},yVe=function(t,n,r){var i={},o={};return Object.entries(t).forEach(function(s){var a,l,c=Ce(s,2),u=c[0],f=c[1];if(r!=null&&(a=r.preserve)!==null&&a!==void 0&&a[u])o[u]=f;else if((typeof f=="string"||typeof f=="number")&&!(r!=null&&(l=r.ignore)!==null&&l!==void 0&&l[u])){var h,g=j$(u,r==null?void 0:r.prefix);i[g]=typeof f=="number"&&!(r!=null&&(h=r.unitless)!==null&&h!==void 0&&h[u])?"".concat(f,"px"):String(f),o[u]="var(".concat(g,")")}}),[o,f$t(i,n,{scope:r==null?void 0:r.scope})]},W5e=Bs()?d.useLayoutEffect:d.useEffect,Zn=function(t,n){var r=d.useRef(!0);W5e(function(){return t(r.current)},n),W5e(function(){return r.current=!1,function(){r.current=!0}},[])},rC=function(t,n){Zn(function(r){if(!r)return t()},n)},h$t=se({},Mx),U5e=h$t.useInsertionEffect,g$t=function(t,n,r){d.useMemo(t,r),Zn(function(){return n(!0)},r)},p$t=U5e?function(e,t,n){return U5e(function(){return e(),t()},n)}:g$t,m$t=se({},Mx),v$t=m$t.useInsertionEffect,C$t=function(t){var n=[],r=!1;function i(o){r||n.push(o)}return d.useEffect(function(){return r=!1,function(){r=!0,n.length&&n.forEach(function(o){return o()})}},t),i},y$t=function(){return function(t){t()}},b$t=typeof v$t<"u"?C$t:y$t;function Nge(e,t,n,r,i){var o=d.useContext(i7),s=o.cache,a=[e].concat(ut(t)),l=Eae(a),c=b$t([l]),u=function(p){s.opUpdate(l,function(m){var v=m||[void 0,void 0],C=Ce(v,2),y=C[0],b=y===void 0?0:y,S=C[1],w=S,x=w||n(),E=[b,x];return p?p(E):E})};d.useMemo(function(){u()},[l]);var f=s.opGet(l),h=f[1];return p$t(function(){i==null||i(h)},function(g){return u(function(p){var m=Ce(p,2),v=m[0],C=m[1];return g&&v===0&&(i==null||i(h)),[v+1,C]}),function(){s.opUpdate(l,function(p){var m=p||[],v=Ce(m,2),C=v[0],y=C===void 0?0:C,b=v[1],S=y-1;return S===0?(c(function(){(g||!s.opGet(l))&&(r==null||r(b,!1))}),null):[y-1,b]})}},[l]),h}var S$t={},w$t="css",g8=new Map;function x$t(e){g8.set(e,(g8.get(e)||0)+1)}function E$t(e,t){if(typeof document<"u"){var n=document.querySelectorAll("style[".concat(r7,'="').concat(e,'"]'));n.forEach(function(r){if(r[n4]===t){var i;(i=r.parentNode)===null||i===void 0||i.removeChild(r)}})}}var R$t=0;function $$t(e,t){g8.set(e,(g8.get(e)||0)-1);var n=Array.from(g8.keys()),r=n.filter(function(i){var o=g8.get(i)||0;return o<=0});n.length-r.length>R$t&&r.forEach(function(i){E$t(i,t),g8.delete(i)})}var kge=function(t,n,r,i){var o=r.getDerivativeToken(t),s=se(se({},o),n);return i&&(s=i(s)),s},bVe="token";function SVe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=d.useContext(i7),i=r.cache.instanceId,o=r.container,s=n.salt,a=s===void 0?"":s,l=n.override,c=l===void 0?S$t:l,u=n.formatToken,f=n.getComputedToken,h=n.cssVar,g=c$t(function(){return Object.assign.apply(Object,[{}].concat(ut(t)))},t),p=H$(g),m=H$(c),v=h?H$(h):"",C=Nge(bVe,[a,e.id,p,m,v],function(){var y,b=f?f(g,c,e):kge(g,c,e,u),S=se({},b),w="";if(h){var x=yVe(b,h.key,{prefix:h.prefix,ignore:h.ignore,unitless:h.unitless,preserve:h.preserve}),E=Ce(x,2);b=E[0],w=E[1]}var R=G5e(b,a);b._tokenKey=R,S._tokenKey=G5e(S,a);var O=(y=h==null?void 0:h.key)!==null&&y!==void 0?y:R;b._themeKey=O,x$t(O);var T="".concat(w$t,"-").concat(bT(R));return b._hashId=T,[b,T,S,w,(h==null?void 0:h.key)||""]},function(y){$$t(y[0]._themeKey,i)},function(y){var b=Ce(y,4),S=b[0],w=b[3];if(h&&w){var x=am(w,bT("css-variables-".concat(S._themeKey)),{mark:wg,prepend:"queue",attachTo:o,priority:-999});x[n4]=i,x.setAttribute(r7,S._themeKey)}});return C}var O$t=function(t,n,r){var i=Ce(t,5),o=i[2],s=i[3],a=i[4],l=r||{},c=l.plain;if(!s)return null;var u=o._tokenKey,f=-999,h={"data-rc-order":"prependQueue","data-rc-priority":"".concat(f)},g=ST(s,a,u,h,c);return[f,u,g]},wVe={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},xVe="comm",EVe="rule",RVe="decl",T$t="@import",I$t="@keyframes",M$t="@layer",$Ve=Math.abs,zge=String.fromCharCode;function OVe(e){return e.trim()}function iN(e,t,n){return e.replace(t,n)}function P$t(e,t,n){return e.indexOf(t,n)}function wT(e,t){return e.charCodeAt(t)|0}function a7(e,t,n){return e.slice(t,n)}function Dp(e){return e.length}function _$t(e){return e.length}function cD(e,t){return t.push(e),e}var jj=1,l7=1,TVe=0,qf=0,Ns=0,Bx="";function Bge(e,t,n,r,i,o,s,a){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:jj,column:l7,length:s,return:"",siblings:a}}function A$t(){return Ns}function D$t(){return Ns=qf>0?wT(Bx,--qf):0,l7--,Ns===10&&(l7=1,jj--),Ns}function xg(){return Ns=qf2||xT(Ns)>3?"":" "}function k$t(e,t){for(;--t&&xg()&&!(Ns<48||Ns>102||Ns>57&&Ns<65||Ns>70&&Ns<97););return Vj(e,oN()+(t<6&&r4()==32&&xg()==32))}function $ae(e){for(;xg();)switch(Ns){case e:return qf;case 34:case 39:e!==34&&e!==39&&$ae(Ns);break;case 40:e===41&&$ae(e);break;case 92:xg();break}return qf}function z$t(e,t){for(;xg()&&e+Ns!==57;)if(e+Ns===84&&r4()===47)break;return"/*"+Vj(t,qf-1)+"*"+zge(e===47?e:xg())}function B$t(e){for(;!xT(r4());)xg();return Vj(e,qf)}function H$t(e){return F$t(sN("",null,null,null,[""],e=L$t(e),0,[0],e))}function sN(e,t,n,r,i,o,s,a,l){for(var c=0,u=0,f=s,h=0,g=0,p=0,m=1,v=1,C=1,y=0,b="",S=i,w=o,x=r,E=b;v;)switch(p=y,y=xg()){case 40:if(p!=108&&wT(E,f-1)==58){P$t(E+=iN(Ree(y),"&","&\f"),"&\f",$Ve(c?a[c-1]:0))!=-1&&(C=-1);break}case 34:case 39:case 91:E+=Ree(y);break;case 9:case 10:case 13:case 32:E+=N$t(p);break;case 92:E+=k$t(oN()-1,7);continue;case 47:switch(r4()){case 42:case 47:cD(j$t(z$t(xg(),oN()),t,n,l),l),(xT(p||1)==5||xT(r4()||1)==5)&&Dp(E)&&a7(E,-1,void 0)!==" "&&(E+=" ");break;default:E+="/"}break;case 123*m:a[c++]=Dp(E)*C;case 125*m:case 59:case 0:switch(y){case 0:case 125:v=0;case 59+u:C==-1&&(E=iN(E,/\f/g,"")),g>0&&(Dp(E)-f||m===0&&p===47)&&cD(g>32?K5e(E+";",r,n,f-1,l):K5e(iN(E," ","")+";",r,n,f-2,l),l);break;case 59:E+=";";default:if(cD(x=q5e(E,t,n,c,u,i,a,b,S=[],w=[],f,o),o),y===123)if(u===0)sN(E,t,x,x,S,o,f,a,w);else switch(h===99&&wT(E,3)===110?100:h){case 100:case 108:case 109:case 115:sN(e,x,x,r&&cD(q5e(e,x,x,0,0,i,a,b,i,S=[],f,w),w),i,w,f,a,r?S:w);break;default:sN(E,x,x,x,[""],w,0,a,w)}}c=u=g=0,m=C=1,b=E="",f=s;break;case 58:f=1+Dp(E),g=p;default:if(m<1){if(y==123)--m;else if(y==125&&m++==0&&D$t()==125)continue}switch(E+=zge(y),y*m){case 38:C=u>0?1:(E+="\f",-1);break;case 44:a[c++]=(Dp(E)-1)*C,C=1;break;case 64:r4()===45&&(E+=Ree(xg())),h=r4(),u=f=Dp(b=E+=B$t(oN())),y++;break;case 45:p===45&&Dp(E)==2&&(m=0)}}return o}function q5e(e,t,n,r,i,o,s,a,l,c,u,f){for(var h=i-1,g=i===0?o:[""],p=_$t(g),m=0,v=0,C=0;m0?g[y]+" "+b:iN(b,/&\f/g,g[y])))&&(l[C++]=S);return Bge(e,t,n,i===0?EVe:a,l,c,u,f)}function j$t(e,t,n,r){return Bge(e,t,n,xVe,zge(A$t()),a7(e,2,-2),0,r)}function K5e(e,t,n,r,i){return Bge(e,t,n,RVe,a7(e,0,r),a7(e,r+1,-1),r,i)}function Oae(e,t){for(var n="",r=0;r1}function W$t(e){return e.parentSelectors.reduce(function(t,n){return t?n.includes("&")?n.replace(/&/g,t):"".concat(t," ").concat(n):n},"")}var U$t=function(t,n,r){var i=W$t(r),o=i.match(/:not\([^)]*\)/g)||[];o.length>0&&o.some(G$t)&&O8("Concat ':not' selector not support in legacy browsers.",r)},q$t=function(t,n,r){switch(t){case"marginLeft":case"marginRight":case"paddingLeft":case"paddingRight":case"left":case"right":case"borderLeft":case"borderLeftWidth":case"borderLeftStyle":case"borderLeftColor":case"borderRight":case"borderRightWidth":case"borderRightStyle":case"borderRightColor":case"borderTopLeftRadius":case"borderTopRightRadius":case"borderBottomLeftRadius":case"borderBottomRightRadius":O8("You seem to be using non-logical property '".concat(t,"' which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties."),r);return;case"margin":case"padding":case"borderWidth":case"borderStyle":if(typeof n=="string"){var i=n.split(" ").map(function(a){return a.trim()});i.length===4&&i[1]!==i[3]&&O8("You seem to be using '".concat(t,"' property with different left ").concat(t," and right ").concat(t,", which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties."),r)}return;case"clear":case"textAlign":(n==="left"||n==="right")&&O8("You seem to be using non-logical value '".concat(n,"' of ").concat(t,", which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties."),r);return;case"borderRadius":if(typeof n=="string"){var o=n.split("/").map(function(a){return a.trim()}),s=o.reduce(function(a,l){if(a)return a;var c=l.split(" ").map(function(u){return u.trim()});return c.length>=2&&c[0]!==c[1]||c.length===3&&c[1]!==c[2]||c.length===4&&c[2]!==c[3]?!0:a},!1);s&&O8("You seem to be using non-logical value '".concat(n,"' of ").concat(t,", which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties."),r)}return}},K$t=function(t,n,r){(typeof n=="string"&&/NaN/g.test(n)||Number.isNaN(n))&&O8("Unexpected 'NaN' in property '".concat(t,": ").concat(n,"'."),r)},Y$t=function(t,n,r){r.parentSelectors.some(function(i){var o=i.split(",");return o.some(function(s){return s.split("&").length>2})})&&O8("Should not use more than one `&` in a selector.",r)},V$="data-ant-cssinjs-cache-path",IVe="_FILE_STYLE__";function X$t(e){return Object.keys(e).map(function(t){var n=e[t];return"".concat(t,":").concat(n)}).join(";")}var iC,MVe=!0;function Q$t(){if(!iC&&(iC={},Bs())){var e=document.createElement("div");e.className=V$,e.style.position="fixed",e.style.visibility="hidden",e.style.top="-9999px",document.body.appendChild(e);var t=getComputedStyle(e).content||"";t=t.replace(/^"/,"").replace(/"$/,""),t.split(";").forEach(function(i){var o=i.split(":"),s=Ce(o,2),a=s[0],l=s[1];iC[a]=l});var n=document.querySelector("style[".concat(V$,"]"));if(n){var r;MVe=!1,(r=n.parentNode)===null||r===void 0||r.removeChild(n)}document.body.removeChild(e)}}function Z$t(e){return Q$t(),!!iC[e]}function J$t(e){var t=iC[e],n=null;if(t&&Bs())if(MVe)n=IVe;else{var r=document.querySelector("style[".concat(wg,'="').concat(iC[e],'"]'));r?n=r.innerHTML:delete iC[e]}return[n,t]}var eOt="_skip_check_",PVe="_multi_value_";function aN(e){var t=Oae(H$t(e),V$t);return t.replace(/\{%%%\:[^;];}/g,";")}function tOt(e){return nn(e)==="object"&&e&&(eOt in e||PVe in e)}function Y5e(e,t,n){if(!t)return e;var r=".".concat(t),i=n==="low"?":where(".concat(r,")"):r,o=e.split(",").map(function(s){var a,l=s.trim().split(/\s+/),c=l[0]||"",u=((a=c.match(/^\w+/))===null||a===void 0?void 0:a[0])||"";return c="".concat(u).concat(i).concat(c.slice(u.length)),[c].concat(ut(l.slice(1))).join(" ")});return o.join(",")}var nOt=function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},i=r.root,o=r.injectHash,s=r.parentSelectors,a=n.hashId,l=n.layer;n.path;var c=n.hashPriority,u=n.transformers,f=u===void 0?[]:u;n.linters;var h="",g={};function p(C){var y=C.getName(a);if(!g[y]){var b=e(C.style,n,{root:!1,parentSelectors:s}),S=Ce(b,1),w=S[0];g[y]="@keyframes ".concat(C.getName(a)).concat(w)}}function m(C){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return C.forEach(function(b){Array.isArray(b)?m(b,y):b&&y.push(b)}),y}var v=m(Array.isArray(t)?t:[t]);return v.forEach(function(C){var y=typeof C=="string"&&!i?{}:C;if(typeof y=="string")h+="".concat(y,` +`);else if(y._keyframe)p(y);else{var b=f.reduce(function(S,w){var x;return(w==null||(x=w.visit)===null||x===void 0?void 0:x.call(w,S))||S},y);Object.keys(b).forEach(function(S){var w=b[S];if(nn(w)==="object"&&w&&(S!=="animationName"||!w._keyframe)&&!tOt(w)){var x=!1,E=S.trim(),R=!1;(i||o)&&a?E.startsWith("@")?x=!0:E==="&"?E=Y5e("",a,c):E=Y5e(S,a,c):i&&!a&&(E==="&"||E==="")&&(E="",R=!0);var O=e(w,n,{root:R,injectHash:x,parentSelectors:[].concat(ut(s),[E])}),T=Ce(O,2),M=T[0],_=T[1];g=se(se({},g),_),h+="".concat(E).concat(M)}else{let k=function(L,I){var A=L.replace(/[A-Z]/g,function(B){return"-".concat(B.toLowerCase())}),N=I;!wVe[L]&&typeof N=="number"&&N!==0&&(N="".concat(N,"px")),L==="animationName"&&I!==null&&I!==void 0&&I._keyframe&&(p(I),N=I.getName(a)),h+="".concat(A,":").concat(N,";")};var F,D=(F=w==null?void 0:w.value)!==null&&F!==void 0?F:w;nn(w)==="object"&&w!==null&&w!==void 0&&w[PVe]&&Array.isArray(D)?D.forEach(function(L){k(S,L)}):k(S,D)}})}}),i?l&&(h&&(h="@layer ".concat(l.name," {").concat(h,"}")),l.dependencies&&(g["@layer ".concat(l.name)]=l.dependencies.map(function(C){return"@layer ".concat(C,", ").concat(l.name,";")}).join(` +`))):h="{".concat(h,"}"),[h,g]};function _Ve(e,t){return bT("".concat(e.join("%")).concat(t))}function rOt(){return null}var AVe="style";function yz(e,t){var n=e.token,r=e.path,i=e.hashId,o=e.layer,s=e.nonce,a=e.clientOnly,l=e.order,c=l===void 0?0:l,u=d.useContext(i7),f=u.autoClear;u.mock;var h=u.defaultCache,g=u.hashPriority,p=u.container,m=u.ssrInline,v=u.transformers,C=u.linters,y=u.cache,b=u.layer,S=n._tokenKey,w=[S];b&&w.push("layer"),w.push.apply(w,ut(r));var x=Rae,E=Nge(AVe,w,function(){var _=w.join("|");if(Z$t(_)){var F=J$t(_),D=Ce(F,2),k=D[0],L=D[1];if(k)return[k,S,L,{},a,c]}var I=t(),A=nOt(I,{hashId:i,hashPriority:g,layer:b?o:void 0,path:r.join("-"),transformers:v,linters:C}),N=Ce(A,2),B=N[0],z=N[1],j=aN(B),W=_Ve(w,j);return[j,S,W,z,a,c]},function(_,F){var D=Ce(_,3),k=D[2];(F||f)&&Rae&&n7(k,{mark:wg})},function(_){var F=Ce(_,4),D=F[0];F[1];var k=F[2],L=F[3];if(x&&D!==IVe){var I={mark:wg,prepend:b?!1:"queue",attachTo:p,priority:c},A=typeof s=="function"?s():s;A&&(I.csp={nonce:A});var N=[],B=[];Object.keys(L).forEach(function(j){j.startsWith("@layer")?N.push(j):B.push(j)}),N.forEach(function(j){am(aN(L[j]),"_layer-".concat(j),se(se({},I),{},{prepend:!0}))});var z=am(D,k,I);z[n4]=y.instanceId,z.setAttribute(r7,S),B.forEach(function(j){am(aN(L[j]),"_effect-".concat(j),I)})}}),R=Ce(E,3),O=R[0],T=R[1],M=R[2];return function(_){var F;if(!m||x||!h)F=d.createElement(rOt,null);else{var D;F=d.createElement("style",V({},(D={},ie(D,r7,T),ie(D,wg,M),D),{dangerouslySetInnerHTML:{__html:O}}))}return d.createElement(d.Fragment,null,F,_)}}var iOt=function(t,n,r){var i=Ce(t,6),o=i[0],s=i[1],a=i[2],l=i[3],c=i[4],u=i[5],f=r||{},h=f.plain;if(c)return null;var g=o,p={"data-rc-order":"prependQueue","data-rc-priority":"".concat(u)};return g=ST(o,s,a,p,h),l&&Object.keys(l).forEach(function(m){if(!n[m]){n[m]=!0;var v=aN(l[m]),C=ST(v,s,"_effect-".concat(m),p,h);m.startsWith("@layer")?g=C+g:g+=C}}),[u,a,g]},DVe="cssVar",LVe=function(t,n){var r=t.key,i=t.prefix,o=t.unitless,s=t.ignore,a=t.token,l=t.scope,c=l===void 0?"":l,u=d.useContext(i7),f=u.cache.instanceId,h=u.container,g=a._tokenKey,p=[].concat(ut(t.path),[r,c,g]),m=Nge(DVe,p,function(){var v=n(),C=yVe(v,r,{prefix:i,unitless:o,ignore:s,scope:c}),y=Ce(C,2),b=y[0],S=y[1],w=_Ve(p,S);return[b,S,w,r]},function(v){var C=Ce(v,3),y=C[2];Rae&&n7(y,{mark:wg})},function(v){var C=Ce(v,3),y=C[1],b=C[2];if(y){var S=am(y,b,{mark:wg,prepend:"queue",attachTo:h,priority:-999});S[n4]=f,S.setAttribute(r7,r)}});return m},oOt=function(t,n,r){var i=Ce(t,4),o=i[1],s=i[2],a=i[3],l=r||{},c=l.plain;if(!o)return null;var u=-999,f={"data-rc-order":"prependQueue","data-rc-priority":"".concat(u)},h=ST(o,a,s,f,c);return[u,s,h]},UE,sOt=(UE={},ie(UE,AVe,iOt),ie(UE,bVe,O$t),ie(UE,DVe,oOt),UE);function aOt(e){return e!==null}function lOt(e,t){var n=typeof t=="boolean"?{plain:t}:t||{},r=n.plain,i=r===void 0?!1:r,o=n.types,s=o===void 0?["style","token","cssVar"]:o,a=new RegExp("^(".concat((typeof s=="string"?[s]:s).join("|"),")%")),l=Array.from(e.cache.keys()).filter(function(h){return a.test(h)}),c={},u={},f="";return l.map(function(h){var g=h.replace(a,"").replace(/%/g,"|"),p=h.split("%"),m=Ce(p,1),v=m[0],C=sOt[v],y=C(e.cache.get(h)[1],c,{plain:i});if(!y)return null;var b=Ce(y,3),S=b[0],w=b[1],x=b[2];return h.startsWith("style")&&(u[g]=w),[S,x]}).filter(aOt).sort(function(h,g){var p=Ce(h,1),m=p[0],v=Ce(g,1),C=v[0];return m-C}).forEach(function(h){var g=Ce(h,2),p=g[1];f+=p}),f+=ST(".".concat(V$,'{content:"').concat(X$t(u),'";}'),void 0,void 0,ie({},V$,V$),i),f}var Pr=function(){function e(t,n){qr(this,e),ie(this,"name",void 0),ie(this,"style",void 0),ie(this,"_keyframe",!0),this.name=t,this.style=n}return Kr(e,[{key:"getName",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return n?"".concat(n,"-").concat(this.name):this.name}}]),e}();function cOt(e){if(typeof e=="number")return[[e],!1];var t=String(e).trim(),n=t.match(/(.*)(!important)/),r=(n?n[1]:t).trim().split(/\s+/),i=[],o=0;return[r.reduce(function(s,a){if(a.includes("(")||a.includes(")")){var l=a.split("(").length-1,c=a.split(")").length-1;o+=l-c}return o>=0&&i.push(a),o===0&&(s.push(i.join(" ")),i=[]),s},[]),!!n]}function n5(e){return e.notSplit=!0,e}var uOt={inset:["top","right","bottom","left"],insetBlock:["top","bottom"],insetBlockStart:["top"],insetBlockEnd:["bottom"],insetInline:["left","right"],insetInlineStart:["left"],insetInlineEnd:["right"],marginBlock:["marginTop","marginBottom"],marginBlockStart:["marginTop"],marginBlockEnd:["marginBottom"],marginInline:["marginLeft","marginRight"],marginInlineStart:["marginLeft"],marginInlineEnd:["marginRight"],paddingBlock:["paddingTop","paddingBottom"],paddingBlockStart:["paddingTop"],paddingBlockEnd:["paddingBottom"],paddingInline:["paddingLeft","paddingRight"],paddingInlineStart:["paddingLeft"],paddingInlineEnd:["paddingRight"],borderBlock:n5(["borderTop","borderBottom"]),borderBlockStart:n5(["borderTop"]),borderBlockEnd:n5(["borderBottom"]),borderInline:n5(["borderLeft","borderRight"]),borderInlineStart:n5(["borderLeft"]),borderInlineEnd:n5(["borderRight"]),borderBlockWidth:["borderTopWidth","borderBottomWidth"],borderBlockStartWidth:["borderTopWidth"],borderBlockEndWidth:["borderBottomWidth"],borderInlineWidth:["borderLeftWidth","borderRightWidth"],borderInlineStartWidth:["borderLeftWidth"],borderInlineEndWidth:["borderRightWidth"],borderBlockStyle:["borderTopStyle","borderBottomStyle"],borderBlockStartStyle:["borderTopStyle"],borderBlockEndStyle:["borderBottomStyle"],borderInlineStyle:["borderLeftStyle","borderRightStyle"],borderInlineStartStyle:["borderLeftStyle"],borderInlineEndStyle:["borderRightStyle"],borderBlockColor:["borderTopColor","borderBottomColor"],borderBlockStartColor:["borderTopColor"],borderBlockEndColor:["borderBottomColor"],borderInlineColor:["borderLeftColor","borderRightColor"],borderInlineStartColor:["borderLeftColor"],borderInlineEndColor:["borderRightColor"],borderStartStartRadius:["borderTopLeftRadius"],borderStartEndRadius:["borderTopRightRadius"],borderEndStartRadius:["borderBottomLeftRadius"],borderEndEndRadius:["borderBottomRightRadius"]};function uD(e,t){var n=e;return t&&(n="".concat(n," !important")),{_skip_check_:!0,value:n}}var dOt={visit:function(t){var n={};return Object.keys(t).forEach(function(r){var i=t[r],o=uOt[r];if(o&&(typeof i=="number"||typeof i=="string")){var s=cOt(i),a=Ce(s,2),l=a[0],c=a[1];o.length&&o.notSplit?o.forEach(function(u){n[u]=uD(i,c)}):o.length===1?n[o[0]]=uD(l[0],c):o.length===2?o.forEach(function(u,f){var h;n[u]=uD((h=l[f])!==null&&h!==void 0?h:l[0],c)}):o.length===4?o.forEach(function(u,f){var h,g;n[u]=uD((h=(g=l[f])!==null&&g!==void 0?g:l[f-2])!==null&&h!==void 0?h:l[0],c)}):n[r]=i}else n[r]=i}),n}},$ee=/url\([^)]+\)|var\([^)]+\)|(\d*\.?\d+)px/g;function fOt(e,t){var n=Math.pow(10,t+1),r=Math.floor(e*n);return Math.round(r/10)*10/n}var hOt=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.rootValue,r=n===void 0?16:n,i=t.precision,o=i===void 0?5:i,s=t.mediaQuery,a=s===void 0?!1:s,l=function(f,h){if(!h)return f;var g=parseFloat(h);if(g<=1)return f;var p=fOt(g/r,o);return"".concat(p,"rem")},c=function(f){var h=se({},f);return Object.entries(f).forEach(function(g){var p=Ce(g,2),m=p[0],v=p[1];if(typeof v=="string"&&v.includes("px")){var C=v.replace($ee,l);h[m]=C}!wVe[m]&&typeof v=="number"&&v!==0&&(h[m]="".concat(v,"px").replace($ee,l));var y=m.trim();if(y.startsWith("@")&&y.includes("px")&&a){var b=m.replace($ee,l);h[b]=h[m],delete h[m]}}),h};return{visit:c}},gOt={supportModernCSS:function(){return u$t()&&d$t()}};const pOt=Object.freeze(Object.defineProperty({__proto__:null,Keyframes:Pr,NaNLinter:K$t,StyleProvider:n$t,Theme:Fge,_experimental:gOt,createCache:Dge,createTheme:o7,extractStyle:lOt,genCalc:s$t,getComputedToken:kge,legacyLogicalPropertiesTransformer:dOt,legacyNotSelectorLinter:U$t,logicalPropertiesLinter:q$t,parentSelectorLinter:Y$t,px2remTransformer:hOt,token2CSSVar:j$,unit:Ne,useCSSVarRegister:LVe,useCacheToken:SVe,useStyleRegister:yz},Symbol.toStringTag,{value:"Module"}));var qI=d.createContext({});function FVe(e){return uVe(e)||sVe(e)||Bj(e)||dVe()}function Bl(e,t){for(var n=e,r=0;r3&&arguments[3]!==void 0?arguments[3]:!1;return t.length&&r&&n===void 0&&!Bl(e,t.slice(0,-1))?e:NVe(e,t,n,r)}function mOt(e){return nn(e)==="object"&&e!==null&&Object.getPrototypeOf(e)===Object.prototype}function X5e(e){return Array.isArray(e)?[]:{}}var vOt=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function xS(){for(var e=arguments.length,t=new Array(e),n=0;n{const e=()=>{};return e.deprecated=COt,e},kVe=d.createContext(void 0);var zVe={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"},bOt={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0},SOt=se(se({},bOt),{},{locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",dateFormat:"M/D/YYYY",dateTimeFormat:"M/D/YYYY HH:mm:ss",previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"});const BVe={placeholder:"Select time",rangePlaceholder:["Start time","End time"]},Q5e={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},SOt),timePickerLocale:Object.assign({},BVe)},_u="${label} is not a valid ${type}",yd={locale:"en",Pagination:zVe,DatePicker:Q5e,TimePicker:BVe,Calendar:Q5e,global:{placeholder:"Please select"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckall:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",deselectAll:"Deselect all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand",collapse:"Collapse"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:_u,method:_u,array:_u,object:_u,number:_u,date:_u,boolean:_u,integer:_u,float:_u,regexp:_u,email:_u,url:_u,hex:_u},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh",scanned:"Scanned"},ColorPicker:{presetEmpty:"Empty",transparent:"Transparent",singleColor:"Single",gradientColor:"Gradient"}};let lN=Object.assign({},yd.Modal),cN=[];const Z5e=()=>cN.reduce((e,t)=>Object.assign(Object.assign({},e),t),yd.Modal);function wOt(e){if(e){const t=Object.assign({},e);return cN.push(t),lN=Z5e(),()=>{cN=cN.filter(n=>n!==t),lN=Z5e()}}lN=Object.assign({},yd.Modal)}function HVe(){return lN}const Hge=d.createContext(void 0),ih=(e,t)=>{const n=d.useContext(Hge),r=d.useMemo(()=>{var o;const s=t||yd[e],a=(o=n==null?void 0:n[e])!==null&&o!==void 0?o:{};return Object.assign(Object.assign({},typeof s=="function"?s():s),a||{})},[e,t,n]),i=d.useMemo(()=>{const o=n==null?void 0:n.locale;return n!=null&&n.exist&&!o?yd.locale:o},[n]);return[r,i]},xOt="internalMark",EOt=e=>{const{locale:t={},children:n,_ANT_MARK__:r}=e;d.useEffect(()=>wOt(t==null?void 0:t.Modal),[t]);const i=d.useMemo(()=>Object.assign(Object.assign({},t),{exist:!0}),[t]);return d.createElement(Hge.Provider,{value:i},n)},Ca=Math.round;function Oee(e,t){const n=e.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],r=n.map(i=>parseFloat(i));for(let i=0;i<3;i+=1)r[i]=t(r[i]||0,n[i]||"",i);return n[3]?r[3]=n[3].includes("%")?r[3]/100:r[3]:r[3]=1,r}const J5e=(e,t,n)=>n===0?e:e/100;function qE(e,t){const n=t||255;return e>n?n:e<0?0:e}class kr{constructor(t){ie(this,"isValid",!0),ie(this,"r",0),ie(this,"g",0),ie(this,"b",0),ie(this,"a",1),ie(this,"_h",void 0),ie(this,"_s",void 0),ie(this,"_l",void 0),ie(this,"_v",void 0),ie(this,"_max",void 0),ie(this,"_min",void 0),ie(this,"_brightness",void 0);function n(r){return r[0]in t&&r[1]in t&&r[2]in t}if(t)if(typeof t=="string"){let i=function(o){return r.startsWith(o)};const r=t.trim();/^#?[A-F\d]{3,8}$/i.test(r)?this.fromHexString(r):i("rgb")?this.fromRgbString(r):i("hsl")?this.fromHslString(r):(i("hsv")||i("hsb"))&&this.fromHsvString(r)}else if(t instanceof kr)this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this._h=t._h,this._s=t._s,this._l=t._l,this._v=t._v;else if(n("rgb"))this.r=qE(t.r),this.g=qE(t.g),this.b=qE(t.b),this.a=typeof t.a=="number"?qE(t.a,1):1;else if(n("hsl"))this.fromHsl(t);else if(n("hsv"))this.fromHsv(t);else throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(t))}setR(t){return this._sc("r",t)}setG(t){return this._sc("g",t)}setB(t){return this._sc("b",t)}setA(t){return this._sc("a",t,1)}setHue(t){const n=this.toHsv();return n.h=t,this._c(n)}getLuminance(){function t(o){const s=o/255;return s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4)}const n=t(this.r),r=t(this.g),i=t(this.b);return .2126*n+.7152*r+.0722*i}getHue(){if(typeof this._h>"u"){const t=this.getMax()-this.getMin();t===0?this._h=0:this._h=Ca(60*(this.r===this.getMax()?(this.g-this.b)/t+(this.g"u"){const t=this.getMax()-this.getMin();t===0?this._s=0:this._s=t/this.getMax()}return this._s}getLightness(){return typeof this._l>"u"&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return typeof this._v>"u"&&(this._v=this.getMax()/255),this._v}getBrightness(){return typeof this._brightness>"u"&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(t=10){const n=this.getHue(),r=this.getSaturation();let i=this.getLightness()-t/100;return i<0&&(i=0),this._c({h:n,s:r,l:i,a:this.a})}lighten(t=10){const n=this.getHue(),r=this.getSaturation();let i=this.getLightness()+t/100;return i>1&&(i=1),this._c({h:n,s:r,l:i,a:this.a})}mix(t,n=50){const r=this._c(t),i=n/100,o=a=>(r[a]-this[a])*i+this[a],s={r:Ca(o("r")),g:Ca(o("g")),b:Ca(o("b")),a:Ca(o("a")*100)/100};return this._c(s)}tint(t=10){return this.mix({r:255,g:255,b:255,a:1},t)}shade(t=10){return this.mix({r:0,g:0,b:0,a:1},t)}onBackground(t){const n=this._c(t),r=this.a+n.a*(1-this.a),i=o=>Ca((this[o]*this.a+n[o]*n.a*(1-this.a))/r);return this._c({r:i("r"),g:i("g"),b:i("b"),a:r})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(t){return this.r===t.r&&this.g===t.g&&this.b===t.b&&this.a===t.a}clone(){return this._c(this)}toHexString(){let t="#";const n=(this.r||0).toString(16);t+=n.length===2?n:"0"+n;const r=(this.g||0).toString(16);t+=r.length===2?r:"0"+r;const i=(this.b||0).toString(16);if(t+=i.length===2?i:"0"+i,typeof this.a=="number"&&this.a>=0&&this.a<1){const o=Ca(this.a*255).toString(16);t+=o.length===2?o:"0"+o}return t}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const t=this.getHue(),n=Ca(this.getSaturation()*100),r=Ca(this.getLightness()*100);return this.a!==1?`hsla(${t},${n}%,${r}%,${this.a})`:`hsl(${t},${n}%,${r}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a!==1?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(t,n,r){const i=this.clone();return i[t]=qE(n,r),i}_c(t){return new this.constructor(t)}getMax(){return typeof this._max>"u"&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return typeof this._min>"u"&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(t){const n=t.replace("#","");function r(i,o){return parseInt(n[i]+n[o||i],16)}n.length<6?(this.r=r(0),this.g=r(1),this.b=r(2),this.a=n[3]?r(3)/255:1):(this.r=r(0,1),this.g=r(2,3),this.b=r(4,5),this.a=n[6]?r(6,7)/255:1)}fromHsl({h:t,s:n,l:r,a:i}){if(this._h=t%360,this._s=n,this._l=r,this.a=typeof i=="number"?i:1,n<=0){const h=Ca(r*255);this.r=h,this.g=h,this.b=h}let o=0,s=0,a=0;const l=t/60,c=(1-Math.abs(2*r-1))*n,u=c*(1-Math.abs(l%2-1));l>=0&&l<1?(o=c,s=u):l>=1&&l<2?(o=u,s=c):l>=2&&l<3?(s=c,a=u):l>=3&&l<4?(s=u,a=c):l>=4&&l<5?(o=u,a=c):l>=5&&l<6&&(o=c,a=u);const f=r-c/2;this.r=Ca((o+f)*255),this.g=Ca((s+f)*255),this.b=Ca((a+f)*255)}fromHsv({h:t,s:n,v:r,a:i}){this._h=t%360,this._s=n,this._v=r,this.a=typeof i=="number"?i:1;const o=Ca(r*255);if(this.r=o,this.g=o,this.b=o,n<=0)return;const s=t/60,a=Math.floor(s),l=s-a,c=Ca(r*(1-n)*255),u=Ca(r*(1-n*l)*255),f=Ca(r*(1-n*(1-l))*255);switch(a){case 0:this.g=f,this.b=c;break;case 1:this.r=u,this.b=c;break;case 2:this.r=c,this.b=f;break;case 3:this.r=c,this.g=u;break;case 4:this.r=f,this.g=c;break;case 5:default:this.g=c,this.b=u;break}}fromHsvString(t){const n=Oee(t,J5e);this.fromHsv({h:n[0],s:n[1],v:n[2],a:n[3]})}fromHslString(t){const n=Oee(t,J5e);this.fromHsl({h:n[0],s:n[1],l:n[2],a:n[3]})}fromRgbString(t){const n=Oee(t,(r,i)=>i.includes("%")?Ca(r/100*255):r);this.r=n[0],this.g=n[1],this.b=n[2],this.a=n[3]}}const ROt=Object.freeze(Object.defineProperty({__proto__:null,FastColor:kr},Symbol.toStringTag,{value:"Module"}));var dD=2,eSe=.16,$Ot=.05,OOt=.05,TOt=.15,jVe=5,VVe=4,IOt=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function tSe(e,t,n){var r;return Math.round(e.h)>=60&&Math.round(e.h)<=240?r=n?Math.round(e.h)-dD*t:Math.round(e.h)+dD*t:r=n?Math.round(e.h)+dD*t:Math.round(e.h)-dD*t,r<0?r+=360:r>=360&&(r-=360),r}function nSe(e,t,n){if(e.h===0&&e.s===0)return e.s;var r;return n?r=e.s-eSe*t:t===VVe?r=e.s+eSe:r=e.s+$Ot*t,r>1&&(r=1),n&&t===jVe&&r>.1&&(r=.1),r<.06&&(r=.06),Math.round(r*100)/100}function rSe(e,t,n){var r;return n?r=e.v+OOt*t:r=e.v-TOt*t,r=Math.max(0,Math.min(1,r)),Math.round(r*100)/100}function K4(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=new kr(e),i=r.toHsv(),o=jVe;o>0;o-=1){var s=new kr({h:tSe(i,o,!0),s:nSe(i,o,!0),v:rSe(i,o,!0)});n.push(s)}n.push(r);for(var a=1;a<=VVe;a+=1){var l=new kr({h:tSe(i,a),s:nSe(i,a),v:rSe(i,a)});n.push(l)}return t.theme==="dark"?IOt.map(function(c){var u=c.index,f=c.amount;return new kr(t.backgroundColor||"#141414").mix(n[u],f).toHexString()}):n.map(function(c){return c.toHexString()})}var oC={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},bz=["#fff1f0","#ffccc7","#ffa39e","#ff7875","#ff4d4f","#f5222d","#cf1322","#a8071a","#820014","#5c0011"];bz.primary=bz[5];var Sz=["#fff2e8","#ffd8bf","#ffbb96","#ff9c6e","#ff7a45","#fa541c","#d4380d","#ad2102","#871400","#610b00"];Sz.primary=Sz[5];var wz=["#fff7e6","#ffe7ba","#ffd591","#ffc069","#ffa940","#fa8c16","#d46b08","#ad4e00","#873800","#612500"];wz.primary=wz[5];var ET=["#fffbe6","#fff1b8","#ffe58f","#ffd666","#ffc53d","#faad14","#d48806","#ad6800","#874d00","#613400"];ET.primary=ET[5];var xz=["#feffe6","#ffffb8","#fffb8f","#fff566","#ffec3d","#fadb14","#d4b106","#ad8b00","#876800","#614700"];xz.primary=xz[5];var Ez=["#fcffe6","#f4ffb8","#eaff8f","#d3f261","#bae637","#a0d911","#7cb305","#5b8c00","#3f6600","#254000"];Ez.primary=Ez[5];var Rz=["#f6ffed","#d9f7be","#b7eb8f","#95de64","#73d13d","#52c41a","#389e0d","#237804","#135200","#092b00"];Rz.primary=Rz[5];var $z=["#e6fffb","#b5f5ec","#87e8de","#5cdbd3","#36cfc9","#13c2c2","#08979c","#006d75","#00474f","#002329"];$z.primary=$z[5];var DC=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];DC.primary=DC[5];var Oz=["#f0f5ff","#d6e4ff","#adc6ff","#85a5ff","#597ef7","#2f54eb","#1d39c4","#10239e","#061178","#030852"];Oz.primary=Oz[5];var Tz=["#f9f0ff","#efdbff","#d3adf7","#b37feb","#9254de","#722ed1","#531dab","#391085","#22075e","#120338"];Tz.primary=Tz[5];var Iz=["#fff0f6","#ffd6e7","#ffadd2","#ff85c0","#f759ab","#eb2f96","#c41d7f","#9e1068","#780650","#520339"];Iz.primary=Iz[5];var RT=["#a6a6a6","#999999","#8c8c8c","#808080","#737373","#666666","#404040","#1a1a1a","#000000","#000000"];RT.primary=RT[5];var MOt=RT,uN={red:bz,volcano:Sz,orange:wz,gold:ET,yellow:xz,lime:Ez,green:Rz,cyan:$z,blue:DC,geekblue:Oz,purple:Tz,magenta:Iz,grey:RT},Mz=["#2a1215","#431418","#58181c","#791a1f","#a61d24","#d32029","#e84749","#f37370","#f89f9a","#fac8c3"];Mz.primary=Mz[5];var Pz=["#2b1611","#441d12","#592716","#7c3118","#aa3e19","#d84a1b","#e87040","#f3956a","#f8b692","#fad4bc"];Pz.primary=Pz[5];var _z=["#2b1d11","#442a11","#593815","#7c4a15","#aa6215","#d87a16","#e89a3c","#f3b765","#f8cf8d","#fae3b7"];_z.primary=_z[5];var Az=["#2b2111","#443111","#594214","#7c5914","#aa7714","#d89614","#e8b339","#f3cc62","#f8df8b","#faedb5"];Az.primary=Az[5];var Dz=["#2b2611","#443b11","#595014","#7c6e14","#aa9514","#d8bd14","#e8d639","#f3ea62","#f8f48b","#fafab5"];Dz.primary=Dz[5];var Lz=["#1f2611","#2e3c10","#3e4f13","#536d13","#6f9412","#8bbb11","#a9d134","#c9e75d","#e4f88b","#f0fab5"];Lz.primary=Lz[5];var Fz=["#162312","#1d3712","#274916","#306317","#3c8618","#49aa19","#6abe39","#8fd460","#b2e58b","#d5f2bb"];Fz.primary=Fz[5];var Nz=["#112123","#113536","#144848","#146262","#138585","#13a8a8","#33bcb7","#58d1c9","#84e2d8","#b2f1e8"];Nz.primary=Nz[5];var kz=["#111a2c","#112545","#15325b","#15417e","#1554ad","#1668dc","#3c89e8","#65a9f3","#8dc5f8","#b7dcfa"];kz.primary=kz[5];var zz=["#131629","#161d40","#1c2755","#203175","#263ea0","#2b4acb","#5273e0","#7f9ef3","#a8c1f8","#d2e0fa"];zz.primary=zz[5];var Bz=["#1a1325","#24163a","#301c4d","#3e2069","#51258f","#642ab5","#854eca","#ab7ae0","#cda8f0","#ebd7fa"];Bz.primary=Bz[5];var Hz=["#291321","#40162f","#551c3b","#75204f","#a02669","#cb2b83","#e0529c","#f37fb7","#f8a8cc","#fad2e3"];Hz.primary=Hz[5];var jz=["#151515","#1f1f1f","#2d2d2d","#393939","#494949","#5a5a5a","#6a6a6a","#7b7b7b","#888888","#969696"];jz.primary=jz[5];var POt={red:Mz,volcano:Pz,orange:_z,gold:Az,yellow:Dz,lime:Lz,green:Fz,cyan:Nz,blue:kz,geekblue:zz,purple:Bz,magenta:Hz,grey:jz};const _Ot=Object.freeze(Object.defineProperty({__proto__:null,blue:DC,blueDark:kz,cyan:$z,cyanDark:Nz,geekblue:Oz,geekblueDark:zz,generate:K4,gold:ET,goldDark:Az,gray:MOt,green:Rz,greenDark:Fz,grey:RT,greyDark:jz,lime:Ez,limeDark:Lz,magenta:Iz,magentaDark:Hz,orange:wz,orangeDark:_z,presetDarkPalettes:POt,presetPalettes:uN,presetPrimaryColors:oC,purple:Tz,purpleDark:Bz,red:bz,redDark:Mz,volcano:Sz,volcanoDark:Pz,yellow:xz,yellowDark:Dz},Symbol.toStringTag,{value:"Module"})),jge={blue:"#1677FF",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#EB2F96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},c7=Object.assign(Object.assign({},jge),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:`-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'`,fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0});function GVe(e,t){let{generateColorPalettes:n,generateNeutralColorPalettes:r}=t;const{colorSuccess:i,colorWarning:o,colorError:s,colorInfo:a,colorPrimary:l,colorBgBase:c,colorTextBase:u}=e,f=n(l),h=n(i),g=n(o),p=n(s),m=n(a),v=r(c,u),C=e.colorLink||e.colorInfo,y=n(C),b=new kr(p[1]).mix(new kr(p[3]),50).toHexString();return Object.assign(Object.assign({},v),{colorPrimaryBg:f[1],colorPrimaryBgHover:f[2],colorPrimaryBorder:f[3],colorPrimaryBorderHover:f[4],colorPrimaryHover:f[5],colorPrimary:f[6],colorPrimaryActive:f[7],colorPrimaryTextHover:f[8],colorPrimaryText:f[9],colorPrimaryTextActive:f[10],colorSuccessBg:h[1],colorSuccessBgHover:h[2],colorSuccessBorder:h[3],colorSuccessBorderHover:h[4],colorSuccessHover:h[4],colorSuccess:h[6],colorSuccessActive:h[7],colorSuccessTextHover:h[8],colorSuccessText:h[9],colorSuccessTextActive:h[10],colorErrorBg:p[1],colorErrorBgHover:p[2],colorErrorBgFilledHover:b,colorErrorBgActive:p[3],colorErrorBorder:p[3],colorErrorBorderHover:p[4],colorErrorHover:p[5],colorError:p[6],colorErrorActive:p[7],colorErrorTextHover:p[8],colorErrorText:p[9],colorErrorTextActive:p[10],colorWarningBg:g[1],colorWarningBgHover:g[2],colorWarningBorder:g[3],colorWarningBorderHover:g[4],colorWarningHover:g[4],colorWarning:g[6],colorWarningActive:g[7],colorWarningTextHover:g[8],colorWarningText:g[9],colorWarningTextActive:g[10],colorInfoBg:m[1],colorInfoBgHover:m[2],colorInfoBorder:m[3],colorInfoBorderHover:m[4],colorInfoHover:m[4],colorInfo:m[6],colorInfoActive:m[7],colorInfoTextHover:m[8],colorInfoText:m[9],colorInfoTextActive:m[10],colorLinkHover:y[4],colorLink:y[6],colorLinkActive:y[7],colorBgMask:new kr("#000").setA(.45).toRgbString(),colorWhite:"#fff"})}const AOt=e=>{let t=e,n=e,r=e,i=e;return e<6&&e>=5?t=e+1:e<16&&e>=6?t=e+2:e>=16&&(t=16),e<7&&e>=5?n=4:e<8&&e>=7?n=5:e<14&&e>=8?n=6:e<16&&e>=14?n=7:e>=16&&(n=8),e<6&&e>=2?r=1:e>=6&&(r=2),e>4&&e<8?i=4:e>=8&&(i=6),{borderRadius:e,borderRadiusXS:r,borderRadiusSM:n,borderRadiusLG:t,borderRadiusOuter:i}};function DOt(e){const{motionUnit:t,motionBase:n,borderRadius:r,lineWidth:i}=e;return Object.assign({motionDurationFast:`${(n+t).toFixed(1)}s`,motionDurationMid:`${(n+t*2).toFixed(1)}s`,motionDurationSlow:`${(n+t*3).toFixed(1)}s`,lineWidthBold:i+1},AOt(r))}const WVe=e=>{const{controlHeight:t}=e;return{controlHeightSM:t*.75,controlHeightXS:t*.5,controlHeightLG:t*1.25}};function dN(e){return(e+8)/e}function LOt(e){const t=new Array(10).fill(null).map((n,r)=>{const i=r-1,o=e*Math.pow(Math.E,i/5),s=r>1?Math.floor(o):Math.ceil(o);return Math.floor(s/2)*2});return t[1]=e,t.map(n=>({size:n,lineHeight:dN(n)}))}const UVe=e=>{const t=LOt(e),n=t.map(u=>u.size),r=t.map(u=>u.lineHeight),i=n[1],o=n[0],s=n[2],a=r[1],l=r[0],c=r[2];return{fontSizeSM:o,fontSize:i,fontSizeLG:s,fontSizeXL:n[3],fontSizeHeading1:n[6],fontSizeHeading2:n[5],fontSizeHeading3:n[4],fontSizeHeading4:n[3],fontSizeHeading5:n[2],lineHeight:a,lineHeightLG:c,lineHeightSM:l,fontHeight:Math.round(a*i),fontHeightLG:Math.round(c*s),fontHeightSM:Math.round(l*o),lineHeightHeading1:r[6],lineHeightHeading2:r[5],lineHeightHeading3:r[4],lineHeightHeading4:r[3],lineHeightHeading5:r[2]}};function FOt(e){const{sizeUnit:t,sizeStep:n}=e;return{sizeXXL:t*(n+8),sizeXL:t*(n+4),sizeLG:t*(n+2),sizeMD:t*(n+1),sizeMS:t*n,size:t*n,sizeSM:t*(n-1),sizeXS:t*(n-2),sizeXXS:t*(n-3)}}const Gd=(e,t)=>new kr(e).setA(t).toRgbString(),KE=(e,t)=>new kr(e).darken(t).toHexString(),NOt=e=>{const t=K4(e);return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[4],6:t[5],7:t[6],8:t[4],9:t[5],10:t[6]}},kOt=(e,t)=>{const n=e||"#fff",r=t||"#000";return{colorBgBase:n,colorTextBase:r,colorText:Gd(r,.88),colorTextSecondary:Gd(r,.65),colorTextTertiary:Gd(r,.45),colorTextQuaternary:Gd(r,.25),colorFill:Gd(r,.15),colorFillSecondary:Gd(r,.06),colorFillTertiary:Gd(r,.04),colorFillQuaternary:Gd(r,.02),colorBgSolid:Gd(r,1),colorBgSolidHover:Gd(r,.75),colorBgSolidActive:Gd(r,.95),colorBgLayout:KE(n,4),colorBgContainer:KE(n,0),colorBgElevated:KE(n,0),colorBgSpotlight:Gd(r,.85),colorBgBlur:"transparent",colorBorder:KE(n,15),colorBorderSecondary:KE(n,6)}};function KI(e){oC.pink=oC.magenta,uN.pink=uN.magenta;const t=Object.keys(jge).map(n=>{const r=e[n]===oC[n]?uN[n]:K4(e[n]);return new Array(10).fill(1).reduce((i,o,s)=>(i[`${n}-${s+1}`]=r[s],i[`${n}${s+1}`]=r[s],i),{})}).reduce((n,r)=>(n=Object.assign(Object.assign({},n),r),n),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e),t),GVe(e,{generateColorPalettes:NOt,generateNeutralColorPalettes:kOt})),UVe(e.fontSize)),FOt(e)),WVe(e)),DOt(e))}const qVe=o7(KI),$T={token:c7,override:{override:c7},hashed:!0},Vge=ce.createContext($T),OT="ant",Gj="anticon",zOt=["outlined","borderless","filled"],BOt=(e,t)=>t||(e?`${OT}-${e}`:OT),vn=d.createContext({getPrefixCls:BOt,iconPrefixCls:Gj}),HOt=`-ant-${Date.now()}-${Math.random()}`;function jOt(e,t){const n={},r=(s,a)=>{let l=s.clone();return l=(a==null?void 0:a(l))||l,l.toRgbString()},i=(s,a)=>{const l=new kr(s),c=K4(l.toRgbString());n[`${a}-color`]=r(l),n[`${a}-color-disabled`]=c[1],n[`${a}-color-hover`]=c[4],n[`${a}-color-active`]=c[6],n[`${a}-color-outline`]=l.clone().setA(.2).toRgbString(),n[`${a}-color-deprecated-bg`]=c[0],n[`${a}-color-deprecated-border`]=c[2]};if(t.primaryColor){i(t.primaryColor,"primary");const s=new kr(t.primaryColor),a=K4(s.toRgbString());a.forEach((c,u)=>{n[`primary-${u+1}`]=c}),n["primary-color-deprecated-l-35"]=r(s,c=>c.lighten(35)),n["primary-color-deprecated-l-20"]=r(s,c=>c.lighten(20)),n["primary-color-deprecated-t-20"]=r(s,c=>c.tint(20)),n["primary-color-deprecated-t-50"]=r(s,c=>c.tint(50)),n["primary-color-deprecated-f-12"]=r(s,c=>c.setA(c.a*.12));const l=new kr(a[0]);n["primary-color-active-deprecated-f-30"]=r(l,c=>c.setA(c.a*.3)),n["primary-color-active-deprecated-d-02"]=r(l,c=>c.darken(2))}return t.successColor&&i(t.successColor,"success"),t.warningColor&&i(t.warningColor,"warning"),t.errorColor&&i(t.errorColor,"error"),t.infoColor&&i(t.infoColor,"info"),` + :root { + ${Object.keys(n).map(s=>`--${e}-${s}: ${n[s]};`).join(` +`)} + } + `.trim()}function VOt(e,t){const n=jOt(e,t);Bs()&&am(n,`${HOt}-dynamic-theme`)}const yc=d.createContext(!1),Gge=e=>{let{children:t,disabled:n}=e;const r=d.useContext(yc);return d.createElement(yc.Provider,{value:n??r},t)},LC=d.createContext(void 0),GOt=e=>{let{children:t,size:n}=e;const r=d.useContext(LC);return d.createElement(LC.Provider,{value:n||r},t)};function WOt(){const e=d.useContext(yc),t=d.useContext(LC);return{componentDisabled:e,componentSize:t}}var KVe=Kr(function e(){qr(this,e)}),YVe="CALC_UNIT",UOt=new RegExp(YVe,"g");function Tee(e){return typeof e=="number"?"".concat(e).concat(YVe):e}var qOt=function(e){hs(n,e);var t=wc(n);function n(r,i){var o;qr(this,n),o=t.call(this),ie(dn(o),"result",""),ie(dn(o),"unitlessCssVar",void 0),ie(dn(o),"lowPriority",void 0);var s=nn(r);return o.unitlessCssVar=i,r instanceof n?o.result="(".concat(r.result,")"):s==="number"?o.result=Tee(r):s==="string"&&(o.result=r),o}return Kr(n,[{key:"add",value:function(i){return i instanceof n?this.result="".concat(this.result," + ").concat(i.getResult()):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," + ").concat(Tee(i))),this.lowPriority=!0,this}},{key:"sub",value:function(i){return i instanceof n?this.result="".concat(this.result," - ").concat(i.getResult()):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," - ").concat(Tee(i))),this.lowPriority=!0,this}},{key:"mul",value:function(i){return this.lowPriority&&(this.result="(".concat(this.result,")")),i instanceof n?this.result="".concat(this.result," * ").concat(i.getResult(!0)):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," * ").concat(i)),this.lowPriority=!1,this}},{key:"div",value:function(i){return this.lowPriority&&(this.result="(".concat(this.result,")")),i instanceof n?this.result="".concat(this.result," / ").concat(i.getResult(!0)):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," / ").concat(i)),this.lowPriority=!1,this}},{key:"getResult",value:function(i){return this.lowPriority||i?"(".concat(this.result,")"):this.result}},{key:"equal",value:function(i){var o=this,s=i||{},a=s.unit,l=!0;return typeof a=="boolean"?l=a:Array.from(this.unitlessCssVar).some(function(c){return o.result.includes(c)})&&(l=!1),this.result=this.result.replace(UOt,l?"px":""),typeof this.lowPriority<"u"?"calc(".concat(this.result,")"):this.result}}]),n}(KVe),KOt=function(e){hs(n,e);var t=wc(n);function n(r){var i;return qr(this,n),i=t.call(this),ie(dn(i),"result",0),r instanceof n?i.result=r.result:typeof r=="number"&&(i.result=r),i}return Kr(n,[{key:"add",value:function(i){return i instanceof n?this.result+=i.result:typeof i=="number"&&(this.result+=i),this}},{key:"sub",value:function(i){return i instanceof n?this.result-=i.result:typeof i=="number"&&(this.result-=i),this}},{key:"mul",value:function(i){return i instanceof n?this.result*=i.result:typeof i=="number"&&(this.result*=i),this}},{key:"div",value:function(i){return i instanceof n?this.result/=i.result:typeof i=="number"&&(this.result/=i),this}},{key:"equal",value:function(){return this.result}}]),n}(KVe),XVe=function(t,n){var r=t==="css"?qOt:KOt;return function(i){return new r(i,n)}},iSe=function(t,n){return"".concat([n,t.replace(/([A-Z]+)([A-Z][a-z]+)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2")].filter(Boolean).join("-"))};function Hn(e){var t=d.useRef();t.current=e;var n=d.useCallback(function(){for(var r,i=arguments.length,o=new Array(i),s=0;s1e4){var r=Date.now();this.lastAccessBeat.forEach(function(i,o){r-i>ZOt&&(n.map.delete(o),n.lastAccessBeat.delete(o))}),this.accessBeat=0}}}]),e}(),aSe=new JOt;function eTt(e,t){return ce.useMemo(function(){var n=aSe.get(t);if(n)return n;var r=e();return aSe.set(t,r),r},t)}var tTt=function(){return{}};function JVe(e){var t=e.useCSP,n=t===void 0?tTt:t,r=e.useToken,i=e.usePrefix,o=e.getResetStyles,s=e.getCommonStyle,a=e.getCompUnitless;function l(h,g,p,m){var v=Array.isArray(h)?h[0]:h;function C(R){return"".concat(String(v)).concat(R.slice(0,1).toUpperCase()).concat(R.slice(1))}var y=(m==null?void 0:m.unitless)||{},b=typeof a=="function"?a(h):{},S=se(se({},b),{},ie({},C("zIndexPopup"),!0));Object.keys(y).forEach(function(R){S[C(R)]=y[R]});var w=se(se({},m),{},{unitless:S,prefixToken:C}),x=u(h,g,p,w),E=c(v,p,w);return function(R){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:R,T=x(R,O),M=Ce(T,2),_=M[1],F=E(O),D=Ce(F,2),k=D[0],L=D[1];return[k,_,L]}}function c(h,g,p){var m=p.unitless,v=p.injectStyle,C=v===void 0?!0:v,y=p.prefixToken,b=p.ignore,S=function(E){var R=E.rootCls,O=E.cssVar,T=O===void 0?{}:O,M=r(),_=M.realToken;return LVe({path:[h],prefix:T.prefix,key:T.key,unitless:m,ignore:b,token:_,scope:R},function(){var F=sSe(h,_,g),D=oSe(h,_,F,{deprecatedTokens:p==null?void 0:p.deprecatedTokens});return Object.keys(F).forEach(function(k){D[y(k)]=D[k],delete D[k]}),D}),null},w=function(E){var R=r(),O=R.cssVar;return[function(T){return C&&O?ce.createElement(ce.Fragment,null,ce.createElement(S,{rootCls:E,cssVar:O,component:h}),T):T},O==null?void 0:O.key]};return w}function u(h,g,p){var m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},v=Array.isArray(h)?h:[h,h],C=Ce(v,1),y=C[0],b=v.join("-"),S=e.layer||{name:"antd"};return function(w){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w,E=r(),R=E.theme,O=E.realToken,T=E.hashId,M=E.token,_=E.cssVar,F=i(),D=F.rootPrefixCls,k=F.iconPrefixCls,L=n(),I=_?"css":"js",A=eTt(function(){var G=new Set;return _&&Object.keys(m.unitless||{}).forEach(function(K){G.add(j$(K,_.prefix)),G.add(j$(K,iSe(y,_.prefix)))}),XVe(I,G)},[I,y,_==null?void 0:_.prefix]),N=QOt(I),B=N.max,z=N.min,j={theme:R,token:M,hashId:T,nonce:function(){return L.nonce},clientOnly:m.clientOnly,layer:S,order:m.order||-999};typeof o=="function"&&yz(se(se({},j),{},{clientOnly:!1,path:["Shared",D]}),function(){return o(M,{prefix:{rootPrefixCls:D,iconPrefixCls:k},csp:L})});var W=yz(se(se({},j),{},{path:[b,w,k]}),function(){if(m.injectStyle===!1)return[];var G=ZVe(M),K=G.token,q=G.flush,X=sSe(y,O,p),Q=".".concat(w),te=oSe(y,O,X,{deprecatedTokens:m.deprecatedTokens});_&&X&&nn(X)==="object"&&Object.keys(X).forEach(function(J){X[J]="var(".concat(j$(J,iSe(y,_.prefix)),")")});var ne=yr(K,{componentCls:Q,prefixCls:w,iconCls:".".concat(k),antCls:".".concat(D),calc:A,max:B,min:z},_?X:te),Z=g(ne,{hashId:T,prefixCls:w,rootPrefixCls:D,iconPrefixCls:k});q(y,te);var ee=typeof s=="function"?s(ne,w,x,m.resetFont):null;return[m.resetStyle===!1?null:ee,Z]});return[W,T]}}function f(h,g,p){var m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},v=u(h,g,p,se({resetStyle:!1,order:-998},m)),C=function(b){var S=b.prefixCls,w=b.rootCls,x=w===void 0?S:w;return v(S,x),null};return C}return{genStyleHooks:l,genSubStyleComponent:f,genComponentStyleHook:u}}const nTt=Object.freeze(Object.defineProperty({__proto__:null,genCalc:XVe,genStyleUtils:JVe,mergeToken:yr,statistic:Iae,statisticToken:ZVe},Symbol.toStringTag,{value:"Module"})),NC=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"],rTt="5.23.0";function Mee(e){return e>=0&&e<=255}function fD(e,t){const{r:n,g:r,b:i,a:o}=new kr(e).toRgb();if(o<1)return e;const{r:s,g:a,b:l}=new kr(t).toRgb();for(let c=.01;c<=1;c+=.01){const u=Math.round((n-s*(1-c))/c),f=Math.round((r-a*(1-c))/c),h=Math.round((i-l*(1-c))/c);if(Mee(u)&&Mee(f)&&Mee(h))return new kr({r:u,g:f,b:h,a:Math.round(c*100)/100}).toRgbString()}return new kr({r:n,g:r,b:i,a:1}).toRgbString()}var iTt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i{delete r[h]});const i=Object.assign(Object.assign({},n),r),o=480,s=576,a=768,l=992,c=1200,u=1600;if(i.motion===!1){const h="0s";i.motionDurationFast=h,i.motionDurationMid=h,i.motionDurationSlow=h}return Object.assign(Object.assign(Object.assign({},i),{colorFillContent:i.colorFillSecondary,colorFillContentHover:i.colorFill,colorFillAlter:i.colorFillQuaternary,colorBgContainerDisabled:i.colorFillTertiary,colorBorderBg:i.colorBgContainer,colorSplit:fD(i.colorBorderSecondary,i.colorBgContainer),colorTextPlaceholder:i.colorTextQuaternary,colorTextDisabled:i.colorTextQuaternary,colorTextHeading:i.colorText,colorTextLabel:i.colorTextSecondary,colorTextDescription:i.colorTextTertiary,colorTextLightSolid:i.colorWhite,colorHighlight:i.colorError,colorBgTextHover:i.colorFillSecondary,colorBgTextActive:i.colorFill,colorIcon:i.colorTextTertiary,colorIconHover:i.colorText,colorErrorOutline:fD(i.colorErrorBg,i.colorBgContainer),colorWarningOutline:fD(i.colorWarningBg,i.colorBgContainer),fontSizeIcon:i.fontSizeSM,lineWidthFocus:i.lineWidth*3,lineWidth:i.lineWidth,controlOutlineWidth:i.lineWidth*2,controlInteractiveSize:i.controlHeight/2,controlItemBgHover:i.colorFillTertiary,controlItemBgActive:i.colorPrimaryBg,controlItemBgActiveHover:i.colorPrimaryBgHover,controlItemBgActiveDisabled:i.colorFill,controlTmpOutline:i.colorFillQuaternary,controlOutline:fD(i.colorPrimaryBg,i.colorBgContainer),lineType:i.lineType,borderRadius:i.borderRadius,borderRadiusXS:i.borderRadiusXS,borderRadiusSM:i.borderRadiusSM,borderRadiusLG:i.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:i.sizeXXS,paddingXS:i.sizeXS,paddingSM:i.sizeSM,padding:i.size,paddingMD:i.sizeMD,paddingLG:i.sizeLG,paddingXL:i.sizeXL,paddingContentHorizontalLG:i.sizeLG,paddingContentVerticalLG:i.sizeMS,paddingContentHorizontal:i.sizeMS,paddingContentVertical:i.sizeSM,paddingContentHorizontalSM:i.size,paddingContentVerticalSM:i.sizeXS,marginXXS:i.sizeXXS,marginXS:i.sizeXS,marginSM:i.sizeSM,margin:i.size,marginMD:i.sizeMD,marginLG:i.sizeLG,marginXL:i.sizeXL,marginXXL:i.sizeXXL,boxShadow:` + 0 6px 16px 0 rgba(0, 0, 0, 0.08), + 0 3px 6px -4px rgba(0, 0, 0, 0.12), + 0 9px 28px 8px rgba(0, 0, 0, 0.05) + `,boxShadowSecondary:` + 0 6px 16px 0 rgba(0, 0, 0, 0.08), + 0 3px 6px -4px rgba(0, 0, 0, 0.12), + 0 9px 28px 8px rgba(0, 0, 0, 0.05) + `,boxShadowTertiary:` + 0 1px 2px 0 rgba(0, 0, 0, 0.03), + 0 1px 6px -1px rgba(0, 0, 0, 0.02), + 0 2px 4px 0 rgba(0, 0, 0, 0.02) + `,screenXS:o,screenXSMin:o,screenXSMax:s-1,screenSM:s,screenSMMin:s,screenSMMax:a-1,screenMD:a,screenMDMin:a,screenMDMax:l-1,screenLG:l,screenLGMin:l,screenLGMax:c-1,screenXL:c,screenXLMin:c,screenXLMax:u-1,screenXXL:u,screenXXLMin:u,boxShadowPopoverArrow:"2px 2px 5px rgba(0, 0, 0, 0.05)",boxShadowCard:` + 0 1px 2px -2px ${new kr("rgba(0, 0, 0, 0.16)").toRgbString()}, + 0 3px 6px 0 ${new kr("rgba(0, 0, 0, 0.12)").toRgbString()}, + 0 5px 12px 4px ${new kr("rgba(0, 0, 0, 0.09)").toRgbString()} + `,boxShadowDrawerRight:` + -6px 0 16px 0 rgba(0, 0, 0, 0.08), + -3px 0 6px -4px rgba(0, 0, 0, 0.12), + -9px 0 28px 8px rgba(0, 0, 0, 0.05) + `,boxShadowDrawerLeft:` + 6px 0 16px 0 rgba(0, 0, 0, 0.08), + 3px 0 6px -4px rgba(0, 0, 0, 0.12), + 9px 0 28px 8px rgba(0, 0, 0, 0.05) + `,boxShadowDrawerUp:` + 0 6px 16px 0 rgba(0, 0, 0, 0.08), + 0 3px 6px -4px rgba(0, 0, 0, 0.12), + 0 9px 28px 8px rgba(0, 0, 0, 0.05) + `,boxShadowDrawerDown:` + 0 -6px 16px 0 rgba(0, 0, 0, 0.08), + 0 -3px 6px -4px rgba(0, 0, 0, 0.12), + 0 -9px 28px 8px rgba(0, 0, 0, 0.05) + `,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),r)}var lSe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i{const r=n.getDerivativeToken(e),{override:i}=t,o=lSe(t,["override"]);let s=Object.assign(Object.assign({},r),{override:i});return s=Wge(s),o&&Object.entries(o).forEach(a=>{let[l,c]=a;const{theme:u}=c,f=lSe(c,["theme"]);let h=f;u&&(h=tGe(Object.assign(Object.assign({},s),f),{override:f},u)),s[l]=h}),s};function za(){const{token:e,hashed:t,theme:n,override:r,cssVar:i}=ce.useContext(Vge),o=`${rTt}-${t||""}`,s=n||qVe,[a,l,c]=SVe(s,[c7,e],{salt:o,override:r,getComputedToken:tGe,formatToken:Wge,cssVar:i&&{prefix:i.prefix,key:i.key,unitless:eGe,ignore:oTt,preserve:sTt}});return[s,c,t?l:"",a,i]}const Kf={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},ii=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return{boxSizing:"border-box",margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:"none",fontFamily:t?"inherit":e.fontFamily}},C3=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),$m=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),aTt=e=>({a:{color:e.colorLink,textDecoration:e.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${e.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive},"&:active, &:hover":{textDecoration:e.linkHoverDecoration,outline:0},"&:focus":{textDecoration:e.linkFocusDecoration,outline:0},"&[disabled]":{color:e.colorTextDisabled,cursor:"not-allowed"}}}),lTt=(e,t,n,r)=>{const i=`[class^="${t}"], [class*=" ${t}"]`,o=n?`.${n}`:i,s={boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}};let a={};return r!==!1&&(a={fontFamily:e.fontFamily,fontSize:e.fontSize}),{[o]:Object.assign(Object.assign(Object.assign({},a),s),{[i]:s})}},Om=(e,t)=>({outline:`${Ne(e.lineWidthFocus)} solid ${e.colorPrimaryBorder}`,outlineOffset:t??1,transition:"outline-offset 0s, outline 0s"}),Yf=(e,t)=>({"&:focus-visible":Object.assign({},Om(e,t))}),nGe=e=>({[`.${e}`]:Object.assign(Object.assign({},C3()),{[`.${e} .${e}-icon`]:{display:"block"}})}),Uge=e=>Object.assign(Object.assign({color:e.colorLink,textDecoration:e.linkDecoration,outline:"none",cursor:"pointer",transition:`all ${e.motionDurationSlow}`,border:0,padding:0,background:"none",userSelect:"none"},Yf(e)),{"&:focus, &:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive}}),{genStyleHooks:Yr,genComponentStyleHook:cTt,genSubStyleComponent:Hx}=JVe({usePrefix:()=>{const{getPrefixCls:e,iconPrefixCls:t}=d.useContext(vn);return{rootPrefixCls:e(),iconPrefixCls:t}},useToken:()=>{const[e,t,n,r,i]=za();return{theme:e,realToken:t,hashId:n,token:r,cssVar:i}},useCSP:()=>{const{csp:e}=d.useContext(vn);return e??{}},getResetStyles:(e,t)=>{var n;return[{"&":aTt(e)},nGe((n=t==null?void 0:t.prefix.iconPrefixCls)!==null&&n!==void 0?n:Gj)]},getCommonStyle:lTt,getCompUnitless:()=>eGe});function rGe(e,t){return NC.reduce((n,r)=>{const i=e[`${r}1`],o=e[`${r}3`],s=e[`${r}6`],a=e[`${r}7`];return Object.assign(Object.assign({},n),t(r,{lightColor:i,lightBorderColor:o,darkColor:s,textColor:a}))},{})}const uTt=(e,t)=>{const[n,r]=za();return yz({theme:n,token:r,hashId:"",path:["ant-design-icons",e],nonce:()=>t==null?void 0:t.nonce,layer:{name:"antd"}},()=>[nGe(e)])},dTt=Object.assign({},Mx),{useId:cSe}=dTt,fTt=()=>"",hTt=typeof cSe>"u"?fTt:cSe;function gTt(e,t,n){var r;_y();const i=e||{},o=i.inherit===!1||!t?Object.assign(Object.assign({},$T),{hashed:(r=t==null?void 0:t.hashed)!==null&&r!==void 0?r:$T.hashed,cssVar:t==null?void 0:t.cssVar}):t,s=hTt();return Rm(()=>{var a,l;if(!e)return t;const c=Object.assign({},o.components);Object.keys(e.components||{}).forEach(h=>{c[h]=Object.assign(Object.assign({},c[h]),e.components[h])});const u=`css-var-${s.replace(/:/g,"")}`,f=((a=i.cssVar)!==null&&a!==void 0?a:o.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:n==null?void 0:n.prefixCls},typeof o.cssVar=="object"?o.cssVar:{}),typeof i.cssVar=="object"?i.cssVar:{}),{key:typeof i.cssVar=="object"&&((l=i.cssVar)===null||l===void 0?void 0:l.key)||u});return Object.assign(Object.assign(Object.assign({},o),i),{token:Object.assign(Object.assign({},o.token),i.token),components:c,cssVar:f})},[i,o],(a,l)=>a.some((c,u)=>{const f=l[u];return!Uf(c,f,!0)}))}var pTt=["children"],iGe=d.createContext({});function oGe(e){var t=e.children,n=on(e,pTt);return d.createElement(iGe.Provider,{value:n},t)}var mTt=function(e){hs(n,e);var t=wc(n);function n(){return qr(this,n),t.apply(this,arguments)}return Kr(n,[{key:"render",value:function(){return this.props.children}}]),n}(d.Component);function vTt(e){var t=d.useReducer(function(a){return a+1},0),n=Ce(t,2),r=n[1],i=d.useRef(e),o=Hn(function(){return i.current}),s=Hn(function(a){i.current=typeof a=="function"?a(i.current):a,r()});return[o,s]}var f2="none",hD="appear",gD="enter",pD="leave",uSe="none",Kh="prepare",ES="start",RS="active",qge="end",sGe="prepared";function dSe(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}function CTt(e,t){var n={animationend:dSe("Animation","AnimationEnd"),transitionend:dSe("Transition","TransitionEnd")};return e&&("AnimationEvent"in t||delete n.animationend.animation,"TransitionEvent"in t||delete n.transitionend.transition),n}var yTt=CTt(Bs(),typeof window<"u"?window:{}),aGe={};if(Bs()){var bTt=document.createElement("div");aGe=bTt.style}var mD={};function lGe(e){if(mD[e])return mD[e];var t=yTt[e];if(t)for(var n=Object.keys(t),r=n.length,i=0;i1&&arguments[1]!==void 0?arguments[1]:2;t();var o=Rr(function(){i<=1?r({isCanceled:function(){return o!==e.current}}):n(r,i-1)});e.current=o}return d.useEffect(function(){return function(){t()}},[]),[n,t]};var xTt=[Kh,ES,RS,qge],ETt=[Kh,sGe],hGe=!1,RTt=!0;function gGe(e){return e===RS||e===qge}const $Tt=function(e,t,n){var r=FC(uSe),i=Ce(r,2),o=i[0],s=i[1],a=wTt(),l=Ce(a,2),c=l[0],u=l[1];function f(){s(Kh,!0)}var h=t?ETt:xTt;return fGe(function(){if(o!==uSe&&o!==qge){var g=h.indexOf(o),p=h[g+1],m=n(o);m===hGe?s(p,!0):p&&c(function(v){function C(){v.isCanceled()||s(p,!0)}m===!0?C():Promise.resolve(m).then(C)})}},[e,o]),d.useEffect(function(){return function(){u()}},[]),[f,o]};function OTt(e,t,n,r){var i=r.motionEnter,o=i===void 0?!0:i,s=r.motionAppear,a=s===void 0?!0:s,l=r.motionLeave,c=l===void 0?!0:l,u=r.motionDeadline,f=r.motionLeaveImmediately,h=r.onAppearPrepare,g=r.onEnterPrepare,p=r.onLeavePrepare,m=r.onAppearStart,v=r.onEnterStart,C=r.onLeaveStart,y=r.onAppearActive,b=r.onEnterActive,S=r.onLeaveActive,w=r.onAppearEnd,x=r.onEnterEnd,E=r.onLeaveEnd,R=r.onVisibleChanged,O=FC(),T=Ce(O,2),M=T[0],_=T[1],F=vTt(f2),D=Ce(F,2),k=D[0],L=D[1],I=FC(null),A=Ce(I,2),N=A[0],B=A[1],z=k(),j=d.useRef(!1),W=d.useRef(null);function G(){return n()}var K=d.useRef(!1);function q(){L(f2),B(null,!0)}var X=Hn(function(de){var xe=k();if(xe!==f2){var Ee=G();if(!(de&&!de.deadline&&de.target!==Ee)){var De=K.current,Be;xe===hD&&De?Be=w==null?void 0:w(Ee,de):xe===gD&&De?Be=x==null?void 0:x(Ee,de):xe===pD&&De&&(Be=E==null?void 0:E(Ee,de)),De&&Be!==!1&&q()}}}),Q=STt(X),te=Ce(Q,1),ne=te[0],Z=function(xe){switch(xe){case hD:return ie(ie(ie({},Kh,h),ES,m),RS,y);case gD:return ie(ie(ie({},Kh,g),ES,v),RS,b);case pD:return ie(ie(ie({},Kh,p),ES,C),RS,S);default:return{}}},ee=d.useMemo(function(){return Z(z)},[z]),J=$Tt(z,!e,function(de){if(de===Kh){var xe=ee[Kh];return xe?xe(G()):hGe}if(ge in ee){var Ee;B(((Ee=ee[ge])===null||Ee===void 0?void 0:Ee.call(ee,G(),null))||null)}return ge===RS&&z!==f2&&(ne(G()),u>0&&(clearTimeout(W.current),W.current=setTimeout(function(){X({deadline:!0})},u))),ge===sGe&&q(),RTt}),oe=Ce(J,2),le=oe[0],ge=oe[1],he=gGe(ge);K.current=he;var ye=d.useRef(null);fGe(function(){if(!(j.current&&ye.current===t)){_(t);var de=j.current;j.current=!0;var xe;!de&&t&&a&&(xe=hD),de&&t&&o&&(xe=gD),(de&&!t&&c||!de&&f&&!t&&c)&&(xe=pD);var Ee=Z(xe);xe&&(e||Ee[Kh])?(L(xe),le()):L(f2),ye.current=t}},[t]),d.useEffect(function(){(z===hD&&!a||z===gD&&!o||z===pD&&!c)&&L(f2)},[a,o,c]),d.useEffect(function(){return function(){j.current=!1,clearTimeout(W.current)}},[]);var ue=d.useRef(!1);d.useEffect(function(){M&&(ue.current=!0),M!==void 0&&z===f2&&((ue.current||M)&&(R==null||R(M)),ue.current=!0)},[M,z]);var ve=N;return ee[Kh]&&ge===ES&&(ve=se({transition:"none"},ve)),[z,ge,ve,M??t]}function TTt(e){var t=e;nn(e)==="object"&&(t=e.transitionSupport);function n(i,o){return!!(i.motionName&&t&&o!==!1)}var r=d.forwardRef(function(i,o){var s=i.visible,a=s===void 0?!0:s,l=i.removeOnLeave,c=l===void 0?!0:l,u=i.forceRender,f=i.children,h=i.motionName,g=i.leavedClassName,p=i.eventProps,m=d.useContext(iGe),v=m.motion,C=n(i,v),y=d.useRef(),b=d.useRef();function S(){try{return y.current instanceof HTMLElement?y.current:nC(b.current)}catch{return null}}var w=OTt(C,a,S,i),x=Ce(w,4),E=x[0],R=x[1],O=x[2],T=x[3],M=d.useRef(T);T&&(M.current=!0);var _=d.useCallback(function(A){y.current=A,CT(o,A)},[o]),F,D=se(se({},p),{},{visible:a});if(!f)F=null;else if(E===f2)T?F=f(se({},D),_):!c&&M.current&&g?F=f(se(se({},D),{},{className:g}),_):u||!c&&!g?F=f(se(se({},D),{},{style:{display:"none"}}),_):F=null;else{var k;R===Kh?k="prepare":gGe(R)?k="active":R===ES&&(k="start");var L=gSe(h,"".concat(E,"-").concat(k));F=f(se(se({},D),{},{className:we(gSe(h,E),ie(ie({},L,L&&k),h,typeof h=="string")),style:O}),_)}if(d.isValidElement(F)&&Cd(F)){var I=v3(F);I||(F=d.cloneElement(F,{ref:_}))}return d.createElement(mTt,{ref:b},F)});return r.displayName="CSSMotion",r}const Hs=TTt(dGe);var Mae="add",Pae="keep",_ae="remove",Pee="removed";function ITt(e){var t;return e&&nn(e)==="object"&&"key"in e?t=e:t={key:e},se(se({},t),{},{key:String(t.key)})}function Aae(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return e.map(ITt)}function MTt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=[],r=0,i=t.length,o=Aae(e),s=Aae(t);o.forEach(function(c){for(var u=!1,f=r;f1});return l.forEach(function(c){n=n.filter(function(u){var f=u.key,h=u.status;return f!==c||h!==_ae}),n.forEach(function(u){u.key===c&&(u.status=Pae)})}),n}var PTt=["component","children","onVisibleChanged","onAllRemoved"],_Tt=["status"],ATt=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function DTt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hs,n=function(r){hs(o,r);var i=wc(o);function o(){var s;qr(this,o);for(var a=arguments.length,l=new Array(a),c=0;cnull;var kTt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);it.endsWith("Color"))}const jTt=e=>{const{prefixCls:t,iconPrefixCls:n,theme:r,holderRender:i}=e;t!==void 0&&(Vz=t),n!==void 0&&(pGe=n),"holderRender"in e&&(vGe=i),r&&(HTt(r)?VOt(fN(),r):mGe=r)},CGe=()=>({getPrefixCls:(e,t)=>t||(e?`${fN()}-${e}`:fN()),getIconPrefixCls:BTt,getRootPrefixCls:()=>Vz||fN(),getTheme:()=>mGe,holderRender:vGe}),VTt=e=>{const{children:t,csp:n,autoInsertSpaceInButton:r,alert:i,anchor:o,form:s,locale:a,componentSize:l,direction:c,space:u,splitter:f,virtual:h,dropdownMatchSelectWidth:g,popupMatchSelectWidth:p,popupOverflow:m,legacyLocale:v,parentContext:C,iconPrefixCls:y,theme:b,componentDisabled:S,segmented:w,statistic:x,spin:E,calendar:R,carousel:O,cascader:T,collapse:M,typography:_,checkbox:F,descriptions:D,divider:k,drawer:L,skeleton:I,steps:A,image:N,layout:B,list:z,mentions:j,modal:W,progress:G,result:K,slider:q,breadcrumb:X,menu:Q,pagination:te,input:ne,textArea:Z,empty:ee,badge:J,radio:oe,rate:le,switch:ge,transfer:he,avatar:ye,message:ue,tag:ve,table:de,card:xe,tabs:Ee,timeline:De,timePicker:Be,upload:Ge,notification:Ue,tree:We,colorPicker:Ve,datePicker:Fe,rangePicker:ke,flex:Ye,wave:ze,dropdown:Re,warning:Le,tour:Me,tooltip:be,popover:je,popconfirm:Xe,floatButtonGroup:ft,variant:Tt,inputNumber:tt,treeSelect:pt}=e,$t=d.useCallback((at,gt)=>{const{prefixCls:yt}=e;if(gt)return gt;const st=yt||C.getPrefixCls("");return at?`${st}-${at}`:st},[C.getPrefixCls,e.prefixCls]),wt=y||C.iconPrefixCls||Gj,It=n||C.csp;uTt(wt,It);const Ct=gTt(b,C.theme,{prefixCls:$t("")}),ot={csp:It,autoInsertSpaceInButton:r,alert:i,anchor:o,locale:a||v,direction:c,space:u,splitter:f,virtual:h,popupMatchSelectWidth:p??g,popupOverflow:m,getPrefixCls:$t,iconPrefixCls:wt,theme:Ct,segmented:w,statistic:x,spin:E,calendar:R,carousel:O,cascader:T,collapse:M,typography:_,checkbox:F,descriptions:D,divider:k,drawer:L,skeleton:I,steps:A,image:N,input:ne,textArea:Z,layout:B,list:z,mentions:j,modal:W,progress:G,result:K,slider:q,breadcrumb:X,menu:Q,pagination:te,empty:ee,badge:J,radio:oe,rate:le,switch:ge,transfer:he,avatar:ye,message:ue,tag:ve,table:de,card:xe,tabs:Ee,timeline:De,timePicker:Be,upload:Ge,notification:Ue,tree:We,colorPicker:Ve,datePicker:Fe,rangePicker:ke,flex:Ye,wave:ze,dropdown:Re,warning:Le,tour:Me,tooltip:be,popover:je,popconfirm:Xe,floatButtonGroup:ft,variant:Tt,inputNumber:tt,treeSelect:pt},nt=Object.assign({},C);Object.keys(ot).forEach(at=>{ot[at]!==void 0&&(nt[at]=ot[at])}),zTt.forEach(at=>{const gt=e[at];gt&&(nt[at]=gt)}),typeof r<"u"&&(nt.button=Object.assign({autoInsertSpace:r},nt.button));const fe=Rm(()=>nt,nt,(at,gt)=>{const yt=Object.keys(at),st=Object.keys(gt);return yt.length!==st.length||yt.some(Ze=>at[Ze]!==gt[Ze])}),Te=d.useMemo(()=>({prefixCls:wt,csp:It}),[wt,It]);let $e=d.createElement(d.Fragment,null,d.createElement(NTt,{dropdownMatchSelectWidth:g}),t);const He=d.useMemo(()=>{var at,gt,yt,st;return xS(((at=yd.Form)===null||at===void 0?void 0:at.defaultValidateMessages)||{},((yt=(gt=fe.locale)===null||gt===void 0?void 0:gt.Form)===null||yt===void 0?void 0:yt.defaultValidateMessages)||{},((st=fe.form)===null||st===void 0?void 0:st.validateMessages)||{},(s==null?void 0:s.validateMessages)||{})},[fe,s==null?void 0:s.validateMessages]);Object.keys(He).length>0&&($e=d.createElement(kVe.Provider,{value:He},$e)),a&&($e=d.createElement(EOt,{locale:a,_ANT_MARK__:xOt},$e)),$e=d.createElement(qI.Provider,{value:Te},$e),l&&($e=d.createElement(GOt,{size:l},$e)),$e=d.createElement(FTt,null,$e);const it=d.useMemo(()=>{const at=Ct||{},{algorithm:gt,token:yt,components:st,cssVar:Ze}=at,dt=kTt(at,["algorithm","token","components","cssVar"]),At=gt&&(!Array.isArray(gt)||gt.length>0)?o7(gt):qVe,kt={};Object.entries(st||{}).forEach(ln=>{let[Lt,xt]=ln;const Rt=Object.assign({},xt);"algorithm"in Rt&&(Rt.algorithm===!0?Rt.theme=At:(Array.isArray(Rt.algorithm)||typeof Rt.algorithm=="function")&&(Rt.theme=o7(Rt.algorithm)),delete Rt.algorithm),kt[Lt]=Rt});const pn=Object.assign(Object.assign({},c7),yt);return Object.assign(Object.assign({},dt),{theme:At,token:pn,components:kt,override:Object.assign({override:pn},kt),cssVar:Ze})},[Ct]);return b&&($e=d.createElement(Vge.Provider,{value:it},$e)),fe.warning&&($e=d.createElement(yOt.Provider,{value:fe.warning},$e)),S!==void 0&&($e=d.createElement(Gge,{disabled:S},$e)),d.createElement(vn.Provider,{value:fe},$e)},Wg=e=>{const t=d.useContext(vn),n=d.useContext(Hge);return d.createElement(VTt,Object.assign({parentContext:t,legacyLocale:n},e))};Wg.ConfigContext=vn;Wg.SizeContext=LC;Wg.config=jTt;Wg.useConfig=WOt;Object.defineProperty(Wg,"SizeContext",{get:()=>LC});var GTt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"};function yGe(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}function WTt(e){return yGe(e)instanceof ShadowRoot}function Gz(e){return WTt(e)?yGe(e):null}function UTt(e){return e.replace(/-(.)/g,function(t,n){return n.toUpperCase()})}function Dae(e,t){ui(e,"[@ant-design/icons] ".concat(t))}function pSe(e){return nn(e)==="object"&&typeof e.name=="string"&&typeof e.theme=="string"&&(nn(e.icon)==="object"||typeof e.icon=="function")}function mSe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(e).reduce(function(t,n){var r=e[n];switch(n){case"class":t.className=r,delete t.class;break;default:delete t[n],t[UTt(n)]=r}return t},{})}function Lae(e,t,n){return n?ce.createElement(e.tag,se(se({key:t},mSe(e.attrs)),n),(e.children||[]).map(function(r,i){return Lae(r,"".concat(t,"-").concat(e.tag,"-").concat(i))})):ce.createElement(e.tag,se({key:t},mSe(e.attrs)),(e.children||[]).map(function(r,i){return Lae(r,"".concat(t,"-").concat(e.tag,"-").concat(i))}))}function bGe(e){return K4(e)[0]}function SGe(e){return e?Array.isArray(e)?e:[e]:[]}var qTt={width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false"},KTt=` +.anticon { + display: inline-flex; + align-items: center; + color: inherit; + font-style: normal; + line-height: 0; + text-align: center; + text-transform: none; + vertical-align: -0.125em; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.anticon > * { + line-height: 1; +} + +.anticon svg { + display: inline-block; +} + +.anticon::before { + display: none; +} + +.anticon .anticon-icon { + display: block; +} + +.anticon[tabindex] { + cursor: pointer; +} + +.anticon-spin::before, +.anticon-spin { + display: inline-block; + -webkit-animation: loadingCircle 1s infinite linear; + animation: loadingCircle 1s infinite linear; +} + +@-webkit-keyframes loadingCircle { + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +@keyframes loadingCircle { + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} +`,wGe=function(t){var n=d.useContext(qI),r=n.csp,i=n.prefixCls,o=KTt;i&&(o=o.replace(/anticon/g,i)),d.useEffect(function(){var s=t.current,a=Gz(s);am(o,"@ant-design-icons",{prepend:!0,csp:r,attachTo:a})},[])},YTt=["icon","className","onClick","style","primaryColor","secondaryColor"],G$={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function XTt(e){var t=e.primaryColor,n=e.secondaryColor;G$.primaryColor=t,G$.secondaryColor=n||bGe(t),G$.calculated=!!n}function QTt(){return se({},G$)}var jx=function(t){var n=t.icon,r=t.className,i=t.onClick,o=t.style,s=t.primaryColor,a=t.secondaryColor,l=on(t,YTt),c=d.useRef(),u=G$;if(s&&(u={primaryColor:s,secondaryColor:a||bGe(s)}),wGe(c),Dae(pSe(n),"icon should be icon definiton, but got ".concat(n)),!pSe(n))return null;var f=n;return f&&typeof f.icon=="function"&&(f=se(se({},f),{},{icon:f.icon(u.primaryColor,u.secondaryColor)})),Lae(f.icon,"svg-".concat(f.name),se(se({className:r,onClick:i,style:o,"data-icon":f.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},l),{},{ref:c}))};jx.displayName="IconReact";jx.getTwoToneColors=QTt;jx.setTwoToneColors=XTt;function Kge(e){var t=SGe(e),n=Ce(t,2),r=n[0],i=n[1];return jx.setTwoToneColors({primaryColor:r,secondaryColor:i})}function xGe(){var e=jx.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}var ZTt=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];Kge(DC.primary);var Y=d.forwardRef(function(e,t){var n=e.className,r=e.icon,i=e.spin,o=e.rotate,s=e.tabIndex,a=e.onClick,l=e.twoToneColor,c=on(e,ZTt),u=d.useContext(qI),f=u.prefixCls,h=f===void 0?"anticon":f,g=u.rootClassName,p=we(g,h,ie(ie({},"".concat(h,"-").concat(r.name),!!r.name),"".concat(h,"-spin"),!!i||r.name==="loading"),n),m=s;m===void 0&&a&&(m=-1);var v=o?{msTransform:"rotate(".concat(o,"deg)"),transform:"rotate(".concat(o,"deg)")}:void 0,C=SGe(l),y=Ce(C,2),b=y[0],S=y[1];return d.createElement("span",V({role:"img","aria-label":r.name},c,{ref:t,tabIndex:m,onClick:a,className:p}),d.createElement(jx,{icon:r,primaryColor:b,secondaryColor:S,style:v}))});Y.displayName="AntdIcon";Y.getTwoToneColor=xGe;Y.setTwoToneColor=Kge;var JTt=function(t,n){return d.createElement(Y,V({},t,{ref:n,icon:GTt}))},Ay=d.forwardRef(JTt),eIt={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"},tIt=function(t,n){return d.createElement(Y,V({},t,{ref:n,icon:eIt}))},nv=d.forwardRef(tIt),nIt={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"},rIt=function(t,n){return d.createElement(Y,V({},t,{ref:n,icon:nIt}))},Ug=d.forwardRef(rIt),iIt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"},oIt=function(t,n){return d.createElement(Y,V({},t,{ref:n,icon:iIt}))},Vx=d.forwardRef(oIt),sIt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"},aIt=function(t,n){return d.createElement(Y,V({},t,{ref:n,icon:sIt}))},YI=d.forwardRef(aIt),lIt=`accept acceptCharset accessKey action allowFullScreen allowTransparency + alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge + charSet checked classID className colSpan cols content contentEditable contextMenu + controls coords crossOrigin data dateTime default defer dir disabled download draggable + encType form formAction formEncType formMethod formNoValidate formTarget frameBorder + headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity + is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media + mediaGroup method min minLength multiple muted name noValidate nonce open + optimum pattern placeholder poster preload radioGroup readOnly rel required + reversed role rowSpan rows sandbox scope scoped scrolling seamless selected + shape size sizes span spellCheck src srcDoc srcLang srcSet start step style + summary tabIndex target title type useMap value width wmode wrap`,cIt=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown + onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick + onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown + onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel + onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough + onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata + onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,uIt="".concat(lIt," ").concat(cIt).split(/[\s\n]+/),dIt="aria-",fIt="data-";function vSe(e,t){return e.indexOf(t)===0}function $o(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;t===!1?n={aria:!0,data:!0,attr:!0}:t===!0?n={aria:!0}:n=se({},t);var r={};return Object.keys(e).forEach(function(i){(n.aria&&(i==="role"||vSe(i,dIt))||n.data&&vSe(i,fIt)||n.attr&&uIt.includes(i))&&(r[i]=e[i])}),r}function EGe(e){return e&&ce.isValidElement(e)&&e.type===ce.Fragment}const Yge=(e,t,n)=>ce.isValidElement(e)?ce.cloneElement(e,typeof n=="function"?n(e.props||{}):n):t;function js(e,t){return Yge(e,e,t)}const vD=(e,t,n,r,i)=>({background:e,border:`${Ne(r.lineWidth)} ${r.lineType} ${t}`,[`${i}-icon`]:{color:n}}),hIt=e=>{const{componentCls:t,motionDurationSlow:n,marginXS:r,marginSM:i,fontSize:o,fontSizeLG:s,lineHeight:a,borderRadiusLG:l,motionEaseInOutCirc:c,withDescriptionIconSize:u,colorText:f,colorTextHeading:h,withDescriptionPadding:g,defaultPadding:p}=e;return{[t]:Object.assign(Object.assign({},ii(e)),{position:"relative",display:"flex",alignItems:"center",padding:p,wordWrap:"break-word",borderRadius:l,[`&${t}-rtl`]:{direction:"rtl"},[`${t}-content`]:{flex:1,minWidth:0},[`${t}-icon`]:{marginInlineEnd:r,lineHeight:0},"&-description":{display:"none",fontSize:o,lineHeight:a},"&-message":{color:h},[`&${t}-motion-leave`]:{overflow:"hidden",opacity:1,transition:`max-height ${n} ${c}, opacity ${n} ${c}, + padding-top ${n} ${c}, padding-bottom ${n} ${c}, + margin-bottom ${n} ${c}`},[`&${t}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}}),[`${t}-with-description`]:{alignItems:"flex-start",padding:g,[`${t}-icon`]:{marginInlineEnd:i,fontSize:u,lineHeight:0},[`${t}-message`]:{display:"block",marginBottom:r,color:h,fontSize:s},[`${t}-description`]:{display:"block",color:f}},[`${t}-banner`]:{marginBottom:0,border:"0 !important",borderRadius:0}}},gIt=e=>{const{componentCls:t,colorSuccess:n,colorSuccessBorder:r,colorSuccessBg:i,colorWarning:o,colorWarningBorder:s,colorWarningBg:a,colorError:l,colorErrorBorder:c,colorErrorBg:u,colorInfo:f,colorInfoBorder:h,colorInfoBg:g}=e;return{[t]:{"&-success":vD(i,r,n,e,t),"&-info":vD(g,h,f,e,t),"&-warning":vD(a,s,o,e,t),"&-error":Object.assign(Object.assign({},vD(u,c,l,e,t)),{[`${t}-description > pre`]:{margin:0,padding:0}})}}},pIt=e=>{const{componentCls:t,iconCls:n,motionDurationMid:r,marginXS:i,fontSizeIcon:o,colorIcon:s,colorIconHover:a}=e;return{[t]:{"&-action":{marginInlineStart:i},[`${t}-close-icon`]:{marginInlineStart:i,padding:0,overflow:"hidden",fontSize:o,lineHeight:Ne(o),backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",[`${n}-close`]:{color:s,transition:`color ${r}`,"&:hover":{color:a}}},"&-close-text":{color:s,transition:`color ${r}`,"&:hover":{color:a}}}}},mIt=e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:`${e.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`}),vIt=Yr("Alert",e=>[hIt(e),gIt(e),pIt(e)],mIt);var CSe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i{const{icon:t,prefixCls:n,type:r}=e,i=CIt[r]||null;return t?Yge(t,d.createElement("span",{className:`${n}-icon`},t),()=>({className:we(`${n}-icon`,t.props.className)})):d.createElement(i,{className:`${n}-icon`})},bIt=e=>{const{isClosable:t,prefixCls:n,closeIcon:r,handleClose:i,ariaProps:o}=e,s=r===!0||r===void 0?d.createElement(Ug,null):r;return t?d.createElement("button",Object.assign({type:"button",onClick:i,className:`${n}-close-icon`,tabIndex:0},o),s):null},RGe=d.forwardRef((e,t)=>{const{description:n,prefixCls:r,message:i,banner:o,className:s,rootClassName:a,style:l,onMouseEnter:c,onMouseLeave:u,onClick:f,afterClose:h,showIcon:g,closable:p,closeText:m,closeIcon:v,action:C,id:y}=e,b=CSe(e,["description","prefixCls","message","banner","className","rootClassName","style","onMouseEnter","onMouseLeave","onClick","afterClose","showIcon","closable","closeText","closeIcon","action","id"]),[S,w]=d.useState(!1),x=d.useRef(null);d.useImperativeHandle(t,()=>({nativeElement:x.current}));const{getPrefixCls:E,direction:R,alert:O}=d.useContext(vn),T=E("alert",r),[M,_,F]=vIt(T),D=j=>{var W;w(!0),(W=e.onClose)===null||W===void 0||W.call(e,j)},k=d.useMemo(()=>e.type!==void 0?e.type:o?"warning":"info",[e.type,o]),L=d.useMemo(()=>typeof p=="object"&&p.closeIcon||m?!0:typeof p=="boolean"?p:v!==!1&&v!==null&&v!==void 0?!0:!!(O!=null&&O.closable),[m,v,p,O==null?void 0:O.closable]),I=o&&g===void 0?!0:g,A=we(T,`${T}-${k}`,{[`${T}-with-description`]:!!n,[`${T}-no-icon`]:!I,[`${T}-banner`]:!!o,[`${T}-rtl`]:R==="rtl"},O==null?void 0:O.className,s,a,F,_),N=$o(b,{aria:!0,data:!0}),B=d.useMemo(()=>{var j,W;return typeof p=="object"&&p.closeIcon?p.closeIcon:m||(v!==void 0?v:typeof(O==null?void 0:O.closable)=="object"&&(!((j=O==null?void 0:O.closable)===null||j===void 0)&&j.closeIcon)?(W=O==null?void 0:O.closable)===null||W===void 0?void 0:W.closeIcon:O==null?void 0:O.closeIcon)},[v,p,m,O==null?void 0:O.closeIcon]),z=d.useMemo(()=>{const j=p??(O==null?void 0:O.closable);return typeof j=="object"?CSe(j,["closeIcon"]):{}},[p,O==null?void 0:O.closable]);return M(d.createElement(Hs,{visible:!S,motionName:`${T}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:j=>({maxHeight:j.offsetHeight}),onLeaveEnd:h},(j,W)=>{let{className:G,style:K}=j;return d.createElement("div",Object.assign({id:y,ref:Ws(x,W),"data-show":!S,className:we(A,G),style:Object.assign(Object.assign(Object.assign({},O==null?void 0:O.style),l),K),onMouseEnter:c,onMouseLeave:u,onClick:f,role:"alert"},N),I?d.createElement(yIt,{description:n,icon:e.icon,prefixCls:T,type:k}):null,d.createElement("div",{className:`${T}-content`},i?d.createElement("div",{className:`${T}-message`},i):null,n?d.createElement("div",{className:`${T}-description`},n):null),C?d.createElement("div",{className:`${T}-action`},C):null,d.createElement(bIt,{isClosable:L,prefixCls:T,closeIcon:B,handleClose:D,ariaProps:z}))}))});function SIt(e,t,n){return t=ul(t),Py(e,tv()?Reflect.construct(t,n||[],ul(e).constructor):t.apply(e,n))}let wIt=function(e){function t(){var n;return qr(this,t),n=SIt(this,t,arguments),n.state={error:void 0,info:{componentStack:""}},n}return hs(t,e),Kr(t,[{key:"componentDidCatch",value:function(r,i){this.setState({error:r,info:i})}},{key:"render",value:function(){const{message:r,description:i,id:o,children:s}=this.props,{error:a,info:l}=this.state,c=(l==null?void 0:l.componentStack)||null,u=typeof r>"u"?(a||"").toString():r,f=typeof i>"u"?c:i;return a?d.createElement(RGe,{id:o,type:"error",message:u,description:d.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},f)}):s}}])}(d.Component);const $Ge=RGe;$Ge.ErrorBoundary=wIt;const ySe=e=>typeof e=="object"&&e!=null&&e.nodeType===1,bSe=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",_ee=(e,t)=>{if(e.clientHeight{const i=(o=>{if(!o.ownerDocument||!o.ownerDocument.defaultView)return null;try{return o.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeightot||o>e&&s=t&&a>=n?o-e-r:s>t&&an?s-t+i:0,xIt=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},SSe=(e,t)=>{var n,r,i,o;if(typeof document>"u")return[];const{scrollMode:s,block:a,inline:l,boundary:c,skipOverflowHiddenElements:u}=t,f=typeof c=="function"?c:L=>L!==c;if(!ySe(e))throw new TypeError("Invalid target");const h=document.scrollingElement||document.documentElement,g=[];let p=e;for(;ySe(p)&&f(p);){if(p=xIt(p),p===h){g.push(p);break}p!=null&&p===document.body&&_ee(p)&&!_ee(document.documentElement)||p!=null&&_ee(p,u)&&g.push(p)}const m=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,v=(o=(i=window.visualViewport)==null?void 0:i.height)!=null?o:innerHeight,{scrollX:C,scrollY:y}=window,{height:b,width:S,top:w,right:x,bottom:E,left:R}=e.getBoundingClientRect(),{top:O,right:T,bottom:M,left:_}=(L=>{const I=window.getComputedStyle(L);return{top:parseFloat(I.scrollMarginTop)||0,right:parseFloat(I.scrollMarginRight)||0,bottom:parseFloat(I.scrollMarginBottom)||0,left:parseFloat(I.scrollMarginLeft)||0}})(e);let F=a==="start"||a==="nearest"?w-O:a==="end"?E+M:w+b/2-O+M,D=l==="center"?R+S/2-_+T:l==="end"?x+T:R-_;const k=[];for(let L=0;L=0&&R>=0&&E<=v&&x<=m&&w>=B&&E<=j&&R>=W&&x<=z)return k;const G=getComputedStyle(I),K=parseInt(G.borderLeftWidth,10),q=parseInt(G.borderTopWidth,10),X=parseInt(G.borderRightWidth,10),Q=parseInt(G.borderBottomWidth,10);let te=0,ne=0;const Z="offsetWidth"in I?I.offsetWidth-I.clientWidth-K-X:0,ee="offsetHeight"in I?I.offsetHeight-I.clientHeight-q-Q:0,J="offsetWidth"in I?I.offsetWidth===0?0:N/I.offsetWidth:0,oe="offsetHeight"in I?I.offsetHeight===0?0:A/I.offsetHeight:0;if(h===I)te=a==="start"?F:a==="end"?F-v:a==="nearest"?CD(y,y+v,v,q,Q,y+F,y+F+b,b):F-v/2,ne=l==="start"?D:l==="center"?D-m/2:l==="end"?D-m:CD(C,C+m,m,K,X,C+D,C+D+S,S),te=Math.max(0,te+y),ne=Math.max(0,ne+C);else{te=a==="start"?F-B-q:a==="end"?F-j+Q+ee:a==="nearest"?CD(B,j,A,q,Q+ee,F,F+b,b):F-(B+A/2)+ee/2,ne=l==="start"?D-W-K:l==="center"?D-(W+N/2)+Z/2:l==="end"?D-z+X+Z:CD(W,z,N,K,X+Z,D,D+S,S);const{scrollLeft:le,scrollTop:ge}=I;te=oe===0?0:Math.max(0,Math.min(ge+te/oe,I.scrollHeight-A/oe+ee)),ne=J===0?0:Math.max(0,Math.min(le+ne/J,I.scrollWidth-N/J+Z)),F+=ge-te,D+=le-ne}k.push({el:I,top:te,left:ne})}return k},EIt=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function OGe(e,t){if(!e.isConnected||!(i=>{let o=i;for(;o&&o.parentNode;){if(o.parentNode===document)return!0;o=o.parentNode instanceof ShadowRoot?o.parentNode.host:o.parentNode}return!1})(e))return;const n=(i=>{const o=window.getComputedStyle(i);return{top:parseFloat(o.scrollMarginTop)||0,right:parseFloat(o.scrollMarginRight)||0,bottom:parseFloat(o.scrollMarginBottom)||0,left:parseFloat(o.scrollMarginLeft)||0}})(e);if((i=>typeof i=="object"&&typeof i.behavior=="function")(t))return t.behavior(SSe(e,t));const r=typeof t=="boolean"||t==null?void 0:t.behavior;for(const{el:i,top:o,left:s}of SSe(e,EIt(t))){const a=o-n.top+n.bottom,l=s-n.left+n.right;i.scroll({top:a,left:l,behavior:r})}}const RIt=Object.freeze(Object.defineProperty({__proto__:null,default:OGe},Symbol.toStringTag,{value:"Module"})),Oo=e=>{const[,,,,t]=za();return t?`${e}-css-var`:""};var lt={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(t){var n=t.keyCode;if(t.altKey&&!t.ctrlKey||t.metaKey||n>=lt.F1&&n<=lt.F12)return!1;switch(n){case lt.ALT:case lt.CAPS_LOCK:case lt.CONTEXT_MENU:case lt.CTRL:case lt.DOWN:case lt.END:case lt.ESC:case lt.HOME:case lt.INSERT:case lt.LEFT:case lt.MAC_FF_META:case lt.META:case lt.NUMLOCK:case lt.NUM_CENTER:case lt.PAGE_DOWN:case lt.PAGE_UP:case lt.PAUSE:case lt.PRINT_SCREEN:case lt.RIGHT:case lt.SHIFT:case lt.UP:case lt.WIN_KEY:case lt.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(t){if(t>=lt.ZERO&&t<=lt.NINE||t>=lt.NUM_ZERO&&t<=lt.NUM_MULTIPLY||t>=lt.A&&t<=lt.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&t===0)return!0;switch(t){case lt.SPACE:case lt.QUESTION_MARK:case lt.NUM_PLUS:case lt.NUM_MINUS:case lt.NUM_PERIOD:case lt.NUM_DIVISION:case lt.SEMICOLON:case lt.DASH:case lt.EQUALS:case lt.COMMA:case lt.PERIOD:case lt.SLASH:case lt.APOSTROPHE:case lt.SINGLE_QUOTE:case lt.OPEN_SQUARE_BRACKET:case lt.BACKSLASH:case lt.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Xge=d.forwardRef(function(e,t){var n=e.prefixCls,r=e.style,i=e.className,o=e.duration,s=o===void 0?4.5:o,a=e.showProgress,l=e.pauseOnHover,c=l===void 0?!0:l,u=e.eventKey,f=e.content,h=e.closable,g=e.closeIcon,p=g===void 0?"x":g,m=e.props,v=e.onClick,C=e.onNoticeClose,y=e.times,b=e.hovering,S=d.useState(!1),w=Ce(S,2),x=w[0],E=w[1],R=d.useState(0),O=Ce(R,2),T=O[0],M=O[1],_=d.useState(0),F=Ce(_,2),D=F[0],k=F[1],L=b||x,I=s>0&&a,A=function(){C(u)},N=function(K){(K.key==="Enter"||K.code==="Enter"||K.keyCode===lt.ENTER)&&A()};d.useEffect(function(){if(!L&&s>0){var G=Date.now()-D,K=setTimeout(function(){A()},s*1e3-D);return function(){c&&clearTimeout(K),k(Date.now()-G)}}},[s,L,y]),d.useEffect(function(){if(!L&&I&&(c||D===0)){var G=performance.now(),K,q=function X(){cancelAnimationFrame(K),K=requestAnimationFrame(function(Q){var te=Q+D-G,ne=Math.min(te/(s*1e3),1);M(ne*100),ne<1&&X()})};return q(),function(){c&&cancelAnimationFrame(K)}}},[s,D,L,I,y]);var B=d.useMemo(function(){return nn(h)==="object"&&h!==null?h:h?{closeIcon:p}:{}},[h,p]),z=$o(B,!0),j=100-(!T||T<0?0:T>100?100:T),W="".concat(n,"-notice");return d.createElement("div",V({},m,{ref:t,className:we(W,i,ie({},"".concat(W,"-closable"),h)),style:r,onMouseEnter:function(K){var q;E(!0),m==null||(q=m.onMouseEnter)===null||q===void 0||q.call(m,K)},onMouseLeave:function(K){var q;E(!1),m==null||(q=m.onMouseLeave)===null||q===void 0||q.call(m,K)},onClick:v}),d.createElement("div",{className:"".concat(W,"-content")},f),h&&d.createElement("a",V({tabIndex:0,className:"".concat(W,"-close"),onKeyDown:N,"aria-label":"Close"},z,{onClick:function(K){K.preventDefault(),K.stopPropagation(),A()}}),B.closeIcon),I&&d.createElement("progress",{className:"".concat(W,"-progress"),max:"100",value:j},j+"%"))}),TGe=ce.createContext({}),Qge=function(t){var n=t.children,r=t.classNames;return ce.createElement(TGe.Provider,{value:{classNames:r}},n)},wSe=8,xSe=3,ESe=16,$It=function(t){var n={offset:wSe,threshold:xSe,gap:ESe};if(t&&nn(t)==="object"){var r,i,o;n.offset=(r=t.offset)!==null&&r!==void 0?r:wSe,n.threshold=(i=t.threshold)!==null&&i!==void 0?i:xSe,n.gap=(o=t.gap)!==null&&o!==void 0?o:ESe}return[!!t,n]},OIt=["className","style","classNames","styles"],TIt=function(t){var n=t.configList,r=t.placement,i=t.prefixCls,o=t.className,s=t.style,a=t.motion,l=t.onAllNoticeRemoved,c=t.onNoticeClose,u=t.stack,f=d.useContext(TGe),h=f.classNames,g=d.useRef({}),p=d.useState(null),m=Ce(p,2),v=m[0],C=m[1],y=d.useState([]),b=Ce(y,2),S=b[0],w=b[1],x=n.map(function(L){return{config:L,key:String(L.key)}}),E=$It(u),R=Ce(E,2),O=R[0],T=R[1],M=T.offset,_=T.threshold,F=T.gap,D=O&&(S.length>0||x.length<=_),k=typeof a=="function"?a(r):a;return d.useEffect(function(){O&&S.length>1&&w(function(L){return L.filter(function(I){return x.some(function(A){var N=A.key;return I===N})})})},[S,x,O]),d.useEffect(function(){var L;if(O&&g.current[(L=x[x.length-1])===null||L===void 0?void 0:L.key]){var I;C(g.current[(I=x[x.length-1])===null||I===void 0?void 0:I.key])}},[x,O]),ce.createElement(Wj,V({key:r,className:we(i,"".concat(i,"-").concat(r),h==null?void 0:h.list,o,ie(ie({},"".concat(i,"-stack"),!!O),"".concat(i,"-stack-expanded"),D)),style:s,keys:x,motionAppear:!0},k,{onAllRemoved:function(){l(r)}}),function(L,I){var A=L.config,N=L.className,B=L.style,z=L.index,j=A,W=j.key,G=j.times,K=String(W),q=A,X=q.className,Q=q.style,te=q.classNames,ne=q.styles,Z=on(q,OIt),ee=x.findIndex(function(De){return De.key===K}),J={};if(O){var oe=x.length-1-(ee>-1?ee:z-1),le=r==="top"||r==="bottom"?"-50%":"0";if(oe>0){var ge,he,ye;J.height=D?(ge=g.current[K])===null||ge===void 0?void 0:ge.offsetHeight:v==null?void 0:v.offsetHeight;for(var ue=0,ve=0;ve-1?g.current[K]=Be:delete g.current[K]},prefixCls:i,classNames:te,styles:ne,className:we(X,h==null?void 0:h.notice),style:Q,times:G,key:W,eventKey:W,onNoticeClose:c,hovering:O&&S.length>0})))})},IIt=d.forwardRef(function(e,t){var n=e.prefixCls,r=n===void 0?"rc-notification":n,i=e.container,o=e.motion,s=e.maxCount,a=e.className,l=e.style,c=e.onAllRemoved,u=e.stack,f=e.renderNotifications,h=d.useState([]),g=Ce(h,2),p=g[0],m=g[1],v=function(O){var T,M=p.find(function(_){return _.key===O});M==null||(T=M.onClose)===null||T===void 0||T.call(M),m(function(_){return _.filter(function(F){return F.key!==O})})};d.useImperativeHandle(t,function(){return{open:function(O){m(function(T){var M=ut(T),_=M.findIndex(function(k){return k.key===O.key}),F=se({},O);if(_>=0){var D;F.times=(((D=T[_])===null||D===void 0?void 0:D.times)||0)+1,M[_]=F}else F.times=0,M.push(F);return s>0&&M.length>s&&(M=M.slice(-s)),M})},close:function(O){v(O)},destroy:function(){m([])}}});var C=d.useState({}),y=Ce(C,2),b=y[0],S=y[1];d.useEffect(function(){var R={};p.forEach(function(O){var T=O.placement,M=T===void 0?"topRight":T;M&&(R[M]=R[M]||[],R[M].push(O))}),Object.keys(b).forEach(function(O){R[O]=R[O]||[]}),S(R)},[p]);var w=function(O){S(function(T){var M=se({},T),_=M[O]||[];return _.length||delete M[O],M})},x=d.useRef(!1);if(d.useEffect(function(){Object.keys(b).length>0?x.current=!0:x.current&&(c==null||c(),x.current=!1)},[b]),!i)return null;var E=Object.keys(b);return fo.createPortal(d.createElement(d.Fragment,null,E.map(function(R){var O=b[R],T=d.createElement(TIt,{key:R,configList:O,placement:R,prefixCls:r,className:a==null?void 0:a(R),style:l==null?void 0:l(R),motion:o,onNoticeClose:v,onAllNoticeRemoved:w,stack:u});return f?f(T,{prefixCls:r,key:R}):T})),i)}),MIt=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved","stack","renderNotifications"],PIt=function(){return document.body},RSe=0;function _It(){for(var e={},t=arguments.length,n=new Array(t),r=0;r0&&arguments[0]!==void 0?arguments[0]:{},t=e.getContainer,n=t===void 0?PIt:t,r=e.motion,i=e.prefixCls,o=e.maxCount,s=e.className,a=e.style,l=e.onAllRemoved,c=e.stack,u=e.renderNotifications,f=on(e,MIt),h=d.useState(),g=Ce(h,2),p=g[0],m=g[1],v=d.useRef(),C=d.createElement(IIt,{container:p,ref:v,prefixCls:i,motion:r,maxCount:o,className:s,style:a,onAllRemoved:l,stack:c,renderNotifications:u}),y=d.useState([]),b=Ce(y,2),S=b[0],w=b[1],x=d.useMemo(function(){return{open:function(R){var O=_It(f,R);(O.key===null||O.key===void 0)&&(O.key="rc-notification-".concat(RSe),RSe+=1),w(function(T){return[].concat(ut(T),[{type:"open",config:O}])})},close:function(R){w(function(O){return[].concat(ut(O),[{type:"close",key:R}])})},destroy:function(){w(function(R){return[].concat(ut(R),[{type:"destroy"}])})}}},[]);return d.useEffect(function(){m(n())}),d.useEffect(function(){v.current&&S.length&&(S.forEach(function(E){switch(E.type){case"open":v.current.open(E.config);break;case"close":v.current.close(E.key);break;case"destroy":v.current.destroy();break}}),w(function(E){return E.filter(function(R){return!S.includes(R)})}))},[S]),[x,C]}const AIt=Object.freeze(Object.defineProperty({__proto__:null,Notice:Xge,NotificationProvider:Qge,useNotification:Zge},Symbol.toStringTag,{value:"Module"}));var DIt={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},LIt=function(t,n){return d.createElement(Y,V({},t,{ref:n,icon:DIt}))},Tm=d.forwardRef(LIt);const Uj=ce.createContext(void 0),h2=100,FIt=10,Jge=h2*FIt,IGe={Modal:h2,Drawer:h2,Popover:h2,Popconfirm:h2,Tooltip:h2,Tour:h2,FloatButton:h2},NIt={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1};function kIt(e){return e in IGe}const y3=(e,t)=>{const[,n]=za(),r=ce.useContext(Uj),i=kIt(e);let o;if(t!==void 0)o=[t,t];else{let s=r??0;i?s+=(r?0:n.zIndexPopupBase)+IGe[e]:s+=NIt[e],o=[r===void 0?t:s,s]}return o},zIt=e=>{const{componentCls:t,iconCls:n,boxShadow:r,colorText:i,colorSuccess:o,colorError:s,colorWarning:a,colorInfo:l,fontSizeLG:c,motionEaseInOutCirc:u,motionDurationSlow:f,marginXS:h,paddingXS:g,borderRadiusLG:p,zIndexPopup:m,contentPadding:v,contentBg:C}=e,y=`${t}-notice`,b=new Pr("MessageMoveIn",{"0%":{padding:0,transform:"translateY(-100%)",opacity:0},"100%":{padding:g,transform:"translateY(0)",opacity:1}}),S=new Pr("MessageMoveOut",{"0%":{maxHeight:e.height,padding:g,opacity:1},"100%":{maxHeight:0,padding:0,opacity:0}}),w={padding:g,textAlign:"center",[`${t}-custom-content`]:{display:"flex",alignItems:"center"},[`${t}-custom-content > ${n}`]:{marginInlineEnd:h,fontSize:c},[`${y}-content`]:{display:"inline-block",padding:v,background:C,borderRadius:p,boxShadow:r,pointerEvents:"all"},[`${t}-success > ${n}`]:{color:o},[`${t}-error > ${n}`]:{color:s},[`${t}-warning > ${n}`]:{color:a},[`${t}-info > ${n}, + ${t}-loading > ${n}`]:{color:l}};return[{[t]:Object.assign(Object.assign({},ii(e)),{color:i,position:"fixed",top:h,width:"100%",pointerEvents:"none",zIndex:m,[`${t}-move-up`]:{animationFillMode:"forwards"},[` + ${t}-move-up-appear, + ${t}-move-up-enter + `]:{animationName:b,animationDuration:f,animationPlayState:"paused",animationTimingFunction:u},[` + ${t}-move-up-appear${t}-move-up-appear-active, + ${t}-move-up-enter${t}-move-up-enter-active + `]:{animationPlayState:"running"},[`${t}-move-up-leave`]:{animationName:S,animationDuration:f,animationPlayState:"paused",animationTimingFunction:u},[`${t}-move-up-leave${t}-move-up-leave-active`]:{animationPlayState:"running"},"&-rtl":{direction:"rtl",span:{direction:"rtl"}}})},{[t]:{[`${y}-wrapper`]:Object.assign({},w)}},{[`${t}-notice-pure-panel`]:Object.assign(Object.assign({},w),{padding:0,textAlign:"start"})}]},BIt=e=>({zIndexPopup:e.zIndexPopupBase+Jge+10,contentBg:e.colorBgElevated,contentPadding:`${(e.controlHeightLG-e.fontSize*e.lineHeight)/2}px ${e.paddingSM}px`}),MGe=Yr("Message",e=>{const t=yr(e,{height:150});return[zIt(t)]},BIt);var HIt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i{let{prefixCls:t,type:n,icon:r,children:i}=e;return d.createElement("div",{className:we(`${t}-custom-content`,`${t}-${n}`)},r||jIt[n],d.createElement("span",null,i))},VIt=e=>{const{prefixCls:t,className:n,type:r,icon:i,content:o}=e,s=HIt(e,["prefixCls","className","type","icon","content"]),{getPrefixCls:a}=d.useContext(vn),l=t||a("message"),c=Oo(l),[u,f,h]=MGe(l,c);return u(d.createElement(Xge,Object.assign({},s,{prefixCls:l,className:we(n,f,`${l}-notice-pure-panel`,h,c),eventKey:"pure",duration:null,content:d.createElement(PGe,{prefixCls:l,type:r,icon:i},o)})))};function GIt(e,t){return{motionName:t??`${e}-move-up`}}function epe(e){let t;const n=new Promise(i=>{t=e(()=>{i(!0)})}),r=()=>{t==null||t()};return r.then=(i,o)=>n.then(i,o),r.promise=n,r}var WIt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i{let{children:t,prefixCls:n}=e;const r=Oo(n),[i,o,s]=MGe(n,r);return i(d.createElement(Qge,{classNames:{list:we(o,s,r)}},t))},YIt=(e,t)=>{let{prefixCls:n,key:r}=t;return d.createElement(KIt,{prefixCls:n,key:r},e)},XIt=d.forwardRef((e,t)=>{const{top:n,prefixCls:r,getContainer:i,maxCount:o,duration:s=qIt,rtl:a,transitionName:l,onAllRemoved:c}=e,{getPrefixCls:u,getPopupContainer:f,message:h,direction:g}=d.useContext(vn),p=r||u("message"),m=()=>({left:"50%",transform:"translateX(-50%)",top:n??UIt}),v=()=>we({[`${p}-rtl`]:a??g==="rtl"}),C=()=>GIt(p,l),y=d.createElement("span",{className:`${p}-close-x`},d.createElement(Ug,{className:`${p}-close-icon`})),[b,S]=Zge({prefixCls:p,style:m,className:v,motion:C,closable:!1,closeIcon:y,duration:s,getContainer:()=>(i==null?void 0:i())||(f==null?void 0:f())||document.body,maxCount:o,onAllRemoved:c,renderNotifications:YIt});return d.useImperativeHandle(t,()=>Object.assign(Object.assign({},b),{prefixCls:p,message:h})),S});let $Se=0;function _Ge(e){const t=d.useRef(null);return _y(),[d.useMemo(()=>{const r=l=>{var c;(c=t.current)===null||c===void 0||c.close(l)},i=l=>{if(!t.current){const x=()=>{};return x.then=()=>{},x}const{open:c,prefixCls:u,message:f}=t.current,h=`${u}-notice`,{content:g,icon:p,type:m,key:v,className:C,style:y,onClose:b}=l,S=WIt(l,["content","icon","type","key","className","style","onClose"]);let w=v;return w==null&&($Se+=1,w=`antd-message-${$Se}`),epe(x=>(c(Object.assign(Object.assign({},S),{key:w,content:d.createElement(PGe,{prefixCls:u,type:m,icon:p},g),placement:"top",className:we(m&&`${h}-${m}`,C,f==null?void 0:f.className),style:Object.assign(Object.assign({},f==null?void 0:f.style),y),onClose:()=>{b==null||b(),x()}})),()=>{r(w)}))},s={open:i,destroy:l=>{var c;l!==void 0?r(l):(c=t.current)===null||c===void 0||c.destroy()}};return["info","success","warning","error","loading"].forEach(l=>{const c=(u,f,h)=>{let g;u&&typeof u=="object"&&"content"in u?g=u:g={content:u};let p,m;typeof f=="function"?m=f:(p=f,m=h);const v=Object.assign(Object.assign({onClose:m,duration:p},g),{type:l});return i(v)};s[l]=c}),s},[]),d.createElement(XIt,Object.assign({key:"message-holder"},e,{ref:t}))]}function AGe(e){return _Ge(e)}function QIt(){const[e,t]=d.useState([]),n=d.useCallback(r=>(t(i=>[].concat(ut(i),[r])),()=>{t(i=>i.filter(o=>o!==r))}),[]);return[e,n]}function mo(){mo=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(L,I,A){L[I]=A.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(L,I,A){return Object.defineProperty(L,I,{value:A,enumerable:!0,configurable:!0,writable:!0}),L[I]}try{c({},"")}catch{c=function(A,N,B){return A[N]=B}}function u(L,I,A,N){var B=I&&I.prototype instanceof C?I:C,z=Object.create(B.prototype),j=new D(N||[]);return i(z,"_invoke",{value:T(L,A,j)}),z}function f(L,I,A){try{return{type:"normal",arg:L.call(I,A)}}catch(N){return{type:"throw",arg:N}}}t.wrap=u;var h="suspendedStart",g="suspendedYield",p="executing",m="completed",v={};function C(){}function y(){}function b(){}var S={};c(S,s,function(){return this});var w=Object.getPrototypeOf,x=w&&w(w(k([])));x&&x!==n&&r.call(x,s)&&(S=x);var E=b.prototype=C.prototype=Object.create(S);function R(L){["next","throw","return"].forEach(function(I){c(L,I,function(A){return this._invoke(I,A)})})}function O(L,I){function A(B,z,j,W){var G=f(L[B],L,z);if(G.type!=="throw"){var K=G.arg,q=K.value;return q&&nn(q)=="object"&&r.call(q,"__await")?I.resolve(q.__await).then(function(X){A("next",X,j,W)},function(X){A("throw",X,j,W)}):I.resolve(q).then(function(X){K.value=X,j(K)},function(X){return A("throw",X,j,W)})}W(G.arg)}var N;i(this,"_invoke",{value:function(z,j){function W(){return new I(function(G,K){A(z,j,G,K)})}return N=N?N.then(W,W):W()}})}function T(L,I,A){var N=h;return function(B,z){if(N===p)throw Error("Generator is already running");if(N===m){if(B==="throw")throw z;return{value:e,done:!0}}for(A.method=B,A.arg=z;;){var j=A.delegate;if(j){var W=M(j,A);if(W){if(W===v)continue;return W}}if(A.method==="next")A.sent=A._sent=A.arg;else if(A.method==="throw"){if(N===h)throw N=m,A.arg;A.dispatchException(A.arg)}else A.method==="return"&&A.abrupt("return",A.arg);N=p;var G=f(L,I,A);if(G.type==="normal"){if(N=A.done?m:g,G.arg===v)continue;return{value:G.arg,done:A.done}}G.type==="throw"&&(N=m,A.method="throw",A.arg=G.arg)}}}function M(L,I){var A=I.method,N=L.iterator[A];if(N===e)return I.delegate=null,A==="throw"&&L.iterator.return&&(I.method="return",I.arg=e,M(L,I),I.method==="throw")||A!=="return"&&(I.method="throw",I.arg=new TypeError("The iterator does not provide a '"+A+"' method")),v;var B=f(N,L.iterator,I.arg);if(B.type==="throw")return I.method="throw",I.arg=B.arg,I.delegate=null,v;var z=B.arg;return z?z.done?(I[L.resultName]=z.value,I.next=L.nextLoc,I.method!=="return"&&(I.method="next",I.arg=e),I.delegate=null,v):z:(I.method="throw",I.arg=new TypeError("iterator result is not an object"),I.delegate=null,v)}function _(L){var I={tryLoc:L[0]};1 in L&&(I.catchLoc=L[1]),2 in L&&(I.finallyLoc=L[2],I.afterLoc=L[3]),this.tryEntries.push(I)}function F(L){var I=L.completion||{};I.type="normal",delete I.arg,L.completion=I}function D(L){this.tryEntries=[{tryLoc:"root"}],L.forEach(_,this),this.reset(!0)}function k(L){if(L||L===""){var I=L[s];if(I)return I.call(L);if(typeof L.next=="function")return L;if(!isNaN(L.length)){var A=-1,N=function B(){for(;++A=0;--B){var z=this.tryEntries[B],j=z.completion;if(z.tryLoc==="root")return N("end");if(z.tryLoc<=this.prev){var W=r.call(z,"catchLoc"),G=r.call(z,"finallyLoc");if(W&&G){if(this.prev=0;--N){var B=this.tryEntries[N];if(B.tryLoc<=this.prev&&r.call(B,"finallyLoc")&&this.prev=0;--A){var N=this.tryEntries[A];if(N.finallyLoc===I)return this.complete(N.completion,N.afterLoc),F(N),v}},catch:function(I){for(var A=this.tryEntries.length-1;A>=0;--A){var N=this.tryEntries[A];if(N.tryLoc===I){var B=N.completion;if(B.type==="throw"){var z=B.arg;F(N)}return z}}throw Error("illegal catch attempt")},delegateYield:function(I,A,N){return this.delegate={iterator:k(I),resultName:A,nextLoc:N},this.method==="next"&&(this.arg=e),v}},t}function OSe(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(c){return void n(c)}a.done?t(l):Promise.resolve(l).then(r,i)}function rd(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(l){OSe(o,r,i,s,a,"next",l)}function a(l){OSe(o,r,i,s,a,"throw",l)}s(void 0)})}}var XI=se({},Lze),ZIt=XI.version,Aee=XI.render,JIt=XI.unmountComponentAtNode,qj;try{var eMt=Number((ZIt||"").split(".")[0]);eMt>=18&&(qj=XI.createRoot)}catch{}function TSe(e){var t=XI.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t&&nn(t)==="object"&&(t.usingClientEntryPoint=e)}var Wz="__rc_react_root__";function tMt(e,t){TSe(!0);var n=t[Wz]||qj(t);TSe(!1),n.render(e),t[Wz]=n}function nMt(e,t){Aee==null||Aee(e,t)}function rMt(e,t){if(qj){tMt(e,t);return}nMt(e,t)}function iMt(e){return Fae.apply(this,arguments)}function Fae(){return Fae=rd(mo().mark(function e(t){return mo().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Promise.resolve().then(function(){var i;(i=t[Wz])===null||i===void 0||i.unmount(),delete t[Wz]}));case 1:case"end":return r.stop()}},e)})),Fae.apply(this,arguments)}function oMt(e){JIt(e)}function sMt(e){return Nae.apply(this,arguments)}function Nae(){return Nae=rd(mo().mark(function e(t){return mo().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(qj===void 0){r.next=2;break}return r.abrupt("return",iMt(t));case 2:oMt(t);case 3:case"end":return r.stop()}},e)})),Nae.apply(this,arguments)}const aMt=(e,t)=>(rMt(e,t),()=>sMt(t));let lMt=aMt;function tpe(){return lMt}const Dee=()=>({height:0,opacity:0}),ISe=e=>{const{scrollHeight:t}=e;return{height:t,opacity:1}},cMt=e=>({height:e?e.offsetHeight:0}),Lee=(e,t)=>(t==null?void 0:t.deadline)===!0||t.propertyName==="height",TT=function(){return{motionName:`${arguments.length>0&&arguments[0]!==void 0?arguments[0]:OT}-motion-collapse`,onAppearStart:Dee,onEnterStart:Dee,onAppearActive:ISe,onEnterActive:ISe,onLeaveStart:cMt,onLeaveActive:Dee,onAppearEnd:Lee,onEnterEnd:Lee,onLeaveEnd:Lee,motionDeadline:500}},Cu=(e,t,n)=>n!==void 0?n:`${e}-${t}`,Gx=function(e){if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox(),n=t.width,r=t.height;if(n||r)return!0}if(e.getBoundingClientRect){var i=e.getBoundingClientRect(),o=i.width,s=i.height;if(o||s)return!0}}return!1},uMt=e=>{const{componentCls:t,colorPrimary:n}=e;return{[t]:{position:"absolute",background:"transparent",pointerEvents:"none",boxSizing:"border-box",color:`var(--wave-color, ${n})`,boxShadow:"0 0 0 0 currentcolor",opacity:.2,"&.wave-motion-appear":{transition:[`box-shadow 0.4s ${e.motionEaseOutCirc}`,`opacity 2s ${e.motionEaseOutCirc}`].join(","),"&-active":{boxShadow:"0 0 0 6px currentcolor",opacity:0},"&.wave-quick":{transition:[`box-shadow ${e.motionDurationSlow} ${e.motionEaseInOut}`,`opacity ${e.motionDurationSlow} ${e.motionEaseInOut}`].join(",")}}}}},dMt=cTt("Wave",e=>[uMt(e)]),Kj=`${OT}-wave-target`;function Fee(e){return e&&e!=="#fff"&&e!=="#ffffff"&&e!=="rgb(255, 255, 255)"&&e!=="rgba(255, 255, 255, 1)"&&!/rgba\((?:\d*, ){3}0\)/.test(e)&&e!=="transparent"}function fMt(e){const{borderTopColor:t,borderColor:n,backgroundColor:r}=getComputedStyle(e);return Fee(t)?t:Fee(n)?n:Fee(r)?r:null}function Nee(e){return Number.isNaN(e)?0:e}const hMt=e=>{const{className:t,target:n,component:r,registerUnmount:i}=e,o=d.useRef(null),s=d.useRef(null);d.useEffect(()=>{s.current=i()},[]);const[a,l]=d.useState(null),[c,u]=d.useState([]),[f,h]=d.useState(0),[g,p]=d.useState(0),[m,v]=d.useState(0),[C,y]=d.useState(0),[b,S]=d.useState(!1),w={left:f,top:g,width:m,height:C,borderRadius:c.map(R=>`${R}px`).join(" ")};a&&(w["--wave-color"]=a);function x(){const R=getComputedStyle(n);l(fMt(n));const O=R.position==="static",{borderLeftWidth:T,borderTopWidth:M}=R;h(O?n.offsetLeft:Nee(-parseFloat(T))),p(O?n.offsetTop:Nee(-parseFloat(M))),v(n.offsetWidth),y(n.offsetHeight);const{borderTopLeftRadius:_,borderTopRightRadius:F,borderBottomLeftRadius:D,borderBottomRightRadius:k}=R;u([_,F,k,D].map(L=>Nee(parseFloat(L))))}if(d.useEffect(()=>{if(n){const R=Rr(()=>{x(),S(!0)});let O;return typeof ResizeObserver<"u"&&(O=new ResizeObserver(x),O.observe(n)),()=>{Rr.cancel(R),O==null||O.disconnect()}}},[]),!b)return null;const E=(r==="Checkbox"||r==="Radio")&&(n==null?void 0:n.classList.contains(Kj));return d.createElement(Hs,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(R,O)=>{var T,M;if(O.deadline||O.propertyName==="opacity"){const _=(T=o.current)===null||T===void 0?void 0:T.parentElement;(M=s.current)===null||M===void 0||M.call(s).then(()=>{_==null||_.remove()})}return!1}},(R,O)=>{let{className:T}=R;return d.createElement("div",{ref:Ws(o,O),className:we(t,T,{"wave-quick":E}),style:w})})},gMt=(e,t)=>{var n;const{component:r}=t;if(r==="Checkbox"&&!(!((n=e.querySelector("input"))===null||n===void 0)&&n.checked))return;const i=document.createElement("div");i.style.position="absolute",i.style.left="0px",i.style.top="0px",e==null||e.insertBefore(i,e==null?void 0:e.firstChild);const o=tpe();let s=null;function a(){return s}s=o(d.createElement(hMt,Object.assign({},t,{target:e,registerUnmount:a})),i)},pMt=(e,t,n)=>{const{wave:r}=d.useContext(vn),[,i,o]=za(),s=Hn(c=>{const u=e.current;if(r!=null&&r.disabled||!u)return;const f=u.querySelector(`.${Kj}`)||u,{showEffect:h}=r||{};(h||gMt)(f,{className:t,token:i,component:n,event:c,hashId:o})}),a=d.useRef(null);return c=>{Rr.cancel(a.current),a.current=Rr(()=>{s(c)})}},QI=e=>{const{children:t,disabled:n,component:r}=e,{getPrefixCls:i}=d.useContext(vn),o=d.useRef(null),s=i("wave"),[,a]=dMt(s),l=pMt(o,we(s,a),r);if(ce.useEffect(()=>{const u=o.current;if(!u||u.nodeType!==1||n)return;const f=h=>{!Gx(h.target)||!u.getAttribute||u.getAttribute("disabled")||u.disabled||u.className.includes("disabled")||u.className.includes("-leave")||l(h)};return u.addEventListener("click",f,!0),()=>{u.removeEventListener("click",f,!0)}},[n]),!ce.isValidElement(t))return t??null;const c=Cd(t)?Ws(v3(t),o):o;return js(t,{ref:c})},fl=e=>{const t=ce.useContext(LC);return ce.useMemo(()=>e?typeof e=="string"?e??t:e instanceof Function?e(t):t:t,[e,t])},mMt=e=>{const{componentCls:t}=e;return{[t]:{"&-block":{display:"flex",width:"100%"},"&-vertical":{flexDirection:"column"}}}},vMt=e=>{const{componentCls:t,antCls:n}=e;return{[t]:{display:"inline-flex","&-rtl":{direction:"rtl"},"&-vertical":{flexDirection:"column"},"&-align":{flexDirection:"column","&-center":{alignItems:"center"},"&-start":{alignItems:"flex-start"},"&-end":{alignItems:"flex-end"},"&-baseline":{alignItems:"baseline"}},[`${t}-item:empty`]:{display:"none"},[`${t}-item > ${n}-badge-not-a-wrapper:only-child`]:{display:"block"}}}},CMt=e=>{const{componentCls:t}=e;return{[t]:{"&-gap-row-small":{rowGap:e.spaceGapSmallSize},"&-gap-row-middle":{rowGap:e.spaceGapMiddleSize},"&-gap-row-large":{rowGap:e.spaceGapLargeSize},"&-gap-col-small":{columnGap:e.spaceGapSmallSize},"&-gap-col-middle":{columnGap:e.spaceGapMiddleSize},"&-gap-col-large":{columnGap:e.spaceGapLargeSize}}}},DGe=Yr("Space",e=>{const t=yr(e,{spaceGapSmallSize:e.paddingXS,spaceGapMiddleSize:e.padding,spaceGapLargeSize:e.paddingLG});return[vMt(t),CMt(t),mMt(t)]},()=>({}),{resetStyle:!1});var LGe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i{const n=d.useContext(Yj),r=d.useMemo(()=>{if(!n)return"";const{compactDirection:i,isFirstItem:o,isLastItem:s}=n,a=i==="vertical"?"-vertical-":"-";return we(`${e}-compact${a}item`,{[`${e}-compact${a}first-item`]:o,[`${e}-compact${a}last-item`]:s,[`${e}-compact${a}item-rtl`]:t==="rtl"})},[e,t,n]);return{compactSize:n==null?void 0:n.compactSize,compactDirection:n==null?void 0:n.compactDirection,compactItemClassnames:r}},yMt=e=>{let{children:t}=e;return d.createElement(Yj.Provider,{value:null},t)},bMt=e=>{var{children:t}=e,n=LGe(e,["children"]);return d.createElement(Yj.Provider,{value:n},t)},SMt=e=>{const{getPrefixCls:t,direction:n}=d.useContext(vn),{size:r,direction:i,block:o,prefixCls:s,className:a,rootClassName:l,children:c}=e,u=LGe(e,["size","direction","block","prefixCls","className","rootClassName","children"]),f=fl(b=>r??b),h=t("space-compact",s),[g,p]=DGe(h),m=we(h,p,{[`${h}-rtl`]:n==="rtl",[`${h}-block`]:o,[`${h}-vertical`]:i==="vertical"},a,l),v=d.useContext(Yj),C=Rs(c),y=d.useMemo(()=>C.map((b,S)=>{const w=(b==null?void 0:b.key)||`${h}-item-${S}`;return d.createElement(bMt,{key:w,compactSize:f,compactDirection:i,isFirstItem:S===0&&(!v||(v==null?void 0:v.isFirstItem)),isLastItem:S===C.length-1&&(!v||(v==null?void 0:v.isLastItem))},b)}),[r,C,v]);return C.length===0?null:g(d.createElement("div",Object.assign({className:m},u),y))};var wMt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i{const{getPrefixCls:t,direction:n}=d.useContext(vn),{prefixCls:r,size:i,className:o}=e,s=wMt(e,["prefixCls","size","className"]),a=t("btn-group",r),[,,l]=za();let c="";switch(i){case"large":c="lg";break;case"small":c="sm";break}const u=we(a,{[`${a}-${c}`]:c,[`${a}-rtl`]:n==="rtl"},o,l);return d.createElement(FGe.Provider,{value:i},d.createElement("div",Object.assign({},s,{className:u})))},MSe=/^[\u4E00-\u9FA5]{2}$/,kae=MSe.test.bind(MSe);function NGe(e){return e==="danger"?{danger:!0}:{type:e}}function PSe(e){return typeof e=="string"}function kee(e){return e==="text"||e==="link"}function EMt(e,t){if(e==null)return;const n=t?" ":"";return typeof e!="string"&&typeof e!="number"&&PSe(e.type)&&kae(e.props.children)?js(e,{children:e.props.children.split("").join(n)}):PSe(e)?kae(e)?ce.createElement("span",null,e.split("").join(n)):ce.createElement("span",null,e):EGe(e)?ce.createElement("span",null,e):e}function RMt(e,t){let n=!1;const r=[];return ce.Children.forEach(e,i=>{const o=typeof i,s=o==="string"||o==="number";if(n&&s){const a=r.length-1,l=r[a];r[a]=`${l}${i}`}else r.push(i);n=s}),ce.Children.map(r,i=>EMt(i,t))}["default","primary","danger"].concat(ut(NC));const zae=d.forwardRef((e,t)=>{const{className:n,style:r,children:i,prefixCls:o}=e,s=we(`${o}-icon`,n);return ce.createElement("span",{ref:t,className:s,style:r},i)}),_Se=d.forwardRef((e,t)=>{const{prefixCls:n,className:r,style:i,iconClassName:o}=e,s=we(`${n}-loading-icon`,r);return ce.createElement(zae,{prefixCls:n,className:s,style:i,ref:t},ce.createElement(Tm,{className:o}))}),zee=()=>({width:0,opacity:0,transform:"scale(0)"}),Bee=e=>({width:e.scrollWidth,opacity:1,transform:"scale(1)"}),$Mt=e=>{const{prefixCls:t,loading:n,existIcon:r,className:i,style:o,mount:s}=e,a=!!n;return r?ce.createElement(_Se,{prefixCls:t,className:i,style:o}):ce.createElement(Hs,{visible:a,motionName:`${t}-loading-icon-motion`,motionAppear:!s,motionEnter:!s,motionLeave:!s,removeOnLeave:!0,onAppearStart:zee,onAppearActive:Bee,onEnterStart:zee,onEnterActive:Bee,onLeaveStart:Bee,onLeaveActive:zee},(l,c)=>{let{className:u,style:f}=l;const h=Object.assign(Object.assign({},o),f);return ce.createElement(_Se,{prefixCls:t,className:we(i,u),style:h,ref:c})})},ASe=(e,t)=>({[`> span, > ${e}`]:{"&:not(:last-child)":{[`&, & > ${e}`]:{"&:not(:disabled)":{borderInlineEndColor:t}}},"&:not(:first-child)":{[`&, & > ${e}`]:{"&:not(:disabled)":{borderInlineStartColor:t}}}}}),OMt=e=>{const{componentCls:t,fontSize:n,lineWidth:r,groupBorderColor:i,colorErrorHover:o}=e;return{[`${t}-group`]:[{position:"relative",display:"inline-flex",[`> span, > ${t}`]:{"&:not(:last-child)":{[`&, & > ${t}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:e.calc(r).mul(-1).equal(),[`&, & > ${t}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[t]:{position:"relative",zIndex:1,"&:hover, &:focus, &:active":{zIndex:2},"&[disabled]":{zIndex:0}},[`${t}-icon-only`]:{fontSize:n}},ASe(`${t}-primary`,i),ASe(`${t}-danger`,o)]}};var TMt=["b"],IMt=["v"],Hee=function(t){return Math.round(Number(t||0))},MMt=function(t){if(t instanceof kr)return t;if(t&&nn(t)==="object"&&"h"in t&&"b"in t){var n=t,r=n.b,i=on(n,TMt);return se(se({},i),{},{v:r})}return typeof t=="string"&&/hsb/.test(t)?t.replace(/hsb/,"hsv"):t},Im=function(e){hs(n,e);var t=wc(n);function n(r){return qr(this,n),t.call(this,MMt(r))}return Kr(n,[{key:"toHsbString",value:function(){var i=this.toHsb(),o=Hee(i.s*100),s=Hee(i.b*100),a=Hee(i.h),l=i.a,c="hsb(".concat(a,", ").concat(o,"%, ").concat(s,"%)"),u="hsba(".concat(a,", ").concat(o,"%, ").concat(s,"%, ").concat(l.toFixed(l===0?0:2),")");return l===1?c:u}},{key:"toHsb",value:function(){var i=this.toHsv(),o=i.v,s=on(i,IMt);return se(se({},s),{},{b:o,a:this.a})}}]),n}(kr),PMt="rc-color-picker",KS=function(t){return t instanceof Im?t:new Im(t)},_Mt=KS("#1677ff"),kGe=function(t){var n=t.offset,r=t.targetRef,i=t.containerRef,o=t.color,s=t.type,a=i.current.getBoundingClientRect(),l=a.width,c=a.height,u=r.current.getBoundingClientRect(),f=u.width,h=u.height,g=f/2,p=h/2,m=(n.x+g)/l,v=1-(n.y+p)/c,C=o.toHsb(),y=m,b=(n.x+g)/l*360;if(s)switch(s){case"hue":return KS(se(se({},C),{},{h:b<=0?0:b}));case"alpha":return KS(se(se({},C),{},{a:y<=0?0:y}))}return KS({h:C.h,s:m<=0?0:m,b:v>=1?1:v,a:C.a})},zGe=function(t,n){var r=t.toHsb();switch(n){case"hue":return{x:r.h/360*100,y:50};case"alpha":return{x:t.a*100,y:50};default:return{x:r.s*100,y:(1-r.b)*100}}},BGe=function(t){var n=t.color,r=t.prefixCls,i=t.className,o=t.style,s=t.onClick,a="".concat(r,"-color-block");return ce.createElement("div",{className:we(a,i),style:o,onClick:s},ce.createElement("div",{className:"".concat(a,"-inner"),style:{background:n}}))};function AMt(e){var t="touches"in e?e.touches[0]:e,n=document.documentElement.scrollLeft||document.body.scrollLeft||window.pageXOffset,r=document.documentElement.scrollTop||document.body.scrollTop||window.pageYOffset;return{pageX:t.pageX-n,pageY:t.pageY-r}}function HGe(e){var t=e.targetRef,n=e.containerRef,r=e.direction,i=e.onDragChange,o=e.onDragChangeComplete,s=e.calculate,a=e.color,l=e.disabledDrag,c=d.useState({x:0,y:0}),u=Ce(c,2),f=u[0],h=u[1],g=d.useRef(null),p=d.useRef(null);d.useEffect(function(){h(s())},[a]),d.useEffect(function(){return function(){document.removeEventListener("mousemove",g.current),document.removeEventListener("mouseup",p.current),document.removeEventListener("touchmove",g.current),document.removeEventListener("touchend",p.current),g.current=null,p.current=null}},[]);var m=function(S){var w=AMt(S),x=w.pageX,E=w.pageY,R=n.current.getBoundingClientRect(),O=R.x,T=R.y,M=R.width,_=R.height,F=t.current.getBoundingClientRect(),D=F.width,k=F.height,L=D/2,I=k/2,A=Math.max(0,Math.min(x-O,M))-L,N=Math.max(0,Math.min(E-T,_))-I,B={x:A,y:r==="x"?f.y:N};if(D===0&&k===0||D!==k)return!1;i==null||i(B)},v=function(S){S.preventDefault(),m(S)},C=function(S){S.preventDefault(),document.removeEventListener("mousemove",g.current),document.removeEventListener("mouseup",p.current),document.removeEventListener("touchmove",g.current),document.removeEventListener("touchend",p.current),g.current=null,p.current=null,o==null||o()},y=function(S){document.removeEventListener("mousemove",g.current),document.removeEventListener("mouseup",p.current),!l&&(m(S),document.addEventListener("mousemove",v),document.addEventListener("mouseup",C),document.addEventListener("touchmove",v),document.addEventListener("touchend",C),g.current=v,p.current=C)};return[f,y]}var jGe=function(t){var n=t.size,r=n===void 0?"default":n,i=t.color,o=t.prefixCls;return ce.createElement("div",{className:we("".concat(o,"-handler"),ie({},"".concat(o,"-handler-sm"),r==="small")),style:{backgroundColor:i}})},VGe=function(t){var n=t.children,r=t.style,i=t.prefixCls;return ce.createElement("div",{className:"".concat(i,"-palette"),style:se({position:"relative"},r)},n)},GGe=d.forwardRef(function(e,t){var n=e.children,r=e.x,i=e.y;return ce.createElement("div",{ref:t,style:{position:"absolute",left:"".concat(r,"%"),top:"".concat(i,"%"),zIndex:1,transform:"translate(-50%, -50%)"}},n)}),DMt=function(t){var n=t.color,r=t.onChange,i=t.prefixCls,o=t.onChangeComplete,s=t.disabled,a=d.useRef(),l=d.useRef(),c=d.useRef(n),u=Hn(function(m){var v=kGe({offset:m,targetRef:l,containerRef:a,color:n});c.current=v,r(v)}),f=HGe({color:n,containerRef:a,targetRef:l,calculate:function(){return zGe(n)},onDragChange:u,onDragChangeComplete:function(){return o==null?void 0:o(c.current)},disabledDrag:s}),h=Ce(f,2),g=h[0],p=h[1];return ce.createElement("div",{ref:a,className:"".concat(i,"-select"),onMouseDown:p,onTouchStart:p},ce.createElement(VGe,{prefixCls:i},ce.createElement(GGe,{x:g.x,y:g.y,ref:l},ce.createElement(jGe,{color:n.toRgbString(),prefixCls:i})),ce.createElement("div",{className:"".concat(i,"-saturation"),style:{backgroundColor:"hsl(".concat(n.toHsb().h,",100%, 50%)"),backgroundImage:"linear-gradient(0deg, #000, transparent),linear-gradient(90deg, #fff, hsla(0, 0%, 100%, 0))"}})))},LMt=function(t,n){var r=ir(t,{value:n}),i=Ce(r,2),o=i[0],s=i[1],a=d.useMemo(function(){return KS(o)},[o]);return[a,s]},FMt=function(t){var n=t.colors,r=t.children,i=t.direction,o=i===void 0?"to right":i,s=t.type,a=t.prefixCls,l=d.useMemo(function(){return n.map(function(c,u){var f=KS(c);return s==="alpha"&&u===n.length-1&&(f=new Im(f.setA(1))),f.toRgbString()}).join(",")},[n,s]);return ce.createElement("div",{className:"".concat(a,"-gradient"),style:{position:"absolute",inset:0,background:"linear-gradient(".concat(o,", ").concat(l,")")}},r)},NMt=function(t){var n=t.prefixCls,r=t.colors,i=t.disabled,o=t.onChange,s=t.onChangeComplete,a=t.color,l=t.type,c=d.useRef(),u=d.useRef(),f=d.useRef(a),h=function(w){return l==="hue"?w.getHue():w.a*100},g=Hn(function(S){var w=kGe({offset:S,targetRef:u,containerRef:c,color:a,type:l});f.current=w,o(h(w))}),p=HGe({color:a,targetRef:u,containerRef:c,calculate:function(){return zGe(a,l)},onDragChange:g,onDragChangeComplete:function(){s(h(f.current))},direction:"x",disabledDrag:i}),m=Ce(p,2),v=m[0],C=m[1],y=ce.useMemo(function(){if(l==="hue"){var S=a.toHsb();S.s=1,S.b=1,S.a=1;var w=new Im(S);return w}return a},[a,l]),b=ce.useMemo(function(){return r.map(function(S){return"".concat(S.color," ").concat(S.percent,"%")})},[r]);return ce.createElement("div",{ref:c,className:we("".concat(n,"-slider"),"".concat(n,"-slider-").concat(l)),onMouseDown:C,onTouchStart:C},ce.createElement(VGe,{prefixCls:n},ce.createElement(GGe,{x:v.x,y:v.y,ref:u},ce.createElement(jGe,{size:"small",color:y.toHexString(),prefixCls:n})),ce.createElement(FMt,{colors:b,type:l,prefixCls:n})))};function kMt(e){return d.useMemo(function(){var t=e||{},n=t.slider;return[n||NMt]},[e])}var zMt=[{color:"rgb(255, 0, 0)",percent:0},{color:"rgb(255, 255, 0)",percent:17},{color:"rgb(0, 255, 0)",percent:33},{color:"rgb(0, 255, 255)",percent:50},{color:"rgb(0, 0, 255)",percent:67},{color:"rgb(255, 0, 255)",percent:83},{color:"rgb(255, 0, 0)",percent:100}],BMt=d.forwardRef(function(e,t){var n=e.value,r=e.defaultValue,i=e.prefixCls,o=i===void 0?PMt:i,s=e.onChange,a=e.onChangeComplete,l=e.className,c=e.style,u=e.panelRender,f=e.disabledAlpha,h=f===void 0?!1:f,g=e.disabled,p=g===void 0?!1:g,m=e.components,v=kMt(m),C=Ce(v,1),y=C[0],b=LMt(r||_Mt,n),S=Ce(b,2),w=S[0],x=S[1],E=d.useMemo(function(){return w.setA(1).toRgbString()},[w]),R=function(N,B){n||x(N),s==null||s(N,B)},O=function(N){return new Im(w.setHue(N))},T=function(N){return new Im(w.setA(N/100))},M=function(N){R(O(N),{type:"hue",value:N})},_=function(N){R(T(N),{type:"alpha",value:N})},F=function(N){a&&a(O(N))},D=function(N){a&&a(T(N))},k=we("".concat(o,"-panel"),l,ie({},"".concat(o,"-panel-disabled"),p)),L={prefixCls:o,disabled:p,color:w},I=ce.createElement(ce.Fragment,null,ce.createElement(DMt,V({onChange:R},L,{onChangeComplete:a})),ce.createElement("div",{className:"".concat(o,"-slider-container")},ce.createElement("div",{className:we("".concat(o,"-slider-group"),ie({},"".concat(o,"-slider-group-disabled-alpha"),h))},ce.createElement(y,V({},L,{type:"hue",colors:zMt,min:0,max:359,value:w.getHue(),onChange:M,onChangeComplete:F})),!h&&ce.createElement(y,V({},L,{type:"alpha",colors:[{percent:0,color:"rgba(255, 0, 4, 0)"},{percent:100,color:E}],min:0,max:100,value:w.a*100,onChange:_,onChangeComplete:D}))),ce.createElement(BGe,{color:w.toRgbString(),prefixCls:o})));return ce.createElement("div",{className:k,style:c,ref:t},typeof u=="function"?u(I):I)});const HMt=Object.freeze(Object.defineProperty({__proto__:null,Color:Im,ColorBlock:BGe,default:BMt},Symbol.toStringTag,{value:"Module"})),jMt=(e,t)=>(e==null?void 0:e.replace(/[^\w/]/g,"").slice(0,t?8:6))||"",VMt=(e,t)=>e?jMt(e,t):"";let GMt=function(){function e(t){qr(this,e);var n;if(this.cleared=!1,t instanceof e){this.metaColor=t.metaColor.clone(),this.colors=(n=t.colors)===null||n===void 0?void 0:n.map(i=>({color:new e(i.color),percent:i.percent})),this.cleared=t.cleared;return}const r=Array.isArray(t);r&&t.length?(this.colors=t.map(i=>{let{color:o,percent:s}=i;return{color:new e(o),percent:s}}),this.metaColor=new Im(this.colors[0].color.metaColor)):this.metaColor=new Im(r?"":t),(!t||r&&!this.colors)&&(this.metaColor=this.metaColor.setA(0),this.cleared=!0)}return Kr(e,[{key:"toHsb",value:function(){return this.metaColor.toHsb()}},{key:"toHsbString",value:function(){return this.metaColor.toHsbString()}},{key:"toHex",value:function(){return VMt(this.toHexString(),this.metaColor.a<1)}},{key:"toHexString",value:function(){return this.metaColor.toHexString()}},{key:"toRgb",value:function(){return this.metaColor.toRgb()}},{key:"toRgbString",value:function(){return this.metaColor.toRgbString()}},{key:"isGradient",value:function(){return!!this.colors&&!this.cleared}},{key:"getColors",value:function(){return this.colors||[{color:this,percent:0}]}},{key:"toCssString",value:function(){const{colors:n}=this;return n?`linear-gradient(90deg, ${n.map(i=>`${i.color.toRgbString()} ${i.percent}%`).join(", ")})`:this.metaColor.toRgbString()}},{key:"equals",value:function(n){return!n||this.isGradient()!==n.isGradient()?!1:this.isGradient()?this.colors.length===n.colors.length&&this.colors.every((r,i)=>{const o=n.colors[i];return r.percent===o.percent&&r.color.equals(o.color)}):this.toHexString()===n.toHexString()}}])}();var WMt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},UMt=function(t,n){return d.createElement(Y,V({},t,{ref:n,icon:WMt}))},Xf=d.forwardRef(UMt),WGe=ce.forwardRef(function(e,t){var n=e.prefixCls,r=e.forceRender,i=e.className,o=e.style,s=e.children,a=e.isActive,l=e.role,c=e.classNames,u=e.styles,f=ce.useState(a||r),h=Ce(f,2),g=h[0],p=h[1];return ce.useEffect(function(){(r||a)&&p(!0)},[r,a]),g?ce.createElement("div",{ref:t,className:we("".concat(n,"-content"),ie(ie({},"".concat(n,"-content-active"),a),"".concat(n,"-content-inactive"),!a),i),style:o,role:l},ce.createElement("div",{className:we("".concat(n,"-content-box"),c==null?void 0:c.body),style:u==null?void 0:u.body},s)):null});WGe.displayName="PanelContent";var qMt=["showArrow","headerClass","isActive","onItemClick","forceRender","className","classNames","styles","prefixCls","collapsible","accordion","panelKey","extra","header","expandIcon","openMotion","destroyInactivePanel","children"],UGe=ce.forwardRef(function(e,t){var n=e.showArrow,r=n===void 0?!0:n,i=e.headerClass,o=e.isActive,s=e.onItemClick,a=e.forceRender,l=e.className,c=e.classNames,u=c===void 0?{}:c,f=e.styles,h=f===void 0?{}:f,g=e.prefixCls,p=e.collapsible,m=e.accordion,v=e.panelKey,C=e.extra,y=e.header,b=e.expandIcon,S=e.openMotion,w=e.destroyInactivePanel,x=e.children,E=on(e,qMt),R=p==="disabled",O=C!=null&&typeof C!="boolean",T=ie(ie(ie({onClick:function(){s==null||s(v)},onKeyDown:function(I){(I.key==="Enter"||I.keyCode===lt.ENTER||I.which===lt.ENTER)&&(s==null||s(v))},role:m?"tab":"button"},"aria-expanded",o),"aria-disabled",R),"tabIndex",R?-1:0),M=typeof b=="function"?b(e):ce.createElement("i",{className:"arrow"}),_=M&&ce.createElement("div",V({className:"".concat(g,"-expand-icon")},["header","icon"].includes(p)?T:{}),M),F=we("".concat(g,"-item"),ie(ie({},"".concat(g,"-item-active"),o),"".concat(g,"-item-disabled"),R),l),D=we(i,"".concat(g,"-header"),ie({},"".concat(g,"-collapsible-").concat(p),!!p),u.header),k=se({className:D,style:h.header},["header","icon"].includes(p)?{}:T);return ce.createElement("div",V({},E,{ref:t,className:F}),ce.createElement("div",k,r&&_,ce.createElement("span",V({className:"".concat(g,"-header-text")},p==="header"?T:{}),y),O&&ce.createElement("div",{className:"".concat(g,"-extra")},C)),ce.createElement(Hs,V({visible:o,leavedClassName:"".concat(g,"-content-hidden")},S,{forceRender:a,removeOnLeave:w}),function(L,I){var A=L.className,N=L.style;return ce.createElement(WGe,{ref:I,prefixCls:g,className:A,classNames:u,style:N,styles:h,isActive:o,forceRender:a,role:m?"tabpanel":void 0},x)}))}),KMt=["children","label","key","collapsible","onItemClick","destroyInactivePanel"],YMt=function(t,n){var r=n.prefixCls,i=n.accordion,o=n.collapsible,s=n.destroyInactivePanel,a=n.onItemClick,l=n.activeKey,c=n.openMotion,u=n.expandIcon;return t.map(function(f,h){var g=f.children,p=f.label,m=f.key,v=f.collapsible,C=f.onItemClick,y=f.destroyInactivePanel,b=on(f,KMt),S=String(m??h),w=v??o,x=y??s,E=function(T){w!=="disabled"&&(a(T),C==null||C(T))},R=!1;return i?R=l[0]===S:R=l.indexOf(S)>-1,ce.createElement(UGe,V({},b,{prefixCls:r,key:S,panelKey:S,isActive:R,accordion:i,openMotion:c,expandIcon:u,header:p,collapsible:w,onItemClick:E,destroyInactivePanel:x}),g)})},XMt=function(t,n,r){if(!t)return null;var i=r.prefixCls,o=r.accordion,s=r.collapsible,a=r.destroyInactivePanel,l=r.onItemClick,c=r.activeKey,u=r.openMotion,f=r.expandIcon,h=t.key||String(n),g=t.props,p=g.header,m=g.headerClass,v=g.destroyInactivePanel,C=g.collapsible,y=g.onItemClick,b=!1;o?b=c[0]===h:b=c.indexOf(h)>-1;var S=C??s,w=function(R){S!=="disabled"&&(l(R),y==null||y(R))},x={key:h,panelKey:h,header:p,headerClass:m,isActive:b,prefixCls:i,destroyInactivePanel:v??a,openMotion:u,accordion:o,children:t.props.children,onItemClick:w,expandIcon:f,collapsible:S};return typeof t.type=="string"?t:(Object.keys(x).forEach(function(E){typeof x[E]>"u"&&delete x[E]}),ce.cloneElement(t,x))};function QMt(e,t,n){return Array.isArray(e)?YMt(e,n):Rs(t).map(function(r,i){return XMt(r,i,n)})}function ZMt(e){var t=e;if(!Array.isArray(t)){var n=nn(t);t=n==="number"||n==="string"?[t]:[]}return t.map(function(r){return String(r)})}var JMt=ce.forwardRef(function(e,t){var n=e.prefixCls,r=n===void 0?"rc-collapse":n,i=e.destroyInactivePanel,o=i===void 0?!1:i,s=e.style,a=e.accordion,l=e.className,c=e.children,u=e.collapsible,f=e.openMotion,h=e.expandIcon,g=e.activeKey,p=e.defaultActiveKey,m=e.onChange,v=e.items,C=we(r,l),y=ir([],{value:g,onChange:function(O){return m==null?void 0:m(O)},defaultValue:p,postState:ZMt}),b=Ce(y,2),S=b[0],w=b[1],x=function(O){return w(function(){if(a)return S[0]===O?[]:[O];var T=S.indexOf(O),M=T>-1;return M?S.filter(function(_){return _!==O}):[].concat(ut(S),[O])})};ui(!c,"[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");var E=QMt(v,c,{prefixCls:r,accordion:a,openMotion:f,expandIcon:h,collapsible:u,destroyInactivePanel:o,onItemClick:x,activeKey:S});return ce.createElement("div",V({ref:t,className:C,style:s,role:a?"tablist":void 0},$o(e,{aria:!0,data:!0})),E)});const Xj=Object.assign(JMt,{Panel:UGe});var ePt=Xj.Panel;const tPt=Object.freeze(Object.defineProperty({__proto__:null,Panel:ePt,default:Xj},Symbol.toStringTag,{value:"Module"})),nPt=d.forwardRef((e,t)=>{const{getPrefixCls:n}=d.useContext(vn),{prefixCls:r,className:i,showArrow:o=!0}=e,s=n("collapse",r),a=we({[`${s}-no-arrow`]:!o},i);return d.createElement(Xj.Panel,Object.assign({ref:t},e,{prefixCls:s,className:a}))}),ZI=e=>({[e.componentCls]:{[`${e.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${e.motionDurationMid} ${e.motionEaseInOut}, + opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}},[`${e.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${e.motionDurationMid} ${e.motionEaseInOut}, + opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}}}),rPt=e=>({animationDuration:e,animationFillMode:"both"}),iPt=e=>({animationDuration:e,animationFillMode:"both"}),Qj=function(e,t,n,r){const o=(arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1)?"&":"";return{[` + ${o}${e}-enter, + ${o}${e}-appear + `]:Object.assign(Object.assign({},rPt(r)),{animationPlayState:"paused"}),[`${o}${e}-leave`]:Object.assign(Object.assign({},iPt(r)),{animationPlayState:"paused"}),[` + ${o}${e}-enter${e}-enter-active, + ${o}${e}-appear${e}-appear-active + `]:{animationName:t,animationPlayState:"running"},[`${o}${e}-leave${e}-leave-active`]:{animationName:n,animationPlayState:"running",pointerEvents:"none"}}},oPt=new Pr("antFadeIn",{"0%":{opacity:0},"100%":{opacity:1}}),sPt=new Pr("antFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),npe=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{antCls:n}=e,r=`${n}-fade`,i=t?"&":"";return[Qj(r,oPt,sPt,e.motionDurationMid,t),{[` + ${i}${r}-enter, + ${i}${r}-appear + `]:{opacity:0,animationTimingFunction:"linear"},[`${i}${r}-leave`]:{animationTimingFunction:"linear"}}]},aPt=new Pr("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),lPt=new Pr("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),cPt=new Pr("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),uPt=new Pr("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),dPt=new Pr("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),fPt=new Pr("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),hPt=new Pr("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),gPt=new Pr("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),pPt={"move-up":{inKeyframes:hPt,outKeyframes:gPt},"move-down":{inKeyframes:aPt,outKeyframes:lPt},"move-left":{inKeyframes:cPt,outKeyframes:uPt},"move-right":{inKeyframes:dPt,outKeyframes:fPt}},Uz=(e,t)=>{const{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:i,outKeyframes:o}=pPt[t];return[Qj(r,i,o,e.motionDurationMid),{[` + ${r}-enter, + ${r}-appear + `]:{opacity:0,animationTimingFunction:e.motionEaseOutCirc},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInOutCirc}}]},rpe=new Pr("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),ipe=new Pr("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),ope=new Pr("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),spe=new Pr("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),mPt=new Pr("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),vPt=new Pr("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),CPt=new Pr("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),yPt=new Pr("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),bPt={"slide-up":{inKeyframes:rpe,outKeyframes:ipe},"slide-down":{inKeyframes:ope,outKeyframes:spe},"slide-left":{inKeyframes:mPt,outKeyframes:vPt},"slide-right":{inKeyframes:CPt,outKeyframes:yPt}},Y4=(e,t)=>{const{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:i,outKeyframes:o}=bPt[t];return[Qj(r,i,o,e.motionDurationMid),{[` + ${r}-enter, + ${r}-appear + `]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:e.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInQuint}}]},ape=new Pr("antZoomIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),SPt=new Pr("antZoomOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),DSe=new Pr("antZoomBigIn",{"0%":{transform:"scale(0.8)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),LSe=new Pr("antZoomBigOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.8)",opacity:0}}),wPt=new Pr("antZoomUpIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 0%"}}),xPt=new Pr("antZoomUpOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 0%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0}}),EPt=new Pr("antZoomLeftIn",{"0%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"0% 50%"}}),RPt=new Pr("antZoomLeftOut",{"0%":{transform:"scale(1)",transformOrigin:"0% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0}}),$Pt=new Pr("antZoomRightIn",{"0%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"100% 50%"}}),OPt=new Pr("antZoomRightOut",{"0%":{transform:"scale(1)",transformOrigin:"100% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0}}),TPt=new Pr("antZoomDownIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 100%"}}),IPt=new Pr("antZoomDownOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 100%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0}}),MPt={zoom:{inKeyframes:ape,outKeyframes:SPt},"zoom-big":{inKeyframes:DSe,outKeyframes:LSe},"zoom-big-fast":{inKeyframes:DSe,outKeyframes:LSe},"zoom-left":{inKeyframes:EPt,outKeyframes:RPt},"zoom-right":{inKeyframes:$Pt,outKeyframes:OPt},"zoom-up":{inKeyframes:wPt,outKeyframes:xPt},"zoom-down":{inKeyframes:TPt,outKeyframes:IPt}},Wx=(e,t)=>{const{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:i,outKeyframes:o}=MPt[t];return[Qj(r,i,o,t==="zoom-big-fast"?e.motionDurationFast:e.motionDurationMid),{[` + ${r}-enter, + ${r}-appear + `]:{transform:"scale(0)",opacity:0,animationTimingFunction:e.motionEaseOutCirc,"&-prepare":{transform:"none"}},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInOutCirc}}]},PPt=e=>{const{componentCls:t,contentBg:n,padding:r,headerBg:i,headerPadding:o,collapseHeaderPaddingSM:s,collapseHeaderPaddingLG:a,collapsePanelBorderRadius:l,lineWidth:c,lineType:u,colorBorder:f,colorText:h,colorTextHeading:g,colorTextDisabled:p,fontSizeLG:m,lineHeight:v,lineHeightLG:C,marginSM:y,paddingSM:b,paddingLG:S,paddingXS:w,motionDurationSlow:x,fontSizeIcon:E,contentPadding:R,fontHeight:O,fontHeightLG:T}=e,M=`${Ne(c)} ${u} ${f}`;return{[t]:Object.assign(Object.assign({},ii(e)),{backgroundColor:i,border:M,borderRadius:l,"&-rtl":{direction:"rtl"},[`& > ${t}-item`]:{borderBottom:M,"&:first-child":{[` + &, + & > ${t}-header`]:{borderRadius:`${Ne(l)} ${Ne(l)} 0 0`}},"&:last-child":{[` + &, + & > ${t}-header`]:{borderRadius:`0 0 ${Ne(l)} ${Ne(l)}`}},[`> ${t}-header`]:Object.assign(Object.assign({position:"relative",display:"flex",flexWrap:"nowrap",alignItems:"flex-start",padding:o,color:g,lineHeight:v,cursor:"pointer",transition:`all ${x}, visibility 0s`},Yf(e)),{[`> ${t}-header-text`]:{flex:"auto"},[`${t}-expand-icon`]:{height:O,display:"flex",alignItems:"center",paddingInlineEnd:y},[`${t}-arrow`]:Object.assign(Object.assign({},C3()),{fontSize:E,transition:`transform ${x}`,svg:{transition:`transform ${x}`}}),[`${t}-header-text`]:{marginInlineEnd:"auto"}}),[`${t}-collapsible-header`]:{cursor:"default",[`${t}-header-text`]:{flex:"none",cursor:"pointer"}},[`${t}-collapsible-icon`]:{cursor:"unset",[`${t}-expand-icon`]:{cursor:"pointer"}}},[`${t}-content`]:{color:h,backgroundColor:n,borderTop:M,[`& > ${t}-content-box`]:{padding:R},"&-hidden":{display:"none"}},"&-small":{[`> ${t}-item`]:{[`> ${t}-header`]:{padding:s,paddingInlineStart:w,[`> ${t}-expand-icon`]:{marginInlineStart:e.calc(b).sub(w).equal()}},[`> ${t}-content > ${t}-content-box`]:{padding:b}}},"&-large":{[`> ${t}-item`]:{fontSize:m,lineHeight:C,[`> ${t}-header`]:{padding:a,paddingInlineStart:r,[`> ${t}-expand-icon`]:{height:T,marginInlineStart:e.calc(S).sub(r).equal()}},[`> ${t}-content > ${t}-content-box`]:{padding:S}}},[`${t}-item:last-child`]:{borderBottom:0,[`> ${t}-content`]:{borderRadius:`0 0 ${Ne(l)} ${Ne(l)}`}},[`& ${t}-item-disabled > ${t}-header`]:{"\n &,\n & > .arrow\n ":{color:p,cursor:"not-allowed"}},[`&${t}-icon-position-end`]:{[`& > ${t}-item`]:{[`> ${t}-header`]:{[`${t}-expand-icon`]:{order:1,paddingInlineEnd:0,paddingInlineStart:y}}}}})}},_Pt=e=>{const{componentCls:t}=e,n=`> ${t}-item > ${t}-header ${t}-arrow`;return{[`${t}-rtl`]:{[n]:{transform:"rotate(180deg)"}}}},APt=e=>{const{componentCls:t,headerBg:n,paddingXXS:r,colorBorder:i}=e;return{[`${t}-borderless`]:{backgroundColor:n,border:0,[`> ${t}-item`]:{borderBottom:`1px solid ${i}`},[` + > ${t}-item:last-child, + > ${t}-item:last-child ${t}-header + `]:{borderRadius:0},[`> ${t}-item:last-child`]:{borderBottom:0},[`> ${t}-item > ${t}-content`]:{backgroundColor:"transparent",borderTop:0},[`> ${t}-item > ${t}-content > ${t}-content-box`]:{paddingTop:r}}}},DPt=e=>{const{componentCls:t,paddingSM:n}=e;return{[`${t}-ghost`]:{backgroundColor:"transparent",border:0,[`> ${t}-item`]:{borderBottom:0,[`> ${t}-content`]:{backgroundColor:"transparent",border:0,[`> ${t}-content-box`]:{paddingBlock:n}}}}}},LPt=e=>({headerPadding:`${e.paddingSM}px ${e.padding}px`,headerBg:e.colorFillAlter,contentPadding:`${e.padding}px 16px`,contentBg:e.colorBgContainer}),FPt=Yr("Collapse",e=>{const t=yr(e,{collapseHeaderPaddingSM:`${Ne(e.paddingXS)} ${Ne(e.paddingSM)}`,collapseHeaderPaddingLG:`${Ne(e.padding)} ${Ne(e.paddingLG)}`,collapsePanelBorderRadius:e.borderRadiusLG});return[PPt(t),APt(t),DPt(t),_Pt(t),ZI(t)]},LPt),NPt=d.forwardRef((e,t)=>{const{getPrefixCls:n,direction:r,collapse:i}=d.useContext(vn),{prefixCls:o,className:s,rootClassName:a,style:l,bordered:c=!0,ghost:u,size:f,expandIconPosition:h="start",children:g,expandIcon:p}=e,m=fl(M=>{var _;return(_=f??M)!==null&&_!==void 0?_:"middle"}),v=n("collapse",o),C=n(),[y,b,S]=FPt(v),w=d.useMemo(()=>h==="left"?"start":h==="right"?"end":h,[h]),x=p??(i==null?void 0:i.expandIcon),E=d.useCallback(function(){let M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const _=typeof x=="function"?x(M):d.createElement(Xf,{rotate:M.isActive?90:void 0,"aria-label":M.isActive?"expanded":"collapsed"});return js(_,()=>{var F;return{className:we((F=_==null?void 0:_.props)===null||F===void 0?void 0:F.className,`${v}-arrow`)}})},[x,v]),R=we(`${v}-icon-position-${w}`,{[`${v}-borderless`]:!c,[`${v}-rtl`]:r==="rtl",[`${v}-ghost`]:!!u,[`${v}-${m}`]:m!=="middle"},i==null?void 0:i.className,s,a,b,S),O=Object.assign(Object.assign({},TT(C)),{motionAppear:!1,leavedClassName:`${v}-content-hidden`}),T=d.useMemo(()=>g?Rs(g).map((M,_)=>{var F,D;const k=M.props;if(k!=null&&k.disabled){const L=(F=M.key)!==null&&F!==void 0?F:String(_),I=Object.assign(Object.assign({},$i(M.props,["disabled"])),{key:L,collapsible:(D=k.collapsible)!==null&&D!==void 0?D:"disabled"});return js(M,I)}return M}):null,[g]);return y(d.createElement(Xj,Object.assign({ref:t,openMotion:O},$i(e,["rootClassName"]),{expandIcon:E,prefixCls:v,className:R,style:Object.assign(Object.assign({},i==null?void 0:i.style),l)}),T))}),FSe=Object.assign(NPt,{Panel:nPt}),kPt=(e,t)=>{const{r:n,g:r,b:i,a:o}=e.toRgb(),s=new Im(e.toRgbString()).onBackground(t).toHsv();return o<=.5?s.v>.5:n*.299+r*.587+i*.114>192},qGe=e=>{const{paddingInline:t,onlyIconSize:n}=e;return yr(e,{buttonPaddingHorizontal:t,buttonPaddingVertical:0,buttonIconOnlyFontSize:n})},KGe=e=>{var t,n,r,i,o,s;const a=(t=e.contentFontSize)!==null&&t!==void 0?t:e.fontSize,l=(n=e.contentFontSizeSM)!==null&&n!==void 0?n:e.fontSize,c=(r=e.contentFontSizeLG)!==null&&r!==void 0?r:e.fontSizeLG,u=(i=e.contentLineHeight)!==null&&i!==void 0?i:dN(a),f=(o=e.contentLineHeightSM)!==null&&o!==void 0?o:dN(l),h=(s=e.contentLineHeightLG)!==null&&s!==void 0?s:dN(c),g=kPt(new GMt(e.colorBgSolid),"#fff")?"#000":"#fff";return{fontWeight:400,defaultShadow:`0 ${e.controlOutlineWidth}px 0 ${e.controlTmpOutline}`,primaryShadow:`0 ${e.controlOutlineWidth}px 0 ${e.controlOutline}`,dangerShadow:`0 ${e.controlOutlineWidth}px 0 ${e.colorErrorOutline}`,primaryColor:e.colorTextLightSolid,dangerColor:e.colorTextLightSolid,borderColorDisabled:e.colorBorder,defaultGhostColor:e.colorBgContainer,ghostBg:"transparent",defaultGhostBorderColor:e.colorBgContainer,paddingInline:e.paddingContentHorizontal-e.lineWidth,paddingInlineLG:e.paddingContentHorizontal-e.lineWidth,paddingInlineSM:8-e.lineWidth,onlyIconSize:e.fontSizeLG,onlyIconSizeSM:e.fontSizeLG-2,onlyIconSizeLG:e.fontSizeLG+2,groupBorderColor:e.colorPrimaryHover,linkHoverBg:"transparent",textTextColor:e.colorText,textTextHoverColor:e.colorText,textTextActiveColor:e.colorText,textHoverBg:e.colorFillTertiary,defaultColor:e.colorText,defaultBg:e.colorBgContainer,defaultBorderColor:e.colorBorder,defaultBorderColorDisabled:e.colorBorder,defaultHoverBg:e.colorBgContainer,defaultHoverColor:e.colorPrimaryHover,defaultHoverBorderColor:e.colorPrimaryHover,defaultActiveBg:e.colorBgContainer,defaultActiveColor:e.colorPrimaryActive,defaultActiveBorderColor:e.colorPrimaryActive,solidTextColor:g,contentFontSize:a,contentFontSizeSM:l,contentFontSizeLG:c,contentLineHeight:u,contentLineHeightSM:f,contentLineHeightLG:h,paddingBlock:Math.max((e.controlHeight-a*u)/2-e.lineWidth,0),paddingBlockSM:Math.max((e.controlHeightSM-l*f)/2-e.lineWidth,0),paddingBlockLG:Math.max((e.controlHeightLG-c*h)/2-e.lineWidth,0)}},zPt=e=>{const{componentCls:t,iconCls:n,fontWeight:r,opacityLoading:i,motionDurationSlow:o,motionEaseInOut:s,marginXS:a,calc:l}=e;return{[t]:{outline:"none",position:"relative",display:"inline-flex",gap:e.marginXS,alignItems:"center",justifyContent:"center",fontWeight:r,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",background:"transparent",border:`${Ne(e.lineWidth)} ${e.lineType} transparent`,cursor:"pointer",transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,userSelect:"none",touchAction:"manipulation",color:e.colorText,"&:disabled > *":{pointerEvents:"none"},[`${t}-icon > svg`]:C3(),"> a":{color:"currentColor"},"&:not(:disabled)":Yf(e),[`&${t}-two-chinese-chars::first-letter`]:{letterSpacing:"0.34em"},[`&${t}-two-chinese-chars > *:not(${n})`]:{marginInlineEnd:"-0.34em",letterSpacing:"0.34em"},[`&${t}-icon-only`]:{paddingInline:0,[`&${t}-compact-item`]:{flex:"none"},[`&${t}-round`]:{width:"auto"}},[`&${t}-loading`]:{opacity:i,cursor:"default"},[`${t}-loading-icon`]:{transition:["width","opacity","margin"].map(c=>`${c} ${o} ${s}`).join(",")},[`&:not(${t}-icon-end)`]:{[`${t}-loading-icon-motion`]:{"&-appear-start, &-enter-start":{marginInlineEnd:l(a).mul(-1).equal()},"&-appear-active, &-enter-active":{marginInlineEnd:0},"&-leave-start":{marginInlineEnd:0},"&-leave-active":{marginInlineEnd:l(a).mul(-1).equal()}}},"&-icon-end":{flexDirection:"row-reverse",[`${t}-loading-icon-motion`]:{"&-appear-start, &-enter-start":{marginInlineStart:l(a).mul(-1).equal()},"&-appear-active, &-enter-active":{marginInlineStart:0},"&-leave-start":{marginInlineStart:0},"&-leave-active":{marginInlineStart:l(a).mul(-1).equal()}}}}}},YGe=(e,t,n)=>({[`&:not(:disabled):not(${e}-disabled)`]:{"&:hover":t,"&:active":n}}),BPt=e=>({minWidth:e.controlHeight,paddingInlineStart:0,paddingInlineEnd:0,borderRadius:"50%"}),HPt=e=>({borderRadius:e.controlHeight,paddingInlineStart:e.calc(e.controlHeight).div(2).equal(),paddingInlineEnd:e.calc(e.controlHeight).div(2).equal()}),jPt=e=>({cursor:"not-allowed",borderColor:e.borderColorDisabled,color:e.colorTextDisabled,background:e.colorBgContainerDisabled,boxShadow:"none"}),lpe=(e,t,n,r,i,o,s,a)=>({[`&${e}-background-ghost`]:Object.assign(Object.assign({color:n||void 0,background:t,borderColor:r||void 0,boxShadow:"none"},YGe(e,Object.assign({background:t},s),Object.assign({background:t},a))),{"&:disabled":{cursor:"not-allowed",color:i||void 0,borderColor:o||void 0}})}),VPt=e=>({[`&:disabled, &${e.componentCls}-disabled`]:Object.assign({},jPt(e))}),GPt=e=>({[`&:disabled, &${e.componentCls}-disabled`]:{cursor:"not-allowed",color:e.colorTextDisabled}}),Zj=(e,t,n,r)=>{const o=r&&["link","text"].includes(r)?GPt:VPt;return Object.assign(Object.assign({},o(e)),YGe(e.componentCls,t,n))},Jj=(e,t,n,r,i)=>({[`&${e.componentCls}-variant-solid`]:Object.assign({color:t,background:n},Zj(e,r,i))}),eV=(e,t,n,r,i)=>({[`&${e.componentCls}-variant-outlined, &${e.componentCls}-variant-dashed`]:Object.assign({borderColor:t,background:n},Zj(e,r,i))}),tV=e=>({[`&${e.componentCls}-variant-dashed`]:{borderStyle:"dashed"}}),nV=(e,t,n,r)=>({[`&${e.componentCls}-variant-filled`]:Object.assign({boxShadow:"none",background:t},Zj(e,n,r))}),X4=(e,t,n,r,i)=>({[`&${e.componentCls}-variant-${n}`]:Object.assign({color:t,boxShadow:"none"},Zj(e,r,i,n))}),WPt=e=>{const{componentCls:t}=e;return NC.reduce((n,r)=>{const i=e[`${r}6`],o=e[`${r}1`],s=e[`${r}5`],a=e[`${r}2`],l=e[`${r}3`],c=e[`${r}7`],u=`0 ${e.controlOutlineWidth} 0 ${e[`${r}1`]}`;return Object.assign(Object.assign({},n),{[`&${t}-color-${r}`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:i,boxShadow:u},Jj(e,e.colorTextLightSolid,i,{background:s},{background:c})),eV(e,i,e.colorBgContainer,{color:s,borderColor:s,background:e.colorBgContainer},{color:c,borderColor:c,background:e.colorBgContainer})),tV(e)),nV(e,o,{background:a},{background:l})),X4(e,i,"link",{color:s},{color:c})),X4(e,i,"text",{color:s,background:o},{color:c,background:l}))})},{})},UPt=e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.defaultColor,boxShadow:e.defaultShadow},Jj(e,e.solidTextColor,e.colorBgSolid,{color:e.solidTextColor,background:e.colorBgSolidHover},{color:e.solidTextColor,background:e.colorBgSolidActive})),tV(e)),nV(e,e.colorFillTertiary,{background:e.colorFillSecondary},{background:e.colorFill})),X4(e,e.textTextColor,"link",{color:e.colorLinkHover,background:e.linkHoverBg},{color:e.colorLinkActive})),lpe(e.componentCls,e.ghostBg,e.defaultGhostColor,e.defaultGhostBorderColor,e.colorTextDisabled,e.colorBorder)),qPt=e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.colorPrimary,boxShadow:e.primaryShadow},eV(e,e.colorPrimary,e.colorBgContainer,{color:e.colorPrimaryTextHover,borderColor:e.colorPrimaryHover,background:e.colorBgContainer},{color:e.colorPrimaryTextActive,borderColor:e.colorPrimaryActive,background:e.colorBgContainer})),tV(e)),nV(e,e.colorPrimaryBg,{background:e.colorPrimaryBgHover},{background:e.colorPrimaryBorder})),X4(e,e.colorLink,"text",{color:e.colorPrimaryTextHover,background:e.colorPrimaryBg},{color:e.colorPrimaryTextActive,background:e.colorPrimaryBorder})),lpe(e.componentCls,e.ghostBg,e.colorPrimary,e.colorPrimary,e.colorTextDisabled,e.colorBorder,{color:e.colorPrimaryHover,borderColor:e.colorPrimaryHover},{color:e.colorPrimaryActive,borderColor:e.colorPrimaryActive})),KPt=e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.colorError,boxShadow:e.dangerShadow},Jj(e,e.dangerColor,e.colorError,{background:e.colorErrorHover},{background:e.colorErrorActive})),eV(e,e.colorError,e.colorBgContainer,{color:e.colorErrorHover,borderColor:e.colorErrorBorderHover},{color:e.colorErrorActive,borderColor:e.colorErrorActive})),tV(e)),nV(e,e.colorErrorBg,{background:e.colorErrorBgFilledHover},{background:e.colorErrorBgActive})),X4(e,e.colorError,"text",{color:e.colorErrorHover,background:e.colorErrorBg},{color:e.colorErrorHover,background:e.colorErrorBgActive})),X4(e,e.colorError,"link",{color:e.colorErrorHover},{color:e.colorErrorActive})),lpe(e.componentCls,e.ghostBg,e.colorError,e.colorError,e.colorTextDisabled,e.colorBorder,{color:e.colorErrorHover,borderColor:e.colorErrorHover},{color:e.colorErrorActive,borderColor:e.colorErrorActive})),YPt=e=>{const{componentCls:t}=e;return Object.assign({[`${t}-color-default`]:UPt(e),[`${t}-color-primary`]:qPt(e),[`${t}-color-dangerous`]:KPt(e)},WPt(e))},XPt=e=>Object.assign(Object.assign(Object.assign(Object.assign({},eV(e,e.defaultBorderColor,e.defaultBg,{color:e.defaultHoverColor,borderColor:e.defaultHoverBorderColor,background:e.defaultHoverBg},{color:e.defaultActiveColor,borderColor:e.defaultActiveBorderColor,background:e.defaultActiveBg})),X4(e,e.textTextColor,"text",{color:e.textTextHoverColor,background:e.textHoverBg},{color:e.textTextActiveColor,background:e.colorBgTextActive})),Jj(e,e.primaryColor,e.colorPrimary,{background:e.colorPrimaryHover,color:e.primaryColor},{background:e.colorPrimaryActive,color:e.primaryColor})),X4(e,e.colorLink,"link",{color:e.colorLinkHover,background:e.linkHoverBg},{color:e.colorLinkActive})),cpe=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const{componentCls:n,controlHeight:r,fontSize:i,borderRadius:o,buttonPaddingHorizontal:s,iconCls:a,buttonPaddingVertical:l,buttonIconOnlyFontSize:c}=e;return[{[t]:{fontSize:i,height:r,padding:`${Ne(l)} ${Ne(s)}`,borderRadius:o,[`&${n}-icon-only`]:{width:r,[a]:{fontSize:c,verticalAlign:"calc(-0.125em - 1px)"}}}},{[`${n}${n}-circle${t}`]:BPt(e)},{[`${n}${n}-round${t}`]:HPt(e)}]},QPt=e=>{const t=yr(e,{fontSize:e.contentFontSize});return cpe(t,e.componentCls)},ZPt=e=>{const t=yr(e,{controlHeight:e.controlHeightSM,fontSize:e.contentFontSizeSM,padding:e.paddingXS,buttonPaddingHorizontal:e.paddingInlineSM,buttonPaddingVertical:0,borderRadius:e.borderRadiusSM,buttonIconOnlyFontSize:e.onlyIconSizeSM});return cpe(t,`${e.componentCls}-sm`)},JPt=e=>{const t=yr(e,{controlHeight:e.controlHeightLG,fontSize:e.contentFontSizeLG,buttonPaddingHorizontal:e.paddingInlineLG,buttonPaddingVertical:0,borderRadius:e.borderRadiusLG,buttonIconOnlyFontSize:e.onlyIconSizeLG});return cpe(t,`${e.componentCls}-lg`)},e_t=e=>{const{componentCls:t}=e;return{[t]:{[`&${t}-block`]:{width:"100%"}}}},t_t=Yr("Button",e=>{const t=qGe(e);return[zPt(t),QPt(t),ZPt(t),JPt(t),e_t(t),YPt(t),XPt(t),OMt(t)]},KGe,{unitless:{fontWeight:!0,contentLineHeight:!0,contentLineHeightSM:!0,contentLineHeightLG:!0}});function n_t(e,t,n){const{focusElCls:r,focus:i,borderElCls:o}=n,s=o?"> *":"",a=["hover",i?"focus":null,"active"].filter(Boolean).map(l=>`&:${l} ${s}`).join(",");return{[`&-item:not(${t}-last-item)`]:{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal()},"&-item":Object.assign(Object.assign({[a]:{zIndex:2}},r?{[`&${r}`]:{zIndex:2}}:{}),{[`&[disabled] ${s}`]:{zIndex:0}})}}function r_t(e,t,n){const{borderElCls:r}=n,i=r?`> ${r}`:"";return{[`&-item:not(${t}-first-item):not(${t}-last-item) ${i}`]:{borderRadius:0},[`&-item:not(${t}-last-item)${t}-first-item`]:{[`& ${i}, &${e}-sm ${i}, &${e}-lg ${i}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${t}-first-item)${t}-last-item`]:{[`& ${i}, &${e}-sm ${i}, &${e}-lg ${i}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function rV(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{focus:!0};const{componentCls:n}=e,r=`${n}-compact`;return{[r]:Object.assign(Object.assign({},n_t(e,r,t)),r_t(n,r,t))}}function i_t(e,t){return{[`&-item:not(${t}-last-item)`]:{marginBottom:e.calc(e.lineWidth).mul(-1).equal()},"&-item":{"&:hover,&:focus,&:active":{zIndex:2},"&[disabled]":{zIndex:0}}}}function o_t(e,t){return{[`&-item:not(${t}-first-item):not(${t}-last-item)`]:{borderRadius:0},[`&-item${t}-first-item:not(${t}-last-item)`]:{[`&, &${e}-sm, &${e}-lg`]:{borderEndEndRadius:0,borderEndStartRadius:0}},[`&-item${t}-last-item:not(${t}-first-item)`]:{[`&, &${e}-sm, &${e}-lg`]:{borderStartStartRadius:0,borderStartEndRadius:0}}}}function s_t(e){const t=`${e.componentCls}-compact-vertical`;return{[t]:Object.assign(Object.assign({},i_t(e,t)),o_t(e.componentCls,t))}}const a_t=e=>{const{componentCls:t,colorPrimaryHover:n,lineWidth:r,calc:i}=e,o=i(r).mul(-1).equal(),s=a=>({[`${t}-compact${a?"-vertical":""}-item${t}-primary:not([disabled])`]:{"& + &::before":{position:"absolute",top:a?o:0,insetInlineStart:a?0:o,backgroundColor:n,content:'""',width:a?"100%":r,height:a?r:"100%"}}});return Object.assign(Object.assign({},s()),s(!0))},l_t=Hx(["Button","compact"],e=>{const t=qGe(e);return[rV(t),s_t(t),a_t(t)]},KGe);var c_t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i{var n,r,i,o;const{loading:s=!1,prefixCls:a,color:l,variant:c,type:u,danger:f=!1,shape:h="default",size:g,styles:p,disabled:m,className:v,rootClassName:C,children:y,icon:b,iconPosition:S="start",ghost:w=!1,block:x=!1,htmlType:E="button",classNames:R,style:O={},autoInsertSpace:T,autoFocus:M}=e,_=c_t(e,["loading","prefixCls","color","variant","type","danger","shape","size","styles","disabled","className","rootClassName","children","icon","iconPosition","ghost","block","htmlType","classNames","style","autoInsertSpace","autoFocus"]),F=u||"default",[D,k]=d.useMemo(()=>{if(l&&c)return[l,c];const ze=d_t[F]||[];return f?["danger",ze[1]]:ze},[u,l,c,f]),I=D==="danger"?"dangerous":D,{getPrefixCls:A,direction:N,button:B}=d.useContext(vn),z=(n=T??(B==null?void 0:B.autoInsertSpace))!==null&&n!==void 0?n:!0,j=A("btn",a),[W,G,K]=t_t(j),q=d.useContext(yc),X=m??q,Q=d.useContext(FGe),te=d.useMemo(()=>u_t(s),[s]),[ne,Z]=d.useState(te.loading),[ee,J]=d.useState(!1),oe=d.useRef(null),le=Od(t,oe),ge=d.Children.count(y)===1&&!b&&!kee(k),he=d.useRef(!0);ce.useEffect(()=>(he.current=!1,()=>{he.current=!0}),[]),d.useEffect(()=>{let ze=null;te.delay>0?ze=setTimeout(()=>{ze=null,Z(!0)},te.delay):Z(te.loading);function Re(){ze&&(clearTimeout(ze),ze=null)}return Re},[te]),d.useEffect(()=>{if(!oe.current||!z)return;const ze=oe.current.textContent||"";ge&&kae(ze)?ee||J(!0):ee&&J(!1)}),d.useEffect(()=>{M&&oe.current&&oe.current.focus()},[]);const ye=ce.useCallback(ze=>{var Re;if(ne||X){ze.preventDefault();return}(Re=e.onClick)===null||Re===void 0||Re.call(e,ze)},[e.onClick,ne,X]),{compactSize:ue,compactItemClassnames:ve}=Dy(j,N),de={large:"lg",small:"sm",middle:void 0},xe=fl(ze=>{var Re,Le;return(Le=(Re=g??ue)!==null&&Re!==void 0?Re:Q)!==null&&Le!==void 0?Le:ze}),Ee=xe&&(r=de[xe])!==null&&r!==void 0?r:"",De=ne?"loading":b,Be=$i(_,["navigate"]),Ge=we(j,G,K,{[`${j}-${h}`]:h!=="default"&&h,[`${j}-${F}`]:F,[`${j}-dangerous`]:f,[`${j}-color-${I}`]:I,[`${j}-variant-${k}`]:k,[`${j}-${Ee}`]:Ee,[`${j}-icon-only`]:!y&&y!==0&&!!De,[`${j}-background-ghost`]:w&&!kee(k),[`${j}-loading`]:ne,[`${j}-two-chinese-chars`]:ee&&z&&!ne,[`${j}-block`]:x,[`${j}-rtl`]:N==="rtl",[`${j}-icon-end`]:S==="end"},ve,v,C,B==null?void 0:B.className),Ue=Object.assign(Object.assign({},B==null?void 0:B.style),O),We=we(R==null?void 0:R.icon,(i=B==null?void 0:B.classNames)===null||i===void 0?void 0:i.icon),Ve=Object.assign(Object.assign({},(p==null?void 0:p.icon)||{}),((o=B==null?void 0:B.styles)===null||o===void 0?void 0:o.icon)||{}),Fe=b&&!ne?ce.createElement(zae,{prefixCls:j,className:We,style:Ve},b):typeof s=="object"&&s.icon?ce.createElement(zae,{prefixCls:j,className:We,style:Ve},s.icon):ce.createElement($Mt,{existIcon:!!b,prefixCls:j,loading:ne,mount:he.current}),ke=y||y===0?RMt(y,ge&&z):null;if(Be.href!==void 0)return W(ce.createElement("a",Object.assign({},Be,{className:we(Ge,{[`${j}-disabled`]:X}),href:X?void 0:Be.href,style:Ue,onClick:ye,ref:le,tabIndex:X?-1:0}),Fe,ke));let Ye=ce.createElement("button",Object.assign({},_,{type:E,className:Ge,style:Ue,onClick:ye,disabled:X,ref:le}),Fe,ke,ve&&ce.createElement(l_t,{prefixCls:j}));return kee(k)||(Ye=ce.createElement(QI,{component:"Button",disabled:ne},Ye)),W(Ye)}),Cr=f_t;Cr.Group=xMt;Cr.__ANT_BUTTON=!0;function jee(e){return!!(e!=null&&e.then)}const XGe=e=>{const{type:t,children:n,prefixCls:r,buttonProps:i,close:o,autoFocus:s,emitEvent:a,isSilent:l,quitOnNullishReturnValue:c,actionFn:u}=e,f=d.useRef(!1),h=d.useRef(null),[g,p]=FC(!1),m=function(){o==null||o.apply(void 0,arguments)};d.useEffect(()=>{let y=null;return s&&(y=setTimeout(()=>{var b;(b=h.current)===null||b===void 0||b.focus({preventScroll:!0})})),()=>{y&&clearTimeout(y)}},[]);const v=y=>{jee(y)&&(p(!0),y.then(function(){p(!1,!0),m.apply(void 0,arguments),f.current=!1},b=>{if(p(!1,!0),f.current=!1,!(l!=null&&l()))return Promise.reject(b)}))},C=y=>{if(f.current)return;if(f.current=!0,!u){m();return}let b;if(a){if(b=u(y),c&&!jee(b)){f.current=!1,m(y);return}}else if(u.length)b=u(o),f.current=!1;else if(b=u(),!jee(b)){m();return}v(b)};return d.createElement(Cr,Object.assign({},NGe(t),{onClick:C,loading:g,prefixCls:r},i,{ref:h}),n)},JI=ce.createContext({}),{Provider:QGe}=JI,NSe=()=>{const{autoFocusButton:e,cancelButtonProps:t,cancelTextLocale:n,isSilent:r,mergedOkCancel:i,rootPrefixCls:o,close:s,onCancel:a,onConfirm:l}=d.useContext(JI);return i?ce.createElement(XGe,{isSilent:r,actionFn:a,close:function(){s==null||s.apply(void 0,arguments),l==null||l(!1)},autoFocus:e==="cancel",buttonProps:t,prefixCls:`${o}-btn`},n):null},kSe=()=>{const{autoFocusButton:e,close:t,isSilent:n,okButtonProps:r,rootPrefixCls:i,okTextLocale:o,okType:s,onConfirm:a,onOk:l}=d.useContext(JI);return ce.createElement(XGe,{isSilent:n,type:s||"primary",actionFn:l,close:function(){t==null||t.apply(void 0,arguments),a==null||a(!0)},autoFocus:e==="ok",buttonProps:r,prefixCls:`${i}-btn`},o)};var ZGe=d.createContext(null),zSe=[];function h_t(e,t){var n=d.useState(function(){if(!Bs())return null;var p=document.createElement("div");return p}),r=Ce(n,1),i=r[0],o=d.useRef(!1),s=d.useContext(ZGe),a=d.useState(zSe),l=Ce(a,2),c=l[0],u=l[1],f=s||(o.current?void 0:function(p){u(function(m){var v=[p].concat(ut(m));return v})});function h(){i.parentElement||document.body.appendChild(i),o.current=!0}function g(){var p;(p=i.parentElement)===null||p===void 0||p.removeChild(i),o.current=!1}return Zn(function(){return e?s?s(h):h():g(),g},[e]),Zn(function(){c.length&&(c.forEach(function(p){return p()}),u(zSe))},[c]),[i,f]}var Vee;function JGe(e){var t="rc-scrollbar-measure-".concat(Math.random().toString(36).substring(7)),n=document.createElement("div");n.id=t;var r=n.style;r.position="absolute",r.left="0",r.top="0",r.width="100px",r.height="100px",r.overflow="scroll";var i,o;if(e){var s=getComputedStyle(e);r.scrollbarColor=s.scrollbarColor,r.scrollbarWidth=s.scrollbarWidth;var a=getComputedStyle(e,"::-webkit-scrollbar"),l=parseInt(a.width,10),c=parseInt(a.height,10);try{var u=l?"width: ".concat(a.width,";"):"",f=c?"height: ".concat(a.height,";"):"";am(` +#`.concat(t,`::-webkit-scrollbar { +`).concat(u,` +`).concat(f,` +}`),t)}catch(p){console.error(p),i=l,o=c}}document.body.appendChild(n);var h=e&&i&&!isNaN(i)?i:n.offsetWidth-n.clientWidth,g=e&&o&&!isNaN(o)?o:n.offsetHeight-n.clientHeight;return document.body.removeChild(n),n7(t),{width:h,height:g}}function BSe(e){return typeof document>"u"?0:(Vee===void 0&&(Vee=JGe()),Vee.width)}function Bae(e){return typeof document>"u"||!e||!(e instanceof Element)?{width:0,height:0}:JGe(e)}function g_t(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var p_t="rc-util-locker-".concat(Date.now()),HSe=0;function m_t(e){var t=!!e,n=d.useState(function(){return HSe+=1,"".concat(p_t,"_").concat(HSe)}),r=Ce(n,1),i=r[0];Zn(function(){if(t){var o=Bae(document.body).width,s=g_t();am(` +html body { + overflow-y: hidden; + `.concat(s?"width: calc(100% - ".concat(o,"px);"):"",` +}`),i)}else n7(i);return function(){n7(i)}},[t,i])}var v_t=!1;function C_t(e){return v_t}var jSe=function(t){return t===!1?!1:!Bs()||!t?null:typeof t=="string"?document.querySelector(t):typeof t=="function"?t():t},Ly=d.forwardRef(function(e,t){var n=e.open,r=e.autoLock,i=e.getContainer;e.debug;var o=e.autoDestroy,s=o===void 0?!0:o,a=e.children,l=d.useState(n),c=Ce(l,2),u=c[0],f=c[1],h=u||n;d.useEffect(function(){(s||n)&&f(n)},[n,s]);var g=d.useState(function(){return jSe(i)}),p=Ce(g,2),m=p[0],v=p[1];d.useEffect(function(){var M=jSe(i);v(M??null)});var C=h_t(h&&!m),y=Ce(C,2),b=y[0],S=y[1],w=m??b;m_t(r&&n&&Bs()&&(w===b||w===document.body));var x=null;if(a&&Cd(a)&&t){var E=a;x=E.ref}var R=Od(x,t);if(!h||!Bs()||m===void 0)return null;var O=w===!1||C_t(),T=a;return t&&(T=d.cloneElement(a,{ref:R})),d.createElement(ZGe.Provider,{value:S},O?T:fo.createPortal(T,w))}),eWe=d.createContext({});function y_t(){var e=se({},Mx);return e.useId}var VSe=0,GSe=y_t();const iV=GSe?function(t){var n=GSe();return t||n}:function(t){var n=d.useState("ssr-id"),r=Ce(n,2),i=r[0],o=r[1];return d.useEffect(function(){var s=VSe;VSe+=1,o("rc_unique_".concat(s))},[]),t||i};function WSe(e,t,n){var r=t;return!r&&n&&(r="".concat(e,"-").concat(n)),r}function USe(e,t){var n=e["page".concat(t?"Y":"X","Offset")],r="scroll".concat(t?"Top":"Left");if(typeof n!="number"){var i=e.document;n=i.documentElement[r],typeof n!="number"&&(n=i.body[r])}return n}function b_t(e){var t=e.getBoundingClientRect(),n={left:t.left,top:t.top},r=e.ownerDocument,i=r.defaultView||r.parentWindow;return n.left+=USe(i),n.top+=USe(i,!0),n}const S_t=d.memo(function(e){var t=e.children;return t},function(e,t){var n=t.shouldUpdate;return!n});var w_t={width:0,height:0,overflow:"hidden",outline:"none"},x_t={outline:"none"},upe=ce.forwardRef(function(e,t){var n=e.prefixCls,r=e.className,i=e.style,o=e.title,s=e.ariaId,a=e.footer,l=e.closable,c=e.closeIcon,u=e.onClose,f=e.children,h=e.bodyStyle,g=e.bodyProps,p=e.modalRender,m=e.onMouseDown,v=e.onMouseUp,C=e.holderRef,y=e.visible,b=e.forceRender,S=e.width,w=e.height,x=e.classNames,E=e.styles,R=ce.useContext(eWe),O=R.panel,T=Od(C,O),M=d.useRef(),_=d.useRef();ce.useImperativeHandle(t,function(){return{focus:function(){var j;(j=M.current)===null||j===void 0||j.focus({preventScroll:!0})},changeActive:function(j){var W=document,G=W.activeElement;j&&G===_.current?M.current.focus({preventScroll:!0}):!j&&G===M.current&&_.current.focus({preventScroll:!0})}}});var F={};S!==void 0&&(F.width=S),w!==void 0&&(F.height=w);var D=a?ce.createElement("div",{className:we("".concat(n,"-footer"),x==null?void 0:x.footer),style:se({},E==null?void 0:E.footer)},a):null,k=o?ce.createElement("div",{className:we("".concat(n,"-header"),x==null?void 0:x.header),style:se({},E==null?void 0:E.header)},ce.createElement("div",{className:"".concat(n,"-title"),id:s},o)):null,L=d.useMemo(function(){return nn(l)==="object"&&l!==null?l:l?{closeIcon:c??ce.createElement("span",{className:"".concat(n,"-close-x")})}:{}},[l,c,n]),I=$o(L,!0),A=nn(l)==="object"&&l.disabled,N=l?ce.createElement("button",V({type:"button",onClick:u,"aria-label":"Close"},I,{className:"".concat(n,"-close"),disabled:A}),L.closeIcon):null,B=ce.createElement("div",{className:we("".concat(n,"-content"),x==null?void 0:x.content),style:E==null?void 0:E.content},N,k,ce.createElement("div",V({className:we("".concat(n,"-body"),x==null?void 0:x.body),style:se(se({},h),E==null?void 0:E.body)},g),f),D);return ce.createElement("div",{key:"dialog-element",role:"dialog","aria-labelledby":o?s:null,"aria-modal":"true",ref:T,style:se(se({},i),F),className:we(n,r),onMouseDown:m,onMouseUp:v},ce.createElement("div",{ref:M,tabIndex:0,style:x_t},ce.createElement(S_t,{shouldUpdate:y||b},p?p(B):B)),ce.createElement("div",{tabIndex:0,ref:_,style:w_t}))}),tWe=d.forwardRef(function(e,t){var n=e.prefixCls,r=e.title,i=e.style,o=e.className,s=e.visible,a=e.forceRender,l=e.destroyOnClose,c=e.motionName,u=e.ariaId,f=e.onVisibleChanged,h=e.mousePosition,g=d.useRef(),p=d.useState(),m=Ce(p,2),v=m[0],C=m[1],y={};v&&(y.transformOrigin=v);function b(){var S=b_t(g.current);C(h&&(h.x||h.y)?"".concat(h.x-S.left,"px ").concat(h.y-S.top,"px"):"")}return d.createElement(Hs,{visible:s,onVisibleChanged:f,onAppearPrepare:b,onEnterPrepare:b,forceRender:a,motionName:c,removeOnLeave:l,ref:g},function(S,w){var x=S.className,E=S.style;return d.createElement(upe,V({},e,{ref:t,title:r,ariaId:u,prefixCls:n,holderRef:w,style:se(se(se({},E),i),y),className:we(o,x)}))})});tWe.displayName="Content";var E_t=function(t){var n=t.prefixCls,r=t.style,i=t.visible,o=t.maskProps,s=t.motionName,a=t.className;return d.createElement(Hs,{key:"mask",visible:i,motionName:s,leavedClassName:"".concat(n,"-mask-hidden")},function(l,c){var u=l.className,f=l.style;return d.createElement("div",V({ref:c,style:se(se({},f),r),className:we("".concat(n,"-mask"),u,a)},o))})},R_t=function(t){var n=t.prefixCls,r=n===void 0?"rc-dialog":n,i=t.zIndex,o=t.visible,s=o===void 0?!1:o,a=t.keyboard,l=a===void 0?!0:a,c=t.focusTriggerAfterClose,u=c===void 0?!0:c,f=t.wrapStyle,h=t.wrapClassName,g=t.wrapProps,p=t.onClose,m=t.afterOpenChange,v=t.afterClose,C=t.transitionName,y=t.animation,b=t.closable,S=b===void 0?!0:b,w=t.mask,x=w===void 0?!0:w,E=t.maskTransitionName,R=t.maskAnimation,O=t.maskClosable,T=O===void 0?!0:O,M=t.maskStyle,_=t.maskProps,F=t.rootClassName,D=t.classNames,k=t.styles,L=d.useRef(),I=d.useRef(),A=d.useRef(),N=d.useState(s),B=Ce(N,2),z=B[0],j=B[1],W=iV();function G(){wae(I.current,document.activeElement)||(L.current=document.activeElement)}function K(){if(!wae(I.current,document.activeElement)){var le;(le=A.current)===null||le===void 0||le.focus()}}function q(le){if(le)K();else{if(j(!1),x&&L.current&&u){try{L.current.focus({preventScroll:!0})}catch{}L.current=null}z&&(v==null||v())}m==null||m(le)}function X(le){p==null||p(le)}var Q=d.useRef(!1),te=d.useRef(),ne=function(){clearTimeout(te.current),Q.current=!0},Z=function(){te.current=setTimeout(function(){Q.current=!1})},ee=null;T&&(ee=function(ge){Q.current?Q.current=!1:I.current===ge.target&&X(ge)});function J(le){if(l&&le.keyCode===lt.ESC){le.stopPropagation(),X(le);return}s&&le.keyCode===lt.TAB&&A.current.changeActive(!le.shiftKey)}d.useEffect(function(){s&&(j(!0),G())},[s]),d.useEffect(function(){return function(){clearTimeout(te.current)}},[]);var oe=se(se(se({zIndex:i},f),k==null?void 0:k.wrapper),{},{display:z?null:"none"});return d.createElement("div",V({className:we("".concat(r,"-root"),F)},$o(t,{data:!0})),d.createElement(E_t,{prefixCls:r,visible:x&&s,motionName:WSe(r,E,R),style:se(se({zIndex:i},M),k==null?void 0:k.mask),maskProps:_,className:D==null?void 0:D.mask}),d.createElement("div",V({tabIndex:-1,onKeyDown:J,className:we("".concat(r,"-wrap"),h,D==null?void 0:D.wrapper),ref:I,onClick:ee,style:oe},g),d.createElement(tWe,V({},t,{onMouseDown:ne,onMouseUp:Z,ref:A,closable:S,ariaId:W,prefixCls:r,visible:s&&z,onClose:X,onVisibleChanged:q,motionName:WSe(r,C,y)}))))},oV=function(t){var n=t.visible,r=t.getContainer,i=t.forceRender,o=t.destroyOnClose,s=o===void 0?!1:o,a=t.afterClose,l=t.panelRef,c=d.useState(n),u=Ce(c,2),f=u[0],h=u[1],g=d.useMemo(function(){return{panel:l}},[l]);return d.useEffect(function(){n&&h(!0)},[n]),!i&&s&&!f?null:d.createElement(eWe.Provider,{value:g},d.createElement(Ly,{open:n||i||f,autoDestroy:!1,getContainer:r,autoLock:n||f},d.createElement(R_t,V({},t,{destroyOnClose:s,afterClose:function(){a==null||a(),h(!1)}}))))};oV.displayName="Dialog";const $_t=Object.freeze(Object.defineProperty({__proto__:null,Panel:upe,default:oV},Symbol.toStringTag,{value:"Module"}));var T8="RC_FORM_INTERNAL_HOOKS",oo=function(){ui(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},Q4=d.createContext({getFieldValue:oo,getFieldsValue:oo,getFieldError:oo,getFieldWarning:oo,getFieldsError:oo,isFieldsTouched:oo,isFieldTouched:oo,isFieldValidating:oo,isFieldsValidating:oo,resetFields:oo,setFields:oo,setFieldValue:oo,setFieldsValue:oo,validateFields:oo,submit:oo,getInternalHooks:function(){return oo(),{dispatch:oo,initEntityValue:oo,registerField:oo,useSubscribe:oo,setInitialValues:oo,destroyForm:oo,setCallbacks:oo,registerWatch:oo,getFields:oo,setValidateMessages:oo,setPreserve:oo,getInitialValue:oo}}}),u7=d.createContext(null);function Hae(e){return e==null?[]:Array.isArray(e)?e:[e]}function O_t(e){return e&&!!e._init}function jae(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var Vae=jae();function T_t(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch{return typeof e=="function"}}function I_t(e,t,n){if(tv())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&yT(i,n.prototype),i}function Gae(e){var t=typeof Map=="function"?new Map:void 0;return Gae=function(r){if(r===null||!T_t(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(r))return t.get(r);t.set(r,i)}function i(){return I_t(r,arguments,ul(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),yT(i,r)},Gae(e)}var M_t=/%[sdj%]/g,P_t=function(){};function Wae(e){if(!e||!e.length)return null;var t={};return e.forEach(function(n){var r=n.field;t[r]=t[r]||[],t[r].push(n)}),t}function id(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=o)return a;switch(a){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch{return"[Circular]"}break;default:return a}});return s}return e}function __t(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function aa(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||__t(t)&&typeof e=="string"&&!e)}function A_t(e,t,n){var r=[],i=0,o=e.length;function s(a){r.push.apply(r,ut(a||[])),i++,i===o&&n(r)}e.forEach(function(a){t(a,s)})}function qSe(e,t,n){var r=0,i=e.length;function o(s){if(s&&s.length){n(s);return}var a=r;r=r+1,at.max?i.push(id(o.messages[f].max,t.fullField,t.max)):a&&l&&(ut.max)&&i.push(id(o.messages[f].range,t.fullField,t.min,t.max))},nWe=function(t,n,r,i,o,s){t.required&&(!r.hasOwnProperty(t.field)||aa(n,s||t.type))&&i.push(id(o.messages.required,t.fullField))},yD;const H_t=function(){if(yD)return yD;var e="[a-fA-F\\d:]",t=function(x){return x&&x.includeBoundaries?"(?:(?<=\\s|^)(?=".concat(e,")|(?<=").concat(e,")(?=\\s|$))"):""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",i=["(?:".concat(r,":){7}(?:").concat(r,"|:)"),"(?:".concat(r,":){6}(?:").concat(n,"|:").concat(r,"|:)"),"(?:".concat(r,":){5}(?::").concat(n,"|(?::").concat(r,"){1,2}|:)"),"(?:".concat(r,":){4}(?:(?::").concat(r,"){0,1}:").concat(n,"|(?::").concat(r,"){1,3}|:)"),"(?:".concat(r,":){3}(?:(?::").concat(r,"){0,2}:").concat(n,"|(?::").concat(r,"){1,4}|:)"),"(?:".concat(r,":){2}(?:(?::").concat(r,"){0,3}:").concat(n,"|(?::").concat(r,"){1,5}|:)"),"(?:".concat(r,":){1}(?:(?::").concat(r,"){0,4}:").concat(n,"|(?::").concat(r,"){1,6}|:)"),"(?::(?:(?::".concat(r,"){0,5}:").concat(n,"|(?::").concat(r,"){1,7}|:))")],o="(?:%[0-9a-zA-Z]{1,})?",s="(?:".concat(i.join("|"),")").concat(o),a=new RegExp("(?:^".concat(n,"$)|(?:^").concat(s,"$)")),l=new RegExp("^".concat(n,"$")),c=new RegExp("^".concat(s,"$")),u=function(x){return x&&x.exact?a:new RegExp("(?:".concat(t(x)).concat(n).concat(t(x),")|(?:").concat(t(x)).concat(s).concat(t(x),")"),"g")};u.v4=function(w){return w&&w.exact?l:new RegExp("".concat(t(w)).concat(n).concat(t(w)),"g")},u.v6=function(w){return w&&w.exact?c:new RegExp("".concat(t(w)).concat(s).concat(t(w)),"g")};var f="(?:(?:[a-z]+:)?//)",h="(?:\\S+(?::\\S*)?@)?",g=u.v4().source,p=u.v6().source,m="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",v="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",C="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",y="(?::\\d{2,5})?",b='(?:[/?#][^\\s"]*)?',S="(?:".concat(f,"|www\\.)").concat(h,"(?:localhost|").concat(g,"|").concat(p,"|").concat(m).concat(v).concat(C,")").concat(y).concat(b);return yD=new RegExp("(?:^".concat(S,"$)"),"i"),yD};var QSe={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},r$={integer:function(t){return r$.number(t)&&parseInt(t,10)===t},float:function(t){return r$.number(t)&&!r$.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return nn(t)==="object"&&!r$.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(QSe.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(H_t())},hex:function(t){return typeof t=="string"&&!!t.match(QSe.hex)}},j_t=function(t,n,r,i,o){if(t.required&&n===void 0){nWe(t,n,r,i,o);return}var s=["integer","float","array","regexp","object","method","email","number","date","url","hex"],a=t.type;s.indexOf(a)>-1?r$[a](n)||i.push(id(o.messages.types[a],t.fullField,t.type)):a&&nn(n)!==t.type&&i.push(id(o.messages.types[a],t.fullField,t.type))},V_t=function(t,n,r,i,o){(/^\s+$/.test(n)||n==="")&&i.push(id(o.messages.whitespace,t.fullField))};const hi={required:nWe,whitespace:V_t,type:j_t,range:B_t,enum:k_t,pattern:z_t};var G_t=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(aa(n)&&!t.required)return r();hi.required(t,n,i,s,o)}r(s)},W_t=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(n==null&&!t.required)return r();hi.required(t,n,i,s,o,"array"),n!=null&&(hi.type(t,n,i,s,o),hi.range(t,n,i,s,o))}r(s)},U_t=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(aa(n)&&!t.required)return r();hi.required(t,n,i,s,o),n!==void 0&&hi.type(t,n,i,s,o)}r(s)},q_t=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(aa(n,"date")&&!t.required)return r();if(hi.required(t,n,i,s,o),!aa(n,"date")){var l;n instanceof Date?l=n:l=new Date(n),hi.type(t,l,i,s,o),l&&hi.range(t,l.getTime(),i,s,o)}}r(s)},K_t="enum",Y_t=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(aa(n)&&!t.required)return r();hi.required(t,n,i,s,o),n!==void 0&&hi[K_t](t,n,i,s,o)}r(s)},X_t=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(aa(n)&&!t.required)return r();hi.required(t,n,i,s,o),n!==void 0&&(hi.type(t,n,i,s,o),hi.range(t,n,i,s,o))}r(s)},Q_t=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(aa(n)&&!t.required)return r();hi.required(t,n,i,s,o),n!==void 0&&(hi.type(t,n,i,s,o),hi.range(t,n,i,s,o))}r(s)},Z_t=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(aa(n)&&!t.required)return r();hi.required(t,n,i,s,o),n!==void 0&&hi.type(t,n,i,s,o)}r(s)},J_t=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(n===""&&(n=void 0),aa(n)&&!t.required)return r();hi.required(t,n,i,s,o),n!==void 0&&(hi.type(t,n,i,s,o),hi.range(t,n,i,s,o))}r(s)},eAt=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(aa(n)&&!t.required)return r();hi.required(t,n,i,s,o),n!==void 0&&hi.type(t,n,i,s,o)}r(s)},tAt=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(aa(n,"string")&&!t.required)return r();hi.required(t,n,i,s,o),aa(n,"string")||hi.pattern(t,n,i,s,o)}r(s)},nAt=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(aa(n)&&!t.required)return r();hi.required(t,n,i,s,o),aa(n)||hi.type(t,n,i,s,o)}r(s)},rAt=function(t,n,r,i,o){var s=[],a=Array.isArray(n)?"array":nn(n);hi.required(t,n,i,s,o,a),r(s)},iAt=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(aa(n,"string")&&!t.required)return r();hi.required(t,n,i,s,o,"string"),aa(n,"string")||(hi.type(t,n,i,s,o),hi.range(t,n,i,s,o),hi.pattern(t,n,i,s,o),t.whitespace===!0&&hi.whitespace(t,n,i,s,o))}r(s)},Gee=function(t,n,r,i,o){var s=t.type,a=[],l=t.required||!t.required&&i.hasOwnProperty(t.field);if(l){if(aa(n,s)&&!t.required)return r();hi.required(t,n,i,a,o,s),aa(n,s)||hi.type(t,n,i,a,o)}r(a)};const W$={string:iAt,method:Z_t,number:J_t,boolean:U_t,regexp:nAt,integer:Q_t,float:X_t,array:W_t,object:eAt,enum:Y_t,pattern:tAt,date:q_t,url:Gee,hex:Gee,email:Gee,required:rAt,any:G_t};var eM=function(){function e(t){qr(this,e),ie(this,"rules",null),ie(this,"_messages",Vae),this.define(t)}return Kr(e,[{key:"define",value:function(n){var r=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(nn(n)!=="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(i){var o=n[i];r.rules[i]=Array.isArray(o)?o:[o]})}},{key:"messages",value:function(n){return n&&(this._messages=XSe(jae(),n)),this._messages}},{key:"validate",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},s=n,a=i,l=o;if(typeof a=="function"&&(l=a,a={}),!this.rules||Object.keys(this.rules).length===0)return l&&l(null,s),Promise.resolve(s);function c(p){var m=[],v={};function C(b){if(Array.isArray(b)){var S;m=(S=m).concat.apply(S,ut(b))}else m.push(b)}for(var y=0;y0&&arguments[0]!==void 0?arguments[0]:[],R=Array.isArray(E)?E:[E];!a.suppressWarning&&R.length&&e.warning("async-validator:",R),R.length&&v.message!==void 0&&(R=[].concat(v.message));var O=R.map(YSe(v,s));if(a.first&&O.length)return g[v.field]=1,m(O);if(!C)m(O);else{if(v.required&&!p.value)return v.message!==void 0?O=[].concat(v.message).map(YSe(v,s)):a.error&&(O=[a.error(v,id(a.messages.required,v.field))]),m(O);var T={};v.defaultField&&Object.keys(p.value).map(function(F){T[F]=v.defaultField}),T=se(se({},T),p.rule.fields);var M={};Object.keys(T).forEach(function(F){var D=T[F],k=Array.isArray(D)?D:[D];M[F]=k.map(y.bind(null,F))});var _=new e(M);_.messages(a.messages),p.rule.options&&(p.rule.options.messages=a.messages,p.rule.options.error=a.error),_.validate(p.value,p.rule.options||a,function(F){var D=[];O&&O.length&&D.push.apply(D,ut(O)),F&&F.length&&D.push.apply(D,ut(F)),m(D.length?D:null)})}}var S;if(v.asyncValidator)S=v.asyncValidator(v,p.value,b,p.source,a);else if(v.validator){try{S=v.validator(v,p.value,b,p.source,a)}catch(E){var w,x;(w=(x=console).error)===null||w===void 0||w.call(x,E),a.suppressValidatorError||setTimeout(function(){throw E},0),b(E.message)}S===!0?b():S===!1?b(typeof v.message=="function"?v.message(v.fullField||v.field):v.message||"".concat(v.fullField||v.field," fails")):S instanceof Array?b(S):S instanceof Error&&b(S.message)}S&&S.then&&S.then(function(){return b()},function(E){return b(E)})},function(p){c(p)},s)}},{key:"getType",value:function(n){if(n.type===void 0&&n.pattern instanceof RegExp&&(n.type="pattern"),typeof n.validator!="function"&&n.type&&!W$.hasOwnProperty(n.type))throw new Error(id("Unknown rule type %s",n.type));return n.type||"string"}},{key:"getValidationMethod",value:function(n){if(typeof n.validator=="function")return n.validator;var r=Object.keys(n),i=r.indexOf("message");return i!==-1&&r.splice(i,1),r.length===1&&r[0]==="required"?W$.required:W$[this.getType(n)]||void 0}}]),e}();ie(eM,"register",function(t,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");W$[t]=n});ie(eM,"warning",P_t);ie(eM,"messages",Vae);ie(eM,"validators",W$);var Au="'${name}' is not a valid ${type}",rWe={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:Au,method:Au,array:Au,object:Au,number:Au,date:Au,boolean:Au,integer:Au,float:Au,regexp:Au,email:Au,url:Au,hex:Au},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},ZSe=eM;function oAt(e,t){return e.replace(/\\?\$\{\w+\}/g,function(n){if(n.startsWith("\\"))return n.slice(1);var r=n.slice(2,-1);return t[r]})}var JSe="CODE_LOGIC_ERROR";function Uae(e,t,n,r,i){return qae.apply(this,arguments)}function qae(){return qae=rd(mo().mark(function e(t,n,r,i,o){var s,a,l,c,u,f,h,g,p;return mo().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return s=se({},r),delete s.ruleIndex,ZSe.warning=function(){},s.validator&&(a=s.validator,s.validator=function(){try{return a.apply(void 0,arguments)}catch(C){return console.error(C),Promise.reject(JSe)}}),l=null,s&&s.type==="array"&&s.defaultField&&(l=s.defaultField,delete s.defaultField),c=new ZSe(ie({},t,[s])),u=xS(rWe,i.validateMessages),c.messages(u),f=[],v.prev=10,v.next=13,Promise.resolve(c.validate(ie({},t,n),se({},i)));case 13:v.next=18;break;case 15:v.prev=15,v.t0=v.catch(10),v.t0.errors&&(f=v.t0.errors.map(function(C,y){var b=C.message,S=b===JSe?u.default:b;return d.isValidElement(S)?d.cloneElement(S,{key:"error_".concat(y)}):S}));case 18:if(!(!f.length&&l)){v.next=23;break}return v.next=21,Promise.all(n.map(function(C,y){return Uae("".concat(t,".").concat(y),C,l,i,o)}));case 21:return h=v.sent,v.abrupt("return",h.reduce(function(C,y){return[].concat(ut(C),ut(y))},[]));case 23:return g=se(se({},r),{},{name:t,enum:(r.enum||[]).join(", ")},o),p=f.map(function(C){return typeof C=="string"?oAt(C,g):C}),v.abrupt("return",p);case 26:case"end":return v.stop()}},e,null,[[10,15]])})),qae.apply(this,arguments)}function sAt(e,t,n,r,i,o){var s=e.join("."),a=n.map(function(u,f){var h=u.validator,g=se(se({},u),{},{ruleIndex:f});return h&&(g.validator=function(p,m,v){var C=!1,y=function(){for(var w=arguments.length,x=new Array(w),E=0;E2&&arguments[2]!==void 0?arguments[2]:!1;return e&&e.some(function(r){return iWe(t,r,n)})}function iWe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return!e||!t||!n&&e.length!==t.length?!1:t.every(function(r,i){return e[i]===r})}function cAt(e,t){if(e===t)return!0;if(!e&&t||!t||!e||!t||nn(e)!=="object"||nn(t)!=="object")return!1;var n=Object.keys(e),r=Object.keys(t),i=new Set([].concat(n,r));return ut(i).every(function(o){var s=e[o],a=t[o];return typeof s=="function"&&typeof a=="function"?!0:s===a})}function uAt(e){var t=arguments.length<=1?void 0:arguments[1];return t&&t.target&&nn(t.target)==="object"&&e in t.target?t.target[e]:t}function twe(e,t,n){var r=e.length;if(t<0||t>=r||n<0||n>=r)return e;var i=e[t],o=t-n;return o>0?[].concat(ut(e.slice(0,n)),[i],ut(e.slice(n,t)),ut(e.slice(t+1,r))):o<0?[].concat(ut(e.slice(0,t)),ut(e.slice(t+1,n+1)),[i],ut(e.slice(n+1,r))):e}var dAt=["name"],Wd=[];function Wee(e,t,n,r,i,o){return typeof e=="function"?e(t,n,"source"in o?{source:o.source}:{}):r!==i}var dpe=function(e){hs(n,e);var t=wc(n);function n(r){var i;if(qr(this,n),i=t.call(this,r),ie(dn(i),"state",{resetCount:0}),ie(dn(i),"cancelRegisterFunc",null),ie(dn(i),"mounted",!1),ie(dn(i),"touched",!1),ie(dn(i),"dirty",!1),ie(dn(i),"validatePromise",void 0),ie(dn(i),"prevValidating",void 0),ie(dn(i),"errors",Wd),ie(dn(i),"warnings",Wd),ie(dn(i),"cancelRegister",function(){var l=i.props,c=l.preserve,u=l.isListField,f=l.name;i.cancelRegisterFunc&&i.cancelRegisterFunc(u,c,bs(f)),i.cancelRegisterFunc=null}),ie(dn(i),"getNamePath",function(){var l=i.props,c=l.name,u=l.fieldContext,f=u.prefixName,h=f===void 0?[]:f;return c!==void 0?[].concat(ut(h),ut(c)):[]}),ie(dn(i),"getRules",function(){var l=i.props,c=l.rules,u=c===void 0?[]:c,f=l.fieldContext;return u.map(function(h){return typeof h=="function"?h(f):h})}),ie(dn(i),"refresh",function(){i.mounted&&i.setState(function(l){var c=l.resetCount;return{resetCount:c+1}})}),ie(dn(i),"metaCache",null),ie(dn(i),"triggerMetaEvent",function(l){var c=i.props.onMetaChange;if(c){var u=se(se({},i.getMeta()),{},{destroy:l});Uf(i.metaCache,u)||c(u),i.metaCache=u}else i.metaCache=null}),ie(dn(i),"onStoreChange",function(l,c,u){var f=i.props,h=f.shouldUpdate,g=f.dependencies,p=g===void 0?[]:g,m=f.onReset,v=u.store,C=i.getNamePath(),y=i.getValue(l),b=i.getValue(v),S=c&&YS(c,C);switch(u.type==="valueUpdate"&&u.source==="external"&&!Uf(y,b)&&(i.touched=!0,i.dirty=!0,i.validatePromise=null,i.errors=Wd,i.warnings=Wd,i.triggerMetaEvent()),u.type){case"reset":if(!c||S){i.touched=!1,i.dirty=!1,i.validatePromise=void 0,i.errors=Wd,i.warnings=Wd,i.triggerMetaEvent(),m==null||m(),i.refresh();return}break;case"remove":{if(h&&Wee(h,l,v,y,b,u)){i.reRender();return}break}case"setField":{var w=u.data;if(S){"touched"in w&&(i.touched=w.touched),"validating"in w&&!("originRCField"in w)&&(i.validatePromise=w.validating?Promise.resolve([]):null),"errors"in w&&(i.errors=w.errors||Wd),"warnings"in w&&(i.warnings=w.warnings||Wd),i.dirty=!0,i.triggerMetaEvent(),i.reRender();return}else if("value"in w&&YS(c,C,!0)){i.reRender();return}if(h&&!C.length&&Wee(h,l,v,y,b,u)){i.reRender();return}break}case"dependenciesUpdate":{var x=p.map(bs);if(x.some(function(E){return YS(u.relatedFields,E)})){i.reRender();return}break}default:if(S||(!p.length||C.length||h)&&Wee(h,l,v,y,b,u)){i.reRender();return}break}h===!0&&i.reRender()}),ie(dn(i),"validateRules",function(l){var c=i.getNamePath(),u=i.getValue(),f=l||{},h=f.triggerName,g=f.validateOnly,p=g===void 0?!1:g,m=Promise.resolve().then(rd(mo().mark(function v(){var C,y,b,S,w,x,E;return mo().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:if(i.mounted){O.next=2;break}return O.abrupt("return",[]);case 2:if(C=i.props,y=C.validateFirst,b=y===void 0?!1:y,S=C.messageVariables,w=C.validateDebounce,x=i.getRules(),h&&(x=x.filter(function(T){return T}).filter(function(T){var M=T.validateTrigger;if(!M)return!0;var _=Hae(M);return _.includes(h)})),!(w&&h)){O.next=10;break}return O.next=8,new Promise(function(T){setTimeout(T,w)});case 8:if(i.validatePromise===m){O.next=10;break}return O.abrupt("return",[]);case 10:return E=sAt(c,u,x,l,b,S),E.catch(function(T){return T}).then(function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Wd;if(i.validatePromise===m){var M;i.validatePromise=null;var _=[],F=[];(M=T.forEach)===null||M===void 0||M.call(T,function(D){var k=D.rule.warningOnly,L=D.errors,I=L===void 0?Wd:L;k?F.push.apply(F,ut(I)):_.push.apply(_,ut(I))}),i.errors=_,i.warnings=F,i.triggerMetaEvent(),i.reRender()}}),O.abrupt("return",E);case 13:case"end":return O.stop()}},v)})));return p||(i.validatePromise=m,i.dirty=!0,i.errors=Wd,i.warnings=Wd,i.triggerMetaEvent(),i.reRender()),m}),ie(dn(i),"isFieldValidating",function(){return!!i.validatePromise}),ie(dn(i),"isFieldTouched",function(){return i.touched}),ie(dn(i),"isFieldDirty",function(){if(i.dirty||i.props.initialValue!==void 0)return!0;var l=i.props.fieldContext,c=l.getInternalHooks(T8),u=c.getInitialValue;return u(i.getNamePath())!==void 0}),ie(dn(i),"getErrors",function(){return i.errors}),ie(dn(i),"getWarnings",function(){return i.warnings}),ie(dn(i),"isListField",function(){return i.props.isListField}),ie(dn(i),"isList",function(){return i.props.isList}),ie(dn(i),"isPreserve",function(){return i.props.preserve}),ie(dn(i),"getMeta",function(){i.prevValidating=i.isFieldValidating();var l={touched:i.isFieldTouched(),validating:i.prevValidating,errors:i.errors,warnings:i.warnings,name:i.getNamePath(),validated:i.validatePromise===null};return l}),ie(dn(i),"getOnlyChild",function(l){if(typeof l=="function"){var c=i.getMeta();return se(se({},i.getOnlyChild(l(i.getControlled(),c,i.props.fieldContext))),{},{isFunction:!0})}var u=Rs(l);return u.length!==1||!d.isValidElement(u[0])?{child:u,isFunction:!1}:{child:u[0],isFunction:!1}}),ie(dn(i),"getValue",function(l){var c=i.props.fieldContext.getFieldsValue,u=i.getNamePath();return Bl(l||c(!0),u)}),ie(dn(i),"getControlled",function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=i.props,u=c.name,f=c.trigger,h=c.validateTrigger,g=c.getValueFromEvent,p=c.normalize,m=c.valuePropName,v=c.getValueProps,C=c.fieldContext,y=h!==void 0?h:C.validateTrigger,b=i.getNamePath(),S=C.getInternalHooks,w=C.getFieldsValue,x=S(T8),E=x.dispatch,R=i.getValue(),O=v||function(D){return ie({},m,D)},T=l[f],M=u!==void 0?O(R):{},_=se(se({},l),M);_[f]=function(){i.touched=!0,i.dirty=!0,i.triggerMetaEvent();for(var D,k=arguments.length,L=new Array(k),I=0;I=0&&T<=M.length?(u.keys=[].concat(ut(u.keys.slice(0,T)),[u.id],ut(u.keys.slice(T))),b([].concat(ut(M.slice(0,T)),[O],ut(M.slice(T))))):(u.keys=[].concat(ut(u.keys),[u.id]),b([].concat(ut(M),[O]))),u.id+=1},remove:function(O){var T=w(),M=new Set(Array.isArray(O)?O:[O]);M.size<=0||(u.keys=u.keys.filter(function(_,F){return!M.has(F)}),b(T.filter(function(_,F){return!M.has(F)})))},move:function(O,T){if(O!==T){var M=w();O<0||O>=M.length||T<0||T>=M.length||(u.keys=twe(u.keys,O,T),b(twe(M,O,T)))}}},E=y||[];return Array.isArray(E)||(E=[]),r(E.map(function(R,O){var T=u.keys[O];return T===void 0&&(u.keys[O]=u.id,T=u.keys[O],u.id+=1),{name:O,key:T,isListField:!0}}),x,v)})))}function fAt(e){var t=!1,n=e.length,r=[];return e.length?new Promise(function(i,o){e.forEach(function(s,a){s.catch(function(l){return t=!0,l}).then(function(l){n-=1,r[a]=l,!(n>0)&&(t&&o(r),i(r))})})}):Promise.resolve([])}var oWe="__@field_split__";function Uee(e){return e.map(function(t){return"".concat(nn(t),":").concat(t)}).join(oWe)}var i5=function(){function e(){qr(this,e),ie(this,"kvs",new Map)}return Kr(e,[{key:"set",value:function(n,r){this.kvs.set(Uee(n),r)}},{key:"get",value:function(n){return this.kvs.get(Uee(n))}},{key:"update",value:function(n,r){var i=this.get(n),o=r(i);o?this.set(n,o):this.delete(n)}},{key:"delete",value:function(n){this.kvs.delete(Uee(n))}},{key:"map",value:function(n){return ut(this.kvs.entries()).map(function(r){var i=Ce(r,2),o=i[0],s=i[1],a=o.split(oWe);return n({key:a.map(function(l){var c=l.match(/^([^:]*):(.*)$/),u=Ce(c,3),f=u[1],h=u[2];return f==="number"?Number(h):h}),value:s})})}},{key:"toJSON",value:function(){var n={};return this.map(function(r){var i=r.key,o=r.value;return n[i.join(".")]=o,null}),n}}]),e}(),hAt=["name"],gAt=Kr(function e(t){var n=this;qr(this,e),ie(this,"formHooked",!1),ie(this,"forceRootUpdate",void 0),ie(this,"subscribable",!0),ie(this,"store",{}),ie(this,"fieldEntities",[]),ie(this,"initialValues",{}),ie(this,"callbacks",{}),ie(this,"validateMessages",null),ie(this,"preserve",null),ie(this,"lastValidatePromise",null),ie(this,"getForm",function(){return{getFieldValue:n.getFieldValue,getFieldsValue:n.getFieldsValue,getFieldError:n.getFieldError,getFieldWarning:n.getFieldWarning,getFieldsError:n.getFieldsError,isFieldsTouched:n.isFieldsTouched,isFieldTouched:n.isFieldTouched,isFieldValidating:n.isFieldValidating,isFieldsValidating:n.isFieldsValidating,resetFields:n.resetFields,setFields:n.setFields,setFieldValue:n.setFieldValue,setFieldsValue:n.setFieldsValue,validateFields:n.validateFields,submit:n.submit,_init:!0,getInternalHooks:n.getInternalHooks}}),ie(this,"getInternalHooks",function(r){return r===T8?(n.formHooked=!0,{dispatch:n.dispatch,initEntityValue:n.initEntityValue,registerField:n.registerField,useSubscribe:n.useSubscribe,setInitialValues:n.setInitialValues,destroyForm:n.destroyForm,setCallbacks:n.setCallbacks,setValidateMessages:n.setValidateMessages,getFields:n.getFields,setPreserve:n.setPreserve,getInitialValue:n.getInitialValue,registerWatch:n.registerWatch}):(ui(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),ie(this,"useSubscribe",function(r){n.subscribable=r}),ie(this,"prevWithoutPreserves",null),ie(this,"setInitialValues",function(r,i){if(n.initialValues=r||{},i){var o,s=xS(r,n.store);(o=n.prevWithoutPreserves)===null||o===void 0||o.map(function(a){var l=a.key;s=Xu(s,l,Bl(r,l))}),n.prevWithoutPreserves=null,n.updateStore(s)}}),ie(this,"destroyForm",function(r){if(r)n.updateStore({});else{var i=new i5;n.getFieldEntities(!0).forEach(function(o){n.isMergedPreserve(o.isPreserve())||i.set(o.getNamePath(),!0)}),n.prevWithoutPreserves=i}}),ie(this,"getInitialValue",function(r){var i=Bl(n.initialValues,r);return r.length?xS(i):i}),ie(this,"setCallbacks",function(r){n.callbacks=r}),ie(this,"setValidateMessages",function(r){n.validateMessages=r}),ie(this,"setPreserve",function(r){n.preserve=r}),ie(this,"watchList",[]),ie(this,"registerWatch",function(r){return n.watchList.push(r),function(){n.watchList=n.watchList.filter(function(i){return i!==r})}}),ie(this,"notifyWatch",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(n.watchList.length){var i=n.getFieldsValue(),o=n.getFieldsValue(!0);n.watchList.forEach(function(s){s(i,o,r)})}}),ie(this,"timeoutId",null),ie(this,"warningUnhooked",function(){}),ie(this,"updateStore",function(r){n.store=r}),ie(this,"getFieldEntities",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return r?n.fieldEntities.filter(function(i){return i.getNamePath().length}):n.fieldEntities}),ie(this,"getFieldsMap",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=new i5;return n.getFieldEntities(r).forEach(function(o){var s=o.getNamePath();i.set(s,o)}),i}),ie(this,"getFieldEntitiesForNamePathList",function(r){if(!r)return n.getFieldEntities(!0);var i=n.getFieldsMap(!0);return r.map(function(o){var s=bs(o);return i.get(s)||{INVALIDATE_NAME_PATH:bs(o)}})}),ie(this,"getFieldsValue",function(r,i){n.warningUnhooked();var o,s,a;if(r===!0||Array.isArray(r)?(o=r,s=i):r&&nn(r)==="object"&&(a=r.strict,s=r.filter),o===!0&&!s)return n.store;var l=n.getFieldEntitiesForNamePathList(Array.isArray(o)?o:null),c=[];return l.forEach(function(u){var f,h,g="INVALIDATE_NAME_PATH"in u?u.INVALIDATE_NAME_PATH:u.getNamePath();if(a){var p,m;if((p=(m=u).isList)!==null&&p!==void 0&&p.call(m))return}else if(!o&&(f=(h=u).isListField)!==null&&f!==void 0&&f.call(h))return;if(!s)c.push(g);else{var v="getMeta"in u?u.getMeta():null;s(v)&&c.push(g)}}),ewe(n.store,c.map(bs))}),ie(this,"getFieldValue",function(r){n.warningUnhooked();var i=bs(r);return Bl(n.store,i)}),ie(this,"getFieldsError",function(r){n.warningUnhooked();var i=n.getFieldEntitiesForNamePathList(r);return i.map(function(o,s){return o&&!("INVALIDATE_NAME_PATH"in o)?{name:o.getNamePath(),errors:o.getErrors(),warnings:o.getWarnings()}:{name:bs(r[s]),errors:[],warnings:[]}})}),ie(this,"getFieldError",function(r){n.warningUnhooked();var i=bs(r),o=n.getFieldsError([i])[0];return o.errors}),ie(this,"getFieldWarning",function(r){n.warningUnhooked();var i=bs(r),o=n.getFieldsError([i])[0];return o.warnings}),ie(this,"isFieldsTouched",function(){n.warningUnhooked();for(var r=arguments.length,i=new Array(r),o=0;o0&&arguments[0]!==void 0?arguments[0]:{},i=new i5,o=n.getFieldEntities(!0);o.forEach(function(l){var c=l.props.initialValue,u=l.getNamePath();if(c!==void 0){var f=i.get(u)||new Set;f.add({entity:l,value:c}),i.set(u,f)}});var s=function(c){c.forEach(function(u){var f=u.props.initialValue;if(f!==void 0){var h=u.getNamePath(),g=n.getInitialValue(h);if(g!==void 0)ui(!1,"Form already set 'initialValues' with path '".concat(h.join("."),"'. Field can not overwrite it."));else{var p=i.get(h);if(p&&p.size>1)ui(!1,"Multiple Field with path '".concat(h.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(p){var m=n.getFieldValue(h),v=u.isListField();!v&&(!r.skipExist||m===void 0)&&n.updateStore(Xu(n.store,h,ut(p)[0].value))}}}})},a;r.entities?a=r.entities:r.namePathList?(a=[],r.namePathList.forEach(function(l){var c=i.get(l);if(c){var u;(u=a).push.apply(u,ut(ut(c).map(function(f){return f.entity})))}})):a=o,s(a)}),ie(this,"resetFields",function(r){n.warningUnhooked();var i=n.store;if(!r){n.updateStore(xS(n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(i,null,{type:"reset"}),n.notifyWatch();return}var o=r.map(bs);o.forEach(function(s){var a=n.getInitialValue(s);n.updateStore(Xu(n.store,s,a))}),n.resetWithFieldInitialValue({namePathList:o}),n.notifyObservers(i,o,{type:"reset"}),n.notifyWatch(o)}),ie(this,"setFields",function(r){n.warningUnhooked();var i=n.store,o=[];r.forEach(function(s){var a=s.name,l=on(s,hAt),c=bs(a);o.push(c),"value"in l&&n.updateStore(Xu(n.store,c,l.value)),n.notifyObservers(i,[c],{type:"setField",data:s})}),n.notifyWatch(o)}),ie(this,"getFields",function(){var r=n.getFieldEntities(!0),i=r.map(function(o){var s=o.getNamePath(),a=o.getMeta(),l=se(se({},a),{},{name:s,value:n.getFieldValue(s)});return Object.defineProperty(l,"originRCField",{value:!0}),l});return i}),ie(this,"initEntityValue",function(r){var i=r.props.initialValue;if(i!==void 0){var o=r.getNamePath(),s=Bl(n.store,o);s===void 0&&n.updateStore(Xu(n.store,o,i))}}),ie(this,"isMergedPreserve",function(r){var i=r!==void 0?r:n.preserve;return i??!0}),ie(this,"registerField",function(r){n.fieldEntities.push(r);var i=r.getNamePath();if(n.notifyWatch([i]),r.props.initialValue!==void 0){var o=n.store;n.resetWithFieldInitialValue({entities:[r],skipExist:!0}),n.notifyObservers(o,[r.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(s,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter(function(f){return f!==r}),!n.isMergedPreserve(a)&&(!s||l.length>1)){var c=s?void 0:n.getInitialValue(i);if(i.length&&n.getFieldValue(i)!==c&&n.fieldEntities.every(function(f){return!iWe(f.getNamePath(),i)})){var u=n.store;n.updateStore(Xu(u,i,c,!0)),n.notifyObservers(u,[i],{type:"remove"}),n.triggerDependenciesUpdate(u,i)}}n.notifyWatch([i])}}),ie(this,"dispatch",function(r){switch(r.type){case"updateValue":{var i=r.namePath,o=r.value;n.updateValue(i,o);break}case"validateField":{var s=r.namePath,a=r.triggerName;n.validateFields([s],{triggerName:a});break}}}),ie(this,"notifyObservers",function(r,i,o){if(n.subscribable){var s=se(se({},o),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach(function(a){var l=a.onStoreChange;l(r,i,s)})}else n.forceRootUpdate()}),ie(this,"triggerDependenciesUpdate",function(r,i){var o=n.getDependencyChildrenFields(i);return o.length&&n.validateFields(o),n.notifyObservers(r,o,{type:"dependenciesUpdate",relatedFields:[i].concat(ut(o))}),o}),ie(this,"updateValue",function(r,i){var o=bs(r),s=n.store;n.updateStore(Xu(n.store,o,i)),n.notifyObservers(s,[o],{type:"valueUpdate",source:"internal"}),n.notifyWatch([o]);var a=n.triggerDependenciesUpdate(s,o),l=n.callbacks.onValuesChange;if(l){var c=ewe(n.store,[o]);l(c,n.getFieldsValue())}n.triggerOnFieldsChange([o].concat(ut(a)))}),ie(this,"setFieldsValue",function(r){n.warningUnhooked();var i=n.store;if(r){var o=xS(n.store,r);n.updateStore(o)}n.notifyObservers(i,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()}),ie(this,"setFieldValue",function(r,i){n.setFields([{name:r,value:i,errors:[],warnings:[]}])}),ie(this,"getDependencyChildrenFields",function(r){var i=new Set,o=[],s=new i5;n.getFieldEntities().forEach(function(l){var c=l.props.dependencies;(c||[]).forEach(function(u){var f=bs(u);s.update(f,function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return h.add(l),h})})});var a=function l(c){var u=s.get(c)||new Set;u.forEach(function(f){if(!i.has(f)){i.add(f);var h=f.getNamePath();f.isFieldDirty()&&h.length&&(o.push(h),l(h))}})};return a(r),o}),ie(this,"triggerOnFieldsChange",function(r,i){var o=n.callbacks.onFieldsChange;if(o){var s=n.getFields();if(i){var a=new i5;i.forEach(function(c){var u=c.name,f=c.errors;a.set(u,f)}),s.forEach(function(c){c.errors=a.get(c.name)||c.errors})}var l=s.filter(function(c){var u=c.name;return YS(r,u)});l.length&&o(l,s)}}),ie(this,"validateFields",function(r,i){n.warningUnhooked();var o,s;Array.isArray(r)||typeof r=="string"||typeof i=="string"?(o=r,s=i):s=r;var a=!!o,l=a?o.map(bs):[],c=[],u=String(Date.now()),f=new Set,h=s||{},g=h.recursive,p=h.dirty;n.getFieldEntities(!0).forEach(function(y){if(a||l.push(y.getNamePath()),!(!y.props.rules||!y.props.rules.length)&&!(p&&!y.isFieldDirty())){var b=y.getNamePath();if(f.add(b.join(u)),!a||YS(l,b,g)){var S=y.validateRules(se({validateMessages:se(se({},rWe),n.validateMessages)},s));c.push(S.then(function(){return{name:b,errors:[],warnings:[]}}).catch(function(w){var x,E=[],R=[];return(x=w.forEach)===null||x===void 0||x.call(w,function(O){var T=O.rule.warningOnly,M=O.errors;T?R.push.apply(R,ut(M)):E.push.apply(E,ut(M))}),E.length?Promise.reject({name:b,errors:E,warnings:R}):{name:b,errors:E,warnings:R}}))}}});var m=fAt(c);n.lastValidatePromise=m,m.catch(function(y){return y}).then(function(y){var b=y.map(function(S){var w=S.name;return w});n.notifyObservers(n.store,b,{type:"validateFinish"}),n.triggerOnFieldsChange(b,y)});var v=m.then(function(){return n.lastValidatePromise===m?Promise.resolve(n.getFieldsValue(l)):Promise.reject([])}).catch(function(y){var b=y.filter(function(S){return S&&S.errors.length});return Promise.reject({values:n.getFieldsValue(l),errorFields:b,outOfDate:n.lastValidatePromise!==m})});v.catch(function(y){return y});var C=l.filter(function(y){return f.has(y.join(u))});return n.triggerOnFieldsChange(C),v}),ie(this,"submit",function(){n.warningUnhooked(),n.validateFields().then(function(r){var i=n.callbacks.onFinish;if(i)try{i(r)}catch(o){console.error(o)}}).catch(function(r){var i=n.callbacks.onFinishFailed;i&&i(r)})}),this.forceRootUpdate=t});function aV(e){var t=d.useRef(),n=d.useState({}),r=Ce(n,2),i=r[1];if(!t.current)if(e)t.current=e;else{var o=function(){i({})},s=new gAt(o);t.current=s.getForm()}return[t.current]}var Xae=d.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),hpe=function(t){var n=t.validateMessages,r=t.onFormChange,i=t.onFormFinish,o=t.children,s=d.useContext(Xae),a=d.useRef({});return d.createElement(Xae.Provider,{value:se(se({},s),{},{validateMessages:se(se({},s.validateMessages),n),triggerFormChange:function(c,u){r&&r(c,{changedFields:u,forms:a.current}),s.triggerFormChange(c,u)},triggerFormFinish:function(c,u){i&&i(c,{values:u,forms:a.current}),s.triggerFormFinish(c,u)},registerForm:function(c,u){c&&(a.current=se(se({},a.current),{},ie({},c,u))),s.registerForm(c,u)},unregisterForm:function(c){var u=se({},a.current);delete u[c],a.current=u,s.unregisterForm(c)}})},o)},pAt=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed","clearOnDestroy"],mAt=function(t,n){var r=t.name,i=t.initialValues,o=t.fields,s=t.form,a=t.preserve,l=t.children,c=t.component,u=c===void 0?"form":c,f=t.validateMessages,h=t.validateTrigger,g=h===void 0?"onChange":h,p=t.onValuesChange,m=t.onFieldsChange,v=t.onFinish,C=t.onFinishFailed,y=t.clearOnDestroy,b=on(t,pAt),S=d.useRef(null),w=d.useContext(Xae),x=aV(s),E=Ce(x,1),R=E[0],O=R.getInternalHooks(T8),T=O.useSubscribe,M=O.setInitialValues,_=O.setCallbacks,F=O.setValidateMessages,D=O.setPreserve,k=O.destroyForm;d.useImperativeHandle(n,function(){return se(se({},R),{},{nativeElement:S.current})}),d.useEffect(function(){return w.registerForm(r,R),function(){w.unregisterForm(r)}},[w,R,r]),F(se(se({},w.validateMessages),f)),_({onValuesChange:p,onFieldsChange:function(G){if(w.triggerFormChange(r,G),m){for(var K=arguments.length,q=new Array(K>1?K-1:0),X=1;X{}}),sWe=d.createContext(null),aWe=e=>{const t=$i(e,["prefixCls"]);return d.createElement(hpe,Object.assign({},t))},ppe=d.createContext({prefixCls:""}),Na=d.createContext({}),yAt=e=>{let{children:t,status:n,override:r}=e;const i=d.useContext(Na),o=d.useMemo(()=>{const s=Object.assign({},i);return r&&delete s.isFormItemInput,n&&(delete s.status,delete s.hasFeedback,delete s.feedbackIcon),s},[n,r,i]);return d.createElement(Na.Provider,{value:o},t)},lWe=d.createContext(void 0),kC=e=>{const{space:t,form:n,children:r}=e;if(r==null)return null;let i=r;return n&&(i=ce.createElement(yAt,{override:!0,status:!0},i)),t&&(i=ce.createElement(yMt,null,i)),i};function qz(e){if(e)return{closable:e.closable,closeIcon:e.closeIcon}}function rwe(e){const{closable:t,closeIcon:n}=e||{};return ce.useMemo(()=>{if(!t&&(t===!1||n===!1||n===null))return!1;if(t===void 0&&n===void 0)return null;let r={closeIcon:typeof n!="boolean"&&n!==null?n:void 0};return t&&typeof t=="object"&&(r=Object.assign(Object.assign({},r),t)),r},[t,n])}function iwe(){const e={};for(var t=arguments.length,n=new Array(t),r=0;r{i&&Object.keys(i).forEach(o=>{i[o]!==void 0&&(e[o]=i[o])})}),e}const bAt={};function cWe(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:bAt;const r=rwe(e),i=rwe(t),o=typeof r!="boolean"?!!(r!=null&&r.disabled):!1,s=ce.useMemo(()=>Object.assign({closeIcon:ce.createElement(Ug,null)},n),[n]),a=ce.useMemo(()=>r===!1?!1:r?iwe(s,i,r):i===!1?!1:i?iwe(s,i):s.closable?s:!1,[r,i,s]);return ce.useMemo(()=>{if(a===!1)return[!1,null,o];const{closeIconRender:l}=s,{closeIcon:c}=a;let u=c;if(u!=null){l&&(u=l(c));const f=$o(a,!0);Object.keys(f).length&&(u=ce.isValidElement(u)?ce.cloneElement(u,f):ce.createElement("span",Object.assign({},f),u))}return[!0,u,o]},[a,s])}var uWe=function(t){if(Bs()&&window.document.documentElement){var n=Array.isArray(t)?t:[t],r=window.document.documentElement;return n.some(function(i){return i in r.style})}return!1},SAt=function(t,n){if(!uWe(t))return!1;var r=document.createElement("div"),i=r.style[t];return r.style[t]=n,r.style[t]!==i};function Qae(e,t){return!Array.isArray(e)&&t!==void 0?SAt(e,t):uWe(e)}const wAt=()=>Bs()&&window.document.documentElement,lV=e=>{const{prefixCls:t,className:n,style:r,size:i,shape:o}=e,s=we({[`${t}-lg`]:i==="large",[`${t}-sm`]:i==="small"}),a=we({[`${t}-circle`]:o==="circle",[`${t}-square`]:o==="square",[`${t}-round`]:o==="round"}),l=d.useMemo(()=>typeof i=="number"?{width:i,height:i,lineHeight:`${i}px`}:{},[i]);return d.createElement("span",{className:we(t,s,a,n),style:Object.assign(Object.assign({},l),r)})},xAt=new Pr("ant-skeleton-loading",{"0%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),cV=e=>({height:e,lineHeight:Ne(e)}),XS=e=>Object.assign({width:e},cV(e)),EAt=e=>({background:e.skeletonLoadingBackground,backgroundSize:"400% 100%",animationName:xAt,animationDuration:e.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite"}),qee=(e,t)=>Object.assign({width:t(e).mul(5).equal(),minWidth:t(e).mul(5).equal()},cV(e)),RAt=e=>{const{skeletonAvatarCls:t,gradientFromColor:n,controlHeight:r,controlHeightLG:i,controlHeightSM:o}=e;return{[t]:Object.assign({display:"inline-block",verticalAlign:"top",background:n},XS(r)),[`${t}${t}-circle`]:{borderRadius:"50%"},[`${t}${t}-lg`]:Object.assign({},XS(i)),[`${t}${t}-sm`]:Object.assign({},XS(o))}},$At=e=>{const{controlHeight:t,borderRadiusSM:n,skeletonInputCls:r,controlHeightLG:i,controlHeightSM:o,gradientFromColor:s,calc:a}=e;return{[r]:Object.assign({display:"inline-block",verticalAlign:"top",background:s,borderRadius:n},qee(t,a)),[`${r}-lg`]:Object.assign({},qee(i,a)),[`${r}-sm`]:Object.assign({},qee(o,a))}},owe=e=>Object.assign({width:e},cV(e)),OAt=e=>{const{skeletonImageCls:t,imageSizeBase:n,gradientFromColor:r,borderRadiusSM:i,calc:o}=e;return{[t]:Object.assign(Object.assign({display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"middle",background:r,borderRadius:i},owe(o(n).mul(2).equal())),{[`${t}-path`]:{fill:"#bfbfbf"},[`${t}-svg`]:Object.assign(Object.assign({},owe(n)),{maxWidth:o(n).mul(4).equal(),maxHeight:o(n).mul(4).equal()}),[`${t}-svg${t}-svg-circle`]:{borderRadius:"50%"}}),[`${t}${t}-circle`]:{borderRadius:"50%"}}},Kee=(e,t,n)=>{const{skeletonButtonCls:r}=e;return{[`${n}${r}-circle`]:{width:t,minWidth:t,borderRadius:"50%"},[`${n}${r}-round`]:{borderRadius:t}}},Yee=(e,t)=>Object.assign({width:t(e).mul(2).equal(),minWidth:t(e).mul(2).equal()},cV(e)),TAt=e=>{const{borderRadiusSM:t,skeletonButtonCls:n,controlHeight:r,controlHeightLG:i,controlHeightSM:o,gradientFromColor:s,calc:a}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[n]:Object.assign({display:"inline-block",verticalAlign:"top",background:s,borderRadius:t,width:a(r).mul(2).equal(),minWidth:a(r).mul(2).equal()},Yee(r,a))},Kee(e,r,n)),{[`${n}-lg`]:Object.assign({},Yee(i,a))}),Kee(e,i,`${n}-lg`)),{[`${n}-sm`]:Object.assign({},Yee(o,a))}),Kee(e,o,`${n}-sm`))},IAt=e=>{const{componentCls:t,skeletonAvatarCls:n,skeletonTitleCls:r,skeletonParagraphCls:i,skeletonButtonCls:o,skeletonInputCls:s,skeletonImageCls:a,controlHeight:l,controlHeightLG:c,controlHeightSM:u,gradientFromColor:f,padding:h,marginSM:g,borderRadius:p,titleHeight:m,blockRadius:v,paragraphLiHeight:C,controlHeightXS:y,paragraphMarginTop:b}=e;return{[t]:{display:"table",width:"100%",[`${t}-header`]:{display:"table-cell",paddingInlineEnd:h,verticalAlign:"top",[n]:Object.assign({display:"inline-block",verticalAlign:"top",background:f},XS(l)),[`${n}-circle`]:{borderRadius:"50%"},[`${n}-lg`]:Object.assign({},XS(c)),[`${n}-sm`]:Object.assign({},XS(u))},[`${t}-content`]:{display:"table-cell",width:"100%",verticalAlign:"top",[r]:{width:"100%",height:m,background:f,borderRadius:v,[`+ ${i}`]:{marginBlockStart:u}},[i]:{padding:0,"> li":{width:"100%",height:C,listStyle:"none",background:f,borderRadius:v,"+ li":{marginBlockStart:y}}},[`${i}> li:last-child:not(:first-child):not(:nth-child(2))`]:{width:"61%"}},[`&-round ${t}-content`]:{[`${r}, ${i} > li`]:{borderRadius:p}}},[`${t}-with-avatar ${t}-content`]:{[r]:{marginBlockStart:g,[`+ ${i}`]:{marginBlockStart:b}}},[`${t}${t}-element`]:Object.assign(Object.assign(Object.assign(Object.assign({display:"inline-block",width:"auto"},TAt(e)),RAt(e)),$At(e)),OAt(e)),[`${t}${t}-block`]:{width:"100%",[o]:{width:"100%"},[s]:{width:"100%"}},[`${t}${t}-active`]:{[` + ${r}, + ${i} > li, + ${n}, + ${o}, + ${s}, + ${a} + `]:Object.assign({},EAt(e))}}},MAt=e=>{const{colorFillContent:t,colorFill:n}=e,r=t,i=n;return{color:r,colorGradientEnd:i,gradientFromColor:r,gradientToColor:i,titleHeight:e.controlHeight/2,blockRadius:e.borderRadiusSM,paragraphMarginTop:e.marginLG+e.marginXXS,paragraphLiHeight:e.controlHeight/2}},Ux=Yr("Skeleton",e=>{const{componentCls:t,calc:n}=e,r=yr(e,{skeletonAvatarCls:`${t}-avatar`,skeletonTitleCls:`${t}-title`,skeletonParagraphCls:`${t}-paragraph`,skeletonButtonCls:`${t}-button`,skeletonInputCls:`${t}-input`,skeletonImageCls:`${t}-image`,imageSizeBase:n(e.controlHeight).mul(1.5).equal(),borderRadius:100,skeletonLoadingBackground:`linear-gradient(90deg, ${e.gradientFromColor} 25%, ${e.gradientToColor} 37%, ${e.gradientFromColor} 63%)`,skeletonLoadingMotionDuration:"1.4s"});return[IAt(r)]},MAt,{deprecatedTokens:[["color","gradientFromColor"],["colorGradientEnd","gradientToColor"]]}),PAt=e=>{const{prefixCls:t,className:n,rootClassName:r,active:i,shape:o="circle",size:s="default"}=e,{getPrefixCls:a}=d.useContext(vn),l=a("skeleton",t),[c,u,f]=Ux(l),h=$i(e,["prefixCls","className"]),g=we(l,`${l}-element`,{[`${l}-active`]:i},n,r,u,f);return c(d.createElement("div",{className:g},d.createElement(lV,Object.assign({prefixCls:`${l}-avatar`,shape:o,size:s},h))))},_At=e=>{const{prefixCls:t,className:n,rootClassName:r,active:i,block:o=!1,size:s="default"}=e,{getPrefixCls:a}=d.useContext(vn),l=a("skeleton",t),[c,u,f]=Ux(l),h=$i(e,["prefixCls"]),g=we(l,`${l}-element`,{[`${l}-active`]:i,[`${l}-block`]:o},n,r,u,f);return c(d.createElement("div",{className:g},d.createElement(lV,Object.assign({prefixCls:`${l}-button`,size:s},h))))},AAt="M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",DAt=e=>{const{prefixCls:t,className:n,rootClassName:r,style:i,active:o}=e,{getPrefixCls:s}=d.useContext(vn),a=s("skeleton",t),[l,c,u]=Ux(a),f=we(a,`${a}-element`,{[`${a}-active`]:o},n,r,c,u);return l(d.createElement("div",{className:f},d.createElement("div",{className:we(`${a}-image`,n),style:i},d.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:`${a}-image-svg`},d.createElement("title",null,"Image placeholder"),d.createElement("path",{d:AAt,className:`${a}-image-path`})))))},LAt=e=>{const{prefixCls:t,className:n,rootClassName:r,active:i,block:o,size:s="default"}=e,{getPrefixCls:a}=d.useContext(vn),l=a("skeleton",t),[c,u,f]=Ux(l),h=$i(e,["prefixCls"]),g=we(l,`${l}-element`,{[`${l}-active`]:i,[`${l}-block`]:o},n,r,u,f);return c(d.createElement("div",{className:g},d.createElement(lV,Object.assign({prefixCls:`${l}-input`,size:s},h))))},FAt=e=>{const{prefixCls:t,className:n,rootClassName:r,style:i,active:o,children:s}=e,{getPrefixCls:a}=d.useContext(vn),l=a("skeleton",t),[c,u,f]=Ux(l),h=we(l,`${l}-element`,{[`${l}-active`]:o},u,n,r,f);return c(d.createElement("div",{className:h},d.createElement("div",{className:we(`${l}-image`,n),style:i},s)))},NAt=(e,t)=>{const{width:n,rows:r=2}=t;if(Array.isArray(n))return n[e];if(r-1===e)return n},kAt=e=>{const{prefixCls:t,className:n,style:r,rows:i}=e,o=ut(new Array(i)).map((s,a)=>d.createElement("li",{key:a,style:{width:NAt(a,e)}}));return d.createElement("ul",{className:we(t,n),style:r},o)},zAt=e=>{let{prefixCls:t,className:n,width:r,style:i}=e;return d.createElement("h3",{className:we(t,n),style:Object.assign({width:r},i)})};function Xee(e){return e&&typeof e=="object"?e:{}}function BAt(e,t){return e&&!t?{size:"large",shape:"square"}:{size:"large",shape:"circle"}}function HAt(e,t){return!e&&t?{width:"38%"}:e&&t?{width:"50%"}:{}}function jAt(e,t){const n={};return(!e||!t)&&(n.width="61%"),!e&&t?n.rows=3:n.rows=2,n}const yu=e=>{const{prefixCls:t,loading:n,className:r,rootClassName:i,style:o,children:s,avatar:a=!1,title:l=!0,paragraph:c=!0,active:u,round:f}=e,{getPrefixCls:h,direction:g,skeleton:p}=d.useContext(vn),m=h("skeleton",t),[v,C,y]=Ux(m);if(n||!("loading"in e)){const b=!!a,S=!!l,w=!!c;let x;if(b){const O=Object.assign(Object.assign({prefixCls:`${m}-avatar`},BAt(S,w)),Xee(a));x=d.createElement("div",{className:`${m}-header`},d.createElement(lV,Object.assign({},O)))}let E;if(S||w){let O;if(S){const M=Object.assign(Object.assign({prefixCls:`${m}-title`},HAt(b,w)),Xee(l));O=d.createElement(zAt,Object.assign({},M))}let T;if(w){const M=Object.assign(Object.assign({prefixCls:`${m}-paragraph`},jAt(b,S)),Xee(c));T=d.createElement(kAt,Object.assign({},M))}E=d.createElement("div",{className:`${m}-content`},O,T)}const R=we(m,{[`${m}-with-avatar`]:b,[`${m}-active`]:u,[`${m}-rtl`]:g==="rtl",[`${m}-round`]:f},p==null?void 0:p.className,r,i,C,y);return v(d.createElement("div",{className:R,style:Object.assign(Object.assign({},p==null?void 0:p.style),o)},x,E))}return s??null};yu.Button=_At;yu.Avatar=PAt;yu.Input=LAt;yu.Image=DAt;yu.Node=FAt;function swe(){}const VAt=d.createContext({add:swe,remove:swe});function GAt(e){const t=d.useContext(VAt),n=d.useRef(null);return Hn(i=>{if(i){const o=e?i.querySelector(e):i;t.add(o),n.current=o}else t.remove(n.current)})}const awe=()=>{const{cancelButtonProps:e,cancelTextLocale:t,onCancel:n}=d.useContext(JI);return ce.createElement(Cr,Object.assign({onClick:n},e),t)},lwe=()=>{const{confirmLoading:e,okButtonProps:t,okType:n,okTextLocale:r,onOk:i}=d.useContext(JI);return ce.createElement(Cr,Object.assign({},NGe(n),{loading:e,onClick:i},t),r)};function dWe(e,t){return ce.createElement("span",{className:`${e}-close-x`},t||ce.createElement(Ug,{className:`${e}-close-icon`}))}const fWe=e=>{const{okText:t,okType:n="primary",cancelText:r,confirmLoading:i,onOk:o,onCancel:s,okButtonProps:a,cancelButtonProps:l,footer:c}=e,[u]=ih("Modal",HVe()),f=t||(u==null?void 0:u.okText),h=r||(u==null?void 0:u.cancelText),g={confirmLoading:i,okButtonProps:a,cancelButtonProps:l,okTextLocale:f,cancelTextLocale:h,okType:n,onOk:o,onCancel:s},p=ce.useMemo(()=>g,ut(Object.values(g)));let m;return typeof c=="function"||typeof c>"u"?(m=ce.createElement(ce.Fragment,null,ce.createElement(awe,null),ce.createElement(lwe,null)),typeof c=="function"&&(m=c(m,{OkBtn:lwe,CancelBtn:awe})),m=ce.createElement(QGe,{value:p},m)):m=c,ce.createElement(Gge,{disabled:!1},m)},WAt=e=>{const{componentCls:t}=e;return{[t]:{display:"flex",flexFlow:"row wrap",minWidth:0,"&::before, &::after":{display:"flex"},"&-no-wrap":{flexWrap:"nowrap"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"},"&-space-between":{justifyContent:"space-between"},"&-space-around":{justifyContent:"space-around"},"&-space-evenly":{justifyContent:"space-evenly"},"&-top":{alignItems:"flex-start"},"&-middle":{alignItems:"center"},"&-bottom":{alignItems:"flex-end"}}}},UAt=e=>{const{componentCls:t}=e;return{[t]:{position:"relative",maxWidth:"100%",minHeight:1}}},qAt=(e,t)=>{const{prefixCls:n,componentCls:r,gridColumns:i}=e,o={};for(let s=i;s>=0;s--)s===0?(o[`${r}${t}-${s}`]={display:"none"},o[`${r}-push-${s}`]={insetInlineStart:"auto"},o[`${r}-pull-${s}`]={insetInlineEnd:"auto"},o[`${r}${t}-push-${s}`]={insetInlineStart:"auto"},o[`${r}${t}-pull-${s}`]={insetInlineEnd:"auto"},o[`${r}${t}-offset-${s}`]={marginInlineStart:0},o[`${r}${t}-order-${s}`]={order:0}):(o[`${r}${t}-${s}`]=[{"--ant-display":"block",display:"block"},{display:"var(--ant-display)",flex:`0 0 ${s/i*100}%`,maxWidth:`${s/i*100}%`}],o[`${r}${t}-push-${s}`]={insetInlineStart:`${s/i*100}%`},o[`${r}${t}-pull-${s}`]={insetInlineEnd:`${s/i*100}%`},o[`${r}${t}-offset-${s}`]={marginInlineStart:`${s/i*100}%`},o[`${r}${t}-order-${s}`]={order:s});return o[`${r}${t}-flex`]={flex:`var(--${n}${t}-flex)`},o},Zae=(e,t)=>qAt(e,t),KAt=(e,t,n)=>({[`@media (min-width: ${Ne(t)})`]:Object.assign({},Zae(e,n))}),YAt=()=>({}),XAt=()=>({}),QAt=Yr("Grid",WAt,YAt),hWe=e=>({xs:e.screenXSMin,sm:e.screenSMMin,md:e.screenMDMin,lg:e.screenLGMin,xl:e.screenXLMin,xxl:e.screenXXLMin}),ZAt=Yr("Grid",e=>{const t=yr(e,{gridColumns:24}),n=hWe(t);return delete n.xs,[UAt(t),Zae(t,""),Zae(t,"-xs"),Object.keys(n).map(r=>KAt(t,n[r],`-${r}`)).reduce((r,i)=>Object.assign(Object.assign({},r),i),{})]},XAt);function cwe(e){return{position:e,inset:0}}const gWe=e=>{const{componentCls:t,antCls:n}=e;return[{[`${t}-root`]:{[`${t}${n}-zoom-enter, ${t}${n}-zoom-appear`]:{transform:"none",opacity:0,animationDuration:e.motionDurationSlow,userSelect:"none"},[`${t}${n}-zoom-leave ${t}-content`]:{pointerEvents:"none"},[`${t}-mask`]:Object.assign(Object.assign({},cwe("fixed")),{zIndex:e.zIndexPopupBase,height:"100%",backgroundColor:e.colorBgMask,pointerEvents:"none",[`${t}-hidden`]:{display:"none"}}),[`${t}-wrap`]:Object.assign(Object.assign({},cwe("fixed")),{zIndex:e.zIndexPopupBase,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"})}},{[`${t}-root`]:npe(e)}]},JAt=e=>{const{componentCls:t}=e;return[{[`${t}-root`]:{[`${t}-wrap-rtl`]:{direction:"rtl"},[`${t}-centered`]:{textAlign:"center","&::before":{display:"inline-block",width:0,height:"100%",verticalAlign:"middle",content:'""'},[t]:{top:0,display:"inline-block",paddingBottom:0,textAlign:"start",verticalAlign:"middle"}},[`@media (max-width: ${e.screenSMMax}px)`]:{[t]:{maxWidth:"calc(100vw - 16px)",margin:`${Ne(e.marginXS)} auto`},[`${t}-centered`]:{[t]:{flex:1}}}}},{[t]:Object.assign(Object.assign({},ii(e)),{pointerEvents:"none",position:"relative",top:100,width:"auto",maxWidth:`calc(100vw - ${Ne(e.calc(e.margin).mul(2).equal())})`,margin:"0 auto",paddingBottom:e.paddingLG,[`${t}-title`]:{margin:0,color:e.titleColor,fontWeight:e.fontWeightStrong,fontSize:e.titleFontSize,lineHeight:e.titleLineHeight,wordWrap:"break-word"},[`${t}-content`]:{position:"relative",backgroundColor:e.contentBg,backgroundClip:"padding-box",border:0,borderRadius:e.borderRadiusLG,boxShadow:e.boxShadow,pointerEvents:"auto",padding:e.contentPadding},[`${t}-close`]:Object.assign({position:"absolute",top:e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),insetInlineEnd:e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),zIndex:e.calc(e.zIndexPopupBase).add(10).equal(),padding:0,color:e.modalCloseIconColor,fontWeight:e.fontWeightStrong,lineHeight:1,textDecoration:"none",background:"transparent",borderRadius:e.borderRadiusSM,width:e.modalCloseBtnSize,height:e.modalCloseBtnSize,border:0,outline:0,cursor:"pointer",transition:`color ${e.motionDurationMid}, background-color ${e.motionDurationMid}`,"&-x":{display:"flex",fontSize:e.fontSizeLG,fontStyle:"normal",lineHeight:Ne(e.modalCloseBtnSize),justifyContent:"center",textTransform:"none",textRendering:"auto"},"&:disabled":{pointerEvents:"none"},"&:hover":{color:e.modalCloseIconHoverColor,backgroundColor:e.colorBgTextHover,textDecoration:"none"},"&:active":{backgroundColor:e.colorBgTextActive}},Yf(e)),[`${t}-header`]:{color:e.colorText,background:e.headerBg,borderRadius:`${Ne(e.borderRadiusLG)} ${Ne(e.borderRadiusLG)} 0 0`,marginBottom:e.headerMarginBottom,padding:e.headerPadding,borderBottom:e.headerBorderBottom},[`${t}-body`]:{fontSize:e.fontSize,lineHeight:e.lineHeight,wordWrap:"break-word",padding:e.bodyPadding,[`${t}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",margin:`${Ne(e.margin)} auto`}},[`${t}-footer`]:{textAlign:"end",background:e.footerBg,marginTop:e.footerMarginTop,padding:e.footerPadding,borderTop:e.footerBorderTop,borderRadius:e.footerBorderRadius,[`> ${e.antCls}-btn + ${e.antCls}-btn`]:{marginInlineStart:e.marginXS}},[`${t}-open`]:{overflow:"hidden"}})},{[`${t}-pure-panel`]:{top:"auto",padding:0,display:"flex",flexDirection:"column",[`${t}-content, + ${t}-body, + ${t}-confirm-body-wrapper`]:{display:"flex",flexDirection:"column",flex:"auto"},[`${t}-confirm-body`]:{marginBottom:"auto"}}}]},eDt=e=>{const{componentCls:t}=e;return{[`${t}-root`]:{[`${t}-wrap-rtl`]:{direction:"rtl",[`${t}-confirm-body`]:{direction:"rtl"}}}}},tDt=e=>{const{componentCls:t}=e,n=hWe(e);delete n.xs;const r=Object.keys(n).map(i=>({[`@media (min-width: ${Ne(n[i])})`]:{width:`var(--${t.replace(".","")}-${i}-width)`}}));return{[`${t}-root`]:{[t]:[{width:`var(--${t.replace(".","")}-xs-width)`}].concat(ut(r))}}},pWe=e=>{const t=e.padding,n=e.fontSizeHeading5,r=e.lineHeightHeading5;return yr(e,{modalHeaderHeight:e.calc(e.calc(r).mul(n).equal()).add(e.calc(t).mul(2).equal()).equal(),modalFooterBorderColorSplit:e.colorSplit,modalFooterBorderStyle:e.lineType,modalFooterBorderWidth:e.lineWidth,modalCloseIconColor:e.colorIcon,modalCloseIconHoverColor:e.colorIconHover,modalCloseBtnSize:e.controlHeight,modalConfirmIconSize:e.fontHeight,modalTitleHeight:e.calc(e.titleFontSize).mul(e.titleLineHeight).equal()})},mWe=e=>({footerBg:"transparent",headerBg:e.colorBgElevated,titleLineHeight:e.lineHeightHeading5,titleFontSize:e.fontSizeHeading5,contentBg:e.colorBgElevated,titleColor:e.colorTextHeading,contentPadding:e.wireframe?0:`${Ne(e.paddingMD)} ${Ne(e.paddingContentHorizontalLG)}`,headerPadding:e.wireframe?`${Ne(e.padding)} ${Ne(e.paddingLG)}`:0,headerBorderBottom:e.wireframe?`${Ne(e.lineWidth)} ${e.lineType} ${e.colorSplit}`:"none",headerMarginBottom:e.wireframe?0:e.marginXS,bodyPadding:e.wireframe?e.paddingLG:0,footerPadding:e.wireframe?`${Ne(e.paddingXS)} ${Ne(e.padding)}`:0,footerBorderTop:e.wireframe?`${Ne(e.lineWidth)} ${e.lineType} ${e.colorSplit}`:"none",footerBorderRadius:e.wireframe?`0 0 ${Ne(e.borderRadiusLG)} ${Ne(e.borderRadiusLG)}`:0,footerMarginTop:e.wireframe?0:e.marginSM,confirmBodyPadding:e.wireframe?`${Ne(e.padding*2)} ${Ne(e.padding*2)} ${Ne(e.paddingLG)}`:0,confirmIconMarginInlineEnd:e.wireframe?e.margin:e.marginSM,confirmBtnsMarginTop:e.wireframe?e.marginLG:e.marginSM}),vWe=Yr("Modal",e=>{const t=pWe(e);return[JAt(t),eDt(t),gWe(t),Wx(t,"zoom"),tDt(t)]},mWe,{unitless:{titleLineHeight:!0}});var nDt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i{Jae={x:e.pageX,y:e.pageY},setTimeout(()=>{Jae=null},100)};wAt()&&document.documentElement.addEventListener("click",rDt,!0);const CWe=e=>{var t;const{getPopupContainer:n,getPrefixCls:r,direction:i,modal:o}=d.useContext(vn),s=q=>{const{onCancel:X}=e;X==null||X(q)},a=q=>{const{onOk:X}=e;X==null||X(q)},{prefixCls:l,className:c,rootClassName:u,open:f,wrapClassName:h,centered:g,getContainer:p,focusTriggerAfterClose:m=!0,style:v,visible:C,width:y=520,footer:b,classNames:S,styles:w,children:x,loading:E}=e,R=nDt(e,["prefixCls","className","rootClassName","open","wrapClassName","centered","getContainer","focusTriggerAfterClose","style","visible","width","footer","classNames","styles","children","loading"]),O=r("modal",l),T=r(),M=Oo(O),[_,F,D]=vWe(O,M),k=we(h,{[`${O}-centered`]:!!g,[`${O}-wrap-rtl`]:i==="rtl"}),L=b!==null&&!E?d.createElement(fWe,Object.assign({},e,{onOk:a,onCancel:s})):null,[I,A,N]=cWe(qz(e),qz(o),{closable:!0,closeIcon:d.createElement(Ug,{className:`${O}-close-icon`}),closeIconRender:q=>dWe(O,q)}),B=GAt(`.${O}-content`),[z,j]=y3("Modal",R.zIndex),[W,G]=d.useMemo(()=>y&&typeof y=="object"?[void 0,y]:[y,void 0],[y]),K=d.useMemo(()=>{const q={};return G&&Object.keys(G).forEach(X=>{const Q=G[X];Q!==void 0&&(q[`--${O}-${X}-width`]=typeof Q=="number"?`${Q}px`:Q)}),q},[G]);return _(d.createElement(kC,{form:!0,space:!0},d.createElement(Uj.Provider,{value:j},d.createElement(oV,Object.assign({width:W},R,{zIndex:z,getContainer:p===void 0?n:p,prefixCls:O,rootClassName:we(F,u,D,M),footer:L,visible:f??C,mousePosition:(t=R.mousePosition)!==null&&t!==void 0?t:Jae,onClose:s,closable:I&&{disabled:N,closeIcon:A},closeIcon:A,focusTriggerAfterClose:m,transitionName:Cu(T,"zoom",e.transitionName),maskTransitionName:Cu(T,"fade",e.maskTransitionName),className:we(F,c,o==null?void 0:o.className),style:Object.assign(Object.assign(Object.assign({},o==null?void 0:o.style),v),K),classNames:Object.assign(Object.assign(Object.assign({},o==null?void 0:o.classNames),S),{wrapper:we(k,S==null?void 0:S.wrapper)}),styles:Object.assign(Object.assign({},o==null?void 0:o.styles),w),panelRef:B}),E?d.createElement(yu,{active:!0,title:!1,paragraph:{rows:4},className:`${O}-body-skeleton`}):x))))},iDt=e=>{const{componentCls:t,titleFontSize:n,titleLineHeight:r,modalConfirmIconSize:i,fontSize:o,lineHeight:s,modalTitleHeight:a,fontHeight:l,confirmBodyPadding:c}=e,u=`${t}-confirm`;return{[u]:{"&-rtl":{direction:"rtl"},[`${e.antCls}-modal-header`]:{display:"none"},[`${u}-body-wrapper`]:Object.assign({},$m()),[`&${t} ${t}-body`]:{padding:c},[`${u}-body`]:{display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${e.iconCls}`]:{flex:"none",fontSize:i,marginInlineEnd:e.confirmIconMarginInlineEnd,marginTop:e.calc(e.calc(l).sub(i).equal()).div(2).equal()},[`&-has-title > ${e.iconCls}`]:{marginTop:e.calc(e.calc(a).sub(i).equal()).div(2).equal()}},[`${u}-paragraph`]:{display:"flex",flexDirection:"column",flex:"auto",rowGap:e.marginXS,maxWidth:`calc(100% - ${Ne(e.marginSM)})`},[`${e.iconCls} + ${u}-paragraph`]:{maxWidth:`calc(100% - ${Ne(e.calc(e.modalConfirmIconSize).add(e.marginSM).equal())})`},[`${u}-title`]:{color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:n,lineHeight:r},[`${u}-content`]:{color:e.colorText,fontSize:o,lineHeight:s},[`${u}-btns`]:{textAlign:"end",marginTop:e.confirmBtnsMarginTop,[`${e.antCls}-btn + ${e.antCls}-btn`]:{marginBottom:0,marginInlineStart:e.marginXS}}},[`${u}-error ${u}-body > ${e.iconCls}`]:{color:e.colorError},[`${u}-warning ${u}-body > ${e.iconCls}, + ${u}-confirm ${u}-body > ${e.iconCls}`]:{color:e.colorWarning},[`${u}-info ${u}-body > ${e.iconCls}`]:{color:e.colorInfo},[`${u}-success ${u}-body > ${e.iconCls}`]:{color:e.colorSuccess}}},oDt=Hx(["Modal","confirm"],e=>{const t=pWe(e);return[iDt(t)]},mWe,{order:-1e3});var sDt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);iy,ut(Object.values(y))),S=d.createElement(d.Fragment,null,d.createElement(NSe,null),d.createElement(kSe,null)),w=e.title!==void 0&&e.title!==null,x=`${o}-body`;return d.createElement("div",{className:`${o}-body-wrapper`},d.createElement("div",{className:we(x,{[`${x}-has-title`]:w})},f,d.createElement("div",{className:`${o}-paragraph`},w&&d.createElement("span",{className:`${o}-title`},e.title),d.createElement("div",{className:`${o}-content`},e.content))),l===void 0||typeof l=="function"?d.createElement(QGe,{value:b},d.createElement("div",{className:`${o}-btns`},typeof l=="function"?l(S,{OkBtn:kSe,CancelBtn:NSe}):S)):l,d.createElement(oDt,{prefixCls:t}))}const aDt=e=>{const{close:t,zIndex:n,maskStyle:r,direction:i,prefixCls:o,wrapClassName:s,rootPrefixCls:a,bodyStyle:l,closable:c=!1,onConfirm:u,styles:f}=e,h=`${o}-confirm`,g=e.width||416,p=e.style||{},m=e.mask===void 0?!0:e.mask,v=e.maskClosable===void 0?!1:e.maskClosable,C=we(h,`${h}-${e.type}`,{[`${h}-rtl`]:i==="rtl"},e.className),[,y]=za(),b=d.useMemo(()=>n!==void 0?n:y.zIndexPopupBase+Jge,[n,y]);return d.createElement(CWe,Object.assign({},e,{className:C,wrapClassName:we({[`${h}-centered`]:!!e.centered},s),onCancel:()=>{t==null||t({triggerCancel:!0}),u==null||u(!1)},title:"",footer:null,transitionName:Cu(a||"","zoom",e.transitionName),maskTransitionName:Cu(a||"","fade",e.maskTransitionName),mask:m,maskClosable:v,style:p,styles:Object.assign({body:l,mask:r},f),width:g,zIndex:b,closable:c}),d.createElement(yWe,Object.assign({},e,{confirmPrefixCls:h})))},bWe=e=>{const{rootPrefixCls:t,iconPrefixCls:n,direction:r,theme:i}=e;return d.createElement(Wg,{prefixCls:t,iconPrefixCls:n,direction:r,theme:i},d.createElement(aDt,Object.assign({},e)))},I8=[];let SWe="";function wWe(){return SWe}const lDt=e=>{var t,n;const{prefixCls:r,getContainer:i,direction:o}=e,s=HVe(),a=d.useContext(vn),l=wWe()||a.getPrefixCls(),c=r||`${l}-modal`;let u=i;return u===!1&&(u=void 0),ce.createElement(bWe,Object.assign({},e,{rootPrefixCls:l,prefixCls:c,iconPrefixCls:a.iconPrefixCls,theme:a.theme,direction:o??a.direction,locale:(n=(t=a.locale)===null||t===void 0?void 0:t.Modal)!==null&&n!==void 0?n:s,getContainer:u}))};function tM(e){const t=CGe(),n=document.createDocumentFragment();let r=Object.assign(Object.assign({},e),{close:l,open:!0}),i,o;function s(){for(var u,f=arguments.length,h=new Array(f),g=0;gv==null?void 0:v.triggerCancel)){var m;(u=e.onCancel)===null||u===void 0||(m=u).call.apply(m,[e,()=>{}].concat(ut(h.slice(1))))}for(let v=0;v{const f=t.getPrefixCls(void 0,wWe()),h=t.getIconPrefixCls(),g=t.getTheme(),p=ce.createElement(lDt,Object.assign({},u));o=tpe()(ce.createElement(Wg,{prefixCls:f,iconPrefixCls:h,theme:g},t.holderRender?t.holderRender(p):p),n)})}function l(){for(var u=arguments.length,f=new Array(u),h=0;h{typeof e.afterClose=="function"&&e.afterClose(),s.apply(this,f)}}),r.visible&&delete r.visible,a(r)}function c(u){typeof u=="function"?r=u(r):r=Object.assign(Object.assign({},r),u),a(r)}return a(r),I8.push(l),{destroy:l,update:c}}function xWe(e){return Object.assign(Object.assign({},e),{type:"warning"})}function EWe(e){return Object.assign(Object.assign({},e),{type:"info"})}function RWe(e){return Object.assign(Object.assign({},e),{type:"success"})}function $We(e){return Object.assign(Object.assign({},e),{type:"error"})}function OWe(e){return Object.assign(Object.assign({},e),{type:"confirm"})}function cDt(e){let{rootPrefixCls:t}=e;SWe=t}var uDt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i{var n,{afterClose:r,config:i}=e,o=uDt(e,["afterClose","config"]);const[s,a]=d.useState(!0),[l,c]=d.useState(i),{direction:u,getPrefixCls:f}=d.useContext(vn),h=f("modal"),g=f(),p=()=>{var y;r(),(y=l.afterClose)===null||y===void 0||y.call(l)},m=function(){var y;a(!1);for(var b=arguments.length,S=new Array(b),w=0;wR==null?void 0:R.triggerCancel)){var E;(y=l.onCancel)===null||y===void 0||(E=y).call.apply(E,[l,()=>{}].concat(ut(S.slice(1))))}};d.useImperativeHandle(t,()=>({destroy:m,update:y=>{c(b=>Object.assign(Object.assign({},b),y))}}));const v=(n=l.okCancel)!==null&&n!==void 0?n:l.type==="confirm",[C]=ih("Modal",yd.Modal);return d.createElement(bWe,Object.assign({prefixCls:h,rootPrefixCls:g},l,{close:m,open:s,afterClose:p,okText:l.okText||(v?C==null?void 0:C.okText:C==null?void 0:C.justOkText),direction:l.direction||u,cancelText:l.cancelText||(C==null?void 0:C.cancelText)},o))},fDt=d.forwardRef(dDt);let uwe=0;const hDt=d.memo(d.forwardRef((e,t)=>{const[n,r]=QIt();return d.useImperativeHandle(t,()=>({patchElement:r}),[]),d.createElement(d.Fragment,null,n)}));function TWe(){const e=d.useRef(null),[t,n]=d.useState([]);d.useEffect(()=>{t.length&&(ut(t).forEach(s=>{s()}),n([]))},[t]);const r=d.useCallback(o=>function(a){var l;uwe+=1;const c=d.createRef();let u;const f=new Promise(v=>{u=v});let h=!1,g;const p=d.createElement(fDt,{key:`modal-${uwe}`,config:o(a),ref:c,afterClose:()=>{g==null||g()},isSilent:()=>h,onConfirm:v=>{u(v)}});return g=(l=e.current)===null||l===void 0?void 0:l.patchElement(p),g&&I8.push(g),{destroy:()=>{function v(){var C;(C=c.current)===null||C===void 0||C.destroy()}c.current?v():n(C=>[].concat(ut(C),[v]))},update:v=>{function C(){var y;(y=c.current)===null||y===void 0||y.update(v)}c.current?C():n(y=>[].concat(ut(y),[C]))},then:v=>(h=!0,f.then(v))}},[]);return[d.useMemo(()=>({info:r(EWe),success:r(RWe),error:r($We),warning:r(xWe),confirm:r(OWe)}),[]),d.createElement(hDt,{key:"modal-holder",ref:e})]}const gDt=e=>{const{componentCls:t,notificationMarginEdge:n,animationMaxHeight:r}=e,i=`${t}-notice`,o=new Pr("antNotificationFadeIn",{"0%":{transform:"translate3d(100%, 0, 0)",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",opacity:1}}),s=new Pr("antNotificationTopFadeIn",{"0%":{top:-r,opacity:0},"100%":{top:0,opacity:1}}),a=new Pr("antNotificationBottomFadeIn",{"0%":{bottom:e.calc(r).mul(-1).equal(),opacity:0},"100%":{bottom:0,opacity:1}}),l=new Pr("antNotificationLeftFadeIn",{"0%":{transform:"translate3d(-100%, 0, 0)",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",opacity:1}});return{[t]:{[`&${t}-top, &${t}-bottom`]:{marginInline:0,[i]:{marginInline:"auto auto"}},[`&${t}-top`]:{[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationName:s}},[`&${t}-bottom`]:{[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationName:a}},[`&${t}-topRight, &${t}-bottomRight`]:{[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationName:o}},[`&${t}-topLeft, &${t}-bottomLeft`]:{marginRight:{value:0,_skip_check_:!0},marginLeft:{value:n,_skip_check_:!0},[i]:{marginInlineEnd:"auto",marginInlineStart:0},[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationName:l}}}}},pDt=["top","topLeft","topRight","bottom","bottomLeft","bottomRight"],mDt={topLeft:"left",topRight:"right",bottomLeft:"left",bottomRight:"right",top:"left",bottom:"left"},vDt=(e,t)=>{const{componentCls:n}=e;return{[`${n}-${t}`]:{[`&${n}-stack > ${n}-notice-wrapper`]:{[t.startsWith("top")?"top":"bottom"]:0,[mDt[t]]:{value:0,_skip_check_:!0}}}}},CDt=e=>{const t={};for(let n=1;n