UNPKG

jordium-gantt-vue3

Version:

A Vue 3 Gantt chart component for project management, task scheduling, resource planning, calendar, resource usage and timeline visualization.

39,445 lines 1.74 MB
var hT = Object.defineProperty;
var gT = (n, t, e) => t in n ? hT(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
var sn = (n, t, e) => gT(n, typeof t != "symbol" ? t + "" : t, e);
import { defineComponent as hn, ref as me, computed as ce, inject as Mr, watch as Gt, openBlock as $, createElementBlock as ee, createElementVNode as _, toDisplayString as Ee, unref as Te, withDirectives as us, vModelText as Qi, withModifiers as dn, Fragment as St, createTextVNode as fn, createCommentVNode as vt, nextTick as An, onMounted as sA, onUnmounted as ga, createBlock as Ir, Teleport as es, normalizeStyle as Mt, normalizeClass as tr, renderList as nr, createVNode as na, createStaticVNode as Il, resolveDynamicComponent as ro, renderSlot as Nn, h as is, useSlots as Jl, toRef as Bm, withCtx as qa, mergeProps as XA, shallowRef as fi, provide as Tn, isMemoSame as vT, createSlots as hi, normalizeProps as qs, onUpdated as pT, guardReactiveProps as So, reactive as Gl, Transition as bm, vModelSelect as xu, withKeys as i5, onBeforeUnmount as mT } from "vue";
const fd = hn({
  name: "TaskListDynamicRenderer",
  props: {
    render: {
      type: Function,
      required: !0
    }
  },
  render() {
    return this.render();
  }
}), hd = {
  "zh-CN": {
    dateNotSet: "未设置",
    // TaskList Header
    taskName: "任务名称",
    resourceName: "资源名称",
    predecessor: "前置任务",
    assignee: "分配人",
    startDate: "开始日期",
    endDate: "结束日期",
    plannedStartDate: "预计开始日期",
    plannedEndDate: "预计结束日期",
    actualStartDate: "实际开始日期",
    actualEndDate: "实际结束日期",
    childrenEarliestStart: "子任务最早开始",
    childrenLatestEnd: "子任务最晚结束",
    childrenOverflow: "子任务已超出父级计划范围",
    estimatedHours: "预计工时(hr)",
    actualHours: "实际工时(hr)",
    progress: "进度",
    type: "类型",
    description: "描述",
    // CSV Export Headers(去除重复,仅保留引用)
    csvHeaders: {
      id: "ID",
      taskName: "任务名称",
      predecessor: "前置任务",
      assignee: "分配人",
      startDate: "开始日期",
      endDate: "结束日期",
      plannedStartDate: "预计开始日期",
      plannedEndDate: "预计结束日期",
      actualStartDate: "实际开始日期",
      actualEndDate: "实际结束日期",
      estimatedHours: "预计工时(hr)",
      actualHours: "实际工时(hr)",
      progress: "进度(%)",
      type: "类型",
      description: "描述"
    },
    // 日期格式
    yearMonthFormat: (n, t) => `${n}年${String(t).padStart(2, "0")}月`,
    // 月份格式
    monthFormat: (n) => `${n}月`,
    // 月份名称
    monthNames: [
      "一月",
      "二月",
      "三月",
      "四月",
      "五月",
      "六月",
      "七月",
      "八月",
      "九月",
      "十月",
      "十一月",
      "十二月"
    ],
    weekDays: ["日", "一", "二", "三", "四", "五", "六"],
    // 其他
    milestone: "里程碑",
    targetDate: "目标日期",
    today: "今天",
    // 里程碑对话框
    milestoneDetails: "里程碑详情",
    milestoneName: "里程碑名称",
    milestoneDate: "里程碑日期",
    milestoneIcon: "里程碑图标",
    diamond: "菱形",
    rocket: "火箭",
    enterMilestoneName: "请输入里程碑名称",
    enterAssignee: "请输入负责人",
    enterDescription: "请输入描述信息",
    milestoneNameRequired: "里程碑名称为必填项",
    milestoneDateRequired: "里程碑日期为必填项",
    save: "保存",
    close: "关闭",
    confirm: "确认",
    delete: "删除",
    confirmDelete: "确定要删除这个里程碑吗?",
    // 工具栏按钮
    addTask: "新增需求/任务",
    addMilestone: "新增里程碑",
    todayLocate: "今日",
    todayLocateTooltip: "定位到今天",
    exportCsv: "导出 CSV",
    exportPdf: "导出 PDF",
    expandAll: "全部展开",
    collapseAll: "全部折叠",
    // v1.9.0 视图模式
    taskView: "任务视图",
    // v1.12.5 日历/资源工时视图
    calendarView: "日历视图",
    resourceUsageView: "资源利用率",
    language: "中文",
    languageTooltip: "选择语言",
    lightMode: "明亮模式",
    darkMode: "暗黑模式",
    fullscreen: "全屏",
    exitFullscreen: "退出全屏",
    githubDocs: "查看Github文档",
    giteeDocs: "查看Gitee文档",
    // 时间刻度按钮
    timeScaleHour: "时",
    timeScaleDay: "日",
    timeScaleWeek: "周",
    timeScaleMonth: "月",
    timeScaleQuarter: "季",
    timeScaleYear: "年",
    timeScaleTooltip: "切换时间刻度",
    halfYearFirst: "上半年",
    halfYearSecond: "下半年",
    // 确认对话框
    confirmDialogMessage: "是否需要保留该设置?",
    // 新建任务对话框
    newTask: "新建任务",
    taskNamePlaceholder: "请输入任务名称",
    assigneePlaceholder: "请输入负责人",
    progressPlaceholder: "0-100",
    hoursPlaceholder: "工时",
    descriptionPlaceholder: "请输入任务描述...",
    hours: "小时",
    create: "创建",
    taskNameRequired: "任务名称不能为空",
    startDateRequired: "开始日期不能为空",
    endDateRequired: "结束日期不能为空",
    endDateInvalid: "结束日期不能早于开始日期",
    plannedStartDateRequired: "预计开始日期不能为空",
    plannedEndDateRequired: "预计结束日期不能为空",
    plannedEndDateInvalid: "预计结束日期不能早于预计开始日期",
    actualEndDateInvalid: "实际结束日期不能早于实际开始日期",
    // 任务状态
    statusPending: "待处理",
    statusOngoing: "进行中",
    statusDelayed: "已逾期",
    statusCompleted: "已完成",
    // 新建里程碑对话框
    newMilestone: "新建里程碑",
    editMilestone: "编辑里程碑",
    cancel: "取消",
    // 右键菜单
    startTimer: "开始计时",
    stopTimer: "停止计时",
    timerStarted: "任务计时已开始",
    timerStopped: "任务计时已停止",
    addPredecessor: "添加前置任务",
    addSuccessor: "添加后置任务",
    // PDF导出相关
    pdfExportLoading: "正在生成PDF,请稍候...",
    pdfExportTitle: "甘特图导出",
    pdfExportDate: "导出日期",
    milestoneGroup: "里程碑",
    collapseTaskList: "收起任务列表",
    expandTaskList: "展开任务列表",
    // TaskDrawer 相关
    taskType: "任务类型",
    taskTypeRequired: "请选择任务类型",
    taskTypeMap: {
      task: "任务",
      milestone: "里程碑",
      story: "需求",
      epic: "史诗",
      bug: "缺陷"
    },
    editTask: "编辑任务",
    parentTask: "上级任务",
    // 时间选择器相关
    time: "时间",
    selectTime: "选择时间",
    hour: "时",
    minute: "分",
    // 日期选择器占位符
    selectDate: "请选择日期",
    to: "至",
    noParentTask: "无上级任务",
    update: "更新",
    taskNameTooLong: "任务名称不能超过50个字符",
    predecessorPlaceholder: "请选择前置任务",
    selectPredecessor: "选择前置任务",
    removePredecessor: "移除前置任务",
    deleteLinks: "删除链接",
    noLinks: "无链接",
    predecessorLink: "前置: {name}",
    successorLink: "后置: {name}",
    operationFailed: "操作失败,请重试",
    taskUpdateSuccess: "任务更新成功",
    taskCreateSuccess: "任务创建成功",
    confirmDeleteTask: '确定要删除任务"{name}"吗?此操作不可撤销。',
    taskDeleteFailed: "删除失败,请重试",
    // Story删除相关
    confirmDeleteStory: "是否删除该需求{name}及其所有的子任务?该操作不可撤回",
    storyDeleteYes: "是, 继续",
    storyDeleteNo: "不,仅删除需求",
    storyDeleteAllSuccess: "已删除需求【{name}】及其所有子任务",
    storyDeleteOnlySuccess: "已删除需求【{name}】,{count}个子任务已升级保留",
    storyNotFound: "未找到要删除的需求,ID:{id}",
    // 里程碑删除成功
    milestoneDeleteSuccess: "里程碑删除成功",
    // 其他删除成功消息
    taskDeletedSuccess: "已删除任务",
    // 选择器占位符
    selectAssignee: "请选择负责人",
    // v1.9.0 资源分配
    resourceAllocation: "资源分配",
    selectResource: "选择资源",
    addResource: "添加资源",
    // v1.13.5 资源类别(人力/设备/其他)
    resourceCategory: "类别",
    resourceCategoryHuman: "人力",
    resourceCategoryDevice: "设备",
    resourceCategoryOthers: "其他",
    percentMinError: "最小占比为20%",
    percentMaxWarning: "占比超过100%将标记为超负荷",
    // 通用消息
    customCsvExportCalled: "自定义CSV导出被调用",
    languageSwitchedTo: "语言切换到:{language}",
    themeSwitchedTo: "主题切换到:{theme}",
    lightModeText: "明亮模式",
    darkModeText: "暗黑模式",
    taskNotFound: "未找到要更新的任务,ID:{id}",
    newParentTaskNotFound: "未找到新父任务,ID:{parentId},将作为顶级任务添加",
    inPlaceUpdateFailed: "就地更新失败,未找到任务,ID:{id}",
    taskToDeleteNotFound: "未找到要删除的任务,ID:{id}",
    milestoneIconUpdateNotFound: "未找到要更新图标的里程碑,ID:{id}",
    overtime: "超",
    overdue: "逾期",
    days: "天",
    // 计时确认弹窗
    timerConfirmPrefix: "即将为任务",
    timerConfirmSuffix: "计时,若有特殊说明请完善下面的描述",
    timerConfirmPlaceholder: "请输入计时说明",
    // Demo配置面板
    configDemo: "配置演示",
    // TaskList配置
    taskListConfig: {
      title: "TaskList 配置",
      columns: {
        title: "列显示(默认渲染模式下生效)",
        renderMode: "渲染模式",
        renderModeDefault: "默认(通过 TaskListColumnConfig 设置)",
        renderModeDeclarative: "声明式(使用 TaskListColumn 设置可见列)"
      },
      width: {
        title: "宽度设置",
        defaultWidth: "默认宽度",
        minWidth: "最小宽度",
        maxWidth: "最大宽度",
        pixelsModel: "像素 (px)",
        percentageModel: "百分比 (%)"
      },
      collapsible: {
        title: "展开/收起控制",
        enableCollapsible: "启用任务列可折叠",
        enableCollapsibleHint: "启用后任务列可展开/收起",
        visible: "任务列显示状态",
        visibleExpanded: "展开",
        visibleCollapsed: "收起",
        visibleHint: "通过 prop 控制任务列初始/当前显示状态"
      }
    },
    // TaskBar配置
    taskBarConfig: {
      title: "TaskBar 配置",
      display: {
        title: "显示选项",
        showAvatar: "显示头像 (Avatar)",
        showTitle: "显示标题 (Title)",
        showProgress: "显示进度 (Progress)"
      },
      mistouch: {
        title: "防误触配置",
        dragThreshold: "拖拽阈值 (px)",
        dragThresholdHint: "移动超过此距离才触发拖拽",
        resizeHandleWidth: "拉伸手柄宽度 (px)",
        resizeHandleWidthHint: "调整手柄的可点击宽度 (5-15px)",
        enableDragDelay: "启用拖拽延迟",
        enableDragDelayHint: "按住一段时间后才能拖拽",
        dragDelayTime: "延迟时间 (ms)",
        dragDelayTimeHint: "延迟启动拖拽的时间",
        allowDragOnClick: "允许拖拽和拉伸 TaskBar 和 Milestone",
        allowDragOnClickHint: "控制是否允许拖拽 TaskBar 和 Milestone,以及拉伸 TaskBar 的长度"
      }
    },
    disableTaskbarFocusMode: "关闭聚焦功能",
    dataSourceAlreadyLoaded: "{name} 已是当前数据源",
    dataSourceLoadSuccess: "已加载 {name}",
    dataSourceLoadFailed: "{name} 加载失败",
    dataSourceSwitch: {
      title: "数据源切换",
      subtitle: "对比常规与超大数据集的初始化体验",
      loading: "数据加载中,请稍候...",
      alreadyLoaded: "{name} 已是当前数据源",
      loadSuccess: "已加载 {name}",
      loadFailed: "{name} 加载失败",
      sources: {
        normal: {
          label: "常规数据源",
          description: "data.json · 含完整前/后置依赖,适合功能演示",
          badge: "data.json"
        },
        medium: {
          label: "中等数据源",
          description: "data-100.json · 含完整前/后置依赖,适合功能演示",
          badge: "data-100.json"
        },
        large: {
          label: "超大数据源",
          description: "data-large-1m.json · 百万级任务,验证虚拟渲染性能",
          badge: "data-large-1m.json"
        }
      }
    },
    resourceView: {
      desc: "资源视图",
      capacity: "利用率",
      overloaded: "超负荷",
      duration: "时间周期",
      overloadWarning: "资源超负荷警告",
      conflictDuration: "冲突时段",
      conflictWith: "与",
      conflictSuffix: "冲突"
    }
  },
  "en-US": {
    dateNotSet: "Not set",
    // TaskList Header
    taskName: "Task Name",
    resourceName: "Resource Name",
    predecessor: "Predecessor",
    assignee: "Assignee",
    startDate: "Start Date",
    endDate: "End Date",
    plannedStartDate: "Planned Start Date",
    plannedEndDate: "Planned End Date",
    actualStartDate: "Actual Start Date",
    actualEndDate: "Actual End Date",
    childrenEarliestStart: "Children Earliest Start",
    childrenLatestEnd: "Children Latest End",
    childrenOverflow: "Children exceed parent boundaries",
    estimatedHours: "Est. Hours",
    actualHours: "Act. Hours",
    progress: "Progress",
    type: "Type",
    // CSV Export Headers(去除重复,仅保留引用)
    csvHeaders: {
      id: "ID",
      taskName: "Task Name",
      predecessor: "Predecessor",
      assignee: "Assignee",
      startDate: "Start Date",
      endDate: "End Date",
      plannedStartDate: "Planned Start Date",
      plannedEndDate: "Planned End Date",
      actualStartDate: "Actual Start Date",
      actualEndDate: "Actual End Date",
      estimatedHours: "Est. Hours",
      actualHours: "Act. Hours",
      progress: "Progress (%)",
      type: "Type",
      description: "Description"
    },
    // 日期格式
    yearMonthFormat: (n, t) => `${n}/${String(t).padStart(2, "0")}`,
    // 月份格式
    monthFormat: (n) => `${String(n).padStart(2, "0")}`,
    // Month name
    monthNames: [
      "Jan",
      "Feb",
      "Mar",
      "Apr",
      "May",
      "Jun",
      "Jul",
      "Aug",
      "Sep",
      "Oct",
      "Nov",
      "Dec"
    ],
    weekDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
    // 其他
    milestone: "Milestone",
    today: "Today",
    targetDate: "Target Date",
    // 里程碑对话框
    milestoneDetails: "Milestone Details",
    milestoneName: "Milestone Name",
    milestoneDate: "Milestone Date",
    milestoneIcon: "Milestone Icon",
    diamond: "Diamond",
    rocket: "Rocket",
    enterMilestoneName: "Enter milestone name",
    enterAssignee: "Enter assignee",
    enterDescription: "Enter description",
    milestoneNameRequired: "Milestone name is required",
    milestoneDateRequired: "Milestone date is required",
    save: "Save",
    close: "Close",
    confirm: "Confirm",
    description: "Description",
    delete: "Delete",
    confirmDelete: "Are you sure you want to delete this milestone?",
    // 工具栏按钮
    addTask: "Add Requirement/Task",
    addMilestone: "Add Milestone",
    todayLocate: "Today",
    todayLocateTooltip: "Locate to today",
    exportCsv: "Export CSV",
    exportPdf: "Export PDF",
    expandAll: "Expand All",
    collapseAll: "Collapse All",
    // v1.9.0 视图模式
    taskView: "Task View",
    // v1.12.5 Calendar/Resource usage view
    calendarView: "Calendar View",
    resourceUsageView: "Resource Utilization",
    language: "English",
    languageTooltip: "Select language",
    lightMode: "Light Mode",
    darkMode: "Dark Mode",
    fullscreen: "Fullscreen",
    exitFullscreen: "Exit Fullscreen",
    githubDocs: "GitHub Docs",
    giteeDocs: "Gitee Docs",
    // 时间刻度按钮
    timeScaleHour: "Hour",
    timeScaleDay: "Day",
    timeScaleWeek: "Week",
    timeScaleMonth: "Month",
    timeScaleQuarter: "Quarter",
    timeScaleYear: "Year",
    timeScaleTooltip: "Switch Time Scale",
    halfYearFirst: "First Half",
    halfYearSecond: "Second Half",
    // Confirm dialog
    confirmDialogMessage: "Do you want to save this setting?",
    taskNamePlaceholder: "Enter task name",
    assigneePlaceholder: "Enter assignee",
    progressPlaceholder: "0-100",
    hoursPlaceholder: "Hours",
    descriptionPlaceholder: "Enter task description...",
    hours: "Hours",
    create: "Create",
    taskNameRequired: "Task name is required",
    startDateRequired: "Start date is required",
    endDateRequired: "End date is required",
    endDateInvalid: "End date cannot be earlier than start date",
    plannedStartDateRequired: "Planned start date is required",
    plannedEndDateRequired: "Planned end date is required",
    plannedEndDateInvalid: "Planned end date cannot be earlier than planned start date",
    actualEndDateInvalid: "Actual end date cannot be earlier than actual start date",
    // Task status
    statusPending: "Pending",
    statusOngoing: "Ongoing",
    statusDelayed: "Delayed",
    statusCompleted: "Completed",
    // 新建里程碑对话框
    newMilestone: "New Milestone",
    editMilestone: "Edit Milestone",
    cancel: "Cancel",
    // Context menu
    timerStarted: "Timer Started",
    timerStopped: "Timer Stopped",
    startTimer: "Start Timer",
    stopTimer: "Stop Timer",
    addPredecessor: "Add Predecessor",
    addSuccessor: "Add Successor",
    // PDF export
    pdfExportLoading: "Generating PDF, please wait...",
    pdfExportTitle: "Gantt Chart Export",
    pdfExportDate: "Export Date",
    milestoneGroup: "Milestone",
    collapseTaskList: "Collapse Task List",
    expandTaskList: "Expand Task List",
    // TaskDrawer related
    taskType: "Task Type",
    taskTypeRequired: "Please select task type",
    taskTypeMap: {
      task: "Task",
      milestone: "Milestone",
      story: "Story",
      epic: "Epic",
      bug: "Bug"
    },
    editTask: "Edit Task",
    newTask: "New Task",
    parentTask: "Parent Task",
    // 时间选择器相关
    time: "Time",
    selectTime: "Select Time",
    hour: "Hour",
    minute: "Minute",
    // Date picker placeholders
    selectDate: "Select date",
    to: "to",
    noParentTask: "No Parent Task",
    update: "Update",
    taskNameTooLong: "Task name cannot exceed 50 characters",
    predecessorPlaceholder: "Select predecessor",
    selectPredecessor: "Select Predecessor",
    removePredecessor: "Remove Predecessor",
    deleteLinks: "Delete Links",
    noLinks: "No Links",
    predecessorLink: "Predecessor: {name}",
    successorLink: "Successor: {name}",
    operationFailed: "Operation failed, please try again",
    taskUpdateSuccess: "Task updated successfully",
    taskCreateSuccess: "Task created successfully",
    confirmDeleteTask: 'Are you sure you want to delete task "{name}"? This action cannot be undone.',
    taskDeleteFailed: "Delete failed, please try again",
    // Story deletion related
    confirmDeleteStory: "Do you want to delete the requirement {name} and all its subtasks? This action cannot be undone",
    storyDeleteYes: "Yes, Continue",
    storyDeleteNo: "No, Delete Requirement Only",
    storyDeleteAllSuccess: "Deleted requirement [{name}] and all its subtasks",
    storyDeleteOnlySuccess: "Deleted requirement [{name}], {count} subtasks have been promoted",
    storyNotFound: "Requirement not found, ID: {id}",
    // Milestone deletion success
    milestoneDeleteSuccess: "Milestone deleted successfully",
    // Other deletion success messages
    taskDeletedSuccess: "Task deleted",
    // Selector placeholders
    selectAssignee: "Select assignee",
    // v1.9.0 Resource allocation
    resourceAllocation: "Resource Allocation",
    selectResource: "Select resource",
    addResource: "Add Resource",
    // v1.13.5 Resource category (Human/Device/Others)
    resourceCategory: "Category",
    resourceCategoryHuman: "Human",
    resourceCategoryDevice: "Device",
    resourceCategoryOthers: "Others",
    percentMinError: "Minimum percentage is 20%",
    percentMaxWarning: "Percentage over 100% will be marked as overloaded",
    // Common messages
    customCsvExportCalled: "Custom CSV export called",
    languageSwitchedTo: "Language switched to: {language}",
    themeSwitchedTo: "Theme switched to: {theme}",
    lightModeText: "Light Mode",
    darkModeText: "Dark Mode",
    taskNotFound: "Task not found for update, ID: {id}",
    newParentTaskNotFound: "New parent task not found, ID: {parentId}, will be added as top-level task",
    inPlaceUpdateFailed: "In-place update failed, task not found, ID: {id}",
    taskToDeleteNotFound: "Task to delete not found, ID: {id}",
    milestoneIconUpdateNotFound: "Milestone not found for icon update, ID: {id}",
    overtime: "Over",
    overdue: "Overdue",
    days: " days",
    // 计时确认弹窗
    timerConfirmPrefix: "About to start timing for",
    timerConfirmSuffix: ". If there are special notes, please complete the description below.",
    timerConfirmPlaceholder: "Please enter timer description",
    // Demo配置面板
    configDemo: "Configuration Demo",
    // TaskList配置
    taskListConfig: {
      title: "TaskList Configuration",
      columns: {
        title: "Columns(默effective in default render mode)",
        renderMode: "Render Mode",
        renderModeDefault: "Default (via TaskListColumnConfig)",
        renderModeDeclarative: "Declarative (via TaskListColumn)"
      },
      width: {
        title: "Width Settings",
        defaultWidth: "Default Width",
        minWidth: "Min Width",
        maxWidth: "Max Width",
        pixelsModel: "pixels (px)",
        percentageModel: "percentage (%)"
      },
      collapsible: {
        title: "Collapsible Control",
        enableCollapsible: "Enable collapsible task list",
        enableCollapsibleHint: "Allow task list to expand/collapse when enabled",
        visible: "Task list visibility",
        visibleExpanded: "Expanded",
        visibleCollapsed: "Collapsed",
        visibleHint: "Controls initial/current visibility state of the task list"
      }
    },
    // TaskBar配置
    taskBarConfig: {
      title: "TaskBar Configuration",
      display: {
        title: "Display Options",
        showAvatar: "Show Avatar",
        showTitle: "Show Title",
        showProgress: "Show Progress"
      },
      mistouch: {
        title: "Mistouch Prevention",
        dragThreshold: "Drag Threshold (px)",
        dragThresholdHint: "Distance to trigger dragging",
        resizeHandleWidth: "Resize Handle Width (px)",
        resizeHandleWidthHint: "Clickable width of resize handle (5-15px)",
        enableDragDelay: "Enable Drag Delay",
        enableDragDelayHint: "Hold to drag after a delay",
        dragDelayTime: "Delay Time (ms)",
        dragDelayTimeHint: "Delay time before dragging starts",
        allowDragOnClick: "Allow dragging and resizing of TaskBars and Milestones",
        allowDragOnClickHint: "Controls whether to allow dragging of TaskBars and Milestones, as well as resizing the length of TaskBars"
      }
    },
    disableTaskbarFocusMode: "Disable Focus Mode",
    dataSourceAlreadyLoaded: "{name} is already active",
    dataSourceLoadSuccess: "{name} loaded successfully",
    dataSourceLoadFailed: "{name} failed to load",
    dataSourceSwitch: {
      title: "Data Sources",
      subtitle: "Compare default vs. mega dataset initialization",
      loading: "Loading data, please wait…",
      alreadyLoaded: "{name} is already active",
      loadSuccess: "{name} loaded successfully",
      loadFailed: "{name} failed to load",
      sources: {
        normal: {
          label: "Standard Dataset",
          description: "data.json · Full predecessor graph for feature demos",
          badge: "data.json"
        },
        medium: {
          label: "Medium Dataset",
          description: "data-100.json · Full predecessor graph for feature demos",
          badge: "data-100.json"
        },
        large: {
          label: "Massive Dataset",
          description: "data-large-1m.json · Million-level tasks to stress virtual rendering",
          badge: "data-large-1m.json"
        }
      }
    },
    resourceView: {
      desc: "Resource View",
      capacity: "capacity",
      overloaded: "overLoaded",
      duration: "duration",
      overloadWarning: "Overload Warning",
      conflictDuration: "conflict duration",
      conflictWith: "conflict with",
      conflictSuffix: ""
    }
  }
};
function Cm(n, t) {
  hd[n] && (hd[n] = {
    ...hd[n],
    ...t
  }, gd.value === n && window.dispatchEvent(
    new CustomEvent("locale-changed", {
      detail: { locale: n }
    })
  ));
}
const wT = "gantt-locale", yT = () => {
  if (typeof window < "u") {
    const n = localStorage.getItem(wT);
    if (n && (n === "zh-CN" || n === "en-US"))
      return n;
  }
  return "zh-CN";
}, gd = me(yT());
function Cs() {
  const n = ce(() => hd[gd.value]), t = (s, o) => {
    const l = s.split(".");
    let u = n.value;
    for (const f of l)
      if (u && typeof u == "object" && f in u)
        u = u[f];
      else
        return o || s;
    return typeof u == "string" ? u : o || s;
  }, e = (s, o) => {
    let l = t(s);
    return Object.keys(o).forEach((u) => {
      l = l.replace(new RegExp(`{${u}}`, "g"), String(o[u]));
    }), l;
  }, r = (s) => {
    gd.value = s, window.dispatchEvent(
      new CustomEvent("locale-changed", {
        detail: { locale: s }
      })
    );
  }, a = ce(() => gd.value);
  return {
    t: n,
    getTranslation: t,
    formatTranslation: e,
    locale: a,
    setLocale: r,
    formatYearMonth: (s, o) => n.value.yearMonthFormat(s, o),
    formatMonth: (s) => n.value.monthFormat(s)
  };
}
function c0() {
  const n = Mr("gantt-view-mode", me("task")), t = Mr("gantt-data-source", ce(() => [])), e = Mr(
    "gantt-list-config",
    ce(() => null)
  ), r = ce(() => n.value === "resource"), a = ce(() => n.value === "task");
  return {
    // 原始状态
    viewMode: n,
    dataSource: t,
    listConfig: e,
    // 派生状态
    isResourceView: r,
    isTaskView: a
  };
}
function BT(n) {
  if (!n) return null;
  const [t, e, r] = n.split("-").map(Number);
  return new Date(t, e - 1, r);
}
function $s(n) {
  return n ? Array.isArray(n) && typeof n[0] == "number" ? n : Array.isArray(n) ? n.filter((t) => t && t.toString().trim()).map((t) => Number(t.toString().trim())).filter((t) => !isNaN(t)) : n.split(",").map((t) => t.trim()).filter((t) => t).map((t) => Number(t)).filter((t) => !isNaN(t)) : [];
}
function lp(n) {
  const t = $s(n);
  return t.length > 0 ? t.join(", ") : "-";
}
const bT = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/, CT = 15;
function kT(n) {
  return typeof n == "string" && bT.test(n.trim());
}
function hA(n, t) {
  const e = kT(n) ? new Date(t.getTime() - CT * 60 * 1e3) : t;
  return new Date(e.getFullYear(), e.getMonth(), e.getDate());
}
function Ku(n, t, e) {
  const r = n.filter((A) => !A.resources || A.resources.length === 0 ? !0 : A.resources.some((i) => String(i.id) === String(t)));
  if (r.length < 2)
    return [];
  let a;
  return r.length > 100 ? a = ET(r, t, e) : a = TT(r, t, e), a;
}
function TT(n, t, e) {
  var A;
  const r = [], a = /* @__PURE__ */ new Set();
  for (let i = 0; i < n.length; i++)
    for (let s = i + 1; s < n.length; s++) {
      const o = n[i], l = n[s], u = km(o, l, e);
      if (!u) continue;
      const f = (W) => {
        const F = W.getFullYear(), Y = String(W.getMonth() + 1).padStart(2, "0"), T = String(W.getDate()).padStart(2, "0"), E = String(W.getHours()).padStart(2, "0"), Q = String(W.getMinutes()).padStart(2, "0");
        return e === "hour" ? `${F}-${Y}-${T} ${E}:${Q}` : `${F}-${Y}-${T}`;
      }, h = n.filter((W) => km(
        { startDate: f(u.start), endDate: f(u.end) },
        W,
        e
      ) !== null);
      let c = 0;
      const p = h.map((W) => {
        var T;
        const F = (T = W.resources) == null ? void 0 : T.find((E) => String(E.id) === String(t)), Y = !W.resources || W.resources.length === 0 ? 100 : (F == null ? void 0 : F.capacity) || 0;
        return c += Y, {
          id: W.id,
          name: W.name || "未命名任务",
          capacity: Y
        };
      });
      if (c <= 100)
        continue;
      const w = h.filter((W) => {
        var Y;
        if (!W.resources || W.resources.length === 0) return !0;
        const F = (Y = W.resources) == null ? void 0 : Y.find((T) => String(T.id) === String(t));
        return F && F.capacity && F.capacity > 0;
      }), y = 1440 * 60 * 1e3, m = e === "hour", k = /* @__PURE__ */ new Set();
      for (const W of w) {
        const F = JA(W.startDate), Y = JA(W.endDate);
        if (F && Y) {
          const T = Math.max(F.getTime(), u.start.getTime()), E = Math.min(Y.getTime(), u.end.getTime());
          k.add(T), k.add(al(W.endDate, new Date(E), m));
        }
      }
      const D = Array.from(k).sort((W, F) => W - F), B = [];
      for (let W = 0; W < D.length - 1; W++) {
        const F = D[W], Y = D[W + 1];
        let T = 0;
        for (const E of w) {
          const Q = JA(E.startDate), x = JA(E.endDate);
          if (!Q || !x) continue;
          const oe = al(E.endDate, x, m);
          if (Q.getTime() <= F && oe > F) {
            const J = (A = E.resources) == null ? void 0 : A.find((I) => String(I.id) === String(t)), S = !E.resources || E.resources.length === 0 ? 100 : (J == null ? void 0 : J.capacity) || 0;
            T += S;
          }
        }
        T > 100 && B.push({ start: F, end: Y });
      }
      if (B.length === 0) continue;
      const O = B[0].start;
      let q = B[0].end;
      for (let W = 1; W < B.length; W++)
        B[W].start === q && (q = B[W].end);
      q = m ? q : q - y;
      const G = `${O}-${q}`;
      a.has(G) || (a.add(G), r.push({
        startDate: new Date(O),
        endDate: new Date(q),
        totalPercent: c,
        level: d0(c),
        tasks: p
      }));
    }
  return o5(r);
}
function o5(n) {
  if (n.length === 0) return [];
  const t = [...n].sort((a, A) => a.startDate.getTime() - A.startDate.getTime()), e = [];
  let r = t[0];
  for (let a = 1; a < t.length; a++) {
    const A = t[a];
    r.endDate >= A.startDate ? r = {
      startDate: r.startDate,
      endDate: new Date(Math.max(r.endDate.getTime(), A.endDate.getTime())),
      totalPercent: Math.max(r.totalPercent, A.totalPercent),
      // 取最大负载
      level: d0(Math.max(r.totalPercent, A.totalPercent)),
      tasks: xT(r.tasks, A.tasks)
    } : (e.push(r), r = A);
  }
  return e.push(r), e;
}
function xT(n, t) {
  const e = /* @__PURE__ */ new Map();
  for (const r of n)
    e.set(r.id, r);
  for (const r of t)
    if (!e.has(r.id))
      e.set(r.id, r);
    else {
      const a = e.get(r.id);
      r.capacity > a.capacity && e.set(r.id, r);
    }
  return Array.from(e.values());
}
function km(n, t, e) {
  const r = JA(n.startDate), a = JA(n.endDate), A = JA(t.startDate), i = JA(t.endDate);
  if (!r || !a || !A || !i)
    return null;
  if (e === "hour") {
    if (r.getTime() >= i.getTime() || A.getTime() >= a.getTime())
      return null;
    const f = new Date(Math.max(r.getTime(), A.getTime())), h = new Date(Math.min(a.getTime(), i.getTime()));
    return { start: f, end: h };
  }
  const s = al(n.endDate, a, !1), o = al(t.endDate, i, !1);
  if (r.getTime() >= o || A.getTime() >= s)
    return null;
  const l = new Date(Math.max(r.getTime(), A.getTime())), u = new Date(Math.min(a.getTime(), i.getTime()));
  return {
    start: l,
    end: u
  };
}
function d0(n) {
  return n > 150 ? "severe" : n > 120 ? "medium" : "light";
}
function JA(n) {
  if (!n) return null;
  if (typeof n == "string") {
    if (/^\d{4}-\d{2}-\d{2}$/.test(n)) {
      const [e, r, a] = n.split("-").map(Number);
      return new Date(e, r - 1, a);
    }
    if (/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/.test(n)) {
      const [e, r] = n.split(" "), [a, A, i] = e.split("-").map(Number), [s, o] = r.split(":").map(Number);
      return new Date(a, A - 1, i, s, o);
    }
  }
  const t = new Date(n);
  return isNaN(t.getTime()) ? null : t;
}
function al(n, t, e) {
  return e ? t.getTime() : hA(n, t).getTime() + 1440 * 60 * 1e3;
}
class DT {
  constructor() {
    sn(this, "root", null);
  }
  /**
   * 插入区间
   */
  insert(t) {
    const e = JA(t.startDate), r = JA(t.endDate);
    if (!e || !r) return;
    const a = {
      start: e.getTime(),
      end: r.getTime(),
      max: r.getTime(),
      task: t,
      left: null,
      right: null
    };
    this.root ? this.insertNode(this.root, a) : this.root = a;
  }
  /**
   * 递归插入节点
   */
  insertNode(t, e) {
    e.end > t.max && (t.max = e.end), e.start < t.start ? t.left === null ? t.left = e : this.insertNode(t.left, e) : t.right === null ? t.right = e : this.insertNode(t.right, e);
  }
  /**
   * 查询与指定区间重叠的所有任务
   */
  query(t, e) {
    const r = [];
    return this.queryNode(this.root, t, e, r), r;
  }
  /**
   * 递归查询节点
   */
  queryNode(t, e, r, a) {
    t && (t.start <= r && t.end >= e && a.push(t.task), t.left && t.left.max >= e && this.queryNode(t.left, e, r, a), t.right && t.start <= r && this.queryNode(t.right, e, r, a));
  }
}
function ET(n, t, e) {
  var i;
  const r = new DT();
  for (const s of n)
    r.insert(s);
  const a = [], A = /* @__PURE__ */ new Set();
  for (const s of n) {
    const o = JA(s.startDate), l = JA(s.endDate);
    if (!o || !l) continue;
    const u = r.query(o.getTime(), l.getTime());
    if (u.length < 2) continue;
    let f = 0;
    const h = u.map((q) => {
      var F;
      const G = (F = q.resources) == null ? void 0 : F.find((Y) => String(Y.id) === String(t)), W = !q.resources || q.resources.length === 0 ? 100 : (G == null ? void 0 : G.capacity) || 0;
      return f += W, {
        id: q.id,
        name: q.name || "未命名任务",
        capacity: W
      };
    });
    if (f <= 100) continue;
    const c = u.filter((q) => {
      var W;
      if (!q.resources || q.resources.length === 0) return !0;
      const G = (W = q.resources) == null ? void 0 : W.find((F) => String(F.id) === String(t));
      return G && G.capacity && G.capacity > 0;
    }), p = 1440 * 60 * 1e3, w = e === "hour", y = /* @__PURE__ */ new Set();
    y.add(o.getTime()), y.add(al(s.endDate, l, w));
    for (const q of c) {
      const G = JA(q.startDate), W = JA(q.endDate);
      G && W && (y.add(G.getTime()), y.add(al(q.endDate, W, w)));
    }
    const m = Array.from(y).sort((q, G) => q - G), k = [];
    for (let q = 0; q < m.length - 1; q++) {
      const G = m[q], W = m[q + 1];
      let F = 0;
      for (const Y of c) {
        const T = JA(Y.startDate), E = JA(Y.endDate);
        if (!T || !E) continue;
        const Q = al(Y.endDate, E, w);
        if (T.getTime() <= G && Q > G) {
          const x = (i = Y.resources) == null ? void 0 : i.find((J) => String(J.id) === String(t)), oe = !Y.resources || Y.resources.length === 0 ? 100 : (x == null ? void 0 : x.capacity) || 0;
          F += oe;
        }
      }
      F > 100 && k.push({ start: G, end: W });
    }
    if (k.length === 0) continue;
    const D = k[0].start;
    let B = k[0].end;
    for (let q = 1; q < k.length; q++)
      k[q].start === B && (B = k[q].end);
    B = w ? B : B - p;
    const O = `${D}-${B}`;
    A.has(O) || (A.add(O), a.push({
      startDate: new Date(D),
      endDate: new Date(B),
      totalPercent: f,
      level: d0(f),
      tasks: h
    }));
  }
  return o5(a);
}
function Tm(n) {
  const t = {
    id: n.id,
    name: n.name,
    title: n.title,
    // 缺省值兜底:数据源未提供 type(如宿主应用尚未迁移的历史数据)时默认 'Human'
    type: n.type ?? "Human",
    avatar: n.avatar,
    description: n.description,
    department: n.department,
    skills: n.skills,
    capacity: n.capacity,
    color: n.color,
    tasks: n.tasks || []
  };
  return Object.keys(n).forEach((e) => {
    e in t || (t[e] = n[e]);
  }), t;
}
function ST(n) {
  return n.tasks.length < 2 ? !1 : Ku(n.tasks, n.id).length > 0;
}
const FT = { class: "confirm-timer-dialog-overlay" }, UT = { class: "confirm-timer-dialog" }, LT = { class: "dialog-message" }, IT = { class: "task-name-highlight" }, QT = ["placeholder"], MT = { class: "dialog-actions" }, _T = /* @__PURE__ */ hn({
  __name: "ConfirmTimerDialog",
  props: {
    visible: Boolean,
    title: { type: String, default: "" },
    message: { type: String, default: "" },
    defaultDesc: { type: String, default: "" },
    placeholder: { type: String, default: "" }
  },
  emits: ["confirm", "cancel"],
  setup(n, { emit: t }) {
    const e = n, r = t, { getTranslation: a } = Cs(), A = me(e.defaultDesc);
    Gt(
      () => e.visible,
      (o) => {
        o && (A.value = e.defaultDesc);
      }
    );
    const i = () => r("confirm", A.value), s = ce(() => {
      if (e.message) {
        const o = e.message.match(/任务([\S\s]+?)计时|Task ([\S\s]+?) timing/);
        if (o && (o[1] || o[2])) return o[1] || o[2];
      }
      return e.defaultDesc;
    });
    return (o, l) => ($(), ee("div", FT, [
      _("div", UT, [
        _("div", LT, [
          _("span", null, Ee(Te(a)("timerConfirmPrefix")), 1),
          _("span", IT, Ee(s.value), 1),
          _("span", null, Ee(Te(a)("timerConfirmSuffix")), 1)
        ]),
        us(_("textarea", {
          "onUpdate:modelValue": l[0] || (l[0] = (u) => A.value = u),
          class: "dialog-textarea",
          placeholder: Te(a)("timerConfirmPlaceholder"),
          rows: "3"
        }, null, 8, QT), [
          [Qi, A.value]
        ]),
        _("div", MT, [
          _("button", {
            class: "gantt-btn gantt-btn-default",
            onClick: l[1] || (l[1] = (u) => o.$emit("cancel"))
          }, Ee(Te(a)("cancel")), 1),
          _("button", {
            class: "gantt-btn gantt-btn-confirm",
            onClick: i
          }, Ee(Te(a)("startTimer")), 1)
        ])
      ])
    ]));
  }
}), Fn = (n, t) => {
  const e = n.__vccOpts || n;
  for (const [r, a] of t)
    e[r] = a;
  return e;
}, l5 = /* @__PURE__ */ Fn(_T, [["__scopeId", "data-v-b12dbe17"]]), RT = { class: "gantt-confirm-header" }, NT = { class: "gantt-confirm-title" }, HT = { class: "gantt-confirm-content" }, OT = { class: "gantt-confirm-footer" }, PT = { class: "gantt-confirm-footer-right" }, WT = /* @__PURE__ */ hn({
  __name: "GanttConfirmDialog",
  props: {
    visible: Boolean,
    title: { type: String, default: "确认" },
    message: { type: String, default: "" },
    confirmText: { type: String, default: "确认" },
    cancelText: { type: String, default: "取消" },
    yesText: { type: String, default: "是" },
    noText: { type: String, default: "否" },
    type: { type: String, default: "confirm-cancel" }
    // 'confirm-cancel' | 'yes-no-cancel'
  },
  emits: ["confirm", "cancel", "yes", "no"],
  setup(n, { emit: t }) {
    const e = n, r = t, a = () => r("confirm"), A = () => r("cancel"), i = () => r("yes"), s = () => r("no");
    return (o, l) => n.visible ? ($(), ee("div", {
      key: 0,
      class: "gantt-confirm-overlay",
      onClick: A
    }, [
      _("div", {
        class: "gantt-confirm-dialog",
        onClick: l[0] || (l[0] = dn(() => {
        }, ["stop"]))
      }, [
        _("div", RT, [
          _("h4", NT, Ee(e.title), 1)
        ]),
        _("div", HT, [
          _("p", null, Ee(e.message), 1)
        ]),
        _("div", OT, [
          e.type === "yes-no-cancel" ? ($(), ee(St, { key: 0 }, [
            _("button", {
              type: "button",
              class: "gantt-btn gantt-btn-default",
              onClick: A
            }, Ee(e.cancelText), 1),
            _("div", PT, [
              _("button", {
                type: "button",
                class: "gantt-btn gantt-btn-warning",
                onClick: s
              }, Ee(e.noText), 1),
              _("button", {
                type: "button",
                class: "gantt-btn gantt-btn-danger",
                onClick: i
              }, Ee(e.yesText), 1)
            ])
          ], 64)) : ($(), ee(St, { key: 1 }, [
            _("button", {
              type: "button",
              class: "gantt-btn gantt-btn-default",
              onClick: A
            }, Ee(e.cancelText), 1),
            l[1] || (l[1] = fn("    ", -1)),
            _("button", {
              type: "button",
              class: "gantt-btn gantt-btn-danger",
              onClick: a
            }, Ee(e.confirmText), 1)
          ], 64))
        ])
      ])
    ])) : vt("", !0);
  }
}), f0 = /* @__PURE__ */ Fn(WT, [["__scopeId", "data-v-096d9bfd"]]), KT = ["data-theme"], $T = { class: "icon-wrapper" }, VT = ["onClick"], qT = ["innerHTML"], jT = /* @__PURE__ */ hn({
  __name: "TaskContextMenu",
  props: {
    visible: { type: Boolean },
    position: {},
    task: {},
    allTasks: {}
  },
  emits: [
    "start-timer",
    "stop-timer",
    "add-predecessor",
    "add-successor",
    "delete",
    // 新增delete事件
    "delete-link",
    // 删除链接事件
    "close"
  ],
  setup(n, { expose: t, emit: e }) {
    const r = n, a = e, { t: A } = Cs(), i = Mr("gantt-theme"), s = me(null), o = me({
      x: 0,
      y: 0
    }), l = me({
      display: "none",
      // 初始不显示
      left: "50%",
      top: "-8px",
      transform: "rotate(0deg)"
    }), u = me(!1), f = me(""), h = me(!1), c = ce(() => {
      var Z;
      return ((Z = r.task) == null ? void 0 : Z.type) === "story" ? "yes-no-cancel" : "confirm-cancel";
    }), p = ce(() => {
      var Z, C, H;
      return ((Z = r.task) == null ? void 0 : Z.type) === "story" ? A.value.confirmDeleteStory.replace("{name}", ((C = r.task) == null ? void 0 : C.name) || "") : A.value.confirmDeleteTask.replace("{name}", ((H = r.task) == null ? void 0 : H.name) || "");
    });
    function w() {
      var Z;
      f.value = ((Z = r.task) == null ? void 0 : Z.name) || "", u.value = !0;
    }
    function y() {
      u.value = !1;
    }
    function m(Z) {
      if (u.value = !1, r.task && typeof r.task == "object") {
        a("close");
        const C = Date.now();
        Object.assign(r.task, {
          timerStartDesc: Z || "",
          isTimerRunning: !0,
          timerStartTime: C,
          timerElapsedTime: 0
          // 每次从0秒开始
        }), a("start-timer", r.task);
      }
    }
    function k() {
      h.value = !0;
    }
    const D = () => {
      h.value = !1, r.task && (a("delete", r.task), a("close"));
    }, B = () => {
      h.value = !1;
    }, O = () => {
      h.value = !1, r.task && (a("delete", r.task, !0), E());
    }, q = () => {
      h.value = !1, r.task && (a("delete", r.task, !1), E());
    }, G = ce(() => {
      var Z;
      return ((Z = r.task) == null ? void 0 : Z.type) !== "story";
    }), W = me(!1);
    let F = null;
    const Y = ce(() => {
      const Z = [];
      if (!r.task || !r.allTasks) return Z;
      if (r.task.predecessor) {
        const C = $s(r.task.predecessor);
        for (const H of C) {
          const M = r.allTasks.find((te) => te.id === H);
          M && Z.push({
            type: "predecessor",
            taskId: H,
            taskName: M.name || `任务 ${H}`
          });
        }
      }
      for (const C of r.allTasks)
        C.predecessor && C.id !== r.task.id && $s(C.predecessor).includes(r.task.id) && Z.push({
          type: "successor",
          taskId: C.id,
          taskName: C.name || `任务 ${C.id}`
        });
      return Z;
    }), T = ce(() => Y.value.length > 0);
    Gt(
      [() => r.visible, () => r.position],
      ([Z, C]) => {
        Z && C && An(() => {
          if (s.value) {
            const H = window.innerWidth, M = window.innerHeight, te = s.value.offsetWidth, ie = s.value.offsetHeight;
            let we = C.x - te / 2, ve = C.y + 10, le = "50%", _e = "-8px", De = "rotate(0deg)";
            if (we + te > H) {
              const ze = we + te - H + 5;
              we -= ze, le = `calc(50% + ${ze}px)`;
            }
            if (we < 5) {
              const ze = 5 - we;
              we = 5, le = `calc(50% - ${ze}px)`;
            }
            ve + ie > M && (ve = C.y - ie - 10, _e = "100%", De = "rotate(180deg)"), o.value = {
              x: we,
              y: ve
            }, l.value = {
              display: "block",
              left: le,
              top: _e,
              transform: De
            };
          }
        });
      },
      { immediate: !0, deep: !0 }
    );
    const E = () => {
      a("close");
    }, Q = () => {
      var Z;
      (Z = r.task) != null && Z.isTimerRunning ? (a("close"), Object.assign(r.task, {
        isTimerRunning: !1,
        timerEndTime: Date.now(),
        timerElapsedTime: (r.task.timerElapsedTime || 0) + (Date.now() - (r.task.timerStartTime || Date.now()))
      }), a("stop-timer", r.task)) : w();
    }, x = () => {
      r.task && (a("close"), An(() => {
        a("add-predecessor", r.task);
      }));
    }, oe = () => {
      r.task && (a("close"), An(() => {
        a("add-successor", r.task);
      }));
    }, J = (Z) => {
      F && (clearTimeout(F), F = null), W.value = !1, a("delete-link", {
        sourceTaskId: Z.type === "predecessor" ? Z.taskId : r.task.id,
        targetTaskId: Z.type === "predecessor" ? r.task.id : Z.taskId
      }), a("close");
    }, S = () => {
      F && (clearTimeout(F), F = null), W.value = !0;
    }, I = () => {
      F = window.setTimeout(() => {
        W.value = !1;
      }, 200);
    }, N = (Z) => {
      s.value && !s.value.contains(Z.target) && E();
    }, se = (Z) => {
      Z.key === "Escape" && E();
    };
    return sA(() => {
      document.addEventListener("mousedown", N), document.addEventListener("keydown", se);
    }), ga(() => {
      document.removeEventListener("mousedown", N), document.removeEventListener("keydown", se), F && clearTimeout(F);
    }), t({ menuRef: s }), (Z, C) => {
      var H, M, te, ie;
      return $(), Ir(es, { to: "body" }, [
        n.visible ? ($(), ee("div", {
          key: 0,
          ref_key: "menuRef",
          ref: s,
          class: "task-context-menu",
          "data-theme": Te(i),
          style: Mt({
            left: `${o.value.x}px`,
            top: `${o.value.y}px`,
            zIndex: 1e4,
            position: "fixed"
          })
        }, [
          _("div", {
            class: "menu-arrow",
            style: Mt({
              display: l.value.display,
              left: l.value.left,
              top: l.value.top,
              transform: l.value.transform
            })
          }, null, 4),
          G.value ? ($(), ee("div", {
            key: 0,
            class: "menu-item",
            onClick: Q
          }, [
            _("div", $T, [
              _("i", {
                class: tr(["menu-icon", (H = r.task) != null && H.isTimerRunning ? "stop-icon" : "timer-icon"])
              }, null, 2)
            ]),
            fn(" " + Ee((M = r.task) != null && M.isTimerRunning ? Te(A).stopTimer : Te(A).startTimer), 1)
          ])) : vt("", !0),
          _("div", {
            class: "menu-item",
            onClick: x
          }, [
            C[0] || (C[0] = _("div", { class: "icon-wrapper" }, [
              _("i", { class: "menu-icon predecessor-icon" })
            ], -1)),
            fn(" " + Ee(Te(A).addPredecessor), 1)
          ]),
          _("div", {
            class: "menu-item",
            onClick: oe
          }, [
            C[1] || (C[1] = _("div", { class: "icon-wrapper" }, [
              _("i", { class: "menu-icon successor-icon" })
            ], -1)),
            fn(" " + Ee(Te(A).addSuccessor), 1)
          ]),
          T.value ? ($(), ee("div", {
            key: 1,
            class: "menu-item menu-item-with-submenu",
            onMouseenter: S,
            onMouseleave: I
          }, [
            C[2] || (C[2] = _("div", { class: "icon-wrapper" }, [
              _("i", { class: "menu-icon link-delete-icon" })
            ], -1)),
            fn(" " + Ee(Te(A).deleteLinks) + " ", 1),
            C[3] || (C[3] = _("i", { class: "submenu-arrow" }, "›", -1)),
            W.value ? ($(), ee("div", {
              key: 0,
              class: "submenu",
              onMouseenter: S,
              onMouseleave: I
            }, [
              ($(!0), ee(St, null, nr(Y.value, (we) => ($(), ee("div", {
                key: `${we.type}-${we.taskId}`,
                class: "menu-item submenu-item",
                onClick: dn((ve) => J(we), ["stop"])
              }, [
                _("span", {
                  innerHTML: we.type === "predecessor" ? Te(A).predecessorLink.replace("{name}", we.taskName) : Te(A).successorLink.replace("{name}", we.taskName)
                }, null, 8, qT)
              ], 8, VT))), 128))
            ], 32)) : vt("", !0)
          ], 32)) : vt("", !0),
          C[5] || (C[5] = _("div", { class: "menu-divider" }, null, -1)),
          _("div", {
            class: "menu-item menu-item-danger",
            onClick: k
          }, [
            C[4] || (C[4] = _("div", { class: "icon-wrapper" }, [
              _("i", { class: "menu-icon delete-icon" })
            ], -1)),
            fn(" " + Ee(Te(A).delete), 1)
          ]),
          na(f0, {
            visible: h.value,
            title: Te(A).delete,
            type: c.value,
            message: p.value,
            "confirm-text": Te(A).confirm,
            "cancel-text": Te(A).cancel,
            "yes-text": Te(A).storyDeleteYes,
            "no-text": Te(A).storyDeleteNo,
            onConfirm: D,
            onYes: O,
            onNo: q,
            onCancel: B
          }, null, 8, ["visible", "title", "type", "message", "confirm-text", "cancel-text", "yes-text", "no-text"]),
          u.value ? ($(), Ir(l5, {
            key: 2,
            visible: u.value,
            title: Te(A).startTimer,
            message: `${Te(A).timerConfirmPrefix}${(te = r.task) == null ? void 0 : te.name}${Te(A).timerConfirmSuffix}`,
            "default-desc": ((ie = r.task) == null ? void 0 : ie.name) || "",
            onConfirm: m,
            onCancel: y
          }, null, 8, ["visible", "title", "message", "default-desc"])) : vt("", !0)
        ], 12, KT)) : vt("", !0)
      ]);
    };
  }
}), u5 = /* @__PURE__ */ Fn(jT, [["__scopeId", "data-v-7a8253df"]]), YT = {
  width: "12",
  height: "12",
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  "stroke-width": "2"
}, GT = {
  key: 0,
  points: "9,18 15,12 9,6"
}, zT = {
  key: 1,
  points: "18,15 12,9 6,15"
}, XT = /* @__PURE__ */ hn({
  __name: "TaskRowCollapseButton",
  props: {
    collapsed: { type: Boolean },
    visible: { type: Boolean }
  },
  emits: ["toggle"],
  setup(n) {
    return (t, e) => n.visible ? ($(), ee("span", {
      key: 0,
      class: "collapse-btn",
      onClick: e[0] || (e[0] = dn((r) => t.$emit("toggle"), ["stop"]))
    }, [
      ($(), ee("svg", YT, [
        n.collapsed ? ($(), ee("polyline", GT)) : ($(), ee("polyline", zT))
      ]))
    ])) : vt("", !0);
  }
}), xm = /* @__PURE__ */ Fn(XT, [["__scopeId", "data-v-b8f89457"]]), JT = {
  key: 0,
  class: "task-icon"
}, ZT = {
  key: 0,
  width: "16",
  height: "16",
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  "stroke-width": "2",
  class: "milestone-group-icon"
}, ex = {
  key: 1,
  width: "16",
  height: "16",
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  "stroke-width": "2"
}, tx = {
  key: 2,
  width: "16",
  height: "16",
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  "stroke-width": "2"
}, rx = /* @__PURE__ */ hn({
  __name: "TaskRowIcon",
  props: {
    isMilestoneGroup: { type: Boolean },
    isParentTask: { type: Boolean },
    hasChildren: { type: Boolean },
    isStoryTask: { type: Boolean },
    showIcon: { type: Boolean, default: !0 }
  },
  setup(n) {
    return (t, e) => n.showIcon ? ($(), ee("span", JT, [
      n.isMilestoneGroup ? ($(), ee("svg", ZT, [...e[0] || (e[0] = [
        _("polygon", { points: "12,2 22,12 12,22 2,12" }, null, -1)
      ])])) : n.isStoryTask || n.hasChildren ? ($(), ee("svg", ex, [...e[1] || (e[1] = [
        _("path", { d: "M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-5l-2-2H5a2 2 0 00-2 2z" }, null, -1)
      ])])) : ($(), ee("svg", tx, [...e[2] || (e[2] = [
        Il('<path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z" data-v-4f02d5e2></path><polyline points="14,2 14,8 20,8" data-v-4f02d5e2></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-4f02d5e2></line><line x1="16" y1="17" x2="8" y2="17" data-v-4f02d5e2></line><polyline points="10,9 9,9 8,9" data-v-4f02d5e2></polyline>', 5)
      ])]))
    ])) : vt("", !0);
  }
}), Dm = /* @__PURE__ */ Fn(rx, [["__scopeId", "data-v-4f02d5e2"]]), nx = {
  key: 0,
  class: "timer-dot"
}, ax = {
  key: 1,
  class: "status-badge overtime"
}, Ax = {
  key: 2,
  class: "status-badge overdue"
}, sx = /* @__PURE__ */ hn({
  __name: "TaskRowBadges",
  props: {
    formattedTimer: {},
    isTimerRunning: { type: Boolean },
    timerElapsedTime: {},
    isOvertime: { type: Boolean },
    overdueDays: {},
    overtimeText: {},
    overdueText: {},
    daysText: {}
  },
  setup(n) {
    return (t, e) => ($(), ee(St, null, [
      n.isTimerRunning || n.timerElapsedTime ? ($(), ee("span", {
        key: 0,
        class: tr(["timer-badge", { "timer-active": n.isTimerRunning }])
      }, [
        n.isTimerRunning ? ($(), ee("span", nx)) : vt("", !0),
        fn(" " + Ee(n.formattedTimer), 1)
      ], 2)) : vt("", !0),
      n.isOvertime ? ($(), ee("span", ax, Ee(n.overtimeText), 1)) : vt("", !0),
      n.overdueDays > 0 ? ($(), ee("span", Ax, Ee(n.overdueText) + Ee(n.overdueDays > 0 ? n.overdueDays + n.daysText : ""), 1)) : vt("", !0)
    ], 64));
  }
}), Em = /* @__PURE__ */ Fn(sx, [["__scopeId", "data-v-890f023b"]]), ix = ["title"], ox = ["title"], lx = /* @__PURE__ */ hn({
  __name: "TaskRowNameContent",
  props: {
    task: {},
    isParentTask: { type: Boolean },
    hasChildren: { type: Boolean },
    isStoryTask: { type: Boolean },
    isMilestoneGroup: { type: Boolean },
    isMilestoneTask: { type: Boolean },
    showTaskIcon: { type: Boolean },
    formattedTimer: {},
    isOvertime: { type: Boolean },
    overdueDays: {},
    overtimeText: {},
    overdueText: {},
    daysText: {},
    hasContentSlot: { type: Boolean },
    renderColumnSlot: { type: Function },
    hasColumnSlot: { type: Function }
  },
  setup(n) {
    const t = n;
    return (e, r) => {
      var a;
      return (a = n.hasColumnSlot) != null && a.call(n, "name") ? ($(), Ir(ro(Te(fd)), {
        key: 0,
        render: () => {
          var A;
          return (A = n.renderColumnSlot) == null ? void 0 : A.call(n, "name", {
            task: t.task,
            column: { key: "name" },
            value: t.task.name,
            isParentTask: n.isParentTask,
            hasChildren: n.hasChildren,
            isStoryTask: n.isStoryTask,
            isMilestoneGroup: n.isMilestoneGroup,
            isMilestoneTask: n.isMilestoneTask,
            showTaskIcon: n.showTaskIcon,
            formattedTimer: n.formattedTimer,
            isOvertime: n.isOvertime,
            overdueDays: n.overdueDays,
            overtimeText: n.overtimeText,
            overdueText: n.overdueText,
            daysText: n.daysText
          });
        }
      }, null, 8, ["render"])) : n.hasContentSlot ? ($(), ee(St, { key: 1 }, [
        na(Dm, {
          "is-milestone-group": n.isMilestoneGroup,
          "is-parent-task": n.isParentTask,
          "has-children": n.hasChildren,
          "is-story-task": n.isStoryTask,
          "show-icon": n.showTaskIcon
        }, null, 8, ["is-milestone-group", "is-parent-task", "has-children", "is-story-task", "show-icon"]),
        _("span", {
          class: tr(["task-name-text", { "parent-task": n.isParentTask }]),
          title: n.task.name
        }, [
          Nn(e.$slots, "custom-task-content", {}, void 0, !0),
          na(Em, {
            "formatted-timer": n.formattedTimer,
            "is-timer-running": !!n.task.isTimerRunning,
            "timer-elapsed-time": n.task.timerElapsedTime,
            "is-overtime": n.isOvertime,
            "overdue-days": n.overdueDays,
            "overtime-text": n.overtimeText,
            "overdue-text": n.overdueText,
            "days-text": n.daysText
          }, null, 8, ["formatted-timer", "is-timer-running", "timer-elapsed-time", "is-overtime", "overdue-days", "overtime-text", "overdue-text", "days-text"])
        ], 10, ix)
      ], 64)) : ($(), ee(St, { key: 2 }, [
        na(Dm, {
          "is-milestone-group": n.isMilestoneGroup,
          "is-parent-task": n.isParentTask,
          "has-children": n.hasChildren,
          "is-story-task": n.isStoryTask,
          "show-icon": n.showTaskIcon
        }, null, 8, ["is-milestone-group", "is-parent-task", "has-children", "is-story-task", "show-icon"]),
        _("span", {
          class: tr(["task-name-text", { "parent-task": n.isParentTask }]),
          title: n.task.name
        }, [
          fn(Ee(n.task.name) + " ", 1),
          na(Em, {
            "formatted-timer": n.formattedTimer,
            "is-timer-running": !!n.task.isTimerRunning,
            "timer-elapsed-time": n.task.timerElapsedTime,
            "is-overtime": n.isOvertime,
            "overdue-days": n.overdueDays,
            "overtime-text": n.overtimeText,
            "overdue-text": n.overdueText,
            "days-text": n.daysText
          }, null, 8, ["formatted-timer", "is-timer-running", "timer-elapsed-time", "is-overtime", "overdue-days", "overtime-text", "overdue-text", "days-text"])
        ], 10, ox)
      ], 64));
    };
  }
}), ux = /* @__PURE__ */ Fn(lx, [["__scopeId", "data-v-8579eb14"]]);
function cx(n, t, e, r, a) {
  const i = ce(() => {
    const c = n.value.type, p = n.value.children, w = !!(p && p.length > 0), y = c === "story", m = c === "milestone-group", k = c === "milestone", D = y || w || m;
    return {
      indent: `${10 + t.value * 20}px`,
      hasChildren: w,
      isStoryTask: y,
      isMilestoneGroup: m,
      isMilestoneTask: k,
      isParentTask: D
    };
  }), s = () => {
    const c = n.value.progress || 0, p = /* @__PURE__ */ new Date(), w = n.value.endDate ? new Date(n.value.endDate) : null;
    return w && p > w && c < 100 ? "progress-danger" : c >= 100 ? "progress-success" : c > 0 ? "progress-warning" : "";
  }, o = () => n.value.actualHours && n.value.estimatedHours && n.value.actualHours > n.value.estimatedHours, l = () => {
    const c = /* @__PURE__ */ new Date(), p = n.value.endDate ? new Date(n.value.endDate) : null, w = n.value.progress || 0;
    if (p && c > p && w < 100) {
      const y = new Date(c.getFullYear(), c.getMonth(), c.getDate()), m = new Date(p.getFullYear(), p.getMonth(), p.getDate());
      return Math.floor((y.getTime() - m.getTime()) / (1e3 * 60 * 60 * 24));
    }
    return 0;
  }, u = ce(() => s()), f = ce(() => r != null && r.value ? typeof r.value == "function" ? r.value(n.value, (e == null ? void 0 : e.value) ?? 0) : r.value : ""), h = ce(() => a != null && a.value ? typeof a.value == "function" ? a.value(n.value, (e == null ? void 0 : e.value) ?? 0) : a.value : {});
  return {
    indent: ce(() => i.value.indent),
    hasChildren: ce(() => i.value.hasChildren),
    isStoryTask: ce(() => i.value.isStoryTask),
    isMilestoneGroup: ce(() => i.value.isMilestoneGroup),
    isMilestoneTask: ce(() => i.value.isMilestoneTask),
    isParentTask: ce(() => i.value.isParentTask),
    getProgressClass: s,
    isOvertime: o,
    overdueDays: l,
    progressClass: u,
    customRowClass: f,
    customRowStyle: h
  };
}
function dx(n, t, e, r, a, A, i) {
  const s = (u) => u === 0;
  return {
    isFirstColumn: s,
    getDeclarativeColumnAlign: (u) => ({
      justifyContent: u.align === "center" ? "center" : u.align === "right" ? "flex-end" : "flex-start",
      textAlign: u.align || "left"
    }),
    renderDeclarativeColumn: (u, f) => {
      if (s(f)) {
        const h = u.prop ? n.value[u.prop] : n.value.name;
        return u.defaultSlot ? is("div", { class: "task-name-content" }, [
          // 自定义内容
          is(
            "span",
            {
              class: ["task-name-text", { "parent-task": t.value }],
              title: h
            },
            [
              u.defaultSlot({
                row: n.value,
                $index: i.value ?? -1
              })
            ]
          )
        ]) : is("div", { class: "task-name-content" }, [
          // 任务图标
          A.value !== !1 ? is(
            "span",
            { class: "task-icon" },
            e.value ? is(
              "svg",
              {
                width: 16,
                height: 16,
                viewBox: "0 0 24 24",
                fill: "none",
                stroke: "currentColor",
                "stroke-width": 2,
                class: "milestone-group-icon"
              },
              is("polygon", { points: "12,2 22,12 12,22 2,12" })
            ) : r.value || a.value ? is(
              "svg",
              {
                width: 16,
                height: 16,
                viewBox: "0 0 24 24",
                fill: "none",
                stroke: "currentColor",
                "stroke-width": 2
              },
              is("path", {
                d: "M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-5l-2-2H5a2 2 0 00-2 2z"
              })
            ) : is(
              "svg",
              {
                width: 16,
                height: 16,
                viewBox: "0 0 24 24",
                fill: "none",
                stroke: "currentColor",
                "stroke-width": 2
              },
              [
                is("path", {
                  d: "M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"
                }),
                is("polyline", { points: "14,2 14,8 20,8" }),
                is("line", { x1: 16, y1: 13, x2: 8, y2: 13 }),
                is("line", { x1: 16, y1: 17, x2: 8, y2: 17 }),
                is("polyline", { points: "10,9 9,9 8,9" })
              ]
            )
          ) : null,
          // 列的值(使用 prop 或默认 name)
          is(
            "span",
            {
              class: ["task-name-text", { "parent-task": t.value }],
              title: String(h)
            },
            String(h || "-")
          )
        ]);
      }
      if (u.defaultSlot)
        return u.defaultSlot({
          row: n.value,
          $index: i.value ?? -1
        });
      if (u.prop) {
        const h = n.value[u.prop];
        return h ?? "-";
      }
      return "-";
    }
  };
}
function fx(n, t, e) {
  const r = me(!1), a = me({ x: 0, y: 0 }), A = ce(() => n.value), i = me(0), s = me(null);
  let o = null;
  const l = ce(() => {
    const y = Math.floor(i.value / 1e3), m = Math.floor(y / 3600), k = Math.floor(y % 3600 / 60), D = y % 60;
    return `${String(m).padStart(2, "0")}:${String(k).padStart(2, "0")}:${String(D).padStart(2, "0")}`;
  }), u = () => {
    if (n.value.isTimerRunning && n.value.timerStartTime) {
      const y = n.value.timerElapsedTime || 0;
      i.value = Date.now() - n.value.timerStartTime + y;
    } else n.value.timerElapsedTime ? i.value = n.value.timerElapsedTime : i.value = 0;
  }, f = () => {
    o || (o = Gt(
      () => [n.value.isTimerRunning, n.value.timerStartTime, n.value.timerElapsedTime],
      () => {
        s.value && (clearInterval(s.value), s.value = null), n.value.isTimerRunning ? (u(), s.value = window.setInterval(u, 1e3)) : u();
      },
      { immediate: !0 }
    ));
  };
  (n.value.isTimerRunning || n.value.timerElapsedTime) && f();
  const h = (y) => {
    window.dispatchEvent(new CustomEvent("close-all-taskbar-menus"));
    const m = n.value.type || "task";
    if (m !== "task" && m !== "story") {
      y.preventDefault(), r.value = !1;
      return;
    }
    y.preventDefault(), r.value = !0, a.value = { x: y.clientX, y: y.clientY };
  }, c = () => {
    r.value = !1;
  }, p = (y) => {
    var D;
    if (!r.value) return;
    const m = y.target, k = (D = e == null ? void 0 : e.value) == null ? void 0 : D.menuRef;
    k && k.contains(m) || c();
  }, w = (y, m) => {
    t("delete", y, m), c();
  };
  return sA(() => {
    window.addEventListener("close-all-taskbar-menus", c), document.addEventListener("click", p);
  }), ga(() => {
    window.removeEventListener("close-all-taskbar-menus", c), document.removeEventListener("click", p), s.value && clearInterval(s.value), o && o();
  }), {
    contextMenuVisible: r,
    contextMenuPosition: a,
    contextMenuTask: A,
    handleContextMenu: h,
    closeContextMenu: c,
    handleTaskDelete: w,
    timerElapsed: i,
    formattedTimer: l
  };
}
const $u = /* @__PURE__ */ new Map();
function c5(n) {
  const { taskId: t, event: e } = n.detail, r = $u.get(t);
  r && r(e);
}
function hx(n, t) {
  const e = $u.size === 0;
  $u.set(n, t), e && window.addEventListener("task-row-drag-over", c5);
}
function gx(n) {
  $u.delete(n), $u.size === 0 && window.removeEventListener("task-row-drag-over", c5);
}
function vx(n, t, e, r, a, A, i, s, o, l, u) {
  const f = () => {
    o && o("toggle", n.value);
  }, h = () => {
    (t.value || e.value) && !r.value && o && o("toggle", n.value);
  }, c = (B) => {
    B.stopPropagation(), o && o("dblclick", n.value);
  }, p = () => {
    a.value || s && s(n.value.id);
  }, w = () => {
    a.value || s && s(null);
  }, y = () => {
    a.value = !0;
  }, m = () => {
    a.value = !1;
  }, k = (B) => {
    if (!i.value) return;
    const O = B.target;
    O.tagName === "BUTTON" || O.tagName === "INPUT" || O.tagName === "SELECT" || O.tagName === "TEXTAREA" || O.closest(".collapse-btn") || O.closest(".task-context-menu") || A.value && l && l(n.value, A.value, B);
  }, D = (B) => {
    !i.value || !A.value || !u || u(n.value, A.value, B);
  };
  return sA(() => {
    window.addEventListener("splitter-drag-start", y), window.addEventListener("splitter-drag-end", m), hx(n.value.id, D);
  }), ga(() => {
    window.removeEventListener("splitter-drag-start", y), window.removeEventListener("splitter-drag-end", m), gx(n.value.id);
  }), {
    handleToggle: f,
    handleRowClick: h,
    handleTaskRowDoubleClick: c,
    handleMouseEnter: p,
    handleMouseLeave: w,
    handleMouseDown: k
  };
}
function px() {
  const n = Mr("gantt-column-slots", {});
  return {
    columnSlots: n,
    hasColumnSlot: (r) => {
      const a = `column-${r}`;
      return !!n[a];
    },
    renderColumnSlot: (r, a) => {
      const A = `column-${r}`, i = n[A];
      return i ? i(a) : null;
    }
  };
}
const mx = ["data-task-id"], wx = {
  key: 0,
  class: "milestone-spacer"
}, yx = {
  key: 1,
  class: "leaf-spacer"
}, Bx = {
  key: 0,
  class: "milestone-spacer"
}, bx = {
  key: 1,
  class: "leaf-spacer"
}, Cx = {
  key: 2,
  class: "resource-row-name"
}, kx = {
  key: 0,
  class: "resource-warning-icon",
  viewBox: "0 0 24 24",
  fill: "none",
  xmlns: "http://www.w3.org/2000/svg"
}, Tx = {
  key: 1,
  class: "resource-avatar"
}, xx = ["src", "alt"], Dx = { class: "resource-name-text" }, Ex = {
  key: 0,
  class: "milestone-empty-col"
}, Sx = {
  key: 4,
  class: "assignee-info"
}, Fx = { class: "assignee-avatars-container" }, Ux = ["src", "alt"], Lx = {
  key: 1,
  class: "avatar-text"
}, Ix = ["title"], Qx = /* @__PURE__ */ hn({
  __name: "TaskRow",
  props: {
    task: {},
    level: {},
    rowIndex: {},
    isHovered: { type: Boolean },
    hoveredTaskId: {},
    onHover: {},
    columns: {},
    declarativeColumns: {},
    renderMode: { default: "default" },
    getColumnWidthStyle: {},
    disableChildrenRender: { type: Boolean },
    showTaskIcon: { type: Boolean },
    enableDrag: { type: Boolean },
    dragStart: {},
    dragOver: {},
    taskListRowClassName: {},
    taskListRowStyle: { type: [Boolean, null, String, Object, Array, Function] }
  },
  emits: [
    "toggle",
    "dblclick",
    "contextmenu",
    "start-timer",
    "stop-timer",
    "add-predecessor",
    "add-successor",
    "delete"
  ],
  setup(n, { emit: t }) {
    const e = n, r = t, { t: a } = Cs(), A = ce(() => {
      var Xe;
      return ((Xe = a.value) == null ? void 0 : Xe.overtime) ?? "";
    }), i = ce(() => {
      var Xe;
      return ((Xe = a.value) == null ? void 0 : Xe.overdue) ?? "";
    }), s = ce(() => {
      var Xe;
      return ((Xe = a.value) == null ? void 0 : Xe.days) ?? "";
    }), o = Jl(), l = ce(() => !!o["custom-task-content"]), { viewMode: u } = c0(), f = Mr(
      "resourceTaskLayouts",
      ce(() => /* @__PURE__ */ new Map())
    ), h = Mr(
      "gantt-fixed-column-offsets",
      ce(() => /* @__PURE__ */ new Map())
    ), c = (Xe) => {
      const Ye = h.value.get(Xe);
      return Ye ? Ye.side === "left" ? { left: `${Ye.baseOffset}px` } : { right: `${Ye.baseOffset}px` } : {};
    }, p = ce(() => u.value === "resource" && "tasks" in e.task), w = ce(() => {
      if (!p.value) return !1;
      const Xe = e.task;
      return ST(Xe);
    }), y = Mr(
      "gantt-row-height",
      ce(() => 51)
    ), m = Mr(
      "taskRowLayouts",
      ce(() => ({ taskHeights: /* @__PURE__ */ new Map() }))
    ), k = ce(() => {
      if (p.value) {
        const Xe = String(e.task.id), Ye = f.value.get(Xe);
        return (Ye == null ? void 0 : Ye.totalHeight) || y.value + 5;
      }
      return m.value.taskHeights.get(e.task.id) || y.value;
    }), D = Mr(
      "enable-task-list-context-menu",
      ce(() => !0)
    ), B = Mr(
      "task-list-context-menu-slot",
      ce(() => !1)
    ), O = Mr(
      "declarative-task-list-context-menu",
      ce(() => null)
    ), q = ce(() => !!D.value), G = ce(() => D.value ? !B.value : !1), W = ce(() => {
      if (!D.value || !B.value)
        return !1;
      const Xe = O.value;
      if ((Xe == null ? void 0 : Xe.taskType) !== void 0) {
        const Ye = e.task.type || "task";
        return (Array.isArray(Xe.taskType) ? Xe.taskType : [Xe.taskType]).includes(Ye);
      }
      return !0;
    }), F = Bm(e, "task"), Y = Bm(e, "level"), {
      indent: T,
      hasChildren: E,
      isStoryTask: Q,
      isMilestoneGroup: x,
      isMilestoneTask: oe,
      isParentTask: J,
      isOvertime: S,
      overdueDays: I,
      progressClass: N,
      customRowClass: se,
      customRowStyle: Z
    } = cx(
      F,
      Y,
      ce(() => e.rowIndex),
      ce(() => e.taskListRowClassName),
      ce(() => e.taskListRowStyle)
    ), { hasColumnSlot: C, renderColumnSlot: H } = px(), { isFirstColumn: M, getDeclarativeColumnAlign: te, renderDeclarativeColumn: ie } = dx(
      F,
      J,
      x,
      Q,
      E,
      ce(() => e.showTaskIcon),
      ce(() => e.rowIndex)
    ), we = me(null), {
      contextMenuVisible: ve,
      contextMenuPosition: le,
      contextMenuTask: _e,
      handleContextMenu: De,
      closeContextMenu: ze,
      handleTaskDelete: nt,
      timerElapsed: Qe,
      formattedTimer: ne
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
    } = fx(F, r, we), gt = (Xe) => {
      if (!q.value) {
        Xe.preventDefault();
        return;
      }
      De(Xe);
    }, je = me(null), ot = me(!1), {
      handleToggle: Ie,
      handleRowClick: It,
      handleTaskRowDoubleClick: dt,
      handleMouseEnter: Dt,
      handleMouseLeave: Ct,
      handleMouseDown: Ve
    } = vx(
      F,
      Q,
      E,
      x,
      ot,
      je,
      ce(() => e.enableDrag),
      e.onHover,
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      r,
      e.dragStart,
      e.dragOver
    ), ht = ce(() => e.renderMode === "declarative" && e.declarativeColumns ? e.declarativeColumns : e.columns), K = ce(() => ({
      isRowContent: !0,
      task: e.task,
      level: e.level,
      indent: T.value,
      isHovered: e.isHovered ?? !1,
      hoveredTaskId: e.hoveredTaskId ?? null,
      isParent: J.value,
      hasChildren: E.value,
      collapsed: !!e.task.collapsed,
      formattedTimer: ne.value,
      timerRunning: !!e.task.isTimerRunning,
      timerElapsed: Qe.value,
      isOvertime: S(),
      overdueDays: I(),
      overtimeText: A.value,
      overdueText: i.value,
      daysText: s.value,
      progressClass: N.value
    })), X = ce(() => {
      if (p.value) {
        const Xe = e.task;
        if (Xe.color)
          return Xe.color;
      }
      return e.task.barColor ? e.task.barColor : null;
    }), ke = ce(() => X.value ? { "--left-border-color": X.value } : {}), Je = ce(() => {
      const Xe = e.task, Ye = Xe.avatar, Kt = Xe.assignee;
      let it = [];
      Ye && (it = Array.isArray(Ye) ? Ye : [Ye]);
      let qt = [];
      Kt && (qt = Array.isArray(Kt) ? Kt : [Kt]);
      const hr = it.length > 0 ? it.map((xr) => ({ type: "image", url: xr })) : qt.map((xr) => ({ type: "text", name: xr })), Nt = qt.join(`
`) || "-";
      return {
        avatars: hr,
        nameText: Nt,
        hasMultiple: hr.length > 1
      };
    }), pt = ce(() => {
      const Xe = e.task.endDate;
      if (!Xe) return "-";
      const Ye = new Date(Xe);
      if (isNaN(Ye.getTime())) return Xe;
      const Kt = hA(Xe, Ye), it = Kt.getFullYear(), qt = String(Kt.getMonth() + 1).padStart(2, "0"), hr = String(Kt.getDate()).padStart(2, "0");
      return `${it}-${qt}-${hr}`;
    });
    return (Xe, Ye) => {
      var Kt;
      return $(), ee("div", null, [
        _("div", {
          ref_key: "taskRowRef",
          ref: je,
          class: tr(["task-row", {
            "task-row-hovered": n.isHovered,
            "task-type-resource": p.value,
            "parent-task": Te(J),
            "milestone-group-row": Te(x),
            "task-type-story": Te(Q),
            "task-type-task": e.task.type === "task",
            "task-type-milestone": Te(oe),
            [Te(se)]: Te(se)
          }]),
          "data-task-id": e.task.id,
          style: Mt([Te(Z), ke.value, { height: `${k.value}px` }]),
          onClick: Ye[0] || (Ye[0] = //@ts-ignore
          (...it) => Te(It) && Te(It)(...it)),
          onDblclick: Ye[1] || (Ye[1] = //@ts-ignore
          (...it) => Te(dt) && Te(dt)(...it)),
          onMousedown: Ye[2] || (Ye[2] = //@ts-ignore
          (...it) => Te(Ve) && Te(Ve)(...it)),
          onMouseenter: Ye[3] || (Ye[3] = //@ts-ignore
          (...it) => Te(Dt) && Te(Dt)(...it)),
          onMouseleave: Ye[4] || (Ye[4] = //@ts-ignore
          (...it) => Te(Ct) && Te(Ct)(...it)),
          onContextmenu: gt
        }, [
          n.renderMode === "declarative" && n.declarativeColumns ? ($(!0), ee(St, { key: 0 }, nr(ht.value, (it, qt) => ($(), ee("div", {
            key: qt,
            class: tr(["col", [
              it.cssClass,
              {
                "col-name": Te(M)(qt),
                // 第一列始终固定(充当名称列角色),其余按 fixed 属性决定
                "col-fixed": Te(M)(qt) || it.fixed === "left" || it.fixed === !0,
                "col-fixed-right": it.fixed === "right"
              }
            ]]),
            style: Mt([
              n.getColumnWidthStyle ? n.getColumnWidthStyle(it) : {},
              Te(te)(it),
              Te(M)(qt) ? { left: "0px" } : c(it.prop || it.key || "")
            ])
          }, [
            Te(M)(qt) ? ($(), ee("div", {
              key: 0,
              style: Mt({ paddingLeft: Te(T) }),
              class: "first-col-wrapper"
            }, [
              na(xm, {
                collapsed: !!e.task.collapsed,
                visible: (Te(Q) || Te(E)) && !Te(x),
                onToggle: Te(Ie)
              }, null, 8, ["collapsed", "visible", "onToggle"]),
              Te(x) ? ($(), ee("span", wx)) : vt("", !0),
              !Te(J) && !Te(x) && n.showTaskIcon === !1 ? ($(), ee("span", yx)) : vt("", !0),
              ($(), Ir(ro(Te(fd)), {
                render: () => Te(ie)(it, qt)
              }, null, 8, ["render"]))
            ], 4)) : ($(), Ir(ro(Te(fd)), {
              key: 1,
              render: () => Te(ie)(it, qt)
            }, null, 8, ["render"]))
          ], 6))), 128)) : ($(), ee(St, { key: 1 }, [
            _("div", {
              class: "col col-name col-fixed",
              style: Mt({ paddingLeft: Te(T), left: "0px" })
            }, [
              na(xm, {
                collapsed: !!e.task.collapsed,
                visible: (Te(Q) || Te(E)) && !Te(x),
                onToggle: Te(Ie)
              }, null, 8, ["collapsed", "visible", "onToggle"]),
              Te(x) ? ($(), ee("span", Bx)) : vt("", !0),
              !Te(J) && !Te(x) && n.showTaskIcon === !1 && !p.value ? ($(), ee("span", bx)) : vt("", !0),
              p.value ? ($(), ee("div", Cx, [
                w.value ? ($(), ee("svg", kx, [...Ye[9] || (Ye[9] = [
                  _("path", {
                    d: "M12 2L2 20h20L12 2z",
                    fill: "var(--gantt-danger, #f56c6c)"
                  }, null, -1),
                  _("path", {
                    d: "M12 8v6M12 16h.01",
                    stroke: "#fff",
                    "stroke-width": "2",
                    "stroke-linecap": "round"
                  }, null, -1)
                ])])) : vt("", !0),
                e.task.avatar ? ($(), ee("div", Tx, [
                  _("img", {
                    src: e.task.avatar,
                    alt: e.task.name
                  }, null, 8, xx)
                ])) : vt("", !0),
                _("span", Dx, Ee(e.task.name || "-"), 1)
              ])) : ($(), Ir(ux, {
                key: 3,
                task: e.task,
                "is-parent-task": Te(J),
                "has-children": Te(E),
                "is-story-task": Te(Q),
                "is-milestone-group": Te(x),
                "is-milestone-task": Te(oe),
                "show-task-icon": n.showTaskIcon !== !1,
                "formatted-timer": Te(ne),
                "is-overtime": !!Te(S)(),
                "overdue-days": Te(I)(),
                "overtime-text": A.value,
                "overdue-text": i.value,
                "days-text": s.value,
                "has-content-slot": l.value,
                "render-column-slot": Te(H),
                "has-column-slot": Te(C)
              }, {
                "custom-task-content": qa(() => [
                  Nn(Xe.$slots, "custom-task-content", XA(K.value, { type: "task-row" }), void 0, !0)
                ]),
                _: 3
              }, 8, ["task", "is-parent-task", "has-children", "is-story-task", "is-milestone-group", "is-milestone-task", "show-task-icon", "formatted-timer", "is-overtime", "overdue-days", "overtime-text", "overdue-text", "days-text", "has-content-slot", "render-column-slot", "has-column-slot"]))
            ], 4),
            ($(!0), ee(St, null, nr(n.columns, (it) => ($(), ee("div", {
              key: it.key,
              class: tr(["col", [
                it.cssClass || `col-${it.key}`,
                {
                  "col-fixed": it.fixed === "left" || it.fixed === !0,
                  "col-fixed-right": it.fixed === "right"
                }
              ]]),
              style: Mt([
                n.getColumnWidthStyle ? n.getColumnWidthStyle(it) : void 0,
                c(it.key)
              ])
            }, [
              Te(x) ? ($(), ee("div", Ex)) : ($(), ee(St, { key: 1 }, [
                Te(C)(it.key) ? ($(), Ir(ro(Te(fd)), {
                  key: 0,
                  render: () => Te(H)(it.key, {
                    task: e.task,
                    column: it,
                    value: e.task[it.key]
                  })
                }, null, 8, ["render"])) : it.formatter ? ($(), ee(St, { key: 1 }, [
                  fn(Ee(it.formatter(e.task, it)), 1)
                ], 64)) : p.value ? ($(), ee(St, { key: 2 }, [
                  fn(Ee(e.task[it.key] || "-"), 1)
                ], 64)) : it.key === "predecessor" ? ($(), ee(St, { key: 3 }, [
                  fn(Ee(Te(lp)(e.task.predecessor)), 1)
                ], 64)) : it.key === "assignee" ? ($(), ee("div", Sx, [
                  _("div", Fx, [
                    ($(!0), ee(St, null, nr(Je.value.avatars, (qt, hr) => ($(), ee("div", {
                      key: hr,
                      class: "avatar",
                      style: Mt({
                        zIndex: hr + 1,
                        marginLeft: hr > 0 ? "-8px" : "0"
                      })
                    }, [
                      qt.type === "image" ? ($(), ee("img", {
                        key: 0,
                        src: qt.url,
                        alt: `avatar-${hr}`
                      }, null, 8, Ux)) : ($(), ee("span", Lx, Ee(qt.name.charAt(0).toUpperCase()), 1))
                    ], 4))), 128))
                  ]),
                  _("span", {
                    class: "assignee-name",
                    title: Je.value.nameText
                  }, Ee(Je.value.nameText), 9, Ix)
                ])) : it.key === "startDate" ? ($(), ee(St, { key: 5 }, [
                  fn(Ee(e.task.startDate || "-"), 1)
                ], 64)) : it.key === "endDate" ? ($(), ee(St, { key: 6 }, [
                  fn(Ee(pt.value), 1)
                ], 64)) : it.key === "estimatedHours" ? ($(), ee(St, { key: 7 }, [
                  fn(Ee(e.task.estimatedHours || "-"), 1)
                ], 64)) : it.key === "actualHours" ? ($(), ee(St, { key: 8 }, [
                  fn(Ee(e.task.actualHours || "-"), 1)
                ], 64)) : it.key === "progress" ? ($(), ee("span", {
                  key: 9,
                  class: tr(["progress-value", Te(N)])
                }, Ee(e.task.progress != null ? e.task.progress + "%" : "-"), 3)) : ($(), ee(St, { key: 10 }, [
                  fn(Ee(e.task[it.key] || "-"), 1)
                ], 64))
              ], 64))
            ], 6))), 128))
          ], 64))
        ], 46, mx),
        G.value ? ($(), Ir(u5, {
          key: 0,
          ref_key: "taskContextMenuRef",
          ref: we,
          visible: Te(ve),
          task: Te(_e),
          position: Te(le),
          onClose: Te(ze),
          onStartTimer: Ye[5] || (Ye[5] = (it) => Xe.$emit("start-timer", e.task)),
          onStopTimer: Ye[6] || (Ye[6] = (it) => Xe.$emit("stop-timer", e.task)),
          onAddPredecessor: Ye[7] || (Ye[7] = (it) => Xe.$emit("add-predecessor", e.task)),
          onAddSuccessor: Ye[8] || (Ye[8] = (it) => Xe.$emit("add-successor", e.task)),
          onDelete: Te(nt)
        }, null, 8, ["visible", "task", "position", "onClose", "onDelete"])) : vt("", !0),
        ($(), Ir(es, { to: "body" }, [
          W.value && Te(ve) && ((Kt = Te(O)) != null && Kt.defaultSlot) ? ($(), ee("div", {
            key: 0,
            class: "gantt-context-menu-wrapper",
            style: Mt({
              position: "fixed",
              left: `${Te(le).x}px`,
              top: `${Te(le).y}px`,
              zIndex: 9999
            })
          }, [
            ($(), Ir(ro(Te(O).defaultSlot), {
              row: Te(_e),
              $index: e.rowIndex ?? -1
            }, null, 8, ["row", "$index"]))
          ], 4)) : vt("", !0)
        ]))
      ]);
    };
  }
}), Mx = /* @__PURE__ */ Fn(Qx, [["__scopeId", "data-v-c63f6c57"]]), _x = 320, Sm = 280, Rx = 1160;
function Kl(n, t, e) {
  if (n == null)
    return e;
  if (typeof n == "number")
    return n;
  if (typeof n == "string") {
    const r = n.trim();
    if (r.endsWith("%")) {
      const A = parseFloat(r);
      if (!isNaN(A))
        return Math.round(t * A / 100);
    }
    const a = parseFloat(r);
    if (!isNaN(a))
      return a;
  }
  return e;
}
const Fm = [
  {
    type: "name",
    key: "taskName",
    label: "任务名称",
    cssClass: "col-name",
    visible: !0
  },
  {
    type: "predecessor",
    key: "predecessor",
    label: "前置任务",
    cssClass: "col-pre",
    visible: !0
  },
  {
    type: "assignee",
    key: "assignee",
    label: "负责人",
    cssClass: "col-assignee",
    visible: !0
  },
  {
    type: "startDate",
    key: "startDate",
    label: "开始日期",
    cssClass: "col-date",
    visible: !0
  },
  {
    type: "endDate",
    key: "endDate",
    label: "结束日期",
    cssClass: "col-date",
    visible: !0
  },
  {
    type: "estimatedHours",
    key: "estimatedHours",
    label: "预估工时",
    cssClass: "col-hours",
    visible: !0
  },
  {
    type: "actualHours",
    key: "actualHours",
    label: "实际工时",
    cssClass: "col-hours",
    visible: !0
  },
  {
    type: "progress",
    key: "progress",
    label: "进度",
    cssClass: "col-progress",
    visible: !0
  }
], Nx = 320, Um = 280, Hx = 1160, d5 = [
  {
    type: "title",
    key: "title",
    label: "职务",
    cssClass: "col-title",
    visible: !0
  },
  {
    type: "type",
    key: "type",
    label: "类别",
    cssClass: "col-type",
    visible: !0
  },
  {
    type: "department",
    key: "department",
    label: "部门",
    cssClass: "col-department",
    visible: !0
  },
  {
    type: "capacity",
    key: "capacity",
    label: "利用率",
    cssClass: "col-capacity",
    visible: !0,
    formatter: (n) => n.capacity != null ? `${n.capacity}%` : "-"
  }
];
function Ox(n) {
  const t = n.dragThreshold ?? 5, e = me({
    isDragging: !1,
    isPreparing: !1,
    draggedTask: null,
    draggedElement: null,
    ghostElement: null,
    dropTargetTask: null,
    dropPosition: null,
    startX: 0,
    startY: 0
  }), r = (h, c, p) => {
    n.enabled && (h.type === "milestone-group" || h.type === "milestone" || (p.preventDefault(), p.stopPropagation(), e.value.isPreparing = !0, e.value.draggedTask = h, e.value.draggedElement = c, e.value.startX = p.clientX, e.value.startY = p.clientY));
  }, a = (h) => {
    if (!e.value.isPreparing || e.value.isDragging) return;
    const c = e.value.draggedTask, p = e.value.draggedElement;
    e.value.isDragging = !0, e.value.isPreparing = !1;
    const w = p.cloneNode(!0);
    w.style.position = "fixed", w.style.left = "-9999px", w.style.top = "-9999px", w.style.width = `${p.offsetWidth}px`, w.style.height = `${p.offsetHeight}px`, w.style.opacity = "0.6", w.style.pointerEvents = "none", w.style.zIndex = "999999", w.style.boxShadow = "0 8px 24px rgba(0, 0, 0, 0.3)", w.classList.add("task-row-dragging"), (document.querySelector(".gantt-fullscreen") || document.body).appendChild(w), e.value.ghostElement = w, p.style.opacity = "0.4", document.body.style.userSelect = "none", document.body.style.webkitUserSelect = "none", document.body.style.cursor = "move", window.dispatchEvent(
      new CustomEvent("task-row-drag-start", {
        detail: { task: c }
      })
    ), n.onDragStart && n.onDragStart(c), A(h);
  }, A = (h) => {
    if (e.value.ghostElement) {
      const c = e.value.ghostElement;
      c.style.left = `${h.clientX + 10}px`, c.style.top = `${h.clientY - 25}px`;
    }
  }, i = (h, c, p) => {
    if (!e.value.isDragging || !e.value.draggedTask) return;
    if (h.id === e.value.draggedTask.id) {
      s();
      return;
    }
    if (f(e.value.draggedTask, h)) {
      s();
      return;
    }
    p.preventDefault(), p.stopPropagation();
    const y = h.children && h.children.length > 0 ? "child" : "after";
    e.value.dropTargetTask = h, e.value.dropPosition = y, document.querySelectorAll(".task-row-drop-target").forEach((m) => {
      m.classList.remove("task-row-drop-target", "drop-after", "drop-child");
    }), c.classList.add("task-row-drop-target"), y === "after" ? c.classList.add("drop-after") : c.classList.add("drop-child"), n.onDragOver && n.onDragOver(h, y);
  }, s = () => {
    e.value.dropTargetTask = null, e.value.dropPosition = null, document.querySelectorAll(".task-row-drop-target").forEach((h) => {
      h.classList.remove("task-row-drop-target", "drop-after", "drop-child");
    });
  }, o = () => {
    if (e.value.isPreparing && !e.value.isDragging) {
      e.value.isPreparing = !1, e.value.draggedTask = null, e.value.draggedElement = null;
      return;
    }
    if (!e.value.isDragging) return;
    const h = e.value.draggedTask, c = e.value.dropTargetTask, p = e.value.dropPosition;
    e.value.draggedElement && (e.value.draggedElement.style.opacity = ""), e.value.ghostElement && e.value.ghostElement.parentElement && e.value.ghostElement.parentElement.removeChild(e.value.ghostElement), s(), document.body.style.userSelect = "", document.body.style.webkitUserSelect = "", document.body.style.cursor = "", window.dispatchEvent(new CustomEvent("task-row-drag-end")), h && c && p && n.onDrop && n.onDrop(h, c, p), e.value = {
      isDragging: !1,
      isPreparing: !1,
      draggedTask: null,
      draggedElement: null,
      ghostElement: null,
      dropTargetTask: null,
      dropPosition: null,
      startX: 0,
      startY: 0
    };
  }, l = (h) => {
    if (e.value.isPreparing && !e.value.isDragging) {
      const c = Math.abs(h.clientX - e.value.startX), p = Math.abs(h.clientY - e.value.startY);
      Math.sqrt(c * c + p * p) > t && a(h);
      return;
    }
    if (e.value.isDragging) {
      A(h);
      const c = e.value.ghostElement;
      c && (c.style.display = "none");
      const p = document.elementFromPoint(h.clientX, h.clientY);
      if (c && (c.style.display = ""), p) {
        const w = p.closest(".task-row");
        if (w && w.dataset.taskId) {
          const y = Number(w.dataset.taskId);
          window.dispatchEvent(
            new CustomEvent("task-row-drag-over", {
              detail: { taskId: y, event: h }
            })
          );
        }
      }
    }
  }, u = () => {
    (e.value.isDragging || e.value.isPreparing) && o();
  }, f = (h, c) => {
    if (!h.children) return !1;
    for (const p of h.children)
      if (p.id === c.id || f(p, c)) return !0;
    return !1;
  };
  return sA(() => {
    document.addEventListener("mousemove", l), document.addEventListener("mouseup", u);
  }), ga(() => {
    document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", u), e.value.ghostElement && e.value.ghostElement.parentElement && e.value.ghostElement.parentElement.removeChild(e.value.ghostElement);
  }), {
    dragState: e,
    startDrag: r,
    handleDragOver: i,
    endDrag: o
  };
}
function Px(n) {
  let t = !1;
  if (typeof n.type == "object") {
    const o = n.type;
    t = o.name === "TaskListColumn" || o.__name === "TaskListColumn" || // 检查文件名(setup script 组件)
    o.__file && o.__file.includes("TaskListColumn");
  }
  if (!t)
    return null;
  const e = n.props || {}, r = n.children, a = r == null ? void 0 : r.header, A = r == null ? void 0 : r.default, i = e.fixed;
  let s;
  return i === "" || i === "true" ? s = !0 : i === "false" ? s = !1 : s = i, {
    prop: e.prop,
    label: e.label,
    width: e.width,
    align: e.align || "left",
    cssClass: e.cssClass,
    fixed: s,
    headerSlot: a,
    defaultSlot: A
  };
}
function Mu(n) {
  var a;
  const t = (a = n.default) == null ? void 0 : a.call(n);
  if (!t || !Array.isArray(t))
    return [];
  const e = [], r = (A) => {
    for (const i of A) {
      if (!i)
        continue;
      if (typeof i.type == "symbol") {
        i.children && Array.isArray(i.children) && r(i.children);
        continue;
      }
      const s = Px(i);
      s && e.push(s), i.children && Array.isArray(i.children) && r(i.children);
    }
  };
  return r(t), e;
}
function Wx(n, t, e) {
  const r = () => typeof n == "string" ? n : n.value, a = fi(
    r() === "declarative" ? Mu(t) : []
  );
  Gt(
    () => r() === "declarative" ? t.default ?? null : null,
    () => {
      a.value = r() === "declarative" ? Mu(t) : [];
    }
  );
  const A = ce(() => (typeof n == "string" ? n : n.value) === "declarative" ? a.value : e || []);
  return {
    declarativeColumns: a,
    finalColumns: A,
    getColumnWidthStyle: (o, l) => {
      if (!o.width) return {};
      let u;
      if (typeof o.width == "string" && o.width.includes("%"))
        if (l && l > 0) {
          const f = parseFloat(o.width) / 100;
          u = `${Math.floor(l * f)}px`;
        } else
          return {};
      else
        typeof o.width == "number" ? u = `${o.width}px` : typeof o.width == "string" ? /\d+(px|rem|em|%)/.test(o.width) ? u = o.width : u = `${o.width}px` : u = String(o.width);
      return {
        flex: `0 0 ${u}`,
        minWidth: u,
        maxWidth: u
      };
    },
    getColumnAlignStyle: (o) => !o || o === "left" ? {} : {
      justifyContent: o === "center" ? "center" : "flex-end",
      textAlign: o
    }
  };
}
const Ec = 5;
function Kx(n) {
  const t = me(0), e = me(0), r = Mr("gantt-view-mode", me("task")), a = Mr(
    "gantt-data-source",
    ce(() => [])
  ), A = Mr(
    "resourceTaskLayouts",
    ce(() => /* @__PURE__ */ new Map())
  ), i = Mr(
    "gantt-row-height",
    ce(() => 51)
  ), s = Mr(
    "taskRowLayouts",
    ce(() => ({ cumulativeHeights: [0], totalHeight: 0, taskHeights: /* @__PURE__ */ new Map() }))
  ), o = (m, k = 0) => {
    const D = [];
    for (const B of m)
      D.push({ task: B, level: k }), !(B.type === "milestone-group") && B.children && B.children.length > 0 && !B.collapsed && D.push(...o(B.children, k + 1));
    return D;
  }, l = ce(() => o(n.value)), u = ce(() => {
    if (r.value !== "resource") return [];
    const m = a.value, k = [0];
    let D = 0;
    return m.forEach((B) => {
      const O = A.value.get(B.id), q = (O == null ? void 0 : O.totalHeight) || i.value;
      D += q, k.push(D);
    }), k;
  }), f = (m) => {
    const k = u.value;
    let D = 0, B = k.length - 1;
    for (; D < B; ) {
      const O = Math.floor((D + B) / 2);
      k[O] <= m ? D = O + 1 : B = O;
    }
    return Math.max(0, D - 1);
  }, h = ce(() => {
    const m = t.value, k = e.value || 600;
    if (r.value === "resource") {
      const D = u.value;
      if (D.length <= 1) return { startIndex: 0, endIndex: 0 };
      const B = a.value.length;
      let O = Math.max(0, f(m) - Ec);
      const q = m + k;
      let G = Math.min(
        D.length - 1,
        f(q) + Ec + 1
      );
      return {
        startIndex: Math.min(O, B),
        endIndex: Math.min(G, B)
      };
    } else {
      const D = s.value.cumulativeHeights, B = l.value.length;
      if (B === 0 || D.length <= 1) return { startIndex: 0, endIndex: 0 };
      const O = (F) => {
        let Y = 0, T = D.length - 1;
        for (; Y < T; ) {
          const E = Math.floor((Y + T) / 2);
          D[E] <= F ? Y = E + 1 : T = E;
        }
        return Math.max(0, Y - 1);
      }, q = Math.max(0, O(m) - Ec), G = m + k, W = Math.min(
        B,
        O(G) + Ec + 1
      );
      return {
        startIndex: q,
        endIndex: Math.min(B, Math.max(q + 1, W))
      };
    }
  }), c = ce(() => {
    const { startIndex: m, endIndex: k } = h.value;
    return l.value.slice(m, k).map((B, O) => ({
      ...B,
      rowIndex: m + O
    }));
  }), p = ce(() => {
    if (r.value === "resource") {
      const m = u.value;
      return m.length > 0 ? m[m.length - 1] : 0;
    }
    return s.value.totalHeight;
  }), w = ce(() => r.value === "resource" ? u.value[h.value.startIndex] || 0 : s.value.cumulativeHeights[h.value.startIndex] || 0), y = ce(() => {
    if (r.value === "resource") {
      const D = h.value.endIndex, B = u.value[D] || 0;
      return Math.max(0, p.value - B);
    }
    const m = h.value.endIndex, k = s.value.cumulativeHeights[m] || 0;
    return Math.max(0, s.value.totalHeight - k);
  });
  return {
    // 状态
    taskListScrollTop: t,
    taskListBodyHeight: e,
    // 计算属性
    flattenedTasks: l,
    visibleTaskRange: h,
    visibleTasks: c,
    totalContentHeight: p,
    startSpacerHeight: w,
    endSpacerHeight: y,
    // 方法
    getFlattenedVisibleTasks: o
  };
}
function $x(n, t, e) {
  const r = me(null), a = me(null), A = me(0);
  let i = null, s = null;
  const o = () => {
    if (r.value) {
      const f = r.value.offsetWidth;
      Math.abs(f - A.value) > 1 && (A.value = f);
    }
  };
  return Gt(n, (f) => {
    if (!f && (o(), a.value)) {
      const h = a.value.clientHeight;
      Math.abs(h - e.value) > 1 && (e.value = h);
    }
  }), {
    taskListRef: r,
    taskListBodyRef: a,
    cachedContainerWidth: A,
    initializeResizeObservers: () => {
      r.value && (i = new ResizeObserver((f) => {
        if (!n.value)
          for (const h of f)
            A.value = h.contentRect.width;
      }), i.observe(r.value)), a.value && (e.value = a.value.clientHeight, t.value = a.value.scrollTop, s = new ResizeObserver((f) => {
        if (!n.value)
          for (const h of f)
            e.value = h.contentRect.height;
      }), s.observe(a.value));
    },
    cleanupResizeObservers: () => {
      i && (i.disconnect(), i = null), s && (s.disconnect(), s = null);
    },
    updateContainerWidth: o
  };
}
function Vx(n) {
  if (!n.children || n.children.length === 0)
    return {
      progress: n.progress || 0,
      startDate: n.startDate || "",
      endDate: n.endDate || ""
    };
  const t = [], e = (u) => {
    u.forEach((f) => {
      t.push(f), f.children && f.children.length > 0 && e(f.children);
    });
  };
  e(n.children);
  const r = t.reduce((u, f) => u + (f.progress || 0), 0), a = t.length > 0 ? Math.round(r / t.length) : 0, A = t.filter((u) => u.startDate && u.endDate);
  if (A.length === 0)
    return {
      progress: a,
      startDate: n.startDate || "",
      endDate: n.endDate || ""
    };
  const i = A.map((u) => new Date(u.startDate)), s = A.map((u) => new Date(u.endDate)), o = new Date(Math.min(...i.map((u) => u.getTime()))), l = new Date(Math.max(...s.map((u) => u.getTime())));
  return {
    progress: a,
    startDate: o.toISOString().split("T")[0],
    endDate: l.toISOString().split("T")[0]
  };
}
function up(n, t = !1) {
  if (!n) return;
  const e = (r) => {
    r.forEach((a) => {
      if (a.children && a.children.length > 0) {
        e(a.children);
        const A = Vx(a);
        a.progress = A.progress, t || (a.startDate = A.startDate, a.endDate = A.endDate);
      }
    });
  };
  e(n);
}
function qx(n) {
  const t = [], e = (r) => {
    r.forEach((a) => {
      t.push(a), a.children && a.children.length > 0 && e(a.children);
    });
  };
  return e(n), t;
}
function jx(n) {
  const {
    tasks: t,
    hoveredTaskId: e,
    isSplitterDragging: r,
    taskListScrollTop: a,
    taskListBodyRef: A,
    updateContainerWidth: i,
    onTaskUpdate: s,
    enableParentTaskAutoSchedule: o
  } = n, l = (F) => {
    r.value || (e.value = F, window.dispatchEvent(
      new CustomEvent("task-list-hover", {
        detail: F
      })
    ));
  }, u = (F) => {
    e.value = F.detail;
  }, f = (F) => {
    F.type === "milestone" || F.type === "milestone-group" || window.dispatchEvent(
      new CustomEvent("task-row-double-click", {
        detail: F
      })
    );
  }, h = (F) => {
    if (!t.value) return;
    const Y = (E) => {
      for (const Q of E) {
        if (Q.id === F.id)
          return Object.assign(Q, F), F.children, !0;
        if (Q.children && Y(Q.children))
          return !0;
      }
      return !1;
    };
    Y(t.value);
    const T = !((o == null ? void 0 : o.value) ?? !0);
    up(t.value, T), s && s(F);
  }, c = (F) => {
    const Y = F.detail;
    h(Y);
  }, p = (F) => {
    const Y = F.detail;
    t.value && t.value.push(Y), up(t.value);
  }, w = () => {
    const F = qx(t.value);
    window.dispatchEvent(
      new CustomEvent("task-list-updated", {
        detail: F
      })
    );
  }, y = (F) => {
    const { milestoneId: Y, icon: T } = F.detail, E = (Q) => {
      for (const x of Q) {
        if (x.type === "milestone-group" && x.children) {
          const oe = x.children.find((J) => J.id === Y);
          if (oe)
            return oe.icon = T, !0;
        }
        if (x.children && E(x.children))
          return !0;
      }
      return !1;
    };
    E(t.value);
  };
  let m = !1;
  const k = (F) => {
    const Y = F.target;
    if (!Y) return;
    const T = Y.scrollTop;
    a.value = T, !m && (window.dispatchEvent(new CustomEvent("close-all-taskbar-menus")), window.dispatchEvent(
      new CustomEvent("task-list-vertical-scroll", {
        detail: { scrollTop: T }
      })
    ));
  }, D = (F) => {
    const { scrollTop: Y } = F.detail, T = A.value;
    a.value = Y, T && Math.abs(T.scrollTop - Y) > 1 && (m = !0, T.scrollTop = Y, Promise.resolve().then(() => {
      m = !1;
    }));
  }, B = (F) => {
    try {
      window.dispatchEvent(
        new CustomEvent("context-menu", {
          detail: F
        })
      );
    } catch (Y) {
      console.error("TaskList - Failed to dispatch context-menu event", Y);
    }
  }, O = () => {
    r.value = !0;
  }, q = () => {
    r.value = !1, i();
  };
  return {
    // 事件处理函数
    handleTaskRowHover: l,
    handleTaskRowDoubleClick: f,
    handleTaskListScroll: k,
    handleTaskRowContextMenu: B,
    // 生命周期方法
    registerEventListeners: () => {
      window.addEventListener("task-updated", c), window.addEventListener("task-added", p), window.addEventListener("request-task-list", w), window.addEventListener("timeline-task-hover", u), window.addEventListener(
        "timeline-vertical-scroll",
        D
      ), window.addEventListener("milestone-icon-changed", y), window.addEventListener("splitter-drag-start", O), window.addEventListener("splitter-drag-end", q);
    },
    unregisterEventListeners: () => {
      window.removeEventListener("task-updated", c), window.removeEventListener("task-added", p), window.removeEventListener("request-task-list", w), window.removeEventListener("timeline-task-hover", u), window.removeEventListener(
        "timeline-vertical-scroll",
        D
      ), window.removeEventListener("milestone-icon-changed", y), window.removeEventListener("splitter-drag-start", O), window.removeEventListener("splitter-drag-end", q);
    }
  };
}
const Yx = { class: "task-list-header" }, Gx = { class: "task-list-body-inner" }, zx = 300, Xx = /* @__PURE__ */ hn({
  __name: "TaskList",
  props: {
    tasks: {},
    useDefaultDrawer: { type: Boolean },
    taskListConfig: {},
    taskListColumnRenderMode: { default: "default" },
    enableTaskRowMove: { type: Boolean },
    taskListRowClassName: {},
    taskListRowStyle: { type: [Boolean, null, String, Object, Array, Function] },
    enableParentTaskAutoSchedule: { type: Boolean }
  },
  emits: ["task-collapse-change", "start-timer", "stop-timer", "add-predecessor", "add-successor", "delete", "task-row-moved", "resource-click"],
  setup(n, { expose: t, emit: e }) {
    const r = n, a = e, A = Jl(), i = ce(() => !!A["custom-task-content"]), { viewMode: s, dataSource: o, listConfig: l } = c0(), u = Mr("gantt-column-slots", {}), { t: f } = Cs(), h = ce(() => s.value === "resource" ? d5 : Fm), c = ce(() => {
      const je = l.value || r.taskListConfig;
      return (je == null ? void 0 : je.columns) || h.value;
    }), { declarativeColumns: p, getColumnWidthStyle: w } = Wx(
      ce(() => r.taskListColumnRenderMode || "default"),
      A,
      c.value
    );
    function y(je) {
      return je === "left" || je === !0 ? 0 : je === "right" ? 2 : 1;
    }
    const m = ce(() => {
      var ot;
      return r.taskListColumnRenderMode === "declarative" ? [...p.value].sort(
        (Ie, It) => y(Ie.fixed) - y(It.fixed)
      ) : (((ot = r.taskListConfig) == null ? void 0 : ot.columns) || Fm).filter((Ie) => Ie.visible !== !1);
    }), k = ce(() => r.taskListColumnRenderMode === "declarative" ? [] : [...c.value.filter((ot) => ot.visible !== !1)].sort((ot, Ie) => y(ot.fixed) - y(Ie.fixed))), D = ce(() => s.value === "resource" ? o.value || [] : r.tasks || []), { taskListScrollTop: B, taskListBodyHeight: O, visibleTasks: q, startSpacerHeight: G, endSpacerHeight: W } = Kx(D), F = me(null);
    function Y(je, ot) {
      if (!je.width) return 120;
      if (typeof je.width == "number") return je.width;
      const Ie = je.width.trim();
      return Ie.endsWith("%") ? Math.floor(ot * parseFloat(Ie) / 100) : parseFloat(Ie) || 120;
    }
    const T = ce(() => {
      const je = /* @__PURE__ */ new Map(), ot = r.taskListColumnRenderMode === "declarative" ? m.value : k.value, Ie = S.value || 0;
      let dt = r.taskListColumnRenderMode === "declarative" ? 0 : zx;
      for (const Ct of ot)
        if (Ct.fixed === "left" || Ct.fixed === !0) {
          const Ve = Ct.key || Ct.prop || "";
          je.set(Ve, { side: "left", baseOffset: dt }), dt += Y(Ct, Ie);
        }
      let Dt = 0;
      for (let Ct = ot.length - 1; Ct >= 0; Ct--) {
        const Ve = ot[Ct];
        if (Ve.fixed === "right") {
          const ht = Ve.key || Ve.prop || "";
          je.set(ht, { side: "right", baseOffset: Dt }), Dt += Y(Ve, Ie);
        }
      }
      return je;
    });
    Tn("gantt-fixed-column-offsets", T);
    const E = () => ({
      position: "sticky",
      left: "0px",
      zIndex: 20,
      backgroundColor: "var(--gantt-bg-secondary)"
    }), Q = (je) => {
      if (!je.fixed) return {};
      const ot = je.key || je.prop || "", Ie = T.value.get(ot);
      return Ie ? Ie.side === "left" ? {
        position: "sticky",
        left: `${Ie.baseOffset}px`,
        zIndex: 20,
        backgroundColor: "var(--gantt-bg-secondary)"
      } : {
        position: "sticky",
        right: `${Ie.baseOffset}px`,
        zIndex: 20,
        backgroundColor: "var(--gantt-bg-secondary)"
      } : {};
    }, x = me(!1), {
      taskListRef: oe,
      taskListBodyRef: J,
      cachedContainerWidth: S,
      initializeResizeObservers: I,
      cleanupResizeObservers: N,
      updateContainerWidth: se
    } = $x(x, B, O), Z = (je) => {
      if (r.taskListColumnRenderMode === "declarative")
        return w(je, S.value);
      if (!je.width) return {};
      let ot;
      if (typeof je.width == "string" && je.width.includes("%")) {
        const Ie = S.value || 0;
        if (Ie > 0) {
          const It = parseFloat(je.width) / 100;
          ot = `${Math.floor(Ie * It)}px`;
        } else
          return {};
      } else
        ot = `${je.width}px`;
      return {
        flex: `0 0 ${ot}`,
        minWidth: ot,
        maxWidth: ot
      };
    }, {
      handleTaskRowHover: C,
      handleTaskRowDoubleClick: H,
      handleTaskListScroll: M,
      handleTaskRowContextMenu: te,
      registerEventListeners: ie,
      unregisterEventListeners: we
    } = jx({
      tasks: D,
      hoveredTaskId: F,
      isSplitterDragging: x,
      taskListScrollTop: B,
      taskListBodyRef: J,
      updateContainerWidth: se,
      enableParentTaskAutoSchedule: ce(() => r.enableParentTaskAutoSchedule ?? !0)
    });
    function ve(je) {
      je.collapsed = !je.collapsed, a("task-collapse-change", je);
    }
    const le = (je) => {
      a("start-timer", je);
    }, _e = (je) => {
      a("stop-timer", je);
    }, De = (je) => {
      a("add-predecessor", je);
    }, ze = (je) => {
      a("add-successor", je);
    }, nt = (je, ot) => {
      a("delete", je, ot);
    }, Qe = (je) => {
      const { draggedTask: ot, targetTask: Ie, position: It } = je;
      r.tasks && a("task-row-moved", {
        draggedTask: ot,
        targetTask: Ie,
        position: It,
        oldParent: null,
        newParent: null
      });
    }, { startDrag: ne, handleDragOver: gt } = Ox({
      enabled: r.enableTaskRowMove ?? !1,
      onDrop: (je, ot, Ie) => {
        Qe({ draggedTask: je, targetTask: ot, position: Ie });
      }
    });
    return sA(async () => {
      I(), ie(), up(r.tasks, !(r.enableParentTaskAutoSchedule ?? !0));
    }), ga(() => {
      N(), we();
    }), t({
      getHeaderScrollWidth: () => {
        var Ie;
        const je = (Ie = oe.value) == null ? void 0 : Ie.querySelector(".task-list-header");
        if (!je) return null;
        const ot = je.scrollWidth;
        return ot > 0 ? ot : null;
      }
    }), (je, ot) => ($(), ee("div", {
      ref_key: "taskListRef",
      ref: oe,
      class: "task-list"
    }, [
      _("div", {
        ref_key: "taskListBodyRef",
        ref: J,
        class: "task-list-body",
        onScroll: ot[2] || (ot[2] = //@ts-ignore
        (...Ie) => Te(M) && Te(M)(...Ie))
      }, [
        _("div", Yx, [
          n.taskListColumnRenderMode === "declarative" ? ($(!0), ee(St, { key: 0 }, nr(m.value, (Ie, It) => ($(), ee("div", {
            key: It,
            class: tr(["col", [
              Ie.cssClass,
              {
                "col-fixed": It === 0 || Ie.fixed === "left" || Ie.fixed === !0,
                "col-fixed-right": Ie.fixed === "right"
              }
            ]]),
            style: Mt({
              ...Z(Ie),
              justifyContent: Ie.align === "center" ? "center" : Ie.align === "right" ? "flex-end" : "flex-start",
              textAlign: Ie.align || "left",
              ...It === 0 && !Ie.fixed ? {
                position: "sticky",
                left: "0px",
                zIndex: 20,
                backgroundColor: "var(--gantt-bg-secondary)"
              } : Q(Ie)
            })
          }, [
            Ie.headerSlot ? ($(), Ir(ro(Ie.headerSlot), { key: 0 })) : ($(), ee(St, { key: 1 }, [
              fn(Ee(Ie.label), 1)
            ], 64))
          ], 6))), 128)) : ($(), ee(St, { key: 1 }, [
            _("div", {
              class: "col col-name col-fixed",
              style: Mt(E())
            }, [
              Te(u)["header-name"] ? ($(), Ir(ro(Te(u)["header-name"]), { key: 0 })) : ($(), ee(St, { key: 1 }, [
                fn(Ee(Te(s) === "resource" ? Te(f).resourceName || "资源名称" : Te(f).taskName || "任务名称"), 1)
              ], 64))
            ], 4),
            ($(!0), ee(St, null, nr(k.value, (Ie) => ($(), ee("div", {
              key: Ie.key,
              class: tr(["col", [
                Ie.cssClass || `col-${Ie.key}`,
                {
                  "col-fixed": Ie.fixed === "left" || Ie.fixed === !0,
                  "col-fixed-right": Ie.fixed === "right"
                }
              ]]),
              style: Mt({
                ...Z(Ie),
                ...Q(Ie)
              })
            }, [
              Te(u)[`header-${Ie.key}`] ? ($(), Ir(ro(Te(u)[`header-${Ie.key}`]), { key: 0 })) : ($(), ee(St, { key: 1 }, [
                fn(Ee(Te(f)[Ie.key] || Ie.label), 1)
              ], 64))
            ], 6))), 128))
          ], 64))
        ]),
        _("div", Gx, [
          _("div", {
            class: "task-list-body-spacer",
            style: Mt({ height: `${Te(G)}px` })
          }, null, 4),
          ($(!0), ee(St, null, nr(Te(q), ({ task: Ie, level: It, rowIndex: dt }, Dt, Ct, Ve) => {
            var X;
            const ht = [
              Ie.id,
              Ie.name,
              Ie.collapsed,
              F.value === Ie.id,
              Ie.startDate,
              Ie.endDate,
              Ie.progress
            ];
            if (Ve && Ve.el && Ve.key === Ie.id && vT(Ve, ht)) return Ve;
            const K = ($(), Ir(Mx, {
              key: Ie.id,
              task: Ie,
              level: It,
              "row-index": dt,
              "is-hovered": F.value === Ie.id,
              "hovered-task-id": F.value,
              "on-hover": Te(C),
              columns: n.taskListColumnRenderMode === "declarative" ? [] : k.value,
              "declarative-columns": n.taskListColumnRenderMode === "declarative" ? m.value : void 0,
              "render-mode": n.taskListColumnRenderMode,
              "get-column-width-style": Z,
              "disable-children-render": !0,
              "show-task-icon": (X = r.taskListConfig) == null ? void 0 : X.showTaskIcon,
              "enable-drag": r.enableTaskRowMove,
              "drag-start": Te(ne),
              "drag-over": Te(gt),
              "task-list-row-class-name": r.taskListRowClassName,
              "task-list-row-style": r.taskListRowStyle,
              onToggle: ve,
              onDblclick: Te(H),
              onContextmenu: Te(te),
              onStartTimer: le,
              onStopTimer: _e,
              onAddPredecessor: De,
              onAddSuccessor: ze,
              onDelete: nt
            }, hi({ _: 2 }, [
              i.value ? {
                name: "custom-task-content",
                fn: qa((ke) => [
                  Nn(je.$slots, "custom-task-content", XA({ ref_for: !0 }, ke), void 0, !0)
                ]),
                key: "0"
              } : void 0,
              Te(A)["task-list-context-menu"] ? {
                name: "task-list-context-menu",
                fn: qa((ke) => [
                  Nn(je.$slots, "task-list-context-menu", XA({ ref_for: !0 }, ke), void 0, !0)
                ]),
                key: "1"
              } : void 0
            ]), 1032, ["task", "level", "row-index", "is-hovered", "hovered-task-id", "on-hover", "columns", "declarative-columns", "render-mode", "show-task-icon", "enable-drag", "drag-start", "drag-over", "task-list-row-class-name", "task-list-row-style", "onDblclick", "onContextmenu"]));
            return K.memo = ht, K;
          }, ot, 0), 128)),
          _("div", {
            class: "task-list-body-spacer",
            style: Mt({ height: `${Te(W)}px` })
          }, null, 4)
        ])
      ], 544)
    ], 512));
  }
}), f5 = /* @__PURE__ */ Fn(Xx, [["__scopeId", "data-v-2db32195"]]), Ue = {
  HOUR: "hour",
  // 小时视图 - 每列显示一小时
  DAY: "day",
  // 日视图 - 每列显示一天
  WEEK: "week",
  // 周视图 - 每列显示一周
  MONTH: "month",
  // 月视图 - 每列显示一个月
  QUARTER: "quarter",
  // 季度视图 - 每列显示一个季度
  YEAR: "year"
  // 年视图 - 每列显示一年
}, bs = {
  hour: {
    scale: Ue.HOUR,
    cellWidth: 40,
    minCellWidth: 40,
    maxCellWidth: 120,
    headerLevels: 2,
    formatters: { primary: "yyyy年MM月dd日", secondary: "HH:mm" }
  },
  day: {
    scale: Ue.DAY,
    cellWidth: 30,
    minCellWidth: 30,
    maxCellWidth: 120,
    headerLevels: 2,
    formatters: { primary: "yyyy年MM月", secondary: "dd" }
  },
  week: {
    scale: Ue.WEEK,
    cellWidth: 60,
    minCellWidth: 60,
    maxCellWidth: 240,
    headerLevels: 2,
    formatters: { primary: "yyyy年MM月", secondary: "d" }
  },
  month: {
    scale: Ue.MONTH,
    cellWidth: 60,
    minCellWidth: 60,
    maxCellWidth: 180,
    headerLevels: 2,
    formatters: { primary: "yyyy年", secondary: "MM月" }
  },
  quarter: {
    scale: Ue.QUARTER,
    cellWidth: 60,
    minCellWidth: 60,
    maxCellWidth: 120,
    headerLevels: 2,
    formatters: { primary: "yyyy年", secondary: "Q季度" }
  },
  year: {
    scale: Ue.YEAR,
    cellWidth: 180,
    minCellWidth: 180,
    maxCellWidth: 720,
    headerLevels: 2,
    formatters: { primary: "yyyy年", secondary: "上半年|下半年" }
  }
}, Jx = {
  key: 0,
  class: "anchor-tooltip"
}, Zx = /* @__PURE__ */ hn({
  __name: "LinkAnchor",
  props: {
    type: {},
    taskId: {},
    visible: { type: Boolean, default: !1 },
    isDragSource: { type: Boolean, default: !1 },
    isDragTarget: { type: Boolean, default: !1 },
    isValidTarget: { type: Boolean, default: !0 },
    enabled: { type: Boolean, default: !0 },
    globalDragging: { type: Boolean, default: !1 }
  },
  emits: ["drag-start", "drag-move", "drag-end"],
  setup(n, { emit: t }) {
    const e = n, r = t, a = Mr("gantt-view-mode", { value: "task" }), A = me(!1), i = ce(() => a.value === "resource" ? !1 : e.visible || // TaskBar 悬停
    e.globalDragging || // 全局拖拽进行中
    e.isDragSource || // 是拖拽的源任务
    e.isDragTarget || // 是拖拽的目标任务
    A.value);
    let s = null, o = null, l = !1;
    function u(p) {
      e.enabled && (p.stopPropagation(), p.preventDefault(), l = !0, r("drag-start", {
        taskId: e.taskId,
        type: e.type,
        x: p.clientX,
        y: p.clientY
      }), s = (w) => {
        l && r("drag-move", {
          x: w.clientX,
          y: w.clientY
        });
      }, o = () => {
        l && (r("drag-end", {
          taskId: e.taskId,
          type: e.type
        }), c());
      }, document.addEventListener("mousemove", s), document.addEventListener("mouseup", o));
    }
    function f() {
      e.enabled && (A.value = !0);
    }
    function h() {
      e.enabled && (A.value = !1);
    }
    function c() {
      l = !1, s && (document.removeEventListener("mousemove", s), s = null), o && (document.removeEventListener("mouseup", o), o = null);
    }
    return ga(() => {
      c();
    }), (p, w) => n.enabled && i.value ? ($(), ee("div", {
      key: 0,
      class: tr(["link-anchor", {
        "anchor-predecessor": n.type === "predecessor",
        "anchor-successor": n.type === "successor",
        "drag-source": n.isDragSource,
        "drag-target": n.isDragTarget,
        "valid-target": n.isDragTarget && n.isValidTarget,
        "invalid-target": n.isDragTarget && !n.isValidTarget,
        visible: i.value
      }]),
      onMousedown: u,
      onMouseenter: f,
      onMouseleave: h
    }, [
      !n.isDragSource && !n.isDragTarget && !n.globalDragging ? ($(), ee("div", Jx, Ee(n.type === "predecessor" ? "添加前置任务" : "添加后置任务"), 1)) : vt("", !0)
    ], 34)) : vt("", !0);
  }
}), Lm = /* @__PURE__ */ Fn(Zx, [["__scopeId", "data-v-9f46aee9"]]), eD = { class: "expanded-content" }, tD = { class: "expanded-title" }, rD = ["src"], nD = { class: "resource-name" }, aD = { class: "expanded-body" }, AD = { class: "expanded-row" }, sD = { class: "info-label" }, iD = { class: "info-value" }, oD = { class: "expanded-row" }, lD = { class: "info-label" }, uD = { class: "info-value" }, cD = {
  key: 0,
  class: "conflict-section"
}, dD = { class: "conflict-header" }, fD = { class: "conflict-title" }, hD = { class: "total-overload" }, gD = { class: "conflict-list-container" }, vD = { class: "conflict-task-name" }, pD = { class: "conflict-detail" }, mD = { class: "conflict-label" }, wD = { class: "conflict-value" }, yD = { class: "conflict-detail" }, BD = { class: "conflict-label" }, bD = { class: "conflict-value" }, CD = 50, kD = /* @__PURE__ */ hn({
  __name: "TaskBarTab",
  props: {
    task: {},
    currentResourceId: {},
    resourceColor: {},
    resourceCapacity: {},
    resourceName: {},
    taskBarWidth: { default: void 0 },
    taskBarLeft: { default: void 0 },
    scrollLeft: { default: 0 },
    containerWidth: { default: 0 },
    hasConflict: { type: Boolean, default: !1 },
    conflictTasks: { default: () => [] },
    resources: {}
  },
  emits: ["hover-change"],
  setup(n, { emit: t }) {
    const e = n, r = t, { t: a } = Cs(), A = me(!1), i = me(null);
    let s = null, o = null;
    const l = ce(() => `${Math.round(e.resourceCapacity)}%`), u = ce(() => {
      if (!e.taskBarWidth) return 30;
      const T = 50, E = Math.min(2, e.taskBarWidth * 0.1);
      return Math.min(e.taskBarWidth - E, T);
    }), f = ce(() => {
      if (e.taskBarLeft === void 0 || e.scrollLeft === void 0)
        return 0;
      const T = e.taskBarLeft, E = e.scrollLeft;
      if (T > E + (e.containerWidth || 0))
        return 0;
      if (T < E) {
        const Q = E - T, x = Math.max(0, (e.taskBarWidth || 0) - u.value);
        return Math.min(Q, x);
      }
      return 0;
    }), h = ce(() => ({
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      backgroundColor: `${e.resourceColor} !important`,
      width: `${u.value}px`,
      left: `${f.value}px`
    })), c = ce(() => !e.resources || !e.currentResourceId ? null : e.resources.find((T) => String(T.id) === String(e.currentResourceId))), p = ce(() => {
      var T;
      return ((T = c.value) == null ? void 0 : T.name) || e.resourceName || "";
    }), w = ce(() => {
      var T;
      return ((T = c.value) == null ? void 0 : T.avatar) || null;
    }), y = ce(() => p.value.charAt(0).toUpperCase() || "R"), m = ce(() => ({
      backgroundColor: e.resourceColor,
      color: Y(e.resourceColor)
    })), k = ce(() => {
      if (!i.value)
        return {};
      const T = i.value.getBoundingClientRect(), E = window.innerHeight, Q = 120, x = B.value.length * 80, oe = Q + x, J = T.top, S = E - T.bottom;
      return J >= oe || J > S ? {
        position: "fixed",
        bottom: `${E - T.top + 2}px`,
        left: `${T.left}px`,
        maxHeight: `${Math.min(J - 10, 400)}px`,
        // 限制最大高度,留10px边距
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        backgroundColor: e.resourceColor
      } : {
        position: "fixed",
        top: `${T.bottom + 2}px`,
        left: `${T.left}px`,
        maxHeight: `${Math.min(S - 10, 400)}px`,
        // 限制最大高度,留10px边距
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        backgroundColor: e.resourceColor
      };
    }), D = ce(() => {
      if (!e.task.startDate || !e.task.endDate) return "-";
      const T = new Date(e.task.startDate), E = hA(e.task.endDate, new Date(e.task.endDate)), Q = (x) => {
        const oe = x.getFullYear(), J = String(x.getMonth() + 1).padStart(2, "0"), S = String(x.getDate()).padStart(2, "0");
        return `${oe}/${J}/${S}`;
      };
      return `${Q(T)} ~ ${Q(E)}`;
    }), B = ce(() => {
      if (!e.hasConflict || !e.conflictTasks || e.conflictTasks.length === 0)
        return [];
      const T = e.task;
      if (!T.startDate || !T.endDate) return [];
      const E = new Date(T.startDate).getTime(), Q = new Date(T.endDate).getTime();
      return e.conflictTasks.map((x) => {
        if (!x.startDate || !x.endDate) return null;
        const oe = new Date(x.startDate).getTime(), J = new Date(x.endDate).getTime();
        let S = 100;
        if (x.resources && Array.isArray(x.resources)) {
          const H = x.resources.find(
            (M) => String(M.id) === String(e.currentResourceId)
          );
          H && H.capacity !== void 0 && (S = Math.max(20, Math.min(100, H.capacity)));
        }
        const I = hA(
          T.endDate,
          new Date(Q)
        ).getTime(), N = hA(
          x.endDate,
          new Date(J)
        ).getTime(), se = Math.max(E, oe), Z = Math.min(I, N), C = (H) => {
          const M = new Date(H);
          return `${M.getFullYear()}/${M.getMonth() + 1}/${M.getDate()}`;
        };
        return {
          taskName: x.name,
          overlapStart: C(se),
          overlapEnd: C(Z),
          conflictPercent: S
          // 该冲突任务自己的利用率
        };
      }).filter(Boolean);
    }), O = ce(() => {
      if (!e.hasConflict || !e.conflictTasks || e.conflictTasks.length === 0)
        return 0;
      const T = e.task;
      if (!T.startDate || !T.endDate) return 0;
      const E = e.resourceCapacity || 100, Q = 1440 * 60 * 1e3, x = (S) => hA(S.endDate, new Date(S.endDate)).getTime() + Q;
      let oe = E;
      const J = [T, ...e.conflictTasks];
      return J.forEach((S, I) => {
        if (!S.startDate || !S.endDate) return;
        const N = new Date(S.startDate).getTime(), se = x(S);
        J.forEach((Z, C) => {
          if (I >= C || !Z.startDate || !Z.endDate) return;
          const H = new Date(Z.startDate).getTime(), M = x(Z);
          if (N < M && H < se) {
            const te = Math.max(N, H), ie = Math.min(se, M);
            let we = 0;
            J.forEach((ve) => {
              if (!ve.startDate || !ve.endDate) return;
              const le = new Date(ve.startDate).getTime(), _e = x(ve);
              if (le < ie && _e > te) {
                let De = 100;
                if (ve.resources && Array.isArray(ve.resources)) {
                  const ze = ve.resources.find(
                    (nt) => String(nt.id) === String(e.currentResourceId)
                  );
                  ze && ze.capacity !== void 0 && (De = ze.capacity);
                }
                we += De;
              }
            }), oe = Math.max(oe, we);
          }
        });
      }), Math.max(0, oe - 100);
    }), q = () => {
      s !== null && (clearTimeout(s), s = null), o !== null && clearTimeout(o), o = window.setTimeout(() => {
        A.value = !0, r("hover-change", !0), o = null;
      }, CD);
    }, G = () => {
      o !== null && (clearTimeout(o), o = null), s = window.setTimeout(() => {
        A.value = !1, r("hover-change", !1), s = null;
      }, 100);
    }, W = () => {
      s !== null && (clearTimeout(s), s = null), A.value = !0;
    }, F = () => {
      s = window.setTimeout(() => {
        A.value = !1, r("hover-change", !1), s = null;
      }, 100);
    }, Y = (T) => {
      const E = T.replace("#", ""), Q = parseInt(E.substring(0, 2), 16), x = parseInt(E.substring(2, 4), 16), oe = parseInt(E.substring(4, 6), 16);
      return (Q * 299 + x * 587 + oe * 114) / 1e3 > 128 ? "#333" : "#fff";
    };
    return ga(() => {
      s !== null && (clearTimeout(s), s = null), o !== null && (clearTimeout(o), o = null), A.value = !1, r("hover-change", !1);
    }), (T, E) => ($(), ee("div", {
      ref_key: "tabElement",
      ref: i,
      class: "task-bar-tab",
      style: Mt(h.value),
      onMouseenter: q,
      onMouseleave: G,
      onClick: E[0] || (E[0] = dn(() => {
      }, ["stop"]))
    }, [
      ($(), Ir(es, { to: "body" }, [
        A.value ? ($(), ee("div", {
          key: 0,
          class: "tab-expanded",
          style: Mt(k.value),
          onMouseenter: W,
          onMouseleave: F
        }, [
          _("div", eD, [
            _("div", tD, [
              w.value ? ($(), ee("div", {
                key: 0,
                class: "resource-avatar",
                style: Mt(m.value)
              }, [
                _("img", {
                  src: w.value,
                  alt: "avatar",
                  class: "avatar-img"
                }, null, 8, rD)
              ], 4)) : ($(), ee("div", {
                key: 1,
                class: "resource-avatar",
                style: Mt(m.value)
              }, Ee(y.value), 5)),
              _("span", nD, Ee(p.value), 1)
            ]),
            _("div", aD, [
              _("div", AD, [
                _("span", sD, Ee(Te(a).resourceView.capacity), 1),
                _("span", iD, Ee(l.value), 1)
              ]),
              _("div", oD, [
                _("span", lD, Ee(Te(a).resourceView.duration), 1),
                _("span", uD, Ee(D.value), 1)
              ]),
              n.hasConflict && B.value.length > 0 ? ($(), ee("div", cD, [
                _("div", dD, [
                  E[1] || (E[1] = _("svg", {
                    class: "warning-icon",
                    viewBox: "0 0 24 24",
                    width: "14",
                    height: "14"
                  }, [
                    _("path", {
                      fill: "currentColor",
                      d: "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"
                    })
                  ], -1)),
                  _("span", fD, Ee(Te(a).resourceView.overloadWarning), 1),
                  _("span", hD, "▲ " + Ee(O.value) + "%", 1)
                ]),
                _("div", gD, [
                  ($(!0), ee(St, null, nr(B.value, (Q, x) => ($(), ee("div", {
                    key: x,
                    class: "conflict-item"
                  }, [
                    _("div", vD, Ee(Te(a).resourceView.conflictWith) + "《" + Ee(Q ? Q.taskName : "") + "》" + Ee(Te(a).resourceView.conflictSuffix), 1),
                    _("div", pD, [
                      _("span", mD, Ee(Te(a).resourceView.conflictDuration) + ":", 1),
                      _("span", wD, Ee(Q ? Q.overlapStart : "") + " ~ " + Ee(Q ? Q.overlapEnd : ""), 1)
                    ]),
                    _("div", yD, [
                      _("span", BD, Ee(Te(a).resourceView.capacity) + ": ", 1),
                      _("span", bD, Ee(Q ? Q.conflictPercent : "") + "%", 1)
                    ])
                  ]))), 128))
                ])
              ])) : vt("", !0)
            ])
          ])
        ], 36)) : vt("", !0)
      ]))
    ], 36));
  }
}), TD = /* @__PURE__ */ Fn(kD, [["__scopeId", "data-v-5f409683"]]), xD = {
  showAvatar: !0,
  showTitle: !0,
  showProgress: !0,
  dragThreshold: 5,
  resizeHandleWidth: 5,
  enableDragDelay: !1,
  dragDelayTime: 150,
  titlePosition: "inside"
}, cp = {
  type: "bezier",
  color: "#c0c4cc",
  highlightColor: "#409eff",
  hoverColor: "#67c23a",
  width: 2,
  highlightWidth: 4,
  style: "dotted"
}, DD = ["data-task-id"], ED = { class: "actual-progress" }, SD = {
  key: 1,
  class: "actual-progress-badge"
}, FD = {
  key: 2,
  class: "actual-bar-trailing"
}, UD = {
  key: 0,
  class: "actual-avatars-container"
}, LD = {
  key: 0,
  class: "avatar-text"
}, ID = ["src", "alt"], QD = {
  key: 2,
  class: "avatar-icon",
  viewBox: "0 0 24 24",
  fill: "none",
  xmlns: "http://www.w3.org/2000/svg"
}, MD = ["innerHTML"], _D = ["data-task-id"], RD = {
  key: 0,
  class: "parent-label-inner"
}, ND = { key: 1 }, HD = {
  key: 0,
  class: "avatar-text"
}, OD = ["src", "alt"], PD = {
  key: 2,
  class: "avatar-icon",
  viewBox: "0 0 24 24",
  fill: "none",
  xmlns: "http://www.w3.org/2000/svg"
}, WD = {
  key: 1,
  class: "task-name"
}, KD = { class: "tooltip-title" }, $D = { class: "tooltip-content" }, VD = {
  key: 0,
  class: "tooltip-row"
}, qD = { class: "tooltip-label" }, jD = { class: "tooltip-value" }, YD = { class: "tooltip-row" }, GD = { class: "tooltip-label" }, zD = { class: "tooltip-value" }, XD = { class: "tooltip-row" }, JD = { class: "tooltip-label" }, ZD = { class: "tooltip-value" }, eE = { class: "tooltip-row" }, tE = { class: "tooltip-label" }, rE = { class: "tooltip-value" }, nE = { class: "tooltip-row" }, aE = { class: "tooltip-label" }, AE = { class: "tooltip-value" }, sE = { class: "tooltip-row" }, iE = { class: "tooltip-label" }, oE = { class: "tooltip-value" }, lE = {
  key: 1,
  class: "tooltip-row tooltip-warning"
}, uE = { class: "tooltip-label" }, cE = { class: "drag-tooltip-content" }, dE = { class: "tooltip-row" }, fE = { class: "tooltip-label" }, hE = { class: "tooltip-value" }, gE = { class: "tooltip-row" }, vE = { class: "tooltip-label" }, pE = { class: "tooltip-value" }, mE = { class: "drag-preview-content" }, Im = 18, wE = 1e3, yE = 100, BE = 250, bE = /* @__PURE__ */ hn({
  inheritAttrs: !1,
  __name: "TaskBar",
  props: {
    task: {},
    rowHeight: {},
    dayWidth: {},
    startDate: {},
    isParent: { type: Boolean },
    onClick: { type: Function },
    rowIndex: {},
    scrollLeft: {},
    containerWidth: {},
    hideBubbles: { type: Boolean },
    timelineData: {},
    currentTimeScale: {},
    taskBarConfig: {},
    allowDragAndResize: { type: Boolean },
    showActualTaskbar: { type: Boolean },
    enableTaskBarTooltip: { type: Boolean },
    pendingTaskBackgroundColor: {},
    delayTaskBackgroundColor: {},
    completeTaskBackgroundColor: {},
    ongoingTaskBackgroundColor: {},
    isHighlighted: { type: Boolean },
    isPrimaryHighlight: { type: Boolean },
    isInHighlightMode: { type: Boolean },
    dragLinkMode: {},
    isLinkDragSource: { type: Boolean },
    isValidLinkTarget: { type: Boolean },
    isInvalidLinkTarget: { type: Boolean },
    allTasks: {},
    hasResourceConflict: { type: Boolean },
    conflictTasks: {},
    resourceAllocationPercent: {},
    currentResourceId: {},
    taskSubRow: {},
    rowHeights: {},
    resources: {},
    enableParentTaskAutoSchedule: { type: Boolean }
  },
  emits: [
    "update:task",
    "bar-mounted",
    "click",
    "dblclick",
    "drag-end",
    "resize-end",
    "scroll-to-position",
    "start-timer",
    "stop-timer",
    "add-predecessor",
    "add-successor",
    "delete",
    "delete-link",
    "context-menu",
    "long-press",
    "link-drag-start",
    "link-drag-move",
    "link-drag-end",
    // Singleton Tooltip:TaskBar 只负责触发,Timeline 统一渲染
    "tooltip-show",
    "tooltip-hide"
  ],
  setup(n, { emit: t }) {
    const e = n, r = t, a = Mr(
      "enable-link-anchor",
      ce(() => !0)
    ), A = ce(() => {
      if (e.resourceAllocationPercent !== void 0) {
        const ye = Number(e.resourceAllocationPercent);
        if (Number.isFinite(ye) && ye > 0)
          return Math.max(0, Math.min(100, ye));
      }
      if (l.value === "resource" && e.currentResourceId && e.task.resources) {
        const ye = e.task.resources.find((Re) => String(Re.id) === String(e.currentResourceId));
        if (ye && ye.capacity !== void 0) {
          const Re = Number(ye.capacity);
          if (Number.isFinite(Re) && Re >= 0)
            return Math.max(0, Math.min(100, Re));
        }
      }
      return 100;
    }), i = ce(() => {
      if (l.value === "resource" && e.currentResourceId && e.resources) {
        const ye = e.resources.find((at) => String(at.id) === String(e.currentResourceId));
        return (ye == null ? void 0 : ye.color) || "#85ce61";
      }
      return "#85ce61";
    }), s = ce(() => {
      var Re;
      if (!e.currentResourceId) return "";
      const ye = (Re = e.resources) == null ? void 0 : Re.find((at) => at.id === e.currentResourceId);
      return (ye == null ? void 0 : ye.name) || "";
    }), o = Jl(), l = Mr("gantt-view-mode", me("task")), u = Mr(
      "gantt-show-taskbar-tab",
      ce(() => !0)
    ), f = Mr(
      "gantt-taskbar-desc-fixed",
      ce(() => !1)
    ), h = Mr(
      "resourceRowPositions",
      ce(() => /* @__PURE__ */ new Map())
    ), c = Mr(
      "resourceTaskLayouts",
      ce(() => /* @__PURE__ */ new Map())
    ), p = Mr("positionCache", null), w = Mr(
      "enable-task-bar-context-menu",
      ce(() => !0)
    ), y = Mr(
      "task-bar-context-menu-slot",
      ce(() => !1)
    ), m = Mr(
      "declarative-task-bar-context-menu",
      ce(() => null)
    ), k = Mr(
      "gantt-has-taskbar-tooltip-slot",
      ce(() => !1)
    ), D = ce(() => !!w.value), B = ce(() => w.value ? !y.value : !1), O = ce(() => {
      if (!w.value || !y.value)
        return !1;
      const ye = m.value;
      if ((ye == null ? void 0 : ye.taskType) !== void 0) {
        const Re = e.task.type || "task";
        return (Array.isArray(ye.taskType) ? ye.taskType : [ye.taskType]).includes(Re);
      }
      return !0;
    }), { getTranslation: q } = Cs(), G = (ye) => q(ye), W = ce(() => !!o["custom-task-content"]), F = ce(() => ({
      ...xD,
      ...e.taskBarConfig
    })), Y = ce(() => !!(e.task.actualStartDate || e.task.actualEndDate)), T = ce(() => F.value.titlePosition !== "above" ? 0 : l.value === "resource" ? Im : e.showActualTaskbar && Y.value ? 0 : Im), E = ce(() => e.rowHeight - T.value), Q = (ye) => {
      if (!ye) return null;
      if (ye instanceof Date)
        return ye;
      if (typeof ye == "string" && /^\d{4}-\d{2}-\d{2}$/.test(ye)) {
        const [at, $e, Tt] = ye.split("-").map(Number);
        return new Date(at, $e - 1, Tt);
      }
      if (typeof ye == "string" && /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/.test(ye)) {
        const [at, $e] = ye.split(" "), [Tt, Lt, ut] = at.split("-").map(Number), [ct, Ut] = $e.split(":").map(Number);
        return new Date(Tt, Lt - 1, ut, ct, Ut);
      }
      const Re = new Date(ye);
      return isNaN(Re.getTime()) ? null : Re;
    }, x = () => {
      const ye = /* @__PURE__ */ new Date();
      return new Date(ye.getFullYear(), ye.getMonth(), ye.getDate());
    }, oe = me(x());
    let J = null;
    sA(() => {
      J = window.setInterval(() => {
        oe.value = x();
      }, 6e4);
    }), ga(() => {
      J !== null && (clearInterval(J), J = null);
    });
    const S = (ye) => {
      const Re = ye.getFullYear(), at = String(ye.getMonth() + 1).padStart(2, "0"), $e = String(ye.getDate()).padStart(2, "0");
      if (e.currentTimeScale === Ue.HOUR) {
        const Tt = String(ye.getHours()).padStart(2, "0"), Lt = String(ye.getMinutes()).padStart(2, "0");
        return `${Re}-${at}-${$e} ${Tt}:${Lt}`;
      }
      return `${Re}-${at}-${$e}`;
    }, I = (ye, Re) => {
      const at = new Date(ye);
      return at.setDate(at.getDate() + Re), at;
    }, N = (ye, Re) => {
      const at = new Date(ye);
      return at.setMinutes(at.getMinutes() + Re), at;
    }, se = (ye, Re) => Math.round((Re.getTime() - ye.getTime()) / (1e3 * 60)), Z = ce(() => e.task.isEditable === !1), C = me(!1), H = me(!1), M = me(!1), te = me(!1), ie = me(0), we = me(0), ve = me(0), le = me(0), _e = me(0), De = me(0), ze = me(0), nt = Mr("isDraggingTaskBar", me(!1)), Qe = Mr("isDraggingTimeline", me(!1)), ne = me(!1), gt = me({ x: 0, y: 0 }), je = me(0), ot = me(0), Ie = me(null), It = me(null), dt = me(null), Dt = me(!1), Ct = me(!1), Ve = me(!1), ht = ce(() => Ve.value && l.value === "resource" ? i.value : rt.value.borderColor), K = ce(() => F.value.dragThreshold ?? 5), X = me(!1), ke = me(null), Je = me(null), pt = me(!1), Xe = me(0), Ye = me(null), Kt = me(null), it = me(null), qt = me(null), hr = me(0), Nt = ce(() => {
      var Or, Kr;
      if (Kt.value && e.currentTimeScale === Ue.QUARTER) {
        const sr = E.value - 10, Er = T.value + (E.value - sr - 4) / 2;
        return {
          left: `${Kt.value.left ?? 0}px`,
          width: `${Kt.value.width ?? 100}px`,
          height: `${sr}px`,
          top: `${Er}px`
        };
      }
      const ye = ((Or = Ye.value) == null ? void 0 : Or.startDate) || e.task.startDate, Re = ((Kr = Ye.value) == null ? void 0 : Kr.endDate) || e.task.endDate, at = Fr.value, $e = e.isParent && (e.enableParentTaskAutoSchedule ?? !0) && er.value !== null, Tt = $e && er.value ? er.value.minStart : Q(ye), Lt = $e && er.value ? er.value.maxEnd : Q(Re);
      if (!Tt && !Lt) {
        const sr = E.value - 10, Er = T.value + (E.value - sr - 4) / 2;
        return {
          left: "0px",
          width: "0px",
          height: `${sr}px`,
          top: `${Er}px`
        };
      }
      const ut = Tt || Lt, ct = Lt || Tt, Ut = at;
      if (!ut || !ct || !Ut) {
        const sr = E.value - 10, Er = T.value + (E.value - sr - 4) / 2;
        return {
          left: "0px",
          width: "0px",
          height: `${sr}px`,
          top: `${Er}px`
        };
      }
      let _t = 0, Zt = 0;
      if (l.value !== "resource" && C.value && It.value !== null) {
        _t = It.value;
        const sr = Q(ye), Er = Q(Re);
        if (sr && Er) {
          const nn = new Date(
            sr.getFullYear(),
            sr.getMonth(),
            sr.getDate()
          ), Ur = hA(Re, Er).getTime() - nn.getTime(), Qr = Math.round(Ur / (1e3 * 60 * 60 * 24));
          Zt = (Qr === 0 ? 1 : Qr + 1) * e.dayWidth;
        } else
          Zt = e.dayWidth;
      } else if (l.value === "resource" && Ie.value !== null)
        if (_t = Ie.value, e.currentTimeScale === Ue.HOUR) {
          const sr = Q(ye), Er = Q(Re);
          if (sr && Er) {
            const nn = se(sr, Er), Pn = e.dayWidth / 1440;
            Zt = Math.max(4, nn * Pn);
          } else
            Zt = e.dayWidth / 24;
        } else {
          const sr = Q(ye), Er = Q(Re);
          if (sr && Er) {
            const nn = new Date(
              sr.getFullYear(),
              sr.getMonth(),
              sr.getDate()
            ), Ur = hA(Re, Er).getTime() - nn.getTime(), Qr = Math.round(Ur / (1e3 * 60 * 60 * 24));
            Zt = (Qr === 0 ? 1 : Qr + 1) * e.dayWidth;
          } else
            Zt = e.dayWidth;
        }
      else if (e.currentTimeScale === Ue.HOUR) {
        const sr = new Date(Ut);
        sr.setHours(0, 0, 0, 0);
        let Er = ut, nn = ct;
        const Pn = ye || e.task.startDate, Ur = Re || e.task.endDate;
        typeof Pn == "string" && /^\d{4}-\d{2}-\d{2}$/.test(Pn.trim()) && (Er = new Date(ut), Er.setHours(0, 0, 0, 0)), typeof Ur == "string" && /^\d{4}-\d{2}-\d{2}$/.test(Ur.trim()) && (nn = new Date(ct), nn.setDate(nn.getDate() + 1), nn.setHours(0, 0, 0, 0));
        const Qr = se(sr, Er), P = se(sr, nn), he = e.dayWidth / 1440;
        _t = Math.max(0, Qr * he), Zt = Math.max(4, (P - Qr) * he);
      } else {
        const sr = new Date(
          ut.getFullYear(),
          ut.getMonth(),
          ut.getDate()
        ), Er = $e && er.value ? er.value.maxEndRaw : Re, nn = hA(Er, ct), Pn = new Date(
          Ut.getFullYear(),
          Ut.getMonth(),
          Ut.getDate()
        );
        if (e.timelineData && e.currentTimeScale && (e.currentTimeScale === Ue.WEEK || e.currentTimeScale === Ue.MONTH || e.currentTimeScale === Ue.QUARTER || e.currentTimeScale === Ue.YEAR)) {
          let Ur, Qr;
          if (p) {
            const P = p.getPosition(sr, e.currentTimeScale);
            P !== null ? Ur = P : Ur = ft(
              sr,
              e.timelineData,
              e.currentTimeScale
            );
            const he = new Date(nn);
            he.setDate(he.getDate() + 1);
            const Fe = p.getPosition(he, e.currentTimeScale);
            Fe !== null ? Qr = Fe : Qr = ft(
              he,
              e.timelineData,
              e.currentTimeScale
            );
          } else {
            Ur = ft(
              sr,
              e.timelineData,
              e.currentTimeScale
            );
            const P = new Date(nn);
            P.setDate(P.getDate() + 1), Qr = ft(
              P,
              e.timelineData,
              e.currentTimeScale
            );
          }
          Qr === Ur && (Qr = ft(
            nn,
            e.timelineData,
            e.currentTimeScale
          ) + e.dayWidth), _t = Ur, Zt = Math.max(Qr - Ur, 4);
        } else if (e.timelineData && e.currentTimeScale === Ue.DAY) {
          let Ur, Qr;
          if (p) {
            const P = p.getPosition(sr, e.currentTimeScale);
            P !== null ? Ur = P : Ur = ft(
              sr,
              e.timelineData,
              e.currentTimeScale
            );
            const he = new Date(nn);
            he.setDate(he.getDate() + 1);
            const Fe = p.getPosition(he, e.currentTimeScale);
            Fe !== null ? Qr = Fe : Qr = ft(
              he,
              e.timelineData,
              e.currentTimeScale
            );
          } else {
            Ur = ft(
              sr,
              e.timelineData,
              e.currentTimeScale
            );
            const P = new Date(nn);
            P.setDate(P.getDate() + 1), Qr = ft(
              P,
              e.timelineData,
              e.currentTimeScale
            );
          }
          Qr === Ur && (Qr = ft(
            nn,
            e.timelineData,
            e.currentTimeScale
          ) + bs.day.cellWidth), _t = Ur, Zt = Math.max(Qr - Ur, 4);
        } else {
          const Ur = Math.floor(
            (sr.getTime() - Pn.getTime()) / 864e5
          ), Qr = nn.getTime() - sr.getTime(), P = Math.round(Qr / (1e3 * 60 * 60 * 24)), he = P === 0 ? 1 : P + 1;
          _t = Ur * e.dayWidth, Zt = he * e.dayWidth;
        }
      }
      const or = E.value - 10;
      let ar = T.value + (E.value - or - 4) / 2;
      if (l.value === "resource" && e.taskSubRow !== void 0 && e.rowHeights && e.rowHeights.length > 0) {
        const sr = e.taskSubRow, Er = e.rowHeights, Pn = (Er[sr] || 51) - T.value;
        let Ur = 0;
        for (let Qr = 0; Qr < sr; Qr++)
          Ur += Er[Qr] || 51;
        sr === 0 ? ar = Ur + T.value + 5 + (Pn - 5 - or - 4) / 2 : ar = Ur + T.value + (Pn - or - 4) / 2;
      }
      return {
        left: `${_t}px`,
        width: `${Zt}px`,
        height: `${or}px`,
        top: `${ar}px`
      };
    }), xr = ce(() => {
      const ye = Nt.value.left;
      return parseFloat(ye) || 0;
    }), Jt = me({
      left: 0,
      top: 0,
      width: 0,
      height: 0,
      timestamp: 0
    }), lr = ce(() => Q(e.task.endDate || "")), Fr = ce(() => Q(e.startDate)), er = ce(() => {
      var Tt;
      if (!e.isParent || !((Tt = e.task.children) != null && Tt.length)) return null;
      const ye = (Lt) => {
        var _t;
        let ut = null, ct = null, Ut;
        for (const Zt of Lt) {
          const fr = Q(Zt.startDate), or = Q(Zt.endDate);
          if (fr && (!ut || fr < ut) && (ut = fr), or && (!ct || or > ct) && (ct = or, Ut = Zt.endDate), (_t = Zt.children) != null && _t.length) {
            const ar = ye(Zt.children);
            ar.min && (!ut || ar.min < ut) && (ut = ar.min), ar.max && (!ct || ar.max > ct) && (ct = ar.max, Ut = ar.maxRaw);
          }
        }
        return { min: ut, max: ct, maxRaw: Ut };
      }, { min: Re, max: at, maxRaw: $e } = ye(e.task.children);
      return Re && at ? { minStart: Re, maxEnd: at, maxEndRaw: $e } : null;
    }), Ar = ce(() => {
      var at, $e;
      const ye = ((at = Ye.value) == null ? void 0 : at.startDate) || e.task.startDate, Re = (($e = Ye.value) == null ? void 0 : $e.endDate) || e.task.endDate;
      return !!(ye || Re);
    }), Ge = ce(() => {
      const ye = parseFloat(Nt.value.width);
      return isNaN(ye) ? 0 : ye;
    }), rt = ce(() => {
      if (e.task.barColor) {
        const ut = ((_t) => {
          const Zt = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(_t);
          return Zt ? {
            r: parseInt(Zt[1], 16),
            g: parseInt(Zt[2], 16),
            b: parseInt(Zt[3], 16)
          } : { r: 64, g: 158, b: 255 };
        })(e.task.barColor);
        if (e.isParent)
          return {
            type: "custom-parent",
            color: e.task.barColor,
            bgColor: e.task.barColor,
            borderColor: e.task.barColor
          };
        const ct = `rgb(${Math.round(255 * 0.95 + ut.r * 0.05)}, ${Math.round(255 * 0.95 + ut.g * 0.05)}, ${Math.round(255 * 0.95 + ut.b * 0.05)})`, Ut = `rgb(${Math.round(255 * 0.7 + ut.r * 0.3)}, ${Math.round(255 * 0.7 + ut.g * 0.3)}, ${Math.round(255 * 0.7 + ut.b * 0.3)})`;
        return {
          type: "custom",
          color: e.task.barColor,
          bgColor: ct,
          borderColor: Ut
        };
      }
      if (e.isParent)
        return {
          type: "parent",
          color: "#409eff",
          // 与新建按钮一致的蓝色
          bgColor: "#409eff",
          borderColor: "#409eff"
        };
      const ye = (Lt) => {
        const ct = ((Zt) => {
          const fr = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(Zt);
          return fr ? {
            r: parseInt(fr[1], 16),
            g: parseInt(fr[2], 16),
            b: parseInt(fr[3], 16)
          } : { r: 64, g: 158, b: 255 };
        })(Lt), Ut = `rgb(${Math.round(255 * 0.95 + ct.r * 0.05)}, ${Math.round(255 * 0.95 + ct.g * 0.05)}, ${Math.round(255 * 0.95 + ct.b * 0.05)})`, _t = `rgb(${Math.round(255 * 0.7 + ct.r * 0.3)}, ${Math.round(255 * 0.7 + ct.g * 0.3)}, ${Math.round(255 * 0.7 + ct.b * 0.3)})`;
        return { bgColor: Ut, borderColor: _t };
      }, Re = oe.value, at = lr.value, $e = e.task.progress || 0, Tt = e.task.actualStartDate ? new Date(e.task.actualStartDate) : null;
      if ($e >= 100) {
        const Lt = e.completeTaskBackgroundColor || "#909399", ut = ye(Lt);
        return {
          type: "completed",
          color: Lt,
          bgColor: ut.bgColor,
          borderColor: ut.borderColor
        };
      }
      if (at && at < Re && $e < 100) {
        const Lt = e.delayTaskBackgroundColor || "#f56c6c", ut = ye(Lt);
        return {
          type: "delayed",
          color: Lt,
          bgColor: ut.bgColor,
          borderColor: ut.borderColor
        };
      }
      if (Tt && $e < 100 && at && at >= Re) {
        const Lt = e.ongoingTaskBackgroundColor || "#e6a23c", ut = ye(Lt);
        return {
          type: "ongoing",
          color: Lt,
          bgColor: ut.bgColor,
          borderColor: ut.borderColor
        };
      }
      if (!Tt && (!at || at >= Re)) {
        const Lt = e.pendingTaskBackgroundColor || "#409eff", ut = ye(Lt);
        return {
          type: "pending",
          color: Lt,
          bgColor: ut.bgColor,
          borderColor: ut.borderColor
        };
      }
      return {
        type: "default",
        color: "#409eff",
        bgColor: "#ecf5ff",
        borderColor: "#b3d8ff"
      };
    }), yt = ce(() => ({
      type: "task-bar",
      task: e.task,
      status: rt.value,
      statusType: rt.value.type,
      isParent: e.isParent ?? !1,
      progress: e.task.progress || 0,
      currentTimeScale: e.currentTimeScale,
      rowHeight: e.rowHeight,
      dayWidth: e.dayWidth
    })), Ot = ce(() => {
      if (l.value === "resource" && e.currentResourceId && e.resources) {
        const at = e.resources.find(($e) => String($e.id) === String(e.currentResourceId));
        if (at)
          return at.avatar ? [at.avatar] : at.name ? [{ isText: !0, name: at.name }] : [];
      }
      const ye = e.task.avatar, Re = e.task.assignee;
      return ye ? Array.isArray(ye) ? ye : [ye] : Re ? (Array.isArray(Re) ? Re : [Re]).map(($e) => ({ isText: !0, name: $e })) : [];
    }), vr = ce(() => (e.task.progress || 0) >= 100), jt = ce(
      () => !!e.showActualTaskbar && E.value < 30
    ), br = ce(() => Math.max(12, Math.min(22, E.value - 8))), on = ce(() => e.isInHighlightMode && !e.isHighlighted && !e.isPrimaryHighlight), an = ce(() => {
      const ye = e.task.progress || 0, Re = parseInt(Nt.value.width);
      return `${ye / 100 * Re}px`;
    }), xn = ce(() => e.currentTimeScale === Ue.WEEK), $r = ce(() => parseFloat(Nt.value.width || "0") < bs.day.cellWidth), pn = ce(() => {
      if (!e.showActualTaskbar || !e.task.actualStartDate || e.isParent)
        return null;
      const ye = Q(e.task.actualStartDate), Re = Q(e.task.actualEndDate), at = Q(e.task.startDate), $e = Fr.value;
      if (!$e)
        return null;
      const Tt = ye || at, Lt = Re || (ye ? x() : null);
      if (!Tt || !Lt)
        return null;
      const ut = Re ? e.task.actualEndDate : void 0, ct = hA(ut, Lt);
      let Ut = 0, _t = 100;
      if (e.timelineData && e.currentTimeScale && (e.currentTimeScale === Ue.WEEK || e.currentTimeScale === Ue.MONTH || e.currentTimeScale === Ue.QUARTER || e.currentTimeScale === Ue.YEAR)) {
        const or = ft(
          Tt,
          e.timelineData,
          e.currentTimeScale
        ), ar = new Date(ct);
        ar.setDate(ar.getDate() + 1);
        let Or = ft(
          ar,
          e.timelineData,
          e.currentTimeScale
        );
        Or === or && (Or = ft(
          ct,
          e.timelineData,
          e.currentTimeScale
        ) + e.dayWidth), Ut = or, _t = Math.max(Or - or, 4);
      } else if (e.timelineData && e.currentTimeScale === Ue.DAY) {
        const or = ft(
          Tt,
          e.timelineData,
          e.currentTimeScale
        ), ar = new Date(ct);
        ar.setDate(ar.getDate() + 1);
        let Or = ft(
          ar,
          e.timelineData,
          e.currentTimeScale
        );
        Or === or && (Or = ft(
          ct,
          e.timelineData,
          e.currentTimeScale
        ) + bs.day.cellWidth), Ut = or, _t = Math.max(Or - or, 4);
      } else {
        const or = Math.floor(
          (Tt.getTime() - $e.getTime()) / 864e5
        ), ar = ct.getTime() - Tt.getTime(), Or = Math.round(ar / (1e3 * 60 * 60 * 24)), Kr = Or === 0 ? 1 : Or + 1;
        Ut = or * e.dayWidth, _t = Kr * e.dayWidth;
      }
      const Zt = E.value < 30 ? 5 : Math.round((E.value - 10) / 2), fr = T.value + (E.value - Zt) / 2;
      return {
        left: `${Ut}px`,
        width: `${_t}px`,
        height: `${Zt}px`,
        top: `${fr}px`
      };
    }), Dn = ce(() => {
      if (!e.isParent || e.enableParentTaskAutoSchedule !== !1 || !er.value) return null;
      const { minStart: ye, maxEnd: Re, maxEndRaw: at } = er.value, $e = Q(e.task.startDate), Tt = Q(e.task.endDate);
      if (!($e && ye < $e || Tt && Re > Tt)) return null;
      const ut = Fr.value;
      if (!ut) return null;
      const ct = new Date(ye.getFullYear(), ye.getMonth(), ye.getDate()), Ut = hA(at, Re), _t = new Date(
        ut.getFullYear(),
        ut.getMonth(),
        ut.getDate()
      );
      let Zt = 0, fr = 4;
      if (e.timelineData && e.currentTimeScale && (e.currentTimeScale === Ue.WEEK || e.currentTimeScale === Ue.MONTH || e.currentTimeScale === Ue.QUARTER || e.currentTimeScale === Ue.YEAR)) {
        const Kr = ft(
          ct,
          e.timelineData,
          e.currentTimeScale
        ), sr = new Date(Ut);
        sr.setDate(sr.getDate() + 1);
        let Er = ft(
          sr,
          e.timelineData,
          e.currentTimeScale
        );
        Er === Kr && (Er = ft(Ut, e.timelineData, e.currentTimeScale) + e.dayWidth), Zt = Kr, fr = Math.max(Er - Kr, 4);
      } else if (e.timelineData && e.currentTimeScale === Ue.DAY) {
        const Kr = ft(
          ct,
          e.timelineData,
          e.currentTimeScale
        ), sr = new Date(Ut);
        sr.setDate(sr.getDate() + 1);
        let Er = ft(
          sr,
          e.timelineData,
          e.currentTimeScale
        );
        Er === Kr && (Er = ft(Ut, e.timelineData, e.currentTimeScale) + e.dayWidth), Zt = Kr, fr = Math.max(Er - Kr, 4);
      } else {
        const Kr = Math.floor(
          (ct.getTime() - _t.getTime()) / 864e5
        ), sr = Ut.getTime() - ct.getTime(), Er = Math.round(sr / (1e3 * 60 * 60 * 24)), nn = Er === 0 ? 1 : Er + 1;
        Zt = Kr * e.dayWidth, fr = nn * e.dayWidth;
      }
      const or = 4, Or = (e.rowHeight - 15) / 2 - or;
      return {
        left: `${Zt}px`,
        width: `${fr}px`,
        height: `${or}px`,
        top: `${Or}px`
      };
    }), Ca = ce(() => xn.value && $r.value), ka = (ye, Re) => {
      if (Qe.value || e.isHighlighted || e.isPrimaryHighlight || e.allowDragAndResize === !1 || vr.value || e.isParent || Z.value || (ye.preventDefault(), ye.stopPropagation(), Ye.value = null, It.value = null, X.value = !1, pt.value = !1, ke.value = Re, Dt.value = !1, dt.value && (clearTimeout(dt.value), dt.value = null), Re === "drag" && (dt.value = window.setTimeout(() => {
        !X.value && !C.value && !H.value && !M.value && (Dt.value = !0, r("long-press", e.task.id)), dt.value = null;
      }, wE)), F.value.enableDragDelay && F.value.dragDelayTime ? Je.value = window.setTimeout(() => {
        pt.value = !0, Je.value = null;
      }, F.value.dragDelayTime) : pt.value = !0, !document.querySelector(".timeline") || !it.value)) return;
      const $e = it.value.getBoundingClientRect();
      Xe.value = ye.clientX - $e.left, je.value = ye.clientX - $e.left, ie.value = ye.clientX, we.value = ye.clientY, ve.value = parseInt(Nt.value.left), le.value = parseInt(Nt.value.width), (Re === "resize-left" || Re === "resize-right") && (_e.value = ye.clientX, De.value = parseInt(Nt.value.width), ze.value = parseInt(Nt.value.left)), window.addEventListener("timeline-auto-scroll", Yn), document.addEventListener("mousemove", Vn), document.addEventListener("mouseup", Xa);
    }, Yn = (ye) => {
      const { scrollDelta: Re } = ye.detail;
      C.value ? ie.value -= Re : (H.value || M.value) && (_e.value -= Re);
    };
    let zr = !1;
    function Un() {
      zr || (zr = !0, requestAnimationFrame(() => {
        if (zr = !1, !it.value) return;
        const ye = Date.now();
        if (ye - Jt.value.timestamp < yE) {
          r("bar-mounted", {
            id: e.task.id,
            left: Jt.value.left,
            top: Jt.value.top,
            width: Jt.value.width,
            height: Jt.value.height
          });
          return;
        }
        const Re = it.value.getBoundingClientRect(), at = {
          left: Re.left,
          top: Re.top,
          width: Re.width,
          height: Re.height
        };
        Jt.value = {
          ...at,
          timestamp: ye
        }, r("bar-mounted", {
          id: e.task.id,
          ...at
        });
      }));
    }
    const pa = me(!1), ma = me({ x: 0, y: 0 }), En = me({ startDate: "", endDate: "" }), Vn = (ye) => {
      if (l.value === "resource") {
        window.lastDragMouseY = ye.clientY;
        const Re = document.querySelector(".timeline-body");
        let at = !1;
        if (Re && C.value && X.value && e.currentResourceId) {
          const $e = Re.getBoundingClientRect(), Tt = ye.clientY - $e.top + Re.scrollTop, Lt = String(e.currentResourceId), ut = h.value.get(Lt) || 0, ct = c.value.get(Lt), Ut = (ct == null ? void 0 : ct.totalHeight) || 51, _t = ut + Ut;
          at = Tt < ut || Tt >= _t, at ? (ne.value = !0, gt.value = {
            x: ye.clientX - je.value,
            y: ye.clientY - e.rowHeight / 2
          }) : ne.value = !1;
        }
      }
      if (!(e.isHighlighted || e.isPrimaryHighlight) && !(F.value.enableDragDelay && !pt.value)) {
        if (!X.value) {
          const Re = Math.abs(ye.clientX - ie.value), at = Math.abs(ye.clientY - we.value);
          if ((l.value === "resource" && ke.value === "drag" ? Math.max(Re, at) : Re) < K.value)
            return;
          X.value = !0, ke.value === "drag" ? C.value = !0 : ke.value === "resize-left" ? H.value = !0 : ke.value === "resize-right" && (M.value = !0);
        }
        if (X.value) {
          if (window.dispatchEvent(
            new CustomEvent("drag-boundary-check", {
              detail: {
                mouseX: ye.clientX,
                mouseY: ye.clientY,
                // v1.9.0 添加Y坐标用于资源视图垂直拖拽检测
                taskId: e.task.id,
                // v1.9.0 添加taskId
                rowIndex: e.rowIndex,
                // v1.9.0 添加当前行索引
                isDragging: C.value || H.value || M.value,
                isResourceView: l.value === "resource"
                // v1.9.0 标识是否资源视图
              }
            })
          ), (C.value || H.value || M.value) && (pa.value = !0, ma.value = {
            x: ye.clientX + 15,
            // 鼠标右侧偏移
            y: ye.clientY - 60
            // 鼠标上方偏移
          }), C.value) {
            const Re = ye.clientX - ie.value;
            if (l.value === "resource") {
              const at = ye.clientX - je.value, $e = document.querySelector(".timeline-body");
              if ($e) {
                const Tt = $e.getBoundingClientRect(), Lt = $e.scrollLeft, ut = at - Tt.left + Lt;
                if (e.currentTimeScale === Ue.HOUR) {
                  const ct = e.dayWidth / 1440, Ut = ct * 15, _t = Math.round(Math.max(0, ve.value + Re) / Ut) * Ut;
                  Ie.value = _t;
                  const Zt = Math.round(_t / ct), fr = new Date(e.startDate);
                  fr.setHours(0, 0, 0, 0);
                  const or = N(fr, Zt), ar = Q(e.task.startDate) || e.startDate, Or = Q(e.task.endDate) || e.startDate;
                  let Kr;
                  if (e.task.startDate && e.task.startDate.includes(" ") || e.task.endDate && e.task.endDate.includes(" "))
                    Kr = se(ar, Or);
                  else {
                    const nn = Or.getTime() - ar.getTime();
                    Kr = Math.max(1, Math.round(nn / (1e3 * 60 * 60 * 24)) + 1) * 24 * 60;
                  }
                  const Er = N(or, Kr);
                  En.value = {
                    startDate: S(or),
                    endDate: S(Er)
                  }, Ye.value = {
                    startDate: S(or),
                    endDate: S(Er)
                  };
                } else {
                  Ie.value = ut;
                  let ct = null;
                  e.timelineData && (e.currentTimeScale === Ue.DAY || e.currentTimeScale === Ue.MONTH || e.currentTimeScale === Ue.QUARTER || e.currentTimeScale === Ue.YEAR) && (ct = Yt(
                    ut,
                    e.timelineData,
                    e.currentTimeScale
                  )), ct || (ct = I(e.startDate, ut / e.dayWidth));
                  const Ut = Q(e.task.startDate) || e.startDate, _t = Q(e.task.endDate) || e.startDate, Zt = new Date(
                    Ut.getFullYear(),
                    Ut.getMonth(),
                    Ut.getDate()
                  ), fr = new Date(
                    _t.getFullYear(),
                    _t.getMonth(),
                    _t.getDate()
                  ), or = Math.round(
                    (fr.getTime() - Zt.getTime()) / (1e3 * 60 * 60 * 24)
                  ), ar = new Date(ct);
                  ar.setDate(ar.getDate() + Math.max(0, or)), En.value = {
                    startDate: S(ct),
                    endDate: S(ar)
                  }, Ye.value = {
                    startDate: S(ct),
                    endDate: S(ar)
                  };
                }
              }
              return;
            }
            if (e.currentTimeScale === Ue.HOUR) {
              const at = e.dayWidth / 1440, $e = at * 15, Tt = Math.max(0, ve.value + Re), Lt = Math.round(Tt / $e) * $e, ut = Math.round(Lt / at), ct = new Date(e.startDate);
              ct.setHours(0, 0, 0, 0);
              const Ut = N(ct, ut), _t = Q(e.task.startDate) || e.startDate, Zt = Q(e.task.endDate) || e.startDate;
              let fr;
              if (e.task.startDate && e.task.startDate.includes(" ") || e.task.endDate && e.task.endDate.includes(" "))
                fr = se(_t, Zt);
              else {
                const Or = Zt.getTime() - _t.getTime();
                fr = Math.max(1, Math.round(Or / (1e3 * 60 * 60 * 24)) + 1) * 24 * 60;
              }
              const ar = N(Ut, fr);
              Ye.value = {
                startDate: S(Ut),
                endDate: S(ar)
              }, En.value = {
                startDate: S(Ut),
                endDate: S(ar)
              };
            } else if (e.currentTimeScale === Ue.QUARTER) {
              const at = Math.max(0, ve.value + Re);
              Kt.value = {
                left: at,
                width: le.value
              };
              const Lt = e.dayWidth * 90 / 90, ut = Math.round(Re / Lt), ct = Q(e.task.startDate) || e.startDate, Ut = Q(e.task.endDate) || e.startDate, _t = new Date(ct);
              _t.setDate(_t.getDate() + ut);
              const Zt = Ut.getTime() - ct.getTime(), fr = Math.ceil(Zt / (1e3 * 60 * 60 * 24)), or = new Date(_t);
              or.setDate(or.getDate() + Math.max(0, fr)), Ye.value = {
                startDate: S(_t),
                endDate: S(or)
              }, En.value = {
                startDate: S(_t),
                endDate: S(or)
              };
            } else {
              const at = Math.max(0, ve.value + Re);
              if (It.value = at, (e.currentTimeScale === Ue.DAY || e.currentTimeScale === Ue.MONTH || e.currentTimeScale === Ue.QUARTER || e.currentTimeScale === Ue.YEAR) && e.timelineData) {
                const $e = Yt(
                  at,
                  e.timelineData,
                  e.currentTimeScale
                );
                if ($e) {
                  const Tt = Q(e.task.startDate) || e.startDate, Lt = Q(e.task.endDate) || e.startDate, ut = new Date(
                    Tt.getFullYear(),
                    Tt.getMonth(),
                    Tt.getDate()
                  ), ct = new Date(
                    Lt.getFullYear(),
                    Lt.getMonth(),
                    Lt.getDate()
                  ), Ut = Math.round(
                    (ct.getTime() - ut.getTime()) / (1e3 * 60 * 60 * 24)
                  ), _t = new Date($e);
                  _t.setDate(_t.getDate() + Math.max(0, Ut)), Ye.value = {
                    startDate: S($e),
                    endDate: S(_t)
                  }, En.value = {
                    startDate: S($e),
                    endDate: S(_t)
                  };
                }
              } else {
                const $e = I(e.startDate, at / e.dayWidth), Tt = Q(e.task.startDate) || e.startDate, Lt = Q(e.task.endDate) || e.startDate, ut = new Date(
                  Tt.getFullYear(),
                  Tt.getMonth(),
                  Tt.getDate()
                ), ct = new Date(
                  Lt.getFullYear(),
                  Lt.getMonth(),
                  Lt.getDate()
                ), Ut = Math.round((ct.getTime() - ut.getTime()) / (1e3 * 60 * 60 * 24)), _t = I($e, Ut);
                Ye.value = {
                  startDate: S($e),
                  endDate: S(_t)
                }, En.value = {
                  startDate: S($e),
                  endDate: S(_t)
                };
              }
            }
          } else if (H.value) {
            const Re = ye.clientX - _e.value;
            if (e.currentTimeScale === Ue.HOUR) {
              const at = e.dayWidth / 1440, $e = at * 15, Tt = Math.max(0, ze.value + Re), Lt = Math.round(Tt / $e) * $e, ut = Math.round(Lt / at), ct = new Date(e.startDate);
              ct.setHours(0, 0, 0, 0);
              const Ut = N(ct, ut);
              Ye.value = {
                startDate: S(Ut),
                endDate: e.task.endDate
                // 保持原来的结束日期
              }, En.value = {
                startDate: S(Ut),
                endDate: e.task.endDate || ""
              };
            } else if (e.currentTimeScale === Ue.QUARTER) {
              const at = Math.max(0, ze.value + Re), $e = Math.max(10, De.value - Re);
              Kt.value = {
                left: at,
                width: $e
              };
              const ut = e.dayWidth * 90 / 90, ct = Math.round(Re / ut), Ut = Q(e.task.startDate) || e.startDate, _t = new Date(Ut);
              _t.setDate(_t.getDate() + ct), Ye.value = {
                startDate: S(_t),
                endDate: e.task.endDate
                // 保持原来的结束日期
              }, En.value = {
                startDate: S(_t),
                endDate: e.task.endDate || ""
              };
            } else {
              const at = ze.value + De.value - e.dayWidth, $e = Math.min(at, Math.max(0, ze.value + Re));
              if ((e.currentTimeScale === Ue.DAY || e.currentTimeScale === Ue.MONTH || e.currentTimeScale === Ue.QUARTER || e.currentTimeScale === Ue.YEAR) && e.timelineData) {
                const Tt = Yt(
                  $e,
                  e.timelineData,
                  e.currentTimeScale
                );
                Tt && (Ye.value = {
                  startDate: S(Tt),
                  endDate: e.task.endDate
                  // 保持原来的结束日期
                }, En.value = {
                  startDate: S(Tt),
                  endDate: e.task.endDate || ""
                });
              } else {
                const Tt = I(e.startDate, $e / e.dayWidth);
                Ye.value = {
                  startDate: S(Tt),
                  endDate: e.task.endDate
                  // 保持原来的结束日期
                }, En.value = {
                  startDate: S(Tt),
                  endDate: e.task.endDate || ""
                };
              }
            }
          } else if (M.value) {
            const Re = ye.clientX - _e.value;
            if (e.currentTimeScale === Ue.HOUR) {
              const at = e.dayWidth / 1440, $e = at * 15, Tt = Math.max($e, De.value + Re), Lt = Math.round(Tt / $e) * $e, ut = Math.round(Lt / at), ct = Q(e.task.startDate) || e.startDate, Ut = N(ct, ut);
              Ye.value = {
                startDate: e.task.startDate,
                // 保持原来的开始日期
                endDate: S(Ut)
              }, En.value = {
                startDate: e.task.startDate || "",
                endDate: S(Ut)
              };
            } else if (e.currentTimeScale === Ue.QUARTER) {
              const at = Math.max(10, De.value + Re);
              Kt.value = {
                left: ze.value,
                width: at
              };
              const Lt = e.dayWidth * 90 / 90, ut = Math.round(Re / Lt), ct = Q(e.task.endDate) || e.startDate, Ut = new Date(ct);
              Ut.setDate(Ut.getDate() + ut), Ye.value = {
                startDate: e.task.startDate,
                // 保持原来的开始日期
                endDate: S(Ut)
              }, En.value = {
                startDate: e.task.startDate || "",
                endDate: S(Ut)
              };
            } else {
              const at = Math.max(e.dayWidth, De.value + Re);
              if ((e.currentTimeScale === Ue.DAY || e.currentTimeScale === Ue.MONTH || e.currentTimeScale === Ue.QUARTER || e.currentTimeScale === Ue.YEAR) && e.timelineData) {
                const $e = ze.value + at, Tt = Yt(
                  $e,
                  e.timelineData,
                  e.currentTimeScale
                );
                Tt && (Ye.value = {
                  startDate: e.task.startDate,
                  // 保持原来的开始日期
                  endDate: S(I(Tt, -1))
                }, En.value = {
                  startDate: e.task.startDate || "",
                  endDate: S(I(Tt, -1))
                });
              } else {
                const $e = at / e.dayWidth, Tt = I(
                  e.startDate,
                  ze.value / e.dayWidth + $e - 1
                );
                Ye.value = {
                  startDate: e.task.startDate,
                  // 保持原来的开始日期
                  endDate: S(Tt)
                }, En.value = {
                  startDate: e.task.startDate || "",
                  endDate: S(Tt)
                };
              }
            }
          }
        }
      }
    }, Xa = () => {
      var Re, at, $e;
      Je.value !== null && (window.clearTimeout(Je.value), Je.value = null), dt.value !== null && (clearTimeout(dt.value), dt.value = null), pa.value = !1, Kt.value = null, window.dispatchEvent(
        new CustomEvent("drag-boundary-check", {
          detail: {
            mouseX: 0,
            isDragging: !1
          }
        })
      );
      let ye = !1;
      if (l.value === "resource" && C.value && X.value && e.currentResourceId) {
        ot.value = ((Re = window.event) == null ? void 0 : Re.clientX) || 0;
        const Tt = document.querySelector(".timeline-body");
        if (Tt) {
          const Lt = Tt.getBoundingClientRect(), ct = (window.lastDragMouseY || 0) - Lt.top + Tt.scrollTop, Ut = String(e.currentResourceId), _t = h.value.get(Ut) || 0, Zt = c.value.get(Ut), fr = (Zt == null ? void 0 : Zt.totalHeight) || 51, or = _t + fr;
          ye = ct < _t || ct >= or;
        }
        ye && window.dispatchEvent(
          new CustomEvent("resource-taskbar-drop", {
            detail: {
              taskId: e.task.id,
              task: e.task,
              sourceRowIndex: e.rowIndex,
              mouseY: window.lastDragMouseY || 0,
              // v1.9.0 直接传递TaskBar已经计算好的精确日期,避免Timeline重复计算导致误差
              calculatedStartDate: (at = Ye.value) == null ? void 0 : at.startDate,
              calculatedEndDate: ($e = Ye.value) == null ? void 0 : $e.endDate
            }
          })
        ), ne.value = !1;
      }
      if (X.value && Ye.value && !(l.value === "resource" && ye)) {
        const Tt = {
          ...e.task,
          ...Ye.value
        };
        C.value ? r("drag-end", Tt) : (H.value || M.value) && r("resize-end", Tt), r("update:task", Tt), Ye.value = null, An(() => {
          Un();
        });
      }
      window.removeEventListener("timeline-auto-scroll", Yn), (C.value || H.value || M.value) && (te.value = !0, setTimeout(() => {
        te.value = !1;
      }, 200)), C.value = !1, H.value = !1, M.value = !1, X.value = !1, pt.value = !1, ke.value = null, Ie.value = null, It.value = null, document.removeEventListener("mousemove", Vn), document.removeEventListener("mouseup", Xa);
    };
    let oA = null;
    sA(() => {
      An(() => {
        Un(), qt.value && (oA = new ResizeObserver(($e) => {
          for (const Tt of $e)
            hr.value = Tt.contentRect.width;
        }), oA.observe(qt.value));
      });
      const ye = ($e) => {
        $e.detail.taskId === e.task.id && (Ye.value = null, Ie.value = null);
      };
      window.addEventListener("resource-drag-cancel", ye);
      const Re = () => {
        An(() => {
          Un();
        });
      }, at = () => {
        An(() => {
          setTimeout(() => {
            Un();
          }, 10);
        });
      };
      window.addEventListener("timeline-scale-updated", Re), window.addEventListener("timeline-force-recalculate", at), window.addEventListener("close-all-taskbar-menus", ln), document.addEventListener("click", Hn), ga(() => {
        oA && (oA.disconnect(), oA = null), window.removeEventListener("timeline-scale-updated", Re), window.removeEventListener("timeline-force-recalculate", at), window.removeEventListener("close-all-taskbar-menus", ln), window.removeEventListener("resource-drag-cancel", ye), document.removeEventListener("click", Hn), dt.value !== null && (clearTimeout(dt.value), dt.value = null), Ta !== null && (clearTimeout(Ta), Ta = null);
      });
    }), Gt(
      () => [e.task.startDate, e.task.endDate],
      () => {
        An(() => {
          Un();
        });
      },
      { deep: !0 }
    ), Gt(
      () => [e.isHighlighted, e.isPrimaryHighlight],
      ([ye, Re]) => {
        if (ye || Re) {
          const at = C.value || H.value || M.value;
          C.value = !1, H.value = !1, M.value = !1, X.value = !1, pt.value = !1, ke.value = null, pa.value = !1, document.removeEventListener("mousemove", Vn), document.removeEventListener("mouseup", Xa), window.removeEventListener("timeline-auto-scroll", Yn), dt.value && (clearTimeout(dt.value), dt.value = null), Je.value && (clearTimeout(Je.value), Je.value = null), !at && !te.value && window.dispatchEvent(
            new CustomEvent("taskbar-highlighted", {
              detail: {
                taskId: e.task.id
              }
            })
          );
        }
      }
    );
    let Ta = null;
    const ts = (ye) => {
      if (!(C.value || H.value || M.value || te.value)) {
        if (Dt.value) {
          Dt.value = !1;
          return;
        }
        Ta === null && (Ta = window.setTimeout(() => {
          Ta = null, e.onClick && typeof e.onClick == "function" ? e.onClick(e.task, ye) : r("click", e.task, ye);
        }, BE));
      }
    }, Hs = (ye) => {
      ye.stopPropagation(), ye.preventDefault(), Ta !== null && (clearTimeout(Ta), Ta = null), C.value = !1, H.value = !1, M.value = !1, Ye.value = null, document.removeEventListener("mousemove", Vn), document.removeEventListener("mouseup", Xa), r("dblclick", e.task, ye);
    }, sa = ce(() => {
      const ye = e.scrollLeft || 0, Re = e.containerWidth || 0;
      if (f.value)
        return {
          nameLeft: "",
          namePosition: "",
          nameTop: "",
          progressLeft: "",
          progressPosition: "",
          progressTop: "",
          avatarLeft: "",
          avatarPosition: ""
        };
      if (!ye && !Re)
        return {
          nameLeft: "",
          namePosition: "",
          nameTop: "",
          progressLeft: "",
          progressPosition: "",
          progressTop: "",
          avatarLeft: "",
          avatarPosition: ""
        };
      const at = parseInt(Nt.value.left), $e = parseInt(Nt.value.width), Tt = at + $e, Lt = at + $e / 2, ut = ye, ct = ye + Re;
      let Ut = "", _t = "", Zt = "", fr = "", or = "", ar = "", Or = "", Kr = "";
      const sr = Math.max(hr.value, 40), Er = 35, nn = br.value, Pn = Ot.value.length, Ur = Pn > 0 ? Pn === 1 ? nn : nn + (Pn - 1) * Math.round(nn * 0.82) : 0, Qr = et.value, P = Qr + 3, he = at + P, Fe = at + P + Ur, tt = he < ut && Tt > ut || Lt < ut && Tt > ut, lt = Math.max(sr, Er), v = Fe + lt + 15 > ct && at < ct;
      let L = 0;
      if (tt)
        Or = `${ut - at + Qr + 3}px`, Kr = "absolute", L = Ur + 8;
      else if (v) {
        const dr = Math.max(sr, Er);
        Or = `${ct - at - dr - Qr - 3 - Ur - 15}px`, Kr = "absolute", L = -(Ur + 15);
      }
      const j = Lt - sr / 2, ae = Lt + sr / 2, pe = F.value.showAvatar;
      let Oe = !1;
      if (pe) {
        const dr = j, qr = Ur + 15;
        Oe = dr < ut + qr && Tt > ut;
      } else
        Oe = j < ut && Tt > ut && Lt < ut;
      const Pe = ae > ct && at < ct && Lt > ct;
      if (Oe) {
        const dr = ut - at, qr = tt ? L : 0;
        Ut = `${dr + Qr + 3 + qr}px`, _t = "absolute", Zt = "2px";
      } else Pe && (Ut = `${ct - at - sr - Qr - 10}px`, _t = "absolute", Zt = "2px");
      const mt = Lt - Er / 2, Qt = Lt + Er / 2;
      let Rt = !1;
      if (pe) {
        const dr = mt, qr = Ur + 15;
        Rt = dr < ut + qr && Tt > ut;
      } else
        Rt = mt < ut && Tt > ut && Lt < ut;
      const cr = Qt > ct && at < ct && Lt > ct;
      if (Rt) {
        const dr = ut - at, qr = tt ? L : 0;
        fr = `${dr + Qr + 3 + qr}px`, or = "absolute", ar = "18px";
      } else cr && (fr = `${ct - at - Er - Qr - 3}px`, or = "absolute", ar = "18px");
      return {
        nameLeft: Ut,
        namePosition: _t,
        nameTop: Zt,
        progressLeft: fr,
        progressPosition: or,
        progressTop: ar,
        avatarLeft: Or,
        avatarPosition: Kr
      };
    }), rs = ce(() => {
      if (F.value.titlePosition !== "above") return {};
      if (f.value) return {};
      const ye = e.scrollLeft || 0, Re = e.containerWidth || 0;
      if (!Re) return {};
      const at = Math.max(hr.value, 40), $e = parseInt(Nt.value.left), Tt = parseInt(Nt.value.width), Lt = $e + Tt, ut = ye, ct = ye + Re, Ut = $e + Tt / 2, _t = Ut - at / 2, Zt = Ut + at / 2, fr = _t < ut && Lt > ut && Ut < ut, or = Zt > ct && $e < ct && Ut > ct;
      return $e >= ut && Lt <= ct ? {} : fr ? { left: `${ut - $e + 10}px`, transform: "none" } : or ? { left: `${ct - $e - 10}px`, transform: "translateX(-100%)" } : {};
    }), Jn = ce(() => {
      const ye = e.scrollLeft || 0, Re = e.containerWidth || 0;
      if (!Re || Re <= 0)
        return {
          show: !1,
          left: "0px",
          side: "left",
          color: "#409eff",
          animationType: "none"
        };
      if (Da.value || ya.value || e.hideBubbles)
        return {
          show: !1,
          left: "0px",
          side: "left",
          color: rt.value.color,
          animationType: "none"
        };
      const at = parseInt(Nt.value.left), $e = parseInt(Nt.value.width), Tt = at + $e, Lt = ye, ut = ye + Re, ct = Tt <= Lt, Ut = at >= ut;
      return ct ? {
        show: !0,
        left: `${Lt - at - 4}px`,
        // 圆心在边界上,向左偏移半径(4px)
        side: "left",
        color: rt.value.color,
        animationType: "morphToSemiCircle"
      } : Ut ? {
        show: !0,
        left: `${ut - at - 8}px`,
        // 右侧半圆位置调整,减少偏移量
        side: "right",
        color: rt.value.color,
        animationType: "morphToSemiCircle"
      } : {
        show: !1,
        left: "0px",
        side: "left",
        color: rt.value.color,
        animationType: "none"
      };
    }), ia = me(!1), xa = me({ x: 0, y: 0 });
    let Bn = null;
    const Zn = me(!1), Xr = me(null), wa = me(!1), Da = me(!0), bn = me(!1), ya = me(!1), Ea = (ye) => {
      ye.stopPropagation(), ye.preventDefault();
      const Re = e.scrollLeft || 0, at = e.containerWidth || 0;
      if (!Re && !at) return;
      const $e = parseInt(Nt.value.left), Tt = parseInt(Nt.value.width), ut = $e + Tt / 2 - at / 2;
      bn.value = !0, ya.value = !0, ia.value = !1, r("scroll-to-position", ut);
    };
    Gt(
      () => [e.scrollLeft, e.containerWidth],
      (ye, Re) => {
        const [at, $e] = ye, [Tt, Lt] = Re || [0, 0], ut = at || 0, ct = $e || 0, Ut = Tt || 0, _t = Lt || 0;
        if (Math.abs(ct - _t) > 1 && _t > 0) {
          wa.value = !0, An(() => {
          }), Da.value && setTimeout(() => {
            Da.value = !1;
          }, 300), setTimeout(() => {
            wa.value = !1;
          }, 500);
          return;
        }
        Da.value && ut >= 0 && ct > 0 && setTimeout(() => {
          Da.value = !1;
        }, 1e3), ut !== Ut && !wa.value && (Zn.value = !0, Xr.value && clearTimeout(Xr.value), Xr.value = setTimeout(() => {
          Zn.value = !1, bn.value && (bn.value = !1, setTimeout(() => {
            ya.value = !1;
          }, 300));
        }, 200));
      },
      { immediate: !0 }
    ), Gt(
      () => e.hideBubbles,
      (ye, Re) => {
        Re && !ye && An(() => {
        });
      }
    ), Gt(
      () => Jn.value.show,
      () => {
      }
    );
    const Hr = () => {
      wa.value = !0, An(() => {
      }), setTimeout(() => {
        wa.value = !1;
      }, 300);
    };
    sA(() => {
      window.addEventListener("resize", Hr), window.addEventListener("zoom", Hr);
    }), ga(() => {
      document.removeEventListener("mousemove", Vn), document.removeEventListener("mouseup", Xa), window.removeEventListener("resize", Hr), window.removeEventListener("zoom", Hr);
    });
    const gA = (ye) => {
      if (ye.stopPropagation(), r("tooltip-hide"), Bn && (window.clearTimeout(Bn), Bn = null), k.value) {
        const ct = ye.currentTarget;
        r("tooltip-show", {
          task: e.task,
          taskStatus: rt.value,
          resourcePercent: A.value,
          hasResourceConflict: e.hasResourceConflict ?? !1,
          targetRect: ct.getBoundingClientRect(),
          parentAutoSchedule: e.isParent ? {
            enabled: e.enableParentTaskAutoSchedule ?? !0,
            childrenRange: er.value,
            hasOverflow: !!Dn.value
          } : void 0
        });
        return;
      }
      ia.value = !0;
      const Re = Jn.value.side === "right", at = 200, $e = document.querySelector(".gantt-panel-right"), Tt = $e == null ? void 0 : $e.getBoundingClientRect();
      let Lt = ye.clientX, ut = ye.clientY - 10;
      if (Tt) {
        let Ut = Lt + (Re ? -180 : 15);
        const _t = Tt.left, Zt = Tt.right;
        Ut < _t ? Ut = _t : Ut > Zt && (Ut = Zt), Ut < _t && (Ut = _t), Lt = Ut;
        const fr = Tt.top, or = Tt.bottom - at;
        ut < fr ? ut = fr : ut > or && (ut = or);
      } else
        Lt = Lt + (Re ? -180 : 15);
      xa.value = { x: Lt, y: ut };
    }, vA = (ye) => {
      ye.stopPropagation(), k.value ? r("tooltip-hide") : ia.value = !1;
    }, pA = (ye) => {
      ye.stopPropagation(), ia.value = !1;
    }, DA = (ye) => {
      if (Ct.value = !0, !Ve.value && e.enableTaskBarTooltip !== !1 && !C.value && !H.value && !M.value) {
        const Re = ye.currentTarget;
        Bn = window.setTimeout(() => {
          const at = Re.getBoundingClientRect();
          r("tooltip-show", {
            task: e.task,
            taskStatus: rt.value,
            resourcePercent: A.value,
            hasResourceConflict: e.hasResourceConflict ?? !1,
            targetRect: at,
            mouseX: ye.clientX,
            // [v1.11.6]
            mouseY: ye.clientY,
            // [v1.11.6]
            parentAutoSchedule: e.isParent ? {
              enabled: e.enableParentTaskAutoSchedule ?? !0,
              childrenRange: er.value,
              hasOverflow: !!Dn.value
            } : void 0
          });
        }, 300);
      }
    }, oa = () => {
      Ct.value = !1, Bn && (clearTimeout(Bn), Bn = null), r("tooltip-hide");
    };
    Gt(
      [C, H, M],
      ([ye, Re, at]) => {
        (ye || Re || at) && (r("tooltip-hide"), Bn && (clearTimeout(Bn), Bn = null));
        const $e = ye || Re || at;
        nt.value !== $e && (nt.value = $e);
      },
      {
        flush: "sync"
        // 同步执行,确保状态重置时立即触发
      }
    ), Gt(Ve, (ye) => {
      ye && (r("tooltip-hide"), Bn && (clearTimeout(Bn), Bn = null));
    });
    const Ja = (ye) => {
      if (!ye) return G("dateNotSet");
      const Re = Q(ye);
      if (!Re) return G("dateNotSet");
      const at = Re.getFullYear(), $e = String(Re.getMonth() + 1).padStart(2, "0"), Tt = String(Re.getDate()).padStart(2, "0");
      return `${at}-${$e}-${Tt}`;
    }, Za = ce(() => {
      const ye = Q(e.task.startDate), Re = Q(e.task.endDate);
      let at = 0;
      if (ye && Re) {
        const Lt = Math.abs(Re.getTime() - ye.getTime());
        at = Math.ceil(Lt / (1e3 * 60 * 60 * 24)) * 8;
      }
      const $e = e.task.progress || 0, Tt = Math.round(at * $e / 100);
      return {
        total: at,
        used: Tt
      };
    }), ea = ce(() => !0), fs = () => {
      const ye = sa.value, Re = {};
      return ye.nameLeft && (Re.left = ye.nameLeft), ye.namePosition && (Re.position = ye.namePosition), ye.nameTop && (Re.top = ye.nameTop), Re;
    }, OA = () => {
      const ye = sa.value, Re = {};
      return ye.progressLeft && (Re.left = ye.progressLeft), ye.progressPosition && (Re.position = ye.progressPosition), ye.progressTop && (Re.top = ye.progressTop), Re;
    }, Ha = () => {
      const ye = sa.value, Re = {};
      return ye.avatarLeft && (Re.left = ye.avatarLeft), ye.avatarPosition && (Re.position = ye.avatarPosition), Re;
    }, Wt = ce(() => parseInt(Nt.value.width) - 10 < br.value), fe = ce(() => ({
      width: `${Math.min(F.value.resizeHandleWidth ?? 5, 15)}px`
    })), et = ce(() => Math.min(F.value.resizeHandleWidth ?? 5, 15)), ft = (ye, Re, at) => {
      var Tt;
      let $e = 0;
      for (const Lt of Re)
        if (at === Ue.DAY) {
          const ut = Lt.days || [];
          for (let ct = 0; ct < ut.length; ct++) {
            const Ut = ut[ct], _t = new Date(Ut.date);
            if (_t.getFullYear() === ye.getFullYear() && _t.getMonth() === ye.getMonth() && _t.getDate() === ye.getDate())
              return $e + ct * e.dayWidth;
          }
          $e += ut.length * e.dayWidth;
        } else if (at === Ue.QUARTER) {
          const ut = Lt.quarters || [];
          for (const ct of ut) {
            const Ut = new Date(ct.startDate), _t = new Date(ct.endDate);
            if (ye >= Ut && ye <= _t) {
              const Zt = e.dayWidth * 90, fr = Math.round((_t.getTime() - Ut.getTime()) / (1e3 * 60 * 60 * 24)) + 1, or = Zt / fr, ar = Math.round(
                (ye.getTime() - Ut.getTime()) / (1e3 * 60 * 60 * 24)
              );
              return $e + ar * or;
            }
            $e += e.dayWidth * 90;
          }
        } else if (at === Ue.WEEK) {
          const ut = Lt.weeks || [];
          for (const ct of ut) {
            const Ut = new Date(ct.weekStart), _t = new Date(ct.weekEnd);
            if (ye >= Ut && ye <= _t) {
              const Zt = e.dayWidth * 7, fr = ct.subDays || [], or = Zt / 7;
              for (let Or = 0; Or < fr.length; Or++) {
                const Kr = fr[Or], sr = new Date(Kr.date);
                if (sr.getFullYear() === ye.getFullYear() && sr.getMonth() === ye.getMonth() && sr.getDate() === ye.getDate())
                  return $e + Or * or;
              }
              const ar = ye.getDay();
              return $e + ar * or;
            }
            $e += e.dayWidth * 7;
          }
        } else if (at === Ue.MONTH) {
          const ut = new Date(Lt.startDate), ct = new Date(Lt.endDate);
          if (ye >= ut && ye <= ct) {
            const Ut = e.dayWidth * 30, _t = ((Tt = Lt.monthData) == null ? void 0 : Tt.dayCount) || 30, Zt = Ut / _t, fr = ye.getDate();
            return $e + (fr - 1) * Zt;
          }
          $e += e.dayWidth * 30;
        } else if (at === Ue.YEAR) {
          const ut = Lt.halfYears || [];
          for (const ct of ut) {
            const Ut = new Date(ct.startDate), _t = new Date(ct.endDate);
            if (ye >= Ut && ye <= _t) {
              const Zt = e.dayWidth * 182.5, fr = Math.round((_t.getTime() - Ut.getTime()) / (1e3 * 60 * 60 * 24)) + 1, or = Zt / fr, ar = Math.round(
                (ye.getTime() - Ut.getTime()) / (1e3 * 60 * 60 * 24)
              );
              return $e + ar * or;
            }
            $e += e.dayWidth * (365 / 2);
          }
        }
      if (Re.length > 0) {
        const Lt = Re[0], ut = Re[Re.length - 1], ct = new Date(Lt.startDate), Ut = new Date(ut.endDate);
        if (ye < ct)
          return -Math.ceil(
            (ct.getTime() - ye.getTime()) / 864e5
          ) * e.dayWidth;
        if (ye > Ut) {
          const _t = Math.ceil(
            (ye.getTime() - Ut.getTime()) / 864e5
          );
          return $e + _t * e.dayWidth;
        }
      }
      return $e;
    }, Yt = (ye, Re, at) => {
      var Tt;
      if (!Re)
        return null;
      let $e = 0;
      if (at === Ue.DAY)
        for (const Lt of Re) {
          const ut = Lt.days || [], ct = ut.length * e.dayWidth;
          if (ye >= $e && ye < $e + ct) {
            const Ut = ye - $e, _t = Math.floor(Ut / e.dayWidth);
            if (_t >= 0 && _t < ut.length)
              return new Date(ut[_t].date);
          }
          $e += ct;
        }
      else if (at === Ue.MONTH)
        for (const Lt of Re) {
          const ut = e.dayWidth * 30;
          if (ye >= $e && ye < $e + ut) {
            const ct = ye - $e, Ut = ((Tt = Lt.monthData) == null ? void 0 : Tt.dayCount) || 30, _t = ut / Ut, Zt = Math.floor(ct / _t), fr = Math.min(Zt + 1, Ut);
            return new Date(Lt.year, Lt.month - 1, fr);
          }
          $e += ut;
        }
      else if (at === Ue.QUARTER)
        for (const Lt of Re) {
          const ut = Lt.quarters || [];
          for (const ct of ut) {
            const Ut = new Date(ct.startDate), _t = new Date(ct.endDate), Zt = e.dayWidth * 90;
            if (ye >= $e && ye < $e + Zt) {
              const fr = ye - $e, or = Math.ceil(
                (_t.getTime() - Ut.getTime()) / (1e3 * 60 * 60 * 24)
              ), ar = Zt / or, Or = Math.floor(fr / ar), Kr = new Date(Ut);
              return Kr.setDate(Kr.getDate() + Or), Kr;
            }
            $e += Zt;
          }
        }
      else if (at === Ue.YEAR)
        for (const Lt of Re) {
          const ut = Lt.halfYears || [];
          for (const ct of ut) {
            const Ut = new Date(ct.startDate), _t = new Date(ct.endDate), Zt = e.dayWidth * (365 / 2);
            if (ye >= $e && ye < $e + Zt) {
              const fr = ye - $e, or = Math.ceil(
                (_t.getTime() - Ut.getTime()) / (1e3 * 60 * 60 * 24)
              ), ar = Zt / or, Or = Math.floor(fr / ar), Kr = new Date(Ut);
              return Kr.setDate(Kr.getDate() + Or), Kr;
            }
            $e += Zt;
          }
        }
      return null;
    }, zt = me(!1), gr = me({ x: 0, y: 0 }), rn = ce(() => e.task);
    function Gn(ye) {
      if (!D.value) {
        ye.preventDefault();
        return;
      }
      if (e.isHighlighted || e.isPrimaryHighlight) {
        ye.preventDefault();
        return;
      }
      window.dispatchEvent(new CustomEvent("close-all-taskbar-menus"));
      const Re = e.task.type || "task";
      if (Re !== "task" && Re !== "story") {
        ye.preventDefault(), zt.value = !1;
        return;
      }
      ye.preventDefault(), Bn && (clearTimeout(Bn), Bn = null), r("tooltip-hide"), zt.value = !0, gr.value = { x: ye.clientX, y: ye.clientY };
    }
    function ln() {
      zt.value = !1;
    }
    function Hn(ye) {
      if (!zt.value) return;
      const Re = ye.target, at = document.querySelector(".task-context-menu");
      at && at.contains(Re) || ln();
    }
    const Ln = (ye, Re) => {
      r("delete", ye, Re), ln();
    }, On = (ye) => {
      r("delete-link", ye), ln();
    }, hs = (ye) => {
      r("link-drag-start", ye);
    }, Dr = (ye) => {
      r("link-drag-move", ye);
    }, Pi = (ye) => {
      r("link-drag-end", ye);
    }, Xs = (ye) => {
      const Re = {
        clientX: ye.x,
        clientY: ye.y
      };
      hs({
        task: e.task,
        type: ye.type,
        mouseEvent: Re
      });
    }, bi = (ye) => {
      Dr({
        mouseX: ye.x,
        mouseY: ye.y
      });
    }, Os = (ye) => {
      Pi({
        task: e.task,
        type: ye.type
      });
    };
    return (ye, Re) => {
      var at;
      return $(), ee(St, null, [
        _("div", XA({ class: "task-bar-wrapper" }, ye.$attrs), [
          pn.value && Ar.value && !n.isParent ? ($(), ee("div", {
            key: 0,
            class: tr(["actual-bar", {
              highlighted: n.isHighlighted,
              "primary-highlight": n.isPrimaryHighlight,
              dimmed: on.value
            }]),
            "data-task-id": `actual-${n.task.id}`,
            style: Mt({
              ...pn.value,
              backgroundColor: rt.value.color,
              filter: "brightness(1.15) saturate(0.9)",
              boxShadow: `0 6px 20px ${rt.value.color}60, 0 3px 10px ${rt.value.color}40`
            })
          }, [
            jt.value ? ($(), ee("span", SD, Ee(n.task.progress || 0) + "%", 1)) : ($(), ee("div", {
              key: 0,
              class: "actual-bar-content",
              style: Mt(n.rowHeight < 40 ? { fontSize: "9px" } : {})
            }, [
              _("span", ED, Ee(n.task.progress || 0) + "%", 1)
            ], 4)),
            jt.value ? vt("", !0) : ($(), ee("div", FD, [
              F.value.showAvatar && Te(l) !== "resource" && Ot.value.length > 0 ? ($(), ee("div", UD, [
                ($(!0), ee(St, null, nr(Ot.value, ($e, Tt) => ($(), ee("div", {
                  key: Tt,
                  class: tr(["actual-task-avatar", {
                    "avatar-default": !$e || typeof $e == "object" && !$e.isText && !$e
                  }]),
                  style: Mt({
                    zIndex: Tt + 1,
                    marginLeft: Tt > 0 ? "-8px" : "0"
                  })
                }, [
                  $e && typeof $e == "object" && $e.isText ? ($(), ee("span", LD, Ee($e.name.charAt(0).toUpperCase()), 1)) : $e && typeof $e == "string" ? ($(), ee("img", {
                    key: 1,
                    src: $e,
                    alt: `avatar-${Tt}`
                  }, null, 8, ID)) : ($(), ee("svg", QD, [...Re[8] || (Re[8] = [
                    _("path", {
                      d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z",
                      fill: "currentColor"
                    }, null, -1)
                  ])]))
                ], 6))), 128))
              ])) : vt("", !0),
              F.value.showTitle ? ($(), ee("div", {
                key: 1,
                class: "actual-task-name-wrapper",
                style: Mt({
                  fontSize: n.rowHeight < 40 ? "10px" : "12px",
                  color: rt.value.color
                })
              }, [
                W.value ? Nn(ye.$slots, "custom-task-content", qs(XA({ key: 0 }, yt.value)), void 0, !0) : ($(), ee("div", {
                  key: 1,
                  class: "actual-task-name",
                  innerHTML: n.task.name
                }, null, 8, MD))
              ], 4)) : vt("", !0)
            ]))
          ], 14, DD)) : vt("", !0),
          Dn.value ? ($(), ee("div", {
            key: 1,
            class: "parent-overflow-bar",
            style: Mt({
              ...Dn.value,
              backgroundColor: "#f56c6c"
            })
          }, null, 4)) : vt("", !0),
          Ar.value ? ($(), ee("div", {
            key: 2,
            ref_key: "barRef",
            ref: it,
            class: tr(["task-bar", {
              dragging: C.value,
              resizing: H.value || M.value,
              completed: vr.value,
              "parent-task": n.isParent,
              "week-view": xn.value,
              "short-task-bar": $r.value,
              "overflow-effect": Ca.value,
              highlighted: n.isHighlighted,
              "primary-highlight": n.isPrimaryHighlight,
              dimmed: on.value,
              "has-actual": n.showActualTaskbar && Y.value,
              "resource-conflict": e.hasResourceConflict,
              "resource-view": Te(l) === "resource",
              "has-bubble": Jn.value.show
            }]),
            "data-task-id": n.task.id,
            style: Mt({
              ...Nt.value,
              backgroundColor: n.showActualTaskbar && Y.value && Ct.value ? "transparent" : rt.value.bgColor,
              borderColor: ht.value,
              ...Te(l) === "resource" && n.currentResourceId ? {
                borderTopWidth: "2px",
                borderTopStyle: "solid",
                borderTopColor: i.value
              } : {},
              color: rt.value.color,
              cursor: vr.value || n.isParent ? "default" : "move",
              "--row-height": `${n.rowHeight}px`,
              "--handle-width": `${et.value}px`,
              "--parent-color": rt.value.color,
              "--allocation-capacity": Number.isFinite(A.value) ? A.value / 100 : 1,
              "--task-bar-bg-color": rt.value.bgColor,
              "--task-bar-border-color": ht.value,
              boxShadow: n.isParent ? `0 4px 16px ${rt.value.color}40, 0 2px 8px ${rt.value.color}26` : `0 4px 16px ${rt.value.color}40, 0 2px 8px ${rt.value.color}26`
            }),
            onClick: ts,
            onContextmenu: Gn,
            onDblclick: Hs,
            onMouseenter: DA,
            onMouseleave: oa
          }, [
            n.isParent && F.value.titlePosition !== "above" ? ($(), ee("div", RD, [
              W.value ? Nn(ye.$slots, "custom-task-content", qs(XA({ key: 0 }, yt.value)), void 0, !0) : ($(), ee(St, { key: 1 }, [
                fn(Ee(n.task.name) + " (" + Ee(n.task.progress || 0) + "%) ", 1)
              ], 64))
            ])) : vt("", !0),
            F.value.showTitle && F.value.titlePosition === "above" && !(n.showActualTaskbar && Y.value) ? ($(), ee("div", {
              key: 1,
              class: "task-title-above",
              style: Mt(rs.value)
            }, [
              W.value ? Nn(ye.$slots, "custom-task-content", qs(XA({ key: 0 }, yt.value)), void 0, !0) : ($(), ee("span", ND, Ee(n.task.name) + Ee(n.isParent ? ` (${n.task.progress || 0}%)` : ""), 1))
            ], 4)) : vt("", !0),
            !n.isParent && n.task.progress && n.task.progress > 0 ? ($(), ee("div", {
              key: 2,
              class: "progress-bar",
              style: Mt({
                width: an.value,
                backgroundColor: rt.value.color
              })
            }, null, 4)) : vt("", !0),
            Te(u) && Te(l) === "resource" && !n.isParent && n.currentResourceId ? ($(), Ir(TD, {
              key: `tab-${n.task.id}-${n.currentResourceId}`,
              task: n.task,
              "current-resource-id": n.currentResourceId,
              "resource-color": i.value,
              "resource-capacity": A.value,
              "resource-name": s.value,
              "task-bar-width": Ge.value,
              "task-bar-left": xr.value,
              "scroll-left": n.scrollLeft || 0,
              "container-width": n.containerWidth || 0,
              "has-conflict": n.hasResourceConflict,
              "conflict-tasks": n.conflictTasks,
              resources: n.resources,
              onHoverChange: Re[0] || (Re[0] = ($e) => Ve.value = $e)
            }, null, 8, ["task", "current-resource-id", "resource-color", "resource-capacity", "resource-name", "task-bar-width", "task-bar-left", "scroll-left", "container-width", "has-conflict", "conflict-tasks", "resources"])) : vt("", !0),
            !vr.value && !n.isParent && !Z.value && e.allowDragAndResize !== !1 && !n.isHighlighted && !n.isPrimaryHighlight ? ($(), ee("div", {
              key: 4,
              class: "resize-handle resize-handle-left",
              style: Mt(fe.value),
              onMousedown: Re[1] || (Re[1] = ($e) => ka($e, "resize-left"))
            }, null, 36)) : vt("", !0),
            n.isParent ? vt("", !0) : ($(), ee("div", {
              key: 5,
              class: "task-bar-content",
              style: Mt({
                cursor: Z.value || e.allowDragAndResize === !1 || n.isHighlighted || n.isPrimaryHighlight ? "grab" : "move",
                ...n.rowHeight < 40 ? { flexDirection: "row", gap: "10px", alignItems: "center" } : {}
              }),
              onMousedown: Re[2] || (Re[2] = ($e) => {
                n.isHighlighted || n.isPrimaryHighlight || Z.value || e.allowDragAndResize === !1 || ka($e, "drag");
              })
            }, [
              F.value.showAvatar && Te(l) !== "resource" && !(n.showActualTaskbar && Y.value) && Ot.value.length > 0 ? ($(), ee("div", {
                key: 0,
                class: tr(["task-avatars-container", { "avatar-outside": Wt.value }]),
                style: Mt(Ha())
              }, [
                ($(!0), ee(St, null, nr(Ot.value, ($e, Tt) => ($(), ee("div", {
                  key: Tt,
                  class: tr(["task-avatar", {
                    "avatar-default": !$e || typeof $e == "object" && !$e.isText && !$e
                  }]),
                  style: Mt({
                    zIndex: Tt + 1,
                    width: `${br.value}px`,
                    height: `${br.value}px`,
                    marginLeft: Tt > 0 ? `-${Math.round(br.value * 0.36)}px` : "0"
                  })
                }, [
                  $e && typeof $e == "object" && $e.isText ? ($(), ee("span", HD, Ee($e.name.charAt(0).toUpperCase()), 1)) : $e && typeof $e == "string" ? ($(), ee("img", {
                    key: 1,
                    src: $e,
                    alt: `avatar-${Tt}`
                  }, null, 8, OD)) : ($(), ee("svg", PD, [...Re[9] || (Re[9] = [
                    _("path", {
                      d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z",
                      fill: "currentColor"
                    }, null, -1)
                  ])]))
                ], 6))), 128))
              ], 6)) : vt("", !0),
              F.value.showTitle && !(n.showActualTaskbar && Y.value) && F.value.titlePosition !== "above" ? ($(), ee("div", {
                key: 1,
                ref_key: "taskBarNameRef",
                ref: qt,
                style: Mt({
                  ...fs(),
                  ...n.rowHeight < 40 ? { lineHeight: "1", fontSize: "10px" } : {}
                })
              }, [
                W.value ? Nn(ye.$slots, "custom-task-content", qs(XA({ key: 0 }, yt.value)), void 0, !0) : ($(), ee("div", WD, Ee(n.task.name), 1))
              ], 4)) : vt("", !0),
              F.value.showProgress && ea.value && !(n.showActualTaskbar && Y.value) ? ($(), ee("div", {
                key: 2,
                class: "task-progress",
                style: Mt({
                  ...OA(),
                  ...n.rowHeight < 40 ? { lineHeight: "1", fontSize: "9px" } : {}
                })
              }, Ee(n.task.progress || 0) + "% ", 5)) : vt("", !0)
            ], 36)),
            !vr.value && !n.isParent && !Z.value && e.allowDragAndResize !== !1 && !n.isHighlighted && !n.isPrimaryHighlight ? ($(), ee("div", {
              key: 6,
              class: "resize-handle resize-handle-right",
              style: Mt(fe.value),
              onMousedown: Re[3] || (Re[3] = ($e) => ka($e, "resize-right"))
            }, null, 36)) : vt("", !0),
            Te(a) && !n.isParent && !n.isInHighlightMode ? ($(), Ir(Lm, {
              key: 7,
              type: "predecessor",
              "task-id": n.task.id,
              visible: Ct.value,
              "is-drag-source": n.isLinkDragSource && n.dragLinkMode === "predecessor",
              "is-drag-target": n.isValidLinkTarget || n.isInvalidLinkTarget,
              "is-valid-target": n.isValidLinkTarget,
              "global-dragging": !!n.dragLinkMode,
              onDragStart: Xs,
              onDragMove: bi,
              onDragEnd: Os
            }, null, 8, ["task-id", "visible", "is-drag-source", "is-drag-target", "is-valid-target", "global-dragging"])) : vt("", !0),
            Te(a) && !n.isParent && !n.isInHighlightMode ? ($(), Ir(Lm, {
              key: 8,
              type: "successor",
              "task-id": n.task.id,
              visible: Ct.value,
              "is-drag-source": n.isLinkDragSource && n.dragLinkMode === "successor",
              "is-drag-target": n.isValidLinkTarget || n.isInvalidLinkTarget,
              "is-valid-target": n.isValidLinkTarget,
              "global-dragging": !!n.dragLinkMode,
              onDragStart: Xs,
              onDragMove: bi,
              onDragEnd: Os
            }, null, 8, ["task-id", "visible", "is-drag-source", "is-drag-target", "is-valid-target", "global-dragging"])) : vt("", !0),
            Jn.value.show && !n.isParent ? ($(), ee("div", {
              key: 9,
              class: tr(["bubble-indicator", [
                `bubble-${Jn.value.side}`,
                `bubble-animation-${Jn.value.animationType}`
              ]]),
              style: Mt({
                left: Jn.value.left,
                backgroundColor: Jn.value.color,
                borderColor: Jn.value.color
              }),
              onMouseenter: dn(gA, ["stop"]),
              onMouseleave: dn(vA, ["stop"]),
              onMousedown: dn(pA, ["stop"]),
              onClick: dn(Ea, ["stop"])
            }, null, 38)) : vt("", !0),
            B.value ? ($(), Ir(u5, {
              key: 10,
              visible: zt.value,
              task: rn.value,
              position: gr.value,
              "all-tasks": n.allTasks,
              onClose: ln,
              onStartTimer: Re[4] || (Re[4] = ($e) => ye.$emit("start-timer", e.task)),
              onStopTimer: Re[5] || (Re[5] = ($e) => ye.$emit("stop-timer", e.task)),
              onAddPredecessor: Re[6] || (Re[6] = ($e) => ye.$emit("add-predecessor", e.task)),
              onAddSuccessor: Re[7] || (Re[7] = ($e) => ye.$emit("add-successor", e.task)),
              onDelete: Ln,
              onDeleteLink: On
            }, null, 8, ["visible", "task", "position", "all-tasks"])) : vt("", !0),
            ($(), Ir(es, { to: "body" }, [
              O.value && zt.value && ((at = Te(m)) != null && at.defaultSlot) ? ($(), ee("div", {
                key: 0,
                class: "gantt-context-menu-wrapper",
                style: Mt({
                  position: "fixed",
                  left: `${gr.value.x}px`,
                  top: `${gr.value.y}px`,
                  zIndex: "var(--gantt-z-overlay)"
                })
              }, [
                ($(), Ir(ro(Te(m).defaultSlot), {
                  row: rn.value,
                  $index: e.rowIndex ?? -1
                }, null, 8, ["row", "$index"]))
              ], 4)) : vt("", !0)
            ]))
          ], 46, _D)) : vt("", !0)
        ], 16),
        ($(), Ir(es, { to: "body" }, [
          ia.value && !Ve.value ? ($(), ee("div", {
            key: 0,
            class: "task-tooltip",
            style: Mt({
              left: `${xa.value.x}px`,
              top: `${xa.value.y}px`
            })
          }, [
            Re[10] || (Re[10] = _("div", { class: "tooltip-arrow" }, null, -1)),
            _("div", KD, Ee(n.task.name), 1),
            _("div", $D, [
              Te(l) === "resource" && A.value < 100 ? ($(), ee("div", VD, [
                _("span", qD, Ee(G("resourceView.capacity") || "利用率") + ":", 1),
                _("span", jD, Ee(A.value) + "%", 1)
              ])) : vt("", !0),
              _("div", YD, [
                _("span", GD, Ee(G("startDate")) + ":", 1),
                _("span", zD, Ee(Ja(n.task.startDate)), 1)
              ]),
              _("div", XD, [
                _("span", JD, Ee(G("endDate")) + ":", 1),
                _("span", ZD, Ee(Ja(n.task.endDate)), 1)
              ]),
              _("div", eE, [
                _("span", tE, Ee(G("estimatedHours")) + ":", 1),
                _("span", rE, Ee(Za.value.total) + "h", 1)
              ]),
              _("div", nE, [
                _("span", aE, Ee(G("actualHours")) + ":", 1),
                _("span", AE, Ee(Za.value.used) + "h", 1)
              ]),
              _("div", sE, [
                _("span", iE, Ee(G("progress")) + ":", 1),
                _("span", oE, Ee(n.task.progress || 0) + "%", 1)
              ]),
              e.hasResourceConflict ? ($(), ee("div", lE, [
                _("span", uE, "⚠️ " + Ee(G("resourceView.overloaded") || "资源超负荷"), 1)
              ])) : vt("", !0)
            ])
          ], 4)) : vt("", !0)
        ])),
        ($(), Ir(es, { to: "body" }, [
          pa.value ? ($(), ee("div", {
            key: 0,
            class: "drag-tooltip",
            style: Mt({
              left: `${ma.value.x}px`,
              top: `${ma.value.y}px`
            })
          }, [
            _("div", cE, [
              _("div", dE, [
                _("span", fE, Ee(G("startDate")) + ":", 1),
                _("span", hE, Ee(Ja(En.value.startDate)), 1)
              ]),
              _("div", gE, [
                _("span", vE, Ee(G("endDate")) + ":", 1),
                _("span", pE, Ee(Ja(En.value.endDate)), 1)
              ])
            ])
          ], 4)) : vt("", !0)
        ])),
        ($(), Ir(es, { to: "body" }, [
          ne.value ? ($(), ee("div", {
            key: 0,
            class: "drag-preview",
            style: Mt({
              left: `${gt.value.x}px`,
              top: `${gt.value.y}px`,
              width: Nt.value.width,
              height: Nt.value.height,
              backgroundColor: rt.value.color,
              borderColor: rt.value.borderColor
            })
          }, [
            _("div", mE, Ee(n.task.name), 1)
          ], 4)) : vt("", !0)
        ]))
      ], 64);
    };
  }
}), Qm = /* @__PURE__ */ Fn(bE, [["__scopeId", "data-v-45b1eadb"]]), CE = ["title"], kE = {
  key: 0,
  transform: "rotate(45 12 12)"
}, TE = ["fill", "stroke"], xE = { key: 1 }, DE = {
  key: 2,
  transform: "rotate(45 12 12)"
}, EE = ["fill", "stroke"], SE = /* @__PURE__ */ hn({
  __name: "MilestonePoint",
  props: {
    date: {},
    milestone: {},
    task: {},
    name: {},
    rowHeight: {},
    dayWidth: {},
    startDate: {},
    timelineStart: {},
    timelineEnd: {},
    labelPosition: {},
    scrollLeft: {},
    containerWidth: {},
    milestoneId: {},
    otherMilestones: {},
    currentTimeScale: {},
    timelineData: {},
    periodWidth: {},
    isInHighlightMode: { type: Boolean },
    allowDragAndResize: { type: Boolean }
  },
  emits: ["milestone-double-click", "update:milestone", "drag-end", "milestone-tooltip-show", "milestone-tooltip-hide"],
  setup(n, { emit: t }) {
    const e = n, r = t, a = me(!1), A = me(0), i = me(0), s = me(null), o = me(null), l = me(null), u = (N) => {
      if (N.preventDefault(), N.stopPropagation(), !(x.value.isSticky || x.value.isPushedOut || !x.value.showIcon))
        if (a.value = !1, s.value = null, document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", m), e.milestone)
          r("milestone-double-click", e.milestone);
        else {
          const se = {
            name: e.name || "里程碑",
            startDate: e.date,
            type: "milestone"
          };
          r("milestone-double-click", se);
        }
    }, f = (N, se) => {
      const Z = new Date(N);
      return Z.setDate(Z.getDate() + se), Z;
    }, h = (N) => {
      const se = N.getFullYear(), Z = String(N.getMonth() + 1).padStart(2, "0"), C = String(N.getDate()).padStart(2, "0");
      return `${se}-${Z}-${C}`;
    }, c = (N, se, Z) => {
      var H;
      if (!se)
        return null;
      let C = 0;
      if (Z === Ue.DAY)
        for (const M of se) {
          const te = M.days || [], ie = te.length * e.dayWidth;
          if (N >= C && N < C + ie) {
            const we = N - C, ve = Math.floor(we / e.dayWidth);
            if (ve >= 0 && ve < te.length)
              return new Date(te[ve].date);
          }
          C += ie;
        }
      else if (Z === Ue.MONTH)
        for (const M of se) {
          const te = e.dayWidth * 30;
          if (N >= C && N < C + te) {
            const ie = N - C, we = ((H = M.monthData) == null ? void 0 : H.dayCount) || 30, ve = te / we, le = Math.floor(ie / ve), _e = Math.min(le + 1, we);
            return new Date(M.year, M.month - 1, _e);
          }
          C += te;
        }
      else if (Z === Ue.QUARTER)
        for (const M of se) {
          const te = M.quarters || [];
          for (const ie of te) {
            const we = new Date(ie.startDate), ve = new Date(ie.endDate), le = e.dayWidth * 90;
            if (N >= C && N < C + le) {
              const _e = N - C, De = Math.ceil(
                (ve.getTime() - we.getTime()) / (1e3 * 60 * 60 * 24)
              ), ze = le / De, nt = Math.floor(_e / ze), Qe = new Date(we);
              return Qe.setDate(Qe.getDate() + nt), Qe;
            }
            C += e.dayWidth * 90;
          }
        }
      else if (Z === Ue.YEAR)
        for (const M of se) {
          const te = M.halfYears || [];
          for (const ie of te) {
            const we = new Date(ie.startDate), ve = new Date(ie.endDate), le = e.dayWidth * (365 / 2);
            if (N >= C && N < C + le) {
              const _e = N - C, De = Math.round((ve.getTime() - we.getTime()) / (1e3 * 60 * 60 * 24)) + 1, ze = le / De, nt = Math.floor(_e / ze), Qe = new Date(we);
              return Qe.setDate(Qe.getDate() + nt), Qe;
            }
            C += le;
          }
        }
      return null;
    }, p = (N) => {
      e.allowDragAndResize === !1 || x.value.isSticky || x.value.isPushedOut || !x.value.showIcon || (N.preventDefault(), N.stopPropagation(), !document.querySelector(".timeline")) || (A.value = N.clientX, i.value = parseInt(q.value.left), s.value = null, window.addEventListener("timeline-auto-scroll", w), document.addEventListener("mousemove", y), document.addEventListener("mouseup", m));
    }, w = (N) => {
      const { scrollDelta: se } = N.detail;
      a.value && (A.value -= se);
    }, y = (N) => {
      window.dispatchEvent(
        new CustomEvent("drag-boundary-check", {
          detail: {
            mouseX: N.clientX,
            isDragging: a.value
          }
        })
      );
      const se = N.clientX - A.value;
      if (Math.abs(se) > 3) {
        a.value = !0;
        const Z = Math.max(0, i.value + se);
        let C;
        if (e.currentTimeScale === Ue.MONTH || e.currentTimeScale === Ue.QUARTER || e.currentTimeScale === Ue.DAY || e.currentTimeScale === Ue.YEAR)
          if (e.timelineData && e.currentTimeScale) {
            const H = c(
              Z,
              e.timelineData,
              e.currentTimeScale
            );
            H ? C = H : C = f(e.startDate, Z / e.dayWidth);
          } else
            C = f(e.startDate, Z / e.dayWidth);
        else
          C = f(e.startDate, Z / e.dayWidth);
        s.value = {
          startDate: h(C)
        };
      }
    }, m = () => {
      if (window.dispatchEvent(
        new CustomEvent("drag-boundary-check", {
          detail: {
            mouseX: 0,
            isDragging: !1
          }
        })
      ), a.value && s.value && e.milestone) {
        const N = {
          ...e.milestone,
          ...s.value
        };
        r("update:milestone", N), r("drag-end", N);
      }
      window.removeEventListener("timeline-auto-scroll", w), a.value = !1, s.value = null, document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", m);
    }, k = (N) => {
      if (N.preventDefault(), N.stopPropagation(), a.value || x.value.isPushedOut || !x.value.showIcon || x.value.isFullyVisible)
        return;
      const se = e.containerWidth || 0, Z = parseInt(q.value.left) + 12;
      if (se > 0) {
        const C = Math.max(0, Z - se / 2);
        window.dispatchEvent(
          new CustomEvent("milestone-click-locate", {
            detail: {
              scrollLeft: C,
              smooth: !0
            }
          })
        );
      }
    }, D = ce(() => e.isInHighlightMode === !0), B = ce(() => {
      var H;
      const N = ((H = s.value) == null ? void 0 : H.startDate) || e.date, se = BT(N);
      if (!e.startDate || !se || isNaN(se.getTime()))
        return null;
      const Z = 12;
      return e.currentTimeScale === Ue.HOUR ? S(se, e.startDate) - Z : e.timelineData && e.currentTimeScale && (e.currentTimeScale === Ue.WEEK || e.currentTimeScale === Ue.MONTH || e.currentTimeScale === Ue.DAY || e.currentTimeScale === Ue.QUARTER || e.currentTimeScale === Ue.YEAR) ? I(
        se,
        e.timelineData,
        e.currentTimeScale
      ) - Z : Math.floor(
        (se.getTime() - e.startDate.getTime()) / (1e3 * 60 * 60 * 24)
      ) * e.dayWidth + e.dayWidth / 2 - Z;
    }), O = ce(() => e.currentTimeScale === Ue.YEAR || e.currentTimeScale === Ue.QUARTER ? Math.min(e.rowHeight, 24) : e.currentTimeScale === Ue.MONTH ? Math.min(e.rowHeight, 20) : e.currentTimeScale === Ue.WEEK ? Math.min(e.rowHeight, Math.max(e.dayWidth * 0.8, 16), 24) : Math.min(e.rowHeight, e.dayWidth * 1.2, 24)), q = ce(() => {
      if (B.value === null)
        return {
          left: "0px",
          top: "0px",
          width: "auto",
          height: "auto"
        };
      const N = (Y.value === "top" || Y.value === "bottom") && (E.value || !!e.name) && x.value.showLabel, se = 24, Z = 16;
      let C;
      if (N) {
        const H = (e.rowHeight - (se + Z)) / 2;
        C = Y.value === "top" ? H + Z : H;
      } else
        C = (e.rowHeight - O.value) / 2;
      return {
        left: `${B.value}px`,
        top: `${C}px`,
        width: "auto",
        height: "auto"
      };
    }), G = ce(() => "var(--gantt-danger, #f56c6c)"), W = ce(() => "var(--gantt-danger-light, #fab6b6)"), F = ce(() => {
      var N;
      return ((N = e.milestone) == null ? void 0 : N.icon) || "diamond";
    }), Y = ce(() => e.labelPosition || "right"), T = Jl(), E = me(!!T["custom-milestone-content"]);
    pT(() => {
      const N = !!T["custom-milestone-content"];
      E.value !== N && (E.value = N);
    });
    const Q = ce(() => ({
      milestone: e.milestone,
      task: e.task ?? e.milestone,
      rowHeight: e.rowHeight,
      dayWidth: e.dayWidth,
      currentTimeScale: e.currentTimeScale,
      labelPosition: Y.value
    })), x = ce(() => {
      const N = e.scrollLeft || 0, se = e.containerWidth || 0;
      if (!se || se <= 0)
        return {
          showIcon: !0,
          showLabel: !0,
          isSticky: !1,
          stickyPosition: "none",
          iconLeft: "0px",
          isPushedOut: !1,
          clipPath: "none",
          isFullyVisible: !0
          // 无滚动信息时认为完全可见
        };
      const Z = (B.value ?? 0) + 12, C = N, H = N + se, M = 24, te = Z - M / 2, ie = Z + M / 2, we = e.milestoneId, ve = te >= C && ie <= H, le = e.otherMilestones || [];
      if (ie <= C + M / 2) {
        const _e = le.filter(
          (De) => De.id !== we && De.stickyPosition === "left" && De.isSticky
        );
        if (_e.length > 0) {
          const De = (B.value ?? 0) + 12;
          if (_e.some((nt) => nt.originalLeft > De))
            return {
              showIcon: !1,
              showLabel: !1,
              isSticky: !1,
              stickyPosition: "none",
              iconLeft: "0px",
              isPushedOut: !0,
              clipPath: "none",
              isFullyVisible: !1
            };
        }
        return {
          showIcon: !0,
          showLabel: !1,
          isSticky: !0,
          stickyPosition: "left",
          iconLeft: `${C - (B.value ?? 0) - M / 2}px`,
          isPushedOut: !1,
          clipPath: "polygon(50% 0%, 100% 0%, 100% 100%, 50% 100%)",
          // 只显示右半部分
          isFullyVisible: !1
        };
      }
      if (te >= H - M / 2) {
        const _e = le.filter(
          (De) => De.id !== we && De.stickyPosition === "right" && De.isSticky
        );
        if (_e.length > 0) {
          const De = (B.value ?? 0) + 12;
          if (_e.some((nt) => nt.originalLeft < De))
            return {
              showIcon: !1,
              showLabel: !1,
              isSticky: !1,
              stickyPosition: "none",
              iconLeft: "0px",
              isPushedOut: !0,
              clipPath: "none",
              isFullyVisible: !1
            };
        }
        return {
          showIcon: !0,
          showLabel: !1,
          isSticky: !0,
          stickyPosition: "right",
          iconLeft: `${H - (B.value ?? 0) - M / 2}px`,
          isPushedOut: !1,
          clipPath: "polygon(0% 0%, 50% 0%, 50% 100%, 0% 100%)",
          // 只显示左半部分
          isFullyVisible: !1
        };
      }
      return {
        showIcon: !0,
        showLabel: !0,
        isSticky: !1,
        stickyPosition: "none",
        iconLeft: "0px",
        isPushedOut: !1,
        clipPath: "none",
        isFullyVisible: ve
      };
    }), oe = (N) => {
      var H;
      if (!x.value.showIcon || x.value.isPushedOut) return;
      const se = N.currentTarget;
      let Z = (H = o.value) == null ? void 0 : H.getBoundingClientRect();
      if (!Z) {
        const te = (l.value ?? se).getBoundingClientRect(), ie = Math.min(24, te.width);
        Z = new DOMRect(
          te.left,
          te.top,
          ie,
          te.height
        );
      }
      let C;
      x.value.isSticky ? C = x.value.stickyPosition : C = Z.left + Z.width / 2 > window.innerWidth * 0.6 ? "right" : "left", r("milestone-tooltip-show", {
        milestone: e.milestone ?? {
          name: e.name ?? "",
          startDate: e.date,
          type: "milestone"
        },
        milestoneColor: G.value,
        targetRect: Z,
        stickyPosition: C
      });
    }, J = () => {
      r("milestone-tooltip-hide");
    };
    ga(() => {
      a.value = !1, s.value = null, document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", m);
    });
    const S = (N, se) => {
      const Z = new Date(
        N.getFullYear(),
        N.getMonth(),
        N.getDate()
      ), C = new Date(
        se.getFullYear(),
        se.getMonth(),
        se.getDate()
      ), H = Z.getTime() - C.getTime(), M = Math.floor(H / (1e3 * 60 * 60 * 24)), te = e.dayWidth / 24, ie = M * e.dayWidth, ve = N.getHours() * te, _e = N.getMinutes() / 60 * te;
      return ie + ve + _e;
    }, I = (N, se, Z) => {
      var H;
      let C = 0;
      for (const M of se)
        if (Z === Ue.DAY) {
          const te = "days" in M && M.days ? M.days : [];
          for (let ie = 0; ie < te.length; ie++) {
            const we = te[ie], ve = new Date(we.date);
            if (ve.getFullYear() === N.getFullYear() && ve.getMonth() === N.getMonth() && ve.getDate() === N.getDate())
              return C + ie * e.dayWidth + e.dayWidth / 2;
          }
          C += te.length * e.dayWidth;
        } else if (Z === Ue.QUARTER) {
          const te = "quarters" in M && M.quarters ? M.quarters : [];
          for (const ie of te) {
            const we = new Date(ie.startDate), ve = new Date(ie.endDate);
            if (N >= we && N <= ve) {
              const le = e.dayWidth * 90, _e = Math.round((ve.getTime() - we.getTime()) / (1e3 * 60 * 60 * 24)) + 1, De = le / _e, ze = Math.round(
                (N.getTime() - we.getTime()) / (1e3 * 60 * 60 * 24)
              );
              return C + ze * De + De / 2;
            }
            C += e.dayWidth * 90;
          }
        } else if (Z === Ue.YEAR) {
          const te = "halfYears" in M && M.halfYears ? M.halfYears : [];
          for (const ie of te) {
            const we = new Date(ie.startDate), ve = new Date(ie.endDate);
            if (N >= we && N <= ve) {
              const le = e.dayWidth * 182.5, _e = Math.round((ve.getTime() - we.getTime()) / (1e3 * 60 * 60 * 24)) + 1, De = le / _e, ze = Math.round(
                (N.getTime() - we.getTime()) / (1e3 * 60 * 60 * 24)
              );
              return C + ze * De + De / 2;
            }
            C += e.dayWidth * (365 / 2);
          }
        } else if (Z === Ue.WEEK) {
          const te = "weeks" in M && M.weeks ? M.weeks : [];
          for (const ie of te) {
            const we = new Date(ie.weekStart), ve = new Date(ie.weekEnd);
            if (N >= we && N <= ve) {
              const le = e.dayWidth * 7, _e = ie.subDays || [], De = le / 7;
              for (let Qe = 0; Qe < _e.length; Qe++) {
                const ne = _e[Qe], gt = new Date(ne.date);
                if (gt.getFullYear() === N.getFullYear() && gt.getMonth() === N.getMonth() && gt.getDate() === N.getDate())
                  return C + Qe * De + De / 2;
              }
              const ze = N.getDay(), nt = ze === 0 ? 6 : ze - 1;
              return C + nt * De + De / 2;
            }
            C += e.dayWidth * 7;
          }
        } else if (Z === Ue.MONTH) {
          if (!("startDate" in M) || !("endDate" in M))
            continue;
          const te = new Date(M.startDate), ie = new Date(M.endDate);
          if (N >= te && N <= ie) {
            const we = e.dayWidth * 30, ve = "monthData" in M && ((H = M.monthData) == null ? void 0 : H.dayCount) || 30, le = we / ve, _e = N.getDate();
            return C + (_e - 1) * le + le / 2;
          }
          C += e.dayWidth * 30;
        }
      return C;
    };
    return (N, se) => ($(), ee("div", {
      class: tr(["milestone", {
        dragging: a.value,
        "milestone-sticky": x.value.isSticky,
        "milestone-sticky-left": x.value.stickyPosition === "left",
        "milestone-sticky-right": x.value.stickyPosition === "right",
        "milestone-pushed-out": x.value.isPushedOut,
        dimmed: D.value,
        [`milestone-label-position-${Y.value}`]: !0
      }]),
      style: Mt(q.value),
      title: x.value.isSticky ? "" : e.name || "里程碑",
      onClick: dn(k, ["stop"]),
      onDblclick: dn(u, ["stop"]),
      onMousedown: dn(p, ["stop"]),
      onMouseenter: oe,
      onMouseleave: J
    }, [
      E.value && x.value.showIcon ? ($(), ee("div", {
        key: 0,
        ref_key: "customContentRef",
        ref: l,
        class: "milestone-custom-content-wrapper",
        style: Mt({
          position: x.value.isSticky ? "relative" : "static",
          left: x.value.isSticky ? x.value.iconLeft : "0px",
          width: x.value.isSticky ? "24px" : "auto",
          overflow: x.value.isSticky ? "hidden" : "visible",
          clipPath: x.value.clipPath,
          zIndex: x.value.isSticky ? "var(--gantt-z-milestone-sticky)" : "var(--gantt-z-milestone)"
        })
      }, [
        Nn(N.$slots, "custom-milestone-content", qs(So(Q.value)), void 0, !0)
      ], 4)) : ($(), ee(St, { key: 1 }, [
        x.value.showIcon ? ($(), ee("svg", {
          key: 0,
          ref_key: "iconRef",
          ref: o,
          width: 24,
          height: 24,
          viewBox: "0 0 24 24",
          style: Mt([{
            position: x.value.isSticky ? "relative" : "static",
            left: x.value.isSticky ? x.value.iconLeft : "0px",
            clipPath: x.value.clipPath,
            zIndex: x.value.isSticky ? "var(--gantt-z-milestone-sticky)" : "var(--gantt-z-milestone)"
          }, { cursor: "pointer" }])
        }, [
          F.value === "diamond" ? ($(), ee("g", kE, [
            _("rect", {
              x: "5",
              y: "5",
              width: "14",
              height: "14",
              rx: "3",
              ry: "3",
              fill: G.value,
              stroke: W.value,
              "stroke-width": "2"
            }, null, 8, TE)
          ])) : F.value === "rocket" ? ($(), ee("g", xE, [...se[0] || (se[0] = [
            _("foreignObject", {
              x: "0",
              y: "0",
              width: "24",
              height: "24"
            }, [
              _("div", { class: "rocket-emoji" }, "🚀")
            ], -1)
          ])])) : ($(), ee("g", DE, [
            _("rect", {
              x: "5",
              y: "5",
              width: "14",
              height: "14",
              rx: "3",
              ry: "3",
              fill: G.value,
              stroke: W.value,
              "stroke-width": "2"
            }, null, 8, EE)
          ]))
        ], 4)) : vt("", !0),
        e.name && x.value.showLabel ? ($(), ee("span", {
          key: 1,
          class: tr(["milestone-label", `milestone-label-${Y.value}`])
        }, Ee(e.name), 3)) : vt("", !0)
      ], 64))
    ], 46, CE));
  }
}), Mm = /* @__PURE__ */ Fn(SE, [["__scopeId", "data-v-26cd65f4"]]);
class h5 {
  constructor() {
    sn(this, "cachedCtx", null);
    sn(this, "cachedWidth", 0);
    sn(this, "cachedHeight", 0);
    sn(this, "isUniApp", !1);
    this.isUniApp = typeof window < "u" && !!window.uni;
  }
  /**
   * 检测是否在 uni-app 环境
   */
  get isUniAppEnvironment() {
    return this.isUniApp;
  }
  /**
   * 获取或初始化 Canvas 上下文
   * @param options 初始化配置
   * @returns Canvas 上下文,失败返回 null
   */
  getContext(t) {
    const { canvas: e, canvasId: r, width: a, height: A, contextOptions: i } = t;
    if (!this.cachedCtx || this.cachedWidth !== a || this.cachedHeight !== A) {
      let s = null;
      if (this.isUniApp && window.uni)
        s = window.uni.createCanvasContext(r);
      else {
        if (!e) return null;
        const o = window.devicePixelRatio || 1;
        if (s = e.getContext("2d", i || { alpha: !0 }), !s) return null;
        const l = a * o, u = A * o;
        e.width = l, e.height = u, s.scale(o, o);
      }
      if (!s) return null;
      this.cachedCtx = s, this.cachedWidth = a, this.cachedHeight = A;
    }
    return this.cachedCtx;
  }
  /**
   * 清空画布
   */
  clear(t, e) {
    this.cachedCtx && this.cachedCtx.clearRect(0, 0, t, e);
  }
  /**
   * 触发 uni-app 画布渲染(仅 uni-app 环境需要)
   */
  draw() {
    var t;
    this.isUniApp && ((t = this.cachedCtx) != null && t.draw) && this.cachedCtx.draw();
  }
  /**
   * 重置缓存(例如 Canvas 元素被销毁时)
   */
  reset() {
    this.cachedCtx = null, this.cachedWidth = 0, this.cachedHeight = 0;
  }
}
const FE = /* @__PURE__ */ hn({
  __name: "GanttLinks",
  props: {
    tasks: {},
    taskBarPositions: {},
    width: {},
    height: {},
    offsetLeft: { default: 0 },
    offsetTop: { default: 0 },
    highlightedTaskId: {},
    highlightedTaskIds: {},
    hoveredTaskId: {},
    verticalLines: { default: () => [] },
    showVerticalLines: { type: Boolean, default: !0 },
    showLinks: { type: Boolean, default: !0 },
    isScrolling: { type: Boolean, default: !1 },
    linkConfig: { default: void 0 }
  },
  setup(n, { expose: t }) {
    const e = n, r = Mr("gantt-theme", me("light")), a = me(null), A = new h5();
    let i = null, s = !1, o = !1;
    const l = ce(() => r.value === "dark"), u = () => {
      var J;
      const y = A.getContext({
        canvas: a.value,
        canvasId: "gantt-link-canvas",
        width: e.width,
        height: e.height,
        contextOptions: { alpha: !0 }
      });
      if (!y) {
        console.error("❌ Canvas context 获取失败,可能是尺寸超限");
        return;
      }
      const m = e.width, k = e.height;
      if (y.clearRect(0, 0, m, k), e.showVerticalLines && e.verticalLines && e.verticalLines.length > 0) {
        y.save();
        const S = l.value ? "#66b1ff" : "#409eff";
        y.strokeStyle = S, y.lineWidth = 1, y.setLineDash([4, 4]), y.beginPath();
        for (const I of e.verticalLines) {
          const N = I.left - e.offsetLeft;
          N >= 0 && N <= m && (y.moveTo(N, 0), y.lineTo(N, k));
        }
        y.stroke(), y.restore();
      }
      if (!e.showLinks) return;
      const D = /* @__PURE__ */ new Set();
      for (const S of e.tasks)
        D.add(S.id);
      const B = e.highlightedTaskId !== null, O = e.offsetLeft, q = e.offsetLeft + m, G = e.offsetTop, W = e.offsetTop + k, F = [], Y = [], T = [], E = [];
      for (const S of e.tasks) {
        if (!S.predecessor || !e.taskBarPositions[S.id]) continue;
        const I = $s(S.predecessor);
        for (const N of I) {
          const se = e.taskBarPositions[N], Z = e.taskBarPositions[S.id];
          if (!se || !Z || !D.has(N))
            continue;
          const C = e.highlightedTaskId === N, H = e.highlightedTaskId === S.id, M = e.highlightedTaskIds.has(N), te = e.highlightedTaskIds.has(S.id), ie = M && te, we = e.hoveredTaskId === N, ve = e.hoveredTaskId === S.id, le = we || ve, _e = C ? -8 : M ? -5 : 0, De = H ? -8 : te ? -5 : 0, ze = se.left + se.width, nt = se.top + se.height / 2 + _e, Qe = Z.left, ne = Z.top + Z.height / 2 + De, gt = Math.min(ze, Qe), je = Math.max(ze, Qe), ot = Math.min(nt, ne), Ie = Math.max(nt, ne);
          if (je < O || gt > q || Ie < G || ot > W)
            continue;
          const It = ze - e.offsetLeft, dt = nt - e.offsetTop, Dt = Qe - e.offsetLeft, Ct = ne - e.offsetTop, Ve = Dt - It, ht = Ct - dt, K = Math.sqrt(Ve * Ve + ht * ht), X = se.width, ke = se.height, Je = Math.abs(Ve) / (K + 1), pt = 20;
          let Xe = ke / 2 + pt;
          Je < 0.3 ? Xe = Math.max(ke / 2 + 25, 45) : Je < 0.6 ? Xe = ke / 2 + pt : Xe = X / 3 + 10;
          let Ye = 0;
          if (Math.abs(ht) > 0) {
            const Ar = ke / 2 + 12, Ge = Math.abs(ht) - ke, rt = Math.min(Ge * 0.5, 100);
            Ye = Math.max(Ar, rt);
          } else
            Ye = 0;
          const it = Je < 0.3 ? 0.4 : 0.8, qt = It + Xe, hr = dt + (ht > 0 ? Ye : -Ye) * it, Nt = Dt - Xe, xr = Ct - (ht > 0 ? Ye : -Ye) * it, Jt = Math.atan2(Ct - xr, Dt - Nt);
          let lr;
          if (((J = e.linkConfig) == null ? void 0 : J.type) === "orthogonal")
            if (Math.abs(ht) < 1)
              lr = [
                { x: It, y: dt },
                { x: Dt, y: Ct }
              ];
            else {
              const er = se.top + se.height, Ar = Z.top, Ge = Z.top + Z.height, rt = se.top;
              let yt;
              Ar >= er ? yt = er + (Ar - er) / 2 : rt >= Ge ? yt = Ge + (rt - Ge) / 2 : yt = (rt + Ar) / 2;
              const Ot = yt - e.offsetTop, vr = Math.abs(Ve), jt = Ve > 20 ? vr / 2 : 15, br = It + jt, on = Dt - jt;
              lr = [
                { x: It, y: dt },
                { x: br, y: dt },
                { x: br, y: Ot },
                { x: on, y: Ot },
                { x: on, y: Ct },
                { x: Dt, y: Ct }
              ];
            }
          const Fr = { x1: It, y1: dt, x2: Dt, y2: Ct, c1x: qt, c1y: hr, c2x: Nt, c2y: xr, arrowAngle: Jt, polyPoints: lr };
          ie ? F.push(Fr) : le ? Y.push(Fr) : B ? E.push(Fr) : T.push(Fr);
        }
      }
      const Q = { ...cp, ...e.linkConfig };
      Q.style === "dotted" ? y.setLineDash([6, 4]) : y.setLineDash([]);
      const x = (S, I) => {
        switch (Q.type) {
          case "straight":
            h(S, I);
            break;
          case "orthogonal":
            c(S, I);
            break;
          case "bezier":
          default:
            f(S, I);
            break;
        }
      }, oe = (S) => {
        if (Q.type === "straight")
          return Math.atan2(S.y2 - S.y1, S.x2 - S.x1);
        if (Q.type === "orthogonal") {
          const I = S.polyPoints;
          if (I && I.length >= 2) {
            const N = I[I.length - 1], se = I[I.length - 2];
            return Math.atan2(N.y - se.y, N.x - se.x);
          }
          return 0;
        }
        return S.arrowAngle;
      };
      if (F.length > 0) {
        y.strokeStyle = Q.highlightColor, y.fillStyle = Q.highlightColor, y.lineWidth = Q.highlightWidth, y.globalAlpha = 1, y.beginPath();
        for (const S of F)
          x(y, S);
        y.stroke();
        for (const S of F)
          p(y, S.x2, S.y2, oe(S));
      }
      if (Y.length > 0) {
        y.strokeStyle = Q.hoverColor, y.fillStyle = Q.hoverColor, y.lineWidth = 3, y.globalAlpha = 1, y.beginPath();
        for (const S of Y)
          x(y, S);
        y.stroke();
        for (const S of Y)
          p(y, S.x2, S.y2, oe(S));
      }
      if (T.length > 0) {
        y.strokeStyle = Q.color, y.fillStyle = Q.color, y.lineWidth = Q.width, y.globalAlpha = 1, y.beginPath();
        for (const S of T)
          x(y, S);
        y.stroke();
        for (const S of T)
          p(y, S.x2, S.y2, oe(S));
      }
      if (E.length > 0) {
        y.strokeStyle = Q.color, y.fillStyle = Q.color, y.lineWidth = Q.width, y.globalAlpha = 0.2, y.beginPath();
        for (const S of E)
          x(y, S);
        y.stroke();
        for (const S of E)
          p(y, S.x2, S.y2, oe(S));
        y.globalAlpha = 1;
      }
      A.draw();
    }, f = (y, m) => {
      y.moveTo(m.x1, m.y1), y.bezierCurveTo(m.c1x, m.c1y, m.c2x, m.c2y, m.x2, m.y2);
    }, h = (y, m) => {
      y.moveTo(m.x1, m.y1), y.lineTo(m.x2, m.y2);
    }, c = (y, m) => {
      const k = m.polyPoints;
      if (!k || k.length < 2) {
        y.moveTo(m.x1, m.y1), y.lineTo(m.x2, m.y2);
        return;
      }
      y.moveTo(k[0].x, k[0].y);
      for (let D = 1; D < k.length; D++)
        y.lineTo(k[D].x, k[D].y);
    }, p = (y, m, k, D) => {
      y.beginPath(), y.moveTo(m, k), y.lineTo(
        m - 8 * Math.cos(D) - 4 * Math.sin(D),
        k - 8 * Math.sin(D) + 4 * Math.cos(D)
      ), y.lineTo(
        m - 8 * Math.cos(D) + 4 * Math.sin(D),
        k - 8 * Math.sin(D) - 4 * Math.cos(D)
      ), y.closePath(), y.fill();
    }, w = () => {
      if (e.isScrolling) {
        o = !0;
        return;
      }
      s || (s = !0, i !== null && cancelAnimationFrame(i), i = requestAnimationFrame(() => {
        s = !1, i = null, u();
      }));
    };
    return Gt(
      () => e.isScrolling,
      (y) => {
        !y && o && (o = !1, w());
      }
    ), Gt(
      [
        () => e.taskBarPositions,
        () => e.tasks,
        () => e.highlightedTaskId,
        () => e.highlightedTaskIds,
        () => e.hoveredTaskId,
        () => e.width,
        () => e.height,
        () => e.verticalLines,
        () => e.showVerticalLines,
        () => e.showLinks,
        () => e.offsetLeft,
        // 监听虚拟渲染的偏移量变化
        () => e.offsetTop,
        r,
        // 监听inject的主题变化(computed会自动响应)
        () => e.linkConfig
        // R1: 监听连线样式配置变化
      ],
      () => {
        w();
      },
      { deep: !1 }
    ), sA(() => {
      An(() => {
        u();
      });
    }), ga(() => {
      i !== null && (cancelAnimationFrame(i), i = null);
    }), t({
      redraw: u
    }), (y, m) => ($(), ee("canvas", {
      ref_key: "canvasRef",
      ref: a,
      "canvas-id": "gantt-link-canvas",
      class: "gantt-links-canvas",
      type: "2d",
      hidpi: !0,
      style: Mt({
        position: "absolute",
        left: `${n.offsetLeft}px`,
        top: `${n.offsetTop}px`,
        width: `${n.width}px`,
        height: `${n.height}px`,
        zIndex: n.highlightedTaskId !== null ? "var(--gantt-z-canvas-hl) !important" : "var(--gantt-z-canvas) !important",
        pointerEvents: "none"
      })
    }, null, 4));
  }
}), UE = /* @__PURE__ */ Fn(FE, [["__scopeId", "data-v-09063495"]]), LE = /* @__PURE__ */ hn({
  __name: "LinkDragGuide",
  props: {
    active: { type: Boolean },
    width: {},
    height: {},
    offsetLeft: { default: 0 },
    offsetTop: { default: 0 }
  },
  setup(n, { expose: t }) {
    const e = n, r = me(null), a = new h5(), A = () => a.getContext({
      canvas: r.value,
      canvasId: "link-drag-guide-canvas",
      width: e.width,
      height: e.height,
      contextOptions: { alpha: !0, willReadFrequently: !1 }
    }), i = (o, l, u, f, h = !0, c = "") => {
      const p = A();
      if (!p) {
        console.error("[LinkDragGuide] initCanvas returned null");
        return;
      }
      const w = e.width, y = e.height;
      p.clearRect(0, 0, w, y);
      const m = o - e.offsetLeft, k = l - e.offsetTop, D = u - e.offsetLeft, B = f - e.offsetTop, O = 100;
      if (!((m >= -O || D >= -O) && (m <= w + O || D <= w + O) && (k >= -O || B >= -O) && (k <= y + O || B <= y + O))) return;
      p.save();
      const G = h ? "#67c23a" : "#f56c6c";
      p.strokeStyle = G, p.lineWidth = 3, p.globalAlpha = 0.8, p.beginPath(), p.moveTo(m, k), p.lineTo(D, B), p.stroke();
      const W = Math.atan2(B - k, D - m), F = 8, Y = 4;
      if (p.fillStyle = G, p.globalAlpha = 1, p.beginPath(), p.moveTo(D, B), p.lineTo(
        D - F * Math.cos(W) - Y * Math.sin(W),
        B - F * Math.sin(W) + Y * Math.cos(W)
      ), p.lineTo(
        D - F * Math.cos(W) + Y * Math.sin(W),
        B - F * Math.sin(W) - Y * Math.cos(W)
      ), p.closePath(), p.fill(), !h && c) {
        const T = (m + D) / 2, E = (k + B) / 2 - 10;
        p.font = "12px Arial, sans-serif";
        const x = p.measureText(c).width, oe = 8;
        p.fillStyle = "rgba(0, 0, 0, 0.75)", p.fillRect(T - x / 2 - oe, E - 12, x + oe * 2, 24), p.fillStyle = "#ffffff", p.textAlign = "center", p.textBaseline = "middle", p.fillText(c, T, E);
      }
      p.restore(), a.draw();
    }, s = () => {
      a.clear(e.width, e.height);
    };
    return Gt(
      [() => e.width, () => e.height],
      () => {
        a.reset();
      }
    ), Gt(
      () => e.active,
      (o) => {
        o || a.reset();
      }
    ), ga(() => {
      a.reset();
    }), t({
      draw: i,
      clear: s
    }), (o, l) => n.active ? ($(), ee("canvas", {
      key: 0,
      ref_key: "canvasRef",
      ref: r,
      "canvas-id": "link-drag-guide-canvas",
      class: "link-drag-guide-canvas",
      type: "2d",
      hidpi: !0,
      style: Mt({
        position: "absolute",
        left: `${n.offsetLeft}px`,
        top: `${n.offsetTop}px`,
        width: `${n.width}px`,
        height: `${n.height}px`,
        zIndex: 1002,
        pointerEvents: "none"
      })
    }, null, 4)) : vt("", !0);
  }
}), IE = /* @__PURE__ */ Fn(LE, [["__scopeId", "data-v-ad99e089"]]), QE = ["width", "height"], ME = /* @__PURE__ */ hn({
  __name: "GanttConflicts",
  props: {
    tasks: {},
    resourceId: {},
    dayWidth: {},
    startDate: {},
    height: {},
    width: {},
    topOffset: {},
    barTopPad: {},
    timelineData: {},
    currentTimeScale: {},
    taskRowMap: {},
    rowHeights: {},
    scrollLeft: {},
    containerWidth: {},
    renderLimit: {}
  },
  setup(n) {
    const t = n, e = Mr("isDraggingTaskBar", me(!1)), r = Mr("isSplitBarDragging", me(!1)), a = Mr("isDraggingTimeline", me(!1)), A = Mr("lastChangedTaskId", me(null));
    let i = null;
    function s() {
      i !== null && (typeof cancelIdleCallback < "u" ? cancelIdleCallback(i) : cancelAnimationFrame(i), i = null);
    }
    function o(S, I = 500) {
      s(), typeof requestIdleCallback < "u" ? i = requestIdleCallback(
        () => {
          i = null, S();
        },
        { timeout: I }
      ) : i = requestAnimationFrame(() => {
        i = null, S();
      });
    }
    const l = me(null), u = ce(() => t.containerWidth || 1920), f = ce(() => t.height), h = me([]), c = me(!1), p = /* @__PURE__ */ new Map(), w = me([]), y = me({
      light: null,
      medium: null,
      severe: null
    }), m = ce(() => ({
      position: "absolute",
      top: `${t.topOffset || 0}px`,
      left: `${t.scrollLeft || 0}px`,
      // 平移到滚动位置
      pointerEvents: "none",
      // 始终穿透,让TaskBar可以响应鼠标事件
      transition: "opacity 0.2s",
      zIndex: "var(--gantt-z-conflict)",
      // v1.9.2 高于TaskBar的 --gantt-z-bar-bubble(18),确保冲突层在最上层
      backgroundColor: "transparent"
      // 确保Canvas背景透明
    }));
    Gt(
      () => t.tasks,
      () => {
        e.value ? c.value = !0 : o(() => {
          A.value !== null ? (D(A.value), A.value = null) : (y.value = { light: null, medium: null, severe: null }, p.clear(), B());
        });
      },
      { deep: !0 }
    ), Gt(
      () => t.renderLimit,
      () => {
        o(B);
      }
    ), Gt(e, (S) => {
      !S && c.value && o(() => {
        A.value !== null ? (D(A.value), A.value = null) : (y.value = { light: null, medium: null, severe: null }, p.clear(), B()), c.value = !1;
      });
    }), Gt(r, (S) => {
      !S && c.value && o(() => {
        y.value = { light: null, medium: null, severe: null }, p.clear(), B(), c.value = !1;
      });
    }), Gt(a, (S) => {
      S ? (s(), E()) : o(B);
    }), Gt([u, f], () => {
      if (r.value) {
        c.value = !0;
        return;
      }
      o(() => {
        p.clear(), B();
      });
    }), Gt(
      [() => t.timelineData, () => t.currentTimeScale],
      () => {
        p.clear(), y.value = { light: null, medium: null, severe: null }, o(B);
      },
      { deep: !0 }
    );
    let k = null;
    Gt(
      () => t.scrollLeft,
      () => {
        k && clearTimeout(k), E(), k = setTimeout(() => {
          B(), k = null;
        }, 50);
      }
    );
    function D(S) {
      const I = t.tasks.find((M) => M.id === S);
      if (!I) {
        B();
        return;
      }
      const N = t.tasks.filter((M) => {
        const te = M.startDate ? new Date(M.startDate) : null;
        if (!te) return !1;
        const ie = M.endDate ? new Date(M.endDate) : null;
        if (!ie) return !1;
        const we = I.startDate ? new Date(I.startDate) : null;
        if (!we) return !1;
        const ve = I.endDate ? new Date(I.endDate) : null;
        return ve ? !(ie < we || te > ve) : !1;
      }), se = Ku(N, t.resourceId, t.currentTimeScale), Z = new Set(N.map((M) => M.id)), H = [
        ...w.value.filter((M) => !M.tasks.some((te) => Z.has(Number(te.id)))).map((M) => ({
          startDate: M.startDate,
          endDate: M.endDate,
          tasks: M.tasks,
          totalPercent: M.totalPercent,
          level: M.level
        })),
        ...se
      ];
      h.value = H.map((M) => {
        const te = `${M.startDate.getTime()}-${M.endDate.getTime()}`;
        let ie, we;
        if (p.has(te)) {
          const je = p.get(te);
          ie = je.left, we = je.width;
        } else {
          const je = O(M.startDate, M.endDate);
          ie = je.left, we = je.width, p.set(te, { left: ie, width: we });
        }
        const ve = t.scrollLeft || 0, le = t.containerWidth || 1920, _e = ie - ve, De = _e + we;
        if (De <= 0 || _e >= le)
          return null;
        const ze = Math.max(0, _e), Qe = Math.min(le, De) - ze;
        let ne = 0, gt = t.height;
        if (t.taskRowMap && t.rowHeights && M.tasks.length > 0) {
          const je = [];
          for (const ot of M.tasks) {
            const Ie = t.taskRowMap.get(ot.id);
            Ie !== void 0 && je.push(Ie);
          }
          if (je.length > 0) {
            const ot = Math.min(...je), Ie = Math.max(...je), It = t.barTopPad || 0, dt = It + 5.5, Dt = It + 0.5, Ct = (t.rowHeights[0] || 51) - It - 10;
            let Ve = 0;
            for (let ke = 0; ke < ot; ke++) Ve += t.rowHeights[ke] || 51;
            const ht = Ve + (ot === 0 ? dt : Dt);
            let K = 0;
            for (let ke = 0; ke < Ie; ke++) K += t.rowHeights[ke] || 51;
            const X = K + (Ie === 0 ? dt : Dt) + Ct;
            ne = ht - dt, gt = X - ht;
          }
        }
        return {
          ...M,
          left: ze,
          width: Qe,
          top: ne,
          height: gt
        };
      }).filter((M) => M !== null), W();
    }
    function B() {
      const S = t.renderLimit !== void 0 && t.renderLimit > 0 ? t.tasks.slice(0, t.renderLimit) : t.tasks, I = Ku(S, t.resourceId, t.currentTimeScale);
      h.value = I.map((N) => {
        const se = `${N.startDate.getTime()}-${N.endDate.getTime()}`;
        let Z, C;
        if (p.has(se)) {
          const ze = p.get(se);
          Z = ze.left, C = ze.width;
        } else {
          const ze = O(N.startDate, N.endDate);
          Z = ze.left, C = ze.width, p.set(se, { left: Z, width: C });
        }
        const H = t.scrollLeft || 0, M = t.containerWidth || 1920, te = Z - H, ie = te + C;
        if (ie <= 0 || te >= M)
          return null;
        const we = Math.max(0, te), le = Math.min(M, ie) - we;
        let _e = 0, De = t.height;
        if (t.taskRowMap && t.rowHeights && N.tasks.length > 0) {
          const ze = [];
          for (const nt of N.tasks) {
            const Qe = t.taskRowMap.get(nt.id);
            Qe !== void 0 && ze.push(Qe);
          }
          if (ze.length > 0) {
            const nt = Math.min(...ze), Qe = Math.max(...ze), ne = t.barTopPad || 0, gt = ne + 5.5, je = ne + 0.5, ot = (t.rowHeights[0] || 51) - ne - 10;
            let Ie = 0;
            for (let Ct = 0; Ct < nt; Ct++) Ie += t.rowHeights[Ct] || 51;
            const It = Ie + (nt === 0 ? gt : je);
            let dt = 0;
            for (let Ct = 0; Ct < Qe; Ct++) dt += t.rowHeights[Ct] || 51;
            const Dt = dt + (Qe === 0 ? gt : je) + ot;
            _e = It - gt, De = Dt - It;
          }
        }
        return {
          ...N,
          left: we,
          width: le,
          top: _e,
          height: De
        };
      }).filter((N) => N !== null), !y.value.light && !y.value.medium && !y.value.severe ? T() : W();
    }
    function O(S, I) {
      let N = 0, se = 0;
      if (t.currentTimeScale === Ue.HOUR) {
        const H = new Date(t.startDate);
        H.setHours(0, 0, 0, 0);
        const M = Math.floor(
          (S.getTime() - H.getTime()) / (1e3 * 60)
        ), te = Math.floor(
          (I.getTime() - H.getTime()) / (1e3 * 60)
        ), ie = bs.hour.cellWidth / 60;
        return N = Math.max(0, M * ie), se = Math.max(4, (te - M) * ie), { left: N, width: se };
      }
      const Z = new Date(S.getFullYear(), S.getMonth(), S.getDate()), C = new Date(I.getFullYear(), I.getMonth(), I.getDate());
      if (t.timelineData && t.currentTimeScale && (t.currentTimeScale === Ue.WEEK || t.currentTimeScale === Ue.MONTH || t.currentTimeScale === Ue.QUARTER || t.currentTimeScale === Ue.YEAR)) {
        const H = G(
          Z,
          t.timelineData,
          t.currentTimeScale
        ), M = new Date(C);
        M.setDate(M.getDate() + 1);
        let te = G(
          M,
          t.timelineData,
          t.currentTimeScale
        );
        te === H && (te = G(C, t.timelineData, t.currentTimeScale) + t.dayWidth), N = H, se = Math.max(te - H, 4);
      } else if (t.timelineData && t.currentTimeScale === Ue.DAY) {
        const H = G(
          Z,
          t.timelineData,
          t.currentTimeScale
        ), M = new Date(C);
        M.setDate(M.getDate() + 1);
        let te = G(
          M,
          t.timelineData,
          t.currentTimeScale
        );
        te === H && (te = G(C, t.timelineData, t.currentTimeScale) + t.dayWidth), N = H, se = Math.max(te - H, 4);
      } else {
        const H = Math.floor(
          (Z.getTime() - t.startDate.getTime()) / 864e5
        ), M = C.getTime() - Z.getTime(), te = Math.round(M / (1e3 * 60 * 60 * 24)), ie = te === 0 ? 1 : te + 1;
        N = H * t.dayWidth, se = ie * t.dayWidth;
      }
      return { left: Math.max(0, N), width: Math.max(4, se) };
    }
    function q(S) {
      if (typeof S == "string") {
        if (/^\d{4}-\d{2}-\d{2}$/.test(S)) {
          const [N, se, Z] = S.split("-").map(Number);
          return new Date(N, se - 1, Z);
        }
        if (/^\d{4}-\d{2}-\d{2}T/.test(S)) {
          const N = new Date(S);
          return new Date(N.getFullYear(), N.getMonth(), N.getDate());
        }
      }
      if (S instanceof Date)
        return new Date(S.getFullYear(), S.getMonth(), S.getDate());
      const I = new Date(S);
      return new Date(I.getFullYear(), I.getMonth(), I.getDate());
    }
    function G(S, I, N) {
      var Z;
      let se = 0;
      for (const C of I)
        if (N === Ue.DAY) {
          const H = C.days || [];
          for (let M = 0; M < H.length; M++) {
            const te = H[M], ie = q(te.date);
            if (ie.getFullYear() === S.getFullYear() && ie.getMonth() === S.getMonth() && ie.getDate() === S.getDate())
              return se + M * t.dayWidth;
          }
          se += H.length * t.dayWidth;
        } else if (N === Ue.QUARTER) {
          const H = C.quarters || [];
          for (const M of H) {
            const te = q(M.startDate), ie = q(M.endDate);
            if (S >= te && S <= ie) {
              const we = t.dayWidth * 90, ve = Math.ceil(
                (ie.getTime() - te.getTime()) / (1e3 * 60 * 60 * 24)
              ), le = we / ve, _e = Math.ceil(
                (S.getTime() - te.getTime()) / (1e3 * 60 * 60 * 24)
              );
              return se + _e * le;
            }
            se += t.dayWidth * 90;
          }
        } else if (N === Ue.WEEK) {
          const H = C.weeks || [];
          for (const M of H) {
            const te = q(M.weekStart), ie = q(M.weekEnd);
            if (S >= te && S <= ie) {
              const we = t.dayWidth * 7, ve = Math.ceil((ie.getTime() - te.getTime()) / (1e3 * 60 * 60 * 24)) + 1, le = we / ve, _e = Math.ceil(
                (S.getTime() - te.getTime()) / (1e3 * 60 * 60 * 24)
              );
              return se + _e * le;
            }
            se += t.dayWidth * 7;
          }
        } else if (N === Ue.MONTH) {
          const H = new Date(C.year, C.month - 1, 1), M = new Date(C.year, C.month, 0);
          if (S >= H && S <= M) {
            const te = t.dayWidth * 30, ie = ((Z = C.monthData) == null ? void 0 : Z.dayCount) || 30, we = te / ie, ve = S.getDate();
            return se + (ve - 1) * we;
          }
          se += t.dayWidth * 30;
        } else if (N === Ue.YEAR) {
          const H = C.halfYears || [];
          for (const M of H) {
            const te = q(M.startDate), ie = q(M.endDate);
            if (S >= te && S <= ie) {
              const we = t.dayWidth * 182.5, ve = Math.ceil((ie.getTime() - te.getTime()) / (1e3 * 60 * 60 * 24)) + 1, le = we / ve, _e = Math.ceil(
                (S.getTime() - te.getTime()) / (1e3 * 60 * 60 * 24)
              );
              return se + _e * le;
            }
            se += t.dayWidth * (365 / 2);
          }
        }
      return se;
    }
    function W() {
      const S = l.value;
      if (!S) return;
      const I = S.getContext("2d");
      if (!I) return;
      const { added: N, removed: se, changed: Z } = F(
        w.value,
        h.value
      ), C = h.value.length, H = N.length + se.length + Z.length;
      if (C === 0 || H > C * 0.5) {
        T(), w.value = [...h.value];
        return;
      }
      for (const M of se)
        M.left !== void 0 && M.width !== void 0 && I.clearRect(M.left - 2, 0, M.width + 4, S.height);
      for (const M of N)
        Y(I, M);
      for (const M of Z)
        M.left !== void 0 && M.width !== void 0 && (I.clearRect(M.left - 2, 0, M.width + 4, S.height), Y(I, M));
      w.value = [...h.value];
    }
    function F(S, I) {
      const N = [], se = [], Z = [], C = new Map(
        S.map((M) => [`${M.startDate.getTime()}-${M.endDate.getTime()}`, M])
      ), H = new Map(
        I.map((M) => [`${M.startDate.getTime()}-${M.endDate.getTime()}`, M])
      );
      for (const [M, te] of H) {
        const ie = C.get(M);
        ie ? (ie.totalPercent !== te.totalPercent || ie.level !== te.level || ie.tasks.length !== te.tasks.length) && Z.push(te) : N.push(te);
      }
      for (const [M, te] of C)
        H.has(M) || se.push(te);
      return { added: N, removed: se, changed: Z };
    }
    function Y(S, I) {
      if (I.left === void 0 || I.width === void 0 || I.width <= 0)
        return;
      const N = l.value;
      !N || I.left + I.width < 0 || I.left > N.width || (Q(S, I), oe(S, I), J(S, I));
    }
    function T() {
      const S = l.value;
      if (!S)
        return;
      const I = S.getContext("2d");
      if (I) {
        I.clearRect(0, 0, S.width, S.height);
        for (const N of h.value)
          Y(I, N);
        w.value = [...h.value];
      }
    }
    function E() {
      const S = l.value;
      if (!S)
        return;
      const I = S.getContext("2d");
      I && (I.clearRect(0, 0, S.width, S.height), w.value = []);
    }
    function Q(S, I) {
      const { left: N = 0, width: se = 0, top: Z = 0, height: C = t.height } = I;
      let H, M;
      switch (I.level) {
        case "light":
          H = "rgba(255,220,0,", M = 0.12;
          break;
        case "medium":
          H = "rgba(255,165,0,", M = 0.15;
          break;
        case "severe":
          H = "rgba(255,69,0,", M = 0.18;
          break;
      }
      S.save(), S.fillStyle = x(S, I.level) || `${H}${M})`, S.fillRect(N, Z, se, C), S.restore();
    }
    function x(S, I) {
      if (y.value[I])
        return y.value[I];
      const N = document.createElement("canvas");
      N.width = 10, N.height = 10;
      const se = N.getContext("2d");
      if (!se) return null;
      let Z;
      switch (I) {
        case "light":
          Z = "rgba(255,220,0,0.25)";
          break;
        case "medium":
          Z = "rgba(255,165,0,0.3)";
          break;
        case "severe":
          Z = "rgba(255,69,0,0.35)";
          break;
      }
      se.strokeStyle = Z, se.lineWidth = 1, se.beginPath(), se.moveTo(0, 10), se.lineTo(10, 0), se.stroke();
      const C = S.createPattern(N, "repeat");
      return y.value[I] = C, C;
    }
    function oe(S, I) {
      const { left: N = 0, width: se = 0, top: Z = 0, height: C = t.height } = I;
      S.save(), S.strokeStyle = "#f56c6c", S.lineWidth = 2, S.beginPath(), S.moveTo(N, Z), S.lineTo(N, Z + C), S.stroke(), S.beginPath(), S.moveTo(N + se, Z), S.lineTo(N + se, Z + C), S.stroke(), S.restore();
    }
    function J(S, I) {
      const { left: N = 0, top: se = 0 } = I, Z = 16, C = 4, H = N + C, M = se + C;
      S.save(), S.fillStyle = "#faad14", S.beginPath(), S.moveTo(H + Z / 2, M), S.lineTo(H, M + Z), S.lineTo(H + Z, M + Z), S.closePath(), S.fill(), S.fillStyle = "#fff", S.font = "bold 12px Arial", S.textAlign = "center", S.textBaseline = "middle", S.fillText("!", H + Z / 2, M + Z * 0.6), S.restore();
    }
    return sA(() => {
      o(B);
    }), ga(() => {
      k && clearTimeout(k), s(), p.clear(), y.value = {
        light: null,
        medium: null,
        severe: null
      };
    }), (S, I) => ($(), ee("canvas", {
      ref_key: "canvasRef",
      ref: l,
      class: "gantt-conflicts-canvas",
      width: u.value,
      height: f.value,
      style: Mt(m.value)
    }, null, 12, QE));
  }
}), _E = /* @__PURE__ */ Fn(ME, [["__scopeId", "data-v-d4cd159d"]]);
performance.now();
class RE {
  constructor() {
    sn(this, "marks", /* @__PURE__ */ new Map());
    sn(this, "measures", []);
  }
  /**
   * 开始计时
   */
  start(t) {
    this.marks.set(t, performance.now());
  }
  /**
   * 结束计时并记录
   */
  end(t) {
    const e = this.marks.get(t);
    if (!e)
      return 0;
    const r = performance.now() - e;
    return this.measures.push({
      name: t,
      duration: r,
      timestamp: Date.now()
    }), this.marks.delete(t), r;
  }
  /**
   * 记录中间点
   */
  checkpoint(t) {
    this.marks.get(t);
  }
  /**
   * 获取最近的性能记录
   */
  getRecentMeasures(t = 10) {
    return this.measures.slice(-t).map((e) => ({ name: e.name, duration: e.duration }));
  }
  /**
   * 清空所有记录
   */
  clear() {
    this.marks.clear(), this.measures = [];
  }
  /**
   * 生成性能报告
   */
  report() {
    console.group("📊 Performance Report");
    const t = /* @__PURE__ */ new Map();
    this.measures.forEach((r) => {
      t.has(r.name) || t.set(r.name, { count: 0, total: 0, avg: 0, max: 0 });
      const a = t.get(r.name);
      a.count++, a.total += r.duration, a.max = Math.max(a.max, r.duration);
    }), t.forEach((r) => {
      r.avg = r.total / r.count;
    });
    const e = Array.from(t.entries()).sort((r, a) => a[1].avg - r[1].avg);
    console.table(
      e.map(([r, a]) => ({
        Name: r,
        Count: a.count,
        "Avg (ms)": a.avg.toFixed(2),
        "Max (ms)": a.max.toFixed(2),
        "Total (ms)": a.total.toFixed(2)
      }))
    ), console.groupEnd();
  }
}
const Ql = new RE();
typeof window < "u" && (window.perfMonitor2 = Ql);
class NE {
  constructor() {
    // 位置缓存表:key格式为 "scale-year-month-day"
    sn(this, "cache", /* @__PURE__ */ new Map());
    // timelineData的哈希值,用于判断是否需要重建缓存
    sn(this, "timelineDataHash", "");
  }
  /**
   * 构建缓存key
   */
  getCacheKey(t, e) {
    const r = t.getFullYear(), a = t.getMonth(), A = t.getDate();
    return `${e}-${r}-${a}-${A}`;
  }
  /**
   * 计算timelineData的hash值
   * 包含时间刻度、日期范围、数据长度以及当前视图的cellWidth,
   * 确保修改 SCALE_CONFIGS 后(例如热更新)能正确重建缓存。
   */
  computeHash(t, e, r) {
    var l;
    if (t.length === 0) return "";
    const a = t[0], A = t[t.length - 1];
    let i, s;
    if ("date" in a)
      i = a.date;
    else if ("startDate" in a)
      i = a.startDate;
    else
      return "";
    if ("date" in A)
      s = A.date;
    else if ("endDate" in A)
      s = A.endDate;
    else
      return "";
    const o = (r == null ? void 0 : r[e]) ?? ((l = bs[e]) == null ? void 0 : l.cellWidth) ?? 0;
    return `${e}-${i.getTime()}-${s.getTime()}-${t.length}-cw${o}`;
  }
  /**
   * 预计算所有日期的位置映射表
   * 在Timeline层调用,所有TaskBar共享缓存
   *
   * @param timelineData 时间轴数据数组
   * @param timeScale 当前时间刻度
   * @param cellWidths 各刻度实际 cellWidth(effectiveScaleConfigs),覆盖内置默认值
   */
  buildCache(t, e, r) {
    var s;
    const a = this.computeHash(t, e, r);
    if (a === this.timelineDataHash && this.cache.size > 0)
      return;
    this.cache.clear(), this.timelineDataHash = a;
    const A = (o) => {
      var l;
      return (r == null ? void 0 : r[o]) ?? ((l = bs[o]) == null ? void 0 : l.cellWidth) ?? 60;
    };
    let i = 0;
    for (const o of t)
      if (e === Ue.HOUR) {
        const l = o.hours || [], u = A("hour");
        for (let f = 0; f < l.length; f++) {
          const h = l[f], c = h.date ? new Date(h.date) : /* @__PURE__ */ new Date(), p = this.getCacheKey(c, e), w = i + f * u;
          this.cache.set(p, w);
        }
        i += l.length * u;
      } else if (e === Ue.DAY) {
        const l = o.days || [], u = A("day");
        for (let f = 0; f < l.length; f++) {
          const h = l[f], c = new Date(h.date), p = this.getCacheKey(c, e), w = i + f * u;
          this.cache.set(p, w);
        }
        i += l.length * u;
      } else if (e === Ue.WEEK) {
        const l = o.weeks || [], u = A("week"), f = u / 7;
        for (const h of l) {
          const c = h.subDays || [];
          for (let p = 0; p < c.length; p++) {
            const w = c[p], y = new Date(w.date), m = this.getCacheKey(y, e), k = i + p * f;
            this.cache.set(m, k);
          }
          i += u;
        }
      } else if (e === Ue.MONTH) {
        const l = new Date(o.startDate), u = new Date(o.endDate), f = ((s = o.monthData) == null ? void 0 : s.dayCount) || 30, h = A("month"), c = h / f;
        for (let p = 1; p <= f; p++) {
          const w = new Date(l.getFullYear(), l.getMonth(), p);
          if (w <= u) {
            const y = this.getCacheKey(w, e), m = i + (p - 1) * c;
            this.cache.set(y, m);
          }
        }
        i += h;
      } else if (e === Ue.QUARTER) {
        const l = o.quarters || [], u = A("quarter");
        for (const f of l) {
          const h = new Date(f.startDate), c = new Date(f.endDate), p = Math.round((c.getTime() - h.getTime()) / (1e3 * 60 * 60 * 24)) + 1, w = u / p;
          for (let y = 0; y < p; y++) {
            const m = new Date(h);
            if (m.setDate(h.getDate() + y), m <= c) {
              const k = this.getCacheKey(m, e), D = i + y * w;
              this.cache.set(k, D);
            }
          }
          i += u;
        }
      } else if (e === Ue.YEAR) {
        const l = o.halfYears || [], u = A("year");
        for (const f of l) {
          const h = new Date(f.startDate), c = new Date(f.endDate), p = u, w = Math.round((c.getTime() - h.getTime()) / (1e3 * 60 * 60 * 24)) + 1, y = p / w;
          for (let m = 0; m < w; m++) {
            const k = new Date(h);
            if (k.setDate(h.getDate() + m), k <= c) {
              const D = this.getCacheKey(k, e), B = i + m * y;
              this.cache.set(D, B);
            }
          }
          i += u;
        }
      }
  }
  /**
   * O(1)查找日期对应的位置
   *
   * @param date 目标日期
   * @param timeScale 当前时间刻度
   * @returns 位置(px),如果未找到返回null
   */
  getPosition(t, e) {
    const r = this.getCacheKey(t, e), a = this.cache.get(r);
    return a === void 0 ? null : a;
  }
  /**
   * 清空缓存
   */
  clear() {
    this.cache.clear(), this.timelineDataHash = "";
  }
  /**
   * 获取缓存统计信息
   */
  getStats() {
    return {
      size: this.cache.size,
      hash: this.timelineDataHash
    };
  }
}
const Ff = new NE();
function HE(n) {
  const t = new Date(Date.UTC(n.getFullYear(), n.getMonth(), n.getDate())), e = t.getUTCDay() || 7;
  t.setUTCDate(t.getUTCDate() + 4 - e);
  const r = new Date(Date.UTC(t.getUTCFullYear(), 0, 1));
  return Math.ceil(((t.getTime() - r.getTime()) / 864e5 + 1) / 7);
}
function dp(n, t) {
  if (n.includes("|")) {
    const f = n.split("|");
    return t.getMonth() < 6 ? f[0] : f[1] ?? f[0];
  }
  const e = t.getFullYear().toString(), r = String(t.getMonth() + 1).padStart(2, "0"), a = String(t.getMonth() + 1), A = String(t.getDate()).padStart(2, "0"), i = String(t.getDate()), s = String(t.getHours()).padStart(2, "0"), o = String(t.getMinutes()).padStart(2, "0"), l = String(Math.ceil((t.getMonth() + 1) / 3)), u = HE(t).toString();
  return n.replace("yyyy", e).replace("MM", r).replace("dd", A).replace("HH", s).replace("mm", o).replace("M", a).replace("d", i).replace("Q", l).replace("W", u);
}
const OE = 2;
function PE(n) {
  return n / 1440;
}
function Sc(n) {
  if (!n) return null;
  if (n instanceof Date) return n;
  if (typeof n == "string") {
    if (/^\d{4}-\d{2}-\d{2}$/.test(n)) {
      const [e, r, a] = n.split("-").map(Number);
      return new Date(e, r - 1, a);
    }
    if (/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/.test(n)) {
      const [e, r] = n.split(" "), [a, A, i] = e.split("-").map(Number), [s, o] = r.split(":").map(Number);
      return new Date(a, A - 1, i, s, o);
    }
  }
  const t = new Date(n);
  return isNaN(t.getTime()) ? null : t;
}
function WE(n) {
  return new Date(n.getFullYear(), n.getMonth(), n.getDate());
}
function KE(n, t, e, r, a, A, i = 51) {
  const s = i - 10, o = Math.floor((i - s - OE * 2) / 2), l = t + o;
  if (e === Ue.HOUR) {
    if (!A) return null;
    const k = Sc(n.startDate || n.endDate), D = Sc(n.endDate || n.startDate);
    if (!k || !D) return null;
    const B = new Date(A);
    B.setHours(0, 0, 0, 0);
    const O = n.startDate, q = n.endDate;
    let G = k, W = D;
    typeof O == "string" && /^\d{4}-\d{2}-\d{2}$/.test(O) && (G = new Date(k), G.setHours(0, 0, 0, 0)), typeof q == "string" && /^\d{4}-\d{2}-\d{2}$/.test(q) && (W = new Date(D), W.setDate(W.getDate() + 1), W.setHours(0, 0, 0, 0));
    const F = (G.getTime() - B.getTime()) / (1e3 * 60), Y = (W.getTime() - B.getTime()) / (1e3 * 60), T = PE(a), E = Math.max(0, F * T), Q = Math.max(4, (Y - F) * T);
    return { left: E, top: l, width: Q, height: s };
  }
  const u = Sc(n.startDate || n.endDate), f = Sc(n.endDate || n.startDate);
  if (!u || !f) return null;
  const h = WE(u), c = hA(n.endDate, f), p = r ? r.getPosition(h, e) : null;
  if (p === null) return null;
  const w = new Date(c);
  w.setDate(w.getDate() + 1);
  const y = r ? r.getPosition(w, e) : null;
  let m;
  if (y !== null)
    m = Math.max(4, y - p);
  else {
    const k = r ? r.getPosition(c, e) : null;
    m = k !== null ? Math.max(4, k - p + a) : Math.max(
      4,
      (Math.max(0, Math.round((c.getTime() - u.getTime()) / 864e5)) + 1) * a
    );
  }
  return { left: p, top: l, width: m, height: s };
}
const $E = { class: "timeline-header" }, VE = { class: "timeline-header-row year-row" }, qE = { class: "year-label" }, jE = { class: "timeline-header-row half-years-row" }, YE = { class: "half-year-label" }, GE = { class: "timeline-header-row year-row" }, zE = { class: "year-label" }, XE = { class: "timeline-header-row months-row" }, JE = { class: "month-label" }, ZE = { class: "timeline-header-row year-row" }, eS = { class: "year-label" }, tS = { class: "timeline-header-row quarters-row" }, rS = { class: "quarter-label" }, nS = { class: "timeline-header-row date-row" }, aS = { class: "date-label" }, AS = { class: "timeline-header-row hours-row" }, sS = { class: "hour-label" }, iS = { class: "timeline-header-row year-month-row" }, oS = { class: "year-month-label" }, lS = { class: "flag-content" }, uS = { class: "timeline-header-row days-row" }, cS = { class: "week-label" }, dS = { class: "day-label" }, fS = { class: "quarter-hour-lines" }, hS = ["onMouseenter"], gS = ["onMouseenter"], vS = {
  key: 1,
  class: "hover-tooltip-content"
}, pS = { class: "hover-tooltip-title" }, mS = { class: "hover-tooltip-row" }, wS = { class: "hover-tooltip-label" }, yS = { class: "hover-tooltip-value" }, BS = { class: "hover-tooltip-row" }, bS = { class: "hover-tooltip-label" }, CS = { class: "hover-tooltip-value" }, kS = { class: "hover-tooltip-row" }, TS = { class: "hover-tooltip-label" }, xS = { class: "hover-tooltip-value" }, DS = { class: "hover-tooltip-row" }, ES = { class: "hover-tooltip-label" }, SS = { class: "hover-tooltip-value" }, FS = { class: "hover-tooltip-row hover-tooltip-overflow-warning" }, US = { class: "hover-tooltip-label" }, LS = { class: "hover-tooltip-row" }, IS = { class: "hover-tooltip-label" }, QS = { class: "hover-tooltip-value" }, MS = { class: "hover-tooltip-row" }, _S = { class: "hover-tooltip-label" }, RS = { class: "hover-tooltip-value" }, NS = { class: "hover-tooltip-row" }, HS = { class: "hover-tooltip-label" }, OS = { class: "hover-tooltip-value" }, PS = { class: "hover-tooltip-row" }, WS = { class: "hover-tooltip-label" }, KS = { class: "hover-tooltip-value" }, $S = {
  key: 1,
  class: "milestone-sticky-tooltip-content"
}, VS = 18, Fc = 5, qS = 200, jS = 8, YS = 4, _m = 10, GS = 6e4, zS = 4, Rm = 3, Nm = 5, XS = 8, JS = 18, ZS = 5.5, eF = 4.5, Hm = 50, Om = 5, tF = /* @__PURE__ */ hn({
  __name: "Timeline",
  props: {
    tasks: { default: () => [] },
    milestones: { default: () => [] },
    startDate: {},
    endDate: {},
    useDefaultDrawer: { type: Boolean, default: !0 },
    useDefaultMilestoneDialog: { type: Boolean, default: !0 },
    onTaskDelete: { type: Function, default: void 0 },
    onTaskUpdate: { type: Function, default: void 0 },
    onMilestoneDelete: { type: Function, default: void 0 },
    onMilestoneUpdate: { type: Function, default: void 0 },
    onMilestoneSave: { type: Function, default: void 0 },
    workingHours: { default: () => ({
      morning: { start: 8, end: 11 },
      afternoon: { start: 13, end: 17 }
    }) },
    taskBarConfig: { default: void 0 },
    allowDragAndResize: { type: Boolean, default: !0 },
    showActualTaskbar: { type: Boolean, default: !1 },
    enableTaskBarTooltip: { type: Boolean, default: !0 },
    enableMilestoneTooltip: { type: Boolean, default: !0 },
    milestoneLabelPosition: { default: "right" },
    pendingTaskBackgroundColor: { default: void 0 },
    delayTaskBackgroundColor: { default: void 0 },
    completeTaskBackgroundColor: { default: void 0 },
    ongoingTaskBackgroundColor: { default: void 0 },
    scaleConfigs: { default: void 0 },
    enableParentTaskAutoSchedule: { type: Boolean, default: !0 },
    linkConfig: {}
  },
  emits: ["timeline-scale-changed", "click-task", "edit-task", "milestone-double-click", "start-timer", "stop-timer", "add-predecessor", "add-successor", "predecessor-added", "successor-added", "delete", "link-deleted", "resource-drag-end"],
  setup(n, { expose: t, emit: e }) {
    const r = n, a = e, { formatYearMonth: A, formatMonth: i, getTranslation: s } = Cs(), o = (R) => s(R), { viewMode: l, dataSource: u } = c0(), f = Mr(
      "resourceConflicts",
      ce(() => /* @__PURE__ */ new Map())
    ), h = me(0), c = (R, z) => {
      if (l.value !== "resource") return [];
      const ge = f.value.get(String(R));
      if (!ge || !ge.has(Number(z))) return [];
      const xe = u.value.find((bt) => String(bt.id) === String(R));
      if (!xe || !xe.tasks) return [];
      const Se = xe.tasks.find((bt) => bt.id === z);
      if (!Se || !Se.startDate || !Se.endDate) return [];
      const Ne = new Date(Se.startDate).getTime(), Me = new Date(Se.endDate), Ke = hA(Se.endDate, Me).getTime() + 1440 * 60 * 1e3;
      return xe.tasks.filter((bt) => {
        if (bt.id === z || !bt.startDate || !bt.endDate || !ge.has(bt.id)) return !1;
        const qe = new Date(bt.startDate).getTime(), wt = new Date(bt.endDate), $t = hA(bt.endDate, wt).getTime() + 1440 * 60 * 1e3;
        return Ne < $t && qe < Ke;
      });
    }, p = me(!1);
    Tn("isDraggingTaskBar", p);
    const w = me(null);
    Tn("lastChangedTaskId", w), Tn("positionCache", Ff);
    const y = Mr("isSplitBarDragging", me(!1)), m = Mr("isTaskListToggling", me(!1)), k = Mr(
      "gantt-show-conflicts",
      ce(() => !0)
    ), D = Mr(
      "gantt-row-height",
      ce(() => 51)
    ), B = Mr(
      "taskRowLayouts",
      ce(() => ({ cumulativeHeights: [0], totalHeight: 0, taskHeights: /* @__PURE__ */ new Map() }))
    ), O = ce(() => {
      var z;
      const R = D.value;
      return ((z = r.taskBarConfig) == null ? void 0 : z.titlePosition) === "above" ? R + VS : R;
    }), q = me(0);
    let G = !1;
    const W = me(!1);
    let F = null;
    const Y = me(0), T = Mr(
      "resourceTaskLayouts",
      ce(() => /* @__PURE__ */ new Map())
    ), E = Mr(
      "resourceRowPositions",
      ce(() => /* @__PURE__ */ new Map())
    ), Q = Mr("gantt-task-list-width", me(0)), x = Gl({
      visible: !1,
      task: null,
      taskStatus: { color: "#409eff", label: "" },
      resourcePercent: 100,
      hasResourceConflict: !1,
      /** 父级任务自动调度信息 */
      parentAutoSchedule: void 0,
      /** 'above'|'below':tooltip 在目标上下方;'left'|'right':tooltip 在目标左右侧(气泡停靠时) */
      placement: "above",
      /** tooltip 盒子的左上角坐标(直接用于 fixed left/top,无 transform) */
      position: { left: 0, top: 0 },
      /**
       * 箭头定位偏移(px):
       *   - placement above/below → 箭头距 tooltip 左边缘的水平距离
       *   - placement left/right  → 箭头距 tooltip 顶边缘的垂直距离
       */
      arrowOffset: 0
    }), oe = (R) => R ? String(R).substring(0, 10) : o("dateNotSet"), J = (R) => {
      if (!R) return o("dateNotSet");
      const z = new Date(R);
      return isNaN(z.getTime()) ? o("dateNotSet") : S(hA(R, z));
    }, S = (R) => {
      if (!R) return o("dateNotSet");
      const z = R.getFullYear(), ge = String(R.getMonth() + 1).padStart(2, "0"), Ce = String(R.getDate()).padStart(2, "0");
      return `${z}-${ge}-${Ce}`;
    }, I = (R, z) => {
      let ge = 4;
      return l.value === "resource" && R < 100 && (ge += 1), z && (ge += 1), 52 + ge * 22;
    }, N = (R) => {
      var WA;
      if (r.enableTaskBarTooltip === !1) return;
      const { task: z, taskStatus: ge, resourcePercent: Ce, hasResourceConflict: xe, targetRect: Se, mouseX: Ne, mouseY: Me } = R;
      x.task = z, x.taskStatus = ge, x.resourcePercent = Ce, x.hasResourceConflict = xe, x.parentAutoSchedule = R.parentAutoSchedule;
      const Ke = 250, Bt = I(Ce, xe), bt = 15, qe = 7, wt = (WA = nt.value) == null ? void 0 : WA.getBoundingClientRect(), $t = wt ? wt.left : Q.value, Le = wt ? wt.right : window.innerWidth, Et = window.innerHeight, Xt = Ne ?? Se.left + Se.width / 2, Lr = Me ?? Se.top + Se.height / 2, Rr = Xt < $t + 60, Sr = Xt > Le - 60;
      let Mn, wn, Ba, FA;
      if (Rr)
        FA = "right", Mn = Se.right + bt, wn = Math.max(qe + Bt / 2, Math.min(Et - qe - Bt / 2, Lr)), Ba = Math.max(10, Math.min(Bt - 10, Lr - wn + Bt / 2));
      else if (Sr)
        FA = "left", Mn = Se.left - Ke - bt, wn = Math.max(qe + Bt / 2, Math.min(Et - qe - Bt / 2, Lr)), Ba = Math.max(10, Math.min(Bt - 10, Lr - wn + Bt / 2));
      else {
        Mn = Math.max($t + qe, Math.min(Le - Ke - qe, Xt - Ke / 2)), Ba = Math.max(10, Math.min(Ke - 10, Xt - Mn));
        const Ws = Se.top - qe, ba = Et - Se.bottom - qe;
        Ws >= Bt + bt || Ws >= ba ? (FA = "above", wn = Se.top - bt) : (FA = "below", wn = Se.bottom + bt);
      }
      x.placement = FA, x.position = { left: Mn, top: wn }, x.arrowOffset = Ba, x.visible = !0;
    }, se = () => {
      x.visible = !1;
    }, Z = Gl({
      visible: !1,
      milestone: null,
      milestoneColor: "#f56c6c",
      position: { x: 0, y: 0 },
      arrowDirection: "left",
      arrowOffsetY: 0
      // 箭头 top 坐标(距 tooltip 顶边)= 目标垂直中心在 tooltip 内的位置,约等于 estimatedH/2 = 17px
    }), C = (R) => {
      if (r.enableMilestoneTooltip === !1) return;
      const { milestone: z, milestoneColor: ge, targetRect: Ce, stickyPosition: xe } = R;
      Z.milestone = z, Z.milestoneColor = ge;
      const Se = 220, Ne = 8, Me = 8, Ke = 34, Bt = window.innerWidth, bt = window.innerHeight;
      let qe, wt;
      xe === "left" ? (qe = Ce.right + Ne, wt = "left") : (qe = Ce.left - Se - Ne - 40, wt = "right"), qe = Math.max(Me, Math.min(Bt - Se - Me, qe));
      const $t = Ce.top + Ce.height / 2;
      let Le = $t - Ke / 2;
      Le = Math.max(Me, Math.min(bt - Ke - Me, Le));
      const Et = Math.max(10, Math.min(Ke - 10, $t - Le));
      Z.position = { x: qe, y: Le }, Z.arrowDirection = wt, Z.arrowOffsetY = Et, Z.visible = !0;
    }, H = () => {
      Z.visible = !1;
    }, M = (() => {
      const R = /* @__PURE__ */ new Date(), z = new Date(R.getFullYear(), R.getMonth() - 6, 1), ge = new Date(R.getFullYear(), R.getMonth() + 6 + 1, 0);
      return {
        startDate: z,
        endDate: ge
      };
    })(), te = () => M, ie = ce(() => r.startDate ? new Date(r.startDate) : te().startDate), we = ce(() => r.endDate ? new Date(r.endDate) : te().endDate), ve = me({
      startDate: ie.value,
      endDate: we.value,
      zoomLevel: 1
    }), le = me(Ue.DAY);
    Gt([ie, we], ([R, z]) => {
      if (l.value !== "resource" && (r.startDate || r.endDate) && !pe) {
        if (R.getTime() === ve.value.startDate.getTime() && z.getTime() === ve.value.endDate.getTime())
          return;
        ve.value.startDate = R, ve.value.endDate = z;
      }
    });
    const _e = [], De = ce(() => l.value === "resource" ? u.value || [] : r.tasks ?? _e), ze = me(null), nt = me(null), Qe = ce(() => r.scaleConfigs ?? bs);
    function ne(R) {
      if (R == null) return null;
      const z = Math.ceil(R);
      return z < 0 ? null : Math.max(1, z);
    }
    function gt(R, z) {
      return dp(R, z);
    }
    function je(R, z) {
      var xe, Se;
      const ge = (xe = Qe.value[R]) == null ? void 0 : xe.formatters, Ce = (Se = bs[R]) == null ? void 0 : Se.formatters;
      return !ge || !Ce ? !1 : z === "primary" ? ge.primary !== Ce.primary : (ge.secondary ?? "") !== (Ce.secondary ?? "");
    }
    const ot = ce(() => le.value === Ue.HOUR ? Qe.value.hour.cellWidth * 24 : le.value === Ue.WEEK ? Qe.value.week.cellWidth / 7 : le.value === Ue.MONTH ? Qe.value.month.cellWidth / 30 : le.value === Ue.QUARTER ? Qe.value.quarter.cellWidth / 90 : le.value === Ue.YEAR ? Qe.value.year.cellWidth * 2 / 365 : Qe.value.day.cellWidth);
    let Ie = null;
    const It = () => {
      Ie = null;
    }, dt = () => {
      if (!De.value || De.value.length === 0)
        return null;
      const R = [], z = (xe) => {
        if (xe.startDate && R.push(new Date(xe.startDate)), xe.endDate && R.push(new Date(xe.endDate)), xe.children && xe.children.length > 0)
          for (const Se of xe.children)
            z(Se);
      };
      if (l.value === "resource") {
        for (const xe of De.value)
          if (xe.tasks && Array.isArray(xe.tasks))
            for (const Se of xe.tasks)
              z(Se);
      } else
        for (const xe of De.value)
          z(xe);
      if (R.length === 0)
        return null;
      let ge = 1 / 0, Ce = -1 / 0;
      for (const xe of R) {
        const Se = xe.getTime();
        isNaN(Se) || (Se < ge && (ge = Se), Se > Ce && (Ce = Se));
      }
      return ge === 1 / 0 || Ce === -1 / 0 ? null : {
        minDate: new Date(ge),
        maxDate: new Date(Ce)
      };
    }, Dt = () => Ie || (Ie = dt(), Ie), Ct = () => {
      const R = Dt(), z = Xr.value || 1200, ge = Qe.value.hour.cellWidth, Ce = Qe.value.hour, xe = ne(Ce.preBuffer), Se = ne(Ce.sufBuffer);
      if (!R) {
        const Le = /* @__PURE__ */ new Date();
        Le.setHours(0, 0, 0, 0);
        const Et = new Date(Le);
        Et.setDate(Et.getDate() - 1);
        const Xt = new Date(Le);
        return Xt.setDate(Xt.getDate() + 1), Xt.setHours(23, 59, 59, 999), { startDate: Et, endDate: Xt };
      }
      const { minDate: Ne, maxDate: Me } = R, Ke = new Date(Ne);
      Ke.setHours(0, 0, 0, 0);
      const Bt = new Date(Ke);
      xe !== null ? Bt.setDate(Bt.getDate() - xe) : Bt.setDate(Bt.getDate() - 1);
      const bt = new Date(Me);
      bt.setHours(23, 59, 59, 999);
      const qe = new Date(bt);
      Se !== null ? qe.setDate(qe.getDate() + Se) : qe.setDate(qe.getDate() + 1);
      const wt = Math.ceil((qe.getTime() - Bt.getTime()) / (1e3 * 60 * 60));
      if (wt * ge < z) {
        const Le = Math.ceil(z / ge), Et = Math.ceil((Le - wt) / 2), Xt = Math.ceil(Et / 24);
        Bt.setDate(Bt.getDate() - Xt), qe.setDate(qe.getDate() + Xt);
      }
      return { startDate: Bt, endDate: qe };
    }, Ve = () => {
      const R = Dt(), z = Xr.value || 1200, ge = Qe.value.day.cellWidth, Ce = Qe.value.day, xe = ne(Ce.preBuffer), Se = ne(Ce.sufBuffer), { minDate: Ne, maxDate: Me } = R || { minDate: /* @__PURE__ */ new Date(), maxDate: /* @__PURE__ */ new Date() };
      let Ke;
      xe !== null ? Ke = new Date(Ne.getFullYear(), Ne.getMonth() - xe, 1) : Ke = new Date(Ne.getFullYear(), Ne.getMonth() - 1, 1);
      let Bt;
      Se !== null ? Bt = new Date(Me.getFullYear(), Me.getMonth() + Se + 1, 0) : Bt = new Date(Me.getFullYear(), Me.getMonth() + 2, 0);
      const bt = Math.ceil((Bt.getTime() - Ke.getTime()) / (1e3 * 60 * 60 * 24));
      if (bt * ge < z) {
        const wt = Math.ceil(z / ge), $t = Math.ceil((wt - bt) / 2), Le = new Date(Ke);
        Le.setDate(Le.getDate() - $t), Ke = Le;
        const Et = new Date(Bt);
        Et.setDate(Et.getDate() + $t), Bt = Et;
      }
      return { startDate: Ke, endDate: Bt };
    }, ht = () => {
      const R = Dt(), z = Xr.value || 1200, ge = Qe.value.week.cellWidth, Ce = Qe.value.week, xe = ne(Ce.preBuffer), Se = ne(Ce.sufBuffer);
      if (!R) {
        const gn = /* @__PURE__ */ new Date(), Zr = Math.max(Math.ceil(z / ge), 20), qn = new Date(gn);
        qn.setDate(qn.getDate() - Math.floor(Zr / 2) * 7);
        const KA = new Date(gn);
        return KA.setDate(KA.getDate() + Math.ceil(Zr / 2) * 7), { startDate: qn, endDate: KA };
      }
      const { minDate: Ne, maxDate: Me } = R;
      function Ke(gn) {
        const Zr = new Date(gn), qn = Zr.getDay() || 7;
        return Zr.setDate(Zr.getDate() - (qn - 1)), Zr;
      }
      function Bt(gn, Zr) {
        let qn = 1;
        for (; qn <= 31; ) {
          const KA = new Date(gn, Zr, qn);
          if (KA.getMonth() !== Zr) break;
          const si = Ke(KA);
          if (si.getMonth() === Zr)
            return si;
          qn++;
        }
        return new Date(gn, Zr, 1);
      }
      function bt(gn, Zr) {
        const qn = new Date(gn, Zr + 1, 0).getDate();
        for (let KA = qn; KA >= 1; KA--) {
          const si = new Date(gn, Zr, KA), UA = Ke(si);
          if (UA.getMonth() === Zr)
            return UA;
        }
        return new Date(gn, Zr, 1);
      }
      function qe(gn, Zr) {
        const qn = [], KA = Bt(gn, Zr), si = bt(gn, Zr), UA = new Date(KA);
        for (; UA <= si; )
          qn.push(new Date(UA)), UA.setDate(UA.getDate() + 7);
        return qn;
      }
      const wt = Ke(Ne), $t = wt.getFullYear(), Le = wt.getMonth(), Et = Le === 0 ? 11 : Le - 1, Xt = Le === 0 ? $t - 1 : $t, Lr = qe(Xt, Et), Rr = Ke(Me), Sr = Rr.getFullYear(), Mn = Rr.getMonth(), wn = Mn === 11 ? 0 : Mn + 1, Ba = Mn === 11 ? Sr + 1 : Sr, FA = qe(Ba, wn);
      let WA;
      if (xe !== null) {
        WA = [];
        for (let gn = xe; gn >= 1; gn--) {
          const Zr = new Date(Ne.getFullYear(), Ne.getMonth() - gn, 1);
          WA.push(...qe(Zr.getFullYear(), Zr.getMonth()));
        }
      } else
        WA = Lr;
      let Ws;
      if (Se !== null) {
        Ws = [];
        for (let gn = 1; gn <= Se; gn++) {
          const Zr = new Date(Me.getFullYear(), Me.getMonth() + gn, 1);
          Ws.push(...qe(Zr.getFullYear(), Zr.getMonth()));
        }
      } else
        Ws = FA;
      let ba = [];
      ba.push(...WA);
      let Di = $t, Ei = Le;
      for (; Di < Sr || Di === Sr && Ei <= Mn; ) {
        const gn = qe(Di, Ei);
        ba.push(...gn), Ei++, Ei > 11 && (Ei = 0, Di++);
      }
      ba.push(...Ws);
      let Vi = ba.length * ge;
      for (; Vi < z; ) {
        const gn = ba[0], Zr = gn.getFullYear(), qn = gn.getMonth(), KA = qn === 0 ? 11 : qn - 1, si = qn === 0 ? Zr - 1 : Zr;
        if (ba = [...qe(si, KA), ...ba], Vi = ba.length * ge, Vi >= z) break;
        const ns = ba[ba.length - 1], hc = ns.getFullYear(), cu = ns.getMonth(), gc = cu === 11 ? 0 : cu + 1, vc = cu === 11 ? hc + 1 : hc, pc = qe(vc, gc);
        ba = [...ba, ...pc], Vi = ba.length * ge;
      }
      const Si = new Date(ba[0]), uu = new Date(ba[ba.length - 1]);
      return uu.setDate(uu.getDate() + 6), { startDate: Si, endDate: uu };
    }, K = () => {
      const R = Dt(), z = Qe.value.month, ge = ne(z.preBuffer), Ce = ne(z.sufBuffer);
      if (!R) {
        const $t = /* @__PURE__ */ new Date(), Le = new Date($t.getFullYear() - 1, 0, 1), Et = new Date($t.getFullYear() + 1, 11, 31);
        return { startDate: Le, endDate: Et };
      }
      const { minDate: xe, maxDate: Se } = R, Ne = Xr.value || 1200;
      let Me;
      ge !== null ? Me = new Date(xe.getFullYear() - ge, 0, 1) : Me = new Date(xe.getFullYear() - 1, 0, 1);
      let Ke;
      Ce !== null ? Ke = new Date(Se.getFullYear() + Ce, 11, 31) : Ke = new Date(Se.getFullYear() + 1, 11, 31);
      const bt = (Ke.getFullYear() - Me.getFullYear()) * 12 + (Ke.getMonth() - Me.getMonth()), qe = Qe.value.month.cellWidth;
      if (bt * qe < Ne) {
        const $t = Math.ceil(Ne / qe), Le = Math.ceil(($t - bt) / 2), Et = new Date(Me);
        Et.setMonth(Et.getMonth() - Le), Me = new Date(Et.getFullYear(), Et.getMonth(), 1);
        const Xt = new Date(Ke);
        Xt.setMonth(Xt.getMonth() + Le), Ke = new Date(Xt.getFullYear(), Xt.getMonth() + 1, 0);
      }
      return { startDate: Me, endDate: Ke };
    }, X = () => {
      const R = Dt();
      if (!R) {
        const Ne = /* @__PURE__ */ new Date(), Me = Xr.value || 1200;
        let Ke = 3;
        if (le.value === Ue.QUARTER) {
          const Le = Qe.value.quarter.cellWidth * 4;
          Ke = Math.max(Math.ceil(Me / Le) + 1, 5);
        } else if (le.value === Ue.YEAR) {
          const $t = Qe.value.year.cellWidth * 2;
          Ke = Math.max(Math.ceil(Me / $t) + 1, 5);
        }
        const Bt = Ne.getFullYear() - Math.floor(Ke / 2), bt = Bt + Ke - 1, qe = new Date(Bt, 0, 1), wt = new Date(bt, 11, 31);
        return { startDate: qe, endDate: wt };
      }
      const { minDate: z, maxDate: ge } = R, Ce = Xr.value || 1200;
      if (le.value === Ue.QUARTER) {
        const Ne = Qe.value.quarter, Me = ne(Ne.preBuffer), Ke = ne(Ne.sufBuffer), bt = Qe.value.quarter.cellWidth * 4;
        let qe;
        Me !== null ? qe = new Date(z.getFullYear() - Me, 0, 1) : qe = new Date(z.getFullYear() - 1, 0, 1);
        let wt;
        Ke !== null ? wt = new Date(ge.getFullYear() + Ke, 11, 31) : wt = new Date(ge.getFullYear() + 1, 11, 31);
        const $t = wt.getFullYear() - qe.getFullYear() + 1;
        if ($t * bt < Ce) {
          const Et = Math.ceil(Ce / bt), Xt = Math.ceil((Et - $t) / 2);
          qe = new Date(qe.getFullYear() - Xt, 0, 1), wt = new Date(wt.getFullYear() + Xt, 11, 31);
        }
        return { startDate: qe, endDate: wt };
      } else if (le.value === Ue.YEAR) {
        const Ne = Qe.value.year, Me = ne(Ne.preBuffer), Ke = ne(Ne.sufBuffer), bt = Qe.value.year.cellWidth * 2;
        let qe;
        Me !== null ? qe = new Date(z.getFullYear() - Me, 0, 1) : qe = new Date(z.getFullYear() - 1, 0, 1);
        let wt;
        Ke !== null ? wt = new Date(ge.getFullYear() + Ke, 11, 31) : wt = new Date(ge.getFullYear() + 1, 11, 31);
        const $t = wt.getFullYear() - qe.getFullYear() + 1;
        if ($t * bt < Ce) {
          const Et = Math.ceil(Ce / bt), Xt = Math.ceil((Et - $t) / 2);
          qe = new Date(qe.getFullYear() - Xt, 0, 1), wt = new Date(wt.getFullYear() + Xt, 11, 31);
        }
        return { startDate: qe, endDate: wt };
      }
      const xe = new Date(z.getFullYear() - 1, 0, 1), Se = new Date(ge.getFullYear() + 1, 11, 31);
      return { startDate: xe, endDate: Se };
    }, ke = me(null), Je = me(null), pt = me(/* @__PURE__ */ new Set()), Xe = ce(() => Je.value !== null), Ye = () => {
      Je.value = null, pt.value.clear();
    }, Kt = (R) => {
      Je.value = R, pt.value.clear(), pt.value.add(R);
      const z = De.value.find((ge) => ge.id === R);
      if (z) {
        if (z.predecessor) {
          const ge = $s(z.predecessor);
          for (const Ce of ge)
            pt.value.add(Ce);
        }
        for (const ge of De.value)
          ge.predecessor && $s(ge.predecessor).includes(R) && pt.value.add(ge.id);
      }
    }, it = me(null), qt = fi(null), hr = fi(null), Nt = me(!1), xr = me(""), Jt = me(null);
    let lr = !1, Fr = "";
    const er = /* @__PURE__ */ new Map(), Ar = (R) => {
      it.value = R.type, qt.value = R.task, Dn(R.mouseEvent.clientX, R.mouseEvent.clientY), hr.value = null, Nt.value = !1, xr.value = "", Un = null, lr = !1, Fr = "", Xa(), document.addEventListener("mousemove", br), document.addEventListener("mouseup", on);
    };
    let Ge = null, rt = 0, yt = 0, Ot = 0, vr = 0;
    const jt = () => {
      Ge = null, Dn(rt, yt), pa(rt, yt), lA.value && qt.value && lA.value.draw(
        ts(),
        Hs(),
        Ot,
        vr,
        lr,
        Fr
      );
    }, br = (R) => {
      it.value && (rt = R.clientX, yt = R.clientY, Ge === null && (Ge = requestAnimationFrame(jt)));
    }, on = () => {
      it.value && (Ge !== null && (cancelAnimationFrame(Ge), Ge = null), qt.value && ka({
        task: qt.value,
        type: it.value
      }));
    };
    let an = null, xn = 0, $r = !1;
    const pn = (R, z) => {
      if (!Pa.value) {
        Ot = R, vr = z;
        return;
      }
      const ge = Date.now();
      (!an || $r || ge - xn > qS) && (an = Pa.value.getBoundingClientRect(), xn = ge, $r = !1), Ot = R - an.left, vr = z - an.top;
    }, Dn = (R, z) => {
      pn(R, z);
    }, Ca = (R) => {
      rt = R.mouseX, yt = R.mouseY, Ge === null && (Ge = requestAnimationFrame(jt));
    }, ka = (R) => {
      var z;
      an = null, document.removeEventListener("mousemove", br), document.removeEventListener("mouseup", on), oA(), (z = lA.value) == null || z.clear(), hr.value && Nt.value && Vn(R.task, hr.value, R.type), it.value = null, qt.value = null, hr.value = null, Nt.value = !1;
    }, Yn = (R, z) => {
      an || (an = Pa.value.getBoundingClientRect(), xn = Date.now());
      const ge = R - an.left, Ce = z - an.top, xe = (jS + YS) / 2, Se = xe + 10;
      for (const Ne in wr.value) {
        const Me = wr.value[Ne], Ke = Number(Ne);
        if (Ce < Me.top - Se || Ce > Me.top + Me.height + Se)
          continue;
        const Bt = Me.top + Me.height / 2, bt = Me.left;
        if (ge >= bt - xe && ge <= bt + xe && Ce >= Bt - xe && Ce <= Bt + xe)
          return { taskId: Ke, anchorType: "left" };
        const qe = Me.left + Me.width;
        if (ge >= qe - xe && ge <= qe + xe && Ce >= Bt - xe && Ce <= Bt + xe)
          return { taskId: Ke, anchorType: "right" };
      }
      return null;
    }, zr = (R, z) => {
      const ge = (Un == null ? void 0 : Un.id) ?? null, Ce = (R == null ? void 0 : R.id) ?? null;
      if (ge !== Ce)
        if (Un = R, R && qt.value) {
          const xe = ma(
            qt.value,
            R,
            it.value,
            z
          );
          lr = xe.valid, Fr = xe.error || "", Nt.value = xe.valid, hr.value = R;
        } else
          lr = !1, Fr = "", Nt.value = !1, hr.value = null;
    };
    let Un = null;
    const pa = (R, z) => {
      if (!qt.value || !Pa.value) return;
      const ge = Yn(R, z), Ce = ge !== null && er.get(ge.taskId) || null, xe = ge == null ? void 0 : ge.anchorType;
      zr(Ce, xe);
    }, ma = (R, z, ge, Ce) => {
      if (Ce) {
        if (ge === "predecessor" && Ce !== "right")
          return { valid: !1, error: "前置任务应连接到右侧触点" };
        if (ge === "successor" && Ce !== "left")
          return { valid: !1, error: "后置任务应连接到左侧触点" };
      }
      if (R.id === z.id)
        return { valid: !1, error: "不能连接到自己" };
      if (z.isParent || z.type === "milestone")
        return { valid: !1, error: "不能连接到父级任务或里程碑" };
      if (ge === "predecessor") {
        if (En(z.id, R.id))
          return { valid: !1, error: "会产生循环依赖" };
      } else if (En(R.id, z.id))
        return { valid: !1, error: "会产生循环依赖" };
      if (ge === "predecessor") {
        if (R.predecessor && $s(R.predecessor).includes(z.id))
          return { valid: !1, error: "关系已存在" };
      } else if (z.predecessor && $s(z.predecessor).includes(R.id))
        return { valid: !1, error: "关系已存在" };
      return { valid: !0 };
    }, En = (R, z) => {
      const ge = /* @__PURE__ */ new Set(), Ce = [R];
      for (; Ce.length > 0; ) {
        const xe = Ce.shift();
        if (xe === z)
          return !0;
        if (ge.has(xe))
          continue;
        ge.add(xe);
        const Se = De.value.find((Ne) => Ne.id === xe);
        if (Se && Se.predecessor) {
          const Ne = $s(Se.predecessor);
          Ce.push(...Ne);
        }
      }
      return !1;
    }, Vn = (R, z, ge) => {
      if (ge === "predecessor") {
        const Ce = R.predecessor ? $s(R.predecessor) : [];
        Ce.includes(z.id) || (Ce.push(z.id), R.predecessor = Ce, _r(R), a("predecessor-added", { targetTask: R, newTask: z }));
      } else {
        const Ce = z.predecessor ? $s(z.predecessor) : [];
        Ce.includes(R.id) || (Ce.push(R.id), z.predecessor = Ce, _r(z), a("successor-added", { targetTask: z, newTask: R }));
      }
    }, Xa = () => {
      Jt.value = window.setInterval(() => {
        if (!ze.value || !Pa.value) return;
        const R = ze.value, z = Ua.value;
        if (!z) return;
        const ge = R.getBoundingClientRect(), Ce = 80, xe = 15, Se = rt, Ne = yt;
        let Me = !1;
        if (Se < ge.left + Ce && R.scrollLeft > 0)
          R.scrollLeft -= xe, Me = !0;
        else if (Se > ge.right - Ce) {
          const Ke = R.scrollWidth - R.clientWidth;
          R.scrollLeft < Ke && (R.scrollLeft += xe, Me = !0);
        }
        if (Ne < ge.top + Ce && z.scrollTop > 0)
          z.scrollTop -= xe, Me = !0;
        else if (Ne > ge.bottom - Ce) {
          const Ke = z.scrollHeight - z.clientHeight;
          z.scrollTop < Ke && (z.scrollTop += xe, Me = !0);
        }
        Me && ($r = !0, pa(Se, Ne), lA.value && qt.value && lA.value.draw(
          ts(),
          Hs(),
          Ot,
          vr,
          lr,
          Fr
        ));
      }, 30);
    }, oA = () => {
      Jt.value !== null && (clearInterval(Jt.value), Jt.value = null);
    }, Ta = () => {
      var R;
      oA(), an = null, Ge !== null && (cancelAnimationFrame(Ge), Ge = null), (R = lA.value) == null || R.clear(), document.removeEventListener("mousemove", br), document.removeEventListener("mouseup", on), it.value = null, qt.value = null, hr.value = null, Nt.value = !1;
    }, ts = () => {
      if (!qt.value) return 0;
      const R = wr.value[qt.value.id];
      return R ? it.value === "predecessor" ? R.left : R.left + R.width : 0;
    }, Hs = () => {
      if (!qt.value) return 0;
      const R = wr.value[qt.value.id];
      return R ? R.top + R.height / 2 : 0;
    }, sa = y, rs = me(!1), Jn = me(!1), ia = me(0), xa = me(!1);
    let Bn = null;
    const Zn = me(0), Xr = me(0);
    let wa = !1, Da = !1;
    const bn = me(!0), ya = me(!0);
    let Ea = null;
    const Hr = /* @__PURE__ */ new Map(), gA = me(!0), vA = ce(() => {
      if (le.value !== Ue.HOUR)
        return { startHour: 0, endHour: 0 };
      const R = Zn.value, z = Xr.value;
      if (gA.value && R === 0)
        return {
          startHour: 0,
          endHour: 168
          // 一周 (7*24=168小时)
        };
      if (gA.value) {
        const Se = /* @__PURE__ */ new Date(), Ne = ve.value.startDate, Me = Math.floor((Se.getTime() - Ne.getTime()) / (1e3 * 60 * 60));
        return {
          startHour: Math.max(0, Me - 168),
          // 前一周 (7*24=168小时)
          endHour: Me + 168
          // 后一周
        };
      }
      const ge = Qe.value.hour.cellWidth, Ce = Math.floor(R / ge) - _m, xe = Math.ceil((R + z) / ge) + _m;
      return {
        startHour: Math.max(0, Ce),
        endHour: Math.max(Ce + 1, xe)
      };
    }), pA = me(0), DA = me(0);
    let oa = null;
    Gt(
      [Zn, Xr],
      ([R, z]) => {
        oa && clearTimeout(oa), oa = window.setTimeout(() => {
          pA.value = R, DA.value = z, oa = null;
        }, 100), pA.value === 0 && DA.value === 0 && (pA.value = R, DA.value = z);
      },
      { immediate: !0 }
    );
    const Ja = ce(() => {
      const R = pA.value, z = DA.value || Xr.value;
      let ge = 0.3;
      le.value === Ue.WEEK ? ge = 0.15 : (le.value === Ue.MONTH || le.value === Ue.QUARTER || le.value === Ue.YEAR) && (ge = 0.05);
      const Ce = z * ge, xe = Za(Math.max(0, R - Ce)), Se = Za(R + z + Ce);
      return { startDate: xe, endDate: Se };
    }), Za = (R) => {
      var xe;
      const z = ve.value.startDate, ge = ve.value.endDate, Ce = le.value;
      if (R <= 0)
        return z;
      if (Ce === Ue.HOUR) {
        const Se = R / 40;
        return new Date(z.getTime() + Se * 60 * 60 * 1e3);
      } else if (Ce === Ue.DAY) {
        const Se = R / 30;
        return new Date(z.getTime() + Se * 24 * 60 * 60 * 1e3);
      } else if (Ce === Ue.WEEK || Ce === Ue.MONTH || Ce === Ue.QUARTER || Ce === Ue.YEAR) {
        const Se = ae.value;
        if (!Se || Se.length === 0)
          return z;
        let Ne = 0;
        if (Ce === Ue.WEEK)
          for (const Me of Se) {
            const Ke = Me.weeks || [];
            for (const Bt of Ke) {
              const bt = Qe.value.week.cellWidth;
              if (R >= Ne && R < Ne + bt) {
                const qe = R - Ne, wt = bt / 7, $t = Math.floor(qe / wt), Le = Bt.subDays || [];
                return $t < Le.length ? new Date(Le[$t].date) : new Date(Bt.weekStart);
              }
              Ne += bt;
            }
          }
        else if (Ce === Ue.MONTH)
          for (const Me of Se) {
            const Ke = Qe.value.month.cellWidth;
            if (R >= Ne && R < Ne + Ke) {
              const Bt = R - Ne, bt = ((xe = Me.monthData) == null ? void 0 : xe.dayCount) || 30, qe = Ke / bt, wt = Math.floor(Bt / qe);
              return new Date(Me.year, Me.month - 1, wt + 1);
            }
            Ne += Ke;
          }
        else if (Ce === Ue.QUARTER)
          for (const Me of Se) {
            const Ke = Me.quarters || [];
            for (const Bt of Ke) {
              const bt = Qe.value.quarter.cellWidth;
              if (R >= Ne && R < Ne + bt) {
                const qe = R - Ne, wt = new Date(Bt.startDate), $t = new Date(Bt.endDate), Le = Math.ceil(
                  ($t.getTime() - wt.getTime()) / (1e3 * 60 * 60 * 24)
                ), Et = bt / Le, Xt = Math.floor(qe / Et);
                return new Date(wt.getTime() + Xt * 24 * 60 * 60 * 1e3);
              }
              Ne += bt;
            }
          }
        else if (Ce === Ue.YEAR)
          for (const Me of Se) {
            const Ke = Me.halfYears || [];
            for (const Bt of Ke) {
              const bt = Qe.value.year.cellWidth;
              if (R >= Ne && R < Ne + bt) {
                const qe = R - Ne, wt = new Date(Bt.startDate), $t = new Date(Bt.endDate), Le = Math.ceil(
                  ($t.getTime() - wt.getTime()) / (1e3 * 60 * 60 * 24)
                ), Et = bt / Le, Xt = Math.floor(qe / Et);
                return new Date(wt.getTime() + Xt * 24 * 60 * 60 * 1e3);
              }
              Ne += bt;
            }
          }
        return console.warn(
          `[Sprint2-Debug] scrollPosition=${R} exceeds timelineData range (cumulative=${Ne}), returning end date`
        ), ge;
      }
      return z;
    }, ea = ce(() => {
      var ge, Ce;
      const R = q.value, z = Y.value || 600;
      if (l.value === "resource") {
        const xe = u.value;
        let Se = 0, Ne = xe.length;
        for (let Ke = 0; Ke < xe.length; Ke++) {
          const Bt = xe[Ke].id, bt = ((ge = E.value) == null ? void 0 : ge.get(Bt)) || 0, qe = T.value.get(Bt), wt = (qe == null ? void 0 : qe.totalHeight) || D.value;
          if (bt + wt >= R - D.value * Fc) {
            Se = Ke;
            break;
          }
        }
        const Me = R + z;
        for (let Ke = Se; Ke < xe.length; Ke++) {
          const Bt = xe[Ke].id;
          if ((((Ce = E.value) == null ? void 0 : Ce.get(Bt)) || 0) > Me + D.value * Fc) {
            Ne = Ke;
            break;
          }
        }
        return {
          startIndex: Math.max(0, Se),
          endIndex: Math.min(xe.length, Ne)
        };
      } else {
        const xe = B.value.cumulativeHeights, Se = De.value.length;
        if (Se === 0 || xe.length <= 1)
          return { startIndex: 0, endIndex: 0 };
        const Ne = (bt) => {
          let qe = 0, wt = xe.length - 1;
          for (; qe < wt; ) {
            const $t = Math.floor((qe + wt) / 2);
            xe[$t] <= bt ? qe = $t + 1 : wt = $t;
          }
          return Math.max(0, qe - 1);
        }, Me = Math.max(0, Ne(R) - Fc), Ke = R + z, Bt = Math.min(Se, Ne(Ke) + Fc + 1);
        return {
          startIndex: Me,
          endIndex: Math.min(Se, Math.max(Me + 1, Bt))
        };
      }
    }), fs = ce(() => {
      const { startIndex: R, endIndex: z } = ea.value;
      return De.value.slice(R, z).map((Ce, xe) => ({
        task: Ce,
        originalIndex: R + xe
      }));
    }), OA = ce(() => {
      const { startIndex: R, endIndex: z } = ea.value;
      return l.value !== "resource" ? [] : u.value.slice(R, z).map((Ce, xe) => ({
        resource: Ce,
        originalIndex: R + xe
      }));
    });
    let Ha = null, Wt = [];
    const fe = /* @__PURE__ */ new Set(), et = fi([]);
    Gt(
      [fs, l],
      ([R, z]) => {
        if (z !== "task") {
          Ha !== null && (cancelAnimationFrame(Ha), Ha = null), Wt = [], fe.clear(), et.value = [];
          return;
        }
        const ge = new Set(R.map((Ne) => Ne.task.id)), Ce = [];
        if (fe.forEach((Ne) => {
          ge.has(Ne) || (fe.delete(Ne), Ce.push(Ne));
        }), Ce.length > 0) {
          const Ne = { ...wr.value };
          for (const Me of Ce)
            delete Ne[Me];
          wr.value = Ne;
        }
        const xe = R.filter((Ne) => !fe.has(Ne.task.id));
        if (Ha !== null && (cancelAnimationFrame(Ha), Ha = null), Wt = xe, Wt.splice(0, Rm).forEach((Ne) => fe.add(Ne.task.id)), et.value = R.filter((Ne) => fe.has(Ne.task.id)), Wt.length > 0) {
          const Ne = () => {
            const Me = Wt.splice(0, Rm);
            if (Me.length === 0) {
              Ha = null;
              return;
            }
            Me.forEach((Ke) => fe.add(Ke.task.id)), et.value = fs.value.filter((Ke) => fe.has(Ke.task.id)), Ha = Wt.length > 0 ? requestAnimationFrame(Ne) : null;
          };
          Ha = requestAnimationFrame(Ne);
        }
      },
      { immediate: !0 }
    );
    const ft = fi(/* @__PURE__ */ new Map()), Yt = fi(/* @__PURE__ */ new Map()), zt = fi(/* @__PURE__ */ new Map()), gr = me("visible");
    let rn = null;
    const Gn = ce(
      () => {
        var R;
        return ((R = r.taskBarConfig) == null ? void 0 : R.titlePosition) === "above" ? JS : 0;
      }
    ), ln = ce(
      () => Gn.value + ZS
    ), Hn = (R) => R - ln.value - eF, Ln = (R) => {
      var z;
      return (z = T.value.get(R)) == null ? void 0 : z.rowHeights;
    }, On = () => {
      rn !== null && (cancelAnimationFrame(rn), rn = null);
    }, hs = () => {
      On();
      const R = () => {
        if (l.value !== "resource") {
          rn = null;
          return;
        }
        const z = performance.now(), ge = new Map(zt.value);
        let Ce = !1;
        Yt.value.forEach((xe, Se) => {
          if (performance.now() - z > XS) {
            Ce = !0;
            return;
          }
          const Ne = ge.get(Se) || 0, Me = xe.visibleCount;
          if (Ne < Me) {
            const Ke = Math.min(Me, Ne + Nm);
            ge.set(Se, Ke), Ce = !0;
          }
        }), Ce ? (zt.value = ge, rn = requestAnimationFrame(R)) : rn = null;
      };
      rn = requestAnimationFrame(R);
    }, Dr = () => {
      if (l.value !== "resource") {
        Yt.value = /* @__PURE__ */ new Map(), zt.value = /* @__PURE__ */ new Map(), gr.value = "visible", ft.value = /* @__PURE__ */ new Map(), On();
        return;
      }
      const { startDate: R, endDate: z } = Ja.value, ge = le.value === Ue.HOUR, Ce = le.value, xe = Ce === Ue.HOUR || Ce === Ue.DAY || Ce === Ue.WEEK;
      let Se, Ne;
      if (xe) {
        const wt = Zn.value, $t = Xr.value, Le = ve.value.startDate.getTime();
        let Et = 0;
        Ce === Ue.HOUR ? Et = Qe.value.hour.cellWidth / (3600 * 1e3) : Ce === Ue.DAY ? Et = Qe.value.day.cellWidth / (1440 * 60 * 1e3) : Ce === Ue.WEEK && (Et = Qe.value.week.cellWidth / (10080 * 60 * 1e3));
        const Lr = $t * 0.1, Rr = Math.max(0, wt - Lr), Sr = wt + $t + Lr;
        Se = Le + Rr / Et, Ne = Le + Sr / Et;
      } else
        Se = R.getTime(), Ne = z.getTime();
      const Me = /* @__PURE__ */ new Map(), Ke = /* @__PURE__ */ new Map(), Bt = new Map(ft.value), bt = /* @__PURE__ */ new Map(), qe = Date.now();
      OA.value.forEach(({ resource: wt }) => {
        const $t = wt.id, Le = wt.tasks || [], Et = ge ? Le : Le.filter((Rr) => {
          if (!Rr.startDate || !Rr.endDate)
            return !1;
          const Sr = new Date(Rr.startDate).getTime();
          return new Date(Rr.endDate).getTime() >= Se && Sr <= Ne;
        });
        Le.forEach((Rr, Sr) => {
          const Mn = Rr.id ?? `idx-${Sr}`, wn = `${$t}-${Mn}`, Ba = Bt.get(wn), FA = (Ba == null ? void 0 : Ba.rendered) || !1;
          bt.set(wn, {
            taskId: Mn,
            resourceId: $t,
            rendered: FA,
            timestamp: FA && Ba ? Ba.timestamp : qe
          });
        }), Me.set($t, {
          tasks: Et,
          // 只保留可见任务,不包含 backgroundTasks
          visibleCount: Et.length,
          totalCount: Et.length,
          // totalCount = visibleCount,禁用 background 阶段
          originalTasks: Le
        });
        const Xt = zt.value.get($t);
        let Lr;
        Xt !== void 0 && Xt >= Et.length ? Lr = Math.min(Xt, Et.length) : Lr = Math.min(Nm, Et.length), Ke.set($t, Lr);
      }), Yt.value = Me, zt.value = Ke, gr.value = "visible", ft.value = bt, hs();
    };
    Gt(
      () => [l.value, le.value, Ja.value, OA.value],
      () => Dr(),
      { immediate: !0 }
    ), Gt(
      () => zt.value,
      (R) => {
        if (l.value !== "resource") return;
        const z = new Map(ft.value), ge = Date.now();
        let Ce = 0;
        Yt.value.forEach((xe, Se) => {
          const Ne = R.get(Se) || 0;
          xe.tasks.slice(0, Ne).forEach((Ke, Bt) => {
            const bt = Ke.id ?? `idx-${Bt}`, qe = `${Se}-${bt}`, wt = z.get(qe);
            wt && !wt.rendered && (wt.rendered = !0, wt.timestamp = ge, Ce++);
          });
        }), Ce > 0 && (ft.value = z);
      },
      { deep: !1 }
    );
    const Pi = ce(() => {
      if (l.value !== "resource")
        return [];
      const { startDate: R, endDate: z } = Ja.value, ge = le.value === Ue.HOUR;
      let Ce = 0, xe = 0;
      return OA.value.map(({ resource: Ne, originalIndex: Me }) => {
        const Ke = Ne.tasks || [];
        Ce += Ke.length;
        const Bt = Yt.value.get(Ne.id), bt = zt.value.get(Ne.id);
        let qe;
        if (Bt) {
          const wt = bt ?? Bt.visibleCount;
          qe = Bt.tasks.slice(0, wt);
        } else
          qe = ge ? Ke : Ke.filter((wt) => {
            if (!wt.startDate || !wt.endDate)
              return !1;
            const $t = new Date(wt.startDate);
            return new Date(wt.endDate) >= R && $t <= z;
          });
        return xe += qe.length, {
          resource: {
            ...Ne,
            tasks: qe,
            // 保留原始完整的任务列表(用于GanttConflicts冲突检测)
            allTasks: Ke
          },
          originalIndex: Me
        };
      });
    }), Xs = (R, z) => {
      let ge = null;
      return ((...Ce) => {
        const xe = () => {
          ge = null, R(...Ce);
        };
        ge && clearTimeout(ge), ge = window.setTimeout(xe, z);
      });
    }, bi = Xs(() => {
      ct();
    }, 200), Os = Xs(() => {
      EA();
    }, 200), ye = () => {
      const R = le.value, z = ve.value.startDate.getTime(), ge = ve.value.endDate.getTime(), Ce = `${R}-${z}-${ge}`, xe = Hr.get(Ce);
      if (xe && Date.now() - xe.timestamp < GS)
        return xe.data;
      let Se;
      if (R === Ue.HOUR ? Se = he() : R === Ue.WEEK ? Se = Fe() : R === Ue.MONTH ? Se = cc() : R === Ue.QUARTER ? Se = dc() : R === Ue.YEAR ? Se = ou() : Se = Qr(), Hr.set(Ce, {
        data: Se,
        timestamp: Date.now(),
        scale: R
      }), Hr.size > zS) {
        let Ne = null, Me = Date.now();
        Hr.forEach((Ke, Bt) => {
          Ke.timestamp < Me && (Me = Ke.timestamp, Ne = Bt);
        }), Ne && Hr.delete(Ne);
      }
      return Se;
    }, Re = ce(() => {
      const R = ye();
      if (le.value === Ue.HOUR && Array.isArray(R)) {
        const { startHour: z, endHour: ge } = vA.value, Ce = [], xe = new Date(ve.value.startDate);
        xe.setHours(0, 0, 0, 0);
        const Se = xe.getTime(), Ne = 1e3 * 60 * 60 * 24;
        for (const Me of R) {
          const Ke = new Date(Me.year, Me.month - 1, Me.day);
          Ke.setHours(0, 0, 0, 0);
          const bt = Math.floor((Ke.getTime() - Se) / Ne) * 24, qe = Math.max(0, z - bt), wt = Math.min(Me.hours.length, ge - bt);
          qe < wt && Ce.push({
            ...Me,
            hours: Me.hours.slice(qe, wt),
            hourOffset: bt + qe,
            visibleHourStart: qe,
            _debug: {
              totalHourOffset: bt,
              dayStartHour: qe,
              dayEndHour: wt,
              visibleRange: { startHour: z, endHour: ge }
            }
          });
        }
        return Ce;
      }
      return R;
    }), at = ce(() => {
      var Ce, xe;
      const R = ye();
      if (!Array.isArray(R)) return 0;
      const z = le.value;
      if (z === Ue.HOUR) {
        let Se = 0;
        for (const Ne of R)
          Se += Ne.hours.length;
        return Se * Qe.value.hour.cellWidth;
      }
      if (z === Ue.QUARTER) {
        let Se = 0;
        for (const Ne of R)
          Se += Ne.quarters.length;
        return Se * Qe.value.quarter.cellWidth;
      }
      if (z === Ue.WEEK) {
        let Se = 0;
        for (const Ne of R)
          Se += ((Ce = Ne.weeks) == null ? void 0 : Ce.length) || 0;
        return Se * Qe.value.week.cellWidth;
      }
      if (z === Ue.MONTH)
        return R.length * Qe.value.month.cellWidth;
      if (z === Ue.YEAR)
        return R.length * Qe.value.year.cellWidth * 2;
      let ge = 0;
      for (const Se of R)
        ge += ((xe = Se.days) == null ? void 0 : xe.length) || 0;
      return ge * Qe.value.day.cellWidth;
    });
    let $e = null, Tt = null, Lt = null;
    const ut = me(/* @__PURE__ */ new Map()), ct = () => {
      const R = /* @__PURE__ */ new Map(), z = ve.value.startDate.getTime(), ge = Zn.value, Ce = ge + Xr.value;
      for (const xe of De.value)
        if (xe.type === "milestone-group" && xe.children)
          for (const Se of xe.children) {
            const Ne = new Date(Se.startDate || "");
            if (!isNaN(Ne.getTime())) {
              const Ke = Math.floor(
                (Ne.getTime() - z) / 864e5
              ) * Qe.value.day.cellWidth + Qe.value.day.cellWidth / 2 - 12, Bt = Ke - 12, bt = Ke + 12;
              let qe = !1, wt = "none";
              bt <= ge + 12 ? (qe = !0, wt = "left") : Bt >= Ce - 12 && (qe = !0, wt = "right"), R.set(Se.id, {
                left: Ke,
                originalLeft: Ke,
                isSticky: qe,
                stickyPosition: wt
              });
            }
          }
        else if (xe.type === "milestone") {
          const Se = new Date(xe.startDate || "");
          if (!isNaN(Se.getTime())) {
            const Ne = (Se.getTime() - z) / 864e5, Ke = Math.floor(Ne) * ot.value + ot.value / 2 - 12, Bt = Ke - 12, bt = Ke + 12;
            let qe = !1, wt = "none";
            bt <= ge + 12 ? (qe = !0, wt = "left") : Bt >= Ce - 12 && (qe = !0, wt = "right"), R.set(xe.id, {
              left: Ke,
              originalLeft: Ke,
              isSticky: qe,
              stickyPosition: wt
            });
          }
        }
      ut.value = R;
    }, Ut = (R) => {
      const z = [];
      return ut.value.forEach((ge, Ce) => {
        Ce !== R && z.push({
          id: Ce,
          left: ge.left,
          originalLeft: ge.originalLeft,
          // 使用保存的原始位置
          isSticky: ge.isSticky,
          stickyPosition: ge.stickyPosition,
          priority: ge.originalLeft
          // 使用原始位置作为优先级
        });
      }), z;
    };
    Gt(y, (R) => {
      if (!R) {
        if (ze.value) {
          const z = ze.value.clientWidth;
          Math.abs(z - Xr.value) > 1 && (wa = !0, Xr.value = z, An(() => {
            wa = !1;
          }));
        }
        if (Ua.value) {
          const z = Ua.value.clientHeight;
          Math.abs(z - Y.value) > 1 && (Y.value = z);
        }
        bn.value = !0, setTimeout(() => {
          bn.value = !1;
        }, 300);
      }
    });
    const _t = () => {
    }, Zt = () => {
    };
    Gt(m, (R) => {
      if (!R && ze.value) {
        const z = ze.value.clientWidth;
        Math.abs(z - Xr.value) > 1 && (wa = !0, Xr.value = z, An(() => {
          wa = !1;
        }));
      }
    });
    const fr = () => {
      bn.value = !0, wr.value = {}, h.value++, an = null, Ea && clearTimeout(Ea), Ea = setTimeout(() => {
        bn.value = !1, Ea = null, EA();
      }, 300);
    }, or = (R) => {
      sa.value || yA.value || (ke.value = R, window.dispatchEvent(
        new CustomEvent("timeline-task-hover", {
          detail: R
        })
      ));
    }, ar = ce(() => {
      if (l.value === "resource") {
        const ge = u.value;
        let Ce = 0;
        return ge.forEach((xe) => {
          const Se = T.value.get(xe.id);
          Ce += (Se == null ? void 0 : Se.totalHeight) || D.value;
        }), Math.max(Ce, 400, Y.value);
      }
      const z = B.value.totalHeight;
      return Math.max(z, 400, Y.value);
    }), Or = (R) => {
      yA.value || (ke.value = R.detail);
    }, Kr = (R) => {
      const z = R.detail;
      Pr(z);
    }, sr = () => {
      ae.value = Pn();
    }, Er = (R) => {
      Xe.value || a("milestone-double-click", R);
    }, nn = (R) => {
      r.onMilestoneSave && typeof r.onMilestoneSave == "function" && r.onMilestoneSave(R), window.dispatchEvent(
        new CustomEvent("milestone-data-updated", {
          detail: { milestone: R }
        })
      );
    }, Pn = () => ye(), Ur = () => {
      Hr.clear();
    }, Qr = () => {
      const R = [], z = new Date(ve.value.startDate);
      for (; z <= ve.value.endDate; ) {
        const ge = z.getFullYear(), Ce = z.getMonth() + 1, xe = [], Se = new Date(ge, Ce, 0).getDate();
        for (let Ne = 1; Ne <= Se; Ne++) {
          const Me = new Date(ge, Ce - 1, Ne), Ke = Me.getDay(), Bt = Ke === 0 || Ke === 6;
          xe.push({
            day: Ne,
            date: Me,
            label: String(Ne).padStart(2, "0"),
            isToday: j(Me),
            isWeekend: Bt
          });
        }
        R.push({
          year: ge,
          month: Ce,
          yearMonthLabel: A(ge, Ce),
          startDate: new Date(z),
          endDate: new Date(ge, Ce, 0),
          days: xe
        }), z.setMonth(z.getMonth() + 1);
      }
      return R;
    }, P = (R, z) => {
      if (z === 0 || z === 6)
        return !1;
      const ge = r.workingHours;
      if (!ge) return !1;
      if (ge.morning) {
        const { start: Ce, end: xe } = ge.morning;
        if (R >= Ce && R <= xe)
          return !0;
      }
      if (ge.afternoon) {
        const { start: Ce, end: xe } = ge.afternoon;
        if (R >= Ce && R <= xe)
          return !0;
      }
      return !1;
    }, he = () => {
      const R = [], z = new Date(ve.value.startDate);
      for (; z <= ve.value.endDate; ) {
        const ge = z.getFullYear(), Ce = z.getMonth() + 1, xe = z.getDate(), Se = [], Ne = z.getDay();
        for (let Me = 0; Me < 24; Me++) {
          const Ke = new Date(ge, Ce - 1, xe, Me);
          Se.push({
            hour: Me,
            label: `${String(Me).padStart(2, "0")}:00`,
            shortLabel: String(Me).padStart(2, "0"),
            // 简化显示格式,只显示小时数
            date: Ke,
            isToday: j(Ke) && Me === (/* @__PURE__ */ new Date()).getHours(),
            isWorkingHour: P(Me, Ne),
            // 判断是否为工作时间
            isWeekend: Ne === 0 || Ne === 6
            // 是否为周末
          });
        }
        R.push({
          year: ge,
          month: Ce,
          day: xe,
          date: new Date(z),
          dateLabel: `${ge}/${String(Ce).padStart(2, "0")}/${String(xe).padStart(2, "0")}`,
          isToday: j(z),
          hours: Se
        }), z.setDate(z.getDate() + 1);
      }
      return R;
    }, Fe = () => {
      const R = [], z = new Date(ve.value.startDate), ge = new Date(ve.value.endDate), Ce = new Date(z), xe = Ce.getDay() || 7;
      Ce.setDate(Ce.getDate() - (xe - 1));
      const Se = new Date(Ce);
      for (; Se <= ge; ) {
        const Ke = new Date(Se);
        Ke.setDate(Ke.getDate() + 6), R.push({
          weekStart: new Date(Se),
          weekEnd: new Date(Ke),
          label: `${Se.getDate()}`,
          isToday: lt(Se, Ke),
          subDays: tt(Se),
          // 根据周一所在月份归属
          belongsToYear: Se.getFullYear(),
          belongsToMonth: Se.getMonth() + 1
        }), Se.setDate(Se.getDate() + 7);
      }
      const Ne = /* @__PURE__ */ new Map();
      for (const Ke of R) {
        const Bt = Ke, bt = Bt.belongsToYear, qe = Bt.belongsToMonth, wt = `${bt}-${qe}`;
        Ne.has(wt) || Ne.set(wt, {
          year: bt,
          month: qe,
          yearMonthLabel: A(bt, qe),
          startDate: new Date(bt, qe - 1, 1),
          endDate: new Date(bt, qe, 0),
          weeks: [],
          isWeekView: !0
        }), Ne.get(wt).weeks.push(Ke);
      }
      return Array.from(Ne.values()).sort((Ke, Bt) => Ke.year !== Bt.year ? Ke.year - Bt.year : Ke.month - Bt.month);
    }, tt = (R) => {
      const z = [];
      for (let ge = 0; ge < 7; ge++) {
        const Ce = new Date(R);
        Ce.setDate(Ce.getDate() + ge), z.push({
          date: new Date(Ce),
          dayOfWeek: Ce.getDay()
        });
      }
      return z;
    }, lt = (R, z) => {
      const ge = /* @__PURE__ */ new Date();
      return ge.setHours(0, 0, 0, 0), ge >= R && ge <= z;
    }, v = (R, z) => {
      let ge = 0;
      for (let Ce = 0; Ce < R; Ce++) {
        const xe = ae.value[Ce];
        xe && xe.isWeekView && xe.weeks ? ge += xe.weeks.length * Qe.value.week.cellWidth : xe && xe.days && (ge += xe.days.length * Qe.value.day.cellWidth);
      }
      return ge += z * Qe.value.week.cellWidth, ge;
    }, L = (R) => {
      if (Ql.start(`updateTimeScale-${R}`), le.value = R, gA.value = !0, Ur(), R === Ue.HOUR) {
        const z = Ct();
        pe = !0, ve.value = {
          ...ve.value,
          startDate: z.startDate,
          endDate: z.endDate
        }, pe = !1;
      } else if (R === Ue.DAY) {
        const z = Ve();
        pe = !0, ve.value = {
          ...ve.value,
          startDate: z.startDate,
          endDate: z.endDate
        }, pe = !1;
      }
      if (R === Ue.WEEK) {
        const z = ht();
        pe = !0, ve.value = {
          ...ve.value,
          startDate: z.startDate,
          endDate: z.endDate
        }, pe = !1;
      }
      if (R === Ue.MONTH) {
        const z = K();
        pe = !0, ve.value = {
          ...ve.value,
          startDate: z.startDate,
          endDate: z.endDate
        }, pe = !1;
      }
      if (R === Ue.QUARTER) {
        const z = X();
        pe = !0, ve.value = {
          ...ve.value,
          startDate: z.startDate,
          endDate: z.endDate
        }, pe = !1;
      }
      if (R === Ue.YEAR) {
        const z = X();
        pe = !0, ve.value = {
          ...ve.value,
          startDate: z.startDate,
          endDate: z.endDate
        }, pe = !1;
      }
      ae.value = Pn(), An(() => {
        a("timeline-scale-changed", R), window.dispatchEvent(new CustomEvent("timeline-scale-updated")), setTimeout(() => {
          window.dispatchEvent(new CustomEvent("timeline-force-recalculate")), setTimeout(() => {
            mt(), Ql.end(`updateTimeScale-${R}`), Ql.report();
          }, 100);
        }, 50);
      });
    }, j = (R) => {
      const z = /* @__PURE__ */ new Date();
      return R.getDate() === z.getDate() && R.getMonth() === z.getMonth() && R.getFullYear() === z.getFullYear();
    }, ae = fi(Pn());
    let pe = !1;
    Gt(
      () => [ve.value.startDate, ve.value.endDate],
      () => {
        pe || (Ur(), ae.value = Pn());
      }
    ), Gt(
      [ae, le],
      ([R, z]) => {
        if (R && z) {
          const ge = Object.fromEntries(
            Object.entries(Qe.value).map(([Ce, xe]) => [Ce, xe.cellWidth])
          );
          Ff.buildCache(R, z, ge);
        }
      },
      { immediate: !0 }
      // 立即执行,确保初始化时也构建缓存
    );
    let Oe = !1, Pe = null;
    Gt(
      () => [ae.value, ve.value.startDate, ve.value.endDate],
      () => {
        Oe || (Pe && clearTimeout(Pe), Pe = setTimeout(() => {
          Pe = null, !Oe && (Oe = !0, An(() => {
            mt();
          }));
        }, 120));
      }
      // 优化:移除 deep: true,因为监听的是基础类型(startDate/endDate)和 shallowRef(timelineData)
      // 不需要深度监听,可减少 90% 的监听开销
    );
    const mt = (R = 0) => {
      bn.value = !0, ya.value = !0;
      const z = /* @__PURE__ */ new Date(), ge = ve.value.startDate, Ce = new Date(z.getFullYear(), z.getMonth(), z.getDate());
      let xe;
      if (le.value === Ue.YEAR || le.value === Ue.QUARTER) {
        const qe = X();
        xe = new Date(
          qe.startDate.getFullYear(),
          qe.startDate.getMonth(),
          qe.startDate.getDate()
        );
      } else if (le.value === Ue.MONTH) {
        const qe = K();
        xe = new Date(
          qe.startDate.getFullYear(),
          qe.startDate.getMonth(),
          qe.startDate.getDate()
        );
      } else
        xe = new Date(
          ge.getFullYear(),
          ge.getMonth(),
          ge.getDate()
        );
      const Se = Ce.getTime() - xe.getTime(), Ne = Math.floor(Se / (1e3 * 60 * 60 * 24));
      let Me;
      if (le.value === Ue.HOUR) {
        const qe = z.getHours(), wt = z.getMinutes(), $t = Ne * ot.value, Le = qe * Qe.value.hour.cellWidth, Et = wt / 60 * Qe.value.hour.cellWidth;
        Me = $t + Le + Et;
      } else if (le.value === Ue.QUARTER) {
        const qe = Ce.getFullYear(), wt = xe.getFullYear(), $t = Qe.value.quarter.cellWidth, Le = $t * 4;
        Me = (qe - wt) * Le;
        const Xt = Ce.getMonth() + 1;
        let Lr = 1;
        Xt >= 1 && Xt <= 3 || (Xt >= 4 && Xt <= 6 ? Lr = 2 : Xt >= 7 && Xt <= 9 ? Lr = 3 : Lr = 4), Me += (Lr - 1) * $t;
        let Rr, Sr;
        Lr === 1 ? (Rr = new Date(qe, 0, 1), Sr = new Date(qe, 2, 31)) : Lr === 2 ? (Rr = new Date(qe, 3, 1), Sr = new Date(qe, 5, 30)) : Lr === 3 ? (Rr = new Date(qe, 6, 1), Sr = new Date(qe, 8, 30)) : (Rr = new Date(qe, 9, 1), Sr = new Date(qe, 11, 31));
        const Mn = Math.floor(
          (Ce.getTime() - Rr.getTime()) / (1e3 * 60 * 60 * 24)
        ), wn = Math.floor((Sr.getTime() - Rr.getTime()) / (1e3 * 60 * 60 * 24)) + 1, Ba = Mn / wn * $t;
        Me += Ba;
      } else if (le.value === Ue.MONTH) {
        const qe = Ce.getFullYear(), wt = Ce.getMonth() + 1, $t = xe.getFullYear(), Le = xe.getMonth() + 1, Et = (qe - $t) * 12 + (wt - Le), Xt = Qe.value.month.cellWidth;
        Me = Et * Xt;
        const Lr = Ce.getDate(), Rr = new Date(qe, wt, 0).getDate(), Sr = Lr / Rr * Xt;
        Me += Sr;
      } else if (le.value === Ue.YEAR) {
        const qe = ae.value;
        let wt = 0;
        const $t = Qe.value.year.cellWidth;
        let Le = !1;
        for (const Et of qe) {
          const Xt = Et.halfYears || [];
          for (const Lr of Xt) {
            const Rr = new Date(Lr.startDate), Sr = new Date(Lr.endDate);
            if (Rr.setHours(0, 0, 0, 0), Sr.setHours(0, 0, 0, 0), Ce < Rr) {
              Le = !0;
              break;
            }
            if (Ce >= Rr && Ce <= Sr) {
              const Mn = Sr.getTime() - Rr.getTime(), Ba = (Ce.getTime() - Rr.getTime()) / Mn;
              wt += Ba * $t, Le = !0;
              break;
            }
            wt += $t;
          }
          if (Le) break;
        }
        Me = wt;
      } else
        Me = Ne * ot.value;
      const Ke = ze.value;
      if (!Ke) {
        R < 10 && setTimeout(() => mt(R + 1), 60);
        return;
      }
      const Bt = Ke.clientWidth;
      if (Bt === 0 && R < 10) {
        setTimeout(() => mt(R + 1), 60);
        return;
      }
      const bt = Me - Bt / 2 + 15;
      typeof Ke.scrollTo == "function" ? Ke.scrollTo({ left: Math.max(0, bt), behavior: "smooth" }) : Ke.scrollLeft = Math.max(0, bt), setTimeout(() => {
        ya.value = !1, le.value === Ue.HOUR && (gA.value = !1), setTimeout(() => {
          bn.value = !1;
        }, 300);
      }, 1500);
    }, Qt = ce(() => {
      if (le.value !== Ue.YEAR)
        return -1;
      const R = /* @__PURE__ */ new Date();
      R.setHours(0, 0, 0, 0);
      const z = ae.value;
      if (!z || z.length === 0)
        return -1;
      let ge = 0;
      const Ce = Qe.value.year.cellWidth;
      for (const xe of z) {
        const Se = xe.halfYears || [];
        for (const Ne of Se) {
          const Me = new Date(Ne.startDate), Ke = new Date(Ne.endDate);
          if (Me.setHours(0, 0, 0, 0), Ke.setHours(0, 0, 0, 0), R < Me)
            return ge;
          if (R >= Me && R <= Ke) {
            const Bt = Ke.getTime() - Me.getTime(), qe = (R.getTime() - Me.getTime()) / Bt;
            return ge + qe * Ce;
          }
          ge += Ce;
        }
      }
      return ge;
    }), Rt = ce(() => {
      if (le.value !== Ue.YEAR)
        return !1;
      const R = /* @__PURE__ */ new Date(), z = new Date(R.getFullYear(), R.getMonth(), R.getDate()), ge = X(), Ce = ge.startDate, xe = ge.endDate;
      return z >= Ce && z <= xe;
    }), cr = () => {
      if (De.value.length === 0) {
        dr();
        return;
      }
      const R = [];
      for (const bt of De.value)
        bt.startDate && R.push(new Date(bt.startDate));
      if (R.length === 0) {
        dr();
        return;
      }
      let z = 1 / 0;
      for (const bt of R) {
        const qe = bt.getTime();
        qe < z && (z = qe);
      }
      const ge = new Date(z), Ce = ge.getFullYear(), xe = ge.getMonth(), Se = ge.getDate();
      let Ne = 0;
      for (let bt = 0; bt < xe; bt++)
        Ne += new Date(Ce, bt + 1, 0).getDate();
      Ne += Se;
      const Me = nt.value, Ke = Me == null ? void 0 : Me.clientWidth, Bt = (Ne - 1) * 30 - (Ke ? Ke / 2 : 200);
      ze.value && (ze.value.scrollLeft = Math.max(0, Bt));
    }, dr = () => {
      const R = /* @__PURE__ */ new Date(), z = ve.value.startDate, ge = new Date(R.getFullYear(), R.getMonth(), R.getDate()), Ce = new Date(
        z.getFullYear(),
        z.getMonth(),
        z.getDate()
      ), xe = ge.getTime() - Ce.getTime(), Se = Math.floor(xe / (1e3 * 60 * 60 * 24));
      if (Se < 0 || ge > ve.value.endDate)
        return;
      const Ne = Se * 30, Me = ze.value;
      if (!Me) return;
      const Ke = Me.clientWidth, Bt = Ne - Ke / 2 + 15;
      Me.scrollTo({
        left: Math.max(0, Bt),
        behavior: "smooth"
      }), setTimeout(() => {
        const bt = document.querySelectorAll(".day-column.today");
        for (const qe of bt)
          qe.classList.add("today-highlight"), setTimeout(() => {
            qe.classList.remove("today-highlight");
          }, 2e3);
      }, 500);
    }, qr = (R) => {
      const z = typeof R == "string" ? new Date(R) : R, ge = ve.value.startDate, Ce = new Date(
        z.getFullYear(),
        z.getMonth(),
        z.getDate()
      );
      let xe;
      if (le.value === Ue.YEAR || le.value === Ue.QUARTER) {
        const qe = X();
        xe = new Date(
          qe.startDate.getFullYear(),
          qe.startDate.getMonth(),
          qe.startDate.getDate()
        );
      } else if (le.value === Ue.MONTH) {
        const qe = K();
        xe = new Date(
          qe.startDate.getFullYear(),
          qe.startDate.getMonth(),
          qe.startDate.getDate()
        );
      } else
        xe = new Date(
          ge.getFullYear(),
          ge.getMonth(),
          ge.getDate()
        );
      const Se = Ce.getTime() - xe.getTime(), Ne = Math.floor(Se / (1e3 * 60 * 60 * 24));
      let Me;
      if (le.value === Ue.HOUR) {
        const qe = z.getHours(), wt = z.getMinutes(), $t = Ne * ot.value, Le = qe * Qe.value.hour.cellWidth, Et = wt / 60 * Qe.value.hour.cellWidth;
        Me = $t + Le + Et;
      } else if (le.value === Ue.QUARTER) {
        const qe = Ce.getFullYear(), wt = xe.getFullYear(), $t = Qe.value.quarter.cellWidth, Le = $t * 4;
        Me = (qe - wt) * Le;
        const Xt = Math.floor(Ce.getMonth() / 3);
        Me += Xt * $t;
        const Lr = Xt * 3, Rr = new Date(qe, Lr, 1), Sr = Math.floor(
          (Ce.getTime() - Rr.getTime()) / (1e3 * 60 * 60 * 24)
        );
        Me += Sr / 91 * $t;
      } else if (le.value === Ue.YEAR) {
        const qe = Ce.getFullYear(), wt = xe.getFullYear(), $t = Qe.value.year.cellWidth * 2;
        Me = (qe - wt) * $t;
        const Et = new Date(qe, 0, 1), Xt = Math.floor(
          (Ce.getTime() - Et.getTime()) / (1e3 * 60 * 60 * 24)
        );
        Me += Xt / 365 * $t;
      } else if (le.value === Ue.MONTH) {
        const qe = Ce.getFullYear(), wt = Ce.getMonth(), $t = xe.getFullYear(), Le = xe.getMonth(), Et = Qe.value.month.cellWidth;
        Me = ((qe - $t) * 12 + (wt - Le)) * Et;
        const Lr = Ce.getDate(), Rr = new Date(qe, wt + 1, 0).getDate();
        Me += Lr / Rr * Et;
      } else if (le.value === Ue.WEEK) {
        const qe = Qe.value.week.cellWidth;
        Me = Ne / 7 * qe;
      } else
        Me = Ne * ot.value;
      const Ke = ze.value;
      if (!Ke) return;
      const Bt = Ke.clientWidth, bt = Me - Bt / 2;
      Ke.scrollTo({
        left: Math.max(0, bt),
        behavior: "smooth"
      });
    }, _r = (R) => {
      Ql.start("updateTask"), window.dispatchEvent(
        new CustomEvent("task-updated", {
          detail: R
        })
      ), Ql.end("updateTask");
    }, Pr = (R) => {
      Xe.value || a("edit-task", R);
    }, un = (R, z) => {
      Xe.value || a("click-task", R, z);
    }, wr = fi({}), Wr = fi({});
    let mn = null, eA = null, tA = 0, jr = !1, cn = "", ta = 30, Oa = null;
    function mA() {
      mn !== null && (typeof cancelIdleCallback < "u" ? cancelIdleCallback(mn) : cancelAnimationFrame(mn), mn = null), eA = null;
    }
    function rA(R) {
      const z = eA;
      if (!z) return;
      const ge = cn, Ce = ta, xe = Oa, Se = {}, Ne = Date.now();
      for (; tA < z.length && !(R ? R.timeRemaining() < 1 : Date.now() - Ne > 4); ) {
        const Me = z[tA];
        if (!jr && Wr.value[Me.id]) {
          tA++;
          continue;
        }
        const Ke = B.value, Bt = Ke.cumulativeHeights[tA] || 0, bt = Ke.taskHeights.get(Me.id) ?? D.value, qe = KE(
          Me,
          Bt,
          ge,
          Ff,
          Ce,
          xe,
          bt
        );
        qe && (Se[Me.id] = qe), tA++;
      }
      Object.keys(Se).length > 0 && (Wr.value = { ...Se, ...Wr.value }), tA < z.length ? typeof requestIdleCallback < "u" ? mn = requestIdleCallback(rA, { timeout: 1e3 }) : mn = requestAnimationFrame(() => rA()) : (eA = null, mn = null);
    }
    function Sa(R) {
      mA(), !(De.value.length === 0 || l.value !== "task") && (eA = [...De.value], tA = 0, jr = R, cn = le.value, ta = ot.value, Oa = ie.value, typeof requestIdleCallback < "u" ? mn = requestIdleCallback(rA, { timeout: 1e3 }) : mn = requestAnimationFrame(() => rA()));
    }
    const Pa = me(null), lA = me(null), Wi = me(0), gs = me(0), Fa = me(0), uo = me(0), Ci = me(0), co = me(0);
    function vs() {
      const R = Math.max(Xr.value, 300), z = Math.max(Y.value, 300);
      return {
        width: Math.min(Math.max(R * 3, 2e3), 8e3),
        height: Math.min(Math.max(z * 3, 1200), 4e3)
      };
    }
    function EA() {
      if (Pa.value) {
        const R = Pa.value.offsetWidth, z = ar.value, ge = Zn.value, Ce = q.value, { width: xe, height: Se } = vs();
        Fa.value = xe;
        const Ne = xe / 3;
        let Me = Math.max(0, ge - Ne);
        if (R <= xe)
          Me = 0;
        else {
          const qe = R - xe;
          Me = Math.min(Me, qe);
        }
        Ci.value = Me;
        const Ke = Math.min(z, Se);
        uo.value = Ke, Wi.value = Fa.value, gs.value = Ke;
        const Bt = Ke / 3;
        let bt = Math.max(0, Ce - Bt);
        if (z <= Ke)
          bt = 0;
        else {
          const qe = z - Ke;
          bt = Math.min(bt, qe);
        }
        co.value = bt;
      }
    }
    const PA = {};
    let Js = !1;
    function ki(R) {
      if (!Pa.value) return;
      (!an || $r) && (an = Pa.value.getBoundingClientRect(), xn = Date.now(), $r = !1);
      const z = an;
      if (PA[R.id] = {
        left: R.left - z.left,
        top: R.top - z.top,
        width: R.width,
        height: R.height
      }, !Js) {
        if (W.value) return;
        Js = !0, Promise.resolve().then(() => {
          Js = !1, wr.value = { ...wr.value, ...PA }, Wr.value = { ...Wr.value, ...PA };
          for (const ge in PA)
            delete PA[ge];
          setTimeout(() => EA(), 200);
        });
      }
    }
    Gt(W, (R) => {
      if (!R && Object.keys(PA).length !== 0) {
        Js = !1, wr.value = { ...wr.value, ...PA }, Wr.value = { ...Wr.value, ...PA };
        for (const z in PA)
          delete PA[z];
        setTimeout(() => EA(), 200);
      }
    });
    const fo = (R) => {
      if (l.value === "resource" && u.value) {
        for (const z of u.value)
          if (z.tasks) {
            const ge = z.tasks.findIndex((Ce) => Ce.id === R.id);
            if (ge !== -1) {
              z.tasks[ge] = { ...z.tasks[ge], ...R };
              break;
            }
          }
      }
      w.value = R.id, window.dispatchEvent(new CustomEvent("taskbar-drag-end", { detail: R }));
    }, wA = (R) => {
      if (l.value === "resource" && u.value) {
        for (const z of u.value)
          if (z.tasks) {
            const ge = z.tasks.findIndex((Ce) => Ce.id === R.id);
            if (ge !== -1) {
              z.tasks[ge] = { ...z.tasks[ge], ...R };
              break;
            }
          }
      }
      w.value = R.id, window.dispatchEvent(new CustomEvent("taskbar-resize-end", { detail: R }));
    }, SA = (R) => {
      window.dispatchEvent(
        new CustomEvent("context-menu", {
          detail: R
        })
      );
    }, Ki = (R) => {
      if (Jr.value) {
        bn.value = !0;
        const z = Jr.value.scrollWidth - Jr.value.clientWidth, ge = Math.max(0, Math.min(R, z));
        Jr.value.scrollTo({
          left: ge,
          behavior: "smooth"
        }), setTimeout(() => {
          bn.value = !1;
        }, 1e3);
      }
    }, Zs = (R) => {
      window.dispatchEvent(new CustomEvent("milestone-drag-end", { detail: R }));
    };
    sA(() => {
      An(() => {
        setTimeout(() => {
          mt();
        }, 60);
      }), window.addEventListener("task-row-double-click", Kr), window.addEventListener("task-list-hover", Or), window.addEventListener(
        "task-list-vertical-scroll",
        ei
      ), window.addEventListener("locale-changed", sr), window.addEventListener("splitter-drag-start", _t), window.addEventListener("splitter-drag-end", Zt), window.addEventListener(
        "timeline-container-resized",
        fr
      ), window.addEventListener("milestone-click-locate", iu), window.addEventListener("drag-boundary-check", Wn), window.addEventListener("taskbar-highlighted", $i), window.addEventListener("resource-taskbar-drop", ri), An(() => {
        const R = document.querySelector(".timeline-body"), z = document.querySelector(".timeline"), ge = document.querySelector(".gantt-panel-right");
        if (Ua.value = R, ze.value = z, nt.value = ge, R && (Y.value = R.clientHeight, $e = new ResizeObserver((Ce) => {
          if (!y.value)
            for (const xe of Ce)
              Y.value = xe.contentRect.height;
        }), $e.observe(R)), z) {
          Zn.value = z.scrollLeft, Xr.value = z.clientWidth;
          const Ce = new ResizeObserver((xe) => {
            if (!y.value && !m.value)
              for (const Se of xe) {
                const Ne = Se.contentRect.width;
                Math.abs(Ne - Xr.value) > 1 && (Xr.value = Ne, bn.value = !0, Ea && clearTimeout(Ea), Ea = setTimeout(() => {
                  bn.value = !1, Ea = null;
                }, 300));
              }
          });
          Ce.observe(z), $e || ($e = Ce);
        }
      }), setTimeout(() => {
        mt(), EA();
      }, 200), Tt = () => {
        $r = !0, EA();
      }, window.addEventListener("resize", Tt), Lt = () => {
        document.visibilityState === "visible" && ($r = !0, EA());
      }, document.addEventListener("visibilitychange", Lt);
    });
    const ei = (R) => {
      const { scrollTop: z } = R.detail;
      q.value = z, Os(), Ua.value && Math.abs(Ua.value.scrollTop - z) > 1 && (G = !0, Ua.value.scrollTop = z, Promise.resolve().then(() => {
        G = !1;
      }));
    }, ho = (R) => {
      const z = R.target;
      if (!z) return;
      const ge = z.scrollTop;
      q.value = ge, $r = !0, W.value = !0, F !== null && clearTimeout(F), F = setTimeout(() => {
        F = null, W.value = !1;
      }, 150), Os(), !yA.value && (G || ge >= 0 && window.dispatchEvent(
        new CustomEvent("timeline-vertical-scroll", {
          detail: { scrollTop: ge }
        })
      ));
    };
    Gt(
      () => {
        var R;
        return (R = De.value) == null ? void 0 : R.length;
      },
      (R, z) => {
        It(), ct(), z === 0 && R > 0 && (Oe = !1, l.value === "resource" && (Da = !0), xi(50)), An(() => {
          EA();
        });
      },
      { immediate: !0 }
    ), Gt(
      De,
      (R) => {
        er.clear();
        const z = (ge) => {
          er.set(ge.id, ge), ge.children && ge.children.length > 0 && ge.children.forEach(z);
        };
        R.forEach(z);
      },
      { immediate: !0 }
    );
    const yA = me(!1);
    Tn("isDraggingTimeline", yA);
    const ca = me(0), ml = me(0), ps = me(0), ms = me(0), Jr = me(null), Ua = me(null);
    let Ds = null;
    const ti = me(!1);
    let Ps = null;
    const $i = () => {
      const R = (z) => {
        var Ce;
        if (p.value) {
          document.removeEventListener("mousemove", R);
          return;
        }
        const ge = document.elementFromPoint(z.clientX, z.clientY);
        if (ge) {
          const xe = ge.closest(".task-bar"), Se = ge.closest(".resize-handle-left, .resize-handle-right"), Ne = ge.closest(
            "button, input, select, textarea, .custom-task-content"
          );
          if (xe || Se || Ne) {
            document.removeEventListener("mousemove", R);
            return;
          }
        }
        z.buttons === 1 && (yA.value = !0, ca.value = z.pageX, ps.value = ((Ce = Jr.value) == null ? void 0 : Ce.scrollLeft) || 0, Jr.value && (Jr.value.style.cursor = "grabbing", Jr.value.style.userSelect = "none"), document.addEventListener("mousemove", Es), document.addEventListener("mouseup", ai)), document.removeEventListener("mousemove", R);
      };
      document.addEventListener("mousemove", R), setTimeout(() => {
        document.removeEventListener("mousemove", R);
      }, 5e3);
    }, ri = (R) => {
      const z = R, { task: ge, sourceRowIndex: Ce, mouseY: xe } = z.detail, Se = Ua.value;
      if (!Se) return;
      const Ne = Se.getBoundingClientRect(), Me = xe - Ne.top + Se.scrollTop, Ke = u.value;
      let Bt = -1, bt = 1 / 0;
      for (let $t = 0; $t < Ke.length; $t++) {
        const Le = Ke[$t], Et = String(Le.id), Xt = E.value.get(Et) || 0, Lr = T.value.get(Et), Rr = (Lr == null ? void 0 : Lr.totalHeight) || D.value, Sr = Xt + Rr / 2, Mn = Math.abs(Me - Sr);
        Mn < bt && (bt = Mn, Bt = $t);
      }
      Bt === -1 && Ke.length > 0 && (Me < 0 ? Bt = 0 : Bt = Ke.length - 1);
      const qe = z.detail.calculatedStartDate, wt = z.detail.calculatedEndDate;
      if (Bt !== Ce && Bt >= 0 && Bt < Ke.length) {
        const $t = Ke[Bt];
        a("resource-drag-end", {
          task: ge,
          sourceResourceIndex: Ce,
          targetResourceIndex: Bt,
          targetResource: $t,
          newStartDate: qe,
          // v1.9.0 新的开始日期
          newEndDate: wt
          // v1.9.0 新的结束日期
        });
      }
    }, ni = (R) => {
      var xe, Se;
      const z = R.target, ge = z.closest(".timeline-header"), Ce = z.closest(".timeline-body");
      if (!(!ge && !Ce)) {
        if (Ce) {
          if (z.closest(".resize-handle-left, .resize-handle-right"))
            return;
          const Me = z.closest(".task-bar");
          if (Me) {
            const Ke = Me.classList.contains("highlighted"), Bt = Me.classList.contains("primary-highlight");
            if (!Ke && !Bt)
              return;
          } else if ([
            ".milestone",
            "button",
            "input",
            "select",
            "textarea",
            ".custom-task-content",
            ".progress-bar",
            ".task-name",
            ".task-controls"
          ].some((bt) => z.closest(bt)))
            return;
        }
        yA.value = !0, ca.value = R.pageX, ml.value = R.pageY, ps.value = ((xe = Jr.value) == null ? void 0 : xe.scrollLeft) || 0, !Ua.value && Jr.value && (Ua.value = Jr.value.querySelector(
          ".timeline-body"
        )), ms.value = ((Se = Ua.value) == null ? void 0 : Se.scrollTop) || 0, Jr.value && (Jr.value.style.cursor = "grabbing", Jr.value.style.userSelect = "none"), R.preventDefault(), document.addEventListener("mousemove", Es), document.addEventListener("mouseup", ai);
      }
    }, Es = (R) => {
      !yA.value || !Jr.value || (R.preventDefault(), Ds !== null && cancelAnimationFrame(Ds), Ds = requestAnimationFrame(() => {
        if (!Jr.value) return;
        const z = R.pageX, ge = R.pageY, Ce = (z - ca.value) * 1.5, xe = (ge - ml.value) * 1.5;
        if (Jr.value.scrollLeft = ps.value - Ce, Ua.value) {
          const Se = ms.value - xe;
          Ua.value.scrollTop = Se;
          const Ne = document.querySelector(".task-list-body");
          Ne && (Ne.scrollTop = Se);
        }
        Ds = null;
      }));
    }, ai = () => {
      yA.value && (yA.value = !1, Ds !== null && (cancelAnimationFrame(Ds), Ds = null), Jr.value && (Jr.value.style.cursor = "grab", Jr.value.style.userSelect = "auto"), ke.value = null, document.removeEventListener("mousemove", Es), document.removeEventListener("mouseup", ai));
    }, BA = (R) => {
      var Ne;
      const z = R.target;
      if (!z) return;
      const ge = z.scrollLeft;
      if (Zn.value = ge, window.dispatchEvent(new CustomEvent("close-all-taskbar-menus")), $r = !0, Xr.value === 0 && (Xr.value = z.clientWidth), gA.value && ge > 0 && (gA.value = !1), Os(), yA.value) return;
      if (le.value === Ue.HOUR) {
        xa.value = !0, Bn && clearTimeout(Bn), Bn = setTimeout(() => {
          xa.value = !1;
        }, 200);
        return;
      }
      const Ce = z.scrollWidth, xe = z.clientWidth, Se = Ce - xe;
      ia.value = Se > 0 ? ge / Se : 0, rs.value = ge > 20, Jn.value = ge < Se - 20, xa.value = !0, (Ne = z.classList) == null || Ne.add("scrolling"), bi(), Bn && clearTimeout(Bn), Bn = setTimeout(() => {
        var Me;
        xa.value = !1, (Me = z.classList) == null || Me.remove("scrolling");
      }, 500);
    }, Ss = (R) => {
      if (ti.value || !Jr.value) return;
      ti.value = !0;
      const z = () => {
        if (!Jr.value || !ti.value) return;
        const ge = Jr.value.scrollLeft, Ce = Jr.value.scrollWidth - Jr.value.clientWidth;
        let xe;
        if (R === "left" ? xe = Math.max(0, ge - Om) : xe = Math.min(Ce, ge + Om), xe === ge) {
          Qn();
          return;
        }
        Jr.value.scrollLeft = xe, window.dispatchEvent(
          new CustomEvent("timeline-auto-scroll", {
            detail: { scrollDelta: xe - ge }
          })
        ), Ps = window.setTimeout(z, 16);
      };
      z();
    }, Qn = () => {
      ti.value = !1, Ps && (clearTimeout(Ps), Ps = null);
    }, Wn = (R) => {
      const { mouseX: z, mouseY: ge, isDragging: Ce, isResourceView: xe, taskId: Se, rowIndex: Ne } = R.detail;
      if (!Ce || !Jr.value) {
        Qn();
        return;
      }
      const Me = Jr.value.getBoundingClientRect(), Ke = z - Me.left;
      if (xe && ge && Ua.value) {
        const Bt = Ua.value.getBoundingClientRect(), bt = ge - Bt.top + Ua.value.scrollTop, qe = u.value;
        let wt = -1, $t = 1 / 0;
        for (let Le = 0; Le < qe.length; Le++) {
          const Et = qe[Le], Xt = String(Et.id), Lr = E.value.get(Xt) || 0, Rr = T.value.get(Xt), Sr = (Rr == null ? void 0 : Rr.totalHeight) || D.value, Mn = Lr + Sr / 2, wn = Math.abs(bt - Mn);
          wn < $t && ($t = wn, wt = Le);
        }
        wt !== -1 && wt !== Ne && window.dispatchEvent(
          new CustomEvent("resource-drag-over", {
            detail: {
              taskId: Se,
              sourceRowIndex: Ne,
              targetRowIndex: wt,
              mouseY: bt
            }
          })
        );
      }
      Ke <= Hm && Jr.value.scrollLeft > 0 ? Ss("left") : Ke >= Me.width - Hm && Jr.value.scrollLeft < Jr.value.scrollWidth - Jr.value.clientWidth ? Ss("right") : Qn();
    };
    ga(() => {
      Qn(), mA(), Ta(), window.removeEventListener("task-row-double-click", Kr), window.removeEventListener("task-list-hover", Or), window.removeEventListener(
        "task-list-vertical-scroll",
        ei
      ), window.removeEventListener("locale-changed", sr), window.removeEventListener("splitter-drag-start", _t), window.removeEventListener("splitter-drag-end", Zt), window.removeEventListener(
        "timeline-container-resized",
        fr
      ), window.removeEventListener("milestone-click-locate", iu), window.removeEventListener("drag-boundary-check", Wn), window.removeEventListener("resource-taskbar-drop", ri), $e && ($e.disconnect(), $e = null), Tt && (window.removeEventListener("resize", Tt), Tt = null), Lt && (document.removeEventListener("visibilitychange", Lt), Lt = null), document.removeEventListener("mousemove", Es), document.removeEventListener("mouseup", ai);
    });
    const da = (R, z) => {
      a("delete", R, z);
    }, La = (R) => {
      const z = De.value.find((Se) => Se.id === R.targetTaskId);
      if (!z || !z.predecessor) return;
      const Ce = $s(z.predecessor).filter((Se) => Se !== R.sourceTaskId), xe = {
        ...z,
        predecessor: Ce.length > 0 ? Ce : void 0
      };
      a("link-deleted", {
        sourceTaskId: R.sourceTaskId,
        targetTaskId: R.targetTaskId,
        updatedTask: xe
      }), _r(xe), Ur();
    }, Ai = ce(() => {
      if (le.value !== Ue.MONTH)
        return {};
      const R = {}, z = ae.value;
      for (const ge of z) {
        const xe = ge.year;
        R[xe] || (R[xe] = []), R[xe].push(ge);
      }
      return R;
    }), Wo = ce(() => {
      if (le.value !== Ue.WEEK)
        return [];
      const R = [], z = ae.value;
      for (let ge = 0; ge < z.length; ge++) {
        const Ce = z[ge];
        if (!(!Ce.isWeekView || !Ce.weeks))
          for (let xe = 0; xe < Ce.weeks.length; xe++) {
            const Ne = Ce.weeks[xe].subDays || [];
            for (let Me = 0; Me < Ne.length; Me++) {
              const Ke = Ne[Me];
              Ke.date && Ke.date.getDate() === 1 && R.push({
                left: v(ge, xe) + Me * (Qe.value.week.cellWidth / 7),
                date: Ke.date.getDate()
              });
            }
          }
      }
      return R;
    }), go = ce(() => {
      if (le.value !== Ue.WEEK)
        return [];
      const R = [], z = ae.value;
      for (let ge = 0; ge < z.length; ge++) {
        const Ce = z[ge];
        if (!(!Ce.isWeekView || !Ce.weeks))
          for (let xe = 0; xe < Ce.weeks.length; xe++) {
            const Ne = Ce.weeks[xe].subDays || [];
            for (let Me = 0; Me < Ne.length; Me++) {
              const Ke = Ne[Me];
              Ke.date && Ke.date.getDate() === 1 && R.push({
                left: v(ge, xe) + Me * (Qe.value.week.cellWidth / 7)
              });
            }
          }
      }
      return R;
    }), Ti = ce(() => {
      if (le.value !== Ue.YEAR)
        return [];
      try {
        const R = ou();
        return Array.isArray(R) ? R : [];
      } catch {
        return [];
      }
    });
    t({
      // 基础滚动功能
      scrollToTasks: cr,
      scrollToToday: dr,
      scrollToTodayCenter: mt,
      scrollToDate: qr,
      // 时间线配置
      timelineConfig: ve,
      // 时间刻度更新
      updateTimeScale: L,
      // 高亮相关
      highlightedTaskId: Je,
      clearHighlight: Ye
    });
    const au = (R) => {
      a("start-timer", R);
    }, Au = (R) => {
      a("stop-timer", R);
    }, su = (R) => {
      const z = R.startDate || R.endDate || "";
      return {
        ...R,
        type: "milestone",
        startDate: z,
        endDate: R.startDate || R.endDate
      };
    };
    let Ko = null;
    const xi = (R = 50) => {
      Ko && clearTimeout(Ko), Ko = setTimeout(() => {
        uc(), Ko = null;
      }, R);
    }, uc = () => {
      if (l.value === "resource" && !Da)
        return;
      Da = !1;
      let R = null;
      le.value === Ue.HOUR ? R = Ct() : le.value === Ue.DAY ? R = Ve() : le.value === Ue.WEEK ? R = ht() : le.value === Ue.MONTH ? R = K() : (le.value === Ue.QUARTER || le.value === Ue.YEAR) && (R = X()), R && (Ur(), pe = !0, ve.value.startDate = R.startDate, ve.value.endDate = R.endDate, pe = !1, ae.value = Pn());
    };
    Gt(
      Xr,
      (R, z) => {
        sa.value || wa || (!z || z === 0 || Math.abs(R - z) > 50) && R > 0 && xi(100);
      },
      { immediate: !0 }
    );
    let $o = null;
    Gt([ae, Xr], () => {
      sa.value || ($o && clearTimeout($o), $o = setTimeout(() => {
        $r = !0, wr.value = {}, Wr.value = {}, Sa(!0), h.value++, An(() => {
          setTimeout(() => {
            EA();
          }, 200);
        }), $o = null;
      }, 100));
    }), Gt([l, u], ([R, z], [ge, Ce]) => {
      It(), R === "task" ? (Oe = !1, xi()) : R === "resource" && (R !== ge || z !== Ce) && (Oe = !1, Da = !0, xi());
    }), Gt(
      () => De.value,
      (R) => {
        It(), $r = !0;
        const z = /* @__PURE__ */ new Set();
        for (const xe of R)
          z.add(String(xe.id));
        const ge = {};
        for (const xe in wr.value)
          z.has(xe) && (ge[xe] = wr.value[xe]);
        wr.value = ge;
        const Ce = {};
        for (const xe in Wr.value)
          z.has(xe) && (Ce[xe] = Wr.value[xe]);
        Wr.value = Ce, Sa(!1);
      }
    );
    const iu = (R) => {
      const { scrollLeft: z, smooth: ge } = R.detail, Ce = document.querySelector(".timeline"), xe = document.querySelector(".timeline-body");
      let Se = null;
      if (Ce && Ce.scrollWidth > Ce.clientWidth ? Se = Ce : xe && xe.scrollWidth > xe.clientWidth && (Se = xe), Se) {
        const Ne = Se.scrollWidth - Se.clientWidth, Me = Math.min(Math.max(0, z), Ne);
        ge ? Se.scrollTo({
          left: Me,
          behavior: "smooth"
        }) : Se.scrollLeft = Me;
      }
    }, cc = () => {
      let R, z;
      if (le.value === Ue.MONTH) {
        const Ne = K();
        R = Ne.startDate, z = Ne.endDate;
      } else
        R = new Date(ve.value.startDate), z = new Date(ve.value.endDate);
      const ge = {}, Ce = new Date(R);
      for (Ce.setDate(1); Ce <= z; ) {
        const Ne = Ce.getFullYear(), Me = Ce.getMonth() + 1, Bt = new Date(Ne, Me, 0).getDate(), bt = /* @__PURE__ */ new Date(), qe = Ne === bt.getFullYear() && Me === bt.getMonth() + 1;
        ge[Ne] || (ge[Ne] = {
          year: Ne,
          yearLabel: `${Ne}年`,
          months: []
        }), ge[Ne].months.push({
          year: Ne,
          month: Me,
          monthLabel: i(Me),
          startDate: new Date(Ne, Me - 1, 1),
          endDate: new Date(Ne, Me, 0),
          isToday: qe,
          dayCount: Bt
        }), Ce.setMonth(Ce.getMonth() + 1);
      }
      const xe = [];
      let Se = 0;
      for (const Ne of Object.values(ge))
        for (const Me of Ne.months) {
          const Ke = [];
          for (let wt = 1; wt <= Me.dayCount; wt++) {
            const $t = new Date(Me.year, Me.month - 1, wt);
            Ke.push({
              day: wt,
              date: new Date($t),
              dayOfWeek: $t.getDay(),
              isToday: j($t),
              isWeekend: $t.getDay() === 0 || $t.getDay() === 6
            });
          }
          const Bt = Qe.value.month.cellWidth, bt = Se, qe = Se + Bt;
          xe.push({
            year: Me.year,
            month: Me.month,
            yearMonthLabel: A(Me.year, Me.month),
            startDate: Me.startDate,
            endDate: Me.endDate,
            isMonthView: !0,
            monthData: {
              monthLabel: Me.monthLabel,
              isToday: Me.isToday,
              dayCount: Me.dayCount
            },
            // 添加每一天的子列数据
            subDays: Ke,
            // 为了兼容性,保留days数组,映射subDays的数据
            days: Ke.map((wt) => ({
              day: wt.day,
              date: wt.date,
              label: String(wt.day).padStart(2, "0"),
              isToday: wt.isToday,
              isWeekend: wt.isWeekend
            })),
            // 添加位置调试信息
            _debugInfo: {
              monthStartPosition: bt,
              monthEndPosition: qe,
              monthWidth: Bt
            }
          }), Se += Bt;
        }
      return xe;
    }, dc = () => {
      const R = ve.value.startDate, z = ve.value.endDate, ge = [], Ce = R.getFullYear(), xe = z.getFullYear();
      for (let Se = Ce; Se <= xe; Se++) {
        const Ne = [];
        for (let Me = 1; Me <= 4; Me++) {
          const Ke = (Me - 1) * 3, Bt = new Date(Se, Ke, 1), bt = Ke + 2, qe = new Date(Se, bt + 1, 0);
          Ne.push({
            quarter: Me,
            label: `Q${Me}`,
            fullLabel: `${Se}年第${Me}季度`,
            startDate: Bt,
            endDate: qe,
            isToday: fc(Bt, qe),
            year: Se
          });
        }
        ge.push({
          year: Se,
          yearLabel: String(Se),
          startDate: new Date(Se, 0, 1),
          endDate: new Date(Se, 11, 31),
          quarters: Ne
        });
      }
      return ge;
    }, fc = (R, z) => {
      const ge = /* @__PURE__ */ new Date();
      return ge.setHours(0, 0, 0, 0), ge >= R && ge <= z;
    }, ou = () => {
      const R = ve.value.startDate, z = ve.value.endDate, ge = [], Ce = R.getFullYear(), xe = z.getFullYear();
      for (let Se = Ce; Se <= xe; Se++) {
        const Ne = [
          {
            label: o("halfYearFirst"),
            startDate: new Date(Se, 0, 1),
            endDate: new Date(Se, 6, 0),
            // 6月的最后一天
            width: Qe.value.year.cellWidth
          },
          {
            label: o("halfYearSecond"),
            startDate: new Date(Se, 6, 1),
            endDate: new Date(Se, 11, 31),
            width: Qe.value.year.cellWidth
          }
        ];
        ge.push({
          year: Se,
          startDate: new Date(Se, 0, 1),
          endDate: new Date(Se, 11, 31),
          halfYears: Ne,
          width: Qe.value.year.cellWidth * 2
        });
      }
      return ge;
    }, lu = (R) => {
      a("add-predecessor", R);
    }, wl = (R) => {
      a("add-successor", R);
    };
    return (R, z) => {
      var ge, Ce, xe, Se, Ne, Me, Ke, Bt, bt, qe, wt, $t;
      return $(), ee(St, null, [
        _("div", {
          ref_key: "timelineContainer",
          ref: Jr,
          class: "timeline",
          style: Mt({
            "--gantt-day-cell-width": Qe.value.day.cellWidth + "px",
            "--gantt-week-cell-width": Qe.value.week.cellWidth + "px"
          }),
          onMousedown: ni,
          onScroll: BA
        }, [
          _("div", $E, [
            le.value === Te(Ue).YEAR && Ti.value && Ti.value.length > 0 ? ($(), ee(St, { key: 0 }, [
              _("div", VE, [
                ($(!0), ee(St, null, nr(Ti.value, (Le) => ($(), ee("div", {
                  key: `year-${Le.year}`,
                  class: "timeline-year",
                  style: Mt({ width: Qe.value.year.cellWidth * 2 + "px" })
                }, [
                  _("div", qE, Ee(je("year", "primary") ? gt(
                    Qe.value.year.formatters.primary,
                    new Date(Le.year, 0, 1)
                  ) : Le.year), 1)
                ], 4))), 128))
              ]),
              _("div", jE, [
                ($(!0), ee(St, null, nr(Ti.value, (Le) => ($(), ee(St, {
                  key: `halfyear-${Le.year}`
                }, [
                  ($(!0), ee(St, null, nr(Le.halfYears || [], (Et) => ($(), ee("div", {
                    key: `halfyear-${Le.year}-${Et.label}`,
                    class: "timeline-half-year-item",
                    style: Mt({ width: Qe.value.year.cellWidth + "px" })
                  }, [
                    _("div", YE, Ee(je("year", "secondary") ? gt(
                      Qe.value.year.formatters.secondary,
                      Et.startDate
                    ) : Et.label), 1)
                  ], 4))), 128))
                ], 64))), 128))
              ])
            ], 64)) : le.value === Te(Ue).MONTH ? ($(), ee(St, { key: 1 }, [
              _("div", GE, [
                ($(!0), ee(St, null, nr(Ai.value, (Le, Et) => ($(), ee("div", {
                  key: `year-${Et}`,
                  class: "timeline-year",
                  style: Mt({
                    width: Le.length * Qe.value.month.cellWidth + "px"
                  })
                }, [
                  _("div", zE, Ee(je("month", "primary") ? gt(
                    Qe.value.month.formatters.primary,
                    new Date(Number(Et), 0, 1)
                  ) : Et), 1)
                ], 4))), 128))
              ]),
              _("div", XE, [
                ($(!0), ee(St, null, nr(ae.value, (Le) => {
                  var Et, Xt;
                  return $(), ee("div", {
                    key: `month-${Le.year}-${Le.month}`,
                    class: tr(["timeline-month-item", { today: (Et = Le.monthData) == null ? void 0 : Et.isToday }]),
                    style: Mt({ width: Qe.value.month.cellWidth + "px" })
                  }, [
                    _("div", JE, Ee(je("month", "secondary") ? gt(
                      Qe.value.month.formatters.secondary,
                      new Date(Le.year, Le.month - 1, 1)
                    ) : (Xt = Le.monthData) == null ? void 0 : Xt.monthLabel), 1)
                  ], 6);
                }), 128))
              ])
            ], 64)) : le.value === Te(Ue).QUARTER ? ($(), ee(St, { key: 2 }, [
              _("div", ZE, [
                ($(!0), ee(St, null, nr(ae.value, (Le) => ($(), ee("div", {
                  key: `year-${Le.year}`,
                  class: "timeline-year",
                  style: Mt({ width: Qe.value.quarter.cellWidth * 4 + "px" })
                }, [
                  _("div", eS, Ee(je("quarter", "primary") ? gt(
                    Qe.value.quarter.formatters.primary,
                    new Date(Le.year, 0, 1)
                  ) : Le.yearLabel), 1)
                ], 4))), 128))
              ]),
              _("div", tS, [
                ($(!0), ee(St, null, nr(ae.value, (Le) => ($(), ee(St, {
                  key: `quarters-${Le.year}`
                }, [
                  ($(!0), ee(St, null, nr(Le.quarters, (Et) => ($(), ee("div", {
                    key: `quarter-${Le.year}-${Et.quarter}`,
                    class: tr(["timeline-quarter-item", { today: Et.isToday }]),
                    style: Mt({ width: Qe.value.quarter.cellWidth + "px" })
                  }, [
                    _("div", rS, Ee(je("quarter", "secondary") ? gt(
                      Qe.value.quarter.formatters.secondary,
                      Et.startDate
                    ) : Et.label), 1)
                  ], 6))), 128))
                ], 64))), 128))
              ])
            ], 64)) : le.value === Te(Ue).HOUR ? ($(), ee("div", {
              key: 3,
              class: "hour-header-container",
              style: Mt({ width: `${at.value}px` })
            }, [
              _("div", nS, [
                ($(!0), ee(St, null, nr(Re.value, (Le) => ($(), ee("div", {
                  key: `date-${Le.year}-${Le.month}-${Le.day}`,
                  class: "timeline-day-item",
                  style: Mt({
                    position: "absolute",
                    width: `${Le.hours.length * Qe.value.hour.cellWidth}px`,
                    left: `${(Le.hourOffset || 0) * Qe.value.hour.cellWidth}px`
                  })
                }, [
                  _("div", aS, Ee(Le.dateLabel), 1)
                ], 4))), 128))
              ]),
              _("div", AS, [
                ($(!0), ee(St, null, nr(Re.value, (Le) => ($(), ee(St, {
                  key: `hours-${Le.year}-${Le.month}-${Le.day}`
                }, [
                  ($(!0), ee(St, null, nr(Le.hours, (Et, Xt) => ($(), ee("div", {
                    key: `hour-${Le.year}-${Le.month}-${Le.day}-${Et.hour}`,
                    class: tr(["timeline-hour-item", {
                      today: Et.isToday,
                      "non-working-hour": !Et.isWorkingHour
                    }]),
                    style: Mt({
                      position: "absolute",
                      width: `${Qe.value.hour.cellWidth}px`,
                      left: `${(Le.hourOffset + Xt) * Qe.value.hour.cellWidth}px`
                    })
                  }, [
                    _("div", sS, Ee(Et.shortLabel), 1)
                  ], 6))), 128))
                ], 64))), 128))
              ])
            ], 4)) : ($(), ee(St, { key: 4 }, [
              _("div", iS, [
                ($(!0), ee(St, null, nr(ae.value, (Le) => ($(), ee("div", {
                  key: `year-month-${Le.year}-${Le.month}`,
                  class: "timeline-month",
                  style: Mt({
                    width: Le.isWeekView ? `${(Le.weeks || []).length * Qe.value.week.cellWidth}px` : `${(Le.days || []).length * Qe.value.day.cellWidth}px`
                  })
                }, [
                  _("div", oS, Ee(je(le.value, "primary") ? gt(
                    Qe.value[le.value].formatters.primary,
                    new Date(Le.year, Le.month - 1, 1)
                  ) : Le.yearMonthLabel), 1)
                ], 4))), 128)),
                ($(!0), ee(St, null, nr(Wo.value, (Le, Et) => ($(), ee("div", {
                  key: `flag-${Et}`,
                  class: "month-first-flag",
                  style: Mt({
                    left: `${Le.left}px`,
                    transform: "translateX(-50%)"
                  })
                }, [
                  z[2] || (z[2] = _("div", { class: "flag-pole" }, null, -1)),
                  _("div", lS, Ee(Le.date), 1)
                ], 4))), 128))
              ]),
              _("div", uS, [
                ($(!0), ee(St, null, nr(ae.value, (Le) => ($(), ee(St, {
                  key: `timeline-${Le.year}-${Le.month}`
                }, [
                  Le.isWeekView && Le.weeks ? ($(), ee("div", {
                    key: 0,
                    class: "timeline-month-weeks",
                    style: Mt({
                      width: `${(Le.weeks || []).length * Qe.value.week.cellWidth}px`
                    })
                  }, [
                    ($(!0), ee(St, null, nr(Le.weeks || [], (Et) => ($(), ee("div", {
                      key: `week-${Le.year}-${Le.month}-${Et.label}`,
                      class: tr(["timeline-week", {
                        today: Et.isToday
                      }])
                    }, [
                      _("div", cS, Ee(gt(
                        Qe.value.week.formatters.secondary ?? "W周",
                        Et.weekStart
                      )), 1),
                      z[3] || (z[3] = _("div", { class: "week-sub-days" }, null, -1))
                    ], 2))), 128))
                  ], 4)) : ($(), ee("div", {
                    key: 1,
                    class: "timeline-month-days",
                    style: Mt({ width: `${Le.days.length * Qe.value.day.cellWidth}px` })
                  }, [
                    ($(!0), ee(St, null, nr(Le.days, (Et) => ($(), ee("div", {
                      key: `day-${Le.year}-${Le.month}-${Et.day}`,
                      class: tr(["timeline-day", {
                        today: Et.isToday,
                        weekend: Et.isWeekend && !Et.isToday
                      }])
                    }, [
                      _("div", dS, Ee(je("day", "secondary") ? gt(Qe.value.day.formatters.secondary, Et.date) : Et.label), 1)
                    ], 2))), 128))
                  ], 4))
                ], 64))), 128))
              ])
            ], 64))
          ]),
          _("div", {
            class: "timeline-body",
            onScroll: ho
          }, [
            _("div", {
              ref_key: "bodyContentRef",
              ref: Pa,
              class: "timeline-body-content"
            }, [
              na(IE, {
                ref_key: "linkDragGuideRef",
                ref: lA,
                active: !!it.value && !!qt.value,
                width: Fa.value,
                height: uo.value,
                "offset-left": Ci.value,
                "offset-top": co.value
              }, null, 8, ["active", "width", "height", "offset-left", "offset-top"]),
              Rt.value && Qt.value >= 0 ? ($(), ee("div", {
                key: 0,
                class: "today-line-year-view",
                style: Mt({
                  left: `${Qt.value}px`,
                  height: `${ar.value}px`
                })
              }, null, 4)) : vt("", !0),
              _("div", {
                class: "day-columns",
                style: Mt({ height: `${ar.value}px` })
              }, [
                le.value === Te(Ue).HOUR ? ($(), ee("div", {
                  key: 0,
                  class: "hour-columns-container",
                  style: Mt({
                    width: `${at.value}px`,
                    height: `${ar.value}px`,
                    position: "relative"
                  })
                }, [
                  ($(!0), ee(St, null, nr(Re.value, (Le) => ($(), ee(St, {
                    key: `day-col-${Le.year}-${Le.month}-${Le.day}`
                  }, [
                    ($(!0), ee(St, null, nr(Le.hours, (Et, Xt) => ($(), ee("div", {
                      key: `hour-col-${Le.year}-${Le.month}-${Le.day}-${Et.hour}`,
                      class: tr(["hour-column", {
                        today: Et.isToday,
                        weekend: Et.isWeekend,
                        "working-hour": Et.isWorkingHour,
                        "rest-hour": !Et.isWorkingHour && !Et.isWeekend
                      }]),
                      style: Mt({
                        position: "absolute",
                        width: `${Qe.value.hour.cellWidth}px`,
                        height: `${ar.value}px`,
                        left: `${(Le.hourOffset + Xt) * Qe.value.hour.cellWidth}px`
                      })
                    }, [
                      _("div", fS, [
                        _("div", {
                          class: "quarter-line",
                          style: Mt({ left: `${Qe.value.hour.cellWidth / 4}px` })
                        }, null, 4),
                        _("div", {
                          class: "quarter-line",
                          style: Mt({ left: `${Qe.value.hour.cellWidth / 2}px` })
                        }, null, 4),
                        _("div", {
                          class: "quarter-line",
                          style: Mt({ left: `${Qe.value.hour.cellWidth * 3 / 4}px` })
                        }, null, 4)
                      ])
                    ], 6))), 128))
                  ], 64))), 128))
                ], 4)) : vt("", !0),
                le.value === Te(Ue).YEAR ? ($(!0), ee(St, { key: 1 }, nr(Ti.value, (Le) => ($(), ee(St, {
                  key: `year-col-${Le.year}`
                }, [
                  ($(!0), ee(St, null, nr(Le.halfYears || [], (Et) => ($(), ee("div", {
                    key: `halfyear-col-${Le.year}-${Et.label}`,
                    class: "half-year-column",
                    style: Mt({
                      width: Qe.value.year.cellWidth + "px",
                      height: `${ar.value}px`
                    })
                  }, null, 4))), 128))
                ], 64))), 128)) : vt("", !0),
                le.value === Te(Ue).QUARTER ? ($(), ee("div", {
                  key: 2,
                  class: "quarter-columns-container",
                  style: Mt({
                    width: `${at.value}px`,
                    height: `${ar.value}px`,
                    position: "relative"
                  })
                }, [
                  ($(!0), ee(St, null, nr(ae.value, (Le, Et) => ($(), ee(St, {
                    key: `quarter-col-${Le.year}`
                  }, [
                    ($(!0), ee(St, null, nr(Le.quarters, (Xt, Lr) => ($(), ee("div", {
                      key: `quarter-col-${Le.year}-${Xt.quarter}`,
                      class: tr(["quarter-column", { today: Xt.isToday }]),
                      style: Mt({
                        position: "absolute",
                        width: `${Qe.value.quarter.cellWidth}px`,
                        height: `${ar.value}px`,
                        left: `${Et * Qe.value.quarter.cellWidth * 4 + Lr * Qe.value.quarter.cellWidth}px`
                      })
                    }, null, 6))), 128))
                  ], 64))), 128))
                ], 4)) : le.value !== Te(Ue).HOUR && le.value !== Te(Ue).YEAR && le.value !== Te(Ue).QUARTER ? ($(!0), ee(St, { key: 3 }, nr(ae.value, (Le) => {
                  var Et;
                  return $(), ee(St, {
                    key: `day-col-${Le.year}-${Le.month}`
                  }, [
                    Le.isMonthView ? ($(), ee("div", {
                      key: 0,
                      class: tr(["month-column", { today: (Et = Le.monthData) == null ? void 0 : Et.isToday }]),
                      style: Mt({
                        width: `${Qe.value.month.cellWidth}px`,
                        height: `${ar.value}px`
                      })
                    }, null, 6)) : Le.isWeekView && Le.weeks ? ($(), ee("div", {
                      key: 1,
                      class: "month-week-columns",
                      style: Mt({
                        width: `${(Le.weeks || []).length * Qe.value.week.cellWidth}px`,
                        height: `${ar.value}px`
                      })
                    }, [
                      ($(!0), ee(St, null, nr(Le.weeks || [], (Xt) => ($(), ee("div", {
                        key: `week-col-${Le.year}-${Le.month}-${Xt.label}`,
                        class: tr(["week-column", {
                          today: Xt.isToday
                        }]),
                        style: Mt({
                          height: `${ar.value}px`,
                          width: `${Qe.value.week.cellWidth}px`
                        })
                      }, [
                        ($(!0), ee(St, null, nr(Xt.subDays || [], (Lr, Rr) => ($(), ee("div", {
                          key: `subday-col-${Rr}`,
                          class: tr(["sub-day-column", {
                            weekend: Lr.dayOfWeek === 0 || Lr.dayOfWeek === 6,
                            today: j(Lr.date)
                          }]),
                          style: Mt({ height: `${ar.value}px`, width: `${ot.value}px` })
                        }, null, 6))), 128))
                      ], 6))), 128))
                    ], 4)) : ($(), ee("div", {
                      key: 2,
                      class: "month-day-columns",
                      style: Mt({
                        width: `${(Le.days || []).length * Qe.value.day.cellWidth}px`,
                        height: `${ar.value}px`
                      })
                    }, [
                      ($(!0), ee(St, null, nr(Le.days || [], (Xt) => ($(), ee("div", {
                        key: `day-col-${Le.year}-${Le.month}-${Xt.day}`,
                        class: tr(["day-column", {
                          weekend: Xt.isWeekend,
                          today: Xt.isToday
                        }]),
                        style: Mt({ height: `${ar.value}px` })
                      }, null, 6))), 128))
                    ], 4))
                  ], 64);
                }), 128)) : vt("", !0)
              ], 4),
              _("div", {
                class: "task-bar-container",
                style: Mt({ height: `${ar.value}px` })
              }, [
                Te(l) === "task" || Te(l) === "resource" && le.value === Te(Ue).WEEK ? ($(), Ir(UE, {
                  key: 0,
                  tasks: De.value,
                  "task-bar-positions": Wr.value,
                  width: Fa.value,
                  height: uo.value,
                  "offset-left": Ci.value,
                  "offset-top": co.value,
                  "highlighted-task-id": Je.value,
                  "highlighted-task-ids": pt.value,
                  "hovered-task-id": ke.value,
                  "vertical-lines": go.value,
                  "show-vertical-lines": le.value === Te(Ue).WEEK,
                  "show-links": Te(l) === "task",
                  "is-scrolling": W.value,
                  "link-config": r.linkConfig
                }, null, 8, ["tasks", "task-bar-positions", "width", "height", "offset-left", "offset-top", "highlighted-task-id", "highlighted-task-ids", "hovered-task-id", "vertical-lines", "show-vertical-lines", "show-links", "is-scrolling", "link-config"])) : vt("", !0),
                _("div", {
                  class: "task-rows",
                  style: Mt({ height: `${ar.value}px` })
                }, [
                  Te(l) === "task" ? ($(!0), ee(St, { key: 0 }, nr(et.value, ({ task: Le, originalIndex: Et }) => {
                    var Xt, Lr, Rr;
                    return $(), ee("div", {
                      key: Le.id,
                      class: tr(["task-row", { "task-row-hovered": ke.value === Le.id }]),
                      style: Mt({
                        top: `${Te(B).cumulativeHeights[Et]}px`,
                        height: `${(Te(B).cumulativeHeights[Et + 1] ?? Te(B).cumulativeHeights[Et]) - Te(B).cumulativeHeights[Et]}px`
                      }),
                      onMouseenter: (Sr) => or(Le.id),
                      onMouseleave: z[0] || (z[0] = (Sr) => or(null))
                    }, [
                      Le.type === "milestone-group" && Le.children ? ($(!0), ee(St, { key: 0 }, nr(Le.children, (Sr) => ($(), Ir(Mm, {
                        key: Sr.id,
                        date: Sr.startDate || "",
                        "row-height": Te(B).taskHeights.get(Le.id) || Te(D),
                        "day-width": ot.value,
                        "start-date": le.value === Te(Ue).YEAR || le.value === Te(Ue).QUARTER ? X().startDate : le.value === Te(Ue).MONTH ? K().startDate : ve.value.startDate,
                        "timeline-start": ve.value.startDate,
                        "timeline-end": ve.value.endDate,
                        "period-width": ot.value,
                        name: Sr.name,
                        milestone: su(Sr),
                        task: Sr,
                        "label-position": r.milestoneLabelPosition,
                        "scroll-left": Zn.value,
                        "container-width": Xr.value,
                        "milestone-id": Sr.id,
                        "other-milestones": Ut(Sr.id),
                        "timeline-data": ae.value,
                        "current-time-scale": le.value,
                        "allow-drag-and-resize": r.allowDragAndResize && !Xe.value,
                        "is-in-highlight-mode": Xe.value,
                        onMilestoneDoubleClick: Er,
                        "onUpdate:milestone": nn,
                        onDragEnd: Zs,
                        onMilestoneTooltipShow: C,
                        onMilestoneTooltipHide: H
                      }, hi({ _: 2 }, [
                        R.$slots["custom-milestone-content"] ? {
                          name: "custom-milestone-content",
                          fn: qa((Mn) => [
                            Nn(R.$slots, "custom-milestone-content", XA({ ref_for: !0 }, Mn), void 0, !0)
                          ]),
                          key: "0"
                        } : void 0
                      ]), 1032, ["date", "row-height", "day-width", "start-date", "timeline-start", "timeline-end", "period-width", "name", "milestone", "task", "label-position", "scroll-left", "container-width", "milestone-id", "other-milestones", "timeline-data", "current-time-scale", "allow-drag-and-resize", "is-in-highlight-mode"]))), 128)) : Le.type === "milestone" ? ($(), Ir(Mm, {
                        key: Le.id,
                        date: Le.startDate || "",
                        "row-height": Te(B).taskHeights.get(Le.id) || Te(D),
                        "day-width": ot.value,
                        "start-date": le.value === Te(Ue).YEAR || le.value === Te(Ue).QUARTER ? X().startDate : le.value === Te(Ue).MONTH ? K().startDate : ve.value.startDate,
                        "timeline-start": ve.value.startDate,
                        "timeline-end": ve.value.endDate,
                        "period-width": ot.value,
                        name: Le.name,
                        milestone: su(Le),
                        task: Le,
                        "label-position": r.milestoneLabelPosition,
                        "scroll-left": Zn.value,
                        "container-width": Xr.value,
                        "milestone-id": Le.id,
                        "other-milestones": Ut(Le.id),
                        "timeline-data": ae.value,
                        "current-time-scale": le.value,
                        "allow-drag-and-resize": r.allowDragAndResize && !Xe.value,
                        "is-in-highlight-mode": Xe.value,
                        onMilestoneDoubleClick: Er,
                        "onUpdate:milestone": nn,
                        onDragEnd: Zs,
                        onMilestoneTooltipShow: C,
                        onMilestoneTooltipHide: H
                      }, hi({ _: 2 }, [
                        R.$slots["custom-milestone-content"] ? {
                          name: "custom-milestone-content",
                          fn: qa((Sr) => [
                            Nn(R.$slots, "custom-milestone-content", XA({ ref_for: !0 }, Sr), void 0, !0)
                          ]),
                          key: "0"
                        } : void 0
                      ]), 1032, ["date", "row-height", "day-width", "start-date", "timeline-start", "timeline-end", "period-width", "name", "milestone", "task", "label-position", "scroll-left", "container-width", "milestone-id", "other-milestones", "timeline-data", "current-time-scale", "allow-drag-and-resize", "is-in-highlight-mode"])) : Le.type !== "milestone-group" && Le.type !== "milestone" ? ($(), Ir(Qm, {
                        key: `taskbar-${Le.id}-${h.value}`,
                        task: Le,
                        "row-index": Et,
                        "row-height": Te(B).taskHeights.get(Le.id) || Te(D),
                        "day-width": ot.value,
                        "start-date": le.value === Te(Ue).YEAR ? X().startDate : le.value === Te(Ue).MONTH ? K().startDate : ve.value.startDate,
                        "is-parent": Le.isParent,
                        "scroll-left": Zn.value,
                        "container-width": Xr.value,
                        "hide-bubbles": bn.value,
                        "timeline-data": le.value === Te(Ue).HOUR ? Re.value : ae.value,
                        "current-time-scale": le.value,
                        "task-bar-config": r.taskBarConfig,
                        "allow-drag-and-resize": r.allowDragAndResize && !Xe.value,
                        "show-actual-taskbar": r.showActualTaskbar,
                        "enable-task-bar-tooltip": r.enableTaskBarTooltip,
                        "pending-task-background-color": r.pendingTaskBackgroundColor,
                        "delay-task-background-color": r.delayTaskBackgroundColor,
                        "complete-task-background-color": r.completeTaskBackgroundColor,
                        "ongoing-task-background-color": r.ongoingTaskBackgroundColor,
                        "enable-parent-task-auto-schedule": r.enableParentTaskAutoSchedule,
                        "is-highlighted": pt.value.has(Le.id),
                        "is-primary-highlight": Je.value === Le.id,
                        "is-in-highlight-mode": Xe.value,
                        "drag-link-mode": it.value,
                        "is-link-drag-source": ((Xt = qt.value) == null ? void 0 : Xt.id) === Le.id,
                        "is-valid-link-target": ((Lr = hr.value) == null ? void 0 : Lr.id) === Le.id && Nt.value === !0,
                        "is-invalid-link-target": ((Rr = hr.value) == null ? void 0 : Rr.id) === Le.id && Nt.value === !1,
                        "all-tasks": De.value,
                        "onUpdate:task": _r,
                        onBarMounted: ki,
                        onClick: (Sr) => un(Le, Sr),
                        onDblclick: (Sr) => Pr(Le),
                        onDragEnd: fo,
                        onResizeEnd: wA,
                        onScrollToPosition: Ki,
                        onContextMenu: SA,
                        onStartTimer: au,
                        onStopTimer: Au,
                        onAddPredecessor: lu,
                        onAddSuccessor: wl,
                        onDelete: da,
                        onDeleteLink: La,
                        onLongPress: Kt,
                        onLinkDragStart: Ar,
                        onLinkDragMove: Ca,
                        onLinkDragEnd: ka,
                        onTooltipShow: N,
                        onTooltipHide: se
                      }, hi({ _: 2 }, [
                        R.$slots["custom-task-content"] ? {
                          name: "custom-task-content",
                          fn: qa((Sr) => [
                            Nn(R.$slots, "custom-task-content", XA({ ref_for: !0 }, Sr), void 0, !0)
                          ]),
                          key: "0"
                        } : void 0,
                        R.$slots["task-bar-context-menu"] ? {
                          name: "task-bar-context-menu",
                          fn: qa((Sr) => [
                            Nn(R.$slots, "task-bar-context-menu", XA({ ref_for: !0 }, Sr), void 0, !0)
                          ]),
                          key: "1"
                        } : void 0
                      ]), 1032, ["task", "row-index", "row-height", "day-width", "start-date", "is-parent", "scroll-left", "container-width", "hide-bubbles", "timeline-data", "current-time-scale", "task-bar-config", "allow-drag-and-resize", "show-actual-taskbar", "enable-task-bar-tooltip", "pending-task-background-color", "delay-task-background-color", "complete-task-background-color", "ongoing-task-background-color", "enable-parent-task-auto-schedule", "is-highlighted", "is-primary-highlight", "is-in-highlight-mode", "drag-link-mode", "is-link-drag-source", "is-valid-link-target", "is-invalid-link-target", "all-tasks", "onClick", "onDblclick"])) : vt("", !0)
                    ], 46, hS);
                  }), 128)) : Te(l) === "resource" ? ($(!0), ee(St, { key: 1 }, nr(Pi.value, ({ resource: Le, originalIndex: Et }) => {
                    var Xt, Lr, Rr, Sr, Mn;
                    return $(), ee("div", {
                      key: Le.id,
                      class: tr(["task-row resource-row", { "task-row-hovered": ke.value === Le.id }]),
                      style: Mt({
                        top: `${((Xt = Te(E)) == null ? void 0 : Xt.get(Le.id)) || 0}px`,
                        height: `${((Rr = (Lr = Te(T)) == null ? void 0 : Lr.get(Le.id)) == null ? void 0 : Rr.totalHeight) || Te(D)}px`
                      }),
                      onMouseenter: (wn) => or(Le.id),
                      onMouseleave: z[1] || (z[1] = (wn) => or(null))
                    }, [
                      Le.tasks && Le.tasks.length > 0 ? ($(), ee(St, { key: 0 }, [
                        ($(!0), ee(St, null, nr(Le.tasks, (wn) => {
                          var Ba, FA, WA, Ws, ba, Di, Ei, Vi;
                          return $(), Ir(Qm, {
                            key: `taskbar-${wn.id}-${h.value}`,
                            task: wn,
                            "row-index": Et,
                            "row-height": O.value,
                            "task-sub-row": ((FA = (Ba = Te(T)) == null ? void 0 : Ba.get(Le.id)) == null ? void 0 : FA.taskRowMap.get(wn.id)) || 0,
                            "row-heights": ((Ws = (WA = Te(T)) == null ? void 0 : WA.get(Le.id)) == null ? void 0 : Ws.rowHeights) || [
                              O.value
                            ],
                            "day-width": ot.value,
                            "start-date": le.value === Te(Ue).YEAR ? X().startDate : le.value === Te(Ue).MONTH ? K().startDate : ve.value.startDate,
                            "scroll-left": Zn.value,
                            "container-width": Xr.value,
                            "hide-bubbles": bn.value,
                            "timeline-data": le.value === Te(Ue).HOUR ? Re.value : ae.value,
                            "current-time-scale": le.value,
                            "task-bar-config": r.taskBarConfig,
                            "allow-drag-and-resize": r.allowDragAndResize && !Xe.value,
                            "show-actual-taskbar": r.showActualTaskbar,
                            "enable-task-bar-tooltip": r.enableTaskBarTooltip,
                            "pending-task-background-color": r.pendingTaskBackgroundColor,
                            "delay-task-background-color": r.delayTaskBackgroundColor,
                            "complete-task-background-color": r.completeTaskBackgroundColor,
                            "ongoing-task-background-color": r.ongoingTaskBackgroundColor,
                            "is-highlighted": pt.value.has(wn.id),
                            "is-primary-highlight": Je.value === wn.id,
                            "is-in-highlight-mode": Xe.value,
                            "drag-link-mode": it.value,
                            "is-link-drag-source": ((ba = qt.value) == null ? void 0 : ba.id) === wn.id,
                            "is-valid-link-target": ((Di = hr.value) == null ? void 0 : Di.id) === wn.id && Nt.value === !0,
                            "is-invalid-link-target": ((Ei = hr.value) == null ? void 0 : Ei.id) === wn.id && Nt.value === !1,
                            "all-tasks": De.value,
                            "has-resource-conflict": ((Vi = Te(f).get(String(Le.id))) == null ? void 0 : Vi.has(wn.id)) || !1,
                            "conflict-tasks": c(Le.id, wn.id),
                            "current-resource-id": Le.id,
                            resources: Te(u),
                            "onUpdate:task": _r,
                            onBarMounted: ki,
                            onClick: (Si) => un(wn, Si),
                            onDblclick: (Si) => Pr(wn),
                            onDragEnd: fo,
                            onResizeEnd: wA,
                            onScrollToPosition: Ki,
                            onContextMenu: SA,
                            onStartTimer: au,
                            onStopTimer: Au,
                            onAddPredecessor: lu,
                            onAddSuccessor: wl,
                            onDelete: da,
                            onDeleteLink: La,
                            onLongPress: Kt,
                            onLinkDragStart: Ar,
                            onLinkDragMove: Ca,
                            onLinkDragEnd: ka,
                            onTooltipShow: N,
                            onTooltipHide: se
                          }, hi({ _: 2 }, [
                            R.$slots["custom-task-content"] ? {
                              name: "custom-task-content",
                              fn: qa((Si) => [
                                Nn(R.$slots, "custom-task-content", XA({ ref_for: !0 }, Si), void 0, !0)
                              ]),
                              key: "0"
                            } : void 0,
                            R.$slots["task-bar-context-menu"] ? {
                              name: "task-bar-context-menu",
                              fn: qa((Si) => [
                                Nn(R.$slots, "task-bar-context-menu", XA({ ref_for: !0 }, Si), void 0, !0)
                              ]),
                              key: "1"
                            } : void 0
                          ]), 1032, ["task", "row-index", "row-height", "task-sub-row", "row-heights", "day-width", "start-date", "scroll-left", "container-width", "hide-bubbles", "timeline-data", "current-time-scale", "task-bar-config", "allow-drag-and-resize", "show-actual-taskbar", "enable-task-bar-tooltip", "pending-task-background-color", "delay-task-background-color", "complete-task-background-color", "ongoing-task-background-color", "is-highlighted", "is-primary-highlight", "is-in-highlight-mode", "drag-link-mode", "is-link-drag-source", "is-valid-link-target", "is-invalid-link-target", "all-tasks", "has-resource-conflict", "conflict-tasks", "current-resource-id", "resources", "onClick", "onDblclick"]);
                        }), 128)),
                        Te(k) ? ($(), Ir(_E, {
                          key: 0,
                          tasks: Le.tasks,
                          "resource-id": Le.id,
                          "day-width": ot.value,
                          "start-date": le.value === Te(Ue).YEAR ? X().startDate : le.value === Te(Ue).MONTH ? K().startDate : ve.value.startDate,
                          "top-offset": ln.value,
                          height: Hn(
                            ((Sr = Te(T).get(Le.id)) == null ? void 0 : Sr.totalHeight) || Te(D)
                          ),
                          "bar-top-pad": Gn.value,
                          width: at.value,
                          "timeline-data": ae.value,
                          "current-time-scale": le.value,
                          "task-row-map": (Mn = Te(T).get(Le.id)) == null ? void 0 : Mn.taskRowMap,
                          "row-heights": Ln(Le.id),
                          "scroll-left": Zn.value,
                          "container-width": Xr.value,
                          "render-limit": zt.value.get(Le.id)
                        }, null, 8, ["tasks", "resource-id", "day-width", "start-date", "top-offset", "height", "bar-top-pad", "width", "timeline-data", "current-time-scale", "task-row-map", "row-heights", "scroll-left", "container-width", "render-limit"])) : vt("", !0)
                      ], 64)) : vt("", !0)
                    ], 46, gS);
                  }), 128)) : vt("", !0)
                ], 4)
              ], 4)
            ], 512)
          ], 32)
        ], 36),
        r.enableTaskBarTooltip !== !1 ? ($(), Ir(es, {
          key: 0,
          to: "body"
        }, [
          x.visible ? ($(), ee("div", {
            key: 0,
            class: tr(["task-hover-tooltip", [
              `placement-${x.placement}`,
              { "tooltip-custom-slot": R.$slots["taskbar-tooltip"] }
            ]]),
            style: Mt({
              left: `${x.position.left}px`,
              top: `${x.position.top}px`,
              "--arrow-offset": `${x.arrowOffset}px`,
              "--tt-color": x.taskStatus.color
            })
          }, [
            R.$slots["taskbar-tooltip"] ? Nn(R.$slots, "taskbar-tooltip", {
              key: 0,
              task: x.task,
              taskStatus: x.taskStatus,
              resourcePercent: x.resourcePercent
            }, void 0, !0) : ($(), ee("div", vS, [
              _("div", pS, Ee((ge = x.task) == null ? void 0 : ge.name), 1),
              (Ce = x.parentAutoSchedule) != null && Ce.enabled && ((xe = x.parentAutoSchedule) != null && xe.childrenRange) ? ($(), ee(St, { key: 0 }, [
                _("div", mS, [
                  _("span", wS, Ee(o("childrenEarliestStart")) + ":", 1),
                  _("span", yS, Ee(S(x.parentAutoSchedule.childrenRange.minStart)), 1)
                ]),
                _("div", BS, [
                  _("span", bS, Ee(o("childrenLatestEnd")) + ":", 1),
                  _("span", CS, Ee(S(
                    Te(hA)(
                      x.parentAutoSchedule.childrenRange.maxEndRaw,
                      x.parentAutoSchedule.childrenRange.maxEnd
                    )
                  )), 1)
                ])
              ], 64)) : ($(), ee(St, { key: 1 }, [
                _("div", kS, [
                  _("span", TS, Ee(o("plannedStartDate")) + ":", 1),
                  _("span", xS, Ee(oe((Se = x.task) == null ? void 0 : Se.startDate)), 1)
                ]),
                _("div", DS, [
                  _("span", ES, Ee(o("plannedEndDate")) + ":", 1),
                  _("span", SS, Ee(J((Ne = x.task) == null ? void 0 : Ne.endDate)), 1)
                ]),
                ((Me = x.parentAutoSchedule) == null ? void 0 : Me.enabled) === !1 && ((Ke = x.parentAutoSchedule) != null && Ke.hasOverflow) && ((Bt = x.parentAutoSchedule) != null && Bt.childrenRange) ? ($(), ee(St, { key: 0 }, [
                  _("div", FS, [
                    _("span", US, "⚠ " + Ee(o("childrenOverflow")), 1)
                  ]),
                  _("div", LS, [
                    _("span", IS, Ee(o("childrenEarliestStart")) + ":", 1),
                    _("span", QS, Ee(S(x.parentAutoSchedule.childrenRange.minStart)), 1)
                  ]),
                  _("div", MS, [
                    _("span", _S, Ee(o("childrenLatestEnd")) + ":", 1),
                    _("span", RS, Ee(S(
                      Te(hA)(
                        x.parentAutoSchedule.childrenRange.maxEndRaw,
                        x.parentAutoSchedule.childrenRange.maxEnd
                      )
                    )), 1)
                  ])
                ], 64)) : vt("", !0)
              ], 64)),
              x.parentAutoSchedule ? vt("", !0) : ($(), ee(St, { key: 2 }, [
                _("div", NS, [
                  _("span", HS, Ee(o("actualStartDate")) + ":", 1),
                  _("span", OS, Ee((bt = x.task) != null && bt.actualStartDate ? oe(x.task.actualStartDate) : "-"), 1)
                ]),
                _("div", PS, [
                  _("span", WS, Ee(o("actualEndDate")) + ":", 1),
                  _("span", KS, Ee((qe = x.task) != null && qe.actualEndDate ? J(x.task.actualEndDate) : "-"), 1)
                ])
              ], 64))
            ])),
            z[4] || (z[4] = _("span", { class: "tt-arrow" }, null, -1))
          ], 6)) : vt("", !0)
        ])) : vt("", !0),
        r.enableMilestoneTooltip !== !1 ? ($(), Ir(es, {
          key: 1,
          to: "body"
        }, [
          Z.visible ? ($(), ee("div", {
            key: 0,
            class: tr(["milestone-sticky-tooltip", [
              `arrow-${Z.arrowDirection}`,
              { "milestone-tooltip-custom": R.$slots["milestone-tooltip"] }
            ]]),
            style: Mt({
              left: `${Z.position.x + (R.$slots["milestone-tooltip"] || Z.arrowDirection === "left" ? 0 : 50)}px`,
              top: `${Z.position.y}px`,
              "--ms-color": Z.milestoneColor,
              maxWidth: `${R.$slots["milestone-tooltip"] ? "280px" : "180px"}`
            })
          }, [
            R.$slots["milestone-tooltip"] ? Nn(R.$slots, "milestone-tooltip", {
              key: 0,
              milestone: Z.milestone
            }, void 0, !0) : ($(), ee("div", $S, Ee((wt = Z.milestone) == null ? void 0 : wt.name) + " – " + Ee(oe(($t = Z.milestone) == null ? void 0 : $t.startDate)) + '" ', 1)),
            _("span", {
              class: "ms-arrow",
              style: Mt({ top: `${Z.arrowOffsetY}px` })
            }, null, 4)
          ], 6)) : vt("", !0)
        ])) : vt("", !0)
      ], 64);
    };
  }
}), rF = /* @__PURE__ */ Fn(tF, [["__scopeId", "data-v-9540f9cf"]]), nF = { class: "gantt-toolbar" }, aF = { class: "toolbar-left" }, AF = {
  key: 0,
  class: "gantt-btn-group gantt-add-btn-group"
}, sF = ["title"], iF = ["title"], oF = {
  key: 1,
  class: "gantt-view-mode-control"
}, lF = { class: "view-mode-track" }, uF = ["title", "onClick"], cF = {
  key: 0,
  class: "gantt-btn-icon",
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  "stroke-width": "2"
}, dF = {
  key: 1,
  class: "gantt-btn-icon",
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  "stroke-width": "2"
}, fF = {
  key: 2,
  class: "gantt-btn-icon",
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  "stroke-width": "2"
}, hF = {
  key: 3,
  class: "gantt-btn-icon",
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  "stroke-width": "2"
}, gF = {
  key: 2,
  class: "gantt-btn-group gantt-expand-collapse-btn-group"
}, vF = ["title"], pF = ["title"], mF = {
  key: 3,
  class: "gantt-btn-group"
}, wF = ["title"], yF = ["title"], BF = { class: "toolbar-right" }, bF = {
  key: 0,
  class: "segmented-control time-scale-segmented"
}, CF = { class: "segmented-track" }, kF = ["title", "onClick"], TF = {
  key: 1,
  class: "language-dropdown"
}, xF = ["title"], DF = { class: "lang-text" }, EF = {
  key: 0,
  class: "language-menu"
}, SF = ["onClick"], FF = { class: "option-text" }, UF = {
  key: 0,
  class: "check-icon",
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  "stroke-width": "2"
}, LF = ["title"], IF = ["title"], QF = {
  key: 0,
  class: "gantt-btn-icon",
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  "stroke-width": "2"
}, MF = {
  key: 1,
  class: "gantt-btn-icon",
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  "stroke-width": "2"
}, _F = { class: "icon-fallback" }, RF = ["title"], NF = {
  key: 0,
  class: "gantt-btn-icon",
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  "stroke-width": "2"
}, HF = {
  key: 1,
  class: "gantt-btn-icon",
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  "stroke-width": "2"
}, OF = { class: "icon-fallback" }, PF = ["data-theme"], WF = { class: "dialog-content" }, KF = { class: "dialog-message" }, $F = { class: "dialog-actions" }, Pm = "gantt-theme", VF = "gantt-locale", qF = /* @__PURE__ */ hn({
  __name: "GanttToolbar",
  props: {
    config: { default: () => ({}) },
    timeScale: { default: void 0 },
    theme: { default: void 0 },
    fullscreen: { type: Boolean, default: void 0 },
    expandAll: { type: Boolean, default: void 0 },
    viewMode: { default: "task" },
    availableViewModes: { default: () => ["task", "resource"] },
    onAddTask: { type: Function, default: void 0 },
    onAddMilestone: { type: Function, default: void 0 },
    onTodayLocate: { type: Function, default: void 0 },
    onExportCsv: { type: Function, default: void 0 },
    onExportPdf: { type: Function, default: void 0 },
    onLanguageChange: { type: Function, default: void 0 },
    onThemeChange: { type: Function, default: void 0 },
    onFullscreenChange: { type: Function, default: void 0 },
    onTimeScaleChange: { type: Function, default: void 0 },
    onExpandAll: { type: Function, default: void 0 },
    onCollapseAll: { type: Function, default: void 0 },
    onViewModeChange: { type: Function, default: void 0 },
    onSettingsConfirm: { type: Function, default: void 0 }
  },
  emits: ["add-task", "add-milestone", "today-locate", "export-csv", "export-pdf", "language-change", "theme-change", "fullscreen-change", "time-scale-change", "expand-all", "collapse-all", "view-mode-change"],
  setup(n, { emit: t }) {
    const e = ["task", "resource"], r = {
      task: "taskView",
      resource: "resourceView.desc",
      calendar: "calendarView",
      "resource-usage": "resourceUsageView"
    }, a = {
      task: "任务视图",
      resource: "资源视图",
      calendar: "日历视图",
      "resource-usage": "资源利用率"
    }, A = n, i = t, s = {
      zh: "zh-CN",
      en: "en-US"
    }, o = () => {
      if (typeof window < "u") {
        const K = localStorage.getItem(Pm);
        return K !== null ? K === "dark" : window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
      }
      return !1;
    }, { locale: l, setLocale: u, getTranslation: f } = Cs(), h = me("zh"), c = me(o()), p = me(!1), w = me(!1), y = me(Ue.DAY), m = me("task"), k = /* @__PURE__ */ new Map(), D = me({}), B = (K) => (X) => {
      X instanceof HTMLElement ? k.set(K, X) : k.delete(K);
    };
    let O = null;
    const q = () => {
      const K = {};
      k.forEach((X, ke) => {
        K[ke] = X.offsetWidth;
      }), D.value = K;
    }, G = () => {
      O ? O.disconnect() : O = new ResizeObserver(() => {
        q();
      }), k.forEach((K) => {
        O.observe(K);
      }), q();
    }, W = ce(() => {
      const K = A.availableViewModes ?? e, X = D.value, ke = K.indexOf(m.value);
      if (!K.every((Xe) => (X[Xe] ?? 0) > 0))
        return {
          transform: `translateX(${K.length > 1 ? Math.max(ke, 0) / (K.length - 1) * 100 : 0}%)`,
          width: `${100 / Math.max(K.length, 1)}%`
        };
      let pt = 0;
      for (const Xe of K) {
        if (Xe === m.value) break;
        pt += X[Xe] ?? 0;
      }
      return {
        transform: `translateX(${pt}px)`,
        width: `${X[m.value] ?? 0}px`
      };
    });
    Gt(
      () => A.viewMode,
      (K) => {
        K && K !== m.value && (m.value = K);
      },
      { immediate: !0 }
    ), Gt(
      () => A.availableViewModes,
      async () => {
        await An(), G();
      }
    ), Gt(
      () => A.timeScale,
      (K) => {
        K && K !== y.value && (y.value = K);
      },
      { immediate: !0 }
    ), Gt(
      () => A.theme,
      (K) => {
        if (K) {
          const X = K === "dark";
          c.value !== X && (c.value = X);
        }
      },
      { immediate: !0 }
    ), Gt(
      () => A.fullscreen,
      (K) => {
        K !== void 0 && p.value !== K && (p.value = K);
      },
      { immediate: !0 }
    );
    const F = (K) => f(K), Y = ce(() => F("language")), T = me(!1), E = me(null), Q = me(null), x = () => {
      A.onAddTask && typeof A.onAddTask == "function" ? A.onAddTask() : i("add-task");
    }, oe = () => {
      A.onAddMilestone && typeof A.onAddMilestone == "function" ? A.onAddMilestone() : i("add-milestone");
    }, J = () => {
      A.onTodayLocate && typeof A.onTodayLocate == "function" ? A.onTodayLocate() : i("today-locate");
    }, S = () => {
      A.onExportCsv && typeof A.onExportCsv == "function" ? A.onExportCsv() : i("export-csv");
    }, I = () => {
      A.onExportPdf && typeof A.onExportPdf == "function" ? A.onExportPdf() : i("export-pdf");
    }, N = () => {
      A.onExpandAll && typeof A.onExpandAll == "function" ? A.onExpandAll() : i("expand-all");
    }, se = () => {
      A.onCollapseAll && typeof A.onCollapseAll == "function" ? A.onCollapseAll() : i("collapse-all");
    }, Z = (K) => {
      m.value !== K && (m.value = K, A.onViewModeChange && typeof A.onViewModeChange == "function" && A.onViewModeChange(K));
    }, C = () => {
      w.value = !w.value;
    }, H = (K) => {
      w.value = !1, Q.value = s[K], E.value = "language", T.value = !0;
    }, M = async () => {
      if (!E.value || Q.value === null) {
        ve();
        return;
      }
      if (A.onSettingsConfirm && typeof A.onSettingsConfirm == "function")
        try {
          if (!await A.onSettingsConfirm(E.value, Q.value)) {
            ve();
            return;
          }
        } catch {
          ve();
          return;
        }
      if (E.value === "theme") {
        const K = Q.value;
        c.value = K, A.onThemeChange && typeof A.onThemeChange == "function" ? A.onThemeChange(K) : i("theme-change", K), te();
      } else if (E.value === "language") {
        const K = Q.value;
        h.value = K === "zh-CN" ? "zh" : "en", u(K), A.onLanguageChange && typeof A.onLanguageChange == "function" ? A.onLanguageChange(K) : i("language-change", K), ie();
      }
      ve();
    }, te = () => {
      typeof window < "u" && typeof Q.value == "boolean" && localStorage.setItem(Pm, Q.value ? "dark" : "light");
    }, ie = () => {
      typeof window < "u" && typeof Q.value == "string" && localStorage.setItem(VF, Q.value);
    }, we = () => {
      ve();
    }, ve = () => {
      T.value = !1, E.value = null, Q.value = null;
    }, le = () => {
      const X = (A.theme || (c.value ? "dark" : "light")) !== "dark";
      Q.value = X, E.value = "theme", T.value = !0;
    }, _e = () => {
      p.value = !p.value, window.dispatchEvent(
        new CustomEvent("fullscreen-toggle", {
          detail: p.value
        })
      ), A.onFullscreenChange && typeof A.onFullscreenChange == "function" ? A.onFullscreenChange(p.value) : i("fullscreen-change", p.value);
    }, De = {
      hour: { value: Ue.HOUR, label: () => F("timeScaleHour") },
      day: { value: Ue.DAY, label: () => F("timeScaleDay") },
      week: { value: Ue.WEEK, label: () => F("timeScaleWeek") },
      month: { value: Ue.MONTH, label: () => F("timeScaleMonth") },
      quarter: { value: Ue.QUARTER, label: () => F("timeScaleQuarter") },
      year: { value: Ue.YEAR, label: () => F("timeScaleYear") }
    }, ze = ["hour", "day", "week", "month", "quarter", "year"], nt = ce(() => {
      var ke;
      const X = (((ke = A.config) == null ? void 0 : ke.timeScaleDimensions) ?? ze).filter(
        (Je) => Je in De
      );
      return X.length > 0 ? X : [...ze];
    }), Qe = ce(() => {
      var ke;
      const K = nt.value, X = (ke = A.config) == null ? void 0 : ke.defaultTimeScale;
      return X && K.includes(X) ? X : K.includes("day") ? "day" : K[0] ?? "day";
    }), ne = (K) => {
      y.value = K, A.onTimeScaleChange && typeof A.onTimeScaleChange == "function" ? A.onTimeScaleChange(K) : i("time-scale-change", K);
    };
    let gt = !1;
    Gt(
      () => Qe.value,
      (K) => {
        const X = De[K].value;
        (y.value !== X || !gt) && (gt = !0, ne(X));
      },
      { immediate: !0 }
    );
    const je = ce(() => nt.value.find(
      (X) => De[X].value === y.value
    ) ?? Qe.value), ot = me(/* @__PURE__ */ new Map()), Ie = me({}), It = (K, X) => {
      X instanceof HTMLElement ? ot.value.set(K, X) : ot.value.delete(K);
    }, dt = () => {
      const K = {};
      ot.value.forEach((X, ke) => {
        K[ke] = X.offsetWidth;
      }), Ie.value = K;
    };
    let Dt = null;
    const Ct = () => {
      Dt && Dt.disconnect(), Dt = new ResizeObserver(() => {
        dt();
      }), ot.value.forEach((K) => {
        Dt.observe(K);
      }), dt();
    }, Ve = ce(() => {
      const K = nt.value, X = je.value, ke = K.findIndex((Ye) => Ye === X);
      if (ke < 0)
        return { transform: "translateX(0px)", width: "0px" };
      const Je = Ie.value, pt = Je[X];
      let Xe = 0;
      for (let Ye = 0; Ye < ke; Ye++)
        Xe += Je[K[Ye]] || 0;
      if (!pt) {
        const Ye = 100 / K.length;
        return {
          transform: `translateX(${ke * 100}%)`,
          width: `${Ye}%`
        };
      }
      return {
        transform: `translateX(${Xe}px)`,
        width: `${pt}px`
      };
    }), ht = (K) => {
      !K.target.closest(".language-dropdown") && w.value && (w.value = !1);
    };
    return sA(() => {
      const K = l.value;
      h.value = K === "zh-CN" ? "zh" : "en", document.addEventListener("click", ht), G(), Ct();
    }), Gt(nt, () => {
      Ct();
    }), ga(() => {
      document.removeEventListener("click", ht), O && (O.disconnect(), O = null), Dt && (Dt.disconnect(), Dt = null);
    }), (K, X) => ($(), ee("div", nF, [
      _("div", aF, [
        n.config.showAddTask !== !1 || n.config.showAddMilestone !== !1 ? ($(), ee("div", AF, [
          n.config.showAddTask !== !1 ? ($(), ee("button", {
            key: 0,
            class: "gantt-btn-group-item",
            title: F("addTask"),
            onClick: x
          }, [
            X[0] || (X[0] = _("svg", {
              class: "gantt-btn-icon",
              viewBox: "0 0 24 24",
              fill: "none",
              stroke: "currentColor",
              "stroke-width": "2"
            }, [
              _("line", {
                x1: "12",
                y1: "5",
                x2: "12",
                y2: "19"
              }),
              _("line", {
                x1: "5",
                y1: "12",
                x2: "19",
                y2: "12"
              })
            ], -1)),
            fn(" " + Ee(F("addTask")), 1)
          ], 8, sF)) : vt("", !0),
          n.config.showAddMilestone !== !1 ? ($(), ee("button", {
            key: 1,
            class: "gantt-btn-group-item",
            title: F("addMilestone"),
            onClick: oe
          }, [
            X[1] || (X[1] = Il('<svg class="gantt-btn-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-c8427546><g transform="rotate(45 12 12)" data-v-c8427546><rect x="4" y="4" width="16" height="16" rx="4" ry="4" fill="none" stroke="currentColor" data-v-c8427546></rect></g><line x1="12" y1="8" x2="12" y2="16" data-v-c8427546></line><line x1="8" y1="12" x2="16" y2="12" data-v-c8427546></line></svg>', 1)),
            fn(" " + Ee(F("addMilestone")), 1)
          ], 8, iF)) : vt("", !0)
        ])) : vt("", !0),
        n.config.showViewMode !== !1 ? ($(), ee("div", oF, [
          _("div", lF, [
            _("div", {
              class: "view-mode-thumb",
              style: Mt(W.value)
            }, null, 4)
          ]),
          ($(!0), ee(St, null, nr(A.availableViewModes ?? e, (ke) => ($(), ee("button", {
            key: ke,
            ref_for: !0,
            ref: B(ke),
            class: tr(["view-mode-item", { active: m.value === ke }]),
            title: F(r[ke]) || a[ke],
            onClick: (Je) => Z(ke)
          }, [
            ke === "task" ? ($(), ee("svg", cF, [...X[2] || (X[2] = [
              _("rect", {
                x: "3",
                y: "3",
                width: "7",
                height: "7",
                rx: "1"
              }, null, -1),
              _("rect", {
                x: "14",
                y: "3",
                width: "7",
                height: "7",
                rx: "1"
              }, null, -1),
              _("rect", {
                x: "3",
                y: "14",
                width: "7",
                height: "7",
                rx: "1"
              }, null, -1),
              _("rect", {
                x: "14",
                y: "14",
                width: "7",
                height: "7",
                rx: "1"
              }, null, -1)
            ])])) : ke === "resource" ? ($(), ee("svg", dF, [...X[3] || (X[3] = [
              _("path", { d: "M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" }, null, -1),
              _("circle", {
                cx: "9",
                cy: "7",
                r: "4"
              }, null, -1),
              _("path", { d: "M23 21v-2a4 4 0 0 0-3-3.87" }, null, -1),
              _("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" }, null, -1)
            ])])) : ke === "calendar" ? ($(), ee("svg", fF, [...X[4] || (X[4] = [
              _("rect", {
                x: "3",
                y: "4",
                width: "18",
                height: "18",
                rx: "2",
                ry: "2"
              }, null, -1),
              _("line", {
                x1: "16",
                y1: "2",
                x2: "16",
                y2: "6"
              }, null, -1),
              _("line", {
                x1: "8",
                y1: "2",
                x2: "8",
                y2: "6"
              }, null, -1),
              _("line", {
                x1: "3",
                y1: "10",
                x2: "21",
                y2: "10"
              }, null, -1)
            ])])) : ($(), ee("svg", hF, [...X[5] || (X[5] = [
              _("line", {
                x1: "18",
                y1: "20",
                x2: "18",
                y2: "10"
              }, null, -1),
              _("line", {
                x1: "12",
                y1: "20",
                x2: "12",
                y2: "4"
              }, null, -1),
              _("line", {
                x1: "6",
                y1: "20",
                x2: "6",
                y2: "14"
              }, null, -1)
            ])])),
            fn(" " + Ee(F(r[ke]) || a[ke]), 1)
          ], 10, uF))), 128))
        ])) : vt("", !0),
        n.config.showExpandCollapse !== !1 ? ($(), ee("div", gF, [
          _("button", {
            class: "gantt-btn-group-item",
            title: F("expandAll"),
            onClick: N
          }, [
            X[6] || (X[6] = _("svg", {
              class: "gantt-btn-icon",
              viewBox: "0 0 24 24",
              fill: "none",
              stroke: "currentColor",
              "stroke-width": "2"
            }, [
              _("polyline", { points: "6 9 12 15 18 9" })
            ], -1)),
            fn(" " + Ee(F("expandAll")), 1)
          ], 8, vF),
          _("button", {
            class: "gantt-btn-group-item",
            title: F("collapseAll"),
            onClick: se
          }, [
            X[7] || (X[7] = _("svg", {
              class: "gantt-btn-icon",
              viewBox: "0 0 24 24",
              fill: "none",
              stroke: "currentColor",
              "stroke-width": "2"
            }, [
              _("polyline", { points: "18 15 12 9 6 15" })
            ], -1)),
            fn(" " + Ee(F("collapseAll")), 1)
          ], 8, pF)
        ])) : vt("", !0),
        n.config.showExportCsv !== !1 || n.config.showExportPdf !== !1 ? ($(), ee("div", mF, [
          n.config.showExportCsv !== !1 ? ($(), ee("button", {
            key: 0,
            class: "gantt-btn-group-item",
            title: F("exportCsv"),
            onClick: S
          }, [
            X[8] || (X[8] = Il('<svg class="gantt-btn-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-c8427546><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z" data-v-c8427546></path><polyline points="14,2 14,8 20,8" data-v-c8427546></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-c8427546></line><line x1="16" y1="17" x2="8" y2="17" data-v-c8427546></line><polyline points="10,9 9,9 8,9" data-v-c8427546></polyline></svg>', 1)),
            fn(" " + Ee(F("exportCsv")), 1)
          ], 8, wF)) : vt("", !0),
          n.config.showExportPdf !== !1 ? ($(), ee("button", {
            key: 1,
            class: "gantt-btn-group-item",
            title: F("exportPdf"),
            onClick: I
          }, [
            X[9] || (X[9] = Il('<svg class="gantt-btn-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-c8427546><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z" data-v-c8427546></path><polyline points="14,2 14,8 20,8" data-v-c8427546></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-c8427546></line><line x1="16" y1="17" x2="8" y2="17" data-v-c8427546></line><line x1="12" y1="13" x2="12" y2="17" data-v-c8427546></line></svg>', 1)),
            fn(" " + Ee(F("exportPdf")), 1)
          ], 8, yF)) : vt("", !0)
        ])) : vt("", !0)
      ]),
      _("div", BF, [
        n.config.showTimeScale !== !1 ? ($(), ee("div", bF, [
          _("div", CF, [
            _("div", {
              class: "segmented-thumb",
              style: Mt(Ve.value)
            }, null, 4)
          ]),
          ($(!0), ee(St, null, nr(nt.value, (ke) => ($(), ee("button", {
            key: ke,
            ref_for: !0,
            ref: (Je) => It(ke, Je),
            class: tr(["segmented-item", { active: je.value === ke }]),
            title: F("timeScaleTooltip"),
            onClick: (Je) => ne(De[ke].value)
          }, Ee(De[ke].label()), 11, kF))), 128))
        ])) : vt("", !0),
        n.config.showLanguage !== !1 ? ($(), ee("div", TF, [
          _("button", {
            class: "toolbar-lang-btn",
            title: F("languageTooltip"),
            onClick: C
          }, [
            X[10] || (X[10] = _("svg", {
              class: "gantt-btn-icon",
              viewBox: "0 0 24 24",
              fill: "none",
              stroke: "currentColor",
              "stroke-width": "2"
            }, [
              _("circle", {
                cx: "12",
                cy: "12",
                r: "10"
              }),
              _("line", {
                x1: "2",
                y1: "12",
                x2: "22",
                y2: "12"
              }),
              _("path", { d: "M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" })
            ], -1)),
            _("span", DF, Ee(Y.value), 1),
            X[11] || (X[11] = _("svg", {
              class: "dropdown-arrow",
              viewBox: "0 0 24 24",
              fill: "none",
              stroke: "currentColor",
              "stroke-width": "2"
            }, [
              _("polyline", { points: "6,9 12,15 18,9" })
            ], -1))
          ], 8, xF),
          w.value ? ($(), ee("div", EF, [
            ($(), ee(St, null, nr(["zh", "en"], (ke) => _("div", {
              key: ke,
              class: tr(["language-option", { active: h.value === ke }]),
              onClick: (Je) => H(ke)
            }, [
              _("span", FF, Ee(ke === "zh" ? "中文" : "English"), 1),
              h.value === ke ? ($(), ee("svg", UF, [...X[12] || (X[12] = [
                _("polyline", { points: "20,6 9,17 4,12" }, null, -1)
              ])])) : vt("", !0)
            ], 10, SF)), 64))
          ])) : vt("", !0)
        ])) : vt("", !0),
        n.config.showTodayLocate !== !1 ? ($(), ee("button", {
          key: 2,
          class: "toolbar-icon-btn today-locate-btn",
          title: F("todayLocateTooltip"),
          onClick: J
        }, [...X[13] || (X[13] = [
          Il('<svg class="gantt-btn-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-c8427546><rect x="3" y="4" width="18" height="18" rx="2" ry="2" data-v-c8427546></rect><line x1="16" y1="2" x2="16" y2="6" data-v-c8427546></line><line x1="8" y1="2" x2="8" y2="6" data-v-c8427546></line><line x1="3" y1="10" x2="21" y2="10" data-v-c8427546></line><circle cx="12" cy="16" r="1" data-v-c8427546></circle></svg>', 1)
        ])], 8, LF)) : vt("", !0),
        n.config.showTheme !== !1 ? ($(), ee("button", {
          key: 3,
          class: "toolbar-icon-btn",
          title: F(c.value ? "lightMode" : "darkMode"),
          onClick: le
        }, [
          c.value ? ($(), ee("svg", QF, [...X[14] || (X[14] = [
            Il('<circle cx="12" cy="12" r="5" data-v-c8427546></circle><line x1="12" y1="1" x2="12" y2="3" data-v-c8427546></line><line x1="12" y1="21" x2="12" y2="23" data-v-c8427546></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64" data-v-c8427546></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78" data-v-c8427546></line><line x1="1" y1="12" x2="3" y2="12" data-v-c8427546></line><line x1="21" y1="12" x2="23" y2="12" data-v-c8427546></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36" data-v-c8427546></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22" data-v-c8427546></line>', 9)
          ])])) : ($(), ee("svg", MF, [...X[15] || (X[15] = [
            _("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }, null, -1)
          ])])),
          _("span", _F, Ee(c.value ? "☀️" : "🌙"), 1)
        ], 8, IF)) : vt("", !0),
        n.config.showFullscreen !== !1 ? ($(), ee("button", {
          key: 4,
          class: "toolbar-icon-btn",
          title: F(p.value ? "exitFullscreen" : "fullscreen"),
          onClick: _e
        }, [
          p.value ? ($(), ee("svg", NF, [...X[16] || (X[16] = [
            _("path", { d: "M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3" }, null, -1)
          ])])) : ($(), ee("svg", HF, [...X[17] || (X[17] = [
            _("path", { d: "M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3" }, null, -1)
          ])])),
          _("span", OF, Ee(p.value ? "⇲" : "⇱"), 1)
        ], 8, RF)) : vt("", !0)
      ]),
      ($(), Ir(es, { to: "body" }, [
        T.value ? ($(), ee("div", {
          key: 0,
          class: "gantt-settings-confirm-dialog",
          "data-theme": A.theme
        }, [
          _("div", WF, [
            _("p", KF, Ee(F("confirmDialogMessage")), 1),
            _("div", $F, [
              _("button", {
                class: "gantt-btn gantt-btn-default",
                onClick: we
              }, Ee(F("cancel")), 1),
              _("button", {
                class: "gantt-btn gantt-btn-primary",
                onClick: M
              }, Ee(F("confirm")), 1)
            ])
          ])
        ], 8, PF)) : vt("", !0)
      ]))
    ]));
  }
}), jF = /* @__PURE__ */ Fn(qF, [["__scopeId", "data-v-c8427546"]]), YF = {
  success: "#67c23a",
  // 绿色
  warning: "#e6a23c",
  // 黄色
  error: "#f56c6c",
  // 红色
  info: "#909399"
  // 灰色
};
let Xo = null;
function GF() {
  return Xo || (Xo = document.createElement("div"), Xo.className = "message-container", Xo.style.cssText = `
      position: fixed;
      top: 20px;
      right: 20px;
      z-index: 9999;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 12px;
      pointer-events: none;
    `, document.body.appendChild(Xo)), Xo;
}
const Uc = /* @__PURE__ */ new Map(), Wm = 1e3;
function g5() {
  return { showMessage: (t, e = "success", r) => {
    const a = Date.now(), A = `${e}:${t}`, i = Uc.get(A);
    if (!(r != null && r.allowDuplicate) && i && a - i < Wm)
      return;
    Uc.set(A, a);
    for (const [p, w] of Uc.entries())
      a - w > Wm * 2 && Uc.delete(p);
    const s = document.createElement("div");
    s.className = `message ${e}`, s.textContent = t, s.style.cssText = `
      min-width: 180px;
      max-width: 360px;
      margin: 0;
      padding: 12px 20px 12px 20px;
      border-radius: 4px;
      color: white;
      font-size: 14px;
      background: ${YF[e]};
      box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
      pointer-events: auto;
      opacity: 0;
      display: flex;
      align-items: center;
      gap: 12px;
      transform: translateY(-20px);
      transition: opacity 0.25s, transform 0.25s;
      position: relative;
    `;
    let o = !1;
    const l = (r == null ? void 0 : r.closable) ?? !1;
    if (l) {
      const p = document.createElement("button");
      p.innerHTML = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>', p.style.cssText = `
        background: transparent;
        border: none;
        color: white;
        cursor: pointer;
        margin-left: 8px;
        padding: 0;
        display: flex;
        align-items: center;
        opacity: 0.7;
        transition: opacity 0.2s;
      `, p.onmouseenter = () => p.style.opacity = "1", p.onmouseleave = () => p.style.opacity = "0.7", p.onclick = () => c(), s.appendChild(p);
    }
    const u = GF();
    u.appendChild(s), setTimeout(() => {
      s.style.opacity = "0.98", s.style.transform = "translateY(0)";
    }, 10);
    const f = (r == null ? void 0 : r.duration) ?? (l ? 0 : 3e3);
    let h;
    !l && f > 0 && (h = window.setTimeout(() => c(), f));
    function c() {
      o || (o = !0, s.style.opacity = "0", s.style.transform = "translateY(-20px)", h && clearTimeout(h), setTimeout(() => {
        s.parentNode && (u.removeChild(s), u.childElementCount === 0 && (u.remove(), Xo = null));
      }, 250));
    }
  } };
}
const zF = { class: "el-input__wrapper" }, XF = { class: "el-input__inner" }, JF = ["value", "placeholder", "disabled"], ZF = { class: "el-input__suffix" }, e3 = { class: "el-input__suffix-inner" }, t3 = {
  key: 1,
  class: "el-input__icon"
}, r3 = { class: "el-time-picker-header" }, n3 = { class: "el-time-picker-title" }, a3 = { class: "el-time-picker-content" }, A3 = { class: "el-time-column" }, s3 = { class: "el-time-column-header" }, i3 = ["onClick"], o3 = { class: "el-time-column" }, l3 = { class: "el-time-column-header" }, u3 = ["onClick"], c3 = { class: "el-time-picker-footer" }, d3 = {
  key: 0,
  class: "el-year-picker"
}, f3 = { class: "el-year-picker__header" }, h3 = { class: "el-year-picker__header-label" }, g3 = { class: "el-year-picker__content" }, v3 = ["onClick"], p3 = {
  key: 1,
  class: "el-month-picker"
}, m3 = { class: "el-month-picker__header" }, w3 = { class: "el-month-picker__content" }, y3 = ["onClick"], B3 = {
  key: 2,
  class: "el-date-picker__content-wrapper"
}, b3 = { class: "el-date-picker__header" }, C3 = { class: "el-date-picker__header-label" }, k3 = { class: "el-date-picker__content" }, T3 = { class: "el-date-table__header" }, x3 = { class: "el-date-table__body" }, D3 = ["onClick"], E3 = { class: "el-date-table__cell-inner" }, S3 = {
  key: 0,
  class: "el-time-picker-input"
}, F3 = {
  class: "el-time-picker-label",
  for: "time-input"
}, U3 = ["value", "placeholder"], L3 = {
  key: 1,
  class: "el-date-picker-footer"
}, I3 = /* @__PURE__ */ hn({
  __name: "DatePicker",
  props: {
    modelValue: { default: "" },
    type: { default: "date" },
    placeholder: {},
    startPlaceholder: {},
    endPlaceholder: {},
    disabled: { type: Boolean, default: !1 },
    clearable: { type: Boolean, default: !0 },
    size: { default: "default" },
    format: { default: "YYYY-MM-DD" },
    valueFormat: { default: "YYYY-MM-DD" },
    rangeSeparator: {}
  },
  emits: ["update:modelValue", "change", "focus", "blur"],
  setup(n, { emit: t }) {
    const e = n, r = t, { t: a } = Cs(), A = ce(() => e.placeholder ?? a.value.selectDate), i = ce(() => e.startPlaceholder ?? a.value.startDate), s = ce(() => e.endPlaceholder ?? a.value.endDate), o = ce(() => e.rangeSeparator ?? a.value.to), l = me(!1), u = me(!1), f = me(!1), h = me(!1), c = me(!1), p = me(!1), w = me(), y = me(), m = me(), k = me(), D = me(), B = me(), O = me(null), q = me(0), G = me(""), W = me("12:00"), F = me(""), Y = me(""), T = me((/* @__PURE__ */ new Date()).getFullYear()), E = me((/* @__PURE__ */ new Date()).getMonth()), Q = me(Math.floor((/* @__PURE__ */ new Date()).getFullYear() / 10) * 10), x = me(""), oe = me(""), J = me(""), S = me("start"), I = me("12:00"), N = me(12), se = me(0), Z = (Ge, rt) => {
      if (!Ge) return "";
      const yt = new Date(Ge);
      if (isNaN(yt.getTime())) return "";
      const Ot = e.format.includes("-") ? "-" : "/", vr = `${yt.getFullYear()}${Ot}${String(yt.getMonth() + 1).padStart(2, "0")}${Ot}${String(yt.getDate()).padStart(2, "0")}`;
      return e.type === "datetime" && rt ? `${vr} ${rt}` : vr;
    }, C = ce(() => {
      if (e.type === "daterange") {
        const Ge = oe.value ? Z(oe.value, I.value) : "", rt = J.value ? Z(J.value, I.value) : "";
        return Ge && rt ? `${Ge} ${o.value} ${rt}` : Ge || rt || "";
      }
      return x.value ? Z(x.value, I.value) : "";
    }), H = (Ge) => {
      if (!Ge) return { dateStr: "", timeStr: "12:00" };
      const rt = Ge.trim().split(" ");
      if (rt.length >= 2) {
        const Ot = rt[0], vr = rt[1], jt = Ot.split("/");
        return jt.length === 3 ? { dateStr: `${jt[0]}-${jt[1].padStart(2, "0")}-${jt[2].padStart(2, "0")}`, timeStr: vr } : { dateStr: Ot, timeStr: vr };
      }
      const yt = rt[0];
      if (yt.includes("/")) {
        const Ot = yt.split("/");
        if (Ot.length === 3)
          return { dateStr: `${Ot[0]}-${Ot[1].padStart(2, "0")}-${Ot[2].padStart(2, "0")}`, timeStr: "12:00" };
      }
      return { dateStr: yt, timeStr: "12:00" };
    };
    Gt(
      () => e.modelValue,
      (Ge) => {
        if (e.type === "daterange")
          if (Array.isArray(Ge) && Ge.length === 2) {
            const rt = H(Ge[0] || ""), yt = H(Ge[1] || "");
            oe.value = rt.dateStr, J.value = yt.dateStr, rt.timeStr !== "12:00" && (I.value = rt.timeStr);
          } else
            oe.value = "", J.value = "", I.value = "12:00";
        else {
          const rt = H(Ge || "");
          x.value = rt.dateStr, I.value = rt.timeStr;
        }
      },
      { immediate: !0 }
    );
    const M = () => {
      e.type === "daterange" ? (oe.value = "", J.value = "", r("update:modelValue", ["", ""]), r("change", ["", ""])) : (x.value = "", r("update:modelValue", ""), r("change", "")), f.value = !1;
    }, te = () => {
      if (!e.disabled && (f.value = !f.value, f.value)) {
        e.type === "daterange" ? (F.value = oe.value, Y.value = J.value) : (G.value = x.value, W.value = I.value), je.x = window.scrollX, je.y = window.scrollY, q.value++;
        let Ge;
        if (e.type === "daterange") {
          const rt = oe.value || J.value;
          Ge = rt ? new Date(rt) : /* @__PURE__ */ new Date();
        } else
          Ge = x.value ? new Date(x.value) : /* @__PURE__ */ new Date();
        isNaN(Ge.getTime()) ? (Ge = /* @__PURE__ */ new Date(), T.value = Ge.getFullYear(), E.value = Ge.getMonth()) : (T.value = Ge.getFullYear(), E.value = Ge.getMonth());
      }
    }, ie = () => {
      e.type === "datetime" && f.value ? (x.value = G.value, I.value = W.value) : e.type === "daterange" && f.value && (oe.value = F.value, J.value = Y.value), f.value = !1, h.value = !1, c.value = !1, p.value = !1, l.value = !1, O.value && (clearTimeout(O.value), O.value = null);
    }, we = (Ge) => {
      if (Ge && (Ge.preventDefault(), Ge.stopPropagation()), p.value) return;
      O.value && (clearTimeout(O.value), O.value = null), p.value = !0;
      const [rt, yt] = I.value.split(":").map(Number);
      N.value = rt, se.value = yt, An(() => {
        ve();
      });
    }, ve = () => {
      if (D.value) {
        const Ge = D.value.querySelectorAll(".el-time-item"), rt = N.value;
        if (Ge[rt]) {
          const vr = Math.max(
            0,
            rt * 28 - 80 + 14
          );
          D.value.scrollTop = vr;
        }
      }
      if (B.value) {
        const Ge = B.value.querySelectorAll(".el-time-item"), yt = [0, 15, 30, 45].indexOf(se.value);
        if (yt >= 0 && Ge[yt]) {
          const jt = Math.max(
            0,
            yt * 28 - 80 + 14
          );
          B.value.scrollTop = jt;
        }
      }
    }, le = () => {
      p.value = !1;
    }, _e = () => {
      I.value = `${String(N.value).padStart(2, "0")}:${String(se.value).padStart(2, "0")}`, le();
    }, De = ce(() => Array.from({ length: 24 }, (Ge, rt) => rt)), ze = ce(() => [0, 15, 30, 45]), nt = (Ge) => {
      N.value = Ge;
    }, Qe = (Ge) => {
      se.value = Ge;
    }, ne = () => {
      if (e.type === "daterange") {
        if (oe.value && J.value) {
          const Ge = (vr) => {
            const jt = new Date(vr), br = e.valueFormat.includes("-") ? "-" : "/", on = `${jt.getFullYear()}${br}${String(jt.getMonth() + 1).padStart(2, "0")}${br}${String(jt.getDate()).padStart(2, "0")}`;
            return I.value ? `${on} ${I.value}` : on;
          }, rt = Ge(oe.value), yt = Ge(J.value), Ot = [rt, yt];
          r("update:modelValue", Ot), r("change", Ot), F.value = oe.value, Y.value = J.value;
        }
      } else if (x.value) {
        const Ge = new Date(x.value), rt = e.valueFormat.includes("-") ? "-" : "/", yt = `${Ge.getFullYear()}${rt}${String(Ge.getMonth() + 1).padStart(2, "0")}${rt}${String(Ge.getDate()).padStart(2, "0")}`, Ot = I.value ? `${yt} ${I.value}` : yt;
        r("update:modelValue", Ot), r("change", Ot), G.value = x.value, W.value = I.value;
      }
      setTimeout(() => {
        ie();
      }, 150);
    }, gt = (Ge) => {
      var jt, br, on;
      const rt = Ge.target, yt = (jt = w.value) == null ? void 0 : jt.contains(rt), Ot = (br = y.value) == null ? void 0 : br.contains(rt), vr = (on = m.value) == null ? void 0 : on.contains(rt);
      !yt && !Ot && !vr ? ie() : !vr && p.value && !Ot && le();
    }, je = { x: 0, y: 0 }, ot = () => {
      if (f.value) {
        const Ge = window.scrollX, rt = window.scrollY, yt = Math.abs(Ge - je.x), Ot = Math.abs(rt - je.y);
        yt < 50 && Ot < 50 ? q.value++ : ie(), je.x = Ge, je.y = rt;
      }
    }, Ie = () => {
      f.value && q.value++;
    }, It = ce(() => {
      const Ge = new Date(T.value, E.value, 1), rt = new Date(Ge);
      rt.setDate(rt.getDate() - Ge.getDay());
      const yt = [];
      for (let Ot = 0; Ot < 42; Ot++) {
        const vr = new Date(rt);
        vr.setDate(rt.getDate() + Ot);
        const jt = `${vr.getFullYear()}-${String(vr.getMonth() + 1).padStart(2, "0")}-${String(vr.getDate()).padStart(2, "0")}`, br = vr.getMonth() === E.value, on = jt === (/* @__PURE__ */ new Date()).toISOString().split("T")[0], an = e.type === "daterange" ? jt === oe.value || jt === J.value : jt === x.value, xn = e.type === "daterange" && oe.value && J.value ? jt >= oe.value && jt <= J.value : !1;
        yt.push({
          date: vr,
          dateStr: jt,
          day: vr.getDate(),
          isCurrentMonth: br,
          isToday: on,
          isSelected: an,
          isInRange: xn
        });
      }
      return yt;
    }), dt = (Ge) => {
      if (e.type === "daterange")
        S.value === "start" || !oe.value || oe.value && J.value ? (oe.value = Ge, J.value = "", S.value = "end") : (Ge < oe.value ? (J.value = oe.value, oe.value = Ge) : J.value = Ge, S.value = "start");
      else if (x.value = Ge, e.type === "date") {
        const rt = new Date(Ge), yt = e.valueFormat.includes("-") ? "-" : "/", Ot = `${rt.getFullYear()}${yt}${String(rt.getMonth() + 1).padStart(2, "0")}${yt}${String(rt.getDate()).padStart(2, "0")}`;
        r("update:modelValue", Ot), r("change", Ot), G.value = x.value, setTimeout(() => {
          ie();
        }, 150);
      }
    }, Dt = (Ge) => {
      Ge && (Ge.preventDefault(), Ge.stopPropagation()), O.value && (clearTimeout(O.value), O.value = null), E.value === 0 ? (E.value = 11, T.value--) : E.value--;
    }, Ct = (Ge) => {
      Ge && (Ge.preventDefault(), Ge.stopPropagation()), O.value && (clearTimeout(O.value), O.value = null), E.value === 11 ? (E.value = 0, T.value++) : E.value++;
    }, Ve = (Ge) => {
      Ge && (Ge.preventDefault(), Ge.stopPropagation()), O.value && (clearTimeout(O.value), O.value = null), T.value--;
    }, ht = (Ge) => {
      Ge && (Ge.preventDefault(), Ge.stopPropagation()), O.value && (clearTimeout(O.value), O.value = null), T.value++;
    }, K = (Ge) => {
      Ge && (Ge.preventDefault(), Ge.stopPropagation()), O.value && (clearTimeout(O.value), O.value = null), h.value = !0, c.value = !1, Q.value = Math.floor(T.value / 10) * 10;
    }, X = (Ge) => {
      Ge && (Ge.preventDefault(), Ge.stopPropagation()), O.value && (clearTimeout(O.value), O.value = null), c.value = !0, h.value = !1;
    }, ke = (Ge, rt) => {
      rt && (rt.preventDefault(), rt.stopPropagation()), O.value && (clearTimeout(O.value), O.value = null), T.value = Ge, h.value = !1, c.value = !0;
    }, Je = (Ge, rt) => {
      rt && (rt.preventDefault(), rt.stopPropagation()), O.value && (clearTimeout(O.value), O.value = null), E.value = Ge, c.value = !1;
    }, pt = (Ge) => {
      Ge && (Ge.preventDefault(), Ge.stopPropagation()), O.value && (clearTimeout(O.value), O.value = null), Q.value -= 10;
    }, Xe = (Ge) => {
      Ge && (Ge.preventDefault(), Ge.stopPropagation()), O.value && (clearTimeout(O.value), O.value = null), Q.value += 10;
    }, Ye = ce(() => {
      const Ge = [];
      for (let rt = 0; rt < 10; rt++)
        Ge.push(Q.value + rt);
      return Ge;
    });
    sA(() => {
      document.addEventListener("click", gt), window.addEventListener("scroll", ot, !0), window.addEventListener("resize", Ie), je.x = window.scrollX, je.y = window.scrollY;
    }), ga(() => {
      document.removeEventListener("click", gt), window.removeEventListener("scroll", ot, !0), window.removeEventListener("resize", Ie), O.value && (clearTimeout(O.value), O.value = null);
    });
    const Kt = (Ge) => {
      O.value && (clearTimeout(O.value), O.value = null), l.value = !0, r("focus", Ge);
    }, it = (Ge) => {
      O.value = setTimeout(() => {
        l.value = !1, ie(), r("blur", Ge);
      }, 150);
    }, qt = () => {
      O.value && (clearTimeout(O.value), O.value = null);
    }, hr = () => {
      p.value || (O.value = setTimeout(() => {
        ie();
      }, 150));
    }, Nt = () => {
      O.value = setTimeout(() => {
        le();
      }, 150);
    }, xr = () => {
      u.value = !0;
    }, Jt = () => {
      u.value = !1;
    }, lr = ce(() => [
      "el-date-picker",
      `el-date-picker--${e.size}`,
      {
        "is-disabled": e.disabled,
        "is-focused": l.value,
        "is-range": e.type === "daterange"
      }
    ]), Fr = ce(() => !e.clearable || e.disabled ? !1 : e.type === "daterange" ? (oe.value || J.value) && u.value : x.value && u.value), er = ce(() => {
      if (!w.value || !f.value) return {};
      const Ge = w.value.getBoundingClientRect(), rt = 280, yt = 300, Ot = 4, vr = window.innerWidth, jt = window.innerHeight, br = {
        position: "fixed",
        zIndex: "10000"
      }, on = jt - Ge.bottom, an = Ge.top;
      on >= yt + Ot || on >= an ? br.top = `${Ge.bottom + Ot}px` : br.top = `${Ge.top - yt - Ot}px`;
      const xn = vr - Ge.left, $r = Ge.right;
      if (xn >= rt)
        br.left = `${Ge.left}px`;
      else if ($r >= rt)
        br.left = `${Ge.right - rt}px`;
      else {
        const Ca = Ge.left + (Ge.width - rt) / 2, ka = Ot, Yn = vr - rt - Ot;
        br.left = `${Math.max(ka, Math.min(Ca, Yn))}px`;
      }
      const pn = parseFloat(br.top), Dn = parseFloat(br.left);
      return pn < Ot ? br.top = `${Ot}px` : pn + yt > jt - Ot && (br.top = `${jt - yt - Ot}px`), Dn < Ot ? br.left = `${Ot}px` : Dn + rt > vr - Ot && (br.left = `${vr - rt - Ot}px`), br;
    }), Ar = ce(() => {
      if (!k.value || !p.value) return {};
      const Ge = k.value.getBoundingClientRect(), rt = 180, yt = 300, Ot = 4, vr = window.innerWidth, jt = window.innerHeight, br = {
        position: "fixed",
        zIndex: "10002"
        // 比日历选择器层级更高
      };
      vr - Ge.left >= rt ? br.left = `${Ge.left}px` : br.left = `${Math.max(Ot, vr - rt - Ot)}px`, Ge.top >= yt + Ot ? br.top = `${Ge.top - yt - Ot}px` : br.top = `${Ge.bottom + Ot}px`;
      const xn = parseFloat(br.top);
      return xn < Ot ? br.top = `${Ot}px` : xn + yt > jt - Ot && (br.top = `${jt - yt - Ot}px`), br;
    });
    return (Ge, rt) => ($(), ee("div", {
      class: tr(lr.value),
      onMouseenter: xr,
      onMouseleave: Jt
    }, [
      _("div", {
        ref_key: "inputRef",
        ref: w,
        class: "el-input",
        onClick: te
      }, [
        _("div", zF, [
          _("div", XF, [
            _("input", {
              value: C.value,
              type: "text",
              class: "el-input__inner-input",
              placeholder: n.type === "daterange" ? `${i.value} ${o.value} ${s.value}` : A.value,
              disabled: n.disabled,
              readonly: "",
              onFocus: Kt,
              onBlur: it
            }, null, 40, JF)
          ]),
          _("div", ZF, [
            _("div", e3, [
              Fr.value ? ($(), ee("button", {
                key: 0,
                type: "button",
                class: "el-input__clear",
                onClick: dn(M, ["stop"])
              }, [...rt[12] || (rt[12] = [
                _("svg", {
                  class: "el-icon",
                  viewBox: "0 0 1024 1024"
                }, [
                  _("path", {
                    fill: "currentColor",
                    d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
                  })
                ], -1)
              ])])) : ($(), ee("span", t3, [...rt[13] || (rt[13] = [
                _("svg", {
                  class: "el-icon",
                  viewBox: "0 0 1024 1024"
                }, [
                  _("path", {
                    fill: "currentColor",
                    d: "M128 384v512h768V384H128zm-32-64h832a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V352a32 32 0 0 1 32-32z"
                  }),
                  _("path", {
                    fill: "currentColor",
                    d: "M288 128a32 32 0 0 1 64 0v192a32 32 0 0 1-64 0V128zm384 0a32 32 0 0 1 64 0v192a32 32 0 0 1-64 0V128z"
                  }),
                  _("path", {
                    fill: "currentColor",
                    d: "M96 320h832q32 0 32 32t-32 32H96q-32 0-32-32t32-32z"
                  })
                ], -1)
              ])]))
            ])
          ])
        ])
      ], 512),
      ($(), Ir(es, { to: "body" }, [
        na(bm, { name: "picker-fade" }, {
          default: qa(() => [
            p.value ? ($(), ee("div", {
              key: 0,
              ref_key: "timePickerRef",
              ref: m,
              class: "el-time-picker-panel",
              style: Mt(Ar.value),
              tabindex: "-1",
              onClick: rt[4] || (rt[4] = dn(() => {
              }, ["stop"])),
              onMousedown: rt[5] || (rt[5] = dn(() => {
              }, ["prevent"])),
              onFocus: qt,
              onBlur: Nt
            }, [
              _("div", r3, [
                _("span", n3, Ee(Te(a).selectTime), 1)
              ]),
              _("div", a3, [
                _("div", A3, [
                  _("div", s3, Ee(Te(a).hour), 1),
                  _("div", {
                    ref_key: "hourListRef",
                    ref: D,
                    class: "el-time-column-list"
                  }, [
                    ($(!0), ee(St, null, nr(De.value, (yt) => ($(), ee("div", {
                      key: yt,
                      class: tr(["el-time-item", { "is-active": yt === N.value }]),
                      onClick: dn((Ot) => nt(yt), ["stop"]),
                      onMousedown: rt[0] || (rt[0] = dn(() => {
                      }, ["prevent"]))
                    }, Ee(String(yt).padStart(2, "0")), 43, i3))), 128))
                  ], 512)
                ]),
                _("div", o3, [
                  _("div", l3, Ee(Te(a).minute), 1),
                  _("div", {
                    ref_key: "minuteListRef",
                    ref: B,
                    class: "el-time-column-list"
                  }, [
                    ($(!0), ee(St, null, nr(ze.value, (yt) => ($(), ee("div", {
                      key: yt,
                      class: tr(["el-time-item", { "is-active": yt === se.value }]),
                      onClick: dn((Ot) => Qe(yt), ["stop"]),
                      onMousedown: rt[1] || (rt[1] = dn(() => {
                      }, ["prevent"]))
                    }, Ee(String(yt).padStart(2, "0")), 43, u3))), 128))
                  ], 512)
                ])
              ]),
              _("div", c3, [
                _("button", {
                  class: "el-time-picker-btn el-time-picker-btn--cancel",
                  onClick: dn(le, ["stop"]),
                  onMousedown: rt[2] || (rt[2] = dn(() => {
                  }, ["prevent"]))
                }, Ee(Te(a).cancel), 33),
                _("button", {
                  class: "el-time-picker-btn el-time-picker-btn--confirm",
                  onClick: dn(_e, ["stop"]),
                  onMousedown: rt[3] || (rt[3] = dn(() => {
                  }, ["prevent"]))
                }, Ee(Te(a).confirm), 33)
              ])
            ], 36)) : vt("", !0)
          ]),
          _: 1
        })
      ])),
      ($(), Ir(es, { to: "body" }, [
        na(bm, { name: "picker-fade" }, {
          default: qa(() => [
            f.value ? ($(), ee("div", {
              key: 0,
              ref_key: "pickerRef",
              ref: y,
              class: "el-picker-panel",
              style: Mt(er.value),
              tabindex: "-1",
              onFocus: qt,
              onBlur: hr
            }, [
              h.value ? ($(), ee("div", d3, [
                _("div", f3, [
                  _("button", {
                    type: "button",
                    class: "el-picker-panel__icon-btn",
                    onClick: pt
                  }, " << "),
                  _("span", h3, Ee(Q.value) + " - " + Ee(Q.value + 9), 1),
                  _("button", {
                    type: "button",
                    class: "el-picker-panel__icon-btn",
                    onClick: Xe
                  }, " >> ")
                ]),
                _("div", g3, [
                  ($(!0), ee(St, null, nr(Ye.value, (yt) => ($(), ee("div", {
                    key: yt,
                    class: tr(["el-year-picker__item", { "is-current": yt === T.value }]),
                    onClick: (Ot) => ke(yt, Ot)
                  }, Ee(yt), 11, v3))), 128))
                ])
              ])) : c.value ? ($(), ee("div", p3, [
                _("div", m3, [
                  _("button", {
                    type: "button",
                    class: "el-picker-panel__icon-btn",
                    onClick: Ve
                  }, " << "),
                  _("span", {
                    class: "el-month-picker__header-label",
                    onClick: rt[6] || (rt[6] = (yt) => K(yt))
                  }, Ee(T.value), 1),
                  _("button", {
                    type: "button",
                    class: "el-picker-panel__icon-btn",
                    onClick: ht
                  }, " >> ")
                ]),
                _("div", w3, [
                  ($(!0), ee(St, null, nr(Te(a).monthNames, (yt, Ot) => ($(), ee("div", {
                    key: Ot,
                    class: tr(["el-month-picker__item", { "is-current": Ot === E.value }]),
                    onClick: (vr) => Je(Ot, vr)
                  }, Ee(yt), 11, y3))), 128))
                ])
              ])) : ($(), ee("div", B3, [
                _("div", b3, [
                  _("button", {
                    type: "button",
                    class: "el-picker-panel__icon-btn",
                    onClick: Ve
                  }, " << "),
                  _("button", {
                    type: "button",
                    class: "el-picker-panel__icon-btn",
                    onClick: Dt
                  }, " < "),
                  _("span", C3, [
                    _("span", {
                      class: "el-date-picker__header-year",
                      onClick: rt[7] || (rt[7] = (yt) => K(yt))
                    }, Ee(T.value), 1),
                    _("span", {
                      class: "el-date-picker__header-month",
                      onClick: rt[8] || (rt[8] = (yt) => X(yt))
                    }, Ee(Te(a).monthNames[E.value]), 1)
                  ]),
                  _("button", {
                    type: "button",
                    class: "el-picker-panel__icon-btn",
                    onClick: Ct
                  }, " > "),
                  _("button", {
                    type: "button",
                    class: "el-picker-panel__icon-btn",
                    onClick: ht
                  }, " >> ")
                ]),
                _("div", k3, [
                  _("div", T3, [
                    ($(!0), ee(St, null, nr(Te(a).weekDays, (yt) => ($(), ee("div", {
                      key: yt,
                      class: "el-date-table__header-cell"
                    }, Ee(yt), 1))), 128))
                  ]),
                  _("div", x3, [
                    ($(!0), ee(St, null, nr(It.value, (yt) => ($(), ee("div", {
                      key: `${yt.date.getTime()}`,
                      class: tr(["el-date-table__cell", {
                        "is-other-month": !yt.isCurrentMonth,
                        "is-today": yt.isToday,
                        "is-selected": yt.isSelected,
                        "is-in-range": yt.isInRange,
                        "is-range-start": n.type === "daterange" && yt.dateStr === oe.value,
                        "is-range-end": n.type === "daterange" && yt.dateStr === J.value
                      }]),
                      onClick: (Ot) => dt(yt.dateStr)
                    }, [
                      _("div", E3, Ee(yt.day), 1)
                    ], 10, D3))), 128))
                  ])
                ]),
                n.type === "datetime" ? ($(), ee("div", S3, [
                  _("label", F3, Ee(Te(a).time) + ":", 1),
                  _("input", {
                    id: "time-input",
                    ref_key: "timeInputRef",
                    ref: k,
                    type: "text",
                    class: "el-time-input",
                    value: I.value,
                    placeholder: Te(a).selectTime,
                    readonly: "",
                    onClick: rt[9] || (rt[9] = (yt) => we(yt)),
                    onMousedown: rt[10] || (rt[10] = dn(() => {
                    }, ["prevent"]))
                  }, null, 40, U3)
                ])) : vt("", !0),
                n.type === "datetime" ? ($(), ee("div", L3, [
                  _("button", {
                    class: "el-date-picker-btn el-date-picker-btn--confirm",
                    onClick: dn(ne, ["stop"]),
                    onMousedown: rt[11] || (rt[11] = dn(() => {
                    }, ["prevent"]))
                  }, Ee(Te(a).confirm), 33)
                ])) : vt("", !0)
              ]))
            ], 36)) : vt("", !0)
          ]),
          _: 1
        })
      ]))
    ], 34));
  }
}), Ol = /* @__PURE__ */ Fn(I3, [["__scopeId", "data-v-fdd5e5b4"]]), Q3 = { class: "multi-select-predecessor" }, M3 = {
  class: "form-label",
  for: "predecessor-select"
}, _3 = { class: "predecessor-selector" }, R3 = {
  key: 0,
  class: "selected-tags"
}, N3 = ["onClick"], H3 = { class: "select-wrapper" }, O3 = { value: "" }, P3 = ["value"], W3 = /* @__PURE__ */ hn({
  __name: "MultiSelectPredecessor",
  props: {
    modelValue: { default: () => [] },
    tasks: {},
    currentTaskId: { default: void 0 },
    label: { default: "前置任务" },
    placeholder: { default: "请选择前置任务" }
  },
  emits: ["update:modelValue"],
  setup(n, { emit: t }) {
    const e = n, r = t, a = me(""), A = ce(() => e.modelValue || []), i = ce(() => A.value.map((u) => e.tasks.find((f) => f.id === u)).filter((u) => u)), s = ce(() => e.tasks.filter(
      (u) => u.type === "task" && u.id !== e.currentTaskId && !A.value.includes(u.id)
    )), o = () => {
      if (a.value) {
        const u = Number(a.value);
        if (!A.value.includes(u)) {
          const f = [...A.value, u];
          r("update:modelValue", f);
        }
        a.value = "";
      }
    }, l = (u) => {
      const f = A.value.filter((h) => h !== u);
      r("update:modelValue", f);
    };
    return Gt(
      () => e.modelValue,
      () => {
        a.value = "";
      },
      { immediate: !0 }
    ), (u, f) => ($(), ee("div", Q3, [
      _("label", M3, Ee(n.label), 1),
      _("div", _3, [
        i.value.length > 0 ? ($(), ee("div", R3, [
          ($(!0), ee(St, null, nr(i.value, (h) => ($(), ee("span", {
            key: h.id,
            class: "predecessor-tag"
          }, [
            fn(Ee(h.name) + " (" + Ee(h.id) + ") ", 1),
            _("button", {
              type: "button",
              class: "remove-tag-btn",
              onClick: (c) => l(h.id)
            }, " × ", 8, N3)
          ]))), 128))
        ])) : vt("", !0),
        _("div", H3, [
          us(_("select", {
            id: "predecessor-select",
            "onUpdate:modelValue": f[0] || (f[0] = (h) => a.value = h),
            class: "form-select",
            onChange: o
          }, [
            _("option", O3, Ee(n.placeholder), 1),
            ($(!0), ee(St, null, nr(s.value, (h) => ($(), ee("option", {
              key: h.id,
              value: h.id
            }, Ee(h.name) + " (ID: " + Ee(h.id) + ") ", 9, P3))), 128))
          ], 544), [
            [xu, a.value]
          ])
        ])
      ])
    ]));
  }
}), K3 = /* @__PURE__ */ Fn(W3, [["__scopeId", "data-v-bc7f35cb"]]), $3 = ["placeholder"], V3 = {
  key: 0,
  class: "ras-dropdown"
}, q3 = ["onClick"], j3 = {
  key: 0,
  class: "ras-option ras-empty"
}, Y3 = /* @__PURE__ */ hn({
  __name: "ResourceAssigneeSelect",
  props: {
    modelValue: { default: "" },
    options: { default: () => [] },
    placeholder: { default: "选择资源" }
  },
  emits: ["update:modelValue"],
  setup(n, { emit: t }) {
    const e = n, r = t, a = me(!1), A = me(""), i = me(null), s = me(null), o = ce(
      () => e.options.find((y) => y.value === e.modelValue)
    ), l = ce(() => {
      const y = A.value.trim().toLowerCase();
      return y ? e.options.filter((m) => m.label.toLowerCase().includes(y)) : e.options;
    }), u = () => {
      a.value || (a.value = !0, A.value = "", An(() => {
        var y;
        return (y = s.value) == null ? void 0 : y.focus();
      }));
    }, f = () => {
      a.value = !1, A.value = "";
    }, h = () => {
      a.value ? f() : u();
    }, c = (y) => {
      r("update:modelValue", y.value), f();
    }, p = () => {
      r("update:modelValue", ""), f();
    }, w = (y) => {
      i.value && !i.value.contains(y.target) && f();
    };
    return Gt(a, (y) => {
      y ? document.addEventListener("mousedown", w) : document.removeEventListener("mousedown", w);
    }), Gt(
      () => e.options,
      () => {
        f();
      }
    ), (y, m) => ($(), ee("div", {
      ref_key: "wrapperRef",
      ref: i,
      class: tr(["resource-assignee-select", { "is-open": a.value }])
    }, [
      _("div", {
        class: "ras-control",
        onClick: h
      }, [
        a.value ? us(($(), ee("input", {
          key: 0,
          ref_key: "searchInputRef",
          ref: s,
          "onUpdate:modelValue": m[0] || (m[0] = (k) => A.value = k),
          type: "text",
          class: "ras-search-input",
          placeholder: n.placeholder,
          onClick: m[1] || (m[1] = dn(() => {
          }, ["stop"])),
          onKeydown: i5(f, ["esc"])
        }, null, 40, $3)), [
          [Qi, A.value]
        ]) : ($(), ee("span", {
          key: 1,
          class: tr(["ras-value", { "ras-placeholder": !o.value }])
        }, Ee(o.value ? o.value.label : n.placeholder), 3)),
        m[2] || (m[2] = _("svg", {
          class: "ras-arrow",
          width: "10",
          height: "10",
          viewBox: "0 0 24 24",
          fill: "none"
        }, [
          _("path", {
            d: "M6 9l6 6 6-6",
            stroke: "currentColor",
            "stroke-width": "2",
            "stroke-linecap": "round",
            "stroke-linejoin": "round"
          })
        ], -1))
      ]),
      a.value ? ($(), ee("ul", V3, [
        _("li", {
          class: "ras-option ras-option-empty",
          onClick: p
        }, Ee(n.placeholder), 1),
        ($(!0), ee(St, null, nr(l.value, (k) => ($(), ee("li", {
          key: k.key ?? k.value,
          class: tr(["ras-option", { active: k.value === n.modelValue }]),
          onClick: (D) => c(k)
        }, Ee(k.label), 11, q3))), 128)),
        l.value.length === 0 ? ($(), ee("li", j3, "无匹配资源")) : vt("", !0)
      ])) : vt("", !0)
    ], 2));
  }
}), G3 = /* @__PURE__ */ Fn(Y3, [["__scopeId", "data-v-65ec3c48"]]), z3 = ["data-theme"], X3 = {
  class: "drawer-header",
  style: { display: "flex", "align-items": "center", "justify-content": "flex-start", gap: "8px" }
}, J3 = {
  class: "drawer-title",
  style: { margin: "0" }
}, Z3 = {
  key: 0,
  class: "drawer-timer",
  style: { display: "flex", "align-items": "center", gap: "6px", "margin-left": "8px" }
}, eU = {
  width: "24",
  height: "24",
  viewBox: "0 0 24 24",
  fill: "none",
  style: { display: "block", margin: "0 auto" }
}, tU = {
  key: 0,
  class: "timer-dot",
  style: { background: "#67c23a", width: "7px", height: "7px", "border-radius": "50%", "margin-right": "5px", animation: "pulse 1s infinite" }
}, rU = {
  class: "close-icon",
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  style: { "vertical-align": "middle" }
}, nU = { class: "drawer-body" }, aU = { class: "form-group" }, AU = {
  class: "form-label",
  for: "task-name"
}, sU = ["placeholder"], iU = {
  key: 0,
  class: "error-text"
}, oU = { class: "form-group" }, lU = {
  class: "form-label",
  for: "task-type"
}, uU = { value: "story" }, cU = { value: "task" }, dU = { value: "bug" }, fU = {
  key: 0,
  class: "error-text"
}, hU = { class: "form-group" }, gU = { class: "form-label" }, vU = { class: "resource-list" }, pU = { class: "resource-header" }, mU = {
  key: 0,
  class: "resource-header-label resource-header-label-type"
}, wU = ["onUpdate:modelValue", "onChange"], yU = ["value"], BU = ["onUpdate:modelValue", "onChange"], bU = ["onClick"], CU = { class: "form-group" }, kU = {
  class: "form-label",
  for: "task-parent"
}, TU = { value: void 0 }, xU = ["value"], DU = { class: "form-row" }, EU = { class: "form-group" }, SU = {
  class: "form-label",
  for: "task-start-date"
}, FU = {
  key: 0,
  class: "error-text"
}, UU = { class: "form-group" }, LU = {
  class: "form-label",
  for: "task-end-date"
}, IU = {
  key: 0,
  class: "error-text"
}, QU = { class: "form-row" }, MU = { class: "form-group" }, _U = {
  class: "form-label",
  for: "task-actual-start-date"
}, RU = {
  key: 0,
  class: "error-text"
}, NU = { class: "form-group" }, HU = {
  class: "form-label",
  for: "task-actual-end-date"
}, OU = {
  key: 0,
  class: "error-text"
}, PU = { class: "form-row" }, WU = { class: "form-group" }, KU = {
  class: "form-label",
  for: "task-estimated-hours"
}, $U = { class: "form-group" }, VU = {
  class: "form-label",
  for: "task-actual-hours"
}, qU = { class: "form-group" }, jU = {
  class: "form-label",
  for: "task-progress"
}, YU = { class: "progress-container" }, GU = { class: "progress-input-group" }, zU = { class: "form-group" }, XU = {
  class: "form-label",
  for: "task-description"
}, JU = ["placeholder"], ZU = { class: "drawer-footer" }, eL = { class: "footer-left" }, tL = ["disabled"], rL = {
  key: 0,
  class: "loading-spinner"
}, nL = { class: "footer-right" }, aL = ["disabled"], AL = {
  key: 0,
  class: "loading-spinner"
}, sL = /* @__PURE__ */ hn({
  __name: "TaskDrawer",
  props: {
    visible: { type: Boolean, default: !1 },
    task: { default: null },
    isEdit: { type: Boolean, default: !1 },
    onDelete: { type: Function, default: void 0 },
    assigneeOptions: { default: () => [
      { value: "zhangsan", label: "张三" },
      { value: "lisi", label: "李四" },
      { value: "wangwu", label: "王五" },
      { value: "zhaoliu", label: "赵六" },
      { value: "qianqi", label: "钱七" }
    ] },
    resourceTypeOptions: { default: () => [] },
    showResourceTypeOption: { type: Boolean, default: !0 },
    pendingTaskBackgroundColor: { default: "#c0c4cc" },
    delayTaskBackgroundColor: { default: "#f56c6c" },
    completeTaskBackgroundColor: { default: "#67c23a" },
    ongoingTaskBackgroundColor: { default: "#409eff" },
    enableCloseOnOverlayClick: { type: Boolean, default: !0 }
  },
  emits: ["update:visible", "submit", "close", "delete", "start-timer", "stop-timer"],
  setup(n, { emit: t }) {
    const e = n, r = t, { t: a } = Cs(), { showMessage: A } = g5(), i = Mr("gantt-theme"), s = me(!1), o = me(e.visible), l = me(!1), u = me(0), f = me(null), h = ce(() => {
      var K;
      return (K = e.task) == null ? void 0 : K.isTimerRunning;
    }), c = ce(() => {
      var K;
      return (K = e.task) == null ? void 0 : K.timerStartTime;
    }), p = ce(() => {
      var K;
      return ((K = e.task) == null ? void 0 : K.timerElapsedTime) || 0;
    }), w = ce(() => {
      const K = Math.floor(u.value / 1e3), X = Math.floor(K / 3600), ke = Math.floor(K % 3600 / 60), Je = K % 60;
      return `${String(X).padStart(2, "0")}:${String(ke).padStart(2, "0")}:${String(Je).padStart(2, "0")}`;
    }), y = () => {
      h.value && c.value ? u.value = Date.now() - c.value + p.value : u.value = p.value;
    };
    Gt(
      () => {
        var K, X, ke;
        return [(K = e.task) == null ? void 0 : K.isTimerRunning, (X = e.task) == null ? void 0 : X.timerStartTime, (ke = e.task) == null ? void 0 : ke.timerElapsedTime];
      },
      () => {
        y();
      }
    );
    const m = me(!1);
    Gt(
      () => {
        var K;
        return (K = e.task) == null ? void 0 : K.isTimerRunning;
      },
      (K) => {
        m.value = !!K, !K && f.value && (clearInterval(f.value), f.value = null);
      },
      { immediate: !0 }
    ), Gt(
      [m, c, p],
      () => {
        f.value && (clearInterval(f.value), f.value = null), m.value && c.value ? (y(), f.value = window.setInterval(y, 1e3)) : y();
      },
      { immediate: !0 }
    ), ga(() => {
      f.value && clearInterval(f.value);
    });
    const k = ce(() => {
      var K;
      return ((K = e.task) == null ? void 0 : K.type) === "story" ? "yes-no-cancel" : "confirm-cancel";
    }), D = ce(() => {
      var K, X, ke;
      return ((K = e.task) == null ? void 0 : K.type) === "story" ? a.value.confirmDeleteStory.replace("{name}", ((X = e.task) == null ? void 0 : X.name) || "") : a.value.confirmDeleteTask.replace("{name}", ((ke = e.task) == null ? void 0 : ke.name) || "");
    }), B = Gl({
      id: 0,
      // 默认值,创建时会被重新分配
      name: "",
      type: "task",
      assignee: "",
      startDate: "",
      endDate: "",
      actualStartDate: "",
      actualEndDate: "",
      predecessor: [],
      estimatedHours: 0,
      actualHours: 0,
      progress: 0,
      description: "",
      parentId: void 0,
      // 上级任务ID
      isTimerRunning: !1,
      // 是否正在计时
      timerStartTime: void 0,
      // 计时器开始时间
      timerEndTime: void 0,
      // 计时器结束时间
      timerElapsedTime: 0,
      // 计时器已用时间
      children: void 0,
      // 子任务列表
      resources: []
      // v1.9.0 资源分配列表(包含占比)
    }), O = me([]), q = ce(() => O.value.filter(
      (K) => {
        var X;
        return K.id !== ((X = e.task) == null ? void 0 : X.id) && // 排除当前任务自己
        (K.type === "story" || K.type === "task");
      }
      // 只显示story和task类型
    ).map((K) => ({
      ...K,
      displayName: `${K.name} (${G(K.type || "task")})`
    }))), G = (K) => {
      var X;
      return ((X = a.value.taskTypeMap) == null ? void 0 : X[K]) || K;
    }, W = ce(() => ({
      "--progress-capacity": `${B.progress || 0}%`
    })), F = me("0"), Y = (K) => {
      const X = K.target;
      let ke = X.value;
      ke = ke.replace(/[^\d]/g, ""), X.value = ke, F.value = ke;
    }, T = () => {
      const K = F.value;
      let X = parseInt(K) || 0;
      X < 0 || isNaN(X) ? X = 0 : X > 100 && (X = 100), B.progress = X, F.value = X.toString();
    }, E = (K) => {
      const X = K.target;
      let ke = parseFloat(X.value);
      isNaN(ke) || ke < 0 ? ke = 0 : ke > 99999 && (ke = 99999), B.estimatedHours = Math.round(ke * 100) / 100;
    }, Q = (K) => {
      const X = K.target;
      let ke = parseFloat(X.value);
      isNaN(ke) || ke < 0 ? ke = 0 : ke > 99999 && (ke = 99999), B.actualHours = Math.round(ke * 100) / 100;
    }, x = (K) => {
      const X = K.target;
      setTimeout(() => {
        X.select();
      }, 0);
    }, oe = (K) => {
      const X = K.key, ke = [
        "Backspace",
        "Delete",
        "Tab",
        "Escape",
        "Enter",
        "ArrowLeft",
        "ArrowRight",
        "ArrowUp",
        "ArrowDown",
        "Home",
        "End",
        "Control",
        "Meta",
        "Alt",
        "Shift"
      ], Je = /^\d$/.test(X), pt = ke.includes(X);
      K.ctrlKey || K.metaKey || !Je && !pt && K.preventDefault();
    }, J = (K, X) => {
      if (!K) return "";
      if (typeof K == "string" && /^\d{4}-\d{2}-\d{2}$/.test(K.trim())) {
        if (X === "start")
          return `${K} 00:00`;
        if (X === "end") {
          const [ke, Je, pt] = K.split("-").map(Number), Xe = new Date(ke, Je - 1, pt);
          Xe.setDate(Xe.getDate() + 1);
          const Ye = Xe.getFullYear(), Kt = String(Xe.getMonth() + 1).padStart(2, "0"), it = String(Xe.getDate()).padStart(2, "0");
          return `${Ye}-${Kt}-${it} 00:00`;
        }
      }
      return K;
    }, S = Gl({
      name: "",
      type: "",
      startDate: "",
      endDate: "",
      actualStartDate: "",
      actualEndDate: ""
    });
    Gt(
      () => e.visible,
      (K) => {
        if (o.value = K, K) {
          if (e.task && e.isEdit) {
            I();
            const X = { ...e.task };
            X.startDate = J(X.startDate, "start"), X.endDate = J(X.endDate, "end"), An(() => {
              Object.assign(B, X), Ct(), Ie();
            });
          } else e.task && !e.isEdit ? (I(), B.parentId = e.task.parentId ?? void 0, B.predecessor = e.task.predecessor ?? [], e.task.startDate && (B.startDate = J(e.task.startDate, "start")), e.task.endDate && (B.endDate = J(e.task.endDate, "end")), e.task.resources && e.task.resources.length > 0 && (B.resources = e.task.resources.map((X) => ({ ...X })), Ie())) : I();
          window.dispatchEvent(new CustomEvent("request-task-list"));
        }
      }
    ), Gt(o, (K) => {
      r("update:visible", K);
    }), Gt(
      () => e.task,
      (K) => {
        K && !e.isEdit && (B.parentId = K.parentId ?? void 0);
      },
      { immediate: !0 }
    );
    const I = () => {
      Object.assign(B, {
        name: "",
        type: "task",
        assignee: "",
        startDate: "",
        endDate: "",
        actualStartDate: "",
        actualEndDate: "",
        predecessor: [],
        estimatedHours: 0,
        actualHours: 0,
        progress: 0,
        description: "",
        parentId: void 0,
        isTimerRunning: !1,
        timerStartTime: void 0,
        timerEndTime: void 0,
        timerElapsedTime: 0,
        children: void 0,
        bgColor: void 0,
        avatar: void 0,
        barColor: void 0,
        resources: []
        // v1.9.0 资源分配
      }), Object.keys(S).forEach((K) => {
        S[K] = "";
      });
    }, N = () => {
      var X;
      let K = !0;
      return Object.keys(S).forEach((ke) => {
        S[ke] = "";
      }), (X = B.name) != null && X.trim() ? B.name.length > 50 && (S.name = a.value.taskNameTooLong, K = !1) : (S.name = a.value.taskNameRequired, K = !1), B.type || (S.type = a.value.taskTypeRequired, K = !1), B.startDate || (S.startDate = a.value.plannedStartDateRequired, K = !1), B.endDate ? B.startDate && new Date(B.endDate) < new Date(B.startDate) && (S.endDate = a.value.plannedEndDateInvalid, K = !1) : (S.endDate = a.value.plannedEndDateRequired, K = !1), B.actualStartDate && B.actualEndDate && new Date(B.actualEndDate) < new Date(B.actualStartDate) && (S.actualEndDate = a.value.actualEndDateInvalid, K = !1), K;
    }, se = () => {
      o.value = !1, r("close");
    }, Z = () => {
      e.enableCloseOnOverlayClick && se();
    }, C = async () => {
      if (N())
        try {
          s.value = !0, Ve();
          const K = {
            ...B,
            id: e.isEdit && e.task ? e.task.id : Date.now(),
            resources: B.resources
            // 确保提交 resources 字段
          };
          r("submit", K), se();
        } catch {
        } finally {
          s.value = !1;
        }
    }, H = () => {
      l.value = !0;
    }, M = (K) => {
      let X = "";
      K && typeof K == "object" && "message" in K && typeof K.message == "string" ? X = K.message : X = String(K), A(X, "error", { closable: !0 });
    }, te = () => {
      if (l.value = !1, e.task && e.isEdit)
        try {
          s.value = !0, r("delete", e.task), se();
        } catch (K) {
          M(K);
        } finally {
          s.value = !1;
        }
    }, ie = () => {
      l.value = !1;
    }, we = () => {
      if (l.value = !1, e.task && e.isEdit)
        try {
          s.value = !0, r("delete", e.task, !0), se();
        } catch (K) {
          M(K);
        } finally {
          s.value = !1;
        }
    }, ve = () => {
      if (l.value = !1, e.task && e.isEdit)
        try {
          s.value = !0, r("delete", e.task, !1), se();
        } catch (K) {
          M(K);
        } finally {
          s.value = !1;
        }
    }, le = (K) => {
      O.value = K.detail || [];
    };
    sA(() => {
      window.addEventListener("task-list-updated", le), window.dispatchEvent(new CustomEvent("request-task-list"));
    }), ga(() => {
      window.removeEventListener("task-list-updated", le);
    }), Gt(
      () => B.progress,
      (K) => {
        F.value = (K || 0).toString();
      },
      { immediate: !0 }
    ), Gt(
      () => e.visible,
      (K) => {
        K && e.task && e.task.type !== "story" && (u.value = e.task.timerElapsedTime || 0, e.task.isTimerRunning || f.value && (clearInterval(f.value), f.value = null));
      },
      { immediate: !0 }
    );
    const _e = (K) => {
      const X = Date.now();
      e.task && typeof e.task == "object" && (Object.assign(e.task, {
        timerStartTime: X,
        isTimerRunning: !0,
        timerElapsedTime: 0,
        // 每次从0秒开始
        timerStartDesc: K || ""
      }), r("start-timer", e.task)), u.value = 0, m.value = !0, y(), f.value && (clearInterval(f.value), f.value = null), window.dispatchEvent(new CustomEvent("start-timer", { detail: e.task }));
    }, De = () => {
      e.task && typeof e.task == "object" && r("stop-timer", e.task), m.value = !1, f.value && (clearInterval(f.value), f.value = null), y(), window.dispatchEvent(new CustomEvent("stop-timer", { detail: e.task }));
    }, ze = me(!1), nt = me("");
    function Qe() {
      var K;
      nt.value = ((K = e.task) == null ? void 0 : K.name) || "", ze.value = !0;
    }
    function ne() {
      ze.value = !1;
    }
    function gt(K) {
      ze.value = !1, _e(K);
    }
    const je = () => {
      B.resources || (B.resources = []), B.resources.push(
        Tm({
          id: "",
          name: "",
          type: "Human",
          // v1.13.5 默认类别
          capacity: 100,
          tasks: []
        })
      );
    }, ot = (K) => {
      B.resources && B.resources.length > K && B.resources.splice(K, 1);
    }, Ie = () => {
      !B.resources || B.resources.length === 0 || B.resources.forEach((K) => {
        K.type || (K.type = "Human");
      });
    }, It = (K) => {
      const X = e.assigneeOptions || [];
      return K.type ? X.filter((ke) => (ke.type || "Human") === K.type) : X;
    }, dt = ce(() => e.resourceTypeOptions && e.resourceTypeOptions.length > 0 ? e.resourceTypeOptions : [
      { value: "Human", label: a.value.resourceCategoryHuman || "人力" },
      { value: "Device", label: a.value.resourceCategoryDevice || "设备" },
      { value: "Others", label: a.value.resourceCategoryOthers || "其他" }
    ]), Dt = (K, X, ke) => {
      var Je;
      if (!(!B.resources || !B.resources[K]))
        if (X === "id") {
          const pt = (Je = e.assigneeOptions) == null ? void 0 : Je.find((Xe) => Xe.value === ke);
          pt ? (B.resources[K].id = pt.value, B.resources[K].name = pt.label, B.resources[K].type = pt.type || "Human") : (B.resources[K].id = "", B.resources[K].name = "");
        } else if (X === "capacity") {
          let pt = typeof ke == "string" ? parseInt(ke) : ke;
          pt < 20 && (pt = 20), pt > 100 && (pt = 100), B.resources[K].capacity = pt;
        } else X === "type" && (B.resources[K].type = String(ke) || "Human", B.resources[K].id = "", B.resources[K].name = "");
    }, Ct = () => {
      if (B.resources || (B.resources = []), B.resources && B.resources.length > 0)
        return;
      const K = Array.isArray(B.assignee) ? B.assignee : B.assignee ? [B.assignee] : [];
      B.resources = K.map((X) => {
        var Je;
        const ke = (Je = e.assigneeOptions) == null ? void 0 : Je.find((pt) => pt.value === X);
        return Tm({
          id: X,
          name: (ke == null ? void 0 : ke.label) || String(X),
          type: (ke == null ? void 0 : ke.type) || "Human",
          // v1.13.5 旧数据迁移时默认 'Human'
          capacity: 100,
          // 默认100%
          tasks: []
        });
      });
    }, Ve = () => {
      if (!B.resources || B.resources.length === 0) {
        B.assignee = "", B.avatar = "";
        return;
      }
      const K = B.resources.map((ke) => String(ke.id)).filter((ke) => ke);
      B.assignee = K.length > 1 ? K : K[0] || "";
      const X = B.resources.map((ke) => {
        var pt;
        const Je = (pt = e.assigneeOptions) == null ? void 0 : pt.find((Xe) => Xe.value === ke.id);
        return (Je == null ? void 0 : Je.avatar) || "";
      }).filter((ke) => ke);
      B.avatar = X.length > 1 ? X : X[0] || "";
    }, ht = ce(() => {
      if (!e.task) return { text: "", color: "", bgColor: "", borderColor: "" };
      const K = e.task, X = K.progress || 0, ke = /* @__PURE__ */ new Date(), Je = K.endDate ? new Date(K.endDate) : null, pt = K.startDate ? new Date(K.startDate) : null;
      if (!K.actualStartDate && X === 0) {
        const Kt = e.pendingTaskBackgroundColor;
        return {
          text: a.value.statusPending,
          color: Kt,
          bgColor: `${Kt}20`,
          // 添加20%透明度
          borderColor: Kt
        };
      }
      if (X >= 100) {
        const Kt = e.completeTaskBackgroundColor;
        return {
          text: a.value.statusCompleted,
          color: Kt,
          bgColor: `${Kt}20`,
          borderColor: Kt
        };
      }
      if (Je && ke > Je && X < 100) {
        const Kt = e.delayTaskBackgroundColor;
        return {
          text: a.value.statusDelayed,
          color: Kt,
          bgColor: `${Kt}20`,
          borderColor: Kt
        };
      }
      if (pt && ke >= pt && X < 100) {
        const Kt = e.ongoingTaskBackgroundColor;
        return {
          text: a.value.statusOngoing,
          color: Kt,
          bgColor: `${Kt}20`,
          borderColor: Kt
        };
      }
      const Ye = e.pendingTaskBackgroundColor;
      return {
        text: a.value.statusPending,
        color: Ye,
        bgColor: `${Ye}20`,
        borderColor: Ye
      };
    });
    return (K, X) => {
      var ke, Je, pt, Xe;
      return $(), Ir(es, { to: "body" }, [
        o.value ? ($(), ee("div", {
          key: 0,
          class: "drawer-overlay",
          "data-theme": Te(i),
          onClick: Z
        }, [
          _("div", {
            class: "drawer-container",
            onClick: X[13] || (X[13] = dn(() => {
            }, ["stop"]))
          }, [
            _("div", X3, [
              _("h3", J3, Ee(n.isEdit ? Te(a).editTask : Te(a).newTask), 1),
              ((ke = e.task) == null ? void 0 : ke.type) !== "story" && n.isEdit ? ($(), ee("div", Z3, [
                m.value ? ($(), ee("button", {
                  key: 1,
                  class: "timer-btn stop minimal",
                  title: "停止计时",
                  style: { width: "24px", height: "24px", background: "#f44336", border: "none", padding: "0", margin: "0", "box-shadow": "none", cursor: "pointer", "border-radius": "50%", display: "flex", "align-items": "center", "justify-content": "center", transition: "background 0.2s" },
                  onClick: dn(De, ["stop"])
                }, [...X[15] || (X[15] = [
                  _("svg", {
                    width: "24",
                    height: "24",
                    viewBox: "0 0 24 24",
                    fill: "none"
                  }, [
                    _("circle", {
                      cx: "12",
                      cy: "12",
                      r: "11",
                      stroke: "#f44336",
                      "stroke-width": "2",
                      fill: "#f44336"
                    }),
                    _("rect", {
                      x: "7",
                      y: "7",
                      width: "10",
                      height: "10",
                      fill: "#fff",
                      rx: "1.5"
                    })
                  ], -1)
                ])])) : ($(), ee("button", {
                  key: 0,
                  class: "timer-btn start minimal",
                  title: "开始计时",
                  style: { width: "24px", height: "24px", background: "#4caf50", border: "none", padding: "0", margin: "0", "box-shadow": "none", cursor: "pointer", "border-radius": "50%", display: "flex", "align-items": "center", "justify-content": "center", transition: "background 0.2s" },
                  onClick: dn(Qe, ["stop"])
                }, [
                  ($(), ee("svg", eU, [...X[14] || (X[14] = [
                    _("circle", {
                      cx: "12",
                      cy: "12",
                      r: "11",
                      stroke: "#4caf50",
                      "stroke-width": "2",
                      fill: "#4caf50"
                    }, null, -1),
                    _("polygon", {
                      points: "9,7 18,12 9,17",
                      fill: "#fff"
                    }, null, -1)
                  ])]))
                ])),
                m.value ? ($(), ee("span", {
                  key: 2,
                  class: tr(["timer-badge", { "timer-active": m.value }]),
                  style: { "margin-left": "8px", "font-size": "13px", "font-weight": "700", padding: "2px 10px", "border-radius": "10px", background: "#fffbe6", color: "#e6a23c", "box-shadow": "0 0 0 1px #ffe58f", display: "inline-flex", "align-items": "center", "min-width": "80px", "justify-content": "center" }
                }, [
                  m.value ? ($(), ee("span", tU)) : vt("", !0),
                  fn(" " + Ee(w.value), 1)
                ], 2)) : vt("", !0)
              ])) : vt("", !0),
              X[17] || (X[17] = _("div", { style: { flex: "1" } }, null, -1)),
              n.isEdit && e.task ? ($(), ee("div", {
                key: 1,
                class: "status-badge",
                style: Mt({
                  backgroundColor: ht.value.bgColor,
                  color: ht.value.color,
                  border: `1px solid ${ht.value.borderColor}`
                })
              }, Ee(ht.value.text), 5)) : vt("", !0),
              _("button", {
                class: "drawer-close-btn",
                type: "button",
                onClick: se
              }, [
                ($(), ee("svg", rU, [...X[16] || (X[16] = [
                  _("line", {
                    x1: "18",
                    y1: "6",
                    x2: "6",
                    y2: "18"
                  }, null, -1),
                  _("line", {
                    x1: "6",
                    y1: "6",
                    x2: "18",
                    y2: "18"
                  }, null, -1)
                ])]))
              ])
            ]),
            _("div", nU, [
              _("form", {
                class: "task-form",
                onSubmit: dn(C, ["prevent"])
              }, [
                _("div", aU, [
                  _("label", AU, [
                    fn(Ee(Te(a).taskName) + " ", 1),
                    X[18] || (X[18] = _("span", { class: "required" }, "*", -1))
                  ]),
                  us(_("input", {
                    id: "task-name",
                    "onUpdate:modelValue": X[0] || (X[0] = (Ye) => B.name = Ye),
                    type: "text",
                    class: tr(["form-input", { error: S.name }]),
                    placeholder: Te(a).taskNamePlaceholder
                  }, null, 10, sU), [
                    [Qi, B.name]
                  ]),
                  S.name ? ($(), ee("span", iU, Ee(S.name), 1)) : vt("", !0)
                ]),
                _("div", oU, [
                  _("label", lU, [
                    fn(Ee(Te(a).taskType) + " ", 1),
                    X[19] || (X[19] = _("span", { class: "required" }, "*", -1))
                  ]),
                  us(_("select", {
                    id: "task-type",
                    "onUpdate:modelValue": X[1] || (X[1] = (Ye) => B.type = Ye),
                    class: tr(["form-select", { error: S.type }])
                  }, [
                    _("option", uU, Ee(Te(a).taskTypeMap.story), 1),
                    _("option", cU, Ee(Te(a).taskTypeMap.task), 1),
                    _("option", dU, Ee(Te(a).taskTypeMap.bug), 1)
                  ], 2), [
                    [xu, B.type]
                  ]),
                  S.type ? ($(), ee("span", fU, Ee(S.type), 1)) : vt("", !0)
                ]),
                _("div", hU, [
                  _("label", gU, Ee(Te(a).resourceAllocation || "资源分配"), 1),
                  _("div", vU, [
                    _("div", pU, [
                      X[20] || (X[20] = _("span", { class: "resource-header-label resource-header-label-name" }, "资源名称", -1)),
                      e.showResourceTypeOption ? ($(), ee("span", mU, Ee(Te(a).resourceCategory || "类别"), 1)) : vt("", !0),
                      X[21] || (X[21] = _("span", { class: "resource-header-label resource-header-label-capacity" }, "占用比例", -1)),
                      X[22] || (X[22] = _("span", { class: "resource-header-action" }, null, -1))
                    ]),
                    ($(!0), ee(St, null, nr(B.resources, (Ye, Kt) => ($(), ee("div", {
                      key: Kt,
                      class: "resource-item"
                    }, [
                      na(G3, {
                        "model-value": Ye.id,
                        options: It(Ye),
                        placeholder: Te(a).selectResource || "选择资源",
                        "onUpdate:modelValue": (it) => Dt(Kt, "id", it)
                      }, null, 8, ["model-value", "options", "placeholder", "onUpdate:modelValue"]),
                      e.showResourceTypeOption ? us(($(), ee("select", {
                        key: 0,
                        "onUpdate:modelValue": (it) => Ye.type = it,
                        class: "form-select type-select",
                        onChange: (it) => Dt(
                          Kt,
                          "type",
                          it.target.value
                        )
                      }, [
                        ($(!0), ee(St, null, nr(dt.value, (it) => ($(), ee("option", {
                          key: it.value,
                          value: it.value
                        }, Ee(it.label), 9, yU))), 128))
                      ], 40, wU)), [
                        [xu, Ye.type]
                      ]) : vt("", !0),
                      us(_("select", {
                        "onUpdate:modelValue": (it) => Ye.capacity = it,
                        class: "form-select capacity-select",
                        onChange: (it) => Dt(
                          Kt,
                          "capacity",
                          it.target.value
                        )
                      }, [...X[23] || (X[23] = [
                        _("option", { value: 25 }, "25%", -1),
                        _("option", { value: 50 }, "50%", -1),
                        _("option", { value: 75 }, "75%", -1),
                        _("option", { value: 100 }, "100%", -1)
                      ])], 40, BU), [
                        [
                          xu,
                          Ye.capacity,
                          void 0,
                          { number: !0 }
                        ]
                      ]),
                      _("button", {
                        type: "button",
                        class: "btn-remove-resource",
                        title: "删除资源",
                        onClick: (it) => ot(Kt)
                      }, [...X[24] || (X[24] = [
                        _("svg", {
                          width: "16",
                          height: "16",
                          viewBox: "0 0 24 24",
                          fill: "none",
                          stroke: "currentColor",
                          "stroke-width": "2",
                          "stroke-linecap": "round",
                          "stroke-linejoin": "round"
                        }, [
                          _("polyline", { points: "3 6 5 6 21 6" }),
                          _("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }),
                          _("line", {
                            x1: "10",
                            y1: "11",
                            x2: "10",
                            y2: "17"
                          }),
                          _("line", {
                            x1: "14",
                            y1: "11",
                            x2: "14",
                            y2: "17"
                          })
                        ], -1)
                      ])], 8, bU)
                    ]))), 128)),
                    _("button", {
                      type: "button",
                      class: "btn-add-resource",
                      onClick: je
                    }, " + " + Ee(Te(a).addResource || "添加资源"), 1)
                  ])
                ]),
                _("div", CU, [
                  _("label", kU, Ee(Te(a).parentTask), 1),
                  us(_("select", {
                    id: "task-parent",
                    "onUpdate:modelValue": X[2] || (X[2] = (Ye) => B.parentId = Ye),
                    class: "form-select"
                  }, [
                    _("option", TU, Ee(Te(a).noParentTask), 1),
                    ($(!0), ee(St, null, nr(q.value, (Ye) => ($(), ee("option", {
                      key: Ye.id,
                      value: Ye.id
                    }, Ee(Ye.displayName), 9, xU))), 128))
                  ], 512), [
                    [xu, B.parentId]
                  ])
                ]),
                _("div", DU, [
                  _("div", EU, [
                    _("label", SU, [
                      fn(Ee(Te(a).plannedStartDate) + " ", 1),
                      X[25] || (X[25] = _("span", { class: "required" }, "*", -1))
                    ]),
                    na(Ol, {
                      id: "task-start-date",
                      modelValue: B.startDate,
                      "onUpdate:modelValue": X[3] || (X[3] = (Ye) => B.startDate = Ye),
                      type: "datetime",
                      "value-format": "YYYY-MM-DD HH:mm",
                      placeholder: Te(a).plannedStartDateRequired,
                      class: tr({ error: S.startDate })
                    }, null, 8, ["modelValue", "placeholder", "class"]),
                    S.startDate ? ($(), ee("span", FU, Ee(S.startDate), 1)) : vt("", !0)
                  ]),
                  _("div", UU, [
                    _("label", LU, [
                      fn(Ee(Te(a).plannedEndDate) + " ", 1),
                      X[26] || (X[26] = _("span", { class: "required" }, "*", -1))
                    ]),
                    na(Ol, {
                      id: "task-end-date",
                      modelValue: B.endDate,
                      "onUpdate:modelValue": X[4] || (X[4] = (Ye) => B.endDate = Ye),
                      type: "datetime",
                      "value-format": "YYYY-MM-DD HH:mm",
                      placeholder: Te(a).plannedEndDateRequired,
                      class: tr({ error: S.endDate })
                    }, null, 8, ["modelValue", "placeholder", "class"]),
                    S.endDate ? ($(), ee("span", IU, Ee(S.endDate), 1)) : vt("", !0)
                  ])
                ]),
                _("div", QU, [
                  _("div", MU, [
                    _("label", _U, Ee(Te(a).actualStartDate), 1),
                    na(Ol, {
                      id: "task-actual-start-date",
                      modelValue: B.actualStartDate,
                      "onUpdate:modelValue": X[5] || (X[5] = (Ye) => B.actualStartDate = Ye),
                      type: "datetime",
                      "value-format": "YYYY-MM-DD HH:mm",
                      placeholder: Te(a).actualStartDate,
                      class: tr({ error: S.actualStartDate })
                    }, null, 8, ["modelValue", "placeholder", "class"]),
                    S.actualStartDate ? ($(), ee("span", RU, Ee(S.actualStartDate), 1)) : vt("", !0)
                  ]),
                  _("div", NU, [
                    _("label", HU, Ee(Te(a).actualEndDate), 1),
                    na(Ol, {
                      id: "task-actual-end-date",
                      modelValue: B.actualEndDate,
                      "onUpdate:modelValue": X[6] || (X[6] = (Ye) => B.actualEndDate = Ye),
                      type: "datetime",
                      "value-format": "YYYY-MM-DD HH:mm",
                      placeholder: Te(a).actualEndDate,
                      class: tr({ error: S.actualEndDate })
                    }, null, 8, ["modelValue", "placeholder", "class"]),
                    S.actualEndDate ? ($(), ee("span", OU, Ee(S.actualEndDate), 1)) : vt("", !0)
                  ])
                ]),
                na(K3, {
                  modelValue: B.predecessor,
                  "onUpdate:modelValue": X[7] || (X[7] = (Ye) => B.predecessor = Ye),
                  tasks: O.value,
                  "current-task-id": (Je = e.task) == null ? void 0 : Je.id,
                  label: Te(a).predecessor,
                  placeholder: Te(a).predecessorPlaceholder
                }, null, 8, ["modelValue", "tasks", "current-task-id", "label", "placeholder"]),
                _("div", PU, [
                  _("div", WU, [
                    _("label", KU, Ee(Te(a).estimatedHours), 1),
                    us(_("input", {
                      id: "task-estimated-hours",
                      "onUpdate:modelValue": X[8] || (X[8] = (Ye) => B.estimatedHours = Ye),
                      type: "number",
                      class: "form-input",
                      placeholder: "0.00",
                      min: "0",
                      max: "99999",
                      step: "0.01",
                      onInput: E
                    }, null, 544), [
                      [Qi, B.estimatedHours]
                    ])
                  ]),
                  _("div", $U, [
                    _("label", VU, Ee(Te(a).actualHours), 1),
                    us(_("input", {
                      id: "task-actual-hours",
                      "onUpdate:modelValue": X[9] || (X[9] = (Ye) => B.actualHours = Ye),
                      type: "number",
                      class: "form-input",
                      placeholder: "0.00",
                      min: "0",
                      max: "99999",
                      step: "0.01",
                      onInput: Q
                    }, null, 544), [
                      [Qi, B.actualHours]
                    ])
                  ])
                ]),
                _("div", qU, [
                  _("label", jU, Ee(Te(a).progress), 1),
                  _("div", YU, [
                    us(_("input", {
                      id: "task-progress",
                      "onUpdate:modelValue": X[10] || (X[10] = (Ye) => B.progress = Ye),
                      type: "range",
                      class: "progress-slider",
                      style: Mt(W.value),
                      min: "0",
                      max: "100",
                      step: "5"
                    }, null, 4), [
                      [
                        Qi,
                        B.progress,
                        void 0,
                        { number: !0 }
                      ]
                    ]),
                    _("div", GU, [
                      us(_("input", {
                        "onUpdate:modelValue": X[11] || (X[11] = (Ye) => F.value = Ye),
                        type: "text",
                        class: "progress-input",
                        placeholder: "0",
                        maxlength: "3",
                        onBlur: T,
                        onKeyup: i5(T, ["enter"]),
                        onInput: Y,
                        onFocus: x,
                        onKeydown: oe
                      }, null, 544), [
                        [Qi, F.value]
                      ]),
                      X[27] || (X[27] = _("span", { class: "progress-unit" }, "%", -1))
                    ])
                  ])
                ]),
                _("div", zU, [
                  _("label", XU, Ee(Te(a).description), 1),
                  us(_("textarea", {
                    id: "task-description",
                    "onUpdate:modelValue": X[12] || (X[12] = (Ye) => B.description = Ye),
                    class: "form-textarea",
                    placeholder: Te(a).descriptionPlaceholder,
                    rows: "3"
                  }, null, 8, JU), [
                    [Qi, B.description]
                  ])
                ])
              ], 32)
            ]),
            _("div", ZU, [
              _("div", eL, [
                n.isEdit && n.task ? ($(), ee("button", {
                  key: 0,
                  type: "button",
                  class: "gantt-btn gantt-btn-danger",
                  disabled: s.value,
                  onClick: H
                }, [
                  s.value ? ($(), ee("span", rL)) : vt("", !0),
                  fn(" " + Ee(Te(a).delete), 1)
                ], 8, tL)) : vt("", !0),
                na(f0, {
                  visible: l.value,
                  title: Te(a).delete,
                  type: k.value,
                  message: D.value,
                  "confirm-text": Te(a).confirm,
                  "cancel-text": Te(a).cancel,
                  "yes-text": Te(a).storyDeleteYes,
                  "no-text": Te(a).storyDeleteNo,
                  onConfirm: te,
                  onYes: we,
                  onNo: ve,
                  onCancel: ie
                }, null, 8, ["visible", "title", "type", "message", "confirm-text", "cancel-text", "yes-text", "no-text"])
              ]),
              _("div", nL, [
                _("button", {
                  type: "button",
                  class: "gantt-btn gantt-btn-default",
                  onClick: se
                }, Ee(Te(a).cancel), 1),
                _("button", {
                  type: "button",
                  class: "gantt-btn gantt-btn-primary",
                  disabled: s.value,
                  onClick: C
                }, [
                  s.value ? ($(), ee("span", AL)) : vt("", !0),
                  fn(" " + Ee(n.isEdit ? Te(a).update : Te(a).create), 1)
                ], 8, aL)
              ])
            ])
          ])
        ], 8, z3)) : vt("", !0),
        ze.value ? ($(), Ir(l5, {
          key: 1,
          visible: ze.value,
          title: Te(a).startTimer,
          message: `${Te(a).timerConfirmPrefix}${(pt = e.task) == null ? void 0 : pt.name}${Te(a).timerConfirmSuffix}`,
          "default-desc": ((Xe = e.task) == null ? void 0 : Xe.name) || "",
          onConfirm: gt,
          onCancel: ne
        }, null, 8, ["visible", "title", "message", "default-desc"])) : vt("", !0)
      ]);
    };
  }
}), iL = /* @__PURE__ */ Fn(sL, [["__scopeId", "data-v-ba960e24"]]), oL = ["data-theme"], lL = { class: "milestone-dialog-header" }, uL = { class: "milestone-dialog-title" }, cL = ["title"], dL = { class: "milestone-dialog-content" }, fL = { class: "milestone-form-row" }, hL = { class: "milestone-form-item milestone-form-item-full" }, gL = {
  class: "milestone-form-label required",
  for: "milestone-name"
}, vL = ["placeholder"], pL = {
  key: 0,
  class: "milestone-form-error"
}, mL = { class: "milestone-form-row" }, wL = { class: "milestone-form-item" }, yL = {
  class: "milestone-form-label required",
  for: "milestone-date"
}, BL = {
  key: 0,
  class: "milestone-form-error"
}, bL = { class: "milestone-form-item" }, CL = {
  class: "milestone-form-label",
  for: "milestone-icon"
}, kL = ["aria-expanded"], TL = { class: "selected-icon" }, xL = {
  key: 0,
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  "stroke-width": "2"
}, DL = {
  key: 1,
  class: "rocket-emoji-mini"
}, EL = {
  key: 0,
  class: "milestone-icon-options"
}, SL = { class: "milestone-form-row" }, FL = { class: "milestone-form-item milestone-form-item-full" }, UL = {
  class: "milestone-form-label",
  for: "milestone-description"
}, LL = { class: "textarea-wrapper" }, IL = ["placeholder"], QL = { class: "textarea-footer" }, ML = { class: "char-count" }, _L = { class: "milestone-dialog-footer" }, RL = { class: "milestone-dialog-footer-left" }, NL = { class: "milestone-dialog-footer-right" }, HL = ["disabled"], OL = /* @__PURE__ */ hn({
  __name: "MilestoneDialog",
  props: {
    visible: { type: Boolean },
    milestone: {}
  },
  emits: ["update:visible", "close", "save", "delete"],
  setup(n, { emit: t }) {
    const e = n, r = t, a = Mr(
      "gantt-theme",
      me("light")
    ), A = Gl({
      id: void 0,
      name: "",
      startDate: "",
      assignee: "",
      type: "milestone",
      icon: "diamond",
      description: ""
    }), i = Gl({
      name: "",
      startDate: ""
    }), s = me(!1), o = me(!1), l = me(null), u = () => {
      const G = l.value;
      G && (G.style.height = "auto", G.style.height = `${Math.min(G.scrollHeight, 120)}px`);
    };
    Gt(
      () => e.milestone,
      (G) => {
        G ? Object.assign(A, {
          id: G.id,
          name: G.name || "",
          startDate: G.startDate || "",
          assignee: G.assignee || "",
          type: G.type || "milestone",
          icon: G.icon || "diamond",
          description: G.description || ""
        }) : Object.assign(A, {
          id: void 0,
          name: "",
          startDate: "",
          assignee: "",
          type: "milestone",
          icon: "diamond",
          description: ""
        }), i.name = "", i.startDate = "";
      },
      { immediate: !0 }
    ), Gt(
      () => e.visible,
      (G) => {
        G && !e.milestone && (Object.assign(A, {
          id: void 0,
          name: "",
          startDate: "",
          assignee: "",
          type: "milestone",
          icon: "diamond",
          description: ""
        }), i.name = "", i.startDate = "");
      }
    );
    const f = () => {
      i.name = "", i.startDate = "";
      let G = !0;
      return A.name.trim() || (i.name = q("milestoneNameRequired"), G = !1), A.startDate || (i.startDate = q("milestoneDateRequired"), G = !1), G;
    }, h = ce(() => A.name.trim() && A.startDate), c = (G) => {
      A.icon = G, s.value = !1;
    }, p = () => {
      if (f()) {
        const G = {
          ...A,
          endDate: A.startDate,
          id: A.id
          // 确保id不为undefined
        };
        r("save", G), D();
      }
    }, w = () => {
      A.id && (o.value = !0);
    }, y = () => {
      A.id && (r("delete", A.id), o.value = !1, D());
    }, m = () => {
      o.value = !1;
    }, k = ce(() => e.milestone && e.milestone.id), D = () => {
      s.value = !1, r("update:visible", !1), r("close");
    }, B = () => {
      D();
    }, { t: O } = Cs(), q = (G) => O.value[G] || G;
    return (G, W) => {
      var F;
      return $(), Ir(es, { to: "body" }, [
        n.visible ? ($(), ee("div", {
          key: 0,
          class: "milestone-dialog-overlay",
          "data-theme": Te(a),
          onClick: B
        }, [
          _("div", {
            class: "milestone-dialog",
            onClick: W[6] || (W[6] = dn(() => {
            }, ["stop"]))
          }, [
            _("div", lL, [
              _("h3", uL, [
                W[7] || (W[7] = _("svg", {
                  class: "milestone-icon",
                  viewBox: "0 0 24 24",
                  fill: "none",
                  stroke: "currentColor",
                  "stroke-width": "2"
                }, [
                  _("g", { transform: "rotate(45 12 12)" }, [
                    _("rect", {
                      x: "4",
                      y: "4",
                      width: "16",
                      height: "16",
                      rx: "4",
                      ry: "4",
                      fill: "currentColor",
                      opacity: "0.1"
                    }),
                    _("rect", {
                      x: "4",
                      y: "4",
                      width: "16",
                      height: "16",
                      rx: "4",
                      ry: "4",
                      stroke: "currentColor",
                      fill: "none"
                    })
                  ])
                ], -1)),
                fn(" " + Ee(k.value ? Te(O).editMilestone : Te(O).newMilestone), 1)
              ]),
              _("button", {
                class: "milestone-dialog-close",
                title: q("close"),
                onClick: D
              }, "×", 8, cL)
            ]),
            _("div", dL, [
              _("form", {
                class: "milestone-form",
                onSubmit: dn(p, ["prevent"])
              }, [
                _("div", fL, [
                  _("div", hL, [
                    _("label", gL, Ee(q("milestoneName")), 1),
                    us(_("input", {
                      id: "milestone-name",
                      "onUpdate:modelValue": W[0] || (W[0] = (Y) => A.name = Y),
                      type: "text",
                      class: tr(["milestone-form-input", { error: i.name }]),
                      placeholder: q("enterMilestoneName"),
                      required: ""
                    }, null, 10, vL), [
                      [Qi, A.name]
                    ]),
                    i.name ? ($(), ee("span", pL, Ee(i.name), 1)) : vt("", !0)
                  ])
                ]),
                _("div", mL, [
                  _("div", wL, [
                    _("label", yL, Ee(q("milestoneDate")), 1),
                    na(Ol, {
                      id: "milestone-date",
                      modelValue: A.startDate,
                      "onUpdate:modelValue": W[1] || (W[1] = (Y) => A.startDate = Y),
                      type: "date",
                      "value-format": "YYYY-MM-DD",
                      placeholder: "请选择里程碑日期",
                      class: tr({ error: i.startDate })
                    }, null, 8, ["modelValue", "class"]),
                    i.startDate ? ($(), ee("span", BL, Ee(i.startDate), 1)) : vt("", !0)
                  ]),
                  _("div", bL, [
                    _("label", CL, Ee(q("milestoneIcon")), 1),
                    _("div", {
                      class: tr(["milestone-icon-dropdown", { active: s.value }])
                    }, [
                      _("button", {
                        id: "milestone-icon",
                        type: "button",
                        class: "milestone-icon-trigger",
                        "aria-expanded": s.value,
                        "aria-haspopup": "listbox",
                        onClick: W[2] || (W[2] = (Y) => s.value = !s.value)
                      }, [
                        _("div", TL, [
                          A.icon === "diamond" ? ($(), ee("svg", xL, [...W[8] || (W[8] = [
                            _("g", { transform: "rotate(45 12 12)" }, [
                              _("rect", {
                                x: "6",
                                y: "6",
                                width: "12",
                                height: "12",
                                rx: "3",
                                ry: "3",
                                fill: "currentColor"
                              })
                            ], -1)
                          ])])) : A.icon === "rocket" ? ($(), ee("div", DL, "🚀")) : vt("", !0),
                          _("span", null, Ee(q(A.icon || "diamond")), 1)
                        ]),
                        W[9] || (W[9] = _("svg", {
                          class: "dropdown-arrow",
                          viewBox: "0 0 24 24",
                          fill: "none",
                          stroke: "currentColor",
                          "stroke-width": "2"
                        }, [
                          _("polyline", { points: "6,9 12,15 18,9" })
                        ], -1))
                      ], 8, kL),
                      s.value ? ($(), ee("div", EL, [
                        _("div", {
                          class: tr(["icon-option", { selected: A.icon === "diamond" }]),
                          onClick: W[3] || (W[3] = (Y) => c("diamond"))
                        }, [
                          W[10] || (W[10] = _("svg", {
                            viewBox: "0 0 24 24",
                            fill: "none",
                            stroke: "currentColor",
                            "stroke-width": "2"
                          }, [
                            _("g", { transform: "rotate(45 12 12)" }, [
                              _("rect", {
                                x: "6",
                                y: "6",
                                width: "12",
                                height: "12",
                                rx: "3",
                                ry: "3",
                                fill: "currentColor"
                              })
                            ])
                          ], -1)),
                          _("span", null, Ee(q("diamond")), 1)
                        ], 2),
                        _("div", {
                          class: tr(["icon-option", { selected: A.icon === "rocket" }]),
                          onClick: W[4] || (W[4] = (Y) => c("rocket"))
                        }, [
                          W[11] || (W[11] = _("div", { class: "rocket-emoji-option" }, "🚀", -1)),
                          _("span", null, Ee(q("rocket")), 1)
                        ], 2)
                      ])) : vt("", !0)
                    ], 2)
                  ])
                ]),
                _("div", SL, [
                  _("div", FL, [
                    _("label", UL, Ee(q("description")), 1),
                    _("div", LL, [
                      us(_("textarea", {
                        id: "milestone-description",
                        ref_key: "descriptionTextarea",
                        ref: l,
                        "onUpdate:modelValue": W[5] || (W[5] = (Y) => A.description = Y),
                        class: "milestone-form-textarea",
                        placeholder: q("enterDescription"),
                        rows: "4",
                        maxlength: "500",
                        onInput: u
                      }, null, 40, IL), [
                        [Qi, A.description]
                      ]),
                      _("div", QL, [
                        _("span", ML, Ee(((F = A.description) == null ? void 0 : F.length) || 0) + "/500", 1)
                      ])
                    ])
                  ])
                ])
              ], 32)
            ]),
            _("div", _L, [
              _("div", RL, [
                k.value ? ($(), ee("button", {
                  key: 0,
                  type: "button",
                  class: "gantt-btn gantt-btn-danger",
                  onClick: w
                }, Ee(Te(O).delete), 1)) : vt("", !0)
              ]),
              _("div", NL, [
                _("button", {
                  type: "button",
                  class: "gantt-btn gantt-btn-default",
                  onClick: D
                }, Ee(Te(O).cancel), 1),
                _("button", {
                  type: "button",
                  class: "gantt-btn gantt-btn-primary",
                  disabled: !h.value,
                  onClick: p
                }, Ee(Te(O).confirm), 9, HL)
              ])
            ])
          ]),
          na(f0, {
            visible: o.value,
            title: Te(O).delete,
            message: Te(O).confirmDelete,
            "confirm-text": Te(O).confirm,
            "cancel-text": Te(O).cancel,
            onConfirm: y,
            onCancel: m
          }, null, 8, ["visible", "title", "message", "confirm-text", "cancel-text"])
        ], 8, oL)) : vt("", !0)
      ]);
    };
  }
}), PL = /* @__PURE__ */ Fn(OL, [["__scopeId", "data-v-528ce102"]]), WL = {
  key: 0,
  class: "gantt-calendar-selection-hint"
}, KL = /* @__PURE__ */ hn({
  __name: "CalendarSelectionLayer",
  props: {
    rect: { default: null },
    segments: { default: () => [] },
    left: { default: 0 },
    width: { default: 0 },
    indicatorWidth: { default: 4 },
    state: { default: "active" },
    rejectedText: { default: "该时段不可选择" }
  },
  setup(n) {
    const t = n, e = ce(() => ({
      "is-rejected": t.state === "rejected",
      "is-pending": t.state === "pending"
    })), r = ce(() => t.rect ? {
      top: `${t.rect.top}px`,
      left: `${t.rect.left}px`,
      width: `${t.rect.width}px`,
      height: `${t.rect.height}px`
    } : {}), a = (A, i) => {
      const s = i === 0, o = i === t.segments.length - 1, l = `${t.indicatorWidth / 2}px`;
      return {
        top: `${A.indicatorTop}px`,
        left: `${t.left}px`,
        width: `${t.indicatorWidth}px`,
        height: `${A.indicatorHeight}px`,
        borderTopLeftRadius: s ? l : "0",
        borderTopRightRadius: s ? l : "0",
        borderBottomLeftRadius: o ? l : "0",
        borderBottomRightRadius: o ? l : "0"
      };
    };
    return (A, i) => ($(), ee(St, null, [
      n.segments && n.segments.length ? ($(), ee(St, { key: 0 }, [
        ($(!0), ee(St, null, nr(n.segments, (s, o) => ($(), ee("div", {
          key: "slot-" + o,
          class: tr(["gantt-calendar-selection-slot", e.value]),
          style: Mt({
            top: `${s.top}px`,
            left: `${n.left}px`,
            width: `${n.width}px`,
            height: `${s.height}px`
          })
        }, null, 6))), 128)),
        ($(!0), ee(St, null, nr(n.segments, (s, o) => ($(), ee("div", {
          key: "indicator-" + o,
          class: tr(["gantt-calendar-selection-indicator", e.value]),
          style: Mt(a(s, o))
        }, null, 6))), 128))
      ], 64)) : vt("", !0),
      n.rect ? ($(), ee("div", {
        key: 1,
        class: tr(["gantt-calendar-selection-layer", e.value]),
        style: Mt(r.value)
      }, [
        n.state === "rejected" ? ($(), ee("span", WL, Ee(n.rejectedText), 1)) : vt("", !0)
      ], 6)) : vt("", !0)
    ], 64));
  }
}), h0 = /* @__PURE__ */ Fn(KL, [["__scopeId", "data-v-1a724565"]]), Km = 4;
function g0(n) {
  const t = me(!1), e = me(!1), r = me(!1), a = me(!1), A = me(null);
  let i = null, s = 0, o = 0, l = !1;
  const u = () => {
    var m;
    return !!((m = n.disabled) != null && m.value);
  }, f = (m) => {
    u() || m.button === 0 && (m.preventDefault(), i = m, s = m.clientX, o = m.clientY, l = !1, r.value = !1, a.value = !1, window.addEventListener("mousemove", h), window.addEventListener("mouseup", p));
  }, h = (m) => {
    if (!i) return;
    if (m.preventDefault(), !l) {
      const D = Math.abs(m.clientX - s), B = Math.abs(m.clientY - o);
      if (D < Km && B < Km)
        return;
      l = !0, t.value = !0;
    }
    const k = n.resolveDraft(m);
    k && (A.value = k);
  }, c = () => {
    i = null, l = !1, t.value = !1, a.value = !1, A.value = null, window.removeEventListener("mousemove", h), window.removeEventListener("mouseup", p);
  }, p = async (m) => {
    var B, O;
    const k = l, D = k ? n.resolveDraft(m) || A.value : null;
    if (window.removeEventListener("mousemove", h), window.removeEventListener("mouseup", p), !k || !D) {
      c();
      return;
    }
    if (A.value = D, n.onBeforeSelect) {
      e.value = !0;
      let q = !1;
      try {
        q = await n.onBeforeSelect(D);
      } catch {
        q = !1;
      }
      if (e.value = !1, !q) {
        r.value = !0, t.value = !1, (B = n.onSelectionCancel) == null || B.call(n, "before-hook-rejected"), i = null, l = !1;
        return;
      }
    }
    (O = n.onSelectionComplete) == null || O.call(n, D), t.value = !1, a.value = !0, i = null, l = !1;
  };
  return {
    isDragging: t,
    isPending: e,
    isRejected: r,
    isConfirmed: a,
    draft: A,
    handleMouseDown: f,
    cancel: () => {
      var m;
      (m = n.onSelectionCancel) == null || m.call(n, "user-cancelled"), c();
    },
    clear: () => {
      A.value = null, r.value = !1, t.value = !1, a.value = !1;
    }
  };
}
const $m = 4;
function v0(n) {
  const t = me(!1), e = me(null), r = me({ deltaX: 0, deltaY: 0 });
  let a = null, A = 0, i = 0, s = !1;
  const o = () => {
    var c;
    return !!((c = n.disabled) != null && c.value);
  }, l = () => {
    window.removeEventListener("mousemove", u), window.removeEventListener("mouseup", f), t.value = !1, e.value = null, r.value = { deltaX: 0, deltaY: 0 }, s = !1, a = null;
  }, u = (c) => {
    var y;
    if (!a) return;
    c.preventDefault();
    const p = c.clientX - A, w = c.clientY - i;
    if (!s) {
      if (Math.abs(p) < $m && Math.abs(w) < $m) return;
      s = !0, t.value = !0, e.value = a.id;
    }
    r.value = { deltaX: p, deltaY: w }, (y = n.onDragMove) == null || y.call(n, a, r.value, c);
  }, f = (c) => {
    var m, k;
    const p = a, w = s, y = { ...r.value };
    if (window.removeEventListener("mousemove", u), window.removeEventListener("mouseup", f), !p) {
      l();
      return;
    }
    w ? (m = n.onDragEnd) == null || m.call(n, p, y, c) : (k = n.onClick) == null || k.call(n, p, c), l();
  };
  return { isDragging: t, draggingTaskId: e, dragDelta: r, handleMouseDown: (c, p) => {
    o() || p.button === 0 && (p.preventDefault(), p.stopPropagation(), a = c, A = p.clientX, i = p.clientY, s = !1, r.value = { deltaX: 0, deltaY: 0 }, window.addEventListener("mousemove", u), window.addEventListener("mouseup", f));
  } };
}
function p0(n) {
  return n === 0 || n === 6;
}
function no(n, t) {
  return n.getFullYear() === t.getFullYear() && n.getMonth() === t.getMonth() && n.getDate() === t.getDate();
}
function v5(n) {
  return no(n, /* @__PURE__ */ new Date());
}
function m0(n) {
  if (!n) return null;
  const t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(n);
  if (t) {
    const [, r, a, A] = t;
    return new Date(Number(r), Number(a) - 1, Number(A));
  }
  const e = new Date(n);
  return isNaN(e.getTime()) ? null : e;
}
function p5(n) {
  return n.getHours() * 60 + n.getMinutes();
}
function $L(n, t, e) {
  const r = new Date(e.getFullYear(), e.getMonth(), e.getDate()), a = new Date(r);
  return a.setDate(a.getDate() + 1), n < a && t >= r;
}
function VL(n, t, e) {
  if (p0(t) || !e) return !1;
  if (e.morning) {
    const { start: r, end: a } = e.morning;
    if (n >= r && n <= a)
      return !0;
  }
  if (e.afternoon) {
    const { start: r, end: a } = e.afternoon;
    if (n >= r && n <= a)
      return !0;
  }
  return !1;
}
function m5(n, t) {
  const e = n.getDay(), r = /* @__PURE__ */ new Date(), a = [];
  for (let A = 0; A < 24; A++) {
    const i = new Date(n.getFullYear(), n.getMonth(), n.getDate(), A);
    a.push({
      hour: A,
      label: `${String(A).padStart(2, "0")}:00`,
      date: i,
      isWorkingHour: VL(A, e, t),
      isCurrentHour: no(n, r) && A === r.getHours()
    });
  }
  return a;
}
function w5(n) {
  const t = new Date(n.getFullYear(), n.getMonth(), n.getDate()), e = t.getDay() || 7;
  return t.setDate(t.getDate() - (e - 1)), t;
}
function qL(n, t) {
  const e = w5(n), r = [];
  for (let a = 0; a < 7; a++) {
    const A = new Date(e);
    A.setDate(A.getDate() + a);
    const i = A.getDay();
    r.push({
      date: A,
      dayOfWeek: i,
      isWeekend: p0(i),
      isToday: v5(A),
      hours: m5(A, t)
    });
  }
  return r;
}
function jL(n) {
  const t = n.getFullYear(), e = n.getMonth(), r = new Date(t, e, 1), a = w5(r), A = [], i = new Date(a);
  for (let s = 0; s < 6; s++) {
    const o = [];
    for (let l = 0; l < 7; l++) {
      const u = new Date(i);
      o.push({
        date: u,
        isCurrentMonth: u.getMonth() === e,
        isWeekend: p0(u.getDay()),
        isToday: v5(u)
      }), i.setDate(i.getDate() + 1);
    }
    if (A.push(o), i.getMonth() !== e && i > r && s >= 3) {
      const l = new Date(i);
      if (l.setDate(l.getDate() + 6), l.getMonth() !== e)
        break;
    }
  }
  return A;
}
function fp(n, t) {
  if (t <= 0) return new Date(n);
  const e = new Date(n), r = e.getHours() * 60 + e.getMinutes(), a = Math.floor(r / t) * t;
  return e.setHours(Math.floor(a / 60), a % 60, 0, 0), e;
}
function Uf(n) {
  return new Date(n.getFullYear(), n.getMonth(), n.getDate());
}
function zl(n) {
  const t = n.getFullYear(), e = String(n.getMonth() + 1).padStart(2, "0"), r = String(n.getDate()).padStart(2, "0"), a = String(n.getHours()).padStart(2, "0"), A = String(n.getMinutes()).padStart(2, "0");
  return `${t}-${e}-${r} ${a}:${A}`;
}
function Ed(n, t, e) {
  const r = new Date(n.getFullYear(), n.getMonth(), n.getDate()).getTime(), a = new Date(t.getFullYear(), t.getMonth(), t.getDate()).getTime(), A = new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime(), i = n.getHours() === 0 && n.getMinutes() === 0, s = t.getHours() === 0 && t.getMinutes() === 0, o = n.getHours() * 60 + n.getMinutes(), l = t.getHours() * 60 + t.getMinutes();
  return r === a ? A !== r ? { type: "none" } : i && s ? { type: "all-day" } : { type: "timed", startMinutes: o, endMinutes: l } : A === r ? i ? { type: "all-day" } : { type: "timed", startMinutes: o, endMinutes: 1440 } : A === a ? s ? { type: "all-day" } : { type: "timed", startMinutes: 0, endMinutes: l } : A > r && A < a ? { type: "all-day" } : { type: "none" };
}
function Vm(n) {
  const t = Math.max(0, Math.min(n, 1440));
  if (t === 1440) return "24:00";
  const e = Math.floor(t / 60), r = t % 60;
  return `${String(e).padStart(2, "0")}:${String(r).padStart(2, "0")}`;
}
function y5(n, t, e) {
  return `${n} - ${Vm(t)} ~ ${Vm(e)}`;
}
function B5(n, t, e, r = 30) {
  const a = Math.min(n, t), A = Math.max(n, t);
  if (r <= 0 || e <= 0) return [];
  const i = e / 60, s = [];
  let o = Math.floor(a / r) * r;
  do {
    const l = o + r, u = Math.max(a, o), f = Math.min(A, l), h = Math.max(f - u, 0);
    s.push({
      slotTop: o * i,
      slotHeight: r * i,
      indicatorTop: u * i,
      indicatorHeight: Math.max(h * i, 3)
    }), o += r;
  } while (o < A);
  return s;
}
function b5(n) {
  const t = n.map(() => ({ column: 0, columnCount: 1 })), e = n.map((s, o) => o).sort((s, o) => n[s].start - n[o].start || n[s].end - n[o].end);
  let r = [], a = [], A = -1 / 0;
  const i = () => {
    if (r.length === 0) return;
    const s = a.length;
    for (const o of r)
      t[o].columnCount = s;
    r = [], a = [], A = -1 / 0;
  };
  for (const s of e) {
    const { start: o, end: l } = n[s];
    o >= A && i();
    let u = -1;
    for (let f = 0; f < a.length; f++)
      if (a[f] <= o) {
        a[f] = l, u = f;
        break;
      }
    u === -1 && (u = a.length, a.push(l)), t[s].column = u, r.push(s), A = Math.max(A, l);
  }
  return i(), t;
}
const YL = { class: "gantt-calendar-day-view" }, GL = {
  key: 0,
  class: "gantt-calendar-allday-row"
}, zL = { class: "gantt-calendar-allday-label" }, XL = { class: "gantt-calendar-allday-chips" }, JL = ["title", "onClick"], ZL = { class: "gantt-calendar-hour-label" }, eI = ["data-hour"], tI = ["title", "onMousedown"], rI = { class: "gantt-calendar-task-card-title" }, nI = {
  key: 0,
  class: "gantt-calendar-task-card-desc"
}, Yi = 48, qo = 64, aI = /* @__PURE__ */ hn({
  __name: "CalendarDayView",
  props: {
    date: {},
    tasks: { default: () => [] },
    workingHours: {},
    resourceId: {},
    selectionMinuteStep: { default: 15 },
    disabled: { type: Boolean, default: !1 },
    allDayLabel: { default: "全天" },
    taskCardOpacity: { default: 0.18 },
    taskAccentWidth: { default: 5 },
    onBeforeSelect: {}
  },
  emits: ["selection-complete", "selection-cancel", "task-click", "task-move"],
  setup(n, { expose: t, emit: e }) {
    const r = n, a = e, A = me(), i = ce(() => m5(r.date, r.workingHours)), s = ce(() => no(r.date, /* @__PURE__ */ new Date()) ? p5(/* @__PURE__ */ new Date()) / 60 * Yi : null), o = m0, l = ce(() => r.tasks.filter((E) => {
      const Q = o(E.startDate), x = o(E.endDate);
      return !Q || !x ? !1 : Ed(Q, x, r.date).type === "all-day";
    })), u = ce(() => {
      const E = [];
      for (const Q of r.tasks) {
        const x = o(Q.startDate), oe = o(Q.endDate);
        if (!x || !oe) continue;
        const J = Ed(x, oe, r.date);
        if (J.type !== "timed") continue;
        const S = J.startMinutes, I = Math.max(J.endMinutes, S + 15);
        E.push({ task: Q, startMinutes: S, endMinutes: I });
      }
      return E;
    }), f = ce(() => u.value.map((E) => E.task)), h = (E, Q) => {
      const x = u.value[Q];
      return x ? y5(E.name, x.startMinutes, x.endMinutes) : E.name;
    }, c = ce(() => {
      const E = u.value.map((Q) => ({
        start: Q.startMinutes,
        end: Q.endMinutes
      }));
      return b5(E);
    }), p = (E, Q) => {
      var ie;
      const x = u.value[Q], oe = (x == null ? void 0 : x.startMinutes) ?? 0, J = (x == null ? void 0 : x.endMinutes) ?? oe + 15;
      let S = oe / 60 * Yi;
      B.value && O.value === E.id && (S += q.value.deltaY);
      const I = (J - oe) / 60 * Yi, N = c.value[Q] ?? { column: 0, columnCount: 1 }, se = ((ie = A.value) == null ? void 0 : ie.clientWidth) ?? 0, C = Math.max(se - qo - 8, 0) / N.columnCount, H = qo + N.column * C, M = E.barColor || "var(--gantt-primary)", te = Math.round(Math.min(Math.max(r.taskCardOpacity, 0), 1) * 100);
      return {
        top: `${S}px`,
        height: `${I}px`,
        left: `${H}px`,
        width: `${Math.max(C - 2, 0)}px`,
        borderLeftWidth: `${r.taskAccentWidth}px`,
        borderLeftColor: M,
        backgroundColor: `color-mix(in srgb, ${M} ${te}%, transparent)`
      };
    }, w = (E) => {
      const Q = A.value;
      if (!Q) return null;
      const x = Q.getBoundingClientRect(), J = Math.min(Math.max(E.clientY - x.top, 0), x.height) / Yi * 60, S = new Date(r.date);
      S.setHours(0, J, 0, 0);
      const I = fp(S, r.selectionMinuteStep);
      return {
        startDate: y.value ?? I,
        endDate: I,
        resourceId: r.resourceId,
        scale: "day"
      };
    }, y = me(null), m = ce(() => r.disabled), k = g0({
      disabled: m,
      resolveDraft: w,
      onBeforeSelect: r.onBeforeSelect,
      onSelectionComplete: (E) => a("selection-complete", E),
      onSelectionCancel: (E) => a("selection-cancel", E)
    }), D = (E) => {
      if (r.disabled) return;
      const Q = A.value;
      if (!Q) return;
      const x = Q.getBoundingClientRect(), J = Math.min(Math.max(E.clientY - x.top, 0), x.height) / Yi * 60, S = new Date(r.date);
      S.setHours(0, J, 0, 0), y.value = fp(S, r.selectionMinuteStep), k.handleMouseDown(E);
    }, {
      isDragging: B,
      draggingTaskId: O,
      dragDelta: q,
      handleMouseDown: G
    } = v0({
      disabled: m,
      onClick: (E, Q) => a("task-click", E, Q),
      onDragEnd: (E, Q) => {
        const x = o(E.startDate), oe = o(E.endDate);
        if (!x || !oe || !no(x, oe)) return;
        const J = oe.getTime() - x.getTime(), S = Q.deltaY / Yi * 60, I = Math.round(S / r.selectionMinuteStep) * r.selectionMinuteStep;
        if (I === 0) return;
        const N = new Date(r.date);
        N.setHours(0, 0, 0, 0);
        const se = 1440 - J / 6e4, Z = x.getHours() * 60 + x.getMinutes(), C = Math.max(
          0,
          Math.min(Z + I, se)
        );
        if (C === Z) return;
        const H = new Date(N);
        H.setMinutes(C);
        const M = new Date(H.getTime() + J), te = {
          ...E,
          startDate: zl(H),
          endDate: zl(M)
        };
        a("task-move", {
          task: te,
          previousStartDate: x,
          previousEndDate: oe,
          newStartDate: H,
          newEndDate: M,
          resourceId: r.resourceId
        });
      }
    }), W = ce(() => {
      var N;
      const E = k.draft.value;
      if (!E || !k.isDragging.value && !k.isConfirmed.value) return null;
      const Q = E.startDate.getHours() * 60 + E.startDate.getMinutes(), x = E.endDate.getHours() * 60 + E.endDate.getMinutes(), oe = Math.min(Q, x) / 60 * Yi, J = Math.abs(x - Q) / 60 * Yi || 4, S = ((N = A.value) == null ? void 0 : N.clientWidth) ?? 0, I = Math.max(S - qo - 8, 0);
      return { top: oe, left: qo, width: I, height: J };
    }), F = ce(() => k.isRejected.value ? "rejected" : k.isPending.value ? "pending" : "active"), Y = ce(() => {
      if (F.value !== "active") return [];
      const E = k.draft.value;
      if (!E || !k.isDragging.value && !k.isConfirmed.value) return [];
      const Q = E.startDate.getHours() * 60 + E.startDate.getMinutes(), x = E.endDate.getHours() * 60 + E.endDate.getMinutes();
      return B5(
        Q,
        x,
        Yi,
        r.selectionMinuteStep
      ).map((oe) => ({
        top: oe.slotTop,
        height: oe.slotHeight,
        indicatorTop: oe.indicatorTop,
        indicatorHeight: oe.indicatorHeight
      }));
    }), T = ce(() => {
      var Q;
      const E = ((Q = A.value) == null ? void 0 : Q.clientWidth) ?? 0;
      return Math.max(E - qo - 8, 0);
    });
    return t({ clearSelection: () => k.clear() }), (E, Q) => ($(), ee("div", YL, [
      l.value.length ? ($(), ee("div", GL, [
        _("div", zL, Ee(n.allDayLabel), 1),
        _("div", XL, [
          ($(!0), ee(St, null, nr(l.value, (x) => ($(), ee("div", {
            key: x.id,
            class: "gantt-calendar-task-chip",
            style: Mt({ backgroundColor: x.barColor || "var(--gantt-primary)" }),
            title: `${x.name} - ${n.allDayLabel}`,
            onClick: (oe) => a("task-click", x, oe)
          }, Ee(x.name) + " - " + Ee(n.allDayLabel), 13, JL))), 128))
        ])
      ])) : vt("", !0),
      _("div", {
        ref_key: "gridRef",
        ref: A,
        class: "gantt-calendar-day-grid",
        onMousedown: D
      }, [
        ($(!0), ee(St, null, nr(i.value, (x) => ($(), ee("div", {
          key: x.hour,
          class: tr(["gantt-calendar-hour-row", {
            "is-working-hour": x.isWorkingHour,
            "is-current-hour": x.isCurrentHour
          }])
        }, [
          _("div", ZL, Ee(x.label), 1),
          _("div", {
            class: "gantt-calendar-hour-cell",
            "data-hour": x.hour
          }, null, 8, eI)
        ], 2))), 128)),
        s.value !== null ? ($(), ee("div", {
          key: 0,
          class: "gantt-calendar-now-line",
          style: Mt({
            top: `${s.value}px`,
            left: `${qo}px`,
            width: `${T.value}px`
          })
        }, null, 4)) : vt("", !0),
        ($(!0), ee(St, null, nr(f.value, (x, oe) => ($(), ee("div", {
          key: x.id,
          class: tr(["gantt-calendar-timed-task", { "is-task-dragging": Te(O) === x.id }]),
          style: Mt(p(x, oe)),
          title: x.name,
          onMousedown: (J) => Te(G)(x, J)
        }, [
          Nn(E.$slots, "task-card", {
            task: x,
            style: Mt(p(x, oe))
          }, () => [
            _("div", rI, Ee(h(x, oe)), 1),
            x.description ? ($(), ee("div", nI, Ee(x.description), 1)) : vt("", !0)
          ], !0)
        ], 46, tI))), 128)),
        na(h0, {
          rect: F.value !== "active" ? W.value : null,
          segments: Y.value,
          left: qo,
          width: T.value,
          "indicator-width": 4,
          state: F.value
        }, null, 8, ["rect", "segments", "width", "state"])
      ], 544)
    ]));
  }
}), AI = /* @__PURE__ */ Fn(aI, [["__scopeId", "data-v-ff751fe4"]]), sI = { class: "gantt-calendar-week-view" }, iI = { class: "gantt-calendar-week-header" }, oI = {
  key: 0,
  class: "gantt-calendar-week-allday-row"
}, lI = { class: "gantt-calendar-hour-label-placeholder gantt-calendar-allday-label" }, uI = ["title", "onClick"], cI = { class: "gantt-calendar-hour-label-column" }, dI = ["data-day-index"], fI = ["title", "onMousedown"], yo = 48, Bl = 60, hI = /* @__PURE__ */ hn({
  __name: "CalendarWeekView",
  props: {
    anchorDate: {},
    tasks: { default: () => [] },
    workingHours: {},
    resourceId: {},
    selectionMinuteStep: { default: 15 },
    disabled: { type: Boolean, default: !1 },
    allDayLabel: { default: "全天" },
    taskCardOpacity: { default: 0.18 },
    taskAccentWidth: { default: 5 }
  },
  emits: ["selection-complete", "selection-cancel", "task-click", "task-move"],
  setup(n, { expose: t, emit: e }) {
    const r = n, a = e, A = me(), i = ce(() => qL(r.anchorDate, r.workingHours)), s = (J) => `${J.getMonth() + 1}/${J.getDate()}`, o = m0, l = (J) => r.tasks.filter((S) => {
      const I = o(S.startDate), N = o(S.endDate);
      return !I || !N ? !1 : Ed(I, N, J).type === "all-day";
    }), u = ce(
      () => i.value.some((J) => l(J.date).length > 0)
    ), f = (J) => {
      const S = [];
      for (const I of r.tasks) {
        const N = o(I.startDate), se = o(I.endDate);
        if (!N || !se) continue;
        const Z = Ed(N, se, J);
        if (Z.type !== "timed") continue;
        const C = Z.startMinutes, H = Math.max(Z.endMinutes, C + 15);
        S.push({ task: I, startMinutes: C, endMinutes: H });
      }
      return S;
    }, h = (J) => y5(J.task.name, J.startMinutes, J.endMinutes), c = ce(() => {
      const J = i.value.findIndex((S) => S.isToday);
      return J === -1 ? null : Bl + J * m();
    }), p = ce(() => m()), w = ce(() => c.value === null ? null : p5(/* @__PURE__ */ new Date()) / 60 * yo), y = me(null), m = () => {
      const J = A.value;
      return J ? (J.clientWidth - Bl) / 7 : 0;
    }, k = ce(() => {
      const J = m(), S = [];
      return i.value.forEach((I, N) => {
        const se = f(I.date), Z = se.map((H) => ({
          start: H.startMinutes,
          end: H.endMinutes
        })), C = b5(Z);
        se.forEach((H, M) => {
          const { start: te, end: ie } = Z[M], we = C[M], ve = te / 60 * yo, le = (ie - te) / 60 * yo, _e = J / we.columnCount, De = Bl + N * J + we.column * _e;
          S.push({
            task: H.task,
            dayIndex: N,
            top: ve,
            height: le,
            left: De,
            width: Math.max(_e - 2, 0),
            startMinutes: H.startMinutes,
            endMinutes: H.endMinutes
          });
        });
      }), S;
    }), D = (J) => {
      let S = J.top, I = J.left;
      F.value && Y.value === J.task.id && (S += T.value.deltaY, I += T.value.deltaX);
      const N = J.task.barColor || "var(--gantt-primary)", se = Math.round(Math.min(Math.max(r.taskCardOpacity, 0), 1) * 100);
      return {
        top: `${S}px`,
        height: `${J.height}px`,
        left: `${I}px`,
        width: `${J.width}px`,
        borderLeftWidth: `${r.taskAccentWidth}px`,
        borderLeftColor: N,
        backgroundColor: `color-mix(in srgb, ${N} ${se}%, transparent)`
      };
    }, B = (J) => {
      var ie;
      const S = A.value;
      if (!S) return null;
      const I = S.getBoundingClientRect(), N = Math.min(
        Math.max(J.clientX - I.left - Bl, 0),
        I.width - Bl
      ), se = Math.min(Math.max(J.clientY - I.top, 0), I.height), Z = m(), C = Z > 0 ? Math.min(Math.floor(N / Z), 6) : 0, H = se / yo * 60, M = ((ie = i.value[C]) == null ? void 0 : ie.date) ?? r.anchorDate, te = new Date(M);
      return te.setHours(0, H, 0, 0), { dayIndex: C, date: fp(te, r.selectionMinuteStep) };
    }, O = (J) => {
      const S = B(J);
      return !S || !y.value ? null : {
        startDate: y.value.date,
        endDate: S.date,
        resourceId: r.resourceId,
        scale: "week"
      };
    }, q = ce(() => r.disabled), G = g0({
      disabled: q,
      resolveDraft: O,
      onSelectionComplete: (J) => a("selection-complete", J),
      onSelectionCancel: (J) => a("selection-cancel", J)
    }), W = (J) => {
      if (r.disabled) return;
      const S = B(J);
      S && (y.value = S, G.handleMouseDown(J));
    }, {
      isDragging: F,
      draggingTaskId: Y,
      dragDelta: T,
      handleMouseDown: E
    } = v0({
      disabled: q,
      onClick: (J, S) => a("task-click", J, S),
      onDragEnd: (J, S) => {
        const I = o(J.startDate), N = o(J.endDate);
        if (!I || !N || !no(I, N)) return;
        const se = N.getTime() - I.getTime(), Z = m();
        if (Z <= 0) return;
        const C = i.value.findIndex((Qe) => no(Qe.date, I));
        if (C === -1) return;
        const H = Math.round(S.deltaX / Z), M = S.deltaY / yo * 60, te = Math.round(M / r.selectionMinuteStep) * r.selectionMinuteStep, ie = Math.max(
          0,
          Math.min(C + H, i.value.length - 1)
        ), we = I.getHours() * 60 + I.getMinutes(), ve = 1440 - se / 6e4, le = Math.max(
          0,
          Math.min(we + te, ve)
        );
        if (ie === C && le === we) return;
        const _e = i.value[ie].date, De = new Date(_e);
        De.setHours(0, le, 0, 0);
        const ze = new Date(De.getTime() + se), nt = {
          ...J,
          startDate: zl(De),
          endDate: zl(ze)
        };
        a("task-move", {
          task: nt,
          previousStartDate: I,
          previousEndDate: N,
          newStartDate: De,
          newEndDate: ze,
          resourceId: r.resourceId
        });
      }
    }), Q = ce(() => {
      const J = G.draft.value;
      if (!J || !G.isDragging.value && !G.isConfirmed.value || !y.value)
        return null;
      const S = m(), I = y.value.dayIndex, N = J.startDate.getHours() * 60 + J.startDate.getMinutes(), se = J.endDate.getHours() * 60 + J.endDate.getMinutes(), Z = Math.min(N, se) / 60 * yo, C = Math.abs(se - N) / 60 * yo || 4;
      return {
        top: Z,
        left: Bl + I * S,
        width: S,
        height: C
      };
    }), x = ce(() => G.isRejected.value ? "rejected" : G.isPending.value ? "pending" : "active"), oe = ce(() => {
      if (x.value !== "active") return [];
      const J = G.draft.value;
      if (!J || !G.isDragging.value && !G.isConfirmed.value) return [];
      const S = J.startDate.getHours() * 60 + J.startDate.getMinutes(), I = J.endDate.getHours() * 60 + J.endDate.getMinutes();
      return B5(
        S,
        I,
        yo,
        r.selectionMinuteStep
      ).map((N) => ({
        top: N.slotTop,
        height: N.slotHeight,
        indicatorTop: N.indicatorTop,
        indicatorHeight: N.indicatorHeight
      }));
    });
    return t({ clearSelection: () => G.clear() }), (J, S) => ($(), ee("div", sI, [
      _("div", iI, [
        S[0] || (S[0] = _("div", { class: "gantt-calendar-hour-label-placeholder" }, null, -1)),
        ($(!0), ee(St, null, nr(i.value, (I) => ($(), ee("div", {
          key: I.date.toISOString(),
          class: tr(["gantt-calendar-week-day-header", { "is-today": I.isToday, "is-weekend": I.isWeekend }])
        }, Ee(s(I.date)), 3))), 128))
      ]),
      u.value ? ($(), ee("div", oI, [
        _("div", lI, Ee(n.allDayLabel), 1),
        ($(!0), ee(St, null, nr(i.value, (I) => ($(), ee("div", {
          key: "allday-" + I.date.toISOString(),
          class: "gantt-calendar-week-allday-col"
        }, [
          ($(!0), ee(St, null, nr(l(I.date), (N) => ($(), ee("div", {
            key: N.id,
            class: "gantt-calendar-task-chip",
            style: Mt({ backgroundColor: N.barColor || "var(--gantt-primary)" }),
            title: N.name,
            onClick: (se) => a("task-click", N, se)
          }, Ee(N.name) + " - " + Ee(n.allDayLabel), 13, uI))), 128))
        ]))), 128))
      ])) : vt("", !0),
      _("div", {
        ref_key: "gridRef",
        ref: A,
        class: "gantt-calendar-week-grid",
        onMousedown: W
      }, [
        _("div", cI, [
          ($(), ee(St, null, nr(24, (I) => _("div", {
            key: I,
            class: "gantt-calendar-hour-label"
          }, Ee(String(I - 1).padStart(2, "0")) + ":00 ", 1)), 64))
        ]),
        ($(!0), ee(St, null, nr(i.value, (I, N) => ($(), ee("div", {
          key: I.date.toISOString(),
          class: "gantt-calendar-week-day-column",
          "data-day-index": N
        }, [
          ($(!0), ee(St, null, nr(I.hours, (se) => ($(), ee("div", {
            key: se.hour,
            class: tr(["gantt-calendar-hour-cell", { "is-working-hour": se.isWorkingHour, "is-current-hour": se.isCurrentHour }])
          }, null, 2))), 128))
        ], 8, dI))), 128)),
        ($(!0), ee(St, null, nr(k.value, (I, N) => ($(), ee("div", {
          key: "timed-" + I.task.id + "-" + N,
          class: tr(["gantt-calendar-timed-task", { "is-task-dragging": Te(Y) === I.task.id }]),
          style: Mt(D(I)),
          title: I.task.name,
          onMousedown: (se) => Te(E)(I.task, se)
        }, [
          Nn(J.$slots, "task-card", {
            task: I.task,
            style: Mt(D(I))
          }, () => [
            fn(Ee(h(I)), 1)
          ], !0)
        ], 46, fI))), 128)),
        na(h0, {
          rect: x.value !== "active" ? Q.value : null,
          segments: oe.value,
          left: Q.value ? Q.value.left : 0,
          width: Q.value ? Q.value.width : 0,
          "indicator-width": 4,
          state: x.value
        }, null, 8, ["rect", "segments", "left", "width", "state"]),
        w.value !== null && c.value !== null ? ($(), ee("div", {
          key: 0,
          class: "gantt-calendar-now-line",
          style: Mt({
            top: `${w.value}px`,
            left: `${c.value}px`,
            width: `${p.value}px`
          })
        }, null, 4)) : vt("", !0)
      ], 544)
    ]));
  }
}), gI = /* @__PURE__ */ Fn(hI, [["__scopeId", "data-v-339c2261"]]), vI = { class: "gantt-calendar-more-popover-header" }, pI = { class: "gantt-calendar-more-popover-body" }, mI = ["onClick"], wI = /* @__PURE__ */ hn({
  __name: "CalendarMoreTasksPopover",
  props: {
    date: {},
    tasks: {},
    anchor: {}
  },
  emits: ["close", "task-click"],
  setup(n) {
    const t = n, e = ce(
      () => `${t.date.getFullYear()}/${t.date.getMonth() + 1}/${t.date.getDate()}`
    ), r = ce(() => {
      if (!t.anchor) return {};
      const a = t.anchor.getBoundingClientRect();
      return {
        position: "fixed",
        top: `${a.bottom + 4}px`,
        left: `${a.left}px`
      };
    });
    return (a, A) => ($(), Ir(es, { to: "body" }, [
      _("div", {
        class: "gantt-calendar-more-popover-mask",
        onClick: A[2] || (A[2] = (i) => a.$emit("close"))
      }, [
        _("div", {
          class: "gantt-calendar-more-popover",
          style: Mt(r.value),
          onClick: A[1] || (A[1] = dn(() => {
          }, ["stop"]))
        }, [
          _("div", vI, [
            _("span", null, Ee(e.value), 1),
            _("button", {
              type: "button",
              class: "gantt-calendar-more-popover-close",
              onClick: A[0] || (A[0] = (i) => a.$emit("close"))
            }, " × ")
          ]),
          _("div", pI, [
            ($(!0), ee(St, null, nr(n.tasks, (i) => ($(), ee("div", {
              key: i.id,
              class: "gantt-calendar-more-popover-item",
              style: Mt({ borderLeftColor: i.barColor || "var(--gantt-primary)" }),
              onClick: (s) => a.$emit("task-click", i, s)
            }, Ee(i.name), 13, mI))), 128))
          ])
        ], 4)
      ])
    ]));
  }
}), yI = /* @__PURE__ */ Fn(wI, [["__scopeId", "data-v-4f568a1a"]]), BI = { class: "gantt-calendar-month-view" }, bI = { class: "gantt-calendar-month-header" }, CI = ["data-week-index", "data-day-index"], kI = { class: "gantt-calendar-month-day-number" }, TI = { class: "gantt-calendar-month-tasks" }, xI = ["title", "onMousedown"], DI = ["onClick"], EI = /* @__PURE__ */ hn({
  __name: "CalendarMonthView",
  props: {
    anchorDate: {},
    tasks: { default: () => [] },
    resourceId: {},
    disabled: { type: Boolean, default: !1 }
  },
  emits: ["selection-complete", "selection-cancel", "task-click", "task-move"],
  setup(n, { expose: t, emit: e }) {
    const r = n, a = e, A = ["一", "二", "三", "四", "五", "六", "日"], i = me(), s = ce(() => jL(r.anchorDate)), o = me(null), l = (Y, T) => {
      o.value = { date: Y, anchor: T.currentTarget };
    }, u = m0, f = (Y) => r.tasks.filter((T) => {
      const E = u(T.startDate), Q = u(T.endDate);
      return !E || !Q ? !1 : $L(E, Q, Y);
    }), h = me(null), c = (Y) => {
      var oe, J;
      const T = (oe = Y.target) == null ? void 0 : oe.closest(
        ".gantt-calendar-month-day"
      );
      if (!T) return null;
      const E = Number(T.dataset.weekIndex), Q = Number(T.dataset.dayIndex), x = (J = s.value[E]) == null ? void 0 : J[Q];
      return x ? Uf(x.date) : null;
    }, p = (Y) => {
      const T = c(Y);
      return !T || !h.value ? null : {
        startDate: h.value,
        endDate: T,
        resourceId: r.resourceId,
        scale: "month"
      };
    }, w = ce(() => r.disabled), y = g0({
      disabled: w,
      resolveDraft: p,
      onSelectionComplete: (Y) => a("selection-complete", Y),
      onSelectionCancel: (Y) => a("selection-cancel", Y)
    }), m = (Y) => {
      if (r.disabled) return;
      const T = c(Y);
      T && (h.value = T, y.handleMouseDown(Y));
    }, k = me(null), D = me(null), B = (Y, T) => {
      var S;
      const E = document.elementFromPoint(Y, T), Q = E == null ? void 0 : E.closest(".gantt-calendar-month-day");
      if (!Q) return null;
      const x = Number(Q.dataset.weekIndex), oe = Number(Q.dataset.dayIndex), J = (S = s.value[x]) == null ? void 0 : S[oe];
      return J ? J.date : null;
    }, { draggingTaskId: O, handleMouseDown: q } = v0({
      disabled: w,
      onClick: (Y, T) => a("task-click", Y, T),
      onDragMove: (Y, T, E) => {
        D.value = B(E.clientX, E.clientY);
      },
      onDragEnd: (Y, T, E) => {
        D.value = null;
        const Q = B(E.clientX, E.clientY), x = k.value;
        if (k.value = null, !Q || !x || no(Q, x)) return;
        const oe = u(Y.startDate), J = u(Y.endDate);
        if (!oe || !J) return;
        const S = Uf(Q).getTime() - Uf(x).getTime(), I = new Date(oe.getTime() + S), N = new Date(J.getTime() + S), se = {
          ...Y,
          startDate: zl(I),
          endDate: zl(N)
        };
        a("task-move", {
          task: se,
          previousStartDate: oe,
          previousEndDate: J,
          newStartDate: I,
          newEndDate: N,
          resourceId: r.resourceId
        });
      }
    }), G = (Y, T, E) => {
      k.value = T, q(Y, E);
    }, W = ce(() => {
      const Y = y.draft.value;
      if (!Y || !y.isDragging.value && !y.isConfirmed.value) return null;
      const T = i.value, E = T == null ? void 0 : T.querySelector(
        "[data-week-index] .gantt-calendar-month-day"
      );
      if (!T || !E) return null;
      const Q = (H) => {
        for (let M = 0; M < s.value.length; M++)
          for (let te = 0; te < 7; te++)
            if (no(s.value[M][te].date, H))
              return T.querySelector(
                `[data-week-index="${M}"][data-day-index="${te}"]`
              );
        return null;
      }, x = Q(Y.startDate), oe = Q(Y.endDate);
      if (!x || !oe) return null;
      const J = T.getBoundingClientRect(), S = x.getBoundingClientRect(), I = oe.getBoundingClientRect(), N = Math.min(S.top, I.top) - J.top, se = Math.min(S.left, I.left) - J.left, Z = Math.max(S.right, I.right) - J.left, C = Math.max(S.bottom, I.bottom) - J.top;
      return { top: N, left: se, width: Z - se, height: C - N };
    }), F = ce(() => y.isRejected.value ? "rejected" : y.isPending.value ? "pending" : "active");
    return t({ clearSelection: () => y.clear() }), (Y, T) => ($(), ee("div", BI, [
      _("div", bI, [
        ($(), ee(St, null, nr(A, (E) => _("div", {
          key: E,
          class: "gantt-calendar-month-weekday"
        }, Ee(E), 1)), 64))
      ]),
      _("div", {
        ref_key: "gridRef",
        ref: i,
        class: "gantt-calendar-month-grid",
        onMousedown: m
      }, [
        ($(!0), ee(St, null, nr(s.value, (E, Q) => ($(), ee("div", {
          key: Q,
          class: "gantt-calendar-month-week"
        }, [
          ($(!0), ee(St, null, nr(E, (x, oe) => ($(), ee("div", {
            key: oe,
            class: tr(["gantt-calendar-month-day", {
              "is-other-month": !x.isCurrentMonth,
              "is-weekend": x.isWeekend,
              "is-today": x.isToday,
              "is-drop-target": D.value && Te(no)(D.value, x.date)
            }]),
            "data-week-index": Q,
            "data-day-index": oe
          }, [
            _("div", kI, Ee(x.date.getDate()), 1),
            _("div", TI, [
              ($(!0), ee(St, null, nr(f(x.date).slice(0, 3), (J) => ($(), ee("div", {
                key: J.id,
                class: tr(["gantt-calendar-task-chip", { "is-task-dragging": Te(O) === J.id }]),
                style: Mt({ backgroundColor: J.barColor || "var(--gantt-primary)" }),
                title: J.name,
                onMousedown: (S) => G(J, x.date, S)
              }, Ee(J.name), 47, xI))), 128)),
              f(x.date).length > 3 ? ($(), ee("button", {
                key: 0,
                type: "button",
                class: "gantt-calendar-more-trigger",
                onClick: dn((J) => l(x.date, J), ["stop"])
              }, " +" + Ee(f(x.date).length - 3) + " 更多 ", 9, DI)) : vt("", !0)
            ])
          ], 10, CI))), 128))
        ]))), 128)),
        na(h0, {
          rect: W.value,
          state: F.value
        }, null, 8, ["rect", "state"])
      ], 544),
      o.value ? ($(), Ir(yI, {
        key: 0,
        date: o.value.date,
        tasks: f(o.value.date),
        anchor: o.value.anchor,
        onClose: T[0] || (T[0] = (E) => o.value = null),
        onTaskClick: T[1] || (T[1] = (E, Q) => a("task-click", E, Q))
      }, null, 8, ["date", "tasks", "anchor"])) : vt("", !0)
    ]));
  }
}), SI = /* @__PURE__ */ Fn(EI, [["__scopeId", "data-v-74c52bf5"]]), FI = ["disabled"], UI = {
  key: 0,
  class: "gantt-resource-filter-avatar"
}, LI = ["src", "alt"], II = {
  key: 1,
  class: "gantt-resource-filter-avatar-fallback"
}, QI = { class: "gantt-resource-filter-label" }, MI = ["onClick"], _I = { class: "gantt-resource-filter-avatar" }, RI = ["src", "alt"], NI = {
  key: 1,
  class: "gantt-resource-filter-avatar-fallback"
}, HI = { class: "gantt-resource-filter-option-name" }, OI = /* @__PURE__ */ hn({
  __name: "ResourceFilterSelect",
  props: {
    resources: { default: () => [] },
    modelValue: { default: null },
    placeholder: { default: "请选择资源" },
    disabled: { type: Boolean, default: !1 }
  },
  emits: ["update:modelValue", "change"],
  setup(n, { emit: t }) {
    const e = n, r = t, a = me(!1), A = me(null), i = me(null), s = me(!1), o = (w, y) => y != null && String(w) === String(y), l = ce(
      () => e.resources.find((w) => o(w.id, e.modelValue)) ?? null
    ), u = (w) => w ? w.trim().slice(0, 1).toUpperCase() : "?", f = async () => {
      await An();
      const w = A.value, y = i.value;
      if (!w || !y) return;
      const m = w.getBoundingClientRect(), k = y.offsetWidth;
      s.value = m.left + k > window.innerWidth;
    }, h = () => {
      e.disabled || (a.value = !a.value, a.value && f());
    }, c = (w) => {
      const y = e.modelValue ?? null;
      a.value = !1, String(w ?? "") !== String(y ?? "") && (r("update:modelValue", w), r("change", { next: w, prev: y }));
    }, p = (w) => {
      a.value && A.value && !A.value.contains(w.target) && (a.value = !1);
    };
    return sA(() => document.addEventListener("click", p)), mT(() => document.removeEventListener("click", p)), (w, y) => ($(), ee("div", {
      ref_key: "rootRef",
      ref: A,
      class: tr(["gantt-resource-filter-select", { "is-disabled": n.disabled, "is-open": a.value }])
    }, [
      _("button", {
        type: "button",
        class: "gantt-resource-filter-trigger",
        disabled: n.disabled,
        onClick: h
      }, [
        l.value ? ($(), ee("span", UI, [
          l.value.avatar ? ($(), ee("img", {
            key: 0,
            src: l.value.avatar,
            alt: l.value.name
          }, null, 8, LI)) : ($(), ee("span", II, Ee(u(l.value.name)), 1))
        ])) : vt("", !0),
        _("span", QI, Ee(l.value ? l.value.name : n.placeholder), 1),
        y[1] || (y[1] = _("span", { class: "gantt-resource-filter-arrow" }, "▾", -1))
      ], 8, FI),
      a.value ? ($(), ee("ul", {
        key: 0,
        ref_key: "menuRef",
        ref: i,
        class: tr(["gantt-resource-filter-menu", { "align-right": s.value }])
      }, [
        _("li", {
          class: tr(["gantt-resource-filter-option", { "is-active": n.modelValue === null || n.modelValue === void 0 }]),
          onClick: y[0] || (y[0] = (m) => c(null))
        }, Ee(n.placeholder), 3),
        ($(!0), ee(St, null, nr(n.resources, (m) => ($(), ee("li", {
          key: m.id,
          class: tr(["gantt-resource-filter-option", { "is-active": o(m.id, n.modelValue) }]),
          onClick: (k) => c(m.id)
        }, [
          _("span", _I, [
            m.avatar ? ($(), ee("img", {
              key: 0,
              src: m.avatar,
              alt: m.name
            }, null, 8, RI)) : ($(), ee("span", NI, Ee(u(m.name)), 1))
          ]),
          _("span", HI, Ee(m.name), 1)
        ], 10, MI))), 128))
      ], 2)) : vt("", !0)
    ], 2));
  }
}), PI = /* @__PURE__ */ Fn(OI, [["__scopeId", "data-v-dfb0d5c5"]]), WI = { class: "gantt-calendar-toolbar" }, KI = { class: "gantt-calendar-nav" }, $I = ["title"], VI = ["title"], qI = ["title"], jI = { class: "gantt-calendar-controls" }, YI = { class: "gantt-calendar-body" }, GI = /* @__PURE__ */ hn({
  __name: "CalendarView",
  props: {
    tasks: {},
    resources: { default: () => [] },
    scale: {},
    defaultScale: { default: "day" },
    currentDate: {},
    selectedResourceId: {},
    workingHours: { default: () => ({
      morning: { start: 8, end: 11 },
      afternoon: { start: 13, end: 17 }
    }) },
    selectionMinuteStep: { default: 15 },
    disabled: { type: Boolean, default: !1 },
    locale: { default: "zh-CN" },
    onBeforeSelect: {},
    onBeforeResourceChange: {},
    onBeforeViewChange: {},
    onSelectionComplete: {},
    onResourceChange: {},
    onTaskClick: {},
    onTaskMove: {},
    allDayLabel: { default: "全天" },
    taskCardOpacity: { default: 0.18 },
    taskAccentWidth: { default: 5 }
  },
  emits: ["selection-complete", "selection-cancel", "resource-change", "view-change", "date-change", "task-click", "task-move"],
  setup(n, { expose: t, emit: e }) {
    const r = n, a = e, A = ce(() => o.value === "day" ? "上一天" : o.value === "week" ? "上一周" : "上一月"), i = ce(() => o.value === "day" ? "下一天" : o.value === "week" ? "下一周" : "下一月"), s = me(r.defaultScale), o = ce(() => r.scale ?? s.value), l = (I) => I ? I instanceof Date ? I : new Date(I) : /* @__PURE__ */ new Date(), u = me(l(r.currentDate)), f = ce(
      () => r.currentDate ? l(r.currentDate) : u.value
    );
    Gt(
      () => r.currentDate,
      (I) => {
        I && (u.value = l(I));
      }
    );
    const h = me(r.selectedResourceId ?? null), c = ce(
      () => r.selectedResourceId !== void 0 ? r.selectedResourceId : h.value
    ), p = (I, N) => {
      var C;
      if ((C = I.resources) != null && C.some((H) => String(H.id) === String(N.id))) return !0;
      const se = I.assignee;
      return se ? (Array.isArray(se) ? se : [se]).some((H) => H === N.name || String(H) === String(N.id)) : !1;
    }, w = ce(() => {
      const I = c.value;
      if (I == null || I === "") return [];
      const N = r.resources.find((C) => String(C.id) === String(I));
      if (!N) return [];
      const se = [], Z = (C) => {
        if (C)
          for (const H of C)
            p(H, N) && se.push(H), H.children && H.children.length > 0 && Z(H.children);
      };
      return Z(r.tasks), se;
    }), y = ce(() => {
      const I = f.value;
      return o.value === "month" ? `${I.getFullYear()}年${I.getMonth() + 1}月` : `${I.getFullYear()}/${I.getMonth() + 1}/${I.getDate()}`;
    }), m = ce(() => {
      const I = f.value;
      return `${I.getFullYear()}-${String(I.getMonth() + 1).padStart(2, "0")}-${String(I.getDate()).padStart(2, "0")}`;
    }), k = me(null), D = (I) => {
      const N = f.value;
      r.currentDate === void 0 && (u.value = I), a("date-change", { next: I, prev: N });
    }, B = () => D(/* @__PURE__ */ new Date()), O = (I) => D(l(I)), q = (I) => {
      const N = Array.isArray(I) ? I[0] : I;
      N && O(N);
    }, G = () => {
      const I = new Date(f.value);
      o.value === "day" ? I.setDate(I.getDate() - 1) : o.value === "week" ? I.setDate(I.getDate() - 7) : I.setMonth(I.getMonth() - 1), D(I);
    }, W = () => {
      const I = new Date(f.value);
      o.value === "day" ? I.setDate(I.getDate() + 1) : o.value === "week" ? I.setDate(I.getDate() + 7) : I.setMonth(I.getMonth() + 1), D(I);
    }, F = (I) => {
      const N = o.value;
      r.scale === void 0 && (s.value = I), a("view-change", { next: I, prev: N });
    }, Y = async (I) => {
      const N = o.value;
      I === N || r.disabled || r.onBeforeViewChange && !await r.onBeforeViewChange(I, N) || F(I);
    }, T = (I) => {
      Y(I);
    }, E = async (I) => {
      var Z;
      const { next: N, prev: se } = I;
      r.onBeforeResourceChange && !await r.onBeforeResourceChange(N, se) || (r.selectedResourceId === void 0 && (h.value = N), (Z = r.onResourceChange) == null || Z.call(r, N, se), a("resource-change", { next: N, prev: se }));
    }, Q = (I) => {
      var N;
      (N = r.onSelectionComplete) == null || N.call(r, I), a("selection-complete", I);
    }, x = (I) => {
      a("selection-cancel", { reason: I });
    }, oe = (I, N) => {
      var se;
      (se = r.onTaskClick) == null || se.call(r, I, N), a("task-click", I, N);
    }, J = (I) => {
      var N;
      (N = r.onTaskMove) == null || N.call(r, I), a("task-move", I);
    };
    return t({ goToToday: B, goToDate: O, clearSelection: () => {
      var I;
      (I = k.value) == null || I.clearSelection();
    }, setScale: T }), (I, N) => ($(), ee("div", {
      class: tr(["gantt-calendar-view", { "is-disabled": n.disabled }])
    }, [
      _("div", WI, [
        _("div", KI, [
          _("button", {
            type: "button",
            class: "gantt-calendar-nav-btn",
            title: A.value,
            onClick: G
          }, " ‹ ", 8, $I),
          _("button", {
            type: "button",
            class: "gantt-calendar-today-btn",
            onClick: B
          }, "今天"),
          _("button", {
            type: "button",
            class: "gantt-calendar-nav-btn",
            title: i.value,
            onClick: W
          }, " › ", 8, VI),
          Nn(I.$slots, "date-picker", {
            date: f.value,
            onChange: q
          }, () => [
            _("div", {
              class: "gantt-calendar-date-picker-wrapper",
              title: y.value
            }, [
              na(Ol, {
                "model-value": m.value,
                type: "date",
                clearable: !1,
                "onUpdate:modelValue": q
              }, null, 8, ["model-value"])
            ], 8, qI)
          ], !0)
        ]),
        _("div", jI, [
          n.resources && n.resources.length ? ($(), Ir(PI, {
            key: 0,
            class: "gantt-calendar-resource-select",
            resources: n.resources,
            "model-value": c.value,
            disabled: n.disabled,
            onChange: E
          }, null, 8, ["resources", "model-value", "disabled"])) : vt("", !0)
        ])
      ]),
      _("div", YI, [
        o.value === "day" ? ($(), Ir(AI, {
          key: 0,
          ref_key: "subViewRef",
          ref: k,
          date: f.value,
          tasks: w.value,
          "working-hours": n.workingHours,
          "resource-id": c.value ?? void 0,
          "selection-minute-step": n.selectionMinuteStep,
          disabled: n.disabled,
          "all-day-label": n.allDayLabel,
          "task-card-opacity": n.taskCardOpacity,
          "task-accent-width": n.taskAccentWidth,
          "on-before-select": n.onBeforeSelect,
          onSelectionComplete: Q,
          onSelectionCancel: x,
          onTaskClick: oe,
          onTaskMove: J
        }, hi({ _: 2 }, [
          I.$slots["task-card"] ? {
            name: "task-card",
            fn: qa((se) => [
              Nn(I.$slots, "task-card", qs(So(se)), void 0, !0)
            ]),
            key: "0"
          } : void 0
        ]), 1032, ["date", "tasks", "working-hours", "resource-id", "selection-minute-step", "disabled", "all-day-label", "task-card-opacity", "task-accent-width", "on-before-select"])) : o.value === "week" ? ($(), Ir(gI, {
          key: 1,
          ref_key: "subViewRef",
          ref: k,
          "anchor-date": f.value,
          tasks: w.value,
          "working-hours": n.workingHours,
          "resource-id": c.value ?? void 0,
          "selection-minute-step": n.selectionMinuteStep,
          disabled: n.disabled,
          "all-day-label": n.allDayLabel,
          "task-card-opacity": n.taskCardOpacity,
          "task-accent-width": n.taskAccentWidth,
          onSelectionComplete: Q,
          onSelectionCancel: x,
          onTaskClick: oe,
          onTaskMove: J
        }, hi({ _: 2 }, [
          I.$slots["task-card"] ? {
            name: "task-card",
            fn: qa((se) => [
              Nn(I.$slots, "task-card", qs(So(se)), void 0, !0)
            ]),
            key: "0"
          } : void 0
        ]), 1032, ["anchor-date", "tasks", "working-hours", "resource-id", "selection-minute-step", "disabled", "all-day-label", "task-card-opacity", "task-accent-width"])) : ($(), Ir(SI, {
          key: 2,
          ref_key: "subViewRef",
          ref: k,
          "anchor-date": f.value,
          tasks: w.value,
          "resource-id": c.value ?? void 0,
          disabled: n.disabled,
          onSelectionComplete: Q,
          onSelectionCancel: x,
          onTaskClick: oe,
          onTaskMove: J
        }, null, 8, ["anchor-date", "tasks", "resource-id", "disabled"]))
      ])
    ], 2));
  }
}), zI = /* @__PURE__ */ Fn(GI, [["__scopeId", "data-v-b9c7fc28"]]), XI = { class: "gantt-resource-usage-hours" }, JI = { class: "gantt-resource-usage-percent" }, ZI = {
  key: 1,
  class: "gantt-resource-usage-empty"
}, eQ = ["data-theme"], tQ = { class: "gantt-resource-usage-tooltip-title" }, rQ = { class: "gantt-resource-usage-tooltip-list" }, nQ = ["onClick"], aQ = { class: "gantt-resource-usage-tooltip-task-name" }, AQ = { class: "gantt-resource-usage-tooltip-task-hours" }, qm = 260, sQ = 30, iQ = 30, oQ = 200, lQ = /* @__PURE__ */ hn({
  __name: "ResourceUsageCell",
  props: {
    cell: {},
    resourceId: {},
    overloadThreshold: { default: 100 },
    underloadThreshold: { default: 60 },
    overloadColor: {},
    normalColor: {},
    underloadColor: {},
    weekendColor: {},
    height: {}
  },
  emits: ["click", "hover", "task-detail-click"],
  setup(n, { emit: t }) {
    const e = n, r = t, a = me(!1), A = me(null), i = me({}), s = me({}), o = me("top"), l = Mr("gantt-theme", me("light")), u = () => {
      var F;
      const k = A.value;
      if (!k) return;
      const D = k.getBoundingClientRect(), B = ((F = e.cell) == null ? void 0 : F.taskBreakdown.length) ?? 0, O = iQ + Math.min(B * sQ, oQ), q = {
        position: "fixed",
        minWidth: "160px",
        maxWidth: `${qm}px`
      }, G = Math.max(D.width / 2, 10), W = {};
      D.left + qm > window.innerWidth ? (q.right = `${Math.max(window.innerWidth - D.right, 0)}px`, W.right = `${G}px`, W.transform = "translateX(50%)") : (q.left = `${D.left}px`, W.left = `${G}px`, W.transform = "translateX(-50%)"), D.bottom + O > window.innerHeight ? (q.bottom = `${Math.max(window.innerHeight - D.top, 0)}px`, o.value = "bottom") : (q.top = `${D.bottom}px`, o.value = "top"), i.value = q, s.value = W;
    }, f = ce(
      () => e.cell ? Math.round(e.cell.totalHours * 10) / 10 : 0
    ), h = ce(() => {
      var D;
      if ((D = e.cell) != null && D.isWeekend) return "is-weekend";
      if (!e.cell) return "is-empty";
      const k = e.cell.totalPercent;
      return k > e.overloadThreshold ? "is-overloaded" : k < e.underloadThreshold ? "is-underloaded" : "is-normal";
    }), c = ce(() => {
      const k = {};
      e.height !== void 0 && (k.height = `${e.height}px`);
      const D = (() => {
        switch (h.value) {
          case "is-weekend":
            return e.weekendColor;
          case "is-overloaded":
            return e.overloadColor;
          case "is-underloaded":
            return e.underloadColor;
          case "is-normal":
            return e.normalColor;
          default:
            return;
        }
      })();
      return D && (k.backgroundColor = D), k;
    }), p = () => {
      r("click", { resourceId: e.resourceId, cell: e.cell });
    }, w = () => {
      a.value = !0, u(), r("hover", e.cell ? { resourceId: e.resourceId, cell: e.cell } : null);
    }, y = () => {
      a.value = !1, r("hover", null);
    }, m = (k) => {
      r("task-detail-click", {
        resourceId: e.resourceId,
        taskId: k.taskId,
        taskName: k.taskName
      });
    };
    return (k, D) => ($(), ee("div", {
      ref_key: "cellRef",
      ref: A,
      class: tr(["gantt-resource-usage-cell", h.value]),
      style: Mt(c.value),
      onClick: p,
      onMouseenter: w,
      onMouseleave: y
    }, [
      n.cell ? ($(), ee(St, { key: 0 }, [
        _("span", XI, Ee(f.value) + "h", 1),
        _("span", JI, Ee(Math.round(n.cell.totalPercent)) + "%", 1)
      ], 64)) : ($(), ee("span", ZI, "-")),
      ($(), Ir(es, { to: "body" }, [
        n.cell && a.value && n.cell.taskBreakdown.length ? ($(), ee("div", {
          key: 0,
          class: "gantt-resource-usage-tooltip",
          "data-theme": Te(l),
          style: Mt(i.value),
          onClick: D[0] || (D[0] = dn(() => {
          }, ["stop"])),
          onMouseenter: w,
          onMouseleave: y
        }, [
          _("div", {
            class: tr(["gantt-resource-usage-tooltip-arrow", o.value === "top" ? "is-arrow-top" : "is-arrow-bottom"]),
            style: Mt(s.value)
          }, null, 6),
          _("div", tQ, Ee(f.value) + "h · " + Ee(Math.round(n.cell.totalPercent)) + "% ", 1),
          _("ul", rQ, [
            ($(!0), ee(St, null, nr(n.cell.taskBreakdown, (B) => ($(), ee("li", {
              key: B.taskId,
              class: "gantt-resource-usage-tooltip-item",
              onClick: (O) => m(B)
            }, [
              _("span", aQ, Ee(B.taskName), 1),
              _("span", AQ, Ee(Math.round(B.hours * 10) / 10) + "h", 1)
            ], 8, nQ))), 128))
          ])
        ], 44, eQ)) : vt("", !0)
      ]))
    ], 38));
  }
}), uQ = /* @__PURE__ */ Fn(lQ, [["__scopeId", "data-v-2caa38b6"]]), jm = 8, C5 = (n) => {
  const t = n.getDay();
  return t === 0 || t === 6;
}, Sd = (n) => {
  const t = new Date(n);
  return t.setHours(0, 0, 0, 0), t;
};
function Ym(n, t) {
  const e = [], r = Sd(n), a = Sd(t);
  for (; r.getTime() <= a.getTime(); )
    C5(r) || e.push(new Date(r)), r.setDate(r.getDate() + 1);
  return e;
}
const Gm = (n) => {
  if (!n) return null;
  const t = new Date(n);
  return isNaN(t.getTime()) ? null : t;
};
function cQ(n, t) {
  if (!n.resources || n.resources.length === 0) return 100;
  const e = n.resources.find((r) => String(r.id) === String(t));
  return e ? e.capacity ?? 100 : 100;
}
function dQ(n, t, e) {
  const r = [], a = Sd(n), A = Sd(t);
  if (e === "day") {
    const s = new Date(a);
    for (; s.getTime() <= A.getTime(); ) {
      const o = new Date(s);
      o.setHours(23, 59, 59, 999), r.push({ start: new Date(s), end: o }), s.setDate(s.getDate() + 1);
    }
    return r;
  }
  if (e === "week") {
    const s = new Date(a), o = s.getDay() || 7;
    for (s.setDate(s.getDate() - (o - 1)); s.getTime() <= A.getTime(); ) {
      const l = new Date(s);
      l.setDate(l.getDate() + 6), l.setHours(23, 59, 59, 999), r.push({ start: new Date(s), end: l }), s.setDate(s.getDate() + 7);
    }
    return r;
  }
  const i = new Date(a.getFullYear(), a.getMonth(), 1);
  for (; i.getTime() <= A.getTime(); ) {
    const s = new Date(i.getFullYear(), i.getMonth() + 1, 0, 23, 59, 59, 999);
    r.push({ start: new Date(i), end: s }), i.setMonth(i.getMonth() + 1);
  }
  return r;
}
function fQ(n) {
  return { cellsByResource: ce(() => {
    var A;
    const e = /* @__PURE__ */ new Map(), r = ((A = n.overloadThreshold) == null ? void 0 : A.value) ?? 100, a = dQ(
      n.dateRange.value.start,
      n.dateRange.value.end,
      n.scale.value
    );
    for (const i of n.resources.value) {
      const s = /* @__PURE__ */ new Map();
      for (const u of i.tasks ?? []) {
        const f = Gm(u.startDate), h = Gm(u.endDate);
        if (!f || !h) continue;
        const c = Ym(f, h);
        if (c.length === 0) continue;
        const w = cQ(u, i.id) / 100;
        let y;
        typeof u.estimatedHours == "number" && u.estimatedHours > 0 ? y = w * u.estimatedHours / c.length : y = w * jm;
        for (const m of c) {
          const k = m.getTime();
          s.has(k) || s.set(k, /* @__PURE__ */ new Map());
          const D = s.get(k), B = D.get(u.id) ?? { name: u.name, hours: 0 };
          B.hours += y, D.set(u.id, B);
        }
      }
      const o = n.scale.value, l = a.map((u) => {
        const f = Ym(u.start, u.end), h = /* @__PURE__ */ new Map();
        let c = 0;
        for (const m of f) {
          const k = s.get(m.getTime());
          if (k)
            for (const [D, B] of k) {
              c += B.hours;
              const O = h.get(D) ?? { name: B.name, hours: 0 };
              O.hours += B.hours, h.set(D, O);
            }
        }
        const p = f.length * jm, w = p > 0 ? c / p * 100 : 0, y = Array.from(h.entries()).map(
          ([m, k]) => ({
            taskId: m,
            taskName: k.name,
            hours: k.hours,
            percent: p > 0 ? k.hours / p * 100 : 0
          })
        );
        return {
          resourceId: i.id,
          periodStart: u.start,
          periodEnd: u.end,
          totalHours: c,
          totalPercent: w,
          isOverloaded: w > r,
          isWeekend: o === "day" ? C5(u.start) : !1,
          taskBreakdown: y
        };
      });
      e.set(i.id, l);
    }
    return e;
  }) };
}
const hQ = { class: "gantt-resource-usage-body" }, gQ = { class: "gantt-resource-usage-grid-panel" }, vQ = { class: "gantt-resource-usage-grid-header" }, pQ = { class: "gantt-resource-usage-grid-header-row major-row" }, mQ = { class: "gantt-resource-usage-grid-header-row minor-row" }, wQ = ["onMouseenter"], zm = 5, Xm = 5, yQ = /* @__PURE__ */ hn({
  __name: "ResourceUsageView",
  props: {
    resources: {},
    scale: {},
    defaultScale: { default: "week" },
    dateRange: {},
    resourceListConfig: {},
    columnRenderMode: { default: "default" },
    scaleConfigs: {},
    overloadThreshold: { default: 100 },
    underloadThreshold: { default: 60 },
    overloadColor: {},
    normalColor: {},
    underloadColor: {},
    weekendColor: {},
    rowHeight: { default: 51 },
    columnWidth: {},
    disabled: { type: Boolean, default: !1 },
    onBeforeScaleChange: {},
    onCellClick: {},
    onTaskDetailClick: {}
  },
  emits: ["scale-change", "cell-click", "cell-hover", "overload-detected", "task-detail-click"],
  setup(n, { expose: t, emit: e }) {
    const r = n, a = Jl();
    Tn("gantt-view-mode", me("resource")), Tn(
      "gantt-data-source",
      ce(() => r.resources)
    ), Tn(
      "gantt-list-config",
      ce(() => r.resourceListConfig ?? null)
    ), Tn(
      "gantt-row-height",
      ce(() => Math.max(0, r.rowHeight - 5))
    ), Tn(
      "resourceTaskLayouts",
      ce(() => {
        const K = /* @__PURE__ */ new Map();
        for (const X of r.resources)
          K.set(String(X.id), {
            taskRowMap: /* @__PURE__ */ new Map(),
            rowHeights: [r.rowHeight],
            totalHeight: r.rowHeight
          });
        return K;
      })
    );
    const A = e, i = me(r.defaultScale), s = ce(() => r.scale ?? i.value), o = () => {
      const K = /* @__PURE__ */ new Date();
      K.setDate(1);
      const X = new Date(K);
      return X.setMonth(X.getMonth() + 1), X.setDate(0), { start: K, end: X };
    }, l = ce(() => r.dateRange ?? o()), u = ce(() => r.overloadThreshold), f = ce(() => s.value), { cellsByResource: h } = fQ({
      resources: ce(() => r.resources),
      scale: f,
      dateRange: l,
      overloadThreshold: u
    }), c = ce(() => {
      const K = r.resources[0];
      return K ? h.value.get(K.id) ?? [] : [];
    }), p = (K, X) => {
      var ke;
      return ((ke = h.value.get(K)) == null ? void 0 : ke[X]) ?? null;
    }, w = ce(() => (r.scaleConfigs ?? bs)[s.value] ?? bs[s.value]), y = (K) => {
      const X = w.value.formatters.secondary;
      return X ? dp(X, K) : s.value === "month" ? `${K.getFullYear()}/${K.getMonth() + 1}` : `${K.getMonth() + 1}/${K.getDate()}`;
    }, m = ce(() => {
      var X;
      return (((X = r.resourceListConfig) == null ? void 0 : X.columns) ?? d5).filter((ke) => ke.visible !== !1);
    }), k = (K, X) => {
      if (!K.width) return 120;
      if (typeof K.width == "number") return K.width;
      const ke = K.width.trim();
      return ke.endsWith("%") ? Math.floor(X * parseFloat(ke) / 100) : parseFloat(ke) || 120;
    }, D = ce(
      () => m.value.reduce((K, X) => K + k(X, C.value), 0)
    ), B = async (K) => {
      const X = s.value;
      K === X || r.disabled || r.onBeforeScaleChange && !await r.onBeforeScaleChange(K, X) || (r.scale === void 0 && (i.value = K), A("scale-change", { next: K, prev: X }));
    }, O = (K) => {
      B(K);
    };
    Gt(
      () => r.scale,
      (K, X) => {
        K !== void 0 && X !== void 0 && K !== X && A("scale-change", { next: K, prev: X });
      }
    );
    const q = () => {
    }, G = (K) => {
      var X;
      (X = r.onCellClick) == null || X.call(r, K), A("cell-click", K);
    }, W = (K) => {
      A("cell-hover", K);
    }, F = (K) => {
      var X;
      (X = r.onTaskDetailClick) == null || X.call(r, K), A("task-detail-click", K);
    };
    Gt(
      h,
      (K) => {
        for (const [X, ke] of K) {
          const Je = ke.filter((pt) => pt.isOverloaded);
          Je.length > 0 && A("overload-detected", { resourceId: X, periods: Je });
        }
      },
      { immediate: !0 }
    );
    const Y = ce(() => r.rowHeight), T = me(null), E = ce(() => r.resources.length * Y.value), Q = ce(() => r.columnWidth ? r.columnWidth : s.value === "month" ? 100 : s.value === "week" ? 80 : 56), x = ce(() => c.value.length * Q.value), oe = ce(() => {
      const K = [], X = s.value, ke = w.value.formatters.primary;
      let Je = 0;
      for (const pt of c.value) {
        const Xe = pt.periodStart, Ye = X === "month" ? `${Xe.getFullYear()}` : `${Xe.getFullYear()}-${Xe.getMonth()}`, Kt = dp(ke, Xe), it = K[K.length - 1];
        it && it.key === Ye ? it.width += Q.value : K.push({ key: Ye, label: Kt, left: Je, width: Q.value }), Je += Q.value;
      }
      return K;
    }), J = me(null), S = me(0), I = me(null), N = ce(() => {
      var Je;
      const K = Kl(
        (Je = r.resourceListConfig) == null ? void 0 : Je.minWidth,
        S.value,
        Um
      ), X = Math.max(K, Um), ke = D.value;
      return ke > 0 && X >= ke ? ke : X;
    }), se = ce(() => {
      var Je, pt, Xe;
      const K = Kl(
        (Je = r.resourceListConfig) == null ? void 0 : Je.maxWidth,
        S.value,
        Hx
      ), X = ((Xe = (pt = I.value) == null ? void 0 : pt.getHeaderScrollWidth) == null ? void 0 : Xe.call(pt)) ?? null;
      if (X && X > 0)
        return Math.min(K, Math.max(X, N.value));
      const ke = D.value;
      return ke > 0 ? Math.min(K, Math.max(ke, N.value)) : K;
    }), C = me((() => {
      var K;
      return Kl(
        (K = r.resourceListConfig) == null ? void 0 : K.defaultWidth,
        S.value,
        Nx
      );
    })()), H = (K) => K < N.value ? N.value : K > se.value ? se.value : Math.max(N.value, K);
    let M = 0, te = 0;
    const ie = (K) => {
      const X = K.clientX - M;
      C.value = H(te + X);
    }, we = () => {
      document.removeEventListener("mousemove", ie), document.removeEventListener("mouseup", we), window.dispatchEvent(new CustomEvent("splitter-drag-end"));
    }, ve = (K) => {
      M = K.clientX, te = C.value, document.addEventListener("mousemove", ie), document.addEventListener("mouseup", we), window.dispatchEvent(new CustomEvent("splitter-drag-start")), K.preventDefault();
    }, le = me(null), _e = me(0), De = me(0), ze = me(0), nt = me(0), Qe = ce(() => {
      const K = r.resources.length;
      if (K === 0 || Y.value <= 0) return { start: 0, end: -1 };
      const X = Math.max(0, Math.floor(_e.value / Y.value) - zm), ke = Math.ceil((nt.value || 0) / Y.value), Je = Math.min(K - 1, X + ke + zm * 2);
      return { start: X, end: Je };
    }), ne = ce(() => {
      const K = c.value.length;
      if (K === 0 || Q.value <= 0) return { start: 0, end: -1 };
      const X = Math.max(
        0,
        Math.floor(De.value / Q.value) - Xm
      ), ke = Math.ceil((ze.value || 0) / Q.value), Je = Math.min(K - 1, X + ke + Xm * 2);
      return { start: X, end: Je };
    }), gt = ce(() => {
      const { start: K, end: X } = Qe.value, ke = [];
      for (let Je = K; Je <= X; Je++) {
        const pt = r.resources[Je];
        pt && ke.push({ resource: pt, top: Je * Y.value });
      }
      return ke;
    }), je = ce(() => {
      const { start: K, end: X } = ne.value, ke = [];
      for (let Je = K; Je <= X; Je++) {
        const pt = c.value[Je];
        pt && ke.push({
          index: Je,
          period: pt,
          left: Je * Q.value,
          isWeekend: !!pt.isWeekend
        });
      }
      return ke;
    });
    let ot = !1;
    const Ie = (K) => {
      const { scrollTop: X } = K.detail;
      _e.value = X, le.value && Math.abs(le.value.scrollTop - X) > 1 && (ot = !0, le.value.scrollTop = X, Promise.resolve().then(() => {
        ot = !1;
      }));
    }, It = (K) => {
      T.value = K.detail;
    }, dt = (K) => {
      T.value = K, window.dispatchEvent(new CustomEvent("timeline-task-hover", { detail: K }));
    }, Dt = () => {
      T.value = null, window.dispatchEvent(new CustomEvent("timeline-task-hover", { detail: null }));
    }, Ct = (K) => {
      const X = K.target;
      _e.value = X.scrollTop, De.value = X.scrollLeft, !ot && window.dispatchEvent(
        new CustomEvent("timeline-vertical-scroll", { detail: { scrollTop: X.scrollTop } })
      );
    };
    let Ve = null, ht = null;
    return sA(() => {
      window.addEventListener(
        "task-list-vertical-scroll",
        Ie
      ), window.addEventListener("task-list-hover", It), An(() => {
        le.value && (ze.value = le.value.clientWidth, nt.value = le.value.clientHeight, Ve = new ResizeObserver((K) => {
          for (const X of K)
            ze.value = X.contentRect.width, nt.value = X.contentRect.height;
        }), Ve.observe(le.value)), J.value && (S.value = J.value.clientWidth, ht = new ResizeObserver((K) => {
          for (const X of K)
            S.value = X.contentRect.width;
        }), ht.observe(J.value));
      });
    }), ga(() => {
      Ve == null || Ve.disconnect(), ht == null || ht.disconnect(), document.removeEventListener("mousemove", ie), document.removeEventListener("mouseup", we), window.removeEventListener(
        "task-list-vertical-scroll",
        Ie
      ), window.removeEventListener("task-list-hover", It);
    }), t({ refreshAggregation: q, setScale: O }), (K, X) => ($(), ee("div", {
      ref_key: "rootRef",
      ref: J,
      class: tr(["gantt-resource-usage-view", { "is-disabled": n.disabled }])
    }, [
      _("div", hQ, [
        _("div", {
          class: "gantt-resource-usage-list-panel",
          style: Mt({ width: C.value + "px" })
        }, [
          na(f5, {
            ref_key: "taskListRef",
            ref: I,
            class: "gantt-resource-usage-embedded-list",
            "task-list-column-render-mode": n.columnRenderMode
          }, hi({ _: 2 }, [
            Te(a).default ? {
              name: "default",
              fn: qa(() => [
                Nn(K.$slots, "default", {}, void 0, !0)
              ]),
              key: "0"
            } : void 0
          ]), 1032, ["task-list-column-render-mode"])
        ], 4),
        _("div", {
          class: "gantt-resource-usage-splitter",
          onMousedown: ve
        }, null, 32),
        _("div", gQ, [
          _("div", vQ, [
            _("div", {
              class: "gantt-resource-usage-grid-header-track",
              style: Mt({ width: x.value + "px", transform: `translateX(${-De.value}px)` })
            }, [
              _("div", pQ, [
                ($(!0), ee(St, null, nr(oe.value, (ke) => ($(), ee("div", {
                  key: ke.key,
                  class: "gantt-resource-usage-grid-major-cell",
                  style: Mt({ left: ke.left + "px", width: ke.width + "px" })
                }, Ee(ke.label), 5))), 128))
              ]),
              _("div", mQ, [
                ($(!0), ee(St, null, nr(je.value, (ke) => ($(), ee("div", {
                  key: ke.index,
                  class: tr(["gantt-resource-usage-grid-header-cell", { "is-weekend": ke.isWeekend }]),
                  style: Mt({ left: ke.left + "px", width: Q.value + "px" })
                }, Ee(y(ke.period.periodStart)), 7))), 128))
              ])
            ], 4)
          ]),
          _("div", {
            ref_key: "gridScrollRef",
            ref: le,
            class: "gantt-resource-usage-grid-scroll",
            onScroll: Ct
          }, [
            _("div", {
              class: "gantt-resource-usage-grid-inner",
              style: Mt({ width: x.value + "px", height: E.value + "px" })
            }, [
              ($(!0), ee(St, null, nr(gt.value, (ke) => ($(), ee("div", {
                key: ke.resource.id,
                class: tr(["gantt-resource-usage-grid-row", { "is-hover": T.value === ke.resource.id }]),
                style: Mt({
                  top: ke.top + "px",
                  height: Y.value + "px",
                  width: x.value + "px"
                }),
                onMouseenter: (Je) => dt(ke.resource.id),
                onMouseleave: Dt
              }, [
                ($(!0), ee(St, null, nr(je.value, (Je) => ($(), Ir(uQ, {
                  key: Je.index,
                  class: "gantt-resource-usage-grid-cell",
                  style: Mt({ left: Je.left + "px", width: Q.value + "px" }),
                  cell: p(ke.resource.id, Je.index),
                  "resource-id": ke.resource.id,
                  "overload-threshold": n.overloadThreshold,
                  "underload-threshold": n.underloadThreshold,
                  "overload-color": n.overloadColor,
                  "normal-color": n.normalColor,
                  "underload-color": n.underloadColor,
                  "weekend-color": n.weekendColor,
                  height: Y.value,
                  onClick: G,
                  onHover: W,
                  onTaskDetailClick: F
                }, null, 8, ["style", "cell", "resource-id", "overload-threshold", "underload-threshold", "overload-color", "normal-color", "underload-color", "weekend-color", "height"]))), 128))
              ], 46, wQ))), 128))
            ], 4)
          ], 544)
        ])
      ])
    ], 2));
  }
}), BQ = /* @__PURE__ */ Fn(yQ, [["__scopeId", "data-v-833c2d3f"]]);
function hp(n, t, e = null) {
  for (const r of n) {
    if (r.id === t)
      return e;
    if (r.children && r.children.length > 0) {
      const a = hp(r.children, t, r);
      if (a !== null) return a;
    }
  }
  return null;
}
function k5(n, t) {
  for (let e = 0; e < n.length; e++) {
    if (n[e].id === t)
      return n.splice(e, 1)[0];
    if (n[e].children && n[e].children.length > 0) {
      const r = k5(n[e].children, t);
      if (r) return r;
    }
  }
  return null;
}
function T5(n, t, e, r) {
  for (let a = 0; a < n.length; a++) {
    if (n[a].id === t)
      return r === "after" || n[a].type === "milestone-group" ? (e.parentId = n[a].parentId, n.splice(a + 1, 0, e)) : (e.parentId = t, n[a].children || (n[a].children = []), n[a].children.unshift(e)), !0;
    if (n[a].children && n[a].children.length > 0 && T5(n[a].children, t, e, r))
      return !0;
  }
  return !1;
}
function bQ(n, t, e, r) {
  const a = hp(n, t), A = k5(n, t);
  if (!A)
    return null;
  if (!T5(n, e, A, r))
    return a && a.children ? a.children.push(A) : n.push(A), null;
  const s = hp(n, t);
  return {
    movedTask: A,
    oldParent: a,
    newParent: s
  };
}
const Bo = 900 * 1e3;
function CQ(n, t, e) {
  const r = n.startDate ? new Date(n.startDate) : null, a = n.endDate ? new Date(n.endDate) : null, A = t.startDate ? new Date(t.startDate) : null, i = t.endDate ? new Date(t.endDate) : null;
  if (!r || !a || !A || !i)
    return !1;
  const s = r.getTime(), o = a.getTime(), l = A.getTime(), u = i.getTime();
  if (e === "hour") {
    const c = Math.floor(s / Bo) * Bo, p = Math.ceil(o / Bo) * Bo, w = Math.floor(l / Bo) * Bo, y = Math.ceil(u / Bo) * Bo;
    return p > w && y > c;
  }
  const f = hA(n.endDate, a).getTime() + 1440 * 60 * 1e3, h = hA(t.endDate, i).getTime() + 1440 * 60 * 1e3;
  return f > l && h > s;
}
function Jm(n, t = 51, e, r = !0) {
  const a = /* @__PURE__ */ new Map(), A = [];
  if (!n || n.length === 0)
    return { taskRowMap: a, rowHeights: A, totalHeight: t };
  const i = [...n].sort((u, f) => {
    const h = u.startDate ? new Date(u.startDate).getTime() : 0, c = f.startDate ? new Date(f.startDate).getTime() : 0;
    return h - c;
  });
  if (!r) {
    const u = t - 10;
    i.forEach((h, c) => {
      a.set(h.id, c);
      const p = c === 0 ? 5 + u + 5 : u + 5;
      A.push(p);
    });
    const f = A.reduce((h, c) => h + c, 0);
    return { taskRowMap: a, rowHeights: A, totalHeight: f };
  }
  const s = [];
  for (const u of i) {
    let f = -1;
    for (let h = 0; h < s.length; h++) {
      const c = s[h];
      let p = !1;
      for (const w of c)
        if (CQ(u, w, e)) {
          p = !0;
          break;
        }
      if (!p) {
        f = h, s[h].push(u);
        break;
      }
    }
    f === -1 && (f = s.length, s.push([u])), a.set(u.id, f);
  }
  const o = t - 10;
  for (let u = 0; u < s.length; u++) {
    const f = u === 0 ? 5 + o + 5 : o + 5;
    A.push(f);
  }
  const l = A.reduce((u, f) => u + f, 0);
  return { taskRowMap: a, rowHeights: A, totalHeight: l };
}
function In(n) {
  "@babel/helpers - typeof";
  return In = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, In(n);
}
var gi = Uint8Array, Ns = Uint16Array, w0 = Int32Array, y0 = new gi([
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  1,
  1,
  1,
  1,
  2,
  2,
  2,
  2,
  3,
  3,
  3,
  3,
  4,
  4,
  4,
  4,
  5,
  5,
  5,
  5,
  0,
  /* unused */
  0,
  0,
  /* impossible */
  0
]), B0 = new gi([
  0,
  0,
  0,
  0,
  1,
  1,
  2,
  2,
  3,
  3,
  4,
  4,
  5,
  5,
  6,
  6,
  7,
  7,
  8,
  8,
  9,
  9,
  10,
  10,
  11,
  11,
  12,
  12,
  13,
  13,
  /* unused */
  0,
  0
]), Zm = new gi([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), x5 = function(n, t) {
  for (var e = new Ns(31), r = 0; r < 31; ++r)
    e[r] = t += 1 << n[r - 1];
  for (var a = new w0(e[30]), r = 1; r < 30; ++r)
    for (var A = e[r]; A < e[r + 1]; ++A)
      a[A] = A - e[r] << 5 | r;
  return { b: e, r: a };
}, D5 = x5(y0, 2), kQ = D5.b, gp = D5.r;
kQ[28] = 258, gp[258] = 28;
var TQ = x5(B0, 0), e1 = TQ.r, vp = new Ns(32768);
for (var ua = 0; ua < 32768; ++ua) {
  var bo = (ua & 43690) >> 1 | (ua & 21845) << 1;
  bo = (bo & 52428) >> 2 | (bo & 13107) << 2, bo = (bo & 61680) >> 4 | (bo & 3855) << 4, vp[ua] = ((bo & 65280) >> 8 | (bo & 255) << 8) >> 1;
}
var _u = (function(n, t, e) {
  for (var r = n.length, a = 0, A = new Ns(t); a < r; ++a)
    n[a] && ++A[n[a] - 1];
  var i = new Ns(t);
  for (a = 1; a < t; ++a)
    i[a] = i[a - 1] + A[a - 1] << 1;
  var s;
  if (e) {
    s = new Ns(1 << t);
    var o = 15 - t;
    for (a = 0; a < r; ++a)
      if (n[a])
        for (var l = a << 4 | n[a], u = t - n[a], f = i[n[a] - 1]++ << u, h = f | (1 << u) - 1; f <= h; ++f)
          s[vp[f] >> o] = l;
  } else
    for (s = new Ns(r), a = 0; a < r; ++a)
      n[a] && (s[a] = vp[i[n[a] - 1]++] >> 15 - n[a]);
  return s;
}), ll = new gi(288);
for (var ua = 0; ua < 144; ++ua)
  ll[ua] = 8;
for (var ua = 144; ua < 256; ++ua)
  ll[ua] = 9;
for (var ua = 256; ua < 280; ++ua)
  ll[ua] = 7;
for (var ua = 280; ua < 288; ++ua)
  ll[ua] = 8;
var Fd = new gi(32);
for (var ua = 0; ua < 32; ++ua)
  Fd[ua] = 5;
var xQ = /* @__PURE__ */ _u(ll, 9, 0), DQ = /* @__PURE__ */ _u(Fd, 5, 0), E5 = function(n) {
  return (n + 7) / 8 | 0;
}, EQ = function(n, t, e) {
  return (e == null || e > n.length) && (e = n.length), new gi(n.subarray(t, e));
}, Gi = function(n, t, e) {
  e <<= t & 7;
  var r = t / 8 | 0;
  n[r] |= e, n[r + 1] |= e >> 8;
}, vu = function(n, t, e) {
  e <<= t & 7;
  var r = t / 8 | 0;
  n[r] |= e, n[r + 1] |= e >> 8, n[r + 2] |= e >> 16;
}, Lf = function(n, t) {
  for (var e = [], r = 0; r < n.length; ++r)
    n[r] && e.push({ s: r, f: n[r] });
  var a = e.length, A = e.slice();
  if (!a)
    return { t: F5, l: 0 };
  if (a == 1) {
    var i = new gi(e[0].s + 1);
    return i[e[0].s] = 1, { t: i, l: 1 };
  }
  e.sort(function(O, q) {
    return O.f - q.f;
  }), e.push({ s: -1, f: 25001 });
  var s = e[0], o = e[1], l = 0, u = 1, f = 2;
  for (e[0] = { s: -1, f: s.f + o.f, l: s, r: o }; u != a - 1; )
    s = e[e[l].f < e[f].f ? l++ : f++], o = e[l != u && e[l].f < e[f].f ? l++ : f++], e[u++] = { s: -1, f: s.f + o.f, l: s, r: o };
  for (var h = A[0].s, r = 1; r < a; ++r)
    A[r].s > h && (h = A[r].s);
  var c = new Ns(h + 1), p = pp(e[u - 1], c, 0);
  if (p > t) {
    var r = 0, w = 0, y = p - t, m = 1 << y;
    for (A.sort(function(q, G) {
      return c[G.s] - c[q.s] || q.f - G.f;
    }); r < a; ++r) {
      var k = A[r].s;
      if (c[k] > t)
        w += m - (1 << p - c[k]), c[k] = t;
      else
        break;
    }
    for (w >>= y; w > 0; ) {
      var D = A[r].s;
      c[D] < t ? w -= 1 << t - c[D]++ - 1 : ++r;
    }
    for (; r >= 0 && w; --r) {
      var B = A[r].s;
      c[B] == t && (--c[B], ++w);
    }
    p = t;
  }
  return { t: new gi(c), l: p };
}, pp = function(n, t, e) {
  return n.s == -1 ? Math.max(pp(n.l, t, e + 1), pp(n.r, t, e + 1)) : t[n.s] = e;
}, t1 = function(n) {
  for (var t = n.length; t && !n[--t]; )
    ;
  for (var e = new Ns(++t), r = 0, a = n[0], A = 1, i = function(o) {
    e[r++] = o;
  }, s = 1; s <= t; ++s)
    if (n[s] == a && s != t)
      ++A;
    else {
      if (!a && A > 2) {
        for (; A > 138; A -= 138)
          i(32754);
        A > 2 && (i(A > 10 ? A - 11 << 5 | 28690 : A - 3 << 5 | 12305), A = 0);
      } else if (A > 3) {
        for (i(a), --A; A > 6; A -= 6)
          i(8304);
        A > 2 && (i(A - 3 << 5 | 8208), A = 0);
      }
      for (; A--; )
        i(a);
      A = 1, a = n[s];
    }
  return { c: e.subarray(0, r), n: t };
}, pu = function(n, t) {
  for (var e = 0, r = 0; r < t.length; ++r)
    e += n[r] * t[r];
  return e;
}, S5 = function(n, t, e) {
  var r = e.length, a = E5(t + 2);
  n[a] = r & 255, n[a + 1] = r >> 8, n[a + 2] = n[a] ^ 255, n[a + 3] = n[a + 1] ^ 255;
  for (var A = 0; A < r; ++A)
    n[a + A + 4] = e[A];
  return (a + 4 + r) * 8;
}, r1 = function(n, t, e, r, a, A, i, s, o, l, u) {
  Gi(t, u++, e), ++a[256];
  for (var f = Lf(a, 15), h = f.t, c = f.l, p = Lf(A, 15), w = p.t, y = p.l, m = t1(h), k = m.c, D = m.n, B = t1(w), O = B.c, q = B.n, G = new Ns(19), W = 0; W < k.length; ++W)
    ++G[k[W] & 31];
  for (var W = 0; W < O.length; ++W)
    ++G[O[W] & 31];
  for (var F = Lf(G, 7), Y = F.t, T = F.l, E = 19; E > 4 && !Y[Zm[E - 1]]; --E)
    ;
  var Q = l + 5 << 3, x = pu(a, ll) + pu(A, Fd) + i, oe = pu(a, h) + pu(A, w) + i + 14 + 3 * E + pu(G, Y) + 2 * G[16] + 3 * G[17] + 7 * G[18];
  if (o >= 0 && Q <= x && Q <= oe)
    return S5(t, u, n.subarray(o, o + l));
  var J, S, I, N;
  if (Gi(t, u, 1 + (oe < x)), u += 2, oe < x) {
    J = _u(h, c, 0), S = h, I = _u(w, y, 0), N = w;
    var se = _u(Y, T, 0);
    Gi(t, u, D - 257), Gi(t, u + 5, q - 1), Gi(t, u + 10, E - 4), u += 14;
    for (var W = 0; W < E; ++W)
      Gi(t, u + 3 * W, Y[Zm[W]]);
    u += 3 * E;
    for (var Z = [k, O], C = 0; C < 2; ++C)
      for (var H = Z[C], W = 0; W < H.length; ++W) {
        var M = H[W] & 31;
        Gi(t, u, se[M]), u += Y[M], M > 15 && (Gi(t, u, H[W] >> 5 & 127), u += H[W] >> 12);
      }
  } else
    J = xQ, S = ll, I = DQ, N = Fd;
  for (var W = 0; W < s; ++W) {
    var te = r[W];
    if (te > 255) {
      var M = te >> 18 & 31;
      vu(t, u, J[M + 257]), u += S[M + 257], M > 7 && (Gi(t, u, te >> 23 & 31), u += y0[M]);
      var ie = te & 31;
      vu(t, u, I[ie]), u += N[ie], ie > 3 && (vu(t, u, te >> 5 & 8191), u += B0[ie]);
    } else
      vu(t, u, J[te]), u += S[te];
  }
  return vu(t, u, J[256]), u + S[256];
}, SQ = /* @__PURE__ */ new w0([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]), F5 = /* @__PURE__ */ new gi(0), FQ = function(n, t, e, r, a, A) {
  var i = A.z || n.length, s = new gi(r + i + 5 * (1 + Math.ceil(i / 7e3)) + a), o = s.subarray(r, s.length - a), l = A.l, u = (A.r || 0) & 7;
  if (t) {
    u && (o[0] = A.r >> 3);
    for (var f = SQ[t - 1], h = f >> 13, c = f & 8191, p = (1 << e) - 1, w = A.p || new Ns(32768), y = A.h || new Ns(p + 1), m = Math.ceil(e / 3), k = 2 * m, D = function(Qe) {
      return (n[Qe] ^ n[Qe + 1] << m ^ n[Qe + 2] << k) & p;
    }, B = new w0(25e3), O = new Ns(288), q = new Ns(32), G = 0, W = 0, F = A.i || 0, Y = 0, T = A.w || 0, E = 0; F + 2 < i; ++F) {
      var Q = D(F), x = F & 32767, oe = y[Q];
      if (w[x] = oe, y[Q] = x, T <= F) {
        var J = i - F;
        if ((G > 7e3 || Y > 24576) && (J > 423 || !l)) {
          u = r1(n, o, 0, B, O, q, W, Y, E, F - E, u), Y = G = W = 0, E = F;
          for (var S = 0; S < 286; ++S)
            O[S] = 0;
          for (var S = 0; S < 30; ++S)
            q[S] = 0;
        }
        var I = 2, N = 0, se = c, Z = x - oe & 32767;
        if (J > 2 && Q == D(F - Z))
          for (var C = Math.min(h, J) - 1, H = Math.min(32767, F), M = Math.min(258, J); Z <= H && --se && x != oe; ) {
            if (n[F + I] == n[F + I - Z]) {
              for (var te = 0; te < M && n[F + te] == n[F + te - Z]; ++te)
                ;
              if (te > I) {
                if (I = te, N = Z, te > C)
                  break;
                for (var ie = Math.min(Z, te - 2), we = 0, S = 0; S < ie; ++S) {
                  var ve = F - Z + S & 32767, le = w[ve], _e = ve - le & 32767;
                  _e > we && (we = _e, oe = ve);
                }
              }
            }
            x = oe, oe = w[x], Z += x - oe & 32767;
          }
        if (N) {
          B[Y++] = 268435456 | gp[I] << 18 | e1[N];
          var De = gp[I] & 31, ze = e1[N] & 31;
          W += y0[De] + B0[ze], ++O[257 + De], ++q[ze], T = F + I, ++G;
        } else
          B[Y++] = n[F], ++O[n[F]];
      }
    }
    for (F = Math.max(F, T); F < i; ++F)
      B[Y++] = n[F], ++O[n[F]];
    u = r1(n, o, l, B, O, q, W, Y, E, F - E, u), l || (A.r = u & 7 | o[u / 8 | 0] << 3, u -= 7, A.h = y, A.p = w, A.i = F, A.w = T);
  } else {
    for (var F = A.w || 0; F < i + l; F += 65535) {
      var nt = F + 65535;
      nt >= i && (o[u / 8 | 0] = l, nt = i), u = S5(o, u + 1, n.subarray(F, nt));
    }
    A.i = i;
  }
  return EQ(s, 0, r + E5(u) + a);
}, U5 = function() {
  var n = 1, t = 0;
  return {
    p: function(e) {
      for (var r = n, a = t, A = e.length | 0, i = 0; i != A; ) {
        for (var s = Math.min(i + 2655, A); i < s; ++i)
          a += r += e[i];
        r = (r & 65535) + 15 * (r >> 16), a = (a & 65535) + 15 * (a >> 16);
      }
      n = r, t = a;
    },
    d: function() {
      return n %= 65521, t %= 65521, (n & 255) << 24 | (n & 65280) << 8 | (t & 255) << 8 | t >> 8;
    }
  };
}, UQ = function(n, t, e, r, a) {
  if (!a && (a = { l: 1 }, t.dictionary)) {
    var A = t.dictionary.subarray(-32768), i = new gi(A.length + n.length);
    i.set(A), i.set(n, A.length), n = i, a.w = A.length;
  }
  return FQ(n, t.level == null ? 6 : t.level, t.mem == null ? a.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(n.length))) * 1.5) : 20 : 12 + t.mem, e, r, a);
}, L5 = function(n, t, e) {
  for (; e; ++t)
    n[t] = e, e >>>= 8;
}, LQ = function(n, t) {
  var e = t.level, r = e == 0 ? 0 : e < 6 ? 1 : e == 9 ? 3 : 2;
  if (n[0] = 120, n[1] = r << 6 | (t.dictionary && 32), n[1] |= 31 - (n[0] << 8 | n[1]) % 31, t.dictionary) {
    var a = U5();
    a.p(t.dictionary), L5(n, 2, a.d());
  }
};
function mp(n, t) {
  t || (t = {});
  var e = U5();
  e.p(n);
  var r = UQ(n, t, t.dictionary ? 6 : 2, 4);
  return LQ(r, t), L5(r, r.length - 4, e.d()), r;
}
var IQ = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), QQ = 0;
try {
  IQ.decode(F5, { stream: !0 }), QQ = 1;
} catch {
}
function MQ(n) {
  if (Array.isArray(n)) return n;
}
function _Q(n, t) {
  var e = n == null ? null : typeof Symbol < "u" && n[Symbol.iterator] || n["@@iterator"];
  if (e != null) {
    var r, a, A, i, s = [], o = !0, l = !1;
    try {
      if (A = (e = e.call(n)).next, t !== 0) for (; !(o = (r = A.call(e)).done) && (s.push(r.value), s.length !== t); o = !0) ;
    } catch (u) {
      l = !0, a = u;
    } finally {
      try {
        if (!o && e.return != null && (i = e.return(), Object(i) !== i)) return;
      } finally {
        if (l) throw a;
      }
    }
    return s;
  }
}
function n1(n, t) {
  (t == null || t > n.length) && (t = n.length);
  for (var e = 0, r = Array(t); e < t; e++) r[e] = n[e];
  return r;
}
function RQ(n, t) {
  if (n) {
    if (typeof n == "string") return n1(n, t);
    var e = {}.toString.call(n).slice(8, -1);
    return e === "Object" && n.constructor && (e = n.constructor.name), e === "Map" || e === "Set" ? Array.from(n) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? n1(n, t) : void 0;
  }
}
function NQ() {
  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 a1(n, t) {
  return MQ(n) || _Q(n, t) || RQ(n, t) || NQ();
}
function A1(n, t = "utf8") {
  return new TextDecoder(t).decode(n);
}
const HQ = new TextEncoder();
function OQ(n) {
  return HQ.encode(n);
}
const PQ = 1024 * 8, WQ = (() => {
  const n = new Uint8Array(4), t = new Uint32Array(n.buffer);
  return !((t[0] = 1) & n[0]);
})(), If = {
  int8: globalThis.Int8Array,
  uint8: globalThis.Uint8Array,
  int16: globalThis.Int16Array,
  uint16: globalThis.Uint16Array,
  int32: globalThis.Int32Array,
  uint32: globalThis.Uint32Array,
  uint64: globalThis.BigUint64Array,
  int64: globalThis.BigInt64Array,
  float32: globalThis.Float32Array,
  float64: globalThis.Float64Array
};
class b0 {
  /**
   * Create a new IOBuffer.
   * @param data - The data to construct the IOBuffer with.
   * If data is a number, it will be the new buffer's length<br>
   * If data is `undefined`, the buffer will be initialized with a default length of 8Kb<br>
   * If data is an ArrayBuffer, SharedArrayBuffer, an ArrayBufferView (Typed Array), an IOBuffer instance,
   * or a Node.js Buffer, a view will be created over the underlying ArrayBuffer.
   * @param options - An object for the options.
   * @returns A new IOBuffer instance.
   */
  constructor(t = PQ, e = {}) {
    /**
     * Reference to the internal ArrayBuffer object.
     */
    sn(this, "buffer");
    /**
     * Byte length of the internal ArrayBuffer.
     */
    sn(this, "byteLength");
    /**
     * Byte offset of the internal ArrayBuffer.
     */
    sn(this, "byteOffset");
    /**
     * Byte length of the internal ArrayBuffer.
     */
    sn(this, "length");
    /**
     * The current offset of the buffer's pointer.
     */
    sn(this, "offset");
    sn(this, "lastWrittenByte");
    sn(this, "littleEndian");
    sn(this, "_data");
    sn(this, "_mark");
    sn(this, "_marks");
    let r = !1;
    typeof t == "number" ? t = new ArrayBuffer(t) : (r = !0, this.lastWrittenByte = t.byteLength);
    const a = e.offset ? e.offset >>> 0 : 0, A = t.byteLength - a;
    let i = a;
    (ArrayBuffer.isView(t) || t instanceof b0) && (t.byteLength !== t.buffer.byteLength && (i = t.byteOffset + a), t = t.buffer), r ? this.lastWrittenByte = A : this.lastWrittenByte = 0, this.buffer = t, this.length = A, this.byteLength = A, this.byteOffset = i, this.offset = 0, this.littleEndian = !0, this._data = new DataView(this.buffer, i, A), this._mark = 0, this._marks = [];
  }
  /**
   * Checks if the memory allocated to the buffer is sufficient to store more
   * bytes after the offset.
   * @param byteLength - The needed memory in bytes.
   * @returns `true` if there is sufficient space and `false` otherwise.
   */
  available(t = 1) {
    return this.offset + t <= this.length;
  }
  /**
   * Check if little-endian mode is used for reading and writing multi-byte
   * values.
   * @returns `true` if little-endian mode is used, `false` otherwise.
   */
  isLittleEndian() {
    return this.littleEndian;
  }
  /**
   * Set little-endian mode for reading and writing multi-byte values.
   * @returns This.
   */
  setLittleEndian() {
    return this.littleEndian = !0, this;
  }
  /**
   * Check if big-endian mode is used for reading and writing multi-byte values.
   * @returns `true` if big-endian mode is used, `false` otherwise.
   */
  isBigEndian() {
    return !this.littleEndian;
  }
  /**
   * Switches to big-endian mode for reading and writing multi-byte values.
   * @returns This.
   */
  setBigEndian() {
    return this.littleEndian = !1, this;
  }
  /**
   * Move the pointer n bytes forward.
   * @param n - Number of bytes to skip.
   * @returns This.
   */
  skip(t = 1) {
    return this.offset += t, this;
  }
  /**
   * Move the pointer n bytes backward.
   * @param n - Number of bytes to move back.
   * @returns This.
   */
  back(t = 1) {
    return this.offset -= t, this;
  }
  /**
   * Move the pointer to the given offset.
   * @param offset - The offset to move to.
   * @returns This.
   */
  seek(t) {
    return this.offset = t, this;
  }
  /**
   * Store the current pointer offset.
   * @see {@link IOBuffer#reset}
   * @returns This.
   */
  mark() {
    return this._mark = this.offset, this;
  }
  /**
   * Move the pointer back to the last pointer offset set by mark.
   * @see {@link IOBuffer#mark}
   * @returns This.
   */
  reset() {
    return this.offset = this._mark, this;
  }
  /**
   * Push the current pointer offset to the mark stack.
   * @see {@link IOBuffer#popMark}
   * @returns This.
   */
  pushMark() {
    return this._marks.push(this.offset), this;
  }
  /**
   * Pop the last pointer offset from the mark stack, and set the current
   * pointer offset to the popped value.
   * @see {@link IOBuffer#pushMark}
   * @returns This.
   */
  popMark() {
    const t = this._marks.pop();
    if (t === void 0)
      throw new Error("Mark stack empty");
    return this.seek(t), this;
  }
  /**
   * Move the pointer offset back to 0.
   * @returns This.
   */
  rewind() {
    return this.offset = 0, this;
  }
  /**
   * Make sure the buffer has sufficient memory to write a given byteLength at
   * the current pointer offset.
   * If the buffer's memory is insufficient, this method will create a new
   * buffer (a copy) with a length that is twice (byteLength + current offset).
   * @param byteLength - The needed memory in bytes.
   * @returns This.
   */
  ensureAvailable(t = 1) {
    if (!this.available(t)) {
      const r = (this.offset + t) * 2, a = new Uint8Array(r);
      a.set(new Uint8Array(this.buffer)), this.buffer = a.buffer, this.length = r, this.byteLength = r, this._data = new DataView(this.buffer);
    }
    return this;
  }
  /**
   * Read a byte and return false if the byte's value is 0, or true otherwise.
   * Moves pointer forward by one byte.
   * @returns The read boolean.
   */
  readBoolean() {
    return this.readUint8() !== 0;
  }
  /**
   * Read a signed 8-bit integer and move pointer forward by 1 byte.
   * @returns The read byte.
   */
  readInt8() {
    return this._data.getInt8(this.offset++);
  }
  /**
   * Read an unsigned 8-bit integer and move pointer forward by 1 byte.
   * @returns The read byte.
   */
  readUint8() {
    return this._data.getUint8(this.offset++);
  }
  /**
   * Alias for {@link IOBuffer#readUint8}.
   * @returns The read byte.
   */
  readByte() {
    return this.readUint8();
  }
  /**
   * Read `n` bytes and move pointer forward by `n` bytes.
   * @param n - Number of bytes to read.
   * @returns The read bytes.
   */
  readBytes(t = 1) {
    return this.readArray(t, "uint8");
  }
  /**
   * Creates an array of corresponding to the type `type` and size `size`.
   * For example type `uint8` will create a `Uint8Array`.
   * @param size - size of the resulting array
   * @param type - number type of elements to read
   * @returns The read array.
   */
  readArray(t, e) {
    const r = If[e].BYTES_PER_ELEMENT * t, a = this.byteOffset + this.offset, A = this.buffer.slice(a, a + r);
    if (this.littleEndian === WQ && e !== "uint8" && e !== "int8") {
      const s = new Uint8Array(this.buffer.slice(a, a + r));
      s.reverse();
      const o = new If[e](s.buffer);
      return this.offset += r, o.reverse(), o;
    }
    const i = new If[e](A);
    return this.offset += r, i;
  }
  /**
   * Read a 16-bit signed integer and move pointer forward by 2 bytes.
   * @returns The read value.
   */
  readInt16() {
    const t = this._data.getInt16(this.offset, this.littleEndian);
    return this.offset += 2, t;
  }
  /**
   * Read a 16-bit unsigned integer and move pointer forward by 2 bytes.
   * @returns The read value.
   */
  readUint16() {
    const t = this._data.getUint16(this.offset, this.littleEndian);
    return this.offset += 2, t;
  }
  /**
   * Read a 32-bit signed integer and move pointer forward by 4 bytes.
   * @returns The read value.
   */
  readInt32() {
    const t = this._data.getInt32(this.offset, this.littleEndian);
    return this.offset += 4, t;
  }
  /**
   * Read a 32-bit unsigned integer and move pointer forward by 4 bytes.
   * @returns The read value.
   */
  readUint32() {
    const t = this._data.getUint32(this.offset, this.littleEndian);
    return this.offset += 4, t;
  }
  /**
   * Read a 32-bit floating number and move pointer forward by 4 bytes.
   * @returns The read value.
   */
  readFloat32() {
    const t = this._data.getFloat32(this.offset, this.littleEndian);
    return this.offset += 4, t;
  }
  /**
   * Read a 64-bit floating number and move pointer forward by 8 bytes.
   * @returns The read value.
   */
  readFloat64() {
    const t = this._data.getFloat64(this.offset, this.littleEndian);
    return this.offset += 8, t;
  }
  /**
   * Read a 64-bit signed integer number and move pointer forward by 8 bytes.
   * @returns The read value.
   */
  readBigInt64() {
    const t = this._data.getBigInt64(this.offset, this.littleEndian);
    return this.offset += 8, t;
  }
  /**
   * Read a 64-bit unsigned integer number and move pointer forward by 8 bytes.
   * @returns The read value.
   */
  readBigUint64() {
    const t = this._data.getBigUint64(this.offset, this.littleEndian);
    return this.offset += 8, t;
  }
  /**
   * Read a 1-byte ASCII character and move pointer forward by 1 byte.
   * @returns The read character.
   */
  readChar() {
    return String.fromCharCode(this.readInt8());
  }
  /**
   * Read `n` 1-byte ASCII characters and move pointer forward by `n` bytes.
   * @param n - Number of characters to read.
   * @returns The read characters.
   */
  readChars(t = 1) {
    let e = "";
    for (let r = 0; r < t; r++)
      e += this.readChar();
    return e;
  }
  /**
   * Read the next `n` bytes, return a UTF-8 decoded string and move pointer
   * forward by `n` bytes.
   * @param n - Number of bytes to read.
   * @returns The decoded string.
   */
  readUtf8(t = 1) {
    return A1(this.readBytes(t));
  }
  /**
   * Read the next `n` bytes, return a string decoded with `encoding` and move pointer
   * forward by `n` bytes.
   * If no encoding is passed, the function is equivalent to @see {@link IOBuffer#readUtf8}
   * @param n - Number of bytes to read.
   * @param encoding - The encoding to use. Default is 'utf8'.
   * @returns The decoded string.
   */
  decodeText(t = 1, e = "utf8") {
    return A1(this.readBytes(t), e);
  }
  /**
   * Write 0xff if the passed value is truthy, 0x00 otherwise and move pointer
   * forward by 1 byte.
   * @param value - The value to write.
   * @returns This.
   */
  writeBoolean(t) {
    return this.writeUint8(t ? 255 : 0), this;
  }
  /**
   * Write `value` as an 8-bit signed integer and move pointer forward by 1 byte.
   * @param value - The value to write.
   * @returns This.
   */
  writeInt8(t) {
    return this.ensureAvailable(1), this._data.setInt8(this.offset++, t), this._updateLastWrittenByte(), this;
  }
  /**
   * Write `value` as an 8-bit unsigned integer and move pointer forward by 1
   * byte.
   * @param value - The value to write.
   * @returns This.
   */
  writeUint8(t) {
    return this.ensureAvailable(1), this._data.setUint8(this.offset++, t), this._updateLastWrittenByte(), this;
  }
  /**
   * An alias for {@link IOBuffer#writeUint8}.
   * @param value - The value to write.
   * @returns This.
   */
  writeByte(t) {
    return this.writeUint8(t);
  }
  /**
   * Write all elements of `bytes` as uint8 values and move pointer forward by
   * `bytes.length` bytes.
   * @param bytes - The array of bytes to write.
   * @returns This.
   */
  writeBytes(t) {
    this.ensureAvailable(t.length);
    for (let e = 0; e < t.length; e++)
      this._data.setUint8(this.offset++, t[e]);
    return this._updateLastWrittenByte(), this;
  }
  /**
   * Write `value` as a 16-bit signed integer and move pointer forward by 2
   * bytes.
   * @param value - The value to write.
   * @returns This.
   */
  writeInt16(t) {
    return this.ensureAvailable(2), this._data.setInt16(this.offset, t, this.littleEndian), this.offset += 2, this._updateLastWrittenByte(), this;
  }
  /**
   * Write `value` as a 16-bit unsigned integer and move pointer forward by 2
   * bytes.
   * @param value - The value to write.
   * @returns This.
   */
  writeUint16(t) {
    return this.ensureAvailable(2), this._data.setUint16(this.offset, t, this.littleEndian), this.offset += 2, this._updateLastWrittenByte(), this;
  }
  /**
   * Write `value` as a 32-bit signed integer and move pointer forward by 4
   * bytes.
   * @param value - The value to write.
   * @returns This.
   */
  writeInt32(t) {
    return this.ensureAvailable(4), this._data.setInt32(this.offset, t, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this;
  }
  /**
   * Write `value` as a 32-bit unsigned integer and move pointer forward by 4
   * bytes.
   * @param value - The value to write.
   * @returns This.
   */
  writeUint32(t) {
    return this.ensureAvailable(4), this._data.setUint32(this.offset, t, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this;
  }
  /**
   * Write `value` as a 32-bit floating number and move pointer forward by 4
   * bytes.
   * @param value - The value to write.
   * @returns This.
   */
  writeFloat32(t) {
    return this.ensureAvailable(4), this._data.setFloat32(this.offset, t, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this;
  }
  /**
   * Write `value` as a 64-bit floating number and move pointer forward by 8
   * bytes.
   * @param value - The value to write.
   * @returns This.
   */
  writeFloat64(t) {
    return this.ensureAvailable(8), this._data.setFloat64(this.offset, t, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this;
  }
  /**
   * Write `value` as a 64-bit signed bigint and move pointer forward by 8
   * bytes.
   * @param value - The value to write.
   * @returns This.
   */
  writeBigInt64(t) {
    return this.ensureAvailable(8), this._data.setBigInt64(this.offset, t, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this;
  }
  /**
   * Write `value` as a 64-bit unsigned bigint and move pointer forward by 8
   * bytes.
   * @param value - The value to write.
   * @returns This.
   */
  writeBigUint64(t) {
    return this.ensureAvailable(8), this._data.setBigUint64(this.offset, t, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this;
  }
  /**
   * Write the charCode of `str`'s first character as an 8-bit unsigned integer
   * and move pointer forward by 1 byte.
   * @param str - The character to write.
   * @returns This.
   */
  writeChar(t) {
    return this.writeUint8(t.charCodeAt(0));
  }
  /**
   * Write the charCodes of all `str`'s characters as 8-bit unsigned integers
   * and move pointer forward by `str.length` bytes.
   * @param str - The characters to write.
   * @returns This.
   */
  writeChars(t) {
    for (let e = 0; e < t.length; e++)
      this.writeUint8(t.charCodeAt(e));
    return this;
  }
  /**
   * UTF-8 encode and write `str` to the current pointer offset and move pointer
   * forward according to the encoded length.
   * @param str - The string to write.
   * @returns This.
   */
  writeUtf8(t) {
    return this.writeBytes(OQ(t));
  }
  /**
   * Export a Uint8Array view of the internal buffer.
   * The view starts at the byte offset and its length
   * is calculated to stop at the last written byte or the original length.
   * @returns A new Uint8Array view.
   */
  toArray() {
    return new Uint8Array(this.buffer, this.byteOffset, this.lastWrittenByte);
  }
  /**
   *  Get the total number of bytes written so far, regardless of the current offset.
   * @returns - Total number of bytes.
   */
  getWrittenByteLength() {
    return this.lastWrittenByte - this.byteOffset;
  }
  /**
   * Update the last written byte offset
   * @private
   */
  _updateLastWrittenByte() {
    this.offset > this.lastWrittenByte && (this.lastWrittenByte = this.offset);
  }
}
function Zl(n) {
  let t = n.length;
  for (; --t >= 0; )
    n[t] = 0;
}
const KQ = 3, $Q = 258, I5 = 29, VQ = 256, qQ = VQ + 1 + I5, Q5 = 30, jQ = 512, YQ = new Array((qQ + 2) * 2);
Zl(YQ);
const GQ = new Array(Q5 * 2);
Zl(GQ);
const zQ = new Array(jQ);
Zl(zQ);
const XQ = new Array($Q - KQ + 1);
Zl(XQ);
const JQ = new Array(I5);
Zl(JQ);
const ZQ = new Array(Q5);
Zl(ZQ);
const eM = (n, t, e, r) => {
  let a = n & 65535 | 0, A = n >>> 16 & 65535 | 0, i = 0;
  for (; e !== 0; ) {
    i = e > 2e3 ? 2e3 : e, e -= i;
    do
      a = a + t[r++] | 0, A = A + a | 0;
    while (--i);
    a %= 65521, A %= 65521;
  }
  return a | A << 16 | 0;
};
var wp = eM;
const tM = () => {
  let n, t = [];
  for (var e = 0; e < 256; e++) {
    n = e;
    for (var r = 0; r < 8; r++)
      n = n & 1 ? 3988292384 ^ n >>> 1 : n >>> 1;
    t[e] = n;
  }
  return t;
}, rM = new Uint32Array(tM()), nM = (n, t, e, r) => {
  const a = rM, A = r + e;
  n ^= -1;
  for (let i = r; i < A; i++)
    n = n >>> 8 ^ a[(n ^ t[i]) & 255];
  return n ^ -1;
};
var Fi = nM, yp = {
  2: "need dictionary",
  /* Z_NEED_DICT       2  */
  1: "stream end",
  /* Z_STREAM_END      1  */
  0: "",
  /* Z_OK              0  */
  "-1": "file error",
  /* Z_ERRNO         (-1) */
  "-2": "stream error",
  /* Z_STREAM_ERROR  (-2) */
  "-3": "data error",
  /* Z_DATA_ERROR    (-3) */
  "-4": "insufficient memory",
  /* Z_MEM_ERROR     (-4) */
  "-5": "buffer error",
  /* Z_BUF_ERROR     (-5) */
  "-6": "incompatible version"
  /* Z_VERSION_ERROR (-6) */
}, M5 = {
  /* Allowed flush values; see deflate() and inflate() below for details */
  Z_NO_FLUSH: 0,
  Z_FINISH: 4,
  Z_BLOCK: 5,
  Z_TREES: 6,
  /* Return codes for the compression/decompression functions. Negative values
  * are errors, positive values are used for special but normal events.
  */
  Z_OK: 0,
  Z_STREAM_END: 1,
  Z_NEED_DICT: 2,
  Z_STREAM_ERROR: -2,
  Z_DATA_ERROR: -3,
  Z_MEM_ERROR: -4,
  Z_BUF_ERROR: -5,
  /* The deflate compression method */
  Z_DEFLATED: 8
  //Z_NULL:                 null // Use -1 or null inline, depending on var type
};
const aM = (n, t) => Object.prototype.hasOwnProperty.call(n, t);
var AM = function(n) {
  const t = Array.prototype.slice.call(arguments, 1);
  for (; t.length; ) {
    const e = t.shift();
    if (e) {
      if (typeof e != "object")
        throw new TypeError(e + "must be non-object");
      for (const r in e)
        aM(e, r) && (n[r] = e[r]);
    }
  }
  return n;
}, sM = (n) => {
  let t = 0;
  for (let r = 0, a = n.length; r < a; r++)
    t += n[r].length;
  const e = new Uint8Array(t);
  for (let r = 0, a = 0, A = n.length; r < A; r++) {
    let i = n[r];
    e.set(i, a), a += i.length;
  }
  return e;
}, _5 = {
  assign: AM,
  flattenChunks: sM
};
let R5 = !0;
try {
  String.fromCharCode.apply(null, new Uint8Array(1));
} catch {
  R5 = !1;
}
const Vu = new Uint8Array(256);
for (let n = 0; n < 256; n++)
  Vu[n] = n >= 252 ? 6 : n >= 248 ? 5 : n >= 240 ? 4 : n >= 224 ? 3 : n >= 192 ? 2 : 1;
Vu[254] = Vu[254] = 1;
var iM = (n) => {
  if (typeof TextEncoder == "function" && TextEncoder.prototype.encode)
    return new TextEncoder().encode(n);
  let t, e, r, a, A, i = n.length, s = 0;
  for (a = 0; a < i; a++)
    e = n.charCodeAt(a), (e & 64512) === 55296 && a + 1 < i && (r = n.charCodeAt(a + 1), (r & 64512) === 56320 && (e = 65536 + (e - 55296 << 10) + (r - 56320), a++)), s += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4;
  for (t = new Uint8Array(s), A = 0, a = 0; A < s; a++)
    e = n.charCodeAt(a), (e & 64512) === 55296 && a + 1 < i && (r = n.charCodeAt(a + 1), (r & 64512) === 56320 && (e = 65536 + (e - 55296 << 10) + (r - 56320), a++)), e < 128 ? t[A++] = e : e < 2048 ? (t[A++] = 192 | e >>> 6, t[A++] = 128 | e & 63) : e < 65536 ? (t[A++] = 224 | e >>> 12, t[A++] = 128 | e >>> 6 & 63, t[A++] = 128 | e & 63) : (t[A++] = 240 | e >>> 18, t[A++] = 128 | e >>> 12 & 63, t[A++] = 128 | e >>> 6 & 63, t[A++] = 128 | e & 63);
  return t;
};
const oM = (n, t) => {
  if (t < 65534 && n.subarray && R5)
    return String.fromCharCode.apply(null, n.length === t ? n : n.subarray(0, t));
  let e = "";
  for (let r = 0; r < t; r++)
    e += String.fromCharCode(n[r]);
  return e;
};
var lM = (n, t) => {
  const e = t || n.length;
  if (typeof TextDecoder == "function" && TextDecoder.prototype.decode)
    return new TextDecoder().decode(n.subarray(0, t));
  let r, a;
  const A = new Array(e * 2);
  for (a = 0, r = 0; r < e; ) {
    let i = n[r++];
    if (i < 128) {
      A[a++] = i;
      continue;
    }
    let s = Vu[i];
    if (s > 4) {
      A[a++] = 65533, r += s - 1;
      continue;
    }
    for (i &= s === 2 ? 31 : s === 3 ? 15 : 7; s > 1 && r < e; )
      i = i << 6 | n[r++] & 63, s--;
    if (s > 1) {
      A[a++] = 65533;
      continue;
    }
    i < 65536 ? A[a++] = i : (i -= 65536, A[a++] = 55296 | i >> 10 & 1023, A[a++] = 56320 | i & 1023);
  }
  return oM(A, a);
}, uM = (n, t) => {
  t = t || n.length, t > n.length && (t = n.length);
  let e = t - 1;
  for (; e >= 0 && (n[e] & 192) === 128; )
    e--;
  return e < 0 || e === 0 ? t : e + Vu[n[e]] > t ? e : t;
}, Bp = {
  string2buf: iM,
  buf2string: lM,
  utf8border: uM
};
function cM() {
  this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0;
}
var dM = cM;
const Lc = 16209, fM = 16191;
var hM = function(t, e) {
  let r, a, A, i, s, o, l, u, f, h, c, p, w, y, m, k, D, B, O, q, G, W, F, Y;
  const T = t.state;
  r = t.next_in, F = t.input, a = r + (t.avail_in - 5), A = t.next_out, Y = t.output, i = A - (e - t.avail_out), s = A + (t.avail_out - 257), o = T.dmax, l = T.wsize, u = T.whave, f = T.wnext, h = T.window, c = T.hold, p = T.bits, w = T.lencode, y = T.distcode, m = (1 << T.lenbits) - 1, k = (1 << T.distbits) - 1;
  e:
    do {
      p < 15 && (c += F[r++] << p, p += 8, c += F[r++] << p, p += 8), D = w[c & m];
      t:
        for (; ; ) {
          if (B = D >>> 24, c >>>= B, p -= B, B = D >>> 16 & 255, B === 0)
            Y[A++] = D & 65535;
          else if (B & 16) {
            O = D & 65535, B &= 15, B && (p < B && (c += F[r++] << p, p += 8), O += c & (1 << B) - 1, c >>>= B, p -= B), p < 15 && (c += F[r++] << p, p += 8, c += F[r++] << p, p += 8), D = y[c & k];
            r:
              for (; ; ) {
                if (B = D >>> 24, c >>>= B, p -= B, B = D >>> 16 & 255, B & 16) {
                  if (q = D & 65535, B &= 15, p < B && (c += F[r++] << p, p += 8, p < B && (c += F[r++] << p, p += 8)), q += c & (1 << B) - 1, q > o) {
                    t.msg = "invalid distance too far back", T.mode = Lc;
                    break e;
                  }
                  if (c >>>= B, p -= B, B = A - i, q > B) {
                    if (B = q - B, B > u && T.sane) {
                      t.msg = "invalid distance too far back", T.mode = Lc;
                      break e;
                    }
                    if (G = 0, W = h, f === 0) {
                      if (G += l - B, B < O) {
                        O -= B;
                        do
                          Y[A++] = h[G++];
                        while (--B);
                        G = A - q, W = Y;
                      }
                    } else if (f < B) {
                      if (G += l + f - B, B -= f, B < O) {
                        O -= B;
                        do
                          Y[A++] = h[G++];
                        while (--B);
                        if (G = 0, f < O) {
                          B = f, O -= B;
                          do
                            Y[A++] = h[G++];
                          while (--B);
                          G = A - q, W = Y;
                        }
                      }
                    } else if (G += f - B, B < O) {
                      O -= B;
                      do
                        Y[A++] = h[G++];
                      while (--B);
                      G = A - q, W = Y;
                    }
                    for (; O > 2; )
                      Y[A++] = W[G++], Y[A++] = W[G++], Y[A++] = W[G++], O -= 3;
                    O && (Y[A++] = W[G++], O > 1 && (Y[A++] = W[G++]));
                  } else {
                    G = A - q;
                    do
                      Y[A++] = Y[G++], Y[A++] = Y[G++], Y[A++] = Y[G++], O -= 3;
                    while (O > 2);
                    O && (Y[A++] = Y[G++], O > 1 && (Y[A++] = Y[G++]));
                  }
                } else if ((B & 64) === 0) {
                  D = y[(D & 65535) + (c & (1 << B) - 1)];
                  continue r;
                } else {
                  t.msg = "invalid distance code", T.mode = Lc;
                  break e;
                }
                break;
              }
          } else if ((B & 64) === 0) {
            D = w[(D & 65535) + (c & (1 << B) - 1)];
            continue t;
          } else if (B & 32) {
            T.mode = fM;
            break e;
          } else {
            t.msg = "invalid literal/length code", T.mode = Lc;
            break e;
          }
          break;
        }
    } while (r < a && A < s);
  O = p >> 3, r -= O, p -= O << 3, c &= (1 << p) - 1, t.next_in = r, t.next_out = A, t.avail_in = r < a ? 5 + (a - r) : 5 - (r - a), t.avail_out = A < s ? 257 + (s - A) : 257 - (A - s), T.hold = c, T.bits = p;
};
const bl = 15, s1 = 852, i1 = 592, o1 = 0, Qf = 1, l1 = 2, gM = new Uint16Array([
  /* Length codes 257..285 base */
  3,
  4,
  5,
  6,
  7,
  8,
  9,
  10,
  11,
  13,
  15,
  17,
  19,
  23,
  27,
  31,
  35,
  43,
  51,
  59,
  67,
  83,
  99,
  115,
  131,
  163,
  195,
  227,
  258,
  0,
  0
]), vM = new Uint8Array([
  /* Length codes 257..285 extra */
  16,
  16,
  16,
  16,
  16,
  16,
  16,
  16,
  17,
  17,
  17,
  17,
  18,
  18,
  18,
  18,
  19,
  19,
  19,
  19,
  20,
  20,
  20,
  20,
  21,
  21,
  21,
  21,
  16,
  72,
  78
]), pM = new Uint16Array([
  /* Distance codes 0..29 base */
  1,
  2,
  3,
  4,
  5,
  7,
  9,
  13,
  17,
  25,
  33,
  49,
  65,
  97,
  129,
  193,
  257,
  385,
  513,
  769,
  1025,
  1537,
  2049,
  3073,
  4097,
  6145,
  8193,
  12289,
  16385,
  24577,
  0,
  0
]), mM = new Uint8Array([
  /* Distance codes 0..29 extra */
  16,
  16,
  16,
  16,
  17,
  17,
  18,
  18,
  19,
  19,
  20,
  20,
  21,
  21,
  22,
  22,
  23,
  23,
  24,
  24,
  25,
  25,
  26,
  26,
  27,
  27,
  28,
  28,
  29,
  29,
  64,
  64
]), wM = (n, t, e, r, a, A, i, s) => {
  const o = s.bits;
  let l = 0, u = 0, f = 0, h = 0, c = 0, p = 0, w = 0, y = 0, m = 0, k = 0, D, B, O, q, G, W = null, F;
  const Y = new Uint16Array(bl + 1), T = new Uint16Array(bl + 1);
  let E = null, Q, x, oe;
  for (l = 0; l <= bl; l++)
    Y[l] = 0;
  for (u = 0; u < r; u++)
    Y[t[e + u]]++;
  for (c = o, h = bl; h >= 1 && Y[h] === 0; h--)
    ;
  if (c > h && (c = h), h === 0)
    return a[A++] = 1 << 24 | 64 << 16 | 0, a[A++] = 1 << 24 | 64 << 16 | 0, s.bits = 1, 0;
  for (f = 1; f < h && Y[f] === 0; f++)
    ;
  for (c < f && (c = f), y = 1, l = 1; l <= bl; l++)
    if (y <<= 1, y -= Y[l], y < 0)
      return -1;
  if (y > 0 && (n === o1 || h !== 1))
    return -1;
  for (T[1] = 0, l = 1; l < bl; l++)
    T[l + 1] = T[l] + Y[l];
  for (u = 0; u < r; u++)
    t[e + u] !== 0 && (i[T[t[e + u]]++] = u);
  if (n === o1 ? (W = E = i, F = 20) : n === Qf ? (W = gM, E = vM, F = 257) : (W = pM, E = mM, F = 0), k = 0, u = 0, l = f, G = A, p = c, w = 0, O = -1, m = 1 << c, q = m - 1, n === Qf && m > s1 || n === l1 && m > i1)
    return 1;
  for (; ; ) {
    Q = l - w, i[u] + 1 < F ? (x = 0, oe = i[u]) : i[u] >= F ? (x = E[i[u] - F], oe = W[i[u] - F]) : (x = 96, oe = 0), D = 1 << l - w, B = 1 << p, f = B;
    do
      B -= D, a[G + (k >> w) + B] = Q << 24 | x << 16 | oe | 0;
    while (B !== 0);
    for (D = 1 << l - 1; k & D; )
      D >>= 1;
    if (D !== 0 ? (k &= D - 1, k += D) : k = 0, u++, --Y[l] === 0) {
      if (l === h)
        break;
      l = t[e + i[u]];
    }
    if (l > c && (k & q) !== O) {
      for (w === 0 && (w = c), G += f, p = l - w, y = 1 << p; p + w < h && (y -= Y[p + w], !(y <= 0)); )
        p++, y <<= 1;
      if (m += 1 << p, n === Qf && m > s1 || n === l1 && m > i1)
        return 1;
      O = k & q, a[O] = c << 24 | p << 16 | G - A | 0;
    }
  }
  return k !== 0 && (a[G + k] = l - w << 24 | 64 << 16 | 0), s.bits = c, 0;
};
var Ru = wM;
const yM = 0, N5 = 1, H5 = 2, {
  Z_FINISH: u1,
  Z_BLOCK: BM,
  Z_TREES: Ic,
  Z_OK: ul,
  Z_STREAM_END: bM,
  Z_NEED_DICT: CM,
  Z_STREAM_ERROR: Gs,
  Z_DATA_ERROR: O5,
  Z_MEM_ERROR: P5,
  Z_BUF_ERROR: kM,
  Z_DEFLATED: c1
} = M5, Vd = 16180, d1 = 16181, f1 = 16182, h1 = 16183, g1 = 16184, v1 = 16185, p1 = 16186, m1 = 16187, w1 = 16188, y1 = 16189, Ud = 16190, zi = 16191, Mf = 16192, B1 = 16193, _f = 16194, b1 = 16195, C1 = 16196, k1 = 16197, T1 = 16198, Qc = 16199, Mc = 16200, x1 = 16201, D1 = 16202, E1 = 16203, S1 = 16204, F1 = 16205, Rf = 16206, U1 = 16207, L1 = 16208, fa = 16209, W5 = 16210, K5 = 16211, TM = 852, xM = 592, DM = 15, EM = DM, I1 = (n) => (n >>> 24 & 255) + (n >>> 8 & 65280) + ((n & 65280) << 8) + ((n & 255) << 24);
function SM() {
  this.strm = null, this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new Uint16Array(320), this.work = new Uint16Array(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;
}
const dl = (n) => {
  if (!n)
    return 1;
  const t = n.state;
  return !t || t.strm !== n || t.mode < Vd || t.mode > K5 ? 1 : 0;
}, $5 = (n) => {
  if (dl(n))
    return Gs;
  const t = n.state;
  return n.total_in = n.total_out = t.total = 0, n.msg = "", t.wrap && (n.adler = t.wrap & 1), t.mode = Vd, t.last = 0, t.havedict = 0, t.flags = -1, t.dmax = 32768, t.head = null, t.hold = 0, t.bits = 0, t.lencode = t.lendyn = new Int32Array(TM), t.distcode = t.distdyn = new Int32Array(xM), t.sane = 1, t.back = -1, ul;
}, V5 = (n) => {
  if (dl(n))
    return Gs;
  const t = n.state;
  return t.wsize = 0, t.whave = 0, t.wnext = 0, $5(n);
}, q5 = (n, t) => {
  let e;
  if (dl(n))
    return Gs;
  const r = n.state;
  return t < 0 ? (e = 0, t = -t) : (e = (t >> 4) + 5, t < 48 && (t &= 15)), t && (t < 8 || t > 15) ? Gs : (r.window !== null && r.wbits !== t && (r.window = null), r.wrap = e, r.wbits = t, V5(n));
}, j5 = (n, t) => {
  if (!n)
    return Gs;
  const e = new SM();
  n.state = e, e.strm = n, e.window = null, e.mode = Vd;
  const r = q5(n, t);
  return r !== ul && (n.state = null), r;
}, FM = (n) => j5(n, EM);
let Q1 = !0, Nf, Hf;
const UM = (n) => {
  if (Q1) {
    Nf = new Int32Array(512), Hf = new Int32Array(32);
    let t = 0;
    for (; t < 144; )
      n.lens[t++] = 8;
    for (; t < 256; )
      n.lens[t++] = 9;
    for (; t < 280; )
      n.lens[t++] = 7;
    for (; t < 288; )
      n.lens[t++] = 8;
    for (Ru(N5, n.lens, 0, 288, Nf, 0, n.work, { bits: 9 }), t = 0; t < 32; )
      n.lens[t++] = 5;
    Ru(H5, n.lens, 0, 32, Hf, 0, n.work, { bits: 5 }), Q1 = !1;
  }
  n.lencode = Nf, n.lenbits = 9, n.distcode = Hf, n.distbits = 5;
}, Y5 = (n, t, e, r) => {
  let a;
  const A = n.state;
  return A.window === null && (A.wsize = 1 << A.wbits, A.wnext = 0, A.whave = 0, A.window = new Uint8Array(A.wsize)), r >= A.wsize ? (A.window.set(t.subarray(e - A.wsize, e), 0), A.wnext = 0, A.whave = A.wsize) : (a = A.wsize - A.wnext, a > r && (a = r), A.window.set(t.subarray(e - r, e - r + a), A.wnext), r -= a, r ? (A.window.set(t.subarray(e - r, e), 0), A.wnext = r, A.whave = A.wsize) : (A.wnext += a, A.wnext === A.wsize && (A.wnext = 0), A.whave < A.wsize && (A.whave += a))), 0;
}, LM = (n, t) => {
  let e, r, a, A, i, s, o, l, u, f, h, c, p, w, y = 0, m, k, D, B, O, q, G, W;
  const F = new Uint8Array(4);
  let Y, T;
  const E = (
    /* permutation of code lengths */
    new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15])
  );
  if (dl(n) || !n.output || !n.input && n.avail_in !== 0)
    return Gs;
  e = n.state, e.mode === zi && (e.mode = Mf), i = n.next_out, a = n.output, o = n.avail_out, A = n.next_in, r = n.input, s = n.avail_in, l = e.hold, u = e.bits, f = s, h = o, W = ul;
  e:
    for (; ; )
      switch (e.mode) {
        case Vd:
          if (e.wrap === 0) {
            e.mode = Mf;
            break;
          }
          for (; u < 16; ) {
            if (s === 0)
              break e;
            s--, l += r[A++] << u, u += 8;
          }
          if (e.wrap & 2 && l === 35615) {
            e.wbits === 0 && (e.wbits = 15), e.check = 0, F[0] = l & 255, F[1] = l >>> 8 & 255, e.check = Fi(e.check, F, 2, 0), l = 0, u = 0, e.mode = d1;
            break;
          }
          if (e.head && (e.head.done = !1), !(e.wrap & 1) || /* check if zlib header allowed */
          (((l & 255) << 8) + (l >> 8)) % 31) {
            n.msg = "incorrect header check", e.mode = fa;
            break;
          }
          if ((l & 15) !== c1) {
            n.msg = "unknown compression method", e.mode = fa;
            break;
          }
          if (l >>>= 4, u -= 4, G = (l & 15) + 8, e.wbits === 0 && (e.wbits = G), G > 15 || G > e.wbits) {
            n.msg = "invalid window size", e.mode = fa;
            break;
          }
          e.dmax = 1 << e.wbits, e.flags = 0, n.adler = e.check = 1, e.mode = l & 512 ? y1 : zi, l = 0, u = 0;
          break;
        case d1:
          for (; u < 16; ) {
            if (s === 0)
              break e;
            s--, l += r[A++] << u, u += 8;
          }
          if (e.flags = l, (e.flags & 255) !== c1) {
            n.msg = "unknown compression method", e.mode = fa;
            break;
          }
          if (e.flags & 57344) {
            n.msg = "unknown header flags set", e.mode = fa;
            break;
          }
          e.head && (e.head.text = l >> 8 & 1), e.flags & 512 && e.wrap & 4 && (F[0] = l & 255, F[1] = l >>> 8 & 255, e.check = Fi(e.check, F, 2, 0)), l = 0, u = 0, e.mode = f1;
        /* falls through */
        case f1:
          for (; u < 32; ) {
            if (s === 0)
              break e;
            s--, l += r[A++] << u, u += 8;
          }
          e.head && (e.head.time = l), e.flags & 512 && e.wrap & 4 && (F[0] = l & 255, F[1] = l >>> 8 & 255, F[2] = l >>> 16 & 255, F[3] = l >>> 24 & 255, e.check = Fi(e.check, F, 4, 0)), l = 0, u = 0, e.mode = h1;
        /* falls through */
        case h1:
          for (; u < 16; ) {
            if (s === 0)
              break e;
            s--, l += r[A++] << u, u += 8;
          }
          e.head && (e.head.xflags = l & 255, e.head.os = l >> 8), e.flags & 512 && e.wrap & 4 && (F[0] = l & 255, F[1] = l >>> 8 & 255, e.check = Fi(e.check, F, 2, 0)), l = 0, u = 0, e.mode = g1;
        /* falls through */
        case g1:
          if (e.flags & 1024) {
            for (; u < 16; ) {
              if (s === 0)
                break e;
              s--, l += r[A++] << u, u += 8;
            }
            e.length = l, e.head && (e.head.extra_len = l), e.flags & 512 && e.wrap & 4 && (F[0] = l & 255, F[1] = l >>> 8 & 255, e.check = Fi(e.check, F, 2, 0)), l = 0, u = 0;
          } else e.head && (e.head.extra = null);
          e.mode = v1;
        /* falls through */
        case v1:
          if (e.flags & 1024 && (c = e.length, c > s && (c = s), c && (e.head && (G = e.head.extra_len - e.length, e.head.extra || (e.head.extra = new Uint8Array(e.head.extra_len)), e.head.extra.set(
            r.subarray(
              A,
              // extra field is limited to 65536 bytes
              // - no need for additional size check
              A + c
            ),
            /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
            G
          )), e.flags & 512 && e.wrap & 4 && (e.check = Fi(e.check, r, c, A)), s -= c, A += c, e.length -= c), e.length))
            break e;
          e.length = 0, e.mode = p1;
        /* falls through */
        case p1:
          if (e.flags & 2048) {
            if (s === 0)
              break e;
            c = 0;
            do
              G = r[A + c++], e.head && G && e.length < 65536 && (e.head.name += String.fromCharCode(G));
            while (G && c < s);
            if (e.flags & 512 && e.wrap & 4 && (e.check = Fi(e.check, r, c, A)), s -= c, A += c, G)
              break e;
          } else e.head && (e.head.name = null);
          e.length = 0, e.mode = m1;
        /* falls through */
        case m1:
          if (e.flags & 4096) {
            if (s === 0)
              break e;
            c = 0;
            do
              G = r[A + c++], e.head && G && e.length < 65536 && (e.head.comment += String.fromCharCode(G));
            while (G && c < s);
            if (e.flags & 512 && e.wrap & 4 && (e.check = Fi(e.check, r, c, A)), s -= c, A += c, G)
              break e;
          } else e.head && (e.head.comment = null);
          e.mode = w1;
        /* falls through */
        case w1:
          if (e.flags & 512) {
            for (; u < 16; ) {
              if (s === 0)
                break e;
              s--, l += r[A++] << u, u += 8;
            }
            if (e.wrap & 4 && l !== (e.check & 65535)) {
              n.msg = "header crc mismatch", e.mode = fa;
              break;
            }
            l = 0, u = 0;
          }
          e.head && (e.head.hcrc = e.flags >> 9 & 1, e.head.done = !0), n.adler = e.check = 0, e.mode = zi;
          break;
        case y1:
          for (; u < 32; ) {
            if (s === 0)
              break e;
            s--, l += r[A++] << u, u += 8;
          }
          n.adler = e.check = I1(l), l = 0, u = 0, e.mode = Ud;
        /* falls through */
        case Ud:
          if (e.havedict === 0)
            return n.next_out = i, n.avail_out = o, n.next_in = A, n.avail_in = s, e.hold = l, e.bits = u, CM;
          n.adler = e.check = 1, e.mode = zi;
        /* falls through */
        case zi:
          if (t === BM || t === Ic)
            break e;
        /* falls through */
        case Mf:
          if (e.last) {
            l >>>= u & 7, u -= u & 7, e.mode = Rf;
            break;
          }
          for (; u < 3; ) {
            if (s === 0)
              break e;
            s--, l += r[A++] << u, u += 8;
          }
          switch (e.last = l & 1, l >>>= 1, u -= 1, l & 3) {
            case 0:
              e.mode = B1;
              break;
            case 1:
              if (UM(e), e.mode = Qc, t === Ic) {
                l >>>= 2, u -= 2;
                break e;
              }
              break;
            case 2:
              e.mode = C1;
              break;
            case 3:
              n.msg = "invalid block type", e.mode = fa;
          }
          l >>>= 2, u -= 2;
          break;
        case B1:
          for (l >>>= u & 7, u -= u & 7; u < 32; ) {
            if (s === 0)
              break e;
            s--, l += r[A++] << u, u += 8;
          }
          if ((l & 65535) !== (l >>> 16 ^ 65535)) {
            n.msg = "invalid stored block lengths", e.mode = fa;
            break;
          }
          if (e.length = l & 65535, l = 0, u = 0, e.mode = _f, t === Ic)
            break e;
        /* falls through */
        case _f:
          e.mode = b1;
        /* falls through */
        case b1:
          if (c = e.length, c) {
            if (c > s && (c = s), c > o && (c = o), c === 0)
              break e;
            a.set(r.subarray(A, A + c), i), s -= c, A += c, o -= c, i += c, e.length -= c;
            break;
          }
          e.mode = zi;
          break;
        case C1:
          for (; u < 14; ) {
            if (s === 0)
              break e;
            s--, l += r[A++] << u, u += 8;
          }
          if (e.nlen = (l & 31) + 257, l >>>= 5, u -= 5, e.ndist = (l & 31) + 1, l >>>= 5, u -= 5, e.ncode = (l & 15) + 4, l >>>= 4, u -= 4, e.nlen > 286 || e.ndist > 30) {
            n.msg = "too many length or distance symbols", e.mode = fa;
            break;
          }
          e.have = 0, e.mode = k1;
        /* falls through */
        case k1:
          for (; e.have < e.ncode; ) {
            for (; u < 3; ) {
              if (s === 0)
                break e;
              s--, l += r[A++] << u, u += 8;
            }
            e.lens[E[e.have++]] = l & 7, l >>>= 3, u -= 3;
          }
          for (; e.have < 19; )
            e.lens[E[e.have++]] = 0;
          if (e.lencode = e.lendyn, e.lenbits = 7, Y = { bits: e.lenbits }, W = Ru(yM, e.lens, 0, 19, e.lencode, 0, e.work, Y), e.lenbits = Y.bits, W) {
            n.msg = "invalid code lengths set", e.mode = fa;
            break;
          }
          e.have = 0, e.mode = T1;
        /* falls through */
        case T1:
          for (; e.have < e.nlen + e.ndist; ) {
            for (; y = e.lencode[l & (1 << e.lenbits) - 1], m = y >>> 24, k = y >>> 16 & 255, D = y & 65535, !(m <= u); ) {
              if (s === 0)
                break e;
              s--, l += r[A++] << u, u += 8;
            }
            if (D < 16)
              l >>>= m, u -= m, e.lens[e.have++] = D;
            else {
              if (D === 16) {
                for (T = m + 2; u < T; ) {
                  if (s === 0)
                    break e;
                  s--, l += r[A++] << u, u += 8;
                }
                if (l >>>= m, u -= m, e.have === 0) {
                  n.msg = "invalid bit length repeat", e.mode = fa;
                  break;
                }
                G = e.lens[e.have - 1], c = 3 + (l & 3), l >>>= 2, u -= 2;
              } else if (D === 17) {
                for (T = m + 3; u < T; ) {
                  if (s === 0)
                    break e;
                  s--, l += r[A++] << u, u += 8;
                }
                l >>>= m, u -= m, G = 0, c = 3 + (l & 7), l >>>= 3, u -= 3;
              } else {
                for (T = m + 7; u < T; ) {
                  if (s === 0)
                    break e;
                  s--, l += r[A++] << u, u += 8;
                }
                l >>>= m, u -= m, G = 0, c = 11 + (l & 127), l >>>= 7, u -= 7;
              }
              if (e.have + c > e.nlen + e.ndist) {
                n.msg = "invalid bit length repeat", e.mode = fa;
                break;
              }
              for (; c--; )
                e.lens[e.have++] = G;
            }
          }
          if (e.mode === fa)
            break;
          if (e.lens[256] === 0) {
            n.msg = "invalid code -- missing end-of-block", e.mode = fa;
            break;
          }
          if (e.lenbits = 9, Y = { bits: e.lenbits }, W = Ru(N5, e.lens, 0, e.nlen, e.lencode, 0, e.work, Y), e.lenbits = Y.bits, W) {
            n.msg = "invalid literal/lengths set", e.mode = fa;
            break;
          }
          if (e.distbits = 6, e.distcode = e.distdyn, Y = { bits: e.distbits }, W = Ru(H5, e.lens, e.nlen, e.ndist, e.distcode, 0, e.work, Y), e.distbits = Y.bits, W) {
            n.msg = "invalid distances set", e.mode = fa;
            break;
          }
          if (e.mode = Qc, t === Ic)
            break e;
        /* falls through */
        case Qc:
          e.mode = Mc;
        /* falls through */
        case Mc:
          if (s >= 6 && o >= 258) {
            n.next_out = i, n.avail_out = o, n.next_in = A, n.avail_in = s, e.hold = l, e.bits = u, hM(n, h), i = n.next_out, a = n.output, o = n.avail_out, A = n.next_in, r = n.input, s = n.avail_in, l = e.hold, u = e.bits, e.mode === zi && (e.back = -1);
            break;
          }
          for (e.back = 0; y = e.lencode[l & (1 << e.lenbits) - 1], m = y >>> 24, k = y >>> 16 & 255, D = y & 65535, !(m <= u); ) {
            if (s === 0)
              break e;
            s--, l += r[A++] << u, u += 8;
          }
          if (k && (k & 240) === 0) {
            for (B = m, O = k, q = D; y = e.lencode[q + ((l & (1 << B + O) - 1) >> B)], m = y >>> 24, k = y >>> 16 & 255, D = y & 65535, !(B + m <= u); ) {
              if (s === 0)
                break e;
              s--, l += r[A++] << u, u += 8;
            }
            l >>>= B, u -= B, e.back += B;
          }
          if (l >>>= m, u -= m, e.back += m, e.length = D, k === 0) {
            e.mode = F1;
            break;
          }
          if (k & 32) {
            e.back = -1, e.mode = zi;
            break;
          }
          if (k & 64) {
            n.msg = "invalid literal/length code", e.mode = fa;
            break;
          }
          e.extra = k & 15, e.mode = x1;
        /* falls through */
        case x1:
          if (e.extra) {
            for (T = e.extra; u < T; ) {
              if (s === 0)
                break e;
              s--, l += r[A++] << u, u += 8;
            }
            e.length += l & (1 << e.extra) - 1, l >>>= e.extra, u -= e.extra, e.back += e.extra;
          }
          e.was = e.length, e.mode = D1;
        /* falls through */
        case D1:
          for (; y = e.distcode[l & (1 << e.distbits) - 1], m = y >>> 24, k = y >>> 16 & 255, D = y & 65535, !(m <= u); ) {
            if (s === 0)
              break e;
            s--, l += r[A++] << u, u += 8;
          }
          if ((k & 240) === 0) {
            for (B = m, O = k, q = D; y = e.distcode[q + ((l & (1 << B + O) - 1) >> B)], m = y >>> 24, k = y >>> 16 & 255, D = y & 65535, !(B + m <= u); ) {
              if (s === 0)
                break e;
              s--, l += r[A++] << u, u += 8;
            }
            l >>>= B, u -= B, e.back += B;
          }
          if (l >>>= m, u -= m, e.back += m, k & 64) {
            n.msg = "invalid distance code", e.mode = fa;
            break;
          }
          e.offset = D, e.extra = k & 15, e.mode = E1;
        /* falls through */
        case E1:
          if (e.extra) {
            for (T = e.extra; u < T; ) {
              if (s === 0)
                break e;
              s--, l += r[A++] << u, u += 8;
            }
            e.offset += l & (1 << e.extra) - 1, l >>>= e.extra, u -= e.extra, e.back += e.extra;
          }
          if (e.offset > e.dmax) {
            n.msg = "invalid distance too far back", e.mode = fa;
            break;
          }
          e.mode = S1;
        /* falls through */
        case S1:
          if (o === 0)
            break e;
          if (c = h - o, e.offset > c) {
            if (c = e.offset - c, c > e.whave && e.sane) {
              n.msg = "invalid distance too far back", e.mode = fa;
              break;
            }
            c > e.wnext ? (c -= e.wnext, p = e.wsize - c) : p = e.wnext - c, c > e.length && (c = e.length), w = e.window;
          } else
            w = a, p = i - e.offset, c = e.length;
          c > o && (c = o), o -= c, e.length -= c;
          do
            a[i++] = w[p++];
          while (--c);
          e.length === 0 && (e.mode = Mc);
          break;
        case F1:
          if (o === 0)
            break e;
          a[i++] = e.length, o--, e.mode = Mc;
          break;
        case Rf:
          if (e.wrap) {
            for (; u < 32; ) {
              if (s === 0)
                break e;
              s--, l |= r[A++] << u, u += 8;
            }
            if (h -= o, n.total_out += h, e.total += h, e.wrap & 4 && h && (n.adler = e.check = /*UPDATE_CHECK(state.check, put - _out, _out);*/
            e.flags ? Fi(e.check, a, h, i - h) : wp(e.check, a, h, i - h)), h = o, e.wrap & 4 && (e.flags ? l : I1(l)) !== e.check) {
              n.msg = "incorrect data check", e.mode = fa;
              break;
            }
            l = 0, u = 0;
          }
          e.mode = U1;
        /* falls through */
        case U1:
          if (e.wrap && e.flags) {
            for (; u < 32; ) {
              if (s === 0)
                break e;
              s--, l += r[A++] << u, u += 8;
            }
            if (e.wrap & 4 && l !== (e.total & 4294967295)) {
              n.msg = "incorrect length check", e.mode = fa;
              break;
            }
            l = 0, u = 0;
          }
          e.mode = L1;
        /* falls through */
        case L1:
          W = bM;
          break e;
        case fa:
          W = O5;
          break e;
        case W5:
          return P5;
        case K5:
        /* falls through */
        default:
          return Gs;
      }
  return n.next_out = i, n.avail_out = o, n.next_in = A, n.avail_in = s, e.hold = l, e.bits = u, (e.wsize || h !== n.avail_out && e.mode < fa && (e.mode < Rf || t !== u1)) && Y5(n, n.output, n.next_out, h - n.avail_out), f -= n.avail_in, h -= n.avail_out, n.total_in += f, n.total_out += h, e.total += h, e.wrap & 4 && h && (n.adler = e.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/
  e.flags ? Fi(e.check, a, h, n.next_out - h) : wp(e.check, a, h, n.next_out - h)), n.data_type = e.bits + (e.last ? 64 : 0) + (e.mode === zi ? 128 : 0) + (e.mode === Qc || e.mode === _f ? 256 : 0), (f === 0 && h === 0 || t === u1) && W === ul && (W = kM), W;
}, IM = (n) => {
  if (dl(n))
    return Gs;
  let t = n.state;
  return t.window && (t.window = null), n.state = null, ul;
}, QM = (n, t) => {
  if (dl(n))
    return Gs;
  const e = n.state;
  return (e.wrap & 2) === 0 ? Gs : (e.head = t, t.done = !1, ul);
}, MM = (n, t) => {
  const e = t.length;
  let r, a, A;
  return dl(n) || (r = n.state, r.wrap !== 0 && r.mode !== Ud) ? Gs : r.mode === Ud && (a = 1, a = wp(a, t, e, 0), a !== r.check) ? O5 : (A = Y5(n, t, e, e), A ? (r.mode = W5, P5) : (r.havedict = 1, ul));
};
var _M = V5, RM = q5, NM = $5, HM = FM, OM = j5, PM = LM, WM = IM, KM = QM, $M = MM, VM = "pako inflate (from Nodeca project)", to = {
  inflateReset: _M,
  inflateReset2: RM,
  inflateResetKeep: NM,
  inflateInit: HM,
  inflateInit2: OM,
  inflate: PM,
  inflateEnd: WM,
  inflateGetHeader: KM,
  inflateSetDictionary: $M,
  inflateInfo: VM
};
function qM() {
  this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = "", this.comment = "", this.hcrc = 0, this.done = !1;
}
var jM = qM;
const G5 = Object.prototype.toString, {
  Z_NO_FLUSH: YM,
  Z_FINISH: GM,
  Z_OK: qu,
  Z_STREAM_END: Of,
  Z_NEED_DICT: Pf,
  Z_STREAM_ERROR: zM,
  Z_DATA_ERROR: M1,
  Z_MEM_ERROR: XM
} = M5;
function zu(n) {
  this.options = _5.assign({
    chunkSize: 1024 * 64,
    windowBits: 15,
    to: ""
  }, n || {});
  const t = this.options;
  t.raw && t.windowBits >= 0 && t.windowBits < 16 && (t.windowBits = -t.windowBits, t.windowBits === 0 && (t.windowBits = -15)), t.windowBits >= 0 && t.windowBits < 16 && !(n && n.windowBits) && (t.windowBits += 32), t.windowBits > 15 && t.windowBits < 48 && (t.windowBits & 15) === 0 && (t.windowBits |= 15), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new dM(), this.strm.avail_out = 0;
  let e = to.inflateInit2(
    this.strm,
    t.windowBits
  );
  if (e !== qu)
    throw new Error(yp[e]);
  if (this.header = new jM(), to.inflateGetHeader(this.strm, this.header), t.dictionary && (typeof t.dictionary == "string" ? t.dictionary = Bp.string2buf(t.dictionary) : G5.call(t.dictionary) === "[object ArrayBuffer]" && (t.dictionary = new Uint8Array(t.dictionary)), t.raw && (e = to.inflateSetDictionary(this.strm, t.dictionary), e !== qu)))
    throw new Error(yp[e]);
}
zu.prototype.push = function(n, t) {
  const e = this.strm, r = this.options.chunkSize, a = this.options.dictionary;
  let A, i, s;
  if (this.ended) return !1;
  for (t === ~~t ? i = t : i = t === !0 ? GM : YM, G5.call(n) === "[object ArrayBuffer]" ? e.input = new Uint8Array(n) : e.input = n, e.next_in = 0, e.avail_in = e.input.length; ; ) {
    for (e.avail_out === 0 && (e.output = new Uint8Array(r), e.next_out = 0, e.avail_out = r), A = to.inflate(e, i), A === Pf && a && (A = to.inflateSetDictionary(e, a), A === qu ? A = to.inflate(e, i) : A === M1 && (A = Pf)); e.avail_in > 0 && A === Of && e.state.wrap > 0 && n[e.next_in] !== 0; )
      to.inflateReset(e), A = to.inflate(e, i);
    switch (A) {
      case zM:
      case M1:
      case Pf:
      case XM:
        return this.onEnd(A), this.ended = !0, !1;
    }
    if (s = e.avail_out, e.next_out && (e.avail_out === 0 || A === Of))
      if (this.options.to === "string") {
        let o = Bp.utf8border(e.output, e.next_out), l = e.next_out - o, u = Bp.buf2string(e.output, o);
        e.next_out = l, e.avail_out = r - l, l && e.output.set(e.output.subarray(o, o + l), 0), this.onData(u);
      } else
        this.onData(e.output.length === e.next_out ? e.output : e.output.subarray(0, e.next_out));
    if (!(A === qu && s === 0)) {
      if (A === Of)
        return A = to.inflateEnd(this.strm), this.onEnd(A), this.ended = !0, !0;
      if (e.avail_in === 0) break;
    }
  }
  return !0;
};
zu.prototype.onData = function(n) {
  this.chunks.push(n);
};
zu.prototype.onEnd = function(n) {
  n === qu && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = _5.flattenChunks(this.chunks)), this.chunks = [], this.err = n, this.msg = this.strm.msg;
};
function JM(n, t) {
  const e = new zu(t);
  if (e.push(n), e.err) throw e.msg || yp[e.err];
  return e.result;
}
var ZM = zu, e6 = JM, t6 = {
  Inflate: ZM,
  inflate: e6
};
const { Inflate: r6, inflate: n6 } = t6;
var _1 = r6, a6 = n6;
const z5 = [];
for (let n = 0; n < 256; n++) {
  let t = n;
  for (let e = 0; e < 8; e++)
    t & 1 ? t = 3988292384 ^ t >>> 1 : t = t >>> 1;
  z5[n] = t;
}
const R1 = 4294967295;
function A6(n, t, e) {
  let r = n;
  for (let a = 0; a < e; a++)
    r = z5[(r ^ t[a]) & 255] ^ r >>> 8;
  return r;
}
function s6(n, t) {
  return (A6(R1, n, t) ^ R1) >>> 0;
}
function N1(n, t, e) {
  const r = n.readUint32(), a = s6(new Uint8Array(n.buffer, n.byteOffset + n.offset - t - 4, t), t);
  if (a !== r)
    throw new Error(`CRC mismatch for chunk ${e}. Expected ${r}, found ${a}`);
}
function X5(n, t, e) {
  for (let r = 0; r < e; r++)
    t[r] = n[r];
}
function J5(n, t, e, r) {
  let a = 0;
  for (; a < r; a++)
    t[a] = n[a];
  for (; a < e; a++)
    t[a] = n[a] + t[a - r] & 255;
}
function Z5(n, t, e, r) {
  let a = 0;
  if (e.length === 0)
    for (; a < r; a++)
      t[a] = n[a];
  else
    for (; a < r; a++)
      t[a] = n[a] + e[a] & 255;
}
function eC(n, t, e, r, a) {
  let A = 0;
  if (e.length === 0) {
    for (; A < a; A++)
      t[A] = n[A];
    for (; A < r; A++)
      t[A] = n[A] + (t[A - a] >> 1) & 255;
  } else {
    for (; A < a; A++)
      t[A] = n[A] + (e[A] >> 1) & 255;
    for (; A < r; A++)
      t[A] = n[A] + (t[A - a] + e[A] >> 1) & 255;
  }
}
function tC(n, t, e, r, a) {
  let A = 0;
  if (e.length === 0) {
    for (; A < a; A++)
      t[A] = n[A];
    for (; A < r; A++)
      t[A] = n[A] + t[A - a] & 255;
  } else {
    for (; A < a; A++)
      t[A] = n[A] + e[A] & 255;
    for (; A < r; A++)
      t[A] = n[A] + i6(t[A - a], e[A], e[A - a]) & 255;
  }
}
function i6(n, t, e) {
  const r = n + t - e, a = Math.abs(r - n), A = Math.abs(r - t), i = Math.abs(r - e);
  return a <= A && a <= i ? n : A <= i ? t : e;
}
function o6(n, t, e, r, a, A) {
  switch (n) {
    case 0:
      X5(t, e, a);
      break;
    case 1:
      J5(t, e, a, A);
      break;
    case 2:
      Z5(t, e, r, a);
      break;
    case 3:
      eC(t, e, r, a, A);
      break;
    case 4:
      tC(t, e, r, a, A);
      break;
    default:
      throw new Error(`Unsupported filter: ${n}`);
  }
}
const l6 = new Uint16Array([255]), u6 = new Uint8Array(l6.buffer), c6 = u6[0] === 255;
function d6(n) {
  const { data: t, width: e, height: r, channels: a, depth: A } = n, i = [
    { x: 0, y: 0, xStep: 8, yStep: 8 },
    // Pass 1
    { x: 4, y: 0, xStep: 8, yStep: 8 },
    // Pass 2
    { x: 0, y: 4, xStep: 4, yStep: 8 },
    // Pass 3
    { x: 2, y: 0, xStep: 4, yStep: 4 },
    // Pass 4
    { x: 0, y: 2, xStep: 2, yStep: 4 },
    // Pass 5
    { x: 1, y: 0, xStep: 2, yStep: 2 },
    // Pass 6
    { x: 0, y: 1, xStep: 1, yStep: 2 }
    // Pass 7
  ], s = Math.ceil(A / 8) * a, o = new Uint8Array(r * e * s);
  let l = 0;
  for (let u = 0; u < 7; u++) {
    const f = i[u], h = Math.ceil((e - f.x) / f.xStep), c = Math.ceil((r - f.y) / f.yStep);
    if (h <= 0 || c <= 0)
      continue;
    const p = h * s, w = new Uint8Array(p);
    for (let y = 0; y < c; y++) {
      const m = t[l++], k = t.subarray(l, l + p);
      l += p;
      const D = new Uint8Array(p);
      o6(m, k, D, w, p, s), w.set(D);
      for (let B = 0; B < h; B++) {
        const O = f.x + B * f.xStep, q = f.y + y * f.yStep;
        if (!(O >= e || q >= r))
          for (let G = 0; G < s; G++)
            o[(q * e + O) * s + G] = D[B * s + G];
      }
    }
  }
  if (A === 16) {
    const u = new Uint16Array(o.buffer);
    if (c6)
      for (let f = 0; f < u.length; f++)
        u[f] = f6(u[f]);
    return u;
  } else
    return o;
}
function f6(n) {
  return (n & 255) << 8 | n >> 8 & 255;
}
const h6 = new Uint16Array([255]), g6 = new Uint8Array(h6.buffer), v6 = g6[0] === 255, p6 = new Uint8Array(0);
function H1(n) {
  const { data: t, width: e, height: r, channels: a, depth: A } = n, i = Math.ceil(A / 8) * a, s = Math.ceil(A / 8 * a * e), o = new Uint8Array(r * s);
  let l = p6, u = 0, f, h;
  for (let c = 0; c < r; c++) {
    switch (f = t.subarray(u + 1, u + 1 + s), h = o.subarray(c * s, (c + 1) * s), t[u]) {
      case 0:
        X5(f, h, s);
        break;
      case 1:
        J5(f, h, s, i);
        break;
      case 2:
        Z5(f, h, l, s);
        break;
      case 3:
        eC(f, h, l, s, i);
        break;
      case 4:
        tC(f, h, l, s, i);
        break;
      default:
        throw new Error(`Unsupported filter: ${t[u]}`);
    }
    l = h, u += s + 1;
  }
  if (A === 16) {
    const c = new Uint16Array(o.buffer);
    if (v6)
      for (let p = 0; p < c.length; p++)
        c[p] = m6(c[p]);
    return c;
  } else
    return o;
}
function m6(n) {
  return (n & 255) << 8 | n >> 8 & 255;
}
const vd = Uint8Array.of(137, 80, 78, 71, 13, 10, 26, 10);
function O1(n) {
  if (!w6(n.readBytes(vd.length)))
    throw new Error("wrong PNG signature");
}
function w6(n) {
  if (n.length < vd.length)
    return !1;
  for (let t = 0; t < vd.length; t++)
    if (n[t] !== vd[t])
      return !1;
  return !0;
}
const y6 = "tEXt", B6 = 0, rC = new TextDecoder("latin1");
function b6(n) {
  if (k6(n), n.length === 0 || n.length > 79)
    throw new Error("keyword length must be between 1 and 79");
}
const C6 = /^[\u0000-\u00FF]*$/;
function k6(n) {
  if (!C6.test(n))
    throw new Error("invalid latin1 text");
}
function T6(n, t, e) {
  const r = nC(t);
  n[r] = x6(t, e - r.length - 1);
}
function nC(n) {
  for (n.mark(); n.readByte() !== B6; )
    ;
  const t = n.offset;
  n.reset();
  const e = rC.decode(n.readBytes(t - n.offset - 1));
  return n.skip(1), b6(e), e;
}
function x6(n, t) {
  return rC.decode(n.readBytes(t));
}
const Ms = {
  UNKNOWN: -1,
  GREYSCALE: 0,
  TRUECOLOUR: 2,
  INDEXED_COLOUR: 3,
  GREYSCALE_ALPHA: 4,
  TRUECOLOUR_ALPHA: 6
}, Wf = {
  UNKNOWN: -1,
  DEFLATE: 0
}, P1 = {
  UNKNOWN: -1,
  ADAPTIVE: 0
}, Kf = {
  UNKNOWN: -1,
  NO_INTERLACE: 0,
  ADAM7: 1
}, _c = {
  NONE: 0,
  BACKGROUND: 1,
  PREVIOUS: 2
}, $f = {
  SOURCE: 0,
  OVER: 1
};
class D6 extends b0 {
  constructor(e, r = {}) {
    super(e);
    sn(this, "_checkCrc");
    sn(this, "_inflator");
    sn(this, "_png");
    sn(this, "_apng");
    sn(this, "_end");
    sn(this, "_hasPalette");
    sn(this, "_palette");
    sn(this, "_hasTransparency");
    sn(this, "_transparency");
    sn(this, "_compressionMethod");
    sn(this, "_filterMethod");
    sn(this, "_interlaceMethod");
    sn(this, "_colorType");
    sn(this, "_isAnimated");
    sn(this, "_numberOfFrames");
    sn(this, "_numberOfPlays");
    sn(this, "_frames");
    sn(this, "_writingDataChunks");
    const { checkCrc: a = !1 } = r;
    this._checkCrc = a, this._inflator = new _1(), this._png = {
      width: -1,
      height: -1,
      channels: -1,
      data: new Uint8Array(0),
      depth: 1,
      text: {}
    }, this._apng = {
      width: -1,
      height: -1,
      channels: -1,
      depth: 1,
      numberOfFrames: 1,
      numberOfPlays: 0,
      text: {},
      frames: []
    }, this._end = !1, this._hasPalette = !1, this._palette = [], this._hasTransparency = !1, this._transparency = new Uint16Array(0), this._compressionMethod = Wf.UNKNOWN, this._filterMethod = P1.UNKNOWN, this._interlaceMethod = Kf.UNKNOWN, this._colorType = Ms.UNKNOWN, this._isAnimated = !1, this._numberOfFrames = 1, this._numberOfPlays = 0, this._frames = [], this._writingDataChunks = !1, this.setBigEndian();
  }
  decode() {
    for (O1(this); !this._end; ) {
      const e = this.readUint32(), r = this.readChars(4);
      this.decodeChunk(e, r);
    }
    return this.decodeImage(), this._png;
  }
  decodeApng() {
    for (O1(this); !this._end; ) {
      const e = this.readUint32(), r = this.readChars(4);
      this.decodeApngChunk(e, r);
    }
    return this.decodeApngImage(), this._apng;
  }
  // https://www.w3.org/TR/PNG/#5Chunk-layout
  decodeChunk(e, r) {
    const a = this.offset;
    switch (r) {
      // 11.2 Critical chunks
      case "IHDR":
        this.decodeIHDR();
        break;
      case "PLTE":
        this.decodePLTE(e);
        break;
      case "IDAT":
        this.decodeIDAT(e);
        break;
      case "IEND":
        this._end = !0;
        break;
      // 11.3 Ancillary chunks
      case "tRNS":
        this.decodetRNS(e);
        break;
      case "iCCP":
        this.decodeiCCP(e);
        break;
      case y6:
        T6(this._png.text, this, e);
        break;
      case "pHYs":
        this.decodepHYs();
        break;
      default:
        this.skip(e);
        break;
    }
    if (this.offset - a !== e)
      throw new Error(`Length mismatch while decoding chunk ${r}`);
    this._checkCrc ? N1(this, e + 4, r) : this.skip(4);
  }
  decodeApngChunk(e, r) {
    const a = this.offset;
    switch (r !== "fdAT" && r !== "IDAT" && this._writingDataChunks && this.pushDataToFrame(), r) {
      case "acTL":
        this.decodeACTL();
        break;
      case "fcTL":
        this.decodeFCTL();
        break;
      case "fdAT":
        this.decodeFDAT(e);
        break;
      default:
        this.decodeChunk(e, r), this.offset = a + e;
        break;
    }
    if (this.offset - a !== e)
      throw new Error(`Length mismatch while decoding chunk ${r}`);
    this._checkCrc ? N1(this, e + 4, r) : this.skip(4);
  }
  // https://www.w3.org/TR/PNG/#11IHDR
  decodeIHDR() {
    const e = this._png;
    e.width = this.readUint32(), e.height = this.readUint32(), e.depth = E6(this.readUint8());
    const r = this.readUint8();
    this._colorType = r;
    let a;
    switch (r) {
      case Ms.GREYSCALE:
        a = 1;
        break;
      case Ms.TRUECOLOUR:
        a = 3;
        break;
      case Ms.INDEXED_COLOUR:
        a = 1;
        break;
      case Ms.GREYSCALE_ALPHA:
        a = 2;
        break;
      case Ms.TRUECOLOUR_ALPHA:
        a = 4;
        break;
      // Kept for exhaustiveness.
      // eslint-disable-next-line unicorn/no-useless-switch-case
      case Ms.UNKNOWN:
      default:
        throw new Error(`Unknown color type: ${r}`);
    }
    if (this._png.channels = a, this._compressionMethod = this.readUint8(), this._compressionMethod !== Wf.DEFLATE)
      throw new Error(`Unsupported compression method: ${this._compressionMethod}`);
    this._filterMethod = this.readUint8(), this._interlaceMethod = this.readUint8();
  }
  decodeACTL() {
    this._numberOfFrames = this.readUint32(), this._numberOfPlays = this.readUint32(), this._isAnimated = !0;
  }
  decodeFCTL() {
    const e = {
      sequenceNumber: this.readUint32(),
      width: this.readUint32(),
      height: this.readUint32(),
      xOffset: this.readUint32(),
      yOffset: this.readUint32(),
      delayNumber: this.readUint16(),
      delayDenominator: this.readUint16(),
      disposeOp: this.readUint8(),
      blendOp: this.readUint8(),
      data: new Uint8Array(0)
    };
    this._frames.push(e);
  }
  // https://www.w3.org/TR/PNG/#11PLTE
  decodePLTE(e) {
    if (e % 3 !== 0)
      throw new RangeError(`PLTE field length must be a multiple of 3. Got ${e}`);
    const r = e / 3;
    this._hasPalette = !0;
    const a = [];
    this._palette = a;
    for (let A = 0; A < r; A++)
      a.push([this.readUint8(), this.readUint8(), this.readUint8()]);
  }
  // https://www.w3.org/TR/PNG/#11IDAT
  decodeIDAT(e) {
    this._writingDataChunks = !0;
    const r = e, a = this.offset + this.byteOffset;
    if (this._inflator.push(new Uint8Array(this.buffer, a, r)), this._inflator.err)
      throw new Error(`Error while decompressing the data: ${this._inflator.err}`);
    this.skip(e);
  }
  decodeFDAT(e) {
    this._writingDataChunks = !0;
    let r = e, a = this.offset + this.byteOffset;
    if (a += 4, r -= 4, this._inflator.push(new Uint8Array(this.buffer, a, r)), this._inflator.err)
      throw new Error(`Error while decompressing the data: ${this._inflator.err}`);
    this.skip(e);
  }
  // https://www.w3.org/TR/PNG/#11tRNS
  decodetRNS(e) {
    switch (this._colorType) {
      case Ms.GREYSCALE:
      case Ms.TRUECOLOUR: {
        if (e % 2 !== 0)
          throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${e}`);
        if (e / 2 > this._png.width * this._png.height)
          throw new Error(`tRNS chunk contains more alpha values than there are pixels (${e / 2} vs ${this._png.width * this._png.height})`);
        this._hasTransparency = !0, this._transparency = new Uint16Array(e / 2);
        for (let r = 0; r < e / 2; r++)
          this._transparency[r] = this.readUint16();
        break;
      }
      case Ms.INDEXED_COLOUR: {
        if (e > this._palette.length)
          throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${e} vs ${this._palette.length})`);
        let r = 0;
        for (; r < e; r++) {
          const a = this.readByte();
          this._palette[r].push(a);
        }
        for (; r < this._palette.length; r++)
          this._palette[r].push(255);
        break;
      }
      // Kept for exhaustiveness.
      /* eslint-disable unicorn/no-useless-switch-case */
      case Ms.UNKNOWN:
      case Ms.GREYSCALE_ALPHA:
      case Ms.TRUECOLOUR_ALPHA:
      default:
        throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`);
    }
  }
  // https://www.w3.org/TR/PNG/#11iCCP
  decodeiCCP(e) {
    const r = nC(this), a = this.readUint8();
    if (a !== Wf.DEFLATE)
      throw new Error(`Unsupported iCCP compression method: ${a}`);
    const A = this.readBytes(e - r.length - 2);
    this._png.iccEmbeddedProfile = {
      name: r,
      profile: a6(A)
    };
  }
  // https://www.w3.org/TR/PNG/#11pHYs
  decodepHYs() {
    const e = this.readUint32(), r = this.readUint32(), a = this.readByte();
    this._png.resolution = { x: e, y: r, unit: a };
  }
  decodeApngImage() {
    this._apng.width = this._png.width, this._apng.height = this._png.height, this._apng.channels = this._png.channels, this._apng.depth = this._png.depth, this._apng.numberOfFrames = this._numberOfFrames, this._apng.numberOfPlays = this._numberOfPlays, this._apng.text = this._png.text, this._apng.resolution = this._png.resolution;
    for (let e = 0; e < this._numberOfFrames; e++) {
      const r = {
        sequenceNumber: this._frames[e].sequenceNumber,
        delayNumber: this._frames[e].delayNumber,
        delayDenominator: this._frames[e].delayDenominator,
        data: this._apng.depth === 8 ? new Uint8Array(this._apng.width * this._apng.height * this._apng.channels) : new Uint16Array(this._apng.width * this._apng.height * this._apng.channels)
      }, a = this._frames.at(e);
      if (a) {
        if (a.data = H1({
          data: a.data,
          width: a.width,
          height: a.height,
          channels: this._apng.channels,
          depth: this._apng.depth
        }), this._hasPalette && (this._apng.palette = this._palette), this._hasTransparency && (this._apng.transparency = this._transparency), e === 0 || a.xOffset === 0 && a.yOffset === 0 && a.width === this._png.width && a.height === this._png.height)
          r.data = a.data;
        else {
          const A = this._apng.frames.at(e - 1);
          this.disposeFrame(a, A, r), this.addFrameDataToCanvas(r, a);
        }
        this._apng.frames.push(r);
      }
    }
    return this._apng;
  }
  disposeFrame(e, r, a) {
    switch (e.disposeOp) {
      case _c.NONE:
        break;
      case _c.BACKGROUND:
        for (let A = 0; A < this._png.height; A++)
          for (let i = 0; i < this._png.width; i++) {
            const s = (A * e.width + i) * this._png.channels;
            for (let o = 0; o < this._png.channels; o++)
              a.data[s + o] = 0;
          }
        break;
      case _c.PREVIOUS:
        a.data.set(r.data);
        break;
      default:
        throw new Error("Unknown disposeOp");
    }
  }
  addFrameDataToCanvas(e, r) {
    const a = 1 << this._png.depth, A = (i, s) => {
      const o = ((i + r.yOffset) * this._png.width + r.xOffset + s) * this._png.channels, l = (i * r.width + s) * this._png.channels;
      return { index: o, frameIndex: l };
    };
    switch (r.blendOp) {
      case $f.SOURCE:
        for (let i = 0; i < r.height; i++)
          for (let s = 0; s < r.width; s++) {
            const { index: o, frameIndex: l } = A(i, s);
            for (let u = 0; u < this._png.channels; u++)
              e.data[o + u] = r.data[l + u];
          }
        break;
      // https://www.w3.org/TR/png-3/#13Alpha-channel-processing
      case $f.OVER:
        for (let i = 0; i < r.height; i++)
          for (let s = 0; s < r.width; s++) {
            const { index: o, frameIndex: l } = A(i, s);
            for (let u = 0; u < this._png.channels; u++) {
              const f = r.data[l + this._png.channels - 1] / a, h = u % (this._png.channels - 1) === 0 ? 1 : r.data[l + u], c = Math.floor(f * h + (1 - f) * e.data[o + u]);
              e.data[o + u] += c;
            }
          }
        break;
      default:
        throw new Error("Unknown blendOp");
    }
  }
  decodeImage() {
    var r;
    if (this._inflator.err)
      throw new Error(`Error while decompressing the data: ${this._inflator.err}`);
    const e = this._isAnimated ? ((r = this._frames) == null ? void 0 : r.at(0)).data : this._inflator.result;
    if (this._filterMethod !== P1.ADAPTIVE)
      throw new Error(`Filter method ${this._filterMethod} not supported`);
    if (this._interlaceMethod === Kf.NO_INTERLACE)
      this._png.data = H1({
        data: e,
        width: this._png.width,
        height: this._png.height,
        channels: this._png.channels,
        depth: this._png.depth
      });
    else if (this._interlaceMethod === Kf.ADAM7)
      this._png.data = d6({
        data: e,
        width: this._png.width,
        height: this._png.height,
        channels: this._png.channels,
        depth: this._png.depth
      });
    else
      throw new Error(`Interlace method ${this._interlaceMethod} not supported`);
    this._hasPalette && (this._png.palette = this._palette), this._hasTransparency && (this._png.transparency = this._transparency);
  }
  pushDataToFrame() {
    const e = this._inflator.result, r = this._frames.at(-1);
    r ? r.data = e : this._frames.push({
      sequenceNumber: 0,
      width: this._png.width,
      height: this._png.height,
      xOffset: 0,
      yOffset: 0,
      delayNumber: 0,
      delayDenominator: 0,
      disposeOp: _c.NONE,
      blendOp: $f.SOURCE,
      data: e
    }), this._inflator = new _1(), this._writingDataChunks = !1;
  }
}
function E6(n) {
  if (n !== 1 && n !== 2 && n !== 4 && n !== 8 && n !== 16)
    throw new Error(`invalid bit depth: ${n}`);
  return n;
}
var W1;
(function(n) {
  n[n.UNKNOWN = 0] = "UNKNOWN", n[n.METRE = 1] = "METRE";
})(W1 || (W1 = {}));
function S6(n, t) {
  return new D6(n, t).decode();
}
/** @license
 *
 * jsPDF - PDF Document creation from JavaScript
 * Version 4.2.1 Built on 2026-03-17T11:11:27.057Z
 *                      CommitID 00000000
 *
 * Copyright (c) 2010-2025 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
 *               2015-2025 yWorks GmbH, http://www.yworks.com
 *               2015-2025 Lukas Holländer <lukas.hollaender@yworks.com>, https://github.com/HackbrettXXX
 *               2016-2018 Aras Abbasi <aras.abbasi@gmail.com>
 *               2010 Aaron Spike, https://github.com/acspike
 *               2012 Willow Systems Corporation, https://github.com/willowsystems
 *               2012 Pablo Hess, https://github.com/pablohess
 *               2012 Florian Jenett, https://github.com/fjenett
 *               2013 Warren Weckesser, https://github.com/warrenweckesser
 *               2013 Youssef Beddad, https://github.com/lifof
 *               2013 Lee Driscoll, https://github.com/lsdriscoll
 *               2013 Stefan Slonevskiy, https://github.com/stefslon
 *               2013 Jeremy Morel, https://github.com/jmorel
 *               2013 Christoph Hartmann, https://github.com/chris-rock
 *               2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
 *               2014 James Makes, https://github.com/dollaruw
 *               2014 Diego Casorran, https://github.com/diegocr
 *               2014 Steven Spungin, https://github.com/Flamenco
 *               2014 Kenneth Glassey, https://github.com/Gavvers
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 * Contributor(s):
 *    siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango,
 *    kim3er, mfo, alnorth, Flamenco
 */
var Nr = /* @__PURE__ */ (function() {
  return typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : this;
})();
function Vf() {
  Nr.console && typeof Nr.console.log == "function" && Nr.console.log.apply(Nr.console, arguments);
}
var Xn = { log: Vf, warn: function(n) {
  Nr.console && (typeof Nr.console.warn == "function" ? Nr.console.warn.apply(Nr.console, arguments) : Vf.call(null, arguments));
}, error: function(n) {
  Nr.console && (typeof Nr.console.error == "function" ? Nr.console.error.apply(Nr.console, arguments) : Vf(n));
} };
function qf(n, t, e) {
  var r = new XMLHttpRequest();
  r.open("GET", n), r.responseType = "blob", r.onload = function() {
    Jo(r.response, t, e);
  }, r.onerror = function() {
    Xn.error("could not download file");
  }, r.send();
}
function K1(n) {
  var t = new XMLHttpRequest();
  t.open("HEAD", n, !1);
  try {
    t.send();
  } catch {
  }
  return t.status >= 200 && t.status <= 299;
}
function Rc(n) {
  try {
    n.dispatchEvent(new MouseEvent("click"));
  } catch {
    var t = document.createEvent("MouseEvents");
    t.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), n.dispatchEvent(t);
  }
}
var Jo = Nr.saveAs || ((typeof window > "u" ? "undefined" : In(window)) !== "object" || window !== Nr ? function() {
} : typeof HTMLAnchorElement < "u" && "download" in HTMLAnchorElement.prototype ? function(n, t, e) {
  var r = Nr.URL || Nr.webkitURL, a = document.createElement("a");
  t = t || n.name || "download", a.download = t, a.rel = "noopener", typeof n == "string" ? (a.href = n, a.origin !== location.origin ? K1(a.href) ? qf(n, t, e) : Rc(a, a.target = "_blank") : Rc(a)) : (a.href = r.createObjectURL(n), setTimeout(function() {
    r.revokeObjectURL(a.href);
  }, 4e4), setTimeout(function() {
    Rc(a);
  }, 0));
} : "msSaveOrOpenBlob" in navigator ? function(n, t, e) {
  if (t = t || n.name || "download", typeof n == "string") if (K1(n)) qf(n, t, e);
  else {
    var r = document.createElement("a");
    r.href = n, r.target = "_blank", setTimeout(function() {
      Rc(r);
    });
  }
  else navigator.msSaveOrOpenBlob((function(a, A) {
    return A === void 0 ? A = { autoBom: !1 } : In(A) !== "object" && (Xn.warn("Deprecated: Expected third argument to be a object"), A = { autoBom: !A }), A.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type) ? new Blob(["\uFEFF", a], { type: a.type }) : a;
  })(n, e), t);
} : function(n, t, e, r) {
  if ((r = r || open("", "_blank")) && (r.document.title = r.document.body.innerText = "downloading..."), typeof n == "string") return qf(n, t, e);
  var a = n.type === "application/octet-stream", A = /constructor/i.test(Nr.HTMLElement) || Nr.safari, i = /CriOS\/[\d]+/.test(navigator.userAgent);
  if ((i || a && A) && (typeof FileReader > "u" ? "undefined" : In(FileReader)) === "object") {
    var s = new FileReader();
    s.onloadend = function() {
      var u = s.result;
      u = i ? u : u.replace(/^data:[^;]*;/, "data:attachment/file;"), r ? r.location.href = u : location = u, r = null;
    }, s.readAsDataURL(n);
  } else {
    var o = Nr.URL || Nr.webkitURL, l = o.createObjectURL(n);
    r ? r.location = l : location.href = l, r = null, setTimeout(function() {
      o.revokeObjectURL(l);
    }, 4e4);
  }
});
/**
 * A class to parse color values
 * @author Stoyan Stefanov <sstoo@gmail.com>
 * {@link   http://www.phpied.com/rgb-color-parser-in-javascript/}
 * @license Use it if you like it
 */
function aC(n) {
  var t;
  n = n || "", this.ok = !1, n.charAt(0) == "#" && (n = n.substr(1, 6)), n = { aliceblue: "f0f8ff", antiquewhite: "faebd7", aqua: "00ffff", aquamarine: "7fffd4", azure: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "000000", blanchedalmond: "ffebcd", blue: "0000ff", blueviolet: "8a2be2", brown: "a52a2a", burlywood: "deb887", cadetblue: "5f9ea0", chartreuse: "7fff00", chocolate: "d2691e", coral: "ff7f50", cornflowerblue: "6495ed", cornsilk: "fff8dc", crimson: "dc143c", cyan: "00ffff", darkblue: "00008b", darkcyan: "008b8b", darkgoldenrod: "b8860b", darkgray: "a9a9a9", darkgreen: "006400", darkkhaki: "bdb76b", darkmagenta: "8b008b", darkolivegreen: "556b2f", darkorange: "ff8c00", darkorchid: "9932cc", darkred: "8b0000", darksalmon: "e9967a", darkseagreen: "8fbc8f", darkslateblue: "483d8b", darkslategray: "2f4f4f", darkturquoise: "00ced1", darkviolet: "9400d3", deeppink: "ff1493", deepskyblue: "00bfff", dimgray: "696969", dodgerblue: "1e90ff", feldspar: "d19275", firebrick: "b22222", floralwhite: "fffaf0", forestgreen: "228b22", fuchsia: "ff00ff", gainsboro: "dcdcdc", ghostwhite: "f8f8ff", gold: "ffd700", goldenrod: "daa520", gray: "808080", green: "008000", greenyellow: "adff2f", 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", lightgrey: "d3d3d3", lightgreen: "90ee90", lightpink: "ffb6c1", lightsalmon: "ffa07a", lightseagreen: "20b2aa", lightskyblue: "87cefa", lightslateblue: "8470ff", lightslategray: "778899", lightsteelblue: "b0c4de", lightyellow: "ffffe0", lime: "00ff00", limegreen: "32cd32", linen: "faf0e6", magenta: "ff00ff", maroon: "800000", mediumaquamarine: "66cdaa", mediumblue: "0000cd", mediumorchid: "ba55d3", mediumpurple: "9370d8", 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: "d87093", papayawhip: "ffefd5", peachpuff: "ffdab9", peru: "cd853f", pink: "ffc0cb", plum: "dda0dd", powderblue: "b0e0e6", purple: "800080", red: "ff0000", rosybrown: "bc8f8f", royalblue: "4169e1", saddlebrown: "8b4513", salmon: "fa8072", sandybrown: "f4a460", seagreen: "2e8b57", seashell: "fff5ee", sienna: "a0522d", silver: "c0c0c0", skyblue: "87ceeb", slateblue: "6a5acd", slategray: "708090", snow: "fffafa", springgreen: "00ff7f", steelblue: "4682b4", tan: "d2b48c", teal: "008080", thistle: "d8bfd8", tomato: "ff6347", turquoise: "40e0d0", violet: "ee82ee", violetred: "d02090", wheat: "f5deb3", white: "ffffff", whitesmoke: "f5f5f5", yellow: "ffff00", yellowgreen: "9acd32" }[n = (n = n.replace(/ /g, "")).toLowerCase()] || n;
  for (var e = [{ re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/, example: ["rgb(123, 234, 45)", "rgb(255,234,245)"], process: function(s) {
    return [parseInt(s[1]), parseInt(s[2]), parseInt(s[3])];
  } }, { re: /^(\w{2})(\w{2})(\w{2})$/, example: ["#00ff00", "336699"], process: function(s) {
    return [parseInt(s[1], 16), parseInt(s[2], 16), parseInt(s[3], 16)];
  } }, { re: /^(\w{1})(\w{1})(\w{1})$/, example: ["#fb0", "f0f"], process: function(s) {
    return [parseInt(s[1] + s[1], 16), parseInt(s[2] + s[2], 16), parseInt(s[3] + s[3], 16)];
  } }], r = 0; r < e.length; r++) {
    var a = e[r].re, A = e[r].process, i = a.exec(n);
    i && (t = A(i), this.r = t[0], this.g = t[1], this.b = t[2], this.ok = !0);
  }
  this.r = this.r < 0 || isNaN(this.r) ? 0 : this.r > 255 ? 255 : this.r, this.g = this.g < 0 || isNaN(this.g) ? 0 : this.g > 255 ? 255 : this.g, this.b = this.b < 0 || isNaN(this.b) ? 0 : this.b > 255 ? 255 : this.b, this.toRGB = function() {
    return "rgb(" + this.r + ", " + this.g + ", " + this.b + ")";
  }, this.toHex = function() {
    var s = this.r.toString(16), o = this.g.toString(16), l = this.b.toString(16);
    return s.length == 1 && (s = "0" + s), o.length == 1 && (o = "0" + o), l.length == 1 && (l = "0" + l), "#" + s + o + l;
  };
}
var pd = Nr.atob.bind(Nr), $1 = Nr.btoa.bind(Nr);
/**
 * @license
 * Joseph Myers does not specify a particular license for his work.
 *
 * Author: Joseph Myers
 * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
 *
 * Modified by: Owen Leong
 */
function jf(n, t) {
  var e = n[0], r = n[1], a = n[2], A = n[3];
  e = VA(e, r, a, A, t[0], 7, -680876936), A = VA(A, e, r, a, t[1], 12, -389564586), a = VA(a, A, e, r, t[2], 17, 606105819), r = VA(r, a, A, e, t[3], 22, -1044525330), e = VA(e, r, a, A, t[4], 7, -176418897), A = VA(A, e, r, a, t[5], 12, 1200080426), a = VA(a, A, e, r, t[6], 17, -1473231341), r = VA(r, a, A, e, t[7], 22, -45705983), e = VA(e, r, a, A, t[8], 7, 1770035416), A = VA(A, e, r, a, t[9], 12, -1958414417), a = VA(a, A, e, r, t[10], 17, -42063), r = VA(r, a, A, e, t[11], 22, -1990404162), e = VA(e, r, a, A, t[12], 7, 1804603682), A = VA(A, e, r, a, t[13], 12, -40341101), a = VA(a, A, e, r, t[14], 17, -1502002290), e = qA(e, r = VA(r, a, A, e, t[15], 22, 1236535329), a, A, t[1], 5, -165796510), A = qA(A, e, r, a, t[6], 9, -1069501632), a = qA(a, A, e, r, t[11], 14, 643717713), r = qA(r, a, A, e, t[0], 20, -373897302), e = qA(e, r, a, A, t[5], 5, -701558691), A = qA(A, e, r, a, t[10], 9, 38016083), a = qA(a, A, e, r, t[15], 14, -660478335), r = qA(r, a, A, e, t[4], 20, -405537848), e = qA(e, r, a, A, t[9], 5, 568446438), A = qA(A, e, r, a, t[14], 9, -1019803690), a = qA(a, A, e, r, t[3], 14, -187363961), r = qA(r, a, A, e, t[8], 20, 1163531501), e = qA(e, r, a, A, t[13], 5, -1444681467), A = qA(A, e, r, a, t[2], 9, -51403784), a = qA(a, A, e, r, t[7], 14, 1735328473), e = jA(e, r = qA(r, a, A, e, t[12], 20, -1926607734), a, A, t[5], 4, -378558), A = jA(A, e, r, a, t[8], 11, -2022574463), a = jA(a, A, e, r, t[11], 16, 1839030562), r = jA(r, a, A, e, t[14], 23, -35309556), e = jA(e, r, a, A, t[1], 4, -1530992060), A = jA(A, e, r, a, t[4], 11, 1272893353), a = jA(a, A, e, r, t[7], 16, -155497632), r = jA(r, a, A, e, t[10], 23, -1094730640), e = jA(e, r, a, A, t[13], 4, 681279174), A = jA(A, e, r, a, t[0], 11, -358537222), a = jA(a, A, e, r, t[3], 16, -722521979), r = jA(r, a, A, e, t[6], 23, 76029189), e = jA(e, r, a, A, t[9], 4, -640364487), A = jA(A, e, r, a, t[12], 11, -421815835), a = jA(a, A, e, r, t[15], 16, 530742520), e = YA(e, r = jA(r, a, A, e, t[2], 23, -995338651), a, A, t[0], 6, -198630844), A = YA(A, e, r, a, t[7], 10, 1126891415), a = YA(a, A, e, r, t[14], 15, -1416354905), r = YA(r, a, A, e, t[5], 21, -57434055), e = YA(e, r, a, A, t[12], 6, 1700485571), A = YA(A, e, r, a, t[3], 10, -1894986606), a = YA(a, A, e, r, t[10], 15, -1051523), r = YA(r, a, A, e, t[1], 21, -2054922799), e = YA(e, r, a, A, t[8], 6, 1873313359), A = YA(A, e, r, a, t[15], 10, -30611744), a = YA(a, A, e, r, t[6], 15, -1560198380), r = YA(r, a, A, e, t[13], 21, 1309151649), e = YA(e, r, a, A, t[4], 6, -145523070), A = YA(A, e, r, a, t[11], 10, -1120210379), a = YA(a, A, e, r, t[2], 15, 718787259), r = YA(r, a, A, e, t[9], 21, -343485551), n[0] = Uo(e, n[0]), n[1] = Uo(r, n[1]), n[2] = Uo(a, n[2]), n[3] = Uo(A, n[3]);
}
function qd(n, t, e, r, a, A) {
  return t = Uo(Uo(t, n), Uo(r, A)), Uo(t << a | t >>> 32 - a, e);
}
function VA(n, t, e, r, a, A, i) {
  return qd(t & e | ~t & r, n, t, a, A, i);
}
function qA(n, t, e, r, a, A, i) {
  return qd(t & r | e & ~r, n, t, a, A, i);
}
function jA(n, t, e, r, a, A, i) {
  return qd(t ^ e ^ r, n, t, a, A, i);
}
function YA(n, t, e, r, a, A, i) {
  return qd(e ^ (t | ~r), n, t, a, A, i);
}
function AC(n) {
  var t, e = n.length, r = [1732584193, -271733879, -1732584194, 271733878];
  for (t = 64; t <= n.length; t += 64) jf(r, F6(n.substring(t - 64, t)));
  n = n.substring(t - 64);
  var a = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
  for (t = 0; t < n.length; t++) a[t >> 2] |= n.charCodeAt(t) << (t % 4 << 3);
  if (a[t >> 2] |= 128 << (t % 4 << 3), t > 55) for (jf(r, a), t = 0; t < 16; t++) a[t] = 0;
  return a[14] = 8 * e, jf(r, a), r;
}
function F6(n) {
  var t, e = [];
  for (t = 0; t < 64; t += 4) e[t >> 2] = n.charCodeAt(t) + (n.charCodeAt(t + 1) << 8) + (n.charCodeAt(t + 2) << 16) + (n.charCodeAt(t + 3) << 24);
  return e;
}
var V1 = "0123456789abcdef".split("");
function U6(n) {
  for (var t = "", e = 0; e < 4; e++) t += V1[n >> 8 * e + 4 & 15] + V1[n >> 8 * e & 15];
  return t;
}
function L6(n) {
  return String.fromCharCode(255 & n, (65280 & n) >> 8, (16711680 & n) >> 16, (4278190080 & n) >> 24);
}
function bp(n) {
  return AC(n).map(L6).join("");
}
var I6 = (function(n) {
  for (var t = 0; t < n.length; t++) n[t] = U6(n[t]);
  return n.join("");
})(AC("hello")) != "5d41402abc4b2a76b9719d911017c592";
function Uo(n, t) {
  if (I6) {
    var e = (65535 & n) + (65535 & t);
    return (n >> 16) + (t >> 16) + (e >> 16) << 16 | 65535 & e;
  }
  return n + t & 4294967295;
}
/**
 * @license
 * FPDF is released under a permissive license: there is no usage restriction.
 * You may embed it freely in your application (commercial or not), with or
 * without modifications.
 *
 * Reference: http://www.fpdf.org/en/script/script37.php
 */
function Cp(n, t) {
  var e, r, a, A;
  if (n !== e) {
    for (var i = (a = n, A = 1 + (256 / n.length | 0), new Array(A + 1).join(a)), s = [], o = 0; o < 256; o++) s[o] = o;
    var l = 0;
    for (o = 0; o < 256; o++) {
      var u = s[o];
      l = (l + u + i.charCodeAt(o)) % 256, s[o] = s[l], s[l] = u;
    }
    e = n, r = s;
  } else s = r;
  var f = t.length, h = 0, c = 0, p = "";
  for (o = 0; o < f; o++) c = (c + (u = s[h = (h + 1) % 256])) % 256, s[h] = s[c], s[c] = u, i = s[(s[h] + s[c]) % 256], p += String.fromCharCode(t.charCodeAt(o) ^ i);
  return p;
}
/**
 * @license
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 * Author: Owen Leong (@owenl131)
 * Date: 15 Oct 2020
 * References:
 * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
 * https://github.com/foliojs/pdfkit/blob/master/lib/security.js
 * http://www.fpdf.org/en/script/script37.php
 */
var q1 = { print: 4, modify: 8, copy: 16, "annot-forms": 32 };
function Ml(n, t, e, r) {
  this.v = 1, this.r = 2;
  var a = 192;
  n.forEach(function(s) {
    if (q1.perm !== void 0) throw new Error("Invalid permission: " + s);
    a += q1[s];
  }), this.padding = "(¿N^NuŠAd\0NVÿú\b..\0¶Ðh>€/\f©þdSiz";
  var A = (t + this.padding).substr(0, 32), i = (e + this.padding).substr(0, 32);
  this.O = this.processOwnerPassword(A, i), this.P = -(1 + (255 ^ a)), this.encryptionKey = bp(A + this.O + this.lsbFirstWord(this.P) + this.hexToBytes(r)).substr(0, 5), this.U = Cp(this.encryptionKey, this.padding);
}
function _l(n) {
  if (/[^\u0000-\u00ff]/.test(n)) throw new Error("Invalid PDF Name Object: " + n + ", Only accept ASCII characters.");
  for (var t = "", e = n.length, r = 0; r < e; r++) {
    var a = n.charCodeAt(r);
    t += a < 33 || a === 35 || a === 37 || a === 40 || a === 41 || a === 47 || a === 60 || a === 62 || a === 91 || a === 93 || a === 123 || a === 125 || a > 126 ? "#" + ("0" + a.toString(16)).slice(-2) : n[r];
  }
  return t;
}
function j1(n) {
  if (In(n) !== "object") throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");
  var t = {};
  this.subscribe = function(e, r, a) {
    if (a = a || !1, typeof e != "string" || typeof r != "function" || typeof a != "boolean") throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");
    t.hasOwnProperty(e) || (t[e] = {});
    var A = Math.random().toString(35);
    return t[e][A] = [r, !!a], A;
  }, this.unsubscribe = function(e) {
    for (var r in t) if (t[r][e]) return delete t[r][e], Object.keys(t[r]).length === 0 && delete t[r], !0;
    return !1;
  }, this.publish = function(e) {
    if (t.hasOwnProperty(e)) {
      var r = Array.prototype.slice.call(arguments, 1), a = [];
      for (var A in t[e]) {
        var i = t[e][A];
        try {
          i[0].apply(n, r);
        } catch (s) {
          Nr.console && Xn.error("jsPDF PubSub Error", s.message, s);
        }
        i[1] && a.push(A);
      }
      a.length && a.forEach(this.unsubscribe);
    }
  }, this.getTopics = function() {
    return t;
  };
}
function Ld(n) {
  if (!(this instanceof Ld)) return new Ld(n);
  var t = "opacity,stroke-opacity".split(",");
  for (var e in n) n.hasOwnProperty(e) && t.indexOf(e) >= 0 && (this[e] = n[e]);
  this.id = "", this.objectNumber = -1;
}
function sC(n, t) {
  this.gState = n, this.matrix = t, this.id = "", this.objectNumber = -1;
}
function el(n, t, e, r, a) {
  if (!(this instanceof el)) return new el(n, t, e, r, a);
  this.type = n === "axial" ? 2 : 3, this.coords = t, this.colors = e, sC.call(this, r, a);
}
function Pl(n, t, e, r, a) {
  if (!(this instanceof Pl)) return new Pl(n, t, e, r, a);
  this.boundingBox = n, this.xStep = t, this.yStep = e, this.stream = "", this.cloneIndex = 0, sC.call(this, r, a);
}
function kr(n) {
  var t, e = typeof arguments[0] == "string" ? arguments[0] : "p", r = arguments[1], a = arguments[2], A = arguments[3], i = [], s = 1, o = 16, l = "S", u = null;
  In(n = n || {}) === "object" && (e = n.orientation, r = n.unit || r, a = n.format || a, A = n.compress || n.compressPdf || A, (u = n.encryption || null) !== null && (u.userPassword = u.userPassword || "", u.ownerPassword = u.ownerPassword || "", u.userPermissions = u.userPermissions || []), s = typeof n.userUnit == "number" ? Math.abs(n.userUnit) : 1, n.precision !== void 0 && (t = n.precision), n.floatPrecision !== void 0 && (o = n.floatPrecision), l = n.defaultPathOperation || "S"), i = n.filters || (A === !0 ? ["FlateEncode"] : i), r = r || "mm", e = ("" + (e || "P")).toLowerCase();
  var f = n.putOnlyUsedFonts || !1, h = {}, c = { internal: {}, __private__: {} };
  c.__private__.PubSub = j1;
  var p = "1.3", w = c.__private__.getPdfVersion = function() {
    return p;
  };
  c.__private__.setPdfVersion = function(v) {
    p = v;
  };
  var y = { a0: [2383.94, 3370.39], a1: [1683.78, 2383.94], a2: [1190.55, 1683.78], a3: [841.89, 1190.55], a4: [595.28, 841.89], a5: [419.53, 595.28], a6: [297.64, 419.53], a7: [209.76, 297.64], a8: [147.4, 209.76], a9: [104.88, 147.4], a10: [73.7, 104.88], b0: [2834.65, 4008.19], b1: [2004.09, 2834.65], b2: [1417.32, 2004.09], b3: [1000.63, 1417.32], b4: [708.66, 1000.63], b5: [498.9, 708.66], b6: [354.33, 498.9], b7: [249.45, 354.33], b8: [175.75, 249.45], b9: [124.72, 175.75], b10: [87.87, 124.72], c0: [2599.37, 3676.54], c1: [1836.85, 2599.37], c2: [1298.27, 1836.85], c3: [918.43, 1298.27], c4: [649.13, 918.43], c5: [459.21, 649.13], c6: [323.15, 459.21], c7: [229.61, 323.15], c8: [161.57, 229.61], c9: [113.39, 161.57], c10: [79.37, 113.39], dl: [311.81, 623.62], letter: [612, 792], "government-letter": [576, 756], legal: [612, 1008], "junior-legal": [576, 360], ledger: [1224, 792], tabloid: [792, 1224], "credit-card": [153, 243] };
  c.__private__.getPageFormats = function() {
    return y;
  };
  var m = c.__private__.getPageFormat = function(v) {
    return y[v];
  };
  a = a || "a4";
  var k = "compat", D = "advanced", B = k;
  function O() {
    this.saveGraphicsState(), ne(new jt(pt, 0, 0, -pt, 0, tt() * pt).toString() + " cm"), this.setFontSize(this.getFontSize() / pt), l = "n", B = D;
  }
  function q() {
    this.restoreGraphicsState(), l = "S", B = k;
  }
  var G = c.__private__.combineFontStyleAndFontWeight = function(v, L) {
    if (v == "bold" && L == "normal" || v == "bold" && L == 400 || v == "normal" && L == "italic" || v == "bold" && L == "italic") throw new Error("Invalid Combination of fontweight and fontstyle");
    return L && (v = L == 400 || L === "normal" ? v === "italic" ? "italic" : "normal" : L != 700 && L !== "bold" || v !== "normal" ? (L == 700 ? "bold" : L) + "" + v : "bold"), v;
  };
  c.advancedAPI = function(v) {
    var L = B === k;
    return L && O.call(this), typeof v != "function" || (v(this), L && q.call(this)), this;
  }, c.compatAPI = function(v) {
    var L = B === D;
    return L && q.call(this), typeof v != "function" || (v(this), L && O.call(this)), this;
  }, c.isAdvancedAPI = function() {
    return B === D;
  };
  var W, F = function(v) {
    if (B !== D) throw new Error(v + " is only available in 'advanced' API mode. You need to call advancedAPI() first.");
  }, Y = c.roundToPrecision = c.__private__.roundToPrecision = function(v, L) {
    var j = t || L;
    if (isNaN(v) || isNaN(j)) throw new Error("Invalid argument passed to jsPDF.roundToPrecision");
    return v.toFixed(j).replace(/0+$/, "");
  };
  W = c.hpf = c.__private__.hpf = typeof o == "number" ? function(v) {
    if (isNaN(v)) throw new Error("Invalid argument passed to jsPDF.hpf");
    return Y(v, o);
  } : o === "smart" ? function(v) {
    if (isNaN(v)) throw new Error("Invalid argument passed to jsPDF.hpf");
    return Y(v, v > -1 && v < 1 ? 16 : 5);
  } : function(v) {
    if (isNaN(v)) throw new Error("Invalid argument passed to jsPDF.hpf");
    return Y(v, 16);
  };
  var T = c.f2 = c.__private__.f2 = function(v) {
    if (isNaN(v)) throw new Error("Invalid argument passed to jsPDF.f2");
    return Y(v, 2);
  }, E = c.__private__.f3 = function(v) {
    if (isNaN(v)) throw new Error("Invalid argument passed to jsPDF.f3");
    return Y(v, 3);
  }, Q = c.scale = c.__private__.scale = function(v) {
    if (isNaN(v)) throw new Error("Invalid argument passed to jsPDF.scale");
    return B === k ? v * pt : B === D ? v : void 0;
  }, x = function(v) {
    return Q((function(L) {
      return B === k ? tt() - L : B === D ? L : void 0;
    })(v));
  };
  c.__private__.setPrecision = c.setPrecision = function(v) {
    typeof parseInt(v, 10) == "number" && (t = parseInt(v, 10));
  };
  var oe, J = "00000000000000000000000000000000", S = c.__private__.getFileId = function() {
    return J;
  }, I = c.__private__.setFileId = function(v) {
    return J = v !== void 0 && /^[a-fA-F0-9]{32}$/.test(v) ? v.toUpperCase() : J.split("").map(function() {
      return "ABCDEF0123456789".charAt(Math.floor(16 * Math.random()));
    }).join(""), u !== null && (ea = new Ml(u.userPermissions, u.userPassword, u.ownerPassword, J)), J;
  };
  c.setFileId = function(v) {
    return I(v), this;
  }, c.getFileId = function() {
    return S();
  };
  var N = c.__private__.convertDateToPDFDate = function(v) {
    var L = v.getTimezoneOffset(), j = L < 0 ? "+" : "-", ae = Math.floor(Math.abs(L / 60)), pe = Math.abs(L % 60), Oe = [j, M(ae), "'", M(pe), "'"].join("");
    return ["D:", v.getFullYear(), M(v.getMonth() + 1), M(v.getDate()), M(v.getHours()), M(v.getMinutes()), M(v.getSeconds()), Oe].join("");
  }, se = c.__private__.convertPDFDateToDate = function(v) {
    var L = parseInt(v.substr(2, 4), 10), j = parseInt(v.substr(6, 2), 10) - 1, ae = parseInt(v.substr(8, 2), 10), pe = parseInt(v.substr(10, 2), 10), Oe = parseInt(v.substr(12, 2), 10), Pe = parseInt(v.substr(14, 2), 10);
    return new Date(L, j, ae, pe, Oe, Pe, 0);
  }, Z = c.__private__.setCreationDate = function(v) {
    var L;
    if (v === void 0 && (v = /* @__PURE__ */ new Date()), v instanceof Date) L = N(v);
    else {
      if (!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(v)) throw new Error("Invalid argument passed to jsPDF.setCreationDate");
      L = v;
    }
    return oe = L;
  }, C = c.__private__.getCreationDate = function(v) {
    var L = oe;
    return v === "jsDate" && (L = se(oe)), L;
  };
  c.setCreationDate = function(v) {
    return Z(v), this;
  }, c.getCreationDate = function(v) {
    return C(v);
  };
  var H, M = c.__private__.padd2 = function(v) {
    return ("0" + parseInt(v)).slice(-2);
  }, te = c.__private__.padd2Hex = function(v) {
    return ("00" + (v = v.toString())).substr(v.length);
  }, ie = 0, we = [], ve = [], le = 0, _e = [], De = [], ze = !1, nt = ve;
  c.__private__.setCustomOutputDestination = function(v) {
    ze = !0, nt = v;
  };
  var Qe = function(v) {
    ze || (nt = v);
  };
  c.__private__.resetCustomOutputDestination = function() {
    ze = !1, nt = ve;
  };
  var ne = c.__private__.out = function(v) {
    return v = v.toString(), le += v.length + 1, nt.push(v), nt;
  }, gt = c.__private__.write = function(v) {
    return ne(arguments.length === 1 ? v.toString() : Array.prototype.join.call(arguments, " "));
  }, je = c.__private__.getArrayBuffer = function(v) {
    for (var L = v.length, j = new ArrayBuffer(L), ae = new Uint8Array(j); L--; ) ae[L] = v.charCodeAt(L);
    return j;
  }, ot = [["Helvetica", "helvetica", "normal", "WinAnsiEncoding"], ["Helvetica-Bold", "helvetica", "bold", "WinAnsiEncoding"], ["Helvetica-Oblique", "helvetica", "italic", "WinAnsiEncoding"], ["Helvetica-BoldOblique", "helvetica", "bolditalic", "WinAnsiEncoding"], ["Courier", "courier", "normal", "WinAnsiEncoding"], ["Courier-Bold", "courier", "bold", "WinAnsiEncoding"], ["Courier-Oblique", "courier", "italic", "WinAnsiEncoding"], ["Courier-BoldOblique", "courier", "bolditalic", "WinAnsiEncoding"], ["Times-Roman", "times", "normal", "WinAnsiEncoding"], ["Times-Bold", "times", "bold", "WinAnsiEncoding"], ["Times-Italic", "times", "italic", "WinAnsiEncoding"], ["Times-BoldItalic", "times", "bolditalic", "WinAnsiEncoding"], ["ZapfDingbats", "zapfdingbats", "normal", null], ["Symbol", "symbol", "normal", null]];
  c.__private__.getStandardFonts = function() {
    return ot;
  };
  var Ie = n.fontSize || 16;
  c.__private__.setFontSize = c.setFontSize = function(v) {
    return Ie = B === D ? v / pt : v, this;
  };
  var It, dt = c.__private__.getFontSize = c.getFontSize = function() {
    return B === k ? Ie : Ie * pt;
  }, Dt = n.R2L || !1;
  c.__private__.setR2L = c.setR2L = function(v) {
    return Dt = v, this;
  }, c.__private__.getR2L = c.getR2L = function() {
    return Dt;
  };
  var Ct, Ve = c.__private__.setZoomMode = function(v) {
    if (/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(v)) It = v;
    else if (isNaN(v)) {
      if ([void 0, null, "fullwidth", "fullheight", "fullpage", "original"].indexOf(v) === -1) throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "' + v + '" is not recognized.');
      It = v;
    } else It = parseInt(v, 10);
  };
  c.__private__.getZoomMode = function() {
    return It;
  };
  var ht, K = c.__private__.setPageMode = function(v) {
    if ([void 0, null, "UseNone", "UseOutlines", "UseThumbs", "FullScreen"].indexOf(v) == -1) throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "' + v + '" is not recognized.');
    Ct = v;
  };
  c.__private__.getPageMode = function() {
    return Ct;
  };
  var X = c.__private__.setLayoutMode = function(v) {
    if ([void 0, null, "continuous", "single", "twoleft", "tworight", "two"].indexOf(v) == -1) throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "' + v + '" is not recognized.');
    ht = v;
  };
  c.__private__.getLayoutMode = function() {
    return ht;
  }, c.__private__.setDisplayMode = c.setDisplayMode = function(v, L, j) {
    return Ve(v), X(L), K(j), this;
  };
  var ke = { title: "", subject: "", author: "", keywords: "", creator: "" };
  c.__private__.getDocumentProperty = function(v) {
    if (Object.keys(ke).indexOf(v) === -1) throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");
    return ke[v];
  }, c.__private__.getDocumentProperties = function() {
    return ke;
  }, c.__private__.setDocumentProperties = c.setProperties = c.setDocumentProperties = function(v) {
    for (var L in ke) ke.hasOwnProperty(L) && v[L] && (ke[L] = v[L]);
    return this;
  }, c.__private__.setDocumentProperty = function(v, L) {
    if (Object.keys(ke).indexOf(v) === -1) throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");
    return ke[v] = L;
  };
  var Je, pt, Xe, Ye, Kt, it = {}, qt = {}, hr = [], Nt = {}, xr = {}, Jt = {}, lr = {}, Fr = null, er = 0, Ar = [], Ge = new j1(c), rt = n.hotfixes || [], yt = {}, Ot = {}, vr = [], jt = function v(L, j, ae, pe, Oe, Pe) {
    if (!(this instanceof v)) return new v(L, j, ae, pe, Oe, Pe);
    isNaN(L) && (L = 1), isNaN(j) && (j = 0), isNaN(ae) && (ae = 0), isNaN(pe) && (pe = 1), isNaN(Oe) && (Oe = 0), isNaN(Pe) && (Pe = 0), this._matrix = [L, j, ae, pe, Oe, Pe];
  };
  Object.defineProperty(jt.prototype, "sx", { get: function() {
    return this._matrix[0];
  }, set: function(v) {
    this._matrix[0] = v;
  } }), Object.defineProperty(jt.prototype, "shy", { get: function() {
    return this._matrix[1];
  }, set: function(v) {
    this._matrix[1] = v;
  } }), Object.defineProperty(jt.prototype, "shx", { get: function() {
    return this._matrix[2];
  }, set: function(v) {
    this._matrix[2] = v;
  } }), Object.defineProperty(jt.prototype, "sy", { get: function() {
    return this._matrix[3];
  }, set: function(v) {
    this._matrix[3] = v;
  } }), Object.defineProperty(jt.prototype, "tx", { get: function() {
    return this._matrix[4];
  }, set: function(v) {
    this._matrix[4] = v;
  } }), Object.defineProperty(jt.prototype, "ty", { get: function() {
    return this._matrix[5];
  }, set: function(v) {
    this._matrix[5] = v;
  } }), Object.defineProperty(jt.prototype, "a", { get: function() {
    return this._matrix[0];
  }, set: function(v) {
    this._matrix[0] = v;
  } }), Object.defineProperty(jt.prototype, "b", { get: function() {
    return this._matrix[1];
  }, set: function(v) {
    this._matrix[1] = v;
  } }), Object.defineProperty(jt.prototype, "c", { get: function() {
    return this._matrix[2];
  }, set: function(v) {
    this._matrix[2] = v;
  } }), Object.defineProperty(jt.prototype, "d", { get: function() {
    return this._matrix[3];
  }, set: function(v) {
    this._matrix[3] = v;
  } }), Object.defineProperty(jt.prototype, "e", { get: function() {
    return this._matrix[4];
  }, set: function(v) {
    this._matrix[4] = v;
  } }), Object.defineProperty(jt.prototype, "f", { get: function() {
    return this._matrix[5];
  }, set: function(v) {
    this._matrix[5] = v;
  } }), Object.defineProperty(jt.prototype, "rotation", { get: function() {
    return Math.atan2(this.shx, this.sx);
  } }), Object.defineProperty(jt.prototype, "scaleX", { get: function() {
    return this.decompose().scale.sx;
  } }), Object.defineProperty(jt.prototype, "scaleY", { get: function() {
    return this.decompose().scale.sy;
  } }), Object.defineProperty(jt.prototype, "isIdentity", { get: function() {
    return this.sx === 1 && this.shy === 0 && this.shx === 0 && this.sy === 1 && this.tx === 0 && this.ty === 0;
  } }), jt.prototype.join = function(v) {
    return [this.sx, this.shy, this.shx, this.sy, this.tx, this.ty].map(W).join(v);
  }, jt.prototype.multiply = function(v) {
    var L = v.sx * this.sx + v.shy * this.shx, j = v.sx * this.shy + v.shy * this.sy, ae = v.shx * this.sx + v.sy * this.shx, pe = v.shx * this.shy + v.sy * this.sy, Oe = v.tx * this.sx + v.ty * this.shx + this.tx, Pe = v.tx * this.shy + v.ty * this.sy + this.ty;
    return new jt(L, j, ae, pe, Oe, Pe);
  }, jt.prototype.decompose = function() {
    var v = this.sx, L = this.shy, j = this.shx, ae = this.sy, pe = this.tx, Oe = this.ty, Pe = Math.sqrt(v * v + L * L), mt = (v /= Pe) * j + (L /= Pe) * ae;
    j -= v * mt, ae -= L * mt;
    var Qt = Math.sqrt(j * j + ae * ae);
    return mt /= Qt, v * (ae /= Qt) < L * (j /= Qt) && (v = -v, L = -L, mt = -mt, Pe = -Pe), { scale: new jt(Pe, 0, 0, Qt, 0, 0), translate: new jt(1, 0, 0, 1, pe, Oe), rotate: new jt(v, L, -L, v, 0, 0), skew: new jt(1, 0, mt, 1, 0, 0) };
  }, jt.prototype.toString = function(v) {
    return this.join(" ");
  }, jt.prototype.inversed = function() {
    var v = this.sx, L = this.shy, j = this.shx, ae = this.sy, pe = this.tx, Oe = this.ty, Pe = 1 / (v * ae - L * j), mt = ae * Pe, Qt = -L * Pe, Rt = -j * Pe, cr = v * Pe;
    return new jt(mt, Qt, Rt, cr, -mt * pe - Rt * Oe, -Qt * pe - cr * Oe);
  }, jt.prototype.applyToPoint = function(v) {
    var L = v.x * this.sx + v.y * this.shx + this.tx, j = v.x * this.shy + v.y * this.sy + this.ty;
    return new Or(L, j);
  }, jt.prototype.applyToRectangle = function(v) {
    var L = this.applyToPoint(v), j = this.applyToPoint(new Or(v.x + v.w, v.y + v.h));
    return new Kr(L.x, L.y, j.x - L.x, j.y - L.y);
  }, jt.prototype.clone = function() {
    var v = this.sx, L = this.shy, j = this.shx, ae = this.sy, pe = this.tx, Oe = this.ty;
    return new jt(v, L, j, ae, pe, Oe);
  }, c.Matrix = jt;
  var br = c.matrixMult = function(v, L) {
    return L.multiply(v);
  }, on = new jt(1, 0, 0, 1, 0, 0);
  c.unitMatrix = c.identityMatrix = on;
  var an = function(v, L) {
    if (!xr[v]) {
      var j = (L instanceof el ? "Sh" : "P") + (Object.keys(Nt).length + 1).toString(10);
      L.id = j, xr[v] = j, Nt[j] = L, Ge.publish("addPattern", L);
    }
  };
  c.ShadingPattern = el, c.TilingPattern = Pl, c.addShadingPattern = function(v, L) {
    return F("addShadingPattern()"), an(v, L), this;
  }, c.beginTilingPattern = function(v) {
    F("beginTilingPattern()"), Er(v.boundingBox[0], v.boundingBox[1], v.boundingBox[2] - v.boundingBox[0], v.boundingBox[3] - v.boundingBox[1], v.matrix);
  }, c.endTilingPattern = function(v, L) {
    F("endTilingPattern()"), L.stream = De[H].join(`
`), an(v, L), Ge.publish("endTilingPattern", L), vr.pop().restore();
  };
  var xn, $r = c.__private__.newObject = function() {
    var v = pn();
    return Dn(v, !0), v;
  }, pn = c.__private__.newObjectDeferred = function() {
    return ie++, we[ie] = function() {
      return le;
    }, ie;
  }, Dn = function(v, L) {
    return L = typeof L == "boolean" && L, we[v] = le, L && ne(v + " 0 obj"), v;
  }, Ca = c.__private__.newAdditionalObject = function() {
    var v = { objId: pn(), content: "" };
    return _e.push(v), v;
  }, ka = pn(), Yn = pn(), zr = c.__private__.decodeColorString = function(v) {
    var L = v.split(" ");
    if (L.length !== 2 || L[1] !== "g" && L[1] !== "G") L.length !== 5 || L[4] !== "k" && L[4] !== "K" || (L = [(1 - L[0]) * (1 - L[3]), (1 - L[1]) * (1 - L[3]), (1 - L[2]) * (1 - L[3]), "r"]);
    else {
      var j = parseFloat(L[0]);
      L = [j, j, j, "r"];
    }
    for (var ae = "#", pe = 0; pe < 3; pe++) ae += ("0" + Math.floor(255 * parseFloat(L[pe])).toString(16)).slice(-2);
    return ae;
  }, Un = c.__private__.encodeColorString = function(v) {
    var L;
    typeof v == "string" && (v = { ch1: v });
    var j = v.ch1, ae = v.ch2, pe = v.ch3, Oe = v.ch4, Pe = v.pdfColorType === "draw" ? ["G", "RG", "K"] : ["g", "rg", "k"];
    if (typeof j == "string" && j.charAt(0) !== "#") {
      var mt = new aC(j);
      if (mt.ok) j = mt.toHex();
      else if (!/^\d*\.?\d*$/.test(j)) throw new Error('Invalid color "' + j + '" passed to jsPDF.encodeColorString.');
    }
    if (typeof j == "string" && /^#[0-9A-Fa-f]{3}$/.test(j) && (j = "#" + j[1] + j[1] + j[2] + j[2] + j[3] + j[3]), typeof j == "string" && /^#[0-9A-Fa-f]{6}$/.test(j)) {
      var Qt = parseInt(j.substr(1), 16);
      j = Qt >> 16 & 255, ae = Qt >> 8 & 255, pe = 255 & Qt;
    }
    if (ae === void 0 || Oe === void 0 && j === ae && ae === pe) L = typeof j == "string" ? j + " " + Pe[0] : v.precision === 2 ? T(j / 255) + " " + Pe[0] : E(j / 255) + " " + Pe[0];
    else if (Oe === void 0 || In(Oe) === "object") {
      if (Oe && !isNaN(Oe.a) && Oe.a === 0) return ["1.", "1.", "1.", Pe[1]].join(" ");
      L = typeof j == "string" ? [j, ae, pe, Pe[1]].join(" ") : v.precision === 2 ? [T(j / 255), T(ae / 255), T(pe / 255), Pe[1]].join(" ") : [E(j / 255), E(ae / 255), E(pe / 255), Pe[1]].join(" ");
    } else L = typeof j == "string" ? [j, ae, pe, Oe, Pe[2]].join(" ") : v.precision === 2 ? [T(j), T(ae), T(pe), T(Oe), Pe[2]].join(" ") : [E(j), E(ae), E(pe), E(Oe), Pe[2]].join(" ");
    return L;
  }, pa = c.__private__.getFilters = function() {
    return i;
  }, ma = c.__private__.putStream = function(v) {
    var L = (v = v || {}).data || "", j = v.filters || pa(), ae = v.alreadyAppliedFilters || [], pe = v.addLength1 || !1, Oe = L.length, Pe = v.objectId, mt = function(un) {
      return un;
    };
    if (u !== null && Pe === void 0) throw new Error("ObjectId must be passed to putStream for file encryption");
    u !== null && (mt = ea.encryptor(Pe, 0));
    var Qt = {};
    j === !0 && (j = ["FlateEncode"]);
    var Rt = v.additionalKeyValues || [], cr = (Qt = kr.API.processDataByFilters !== void 0 ? kr.API.processDataByFilters(L, j) : { data: L, reverseChain: [] }).reverseChain + (Array.isArray(ae) ? ae.join(" ") : ae.toString());
    if (Qt.data.length !== 0 && (Rt.push({ key: "Length", value: Qt.data.length }), pe === !0 && Rt.push({ key: "Length1", value: Oe })), cr.length != 0) if (cr.split("/").length - 1 == 1) Rt.push({ key: "Filter", value: cr });
    else {
      Rt.push({ key: "Filter", value: "[" + cr + "]" });
      for (var dr = 0; dr < Rt.length; dr += 1) if (Rt[dr].key === "DecodeParms") {
        for (var qr = [], _r = 0; _r < Qt.reverseChain.split("/").length - 1; _r += 1) qr.push("null");
        qr.push(Rt[dr].value), Rt[dr].value = "[" + qr.join(" ") + "]";
      }
    }
    ne("<<");
    for (var Pr = 0; Pr < Rt.length; Pr++) ne("/" + Rt[Pr].key + " " + Rt[Pr].value);
    ne(">>"), Qt.data.length !== 0 && (ne("stream"), ne(mt(Qt.data)), ne("endstream"));
  }, En = c.__private__.putPage = function(v) {
    var L = v.number, j = v.data, ae = v.objId, pe = v.contentsObjId;
    Dn(ae, !0), ne("<</Type /Page"), ne("/Parent " + v.rootDictionaryObjId + " 0 R"), ne("/Resources " + v.resourceDictionaryObjId + " 0 R"), ne("/MediaBox [" + parseFloat(W(v.mediaBox.bottomLeftX)) + " " + parseFloat(W(v.mediaBox.bottomLeftY)) + " " + W(v.mediaBox.topRightX) + " " + W(v.mediaBox.topRightY) + "]"), v.cropBox !== null && ne("/CropBox [" + W(v.cropBox.bottomLeftX) + " " + W(v.cropBox.bottomLeftY) + " " + W(v.cropBox.topRightX) + " " + W(v.cropBox.topRightY) + "]"), v.bleedBox !== null && ne("/BleedBox [" + W(v.bleedBox.bottomLeftX) + " " + W(v.bleedBox.bottomLeftY) + " " + W(v.bleedBox.topRightX) + " " + W(v.bleedBox.topRightY) + "]"), v.trimBox !== null && ne("/TrimBox [" + W(v.trimBox.bottomLeftX) + " " + W(v.trimBox.bottomLeftY) + " " + W(v.trimBox.topRightX) + " " + W(v.trimBox.topRightY) + "]"), v.artBox !== null && ne("/ArtBox [" + W(v.artBox.bottomLeftX) + " " + W(v.artBox.bottomLeftY) + " " + W(v.artBox.topRightX) + " " + W(v.artBox.topRightY) + "]"), typeof v.userUnit == "number" && v.userUnit !== 1 && ne("/UserUnit " + v.userUnit), Ge.publish("putPage", { objId: ae, pageContext: Ar[L], pageNumber: L, page: j }), ne("/Contents " + pe + " 0 R"), ne(">>"), ne("endobj");
    var Oe = j.join(`
`);
    return B === D && (Oe += `
Q`), Dn(pe, !0), ma({ data: Oe, filters: pa(), objectId: pe }), ne("endobj"), ae;
  }, Vn = c.__private__.putPages = function() {
    var v, L, j = [];
    for (v = 1; v <= er; v++) Ar[v].objId = pn(), Ar[v].contentsObjId = pn();
    for (v = 1; v <= er; v++) j.push(En({ number: v, data: De[v], objId: Ar[v].objId, contentsObjId: Ar[v].contentsObjId, mediaBox: Ar[v].mediaBox, cropBox: Ar[v].cropBox, bleedBox: Ar[v].bleedBox, trimBox: Ar[v].trimBox, artBox: Ar[v].artBox, userUnit: Ar[v].userUnit, rootDictionaryObjId: ka, resourceDictionaryObjId: Yn }));
    Dn(ka, !0), ne("<</Type /Pages");
    var ae = "/Kids [";
    for (L = 0; L < er; L++) ae += j[L] + " 0 R ";
    ne(ae + "]"), ne("/Count " + er), ne(">>"), ne("endobj"), Ge.publish("postPutPages");
  }, Xa = function(v) {
    Ge.publish("putFont", { font: v, out: ne, newObject: $r, putStream: ma }), v.isAlreadyPutted !== !0 && (v.objectNumber = $r(), ne("<<"), ne("/Type /Font"), ne("/BaseFont /" + _l(v.postScriptName)), ne("/Subtype /Type1"), typeof v.encoding == "string" && ne("/Encoding /" + v.encoding), ne("/FirstChar 32"), ne("/LastChar 255"), ne(">>"), ne("endobj"));
  }, oA = function(v) {
    v.objectNumber = $r();
    var L = [];
    L.push({ key: "Type", value: "/XObject" }), L.push({ key: "Subtype", value: "/Form" }), L.push({ key: "BBox", value: "[" + [W(v.x), W(v.y), W(v.x + v.width), W(v.y + v.height)].join(" ") + "]" }), L.push({ key: "Matrix", value: "[" + v.matrix.toString() + "]" });
    var j = v.pages[1].join(`
`);
    ma({ data: j, additionalKeyValues: L, objectId: v.objectNumber }), ne("endobj");
  }, Ta = function(v, L) {
    L || (L = 21);
    var j = $r(), ae = (function(Pe, mt) {
      var Qt, Rt = [], cr = 1 / (mt - 1);
      for (Qt = 0; Qt < 1; Qt += cr) Rt.push(Qt);
      if (Rt.push(1), Pe[0].offset != 0) {
        var dr = { offset: 0, color: Pe[0].color };
        Pe.unshift(dr);
      }
      if (Pe[Pe.length - 1].offset != 1) {
        var qr = { offset: 1, color: Pe[Pe.length - 1].color };
        Pe.push(qr);
      }
      for (var _r = "", Pr = 0, un = 0; un < Rt.length; un++) {
        for (Qt = Rt[un]; Qt > Pe[Pr + 1].offset; ) Pr++;
        var wr = Pe[Pr].offset, Wr = (Qt - wr) / (Pe[Pr + 1].offset - wr), mn = Pe[Pr].color, eA = Pe[Pr + 1].color;
        _r += te(Math.round((1 - Wr) * mn[0] + Wr * eA[0]).toString(16)) + te(Math.round((1 - Wr) * mn[1] + Wr * eA[1]).toString(16)) + te(Math.round((1 - Wr) * mn[2] + Wr * eA[2]).toString(16));
      }
      return _r.trim();
    })(v.colors, L), pe = [];
    pe.push({ key: "FunctionType", value: "0" }), pe.push({ key: "Domain", value: "[0.0 1.0]" }), pe.push({ key: "Size", value: "[" + L + "]" }), pe.push({ key: "BitsPerSample", value: "8" }), pe.push({ key: "Range", value: "[0.0 1.0 0.0 1.0 0.0 1.0]" }), pe.push({ key: "Decode", value: "[0.0 1.0 0.0 1.0 0.0 1.0]" }), ma({ data: ae, additionalKeyValues: pe, alreadyAppliedFilters: ["/ASCIIHexDecode"], objectId: j }), ne("endobj"), v.objectNumber = $r(), ne("<< /ShadingType " + v.type), ne("/ColorSpace /DeviceRGB");
    var Oe = "/Coords [" + W(parseFloat(v.coords[0])) + " " + W(parseFloat(v.coords[1])) + " ";
    v.type === 2 ? Oe += W(parseFloat(v.coords[2])) + " " + W(parseFloat(v.coords[3])) : Oe += W(parseFloat(v.coords[2])) + " " + W(parseFloat(v.coords[3])) + " " + W(parseFloat(v.coords[4])) + " " + W(parseFloat(v.coords[5])), ne(Oe += "]"), v.matrix && ne("/Matrix [" + v.matrix.toString() + "]"), ne("/Function " + j + " 0 R"), ne("/Extend [true true]"), ne(">>"), ne("endobj");
  }, ts = function(v, L) {
    var j = pn(), ae = $r();
    L.push({ resourcesOid: j, objectOid: ae }), v.objectNumber = ae;
    var pe = [];
    pe.push({ key: "Type", value: "/Pattern" }), pe.push({ key: "PatternType", value: "1" }), pe.push({ key: "PaintType", value: "1" }), pe.push({ key: "TilingType", value: "1" }), pe.push({ key: "BBox", value: "[" + v.boundingBox.map(W).join(" ") + "]" }), pe.push({ key: "XStep", value: W(v.xStep) }), pe.push({ key: "YStep", value: W(v.yStep) }), pe.push({ key: "Resources", value: j + " 0 R" }), v.matrix && pe.push({ key: "Matrix", value: "[" + v.matrix.toString() + "]" }), ma({ data: v.stream, additionalKeyValues: pe, objectId: v.objectNumber }), ne("endobj");
  }, Hs = function(v) {
    for (var L in v.objectNumber = $r(), ne("<<"), v) switch (L) {
      case "opacity":
        ne("/ca " + T(v[L]));
        break;
      case "stroke-opacity":
        ne("/CA " + T(v[L]));
    }
    ne(">>"), ne("endobj");
  }, sa = function(v) {
    Dn(v.resourcesOid, !0), ne("<<"), ne("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"), (function() {
      for (var L in ne("/Font <<"), it) it.hasOwnProperty(L) && (f === !1 || f === !0 && h.hasOwnProperty(L)) && ne("/" + L + " " + it[L].objectNumber + " 0 R");
      ne(">>");
    })(), (function() {
      if (Object.keys(Nt).length > 0) {
        for (var L in ne("/Shading <<"), Nt) Nt.hasOwnProperty(L) && Nt[L] instanceof el && Nt[L].objectNumber >= 0 && ne("/" + L + " " + Nt[L].objectNumber + " 0 R");
        Ge.publish("putShadingPatternDict"), ne(">>");
      }
    })(), (function(L) {
      if (Object.keys(Nt).length > 0) {
        for (var j in ne("/Pattern <<"), Nt) Nt.hasOwnProperty(j) && Nt[j] instanceof c.TilingPattern && Nt[j].objectNumber >= 0 && Nt[j].objectNumber < L && ne("/" + j + " " + Nt[j].objectNumber + " 0 R");
        Ge.publish("putTilingPatternDict"), ne(">>");
      }
    })(v.objectOid), (function() {
      if (Object.keys(Jt).length > 0) {
        var L;
        for (L in ne("/ExtGState <<"), Jt) Jt.hasOwnProperty(L) && Jt[L].objectNumber >= 0 && ne("/" + L + " " + Jt[L].objectNumber + " 0 R");
        Ge.publish("putGStateDict"), ne(">>");
      }
    })(), (function() {
      for (var L in ne("/XObject <<"), yt) yt.hasOwnProperty(L) && yt[L].objectNumber >= 0 && ne("/" + L + " " + yt[L].objectNumber + " 0 R");
      Ge.publish("putXobjectDict"), ne(">>");
    })(), ne(">>"), ne("endobj");
  }, rs = function(v) {
    qt[v.fontName] = qt[v.fontName] || {}, qt[v.fontName][v.fontStyle] = v.id;
  }, Jn = function(v, L, j, ae, pe) {
    var Oe = { id: "F" + (Object.keys(it).length + 1).toString(10), postScriptName: v, fontName: L, fontStyle: j, encoding: ae, isStandardFont: pe || !1, metadata: {} };
    return Ge.publish("addFont", { font: Oe, instance: this }), it[Oe.id] = Oe, rs(Oe), Oe.id;
  }, ia = c.__private__.pdfEscape = c.pdfEscape = function(v, L) {
    return (function(j, ae) {
      var pe, Oe, Pe, mt, Qt, Rt, cr, dr, qr;
      if (Pe = (ae = ae || {}).sourceEncoding || "Unicode", Qt = ae.outputEncoding, (ae.autoencode || Qt) && it[Je].metadata && it[Je].metadata[Pe] && it[Je].metadata[Pe].encoding && (mt = it[Je].metadata[Pe].encoding, !Qt && it[Je].encoding && (Qt = it[Je].encoding), !Qt && mt.codePages && (Qt = mt.codePages[0]), typeof Qt == "string" && (Qt = mt[Qt]), Qt)) {
        for (cr = !1, Rt = [], pe = 0, Oe = j.length; pe < Oe; pe++) (dr = Qt[j.charCodeAt(pe)]) ? Rt.push(String.fromCharCode(dr)) : Rt.push(j[pe]), Rt[pe].charCodeAt(0) >> 8 && (cr = !0);
        j = Rt.join("");
      }
      for (pe = j.length; cr === void 0 && pe !== 0; ) j.charCodeAt(pe - 1) >> 8 && (cr = !0), pe--;
      if (!cr) return j;
      for (Rt = ae.noBOM ? [] : [254, 255], pe = 0, Oe = j.length; pe < Oe; pe++) {
        if ((qr = (dr = j.charCodeAt(pe)) >> 8) >> 8) throw new Error("Character at position " + pe + " of string '" + j + "' exceeds 16bits. Cannot be encoded into UCS-2 BE");
        Rt.push(qr), Rt.push(dr - (qr << 8));
      }
      return String.fromCharCode.apply(void 0, Rt);
    })(v, L).replace(/\\/g, "\\\\").replace(/\(/g, "\\(").replace(/\)/g, "\\)");
  }, xa = c.__private__.beginPage = function(v) {
    De[++er] = [], Ar[er] = { objId: 0, contentsObjId: 0, userUnit: Number(s), artBox: null, bleedBox: null, cropBox: null, trimBox: null, mediaBox: { bottomLeftX: 0, bottomLeftY: 0, topRightX: Number(v[0]), topRightY: Number(v[1]) } }, Xr(er), Qe(De[H]);
  }, Bn = function(v, L) {
    var j, ae, pe;
    switch (e = L || e, typeof v == "string" && (j = m(v.toLowerCase()), Array.isArray(j) && (ae = j[0], pe = j[1])), Array.isArray(v) && (ae = v[0] * pt, pe = v[1] * pt), isNaN(ae) && (ae = a[0], pe = a[1]), (ae > 14400 || pe > 14400) && (Xn.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"), ae = Math.min(14400, ae), pe = Math.min(14400, pe)), a = [ae, pe], e.substr(0, 1)) {
      case "l":
        pe > ae && (a = [pe, ae]);
        break;
      case "p":
        ae > pe && (a = [pe, ae]);
    }
    xa(a), Xs(Dr), ne(Lt), fr !== 0 && ne(fr + " J"), or !== 0 && ne(or + " j"), Ge.publish("addPage", { pageNumber: er });
  }, Zn = function(v) {
    v > 0 && v <= er && (De.splice(v, 1), Ar.splice(v, 1), er--, H > er && (H = er), this.setPage(H));
  }, Xr = function(v) {
    v > 0 && v <= er && (H = v);
  }, wa = c.__private__.getNumberOfPages = c.getNumberOfPages = function() {
    return De.length - 1;
  }, Da = function(v, L, j) {
    var ae, pe = void 0;
    return j = j || {}, v = v !== void 0 ? v : it[Je].fontName, L = L !== void 0 ? L : it[Je].fontStyle, ae = v.toLowerCase(), qt[ae] !== void 0 && qt[ae][L] !== void 0 ? pe = qt[ae][L] : qt[v] !== void 0 && qt[v][L] !== void 0 ? pe = qt[v][L] : j.disableWarning === !1 && Xn.warn("Unable to look up font label for font '" + v + "', '" + L + "'. Refer to getFontList() for available fonts."), pe || j.noFallback || (pe = qt.times[L]) == null && (pe = qt.times.normal), pe;
  }, bn = c.__private__.putInfo = function() {
    var v = $r(), L = function(ae) {
      return ae;
    };
    for (var j in u !== null && (L = ea.encryptor(v, 0)), ne("<<"), ne("/Producer (" + ia(L("jsPDF " + kr.version)) + ")"), ke) ke.hasOwnProperty(j) && ke[j] && ne("/" + j.substr(0, 1).toUpperCase() + j.substr(1) + " (" + ia(L(ke[j])) + ")");
    ne("/CreationDate (" + ia(L(oe)) + ")"), ne(">>"), ne("endobj");
  }, ya = c.__private__.putCatalog = function(v) {
    var L = (v = v || {}).rootDictionaryObjId || ka;
    switch ($r(), ne("<<"), ne("/Type /Catalog"), ne("/Pages " + L + " 0 R"), It || (It = "fullwidth"), It) {
      case "fullwidth":
        ne("/OpenAction [3 0 R /FitH null]");
        break;
      case "fullheight":
        ne("/OpenAction [3 0 R /FitV null]");
        break;
      case "fullpage":
        ne("/OpenAction [3 0 R /Fit]");
        break;
      case "original":
        ne("/OpenAction [3 0 R /XYZ null null 1]");
        break;
      default:
        var j = "" + It;
        j.substr(j.length - 1) === "%" && (It = parseInt(It) / 100), typeof It == "number" && ne("/OpenAction [3 0 R /XYZ null null " + T(It) + "]");
    }
    switch (ht || (ht = "continuous"), ht) {
      case "continuous":
        ne("/PageLayout /OneColumn");
        break;
      case "single":
        ne("/PageLayout /SinglePage");
        break;
      case "two":
      case "twoleft":
        ne("/PageLayout /TwoColumnLeft");
        break;
      case "tworight":
        ne("/PageLayout /TwoColumnRight");
    }
    Ct && ne("/PageMode /" + Ct), Ge.publish("putCatalog"), ne(">>"), ne("endobj");
  }, Ea = c.__private__.putTrailer = function() {
    ne("trailer"), ne("<<"), ne("/Size " + (ie + 1)), ne("/Root " + ie + " 0 R"), ne("/Info " + (ie - 1) + " 0 R"), u !== null && ne("/Encrypt " + ea.oid + " 0 R"), ne("/ID [ <" + J + "> <" + J + "> ]"), ne(">>");
  }, Hr = c.__private__.putHeader = function() {
    ne("%PDF-" + p), ne("%ºß¬à");
  }, gA = c.__private__.putXRef = function() {
    var v = "0000000000";
    ne("xref"), ne("0 " + (ie + 1)), ne("0000000000 65535 f ");
    for (var L = 1; L <= ie; L++) typeof we[L] == "function" ? ne((v + we[L]()).slice(-10) + " 00000 n ") : we[L] !== void 0 ? ne((v + we[L]).slice(-10) + " 00000 n ") : ne("0000000000 00000 n ");
  }, vA = c.__private__.buildDocument = function() {
    var v;
    ie = 0, le = 0, ve = [], we = [], _e = [], ka = pn(), Yn = pn(), Qe(ve), Ge.publish("buildDocument"), Hr(), Vn(), (function() {
      Ge.publish("putAdditionalObjects");
      for (var j = 0; j < _e.length; j++) {
        var ae = _e[j];
        Dn(ae.objId, !0), ne(ae.content), ne("endobj");
      }
      Ge.publish("postPutAdditionalObjects");
    })(), v = [], (function() {
      for (var j in it) it.hasOwnProperty(j) && (f === !1 || f === !0 && h.hasOwnProperty(j)) && Xa(it[j]);
    })(), (function() {
      var j;
      for (j in Jt) Jt.hasOwnProperty(j) && Hs(Jt[j]);
    })(), (function() {
      for (var j in yt) yt.hasOwnProperty(j) && oA(yt[j]);
    })(), (function(j) {
      var ae;
      for (ae in Nt) Nt.hasOwnProperty(ae) && (Nt[ae] instanceof el ? Ta(Nt[ae]) : Nt[ae] instanceof Pl && ts(Nt[ae], j));
    })(v), Ge.publish("putResources"), v.forEach(sa), sa({ resourcesOid: Yn, objectOid: Number.MAX_SAFE_INTEGER }), Ge.publish("postPutResources"), u !== null && (ea.oid = $r(), ne("<<"), ne("/Filter /Standard"), ne("/V " + ea.v), ne("/R " + ea.r), ne("/U <" + ea.toHexString(ea.U) + ">"), ne("/O <" + ea.toHexString(ea.O) + ">"), ne("/P " + ea.P), ne(">>"), ne("endobj")), bn(), ya();
    var L = le;
    return gA(), Ea(), ne("startxref"), ne("" + L), ne("%%EOF"), Qe(De[H]), ve.join(`
`);
  }, pA = c.__private__.getBlob = function(v) {
    return new Blob([je(v)], { type: "application/pdf" });
  }, DA = function(v) {
    for (; v.firstChild; ) v.removeChild(v.firstChild);
  }, oa = function(v) {
    var L, j = v.document, ae = j.documentElement, pe = j.head, Oe = j.body;
    return pe || (pe = j.createElement("head"), ae.appendChild(pe)), Oe || (Oe = j.createElement("body"), ae.appendChild(Oe)), DA(pe), DA(Oe), (L = j.createElement("style")).appendChild(j.createTextNode("html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}")), pe.appendChild(L), { document: j, body: Oe };
  }, Ja = c.output = c.__private__.output = (xn = function(v, L) {
    switch (typeof (L = L || {}) == "string" ? L = { filename: L } : L.filename = L.filename || "generated.pdf", v) {
      case void 0:
        return vA();
      case "save":
        c.save(L.filename);
        break;
      case "arraybuffer":
        return je(vA());
      case "blob":
        return pA(vA());
      case "bloburi":
      case "bloburl":
        if (Nr.URL !== void 0 && typeof Nr.URL.createObjectURL == "function") return Nr.URL && Nr.URL.createObjectURL(pA(vA())) || void 0;
        Xn.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");
        break;
      case "datauristring":
      case "dataurlstring":
        var j = "", ae = vA();
        try {
          j = $1(ae);
        } catch {
          j = $1(unescape(encodeURIComponent(ae)));
        }
        return "data:application/pdf;filename=" + encodeURIComponent(L.filename) + ";base64," + j;
      case "pdfobjectnewwindow":
        if (Object.prototype.toString.call(Nr) === "[object Window]") {
          var pe = "https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js", Oe = !L.pdfObjectUrl;
          Oe || (pe = L.pdfObjectUrl);
          var Pe = Nr.open();
          if (Pe !== null) {
            var mt = oa(Pe), Qt = mt.document.createElement("script"), Rt = this;
            Qt.src = pe, Oe && (Qt.integrity = "sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==", Qt.crossOrigin = "anonymous"), Qt.onload = function() {
              Pe.PDFObject.embed(Rt.output("dataurlstring"), L);
            }, mt.body.appendChild(Qt);
          }
          return Pe;
        }
        throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");
      case "pdfjsnewwindow":
        if (Object.prototype.toString.call(Nr) === "[object Window]") {
          var cr = L.pdfJsUrl || "examples/PDF.js/web/viewer.html", dr = Nr.open();
          if (dr !== null) {
            var qr = oa(dr), _r = qr.document.createElement("iframe"), Pr = cr.indexOf("?") === -1 ? "?" : "&";
            Rt = this, _r.id = "pdfViewer", _r.width = "500px", _r.height = "400px", _r.src = cr + Pr + "file=&downloadName=" + encodeURIComponent(L.filename), _r.onload = function() {
              dr.document.title = L.filename, _r.contentWindow.PDFViewerApplication.open(Rt.output("bloburl"));
            }, qr.body.appendChild(_r);
          }
          return dr;
        }
        throw new Error("The option pdfjsnewwindow just works in a browser-environment.");
      case "dataurlnewwindow":
        if (Object.prototype.toString.call(Nr) !== "[object Window]") throw new Error("The option dataurlnewwindow just works in a browser-environment.");
        var un = Nr.open();
        if (un !== null) {
          var wr = oa(un), Wr = wr.document.createElement("iframe");
          Wr.src = this.output("datauristring", L), wr.body.appendChild(Wr), un.document.title = L.filename;
        }
        if (un || typeof safari > "u") return un;
        break;
      case "datauri":
      case "dataurl":
        return Nr.document.location.href = this.output("datauristring", L);
      default:
        return null;
    }
  }, xn.foo = function() {
    try {
      return xn.apply(this, arguments);
    } catch (j) {
      var v = j.stack || "";
      ~v.indexOf(" at ") && (v = v.split(" at ")[1]);
      var L = "Error in function " + v.split(`
`)[0].split("<")[0] + ": " + j.message;
      if (!Nr.console) throw new Error(L);
      Nr.console.error(L, j), Nr.alert && alert(L);
    }
  }, xn.foo.bar = xn, xn.foo), Za = function(v) {
    return Array.isArray(rt) === !0 && rt.indexOf(v) > -1;
  };
  switch (r) {
    case "pt":
      pt = 1;
      break;
    case "mm":
      pt = 72 / 25.4;
      break;
    case "cm":
      pt = 72 / 2.54;
      break;
    case "in":
      pt = 72;
      break;
    case "px":
      pt = Za("px_scaling") == 1 ? 0.75 : 96 / 72;
      break;
    case "pc":
    case "em":
      pt = 12;
      break;
    case "ex":
      pt = 6;
      break;
    default:
      if (typeof r != "number") throw new Error("Invalid unit: " + r);
      pt = r;
  }
  var ea = null;
  Z(), I();
  var fs = c.__private__.getPageInfo = c.getPageInfo = function(v) {
    if (isNaN(v) || v % 1 != 0) throw new Error("Invalid argument passed to jsPDF.getPageInfo");
    return { objId: Ar[v].objId, pageNumber: v, pageContext: Ar[v] };
  }, OA = c.__private__.getPageInfoByObjId = function(v) {
    if (isNaN(v) || v % 1 != 0) throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");
    for (var L in Ar) if (Ar[L].objId === v) break;
    return fs(L);
  }, Ha = c.__private__.getCurrentPageInfo = c.getCurrentPageInfo = function() {
    return { objId: Ar[H].objId, pageNumber: H, pageContext: Ar[H] };
  };
  c.addPage = function() {
    return Bn.apply(this, arguments), this;
  }, c.setPage = function() {
    return Xr.apply(this, arguments), Qe.call(this, De[H]), this;
  }, c.insertPage = function(v) {
    return this.addPage(), this.movePage(H, v), this;
  }, c.movePage = function(v, L) {
    var j, ae;
    if (v > L) {
      j = De[v], ae = Ar[v];
      for (var pe = v; pe > L; pe--) De[pe] = De[pe - 1], Ar[pe] = Ar[pe - 1];
      De[L] = j, Ar[L] = ae, this.setPage(L);
    } else if (v < L) {
      j = De[v], ae = Ar[v];
      for (var Oe = v; Oe < L; Oe++) De[Oe] = De[Oe + 1], Ar[Oe] = Ar[Oe + 1];
      De[L] = j, Ar[L] = ae, this.setPage(L);
    }
    return this;
  }, c.deletePage = function() {
    return Zn.apply(this, arguments), this;
  }, c.__private__.text = c.text = function(v, L, j, ae, pe) {
    var Oe, Pe, mt, Qt, Rt, cr, dr, qr, _r, Pr = (ae = ae || {}).scope || this;
    if (typeof v == "number" && typeof L == "number" && (typeof j == "string" || Array.isArray(j))) {
      var un = j;
      j = L, L = v, v = un;
    }
    if (arguments[3] instanceof jt == 0 ? (mt = arguments[4], Qt = arguments[5], In(dr = arguments[3]) === "object" && dr !== null || (typeof mt == "string" && (Qt = mt, mt = null), typeof dr == "string" && (Qt = dr, dr = null), typeof dr == "number" && (mt = dr, dr = null), ae = { flags: dr, angle: mt, align: Qt })) : (F("The transform parameter of text() with a Matrix value"), _r = pe), isNaN(L) || isNaN(j) || v == null) throw new Error("Invalid arguments passed to jsPDF.text");
    if (v.length === 0) return Pr;
    var wr, Wr = "", mn = typeof ae.lineHeightFactor == "number" ? ae.lineHeightFactor : hs, eA = Pr.internal.scaleFactor;
    function tA(Qn) {
      return Qn = Qn.split("	").join(Array(ae.TabLen || 9).join(" ")), ia(Qn, dr);
    }
    function jr(Qn) {
      for (var Wn, da = Qn.concat(), La = [], Ai = da.length; Ai--; ) typeof (Wn = da.shift()) == "string" ? La.push(Wn) : Array.isArray(Qn) && (Wn.length === 1 || Wn[1] === void 0 && Wn[2] === void 0) ? La.push(Wn[0]) : La.push([Wn[0], Wn[1], Wn[2]]);
      return La;
    }
    function cn(Qn, Wn) {
      var da;
      if (typeof Qn == "string") da = Wn(Qn)[0];
      else if (Array.isArray(Qn)) {
        for (var La, Ai, Wo = Qn.concat(), go = [], Ti = Wo.length; Ti--; ) typeof (La = Wo.shift()) == "string" ? go.push(Wn(La)[0]) : Array.isArray(La) && typeof La[0] == "string" && (Ai = Wn(La[0], La[1], La[2]), go.push([Ai[0], Ai[1], Ai[2]]));
        da = go;
      }
      return da;
    }
    var ta = !1, Oa = !0;
    if (typeof v == "string") ta = !0;
    else if (Array.isArray(v)) {
      var mA = v.concat();
      Pe = [];
      for (var rA, Sa = mA.length; Sa--; ) (typeof (rA = mA.shift()) != "string" || Array.isArray(rA) && typeof rA[0] != "string") && (Oa = !1);
      ta = Oa;
    }
    if (ta === !1) throw new Error('Type of text must be string or Array. "' + v + '" is not recognized.');
    typeof v == "string" && (v = v.match(/[\r?\n]/) ? v.split(/\r\n|\r|\n/g) : [v]);
    var Pa = Ie / Pr.internal.scaleFactor, lA = Pa * (mn - 1);
    switch (ae.baseline) {
      case "bottom":
        j -= lA;
        break;
      case "top":
        j += Pa - lA;
        break;
      case "hanging":
        j += Pa - 2 * lA;
        break;
      case "middle":
        j += Pa / 2 - lA;
    }
    if ((cr = ae.maxWidth || 0) > 0 && (typeof v == "string" ? v = Pr.splitTextToSize(v, cr) : Object.prototype.toString.call(v) === "[object Array]" && (v = v.reduce(function(Qn, Wn) {
      return Qn.concat(Pr.splitTextToSize(Wn, cr));
    }, []))), Oe = { text: v, x: L, y: j, options: ae, mutex: { pdfEscape: ia, activeFontKey: Je, fonts: it, activeFontSize: Ie } }, Ge.publish("preProcessText", Oe), v = Oe.text, mt = (ae = Oe.options).angle, _r instanceof jt == 0 && mt && typeof mt == "number") {
      mt *= Math.PI / 180, ae.rotationDirection === 0 && (mt = -mt), B === D && (mt = -mt);
      var Wi = Math.cos(mt), gs = Math.sin(mt);
      _r = new jt(Wi, gs, -gs, Wi, 0, 0);
    } else mt && mt instanceof jt && (_r = mt);
    B !== D || _r || (_r = on), (Rt = ae.charSpace || _t) !== void 0 && (Wr += W(Q(Rt)) + ` Tc
`, this.setCharSpace(this.getCharSpace() || 0)), (qr = ae.horizontalScale) !== void 0 && (Wr += W(100 * qr) + ` Tz
`), ae.lang;
    var Fa = -1, uo = ae.renderingMode !== void 0 ? ae.renderingMode : ae.stroke, Ci = Pr.internal.getCurrentPageInfo().pageContext;
    switch (uo) {
      case 0:
      case !1:
      case "fill":
        Fa = 0;
        break;
      case 1:
      case !0:
      case "stroke":
        Fa = 1;
        break;
      case 2:
      case "fillThenStroke":
        Fa = 2;
        break;
      case 3:
      case "invisible":
        Fa = 3;
        break;
      case 4:
      case "fillAndAddForClipping":
        Fa = 4;
        break;
      case 5:
      case "strokeAndAddPathForClipping":
        Fa = 5;
        break;
      case 6:
      case "fillThenStrokeAndAddToPathForClipping":
        Fa = 6;
        break;
      case 7:
      case "addToPathForClipping":
        Fa = 7;
    }
    var co = Ci.usedRenderingMode !== void 0 ? Ci.usedRenderingMode : -1;
    Fa !== -1 ? Wr += Fa + ` Tr
` : co !== -1 && (Wr += `0 Tr
`), Fa !== -1 && (Ci.usedRenderingMode = Fa), Qt = ae.align || "left";
    var vs, EA = Ie * mn, PA = Pr.internal.pageSize.getWidth(), Js = it[Je];
    Rt = ae.charSpace || _t, cr = ae.maxWidth || 0, dr = Object.assign({ autoencode: !0, noBOM: !0 }, ae.flags);
    var ki = [], fo = function(Qn) {
      return Pr.getStringUnitWidth(Qn, { font: Js, charSpace: Rt, fontSize: Ie, doKerning: !1 }) * Ie / eA;
    };
    if (Object.prototype.toString.call(v) === "[object Array]") {
      var wA;
      Pe = jr(v), Qt !== "left" && (vs = Pe.map(fo));
      var SA, Ki = 0;
      if (Qt === "right") {
        L -= vs[0], v = [], Sa = Pe.length;
        for (var Zs = 0; Zs < Sa; Zs++) Zs === 0 ? (SA = Re(L), wA = at(j)) : (SA = Q(Ki - vs[Zs]), wA = -EA), v.push([Pe[Zs], SA, wA]), Ki = vs[Zs];
      } else if (Qt === "center") {
        L -= vs[0] / 2, v = [], Sa = Pe.length;
        for (var ei = 0; ei < Sa; ei++) ei === 0 ? (SA = Re(L), wA = at(j)) : (SA = Q((Ki - vs[ei]) / 2), wA = -EA), v.push([Pe[ei], SA, wA]), Ki = vs[ei];
      } else if (Qt === "left") {
        v = [], Sa = Pe.length;
        for (var ho = 0; ho < Sa; ho++) v.push(Pe[ho]);
      } else if (Qt === "justify" && Js.encoding === "Identity-H") {
        v = [], Sa = Pe.length, cr = cr !== 0 ? cr : PA;
        for (var yA = 0, ca = 0; ca < Sa; ca++) if (wA = ca === 0 ? at(j) : -EA, SA = ca === 0 ? Re(L) : yA, ca < Sa - 1) {
          var ml = Q((cr - vs[ca]) / (Pe[ca].split(" ").length - 1)), ps = Pe[ca].split(" ");
          v.push([ps[0] + " ", SA, wA]), yA = 0;
          for (var ms = 1; ms < ps.length; ms++) {
            var Jr = (fo(ps[ms - 1] + " " + ps[ms]) - fo(ps[ms])) * eA + ml;
            ms == ps.length - 1 ? v.push([ps[ms], Jr, 0]) : v.push([ps[ms] + " ", Jr, 0]), yA -= Jr;
          }
        } else v.push([Pe[ca], SA, wA]);
        v.push(["", yA, 0]);
      } else {
        if (Qt !== "justify") throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');
        for (v = [], Sa = Pe.length, cr = cr !== 0 ? cr : PA, ca = 0; ca < Sa; ca++) {
          wA = ca === 0 ? at(j) : -EA, SA = ca === 0 ? Re(L) : 0;
          var Ua = Pe[ca].split(" ").length - 1, Ds = Ua > 0 ? (cr - vs[ca]) / Ua : 0;
          ca < Sa - 1 ? ki.push(W(Q(Ds))) : ki.push(0), v.push([Pe[ca], SA, wA]);
        }
      }
    }
    (typeof ae.R2L == "boolean" ? ae.R2L : Dt) === !0 && (v = cn(v, function(Qn, Wn, da) {
      return [Qn.split("").reverse().join(""), Wn, da];
    })), Oe = { text: v, x: L, y: j, options: ae, mutex: { pdfEscape: ia, activeFontKey: Je, fonts: it, activeFontSize: Ie } }, Ge.publish("postProcessText", Oe), v = Oe.text, wr = Oe.mutex.isHex || !1;
    var ti = it[Je].encoding;
    ti !== "WinAnsiEncoding" && ti !== "StandardEncoding" || (v = cn(v, function(Qn, Wn, da) {
      return [tA(Qn), Wn, da];
    })), Pe = jr(v), v = [];
    for (var Ps, $i, ri, ni = Array.isArray(Pe[0]) ? 1 : 0, Es = "", ai = function(Qn, Wn, da) {
      var La = "";
      return da instanceof jt ? (da = typeof ae.angle == "number" ? br(da, new jt(1, 0, 0, 1, Qn, Wn)) : br(new jt(1, 0, 0, 1, Qn, Wn), da), B === D && (da = br(new jt(1, 0, 0, -1, 0, 0), da)), La = da.join(" ") + ` Tm
`) : La = W(Qn) + " " + W(Wn) + ` Td
`, La;
    }, BA = 0; BA < Pe.length; BA++) {
      switch (Es = "", ni) {
        case 1:
          ri = (wr ? "<" : "(") + Pe[BA][0] + (wr ? ">" : ")"), Ps = parseFloat(Pe[BA][1]), $i = parseFloat(Pe[BA][2]);
          break;
        case 0:
          ri = (wr ? "<" : "(") + Pe[BA] + (wr ? ">" : ")"), Ps = Re(L), $i = at(j);
      }
      ki !== void 0 && ki[BA] !== void 0 && (Es = ki[BA] + ` Tw
`), BA === 0 ? v.push(Es + ai(Ps, $i, _r) + ri) : ni === 0 ? v.push(Es + ri) : ni === 1 && v.push(Es + ai(Ps, $i, _r) + ri);
    }
    v = ni === 0 ? v.join(` Tj
T* `) : v.join(` Tj
`), v += ` Tj
`;
    var Ss = `BT
/`;
    return Ss += Je + " " + Ie + ` Tf
`, Ss += W(Ie * mn) + ` TL
`, Ss += ct + `
`, Ss += Wr, Ss += v, ne(Ss += "ET"), h[Je] = !0, Pr;
  };
  var Wt = c.__private__.clip = c.clip = function(v) {
    return ne(v === "evenodd" ? "W*" : "W"), this;
  };
  c.clipEvenOdd = function() {
    return Wt("evenodd");
  }, c.__private__.discardPath = c.discardPath = function() {
    return ne("n"), this;
  };
  var fe = c.__private__.isValidStyle = function(v) {
    var L = !1;
    return [void 0, null, "S", "D", "F", "DF", "FD", "f", "f*", "B", "B*", "n"].indexOf(v) !== -1 && (L = !0), L;
  };
  c.__private__.setDefaultPathOperation = c.setDefaultPathOperation = function(v) {
    return fe(v) && (l = v), this;
  };
  var et = c.__private__.getStyle = c.getStyle = function(v) {
    var L = l;
    switch (v) {
      case "D":
      case "S":
        L = "S";
        break;
      case "F":
        L = "f";
        break;
      case "FD":
      case "DF":
        L = "B";
        break;
      case "f":
      case "f*":
      case "B":
      case "B*":
        L = v;
    }
    return L;
  }, ft = c.close = function() {
    return ne("h"), this;
  };
  c.stroke = function() {
    return ne("S"), this;
  }, c.fill = function(v) {
    return Yt("f", v), this;
  }, c.fillEvenOdd = function(v) {
    return Yt("f*", v), this;
  }, c.fillStroke = function(v) {
    return Yt("B", v), this;
  }, c.fillStrokeEvenOdd = function(v) {
    return Yt("B*", v), this;
  };
  var Yt = function(v, L) {
    In(L) === "object" ? rn(L, v) : ne(v);
  }, zt = function(v) {
    v === null || B === D && v === void 0 || (v = et(v), ne(v));
  };
  function gr(v, L, j, ae, pe) {
    var Oe = new Pl(L || this.boundingBox, j || this.xStep, ae || this.yStep, this.gState, pe || this.matrix);
    Oe.stream = this.stream;
    var Pe = v + "$$" + this.cloneIndex++ + "$$";
    return an(Pe, Oe), Oe;
  }
  var rn = function(v, L) {
    var j = xr[v.key], ae = Nt[j];
    if (ae instanceof el) ne("q"), ne(Gn(L)), ae.gState && c.setGState(ae.gState), ne(v.matrix.toString() + " cm"), ne("/" + j + " sh"), ne("Q");
    else if (ae instanceof Pl) {
      var pe = new jt(1, 0, 0, -1, 0, tt());
      v.matrix && (pe = pe.multiply(v.matrix || on), j = gr.call(ae, v.key, v.boundingBox, v.xStep, v.yStep, pe).id), ne("q"), ne("/Pattern cs"), ne("/" + j + " scn"), ae.gState && c.setGState(ae.gState), ne(L), ne("Q");
    }
  }, Gn = function(v) {
    switch (v) {
      case "f":
      case "F":
      case "n":
        return "W n";
      case "f*":
        return "W* n";
      case "B":
      case "S":
        return "W S";
      case "B*":
        return "W* S";
    }
  }, ln = c.moveTo = function(v, L) {
    return ne(W(Q(v)) + " " + W(x(L)) + " m"), this;
  }, Hn = c.lineTo = function(v, L) {
    return ne(W(Q(v)) + " " + W(x(L)) + " l"), this;
  }, Ln = c.curveTo = function(v, L, j, ae, pe, Oe) {
    return ne([W(Q(v)), W(x(L)), W(Q(j)), W(x(ae)), W(Q(pe)), W(x(Oe)), "c"].join(" ")), this;
  };
  c.__private__.line = c.line = function(v, L, j, ae, pe) {
    if (isNaN(v) || isNaN(L) || isNaN(j) || isNaN(ae) || !fe(pe)) throw new Error("Invalid arguments passed to jsPDF.line");
    return B === k ? this.lines([[j - v, ae - L]], v, L, [1, 1], pe || "S") : this.lines([[j - v, ae - L]], v, L, [1, 1]).stroke();
  }, c.__private__.lines = c.lines = function(v, L, j, ae, pe, Oe) {
    var Pe, mt, Qt, Rt, cr, dr, qr, _r, Pr, un, wr, Wr;
    if (typeof v == "number" && (Wr = j, j = L, L = v, v = Wr), ae = ae || [1, 1], Oe = Oe || !1, isNaN(L) || isNaN(j) || !Array.isArray(v) || !Array.isArray(ae) || !fe(pe) || typeof Oe != "boolean") throw new Error("Invalid arguments passed to jsPDF.lines");
    for (ln(L, j), Pe = ae[0], mt = ae[1], Rt = v.length, un = L, wr = j, Qt = 0; Qt < Rt; Qt++) (cr = v[Qt]).length === 2 ? (un = cr[0] * Pe + un, wr = cr[1] * mt + wr, Hn(un, wr)) : (dr = cr[0] * Pe + un, qr = cr[1] * mt + wr, _r = cr[2] * Pe + un, Pr = cr[3] * mt + wr, un = cr[4] * Pe + un, wr = cr[5] * mt + wr, Ln(dr, qr, _r, Pr, un, wr));
    return Oe && ft(), zt(pe), this;
  }, c.path = function(v) {
    for (var L = 0; L < v.length; L++) {
      var j = v[L], ae = j.c;
      switch (j.op) {
        case "m":
          ln(ae[0], ae[1]);
          break;
        case "l":
          Hn(ae[0], ae[1]);
          break;
        case "c":
          Ln.apply(this, ae);
          break;
        case "h":
          ft();
      }
    }
    return this;
  }, c.__private__.rect = c.rect = function(v, L, j, ae, pe) {
    if (isNaN(v) || isNaN(L) || isNaN(j) || isNaN(ae) || !fe(pe)) throw new Error("Invalid arguments passed to jsPDF.rect");
    return B === k && (ae = -ae), ne([W(Q(v)), W(x(L)), W(Q(j)), W(Q(ae)), "re"].join(" ")), zt(pe), this;
  }, c.__private__.triangle = c.triangle = function(v, L, j, ae, pe, Oe, Pe) {
    if (isNaN(v) || isNaN(L) || isNaN(j) || isNaN(ae) || isNaN(pe) || isNaN(Oe) || !fe(Pe)) throw new Error("Invalid arguments passed to jsPDF.triangle");
    return this.lines([[j - v, ae - L], [pe - j, Oe - ae], [v - pe, L - Oe]], v, L, [1, 1], Pe, !0), this;
  }, c.__private__.roundedRect = c.roundedRect = function(v, L, j, ae, pe, Oe, Pe) {
    if (isNaN(v) || isNaN(L) || isNaN(j) || isNaN(ae) || isNaN(pe) || isNaN(Oe) || !fe(Pe)) throw new Error("Invalid arguments passed to jsPDF.roundedRect");
    var mt = 4 / 3 * (Math.SQRT2 - 1);
    return pe = Math.min(pe, 0.5 * j), Oe = Math.min(Oe, 0.5 * ae), this.lines([[j - 2 * pe, 0], [pe * mt, 0, pe, Oe - Oe * mt, pe, Oe], [0, ae - 2 * Oe], [0, Oe * mt, -pe * mt, Oe, -pe, Oe], [2 * pe - j, 0], [-pe * mt, 0, -pe, -Oe * mt, -pe, -Oe], [0, 2 * Oe - ae], [0, -Oe * mt, pe * mt, -Oe, pe, -Oe]], v + pe, L, [1, 1], Pe, !0), this;
  }, c.__private__.ellipse = c.ellipse = function(v, L, j, ae, pe) {
    if (isNaN(v) || isNaN(L) || isNaN(j) || isNaN(ae) || !fe(pe)) throw new Error("Invalid arguments passed to jsPDF.ellipse");
    var Oe = 4 / 3 * (Math.SQRT2 - 1) * j, Pe = 4 / 3 * (Math.SQRT2 - 1) * ae;
    return ln(v + j, L), Ln(v + j, L - Pe, v + Oe, L - ae, v, L - ae), Ln(v - Oe, L - ae, v - j, L - Pe, v - j, L), Ln(v - j, L + Pe, v - Oe, L + ae, v, L + ae), Ln(v + Oe, L + ae, v + j, L + Pe, v + j, L), zt(pe), this;
  }, c.__private__.circle = c.circle = function(v, L, j, ae) {
    if (isNaN(v) || isNaN(L) || isNaN(j) || !fe(ae)) throw new Error("Invalid arguments passed to jsPDF.circle");
    return this.ellipse(v, L, j, j, ae);
  }, c.setFont = function(v, L, j) {
    return j && (L = G(L, j)), Je = Da(v, L, { disableWarning: !1 }), this;
  };
  var On = c.__private__.getFont = c.getFont = function() {
    return it[Da.apply(c, arguments)];
  };
  c.__private__.getFontList = c.getFontList = function() {
    var v, L, j = {};
    for (v in qt) if (qt.hasOwnProperty(v)) for (L in j[v] = [], qt[v]) qt[v].hasOwnProperty(L) && j[v].push(L);
    return j;
  }, c.addFont = function(v, L, j, ae, pe) {
    var Oe = ["StandardEncoding", "MacRomanEncoding", "Identity-H", "WinAnsiEncoding"];
    return arguments[3] && Oe.indexOf(arguments[3]) !== -1 ? pe = arguments[3] : arguments[3] && Oe.indexOf(arguments[3]) == -1 && (j = G(j, ae)), Jn.call(this, v, L, j, pe = pe || "Identity-H");
  };
  var hs, Dr = n.lineWidth || 0.200025, Pi = c.__private__.getLineWidth = c.getLineWidth = function() {
    return Dr;
  }, Xs = c.__private__.setLineWidth = c.setLineWidth = function(v) {
    return Dr = v, ne(W(Q(v)) + " w"), this;
  };
  c.__private__.setLineDash = kr.API.setLineDash = kr.API.setLineDashPattern = function(v, L) {
    if (v = v || [], L = L || 0, isNaN(L) || !Array.isArray(v)) throw new Error("Invalid arguments passed to jsPDF.setLineDash");
    return v = v.map(function(j) {
      return W(Q(j));
    }).join(" "), L = W(Q(L)), ne("[" + v + "] " + L + " d"), this;
  };
  var bi = c.__private__.getLineHeight = c.getLineHeight = function() {
    return Ie * hs;
  };
  c.__private__.getLineHeight = c.getLineHeight = function() {
    return Ie * hs;
  };
  var Os = c.__private__.setLineHeightFactor = c.setLineHeightFactor = function(v) {
    return typeof (v = v || 1.15) == "number" && (hs = v), this;
  }, ye = c.__private__.getLineHeightFactor = c.getLineHeightFactor = function() {
    return hs;
  };
  Os(n.lineHeight);
  var Re = c.__private__.getHorizontalCoordinate = function(v) {
    return Q(v);
  }, at = c.__private__.getVerticalCoordinate = function(v) {
    return B === D ? v : Ar[H].mediaBox.topRightY - Ar[H].mediaBox.bottomLeftY - Q(v);
  }, $e = c.__private__.getHorizontalCoordinateString = c.getHorizontalCoordinateString = function(v) {
    return W(Re(v));
  }, Tt = c.__private__.getVerticalCoordinateString = c.getVerticalCoordinateString = function(v) {
    return W(at(v));
  }, Lt = n.strokeColor || "0 G";
  c.__private__.getStrokeColor = c.getDrawColor = function() {
    return zr(Lt);
  }, c.__private__.setStrokeColor = c.setDrawColor = function(v, L, j, ae) {
    return Lt = Un({ ch1: v, ch2: L, ch3: j, ch4: ae, pdfColorType: "draw", precision: 2 }), ne(Lt), this;
  };
  var ut = n.fillColor || "0 g";
  c.__private__.getFillColor = c.getFillColor = function() {
    return zr(ut);
  }, c.__private__.setFillColor = c.setFillColor = function(v, L, j, ae) {
    return ut = Un({ ch1: v, ch2: L, ch3: j, ch4: ae, pdfColorType: "fill", precision: 2 }), ne(ut), this;
  };
  var ct = n.textColor || "0 g", Ut = c.__private__.getTextColor = c.getTextColor = function() {
    return zr(ct);
  };
  c.__private__.setTextColor = c.setTextColor = function(v, L, j, ae) {
    return ct = Un({ ch1: v, ch2: L, ch3: j, ch4: ae, pdfColorType: "text", precision: 3 }), this;
  };
  var _t = n.charSpace, Zt = c.__private__.getCharSpace = c.getCharSpace = function() {
    return parseFloat(_t || 0);
  };
  c.__private__.setCharSpace = c.setCharSpace = function(v) {
    if (isNaN(v)) throw new Error("Invalid argument passed to jsPDF.setCharSpace");
    return _t = v, this;
  };
  var fr = 0;
  c.CapJoinStyles = { 0: 0, butt: 0, but: 0, miter: 0, 1: 1, round: 1, rounded: 1, circle: 1, 2: 2, projecting: 2, project: 2, square: 2, bevel: 2 }, c.__private__.setLineCap = c.setLineCap = function(v) {
    var L = c.CapJoinStyles[v];
    if (L === void 0) throw new Error("Line cap style of '" + v + "' is not recognized. See or extend .CapJoinStyles property for valid styles");
    return fr = L, ne(L + " J"), this;
  };
  var or = 0;
  c.__private__.setLineJoin = c.setLineJoin = function(v) {
    var L = c.CapJoinStyles[v];
    if (L === void 0) throw new Error("Line join style of '" + v + "' is not recognized. See or extend .CapJoinStyles property for valid styles");
    return or = L, ne(L + " j"), this;
  }, c.__private__.setLineMiterLimit = c.__private__.setMiterLimit = c.setLineMiterLimit = c.setMiterLimit = function(v) {
    if (v = v || 0, isNaN(v)) throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");
    return ne(W(Q(v)) + " M"), this;
  }, c.GState = Ld, c.setGState = function(v) {
    (v = typeof v == "string" ? Jt[lr[v]] : ar(null, v)).equals(Fr) || (ne("/" + v.id + " gs"), Fr = v);
  };
  var ar = function(v, L) {
    if (!v || !lr[v]) {
      var j = !1;
      for (var ae in Jt) if (Jt.hasOwnProperty(ae) && Jt[ae].equals(L)) {
        j = !0;
        break;
      }
      if (j) L = Jt[ae];
      else {
        var pe = "GS" + (Object.keys(Jt).length + 1).toString(10);
        Jt[pe] = L, L.id = pe;
      }
      return v && (lr[v] = L.id), Ge.publish("addGState", L), L;
    }
  };
  c.addGState = function(v, L) {
    return ar(v, L), this;
  }, c.saveGraphicsState = function() {
    return ne("q"), hr.push({ key: Je, size: Ie, color: ct }), this;
  }, c.restoreGraphicsState = function() {
    ne("Q");
    var v = hr.pop();
    return Je = v.key, Ie = v.size, ct = v.color, Fr = null, this;
  }, c.setCurrentTransformationMatrix = function(v) {
    return ne(v.toString() + " cm"), this;
  }, c.comment = function(v) {
    return ne("#" + v), this;
  };
  var Or = function(v, L) {
    var j = v || 0;
    Object.defineProperty(this, "x", { enumerable: !0, get: function() {
      return j;
    }, set: function(Oe) {
      isNaN(Oe) || (j = parseFloat(Oe));
    } });
    var ae = L || 0;
    Object.defineProperty(this, "y", { enumerable: !0, get: function() {
      return ae;
    }, set: function(Oe) {
      isNaN(Oe) || (ae = parseFloat(Oe));
    } });
    var pe = "pt";
    return Object.defineProperty(this, "type", { enumerable: !0, get: function() {
      return pe;
    }, set: function(Oe) {
      pe = Oe.toString();
    } }), this;
  }, Kr = function(v, L, j, ae) {
    Or.call(this, v, L), this.type = "rect";
    var pe = j || 0;
    Object.defineProperty(this, "w", { enumerable: !0, get: function() {
      return pe;
    }, set: function(Pe) {
      isNaN(Pe) || (pe = parseFloat(Pe));
    } });
    var Oe = ae || 0;
    return Object.defineProperty(this, "h", { enumerable: !0, get: function() {
      return Oe;
    }, set: function(Pe) {
      isNaN(Pe) || (Oe = parseFloat(Pe));
    } }), this;
  }, sr = function() {
    this.page = er, this.currentPage = H, this.pages = De.slice(0), this.pagesContext = Ar.slice(0), this.x = Xe, this.y = Ye, this.matrix = Kt, this.width = Pn(H), this.height = Qr(H), this.outputDestination = nt, this.id = "", this.objectNumber = -1;
  };
  sr.prototype.restore = function() {
    er = this.page, H = this.currentPage, Ar = this.pagesContext, De = this.pages, Xe = this.x, Ye = this.y, Kt = this.matrix, Ur(H, this.width), P(H, this.height), nt = this.outputDestination;
  };
  var Er = function(v, L, j, ae, pe) {
    vr.push(new sr()), er = H = 0, De = [], Xe = v, Ye = L, Kt = pe, xa([j, ae]);
  };
  for (var nn in c.beginFormObject = function(v, L, j, ae, pe) {
    return Er(v, L, j, ae, pe), this;
  }, c.endFormObject = function(v) {
    return (function(L) {
      if (Ot[L]) vr.pop().restore();
      else {
        var j = new sr(), ae = "Xo" + (Object.keys(yt).length + 1).toString(10);
        j.id = ae, Ot[L] = ae, yt[ae] = j, Ge.publish("addFormObject", j), vr.pop().restore();
      }
    })(v), this;
  }, c.doFormObject = function(v, L) {
    var j = yt[Ot[v]];
    return ne("q"), ne(L.toString() + " cm"), ne("/" + j.id + " Do"), ne("Q"), this;
  }, c.getFormObject = function(v) {
    var L = yt[Ot[v]];
    return { x: L.x, y: L.y, width: L.width, height: L.height, matrix: L.matrix };
  }, c.save = function(v, L) {
    return v = v || "generated.pdf", (L = L || {}).returnPromise = L.returnPromise || !1, L.returnPromise === !1 ? (Jo(pA(vA()), v), typeof Jo.unload == "function" && Nr.setTimeout && setTimeout(Jo.unload, 911), this) : new Promise(function(j, ae) {
      try {
        var pe = Jo(pA(vA()), v);
        typeof Jo.unload == "function" && Nr.setTimeout && setTimeout(Jo.unload, 911), j(pe);
      } catch (Oe) {
        ae(Oe.message);
      }
    });
  }, kr.API) kr.API.hasOwnProperty(nn) && (nn === "events" && kr.API.events.length ? (function(v, L) {
    var j, ae, pe;
    for (pe = L.length - 1; pe !== -1; pe--) j = L[pe][0], ae = L[pe][1], v.subscribe.apply(v, [j].concat(typeof ae == "function" ? [ae] : ae));
  })(Ge, kr.API.events) : c[nn] = kr.API[nn]);
  function Pn(v) {
    return Ar[v].mediaBox.topRightX - Ar[v].mediaBox.bottomLeftX;
  }
  function Ur(v, L) {
    Ar[v].mediaBox.topRightX = L + Ar[v].mediaBox.bottomLeftX;
  }
  function Qr(v) {
    return Ar[v].mediaBox.topRightY - Ar[v].mediaBox.bottomLeftY;
  }
  function P(v, L) {
    Ar[v].mediaBox.topRightY = L + Ar[v].mediaBox.bottomLeftY;
  }
  var he = c.getPageWidth = function(v) {
    return Pn(v = v || H) / pt;
  }, Fe = c.setPageWidth = function(v, L) {
    Ur(v, L * pt);
  }, tt = c.getPageHeight = function(v) {
    return Qr(v = v || H) / pt;
  }, lt = c.setPageHeight = function(v, L) {
    P(v, L * pt);
  };
  return c.internal = { pdfEscape: ia, getStyle: et, getFont: On, getFontSize: dt, getCharSpace: Zt, getTextColor: Ut, getLineHeight: bi, getLineHeightFactor: ye, getLineWidth: Pi, write: gt, getHorizontalCoordinate: Re, getVerticalCoordinate: at, getCoordinateString: $e, getVerticalCoordinateString: Tt, collections: {}, newObject: $r, newAdditionalObject: Ca, newObjectDeferred: pn, newObjectDeferredBegin: Dn, getFilters: pa, putStream: ma, events: Ge, scaleFactor: pt, pageSize: { getWidth: function() {
    return he(H);
  }, setWidth: function(v) {
    Fe(H, v);
  }, getHeight: function() {
    return tt(H);
  }, setHeight: function(v) {
    lt(H, v);
  } }, encryptionOptions: u, encryption: ea, getEncryptor: function(v) {
    return u !== null ? ea.encryptor(v, 0) : function(L) {
      return L;
    };
  }, output: Ja, getNumberOfPages: wa, get pages() {
    return De;
  }, out: ne, f2: T, f3: E, getPageInfo: fs, getPageInfoByObjId: OA, getCurrentPageInfo: Ha, getPDFVersion: w, Point: Or, Rectangle: Kr, Matrix: jt, hasHotfix: Za }, Object.defineProperty(c.internal.pageSize, "width", { get: function() {
    return he(H);
  }, set: function(v) {
    Fe(H, v);
  }, enumerable: !0, configurable: !0 }), Object.defineProperty(c.internal.pageSize, "height", { get: function() {
    return tt(H);
  }, set: function(v) {
    lt(H, v);
  }, enumerable: !0, configurable: !0 }), (function(v) {
    for (var L = 0, j = ot.length; L < j; L++) {
      var ae = Jn.call(this, v[L][0], v[L][1], v[L][2], ot[L][3], !0);
      f === !1 && (h[ae] = !0);
      var pe = v[L][0].split("-");
      rs({ id: ae, fontName: pe[0], fontStyle: pe[1] || "" });
    }
    Ge.publish("addFonts", { fonts: it, dictionary: qt });
  }).call(c, ot), Je = "F1", Bn(a, e), Ge.publish("initialized"), c;
}
Ml.prototype.lsbFirstWord = function(n) {
  return String.fromCharCode(255 & n, n >> 8 & 255, n >> 16 & 255, n >> 24 & 255);
}, Ml.prototype.toHexString = function(n) {
  return n.split("").map(function(t) {
    return ("0" + (255 & t.charCodeAt(0)).toString(16)).slice(-2);
  }).join("");
}, Ml.prototype.hexToBytes = function(n) {
  for (var t = [], e = 0; e < n.length; e += 2) t.push(String.fromCharCode(parseInt(n.substr(e, 2), 16)));
  return t.join("");
}, Ml.prototype.processOwnerPassword = function(n, t) {
  return Cp(bp(t).substr(0, 5), n);
}, Ml.prototype.encryptor = function(n, t) {
  var e = bp(this.encryptionKey + String.fromCharCode(255 & n, n >> 8 & 255, n >> 16 & 255, 255 & t, t >> 8 & 255)).substr(0, 10);
  return function(r) {
    return Cp(e, r);
  };
}, Ld.prototype.equals = function(n) {
  var t, e = "id,objectNumber,equals";
  if (!n || In(n) !== In(this)) return !1;
  var r = 0;
  for (t in this) if (!(e.indexOf(t) >= 0)) {
    if (this.hasOwnProperty(t) && !n.hasOwnProperty(t) || this[t] !== n[t]) return !1;
    r++;
  }
  for (t in n) n.hasOwnProperty(t) && e.indexOf(t) < 0 && r--;
  return r === 0;
}, kr.API = { events: [] }, kr.version = "4.2.1";
var Ma = kr.API, C0 = 1, fl = function(n) {
  return n.replace(/\\/g, "\\\\").replace(/\(/g, "\\(").replace(/\)/g, "\\)");
}, Cl = function(n) {
  return n.replace(/\\\\/g, "\\").replace(/\\\(/g, "(").replace(/\\\)/g, ")");
}, cl = function(n) {
  return n.toString().replace(/#/g, "#23").replace(/[\s\n\r()<>[\]{}\/%]/g, function(t) {
    var e = t.charCodeAt(0).toString(16).toUpperCase();
    return "#" + (e.length === 1 ? "0" + e : e);
  });
}, Vr = function(n) {
  return n.toFixed(2);
}, Co = function(n) {
  return n.toFixed(5);
};
Ma.__acroform__ = {};
var Ts = function(n, t) {
  n.prototype = Object.create(t.prototype), n.prototype.constructor = n;
}, Y1 = function(n) {
  return n * C0;
}, Li = function(n) {
  var t = new oC(), e = mr.internal.getHeight(n) || 0, r = mr.internal.getWidth(n) || 0;
  return t.BBox = [0, 0, Number(Vr(r)), Number(Vr(e))], t;
}, Q6 = Ma.__acroform__.setBit = function(n, t) {
  if (n = n || 0, t = t || 0, isNaN(n) || isNaN(t)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");
  return n | 1 << t;
}, M6 = Ma.__acroform__.clearBit = function(n, t) {
  if (n = n || 0, t = t || 0, isNaN(n) || isNaN(t)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");
  return n & ~(1 << t);
}, _6 = Ma.__acroform__.getBit = function(n, t) {
  if (isNaN(n) || isNaN(t)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");
  return n & 1 << t ? 1 : 0;
}, ja = Ma.__acroform__.getBitForPdf = function(n, t) {
  if (isNaN(n) || isNaN(t)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");
  return _6(n, t - 1);
}, Ya = Ma.__acroform__.setBitForPdf = function(n, t) {
  if (isNaN(n) || isNaN(t)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");
  return Q6(n, t - 1);
}, Ga = Ma.__acroform__.clearBitForPdf = function(n, t) {
  if (isNaN(n) || isNaN(t)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");
  return M6(n, t - 1);
}, R6 = Ma.__acroform__.calculateCoordinates = function(n, t) {
  var e = t.internal.getHorizontalCoordinate, r = t.internal.getVerticalCoordinate, a = n[0], A = n[1], i = n[2], s = n[3], o = {};
  return o.lowerLeft_X = e(a) || 0, o.lowerLeft_Y = r(A + s) || 0, o.upperRight_X = e(a + i) || 0, o.upperRight_Y = r(A) || 0, [Number(Vr(o.lowerLeft_X)), Number(Vr(o.lowerLeft_Y)), Number(Vr(o.upperRight_X)), Number(Vr(o.upperRight_Y))];
}, N6 = function(n) {
  if (n.appearanceStreamContent) return n.appearanceStreamContent;
  if (n.V || n.DV) {
    var t = [], e = n._V || n.DV, r = kp(n, e), a = n.scope.internal.getFont(n.fontName, n.fontStyle).id;
    t.push("/Tx BMC"), t.push("q"), t.push("BT"), t.push(n.scope.__private__.encodeColorString(n.color)), t.push("/" + a + " " + Vr(r.fontSize) + " Tf"), t.push("1 0 0 1 0 0 Tm"), t.push(r.text), t.push("ET"), t.push("Q"), t.push("EMC");
    var A = Li(n);
    return A.scope = n.scope, A.stream = t.join(`
`), A;
  }
}, kp = function(n, t) {
  var e = n.fontSize === 0 ? n.maxFontSize : n.fontSize, r = { text: "", fontSize: "" }, a = (t = (t = t.substr(0, 1) == "(" ? t.substr(1) : t).substr(t.length - 1) == ")" ? t.substr(0, t.length - 1) : t).split(" ");
  a = n.multiline ? a.map(function(T) {
    return T.split(`
`);
  }) : a.map(function(T) {
    return [T];
  });
  var A = e, i = mr.internal.getHeight(n) || 0;
  i = i < 0 ? -i : i;
  var s = mr.internal.getWidth(n) || 0;
  s = s < 0 ? -s : s;
  var o = function(T, E, Q) {
    if (T + 1 < a.length) {
      var x = E + " " + a[T + 1][0];
      return Nc(x, n, Q).width <= s - 4;
    }
    return !1;
  };
  A++;
  e: for (; A > 0; ) {
    t = "", A--;
    var l, u, f = Nc("3", n, A).height, h = n.multiline ? i - A : (i - f) / 2, c = h += 2, p = 0, w = 0, y = 0;
    if (A <= 0) {
      t = `(...) Tj
`, t += "% Width of Text: " + Nc(t, n, A = 12).width + ", FieldWidth:" + s + `
`;
      break;
    }
    for (var m = "", k = 0, D = 0; D < a.length; D++) if (a.hasOwnProperty(D)) {
      var B = !1;
      if (a[D].length !== 1 && y !== a[D].length - 1) {
        if ((f + 2) * (k + 2) + 2 > i) continue e;
        m += a[D][y], B = !0, w = D, D--;
      } else {
        m = (m += a[D][y] + " ").substr(m.length - 1) == " " ? m.substr(0, m.length - 1) : m;
        var O = parseInt(D), q = o(O, m, A), G = D >= a.length - 1;
        if (q && !G) {
          m += " ", y = 0;
          continue;
        }
        if (q || G) {
          if (G) w = O;
          else if (n.multiline && (f + 2) * (k + 2) + 2 > i) continue e;
        } else {
          if (!n.multiline || (f + 2) * (k + 2) + 2 > i) continue e;
          w = O;
        }
      }
      for (var W = "", F = p; F <= w; F++) {
        var Y = a[F];
        if (n.multiline) {
          if (F === w) {
            W += Y[y] + " ", y = (y + 1) % Y.length;
            continue;
          }
          if (F === p) {
            W += Y[Y.length - 1] + " ";
            continue;
          }
        }
        W += Y[0] + " ";
      }
      switch (W = W.substr(W.length - 1) == " " ? W.substr(0, W.length - 1) : W, u = Nc(W, n, A).width, n.textAlign) {
        case "right":
          l = s - u - 2;
          break;
        case "center":
          l = (s - u) / 2;
          break;
        default:
          l = 2;
      }
      t += Vr(l) + " " + Vr(c) + ` Td
`, t += "(" + fl(W) + `) Tj
`, t += -Vr(l) + ` 0 Td
`, c = -(A + 2), u = 0, p = B ? w : w + 1, k++, m = "";
    }
    break;
  }
  return r.text = t, r.fontSize = A, r;
}, Nc = function(n, t, e) {
  var r = t.scope.internal.getFont(t.fontName, t.fontStyle), a = t.scope.getStringUnitWidth(n, { font: r, fontSize: parseFloat(e), charSpace: 0 }) * parseFloat(e);
  return { height: t.scope.getStringUnitWidth("3", { font: r, fontSize: parseFloat(e), charSpace: 0 }) * parseFloat(e) * 1.5, width: a };
}, H6 = { fields: [], xForms: [], acroFormDictionaryRoot: null, printedOut: !1, internal: null, isInitialized: !1 }, O6 = function(n, t) {
  var e = { type: "reference", object: n };
  t.internal.getPageInfo(n.page).pageContext.annotations.find(function(r) {
    return r.type === e.type && r.object === e.object;
  }) === void 0 && t.internal.getPageInfo(n.page).pageContext.annotations.push(e);
}, P6 = function(n, t) {
  if (t.scope = n, n.internal !== void 0 && (n.internal.acroformPlugin === void 0 || n.internal.acroformPlugin.isInitialized === !1)) {
    if (vi.FieldNum = 0, n.internal.acroformPlugin = JSON.parse(JSON.stringify(H6)), n.internal.acroformPlugin.acroFormDictionaryRoot) throw new Error("Exception while creating AcroformDictionary");
    C0 = n.internal.scaleFactor, n.internal.acroformPlugin.acroFormDictionaryRoot = new lC(), n.internal.acroformPlugin.acroFormDictionaryRoot.scope = n, n.internal.acroformPlugin.acroFormDictionaryRoot._eventID = n.internal.events.subscribe("postPutResources", function() {
      (function(e) {
        e.internal.events.unsubscribe(e.internal.acroformPlugin.acroFormDictionaryRoot._eventID), delete e.internal.acroformPlugin.acroFormDictionaryRoot._eventID, e.internal.acroformPlugin.printedOut = !0;
      })(n);
    }), n.internal.events.subscribe("buildDocument", function() {
      (function(e) {
        e.internal.acroformPlugin.acroFormDictionaryRoot.objId = void 0;
        var r = e.internal.acroformPlugin.acroFormDictionaryRoot.Fields;
        for (var a in r) if (r.hasOwnProperty(a)) {
          var A = r[a];
          A.objId = void 0, A.hasAnnotation && O6(A, e);
        }
      })(n);
    }), n.internal.events.subscribe("putCatalog", function() {
      (function(e) {
        if (e.internal.acroformPlugin.acroFormDictionaryRoot === void 0) throw new Error("putCatalogCallback: Root missing.");
        e.internal.write("/AcroForm " + e.internal.acroformPlugin.acroFormDictionaryRoot.objId + " 0 R");
      })(n);
    }), n.internal.events.subscribe("postPutPages", function(e) {
      (function(r, a) {
        var A = !r;
        for (var i in r || (a.internal.newObjectDeferredBegin(a.internal.acroformPlugin.acroFormDictionaryRoot.objId, !0), a.internal.acroformPlugin.acroFormDictionaryRoot.putStream()), r = r || a.internal.acroformPlugin.acroFormDictionaryRoot.Kids) if (r.hasOwnProperty(i)) {
          var s = r[i], o = [], l = s.Rect;
          if (s.Rect && (s.Rect = R6(s.Rect, a)), a.internal.newObjectDeferredBegin(s.objId, !0), s.DA = mr.createDefaultAppearanceStream(s), In(s) === "object" && typeof s.getKeyValueListForStream == "function" && (o = s.getKeyValueListForStream()), s.Rect = l, s.hasAppearanceStream && !s.appearanceStreamContent) {
            var u = N6(s);
            o.push({ key: "AP", value: "<</N " + u + ">>" }), a.internal.acroformPlugin.xForms.push(u);
          }
          if (s.appearanceStreamContent) {
            var f = "";
            for (var h in s.appearanceStreamContent) if (s.appearanceStreamContent.hasOwnProperty(h)) {
              var c = s.appearanceStreamContent[h];
              if (f += "/" + h + " ", f += "<<", Object.keys(c).length >= 1 || Array.isArray(c)) {
                for (var i in c) if (c.hasOwnProperty(i)) {
                  var p = c[i];
                  typeof p == "function" && (p = p.call(a, s)), f += "/" + i + " " + p + " ", a.internal.acroformPlugin.xForms.indexOf(p) >= 0 || a.internal.acroformPlugin.xForms.push(p);
                }
              } else typeof (p = c) == "function" && (p = p.call(a, s)), f += "/" + i + " " + p, a.internal.acroformPlugin.xForms.indexOf(p) >= 0 || a.internal.acroformPlugin.xForms.push(p);
              f += ">>";
            }
            o.push({ key: "AP", value: `<<
` + f + ">>" });
          }
          a.internal.putStream({ additionalKeyValues: o, objectId: s.objId }), a.internal.out("endobj");
        }
        A && (function(w, y) {
          for (var m in w) if (w.hasOwnProperty(m)) {
            var k = m, D = w[m];
            y.internal.newObjectDeferredBegin(D.objId, !0), In(D) === "object" && typeof D.putStream == "function" && D.putStream(), delete w[k];
          }
        })(a.internal.acroformPlugin.xForms, a);
      })(e, n);
    }), n.internal.acroformPlugin.isInitialized = !0;
  }
}, iC = Ma.__acroform__.arrayToPdfArray = function(n, t, e) {
  var r = function(i) {
    return i;
  };
  if (Array.isArray(n)) {
    for (var a = "[", A = 0; A < n.length; A++) switch (A !== 0 && (a += " "), In(n[A])) {
      case "boolean":
      case "number":
      case "object":
        a += n[A].toString();
        break;
      case "string":
        n[A].substr(0, 1) === "/" ? a += "/" + cl(n[A].substr(1)) : (t !== void 0 && e && (r = e.internal.getEncryptor(t)), a += "(" + fl(r(n[A].toString())) + ")");
    }
    return a + "]";
  }
  throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray");
}, Yf = function(n, t, e) {
  var r = function(a) {
    return a;
  };
  return t !== void 0 && e && (r = e.internal.getEncryptor(t)), (n = n || "").toString(), "(" + fl(r(n)) + ")";
}, Mi = function() {
  this._objId = void 0, this._scope = void 0, Object.defineProperty(this, "objId", { get: function() {
    if (this._objId === void 0) {
      if (this.scope === void 0) return;
      this._objId = this.scope.internal.newObjectDeferred();
    }
    return this._objId;
  }, set: function(n) {
    this._objId = n;
  } }), Object.defineProperty(this, "scope", { value: this._scope, writable: !0 });
};
Mi.prototype.toString = function() {
  return this.objId + " 0 R";
}, Mi.prototype.putStream = function() {
  var n = this.getKeyValueListForStream();
  this.scope.internal.putStream({ data: this.stream, additionalKeyValues: n, objectId: this.objId }), this.scope.internal.out("endobj");
}, Mi.prototype.getKeyValueListForStream = function() {
  var n = [], t = Object.getOwnPropertyNames(this).filter(function(A) {
    return A != "content" && A != "appearanceStreamContent" && A != "scope" && A != "objId" && A.substring(0, 1) != "_";
  });
  for (var e in t) if (Object.getOwnPropertyDescriptor(this, t[e]).configurable === !1) {
    var r = t[e], a = this[r];
    a && (Array.isArray(a) ? n.push({ key: r, value: iC(a, this.objId, this.scope) }) : a instanceof Mi ? (a.scope = this.scope, n.push({ key: r, value: a.objId + " 0 R" })) : typeof a != "function" && n.push({ key: r, value: a }));
  }
  return n;
};
var oC = function() {
  Mi.call(this), Object.defineProperty(this, "Type", { value: "/XObject", configurable: !1, writable: !0 }), Object.defineProperty(this, "Subtype", { value: "/Form", configurable: !1, writable: !0 }), Object.defineProperty(this, "FormType", { value: 1, configurable: !1, writable: !0 });
  var n, t = [];
  Object.defineProperty(this, "BBox", { configurable: !1, get: function() {
    return t;
  }, set: function(e) {
    t = e;
  } }), Object.defineProperty(this, "Resources", { value: "2 0 R", configurable: !1, writable: !0 }), Object.defineProperty(this, "stream", { enumerable: !1, configurable: !0, set: function(e) {
    n = e.trim();
  }, get: function() {
    return n || null;
  } });
};
Ts(oC, Mi);
var lC = function() {
  Mi.call(this);
  var n, t = [];
  Object.defineProperty(this, "Kids", { enumerable: !1, configurable: !0, get: function() {
    return t.length > 0 ? t : void 0;
  } }), Object.defineProperty(this, "Fields", { enumerable: !1, configurable: !1, get: function() {
    return t;
  } }), Object.defineProperty(this, "DA", { enumerable: !1, configurable: !1, get: function() {
    if (n) {
      var e = function(r) {
        return r;
      };
      return this.scope && (e = this.scope.internal.getEncryptor(this.objId)), "(" + fl(e(n)) + ")";
    }
  }, set: function(e) {
    n = e;
  } });
};
Ts(lC, Mi);
var vi = function n() {
  Mi.call(this);
  var t = 4;
  Object.defineProperty(this, "F", { enumerable: !1, configurable: !1, get: function() {
    return t;
  }, set: function(m) {
    if (isNaN(m)) throw new Error('Invalid value "' + m + '" for attribute F supplied.');
    t = m;
  } }), Object.defineProperty(this, "showWhenPrinted", { enumerable: !0, configurable: !0, get: function() {
    return !!ja(t, 3);
  }, set: function(m) {
    m ? this.F = Ya(t, 3) : this.F = Ga(t, 3);
  } });
  var e = 0;
  Object.defineProperty(this, "Ff", { enumerable: !1, configurable: !1, get: function() {
    return e;
  }, set: function(m) {
    if (isNaN(m)) throw new Error('Invalid value "' + m + '" for attribute Ff supplied.');
    e = m;
  } });
  var r = [];
  Object.defineProperty(this, "Rect", { enumerable: !1, configurable: !1, get: function() {
    if (r.length !== 0) return r;
  }, set: function(m) {
    r = m !== void 0 ? m : [];
  } }), Object.defineProperty(this, "x", { enumerable: !0, configurable: !0, get: function() {
    return !r || isNaN(r[0]) ? 0 : r[0];
  }, set: function(m) {
    r[0] = m;
  } }), Object.defineProperty(this, "y", { enumerable: !0, configurable: !0, get: function() {
    return !r || isNaN(r[1]) ? 0 : r[1];
  }, set: function(m) {
    r[1] = m;
  } }), Object.defineProperty(this, "width", { enumerable: !0, configurable: !0, get: function() {
    return !r || isNaN(r[2]) ? 0 : r[2];
  }, set: function(m) {
    r[2] = m;
  } }), Object.defineProperty(this, "height", { enumerable: !0, configurable: !0, get: function() {
    return !r || isNaN(r[3]) ? 0 : r[3];
  }, set: function(m) {
    r[3] = m;
  } });
  var a = "";
  Object.defineProperty(this, "FT", { enumerable: !0, configurable: !1, get: function() {
    return a;
  }, set: function(m) {
    switch (m) {
      case "/Btn":
      case "/Tx":
      case "/Ch":
      case "/Sig":
        a = m;
        break;
      default:
        throw new Error('Invalid value "' + m + '" for attribute FT supplied.');
    }
  } });
  var A = null;
  Object.defineProperty(this, "T", { enumerable: !0, configurable: !1, get: function() {
    if (!A || A.length < 1) {
      if (this instanceof Id) return;
      A = "FieldObject" + n.FieldNum++;
    }
    var m = function(k) {
      return k;
    };
    return this.scope && (m = this.scope.internal.getEncryptor(this.objId)), "(" + fl(m(A)) + ")";
  }, set: function(m) {
    A = m.toString();
  } }), Object.defineProperty(this, "fieldName", { configurable: !0, enumerable: !0, get: function() {
    return A;
  }, set: function(m) {
    A = m;
  } });
  var i = "helvetica";
  Object.defineProperty(this, "fontName", { enumerable: !0, configurable: !0, get: function() {
    return i;
  }, set: function(m) {
    i = m;
  } });
  var s = "normal";
  Object.defineProperty(this, "fontStyle", { enumerable: !0, configurable: !0, get: function() {
    return s;
  }, set: function(m) {
    s = m;
  } });
  var o = 0;
  Object.defineProperty(this, "fontSize", { enumerable: !0, configurable: !0, get: function() {
    return o;
  }, set: function(m) {
    o = m;
  } });
  var l = void 0;
  Object.defineProperty(this, "maxFontSize", { enumerable: !0, configurable: !0, get: function() {
    return l === void 0 ? 50 / C0 : l;
  }, set: function(m) {
    l = m;
  } });
  var u = "black";
  Object.defineProperty(this, "color", { enumerable: !0, configurable: !0, get: function() {
    return u;
  }, set: function(m) {
    u = m;
  } });
  var f = "/F1 0 Tf 0 g";
  Object.defineProperty(this, "DA", { enumerable: !0, configurable: !1, get: function() {
    if (!(!f || this instanceof Id || this instanceof Al)) return Yf(f, this.objId, this.scope);
  }, set: function(m) {
    m = m.toString(), f = m;
  } });
  var h = null;
  Object.defineProperty(this, "DV", { enumerable: !1, configurable: !1, get: function() {
    if (h) return this instanceof TA == 0 ? Yf(h, this.objId, this.scope) : h;
  }, set: function(m) {
    m = m.toString(), h = this instanceof TA == 0 ? m.substr(0, 1) === "(" ? Cl(m.substr(1, m.length - 2)) : Cl(m) : m;
  } }), Object.defineProperty(this, "defaultValue", { enumerable: !0, configurable: !0, get: function() {
    return this instanceof TA == 1 ? Cl(h.substr(1, h.length - 1)) : h;
  }, set: function(m) {
    m = m.toString(), h = this instanceof TA == 1 ? "/" + cl(m) : m;
  } });
  var c = null;
  Object.defineProperty(this, "_V", { enumerable: !1, configurable: !1, get: function() {
    if (c) return c;
  }, set: function(m) {
    this.V = m;
  } }), Object.defineProperty(this, "V", { enumerable: !1, configurable: !1, get: function() {
    if (c) return this instanceof TA == 0 ? Yf(c, this.objId, this.scope) : c;
  }, set: function(m) {
    m = m.toString(), c = this instanceof TA == 0 ? m.substr(0, 1) === "(" ? Cl(m.substr(1, m.length - 2)) : Cl(m) : m;
  } }), Object.defineProperty(this, "value", { enumerable: !0, configurable: !0, get: function() {
    return this instanceof TA == 1 ? Cl(c.substr(1, c.length - 1)) : c;
  }, set: function(m) {
    m = m.toString(), c = this instanceof TA == 1 ? "/" + cl(m) : m;
  } }), Object.defineProperty(this, "hasAnnotation", { enumerable: !0, configurable: !0, get: function() {
    return this.Rect;
  } }), Object.defineProperty(this, "Type", { enumerable: !0, configurable: !1, get: function() {
    return this.hasAnnotation ? "/Annot" : null;
  } }), Object.defineProperty(this, "Subtype", { enumerable: !0, configurable: !1, get: function() {
    return this.hasAnnotation ? "/Widget" : null;
  } });
  var p, w = !1;
  Object.defineProperty(this, "hasAppearanceStream", { enumerable: !0, configurable: !0, get: function() {
    return w;
  }, set: function(m) {
    m = !!m, w = m;
  } }), Object.defineProperty(this, "page", { enumerable: !0, configurable: !0, get: function() {
    if (p) return p;
  }, set: function(m) {
    p = m;
  } }), Object.defineProperty(this, "readOnly", { enumerable: !0, configurable: !0, get: function() {
    return !!ja(this.Ff, 1);
  }, set: function(m) {
    m ? this.Ff = Ya(this.Ff, 1) : this.Ff = Ga(this.Ff, 1);
  } }), Object.defineProperty(this, "required", { enumerable: !0, configurable: !0, get: function() {
    return !!ja(this.Ff, 2);
  }, set: function(m) {
    m ? this.Ff = Ya(this.Ff, 2) : this.Ff = Ga(this.Ff, 2);
  } }), Object.defineProperty(this, "noExport", { enumerable: !0, configurable: !0, get: function() {
    return !!ja(this.Ff, 3);
  }, set: function(m) {
    m ? this.Ff = Ya(this.Ff, 3) : this.Ff = Ga(this.Ff, 3);
  } });
  var y = null;
  Object.defineProperty(this, "Q", { enumerable: !0, configurable: !1, get: function() {
    if (y !== null) return y;
  }, set: function(m) {
    if ([0, 1, 2].indexOf(m) === -1) throw new Error('Invalid value "' + m + '" for attribute Q supplied.');
    y = m;
  } }), Object.defineProperty(this, "textAlign", { get: function() {
    var m;
    switch (y) {
      case 0:
      default:
        m = "left";
        break;
      case 1:
        m = "center";
        break;
      case 2:
        m = "right";
    }
    return m;
  }, configurable: !0, enumerable: !0, set: function(m) {
    switch (m) {
      case "right":
      case 2:
        y = 2;
        break;
      case "center":
      case 1:
        y = 1;
        break;
      default:
        y = 0;
    }
  } });
};
Ts(vi, Mi);
var $l = function() {
  vi.call(this), this.FT = "/Ch", this.V = "()", this.fontName = "zapfdingbats";
  var n = 0;
  Object.defineProperty(this, "TI", { enumerable: !0, configurable: !1, get: function() {
    return n;
  }, set: function(e) {
    n = e;
  } }), Object.defineProperty(this, "topIndex", { enumerable: !0, configurable: !0, get: function() {
    return n;
  }, set: function(e) {
    n = e;
  } });
  var t = [];
  Object.defineProperty(this, "Opt", { enumerable: !0, configurable: !1, get: function() {
    return iC(t, this.objId, this.scope);
  }, set: function(e) {
    var r, a;
    a = [], typeof (r = e) == "string" && (a = (function(A, i, s) {
      s || (s = 1);
      for (var o, l = []; o = i.exec(A); ) l.push(o[s]);
      return l;
    })(r, /\((.*?)\)/g)), t = a;
  } }), this.getOptions = function() {
    return t;
  }, this.setOptions = function(e) {
    t = e, this.sort && t.sort();
  }, this.addOption = function(e) {
    e = (e = e || "").toString(), t.push(e), this.sort && t.sort();
  }, this.removeOption = function(e, r) {
    for (r = r || !1, e = (e = e || "").toString(); t.indexOf(e) !== -1 && (t.splice(t.indexOf(e), 1), r !== !1); ) ;
  }, Object.defineProperty(this, "combo", { enumerable: !0, configurable: !0, get: function() {
    return !!ja(this.Ff, 18);
  }, set: function(e) {
    e ? this.Ff = Ya(this.Ff, 18) : this.Ff = Ga(this.Ff, 18);
  } }), Object.defineProperty(this, "edit", { enumerable: !0, configurable: !0, get: function() {
    return !!ja(this.Ff, 19);
  }, set: function(e) {
    this.combo === !0 && (e ? this.Ff = Ya(this.Ff, 19) : this.Ff = Ga(this.Ff, 19));
  } }), Object.defineProperty(this, "sort", { enumerable: !0, configurable: !0, get: function() {
    return !!ja(this.Ff, 20);
  }, set: function(e) {
    e ? (this.Ff = Ya(this.Ff, 20), t.sort()) : this.Ff = Ga(this.Ff, 20);
  } }), Object.defineProperty(this, "multiSelect", { enumerable: !0, configurable: !0, get: function() {
    return !!ja(this.Ff, 22);
  }, set: function(e) {
    e ? this.Ff = Ya(this.Ff, 22) : this.Ff = Ga(this.Ff, 22);
  } }), Object.defineProperty(this, "doNotSpellCheck", { enumerable: !0, configurable: !0, get: function() {
    return !!ja(this.Ff, 23);
  }, set: function(e) {
    e ? this.Ff = Ya(this.Ff, 23) : this.Ff = Ga(this.Ff, 23);
  } }), Object.defineProperty(this, "commitOnSelChange", { enumerable: !0, configurable: !0, get: function() {
    return !!ja(this.Ff, 27);
  }, set: function(e) {
    e ? this.Ff = Ya(this.Ff, 27) : this.Ff = Ga(this.Ff, 27);
  } }), this.hasAppearanceStream = !1;
};
Ts($l, vi);
var Vl = function() {
  $l.call(this), this.fontName = "helvetica", this.combo = !1;
};
Ts(Vl, $l);
var ql = function() {
  Vl.call(this), this.combo = !0;
};
Ts(ql, Vl);
var md = function() {
  ql.call(this), this.edit = !0;
};
Ts(md, ql);
var TA = function() {
  vi.call(this), this.FT = "/Btn", Object.defineProperty(this, "noToggleToOff", { enumerable: !0, configurable: !0, get: function() {
    return !!ja(this.Ff, 15);
  }, set: function(e) {
    e ? this.Ff = Ya(this.Ff, 15) : this.Ff = Ga(this.Ff, 15);
  } }), Object.defineProperty(this, "radio", { enumerable: !0, configurable: !0, get: function() {
    return !!ja(this.Ff, 16);
  }, set: function(e) {
    e ? this.Ff = Ya(this.Ff, 16) : this.Ff = Ga(this.Ff, 16);
  } }), Object.defineProperty(this, "pushButton", { enumerable: !0, configurable: !0, get: function() {
    return !!ja(this.Ff, 17);
  }, set: function(e) {
    e ? this.Ff = Ya(this.Ff, 17) : this.Ff = Ga(this.Ff, 17);
  } }), Object.defineProperty(this, "radioIsUnison", { enumerable: !0, configurable: !0, get: function() {
    return !!ja(this.Ff, 26);
  }, set: function(e) {
    e ? this.Ff = Ya(this.Ff, 26) : this.Ff = Ga(this.Ff, 26);
  } });
  var n, t = {};
  Object.defineProperty(this, "MK", { enumerable: !1, configurable: !1, get: function() {
    var e = function(A) {
      return A;
    };
    if (this.scope && (e = this.scope.internal.getEncryptor(this.objId)), Object.keys(t).length !== 0) {
      var r, a = [];
      for (r in a.push("<<"), t) a.push("/" + r + " (" + fl(e(t[r])) + ")");
      return a.push(">>"), a.join(`
`);
    }
  }, set: function(e) {
    In(e) === "object" && (t = e);
  } }), Object.defineProperty(this, "caption", { enumerable: !0, configurable: !0, get: function() {
    return t.CA || "";
  }, set: function(e) {
    typeof e == "string" && (t.CA = e);
  } }), Object.defineProperty(this, "AS", { enumerable: !1, configurable: !1, get: function() {
    return n;
  }, set: function(e) {
    var r = e == null ? "" : e.toString();
    r.substr(0, 1) === "/" && (r = r.substr(1)), n = "/" + cl(r);
  } }), Object.defineProperty(this, "appearanceState", { enumerable: !0, configurable: !0, get: function() {
    return n.substr(1, n.length - 1);
  }, set: function(e) {
    n = "/" + cl(e);
  } });
};
Ts(TA, vi);
var wd = function() {
  TA.call(this), this.pushButton = !0;
};
Ts(wd, TA);
var jl = function() {
  TA.call(this), this.radio = !0, this.pushButton = !1;
  var n = [];
  Object.defineProperty(this, "Kids", { enumerable: !0, configurable: !1, get: function() {
    return n;
  }, set: function(t) {
    n = t !== void 0 ? t : [];
  } });
};
Ts(jl, TA);
var Id = function() {
  var n, t;
  vi.call(this), Object.defineProperty(this, "Parent", { enumerable: !1, configurable: !1, get: function() {
    return n;
  }, set: function(a) {
    n = a;
  } }), Object.defineProperty(this, "optionName", { enumerable: !1, configurable: !0, get: function() {
    return t;
  }, set: function(a) {
    t = a;
  } });
  var e, r = {};
  Object.defineProperty(this, "MK", { enumerable: !1, configurable: !1, get: function() {
    var a = function(s) {
      return s;
    };
    this.scope && (a = this.scope.internal.getEncryptor(this.objId));
    var A, i = [];
    for (A in i.push("<<"), r) i.push("/" + A + " (" + fl(a(r[A])) + ")");
    return i.push(">>"), i.join(`
`);
  }, set: function(a) {
    In(a) === "object" && (r = a);
  } }), Object.defineProperty(this, "caption", { enumerable: !0, configurable: !0, get: function() {
    return r.CA || "";
  }, set: function(a) {
    typeof a == "string" && (r.CA = a);
  } }), Object.defineProperty(this, "AS", { enumerable: !1, configurable: !1, get: function() {
    return e;
  }, set: function(a) {
    var A = a == null ? "" : a.toString();
    A.substr(0, 1) === "/" && (A = A.substr(1)), e = "/" + cl(A);
  } }), Object.defineProperty(this, "appearanceState", { enumerable: !0, configurable: !0, get: function() {
    return e.substr(1, e.length - 1);
  }, set: function(a) {
    var A = a == null ? "" : a.toString();
    A.substr(0, 1) === "/" && (A = A.substr(1)), e = "/" + cl(A);
  } }), this.caption = "l", this.appearanceState = "Off", this._AppearanceType = mr.RadioButton.Circle, this.appearanceStreamContent = this._AppearanceType.createAppearanceStream(this.optionName);
};
Ts(Id, vi), jl.prototype.setAppearance = function(n) {
  if (!("createAppearanceStream" in n) || !("getCA" in n)) throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");
  for (var t in this.Kids) if (this.Kids.hasOwnProperty(t)) {
    var e = this.Kids[t];
    e.appearanceStreamContent = n.createAppearanceStream(e.optionName), e.caption = n.getCA();
  }
}, jl.prototype.createOption = function(n) {
  var t = new Id();
  return t.Parent = this, t.optionName = n, this.Kids.push(t), W6.call(this.scope, t), t;
};
var yd = function() {
  TA.call(this), this.fontName = "zapfdingbats", this.caption = "3", this.appearanceState = "On", this.value = "On", this.textAlign = "center", this.appearanceStreamContent = mr.CheckBox.createAppearanceStream();
};
Ts(yd, TA);
var Al = function() {
  vi.call(this), this.FT = "/Tx", Object.defineProperty(this, "multiline", { enumerable: !0, configurable: !0, get: function() {
    return !!ja(this.Ff, 13);
  }, set: function(t) {
    t ? this.Ff = Ya(this.Ff, 13) : this.Ff = Ga(this.Ff, 13);
  } }), Object.defineProperty(this, "fileSelect", { enumerable: !0, configurable: !0, get: function() {
    return !!ja(this.Ff, 21);
  }, set: function(t) {
    t ? this.Ff = Ya(this.Ff, 21) : this.Ff = Ga(this.Ff, 21);
  } }), Object.defineProperty(this, "doNotSpellCheck", { enumerable: !0, configurable: !0, get: function() {
    return !!ja(this.Ff, 23);
  }, set: function(t) {
    t ? this.Ff = Ya(this.Ff, 23) : this.Ff = Ga(this.Ff, 23);
  } }), Object.defineProperty(this, "doNotScroll", { enumerable: !0, configurable: !0, get: function() {
    return !!ja(this.Ff, 24);
  }, set: function(t) {
    t ? this.Ff = Ya(this.Ff, 24) : this.Ff = Ga(this.Ff, 24);
  } }), Object.defineProperty(this, "comb", { enumerable: !0, configurable: !0, get: function() {
    return !!ja(this.Ff, 25);
  }, set: function(t) {
    t ? this.Ff = Ya(this.Ff, 25) : this.Ff = Ga(this.Ff, 25);
  } }), Object.defineProperty(this, "richText", { enumerable: !0, configurable: !0, get: function() {
    return !!ja(this.Ff, 26);
  }, set: function(t) {
    t ? this.Ff = Ya(this.Ff, 26) : this.Ff = Ga(this.Ff, 26);
  } });
  var n = null;
  Object.defineProperty(this, "MaxLen", { enumerable: !0, configurable: !1, get: function() {
    return n;
  }, set: function(t) {
    n = t;
  } }), Object.defineProperty(this, "maxLength", { enumerable: !0, configurable: !0, get: function() {
    return n;
  }, set: function(t) {
    Number.isInteger(t) && (n = t);
  } }), Object.defineProperty(this, "hasAppearanceStream", { enumerable: !0, configurable: !0, get: function() {
    return this.V || this.DV;
  } });
};
Ts(Al, vi);
var Bd = function() {
  Al.call(this), Object.defineProperty(this, "password", { enumerable: !0, configurable: !0, get: function() {
    return !!ja(this.Ff, 14);
  }, set: function(n) {
    n ? this.Ff = Ya(this.Ff, 14) : this.Ff = Ga(this.Ff, 14);
  } }), this.password = !0;
};
Ts(Bd, Al);
var mr = { CheckBox: { createAppearanceStream: function() {
  return { N: { On: mr.CheckBox.YesNormal }, D: { On: mr.CheckBox.YesPushDown, Off: mr.CheckBox.OffPushDown } };
}, YesPushDown: function(n) {
  var t = Li(n);
  t.scope = n.scope;
  var e = [], r = n.scope.internal.getFont(n.fontName, n.fontStyle).id, a = n.scope.__private__.encodeColorString(n.color), A = kp(n, n.caption);
  return e.push("0.749023 g"), e.push("0 0 " + Vr(mr.internal.getWidth(n)) + " " + Vr(mr.internal.getHeight(n)) + " re"), e.push("f"), e.push("BMC"), e.push("q"), e.push("0 0 1 rg"), e.push("/" + r + " " + Vr(A.fontSize) + " Tf " + a), e.push("BT"), e.push(A.text), e.push("ET"), e.push("Q"), e.push("EMC"), t.stream = e.join(`
`), t;
}, YesNormal: function(n) {
  var t = Li(n);
  t.scope = n.scope;
  var e = n.scope.internal.getFont(n.fontName, n.fontStyle).id, r = n.scope.__private__.encodeColorString(n.color), a = [], A = mr.internal.getHeight(n), i = mr.internal.getWidth(n), s = kp(n, n.caption);
  return a.push("1 g"), a.push("0 0 " + Vr(i) + " " + Vr(A) + " re"), a.push("f"), a.push("q"), a.push("0 0 1 rg"), a.push("0 0 " + Vr(i - 1) + " " + Vr(A - 1) + " re"), a.push("W"), a.push("n"), a.push("0 g"), a.push("BT"), a.push("/" + e + " " + Vr(s.fontSize) + " Tf " + r), a.push(s.text), a.push("ET"), a.push("Q"), t.stream = a.join(`
`), t;
}, OffPushDown: function(n) {
  var t = Li(n);
  t.scope = n.scope;
  var e = [];
  return e.push("0.749023 g"), e.push("0 0 " + Vr(mr.internal.getWidth(n)) + " " + Vr(mr.internal.getHeight(n)) + " re"), e.push("f"), t.stream = e.join(`
`), t;
} }, RadioButton: { Circle: { createAppearanceStream: function(n) {
  var t = { D: { Off: mr.RadioButton.Circle.OffPushDown }, N: {} };
  return t.N[n] = mr.RadioButton.Circle.YesNormal, t.D[n] = mr.RadioButton.Circle.YesPushDown, t;
}, getCA: function() {
  return "l";
}, YesNormal: function(n) {
  var t = Li(n);
  t.scope = n.scope;
  var e = [], r = mr.internal.getWidth(n) <= mr.internal.getHeight(n) ? mr.internal.getWidth(n) / 4 : mr.internal.getHeight(n) / 4;
  r = Number((0.9 * r).toFixed(5));
  var a = mr.internal.Bezier_C, A = Number((r * a).toFixed(5));
  return e.push("q"), e.push("1 0 0 1 " + Co(mr.internal.getWidth(n) / 2) + " " + Co(mr.internal.getHeight(n) / 2) + " cm"), e.push(r + " 0 m"), e.push(r + " " + A + " " + A + " " + r + " 0 " + r + " c"), e.push("-" + A + " " + r + " -" + r + " " + A + " -" + r + " 0 c"), e.push("-" + r + " -" + A + " -" + A + " -" + r + " 0 -" + r + " c"), e.push(A + " -" + r + " " + r + " -" + A + " " + r + " 0 c"), e.push("f"), e.push("Q"), t.stream = e.join(`
`), t;
}, YesPushDown: function(n) {
  var t = Li(n);
  t.scope = n.scope;
  var e = [], r = mr.internal.getWidth(n) <= mr.internal.getHeight(n) ? mr.internal.getWidth(n) / 4 : mr.internal.getHeight(n) / 4;
  r = Number((0.9 * r).toFixed(5));
  var a = Number((2 * r).toFixed(5)), A = Number((a * mr.internal.Bezier_C).toFixed(5)), i = Number((r * mr.internal.Bezier_C).toFixed(5));
  return e.push("0.749023 g"), e.push("q"), e.push("1 0 0 1 " + Co(mr.internal.getWidth(n) / 2) + " " + Co(mr.internal.getHeight(n) / 2) + " cm"), e.push(a + " 0 m"), e.push(a + " " + A + " " + A + " " + a + " 0 " + a + " c"), e.push("-" + A + " " + a + " -" + a + " " + A + " -" + a + " 0 c"), e.push("-" + a + " -" + A + " -" + A + " -" + a + " 0 -" + a + " c"), e.push(A + " -" + a + " " + a + " -" + A + " " + a + " 0 c"), e.push("f"), e.push("Q"), e.push("0 g"), e.push("q"), e.push("1 0 0 1 " + Co(mr.internal.getWidth(n) / 2) + " " + Co(mr.internal.getHeight(n) / 2) + " cm"), e.push(r + " 0 m"), e.push(r + " " + i + " " + i + " " + r + " 0 " + r + " c"), e.push("-" + i + " " + r + " -" + r + " " + i + " -" + r + " 0 c"), e.push("-" + r + " -" + i + " -" + i + " -" + r + " 0 -" + r + " c"), e.push(i + " -" + r + " " + r + " -" + i + " " + r + " 0 c"), e.push("f"), e.push("Q"), t.stream = e.join(`
`), t;
}, OffPushDown: function(n) {
  var t = Li(n);
  t.scope = n.scope;
  var e = [], r = mr.internal.getWidth(n) <= mr.internal.getHeight(n) ? mr.internal.getWidth(n) / 4 : mr.internal.getHeight(n) / 4;
  r = Number((0.9 * r).toFixed(5));
  var a = Number((2 * r).toFixed(5)), A = Number((a * mr.internal.Bezier_C).toFixed(5));
  return e.push("0.749023 g"), e.push("q"), e.push("1 0 0 1 " + Co(mr.internal.getWidth(n) / 2) + " " + Co(mr.internal.getHeight(n) / 2) + " cm"), e.push(a + " 0 m"), e.push(a + " " + A + " " + A + " " + a + " 0 " + a + " c"), e.push("-" + A + " " + a + " -" + a + " " + A + " -" + a + " 0 c"), e.push("-" + a + " -" + A + " -" + A + " -" + a + " 0 -" + a + " c"), e.push(A + " -" + a + " " + a + " -" + A + " " + a + " 0 c"), e.push("f"), e.push("Q"), t.stream = e.join(`
`), t;
} }, Cross: { createAppearanceStream: function(n) {
  var t = { D: { Off: mr.RadioButton.Cross.OffPushDown }, N: {} };
  return t.N[n] = mr.RadioButton.Cross.YesNormal, t.D[n] = mr.RadioButton.Cross.YesPushDown, t;
}, getCA: function() {
  return "8";
}, YesNormal: function(n) {
  var t = Li(n);
  t.scope = n.scope;
  var e = [], r = mr.internal.calculateCross(n);
  return e.push("q"), e.push("1 1 " + Vr(mr.internal.getWidth(n) - 2) + " " + Vr(mr.internal.getHeight(n) - 2) + " re"), e.push("W"), e.push("n"), e.push(Vr(r.x1.x) + " " + Vr(r.x1.y) + " m"), e.push(Vr(r.x2.x) + " " + Vr(r.x2.y) + " l"), e.push(Vr(r.x4.x) + " " + Vr(r.x4.y) + " m"), e.push(Vr(r.x3.x) + " " + Vr(r.x3.y) + " l"), e.push("s"), e.push("Q"), t.stream = e.join(`
`), t;
}, YesPushDown: function(n) {
  var t = Li(n);
  t.scope = n.scope;
  var e = mr.internal.calculateCross(n), r = [];
  return r.push("0.749023 g"), r.push("0 0 " + Vr(mr.internal.getWidth(n)) + " " + Vr(mr.internal.getHeight(n)) + " re"), r.push("f"), r.push("q"), r.push("1 1 " + Vr(mr.internal.getWidth(n) - 2) + " " + Vr(mr.internal.getHeight(n) - 2) + " re"), r.push("W"), r.push("n"), r.push(Vr(e.x1.x) + " " + Vr(e.x1.y) + " m"), r.push(Vr(e.x2.x) + " " + Vr(e.x2.y) + " l"), r.push(Vr(e.x4.x) + " " + Vr(e.x4.y) + " m"), r.push(Vr(e.x3.x) + " " + Vr(e.x3.y) + " l"), r.push("s"), r.push("Q"), t.stream = r.join(`
`), t;
}, OffPushDown: function(n) {
  var t = Li(n);
  t.scope = n.scope;
  var e = [];
  return e.push("0.749023 g"), e.push("0 0 " + Vr(mr.internal.getWidth(n)) + " " + Vr(mr.internal.getHeight(n)) + " re"), e.push("f"), t.stream = e.join(`
`), t;
} } }, createDefaultAppearanceStream: function(n) {
  var t = n.scope.internal.getFont(n.fontName, n.fontStyle).id, e = n.scope.__private__.encodeColorString(n.color);
  return "/" + t + " " + n.fontSize + " Tf " + e;
} };
mr.internal = { Bezier_C: 0.551915024494, calculateCross: function(n) {
  var t = mr.internal.getWidth(n), e = mr.internal.getHeight(n), r = Math.min(t, e);
  return { x1: { x: (t - r) / 2, y: (e - r) / 2 + r }, x2: { x: (t - r) / 2 + r, y: (e - r) / 2 }, x3: { x: (t - r) / 2, y: (e - r) / 2 }, x4: { x: (t - r) / 2 + r, y: (e - r) / 2 + r } };
} }, mr.internal.getWidth = function(n) {
  var t = 0;
  return In(n) === "object" && (t = Y1(n.Rect[2])), t;
}, mr.internal.getHeight = function(n) {
  var t = 0;
  return In(n) === "object" && (t = Y1(n.Rect[3])), t;
};
var W6 = Ma.addField = function(n) {
  if (P6(this, n), !(n instanceof vi)) throw new Error("Invalid argument passed to jsPDF.addField.");
  var t;
  return (t = n).scope.internal.acroformPlugin.printedOut && (t.scope.internal.acroformPlugin.printedOut = !1, t.scope.internal.acroformPlugin.acroFormDictionaryRoot = null), t.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t), n.page = n.scope.internal.getCurrentPageInfo().pageNumber, this;
};
Ma.AcroFormChoiceField = $l, Ma.AcroFormListBox = Vl, Ma.AcroFormComboBox = ql, Ma.AcroFormEditBox = md, Ma.AcroFormButton = TA, Ma.AcroFormPushButton = wd, Ma.AcroFormRadioButton = jl, Ma.AcroFormCheckBox = yd, Ma.AcroFormTextField = Al, Ma.AcroFormPasswordField = Bd, Ma.AcroFormAppearance = mr, Ma.AcroForm = { ChoiceField: $l, ListBox: Vl, ComboBox: ql, EditBox: md, Button: TA, PushButton: wd, RadioButton: jl, CheckBox: yd, TextField: Al, PasswordField: Bd, Appearance: mr }, kr.AcroForm = { ChoiceField: $l, ListBox: Vl, ComboBox: ql, EditBox: md, Button: TA, PushButton: wd, RadioButton: jl, CheckBox: yd, TextField: Al, PasswordField: Bd, Appearance: mr };
kr.AcroForm;
function uC(n) {
  return n.reduce(function(t, e, r) {
    return t[e] = r, t;
  }, {});
}
(function(n) {
  var t = "addImage_";
  n.__addimage__ = {};
  var e = "UNKNOWN", r = { PNG: [[137, 80, 78, 71]], TIFF: [[77, 77, 0, 42], [73, 73, 42, 0]], JPEG: [[255, 216, 255, 224, void 0, void 0, 74, 70, 73, 70, 0], [255, 216, 255, 225, void 0, void 0, 69, 120, 105, 102, 0, 0], [255, 216, 255, 219], [255, 216, 255, 238]], JPEG2000: [[0, 0, 0, 12, 106, 80, 32, 32]], GIF87a: [[71, 73, 70, 56, 55, 97]], GIF89a: [[71, 73, 70, 56, 57, 97]], WEBP: [[82, 73, 70, 70, void 0, void 0, void 0, void 0, 87, 69, 66, 80]], BMP: [[66, 77], [66, 65], [67, 73], [67, 80], [73, 67], [80, 84]] }, a = n.__addimage__.getImageFileTypeByImageData = function(T, E) {
    var Q, x, oe, J, S, I = e;
    if ((E = E || e) === "RGBA" || T.data !== void 0 && T.data instanceof Uint8ClampedArray && "height" in T && "width" in T) return "RGBA";
    if (q(T)) for (S in r) for (oe = r[S], Q = 0; Q < oe.length; Q += 1) {
      for (J = !0, x = 0; x < oe[Q].length; x += 1) if (oe[Q][x] !== void 0 && oe[Q][x] !== T[x]) {
        J = !1;
        break;
      }
      if (J === !0) {
        I = S;
        break;
      }
    }
    else for (S in r) for (oe = r[S], Q = 0; Q < oe.length; Q += 1) {
      for (J = !0, x = 0; x < oe[Q].length; x += 1) if (oe[Q][x] !== void 0 && oe[Q][x] !== T.charCodeAt(x)) {
        J = !1;
        break;
      }
      if (J === !0) {
        I = S;
        break;
      }
    }
    return I === e && E !== e && (I = E), I;
  }, A = function T(E) {
    for (var Q = this.internal.write, x = this.internal.putStream, oe = (0, this.internal.getFilters)(); oe.indexOf("FlateEncode") !== -1; ) oe.splice(oe.indexOf("FlateEncode"), 1);
    E.objectId = this.internal.newObject();
    var J = [];
    if (J.push({ key: "Type", value: "/XObject" }), J.push({ key: "Subtype", value: "/Image" }), J.push({ key: "Width", value: E.width }), J.push({ key: "Height", value: E.height }), E.colorSpace === m.INDEXED ? J.push({ key: "ColorSpace", value: "[/Indexed /DeviceRGB " + (E.palette.length / 3 - 1) + " " + ("sMask" in E && E.sMask !== void 0 ? E.objectId + 2 : E.objectId + 1) + " 0 R]" }) : (J.push({ key: "ColorSpace", value: "/" + E.colorSpace }), E.colorSpace === m.DEVICE_CMYK && J.push({ key: "Decode", value: "[1 0 1 0 1 0 1 0]" })), J.push({ key: "BitsPerComponent", value: E.bitsPerComponent }), "decodeParameters" in E && E.decodeParameters !== void 0 && J.push({ key: "DecodeParms", value: "<<" + E.decodeParameters + ">>" }), "transparency" in E && Array.isArray(E.transparency) && E.transparency.length > 0) {
      for (var S = "", I = 0, N = E.transparency.length; I < N; I++) S += E.transparency[I] + " " + E.transparency[I] + " ";
      J.push({ key: "Mask", value: "[" + S + "]" });
    }
    E.sMask !== void 0 && J.push({ key: "SMask", value: E.objectId + 1 + " 0 R" });
    var se = E.filter !== void 0 ? ["/" + E.filter] : void 0;
    if (x({ data: E.data, additionalKeyValues: J, alreadyAppliedFilters: se, objectId: E.objectId }), Q("endobj"), "sMask" in E && E.sMask !== void 0) {
      var Z, C = (Z = E.sMaskBitsPerComponent) !== null && Z !== void 0 ? Z : E.bitsPerComponent, H = { width: E.width, height: E.height, colorSpace: "DeviceGray", bitsPerComponent: C, data: E.sMask };
      "filter" in E && (H.decodeParameters = "/Predictor ".concat(E.predictor, " /Colors 1 /BitsPerComponent ").concat(C, " /Columns ").concat(E.width), H.filter = E.filter), T.call(this, H);
    }
    if (E.colorSpace === m.INDEXED) {
      var M = this.internal.newObject();
      x({ data: W(new Uint8Array(E.palette)), objectId: M }), Q("endobj");
    }
  }, i = function() {
    var T = this.internal.collections[t + "images"];
    for (var E in T) A.call(this, T[E]);
  }, s = function() {
    var T, E = this.internal.collections[t + "images"], Q = this.internal.write;
    for (var x in E) Q("/I" + (T = E[x]).index, T.objectId, "0", "R");
  }, o = function() {
    this.internal.collections[t + "images"] || (this.internal.collections[t + "images"] = {}, this.internal.events.subscribe("putResources", i), this.internal.events.subscribe("putXobjectDict", s));
  }, l = function() {
    var T = this.internal.collections[t + "images"];
    return o.call(this), T;
  }, u = function() {
    return Object.keys(this.internal.collections[t + "images"]).length;
  }, f = function(T) {
    return typeof n["process" + T.toUpperCase()] == "function";
  }, h = function(T) {
    return In(T) === "object" && T.nodeType === 1;
  }, c = function(T, E) {
    if (T.nodeName === "IMG" && T.hasAttribute("src")) {
      var Q = "" + T.getAttribute("src");
      if (Q.indexOf("data:image/") === 0) return pd(unescape(Q).split("base64,").pop());
      var x = n.loadFile(Q, !0);
      if (x !== void 0) return x;
    }
    if (T.nodeName === "CANVAS") {
      if (T.width === 0 || T.height === 0) throw new Error("Given canvas must have data. Canvas width: " + T.width + ", height: " + T.height);
      var oe;
      switch (E) {
        case "PNG":
          oe = "image/png";
          break;
        case "WEBP":
          oe = "image/webp";
          break;
        default:
          oe = "image/jpeg";
      }
      return pd(T.toDataURL(oe, 1).split("base64,").pop());
    }
  }, p = function(T) {
    var E = this.internal.collections[t + "images"];
    if (E) {
      for (var Q in E) if (T === E[Q].alias) return E[Q];
    }
  }, w = function(T, E, Q) {
    return T || E || (T = -96, E = -96), T < 0 && (T = -1 * Q.width * 72 / T / this.internal.scaleFactor), E < 0 && (E = -1 * Q.height * 72 / E / this.internal.scaleFactor), T === 0 && (T = E * Q.width / Q.height), E === 0 && (E = T * Q.height / Q.width), [T, E];
  }, y = function(T, E, Q, x, oe, J) {
    var S = w.call(this, Q, x, oe), I = this.internal.getCoordinateString, N = this.internal.getVerticalCoordinateString, se = l.call(this);
    if (Q = S[0], x = S[1], se[oe.index] = oe, J) {
      J *= Math.PI / 180;
      var Z = Math.cos(J), C = Math.sin(J), H = function(te) {
        return te.toFixed(4);
      }, M = [H(Z), H(C), H(-1 * C), H(Z), 0, 0, "cm"];
    }
    this.internal.write("q"), J ? (this.internal.write([1, "0", "0", 1, I(T), N(E + x), "cm"].join(" ")), this.internal.write(M.join(" ")), this.internal.write([I(Q), "0", "0", I(x), "0", "0", "cm"].join(" "))) : this.internal.write([I(Q), "0", "0", I(x), I(T), N(E + x), "cm"].join(" ")), this.isAdvancedAPI() && this.internal.write([1, 0, 0, -1, 0, 0, "cm"].join(" ")), this.internal.write("/I" + oe.index + " Do"), this.internal.write("Q");
  }, m = n.color_spaces = { DEVICE_RGB: "DeviceRGB", DEVICE_GRAY: "DeviceGray", DEVICE_CMYK: "DeviceCMYK", CAL_GREY: "CalGray", CAL_RGB: "CalRGB", LAB: "Lab", ICC_BASED: "ICCBased", INDEXED: "Indexed", PATTERN: "Pattern", SEPARATION: "Separation", DEVICE_N: "DeviceN" };
  n.decode = { DCT_DECODE: "DCTDecode", FLATE_DECODE: "FlateDecode", LZW_DECODE: "LZWDecode", JPX_DECODE: "JPXDecode", JBIG2_DECODE: "JBIG2Decode", ASCII85_DECODE: "ASCII85Decode", ASCII_HEX_DECODE: "ASCIIHexDecode", RUN_LENGTH_DECODE: "RunLengthDecode", CCITT_FAX_DECODE: "CCITTFaxDecode" };
  var k = n.image_compression = { NONE: "NONE", FAST: "FAST", MEDIUM: "MEDIUM", SLOW: "SLOW" }, D = n.__addimage__.sHashCode = function(T) {
    var E, Q, x = 0;
    if (typeof T == "string") for (Q = T.length, E = 0; E < Q; E++) x = (x << 5) - x + T.charCodeAt(E), x |= 0;
    else if (q(T)) for (Q = T.byteLength / 2, E = 0; E < Q; E++) x = (x << 5) - x + T[E], x |= 0;
    return x;
  }, B = n.__addimage__.validateStringAsBase64 = function(T) {
    (T = T || "").toString().trim();
    var E = !0;
    return T.length === 0 && (E = !1), T.length % 4 != 0 && (E = !1), /^[A-Za-z0-9+/]+$/.test(T.substr(0, T.length - 2)) === !1 && (E = !1), /^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(T.substr(-2)) === !1 && (E = !1), E;
  }, O = n.__addimage__.extractImageFromDataUrl = function(T) {
    if (T == null || !(T = T.trim()).startsWith("data:")) return null;
    var E = T.indexOf(",");
    return E < 0 ? null : T.substring(0, E).trim().endsWith("base64") ? T.substring(E + 1) : null;
  };
  n.__addimage__.isArrayBuffer = function(T) {
    return T instanceof ArrayBuffer;
  };
  var q = n.__addimage__.isArrayBufferView = function(T) {
    return T instanceof Int8Array || T instanceof Uint8Array || T instanceof Uint8ClampedArray || T instanceof Int16Array || T instanceof Uint16Array || T instanceof Int32Array || T instanceof Uint32Array || T instanceof Float32Array || T instanceof Float64Array;
  }, G = n.__addimage__.binaryStringToUint8Array = function(T) {
    for (var E = T.length, Q = new Uint8Array(E), x = 0; x < E; x++) Q[x] = T.charCodeAt(x);
    return Q;
  }, W = n.__addimage__.arrayBufferToBinaryString = function(T) {
    for (var E = "", Q = q(T) ? T : new Uint8Array(T), x = 0; x < Q.length; x += 8192) E += String.fromCharCode.apply(null, Q.subarray(x, x + 8192));
    return E;
  };
  n.addImage = function() {
    var T, E, Q, x, oe, J, S, I, N;
    if (typeof arguments[1] == "number" ? (E = e, Q = arguments[1], x = arguments[2], oe = arguments[3], J = arguments[4], S = arguments[5], I = arguments[6], N = arguments[7]) : (E = arguments[1], Q = arguments[2], x = arguments[3], oe = arguments[4], J = arguments[5], S = arguments[6], I = arguments[7], N = arguments[8]), In(T = arguments[0]) === "object" && !h(T) && "imageData" in T) {
      var se = T;
      T = se.imageData, E = se.format || E || e, Q = se.x || Q || 0, x = se.y || x || 0, oe = se.w || se.width || oe, J = se.h || se.height || J, S = se.alias || S, I = se.compression || I, N = se.rotation || se.angle || N;
    }
    var Z = this.internal.getFilters();
    if (I === void 0 && Z.indexOf("FlateEncode") !== -1 && (I = "SLOW"), isNaN(Q) || isNaN(x)) throw new Error("Invalid coordinates passed to jsPDF.addImage");
    o.call(this);
    var C = F.call(this, T, E, S, I);
    return y.call(this, Q, x, oe, J, C, N), this;
  };
  var F = function(T, E, Q, x) {
    var oe, J, S;
    if (typeof T == "string" && a(T) === e) {
      T = unescape(T);
      var I = Y(T, !1);
      (I !== "" || (I = n.loadFile(T, !0)) !== void 0) && (T = I);
    }
    if (h(T) && (T = c(T, E)), E = a(T, E), !f(E)) throw new Error("addImage does not support files of type '" + E + "', please ensure that a plugin for '" + E + "' support is added.");
    if (((S = Q) == null || S.length === 0) && (Q = (function(N) {
      return typeof N == "string" || q(N) ? D(N) : q(N.data) ? D(N.data) : null;
    })(T)), (oe = p.call(this, Q)) || (T instanceof Uint8Array || E === "RGBA" || (J = T, T = G(T)), oe = this["process" + E.toUpperCase()](T, u.call(this), Q, (function(N) {
      return N && typeof N == "string" && (N = N.toUpperCase()), N in n.image_compression ? N : k.NONE;
    })(x), J)), !oe) throw new Error("An unknown error occurred whilst processing the image.");
    return oe;
  }, Y = n.__addimage__.convertBase64ToBinaryString = function(T, E) {
    E = typeof E != "boolean" || E;
    var Q, x = "";
    if (typeof T == "string") {
      var oe;
      Q = (oe = O(T)) !== null && oe !== void 0 ? oe : T;
      try {
        x = pd(Q);
      } catch (J) {
        if (E) throw B(Q) ? new Error("atob-Error in jsPDF.convertBase64ToBinaryString " + J.message) : new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ");
      }
    }
    return x;
  };
  n.getImageProperties = function(T) {
    var E, Q, x = "";
    if (h(T) && (T = c(T)), typeof T == "string" && a(T) === e && ((x = Y(T, !1)) === "" && (x = n.loadFile(T) || ""), T = x), Q = a(T), !f(Q)) throw new Error("addImage does not support files of type '" + Q + "', please ensure that a plugin for '" + Q + "' support is added.");
    if (T instanceof Uint8Array || (T = G(T)), !(E = this["process" + Q.toUpperCase()](T))) throw new Error("An unknown error occurred whilst processing the image");
    return E.fileType = Q, E;
  };
})(kr.API), /**
 * @license
 * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */
(function(n) {
  var t = function(e) {
    if (e !== void 0 && e != "") return !0;
  };
  kr.API.events.push(["addPage", function(e) {
    this.internal.getPageInfo(e.pageNumber).pageContext.annotations = [];
  }]), n.events.push(["putPage", function(e) {
    for (var r, a, A, i = this.internal.getCoordinateString, s = this.internal.getVerticalCoordinateString, o = this.internal.getPageInfoByObjId(e.objId), l = e.pageContext.annotations, u = !1, f = 0; f < l.length && !u; f++) switch ((r = l[f]).type) {
      case "link":
        (t(r.options.url) || t(r.options.pageNumber)) && (u = !0);
        break;
      case "reference":
      case "text":
      case "freetext":
        u = !0;
    }
    if (u != 0) {
      this.internal.write("/Annots [");
      for (var h = 0; h < l.length; h++) {
        r = l[h];
        var c = this.internal.pdfEscape, p = this.internal.getEncryptor(e.objId);
        switch (r.type) {
          case "reference":
            this.internal.write(" " + r.object.objId + " 0 R ");
            break;
          case "text":
            var w = this.internal.newAdditionalObject(), y = this.internal.newAdditionalObject(), m = this.internal.getEncryptor(w.objId), k = r.title || "Note";
            A = "<</Type /Annot /Subtype /Text " + (a = "/Rect [" + i(r.bounds.x) + " " + s(r.bounds.y + r.bounds.h) + " " + i(r.bounds.x + r.bounds.w) + " " + s(r.bounds.y) + "] ") + "/Contents (" + c(m(r.contents)) + ")", A += " /Popup " + y.objId + " 0 R", A += " /P " + o.objId + " 0 R", A += " /T (" + c(m(k)) + ") >>", w.content = A;
            var D = w.objId + " 0 R";
            A = "<</Type /Annot /Subtype /Popup " + (a = "/Rect [" + i(r.bounds.x + 30) + " " + s(r.bounds.y + r.bounds.h) + " " + i(r.bounds.x + r.bounds.w + 30) + " " + s(r.bounds.y) + "] ") + " /Parent " + D, r.open && (A += " /Open true"), A += " >>", y.content = A, this.internal.write(w.objId, "0 R", y.objId, "0 R");
            break;
          case "freetext":
            a = "/Rect [" + i(r.bounds.x) + " " + s(r.bounds.y) + " " + i(r.bounds.x + r.bounds.w) + " " + s(r.bounds.y + r.bounds.h) + "] ";
            var B = "font: Helvetica,sans-serif 12.0pt; text-align:left; color:#" + (r.color || "#000000");
            A = "<</Type /Annot /Subtype /FreeText " + a + "/Contents (" + c(p(r.contents)) + ")", A += " /DS(" + c(p(B)) + ")", A += " /Border [0 0 0]", A += " >>", this.internal.write(A);
            break;
          case "link":
            if (r.options.name) {
              var O = this.annotations._nameMap[r.options.name];
              r.options.pageNumber = O.page, r.options.top = O.y;
            } else r.options.top || (r.options.top = 0);
            if (a = "/Rect [" + r.finalBounds.x + " " + r.finalBounds.y + " " + r.finalBounds.w + " " + r.finalBounds.h + "] ", A = "", r.options.url) A = "<</Type /Annot /Subtype /Link " + a + "/Border [0 0 0] /A <</S /URI /URI (" + c(p(r.options.url)) + ") >>";
            else if (r.options.pageNumber) switch (A = "<</Type /Annot /Subtype /Link " + a + "/Border [0 0 0] /Dest [" + this.internal.getPageInfo(r.options.pageNumber).objId + " 0 R", r.options.magFactor = r.options.magFactor || "XYZ", r.options.magFactor) {
              case "Fit":
                A += " /Fit]";
                break;
              case "FitH":
                A += " /FitH " + r.options.top + "]";
                break;
              case "FitV":
                r.options.left = r.options.left || 0, A += " /FitV " + r.options.left + "]";
                break;
              default:
                var q = s(r.options.top);
                r.options.left = r.options.left || 0, r.options.zoom === void 0 && (r.options.zoom = 0), A += " /XYZ " + r.options.left + " " + q + " " + r.options.zoom + "]";
            }
            A != "" && (A += " >>", this.internal.write(A));
        }
      }
      this.internal.write("]");
    }
  }]), n.createAnnotation = function(e) {
    var r = this.internal.getCurrentPageInfo();
    switch (e.type) {
      case "link":
        this.link(e.bounds.x, e.bounds.y, e.bounds.w, e.bounds.h, e);
        break;
      case "text":
      case "freetext":
        r.pageContext.annotations.push(e);
    }
  }, n.link = function(e, r, a, A, i) {
    var s = this.internal.getCurrentPageInfo(), o = this.internal.getCoordinateString, l = this.internal.getVerticalCoordinateString;
    s.pageContext.annotations.push({ finalBounds: { x: o(e), y: l(r), w: o(e + a), h: l(r + A) }, options: i, type: "link" });
  }, n.textWithLink = function(e, r, a, A) {
    var i, s, o = this.getTextWidth(e), l = this.internal.getLineHeight() / this.internal.scaleFactor;
    if (A.maxWidth !== void 0) {
      s = A.maxWidth;
      var u = this.splitTextToSize(e, s).length;
      i = Math.ceil(l * u);
    } else s = o, i = l;
    return this.text(e, r, a, A), a += 0.2 * l, A.align === "center" && (r -= o / 2), A.align === "right" && (r -= o), this.link(r, a - l, s, i, A), o;
  }, n.getTextWidth = function(e) {
    var r = this.internal.getFontSize();
    return this.getStringUnitWidth(e) * r / this.internal.scaleFactor;
  };
})(kr.API), /**
 * @license
 * Copyright (c) 2017 Aras Abbasi
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */
(function(n) {
  var t = { 1569: [65152], 1570: [65153, 65154], 1571: [65155, 65156], 1572: [65157, 65158], 1573: [65159, 65160], 1574: [65161, 65162, 65163, 65164], 1575: [65165, 65166], 1576: [65167, 65168, 65169, 65170], 1577: [65171, 65172], 1578: [65173, 65174, 65175, 65176], 1579: [65177, 65178, 65179, 65180], 1580: [65181, 65182, 65183, 65184], 1581: [65185, 65186, 65187, 65188], 1582: [65189, 65190, 65191, 65192], 1583: [65193, 65194], 1584: [65195, 65196], 1585: [65197, 65198], 1586: [65199, 65200], 1587: [65201, 65202, 65203, 65204], 1588: [65205, 65206, 65207, 65208], 1589: [65209, 65210, 65211, 65212], 1590: [65213, 65214, 65215, 65216], 1591: [65217, 65218, 65219, 65220], 1592: [65221, 65222, 65223, 65224], 1593: [65225, 65226, 65227, 65228], 1594: [65229, 65230, 65231, 65232], 1601: [65233, 65234, 65235, 65236], 1602: [65237, 65238, 65239, 65240], 1603: [65241, 65242, 65243, 65244], 1604: [65245, 65246, 65247, 65248], 1605: [65249, 65250, 65251, 65252], 1606: [65253, 65254, 65255, 65256], 1607: [65257, 65258, 65259, 65260], 1608: [65261, 65262], 1609: [65263, 65264, 64488, 64489], 1610: [65265, 65266, 65267, 65268], 1649: [64336, 64337], 1655: [64477], 1657: [64358, 64359, 64360, 64361], 1658: [64350, 64351, 64352, 64353], 1659: [64338, 64339, 64340, 64341], 1662: [64342, 64343, 64344, 64345], 1663: [64354, 64355, 64356, 64357], 1664: [64346, 64347, 64348, 64349], 1667: [64374, 64375, 64376, 64377], 1668: [64370, 64371, 64372, 64373], 1670: [64378, 64379, 64380, 64381], 1671: [64382, 64383, 64384, 64385], 1672: [64392, 64393], 1676: [64388, 64389], 1677: [64386, 64387], 1678: [64390, 64391], 1681: [64396, 64397], 1688: [64394, 64395], 1700: [64362, 64363, 64364, 64365], 1702: [64366, 64367, 64368, 64369], 1705: [64398, 64399, 64400, 64401], 1709: [64467, 64468, 64469, 64470], 1711: [64402, 64403, 64404, 64405], 1713: [64410, 64411, 64412, 64413], 1715: [64406, 64407, 64408, 64409], 1722: [64414, 64415], 1723: [64416, 64417, 64418, 64419], 1726: [64426, 64427, 64428, 64429], 1728: [64420, 64421], 1729: [64422, 64423, 64424, 64425], 1733: [64480, 64481], 1734: [64473, 64474], 1735: [64471, 64472], 1736: [64475, 64476], 1737: [64482, 64483], 1739: [64478, 64479], 1740: [64508, 64509, 64510, 64511], 1744: [64484, 64485, 64486, 64487], 1746: [64430, 64431], 1747: [64432, 64433] }, e = { 65247: { 65154: 65269, 65156: 65271, 65160: 65273, 65166: 65275 }, 65248: { 65154: 65270, 65156: 65272, 65160: 65274, 65166: 65276 }, 65165: { 65247: { 65248: { 65258: 65010 } } }, 1617: { 1612: 64606, 1613: 64607, 1614: 64608, 1615: 64609, 1616: 64610 } }, r = { 1612: 64606, 1613: 64607, 1614: 64608, 1615: 64609, 1616: 64610 }, a = [1570, 1571, 1573, 1575];
  n.__arabicParser__ = {};
  var A = n.__arabicParser__.isInArabicSubstitutionA = function(w) {
    return t[w.charCodeAt(0)] !== void 0;
  }, i = n.__arabicParser__.isArabicLetter = function(w) {
    return typeof w == "string" && /^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(w);
  }, s = n.__arabicParser__.isArabicEndLetter = function(w) {
    return i(w) && A(w) && t[w.charCodeAt(0)].length <= 2;
  }, o = n.__arabicParser__.isArabicAlfLetter = function(w) {
    return i(w) && a.indexOf(w.charCodeAt(0)) >= 0;
  };
  n.__arabicParser__.arabicLetterHasIsolatedForm = function(w) {
    return i(w) && A(w) && t[w.charCodeAt(0)].length >= 1;
  };
  var l = n.__arabicParser__.arabicLetterHasFinalForm = function(w) {
    return i(w) && A(w) && t[w.charCodeAt(0)].length >= 2;
  };
  n.__arabicParser__.arabicLetterHasInitialForm = function(w) {
    return i(w) && A(w) && t[w.charCodeAt(0)].length >= 3;
  };
  var u = n.__arabicParser__.arabicLetterHasMedialForm = function(w) {
    return i(w) && A(w) && t[w.charCodeAt(0)].length == 4;
  }, f = n.__arabicParser__.resolveLigatures = function(w) {
    var y = 0, m = e, k = "", D = 0;
    for (y = 0; y < w.length; y += 1) m[w.charCodeAt(y)] !== void 0 ? (D++, typeof (m = m[w.charCodeAt(y)]) == "number" && (k += String.fromCharCode(m), m = e, D = 0), y === w.length - 1 && (m = e, k += w.charAt(y - (D - 1)), y -= D - 1, D = 0)) : (m = e, k += w.charAt(y - D), y -= D, D = 0);
    return k;
  };
  n.__arabicParser__.isArabicDiacritic = function(w) {
    return w !== void 0 && r[w.charCodeAt(0)] !== void 0;
  };
  var h = n.__arabicParser__.getCorrectForm = function(w, y, m) {
    return i(w) ? A(w) === !1 ? -1 : !l(w) || !i(y) && !i(m) || !i(m) && s(y) || s(w) && !i(y) || s(w) && o(y) || s(w) && s(y) ? 0 : u(w) && i(y) && !s(y) && i(m) && l(m) ? 3 : s(w) || !i(m) ? 1 : 2 : -1;
  }, c = function(w) {
    var y = 0, m = 0, k = 0, D = "", B = "", O = "", q = (w = w || "").split("\\s+"), G = [];
    for (y = 0; y < q.length; y += 1) {
      for (G.push(""), m = 0; m < q[y].length; m += 1) D = q[y][m], B = q[y][m - 1], O = q[y][m + 1], i(D) ? (k = h(D, B, O), G[y] += k !== -1 ? String.fromCharCode(t[D.charCodeAt(0)][k]) : D) : G[y] += D;
      G[y] = f(G[y]);
    }
    return G.join(" ");
  }, p = n.__arabicParser__.processArabic = n.processArabic = function() {
    var w, y = typeof arguments[0] == "string" ? arguments[0] : arguments[0].text, m = [];
    if (Array.isArray(y)) {
      var k = 0;
      for (m = [], k = 0; k < y.length; k += 1) Array.isArray(y[k]) ? m.push([c(y[k][0]), y[k][1], y[k][2]]) : m.push([c(y[k])]);
      w = m;
    } else w = c(y);
    return typeof arguments[0] == "string" ? w : (arguments[0].text = w, arguments[0]);
  };
  n.events.push(["preProcessText", p]);
})(kr.API), kr.API.autoPrint = function(n) {
  var t;
  return (n = n || {}).variant = n.variant || "non-conform", n.variant === "javascript" ? this.addJS("print({});") : (this.internal.events.subscribe("postPutResources", function() {
    t = this.internal.newObject(), this.internal.out("<<"), this.internal.out("/S /Named"), this.internal.out("/Type /Action"), this.internal.out("/N /Print"), this.internal.out(">>"), this.internal.out("endobj");
  }), this.internal.events.subscribe("putCatalog", function() {
    this.internal.out("/OpenAction " + t + " 0 R");
  })), this;
}, /**
 * @license
 * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */
(function(n) {
  var t = function() {
    var e = void 0;
    Object.defineProperty(this, "pdf", { get: function() {
      return e;
    }, set: function(s) {
      e = s;
    } });
    var r = 150;
    Object.defineProperty(this, "width", { get: function() {
      return r;
    }, set: function(s) {
      r = isNaN(s) || Number.isInteger(s) === !1 || s < 0 ? 150 : s, this.getContext("2d").pageWrapXEnabled && (this.getContext("2d").pageWrapX = r + 1);
    } });
    var a = 300;
    Object.defineProperty(this, "height", { get: function() {
      return a;
    }, set: function(s) {
      a = isNaN(s) || Number.isInteger(s) === !1 || s < 0 ? 300 : s, this.getContext("2d").pageWrapYEnabled && (this.getContext("2d").pageWrapY = a + 1);
    } });
    var A = [];
    Object.defineProperty(this, "childNodes", { get: function() {
      return A;
    }, set: function(s) {
      A = s;
    } });
    var i = {};
    Object.defineProperty(this, "style", { get: function() {
      return i;
    }, set: function(s) {
      i = s;
    } }), Object.defineProperty(this, "parentNode", {});
  };
  t.prototype.getContext = function(e, r) {
    var a;
    if ((e = e || "2d") !== "2d") return null;
    for (a in r) this.pdf.context2d.hasOwnProperty(a) && (this.pdf.context2d[a] = r[a]);
    return this.pdf.context2d._canvas = this, this.pdf.context2d;
  }, t.prototype.toDataURL = function() {
    throw new Error("toDataURL is not implemented.");
  }, n.events.push(["initialized", function() {
    this.canvas = new t(), this.canvas.pdf = this;
  }]);
})(kr.API), (function(n) {
  var t = { left: 0, top: 0, bottom: 0, right: 0 }, e = !1, r = function() {
    this.internal.__cell__ === void 0 && (this.internal.__cell__ = {}, this.internal.__cell__.padding = 3, this.internal.__cell__.headerFunction = void 0, this.internal.__cell__.margins = Object.assign({}, t), this.internal.__cell__.margins.width = this.getPageWidth(), a.call(this));
  }, a = function() {
    this.internal.__cell__.lastCell = new A(), this.internal.__cell__.pages = 1;
  }, A = function() {
    var o = arguments[0];
    Object.defineProperty(this, "x", { enumerable: !0, get: function() {
      return o;
    }, set: function(w) {
      o = w;
    } });
    var l = arguments[1];
    Object.defineProperty(this, "y", { enumerable: !0, get: function() {
      return l;
    }, set: function(w) {
      l = w;
    } });
    var u = arguments[2];
    Object.defineProperty(this, "width", { enumerable: !0, get: function() {
      return u;
    }, set: function(w) {
      u = w;
    } });
    var f = arguments[3];
    Object.defineProperty(this, "height", { enumerable: !0, get: function() {
      return f;
    }, set: function(w) {
      f = w;
    } });
    var h = arguments[4];
    Object.defineProperty(this, "text", { enumerable: !0, get: function() {
      return h;
    }, set: function(w) {
      h = w;
    } });
    var c = arguments[5];
    Object.defineProperty(this, "lineNumber", { enumerable: !0, get: function() {
      return c;
    }, set: function(w) {
      c = w;
    } });
    var p = arguments[6];
    return Object.defineProperty(this, "align", { enumerable: !0, get: function() {
      return p;
    }, set: function(w) {
      p = w;
    } }), this;
  };
  A.prototype.clone = function() {
    return new A(this.x, this.y, this.width, this.height, this.text, this.lineNumber, this.align);
  }, A.prototype.toArray = function() {
    return [this.x, this.y, this.width, this.height, this.text, this.lineNumber, this.align];
  }, n.setHeaderFunction = function(o) {
    return r.call(this), this.internal.__cell__.headerFunction = typeof o == "function" ? o : void 0, this;
  }, n.getTextDimensions = function(o, l) {
    r.call(this);
    var u = (l = l || {}).fontSize || this.getFontSize(), f = l.font || this.getFont(), h = l.scaleFactor || this.internal.scaleFactor, c = 0, p = 0, w = 0, y = this;
    if (!Array.isArray(o) && typeof o != "string") {
      if (typeof o != "number") throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");
      o = String(o);
    }
    var m = l.maxWidth;
    m > 0 ? typeof o == "string" ? o = this.splitTextToSize(o, m) : Object.prototype.toString.call(o) === "[object Array]" && (o = o.reduce(function(D, B) {
      return D.concat(y.splitTextToSize(B, m));
    }, [])) : o = Array.isArray(o) ? o : [o];
    for (var k = 0; k < o.length; k++) c < (w = this.getStringUnitWidth(o[k], { font: f }) * u) && (c = w);
    return c !== 0 && (p = o.length), { w: c /= h, h: Math.max((p * u * this.getLineHeightFactor() - u * (this.getLineHeightFactor() - 1)) / h, 0) };
  }, n.cellAddPage = function() {
    r.call(this), this.addPage();
    var o = this.internal.__cell__.margins || t;
    return this.internal.__cell__.lastCell = new A(o.left, o.top, void 0, void 0), this.internal.__cell__.pages += 1, this;
  };
  var i = n.cell = function() {
    var o;
    o = arguments[0] instanceof A ? arguments[0] : new A(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6]), r.call(this);
    var l = this.internal.__cell__.lastCell, u = this.internal.__cell__.padding, f = this.internal.__cell__.margins || t, h = this.internal.__cell__.tableHeaderRow, c = this.internal.__cell__.printHeaders;
    return l.lineNumber !== void 0 && (l.lineNumber === o.lineNumber ? (o.x = (l.x || 0) + (l.width || 0), o.y = l.y || 0) : l.y + l.height + o.height + f.bottom > this.getPageHeight() ? (this.cellAddPage(), o.y = f.top, c && h && (this.printHeaderRow(o.lineNumber, !0), o.y += h[0].height)) : o.y = l.y + l.height || o.y), o.text[0] !== void 0 && (this.rect(o.x, o.y, o.width, o.height, e === !0 ? "FD" : void 0), o.align === "right" ? this.text(o.text, o.x + o.width - u, o.y + u, { align: "right", baseline: "top" }) : o.align === "center" ? this.text(o.text, o.x + o.width / 2, o.y + u, { align: "center", baseline: "top", maxWidth: o.width - u - u }) : this.text(o.text, o.x + u, o.y + u, { align: "left", baseline: "top", maxWidth: o.width - u - u })), this.internal.__cell__.lastCell = o, this;
  };
  n.table = function(o, l, u, f, h) {
    if (r.call(this), !u) throw new Error("No data for PDF table.");
    var c, p, w, y, m = [], k = [], D = [], B = {}, O = {}, q = [], G = [], W = (h = h || {}).autoSize || !1, F = h.printHeaders !== !1, Y = h.css && h.css["font-size"] !== void 0 ? 16 * h.css["font-size"] : h.fontSize || 12, T = h.margins || Object.assign({ width: this.getPageWidth() }, t), E = typeof h.padding == "number" ? h.padding : 3, Q = h.headerBackgroundColor || "#c8c8c8", x = h.headerTextColor || "#000";
    if (a.call(this), this.internal.__cell__.printHeaders = F, this.internal.__cell__.margins = T, this.internal.__cell__.table_font_size = Y, this.internal.__cell__.padding = E, this.internal.__cell__.headerBackgroundColor = Q, this.internal.__cell__.headerTextColor = x, this.setFontSize(Y), f == null) k = m = Object.keys(u[0]), D = m.map(function() {
      return "left";
    });
    else if (Array.isArray(f) && In(f[0]) === "object") for (m = f.map(function(se) {
      return se.name;
    }), k = f.map(function(se) {
      return se.prompt || se.name || "";
    }), D = f.map(function(se) {
      return se.align || "left";
    }), c = 0; c < f.length; c += 1) O[f[c].name] = 0.7499990551181103 * f[c].width;
    else Array.isArray(f) && typeof f[0] == "string" && (k = m = f, D = m.map(function() {
      return "left";
    }));
    if (W || Array.isArray(f) && typeof f[0] == "string") for (c = 0; c < m.length; c += 1) {
      for (B[y = m[c]] = u.map(function(se) {
        return se[y];
      }), this.setFont(void 0, "bold"), q.push(this.getTextDimensions(k[c], { fontSize: this.internal.__cell__.table_font_size, scaleFactor: this.internal.scaleFactor }).w), p = B[y], this.setFont(void 0, "normal"), w = 0; w < p.length; w += 1) q.push(this.getTextDimensions(p[w], { fontSize: this.internal.__cell__.table_font_size, scaleFactor: this.internal.scaleFactor }).w);
      O[y] = Math.max.apply(null, q) + E + E, q = [];
    }
    if (F) {
      var oe = {};
      for (c = 0; c < m.length; c += 1) oe[m[c]] = {}, oe[m[c]].text = k[c], oe[m[c]].align = D[c];
      var J = s.call(this, oe, O);
      G = m.map(function(se) {
        return new A(o, l, O[se], J, oe[se].text, void 0, oe[se].align);
      }), this.setTableHeaderRow(G), this.printHeaderRow(1, !1);
    }
    var S = f.reduce(function(se, Z) {
      return se[Z.name] = Z.align, se;
    }, {});
    for (c = 0; c < u.length; c += 1) {
      "rowStart" in h && h.rowStart instanceof Function && h.rowStart({ row: c, data: u[c] }, this);
      var I = s.call(this, u[c], O);
      for (w = 0; w < m.length; w += 1) {
        var N = u[c][m[w]];
        "cellStart" in h && h.cellStart instanceof Function && h.cellStart({ row: c, col: w, data: N }, this), i.call(this, new A(o, l, O[m[w]], I, N, c + 2, S[m[w]]));
      }
    }
    return this.internal.__cell__.table_x = o, this.internal.__cell__.table_y = l, this;
  };
  var s = function(o, l) {
    var u = this.internal.__cell__.padding, f = this.internal.__cell__.table_font_size, h = this.internal.scaleFactor;
    return Object.keys(o).map(function(c) {
      var p = o[c];
      return this.splitTextToSize(p.hasOwnProperty("text") ? p.text : p, l[c] - u - u);
    }, this).map(function(c) {
      return this.getLineHeightFactor() * c.length * f / h + u + u;
    }, this).reduce(function(c, p) {
      return Math.max(c, p);
    }, 0);
  };
  n.setTableHeaderRow = function(o) {
    r.call(this), this.internal.__cell__.tableHeaderRow = o;
  }, n.printHeaderRow = function(o, l) {
    if (r.call(this), !this.internal.__cell__.tableHeaderRow) throw new Error("Property tableHeaderRow does not exist.");
    var u;
    if (e = !0, typeof this.internal.__cell__.headerFunction == "function") {
      var f = this.internal.__cell__.headerFunction(this, this.internal.__cell__.pages);
      this.internal.__cell__.lastCell = new A(f[0], f[1], f[2], f[3], void 0, -1);
    }
    this.setFont(void 0, "bold");
    for (var h = [], c = 0; c < this.internal.__cell__.tableHeaderRow.length; c += 1) {
      u = this.internal.__cell__.tableHeaderRow[c].clone(), l && (u.y = this.internal.__cell__.margins.top || 0, h.push(u)), u.lineNumber = o;
      var p = this.getTextColor();
      this.setTextColor(this.internal.__cell__.headerTextColor), this.setFillColor(this.internal.__cell__.headerBackgroundColor), i.call(this, u), this.setTextColor(p);
    }
    h.length > 0 && this.setTableHeaderRow(h), this.setFont(void 0, "normal"), e = !1;
  };
})(kr.API);
var cC = { italic: ["italic", "oblique", "normal"], oblique: ["oblique", "italic", "normal"], normal: ["normal", "oblique", "italic"] }, dC = ["ultra-condensed", "extra-condensed", "condensed", "semi-condensed", "normal", "semi-expanded", "expanded", "extra-expanded", "ultra-expanded"], Tp = uC(dC), fC = [100, 200, 300, 400, 500, 600, 700, 800, 900], K6 = uC(fC);
function Gf(n) {
  var t = n.family.replace(/"|'/g, "").toLowerCase(), e = (function(A) {
    return cC[A = A || "normal"] ? A : "normal";
  })(n.style), r = (function(A) {
    return A ? typeof A == "number" ? A >= 100 && A <= 900 && A % 100 == 0 ? A : 400 : /^\d00$/.test(A) ? parseInt(A) : A === "bold" ? 700 : 400 : 400;
  })(n.weight), a = (function(A) {
    return typeof Tp[A = A || "normal"] == "number" ? A : "normal";
  })(n.stretch);
  return { family: t, style: e, weight: r, stretch: a, src: n.src || [], ref: n.ref || { name: t, style: [a, e, r].join(" ") } };
}
function G1(n, t, e, r) {
  var a;
  for (a = e; a >= 0 && a < t.length; a += r) if (n[t[a]]) return n[t[a]];
  for (a = e; a >= 0 && a < t.length; a -= r) if (n[t[a]]) return n[t[a]];
}
var $6 = { "sans-serif": "helvetica", fixed: "courier", monospace: "courier", terminal: "courier", cursive: "times", fantasy: "times", serif: "times" }, z1 = { caption: "times", icon: "times", menu: "times", "message-box": "times", "small-caption": "times", "status-bar": "times" };
function X1(n) {
  return [n.stretch, n.style, n.weight, n.family].join(" ");
}
function J1(n) {
  return n.trimLeft();
}
function V6(n, t) {
  for (var e = 0; e < n.length; ) {
    if (n.charAt(e) === t) return [n.substring(0, e), n.substring(e + 1)];
    e += 1;
  }
  return null;
}
function q6(n) {
  var t = n.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);
  return t === null ? null : [t[0], n.substring(t[0].length)];
}
var kl, Hc, Z1, ew, tw, zf = ["times"];
function rw(n, t, e, r, a) {
  var A = 4, i = aw;
  switch (a) {
    case kr.API.image_compression.FAST:
      A = 1, i = nw;
      break;
    case kr.API.image_compression.MEDIUM:
      A = 6, i = Aw;
      break;
    case kr.API.image_compression.SLOW:
      A = 9, i = sw;
  }
  n = (function(o, l, u, f) {
    for (var h, c = o.length / l, p = new Uint8Array(o.length + c), w = [j6, nw, aw, Aw, sw], y = 0; y < c; y += 1) {
      var m = y * l, k = o.subarray(m, m + l);
      if (f) p.set(f(k, u, h), m + y);
      else {
        for (var D = w.length, B = [], O = 0; O < D; O += 1) B[O] = w[O](k, u, h);
        var q = G6(B.concat());
        p.set(B[q], m + y);
      }
      h = k;
    }
    return p;
  })(n, t, Math.ceil(e * r / 8), i);
  var s = mp(n, { level: A });
  return kr.API.__addimage__.arrayBufferToBinaryString(s);
}
function j6(n) {
  var t = Array.apply([], n);
  return t.unshift(0), t;
}
function nw(n, t) {
  var e = n.length, r = [];
  r[0] = 1;
  for (var a = 0; a < e; a += 1) {
    var A = n[a - t] || 0;
    r[a + 1] = n[a] - A + 256 & 255;
  }
  return r;
}
function aw(n, t, e) {
  var r = n.length, a = [];
  a[0] = 2;
  for (var A = 0; A < r; A += 1) {
    var i = e && e[A] || 0;
    a[A + 1] = n[A] - i + 256 & 255;
  }
  return a;
}
function Aw(n, t, e) {
  var r = n.length, a = [];
  a[0] = 3;
  for (var A = 0; A < r; A += 1) {
    var i = n[A - t] || 0, s = e && e[A] || 0;
    a[A + 1] = n[A] + 256 - (i + s >>> 1) & 255;
  }
  return a;
}
function sw(n, t, e) {
  var r = n.length, a = [];
  a[0] = 4;
  for (var A = 0; A < r; A += 1) {
    var i = Y6(n[A - t] || 0, e && e[A] || 0, e && e[A - t] || 0);
    a[A + 1] = n[A] - i + 256 & 255;
  }
  return a;
}
function Y6(n, t, e) {
  if (n === t && t === e) return n;
  var r = Math.abs(t - e), a = Math.abs(n - e), A = Math.abs(n + t - e - e);
  return r <= a && r <= A ? n : a <= A ? t : e;
}
function G6(n) {
  var t = n.map(function(e) {
    return e.reduce(function(r, a) {
      return r + Math.abs(a);
    }, 0);
  });
  return t.indexOf(Math.min.apply(null, t));
}
function Xf(n, t, e) {
  var r = t * e, a = Math.floor(r / 8), A = 16 - (r - 8 * a + e), i = (1 << e) - 1;
  return hC(n, a) >> A & i;
}
function iw(n, t, e, r) {
  var a = e * r, A = Math.floor(a / 8), i = 16 - (a - 8 * A + r), s = (1 << r) - 1, o = (t & s) << i;
  (function(l, u, f) {
    if (u + 1 < l.byteLength) l.setUint16(u, f, !1);
    else {
      var h = f >> 8 & 255;
      l.setUint8(u, h);
    }
  })(n, A, hC(n, A) & ~(s << i) & 65535 | o);
}
function hC(n, t) {
  return t + 1 < n.byteLength ? n.getUint16(t, !1) : n.getUint8(t) << 8;
}
function z6(n) {
  var t = 0;
  if (n[t++] !== 71 || n[t++] !== 73 || n[t++] !== 70 || n[t++] !== 56 || (n[t++] + 1 & 253) != 56 || n[t++] !== 97) throw new Error("Invalid GIF 87a/89a header.");
  var e = n[t++] | n[t++] << 8, r = n[t++] | n[t++] << 8, a = n[t++], A = a >> 7, i = 1 << 1 + (7 & a);
  n[t++], n[t++];
  var s = null, o = null;
  A && (s = t, o = i, t += 3 * i);
  var l = !0, u = [], f = 0, h = null, c = 0, p = null;
  for (this.width = e, this.height = r; l && t < n.length; ) switch (n[t++]) {
    case 33:
      switch (n[t++]) {
        case 255:
          if (n[t] !== 11 || n[t + 1] == 78 && n[t + 2] == 69 && n[t + 3] == 84 && n[t + 4] == 83 && n[t + 5] == 67 && n[t + 6] == 65 && n[t + 7] == 80 && n[t + 8] == 69 && n[t + 9] == 50 && n[t + 10] == 46 && n[t + 11] == 48 && n[t + 12] == 3 && n[t + 13] == 1 && n[t + 16] == 0) t += 14, p = n[t++] | n[t++] << 8, t++;
          else for (t += 12; ; ) {
            if (!((T = n[t++]) >= 0)) throw Error("Invalid block size");
            if (T === 0) break;
            t += T;
          }
          break;
        case 249:
          if (n[t++] !== 4 || n[t + 4] !== 0) throw new Error("Invalid graphics extension block.");
          var w = n[t++];
          f = n[t++] | n[t++] << 8, h = n[t++], 1 & w || (h = null), c = w >> 2 & 7, t++;
          break;
        case 254:
          for (; ; ) {
            if (!((T = n[t++]) >= 0)) throw Error("Invalid block size");
            if (T === 0) break;
            t += T;
          }
          break;
        default:
          throw new Error("Unknown graphic control label: 0x" + n[t - 1].toString(16));
      }
      break;
    case 44:
      var y = n[t++] | n[t++] << 8, m = n[t++] | n[t++] << 8, k = n[t++] | n[t++] << 8, D = n[t++] | n[t++] << 8, B = n[t++], O = B >> 6 & 1, q = 1 << 1 + (7 & B), G = s, W = o, F = !1;
      B >> 7 && (F = !0, G = t, W = q, t += 3 * q);
      var Y = t;
      for (t++; ; ) {
        var T;
        if (!((T = n[t++]) >= 0)) throw Error("Invalid block size");
        if (T === 0) break;
        t += T;
      }
      u.push({ x: y, y: m, width: k, height: D, has_local_palette: F, palette_offset: G, palette_size: W, data_offset: Y, data_length: t - Y, transparent_index: h, interlaced: !!O, delay: f, disposal: c });
      break;
    case 59:
      l = !1;
      break;
    default:
      throw new Error("Unknown gif block: 0x" + n[t - 1].toString(16));
  }
  this.numFrames = function() {
    return u.length;
  }, this.loopCount = function() {
    return p;
  }, this.frameInfo = function(E) {
    if (E < 0 || E >= u.length) throw new Error("Frame index out of range.");
    return u[E];
  }, this.decodeAndBlitFrameBGRA = function(E, Q) {
    var x = this.frameInfo(E), oe = x.width * x.height;
    if (oe > 536870912) throw new Error("Image dimensions exceed 512MB, which is too large.");
    var J = new Uint8Array(oe);
    ow(n, x.data_offset, J, oe);
    var S = x.palette_offset, I = x.transparent_index;
    I === null && (I = 256);
    var N = x.width, se = e - N, Z = N, C = 4 * (x.y * e + x.x), H = 4 * ((x.y + x.height) * e + x.x), M = C, te = 4 * se;
    x.interlaced === !0 && (te += 4 * e * 7);
    for (var ie = 8, we = 0, ve = J.length; we < ve; ++we) {
      var le = J[we];
      if (Z === 0 && (Z = N, (M += te) >= H && (te = 4 * se + 4 * e * (ie - 1), M = C + (N + se) * (ie << 1), ie >>= 1)), le === I) M += 4;
      else {
        var _e = n[S + 3 * le], De = n[S + 3 * le + 1], ze = n[S + 3 * le + 2];
        Q[M++] = ze, Q[M++] = De, Q[M++] = _e, Q[M++] = 255;
      }
      --Z;
    }
  }, this.decodeAndBlitFrameRGBA = function(E, Q) {
    var x = this.frameInfo(E), oe = x.width * x.height;
    if (oe > 536870912) throw new Error("Image dimensions exceed 512MB, which is too large.");
    var J = new Uint8Array(oe);
    ow(n, x.data_offset, J, oe);
    var S = x.palette_offset, I = x.transparent_index;
    I === null && (I = 256);
    var N = x.width, se = e - N, Z = N, C = 4 * (x.y * e + x.x), H = 4 * ((x.y + x.height) * e + x.x), M = C, te = 4 * se;
    x.interlaced === !0 && (te += 4 * e * 7);
    for (var ie = 8, we = 0, ve = J.length; we < ve; ++we) {
      var le = J[we];
      if (Z === 0 && (Z = N, (M += te) >= H && (te = 4 * se + 4 * e * (ie - 1), M = C + (N + se) * (ie << 1), ie >>= 1)), le === I) M += 4;
      else {
        var _e = n[S + 3 * le], De = n[S + 3 * le + 1], ze = n[S + 3 * le + 2];
        Q[M++] = _e, Q[M++] = De, Q[M++] = ze, Q[M++] = 255;
      }
      --Z;
    }
  };
}
function ow(n, t, e, r) {
  for (var a = n[t++], A = 1 << a, i = A + 1, s = i + 1, o = a + 1, l = (1 << o) - 1, u = 0, f = 0, h = 0, c = n[t++], p = new Int32Array(4096), w = null; ; ) {
    for (; u < 16 && c !== 0; ) f |= n[t++] << u, u += 8, c === 1 ? c = n[t++] : --c;
    if (u < o) break;
    var y = f & l;
    if (f >>= o, u -= o, y !== A) {
      if (y === i) break;
      for (var m = y < s ? y : w, k = 0, D = m; D > A; ) D = p[D] >> 8, ++k;
      var B = D;
      if (h + k + (m !== y ? 1 : 0) > r) return void Xn.log("Warning, gif stream longer than expected.");
      e[h++] = B;
      var O = h += k;
      for (m !== y && (e[h++] = B), D = m; k--; ) D = p[D], e[--O] = 255 & D, D >>= 8;
      w !== null && s < 4096 && (p[s++] = w << 8 | B, s >= l + 1 && o < 12 && (++o, l = l << 1 | 1)), w = y;
    } else s = i + 1, l = (1 << (o = a + 1)) - 1, w = null;
  }
  return h !== r && Xn.log("Warning, gif stream shorter than expected."), e;
}
/**
 * @license
  Copyright (c) 2008, Adobe Systems Incorporated
  All rights reserved.

  Redistribution and use in source and binary forms, with or without 
  modification, are permitted provided that the following conditions are
  met:

  * Redistributions of source code must retain the above copyright notice, 
    this list of conditions and the following disclaimer.
  
  * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the 
    documentation and/or other materials provided with the distribution.
  
  * Neither the name of Adobe Systems Incorporated nor the names of its 
    contributors may be used to endorse or promote products derived from 
    this software without specific prior written permission.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
function Jf(n) {
  var t, e, r, a, A, i = Math.floor, s = new Array(64), o = new Array(64), l = new Array(64), u = new Array(64), f = new Array(65535), h = new Array(65535), c = new Array(64), p = new Array(64), w = [], y = 0, m = 7, k = new Array(64), D = new Array(64), B = new Array(64), O = new Array(256), q = new Array(2048), G = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63], W = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], F = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], Y = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], T = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250], E = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], Q = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], x = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], oe = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
  function J(C, H) {
    for (var M = 0, te = 0, ie = new Array(), we = 1; we <= 16; we++) {
      for (var ve = 1; ve <= C[we]; ve++) ie[H[te]] = [], ie[H[te]][0] = M, ie[H[te]][1] = we, te++, M++;
      M *= 2;
    }
    return ie;
  }
  function S(C) {
    for (var H = C[0], M = C[1] - 1; M >= 0; ) H & 1 << M && (y |= 1 << m), M--, --m < 0 && (y == 255 ? (I(255), I(0)) : I(y), m = 7, y = 0);
  }
  function I(C) {
    w.push(C);
  }
  function N(C) {
    I(C >> 8 & 255), I(255 & C);
  }
  function se(C, H, M, te, ie) {
    for (var we, ve = ie[0], le = ie[240], _e = (function(Ie, It) {
      var dt, Dt, Ct, Ve, ht, K, X, ke, Je, pt, Xe = 0;
      for (Je = 0; Je < 8; ++Je) {
        dt = Ie[Xe], Dt = Ie[Xe + 1], Ct = Ie[Xe + 2], Ve = Ie[Xe + 3], ht = Ie[Xe + 4], K = Ie[Xe + 5], X = Ie[Xe + 6];
        var Ye = dt + (ke = Ie[Xe + 7]), Kt = dt - ke, it = Dt + X, qt = Dt - X, hr = Ct + K, Nt = Ct - K, xr = Ve + ht, Jt = Ve - ht, lr = Ye + xr, Fr = Ye - xr, er = it + hr, Ar = it - hr;
        Ie[Xe] = lr + er, Ie[Xe + 4] = lr - er;
        var Ge = 0.707106781 * (Ar + Fr);
        Ie[Xe + 2] = Fr + Ge, Ie[Xe + 6] = Fr - Ge;
        var rt = 0.382683433 * ((lr = Jt + Nt) - (Ar = qt + Kt)), yt = 0.5411961 * lr + rt, Ot = 1.306562965 * Ar + rt, vr = 0.707106781 * (er = Nt + qt), jt = Kt + vr, br = Kt - vr;
        Ie[Xe + 5] = br + yt, Ie[Xe + 3] = br - yt, Ie[Xe + 1] = jt + Ot, Ie[Xe + 7] = jt - Ot, Xe += 8;
      }
      for (Xe = 0, Je = 0; Je < 8; ++Je) {
        dt = Ie[Xe], Dt = Ie[Xe + 8], Ct = Ie[Xe + 16], Ve = Ie[Xe + 24], ht = Ie[Xe + 32], K = Ie[Xe + 40], X = Ie[Xe + 48];
        var on = dt + (ke = Ie[Xe + 56]), an = dt - ke, xn = Dt + X, $r = Dt - X, pn = Ct + K, Dn = Ct - K, Ca = Ve + ht, ka = Ve - ht, Yn = on + Ca, zr = on - Ca, Un = xn + pn, pa = xn - pn;
        Ie[Xe] = Yn + Un, Ie[Xe + 32] = Yn - Un;
        var ma = 0.707106781 * (pa + zr);
        Ie[Xe + 16] = zr + ma, Ie[Xe + 48] = zr - ma;
        var En = 0.382683433 * ((Yn = ka + Dn) - (pa = $r + an)), Vn = 0.5411961 * Yn + En, Xa = 1.306562965 * pa + En, oA = 0.707106781 * (Un = Dn + $r), Ta = an + oA, ts = an - oA;
        Ie[Xe + 40] = ts + Vn, Ie[Xe + 24] = ts - Vn, Ie[Xe + 8] = Ta + Xa, Ie[Xe + 56] = Ta - Xa, Xe++;
      }
      for (Je = 0; Je < 64; ++Je) pt = Ie[Je] * It[Je], c[Je] = pt > 0 ? pt + 0.5 | 0 : pt - 0.5 | 0;
      return c;
    })(C, H), De = 0; De < 64; ++De) p[G[De]] = _e[De];
    var ze = p[0] - M;
    M = p[0], ze == 0 ? S(te[0]) : (S(te[h[we = 32767 + ze]]), S(f[we]));
    for (var nt = 63; nt > 0 && p[nt] == 0; ) nt--;
    if (nt == 0) return S(ve), M;
    for (var Qe, ne = 1; ne <= nt; ) {
      for (var gt = ne; p[ne] == 0 && ne <= nt; ) ++ne;
      var je = ne - gt;
      if (je >= 16) {
        Qe = je >> 4;
        for (var ot = 1; ot <= Qe; ++ot) S(le);
        je &= 15;
      }
      we = 32767 + p[ne], S(ie[(je << 4) + h[we]]), S(f[we]), ne++;
    }
    return nt != 63 && S(ve), M;
  }
  function Z(C) {
    C = Math.min(Math.max(C, 1), 100), A != C && ((function(H) {
      for (var M = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99], te = 0; te < 64; te++) {
        var ie = i((M[te] * H + 50) / 100);
        ie = Math.min(Math.max(ie, 1), 255), s[G[te]] = ie;
      }
      for (var we = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99], ve = 0; ve < 64; ve++) {
        var le = i((we[ve] * H + 50) / 100);
        le = Math.min(Math.max(le, 1), 255), o[G[ve]] = le;
      }
      for (var _e = [1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958, 0.5411961, 0.275899379], De = 0, ze = 0; ze < 8; ze++) for (var nt = 0; nt < 8; nt++) l[De] = 1 / (s[G[De]] * _e[ze] * _e[nt] * 8), u[De] = 1 / (o[G[De]] * _e[ze] * _e[nt] * 8), De++;
    })(C < 50 ? Math.floor(5e3 / C) : Math.floor(200 - 2 * C)), A = C);
  }
  this.encode = function(C, H) {
    H && Z(H), w = new Array(), y = 0, m = 7, N(65496), N(65504), N(16), I(74), I(70), I(73), I(70), I(0), I(1), I(1), I(0), N(1), N(1), I(0), I(0), (function() {
      N(65499), N(132), I(0);
      for (var Dt = 0; Dt < 64; Dt++) I(s[Dt]);
      I(1);
      for (var Ct = 0; Ct < 64; Ct++) I(o[Ct]);
    })(), (function(Dt, Ct) {
      N(65472), N(17), I(8), N(Ct), N(Dt), I(3), I(1), I(17), I(0), I(2), I(17), I(1), I(3), I(17), I(1);
    })(C.width, C.height), (function() {
      N(65476), N(418), I(0);
      for (var Dt = 0; Dt < 16; Dt++) I(W[Dt + 1]);
      for (var Ct = 0; Ct <= 11; Ct++) I(F[Ct]);
      I(16);
      for (var Ve = 0; Ve < 16; Ve++) I(Y[Ve + 1]);
      for (var ht = 0; ht <= 161; ht++) I(T[ht]);
      I(1);
      for (var K = 0; K < 16; K++) I(E[K + 1]);
      for (var X = 0; X <= 11; X++) I(Q[X]);
      I(17);
      for (var ke = 0; ke < 16; ke++) I(x[ke + 1]);
      for (var Je = 0; Je <= 161; Je++) I(oe[Je]);
    })(), N(65498), N(12), I(3), I(1), I(0), I(2), I(17), I(3), I(17), I(0), I(63), I(0);
    var M = 0, te = 0, ie = 0;
    y = 0, m = 7, this.encode.displayName = "_encode_";
    for (var we, ve, le, _e, De, ze, nt, Qe, ne, gt = C.data, je = C.width, ot = C.height, Ie = 4 * je, It = 0; It < ot; ) {
      for (we = 0; we < Ie; ) {
        for (De = Ie * It + we, nt = -1, Qe = 0, ne = 0; ne < 64; ne++) ze = De + (Qe = ne >> 3) * Ie + (nt = 4 * (7 & ne)), It + Qe >= ot && (ze -= Ie * (It + 1 + Qe - ot)), we + nt >= Ie && (ze -= we + nt - Ie + 4), ve = gt[ze++], le = gt[ze++], _e = gt[ze++], k[ne] = (q[ve] + q[le + 256 | 0] + q[_e + 512 | 0] >> 16) - 128, D[ne] = (q[ve + 768 | 0] + q[le + 1024 | 0] + q[_e + 1280 | 0] >> 16) - 128, B[ne] = (q[ve + 1280 | 0] + q[le + 1536 | 0] + q[_e + 1792 | 0] >> 16) - 128;
        M = se(k, l, M, t, r), te = se(D, u, te, e, a), ie = se(B, u, ie, e, a), we += 32;
      }
      It += 8;
    }
    if (m >= 0) {
      var dt = [];
      dt[1] = m + 1, dt[0] = (1 << m + 1) - 1, S(dt);
    }
    return N(65497), new Uint8Array(w);
  }, n = n || 50, (function() {
    for (var C = String.fromCharCode, H = 0; H < 256; H++) O[H] = C(H);
  })(), t = J(W, F), e = J(E, Q), r = J(Y, T), a = J(x, oe), (function() {
    for (var C = 1, H = 2, M = 1; M <= 15; M++) {
      for (var te = C; te < H; te++) h[32767 + te] = M, f[32767 + te] = [], f[32767 + te][1] = M, f[32767 + te][0] = te;
      for (var ie = -(H - 1); ie <= -C; ie++) h[32767 + ie] = M, f[32767 + ie] = [], f[32767 + ie][1] = M, f[32767 + ie][0] = H - 1 + ie;
      C <<= 1, H <<= 1;
    }
  })(), (function() {
    for (var C = 0; C < 256; C++) q[C] = 19595 * C, q[C + 256 | 0] = 38470 * C, q[C + 512 | 0] = 7471 * C + 32768, q[C + 768 | 0] = -11059 * C, q[C + 1024 | 0] = -21709 * C, q[C + 1280 | 0] = 32768 * C + 8421375, q[C + 1536 | 0] = -27439 * C, q[C + 1792 | 0] = -5329 * C;
  })(), Z(n);
}
/**
 * @license
 * Copyright (c) 2017 Aras Abbasi
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */
function li(n, t) {
  if (this.pos = 0, this.buffer = n, this.datav = new DataView(n.buffer), this.is_with_alpha = !!t, this.bottom_up = !0, this.flag = String.fromCharCode(this.buffer[0]) + String.fromCharCode(this.buffer[1]), this.pos += 2, ["BM", "BA", "CI", "CP", "IC", "PT"].indexOf(this.flag) === -1) throw new Error("Invalid BMP File");
  this.parseHeader(), this.parseBGR();
}
function lw(n) {
  function t(F) {
    if (!F) throw Error("assert :P");
  }
  function e(F, Y, T) {
    for (var E = 0; 4 > E; E++) if (F[Y + E] != T.charCodeAt(E)) return !0;
    return !1;
  }
  function r(F, Y, T, E, Q) {
    for (var x = 0; x < Q; x++) F[Y + x] = T[E + x];
  }
  function a(F, Y, T, E) {
    for (var Q = 0; Q < E; Q++) F[Y + Q] = T;
  }
  function A(F) {
    return new Int32Array(F);
  }
  function i(F, Y) {
    for (var T = [], E = 0; E < F; E++) T.push(new Y());
    return T;
  }
  function s(F, Y) {
    var T = [];
    return (function E(Q, x, oe) {
      for (var J = oe[x], S = 0; S < J && (Q.push(oe.length > x + 1 ? [] : new Y()), !(oe.length < x + 1)); S++) E(Q[S], x + 1, oe);
    })(T, 0, F), T;
  }
  var o = function() {
    var F = this;
    function Y(d, g) {
      for (var b = 1 << g - 1 >>> 0; d & b; ) b >>>= 1;
      return b ? (d & b - 1) + b : d;
    }
    function T(d, g, b, U, V) {
      t(!(U % b));
      do
        d[g + (U -= b)] = V;
      while (0 < U);
    }
    function E(d, g, b, U, V) {
      if (t(2328 >= V), 512 >= V) var re = A(512);
      else if ((re = A(V)) == null) return 0;
      return (function(Ae, ue, de, Be, He, st) {
        var be, We, Ze = ue, kt = 1 << de, At = A(16), xt = A(16);
        for (t(He != 0), t(Be != null), t(Ae != null), t(0 < de), We = 0; We < He; ++We) {
          if (15 < Be[We]) return 0;
          ++At[Be[We]];
        }
        if (At[0] == He) return 0;
        for (xt[1] = 0, be = 1; 15 > be; ++be) {
          if (At[be] > 1 << be) return 0;
          xt[be + 1] = xt[be] + At[be];
        }
        for (We = 0; We < He; ++We) be = Be[We], 0 < Be[We] && (st[xt[be]++] = We);
        if (xt[15] == 1) return (Be = new Q()).g = 0, Be.value = st[0], T(Ae, Ze, 1, kt, Be), kt;
        var Ft, Vt = -1, Ht = kt - 1, Cr = 0, pr = 1, en = 1, yr = 1 << de;
        for (We = 0, be = 1, He = 2; be <= de; ++be, He <<= 1) {
          if (pr += en <<= 1, 0 > (en -= At[be])) return 0;
          for (; 0 < At[be]; --At[be]) (Be = new Q()).g = be, Be.value = st[We++], T(Ae, Ze + Cr, He, yr, Be), Cr = Y(Cr, be);
        }
        for (be = de + 1, He = 2; 15 >= be; ++be, He <<= 1) {
          if (pr += en <<= 1, 0 > (en -= At[be])) return 0;
          for (; 0 < At[be]; --At[be]) {
            if (Be = new Q(), (Cr & Ht) != Vt) {
              for (Ze += yr, Ft = 1 << (Vt = be) - de; 15 > Vt && !(0 >= (Ft -= At[Vt])); ) ++Vt, Ft <<= 1;
              kt += yr = 1 << (Ft = Vt - de), Ae[ue + (Vt = Cr & Ht)].g = Ft + de, Ae[ue + Vt].value = Ze - ue - Vt;
            }
            Be.g = be - de, Be.value = st[We++], T(Ae, Ze + (Cr >> de), He, yr, Be), Cr = Y(Cr, be);
          }
        }
        return pr != 2 * xt[15] - 1 ? 0 : kt;
      })(d, g, b, U, V, re);
    }
    function Q() {
      this.value = this.g = 0;
    }
    function x() {
      this.value = this.g = 0;
    }
    function oe() {
      this.G = i(5, Q), this.H = A(5), this.jc = this.Qb = this.qb = this.nd = 0, this.pd = i(Js, x);
    }
    function J(d, g, b, U) {
      t(d != null), t(g != null), t(2147483648 > U), d.Ca = 254, d.I = 0, d.b = -8, d.Ka = 0, d.oa = g, d.pa = b, d.Jd = g, d.Yc = b + U, d.Zc = 4 <= U ? b + U - 4 + 1 : b, ve(d);
    }
    function S(d, g) {
      for (var b = 0; 0 < g--; ) b |= _e(d, 128) << g;
      return b;
    }
    function I(d, g) {
      var b = S(d, g);
      return le(d) ? -b : b;
    }
    function N(d, g, b, U) {
      var V, re = 0;
      for (t(d != null), t(g != null), t(4294967288 > U), d.Sb = U, d.Ra = 0, d.u = 0, d.h = 0, 4 < U && (U = 4), V = 0; V < U; ++V) re += g[b + V] << 8 * V;
      d.Ra = re, d.bb = U, d.oa = g, d.pa = b;
    }
    function se(d) {
      for (; 8 <= d.u && d.bb < d.Sb; ) d.Ra >>>= 8, d.Ra += d.oa[d.pa + d.bb] << wA - 8 >>> 0, ++d.bb, d.u -= 8;
      te(d) && (d.h = 1, d.u = 0);
    }
    function Z(d, g) {
      if (t(0 <= g), !d.h && g <= fo) {
        var b = M(d) & ki[g];
        return d.u += g, se(d), b;
      }
      return d.h = 1, d.u = 0;
    }
    function C() {
      this.b = this.Ca = this.I = 0, this.oa = [], this.pa = 0, this.Jd = [], this.Yc = 0, this.Zc = [], this.Ka = 0;
    }
    function H() {
      this.Ra = 0, this.oa = [], this.h = this.u = this.bb = this.Sb = this.pa = 0;
    }
    function M(d) {
      return d.Ra >>> (d.u & wA - 1) >>> 0;
    }
    function te(d) {
      return t(d.bb <= d.Sb), d.h || d.bb == d.Sb && d.u > wA;
    }
    function ie(d, g) {
      d.u = g, d.h = te(d);
    }
    function we(d) {
      d.u >= SA && (t(d.u >= SA), se(d));
    }
    function ve(d) {
      t(d != null && d.oa != null), d.pa < d.Zc ? (d.I = (d.oa[d.pa++] | d.I << 8) >>> 0, d.b += 8) : (t(d != null && d.oa != null), d.pa < d.Yc ? (d.b += 8, d.I = d.oa[d.pa++] | d.I << 8) : d.Ka ? d.b = 0 : (d.I <<= 8, d.b += 8, d.Ka = 1));
    }
    function le(d) {
      return S(d, 1);
    }
    function _e(d, g) {
      var b = d.Ca;
      0 > d.b && ve(d);
      var U = d.b, V = b * g >>> 8, re = (d.I >>> U > V) + 0;
      for (re ? (b -= V, d.I -= V + 1 << U >>> 0) : b = V + 1, U = b, V = 0; 256 <= U; ) V += 8, U >>= 8;
      return U = 7 ^ V + Ki[U], d.b -= U, d.Ca = (b << U) - 1, re;
    }
    function De(d, g, b) {
      d[g + 0] = b >> 24 & 255, d[g + 1] = b >> 16 & 255, d[g + 2] = b >> 8 & 255, d[g + 3] = 255 & b;
    }
    function ze(d, g) {
      return d[g + 0] | d[g + 1] << 8;
    }
    function nt(d, g) {
      return ze(d, g) | d[g + 2] << 16;
    }
    function Qe(d, g) {
      return ze(d, g) | ze(d, g + 2) << 16;
    }
    function ne(d, g) {
      var b = 1 << g;
      return t(d != null), t(0 < g), d.X = A(b), d.X == null ? 0 : (d.Mb = 32 - g, d.Xa = g, 1);
    }
    function gt(d, g) {
      t(d != null), t(g != null), t(d.Xa == g.Xa), r(g.X, 0, d.X, 0, 1 << g.Xa);
    }
    function je() {
      this.X = [], this.Xa = this.Mb = 0;
    }
    function ot(d, g, b, U) {
      t(b != null), t(U != null);
      var V = b[0], re = U[0];
      return V == 0 && (V = (d * re + g / 2) / g), re == 0 && (re = (g * V + d / 2) / d), 0 >= V || 0 >= re ? 0 : (b[0] = V, U[0] = re, 1);
    }
    function Ie(d, g) {
      return d + (1 << g) - 1 >>> g;
    }
    function It(d, g) {
      return ((4278255360 & d) + (4278255360 & g) >>> 0 & 4278255360) + ((16711935 & d) + (16711935 & g) >>> 0 & 16711935) >>> 0;
    }
    function dt(d, g) {
      F[g] = function(b, U, V, re, Ae, ue, de) {
        var Be;
        for (Be = 0; Be < Ae; ++Be) {
          var He = F[d](ue[de + Be - 1], V, re + Be);
          ue[de + Be] = It(b[U + Be], He);
        }
      };
    }
    function Dt() {
      this.ud = this.hd = this.jd = 0;
    }
    function Ct(d, g) {
      return ((4278124286 & (d ^ g)) >>> 1) + (d & g) >>> 0;
    }
    function Ve(d) {
      return 0 <= d && 256 > d ? d : 0 > d ? 0 : 255 < d ? 255 : void 0;
    }
    function ht(d, g) {
      return Ve(d + (d - g + 0.5 >> 1));
    }
    function K(d, g, b) {
      return Math.abs(g - b) - Math.abs(d - b);
    }
    function X(d, g, b, U, V, re, Ae) {
      for (U = re[Ae - 1], b = 0; b < V; ++b) re[Ae + b] = U = It(d[g + b], U);
    }
    function ke(d, g, b, U, V) {
      var re;
      for (re = 0; re < b; ++re) {
        var Ae = d[g + re], ue = Ae >> 8 & 255, de = 16711935 & (de = (de = 16711935 & Ae) + ((ue << 16) + ue));
        U[V + re] = (4278255360 & Ae) + de >>> 0;
      }
    }
    function Je(d, g) {
      g.jd = 255 & d, g.hd = d >> 8 & 255, g.ud = d >> 16 & 255;
    }
    function pt(d, g, b, U, V, re) {
      var Ae;
      for (Ae = 0; Ae < U; ++Ae) {
        var ue = g[b + Ae], de = ue >>> 8, Be = ue, He = 255 & (He = (He = ue >>> 16) + ((d.jd << 24 >> 24) * (de << 24 >> 24) >>> 5));
        Be = 255 & (Be = (Be += (d.hd << 24 >> 24) * (de << 24 >> 24) >>> 5) + ((d.ud << 24 >> 24) * (He << 24 >> 24) >>> 5)), V[re + Ae] = (4278255360 & ue) + (He << 16) + Be;
      }
    }
    function Xe(d, g, b, U, V) {
      F[g] = function(re, Ae, ue, de, Be, He, st, be, We) {
        for (de = st; de < be; ++de) for (st = 0; st < We; ++st) Be[He++] = V(ue[U(re[Ae++])]);
      }, F[d] = function(re, Ae, ue, de, Be, He, st) {
        var be = 8 >> re.b, We = re.Ea, Ze = re.K[0], kt = re.w;
        if (8 > be) for (re = (1 << re.b) - 1, kt = (1 << be) - 1; Ae < ue; ++Ae) {
          var At, xt = 0;
          for (At = 0; At < We; ++At) At & re || (xt = U(de[Be++])), He[st++] = V(Ze[xt & kt]), xt >>= be;
        }
        else F["VP8LMapColor" + b](de, Be, Ze, kt, He, st, Ae, ue, We);
      };
    }
    function Ye(d, g, b, U, V) {
      for (b = g + b; g < b; ) {
        var re = d[g++];
        U[V++] = re >> 16 & 255, U[V++] = re >> 8 & 255, U[V++] = 255 & re;
      }
    }
    function Kt(d, g, b, U, V) {
      for (b = g + b; g < b; ) {
        var re = d[g++];
        U[V++] = re >> 16 & 255, U[V++] = re >> 8 & 255, U[V++] = 255 & re, U[V++] = re >> 24 & 255;
      }
    }
    function it(d, g, b, U, V) {
      for (b = g + b; g < b; ) {
        var re = (Ae = d[g++]) >> 16 & 240 | Ae >> 12 & 15, Ae = 240 & Ae | Ae >> 28 & 15;
        U[V++] = re, U[V++] = Ae;
      }
    }
    function qt(d, g, b, U, V) {
      for (b = g + b; g < b; ) {
        var re = (Ae = d[g++]) >> 16 & 248 | Ae >> 13 & 7, Ae = Ae >> 5 & 224 | Ae >> 3 & 31;
        U[V++] = re, U[V++] = Ae;
      }
    }
    function hr(d, g, b, U, V) {
      for (b = g + b; g < b; ) {
        var re = d[g++];
        U[V++] = 255 & re, U[V++] = re >> 8 & 255, U[V++] = re >> 16 & 255;
      }
    }
    function Nt(d, g, b, U, V, re) {
      if (re == 0) for (b = g + b; g < b; ) De(U, ((re = d[g++])[0] >> 24 | re[1] >> 8 & 65280 | re[2] << 8 & 16711680 | re[3] << 24) >>> 0), V += 32;
      else r(U, V, d, g, b);
    }
    function xr(d, g) {
      F[g][0] = F[d + "0"], F[g][1] = F[d + "1"], F[g][2] = F[d + "2"], F[g][3] = F[d + "3"], F[g][4] = F[d + "4"], F[g][5] = F[d + "5"], F[g][6] = F[d + "6"], F[g][7] = F[d + "7"], F[g][8] = F[d + "8"], F[g][9] = F[d + "9"], F[g][10] = F[d + "10"], F[g][11] = F[d + "11"], F[g][12] = F[d + "12"], F[g][13] = F[d + "13"], F[g][14] = F[d + "0"], F[g][15] = F[d + "0"];
    }
    function Jt(d) {
      return d == bt || d == qe || d == wt || d == $t;
    }
    function lr() {
      this.eb = [], this.size = this.A = this.fb = 0;
    }
    function Fr() {
      this.y = [], this.f = [], this.ea = [], this.F = [], this.Tc = this.Ed = this.Cd = this.Fd = this.lb = this.Db = this.Ab = this.fa = this.J = this.W = this.N = this.O = 0;
    }
    function er() {
      this.Rd = this.height = this.width = this.S = 0, this.f = {}, this.f.RGBA = new lr(), this.f.kb = new Fr(), this.sd = null;
    }
    function Ar() {
      this.width = [0], this.height = [0], this.Pd = [0], this.Qd = [0], this.format = [0];
    }
    function Ge() {
      this.Id = this.fd = this.Md = this.hb = this.ib = this.da = this.bd = this.cd = this.j = this.v = this.Da = this.Sd = this.ob = 0;
    }
    function rt(d) {
      return alert("todo:WebPSamplerProcessPlane"), d.T;
    }
    function yt(d, g) {
      var b = d.T, U = g.ba.f.RGBA, V = U.eb, re = U.fb + d.ka * U.A, Ae = ns[g.ba.S], ue = d.y, de = d.O, Be = d.f, He = d.N, st = d.ea, be = d.W, We = g.cc, Ze = g.dc, kt = g.Mc, At = g.Nc, xt = d.ka, Ft = d.ka + d.T, Vt = d.U, Ht = Vt + 1 >> 1;
      for (xt == 0 ? Ae(ue, de, null, null, Be, He, st, be, Be, He, st, be, V, re, null, null, Vt) : (Ae(g.ec, g.fc, ue, de, We, Ze, kt, At, Be, He, st, be, V, re - U.A, V, re, Vt), ++b); xt + 2 < Ft; xt += 2) We = Be, Ze = He, kt = st, At = be, He += d.Rc, be += d.Rc, re += 2 * U.A, Ae(ue, (de += 2 * d.fa) - d.fa, ue, de, We, Ze, kt, At, Be, He, st, be, V, re - U.A, V, re, Vt);
      return de += d.fa, d.j + Ft < d.o ? (r(g.ec, g.fc, ue, de, Vt), r(g.cc, g.dc, Be, He, Ht), r(g.Mc, g.Nc, st, be, Ht), b--) : 1 & Ft || Ae(ue, de, null, null, Be, He, st, be, Be, He, st, be, V, re + U.A, null, null, Vt), b;
    }
    function Ot(d, g, b) {
      var U = d.F, V = [d.J];
      if (U != null) {
        var re = d.U, Ae = g.ba.S, ue = Ae == Me || Ae == wt;
        g = g.ba.f.RGBA;
        var de = [0], Be = d.ka;
        de[0] = d.T, d.Kb && (Be == 0 ? --de[0] : (--Be, V[0] -= d.width), d.j + d.ka + d.T == d.o && (de[0] = d.o - d.j - Be));
        var He = g.eb;
        Be = g.fb + Be * g.A, d = $o(U, V[0], d.width, re, de, He, Be + (ue ? 0 : 3), g.A), t(b == de), d && Jt(Ae) && xi(He, Be, ue, re, de, g.A);
      }
      return 0;
    }
    function vr(d) {
      var g = d.ma, b = g.ba.S, U = 11 > b, V = b == xe || b == Ne || b == Me || b == Ke || b == 12 || Jt(b);
      if (g.memory = null, g.Ib = null, g.Jb = null, g.Nd = null, !vs(g.Oa, d, V ? 11 : 12)) return 0;
      if (V && Jt(b) && eA(), d.da) alert("todo:use_scaling");
      else {
        if (U) {
          if (g.Ib = rt, d.Kb) {
            if (b = d.U + 1 >> 1, g.memory = A(d.U + 2 * b), g.memory == null) return 0;
            g.ec = g.memory, g.fc = 0, g.cc = g.ec, g.dc = g.fc + d.U, g.Mc = g.cc, g.Nc = g.dc + b, g.Ib = yt, eA();
          }
        } else alert("todo:EmitYUV");
        V && (g.Jb = Ot, U && Wr());
      }
      if (U && !im) {
        for (d = 0; 256 > d; ++d) G4[d] = 89858 * (d - 128) + wc >> mc, J4[d] = -22014 * (d - 128) + wc, X4[d] = -45773 * (d - 128), z4[d] = 113618 * (d - 128) + wc >> mc;
        for (d = du; d < Bf; ++d) g = 76283 * (d - 16) + wc >> mc, Z4[d - du] = bn(g, 255), eT[d - du] = bn(g + 8 >> 4, 15);
        im = 1;
      }
      return 1;
    }
    function jt(d) {
      var g = d.ma, b = d.U, U = d.T;
      return t(!(1 & d.ka)), 0 >= b || 0 >= U ? 0 : (b = g.Ib(d, g), g.Jb != null && g.Jb(d, g, b), g.Dc += b, 1);
    }
    function br(d) {
      d.ma.memory = null;
    }
    function on(d, g, b, U) {
      return Z(d, 8) != 47 ? 0 : (g[0] = Z(d, 14) + 1, b[0] = Z(d, 14) + 1, U[0] = Z(d, 1), Z(d, 3) != 0 ? 0 : !d.h);
    }
    function an(d, g) {
      if (4 > d) return d + 1;
      var b = d - 2 >> 1;
      return (2 + (1 & d) << b) + Z(g, b) + 1;
    }
    function xn(d, g) {
      return 120 < g ? g - 120 : 1 <= (b = ((b = Sr[g - 1]) >> 4) * d + (8 - (15 & b))) ? b : 1;
      var b;
    }
    function $r(d, g, b) {
      var U = M(b), V = d[g += 255 & U].g - 8;
      return 0 < V && (ie(b, b.u + 8), U = M(b), g += d[g].value, g += U & (1 << V) - 1), ie(b, b.u + d[g].g), d[g].value;
    }
    function pn(d, g, b) {
      return b.g += d.g, b.value += d.value << g >>> 0, t(8 >= b.g), d.g;
    }
    function Dn(d, g, b) {
      var U = d.xc;
      return t((g = U == 0 ? 0 : d.vc[d.md * (b >> U) + (g >> U)]) < d.Wb), d.Ya[g];
    }
    function Ca(d, g, b, U) {
      var V = d.ab, re = d.c * g, Ae = d.C;
      g = Ae + g;
      var ue = b, de = U;
      for (U = d.Ta, b = d.Ua; 0 < V--; ) {
        var Be = d.gc[V], He = Ae, st = g, be = ue, We = de, Ze = (de = U, ue = b, Be.Ea);
        switch (t(He < st), t(st <= Be.nc), Be.hc) {
          case 2:
            ho(be, We, (st - He) * Ze, de, ue);
            break;
          case 0:
            var kt = He, At = st, xt = de, Ft = ue, Vt = (yr = Be).Ea;
            kt == 0 && (Zs(be, We, null, null, 1, xt, Ft), X(be, We + 1, 0, 0, Vt - 1, xt, Ft + 1), We += Vt, Ft += Vt, ++kt);
            for (var Ht = 1 << yr.b, Cr = Ht - 1, pr = Ie(Vt, yr.b), en = yr.K, yr = yr.w + (kt >> yr.b) * pr; kt < At; ) {
              var yn = en, uA = yr, tn = 1;
              for (ei(be, We, xt, Ft - Vt, 1, xt, Ft); tn < Vt; ) {
                var Br = (tn & ~Cr) + Ht;
                Br > Vt && (Br = Vt), (0, ms[yn[uA++] >> 8 & 15])(be, We + +tn, xt, Ft + tn - Vt, Br - tn, xt, Ft + tn), tn = Br;
              }
              We += Vt, Ft += Vt, ++kt & Cr || (yr += pr);
            }
            st != Be.nc && r(de, ue - Ze, de, ue + (st - He - 1) * Ze, Ze);
            break;
          case 1:
            for (Ze = be, At = We, Vt = (be = Be.Ea) - (Ft = be & ~(xt = (We = 1 << Be.b) - 1)), kt = Ie(be, Be.b), Ht = Be.K, Be = Be.w + (He >> Be.b) * kt; He < st; ) {
              for (Cr = Ht, pr = Be, en = new Dt(), yr = At + Ft, yn = At + be; At < yr; ) Je(Cr[pr++], en), Jr(en, Ze, At, We, de, ue), At += We, ue += We;
              At < yn && (Je(Cr[pr++], en), Jr(en, Ze, At, Vt, de, ue), At += Vt, ue += Vt), ++He & xt || (Be += kt);
            }
            break;
          case 3:
            if (be == de && We == ue && 0 < Be.b) {
              for (At = de, be = Ze = ue + (st - He) * Ze - (Ft = (st - He) * Ie(Be.Ea, Be.b)), We = de, xt = ue, kt = [], Ft = (Vt = Ft) - 1; 0 <= Ft; --Ft) kt[Ft] = We[xt + Ft];
              for (Ft = Vt - 1; 0 <= Ft; --Ft) At[be + Ft] = kt[Ft];
              yA(Be, He, st, de, Ze, de, ue);
            } else yA(Be, He, st, be, We, de, ue);
        }
        ue = U, de = b;
      }
      de != b && r(U, b, ue, de, re);
    }
    function ka(d, g) {
      var b = d.V, U = d.Ba + d.c * d.C, V = g - d.C;
      if (t(g <= d.l.o), t(16 >= V), 0 < V) {
        var re = d.l, Ae = d.Ta, ue = d.Ua, de = re.width;
        if (Ca(d, V, b, U), V = ue = [ue], t((b = d.C) < (U = g)), t(re.v < re.va), U > re.o && (U = re.o), b < re.j) {
          var Be = re.j - b;
          b = re.j, V[0] += Be * de;
        }
        if (b >= U ? b = 0 : (V[0] += 4 * re.v, re.ka = b - re.j, re.U = re.va - re.v, re.T = U - b, b = 1), b) {
          if (ue = ue[0], 11 > (b = d.ca).S) {
            var He = b.f.RGBA, st = (U = b.S, V = re.U, re = re.T, Be = He.eb, He.A), be = re;
            for (He = He.fb + d.Ma * He.A; 0 < be--; ) {
              var We = Ae, Ze = ue, kt = V, At = Be, xt = He;
              switch (U) {
                case Ce:
                  Ua(We, Ze, kt, At, xt);
                  break;
                case xe:
                  Ds(We, Ze, kt, At, xt);
                  break;
                case bt:
                  Ds(We, Ze, kt, At, xt), xi(At, xt, 0, kt, 1, 0);
                  break;
                case Se:
                  $i(We, Ze, kt, At, xt);
                  break;
                case Ne:
                  Nt(We, Ze, kt, At, xt, 1);
                  break;
                case qe:
                  Nt(We, Ze, kt, At, xt, 1), xi(At, xt, 0, kt, 1, 0);
                  break;
                case Me:
                  Nt(We, Ze, kt, At, xt, 0);
                  break;
                case wt:
                  Nt(We, Ze, kt, At, xt, 0), xi(At, xt, 1, kt, 1, 0);
                  break;
                case Ke:
                  ti(We, Ze, kt, At, xt);
                  break;
                case $t:
                  ti(We, Ze, kt, At, xt), uc(At, xt, kt, 1, 0);
                  break;
                case Bt:
                  Ps(We, Ze, kt, At, xt);
                  break;
                default:
                  t(0);
              }
              ue += de, He += st;
            }
            d.Ma += re;
          } else alert("todo:EmitRescaledRowsYUVA");
          t(d.Ma <= b.height);
        }
      }
      d.C = g, t(d.C <= d.i);
    }
    function Yn(d) {
      var g;
      if (0 < d.ua) return 0;
      for (g = 0; g < d.Wb; ++g) {
        var b = d.Ya[g].G, U = d.Ya[g].H;
        if (0 < b[1][U[1] + 0].g || 0 < b[2][U[2] + 0].g || 0 < b[3][U[3] + 0].g) return 0;
      }
      return 1;
    }
    function zr(d, g, b, U, V, re) {
      if (d.Z != 0) {
        var Ae = d.qd, ue = d.rd;
        for (t(UA[d.Z] != null); g < b; ++g) UA[d.Z](Ae, ue, U, V, U, V, re), Ae = U, ue = V, V += re;
        d.qd = Ae, d.rd = ue;
      }
    }
    function Un(d, g) {
      var b = d.l.ma, U = b.Z == 0 || b.Z == 1 ? d.l.j : d.C;
      if (U = d.C < U ? U : d.C, t(g <= d.l.o), g > U) {
        var V = d.l.width, re = b.ca, Ae = b.tb + V * U, ue = d.V, de = d.Ba + d.c * U, Be = d.gc;
        t(d.ab == 1), t(Be[0].hc == 3), ml(Be[0], U, g, ue, de, re, Ae), zr(b, U, g, re, Ae, V);
      }
      d.C = d.Ma = g;
    }
    function pa(d, g, b, U, V, re, Ae) {
      var ue = d.$ / U, de = d.$ % U, Be = d.m, He = d.s, st = b + d.$, be = st;
      V = b + U * V;
      var We = b + U * re, Ze = 280 + He.ua, kt = d.Pb ? ue : 16777216, At = 0 < He.ua ? He.Wa : null, xt = He.wc, Ft = st < We ? Dn(He, de, ue) : null;
      t(d.C < re), t(We <= V);
      var Vt = !1;
      e: for (; ; ) {
        for (; Vt || st < We; ) {
          var Ht = 0;
          if (ue >= kt) {
            var Cr = st - b;
            t((kt = d).Pb), kt.wd = kt.m, kt.xd = Cr, 0 < kt.s.ua && gt(kt.s.Wa, kt.s.vb), kt = ue + wn;
          }
          if (de & xt || (Ft = Dn(He, de, ue)), t(Ft != null), Ft.Qb && (g[st] = Ft.qb, Vt = !0), !Vt) if (we(Be), Ft.jc) {
            Ht = Be, Cr = g;
            var pr = st, en = Ft.pd[M(Ht) & Js - 1];
            t(Ft.jc), 256 > en.g ? (ie(Ht, Ht.u + en.g), Cr[pr] = en.value, Ht = 0) : (ie(Ht, Ht.u + en.g - 256), t(256 <= en.value), Ht = en.value), Ht == 0 && (Vt = !0);
          } else Ht = $r(Ft.G[0], Ft.H[0], Be);
          if (Be.h) break;
          if (Vt || 256 > Ht) {
            if (!Vt) if (Ft.nd) g[st] = (Ft.qb | Ht << 8) >>> 0;
            else {
              if (we(Be), Vt = $r(Ft.G[1], Ft.H[1], Be), we(Be), Cr = $r(Ft.G[2], Ft.H[2], Be), pr = $r(Ft.G[3], Ft.H[3], Be), Be.h) break;
              g[st] = (pr << 24 | Vt << 16 | Ht << 8 | Cr) >>> 0;
            }
            if (Vt = !1, ++st, ++de >= U && (de = 0, ++ue, Ae != null && ue <= re && !(ue % 16) && Ae(d, ue), At != null)) for (; be < st; ) Ht = g[be++], At.X[(506832829 * Ht & 4294967295) >>> At.Mb] = Ht;
          } else if (280 > Ht) {
            if (Ht = an(Ht - 256, Be), Cr = $r(Ft.G[4], Ft.H[4], Be), we(Be), Cr = xn(U, Cr = an(Cr, Be)), Be.h) break;
            if (st - b < Cr || V - st < Ht) break e;
            for (pr = 0; pr < Ht; ++pr) g[st + pr] = g[st + pr - Cr];
            for (st += Ht, de += Ht; de >= U; ) de -= U, ++ue, Ae != null && ue <= re && !(ue % 16) && Ae(d, ue);
            if (t(st <= V), de & xt && (Ft = Dn(He, de, ue)), At != null) for (; be < st; ) Ht = g[be++], At.X[(506832829 * Ht & 4294967295) >>> At.Mb] = Ht;
          } else {
            if (!(Ht < Ze)) break e;
            for (Vt = Ht - 280, t(At != null); be < st; ) Ht = g[be++], At.X[(506832829 * Ht & 4294967295) >>> At.Mb] = Ht;
            Ht = st, t(!(Vt >>> (Cr = At).Xa)), g[Ht] = Cr.X[Vt], Vt = !0;
          }
          Vt || t(Be.h == te(Be));
        }
        if (d.Pb && Be.h && st < V) t(d.m.h), d.a = 5, d.m = d.wd, d.$ = d.xd, 0 < d.s.ua && gt(d.s.vb, d.s.Wa);
        else {
          if (Be.h) break e;
          Ae != null && Ae(d, ue > re ? re : ue), d.a = 0, d.$ = st - b;
        }
        return 1;
      }
      return d.a = 3, 0;
    }
    function ma(d) {
      t(d != null), d.vc = null, d.yc = null, d.Ya = null;
      var g = d.Wa;
      g != null && (g.X = null), d.vb = null, t(d != null);
    }
    function En() {
      var d = new mt();
      return d == null ? null : (d.a = 0, d.xb = si, xr("Predictor", "VP8LPredictors"), xr("Predictor", "VP8LPredictors_C"), xr("PredictorAdd", "VP8LPredictorsAdd"), xr("PredictorAdd", "VP8LPredictorsAdd_C"), ho = ke, Jr = pt, Ua = Ye, Ds = Kt, ti = it, Ps = qt, $i = hr, F.VP8LMapColor32b = ca, F.VP8LMapColor8b = ps, d);
    }
    function Vn(d, g, b, U, V) {
      var re = 1, Ae = [d], ue = [g], de = U.m, Be = U.s, He = null, st = 0;
      e: for (; ; ) {
        if (b) for (; re && Z(de, 1); ) {
          var be = Ae, We = ue, Ze = U, kt = 1, At = Ze.m, xt = Ze.gc[Ze.ab], Ft = Z(At, 2);
          if (Ze.Oc & 1 << Ft) re = 0;
          else {
            switch (Ze.Oc |= 1 << Ft, xt.hc = Ft, xt.Ea = be[0], xt.nc = We[0], xt.K = [null], ++Ze.ab, t(4 >= Ze.ab), Ft) {
              case 0:
              case 1:
                xt.b = Z(At, 3) + 2, kt = Vn(Ie(xt.Ea, xt.b), Ie(xt.nc, xt.b), 0, Ze, xt.K), xt.K = xt.K[0];
                break;
              case 3:
                var Vt, Ht = Z(At, 8) + 1, Cr = 16 < Ht ? 0 : 4 < Ht ? 1 : 2 < Ht ? 2 : 3;
                if (be[0] = Ie(xt.Ea, Cr), xt.b = Cr, Vt = kt = Vn(Ht, 1, 0, Ze, xt.K)) {
                  var pr, en = Ht, yr = xt, yn = 1 << (8 >> yr.b), uA = A(yn);
                  if (uA == null) Vt = 0;
                  else {
                    var tn = yr.K[0], Br = yr.w;
                    for (uA[0] = yr.K[0][0], pr = 1; pr < 1 * en; ++pr) uA[pr] = It(tn[Br + pr], uA[pr - 1]);
                    for (; pr < 4 * yn; ++pr) uA[pr] = 0;
                    yr.K[0] = null, yr.K[0] = uA, Vt = 1;
                  }
                }
                kt = Vt;
                break;
              case 2:
                break;
              default:
                t(0);
            }
            re = kt;
          }
        }
        if (Ae = Ae[0], ue = ue[0], re && Z(de, 1) && !(re = 1 <= (st = Z(de, 4)) && 11 >= st)) {
          U.a = 3;
          break e;
        }
        var rr;
        if (rr = re) t: {
          var Wa, Yr, Cn, la = U, LA = Ae, as = ue, Ia = st, $A = b, As = la.m, cA = la.s, Sn = [null], Kn = 1, Qa = 0, $n = Mn[Ia];
          r: for (; ; ) {
            if ($A && Z(As, 1)) {
              var IA = Z(As, 3) + 2, ii = Ie(LA, IA), Ka = Ie(as, IA), ws = ii * Ka;
              if (!Vn(ii, Ka, 0, la, Sn)) break r;
              for (Sn = Sn[0], cA.xc = IA, Wa = 0; Wa < ws; ++Wa) {
                var zn = Sn[Wa] >> 8 & 65535;
                Sn[Wa] = zn, zn >= Kn && (Kn = zn + 1);
              }
            }
            if (As.h) break r;
            for (Yr = 0; 5 > Yr; ++Yr) {
              var dA = Xt[Yr];
              !Yr && 0 < Ia && (dA += 1 << Ia), Qa < dA && (Qa = dA);
            }
            var Fs = i(Kn * $n, Q), ss = Kn, Us = i(ss, oe);
            if (Us == null) var Ls = null;
            else t(65536 >= ss), Ls = Us;
            var ys = A(Qa);
            if (Ls == null || ys == null || Fs == null) {
              la.a = 1;
              break r;
            }
            var Is = Fs;
            for (Wa = Cn = 0; Wa < Kn; ++Wa) {
              var ra = Ls[Wa], Qs = ra.G, oi = ra.H, Vo = 0, qi = 1, QA = 0;
              for (Yr = 0; 5 > Yr; ++Yr) {
                dA = Xt[Yr], Qs[Yr] = Is, oi[Yr] = Cn, !Yr && 0 < Ia && (dA += 1 << Ia);
                a: {
                  var Bc, bf = dA, bc = la, fu = ys, nT = Is, aT = Cn, Cf = 0, vo = bc.m, AT = Z(vo, 1);
                  if (a(fu, 0, 0, bf), AT) {
                    var sT = Z(vo, 1) + 1, iT = Z(vo, 1), um = Z(vo, iT == 0 ? 1 : 8);
                    fu[um] = 1, sT == 2 && (fu[um = Z(vo, 8)] = 1);
                    var Cc = 1;
                  } else {
                    var cm = A(19), dm = Z(vo, 4) + 4;
                    if (19 < dm) {
                      bc.a = 3;
                      var kc = 0;
                      break a;
                    }
                    for (Bc = 0; Bc < dm; ++Bc) cm[Rr[Bc]] = Z(vo, 3);
                    var kf = void 0, hu = void 0, fm = bc, oT = cm, Tc = bf, hm = fu, Tf = 0, po = fm.m, gm = 8, vm = i(128, Q);
                    n: for (; E(vm, 0, 7, oT, 19); ) {
                      if (Z(po, 1)) {
                        var lT = 2 + 2 * Z(po, 3);
                        if ((kf = 2 + Z(po, lT)) > Tc) break n;
                      } else kf = Tc;
                      for (hu = 0; hu < Tc && kf--; ) {
                        we(po);
                        var pm = vm[0 + (127 & M(po))];
                        ie(po, po.u + pm.g);
                        var yl = pm.value;
                        if (16 > yl) hm[hu++] = yl, yl != 0 && (gm = yl);
                        else {
                          var uT = yl == 16, mm = yl - 16, cT = Et[mm], wm = Z(po, Le[mm]) + cT;
                          if (hu + wm > Tc) break n;
                          for (var dT = uT ? gm : 0; 0 < wm--; ) hm[hu++] = dT;
                        }
                      }
                      Tf = 1;
                      break n;
                    }
                    Tf || (fm.a = 3), Cc = Tf;
                  }
                  (Cc = Cc && !vo.h) && (Cf = E(nT, aT, 8, fu, bf)), Cc && Cf != 0 ? kc = Cf : (bc.a = 3, kc = 0);
                }
                if (kc == 0) break r;
                if (qi && Lr[Yr] == 1 && (qi = Is[Cn].g == 0), Vo += Is[Cn].g, Cn += kc, 3 >= Yr) {
                  var gu, xf = ys[0];
                  for (gu = 1; gu < dA; ++gu) ys[gu] > xf && (xf = ys[gu]);
                  QA += xf;
                }
              }
              if (ra.nd = qi, ra.Qb = 0, qi && (ra.qb = (Qs[3][oi[3] + 0].value << 24 | Qs[1][oi[1] + 0].value << 16 | Qs[2][oi[2] + 0].value) >>> 0, Vo == 0 && 256 > Qs[0][oi[0] + 0].value && (ra.Qb = 1, ra.qb += Qs[0][oi[0] + 0].value << 8)), ra.jc = !ra.Qb && 6 > QA, ra.jc) {
                var xc, ji = ra;
                for (xc = 0; xc < Js; ++xc) {
                  var mo = xc, wo = ji.pd[mo], Dc = ji.G[0][ji.H[0] + mo];
                  256 <= Dc.value ? (wo.g = Dc.g + 256, wo.value = Dc.value) : (wo.g = 0, wo.value = 0, mo >>= pn(Dc, 8, wo), mo >>= pn(ji.G[1][ji.H[1] + mo], 16, wo), mo >>= pn(ji.G[2][ji.H[2] + mo], 0, wo), pn(ji.G[3][ji.H[3] + mo], 24, wo));
                }
              }
            }
            cA.vc = Sn, cA.Wb = Kn, cA.Ya = Ls, cA.yc = Fs, rr = 1;
            break t;
          }
          rr = 0;
        }
        if (!(re = rr)) {
          U.a = 3;
          break e;
        }
        if (0 < st) {
          if (Be.ua = 1 << st, !ne(Be.Wa, st)) {
            U.a = 1, re = 0;
            break e;
          }
        } else Be.ua = 0;
        var Df = U, ym = Ae, fT = ue, Ef = Df.s, Sf = Ef.xc;
        if (Df.c = ym, Df.i = fT, Ef.md = Ie(ym, Sf), Ef.wc = Sf == 0 ? -1 : (1 << Sf) - 1, b) {
          U.xb = KA;
          break e;
        }
        if ((He = A(Ae * ue)) == null) {
          U.a = 1, re = 0;
          break e;
        }
        re = (re = pa(U, He, 0, Ae, ue, ue, null)) && !de.h;
        break e;
      }
      return re ? (V != null ? V[0] = He : (t(He == null), t(b)), U.$ = 0, b || ma(Be)) : ma(Be), re;
    }
    function Xa(d, g) {
      var b = d.c * d.i, U = b + g + 16 * g;
      return t(d.c <= g), d.V = A(U), d.V == null ? (d.Ta = null, d.Ua = 0, d.a = 1, 0) : (d.Ta = d.V, d.Ua = d.Ba + b + g, 1);
    }
    function oA(d, g) {
      var b = d.C, U = g - b, V = d.V, re = d.Ba + d.c * b;
      for (t(g <= d.l.o); 0 < U; ) {
        var Ae = 16 < U ? 16 : U, ue = d.l.ma, de = d.l.width, Be = de * Ae, He = ue.ca, st = ue.tb + de * b, be = d.Ta, We = d.Ua;
        Ca(d, Ae, V, re), iu(be, We, He, st, Be), zr(ue, b, b + Ae, He, st, de), U -= Ae, V += Ae * d.c, b += Ae;
      }
      t(b == g), d.C = d.Ma = g;
    }
    function Ta() {
      this.ub = this.yd = this.td = this.Rb = 0;
    }
    function ts() {
      this.Kd = this.Ld = this.Ud = this.Td = this.i = this.c = 0;
    }
    function Hs() {
      this.Fb = this.Bb = this.Cb = 0, this.Zb = A(4), this.Lb = A(4);
    }
    function sa() {
      this.Yb = (function() {
        var d = [];
        return (function g(b, U, V) {
          for (var re = V[U], Ae = 0; Ae < re && (b.push(V.length > U + 1 ? [] : 0), !(V.length < U + 1)); Ae++) g(b[Ae], U + 1, V);
        })(d, 0, [3, 11]), d;
      })();
    }
    function rs() {
      this.jb = A(3), this.Wc = s([4, 8], sa), this.Xc = s([4, 17], sa);
    }
    function Jn() {
      this.Pc = this.wb = this.Tb = this.zd = 0, this.vd = new A(4), this.od = new A(4);
    }
    function ia() {
      this.ld = this.La = this.dd = this.tc = 0;
    }
    function xa() {
      this.Na = this.la = 0;
    }
    function Bn() {
      this.Sc = [0, 0], this.Eb = [0, 0], this.Qc = [0, 0], this.ia = this.lc = 0;
    }
    function Zn() {
      this.ad = A(384), this.Za = 0, this.Ob = A(16), this.$b = this.Ad = this.ia = this.Gc = this.Hc = this.Dd = 0;
    }
    function Xr() {
      this.uc = this.M = this.Nb = 0, this.wa = Array(new ia()), this.Y = 0, this.ya = Array(new Zn()), this.aa = 0, this.l = new ya();
    }
    function wa() {
      this.y = A(16), this.f = A(8), this.ea = A(8);
    }
    function Da() {
      this.cb = this.a = 0, this.sc = "", this.m = new C(), this.Od = new Ta(), this.Kc = new ts(), this.ed = new Jn(), this.Qa = new Hs(), this.Ic = this.$c = this.Aa = 0, this.D = new Xr(), this.Xb = this.Va = this.Hb = this.zb = this.yb = this.Ub = this.za = 0, this.Jc = i(8, C), this.ia = 0, this.pb = i(4, Bn), this.Pa = new rs(), this.Bd = this.kc = 0, this.Ac = [], this.Bc = 0, this.zc = [0, 0, 0, 0], this.Gd = Array(new wa()), this.Hd = 0, this.rb = Array(new xa()), this.sb = 0, this.wa = Array(new ia()), this.Y = 0, this.oc = [], this.pc = 0, this.sa = [], this.ta = 0, this.qa = [], this.ra = 0, this.Ha = [], this.B = this.R = this.Ia = 0, this.Ec = [], this.M = this.ja = this.Vb = this.Fc = 0, this.ya = Array(new Zn()), this.L = this.aa = 0, this.gd = s([4, 2], ia), this.ga = null, this.Fa = [], this.Cc = this.qc = this.P = 0, this.Gb = [], this.Uc = 0, this.mb = [], this.nb = 0, this.rc = [], this.Ga = this.Vc = 0;
    }
    function bn(d, g) {
      return 0 > d ? 0 : d > g ? g : d;
    }
    function ya() {
      this.T = this.U = this.ka = this.height = this.width = 0, this.y = [], this.f = [], this.ea = [], this.Rc = this.fa = this.W = this.N = this.O = 0, this.ma = "void", this.put = "VP8IoPutHook", this.ac = "VP8IoSetupHook", this.bc = "VP8IoTeardownHook", this.ha = this.Kb = 0, this.data = [], this.hb = this.ib = this.da = this.o = this.j = this.va = this.v = this.Da = this.ob = this.w = 0, this.F = [], this.J = 0;
    }
    function Ea() {
      var d = new Da();
      return d != null && (d.a = 0, d.sc = "OK", d.cb = 0, d.Xb = 0, WA || (WA = pA)), d;
    }
    function Hr(d, g, b) {
      return d.a == 0 && (d.a = g, d.sc = b, d.cb = 0), 0;
    }
    function gA(d, g, b) {
      return 3 <= b && d[g + 0] == 157 && d[g + 1] == 1 && d[g + 2] == 42;
    }
    function vA(d, g) {
      if (d == null) return 0;
      if (d.a = 0, d.sc = "OK", g == null) return Hr(d, 2, "null VP8Io passed to VP8GetHeaders()");
      var b = g.data, U = g.w, V = g.ha;
      if (4 > V) return Hr(d, 7, "Truncated header.");
      var re = b[U + 0] | b[U + 1] << 8 | b[U + 2] << 16, Ae = d.Od;
      if (Ae.Rb = !(1 & re), Ae.td = re >> 1 & 7, Ae.yd = re >> 4 & 1, Ae.ub = re >> 5, 3 < Ae.td) return Hr(d, 3, "Incorrect keyframe parameters.");
      if (!Ae.yd) return Hr(d, 4, "Frame not displayable.");
      U += 3, V -= 3;
      var ue = d.Kc;
      if (Ae.Rb) {
        if (7 > V) return Hr(d, 7, "cannot parse picture header");
        if (!gA(b, U, V)) return Hr(d, 3, "Bad code word");
        ue.c = 16383 & (b[U + 4] << 8 | b[U + 3]), ue.Td = b[U + 4] >> 6, ue.i = 16383 & (b[U + 6] << 8 | b[U + 5]), ue.Ud = b[U + 6] >> 6, U += 7, V -= 7, d.za = ue.c + 15 >> 4, d.Ub = ue.i + 15 >> 4, g.width = ue.c, g.height = ue.i, g.Da = 0, g.j = 0, g.v = 0, g.va = g.width, g.o = g.height, g.da = 0, g.ib = g.width, g.hb = g.height, g.U = g.width, g.T = g.height, a((re = d.Pa).jb, 0, 255, re.jb.length), t((re = d.Qa) != null), re.Cb = 0, re.Bb = 0, re.Fb = 1, a(re.Zb, 0, 0, re.Zb.length), a(re.Lb, 0, 0, re.Lb);
      }
      if (Ae.ub > V) return Hr(d, 7, "bad partition length");
      J(re = d.m, b, U, Ae.ub), U += Ae.ub, V -= Ae.ub, Ae.Rb && (ue.Ld = le(re), ue.Kd = le(re)), ue = d.Qa;
      var de, Be = d.Pa;
      if (t(re != null), t(ue != null), ue.Cb = le(re), ue.Cb) {
        if (ue.Bb = le(re), le(re)) {
          for (ue.Fb = le(re), de = 0; 4 > de; ++de) ue.Zb[de] = le(re) ? I(re, 7) : 0;
          for (de = 0; 4 > de; ++de) ue.Lb[de] = le(re) ? I(re, 6) : 0;
        }
        if (ue.Bb) for (de = 0; 3 > de; ++de) Be.jb[de] = le(re) ? S(re, 8) : 255;
      } else ue.Bb = 0;
      if (re.Ka) return Hr(d, 3, "cannot parse segment header");
      if ((ue = d.ed).zd = le(re), ue.Tb = S(re, 6), ue.wb = S(re, 3), ue.Pc = le(re), ue.Pc && le(re)) {
        for (Be = 0; 4 > Be; ++Be) le(re) && (ue.vd[Be] = I(re, 6));
        for (Be = 0; 4 > Be; ++Be) le(re) && (ue.od[Be] = I(re, 6));
      }
      if (d.L = ue.Tb == 0 ? 0 : ue.zd ? 1 : 2, re.Ka) return Hr(d, 3, "cannot parse filter header");
      var He = V;
      if (V = de = U, U = de + He, ue = He, d.Xb = (1 << S(d.m, 2)) - 1, He < 3 * (Be = d.Xb)) b = 7;
      else {
        for (de += 3 * Be, ue -= 3 * Be, He = 0; He < Be; ++He) {
          var st = b[V + 0] | b[V + 1] << 8 | b[V + 2] << 16;
          st > ue && (st = ue), J(d.Jc[+He], b, de, st), de += st, ue -= st, V += 3;
        }
        J(d.Jc[+Be], b, de, ue), b = de < U ? 0 : 5;
      }
      if (b != 0) return Hr(d, b, "cannot parse partitions");
      for (b = S(de = d.m, 7), V = le(de) ? I(de, 4) : 0, U = le(de) ? I(de, 4) : 0, ue = le(de) ? I(de, 4) : 0, Be = le(de) ? I(de, 4) : 0, de = le(de) ? I(de, 4) : 0, He = d.Qa, st = 0; 4 > st; ++st) {
        if (He.Cb) {
          var be = He.Zb[st];
          He.Fb || (be += b);
        } else {
          if (0 < st) {
            d.pb[st] = d.pb[0];
            continue;
          }
          be = b;
        }
        var We = d.pb[st];
        We.Sc[0] = Ba[bn(be + V, 127)], We.Sc[1] = FA[bn(be + 0, 127)], We.Eb[0] = 2 * Ba[bn(be + U, 127)], We.Eb[1] = 101581 * FA[bn(be + ue, 127)] >> 16, 8 > We.Eb[1] && (We.Eb[1] = 8), We.Qc[0] = Ba[bn(be + Be, 117)], We.Qc[1] = FA[bn(be + de, 127)], We.lc = be + de;
      }
      if (!Ae.Rb) return Hr(d, 4, "Not a key frame.");
      for (le(re), Ae = d.Pa, b = 0; 4 > b; ++b) {
        for (V = 0; 8 > V; ++V) for (U = 0; 3 > U; ++U) for (ue = 0; 11 > ue; ++ue) Be = _e(re, Si[b][V][U][ue]) ? S(re, 8) : Ei[b][V][U][ue], Ae.Wc[b][V].Yb[U][ue] = Be;
        for (V = 0; 17 > V; ++V) Ae.Xc[b][V] = Ae.Wc[b][uu[V]];
      }
      return d.kc = le(re), d.kc && (d.Bd = S(re, 8)), d.cb = 1;
    }
    function pA(d, g, b, U, V, re, Ae) {
      var ue = g[V].Yb[b];
      for (b = 0; 16 > V; ++V) {
        if (!_e(d, ue[b + 0])) return V;
        for (; !_e(d, ue[b + 1]); ) if (ue = g[++V].Yb[0], b = 0, V == 16) return 16;
        var de = g[V + 1].Yb;
        if (_e(d, ue[b + 2])) {
          var Be = d, He = 0;
          if (_e(Be, (be = ue)[(st = b) + 3])) if (_e(Be, be[st + 6])) {
            for (ue = 0, st = 2 * (He = _e(Be, be[st + 8])) + (be = _e(Be, be[st + 9 + He])), He = 0, be = Ws[st]; be[ue]; ++ue) He += He + _e(Be, be[ue]);
            He += 3 + (8 << st);
          } else _e(Be, be[st + 7]) ? (He = 7 + 2 * _e(Be, 165), He += _e(Be, 145)) : He = 5 + _e(Be, 159);
          else He = _e(Be, be[st + 4]) ? 3 + _e(Be, be[st + 5]) : 2;
          ue = de[2];
        } else He = 1, ue = de[1];
        de = Ae + ba[V], 0 > (Be = d).b && ve(Be);
        var st, be = Be.b, We = (st = Be.Ca >> 1) - (Be.I >> be) >> 31;
        --Be.b, Be.Ca += We, Be.Ca |= 1, Be.I -= (st + 1 & We) << be, re[de] = ((He ^ We) - We) * U[(0 < V) + 0];
      }
      return 16;
    }
    function DA(d) {
      var g = d.rb[d.sb - 1];
      g.la = 0, g.Na = 0, a(d.zc, 0, 0, d.zc.length), d.ja = 0;
    }
    function oa(d, g, b, U, V) {
      V = d[g + b + 32 * U] + (V >> 3), d[g + b + 32 * U] = -256 & V ? 0 > V ? 0 : 255 : V;
    }
    function Ja(d, g, b, U, V, re) {
      oa(d, g, 0, b, U + V), oa(d, g, 1, b, U + re), oa(d, g, 2, b, U - re), oa(d, g, 3, b, U - V);
    }
    function Za(d) {
      return (20091 * d >> 16) + d;
    }
    function ea(d, g, b, U) {
      var V, re = 0, Ae = A(16);
      for (V = 0; 4 > V; ++V) {
        var ue = d[g + 0] + d[g + 8], de = d[g + 0] - d[g + 8], Be = (35468 * d[g + 4] >> 16) - Za(d[g + 12]), He = Za(d[g + 4]) + (35468 * d[g + 12] >> 16);
        Ae[re + 0] = ue + He, Ae[re + 1] = de + Be, Ae[re + 2] = de - Be, Ae[re + 3] = ue - He, re += 4, g++;
      }
      for (V = re = 0; 4 > V; ++V) ue = (d = Ae[re + 0] + 4) + Ae[re + 8], de = d - Ae[re + 8], Be = (35468 * Ae[re + 4] >> 16) - Za(Ae[re + 12]), oa(b, U, 0, 0, ue + (He = Za(Ae[re + 4]) + (35468 * Ae[re + 12] >> 16))), oa(b, U, 1, 0, de + Be), oa(b, U, 2, 0, de - Be), oa(b, U, 3, 0, ue - He), re++, U += 32;
    }
    function fs(d, g, b, U) {
      var V = d[g + 0] + 4, re = 35468 * d[g + 4] >> 16, Ae = Za(d[g + 4]), ue = 35468 * d[g + 1] >> 16;
      Ja(b, U, 0, V + Ae, d = Za(d[g + 1]), ue), Ja(b, U, 1, V + re, d, ue), Ja(b, U, 2, V - re, d, ue), Ja(b, U, 3, V - Ae, d, ue);
    }
    function OA(d, g, b, U, V) {
      ea(d, g, b, U), V && ea(d, g + 16, b, U + 4);
    }
    function Ha(d, g, b, U) {
      ni(d, g + 0, b, U, 1), ni(d, g + 32, b, U + 128, 1);
    }
    function Wt(d, g, b, U) {
      var V;
      for (d = d[g + 0] + 4, V = 0; 4 > V; ++V) for (g = 0; 4 > g; ++g) oa(b, U, g, V, d);
    }
    function fe(d, g, b, U) {
      d[g + 0] && BA(d, g + 0, b, U), d[g + 16] && BA(d, g + 16, b, U + 4), d[g + 32] && BA(d, g + 32, b, U + 128), d[g + 48] && BA(d, g + 48, b, U + 128 + 4);
    }
    function et(d, g, b, U) {
      var V, re = A(16);
      for (V = 0; 4 > V; ++V) {
        var Ae = d[g + 0 + V] + d[g + 12 + V], ue = d[g + 4 + V] + d[g + 8 + V], de = d[g + 4 + V] - d[g + 8 + V], Be = d[g + 0 + V] - d[g + 12 + V];
        re[0 + V] = Ae + ue, re[8 + V] = Ae - ue, re[4 + V] = Be + de, re[12 + V] = Be - de;
      }
      for (V = 0; 4 > V; ++V) Ae = (d = re[0 + 4 * V] + 3) + re[3 + 4 * V], ue = re[1 + 4 * V] + re[2 + 4 * V], de = re[1 + 4 * V] - re[2 + 4 * V], Be = d - re[3 + 4 * V], b[U + 0] = Ae + ue >> 3, b[U + 16] = Be + de >> 3, b[U + 32] = Ae - ue >> 3, b[U + 48] = Be - de >> 3, U += 64;
    }
    function ft(d, g, b) {
      var U, V = g - 32, re = z, Ae = 255 - d[V - 1];
      for (U = 0; U < b; ++U) {
        var ue, de = re, Be = Ae + d[g - 1];
        for (ue = 0; ue < b; ++ue) d[g + ue] = de[Be + d[V + ue]];
        g += 32;
      }
    }
    function Yt(d, g) {
      ft(d, g, 4);
    }
    function zt(d, g) {
      ft(d, g, 8);
    }
    function gr(d, g) {
      ft(d, g, 16);
    }
    function rn(d, g) {
      var b;
      for (b = 0; 16 > b; ++b) r(d, g + 32 * b, d, g - 32, 16);
    }
    function Gn(d, g) {
      var b;
      for (b = 16; 0 < b; --b) a(d, g, d[g - 1], 16), g += 32;
    }
    function ln(d, g, b) {
      var U;
      for (U = 0; 16 > U; ++U) a(g, b + 32 * U, d, 16);
    }
    function Hn(d, g) {
      var b, U = 16;
      for (b = 0; 16 > b; ++b) U += d[g - 1 + 32 * b] + d[g + b - 32];
      ln(U >> 5, d, g);
    }
    function Ln(d, g) {
      var b, U = 8;
      for (b = 0; 16 > b; ++b) U += d[g - 1 + 32 * b];
      ln(U >> 4, d, g);
    }
    function On(d, g) {
      var b, U = 8;
      for (b = 0; 16 > b; ++b) U += d[g + b - 32];
      ln(U >> 4, d, g);
    }
    function hs(d, g) {
      ln(128, d, g);
    }
    function Dr(d, g, b) {
      return d + 2 * g + b + 2 >> 2;
    }
    function Pi(d, g) {
      var b, U = g - 32;
      for (U = new Uint8Array([Dr(d[U - 1], d[U + 0], d[U + 1]), Dr(d[U + 0], d[U + 1], d[U + 2]), Dr(d[U + 1], d[U + 2], d[U + 3]), Dr(d[U + 2], d[U + 3], d[U + 4])]), b = 0; 4 > b; ++b) r(d, g + 32 * b, U, 0, U.length);
    }
    function Xs(d, g) {
      var b = d[g - 1], U = d[g - 1 + 32], V = d[g - 1 + 64], re = d[g - 1 + 96];
      De(d, g + 0, 16843009 * Dr(d[g - 1 - 32], b, U)), De(d, g + 32, 16843009 * Dr(b, U, V)), De(d, g + 64, 16843009 * Dr(U, V, re)), De(d, g + 96, 16843009 * Dr(V, re, re));
    }
    function bi(d, g) {
      var b, U = 4;
      for (b = 0; 4 > b; ++b) U += d[g + b - 32] + d[g - 1 + 32 * b];
      for (U >>= 3, b = 0; 4 > b; ++b) a(d, g + 32 * b, U, 4);
    }
    function Os(d, g) {
      var b = d[g - 1 + 0], U = d[g - 1 + 32], V = d[g - 1 + 64], re = d[g - 1 - 32], Ae = d[g + 0 - 32], ue = d[g + 1 - 32], de = d[g + 2 - 32], Be = d[g + 3 - 32];
      d[g + 0 + 96] = Dr(U, V, d[g - 1 + 96]), d[g + 1 + 96] = d[g + 0 + 64] = Dr(b, U, V), d[g + 2 + 96] = d[g + 1 + 64] = d[g + 0 + 32] = Dr(re, b, U), d[g + 3 + 96] = d[g + 2 + 64] = d[g + 1 + 32] = d[g + 0 + 0] = Dr(Ae, re, b), d[g + 3 + 64] = d[g + 2 + 32] = d[g + 1 + 0] = Dr(ue, Ae, re), d[g + 3 + 32] = d[g + 2 + 0] = Dr(de, ue, Ae), d[g + 3 + 0] = Dr(Be, de, ue);
    }
    function ye(d, g) {
      var b = d[g + 1 - 32], U = d[g + 2 - 32], V = d[g + 3 - 32], re = d[g + 4 - 32], Ae = d[g + 5 - 32], ue = d[g + 6 - 32], de = d[g + 7 - 32];
      d[g + 0 + 0] = Dr(d[g + 0 - 32], b, U), d[g + 1 + 0] = d[g + 0 + 32] = Dr(b, U, V), d[g + 2 + 0] = d[g + 1 + 32] = d[g + 0 + 64] = Dr(U, V, re), d[g + 3 + 0] = d[g + 2 + 32] = d[g + 1 + 64] = d[g + 0 + 96] = Dr(V, re, Ae), d[g + 3 + 32] = d[g + 2 + 64] = d[g + 1 + 96] = Dr(re, Ae, ue), d[g + 3 + 64] = d[g + 2 + 96] = Dr(Ae, ue, de), d[g + 3 + 96] = Dr(ue, de, de);
    }
    function Re(d, g) {
      var b = d[g - 1 + 0], U = d[g - 1 + 32], V = d[g - 1 + 64], re = d[g - 1 - 32], Ae = d[g + 0 - 32], ue = d[g + 1 - 32], de = d[g + 2 - 32], Be = d[g + 3 - 32];
      d[g + 0 + 0] = d[g + 1 + 64] = re + Ae + 1 >> 1, d[g + 1 + 0] = d[g + 2 + 64] = Ae + ue + 1 >> 1, d[g + 2 + 0] = d[g + 3 + 64] = ue + de + 1 >> 1, d[g + 3 + 0] = de + Be + 1 >> 1, d[g + 0 + 96] = Dr(V, U, b), d[g + 0 + 64] = Dr(U, b, re), d[g + 0 + 32] = d[g + 1 + 96] = Dr(b, re, Ae), d[g + 1 + 32] = d[g + 2 + 96] = Dr(re, Ae, ue), d[g + 2 + 32] = d[g + 3 + 96] = Dr(Ae, ue, de), d[g + 3 + 32] = Dr(ue, de, Be);
    }
    function at(d, g) {
      var b = d[g + 0 - 32], U = d[g + 1 - 32], V = d[g + 2 - 32], re = d[g + 3 - 32], Ae = d[g + 4 - 32], ue = d[g + 5 - 32], de = d[g + 6 - 32], Be = d[g + 7 - 32];
      d[g + 0 + 0] = b + U + 1 >> 1, d[g + 1 + 0] = d[g + 0 + 64] = U + V + 1 >> 1, d[g + 2 + 0] = d[g + 1 + 64] = V + re + 1 >> 1, d[g + 3 + 0] = d[g + 2 + 64] = re + Ae + 1 >> 1, d[g + 0 + 32] = Dr(b, U, V), d[g + 1 + 32] = d[g + 0 + 96] = Dr(U, V, re), d[g + 2 + 32] = d[g + 1 + 96] = Dr(V, re, Ae), d[g + 3 + 32] = d[g + 2 + 96] = Dr(re, Ae, ue), d[g + 3 + 64] = Dr(Ae, ue, de), d[g + 3 + 96] = Dr(ue, de, Be);
    }
    function $e(d, g) {
      var b = d[g - 1 + 0], U = d[g - 1 + 32], V = d[g - 1 + 64], re = d[g - 1 + 96];
      d[g + 0 + 0] = b + U + 1 >> 1, d[g + 2 + 0] = d[g + 0 + 32] = U + V + 1 >> 1, d[g + 2 + 32] = d[g + 0 + 64] = V + re + 1 >> 1, d[g + 1 + 0] = Dr(b, U, V), d[g + 3 + 0] = d[g + 1 + 32] = Dr(U, V, re), d[g + 3 + 32] = d[g + 1 + 64] = Dr(V, re, re), d[g + 3 + 64] = d[g + 2 + 64] = d[g + 0 + 96] = d[g + 1 + 96] = d[g + 2 + 96] = d[g + 3 + 96] = re;
    }
    function Tt(d, g) {
      var b = d[g - 1 + 0], U = d[g - 1 + 32], V = d[g - 1 + 64], re = d[g - 1 + 96], Ae = d[g - 1 - 32], ue = d[g + 0 - 32], de = d[g + 1 - 32], Be = d[g + 2 - 32];
      d[g + 0 + 0] = d[g + 2 + 32] = b + Ae + 1 >> 1, d[g + 0 + 32] = d[g + 2 + 64] = U + b + 1 >> 1, d[g + 0 + 64] = d[g + 2 + 96] = V + U + 1 >> 1, d[g + 0 + 96] = re + V + 1 >> 1, d[g + 3 + 0] = Dr(ue, de, Be), d[g + 2 + 0] = Dr(Ae, ue, de), d[g + 1 + 0] = d[g + 3 + 32] = Dr(b, Ae, ue), d[g + 1 + 32] = d[g + 3 + 64] = Dr(U, b, Ae), d[g + 1 + 64] = d[g + 3 + 96] = Dr(V, U, b), d[g + 1 + 96] = Dr(re, V, U);
    }
    function Lt(d, g) {
      var b;
      for (b = 0; 8 > b; ++b) r(d, g + 32 * b, d, g - 32, 8);
    }
    function ut(d, g) {
      var b;
      for (b = 0; 8 > b; ++b) a(d, g, d[g - 1], 8), g += 32;
    }
    function ct(d, g, b) {
      var U;
      for (U = 0; 8 > U; ++U) a(g, b + 32 * U, d, 8);
    }
    function Ut(d, g) {
      var b, U = 8;
      for (b = 0; 8 > b; ++b) U += d[g + b - 32] + d[g - 1 + 32 * b];
      ct(U >> 4, d, g);
    }
    function _t(d, g) {
      var b, U = 4;
      for (b = 0; 8 > b; ++b) U += d[g + b - 32];
      ct(U >> 3, d, g);
    }
    function Zt(d, g) {
      var b, U = 4;
      for (b = 0; 8 > b; ++b) U += d[g - 1 + 32 * b];
      ct(U >> 3, d, g);
    }
    function fr(d, g) {
      ct(128, d, g);
    }
    function or(d, g, b) {
      var U = d[g - b], V = d[g + 0], re = 3 * (V - U) + wl[1020 + d[g - 2 * b] - d[g + b]], Ae = R[112 + (re + 4 >> 3)];
      d[g - b] = z[255 + U + R[112 + (re + 3 >> 3)]], d[g + 0] = z[255 + V - Ae];
    }
    function ar(d, g, b, U) {
      var V = d[g + 0], re = d[g + b];
      return ge[255 + d[g - 2 * b] - d[g - b]] > U || ge[255 + re - V] > U;
    }
    function Or(d, g, b, U) {
      return 4 * ge[255 + d[g - b] - d[g + 0]] + ge[255 + d[g - 2 * b] - d[g + b]] <= U;
    }
    function Kr(d, g, b, U, V) {
      var re = d[g - 3 * b], Ae = d[g - 2 * b], ue = d[g - b], de = d[g + 0], Be = d[g + b], He = d[g + 2 * b], st = d[g + 3 * b];
      return 4 * ge[255 + ue - de] + ge[255 + Ae - Be] > U ? 0 : ge[255 + d[g - 4 * b] - re] <= V && ge[255 + re - Ae] <= V && ge[255 + Ae - ue] <= V && ge[255 + st - He] <= V && ge[255 + He - Be] <= V && ge[255 + Be - de] <= V;
    }
    function sr(d, g, b, U) {
      var V = 2 * U + 1;
      for (U = 0; 16 > U; ++U) Or(d, g + U, b, V) && or(d, g + U, b);
    }
    function Er(d, g, b, U) {
      var V = 2 * U + 1;
      for (U = 0; 16 > U; ++U) Or(d, g + U * b, 1, V) && or(d, g + U * b, 1);
    }
    function nn(d, g, b, U) {
      var V;
      for (V = 3; 0 < V; --V) sr(d, g += 4 * b, b, U);
    }
    function Pn(d, g, b, U) {
      var V;
      for (V = 3; 0 < V; --V) Er(d, g += 4, b, U);
    }
    function Ur(d, g, b, U, V, re, Ae, ue) {
      for (re = 2 * re + 1; 0 < V--; ) {
        if (Kr(d, g, b, re, Ae)) if (ar(d, g, b, ue)) or(d, g, b);
        else {
          var de = d, Be = g, He = b, st = de[Be - 2 * He], be = de[Be - He], We = de[Be + 0], Ze = de[Be + He], kt = de[Be + 2 * He], At = 27 * (Ft = wl[1020 + 3 * (We - be) + wl[1020 + st - Ze]]) + 63 >> 7, xt = 18 * Ft + 63 >> 7, Ft = 9 * Ft + 63 >> 7;
          de[Be - 3 * He] = z[255 + de[Be - 3 * He] + Ft], de[Be - 2 * He] = z[255 + st + xt], de[Be - He] = z[255 + be + At], de[Be + 0] = z[255 + We - At], de[Be + He] = z[255 + Ze - xt], de[Be + 2 * He] = z[255 + kt - Ft];
        }
        g += U;
      }
    }
    function Qr(d, g, b, U, V, re, Ae, ue) {
      for (re = 2 * re + 1; 0 < V--; ) {
        if (Kr(d, g, b, re, Ae)) if (ar(d, g, b, ue)) or(d, g, b);
        else {
          var de = d, Be = g, He = b, st = de[Be - He], be = de[Be + 0], We = de[Be + He], Ze = R[112 + (4 + (kt = 3 * (be - st)) >> 3)], kt = R[112 + (kt + 3 >> 3)], At = Ze + 1 >> 1;
          de[Be - 2 * He] = z[255 + de[Be - 2 * He] + At], de[Be - He] = z[255 + st + kt], de[Be + 0] = z[255 + be - Ze], de[Be + He] = z[255 + We - At];
        }
        g += U;
      }
    }
    function P(d, g, b, U, V, re) {
      Ur(d, g, b, 1, 16, U, V, re);
    }
    function he(d, g, b, U, V, re) {
      Ur(d, g, 1, b, 16, U, V, re);
    }
    function Fe(d, g, b, U, V, re) {
      var Ae;
      for (Ae = 3; 0 < Ae; --Ae) Qr(d, g += 4 * b, b, 1, 16, U, V, re);
    }
    function tt(d, g, b, U, V, re) {
      var Ae;
      for (Ae = 3; 0 < Ae; --Ae) Qr(d, g += 4, 1, b, 16, U, V, re);
    }
    function lt(d, g, b, U, V, re, Ae, ue) {
      Ur(d, g, V, 1, 8, re, Ae, ue), Ur(b, U, V, 1, 8, re, Ae, ue);
    }
    function v(d, g, b, U, V, re, Ae, ue) {
      Ur(d, g, 1, V, 8, re, Ae, ue), Ur(b, U, 1, V, 8, re, Ae, ue);
    }
    function L(d, g, b, U, V, re, Ae, ue) {
      Qr(d, g + 4 * V, V, 1, 8, re, Ae, ue), Qr(b, U + 4 * V, V, 1, 8, re, Ae, ue);
    }
    function j(d, g, b, U, V, re, Ae, ue) {
      Qr(d, g + 4, 1, V, 8, re, Ae, ue), Qr(b, U + 4, 1, V, 8, re, Ae, ue);
    }
    function ae() {
      this.ba = new er(), this.ec = [], this.cc = [], this.Mc = [], this.Dc = this.Nc = this.dc = this.fc = 0, this.Oa = new Ge(), this.memory = 0, this.Ib = "OutputFunc", this.Jb = "OutputAlphaFunc", this.Nd = "OutputRowFunc";
    }
    function pe() {
      this.data = [], this.offset = this.kd = this.ha = this.w = 0, this.na = [], this.xa = this.gb = this.Ja = this.Sa = this.P = 0;
    }
    function Oe() {
      this.nc = this.Ea = this.b = this.hc = 0, this.K = [], this.w = 0;
    }
    function Pe() {
      this.ua = 0, this.Wa = new je(), this.vb = new je(), this.md = this.xc = this.wc = 0, this.vc = [], this.Wb = 0, this.Ya = new oe(), this.yc = new Q();
    }
    function mt() {
      this.xb = this.a = 0, this.l = new ya(), this.ca = new er(), this.V = [], this.Ba = 0, this.Ta = [], this.Ua = 0, this.m = new H(), this.Pb = 0, this.wd = new H(), this.Ma = this.$ = this.C = this.i = this.c = this.xd = 0, this.s = new Pe(), this.ab = 0, this.gc = i(4, Oe), this.Oc = 0;
    }
    function Qt() {
      this.Lc = this.Z = this.$a = this.i = this.c = 0, this.l = new ya(), this.ic = 0, this.ca = [], this.tb = 0, this.qd = null, this.rd = 0;
    }
    function Rt(d, g, b, U, V, re, Ae) {
      for (d = d == null ? 0 : d[g + 0], g = 0; g < Ae; ++g) V[re + g] = d + b[U + g] & 255, d = V[re + g];
    }
    function cr(d, g, b, U, V, re, Ae) {
      var ue;
      if (d == null) Rt(null, null, b, U, V, re, Ae);
      else for (ue = 0; ue < Ae; ++ue) V[re + ue] = d[g + ue] + b[U + ue] & 255;
    }
    function dr(d, g, b, U, V, re, Ae) {
      if (d == null) Rt(null, null, b, U, V, re, Ae);
      else {
        var ue, de = d[g + 0], Be = de, He = de;
        for (ue = 0; ue < Ae; ++ue) Be = He + (de = d[g + ue]) - Be, He = b[U + ue] + (-256 & Be ? 0 > Be ? 0 : 255 : Be) & 255, Be = de, V[re + ue] = He;
      }
    }
    function qr(d, g, b, U) {
      var V = g.width, re = g.o;
      if (t(d != null && g != null), 0 > b || 0 >= U || b + U > re) return null;
      if (!d.Cc) {
        if (d.ga == null) {
          var Ae;
          if (d.ga = new Qt(), (Ae = d.ga == null) || (Ae = g.width * g.o, t(d.Gb.length == 0), d.Gb = A(Ae), d.Uc = 0, d.Gb == null ? Ae = 0 : (d.mb = d.Gb, d.nb = d.Uc, d.rc = null, Ae = 1), Ae = !Ae), !Ae) {
            Ae = d.ga;
            var ue = d.Fa, de = d.P, Be = d.qc, He = d.mb, st = d.nb, be = de + 1, We = Be - 1, Ze = Ae.l;
            if (t(ue != null && He != null && g != null), UA[0] = null, UA[1] = Rt, UA[2] = cr, UA[3] = dr, Ae.ca = He, Ae.tb = st, Ae.c = g.width, Ae.i = g.height, t(0 < Ae.c && 0 < Ae.i), 1 >= Be) g = 0;
            else if (Ae.$a = 3 & ue[de + 0], Ae.Z = ue[de + 0] >> 2 & 3, Ae.Lc = ue[de + 0] >> 4 & 3, de = ue[de + 0] >> 6 & 3, 0 > Ae.$a || 1 < Ae.$a || 4 <= Ae.Z || 1 < Ae.Lc || de) g = 0;
            else if (Ze.put = jt, Ze.ac = vr, Ze.bc = br, Ze.ma = Ae, Ze.width = g.width, Ze.height = g.height, Ze.Da = g.Da, Ze.v = g.v, Ze.va = g.va, Ze.j = g.j, Ze.o = g.o, Ae.$a) e: {
              t(Ae.$a == 1), g = En();
              t: for (; ; ) {
                if (g == null) {
                  g = 0;
                  break e;
                }
                if (t(Ae != null), Ae.mc = g, g.c = Ae.c, g.i = Ae.i, g.l = Ae.l, g.l.ma = Ae, g.l.width = Ae.c, g.l.height = Ae.i, g.a = 0, N(g.m, ue, be, We), !Vn(Ae.c, Ae.i, 1, g, null) || (g.ab == 1 && g.gc[0].hc == 3 && Yn(g.s) ? (Ae.ic = 1, ue = g.c * g.i, g.Ta = null, g.Ua = 0, g.V = A(ue), g.Ba = 0, g.V == null ? (g.a = 1, g = 0) : g = 1) : (Ae.ic = 0, g = Xa(g, Ae.c)), !g)) break t;
                g = 1;
                break e;
              }
              Ae.mc = null, g = 0;
            }
            else g = We >= Ae.c * Ae.i;
            Ae = !g;
          }
          if (Ae) return null;
          d.ga.Lc != 1 ? d.Ga = 0 : U = re - b;
        }
        t(d.ga != null), t(b + U <= re);
        e: {
          if (g = (ue = d.ga).c, re = ue.l.o, ue.$a == 0) {
            if (be = d.rc, We = d.Vc, Ze = d.Fa, de = d.P + 1 + b * g, Be = d.mb, He = d.nb + b * g, t(de <= d.P + d.qc), ue.Z != 0) for (t(UA[ue.Z] != null), Ae = 0; Ae < U; ++Ae) UA[ue.Z](be, We, Ze, de, Be, He, g), be = Be, We = He, He += g, de += g;
            else for (Ae = 0; Ae < U; ++Ae) r(Be, He, Ze, de, g), be = Be, We = He, He += g, de += g;
            d.rc = be, d.Vc = We;
          } else {
            if (t(ue.mc != null), g = b + U, t((Ae = ue.mc) != null), t(g <= Ae.i), Ae.C >= g) g = 1;
            else if (ue.ic || Wr(), ue.ic) {
              ue = Ae.V, be = Ae.Ba, We = Ae.c;
              var kt = Ae.i, At = (Ze = 1, de = Ae.$ / We, Be = Ae.$ % We, He = Ae.m, st = Ae.s, Ae.$), xt = We * kt, Ft = We * g, Vt = st.wc, Ht = At < Ft ? Dn(st, Be, de) : null;
              t(At <= xt), t(g <= kt), t(Yn(st));
              t: for (; ; ) {
                for (; !He.h && At < Ft; ) {
                  if (Be & Vt || (Ht = Dn(st, Be, de)), t(Ht != null), we(He), 256 > (kt = $r(Ht.G[0], Ht.H[0], He))) ue[be + At] = kt, ++At, ++Be >= We && (Be = 0, ++de <= g && !(de % 16) && Un(Ae, de));
                  else {
                    if (!(280 > kt)) {
                      Ze = 0;
                      break t;
                    }
                    kt = an(kt - 256, He);
                    var Cr, pr = $r(Ht.G[4], Ht.H[4], He);
                    if (we(He), !(At >= (pr = xn(We, pr = an(pr, He))) && xt - At >= kt)) {
                      Ze = 0;
                      break t;
                    }
                    for (Cr = 0; Cr < kt; ++Cr) ue[be + At + Cr] = ue[be + At + Cr - pr];
                    for (At += kt, Be += kt; Be >= We; ) Be -= We, ++de <= g && !(de % 16) && Un(Ae, de);
                    At < Ft && Be & Vt && (Ht = Dn(st, Be, de));
                  }
                  t(He.h == te(He));
                }
                Un(Ae, de > g ? g : de);
                break t;
              }
              !Ze || He.h && At < xt ? (Ze = 0, Ae.a = He.h ? 5 : 3) : Ae.$ = At, g = Ze;
            } else g = pa(Ae, Ae.V, Ae.Ba, Ae.c, Ae.i, g, oA);
            if (!g) {
              U = 0;
              break e;
            }
          }
          b + U >= re && (d.Cc = 1), U = 1;
        }
        if (!U) return null;
        if (d.Cc && ((U = d.ga) != null && (U.mc = null), d.ga = null, 0 < d.Ga)) return alert("todo:WebPDequantizeLevels"), null;
      }
      return d.nb + b * V;
    }
    function _r(d, g, b, U, V, re) {
      for (; 0 < V--; ) {
        var Ae, ue = d, de = g + (b ? 1 : 0), Be = d, He = g + (b ? 0 : 3);
        for (Ae = 0; Ae < U; ++Ae) {
          var st = Be[He + 4 * Ae];
          st != 255 && (st *= 32897, ue[de + 4 * Ae + 0] = ue[de + 4 * Ae + 0] * st >> 23, ue[de + 4 * Ae + 1] = ue[de + 4 * Ae + 1] * st >> 23, ue[de + 4 * Ae + 2] = ue[de + 4 * Ae + 2] * st >> 23);
        }
        g += re;
      }
    }
    function Pr(d, g, b, U, V) {
      for (; 0 < U--; ) {
        var re;
        for (re = 0; re < b; ++re) {
          var Ae = d[g + 2 * re + 0], ue = 15 & (Be = d[g + 2 * re + 1]), de = 4369 * ue, Be = (240 & Be | Be >> 4) * de >> 16;
          d[g + 2 * re + 0] = (240 & Ae | Ae >> 4) * de >> 16 & 240 | (15 & Ae | Ae << 4) * de >> 16 >> 4 & 15, d[g + 2 * re + 1] = 240 & Be | ue;
        }
        g += V;
      }
    }
    function un(d, g, b, U, V, re, Ae, ue) {
      var de, Be, He = 255;
      for (Be = 0; Be < V; ++Be) {
        for (de = 0; de < U; ++de) {
          var st = d[g + de];
          re[Ae + 4 * de] = st, He &= st;
        }
        g += b, Ae += ue;
      }
      return He != 255;
    }
    function wr(d, g, b, U, V) {
      var re;
      for (re = 0; re < V; ++re) b[U + re] = d[g + re] >> 8;
    }
    function Wr() {
      xi = _r, uc = Pr, $o = un, iu = wr;
    }
    function mn(d, g, b) {
      F[d] = function(U, V, re, Ae, ue, de, Be, He, st, be, We, Ze, kt, At, xt, Ft, Vt) {
        var Ht, Cr = Vt - 1 >> 1, pr = ue[de + 0] | Be[He + 0] << 16, en = st[be + 0] | We[Ze + 0] << 16;
        t(U != null);
        var yr = 3 * pr + en + 131074 >> 2;
        for (g(U[V + 0], 255 & yr, yr >> 16, kt, At), re != null && (yr = 3 * en + pr + 131074 >> 2, g(re[Ae + 0], 255 & yr, yr >> 16, xt, Ft)), Ht = 1; Ht <= Cr; ++Ht) {
          var yn = ue[de + Ht] | Be[He + Ht] << 16, uA = st[be + Ht] | We[Ze + Ht] << 16, tn = pr + yn + en + uA + 524296, Br = tn + 2 * (yn + en) >> 3;
          yr = Br + pr >> 1, pr = (tn = tn + 2 * (pr + uA) >> 3) + yn >> 1, g(U[V + 2 * Ht - 1], 255 & yr, yr >> 16, kt, At + (2 * Ht - 1) * b), g(U[V + 2 * Ht - 0], 255 & pr, pr >> 16, kt, At + (2 * Ht - 0) * b), re != null && (yr = tn + en >> 1, pr = Br + uA >> 1, g(re[Ae + 2 * Ht - 1], 255 & yr, yr >> 16, xt, Ft + (2 * Ht - 1) * b), g(re[Ae + 2 * Ht + 0], 255 & pr, pr >> 16, xt, Ft + (2 * Ht + 0) * b)), pr = yn, en = uA;
        }
        1 & Vt || (yr = 3 * pr + en + 131074 >> 2, g(U[V + Vt - 1], 255 & yr, yr >> 16, kt, At + (Vt - 1) * b), re != null && (yr = 3 * en + pr + 131074 >> 2, g(re[Ae + Vt - 1], 255 & yr, yr >> 16, xt, Ft + (Vt - 1) * b)));
      };
    }
    function eA() {
      ns[Ce] = hc, ns[xe] = gc, ns[Se] = cu, ns[Ne] = vc, ns[Me] = pc, ns[Ke] = sm, ns[Bt] = j4, ns[bt] = gc, ns[qe] = vc, ns[wt] = pc, ns[$t] = sm;
    }
    function tA(d) {
      return d & -16384 ? 0 > d ? 0 : 255 : d >> Y4;
    }
    function jr(d, g) {
      return tA((19077 * d >> 8) + (26149 * g >> 8) - 14234);
    }
    function cn(d, g, b) {
      return tA((19077 * d >> 8) - (6419 * g >> 8) - (13320 * b >> 8) + 8708);
    }
    function ta(d, g) {
      return tA((19077 * d >> 8) + (33050 * g >> 8) - 17685);
    }
    function Oa(d, g, b, U, V) {
      U[V + 0] = jr(d, b), U[V + 1] = cn(d, g, b), U[V + 2] = ta(d, g);
    }
    function mA(d, g, b, U, V) {
      U[V + 0] = ta(d, g), U[V + 1] = cn(d, g, b), U[V + 2] = jr(d, b);
    }
    function rA(d, g, b, U, V) {
      var re = cn(d, g, b);
      g = re << 3 & 224 | ta(d, g) >> 3, U[V + 0] = 248 & jr(d, b) | re >> 5, U[V + 1] = g;
    }
    function Sa(d, g, b, U, V) {
      var re = 240 & ta(d, g) | 15;
      U[V + 0] = 240 & jr(d, b) | cn(d, g, b) >> 4, U[V + 1] = re;
    }
    function Pa(d, g, b, U, V) {
      U[V + 0] = 255, Oa(d, g, b, U, V + 1);
    }
    function lA(d, g, b, U, V) {
      mA(d, g, b, U, V), U[V + 3] = 255;
    }
    function Wi(d, g, b, U, V) {
      Oa(d, g, b, U, V), U[V + 3] = 255;
    }
    function gs(d, g, b) {
      F[d] = function(U, V, re, Ae, ue, de, Be, He, st) {
        for (var be = He + (-2 & st) * b; He != be; ) g(U[V + 0], re[Ae + 0], ue[de + 0], Be, He), g(U[V + 1], re[Ae + 0], ue[de + 0], Be, He + b), V += 2, ++Ae, ++de, He += 2 * b;
        1 & st && g(U[V + 0], re[Ae + 0], ue[de + 0], Be, He);
      };
    }
    function Fa(d, g, b) {
      return b == 0 ? d == 0 ? g == 0 ? 6 : 5 : g == 0 ? 4 : 0 : b;
    }
    function uo(d, g, b, U, V) {
      switch (d >>> 30) {
        case 3:
          ni(g, b, U, V, 0);
          break;
        case 2:
          Es(g, b, U, V);
          break;
        case 1:
          BA(g, b, U, V);
      }
    }
    function Ci(d, g) {
      var b, U, V = g.M, re = g.Nb, Ae = d.oc, ue = d.pc + 40, de = d.oc, Be = d.pc + 584, He = d.oc, st = d.pc + 600;
      for (b = 0; 16 > b; ++b) Ae[ue + 32 * b - 1] = 129;
      for (b = 0; 8 > b; ++b) de[Be + 32 * b - 1] = 129, He[st + 32 * b - 1] = 129;
      for (0 < V ? Ae[ue - 1 - 32] = de[Be - 1 - 32] = He[st - 1 - 32] = 129 : (a(Ae, ue - 32 - 1, 127, 21), a(de, Be - 32 - 1, 127, 9), a(He, st - 32 - 1, 127, 9)), U = 0; U < d.za; ++U) {
        var be = g.ya[g.aa + U];
        if (0 < U) {
          for (b = -1; 16 > b; ++b) r(Ae, ue + 32 * b - 4, Ae, ue + 32 * b + 12, 4);
          for (b = -1; 8 > b; ++b) r(de, Be + 32 * b - 4, de, Be + 32 * b + 4, 4), r(He, st + 32 * b - 4, He, st + 32 * b + 4, 4);
        }
        var We = d.Gd, Ze = d.Hd + U, kt = be.ad, At = be.Hc;
        if (0 < V && (r(Ae, ue - 32, We[Ze].y, 0, 16), r(de, Be - 32, We[Ze].f, 0, 8), r(He, st - 32, We[Ze].ea, 0, 8)), be.Za) {
          var xt = Ae, Ft = ue - 32 + 16;
          for (0 < V && (U >= d.za - 1 ? a(xt, Ft, We[Ze].y[15], 4) : r(xt, Ft, We[Ze + 1].y, 0, 4)), b = 0; 4 > b; b++) xt[Ft + 128 + b] = xt[Ft + 256 + b] = xt[Ft + 384 + b] = xt[Ft + 0 + b];
          for (b = 0; 16 > b; ++b, At <<= 2) xt = Ae, Ft = ue + om[b], Zr[be.Ob[b]](xt, Ft), uo(At, kt, 16 * +b, xt, Ft);
        } else if (xt = Fa(U, V, be.Ob[0]), gn[xt](Ae, ue), At != 0) for (b = 0; 16 > b; ++b, At <<= 2) uo(At, kt, 16 * +b, Ae, ue + om[b]);
        for (b = be.Gc, xt = Fa(U, V, be.Dd), qn[xt](de, Be), qn[xt](He, st), At = kt, xt = de, Ft = Be, 255 & (be = 0 | b) && (170 & be ? ai(At, 256, xt, Ft) : Ss(At, 256, xt, Ft)), be = He, At = st, 255 & (b >>= 8) && (170 & b ? ai(kt, 320, be, At) : Ss(kt, 320, be, At)), V < d.Ub - 1 && (r(We[Ze].y, 0, Ae, ue + 480, 16), r(We[Ze].f, 0, de, Be + 224, 8), r(We[Ze].ea, 0, He, st + 224, 8)), b = 8 * re * d.B, We = d.sa, Ze = d.ta + 16 * U + 16 * re * d.R, kt = d.qa, be = d.ra + 8 * U + b, At = d.Ha, xt = d.Ia + 8 * U + b, b = 0; 16 > b; ++b) r(We, Ze + b * d.R, Ae, ue + 32 * b, 16);
        for (b = 0; 8 > b; ++b) r(kt, be + b * d.B, de, Be + 32 * b, 8), r(At, xt + b * d.B, He, st + 32 * b, 8);
      }
    }
    function co(d, g, b, U, V, re, Ae, ue, de) {
      var Be = [0], He = [0], st = 0, be = de != null ? de.kd : 0, We = de ?? new pe();
      if (d == null || 12 > b) return 7;
      We.data = d, We.w = g, We.ha = b, g = [g], b = [b], We.gb = [We.gb];
      e: {
        var Ze = g, kt = b, At = We.gb;
        if (t(d != null), t(kt != null), t(At != null), At[0] = 0, 12 <= kt[0] && !e(d, Ze[0], "RIFF")) {
          if (e(d, Ze[0] + 8, "WEBP")) {
            At = 3;
            break e;
          }
          var xt = Qe(d, Ze[0] + 4);
          if (12 > xt || 4294967286 < xt) {
            At = 3;
            break e;
          }
          if (be && xt > kt[0] - 8) {
            At = 7;
            break e;
          }
          At[0] = xt, Ze[0] += 12, kt[0] -= 12;
        }
        At = 0;
      }
      if (At != 0) return At;
      for (xt = 0 < We.gb[0], b = b[0]; ; ) {
        e: {
          var Ft = d;
          kt = g, At = b;
          var Vt = Be, Ht = He, Cr = Ze = [0];
          if ((yr = st = [st])[0] = 0, 8 > At[0]) At = 7;
          else {
            if (!e(Ft, kt[0], "VP8X")) {
              if (Qe(Ft, kt[0] + 4) != 10) {
                At = 3;
                break e;
              }
              if (18 > At[0]) {
                At = 7;
                break e;
              }
              var pr = Qe(Ft, kt[0] + 8), en = 1 + nt(Ft, kt[0] + 12);
              if (2147483648 <= en * (Ft = 1 + nt(Ft, kt[0] + 15))) {
                At = 3;
                break e;
              }
              Cr != null && (Cr[0] = pr), Vt != null && (Vt[0] = en), Ht != null && (Ht[0] = Ft), kt[0] += 18, At[0] -= 18, yr[0] = 1;
            }
            At = 0;
          }
        }
        if (st = st[0], Ze = Ze[0], At != 0) return At;
        if (kt = !!(2 & Ze), !xt && st) return 3;
        if (re != null && (re[0] = !!(16 & Ze)), Ae != null && (Ae[0] = kt), ue != null && (ue[0] = 0), Ae = Be[0], Ze = He[0], st && kt && de == null) {
          At = 0;
          break;
        }
        if (4 > b) {
          At = 7;
          break;
        }
        if (xt && st || !xt && !st && !e(d, g[0], "ALPH")) {
          b = [b], We.na = [We.na], We.P = [We.P], We.Sa = [We.Sa];
          e: {
            pr = d, At = g, xt = b;
            var yr = We.gb;
            Vt = We.na, Ht = We.P, Cr = We.Sa, en = 22, t(pr != null), t(xt != null), Ft = At[0];
            var yn = xt[0];
            for (t(Vt != null), t(Cr != null), Vt[0] = null, Ht[0] = null, Cr[0] = 0; ; ) {
              if (At[0] = Ft, xt[0] = yn, 8 > yn) {
                At = 7;
                break e;
              }
              var uA = Qe(pr, Ft + 4);
              if (4294967286 < uA) {
                At = 3;
                break e;
              }
              var tn = 8 + uA + 1 & -2;
              if (en += tn, 0 < yr && en > yr) {
                At = 3;
                break e;
              }
              if (!e(pr, Ft, "VP8 ") || !e(pr, Ft, "VP8L")) {
                At = 0;
                break e;
              }
              if (yn[0] < tn) {
                At = 7;
                break e;
              }
              e(pr, Ft, "ALPH") || (Vt[0] = pr, Ht[0] = Ft + 8, Cr[0] = uA), Ft += tn, yn -= tn;
            }
          }
          if (b = b[0], We.na = We.na[0], We.P = We.P[0], We.Sa = We.Sa[0], At != 0) break;
        }
        b = [b], We.Ja = [We.Ja], We.xa = [We.xa];
        e: if (yr = d, At = g, xt = b, Vt = We.gb[0], Ht = We.Ja, Cr = We.xa, pr = At[0], Ft = !e(yr, pr, "VP8 "), en = !e(yr, pr, "VP8L"), t(yr != null), t(xt != null), t(Ht != null), t(Cr != null), 8 > xt[0]) At = 7;
        else {
          if (Ft || en) {
            if (yr = Qe(yr, pr + 4), 12 <= Vt && yr > Vt - 12) {
              At = 3;
              break e;
            }
            if (be && yr > xt[0] - 8) {
              At = 7;
              break e;
            }
            Ht[0] = yr, At[0] += 8, xt[0] -= 8, Cr[0] = en;
          } else Cr[0] = 5 <= xt[0] && yr[pr + 0] == 47 && !(yr[pr + 4] >> 5), Ht[0] = xt[0];
          At = 0;
        }
        if (b = b[0], We.Ja = We.Ja[0], We.xa = We.xa[0], g = g[0], At != 0) break;
        if (4294967286 < We.Ja) return 3;
        if (ue == null || kt || (ue[0] = We.xa ? 2 : 1), Ae = [Ae], Ze = [Ze], We.xa) {
          if (5 > b) {
            At = 7;
            break;
          }
          ue = Ae, be = Ze, kt = re, d == null || 5 > b ? d = 0 : 5 <= b && d[g + 0] == 47 && !(d[g + 4] >> 5) ? (xt = [0], yr = [0], Vt = [0], N(Ht = new H(), d, g, b), on(Ht, xt, yr, Vt) ? (ue != null && (ue[0] = xt[0]), be != null && (be[0] = yr[0]), kt != null && (kt[0] = Vt[0]), d = 1) : d = 0) : d = 0;
        } else {
          if (10 > b) {
            At = 7;
            break;
          }
          ue = Ze, d == null || 10 > b || !gA(d, g + 3, b - 3) ? d = 0 : (be = d[g + 0] | d[g + 1] << 8 | d[g + 2] << 16, kt = 16383 & (d[g + 7] << 8 | d[g + 6]), d = 16383 & (d[g + 9] << 8 | d[g + 8]), 1 & be || 3 < (be >> 1 & 7) || !(be >> 4 & 1) || be >> 5 >= We.Ja || !kt || !d ? d = 0 : (Ae && (Ae[0] = kt), ue && (ue[0] = d), d = 1));
        }
        if (!d || (Ae = Ae[0], Ze = Ze[0], st && (Be[0] != Ae || He[0] != Ze))) return 3;
        de != null && (de[0] = We, de.offset = g - de.w, t(4294967286 > g - de.w), t(de.offset == de.ha - b));
        break;
      }
      return At == 0 || At == 7 && st && de == null ? (re != null && (re[0] |= We.na != null && 0 < We.na.length), U != null && (U[0] = Ae), V != null && (V[0] = Ze), 0) : At;
    }
    function vs(d, g, b) {
      var U = g.width, V = g.height, re = 0, Ae = 0, ue = U, de = V;
      if (g.Da = d != null && 0 < d.Da, g.Da && (ue = d.cd, de = d.bd, re = d.v, Ae = d.j, 11 > b || (re &= -2, Ae &= -2), 0 > re || 0 > Ae || 0 >= ue || 0 >= de || re + ue > U || Ae + de > V)) return 0;
      if (g.v = re, g.j = Ae, g.va = re + ue, g.o = Ae + de, g.U = ue, g.T = de, g.da = d != null && 0 < d.da, g.da) {
        if (!ot(ue, de, b = [d.ib], re = [d.hb])) return 0;
        g.ib = b[0], g.hb = re[0];
      }
      return g.ob = d != null && d.ob, g.Kb = d == null || !d.Sd, g.da && (g.ob = g.ib < 3 * U / 4 && g.hb < 3 * V / 4, g.Kb = 0), 1;
    }
    function EA(d) {
      if (d == null) return 2;
      if (11 > d.S) {
        var g = d.f.RGBA;
        g.fb += (d.height - 1) * g.A, g.A = -g.A;
      } else g = d.f.kb, d = d.height, g.O += (d - 1) * g.fa, g.fa = -g.fa, g.N += (d - 1 >> 1) * g.Ab, g.Ab = -g.Ab, g.W += (d - 1 >> 1) * g.Db, g.Db = -g.Db, g.F != null && (g.J += (d - 1) * g.lb, g.lb = -g.lb);
      return 0;
    }
    function PA(d, g, b, U) {
      if (U == null || 0 >= d || 0 >= g) return 2;
      if (b != null) {
        if (b.Da) {
          var V = b.cd, re = b.bd, Ae = -2 & b.v, ue = -2 & b.j;
          if (0 > Ae || 0 > ue || 0 >= V || 0 >= re || Ae + V > d || ue + re > g) return 2;
          d = V, g = re;
        }
        if (b.da) {
          if (!ot(d, g, V = [b.ib], re = [b.hb])) return 2;
          d = V[0], g = re[0];
        }
      }
      U.width = d, U.height = g;
      e: {
        var de = U.width, Be = U.height;
        if (d = U.S, 0 >= de || 0 >= Be || !(d >= Ce && 13 > d)) d = 2;
        else {
          if (0 >= U.Rd && U.sd == null) {
            Ae = re = V = g = 0;
            var He = (ue = de * lm[d]) * Be;
            if (11 > d || (re = (Be + 1) / 2 * (g = (de + 1) / 2), d == 12 && (Ae = (V = de) * Be)), (Be = A(He + 2 * re + Ae)) == null) {
              d = 1;
              break e;
            }
            U.sd = Be, 11 > d ? ((de = U.f.RGBA).eb = Be, de.fb = 0, de.A = ue, de.size = He) : ((de = U.f.kb).y = Be, de.O = 0, de.fa = ue, de.Fd = He, de.f = Be, de.N = 0 + He, de.Ab = g, de.Cd = re, de.ea = Be, de.W = 0 + He + re, de.Db = g, de.Ed = re, d == 12 && (de.F = Be, de.J = 0 + He + 2 * re), de.Tc = Ae, de.lb = V);
          }
          if (g = 1, V = U.S, re = U.width, Ae = U.height, V >= Ce && 13 > V) if (11 > V) d = U.f.RGBA, g &= (ue = Math.abs(d.A)) * (Ae - 1) + re <= d.size, g &= ue >= re * lm[V], g &= d.eb != null;
          else {
            d = U.f.kb, ue = (re + 1) / 2, He = (Ae + 1) / 2, de = Math.abs(d.fa), Be = Math.abs(d.Ab);
            var st = Math.abs(d.Db), be = Math.abs(d.lb), We = be * (Ae - 1) + re;
            g &= de * (Ae - 1) + re <= d.Fd, g &= Be * (He - 1) + ue <= d.Cd, g = (g &= st * (He - 1) + ue <= d.Ed) & de >= re & Be >= ue & st >= ue, g &= d.y != null, g &= d.f != null, g &= d.ea != null, V == 12 && (g &= be >= re, g &= We <= d.Tc, g &= d.F != null);
          }
          else g = 0;
          d = g ? 0 : 2;
        }
      }
      return d != 0 || b != null && b.fd && (d = EA(U)), d;
    }
    var Js = 64, ki = [0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215], fo = 24, wA = 32, SA = 8, Ki = [0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7];
    dt("Predictor0", "PredictorAdd0"), F.Predictor0 = function() {
      return 4278190080;
    }, F.Predictor1 = function(d) {
      return d;
    }, F.Predictor2 = function(d, g, b) {
      return g[b + 0];
    }, F.Predictor3 = function(d, g, b) {
      return g[b + 1];
    }, F.Predictor4 = function(d, g, b) {
      return g[b - 1];
    }, F.Predictor5 = function(d, g, b) {
      return Ct(Ct(d, g[b + 1]), g[b + 0]);
    }, F.Predictor6 = function(d, g, b) {
      return Ct(d, g[b - 1]);
    }, F.Predictor7 = function(d, g, b) {
      return Ct(d, g[b + 0]);
    }, F.Predictor8 = function(d, g, b) {
      return Ct(g[b - 1], g[b + 0]);
    }, F.Predictor9 = function(d, g, b) {
      return Ct(g[b + 0], g[b + 1]);
    }, F.Predictor10 = function(d, g, b) {
      return Ct(Ct(d, g[b - 1]), Ct(g[b + 0], g[b + 1]));
    }, F.Predictor11 = function(d, g, b) {
      var U = g[b + 0];
      return 0 >= K(U >> 24 & 255, d >> 24 & 255, (g = g[b - 1]) >> 24 & 255) + K(U >> 16 & 255, d >> 16 & 255, g >> 16 & 255) + K(U >> 8 & 255, d >> 8 & 255, g >> 8 & 255) + K(255 & U, 255 & d, 255 & g) ? U : d;
    }, F.Predictor12 = function(d, g, b) {
      var U = g[b + 0];
      return (Ve((d >> 24 & 255) + (U >> 24 & 255) - ((g = g[b - 1]) >> 24 & 255)) << 24 | Ve((d >> 16 & 255) + (U >> 16 & 255) - (g >> 16 & 255)) << 16 | Ve((d >> 8 & 255) + (U >> 8 & 255) - (g >> 8 & 255)) << 8 | Ve((255 & d) + (255 & U) - (255 & g))) >>> 0;
    }, F.Predictor13 = function(d, g, b) {
      var U = g[b - 1];
      return (ht((d = Ct(d, g[b + 0])) >> 24 & 255, U >> 24 & 255) << 24 | ht(d >> 16 & 255, U >> 16 & 255) << 16 | ht(d >> 8 & 255, U >> 8 & 255) << 8 | ht(255 & d, 255 & U)) >>> 0;
    };
    var Zs = F.PredictorAdd0;
    F.PredictorAdd1 = X, dt("Predictor2", "PredictorAdd2"), dt("Predictor3", "PredictorAdd3"), dt("Predictor4", "PredictorAdd4"), dt("Predictor5", "PredictorAdd5"), dt("Predictor6", "PredictorAdd6"), dt("Predictor7", "PredictorAdd7"), dt("Predictor8", "PredictorAdd8"), dt("Predictor9", "PredictorAdd9"), dt("Predictor10", "PredictorAdd10"), dt("Predictor11", "PredictorAdd11"), dt("Predictor12", "PredictorAdd12"), dt("Predictor13", "PredictorAdd13");
    var ei = F.PredictorAdd2;
    Xe("ColorIndexInverseTransform", "MapARGB", "32b", function(d) {
      return d >> 8 & 255;
    }, function(d) {
      return d;
    }), Xe("VP8LColorIndexInverseTransformAlpha", "MapAlpha", "8b", function(d) {
      return d;
    }, function(d) {
      return d >> 8 & 255;
    });
    var ho, yA = F.ColorIndexInverseTransform, ca = F.MapARGB, ml = F.VP8LColorIndexInverseTransformAlpha, ps = F.MapAlpha, ms = F.VP8LPredictorsAdd = [];
    ms.length = 16, (F.VP8LPredictors = []).length = 16, (F.VP8LPredictorsAdd_C = []).length = 16, (F.VP8LPredictors_C = []).length = 16;
    var Jr, Ua, Ds, ti, Ps, $i, ri, ni, Es, ai, BA, Ss, Qn, Wn, da, La, Ai, Wo, go, Ti, au, Au, su, Ko, xi, uc, $o, iu, cc = A(511), dc = A(2041), fc = A(225), ou = A(767), lu = 0, wl = dc, R = fc, z = ou, ge = cc, Ce = 0, xe = 1, Se = 2, Ne = 3, Me = 4, Ke = 5, Bt = 6, bt = 7, qe = 8, wt = 9, $t = 10, Le = [2, 3, 7], Et = [3, 3, 11], Xt = [280, 256, 256, 256, 40], Lr = [0, 1, 1, 1, 0], Rr = [17, 18, 0, 1, 2, 3, 4, 5, 16, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], Sr = [24, 7, 23, 25, 40, 6, 39, 41, 22, 26, 38, 42, 56, 5, 55, 57, 21, 27, 54, 58, 37, 43, 72, 4, 71, 73, 20, 28, 53, 59, 70, 74, 36, 44, 88, 69, 75, 52, 60, 3, 87, 89, 19, 29, 86, 90, 35, 45, 68, 76, 85, 91, 51, 61, 104, 2, 103, 105, 18, 30, 102, 106, 34, 46, 84, 92, 67, 77, 101, 107, 50, 62, 120, 1, 119, 121, 83, 93, 17, 31, 100, 108, 66, 78, 118, 122, 33, 47, 117, 123, 49, 63, 99, 109, 82, 94, 0, 116, 124, 65, 79, 16, 32, 98, 110, 48, 115, 125, 81, 95, 64, 114, 126, 97, 111, 80, 113, 127, 96, 112], Mn = [2954, 2956, 2958, 2962, 2970, 2986, 3018, 3082, 3212, 3468, 3980, 5004], wn = 8, Ba = [4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 91, 93, 95, 96, 98, 100, 101, 102, 104, 106, 108, 110, 112, 114, 116, 118, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 143, 145, 148, 151, 154, 157], FA = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 119, 122, 125, 128, 131, 134, 137, 140, 143, 146, 149, 152, 155, 158, 161, 164, 167, 170, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209, 213, 217, 221, 225, 229, 234, 239, 245, 249, 254, 259, 264, 269, 274, 279, 284], WA = null, Ws = [[173, 148, 140, 0], [176, 155, 140, 135, 0], [180, 157, 141, 134, 130, 0], [254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0]], ba = [0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15], Di = [-0, 1, -1, 2, -2, 3, 4, 6, -3, 5, -4, -5, -6, 7, -7, 8, -8, -9], Ei = [[[[128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]], [[253, 136, 254, 255, 228, 219, 128, 128, 128, 128, 128], [189, 129, 242, 255, 227, 213, 255, 219, 128, 128, 128], [106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128]], [[1, 98, 248, 255, 236, 226, 255, 255, 128, 128, 128], [181, 133, 238, 254, 221, 234, 255, 154, 128, 128, 128], [78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128]], [[1, 185, 249, 255, 243, 255, 128, 128, 128, 128, 128], [184, 150, 247, 255, 236, 224, 128, 128, 128, 128, 128], [77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128]], [[1, 101, 251, 255, 241, 255, 128, 128, 128, 128, 128], [170, 139, 241, 252, 236, 209, 255, 255, 128, 128, 128], [37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128]], [[1, 204, 254, 255, 245, 255, 128, 128, 128, 128, 128], [207, 160, 250, 255, 238, 128, 128, 128, 128, 128, 128], [102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128]], [[1, 152, 252, 255, 240, 255, 128, 128, 128, 128, 128], [177, 135, 243, 255, 234, 225, 128, 128, 128, 128, 128], [80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128]], [[1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [246, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]]], [[[198, 35, 237, 223, 193, 187, 162, 160, 145, 155, 62], [131, 45, 198, 221, 172, 176, 220, 157, 252, 221, 1], [68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128]], [[1, 149, 241, 255, 221, 224, 255, 255, 128, 128, 128], [184, 141, 234, 253, 222, 220, 255, 199, 128, 128, 128], [81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128]], [[1, 129, 232, 253, 214, 197, 242, 196, 255, 255, 128], [99, 121, 210, 250, 201, 198, 255, 202, 128, 128, 128], [23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128]], [[1, 200, 246, 255, 234, 255, 128, 128, 128, 128, 128], [109, 178, 241, 255, 231, 245, 255, 255, 128, 128, 128], [44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128]], [[1, 132, 239, 251, 219, 209, 255, 165, 128, 128, 128], [94, 136, 225, 251, 218, 190, 255, 255, 128, 128, 128], [22, 100, 174, 245, 186, 161, 255, 199, 128, 128, 128]], [[1, 182, 249, 255, 232, 235, 128, 128, 128, 128, 128], [124, 143, 241, 255, 227, 234, 128, 128, 128, 128, 128], [35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128]], [[1, 157, 247, 255, 236, 231, 255, 255, 128, 128, 128], [121, 141, 235, 255, 225, 227, 255, 255, 128, 128, 128], [45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128]], [[1, 1, 251, 255, 213, 255, 128, 128, 128, 128, 128], [203, 1, 248, 255, 255, 128, 128, 128, 128, 128, 128], [137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128]]], [[[253, 9, 248, 251, 207, 208, 255, 192, 128, 128, 128], [175, 13, 224, 243, 193, 185, 249, 198, 255, 255, 128], [73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128]], [[1, 95, 247, 253, 212, 183, 255, 255, 128, 128, 128], [239, 90, 244, 250, 211, 209, 255, 255, 128, 128, 128], [155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128]], [[1, 24, 239, 251, 218, 219, 255, 205, 128, 128, 128], [201, 51, 219, 255, 196, 186, 128, 128, 128, 128, 128], [69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128]], [[1, 191, 251, 255, 255, 128, 128, 128, 128, 128, 128], [223, 165, 249, 255, 213, 255, 128, 128, 128, 128, 128], [141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128]], [[1, 16, 248, 255, 255, 128, 128, 128, 128, 128, 128], [190, 36, 230, 255, 236, 255, 128, 128, 128, 128, 128], [149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128]], [[1, 226, 255, 128, 128, 128, 128, 128, 128, 128, 128], [247, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128], [240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128]], [[1, 134, 252, 255, 255, 128, 128, 128, 128, 128, 128], [213, 62, 250, 255, 255, 128, 128, 128, 128, 128, 128], [55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128]], [[128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]]], [[[202, 24, 213, 235, 186, 191, 220, 160, 240, 175, 255], [126, 38, 182, 232, 169, 184, 228, 174, 255, 187, 128], [61, 46, 138, 219, 151, 178, 240, 170, 255, 216, 128]], [[1, 112, 230, 250, 199, 191, 247, 159, 255, 255, 128], [166, 109, 228, 252, 211, 215, 255, 174, 128, 128, 128], [39, 77, 162, 232, 172, 180, 245, 178, 255, 255, 128]], [[1, 52, 220, 246, 198, 199, 249, 220, 255, 255, 128], [124, 74, 191, 243, 183, 193, 250, 221, 255, 255, 128], [24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128]], [[1, 182, 225, 249, 219, 240, 255, 224, 128, 128, 128], [149, 150, 226, 252, 216, 205, 255, 171, 128, 128, 128], [28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128]], [[1, 81, 230, 252, 204, 203, 255, 192, 128, 128, 128], [123, 102, 209, 247, 188, 196, 255, 233, 128, 128, 128], [20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128]], [[1, 222, 248, 255, 216, 213, 128, 128, 128, 128, 128], [168, 175, 246, 252, 235, 205, 255, 255, 128, 128, 128], [47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128]], [[1, 121, 236, 253, 212, 214, 255, 255, 128, 128, 128], [141, 84, 213, 252, 201, 202, 255, 219, 128, 128, 128], [42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128]], [[1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [244, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128]]]], Vi = [[[231, 120, 48, 89, 115, 113, 120, 152, 112], [152, 179, 64, 126, 170, 118, 46, 70, 95], [175, 69, 143, 80, 85, 82, 72, 155, 103], [56, 58, 10, 171, 218, 189, 17, 13, 152], [114, 26, 17, 163, 44, 195, 21, 10, 173], [121, 24, 80, 195, 26, 62, 44, 64, 85], [144, 71, 10, 38, 171, 213, 144, 34, 26], [170, 46, 55, 19, 136, 160, 33, 206, 71], [63, 20, 8, 114, 114, 208, 12, 9, 226], [81, 40, 11, 96, 182, 84, 29, 16, 36]], [[134, 183, 89, 137, 98, 101, 106, 165, 148], [72, 187, 100, 130, 157, 111, 32, 75, 80], [66, 102, 167, 99, 74, 62, 40, 234, 128], [41, 53, 9, 178, 241, 141, 26, 8, 107], [74, 43, 26, 146, 73, 166, 49, 23, 157], [65, 38, 105, 160, 51, 52, 31, 115, 128], [104, 79, 12, 27, 217, 255, 87, 17, 7], [87, 68, 71, 44, 114, 51, 15, 186, 23], [47, 41, 14, 110, 182, 183, 21, 17, 194], [66, 45, 25, 102, 197, 189, 23, 18, 22]], [[88, 88, 147, 150, 42, 46, 45, 196, 205], [43, 97, 183, 117, 85, 38, 35, 179, 61], [39, 53, 200, 87, 26, 21, 43, 232, 171], [56, 34, 51, 104, 114, 102, 29, 93, 77], [39, 28, 85, 171, 58, 165, 90, 98, 64], [34, 22, 116, 206, 23, 34, 43, 166, 73], [107, 54, 32, 26, 51, 1, 81, 43, 31], [68, 25, 106, 22, 64, 171, 36, 225, 114], [34, 19, 21, 102, 132, 188, 16, 76, 124], [62, 18, 78, 95, 85, 57, 50, 48, 51]], [[193, 101, 35, 159, 215, 111, 89, 46, 111], [60, 148, 31, 172, 219, 228, 21, 18, 111], [112, 113, 77, 85, 179, 255, 38, 120, 114], [40, 42, 1, 196, 245, 209, 10, 25, 109], [88, 43, 29, 140, 166, 213, 37, 43, 154], [61, 63, 30, 155, 67, 45, 68, 1, 209], [100, 80, 8, 43, 154, 1, 51, 26, 71], [142, 78, 78, 16, 255, 128, 34, 197, 171], [41, 40, 5, 102, 211, 183, 4, 1, 221], [51, 50, 17, 168, 209, 192, 23, 25, 82]], [[138, 31, 36, 171, 27, 166, 38, 44, 229], [67, 87, 58, 169, 82, 115, 26, 59, 179], [63, 59, 90, 180, 59, 166, 93, 73, 154], [40, 40, 21, 116, 143, 209, 34, 39, 175], [47, 15, 16, 183, 34, 223, 49, 45, 183], [46, 17, 33, 183, 6, 98, 15, 32, 183], [57, 46, 22, 24, 128, 1, 54, 17, 37], [65, 32, 73, 115, 28, 128, 23, 128, 205], [40, 3, 9, 115, 51, 192, 18, 6, 223], [87, 37, 9, 115, 59, 77, 64, 21, 47]], [[104, 55, 44, 218, 9, 54, 53, 130, 226], [64, 90, 70, 205, 40, 41, 23, 26, 57], [54, 57, 112, 184, 5, 41, 38, 166, 213], [30, 34, 26, 133, 152, 116, 10, 32, 134], [39, 19, 53, 221, 26, 114, 32, 73, 255], [31, 9, 65, 234, 2, 15, 1, 118, 73], [75, 32, 12, 51, 192, 255, 160, 43, 51], [88, 31, 35, 67, 102, 85, 55, 186, 85], [56, 21, 23, 111, 59, 205, 45, 37, 192], [55, 38, 70, 124, 73, 102, 1, 34, 98]], [[125, 98, 42, 88, 104, 85, 117, 175, 82], [95, 84, 53, 89, 128, 100, 113, 101, 45], [75, 79, 123, 47, 51, 128, 81, 171, 1], [57, 17, 5, 71, 102, 57, 53, 41, 49], [38, 33, 13, 121, 57, 73, 26, 1, 85], [41, 10, 67, 138, 77, 110, 90, 47, 114], [115, 21, 2, 10, 102, 255, 166, 23, 6], [101, 29, 16, 10, 85, 128, 101, 196, 26], [57, 18, 10, 102, 102, 213, 34, 20, 43], [117, 20, 15, 36, 163, 128, 68, 1, 26]], [[102, 61, 71, 37, 34, 53, 31, 243, 192], [69, 60, 71, 38, 73, 119, 28, 222, 37], [68, 45, 128, 34, 1, 47, 11, 245, 171], [62, 17, 19, 70, 146, 85, 55, 62, 70], [37, 43, 37, 154, 100, 163, 85, 160, 1], [63, 9, 92, 136, 28, 64, 32, 201, 85], [75, 15, 9, 9, 64, 255, 184, 119, 16], [86, 6, 28, 5, 64, 255, 25, 248, 1], [56, 8, 17, 132, 137, 255, 55, 116, 128], [58, 15, 20, 82, 135, 57, 26, 121, 40]], [[164, 50, 31, 137, 154, 133, 25, 35, 218], [51, 103, 44, 131, 131, 123, 31, 6, 158], [86, 40, 64, 135, 148, 224, 45, 183, 128], [22, 26, 17, 131, 240, 154, 14, 1, 209], [45, 16, 21, 91, 64, 222, 7, 1, 197], [56, 21, 39, 155, 60, 138, 23, 102, 213], [83, 12, 13, 54, 192, 255, 68, 47, 28], [85, 26, 85, 85, 128, 128, 32, 146, 171], [18, 11, 7, 63, 144, 171, 4, 4, 246], [35, 27, 10, 146, 174, 171, 12, 26, 128]], [[190, 80, 35, 99, 180, 80, 126, 54, 45], [85, 126, 47, 87, 176, 51, 41, 20, 32], [101, 75, 128, 139, 118, 146, 116, 128, 85], [56, 41, 15, 176, 236, 85, 37, 9, 62], [71, 30, 17, 119, 118, 255, 17, 18, 138], [101, 38, 60, 138, 55, 70, 43, 26, 142], [146, 36, 19, 30, 171, 255, 97, 27, 20], [138, 45, 61, 62, 219, 1, 81, 188, 64], [32, 41, 20, 117, 151, 142, 20, 21, 163], [112, 19, 12, 61, 195, 128, 48, 4, 24]]], Si = [[[[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[176, 246, 255, 255, 255, 255, 255, 255, 255, 255, 255], [223, 241, 252, 255, 255, 255, 255, 255, 255, 255, 255], [249, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 244, 252, 255, 255, 255, 255, 255, 255, 255, 255], [234, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 246, 254, 255, 255, 255, 255, 255, 255, 255, 255], [239, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255], [251, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [251, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 253, 255, 254, 255, 255, 255, 255, 255, 255], [250, 255, 254, 255, 254, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]], [[[217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [225, 252, 241, 253, 255, 255, 254, 255, 255, 255, 255], [234, 250, 241, 250, 253, 255, 253, 254, 255, 255, 255]], [[255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [223, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [238, 253, 254, 254, 255, 255, 255, 255, 255, 255, 255]], [[255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255], [249, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255], [247, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255], [250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]], [[[186, 251, 250, 255, 255, 255, 255, 255, 255, 255, 255], [234, 251, 244, 254, 255, 255, 255, 255, 255, 255, 255], [251, 251, 243, 253, 254, 255, 254, 255, 255, 255, 255]], [[255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [236, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [251, 253, 253, 254, 254, 255, 255, 255, 255, 255, 255]], [[255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]], [[[248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [250, 254, 252, 254, 255, 255, 255, 255, 255, 255, 255], [248, 254, 249, 253, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255], [246, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255], [252, 254, 251, 254, 254, 255, 255, 255, 255, 255, 255]], [[255, 254, 252, 255, 255, 255, 255, 255, 255, 255, 255], [248, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255], [253, 255, 254, 254, 255, 255, 255, 255, 255, 255, 255]], [[255, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255], [245, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255], [253, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255], [252, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255], [249, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 253, 255, 255, 255, 255, 255, 255, 255, 255], [250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]]], uu = [0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 0], gn = [], Zr = [], qn = [], KA = 1, si = 2, UA = [], ns = [];
    mn("UpsampleRgbLinePair", Oa, 3), mn("UpsampleBgrLinePair", mA, 3), mn("UpsampleRgbaLinePair", Wi, 4), mn("UpsampleBgraLinePair", lA, 4), mn("UpsampleArgbLinePair", Pa, 4), mn("UpsampleRgba4444LinePair", Sa, 2), mn("UpsampleRgb565LinePair", rA, 2);
    var hc = F.UpsampleRgbLinePair, cu = F.UpsampleBgrLinePair, gc = F.UpsampleRgbaLinePair, vc = F.UpsampleBgraLinePair, pc = F.UpsampleArgbLinePair, sm = F.UpsampleRgba4444LinePair, j4 = F.UpsampleRgb565LinePair, mc = 16, wc = 1 << mc - 1, du = -227, Bf = 482, Y4 = 6, im = 0, G4 = A(256), z4 = A(256), X4 = A(256), J4 = A(256), Z4 = A(Bf - du), eT = A(Bf - du);
    gs("YuvToRgbRow", Oa, 3), gs("YuvToBgrRow", mA, 3), gs("YuvToRgbaRow", Wi, 4), gs("YuvToBgraRow", lA, 4), gs("YuvToArgbRow", Pa, 4), gs("YuvToRgba4444Row", Sa, 2), gs("YuvToRgb565Row", rA, 2);
    var om = [0, 4, 8, 12, 128, 132, 136, 140, 256, 260, 264, 268, 384, 388, 392, 396], yc = [0, 2, 8], tT = [8, 7, 6, 4, 4, 2, 2, 2, 1, 1, 1, 1], rT = 1;
    this.WebPDecodeRGBA = function(d, g, b, U, V) {
      var re = xe, Ae = new ae(), ue = new er();
      Ae.ba = ue, ue.S = re, ue.width = [ue.width], ue.height = [ue.height];
      var de = ue.width, Be = ue.height, He = new Ar();
      if (He == null || d == null) var st = 2;
      else t(He != null), st = co(d, g, b, He.width, He.height, He.Pd, He.Qd, He.format, null);
      if (st != 0 ? de = 0 : (de != null && (de[0] = He.width[0]), Be != null && (Be[0] = He.height[0]), de = 1), de) {
        ue.width = ue.width[0], ue.height = ue.height[0], U != null && (U[0] = ue.width), V != null && (V[0] = ue.height);
        e: {
          if (U = new ya(), (V = new pe()).data = d, V.w = g, V.ha = b, V.kd = 1, g = [0], t(V != null), ((d = co(V.data, V.w, V.ha, null, null, null, g, null, V)) == 0 || d == 7) && g[0] && (d = 4), (g = d) == 0) {
            if (t(Ae != null), U.data = V.data, U.w = V.w + V.offset, U.ha = V.ha - V.offset, U.put = jt, U.ac = vr, U.bc = br, U.ma = Ae, V.xa) {
              if ((d = En()) == null) {
                Ae = 1;
                break e;
              }
              if ((function(be, We) {
                var Ze = [0], kt = [0], At = [0];
                t: for (; ; ) {
                  if (be == null) return 0;
                  if (We == null) return be.a = 2, 0;
                  if (be.l = We, be.a = 0, N(be.m, We.data, We.w, We.ha), !on(be.m, Ze, kt, At)) {
                    be.a = 3;
                    break t;
                  }
                  if (be.xb = si, We.width = Ze[0], We.height = kt[0], !Vn(Ze[0], kt[0], 1, be, null)) break t;
                  return 1;
                }
                return t(be.a != 0), 0;
              })(d, U)) {
                if (U = (g = PA(U.width, U.height, Ae.Oa, Ae.ba)) == 0) {
                  t: {
                    U = d;
                    r: for (; ; ) {
                      if (U == null) {
                        U = 0;
                        break t;
                      }
                      if (t(U.s.yc != null), t(U.s.Ya != null), t(0 < U.s.Wb), t((b = U.l) != null), t((V = b.ma) != null), U.xb != 0) {
                        if (U.ca = V.ba, U.tb = V.tb, t(U.ca != null), !vs(V.Oa, b, Ne)) {
                          U.a = 2;
                          break r;
                        }
                        if (!Xa(U, b.width) || b.da) break r;
                        if ((b.da || Jt(U.ca.S)) && Wr(), 11 > U.ca.S || (alert("todo:WebPInitConvertARGBToYUV"), U.ca.f.kb.F != null && Wr()), U.Pb && 0 < U.s.ua && U.s.vb.X == null && !ne(U.s.vb, U.s.Wa.Xa)) {
                          U.a = 1;
                          break r;
                        }
                        U.xb = 0;
                      }
                      if (!pa(U, U.V, U.Ba, U.c, U.i, b.o, ka)) break r;
                      V.Dc = U.Ma, U = 1;
                      break t;
                    }
                    t(U.a != 0), U = 0;
                  }
                  U = !U;
                }
                U && (g = d.a);
              } else g = d.a;
            } else {
              if ((d = new Ea()) == null) {
                Ae = 1;
                break e;
              }
              if (d.Fa = V.na, d.P = V.P, d.qc = V.Sa, vA(d, U)) {
                if ((g = PA(U.width, U.height, Ae.Oa, Ae.ba)) == 0) {
                  if (d.Aa = 0, b = Ae.Oa, t((V = d) != null), b != null) {
                    if (0 < (de = 0 > (de = b.Md) ? 0 : 100 < de ? 255 : 255 * de / 100)) {
                      for (Be = He = 0; 4 > Be; ++Be) 12 > (st = V.pb[Be]).lc && (st.ia = de * tT[0 > st.lc ? 0 : st.lc] >> 3), He |= st.ia;
                      He && (alert("todo:VP8InitRandom"), V.ia = 1);
                    }
                    V.Ga = b.Id, 100 < V.Ga ? V.Ga = 100 : 0 > V.Ga && (V.Ga = 0);
                  }
                  (function(be, We) {
                    if (be == null) return 0;
                    if (We == null) return Hr(be, 2, "NULL VP8Io parameter in VP8Decode().");
                    if (!be.cb && !vA(be, We)) return 0;
                    if (t(be.cb), We.ac == null || We.ac(We)) {
                      We.ob && (be.L = 0);
                      var Ze = yc[be.L];
                      if (be.L == 2 ? (be.yb = 0, be.zb = 0) : (be.yb = We.v - Ze >> 4, be.zb = We.j - Ze >> 4, 0 > be.yb && (be.yb = 0), 0 > be.zb && (be.zb = 0)), be.Va = We.o + 15 + Ze >> 4, be.Hb = We.va + 15 + Ze >> 4, be.Hb > be.za && (be.Hb = be.za), be.Va > be.Ub && (be.Va = be.Ub), 0 < be.L) {
                        var kt = be.ed;
                        for (Ze = 0; 4 > Ze; ++Ze) {
                          var At;
                          if (be.Qa.Cb) {
                            var xt = be.Qa.Lb[Ze];
                            be.Qa.Fb || (xt += kt.Tb);
                          } else xt = kt.Tb;
                          for (At = 0; 1 >= At; ++At) {
                            var Ft = be.gd[Ze][At], Vt = xt;
                            if (kt.Pc && (Vt += kt.vd[0], At && (Vt += kt.od[0])), 0 < (Vt = 0 > Vt ? 0 : 63 < Vt ? 63 : Vt)) {
                              var Ht = Vt;
                              0 < kt.wb && (Ht = 4 < kt.wb ? Ht >> 2 : Ht >> 1) > 9 - kt.wb && (Ht = 9 - kt.wb), 1 > Ht && (Ht = 1), Ft.dd = Ht, Ft.tc = 2 * Vt + Ht, Ft.ld = 40 <= Vt ? 2 : 15 <= Vt ? 1 : 0;
                            } else Ft.tc = 0;
                            Ft.La = At;
                          }
                        }
                      }
                      Ze = 0;
                    } else Hr(be, 6, "Frame setup failed"), Ze = be.a;
                    if (Ze = Ze == 0) {
                      if (Ze) {
                        be.$c = 0, 0 < be.Aa || (be.Ic = rT);
                        t: {
                          Ze = be.Ic, kt = 4 * (Ht = be.za);
                          var Cr = 32 * Ht, pr = Ht + 1, en = 0 < be.L ? Ht * (0 < be.Aa ? 2 : 1) : 0, yr = (be.Aa == 2 ? 2 : 1) * Ht;
                          if ((Ft = kt + 832 + (At = 3 * (16 * Ze + yc[be.L]) / 2 * Cr) + (xt = be.Fa != null && 0 < be.Fa.length ? be.Kc.c * be.Kc.i : 0)) != Ft) Ze = 0;
                          else {
                            if (Ft > be.Vb) {
                              if (be.Vb = 0, be.Ec = A(Ft), be.Fc = 0, be.Ec == null) {
                                Ze = Hr(be, 1, "no memory during frame initialization.");
                                break t;
                              }
                              be.Vb = Ft;
                            }
                            Ft = be.Ec, Vt = be.Fc, be.Ac = Ft, be.Bc = Vt, Vt += kt, be.Gd = i(Cr, wa), be.Hd = 0, be.rb = i(pr + 1, xa), be.sb = 1, be.wa = en ? i(en, ia) : null, be.Y = 0, be.D.Nb = 0, be.D.wa = be.wa, be.D.Y = be.Y, 0 < be.Aa && (be.D.Y += Ht), t(!0), be.oc = Ft, be.pc = Vt, Vt += 832, be.ya = i(yr, Zn), be.aa = 0, be.D.ya = be.ya, be.D.aa = be.aa, be.Aa == 2 && (be.D.aa += Ht), be.R = 16 * Ht, be.B = 8 * Ht, Ht = (Cr = yc[be.L]) * be.R, Cr = Cr / 2 * be.B, be.sa = Ft, be.ta = Vt + Ht, be.qa = be.sa, be.ra = be.ta + 16 * Ze * be.R + Cr, be.Ha = be.qa, be.Ia = be.ra + 8 * Ze * be.B + Cr, be.$c = 0, Vt += At, be.mb = xt ? Ft : null, be.nb = xt ? Vt : null, t(Vt + xt <= be.Fc + be.Vb), DA(be), a(be.Ac, be.Bc, 0, kt), Ze = 1;
                          }
                        }
                        if (Ze) {
                          if (We.ka = 0, We.y = be.sa, We.O = be.ta, We.f = be.qa, We.N = be.ra, We.ea = be.Ha, We.Vd = be.Ia, We.fa = be.R, We.Rc = be.B, We.F = null, We.J = 0, !lu) {
                            for (Ze = -255; 255 >= Ze; ++Ze) cc[255 + Ze] = 0 > Ze ? -Ze : Ze;
                            for (Ze = -1020; 1020 >= Ze; ++Ze) dc[1020 + Ze] = -128 > Ze ? -128 : 127 < Ze ? 127 : Ze;
                            for (Ze = -112; 112 >= Ze; ++Ze) fc[112 + Ze] = -16 > Ze ? -16 : 15 < Ze ? 15 : Ze;
                            for (Ze = -255; 510 >= Ze; ++Ze) ou[255 + Ze] = 0 > Ze ? 0 : 255 < Ze ? 255 : Ze;
                            lu = 1;
                          }
                          ri = et, ni = OA, ai = Ha, BA = Wt, Ss = fe, Es = fs, Qn = P, Wn = he, da = lt, La = v, Ai = Fe, Wo = tt, go = L, Ti = j, au = sr, Au = Er, su = nn, Ko = Pn, Zr[0] = bi, Zr[1] = Yt, Zr[2] = Pi, Zr[3] = Xs, Zr[4] = Os, Zr[5] = Re, Zr[6] = ye, Zr[7] = at, Zr[8] = Tt, Zr[9] = $e, gn[0] = Hn, gn[1] = gr, gn[2] = rn, gn[3] = Gn, gn[4] = Ln, gn[5] = On, gn[6] = hs, qn[0] = Ut, qn[1] = zt, qn[2] = Lt, qn[3] = ut, qn[4] = Zt, qn[5] = _t, qn[6] = fr, Ze = 1;
                        } else Ze = 0;
                      }
                      Ze && (Ze = (function(yn, uA) {
                        for (yn.M = 0; yn.M < yn.Va; ++yn.M) {
                          var tn, Br = yn.Jc[yn.M & yn.Xb], rr = yn.m, Wa = yn;
                          for (tn = 0; tn < Wa.za; ++tn) {
                            var Yr = rr, Cn = Wa, la = Cn.Ac, LA = Cn.Bc + 4 * tn, as = Cn.zc, Ia = Cn.ya[Cn.aa + tn];
                            if (Cn.Qa.Bb ? Ia.$b = _e(Yr, Cn.Pa.jb[0]) ? 2 + _e(Yr, Cn.Pa.jb[2]) : _e(Yr, Cn.Pa.jb[1]) : Ia.$b = 0, Cn.kc && (Ia.Ad = _e(Yr, Cn.Bd)), Ia.Za = !_e(Yr, 145) + 0, Ia.Za) {
                              var $A = Ia.Ob, As = 0;
                              for (Cn = 0; 4 > Cn; ++Cn) {
                                var cA, Sn = as[0 + Cn];
                                for (cA = 0; 4 > cA; ++cA) {
                                  Sn = Vi[la[LA + cA]][Sn];
                                  for (var Kn = Di[_e(Yr, Sn[0])]; 0 < Kn; ) Kn = Di[2 * Kn + _e(Yr, Sn[Kn])];
                                  Sn = -Kn, la[LA + cA] = Sn;
                                }
                                r($A, As, la, LA, 4), As += 4, as[0 + Cn] = Sn;
                              }
                            } else Sn = _e(Yr, 156) ? _e(Yr, 128) ? 1 : 3 : _e(Yr, 163) ? 2 : 0, Ia.Ob[0] = Sn, a(la, LA, Sn, 4), a(as, 0, Sn, 4);
                            Ia.Dd = _e(Yr, 142) ? _e(Yr, 114) ? _e(Yr, 183) ? 1 : 3 : 2 : 0;
                          }
                          if (Wa.m.Ka) return Hr(yn, 7, "Premature end-of-partition0 encountered.");
                          for (; yn.ja < yn.za; ++yn.ja) {
                            if (Wa = Br, Yr = (rr = yn).rb[rr.sb - 1], la = rr.rb[rr.sb + rr.ja], tn = rr.ya[rr.aa + rr.ja], LA = rr.kc ? tn.Ad : 0) Yr.la = la.la = 0, tn.Za || (Yr.Na = la.Na = 0), tn.Hc = 0, tn.Gc = 0, tn.ia = 0;
                            else {
                              var Qa, $n;
                              if (Yr = la, la = Wa, LA = rr.Pa.Xc, as = rr.ya[rr.aa + rr.ja], Ia = rr.pb[as.$b], Cn = as.ad, $A = 0, As = rr.rb[rr.sb - 1], Sn = cA = 0, a(Cn, $A, 0, 384), as.Za) var IA = 0, ii = LA[3];
                              else {
                                Kn = A(16);
                                var Ka = Yr.Na + As.Na;
                                if (Ka = WA(la, LA[1], Ka, Ia.Eb, 0, Kn, 0), Yr.Na = As.Na = (0 < Ka) + 0, 1 < Ka) ri(Kn, 0, Cn, $A);
                                else {
                                  var ws = Kn[0] + 3 >> 3;
                                  for (Kn = 0; 256 > Kn; Kn += 16) Cn[$A + Kn] = ws;
                                }
                                IA = 1, ii = LA[0];
                              }
                              var zn = 15 & Yr.la, dA = 15 & As.la;
                              for (Kn = 0; 4 > Kn; ++Kn) {
                                var Fs = 1 & dA;
                                for (ws = $n = 0; 4 > ws; ++ws) zn = zn >> 1 | (Fs = (Ka = WA(la, ii, Ka = Fs + (1 & zn), Ia.Sc, IA, Cn, $A)) > IA) << 7, $n = $n << 2 | (3 < Ka ? 3 : 1 < Ka ? 2 : Cn[$A + 0] != 0), $A += 16;
                                zn >>= 4, dA = dA >> 1 | Fs << 7, cA = (cA << 8 | $n) >>> 0;
                              }
                              for (ii = zn, IA = dA >> 4, Qa = 0; 4 > Qa; Qa += 2) {
                                for ($n = 0, zn = Yr.la >> 4 + Qa, dA = As.la >> 4 + Qa, Kn = 0; 2 > Kn; ++Kn) {
                                  for (Fs = 1 & dA, ws = 0; 2 > ws; ++ws) Ka = Fs + (1 & zn), zn = zn >> 1 | (Fs = 0 < (Ka = WA(la, LA[2], Ka, Ia.Qc, 0, Cn, $A))) << 3, $n = $n << 2 | (3 < Ka ? 3 : 1 < Ka ? 2 : Cn[$A + 0] != 0), $A += 16;
                                  zn >>= 2, dA = dA >> 1 | Fs << 5;
                                }
                                Sn |= $n << 4 * Qa, ii |= zn << 4 << Qa, IA |= (240 & dA) << Qa;
                              }
                              Yr.la = ii, As.la = IA, as.Hc = cA, as.Gc = Sn, as.ia = 43690 & Sn ? 0 : Ia.ia, LA = !(cA | Sn);
                            }
                            if (0 < rr.L && (rr.wa[rr.Y + rr.ja] = rr.gd[tn.$b][tn.Za], rr.wa[rr.Y + rr.ja].La |= !LA), Wa.Ka) return Hr(yn, 7, "Premature end-of-file encountered.");
                          }
                          if (DA(yn), rr = uA, Wa = 1, tn = (Br = yn).D, Yr = 0 < Br.L && Br.M >= Br.zb && Br.M <= Br.Va, Br.Aa == 0) t: {
                            if (tn.M = Br.M, tn.uc = Yr, Ci(Br, tn), Wa = 1, tn = ($n = Br.D).Nb, Yr = (Sn = yc[Br.L]) * Br.R, la = Sn / 2 * Br.B, Kn = 16 * tn * Br.R, ws = 8 * tn * Br.B, LA = Br.sa, as = Br.ta - Yr + Kn, Ia = Br.qa, Cn = Br.ra - la + ws, $A = Br.Ha, As = Br.Ia - la + ws, dA = (zn = $n.M) == 0, cA = zn >= Br.Va - 1, Br.Aa == 2 && Ci(Br, $n), $n.uc) for (Fs = (Ka = Br).D.M, t(Ka.D.uc), $n = Ka.yb; $n < Ka.Hb; ++$n) {
                              IA = $n, ii = Fs;
                              var ss = (Us = (QA = Ka).D).Nb;
                              Qa = QA.R;
                              var Us = Us.wa[Us.Y + IA], Ls = QA.sa, ys = QA.ta + 16 * ss * Qa + 16 * IA, Is = Us.dd, ra = Us.tc;
                              if (ra != 0) if (t(3 <= ra), QA.L == 1) 0 < IA && Au(Ls, ys, Qa, ra + 4), Us.La && Ko(Ls, ys, Qa, ra), 0 < ii && au(Ls, ys, Qa, ra + 4), Us.La && su(Ls, ys, Qa, ra);
                              else {
                                var Qs = QA.B, oi = QA.qa, Vo = QA.ra + 8 * ss * Qs + 8 * IA, qi = QA.Ha, QA = QA.Ia + 8 * ss * Qs + 8 * IA;
                                ss = Us.ld, 0 < IA && (Wn(Ls, ys, Qa, ra + 4, Is, ss), La(oi, Vo, qi, QA, Qs, ra + 4, Is, ss)), Us.La && (Wo(Ls, ys, Qa, ra, Is, ss), Ti(oi, Vo, qi, QA, Qs, ra, Is, ss)), 0 < ii && (Qn(Ls, ys, Qa, ra + 4, Is, ss), da(oi, Vo, qi, QA, Qs, ra + 4, Is, ss)), Us.La && (Ai(Ls, ys, Qa, ra, Is, ss), go(oi, Vo, qi, QA, Qs, ra, Is, ss));
                              }
                            }
                            if (Br.ia && alert("todo:DitherRow"), rr.put != null) {
                              if ($n = 16 * zn, zn = 16 * (zn + 1), dA ? (rr.y = Br.sa, rr.O = Br.ta + Kn, rr.f = Br.qa, rr.N = Br.ra + ws, rr.ea = Br.Ha, rr.W = Br.Ia + ws) : ($n -= Sn, rr.y = LA, rr.O = as, rr.f = Ia, rr.N = Cn, rr.ea = $A, rr.W = As), cA || (zn -= Sn), zn > rr.o && (zn = rr.o), rr.F = null, rr.J = null, Br.Fa != null && 0 < Br.Fa.length && $n < zn && (rr.J = qr(Br, rr, $n, zn - $n), rr.F = Br.mb, rr.F == null && rr.F.length == 0)) {
                                Wa = Hr(Br, 3, "Could not decode alpha data.");
                                break t;
                              }
                              $n < rr.j && (Sn = rr.j - $n, $n = rr.j, t(!(1 & Sn)), rr.O += Br.R * Sn, rr.N += Br.B * (Sn >> 1), rr.W += Br.B * (Sn >> 1), rr.F != null && (rr.J += rr.width * Sn)), $n < zn && (rr.O += rr.v, rr.N += rr.v >> 1, rr.W += rr.v >> 1, rr.F != null && (rr.J += rr.v), rr.ka = $n - rr.j, rr.U = rr.va - rr.v, rr.T = zn - $n, Wa = rr.put(rr));
                            }
                            tn + 1 != Br.Ic || cA || (r(Br.sa, Br.ta - Yr, LA, as + 16 * Br.R, Yr), r(Br.qa, Br.ra - la, Ia, Cn + 8 * Br.B, la), r(Br.Ha, Br.Ia - la, $A, As + 8 * Br.B, la));
                          }
                          if (!Wa) return Hr(yn, 6, "Output aborted.");
                        }
                        return 1;
                      })(be, We)), We.bc != null && We.bc(We), Ze &= 1;
                    }
                    return Ze ? (be.cb = 0, Ze) : 0;
                  })(d, U) || (g = d.a);
                }
              } else g = d.a;
            }
            g == 0 && Ae.Oa != null && Ae.Oa.fd && (g = EA(Ae.ba));
          }
          Ae = g;
        }
        re = Ae != 0 ? null : 11 > re ? ue.f.RGBA.eb : ue.f.kb.y;
      } else re = null;
      return re;
    };
    var lm = [3, 4, 3, 4, 4, 2, 2, 4, 4, 4, 2, 1, 1];
  };
  function l(F, Y) {
    for (var T = "", E = 0; E < 4; E++) T += String.fromCharCode(F[Y++]);
    return T;
  }
  function u(F, Y) {
    return F[Y + 0] | F[Y + 1] << 8;
  }
  function f(F, Y) {
    return (F[Y + 0] | F[Y + 1] << 8 | F[Y + 2] << 16) >>> 0;
  }
  function h(F, Y) {
    return (F[Y + 0] | F[Y + 1] << 8 | F[Y + 2] << 16 | F[Y + 3] << 24) >>> 0;
  }
  new o();
  var c = [0], p = [0], w = [], y = new o(), m = n, k = (function(F, Y) {
    var T = {}, E = 0, Q = !1, x = 0, oe = 0;
    if (T.frames = [], !/** @license
       * Copyright (c) 2017 Dominik Homberger
      Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
      The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
      https://webpjs.appspot.com
      WebPRiffParser dominikhlbg@gmail.com
      */
    (function(C, H) {
      for (var M = 0; M < 4; M++) if (C[H + M] != "RIFF".charCodeAt(M)) return !0;
      return !1;
    })(F, Y)) {
      for (h(F, Y += 4), Y += 8; Y < F.length; ) {
        var J = l(F, Y), S = h(F, Y += 4);
        Y += 4;
        var I = S + (1 & S);
        switch (J) {
          case "VP8 ":
          case "VP8L":
            T.frames[E] === void 0 && (T.frames[E] = {}), (Z = T.frames[E]).src_off = Q ? oe : Y - 8, Z.src_size = x + S + 8, E++, Q && (Q = !1, x = 0, oe = 0);
            break;
          case "VP8X":
            (Z = T.header = {}).feature_flags = F[Y];
            var N = Y + 4;
            Z.canvas_width = 1 + f(F, N), N += 3, Z.canvas_height = 1 + f(F, N), N += 3;
            break;
          case "ALPH":
            Q = !0, x = I + 8, oe = Y - 8;
            break;
          case "ANIM":
            (Z = T.header).bgcolor = h(F, Y), N = Y + 4, Z.loop_count = u(F, N), N += 2;
            break;
          case "ANMF":
            var se, Z;
            (Z = T.frames[E] = {}).offset_x = 2 * f(F, Y), Y += 3, Z.offset_y = 2 * f(F, Y), Y += 3, Z.width = 1 + f(F, Y), Y += 3, Z.height = 1 + f(F, Y), Y += 3, Z.duration = f(F, Y), Y += 3, se = F[Y++], Z.dispose = 1 & se, Z.blend = se >> 1 & 1;
        }
        J != "ANMF" && (Y += I);
      }
      return T;
    }
  })(m, 0);
  k.response = m, k.rgbaoutput = !0, k.dataurl = !1;
  var D = k.header ? k.header : null, B = k.frames ? k.frames : null;
  if (D) {
    D.loop_counter = D.loop_count, c = [D.canvas_height], p = [D.canvas_width];
    for (var O = 0; O < B.length && B[O].blend != 0; O++) ;
  }
  var q = B[0], G = y.WebPDecodeRGBA(m, q.src_off, q.src_size, p, c);
  q.rgba = G, q.imgwidth = p[0], q.imgheight = c[0];
  for (var W = 0; W < p[0] * c[0] * 4; W++) w[W] = G[W];
  return this.width = p, this.height = c, this.data = w, this;
}
/** ====================================================================
 * @license
 * jsPDF XMP metadata plugin
 * Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 * ====================================================================
 */
function X6() {
  var n, t = this.internal.__metadata__.metadata, e = unescape(encodeURIComponent(t));
  n = this.internal.__metadata__.rawXml ? e : '<x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="' + this.internal.__metadata__.namespaceUri + '"><jspdf:metadata>' + e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;") + "</jspdf:metadata></rdf:Description></rdf:RDF></x:xmpmeta>", this.internal.__metadata__.metadataObjectNumber = this.internal.newObject(), this.internal.write("<< /Type /Metadata /Subtype /XML /Length " + n.length + " >>"), this.internal.write("stream"), this.internal.write(n), this.internal.write("endstream"), this.internal.write("endobj");
}
function J6() {
  this.internal.__metadata__.metadataObjectNumber && this.internal.write("/Metadata " + this.internal.__metadata__.metadataObjectNumber + " 0 R");
}
(function(n) {
  var t, e, r, a, A, i, s, o, l, u = function(C) {
    return C = C || {}, this.isStrokeTransparent = C.isStrokeTransparent || !1, this.strokeOpacity = C.strokeOpacity || 1, this.strokeStyle = C.strokeStyle || "#000000", this.fillStyle = C.fillStyle || "#000000", this.isFillTransparent = C.isFillTransparent || !1, this.fillOpacity = C.fillOpacity || 1, this.font = C.font || "10px sans-serif", this.textBaseline = C.textBaseline || "alphabetic", this.textAlign = C.textAlign || "left", this.lineWidth = C.lineWidth || 1, this.lineJoin = C.lineJoin || "miter", this.lineCap = C.lineCap || "butt", this.path = C.path || [], this.transform = C.transform !== void 0 ? C.transform.clone() : new o(), this.globalCompositeOperation = C.globalCompositeOperation || "normal", this.globalAlpha = C.globalAlpha || 1, this.clip_path = C.clip_path || [], this.currentPoint = C.currentPoint || new i(), this.miterLimit = C.miterLimit || 10, this.lastPoint = C.lastPoint || new i(), this.lineDashOffset = C.lineDashOffset || 0, this.lineDash = C.lineDash || [], this.margin = C.margin || [0, 0, 0, 0], this.prevPageLastElemOffset = C.prevPageLastElemOffset || 0, this.ignoreClearRect = typeof C.ignoreClearRect != "boolean" || C.ignoreClearRect, this;
  };
  n.events.push(["initialized", function() {
    this.context2d = new f(this), t = this.internal.f2, e = this.internal.getCoordinateString, r = this.internal.getVerticalCoordinateString, a = this.internal.getHorizontalCoordinate, A = this.internal.getVerticalCoordinate, i = this.internal.Point, s = this.internal.Rectangle, o = this.internal.Matrix, l = new u();
  }]);
  var f = function(C) {
    Object.defineProperty(this, "canvas", { get: function() {
      return { parentNode: !1, style: !1 };
    } });
    var H = C;
    Object.defineProperty(this, "pdf", { get: function() {
      return H;
    } });
    var M = !1;
    Object.defineProperty(this, "pageWrapXEnabled", { get: function() {
      return M;
    }, set: function(ne) {
      M = !!ne;
    } });
    var te = !1;
    Object.defineProperty(this, "pageWrapYEnabled", { get: function() {
      return te;
    }, set: function(ne) {
      te = !!ne;
    } });
    var ie = 0;
    Object.defineProperty(this, "posX", { get: function() {
      return ie;
    }, set: function(ne) {
      isNaN(ne) || (ie = ne);
    } });
    var we = 0;
    Object.defineProperty(this, "posY", { get: function() {
      return we;
    }, set: function(ne) {
      isNaN(ne) || (we = ne);
    } }), Object.defineProperty(this, "margin", { get: function() {
      return l.margin;
    }, set: function(ne) {
      var gt;
      typeof ne == "number" ? gt = [ne, ne, ne, ne] : ((gt = new Array(4))[0] = ne[0], gt[1] = ne.length >= 2 ? ne[1] : gt[0], gt[2] = ne.length >= 3 ? ne[2] : gt[0], gt[3] = ne.length >= 4 ? ne[3] : gt[1]), l.margin = gt;
    } });
    var ve = !1;
    Object.defineProperty(this, "autoPaging", { get: function() {
      return ve;
    }, set: function(ne) {
      ve = ne;
    } });
    var le = 0;
    Object.defineProperty(this, "lastBreak", { get: function() {
      return le;
    }, set: function(ne) {
      le = ne;
    } });
    var _e = [];
    Object.defineProperty(this, "pageBreaks", { get: function() {
      return _e;
    }, set: function(ne) {
      _e = ne;
    } }), Object.defineProperty(this, "ctx", { get: function() {
      return l;
    }, set: function(ne) {
      ne instanceof u && (l = ne);
    } }), Object.defineProperty(this, "path", { get: function() {
      return l.path;
    }, set: function(ne) {
      l.path = ne;
    } });
    var De = [];
    Object.defineProperty(this, "ctxStack", { get: function() {
      return De;
    }, set: function(ne) {
      De = ne;
    } }), Object.defineProperty(this, "fillStyle", { get: function() {
      return this.ctx.fillStyle;
    }, set: function(ne) {
      var gt;
      gt = h(ne), this.ctx.fillStyle = gt.style, this.ctx.isFillTransparent = gt.a === 0, this.ctx.fillOpacity = gt.a, this.pdf.setFillColor(gt.r, gt.g, gt.b, { a: gt.a }), this.pdf.setTextColor(gt.r, gt.g, gt.b, { a: gt.a });
    } }), Object.defineProperty(this, "strokeStyle", { get: function() {
      return this.ctx.strokeStyle;
    }, set: function(ne) {
      var gt = h(ne);
      this.ctx.strokeStyle = gt.style, this.ctx.isStrokeTransparent = gt.a === 0, this.ctx.strokeOpacity = gt.a, gt.a === 0 ? this.pdf.setDrawColor(255, 255, 255) : (gt.a, this.pdf.setDrawColor(gt.r, gt.g, gt.b));
    } }), Object.defineProperty(this, "lineCap", { get: function() {
      return this.ctx.lineCap;
    }, set: function(ne) {
      ["butt", "round", "square"].indexOf(ne) !== -1 && (this.ctx.lineCap = ne, this.pdf.setLineCap(ne));
    } }), Object.defineProperty(this, "lineWidth", { get: function() {
      return this.ctx.lineWidth;
    }, set: function(ne) {
      isNaN(ne) || (this.ctx.lineWidth = ne, this.pdf.setLineWidth(ne));
    } }), Object.defineProperty(this, "lineJoin", { get: function() {
      return this.ctx.lineJoin;
    }, set: function(ne) {
      ["bevel", "round", "miter"].indexOf(ne) !== -1 && (this.ctx.lineJoin = ne, this.pdf.setLineJoin(ne));
    } }), Object.defineProperty(this, "miterLimit", { get: function() {
      return this.ctx.miterLimit;
    }, set: function(ne) {
      isNaN(ne) || (this.ctx.miterLimit = ne, this.pdf.setMiterLimit(ne));
    } }), Object.defineProperty(this, "textBaseline", { get: function() {
      return this.ctx.textBaseline;
    }, set: function(ne) {
      this.ctx.textBaseline = ne;
    } }), Object.defineProperty(this, "textAlign", { get: function() {
      return this.ctx.textAlign;
    }, set: function(ne) {
      ["right", "end", "center", "left", "start"].indexOf(ne) !== -1 && (this.ctx.textAlign = ne);
    } });
    var ze = null, nt = null, Qe = null;
    Object.defineProperty(this, "fontFaces", { get: function() {
      return Qe;
    }, set: function(ne) {
      ze = null, nt = null, Qe = ne;
    } }), Object.defineProperty(this, "font", { get: function() {
      return this.ctx.font;
    }, set: function(ne) {
      var gt;
      if (this.ctx.font = ne, (gt = /^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z0-9]+?)\s*$/i.exec(ne)) !== null) {
        var je = gt[1];
        gt[2];
        var ot = gt[3], Ie = gt[4];
        gt[5];
        var It = gt[6], dt = /^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Ie)[2];
        Ie = Math.floor(dt === "px" ? parseFloat(Ie) * this.pdf.internal.scaleFactor : dt === "em" ? parseFloat(Ie) * this.pdf.getFontSize() : parseFloat(Ie) * this.pdf.internal.scaleFactor), this.pdf.setFontSize(Ie);
        var Dt = (function(Xe) {
          var Ye, Kt, it = [], qt = Xe.trim();
          if (qt === "") return zf;
          if (qt in z1) return [z1[qt]];
          for (; qt !== ""; ) {
            switch (Kt = null, Ye = (qt = J1(qt)).charAt(0)) {
              case '"':
              case "'":
                Kt = V6(qt.substring(1), Ye);
                break;
              default:
                Kt = q6(qt);
            }
            if (Kt === null || (it.push(Kt[0]), (qt = J1(Kt[1])) !== "" && qt.charAt(0) !== ",")) return zf;
            qt = qt.replace(/^,/, "");
          }
          return it;
        })(It);
        if (this.fontFaces) {
          var Ct = (function(Xe, Ye) {
            var Kt = Xe.getFontList(), it = JSON.stringify(Kt);
            if (ze === null || nt !== it) {
              var qt = (function(hr) {
                var Nt = [];
                return Object.keys(hr).forEach(function(xr) {
                  hr[xr].forEach(function(Jt) {
                    var lr = null;
                    switch (Jt) {
                      case "bold":
                        lr = { family: xr, weight: "bold" };
                        break;
                      case "italic":
                        lr = { family: xr, style: "italic" };
                        break;
                      case "bolditalic":
                        lr = { family: xr, weight: "bold", style: "italic" };
                        break;
                      case "":
                      case "normal":
                        lr = { family: xr };
                    }
                    lr !== null && (lr.ref = { name: xr, style: Jt }, Nt.push(lr));
                  });
                }), Nt;
              })(Kt);
              ze = (function(hr) {
                for (var Nt = {}, xr = 0; xr < hr.length; ++xr) {
                  var Jt = Gf(hr[xr]), lr = Jt.family, Fr = Jt.stretch, er = Jt.style, Ar = Jt.weight;
                  Nt[lr] = Nt[lr] || {}, Nt[lr][Fr] = Nt[lr][Fr] || {}, Nt[lr][Fr][er] = Nt[lr][Fr][er] || {}, Nt[lr][Fr][er][Ar] = Jt;
                }
                return Nt;
              })(qt.concat(Ye)), nt = it;
            }
            return ze;
          })(this.pdf, this.fontFaces), Ve = Dt.map(function(Xe) {
            return { family: Xe, stretch: "normal", weight: ot, style: je };
          }), ht = (function(Xe, Ye, Kt) {
            for (var it = (Kt = Kt || {}).defaultFontFamily || "times", qt = Object.assign({}, $6, Kt.genericFontFamilies || {}), hr = null, Nt = null, xr = 0; xr < Ye.length; ++xr) if (qt[(hr = Gf(Ye[xr])).family] && (hr.family = qt[hr.family]), Xe.hasOwnProperty(hr.family)) {
              Nt = Xe[hr.family];
              break;
            }
            if (!(Nt = Nt || Xe[it])) throw new Error("Could not find a font-family for the rule '" + X1(hr) + "' and default family '" + it + "'.");
            if (Nt = (function(Jt, lr) {
              if (lr[Jt]) return lr[Jt];
              var Fr = Tp[Jt], er = Fr <= Tp.normal ? -1 : 1, Ar = G1(lr, dC, Fr, er);
              if (!Ar) throw new Error("Could not find a matching font-stretch value for " + Jt);
              return Ar;
            })(hr.stretch, Nt), Nt = (function(Jt, lr) {
              if (lr[Jt]) return lr[Jt];
              for (var Fr = cC[Jt], er = 0; er < Fr.length; ++er) if (lr[Fr[er]]) return lr[Fr[er]];
              throw new Error("Could not find a matching font-style for " + Jt);
            })(hr.style, Nt), !(Nt = (function(Jt, lr) {
              if (lr[Jt]) return lr[Jt];
              if (Jt === 400 && lr[500]) return lr[500];
              if (Jt === 500 && lr[400]) return lr[400];
              var Fr = K6[Jt], er = G1(lr, fC, Fr, Jt < 400 ? -1 : 1);
              if (!er) throw new Error("Could not find a matching font-weight for value " + Jt);
              return er;
            })(hr.weight, Nt))) throw new Error("Failed to resolve a font for the rule '" + X1(hr) + "'.");
            return Nt;
          })(Ct, Ve);
          this.pdf.setFont(ht.ref.name, ht.ref.style);
        } else {
          var K = "";
          (ot === "bold" || parseInt(ot, 10) >= 700 || je === "bold") && (K = "bold"), je === "italic" && (K += "italic"), K.length === 0 && (K = "normal");
          for (var X = "", ke = { arial: "Helvetica", Arial: "Helvetica", verdana: "Helvetica", Verdana: "Helvetica", helvetica: "Helvetica", Helvetica: "Helvetica", "sans-serif": "Helvetica", fixed: "Courier", monospace: "Courier", terminal: "Courier", cursive: "Times", fantasy: "Times", serif: "Times" }, Je = 0; Je < Dt.length; Je++) {
            if (this.pdf.internal.getFont(Dt[Je], K, { noFallback: !0, disableWarning: !0 }) !== void 0) {
              X = Dt[Je];
              break;
            }
            if (K === "bolditalic" && this.pdf.internal.getFont(Dt[Je], "bold", { noFallback: !0, disableWarning: !0 }) !== void 0) X = Dt[Je], K = "bold";
            else if (this.pdf.internal.getFont(Dt[Je], "normal", { noFallback: !0, disableWarning: !0 }) !== void 0) {
              X = Dt[Je], K = "normal";
              break;
            }
          }
          if (X === "") {
            for (var pt = 0; pt < Dt.length; pt++) if (ke[Dt[pt]]) {
              X = ke[Dt[pt]];
              break;
            }
          }
          X = X === "" ? "Times" : X, this.pdf.setFont(X, K);
        }
      }
    } }), Object.defineProperty(this, "globalCompositeOperation", { get: function() {
      return this.ctx.globalCompositeOperation;
    }, set: function(ne) {
      this.ctx.globalCompositeOperation = ne;
    } }), Object.defineProperty(this, "globalAlpha", { get: function() {
      return this.ctx.globalAlpha;
    }, set: function(ne) {
      this.ctx.globalAlpha = ne;
    } }), Object.defineProperty(this, "lineDashOffset", { get: function() {
      return this.ctx.lineDashOffset;
    }, set: function(ne) {
      this.ctx.lineDashOffset = ne, Z.call(this);
    } }), Object.defineProperty(this, "lineDash", { get: function() {
      return this.ctx.lineDash;
    }, set: function(ne) {
      this.ctx.lineDash = ne, Z.call(this);
    } }), Object.defineProperty(this, "ignoreClearRect", { get: function() {
      return this.ctx.ignoreClearRect;
    }, set: function(ne) {
      this.ctx.ignoreClearRect = !!ne;
    } });
  };
  f.prototype.setLineDash = function(C) {
    this.lineDash = C;
  }, f.prototype.getLineDash = function() {
    return this.lineDash.length % 2 ? this.lineDash.concat(this.lineDash) : this.lineDash.slice();
  }, f.prototype.fill = function() {
    B.call(this, "fill", !1);
  }, f.prototype.stroke = function() {
    B.call(this, "stroke", !1);
  }, f.prototype.beginPath = function() {
    this.path = [{ type: "begin" }];
  }, f.prototype.moveTo = function(C, H) {
    if (isNaN(C) || isNaN(H)) throw Xn.error("jsPDF.context2d.moveTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.moveTo");
    var M = this.ctx.transform.applyToPoint(new i(C, H));
    this.path.push({ type: "mt", x: M.x, y: M.y }), this.ctx.lastPoint = new i(C, H);
  }, f.prototype.closePath = function() {
    var C = new i(0, 0), H = 0;
    for (H = this.path.length - 1; H !== -1; H--) if (this.path[H].type === "begin" && In(this.path[H + 1]) === "object" && typeof this.path[H + 1].x == "number") {
      C = new i(this.path[H + 1].x, this.path[H + 1].y);
      break;
    }
    this.path.push({ type: "close" }), this.ctx.lastPoint = new i(C.x, C.y);
  }, f.prototype.lineTo = function(C, H) {
    if (isNaN(C) || isNaN(H)) throw Xn.error("jsPDF.context2d.lineTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.lineTo");
    var M = this.ctx.transform.applyToPoint(new i(C, H));
    this.path.push({ type: "lt", x: M.x, y: M.y }), this.ctx.lastPoint = new i(M.x, M.y);
  }, f.prototype.clip = function() {
    this.ctx.clip_path = JSON.parse(JSON.stringify(this.path)), B.call(this, null, !0);
  }, f.prototype.quadraticCurveTo = function(C, H, M, te) {
    if (isNaN(M) || isNaN(te) || isNaN(C) || isNaN(H)) throw Xn.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");
    var ie = this.ctx.transform.applyToPoint(new i(M, te)), we = this.ctx.transform.applyToPoint(new i(C, H));
    this.path.push({ type: "qct", x1: we.x, y1: we.y, x: ie.x, y: ie.y }), this.ctx.lastPoint = new i(ie.x, ie.y);
  }, f.prototype.bezierCurveTo = function(C, H, M, te, ie, we) {
    if (isNaN(ie) || isNaN(we) || isNaN(C) || isNaN(H) || isNaN(M) || isNaN(te)) throw Xn.error("jsPDF.context2d.bezierCurveTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");
    var ve = this.ctx.transform.applyToPoint(new i(ie, we)), le = this.ctx.transform.applyToPoint(new i(C, H)), _e = this.ctx.transform.applyToPoint(new i(M, te));
    this.path.push({ type: "bct", x1: le.x, y1: le.y, x2: _e.x, y2: _e.y, x: ve.x, y: ve.y }), this.ctx.lastPoint = new i(ve.x, ve.y);
  }, f.prototype.arc = function(C, H, M, te, ie, we) {
    if (isNaN(C) || isNaN(H) || isNaN(M) || isNaN(te) || isNaN(ie)) throw Xn.error("jsPDF.context2d.arc: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.arc");
    if (we = !!we, !this.ctx.transform.isIdentity) {
      var ve = this.ctx.transform.applyToPoint(new i(C, H));
      C = ve.x, H = ve.y;
      var le = this.ctx.transform.applyToPoint(new i(0, M)), _e = this.ctx.transform.applyToPoint(new i(0, 0));
      M = Math.sqrt(Math.pow(le.x - _e.x, 2) + Math.pow(le.y - _e.y, 2));
    }
    Math.abs(ie - te) >= 2 * Math.PI && (te = 0, ie = 2 * Math.PI), this.path.push({ type: "arc", x: C, y: H, radius: M, startAngle: te, endAngle: ie, counterclockwise: we });
  }, f.prototype.arcTo = function(C, H, M, te, ie) {
    throw new Error("arcTo not implemented.");
  }, f.prototype.rect = function(C, H, M, te) {
    if (isNaN(C) || isNaN(H) || isNaN(M) || isNaN(te)) throw Xn.error("jsPDF.context2d.rect: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.rect");
    this.moveTo(C, H), this.lineTo(C + M, H), this.lineTo(C + M, H + te), this.lineTo(C, H + te), this.lineTo(C, H), this.lineTo(C + M, H), this.lineTo(C, H);
  }, f.prototype.fillRect = function(C, H, M, te) {
    if (isNaN(C) || isNaN(H) || isNaN(M) || isNaN(te)) throw Xn.error("jsPDF.context2d.fillRect: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.fillRect");
    if (!c.call(this)) {
      var ie = {};
      this.lineCap !== "butt" && (ie.lineCap = this.lineCap, this.lineCap = "butt"), this.lineJoin !== "miter" && (ie.lineJoin = this.lineJoin, this.lineJoin = "miter"), this.beginPath(), this.rect(C, H, M, te), this.fill(), ie.hasOwnProperty("lineCap") && (this.lineCap = ie.lineCap), ie.hasOwnProperty("lineJoin") && (this.lineJoin = ie.lineJoin);
    }
  }, f.prototype.strokeRect = function(C, H, M, te) {
    if (isNaN(C) || isNaN(H) || isNaN(M) || isNaN(te)) throw Xn.error("jsPDF.context2d.strokeRect: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");
    p.call(this) || (this.beginPath(), this.rect(C, H, M, te), this.stroke());
  }, f.prototype.clearRect = function(C, H, M, te) {
    if (isNaN(C) || isNaN(H) || isNaN(M) || isNaN(te)) throw Xn.error("jsPDF.context2d.clearRect: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.clearRect");
    this.ignoreClearRect || (this.fillStyle = "#ffffff", this.fillRect(C, H, M, te));
  }, f.prototype.save = function(C) {
    C = typeof C != "boolean" || C;
    for (var H = this.pdf.internal.getCurrentPageInfo().pageNumber, M = 0; M < this.pdf.internal.getNumberOfPages(); M++) this.pdf.setPage(M + 1), this.pdf.internal.out("q");
    if (this.pdf.setPage(H), C) {
      this.ctx.fontSize = this.pdf.internal.getFontSize();
      var te = new u(this.ctx);
      this.ctxStack.push(this.ctx), this.ctx = te;
    }
  }, f.prototype.restore = function(C) {
    C = typeof C != "boolean" || C;
    for (var H = this.pdf.internal.getCurrentPageInfo().pageNumber, M = 0; M < this.pdf.internal.getNumberOfPages(); M++) this.pdf.setPage(M + 1), this.pdf.internal.out("Q");
    this.pdf.setPage(H), C && this.ctxStack.length !== 0 && (this.ctx = this.ctxStack.pop(), this.fillStyle = this.ctx.fillStyle, this.strokeStyle = this.ctx.strokeStyle, this.font = this.ctx.font, this.lineCap = this.ctx.lineCap, this.lineWidth = this.ctx.lineWidth, this.lineJoin = this.ctx.lineJoin, this.lineDash = this.ctx.lineDash, this.lineDashOffset = this.ctx.lineDashOffset);
  }, f.prototype.toDataURL = function() {
    throw new Error("toDataUrl not implemented.");
  };
  var h = function(C) {
    var H, M, te, ie;
    if (C.isCanvasGradient === !0 && (C = C.getColor()), !C) return { r: 0, g: 0, b: 0, a: 0, style: C };
    if (/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(C)) H = 0, M = 0, te = 0, ie = 0;
    else {
      var we = /rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(C);
      if (we !== null) H = parseInt(we[1]), M = parseInt(we[2]), te = parseInt(we[3]), ie = 1;
      else if ((we = /rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(C)) !== null) H = parseInt(we[1]), M = parseInt(we[2]), te = parseInt(we[3]), ie = parseFloat(we[4]);
      else {
        if (ie = 1, typeof C == "string" && C.charAt(0) !== "#") {
          var ve = new aC(C);
          C = ve.ok ? ve.toHex() : "#000000";
        }
        C.length === 4 ? (H = C.substring(1, 2), H += H, M = C.substring(2, 3), M += M, te = C.substring(3, 4), te += te) : (H = C.substring(1, 3), M = C.substring(3, 5), te = C.substring(5, 7)), H = parseInt(H, 16), M = parseInt(M, 16), te = parseInt(te, 16);
      }
    }
    return { r: H, g: M, b: te, a: ie, style: C };
  }, c = function() {
    return this.ctx.isFillTransparent || this.globalAlpha == 0;
  }, p = function() {
    return !!(this.ctx.isStrokeTransparent || this.globalAlpha == 0);
  };
  f.prototype.fillText = function(C, H, M, te) {
    if (isNaN(H) || isNaN(M) || typeof C != "string") throw Xn.error("jsPDF.context2d.fillText: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.fillText");
    if (te = isNaN(te) ? void 0 : te, !c.call(this)) {
      var ie = I(this.ctx.transform.rotation), we = this.ctx.transform.scaleX;
      E.call(this, { text: C, x: H, y: M, scale: we, angle: ie, align: this.textAlign, maxWidth: te });
    }
  }, f.prototype.strokeText = function(C, H, M, te) {
    if (isNaN(H) || isNaN(M) || typeof C != "string") throw Xn.error("jsPDF.context2d.strokeText: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.strokeText");
    if (!p.call(this)) {
      te = isNaN(te) ? void 0 : te;
      var ie = I(this.ctx.transform.rotation), we = this.ctx.transform.scaleX;
      E.call(this, { text: C, x: H, y: M, scale: we, renderingMode: "stroke", angle: ie, align: this.textAlign, maxWidth: te });
    }
  }, f.prototype.measureText = function(C) {
    if (typeof C != "string") throw Xn.error("jsPDF.context2d.measureText: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.measureText");
    var H = this.pdf, M = this.pdf.internal.scaleFactor, te = H.internal.getFontSize(), ie = H.getStringUnitWidth(C) * te / H.internal.scaleFactor;
    return new function(we) {
      var ve = (we = we || {}).width || 0;
      return Object.defineProperty(this, "width", { get: function() {
        return ve;
      } }), this;
    }({ width: ie *= Math.round(96 * M / 72 * 1e4) / 1e4 });
  }, f.prototype.scale = function(C, H) {
    if (isNaN(C) || isNaN(H)) throw Xn.error("jsPDF.context2d.scale: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.scale");
    var M = new o(C, 0, 0, H, 0, 0);
    this.ctx.transform = this.ctx.transform.multiply(M);
  }, f.prototype.rotate = function(C) {
    if (isNaN(C)) throw Xn.error("jsPDF.context2d.rotate: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.rotate");
    var H = new o(Math.cos(C), Math.sin(C), -Math.sin(C), Math.cos(C), 0, 0);
    this.ctx.transform = this.ctx.transform.multiply(H);
  }, f.prototype.translate = function(C, H) {
    if (isNaN(C) || isNaN(H)) throw Xn.error("jsPDF.context2d.translate: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.translate");
    var M = new o(1, 0, 0, 1, C, H);
    this.ctx.transform = this.ctx.transform.multiply(M);
  }, f.prototype.transform = function(C, H, M, te, ie, we) {
    if (isNaN(C) || isNaN(H) || isNaN(M) || isNaN(te) || isNaN(ie) || isNaN(we)) throw Xn.error("jsPDF.context2d.transform: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.transform");
    var ve = new o(C, H, M, te, ie, we);
    this.ctx.transform = this.ctx.transform.multiply(ve);
  }, f.prototype.setTransform = function(C, H, M, te, ie, we) {
    C = isNaN(C) ? 1 : C, H = isNaN(H) ? 0 : H, M = isNaN(M) ? 0 : M, te = isNaN(te) ? 1 : te, ie = isNaN(ie) ? 0 : ie, we = isNaN(we) ? 0 : we, this.ctx.transform = new o(C, H, M, te, ie, we);
  };
  var w = function() {
    return this.margin[0] > 0 || this.margin[1] > 0 || this.margin[2] > 0 || this.margin[3] > 0;
  };
  f.prototype.drawImage = function(C, H, M, te, ie, we, ve, le, _e) {
    var De = this.pdf.getImageProperties(C), ze = 1, nt = 1, Qe = 1, ne = 1;
    te !== void 0 && le !== void 0 && (Qe = le / te, ne = _e / ie, ze = De.width / te * le / te, nt = De.height / ie * _e / ie), we === void 0 && (we = H, ve = M, H = 0, M = 0), te !== void 0 && le === void 0 && (le = te, _e = ie), te === void 0 && le === void 0 && (le = De.width, _e = De.height);
    var gt = this.ctx.transform.decompose(), je = I(gt.rotate.shx), ot = new o(), Ie = (ot = (ot = (ot = ot.multiply(gt.translate)).multiply(gt.skew)).multiply(gt.scale)).applyToRectangle(new s(we - H * Qe, ve - M * ne, te * ze, ie * nt));
    if (this.autoPaging) {
      for (var It, dt = y.call(this, Ie), Dt = [], Ct = 0; Ct < dt.length; Ct += 1) Dt.indexOf(dt[Ct]) === -1 && Dt.push(dt[Ct]);
      D(Dt);
      for (var Ve = Dt[0], ht = Dt[Dt.length - 1], K = Ve; K < ht + 1; K++) {
        this.pdf.setPage(K);
        var X = this.pdf.internal.pageSize.width - this.margin[3] - this.margin[1], ke = K === 1 ? this.posY + this.margin[0] : this.margin[0], Je = this.pdf.internal.pageSize.height - this.posY - this.margin[0] - this.margin[2], pt = this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2], Xe = K === 1 ? 0 : Je + (K - 2) * pt;
        if (this.ctx.clip_path.length !== 0) {
          var Ye = this.path;
          It = JSON.parse(JSON.stringify(this.ctx.clip_path)), this.path = k(It, this.posX + this.margin[3], -Xe + ke + this.ctx.prevPageLastElemOffset), O.call(this, "fill", !0), this.path = Ye;
        }
        var Kt = JSON.parse(JSON.stringify(Ie));
        Kt = k([Kt], this.posX + this.margin[3], -Xe + ke + this.ctx.prevPageLastElemOffset)[0];
        var it = (K > Ve || K < ht) && w.call(this);
        it && (this.pdf.saveGraphicsState(), this.pdf.rect(this.margin[3], this.margin[0], X, pt, null).clip().discardPath()), this.pdf.addImage(C, "JPEG", Kt.x, Kt.y, Kt.w, Kt.h, null, null, je), it && this.pdf.restoreGraphicsState();
      }
    } else this.pdf.addImage(C, "JPEG", Ie.x, Ie.y, Ie.w, Ie.h, null, null, je);
  };
  var y = function(C, H, M) {
    var te = [];
    H = H || this.pdf.internal.pageSize.width, M = M || this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2];
    var ie = this.posY + this.ctx.prevPageLastElemOffset;
    switch (C.type) {
      default:
      case "mt":
      case "lt":
        te.push(Math.floor((C.y + ie) / M) + 1);
        break;
      case "arc":
        te.push(Math.floor((C.y + ie - C.radius) / M) + 1), te.push(Math.floor((C.y + ie + C.radius) / M) + 1);
        break;
      case "qct":
        var we = N(this.ctx.lastPoint.x, this.ctx.lastPoint.y, C.x1, C.y1, C.x, C.y);
        te.push(Math.floor((we.y + ie) / M) + 1), te.push(Math.floor((we.y + we.h + ie) / M) + 1);
        break;
      case "bct":
        var ve = se(this.ctx.lastPoint.x, this.ctx.lastPoint.y, C.x1, C.y1, C.x2, C.y2, C.x, C.y);
        te.push(Math.floor((ve.y + ie) / M) + 1), te.push(Math.floor((ve.y + ve.h + ie) / M) + 1);
        break;
      case "rect":
        te.push(Math.floor((C.y + ie) / M) + 1), te.push(Math.floor((C.y + C.h + ie) / M) + 1);
    }
    for (var le = 0; le < te.length; le += 1) for (; this.pdf.internal.getNumberOfPages() < te[le]; ) m.call(this);
    return te;
  }, m = function() {
    var C = this.fillStyle, H = this.strokeStyle, M = this.font, te = this.lineCap, ie = this.lineWidth, we = this.lineJoin;
    this.pdf.addPage(), this.fillStyle = C, this.strokeStyle = H, this.font = M, this.lineCap = te, this.lineWidth = ie, this.lineJoin = we;
  }, k = function(C, H, M) {
    for (var te = 0; te < C.length; te++) switch (C[te].type) {
      case "bct":
        C[te].x2 += H, C[te].y2 += M;
      case "qct":
        C[te].x1 += H, C[te].y1 += M;
      default:
        C[te].x += H, C[te].y += M;
    }
    return C;
  }, D = function(C) {
    return C.sort(function(H, M) {
      return H - M;
    });
  }, B = function(C, H) {
    var M = this.fillStyle, te = this.strokeStyle, ie = this.lineCap, we = this.lineWidth, ve = Math.abs(we * this.ctx.transform.scaleX), le = this.lineJoin;
    if (this.autoPaging) {
      for (var _e, De, ze = JSON.parse(JSON.stringify(this.path)), nt = JSON.parse(JSON.stringify(this.path)), Qe = [], ne = 0; ne < nt.length; ne++) if (nt[ne].x !== void 0) for (var gt = y.call(this, nt[ne]), je = 0; je < gt.length; je += 1) Qe.indexOf(gt[je]) === -1 && Qe.push(gt[je]);
      for (var ot = 0; ot < Qe.length; ot++) for (; this.pdf.internal.getNumberOfPages() < Qe[ot]; ) m.call(this);
      D(Qe);
      for (var Ie = Qe[0], It = Qe[Qe.length - 1], dt = Ie; dt < It + 1; dt++) {
        this.pdf.setPage(dt), this.fillStyle = M, this.strokeStyle = te, this.lineCap = ie, this.lineWidth = ve, this.lineJoin = le;
        var Dt = this.pdf.internal.pageSize.width - this.margin[3] - this.margin[1], Ct = dt === 1 ? this.posY + this.margin[0] : this.margin[0], Ve = this.pdf.internal.pageSize.height - this.posY - this.margin[0] - this.margin[2], ht = this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2], K = dt === 1 ? 0 : Ve + (dt - 2) * ht;
        if (this.ctx.clip_path.length !== 0) {
          var X = this.path;
          _e = JSON.parse(JSON.stringify(this.ctx.clip_path)), this.path = k(_e, this.posX + this.margin[3], -K + Ct + this.ctx.prevPageLastElemOffset), O.call(this, C, !0), this.path = X;
        }
        if (De = JSON.parse(JSON.stringify(ze)), this.path = k(De, this.posX + this.margin[3], -K + Ct + this.ctx.prevPageLastElemOffset), H === !1 || dt === 0) {
          var ke = (dt > Ie || dt < It) && w.call(this);
          ke && (this.pdf.saveGraphicsState(), this.pdf.rect(this.margin[3], this.margin[0], Dt, ht, null).clip().discardPath()), O.call(this, C, H), ke && this.pdf.restoreGraphicsState();
        }
        this.lineWidth = we;
      }
      this.path = ze;
    } else this.lineWidth = ve, O.call(this, C, H), this.lineWidth = we;
  }, O = function(C, H) {
    if ((C !== "stroke" || H || !p.call(this)) && (C === "stroke" || H || !c.call(this))) {
      for (var M, te, ie = [], we = this.path, ve = 0; ve < we.length; ve++) {
        var le = we[ve];
        switch (le.type) {
          case "begin":
            ie.push({ begin: !0 });
            break;
          case "close":
            ie.push({ close: !0 });
            break;
          case "mt":
            ie.push({ start: le, deltas: [], abs: [] });
            break;
          case "lt":
            var _e = ie.length;
            if (we[ve - 1] && !isNaN(we[ve - 1].x) && (M = [le.x - we[ve - 1].x, le.y - we[ve - 1].y], _e > 0)) {
              for (; _e >= 0; _e--) if (ie[_e - 1].close !== !0 && ie[_e - 1].begin !== !0) {
                ie[_e - 1].deltas.push(M), ie[_e - 1].abs.push(le);
                break;
              }
            }
            break;
          case "bct":
            M = [le.x1 - we[ve - 1].x, le.y1 - we[ve - 1].y, le.x2 - we[ve - 1].x, le.y2 - we[ve - 1].y, le.x - we[ve - 1].x, le.y - we[ve - 1].y], ie[ie.length - 1].deltas.push(M);
            break;
          case "qct":
            var De = we[ve - 1].x + 2 / 3 * (le.x1 - we[ve - 1].x), ze = we[ve - 1].y + 2 / 3 * (le.y1 - we[ve - 1].y), nt = le.x + 2 / 3 * (le.x1 - le.x), Qe = le.y + 2 / 3 * (le.y1 - le.y), ne = le.x, gt = le.y;
            M = [De - we[ve - 1].x, ze - we[ve - 1].y, nt - we[ve - 1].x, Qe - we[ve - 1].y, ne - we[ve - 1].x, gt - we[ve - 1].y], ie[ie.length - 1].deltas.push(M);
            break;
          case "arc":
            ie.push({ deltas: [], abs: [], arc: !0 }), Array.isArray(ie[ie.length - 1].abs) && ie[ie.length - 1].abs.push(le);
        }
      }
      te = H ? null : C === "stroke" ? "stroke" : "fill";
      for (var je = !1, ot = 0; ot < ie.length; ot++) if (ie[ot].arc) for (var Ie = ie[ot].abs, It = 0; It < Ie.length; It++) {
        var dt = Ie[It];
        dt.type === "arc" ? W.call(this, dt.x, dt.y, dt.radius, dt.startAngle, dt.endAngle, dt.counterclockwise, void 0, H, !je) : Q.call(this, dt.x, dt.y), je = !0;
      }
      else if (ie[ot].close === !0) this.pdf.internal.out("h"), je = !1;
      else if (ie[ot].begin !== !0) {
        var Dt = ie[ot].start.x, Ct = ie[ot].start.y;
        x.call(this, ie[ot].deltas, Dt, Ct), je = !0;
      }
      te && F.call(this, te), H && Y.call(this);
    }
  }, q = function(C) {
    var H = this.pdf.internal.getFontSize() / this.pdf.internal.scaleFactor, M = H * (this.pdf.internal.getLineHeightFactor() - 1);
    switch (this.ctx.textBaseline) {
      case "bottom":
        return C - M;
      case "top":
        return C + H - M;
      case "hanging":
        return C + H - 2 * M;
      case "middle":
        return C + H / 2 - M;
      default:
        return C;
    }
  }, G = function(C) {
    return C + this.pdf.internal.getFontSize() / this.pdf.internal.scaleFactor * (this.pdf.internal.getLineHeightFactor() - 1);
  };
  f.prototype.createLinearGradient = function() {
    var C = function() {
    };
    return C.colorStops = [], C.addColorStop = function(H, M) {
      this.colorStops.push([H, M]);
    }, C.getColor = function() {
      return this.colorStops.length === 0 ? "#000000" : this.colorStops[0][1];
    }, C.isCanvasGradient = !0, C;
  }, f.prototype.createPattern = function() {
    return this.createLinearGradient();
  }, f.prototype.createRadialGradient = function() {
    return this.createLinearGradient();
  };
  var W = function(C, H, M, te, ie, we, ve, le, _e) {
    for (var De = J.call(this, M, te, ie, we), ze = 0; ze < De.length; ze++) {
      var nt = De[ze];
      ze === 0 && (_e ? T.call(this, nt.x1 + C, nt.y1 + H) : Q.call(this, nt.x1 + C, nt.y1 + H)), oe.call(this, C, H, nt.x2, nt.y2, nt.x3, nt.y3, nt.x4, nt.y4);
    }
    le ? Y.call(this) : F.call(this, ve);
  }, F = function(C) {
    switch (C) {
      case "stroke":
        this.pdf.internal.out("S");
        break;
      case "fill":
        this.pdf.internal.out("f");
    }
  }, Y = function() {
    this.pdf.clip(), this.pdf.discardPath();
  }, T = function(C, H) {
    this.pdf.internal.out(e(C) + " " + r(H) + " m");
  }, E = function(C) {
    var H;
    switch (C.align) {
      case "right":
      case "end":
        H = "right";
        break;
      case "center":
        H = "center";
        break;
      default:
        H = "left";
    }
    var M, te, ie, we = this.pdf.getTextDimensions(C.text), ve = q.call(this, C.y), le = G.call(this, ve) - we.h, _e = this.ctx.transform.applyToPoint(new i(C.x, ve));
    if (this.autoPaging) {
      var De = this.ctx.transform.decompose(), ze = new o();
      ze = (ze = (ze = ze.multiply(De.translate)).multiply(De.skew)).multiply(De.scale);
      for (var nt = this.ctx.transform.applyToRectangle(new s(C.x, ve, we.w, we.h)), Qe = ze.applyToRectangle(new s(C.x, le, we.w, we.h)), ne = y.call(this, Qe), gt = [], je = 0; je < ne.length; je += 1) gt.indexOf(ne[je]) === -1 && gt.push(ne[je]);
      D(gt);
      for (var ot = gt[0], Ie = gt[gt.length - 1], It = ot; It < Ie + 1; It++) {
        this.pdf.setPage(It);
        var dt = It === 1 ? this.posY + this.margin[0] : this.margin[0], Dt = this.pdf.internal.pageSize.height - this.posY - this.margin[0] - this.margin[2], Ct = this.pdf.internal.pageSize.height - this.margin[2], Ve = Ct - this.margin[0], ht = this.pdf.internal.pageSize.width - this.margin[1], K = ht - this.margin[3], X = It === 1 ? 0 : Dt + (It - 2) * Ve;
        if (this.ctx.clip_path.length !== 0) {
          var ke = this.path;
          M = JSON.parse(JSON.stringify(this.ctx.clip_path)), this.path = k(M, this.posX + this.margin[3], -1 * X + dt), O.call(this, "fill", !0), this.path = ke;
        }
        var Je = k([JSON.parse(JSON.stringify(Qe))], this.posX + this.margin[3], -X + dt + this.ctx.prevPageLastElemOffset)[0];
        C.scale >= 0.01 && (te = this.pdf.internal.getFontSize(), this.pdf.setFontSize(te * C.scale), ie = this.lineWidth, this.lineWidth = ie * C.scale);
        var pt = this.autoPaging !== "text";
        if (pt || Je.y + Je.h <= Ct) {
          if (pt || Je.y >= dt && Je.x <= ht) {
            var Xe = pt ? C.text : this.pdf.splitTextToSize(C.text, C.maxWidth || ht - Je.x)[0], Ye = k([JSON.parse(JSON.stringify(nt))], this.posX + this.margin[3], -X + dt + this.ctx.prevPageLastElemOffset)[0], Kt = pt && (It > ot || It < Ie) && w.call(this);
            Kt && (this.pdf.saveGraphicsState(), this.pdf.rect(this.margin[3], this.margin[0], K, Ve, null).clip().discardPath()), this.pdf.text(Xe, Ye.x, Ye.y, { angle: C.angle, align: H, renderingMode: C.renderingMode }), Kt && this.pdf.restoreGraphicsState();
          }
        } else Je.y < Ct && (this.ctx.prevPageLastElemOffset += Ct - Je.y);
        C.scale >= 0.01 && (this.pdf.setFontSize(te), this.lineWidth = ie);
      }
    } else C.scale >= 0.01 && (te = this.pdf.internal.getFontSize(), this.pdf.setFontSize(te * C.scale), ie = this.lineWidth, this.lineWidth = ie * C.scale), this.pdf.text(C.text, _e.x + this.posX, _e.y + this.posY, { angle: C.angle, align: H, renderingMode: C.renderingMode, maxWidth: C.maxWidth }), C.scale >= 0.01 && (this.pdf.setFontSize(te), this.lineWidth = ie);
  }, Q = function(C, H, M, te) {
    M = M || 0, te = te || 0, this.pdf.internal.out(e(C + M) + " " + r(H + te) + " l");
  }, x = function(C, H, M) {
    return this.pdf.lines(C, H, M, null, null);
  }, oe = function(C, H, M, te, ie, we, ve, le) {
    this.pdf.internal.out([t(a(M + C)), t(A(te + H)), t(a(ie + C)), t(A(we + H)), t(a(ve + C)), t(A(le + H)), "c"].join(" "));
  }, J = function(C, H, M, te) {
    for (var ie = 2 * Math.PI, we = Math.PI / 2; H > M; ) H -= ie;
    var ve = Math.abs(M - H);
    ve < ie && te && (ve = ie - ve);
    for (var le = [], _e = te ? -1 : 1, De = H; ve > 1e-5; ) {
      var ze = De + _e * Math.min(ve, we);
      le.push(S.call(this, C, De, ze)), ve -= Math.abs(ze - De), De = ze;
    }
    return le;
  }, S = function(C, H, M) {
    var te = (M - H) / 2, ie = C * Math.cos(te), we = C * Math.sin(te), ve = ie, le = -we, _e = ve * ve + le * le, De = _e + ve * ie + le * we, ze = 4 / 3 * (Math.sqrt(2 * _e * De) - De) / (ve * we - le * ie), nt = ve - ze * le, Qe = le + ze * ve, ne = nt, gt = -Qe, je = te + H, ot = Math.cos(je), Ie = Math.sin(je);
    return { x1: C * Math.cos(H), y1: C * Math.sin(H), x2: nt * ot - Qe * Ie, y2: nt * Ie + Qe * ot, x3: ne * ot - gt * Ie, y3: ne * Ie + gt * ot, x4: C * Math.cos(M), y4: C * Math.sin(M) };
  }, I = function(C) {
    return 180 * C / Math.PI;
  }, N = function(C, H, M, te, ie, we) {
    var ve = C + 0.5 * (M - C), le = H + 0.5 * (te - H), _e = ie + 0.5 * (M - ie), De = we + 0.5 * (te - we), ze = Math.min(C, ie, ve, _e), nt = Math.max(C, ie, ve, _e), Qe = Math.min(H, we, le, De), ne = Math.max(H, we, le, De);
    return new s(ze, Qe, nt - ze, ne - Qe);
  }, se = function(C, H, M, te, ie, we, ve, le) {
    var _e, De, ze, nt, Qe, ne, gt, je, ot, Ie, It, dt, Dt, Ct, Ve = M - C, ht = te - H, K = ie - M, X = we - te, ke = ve - ie, Je = le - we;
    for (De = 0; De < 41; De++) ot = (gt = (ze = C + (_e = De / 40) * Ve) + _e * ((Qe = M + _e * K) - ze)) + _e * (Qe + _e * (ie + _e * ke - Qe) - gt), Ie = (je = (nt = H + _e * ht) + _e * ((ne = te + _e * X) - nt)) + _e * (ne + _e * (we + _e * Je - ne) - je), De == 0 ? (It = ot, dt = Ie, Dt = ot, Ct = Ie) : (It = Math.min(It, ot), dt = Math.min(dt, Ie), Dt = Math.max(Dt, ot), Ct = Math.max(Ct, Ie));
    return new s(Math.round(It), Math.round(dt), Math.round(Dt - It), Math.round(Ct - dt));
  }, Z = function() {
    if (this.prevLineDash || this.ctx.lineDash.length || this.ctx.lineDashOffset) {
      var C, H, M = (C = this.ctx.lineDash, H = this.ctx.lineDashOffset, JSON.stringify({ lineDash: C, lineDashOffset: H }));
      this.prevLineDash !== M && (this.pdf.setLineDash(this.ctx.lineDash, this.ctx.lineDashOffset), this.prevLineDash = M);
    }
  };
})(kr.API), /**
 * @license
 * jsPDF filters PlugIn
 * Copyright (c) 2014 Aras Abbasi
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */
(function(n) {
  var t = function(i) {
    var s, o, l, u, f, h, c, p, w, y;
    for (o = [], l = 0, u = (i += s = "\0\0\0\0".slice(i.length % 4 || 4)).length; u > l; l += 4) (f = (i.charCodeAt(l) << 24) + (i.charCodeAt(l + 1) << 16) + (i.charCodeAt(l + 2) << 8) + i.charCodeAt(l + 3)) !== 0 ? (h = (f = ((f = ((f = ((f = (f - (y = f % 85)) / 85) - (w = f % 85)) / 85) - (p = f % 85)) / 85) - (c = f % 85)) / 85) % 85, o.push(h + 33, c + 33, p + 33, w + 33, y + 33)) : o.push(122);
    return (function(m, k) {
      for (var D = k; D > 0; D--) m.pop();
    })(o, s.length), String.fromCharCode.apply(String, o) + "~>";
  }, e = function(i) {
    var s, o, l, u, f, h = String, c = "length", p = 255, w = "charCodeAt", y = "slice", m = "replace";
    for (i[y](-2), i = i[y](0, -2)[m](/\s/g, "")[m]("z", "!!!!!"), l = [], u = 0, f = (i += s = "uuuuu"[y](i[c] % 5 || 5))[c]; f > u; u += 5) o = 52200625 * (i[w](u) - 33) + 614125 * (i[w](u + 1) - 33) + 7225 * (i[w](u + 2) - 33) + 85 * (i[w](u + 3) - 33) + (i[w](u + 4) - 33), l.push(p & o >> 24, p & o >> 16, p & o >> 8, p & o);
    return (function(k, D) {
      for (var B = D; B > 0; B--) k.pop();
    })(l, s[c]), h.fromCharCode.apply(h, l);
  }, r = function(i) {
    return i.split("").map(function(s) {
      return ("0" + s.charCodeAt().toString(16)).slice(-2);
    }).join("") + ">";
  }, a = function(i) {
    var s = new RegExp(/^([0-9A-Fa-f]{2})+$/);
    if ((i = i.replace(/\s/g, "")).indexOf(">") !== -1 && (i = i.substr(0, i.indexOf(">"))), i.length % 2 && (i += "0"), s.test(i) === !1) return "";
    for (var o = "", l = 0; l < i.length; l += 2) o += String.fromCharCode("0x" + (i[l] + i[l + 1]));
    return o;
  }, A = function(i) {
    for (var s = new Uint8Array(i.length), o = i.length; o--; ) s[o] = i.charCodeAt(o);
    return (s = mp(s)).reduce(function(l, u) {
      return l + String.fromCharCode(u);
    }, "");
  };
  n.processDataByFilters = function(i, s) {
    var o = 0, l = i || "", u = [];
    for (typeof (s = s || []) == "string" && (s = [s]), o = 0; o < s.length; o += 1) switch (s[o]) {
      case "ASCII85Decode":
      case "/ASCII85Decode":
        l = e(l), u.push("/ASCII85Encode");
        break;
      case "ASCII85Encode":
      case "/ASCII85Encode":
        l = t(l), u.push("/ASCII85Decode");
        break;
      case "ASCIIHexDecode":
      case "/ASCIIHexDecode":
        l = a(l), u.push("/ASCIIHexEncode");
        break;
      case "ASCIIHexEncode":
      case "/ASCIIHexEncode":
        l = r(l), u.push("/ASCIIHexDecode");
        break;
      case "FlateEncode":
      case "/FlateEncode":
        l = A(l), u.push("/FlateDecode");
        break;
      default:
        throw new Error('The filter: "' + s[o] + '" is not implemented');
    }
    return { data: l, reverseChain: u.reverse().join(" ") };
  };
})(kr.API), /**
 * @license
 * jsPDF fileloading PlugIn
 * Copyright (c) 2018 Aras Abbasi (aras.abbasi@gmail.com)
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */
(function(n) {
  n.loadFile = function(t, e, r) {
    return (function(a, A, i) {
      A = A !== !1, i = typeof i == "function" ? i : function() {
      };
      var s = void 0;
      try {
        s = (function(o, l, u) {
          var f = new XMLHttpRequest(), h = 0, c = function(p) {
            var w = p.length, y = [], m = String.fromCharCode;
            for (h = 0; h < w; h += 1) y.push(m(255 & p.charCodeAt(h)));
            return y.join("");
          };
          if (f.open("GET", o, !l), f.overrideMimeType("text/plain; charset=x-user-defined"), l === !1 && (f.onload = function() {
            f.status === 200 ? u(c(this.responseText)) : u(void 0);
          }), f.send(null), l && f.status === 200) return c(f.responseText);
        })(a, A, i);
      } catch {
      }
      return s;
    })(t, e, r);
  }, n.allowFsRead = void 0, n.loadImageFile = n.loadFile;
})(kr.API), (function(n) {
  function t() {
    return (Nr.html2canvas ? Promise.resolve(Nr.html2canvas) : Promise.resolve().then(() => N8)).catch(function(s) {
      return Promise.reject(new Error("Could not load html2canvas: " + s));
    }).then(function(s) {
      return s.default ? s.default : s;
    });
  }
  function e() {
    return (Nr.DOMPurify ? Promise.resolve(Nr.DOMPurify) : Promise.resolve().then(() => _P)).catch(function(s) {
      return Promise.reject(new Error("Could not load dompurify: " + s));
    }).then(function(s) {
      return s.default ? s.default : s;
    });
  }
  var r = function(s) {
    var o = In(s);
    return o === "undefined" ? "undefined" : o === "string" || s instanceof String ? "string" : o === "number" || s instanceof Number ? "number" : o === "function" || s instanceof Function ? "function" : s && s.constructor === Array ? "array" : s && s.nodeType === 1 ? "element" : o === "object" ? "object" : "unknown";
  }, a = function(s, o) {
    var l = document.createElement(s);
    for (var u in o.className && (l.className = o.className), o.innerHTML && o.dompurify && (l.innerHTML = o.dompurify.sanitize(o.innerHTML)), o.style) l.style[u] = o.style[u];
    return l;
  }, A = function s(o, l) {
    for (var u = o.nodeType === 3 ? document.createTextNode(o.nodeValue) : o.cloneNode(!1), f = o.firstChild; f; f = f.nextSibling) l !== !0 && f.nodeType === 1 && f.nodeName === "SCRIPT" || u.appendChild(s(f, l));
    return o.nodeType === 1 && (o.nodeName === "CANVAS" ? (u.width = o.width, u.height = o.height, u.getContext("2d").drawImage(o, 0, 0)) : o.nodeName !== "TEXTAREA" && o.nodeName !== "SELECT" || (u.value = o.value), u.addEventListener("load", function() {
      u.scrollTop = o.scrollTop, u.scrollLeft = o.scrollLeft;
    }, !0)), u;
  }, i = function s(o) {
    var l = Object.assign(s.convert(Promise.resolve()), JSON.parse(JSON.stringify(s.template))), u = s.convert(Promise.resolve(), l);
    return (u = u.setProgress(1, s, 1, [s])).set(o);
  };
  (i.prototype = Object.create(Promise.prototype)).constructor = i, i.convert = function(s, o) {
    return s.__proto__ = o || i.prototype, s;
  }, i.template = { prop: { src: null, container: null, overlay: null, canvas: null, img: null, pdf: null, pageSize: null, callback: function() {
  } }, progress: { val: 0, state: null, n: 0, stack: [] }, opt: { filename: "file.pdf", margin: [0, 0, 0, 0], enableLinks: !0, x: 0, y: 0, html2canvas: {}, jsPDF: {}, backgroundColor: "transparent" } }, i.prototype.from = function(s, o) {
    return this.then(function() {
      switch (o = o || (function(l) {
        switch (r(l)) {
          case "string":
            return "string";
          case "element":
            return l.nodeName.toLowerCase() === "canvas" ? "canvas" : "element";
          default:
            return "unknown";
        }
      })(s), o) {
        case "string":
          return this.then(e).then(function(l) {
            return this.set({ src: a("div", { innerHTML: s, dompurify: l }) });
          });
        case "element":
          return this.set({ src: s });
        case "canvas":
          return this.set({ canvas: s });
        case "img":
          return this.set({ img: s });
        default:
          return this.error("Unknown source type.");
      }
    });
  }, i.prototype.to = function(s) {
    switch (s) {
      case "container":
        return this.toContainer();
      case "canvas":
        return this.toCanvas();
      case "img":
        return this.toImg();
      case "pdf":
        return this.toPdf();
      default:
        return this.error("Invalid target.");
    }
  }, i.prototype.toContainer = function() {
    return this.thenList([function() {
      return this.prop.src || this.error("Cannot duplicate - no source HTML.");
    }, function() {
      return this.prop.pageSize || this.setPageSize();
    }]).then(function() {
      var s = { position: "relative", display: "inline-block", width: (typeof this.opt.width != "number" || isNaN(this.opt.width) || typeof this.opt.windowWidth != "number" || isNaN(this.opt.windowWidth) ? Math.max(this.prop.src.clientWidth, this.prop.src.scrollWidth, this.prop.src.offsetWidth) : this.opt.windowWidth) + "px", left: 0, right: 0, top: 0, margin: "auto", backgroundColor: this.opt.backgroundColor }, o = A(this.prop.src, this.opt.html2canvas.javascriptEnabled);
      o.tagName === "BODY" && (s.height = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight) + "px"), this.prop.overlay = a("div", { className: "html2pdf__overlay", style: { position: "fixed", overflow: "hidden", zIndex: 1e3, left: "-100000px", right: 0, bottom: 0, top: 0 } }), this.prop.container = a("div", { className: "html2pdf__container", style: s }), this.prop.container.appendChild(o), this.prop.container.firstChild.appendChild(a("div", { style: { clear: "both", border: "0 none transparent", margin: 0, padding: 0, height: 0 } })), this.prop.container.style.float = "none", this.prop.overlay.appendChild(this.prop.container), document.body.appendChild(this.prop.overlay), this.prop.container.firstChild.style.position = "relative", this.prop.container.height = Math.max(this.prop.container.firstChild.clientHeight, this.prop.container.firstChild.scrollHeight, this.prop.container.firstChild.offsetHeight) + "px";
    });
  }, i.prototype.toCanvas = function() {
    var s = [function() {
      return document.body.contains(this.prop.container) || this.toContainer();
    }];
    return this.thenList(s).then(t).then(function(o) {
      var l = Object.assign({}, this.opt.html2canvas);
      return delete l.onrendered, o(this.prop.container, l);
    }).then(function(o) {
      (this.opt.html2canvas.onrendered || function() {
      })(o), this.prop.canvas = o, document.body.removeChild(this.prop.overlay);
    });
  }, i.prototype.toContext2d = function() {
    var s = [function() {
      return document.body.contains(this.prop.container) || this.toContainer();
    }];
    return this.thenList(s).then(t).then(function(o) {
      var l = this.opt.jsPDF, u = this.opt.fontFaces, f = typeof this.opt.width != "number" || isNaN(this.opt.width) || typeof this.opt.windowWidth != "number" || isNaN(this.opt.windowWidth) ? 1 : this.opt.width / this.opt.windowWidth, h = Object.assign({ async: !0, allowTaint: !0, scale: f, scrollX: this.opt.scrollX || 0, scrollY: this.opt.scrollY || 0, backgroundColor: "#ffffff", imageTimeout: 15e3, logging: !0, proxy: null, removeContainer: !0, foreignObjectRendering: !1, useCORS: !1 }, this.opt.html2canvas);
      if (delete h.onrendered, l.context2d.autoPaging = this.opt.autoPaging === void 0 || this.opt.autoPaging, l.context2d.posX = this.opt.x, l.context2d.posY = this.opt.y, l.context2d.margin = this.opt.margin, l.context2d.fontFaces = u, u) for (var c = 0; c < u.length; ++c) {
        var p = u[c], w = p.src.find(function(y) {
          return y.format === "truetype";
        });
        w && l.addFont(w.url, p.ref.name, p.ref.style);
      }
      return h.windowHeight = h.windowHeight || 0, h.windowHeight = h.windowHeight == 0 ? Math.max(this.prop.container.clientHeight, this.prop.container.scrollHeight, this.prop.container.offsetHeight) : h.windowHeight, l.context2d.save(!0), o(this.prop.container, h);
    }).then(function(o) {
      this.opt.jsPDF.context2d.restore(!0), (this.opt.html2canvas.onrendered || function() {
      })(o), this.prop.canvas = o, document.body.removeChild(this.prop.overlay);
    });
  }, i.prototype.toImg = function() {
    return this.thenList([function() {
      return this.prop.canvas || this.toCanvas();
    }]).then(function() {
      var s = this.prop.canvas.toDataURL("image/" + this.opt.image.type, this.opt.image.quality);
      this.prop.img = document.createElement("img"), this.prop.img.src = s;
    });
  }, i.prototype.toPdf = function() {
    return this.thenList([function() {
      return this.toContext2d();
    }]).then(function() {
      this.prop.pdf = this.prop.pdf || this.opt.jsPDF;
    });
  }, i.prototype.output = function(s, o, l) {
    return (l = l || "pdf").toLowerCase() === "img" || l.toLowerCase() === "image" ? this.outputImg(s, o) : this.outputPdf(s, o);
  }, i.prototype.outputPdf = function(s, o) {
    return this.thenList([function() {
      return this.prop.pdf || this.toPdf();
    }]).then(function() {
      return this.prop.pdf.output(s, o);
    });
  }, i.prototype.outputImg = function(s) {
    return this.thenList([function() {
      return this.prop.img || this.toImg();
    }]).then(function() {
      switch (s) {
        case void 0:
        case "img":
          return this.prop.img;
        case "datauristring":
        case "dataurlstring":
          return this.prop.img.src;
        case "datauri":
        case "dataurl":
          return document.location.href = this.prop.img.src;
        default:
          throw 'Image output type "' + s + '" is not supported.';
      }
    });
  }, i.prototype.save = function(s) {
    return this.thenList([function() {
      return this.prop.pdf || this.toPdf();
    }]).set(s ? { filename: s } : null).then(function() {
      this.prop.pdf.save(this.opt.filename);
    });
  }, i.prototype.doCallback = function() {
    return this.thenList([function() {
      return this.prop.pdf || this.toPdf();
    }]).then(function() {
      this.prop.callback(this.prop.pdf);
    });
  }, i.prototype.set = function(s) {
    if (r(s) !== "object") return this;
    var o = Object.keys(s || {}).map(function(l) {
      if (l in i.template.prop) return function() {
        this.prop[l] = s[l];
      };
      switch (l) {
        case "margin":
          return this.setMargin.bind(this, s.margin);
        case "jsPDF":
          return function() {
            return this.opt.jsPDF = s.jsPDF, this.setPageSize();
          };
        case "pageSize":
          return this.setPageSize.bind(this, s.pageSize);
        default:
          return function() {
            this.opt[l] = s[l];
          };
      }
    }, this);
    return this.then(function() {
      return this.thenList(o);
    });
  }, i.prototype.get = function(s, o) {
    return this.then(function() {
      var l = s in i.template.prop ? this.prop[s] : this.opt[s];
      return o ? o(l) : l;
    });
  }, i.prototype.setMargin = function(s) {
    return this.then(function() {
      switch (r(s)) {
        case "number":
          s = [s, s, s, s];
        case "array":
          if (s.length === 2 && (s = [s[0], s[1], s[0], s[1]]), s.length === 4) break;
        default:
          return this.error("Invalid margin array.");
      }
      this.opt.margin = s;
    }).then(this.setPageSize);
  }, i.prototype.setPageSize = function(s) {
    function o(l, u) {
      return Math.floor(l * u / 72 * 96);
    }
    return this.then(function() {
      (s = s || kr.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner") || (s.inner = { width: s.width - this.opt.margin[1] - this.opt.margin[3], height: s.height - this.opt.margin[0] - this.opt.margin[2] }, s.inner.px = { width: o(s.inner.width, s.k), height: o(s.inner.height, s.k) }, s.inner.ratio = s.inner.height / s.inner.width), this.prop.pageSize = s;
    });
  }, i.prototype.setProgress = function(s, o, l, u) {
    return s != null && (this.progress.val = s), o != null && (this.progress.state = o), l != null && (this.progress.n = l), u != null && (this.progress.stack = u), this.progress.ratio = this.progress.val / this.progress.state, this;
  }, i.prototype.updateProgress = function(s, o, l, u) {
    return this.setProgress(s ? this.progress.val + s : null, o || null, l ? this.progress.n + l : null, u ? this.progress.stack.concat(u) : null);
  }, i.prototype.then = function(s, o) {
    var l = this;
    return this.thenCore(s, o, function(u, f) {
      return l.updateProgress(null, null, 1, [u]), Promise.prototype.then.call(this, function(h) {
        return l.updateProgress(null, u), h;
      }).then(u, f).then(function(h) {
        return l.updateProgress(1), h;
      });
    });
  }, i.prototype.thenCore = function(s, o, l) {
    l = l || Promise.prototype.then;
    var u = this;
    s && (s = s.bind(u)), o && (o = o.bind(u));
    var f = Promise.toString().indexOf("[native code]") !== -1 && Promise.name === "Promise" ? u : i.convert(Object.assign({}, u), Promise.prototype), h = l.call(f, s, o);
    return i.convert(h, u.__proto__);
  }, i.prototype.thenExternal = function(s, o) {
    return Promise.prototype.then.call(this, s, o);
  }, i.prototype.thenList = function(s) {
    var o = this;
    return s.forEach(function(l) {
      o = o.thenCore(l);
    }), o;
  }, i.prototype.catch = function(s) {
    s && (s = s.bind(this));
    var o = Promise.prototype.catch.call(this, s);
    return i.convert(o, this);
  }, i.prototype.catchExternal = function(s) {
    return Promise.prototype.catch.call(this, s);
  }, i.prototype.error = function(s) {
    return this.then(function() {
      throw new Error(s);
    });
  }, i.prototype.using = i.prototype.set, i.prototype.saveAs = i.prototype.save, i.prototype.export = i.prototype.output, i.prototype.run = i.prototype.then, kr.getPageSize = function(s, o, l) {
    if (In(s) === "object") {
      var u = s;
      s = u.orientation, o = u.unit || o, l = u.format || l;
    }
    o = o || "mm", l = l || "a4", s = ("" + (s || "P")).toLowerCase();
    var f, h = ("" + l).toLowerCase(), c = { a0: [2383.94, 3370.39], a1: [1683.78, 2383.94], a2: [1190.55, 1683.78], a3: [841.89, 1190.55], a4: [595.28, 841.89], a5: [419.53, 595.28], a6: [297.64, 419.53], a7: [209.76, 297.64], a8: [147.4, 209.76], a9: [104.88, 147.4], a10: [73.7, 104.88], b0: [2834.65, 4008.19], b1: [2004.09, 2834.65], b2: [1417.32, 2004.09], b3: [1000.63, 1417.32], b4: [708.66, 1000.63], b5: [498.9, 708.66], b6: [354.33, 498.9], b7: [249.45, 354.33], b8: [175.75, 249.45], b9: [124.72, 175.75], b10: [87.87, 124.72], c0: [2599.37, 3676.54], c1: [1836.85, 2599.37], c2: [1298.27, 1836.85], c3: [918.43, 1298.27], c4: [649.13, 918.43], c5: [459.21, 649.13], c6: [323.15, 459.21], c7: [229.61, 323.15], c8: [161.57, 229.61], c9: [113.39, 161.57], c10: [79.37, 113.39], dl: [311.81, 623.62], letter: [612, 792], "government-letter": [576, 756], legal: [612, 1008], "junior-legal": [576, 360], ledger: [1224, 792], tabloid: [792, 1224], "credit-card": [153, 243] };
    switch (o) {
      case "pt":
        f = 1;
        break;
      case "mm":
        f = 72 / 25.4;
        break;
      case "cm":
        f = 72 / 2.54;
        break;
      case "in":
        f = 72;
        break;
      case "px":
        f = 0.75;
        break;
      case "pc":
      case "em":
        f = 12;
        break;
      case "ex":
        f = 6;
        break;
      default:
        throw "Invalid unit: " + o;
    }
    var p, w = 0, y = 0;
    if (c.hasOwnProperty(h)) w = c[h][1] / f, y = c[h][0] / f;
    else try {
      w = l[1], y = l[0];
    } catch {
      throw new Error("Invalid format: " + l);
    }
    if (s === "p" || s === "portrait") s = "p", y > w && (p = y, y = w, w = p);
    else {
      if (s !== "l" && s !== "landscape") throw "Invalid orientation: " + s;
      s = "l", w > y && (p = y, y = w, w = p);
    }
    return { width: y, height: w, unit: o, k: f, orientation: s };
  }, n.html = function(s, o) {
    (o = o || {}).callback = o.callback || function() {
    }, o.html2canvas = o.html2canvas || {}, o.html2canvas.canvas = o.html2canvas.canvas || this.canvas, o.jsPDF = o.jsPDF || this, o.fontFaces = o.fontFaces ? o.fontFaces.map(Gf) : null;
    var l = new i(o);
    return o.worker ? l : l.from(s).doCallback();
  };
})(kr.API), kr.API.addJS = function(n) {
  var t, e, r = (function(a) {
    for (var A = "", i = 0; i < a.length; i++) {
      var s = a[i];
      if (s === "(" || s === ")") {
        for (var o = 0, l = i - 1; l >= 0 && a[l] === "\\"; l--) o++;
        A += o % 2 == 0 ? "\\" + s : s;
      } else A += s;
    }
    return A;
  })(n);
  return this.internal.events.subscribe("postPutResources", function() {
    t = this.internal.newObject(), this.internal.out("<<"), this.internal.out("/Names [(EmbeddedJS) " + (t + 1) + " 0 R]"), this.internal.out(">>"), this.internal.out("endobj"), e = this.internal.newObject(), this.internal.out("<<"), this.internal.out("/S /JavaScript"), this.internal.out("/JS (" + r + ")"), this.internal.out(">>"), this.internal.out("endobj");
  }), this.internal.events.subscribe("putCatalog", function() {
    t !== void 0 && e !== void 0 && this.internal.out("/Names <</JavaScript " + t + " 0 R>>");
  }), this;
}, /**
 * @license
 * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */
(function(n) {
  var t;
  n.events.push(["postPutResources", function() {
    var e = this, r = /^(\d+) 0 obj$/;
    if (this.outline.root.children.length > 0) for (var a = e.outline.render().split(/\r\n/), A = 0; A < a.length; A++) {
      var i = a[A], s = r.exec(i);
      if (s != null) {
        var o = s[1];
        e.internal.newObjectDeferredBegin(o, !1);
      }
      e.internal.write(i);
    }
    if (this.outline.createNamedDestinations) {
      var l = this.internal.pages.length, u = [];
      for (A = 0; A < l; A++) {
        var f = e.internal.newObject();
        u.push(f);
        var h = e.internal.getPageInfo(A + 1);
        e.internal.write("<< /D[" + h.objId + " 0 R /XYZ null null null]>> endobj");
      }
      var c = e.internal.newObject();
      for (e.internal.write("<< /Names [ "), A = 0; A < u.length; A++) e.internal.write("(page_" + (A + 1) + ")" + u[A] + " 0 R");
      e.internal.write(" ] >>", "endobj"), t = e.internal.newObject(), e.internal.write("<< /Dests " + c + " 0 R"), e.internal.write(">>", "endobj");
    }
  }]), n.events.push(["putCatalog", function() {
    var e = this;
    e.outline.root.children.length > 0 && (e.internal.write("/Outlines", this.outline.makeRef(this.outline.root)), this.outline.createNamedDestinations && e.internal.write("/Names " + t + " 0 R"));
  }]), n.events.push(["initialized", function() {
    var e = this;
    e.outline = { createNamedDestinations: !1, root: { children: [] } }, e.outline.add = function(r, a, A) {
      var i = { title: a, options: A, children: [] };
      return r == null && (r = this.root), r.children.push(i), i;
    }, e.outline.render = function() {
      return this.ctx = {}, this.ctx.val = "", this.ctx.pdf = e, this.genIds_r(this.root), this.renderRoot(this.root), this.renderItems(this.root), this.ctx.val;
    }, e.outline.genIds_r = function(r) {
      r.id = e.internal.newObjectDeferred();
      for (var a = 0; a < r.children.length; a++) this.genIds_r(r.children[a]);
    }, e.outline.renderRoot = function(r) {
      this.objStart(r), this.line("/Type /Outlines"), r.children.length > 0 && (this.line("/First " + this.makeRef(r.children[0])), this.line("/Last " + this.makeRef(r.children[r.children.length - 1]))), this.line("/Count " + this.count_r({ count: 0 }, r)), this.objEnd();
    }, e.outline.renderItems = function(r) {
      for (var a = this.ctx.pdf.internal.getVerticalCoordinateString, A = 0; A < r.children.length; A++) {
        var i = r.children[A];
        this.objStart(i), this.line("/Title " + this.makeString(i.title)), this.line("/Parent " + this.makeRef(r)), A > 0 && this.line("/Prev " + this.makeRef(r.children[A - 1])), A < r.children.length - 1 && this.line("/Next " + this.makeRef(r.children[A + 1])), i.children.length > 0 && (this.line("/First " + this.makeRef(i.children[0])), this.line("/Last " + this.makeRef(i.children[i.children.length - 1])));
        var s = this.count = this.count_r({ count: 0 }, i);
        if (s > 0 && this.line("/Count " + s), i.options && i.options.pageNumber) {
          var o = e.internal.getPageInfo(i.options.pageNumber);
          this.line("/Dest [" + o.objId + " 0 R /XYZ 0 " + a(0) + " 0]");
        }
        this.objEnd();
      }
      for (var l = 0; l < r.children.length; l++) this.renderItems(r.children[l]);
    }, e.outline.line = function(r) {
      this.ctx.val += r + `\r
`;
    }, e.outline.makeRef = function(r) {
      return r.id + " 0 R";
    }, e.outline.makeString = function(r) {
      return "(" + e.internal.pdfEscape(r) + ")";
    }, e.outline.objStart = function(r) {
      this.ctx.val += `\r
` + r.id + ` 0 obj\r
<<\r
`;
    }, e.outline.objEnd = function() {
      this.ctx.val += `>> \r
endobj\r
`;
    }, e.outline.count_r = function(r, a) {
      for (var A = 0; A < a.children.length; A++) r.count++, this.count_r(r, a.children[A]);
      return r.count;
    };
  }]);
})(kr.API), /**
 * @license
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */
(function(n) {
  var t = [192, 193, 194, 195, 196, 197, 198, 199];
  n.processJPEG = function(e, r, a, A, i, s) {
    var o, l = this.decode.DCT_DECODE, u = null;
    if (typeof e == "string" || this.__addimage__.isArrayBuffer(e) || this.__addimage__.isArrayBufferView(e)) {
      switch (e = i || e, e = this.__addimage__.isArrayBuffer(e) ? new Uint8Array(e) : e, o = (function(f) {
        for (var h, c = 256 * f.charCodeAt(4) + f.charCodeAt(5), p = f.length, w = { width: 0, height: 0, numcomponents: 1 }, y = 4; y < p; y += 2) {
          if (y += c, t.indexOf(f.charCodeAt(y + 1)) !== -1) {
            h = 256 * f.charCodeAt(y + 5) + f.charCodeAt(y + 6), w = { width: 256 * f.charCodeAt(y + 7) + f.charCodeAt(y + 8), height: h, numcomponents: f.charCodeAt(y + 9) };
            break;
          }
          c = 256 * f.charCodeAt(y + 2) + f.charCodeAt(y + 3);
        }
        return w;
      })(e = this.__addimage__.isArrayBufferView(e) ? this.__addimage__.arrayBufferToBinaryString(e) : e), o.numcomponents) {
        case 1:
          s = this.color_spaces.DEVICE_GRAY;
          break;
        case 4:
          s = this.color_spaces.DEVICE_CMYK;
          break;
        case 3:
          s = this.color_spaces.DEVICE_RGB;
      }
      u = { data: e, width: o.width, height: o.height, colorSpace: s, bitsPerComponent: 8, filter: l, index: r, alias: a };
    }
    return u;
  };
})(kr.API), kr.API.processPNG = function(n, t, e, r) {
  if (this.__addimage__.isArrayBuffer(n) && (n = new Uint8Array(n)), this.__addimage__.isArrayBufferView(n)) {
    var a, A = S6(n, { checkCrc: !0 }), i = A.width, s = A.height, o = A.channels, l = A.palette, u = A.depth;
    a = l && o === 1 ? (function(W) {
      for (var F = W.width, Y = W.height, T = W.data, E = W.palette, Q = W.depth, x = !1, oe = [], J = [], S = void 0, I = !1, N = 0, se = 0; se < E.length; se++) {
        var Z = a1(E[se], 4), C = Z[0], H = Z[1], M = Z[2], te = Z[3];
        oe.push(C, H, M), te != null && (te === 0 ? (N++, J.length < 1 && J.push(se)) : te < 255 && (I = !0));
      }
      if (I || N > 1) {
        x = !0, J = void 0;
        var ie = F * Y;
        S = new Uint8Array(ie);
        for (var we = new DataView(T.buffer), ve = 0; ve < ie; ve++) {
          var le = Xf(we, ve, Q), _e = a1(E[le], 4)[3];
          S[ve] = _e;
        }
      } else N === 0 && (J = void 0);
      return { colorSpace: "Indexed", colorsPerPixel: 1, sMaskBitsPerComponent: x ? 8 : void 0, colorBytes: T, alphaBytes: S, needSMask: x, palette: oe, mask: J };
    })(A) : o === 2 || o === 4 ? (function(W) {
      for (var F = W.data, Y = W.width, T = W.height, E = W.channels, Q = W.depth, x = E === 2 ? "DeviceGray" : "DeviceRGB", oe = E - 1, J = Y * T, S = oe, I = J * S, N = 1 * J, se = Math.ceil(I * Q / 8), Z = Math.ceil(N * Q / 8), C = new Uint8Array(se), H = new Uint8Array(Z), M = new DataView(F.buffer), te = new DataView(C.buffer), ie = new DataView(H.buffer), we = !1, ve = 0; ve < J; ve++) {
        for (var le = ve * E, _e = 0; _e < S; _e++) iw(te, Xf(M, le + _e, Q), ve * S + _e, Q);
        var De = Xf(M, le + S, Q);
        De < (1 << Q) - 1 && (we = !0), iw(ie, De, 1 * ve, Q);
      }
      return { colorSpace: x, colorsPerPixel: oe, sMaskBitsPerComponent: we ? Q : void 0, colorBytes: C, alphaBytes: H, needSMask: we };
    })(A) : (function(W) {
      var F = W.data, Y = W.channels === 1 ? "DeviceGray" : "DeviceRGB";
      return { colorSpace: Y, colorsPerPixel: Y === "DeviceGray" ? 1 : 3, colorBytes: F instanceof Uint16Array ? (function(T) {
        for (var E = T.length, Q = new Uint8Array(2 * E), x = new DataView(Q.buffer, Q.byteOffset, Q.byteLength), oe = 0; oe < E; oe++) x.setUint16(2 * oe, T[oe], !1);
        return Q;
      })(F) : F, needSMask: !1 };
    })(A);
    var f, h, c, p = a, w = p.colorSpace, y = p.colorsPerPixel, m = p.sMaskBitsPerComponent, k = p.colorBytes, D = p.alphaBytes, B = p.needSMask, O = p.palette, q = p.mask, G = null;
    return r !== kr.API.image_compression.NONE && typeof mp == "function" ? (G = (function(W) {
      var F;
      switch (W) {
        case kr.API.image_compression.FAST:
          F = 11;
          break;
        case kr.API.image_compression.MEDIUM:
          F = 13;
          break;
        case kr.API.image_compression.SLOW:
          F = 14;
          break;
        default:
          F = 12;
      }
      return F;
    })(r), f = this.decode.FLATE_DECODE, h = "/Predictor ".concat(G, " /Colors ").concat(y, " /BitsPerComponent ").concat(u, " /Columns ").concat(i), n = rw(k, Math.ceil(i * y * u / 8), y, u, r), B && (c = rw(D, Math.ceil(i * m / 8), 1, m, r))) : (f = void 0, h = void 0, n = k, B && (c = D)), (this.__addimage__.isArrayBuffer(n) || this.__addimage__.isArrayBufferView(n)) && (n = this.__addimage__.arrayBufferToBinaryString(n)), (c && this.__addimage__.isArrayBuffer(c) || this.__addimage__.isArrayBufferView(c)) && (c = this.__addimage__.arrayBufferToBinaryString(c)), { alias: e, data: n, index: t, filter: f, decodeParameters: h, transparency: q, palette: O, sMask: c, predictor: G, width: i, height: s, bitsPerComponent: u, sMaskBitsPerComponent: m, colorSpace: w };
  }
}, (function(n) {
  n.processGIF89A = function(t, e, r, a) {
    var A = new z6(t), i = A.width, s = A.height, o = [];
    A.decodeAndBlitFrameRGBA(0, o);
    var l = { data: o, width: i, height: s }, u = new Jf(100).encode(l, 100);
    return n.processJPEG.call(this, u, e, r, a);
  }, n.processGIF87A = n.processGIF89A;
})(kr.API), li.prototype.parseHeader = function() {
  if (this.fileSize = this.datav.getUint32(this.pos, !0), this.pos += 4, this.reserved = this.datav.getUint32(this.pos, !0), this.pos += 4, this.offset = this.datav.getUint32(this.pos, !0), this.pos += 4, this.headerSize = this.datav.getUint32(this.pos, !0), this.pos += 4, this.width = this.datav.getUint32(this.pos, !0), this.pos += 4, this.height = this.datav.getInt32(this.pos, !0), this.pos += 4, this.planes = this.datav.getUint16(this.pos, !0), this.pos += 2, this.bitPP = this.datav.getUint16(this.pos, !0), this.pos += 2, this.compress = this.datav.getUint32(this.pos, !0), this.pos += 4, this.rawSize = this.datav.getUint32(this.pos, !0), this.pos += 4, this.hr = this.datav.getUint32(this.pos, !0), this.pos += 4, this.vr = this.datav.getUint32(this.pos, !0), this.pos += 4, this.colors = this.datav.getUint32(this.pos, !0), this.pos += 4, this.importantColors = this.datav.getUint32(this.pos, !0), this.pos += 4, this.bitPP === 16 && this.is_with_alpha && (this.bitPP = 15), this.bitPP < 15) {
    var n = this.colors === 0 ? 1 << this.bitPP : this.colors;
    this.palette = new Array(n);
    for (var t = 0; t < n; t++) {
      var e = this.datav.getUint8(this.pos++, !0), r = this.datav.getUint8(this.pos++, !0), a = this.datav.getUint8(this.pos++, !0), A = this.datav.getUint8(this.pos++, !0);
      this.palette[t] = { red: a, green: r, blue: e, quad: A };
    }
  }
  this.height < 0 && (this.height *= -1, this.bottom_up = !1);
}, li.prototype.parseBGR = function() {
  this.pos = this.offset;
  var n = "bit" + this.bitPP, t = this.width * this.height * 4;
  if (t > 536870912) throw new Error("Image dimensions exceed 512MB, which is too large.");
  this.data = new Uint8Array(t);
  try {
    this[n]();
  } catch (e) {
    Xn.log("bit decode error:" + e);
  }
}, li.prototype.bit1 = function() {
  var n, t = Math.ceil(this.width / 8), e = t % 4;
  for (n = this.height - 1; n >= 0; n--) {
    for (var r = this.bottom_up ? n : this.height - 1 - n, a = 0; a < t; a++) for (var A = this.datav.getUint8(this.pos++, !0), i = r * this.width * 4 + 8 * a * 4, s = 0; s < 8 && 8 * a + s < this.width; s++) {
      var o = this.palette[A >> 7 - s & 1];
      this.data[i + 4 * s] = o.blue, this.data[i + 4 * s + 1] = o.green, this.data[i + 4 * s + 2] = o.red, this.data[i + 4 * s + 3] = 255;
    }
    e !== 0 && (this.pos += 4 - e);
  }
}, li.prototype.bit4 = function() {
  for (var n = Math.ceil(this.width / 2), t = n % 4, e = this.height - 1; e >= 0; e--) {
    for (var r = this.bottom_up ? e : this.height - 1 - e, a = 0; a < n; a++) {
      var A = this.datav.getUint8(this.pos++, !0), i = r * this.width * 4 + 2 * a * 4, s = A >> 4, o = 15 & A, l = this.palette[s];
      if (this.data[i] = l.blue, this.data[i + 1] = l.green, this.data[i + 2] = l.red, this.data[i + 3] = 255, 2 * a + 1 >= this.width) break;
      l = this.palette[o], this.data[i + 4] = l.blue, this.data[i + 4 + 1] = l.green, this.data[i + 4 + 2] = l.red, this.data[i + 4 + 3] = 255;
    }
    t !== 0 && (this.pos += 4 - t);
  }
}, li.prototype.bit8 = function() {
  for (var n = this.width % 4, t = this.height - 1; t >= 0; t--) {
    for (var e = this.bottom_up ? t : this.height - 1 - t, r = 0; r < this.width; r++) {
      var a = this.datav.getUint8(this.pos++, !0), A = e * this.width * 4 + 4 * r;
      if (a < this.palette.length) {
        var i = this.palette[a];
        this.data[A] = i.red, this.data[A + 1] = i.green, this.data[A + 2] = i.blue, this.data[A + 3] = 255;
      } else this.data[A] = 255, this.data[A + 1] = 255, this.data[A + 2] = 255, this.data[A + 3] = 255;
    }
    n !== 0 && (this.pos += 4 - n);
  }
}, li.prototype.bit15 = function() {
  for (var n = this.width % 3, t = parseInt("11111", 2), e = this.height - 1; e >= 0; e--) {
    for (var r = this.bottom_up ? e : this.height - 1 - e, a = 0; a < this.width; a++) {
      var A = this.datav.getUint16(this.pos, !0);
      this.pos += 2;
      var i = (A & t) / t * 255 | 0, s = (A >> 5 & t) / t * 255 | 0, o = (A >> 10 & t) / t * 255 | 0, l = A >> 15 ? 255 : 0, u = r * this.width * 4 + 4 * a;
      this.data[u] = o, this.data[u + 1] = s, this.data[u + 2] = i, this.data[u + 3] = l;
    }
    this.pos += n;
  }
}, li.prototype.bit16 = function() {
  for (var n = this.width % 3, t = parseInt("11111", 2), e = parseInt("111111", 2), r = this.height - 1; r >= 0; r--) {
    for (var a = this.bottom_up ? r : this.height - 1 - r, A = 0; A < this.width; A++) {
      var i = this.datav.getUint16(this.pos, !0);
      this.pos += 2;
      var s = (i & t) / t * 255 | 0, o = (i >> 5 & e) / e * 255 | 0, l = (i >> 11) / t * 255 | 0, u = a * this.width * 4 + 4 * A;
      this.data[u] = l, this.data[u + 1] = o, this.data[u + 2] = s, this.data[u + 3] = 255;
    }
    this.pos += n;
  }
}, li.prototype.bit24 = function() {
  for (var n = this.height - 1; n >= 0; n--) {
    for (var t = this.bottom_up ? n : this.height - 1 - n, e = 0; e < this.width; e++) {
      var r = this.datav.getUint8(this.pos++, !0), a = this.datav.getUint8(this.pos++, !0), A = this.datav.getUint8(this.pos++, !0), i = t * this.width * 4 + 4 * e;
      this.data[i] = A, this.data[i + 1] = a, this.data[i + 2] = r, this.data[i + 3] = 255;
    }
    this.pos += this.width % 4;
  }
}, li.prototype.bit32 = function() {
  for (var n = this.height - 1; n >= 0; n--) for (var t = this.bottom_up ? n : this.height - 1 - n, e = 0; e < this.width; e++) {
    var r = this.datav.getUint8(this.pos++, !0), a = this.datav.getUint8(this.pos++, !0), A = this.datav.getUint8(this.pos++, !0), i = this.datav.getUint8(this.pos++, !0), s = t * this.width * 4 + 4 * e;
    this.data[s] = A, this.data[s + 1] = a, this.data[s + 2] = r, this.data[s + 3] = i;
  }
}, li.prototype.getData = function() {
  return this.data;
}, /**
 * @license
 * Copyright (c) 2018 Aras Abbasi
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */
(function(n) {
  n.processBMP = function(t, e, r, a) {
    var A = new li(t, !1), i = A.width, s = A.height, o = { data: A.getData(), width: i, height: s }, l = new Jf(100).encode(o, 100);
    return n.processJPEG.call(this, l, e, r, a);
  };
})(kr.API), lw.prototype.getData = function() {
  return this.data;
}, /**
 * @license
 * Copyright (c) 2019 Aras Abbasi
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */
(function(n) {
  n.processWEBP = function(t, e, r, a) {
    var A = new lw(t), i = A.width, s = A.height, o = { data: A.getData(), width: i, height: s }, l = new Jf(100).encode(o, 100);
    return n.processJPEG.call(this, l, e, r, a);
  };
})(kr.API), kr.API.processRGBA = function(n, t, e) {
  for (var r = n.data, a = r.length, A = new Uint8Array(a / 4 * 3), i = new Uint8Array(a / 4), s = 0, o = 0, l = 0; l < a; l += 4) {
    var u = r[l], f = r[l + 1], h = r[l + 2], c = r[l + 3];
    A[s++] = u, A[s++] = f, A[s++] = h, i[o++] = c;
  }
  var p = this.__addimage__.arrayBufferToBinaryString(A);
  return { alpha: this.__addimage__.arrayBufferToBinaryString(i), data: p, index: t, alias: e, colorSpace: "DeviceRGB", bitsPerComponent: 8, width: n.width, height: n.height };
}, kr.API.setLanguage = function(n) {
  return this.internal.languageSettings === void 0 && (this.internal.languageSettings = {}, this.internal.languageSettings.isSubscribed = !1), { af: "Afrikaans", sq: "Albanian", ar: "Arabic (Standard)", "ar-DZ": "Arabic (Algeria)", "ar-BH": "Arabic (Bahrain)", "ar-EG": "Arabic (Egypt)", "ar-IQ": "Arabic (Iraq)", "ar-JO": "Arabic (Jordan)", "ar-KW": "Arabic (Kuwait)", "ar-LB": "Arabic (Lebanon)", "ar-LY": "Arabic (Libya)", "ar-MA": "Arabic (Morocco)", "ar-OM": "Arabic (Oman)", "ar-QA": "Arabic (Qatar)", "ar-SA": "Arabic (Saudi Arabia)", "ar-SY": "Arabic (Syria)", "ar-TN": "Arabic (Tunisia)", "ar-AE": "Arabic (U.A.E.)", "ar-YE": "Arabic (Yemen)", an: "Aragonese", hy: "Armenian", as: "Assamese", ast: "Asturian", az: "Azerbaijani", eu: "Basque", be: "Belarusian", bn: "Bengali", bs: "Bosnian", br: "Breton", bg: "Bulgarian", my: "Burmese", ca: "Catalan", ch: "Chamorro", ce: "Chechen", zh: "Chinese", "zh-HK": "Chinese (Hong Kong)", "zh-CN": "Chinese (PRC)", "zh-SG": "Chinese (Singapore)", "zh-TW": "Chinese (Taiwan)", cv: "Chuvash", co: "Corsican", cr: "Cree", hr: "Croatian", cs: "Czech", da: "Danish", nl: "Dutch (Standard)", "nl-BE": "Dutch (Belgian)", en: "English", "en-AU": "English (Australia)", "en-BZ": "English (Belize)", "en-CA": "English (Canada)", "en-IE": "English (Ireland)", "en-JM": "English (Jamaica)", "en-NZ": "English (New Zealand)", "en-PH": "English (Philippines)", "en-ZA": "English (South Africa)", "en-TT": "English (Trinidad & Tobago)", "en-GB": "English (United Kingdom)", "en-US": "English (United States)", "en-ZW": "English (Zimbabwe)", eo: "Esperanto", et: "Estonian", fo: "Faeroese", fj: "Fijian", fi: "Finnish", fr: "French (Standard)", "fr-BE": "French (Belgium)", "fr-CA": "French (Canada)", "fr-FR": "French (France)", "fr-LU": "French (Luxembourg)", "fr-MC": "French (Monaco)", "fr-CH": "French (Switzerland)", fy: "Frisian", fur: "Friulian", gd: "Gaelic (Scots)", "gd-IE": "Gaelic (Irish)", gl: "Galacian", ka: "Georgian", de: "German (Standard)", "de-AT": "German (Austria)", "de-DE": "German (Germany)", "de-LI": "German (Liechtenstein)", "de-LU": "German (Luxembourg)", "de-CH": "German (Switzerland)", el: "Greek", gu: "Gujurati", ht: "Haitian", he: "Hebrew", hi: "Hindi", hu: "Hungarian", is: "Icelandic", id: "Indonesian", iu: "Inuktitut", ga: "Irish", it: "Italian (Standard)", "it-CH": "Italian (Switzerland)", ja: "Japanese", kn: "Kannada", ks: "Kashmiri", kk: "Kazakh", km: "Khmer", ky: "Kirghiz", tlh: "Klingon", ko: "Korean", "ko-KP": "Korean (North Korea)", "ko-KR": "Korean (South Korea)", la: "Latin", lv: "Latvian", lt: "Lithuanian", lb: "Luxembourgish", mk: "North Macedonia", ms: "Malay", ml: "Malayalam", mt: "Maltese", mi: "Maori", mr: "Marathi", mo: "Moldavian", nv: "Navajo", ng: "Ndonga", ne: "Nepali", no: "Norwegian", nb: "Norwegian (Bokmal)", nn: "Norwegian (Nynorsk)", oc: "Occitan", or: "Oriya", om: "Oromo", fa: "Persian", "fa-IR": "Persian/Iran", pl: "Polish", pt: "Portuguese", "pt-BR": "Portuguese (Brazil)", pa: "Punjabi", "pa-IN": "Punjabi (India)", "pa-PK": "Punjabi (Pakistan)", qu: "Quechua", rm: "Rhaeto-Romanic", ro: "Romanian", "ro-MO": "Romanian (Moldavia)", ru: "Russian", "ru-MO": "Russian (Moldavia)", sz: "Sami (Lappish)", sg: "Sango", sa: "Sanskrit", sc: "Sardinian", sd: "Sindhi", si: "Singhalese", sr: "Serbian", sk: "Slovak", sl: "Slovenian", so: "Somani", sb: "Sorbian", es: "Spanish", "es-AR": "Spanish (Argentina)", "es-BO": "Spanish (Bolivia)", "es-CL": "Spanish (Chile)", "es-CO": "Spanish (Colombia)", "es-CR": "Spanish (Costa Rica)", "es-DO": "Spanish (Dominican Republic)", "es-EC": "Spanish (Ecuador)", "es-SV": "Spanish (El Salvador)", "es-GT": "Spanish (Guatemala)", "es-HN": "Spanish (Honduras)", "es-MX": "Spanish (Mexico)", "es-NI": "Spanish (Nicaragua)", "es-PA": "Spanish (Panama)", "es-PY": "Spanish (Paraguay)", "es-PE": "Spanish (Peru)", "es-PR": "Spanish (Puerto Rico)", "es-ES": "Spanish (Spain)", "es-UY": "Spanish (Uruguay)", "es-VE": "Spanish (Venezuela)", sx: "Sutu", sw: "Swahili", sv: "Swedish", "sv-FI": "Swedish (Finland)", "sv-SV": "Swedish (Sweden)", ta: "Tamil", tt: "Tatar", te: "Teluga", th: "Thai", tig: "Tigre", ts: "Tsonga", tn: "Tswana", tr: "Turkish", tk: "Turkmen", uk: "Ukrainian", hsb: "Upper Sorbian", ur: "Urdu", ve: "Venda", vi: "Vietnamese", vo: "Volapuk", wa: "Walloon", cy: "Welsh", xh: "Xhosa", ji: "Yiddish", zu: "Zulu" }[n] !== void 0 && (this.internal.languageSettings.languageCode = n, this.internal.languageSettings.isSubscribed === !1 && (this.internal.events.subscribe("putCatalog", function() {
    this.internal.write("/Lang (" + this.internal.languageSettings.languageCode + ")");
  }), this.internal.languageSettings.isSubscribed = !0)), this;
}, kl = kr.API, Hc = kl.getCharWidthsArray = function(n, t) {
  var e, r, a = (t = t || {}).font || this.internal.getFont(), A = t.fontSize || this.internal.getFontSize(), i = t.charSpace || this.internal.getCharSpace(), s = t.widths ? t.widths : a.metadata.Unicode.widths, o = s.fof ? s.fof : 1, l = t.kerning ? t.kerning : a.metadata.Unicode.kerning, u = l.fof ? l.fof : 1, f = t.doKerning !== !1, h = 0, c = n.length, p = 0, w = s[0] || o, y = [];
  for (e = 0; e < c; e++) r = n.charCodeAt(e), typeof a.metadata.widthOfString == "function" ? y.push((a.metadata.widthOfGlyph(a.metadata.characterToGlyph(r)) + i * (1e3 / A) || 0) / 1e3) : (h = f && In(l[r]) === "object" && !isNaN(parseInt(l[r][p], 10)) ? l[r][p] / u : 0, y.push((s[r] || w) / o + h)), p = r;
  return y;
}, Z1 = kl.getStringUnitWidth = function(n, t) {
  var e = (t = t || {}).fontSize || this.internal.getFontSize(), r = t.font || this.internal.getFont(), a = t.charSpace || this.internal.getCharSpace();
  return kl.processArabic && (n = kl.processArabic(n)), typeof r.metadata.widthOfString == "function" ? r.metadata.widthOfString(n, e, a) / e : Hc.apply(this, arguments).reduce(function(A, i) {
    return A + i;
  }, 0);
}, ew = function(n, t, e, r) {
  for (var a = [], A = 0, i = n.length, s = 0; A !== i && s + t[A] < e; ) s += t[A], A++;
  a.push(n.slice(0, A));
  var o = A;
  for (s = 0; A !== i; ) s + t[A] > r && (a.push(n.slice(o, A)), s = 0, o = A), s += t[A], A++;
  return o !== A && a.push(n.slice(o, A)), a;
}, tw = function(n, t, e) {
  e || (e = {});
  var r, a, A, i, s, o, l, u = [], f = [u], h = e.textIndent || 0, c = 0, p = 0, w = n.split(" "), y = Hc.apply(this, [" ", e])[0];
  if (o = e.lineIndent === -1 ? w[0].length + 2 : e.lineIndent || 0) {
    var m = Array(o).join(" "), k = [];
    w.map(function(B) {
      (B = B.split(/\s*\n/)).length > 1 ? k = k.concat(B.map(function(O, q) {
        return (q && O.length ? `
` : "") + O;
      })) : k.push(B[0]);
    }), w = k, o = Z1.apply(this, [m, e]);
  }
  for (A = 0, i = w.length; A < i; A++) {
    var D = 0;
    if (r = w[A], o && r[0] == `
` && (r = r.substr(1), D = 1), h + c + (p = (a = Hc.apply(this, [r, e])).reduce(function(B, O) {
      return B + O;
    }, 0)) > t || D) {
      if (p > t) {
        for (s = ew.apply(this, [r, a, t - (h + c), t]), u.push(s.shift()), u = [s.pop()]; s.length; ) f.push([s.shift()]);
        p = a.slice(r.length - (u[0] ? u[0].length : 0)).reduce(function(B, O) {
          return B + O;
        }, 0);
      } else u = [r];
      f.push(u), h = p + o, c = y;
    } else u.push(r), h += c + p, c = y;
  }
  return l = o ? function(B, O) {
    return (O ? m : "") + B.join(" ");
  } : function(B) {
    return B.join(" ");
  }, f.map(l);
}, kl.splitTextToSize = function(n, t, e) {
  var r, a = (e = e || {}).fontSize || this.internal.getFontSize(), A = (function(u) {
    if (u.widths && u.kerning) return { widths: u.widths, kerning: u.kerning };
    var f = this.internal.getFont(u.fontName, u.fontStyle), h = "Unicode";
    return f.metadata[h] ? { widths: f.metadata[h].widths || { 0: 1 }, kerning: f.metadata[h].kerning || {} } : { font: f.metadata, fontSize: this.internal.getFontSize(), charSpace: this.internal.getCharSpace() };
  }).call(this, e);
  r = Array.isArray(n) ? n : String(n).split(/\r?\n/);
  var i = 1 * this.internal.scaleFactor * t / a;
  A.textIndent = e.textIndent ? 1 * e.textIndent * this.internal.scaleFactor / a : 0, A.lineIndent = e.lineIndent;
  var s, o, l = [];
  for (s = 0, o = r.length; s < o; s++) l = l.concat(tw.apply(this, [r[s], i, A]));
  return l;
}, (function(n) {
  n.__fontmetrics__ = n.__fontmetrics__ || {};
  for (var t = "0123456789abcdef", e = "klmnopqrstuvwxyz", r = {}, a = {}, A = 0; A < 16; A++) r[e[A]] = t[A], a[t[A]] = e[A];
  var i = function(h) {
    return "0x" + parseInt(h, 10).toString(16);
  }, s = n.__fontmetrics__.compress = function(h) {
    var c, p, w, y, m = ["{"];
    for (var k in h) {
      if (c = h[k], isNaN(parseInt(k, 10)) ? p = "'" + k + "'" : (k = parseInt(k, 10), p = (p = i(k).slice(2)).slice(0, -1) + a[p.slice(-1)]), typeof c == "number") c < 0 ? (w = i(c).slice(3), y = "-") : (w = i(c).slice(2), y = ""), w = y + w.slice(0, -1) + a[w.slice(-1)];
      else {
        if (In(c) !== "object") throw new Error("Don't know what to do with value type " + In(c) + ".");
        w = s(c);
      }
      m.push(p + w);
    }
    return m.push("}"), m.join("");
  }, o = n.__fontmetrics__.uncompress = function(h) {
    if (typeof h != "string") throw new Error("Invalid argument passed to uncompress.");
    for (var c, p, w, y, m = {}, k = 1, D = m, B = [], O = "", q = "", G = h.length - 1, W = 1; W < G; W += 1) (y = h[W]) == "'" ? c ? (w = c.join(""), c = void 0) : c = [] : c ? c.push(y) : y == "{" ? (B.push([D, w]), D = {}, w = void 0) : y == "}" ? ((p = B.pop())[0][p[1]] = D, w = void 0, D = p[0]) : y == "-" ? k = -1 : w === void 0 ? r.hasOwnProperty(y) ? (O += r[y], w = parseInt(O, 16) * k, k = 1, O = "") : O += y : r.hasOwnProperty(y) ? (q += r[y], D[w] = parseInt(q, 16) * k, k = 1, w = void 0, q = "") : q += y;
    return m;
  }, l = { codePages: ["WinAnsiEncoding"], WinAnsiEncoding: o("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}") }, u = { Unicode: { Courier: l, "Courier-Bold": l, "Courier-BoldOblique": l, "Courier-Oblique": l, Helvetica: l, "Helvetica-Bold": l, "Helvetica-BoldOblique": l, "Helvetica-Oblique": l, "Times-Roman": l, "Times-Bold": l, "Times-BoldItalic": l, "Times-Italic": l } }, f = { Unicode: { "Courier-Oblique": o("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Times-BoldItalic": o("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"), "Helvetica-Bold": o("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"), Courier: o("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Courier-BoldOblique": o("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Times-Bold": o("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"), Symbol: o("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"), Helvetica: o("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"), "Helvetica-BoldOblique": o("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"), ZapfDingbats: o("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"), "Courier-Bold": o("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Times-Italic": o("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"), "Times-Roman": o("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"), "Helvetica-Oblique": o("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}") } };
  n.events.push(["addFont", function(h) {
    var c = h.font, p = f.Unicode[c.postScriptName];
    p && (c.metadata.Unicode = {}, c.metadata.Unicode.widths = p.widths, c.metadata.Unicode.kerning = p.kerning);
    var w = u.Unicode[c.postScriptName];
    w && (c.metadata.Unicode.encoding = w, c.encoding = w.codePages[0]);
  }]);
})(kr.API), /**
 * @license
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */
(function(n) {
  var t = function(e) {
    for (var r = e.length, a = new Uint8Array(r), A = 0; A < r; A++) a[A] = e.charCodeAt(A);
    return a;
  };
  n.API.events.push(["addFont", function(e) {
    var r = void 0, a = e.font, A = e.instance;
    if (!a.isStandardFont) {
      if (A === void 0) throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('" + a.postScriptName + "').");
      if (typeof (r = A.existsFileInVFS(a.postScriptName) === !1 ? A.loadFile(a.postScriptName) : A.getFileFromVFS(a.postScriptName)) != "string") throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('" + a.postScriptName + "').");
      (function(i, s) {
        s = /^\x00\x01\x00\x00/.test(s) ? t(s) : t(pd(s)), i.metadata = n.API.TTFFont.open(s), i.metadata.Unicode = i.metadata.Unicode || { encoding: {}, kerning: {}, widths: [] }, i.metadata.glyIdsUsed = [0];
      })(a, r);
    }
  }]);
})(kr), kr.API.addSvgAsImage = function(n, t, e, r, a, A, i, s) {
  if (isNaN(t) || isNaN(e)) throw Xn.error("jsPDF.addSvgAsImage: Invalid coordinates", arguments), new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");
  if (isNaN(r) || isNaN(a)) throw Xn.error("jsPDF.addSvgAsImage: Invalid measurements", arguments), new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");
  var o = document.createElement("canvas");
  o.width = r, o.height = a;
  var l = o.getContext("2d");
  l.fillStyle = "#fff", l.fillRect(0, 0, o.width, o.height);
  var u = { ignoreMouse: !0, ignoreAnimation: !0, ignoreDimensions: !0 }, f = this;
  return (Nr.canvg ? Promise.resolve(Nr.canvg) : Promise.resolve().then(() => K9)).catch(function(h) {
    return Promise.reject(new Error("Could not load canvg: " + h));
  }).then(function(h) {
    return h.default ? h.default : h;
  }).then(function(h) {
    return h.fromString(l, n, u);
  }, function() {
    return Promise.reject(new Error("Could not load canvg."));
  }).then(function(h) {
    return h.render(u);
  }).then(function() {
    f.addImage(o.toDataURL("image/jpeg", 1), t, e, r, a, i, s);
  });
}, kr.API.putTotalPages = function(n) {
  var t, e = 0;
  parseInt(this.internal.getFont().id.substr(1), 10) < 15 ? (t = new RegExp(n, "g"), e = this.internal.getNumberOfPages()) : (t = new RegExp(this.pdfEscape16(n, this.internal.getFont()), "g"), e = this.pdfEscape16(this.internal.getNumberOfPages() + "", this.internal.getFont()));
  for (var r = 1; r <= this.internal.getNumberOfPages(); r++) for (var a = 0; a < this.internal.pages[r].length; a++) this.internal.pages[r][a] = this.internal.pages[r][a].replace(t, e);
  return this;
}, kr.API.viewerPreferences = function(n, t) {
  var e;
  n = n || {}, t = t || !1;
  var r, a, A, i = { HideToolbar: { defaultValue: !1, value: !1, type: "boolean", explicitSet: !1, valueSet: [!0, !1], pdfVersion: 1.3 }, HideMenubar: { defaultValue: !1, value: !1, type: "boolean", explicitSet: !1, valueSet: [!0, !1], pdfVersion: 1.3 }, HideWindowUI: { defaultValue: !1, value: !1, type: "boolean", explicitSet: !1, valueSet: [!0, !1], pdfVersion: 1.3 }, FitWindow: { defaultValue: !1, value: !1, type: "boolean", explicitSet: !1, valueSet: [!0, !1], pdfVersion: 1.3 }, CenterWindow: { defaultValue: !1, value: !1, type: "boolean", explicitSet: !1, valueSet: [!0, !1], pdfVersion: 1.3 }, DisplayDocTitle: { defaultValue: !1, value: !1, type: "boolean", explicitSet: !1, valueSet: [!0, !1], pdfVersion: 1.4 }, NonFullScreenPageMode: { defaultValue: "UseNone", value: "UseNone", type: "name", explicitSet: !1, valueSet: ["UseNone", "UseOutlines", "UseThumbs", "UseOC"], pdfVersion: 1.3 }, Direction: { defaultValue: "L2R", value: "L2R", type: "name", explicitSet: !1, valueSet: ["L2R", "R2L"], pdfVersion: 1.3 }, ViewArea: { defaultValue: "CropBox", value: "CropBox", type: "name", explicitSet: !1, valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"], pdfVersion: 1.4 }, ViewClip: { defaultValue: "CropBox", value: "CropBox", type: "name", explicitSet: !1, valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"], pdfVersion: 1.4 }, PrintArea: { defaultValue: "CropBox", value: "CropBox", type: "name", explicitSet: !1, valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"], pdfVersion: 1.4 }, PrintClip: { defaultValue: "CropBox", value: "CropBox", type: "name", explicitSet: !1, valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"], pdfVersion: 1.4 }, PrintScaling: { defaultValue: "AppDefault", value: "AppDefault", type: "name", explicitSet: !1, valueSet: ["AppDefault", "None"], pdfVersion: 1.6 }, Duplex: { defaultValue: "", value: "none", type: "name", explicitSet: !1, valueSet: ["Simplex", "DuplexFlipShortEdge", "DuplexFlipLongEdge", "none"], pdfVersion: 1.7 }, PickTrayByPDFSize: { defaultValue: !1, value: !1, type: "boolean", explicitSet: !1, valueSet: [!0, !1], pdfVersion: 1.7 }, PrintPageRange: { defaultValue: "", value: "", type: "array", explicitSet: !1, valueSet: null, pdfVersion: 1.7 }, NumCopies: { defaultValue: 1, value: 1, type: "integer", explicitSet: !1, valueSet: null, pdfVersion: 1.7 } }, s = Object.keys(i), o = [], l = 0, u = 0, f = 0;
  function h(p, w) {
    var y, m = !1;
    for (y = 0; y < p.length; y += 1) p[y] === w && (m = !0);
    return m;
  }
  if (this.internal.viewerpreferences === void 0 && (this.internal.viewerpreferences = {}, this.internal.viewerpreferences.configuration = JSON.parse(JSON.stringify(i)), this.internal.viewerpreferences.isSubscribed = !1), e = this.internal.viewerpreferences.configuration, n === "reset" || t === !0) {
    var c = s.length;
    for (f = 0; f < c; f += 1) e[s[f]].value = e[s[f]].defaultValue, e[s[f]].explicitSet = !1;
  }
  if (In(n) === "object") {
    for (a in n) if (A = n[a], h(s, a) && A !== void 0) {
      if (e[a].type === "boolean" && typeof A == "boolean") e[a].value = A;
      else if (e[a].type === "name" && h(e[a].valueSet, A)) e[a].value = A;
      else if (e[a].type === "integer" && Number.isInteger(A)) e[a].value = A;
      else if (e[a].type === "array") {
        for (l = 0; l < A.length; l += 1) if (r = !0, A[l].length === 1 && typeof A[l][0] == "number") o.push(String(A[l] - 1));
        else if (A[l].length > 1) {
          for (u = 0; u < A[l].length; u += 1) typeof A[l][u] != "number" && (r = !1);
          r === !0 && o.push([A[l][0] - 1, A[l][1] - 1].join(" "));
        }
        e[a].value = "[" + o.join(" ") + "]";
      } else e[a].value = e[a].defaultValue;
      e[a].explicitSet = !0;
    }
  }
  return this.internal.viewerpreferences.isSubscribed === !1 && (this.internal.events.subscribe("putCatalog", function() {
    var p, w = [];
    for (p in e) e[p].explicitSet === !0 && (e[p].type === "name" ? w.push("/" + p + " /" + e[p].value) : w.push("/" + p + " " + e[p].value));
    w.length !== 0 && this.internal.write(`/ViewerPreferences
<<
` + w.join(`
`) + `
>>`);
  }), this.internal.viewerpreferences.isSubscribed = !0), this.internal.viewerpreferences.configuration = e, this;
}, kr.API.addMetadata = function(n, t) {
  return this.internal.__metadata__ === void 0 && (this.internal.__metadata__ = { metadata: n, namespaceUri: t ?? "http://jspdf.default.namespaceuri/", rawXml: typeof t == "boolean" && t }, this.internal.events.subscribe("putCatalog", J6), this.internal.events.subscribe("postPutResources", X6)), this;
}, (function(n) {
  var t = n.API, e = t.pdfEscape16 = function(A, i) {
    for (var s, o = i.metadata.Unicode.widths, l = ["", "0", "00", "000", "0000"], u = [""], f = 0, h = A.length; f < h; ++f) {
      if (s = i.metadata.characterToGlyph(A.charCodeAt(f)), i.metadata.glyIdsUsed.push(s), i.metadata.toUnicode[s] = A.charCodeAt(f), o.indexOf(s) == -1 && (o.push(s), o.push([parseInt(i.metadata.widthOfGlyph(s), 10)])), s == "0") return u.join("");
      s = s.toString(16), u.push(l[4 - s.length], s);
    }
    return u.join("");
  }, r = function(A) {
    var i, s, o, l, u, f, h;
    for (u = `/CIDInit /ProcSet findresource begin
12 dict begin
begincmap
/CIDSystemInfo <<
  /Registry (Adobe)
  /Ordering (UCS)
  /Supplement 0
>> def
/CMapName /Adobe-Identity-UCS def
/CMapType 2 def
1 begincodespacerange
<0000><ffff>
endcodespacerange`, o = [], f = 0, h = (s = Object.keys(A).sort(function(c, p) {
      return c - p;
    })).length; f < h; f++) i = s[f], o.length >= 100 && (u += `
` + o.length + ` beginbfchar
` + o.join(`
`) + `
endbfchar`, o = []), A[i] !== void 0 && A[i] !== null && typeof A[i].toString == "function" && (l = ("0000" + A[i].toString(16)).slice(-4), i = ("0000" + (+i).toString(16)).slice(-4), o.push("<" + i + "><" + l + ">"));
    return o.length && (u += `
` + o.length + ` beginbfchar
` + o.join(`
`) + `
endbfchar
`), u + `endcmap
CMapName currentdict /CMap defineresource pop
end
end`;
  };
  t.events.push(["putFont", function(A) {
    (function(i) {
      var s = i.font, o = i.out, l = i.newObject, u = i.putStream;
      if (s.metadata instanceof n.API.TTFFont && s.encoding === "Identity-H") {
        for (var f = s.metadata.Unicode.widths, h = s.metadata.subset.encode(s.metadata.glyIdsUsed, 1), c = "", p = 0; p < h.length; p++) c += String.fromCharCode(h[p]);
        var w = l();
        u({ data: c, addLength1: !0, objectId: w }), o("endobj");
        var y = l();
        u({ data: r(s.metadata.toUnicode), addLength1: !0, objectId: y }), o("endobj");
        var m = l();
        o("<<"), o("/Type /FontDescriptor"), o("/FontName /" + _l(s.fontName)), o("/FontFile2 " + w + " 0 R"), o("/FontBBox " + n.API.PDFObject.convert(s.metadata.bbox)), o("/Flags " + s.metadata.flags), o("/StemV " + s.metadata.stemV), o("/ItalicAngle " + s.metadata.italicAngle), o("/Ascent " + s.metadata.ascender), o("/Descent " + s.metadata.decender), o("/CapHeight " + s.metadata.capHeight), o(">>"), o("endobj");
        var k = l();
        o("<<"), o("/Type /Font"), o("/BaseFont /" + _l(s.fontName)), o("/FontDescriptor " + m + " 0 R"), o("/W " + n.API.PDFObject.convert(f)), o("/CIDToGIDMap /Identity"), o("/DW 1000"), o("/Subtype /CIDFontType2"), o("/CIDSystemInfo"), o("<<"), o("/Supplement 0"), o("/Registry (Adobe)"), o("/Ordering (" + s.encoding + ")"), o(">>"), o(">>"), o("endobj"), s.objectNumber = l(), o("<<"), o("/Type /Font"), o("/Subtype /Type0"), o("/ToUnicode " + y + " 0 R"), o("/BaseFont /" + _l(s.fontName)), o("/Encoding /" + s.encoding), o("/DescendantFonts [" + k + " 0 R]"), o(">>"), o("endobj"), s.isAlreadyPutted = !0;
      }
    })(A);
  }]), t.events.push(["putFont", function(A) {
    (function(i) {
      var s = i.font, o = i.out, l = i.newObject, u = i.putStream;
      if (s.metadata instanceof n.API.TTFFont && s.encoding === "WinAnsiEncoding") {
        for (var f = s.metadata.rawData, h = "", c = 0; c < f.length; c++) h += String.fromCharCode(f[c]);
        var p = l();
        u({ data: h, addLength1: !0, objectId: p }), o("endobj");
        var w = l();
        u({ data: r(s.metadata.toUnicode), addLength1: !0, objectId: w }), o("endobj");
        var y = l();
        o("<<"), o("/Descent " + s.metadata.decender), o("/CapHeight " + s.metadata.capHeight), o("/StemV " + s.metadata.stemV), o("/Type /FontDescriptor"), o("/FontFile2 " + p + " 0 R"), o("/Flags 96"), o("/FontBBox " + n.API.PDFObject.convert(s.metadata.bbox)), o("/FontName /" + _l(s.fontName)), o("/ItalicAngle " + s.metadata.italicAngle), o("/Ascent " + s.metadata.ascender), o(">>"), o("endobj"), s.objectNumber = l();
        for (var m = 0; m < s.metadata.hmtx.widths.length; m++) s.metadata.hmtx.widths[m] = parseInt(s.metadata.hmtx.widths[m] * (1e3 / s.metadata.head.unitsPerEm));
        o("<</Subtype/TrueType/Type/Font/ToUnicode " + w + " 0 R/BaseFont/" + _l(s.fontName) + "/FontDescriptor " + y + " 0 R/Encoding/" + s.encoding + " /FirstChar 29 /LastChar 255 /Widths " + n.API.PDFObject.convert(s.metadata.hmtx.widths) + ">>"), o("endobj"), s.isAlreadyPutted = !0;
      }
    })(A);
  }]);
  var a = function(A) {
    var i, s = A.text || "", o = A.x, l = A.y, u = A.options || {}, f = A.mutex || {}, h = f.pdfEscape, c = f.activeFontKey, p = f.fonts, w = c, y = "", m = 0, k = "", D = p[w].encoding;
    if (p[w].encoding !== "Identity-H") return { text: s, x: o, y: l, options: u, mutex: f };
    for (k = s, w = c, Array.isArray(s) && (k = s[0]), m = 0; m < k.length; m += 1) p[w].metadata.hasOwnProperty("cmap") && (i = p[w].metadata.cmap.unicode.codeMap[k[m].charCodeAt(0)]), i || k[m].charCodeAt(0) < 256 && p[w].metadata.hasOwnProperty("Unicode") ? y += k[m] : y += "";
    var B = "";
    return parseInt(w.slice(1)) < 14 || D === "WinAnsiEncoding" ? B = h(y, w).split("").map(function(O) {
      return O.charCodeAt(0).toString(16);
    }).join("") : D === "Identity-H" && (B = e(y, p[w])), f.isHex = !0, { text: B, x: o, y: l, options: u, mutex: f };
  };
  t.events.push(["postProcessText", function(A) {
    var i = A.text || "", s = [], o = { text: i, x: A.x, y: A.y, options: A.options, mutex: A.mutex };
    if (Array.isArray(i)) {
      var l = 0;
      for (l = 0; l < i.length; l += 1) Array.isArray(i[l]) && i[l].length === 3 ? s.push([a(Object.assign({}, o, { text: i[l][0] })).text, i[l][1], i[l][2]]) : s.push(a(Object.assign({}, o, { text: i[l] })).text);
      A.text = s;
    } else A.text = a(Object.assign({}, o, { text: i })).text;
  }]);
})(kr), /**
 * @license
 * jsPDF virtual FileSystem functionality
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */
(function(n) {
  var t = function() {
    return this.internal.vFS === void 0 && (this.internal.vFS = {}), !0;
  };
  n.existsFileInVFS = function(e) {
    return t.call(this), this.internal.vFS[e] !== void 0;
  }, n.addFileToVFS = function(e, r) {
    return t.call(this), this.internal.vFS[e] = r, this;
  }, n.getFileFromVFS = function(e) {
    return t.call(this), this.internal.vFS[e] !== void 0 ? this.internal.vFS[e] : null;
  };
})(kr.API), /**
 * @license
 * Unicode Bidi Engine based on the work of Alex Shensis (@asthensis)
 * MIT License
 */
(function(n) {
  n.__bidiEngine__ = n.prototype.__bidiEngine__ = function(r) {
    var a, A, i, s, o, l, u, f = t, h = [[0, 3, 0, 1, 0, 0, 0], [0, 3, 0, 1, 2, 2, 0], [0, 3, 0, 17, 2, 0, 1], [0, 3, 5, 5, 4, 1, 0], [0, 3, 21, 21, 4, 0, 1], [0, 3, 5, 5, 4, 2, 0]], c = [[2, 0, 1, 1, 0, 1, 0], [2, 0, 1, 1, 0, 2, 0], [2, 0, 2, 1, 3, 2, 0], [2, 0, 2, 33, 3, 1, 1]], p = { L: 0, R: 1, EN: 2, AN: 3, N: 4, B: 5, S: 6 }, w = { 0: 0, 5: 1, 6: 2, 7: 3, 32: 4, 251: 5, 254: 6, 255: 7 }, y = ["(", ")", "(", "<", ">", "<", "[", "]", "[", "{", "}", "{", "«", "»", "«", "‹", "›", "‹", "⁅", "⁆", "⁅", "⁽", "⁾", "⁽", "₍", "₎", "₍", "≤", "≥", "≤", "〈", "〉", "〈", "﹙", "﹚", "﹙", "﹛", "﹜", "﹛", "﹝", "﹞", "﹝", "﹤", "﹥", "﹤"], m = new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/), k = !1, D = 0;
    this.__bidiEngine__ = {};
    var B = function(T) {
      var E = T.charCodeAt(), Q = E >> 8, x = w[Q];
      return x !== void 0 ? f[256 * x + (255 & E)] : Q === 252 || Q === 253 ? "AL" : m.test(Q) ? "L" : Q === 8 ? "R" : "N";
    }, O = function(T) {
      for (var E, Q = 0; Q < T.length; Q++) {
        if ((E = B(T.charAt(Q))) === "L") return !1;
        if (E === "R") return !0;
      }
      return !1;
    }, q = function(T, E, Q, x) {
      var oe, J, S, I, N = E[x];
      switch (N) {
        case "L":
        case "R":
        case "LRE":
        case "RLE":
        case "LRO":
        case "RLO":
        case "PDF":
          k = !1;
          break;
        case "N":
        case "AN":
          break;
        case "EN":
          k && (N = "AN");
          break;
        case "AL":
          k = !0, N = "R";
          break;
        case "WS":
        case "BN":
          N = "N";
          break;
        case "CS":
          x < 1 || x + 1 >= E.length || (oe = Q[x - 1]) !== "EN" && oe !== "AN" || (J = E[x + 1]) !== "EN" && J !== "AN" ? N = "N" : k && (J = "AN"), N = J === oe ? J : "N";
          break;
        case "ES":
          N = (oe = x > 0 ? Q[x - 1] : "B") === "EN" && x + 1 < E.length && E[x + 1] === "EN" ? "EN" : "N";
          break;
        case "ET":
          if (x > 0 && Q[x - 1] === "EN") {
            N = "EN";
            break;
          }
          if (k) {
            N = "N";
            break;
          }
          for (S = x + 1, I = E.length; S < I && E[S] === "ET"; ) S++;
          N = S < I && E[S] === "EN" ? "EN" : "N";
          break;
        case "NSM":
          if (i && !s) {
            for (I = E.length, S = x + 1; S < I && E[S] === "NSM"; ) S++;
            if (S < I) {
              var se = T[x], Z = se >= 1425 && se <= 2303 || se === 64286;
              if (oe = E[S], Z && (oe === "R" || oe === "AL")) {
                N = "R";
                break;
              }
            }
          }
          N = x < 1 || (oe = E[x - 1]) === "B" ? "N" : Q[x - 1];
          break;
        case "B":
          k = !1, a = !0, N = D;
          break;
        case "S":
          A = !0, N = "N";
      }
      return N;
    }, G = function(T, E, Q) {
      var x = T.split("");
      return Q && W(x, Q, { hiLevel: D }), x.reverse(), E && E.reverse(), x.join("");
    }, W = function(T, E, Q) {
      var x, oe, J, S, I, N = -1, se = T.length, Z = 0, C = [], H = D ? c : h, M = [];
      for (k = !1, a = !1, A = !1, oe = 0; oe < se; oe++) M[oe] = B(T[oe]);
      for (J = 0; J < se; J++) {
        if (I = Z, C[J] = q(T, M, C, J), x = 240 & (Z = H[I][p[C[J]]]), Z &= 15, E[J] = S = H[Z][5], x > 0) if (x === 16) {
          for (oe = N; oe < J; oe++) E[oe] = 1;
          N = -1;
        } else N = -1;
        if (H[Z][6]) N === -1 && (N = J);
        else if (N > -1) {
          for (oe = N; oe < J; oe++) E[oe] = S;
          N = -1;
        }
        M[J] === "B" && (E[J] = 0), Q.hiLevel |= S;
      }
      A && (function(te, ie, we) {
        for (var ve = 0; ve < we; ve++) if (te[ve] === "S") {
          ie[ve] = D;
          for (var le = ve - 1; le >= 0 && te[le] === "WS"; le--) ie[le] = D;
        }
      })(M, E, se);
    }, F = function(T, E, Q, x, oe) {
      if (!(oe.hiLevel < T)) {
        if (T === 1 && D === 1 && !a) return E.reverse(), void (Q && Q.reverse());
        for (var J, S, I, N, se = E.length, Z = 0; Z < se; ) {
          if (x[Z] >= T) {
            for (I = Z + 1; I < se && x[I] >= T; ) I++;
            for (N = Z, S = I - 1; N < S; N++, S--) J = E[N], E[N] = E[S], E[S] = J, Q && (J = Q[N], Q[N] = Q[S], Q[S] = J);
            Z = I;
          }
          Z++;
        }
      }
    }, Y = function(T, E, Q) {
      var x = T.split(""), oe = { hiLevel: D };
      return Q || (Q = []), W(x, Q, oe), (function(J, S, I) {
        if (I.hiLevel !== 0 && u) for (var N, se = 0; se < J.length; se++) S[se] === 1 && (N = y.indexOf(J[se])) >= 0 && (J[se] = y[N + 1]);
      })(x, Q, oe), F(2, x, E, Q, oe), F(1, x, E, Q, oe), x.join("");
    };
    return this.__bidiEngine__.doBidiReorder = function(T, E, Q) {
      if ((function(oe, J) {
        if (J) for (var S = 0; S < oe.length; S++) J[S] = S;
        s === void 0 && (s = O(oe)), l === void 0 && (l = O(oe));
      })(T, E), i || !o || l) if (i && o && s ^ l) D = s ? 1 : 0, T = G(T, E, Q);
      else if (!i && o && l) D = s ? 1 : 0, T = Y(T, E, Q), T = G(T, E);
      else if (!i || s || o || l) {
        if (i && !o && s ^ l) T = G(T, E), s ? (D = 0, T = Y(T, E, Q)) : (D = 1, T = Y(T, E, Q), T = G(T, E));
        else if (i && s && !o && l) D = 1, T = Y(T, E, Q), T = G(T, E);
        else if (!i && !o && s ^ l) {
          var x = u;
          s ? (D = 1, T = Y(T, E, Q), D = 0, u = !1, T = Y(T, E, Q), u = x) : (D = 0, T = Y(T, E, Q), T = G(T, E), D = 1, u = !1, T = Y(T, E, Q), u = x, T = G(T, E));
        }
      } else D = 0, T = Y(T, E, Q);
      else D = s ? 1 : 0, T = Y(T, E, Q);
      return T;
    }, this.__bidiEngine__.setOptions = function(T) {
      T && (i = T.isInputVisual, o = T.isOutputVisual, s = T.isInputRtl, l = T.isOutputRtl, u = T.isSymmetricSwapping);
    }, this.__bidiEngine__.setOptions(r), this.__bidiEngine__;
  };
  var t = ["BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "S", "B", "S", "WS", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "B", "B", "B", "S", "WS", "N", "N", "ET", "ET", "ET", "N", "N", "N", "N", "N", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "BN", "BN", "BN", "BN", "BN", "BN", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "CS", "N", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "L", "N", "N", "BN", "N", "N", "ET", "ET", "EN", "EN", "N", "L", "N", "N", "N", "EN", "L", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "N", "N", "N", "N", "N", "ET", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "R", "NSM", "R", "NSM", "NSM", "R", "NSM", "NSM", "R", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "AN", "AN", "AN", "AN", "AN", "AN", "N", "N", "AL", "ET", "ET", "AL", "CS", "AL", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "ET", "AN", "AN", "AL", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "NSM", "NSM", "N", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "R", "R", "N", "N", "N", "N", "R", "N", "N", "N", "N", "N", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "BN", "BN", "BN", "L", "R", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "WS", "B", "LRE", "RLE", "PDF", "LRO", "RLO", "CS", "ET", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "CS", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "WS", "BN", "BN", "BN", "BN", "BN", "N", "LRI", "RLI", "FSI", "PDI", "BN", "BN", "BN", "BN", "BN", "BN", "EN", "L", "N", "N", "EN", "EN", "EN", "EN", "EN", "EN", "ES", "ES", "N", "N", "N", "L", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "ES", "ES", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "R", "NSM", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "ES", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "N", "R", "R", "R", "R", "R", "N", "R", "N", "R", "R", "N", "R", "R", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "CS", "N", "CS", "N", "N", "CS", "N", "N", "N", "N", "N", "N", "N", "N", "N", "ET", "N", "N", "ES", "ES", "N", "N", "N", "N", "N", "ET", "ET", "N", "N", "N", "N", "N", "AL", "AL", "AL", "AL", "AL", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "N", "BN", "N", "N", "N", "ET", "ET", "ET", "N", "N", "N", "N", "N", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "N", "N", "N", "ET", "ET", "N", "N", "N", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N"], e = new n.__bidiEngine__({ isInputVisual: !0 });
  n.API.events.push(["postProcessText", function(r) {
    var a = r.text;
    r.x, r.y;
    var A = r.options || {};
    r.mutex, A.lang;
    var i = [];
    if (A.isInputVisual = typeof A.isInputVisual != "boolean" || A.isInputVisual, e.setOptions(A), Object.prototype.toString.call(a) === "[object Array]") {
      var s = 0;
      for (i = [], s = 0; s < a.length; s += 1) Object.prototype.toString.call(a[s]) === "[object Array]" ? i.push([e.doBidiReorder(a[s][0]), a[s][1], a[s][2]]) : i.push([e.doBidiReorder(a[s])]);
      r.text = i;
    } else r.text = e.doBidiReorder(a);
    e.setOptions({ isInputVisual: !0 });
  }]);
})(kr), kr.API.TTFFont = (function() {
  function n(t) {
    var e;
    if (this.rawData = t, e = this.contents = new Ro(t), this.contents.pos = 4, e.readString(4) === "ttcf") throw new Error("TTCF not supported.");
    e.pos = 0, this.parse(), this.subset = new f_(this), this.registerTTF();
  }
  return n.open = function(t) {
    return new n(t);
  }, n.prototype.parse = function() {
    return this.directory = new Z6(this.contents), this.head = new t_(this), this.name = new s_(this), this.cmap = new gC(this), this.toUnicode = {}, this.hhea = new r_(this), this.maxp = new i_(this), this.hmtx = new o_(this), this.post = new a_(this), this.os2 = new n_(this), this.loca = new d_(this), this.glyf = new l_(this), this.ascender = this.os2.exists && this.os2.ascender || this.hhea.ascender, this.decender = this.os2.exists && this.os2.decender || this.hhea.decender, this.lineGap = this.os2.exists && this.os2.lineGap || this.hhea.lineGap, this.bbox = [this.head.xMin, this.head.yMin, this.head.xMax, this.head.yMax];
  }, n.prototype.registerTTF = function() {
    var t, e, r, a, A;
    if (this.scaleFactor = 1e3 / this.head.unitsPerEm, this.bbox = (function() {
      var i, s, o, l;
      for (l = [], i = 0, s = (o = this.bbox).length; i < s; i++) t = o[i], l.push(Math.round(t * this.scaleFactor));
      return l;
    }).call(this), this.stemV = 0, this.post.exists ? (r = 255 & (a = this.post.italic_angle), 32768 & (e = a >> 16) && (e = -(1 + (65535 ^ e))), this.italicAngle = +(e + "." + r)) : this.italicAngle = 0, this.ascender = Math.round(this.ascender * this.scaleFactor), this.decender = Math.round(this.decender * this.scaleFactor), this.lineGap = Math.round(this.lineGap * this.scaleFactor), this.capHeight = this.os2.exists && this.os2.capHeight || this.ascender, this.xHeight = this.os2.exists && this.os2.xHeight || 0, this.familyClass = (this.os2.exists && this.os2.familyClass || 0) >> 8, this.isSerif = (A = this.familyClass) === 1 || A === 2 || A === 3 || A === 4 || A === 5 || A === 7, this.isScript = this.familyClass === 10, this.flags = 0, this.post.isFixedPitch && (this.flags |= 1), this.isSerif && (this.flags |= 2), this.isScript && (this.flags |= 8), this.italicAngle !== 0 && (this.flags |= 64), this.flags |= 32, !this.cmap.unicode) throw new Error("No unicode cmap for font");
  }, n.prototype.characterToGlyph = function(t) {
    var e;
    return ((e = this.cmap.unicode) != null ? e.codeMap[t] : void 0) || 0;
  }, n.prototype.widthOfGlyph = function(t) {
    var e;
    return e = 1e3 / this.head.unitsPerEm, this.hmtx.forGlyph(t).advance * e;
  }, n.prototype.widthOfString = function(t, e, r) {
    var a, A, i, s;
    for (i = 0, A = 0, s = (t = "" + t).length; 0 <= s ? A < s : A > s; A = 0 <= s ? ++A : --A) a = t.charCodeAt(A), i += this.widthOfGlyph(this.characterToGlyph(a)) + r * (1e3 / e) || 0;
    return i * (e / 1e3);
  }, n.prototype.lineHeight = function(t, e) {
    var r;
    return e == null && (e = !1), r = e ? this.lineGap : 0, (this.ascender + r - this.decender) / 1e3 * t;
  }, n;
})();
var pi, Ro = (function() {
  function n(t) {
    this.data = t ?? [], this.pos = 0, this.length = this.data.length;
  }
  return n.prototype.readByte = function() {
    return this.data[this.pos++];
  }, n.prototype.writeByte = function(t) {
    return this.data[this.pos++] = t;
  }, n.prototype.readUInt32 = function() {
    return 16777216 * this.readByte() + (this.readByte() << 16) + (this.readByte() << 8) + this.readByte();
  }, n.prototype.writeUInt32 = function(t) {
    return this.writeByte(t >>> 24 & 255), this.writeByte(t >> 16 & 255), this.writeByte(t >> 8 & 255), this.writeByte(255 & t);
  }, n.prototype.readInt32 = function() {
    var t;
    return (t = this.readUInt32()) >= 2147483648 ? t - 4294967296 : t;
  }, n.prototype.writeInt32 = function(t) {
    return t < 0 && (t += 4294967296), this.writeUInt32(t);
  }, n.prototype.readUInt16 = function() {
    return this.readByte() << 8 | this.readByte();
  }, n.prototype.writeUInt16 = function(t) {
    return this.writeByte(t >> 8 & 255), this.writeByte(255 & t);
  }, n.prototype.readInt16 = function() {
    var t;
    return (t = this.readUInt16()) >= 32768 ? t - 65536 : t;
  }, n.prototype.writeInt16 = function(t) {
    return t < 0 && (t += 65536), this.writeUInt16(t);
  }, n.prototype.readString = function(t) {
    var e, r;
    for (r = [], e = 0; 0 <= t ? e < t : e > t; e = 0 <= t ? ++e : --e) r[e] = String.fromCharCode(this.readByte());
    return r.join("");
  }, n.prototype.writeString = function(t) {
    var e, r, a;
    for (a = [], e = 0, r = t.length; 0 <= r ? e < r : e > r; e = 0 <= r ? ++e : --e) a.push(this.writeByte(t.charCodeAt(e)));
    return a;
  }, n.prototype.readShort = function() {
    return this.readInt16();
  }, n.prototype.writeShort = function(t) {
    return this.writeInt16(t);
  }, n.prototype.readLongLong = function() {
    var t, e, r, a, A, i, s, o;
    return t = this.readByte(), e = this.readByte(), r = this.readByte(), a = this.readByte(), A = this.readByte(), i = this.readByte(), s = this.readByte(), o = this.readByte(), 128 & t ? -1 * (72057594037927940 * (255 ^ t) + 281474976710656 * (255 ^ e) + 1099511627776 * (255 ^ r) + 4294967296 * (255 ^ a) + 16777216 * (255 ^ A) + 65536 * (255 ^ i) + 256 * (255 ^ s) + (255 ^ o) + 1) : 72057594037927940 * t + 281474976710656 * e + 1099511627776 * r + 4294967296 * a + 16777216 * A + 65536 * i + 256 * s + o;
  }, n.prototype.writeLongLong = function(t) {
    var e, r;
    return e = Math.floor(t / 4294967296), r = 4294967295 & t, this.writeByte(e >> 24 & 255), this.writeByte(e >> 16 & 255), this.writeByte(e >> 8 & 255), this.writeByte(255 & e), this.writeByte(r >> 24 & 255), this.writeByte(r >> 16 & 255), this.writeByte(r >> 8 & 255), this.writeByte(255 & r);
  }, n.prototype.readInt = function() {
    return this.readInt32();
  }, n.prototype.writeInt = function(t) {
    return this.writeInt32(t);
  }, n.prototype.read = function(t) {
    var e, r;
    for (e = [], r = 0; 0 <= t ? r < t : r > t; r = 0 <= t ? ++r : --r) e.push(this.readByte());
    return e;
  }, n.prototype.write = function(t) {
    var e, r, a, A;
    for (A = [], r = 0, a = t.length; r < a; r++) e = t[r], A.push(this.writeByte(e));
    return A;
  }, n;
})(), Z6 = (function() {
  var n;
  function t(e) {
    var r, a, A;
    for (this.scalarType = e.readInt(), this.tableCount = e.readShort(), this.searchRange = e.readShort(), this.entrySelector = e.readShort(), this.rangeShift = e.readShort(), this.tables = {}, a = 0, A = this.tableCount; 0 <= A ? a < A : a > A; a = 0 <= A ? ++a : --a) r = { tag: e.readString(4), checksum: e.readInt(), offset: e.readInt(), length: e.readInt() }, this.tables[r.tag] = r;
  }
  return t.prototype.encode = function(e) {
    var r, a, A, i, s, o, l, u, f, h, c, p, w;
    for (w in c = Object.keys(e).length, o = Math.log(2), f = 16 * Math.floor(Math.log(c) / o), i = Math.floor(f / o), u = 16 * c - f, (a = new Ro()).writeInt(this.scalarType), a.writeShort(c), a.writeShort(f), a.writeShort(i), a.writeShort(u), A = 16 * c, l = a.pos + A, s = null, p = [], e) for (h = e[w], a.writeString(w), a.writeInt(n(h)), a.writeInt(l), a.writeInt(h.length), p = p.concat(h), w === "head" && (s = l), l += h.length; l % 4; ) p.push(0), l++;
    return a.write(p), r = 2981146554 - n(a.data), a.pos = s + 8, a.writeUInt32(r), a.data;
  }, n = function(e) {
    var r, a, A, i;
    for (e = vC.call(e); e.length % 4; ) e.push(0);
    for (A = new Ro(e), a = 0, r = 0, i = e.length; r < i; r = r += 4) a += A.readUInt32();
    return 4294967295 & a;
  }, t;
})(), e_ = {}.hasOwnProperty, _i = function(n, t) {
  for (var e in t) e_.call(t, e) && (n[e] = t[e]);
  function r() {
    this.constructor = n;
  }
  return r.prototype = t.prototype, n.prototype = new r(), n.__super__ = t.prototype, n;
};
pi = (function() {
  function n(t) {
    var e;
    this.file = t, e = this.file.directory.tables[this.tag], this.exists = !!e, e && (this.offset = e.offset, this.length = e.length, this.parse(this.file.contents));
  }
  return n.prototype.parse = function() {
  }, n.prototype.encode = function() {
  }, n.prototype.raw = function() {
    return this.exists ? (this.file.contents.pos = this.offset, this.file.contents.read(this.length)) : null;
  }, n;
})();
var t_ = (function() {
  function n() {
    return n.__super__.constructor.apply(this, arguments);
  }
  return _i(n, pi), n.prototype.tag = "head", n.prototype.parse = function(t) {
    return t.pos = this.offset, this.version = t.readInt(), this.revision = t.readInt(), this.checkSumAdjustment = t.readInt(), this.magicNumber = t.readInt(), this.flags = t.readShort(), this.unitsPerEm = t.readShort(), this.created = t.readLongLong(), this.modified = t.readLongLong(), this.xMin = t.readShort(), this.yMin = t.readShort(), this.xMax = t.readShort(), this.yMax = t.readShort(), this.macStyle = t.readShort(), this.lowestRecPPEM = t.readShort(), this.fontDirectionHint = t.readShort(), this.indexToLocFormat = t.readShort(), this.glyphDataFormat = t.readShort();
  }, n.prototype.encode = function(t) {
    var e;
    return (e = new Ro()).writeInt(this.version), e.writeInt(this.revision), e.writeInt(this.checkSumAdjustment), e.writeInt(this.magicNumber), e.writeShort(this.flags), e.writeShort(this.unitsPerEm), e.writeLongLong(this.created), e.writeLongLong(this.modified), e.writeShort(this.xMin), e.writeShort(this.yMin), e.writeShort(this.xMax), e.writeShort(this.yMax), e.writeShort(this.macStyle), e.writeShort(this.lowestRecPPEM), e.writeShort(this.fontDirectionHint), e.writeShort(t), e.writeShort(this.glyphDataFormat), e.data;
  }, n;
})(), uw = (function() {
  function n(t, e) {
    var r, a, A, i, s, o, l, u, f, h, c, p, w, y, m, k, D;
    switch (this.platformID = t.readUInt16(), this.encodingID = t.readShort(), this.offset = e + t.readInt(), f = t.pos, t.pos = this.offset, this.format = t.readUInt16(), this.length = t.readUInt16(), this.language = t.readUInt16(), this.isUnicode = this.platformID === 3 && this.encodingID === 1 && this.format === 4 || this.platformID === 0 && this.format === 4, this.codeMap = {}, this.format) {
      case 0:
        for (o = 0; o < 256; ++o) this.codeMap[o] = t.readByte();
        break;
      case 4:
        for (c = t.readUInt16(), h = c / 2, t.pos += 6, A = (function() {
          var B, O;
          for (O = [], o = B = 0; 0 <= h ? B < h : B > h; o = 0 <= h ? ++B : --B) O.push(t.readUInt16());
          return O;
        })(), t.pos += 2, w = (function() {
          var B, O;
          for (O = [], o = B = 0; 0 <= h ? B < h : B > h; o = 0 <= h ? ++B : --B) O.push(t.readUInt16());
          return O;
        })(), l = (function() {
          var B, O;
          for (O = [], o = B = 0; 0 <= h ? B < h : B > h; o = 0 <= h ? ++B : --B) O.push(t.readUInt16());
          return O;
        })(), u = (function() {
          var B, O;
          for (O = [], o = B = 0; 0 <= h ? B < h : B > h; o = 0 <= h ? ++B : --B) O.push(t.readUInt16());
          return O;
        })(), a = (this.length - t.pos + this.offset) / 2, s = (function() {
          var B, O;
          for (O = [], o = B = 0; 0 <= a ? B < a : B > a; o = 0 <= a ? ++B : --B) O.push(t.readUInt16());
          return O;
        })(), o = m = 0, D = A.length; m < D; o = ++m) for (y = A[o], r = k = p = w[o]; p <= y ? k <= y : k >= y; r = p <= y ? ++k : --k) u[o] === 0 ? i = r + l[o] : (i = s[u[o] / 2 + (r - p) - (h - o)] || 0) !== 0 && (i += l[o]), this.codeMap[r] = 65535 & i;
    }
    t.pos = f;
  }
  return n.encode = function(t, e) {
    var r, a, A, i, s, o, l, u, f, h, c, p, w, y, m, k, D, B, O, q, G, W, F, Y, T, E, Q, x, oe, J, S, I, N, se, Z, C, H, M, te, ie, we, ve, le, _e, De, ze;
    switch (x = new Ro(), i = Object.keys(t).sort(function(nt, Qe) {
      return nt - Qe;
    }), e) {
      case "macroman":
        for (w = 0, y = (function() {
          var nt = [];
          for (p = 0; p < 256; ++p) nt.push(0);
          return nt;
        })(), k = { 0: 0 }, A = {}, oe = 0, N = i.length; oe < N; oe++) k[le = t[a = i[oe]]] == null && (k[le] = ++w), A[a] = { old: t[a], new: k[t[a]] }, y[a] = k[t[a]];
        return x.writeUInt16(1), x.writeUInt16(0), x.writeUInt32(12), x.writeUInt16(0), x.writeUInt16(262), x.writeUInt16(0), x.write(y), { charMap: A, subtable: x.data, maxGlyphID: w + 1 };
      case "unicode":
        for (E = [], f = [], D = 0, k = {}, r = {}, m = l = null, J = 0, se = i.length; J < se; J++) k[O = t[a = i[J]]] == null && (k[O] = ++D), r[a] = { old: O, new: k[O] }, s = k[O] - a, m != null && s === l || (m && f.push(m), E.push(a), l = s), m = a;
        for (m && f.push(m), f.push(65535), E.push(65535), Y = 2 * (F = E.length), W = 2 * Math.pow(Math.log(F) / Math.LN2, 2), h = Math.log(W / 2) / Math.LN2, G = 2 * F - W, o = [], q = [], c = [], p = S = 0, Z = E.length; S < Z; p = ++S) {
          if (T = E[p], u = f[p], T === 65535) {
            o.push(0), q.push(0);
            break;
          }
          if (T - (Q = r[T].new) >= 32768) for (o.push(0), q.push(2 * (c.length + F - p)), a = I = T; T <= u ? I <= u : I >= u; a = T <= u ? ++I : --I) c.push(r[a].new);
          else o.push(Q - T), q.push(0);
        }
        for (x.writeUInt16(3), x.writeUInt16(1), x.writeUInt32(12), x.writeUInt16(4), x.writeUInt16(16 + 8 * F + 2 * c.length), x.writeUInt16(0), x.writeUInt16(Y), x.writeUInt16(W), x.writeUInt16(h), x.writeUInt16(G), we = 0, C = f.length; we < C; we++) a = f[we], x.writeUInt16(a);
        for (x.writeUInt16(0), ve = 0, H = E.length; ve < H; ve++) a = E[ve], x.writeUInt16(a);
        for (_e = 0, M = o.length; _e < M; _e++) s = o[_e], x.writeUInt16(s);
        for (De = 0, te = q.length; De < te; De++) B = q[De], x.writeUInt16(B);
        for (ze = 0, ie = c.length; ze < ie; ze++) w = c[ze], x.writeUInt16(w);
        return { charMap: r, subtable: x.data, maxGlyphID: D + 1 };
    }
  }, n;
})(), gC = (function() {
  function n() {
    return n.__super__.constructor.apply(this, arguments);
  }
  return _i(n, pi), n.prototype.tag = "cmap", n.prototype.parse = function(t) {
    var e, r, a;
    for (t.pos = this.offset, this.version = t.readUInt16(), a = t.readUInt16(), this.tables = [], this.unicode = null, r = 0; 0 <= a ? r < a : r > a; r = 0 <= a ? ++r : --r) e = new uw(t, this.offset), this.tables.push(e), e.isUnicode && this.unicode == null && (this.unicode = e);
    return !0;
  }, n.encode = function(t, e) {
    var r, a;
    return e == null && (e = "macroman"), r = uw.encode(t, e), (a = new Ro()).writeUInt16(0), a.writeUInt16(1), r.table = a.data.concat(r.subtable), r;
  }, n;
})(), r_ = (function() {
  function n() {
    return n.__super__.constructor.apply(this, arguments);
  }
  return _i(n, pi), n.prototype.tag = "hhea", n.prototype.parse = function(t) {
    return t.pos = this.offset, this.version = t.readInt(), this.ascender = t.readShort(), this.decender = t.readShort(), this.lineGap = t.readShort(), this.advanceWidthMax = t.readShort(), this.minLeftSideBearing = t.readShort(), this.minRightSideBearing = t.readShort(), this.xMaxExtent = t.readShort(), this.caretSlopeRise = t.readShort(), this.caretSlopeRun = t.readShort(), this.caretOffset = t.readShort(), t.pos += 8, this.metricDataFormat = t.readShort(), this.numberOfMetrics = t.readUInt16();
  }, n;
})(), n_ = (function() {
  function n() {
    return n.__super__.constructor.apply(this, arguments);
  }
  return _i(n, pi), n.prototype.tag = "OS/2", n.prototype.parse = function(t) {
    if (t.pos = this.offset, this.version = t.readUInt16(), this.averageCharWidth = t.readShort(), this.weightClass = t.readUInt16(), this.widthClass = t.readUInt16(), this.type = t.readShort(), this.ySubscriptXSize = t.readShort(), this.ySubscriptYSize = t.readShort(), this.ySubscriptXOffset = t.readShort(), this.ySubscriptYOffset = t.readShort(), this.ySuperscriptXSize = t.readShort(), this.ySuperscriptYSize = t.readShort(), this.ySuperscriptXOffset = t.readShort(), this.ySuperscriptYOffset = t.readShort(), this.yStrikeoutSize = t.readShort(), this.yStrikeoutPosition = t.readShort(), this.familyClass = t.readShort(), this.panose = (function() {
      var e, r;
      for (r = [], e = 0; e < 10; ++e) r.push(t.readByte());
      return r;
    })(), this.charRange = (function() {
      var e, r;
      for (r = [], e = 0; e < 4; ++e) r.push(t.readInt());
      return r;
    })(), this.vendorID = t.readString(4), this.selection = t.readShort(), this.firstCharIndex = t.readShort(), this.lastCharIndex = t.readShort(), this.version > 0 && (this.ascent = t.readShort(), this.descent = t.readShort(), this.lineGap = t.readShort(), this.winAscent = t.readShort(), this.winDescent = t.readShort(), this.codePageRange = (function() {
      var e, r;
      for (r = [], e = 0; e < 2; e = ++e) r.push(t.readInt());
      return r;
    })(), this.version > 1)) return this.xHeight = t.readShort(), this.capHeight = t.readShort(), this.defaultChar = t.readShort(), this.breakChar = t.readShort(), this.maxContext = t.readShort();
  }, n;
})(), a_ = (function() {
  function n() {
    return n.__super__.constructor.apply(this, arguments);
  }
  return _i(n, pi), n.prototype.tag = "post", n.prototype.parse = function(t) {
    var e, r, a;
    switch (t.pos = this.offset, this.format = t.readInt(), this.italicAngle = t.readInt(), this.underlinePosition = t.readShort(), this.underlineThickness = t.readShort(), this.isFixedPitch = t.readInt(), this.minMemType42 = t.readInt(), this.maxMemType42 = t.readInt(), this.minMemType1 = t.readInt(), this.maxMemType1 = t.readInt(), this.format) {
      case 65536:
      case 196608:
        break;
      case 131072:
        var A;
        for (r = t.readUInt16(), this.glyphNameIndex = [], A = 0; 0 <= r ? A < r : A > r; A = 0 <= r ? ++A : --A) this.glyphNameIndex.push(t.readUInt16());
        for (this.names = [], a = []; t.pos < this.offset + this.length; ) e = t.readByte(), a.push(this.names.push(t.readString(e)));
        return a;
      case 151552:
        return r = t.readUInt16(), this.offsets = t.read(r);
      case 262144:
        return this.map = (function() {
          var i, s, o;
          for (o = [], A = i = 0, s = this.file.maxp.numGlyphs; 0 <= s ? i < s : i > s; A = 0 <= s ? ++i : --i) o.push(t.readUInt32());
          return o;
        }).call(this);
    }
  }, n;
})(), A_ = function(n, t) {
  this.raw = n, this.length = n.length, this.platformID = t.platformID, this.encodingID = t.encodingID, this.languageID = t.languageID;
}, s_ = (function() {
  function n() {
    return n.__super__.constructor.apply(this, arguments);
  }
  return _i(n, pi), n.prototype.tag = "name", n.prototype.parse = function(t) {
    var e, r, a, A, i, s, o, l, u, f, h;
    for (t.pos = this.offset, t.readShort(), e = t.readShort(), s = t.readShort(), r = [], A = 0; 0 <= e ? A < e : A > e; A = 0 <= e ? ++A : --A) r.push({ platformID: t.readShort(), encodingID: t.readShort(), languageID: t.readShort(), nameID: t.readShort(), length: t.readShort(), offset: this.offset + s + t.readShort() });
    for (o = {}, A = u = 0, f = r.length; u < f; A = ++u) a = r[A], t.pos = a.offset, l = t.readString(a.length), i = new A_(l, a), o[h = a.nameID] == null && (o[h] = []), o[a.nameID].push(i);
    this.strings = o, this.copyright = o[0], this.fontFamily = o[1], this.fontSubfamily = o[2], this.uniqueSubfamily = o[3], this.fontName = o[4], this.version = o[5];
    try {
      this.postscriptName = o[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g, "");
    } catch {
      this.postscriptName = o[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g, "");
    }
    return this.trademark = o[7], this.manufacturer = o[8], this.designer = o[9], this.description = o[10], this.vendorUrl = o[11], this.designerUrl = o[12], this.license = o[13], this.licenseUrl = o[14], this.preferredFamily = o[15], this.preferredSubfamily = o[17], this.compatibleFull = o[18], this.sampleText = o[19];
  }, n;
})(), i_ = (function() {
  function n() {
    return n.__super__.constructor.apply(this, arguments);
  }
  return _i(n, pi), n.prototype.tag = "maxp", n.prototype.parse = function(t) {
    return t.pos = this.offset, this.version = t.readInt(), this.numGlyphs = t.readUInt16(), this.maxPoints = t.readUInt16(), this.maxContours = t.readUInt16(), this.maxCompositePoints = t.readUInt16(), this.maxComponentContours = t.readUInt16(), this.maxZones = t.readUInt16(), this.maxTwilightPoints = t.readUInt16(), this.maxStorage = t.readUInt16(), this.maxFunctionDefs = t.readUInt16(), this.maxInstructionDefs = t.readUInt16(), this.maxStackElements = t.readUInt16(), this.maxSizeOfInstructions = t.readUInt16(), this.maxComponentElements = t.readUInt16(), this.maxComponentDepth = t.readUInt16();
  }, n;
})(), o_ = (function() {
  function n() {
    return n.__super__.constructor.apply(this, arguments);
  }
  return _i(n, pi), n.prototype.tag = "hmtx", n.prototype.parse = function(t) {
    var e, r, a, A, i, s, o;
    for (t.pos = this.offset, this.metrics = [], e = 0, s = this.file.hhea.numberOfMetrics; 0 <= s ? e < s : e > s; e = 0 <= s ? ++e : --e) this.metrics.push({ advance: t.readUInt16(), lsb: t.readInt16() });
    for (a = this.file.maxp.numGlyphs - this.file.hhea.numberOfMetrics, this.leftSideBearings = (function() {
      var l, u;
      for (u = [], e = l = 0; 0 <= a ? l < a : l > a; e = 0 <= a ? ++l : --l) u.push(t.readInt16());
      return u;
    })(), this.widths = (function() {
      var l, u, f, h;
      for (h = [], l = 0, u = (f = this.metrics).length; l < u; l++) A = f[l], h.push(A.advance);
      return h;
    }).call(this), r = this.widths[this.widths.length - 1], o = [], e = i = 0; 0 <= a ? i < a : i > a; e = 0 <= a ? ++i : --i) o.push(this.widths.push(r));
    return o;
  }, n.prototype.forGlyph = function(t) {
    return t in this.metrics ? this.metrics[t] : { advance: this.metrics[this.metrics.length - 1].advance, lsb: this.leftSideBearings[t - this.metrics.length] };
  }, n;
})(), vC = [].slice, l_ = (function() {
  function n() {
    return n.__super__.constructor.apply(this, arguments);
  }
  return _i(n, pi), n.prototype.tag = "glyf", n.prototype.parse = function() {
    return this.cache = {};
  }, n.prototype.glyphFor = function(t) {
    var e, r, a, A, i, s, o, l, u, f;
    return t in this.cache ? this.cache[t] : (A = this.file.loca, e = this.file.contents, r = A.indexOf(t), (a = A.lengthOf(t)) === 0 ? this.cache[t] = null : (e.pos = this.offset + r, i = (s = new Ro(e.read(a))).readShort(), l = s.readShort(), f = s.readShort(), o = s.readShort(), u = s.readShort(), this.cache[t] = i === -1 ? new c_(s, l, f, o, u) : new u_(s, i, l, f, o, u), this.cache[t]));
  }, n.prototype.encode = function(t, e, r) {
    var a, A, i, s, o;
    for (i = [], A = [], s = 0, o = e.length; s < o; s++) a = t[e[s]], A.push(i.length), a && (i = i.concat(a.encode(r)));
    return A.push(i.length), { table: i, offsets: A };
  }, n;
})(), u_ = (function() {
  function n(t, e, r, a, A, i) {
    this.raw = t, this.numberOfContours = e, this.xMin = r, this.yMin = a, this.xMax = A, this.yMax = i, this.compound = !1;
  }
  return n.prototype.encode = function() {
    return this.raw.data;
  }, n;
})(), c_ = (function() {
  function n(t, e, r, a, A) {
    var i, s;
    for (this.raw = t, this.xMin = e, this.yMin = r, this.xMax = a, this.yMax = A, this.compound = !0, this.glyphIDs = [], this.glyphOffsets = [], i = this.raw; s = i.readShort(), this.glyphOffsets.push(i.pos), this.glyphIDs.push(i.readUInt16()), 32 & s; ) i.pos += 1 & s ? 4 : 2, 128 & s ? i.pos += 8 : 64 & s ? i.pos += 4 : 8 & s && (i.pos += 2);
  }
  return n.prototype.encode = function() {
    var t, e, r;
    for (e = new Ro(vC.call(this.raw.data)), t = 0, r = this.glyphIDs.length; t < r; ++t) e.pos = this.glyphOffsets[t];
    return e.data;
  }, n;
})(), d_ = (function() {
  function n() {
    return n.__super__.constructor.apply(this, arguments);
  }
  return _i(n, pi), n.prototype.tag = "loca", n.prototype.parse = function(t) {
    var e, r;
    return t.pos = this.offset, e = this.file.head.indexToLocFormat, this.offsets = e === 0 ? (function() {
      var a, A;
      for (A = [], r = 0, a = this.length; r < a; r += 2) A.push(2 * t.readUInt16());
      return A;
    }).call(this) : (function() {
      var a, A;
      for (A = [], r = 0, a = this.length; r < a; r += 4) A.push(t.readUInt32());
      return A;
    }).call(this);
  }, n.prototype.indexOf = function(t) {
    return this.offsets[t];
  }, n.prototype.lengthOf = function(t) {
    return this.offsets[t + 1] - this.offsets[t];
  }, n.prototype.encode = function(t, e) {
    for (var r = new Uint32Array(this.offsets.length), a = 0, A = 0, i = 0; i < r.length; ++i) if (r[i] = a, A < e.length && e[A] == i) {
      ++A, r[i] = a;
      var s = this.offsets[i], o = this.offsets[i + 1] - s;
      o > 0 && (a += o);
    }
    for (var l = new Array(4 * r.length), u = 0; u < r.length; ++u) l[4 * u + 3] = 255 & r[u], l[4 * u + 2] = (65280 & r[u]) >> 8, l[4 * u + 1] = (16711680 & r[u]) >> 16, l[4 * u] = (4278190080 & r[u]) >> 24;
    return l;
  }, n;
})(), f_ = (function() {
  function n(t) {
    this.font = t, this.subset = {}, this.unicodes = {}, this.next = 33;
  }
  return n.prototype.generateCmap = function() {
    var t, e, r, a, A;
    for (e in a = this.font.cmap.tables[0].codeMap, t = {}, A = this.subset) r = A[e], t[e] = a[r];
    return t;
  }, n.prototype.glyphsFor = function(t) {
    var e, r, a, A, i, s, o;
    for (a = {}, i = 0, s = t.length; i < s; i++) a[A = t[i]] = this.font.glyf.glyphFor(A);
    for (A in e = [], a) (r = a[A]) != null && r.compound && e.push.apply(e, r.glyphIDs);
    if (e.length > 0) for (A in o = this.glyphsFor(e)) r = o[A], a[A] = r;
    return a;
  }, n.prototype.encode = function(t, e) {
    var r, a, A, i, s, o, l, u, f, h, c, p, w, y, m;
    for (a in r = gC.encode(this.generateCmap(), "unicode"), i = this.glyphsFor(t), c = { 0: 0 }, m = r.charMap) c[(o = m[a]).old] = o.new;
    for (p in h = r.maxGlyphID, i) p in c || (c[p] = h++);
    return u = (function(k) {
      var D, B;
      for (D in B = {}, k) B[k[D]] = D;
      return B;
    })(c), f = Object.keys(u).sort(function(k, D) {
      return k - D;
    }), w = (function() {
      var k, D, B;
      for (B = [], k = 0, D = f.length; k < D; k++) s = f[k], B.push(u[s]);
      return B;
    })(), A = this.font.glyf.encode(i, w, c), l = this.font.loca.encode(A.offsets, w), y = { cmap: this.font.cmap.raw(), glyf: A.table, loca: l, hmtx: this.font.hmtx.raw(), hhea: this.font.hhea.raw(), maxp: this.font.maxp.raw(), post: this.font.post.raw(), name: this.font.name.raw(), head: this.font.head.encode(e) }, this.font.os2.exists && (y["OS/2"] = this.font.os2.raw()), this.font.directory.encode(y);
  }, n;
})();
kr.API.PDFObject = (function() {
  var n;
  function t() {
  }
  return n = function(e, r) {
    return (Array(r + 1).join("0") + e).slice(-r);
  }, t.convert = function(e) {
    var r, a, A, i;
    if (Array.isArray(e)) return "[" + (function() {
      var s, o, l;
      for (l = [], s = 0, o = e.length; s < o; s++) r = e[s], l.push(t.convert(r));
      return l;
    })().join(" ") + "]";
    if (typeof e == "string") return "/" + e;
    if (e != null && e.isString) return "(" + e + ")";
    if (e instanceof Date) return "(D:" + n(e.getUTCFullYear(), 4) + n(e.getUTCMonth(), 2) + n(e.getUTCDate(), 2) + n(e.getUTCHours(), 2) + n(e.getUTCMinutes(), 2) + n(e.getUTCSeconds(), 2) + "Z)";
    if ({}.toString.call(e) === "[object Object]") {
      for (a in A = ["<<"], e) i = e[a], A.push("/" + a + " " + t.convert(i));
      return A.push(">>"), A.join(`
`);
    }
    return "" + e;
  }, t;
})();
/*!
 * html2canvas 1.4.1 <https://html2canvas.hertzen.com>
 * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
 * Released under MIT License
 */
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var xp = function(n, t) {
  return xp = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
    e.__proto__ = r;
  } || function(e, r) {
    for (var a in r) Object.prototype.hasOwnProperty.call(r, a) && (e[a] = r[a]);
  }, xp(n, t);
};
function mi(n, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
  xp(n, t);
  function e() {
    this.constructor = n;
  }
  n.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());
}
var Dp = function() {
  return Dp = Object.assign || function(t) {
    for (var e, r = 1, a = arguments.length; r < a; r++) {
      e = arguments[r];
      for (var A in e) Object.prototype.hasOwnProperty.call(e, A) && (t[A] = e[A]);
    }
    return t;
  }, Dp.apply(this, arguments);
};
function ls(n, t, e, r) {
  function a(A) {
    return A instanceof e ? A : new e(function(i) {
      i(A);
    });
  }
  return new (e || (e = Promise))(function(A, i) {
    function s(u) {
      try {
        l(r.next(u));
      } catch (f) {
        i(f);
      }
    }
    function o(u) {
      try {
        l(r.throw(u));
      } catch (f) {
        i(f);
      }
    }
    function l(u) {
      u.done ? A(u.value) : a(u.value).then(s, o);
    }
    l((r = r.apply(n, [])).next());
  });
}
function GA(n, t) {
  var e = { label: 0, sent: function() {
    if (A[0] & 1) throw A[1];
    return A[1];
  }, trys: [], ops: [] }, r, a, A, i;
  return i = { next: s(0), throw: s(1), return: s(2) }, typeof Symbol == "function" && (i[Symbol.iterator] = function() {
    return this;
  }), i;
  function s(l) {
    return function(u) {
      return o([l, u]);
    };
  }
  function o(l) {
    if (r) throw new TypeError("Generator is already executing.");
    for (; e; ) try {
      if (r = 1, a && (A = l[0] & 2 ? a.return : l[0] ? a.throw || ((A = a.return) && A.call(a), 0) : a.next) && !(A = A.call(a, l[1])).done) return A;
      switch (a = 0, A && (l = [l[0] & 2, A.value]), l[0]) {
        case 0:
        case 1:
          A = l;
          break;
        case 4:
          return e.label++, { value: l[1], done: !1 };
        case 5:
          e.label++, a = l[1], l = [0];
          continue;
        case 7:
          l = e.ops.pop(), e.trys.pop();
          continue;
        default:
          if (A = e.trys, !(A = A.length > 0 && A[A.length - 1]) && (l[0] === 6 || l[0] === 2)) {
            e = 0;
            continue;
          }
          if (l[0] === 3 && (!A || l[1] > A[0] && l[1] < A[3])) {
            e.label = l[1];
            break;
          }
          if (l[0] === 6 && e.label < A[1]) {
            e.label = A[1], A = l;
            break;
          }
          if (A && e.label < A[2]) {
            e.label = A[2], e.ops.push(l);
            break;
          }
          A[2] && e.ops.pop(), e.trys.pop();
          continue;
      }
      l = t.call(n, e);
    } catch (u) {
      l = [6, u], a = 0;
    } finally {
      r = A = 0;
    }
    if (l[0] & 5) throw l[1];
    return { value: l[0] ? l[1] : void 0, done: !0 };
  }
}
function Oc(n, t, e) {
  if (arguments.length === 2) for (var r = 0, a = t.length, A; r < a; r++)
    (A || !(r in t)) && (A || (A = Array.prototype.slice.call(t, 0, r)), A[r] = t[r]);
  return n.concat(A || t);
}
var so = (
  /** @class */
  (function() {
    function n(t, e, r, a) {
      this.left = t, this.top = e, this.width = r, this.height = a;
    }
    return n.prototype.add = function(t, e, r, a) {
      return new n(this.left + t, this.top + e, this.width + r, this.height + a);
    }, n.fromClientRect = function(t, e) {
      return new n(e.left + t.windowBounds.left, e.top + t.windowBounds.top, e.width, e.height);
    }, n.fromDOMRectList = function(t, e) {
      var r = Array.from(e).find(function(a) {
        return a.width !== 0;
      });
      return r ? new n(r.left + t.windowBounds.left, r.top + t.windowBounds.top, r.width, r.height) : n.EMPTY;
    }, n.EMPTY = new n(0, 0, 0, 0), n;
  })()
), jd = function(n, t) {
  return so.fromClientRect(n, t.getBoundingClientRect());
}, h_ = function(n) {
  var t = n.body, e = n.documentElement;
  if (!t || !e)
    throw new Error("Unable to get document size");
  var r = Math.max(Math.max(t.scrollWidth, e.scrollWidth), Math.max(t.offsetWidth, e.offsetWidth), Math.max(t.clientWidth, e.clientWidth)), a = Math.max(Math.max(t.scrollHeight, e.scrollHeight), Math.max(t.offsetHeight, e.offsetHeight), Math.max(t.clientHeight, e.clientHeight));
  return new so(0, 0, r, a);
}, Yd = function(n) {
  for (var t = [], e = 0, r = n.length; e < r; ) {
    var a = n.charCodeAt(e++);
    if (a >= 55296 && a <= 56319 && e < r) {
      var A = n.charCodeAt(e++);
      (A & 64512) === 56320 ? t.push(((a & 1023) << 10) + (A & 1023) + 65536) : (t.push(a), e--);
    } else
      t.push(a);
  }
  return t;
}, Va = function() {
  for (var n = [], t = 0; t < arguments.length; t++)
    n[t] = arguments[t];
  if (String.fromCodePoint)
    return String.fromCodePoint.apply(String, n);
  var e = n.length;
  if (!e)
    return "";
  for (var r = [], a = -1, A = ""; ++a < e; ) {
    var i = n[a];
    i <= 65535 ? r.push(i) : (i -= 65536, r.push((i >> 10) + 55296, i % 1024 + 56320)), (a + 1 === e || r.length > 16384) && (A += String.fromCharCode.apply(String, r), r.length = 0);
  }
  return A;
}, cw = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", g_ = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
for (var Pc = 0; Pc < cw.length; Pc++)
  g_[cw.charCodeAt(Pc)] = Pc;
var dw = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Du = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
for (var Wc = 0; Wc < dw.length; Wc++)
  Du[dw.charCodeAt(Wc)] = Wc;
var v_ = function(n) {
  var t = n.length * 0.75, e = n.length, r, a = 0, A, i, s, o;
  n[n.length - 1] === "=" && (t--, n[n.length - 2] === "=" && t--);
  var l = typeof ArrayBuffer < "u" && typeof Uint8Array < "u" && typeof Uint8Array.prototype.slice < "u" ? new ArrayBuffer(t) : new Array(t), u = Array.isArray(l) ? l : new Uint8Array(l);
  for (r = 0; r < e; r += 4)
    A = Du[n.charCodeAt(r)], i = Du[n.charCodeAt(r + 1)], s = Du[n.charCodeAt(r + 2)], o = Du[n.charCodeAt(r + 3)], u[a++] = A << 2 | i >> 4, u[a++] = (i & 15) << 4 | s >> 2, u[a++] = (s & 3) << 6 | o & 63;
  return l;
}, p_ = function(n) {
  for (var t = n.length, e = [], r = 0; r < t; r += 2)
    e.push(n[r + 1] << 8 | n[r]);
  return e;
}, m_ = function(n) {
  for (var t = n.length, e = [], r = 0; r < t; r += 4)
    e.push(n[r + 3] << 24 | n[r + 2] << 16 | n[r + 1] << 8 | n[r]);
  return e;
}, sl = 5, k0 = 11, Zf = 2, w_ = k0 - sl, pC = 65536 >> sl, y_ = 1 << sl, eh = y_ - 1, B_ = 1024 >> sl, b_ = pC + B_, C_ = b_, k_ = 32, T_ = C_ + k_, x_ = 65536 >> k0, D_ = 1 << w_, E_ = D_ - 1, fw = function(n, t, e) {
  return n.slice ? n.slice(t, e) : new Uint16Array(Array.prototype.slice.call(n, t, e));
}, S_ = function(n, t, e) {
  return n.slice ? n.slice(t, e) : new Uint32Array(Array.prototype.slice.call(n, t, e));
}, F_ = function(n, t) {
  var e = v_(n), r = Array.isArray(e) ? m_(e) : new Uint32Array(e), a = Array.isArray(e) ? p_(e) : new Uint16Array(e), A = 24, i = fw(a, A / 2, r[4] / 2), s = r[5] === 2 ? fw(a, (A + r[4]) / 2) : S_(r, Math.ceil((A + r[4]) / 4));
  return new U_(r[0], r[1], r[2], r[3], i, s);
}, U_ = (
  /** @class */
  (function() {
    function n(t, e, r, a, A, i) {
      this.initialValue = t, this.errorValue = e, this.highStart = r, this.highValueIndex = a, this.index = A, this.data = i;
    }
    return n.prototype.get = function(t) {
      var e;
      if (t >= 0) {
        if (t < 55296 || t > 56319 && t <= 65535)
          return e = this.index[t >> sl], e = (e << Zf) + (t & eh), this.data[e];
        if (t <= 65535)
          return e = this.index[pC + (t - 55296 >> sl)], e = (e << Zf) + (t & eh), this.data[e];
        if (t < this.highStart)
          return e = T_ - x_ + (t >> k0), e = this.index[e], e += t >> sl & E_, e = this.index[e], e = (e << Zf) + (t & eh), this.data[e];
        if (t <= 1114111)
          return this.data[this.highValueIndex];
      }
      return this.errorValue;
    }, n;
  })()
), hw = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", L_ = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
for (var Kc = 0; Kc < hw.length; Kc++)
  L_[hw.charCodeAt(Kc)] = Kc;
var I_ = "KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==", gw = 50, Q_ = 1, mC = 2, wC = 3, M_ = 4, __ = 5, vw = 7, yC = 8, pw = 9, Lo = 10, Ep = 11, mw = 12, Sp = 13, R_ = 14, Eu = 15, Fp = 16, $c = 17, mu = 18, N_ = 19, ww = 20, Up = 21, wu = 22, th = 23, Tl = 24, Rs = 25, Su = 26, Fu = 27, xl = 28, H_ = 29, tl = 30, O_ = 31, Vc = 32, qc = 33, Lp = 34, Ip = 35, Qp = 36, ju = 37, Mp = 38, bd = 39, Cd = 40, rh = 41, BC = 42, P_ = 43, W_ = [9001, 65288], bC = "!", vn = "×", jc = "÷", _p = F_(I_), Xi = [tl, Qp], Rp = [Q_, mC, wC, __], CC = [Lo, yC], yw = [Fu, Su], K_ = Rp.concat(CC), Bw = [Mp, bd, Cd, Lp, Ip], $_ = [Eu, Sp], V_ = function(n, t) {
  t === void 0 && (t = "strict");
  var e = [], r = [], a = [];
  return n.forEach(function(A, i) {
    var s = _p.get(A);
    if (s > gw ? (a.push(!0), s -= gw) : a.push(!1), ["normal", "auto", "loose"].indexOf(t) !== -1 && [8208, 8211, 12316, 12448].indexOf(A) !== -1)
      return r.push(i), e.push(Fp);
    if (s === M_ || s === Ep) {
      if (i === 0)
        return r.push(i), e.push(tl);
      var o = e[i - 1];
      return K_.indexOf(o) === -1 ? (r.push(r[i - 1]), e.push(o)) : (r.push(i), e.push(tl));
    }
    if (r.push(i), s === O_)
      return e.push(t === "strict" ? Up : ju);
    if (s === BC || s === H_)
      return e.push(tl);
    if (s === P_)
      return A >= 131072 && A <= 196605 || A >= 196608 && A <= 262141 ? e.push(ju) : e.push(tl);
    e.push(s);
  }), [r, e, a];
}, nh = function(n, t, e, r) {
  var a = r[e];
  if (Array.isArray(n) ? n.indexOf(a) !== -1 : n === a)
    for (var A = e; A <= r.length; ) {
      A++;
      var i = r[A];
      if (i === t)
        return !0;
      if (i !== Lo)
        break;
    }
  if (a === Lo)
    for (var A = e; A > 0; ) {
      A--;
      var s = r[A];
      if (Array.isArray(n) ? n.indexOf(s) !== -1 : n === s)
        for (var o = e; o <= r.length; ) {
          o++;
          var i = r[o];
          if (i === t)
            return !0;
          if (i !== Lo)
            break;
        }
      if (s !== Lo)
        break;
    }
  return !1;
}, bw = function(n, t) {
  for (var e = n; e >= 0; ) {
    var r = t[e];
    if (r === Lo)
      e--;
    else
      return r;
  }
  return 0;
}, q_ = function(n, t, e, r, a) {
  if (e[r] === 0)
    return vn;
  var A = r - 1;
  if (Array.isArray(a) && a[A] === !0)
    return vn;
  var i = A - 1, s = A + 1, o = t[A], l = i >= 0 ? t[i] : 0, u = t[s];
  if (o === mC && u === wC)
    return vn;
  if (Rp.indexOf(o) !== -1)
    return bC;
  if (Rp.indexOf(u) !== -1 || CC.indexOf(u) !== -1)
    return vn;
  if (bw(A, t) === yC)
    return jc;
  if (_p.get(n[A]) === Ep || (o === Vc || o === qc) && _p.get(n[s]) === Ep || o === vw || u === vw || o === pw || [Lo, Sp, Eu].indexOf(o) === -1 && u === pw || [$c, mu, N_, Tl, xl].indexOf(u) !== -1 || bw(A, t) === wu || nh(th, wu, A, t) || nh([$c, mu], Up, A, t) || nh(mw, mw, A, t))
    return vn;
  if (o === Lo)
    return jc;
  if (o === th || u === th)
    return vn;
  if (u === Fp || o === Fp)
    return jc;
  if ([Sp, Eu, Up].indexOf(u) !== -1 || o === R_ || l === Qp && $_.indexOf(o) !== -1 || o === xl && u === Qp || u === ww || Xi.indexOf(u) !== -1 && o === Rs || Xi.indexOf(o) !== -1 && u === Rs || o === Fu && [ju, Vc, qc].indexOf(u) !== -1 || [ju, Vc, qc].indexOf(o) !== -1 && u === Su || Xi.indexOf(o) !== -1 && yw.indexOf(u) !== -1 || yw.indexOf(o) !== -1 && Xi.indexOf(u) !== -1 || // (PR | PO) × ( OP | HY )? NU
  [Fu, Su].indexOf(o) !== -1 && (u === Rs || [wu, Eu].indexOf(u) !== -1 && t[s + 1] === Rs) || // ( OP | HY ) × NU
  [wu, Eu].indexOf(o) !== -1 && u === Rs || // NU ×	(NU | SY | IS)
  o === Rs && [Rs, xl, Tl].indexOf(u) !== -1)
    return vn;
  if ([Rs, xl, Tl, $c, mu].indexOf(u) !== -1)
    for (var f = A; f >= 0; ) {
      var h = t[f];
      if (h === Rs)
        return vn;
      if ([xl, Tl].indexOf(h) !== -1)
        f--;
      else
        break;
    }
  if ([Fu, Su].indexOf(u) !== -1)
    for (var f = [$c, mu].indexOf(o) !== -1 ? i : A; f >= 0; ) {
      var h = t[f];
      if (h === Rs)
        return vn;
      if ([xl, Tl].indexOf(h) !== -1)
        f--;
      else
        break;
    }
  if (Mp === o && [Mp, bd, Lp, Ip].indexOf(u) !== -1 || [bd, Lp].indexOf(o) !== -1 && [bd, Cd].indexOf(u) !== -1 || [Cd, Ip].indexOf(o) !== -1 && u === Cd || Bw.indexOf(o) !== -1 && [ww, Su].indexOf(u) !== -1 || Bw.indexOf(u) !== -1 && o === Fu || Xi.indexOf(o) !== -1 && Xi.indexOf(u) !== -1 || o === Tl && Xi.indexOf(u) !== -1 || Xi.concat(Rs).indexOf(o) !== -1 && u === wu && W_.indexOf(n[s]) === -1 || Xi.concat(Rs).indexOf(u) !== -1 && o === mu)
    return vn;
  if (o === rh && u === rh) {
    for (var c = e[A], p = 1; c > 0 && (c--, t[c] === rh); )
      p++;
    if (p % 2 !== 0)
      return vn;
  }
  return o === Vc && u === qc ? vn : jc;
}, j_ = function(n, t) {
  t || (t = { lineBreak: "normal", wordBreak: "normal" });
  var e = V_(n, t.lineBreak), r = e[0], a = e[1], A = e[2];
  (t.wordBreak === "break-all" || t.wordBreak === "break-word") && (a = a.map(function(s) {
    return [Rs, tl, BC].indexOf(s) !== -1 ? ju : s;
  }));
  var i = t.wordBreak === "keep-all" ? A.map(function(s, o) {
    return s && n[o] >= 19968 && n[o] <= 40959;
  }) : void 0;
  return [r, a, i];
}, Y_ = (
  /** @class */
  (function() {
    function n(t, e, r, a) {
      this.codePoints = t, this.required = e === bC, this.start = r, this.end = a;
    }
    return n.prototype.slice = function() {
      return Va.apply(void 0, this.codePoints.slice(this.start, this.end));
    }, n;
  })()
), G_ = function(n, t) {
  var e = Yd(n), r = j_(e, t), a = r[0], A = r[1], i = r[2], s = e.length, o = 0, l = 0;
  return {
    next: function() {
      if (l >= s)
        return { done: !0, value: null };
      for (var u = vn; l < s && (u = q_(e, A, a, ++l, i)) === vn; )
        ;
      if (u !== vn || l === s) {
        var f = new Y_(e, u, o, l);
        return o = l, { value: f, done: !1 };
      }
      return { done: !0, value: null };
    }
  };
}, z_ = 1, X_ = 2, Xu = 4, Cw = 8, Qd = 10, kw = 47, Nu = 92, J_ = 9, Z_ = 32, Yc = 34, yu = 61, eR = 35, tR = 36, rR = 37, Gc = 39, zc = 40, Bu = 41, nR = 95, Bs = 45, aR = 33, AR = 60, sR = 62, iR = 64, oR = 91, lR = 93, uR = 61, cR = 123, Xc = 63, dR = 125, Tw = 124, fR = 126, hR = 128, xw = 65533, ah = 42, rl = 43, gR = 44, vR = 58, pR = 59, Yu = 46, mR = 0, wR = 8, yR = 11, BR = 14, bR = 31, CR = 127, Ui = -1, kC = 48, TC = 97, xC = 101, kR = 102, TR = 117, xR = 122, DC = 65, EC = 69, SC = 70, DR = 85, ER = 90, zA = function(n) {
  return n >= kC && n <= 57;
}, SR = function(n) {
  return n >= 55296 && n <= 57343;
}, Dl = function(n) {
  return zA(n) || n >= DC && n <= SC || n >= TC && n <= kR;
}, FR = function(n) {
  return n >= TC && n <= xR;
}, UR = function(n) {
  return n >= DC && n <= ER;
}, LR = function(n) {
  return FR(n) || UR(n);
}, IR = function(n) {
  return n >= hR;
}, Jc = function(n) {
  return n === Qd || n === J_ || n === Z_;
}, Md = function(n) {
  return LR(n) || IR(n) || n === nR;
}, Dw = function(n) {
  return Md(n) || zA(n) || n === Bs;
}, QR = function(n) {
  return n >= mR && n <= wR || n === yR || n >= BR && n <= bR || n === CR;
}, Do = function(n, t) {
  return n !== Nu ? !1 : t !== Qd;
}, Zc = function(n, t, e) {
  return n === Bs ? Md(t) || Do(t, e) : Md(n) ? !0 : !!(n === Nu && Do(n, t));
}, Ah = function(n, t, e) {
  return n === rl || n === Bs ? zA(t) ? !0 : t === Yu && zA(e) : zA(n === Yu ? t : n);
}, MR = function(n) {
  var t = 0, e = 1;
  (n[t] === rl || n[t] === Bs) && (n[t] === Bs && (e = -1), t++);
  for (var r = []; zA(n[t]); )
    r.push(n[t++]);
  var a = r.length ? parseInt(Va.apply(void 0, r), 10) : 0;
  n[t] === Yu && t++;
  for (var A = []; zA(n[t]); )
    A.push(n[t++]);
  var i = A.length, s = i ? parseInt(Va.apply(void 0, A), 10) : 0;
  (n[t] === EC || n[t] === xC) && t++;
  var o = 1;
  (n[t] === rl || n[t] === Bs) && (n[t] === Bs && (o = -1), t++);
  for (var l = []; zA(n[t]); )
    l.push(n[t++]);
  var u = l.length ? parseInt(Va.apply(void 0, l), 10) : 0;
  return e * (a + s * Math.pow(10, -i)) * Math.pow(10, o * u);
}, _R = {
  type: 2
  /* LEFT_PARENTHESIS_TOKEN */
}, RR = {
  type: 3
  /* RIGHT_PARENTHESIS_TOKEN */
}, NR = {
  type: 4
  /* COMMA_TOKEN */
}, HR = {
  type: 13
  /* SUFFIX_MATCH_TOKEN */
}, OR = {
  type: 8
  /* PREFIX_MATCH_TOKEN */
}, PR = {
  type: 21
  /* COLUMN_TOKEN */
}, WR = {
  type: 9
  /* DASH_MATCH_TOKEN */
}, KR = {
  type: 10
  /* INCLUDE_MATCH_TOKEN */
}, $R = {
  type: 11
  /* LEFT_CURLY_BRACKET_TOKEN */
}, VR = {
  type: 12
  /* RIGHT_CURLY_BRACKET_TOKEN */
}, qR = {
  type: 14
  /* SUBSTRING_MATCH_TOKEN */
}, ed = {
  type: 23
  /* BAD_URL_TOKEN */
}, jR = {
  type: 1
  /* BAD_STRING_TOKEN */
}, YR = {
  type: 25
  /* CDO_TOKEN */
}, GR = {
  type: 24
  /* CDC_TOKEN */
}, zR = {
  type: 26
  /* COLON_TOKEN */
}, XR = {
  type: 27
  /* SEMICOLON_TOKEN */
}, JR = {
  type: 28
  /* LEFT_SQUARE_BRACKET_TOKEN */
}, ZR = {
  type: 29
  /* RIGHT_SQUARE_BRACKET_TOKEN */
}, eN = {
  type: 31
  /* WHITESPACE_TOKEN */
}, Np = {
  type: 32
  /* EOF_TOKEN */
}, FC = (
  /** @class */
  (function() {
    function n() {
      this._value = [];
    }
    return n.prototype.write = function(t) {
      this._value = this._value.concat(Yd(t));
    }, n.prototype.read = function() {
      for (var t = [], e = this.consumeToken(); e !== Np; )
        t.push(e), e = this.consumeToken();
      return t;
    }, n.prototype.consumeToken = function() {
      var t = this.consumeCodePoint();
      switch (t) {
        case Yc:
          return this.consumeStringToken(Yc);
        case eR:
          var e = this.peekCodePoint(0), r = this.peekCodePoint(1), a = this.peekCodePoint(2);
          if (Dw(e) || Do(r, a)) {
            var A = Zc(e, r, a) ? X_ : z_, i = this.consumeName();
            return { type: 5, value: i, flags: A };
          }
          break;
        case tR:
          if (this.peekCodePoint(0) === yu)
            return this.consumeCodePoint(), HR;
          break;
        case Gc:
          return this.consumeStringToken(Gc);
        case zc:
          return _R;
        case Bu:
          return RR;
        case ah:
          if (this.peekCodePoint(0) === yu)
            return this.consumeCodePoint(), qR;
          break;
        case rl:
          if (Ah(t, this.peekCodePoint(0), this.peekCodePoint(1)))
            return this.reconsumeCodePoint(t), this.consumeNumericToken();
          break;
        case gR:
          return NR;
        case Bs:
          var s = t, o = this.peekCodePoint(0), l = this.peekCodePoint(1);
          if (Ah(s, o, l))
            return this.reconsumeCodePoint(t), this.consumeNumericToken();
          if (Zc(s, o, l))
            return this.reconsumeCodePoint(t), this.consumeIdentLikeToken();
          if (o === Bs && l === sR)
            return this.consumeCodePoint(), this.consumeCodePoint(), GR;
          break;
        case Yu:
          if (Ah(t, this.peekCodePoint(0), this.peekCodePoint(1)))
            return this.reconsumeCodePoint(t), this.consumeNumericToken();
          break;
        case kw:
          if (this.peekCodePoint(0) === ah)
            for (this.consumeCodePoint(); ; ) {
              var u = this.consumeCodePoint();
              if (u === ah && (u = this.consumeCodePoint(), u === kw))
                return this.consumeToken();
              if (u === Ui)
                return this.consumeToken();
            }
          break;
        case vR:
          return zR;
        case pR:
          return XR;
        case AR:
          if (this.peekCodePoint(0) === aR && this.peekCodePoint(1) === Bs && this.peekCodePoint(2) === Bs)
            return this.consumeCodePoint(), this.consumeCodePoint(), YR;
          break;
        case iR:
          var f = this.peekCodePoint(0), h = this.peekCodePoint(1), c = this.peekCodePoint(2);
          if (Zc(f, h, c)) {
            var i = this.consumeName();
            return { type: 7, value: i };
          }
          break;
        case oR:
          return JR;
        case Nu:
          if (Do(t, this.peekCodePoint(0)))
            return this.reconsumeCodePoint(t), this.consumeIdentLikeToken();
          break;
        case lR:
          return ZR;
        case uR:
          if (this.peekCodePoint(0) === yu)
            return this.consumeCodePoint(), OR;
          break;
        case cR:
          return $R;
        case dR:
          return VR;
        case TR:
        case DR:
          var p = this.peekCodePoint(0), w = this.peekCodePoint(1);
          return p === rl && (Dl(w) || w === Xc) && (this.consumeCodePoint(), this.consumeUnicodeRangeToken()), this.reconsumeCodePoint(t), this.consumeIdentLikeToken();
        case Tw:
          if (this.peekCodePoint(0) === yu)
            return this.consumeCodePoint(), WR;
          if (this.peekCodePoint(0) === Tw)
            return this.consumeCodePoint(), PR;
          break;
        case fR:
          if (this.peekCodePoint(0) === yu)
            return this.consumeCodePoint(), KR;
          break;
        case Ui:
          return Np;
      }
      return Jc(t) ? (this.consumeWhiteSpace(), eN) : zA(t) ? (this.reconsumeCodePoint(t), this.consumeNumericToken()) : Md(t) ? (this.reconsumeCodePoint(t), this.consumeIdentLikeToken()) : { type: 6, value: Va(t) };
    }, n.prototype.consumeCodePoint = function() {
      var t = this._value.shift();
      return typeof t > "u" ? -1 : t;
    }, n.prototype.reconsumeCodePoint = function(t) {
      this._value.unshift(t);
    }, n.prototype.peekCodePoint = function(t) {
      return t >= this._value.length ? -1 : this._value[t];
    }, n.prototype.consumeUnicodeRangeToken = function() {
      for (var t = [], e = this.consumeCodePoint(); Dl(e) && t.length < 6; )
        t.push(e), e = this.consumeCodePoint();
      for (var r = !1; e === Xc && t.length < 6; )
        t.push(e), e = this.consumeCodePoint(), r = !0;
      if (r) {
        var a = parseInt(Va.apply(void 0, t.map(function(o) {
          return o === Xc ? kC : o;
        })), 16), A = parseInt(Va.apply(void 0, t.map(function(o) {
          return o === Xc ? SC : o;
        })), 16);
        return { type: 30, start: a, end: A };
      }
      var i = parseInt(Va.apply(void 0, t), 16);
      if (this.peekCodePoint(0) === Bs && Dl(this.peekCodePoint(1))) {
        this.consumeCodePoint(), e = this.consumeCodePoint();
        for (var s = []; Dl(e) && s.length < 6; )
          s.push(e), e = this.consumeCodePoint();
        var A = parseInt(Va.apply(void 0, s), 16);
        return { type: 30, start: i, end: A };
      } else
        return { type: 30, start: i, end: i };
    }, n.prototype.consumeIdentLikeToken = function() {
      var t = this.consumeName();
      return t.toLowerCase() === "url" && this.peekCodePoint(0) === zc ? (this.consumeCodePoint(), this.consumeUrlToken()) : this.peekCodePoint(0) === zc ? (this.consumeCodePoint(), { type: 19, value: t }) : { type: 20, value: t };
    }, n.prototype.consumeUrlToken = function() {
      var t = [];
      if (this.consumeWhiteSpace(), this.peekCodePoint(0) === Ui)
        return { type: 22, value: "" };
      var e = this.peekCodePoint(0);
      if (e === Gc || e === Yc) {
        var r = this.consumeStringToken(this.consumeCodePoint());
        return r.type === 0 && (this.consumeWhiteSpace(), this.peekCodePoint(0) === Ui || this.peekCodePoint(0) === Bu) ? (this.consumeCodePoint(), { type: 22, value: r.value }) : (this.consumeBadUrlRemnants(), ed);
      }
      for (; ; ) {
        var a = this.consumeCodePoint();
        if (a === Ui || a === Bu)
          return { type: 22, value: Va.apply(void 0, t) };
        if (Jc(a))
          return this.consumeWhiteSpace(), this.peekCodePoint(0) === Ui || this.peekCodePoint(0) === Bu ? (this.consumeCodePoint(), { type: 22, value: Va.apply(void 0, t) }) : (this.consumeBadUrlRemnants(), ed);
        if (a === Yc || a === Gc || a === zc || QR(a))
          return this.consumeBadUrlRemnants(), ed;
        if (a === Nu)
          if (Do(a, this.peekCodePoint(0)))
            t.push(this.consumeEscapedCodePoint());
          else
            return this.consumeBadUrlRemnants(), ed;
        else
          t.push(a);
      }
    }, n.prototype.consumeWhiteSpace = function() {
      for (; Jc(this.peekCodePoint(0)); )
        this.consumeCodePoint();
    }, n.prototype.consumeBadUrlRemnants = function() {
      for (; ; ) {
        var t = this.consumeCodePoint();
        if (t === Bu || t === Ui)
          return;
        Do(t, this.peekCodePoint(0)) && this.consumeEscapedCodePoint();
      }
    }, n.prototype.consumeStringSlice = function(t) {
      for (var e = 5e4, r = ""; t > 0; ) {
        var a = Math.min(e, t);
        r += Va.apply(void 0, this._value.splice(0, a)), t -= a;
      }
      return this._value.shift(), r;
    }, n.prototype.consumeStringToken = function(t) {
      var e = "", r = 0;
      do {
        var a = this._value[r];
        if (a === Ui || a === void 0 || a === t)
          return e += this.consumeStringSlice(r), { type: 0, value: e };
        if (a === Qd)
          return this._value.splice(0, r), jR;
        if (a === Nu) {
          var A = this._value[r + 1];
          A !== Ui && A !== void 0 && (A === Qd ? (e += this.consumeStringSlice(r), r = -1, this._value.shift()) : Do(a, A) && (e += this.consumeStringSlice(r), e += Va(this.consumeEscapedCodePoint()), r = -1));
        }
        r++;
      } while (!0);
    }, n.prototype.consumeNumber = function() {
      var t = [], e = Xu, r = this.peekCodePoint(0);
      for ((r === rl || r === Bs) && t.push(this.consumeCodePoint()); zA(this.peekCodePoint(0)); )
        t.push(this.consumeCodePoint());
      r = this.peekCodePoint(0);
      var a = this.peekCodePoint(1);
      if (r === Yu && zA(a))
        for (t.push(this.consumeCodePoint(), this.consumeCodePoint()), e = Cw; zA(this.peekCodePoint(0)); )
          t.push(this.consumeCodePoint());
      r = this.peekCodePoint(0), a = this.peekCodePoint(1);
      var A = this.peekCodePoint(2);
      if ((r === EC || r === xC) && ((a === rl || a === Bs) && zA(A) || zA(a)))
        for (t.push(this.consumeCodePoint(), this.consumeCodePoint()), e = Cw; zA(this.peekCodePoint(0)); )
          t.push(this.consumeCodePoint());
      return [MR(t), e];
    }, n.prototype.consumeNumericToken = function() {
      var t = this.consumeNumber(), e = t[0], r = t[1], a = this.peekCodePoint(0), A = this.peekCodePoint(1), i = this.peekCodePoint(2);
      if (Zc(a, A, i)) {
        var s = this.consumeName();
        return { type: 15, number: e, flags: r, unit: s };
      }
      return a === rR ? (this.consumeCodePoint(), { type: 16, number: e, flags: r }) : { type: 17, number: e, flags: r };
    }, n.prototype.consumeEscapedCodePoint = function() {
      var t = this.consumeCodePoint();
      if (Dl(t)) {
        for (var e = Va(t); Dl(this.peekCodePoint(0)) && e.length < 6; )
          e += Va(this.consumeCodePoint());
        Jc(this.peekCodePoint(0)) && this.consumeCodePoint();
        var r = parseInt(e, 16);
        return r === 0 || SR(r) || r > 1114111 ? xw : r;
      }
      return t === Ui ? xw : t;
    }, n.prototype.consumeName = function() {
      for (var t = ""; ; ) {
        var e = this.consumeCodePoint();
        if (Dw(e))
          t += Va(e);
        else if (Do(e, this.peekCodePoint(0)))
          t += Va(this.consumeEscapedCodePoint());
        else
          return this.reconsumeCodePoint(e), t;
      }
    }, n;
  })()
), UC = (
  /** @class */
  (function() {
    function n(t) {
      this._tokens = t;
    }
    return n.create = function(t) {
      var e = new FC();
      return e.write(t), new n(e.read());
    }, n.parseValue = function(t) {
      return n.create(t).parseComponentValue();
    }, n.parseValues = function(t) {
      return n.create(t).parseComponentValues();
    }, n.prototype.parseComponentValue = function() {
      for (var t = this.consumeToken(); t.type === 31; )
        t = this.consumeToken();
      if (t.type === 32)
        throw new SyntaxError("Error parsing CSS component value, unexpected EOF");
      this.reconsumeToken(t);
      var e = this.consumeComponentValue();
      do
        t = this.consumeToken();
      while (t.type === 31);
      if (t.type === 32)
        return e;
      throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one");
    }, n.prototype.parseComponentValues = function() {
      for (var t = []; ; ) {
        var e = this.consumeComponentValue();
        if (e.type === 32)
          return t;
        t.push(e), t.push();
      }
    }, n.prototype.consumeComponentValue = function() {
      var t = this.consumeToken();
      switch (t.type) {
        case 11:
        case 28:
        case 2:
          return this.consumeSimpleBlock(t.type);
        case 19:
          return this.consumeFunction(t);
      }
      return t;
    }, n.prototype.consumeSimpleBlock = function(t) {
      for (var e = { type: t, values: [] }, r = this.consumeToken(); ; ) {
        if (r.type === 32 || rN(r, t))
          return e;
        this.reconsumeToken(r), e.values.push(this.consumeComponentValue()), r = this.consumeToken();
      }
    }, n.prototype.consumeFunction = function(t) {
      for (var e = {
        name: t.value,
        values: [],
        type: 18
        /* FUNCTION */
      }; ; ) {
        var r = this.consumeToken();
        if (r.type === 32 || r.type === 3)
          return e;
        this.reconsumeToken(r), e.values.push(this.consumeComponentValue());
      }
    }, n.prototype.consumeToken = function() {
      var t = this._tokens.shift();
      return typeof t > "u" ? Np : t;
    }, n.prototype.reconsumeToken = function(t) {
      this._tokens.unshift(t);
    }, n;
  })()
), Ju = function(n) {
  return n.type === 15;
}, eu = function(n) {
  return n.type === 17;
}, jn = function(n) {
  return n.type === 20;
}, tN = function(n) {
  return n.type === 0;
}, Hp = function(n, t) {
  return jn(n) && n.value === t;
}, LC = function(n) {
  return n.type !== 31;
}, Xl = function(n) {
  return n.type !== 31 && n.type !== 4;
}, Ri = function(n) {
  var t = [], e = [];
  return n.forEach(function(r) {
    if (r.type === 4) {
      if (e.length === 0)
        throw new Error("Error parsing function args, zero tokens for arg");
      t.push(e), e = [];
      return;
    }
    r.type !== 31 && e.push(r);
  }), e.length && t.push(e), t;
}, rN = function(n, t) {
  return t === 11 && n.type === 12 || t === 28 && n.type === 29 ? !0 : t === 2 && n.type === 3;
}, No = function(n) {
  return n.type === 17 || n.type === 15;
}, AA = function(n) {
  return n.type === 16 || No(n);
}, IC = function(n) {
  return n.length > 1 ? [n[0], n[1]] : [n[0]];
}, _A = {
  type: 17,
  number: 0,
  flags: Xu
}, T0 = {
  type: 16,
  number: 50,
  flags: Xu
}, Io = {
  type: 16,
  number: 100,
  flags: Xu
}, Uu = function(n, t, e) {
  var r = n[0], a = n[1];
  return [aa(r, t), aa(typeof a < "u" ? a : r, e)];
}, aa = function(n, t) {
  if (n.type === 16)
    return n.number / 100 * t;
  if (Ju(n))
    switch (n.unit) {
      case "rem":
      case "em":
        return 16 * n.number;
      // TODO use correct font-size
      case "px":
      default:
        return n.number;
    }
  return n.number;
}, QC = "deg", MC = "grad", _C = "rad", RC = "turn", Gd = {
  name: "angle",
  parse: function(n, t) {
    if (t.type === 15)
      switch (t.unit) {
        case QC:
          return Math.PI * t.number / 180;
        case MC:
          return Math.PI / 200 * t.number;
        case _C:
          return t.number;
        case RC:
          return Math.PI * 2 * t.number;
      }
    throw new Error("Unsupported angle type");
  }
}, NC = function(n) {
  return n.type === 15 && (n.unit === QC || n.unit === MC || n.unit === _C || n.unit === RC);
}, HC = function(n) {
  var t = n.filter(jn).map(function(e) {
    return e.value;
  }).join(" ");
  switch (t) {
    case "to bottom right":
    case "to right bottom":
    case "left top":
    case "top left":
      return [_A, _A];
    case "to top":
    case "bottom":
      return js(0);
    case "to bottom left":
    case "to left bottom":
    case "right top":
    case "top right":
      return [_A, Io];
    case "to right":
    case "left":
      return js(90);
    case "to top left":
    case "to left top":
    case "right bottom":
    case "bottom right":
      return [Io, Io];
    case "to bottom":
    case "top":
      return js(180);
    case "to top right":
    case "to right top":
    case "left bottom":
    case "bottom left":
      return [Io, _A];
    case "to left":
    case "right":
      return js(270);
  }
  return 0;
}, js = function(n) {
  return Math.PI * n / 180;
}, Mo = {
  name: "color",
  parse: function(n, t) {
    if (t.type === 18) {
      var e = nN[t.name];
      if (typeof e > "u")
        throw new Error('Attempting to parse an unsupported color function "' + t.name + '"');
      return e(n, t.values);
    }
    if (t.type === 5) {
      if (t.value.length === 3) {
        var r = t.value.substring(0, 1), a = t.value.substring(1, 2), A = t.value.substring(2, 3);
        return Qo(parseInt(r + r, 16), parseInt(a + a, 16), parseInt(A + A, 16), 1);
      }
      if (t.value.length === 4) {
        var r = t.value.substring(0, 1), a = t.value.substring(1, 2), A = t.value.substring(2, 3), i = t.value.substring(3, 4);
        return Qo(parseInt(r + r, 16), parseInt(a + a, 16), parseInt(A + A, 16), parseInt(i + i, 16) / 255);
      }
      if (t.value.length === 6) {
        var r = t.value.substring(0, 2), a = t.value.substring(2, 4), A = t.value.substring(4, 6);
        return Qo(parseInt(r, 16), parseInt(a, 16), parseInt(A, 16), 1);
      }
      if (t.value.length === 8) {
        var r = t.value.substring(0, 2), a = t.value.substring(2, 4), A = t.value.substring(4, 6), i = t.value.substring(6, 8);
        return Qo(parseInt(r, 16), parseInt(a, 16), parseInt(A, 16), parseInt(i, 16) / 255);
      }
    }
    if (t.type === 20) {
      var s = ao[t.value.toUpperCase()];
      if (typeof s < "u")
        return s;
    }
    return ao.TRANSPARENT;
  }
}, _o = function(n) {
  return (255 & n) === 0;
}, bA = function(n) {
  var t = 255 & n, e = 255 & n >> 8, r = 255 & n >> 16, a = 255 & n >> 24;
  return t < 255 ? "rgba(" + a + "," + r + "," + e + "," + t / 255 + ")" : "rgb(" + a + "," + r + "," + e + ")";
}, Qo = function(n, t, e, r) {
  return (n << 24 | t << 16 | e << 8 | Math.round(r * 255) << 0) >>> 0;
}, Ew = function(n, t) {
  if (n.type === 17)
    return n.number;
  if (n.type === 16) {
    var e = t === 3 ? 1 : 255;
    return t === 3 ? n.number / 100 * e : Math.round(n.number / 100 * e);
  }
  return 0;
}, Sw = function(n, t) {
  var e = t.filter(Xl);
  if (e.length === 3) {
    var r = e.map(Ew), a = r[0], A = r[1], i = r[2];
    return Qo(a, A, i, 1);
  }
  if (e.length === 4) {
    var s = e.map(Ew), a = s[0], A = s[1], i = s[2], o = s[3];
    return Qo(a, A, i, o);
  }
  return 0;
};
function sh(n, t, e) {
  return e < 0 && (e += 1), e >= 1 && (e -= 1), e < 1 / 6 ? (t - n) * e * 6 + n : e < 1 / 2 ? t : e < 2 / 3 ? (t - n) * 6 * (2 / 3 - e) + n : n;
}
var Fw = function(n, t) {
  var e = t.filter(Xl), r = e[0], a = e[1], A = e[2], i = e[3], s = (r.type === 17 ? js(r.number) : Gd.parse(n, r)) / (Math.PI * 2), o = AA(a) ? a.number / 100 : 0, l = AA(A) ? A.number / 100 : 0, u = typeof i < "u" && AA(i) ? aa(i, 1) : 1;
  if (o === 0)
    return Qo(l * 255, l * 255, l * 255, 1);
  var f = l <= 0.5 ? l * (o + 1) : l + o - l * o, h = l * 2 - f, c = sh(h, f, s + 1 / 3), p = sh(h, f, s), w = sh(h, f, s - 1 / 3);
  return Qo(c * 255, p * 255, w * 255, u);
}, nN = {
  hsl: Fw,
  hsla: Fw,
  rgb: Sw,
  rgba: Sw
}, Hu = function(n, t) {
  return Mo.parse(n, UC.create(t).parseComponentValue());
}, ao = {
  ALICEBLUE: 4042850303,
  ANTIQUEWHITE: 4209760255,
  AQUA: 16777215,
  AQUAMARINE: 2147472639,
  AZURE: 4043309055,
  BEIGE: 4126530815,
  BISQUE: 4293182719,
  BLACK: 255,
  BLANCHEDALMOND: 4293643775,
  BLUE: 65535,
  BLUEVIOLET: 2318131967,
  BROWN: 2771004159,
  BURLYWOOD: 3736635391,
  CADETBLUE: 1604231423,
  CHARTREUSE: 2147418367,
  CHOCOLATE: 3530104575,
  CORAL: 4286533887,
  CORNFLOWERBLUE: 1687547391,
  CORNSILK: 4294499583,
  CRIMSON: 3692313855,
  CYAN: 16777215,
  DARKBLUE: 35839,
  DARKCYAN: 9145343,
  DARKGOLDENROD: 3095837695,
  DARKGRAY: 2846468607,
  DARKGREEN: 6553855,
  DARKGREY: 2846468607,
  DARKKHAKI: 3182914559,
  DARKMAGENTA: 2332068863,
  DARKOLIVEGREEN: 1433087999,
  DARKORANGE: 4287365375,
  DARKORCHID: 2570243327,
  DARKRED: 2332033279,
  DARKSALMON: 3918953215,
  DARKSEAGREEN: 2411499519,
  DARKSLATEBLUE: 1211993087,
  DARKSLATEGRAY: 793726975,
  DARKSLATEGREY: 793726975,
  DARKTURQUOISE: 13554175,
  DARKVIOLET: 2483082239,
  DEEPPINK: 4279538687,
  DEEPSKYBLUE: 12582911,
  DIMGRAY: 1768516095,
  DIMGREY: 1768516095,
  DODGERBLUE: 512819199,
  FIREBRICK: 2988581631,
  FLORALWHITE: 4294635775,
  FORESTGREEN: 579543807,
  FUCHSIA: 4278255615,
  GAINSBORO: 3705462015,
  GHOSTWHITE: 4177068031,
  GOLD: 4292280575,
  GOLDENROD: 3668254975,
  GRAY: 2155905279,
  GREEN: 8388863,
  GREENYELLOW: 2919182335,
  GREY: 2155905279,
  HONEYDEW: 4043305215,
  HOTPINK: 4285117695,
  INDIANRED: 3445382399,
  INDIGO: 1258324735,
  IVORY: 4294963455,
  KHAKI: 4041641215,
  LAVENDER: 3873897215,
  LAVENDERBLUSH: 4293981695,
  LAWNGREEN: 2096890111,
  LEMONCHIFFON: 4294626815,
  LIGHTBLUE: 2916673279,
  LIGHTCORAL: 4034953471,
  LIGHTCYAN: 3774873599,
  LIGHTGOLDENRODYELLOW: 4210742015,
  LIGHTGRAY: 3553874943,
  LIGHTGREEN: 2431553791,
  LIGHTGREY: 3553874943,
  LIGHTPINK: 4290167295,
  LIGHTSALMON: 4288707327,
  LIGHTSEAGREEN: 548580095,
  LIGHTSKYBLUE: 2278488831,
  LIGHTSLATEGRAY: 2005441023,
  LIGHTSLATEGREY: 2005441023,
  LIGHTSTEELBLUE: 2965692159,
  LIGHTYELLOW: 4294959359,
  LIME: 16711935,
  LIMEGREEN: 852308735,
  LINEN: 4210091775,
  MAGENTA: 4278255615,
  MAROON: 2147483903,
  MEDIUMAQUAMARINE: 1724754687,
  MEDIUMBLUE: 52735,
  MEDIUMORCHID: 3126187007,
  MEDIUMPURPLE: 2473647103,
  MEDIUMSEAGREEN: 1018393087,
  MEDIUMSLATEBLUE: 2070474495,
  MEDIUMSPRINGGREEN: 16423679,
  MEDIUMTURQUOISE: 1221709055,
  MEDIUMVIOLETRED: 3340076543,
  MIDNIGHTBLUE: 421097727,
  MINTCREAM: 4127193855,
  MISTYROSE: 4293190143,
  MOCCASIN: 4293178879,
  NAVAJOWHITE: 4292783615,
  NAVY: 33023,
  OLDLACE: 4260751103,
  OLIVE: 2155872511,
  OLIVEDRAB: 1804477439,
  ORANGE: 4289003775,
  ORANGERED: 4282712319,
  ORCHID: 3664828159,
  PALEGOLDENROD: 4008225535,
  PALEGREEN: 2566625535,
  PALETURQUOISE: 2951671551,
  PALEVIOLETRED: 3681588223,
  PAPAYAWHIP: 4293907967,
  PEACHPUFF: 4292524543,
  PERU: 3448061951,
  PINK: 4290825215,
  PLUM: 3718307327,
  POWDERBLUE: 2967529215,
  PURPLE: 2147516671,
  REBECCAPURPLE: 1714657791,
  RED: 4278190335,
  ROSYBROWN: 3163525119,
  ROYALBLUE: 1097458175,
  SADDLEBROWN: 2336560127,
  SALMON: 4202722047,
  SANDYBROWN: 4104413439,
  SEAGREEN: 780883967,
  SEASHELL: 4294307583,
  SIENNA: 2689740287,
  SILVER: 3233857791,
  SKYBLUE: 2278484991,
  SLATEBLUE: 1784335871,
  SLATEGRAY: 1887473919,
  SLATEGREY: 1887473919,
  SNOW: 4294638335,
  SPRINGGREEN: 16744447,
  STEELBLUE: 1182971135,
  TAN: 3535047935,
  TEAL: 8421631,
  THISTLE: 3636451583,
  TOMATO: 4284696575,
  TRANSPARENT: 0,
  TURQUOISE: 1088475391,
  VIOLET: 4001558271,
  WHEAT: 4125012991,
  WHITE: 4294967295,
  WHITESMOKE: 4126537215,
  YELLOW: 4294902015,
  YELLOWGREEN: 2597139199
}, aN = {
  name: "background-clip",
  initialValue: "border-box",
  prefix: !1,
  type: 1,
  parse: function(n, t) {
    return t.map(function(e) {
      if (jn(e))
        switch (e.value) {
          case "padding-box":
            return 1;
          case "content-box":
            return 2;
        }
      return 0;
    });
  }
}, AN = {
  name: "background-color",
  initialValue: "transparent",
  prefix: !1,
  type: 3,
  format: "color"
}, zd = function(n, t) {
  var e = Mo.parse(n, t[0]), r = t[1];
  return r && AA(r) ? { color: e, stop: r } : { color: e, stop: null };
}, Uw = function(n, t) {
  var e = n[0], r = n[n.length - 1];
  e.stop === null && (e.stop = _A), r.stop === null && (r.stop = Io);
  for (var a = [], A = 0, i = 0; i < n.length; i++) {
    var s = n[i].stop;
    if (s !== null) {
      var o = aa(s, t);
      o > A ? a.push(o) : a.push(A), A = o;
    } else
      a.push(null);
  }
  for (var l = null, i = 0; i < a.length; i++) {
    var u = a[i];
    if (u === null)
      l === null && (l = i);
    else if (l !== null) {
      for (var f = i - l, h = a[l - 1], c = (u - h) / (f + 1), p = 1; p <= f; p++)
        a[l + p - 1] = c * p;
      l = null;
    }
  }
  return n.map(function(w, y) {
    var m = w.color;
    return { color: m, stop: Math.max(Math.min(1, a[y] / t), 0) };
  });
}, sN = function(n, t, e) {
  var r = t / 2, a = e / 2, A = aa(n[0], t) - r, i = a - aa(n[1], e);
  return (Math.atan2(i, A) + Math.PI * 2) % (Math.PI * 2);
}, iN = function(n, t, e) {
  var r = typeof n == "number" ? n : sN(n, t, e), a = Math.abs(t * Math.sin(r)) + Math.abs(e * Math.cos(r)), A = t / 2, i = e / 2, s = a / 2, o = Math.sin(r - Math.PI / 2) * s, l = Math.cos(r - Math.PI / 2) * s;
  return [a, A - l, A + l, i - o, i + o];
}, ci = function(n, t) {
  return Math.sqrt(n * n + t * t);
}, Lw = function(n, t, e, r, a) {
  var A = [
    [0, 0],
    [0, t],
    [n, 0],
    [n, t]
  ];
  return A.reduce(function(i, s) {
    var o = s[0], l = s[1], u = ci(e - o, r - l);
    return (a ? u < i.optimumDistance : u > i.optimumDistance) ? {
      optimumCorner: s,
      optimumDistance: u
    } : i;
  }, {
    optimumDistance: a ? 1 / 0 : -1 / 0,
    optimumCorner: null
  }).optimumCorner;
}, oN = function(n, t, e, r, a) {
  var A = 0, i = 0;
  switch (n.size) {
    case 0:
      n.shape === 0 ? A = i = Math.min(Math.abs(t), Math.abs(t - r), Math.abs(e), Math.abs(e - a)) : n.shape === 1 && (A = Math.min(Math.abs(t), Math.abs(t - r)), i = Math.min(Math.abs(e), Math.abs(e - a)));
      break;
    case 2:
      if (n.shape === 0)
        A = i = Math.min(ci(t, e), ci(t, e - a), ci(t - r, e), ci(t - r, e - a));
      else if (n.shape === 1) {
        var s = Math.min(Math.abs(e), Math.abs(e - a)) / Math.min(Math.abs(t), Math.abs(t - r)), o = Lw(r, a, t, e, !0), l = o[0], u = o[1];
        A = ci(l - t, (u - e) / s), i = s * A;
      }
      break;
    case 1:
      n.shape === 0 ? A = i = Math.max(Math.abs(t), Math.abs(t - r), Math.abs(e), Math.abs(e - a)) : n.shape === 1 && (A = Math.max(Math.abs(t), Math.abs(t - r)), i = Math.max(Math.abs(e), Math.abs(e - a)));
      break;
    case 3:
      if (n.shape === 0)
        A = i = Math.max(ci(t, e), ci(t, e - a), ci(t - r, e), ci(t - r, e - a));
      else if (n.shape === 1) {
        var s = Math.max(Math.abs(e), Math.abs(e - a)) / Math.max(Math.abs(t), Math.abs(t - r)), f = Lw(r, a, t, e, !1), l = f[0], u = f[1];
        A = ci(l - t, (u - e) / s), i = s * A;
      }
      break;
  }
  return Array.isArray(n.size) && (A = aa(n.size[0], r), i = n.size.length === 2 ? aa(n.size[1], a) : A), [A, i];
}, lN = function(n, t) {
  var e = js(180), r = [];
  return Ri(t).forEach(function(a, A) {
    if (A === 0) {
      var i = a[0];
      if (i.type === 20 && i.value === "to") {
        e = HC(a);
        return;
      } else if (NC(i)) {
        e = Gd.parse(n, i);
        return;
      }
    }
    var s = zd(n, a);
    r.push(s);
  }), {
    angle: e,
    stops: r,
    type: 1
    /* LINEAR_GRADIENT */
  };
}, td = function(n, t) {
  var e = js(180), r = [];
  return Ri(t).forEach(function(a, A) {
    if (A === 0) {
      var i = a[0];
      if (i.type === 20 && ["top", "left", "right", "bottom"].indexOf(i.value) !== -1) {
        e = HC(a);
        return;
      } else if (NC(i)) {
        e = (Gd.parse(n, i) + js(270)) % js(360);
        return;
      }
    }
    var s = zd(n, a);
    r.push(s);
  }), {
    angle: e,
    stops: r,
    type: 1
    /* LINEAR_GRADIENT */
  };
}, uN = function(n, t) {
  var e = js(180), r = [], a = 1, A = 0, i = 3, s = [];
  return Ri(t).forEach(function(o, l) {
    var u = o[0];
    if (l === 0) {
      if (jn(u) && u.value === "linear") {
        a = 1;
        return;
      } else if (jn(u) && u.value === "radial") {
        a = 2;
        return;
      }
    }
    if (u.type === 18) {
      if (u.name === "from") {
        var f = Mo.parse(n, u.values[0]);
        r.push({ stop: _A, color: f });
      } else if (u.name === "to") {
        var f = Mo.parse(n, u.values[0]);
        r.push({ stop: Io, color: f });
      } else if (u.name === "color-stop") {
        var h = u.values.filter(Xl);
        if (h.length === 2) {
          var f = Mo.parse(n, h[1]), c = h[0];
          eu(c) && r.push({
            stop: { type: 16, number: c.number * 100, flags: c.flags },
            color: f
          });
        }
      }
    }
  }), a === 1 ? {
    angle: (e + js(180)) % js(360),
    stops: r,
    type: a
  } : { size: i, shape: A, stops: r, position: s, type: a };
}, OC = "closest-side", PC = "farthest-side", WC = "closest-corner", KC = "farthest-corner", $C = "circle", VC = "ellipse", qC = "cover", jC = "contain", cN = function(n, t) {
  var e = 0, r = 3, a = [], A = [];
  return Ri(t).forEach(function(i, s) {
    var o = !0;
    if (s === 0) {
      var l = !1;
      o = i.reduce(function(f, h) {
        if (l)
          if (jn(h))
            switch (h.value) {
              case "center":
                return A.push(T0), f;
              case "top":
              case "left":
                return A.push(_A), f;
              case "right":
              case "bottom":
                return A.push(Io), f;
            }
          else (AA(h) || No(h)) && A.push(h);
        else if (jn(h))
          switch (h.value) {
            case $C:
              return e = 0, !1;
            case VC:
              return e = 1, !1;
            case "at":
              return l = !0, !1;
            case OC:
              return r = 0, !1;
            case qC:
            case PC:
              return r = 1, !1;
            case jC:
            case WC:
              return r = 2, !1;
            case KC:
              return r = 3, !1;
          }
        else if (No(h) || AA(h))
          return Array.isArray(r) || (r = []), r.push(h), !1;
        return f;
      }, o);
    }
    if (o) {
      var u = zd(n, i);
      a.push(u);
    }
  }), {
    size: r,
    shape: e,
    stops: a,
    position: A,
    type: 2
    /* RADIAL_GRADIENT */
  };
}, rd = function(n, t) {
  var e = 0, r = 3, a = [], A = [];
  return Ri(t).forEach(function(i, s) {
    var o = !0;
    if (s === 0 ? o = i.reduce(function(u, f) {
      if (jn(f))
        switch (f.value) {
          case "center":
            return A.push(T0), !1;
          case "top":
          case "left":
            return A.push(_A), !1;
          case "right":
          case "bottom":
            return A.push(Io), !1;
        }
      else if (AA(f) || No(f))
        return A.push(f), !1;
      return u;
    }, o) : s === 1 && (o = i.reduce(function(u, f) {
      if (jn(f))
        switch (f.value) {
          case $C:
            return e = 0, !1;
          case VC:
            return e = 1, !1;
          case jC:
          case OC:
            return r = 0, !1;
          case PC:
            return r = 1, !1;
          case WC:
            return r = 2, !1;
          case qC:
          case KC:
            return r = 3, !1;
        }
      else if (No(f) || AA(f))
        return Array.isArray(r) || (r = []), r.push(f), !1;
      return u;
    }, o)), o) {
      var l = zd(n, i);
      a.push(l);
    }
  }), {
    size: r,
    shape: e,
    stops: a,
    position: A,
    type: 2
    /* RADIAL_GRADIENT */
  };
}, dN = function(n) {
  return n.type === 1;
}, fN = function(n) {
  return n.type === 2;
}, x0 = {
  name: "image",
  parse: function(n, t) {
    if (t.type === 22) {
      var e = {
        url: t.value,
        type: 0
        /* URL */
      };
      return n.cache.addImage(t.value), e;
    }
    if (t.type === 18) {
      var r = YC[t.name];
      if (typeof r > "u")
        throw new Error('Attempting to parse an unsupported image function "' + t.name + '"');
      return r(n, t.values);
    }
    throw new Error("Unsupported image type " + t.type);
  }
};
function hN(n) {
  return !(n.type === 20 && n.value === "none") && (n.type !== 18 || !!YC[n.name]);
}
var YC = {
  "linear-gradient": lN,
  "-moz-linear-gradient": td,
  "-ms-linear-gradient": td,
  "-o-linear-gradient": td,
  "-webkit-linear-gradient": td,
  "radial-gradient": cN,
  "-moz-radial-gradient": rd,
  "-ms-radial-gradient": rd,
  "-o-radial-gradient": rd,
  "-webkit-radial-gradient": rd,
  "-webkit-gradient": uN
}, gN = {
  name: "background-image",
  initialValue: "none",
  type: 1,
  prefix: !1,
  parse: function(n, t) {
    if (t.length === 0)
      return [];
    var e = t[0];
    return e.type === 20 && e.value === "none" ? [] : t.filter(function(r) {
      return Xl(r) && hN(r);
    }).map(function(r) {
      return x0.parse(n, r);
    });
  }
}, vN = {
  name: "background-origin",
  initialValue: "border-box",
  prefix: !1,
  type: 1,
  parse: function(n, t) {
    return t.map(function(e) {
      if (jn(e))
        switch (e.value) {
          case "padding-box":
            return 1;
          case "content-box":
            return 2;
        }
      return 0;
    });
  }
}, pN = {
  name: "background-position",
  initialValue: "0% 0%",
  type: 1,
  prefix: !1,
  parse: function(n, t) {
    return Ri(t).map(function(e) {
      return e.filter(AA);
    }).map(IC);
  }
}, mN = {
  name: "background-repeat",
  initialValue: "repeat",
  prefix: !1,
  type: 1,
  parse: function(n, t) {
    return Ri(t).map(function(e) {
      return e.filter(jn).map(function(r) {
        return r.value;
      }).join(" ");
    }).map(wN);
  }
}, wN = function(n) {
  switch (n) {
    case "no-repeat":
      return 1;
    case "repeat-x":
    case "repeat no-repeat":
      return 2;
    case "repeat-y":
    case "no-repeat repeat":
      return 3;
    case "repeat":
    default:
      return 0;
  }
}, Yl;
(function(n) {
  n.AUTO = "auto", n.CONTAIN = "contain", n.COVER = "cover";
})(Yl || (Yl = {}));
var yN = {
  name: "background-size",
  initialValue: "0",
  prefix: !1,
  type: 1,
  parse: function(n, t) {
    return Ri(t).map(function(e) {
      return e.filter(BN);
    });
  }
}, BN = function(n) {
  return jn(n) || AA(n);
}, Xd = function(n) {
  return {
    name: "border-" + n + "-color",
    initialValue: "transparent",
    prefix: !1,
    type: 3,
    format: "color"
  };
}, bN = Xd("top"), CN = Xd("right"), kN = Xd("bottom"), TN = Xd("left"), Jd = function(n) {
  return {
    name: "border-radius-" + n,
    initialValue: "0 0",
    prefix: !1,
    type: 1,
    parse: function(t, e) {
      return IC(e.filter(AA));
    }
  };
}, xN = Jd("top-left"), DN = Jd("top-right"), EN = Jd("bottom-right"), SN = Jd("bottom-left"), Zd = function(n) {
  return {
    name: "border-" + n + "-style",
    initialValue: "solid",
    prefix: !1,
    type: 2,
    parse: function(t, e) {
      switch (e) {
        case "none":
          return 0;
        case "dashed":
          return 2;
        case "dotted":
          return 3;
        case "double":
          return 4;
      }
      return 1;
    }
  };
}, FN = Zd("top"), UN = Zd("right"), LN = Zd("bottom"), IN = Zd("left"), ef = function(n) {
  return {
    name: "border-" + n + "-width",
    initialValue: "0",
    type: 0,
    prefix: !1,
    parse: function(t, e) {
      return Ju(e) ? e.number : 0;
    }
  };
}, QN = ef("top"), MN = ef("right"), _N = ef("bottom"), RN = ef("left"), NN = {
  name: "color",
  initialValue: "transparent",
  prefix: !1,
  type: 3,
  format: "color"
}, HN = {
  name: "direction",
  initialValue: "ltr",
  prefix: !1,
  type: 2,
  parse: function(n, t) {
    switch (t) {
      case "rtl":
        return 1;
      case "ltr":
      default:
        return 0;
    }
  }
}, ON = {
  name: "display",
  initialValue: "inline-block",
  prefix: !1,
  type: 1,
  parse: function(n, t) {
    return t.filter(jn).reduce(
      function(e, r) {
        return e | PN(r.value);
      },
      0
      /* NONE */
    );
  }
}, PN = function(n) {
  switch (n) {
    case "block":
    case "-webkit-box":
      return 2;
    case "inline":
      return 4;
    case "run-in":
      return 8;
    case "flow":
      return 16;
    case "flow-root":
      return 32;
    case "table":
      return 64;
    case "flex":
    case "-webkit-flex":
      return 128;
    case "grid":
    case "-ms-grid":
      return 256;
    case "ruby":
      return 512;
    case "subgrid":
      return 1024;
    case "list-item":
      return 2048;
    case "table-row-group":
      return 4096;
    case "table-header-group":
      return 8192;
    case "table-footer-group":
      return 16384;
    case "table-row":
      return 32768;
    case "table-cell":
      return 65536;
    case "table-column-group":
      return 131072;
    case "table-column":
      return 262144;
    case "table-caption":
      return 524288;
    case "ruby-base":
      return 1048576;
    case "ruby-text":
      return 2097152;
    case "ruby-base-container":
      return 4194304;
    case "ruby-text-container":
      return 8388608;
    case "contents":
      return 16777216;
    case "inline-block":
      return 33554432;
    case "inline-list-item":
      return 67108864;
    case "inline-table":
      return 134217728;
    case "inline-flex":
      return 268435456;
    case "inline-grid":
      return 536870912;
  }
  return 0;
}, WN = {
  name: "float",
  initialValue: "none",
  prefix: !1,
  type: 2,
  parse: function(n, t) {
    switch (t) {
      case "left":
        return 1;
      case "right":
        return 2;
      case "inline-start":
        return 3;
      case "inline-end":
        return 4;
    }
    return 0;
  }
}, KN = {
  name: "letter-spacing",
  initialValue: "0",
  prefix: !1,
  type: 0,
  parse: function(n, t) {
    return t.type === 20 && t.value === "normal" ? 0 : t.type === 17 || t.type === 15 ? t.number : 0;
  }
}, _d;
(function(n) {
  n.NORMAL = "normal", n.STRICT = "strict";
})(_d || (_d = {}));
var $N = {
  name: "line-break",
  initialValue: "normal",
  prefix: !1,
  type: 2,
  parse: function(n, t) {
    switch (t) {
      case "strict":
        return _d.STRICT;
      case "normal":
      default:
        return _d.NORMAL;
    }
  }
}, VN = {
  name: "line-height",
  initialValue: "normal",
  prefix: !1,
  type: 4
  /* TOKEN_VALUE */
}, Iw = function(n, t) {
  return jn(n) && n.value === "normal" ? 1.2 * t : n.type === 17 ? t * n.number : AA(n) ? aa(n, t) : t;
}, qN = {
  name: "list-style-image",
  initialValue: "none",
  type: 0,
  prefix: !1,
  parse: function(n, t) {
    return t.type === 20 && t.value === "none" ? null : x0.parse(n, t);
  }
}, jN = {
  name: "list-style-position",
  initialValue: "outside",
  prefix: !1,
  type: 2,
  parse: function(n, t) {
    switch (t) {
      case "inside":
        return 0;
      case "outside":
      default:
        return 1;
    }
  }
}, Op = {
  name: "list-style-type",
  initialValue: "none",
  prefix: !1,
  type: 2,
  parse: function(n, t) {
    switch (t) {
      case "disc":
        return 0;
      case "circle":
        return 1;
      case "square":
        return 2;
      case "decimal":
        return 3;
      case "cjk-decimal":
        return 4;
      case "decimal-leading-zero":
        return 5;
      case "lower-roman":
        return 6;
      case "upper-roman":
        return 7;
      case "lower-greek":
        return 8;
      case "lower-alpha":
        return 9;
      case "upper-alpha":
        return 10;
      case "arabic-indic":
        return 11;
      case "armenian":
        return 12;
      case "bengali":
        return 13;
      case "cambodian":
        return 14;
      case "cjk-earthly-branch":
        return 15;
      case "cjk-heavenly-stem":
        return 16;
      case "cjk-ideographic":
        return 17;
      case "devanagari":
        return 18;
      case "ethiopic-numeric":
        return 19;
      case "georgian":
        return 20;
      case "gujarati":
        return 21;
      case "gurmukhi":
        return 22;
      case "hebrew":
        return 22;
      case "hiragana":
        return 23;
      case "hiragana-iroha":
        return 24;
      case "japanese-formal":
        return 25;
      case "japanese-informal":
        return 26;
      case "kannada":
        return 27;
      case "katakana":
        return 28;
      case "katakana-iroha":
        return 29;
      case "khmer":
        return 30;
      case "korean-hangul-formal":
        return 31;
      case "korean-hanja-formal":
        return 32;
      case "korean-hanja-informal":
        return 33;
      case "lao":
        return 34;
      case "lower-armenian":
        return 35;
      case "malayalam":
        return 36;
      case "mongolian":
        return 37;
      case "myanmar":
        return 38;
      case "oriya":
        return 39;
      case "persian":
        return 40;
      case "simp-chinese-formal":
        return 41;
      case "simp-chinese-informal":
        return 42;
      case "tamil":
        return 43;
      case "telugu":
        return 44;
      case "thai":
        return 45;
      case "tibetan":
        return 46;
      case "trad-chinese-formal":
        return 47;
      case "trad-chinese-informal":
        return 48;
      case "upper-armenian":
        return 49;
      case "disclosure-open":
        return 50;
      case "disclosure-closed":
        return 51;
      case "none":
      default:
        return -1;
    }
  }
}, tf = function(n) {
  return {
    name: "margin-" + n,
    initialValue: "0",
    prefix: !1,
    type: 4
    /* TOKEN_VALUE */
  };
}, YN = tf("top"), GN = tf("right"), zN = tf("bottom"), XN = tf("left"), JN = {
  name: "overflow",
  initialValue: "visible",
  prefix: !1,
  type: 1,
  parse: function(n, t) {
    return t.filter(jn).map(function(e) {
      switch (e.value) {
        case "hidden":
          return 1;
        case "scroll":
          return 2;
        case "clip":
          return 3;
        case "auto":
          return 4;
        case "visible":
        default:
          return 0;
      }
    });
  }
}, ZN = {
  name: "overflow-wrap",
  initialValue: "normal",
  prefix: !1,
  type: 2,
  parse: function(n, t) {
    switch (t) {
      case "break-word":
        return "break-word";
      case "normal":
      default:
        return "normal";
    }
  }
}, rf = function(n) {
  return {
    name: "padding-" + n,
    initialValue: "0",
    prefix: !1,
    type: 3,
    format: "length-percentage"
  };
}, eH = rf("top"), tH = rf("right"), rH = rf("bottom"), nH = rf("left"), aH = {
  name: "text-align",
  initialValue: "left",
  prefix: !1,
  type: 2,
  parse: function(n, t) {
    switch (t) {
      case "right":
        return 2;
      case "center":
      case "justify":
        return 1;
      case "left":
      default:
        return 0;
    }
  }
}, AH = {
  name: "position",
  initialValue: "static",
  prefix: !1,
  type: 2,
  parse: function(n, t) {
    switch (t) {
      case "relative":
        return 1;
      case "absolute":
        return 2;
      case "fixed":
        return 3;
      case "sticky":
        return 4;
    }
    return 0;
  }
}, sH = {
  name: "text-shadow",
  initialValue: "none",
  type: 1,
  prefix: !1,
  parse: function(n, t) {
    return t.length === 1 && Hp(t[0], "none") ? [] : Ri(t).map(function(e) {
      for (var r = {
        color: ao.TRANSPARENT,
        offsetX: _A,
        offsetY: _A,
        blur: _A
      }, a = 0, A = 0; A < e.length; A++) {
        var i = e[A];
        No(i) ? (a === 0 ? r.offsetX = i : a === 1 ? r.offsetY = i : r.blur = i, a++) : r.color = Mo.parse(n, i);
      }
      return r;
    });
  }
}, iH = {
  name: "text-transform",
  initialValue: "none",
  prefix: !1,
  type: 2,
  parse: function(n, t) {
    switch (t) {
      case "uppercase":
        return 2;
      case "lowercase":
        return 1;
      case "capitalize":
        return 3;
    }
    return 0;
  }
}, oH = {
  name: "transform",
  initialValue: "none",
  prefix: !0,
  type: 0,
  parse: function(n, t) {
    if (t.type === 20 && t.value === "none")
      return null;
    if (t.type === 18) {
      var e = cH[t.name];
      if (typeof e > "u")
        throw new Error('Attempting to parse an unsupported transform function "' + t.name + '"');
      return e(t.values);
    }
    return null;
  }
}, lH = function(n) {
  var t = n.filter(function(e) {
    return e.type === 17;
  }).map(function(e) {
    return e.number;
  });
  return t.length === 6 ? t : null;
}, uH = function(n) {
  var t = n.filter(function(o) {
    return o.type === 17;
  }).map(function(o) {
    return o.number;
  }), e = t[0], r = t[1];
  t[2], t[3];
  var a = t[4], A = t[5];
  t[6], t[7], t[8], t[9], t[10], t[11];
  var i = t[12], s = t[13];
  return t[14], t[15], t.length === 16 ? [e, r, a, A, i, s] : null;
}, cH = {
  matrix: lH,
  matrix3d: uH
}, Qw = {
  type: 16,
  number: 50,
  flags: Xu
}, dH = [Qw, Qw], fH = {
  name: "transform-origin",
  initialValue: "50% 50%",
  prefix: !0,
  type: 1,
  parse: function(n, t) {
    var e = t.filter(AA);
    return e.length !== 2 ? dH : [e[0], e[1]];
  }
}, hH = {
  name: "visible",
  initialValue: "none",
  prefix: !1,
  type: 2,
  parse: function(n, t) {
    switch (t) {
      case "hidden":
        return 1;
      case "collapse":
        return 2;
      case "visible":
      default:
        return 0;
    }
  }
}, Ou;
(function(n) {
  n.NORMAL = "normal", n.BREAK_ALL = "break-all", n.KEEP_ALL = "keep-all";
})(Ou || (Ou = {}));
var gH = {
  name: "word-break",
  initialValue: "normal",
  prefix: !1,
  type: 2,
  parse: function(n, t) {
    switch (t) {
      case "break-all":
        return Ou.BREAK_ALL;
      case "keep-all":
        return Ou.KEEP_ALL;
      case "normal":
      default:
        return Ou.NORMAL;
    }
  }
}, vH = {
  name: "z-index",
  initialValue: "auto",
  prefix: !1,
  type: 0,
  parse: function(n, t) {
    if (t.type === 20)
      return { auto: !0, order: 0 };
    if (eu(t))
      return { auto: !1, order: t.number };
    throw new Error("Invalid z-index number parsed");
  }
}, GC = {
  name: "time",
  parse: function(n, t) {
    if (t.type === 15)
      switch (t.unit.toLowerCase()) {
        case "s":
          return 1e3 * t.number;
        case "ms":
          return t.number;
      }
    throw new Error("Unsupported time type");
  }
}, pH = {
  name: "opacity",
  initialValue: "1",
  type: 0,
  prefix: !1,
  parse: function(n, t) {
    return eu(t) ? t.number : 1;
  }
}, mH = {
  name: "text-decoration-color",
  initialValue: "transparent",
  prefix: !1,
  type: 3,
  format: "color"
}, wH = {
  name: "text-decoration-line",
  initialValue: "none",
  prefix: !1,
  type: 1,
  parse: function(n, t) {
    return t.filter(jn).map(function(e) {
      switch (e.value) {
        case "underline":
          return 1;
        case "overline":
          return 2;
        case "line-through":
          return 3;
        case "none":
          return 4;
      }
      return 0;
    }).filter(function(e) {
      return e !== 0;
    });
  }
}, yH = {
  name: "font-family",
  initialValue: "",
  prefix: !1,
  type: 1,
  parse: function(n, t) {
    var e = [], r = [];
    return t.forEach(function(a) {
      switch (a.type) {
        case 20:
        case 0:
          e.push(a.value);
          break;
        case 17:
          e.push(a.number.toString());
          break;
        case 4:
          r.push(e.join(" ")), e.length = 0;
          break;
      }
    }), e.length && r.push(e.join(" ")), r.map(function(a) {
      return a.indexOf(" ") === -1 ? a : "'" + a + "'";
    });
  }
}, BH = {
  name: "font-size",
  initialValue: "0",
  prefix: !1,
  type: 3,
  format: "length"
}, bH = {
  name: "font-weight",
  initialValue: "normal",
  type: 0,
  prefix: !1,
  parse: function(n, t) {
    if (eu(t))
      return t.number;
    if (jn(t))
      switch (t.value) {
        case "bold":
          return 700;
        case "normal":
        default:
          return 400;
      }
    return 400;
  }
}, CH = {
  name: "font-variant",
  initialValue: "none",
  type: 1,
  prefix: !1,
  parse: function(n, t) {
    return t.filter(jn).map(function(e) {
      return e.value;
    });
  }
}, kH = {
  name: "font-style",
  initialValue: "normal",
  prefix: !1,
  type: 2,
  parse: function(n, t) {
    switch (t) {
      case "oblique":
        return "oblique";
      case "italic":
        return "italic";
      case "normal":
      default:
        return "normal";
    }
  }
}, fA = function(n, t) {
  return (n & t) !== 0;
}, TH = {
  name: "content",
  initialValue: "none",
  type: 1,
  prefix: !1,
  parse: function(n, t) {
    if (t.length === 0)
      return [];
    var e = t[0];
    return e.type === 20 && e.value === "none" ? [] : t;
  }
}, xH = {
  name: "counter-increment",
  initialValue: "none",
  prefix: !0,
  type: 1,
  parse: function(n, t) {
    if (t.length === 0)
      return null;
    var e = t[0];
    if (e.type === 20 && e.value === "none")
      return null;
    for (var r = [], a = t.filter(LC), A = 0; A < a.length; A++) {
      var i = a[A], s = a[A + 1];
      if (i.type === 20) {
        var o = s && eu(s) ? s.number : 1;
        r.push({ counter: i.value, increment: o });
      }
    }
    return r;
  }
}, DH = {
  name: "counter-reset",
  initialValue: "none",
  prefix: !0,
  type: 1,
  parse: function(n, t) {
    if (t.length === 0)
      return [];
    for (var e = [], r = t.filter(LC), a = 0; a < r.length; a++) {
      var A = r[a], i = r[a + 1];
      if (jn(A) && A.value !== "none") {
        var s = i && eu(i) ? i.number : 0;
        e.push({ counter: A.value, reset: s });
      }
    }
    return e;
  }
}, EH = {
  name: "duration",
  initialValue: "0s",
  prefix: !1,
  type: 1,
  parse: function(n, t) {
    return t.filter(Ju).map(function(e) {
      return GC.parse(n, e);
    });
  }
}, SH = {
  name: "quotes",
  initialValue: "none",
  prefix: !0,
  type: 1,
  parse: function(n, t) {
    if (t.length === 0)
      return null;
    var e = t[0];
    if (e.type === 20 && e.value === "none")
      return null;
    var r = [], a = t.filter(tN);
    if (a.length % 2 !== 0)
      return null;
    for (var A = 0; A < a.length; A += 2) {
      var i = a[A].value, s = a[A + 1].value;
      r.push({ open: i, close: s });
    }
    return r;
  }
}, Mw = function(n, t, e) {
  if (!n)
    return "";
  var r = n[Math.min(t, n.length - 1)];
  return r ? e ? r.open : r.close : "";
}, FH = {
  name: "box-shadow",
  initialValue: "none",
  type: 1,
  prefix: !1,
  parse: function(n, t) {
    return t.length === 1 && Hp(t[0], "none") ? [] : Ri(t).map(function(e) {
      for (var r = {
        color: 255,
        offsetX: _A,
        offsetY: _A,
        blur: _A,
        spread: _A,
        inset: !1
      }, a = 0, A = 0; A < e.length; A++) {
        var i = e[A];
        Hp(i, "inset") ? r.inset = !0 : No(i) ? (a === 0 ? r.offsetX = i : a === 1 ? r.offsetY = i : a === 2 ? r.blur = i : r.spread = i, a++) : r.color = Mo.parse(n, i);
      }
      return r;
    });
  }
}, UH = {
  name: "paint-order",
  initialValue: "normal",
  prefix: !1,
  type: 1,
  parse: function(n, t) {
    var e = [
      0,
      1,
      2
      /* MARKERS */
    ], r = [];
    return t.filter(jn).forEach(function(a) {
      switch (a.value) {
        case "stroke":
          r.push(
            1
            /* STROKE */
          );
          break;
        case "fill":
          r.push(
            0
            /* FILL */
          );
          break;
        case "markers":
          r.push(
            2
            /* MARKERS */
          );
          break;
      }
    }), e.forEach(function(a) {
      r.indexOf(a) === -1 && r.push(a);
    }), r;
  }
}, LH = {
  name: "-webkit-text-stroke-color",
  initialValue: "currentcolor",
  prefix: !1,
  type: 3,
  format: "color"
}, IH = {
  name: "-webkit-text-stroke-width",
  initialValue: "0",
  type: 0,
  prefix: !1,
  parse: function(n, t) {
    return Ju(t) ? t.number : 0;
  }
}, QH = (
  /** @class */
  (function() {
    function n(t, e) {
      var r, a;
      this.animationDuration = ur(t, EH, e.animationDuration), this.backgroundClip = ur(t, aN, e.backgroundClip), this.backgroundColor = ur(t, AN, e.backgroundColor), this.backgroundImage = ur(t, gN, e.backgroundImage), this.backgroundOrigin = ur(t, vN, e.backgroundOrigin), this.backgroundPosition = ur(t, pN, e.backgroundPosition), this.backgroundRepeat = ur(t, mN, e.backgroundRepeat), this.backgroundSize = ur(t, yN, e.backgroundSize), this.borderTopColor = ur(t, bN, e.borderTopColor), this.borderRightColor = ur(t, CN, e.borderRightColor), this.borderBottomColor = ur(t, kN, e.borderBottomColor), this.borderLeftColor = ur(t, TN, e.borderLeftColor), this.borderTopLeftRadius = ur(t, xN, e.borderTopLeftRadius), this.borderTopRightRadius = ur(t, DN, e.borderTopRightRadius), this.borderBottomRightRadius = ur(t, EN, e.borderBottomRightRadius), this.borderBottomLeftRadius = ur(t, SN, e.borderBottomLeftRadius), this.borderTopStyle = ur(t, FN, e.borderTopStyle), this.borderRightStyle = ur(t, UN, e.borderRightStyle), this.borderBottomStyle = ur(t, LN, e.borderBottomStyle), this.borderLeftStyle = ur(t, IN, e.borderLeftStyle), this.borderTopWidth = ur(t, QN, e.borderTopWidth), this.borderRightWidth = ur(t, MN, e.borderRightWidth), this.borderBottomWidth = ur(t, _N, e.borderBottomWidth), this.borderLeftWidth = ur(t, RN, e.borderLeftWidth), this.boxShadow = ur(t, FH, e.boxShadow), this.color = ur(t, NN, e.color), this.direction = ur(t, HN, e.direction), this.display = ur(t, ON, e.display), this.float = ur(t, WN, e.cssFloat), this.fontFamily = ur(t, yH, e.fontFamily), this.fontSize = ur(t, BH, e.fontSize), this.fontStyle = ur(t, kH, e.fontStyle), this.fontVariant = ur(t, CH, e.fontVariant), this.fontWeight = ur(t, bH, e.fontWeight), this.letterSpacing = ur(t, KN, e.letterSpacing), this.lineBreak = ur(t, $N, e.lineBreak), this.lineHeight = ur(t, VN, e.lineHeight), this.listStyleImage = ur(t, qN, e.listStyleImage), this.listStylePosition = ur(t, jN, e.listStylePosition), this.listStyleType = ur(t, Op, e.listStyleType), this.marginTop = ur(t, YN, e.marginTop), this.marginRight = ur(t, GN, e.marginRight), this.marginBottom = ur(t, zN, e.marginBottom), this.marginLeft = ur(t, XN, e.marginLeft), this.opacity = ur(t, pH, e.opacity);
      var A = ur(t, JN, e.overflow);
      this.overflowX = A[0], this.overflowY = A[A.length > 1 ? 1 : 0], this.overflowWrap = ur(t, ZN, e.overflowWrap), this.paddingTop = ur(t, eH, e.paddingTop), this.paddingRight = ur(t, tH, e.paddingRight), this.paddingBottom = ur(t, rH, e.paddingBottom), this.paddingLeft = ur(t, nH, e.paddingLeft), this.paintOrder = ur(t, UH, e.paintOrder), this.position = ur(t, AH, e.position), this.textAlign = ur(t, aH, e.textAlign), this.textDecorationColor = ur(t, mH, (r = e.textDecorationColor) !== null && r !== void 0 ? r : e.color), this.textDecorationLine = ur(t, wH, (a = e.textDecorationLine) !== null && a !== void 0 ? a : e.textDecoration), this.textShadow = ur(t, sH, e.textShadow), this.textTransform = ur(t, iH, e.textTransform), this.transform = ur(t, oH, e.transform), this.transformOrigin = ur(t, fH, e.transformOrigin), this.visibility = ur(t, hH, e.visibility), this.webkitTextStrokeColor = ur(t, LH, e.webkitTextStrokeColor), this.webkitTextStrokeWidth = ur(t, IH, e.webkitTextStrokeWidth), this.wordBreak = ur(t, gH, e.wordBreak), this.zIndex = ur(t, vH, e.zIndex);
    }
    return n.prototype.isVisible = function() {
      return this.display > 0 && this.opacity > 0 && this.visibility === 0;
    }, n.prototype.isTransparent = function() {
      return _o(this.backgroundColor);
    }, n.prototype.isTransformed = function() {
      return this.transform !== null;
    }, n.prototype.isPositioned = function() {
      return this.position !== 0;
    }, n.prototype.isPositionedWithZIndex = function() {
      return this.isPositioned() && !this.zIndex.auto;
    }, n.prototype.isFloating = function() {
      return this.float !== 0;
    }, n.prototype.isInlineLevel = function() {
      return fA(
        this.display,
        4
        /* INLINE */
      ) || fA(
        this.display,
        33554432
        /* INLINE_BLOCK */
      ) || fA(
        this.display,
        268435456
        /* INLINE_FLEX */
      ) || fA(
        this.display,
        536870912
        /* INLINE_GRID */
      ) || fA(
        this.display,
        67108864
        /* INLINE_LIST_ITEM */
      ) || fA(
        this.display,
        134217728
        /* INLINE_TABLE */
      );
    }, n;
  })()
), MH = (
  /** @class */
  /* @__PURE__ */ (function() {
    function n(t, e) {
      this.content = ur(t, TH, e.content), this.quotes = ur(t, SH, e.quotes);
    }
    return n;
  })()
), _w = (
  /** @class */
  /* @__PURE__ */ (function() {
    function n(t, e) {
      this.counterIncrement = ur(t, xH, e.counterIncrement), this.counterReset = ur(t, DH, e.counterReset);
    }
    return n;
  })()
), ur = function(n, t, e) {
  var r = new FC(), a = e !== null && typeof e < "u" ? e.toString() : t.initialValue;
  r.write(a);
  var A = new UC(r.read());
  switch (t.type) {
    case 2:
      var i = A.parseComponentValue();
      return t.parse(n, jn(i) ? i.value : t.initialValue);
    case 0:
      return t.parse(n, A.parseComponentValue());
    case 1:
      return t.parse(n, A.parseComponentValues());
    case 4:
      return A.parseComponentValue();
    case 3:
      switch (t.format) {
        case "angle":
          return Gd.parse(n, A.parseComponentValue());
        case "color":
          return Mo.parse(n, A.parseComponentValue());
        case "image":
          return x0.parse(n, A.parseComponentValue());
        case "length":
          var s = A.parseComponentValue();
          return No(s) ? s : _A;
        case "length-percentage":
          var o = A.parseComponentValue();
          return AA(o) ? o : _A;
        case "time":
          return GC.parse(n, A.parseComponentValue());
      }
      break;
  }
}, _H = "data-html2canvas-debug", RH = function(n) {
  var t = n.getAttribute(_H);
  switch (t) {
    case "all":
      return 1;
    case "clone":
      return 2;
    case "parse":
      return 3;
    case "render":
      return 4;
    default:
      return 0;
  }
}, Pp = function(n, t) {
  var e = RH(n);
  return e === 1 || t === e;
}, Ni = (
  /** @class */
  /* @__PURE__ */ (function() {
    function n(t, e) {
      if (this.context = t, this.textNodes = [], this.elements = [], this.flags = 0, Pp(
        e,
        3
        /* PARSE */
      ))
        debugger;
      this.styles = new QH(t, window.getComputedStyle(e, null)), $p(e) && (this.styles.animationDuration.some(function(r) {
        return r > 0;
      }) && (e.style.animationDuration = "0s"), this.styles.transform !== null && (e.style.transform = "none")), this.bounds = jd(this.context, e), Pp(
        e,
        4
        /* RENDER */
      ) && (this.flags |= 16);
    }
    return n;
  })()
), NH = "AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=", Rw = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Lu = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
for (var nd = 0; nd < Rw.length; nd++)
  Lu[Rw.charCodeAt(nd)] = nd;
var HH = function(n) {
  var t = n.length * 0.75, e = n.length, r, a = 0, A, i, s, o;
  n[n.length - 1] === "=" && (t--, n[n.length - 2] === "=" && t--);
  var l = typeof ArrayBuffer < "u" && typeof Uint8Array < "u" && typeof Uint8Array.prototype.slice < "u" ? new ArrayBuffer(t) : new Array(t), u = Array.isArray(l) ? l : new Uint8Array(l);
  for (r = 0; r < e; r += 4)
    A = Lu[n.charCodeAt(r)], i = Lu[n.charCodeAt(r + 1)], s = Lu[n.charCodeAt(r + 2)], o = Lu[n.charCodeAt(r + 3)], u[a++] = A << 2 | i >> 4, u[a++] = (i & 15) << 4 | s >> 2, u[a++] = (s & 3) << 6 | o & 63;
  return l;
}, OH = function(n) {
  for (var t = n.length, e = [], r = 0; r < t; r += 2)
    e.push(n[r + 1] << 8 | n[r]);
  return e;
}, PH = function(n) {
  for (var t = n.length, e = [], r = 0; r < t; r += 4)
    e.push(n[r + 3] << 24 | n[r + 2] << 16 | n[r + 1] << 8 | n[r]);
  return e;
}, il = 5, D0 = 11, ih = 2, WH = D0 - il, zC = 65536 >> il, KH = 1 << il, oh = KH - 1, $H = 1024 >> il, VH = zC + $H, qH = VH, jH = 32, YH = qH + jH, GH = 65536 >> D0, zH = 1 << WH, XH = zH - 1, Nw = function(n, t, e) {
  return n.slice ? n.slice(t, e) : new Uint16Array(Array.prototype.slice.call(n, t, e));
}, JH = function(n, t, e) {
  return n.slice ? n.slice(t, e) : new Uint32Array(Array.prototype.slice.call(n, t, e));
}, ZH = function(n, t) {
  var e = HH(n), r = Array.isArray(e) ? PH(e) : new Uint32Array(e), a = Array.isArray(e) ? OH(e) : new Uint16Array(e), A = 24, i = Nw(a, A / 2, r[4] / 2), s = r[5] === 2 ? Nw(a, (A + r[4]) / 2) : JH(r, Math.ceil((A + r[4]) / 4));
  return new eO(r[0], r[1], r[2], r[3], i, s);
}, eO = (
  /** @class */
  (function() {
    function n(t, e, r, a, A, i) {
      this.initialValue = t, this.errorValue = e, this.highStart = r, this.highValueIndex = a, this.index = A, this.data = i;
    }
    return n.prototype.get = function(t) {
      var e;
      if (t >= 0) {
        if (t < 55296 || t > 56319 && t <= 65535)
          return e = this.index[t >> il], e = (e << ih) + (t & oh), this.data[e];
        if (t <= 65535)
          return e = this.index[zC + (t - 55296 >> il)], e = (e << ih) + (t & oh), this.data[e];
        if (t < this.highStart)
          return e = YH - GH + (t >> D0), e = this.index[e], e += t >> il & XH, e = this.index[e], e = (e << ih) + (t & oh), this.data[e];
        if (t <= 1114111)
          return this.data[this.highValueIndex];
      }
      return this.errorValue;
    }, n;
  })()
), Hw = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", tO = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
for (var ad = 0; ad < Hw.length; ad++)
  tO[Hw.charCodeAt(ad)] = ad;
var rO = 1, lh = 2, uh = 3, Ow = 4, Pw = 5, nO = 7, Ww = 8, ch = 9, dh = 10, Kw = 11, $w = 12, Vw = 13, qw = 14, fh = 15, aO = function(n) {
  for (var t = [], e = 0, r = n.length; e < r; ) {
    var a = n.charCodeAt(e++);
    if (a >= 55296 && a <= 56319 && e < r) {
      var A = n.charCodeAt(e++);
      (A & 64512) === 56320 ? t.push(((a & 1023) << 10) + (A & 1023) + 65536) : (t.push(a), e--);
    } else
      t.push(a);
  }
  return t;
}, AO = function() {
  for (var n = [], t = 0; t < arguments.length; t++)
    n[t] = arguments[t];
  if (String.fromCodePoint)
    return String.fromCodePoint.apply(String, n);
  var e = n.length;
  if (!e)
    return "";
  for (var r = [], a = -1, A = ""; ++a < e; ) {
    var i = n[a];
    i <= 65535 ? r.push(i) : (i -= 65536, r.push((i >> 10) + 55296, i % 1024 + 56320)), (a + 1 === e || r.length > 16384) && (A += String.fromCharCode.apply(String, r), r.length = 0);
  }
  return A;
}, sO = ZH(NH), Ks = "×", hh = "÷", iO = function(n) {
  return sO.get(n);
}, oO = function(n, t, e) {
  var r = e - 2, a = t[r], A = t[e - 1], i = t[e];
  if (A === lh && i === uh)
    return Ks;
  if (A === lh || A === uh || A === Ow || i === lh || i === uh || i === Ow)
    return hh;
  if (A === Ww && [Ww, ch, Kw, $w].indexOf(i) !== -1 || (A === Kw || A === ch) && (i === ch || i === dh) || (A === $w || A === dh) && i === dh || i === Vw || i === Pw || i === nO || A === rO)
    return Ks;
  if (A === Vw && i === qw) {
    for (; a === Pw; )
      a = t[--r];
    if (a === qw)
      return Ks;
  }
  if (A === fh && i === fh) {
    for (var s = 0; a === fh; )
      s++, a = t[--r];
    if (s % 2 === 0)
      return Ks;
  }
  return hh;
}, lO = function(n) {
  var t = aO(n), e = t.length, r = 0, a = 0, A = t.map(iO);
  return {
    next: function() {
      if (r >= e)
        return { done: !0, value: null };
      for (var i = Ks; r < e && (i = oO(t, A, ++r)) === Ks; )
        ;
      if (i !== Ks || r === e) {
        var s = AO.apply(null, t.slice(a, r));
        return a = r, { value: s, done: !1 };
      }
      return { done: !0, value: null };
    }
  };
}, uO = function(n) {
  for (var t = lO(n), e = [], r; !(r = t.next()).done; )
    r.value && e.push(r.value.slice());
  return e;
}, cO = function(n) {
  var t = 123;
  if (n.createRange) {
    var e = n.createRange();
    if (e.getBoundingClientRect) {
      var r = n.createElement("boundtest");
      r.style.height = t + "px", r.style.display = "block", n.body.appendChild(r), e.selectNode(r);
      var a = e.getBoundingClientRect(), A = Math.round(a.height);
      if (n.body.removeChild(r), A === t)
        return !0;
    }
  }
  return !1;
}, dO = function(n) {
  var t = n.createElement("boundtest");
  t.style.width = "50px", t.style.display = "block", t.style.fontSize = "12px", t.style.letterSpacing = "0px", t.style.wordSpacing = "0px", n.body.appendChild(t);
  var e = n.createRange();
  t.innerHTML = typeof "".repeat == "function" ? "&#128104;".repeat(10) : "";
  var r = t.firstChild, a = Yd(r.data).map(function(o) {
    return Va(o);
  }), A = 0, i = {}, s = a.every(function(o, l) {
    e.setStart(r, A), e.setEnd(r, A + o.length);
    var u = e.getBoundingClientRect();
    A += o.length;
    var f = u.x > i.x || u.y > i.y;
    return i = u, l === 0 ? !0 : f;
  });
  return n.body.removeChild(t), s;
}, fO = function() {
  return typeof new Image().crossOrigin < "u";
}, hO = function() {
  return typeof new XMLHttpRequest().responseType == "string";
}, gO = function(n) {
  var t = new Image(), e = n.createElement("canvas"), r = e.getContext("2d");
  if (!r)
    return !1;
  t.src = "data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";
  try {
    r.drawImage(t, 0, 0), e.toDataURL();
  } catch {
    return !1;
  }
  return !0;
}, jw = function(n) {
  return n[0] === 0 && n[1] === 255 && n[2] === 0 && n[3] === 255;
}, vO = function(n) {
  var t = n.createElement("canvas"), e = 100;
  t.width = e, t.height = e;
  var r = t.getContext("2d");
  if (!r)
    return Promise.reject(!1);
  r.fillStyle = "rgb(0, 255, 0)", r.fillRect(0, 0, e, e);
  var a = new Image(), A = t.toDataURL();
  a.src = A;
  var i = Wp(e, e, 0, 0, a);
  return r.fillStyle = "red", r.fillRect(0, 0, e, e), Yw(i).then(function(s) {
    r.drawImage(s, 0, 0);
    var o = r.getImageData(0, 0, e, e).data;
    r.fillStyle = "red", r.fillRect(0, 0, e, e);
    var l = n.createElement("div");
    return l.style.backgroundImage = "url(" + A + ")", l.style.height = e + "px", jw(o) ? Yw(Wp(e, e, 0, 0, l)) : Promise.reject(!1);
  }).then(function(s) {
    return r.drawImage(s, 0, 0), jw(r.getImageData(0, 0, e, e).data);
  }).catch(function() {
    return !1;
  });
}, Wp = function(n, t, e, r, a) {
  var A = "http://www.w3.org/2000/svg", i = document.createElementNS(A, "svg"), s = document.createElementNS(A, "foreignObject");
  return i.setAttributeNS(null, "width", n.toString()), i.setAttributeNS(null, "height", t.toString()), s.setAttributeNS(null, "width", "100%"), s.setAttributeNS(null, "height", "100%"), s.setAttributeNS(null, "x", e.toString()), s.setAttributeNS(null, "y", r.toString()), s.setAttributeNS(null, "externalResourcesRequired", "true"), i.appendChild(s), s.appendChild(a), i;
}, Yw = function(n) {
  return new Promise(function(t, e) {
    var r = new Image();
    r.onload = function() {
      return t(r);
    }, r.onerror = e, r.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(n));
  });
}, MA = {
  get SUPPORT_RANGE_BOUNDS() {
    var n = cO(document);
    return Object.defineProperty(MA, "SUPPORT_RANGE_BOUNDS", { value: n }), n;
  },
  get SUPPORT_WORD_BREAKING() {
    var n = MA.SUPPORT_RANGE_BOUNDS && dO(document);
    return Object.defineProperty(MA, "SUPPORT_WORD_BREAKING", { value: n }), n;
  },
  get SUPPORT_SVG_DRAWING() {
    var n = gO(document);
    return Object.defineProperty(MA, "SUPPORT_SVG_DRAWING", { value: n }), n;
  },
  get SUPPORT_FOREIGNOBJECT_DRAWING() {
    var n = typeof Array.from == "function" && typeof window.fetch == "function" ? vO(document) : Promise.resolve(!1);
    return Object.defineProperty(MA, "SUPPORT_FOREIGNOBJECT_DRAWING", { value: n }), n;
  },
  get SUPPORT_CORS_IMAGES() {
    var n = fO();
    return Object.defineProperty(MA, "SUPPORT_CORS_IMAGES", { value: n }), n;
  },
  get SUPPORT_RESPONSE_TYPE() {
    var n = hO();
    return Object.defineProperty(MA, "SUPPORT_RESPONSE_TYPE", { value: n }), n;
  },
  get SUPPORT_CORS_XHR() {
    var n = "withCredentials" in new XMLHttpRequest();
    return Object.defineProperty(MA, "SUPPORT_CORS_XHR", { value: n }), n;
  },
  get SUPPORT_NATIVE_TEXT_SEGMENTATION() {
    var n = !!(typeof Intl < "u" && Intl.Segmenter);
    return Object.defineProperty(MA, "SUPPORT_NATIVE_TEXT_SEGMENTATION", { value: n }), n;
  }
}, Pu = (
  /** @class */
  /* @__PURE__ */ (function() {
    function n(t, e) {
      this.text = t, this.bounds = e;
    }
    return n;
  })()
), pO = function(n, t, e, r) {
  var a = yO(t, e), A = [], i = 0;
  return a.forEach(function(s) {
    if (e.textDecorationLine.length || s.trim().length > 0)
      if (MA.SUPPORT_RANGE_BOUNDS) {
        var o = Gw(r, i, s.length).getClientRects();
        if (o.length > 1) {
          var l = E0(s), u = 0;
          l.forEach(function(h) {
            A.push(new Pu(h, so.fromDOMRectList(n, Gw(r, u + i, h.length).getClientRects()))), u += h.length;
          });
        } else
          A.push(new Pu(s, so.fromDOMRectList(n, o)));
      } else {
        var f = r.splitText(s.length);
        A.push(new Pu(s, mO(n, r))), r = f;
      }
    else MA.SUPPORT_RANGE_BOUNDS || (r = r.splitText(s.length));
    i += s.length;
  }), A;
}, mO = function(n, t) {
  var e = t.ownerDocument;
  if (e) {
    var r = e.createElement("html2canvaswrapper");
    r.appendChild(t.cloneNode(!0));
    var a = t.parentNode;
    if (a) {
      a.replaceChild(r, t);
      var A = jd(n, r);
      return r.firstChild && a.replaceChild(r.firstChild, r), A;
    }
  }
  return so.EMPTY;
}, Gw = function(n, t, e) {
  var r = n.ownerDocument;
  if (!r)
    throw new Error("Node has no owner document");
  var a = r.createRange();
  return a.setStart(n, t), a.setEnd(n, t + e), a;
}, E0 = function(n) {
  if (MA.SUPPORT_NATIVE_TEXT_SEGMENTATION) {
    var t = new Intl.Segmenter(void 0, { granularity: "grapheme" });
    return Array.from(t.segment(n)).map(function(e) {
      return e.segment;
    });
  }
  return uO(n);
}, wO = function(n, t) {
  if (MA.SUPPORT_NATIVE_TEXT_SEGMENTATION) {
    var e = new Intl.Segmenter(void 0, {
      granularity: "word"
    });
    return Array.from(e.segment(n)).map(function(r) {
      return r.segment;
    });
  }
  return bO(n, t);
}, yO = function(n, t) {
  return t.letterSpacing !== 0 ? E0(n) : wO(n, t);
}, BO = [32, 160, 4961, 65792, 65793, 4153, 4241], bO = function(n, t) {
  for (var e = G_(n, {
    lineBreak: t.lineBreak,
    wordBreak: t.overflowWrap === "break-word" ? "break-word" : t.wordBreak
  }), r = [], a, A = function() {
    if (a.value) {
      var i = a.value.slice(), s = Yd(i), o = "";
      s.forEach(function(l) {
        BO.indexOf(l) === -1 ? o += Va(l) : (o.length && r.push(o), r.push(Va(l)), o = "");
      }), o.length && r.push(o);
    }
  }; !(a = e.next()).done; )
    A();
  return r;
}, CO = (
  /** @class */
  /* @__PURE__ */ (function() {
    function n(t, e, r) {
      this.text = kO(e.data, r.textTransform), this.textBounds = pO(t, this.text, r, e);
    }
    return n;
  })()
), kO = function(n, t) {
  switch (t) {
    case 1:
      return n.toLowerCase();
    case 3:
      return n.replace(TO, xO);
    case 2:
      return n.toUpperCase();
    default:
      return n;
  }
}, TO = /(^|\s|:|-|\(|\))([a-z])/g, xO = function(n, t, e) {
  return n.length > 0 ? t + e.toUpperCase() : n;
}, XC = (
  /** @class */
  (function(n) {
    mi(t, n);
    function t(e, r) {
      var a = n.call(this, e, r) || this;
      return a.src = r.currentSrc || r.src, a.intrinsicWidth = r.naturalWidth, a.intrinsicHeight = r.naturalHeight, a.context.cache.addImage(a.src), a;
    }
    return t;
  })(Ni)
), JC = (
  /** @class */
  (function(n) {
    mi(t, n);
    function t(e, r) {
      var a = n.call(this, e, r) || this;
      return a.canvas = r, a.intrinsicWidth = r.width, a.intrinsicHeight = r.height, a;
    }
    return t;
  })(Ni)
), ZC = (
  /** @class */
  (function(n) {
    mi(t, n);
    function t(e, r) {
      var a = n.call(this, e, r) || this, A = new XMLSerializer(), i = jd(e, r);
      return r.setAttribute("width", i.width + "px"), r.setAttribute("height", i.height + "px"), a.svg = "data:image/svg+xml," + encodeURIComponent(A.serializeToString(r)), a.intrinsicWidth = r.width.baseVal.value, a.intrinsicHeight = r.height.baseVal.value, a.context.cache.addImage(a.svg), a;
    }
    return t;
  })(Ni)
), ek = (
  /** @class */
  (function(n) {
    mi(t, n);
    function t(e, r) {
      var a = n.call(this, e, r) || this;
      return a.value = r.value, a;
    }
    return t;
  })(Ni)
), Kp = (
  /** @class */
  (function(n) {
    mi(t, n);
    function t(e, r) {
      var a = n.call(this, e, r) || this;
      return a.start = r.start, a.reversed = typeof r.reversed == "boolean" && r.reversed === !0, a;
    }
    return t;
  })(Ni)
), DO = [
  {
    type: 15,
    flags: 0,
    unit: "px",
    number: 3
  }
], EO = [
  {
    type: 16,
    flags: 0,
    number: 50
  }
], SO = function(n) {
  return n.width > n.height ? new so(n.left + (n.width - n.height) / 2, n.top, n.height, n.height) : n.width < n.height ? new so(n.left, n.top + (n.height - n.width) / 2, n.width, n.width) : n;
}, FO = function(n) {
  var t = n.type === UO ? new Array(n.value.length + 1).join("•") : n.value;
  return t.length === 0 ? n.placeholder || "" : t;
}, Rd = "checkbox", Nd = "radio", UO = "password", zw = 707406591, S0 = (
  /** @class */
  (function(n) {
    mi(t, n);
    function t(e, r) {
      var a = n.call(this, e, r) || this;
      switch (a.type = r.type.toLowerCase(), a.checked = r.checked, a.value = FO(r), (a.type === Rd || a.type === Nd) && (a.styles.backgroundColor = 3739148031, a.styles.borderTopColor = a.styles.borderRightColor = a.styles.borderBottomColor = a.styles.borderLeftColor = 2779096575, a.styles.borderTopWidth = a.styles.borderRightWidth = a.styles.borderBottomWidth = a.styles.borderLeftWidth = 1, a.styles.borderTopStyle = a.styles.borderRightStyle = a.styles.borderBottomStyle = a.styles.borderLeftStyle = 1, a.styles.backgroundClip = [
        0
        /* BORDER_BOX */
      ], a.styles.backgroundOrigin = [
        0
        /* BORDER_BOX */
      ], a.bounds = SO(a.bounds)), a.type) {
        case Rd:
          a.styles.borderTopRightRadius = a.styles.borderTopLeftRadius = a.styles.borderBottomRightRadius = a.styles.borderBottomLeftRadius = DO;
          break;
        case Nd:
          a.styles.borderTopRightRadius = a.styles.borderTopLeftRadius = a.styles.borderBottomRightRadius = a.styles.borderBottomLeftRadius = EO;
          break;
      }
      return a;
    }
    return t;
  })(Ni)
), tk = (
  /** @class */
  (function(n) {
    mi(t, n);
    function t(e, r) {
      var a = n.call(this, e, r) || this, A = r.options[r.selectedIndex || 0];
      return a.value = A && A.text || "", a;
    }
    return t;
  })(Ni)
), rk = (
  /** @class */
  (function(n) {
    mi(t, n);
    function t(e, r) {
      var a = n.call(this, e, r) || this;
      return a.value = r.value, a;
    }
    return t;
  })(Ni)
), nk = (
  /** @class */
  (function(n) {
    mi(t, n);
    function t(e, r) {
      var a = n.call(this, e, r) || this;
      a.src = r.src, a.width = parseInt(r.width, 10) || 0, a.height = parseInt(r.height, 10) || 0, a.backgroundColor = a.styles.backgroundColor;
      try {
        if (r.contentWindow && r.contentWindow.document && r.contentWindow.document.documentElement) {
          a.tree = Ak(e, r.contentWindow.document.documentElement);
          var A = r.contentWindow.document.documentElement ? Hu(e, getComputedStyle(r.contentWindow.document.documentElement).backgroundColor) : ao.TRANSPARENT, i = r.contentWindow.document.body ? Hu(e, getComputedStyle(r.contentWindow.document.body).backgroundColor) : ao.TRANSPARENT;
          a.backgroundColor = _o(A) ? _o(i) ? a.styles.backgroundColor : i : A;
        }
      } catch {
      }
      return a;
    }
    return t;
  })(Ni)
), LO = ["OL", "UL", "MENU"], kd = function(n, t, e, r) {
  for (var a = t.firstChild, A = void 0; a; a = A)
    if (A = a.nextSibling, sk(a) && a.data.trim().length > 0)
      e.textNodes.push(new CO(n, a, e.styles));
    else if (Wl(a))
      if (uk(a) && a.assignedNodes)
        a.assignedNodes().forEach(function(s) {
          return kd(n, s, e, r);
        });
      else {
        var i = ak(n, a);
        i.styles.isVisible() && (IO(a, i, r) ? i.flags |= 4 : QO(i.styles) && (i.flags |= 2), LO.indexOf(a.tagName) !== -1 && (i.flags |= 8), e.elements.push(i), a.slot, a.shadowRoot ? kd(n, a.shadowRoot, i, r) : !Hd(a) && !ik(a) && !Od(a) && kd(n, a, i, r));
      }
}, ak = function(n, t) {
  return Vp(t) ? new XC(n, t) : ok(t) ? new JC(n, t) : ik(t) ? new ZC(n, t) : MO(t) ? new ek(n, t) : _O(t) ? new Kp(n, t) : RO(t) ? new S0(n, t) : Od(t) ? new tk(n, t) : Hd(t) ? new rk(n, t) : lk(t) ? new nk(n, t) : new Ni(n, t);
}, Ak = function(n, t) {
  var e = ak(n, t);
  return e.flags |= 4, kd(n, t, e, e), e;
}, IO = function(n, t, e) {
  return t.styles.isPositionedWithZIndex() || t.styles.opacity < 1 || t.styles.isTransformed() || F0(n) && e.styles.isTransparent();
}, QO = function(n) {
  return n.isPositioned() || n.isFloating();
}, sk = function(n) {
  return n.nodeType === Node.TEXT_NODE;
}, Wl = function(n) {
  return n.nodeType === Node.ELEMENT_NODE;
}, $p = function(n) {
  return Wl(n) && typeof n.style < "u" && !Td(n);
}, Td = function(n) {
  return typeof n.className == "object";
}, MO = function(n) {
  return n.tagName === "LI";
}, _O = function(n) {
  return n.tagName === "OL";
}, RO = function(n) {
  return n.tagName === "INPUT";
}, NO = function(n) {
  return n.tagName === "HTML";
}, ik = function(n) {
  return n.tagName === "svg";
}, F0 = function(n) {
  return n.tagName === "BODY";
}, ok = function(n) {
  return n.tagName === "CANVAS";
}, Xw = function(n) {
  return n.tagName === "VIDEO";
}, Vp = function(n) {
  return n.tagName === "IMG";
}, lk = function(n) {
  return n.tagName === "IFRAME";
}, Jw = function(n) {
  return n.tagName === "STYLE";
}, HO = function(n) {
  return n.tagName === "SCRIPT";
}, Hd = function(n) {
  return n.tagName === "TEXTAREA";
}, Od = function(n) {
  return n.tagName === "SELECT";
}, uk = function(n) {
  return n.tagName === "SLOT";
}, Zw = function(n) {
  return n.tagName.indexOf("-") > 0;
}, OO = (
  /** @class */
  (function() {
    function n() {
      this.counters = {};
    }
    return n.prototype.getCounterValue = function(t) {
      var e = this.counters[t];
      return e && e.length ? e[e.length - 1] : 1;
    }, n.prototype.getCounterValues = function(t) {
      var e = this.counters[t];
      return e || [];
    }, n.prototype.pop = function(t) {
      var e = this;
      t.forEach(function(r) {
        return e.counters[r].pop();
      });
    }, n.prototype.parse = function(t) {
      var e = this, r = t.counterIncrement, a = t.counterReset, A = !0;
      r !== null && r.forEach(function(s) {
        var o = e.counters[s.counter];
        o && s.increment !== 0 && (A = !1, o.length || o.push(1), o[Math.max(0, o.length - 1)] += s.increment);
      });
      var i = [];
      return A && a.forEach(function(s) {
        var o = e.counters[s.counter];
        i.push(s.counter), o || (o = e.counters[s.counter] = []), o.push(s.reset);
      }), i;
    }, n;
  })()
), e2 = {
  integers: [1e3, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1],
  values: ["M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"]
}, t2 = {
  integers: [
    9e3,
    8e3,
    7e3,
    6e3,
    5e3,
    4e3,
    3e3,
    2e3,
    1e3,
    900,
    800,
    700,
    600,
    500,
    400,
    300,
    200,
    100,
    90,
    80,
    70,
    60,
    50,
    40,
    30,
    20,
    10,
    9,
    8,
    7,
    6,
    5,
    4,
    3,
    2,
    1
  ],
  values: [
    "Ք",
    "Փ",
    "Ւ",
    "Ց",
    "Ր",
    "Տ",
    "Վ",
    "Ս",
    "Ռ",
    "Ջ",
    "Պ",
    "Չ",
    "Ո",
    "Շ",
    "Ն",
    "Յ",
    "Մ",
    "Ճ",
    "Ղ",
    "Ձ",
    "Հ",
    "Կ",
    "Ծ",
    "Խ",
    "Լ",
    "Ի",
    "Ժ",
    "Թ",
    "Ը",
    "Է",
    "Զ",
    "Ե",
    "Դ",
    "Գ",
    "Բ",
    "Ա"
  ]
}, PO = {
  integers: [
    1e4,
    9e3,
    8e3,
    7e3,
    6e3,
    5e3,
    4e3,
    3e3,
    2e3,
    1e3,
    400,
    300,
    200,
    100,
    90,
    80,
    70,
    60,
    50,
    40,
    30,
    20,
    19,
    18,
    17,
    16,
    15,
    10,
    9,
    8,
    7,
    6,
    5,
    4,
    3,
    2,
    1
  ],
  values: [
    "י׳",
    "ט׳",
    "ח׳",
    "ז׳",
    "ו׳",
    "ה׳",
    "ד׳",
    "ג׳",
    "ב׳",
    "א׳",
    "ת",
    "ש",
    "ר",
    "ק",
    "צ",
    "פ",
    "ע",
    "ס",
    "נ",
    "מ",
    "ל",
    "כ",
    "יט",
    "יח",
    "יז",
    "טז",
    "טו",
    "י",
    "ט",
    "ח",
    "ז",
    "ו",
    "ה",
    "ד",
    "ג",
    "ב",
    "א"
  ]
}, WO = {
  integers: [
    1e4,
    9e3,
    8e3,
    7e3,
    6e3,
    5e3,
    4e3,
    3e3,
    2e3,
    1e3,
    900,
    800,
    700,
    600,
    500,
    400,
    300,
    200,
    100,
    90,
    80,
    70,
    60,
    50,
    40,
    30,
    20,
    10,
    9,
    8,
    7,
    6,
    5,
    4,
    3,
    2,
    1
  ],
  values: [
    "ჵ",
    "ჰ",
    "ჯ",
    "ჴ",
    "ხ",
    "ჭ",
    "წ",
    "ძ",
    "ც",
    "ჩ",
    "შ",
    "ყ",
    "ღ",
    "ქ",
    "ფ",
    "ჳ",
    "ტ",
    "ს",
    "რ",
    "ჟ",
    "პ",
    "ო",
    "ჲ",
    "ნ",
    "მ",
    "ლ",
    "კ",
    "ი",
    "თ",
    "ჱ",
    "ზ",
    "ვ",
    "ე",
    "დ",
    "გ",
    "ბ",
    "ა"
  ]
}, El = function(n, t, e, r, a, A) {
  return n < t || n > e ? Gu(n, a, A.length > 0) : r.integers.reduce(function(i, s, o) {
    for (; n >= s; )
      n -= s, i += r.values[o];
    return i;
  }, "") + A;
}, ck = function(n, t, e, r) {
  var a = "";
  do
    e || n--, a = r(n) + a, n /= t;
  while (n * t >= t);
  return a;
}, $a = function(n, t, e, r, a) {
  var A = e - t + 1;
  return (n < 0 ? "-" : "") + (ck(Math.abs(n), A, r, function(i) {
    return Va(Math.floor(i % A) + t);
  }) + a);
}, jo = function(n, t, e) {
  e === void 0 && (e = ". ");
  var r = t.length;
  return ck(Math.abs(n), r, !1, function(a) {
    return t[Math.floor(a % r)];
  }) + e;
}, Rl = 1, To = 2, xo = 4, Iu = 8, Ji = function(n, t, e, r, a, A) {
  if (n < -9999 || n > 9999)
    return Gu(n, 4, a.length > 0);
  var i = Math.abs(n), s = a;
  if (i === 0)
    return t[0] + s;
  for (var o = 0; i > 0 && o <= 4; o++) {
    var l = i % 10;
    l === 0 && fA(A, Rl) && s !== "" ? s = t[l] + s : l > 1 || l === 1 && o === 0 || l === 1 && o === 1 && fA(A, To) || l === 1 && o === 1 && fA(A, xo) && n > 100 || l === 1 && o > 1 && fA(A, Iu) ? s = t[l] + (o > 0 ? e[o - 1] : "") + s : l === 1 && o > 0 && (s = e[o - 1] + s), i = Math.floor(i / 10);
  }
  return (n < 0 ? r : "") + s;
}, r2 = "十百千萬", n2 = "拾佰仟萬", a2 = "マイナス", gh = "마이너스", Gu = function(n, t, e) {
  var r = e ? ". " : "", a = e ? "、" : "", A = e ? ", " : "", i = e ? " " : "";
  switch (t) {
    case 0:
      return "•" + i;
    case 1:
      return "◦" + i;
    case 2:
      return "◾" + i;
    case 5:
      var s = $a(n, 48, 57, !0, r);
      return s.length < 4 ? "0" + s : s;
    case 4:
      return jo(n, "〇一二三四五六七八九", a);
    case 6:
      return El(n, 1, 3999, e2, 3, r).toLowerCase();
    case 7:
      return El(n, 1, 3999, e2, 3, r);
    case 8:
      return $a(n, 945, 969, !1, r);
    case 9:
      return $a(n, 97, 122, !1, r);
    case 10:
      return $a(n, 65, 90, !1, r);
    case 11:
      return $a(n, 1632, 1641, !0, r);
    case 12:
    case 49:
      return El(n, 1, 9999, t2, 3, r);
    case 35:
      return El(n, 1, 9999, t2, 3, r).toLowerCase();
    case 13:
      return $a(n, 2534, 2543, !0, r);
    case 14:
    case 30:
      return $a(n, 6112, 6121, !0, r);
    case 15:
      return jo(n, "子丑寅卯辰巳午未申酉戌亥", a);
    case 16:
      return jo(n, "甲乙丙丁戊己庚辛壬癸", a);
    case 17:
    case 48:
      return Ji(n, "零一二三四五六七八九", r2, "負", a, To | xo | Iu);
    case 47:
      return Ji(n, "零壹貳參肆伍陸柒捌玖", n2, "負", a, Rl | To | xo | Iu);
    case 42:
      return Ji(n, "零一二三四五六七八九", r2, "负", a, To | xo | Iu);
    case 41:
      return Ji(n, "零壹贰叁肆伍陆柒捌玖", n2, "负", a, Rl | To | xo | Iu);
    case 26:
      return Ji(n, "〇一二三四五六七八九", "十百千万", a2, a, 0);
    case 25:
      return Ji(n, "零壱弐参四伍六七八九", "拾百千万", a2, a, Rl | To | xo);
    case 31:
      return Ji(n, "영일이삼사오육칠팔구", "십백천만", gh, A, Rl | To | xo);
    case 33:
      return Ji(n, "零一二三四五六七八九", "十百千萬", gh, A, 0);
    case 32:
      return Ji(n, "零壹貳參四五六七八九", "拾百千", gh, A, Rl | To | xo);
    case 18:
      return $a(n, 2406, 2415, !0, r);
    case 20:
      return El(n, 1, 19999, WO, 3, r);
    case 21:
      return $a(n, 2790, 2799, !0, r);
    case 22:
      return $a(n, 2662, 2671, !0, r);
    case 22:
      return El(n, 1, 10999, PO, 3, r);
    case 23:
      return jo(n, "あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");
    case 24:
      return jo(n, "いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");
    case 27:
      return $a(n, 3302, 3311, !0, r);
    case 28:
      return jo(n, "アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン", a);
    case 29:
      return jo(n, "イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス", a);
    case 34:
      return $a(n, 3792, 3801, !0, r);
    case 37:
      return $a(n, 6160, 6169, !0, r);
    case 38:
      return $a(n, 4160, 4169, !0, r);
    case 39:
      return $a(n, 2918, 2927, !0, r);
    case 40:
      return $a(n, 1776, 1785, !0, r);
    case 43:
      return $a(n, 3046, 3055, !0, r);
    case 44:
      return $a(n, 3174, 3183, !0, r);
    case 45:
      return $a(n, 3664, 3673, !0, r);
    case 46:
      return $a(n, 3872, 3881, !0, r);
    case 3:
    default:
      return $a(n, 48, 57, !0, r);
  }
}, dk = "data-html2canvas-ignore", A2 = (
  /** @class */
  (function() {
    function n(t, e, r) {
      if (this.context = t, this.options = r, this.scrolledElements = [], this.referenceElement = e, this.counters = new OO(), this.quoteDepth = 0, !e.ownerDocument)
        throw new Error("Cloned element does not have an owner document");
      this.documentElement = this.cloneNode(e.ownerDocument.documentElement, !1);
    }
    return n.prototype.toIFrame = function(t, e) {
      var r = this, a = KO(t, e);
      if (!a.contentWindow)
        return Promise.reject("Unable to find iframe window");
      var A = t.defaultView.pageXOffset, i = t.defaultView.pageYOffset, s = a.contentWindow, o = s.document, l = qO(a).then(function() {
        return ls(r, void 0, void 0, function() {
          var u, f;
          return GA(this, function(h) {
            switch (h.label) {
              case 0:
                return this.scrolledElements.forEach(zO), s && (s.scrollTo(e.left, e.top), /(iPad|iPhone|iPod)/g.test(navigator.userAgent) && (s.scrollY !== e.top || s.scrollX !== e.left) && (this.context.logger.warn("Unable to restore scroll position for cloned document"), this.context.windowBounds = this.context.windowBounds.add(s.scrollX - e.left, s.scrollY - e.top, 0, 0))), u = this.options.onclone, f = this.clonedReferenceElement, typeof f > "u" ? [2, Promise.reject("Error finding the " + this.referenceElement.nodeName + " in the cloned document")] : o.fonts && o.fonts.ready ? [4, o.fonts.ready] : [3, 2];
              case 1:
                h.sent(), h.label = 2;
              case 2:
                return /(AppleWebKit)/g.test(navigator.userAgent) ? [4, VO(o)] : [3, 4];
              case 3:
                h.sent(), h.label = 4;
              case 4:
                return typeof u == "function" ? [2, Promise.resolve().then(function() {
                  return u(o, f);
                }).then(function() {
                  return a;
                })] : [2, a];
            }
          });
        });
      });
      return o.open(), o.write(YO(document.doctype) + "<html></html>"), GO(this.referenceElement.ownerDocument, A, i), o.replaceChild(o.adoptNode(this.documentElement), o.documentElement), o.close(), l;
    }, n.prototype.createElementClone = function(t) {
      if (Pp(
        t,
        2
        /* CLONE */
      ))
        debugger;
      if (ok(t))
        return this.createCanvasClone(t);
      if (Xw(t))
        return this.createVideoClone(t);
      if (Jw(t))
        return this.createStyleClone(t);
      var e = t.cloneNode(!1);
      return Vp(e) && (Vp(t) && t.currentSrc && t.currentSrc !== t.src && (e.src = t.currentSrc, e.srcset = ""), e.loading === "lazy" && (e.loading = "eager")), Zw(e) ? this.createCustomElementClone(e) : e;
    }, n.prototype.createCustomElementClone = function(t) {
      var e = document.createElement("html2canvascustomelement");
      return vh(t.style, e), e;
    }, n.prototype.createStyleClone = function(t) {
      try {
        var e = t.sheet;
        if (e && e.cssRules) {
          var r = [].slice.call(e.cssRules, 0).reduce(function(A, i) {
            return i && typeof i.cssText == "string" ? A + i.cssText : A;
          }, ""), a = t.cloneNode(!1);
          return a.textContent = r, a;
        }
      } catch (A) {
        if (this.context.logger.error("Unable to access cssRules property", A), A.name !== "SecurityError")
          throw A;
      }
      return t.cloneNode(!1);
    }, n.prototype.createCanvasClone = function(t) {
      var e;
      if (this.options.inlineImages && t.ownerDocument) {
        var r = t.ownerDocument.createElement("img");
        try {
          return r.src = t.toDataURL(), r;
        } catch {
          this.context.logger.info("Unable to inline canvas contents, canvas is tainted", t);
        }
      }
      var a = t.cloneNode(!1);
      try {
        a.width = t.width, a.height = t.height;
        var A = t.getContext("2d"), i = a.getContext("2d");
        if (i)
          if (!this.options.allowTaint && A)
            i.putImageData(A.getImageData(0, 0, t.width, t.height), 0, 0);
          else {
            var s = (e = t.getContext("webgl2")) !== null && e !== void 0 ? e : t.getContext("webgl");
            if (s) {
              var o = s.getContextAttributes();
              (o == null ? void 0 : o.preserveDrawingBuffer) === !1 && this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false", t);
            }
            i.drawImage(t, 0, 0);
          }
        return a;
      } catch {
        this.context.logger.info("Unable to clone canvas as it is tainted", t);
      }
      return a;
    }, n.prototype.createVideoClone = function(t) {
      var e = t.ownerDocument.createElement("canvas");
      e.width = t.offsetWidth, e.height = t.offsetHeight;
      var r = e.getContext("2d");
      try {
        return r && (r.drawImage(t, 0, 0, e.width, e.height), this.options.allowTaint || r.getImageData(0, 0, e.width, e.height)), e;
      } catch {
        this.context.logger.info("Unable to clone video as it is tainted", t);
      }
      var a = t.ownerDocument.createElement("canvas");
      return a.width = t.offsetWidth, a.height = t.offsetHeight, a;
    }, n.prototype.appendChildNode = function(t, e, r) {
      (!Wl(e) || !HO(e) && !e.hasAttribute(dk) && (typeof this.options.ignoreElements != "function" || !this.options.ignoreElements(e))) && (!this.options.copyStyles || !Wl(e) || !Jw(e)) && t.appendChild(this.cloneNode(e, r));
    }, n.prototype.cloneChildNodes = function(t, e, r) {
      for (var a = this, A = t.shadowRoot ? t.shadowRoot.firstChild : t.firstChild; A; A = A.nextSibling)
        if (Wl(A) && uk(A) && typeof A.assignedNodes == "function") {
          var i = A.assignedNodes();
          i.length && i.forEach(function(s) {
            return a.appendChildNode(e, s, r);
          });
        } else
          this.appendChildNode(e, A, r);
    }, n.prototype.cloneNode = function(t, e) {
      if (sk(t))
        return document.createTextNode(t.data);
      if (!t.ownerDocument)
        return t.cloneNode(!1);
      var r = t.ownerDocument.defaultView;
      if (r && Wl(t) && ($p(t) || Td(t))) {
        var a = this.createElementClone(t);
        a.style.transitionProperty = "none";
        var A = r.getComputedStyle(t), i = r.getComputedStyle(t, ":before"), s = r.getComputedStyle(t, ":after");
        this.referenceElement === t && $p(a) && (this.clonedReferenceElement = a), F0(a) && ZO(a);
        var o = this.counters.parse(new _w(this.context, A)), l = this.resolvePseudoContent(t, a, i, Wu.BEFORE);
        Zw(t) && (e = !0), Xw(t) || this.cloneChildNodes(t, a, e), l && a.insertBefore(l, a.firstChild);
        var u = this.resolvePseudoContent(t, a, s, Wu.AFTER);
        return u && a.appendChild(u), this.counters.pop(o), (A && (this.options.copyStyles || Td(t)) && !lk(t) || e) && vh(A, a), (t.scrollTop !== 0 || t.scrollLeft !== 0) && this.scrolledElements.push([a, t.scrollLeft, t.scrollTop]), (Hd(t) || Od(t)) && (Hd(a) || Od(a)) && (a.value = t.value), a;
      }
      return t.cloneNode(!1);
    }, n.prototype.resolvePseudoContent = function(t, e, r, a) {
      var A = this;
      if (r) {
        var i = r.content, s = e.ownerDocument;
        if (!(!s || !i || i === "none" || i === "-moz-alt-content" || r.display === "none")) {
          this.counters.parse(new _w(this.context, r));
          var o = new MH(this.context, r), l = s.createElement("html2canvaspseudoelement");
          vh(r, l), o.content.forEach(function(f) {
            if (f.type === 0)
              l.appendChild(s.createTextNode(f.value));
            else if (f.type === 22) {
              var h = s.createElement("img");
              h.src = f.value, h.style.opacity = "1", l.appendChild(h);
            } else if (f.type === 18) {
              if (f.name === "attr") {
                var c = f.values.filter(jn);
                c.length && l.appendChild(s.createTextNode(t.getAttribute(c[0].value) || ""));
              } else if (f.name === "counter") {
                var p = f.values.filter(Xl), w = p[0], y = p[1];
                if (w && jn(w)) {
                  var m = A.counters.getCounterValue(w.value), k = y && jn(y) ? Op.parse(A.context, y.value) : 3;
                  l.appendChild(s.createTextNode(Gu(m, k, !1)));
                }
              } else if (f.name === "counters") {
                var D = f.values.filter(Xl), w = D[0], B = D[1], y = D[2];
                if (w && jn(w)) {
                  var O = A.counters.getCounterValues(w.value), q = y && jn(y) ? Op.parse(A.context, y.value) : 3, G = B && B.type === 0 ? B.value : "", W = O.map(function(T) {
                    return Gu(T, q, !1);
                  }).join(G);
                  l.appendChild(s.createTextNode(W));
                }
              }
            } else if (f.type === 20)
              switch (f.value) {
                case "open-quote":
                  l.appendChild(s.createTextNode(Mw(o.quotes, A.quoteDepth++, !0)));
                  break;
                case "close-quote":
                  l.appendChild(s.createTextNode(Mw(o.quotes, --A.quoteDepth, !1)));
                  break;
                default:
                  l.appendChild(s.createTextNode(f.value));
              }
          }), l.className = qp + " " + jp;
          var u = a === Wu.BEFORE ? " " + qp : " " + jp;
          return Td(e) ? e.className.baseValue += u : e.className += u, l;
        }
      }
    }, n.destroy = function(t) {
      return t.parentNode ? (t.parentNode.removeChild(t), !0) : !1;
    }, n;
  })()
), Wu;
(function(n) {
  n[n.BEFORE = 0] = "BEFORE", n[n.AFTER = 1] = "AFTER";
})(Wu || (Wu = {}));
var KO = function(n, t) {
  var e = n.createElement("iframe");
  return e.className = "html2canvas-container", e.style.visibility = "hidden", e.style.position = "fixed", e.style.left = "-10000px", e.style.top = "0px", e.style.border = "0", e.width = t.width.toString(), e.height = t.height.toString(), e.scrolling = "no", e.setAttribute(dk, "true"), n.body.appendChild(e), e;
}, $O = function(n) {
  return new Promise(function(t) {
    if (n.complete) {
      t();
      return;
    }
    if (!n.src) {
      t();
      return;
    }
    n.onload = t, n.onerror = t;
  });
}, VO = function(n) {
  return Promise.all([].slice.call(n.images, 0).map($O));
}, qO = function(n) {
  return new Promise(function(t, e) {
    var r = n.contentWindow;
    if (!r)
      return e("No window assigned for iframe");
    var a = r.document;
    r.onload = n.onload = function() {
      r.onload = n.onload = null;
      var A = setInterval(function() {
        a.body.childNodes.length > 0 && a.readyState === "complete" && (clearInterval(A), t(n));
      }, 50);
    };
  });
}, jO = [
  "all",
  "d",
  "content"
  // Safari shows pseudoelements if content is set
], vh = function(n, t) {
  for (var e = n.length - 1; e >= 0; e--) {
    var r = n.item(e);
    jO.indexOf(r) === -1 && t.style.setProperty(r, n.getPropertyValue(r));
  }
  return t;
}, YO = function(n) {
  var t = "";
  return n && (t += "<!DOCTYPE ", n.name && (t += n.name), n.internalSubset && (t += n.internalSubset), n.publicId && (t += '"' + n.publicId + '"'), n.systemId && (t += '"' + n.systemId + '"'), t += ">"), t;
}, GO = function(n, t, e) {
  n && n.defaultView && (t !== n.defaultView.pageXOffset || e !== n.defaultView.pageYOffset) && n.defaultView.scrollTo(t, e);
}, zO = function(n) {
  var t = n[0], e = n[1], r = n[2];
  t.scrollLeft = e, t.scrollTop = r;
}, XO = ":before", JO = ":after", qp = "___html2canvas___pseudoelement_before", jp = "___html2canvas___pseudoelement_after", s2 = `{
    content: "" !important;
    display: none !important;
}`, ZO = function(n) {
  e8(n, "." + qp + XO + s2 + `
         .` + jp + JO + s2);
}, e8 = function(n, t) {
  var e = n.ownerDocument;
  if (e) {
    var r = e.createElement("style");
    r.textContent = t, n.appendChild(r);
  }
}, fk = (
  /** @class */
  (function() {
    function n() {
    }
    return n.getOrigin = function(t) {
      var e = n._link;
      return e ? (e.href = t, e.href = e.href, e.protocol + e.hostname + e.port) : "about:blank";
    }, n.isSameOrigin = function(t) {
      return n.getOrigin(t) === n._origin;
    }, n.setContext = function(t) {
      n._link = t.document.createElement("a"), n._origin = n.getOrigin(t.location.href);
    }, n._origin = "about:blank", n;
  })()
), t8 = (
  /** @class */
  (function() {
    function n(t, e) {
      this.context = t, this._options = e, this._cache = {};
    }
    return n.prototype.addImage = function(t) {
      var e = Promise.resolve();
      return this.has(t) || (mh(t) || A8(t)) && (this._cache[t] = this.loadImage(t)).catch(function() {
      }), e;
    }, n.prototype.match = function(t) {
      return this._cache[t];
    }, n.prototype.loadImage = function(t) {
      return ls(this, void 0, void 0, function() {
        var e, r, a, A, i = this;
        return GA(this, function(s) {
          switch (s.label) {
            case 0:
              return e = fk.isSameOrigin(t), r = !ph(t) && this._options.useCORS === !0 && MA.SUPPORT_CORS_IMAGES && !e, a = !ph(t) && !e && !mh(t) && typeof this._options.proxy == "string" && MA.SUPPORT_CORS_XHR && !r, !e && this._options.allowTaint === !1 && !ph(t) && !mh(t) && !a && !r ? [
                2
                /*return*/
              ] : (A = t, a ? [4, this.proxy(A)] : [3, 2]);
            case 1:
              A = s.sent(), s.label = 2;
            case 2:
              return this.context.logger.debug("Added image " + t.substring(0, 256)), [4, new Promise(function(o, l) {
                var u = new Image();
                u.onload = function() {
                  return o(u);
                }, u.onerror = l, (s8(A) || r) && (u.crossOrigin = "anonymous"), u.src = A, u.complete === !0 && setTimeout(function() {
                  return o(u);
                }, 500), i._options.imageTimeout > 0 && setTimeout(function() {
                  return l("Timed out (" + i._options.imageTimeout + "ms) loading image");
                }, i._options.imageTimeout);
              })];
            case 3:
              return [2, s.sent()];
          }
        });
      });
    }, n.prototype.has = function(t) {
      return typeof this._cache[t] < "u";
    }, n.prototype.keys = function() {
      return Promise.resolve(Object.keys(this._cache));
    }, n.prototype.proxy = function(t) {
      var e = this, r = this._options.proxy;
      if (!r)
        throw new Error("No proxy defined");
      var a = t.substring(0, 256);
      return new Promise(function(A, i) {
        var s = MA.SUPPORT_RESPONSE_TYPE ? "blob" : "text", o = new XMLHttpRequest();
        o.onload = function() {
          if (o.status === 200)
            if (s === "text")
              A(o.response);
            else {
              var f = new FileReader();
              f.addEventListener("load", function() {
                return A(f.result);
              }, !1), f.addEventListener("error", function(h) {
                return i(h);
              }, !1), f.readAsDataURL(o.response);
            }
          else
            i("Failed to proxy resource " + a + " with status code " + o.status);
        }, o.onerror = i;
        var l = r.indexOf("?") > -1 ? "&" : "?";
        if (o.open("GET", "" + r + l + "url=" + encodeURIComponent(t) + "&responseType=" + s), s !== "text" && o instanceof XMLHttpRequest && (o.responseType = s), e._options.imageTimeout) {
          var u = e._options.imageTimeout;
          o.timeout = u, o.ontimeout = function() {
            return i("Timed out (" + u + "ms) proxying " + a);
          };
        }
        o.send();
      });
    }, n;
  })()
), r8 = /^data:image\/svg\+xml/i, n8 = /^data:image\/.*;base64,/i, a8 = /^data:image\/.*/i, A8 = function(n) {
  return MA.SUPPORT_SVG_DRAWING || !i8(n);
}, ph = function(n) {
  return a8.test(n);
}, s8 = function(n) {
  return n8.test(n);
}, mh = function(n) {
  return n.substr(0, 4) === "blob";
}, i8 = function(n) {
  return n.substr(-3).toLowerCase() === "svg" || r8.test(n);
}, ir = (
  /** @class */
  (function() {
    function n(t, e) {
      this.type = 0, this.x = t, this.y = e;
    }
    return n.prototype.add = function(t, e) {
      return new n(this.x + t, this.y + e);
    }, n;
  })()
), Sl = function(n, t, e) {
  return new ir(n.x + (t.x - n.x) * e, n.y + (t.y - n.y) * e);
}, Ad = (
  /** @class */
  (function() {
    function n(t, e, r, a) {
      this.type = 1, this.start = t, this.startControl = e, this.endControl = r, this.end = a;
    }
    return n.prototype.subdivide = function(t, e) {
      var r = Sl(this.start, this.startControl, t), a = Sl(this.startControl, this.endControl, t), A = Sl(this.endControl, this.end, t), i = Sl(r, a, t), s = Sl(a, A, t), o = Sl(i, s, t);
      return e ? new n(this.start, r, i, o) : new n(o, s, A, this.end);
    }, n.prototype.add = function(t, e) {
      return new n(this.start.add(t, e), this.startControl.add(t, e), this.endControl.add(t, e), this.end.add(t, e));
    }, n.prototype.reverse = function() {
      return new n(this.end, this.endControl, this.startControl, this.start);
    }, n;
  })()
), Vs = function(n) {
  return n.type === 1;
}, o8 = (
  /** @class */
  /* @__PURE__ */ (function() {
    function n(t) {
      var e = t.styles, r = t.bounds, a = Uu(e.borderTopLeftRadius, r.width, r.height), A = a[0], i = a[1], s = Uu(e.borderTopRightRadius, r.width, r.height), o = s[0], l = s[1], u = Uu(e.borderBottomRightRadius, r.width, r.height), f = u[0], h = u[1], c = Uu(e.borderBottomLeftRadius, r.width, r.height), p = c[0], w = c[1], y = [];
      y.push((A + o) / r.width), y.push((p + f) / r.width), y.push((i + w) / r.height), y.push((l + h) / r.height);
      var m = Math.max.apply(Math, y);
      m > 1 && (A /= m, i /= m, o /= m, l /= m, f /= m, h /= m, p /= m, w /= m);
      var k = r.width - o, D = r.height - h, B = r.width - f, O = r.height - w, q = e.borderTopWidth, G = e.borderRightWidth, W = e.borderBottomWidth, F = e.borderLeftWidth, Y = aa(e.paddingTop, t.bounds.width), T = aa(e.paddingRight, t.bounds.width), E = aa(e.paddingBottom, t.bounds.width), Q = aa(e.paddingLeft, t.bounds.width);
      this.topLeftBorderDoubleOuterBox = A > 0 || i > 0 ? ha(r.left + F / 3, r.top + q / 3, A - F / 3, i - q / 3, _n.TOP_LEFT) : new ir(r.left + F / 3, r.top + q / 3), this.topRightBorderDoubleOuterBox = A > 0 || i > 0 ? ha(r.left + k, r.top + q / 3, o - G / 3, l - q / 3, _n.TOP_RIGHT) : new ir(r.left + r.width - G / 3, r.top + q / 3), this.bottomRightBorderDoubleOuterBox = f > 0 || h > 0 ? ha(r.left + B, r.top + D, f - G / 3, h - W / 3, _n.BOTTOM_RIGHT) : new ir(r.left + r.width - G / 3, r.top + r.height - W / 3), this.bottomLeftBorderDoubleOuterBox = p > 0 || w > 0 ? ha(r.left + F / 3, r.top + O, p - F / 3, w - W / 3, _n.BOTTOM_LEFT) : new ir(r.left + F / 3, r.top + r.height - W / 3), this.topLeftBorderDoubleInnerBox = A > 0 || i > 0 ? ha(r.left + F * 2 / 3, r.top + q * 2 / 3, A - F * 2 / 3, i - q * 2 / 3, _n.TOP_LEFT) : new ir(r.left + F * 2 / 3, r.top + q * 2 / 3), this.topRightBorderDoubleInnerBox = A > 0 || i > 0 ? ha(r.left + k, r.top + q * 2 / 3, o - G * 2 / 3, l - q * 2 / 3, _n.TOP_RIGHT) : new ir(r.left + r.width - G * 2 / 3, r.top + q * 2 / 3), this.bottomRightBorderDoubleInnerBox = f > 0 || h > 0 ? ha(r.left + B, r.top + D, f - G * 2 / 3, h - W * 2 / 3, _n.BOTTOM_RIGHT) : new ir(r.left + r.width - G * 2 / 3, r.top + r.height - W * 2 / 3), this.bottomLeftBorderDoubleInnerBox = p > 0 || w > 0 ? ha(r.left + F * 2 / 3, r.top + O, p - F * 2 / 3, w - W * 2 / 3, _n.BOTTOM_LEFT) : new ir(r.left + F * 2 / 3, r.top + r.height - W * 2 / 3), this.topLeftBorderStroke = A > 0 || i > 0 ? ha(r.left + F / 2, r.top + q / 2, A - F / 2, i - q / 2, _n.TOP_LEFT) : new ir(r.left + F / 2, r.top + q / 2), this.topRightBorderStroke = A > 0 || i > 0 ? ha(r.left + k, r.top + q / 2, o - G / 2, l - q / 2, _n.TOP_RIGHT) : new ir(r.left + r.width - G / 2, r.top + q / 2), this.bottomRightBorderStroke = f > 0 || h > 0 ? ha(r.left + B, r.top + D, f - G / 2, h - W / 2, _n.BOTTOM_RIGHT) : new ir(r.left + r.width - G / 2, r.top + r.height - W / 2), this.bottomLeftBorderStroke = p > 0 || w > 0 ? ha(r.left + F / 2, r.top + O, p - F / 2, w - W / 2, _n.BOTTOM_LEFT) : new ir(r.left + F / 2, r.top + r.height - W / 2), this.topLeftBorderBox = A > 0 || i > 0 ? ha(r.left, r.top, A, i, _n.TOP_LEFT) : new ir(r.left, r.top), this.topRightBorderBox = o > 0 || l > 0 ? ha(r.left + k, r.top, o, l, _n.TOP_RIGHT) : new ir(r.left + r.width, r.top), this.bottomRightBorderBox = f > 0 || h > 0 ? ha(r.left + B, r.top + D, f, h, _n.BOTTOM_RIGHT) : new ir(r.left + r.width, r.top + r.height), this.bottomLeftBorderBox = p > 0 || w > 0 ? ha(r.left, r.top + O, p, w, _n.BOTTOM_LEFT) : new ir(r.left, r.top + r.height), this.topLeftPaddingBox = A > 0 || i > 0 ? ha(r.left + F, r.top + q, Math.max(0, A - F), Math.max(0, i - q), _n.TOP_LEFT) : new ir(r.left + F, r.top + q), this.topRightPaddingBox = o > 0 || l > 0 ? ha(r.left + Math.min(k, r.width - G), r.top + q, k > r.width + G ? 0 : Math.max(0, o - G), Math.max(0, l - q), _n.TOP_RIGHT) : new ir(r.left + r.width - G, r.top + q), this.bottomRightPaddingBox = f > 0 || h > 0 ? ha(r.left + Math.min(B, r.width - F), r.top + Math.min(D, r.height - W), Math.max(0, f - G), Math.max(0, h - W), _n.BOTTOM_RIGHT) : new ir(r.left + r.width - G, r.top + r.height - W), this.bottomLeftPaddingBox = p > 0 || w > 0 ? ha(r.left + F, r.top + Math.min(O, r.height - W), Math.max(0, p - F), Math.max(0, w - W), _n.BOTTOM_LEFT) : new ir(r.left + F, r.top + r.height - W), this.topLeftContentBox = A > 0 || i > 0 ? ha(r.left + F + Q, r.top + q + Y, Math.max(0, A - (F + Q)), Math.max(0, i - (q + Y)), _n.TOP_LEFT) : new ir(r.left + F + Q, r.top + q + Y), this.topRightContentBox = o > 0 || l > 0 ? ha(r.left + Math.min(k, r.width + F + Q), r.top + q + Y, k > r.width + F + Q ? 0 : o - F + Q, l - (q + Y), _n.TOP_RIGHT) : new ir(r.left + r.width - (G + T), r.top + q + Y), this.bottomRightContentBox = f > 0 || h > 0 ? ha(r.left + Math.min(B, r.width - (F + Q)), r.top + Math.min(D, r.height + q + Y), Math.max(0, f - (G + T)), h - (W + E), _n.BOTTOM_RIGHT) : new ir(r.left + r.width - (G + T), r.top + r.height - (W + E)), this.bottomLeftContentBox = p > 0 || w > 0 ? ha(r.left + F + Q, r.top + O, Math.max(0, p - (F + Q)), w - (W + E), _n.BOTTOM_LEFT) : new ir(r.left + F + Q, r.top + r.height - (W + E));
    }
    return n;
  })()
), _n;
(function(n) {
  n[n.TOP_LEFT = 0] = "TOP_LEFT", n[n.TOP_RIGHT = 1] = "TOP_RIGHT", n[n.BOTTOM_RIGHT = 2] = "BOTTOM_RIGHT", n[n.BOTTOM_LEFT = 3] = "BOTTOM_LEFT";
})(_n || (_n = {}));
var ha = function(n, t, e, r, a) {
  var A = 4 * ((Math.sqrt(2) - 1) / 3), i = e * A, s = r * A, o = n + e, l = t + r;
  switch (a) {
    case _n.TOP_LEFT:
      return new Ad(new ir(n, l), new ir(n, l - s), new ir(o - i, t), new ir(o, t));
    case _n.TOP_RIGHT:
      return new Ad(new ir(n, t), new ir(n + i, t), new ir(o, l - s), new ir(o, l));
    case _n.BOTTOM_RIGHT:
      return new Ad(new ir(o, t), new ir(o, t + s), new ir(n + i, l), new ir(n, l));
    case _n.BOTTOM_LEFT:
    default:
      return new Ad(new ir(o, l), new ir(o - i, l), new ir(n, t + s), new ir(n, t));
  }
}, Pd = function(n) {
  return [n.topLeftBorderBox, n.topRightBorderBox, n.bottomRightBorderBox, n.bottomLeftBorderBox];
}, l8 = function(n) {
  return [
    n.topLeftContentBox,
    n.topRightContentBox,
    n.bottomRightContentBox,
    n.bottomLeftContentBox
  ];
}, Wd = function(n) {
  return [
    n.topLeftPaddingBox,
    n.topRightPaddingBox,
    n.bottomRightPaddingBox,
    n.bottomLeftPaddingBox
  ];
}, u8 = (
  /** @class */
  /* @__PURE__ */ (function() {
    function n(t, e, r) {
      this.offsetX = t, this.offsetY = e, this.matrix = r, this.type = 0, this.target = 6;
    }
    return n;
  })()
), sd = (
  /** @class */
  /* @__PURE__ */ (function() {
    function n(t, e) {
      this.path = t, this.target = e, this.type = 1;
    }
    return n;
  })()
), c8 = (
  /** @class */
  /* @__PURE__ */ (function() {
    function n(t) {
      this.opacity = t, this.type = 2, this.target = 6;
    }
    return n;
  })()
), d8 = function(n) {
  return n.type === 0;
}, hk = function(n) {
  return n.type === 1;
}, f8 = function(n) {
  return n.type === 2;
}, i2 = function(n, t) {
  return n.length === t.length ? n.some(function(e, r) {
    return e === t[r];
  }) : !1;
}, h8 = function(n, t, e, r, a) {
  return n.map(function(A, i) {
    switch (i) {
      case 0:
        return A.add(t, e);
      case 1:
        return A.add(t + r, e);
      case 2:
        return A.add(t + r, e + a);
      case 3:
        return A.add(t, e + a);
    }
    return A;
  });
}, gk = (
  /** @class */
  /* @__PURE__ */ (function() {
    function n(t) {
      this.element = t, this.inlineLevel = [], this.nonInlineLevel = [], this.negativeZIndex = [], this.zeroOrAutoZIndexOrTransformedOrOpacity = [], this.positiveZIndex = [], this.nonPositionedFloats = [], this.nonPositionedInlineLevel = [];
    }
    return n;
  })()
), vk = (
  /** @class */
  (function() {
    function n(t, e) {
      if (this.container = t, this.parent = e, this.effects = [], this.curves = new o8(this.container), this.container.styles.opacity < 1 && this.effects.push(new c8(this.container.styles.opacity)), this.container.styles.transform !== null) {
        var r = this.container.bounds.left + this.container.styles.transformOrigin[0].number, a = this.container.bounds.top + this.container.styles.transformOrigin[1].number, A = this.container.styles.transform;
        this.effects.push(new u8(r, a, A));
      }
      if (this.container.styles.overflowX !== 0) {
        var i = Pd(this.curves), s = Wd(this.curves);
        i2(i, s) ? this.effects.push(new sd(
          i,
          6
          /* CONTENT */
        )) : (this.effects.push(new sd(
          i,
          2
          /* BACKGROUND_BORDERS */
        )), this.effects.push(new sd(
          s,
          4
          /* CONTENT */
        )));
      }
    }
    return n.prototype.getEffects = function(t) {
      for (var e = [
        2,
        3
        /* FIXED */
      ].indexOf(this.container.styles.position) === -1, r = this.parent, a = this.effects.slice(0); r; ) {
        var A = r.effects.filter(function(o) {
          return !hk(o);
        });
        if (e || r.container.styles.position !== 0 || !r.parent) {
          if (a.unshift.apply(a, A), e = [
            2,
            3
            /* FIXED */
          ].indexOf(r.container.styles.position) === -1, r.container.styles.overflowX !== 0) {
            var i = Pd(r.curves), s = Wd(r.curves);
            i2(i, s) || a.unshift(new sd(
              s,
              6
              /* CONTENT */
            ));
          }
        } else
          a.unshift.apply(a, A);
        r = r.parent;
      }
      return a.filter(function(o) {
        return fA(o.target, t);
      });
    }, n;
  })()
), Yp = function(n, t, e, r) {
  n.container.elements.forEach(function(a) {
    var A = fA(
      a.flags,
      4
      /* CREATES_REAL_STACKING_CONTEXT */
    ), i = fA(
      a.flags,
      2
      /* CREATES_STACKING_CONTEXT */
    ), s = new vk(a, n);
    fA(
      a.styles.display,
      2048
      /* LIST_ITEM */
    ) && r.push(s);
    var o = fA(
      a.flags,
      8
      /* IS_LIST_OWNER */
    ) ? [] : r;
    if (A || i) {
      var l = A || a.styles.isPositioned() ? e : t, u = new gk(s);
      if (a.styles.isPositioned() || a.styles.opacity < 1 || a.styles.isTransformed()) {
        var f = a.styles.zIndex.order;
        if (f < 0) {
          var h = 0;
          l.negativeZIndex.some(function(p, w) {
            return f > p.element.container.styles.zIndex.order ? (h = w, !1) : h > 0;
          }), l.negativeZIndex.splice(h, 0, u);
        } else if (f > 0) {
          var c = 0;
          l.positiveZIndex.some(function(p, w) {
            return f >= p.element.container.styles.zIndex.order ? (c = w + 1, !1) : c > 0;
          }), l.positiveZIndex.splice(c, 0, u);
        } else
          l.zeroOrAutoZIndexOrTransformedOrOpacity.push(u);
      } else
        a.styles.isFloating() ? l.nonPositionedFloats.push(u) : l.nonPositionedInlineLevel.push(u);
      Yp(s, u, A ? u : e, o);
    } else
      a.styles.isInlineLevel() ? t.inlineLevel.push(s) : t.nonInlineLevel.push(s), Yp(s, t, e, o);
    fA(
      a.flags,
      8
      /* IS_LIST_OWNER */
    ) && pk(a, o);
  });
}, pk = function(n, t) {
  for (var e = n instanceof Kp ? n.start : 1, r = n instanceof Kp ? n.reversed : !1, a = 0; a < t.length; a++) {
    var A = t[a];
    A.container instanceof ek && typeof A.container.value == "number" && A.container.value !== 0 && (e = A.container.value), A.listValue = Gu(e, A.container.styles.listStyleType, !0), e += r ? -1 : 1;
  }
}, g8 = function(n) {
  var t = new vk(n, null), e = new gk(t), r = [];
  return Yp(t, e, e, r), pk(t.container, r), e;
}, o2 = function(n, t) {
  switch (t) {
    case 0:
      return Ys(n.topLeftBorderBox, n.topLeftPaddingBox, n.topRightBorderBox, n.topRightPaddingBox);
    case 1:
      return Ys(n.topRightBorderBox, n.topRightPaddingBox, n.bottomRightBorderBox, n.bottomRightPaddingBox);
    case 2:
      return Ys(n.bottomRightBorderBox, n.bottomRightPaddingBox, n.bottomLeftBorderBox, n.bottomLeftPaddingBox);
    case 3:
    default:
      return Ys(n.bottomLeftBorderBox, n.bottomLeftPaddingBox, n.topLeftBorderBox, n.topLeftPaddingBox);
  }
}, v8 = function(n, t) {
  switch (t) {
    case 0:
      return Ys(n.topLeftBorderBox, n.topLeftBorderDoubleOuterBox, n.topRightBorderBox, n.topRightBorderDoubleOuterBox);
    case 1:
      return Ys(n.topRightBorderBox, n.topRightBorderDoubleOuterBox, n.bottomRightBorderBox, n.bottomRightBorderDoubleOuterBox);
    case 2:
      return Ys(n.bottomRightBorderBox, n.bottomRightBorderDoubleOuterBox, n.bottomLeftBorderBox, n.bottomLeftBorderDoubleOuterBox);
    case 3:
    default:
      return Ys(n.bottomLeftBorderBox, n.bottomLeftBorderDoubleOuterBox, n.topLeftBorderBox, n.topLeftBorderDoubleOuterBox);
  }
}, p8 = function(n, t) {
  switch (t) {
    case 0:
      return Ys(n.topLeftBorderDoubleInnerBox, n.topLeftPaddingBox, n.topRightBorderDoubleInnerBox, n.topRightPaddingBox);
    case 1:
      return Ys(n.topRightBorderDoubleInnerBox, n.topRightPaddingBox, n.bottomRightBorderDoubleInnerBox, n.bottomRightPaddingBox);
    case 2:
      return Ys(n.bottomRightBorderDoubleInnerBox, n.bottomRightPaddingBox, n.bottomLeftBorderDoubleInnerBox, n.bottomLeftPaddingBox);
    case 3:
    default:
      return Ys(n.bottomLeftBorderDoubleInnerBox, n.bottomLeftPaddingBox, n.topLeftBorderDoubleInnerBox, n.topLeftPaddingBox);
  }
}, m8 = function(n, t) {
  switch (t) {
    case 0:
      return id(n.topLeftBorderStroke, n.topRightBorderStroke);
    case 1:
      return id(n.topRightBorderStroke, n.bottomRightBorderStroke);
    case 2:
      return id(n.bottomRightBorderStroke, n.bottomLeftBorderStroke);
    case 3:
    default:
      return id(n.bottomLeftBorderStroke, n.topLeftBorderStroke);
  }
}, id = function(n, t) {
  var e = [];
  return Vs(n) ? e.push(n.subdivide(0.5, !1)) : e.push(n), Vs(t) ? e.push(t.subdivide(0.5, !0)) : e.push(t), e;
}, Ys = function(n, t, e, r) {
  var a = [];
  return Vs(n) ? a.push(n.subdivide(0.5, !1)) : a.push(n), Vs(e) ? a.push(e.subdivide(0.5, !0)) : a.push(e), Vs(r) ? a.push(r.subdivide(0.5, !0).reverse()) : a.push(r), Vs(t) ? a.push(t.subdivide(0.5, !1).reverse()) : a.push(t), a;
}, mk = function(n) {
  var t = n.bounds, e = n.styles;
  return t.add(e.borderLeftWidth, e.borderTopWidth, -(e.borderRightWidth + e.borderLeftWidth), -(e.borderTopWidth + e.borderBottomWidth));
}, Kd = function(n) {
  var t = n.styles, e = n.bounds, r = aa(t.paddingLeft, e.width), a = aa(t.paddingRight, e.width), A = aa(t.paddingTop, e.width), i = aa(t.paddingBottom, e.width);
  return e.add(r + t.borderLeftWidth, A + t.borderTopWidth, -(t.borderRightWidth + t.borderLeftWidth + r + a), -(t.borderTopWidth + t.borderBottomWidth + A + i));
}, w8 = function(n, t) {
  return n === 0 ? t.bounds : n === 2 ? Kd(t) : mk(t);
}, y8 = function(n, t) {
  return n === 0 ? t.bounds : n === 2 ? Kd(t) : mk(t);
}, wh = function(n, t, e) {
  var r = w8(Nl(n.styles.backgroundOrigin, t), n), a = y8(Nl(n.styles.backgroundClip, t), n), A = B8(Nl(n.styles.backgroundSize, t), e, r), i = A[0], s = A[1], o = Uu(Nl(n.styles.backgroundPosition, t), r.width - i, r.height - s), l = b8(Nl(n.styles.backgroundRepeat, t), o, A, r, a), u = Math.round(r.left + o[0]), f = Math.round(r.top + o[1]);
  return [l, u, f, i, s];
}, Fl = function(n) {
  return jn(n) && n.value === Yl.AUTO;
}, od = function(n) {
  return typeof n == "number";
}, B8 = function(n, t, e) {
  var r = t[0], a = t[1], A = t[2], i = n[0], s = n[1];
  if (!i)
    return [0, 0];
  if (AA(i) && s && AA(s))
    return [aa(i, e.width), aa(s, e.height)];
  var o = od(A);
  if (jn(i) && (i.value === Yl.CONTAIN || i.value === Yl.COVER)) {
    if (od(A)) {
      var l = e.width / e.height;
      return l < A != (i.value === Yl.COVER) ? [e.width, e.width / A] : [e.height * A, e.height];
    }
    return [e.width, e.height];
  }
  var u = od(r), f = od(a), h = u || f;
  if (Fl(i) && (!s || Fl(s))) {
    if (u && f)
      return [r, a];
    if (!o && !h)
      return [e.width, e.height];
    if (h && o) {
      var c = u ? r : a * A, p = f ? a : r / A;
      return [c, p];
    }
    var w = u ? r : e.width, y = f ? a : e.height;
    return [w, y];
  }
  if (o) {
    var m = 0, k = 0;
    return AA(i) ? m = aa(i, e.width) : AA(s) && (k = aa(s, e.height)), Fl(i) ? m = k * A : (!s || Fl(s)) && (k = m / A), [m, k];
  }
  var D = null, B = null;
  if (AA(i) ? D = aa(i, e.width) : s && AA(s) && (B = aa(s, e.height)), D !== null && (!s || Fl(s)) && (B = u && f ? D / r * a : e.height), B !== null && Fl(i) && (D = u && f ? B / a * r : e.width), D !== null && B !== null)
    return [D, B];
  throw new Error("Unable to calculate background-size for element");
}, Nl = function(n, t) {
  var e = n[t];
  return typeof e > "u" ? n[0] : e;
}, b8 = function(n, t, e, r, a) {
  var A = t[0], i = t[1], s = e[0], o = e[1];
  switch (n) {
    case 2:
      return [
        new ir(Math.round(r.left), Math.round(r.top + i)),
        new ir(Math.round(r.left + r.width), Math.round(r.top + i)),
        new ir(Math.round(r.left + r.width), Math.round(o + r.top + i)),
        new ir(Math.round(r.left), Math.round(o + r.top + i))
      ];
    case 3:
      return [
        new ir(Math.round(r.left + A), Math.round(r.top)),
        new ir(Math.round(r.left + A + s), Math.round(r.top)),
        new ir(Math.round(r.left + A + s), Math.round(r.height + r.top)),
        new ir(Math.round(r.left + A), Math.round(r.height + r.top))
      ];
    case 1:
      return [
        new ir(Math.round(r.left + A), Math.round(r.top + i)),
        new ir(Math.round(r.left + A + s), Math.round(r.top + i)),
        new ir(Math.round(r.left + A + s), Math.round(r.top + i + o)),
        new ir(Math.round(r.left + A), Math.round(r.top + i + o))
      ];
    default:
      return [
        new ir(Math.round(a.left), Math.round(a.top)),
        new ir(Math.round(a.left + a.width), Math.round(a.top)),
        new ir(Math.round(a.left + a.width), Math.round(a.height + a.top)),
        new ir(Math.round(a.left), Math.round(a.height + a.top))
      ];
  }
}, C8 = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", l2 = "Hidden Text", k8 = (
  /** @class */
  (function() {
    function n(t) {
      this._data = {}, this._document = t;
    }
    return n.prototype.parseMetrics = function(t, e) {
      var r = this._document.createElement("div"), a = this._document.createElement("img"), A = this._document.createElement("span"), i = this._document.body;
      r.style.visibility = "hidden", r.style.fontFamily = t, r.style.fontSize = e, r.style.margin = "0", r.style.padding = "0", r.style.whiteSpace = "nowrap", i.appendChild(r), a.src = C8, a.width = 1, a.height = 1, a.style.margin = "0", a.style.padding = "0", a.style.verticalAlign = "baseline", A.style.fontFamily = t, A.style.fontSize = e, A.style.margin = "0", A.style.padding = "0", A.appendChild(this._document.createTextNode(l2)), r.appendChild(A), r.appendChild(a);
      var s = a.offsetTop - A.offsetTop + 2;
      r.removeChild(A), r.appendChild(this._document.createTextNode(l2)), r.style.lineHeight = "normal", a.style.verticalAlign = "super";
      var o = a.offsetTop - r.offsetTop + 2;
      return i.removeChild(r), { baseline: s, middle: o };
    }, n.prototype.getMetrics = function(t, e) {
      var r = t + " " + e;
      return typeof this._data[r] > "u" && (this._data[r] = this.parseMetrics(t, e)), this._data[r];
    }, n;
  })()
), wk = (
  /** @class */
  /* @__PURE__ */ (function() {
    function n(t, e) {
      this.context = t, this.options = e;
    }
    return n;
  })()
), T8 = 1e4, x8 = (
  /** @class */
  (function(n) {
    mi(t, n);
    function t(e, r) {
      var a = n.call(this, e, r) || this;
      return a._activeEffects = [], a.canvas = r.canvas ? r.canvas : document.createElement("canvas"), a.ctx = a.canvas.getContext("2d"), r.canvas || (a.canvas.width = Math.floor(r.width * r.scale), a.canvas.height = Math.floor(r.height * r.scale), a.canvas.style.width = r.width + "px", a.canvas.style.height = r.height + "px"), a.fontMetrics = new k8(document), a.ctx.scale(a.options.scale, a.options.scale), a.ctx.translate(-r.x, -r.y), a.ctx.textBaseline = "bottom", a._activeEffects = [], a.context.logger.debug("Canvas renderer initialized (" + r.width + "x" + r.height + ") with scale " + r.scale), a;
    }
    return t.prototype.applyEffects = function(e) {
      for (var r = this; this._activeEffects.length; )
        this.popEffect();
      e.forEach(function(a) {
        return r.applyEffect(a);
      });
    }, t.prototype.applyEffect = function(e) {
      this.ctx.save(), f8(e) && (this.ctx.globalAlpha = e.opacity), d8(e) && (this.ctx.translate(e.offsetX, e.offsetY), this.ctx.transform(e.matrix[0], e.matrix[1], e.matrix[2], e.matrix[3], e.matrix[4], e.matrix[5]), this.ctx.translate(-e.offsetX, -e.offsetY)), hk(e) && (this.path(e.path), this.ctx.clip()), this._activeEffects.push(e);
    }, t.prototype.popEffect = function() {
      this._activeEffects.pop(), this.ctx.restore();
    }, t.prototype.renderStack = function(e) {
      return ls(this, void 0, void 0, function() {
        var r;
        return GA(this, function(a) {
          switch (a.label) {
            case 0:
              return r = e.element.container.styles, r.isVisible() ? [4, this.renderStackContent(e)] : [3, 2];
            case 1:
              a.sent(), a.label = 2;
            case 2:
              return [
                2
                /*return*/
              ];
          }
        });
      });
    }, t.prototype.renderNode = function(e) {
      return ls(this, void 0, void 0, function() {
        return GA(this, function(r) {
          switch (r.label) {
            case 0:
              if (fA(
                e.container.flags,
                16
                /* DEBUG_RENDER */
              ))
                debugger;
              return e.container.styles.isVisible() ? [4, this.renderNodeBackgroundAndBorders(e)] : [3, 3];
            case 1:
              return r.sent(), [4, this.renderNodeContent(e)];
            case 2:
              r.sent(), r.label = 3;
            case 3:
              return [
                2
                /*return*/
              ];
          }
        });
      });
    }, t.prototype.renderTextWithLetterSpacing = function(e, r, a) {
      var A = this;
      if (r === 0)
        this.ctx.fillText(e.text, e.bounds.left, e.bounds.top + a);
      else {
        var i = E0(e.text);
        i.reduce(function(s, o) {
          return A.ctx.fillText(o, s, e.bounds.top + a), s + A.ctx.measureText(o).width;
        }, e.bounds.left);
      }
    }, t.prototype.createFontStyle = function(e) {
      var r = e.fontVariant.filter(function(i) {
        return i === "normal" || i === "small-caps";
      }).join(""), a = U8(e.fontFamily).join(", "), A = Ju(e.fontSize) ? "" + e.fontSize.number + e.fontSize.unit : e.fontSize.number + "px";
      return [
        [e.fontStyle, r, e.fontWeight, A, a].join(" "),
        a,
        A
      ];
    }, t.prototype.renderTextNode = function(e, r) {
      return ls(this, void 0, void 0, function() {
        var a, A, i, s, o, l, u, f, h = this;
        return GA(this, function(c) {
          return a = this.createFontStyle(r), A = a[0], i = a[1], s = a[2], this.ctx.font = A, this.ctx.direction = r.direction === 1 ? "rtl" : "ltr", this.ctx.textAlign = "left", this.ctx.textBaseline = "alphabetic", o = this.fontMetrics.getMetrics(i, s), l = o.baseline, u = o.middle, f = r.paintOrder, e.textBounds.forEach(function(p) {
            f.forEach(function(w) {
              switch (w) {
                case 0:
                  h.ctx.fillStyle = bA(r.color), h.renderTextWithLetterSpacing(p, r.letterSpacing, l);
                  var y = r.textShadow;
                  y.length && p.text.trim().length && (y.slice(0).reverse().forEach(function(m) {
                    h.ctx.shadowColor = bA(m.color), h.ctx.shadowOffsetX = m.offsetX.number * h.options.scale, h.ctx.shadowOffsetY = m.offsetY.number * h.options.scale, h.ctx.shadowBlur = m.blur.number, h.renderTextWithLetterSpacing(p, r.letterSpacing, l);
                  }), h.ctx.shadowColor = "", h.ctx.shadowOffsetX = 0, h.ctx.shadowOffsetY = 0, h.ctx.shadowBlur = 0), r.textDecorationLine.length && (h.ctx.fillStyle = bA(r.textDecorationColor || r.color), r.textDecorationLine.forEach(function(m) {
                    switch (m) {
                      case 1:
                        h.ctx.fillRect(p.bounds.left, Math.round(p.bounds.top + l), p.bounds.width, 1);
                        break;
                      case 2:
                        h.ctx.fillRect(p.bounds.left, Math.round(p.bounds.top), p.bounds.width, 1);
                        break;
                      case 3:
                        h.ctx.fillRect(p.bounds.left, Math.ceil(p.bounds.top + u), p.bounds.width, 1);
                        break;
                    }
                  }));
                  break;
                case 1:
                  r.webkitTextStrokeWidth && p.text.trim().length && (h.ctx.strokeStyle = bA(r.webkitTextStrokeColor), h.ctx.lineWidth = r.webkitTextStrokeWidth, h.ctx.lineJoin = window.chrome ? "miter" : "round", h.ctx.strokeText(p.text, p.bounds.left, p.bounds.top + l)), h.ctx.strokeStyle = "", h.ctx.lineWidth = 0, h.ctx.lineJoin = "miter";
                  break;
              }
            });
          }), [
            2
            /*return*/
          ];
        });
      });
    }, t.prototype.renderReplacedElement = function(e, r, a) {
      if (a && e.intrinsicWidth > 0 && e.intrinsicHeight > 0) {
        var A = Kd(e), i = Wd(r);
        this.path(i), this.ctx.save(), this.ctx.clip(), this.ctx.drawImage(a, 0, 0, e.intrinsicWidth, e.intrinsicHeight, A.left, A.top, A.width, A.height), this.ctx.restore();
      }
    }, t.prototype.renderNodeContent = function(e) {
      return ls(this, void 0, void 0, function() {
        var r, a, A, i, s, o, k, k, l, u, f, h, B, c, p, O, w, y, m, k, D, B, O;
        return GA(this, function(q) {
          switch (q.label) {
            case 0:
              this.applyEffects(e.getEffects(
                4
                /* CONTENT */
              )), r = e.container, a = e.curves, A = r.styles, i = 0, s = r.textNodes, q.label = 1;
            case 1:
              return i < s.length ? (o = s[i], [4, this.renderTextNode(o, A)]) : [3, 4];
            case 2:
              q.sent(), q.label = 3;
            case 3:
              return i++, [3, 1];
            case 4:
              if (!(r instanceof XC)) return [3, 8];
              q.label = 5;
            case 5:
              return q.trys.push([5, 7, , 8]), [4, this.context.cache.match(r.src)];
            case 6:
              return k = q.sent(), this.renderReplacedElement(r, a, k), [3, 8];
            case 7:
              return q.sent(), this.context.logger.error("Error loading image " + r.src), [3, 8];
            case 8:
              if (r instanceof JC && this.renderReplacedElement(r, a, r.canvas), !(r instanceof ZC)) return [3, 12];
              q.label = 9;
            case 9:
              return q.trys.push([9, 11, , 12]), [4, this.context.cache.match(r.svg)];
            case 10:
              return k = q.sent(), this.renderReplacedElement(r, a, k), [3, 12];
            case 11:
              return q.sent(), this.context.logger.error("Error loading svg " + r.svg.substring(0, 255)), [3, 12];
            case 12:
              return r instanceof nk && r.tree ? (l = new t(this.context, {
                scale: this.options.scale,
                backgroundColor: r.backgroundColor,
                x: 0,
                y: 0,
                width: r.width,
                height: r.height
              }), [4, l.render(r.tree)]) : [3, 14];
            case 13:
              u = q.sent(), r.width && r.height && this.ctx.drawImage(u, 0, 0, r.width, r.height, r.bounds.left, r.bounds.top, r.bounds.width, r.bounds.height), q.label = 14;
            case 14:
              if (r instanceof S0 && (f = Math.min(r.bounds.width, r.bounds.height), r.type === Rd ? r.checked && (this.ctx.save(), this.path([
                new ir(r.bounds.left + f * 0.39363, r.bounds.top + f * 0.79),
                new ir(r.bounds.left + f * 0.16, r.bounds.top + f * 0.5549),
                new ir(r.bounds.left + f * 0.27347, r.bounds.top + f * 0.44071),
                new ir(r.bounds.left + f * 0.39694, r.bounds.top + f * 0.5649),
                new ir(r.bounds.left + f * 0.72983, r.bounds.top + f * 0.23),
                new ir(r.bounds.left + f * 0.84, r.bounds.top + f * 0.34085),
                new ir(r.bounds.left + f * 0.39363, r.bounds.top + f * 0.79)
              ]), this.ctx.fillStyle = bA(zw), this.ctx.fill(), this.ctx.restore()) : r.type === Nd && r.checked && (this.ctx.save(), this.ctx.beginPath(), this.ctx.arc(r.bounds.left + f / 2, r.bounds.top + f / 2, f / 4, 0, Math.PI * 2, !0), this.ctx.fillStyle = bA(zw), this.ctx.fill(), this.ctx.restore())), D8(r) && r.value.length) {
                switch (h = this.createFontStyle(A), B = h[0], c = h[1], p = this.fontMetrics.getMetrics(B, c).baseline, this.ctx.font = B, this.ctx.fillStyle = bA(A.color), this.ctx.textBaseline = "alphabetic", this.ctx.textAlign = S8(r.styles.textAlign), O = Kd(r), w = 0, r.styles.textAlign) {
                  case 1:
                    w += O.width / 2;
                    break;
                  case 2:
                    w += O.width;
                    break;
                }
                y = O.add(w, 0, 0, -O.height / 2 + 1), this.ctx.save(), this.path([
                  new ir(O.left, O.top),
                  new ir(O.left + O.width, O.top),
                  new ir(O.left + O.width, O.top + O.height),
                  new ir(O.left, O.top + O.height)
                ]), this.ctx.clip(), this.renderTextWithLetterSpacing(new Pu(r.value, y), A.letterSpacing, p), this.ctx.restore(), this.ctx.textBaseline = "alphabetic", this.ctx.textAlign = "left";
              }
              if (!fA(
                r.styles.display,
                2048
                /* LIST_ITEM */
              )) return [3, 20];
              if (r.styles.listStyleImage === null) return [3, 19];
              if (m = r.styles.listStyleImage, m.type !== 0) return [3, 18];
              k = void 0, D = m.url, q.label = 15;
            case 15:
              return q.trys.push([15, 17, , 18]), [4, this.context.cache.match(D)];
            case 16:
              return k = q.sent(), this.ctx.drawImage(k, r.bounds.left - (k.width + 10), r.bounds.top), [3, 18];
            case 17:
              return q.sent(), this.context.logger.error("Error loading list-style-image " + D), [3, 18];
            case 18:
              return [3, 20];
            case 19:
              e.listValue && r.styles.listStyleType !== -1 && (B = this.createFontStyle(A)[0], this.ctx.font = B, this.ctx.fillStyle = bA(A.color), this.ctx.textBaseline = "middle", this.ctx.textAlign = "right", O = new so(r.bounds.left, r.bounds.top + aa(r.styles.paddingTop, r.bounds.width), r.bounds.width, Iw(A.lineHeight, A.fontSize.number) / 2 + 1), this.renderTextWithLetterSpacing(new Pu(e.listValue, O), A.letterSpacing, Iw(A.lineHeight, A.fontSize.number) / 2 + 2), this.ctx.textBaseline = "bottom", this.ctx.textAlign = "left"), q.label = 20;
            case 20:
              return [
                2
                /*return*/
              ];
          }
        });
      });
    }, t.prototype.renderStackContent = function(e) {
      return ls(this, void 0, void 0, function() {
        var r, a, m, A, i, m, s, o, m, l, u, m, f, h, m, c, p, m, w, y, m;
        return GA(this, function(k) {
          switch (k.label) {
            case 0:
              if (fA(
                e.element.container.flags,
                16
                /* DEBUG_RENDER */
              ))
                debugger;
              return [4, this.renderNodeBackgroundAndBorders(e.element)];
            case 1:
              k.sent(), r = 0, a = e.negativeZIndex, k.label = 2;
            case 2:
              return r < a.length ? (m = a[r], [4, this.renderStack(m)]) : [3, 5];
            case 3:
              k.sent(), k.label = 4;
            case 4:
              return r++, [3, 2];
            case 5:
              return [4, this.renderNodeContent(e.element)];
            case 6:
              k.sent(), A = 0, i = e.nonInlineLevel, k.label = 7;
            case 7:
              return A < i.length ? (m = i[A], [4, this.renderNode(m)]) : [3, 10];
            case 8:
              k.sent(), k.label = 9;
            case 9:
              return A++, [3, 7];
            case 10:
              s = 0, o = e.nonPositionedFloats, k.label = 11;
            case 11:
              return s < o.length ? (m = o[s], [4, this.renderStack(m)]) : [3, 14];
            case 12:
              k.sent(), k.label = 13;
            case 13:
              return s++, [3, 11];
            case 14:
              l = 0, u = e.nonPositionedInlineLevel, k.label = 15;
            case 15:
              return l < u.length ? (m = u[l], [4, this.renderStack(m)]) : [3, 18];
            case 16:
              k.sent(), k.label = 17;
            case 17:
              return l++, [3, 15];
            case 18:
              f = 0, h = e.inlineLevel, k.label = 19;
            case 19:
              return f < h.length ? (m = h[f], [4, this.renderNode(m)]) : [3, 22];
            case 20:
              k.sent(), k.label = 21;
            case 21:
              return f++, [3, 19];
            case 22:
              c = 0, p = e.zeroOrAutoZIndexOrTransformedOrOpacity, k.label = 23;
            case 23:
              return c < p.length ? (m = p[c], [4, this.renderStack(m)]) : [3, 26];
            case 24:
              k.sent(), k.label = 25;
            case 25:
              return c++, [3, 23];
            case 26:
              w = 0, y = e.positiveZIndex, k.label = 27;
            case 27:
              return w < y.length ? (m = y[w], [4, this.renderStack(m)]) : [3, 30];
            case 28:
              k.sent(), k.label = 29;
            case 29:
              return w++, [3, 27];
            case 30:
              return [
                2
                /*return*/
              ];
          }
        });
      });
    }, t.prototype.mask = function(e) {
      this.ctx.beginPath(), this.ctx.moveTo(0, 0), this.ctx.lineTo(this.canvas.width, 0), this.ctx.lineTo(this.canvas.width, this.canvas.height), this.ctx.lineTo(0, this.canvas.height), this.ctx.lineTo(0, 0), this.formatPath(e.slice(0).reverse()), this.ctx.closePath();
    }, t.prototype.path = function(e) {
      this.ctx.beginPath(), this.formatPath(e), this.ctx.closePath();
    }, t.prototype.formatPath = function(e) {
      var r = this;
      e.forEach(function(a, A) {
        var i = Vs(a) ? a.start : a;
        A === 0 ? r.ctx.moveTo(i.x, i.y) : r.ctx.lineTo(i.x, i.y), Vs(a) && r.ctx.bezierCurveTo(a.startControl.x, a.startControl.y, a.endControl.x, a.endControl.y, a.end.x, a.end.y);
      });
    }, t.prototype.renderRepeat = function(e, r, a, A) {
      this.path(e), this.ctx.fillStyle = r, this.ctx.translate(a, A), this.ctx.fill(), this.ctx.translate(-a, -A);
    }, t.prototype.resizeImage = function(e, r, a) {
      var A;
      if (e.width === r && e.height === a)
        return e;
      var i = (A = this.canvas.ownerDocument) !== null && A !== void 0 ? A : document, s = i.createElement("canvas");
      s.width = Math.max(1, r), s.height = Math.max(1, a);
      var o = s.getContext("2d");
      return o.drawImage(e, 0, 0, e.width, e.height, 0, 0, r, a), s;
    }, t.prototype.renderBackgroundImage = function(e) {
      return ls(this, void 0, void 0, function() {
        var r, a, A, i, s, o;
        return GA(this, function(l) {
          switch (l.label) {
            case 0:
              r = e.styles.backgroundImage.length - 1, a = function(u) {
                var f, h, c, Y, J, S, Q, x, W, p, Y, J, S, Q, x, w, y, m, k, D, B, O, q, G, W, F, Y, T, E, Q, x, oe, J, S, I, N, se, Z, C, H, M, te;
                return GA(this, function(ie) {
                  switch (ie.label) {
                    case 0:
                      if (u.type !== 0) return [3, 5];
                      f = void 0, h = u.url, ie.label = 1;
                    case 1:
                      return ie.trys.push([1, 3, , 4]), [4, A.context.cache.match(h)];
                    case 2:
                      return f = ie.sent(), [3, 4];
                    case 3:
                      return ie.sent(), A.context.logger.error("Error loading background-image " + h), [3, 4];
                    case 4:
                      return f && (c = wh(e, r, [
                        f.width,
                        f.height,
                        f.width / f.height
                      ]), Y = c[0], J = c[1], S = c[2], Q = c[3], x = c[4], W = A.ctx.createPattern(A.resizeImage(f, Q, x), "repeat"), A.renderRepeat(Y, W, J, S)), [3, 6];
                    case 5:
                      dN(u) ? (p = wh(e, r, [null, null, null]), Y = p[0], J = p[1], S = p[2], Q = p[3], x = p[4], w = iN(u.angle, Q, x), y = w[0], m = w[1], k = w[2], D = w[3], B = w[4], O = document.createElement("canvas"), O.width = Q, O.height = x, q = O.getContext("2d"), G = q.createLinearGradient(m, D, k, B), Uw(u.stops, y).forEach(function(we) {
                        return G.addColorStop(we.stop, bA(we.color));
                      }), q.fillStyle = G, q.fillRect(0, 0, Q, x), Q > 0 && x > 0 && (W = A.ctx.createPattern(O, "repeat"), A.renderRepeat(Y, W, J, S))) : fN(u) && (F = wh(e, r, [
                        null,
                        null,
                        null
                      ]), Y = F[0], T = F[1], E = F[2], Q = F[3], x = F[4], oe = u.position.length === 0 ? [T0] : u.position, J = aa(oe[0], Q), S = aa(oe[oe.length - 1], x), I = oN(u, J, S, Q, x), N = I[0], se = I[1], N > 0 && se > 0 && (Z = A.ctx.createRadialGradient(T + J, E + S, 0, T + J, E + S, N), Uw(u.stops, N * 2).forEach(function(we) {
                        return Z.addColorStop(we.stop, bA(we.color));
                      }), A.path(Y), A.ctx.fillStyle = Z, N !== se ? (C = e.bounds.left + 0.5 * e.bounds.width, H = e.bounds.top + 0.5 * e.bounds.height, M = se / N, te = 1 / M, A.ctx.save(), A.ctx.translate(C, H), A.ctx.transform(1, 0, 0, M, 0, 0), A.ctx.translate(-C, -H), A.ctx.fillRect(T, te * (E - H) + H, Q, x * te), A.ctx.restore()) : A.ctx.fill())), ie.label = 6;
                    case 6:
                      return r--, [
                        2
                        /*return*/
                      ];
                  }
                });
              }, A = this, i = 0, s = e.styles.backgroundImage.slice(0).reverse(), l.label = 1;
            case 1:
              return i < s.length ? (o = s[i], [5, a(o)]) : [3, 4];
            case 2:
              l.sent(), l.label = 3;
            case 3:
              return i++, [3, 1];
            case 4:
              return [
                2
                /*return*/
              ];
          }
        });
      });
    }, t.prototype.renderSolidBorder = function(e, r, a) {
      return ls(this, void 0, void 0, function() {
        return GA(this, function(A) {
          return this.path(o2(a, r)), this.ctx.fillStyle = bA(e), this.ctx.fill(), [
            2
            /*return*/
          ];
        });
      });
    }, t.prototype.renderDoubleBorder = function(e, r, a, A) {
      return ls(this, void 0, void 0, function() {
        var i, s;
        return GA(this, function(o) {
          switch (o.label) {
            case 0:
              return r < 3 ? [4, this.renderSolidBorder(e, a, A)] : [3, 2];
            case 1:
              return o.sent(), [
                2
                /*return*/
              ];
            case 2:
              return i = v8(A, a), this.path(i), this.ctx.fillStyle = bA(e), this.ctx.fill(), s = p8(A, a), this.path(s), this.ctx.fill(), [
                2
                /*return*/
              ];
          }
        });
      });
    }, t.prototype.renderNodeBackgroundAndBorders = function(e) {
      return ls(this, void 0, void 0, function() {
        var r, a, A, i, s, o, l, u, f = this;
        return GA(this, function(h) {
          switch (h.label) {
            case 0:
              return this.applyEffects(e.getEffects(
                2
                /* BACKGROUND_BORDERS */
              )), r = e.container.styles, a = !_o(r.backgroundColor) || r.backgroundImage.length, A = [
                { style: r.borderTopStyle, color: r.borderTopColor, width: r.borderTopWidth },
                { style: r.borderRightStyle, color: r.borderRightColor, width: r.borderRightWidth },
                { style: r.borderBottomStyle, color: r.borderBottomColor, width: r.borderBottomWidth },
                { style: r.borderLeftStyle, color: r.borderLeftColor, width: r.borderLeftWidth }
              ], i = E8(Nl(r.backgroundClip, 0), e.curves), a || r.boxShadow.length ? (this.ctx.save(), this.path(i), this.ctx.clip(), _o(r.backgroundColor) || (this.ctx.fillStyle = bA(r.backgroundColor), this.ctx.fill()), [4, this.renderBackgroundImage(e.container)]) : [3, 2];
            case 1:
              h.sent(), this.ctx.restore(), r.boxShadow.slice(0).reverse().forEach(function(c) {
                f.ctx.save();
                var p = Pd(e.curves), w = c.inset ? 0 : T8, y = h8(p, -w + (c.inset ? 1 : -1) * c.spread.number, (c.inset ? 1 : -1) * c.spread.number, c.spread.number * (c.inset ? -2 : 2), c.spread.number * (c.inset ? -2 : 2));
                c.inset ? (f.path(p), f.ctx.clip(), f.mask(y)) : (f.mask(p), f.ctx.clip(), f.path(y)), f.ctx.shadowOffsetX = c.offsetX.number + w, f.ctx.shadowOffsetY = c.offsetY.number, f.ctx.shadowColor = bA(c.color), f.ctx.shadowBlur = c.blur.number, f.ctx.fillStyle = c.inset ? bA(c.color) : "rgba(0,0,0,1)", f.ctx.fill(), f.ctx.restore();
              }), h.label = 2;
            case 2:
              s = 0, o = 0, l = A, h.label = 3;
            case 3:
              return o < l.length ? (u = l[o], u.style !== 0 && !_o(u.color) && u.width > 0 ? u.style !== 2 ? [3, 5] : [4, this.renderDashedDottedBorder(
                u.color,
                u.width,
                s,
                e.curves,
                2
                /* DASHED */
              )] : [3, 11]) : [3, 13];
            case 4:
              return h.sent(), [3, 11];
            case 5:
              return u.style !== 3 ? [3, 7] : [4, this.renderDashedDottedBorder(
                u.color,
                u.width,
                s,
                e.curves,
                3
                /* DOTTED */
              )];
            case 6:
              return h.sent(), [3, 11];
            case 7:
              return u.style !== 4 ? [3, 9] : [4, this.renderDoubleBorder(u.color, u.width, s, e.curves)];
            case 8:
              return h.sent(), [3, 11];
            case 9:
              return [4, this.renderSolidBorder(u.color, s, e.curves)];
            case 10:
              h.sent(), h.label = 11;
            case 11:
              s++, h.label = 12;
            case 12:
              return o++, [3, 3];
            case 13:
              return [
                2
                /*return*/
              ];
          }
        });
      });
    }, t.prototype.renderDashedDottedBorder = function(e, r, a, A, i) {
      return ls(this, void 0, void 0, function() {
        var s, o, l, u, f, h, c, p, w, y, m, k, D, B, O, q, O, q;
        return GA(this, function(G) {
          return this.ctx.save(), s = m8(A, a), o = o2(A, a), i === 2 && (this.path(o), this.ctx.clip()), Vs(o[0]) ? (l = o[0].start.x, u = o[0].start.y) : (l = o[0].x, u = o[0].y), Vs(o[1]) ? (f = o[1].end.x, h = o[1].end.y) : (f = o[1].x, h = o[1].y), a === 0 || a === 2 ? c = Math.abs(l - f) : c = Math.abs(u - h), this.ctx.beginPath(), i === 3 ? this.formatPath(s) : this.formatPath(o.slice(0, 2)), p = r < 3 ? r * 3 : r * 2, w = r < 3 ? r * 2 : r, i === 3 && (p = r, w = r), y = !0, c <= p * 2 ? y = !1 : c <= p * 2 + w ? (m = c / (2 * p + w), p *= m, w *= m) : (k = Math.floor((c + w) / (p + w)), D = (c - k * p) / (k - 1), B = (c - (k + 1) * p) / k, w = B <= 0 || Math.abs(w - D) < Math.abs(w - B) ? D : B), y && (i === 3 ? this.ctx.setLineDash([0, p + w]) : this.ctx.setLineDash([p, w])), i === 3 ? (this.ctx.lineCap = "round", this.ctx.lineWidth = r) : this.ctx.lineWidth = r * 2 + 1.1, this.ctx.strokeStyle = bA(e), this.ctx.stroke(), this.ctx.setLineDash([]), i === 2 && (Vs(o[0]) && (O = o[3], q = o[0], this.ctx.beginPath(), this.formatPath([new ir(O.end.x, O.end.y), new ir(q.start.x, q.start.y)]), this.ctx.stroke()), Vs(o[1]) && (O = o[1], q = o[2], this.ctx.beginPath(), this.formatPath([new ir(O.end.x, O.end.y), new ir(q.start.x, q.start.y)]), this.ctx.stroke())), this.ctx.restore(), [
            2
            /*return*/
          ];
        });
      });
    }, t.prototype.render = function(e) {
      return ls(this, void 0, void 0, function() {
        var r;
        return GA(this, function(a) {
          switch (a.label) {
            case 0:
              return this.options.backgroundColor && (this.ctx.fillStyle = bA(this.options.backgroundColor), this.ctx.fillRect(this.options.x, this.options.y, this.options.width, this.options.height)), r = g8(e), [4, this.renderStack(r)];
            case 1:
              return a.sent(), this.applyEffects([]), [2, this.canvas];
          }
        });
      });
    }, t;
  })(wk)
), D8 = function(n) {
  return n instanceof rk || n instanceof tk ? !0 : n instanceof S0 && n.type !== Nd && n.type !== Rd;
}, E8 = function(n, t) {
  switch (n) {
    case 0:
      return Pd(t);
    case 2:
      return l8(t);
    case 1:
    default:
      return Wd(t);
  }
}, S8 = function(n) {
  switch (n) {
    case 1:
      return "center";
    case 2:
      return "right";
    case 0:
    default:
      return "left";
  }
}, F8 = ["-apple-system", "system-ui"], U8 = function(n) {
  return /iPhone OS 15_(0|1)/.test(window.navigator.userAgent) ? n.filter(function(t) {
    return F8.indexOf(t) === -1;
  }) : n;
}, L8 = (
  /** @class */
  (function(n) {
    mi(t, n);
    function t(e, r) {
      var a = n.call(this, e, r) || this;
      return a.canvas = r.canvas ? r.canvas : document.createElement("canvas"), a.ctx = a.canvas.getContext("2d"), a.options = r, a.canvas.width = Math.floor(r.width * r.scale), a.canvas.height = Math.floor(r.height * r.scale), a.canvas.style.width = r.width + "px", a.canvas.style.height = r.height + "px", a.ctx.scale(a.options.scale, a.options.scale), a.ctx.translate(-r.x, -r.y), a.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized (" + r.width + "x" + r.height + " at " + r.x + "," + r.y + ") with scale " + r.scale), a;
    }
    return t.prototype.render = function(e) {
      return ls(this, void 0, void 0, function() {
        var r, a;
        return GA(this, function(A) {
          switch (A.label) {
            case 0:
              return r = Wp(this.options.width * this.options.scale, this.options.height * this.options.scale, this.options.scale, this.options.scale, e), [4, I8(r)];
            case 1:
              return a = A.sent(), this.options.backgroundColor && (this.ctx.fillStyle = bA(this.options.backgroundColor), this.ctx.fillRect(0, 0, this.options.width * this.options.scale, this.options.height * this.options.scale)), this.ctx.drawImage(a, -this.options.x * this.options.scale, -this.options.y * this.options.scale), [2, this.canvas];
          }
        });
      });
    }, t;
  })(wk)
), I8 = function(n) {
  return new Promise(function(t, e) {
    var r = new Image();
    r.onload = function() {
      t(r);
    }, r.onerror = e, r.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(n));
  });
}, Q8 = (
  /** @class */
  (function() {
    function n(t) {
      var e = t.id, r = t.enabled;
      this.id = e, this.enabled = r, this.start = Date.now();
    }
    return n.prototype.debug = function() {
      for (var t = [], e = 0; e < arguments.length; e++)
        t[e] = arguments[e];
      this.enabled && (typeof window < "u" && window.console && typeof console.debug == "function" ? console.debug.apply(console, Oc([this.id, this.getTime() + "ms"], t)) : this.info.apply(this, t));
    }, n.prototype.getTime = function() {
      return Date.now() - this.start;
    }, n.prototype.info = function() {
      for (var t = [], e = 0; e < arguments.length; e++)
        t[e] = arguments[e];
      this.enabled && typeof window < "u" && window.console && typeof console.info == "function" && console.info.apply(console, Oc([this.id, this.getTime() + "ms"], t));
    }, n.prototype.warn = function() {
      for (var t = [], e = 0; e < arguments.length; e++)
        t[e] = arguments[e];
      this.enabled && (typeof window < "u" && window.console && typeof console.warn == "function" ? console.warn.apply(console, Oc([this.id, this.getTime() + "ms"], t)) : this.info.apply(this, t));
    }, n.prototype.error = function() {
      for (var t = [], e = 0; e < arguments.length; e++)
        t[e] = arguments[e];
      this.enabled && (typeof window < "u" && window.console && typeof console.error == "function" ? console.error.apply(console, Oc([this.id, this.getTime() + "ms"], t)) : this.info.apply(this, t));
    }, n.instances = {}, n;
  })()
), M8 = (
  /** @class */
  (function() {
    function n(t, e) {
      var r;
      this.windowBounds = e, this.instanceName = "#" + n.instanceCount++, this.logger = new Q8({ id: this.instanceName, enabled: t.logging }), this.cache = (r = t.cache) !== null && r !== void 0 ? r : new t8(this, t);
    }
    return n.instanceCount = 1, n;
  })()
), Gp = function(n, t) {
  return t === void 0 && (t = {}), _8(n, t);
};
typeof window < "u" && fk.setContext(window);
var _8 = function(n, t) {
  return ls(void 0, void 0, void 0, function() {
    var e, r, a, A, i, s, o, l, u, f, h, c, p, w, y, m, k, D, B, O, G, q, G, W, F, Y, T, E, Q, x, oe, J, S, I, N, se, Z, C, H, M;
    return GA(this, function(te) {
      switch (te.label) {
        case 0:
          if (!n || typeof n != "object")
            return [2, Promise.reject("Invalid element provided as first argument")];
          if (e = n.ownerDocument, !e)
            throw new Error("Element is not attached to a Document");
          if (r = e.defaultView, !r)
            throw new Error("Document is not attached to a Window");
          return a = {
            allowTaint: (W = t.allowTaint) !== null && W !== void 0 ? W : !1,
            imageTimeout: (F = t.imageTimeout) !== null && F !== void 0 ? F : 15e3,
            proxy: t.proxy,
            useCORS: (Y = t.useCORS) !== null && Y !== void 0 ? Y : !1
          }, A = Dp({ logging: (T = t.logging) !== null && T !== void 0 ? T : !0, cache: t.cache }, a), i = {
            windowWidth: (E = t.windowWidth) !== null && E !== void 0 ? E : r.innerWidth,
            windowHeight: (Q = t.windowHeight) !== null && Q !== void 0 ? Q : r.innerHeight,
            scrollX: (x = t.scrollX) !== null && x !== void 0 ? x : r.pageXOffset,
            scrollY: (oe = t.scrollY) !== null && oe !== void 0 ? oe : r.pageYOffset
          }, s = new so(i.scrollX, i.scrollY, i.windowWidth, i.windowHeight), o = new M8(A, s), l = (J = t.foreignObjectRendering) !== null && J !== void 0 ? J : !1, u = {
            allowTaint: (S = t.allowTaint) !== null && S !== void 0 ? S : !1,
            onclone: t.onclone,
            ignoreElements: t.ignoreElements,
            inlineImages: l,
            copyStyles: l
          }, o.logger.debug("Starting document clone with size " + s.width + "x" + s.height + " scrolled to " + -s.left + "," + -s.top), f = new A2(o, n, u), h = f.clonedReferenceElement, h ? [4, f.toIFrame(e, s)] : [2, Promise.reject("Unable to find element in cloned iframe")];
        case 1:
          return c = te.sent(), p = F0(h) || NO(h) ? h_(h.ownerDocument) : jd(o, h), w = p.width, y = p.height, m = p.left, k = p.top, D = R8(o, h, t.backgroundColor), B = {
            canvas: t.canvas,
            backgroundColor: D,
            scale: (N = (I = t.scale) !== null && I !== void 0 ? I : r.devicePixelRatio) !== null && N !== void 0 ? N : 1,
            x: ((se = t.x) !== null && se !== void 0 ? se : 0) + m,
            y: ((Z = t.y) !== null && Z !== void 0 ? Z : 0) + k,
            width: (C = t.width) !== null && C !== void 0 ? C : Math.ceil(w),
            height: (H = t.height) !== null && H !== void 0 ? H : Math.ceil(y)
          }, l ? (o.logger.debug("Document cloned, using foreign object rendering"), G = new L8(o, B), [4, G.render(h)]) : [3, 3];
        case 2:
          return O = te.sent(), [3, 5];
        case 3:
          return o.logger.debug("Document cloned, element located at " + m + "," + k + " with size " + w + "x" + y + " using computed rendering"), o.logger.debug("Starting DOM parsing"), q = Ak(o, h), D === q.styles.backgroundColor && (q.styles.backgroundColor = ao.TRANSPARENT), o.logger.debug("Starting renderer for element at " + B.x + "," + B.y + " with size " + B.width + "x" + B.height), G = new x8(o, B), [4, G.render(q)];
        case 4:
          O = te.sent(), te.label = 5;
        case 5:
          return (!((M = t.removeContainer) !== null && M !== void 0) || M) && (A2.destroy(c) || o.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")), o.logger.debug("Finished rendering"), [2, O];
      }
    });
  });
}, R8 = function(n, t, e) {
  var r = t.ownerDocument, a = r.documentElement ? Hu(n, getComputedStyle(r.documentElement).backgroundColor) : ao.TRANSPARENT, A = r.body ? Hu(n, getComputedStyle(r.body).backgroundColor) : ao.TRANSPARENT, i = typeof e == "string" ? Hu(n, e) : e === null ? ao.TRANSPARENT : 4294967295;
  return t === r.documentElement ? _o(a) ? _o(A) ? i : A : a : i;
};
const N8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: Gp
}, Symbol.toStringTag, { value: "Module" }));
function H8(n) {
  let t = !1;
  if (typeof n.type == "object") {
    const A = n.type;
    t = A.name === "TaskListContextMenu" || A.__name === "TaskListContextMenu" || // 检查文件名(setup script 组件)
    A.__file !== void 0 && A.__file.includes("TaskListContextMenu");
  }
  if (!t)
    return null;
  const e = n.props || {}, r = n.children, a = r == null ? void 0 : r.default;
  return a ? {
    defaultSlot: a,
    taskType: e.taskType || e["task-type"]
  } : null;
}
function O8(n) {
  var r;
  const t = (r = n.default) == null ? void 0 : r.call(n);
  if (!t || !Array.isArray(t))
    return null;
  const e = (a) => {
    for (const A of a) {
      if (!A)
        continue;
      if (typeof A.type == "symbol") {
        if (A.children && Array.isArray(A.children)) {
          const s = e(A.children);
          if (s) return s;
        }
        continue;
      }
      const i = H8(A);
      if (i)
        return i;
      if (A.children && Array.isArray(A.children)) {
        const s = e(A.children);
        if (s) return s;
      }
    }
    return null;
  };
  return e(t);
}
function P8(n) {
  const t = ce(() => O8(n)), e = ce(() => !!t.value);
  return {
    declarativeContextMenu: t,
    hasDeclarativeContextMenu: e
  };
}
function W8(n) {
  let t = !1;
  if (typeof n.type == "object") {
    const A = n.type;
    t = A.name === "TaskBarContextMenu" || A.__name === "TaskBarContextMenu" || // 检查文件名(setup script 组件)
    A.__file !== void 0 && A.__file.includes("TaskBarContextMenu");
  }
  if (!t)
    return null;
  const e = n.props || {}, r = n.children, a = r == null ? void 0 : r.default;
  return a ? {
    defaultSlot: a,
    taskType: e.taskType || e["task-type"]
  } : null;
}
function K8(n) {
  var r;
  const t = (r = n.default) == null ? void 0 : r.call(n);
  if (!t || !Array.isArray(t))
    return null;
  const e = (a) => {
    for (const A of a) {
      if (!A)
        continue;
      if (typeof A.type == "symbol") {
        if (A.children && Array.isArray(A.children)) {
          const s = e(A.children);
          if (s) return s;
        }
        continue;
      }
      const i = W8(A);
      if (i)
        return i;
      if (A.children && Array.isArray(A.children)) {
        const s = e(A.children);
        if (s) return s;
      }
    }
    return null;
  };
  return e(t);
}
function $8(n) {
  const t = ce(() => K8(n)), e = ce(() => !!t.value);
  return {
    declarativeContextMenu: t,
    hasDeclarativeContextMenu: e
  };
}
const V8 = { class: "gantt-body" }, q8 = ["title"], j8 = {
  width: "16",
  height: "16",
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  "stroke-width": "2.5"
}, Y8 = {
  key: 0,
  points: "15,18 9,12 15,6"
}, G8 = {
  key: 1,
  points: "9,18 15,12 9,6"
}, z8 = { class: "close-text" }, yh = 18, X8 = /* @__PURE__ */ hn({
  __name: "GanttChart",
  props: {
    tasks: { default: () => [] },
    milestones: { default: () => [] },
    resources: { default: () => [] },
    viewMode: { default: "task" },
    availableViewModes: {},
    useDefaultDrawer: { type: Boolean, default: !0 },
    useDefaultMilestoneDialog: { type: Boolean, default: !0 },
    toolbarConfig: { default: () => ({}) },
    showToolbar: { type: Boolean, default: !0 },
    onTodayLocate: { type: Function, default: void 0 },
    onExportCsv: { type: Function, default: void 0 },
    onExportPdf: { type: Function, default: void 0 },
    onLanguageChange: { type: Function, default: void 0 },
    onThemeChange: { type: Function, default: void 0 },
    onFullscreenChange: { type: Function, default: void 0 },
    onSettingsConfirm: { type: Function, default: void 0 },
    onExpandAll: { type: Function, default: void 0 },
    onCollapseAll: { type: Function, default: void 0 },
    localeMessages: { default: void 0 },
    workingHours: { default: () => ({
      morning: { start: 8, end: 11 },
      afternoon: { start: 13, end: 17 }
    }) },
    taskListConfig: { default: void 0 },
    resourceListConfig: { default: void 0 },
    calendarProps: {},
    resourceUsageProps: {},
    taskListColumnRenderMode: { default: "default" },
    taskBarConfig: { default: void 0 },
    autoSortByStartDate: { type: Boolean, default: !1 },
    allowDragAndResize: { type: Boolean, default: !0 },
    enableTaskRowMove: { type: Boolean, default: !1 },
    assigneeOptions: { default: () => [] },
    resourceTypeOptions: { default: () => [] },
    showResourceTypeOption: { type: Boolean, default: !0 },
    taskListRowClassName: { type: [String, Function], default: void 0 },
    taskListRowStyle: { type: [Boolean, null, String, Object, Array, Function], default: void 0 },
    enableTaskListContextMenu: { type: Boolean, default: !0 },
    enableTaskBarContextMenu: { type: Boolean, default: !0 },
    enableLinkAnchor: { type: Boolean, default: !0 },
    enableTaskBarTooltip: { type: Boolean, default: !0 },
    enableMilestoneTooltip: { type: Boolean, default: !0 },
    milestoneLabelPosition: { default: "right" },
    showActualTaskbar: { type: Boolean, default: !1 },
    showConflicts: { type: Boolean, default: !0 },
    showTaskbarTab: { type: Boolean, default: !0 },
    taskbarDescFixed: { type: Boolean, default: !1 },
    pendingTaskBackgroundColor: {},
    delayTaskBackgroundColor: {},
    completeTaskBackgroundColor: {},
    ongoingTaskBackgroundColor: {},
    fullscreen: { type: Boolean, default: !1 },
    expandAll: { type: Boolean, default: !0 },
    locale: { default: "zh-CN" },
    timeScale: { default: "week" },
    theme: { default: void 0 },
    enableTaskListCollapsible: { type: Boolean, default: !0 },
    taskListVisible: { type: Boolean, default: !0 },
    enableTaskDrawerAutoClose: { type: Boolean, default: !0 },
    scaleConfigs: { default: void 0 },
    rowHeight: { default: 51 },
    enableParentTaskAutoSchedule: { type: Boolean, default: !0 },
    enableResourceLaneStacking: { type: Boolean, default: !0 },
    linkConfig: {}
  },
  emits: [
    "task-click",
    "task-double-click",
    "taskbar-drag-end",
    "taskbar-resize-end",
    "milestone-drag-end",
    "milestone-double-click",
    "timer-started",
    "timer-stopped",
    "predecessor-added",
    "successor-added",
    "task-deleted",
    "task-added",
    "task-updated",
    "task-collapse-change",
    // 任务折叠状态变化事件
    "link-deleted",
    // 链接删除事件
    "view-mode-changed",
    // 视图模式变化事件
    // 工具栏事件
    "add-task",
    "add-milestone",
    // 里程碑事件
    "milestone-saved",
    "milestone-deleted",
    "milestone-icon-changed",
    // 任务关系事件
    "add-predecessor",
    "add-successor",
    // TaskRow拖拽事件
    "task-row-moved",
    // v1.9.0 资源视图事件
    "taskbar-resource-change",
    // 任务跨资源移动事件
    "resource-drag-end",
    // v1.9.0 资源视图垂直拖拽结束事件
    // v1.12.5 CalendarView 转发事件
    "calendar-selection-complete",
    "calendar-selection-cancel",
    "calendar-resource-change",
    "calendar-view-change",
    "calendar-date-change",
    // v1.13.0 CalendarView 任务点击/拖拽移动转发事件
    "calendar-task-click",
    "calendar-task-move",
    // v1.12.5 ResourceUsageView 转发事件
    "resource-usage-scale-change",
    "resource-usage-cell-click",
    "resource-usage-cell-hover",
    "resource-usage-overload-detected",
    // v1.13.0 ResourceUsageView Tooltip 明细任务点击转发事件(P1 待办 T7.4)
    "resource-usage-task-detail-click"
  ],
  setup(n, { expose: t, emit: e }) {
    const r = n, a = e, A = me(r.linkConfig || {});
    Gt(
      () => r.linkConfig,
      (P) => {
        A.value = P || {};
      }
    );
    const i = ce(() => ({
      ...cp,
      ...A.value
    })), s = me(), o = me(null), { showMessage: l } = g5(), u = Jl(), f = me(
      r.viewMode || "task"
    ), h = ce(() => f.value === "resource" ? r.resources : r.tasks), c = ce(() => f.value === "resource" ? r.resourceListConfig : r.taskListConfig);
    Tn("gantt-view-mode", f), Tn("gantt-data-source", h), Tn("gantt-list-config", c), Tn(
      "gantt-show-conflicts",
      ce(() => r.showConflicts)
    ), Tn(
      "gantt-show-taskbar-tab",
      ce(() => r.showTaskbarTab)
    ), Tn(
      "gantt-taskbar-desc-fixed",
      ce(() => r.taskbarDescFixed)
    ), Tn(
      "gantt-row-height",
      ce(() => Math.min(60, Math.max(30, r.rowHeight ?? 51)))
    );
    const p = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), y = (P) => P.map((he) => `${he.id}-${he.startDate || ""}-${he.endDate || ""}`).join("|"), m = ce(() => {
      var he;
      const P = /* @__PURE__ */ new Map();
      if (f.value === "resource") {
        const Fe = h.value, tt = Math.min(60, Math.max(30, r.rowHeight ?? 51)) + (((he = r.taskBarConfig) == null ? void 0 : he.titlePosition) === "above" ? yh : 0);
        if (De.value >= 0) {
          const lt = nt.value;
          lt.size > 0 && lt.size < Fe.length * 0.3 ? (p.forEach((L, j) => {
            P.set(j, L.layout);
          }), lt.forEach((L) => {
            const j = Fe.find((Rt) => String(Rt.id) === String(L));
            if (!j) return;
            const ae = String(j.id), pe = j.tasks || [];
            if (pe.length === 0) {
              P.set(ae, {
                taskRowMap: /* @__PURE__ */ new Map(),
                rowHeights: [tt],
                totalHeight: tt
              }), p.set(ae, {
                layout: P.get(ae),
                hash: ""
              });
              return;
            }
            const Oe = y(pe), Pe = r.enableResourceLaneStacking !== !1 ? "1" : "0", mt = `${je.value}:${Pe}:${Oe}`, Qt = p.get(ae);
            if (Qt && Qt.hash === mt)
              P.set(ae, Qt.layout);
            else {
              const Rt = Jm(
                pe,
                tt,
                je.value,
                r.enableResourceLaneStacking !== !1
              );
              P.set(ae, Rt), p.set(ae, {
                layout: Rt,
                hash: mt
              });
            }
          })) : Fe.forEach((L) => {
            const j = String(L.id), ae = L.tasks || [];
            if (ae.length === 0) {
              P.set(j, {
                taskRowMap: /* @__PURE__ */ new Map(),
                rowHeights: [tt],
                totalHeight: tt
              });
              return;
            }
            const pe = y(ae), Oe = r.enableResourceLaneStacking !== !1 ? "1" : "0", Pe = `${je.value}:${Oe}:${pe}`, mt = p.get(j);
            if (mt && mt.hash === Pe)
              P.set(j, mt.layout);
            else {
              const Qt = Jm(
                ae,
                tt,
                je.value,
                r.enableResourceLaneStacking !== !1
              );
              P.set(j, Qt), p.set(j, {
                layout: Qt,
                hash: Pe
              });
            }
          });
        }
      }
      return P;
    }), k = ce(() => {
      const P = /* @__PURE__ */ new Map();
      if (f.value === "resource") {
        const he = h.value;
        let Fe = 0;
        he.forEach((tt) => {
          var j;
          const lt = String(tt.id);
          P.set(lt, Fe);
          const v = m.value.get(lt), L = (v == null ? void 0 : v.totalHeight) || Math.min(60, Math.max(30, r.rowHeight ?? 51)) + (((j = r.taskBarConfig) == null ? void 0 : j.titlePosition) === "above" ? yh : 0);
          Fe += L;
        });
      }
      return P;
    }), D = ce(() => {
      if (f.value !== "resource") return /* @__PURE__ */ new Map();
      const P = h.value, he = /* @__PURE__ */ new Map();
      if (De.value >= 0) {
        const Fe = nt.value;
        Fe.size > 0 && Fe.size < P.length * 0.3 ? (w.forEach((lt, v) => {
          lt.conflicts.size > 0 && he.set(v, lt.conflicts);
        }), Fe.forEach((lt) => {
          const v = P.find((Pe) => String(Pe.id) === String(lt));
          if (!v) return;
          const L = v.tasks || [];
          if (L.length < 2) return;
          const j = String(v.id), ae = y(L), pe = `${je.value}:${ae}`, Oe = w.get(j);
          if (Oe && Oe.hash === pe)
            Oe.conflicts.size > 0 && he.set(j, Oe.conflicts);
          else {
            const Pe = Ku(L, v.id, je.value);
            if (Pe.length > 0) {
              const mt = /* @__PURE__ */ new Set();
              Pe.forEach((Qt) => {
                Qt.tasks.forEach((Rt) => {
                  mt.add(Rt.id);
                });
              }), mt.size > 0 && he.set(j, mt), w.set(j, {
                conflicts: mt,
                hash: pe
              });
            } else
              w.set(j, {
                conflicts: /* @__PURE__ */ new Set(),
                hash: pe
              });
          }
        })) : P.forEach((lt) => {
          const v = lt.tasks || [];
          if (v.length < 2) return;
          const L = String(lt.id), j = y(v), ae = `${je.value}:${j}`, pe = w.get(L);
          if (pe && pe.hash === ae)
            pe.conflicts.size > 0 && he.set(L, pe.conflicts);
          else {
            const Oe = Ku(v, lt.id, je.value);
            if (Oe.length > 0) {
              const Pe = /* @__PURE__ */ new Set();
              Oe.forEach((mt) => {
                mt.tasks.forEach((Qt) => {
                  Pe.add(Qt.id);
                });
              }), Pe.size > 0 && he.set(L, Pe), w.set(L, {
                conflicts: Pe,
                hash: ae
              });
            } else
              w.set(L, {
                conflicts: /* @__PURE__ */ new Set(),
                hash: ae
              });
          }
        });
      }
      return he;
    });
    Tn("resourceTaskLayouts", m), Tn("resourceRowPositions", k), Tn("resourceConflicts", D), Tn("gantt-column-slots", u), Tn(
      "gantt-has-taskbar-tooltip-slot",
      ce(() => !!u["taskbar-tooltip"])
    ), Tn(
      "enable-task-list-context-menu",
      ce(() => r.enableTaskListContextMenu)
    ), Tn(
      "enable-task-bar-context-menu",
      ce(() => r.enableTaskBarContextMenu)
    ), Tn(
      "enable-link-anchor",
      ce(() => r.enableLinkAnchor)
    );
    const B = () => typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", O = me("light");
    Tn("gantt-theme", O);
    const {
      hasDeclarativeContextMenu: q,
      declarativeContextMenu: G
    } = P8(u), {
      hasDeclarativeContextMenu: W,
      declarativeContextMenu: F
    } = $8(u), Y = ce(() => q.value);
    Tn("task-list-context-menu-slot", Y), Tn("declarative-task-list-context-menu", G);
    const T = ce(() => W.value);
    Tn("task-bar-context-menu-slot", T), Tn("declarative-task-bar-context-menu", F);
    const E = me(1920), Q = (P, he) => {
      let Fe = 0, tt = null;
      return ((...lt) => {
        const v = Date.now(), L = he - (v - Fe);
        tt && clearTimeout(tt), L <= 0 ? (Fe = v, P(...lt)) : tt = window.setTimeout(() => {
          Fe = Date.now(), P(...lt), tt = null;
        }, L);
      });
    }, x = async () => {
      await An(), C.value = I(), Z.value = N(), M.value = N(), te.value = N(), H.value = I();
      const P = we(ie.value);
      P !== ie.value && (ie.value = P);
    }, oe = () => {
      if (s.value) {
        const P = s.value.clientWidth;
        P !== E.value && (E.value = P, x());
      }
    }, J = Q(oe, 100);
    sA(() => {
      oe(), x(), window.addEventListener("resize", J), An(() => {
        if (s.value) {
          const P = r.theme ?? B();
          s.value.setAttribute("data-theme", P), O.value = P;
        }
      });
    }), ga(() => {
      window.removeEventListener("resize", J);
    });
    const S = () => {
      var tt;
      let P;
      if (r.taskListColumnRenderMode === "declarative")
        P = Mu(u);
      else {
        const lt = (tt = r.taskListConfig) == null ? void 0 : tt.columns;
        if (!lt || lt.length === 0) return null;
        P = lt.filter((v) => v.visible !== !1);
      }
      if (P.length === 0 || P.some((lt) => lt.width == null)) return null;
      let he = 0, Fe = 0;
      for (const lt of P) {
        const v = lt.width;
        if (typeof v == "number")
          he += v;
        else {
          const L = v.trim();
          if (L.endsWith("%"))
            Fe += parseFloat(L) / 100;
          else {
            const j = parseFloat(L);
            if (isNaN(j)) return null;
            he += j;
          }
        }
      }
      return Fe >= 1 ? null : Fe > 0 ? Math.round(he / (1 - Fe)) : he;
    }, I = () => {
      var tt;
      const P = Kl(
        (tt = r.taskListConfig) == null ? void 0 : tt.minWidth,
        E.value,
        Sm
      ), he = Math.max(P, Sm), Fe = S();
      return Fe !== null && he >= Fe ? Fe : he;
    }, N = () => {
      var tt, lt;
      const P = Kl(
        (tt = r.taskListConfig) == null ? void 0 : tt.maxWidth,
        E.value,
        Rx
      ), he = ((lt = o.value) == null ? void 0 : lt.getHeaderScrollWidth()) ?? null;
      if (he !== null && he > 0) return Math.min(P, he);
      const Fe = S();
      return Fe !== null ? Math.min(P, Fe) : P;
    }, se = () => {
      var P;
      return Kl(
        (P = r.taskListConfig) == null ? void 0 : P.defaultWidth,
        E.value,
        _x
      );
    }, Z = me(N()), C = me(I()), H = me(I()), M = me(N()), te = me(N()), ie = me(se());
    Tn("gantt-task-list-width", ie);
    const we = (P) => P < C.value ? C.value : P > te.value ? te.value : Math.max(C.value, P);
    Gt(
      () => r.taskListConfig,
      (P) => {
        P && (P.defaultWidth !== void 0 && (ie.value = se()), x());
      },
      { immediate: !1, deep: !0 }
    );
    const ve = fi(
      r.taskListColumnRenderMode === "declarative" ? Mu(u).map((P) => `${P.width ?? "?"}`).join(",") : null
    );
    Gt(
      () => r.taskListColumnRenderMode !== "declarative" ? null : u.default ?? null,
      () => {
        if (r.taskListColumnRenderMode !== "declarative") {
          ve.value = null;
          return;
        }
        const P = Mu(u);
        ve.value = P.map((he) => `${he.width ?? "?"}`).join(",");
      }
    ), Gt(ve, () => {
      ve.value !== null && x();
    });
    const le = me(null), _e = me(0), De = me(0), ze = me(null), nt = me(/* @__PURE__ */ new Set()), Qe = () => {
      ze.value = null, nt.value = /* @__PURE__ */ new Set(), De.value++;
    }, ne = /* @__PURE__ */ new Map(), gt = (P, he) => {
      ne.clear();
      const Fe = (tt) => {
        for (const lt of tt)
          lt.children && lt.children.length > 0 && (ne.set(lt.id, {
            startDate: lt.startDate || "",
            endDate: lt.endDate || ""
          }), Fe(lt.children));
      };
      P && Fe(P);
    };
    r.tasks && gt(r.tasks), Gt(
      () => r.tasks,
      (P) => {
        P && gt(P), Qe(), r.expandAll === !1 && An(() => xr());
      }
    ), Gt(
      () => r.enableParentTaskAutoSchedule,
      (P, he) => {
        if (he !== !1 && P === !1 && r.tasks) {
          const Fe = (tt) => {
            for (const lt of tt)
              if (lt.children && lt.children.length > 0) {
                const v = ne.get(lt.id);
                v && (lt.startDate = v.startDate, lt.endDate = v.endDate), Fe(lt.children);
              }
          };
          Fe(r.tasks), Qe();
        }
      }
    ), Gt(
      () => r.resources,
      () => {
        Qe();
      }
    ), Gt(
      () => {
        var P;
        return (P = r.resources) == null ? void 0 : P.map((he) => he.tasks.length);
      },
      () => {
        Qe();
      }
    );
    const je = me(Ue.DAY), ot = ce(() => {
      if (!r.scaleConfigs) return bs;
      const P = {};
      for (const he of Object.keys(bs)) {
        const Fe = r.scaleConfigs[he];
        if (!Fe)
          P[he] = bs[he];
        else {
          const tt = bs[he], lt = Fe.cellWidth ?? tt.cellWidth, v = Math.min(
            tt.maxCellWidth ?? 1 / 0,
            Math.max(tt.minCellWidth ?? 0, lt)
          );
          P[he] = {
            ...tt,
            cellWidth: v,
            ...Fe.preBuffer != null ? { preBuffer: Fe.preBuffer } : {},
            ...Fe.sufBuffer != null ? { sufBuffer: Fe.sufBuffer } : {},
            formatters: Fe.formatter ? { ...tt.formatters, ...Fe.formatter } : tt.formatters,
            headerLevels: 2
          };
        }
      }
      return P;
    }), Ie = (P) => {
      f.value !== P && (f.value = P, a("view-mode-changed", P));
    };
    Gt(
      () => r.viewMode,
      (P) => {
        P && f.value !== P && (f.value = P, a("view-mode-changed", P));
      }
    ), Gt(f, () => {
      x();
    });
    const It = ce(() => {
      var he;
      const P = (he = le.value) == null ? void 0 : he.highlightedTaskId;
      return P != null;
    });
    Gt(
      () => le.value,
      (P) => {
        P && P.updateTimeScale(je.value);
      },
      { once: !0 }
      // 只执行一次,避免不必要的重复调用
    );
    const dt = me(!1);
    Tn("isSplitBarDragging", dt);
    const Dt = me(!1);
    Tn("isTaskListToggling", Dt);
    function Ct(P) {
      if (P.target.closest(".task-list-toggle"))
        return;
      P.preventDefault(), P.stopPropagation(), dt.value = !0;
      const Fe = P.clientX, tt = ie.value, lt = document.querySelector(".task-list-body");
      if (!lt) return;
      const v = lt.getBoundingClientRect();
      Z.value = v.width, M.value = window.innerWidth * 0.8 - 6, te.value = Math.min(
        M.value,
        te.value
      ), window.dispatchEvent(new CustomEvent("splitter-drag-start")), document.body.style.userSelect = "none", document.body.style.webkitUserSelect = "none", document.body.style.cursor = "col-resize", document.body.style.pointerEvents = "none";
      const L = (Pe) => {
        Pe.type !== "mousemove" && Pe.type !== "mouseup" && (Pe.preventDefault(), Pe.stopPropagation(), Pe.stopImmediatePropagation());
      };
      document.addEventListener("mousedown", L, { capture: !0 }), document.addEventListener("click", L, { capture: !0 }), document.addEventListener("dblclick", L, { capture: !0 }), document.addEventListener("mouseover", L, { capture: !0 }), document.addEventListener("mouseout", L, { capture: !0 }), document.addEventListener("mouseenter", L, { capture: !0 }), document.addEventListener("mouseleave", L, { capture: !0 }), document.addEventListener("wheel", L, { capture: !0, passive: !1 }), document.addEventListener("contextmenu", L, { capture: !0 });
      let j = null, ae = null;
      function pe(Pe) {
        if (!dt.value) return;
        Pe.preventDefault(), Pe.stopPropagation(), Pe.stopImmediatePropagation();
        const mt = Pe.clientX - Fe, Qt = tt + mt;
        ae = we(Qt), j === null && (j = requestAnimationFrame(() => {
          ae !== null && (ie.value = ae, ae = null), j = null;
        }));
      }
      function Oe() {
        dt.value = !1, j !== null && (cancelAnimationFrame(j), j = null, ae !== null && (ie.value = ae, ae = null)), document.removeEventListener("mousedown", L, { capture: !0 }), document.removeEventListener("click", L, { capture: !0 }), document.removeEventListener("dblclick", L, { capture: !0 }), document.removeEventListener("mouseover", L, { capture: !0 }), document.removeEventListener("mouseout", L, { capture: !0 }), document.removeEventListener("mouseenter", L, { capture: !0 }), document.removeEventListener("mouseleave", L, { capture: !0 }), document.removeEventListener("wheel", L, { capture: !0 }), document.removeEventListener("contextmenu", L, { capture: !0 }), window.dispatchEvent(new CustomEvent("splitter-drag-end")), document.body.style.userSelect = "", document.body.style.webkitUserSelect = "", document.body.style.cursor = "", document.body.style.pointerEvents = "", Z.value = N(), C.value = I(), M.value = N(), te.value = N(), H.value = I(), window.removeEventListener("mousemove", pe), window.removeEventListener("mouseup", Oe);
      }
      window.addEventListener("mousemove", pe), window.addEventListener("mouseup", Oe);
    }
    const Ve = me(
      r.enableTaskListCollapsible ? r.taskListVisible ?? !0 : !1
    );
    Gt(
      () => r.taskListVisible,
      (P) => {
        r.enableTaskListCollapsible && (Ve.value = P ?? !0);
      }
    ), Gt(
      () => r.enableTaskListCollapsible,
      (P) => {
        P ? Ve.value = r.taskListVisible ?? !0 : Ve.value = !1;
      }
    );
    const ht = me(!1), K = me(""), X = () => {
      r.enableTaskListCollapsible && (ht.value || (Dt.value = !0, ht.value = !0, Ve.value ? K.value = "impact-left" : K.value = "impact-right", setTimeout(() => {
        Ve.value = !Ve.value;
      }, 200), setTimeout(() => {
        ht.value = !1, K.value = "", Dt.value = !1, An(() => {
          window.dispatchEvent(
            new CustomEvent("timeline-container-resized", {
              detail: { source: "manual-task-list-toggle" }
            })
          );
        });
      }, 400)));
    }, ke = (P) => {
      Dt.value = !0, Ve.value = P.detail, An(() => {
        Dt.value = !1, window.dispatchEvent(
          new CustomEvent("timeline-container-resized", {
            detail: { source: "task-list-toggle" }
          })
        );
      });
    };
    function Je(P) {
      const he = P.detail;
      fr(he, !0), De.value++, a("taskbar-drag-end", he);
    }
    function pt(P) {
      const he = P.detail;
      fr(he, !0), De.value++, a("taskbar-resize-end", he);
    }
    function Xe(P) {
      const he = P.detail;
      De.value++, a("milestone-drag-end", he);
    }
    let Ye = null;
    sA(() => {
      window.addEventListener("taskbar-drag-end", Je), window.addEventListener("taskbar-resize-end", pt), window.addEventListener("milestone-drag-end", Xe), An(() => {
        const P = document.querySelector(".gantt-body");
        P && (_e.value = P.clientWidth, Ye = new ResizeObserver((he) => {
          for (const Fe of he)
            _e.value = Fe.contentRect.width;
        }), Ye.observe(P));
      });
    }), ga(() => {
      window.removeEventListener("taskbar-drag-end", Je), window.removeEventListener("taskbar-resize-end", pt), window.removeEventListener("milestone-drag-end", Xe), Ye && (Ye.disconnect(), Ye = null);
    });
    const Kt = (P) => {
      const he = (Fe, tt, lt) => {
        for (const v of Fe) {
          if (v.id === tt)
            return v.collapsed = lt, !0;
          if (v.children && v.children.length > 0 && he(v.children, tt, lt))
            return !0;
        }
        return !1;
      };
      r.tasks && he(r.tasks, P.id, P.collapsed ?? !1), De.value++, a("task-collapse-change", P);
    }, it = () => {
      if (r.onExpandAll && typeof r.onExpandAll == "function")
        r.onExpandAll();
      else {
        const P = (he) => {
          he.forEach((Fe) => {
            Fe.children && Fe.children.length > 0 && (Fe.collapsed = !1, P(Fe.children));
          });
        };
        r.tasks && (P(r.tasks), De.value++);
      }
    }, qt = (P) => {
      const { draggedTask: he, targetTask: Fe, position: tt } = P;
      if (!r.tasks) return;
      const lt = bQ(r.tasks, he.id, Fe.id, tt);
      lt && (De.value++, An(() => {
        window.dispatchEvent(
          new CustomEvent("task-updated", {
            detail: lt.movedTask
          })
        );
      }), a("task-row-moved", {
        draggedTask: lt.movedTask,
        targetTask: Fe,
        position: tt,
        oldParent: lt.oldParent,
        newParent: lt.newParent
      }));
    }, hr = () => {
      if (r.onCollapseAll && typeof r.onCollapseAll == "function")
        r.onCollapseAll();
      else {
        const P = (he) => {
          he.forEach((Fe) => {
            Fe.children && Fe.children.length > 0 && (Fe.collapsed = !0, P(Fe.children));
          });
        };
        r.tasks && (P(r.tasks), De.value++);
      }
    }, Nt = () => {
      it();
    }, xr = () => {
      hr();
    }, Jt = () => {
      const P = (he) => {
        for (const Fe of he)
          if (Fe.children && Fe.children.length > 0 && (Fe.collapsed || !P(Fe.children)))
            return !1;
        return !0;
      };
      r.tasks && (P(r.tasks) ? xr() : Nt());
    }, lr = () => {
      if (!r.tasks || r.tasks.length === 0)
        return !0;
      const P = (he) => {
        for (const Fe of he)
          if (Fe.children && Fe.children.length > 0 && (Fe.collapsed || !P(Fe.children)))
            return !1;
        return !0;
      };
      return P(r.tasks);
    };
    Gt(
      () => r.expandAll,
      (P) => {
        P !== void 0 && (P ? Nt() : xr());
      },
      { immediate: !0 }
    );
    const Fr = () => {
      const P = [], he = (Fe) => {
        Fe.forEach((tt) => {
          P.push(tt), tt.children && tt.children.length > 0 && he(tt.children);
        });
      };
      r.tasks && he(r.tasks), r.milestones && P.push(...r.milestones), window.dispatchEvent(new CustomEvent("task-list-updated", { detail: P }));
    }, er = () => {
      Fr();
    };
    Gt(
      [() => r.tasks, () => r.milestones],
      () => {
        An(() => {
          er();
        });
      },
      { immediate: !0 }
    ), sA(() => {
      window.addEventListener("toggle-task-list", ke), window.addEventListener("fullscreen-toggle", ia), window.addEventListener("milestone-icon-changed", ya), window.addEventListener("milestone-deleted", Hr), window.addEventListener("milestone-data-changed", gA), window.addEventListener("request-task-list", Fr), window.addEventListener("resize", Wt), window.addEventListener("context-menu", hs), An(() => {
        le.value && typeof le.value.scrollToTodayCenter == "function" && le.value.scrollToTodayCenter();
      });
    }), ga(() => {
      dt.value = !1, window.removeEventListener("toggle-task-list", ke), window.removeEventListener("fullscreen-toggle", ia), window.removeEventListener(
        "milestone-icon-changed",
        ya
      ), window.removeEventListener("milestone-deleted", Hr), window.removeEventListener("milestone-data-changed", gA), window.removeEventListener("request-task-list", Fr), window.removeEventListener("resize", Wt), window.removeEventListener("context-menu", hs);
    });
    const Ar = (P) => {
      const he = P || "dark";
      O.value = he, s.value && s.value.setAttribute("data-theme", he);
    }, Ge = () => O.value;
    if (Gt(
      () => r.theme,
      (P) => {
        if (!s.value) return;
        const he = P ?? B();
        he !== O.value && Ar(he);
      }
    ), typeof window < "u" && window.matchMedia) {
      const P = window.matchMedia("(prefers-color-scheme: dark)"), he = (Fe) => {
        if (!r.theme) {
          const tt = Fe.matches ? "dark" : "light";
          Ar(tt);
        }
      };
      P.addEventListener("change", he), ga(() => {
        P.removeEventListener("change", he);
      });
    }
    const rt = me(!1), { t: yt, locale: Ot } = Cs(), vr = ce(() => yt.value.collapseTaskList), jt = ce(() => yt.value.expandTaskList), br = ce(() => {
      De.value >= 0;
      const P = [];
      if (r.milestones && r.milestones.length > 0) {
        const he = {
          id: -1,
          name: yt.value.milestoneGroup,
          startDate: "",
          endDate: "",
          type: "milestone-group",
          children: r.milestones,
          isParent: !0,
          collapsed: !1
        };
        P.push(he);
      }
      if (r.tasks && r.tasks.length > 0)
        if (r.autoSortByStartDate) {
          const he = (tt) => [...tt].map((lt) => {
            const v = { ...lt };
            return lt.children && lt.children.length > 0 && (v.children = he(lt.children)), v;
          }).sort((lt, v) => {
            const L = (Oe) => {
              if (Oe.children && Oe.children.length > 0) {
                const Pe = Oe.children.map((mt) => L(mt)).filter((mt) => mt.getTime() > 0);
                if (Pe.length > 0)
                  return new Date(Math.min(...Pe.map((mt) => mt.getTime())));
              }
              return Oe.startDate ? new Date(Oe.startDate) : /* @__PURE__ */ new Date("9999-12-31");
            }, j = L(lt), ae = L(v), pe = j.getTime() - ae.getTime();
            return pe !== 0 ? pe : lt.id - v.id;
          }), Fe = he(r.tasks);
          P.push(...Fe);
        } else
          P.push(...r.tasks);
      return P;
    }), on = ce(() => {
      De.value >= 0;
      const P = [];
      if (r.milestones && r.milestones.length > 0) {
        const he = {
          id: -1,
          name: yt.value.milestoneGroup,
          startDate: "",
          endDate: "",
          type: "milestone-group",
          children: r.milestones,
          isParent: !0,
          collapsed: !1
        };
        P.push(he);
      }
      if (r.tasks && r.tasks.length > 0) {
        const he = (ae) => {
          const pe = [], Oe = [];
          return ae.forEach((Pe) => {
            if (Pe.startDate && pe.push(Pe.startDate), Pe.endDate && Oe.push(Pe.endDate), Pe.children && Pe.children.length > 0) {
              const mt = he(Pe.children);
              pe.push(...mt.starts), Oe.push(...mt.ends);
            }
          }), { starts: pe, ends: Oe };
        }, Fe = (ae) => {
          if (!ae.children || ae.children.length === 0)
            return {
              startDate: ae.startDate || "",
              endDate: ae.endDate || ""
            };
          const { starts: pe, ends: Oe } = he(ae.children);
          if (pe.length === 0 || Oe.length === 0)
            return {
              startDate: ae.startDate || "",
              endDate: ae.endDate || ""
            };
          const Pe = pe.reduce((Qt, Rt) => new Date(Rt) < new Date(Qt) ? Rt : Qt), mt = Oe.reduce((Qt, Rt) => new Date(Rt) > new Date(Qt) ? Rt : Qt);
          return { startDate: Pe, endDate: mt };
        }, tt = (ae) => ae.map((pe) => {
          if (!pe.children || pe.children.length === 0)
            return pe;
          const Oe = tt(pe.children), Pe = pe.type === "story" || !0;
          if (!r.enableParentTaskAutoSchedule)
            return {
              ...pe,
              children: Oe,
              isParent: Pe
            };
          const mt = { ...pe, children: Oe }, { startDate: Qt, endDate: Rt } = Fe(mt);
          return {
            ...pe,
            children: Oe,
            isParent: Pe,
            startDate: Qt,
            endDate: Rt
          };
        }), lt = (ae, pe = 0) => {
          const Oe = [];
          return ae.forEach((Pe) => {
            const mt = {
              ...Pe,
              level: pe
            };
            if (Oe.push(mt), Pe.children && Pe.children.length > 0 && !Pe.collapsed) {
              const Qt = lt(Pe.children, pe + 1);
              Oe.push(...Qt);
            }
          }), Oe;
        }, v = br.value.filter((ae) => ae.type !== "milestone-group"), L = tt(v), j = lt(L);
        P.push(...j);
      }
      return P;
    });
    function an(P) {
      var Fe;
      const he = Math.min(60, Math.max(30, r.rowHeight ?? 51));
      return ((Fe = r.taskBarConfig) == null ? void 0 : Fe.titlePosition) !== "above" || P.type === "milestone" || P.type === "milestone-group" || r.showActualTaskbar && (P.actualStartDate || P.actualEndDate) ? he : he + yh;
    }
    const xn = ce(() => {
      const P = on.value, he = [0], Fe = /* @__PURE__ */ new Map();
      let tt = 0;
      for (const lt of P) {
        const v = an(lt);
        tt += v, he.push(tt), Fe.set(lt.id, v);
      }
      return { cumulativeHeights: he, totalHeight: tt, taskHeights: Fe };
    });
    Tn("taskRowLayouts", xn);
    const $r = ce(() => (De.value >= 0, r.milestones ? r.milestones.filter((he) => !!he.startDate).map((he) => ({
      id: he.id,
      name: he.name,
      startDate: he.startDate,
      // 此时已确保非空
      endDate: he.endDate,
      assignee: he.assignee,
      assigneeName: he.assigneeName,
      avatar: he.avatar,
      type: he.type || "milestone",
      icon: he.icon,
      description: he.description
    })) : [])), pn = ce(() => {
      De.value;
      const P = (Rt) => {
        let cr = [];
        return Rt.forEach((dr) => {
          cr.push(dr), dr.children && dr.children.length > 0 && (cr = cr.concat(P(dr.children)));
        }), cr;
      };
      let he = [];
      if ((f.value === "resource" || f.value === "resource-usage") && r.resources)
        for (const Rt of r.resources)
          Rt.tasks && Array.isArray(Rt.tasks) && (he = he.concat(P(Rt.tasks)));
      else
        he = he.concat(P(on.value));
      const Fe = he.map((Rt) => Rt.startDate).filter(Boolean).map((Rt) => new Date(Rt)), tt = he.map((Rt) => Rt.endDate).filter(Boolean).map((Rt) => new Date(Rt));
      if (Fe.length === 0 || tt.length === 0) {
        const Rt = /* @__PURE__ */ new Date(), cr = new Date(Rt.getFullYear(), Rt.getMonth() - 6, 1), dr = new Date(Rt.getFullYear(), Rt.getMonth() + 6 + 1, 0);
        return { min: cr, max: dr };
      }
      const lt = new Date(Math.min(...Fe.map((Rt) => Rt.getTime()))), v = new Date(Math.max(...tt.map((Rt) => Rt.getTime()))), L = _e.value || 1200, j = ot.value[je.value].cellWidth, ae = Math.ceil(L / j), pe = ot.value[je.value], Oe = Dn(pe.preBuffer), Pe = Dn(pe.sufBuffer), { min: mt, max: Qt } = Ca(
        lt,
        v,
        je.value,
        ae,
        j,
        Oe,
        Pe
      );
      return { min: mt, max: Qt };
    });
    function Dn(P) {
      if (P == null) return null;
      const he = Math.ceil(P);
      return he < 0 ? null : Math.max(1, he);
    }
    function Ca(P, he, Fe, tt, lt, v = null, L = null) {
      let j, ae;
      switch (Fe) {
        case Ue.HOUR: {
          const pe = v !== null ? v : 24, Oe = L !== null ? L : 24;
          j = new Date(P.getTime() - pe * 60 * 60 * 1e3), ae = new Date(he.getTime() + Oe * 60 * 60 * 1e3);
          const Pe = Math.ceil((ae.getTime() - j.getTime()) / (1e3 * 60 * 60));
          if (Pe < tt) {
            const mt = tt - Pe, Qt = Math.ceil(mt / 2);
            j = new Date(j.getTime() - Qt * 60 * 60 * 1e3), ae = new Date(ae.getTime() + Qt * 60 * 60 * 1e3);
          }
          break;
        }
        case Ue.DAY: {
          const pe = v !== null ? v : 1, Oe = L !== null ? L : 1;
          j = new Date(P.getFullYear(), P.getMonth() - pe, 1), ae = new Date(he.getFullYear(), he.getMonth() + Oe + 1, 0);
          const Pe = Math.ceil((ae.getTime() - j.getTime()) / (1e3 * 60 * 60 * 24));
          if (Pe < tt) {
            const mt = tt - Pe, Qt = Math.ceil(mt / 30), Rt = j.getMonth() - Qt, cr = j.getFullYear() + Math.floor(Rt / 12), dr = (Rt % 12 + 12) % 12;
            j = new Date(cr, dr, 1);
            const qr = ae.getMonth() + Qt + 1, _r = ae.getFullYear() + Math.floor(qr / 12), Pr = (qr % 12 + 12) % 12;
            ae = new Date(_r, Pr, 0);
          }
          break;
        }
        case Ue.WEEK: {
          const pe = (jr) => {
            const cn = new Date(jr), ta = cn.getDay() || 7;
            return cn.setDate(cn.getDate() - (ta - 1)), cn;
          }, Oe = (jr, cn) => {
            let ta = 1;
            for (; ta <= 31; ) {
              const Oa = new Date(jr, cn, ta);
              if (Oa.getMonth() !== cn) break;
              const mA = pe(Oa);
              if (mA.getMonth() === cn)
                return mA;
              ta++;
            }
            return new Date(jr, cn, 1);
          }, Pe = (jr, cn) => {
            const ta = new Date(jr, cn + 1, 0).getDate();
            for (let Oa = ta; Oa >= 1; Oa--) {
              const mA = new Date(jr, cn, Oa), rA = pe(mA);
              if (rA.getMonth() === cn)
                return rA;
            }
            return new Date(jr, cn, 1);
          }, mt = (jr, cn) => {
            const ta = [], Oa = Oe(jr, cn), mA = Pe(jr, cn), rA = new Date(Oa);
            for (; rA <= mA; )
              ta.push(new Date(rA)), rA.setDate(rA.getDate() + 7);
            return ta;
          }, Qt = pe(P), Rt = Qt.getFullYear(), cr = Qt.getMonth();
          let dr;
          if (v !== null) {
            const jr = new Date(Qt);
            jr.setDate(jr.getDate() - v * 7), dr = [jr];
          } else {
            const jr = cr === 0 ? 11 : cr - 1, cn = cr === 0 ? Rt - 1 : Rt;
            dr = mt(cn, jr);
          }
          const qr = pe(he), _r = qr.getFullYear(), Pr = qr.getMonth();
          let un;
          if (L !== null) {
            const jr = new Date(qr);
            jr.setDate(jr.getDate() + L * 7), un = [jr];
          } else {
            const jr = Pr === 11 ? 0 : Pr + 1, cn = Pr === 11 ? _r + 1 : _r;
            un = mt(cn, jr);
          }
          let wr = [];
          wr.push(...dr);
          let Wr = Rt, mn = cr;
          for (; Wr < _r || Wr === _r && mn <= Pr; ) {
            const jr = mt(Wr, mn);
            wr.push(...jr), mn++, mn > 11 && (mn = 0, Wr++);
          }
          wr.push(...un);
          const eA = 60;
          let tA = wr.length * eA;
          for (; tA < tt * lt; ) {
            const jr = wr[0], cn = jr.getFullYear(), ta = jr.getMonth(), Oa = ta === 0 ? 11 : ta - 1, mA = ta === 0 ? cn - 1 : cn;
            if (wr = [...mt(mA, Oa), ...wr], tA = wr.length * eA, tA >= tt * lt) break;
            const Sa = wr[wr.length - 1], Pa = Sa.getFullYear(), lA = Sa.getMonth(), Wi = lA === 11 ? 0 : lA + 1, gs = lA === 11 ? Pa + 1 : Pa, Fa = mt(gs, Wi);
            wr = [...wr, ...Fa], tA = wr.length * eA;
          }
          j = new Date(wr[0]), ae = new Date(wr[wr.length - 1]), ae.setDate(ae.getDate() + 6);
          break;
        }
        case Ue.MONTH: {
          const pe = v !== null ? v : 12, Oe = L !== null ? L : 12;
          j = new Date(P.getFullYear(), P.getMonth() - pe, 1), ae = new Date(he.getFullYear(), he.getMonth() + Oe + 1, 0);
          const Pe = (ae.getFullYear() - j.getFullYear()) * 12 + (ae.getMonth() - j.getMonth());
          if (Pe < tt) {
            const mt = tt - Pe, Qt = Math.ceil(mt / 2);
            j = new Date(j.getFullYear(), j.getMonth() - Qt, 1), ae = new Date(ae.getFullYear(), ae.getMonth() + Qt + 1, 0);
          }
          break;
        }
        case Ue.QUARTER: {
          if (v !== null || L !== null) {
            const Oe = v !== null ? v : 0, Pe = L !== null ? L : 0, mt = Oe * 3, Qt = Pe * 3, Rt = P.getMonth() - mt, cr = P.getFullYear() + Math.floor(Rt / 12), dr = (Rt % 12 + 12) % 12, qr = Math.floor(dr / 3) * 3;
            j = new Date(cr, qr, 1);
            const _r = he.getMonth() + Qt, Pr = he.getFullYear() + Math.floor(_r / 12), un = (_r % 12 + 12) % 12, wr = Math.floor(un / 3) * 3 + 2;
            ae = new Date(Pr, wr + 1, 0);
          } else {
            const Pe = (/* @__PURE__ */ new Date()).getFullYear(), mt = P.getFullYear(), Qt = he.getFullYear();
            j = new Date(Math.min(Pe - 2, mt - 2), 0, 1), ae = new Date(Math.max(Pe + 2, Qt + 2), 11, 31);
          }
          const pe = (ae.getFullYear() - j.getFullYear() + 1) * 4;
          if (pe < tt) {
            const Oe = tt - pe, Pe = Math.ceil(Oe / 4), mt = Math.ceil(Pe / 2);
            j = new Date(j.getFullYear() - mt, 0, 1), ae = new Date(ae.getFullYear() + mt, 11, 31);
          }
          break;
        }
        case Ue.YEAR: {
          if (v !== null || L !== null) {
            const Oe = v !== null ? v : 0, Pe = L !== null ? L : 0;
            j = new Date(P.getFullYear() - Oe, 0, 1), ae = new Date(he.getFullYear() + Pe, 11, 31);
          } else {
            const Pe = (/* @__PURE__ */ new Date()).getFullYear(), mt = P.getFullYear(), Qt = he.getFullYear();
            j = new Date(Math.min(Pe - 2, mt - 2), 0, 1), ae = new Date(Math.max(Pe + 2, Qt + 2), 11, 31);
          }
          const pe = (ae.getFullYear() - j.getFullYear() + 1) * 2;
          if (pe < tt) {
            const Oe = tt - pe, Pe = Math.ceil(Oe / 2), mt = Math.ceil(Pe / 2);
            j = new Date(j.getFullYear() - mt, 0, 1), ae = new Date(ae.getFullYear() + mt, 11, 31);
          }
          break;
        }
        default:
          j = P, ae = he;
      }
      return { min: j, max: ae };
    }
    const ka = () => {
      if (r.onExportCsv && typeof r.onExportCsv == "function") {
        r.onExportCsv() === !1 && sa();
        return;
      }
      sa();
    }, Yn = (P) => {
      je.value = P, le.value && le.value.updateTimeScale(P);
    }, zr = ce(() => je.value === Ue.WEEK ? "week" : je.value === Ue.MONTH ? "month" : "day"), Un = ce(() => je.value === Ue.WEEK ? "week" : je.value === Ue.MONTH ? "month" : "day"), pa = ce(() => ({
      start: pn.value.min,
      end: pn.value.max
    })), ma = (P) => {
      An(() => {
        const he = new CustomEvent("timeline-scale-updated", { detail: P });
        window.dispatchEvent(he);
      });
    }, En = (P) => {
      var Fe;
      Ar(P ? "dark" : "light"), (Fe = r.onThemeChange) == null || Fe.call(r, P);
    }, Vn = ["hour", "day", "week", "month", "quarter", "year"], Xa = (P) => {
      const he = P || "week";
      Vn.includes(he) && Yn(he);
    }, oA = () => {
      const P = Vn.indexOf(je.value);
      if (P > 0) {
        const he = Vn[P - 1];
        Yn(he);
      }
    }, Ta = () => {
      const P = Vn.indexOf(je.value);
      if (P < Vn.length - 1) {
        const he = Vn[P + 1];
        Yn(he);
      }
    }, ts = () => je.value;
    Gt(
      () => r.timeScale,
      (P) => {
        P && P !== je.value && Yn(P);
      },
      { immediate: !0 }
    );
    const Hs = () => {
      var P;
      (P = le.value) != null && P.clearHighlight && le.value.clearHighlight();
    }, sa = () => {
      try {
        const P = [];
        r.tasks && r.tasks.length > 0 && P.push(...r.tasks), r.milestones && r.milestones.length > 0 && P.push(...r.milestones);
        const tt = "\uFEFF" + rs(P), lt = new Blob([tt], {
          type: "text/csv;charset=utf-8;"
        }), v = document.createElement("a"), L = URL.createObjectURL(lt), ae = `gantt-tasks-${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.csv`;
        v.setAttribute("href", L), v.setAttribute("download", ae), v.style.visibility = "hidden", document.body.appendChild(v), v.click(), document.body.removeChild(v), URL.revokeObjectURL(L);
      } catch (P) {
        console.error("CSV导出失败:", P), l("CSV导出失败", "error", { closable: !1 });
      }
    }, rs = (P) => {
      const he = yt.value.csvHeaders, Fe = [
        he.id,
        he.taskName,
        he.predecessor,
        he.assignee,
        he.startDate,
        he.endDate,
        he.estimatedHours,
        he.actualHours,
        he.progress,
        he.type,
        he.description
      ], tt = (j) => {
        if (j == null)
          return "";
        const ae = String(j);
        return ae.includes(",") || ae.includes('"') || ae.includes(`
`) || ae.includes("\r") ? `"${ae.replace(/"/g, '""')}"` : ae;
      }, lt = (j) => {
        const ae = [];
        return j.forEach((pe) => {
          ae.push({
            id: pe.id,
            name: pe.name || "",
            predecessor: lp(pe.predecessor),
            assignee: pe.assignee || "",
            startDate: pe.startDate || "",
            endDate: pe.endDate || "",
            estimatedHours: pe.estimatedHours || "",
            actualHours: pe.actualHours || "",
            progress: pe.progress !== void 0 ? `${pe.progress}%` : "",
            type: pe.type || "",
            description: pe.description || ""
          }), pe.children && pe.children.length > 0 && ae.push(...lt(pe.children));
        }), ae;
      }, v = lt(P);
      return [
        // 头部行 - 也需要进行转义处理
        Fe.map((j) => tt(j)).join(","),
        // 数据行
        ...v.map((j) => [
          tt(j.id),
          tt(j.name),
          tt(lp(j.predecessor)),
          tt(j.assignee),
          tt(j.startDate),
          tt(j.endDate),
          tt(j.estimatedHours),
          tt(j.actualHours),
          tt(j.progress),
          tt(j.type),
          tt(j.description)
        ].join(","))
      ].join(`
`);
    }, Jn = async () => {
      try {
        const P = yt.value.pdfExportLoading, he = yt.value.pdfExportTitle, Fe = yt.value.pdfExportDate, tt = document.createElement("div");
        tt.style.cssText = `
      position: fixed; top: 0; left: 0; width: 100%; height: 100%;
      background: rgba(0,0,0,0.5); display: flex; align-items: center;
      justify-content: center; z-index: 10000; color: white; font-size: 16px;
    `, tt.textContent = P, document.body.appendChild(tt);
        const lt = document.querySelector(".gantt-body");
        if (!lt)
          throw new Error("找不到甘特图元素");
        const v = {
          overflow: lt.style.overflow,
          height: lt.style.height
        };
        lt.style.overflow = "visible", lt.style.height = "auto";
        const L = (/* @__PURE__ */ new Date()).toLocaleDateString(Ot.value), j = document.createElement("div");
        j.style.cssText = [
          "position: fixed",
          "left: -9999px",
          "top: 0",
          `width: ${Math.max(lt.scrollWidth, 800)}px`,
          "background: #ffffff",
          "padding: 10px 16px",
          "display: flex",
          "justify-content: space-between",
          "align-items: center",
          "font-family: sans-serif",
          "box-sizing: border-box"
        ].join("; ");
        const ae = document.createElement("span");
        ae.style.cssText = "font-size: 20px; font-weight: bold; flex: 1; text-align: center;", ae.textContent = he;
        const pe = document.createElement("span");
        pe.style.cssText = "font-size: 12px; white-space: nowrap;", pe.textContent = `${Fe}: ${L}`, j.appendChild(ae), j.appendChild(pe), document.body.appendChild(j);
        const [Oe, Pe] = await Promise.all([
          Gp(j, {
            allowTaint: !0,
            useCORS: !0,
            scale: 2,
            backgroundColor: "#ffffff"
          }),
          Gp(lt, {
            allowTaint: !0,
            useCORS: !0,
            scale: 2,
            width: lt.scrollWidth,
            height: lt.scrollHeight,
            backgroundColor: "#ffffff"
          })
        ]);
        document.body.removeChild(j), lt.style.overflow = v.overflow, lt.style.height = v.height;
        const mt = Oe.toDataURL("image/png"), Qt = Pe.toDataURL("image/png"), Rt = new kr({
          orientation: "landscape",
          unit: "mm",
          format: "a4"
        }), cr = Rt.internal.pageSize.getWidth(), dr = Rt.internal.pageSize.getHeight(), qr = Oe.height / Oe.width * cr;
        Rt.addImage(mt, "PNG", 0, 0, cr, qr);
        const _r = qr + 2, Pr = dr - _r, un = Pe.height / Pe.width, wr = Math.min(cr, Pr / un), Wr = wr * un, mn = (cr - wr) / 2;
        if (Rt.addImage(Qt, "PNG", mn, _r, wr, Wr), Wr > Pr) {
          const tA = Math.ceil(Wr / Pr);
          for (let jr = 1; jr < tA; jr++) {
            Rt.addPage();
            const cn = -jr * Pr;
            Rt.addImage(Qt, "PNG", mn, _r + cn, wr, Wr);
          }
        }
        const eA = `gantt-chart-${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.pdf`;
        Rt.save(eA), tt && tt.parentNode && tt.parentNode.removeChild(tt);
      } catch (P) {
        const he = document.querySelector('[style*="position: fixed"]');
        he && he.parentNode && he.parentNode.removeChild(he), console.error("PDF导出失败:", P), alert("PDF导出失败");
      }
    }, ia = (P) => {
      rt.value = P.detail, r.onFullscreenChange && typeof r.onFullscreenChange == "function" && r.onFullscreenChange(rt.value), setTimeout(() => {
        window.dispatchEvent(
          new CustomEvent("timeline-container-resized", {
            detail: { source: "fullscreen-toggle" }
          })
        );
      }, 500);
    }, xa = () => {
      rt.value || (rt.value = !0, r.onFullscreenChange && typeof r.onFullscreenChange == "function" && r.onFullscreenChange(!0), setTimeout(() => {
        window.dispatchEvent(
          new CustomEvent("timeline-container-resized", {
            detail: { source: "fullscreen-toggle" }
          })
        );
      }, 500));
    }, Bn = () => {
      rt.value && (rt.value = !1, r.onFullscreenChange && typeof r.onFullscreenChange == "function" && r.onFullscreenChange(!1), setTimeout(() => {
        window.dispatchEvent(
          new CustomEvent("timeline-container-resized", {
            detail: { source: "fullscreen-toggle" }
          })
        );
      }, 500));
    }, Zn = () => {
      rt.value ? Bn() : xa();
    }, Xr = () => rt.value;
    Gt(
      () => r.fullscreen,
      (P) => {
        P !== void 0 && P !== rt.value && (P ? xa() : Bn());
      },
      { immediate: !0 }
    );
    const wa = (P, he) => {
      const Fe = P.findIndex((tt) => tt.id === he.id);
      return Fe !== -1 ? (P.splice(Fe, 1, { ...P[Fe], ...he }), !0) : (P.push(he), !0);
    }, Da = (P) => {
      P.id || (P.id = Date.now()), P.type = "milestone", r.milestones && wa(r.milestones, P), a("milestone-saved", P), De.value++, ln.value && Ur();
    }, bn = (P, he, Fe) => {
      const tt = P.findIndex((lt) => lt.id === he);
      return tt !== -1 ? (P.splice(tt, 1, { ...P[tt], icon: Fe }), !0) : !1;
    }, ya = (P) => {
      const { milestoneId: he, icon: Fe } = P.detail;
      r.milestones && bn(r.milestones, he, Fe), a("milestone-icon-changed", { milestoneId: he, icon: Fe }), De.value++;
    }, Ea = (P, he) => {
      const Fe = P.findIndex((tt) => tt.id === he);
      return Fe !== -1 ? (P.splice(Fe, 1), !0) : !1;
    }, Hr = () => {
      De.value++;
    }, gA = () => {
      De.value++, An(() => {
      });
    };
    sA(() => {
      An(() => {
        le.value && typeof le.value.scrollToTodayCenter == "function" && le.value.scrollToTodayCenter();
      });
    });
    const vA = () => {
      if (r.onTodayLocate && typeof r.onTodayLocate == "function") {
        r.onTodayLocate();
        return;
      }
      if (le.value && typeof le.value.scrollToTodayCenter == "function") {
        le.value.scrollToTodayCenter();
        return;
      }
      oa();
    }, pA = () => {
      a("add-milestone"), r.useDefaultMilestoneDialog && DA();
    }, DA = () => {
      Hn.value = null, ln.value = !0;
    }, oa = () => {
      if (le.value && typeof le.value.scrollToToday == "function") {
        le.value.scrollToToday();
        return;
      }
      const P = /* @__PURE__ */ new Date(), he = P.getMonth(), Fe = P.getDate();
      let tt = 0;
      for (let ae = 0; ae < he; ae++)
        tt += new Date(P.getFullYear(), ae + 1, 0).getDate();
      tt += Fe;
      const lt = document.querySelector(".gantt-panel-right"), v = lt == null ? void 0 : lt.clientWidth, L = v ? v / 2 : 200, j = (tt - 1) * 30 - L;
      lt && (lt.scrollLeft = Math.max(0, j));
    }, Ja = () => {
      le.value && typeof le.value.scrollToTodayCenter == "function" ? le.value.scrollToTodayCenter() : oa();
    }, Za = (P) => {
      const he = (Fe, tt) => {
        for (const lt of Fe) {
          if (lt.id === tt || String(lt.id) === String(tt))
            return lt;
          if (lt.children && lt.children.length > 0) {
            const v = he(lt.children, tt);
            if (v) return v;
          }
        }
        return null;
      };
      if (r.tasks) {
        const Fe = he(r.tasks, P);
        Fe && Fe.startDate && le.value && typeof le.value.scrollToDate == "function" && le.value.scrollToDate(Fe.startDate);
      }
    }, ea = (P) => {
      le.value && typeof le.value.scrollToDate == "function" && le.value.scrollToDate(P);
    }, fs = (P) => {
      a("resource-usage-task-detail-click", P), Ie("task"), An(() => {
        Za(P.taskId);
      });
    }, OA = () => Ot.value, Ha = (P) => {
      const { setLocale: he } = Cs();
      he(P);
    };
    Gt(
      () => r.locale,
      (P) => {
        if (P && P !== Ot.value) {
          const { setLocale: he } = Cs();
          he(P);
        }
      },
      { immediate: !0 }
    );
    const Wt = () => {
      const P = we(ie.value);
      P !== ie.value && (ie.value = P);
    };
    r.localeMessages && Object.keys(r.localeMessages).forEach((P) => {
      const he = r.localeMessages[P];
      he && Cm(P, he);
    }), Gt(
      () => r.localeMessages,
      (P) => {
        P && Object.keys(P).forEach((he) => {
          const Fe = P[he];
          Fe && Cm(he, Fe);
        });
      },
      { deep: !0 }
    );
    const fe = me({ x: 0, y: 0 }), et = me(!1), ft = me(null), Yt = me(!1), zt = me(null), gr = me(!1), rn = me(null);
    Gt(Yt, (P) => {
      var he;
      P || (he = rn.value) == null || he.clearSelection();
    });
    const Gn = ce(() => {
      const P = [...r.tasks || []];
      if (r.milestones && r.milestones.length > 0 && P.push(...r.milestones), r.resources && r.resources.length > 0) {
        const he = new Set(P.map((Fe) => Fe.id));
        for (const Fe of r.resources)
          if (!(!Fe.tasks || !Array.isArray(Fe.tasks)))
            for (const tt of Fe.tasks)
              he.has(tt.id) || (he.add(tt.id), P.push(tt));
      }
      return P;
    }), ln = me(!1), Hn = me(null), Ln = me(null), On = me(null), hs = (P) => {
      const { task: he, position: Fe } = P.detail;
      ft.value = he, fe.value = Fe, et.value = !0;
    }, Dr = () => {
      et.value = !1;
    };
    function Pi() {
      if (a("add-task"), r.useDefaultDrawer) {
        const P = {
          id: Date.now(),
          // 临时id,实际保存时应由后端分配
          name: "",
          type: "task",
          assignee: "",
          startDate: "",
          endDate: "",
          predecessor: [],
          estimatedHours: 0,
          actualHours: 0,
          progress: 0,
          description: "",
          parentId: void 0,
          children: [],
          resources: []
        };
        zt.value = P, gr.value = !1, Yt.value = !0;
      }
    }
    function Xs(P) {
      if (a("calendar-selection-complete", P), r.useDefaultDrawer) {
        const he = (lt) => {
          const v = lt.getFullYear(), L = String(lt.getMonth() + 1).padStart(2, "0"), j = String(lt.getDate()).padStart(2, "0"), ae = String(lt.getHours()).padStart(2, "0"), pe = String(lt.getMinutes()).padStart(2, "0");
          return `${v}-${L}-${j} ${ae}:${pe}`;
        }, Fe = P.resourceId ? (r.resources ?? []).find((lt) => String(lt.id) === String(P.resourceId)) : void 0, tt = {
          id: Date.now(),
          name: "",
          type: "task",
          assignee: "",
          startDate: he(P.startDate),
          endDate: he(P.endDate),
          predecessor: [],
          estimatedHours: 0,
          actualHours: 0,
          progress: 0,
          description: "",
          parentId: void 0,
          children: [],
          // v1.12.5 日历视图选中资源时,绑定对应资源并将占用比例默认设为100%
          resources: Fe ? [{ id: Fe.id, name: Fe.name, capacity: 100, tasks: [] }] : []
        };
        zt.value = tt, gr.value = !1, Yt.value = !0;
      }
    }
    function bi(P, he) {
      a("calendar-task-click", P, he), r.useDefaultDrawer && $e(P) && typeof P.id == "number" && (zt.value = P, gr.value = !0, Yt.value = !0);
    }
    function Os(P) {
      fr(P.task, !0), De.value++, a("calendar-task-move", P);
    }
    const ye = (P) => {
      ar(P.id, (he) => {
        he.isTimerRunning = !0, he.timerStartTime = P.timerStartTime || Date.now(), he.timerEndTime = void 0, he.timerElapsedTime = 0;
      }), Dr(), a("timer-started", P);
    }, Re = (P) => {
      ar(P.id, (he) => {
        if (he.isTimerRunning && he.timerStartTime !== void 0) {
          const Fe = he.timerElapsedTime || 0;
          he.timerElapsedTime = Fe + (Date.now() - he.timerStartTime), he.timerEndTime = Date.now();
        }
        he.isTimerRunning = !1, Yt.value && zt.value && zt.value.id === P.id && (zt.value.isTimerRunning = !1, zt.value.timerEndTime = Date.now());
      }), Dr(), a("timer-stopped", P);
    };
    function at(P, he) {
      a("task-click", P, he);
    }
    function $e(P) {
      return P && typeof P == "object" && !("tasks" in P && Array.isArray(P.tasks) && !("resources" in P));
    }
    function Tt(P) {
      a("task-double-click", P), r.useDefaultDrawer && $e(P) && typeof P.id == "number" && (zt.value = P, gr.value = !0, Yt.value = !0);
    }
    function Lt(P) {
      if (!P) return;
      a("add-predecessor", P), Ln.value = P;
      const he = {
        id: Date.now(),
        // 临时id,实际保存时应由后端分配
        name: "",
        type: "task",
        assignee: "",
        startDate: "",
        endDate: "",
        predecessor: [],
        estimatedHours: 0,
        actualHours: 0,
        progress: 0,
        description: "",
        parentId: P.parentId,
        children: [],
        resources: [],
        isTimerRunning: !1,
        timerStartTime: void 0,
        timerEndTime: void 0,
        timerElapsedTime: 0
      };
      zt.value = he, gr.value = !1, Yt.value = !0;
    }
    function ut(P) {
      if (!P) return;
      a("add-successor", P), On.value = P;
      const he = {
        id: Date.now(),
        // 临时id,实际保存时应由后端分配
        name: "",
        type: "task",
        assignee: "",
        startDate: "",
        endDate: "",
        predecessor: [P.id],
        estimatedHours: 0,
        actualHours: 0,
        progress: 0,
        description: "",
        parentId: P.parentId,
        children: [],
        resources: [],
        isTimerRunning: !1,
        timerStartTime: void 0,
        timerEndTime: void 0,
        timerElapsedTime: 0
      };
      zt.value = he, gr.value = !1, Yt.value = !0;
    }
    function ct(P) {
      a("predecessor-added", P);
    }
    function Ut(P) {
      a("successor-added", P);
    }
    const _t = (P, he) => {
      if (!he.parentId)
        return P.push(he), !0;
      for (const Fe of P) {
        if (Fe.id === he.parentId)
          return Fe.children || (Fe.children = []), Fe.children.push(he), !0;
        if (Fe.children && Fe.children.length > 0 && _t(Fe.children, he))
          return !0;
      }
      return !1;
    }, Zt = (P, he) => {
      for (let Fe = 0; Fe < P.length; Fe++) {
        if (P[Fe].id === he.id)
          return P[Fe] = { ...P[Fe], ...he }, !0;
        if (P[Fe].children && P[Fe].children.length > 0 && Zt(P[Fe].children, he))
          return !0;
      }
      return !1;
    }, fr = (P, he = !1) => {
      ze.value = P.id;
      const Fe = /* @__PURE__ */ new Set();
      if (r.tasks && Zt(r.tasks, P), (f.value === "resource" || f.value === "calendar" || f.value === "resource-usage") && r.resources && r.resources) {
        let lt = null, v = null, L = -1;
        for (const j of r.resources) {
          const ae = j.tasks.findIndex((pe) => pe.id === P.id);
          if (ae !== -1) {
            lt = j.id, v = j, L = ae, Fe.add(j.id);
            break;
          }
        }
        if (v && L !== -1)
          if (!he && P.assignee && P.assignee !== lt) {
            v.tasks.splice(L, 1);
            const j = r.resources.find((ae) => ae.id === P.assignee);
            j && (j.tasks.push({ ...P }), Fe.add(j.id));
          } else
            v.tasks[L] = { ...v.tasks[L], ...P };
        else if (P.assignee) {
          const j = r.resources.find((ae) => ae.id === P.assignee);
          j && (j.tasks.push({ ...P }), Fe.add(j.id));
        }
      }
      nt.value = Fe;
    }, or = (P) => {
      if (!(!(f.value === "resource" || f.value === "calendar" || f.value === "resource-usage") || !r.resources)) {
        if (P.resources && P.resources.length > 0)
          P.resources.forEach((Fe) => {
            const tt = r.resources.find((lt) => lt.id === Fe.id);
            tt && (tt.tasks.find((v) => v.id === P.id) || tt.tasks.push({ ...P }));
          });
        else if (P.assignee) {
          const Fe = Array.isArray(P.assignee) ? P.assignee[0] : P.assignee, tt = r.resources.find((lt) => lt.id === Fe);
          tt && (tt.tasks.find((v) => v.id === P.id) || tt.tasks.push({ ...P }));
        }
      }
    }, ar = (P, he) => {
      const Fe = (lt) => {
        var v;
        for (let L = 0; L < lt.length; L++) {
          if (lt[L].id === P)
            return he(lt[L]), !0;
          if ((v = lt[L].children) != null && v.length && Fe(lt[L].children))
            return !0;
        }
        return !1;
      };
      let tt = !1;
      return r.tasks && (tt = Fe(r.tasks)), tt && f.value === "resource" && r.resources && r.resources.forEach((lt) => {
        const v = lt.tasks.find((L) => L.id === P);
        v && he(v);
      }), tt;
    };
    function Or(P) {
      gr.value ? (fr(P), De.value++, a("task-updated", { task: P })) : (r.tasks && _t(r.tasks, P), or(P), De.value++, a("task-added", { task: P }), Ln.value && (Ln.value.predecessor || (Ln.value.predecessor = []), Ln.value.predecessor.push(P.id), a("predecessor-added", { targetTask: Ln.value, newTask: P }), Ln.value = null), On.value && (a("successor-added", { targetTask: On.value, newTask: P }), On.value = null));
    }
    function Kr(P, he, Fe) {
      for (let tt = 0; tt < P.length; tt++) {
        if (P[tt].id === he) {
          if (Fe)
            P.splice(tt, 1);
          else {
            const lt = P[tt].children || [];
            P.splice(tt, 1, ...lt);
          }
          return !0;
        }
        if (P[tt].children && P[tt].children.length > 0 && Kr(P[tt].children, he, Fe))
          return !0;
      }
      return !1;
    }
    function sr(P, he) {
      r.tasks && Kr(r.tasks, P.id, he), f.value === "resource" && r.resources && r.resources.forEach((Fe) => {
        const tt = Fe.tasks.findIndex((lt) => lt.id === P.id);
        tt !== -1 && Fe.tasks.splice(tt, 1);
      }), Yt.value = !1, zt.value = null, a("task-deleted", { task: P });
    }
    function Er(P) {
      if (r.tasks) {
        const he = (Fe) => {
          for (let tt = 0; tt < Fe.length; tt++) {
            if (Fe[tt].id === P.targetTaskId)
              return Fe[tt] = { ...Fe[tt], predecessor: P.updatedTask.predecessor }, !0;
            if (Fe[tt].children && Fe[tt].children.length > 0 && he(Fe[tt].children))
              return !0;
          }
          return !1;
        };
        he(r.tasks);
      }
      a("task-updated", { task: P.updatedTask }), a("link-deleted", P);
    }
    function nn(P) {
      a("resource-drag-end", P);
    }
    function Pn(P) {
      a("milestone-double-click", P), r.useDefaultMilestoneDialog && (Hn.value = P, ln.value = !0);
    }
    function Ur() {
      ln.value = !1, Hn.value = null;
    }
    function Qr(P) {
      r.milestones && Ea(r.milestones, P), a("milestone-deleted", { milestoneId: P }), De.value++, Ur();
    }
    return t({
      // 全屏相关
      enterFullscreen: xa,
      exitFullscreen: Bn,
      toggleFullscreen: Zn,
      isFullscreen: Xr,
      // 展开/收起相关
      expandAll: Nt,
      collapseAll: xr,
      toggleExpandAll: Jt,
      isExpandAll: lr,
      // 今日定位相关
      scrollToToday: Ja,
      scrollToTask: Za,
      scrollToDate: ea,
      // 语言切换相关
      setLocale: Ha,
      currentLocale: OA,
      // 时间维度相关
      setTimeScale: Xa,
      zoomIn: oA,
      zoomOut: Ta,
      currentScale: ts,
      // 主题相关
      setTheme: Ar,
      currentTheme: Ge,
      // TaskList 显隐相关
      /** 获取 TaskList 当前可见状态 */
      getTaskListVisible: () => Ve.value,
      /**
       * 设置 TaskList 可见状态(仅在 enableTaskListCollapsible=true 时生效)
       * @param visible true=展开,false=收起
       */
      setTaskListVisible: (P) => {
        r.enableTaskListCollapsible && (Ve.value = P);
      },
      /** 切换 TaskList 展开/收起(仅在 enableTaskListCollapsible=true 时生效,带动画) */
      toggleTaskList: X,
      // R2: 连线配置 API
      /**
       * 动态设置连线样式配置(与 props.linkConfig 合并,运行时调用优先级更高)
       * @example ganttRef.value.setLinkConfig({ type: 'orthogonal', color: '#ff0000' })
       */
      setLinkConfig: (P) => {
        A.value = { ...A.value, ...P };
      },
      /**
       * 获取当前生效的完整连线配置(合并 DEFAULT + props + setLinkConfig)
       */
      getLinkConfig: () => ({ ...cp, ...A.value })
    }), (P, he) => ($(), ee("div", {
      ref_key: "ganttRootRef",
      ref: s,
      class: tr(["gantt-root", { "gantt-fullscreen": rt.value, "splitter-dragging": dt.value }])
    }, [
      r.showToolbar ? ($(), Ir(jF, {
        key: 0,
        config: r.toolbarConfig,
        "time-scale": je.value,
        theme: O.value,
        fullscreen: rt.value,
        "expand-all": lr(),
        "view-mode": f.value,
        "available-view-modes": r.availableViewModes,
        "on-today-locate": vA,
        "on-export-csv": ka,
        "on-export-pdf": Jn,
        "on-language-change": r.onLanguageChange,
        "on-fullscreen-change": r.onFullscreenChange,
        "on-settings-confirm": r.onSettingsConfirm,
        "on-time-scale-change": Yn,
        "on-expand-all": it,
        "on-collapse-all": hr,
        "on-view-mode-change": Ie,
        onAddTask: Pi,
        onAddMilestone: pA,
        onExpandAll: it,
        onCollapseAll: hr,
        onThemeChange: En
      }, null, 8, ["config", "time-scale", "theme", "fullscreen", "expand-all", "view-mode", "available-view-modes", "on-language-change", "on-fullscreen-change", "on-settings-confirm"])) : vt("", !0),
      _("div", V8, [
        f.value === "calendar" ? ($(), Ir(zI, XA({
          key: 0,
          ref_key: "calendarViewRef",
          ref: rn,
          class: "gantt-panel-full-view",
          tasks: Gn.value,
          resources: r.resources,
          "working-hours": r.workingHours,
          scale: zr.value
        }, r.calendarProps, {
          onSelectionComplete: Xs,
          onSelectionCancel: he[0] || (he[0] = (Fe) => a("calendar-selection-cancel", Fe)),
          onResourceChange: he[1] || (he[1] = (Fe) => a("calendar-resource-change", Fe)),
          onViewChange: he[2] || (he[2] = (Fe) => a("calendar-view-change", Fe)),
          onDateChange: he[3] || (he[3] = (Fe) => a("calendar-date-change", Fe)),
          onTaskClick: bi,
          onTaskMove: Os
        }), null, 16, ["tasks", "resources", "working-hours", "scale"])) : f.value === "resource-usage" ? ($(), Ir(BQ, XA({
          key: 1,
          class: "gantt-panel-full-view",
          resources: r.resources,
          "resource-list-config": r.resourceListConfig,
          "column-render-mode": r.taskListColumnRenderMode,
          scale: Un.value,
          "date-range": pa.value,
          "scale-configs": ot.value
        }, r.resourceUsageProps, {
          onScaleChange: he[4] || (he[4] = (Fe) => a("resource-usage-scale-change", Fe)),
          onCellClick: he[5] || (he[5] = (Fe) => a("resource-usage-cell-click", Fe)),
          onCellHover: he[6] || (he[6] = (Fe) => a("resource-usage-cell-hover", Fe)),
          onOverloadDetected: he[7] || (he[7] = (Fe) => a("resource-usage-overload-detected", Fe)),
          onTaskDetailClick: fs
        }), hi({ _: 2 }, [
          P.$slots.default ? {
            name: "default",
            fn: qa(() => [
              Nn(P.$slots, "default", {}, void 0, !0)
            ]),
            key: "0"
          } : void 0
        ]), 1040, ["resources", "resource-list-config", "column-render-mode", "scale", "date-range", "scale-configs"])) : ($(), ee(St, { key: 2 }, [
          Ve.value ? ($(), ee("div", {
            key: 0,
            class: "gantt-panel gantt-panel-left",
            style: Mt({ width: ie.value + "px" })
          }, [
            na(f5, {
              ref_key: "taskListComponentRef",
              ref: o,
              tasks: br.value,
              "use-default-drawer": r.useDefaultDrawer,
              "task-list-config": r.taskListConfig,
              "task-list-column-render-mode": r.taskListColumnRenderMode,
              "enable-task-row-move": r.enableTaskRowMove,
              "task-list-row-class-name": r.taskListRowClassName,
              "task-list-row-style": r.taskListRowStyle,
              "enable-parent-task-auto-schedule": r.enableParentTaskAutoSchedule,
              onTaskCollapseChange: Kt,
              onStartTimer: ye,
              onStopTimer: Re,
              onAddPredecessor: Lt,
              onAddSuccessor: ut,
              onDelete: sr,
              onTaskRowMoved: qt
            }, hi({ _: 2 }, [
              P.$slots.default ? {
                name: "default",
                fn: qa(() => [
                  Nn(P.$slots, "default", {}, void 0, !0)
                ]),
                key: "0"
              } : void 0,
              P.$slots["custom-task-content"] ? {
                name: "custom-task-content",
                fn: qa((Fe) => [
                  Nn(P.$slots, "custom-task-content", qs(So(Fe)), void 0, !0)
                ]),
                key: "1"
              } : void 0
            ]), 1032, ["tasks", "use-default-drawer", "task-list-config", "task-list-column-render-mode", "enable-task-row-move", "task-list-row-class-name", "task-list-row-style", "enable-parent-task-auto-schedule"])
          ], 4)) : vt("", !0),
          r.enableTaskListCollapsible ? ($(), ee("div", {
            key: 1,
            class: "gantt-splitter",
            onMousedown: Ct
          }, [
            _("div", {
              class: tr(["task-list-toggle", {
                collapsed: !Ve.value,
                [K.value]: ht.value
              }]),
              title: Ve.value ? vr.value : jt.value,
              onClick: dn(X, ["stop"])
            }, [
              ($(), ee("svg", j8, [
                Ve.value ? ($(), ee("polyline", Y8)) : ($(), ee("polyline", G8))
              ]))
            ], 10, q8)
          ], 32)) : vt("", !0),
          _("div", {
            class: tr(["gantt-panel gantt-panel-right", { "full-width": !Ve.value }])
          }, [
            na(rF, {
              ref_key: "timelineRef",
              ref: le,
              tasks: on.value,
              milestones: $r.value,
              "start-date": pn.value.min,
              "end-date": pn.value.max,
              "scale-configs": ot.value,
              "working-hours": r.workingHours,
              "task-bar-config": r.taskBarConfig,
              "allow-drag-and-resize": r.allowDragAndResize,
              "show-actual-taskbar": r.showActualTaskbar,
              "enable-task-bar-tooltip": r.enableTaskBarTooltip,
              "enable-milestone-tooltip": r.enableMilestoneTooltip,
              "milestone-label-position": r.milestoneLabelPosition,
              "enable-parent-task-auto-schedule": r.enableParentTaskAutoSchedule,
              "link-config": i.value,
              "pending-task-background-color": r.pendingTaskBackgroundColor,
              "delay-task-background-color": r.delayTaskBackgroundColor,
              "complete-task-background-color": r.completeTaskBackgroundColor,
              "ongoing-task-background-color": r.ongoingTaskBackgroundColor,
              "use-default-drawer": r.useDefaultDrawer,
              "use-default-milestone-dialog": r.useDefaultMilestoneDialog,
              "on-milestone-save": Da,
              onTimelineScaleChanged: ma,
              onClickTask: at,
              onEditTask: Tt,
              onMilestoneDoubleClick: Pn,
              onStartTimer: ye,
              onStopTimer: Re,
              onAddPredecessor: Lt,
              onAddSuccessor: ut,
              onPredecessorAdded: ct,
              onSuccessorAdded: Ut,
              onDelete: sr,
              onLinkDeleted: Er,
              onResourceDragEnd: nn
            }, hi({ _: 2 }, [
              P.$slots["custom-task-content"] ? {
                name: "custom-task-content",
                fn: qa((Fe) => [
                  Nn(P.$slots, "custom-task-content", qs(So(Fe)), void 0, !0)
                ]),
                key: "0"
              } : void 0,
              P.$slots["taskbar-tooltip"] ? {
                name: "taskbar-tooltip",
                fn: qa((Fe) => [
                  Nn(P.$slots, "taskbar-tooltip", qs(So(Fe)), void 0, !0)
                ]),
                key: "1"
              } : void 0,
              P.$slots["milestone-tooltip"] ? {
                name: "milestone-tooltip",
                fn: qa((Fe) => [
                  Nn(P.$slots, "milestone-tooltip", qs(So(Fe)), void 0, !0)
                ]),
                key: "2"
              } : void 0,
              P.$slots["custom-milestone-content"] ? {
                name: "custom-milestone-content",
                fn: qa((Fe) => [
                  Nn(P.$slots, "custom-milestone-content", qs(So(Fe)), void 0, !0)
                ]),
                key: "3"
              } : void 0
            ]), 1032, ["tasks", "milestones", "start-date", "end-date", "scale-configs", "working-hours", "task-bar-config", "allow-drag-and-resize", "show-actual-taskbar", "enable-task-bar-tooltip", "enable-milestone-tooltip", "milestone-label-position", "enable-parent-task-auto-schedule", "link-config", "pending-task-background-color", "delay-task-background-color", "complete-task-background-color", "ongoing-task-background-color", "use-default-drawer", "use-default-milestone-dialog"]),
            It.value ? ($(), ee("div", {
              key: 0,
              class: "focus-close-button",
              onClick: dn(Hs, ["stop"])
            }, [
              he[11] || (he[11] = _("svg", {
                class: "close-icon",
                viewBox: "0 0 24 24",
                fill: "none",
                xmlns: "http://www.w3.org/2000/svg"
              }, [
                _("path", {
                  d: "M18 6L6 18M6 6l12 12",
                  stroke: "currentColor",
                  "stroke-width": "2",
                  "stroke-linecap": "round",
                  "stroke-linejoin": "round"
                })
              ], -1)),
              _("span", z8, Ee(Te(yt).disableTaskbarFocusMode), 1)
            ])) : vt("", !0)
          ], 2)
        ], 64))
      ]),
      r.useDefaultDrawer ? ($(), Ir(iL, {
        key: 1,
        visible: Yt.value,
        "onUpdate:visible": he[8] || (he[8] = (Fe) => Yt.value = Fe),
        task: zt.value,
        "is-edit": gr.value,
        "assignee-options": r.assigneeOptions,
        "resource-type-options": r.resourceTypeOptions,
        "show-resource-type-option": r.showResourceTypeOption,
        "pending-task-background-color": r.pendingTaskBackgroundColor,
        "delay-task-background-color": r.delayTaskBackgroundColor,
        "complete-task-background-color": r.completeTaskBackgroundColor,
        "ongoing-task-background-color": r.ongoingTaskBackgroundColor,
        "enable-close-on-overlay-click": r.enableTaskDrawerAutoClose,
        onSubmit: Or,
        onClose: he[9] || (he[9] = (Fe) => Yt.value = !1),
        onStartTimer: ye,
        onStopTimer: Re,
        onDelete: sr
      }, null, 8, ["visible", "task", "is-edit", "assignee-options", "resource-type-options", "show-resource-type-option", "pending-task-background-color", "delay-task-background-color", "complete-task-background-color", "ongoing-task-background-color", "enable-close-on-overlay-click"])) : vt("", !0),
      r.useDefaultMilestoneDialog ? ($(), Ir(PL, {
        key: 2,
        visible: ln.value,
        "onUpdate:visible": he[10] || (he[10] = (Fe) => ln.value = Fe),
        milestone: Hn.value,
        onClose: Ur,
        onSave: Da,
        onDelete: Qr
      }, null, 8, ["visible", "milestone"])) : vt("", !0)
    ], 2));
  }
}), J8 = /* @__PURE__ */ Fn(X8, [["__scopeId", "data-v-8ae83c7c"]]), Z8 = /* @__PURE__ */ hn({
  name: "TaskListColumn",
  __name: "TaskListColumn",
  props: {
    prop: {},
    label: {},
    width: {},
    align: { default: "left" },
    cssClass: {},
    fixed: { type: [String, Boolean] }
  },
  setup(n) {
    return (t, e) => null;
  }
}), eP = /* @__PURE__ */ hn({
  name: "TaskListContextMenu",
  __name: "TaskListContextMenu",
  props: {
    taskType: {}
  },
  setup(n) {
    return (t, e) => null;
  }
}), tP = /* @__PURE__ */ hn({
  name: "TaskBarContextMenu",
  __name: "TaskBarContextMenu",
  props: {
    taskType: {}
  },
  setup(n) {
    return (t, e) => null;
  }
}), rP = (n) => {
  n.component("GanttChart", J8), n.component("TaskListColumn", Z8), n.component("TaskListContextMenu", eP), n.component("TaskBarContextMenu", tP);
}, q9 = {
  install: rP
};
/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */
function u2(n, t) {
  (t == null || t > n.length) && (t = n.length);
  for (var e = 0, r = Array(t); e < t; e++) r[e] = n[e];
  return r;
}
function nP(n) {
  if (Array.isArray(n)) return n;
}
function aP(n, t) {
  var e = n == null ? null : typeof Symbol < "u" && n[Symbol.iterator] || n["@@iterator"];
  if (e != null) {
    var r, a, A, i, s = [], o = !0, l = !1;
    try {
      if (A = (e = e.call(n)).next, t !== 0) for (; !(o = (r = A.call(e)).done) && (s.push(r.value), s.length !== t); o = !0) ;
    } catch (u) {
      l = !0, a = u;
    } finally {
      try {
        if (!o && e.return != null && (i = e.return(), Object(i) !== i)) return;
      } finally {
        if (l) throw a;
      }
    }
    return s;
  }
}
function AP() {
  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 sP(n, t) {
  return nP(n) || aP(n, t) || iP(n, t) || AP();
}
function iP(n, t) {
  if (n) {
    if (typeof n == "string") return u2(n, t);
    var e = {}.toString.call(n).slice(8, -1);
    return e === "Object" && n.constructor && (e = n.constructor.name), e === "Map" || e === "Set" ? Array.from(n) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? u2(n, t) : void 0;
  }
}
const yk = Object.entries, c2 = Object.setPrototypeOf, oP = Object.isFrozen, lP = Object.getPrototypeOf, uP = Object.getOwnPropertyDescriptor;
let RA = Object.freeze, NA = Object.seal, Hl = Object.create, Bk = typeof Reflect < "u" && Reflect, zp = Bk.apply, Xp = Bk.construct;
RA || (RA = function(t) {
  return t;
});
NA || (NA = function(t) {
  return t;
});
zp || (zp = function(t, e) {
  for (var r = arguments.length, a = new Array(r > 2 ? r - 2 : 0), A = 2; A < r; A++)
    a[A - 2] = arguments[A];
  return t.apply(e, a);
});
Xp || (Xp = function(t) {
  for (var e = arguments.length, r = new Array(e > 1 ? e - 1 : 0), a = 1; a < e; a++)
    r[a - 1] = arguments[a];
  return new t(...r);
});
const Ul = iA(Array.prototype.forEach), cP = iA(Array.prototype.lastIndexOf), d2 = iA(Array.prototype.pop), Ll = iA(Array.prototype.push), dP = iA(Array.prototype.splice), Fo = Array.isArray, Qu = iA(String.prototype.toLowerCase), Bh = iA(String.prototype.toString), f2 = iA(String.prototype.match), bu = iA(String.prototype.replace), h2 = iA(String.prototype.indexOf), fP = iA(String.prototype.trim), hP = iA(Number.prototype.toString), gP = iA(Boolean.prototype.toString), g2 = typeof BigInt > "u" ? null : iA(BigInt.prototype.toString), v2 = typeof Symbol > "u" ? null : iA(Symbol.prototype.toString), kA = iA(Object.prototype.hasOwnProperty), Cu = iA(Object.prototype.toString), CA = iA(RegExp.prototype.test), Yo = vP(TypeError);
function iA(n) {
  return function(t) {
    t instanceof RegExp && (t.lastIndex = 0);
    for (var e = arguments.length, r = new Array(e > 1 ? e - 1 : 0), a = 1; a < e; a++)
      r[a - 1] = arguments[a];
    return zp(n, t, r);
  };
}
function vP(n) {
  return function() {
    for (var t = arguments.length, e = new Array(t), r = 0; r < t; r++)
      e[r] = arguments[r];
    return Xp(n, e);
  };
}
function kn(n, t) {
  let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Qu;
  if (c2 && c2(n, null), !Fo(t))
    return n;
  let r = t.length;
  for (; r--; ) {
    let a = t[r];
    if (typeof a == "string") {
      const A = e(a);
      A !== a && (oP(t) || (t[r] = A), a = A);
    }
    n[a] = !0;
  }
  return n;
}
function pP(n) {
  for (let t = 0; t < n.length; t++)
    kA(n, t) || (n[t] = null);
  return n;
}
function os(n) {
  const t = Hl(null);
  for (const r of yk(n)) {
    var e = sP(r, 2);
    const a = e[0], A = e[1];
    kA(n, a) && (Fo(A) ? t[a] = pP(A) : A && typeof A == "object" && A.constructor === Object ? t[a] = os(A) : t[a] = A);
  }
  return t;
}
function mP(n) {
  switch (typeof n) {
    case "string":
      return n;
    case "number":
      return hP(n);
    case "boolean":
      return gP(n);
    case "bigint":
      return g2 ? g2(n) : "0";
    case "symbol":
      return v2 ? v2(n) : "Symbol()";
    case "undefined":
      return Cu(n);
    case "function":
    case "object": {
      if (n === null)
        return Cu(n);
      const t = n, e = Ii(t, "toString");
      if (typeof e == "function") {
        const r = e(t);
        return typeof r == "string" ? r : Cu(r);
      }
      return Cu(n);
    }
    default:
      return Cu(n);
  }
}
function Ii(n, t) {
  for (; n !== null; ) {
    const r = uP(n, t);
    if (r) {
      if (r.get)
        return iA(r.get);
      if (typeof r.value == "function")
        return iA(r.value);
    }
    n = lP(n);
  }
  function e() {
    return null;
  }
  return e;
}
function wP(n) {
  try {
    return CA(n, ""), !0;
  } catch {
    return !1;
  }
}
const p2 = RA(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), bh = RA(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Ch = RA(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), yP = RA(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), kh = RA(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), BP = RA(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), m2 = RA(["#text"]), w2 = RA(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), Th = RA(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dominant-baseline", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-orientation", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), y2 = RA(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), ld = RA(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), bP = NA(/{{[\w\W]*|^[\w\W]*}}/g), CP = NA(/<%[\w\W]*|^[\w\W]*%>/g), kP = NA(/\${[\w\W]*/g), TP = NA(/^data-[\-\w.\u00B7-\uFFFF]+$/), xP = NA(/^aria-[\-\w]+$/), B2 = NA(
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
  // eslint-disable-line no-useless-escape
), DP = NA(/^(?:\w+script|data):/i), EP = NA(
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
  // eslint-disable-line no-control-regex
), SP = NA(/^html$/i), FP = NA(/^[a-z][.\w]*(-[.\w]+)+$/i), b2 = NA(/<[/\w!]/g), C2 = NA(/<[/\w]/g), UP = NA(/<\/no(script|embed|frames)/i), LP = NA(/\/>/i), _s = {
  element: 1,
  attribute: 2,
  text: 3,
  cdataSection: 4,
  entityReference: 5,
  // Deprecated
  entityNode: 6,
  // Deprecated
  processingInstruction: 7,
  comment: 8,
  document: 9,
  documentType: 10,
  documentFragment: 11,
  notation: 12
  // Deprecated
}, IP = function() {
  return typeof window > "u" ? null : window;
}, QP = function(t, e) {
  if (typeof t != "object" || typeof t.createPolicy != "function")
    return null;
  let r = null;
  const a = "data-tt-policy-suffix";
  e && e.hasAttribute(a) && (r = e.getAttribute(a));
  const A = "dompurify" + (r ? "#" + r : "");
  try {
    return t.createPolicy(A, {
      createHTML(i) {
        return i;
      },
      createScriptURL(i) {
        return i;
      }
    });
  } catch {
    return console.warn("TrustedTypes policy " + A + " could not be created."), null;
  }
}, k2 = function() {
  return {
    afterSanitizeAttributes: [],
    afterSanitizeElements: [],
    afterSanitizeShadowDOM: [],
    beforeSanitizeAttributes: [],
    beforeSanitizeElements: [],
    beforeSanitizeShadowDOM: [],
    uponSanitizeAttribute: [],
    uponSanitizeElement: [],
    uponSanitizeShadowNode: []
  };
}, ko = function(t, e, r, a) {
  return kA(t, e) && Fo(t[e]) ? kn(a.base ? os(a.base) : {}, t[e], a.transform) : r;
};
function bk() {
  let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : IP();
  const t = (Wt) => bk(Wt);
  if (t.version = "3.4.12", t.removed = [], !n || !n.document || n.document.nodeType !== _s.document || !n.Element)
    return t.isSupported = !1, t;
  let e = n.document;
  const r = e, a = r.currentScript;
  n.DocumentFragment;
  const A = n.HTMLTemplateElement, i = n.Node, s = n.Element, o = n.NodeFilter, l = n.NamedNodeMap;
  l === void 0 && (n.NamedNodeMap || n.MozNamedAttrMap), n.HTMLFormElement;
  const u = n.DOMParser, f = n.trustedTypes, h = s.prototype, c = Ii(h, "cloneNode"), p = Ii(h, "remove"), w = Ii(h, "nextSibling"), y = Ii(h, "childNodes"), m = Ii(h, "parentNode"), k = Ii(h, "shadowRoot"), D = Ii(h, "attributes"), B = i && i.prototype ? Ii(i.prototype, "nodeType") : null, O = i && i.prototype ? Ii(i.prototype, "nodeName") : null;
  if (typeof A == "function") {
    const Wt = e.createElement("template");
    Wt.content && Wt.content.ownerDocument && (e = Wt.content.ownerDocument);
  }
  let q, G = "", W, F = !1, Y = 0;
  const T = function() {
    if (Y > 0)
      throw Yo('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
  }, E = function(fe) {
    T(), Y++;
    try {
      return q.createHTML(fe);
    } finally {
      Y--;
    }
  }, Q = function(fe) {
    T(), Y++;
    try {
      return q.createScriptURL(fe);
    } finally {
      Y--;
    }
  }, x = function() {
    return F || (W = QP(f, a), F = !0), W;
  }, oe = e, J = oe.implementation, S = oe.createNodeIterator, I = oe.createDocumentFragment, N = oe.getElementsByTagName, se = r.importNode;
  let Z = k2();
  t.isSupported = typeof yk == "function" && typeof m == "function" && J && J.createHTMLDocument !== void 0;
  const C = bP, H = CP, M = kP, te = TP, ie = xP, we = DP, ve = EP, le = FP;
  let _e = B2, De = null;
  const ze = kn({}, [...p2, ...bh, ...Ch, ...kh, ...m2]);
  let nt = null;
  const Qe = kn({}, [...w2, ...Th, ...y2, ...ld]);
  let ne = Object.seal(Hl(null, {
    tagNameCheck: {
      writable: !0,
      configurable: !1,
      enumerable: !0,
      value: null
    },
    attributeNameCheck: {
      writable: !0,
      configurable: !1,
      enumerable: !0,
      value: null
    },
    allowCustomizedBuiltInElements: {
      writable: !0,
      configurable: !1,
      enumerable: !0,
      value: !1
    }
  })), gt = null, je = null;
  const ot = Object.seal(Hl(null, {
    tagCheck: {
      writable: !0,
      configurable: !1,
      enumerable: !0,
      value: null
    },
    attributeCheck: {
      writable: !0,
      configurable: !1,
      enumerable: !0,
      value: null
    }
  }));
  let Ie = !0, It = !0, dt = !1, Dt = !0, Ct = !1, Ve = !0, ht = !1, K = !1, X = null, ke = null, Je = !1, pt = !1, Xe = !1, Ye = !1, Kt = !0, it = !1;
  const qt = "user-content-";
  let hr = !0, Nt = !1, xr = {}, Jt = null;
  const lr = kn({}, [
    "annotation-xml",
    "audio",
    "colgroup",
    "desc",
    "foreignobject",
    "head",
    "iframe",
    "math",
    "mi",
    "mn",
    "mo",
    "ms",
    "mtext",
    "noembed",
    "noframes",
    "noscript",
    "plaintext",
    "script",
    // <selectedcontent> mirrors the selected <option>'s subtree, cloned by
    // the UA (customizable <select>) — including any on* handlers — and the
    // engine re-mirrors synchronously whenever a removal changes which
    // option/selectedcontent is current, even inside DOMPurify's inert
    // DOMParser document. Hoisting its children on removal re-inserts a fresh
    // mirror target ahead of the walk, which the engine refills, looping
    // forever (DoS) and amplifying output. Dropping its content on removal
    // (rather than hoisting) breaks that cascade; the content is a duplicate
    // of the option, which is sanitized on its own. See campaign-3 F1/F6.
    "selectedcontent",
    "style",
    "svg",
    "template",
    "thead",
    "title",
    "video",
    "xmp"
  ]);
  let Fr = null;
  const er = kn({}, ["audio", "video", "img", "source", "image", "track"]);
  let Ar = null;
  const Ge = kn({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), rt = "http://www.w3.org/1998/Math/MathML", yt = "http://www.w3.org/2000/svg", Ot = "http://www.w3.org/1999/xhtml";
  let vr = Ot, jt = !1, br = null;
  const on = kn({}, [rt, yt, Ot], Bh), an = RA(["mi", "mo", "mn", "ms", "mtext"]);
  let xn = kn({}, an);
  const $r = RA(["annotation-xml"]);
  let pn = kn({}, $r);
  const Dn = kn({}, ["title", "style", "font", "a", "script"]);
  let Ca = null;
  const ka = ["application/xhtml+xml", "text/html"], Yn = "text/html";
  let zr = null, Un = null;
  const pa = e.createElement("form"), ma = function(fe) {
    return fe instanceof RegExp || fe instanceof Function;
  }, En = function() {
    let fe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    if (Un && Un === fe)
      return;
    (!fe || typeof fe != "object") && (fe = {}), fe = os(fe), Ca = // eslint-disable-next-line unicorn/prefer-includes
    ka.indexOf(fe.PARSER_MEDIA_TYPE) === -1 ? Yn : fe.PARSER_MEDIA_TYPE, zr = Ca === "application/xhtml+xml" ? Bh : Qu, De = ko(fe, "ALLOWED_TAGS", ze, {
      transform: zr
    }), nt = ko(fe, "ALLOWED_ATTR", Qe, {
      transform: zr
    }), br = ko(fe, "ALLOWED_NAMESPACES", on, {
      transform: Bh
    }), Ar = ko(fe, "ADD_URI_SAFE_ATTR", Ge, {
      transform: zr,
      base: Ge
    }), Fr = ko(fe, "ADD_DATA_URI_TAGS", er, {
      transform: zr,
      base: er
    }), Jt = ko(fe, "FORBID_CONTENTS", lr, {
      transform: zr
    }), gt = ko(fe, "FORBID_TAGS", os({}), {
      transform: zr
    }), je = ko(fe, "FORBID_ATTR", os({}), {
      transform: zr
    }), xr = kA(fe, "USE_PROFILES") ? fe.USE_PROFILES && typeof fe.USE_PROFILES == "object" ? os(fe.USE_PROFILES) : fe.USE_PROFILES : !1, Ie = fe.ALLOW_ARIA_ATTR !== !1, It = fe.ALLOW_DATA_ATTR !== !1, dt = fe.ALLOW_UNKNOWN_PROTOCOLS || !1, Dt = fe.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ct = fe.SAFE_FOR_TEMPLATES || !1, Ve = fe.SAFE_FOR_XML !== !1, ht = fe.WHOLE_DOCUMENT || !1, pt = fe.RETURN_DOM || !1, Xe = fe.RETURN_DOM_FRAGMENT || !1, Ye = fe.RETURN_TRUSTED_TYPE || !1, Je = fe.FORCE_BODY || !1, Kt = fe.SANITIZE_DOM !== !1, it = fe.SANITIZE_NAMED_PROPS || !1, hr = fe.KEEP_CONTENT !== !1, Nt = fe.IN_PLACE || !1, _e = wP(fe.ALLOWED_URI_REGEXP) ? fe.ALLOWED_URI_REGEXP : B2, vr = typeof fe.NAMESPACE == "string" ? fe.NAMESPACE : Ot, xn = kA(fe, "MATHML_TEXT_INTEGRATION_POINTS") && fe.MATHML_TEXT_INTEGRATION_POINTS && typeof fe.MATHML_TEXT_INTEGRATION_POINTS == "object" ? os(fe.MATHML_TEXT_INTEGRATION_POINTS) : kn({}, an), pn = kA(fe, "HTML_INTEGRATION_POINTS") && fe.HTML_INTEGRATION_POINTS && typeof fe.HTML_INTEGRATION_POINTS == "object" ? os(fe.HTML_INTEGRATION_POINTS) : kn({}, $r);
    const et = kA(fe, "CUSTOM_ELEMENT_HANDLING") && fe.CUSTOM_ELEMENT_HANDLING && typeof fe.CUSTOM_ELEMENT_HANDLING == "object" ? os(fe.CUSTOM_ELEMENT_HANDLING) : Hl(null);
    if (ne = Hl(null), kA(et, "tagNameCheck") && ma(et.tagNameCheck) && (ne.tagNameCheck = et.tagNameCheck), kA(et, "attributeNameCheck") && ma(et.attributeNameCheck) && (ne.attributeNameCheck = et.attributeNameCheck), kA(et, "allowCustomizedBuiltInElements") && typeof et.allowCustomizedBuiltInElements == "boolean" && (ne.allowCustomizedBuiltInElements = et.allowCustomizedBuiltInElements), NA(ne), Ct && (It = !1), Xe && (pt = !0), xr && (De = kn({}, m2), nt = Hl(null), xr.html === !0 && (kn(De, p2), kn(nt, w2)), xr.svg === !0 && (kn(De, bh), kn(nt, Th), kn(nt, ld)), xr.svgFilters === !0 && (kn(De, Ch), kn(nt, Th), kn(nt, ld)), xr.mathMl === !0 && (kn(De, kh), kn(nt, y2), kn(nt, ld))), ot.tagCheck = null, ot.attributeCheck = null, kA(fe, "ADD_TAGS") && (typeof fe.ADD_TAGS == "function" ? ot.tagCheck = fe.ADD_TAGS : Fo(fe.ADD_TAGS) && (De === ze && (De = os(De)), kn(De, fe.ADD_TAGS, zr))), kA(fe, "ADD_ATTR") && (typeof fe.ADD_ATTR == "function" ? ot.attributeCheck = fe.ADD_ATTR : Fo(fe.ADD_ATTR) && (nt === Qe && (nt = os(nt)), kn(nt, fe.ADD_ATTR, zr))), kA(fe, "ADD_URI_SAFE_ATTR") && Fo(fe.ADD_URI_SAFE_ATTR) && kn(Ar, fe.ADD_URI_SAFE_ATTR, zr), kA(fe, "FORBID_CONTENTS") && Fo(fe.FORBID_CONTENTS) && (Jt === lr && (Jt = os(Jt)), kn(Jt, fe.FORBID_CONTENTS, zr)), kA(fe, "ADD_FORBID_CONTENTS") && Fo(fe.ADD_FORBID_CONTENTS) && (Jt === lr && (Jt = os(Jt)), kn(Jt, fe.ADD_FORBID_CONTENTS, zr)), hr && (De["#text"] = !0), ht && kn(De, ["html", "head", "body"]), De.table && (kn(De, ["tbody"]), delete gt.tbody), fe.TRUSTED_TYPES_POLICY) {
      if (typeof fe.TRUSTED_TYPES_POLICY.createHTML != "function")
        throw Yo('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
      if (typeof fe.TRUSTED_TYPES_POLICY.createScriptURL != "function")
        throw Yo('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
      const ft = q;
      q = fe.TRUSTED_TYPES_POLICY;
      try {
        G = E("");
      } catch (Yt) {
        throw q = ft, Yt;
      }
    } else fe.TRUSTED_TYPES_POLICY === null ? (q = void 0, G = "") : (q === void 0 && (q = x()), q && typeof G == "string" && (G = E("")));
    RA && RA(fe), Un = fe;
  }, Vn = kn({}, [...bh, ...Ch, ...yP]), Xa = kn({}, [...kh, ...BP]), oA = function(fe, et, ft) {
    return et.namespaceURI === Ot ? fe === "svg" : et.namespaceURI === rt ? fe === "svg" && (ft === "annotation-xml" || xn[ft]) : !!Vn[fe];
  }, Ta = function(fe, et, ft) {
    return et.namespaceURI === Ot ? fe === "math" : et.namespaceURI === yt ? fe === "math" && pn[ft] : !!Xa[fe];
  }, ts = function(fe, et, ft) {
    return et.namespaceURI === yt && !pn[ft] || et.namespaceURI === rt && !xn[ft] ? !1 : !Xa[fe] && (Dn[fe] || !Vn[fe]);
  }, Hs = function(fe) {
    let et = m(fe);
    (!et || !et.tagName) && (et = {
      namespaceURI: vr,
      tagName: "template"
    });
    const ft = Qu(fe.tagName), Yt = Qu(et.tagName);
    return br[fe.namespaceURI] ? fe.namespaceURI === yt ? oA(ft, et, Yt) : fe.namespaceURI === rt ? Ta(ft, et, Yt) : fe.namespaceURI === Ot ? ts(ft, et, Yt) : !!(Ca === "application/xhtml+xml" && br[fe.namespaceURI]) : !1;
  }, sa = function(fe) {
    Ll(t.removed, {
      element: fe
    });
    try {
      m(fe).removeChild(fe);
    } catch {
      if (p(fe), !m(fe))
        throw Yo("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
    }
  }, rs = function(fe) {
    xa(fe);
    const et = y(fe);
    if (et) {
      const Yt = [];
      Ul(et, (zt) => {
        Ll(Yt, zt);
      }), Ul(Yt, (zt) => {
        try {
          p(zt);
        } catch {
        }
      });
    }
    const ft = D(fe);
    if (ft)
      for (let Yt = ft.length - 1; Yt >= 0; --Yt) {
        const zt = ft[Yt], gr = zt && zt.name;
        if (typeof gr == "string")
          try {
            fe.removeAttribute(gr);
          } catch {
          }
      }
  }, Jn = function(fe, et) {
    try {
      Ll(t.removed, {
        attribute: et.getAttributeNode(fe),
        from: et
      });
    } catch {
      Ll(t.removed, {
        attribute: null,
        from: et
      });
    }
    if (et.removeAttribute(fe), fe === "is")
      if (pt || Xe)
        try {
          sa(et);
        } catch {
        }
      else
        try {
          et.setAttribute(fe, "");
        } catch {
        }
  }, ia = function(fe) {
    const et = D(fe);
    if (et)
      for (let ft = et.length - 1; ft >= 0; --ft) {
        const Yt = et[ft], zt = Yt && Yt.name;
        if (!(typeof zt != "string" || nt[zr(zt)]))
          try {
            fe.removeAttribute(zt);
          } catch {
          }
      }
  }, xa = function(fe) {
    const et = [fe];
    for (; et.length > 0; ) {
      const ft = et.pop();
      (B ? B(ft) : ft.nodeType) === _s.element && ia(ft);
      const zt = y(ft);
      if (zt)
        for (let gr = zt.length - 1; gr >= 0; --gr)
          et.push(zt[gr]);
    }
  }, Bn = function(fe) {
    if (!Ve)
      return;
    const et = [fe];
    for (; et.length > 0; ) {
      const ft = et.pop(), Yt = B ? B(ft) : ft.nodeType;
      if (Yt === _s.processingInstruction || Yt === _s.comment && CA(C2, ft.data)) {
        try {
          p(ft);
        } catch {
        }
        continue;
      }
      if (Yt === _s.element) {
        const gr = ft, rn = zr(O ? O(ft) : ft.nodeName);
        try {
          gr.hasAttribute && gr.hasAttribute("patchsrc") && gr.removeAttribute("patchsrc"), gr.hasAttribute && gr.hasAttribute("for") && rn !== "label" && rn !== "output" && gr.removeAttribute("for");
        } catch {
        }
      }
      const zt = y(ft);
      if (zt)
        for (let gr = zt.length - 1; gr >= 0; --gr)
          et.push(zt[gr]);
    }
  }, Zn = function(fe) {
    let et = null, ft = null;
    if (Je)
      fe = "<remove></remove>" + fe;
    else {
      const gr = f2(fe, /^[\r\n\t ]+/);
      ft = gr && gr[0];
    }
    Ca === "application/xhtml+xml" && vr === Ot && (fe = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + fe + "</body></html>");
    const Yt = q ? E(fe) : fe;
    if (vr === Ot)
      try {
        et = new u().parseFromString(Yt, Ca);
      } catch {
      }
    if (!et || !et.documentElement) {
      et = J.createDocument(vr, "template", null);
      try {
        et.documentElement.innerHTML = jt ? G : Yt;
      } catch {
      }
    }
    const zt = et.body || et.documentElement;
    return fe && ft && zt.insertBefore(e.createTextNode(ft), zt.childNodes[0] || null), vr === Ot ? N.call(et, ht ? "html" : "body")[0] : ht ? et.documentElement : zt;
  }, Xr = function(fe) {
    return S.call(
      fe.ownerDocument || fe,
      fe,
      // eslint-disable-next-line no-bitwise
      o.SHOW_ELEMENT | o.SHOW_COMMENT | o.SHOW_TEXT | o.SHOW_PROCESSING_INSTRUCTION | o.SHOW_CDATA_SECTION,
      null
    );
  }, wa = function(fe) {
    return fe = bu(fe, C, " "), fe = bu(fe, H, " "), fe = bu(fe, M, " "), fe;
  }, Da = function(fe) {
    var et;
    fe.normalize();
    const ft = S.call(
      fe.ownerDocument || fe,
      fe,
      // eslint-disable-next-line no-bitwise
      o.SHOW_TEXT | o.SHOW_COMMENT | o.SHOW_CDATA_SECTION | o.SHOW_PROCESSING_INSTRUCTION,
      null
    );
    let Yt = ft.nextNode();
    for (; Yt; )
      Yt.data = wa(Yt.data), Yt = ft.nextNode();
    const zt = (et = fe.querySelectorAll) === null || et === void 0 ? void 0 : et.call(fe, "template");
    zt && Ul(zt, (gr) => {
      ya(gr.content) && Da(gr.content);
    });
  }, bn = function(fe) {
    const et = O ? O(fe) : null;
    return typeof et != "string" || zr(et) !== "form" ? !1 : typeof fe.nodeName != "string" || typeof fe.textContent != "string" || typeof fe.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
    // prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
    // makes the direct read diverge from the cached read; a clean form
    // (same-realm OR foreign-realm) has both reads pointing at the same
    // canonical NamedNodeMap.
    fe.attributes !== D(fe) || typeof fe.removeAttribute != "function" || typeof fe.setAttribute != "function" || typeof fe.namespaceURI != "string" || typeof fe.insertBefore != "function" || typeof fe.hasChildNodes != "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
    // returns the integer 1 for any Element regardless of realm; direct
    // read on a clobbered form (e.g. <input name="nodeType">) returns
    // the named child element. Cheap addition — nodeType is read from
    // an internal slot, no serialization cost — and removes a residual
    // clobbering surface used by several mXSS / PI / comment branches
    // in _sanitizeElements that compare currentNode.nodeType directly.
    fe.nodeType !== B(fe) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
    // "childNodes" shadows the prototype getter. Direct reads of
    // form.childNodes from a clobbered form return the named child
    // instead of the real NodeList, so any walk that reads it directly
    // skips the form's real children. Compare the direct read to the
    // cached Node.prototype getter — when the form's named-property
    // getter intercepts the read, the two values differ and we flag
    // the form. This catches every clobbering child type (input,
    // select, etc.) regardless of whether the named child happens to
    // carry a numeric .length, which a typeof-based probe would miss
    // (e.g. HTMLSelectElement.length is a defined unsigned-long).
    fe.childNodes !== y(fe);
  }, ya = function(fe) {
    if (!B || typeof fe != "object" || fe === null)
      return !1;
    try {
      return B(fe) === _s.documentFragment;
    } catch {
      return !1;
    }
  }, Ea = function(fe) {
    if (!B || typeof fe != "object" || fe === null)
      return !1;
    try {
      return typeof B(fe) == "number";
    } catch {
      return !1;
    }
  };
  function Hr(Wt, fe, et) {
    Wt.length !== 0 && Ul(Wt, (ft) => {
      ft.call(t, fe, et, Un);
    });
  }
  const gA = function(fe, et) {
    return !!(Ve && fe.hasChildNodes() && !Ea(fe.firstElementChild) && CA(b2, fe.textContent) && CA(b2, fe.innerHTML) || Ve && fe.namespaceURI === Ot && et === "style" && Ea(fe.firstElementChild) || fe.nodeType === _s.processingInstruction || Ve && fe.nodeType === _s.comment && CA(C2, fe.data));
  }, vA = function(fe, et) {
    if (!gt[et] && Ja(et) && (ne.tagNameCheck instanceof RegExp && CA(ne.tagNameCheck, et) || ne.tagNameCheck instanceof Function && ne.tagNameCheck(et)))
      return !1;
    if (hr && !Jt[et]) {
      const ft = m(fe), Yt = y(fe);
      if (Yt && ft) {
        const zt = Yt.length;
        for (let gr = zt - 1; gr >= 0; --gr) {
          const rn = Nt ? Yt[gr] : c(Yt[gr], !0);
          ft.insertBefore(rn, w(fe));
        }
      }
    }
    return sa(fe), !0;
  }, pA = function(fe, et) {
    if (Hr(Z.beforeSanitizeElements, fe, null), fe !== et && m(fe) === null)
      return !0;
    if (bn(fe))
      return sa(fe), !0;
    const ft = zr(O ? O(fe) : fe.nodeName);
    if (Hr(Z.uponSanitizeElement, fe, {
      tagName: ft,
      allowedTags: De
    }), fe !== et && m(fe) === null)
      return !0;
    if (gA(fe, ft))
      return sa(fe), !0;
    if (gt[ft] || !(ot.tagCheck instanceof Function && ot.tagCheck(ft)) && !De[ft]) {
      const zt = vA(fe, ft);
      return zt === !1 && Hr(Z.afterSanitizeElements, fe, null), zt;
    }
    if ((B ? B(fe) : fe.nodeType) === _s.element && !Hs(fe) || (ft === "noscript" || ft === "noembed" || ft === "noframes") && CA(UP, fe.innerHTML))
      return sa(fe), !0;
    if (Ct && fe.nodeType === _s.text) {
      const zt = wa(fe.textContent);
      fe.textContent !== zt && (Ll(t.removed, {
        element: fe.cloneNode()
      }), fe.textContent = zt);
    }
    return Hr(Z.afterSanitizeElements, fe, null), !1;
  }, DA = function(fe, et, ft) {
    if (je[et] || Ve && et === "patchsrc" || Ve && et === "for" && fe !== "label" && fe !== "output" || Kt && (et === "id" || et === "name") && (ft in e || ft in pa))
      return !1;
    const Yt = nt[et] || ot.attributeCheck instanceof Function && ot.attributeCheck(et, fe);
    if (!(It && CA(te, et))) {
      if (!(Ie && CA(ie, et))) {
        if (Yt) {
          if (!Ar[et]) {
            if (!CA(_e, bu(ft, ve, ""))) {
              if (!((et === "src" || et === "xlink:href" || et === "href") && fe !== "script" && h2(ft, "data:") === 0 && Fr[fe])) {
                if (!(dt && !CA(we, bu(ft, ve, "")))) {
                  if (ft)
                    return !1;
                }
              }
            }
          }
        } else if (
          // First condition does a very basic check if a) it's basically a valid custom element tagname AND
          // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
          // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
          !(Ja(fe) && (ne.tagNameCheck instanceof RegExp && CA(ne.tagNameCheck, fe) || ne.tagNameCheck instanceof Function && ne.tagNameCheck(fe)) && (ne.attributeNameCheck instanceof RegExp && CA(ne.attributeNameCheck, et) || ne.attributeNameCheck instanceof Function && ne.attributeNameCheck(et, fe)) || // Alternative, second condition checks if it's an `is`-attribute, AND
          // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
          et === "is" && ne.allowCustomizedBuiltInElements && (ne.tagNameCheck instanceof RegExp && CA(ne.tagNameCheck, ft) || ne.tagNameCheck instanceof Function && ne.tagNameCheck(ft)))
        ) return !1;
      }
    }
    return !0;
  }, oa = kn({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), Ja = function(fe) {
    return !oa[Qu(fe)] && CA(le, fe);
  }, Za = function(fe, et, ft, Yt) {
    if (q && typeof f == "object" && typeof f.getAttributeType == "function" && !ft)
      switch (f.getAttributeType(fe, et)) {
        case "TrustedHTML":
          return E(Yt);
        case "TrustedScriptURL":
          return Q(Yt);
      }
    return Yt;
  }, ea = function(fe, et, ft, Yt) {
    try {
      ft ? fe.setAttributeNS(ft, et, Yt) : fe.setAttribute(et, Yt), bn(fe) ? sa(fe) : d2(t.removed);
    } catch {
      Jn(et, fe);
    }
  }, fs = function(fe) {
    Hr(Z.beforeSanitizeAttributes, fe, null);
    const et = fe.attributes;
    if (!et || bn(fe))
      return;
    const ft = {
      attrName: "",
      attrValue: "",
      keepAttr: !0,
      allowedAttributes: nt,
      forceKeepAttr: void 0
    };
    let Yt = et.length;
    const zt = zr(fe.nodeName);
    for (; Yt--; ) {
      const gr = et[Yt], rn = gr.name, Gn = gr.namespaceURI, ln = gr.value, Hn = zr(rn), Ln = ln;
      let On = rn === "value" ? Ln : fP(Ln);
      if (ft.attrName = Hn, ft.attrValue = On, ft.keepAttr = !0, ft.forceKeepAttr = void 0, Hr(Z.uponSanitizeAttribute, fe, ft), On = ft.attrValue, it && (Hn === "id" || Hn === "name") && h2(On, qt) !== 0 && (Jn(rn, fe), On = qt + On), Ve && CA(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, On)) {
        Jn(rn, fe);
        continue;
      }
      if (Hn === "attributename" && f2(On, "href")) {
        Jn(rn, fe);
        continue;
      }
      if (!ft.forceKeepAttr) {
        if (!ft.keepAttr) {
          Jn(rn, fe);
          continue;
        }
        if (!Dt && CA(LP, On)) {
          Jn(rn, fe);
          continue;
        }
        if (Ct && (On = wa(On)), !DA(zt, Hn, On)) {
          Jn(rn, fe);
          continue;
        }
        On = Za(zt, Hn, Gn, On), On !== Ln && ea(fe, rn, Gn, On);
      }
    }
    Hr(Z.afterSanitizeAttributes, fe, null);
  }, OA = function(fe) {
    let et = null;
    const ft = Xr(fe);
    for (Hr(Z.beforeSanitizeShadowDOM, fe, null); et = ft.nextNode(); )
      if (Hr(Z.uponSanitizeShadowNode, et, null), pA(et, fe), fs(et), ya(et.content) && OA(et.content), (B ? B(et) : et.nodeType) === _s.element) {
        const zt = k(et);
        ya(zt) && (Ha(zt), OA(zt));
      }
    Hr(Z.afterSanitizeShadowDOM, fe, null);
  }, Ha = function(fe) {
    const et = [{
      node: fe,
      shadow: null
    }];
    for (; et.length > 0; ) {
      const ft = et.pop();
      if (ft.shadow) {
        OA(ft.shadow);
        continue;
      }
      const Yt = ft.node, gr = (B ? B(Yt) : Yt.nodeType) === _s.element, rn = y(Yt);
      if (rn)
        for (let Gn = rn.length - 1; Gn >= 0; --Gn)
          et.push({
            node: rn[Gn],
            shadow: null
          });
      if (gr) {
        const Gn = O ? O(Yt) : null;
        if (typeof Gn == "string" && zr(Gn) === "template") {
          const ln = Yt.content;
          ya(ln) && et.push({
            node: ln,
            shadow: null
          });
        }
      }
      if (gr) {
        const Gn = k(Yt);
        ya(Gn) && et.push({
          node: null,
          shadow: Gn
        }, {
          node: Gn,
          shadow: null
        });
      }
    }
  };
  return t.sanitize = function(Wt) {
    let fe = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, et = null, ft = null, Yt = null, zt = null;
    if (jt = !Wt, jt && (Wt = "<!-->"), typeof Wt != "string" && !Ea(Wt) && (Wt = mP(Wt), typeof Wt != "string"))
      throw Yo("dirty is not a string, aborting");
    if (!t.isSupported)
      return Wt;
    K ? (De = X, nt = ke) : En(fe), (Z.uponSanitizeElement.length > 0 || Z.uponSanitizeAttribute.length > 0) && (De = os(De)), Z.uponSanitizeAttribute.length > 0 && (nt = os(nt)), t.removed = [];
    const gr = Nt && typeof Wt != "string" && Ea(Wt);
    if (gr) {
      Bn(Wt);
      const Hn = O ? O(Wt) : Wt.nodeName;
      if (typeof Hn == "string") {
        const Ln = zr(Hn);
        if (!De[Ln] || gt[Ln])
          throw rs(Wt), Yo("root node is forbidden and cannot be sanitized in-place");
      }
      if (bn(Wt))
        throw rs(Wt), Yo("root node is clobbered and cannot be sanitized in-place");
      try {
        Ha(Wt);
      } catch (Ln) {
        throw rs(Wt), Ln;
      }
    } else if (Ea(Wt))
      et = Zn("<!---->"), ft = et.ownerDocument.importNode(Wt, !0), ft.nodeType === _s.element && ft.nodeName === "BODY" || ft.nodeName === "HTML" ? et = ft : et.appendChild(ft), Ha(ft);
    else {
      if (!pt && !Ct && !ht && // eslint-disable-next-line unicorn/prefer-includes
      Wt.indexOf("<") === -1)
        return q && Ye ? E(Wt) : Wt;
      if (et = Zn(Wt), !et)
        return pt ? null : Ye ? G : "";
    }
    et && Je && sa(et.firstChild);
    const rn = gr ? Wt : et, Gn = Xr(rn);
    try {
      for (; Yt = Gn.nextNode(); )
        pA(Yt, rn), fs(Yt), ya(Yt.content) && OA(Yt.content);
    } catch (Hn) {
      throw gr && (rs(Wt), Ul(t.removed, (Ln) => {
        Ln.element && xa(Ln.element);
      })), Hn;
    }
    if (gr)
      return Ul(t.removed, (Hn) => {
        Hn.element && xa(Hn.element);
      }), Ct && Da(Wt), Wt;
    if (pt) {
      if (Ct && Da(et), Xe)
        for (zt = I.call(et.ownerDocument); et.firstChild; )
          zt.appendChild(et.firstChild);
      else
        zt = et;
      return (nt.shadowroot || nt.shadowrootmode) && (zt = se.call(r, zt, !0)), zt;
    }
    let ln = ht ? et.outerHTML : et.innerHTML;
    return ht && De["!doctype"] && et.ownerDocument && et.ownerDocument.doctype && et.ownerDocument.doctype.name && CA(SP, et.ownerDocument.doctype.name) && (ln = "<!DOCTYPE " + et.ownerDocument.doctype.name + `>
` + ln), Ct && (ln = wa(ln)), q && Ye ? E(ln) : ln;
  }, t.setConfig = function() {
    let Wt = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    En(Wt), K = !0, X = De, ke = nt;
  }, t.clearConfig = function() {
    Un = null, K = !1, X = null, ke = null, q = W, G = "";
  }, t.isValidAttribute = function(Wt, fe, et) {
    Un || En({});
    const ft = zr(Wt), Yt = zr(fe);
    return DA(ft, Yt, et);
  }, t.addHook = function(Wt, fe) {
    typeof fe == "function" && kA(Z, Wt) && Ll(Z[Wt], fe);
  }, t.removeHook = function(Wt, fe) {
    if (kA(Z, Wt)) {
      if (fe !== void 0) {
        const et = cP(Z[Wt], fe);
        return et === -1 ? void 0 : dP(Z[Wt], et, 1)[0];
      }
      return d2(Z[Wt]);
    }
  }, t.removeHooks = function(Wt) {
    kA(Z, Wt) && (Z[Wt] = []);
  }, t.removeAllHooks = function() {
    Z = k2();
  }, t;
}
var MP = bk();
const _P = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: MP
}, Symbol.toStringTag, { value: "Module" }));
var Jp = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function Ck(n) {
  return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
}
var T2 = {}, x2 = {}, ku, D2;
function va() {
  if (D2) return ku;
  D2 = 1;
  var n = function(t) {
    return t && t.Math === Math && t;
  };
  return ku = // eslint-disable-next-line es/no-global-this -- safe
  n(typeof globalThis == "object" && globalThis) || n(typeof window == "object" && window) || // eslint-disable-next-line no-restricted-globals -- safe
  n(typeof self == "object" && self) || n(typeof Jp == "object" && Jp) || n(typeof ku == "object" && ku) || // eslint-disable-next-line no-new-func -- fallback
  /* @__PURE__ */ (function() {
    return this;
  })() || Function("return this")(), ku;
}
var xh = {}, Dh, E2;
function Ra() {
  return E2 || (E2 = 1, Dh = function(n) {
    try {
      return !!n();
    } catch {
      return !0;
    }
  }), Dh;
}
var Eh, S2;
function wi() {
  if (S2) return Eh;
  S2 = 1;
  var n = Ra();
  return Eh = !n(function() {
    return Object.defineProperty({}, 1, { get: function() {
      return 7;
    } })[1] !== 7;
  }), Eh;
}
var Sh, F2;
function nf() {
  if (F2) return Sh;
  F2 = 1;
  var n = Ra();
  return Sh = !n(function() {
    var t = (function() {
    }).bind();
    return typeof t != "function" || t.hasOwnProperty("prototype");
  }), Sh;
}
var Fh, U2;
function HA() {
  if (U2) return Fh;
  U2 = 1;
  var n = nf(), t = Function.prototype.call;
  return Fh = n ? t.bind(t) : function() {
    return t.apply(t, arguments);
  }, Fh;
}
var Uh = {}, L2;
function RP() {
  if (L2) return Uh;
  L2 = 1;
  var n = {}.propertyIsEnumerable, t = Object.getOwnPropertyDescriptor, e = t && !n.call({ 1: 2 }, 1);
  return Uh.f = e ? function(a) {
    var A = t(this, a);
    return !!A && A.enumerable;
  } : n, Uh;
}
var Lh, I2;
function U0() {
  return I2 || (I2 = 1, Lh = function(n, t) {
    return {
      enumerable: !(n & 1),
      configurable: !(n & 2),
      writable: !(n & 4),
      value: t
    };
  }), Lh;
}
var Ih, Q2;
function Na() {
  if (Q2) return Ih;
  Q2 = 1;
  var n = nf(), t = Function.prototype, e = t.call, r = n && t.bind.bind(e, e);
  return Ih = n ? r : function(a) {
    return function() {
      return e.apply(a, arguments);
    };
  }, Ih;
}
var Qh, M2;
function hl() {
  if (M2) return Qh;
  M2 = 1;
  var n = Na(), t = n({}.toString), e = n("".slice);
  return Qh = function(r) {
    return e(t(r), 8, -1);
  }, Qh;
}
var Mh, _2;
function kk() {
  if (_2) return Mh;
  _2 = 1;
  var n = Na(), t = Ra(), e = hl(), r = Object, a = n("".split);
  return Mh = t(function() {
    return !r("z").propertyIsEnumerable(0);
  }) ? function(A) {
    return e(A) === "String" ? a(A, "") : r(A);
  } : r, Mh;
}
var _h, R2;
function af() {
  return R2 || (R2 = 1, _h = function(n) {
    return n == null;
  }), _h;
}
var Rh, N2;
function yi() {
  if (N2) return Rh;
  N2 = 1;
  var n = af(), t = TypeError;
  return Rh = function(e) {
    if (n(e)) throw new t("Can't call method on " + e);
    return e;
  }, Rh;
}
var Nh, H2;
function Zu() {
  if (H2) return Nh;
  H2 = 1;
  var n = kk(), t = yi();
  return Nh = function(e) {
    return n(t(e));
  }, Nh;
}
var Hh, O2;
function za() {
  if (O2) return Hh;
  O2 = 1;
  var n = typeof document == "object" && document.all;
  return Hh = typeof n > "u" && n !== void 0 ? function(t) {
    return typeof t == "function" || t === n;
  } : function(t) {
    return typeof t == "function";
  }, Hh;
}
var Oh, P2;
function xs() {
  if (P2) return Oh;
  P2 = 1;
  var n = za();
  return Oh = function(t) {
    return typeof t == "object" ? t !== null : n(t);
  }, Oh;
}
var Ph, W2;
function gl() {
  if (W2) return Ph;
  W2 = 1;
  var n = va(), t = za(), e = function(r) {
    return t(r) ? r : void 0;
  };
  return Ph = function(r, a) {
    return arguments.length < 2 ? e(n[r]) : n[r] && n[r][a];
  }, Ph;
}
var Wh, K2;
function Af() {
  if (K2) return Wh;
  K2 = 1;
  var n = Na();
  return Wh = n({}.isPrototypeOf), Wh;
}
var Kh, $2;
function ec() {
  if ($2) return Kh;
  $2 = 1;
  var n = va(), t = n.navigator, e = t && t.userAgent;
  return Kh = e ? String(e) : "", Kh;
}
var $h, V2;
function L0() {
  if (V2) return $h;
  V2 = 1;
  var n = va(), t = ec(), e = n.process, r = n.Deno, a = e && e.versions || r && r.version, A = a && a.v8, i, s;
  return A && (i = A.split("."), s = i[0] > 0 && i[0] < 4 ? 1 : +(i[0] + i[1])), !s && t && (i = t.match(/Edge\/(\d+)/), (!i || i[1] >= 74) && (i = t.match(/Chrome\/(\d+)/), i && (s = +i[1]))), $h = s, $h;
}
var Vh, q2;
function Tk() {
  if (q2) return Vh;
  q2 = 1;
  var n = L0(), t = Ra(), e = va(), r = e.String;
  return Vh = !!Object.getOwnPropertySymbols && !t(function() {
    var a = Symbol("symbol detection");
    return !r(a) || !(Object(a) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
    !Symbol.sham && n && n < 41;
  }), Vh;
}
var qh, j2;
function xk() {
  if (j2) return qh;
  j2 = 1;
  var n = Tk();
  return qh = n && !Symbol.sham && typeof Symbol.iterator == "symbol", qh;
}
var jh, Y2;
function Dk() {
  if (Y2) return jh;
  Y2 = 1;
  var n = gl(), t = za(), e = Af(), r = xk(), a = Object;
  return jh = r ? function(A) {
    return typeof A == "symbol";
  } : function(A) {
    var i = n("Symbol");
    return t(i) && e(i.prototype, a(A));
  }, jh;
}
var Yh, G2;
function sf() {
  if (G2) return Yh;
  G2 = 1;
  var n = String;
  return Yh = function(t) {
    try {
      return n(t);
    } catch {
      return "Object";
    }
  }, Yh;
}
var Gh, z2;
function lo() {
  if (z2) return Gh;
  z2 = 1;
  var n = za(), t = sf(), e = TypeError;
  return Gh = function(r) {
    if (n(r)) return r;
    throw new e(t(r) + " is not a function");
  }, Gh;
}
var zh, X2;
function tu() {
  if (X2) return zh;
  X2 = 1;
  var n = lo(), t = af();
  return zh = function(e, r) {
    var a = e[r];
    return t(a) ? void 0 : n(a);
  }, zh;
}
var Xh, J2;
function NP() {
  if (J2) return Xh;
  J2 = 1;
  var n = HA(), t = za(), e = xs(), r = TypeError;
  return Xh = function(a, A) {
    var i, s;
    if (A === "string" && t(i = a.toString) && !e(s = n(i, a)) || t(i = a.valueOf) && !e(s = n(i, a)) || A !== "string" && t(i = a.toString) && !e(s = n(i, a))) return s;
    throw new r("Can't convert object to primitive value");
  }, Xh;
}
var Jh = { exports: {} }, Zh, Z2;
function Hi() {
  return Z2 || (Z2 = 1, Zh = !1), Zh;
}
var eg, ey;
function I0() {
  if (ey) return eg;
  ey = 1;
  var n = va(), t = Object.defineProperty;
  return eg = function(e, r) {
    try {
      t(n, e, { value: r, configurable: !0, writable: !0 });
    } catch {
      n[e] = r;
    }
    return r;
  }, eg;
}
var ty;
function Q0() {
  if (ty) return Jh.exports;
  ty = 1;
  var n = Hi(), t = va(), e = I0(), r = "__core-js_shared__", a = Jh.exports = t[r] || e(r, {});
  return (a.versions || (a.versions = [])).push({
    version: "3.49.0",
    mode: n ? "pure" : "global",
    copyright: "© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",
    license: "https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE",
    source: "https://github.com/zloirock/core-js"
  }), Jh.exports;
}
var tg, ry;
function M0() {
  if (ry) return tg;
  ry = 1;
  var n = Q0();
  return tg = function(t, e) {
    return n[t] || (n[t] = e || {});
  }, tg;
}
var rg, ny;
function of() {
  if (ny) return rg;
  ny = 1;
  var n = yi(), t = Object;
  return rg = function(e) {
    return t(n(e));
  }, rg;
}
var ng, ay;
function Bi() {
  if (ay) return ng;
  ay = 1;
  var n = Na(), t = of(), e = n({}.hasOwnProperty);
  return ng = Object.hasOwn || function(a, A) {
    return e(t(a), A);
  }, ng;
}
var ag, Ay;
function Ek() {
  if (Ay) return ag;
  Ay = 1;
  var n = Na(), t = 0, e = Math.random(), r = n(1.1.toString);
  return ag = function(a) {
    return "Symbol(" + (a === void 0 ? "" : a) + ")_" + r(++t + e, 36);
  }, ag;
}
var Ag, sy;
function xA() {
  if (sy) return Ag;
  sy = 1;
  var n = va(), t = M0(), e = Bi(), r = Ek(), a = Tk(), A = xk(), i = n.Symbol, s = t("wks"), o = A ? i.for || i : i && i.withoutSetter || r;
  return Ag = function(l) {
    return e(s, l) || (s[l] = a && e(i, l) ? i[l] : o("Symbol." + l)), s[l];
  }, Ag;
}
var sg, iy;
function HP() {
  if (iy) return sg;
  iy = 1;
  var n = HA(), t = xs(), e = Dk(), r = tu(), a = NP(), A = xA(), i = TypeError, s = A("toPrimitive");
  return sg = function(o, l) {
    if (!t(o) || e(o)) return o;
    var u = r(o, s), f;
    if (u) {
      if (l === void 0 && (l = "default"), f = n(u, o, l), !t(f) || e(f)) return f;
      throw new i("Can't convert object to primitive value");
    }
    return l === void 0 && (l = "number"), a(o, l);
  }, sg;
}
var ig, oy;
function Sk() {
  if (oy) return ig;
  oy = 1;
  var n = HP(), t = Dk();
  return ig = function(e) {
    var r = n(e, "string");
    return t(r) ? r : r + "";
  }, ig;
}
var og, ly;
function lf() {
  if (ly) return og;
  ly = 1;
  var n = va(), t = xs(), e = n.document, r = t(e) && t(e.createElement);
  return og = function(a) {
    return r ? e.createElement(a) : {};
  }, og;
}
var lg, uy;
function Fk() {
  if (uy) return lg;
  uy = 1;
  var n = wi(), t = Ra(), e = lf();
  return lg = !n && !t(function() {
    return Object.defineProperty(e("div"), "a", {
      get: function() {
        return 7;
      }
    }).a !== 7;
  }), lg;
}
var cy;
function uf() {
  if (cy) return xh;
  cy = 1;
  var n = wi(), t = HA(), e = RP(), r = U0(), a = Zu(), A = Sk(), i = Bi(), s = Fk(), o = Object.getOwnPropertyDescriptor;
  return xh.f = n ? o : function(u, f) {
    if (u = a(u), f = A(f), s) try {
      return o(u, f);
    } catch {
    }
    if (i(u, f)) return r(!t(e.f, u, f), u[f]);
  }, xh;
}
var ug = {}, cg, dy;
function Uk() {
  if (dy) return cg;
  dy = 1;
  var n = wi(), t = Ra();
  return cg = n && t(function() {
    return Object.defineProperty(function() {
    }, "prototype", {
      value: 42,
      writable: !1
    }).prototype !== 42;
  }), cg;
}
var dg, fy;
function cs() {
  if (fy) return dg;
  fy = 1;
  var n = xs(), t = String, e = TypeError;
  return dg = function(r) {
    if (n(r)) return r;
    throw new e(t(r) + " is not an object");
  }, dg;
}
var hy;
function Oo() {
  if (hy) return ug;
  hy = 1;
  var n = wi(), t = Fk(), e = Uk(), r = cs(), a = Sk(), A = TypeError, i = Object.defineProperty, s = Object.getOwnPropertyDescriptor, o = "enumerable", l = "configurable", u = "writable";
  return ug.f = n ? e ? function(h, c, p) {
    if (r(h), c = a(c), r(p), typeof h == "function" && c === "prototype" && "value" in p && u in p && !p[u]) {
      var w = s(h, c);
      w && w[u] && (h[c] = p.value, p = {
        configurable: l in p ? p[l] : w[l],
        enumerable: o in p ? p[o] : w[o],
        writable: !1
      });
    }
    return i(h, c, p);
  } : i : function(h, c, p) {
    if (r(h), c = a(c), r(p), t) try {
      return i(h, c, p);
    } catch {
    }
    if ("get" in p || "set" in p) throw new A("Accessors not supported");
    return "value" in p && (h[c] = p.value), h;
  }, ug;
}
var fg, gy;
function tc() {
  if (gy) return fg;
  gy = 1;
  var n = wi(), t = Oo(), e = U0();
  return fg = n ? function(r, a, A) {
    return t.f(r, a, e(1, A));
  } : function(r, a, A) {
    return r[a] = A, r;
  }, fg;
}
var hg = { exports: {} }, gg, vy;
function cf() {
  if (vy) return gg;
  vy = 1;
  var n = wi(), t = Bi(), e = Function.prototype, r = n && Object.getOwnPropertyDescriptor, a = t(e, "name"), A = a && (function() {
  }).name === "something", i = a && (!n || n && r(e, "name").configurable);
  return gg = {
    EXISTS: a,
    PROPER: A,
    CONFIGURABLE: i
  }, gg;
}
var vg, py;
function _0() {
  if (py) return vg;
  py = 1;
  var n = Na(), t = za(), e = Q0(), r = n(Function.toString);
  return t(e.inspectSource) || (e.inspectSource = function(a) {
    return r(a);
  }), vg = e.inspectSource, vg;
}
var pg, my;
function OP() {
  if (my) return pg;
  my = 1;
  var n = va(), t = za(), e = n.WeakMap;
  return pg = t(e) && /native code/.test(String(e)), pg;
}
var mg, wy;
function R0() {
  if (wy) return mg;
  wy = 1;
  var n = M0(), t = Ek(), e = n("keys");
  return mg = function(r) {
    return e[r] || (e[r] = t(r));
  }, mg;
}
var wg, yy;
function N0() {
  return yy || (yy = 1, wg = {}), wg;
}
var yg, By;
function df() {
  if (By) return yg;
  By = 1;
  var n = OP(), t = va(), e = xs(), r = tc(), a = Bi(), A = Q0(), i = R0(), s = N0(), o = "Object already initialized", l = t.TypeError, u = t.WeakMap, f, h, c, p = function(k) {
    return c(k) ? h(k) : f(k, {});
  }, w = function(k) {
    return function(D) {
      var B;
      if (!e(D) || (B = h(D)).type !== k)
        throw new l("Incompatible receiver, " + k + " required");
      return B;
    };
  };
  if (n || A.state) {
    var y = A.state || (A.state = new u());
    y.get = y.get, y.has = y.has, y.set = y.set, f = function(k, D) {
      if (y.has(k)) throw new l(o);
      return D.facade = k, y.set(k, D), D;
    }, h = function(k) {
      return y.get(k) || {};
    }, c = function(k) {
      return y.has(k);
    };
  } else {
    var m = i("state");
    s[m] = !0, f = function(k, D) {
      if (a(k, m)) throw new l(o);
      return D.facade = k, r(k, m, D), D;
    }, h = function(k) {
      return a(k, m) ? k[m] : {};
    }, c = function(k) {
      return a(k, m);
    };
  }
  return yg = {
    set: f,
    get: h,
    has: c,
    enforce: p,
    getterFor: w
  }, yg;
}
var by;
function Lk() {
  if (by) return hg.exports;
  by = 1;
  var n = Na(), t = Ra(), e = za(), r = Bi(), a = wi(), A = cf().CONFIGURABLE, i = _0(), s = df(), o = s.enforce, l = s.get, u = String, f = Object.defineProperty, h = n("".slice), c = n("".replace), p = n([].join), w = a && !t(function() {
    return f(function() {
    }, "length", { value: 8 }).length !== 8;
  }), y = String(String).split("String"), m = hg.exports = function(k, D, B) {
    h(u(D), 0, 7) === "Symbol(" && (D = "[" + c(u(D), /^Symbol\(([^)]*)\).*$/, "$1") + "]"), B && B.getter && (D = "get " + D), B && B.setter && (D = "set " + D), (!r(k, "name") || A && k.name !== D) && (a ? f(k, "name", { value: D, configurable: !0 }) : k.name = D), w && B && r(B, "arity") && k.length !== B.arity && f(k, "length", { value: B.arity });
    try {
      B && r(B, "constructor") && B.constructor ? a && f(k, "prototype", { writable: !1 }) : k.prototype && (k.prototype = void 0);
    } catch {
    }
    var O = o(k);
    return r(O, "source") || (O.source = p(y, typeof D == "string" ? D : "")), k;
  };
  return Function.prototype.toString = m(function() {
    return e(this) && l(this).source || i(this);
  }, "toString"), hg.exports;
}
var Bg, Cy;
function vl() {
  if (Cy) return Bg;
  Cy = 1;
  var n = za(), t = Oo(), e = Lk(), r = I0();
  return Bg = function(a, A, i, s) {
    s || (s = {});
    var o = s.enumerable, l = s.name !== void 0 ? s.name : A;
    if (n(i) && e(i, l, s), s.global)
      o ? a[A] = i : r(A, i);
    else {
      try {
        s.unsafe ? a[A] && (o = !0) : delete a[A];
      } catch {
      }
      o ? a[A] = i : t.f(a, A, {
        value: i,
        enumerable: !1,
        configurable: !s.nonConfigurable,
        writable: !s.nonWritable
      });
    }
    return a;
  }, Bg;
}
var bg = {}, Cg, ky;
function PP() {
  if (ky) return Cg;
  ky = 1;
  var n = Math.ceil, t = Math.floor;
  return Cg = Math.trunc || function(r) {
    var a = +r;
    return (a > 0 ? t : n)(a);
  }, Cg;
}
var kg, Ty;
function ff() {
  if (Ty) return kg;
  Ty = 1;
  var n = PP();
  return kg = function(t) {
    var e = +t;
    return e !== e || e === 0 ? 0 : n(e);
  }, kg;
}
var Tg, xy;
function WP() {
  if (xy) return Tg;
  xy = 1;
  var n = ff(), t = Math.max, e = Math.min;
  return Tg = function(r, a) {
    var A = n(r);
    return A < 0 ? t(A + a, 0) : e(A, a);
  }, Tg;
}
var xg, Dy;
function ru() {
  if (Dy) return xg;
  Dy = 1;
  var n = ff(), t = Math.min;
  return xg = function(e) {
    var r = n(e);
    return r > 0 ? t(r, 9007199254740991) : 0;
  }, xg;
}
var Dg, Ey;
function H0() {
  if (Ey) return Dg;
  Ey = 1;
  var n = ru();
  return Dg = function(t) {
    return n(t.length);
  }, Dg;
}
var Eg, Sy;
function Ik() {
  if (Sy) return Eg;
  Sy = 1;
  var n = Zu(), t = WP(), e = H0(), r = function(a) {
    return function(A, i, s) {
      var o = n(A), l = e(o);
      if (l === 0) return !a && -1;
      var u = t(s, l), f;
      if (a && i !== i) {
        for (; l > u; )
          if (f = o[u++], f !== f) return !0;
      } else for (; l > u; u++)
        if ((a || u in o) && o[u] === i) return a || u || 0;
      return !a && -1;
    };
  };
  return Eg = {
    // `Array.prototype.includes` method
    // https://tc39.es/ecma262/#sec-array.prototype.includes
    includes: r(!0),
    // `Array.prototype.indexOf` method
    // https://tc39.es/ecma262/#sec-array.prototype.indexof
    indexOf: r(!1)
  }, Eg;
}
var Sg, Fy;
function Qk() {
  if (Fy) return Sg;
  Fy = 1;
  var n = Na(), t = Bi(), e = Zu(), r = Ik().indexOf, a = N0(), A = n([].push);
  return Sg = function(i, s) {
    var o = e(i), l = 0, u = [], f;
    for (f in o) !t(a, f) && t(o, f) && A(u, f);
    for (; s.length > l; ) t(o, f = s[l++]) && (~r(u, f) || A(u, f));
    return u;
  }, Sg;
}
var Fg, Uy;
function O0() {
  return Uy || (Uy = 1, Fg = [
    "constructor",
    "hasOwnProperty",
    "isPrototypeOf",
    "propertyIsEnumerable",
    "toLocaleString",
    "toString",
    "valueOf"
  ]), Fg;
}
var Ly;
function KP() {
  if (Ly) return bg;
  Ly = 1;
  var n = Qk(), t = O0(), e = t.concat("length", "prototype");
  return bg.f = Object.getOwnPropertyNames || function(a) {
    return n(a, e);
  }, bg;
}
var Ug = {}, Iy;
function $P() {
  return Iy || (Iy = 1, Ug.f = Object.getOwnPropertySymbols), Ug;
}
var Lg, Qy;
function VP() {
  if (Qy) return Lg;
  Qy = 1;
  var n = gl(), t = Na(), e = KP(), r = $P(), a = cs(), A = t([].concat);
  return Lg = n("Reflect", "ownKeys") || function(s) {
    var o = e.f(a(s)), l = r.f;
    return l ? A(o, l(s)) : o;
  }, Lg;
}
var Ig, My;
function qP() {
  if (My) return Ig;
  My = 1;
  var n = Bi(), t = VP(), e = uf(), r = Oo();
  return Ig = function(a, A, i) {
    for (var s = t(A), o = r.f, l = e.f, u = 0; u < s.length; u++) {
      var f = s[u];
      !n(a, f) && !(i && n(i, f)) && o(a, f, l(A, f));
    }
  }, Ig;
}
var Qg, _y;
function Mk() {
  if (_y) return Qg;
  _y = 1;
  var n = Ra(), t = za(), e = /#|\.prototype\./, r = function(o, l) {
    var u = A[a(o)];
    return u === s ? !0 : u === i ? !1 : t(l) ? n(l) : !!l;
  }, a = r.normalize = function(o) {
    return String(o).replace(e, ".").toLowerCase();
  }, A = r.data = {}, i = r.NATIVE = "N", s = r.POLYFILL = "P";
  return Qg = r, Qg;
}
var Mg, Ry;
function ds() {
  if (Ry) return Mg;
  Ry = 1;
  var n = va(), t = uf().f, e = tc(), r = vl(), a = I0(), A = qP(), i = Mk();
  return Mg = function(s, o) {
    var l = s.target, u = s.global, f = s.stat, h, c, p, w, y, m;
    if (u ? c = n : f ? c = n[l] || a(l, {}) : c = n[l] && n[l].prototype, c) for (p in o) {
      if (y = o[p], s.dontCallGetSet ? (m = t(c, p), w = m && m.value) : w = c[p], h = i(u ? p : l + (f ? "." : "#") + p, s.forced), !h && w !== void 0) {
        if (typeof y == typeof w) continue;
        A(y, w);
      }
      (s.sham || w && w.sham) && e(y, "sham", !0), r(c, p, y, s);
    }
  }, Mg;
}
var _g, Ny;
function _k() {
  if (Ny) return _g;
  Ny = 1;
  var n = va(), t = ec(), e = hl(), r = function(a) {
    return t.slice(0, a.length) === a;
  };
  return _g = (function() {
    return r("Bun/") ? "BUN" : r("Cloudflare-Workers") ? "CLOUDFLARE" : r("Deno/") ? "DENO" : r("Node.js/") ? "NODE" : n.Bun && typeof Bun.version == "string" ? "BUN" : n.Deno && typeof Deno.version == "object" ? "DENO" : e(n.process) === "process" ? "NODE" : n.window && n.document ? "BROWSER" : "REST";
  })(), _g;
}
var Rg, Hy;
function hf() {
  if (Hy) return Rg;
  Hy = 1;
  var n = _k();
  return Rg = n === "NODE", Rg;
}
var Ng, Oy;
function jP() {
  if (Oy) return Ng;
  Oy = 1;
  var n = va();
  return Ng = n, Ng;
}
var Hg, Py;
function YP() {
  if (Py) return Hg;
  Py = 1;
  var n = Na(), t = lo();
  return Hg = function(e, r, a) {
    try {
      return n(t(Object.getOwnPropertyDescriptor(e, r)[a]));
    } catch {
    }
  }, Hg;
}
var Og, Wy;
function GP() {
  if (Wy) return Og;
  Wy = 1;
  var n = xs();
  return Og = function(t) {
    return n(t) || t === null;
  }, Og;
}
var Pg, Ky;
function zP() {
  if (Ky) return Pg;
  Ky = 1;
  var n = GP(), t = String, e = TypeError;
  return Pg = function(r) {
    if (n(r)) return r;
    throw new e("Can't set " + t(r) + " as a prototype");
  }, Pg;
}
var Wg, $y;
function Rk() {
  if ($y) return Wg;
  $y = 1;
  var n = YP(), t = xs(), e = yi(), r = zP();
  return Wg = Object.setPrototypeOf || ("__proto__" in {} ? (function() {
    var a = !1, A = {}, i;
    try {
      i = n(Object.prototype, "__proto__", "set"), i(A, []), a = A instanceof Array;
    } catch {
    }
    return function(o, l) {
      return e(o), r(l), t(o) && (a ? i(o, l) : o.__proto__ = l), o;
    };
  })() : void 0), Wg;
}
var Kg, Vy;
function gf() {
  if (Vy) return Kg;
  Vy = 1;
  var n = Oo().f, t = Bi(), e = xA(), r = e("toStringTag");
  return Kg = function(a, A, i) {
    a && !i && (a = a.prototype), a && !t(a, r) && n(a, r, { configurable: !0, value: A });
  }, Kg;
}
var $g, qy;
function XP() {
  if (qy) return $g;
  qy = 1;
  var n = Lk(), t = Oo();
  return $g = function(e, r, a) {
    return a.get && n(a.get, r, { getter: !0 }), a.set && n(a.set, r, { setter: !0 }), t.f(e, r, a);
  }, $g;
}
var Vg, jy;
function JP() {
  if (jy) return Vg;
  jy = 1;
  var n = gl(), t = XP(), e = xA(), r = wi(), a = e("species");
  return Vg = function(A) {
    var i = n(A);
    r && i && !i[a] && t(i, a, {
      configurable: !0,
      get: function() {
        return this;
      }
    });
  }, Vg;
}
var qg, Yy;
function ZP() {
  if (Yy) return qg;
  Yy = 1;
  var n = Af(), t = TypeError;
  return qg = function(e, r) {
    if (n(r, e)) return e;
    throw new t("Incorrect invocation");
  }, qg;
}
var jg, Gy;
function e7() {
  if (Gy) return jg;
  Gy = 1;
  var n = xA(), t = n("toStringTag"), e = {};
  return e[t] = "z", jg = String(e) === "[object z]", jg;
}
var Yg, zy;
function P0() {
  if (zy) return Yg;
  zy = 1;
  var n = e7(), t = za(), e = hl(), r = xA(), a = r("toStringTag"), A = Object, i = e(/* @__PURE__ */ (function() {
    return arguments;
  })()) === "Arguments", s = function(o, l) {
    try {
      return o[l];
    } catch {
    }
  };
  return Yg = n ? e : function(o) {
    var l, u, f;
    return o === void 0 ? "Undefined" : o === null ? "Null" : typeof (u = s(l = A(o), a)) == "string" ? u : i ? e(l) : (f = e(l)) === "Object" && t(l.callee) ? "Arguments" : f;
  }, Yg;
}
var Gg, Xy;
function t7() {
  if (Xy) return Gg;
  Xy = 1;
  var n = Na(), t = Ra(), e = za(), r = P0(), a = gl(), A = _0(), i = function() {
  }, s = a("Reflect", "construct"), o = /^\s*(?:class|function)\b/, l = n(o.exec), u = !o.test(i), f = function(p) {
    if (!e(p)) return !1;
    try {
      return s(i, [], p), !0;
    } catch {
      return !1;
    }
  }, h = function(p) {
    if (!e(p)) return !1;
    switch (r(p)) {
      case "AsyncFunction":
      case "GeneratorFunction":
      case "AsyncGeneratorFunction":
        return !1;
    }
    try {
      return u || !!l(o, A(p));
    } catch {
      return !0;
    }
  };
  return h.sham = !0, Gg = !s || t(function() {
    var c;
    return f(f.call) || !f(Object) || !f(function() {
      c = !0;
    }) || c;
  }) ? h : f, Gg;
}
var zg, Jy;
function r7() {
  if (Jy) return zg;
  Jy = 1;
  var n = t7(), t = sf(), e = TypeError;
  return zg = function(r) {
    if (n(r)) return r;
    throw new e(t(r) + " is not a constructor");
  }, zg;
}
var Xg, Zy;
function Nk() {
  if (Zy) return Xg;
  Zy = 1;
  var n = cs(), t = r7(), e = af(), r = xA(), a = r("species");
  return Xg = function(A, i) {
    var s = n(A).constructor, o;
    return s === void 0 || e(o = n(s)[a]) ? i : t(o);
  }, Xg;
}
var Jg, eB;
function Hk() {
  if (eB) return Jg;
  eB = 1;
  var n = nf(), t = Function.prototype, e = t.apply, r = t.call;
  return Jg = typeof Reflect == "object" && Reflect.apply || (n ? r.bind(e) : function() {
    return r.apply(e, arguments);
  }), Jg;
}
var Zg, tB;
function vf() {
  if (tB) return Zg;
  tB = 1;
  var n = hl(), t = Na();
  return Zg = function(e) {
    if (n(e) === "Function") return t(e);
  }, Zg;
}
var ev, rB;
function W0() {
  if (rB) return ev;
  rB = 1;
  var n = vf(), t = lo(), e = nf(), r = n(n.bind);
  return ev = function(a, A) {
    return t(a), A === void 0 ? a : e ? r(a, A) : function() {
      return a.apply(A, arguments);
    };
  }, ev;
}
var tv, nB;
function Ok() {
  if (nB) return tv;
  nB = 1;
  var n = gl();
  return tv = n("document", "documentElement"), tv;
}
var rv, aB;
function n7() {
  if (aB) return rv;
  aB = 1;
  var n = Na();
  return rv = n([].slice), rv;
}
var nv, AB;
function a7() {
  if (AB) return nv;
  AB = 1;
  var n = TypeError;
  return nv = function(t, e) {
    if (t < e) throw new n("Not enough arguments");
    return t;
  }, nv;
}
var av, sB;
function Pk() {
  if (sB) return av;
  sB = 1;
  var n = ec();
  return av = /ipad|iphone|ipod/i.test(n) && /applewebkit/i.test(n), av;
}
var Av, iB;
function Wk() {
  if (iB) return Av;
  iB = 1;
  var n = va(), t = Hk(), e = W0(), r = za(), a = Bi(), A = Ra(), i = Ok(), s = n7(), o = lf(), l = a7(), u = Pk(), f = hf(), h = n.setImmediate, c = n.clearImmediate, p = n.process, w = n.Dispatch, y = n.Function, m = n.MessageChannel, k = n.String, D = 0, B = {}, O = "onreadystatechange", q, G, W, F;
  A(function() {
    q = n.location;
  });
  var Y = function(x) {
    if (a(B, x)) {
      var oe = B[x];
      delete B[x], oe();
    }
  }, T = function(x) {
    return function() {
      Y(x);
    };
  }, E = function(x) {
    Y(x.data);
  }, Q = function(x) {
    n.postMessage(k(x), q.protocol + "//" + q.host);
  };
  return (!h || !c) && (h = function(oe) {
    l(arguments.length, 1);
    var J = r(oe) ? oe : y(oe), S = s(arguments, 1);
    return B[++D] = function() {
      t(J, void 0, S);
    }, G(D), D;
  }, c = function(oe) {
    delete B[oe];
  }, f ? G = function(x) {
    p.nextTick(T(x));
  } : w && w.now ? G = function(x) {
    w.now(T(x));
  } : m && !u ? (W = new m(), F = W.port2, W.port1.onmessage = E, G = e(F.postMessage, F)) : n.addEventListener && r(n.postMessage) && !n.importScripts && q && q.protocol !== "file:" && !A(Q) ? (G = Q, n.addEventListener("message", E, !1)) : O in o("script") ? G = function(x) {
    i.appendChild(o("script"))[O] = function() {
      i.removeChild(this), Y(x);
    };
  } : G = function(x) {
    setTimeout(T(x), 0);
  }), Av = {
    set: h,
    clear: c
  }, Av;
}
var sv, oB;
function A7() {
  if (oB) return sv;
  oB = 1;
  var n = va(), t = wi(), e = Object.getOwnPropertyDescriptor;
  return sv = function(r) {
    if (!t) return n[r];
    var a = e(n, r);
    return a && a.value;
  }, sv;
}
var iv, lB;
function Kk() {
  if (lB) return iv;
  lB = 1;
  var n = function() {
    this.head = null, this.tail = null;
  };
  return n.prototype = {
    add: function(t) {
      var e = { item: t, next: null }, r = this.tail;
      r ? r.next = e : this.head = e, this.tail = e;
    },
    get: function() {
      var t = this.head;
      if (t) {
        var e = this.head = t.next;
        return e === null && (this.tail = null), t.item;
      }
    }
  }, iv = n, iv;
}
var ov, uB;
function s7() {
  if (uB) return ov;
  uB = 1;
  var n = ec();
  return ov = /ipad|iphone|ipod/i.test(n) && typeof Pebble < "u", ov;
}
var lv, cB;
function i7() {
  if (cB) return lv;
  cB = 1;
  var n = ec();
  return lv = /web0s(?!.*chrome)/i.test(n), lv;
}
var uv, dB;
function o7() {
  if (dB) return uv;
  dB = 1;
  var n = va(), t = A7(), e = W0(), r = Wk().set, a = Kk(), A = Pk(), i = s7(), s = i7(), o = hf(), l = n.MutationObserver || n.WebKitMutationObserver, u = n.document, f = n.process, h = n.Promise, c = t("queueMicrotask"), p, w, y, m, k;
  if (!c) {
    var D = new a(), B = function() {
      var O, q;
      for (o && (O = f.domain) && O.exit(); q = D.get(); ) try {
        q();
      } catch (G) {
        throw D.head && p(), G;
      }
      O && O.enter();
    };
    !A && !o && !s && l && u ? (w = !0, y = u.createTextNode(""), new l(B).observe(y, { characterData: !0 }), p = function() {
      y.data = w = !w;
    }) : !i && h && h.resolve ? (m = h.resolve(void 0), m.constructor = h, k = e(m.then, m), p = function() {
      k(B);
    }) : o ? p = function() {
      f.nextTick(B);
    } : (r = e(r, n), p = function() {
      r(B);
    }), c = function(O) {
      D.head || p(), D.add(O);
    };
  }
  return uv = c, uv;
}
var cv, fB;
function l7() {
  return fB || (fB = 1, cv = function(n, t) {
    try {
      arguments.length === 1 ? console.error(n) : console.error(n, t);
    } catch {
    }
  }), cv;
}
var dv, hB;
function K0() {
  return hB || (hB = 1, dv = function(n) {
    try {
      return { error: !1, value: n() };
    } catch (t) {
      return { error: !0, value: t };
    }
  }), dv;
}
var fv, gB;
function rc() {
  if (gB) return fv;
  gB = 1;
  var n = va();
  return fv = n.Promise, fv;
}
var hv, vB;
function nc() {
  if (vB) return hv;
  vB = 1;
  var n = va(), t = rc(), e = za(), r = Mk(), a = _0(), A = xA(), i = _k(), s = Hi(), o = L0(), l = t && t.prototype, u = A("species"), f = !1, h = e(n.PromiseRejectionEvent), c = r("Promise", function() {
    var p = a(t), w = p !== String(t);
    if (!w && o === 66 || s && !(l.catch && l.finally)) return !0;
    if (!o || o < 51 || !/native code/.test(p)) {
      var y = new t(function(D) {
        D(1);
      }), m = function(D) {
        D(function() {
        }, function() {
        });
      }, k = y.constructor = {};
      if (k[u] = m, f = y.then(function() {
      }) instanceof m, !f) return !0;
    }
    return !w && (i === "BROWSER" || i === "DENO") && !h;
  });
  return hv = {
    CONSTRUCTOR: c,
    REJECTION_EVENT: h,
    SUBCLASSING: f
  }, hv;
}
var gv = {}, pB;
function ac() {
  if (pB) return gv;
  pB = 1;
  var n = lo(), t = TypeError, e = function(r) {
    var a, A;
    this.promise = new r(function(i, s) {
      if (a !== void 0 || A !== void 0) throw new t("Bad Promise constructor");
      a = i, A = s;
    }), this.resolve = n(a), this.reject = n(A);
  };
  return gv.f = function(r) {
    return new e(r);
  }, gv;
}
var mB;
function u7() {
  if (mB) return x2;
  mB = 1;
  var n = ds(), t = Hi(), e = hf(), r = va(), a = jP(), A = HA(), i = vl(), s = Rk(), o = gf(), l = JP(), u = lo(), f = za(), h = xs(), c = ZP(), p = Nk(), w = Wk().set, y = o7(), m = l7(), k = K0(), D = Kk(), B = df(), O = rc(), q = nc(), G = ac(), W = "Promise", F = q.CONSTRUCTOR, Y = q.REJECTION_EVENT, T = q.SUBCLASSING, E = B.getterFor(W), Q = B.set, x = O && O.prototype, oe = O, J = x, S = r.TypeError, I = r.document, N = r.process, se = G.f, Z = se, C = !!(I && I.createEvent && r.dispatchEvent), H = "unhandledrejection", M = "rejectionhandled", te = 0, ie = 1, we = 2, ve = 1, le = 2, _e, De, ze, nt, Qe = function(Ve) {
    var ht;
    return h(Ve) && f(ht = Ve.then) ? ht : !1;
  }, ne = function(Ve, ht) {
    var K = ht.value, X = ht.state === ie, ke = X ? Ve.ok : Ve.fail, Je = Ve.resolve, pt = Ve.reject, Xe = Ve.domain, Ye, Kt, it;
    try {
      ke ? (X || (ht.rejection === le && It(ht), ht.rejection = ve), ke === !0 ? Ye = K : (Xe && Xe.enter(), Ye = ke(K), Xe && (Xe.exit(), it = !0)), Ye === Ve.promise ? pt(new S("Promise-chain cycle")) : (Kt = Qe(Ye)) ? A(Kt, Ye, Je, pt) : Je(Ye)) : pt(K);
    } catch (qt) {
      Xe && !it && Xe.exit(), pt(qt);
    }
  }, gt = function(Ve, ht) {
    Ve.notified || (Ve.notified = !0, y(function() {
      for (var K = Ve.reactions, X; X = K.get(); )
        ne(X, Ve);
      Ve.notified = !1, ht && !Ve.rejection && ot(Ve);
    }));
  }, je = function(Ve, ht, K) {
    var X, ke;
    C ? (X = I.createEvent("Event"), X.promise = ht, X.reason = K, X.initEvent(Ve, !1, !0), r.dispatchEvent(X)) : X = { promise: ht, reason: K }, !Y && (ke = r["on" + Ve]) ? ke(X) : Ve === H && m("Unhandled promise rejection", K);
  }, ot = function(Ve) {
    A(w, r, function() {
      var ht = Ve.facade, K = Ve.value, X = Ie(Ve), ke;
      if (X && (ke = k(function() {
        e ? N.emit("unhandledRejection", K, ht) : je(H, ht, K);
      }), Ve.rejection = e || Ie(Ve) ? le : ve, ke.error))
        throw ke.value;
    });
  }, Ie = function(Ve) {
    return Ve.rejection !== ve && !Ve.parent;
  }, It = function(Ve) {
    A(w, r, function() {
      var ht = Ve.facade;
      e ? N.emit("rejectionHandled", ht) : je(M, ht, Ve.value);
    });
  }, dt = function(Ve, ht, K) {
    return function(X) {
      Ve(ht, X, K);
    };
  }, Dt = function(Ve, ht, K) {
    Ve.done || (Ve.done = !0, K && (Ve = K), Ve.value = ht, Ve.state = we, gt(Ve, !0));
  }, Ct = function(Ve, ht, K) {
    if (!Ve.done) {
      Ve.done = !0, K && (Ve = K);
      try {
        if (Ve.facade === ht) throw new S("Promise can't be resolved itself");
        var X = Qe(ht);
        X ? y(function() {
          var ke = { done: !1 };
          try {
            A(
              X,
              ht,
              dt(Ct, ke, Ve),
              dt(Dt, ke, Ve)
            );
          } catch (Je) {
            Dt(ke, Je, Ve);
          }
        }) : (Ve.value = ht, Ve.state = ie, gt(Ve, !1));
      } catch (ke) {
        Dt({ done: !1 }, ke, Ve);
      }
    }
  };
  if (F && (oe = function(ht) {
    c(this, J), u(ht), A(_e, this);
    var K = E(this);
    try {
      ht(dt(Ct, K), dt(Dt, K));
    } catch (X) {
      Dt(K, X);
    }
  }, J = oe.prototype, _e = function(ht) {
    Q(this, {
      type: W,
      done: !1,
      notified: !1,
      parent: !1,
      reactions: new D(),
      rejection: !1,
      state: te,
      value: null
    });
  }, _e.prototype = i(J, "then", function(ht, K) {
    var X = E(this), ke = se(p(this, oe));
    return X.parent = !0, ke.ok = f(ht) ? ht : !0, ke.fail = f(K) && K, ke.domain = e ? N.domain : void 0, X.state === te ? X.reactions.add(ke) : y(function() {
      ne(ke, X);
    }), ke.promise;
  }), De = function() {
    var Ve = new _e(), ht = E(Ve);
    this.promise = Ve, this.resolve = dt(Ct, ht), this.reject = dt(Dt, ht);
  }, G.f = se = function(Ve) {
    return Ve === oe || Ve === ze ? new De(Ve) : Z(Ve);
  }, !t && f(O) && x !== Object.prototype)) {
    nt = x.then, T || i(x, "then", function(ht, K) {
      var X = this;
      return new oe(function(ke, Je) {
        A(nt, X, ke, Je);
      }).then(ht, K);
    }, { unsafe: !0 });
    try {
      delete x.constructor;
    } catch {
    }
    s && s(x, J);
  }
  return n({ global: !0, constructor: !0, wrap: !0, forced: F }, {
    Promise: oe
  }), ze = a.Promise, o(oe, W, !1, !0), l(W), x2;
}
var wB = {}, vv, yB;
function Ac() {
  return yB || (yB = 1, vv = {}), vv;
}
var pv, BB;
function c7() {
  if (BB) return pv;
  BB = 1;
  var n = xA(), t = Ac(), e = n("iterator"), r = Array.prototype;
  return pv = function(a) {
    return a !== void 0 && (t.Array === a || r[e] === a);
  }, pv;
}
var mv, bB;
function $k() {
  if (bB) return mv;
  bB = 1;
  var n = P0(), t = tu(), e = af(), r = Ac(), a = xA(), A = a("iterator");
  return mv = function(i) {
    if (!e(i)) return t(i, A) || t(i, "@@iterator") || r[n(i)];
  }, mv;
}
var wv, CB;
function d7() {
  if (CB) return wv;
  CB = 1;
  var n = HA(), t = lo(), e = cs(), r = sf(), a = $k(), A = TypeError;
  return wv = function(i, s) {
    var o = arguments.length < 2 ? a(i) : s;
    if (t(o)) return e(n(o, i));
    throw new A(r(i) + " is not iterable");
  }, wv;
}
var yv, kB;
function f7() {
  if (kB) return yv;
  kB = 1;
  var n = HA(), t = cs(), e = tu();
  return yv = function(r, a, A) {
    var i, s;
    t(r);
    try {
      if (i = e(r, "return"), !i) {
        if (a === "throw") throw A;
        return A;
      }
      i = n(i, r);
    } catch (o) {
      s = !0, i = o;
    }
    if (a === "throw") throw A;
    if (s) throw i;
    return t(i), A;
  }, yv;
}
var Bv, TB;
function Vk() {
  if (TB) return Bv;
  TB = 1;
  var n = W0(), t = HA(), e = cs(), r = sf(), a = c7(), A = H0(), i = Af(), s = d7(), o = $k(), l = f7(), u = TypeError, f = function(c, p) {
    this.stopped = c, this.result = p;
  }, h = f.prototype;
  return Bv = function(c, p, w) {
    var y = w && w.that, m = !!(w && w.AS_ENTRIES), k = !!(w && w.IS_RECORD), D = !!(w && w.IS_ITERATOR), B = !!(w && w.INTERRUPTED), O = n(p, y), q, G, W, F, Y, T, E, Q = function(J) {
      var S = q;
      return q = void 0, S && l(S, "normal"), new f(!0, J);
    }, x = function(J) {
      return m ? (e(J), B ? O(J[0], J[1], Q) : O(J[0], J[1])) : B ? O(J, Q) : O(J);
    };
    if (k)
      q = c.iterator;
    else if (D)
      q = c;
    else {
      if (G = o(c), !G) throw new u(r(c) + " is not iterable");
      if (a(G)) {
        for (W = 0, F = A(c); F > W; W++)
          if (Y = x(c[W]), Y && i(h, Y)) return Y;
        return new f(!1);
      }
      q = s(c, G);
    }
    for (T = k ? c.next : q.next; !(E = t(T, q)).done; ) {
      var oe = E.value;
      try {
        Y = x(oe);
      } catch (J) {
        if (q) l(q, "throw", J);
        else throw J;
      }
      if (typeof Y == "object" && Y && i(h, Y)) return Y;
    }
    return new f(!1);
  }, Bv;
}
var bv, xB;
function h7() {
  if (xB) return bv;
  xB = 1;
  var n = xA(), t = n("iterator"), e = !1;
  try {
    var r = 0, a = {
      next: function() {
        return { done: !!r++ };
      },
      return: function() {
        e = !0;
      }
    };
    a[t] = function() {
      return this;
    }, Array.from(a, function() {
      throw 2;
    });
  } catch {
  }
  return bv = function(A, i) {
    try {
      if (!i && !e) return !1;
    } catch {
      return !1;
    }
    var s = !1;
    try {
      var o = {};
      o[t] = function() {
        return {
          next: function() {
            return { done: s = !0 };
          }
        };
      }, A(o);
    } catch {
    }
    return s;
  }, bv;
}
var Cv, DB;
function qk() {
  if (DB) return Cv;
  DB = 1;
  var n = rc(), t = h7(), e = nc().CONSTRUCTOR;
  return Cv = e || !t(function(r) {
    n.all(r).then(void 0, function() {
    });
  }), Cv;
}
var EB;
function g7() {
  if (EB) return wB;
  EB = 1;
  var n = ds(), t = HA(), e = lo(), r = ac(), a = K0(), A = Vk(), i = qk();
  return n({ target: "Promise", stat: !0, forced: i }, {
    all: function(o) {
      var l = this, u = r.f(l), f = u.resolve, h = u.reject, c = a(function() {
        var p = e(l.resolve), w = [], y = 0, m = 1;
        A(o, function(k) {
          var D = y++, B = !1;
          m++, t(p, l, k).then(function(O) {
            B || (B = !0, w[D] = O, --m || f(w));
          }, h);
        }), --m || f(w);
      });
      return c.error && h(c.value), u.promise;
    }
  }), wB;
}
var SB = {}, FB;
function v7() {
  if (FB) return SB;
  FB = 1;
  var n = ds(), t = Hi(), e = nc().CONSTRUCTOR, r = rc(), a = gl(), A = za(), i = vl(), s = r && r.prototype;
  if (n({ target: "Promise", proto: !0, forced: e, real: !0 }, {
    catch: function(l) {
      return this.then(void 0, l);
    }
  }), !t && A(r)) {
    var o = a("Promise").prototype.catch;
    s.catch !== o && i(s, "catch", o, { unsafe: !0 });
  }
  return SB;
}
var UB = {}, LB;
function p7() {
  if (LB) return UB;
  LB = 1;
  var n = ds(), t = HA(), e = lo(), r = ac(), a = K0(), A = Vk(), i = qk();
  return n({ target: "Promise", stat: !0, forced: i }, {
    race: function(o) {
      var l = this, u = r.f(l), f = u.reject, h = a(function() {
        var c = e(l.resolve);
        A(o, function(p) {
          t(c, l, p).then(u.resolve, f);
        });
      });
      return h.error && f(h.value), u.promise;
    }
  }), UB;
}
var IB = {}, QB;
function m7() {
  if (QB) return IB;
  QB = 1;
  var n = ds(), t = ac(), e = nc().CONSTRUCTOR;
  return n({ target: "Promise", stat: !0, forced: e }, {
    reject: function(a) {
      var A = t.f(this), i = A.reject;
      return i(a), A.promise;
    }
  }), IB;
}
var MB = {}, kv, _B;
function w7() {
  if (_B) return kv;
  _B = 1;
  var n = cs(), t = xs(), e = ac();
  return kv = function(r, a) {
    if (n(r), t(a) && a.constructor === r) return a;
    var A = e.f(r), i = A.resolve;
    return i(a), A.promise;
  }, kv;
}
var RB;
function y7() {
  if (RB) return MB;
  RB = 1;
  var n = ds(), t = gl(), e = Hi(), r = rc(), a = nc().CONSTRUCTOR, A = w7(), i = t("Promise"), s = e && !a;
  return n({ target: "Promise", stat: !0, forced: e || a }, {
    resolve: function(l) {
      return A(s && this === i ? r : this, l);
    }
  }), MB;
}
var NB;
function B7() {
  return NB || (NB = 1, u7(), g7(), v7(), p7(), m7(), y7()), T2;
}
B7();
function HB(n, t, e, r, a, A, i) {
  try {
    var s = n[A](i), o = s.value;
  } catch (l) {
    return void e(l);
  }
  s.done ? t(o) : Promise.resolve(o).then(r, a);
}
function io(n) {
  return function() {
    var t = this, e = arguments;
    return new Promise(function(r, a) {
      var A = n.apply(t, e);
      function i(o) {
        HB(A, r, a, i, s, "next", o);
      }
      function s(o) {
        HB(A, r, a, i, s, "throw", o);
      }
      i(void 0);
    });
  };
}
var OB = {}, PB = {}, Tv, WB;
function Oi() {
  if (WB) return Tv;
  WB = 1;
  var n = P0(), t = String;
  return Tv = function(e) {
    if (n(e) === "Symbol") throw new TypeError("Cannot convert a Symbol value to a string");
    return t(e);
  }, Tv;
}
var xv, KB;
function jk() {
  if (KB) return xv;
  KB = 1;
  var n = cs();
  return xv = function() {
    var t = n(this), e = "";
    return t.hasIndices && (e += "d"), t.global && (e += "g"), t.ignoreCase && (e += "i"), t.multiline && (e += "m"), t.dotAll && (e += "s"), t.unicode && (e += "u"), t.unicodeSets && (e += "v"), t.sticky && (e += "y"), e;
  }, xv;
}
var Dv, $B;
function Yk() {
  if ($B) return Dv;
  $B = 1;
  var n = Ra(), t = va(), e = t.RegExp, r = n(function() {
    var i = e("a", "y");
    return i.lastIndex = 2, i.exec("abcd") !== null;
  }), a = r || n(function() {
    return !e("a", "y").sticky;
  }), A = r || n(function() {
    var i = e("^r", "gy");
    return i.lastIndex = 2, i.exec("str") !== null;
  });
  return Dv = {
    BROKEN_CARET: A,
    MISSED_STICKY: a,
    UNSUPPORTED_Y: r
  }, Dv;
}
var Ev = {}, Sv, VB;
function b7() {
  if (VB) return Sv;
  VB = 1;
  var n = Qk(), t = O0();
  return Sv = Object.keys || function(r) {
    return n(r, t);
  }, Sv;
}
var qB;
function C7() {
  if (qB) return Ev;
  qB = 1;
  var n = wi(), t = Uk(), e = Oo(), r = cs(), a = Zu(), A = b7();
  return Ev.f = n && !t ? Object.defineProperties : function(s, o) {
    r(s);
    for (var l = a(o), u = A(o), f = u.length, h = 0, c; f > h; ) e.f(s, c = u[h++], l[c]);
    return s;
  }, Ev;
}
var Fv, jB;
function pf() {
  if (jB) return Fv;
  jB = 1;
  var n = cs(), t = C7(), e = O0(), r = N0(), a = Ok(), A = lf(), i = R0(), s = ">", o = "<", l = "prototype", u = "script", f = i("IE_PROTO"), h = function() {
  }, c = function(k) {
    return o + u + s + k + o + "/" + u + s;
  }, p = function(k) {
    k.write(c("")), k.close();
    var D = k.parentWindow.Object;
    return k = null, D;
  }, w = function() {
    var k = A("iframe"), D = "java" + u + ":", B;
    return k.style.display = "none", a.appendChild(k), k.src = String(D), B = k.contentWindow.document, B.open(), B.write(c("document.F=Object")), B.close(), B.F;
  }, y, m = function() {
    try {
      y = new ActiveXObject("htmlfile");
    } catch {
    }
    m = typeof document < "u" ? document.domain && y ? p(y) : w() : p(y);
    for (var k = e.length; k--; ) delete m[l][e[k]];
    return m();
  };
  return r[f] = !0, Fv = Object.create || function(D, B) {
    var O;
    return D !== null ? (h[l] = n(D), O = new h(), h[l] = null, O[f] = D) : O = m(), B === void 0 ? O : t.f(O, B);
  }, Fv;
}
var Uv, YB;
function k7() {
  if (YB) return Uv;
  YB = 1;
  var n = Ra(), t = va(), e = t.RegExp;
  return Uv = n(function() {
    var r = e(".", "s");
    return !(r.dotAll && r.test(`
`) && r.flags === "s");
  }), Uv;
}
var Lv, GB;
function T7() {
  if (GB) return Lv;
  GB = 1;
  var n = Ra(), t = va(), e = t.RegExp;
  return Lv = n(function() {
    var r = e("(?<a>b)", "g");
    return r.exec("b").groups.a !== "b" || "b".replace(r, "$<a>c") !== "bc";
  }), Lv;
}
var Iv, zB;
function $0() {
  if (zB) return Iv;
  zB = 1;
  var n = HA(), t = Na(), e = Oi(), r = jk(), a = Yk(), A = M0(), i = pf(), s = df().get, o = k7(), l = T7(), u = A("native-string-replace", String.prototype.replace), f = RegExp.prototype.exec, h = f, c = t("".charAt), p = t("".indexOf), w = t("".replace), y = t("".slice), m = (function() {
    var q = /a/, G = /b*/g;
    return n(f, q, "a"), n(f, G, "a"), q.lastIndex !== 0 || G.lastIndex !== 0;
  })(), k = a.BROKEN_CARET, D = /()??/.exec("")[1] !== void 0, B = m || D || k || o || l, O = function(q, G) {
    for (var W = q.groups = i(null), F = 0; F < G.length; F++) {
      var Y = G[F];
      W[Y[0]] = q[Y[1]];
    }
  };
  return B && (h = function(G) {
    var W = this, F = s(W), Y = e(G), T = F.raw, E, Q, x;
    if (T)
      return T.lastIndex = W.lastIndex, E = n(h, T, Y), W.lastIndex = T.lastIndex, E && F.groups && O(E, F.groups), E;
    var oe = F.groups, J = k && W.sticky, S = n(r, W), I = W.source, N = 0, se = Y;
    if (J) {
      S = w(S, "y", ""), p(S, "g") === -1 && (S += "g"), se = y(Y, W.lastIndex);
      var Z = W.lastIndex > 0 && c(Y, W.lastIndex - 1);
      W.lastIndex > 0 && (!W.multiline || W.multiline && Z !== `
` && Z !== "\r" && Z !== "\u2028" && Z !== "\u2029") && (I = "(?: (?:" + I + "))", se = " " + se, N++), Q = new RegExp("^(?:" + I + ")", S);
    }
    D && (Q = new RegExp("^" + I + "$(?!\\s)", S)), m && (x = W.lastIndex);
    var C = n(f, J ? Q : W, se);
    return J ? C ? (C.input = Y, C[0] = y(C[0], N), C.index = W.lastIndex, W.lastIndex += C[0].length) : W.lastIndex = 0 : m && C && (W.lastIndex = W.global ? C.index + C[0].length : x), D && C && C.length > 1 && n(u, C[0], Q, function() {
      for (var H = 1; H < arguments.length - 2; H++)
        arguments[H] === void 0 && (C[H] = void 0);
    }), C && oe && O(C, oe), C;
  }), Iv = h, Iv;
}
var XB;
function x7() {
  if (XB) return PB;
  XB = 1;
  var n = ds(), t = $0();
  return n({ target: "RegExp", proto: !0, forced: /./.exec !== t }, {
    exec: t
  }), PB;
}
var Qv, JB;
function V0() {
  if (JB) return Qv;
  JB = 1, x7();
  var n = HA(), t = vl(), e = $0(), r = Ra(), a = xA(), A = tc(), i = a("species"), s = RegExp.prototype;
  return Qv = function(o, l, u, f) {
    var h = a(o), c = !r(function() {
      var m = {};
      return m[h] = function() {
        return 7;
      }, ""[o](m) !== 7;
    }), p = c && !r(function() {
      var m = !1, k = /a/;
      if (o === "split") {
        var D = {};
        D[i] = function() {
          return k;
        }, k = { constructor: D, flags: "" }, k[h] = /./[h];
      }
      return k.exec = function() {
        return m = !0, null;
      }, k[h](""), !m;
    });
    if (!c || !p || u) {
      var w = /./[h], y = l(h, ""[o], function(m, k, D, B, O) {
        var q = k.exec;
        return q === e || q === s.exec ? c && !O ? { done: !0, value: n(w, k, D, B) } : { done: !0, value: n(m, D, k, B) } : { done: !1 };
      });
      t(String.prototype, o, y[0]), t(s, h, y[1]);
    }
    f && A(s[h], "sham", !0);
  }, Qv;
}
var Mv, ZB;
function D7() {
  if (ZB) return Mv;
  ZB = 1;
  var n = Na(), t = ff(), e = Oi(), r = yi(), a = n("".charAt), A = n("".charCodeAt), i = n("".slice), s = function(o) {
    return function(l, u) {
      var f = e(r(l)), h = t(u), c = f.length, p, w;
      return h < 0 || h >= c ? o ? "" : void 0 : (p = A(f, h), p < 55296 || p > 56319 || h + 1 === c || (w = A(f, h + 1)) < 56320 || w > 57343 ? o ? a(f, h) : p : o ? i(f, h, h + 2) : (p - 55296 << 10) + (w - 56320) + 65536);
    };
  };
  return Mv = {
    // `String.prototype.codePointAt` method
    // https://tc39.es/ecma262/#sec-string.prototype.codepointat
    codeAt: s(!1),
    // `String.prototype.at` method
    // https://github.com/mathiasbynens/String.prototype.at
    charAt: s(!0)
  }, Mv;
}
var _v, eb;
function q0() {
  if (eb) return _v;
  eb = 1;
  var n = D7().charAt;
  return _v = function(t, e, r) {
    return e + (r && n(t, e).length || 1);
  }, _v;
}
var Rv, tb;
function E7() {
  if (tb) return Rv;
  tb = 1;
  var n = va(), t = Ra(), e = n.RegExp, r = !t(function() {
    var a = !0;
    try {
      e(".", "d");
    } catch {
      a = !1;
    }
    var A = {}, i = "", s = a ? "dgimsy" : "gimsy", o = function(h, c) {
      Object.defineProperty(A, h, { get: function() {
        return i += c, !0;
      } });
    }, l = {
      dotAll: "s",
      global: "g",
      ignoreCase: "i",
      multiline: "m",
      sticky: "y"
    };
    a && (l.hasIndices = "d");
    for (var u in l) o(u, l[u]);
    var f = Object.getOwnPropertyDescriptor(e.prototype, "flags").get.call(A);
    return f !== s || i !== s;
  });
  return Rv = { correct: r }, Rv;
}
var Nv, rb;
function mf() {
  if (rb) return Nv;
  rb = 1;
  var n = HA(), t = Bi(), e = Af(), r = E7(), a = jk(), A = RegExp.prototype;
  return Nv = r.correct ? function(i) {
    return i.flags;
  } : function(i) {
    return !r.correct && e(A, i) && !t(i, "flags") ? n(a, i) : i.flags;
  }, Nv;
}
var Hv, nb;
function j0() {
  if (nb) return Hv;
  nb = 1;
  var n = HA(), t = cs(), e = za(), r = hl(), a = $0(), A = TypeError;
  return Hv = function(i, s) {
    var o = i.exec;
    if (e(o)) {
      var l = n(o, i, s);
      return l !== null && t(l), l;
    }
    if (r(i) === "RegExp") return n(a, i, s);
    throw new A("RegExp#exec called on incompatible receiver");
  }, Hv;
}
var ab;
function S7() {
  if (ab) return OB;
  ab = 1;
  var n = HA(), t = Na(), e = V0(), r = cs(), a = xs(), A = ru(), i = Oi(), s = yi(), o = tu(), l = q0(), u = mf(), f = j0(), h = t("".indexOf);
  return e("match", function(c, p, w) {
    return [
      // `String.prototype.match` method
      // https://tc39.es/ecma262/#sec-string.prototype.match
      function(m) {
        var k = s(this), D = a(m) ? o(m, c) : void 0;
        return D ? n(D, m, k) : new RegExp(m)[c](i(k));
      },
      // `RegExp.prototype[@@match]` method
      // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
      function(y) {
        var m = r(this), k = i(y), D = w(p, m, k);
        if (D.done) return D.value;
        var B = i(u(m));
        if (!~h(B, "g")) return f(m, k);
        var O = !!~h(B, "u") || !!~h(B, "v");
        m.lastIndex = 0;
        for (var q = [], G = 0, W; (W = f(m, k)) !== null; ) {
          var F = i(W[0]);
          q[G] = F, F === "" && (m.lastIndex = l(k, A(m.lastIndex), O)), G++;
        }
        return G === 0 ? null : q;
      }
    ];
  }), OB;
}
S7();
var Ab = {}, Ov, sb;
function F7() {
  if (sb) return Ov;
  sb = 1;
  var n = Na(), t = of(), e = Math.floor, r = n("".charAt), a = n("".replace), A = n("".slice), i = /\$([$&'`]|\d{1,2}|<[^>]*>)/g, s = /\$([$&'`]|\d{1,2})/g;
  return Ov = function(o, l, u, f, h, c) {
    var p = u + o.length, w = f.length, y = s;
    return h !== void 0 && (h = t(h), y = i), a(c, y, function(m, k) {
      var D;
      switch (r(k, 0)) {
        case "$":
          return "$";
        case "&":
          return o;
        case "`":
          return A(l, 0, u);
        case "'":
          return A(l, p);
        case "<":
          D = h[A(k, 1, -1)];
          break;
        default:
          var B = +k;
          if (B === 0) return m;
          if (B > w) {
            var O = e(B / 10);
            return O === 0 ? m : O <= w ? f[O - 1] === void 0 ? r(k, 1) : f[O - 1] + r(k, 1) : m;
          }
          D = f[B - 1];
      }
      return D === void 0 ? "" : D;
    });
  }, Ov;
}
var ib;
function U7() {
  if (ib) return Ab;
  ib = 1;
  var n = Hk(), t = HA(), e = Na(), r = V0(), a = Ra(), A = cs(), i = za(), s = xs(), o = ff(), l = ru(), u = Oi(), f = yi(), h = q0(), c = tu(), p = F7(), w = mf(), y = j0(), m = xA(), k = m("replace"), D = Math.max, B = Math.min, O = e([].concat), q = e([].push), G = e("".indexOf), W = e("".slice), F = function(Q) {
    return Q === void 0 ? Q : String(Q);
  }, Y = (function() {
    return "a".replace(/./, "$0") === "$0";
  })(), T = (function() {
    return /./[k] ? /./[k]("a", "$0") === "" : !1;
  })(), E = !a(function() {
    var Q = /./;
    return Q.exec = function() {
      var x = [];
      return x.groups = { a: "7" }, x;
    }, "".replace(Q, "$<a>") !== "7";
  });
  return r("replace", function(Q, x, oe) {
    var J = T ? "$" : "$0";
    return [
      // `String.prototype.replace` method
      // https://tc39.es/ecma262/#sec-string.prototype.replace
      function(I, N) {
        var se = f(this), Z = s(I) ? c(I, k) : void 0;
        return Z ? t(Z, I, se, N) : t(x, u(se), I, N);
      },
      // `RegExp.prototype[@@replace]` method
      // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
      function(S, I) {
        var N = A(this), se = u(S), Z = i(I);
        Z || (I = u(I));
        var C = u(w(N));
        if (typeof I == "string" && !~G(I, J) && !~G(I, "$<") && !~G(C, "y")) {
          var H = oe(x, N, se, I);
          if (H.done) return H.value;
        }
        var M = !!~G(C, "g"), te;
        M && (te = !!~G(C, "u") || !!~G(C, "v"), N.lastIndex = 0);
        for (var ie = [], we; we = y(N, se), !(we === null || (q(ie, we), !M)); ) {
          var ve = u(we[0]);
          ve === "" && (N.lastIndex = h(se, l(N.lastIndex), te));
        }
        for (var le = "", _e = 0, De = 0; De < ie.length; De++) {
          we = ie[De];
          for (var ze = u(we[0]), nt = D(B(o(we.index), se.length), 0), Qe = [], ne, gt = 1; gt < we.length; gt++) q(Qe, F(we[gt]));
          var je = we.groups;
          if (Z) {
            var ot = O([ze], Qe, nt, se);
            je !== void 0 && q(ot, je), ne = u(n(I, void 0, ot));
          } else
            ne = p(ze, se, nt, Qe, je, I);
          nt >= _e && (le += W(se, _e, nt) + ne, _e = nt + ze.length);
        }
        return le + W(se, _e);
      }
    ];
  }, !E || !Y || T), Ab;
}
U7();
var ob = {}, Pv, lb;
function L7() {
  if (lb) return Pv;
  lb = 1;
  var n = xs(), t = hl(), e = xA(), r = e("match");
  return Pv = function(a) {
    var A;
    return n(a) && ((A = a[r]) !== void 0 ? !!A : t(a) === "RegExp");
  }, Pv;
}
var Wv, ub;
function Y0() {
  if (ub) return Wv;
  ub = 1;
  var n = L7(), t = TypeError;
  return Wv = function(e) {
    if (n(e))
      throw new t("The method doesn't accept regular expressions");
    return e;
  }, Wv;
}
var Kv, cb;
function G0() {
  if (cb) return Kv;
  cb = 1;
  var n = xA(), t = n("match");
  return Kv = function(e) {
    var r = /./;
    try {
      "/./"[e](r);
    } catch {
      try {
        return r[t] = !1, "/./"[e](r);
      } catch {
      }
    }
    return !1;
  }, Kv;
}
var db;
function I7() {
  if (db) return ob;
  db = 1;
  var n = ds(), t = vf(), e = uf().f, r = ru(), a = Oi(), A = Y0(), i = yi(), s = G0(), o = Hi(), l = t("".slice), u = Math.min, f = s("startsWith"), h = !o && !f && !!(function() {
    var c = e(String.prototype, "startsWith");
    return c && !c.writable;
  })();
  return n({ target: "String", proto: !0, forced: !h && !f }, {
    startsWith: function(p) {
      var w = a(i(this));
      A(p);
      var y = a(p), m = r(u(arguments.length > 1 ? arguments[1] : void 0, w.length));
      return l(w, m, m + y.length) === y;
    }
  }), ob;
}
I7();
var $v, fb;
function Q7() {
  if (fb) return $v;
  fb = 1;
  var n = xA(), t = pf(), e = Oo().f, r = n("unscopables"), a = Array.prototype;
  return a[r] === void 0 && e(a, r, {
    configurable: !0,
    value: t(null)
  }), $v = function(A) {
    a[r][A] = !0;
  }, $v;
}
var Vv, hb;
function M7() {
  if (hb) return Vv;
  hb = 1;
  var n = Ra();
  return Vv = !n(function() {
    function t() {
    }
    return t.prototype.constructor = null, Object.getPrototypeOf(new t()) !== t.prototype;
  }), Vv;
}
var qv, gb;
function Gk() {
  if (gb) return qv;
  gb = 1;
  var n = Bi(), t = za(), e = of(), r = R0(), a = M7(), A = r("IE_PROTO"), i = Object, s = i.prototype;
  return qv = a ? i.getPrototypeOf : function(o) {
    var l = e(o);
    if (n(l, A)) return l[A];
    var u = l.constructor;
    return t(u) && l instanceof u ? u.prototype : l instanceof i ? s : null;
  }, qv;
}
var jv, vb;
function zk() {
  if (vb) return jv;
  vb = 1;
  var n = Ra(), t = za(), e = xs(), r = pf(), a = Gk(), A = vl(), i = xA(), s = Hi(), o = i("iterator"), l = !1, u, f, h;
  [].keys && (h = [].keys(), "next" in h ? (f = a(a(h)), f !== Object.prototype && (u = f)) : l = !0);
  var c = !e(u) || n(function() {
    var p = {};
    return u[o].call(p) !== p;
  });
  return c ? u = {} : s && (u = r(u)), t(u[o]) || A(u, o, function() {
    return this;
  }), jv = {
    IteratorPrototype: u,
    BUGGY_SAFARI_ITERATORS: l
  }, jv;
}
var Yv, pb;
function _7() {
  if (pb) return Yv;
  pb = 1;
  var n = zk().IteratorPrototype, t = pf(), e = U0(), r = gf(), a = Ac(), A = function() {
    return this;
  };
  return Yv = function(i, s, o, l) {
    var u = s + " Iterator";
    return i.prototype = t(n, { next: e(+!l, o) }), r(i, u, !1, !0), a[u] = A, i;
  }, Yv;
}
var Gv, mb;
function R7() {
  if (mb) return Gv;
  mb = 1;
  var n = ds(), t = HA(), e = Hi(), r = cf(), a = za(), A = _7(), i = Gk(), s = Rk(), o = gf(), l = tc(), u = vl(), f = xA(), h = Ac(), c = zk(), p = r.PROPER, w = r.CONFIGURABLE, y = c.IteratorPrototype, m = c.BUGGY_SAFARI_ITERATORS, k = f("iterator"), D = "keys", B = "values", O = "entries", q = function() {
    return this;
  };
  return Gv = function(G, W, F, Y, T, E, Q) {
    A(F, W, Y);
    var x = function(M) {
      if (M === T && N) return N;
      if (!m && M && M in S) return S[M];
      switch (M) {
        case D:
          return function() {
            return new F(this, M);
          };
        case B:
          return function() {
            return new F(this, M);
          };
        case O:
          return function() {
            return new F(this, M);
          };
      }
      return function() {
        return new F(this);
      };
    }, oe = W + " Iterator", J = !1, S = G.prototype, I = S[k] || S["@@iterator"] || T && S[T], N = !m && I || x(T), se = W === "Array" && S.entries || I, Z, C, H;
    if (se && (Z = i(se.call(new G())), Z !== Object.prototype && Z.next && (!e && i(Z) !== y && (s ? s(Z, y) : a(Z[k]) || u(Z, k, q)), o(Z, oe, !0, !0), e && (h[oe] = q))), p && T === B && I && I.name !== B && (!e && w ? l(S, "name", B) : (J = !0, N = function() {
      return t(I, this);
    })), T)
      if (C = {
        values: x(B),
        keys: E ? N : x(D),
        entries: x(O)
      }, Q) for (H in C)
        (m || J || !(H in S)) && u(S, H, C[H]);
      else n({ target: W, proto: !0, forced: m || J }, C);
    return (!e || Q) && S[k] !== N && u(S, k, N, { name: T }), h[W] = N, C;
  }, Gv;
}
var zv, wb;
function N7() {
  return wb || (wb = 1, zv = function(n, t) {
    return { value: n, done: t };
  }), zv;
}
var Xv, yb;
function Xk() {
  if (yb) return Xv;
  yb = 1;
  var n = Zu(), t = Q7(), e = Ac(), r = df(), a = Oo().f, A = R7(), i = N7(), s = Hi(), o = wi(), l = "Array Iterator", u = r.set, f = r.getterFor(l);
  Xv = A(Array, "Array", function(c, p) {
    u(this, {
      type: l,
      target: n(c),
      // target
      index: 0,
      // next index
      kind: p
      // kind
    });
  }, function() {
    var c = f(this), p = c.target, w = c.index++;
    if (!p || w >= p.length)
      return c.target = null, i(void 0, !0);
    switch (c.kind) {
      case "keys":
        return i(w, !1);
      case "values":
        return i(p[w], !1);
    }
    return i([w, p[w]], !1);
  }, "values");
  var h = e.Arguments = e.Array;
  if (t("keys"), t("values"), t("entries"), !s && o && h.name !== "values") try {
    a(h, "name", { value: "values" });
  } catch {
  }
  return Xv;
}
Xk();
var Bb = {}, Jv, bb;
function H7() {
  return bb || (bb = 1, Jv = {
    CSSRuleList: 0,
    CSSStyleDeclaration: 0,
    CSSValueList: 0,
    ClientRectList: 0,
    DOMRectList: 0,
    DOMStringList: 0,
    DOMTokenList: 1,
    DataTransferItemList: 0,
    FileList: 0,
    HTMLAllCollection: 0,
    HTMLCollection: 0,
    HTMLFormElement: 0,
    HTMLSelectElement: 0,
    MediaList: 0,
    MimeTypeArray: 0,
    NamedNodeMap: 0,
    NodeList: 1,
    PaintRequestList: 0,
    Plugin: 0,
    PluginArray: 0,
    SVGLengthList: 0,
    SVGNumberList: 0,
    SVGPathSegList: 0,
    SVGPointList: 0,
    SVGStringList: 0,
    SVGTransformList: 0,
    SourceBufferList: 0,
    StyleSheetList: 0,
    TextTrackCueList: 0,
    TextTrackList: 0,
    TouchList: 0
  }), Jv;
}
var Zv, Cb;
function O7() {
  if (Cb) return Zv;
  Cb = 1;
  var n = lf(), t = n("span").classList, e = t && t.constructor && t.constructor.prototype;
  return Zv = e === Object.prototype ? void 0 : e, Zv;
}
var kb;
function P7() {
  if (kb) return Bb;
  kb = 1;
  var n = va(), t = H7(), e = O7(), r = Xk(), a = tc(), A = gf(), i = xA(), s = i("iterator"), o = r.values, l = function(f, h) {
    if (f) {
      if (f[s] !== o) try {
        a(f, s, o);
      } catch {
        f[s] = o;
      }
      if (A(f, h, !0), t[h]) {
        for (var c in r)
          if (f[c] !== r[c]) try {
            a(f, c, r[c]);
          } catch {
            f[c] = r[c];
          }
      }
    }
  };
  for (var u in t)
    l(n[u] && n[u].prototype, u);
  return l(e, "DOMTokenList"), Bb;
}
P7();
function W7(n, t) {
  if (In(n) != "object" || !n) return n;
  var e = n[Symbol.toPrimitive];
  if (e !== void 0) {
    var r = e.call(n, t);
    if (In(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(n);
}
function K7(n) {
  var t = W7(n, "string");
  return In(t) == "symbol" ? t : t + "";
}
function z0(n, t, e) {
  return (t = K7(t)) in n ? Object.defineProperty(n, t, {
    value: e,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : n[t] = e, n;
}
var Tb = {}, ep, xb;
function $7() {
  if (xb) return ep;
  xb = 1;
  var n = lo(), t = of(), e = kk(), r = H0(), a = TypeError, A = "Reduce of empty array with no initial value", i = function(s) {
    return function(o, l, u, f) {
      var h = t(o), c = e(h), p = r(h);
      if (n(l), p === 0 && u < 2) throw new a(A);
      var w = s ? p - 1 : 0, y = s ? -1 : 1;
      if (u < 2) for (; ; ) {
        if (w in c) {
          f = c[w], w += y;
          break;
        }
        if (w += y, s ? w < 0 : p <= w)
          throw new a(A);
      }
      for (; s ? w >= 0 : p > w; w += y) w in c && (f = l(f, c[w], w, h));
      return f;
    };
  };
  return ep = {
    // `Array.prototype.reduce` method
    // https://tc39.es/ecma262/#sec-array.prototype.reduce
    left: i(!1),
    // `Array.prototype.reduceRight` method
    // https://tc39.es/ecma262/#sec-array.prototype.reduceright
    right: i(!0)
  }, ep;
}
var tp, Db;
function Jk() {
  if (Db) return tp;
  Db = 1;
  var n = Ra();
  return tp = function(t, e) {
    var r = [][t];
    return !!r && n(function() {
      r.call(null, e || function() {
        return 1;
      }, 1);
    });
  }, tp;
}
var Eb;
function V7() {
  if (Eb) return Tb;
  Eb = 1;
  var n = ds(), t = $7().left, e = Jk(), r = L0(), a = hf(), A = !a && r > 79 && r < 83, i = A || !e("reduce");
  return n({ target: "Array", proto: !0, forced: i }, {
    reduce: function(o) {
      var l = arguments.length;
      return t(this, o, l, l > 1 ? arguments[1] : void 0);
    }
  }), Tb;
}
V7();
var Sb = {}, Fb;
function q7() {
  if (Fb) return Sb;
  Fb = 1;
  var n = ds(), t = vf(), e = uf().f, r = ru(), a = Oi(), A = Y0(), i = yi(), s = G0(), o = Hi(), l = t("".slice), u = Math.min, f = s("endsWith"), h = !o && !f && !!(function() {
    var c = e(String.prototype, "endsWith");
    return c && !c.writable;
  })();
  return n({ target: "String", proto: !0, forced: !h && !f }, {
    endsWith: function(p) {
      var w = a(i(this));
      A(p);
      var y = a(p), m = arguments.length > 1 ? arguments[1] : void 0, k = w.length, D = m === void 0 ? k : u(r(m), k);
      return l(w, D - y.length, D) === y;
    }
  }), Sb;
}
q7();
var Ub = {}, Lb;
function j7() {
  if (Lb) return Ub;
  Lb = 1;
  var n = HA(), t = Na(), e = V0(), r = cs(), a = xs(), A = yi(), i = Nk(), s = q0(), o = ru(), l = Oi(), u = tu(), f = mf(), h = j0(), c = Yk(), p = Ra(), w = c.UNSUPPORTED_Y, y = 4294967295, m = Math.min, k = t([].push), D = t("".slice), B = t("".indexOf), O = !p(function() {
    var G = /(?:)/, W = G.exec;
    G.exec = function() {
      return W.apply(this, arguments);
    };
    var F = "ab".split(G);
    return F.length !== 2 || F[0] !== "a" || F[1] !== "b";
  }), q = "abbc".split(/(b)*/)[1] === "c" || // eslint-disable-next-line regexp/no-empty-group -- required for testing
  "test".split(/(?:)/, -1).length !== 4 || "ab".split(/(?:ab)*/).length !== 2 || ".".split(/(.?)(.?)/).length !== 4 || // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
  ".".split(/()()/).length > 1 || "".split(/.?/).length;
  return e("split", function(G, W, F) {
    var Y = "0".split(void 0, 0).length ? function(T, E) {
      return T === void 0 && E === 0 ? [] : n(W, this, T, E);
    } : W;
    return [
      // `String.prototype.split` method
      // https://tc39.es/ecma262/#sec-string.prototype.split
      function(E, Q) {
        var x = A(this), oe = a(E) ? u(E, G) : void 0;
        return oe ? n(oe, E, x, Q) : n(Y, l(x), E, Q);
      },
      // `RegExp.prototype[@@split]` method
      // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
      //
      // NOTE: This cannot be properly polyfilled in engines that don't support
      // the 'y' flag.
      function(T, E) {
        var Q = r(this), x = l(T);
        if (!q) {
          var oe = F(Y, Q, x, E, Y !== W);
          if (oe.done) return oe.value;
        }
        var J = i(Q, RegExp), S = l(f(Q)), I = !!~B(S, "u") || !!~B(S, "v");
        w ? ~B(S, "g") || (S += "g") : ~B(S, "y") || (S += "y");
        var N = new J(w ? "^(?:" + Q.source + ")" : Q, S), se = E === void 0 ? y : E >>> 0;
        if (se === 0) return [];
        if (x.length === 0) return h(N, x) === null ? [x] : [];
        for (var Z = 0, C = 0, H = []; C < x.length; ) {
          N.lastIndex = w ? 0 : C;
          var M = h(N, w ? D(x, C) : x), te;
          if (M === null || (te = m(o(N.lastIndex + (w ? C : 0)), x.length)) === Z)
            C = s(x, C, I);
          else {
            if (k(H, D(x, Z, C)), H.length === se) return H;
            for (var ie = 1; ie <= M.length - 1; ie++)
              if (k(H, M[ie]), H.length === se) return H;
            C = Z = te;
          }
        }
        return k(H, D(x, Z)), H;
      }
    ];
  }, q || !O, w), Ub;
}
j7();
var Tu = { exports: {} }, Zo = { exports: {} }, Y7 = Zo.exports, Ib;
function G7() {
  return Ib || (Ib = 1, (function() {
    var n, t, e, r, a, A;
    typeof performance < "u" && performance !== null && performance.now ? Zo.exports = function() {
      return performance.now();
    } : typeof process < "u" && process !== null && process.hrtime ? (Zo.exports = function() {
      return (n() - a) / 1e6;
    }, t = process.hrtime, n = function() {
      var i;
      return i = t(), i[0] * 1e9 + i[1];
    }, r = n(), A = process.uptime() * 1e9, a = r - A) : Date.now ? (Zo.exports = function() {
      return Date.now() - e;
    }, e = Date.now()) : (Zo.exports = function() {
      return (/* @__PURE__ */ new Date()).getTime() - e;
    }, e = (/* @__PURE__ */ new Date()).getTime());
  }).call(Y7)), Zo.exports;
}
var Qb;
function z7() {
  if (Qb) return Tu.exports;
  Qb = 1;
  for (var n = G7(), t = typeof window > "u" ? Jp : window, e = ["moz", "webkit"], r = "AnimationFrame", a = t["request" + r], A = t["cancel" + r] || t["cancelRequest" + r], i = 0; !a && i < e.length; i++)
    a = t[e[i] + "Request" + r], A = t[e[i] + "Cancel" + r] || t[e[i] + "CancelRequest" + r];
  if (!a || !A) {
    var s = 0, o = 0, l = [], u = 1e3 / 60;
    a = function(f) {
      if (l.length === 0) {
        var h = n(), c = Math.max(0, u - (h - s));
        s = c + h, setTimeout(function() {
          var p = l.slice(0);
          l.length = 0;
          for (var w = 0; w < p.length; w++)
            if (!p[w].cancelled)
              try {
                p[w].callback(s);
              } catch (y) {
                setTimeout(function() {
                  throw y;
                }, 0);
              }
        }, Math.round(c));
      }
      return l.push({
        handle: ++o,
        callback: f,
        cancelled: !1
      }), o;
    }, A = function(f) {
      for (var h = 0; h < l.length; h++)
        l[h].handle === f && (l[h].cancelled = !0);
    };
  }
  return Tu.exports = function(f) {
    return a.call(t, f);
  }, Tu.exports.cancel = function() {
    A.apply(t, arguments);
  }, Tu.exports.polyfill = function(f) {
    f || (f = t), f.requestAnimationFrame = a, f.cancelAnimationFrame = A;
  }, Tu.exports;
}
var X7 = z7();
const rp = /* @__PURE__ */ Ck(X7);
var Mb = {}, np, _b;
function Zk() {
  return _b || (_b = 1, np = `	
\v\f\r                 \u2028\u2029\uFEFF`), np;
}
var ap, Rb;
function J7() {
  if (Rb) return ap;
  Rb = 1;
  var n = Na(), t = yi(), e = Oi(), r = Zk(), a = n("".replace), A = RegExp("^[" + r + "]+"), i = RegExp("(^|[^" + r + "])[" + r + "]+$"), s = function(o) {
    return function(l) {
      var u = e(t(l));
      return o & 1 && (u = a(u, A, "")), o & 2 && (u = a(u, i, "$1")), u;
    };
  };
  return ap = {
    // `String.prototype.{ trimLeft, trimStart }` methods
    // https://tc39.es/ecma262/#sec-string.prototype.trimstart
    start: s(1),
    // `String.prototype.{ trimRight, trimEnd }` methods
    // https://tc39.es/ecma262/#sec-string.prototype.trimend
    end: s(2),
    // `String.prototype.trim` method
    // https://tc39.es/ecma262/#sec-string.prototype.trim
    trim: s(3)
  }, ap;
}
var Ap, Nb;
function Z7() {
  if (Nb) return Ap;
  Nb = 1;
  var n = cf().PROPER, t = Ra(), e = Zk(), r = "​…᠎";
  return Ap = function(a) {
    return t(function() {
      return !!e[a]() || r[a]() !== r || n && e[a].name !== a;
    });
  }, Ap;
}
var Hb;
function e9() {
  if (Hb) return Mb;
  Hb = 1;
  var n = ds(), t = J7().trim, e = Z7();
  return n({ target: "String", proto: !0, forced: e("trim") }, {
    trim: function() {
      return t(this);
    }
  }), Mb;
}
e9();
var sp, Ob;
function t9() {
  return Ob || (Ob = 1, sp = function(n) {
    this.ok = !1, this.alpha = 1, n.charAt(0) == "#" && (n = n.substr(1, 6)), n = n.replace(/ /g, ""), n = n.toLowerCase();
    var t = {
      aliceblue: "f0f8ff",
      antiquewhite: "faebd7",
      aqua: "00ffff",
      aquamarine: "7fffd4",
      azure: "f0ffff",
      beige: "f5f5dc",
      bisque: "ffe4c4",
      black: "000000",
      blanchedalmond: "ffebcd",
      blue: "0000ff",
      blueviolet: "8a2be2",
      brown: "a52a2a",
      burlywood: "deb887",
      cadetblue: "5f9ea0",
      chartreuse: "7fff00",
      chocolate: "d2691e",
      coral: "ff7f50",
      cornflowerblue: "6495ed",
      cornsilk: "fff8dc",
      crimson: "dc143c",
      cyan: "00ffff",
      darkblue: "00008b",
      darkcyan: "008b8b",
      darkgoldenrod: "b8860b",
      darkgray: "a9a9a9",
      darkgreen: "006400",
      darkkhaki: "bdb76b",
      darkmagenta: "8b008b",
      darkolivegreen: "556b2f",
      darkorange: "ff8c00",
      darkorchid: "9932cc",
      darkred: "8b0000",
      darksalmon: "e9967a",
      darkseagreen: "8fbc8f",
      darkslateblue: "483d8b",
      darkslategray: "2f4f4f",
      darkturquoise: "00ced1",
      darkviolet: "9400d3",
      deeppink: "ff1493",
      deepskyblue: "00bfff",
      dimgray: "696969",
      dodgerblue: "1e90ff",
      feldspar: "d19275",
      firebrick: "b22222",
      floralwhite: "fffaf0",
      forestgreen: "228b22",
      fuchsia: "ff00ff",
      gainsboro: "dcdcdc",
      ghostwhite: "f8f8ff",
      gold: "ffd700",
      goldenrod: "daa520",
      gray: "808080",
      green: "008000",
      greenyellow: "adff2f",
      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",
      lightgrey: "d3d3d3",
      lightgreen: "90ee90",
      lightpink: "ffb6c1",
      lightsalmon: "ffa07a",
      lightseagreen: "20b2aa",
      lightskyblue: "87cefa",
      lightslateblue: "8470ff",
      lightslategray: "778899",
      lightsteelblue: "b0c4de",
      lightyellow: "ffffe0",
      lime: "00ff00",
      limegreen: "32cd32",
      linen: "faf0e6",
      magenta: "ff00ff",
      maroon: "800000",
      mediumaquamarine: "66cdaa",
      mediumblue: "0000cd",
      mediumorchid: "ba55d3",
      mediumpurple: "9370d8",
      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: "d87093",
      papayawhip: "ffefd5",
      peachpuff: "ffdab9",
      peru: "cd853f",
      pink: "ffc0cb",
      plum: "dda0dd",
      powderblue: "b0e0e6",
      purple: "800080",
      rebeccapurple: "663399",
      red: "ff0000",
      rosybrown: "bc8f8f",
      royalblue: "4169e1",
      saddlebrown: "8b4513",
      salmon: "fa8072",
      sandybrown: "f4a460",
      seagreen: "2e8b57",
      seashell: "fff5ee",
      sienna: "a0522d",
      silver: "c0c0c0",
      skyblue: "87ceeb",
      slateblue: "6a5acd",
      slategray: "708090",
      snow: "fffafa",
      springgreen: "00ff7f",
      steelblue: "4682b4",
      tan: "d2b48c",
      teal: "008080",
      thistle: "d8bfd8",
      tomato: "ff6347",
      turquoise: "40e0d0",
      violet: "ee82ee",
      violetred: "d02090",
      wheat: "f5deb3",
      white: "ffffff",
      whitesmoke: "f5f5f5",
      yellow: "ffff00",
      yellowgreen: "9acd32"
    };
    n = t[n] || n;
    for (var e = [
      {
        re: /^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,
        example: ["rgba(123, 234, 45, 0.8)", "rgba(255,234,245,1.0)"],
        process: function(o) {
          return [
            parseInt(o[1]),
            parseInt(o[2]),
            parseInt(o[3]),
            parseFloat(o[4])
          ];
        }
      },
      {
        re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
        example: ["rgb(123, 234, 45)", "rgb(255,234,245)"],
        process: function(o) {
          return [
            parseInt(o[1]),
            parseInt(o[2]),
            parseInt(o[3])
          ];
        }
      },
      {
        re: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
        example: ["#00ff00", "336699"],
        process: function(o) {
          return [
            parseInt(o[1], 16),
            parseInt(o[2], 16),
            parseInt(o[3], 16)
          ];
        }
      },
      {
        re: /^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
        example: ["#fb0", "f0f"],
        process: function(o) {
          return [
            parseInt(o[1] + o[1], 16),
            parseInt(o[2] + o[2], 16),
            parseInt(o[3] + o[3], 16)
          ];
        }
      }
    ], r = 0; r < e.length; r++) {
      var a = e[r].re, A = e[r].process, i = a.exec(n);
      if (i) {
        var s = A(i);
        this.r = s[0], this.g = s[1], this.b = s[2], s.length > 3 && (this.alpha = s[3]), this.ok = !0;
      }
    }
    this.r = this.r < 0 || isNaN(this.r) ? 0 : this.r > 255 ? 255 : this.r, this.g = this.g < 0 || isNaN(this.g) ? 0 : this.g > 255 ? 255 : this.g, this.b = this.b < 0 || isNaN(this.b) ? 0 : this.b > 255 ? 255 : this.b, this.alpha = this.alpha < 0 ? 0 : this.alpha > 1 || isNaN(this.alpha) ? 1 : this.alpha, this.toRGB = function() {
      return "rgb(" + this.r + ", " + this.g + ", " + this.b + ")";
    }, this.toRGBA = function() {
      return "rgba(" + this.r + ", " + this.g + ", " + this.b + ", " + this.alpha + ")";
    }, this.toHex = function() {
      var o = this.r.toString(16), l = this.g.toString(16), u = this.b.toString(16);
      return o.length == 1 && (o = "0" + o), l.length == 1 && (l = "0" + l), u.length == 1 && (u = "0" + u), "#" + o + l + u;
    }, this.getHelpXML = function() {
      for (var o = new Array(), l = 0; l < e.length; l++)
        for (var u = e[l].example, f = 0; f < u.length; f++)
          o[o.length] = u[f];
      for (var h in t)
        o[o.length] = h;
      var c = document.createElement("ul");
      c.setAttribute("id", "rgbcolor-examples");
      for (var l = 0; l < o.length; l++)
        try {
          var p = document.createElement("li"), w = new RGBColor(o[l]), y = document.createElement("div");
          y.style.cssText = "margin: 3px; border: 1px solid black; background:" + w.toHex() + "; color:" + w.toHex(), y.appendChild(document.createTextNode("test"));
          var m = document.createTextNode(
            " " + o[l] + " -> " + w.toRGB() + " -> " + w.toHex()
          );
          p.appendChild(y), p.appendChild(m), c.appendChild(p);
        } catch {
        }
      return c;
    };
  }), sp;
}
var r9 = t9();
const Zp = /* @__PURE__ */ Ck(r9);
var Pb = {}, Wb;
function n9() {
  if (Wb) return Pb;
  Wb = 1;
  var n = ds(), t = vf(), e = Ik().indexOf, r = Jk(), a = t([].indexOf), A = !!a && 1 / a([1], 1, -0) < 0, i = A || !r("indexOf");
  return n({ target: "Array", proto: !0, forced: i }, {
    indexOf: function(o) {
      var l = arguments.length > 1 ? arguments[1] : void 0;
      return A ? a(this, o, l) || 0 : e(this, o, l);
    }
  }), Pb;
}
n9();
var Kb = {}, $b;
function a9() {
  if ($b) return Kb;
  $b = 1;
  var n = ds(), t = Na(), e = Y0(), r = yi(), a = Oi(), A = G0(), i = t("".indexOf);
  return n({ target: "String", proto: !0, forced: !A("includes") }, {
    includes: function(o) {
      return !!~i(
        a(r(this)),
        a(e(o)),
        arguments.length > 1 ? arguments[1] : void 0
      );
    }
  }), Kb;
}
a9();
var Vb = {}, ip, qb;
function A9() {
  if (qb) return ip;
  qb = 1;
  var n = hl();
  return ip = Array.isArray || function(e) {
    return n(e) === "Array";
  }, ip;
}
var jb;
function s9() {
  if (jb) return Vb;
  jb = 1;
  var n = ds(), t = Na(), e = A9(), r = t([].reverse), a = [1, 2];
  return n({ target: "Array", proto: !0, forced: String(a) === String(a.reverse()) }, {
    reverse: function() {
      return e(this) && (this.length = this.length), r(this);
    }
  }), Vb;
}
s9();
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var e4 = function(n, t) {
  return (e4 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
    e.__proto__ = r;
  } || function(e, r) {
    for (var a in r) Object.prototype.hasOwnProperty.call(r, a) && (e[a] = r[a]);
  })(n, t);
};
function t4(n, t) {
  if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
  function e() {
    this.constructor = n;
  }
  e4(n, t), n.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());
}
function i9(n) {
  var t = "";
  Array.isArray(n) || (n = [n]);
  for (var e = 0; e < n.length; e++) {
    var r = n[e];
    if (r.type === Pt.CLOSE_PATH) t += "z";
    else if (r.type === Pt.HORIZ_LINE_TO) t += (r.relative ? "h" : "H") + r.x;
    else if (r.type === Pt.VERT_LINE_TO) t += (r.relative ? "v" : "V") + r.y;
    else if (r.type === Pt.MOVE_TO) t += (r.relative ? "m" : "M") + r.x + " " + r.y;
    else if (r.type === Pt.LINE_TO) t += (r.relative ? "l" : "L") + r.x + " " + r.y;
    else if (r.type === Pt.CURVE_TO) t += (r.relative ? "c" : "C") + r.x1 + " " + r.y1 + " " + r.x2 + " " + r.y2 + " " + r.x + " " + r.y;
    else if (r.type === Pt.SMOOTH_CURVE_TO) t += (r.relative ? "s" : "S") + r.x2 + " " + r.y2 + " " + r.x + " " + r.y;
    else if (r.type === Pt.QUAD_TO) t += (r.relative ? "q" : "Q") + r.x1 + " " + r.y1 + " " + r.x + " " + r.y;
    else if (r.type === Pt.SMOOTH_QUAD_TO) t += (r.relative ? "t" : "T") + r.x + " " + r.y;
    else {
      if (r.type !== Pt.ARC) throw new Error('Unexpected command type "' + r.type + '" at index ' + e + ".");
      t += (r.relative ? "a" : "A") + r.rX + " " + r.rY + " " + r.xRot + " " + +r.lArcFlag + " " + +r.sweepFlag + " " + r.x + " " + r.y;
    }
  }
  return t;
}
function e0(n, t) {
  var e = n[0], r = n[1];
  return [e * Math.cos(t) - r * Math.sin(t), e * Math.sin(t) + r * Math.cos(t)];
}
function di() {
  for (var n = [], t = 0; t < arguments.length; t++) n[t] = arguments[t];
  for (var e = 0; e < n.length; e++) if (typeof n[e] != "number") throw new Error("assertNumbers arguments[" + e + "] is not a number. " + typeof n[e] + " == typeof " + n[e]);
  return !0;
}
var Eo = Math.PI;
function op(n, t, e) {
  n.lArcFlag = n.lArcFlag === 0 ? 0 : 1, n.sweepFlag = n.sweepFlag === 0 ? 0 : 1;
  var r = n.rX, a = n.rY, A = n.x, i = n.y;
  r = Math.abs(n.rX), a = Math.abs(n.rY);
  var s = e0([(t - A) / 2, (e - i) / 2], -n.xRot / 180 * Eo), o = s[0], l = s[1], u = Math.pow(o, 2) / Math.pow(r, 2) + Math.pow(l, 2) / Math.pow(a, 2);
  1 < u && (r *= Math.sqrt(u), a *= Math.sqrt(u)), n.rX = r, n.rY = a;
  var f = Math.pow(r, 2) * Math.pow(l, 2) + Math.pow(a, 2) * Math.pow(o, 2), h = (n.lArcFlag !== n.sweepFlag ? 1 : -1) * Math.sqrt(Math.max(0, (Math.pow(r, 2) * Math.pow(a, 2) - f) / f)), c = r * l / a * h, p = -a * o / r * h, w = e0([c, p], n.xRot / 180 * Eo);
  n.cX = w[0] + (t + A) / 2, n.cY = w[1] + (e + i) / 2, n.phi1 = Math.atan2((l - p) / a, (o - c) / r), n.phi2 = Math.atan2((-l - p) / a, (-o - c) / r), n.sweepFlag === 0 && n.phi2 > n.phi1 && (n.phi2 -= 2 * Eo), n.sweepFlag === 1 && n.phi2 < n.phi1 && (n.phi2 += 2 * Eo), n.phi1 *= 180 / Eo, n.phi2 *= 180 / Eo;
}
function Yb(n, t, e) {
  di(n, t, e);
  var r = n * n + t * t - e * e;
  if (0 > r) return [];
  if (r === 0) return [[n * e / (n * n + t * t), t * e / (n * n + t * t)]];
  var a = Math.sqrt(r);
  return [[(n * e + t * a) / (n * n + t * t), (t * e - n * a) / (n * n + t * t)], [(n * e - t * a) / (n * n + t * t), (t * e + n * a) / (n * n + t * t)]];
}
var aA, Zi = Math.PI / 180;
function Gb(n, t, e) {
  return (1 - e) * n + e * t;
}
function zb(n, t, e, r) {
  return n + Math.cos(r / 180 * Eo) * t + Math.sin(r / 180 * Eo) * e;
}
function Xb(n, t, e, r) {
  var a = 1e-6, A = t - n, i = e - t, s = 3 * A + 3 * (r - e) - 6 * i, o = 6 * (i - A), l = 3 * A;
  return Math.abs(s) < a ? [-l / o] : (function(u, f, h) {
    var c = u * u / 4 - f;
    if (c < -h) return [];
    if (c <= h) return [-u / 2];
    var p = Math.sqrt(c);
    return [-u / 2 - p, -u / 2 + p];
  })(o / s, l / s, a);
}
function Jb(n, t, e, r, a) {
  var A = 1 - a;
  return n * (A * A * A) + t * (3 * A * A * a) + e * (3 * A * a * a) + r * (a * a * a);
}
(function(n) {
  function t() {
    return a((function(s, o, l) {
      return s.relative && (s.x1 !== void 0 && (s.x1 += o), s.y1 !== void 0 && (s.y1 += l), s.x2 !== void 0 && (s.x2 += o), s.y2 !== void 0 && (s.y2 += l), s.x !== void 0 && (s.x += o), s.y !== void 0 && (s.y += l), s.relative = !1), s;
    }));
  }
  function e() {
    var s = NaN, o = NaN, l = NaN, u = NaN;
    return a((function(f, h, c) {
      return f.type & Pt.SMOOTH_CURVE_TO && (f.type = Pt.CURVE_TO, s = isNaN(s) ? h : s, o = isNaN(o) ? c : o, f.x1 = f.relative ? h - s : 2 * h - s, f.y1 = f.relative ? c - o : 2 * c - o), f.type & Pt.CURVE_TO ? (s = f.relative ? h + f.x2 : f.x2, o = f.relative ? c + f.y2 : f.y2) : (s = NaN, o = NaN), f.type & Pt.SMOOTH_QUAD_TO && (f.type = Pt.QUAD_TO, l = isNaN(l) ? h : l, u = isNaN(u) ? c : u, f.x1 = f.relative ? h - l : 2 * h - l, f.y1 = f.relative ? c - u : 2 * c - u), f.type & Pt.QUAD_TO ? (l = f.relative ? h + f.x1 : f.x1, u = f.relative ? c + f.y1 : f.y1) : (l = NaN, u = NaN), f;
    }));
  }
  function r() {
    var s = NaN, o = NaN;
    return a((function(l, u, f) {
      if (l.type & Pt.SMOOTH_QUAD_TO && (l.type = Pt.QUAD_TO, s = isNaN(s) ? u : s, o = isNaN(o) ? f : o, l.x1 = l.relative ? u - s : 2 * u - s, l.y1 = l.relative ? f - o : 2 * f - o), l.type & Pt.QUAD_TO) {
        s = l.relative ? u + l.x1 : l.x1, o = l.relative ? f + l.y1 : l.y1;
        var h = l.x1, c = l.y1;
        l.type = Pt.CURVE_TO, l.x1 = ((l.relative ? 0 : u) + 2 * h) / 3, l.y1 = ((l.relative ? 0 : f) + 2 * c) / 3, l.x2 = (l.x + 2 * h) / 3, l.y2 = (l.y + 2 * c) / 3;
      } else s = NaN, o = NaN;
      return l;
    }));
  }
  function a(s) {
    var o = 0, l = 0, u = NaN, f = NaN;
    return function(h) {
      if (isNaN(u) && !(h.type & Pt.MOVE_TO)) throw new Error("path must start with moveto");
      var c = s(h, o, l, u, f);
      return h.type & Pt.CLOSE_PATH && (o = u, l = f), h.x !== void 0 && (o = h.relative ? o + h.x : h.x), h.y !== void 0 && (l = h.relative ? l + h.y : h.y), h.type & Pt.MOVE_TO && (u = o, f = l), c;
    };
  }
  function A(s, o, l, u, f, h) {
    return di(s, o, l, u, f, h), a((function(c, p, w, y) {
      var m = c.x1, k = c.x2, D = c.relative && !isNaN(y), B = c.x !== void 0 ? c.x : D ? 0 : p, O = c.y !== void 0 ? c.y : D ? 0 : w;
      function q(C) {
        return C * C;
      }
      c.type & Pt.HORIZ_LINE_TO && o !== 0 && (c.type = Pt.LINE_TO, c.y = c.relative ? 0 : w), c.type & Pt.VERT_LINE_TO && l !== 0 && (c.type = Pt.LINE_TO, c.x = c.relative ? 0 : p), c.x !== void 0 && (c.x = c.x * s + O * l + (D ? 0 : f)), c.y !== void 0 && (c.y = B * o + c.y * u + (D ? 0 : h)), c.x1 !== void 0 && (c.x1 = c.x1 * s + c.y1 * l + (D ? 0 : f)), c.y1 !== void 0 && (c.y1 = m * o + c.y1 * u + (D ? 0 : h)), c.x2 !== void 0 && (c.x2 = c.x2 * s + c.y2 * l + (D ? 0 : f)), c.y2 !== void 0 && (c.y2 = k * o + c.y2 * u + (D ? 0 : h));
      var G = s * u - o * l;
      if (c.xRot !== void 0 && (s !== 1 || o !== 0 || l !== 0 || u !== 1)) if (G === 0) delete c.rX, delete c.rY, delete c.xRot, delete c.lArcFlag, delete c.sweepFlag, c.type = Pt.LINE_TO;
      else {
        var W = c.xRot * Math.PI / 180, F = Math.sin(W), Y = Math.cos(W), T = 1 / q(c.rX), E = 1 / q(c.rY), Q = q(Y) * T + q(F) * E, x = 2 * F * Y * (T - E), oe = q(F) * T + q(Y) * E, J = Q * u * u - x * o * u + oe * o * o, S = x * (s * u + o * l) - 2 * (Q * l * u + oe * s * o), I = Q * l * l - x * s * l + oe * s * s, N = (Math.atan2(S, J - I) + Math.PI) % Math.PI / 2, se = Math.sin(N), Z = Math.cos(N);
        c.rX = Math.abs(G) / Math.sqrt(J * q(Z) + S * se * Z + I * q(se)), c.rY = Math.abs(G) / Math.sqrt(J * q(se) - S * se * Z + I * q(Z)), c.xRot = 180 * N / Math.PI;
      }
      return c.sweepFlag !== void 0 && 0 > G && (c.sweepFlag = +!c.sweepFlag), c;
    }));
  }
  function i() {
    return function(s) {
      var o = {};
      for (var l in s) o[l] = s[l];
      return o;
    };
  }
  n.ROUND = function(s) {
    function o(l) {
      return Math.round(l * s) / s;
    }
    return s === void 0 && (s = 1e13), di(s), function(l) {
      return l.x1 !== void 0 && (l.x1 = o(l.x1)), l.y1 !== void 0 && (l.y1 = o(l.y1)), l.x2 !== void 0 && (l.x2 = o(l.x2)), l.y2 !== void 0 && (l.y2 = o(l.y2)), l.x !== void 0 && (l.x = o(l.x)), l.y !== void 0 && (l.y = o(l.y)), l.rX !== void 0 && (l.rX = o(l.rX)), l.rY !== void 0 && (l.rY = o(l.rY)), l;
    };
  }, n.TO_ABS = t, n.TO_REL = function() {
    return a((function(s, o, l) {
      return s.relative || (s.x1 !== void 0 && (s.x1 -= o), s.y1 !== void 0 && (s.y1 -= l), s.x2 !== void 0 && (s.x2 -= o), s.y2 !== void 0 && (s.y2 -= l), s.x !== void 0 && (s.x -= o), s.y !== void 0 && (s.y -= l), s.relative = !0), s;
    }));
  }, n.NORMALIZE_HVZ = function(s, o, l) {
    return s === void 0 && (s = !0), o === void 0 && (o = !0), l === void 0 && (l = !0), a((function(u, f, h, c, p) {
      if (isNaN(c) && !(u.type & Pt.MOVE_TO)) throw new Error("path must start with moveto");
      return o && u.type & Pt.HORIZ_LINE_TO && (u.type = Pt.LINE_TO, u.y = u.relative ? 0 : h), l && u.type & Pt.VERT_LINE_TO && (u.type = Pt.LINE_TO, u.x = u.relative ? 0 : f), s && u.type & Pt.CLOSE_PATH && (u.type = Pt.LINE_TO, u.x = u.relative ? c - f : c, u.y = u.relative ? p - h : p), u.type & Pt.ARC && (u.rX === 0 || u.rY === 0) && (u.type = Pt.LINE_TO, delete u.rX, delete u.rY, delete u.xRot, delete u.lArcFlag, delete u.sweepFlag), u;
    }));
  }, n.NORMALIZE_ST = e, n.QT_TO_C = r, n.INFO = a, n.SANITIZE = function(s) {
    s === void 0 && (s = 0), di(s);
    var o = NaN, l = NaN, u = NaN, f = NaN;
    return a((function(h, c, p, w, y) {
      var m = Math.abs, k = !1, D = 0, B = 0;
      if (h.type & Pt.SMOOTH_CURVE_TO && (D = isNaN(o) ? 0 : c - o, B = isNaN(l) ? 0 : p - l), h.type & (Pt.CURVE_TO | Pt.SMOOTH_CURVE_TO) ? (o = h.relative ? c + h.x2 : h.x2, l = h.relative ? p + h.y2 : h.y2) : (o = NaN, l = NaN), h.type & Pt.SMOOTH_QUAD_TO ? (u = isNaN(u) ? c : 2 * c - u, f = isNaN(f) ? p : 2 * p - f) : h.type & Pt.QUAD_TO ? (u = h.relative ? c + h.x1 : h.x1, f = h.relative ? p + h.y1 : h.y2) : (u = NaN, f = NaN), h.type & Pt.LINE_COMMANDS || h.type & Pt.ARC && (h.rX === 0 || h.rY === 0 || !h.lArcFlag) || h.type & Pt.CURVE_TO || h.type & Pt.SMOOTH_CURVE_TO || h.type & Pt.QUAD_TO || h.type & Pt.SMOOTH_QUAD_TO) {
        var O = h.x === void 0 ? 0 : h.relative ? h.x : h.x - c, q = h.y === void 0 ? 0 : h.relative ? h.y : h.y - p;
        D = isNaN(u) ? h.x1 === void 0 ? D : h.relative ? h.x : h.x1 - c : u - c, B = isNaN(f) ? h.y1 === void 0 ? B : h.relative ? h.y : h.y1 - p : f - p;
        var G = h.x2 === void 0 ? 0 : h.relative ? h.x : h.x2 - c, W = h.y2 === void 0 ? 0 : h.relative ? h.y : h.y2 - p;
        m(O) <= s && m(q) <= s && m(D) <= s && m(B) <= s && m(G) <= s && m(W) <= s && (k = !0);
      }
      return h.type & Pt.CLOSE_PATH && m(c - w) <= s && m(p - y) <= s && (k = !0), k ? [] : h;
    }));
  }, n.MATRIX = A, n.ROTATE = function(s, o, l) {
    o === void 0 && (o = 0), l === void 0 && (l = 0), di(s, o, l);
    var u = Math.sin(s), f = Math.cos(s);
    return A(f, u, -u, f, o - o * f + l * u, l - o * u - l * f);
  }, n.TRANSLATE = function(s, o) {
    return o === void 0 && (o = 0), di(s, o), A(1, 0, 0, 1, s, o);
  }, n.SCALE = function(s, o) {
    return o === void 0 && (o = s), di(s, o), A(s, 0, 0, o, 0, 0);
  }, n.SKEW_X = function(s) {
    return di(s), A(1, 0, Math.atan(s), 1, 0, 0);
  }, n.SKEW_Y = function(s) {
    return di(s), A(1, Math.atan(s), 0, 1, 0, 0);
  }, n.X_AXIS_SYMMETRY = function(s) {
    return s === void 0 && (s = 0), di(s), A(-1, 0, 0, 1, s, 0);
  }, n.Y_AXIS_SYMMETRY = function(s) {
    return s === void 0 && (s = 0), di(s), A(1, 0, 0, -1, 0, s);
  }, n.A_TO_C = function() {
    return a((function(s, o, l) {
      return Pt.ARC === s.type ? (function(u, f, h) {
        var c, p, w, y;
        u.cX || op(u, f, h);
        for (var m = Math.min(u.phi1, u.phi2), k = Math.max(u.phi1, u.phi2) - m, D = Math.ceil(k / 90), B = new Array(D), O = f, q = h, G = 0; G < D; G++) {
          var W = Gb(u.phi1, u.phi2, G / D), F = Gb(u.phi1, u.phi2, (G + 1) / D), Y = F - W, T = 4 / 3 * Math.tan(Y * Zi / 4), E = [Math.cos(W * Zi) - T * Math.sin(W * Zi), Math.sin(W * Zi) + T * Math.cos(W * Zi)], Q = E[0], x = E[1], oe = [Math.cos(F * Zi), Math.sin(F * Zi)], J = oe[0], S = oe[1], I = [J + T * Math.sin(F * Zi), S - T * Math.cos(F * Zi)], N = I[0], se = I[1];
          B[G] = { relative: u.relative, type: Pt.CURVE_TO };
          var Z = function(C, H) {
            var M = e0([C * u.rX, H * u.rY], u.xRot), te = M[0], ie = M[1];
            return [u.cX + te, u.cY + ie];
          };
          c = Z(Q, x), B[G].x1 = c[0], B[G].y1 = c[1], p = Z(N, se), B[G].x2 = p[0], B[G].y2 = p[1], w = Z(J, S), B[G].x = w[0], B[G].y = w[1], u.relative && (B[G].x1 -= O, B[G].y1 -= q, B[G].x2 -= O, B[G].y2 -= q, B[G].x -= O, B[G].y -= q), O = (y = [B[G].x, B[G].y])[0], q = y[1];
        }
        return B;
      })(s, s.relative ? 0 : o, s.relative ? 0 : l) : s;
    }));
  }, n.ANNOTATE_ARCS = function() {
    return a((function(s, o, l) {
      return s.relative && (o = 0, l = 0), Pt.ARC === s.type && op(s, o, l), s;
    }));
  }, n.CLONE = i, n.CALCULATE_BOUNDS = function() {
    var s = function(h) {
      var c = {};
      for (var p in h) c[p] = h[p];
      return c;
    }, o = t(), l = r(), u = e(), f = a((function(h, c, p) {
      var w = u(l(o(s(h))));
      function y(se) {
        se > f.maxX && (f.maxX = se), se < f.minX && (f.minX = se);
      }
      function m(se) {
        se > f.maxY && (f.maxY = se), se < f.minY && (f.minY = se);
      }
      if (w.type & Pt.DRAWING_COMMANDS && (y(c), m(p)), w.type & Pt.HORIZ_LINE_TO && y(w.x), w.type & Pt.VERT_LINE_TO && m(w.y), w.type & Pt.LINE_TO && (y(w.x), m(w.y)), w.type & Pt.CURVE_TO) {
        y(w.x), m(w.y);
        for (var k = 0, D = Xb(c, w.x1, w.x2, w.x); k < D.length; k++)
          0 < (N = D[k]) && 1 > N && y(Jb(c, w.x1, w.x2, w.x, N));
        for (var B = 0, O = Xb(p, w.y1, w.y2, w.y); B < O.length; B++)
          0 < (N = O[B]) && 1 > N && m(Jb(p, w.y1, w.y2, w.y, N));
      }
      if (w.type & Pt.ARC) {
        y(w.x), m(w.y), op(w, c, p);
        for (var q = w.xRot / 180 * Math.PI, G = Math.cos(q) * w.rX, W = Math.sin(q) * w.rX, F = -Math.sin(q) * w.rY, Y = Math.cos(q) * w.rY, T = w.phi1 < w.phi2 ? [w.phi1, w.phi2] : -180 > w.phi2 ? [w.phi2 + 360, w.phi1 + 360] : [w.phi2, w.phi1], E = T[0], Q = T[1], x = function(se) {
          var Z = se[0], C = se[1], H = 180 * Math.atan2(C, Z) / Math.PI;
          return H < E ? H + 360 : H;
        }, oe = 0, J = Yb(F, -G, 0).map(x); oe < J.length; oe++)
          (N = J[oe]) > E && N < Q && y(zb(w.cX, G, F, N));
        for (var S = 0, I = Yb(Y, -W, 0).map(x); S < I.length; S++) {
          var N;
          (N = I[S]) > E && N < Q && m(zb(w.cY, W, Y, N));
        }
      }
      return h;
    }));
    return f.minX = 1 / 0, f.maxX = -1 / 0, f.minY = 1 / 0, f.maxY = -1 / 0, f;
  };
})(aA || (aA = {}));
var ui, r4 = (function() {
  function n() {
  }
  return n.prototype.round = function(t) {
    return this.transform(aA.ROUND(t));
  }, n.prototype.toAbs = function() {
    return this.transform(aA.TO_ABS());
  }, n.prototype.toRel = function() {
    return this.transform(aA.TO_REL());
  }, n.prototype.normalizeHVZ = function(t, e, r) {
    return this.transform(aA.NORMALIZE_HVZ(t, e, r));
  }, n.prototype.normalizeST = function() {
    return this.transform(aA.NORMALIZE_ST());
  }, n.prototype.qtToC = function() {
    return this.transform(aA.QT_TO_C());
  }, n.prototype.aToC = function() {
    return this.transform(aA.A_TO_C());
  }, n.prototype.sanitize = function(t) {
    return this.transform(aA.SANITIZE(t));
  }, n.prototype.translate = function(t, e) {
    return this.transform(aA.TRANSLATE(t, e));
  }, n.prototype.scale = function(t, e) {
    return this.transform(aA.SCALE(t, e));
  }, n.prototype.rotate = function(t, e, r) {
    return this.transform(aA.ROTATE(t, e, r));
  }, n.prototype.matrix = function(t, e, r, a, A, i) {
    return this.transform(aA.MATRIX(t, e, r, a, A, i));
  }, n.prototype.skewX = function(t) {
    return this.transform(aA.SKEW_X(t));
  }, n.prototype.skewY = function(t) {
    return this.transform(aA.SKEW_Y(t));
  }, n.prototype.xSymmetry = function(t) {
    return this.transform(aA.X_AXIS_SYMMETRY(t));
  }, n.prototype.ySymmetry = function(t) {
    return this.transform(aA.Y_AXIS_SYMMETRY(t));
  }, n.prototype.annotateArcs = function() {
    return this.transform(aA.ANNOTATE_ARCS());
  }, n;
})(), o9 = function(n) {
  return n === " " || n === "	" || n === "\r" || n === `
`;
}, Zb = function(n) {
  return 48 <= n.charCodeAt(0) && n.charCodeAt(0) <= 57;
}, l9 = (function(n) {
  function t() {
    var e = n.call(this) || this;
    return e.curNumber = "", e.curCommandType = -1, e.curCommandRelative = !1, e.canParseCommandOrComma = !0, e.curNumberHasExp = !1, e.curNumberHasExpDigits = !1, e.curNumberHasDecimal = !1, e.curArgs = [], e;
  }
  return t4(t, n), t.prototype.finish = function(e) {
    if (e === void 0 && (e = []), this.parse(" ", e), this.curArgs.length !== 0 || !this.canParseCommandOrComma) throw new SyntaxError("Unterminated command at the path end.");
    return e;
  }, t.prototype.parse = function(e, r) {
    var a = this;
    r === void 0 && (r = []);
    for (var A = function(f) {
      r.push(f), a.curArgs.length = 0, a.canParseCommandOrComma = !0;
    }, i = 0; i < e.length; i++) {
      var s = e[i], o = !(this.curCommandType !== Pt.ARC || this.curArgs.length !== 3 && this.curArgs.length !== 4 || this.curNumber.length !== 1 || this.curNumber !== "0" && this.curNumber !== "1"), l = Zb(s) && (this.curNumber === "0" && s === "0" || o);
      if (!Zb(s) || l) if (s !== "e" && s !== "E") if (s !== "-" && s !== "+" || !this.curNumberHasExp || this.curNumberHasExpDigits) if (s !== "." || this.curNumberHasExp || this.curNumberHasDecimal || o) {
        if (this.curNumber && this.curCommandType !== -1) {
          var u = Number(this.curNumber);
          if (isNaN(u)) throw new SyntaxError("Invalid number ending at " + i);
          if (this.curCommandType === Pt.ARC) {
            if (this.curArgs.length === 0 || this.curArgs.length === 1) {
              if (0 > u) throw new SyntaxError('Expected positive number, got "' + u + '" at index "' + i + '"');
            } else if ((this.curArgs.length === 3 || this.curArgs.length === 4) && this.curNumber !== "0" && this.curNumber !== "1") throw new SyntaxError('Expected a flag, got "' + this.curNumber + '" at index "' + i + '"');
          }
          this.curArgs.push(u), this.curArgs.length === u9[this.curCommandType] && (Pt.HORIZ_LINE_TO === this.curCommandType ? A({ type: Pt.HORIZ_LINE_TO, relative: this.curCommandRelative, x: u }) : Pt.VERT_LINE_TO === this.curCommandType ? A({ type: Pt.VERT_LINE_TO, relative: this.curCommandRelative, y: u }) : this.curCommandType === Pt.MOVE_TO || this.curCommandType === Pt.LINE_TO || this.curCommandType === Pt.SMOOTH_QUAD_TO ? (A({ type: this.curCommandType, relative: this.curCommandRelative, x: this.curArgs[0], y: this.curArgs[1] }), Pt.MOVE_TO === this.curCommandType && (this.curCommandType = Pt.LINE_TO)) : this.curCommandType === Pt.CURVE_TO ? A({ type: Pt.CURVE_TO, relative: this.curCommandRelative, x1: this.curArgs[0], y1: this.curArgs[1], x2: this.curArgs[2], y2: this.curArgs[3], x: this.curArgs[4], y: this.curArgs[5] }) : this.curCommandType === Pt.SMOOTH_CURVE_TO ? A({ type: Pt.SMOOTH_CURVE_TO, relative: this.curCommandRelative, x2: this.curArgs[0], y2: this.curArgs[1], x: this.curArgs[2], y: this.curArgs[3] }) : this.curCommandType === Pt.QUAD_TO ? A({ type: Pt.QUAD_TO, relative: this.curCommandRelative, x1: this.curArgs[0], y1: this.curArgs[1], x: this.curArgs[2], y: this.curArgs[3] }) : this.curCommandType === Pt.ARC && A({ type: Pt.ARC, relative: this.curCommandRelative, rX: this.curArgs[0], rY: this.curArgs[1], xRot: this.curArgs[2], lArcFlag: this.curArgs[3], sweepFlag: this.curArgs[4], x: this.curArgs[5], y: this.curArgs[6] })), this.curNumber = "", this.curNumberHasExpDigits = !1, this.curNumberHasExp = !1, this.curNumberHasDecimal = !1, this.canParseCommandOrComma = !0;
        }
        if (!o9(s)) if (s === "," && this.canParseCommandOrComma) this.canParseCommandOrComma = !1;
        else if (s !== "+" && s !== "-" && s !== ".") if (l) this.curNumber = s, this.curNumberHasDecimal = !1;
        else {
          if (this.curArgs.length !== 0) throw new SyntaxError("Unterminated command at index " + i + ".");
          if (!this.canParseCommandOrComma) throw new SyntaxError('Unexpected character "' + s + '" at index ' + i + ". Command cannot follow comma");
          if (this.canParseCommandOrComma = !1, s !== "z" && s !== "Z") if (s === "h" || s === "H") this.curCommandType = Pt.HORIZ_LINE_TO, this.curCommandRelative = s === "h";
          else if (s === "v" || s === "V") this.curCommandType = Pt.VERT_LINE_TO, this.curCommandRelative = s === "v";
          else if (s === "m" || s === "M") this.curCommandType = Pt.MOVE_TO, this.curCommandRelative = s === "m";
          else if (s === "l" || s === "L") this.curCommandType = Pt.LINE_TO, this.curCommandRelative = s === "l";
          else if (s === "c" || s === "C") this.curCommandType = Pt.CURVE_TO, this.curCommandRelative = s === "c";
          else if (s === "s" || s === "S") this.curCommandType = Pt.SMOOTH_CURVE_TO, this.curCommandRelative = s === "s";
          else if (s === "q" || s === "Q") this.curCommandType = Pt.QUAD_TO, this.curCommandRelative = s === "q";
          else if (s === "t" || s === "T") this.curCommandType = Pt.SMOOTH_QUAD_TO, this.curCommandRelative = s === "t";
          else {
            if (s !== "a" && s !== "A") throw new SyntaxError('Unexpected character "' + s + '" at index ' + i + ".");
            this.curCommandType = Pt.ARC, this.curCommandRelative = s === "a";
          }
          else r.push({ type: Pt.CLOSE_PATH }), this.canParseCommandOrComma = !0, this.curCommandType = -1;
        }
        else this.curNumber = s, this.curNumberHasDecimal = s === ".";
      } else this.curNumber += s, this.curNumberHasDecimal = !0;
      else this.curNumber += s;
      else this.curNumber += s, this.curNumberHasExp = !0;
      else this.curNumber += s, this.curNumberHasExpDigits = this.curNumberHasExp;
    }
    return r;
  }, t.prototype.transform = function(e) {
    return Object.create(this, { parse: { value: function(r, a) {
      a === void 0 && (a = []);
      for (var A = 0, i = Object.getPrototypeOf(this).parse.call(this, r); A < i.length; A++) {
        var s = i[A], o = e(s);
        Array.isArray(o) ? a.push.apply(a, o) : a.push(o);
      }
      return a;
    } } });
  }, t;
})(r4), Pt = (function(n) {
  function t(e) {
    var r = n.call(this) || this;
    return r.commands = typeof e == "string" ? t.parse(e) : e, r;
  }
  return t4(t, n), t.prototype.encode = function() {
    return t.encode(this.commands);
  }, t.prototype.getBounds = function() {
    var e = aA.CALCULATE_BOUNDS();
    return this.transform(e), e;
  }, t.prototype.transform = function(e) {
    for (var r = [], a = 0, A = this.commands; a < A.length; a++) {
      var i = e(A[a]);
      Array.isArray(i) ? r.push.apply(r, i) : r.push(i);
    }
    return this.commands = r, this;
  }, t.encode = function(e) {
    return i9(e);
  }, t.parse = function(e) {
    var r = new l9(), a = [];
    return r.parse(e, a), r.finish(a), a;
  }, t.CLOSE_PATH = 1, t.MOVE_TO = 2, t.HORIZ_LINE_TO = 4, t.VERT_LINE_TO = 8, t.LINE_TO = 16, t.CURVE_TO = 32, t.SMOOTH_CURVE_TO = 64, t.QUAD_TO = 128, t.SMOOTH_QUAD_TO = 256, t.ARC = 512, t.LINE_COMMANDS = t.LINE_TO | t.HORIZ_LINE_TO | t.VERT_LINE_TO, t.DRAWING_COMMANDS = t.HORIZ_LINE_TO | t.VERT_LINE_TO | t.LINE_TO | t.CURVE_TO | t.SMOOTH_CURVE_TO | t.QUAD_TO | t.SMOOTH_QUAD_TO | t.ARC, t;
})(r4), u9 = ((ui = {})[Pt.MOVE_TO] = 2, ui[Pt.LINE_TO] = 2, ui[Pt.HORIZ_LINE_TO] = 1, ui[Pt.VERT_LINE_TO] = 1, ui[Pt.CLOSE_PATH] = 0, ui[Pt.QUAD_TO] = 4, ui[Pt.SMOOTH_QUAD_TO] = 2, ui[Pt.CURVE_TO] = 6, ui[Pt.SMOOTH_CURVE_TO] = 4, ui[Pt.ARC] = 7, ui), e5 = {}, t5;
function c9() {
  if (t5) return e5;
  t5 = 1;
  var n = cf().PROPER, t = vl(), e = cs(), r = Oi(), a = Ra(), A = mf(), i = "toString", s = RegExp.prototype, o = s[i], l = a(function() {
    return o.call({ source: "a", flags: "b" }) !== "/a/b";
  }), u = n && o.name !== i;
  return (l || u) && t(s, i, function() {
    var h = e(this), c = r(h.source), p = r(A(h));
    return "/" + c + "/" + p;
  }, { unsafe: !0 }), e5;
}
c9();
function xd(n) {
  "@babel/helpers - typeof";
  return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? xd = function(t) {
    return typeof t;
  } : xd = function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, xd(n);
}
function d9(n, t) {
  if (!(n instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
var f9 = [512, 512, 456, 512, 328, 456, 335, 512, 405, 328, 271, 456, 388, 335, 292, 512, 454, 405, 364, 328, 298, 271, 496, 456, 420, 388, 360, 335, 312, 292, 273, 512, 482, 454, 428, 405, 383, 364, 345, 328, 312, 298, 284, 271, 259, 496, 475, 456, 437, 420, 404, 388, 374, 360, 347, 335, 323, 312, 302, 292, 282, 273, 265, 512, 497, 482, 468, 454, 441, 428, 417, 405, 394, 383, 373, 364, 354, 345, 337, 328, 320, 312, 305, 298, 291, 284, 278, 271, 265, 259, 507, 496, 485, 475, 465, 456, 446, 437, 428, 420, 412, 404, 396, 388, 381, 374, 367, 360, 354, 347, 341, 335, 329, 323, 318, 312, 307, 302, 297, 292, 287, 282, 278, 273, 269, 265, 261, 512, 505, 497, 489, 482, 475, 468, 461, 454, 447, 441, 435, 428, 422, 417, 411, 405, 399, 394, 389, 383, 378, 373, 368, 364, 359, 354, 350, 345, 341, 337, 332, 328, 324, 320, 316, 312, 309, 305, 301, 298, 294, 291, 287, 284, 281, 278, 274, 271, 268, 265, 262, 259, 257, 507, 501, 496, 491, 485, 480, 475, 470, 465, 460, 456, 451, 446, 442, 437, 433, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 388, 385, 381, 377, 374, 370, 367, 363, 360, 357, 354, 350, 347, 344, 341, 338, 335, 332, 329, 326, 323, 320, 318, 315, 312, 310, 307, 304, 302, 299, 297, 294, 292, 289, 287, 285, 282, 280, 278, 275, 273, 271, 269, 267, 265, 263, 261, 259], h9 = [9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24];
function g9(n, t, e, r, a) {
  if (typeof n == "string" && (n = document.getElementById(n)), !n || xd(n) !== "object" || !("getContext" in n))
    throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");
  var A = n.getContext("2d");
  try {
    return A.getImageData(t, e, r, a);
  } catch (i) {
    throw new Error("unable to access image data: " + i);
  }
}
function v9(n, t, e, r, a, A) {
  if (!(isNaN(A) || A < 1)) {
    A |= 0;
    var i = g9(n, t, e, r, a);
    i = p9(i, t, e, r, a, A), n.getContext("2d").putImageData(i, t, e);
  }
}
function p9(n, t, e, r, a, A) {
  for (var i = n.data, s = 2 * A + 1, o = r - 1, l = a - 1, u = A + 1, f = u * (u + 1) / 2, h = new r5(), c = h, p, w = 1; w < s; w++)
    c = c.next = new r5(), w === u && (p = c);
  c.next = h;
  for (var y = null, m = null, k = 0, D = 0, B = f9[A], O = h9[A], q = 0; q < a; q++) {
    c = h;
    for (var G = i[D], W = i[D + 1], F = i[D + 2], Y = i[D + 3], T = 0; T < u; T++)
      c.r = G, c.g = W, c.b = F, c.a = Y, c = c.next;
    for (var E = 0, Q = 0, x = 0, oe = 0, J = u * G, S = u * W, I = u * F, N = u * Y, se = f * G, Z = f * W, C = f * F, H = f * Y, M = 1; M < u; M++) {
      var te = D + ((o < M ? o : M) << 2), ie = i[te], we = i[te + 1], ve = i[te + 2], le = i[te + 3], _e = u - M;
      se += (c.r = ie) * _e, Z += (c.g = we) * _e, C += (c.b = ve) * _e, H += (c.a = le) * _e, E += ie, Q += we, x += ve, oe += le, c = c.next;
    }
    y = h, m = p;
    for (var De = 0; De < r; De++) {
      var ze = H * B >>> O;
      if (i[D + 3] = ze, ze !== 0) {
        var nt = 255 / ze;
        i[D] = (se * B >>> O) * nt, i[D + 1] = (Z * B >>> O) * nt, i[D + 2] = (C * B >>> O) * nt;
      } else
        i[D] = i[D + 1] = i[D + 2] = 0;
      se -= J, Z -= S, C -= I, H -= N, J -= y.r, S -= y.g, I -= y.b, N -= y.a;
      var Qe = De + A + 1;
      Qe = k + (Qe < o ? Qe : o) << 2, E += y.r = i[Qe], Q += y.g = i[Qe + 1], x += y.b = i[Qe + 2], oe += y.a = i[Qe + 3], se += E, Z += Q, C += x, H += oe, y = y.next;
      var ne = m, gt = ne.r, je = ne.g, ot = ne.b, Ie = ne.a;
      J += gt, S += je, I += ot, N += Ie, E -= gt, Q -= je, x -= ot, oe -= Ie, m = m.next, D += 4;
    }
    k += r;
  }
  for (var It = 0; It < r; It++) {
    D = It << 2;
    var dt = i[D], Dt = i[D + 1], Ct = i[D + 2], Ve = i[D + 3], ht = u * dt, K = u * Dt, X = u * Ct, ke = u * Ve, Je = f * dt, pt = f * Dt, Xe = f * Ct, Ye = f * Ve;
    c = h;
    for (var Kt = 0; Kt < u; Kt++)
      c.r = dt, c.g = Dt, c.b = Ct, c.a = Ve, c = c.next;
    for (var it = r, qt = 0, hr = 0, Nt = 0, xr = 0, Jt = 1; Jt <= A; Jt++) {
      D = it + It << 2;
      var lr = u - Jt;
      Je += (c.r = dt = i[D]) * lr, pt += (c.g = Dt = i[D + 1]) * lr, Xe += (c.b = Ct = i[D + 2]) * lr, Ye += (c.a = Ve = i[D + 3]) * lr, xr += dt, qt += Dt, hr += Ct, Nt += Ve, c = c.next, Jt < l && (it += r);
    }
    D = It, y = h, m = p;
    for (var Fr = 0; Fr < a; Fr++) {
      var er = D << 2;
      i[er + 3] = Ve = Ye * B >>> O, Ve > 0 ? (Ve = 255 / Ve, i[er] = (Je * B >>> O) * Ve, i[er + 1] = (pt * B >>> O) * Ve, i[er + 2] = (Xe * B >>> O) * Ve) : i[er] = i[er + 1] = i[er + 2] = 0, Je -= ht, pt -= K, Xe -= X, Ye -= ke, ht -= y.r, K -= y.g, X -= y.b, ke -= y.a, er = It + ((er = Fr + u) < l ? er : l) * r << 2, Je += xr += y.r = i[er], pt += qt += y.g = i[er + 1], Xe += hr += y.b = i[er + 2], Ye += Nt += y.a = i[er + 3], y = y.next, ht += dt = m.r, K += Dt = m.g, X += Ct = m.b, ke += Ve = m.a, xr -= dt, qt -= Dt, hr -= Ct, Nt -= Ve, m = m.next, D += r;
    }
  }
  return n;
}
var r5 = (
  /**
   * Set properties.
   */
  function n() {
    d9(this, n), this.r = 0, this.g = 0, this.b = 0, this.a = 0, this.next = null;
  }
);
function m9() {
  var {
    DOMParser: n
  } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = {
    window: null,
    ignoreAnimation: !0,
    ignoreMouse: !0,
    DOMParser: n,
    createCanvas(e, r) {
      return new OffscreenCanvas(e, r);
    },
    createImage(e) {
      return io(function* () {
        var r = yield fetch(e), a = yield r.blob(), A = yield createImageBitmap(a);
        return A;
      })();
    }
  };
  return (typeof DOMParser < "u" || typeof n > "u") && Reflect.deleteProperty(t, "DOMParser"), t;
}
function w9(n) {
  var {
    DOMParser: t,
    canvas: e,
    fetch: r
  } = n;
  return {
    window: null,
    ignoreAnimation: !0,
    ignoreMouse: !0,
    DOMParser: t,
    fetch: r,
    createCanvas: e.createCanvas,
    createImage: e.loadImage
  };
}
var y9 = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  offscreen: m9,
  node: w9
});
function pl(n) {
  return n.replace(/(?!\u3000)\s+/gm, " ");
}
function n4(n) {
  return n.replace(/^[\n \t]+/, "");
}
function a4(n) {
  return n.replace(/[\n \t]+$/, "");
}
function ks(n) {
  var t = (n || "").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm) || [];
  return t.map(parseFloat);
}
var B9 = /^[A-Z-]+$/;
function A4(n) {
  return B9.test(n) ? n.toLowerCase() : n;
}
function X0(n) {
  var t = /url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(n) || [];
  return t[2] || t[3] || t[4];
}
function s4(n) {
  if (!n.startsWith("rgb"))
    return n;
  var t = 3, e = n.replace(/\d+(\.\d+)?/g, (r, a) => t-- && a ? String(Math.round(parseFloat(r))) : r);
  return e;
}
var b9 = /(\[[^\]]+\])/g, C9 = /(#[^\s+>~.[:]+)/g, k9 = /(\.[^\s+>~.[:]+)/g, T9 = /(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi, x9 = /(:[\w-]+\([^)]*\))/gi, D9 = /(:[^\s+>~.[:]+)/g, E9 = /([^\s+>~.[:]+)/g;
function Go(n, t) {
  var e = t.exec(n);
  return e ? [n.replace(t, " "), e.length] : [n, 0];
}
function i4(n) {
  var t = [0, 0, 0], e = n.replace(/:not\(([^)]*)\)/g, "     $1 ").replace(/{[\s\S]*/gm, " "), r = 0;
  return [e, r] = Go(e, b9), t[1] += r, [e, r] = Go(e, C9), t[0] += r, [e, r] = Go(e, k9), t[1] += r, [e, r] = Go(e, T9), t[2] += r, [e, r] = Go(e, x9), t[1] += r, [e, r] = Go(e, D9), t[1] += r, e = e.replace(/[*\s+>~]/g, " ").replace(/[#.]/g, " "), [e, r] = Go(e, E9), t[2] += r, t.join("");
}
var ol = 1e-8;
function t0(n) {
  return Math.sqrt(Math.pow(n[0], 2) + Math.pow(n[1], 2));
}
function $d(n, t) {
  return (n[0] * t[0] + n[1] * t[1]) / (t0(n) * t0(t));
}
function r0(n, t) {
  return (n[0] * t[1] < n[1] * t[0] ? -1 : 1) * Math.acos($d(n, t));
}
function n0(n) {
  return n * n * n;
}
function a0(n) {
  return 3 * n * n * (1 - n);
}
function A0(n) {
  return 3 * n * (1 - n) * (1 - n);
}
function s0(n) {
  return (1 - n) * (1 - n) * (1 - n);
}
function i0(n) {
  return n * n;
}
function o0(n) {
  return 2 * n * (1 - n);
}
function l0(n) {
  return (1 - n) * (1 - n);
}
class Tr {
  constructor(t, e, r) {
    this.document = t, this.name = e, this.value = r, this.isNormalizedColor = !1;
  }
  static empty(t) {
    return new Tr(t, "EMPTY", "");
  }
  split() {
    var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : " ", {
      document: e,
      name: r
    } = this;
    return pl(this.getString()).trim().split(t).map((a) => new Tr(e, r, a));
  }
  hasValue(t) {
    var {
      value: e
    } = this;
    return e !== null && e !== "" && (t || e !== 0) && typeof e < "u";
  }
  isString(t) {
    var {
      value: e
    } = this, r = typeof e == "string";
    return !r || !t ? r : t.test(e);
  }
  isUrlDefinition() {
    return this.isString(/^url\(/);
  }
  isPixels() {
    if (!this.hasValue())
      return !1;
    var t = this.getString();
    switch (!0) {
      case t.endsWith("px"):
      case /^[0-9]+$/.test(t):
        return !0;
      default:
        return !1;
    }
  }
  setValue(t) {
    return this.value = t, this;
  }
  getValue(t) {
    return typeof t > "u" || this.hasValue() ? this.value : t;
  }
  getNumber(t) {
    if (!this.hasValue())
      return typeof t > "u" ? 0 : parseFloat(t);
    var {
      value: e
    } = this, r = parseFloat(e);
    return this.isString(/%$/) && (r /= 100), r;
  }
  getString(t) {
    return typeof t > "u" || this.hasValue() ? typeof this.value > "u" ? "" : String(this.value) : String(t);
  }
  getColor(t) {
    var e = this.getString(t);
    return this.isNormalizedColor || (this.isNormalizedColor = !0, e = s4(e), this.value = e), e;
  }
  getDpi() {
    return 96;
  }
  getRem() {
    return this.document.rootEmSize;
  }
  getEm() {
    return this.document.emSize;
  }
  getUnits() {
    return this.getString().replace(/[0-9.-]/g, "");
  }
  getPixels(t) {
    var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
    if (!this.hasValue())
      return 0;
    var [r, a] = typeof t == "boolean" ? [void 0, t] : [t], {
      viewPort: A
    } = this.document.screen;
    switch (!0) {
      case this.isString(/vmin$/):
        return this.getNumber() / 100 * Math.min(A.computeSize("x"), A.computeSize("y"));
      case this.isString(/vmax$/):
        return this.getNumber() / 100 * Math.max(A.computeSize("x"), A.computeSize("y"));
      case this.isString(/vw$/):
        return this.getNumber() / 100 * A.computeSize("x");
      case this.isString(/vh$/):
        return this.getNumber() / 100 * A.computeSize("y");
      case this.isString(/rem$/):
        return this.getNumber() * this.getRem();
      case this.isString(/em$/):
        return this.getNumber() * this.getEm();
      case this.isString(/ex$/):
        return this.getNumber() * this.getEm() / 2;
      case this.isString(/px$/):
        return this.getNumber();
      case this.isString(/pt$/):
        return this.getNumber() * this.getDpi() * (1 / 72);
      case this.isString(/pc$/):
        return this.getNumber() * 15;
      case this.isString(/cm$/):
        return this.getNumber() * this.getDpi() / 2.54;
      case this.isString(/mm$/):
        return this.getNumber() * this.getDpi() / 25.4;
      case this.isString(/in$/):
        return this.getNumber() * this.getDpi();
      case (this.isString(/%$/) && a):
        return this.getNumber() * this.getEm();
      case this.isString(/%$/):
        return this.getNumber() * A.computeSize(r);
      default: {
        var i = this.getNumber();
        return e && i < 1 ? i * A.computeSize(r) : i;
      }
    }
  }
  getMilliseconds() {
    return this.hasValue() ? this.isString(/ms$/) ? this.getNumber() : this.getNumber() * 1e3 : 0;
  }
  getRadians() {
    if (!this.hasValue())
      return 0;
    switch (!0) {
      case this.isString(/deg$/):
        return this.getNumber() * (Math.PI / 180);
      case this.isString(/grad$/):
        return this.getNumber() * (Math.PI / 200);
      case this.isString(/rad$/):
        return this.getNumber();
      default:
        return this.getNumber() * (Math.PI / 180);
    }
  }
  getDefinition() {
    var t = this.getString(), e = /#([^)'"]+)/.exec(t);
    return e && (e = e[1]), e || (e = t), this.document.definitions[e];
  }
  getFillStyleDefinition(t, e) {
    var r = this.getDefinition();
    if (!r)
      return null;
    if (typeof r.createGradient == "function")
      return r.createGradient(this.document.ctx, t, e);
    if (typeof r.createPattern == "function") {
      if (r.getHrefAttribute().hasValue()) {
        var a = r.getAttribute("patternTransform");
        r = r.getHrefAttribute().getDefinition(), a.hasValue() && r.getAttribute("patternTransform", !0).setValue(a.value);
      }
      return r.createPattern(this.document.ctx, t, e);
    }
    return null;
  }
  getTextBaseline() {
    return this.hasValue() ? Tr.textBaselineMapping[this.getString()] : null;
  }
  addOpacity(t) {
    for (var e = this.getColor(), r = e.length, a = 0, A = 0; A < r && (e[A] === "," && a++, a !== 3); A++)
      ;
    if (t.hasValue() && this.isString() && a !== 3) {
      var i = new Zp(e);
      i.ok && (i.alpha = t.getNumber(), e = i.toRGBA());
    }
    return new Tr(this.document, this.name, e);
  }
}
Tr.textBaselineMapping = {
  baseline: "alphabetic",
  "before-edge": "top",
  "text-before-edge": "top",
  middle: "middle",
  central: "middle",
  "after-edge": "bottom",
  "text-after-edge": "bottom",
  ideographic: "ideographic",
  alphabetic: "alphabetic",
  hanging: "hanging",
  mathematical: "alphabetic"
};
class o4 {
  constructor() {
    this.viewPorts = [];
  }
  clear() {
    this.viewPorts = [];
  }
  setCurrent(t, e) {
    this.viewPorts.push({
      width: t,
      height: e
    });
  }
  removeCurrent() {
    this.viewPorts.pop();
  }
  getCurrent() {
    var {
      viewPorts: t
    } = this;
    return t[t.length - 1];
  }
  get width() {
    return this.getCurrent().width;
  }
  get height() {
    return this.getCurrent().height;
  }
  computeSize(t) {
    return typeof t == "number" ? t : t === "x" ? this.width : t === "y" ? this.height : Math.sqrt(Math.pow(this.width, 2) + Math.pow(this.height, 2)) / Math.sqrt(2);
  }
}
class _a {
  constructor(t, e) {
    this.x = t, this.y = e;
  }
  static parse(t) {
    var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, [r = e, a = e] = ks(t);
    return new _a(r, a);
  }
  static parseScale(t) {
    var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1, [r = e, a = r] = ks(t);
    return new _a(r, a);
  }
  static parsePath(t) {
    for (var e = ks(t), r = e.length, a = [], A = 0; A < r; A += 2)
      a.push(new _a(e[A], e[A + 1]));
    return a;
  }
  angleTo(t) {
    return Math.atan2(t.y - this.y, t.x - this.x);
  }
  applyTransform(t) {
    var {
      x: e,
      y: r
    } = this, a = e * t[0] + r * t[2] + t[4], A = e * t[1] + r * t[3] + t[5];
    this.x = a, this.y = A;
  }
}
class l4 {
  constructor(t) {
    this.screen = t, this.working = !1, this.events = [], this.eventElements = [], this.onClick = this.onClick.bind(this), this.onMouseMove = this.onMouseMove.bind(this);
  }
  isWorking() {
    return this.working;
  }
  start() {
    if (!this.working) {
      var {
        screen: t,
        onClick: e,
        onMouseMove: r
      } = this, a = t.ctx.canvas;
      a.onclick = e, a.onmousemove = r, this.working = !0;
    }
  }
  stop() {
    if (this.working) {
      var t = this.screen.ctx.canvas;
      this.working = !1, t.onclick = null, t.onmousemove = null;
    }
  }
  hasEvents() {
    return this.working && this.events.length > 0;
  }
  runEvents() {
    if (this.working) {
      var {
        screen: t,
        events: e,
        eventElements: r
      } = this, {
        style: a
      } = t.ctx.canvas;
      a && (a.cursor = ""), e.forEach((A, i) => {
        for (var {
          run: s
        } = A, o = r[i]; o; )
          s(o), o = o.parent;
      }), this.events = [], this.eventElements = [];
    }
  }
  checkPath(t, e) {
    if (!(!this.working || !e)) {
      var {
        events: r,
        eventElements: a
      } = this;
      r.forEach((A, i) => {
        var {
          x: s,
          y: o
        } = A;
        !a[i] && e.isPointInPath && e.isPointInPath(s, o) && (a[i] = t);
      });
    }
  }
  checkBoundingBox(t, e) {
    if (!(!this.working || !e)) {
      var {
        events: r,
        eventElements: a
      } = this;
      r.forEach((A, i) => {
        var {
          x: s,
          y: o
        } = A;
        !a[i] && e.isPointInBox(s, o) && (a[i] = t);
      });
    }
  }
  mapXY(t, e) {
    for (var {
      window: r,
      ctx: a
    } = this.screen, A = new _a(t, e), i = a.canvas; i; )
      A.x -= i.offsetLeft, A.y -= i.offsetTop, i = i.offsetParent;
    return r.scrollX && (A.x += r.scrollX), r.scrollY && (A.y += r.scrollY), A;
  }
  onClick(t) {
    var {
      x: e,
      y: r
    } = this.mapXY(t.clientX, t.clientY);
    this.events.push({
      type: "onclick",
      x: e,
      y: r,
      run(a) {
        a.onClick && a.onClick();
      }
    });
  }
  onMouseMove(t) {
    var {
      x: e,
      y: r
    } = this.mapXY(t.clientX, t.clientY);
    this.events.push({
      type: "onmousemove",
      x: e,
      y: r,
      run(a) {
        a.onMouseMove && a.onMouseMove();
      }
    });
  }
}
var u4 = typeof window < "u" ? window : null, c4 = typeof fetch < "u" ? fetch.bind(void 0) : null;
class sc {
  constructor(t) {
    var {
      fetch: e = c4,
      window: r = u4
    } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    this.ctx = t, this.FRAMERATE = 30, this.MAX_VIRTUAL_PIXELS = 3e4, this.CLIENT_WIDTH = 800, this.CLIENT_HEIGHT = 600, this.viewPort = new o4(), this.mouse = new l4(this), this.animations = [], this.waits = [], this.frameDuration = 0, this.isReadyLock = !1, this.isFirstRender = !0, this.intervalId = null, this.window = r, this.fetch = e;
  }
  wait(t) {
    this.waits.push(t);
  }
  ready() {
    return this.readyPromise ? this.readyPromise : Promise.resolve();
  }
  isReady() {
    if (this.isReadyLock)
      return !0;
    var t = this.waits.every((e) => e());
    return t && (this.waits = [], this.resolveReady && this.resolveReady()), this.isReadyLock = t, t;
  }
  setDefaults(t) {
    t.strokeStyle = "rgba(0,0,0,0)", t.lineCap = "butt", t.lineJoin = "miter", t.miterLimit = 4;
  }
  setViewBox(t) {
    var {
      document: e,
      ctx: r,
      aspectRatio: a,
      width: A,
      desiredWidth: i,
      height: s,
      desiredHeight: o,
      minX: l = 0,
      minY: u = 0,
      refX: f,
      refY: h,
      clip: c = !1,
      clipX: p = 0,
      clipY: w = 0
    } = t, y = pl(a).replace(/^defer\s/, ""), [m, k] = y.split(" "), D = m || "xMidYMid", B = k || "meet", O = A / i, q = s / o, G = Math.min(O, q), W = Math.max(O, q), F = i, Y = o;
    B === "meet" && (F *= G, Y *= G), B === "slice" && (F *= W, Y *= W);
    var T = new Tr(e, "refX", f), E = new Tr(e, "refY", h), Q = T.hasValue() && E.hasValue();
    if (Q && r.translate(-G * T.getPixels("x"), -G * E.getPixels("y")), c) {
      var x = G * p, oe = G * w;
      r.beginPath(), r.moveTo(x, oe), r.lineTo(A, oe), r.lineTo(A, s), r.lineTo(x, s), r.closePath(), r.clip();
    }
    if (!Q) {
      var J = B === "meet" && G === q, S = B === "slice" && W === q, I = B === "meet" && G === O, N = B === "slice" && W === O;
      D.startsWith("xMid") && (J || S) && r.translate(A / 2 - F / 2, 0), D.endsWith("YMid") && (I || N) && r.translate(0, s / 2 - Y / 2), D.startsWith("xMax") && (J || S) && r.translate(A - F, 0), D.endsWith("YMax") && (I || N) && r.translate(0, s - Y);
    }
    switch (!0) {
      case D === "none":
        r.scale(O, q);
        break;
      case B === "meet":
        r.scale(G, G);
        break;
      case B === "slice":
        r.scale(W, W);
        break;
    }
    r.translate(-l, -u);
  }
  start(t) {
    var {
      enableRedraw: e = !1,
      ignoreMouse: r = !1,
      ignoreAnimation: a = !1,
      ignoreDimensions: A = !1,
      ignoreClear: i = !1,
      forceRedraw: s,
      scaleWidth: o,
      scaleHeight: l,
      offsetX: u,
      offsetY: f
    } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, {
      FRAMERATE: h,
      mouse: c
    } = this, p = 1e3 / h;
    if (this.frameDuration = p, this.readyPromise = new Promise((D) => {
      this.resolveReady = D;
    }), this.isReady() && this.render(t, A, i, o, l, u, f), !!e) {
      var w = Date.now(), y = w, m = 0, k = () => {
        w = Date.now(), m = w - y, m >= p && (y = w - m % p, this.shouldUpdate(a, s) && (this.render(t, A, i, o, l, u, f), c.runEvents())), this.intervalId = rp(k);
      };
      r || c.start(), this.intervalId = rp(k);
    }
  }
  stop() {
    this.intervalId && (rp.cancel(this.intervalId), this.intervalId = null), this.mouse.stop();
  }
  shouldUpdate(t, e) {
    if (!t) {
      var {
        frameDuration: r
      } = this, a = this.animations.reduce((A, i) => i.update(r) || A, !1);
      if (a)
        return !0;
    }
    return !!(typeof e == "function" && e() || !this.isReadyLock && this.isReady() || this.mouse.hasEvents());
  }
  render(t, e, r, a, A, i, s) {
    var {
      CLIENT_WIDTH: o,
      CLIENT_HEIGHT: l,
      viewPort: u,
      ctx: f,
      isFirstRender: h
    } = this, c = f.canvas;
    u.clear(), c.width && c.height ? u.setCurrent(c.width, c.height) : u.setCurrent(o, l);
    var p = t.getStyle("width"), w = t.getStyle("height");
    !e && (h || typeof a != "number" && typeof A != "number") && (p.hasValue() && (c.width = p.getPixels("x"), c.style && (c.style.width = "".concat(c.width, "px"))), w.hasValue() && (c.height = w.getPixels("y"), c.style && (c.style.height = "".concat(c.height, "px"))));
    var y = c.clientWidth || c.width, m = c.clientHeight || c.height;
    if (e && p.hasValue() && w.hasValue() && (y = p.getPixels("x"), m = w.getPixels("y")), u.setCurrent(y, m), typeof i == "number" && t.getAttribute("x", !0).setValue(i), typeof s == "number" && t.getAttribute("y", !0).setValue(s), typeof a == "number" || typeof A == "number") {
      var k = ks(t.getAttribute("viewBox").getString()), D = 0, B = 0;
      if (typeof a == "number") {
        var O = t.getStyle("width");
        O.hasValue() ? D = O.getPixels("x") / a : isNaN(k[2]) || (D = k[2] / a);
      }
      if (typeof A == "number") {
        var q = t.getStyle("height");
        q.hasValue() ? B = q.getPixels("y") / A : isNaN(k[3]) || (B = k[3] / A);
      }
      D || (D = B), B || (B = D), t.getAttribute("width", !0).setValue(a), t.getAttribute("height", !0).setValue(A);
      var G = t.getStyle("transform", !0, !0);
      G.setValue("".concat(G.getString(), " scale(").concat(1 / D, ", ").concat(1 / B, ")"));
    }
    r || f.clearRect(0, 0, y, m), t.render(f), h && (this.isFirstRender = !1);
  }
}
sc.defaultWindow = u4;
sc.defaultFetch = c4;
var {
  defaultFetch: S9
} = sc, F9 = typeof DOMParser < "u" ? DOMParser : null;
class Dd {
  constructor() {
    var {
      fetch: t = S9,
      DOMParser: e = F9
    } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    this.fetch = t, this.DOMParser = e;
  }
  parse(t) {
    var e = this;
    return io(function* () {
      return t.startsWith("<") ? e.parseFromString(t) : e.load(t);
    })();
  }
  parseFromString(t) {
    var e = new this.DOMParser();
    try {
      return this.checkDocument(e.parseFromString(t, "image/svg+xml"));
    } catch {
      return this.checkDocument(e.parseFromString(t, "text/xml"));
    }
  }
  checkDocument(t) {
    var e = t.getElementsByTagName("parsererror")[0];
    if (e)
      throw new Error(e.textContent);
    return t;
  }
  load(t) {
    var e = this;
    return io(function* () {
      var r = yield e.fetch(t), a = yield r.text();
      return e.parseFromString(a);
    })();
  }
}
class d4 {
  constructor(t, e) {
    this.type = "translate", this.point = null, this.point = _a.parse(e);
  }
  apply(t) {
    var {
      x: e,
      y: r
    } = this.point;
    t.translate(e || 0, r || 0);
  }
  unapply(t) {
    var {
      x: e,
      y: r
    } = this.point;
    t.translate(-1 * e || 0, -1 * r || 0);
  }
  applyToPoint(t) {
    var {
      x: e,
      y: r
    } = this.point;
    t.applyTransform([1, 0, 0, 1, e || 0, r || 0]);
  }
}
class f4 {
  constructor(t, e, r) {
    this.type = "rotate", this.angle = null, this.originX = null, this.originY = null, this.cx = 0, this.cy = 0;
    var a = ks(e);
    this.angle = new Tr(t, "angle", a[0]), this.originX = r[0], this.originY = r[1], this.cx = a[1] || 0, this.cy = a[2] || 0;
  }
  apply(t) {
    var {
      cx: e,
      cy: r,
      originX: a,
      originY: A,
      angle: i
    } = this, s = e + a.getPixels("x"), o = r + A.getPixels("y");
    t.translate(s, o), t.rotate(i.getRadians()), t.translate(-s, -o);
  }
  unapply(t) {
    var {
      cx: e,
      cy: r,
      originX: a,
      originY: A,
      angle: i
    } = this, s = e + a.getPixels("x"), o = r + A.getPixels("y");
    t.translate(s, o), t.rotate(-1 * i.getRadians()), t.translate(-s, -o);
  }
  applyToPoint(t) {
    var {
      cx: e,
      cy: r,
      angle: a
    } = this, A = a.getRadians();
    t.applyTransform([
      1,
      0,
      0,
      1,
      e || 0,
      r || 0
      // this.p.y
    ]), t.applyTransform([Math.cos(A), Math.sin(A), -Math.sin(A), Math.cos(A), 0, 0]), t.applyTransform([
      1,
      0,
      0,
      1,
      -e || 0,
      -r || 0
      // -this.p.y
    ]);
  }
}
class h4 {
  constructor(t, e, r) {
    this.type = "scale", this.scale = null, this.originX = null, this.originY = null;
    var a = _a.parseScale(e);
    (a.x === 0 || a.y === 0) && (a.x = ol, a.y = ol), this.scale = a, this.originX = r[0], this.originY = r[1];
  }
  apply(t) {
    var {
      scale: {
        x: e,
        y: r
      },
      originX: a,
      originY: A
    } = this, i = a.getPixels("x"), s = A.getPixels("y");
    t.translate(i, s), t.scale(e, r || e), t.translate(-i, -s);
  }
  unapply(t) {
    var {
      scale: {
        x: e,
        y: r
      },
      originX: a,
      originY: A
    } = this, i = a.getPixels("x"), s = A.getPixels("y");
    t.translate(i, s), t.scale(1 / e, 1 / r || e), t.translate(-i, -s);
  }
  applyToPoint(t) {
    var {
      x: e,
      y: r
    } = this.scale;
    t.applyTransform([e || 0, 0, 0, r || 0, 0, 0]);
  }
}
class J0 {
  constructor(t, e, r) {
    this.type = "matrix", this.matrix = [], this.originX = null, this.originY = null, this.matrix = ks(e), this.originX = r[0], this.originY = r[1];
  }
  apply(t) {
    var {
      originX: e,
      originY: r,
      matrix: a
    } = this, A = e.getPixels("x"), i = r.getPixels("y");
    t.translate(A, i), t.transform(a[0], a[1], a[2], a[3], a[4], a[5]), t.translate(-A, -i);
  }
  unapply(t) {
    var {
      originX: e,
      originY: r,
      matrix: a
    } = this, A = a[0], i = a[2], s = a[4], o = a[1], l = a[3], u = a[5], f = 0, h = 0, c = 1, p = 1 / (A * (l * c - u * h) - i * (o * c - u * f) + s * (o * h - l * f)), w = e.getPixels("x"), y = r.getPixels("y");
    t.translate(w, y), t.transform(p * (l * c - u * h), p * (u * f - o * c), p * (s * h - i * c), p * (A * c - s * f), p * (i * u - s * l), p * (s * o - A * u)), t.translate(-w, -y);
  }
  applyToPoint(t) {
    t.applyTransform(this.matrix);
  }
}
class Z0 extends J0 {
  constructor(t, e, r) {
    super(t, e, r), this.type = "skew", this.angle = null, this.angle = new Tr(t, "angle", e);
  }
}
class g4 extends Z0 {
  constructor(t, e, r) {
    super(t, e, r), this.type = "skewX", this.matrix = [1, 0, Math.tan(this.angle.getRadians()), 1, 0, 0];
  }
}
class v4 extends Z0 {
  constructor(t, e, r) {
    super(t, e, r), this.type = "skewY", this.matrix = [1, Math.tan(this.angle.getRadians()), 0, 1, 0, 0];
  }
}
function U9(n) {
  return pl(n).trim().replace(/\)([a-zA-Z])/g, ") $1").replace(/\)(\s?,\s?)/g, ") ").split(/\s(?=[a-z])/);
}
function L9(n) {
  var [t, e] = n.split("(");
  return [t.trim(), e.trim().replace(")", "")];
}
class Ho {
  constructor(t, e, r) {
    this.document = t, this.transforms = [];
    var a = U9(e);
    a.forEach((A) => {
      if (A !== "none") {
        var [i, s] = L9(A), o = Ho.transformTypes[i];
        typeof o < "u" && this.transforms.push(new o(this.document, s, r));
      }
    });
  }
  static fromElement(t, e) {
    var r = e.getStyle("transform", !1, !0), [a, A = a] = e.getStyle("transform-origin", !1, !0).split(), i = [a, A];
    return r.hasValue() ? new Ho(t, r.getString(), i) : null;
  }
  apply(t) {
    for (var {
      transforms: e
    } = this, r = e.length, a = 0; a < r; a++)
      e[a].apply(t);
  }
  unapply(t) {
    for (var {
      transforms: e
    } = this, r = e.length, a = r - 1; a >= 0; a--)
      e[a].unapply(t);
  }
  // TODO: applyToPoint unused ... remove?
  applyToPoint(t) {
    for (var {
      transforms: e
    } = this, r = e.length, a = 0; a < r; a++)
      e[a].applyToPoint(t);
  }
}
Ho.transformTypes = {
  translate: d4,
  rotate: f4,
  scale: h4,
  matrix: J0,
  skewX: g4,
  skewY: v4
};
class Aa {
  constructor(t, e) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
    if (this.document = t, this.node = e, this.captureTextNodes = r, this.attributes = /* @__PURE__ */ Object.create(null), this.styles = /* @__PURE__ */ Object.create(null), this.stylesSpecificity = /* @__PURE__ */ Object.create(null), this.animationFrozen = !1, this.animationFrozenValue = "", this.parent = null, this.children = [], !(!e || e.nodeType !== 1)) {
      if (Array.from(e.attributes).forEach((s) => {
        var o = A4(s.nodeName);
        this.attributes[o] = new Tr(t, o, s.value);
      }), this.addStylesFromStyleDefinition(), this.getAttribute("style").hasValue()) {
        var a = this.getAttribute("style").getString().split(";").map((s) => s.trim());
        a.forEach((s) => {
          if (s) {
            var [o, l] = s.split(":").map((u) => u.trim());
            this.styles[o] = new Tr(t, o, l);
          }
        });
      }
      var {
        definitions: A
      } = t, i = this.getAttribute("id");
      i.hasValue() && (A[i.getString()] || (A[i.getString()] = this)), Array.from(e.childNodes).forEach((s) => {
        if (s.nodeType === 1)
          this.addChild(s);
        else if (r && (s.nodeType === 3 || s.nodeType === 4)) {
          var o = t.createTextNode(s);
          o.getText().length > 0 && this.addChild(o);
        }
      });
    }
  }
  getAttribute(t) {
    var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, r = this.attributes[t];
    if (!r && e) {
      var a = new Tr(this.document, t, "");
      return this.attributes[t] = a, a;
    }
    return r || Tr.empty(this.document);
  }
  getHrefAttribute() {
    for (var t in this.attributes)
      if (t === "href" || t.endsWith(":href"))
        return this.attributes[t];
    return Tr.empty(this.document);
  }
  getStyle(t) {
    var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, a = this.styles[t];
    if (a)
      return a;
    var A = this.getAttribute(t);
    if (A != null && A.hasValue())
      return this.styles[t] = A, A;
    if (!r) {
      var {
        parent: i
      } = this;
      if (i) {
        var s = i.getStyle(t);
        if (s != null && s.hasValue())
          return s;
      }
    }
    if (e) {
      var o = new Tr(this.document, t, "");
      return this.styles[t] = o, o;
    }
    return a || Tr.empty(this.document);
  }
  render(t) {
    if (!(this.getStyle("display").getString() === "none" || this.getStyle("visibility").getString() === "hidden")) {
      if (t.save(), this.getStyle("mask").hasValue()) {
        var e = this.getStyle("mask").getDefinition();
        e && (this.applyEffects(t), e.apply(t, this));
      } else if (this.getStyle("filter").getValue("none") !== "none") {
        var r = this.getStyle("filter").getDefinition();
        r && (this.applyEffects(t), r.apply(t, this));
      } else
        this.setContext(t), this.renderChildren(t), this.clearContext(t);
      t.restore();
    }
  }
  setContext(t) {
  }
  applyEffects(t) {
    var e = Ho.fromElement(this.document, this);
    e && e.apply(t);
    var r = this.getStyle("clip-path", !1, !0);
    if (r.hasValue()) {
      var a = r.getDefinition();
      a && a.apply(t);
    }
  }
  clearContext(t) {
  }
  renderChildren(t) {
    this.children.forEach((e) => {
      e.render(t);
    });
  }
  addChild(t) {
    var e = t instanceof Aa ? t : this.document.createElement(t);
    e.parent = this, Aa.ignoreChildTypes.includes(e.type) || this.children.push(e);
  }
  matchesSelector(t) {
    var e, {
      node: r
    } = this;
    if (typeof r.matches == "function")
      return r.matches(t);
    var a = (e = r.getAttribute) === null || e === void 0 ? void 0 : e.call(r, "class");
    return !a || a === "" ? !1 : a.split(" ").some((A) => ".".concat(A) === t);
  }
  addStylesFromStyleDefinition() {
    var {
      styles: t,
      stylesSpecificity: e
    } = this.document;
    for (var r in t)
      if (!r.startsWith("@") && this.matchesSelector(r)) {
        var a = t[r], A = e[r];
        if (a)
          for (var i in a) {
            var s = this.stylesSpecificity[i];
            typeof s > "u" && (s = "000"), A >= s && (this.styles[i] = a[i], this.stylesSpecificity[i] = A);
          }
      }
  }
  removeStyles(t, e) {
    var r = e.reduce((a, A) => {
      var i = t.getStyle(A);
      if (!i.hasValue())
        return a;
      var s = i.getString();
      return i.setValue(""), [...a, [A, s]];
    }, []);
    return r;
  }
  restoreStyles(t, e) {
    e.forEach((r) => {
      var [a, A] = r;
      t.getStyle(a, !0).setValue(A);
    });
  }
  isFirstChild() {
    var t;
    return ((t = this.parent) === null || t === void 0 ? void 0 : t.children.indexOf(this)) === 0;
  }
}
Aa.ignoreChildTypes = ["title"];
class p4 extends Aa {
  constructor(t, e, r) {
    super(t, e, r);
  }
}
function I9(n) {
  var t = n.trim();
  return /^('|")/.test(t) ? t : '"'.concat(t, '"');
}
function Q9(n) {
  return typeof process > "u" ? n : n.trim().split(",").map(I9).join(",");
}
function M9(n) {
  if (!n)
    return "";
  var t = n.trim().toLowerCase();
  switch (t) {
    case "normal":
    case "italic":
    case "oblique":
    case "inherit":
    case "initial":
    case "unset":
      return t;
    default:
      return /^oblique\s+(-|)\d+deg$/.test(t) ? t : "";
  }
}
function _9(n) {
  if (!n)
    return "";
  var t = n.trim().toLowerCase();
  switch (t) {
    case "normal":
    case "bold":
    case "lighter":
    case "bolder":
    case "inherit":
    case "initial":
    case "unset":
      return t;
    default:
      return /^[\d.]+$/.test(t) ? t : "";
  }
}
class ZA {
  constructor(t, e, r, a, A, i) {
    var s = i ? typeof i == "string" ? ZA.parse(i) : i : {};
    this.fontFamily = A || s.fontFamily, this.fontSize = a || s.fontSize, this.fontStyle = t || s.fontStyle, this.fontWeight = r || s.fontWeight, this.fontVariant = e || s.fontVariant;
  }
  static parse() {
    var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", e = arguments.length > 1 ? arguments[1] : void 0, r = "", a = "", A = "", i = "", s = "", o = pl(t).trim().split(" "), l = {
      fontSize: !1,
      fontStyle: !1,
      fontWeight: !1,
      fontVariant: !1
    };
    return o.forEach((u) => {
      switch (!0) {
        case (!l.fontStyle && ZA.styles.includes(u)):
          u !== "inherit" && (r = u), l.fontStyle = !0;
          break;
        case (!l.fontVariant && ZA.variants.includes(u)):
          u !== "inherit" && (a = u), l.fontStyle = !0, l.fontVariant = !0;
          break;
        case (!l.fontWeight && ZA.weights.includes(u)):
          u !== "inherit" && (A = u), l.fontStyle = !0, l.fontVariant = !0, l.fontWeight = !0;
          break;
        case !l.fontSize:
          u !== "inherit" && ([i] = u.split("/")), l.fontStyle = !0, l.fontVariant = !0, l.fontWeight = !0, l.fontSize = !0;
          break;
        default:
          u !== "inherit" && (s += u);
      }
    }), new ZA(r, a, A, i, s, e);
  }
  toString() {
    return [
      M9(this.fontStyle),
      this.fontVariant,
      _9(this.fontWeight),
      this.fontSize,
      // Wrap fontFamily only on nodejs and only for canvas.ctx
      Q9(this.fontFamily)
    ].join(" ").trim();
  }
}
ZA.styles = "normal|italic|oblique|inherit";
ZA.variants = "normal|small-caps|inherit";
ZA.weights = "normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";
class zs {
  constructor() {
    var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Number.NaN, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Number.NaN, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Number.NaN, a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : Number.NaN;
    this.x1 = t, this.y1 = e, this.x2 = r, this.y2 = a, this.addPoint(t, e), this.addPoint(r, a);
  }
  get x() {
    return this.x1;
  }
  get y() {
    return this.y1;
  }
  get width() {
    return this.x2 - this.x1;
  }
  get height() {
    return this.y2 - this.y1;
  }
  addPoint(t, e) {
    typeof t < "u" && ((isNaN(this.x1) || isNaN(this.x2)) && (this.x1 = t, this.x2 = t), t < this.x1 && (this.x1 = t), t > this.x2 && (this.x2 = t)), typeof e < "u" && ((isNaN(this.y1) || isNaN(this.y2)) && (this.y1 = e, this.y2 = e), e < this.y1 && (this.y1 = e), e > this.y2 && (this.y2 = e));
  }
  addX(t) {
    this.addPoint(t, null);
  }
  addY(t) {
    this.addPoint(null, t);
  }
  addBoundingBox(t) {
    if (t) {
      var {
        x1: e,
        y1: r,
        x2: a,
        y2: A
      } = t;
      this.addPoint(e, r), this.addPoint(a, A);
    }
  }
  sumCubic(t, e, r, a, A) {
    return Math.pow(1 - t, 3) * e + 3 * Math.pow(1 - t, 2) * t * r + 3 * (1 - t) * Math.pow(t, 2) * a + Math.pow(t, 3) * A;
  }
  bezierCurveAdd(t, e, r, a, A) {
    var i = 6 * e - 12 * r + 6 * a, s = -3 * e + 9 * r - 9 * a + 3 * A, o = 3 * r - 3 * e;
    if (s === 0) {
      if (i === 0)
        return;
      var l = -o / i;
      0 < l && l < 1 && (t ? this.addX(this.sumCubic(l, e, r, a, A)) : this.addY(this.sumCubic(l, e, r, a, A)));
      return;
    }
    var u = Math.pow(i, 2) - 4 * o * s;
    if (!(u < 0)) {
      var f = (-i + Math.sqrt(u)) / (2 * s);
      0 < f && f < 1 && (t ? this.addX(this.sumCubic(f, e, r, a, A)) : this.addY(this.sumCubic(f, e, r, a, A)));
      var h = (-i - Math.sqrt(u)) / (2 * s);
      0 < h && h < 1 && (t ? this.addX(this.sumCubic(h, e, r, a, A)) : this.addY(this.sumCubic(h, e, r, a, A)));
    }
  }
  // from http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html
  addBezierCurve(t, e, r, a, A, i, s, o) {
    this.addPoint(t, e), this.addPoint(s, o), this.bezierCurveAdd(!0, t, r, A, s), this.bezierCurveAdd(!1, e, a, i, o);
  }
  addQuadraticCurve(t, e, r, a, A, i) {
    var s = t + 0.6666666666666666 * (r - t), o = e + 2 / 3 * (a - e), l = s + 1 / 3 * (A - t), u = o + 1 / 3 * (i - e);
    this.addBezierCurve(t, e, s, l, o, u, A, i);
  }
  isPointInBox(t, e) {
    var {
      x1: r,
      y1: a,
      x2: A,
      y2: i
    } = this;
    return r <= t && t <= A && a <= e && e <= i;
  }
}
class Gr extends Pt {
  constructor(t) {
    super(t.replace(/([+\-.])\s+/gm, "$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g, "")), this.control = null, this.start = null, this.current = null, this.command = null, this.commands = this.commands, this.i = -1, this.previousCommand = null, this.points = [], this.angles = [];
  }
  reset() {
    this.i = -1, this.command = null, this.previousCommand = null, this.start = new _a(0, 0), this.control = new _a(0, 0), this.current = new _a(0, 0), this.points = [], this.angles = [];
  }
  isEnd() {
    var {
      i: t,
      commands: e
    } = this;
    return t >= e.length - 1;
  }
  next() {
    var t = this.commands[++this.i];
    return this.previousCommand = this.command, this.command = t, t;
  }
  getPoint() {
    var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "x", e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "y", r = new _a(this.command[t], this.command[e]);
    return this.makeAbsolute(r);
  }
  getAsControlPoint(t, e) {
    var r = this.getPoint(t, e);
    return this.control = r, r;
  }
  getAsCurrentPoint(t, e) {
    var r = this.getPoint(t, e);
    return this.current = r, r;
  }
  getReflectedControlPoint() {
    var t = this.previousCommand.type;
    if (t !== Pt.CURVE_TO && t !== Pt.SMOOTH_CURVE_TO && t !== Pt.QUAD_TO && t !== Pt.SMOOTH_QUAD_TO)
      return this.current;
    var {
      current: {
        x: e,
        y: r
      },
      control: {
        x: a,
        y: A
      }
    } = this, i = new _a(2 * e - a, 2 * r - A);
    return i;
  }
  makeAbsolute(t) {
    if (this.command.relative) {
      var {
        x: e,
        y: r
      } = this.current;
      t.x += e, t.y += r;
    }
    return t;
  }
  addMarker(t, e, r) {
    var {
      points: a,
      angles: A
    } = this;
    r && A.length > 0 && !A[A.length - 1] && (A[A.length - 1] = a[a.length - 1].angleTo(r)), this.addMarkerAngle(t, e ? e.angleTo(t) : null);
  }
  addMarkerAngle(t, e) {
    this.points.push(t), this.angles.push(e);
  }
  getMarkerPoints() {
    return this.points;
  }
  getMarkerAngles() {
    for (var {
      angles: t
    } = this, e = t.length, r = 0; r < e; r++)
      if (!t[r]) {
        for (var a = r + 1; a < e; a++)
          if (t[a]) {
            t[r] = t[a];
            break;
          }
      }
    return t;
  }
}
class Po extends Aa {
  constructor() {
    super(...arguments), this.modifiedEmSizeStack = !1;
  }
  calculateOpacity() {
    for (var t = 1, e = this; e; ) {
      var r = e.getStyle("opacity", !1, !0);
      r.hasValue(!0) && (t *= r.getNumber()), e = e.parent;
    }
    return t;
  }
  setContext(t) {
    var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
    if (!e) {
      var r = this.getStyle("fill"), a = this.getStyle("fill-opacity"), A = this.getStyle("stroke"), i = this.getStyle("stroke-opacity");
      if (r.isUrlDefinition()) {
        var s = r.getFillStyleDefinition(this, a);
        s && (t.fillStyle = s);
      } else if (r.hasValue()) {
        r.getString() === "currentColor" && r.setValue(this.getStyle("color").getColor());
        var o = r.getColor();
        o !== "inherit" && (t.fillStyle = o === "none" ? "rgba(0,0,0,0)" : o);
      }
      if (a.hasValue()) {
        var l = new Tr(this.document, "fill", t.fillStyle).addOpacity(a).getColor();
        t.fillStyle = l;
      }
      if (A.isUrlDefinition()) {
        var u = A.getFillStyleDefinition(this, i);
        u && (t.strokeStyle = u);
      } else if (A.hasValue()) {
        A.getString() === "currentColor" && A.setValue(this.getStyle("color").getColor());
        var f = A.getString();
        f !== "inherit" && (t.strokeStyle = f === "none" ? "rgba(0,0,0,0)" : f);
      }
      if (i.hasValue()) {
        var h = new Tr(this.document, "stroke", t.strokeStyle).addOpacity(i).getString();
        t.strokeStyle = h;
      }
      var c = this.getStyle("stroke-width");
      if (c.hasValue()) {
        var p = c.getPixels();
        t.lineWidth = p || ol;
      }
      var w = this.getStyle("stroke-linecap"), y = this.getStyle("stroke-linejoin"), m = this.getStyle("stroke-miterlimit"), k = this.getStyle("stroke-dasharray"), D = this.getStyle("stroke-dashoffset");
      if (w.hasValue() && (t.lineCap = w.getString()), y.hasValue() && (t.lineJoin = y.getString()), m.hasValue() && (t.miterLimit = m.getNumber()), k.hasValue() && k.getString() !== "none") {
        var B = ks(k.getString());
        typeof t.setLineDash < "u" ? t.setLineDash(B) : typeof t.webkitLineDash < "u" ? t.webkitLineDash = B : typeof t.mozDash < "u" && !(B.length === 1 && B[0] === 0) && (t.mozDash = B);
        var O = D.getPixels();
        typeof t.lineDashOffset < "u" ? t.lineDashOffset = O : typeof t.webkitLineDashOffset < "u" ? t.webkitLineDashOffset = O : typeof t.mozDashOffset < "u" && (t.mozDashOffset = O);
      }
    }
    if (this.modifiedEmSizeStack = !1, typeof t.font < "u") {
      var q = this.getStyle("font"), G = this.getStyle("font-style"), W = this.getStyle("font-variant"), F = this.getStyle("font-weight"), Y = this.getStyle("font-size"), T = this.getStyle("font-family"), E = new ZA(G.getString(), W.getString(), F.getString(), Y.hasValue() ? "".concat(Y.getPixels(!0), "px") : "", T.getString(), ZA.parse(q.getString(), t.font));
      G.setValue(E.fontStyle), W.setValue(E.fontVariant), F.setValue(E.fontWeight), Y.setValue(E.fontSize), T.setValue(E.fontFamily), t.font = E.toString(), Y.isPixels() && (this.document.emSize = Y.getPixels(), this.modifiedEmSizeStack = !0);
    }
    e || (this.applyEffects(t), t.globalAlpha = this.calculateOpacity());
  }
  clearContext(t) {
    super.clearContext(t), this.modifiedEmSizeStack && this.document.popEmSize();
  }
}
class Rn extends Po {
  constructor(t, e, r) {
    super(t, e, r), this.type = "path", this.pathParser = null, this.pathParser = new Gr(this.getAttribute("d").getString());
  }
  path(t) {
    var {
      pathParser: e
    } = this, r = new zs();
    for (e.reset(), t && t.beginPath(); !e.isEnd(); )
      switch (e.next().type) {
        case Gr.MOVE_TO:
          this.pathM(t, r);
          break;
        case Gr.LINE_TO:
          this.pathL(t, r);
          break;
        case Gr.HORIZ_LINE_TO:
          this.pathH(t, r);
          break;
        case Gr.VERT_LINE_TO:
          this.pathV(t, r);
          break;
        case Gr.CURVE_TO:
          this.pathC(t, r);
          break;
        case Gr.SMOOTH_CURVE_TO:
          this.pathS(t, r);
          break;
        case Gr.QUAD_TO:
          this.pathQ(t, r);
          break;
        case Gr.SMOOTH_QUAD_TO:
          this.pathT(t, r);
          break;
        case Gr.ARC:
          this.pathA(t, r);
          break;
        case Gr.CLOSE_PATH:
          this.pathZ(t, r);
          break;
      }
    return r;
  }
  getBoundingBox(t) {
    return this.path();
  }
  getMarkers() {
    var {
      pathParser: t
    } = this, e = t.getMarkerPoints(), r = t.getMarkerAngles(), a = e.map((A, i) => [A, r[i]]);
    return a;
  }
  renderChildren(t) {
    this.path(t), this.document.screen.mouse.checkPath(this, t);
    var e = this.getStyle("fill-rule");
    t.fillStyle !== "" && (e.getString("inherit") !== "inherit" ? t.fill(e.getString()) : t.fill()), t.strokeStyle !== "" && (this.getAttribute("vector-effect").getString() === "non-scaling-stroke" ? (t.save(), t.setTransform(1, 0, 0, 1, 0, 0), t.stroke(), t.restore()) : t.stroke());
    var r = this.getMarkers();
    if (r) {
      var a = r.length - 1, A = this.getStyle("marker-start"), i = this.getStyle("marker-mid"), s = this.getStyle("marker-end");
      if (A.isUrlDefinition()) {
        var o = A.getDefinition(), [l, u] = r[0];
        o.render(t, l, u);
      }
      if (i.isUrlDefinition())
        for (var f = i.getDefinition(), h = 1; h < a; h++) {
          var [c, p] = r[h];
          f.render(t, c, p);
        }
      if (s.isUrlDefinition()) {
        var w = s.getDefinition(), [y, m] = r[a];
        w.render(t, y, m);
      }
    }
  }
  static pathM(t) {
    var e = t.getAsCurrentPoint();
    return t.start = t.current, {
      point: e
    };
  }
  pathM(t, e) {
    var {
      pathParser: r
    } = this, {
      point: a
    } = Rn.pathM(r), {
      x: A,
      y: i
    } = a;
    r.addMarker(a), e.addPoint(A, i), t && t.moveTo(A, i);
  }
  static pathL(t) {
    var {
      current: e
    } = t, r = t.getAsCurrentPoint();
    return {
      current: e,
      point: r
    };
  }
  pathL(t, e) {
    var {
      pathParser: r
    } = this, {
      current: a,
      point: A
    } = Rn.pathL(r), {
      x: i,
      y: s
    } = A;
    r.addMarker(A, a), e.addPoint(i, s), t && t.lineTo(i, s);
  }
  static pathH(t) {
    var {
      current: e,
      command: r
    } = t, a = new _a((r.relative ? e.x : 0) + r.x, e.y);
    return t.current = a, {
      current: e,
      point: a
    };
  }
  pathH(t, e) {
    var {
      pathParser: r
    } = this, {
      current: a,
      point: A
    } = Rn.pathH(r), {
      x: i,
      y: s
    } = A;
    r.addMarker(A, a), e.addPoint(i, s), t && t.lineTo(i, s);
  }
  static pathV(t) {
    var {
      current: e,
      command: r
    } = t, a = new _a(e.x, (r.relative ? e.y : 0) + r.y);
    return t.current = a, {
      current: e,
      point: a
    };
  }
  pathV(t, e) {
    var {
      pathParser: r
    } = this, {
      current: a,
      point: A
    } = Rn.pathV(r), {
      x: i,
      y: s
    } = A;
    r.addMarker(A, a), e.addPoint(i, s), t && t.lineTo(i, s);
  }
  static pathC(t) {
    var {
      current: e
    } = t, r = t.getPoint("x1", "y1"), a = t.getAsControlPoint("x2", "y2"), A = t.getAsCurrentPoint();
    return {
      current: e,
      point: r,
      controlPoint: a,
      currentPoint: A
    };
  }
  pathC(t, e) {
    var {
      pathParser: r
    } = this, {
      current: a,
      point: A,
      controlPoint: i,
      currentPoint: s
    } = Rn.pathC(r);
    r.addMarker(s, i, A), e.addBezierCurve(a.x, a.y, A.x, A.y, i.x, i.y, s.x, s.y), t && t.bezierCurveTo(A.x, A.y, i.x, i.y, s.x, s.y);
  }
  static pathS(t) {
    var {
      current: e
    } = t, r = t.getReflectedControlPoint(), a = t.getAsControlPoint("x2", "y2"), A = t.getAsCurrentPoint();
    return {
      current: e,
      point: r,
      controlPoint: a,
      currentPoint: A
    };
  }
  pathS(t, e) {
    var {
      pathParser: r
    } = this, {
      current: a,
      point: A,
      controlPoint: i,
      currentPoint: s
    } = Rn.pathS(r);
    r.addMarker(s, i, A), e.addBezierCurve(a.x, a.y, A.x, A.y, i.x, i.y, s.x, s.y), t && t.bezierCurveTo(A.x, A.y, i.x, i.y, s.x, s.y);
  }
  static pathQ(t) {
    var {
      current: e
    } = t, r = t.getAsControlPoint("x1", "y1"), a = t.getAsCurrentPoint();
    return {
      current: e,
      controlPoint: r,
      currentPoint: a
    };
  }
  pathQ(t, e) {
    var {
      pathParser: r
    } = this, {
      current: a,
      controlPoint: A,
      currentPoint: i
    } = Rn.pathQ(r);
    r.addMarker(i, A, A), e.addQuadraticCurve(a.x, a.y, A.x, A.y, i.x, i.y), t && t.quadraticCurveTo(A.x, A.y, i.x, i.y);
  }
  static pathT(t) {
    var {
      current: e
    } = t, r = t.getReflectedControlPoint();
    t.control = r;
    var a = t.getAsCurrentPoint();
    return {
      current: e,
      controlPoint: r,
      currentPoint: a
    };
  }
  pathT(t, e) {
    var {
      pathParser: r
    } = this, {
      current: a,
      controlPoint: A,
      currentPoint: i
    } = Rn.pathT(r);
    r.addMarker(i, A, A), e.addQuadraticCurve(a.x, a.y, A.x, A.y, i.x, i.y), t && t.quadraticCurveTo(A.x, A.y, i.x, i.y);
  }
  static pathA(t) {
    var {
      current: e,
      command: r
    } = t, {
      rX: a,
      rY: A,
      xRot: i,
      lArcFlag: s,
      sweepFlag: o
    } = r, l = i * (Math.PI / 180), u = t.getAsCurrentPoint(), f = new _a(Math.cos(l) * (e.x - u.x) / 2 + Math.sin(l) * (e.y - u.y) / 2, -Math.sin(l) * (e.x - u.x) / 2 + Math.cos(l) * (e.y - u.y) / 2), h = Math.pow(f.x, 2) / Math.pow(a, 2) + Math.pow(f.y, 2) / Math.pow(A, 2);
    h > 1 && (a *= Math.sqrt(h), A *= Math.sqrt(h));
    var c = (s === o ? -1 : 1) * Math.sqrt((Math.pow(a, 2) * Math.pow(A, 2) - Math.pow(a, 2) * Math.pow(f.y, 2) - Math.pow(A, 2) * Math.pow(f.x, 2)) / (Math.pow(a, 2) * Math.pow(f.y, 2) + Math.pow(A, 2) * Math.pow(f.x, 2)));
    isNaN(c) && (c = 0);
    var p = new _a(c * a * f.y / A, c * -A * f.x / a), w = new _a((e.x + u.x) / 2 + Math.cos(l) * p.x - Math.sin(l) * p.y, (e.y + u.y) / 2 + Math.sin(l) * p.x + Math.cos(l) * p.y), y = r0([1, 0], [(f.x - p.x) / a, (f.y - p.y) / A]), m = [(f.x - p.x) / a, (f.y - p.y) / A], k = [(-f.x - p.x) / a, (-f.y - p.y) / A], D = r0(m, k);
    return $d(m, k) <= -1 && (D = Math.PI), $d(m, k) >= 1 && (D = 0), {
      currentPoint: u,
      rX: a,
      rY: A,
      sweepFlag: o,
      xAxisRotation: l,
      centp: w,
      a1: y,
      ad: D
    };
  }
  pathA(t, e) {
    var {
      pathParser: r
    } = this, {
      currentPoint: a,
      rX: A,
      rY: i,
      sweepFlag: s,
      xAxisRotation: o,
      centp: l,
      a1: u,
      ad: f
    } = Rn.pathA(r), h = 1 - s ? 1 : -1, c = u + h * (f / 2), p = new _a(l.x + A * Math.cos(c), l.y + i * Math.sin(c));
    if (r.addMarkerAngle(p, c - h * Math.PI / 2), r.addMarkerAngle(a, c - h * Math.PI), e.addPoint(a.x, a.y), t && !isNaN(u) && !isNaN(f)) {
      var w = A > i ? A : i, y = A > i ? 1 : A / i, m = A > i ? i / A : 1;
      t.translate(l.x, l.y), t.rotate(o), t.scale(y, m), t.arc(0, 0, w, u, u + f, !!(1 - s)), t.scale(1 / y, 1 / m), t.rotate(-o), t.translate(-l.x, -l.y);
    }
  }
  static pathZ(t) {
    t.current = t.start;
  }
  pathZ(t, e) {
    Rn.pathZ(this.pathParser), t && e.x1 !== e.x2 && e.y1 !== e.y2 && t.closePath();
  }
}
class em extends Rn {
  constructor(t, e, r) {
    super(t, e, r), this.type = "glyph", this.horizAdvX = this.getAttribute("horiz-adv-x").getNumber(), this.unicode = this.getAttribute("unicode").getString(), this.arabicForm = this.getAttribute("arabic-form").getString();
  }
}
class oo extends Po {
  constructor(t, e, r) {
    super(t, e, new.target === oo ? !0 : r), this.type = "text", this.x = 0, this.y = 0, this.measureCache = -1;
  }
  setContext(t) {
    var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
    super.setContext(t, e);
    var r = this.getStyle("dominant-baseline").getTextBaseline() || this.getStyle("alignment-baseline").getTextBaseline();
    r && (t.textBaseline = r);
  }
  initializeCoordinates() {
    this.x = 0, this.y = 0, this.leafTexts = [], this.textChunkStart = 0, this.minX = Number.POSITIVE_INFINITY, this.maxX = Number.NEGATIVE_INFINITY;
  }
  getBoundingBox(t) {
    if (this.type !== "text")
      return this.getTElementBoundingBox(t);
    this.initializeCoordinates(), this.adjustChildCoordinatesRecursive(t);
    var e = null;
    return this.children.forEach((r, a) => {
      var A = this.getChildBoundingBox(t, this, this, a);
      e ? e.addBoundingBox(A) : e = A;
    }), e;
  }
  getFontSize() {
    var {
      document: t,
      parent: e
    } = this, r = ZA.parse(t.ctx.font).fontSize, a = e.getStyle("font-size").getNumber(r);
    return a;
  }
  getTElementBoundingBox(t) {
    var e = this.getFontSize();
    return new zs(this.x, this.y - e, this.x + this.measureText(t), this.y);
  }
  getGlyph(t, e, r) {
    var a = e[r], A = null;
    if (t.isArabic) {
      var i = e.length, s = e[r - 1], o = e[r + 1], l = "isolated";
      if ((r === 0 || s === " ") && r < i - 1 && o !== " " && (l = "terminal"), r > 0 && s !== " " && r < i - 1 && o !== " " && (l = "medial"), r > 0 && s !== " " && (r === i - 1 || o === " ") && (l = "initial"), typeof t.glyphs[a] < "u") {
        var u = t.glyphs[a];
        A = u instanceof em ? u : u[l];
      }
    } else
      A = t.glyphs[a];
    return A || (A = t.missingGlyph), A;
  }
  getText() {
    return "";
  }
  getTextFromNode(t) {
    var e = t || this.node, r = Array.from(e.parentNode.childNodes), a = r.indexOf(e), A = r.length - 1, i = pl(
      // textNode.value
      // || textNode.text
      e.textContent || ""
    );
    return a === 0 && (i = n4(i)), a === A && (i = a4(i)), i;
  }
  renderChildren(t) {
    if (this.type !== "text") {
      this.renderTElementChildren(t);
      return;
    }
    this.initializeCoordinates(), this.adjustChildCoordinatesRecursive(t), this.children.forEach((r, a) => {
      this.renderChild(t, this, this, a);
    });
    var {
      mouse: e
    } = this.document.screen;
    e.isWorking() && e.checkBoundingBox(this, this.getBoundingBox(t));
  }
  renderTElementChildren(t) {
    var {
      document: e,
      parent: r
    } = this, a = this.getText(), A = r.getStyle("font-family").getDefinition();
    if (A) {
      for (var {
        unitsPerEm: i
      } = A.fontFace, s = ZA.parse(e.ctx.font), o = r.getStyle("font-size").getNumber(s.fontSize), l = r.getStyle("font-style").getString(s.fontStyle), u = o / i, f = A.isRTL ? a.split("").reverse().join("") : a, h = ks(r.getAttribute("dx").getString()), c = f.length, p = 0; p < c; p++) {
        var w = this.getGlyph(A, f, p);
        t.translate(this.x, this.y), t.scale(u, -u);
        var y = t.lineWidth;
        t.lineWidth = t.lineWidth * i / o, l === "italic" && t.transform(1, 0, 0.4, 1, 0, 0), w.render(t), l === "italic" && t.transform(1, 0, -0.4, 1, 0, 0), t.lineWidth = y, t.scale(1 / u, -1 / u), t.translate(-this.x, -this.y), this.x += o * (w.horizAdvX || A.horizAdvX) / i, typeof h[p] < "u" && !isNaN(h[p]) && (this.x += h[p]);
      }
      return;
    }
    var {
      x: m,
      y: k
    } = this;
    t.fillStyle && t.fillText(a, m, k), t.strokeStyle && t.strokeText(a, m, k);
  }
  applyAnchoring() {
    if (!(this.textChunkStart >= this.leafTexts.length)) {
      var t = this.leafTexts[this.textChunkStart], e = t.getStyle("text-anchor").getString("start"), r = !1, a = 0;
      e === "start" && !r || e === "end" && r ? a = t.x - this.minX : e === "end" && !r || e === "start" && r ? a = t.x - this.maxX : a = t.x - (this.minX + this.maxX) / 2;
      for (var A = this.textChunkStart; A < this.leafTexts.length; A++)
        this.leafTexts[A].x += a;
      this.minX = Number.POSITIVE_INFINITY, this.maxX = Number.NEGATIVE_INFINITY, this.textChunkStart = this.leafTexts.length;
    }
  }
  adjustChildCoordinatesRecursive(t) {
    this.children.forEach((e, r) => {
      this.adjustChildCoordinatesRecursiveCore(t, this, this, r);
    }), this.applyAnchoring();
  }
  adjustChildCoordinatesRecursiveCore(t, e, r, a) {
    var A = r.children[a];
    A.children.length > 0 ? A.children.forEach((i, s) => {
      e.adjustChildCoordinatesRecursiveCore(t, e, A, s);
    }) : this.adjustChildCoordinates(t, e, r, a);
  }
  adjustChildCoordinates(t, e, r, a) {
    var A = r.children[a];
    if (typeof A.measureText != "function")
      return A;
    t.save(), A.setContext(t, !0);
    var i = A.getAttribute("x"), s = A.getAttribute("y"), o = A.getAttribute("dx"), l = A.getAttribute("dy"), u = A.getStyle("font-family").getDefinition(), f = !!u && u.isRTL;
    a === 0 && (i.hasValue() || i.setValue(A.getInheritedAttribute("x")), s.hasValue() || s.setValue(A.getInheritedAttribute("y")), o.hasValue() || o.setValue(A.getInheritedAttribute("dx")), l.hasValue() || l.setValue(A.getInheritedAttribute("dy")));
    var h = A.measureText(t);
    return f && (e.x -= h), i.hasValue() ? (e.applyAnchoring(), A.x = i.getPixels("x"), o.hasValue() && (A.x += o.getPixels("x"))) : (o.hasValue() && (e.x += o.getPixels("x")), A.x = e.x), e.x = A.x, f || (e.x += h), s.hasValue() ? (A.y = s.getPixels("y"), l.hasValue() && (A.y += l.getPixels("y"))) : (l.hasValue() && (e.y += l.getPixels("y")), A.y = e.y), e.y = A.y, e.leafTexts.push(A), e.minX = Math.min(e.minX, A.x, A.x + h), e.maxX = Math.max(e.maxX, A.x, A.x + h), A.clearContext(t), t.restore(), A;
  }
  getChildBoundingBox(t, e, r, a) {
    var A = r.children[a];
    if (typeof A.getBoundingBox != "function")
      return null;
    var i = A.getBoundingBox(t);
    return i ? (A.children.forEach((s, o) => {
      var l = e.getChildBoundingBox(t, e, A, o);
      i.addBoundingBox(l);
    }), i) : null;
  }
  renderChild(t, e, r, a) {
    var A = r.children[a];
    A.render(t), A.children.forEach((i, s) => {
      e.renderChild(t, e, A, s);
    });
  }
  measureText(t) {
    var {
      measureCache: e
    } = this;
    if (~e)
      return e;
    var r = this.getText(), a = this.measureTargetText(t, r);
    return this.measureCache = a, a;
  }
  measureTargetText(t, e) {
    if (!e.length)
      return 0;
    var {
      parent: r
    } = this, a = r.getStyle("font-family").getDefinition();
    if (a) {
      for (var A = this.getFontSize(), i = a.isRTL ? e.split("").reverse().join("") : e, s = ks(r.getAttribute("dx").getString()), o = i.length, l = 0, u = 0; u < o; u++) {
        var f = this.getGlyph(a, i, u);
        l += (f.horizAdvX || a.horizAdvX) * A / a.fontFace.unitsPerEm, typeof s[u] < "u" && !isNaN(s[u]) && (l += s[u]);
      }
      return l;
    }
    if (!t.measureText)
      return e.length * 10;
    t.save(), this.setContext(t, !0);
    var {
      width: h
    } = t.measureText(e);
    return this.clearContext(t), t.restore(), h;
  }
  /**
   * Inherits positional attributes from {@link TextElement} parent(s). Attributes
   * are only inherited from a parent to its first child.
   * @param name - The attribute name.
   * @returns The attribute value or null.
   */
  getInheritedAttribute(t) {
    for (var e = this; e instanceof oo && e.isFirstChild(); ) {
      var r = e.parent.getAttribute(t);
      if (r.hasValue(!0))
        return r.getValue("0");
      e = e.parent;
    }
    return null;
  }
}
class ic extends oo {
  constructor(t, e, r) {
    super(t, e, new.target === ic ? !0 : r), this.type = "tspan", this.text = this.children.length > 0 ? "" : this.getTextFromNode();
  }
  getText() {
    return this.text;
  }
}
class R9 extends ic {
  constructor() {
    super(...arguments), this.type = "textNode";
  }
}
class nu extends Po {
  constructor() {
    super(...arguments), this.type = "svg", this.root = !1;
  }
  setContext(t) {
    var e, {
      document: r
    } = this, {
      screen: a,
      window: A
    } = r, i = t.canvas;
    if (a.setDefaults(t), i.style && typeof t.font < "u" && A && typeof A.getComputedStyle < "u") {
      t.font = A.getComputedStyle(i).getPropertyValue("font");
      var s = new Tr(r, "fontSize", ZA.parse(t.font).fontSize);
      s.hasValue() && (r.rootEmSize = s.getPixels("y"), r.emSize = r.rootEmSize);
    }
    this.getAttribute("x").hasValue() || this.getAttribute("x", !0).setValue(0), this.getAttribute("y").hasValue() || this.getAttribute("y", !0).setValue(0);
    var {
      width: o,
      height: l
    } = a.viewPort;
    this.getStyle("width").hasValue() || this.getStyle("width", !0).setValue("100%"), this.getStyle("height").hasValue() || this.getStyle("height", !0).setValue("100%"), this.getStyle("color").hasValue() || this.getStyle("color", !0).setValue("black");
    var u = this.getAttribute("refX"), f = this.getAttribute("refY"), h = this.getAttribute("viewBox"), c = h.hasValue() ? ks(h.getString()) : null, p = !this.root && this.getStyle("overflow").getValue("hidden") !== "visible", w = 0, y = 0, m = 0, k = 0;
    c && (w = c[0], y = c[1]), this.root || (o = this.getStyle("width").getPixels("x"), l = this.getStyle("height").getPixels("y"), this.type === "marker" && (m = w, k = y, w = 0, y = 0)), a.viewPort.setCurrent(o, l), this.node && (!this.parent || ((e = this.node.parentNode) === null || e === void 0 ? void 0 : e.nodeName) === "foreignObject") && this.getStyle("transform", !1, !0).hasValue() && !this.getStyle("transform-origin", !1, !0).hasValue() && this.getStyle("transform-origin", !0, !0).setValue("50% 50%"), super.setContext(t), t.translate(this.getAttribute("x").getPixels("x"), this.getAttribute("y").getPixels("y")), c && (o = c[2], l = c[3]), r.setViewBox({
      ctx: t,
      aspectRatio: this.getAttribute("preserveAspectRatio").getString(),
      width: a.viewPort.width,
      desiredWidth: o,
      height: a.viewPort.height,
      desiredHeight: l,
      minX: w,
      minY: y,
      refX: u.getValue(),
      refY: f.getValue(),
      clip: p,
      clipX: m,
      clipY: k
    }), c && (a.viewPort.removeCurrent(), a.viewPort.setCurrent(o, l));
  }
  clearContext(t) {
    super.clearContext(t), this.document.screen.viewPort.removeCurrent();
  }
  /**
   * Resize SVG to fit in given size.
   * @param width
   * @param height
   * @param preserveAspectRatio
   */
  resize(t) {
    var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : t, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, a = this.getAttribute("width", !0), A = this.getAttribute("height", !0), i = this.getAttribute("viewBox"), s = this.getAttribute("style"), o = a.getNumber(0), l = A.getNumber(0);
    if (r)
      if (typeof r == "string")
        this.getAttribute("preserveAspectRatio", !0).setValue(r);
      else {
        var u = this.getAttribute("preserveAspectRatio");
        u.hasValue() && u.setValue(u.getString().replace(/^\s*(\S.*\S)\s*$/, "$1"));
      }
    if (a.setValue(t), A.setValue(e), i.hasValue() || i.setValue("0 0 ".concat(o || t, " ").concat(l || e)), s.hasValue()) {
      var f = this.getStyle("width"), h = this.getStyle("height");
      f.hasValue() && f.setValue("".concat(t, "px")), h.hasValue() && h.setValue("".concat(e, "px"));
    }
  }
}
class tm extends Rn {
  constructor() {
    super(...arguments), this.type = "rect";
  }
  path(t) {
    var e = this.getAttribute("x").getPixels("x"), r = this.getAttribute("y").getPixels("y"), a = this.getStyle("width", !1, !0).getPixels("x"), A = this.getStyle("height", !1, !0).getPixels("y"), i = this.getAttribute("rx"), s = this.getAttribute("ry"), o = i.getPixels("x"), l = s.getPixels("y");
    if (i.hasValue() && !s.hasValue() && (l = o), s.hasValue() && !i.hasValue() && (o = l), o = Math.min(o, a / 2), l = Math.min(l, A / 2), t) {
      var u = 4 * ((Math.sqrt(2) - 1) / 3);
      t.beginPath(), A > 0 && a > 0 && (t.moveTo(e + o, r), t.lineTo(e + a - o, r), t.bezierCurveTo(e + a - o + u * o, r, e + a, r + l - u * l, e + a, r + l), t.lineTo(e + a, r + A - l), t.bezierCurveTo(e + a, r + A - l + u * l, e + a - o + u * o, r + A, e + a - o, r + A), t.lineTo(e + o, r + A), t.bezierCurveTo(e + o - u * o, r + A, e, r + A - l + u * l, e, r + A - l), t.lineTo(e, r + l), t.bezierCurveTo(e, r + l - u * l, e + o - u * o, r, e + o, r), t.closePath());
    }
    return new zs(e, r, e + a, r + A);
  }
  getMarkers() {
    return null;
  }
}
class m4 extends Rn {
  constructor() {
    super(...arguments), this.type = "circle";
  }
  path(t) {
    var e = this.getAttribute("cx").getPixels("x"), r = this.getAttribute("cy").getPixels("y"), a = this.getAttribute("r").getPixels();
    return t && a > 0 && (t.beginPath(), t.arc(e, r, a, 0, Math.PI * 2, !1), t.closePath()), new zs(e - a, r - a, e + a, r + a);
  }
  getMarkers() {
    return null;
  }
}
class w4 extends Rn {
  constructor() {
    super(...arguments), this.type = "ellipse";
  }
  path(t) {
    var e = 4 * ((Math.sqrt(2) - 1) / 3), r = this.getAttribute("rx").getPixels("x"), a = this.getAttribute("ry").getPixels("y"), A = this.getAttribute("cx").getPixels("x"), i = this.getAttribute("cy").getPixels("y");
    return t && r > 0 && a > 0 && (t.beginPath(), t.moveTo(A + r, i), t.bezierCurveTo(A + r, i + e * a, A + e * r, i + a, A, i + a), t.bezierCurveTo(A - e * r, i + a, A - r, i + e * a, A - r, i), t.bezierCurveTo(A - r, i - e * a, A - e * r, i - a, A, i - a), t.bezierCurveTo(A + e * r, i - a, A + r, i - e * a, A + r, i), t.closePath()), new zs(A - r, i - a, A + r, i + a);
  }
  getMarkers() {
    return null;
  }
}
class y4 extends Rn {
  constructor() {
    super(...arguments), this.type = "line";
  }
  getPoints() {
    return [new _a(this.getAttribute("x1").getPixels("x"), this.getAttribute("y1").getPixels("y")), new _a(this.getAttribute("x2").getPixels("x"), this.getAttribute("y2").getPixels("y"))];
  }
  path(t) {
    var [{
      x: e,
      y: r
    }, {
      x: a,
      y: A
    }] = this.getPoints();
    return t && (t.beginPath(), t.moveTo(e, r), t.lineTo(a, A)), new zs(e, r, a, A);
  }
  getMarkers() {
    var [t, e] = this.getPoints(), r = t.angleTo(e);
    return [[t, r], [e, r]];
  }
}
class rm extends Rn {
  constructor(t, e, r) {
    super(t, e, r), this.type = "polyline", this.points = [], this.points = _a.parsePath(this.getAttribute("points").getString());
  }
  path(t) {
    var {
      points: e
    } = this, [{
      x: r,
      y: a
    }] = e, A = new zs(r, a);
    return t && (t.beginPath(), t.moveTo(r, a)), e.forEach((i) => {
      var {
        x: s,
        y: o
      } = i;
      A.addPoint(s, o), t && t.lineTo(s, o);
    }), A;
  }
  getMarkers() {
    var {
      points: t
    } = this, e = t.length - 1, r = [];
    return t.forEach((a, A) => {
      A !== e && r.push([a, a.angleTo(t[A + 1])]);
    }), r.length > 0 && r.push([t[t.length - 1], r[r.length - 1][1]]), r;
  }
}
class B4 extends rm {
  constructor() {
    super(...arguments), this.type = "polygon";
  }
  path(t) {
    var e = super.path(t), [{
      x: r,
      y: a
    }] = this.points;
    return t && (t.lineTo(r, a), t.closePath()), e;
  }
}
class b4 extends Aa {
  constructor() {
    super(...arguments), this.type = "pattern";
  }
  createPattern(t, e, r) {
    var a = this.getStyle("width").getPixels("x", !0), A = this.getStyle("height").getPixels("y", !0), i = new nu(this.document, null);
    i.attributes.viewBox = new Tr(this.document, "viewBox", this.getAttribute("viewBox").getValue()), i.attributes.width = new Tr(this.document, "width", "".concat(a, "px")), i.attributes.height = new Tr(this.document, "height", "".concat(A, "px")), i.attributes.transform = new Tr(this.document, "transform", this.getAttribute("patternTransform").getValue()), i.children = this.children;
    var s = this.document.createCanvas(a, A), o = s.getContext("2d"), l = this.getAttribute("x"), u = this.getAttribute("y");
    l.hasValue() && u.hasValue() && o.translate(l.getPixels("x", !0), u.getPixels("y", !0)), r.hasValue() ? this.styles["fill-opacity"] = r : Reflect.deleteProperty(this.styles, "fill-opacity");
    for (var f = -1; f <= 1; f++)
      for (var h = -1; h <= 1; h++)
        o.save(), i.attributes.x = new Tr(this.document, "x", f * s.width), i.attributes.y = new Tr(this.document, "y", h * s.height), i.render(o), o.restore();
    var c = t.createPattern(s, "repeat");
    return c;
  }
}
class C4 extends Aa {
  constructor() {
    super(...arguments), this.type = "marker";
  }
  render(t, e, r) {
    if (e) {
      var {
        x: a,
        y: A
      } = e, i = this.getAttribute("orient").getString("auto"), s = this.getAttribute("markerUnits").getString("strokeWidth");
      t.translate(a, A), i === "auto" && t.rotate(r), s === "strokeWidth" && t.scale(t.lineWidth, t.lineWidth), t.save();
      var o = new nu(this.document, null);
      o.type = this.type, o.attributes.viewBox = new Tr(this.document, "viewBox", this.getAttribute("viewBox").getValue()), o.attributes.refX = new Tr(this.document, "refX", this.getAttribute("refX").getValue()), o.attributes.refY = new Tr(this.document, "refY", this.getAttribute("refY").getValue()), o.attributes.width = new Tr(this.document, "width", this.getAttribute("markerWidth").getValue()), o.attributes.height = new Tr(this.document, "height", this.getAttribute("markerHeight").getValue()), o.attributes.overflow = new Tr(this.document, "overflow", this.getAttribute("overflow").getValue()), o.attributes.fill = new Tr(this.document, "fill", this.getAttribute("fill").getColor("black")), o.attributes.stroke = new Tr(this.document, "stroke", this.getAttribute("stroke").getValue("none")), o.children = this.children, o.render(t), t.restore(), s === "strokeWidth" && t.scale(1 / t.lineWidth, 1 / t.lineWidth), i === "auto" && t.rotate(-r), t.translate(-a, -A);
    }
  }
}
class k4 extends Aa {
  constructor() {
    super(...arguments), this.type = "defs";
  }
  render() {
  }
}
class wf extends Po {
  constructor() {
    super(...arguments), this.type = "g";
  }
  getBoundingBox(t) {
    var e = new zs();
    return this.children.forEach((r) => {
      e.addBoundingBox(r.getBoundingBox(t));
    }), e;
  }
}
class nm extends Aa {
  constructor(t, e, r) {
    super(t, e, r), this.attributesToInherit = ["gradientUnits"], this.stops = [];
    var {
      stops: a,
      children: A
    } = this;
    A.forEach((i) => {
      i.type === "stop" && a.push(i);
    });
  }
  getGradientUnits() {
    return this.getAttribute("gradientUnits").getString("objectBoundingBox");
  }
  createGradient(t, e, r) {
    var a = this;
    this.getHrefAttribute().hasValue() && (a = this.getHrefAttribute().getDefinition(), this.inheritStopContainer(a));
    var {
      stops: A
    } = a, i = this.getGradient(t, e);
    if (!i)
      return this.addParentOpacity(r, A[A.length - 1].color);
    if (A.forEach((y) => {
      i.addColorStop(y.offset, this.addParentOpacity(r, y.color));
    }), this.getAttribute("gradientTransform").hasValue()) {
      var {
        document: s
      } = this, {
        MAX_VIRTUAL_PIXELS: o,
        viewPort: l
      } = s.screen, [u] = l.viewPorts, f = new tm(s, null);
      f.attributes.x = new Tr(s, "x", -o / 3), f.attributes.y = new Tr(s, "y", -o / 3), f.attributes.width = new Tr(s, "width", o), f.attributes.height = new Tr(s, "height", o);
      var h = new wf(s, null);
      h.attributes.transform = new Tr(s, "transform", this.getAttribute("gradientTransform").getValue()), h.children = [f];
      var c = new nu(s, null);
      c.attributes.x = new Tr(s, "x", 0), c.attributes.y = new Tr(s, "y", 0), c.attributes.width = new Tr(s, "width", u.width), c.attributes.height = new Tr(s, "height", u.height), c.children = [h];
      var p = s.createCanvas(u.width, u.height), w = p.getContext("2d");
      return w.fillStyle = i, c.render(w), w.createPattern(p, "no-repeat");
    }
    return i;
  }
  inheritStopContainer(t) {
    this.attributesToInherit.forEach((e) => {
      !this.getAttribute(e).hasValue() && t.getAttribute(e).hasValue() && this.getAttribute(e, !0).setValue(t.getAttribute(e).getValue());
    });
  }
  addParentOpacity(t, e) {
    if (t.hasValue()) {
      var r = new Tr(this.document, "color", e);
      return r.addOpacity(t).getColor();
    }
    return e;
  }
}
class T4 extends nm {
  constructor(t, e, r) {
    super(t, e, r), this.type = "linearGradient", this.attributesToInherit.push("x1", "y1", "x2", "y2");
  }
  getGradient(t, e) {
    var r = this.getGradientUnits() === "objectBoundingBox", a = r ? e.getBoundingBox(t) : null;
    if (r && !a)
      return null;
    !this.getAttribute("x1").hasValue() && !this.getAttribute("y1").hasValue() && !this.getAttribute("x2").hasValue() && !this.getAttribute("y2").hasValue() && (this.getAttribute("x1", !0).setValue(0), this.getAttribute("y1", !0).setValue(0), this.getAttribute("x2", !0).setValue(1), this.getAttribute("y2", !0).setValue(0));
    var A = r ? a.x + a.width * this.getAttribute("x1").getNumber() : this.getAttribute("x1").getPixels("x"), i = r ? a.y + a.height * this.getAttribute("y1").getNumber() : this.getAttribute("y1").getPixels("y"), s = r ? a.x + a.width * this.getAttribute("x2").getNumber() : this.getAttribute("x2").getPixels("x"), o = r ? a.y + a.height * this.getAttribute("y2").getNumber() : this.getAttribute("y2").getPixels("y");
    return A === s && i === o ? null : t.createLinearGradient(A, i, s, o);
  }
}
class x4 extends nm {
  constructor(t, e, r) {
    super(t, e, r), this.type = "radialGradient", this.attributesToInherit.push("cx", "cy", "r", "fx", "fy", "fr");
  }
  getGradient(t, e) {
    var r = this.getGradientUnits() === "objectBoundingBox", a = e.getBoundingBox(t);
    if (r && !a)
      return null;
    this.getAttribute("cx").hasValue() || this.getAttribute("cx", !0).setValue("50%"), this.getAttribute("cy").hasValue() || this.getAttribute("cy", !0).setValue("50%"), this.getAttribute("r").hasValue() || this.getAttribute("r", !0).setValue("50%");
    var A = r ? a.x + a.width * this.getAttribute("cx").getNumber() : this.getAttribute("cx").getPixels("x"), i = r ? a.y + a.height * this.getAttribute("cy").getNumber() : this.getAttribute("cy").getPixels("y"), s = A, o = i;
    this.getAttribute("fx").hasValue() && (s = r ? a.x + a.width * this.getAttribute("fx").getNumber() : this.getAttribute("fx").getPixels("x")), this.getAttribute("fy").hasValue() && (o = r ? a.y + a.height * this.getAttribute("fy").getNumber() : this.getAttribute("fy").getPixels("y"));
    var l = r ? (a.width + a.height) / 2 * this.getAttribute("r").getNumber() : this.getAttribute("r").getPixels(), u = this.getAttribute("fr").getPixels();
    return t.createRadialGradient(s, o, u, A, i, l);
  }
}
class D4 extends Aa {
  constructor(t, e, r) {
    super(t, e, r), this.type = "stop";
    var a = Math.max(0, Math.min(1, this.getAttribute("offset").getNumber())), A = this.getStyle("stop-opacity"), i = this.getStyle("stop-color", !0);
    i.getString() === "" && i.setValue("#000"), A.hasValue() && (i = i.addOpacity(A)), this.offset = a, this.color = i.getColor();
  }
}
class yf extends Aa {
  constructor(t, e, r) {
    super(t, e, r), this.type = "animate", this.duration = 0, this.initialValue = null, this.initialUnits = "", this.removed = !1, this.frozen = !1, t.screen.animations.push(this), this.begin = this.getAttribute("begin").getMilliseconds(), this.maxDuration = this.begin + this.getAttribute("dur").getMilliseconds(), this.from = this.getAttribute("from"), this.to = this.getAttribute("to"), this.values = new Tr(t, "values", null);
    var a = this.getAttribute("values");
    a.hasValue() && this.values.setValue(a.getString().split(";"));
  }
  getProperty() {
    var t = this.getAttribute("attributeType").getString(), e = this.getAttribute("attributeName").getString();
    return t === "CSS" ? this.parent.getStyle(e, !0) : this.parent.getAttribute(e, !0);
  }
  calcValue() {
    var {
      initialUnits: t
    } = this, {
      progress: e,
      from: r,
      to: a
    } = this.getProgress(), A = r.getNumber() + (a.getNumber() - r.getNumber()) * e;
    return t === "%" && (A *= 100), "".concat(A).concat(t);
  }
  update(t) {
    var {
      parent: e
    } = this, r = this.getProperty();
    if (this.initialValue || (this.initialValue = r.getString(), this.initialUnits = r.getUnits()), this.duration > this.maxDuration) {
      var a = this.getAttribute("fill").getString("remove");
      if (this.getAttribute("repeatCount").getString() === "indefinite" || this.getAttribute("repeatDur").getString() === "indefinite")
        this.duration = 0;
      else if (a === "freeze" && !this.frozen)
        this.frozen = !0, e.animationFrozen = !0, e.animationFrozenValue = r.getString();
      else if (a === "remove" && !this.removed)
        return this.removed = !0, r.setValue(e.animationFrozen ? e.animationFrozenValue : this.initialValue), !0;
      return !1;
    }
    this.duration += t;
    var A = !1;
    if (this.begin < this.duration) {
      var i = this.calcValue(), s = this.getAttribute("type");
      if (s.hasValue()) {
        var o = s.getString();
        i = "".concat(o, "(").concat(i, ")");
      }
      r.setValue(i), A = !0;
    }
    return A;
  }
  getProgress() {
    var {
      document: t,
      values: e
    } = this, r = {
      progress: (this.duration - this.begin) / (this.maxDuration - this.begin)
    };
    if (e.hasValue()) {
      var a = r.progress * (e.getValue().length - 1), A = Math.floor(a), i = Math.ceil(a);
      r.from = new Tr(t, "from", parseFloat(e.getValue()[A])), r.to = new Tr(t, "to", parseFloat(e.getValue()[i])), r.progress = (a - A) / (i - A);
    } else
      r.from = this.from, r.to = this.to;
    return r;
  }
}
class E4 extends yf {
  constructor() {
    super(...arguments), this.type = "animateColor";
  }
  calcValue() {
    var {
      progress: t,
      from: e,
      to: r
    } = this.getProgress(), a = new Zp(e.getColor()), A = new Zp(r.getColor());
    if (a.ok && A.ok) {
      var i = a.r + (A.r - a.r) * t, s = a.g + (A.g - a.g) * t, o = a.b + (A.b - a.b) * t;
      return "rgb(".concat(Math.floor(i), ", ").concat(Math.floor(s), ", ").concat(Math.floor(o), ")");
    }
    return this.getAttribute("from").getColor();
  }
}
class S4 extends yf {
  constructor() {
    super(...arguments), this.type = "animateTransform";
  }
  calcValue() {
    var {
      progress: t,
      from: e,
      to: r
    } = this.getProgress(), a = ks(e.getString()), A = ks(r.getString()), i = a.map((s, o) => {
      var l = A[o];
      return s + (l - s) * t;
    }).join(" ");
    return i;
  }
}
class F4 extends Aa {
  constructor(t, e, r) {
    super(t, e, r), this.type = "font", this.glyphs = /* @__PURE__ */ Object.create(null), this.horizAdvX = this.getAttribute("horiz-adv-x").getNumber();
    var {
      definitions: a
    } = t, {
      children: A
    } = this;
    for (var i of A)
      switch (i.type) {
        case "font-face": {
          this.fontFace = i;
          var s = i.getStyle("font-family");
          s.hasValue() && (a[s.getString()] = this);
          break;
        }
        case "missing-glyph":
          this.missingGlyph = i;
          break;
        case "glyph": {
          var o = i;
          o.arabicForm ? (this.isRTL = !0, this.isArabic = !0, typeof this.glyphs[o.unicode] > "u" && (this.glyphs[o.unicode] = /* @__PURE__ */ Object.create(null)), this.glyphs[o.unicode][o.arabicForm] = o) : this.glyphs[o.unicode] = o;
          break;
        }
      }
  }
  render() {
  }
}
class U4 extends Aa {
  constructor(t, e, r) {
    super(t, e, r), this.type = "font-face", this.ascent = this.getAttribute("ascent").getNumber(), this.descent = this.getAttribute("descent").getNumber(), this.unitsPerEm = this.getAttribute("units-per-em").getNumber();
  }
}
class L4 extends Rn {
  constructor() {
    super(...arguments), this.type = "missing-glyph", this.horizAdvX = 0;
  }
}
class I4 extends oo {
  constructor() {
    super(...arguments), this.type = "tref";
  }
  getText() {
    var t = this.getHrefAttribute().getDefinition();
    if (t) {
      var e = t.children[0];
      if (e)
        return e.getText();
    }
    return "";
  }
}
class Q4 extends oo {
  constructor(t, e, r) {
    super(t, e, r), this.type = "a";
    var {
      childNodes: a
    } = e, A = a[0], i = a.length > 0 && Array.from(a).every((s) => s.nodeType === 3);
    this.hasText = i, this.text = i ? this.getTextFromNode(A) : "";
  }
  getText() {
    return this.text;
  }
  renderChildren(t) {
    if (this.hasText) {
      super.renderChildren(t);
      var {
        document: e,
        x: r,
        y: a
      } = this, {
        mouse: A
      } = e.screen, i = new Tr(e, "fontSize", ZA.parse(e.ctx.font).fontSize);
      A.isWorking() && A.checkBoundingBox(this, new zs(r, a - i.getPixels("y"), r + this.measureText(t), a));
    } else if (this.children.length > 0) {
      var s = new wf(this.document, null);
      s.children = this.children, s.parent = this, s.render(t);
    }
  }
  onClick() {
    var {
      window: t
    } = this.document;
    t && t.open(this.getHrefAttribute().getString());
  }
  onMouseMove() {
    var t = this.document.ctx;
    t.canvas.style.cursor = "pointer";
  }
}
function n5(n, t) {
  var e = Object.keys(n);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(n);
    t && (r = r.filter(function(a) {
      return Object.getOwnPropertyDescriptor(n, a).enumerable;
    })), e.push.apply(e, r);
  }
  return e;
}
function ud(n) {
  for (var t = 1; t < arguments.length; t++) {
    var e = arguments[t] != null ? arguments[t] : {};
    t % 2 ? n5(Object(e), !0).forEach(function(r) {
      z0(n, r, e[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(e)) : n5(Object(e)).forEach(function(r) {
      Object.defineProperty(n, r, Object.getOwnPropertyDescriptor(e, r));
    });
  }
  return n;
}
class M4 extends oo {
  constructor(t, e, r) {
    super(t, e, r), this.type = "textPath", this.textWidth = 0, this.textHeight = 0, this.pathLength = -1, this.glyphInfo = null, this.letterSpacingCache = [], this.measuresCache = /* @__PURE__ */ new Map([["", 0]]);
    var a = this.getHrefAttribute().getDefinition();
    this.text = this.getTextFromNode(), this.dataArray = this.parsePathData(a);
  }
  getText() {
    return this.text;
  }
  path(t) {
    var {
      dataArray: e
    } = this;
    t && t.beginPath(), e.forEach((r) => {
      var {
        type: a,
        points: A
      } = r;
      switch (a) {
        case Gr.LINE_TO:
          t && t.lineTo(A[0], A[1]);
          break;
        case Gr.MOVE_TO:
          t && t.moveTo(A[0], A[1]);
          break;
        case Gr.CURVE_TO:
          t && t.bezierCurveTo(A[0], A[1], A[2], A[3], A[4], A[5]);
          break;
        case Gr.QUAD_TO:
          t && t.quadraticCurveTo(A[0], A[1], A[2], A[3]);
          break;
        case Gr.ARC: {
          var [i, s, o, l, u, f, h, c] = A, p = o > l ? o : l, w = o > l ? 1 : o / l, y = o > l ? l / o : 1;
          t && (t.translate(i, s), t.rotate(h), t.scale(w, y), t.arc(0, 0, p, u, u + f, !!(1 - c)), t.scale(1 / w, 1 / y), t.rotate(-h), t.translate(-i, -s));
          break;
        }
        case Gr.CLOSE_PATH:
          t && t.closePath();
          break;
      }
    });
  }
  renderChildren(t) {
    this.setTextData(t), t.save();
    var e = this.parent.getStyle("text-decoration").getString(), r = this.getFontSize(), {
      glyphInfo: a
    } = this, A = t.fillStyle;
    e === "underline" && t.beginPath(), a.forEach((i, s) => {
      var {
        p0: o,
        p1: l,
        rotation: u,
        text: f
      } = i;
      t.save(), t.translate(o.x, o.y), t.rotate(u), t.fillStyle && t.fillText(f, 0, 0), t.strokeStyle && t.strokeText(f, 0, 0), t.restore(), e === "underline" && (s === 0 && t.moveTo(o.x, o.y + r / 8), t.lineTo(l.x, l.y + r / 5));
    }), e === "underline" && (t.lineWidth = r / 20, t.strokeStyle = A, t.stroke(), t.closePath()), t.restore();
  }
  getLetterSpacingAt() {
    var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
    return this.letterSpacingCache[t] || 0;
  }
  findSegmentToFitChar(t, e, r, a, A, i, s, o, l) {
    var u = i, f = this.measureText(t, o);
    o === " " && e === "justify" && r < a && (f += (a - r) / A), l > -1 && (u += this.getLetterSpacingAt(l));
    var h = this.textHeight / 20, c = this.getEquidistantPointOnPath(u, h, 0), p = this.getEquidistantPointOnPath(u + f, h, 0), w = {
      p0: c,
      p1: p
    }, y = c && p ? Math.atan2(p.y - c.y, p.x - c.x) : 0;
    if (s) {
      var m = Math.cos(Math.PI / 2 + y) * s, k = Math.cos(-y) * s;
      w.p0 = ud(ud({}, c), {}, {
        x: c.x + m,
        y: c.y + k
      }), w.p1 = ud(ud({}, p), {}, {
        x: p.x + m,
        y: p.y + k
      });
    }
    return u += f, {
      offset: u,
      segment: w,
      rotation: y
    };
  }
  measureText(t, e) {
    var {
      measuresCache: r
    } = this, a = e || this.getText();
    if (r.has(a))
      return r.get(a);
    var A = this.measureTargetText(t, a);
    return r.set(a, A), A;
  }
  // This method supposes what all custom fonts already loaded.
  // If some font will be loaded after this method call, <textPath> will not be rendered correctly.
  // You need to call this method manually to update glyphs cache.
  setTextData(t) {
    if (!this.glyphInfo) {
      var e = this.getText(), r = e.split(""), a = e.split(" ").length - 1, A = this.parent.getAttribute("dx").split().map((B) => B.getPixels("x")), i = this.parent.getAttribute("dy").getPixels("y"), s = this.parent.getStyle("text-anchor").getString("start"), o = this.getStyle("letter-spacing"), l = this.parent.getStyle("letter-spacing"), u = 0;
      !o.hasValue() || o.getValue() === "inherit" ? u = l.getPixels() : o.hasValue() && o.getValue() !== "initial" && o.getValue() !== "unset" && (u = o.getPixels());
      var f = [], h = e.length;
      this.letterSpacingCache = f;
      for (var c = 0; c < h; c++)
        f.push(typeof A[c] < "u" ? A[c] : u);
      var p = f.reduce((B, O, q) => q === 0 ? 0 : B + O || 0, 0), w = this.measureText(t), y = Math.max(w + p, 0);
      this.textWidth = w, this.textHeight = this.getFontSize(), this.glyphInfo = [];
      var m = this.getPathLength(), k = this.getStyle("startOffset").getNumber(0) * m, D = 0;
      (s === "middle" || s === "center") && (D = -y / 2), (s === "end" || s === "right") && (D = -y), D += k, r.forEach((B, O) => {
        var {
          offset: q,
          segment: G,
          rotation: W
        } = this.findSegmentToFitChar(t, s, y, m, a, D, i, B, O);
        D = q, !(!G.p0 || !G.p1) && this.glyphInfo.push({
          // transposeX: midpoint.x,
          // transposeY: midpoint.y,
          text: r[O],
          p0: G.p0,
          p1: G.p1,
          rotation: W
        });
      });
    }
  }
  parsePathData(t) {
    if (this.pathLength = -1, !t)
      return [];
    var e = [], {
      pathParser: r
    } = t;
    for (r.reset(); !r.isEnd(); ) {
      var {
        current: a
      } = r, A = a ? a.x : 0, i = a ? a.y : 0, s = r.next(), o = s.type, l = [];
      switch (s.type) {
        case Gr.MOVE_TO:
          this.pathM(r, l);
          break;
        case Gr.LINE_TO:
          o = this.pathL(r, l);
          break;
        case Gr.HORIZ_LINE_TO:
          o = this.pathH(r, l);
          break;
        case Gr.VERT_LINE_TO:
          o = this.pathV(r, l);
          break;
        case Gr.CURVE_TO:
          this.pathC(r, l);
          break;
        case Gr.SMOOTH_CURVE_TO:
          o = this.pathS(r, l);
          break;
        case Gr.QUAD_TO:
          this.pathQ(r, l);
          break;
        case Gr.SMOOTH_QUAD_TO:
          o = this.pathT(r, l);
          break;
        case Gr.ARC:
          l = this.pathA(r);
          break;
        case Gr.CLOSE_PATH:
          Rn.pathZ(r);
          break;
      }
      s.type !== Gr.CLOSE_PATH ? e.push({
        type: o,
        points: l,
        start: {
          x: A,
          y: i
        },
        pathLength: this.calcLength(A, i, o, l)
      }) : e.push({
        type: Gr.CLOSE_PATH,
        points: [],
        pathLength: 0
      });
    }
    return e;
  }
  pathM(t, e) {
    var {
      x: r,
      y: a
    } = Rn.pathM(t).point;
    e.push(r, a);
  }
  pathL(t, e) {
    var {
      x: r,
      y: a
    } = Rn.pathL(t).point;
    return e.push(r, a), Gr.LINE_TO;
  }
  pathH(t, e) {
    var {
      x: r,
      y: a
    } = Rn.pathH(t).point;
    return e.push(r, a), Gr.LINE_TO;
  }
  pathV(t, e) {
    var {
      x: r,
      y: a
    } = Rn.pathV(t).point;
    return e.push(r, a), Gr.LINE_TO;
  }
  pathC(t, e) {
    var {
      point: r,
      controlPoint: a,
      currentPoint: A
    } = Rn.pathC(t);
    e.push(r.x, r.y, a.x, a.y, A.x, A.y);
  }
  pathS(t, e) {
    var {
      point: r,
      controlPoint: a,
      currentPoint: A
    } = Rn.pathS(t);
    return e.push(r.x, r.y, a.x, a.y, A.x, A.y), Gr.CURVE_TO;
  }
  pathQ(t, e) {
    var {
      controlPoint: r,
      currentPoint: a
    } = Rn.pathQ(t);
    e.push(r.x, r.y, a.x, a.y);
  }
  pathT(t, e) {
    var {
      controlPoint: r,
      currentPoint: a
    } = Rn.pathT(t);
    return e.push(r.x, r.y, a.x, a.y), Gr.QUAD_TO;
  }
  pathA(t) {
    var {
      rX: e,
      rY: r,
      sweepFlag: a,
      xAxisRotation: A,
      centp: i,
      a1: s,
      ad: o
    } = Rn.pathA(t);
    return a === 0 && o > 0 && (o -= 2 * Math.PI), a === 1 && o < 0 && (o += 2 * Math.PI), [i.x, i.y, e, r, s, o, A, a];
  }
  calcLength(t, e, r, a) {
    var A = 0, i = null, s = null, o = 0;
    switch (r) {
      case Gr.LINE_TO:
        return this.getLineLength(t, e, a[0], a[1]);
      case Gr.CURVE_TO:
        for (A = 0, i = this.getPointOnCubicBezier(0, t, e, a[0], a[1], a[2], a[3], a[4], a[5]), o = 0.01; o <= 1; o += 0.01)
          s = this.getPointOnCubicBezier(o, t, e, a[0], a[1], a[2], a[3], a[4], a[5]), A += this.getLineLength(i.x, i.y, s.x, s.y), i = s;
        return A;
      case Gr.QUAD_TO:
        for (A = 0, i = this.getPointOnQuadraticBezier(0, t, e, a[0], a[1], a[2], a[3]), o = 0.01; o <= 1; o += 0.01)
          s = this.getPointOnQuadraticBezier(o, t, e, a[0], a[1], a[2], a[3]), A += this.getLineLength(i.x, i.y, s.x, s.y), i = s;
        return A;
      case Gr.ARC: {
        A = 0;
        var l = a[4], u = a[5], f = a[4] + u, h = Math.PI / 180;
        if (Math.abs(l - f) < h && (h = Math.abs(l - f)), i = this.getPointOnEllipticalArc(a[0], a[1], a[2], a[3], l, 0), u < 0)
          for (o = l - h; o > f; o -= h)
            s = this.getPointOnEllipticalArc(a[0], a[1], a[2], a[3], o, 0), A += this.getLineLength(i.x, i.y, s.x, s.y), i = s;
        else
          for (o = l + h; o < f; o += h)
            s = this.getPointOnEllipticalArc(a[0], a[1], a[2], a[3], o, 0), A += this.getLineLength(i.x, i.y, s.x, s.y), i = s;
        return s = this.getPointOnEllipticalArc(a[0], a[1], a[2], a[3], f, 0), A += this.getLineLength(i.x, i.y, s.x, s.y), A;
      }
    }
    return 0;
  }
  getPointOnLine(t, e, r, a, A) {
    var i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : e, s = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : r, o = (A - r) / (a - e + ol), l = Math.sqrt(t * t / (1 + o * o));
    a < e && (l *= -1);
    var u = o * l, f = null;
    if (a === e)
      f = {
        x: i,
        y: s + u
      };
    else if ((s - r) / (i - e + ol) === o)
      f = {
        x: i + l,
        y: s + u
      };
    else {
      var h = 0, c = 0, p = this.getLineLength(e, r, a, A);
      if (p < ol)
        return null;
      var w = (i - e) * (a - e) + (s - r) * (A - r);
      w /= p * p, h = e + w * (a - e), c = r + w * (A - r);
      var y = this.getLineLength(i, s, h, c), m = Math.sqrt(t * t - y * y);
      l = Math.sqrt(m * m / (1 + o * o)), a < e && (l *= -1), u = o * l, f = {
        x: h + l,
        y: c + u
      };
    }
    return f;
  }
  getPointOnPath(t) {
    var e = this.getPathLength(), r = 0, a = null;
    if (t < -5e-5 || t - 5e-5 > e)
      return null;
    var {
      dataArray: A
    } = this;
    for (var i of A) {
      if (i && (i.pathLength < 5e-5 || r + i.pathLength + 5e-5 < t)) {
        r += i.pathLength;
        continue;
      }
      var s = t - r, o = 0;
      switch (i.type) {
        case Gr.LINE_TO:
          a = this.getPointOnLine(s, i.start.x, i.start.y, i.points[0], i.points[1], i.start.x, i.start.y);
          break;
        case Gr.ARC: {
          var l = i.points[4], u = i.points[5], f = i.points[4] + u;
          if (o = l + s / i.pathLength * u, u < 0 && o < f || u >= 0 && o > f)
            break;
          a = this.getPointOnEllipticalArc(i.points[0], i.points[1], i.points[2], i.points[3], o, i.points[6]);
          break;
        }
        case Gr.CURVE_TO:
          o = s / i.pathLength, o > 1 && (o = 1), a = this.getPointOnCubicBezier(o, i.start.x, i.start.y, i.points[0], i.points[1], i.points[2], i.points[3], i.points[4], i.points[5]);
          break;
        case Gr.QUAD_TO:
          o = s / i.pathLength, o > 1 && (o = 1), a = this.getPointOnQuadraticBezier(o, i.start.x, i.start.y, i.points[0], i.points[1], i.points[2], i.points[3]);
          break;
      }
      if (a)
        return a;
      break;
    }
    return null;
  }
  getLineLength(t, e, r, a) {
    return Math.sqrt((r - t) * (r - t) + (a - e) * (a - e));
  }
  getPathLength() {
    return this.pathLength === -1 && (this.pathLength = this.dataArray.reduce((t, e) => e.pathLength > 0 ? t + e.pathLength : t, 0)), this.pathLength;
  }
  getPointOnCubicBezier(t, e, r, a, A, i, s, o, l) {
    var u = o * n0(t) + i * a0(t) + a * A0(t) + e * s0(t), f = l * n0(t) + s * a0(t) + A * A0(t) + r * s0(t);
    return {
      x: u,
      y: f
    };
  }
  getPointOnQuadraticBezier(t, e, r, a, A, i, s) {
    var o = i * i0(t) + a * o0(t) + e * l0(t), l = s * i0(t) + A * o0(t) + r * l0(t);
    return {
      x: o,
      y: l
    };
  }
  getPointOnEllipticalArc(t, e, r, a, A, i) {
    var s = Math.cos(i), o = Math.sin(i), l = {
      x: r * Math.cos(A),
      y: a * Math.sin(A)
    };
    return {
      x: t + (l.x * s - l.y * o),
      y: e + (l.x * o + l.y * s)
    };
  }
  // TODO need some optimisations. possibly build cache only for curved segments?
  buildEquidistantCache(t, e) {
    var r = this.getPathLength(), a = e || 0.25, A = t || r / 100;
    if (!this.equidistantCache || this.equidistantCache.step !== A || this.equidistantCache.precision !== a) {
      this.equidistantCache = {
        step: A,
        precision: a,
        points: []
      };
      for (var i = 0, s = 0; s <= r; s += a) {
        var o = this.getPointOnPath(s), l = this.getPointOnPath(s + a);
        !o || !l || (i += this.getLineLength(o.x, o.y, l.x, l.y), i >= A && (this.equidistantCache.points.push({
          x: o.x,
          y: o.y,
          distance: s
        }), i -= A));
      }
    }
  }
  getEquidistantPointOnPath(t, e, r) {
    if (this.buildEquidistantCache(e, r), t < 0 || t - this.getPathLength() > 5e-5)
      return null;
    var a = Math.round(t / this.getPathLength() * (this.equidistantCache.points.length - 1));
    return this.equidistantCache.points[a] || null;
  }
}
var N9 = /^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;
class _4 extends Po {
  constructor(t, e, r) {
    super(t, e, r), this.type = "image", this.loaded = !1;
    var a = this.getHrefAttribute().getString();
    if (a) {
      var A = a.endsWith(".svg") || /^\s*data:image\/svg\+xml/i.test(a);
      t.images.push(this), A ? this.loadSvg(a) : this.loadImage(a), this.isSvg = A;
    }
  }
  loadImage(t) {
    var e = this;
    return io(function* () {
      try {
        var r = yield e.document.createImage(t);
        e.image = r;
      } catch (a) {
        console.error('Error while loading image "'.concat(t, '":'), a);
      }
      e.loaded = !0;
    })();
  }
  loadSvg(t) {
    var e = this;
    return io(function* () {
      var r = N9.exec(t);
      if (r) {
        var a = r[5];
        r[4] === "base64" ? e.image = atob(a) : e.image = decodeURIComponent(a);
      } else
        try {
          var A = yield e.document.fetch(t), i = yield A.text();
          e.image = i;
        } catch (s) {
          console.error('Error while loading image "'.concat(t, '":'), s);
        }
      e.loaded = !0;
    })();
  }
  renderChildren(t) {
    var {
      document: e,
      image: r,
      loaded: a
    } = this, A = this.getAttribute("x").getPixels("x"), i = this.getAttribute("y").getPixels("y"), s = this.getStyle("width").getPixels("x"), o = this.getStyle("height").getPixels("y");
    if (!(!a || !r || !s || !o)) {
      if (t.save(), t.translate(A, i), this.isSvg) {
        var l = e.canvg.forkString(t, this.image, {
          ignoreMouse: !0,
          ignoreAnimation: !0,
          ignoreDimensions: !0,
          ignoreClear: !0,
          offsetX: 0,
          offsetY: 0,
          scaleWidth: s,
          scaleHeight: o
        });
        l.document.documentElement.parent = this, l.render();
      } else {
        var u = this.image;
        e.setViewBox({
          ctx: t,
          aspectRatio: this.getAttribute("preserveAspectRatio").getString(),
          width: s,
          desiredWidth: u.width,
          height: o,
          desiredHeight: u.height
        }), this.loaded && (typeof u.complete > "u" || u.complete) && t.drawImage(u, 0, 0);
      }
      t.restore();
    }
  }
  getBoundingBox() {
    var t = this.getAttribute("x").getPixels("x"), e = this.getAttribute("y").getPixels("y"), r = this.getStyle("width").getPixels("x"), a = this.getStyle("height").getPixels("y");
    return new zs(t, e, t + r, e + a);
  }
}
class R4 extends Po {
  constructor() {
    super(...arguments), this.type = "symbol";
  }
  render(t) {
  }
}
class N4 {
  constructor(t) {
    this.document = t, this.loaded = !1, t.fonts.push(this);
  }
  load(t, e) {
    var r = this;
    return io(function* () {
      try {
        var {
          document: a
        } = r, A = yield a.canvg.parser.load(e), i = A.getElementsByTagName("font");
        Array.from(i).forEach((s) => {
          var o = a.createElement(s);
          a.definitions[t] = o;
        });
      } catch (s) {
        console.error('Error while loading font "'.concat(e, '":'), s);
      }
      r.loaded = !0;
    })();
  }
}
class am extends Aa {
  constructor(t, e, r) {
    super(t, e, r), this.type = "style";
    var a = pl(
      Array.from(e.childNodes).map((i) => i.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm, "").replace(/@import.*;/g, "")
      // remove imports
    ), A = a.split("}");
    A.forEach((i) => {
      var s = i.trim();
      if (s) {
        var o = s.split("{"), l = o[0].split(","), u = o[1].split(";");
        l.forEach((f) => {
          var h = f.trim();
          if (h) {
            var c = t.styles[h] || {};
            if (u.forEach((y) => {
              var m = y.indexOf(":"), k = y.substr(0, m).trim(), D = y.substr(m + 1, y.length - m).trim();
              k && D && (c[k] = new Tr(t, k, D));
            }), t.styles[h] = c, t.stylesSpecificity[h] = i4(h), h === "@font-face") {
              var p = c["font-family"].getString().replace(/"|'/g, ""), w = c.src.getString().split(",");
              w.forEach((y) => {
                if (y.indexOf('format("svg")') > 0) {
                  var m = X0(y);
                  m && new N4(t).load(p, m);
                }
              });
            }
          }
        });
      }
    });
  }
}
am.parseExternalUrl = X0;
class H4 extends Po {
  constructor() {
    super(...arguments), this.type = "use";
  }
  setContext(t) {
    super.setContext(t);
    var e = this.getAttribute("x"), r = this.getAttribute("y");
    e.hasValue() && t.translate(e.getPixels("x"), 0), r.hasValue() && t.translate(0, r.getPixels("y"));
  }
  path(t) {
    var {
      element: e
    } = this;
    e && e.path(t);
  }
  renderChildren(t) {
    var {
      document: e,
      element: r
    } = this;
    if (r) {
      var a = r;
      if (r.type === "symbol" && (a = new nu(e, null), a.attributes.viewBox = new Tr(e, "viewBox", r.getAttribute("viewBox").getString()), a.attributes.preserveAspectRatio = new Tr(e, "preserveAspectRatio", r.getAttribute("preserveAspectRatio").getString()), a.attributes.overflow = new Tr(e, "overflow", r.getAttribute("overflow").getString()), a.children = r.children, r.styles.opacity = new Tr(e, "opacity", this.calculateOpacity())), a.type === "svg") {
        var A = this.getStyle("width", !1, !0), i = this.getStyle("height", !1, !0);
        A.hasValue() && (a.attributes.width = new Tr(e, "width", A.getString())), i.hasValue() && (a.attributes.height = new Tr(e, "height", i.getString()));
      }
      var s = a.parent;
      a.parent = this, a.render(t), a.parent = s;
    }
  }
  getBoundingBox(t) {
    var {
      element: e
    } = this;
    return e ? e.getBoundingBox(t) : null;
  }
  elementTransform() {
    var {
      document: t,
      element: e
    } = this;
    return Ho.fromElement(t, e);
  }
  get element() {
    return this.cachedElement || (this.cachedElement = this.getHrefAttribute().getDefinition()), this.cachedElement;
  }
}
function cd(n, t, e, r, a, A) {
  return n[e * r * 4 + t * 4 + A];
}
function dd(n, t, e, r, a, A, i) {
  n[e * r * 4 + t * 4 + A] = i;
}
function nA(n, t, e) {
  var r = n[t];
  return r * e;
}
function eo(n, t, e, r) {
  return t + Math.cos(n) * e + Math.sin(n) * r;
}
class Am extends Aa {
  constructor(t, e, r) {
    super(t, e, r), this.type = "feColorMatrix";
    var a = ks(this.getAttribute("values").getString());
    switch (this.getAttribute("type").getString("matrix")) {
      // http://www.w3.org/TR/SVG/filters.html#feColorMatrixElement
      case "saturate": {
        var A = a[0];
        a = [0.213 + 0.787 * A, 0.715 - 0.715 * A, 0.072 - 0.072 * A, 0, 0, 0.213 - 0.213 * A, 0.715 + 0.285 * A, 0.072 - 0.072 * A, 0, 0, 0.213 - 0.213 * A, 0.715 - 0.715 * A, 0.072 + 0.928 * A, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
        break;
      }
      case "hueRotate": {
        var i = a[0] * Math.PI / 180;
        a = [eo(i, 0.213, 0.787, -0.213), eo(i, 0.715, -0.715, -0.715), eo(i, 0.072, -0.072, 0.928), 0, 0, eo(i, 0.213, -0.213, 0.143), eo(i, 0.715, 0.285, 0.14), eo(i, 0.072, -0.072, -0.283), 0, 0, eo(i, 0.213, -0.213, -0.787), eo(i, 0.715, -0.715, 0.715), eo(i, 0.072, 0.928, 0.072), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
        break;
      }
      case "luminanceToAlpha":
        a = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2125, 0.7154, 0.0721, 0, 0, 0, 0, 0, 0, 1];
        break;
    }
    this.matrix = a, this.includeOpacity = this.getAttribute("includeOpacity").hasValue();
  }
  apply(t, e, r, a, A) {
    for (var {
      includeOpacity: i,
      matrix: s
    } = this, o = t.getImageData(0, 0, a, A), l = 0; l < A; l++)
      for (var u = 0; u < a; u++) {
        var f = cd(o.data, u, l, a, A, 0), h = cd(o.data, u, l, a, A, 1), c = cd(o.data, u, l, a, A, 2), p = cd(o.data, u, l, a, A, 3), w = nA(s, 0, f) + nA(s, 1, h) + nA(s, 2, c) + nA(s, 3, p) + nA(s, 4, 1), y = nA(s, 5, f) + nA(s, 6, h) + nA(s, 7, c) + nA(s, 8, p) + nA(s, 9, 1), m = nA(s, 10, f) + nA(s, 11, h) + nA(s, 12, c) + nA(s, 13, p) + nA(s, 14, 1), k = nA(s, 15, f) + nA(s, 16, h) + nA(s, 17, c) + nA(s, 18, p) + nA(s, 19, 1);
        i && (w = 0, y = 0, m = 0, k *= p / 255), dd(o.data, u, l, a, A, 0, w), dd(o.data, u, l, a, A, 1, y), dd(o.data, u, l, a, A, 2, m), dd(o.data, u, l, a, A, 3, k);
      }
    t.clearRect(0, 0, a, A), t.putImageData(o, 0, 0);
  }
}
class oc extends Aa {
  constructor() {
    super(...arguments), this.type = "mask";
  }
  apply(t, e) {
    var {
      document: r
    } = this, a = this.getAttribute("x").getPixels("x"), A = this.getAttribute("y").getPixels("y"), i = this.getStyle("width").getPixels("x"), s = this.getStyle("height").getPixels("y");
    if (!i && !s) {
      var o = new zs();
      this.children.forEach((p) => {
        o.addBoundingBox(p.getBoundingBox(t));
      }), a = Math.floor(o.x1), A = Math.floor(o.y1), i = Math.floor(o.width), s = Math.floor(o.height);
    }
    var l = this.removeStyles(e, oc.ignoreStyles), u = r.createCanvas(a + i, A + s), f = u.getContext("2d");
    r.screen.setDefaults(f), this.renderChildren(f), new Am(r, {
      nodeType: 1,
      childNodes: [],
      attributes: [{
        nodeName: "type",
        value: "luminanceToAlpha"
      }, {
        nodeName: "includeOpacity",
        value: "true"
      }]
    }).apply(f, 0, 0, a + i, A + s);
    var h = r.createCanvas(a + i, A + s), c = h.getContext("2d");
    r.screen.setDefaults(c), e.render(c), c.globalCompositeOperation = "destination-in", c.fillStyle = f.createPattern(u, "no-repeat"), c.fillRect(0, 0, a + i, A + s), t.fillStyle = c.createPattern(h, "no-repeat"), t.fillRect(0, 0, a + i, A + s), this.restoreStyles(e, l);
  }
  render(t) {
  }
}
oc.ignoreStyles = ["mask", "transform", "clip-path"];
var a5 = () => {
};
class O4 extends Aa {
  constructor() {
    super(...arguments), this.type = "clipPath";
  }
  apply(t) {
    var {
      document: e
    } = this, r = Reflect.getPrototypeOf(t), {
      beginPath: a,
      closePath: A
    } = t;
    r && (r.beginPath = a5, r.closePath = a5), Reflect.apply(a, t, []), this.children.forEach((i) => {
      if (!(typeof i.path > "u")) {
        var s = typeof i.elementTransform < "u" ? i.elementTransform() : null;
        s || (s = Ho.fromElement(e, i)), s && s.apply(t), i.path(t), r && (r.closePath = A), s && s.unapply(t);
      }
    }), Reflect.apply(A, t, []), t.clip(), r && (r.beginPath = a, r.closePath = A);
  }
  render(t) {
  }
}
class lc extends Aa {
  constructor() {
    super(...arguments), this.type = "filter";
  }
  apply(t, e) {
    var {
      document: r,
      children: a
    } = this, A = e.getBoundingBox(t);
    if (A) {
      var i = 0, s = 0;
      a.forEach((m) => {
        var k = m.extraFilterDistance || 0;
        i = Math.max(i, k), s = Math.max(s, k);
      });
      var o = Math.floor(A.width), l = Math.floor(A.height), u = o + 2 * i, f = l + 2 * s;
      if (!(u < 1 || f < 1)) {
        var h = Math.floor(A.x), c = Math.floor(A.y), p = this.removeStyles(e, lc.ignoreStyles), w = r.createCanvas(u, f), y = w.getContext("2d");
        r.screen.setDefaults(y), y.translate(-h + i, -c + s), e.render(y), a.forEach((m) => {
          typeof m.apply == "function" && m.apply(y, 0, 0, u, f);
        }), t.drawImage(w, 0, 0, u, f, h - i, c - s, u, f), this.restoreStyles(e, p);
      }
    }
  }
  render(t) {
  }
}
lc.ignoreStyles = ["filter", "transform", "clip-path"];
class P4 extends Aa {
  constructor(t, e, r) {
    super(t, e, r), this.type = "feDropShadow", this.addStylesFromStyleDefinition();
  }
  apply(t, e, r, a, A) {
  }
}
class W4 extends Aa {
  constructor() {
    super(...arguments), this.type = "feMorphology";
  }
  apply(t, e, r, a, A) {
  }
}
class K4 extends Aa {
  constructor() {
    super(...arguments), this.type = "feComposite";
  }
  apply(t, e, r, a, A) {
  }
}
class $4 extends Aa {
  constructor(t, e, r) {
    super(t, e, r), this.type = "feGaussianBlur", this.blurRadius = Math.floor(this.getAttribute("stdDeviation").getNumber()), this.extraFilterDistance = this.blurRadius;
  }
  apply(t, e, r, a, A) {
    var {
      document: i,
      blurRadius: s
    } = this, o = i.window ? i.window.document.body : null, l = t.canvas;
    l.id = i.getUniqueId(), o && (l.style.display = "none", o.appendChild(l)), v9(l, e, r, a, A, s), o && o.removeChild(l);
  }
}
class V4 extends Aa {
  constructor() {
    super(...arguments), this.type = "title";
  }
}
class q4 extends Aa {
  constructor() {
    super(...arguments), this.type = "desc";
  }
}
var H9 = {
  svg: nu,
  rect: tm,
  circle: m4,
  ellipse: w4,
  line: y4,
  polyline: rm,
  polygon: B4,
  path: Rn,
  pattern: b4,
  marker: C4,
  defs: k4,
  linearGradient: T4,
  radialGradient: x4,
  stop: D4,
  animate: yf,
  animateColor: E4,
  animateTransform: S4,
  font: F4,
  "font-face": U4,
  "missing-glyph": L4,
  glyph: em,
  text: oo,
  tspan: ic,
  tref: I4,
  a: Q4,
  textPath: M4,
  image: _4,
  g: wf,
  symbol: R4,
  style: am,
  use: H4,
  mask: oc,
  clipPath: O4,
  filter: lc,
  feDropShadow: P4,
  feMorphology: W4,
  feComposite: K4,
  feColorMatrix: Am,
  feGaussianBlur: $4,
  title: V4,
  desc: q4
};
function A5(n, t) {
  var e = Object.keys(n);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(n);
    t && (r = r.filter(function(a) {
      return Object.getOwnPropertyDescriptor(n, a).enumerable;
    })), e.push.apply(e, r);
  }
  return e;
}
function O9(n) {
  for (var t = 1; t < arguments.length; t++) {
    var e = arguments[t] != null ? arguments[t] : {};
    t % 2 ? A5(Object(e), !0).forEach(function(r) {
      z0(n, r, e[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(e)) : A5(Object(e)).forEach(function(r) {
      Object.defineProperty(n, r, Object.getOwnPropertyDescriptor(e, r));
    });
  }
  return n;
}
function P9(n, t) {
  var e = document.createElement("canvas");
  return e.width = n, e.height = t, e;
}
function W9(n) {
  return u0.apply(this, arguments);
}
function u0() {
  return u0 = io(function* (n) {
    var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, e = document.createElement("img");
    return t && (e.crossOrigin = "Anonymous"), new Promise((r, a) => {
      e.onload = () => {
        r(e);
      }, e.onerror = (A, i, s, o, l) => {
        a(l);
      }, e.src = n;
    });
  }), u0.apply(this, arguments);
}
class Ao {
  constructor(t) {
    var {
      rootEmSize: e = 12,
      emSize: r = 12,
      createCanvas: a = Ao.createCanvas,
      createImage: A = Ao.createImage,
      anonymousCrossOrigin: i
    } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    this.canvg = t, this.definitions = /* @__PURE__ */ Object.create(null), this.styles = /* @__PURE__ */ Object.create(null), this.stylesSpecificity = /* @__PURE__ */ Object.create(null), this.images = [], this.fonts = [], this.emSizeStack = [], this.uniqueId = 0, this.screen = t.screen, this.rootEmSize = e, this.emSize = r, this.createCanvas = a, this.createImage = this.bindCreateImage(A, i), this.screen.wait(this.isImagesLoaded.bind(this)), this.screen.wait(this.isFontsLoaded.bind(this));
  }
  bindCreateImage(t, e) {
    return typeof e == "boolean" ? (r, a) => t(r, typeof a == "boolean" ? a : e) : t;
  }
  get window() {
    return this.screen.window;
  }
  get fetch() {
    return this.screen.fetch;
  }
  get ctx() {
    return this.screen.ctx;
  }
  get emSize() {
    var {
      emSizeStack: t
    } = this;
    return t[t.length - 1];
  }
  set emSize(t) {
    var {
      emSizeStack: e
    } = this;
    e.push(t);
  }
  popEmSize() {
    var {
      emSizeStack: t
    } = this;
    t.pop();
  }
  getUniqueId() {
    return "canvg".concat(++this.uniqueId);
  }
  isImagesLoaded() {
    return this.images.every((t) => t.loaded);
  }
  isFontsLoaded() {
    return this.fonts.every((t) => t.loaded);
  }
  createDocumentElement(t) {
    var e = this.createElement(t.documentElement);
    return e.root = !0, e.addStylesFromStyleDefinition(), this.documentElement = e, e;
  }
  createElement(t) {
    var e = t.nodeName.replace(/^[^:]+:/, ""), r = Ao.elementTypes[e];
    return typeof r < "u" ? new r(this, t) : new p4(this, t);
  }
  createTextNode(t) {
    return new R9(this, t);
  }
  setViewBox(t) {
    this.screen.setViewBox(O9({
      document: this
    }, t));
  }
}
Ao.createCanvas = P9;
Ao.createImage = W9;
Ao.elementTypes = H9;
function s5(n, t) {
  var e = Object.keys(n);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(n);
    t && (r = r.filter(function(a) {
      return Object.getOwnPropertyDescriptor(n, a).enumerable;
    })), e.push.apply(e, r);
  }
  return e;
}
function zo(n) {
  for (var t = 1; t < arguments.length; t++) {
    var e = arguments[t] != null ? arguments[t] : {};
    t % 2 ? s5(Object(e), !0).forEach(function(r) {
      z0(n, r, e[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(e)) : s5(Object(e)).forEach(function(r) {
      Object.defineProperty(n, r, Object.getOwnPropertyDescriptor(e, r));
    });
  }
  return n;
}
class nl {
  /**
   * Main constructor.
   * @param ctx - Rendering context.
   * @param svg - SVG Document.
   * @param options - Rendering options.
   */
  constructor(t, e) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
    this.parser = new Dd(r), this.screen = new sc(t, r), this.options = r;
    var a = new Ao(this, r), A = a.createDocumentElement(e);
    this.document = a, this.documentElement = A;
  }
  /**
   * Create Canvg instance from SVG source string or URL.
   * @param ctx - Rendering context.
   * @param svg - SVG source string or URL.
   * @param options - Rendering options.
   * @returns Canvg instance.
   */
  static from(t, e) {
    var r = arguments;
    return io(function* () {
      var a = r.length > 2 && r[2] !== void 0 ? r[2] : {}, A = new Dd(a), i = yield A.parse(e);
      return new nl(t, i, a);
    })();
  }
  /**
   * Create Canvg instance from SVG source string.
   * @param ctx - Rendering context.
   * @param svg - SVG source string.
   * @param options - Rendering options.
   * @returns Canvg instance.
   */
  static fromString(t, e) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, a = new Dd(r), A = a.parseFromString(e);
    return new nl(t, A, r);
  }
  /**
   * Create new Canvg instance with inherited options.
   * @param ctx - Rendering context.
   * @param svg - SVG source string or URL.
   * @param options - Rendering options.
   * @returns Canvg instance.
   */
  fork(t, e) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
    return nl.from(t, e, zo(zo({}, this.options), r));
  }
  /**
   * Create new Canvg instance with inherited options.
   * @param ctx - Rendering context.
   * @param svg - SVG source string.
   * @param options - Rendering options.
   * @returns Canvg instance.
   */
  forkString(t, e) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
    return nl.fromString(t, e, zo(zo({}, this.options), r));
  }
  /**
   * Document is ready promise.
   * @returns Ready promise.
   */
  ready() {
    return this.screen.ready();
  }
  /**
   * Document is ready value.
   * @returns Is ready or not.
   */
  isReady() {
    return this.screen.isReady();
  }
  /**
   * Render only first frame, ignoring animations and mouse.
   * @param options - Rendering options.
   */
  render() {
    var t = arguments, e = this;
    return io(function* () {
      var r = t.length > 0 && t[0] !== void 0 ? t[0] : {};
      e.start(zo({
        enableRedraw: !0,
        ignoreAnimation: !0,
        ignoreMouse: !0
      }, r)), yield e.ready(), e.stop();
    })();
  }
  /**
   * Start rendering.
   * @param options - Render options.
   */
  start() {
    var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, {
      documentElement: e,
      screen: r,
      options: a
    } = this;
    r.start(e, zo(zo({
      enableRedraw: !0
    }, a), t));
  }
  /**
   * Stop rendering.
   */
  stop() {
    this.screen.stop();
  }
  /**
   * Resize SVG to fit in given size.
   * @param width
   * @param height
   * @param preserveAspectRatio
   */
  resize(t) {
    var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : t, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
    this.documentElement.resize(t, e, r);
  }
}
const K9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  AElement: Q4,
  AnimateColorElement: E4,
  AnimateElement: yf,
  AnimateTransformElement: S4,
  BoundingBox: zs,
  CB1: n0,
  CB2: a0,
  CB3: A0,
  CB4: s0,
  Canvg: nl,
  CircleElement: m4,
  ClipPathElement: O4,
  DefsElement: k4,
  DescElement: q4,
  Document: Ao,
  Element: Aa,
  EllipseElement: w4,
  FeColorMatrixElement: Am,
  FeCompositeElement: K4,
  FeDropShadowElement: P4,
  FeGaussianBlurElement: $4,
  FeMorphologyElement: W4,
  FilterElement: lc,
  Font: ZA,
  FontElement: F4,
  FontFaceElement: U4,
  GElement: wf,
  GlyphElement: em,
  GradientElement: nm,
  ImageElement: _4,
  LineElement: y4,
  LinearGradientElement: T4,
  MarkerElement: C4,
  MaskElement: oc,
  Matrix: J0,
  MissingGlyphElement: L4,
  Mouse: l4,
  PSEUDO_ZERO: ol,
  Parser: Dd,
  PathElement: Rn,
  PathParser: Gr,
  PatternElement: b4,
  Point: _a,
  PolygonElement: B4,
  PolylineElement: rm,
  Property: Tr,
  QB1: i0,
  QB2: o0,
  QB3: l0,
  RadialGradientElement: x4,
  RectElement: tm,
  RenderedElement: Po,
  Rotate: f4,
  SVGElement: nu,
  SVGFontLoader: N4,
  Scale: h4,
  Screen: sc,
  Skew: Z0,
  SkewX: g4,
  SkewY: v4,
  StopElement: D4,
  StyleElement: am,
  SymbolElement: R4,
  TRefElement: I4,
  TSpanElement: ic,
  TextElement: oo,
  TextPathElement: M4,
  TitleElement: V4,
  Transform: Ho,
  Translate: d4,
  UnknownElement: p4,
  UseElement: H4,
  ViewPort: o4,
  compressSpaces: pl,
  default: nl,
  getSelectorSpecificity: i4,
  normalizeAttributeName: A4,
  normalizeColor: s4,
  parseExternalUrl: X0,
  presets: y9,
  toNumbers: ks,
  trimLeft: n4,
  trimRight: a4,
  vectorMagnitude: t0,
  vectorsAngle: r0,
  vectorsRatio: $d
}, Symbol.toStringTag, { value: "Module" }));
export {
  zI as CalendarView,
  J8 as GanttChart,
  PL as MilestoneDialog,
  Mm as MilestonePoint,
  PI as ResourceFilterSelect,
  BQ as ResourceUsageView,
  Qm as TaskBar,
  tP as TaskBarContextMenu,
  iL as TaskDrawer,
  f5 as TaskList,
  Z8 as TaskListColumn,
  eP as TaskListContextMenu,
  Mx as TaskRow,
  rF as Timeline,
  Tm as createResource,
  q9 as default,
  rP as install,
  Cs as useI18n,
  g5 as useMessage
};