@platox/pivot-table 0.0.85 → 0.0.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/dashboard-workbench/components/global-filter-condition/index.js +1 -1
- package/es/dashboard-workbench/components/global-filter-condition/index.js.map +1 -1
- package/es/dashboard-workbench/lang/en-US.js +1 -1
- package/es/dashboard-workbench/lang/en-US.js.map +1 -1
- package/package.json +1 -1
- package/umd/pivot-table.umd.cjs +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../packages/dashboard-workbench/components/global-filter-condition/index.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from 'react'\nimport clsx from 'clsx'\nimport { Button, Popover, Select } from 'antd'\nimport { PlusOutlined } from '@ant-design/icons'\nimport { useTranslation } from 'react-i18next'\nimport { useMemoizedFn } from 'ahooks'\nimport { cloneDeep, isEqual } from 'lodash-es'\nimport { useAppContext } from '@platox/pivot-table/context'\nimport IconFilter from '@platox/pivot-table/icon/icon-Filter'\nimport { useConditionTypeOptions } from '../add-module-modal/components/condition-modal/config'\nimport ConditionRowItem from './ConditionRowItem'\nimport { FieldPickerDataSourceItem } from './FieldPicker'\nimport styles from './index.module.less'\nimport { ConditionBlockWrapper, ConditionListItemWrapper } from './interface'\nimport { Context, ContextProps, useContext } from './useContext'\nimport { getMergeId } from './util'\n\nconst componentName = 'global-filter-condition'\n\nconst Empty: unknown[] = []\n\n/* ============================== split =============================== */\n\nexport interface GlobalFilterConditionProps {\n className?: string\n style?: React.CSSProperties\n}\nexport const GlobalFilterCondition: React.FC<GlobalFilterConditionProps> = props => {\n const { className, style } = props\n\n const { t } = useTranslation()\n\n const { globalFilterCondition, setGlobalFilterCondition } = useAppContext()\n\n const [open, setOpen] = useState<boolean>(false)\n\n /* ============================== 整理数据 =============================== */\n const { globalData } = useAppContext()\n const { fieldPickerDataSource, flattenFieldMap } = useMemo(() => {\n let flattenFieldMap: ContextProps['flattenFieldMap'] = new Map()\n\n let fieldPickerDataSource = (globalData?.sourceData || []).map(item => {\n let children = (item?.fields || []).map(v => {\n let mergeId = getMergeId(item?.value, v?.value)\n\n // 记录mergeId对应的field和source\n flattenFieldMap.set(mergeId, {\n field: v,\n source: item,\n mergeId: mergeId,\n })\n\n return {\n key: mergeId,\n label: v?.label,\n disabled: v.disabled ?? false,\n }\n })\n\n return {\n key: item?.value,\n label: item?.label,\n children,\n popupClassName: styles['sub-popup'],\n }\n })\n\n return {\n fieldPickerDataSource: fieldPickerDataSource as unknown as FieldPickerDataSourceItem[],\n flattenFieldMap,\n }\n }, [globalData?.sourceData])\n\n return (\n <Context.Provider\n value={{\n fieldPickerDataSource: fieldPickerDataSource,\n flattenFieldMap: flattenFieldMap,\n }}\n >\n <div className={clsx(styles[`${componentName}`], className)} style={style}>\n <Popover\n content={\n <PopoverContent\n defaultValue={globalFilterCondition}\n onClose={(isOk, data) => {\n if (isOk) {\n setGlobalFilterCondition(data!)\n }\n setOpen(false)\n }}\n />\n }\n destroyTooltipOnHide\n placement=\"bottomRight\"\n trigger=\"click\"\n open={open}\n onOpenChange={setOpen}\n >\n <Button\n className={`!px-1 ${(globalFilterCondition?.length ?? 0) > 0 ? '!bg-primary/10' : ''}`}\n type=\"text\"\n icon={<IconFilter />}\n >\n {t('globalfilter')}\n {/* {t('common.filter')} */}\n </Button>\n </Popover>\n </div>\n </Context.Provider>\n )\n}\n\nGlobalFilterCondition.displayName = 'GlobalFilterCondition'\n\nexport default GlobalFilterCondition\n\n/* ============================== split =============================== */\n\nexport type PopoverContentProps = {\n defaultValue?: ConditionBlockWrapper[]\n onClose?: (isOk: boolean, data?: ConditionBlockWrapper[]) => void\n}\n\nexport const PopoverContent = (props: PopoverContentProps) => {\n const { defaultValue } = props\n\n const { t } = useTranslation()\n const fieldPickerDataSource = useContext().fieldPickerDataSource\n const conditionTypeOptions = useConditionTypeOptions()\n\n /* ============================== split =============================== */\n const [value = Empty as ConditionBlockWrapper[], setValue] = useState<ConditionBlockWrapper[]>([])\n\n useEffect(() => {\n if (defaultValue) {\n setValue(cloneDeep(defaultValue))\n }\n }, [defaultValue])\n\n /* ============================== 这是empty =============================== */\n const [emptyBlockList, setEmptyBlockList] = useState<ConditionListItemWrapper[]>([])\n\n const handleEmptyBlockListChange = (newItem: ConditionListItemWrapper) => {\n if (newItem?.field) {\n setValue(prev => {\n let ret = [...prev]\n let match = ret.find(item => item.dataSourceId === newItem.dataSourceId)\n if (match) {\n match.conditionList.push(newItem)\n return [...ret]\n } else {\n // 创建一个\n let newConditionBlockWrapper = {\n dataSourceId: newItem.dataSourceId,\n conditionType: 'all',\n conditionList: [newItem],\n } as ConditionBlockWrapper\n return [...ret, newConditionBlockWrapper]\n }\n })\n }\n }\n\n const handleAddEmptyBlock = () => {\n setEmptyBlockList([...emptyBlockList, {}])\n }\n\n /* ============================== split =============================== */\n const hasChange = useMemo(() => {\n return !isEqual(value, defaultValue)\n }, [value, defaultValue])\n\n const handleSubmit = useMemoizedFn(() => {\n props?.onClose?.(true, value)\n })\n\n return (\n <div className={clsx(styles[`${componentName}__popover`])}>\n <div\n style={{\n marginBottom: '10px',\n }}\n >\n {t('setFilterCondition')}\n </div>\n\n {value.map((item, index) => {\n let conditionList = item?.conditionList\n let dataSourceName = fieldPickerDataSource?.find(v => v.key === item?.dataSourceId)?.label\n console.log('dataSourceName', dataSourceName)\n return (\n <div className={clsx(styles[`${componentName}__block`])} key={item?.dataSourceId}>\n <div\n style={{\n marginBottom: '10px',\n display: 'flex',\n justifyContent: 'space-between',\n }}\n >\n <div>{dataSourceName}</div>\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n gap: '5px',\n }}\n >\n {t('conformTo')}\n <Select\n style={{ width: '80px' }}\n options={conditionTypeOptions}\n value={item?.conditionType}\n onChange={v => {\n setValue(prev => {\n let ret = [...prev]\n ret[index].conditionType = v\n return ret\n })\n }}\n />\n {t('addCondition')}\n </div>\n </div>\n <div\n style={{\n display: 'flex',\n flexDirection: 'column',\n gap: '10px',\n }}\n >\n {conditionList.map((v, conditionIndex) => {\n return (\n <ConditionRowItem\n key={conditionIndex}\n value={v}\n onChange={newValue => {\n setValue(prev => {\n let ret = [...prev]\n let prevItem = ret[index].conditionList[conditionIndex]\n if (prevItem?.dataSourceId !== newValue?.dataSourceId) {\n // 数据源变化了 删除原来的\n ret[index].conditionList.splice(conditionIndex, 1)\n if (ret[index].conditionList.length === 0) {\n ret.splice(index, 1)\n }\n // 添加到新的数据源添\n let newItem = newValue\n let match = ret.find(item => item.dataSourceId === newItem.dataSourceId)\n if (match) {\n match.conditionList.push(newItem)\n return [...ret]\n } else {\n let newConditionBlockWrapper = {\n dataSourceId: newItem.dataSourceId,\n conditionType: 'all',\n conditionList: [newItem],\n } as ConditionBlockWrapper\n return [...ret, newConditionBlockWrapper]\n }\n } else {\n ret[index].conditionList[conditionIndex] = {\n ...prevItem,\n ...newValue,\n }\n }\n\n return ret\n })\n }}\n onDelete={() => {\n setValue(prev => {\n let ret = [...prev]\n ret[index].conditionList.splice(conditionIndex, 1)\n\n if (ret[index].conditionList.length === 0) {\n ret.splice(index, 1)\n }\n return ret\n })\n }}\n />\n )\n })}\n </div>\n </div>\n )\n })}\n\n {emptyBlockList.map((item, index) => {\n return (\n <div className={clsx(styles[`${componentName}__block`])} key={index}>\n <ConditionRowItem\n value={item}\n onChange={newValue => {\n handleEmptyBlockListChange(newValue)\n }}\n onDelete={() => {\n setEmptyBlockList(prev => {\n let ret = [...prev]\n ret.splice(index, 1)\n return ret\n })\n }}\n />\n </div>\n )\n })}\n\n <Button\n type=\"dashed\"\n block\n style={{\n marginBottom: '10px',\n }}\n icon={<PlusOutlined />}\n onClick={() => {\n handleAddEmptyBlock()\n }}\n >\n {t('addCondition')}\n </Button>\n\n <div\n style={{\n display: 'flex',\n justifyContent: 'flex-end',\n }}\n >\n <Button\n type=\"primary\"\n disabled={!hasChange}\n onClick={() => {\n handleSubmit()\n }}\n >\n {t('confirm')}\n </Button>\n </div>\n </div>\n )\n}\n"],"names":["flattenFieldMap","fieldPickerDataSource","IconFilter","item"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../packages/dashboard-workbench/components/global-filter-condition/index.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from 'react'\nimport clsx from 'clsx'\nimport { Button, Popover, Select } from 'antd'\nimport { PlusOutlined } from '@ant-design/icons'\nimport { useTranslation } from 'react-i18next'\nimport { useMemoizedFn } from 'ahooks'\nimport { cloneDeep, isEqual } from 'lodash-es'\nimport { useAppContext } from '@platox/pivot-table/context'\nimport IconFilter from '@platox/pivot-table/icon/icon-Filter'\nimport { useConditionTypeOptions } from '../add-module-modal/components/condition-modal/config'\nimport ConditionRowItem from './ConditionRowItem'\nimport { FieldPickerDataSourceItem } from './FieldPicker'\nimport styles from './index.module.less'\nimport { ConditionBlockWrapper, ConditionListItemWrapper } from './interface'\nimport { Context, ContextProps, useContext } from './useContext'\nimport { getMergeId } from './util'\n\nconst componentName = 'global-filter-condition'\n\nconst Empty: unknown[] = []\n\n/* ============================== split =============================== */\n\nexport interface GlobalFilterConditionProps {\n className?: string\n style?: React.CSSProperties\n}\nexport const GlobalFilterCondition: React.FC<GlobalFilterConditionProps> = props => {\n const { className, style } = props\n\n const { t } = useTranslation()\n\n const { globalFilterCondition, setGlobalFilterCondition } = useAppContext()\n\n const [open, setOpen] = useState<boolean>(false)\n\n /* ============================== 整理数据 =============================== */\n const { globalData } = useAppContext()\n const { fieldPickerDataSource, flattenFieldMap } = useMemo(() => {\n let flattenFieldMap: ContextProps['flattenFieldMap'] = new Map()\n\n let fieldPickerDataSource = (globalData?.sourceData || []).map(item => {\n let children = (item?.fields || []).map(v => {\n let mergeId = getMergeId(item?.value, v?.value)\n\n // 记录mergeId对应的field和source\n flattenFieldMap.set(mergeId, {\n field: v,\n source: item,\n mergeId: mergeId,\n })\n\n return {\n key: mergeId,\n label: v?.label,\n disabled: v.disabled ?? false,\n }\n })\n\n return {\n key: item?.value,\n label: item?.label,\n children,\n popupClassName: styles['sub-popup'],\n }\n })\n\n return {\n fieldPickerDataSource: fieldPickerDataSource as unknown as FieldPickerDataSourceItem[],\n flattenFieldMap,\n }\n }, [globalData?.sourceData])\n\n return (\n <Context.Provider\n value={{\n fieldPickerDataSource: fieldPickerDataSource,\n flattenFieldMap: flattenFieldMap,\n }}\n >\n <div className={clsx(styles[`${componentName}`], className)} style={style}>\n <Popover\n content={\n <PopoverContent\n defaultValue={globalFilterCondition}\n onClose={(isOk, data) => {\n if (isOk) {\n setGlobalFilterCondition(data!)\n }\n setOpen(false)\n }}\n />\n }\n destroyTooltipOnHide\n placement=\"bottomRight\"\n trigger=\"click\"\n open={open}\n onOpenChange={setOpen}\n >\n <Button\n className={`!px-1 ${(globalFilterCondition?.length ?? 0) > 0 ? '!bg-primary/10' : ''}`}\n type=\"text\"\n icon={<IconFilter />}\n >\n {t('globalfilter')}\n {/* {t('common.filter')} */}\n </Button>\n </Popover>\n </div>\n </Context.Provider>\n )\n}\n\nGlobalFilterCondition.displayName = 'GlobalFilterCondition'\n\nexport default GlobalFilterCondition\n\n/* ============================== split =============================== */\n\nexport type PopoverContentProps = {\n defaultValue?: ConditionBlockWrapper[]\n onClose?: (isOk: boolean, data?: ConditionBlockWrapper[]) => void\n}\n\nexport const PopoverContent = (props: PopoverContentProps) => {\n const { defaultValue } = props\n\n const { t } = useTranslation()\n const fieldPickerDataSource = useContext().fieldPickerDataSource\n const conditionTypeOptions = useConditionTypeOptions()\n\n /* ============================== split =============================== */\n const [value = Empty as ConditionBlockWrapper[], setValue] = useState<ConditionBlockWrapper[]>([])\n\n useEffect(() => {\n if (defaultValue) {\n setValue(cloneDeep(defaultValue))\n }\n }, [defaultValue])\n\n /* ============================== 这是empty =============================== */\n const [emptyBlockList, setEmptyBlockList] = useState<ConditionListItemWrapper[]>([])\n\n const handleEmptyBlockListChange = (newItem: ConditionListItemWrapper) => {\n if (newItem?.field) {\n setValue(prev => {\n let ret = [...prev]\n let match = ret.find(item => item.dataSourceId === newItem.dataSourceId)\n if (match) {\n match.conditionList.push(newItem)\n return [...ret]\n } else {\n // 创建一个\n let newConditionBlockWrapper = {\n dataSourceId: newItem.dataSourceId,\n conditionType: 'all',\n conditionList: [newItem],\n } as ConditionBlockWrapper\n return [...ret, newConditionBlockWrapper]\n }\n })\n }\n }\n\n const handleAddEmptyBlock = () => {\n setEmptyBlockList([...emptyBlockList, {}])\n }\n\n /* ============================== split =============================== */\n const hasChange = useMemo(() => {\n return !isEqual(value, defaultValue)\n }, [value, defaultValue])\n\n const handleSubmit = useMemoizedFn(() => {\n props?.onClose?.(true, value)\n })\n\n return (\n <div className={clsx(styles[`${componentName}__popover`])}>\n <div\n style={{\n marginBottom: '10px',\n }}\n >\n {t('setFilterCondition')}\n </div>\n\n {value.map((item, index) => {\n let conditionList = item?.conditionList\n let dataSourceName = fieldPickerDataSource?.find(v => v.key === item?.dataSourceId)?.label\n console.log('dataSourceName', dataSourceName)\n return (\n <div className={clsx(styles[`${componentName}__block`])} key={item?.dataSourceId}>\n <div\n style={{\n marginBottom: '10px',\n display: 'flex',\n justifyContent: 'space-between',\n }}\n >\n <div>{dataSourceName}</div>\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n gap: '5px',\n }}\n >\n {t('conformTo')}\n <Select\n style={{ width: '80px' }}\n options={conditionTypeOptions}\n value={item?.conditionType}\n onChange={v => {\n setValue(prev => {\n let ret = [...prev]\n ret[index].conditionType = v\n return ret\n })\n }}\n />\n {t('condition')}\n </div>\n </div>\n <div\n style={{\n display: 'flex',\n flexDirection: 'column',\n gap: '10px',\n }}\n >\n {conditionList.map((v, conditionIndex) => {\n return (\n <ConditionRowItem\n key={conditionIndex}\n value={v}\n onChange={newValue => {\n setValue(prev => {\n let ret = [...prev]\n let prevItem = ret[index].conditionList[conditionIndex]\n if (prevItem?.dataSourceId !== newValue?.dataSourceId) {\n // 数据源变化了 删除原来的\n ret[index].conditionList.splice(conditionIndex, 1)\n if (ret[index].conditionList.length === 0) {\n ret.splice(index, 1)\n }\n // 添加到新的数据源添\n let newItem = newValue\n let match = ret.find(item => item.dataSourceId === newItem.dataSourceId)\n if (match) {\n match.conditionList.push(newItem)\n return [...ret]\n } else {\n let newConditionBlockWrapper = {\n dataSourceId: newItem.dataSourceId,\n conditionType: 'all',\n conditionList: [newItem],\n } as ConditionBlockWrapper\n return [...ret, newConditionBlockWrapper]\n }\n } else {\n ret[index].conditionList[conditionIndex] = {\n ...prevItem,\n ...newValue,\n }\n }\n\n return ret\n })\n }}\n onDelete={() => {\n setValue(prev => {\n let ret = [...prev]\n ret[index].conditionList.splice(conditionIndex, 1)\n\n if (ret[index].conditionList.length === 0) {\n ret.splice(index, 1)\n }\n return ret\n })\n }}\n />\n )\n })}\n </div>\n </div>\n )\n })}\n\n {emptyBlockList.map((item, index) => {\n return (\n <div className={clsx(styles[`${componentName}__block`])} key={index}>\n <ConditionRowItem\n value={item}\n onChange={newValue => {\n handleEmptyBlockListChange(newValue)\n }}\n onDelete={() => {\n setEmptyBlockList(prev => {\n let ret = [...prev]\n ret.splice(index, 1)\n return ret\n })\n }}\n />\n </div>\n )\n })}\n\n <Button\n type=\"dashed\"\n block\n style={{\n marginBottom: '10px',\n }}\n icon={<PlusOutlined />}\n onClick={() => {\n handleAddEmptyBlock()\n }}\n >\n {t('addCondition')}\n </Button>\n\n <div\n style={{\n display: 'flex',\n justifyContent: 'flex-end',\n }}\n >\n <Button\n type=\"primary\"\n disabled={!hasChange}\n onClick={() => {\n handleSubmit()\n }}\n >\n {t('confirm')}\n </Button>\n </div>\n </div>\n )\n}\n"],"names":["flattenFieldMap","fieldPickerDataSource","IconFilter","item"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en-US.js","sources":["../../../packages/dashboard-workbench/lang/en-US.ts"],"sourcesContent":["const common = {\n title: 'Dashboard',\n text: 'Text',\n confirm: 'Confirm',\n pleaseEnter: 'Please enter',\n configuration: 'Configuration',\n copy: 'Copy',\n delete: 'Delete',\n calendarText: 'Calendar',\n chartText: 'Chart',\n promptTitle: 'Prompt',\n promptContentDeleteComponents: 'Are you sure you want to delete this component?',\n unnamedRecord: 'Unnamed Record',\n setFilteringCriteria: 'Set filtering criteria',\n all: 'All',\n everyone: 'Any',\n condition: '
|
|
1
|
+
{"version":3,"file":"en-US.js","sources":["../../../packages/dashboard-workbench/lang/en-US.ts"],"sourcesContent":["const common = {\n title: 'Dashboard',\n text: 'Text',\n confirm: 'Confirm',\n pleaseEnter: 'Please enter',\n configuration: 'Configuration',\n copy: 'Copy',\n delete: 'Delete',\n calendarText: 'Calendar',\n chartText: 'Chart',\n promptTitle: 'Prompt',\n promptContentDeleteComponents: 'Are you sure you want to delete this component?',\n unnamedRecord: 'Unnamed Record',\n setFilteringCriteria: 'Set filtering criteria',\n all: 'All',\n everyone: 'Any',\n condition: 'Conditions',\n addCondition: 'Add condition',\n equalto: 'Equal to',\n notequalto: 'Not equal to',\n contain: 'Contains',\n notcontain: 'Does not contain',\n null: 'Is empty',\n notnull: 'Is not empty',\n conformTo: 'Match the following',\n statisticsText: 'Statistics Text',\n typeData: 'Type and Data',\n customStyle: 'Custom Style',\n dataSource: 'Data Source',\n dataRange: 'Data Range',\n data: 'Data',\n filterData: 'Filter Data',\n selectNcondition: 'Selected {{n}} conditions',\n allData: 'All Data',\n statisticstMethods: 'Statistical Methods',\n statisticstRecordNum: 'Total Number of Records',\n statisticstFieldVal: 'Statistical Field Values',\n selectField: 'Select Field',\n sumVal: 'Sum',\n maxVal: 'Maximum Value',\n minVal: 'Minimum Value',\n averageVal: 'Average Value',\n empty: 'No Data',\n\n filter: 'Filter',\n globalfilter: 'Global Filter',\n setFilterCondition: 'Set Filter Condition',\n selectGroupField: 'Select Group Field',\n}\n\nconst pb = {\n text: 'text',\n statisticsText: 'Statistics',\n unknown: 'unknown',\n}\n\nconst statistics = {\n t1: 'Color Scheme',\n t2: 'Value Settings',\n t3: 'Decimal Places and Format',\n t4: 'Please enter decimal places',\n t5: 'Number (Thousand Separator)',\n t6: 'Number',\n t7: 'Percentage',\n currency: 'Currency',\n t8: 'Renminbi',\n t9: 'Dollar',\n t10: 'Statistical Value Description',\n t11: 'EUR',\n t12: 'GBP',\n t13: 'THB',\n}\n\nconst chart = {\n t1: 'Chart Type',\n t2: 'Basic Bar Chart',\n t3: 'Stacked Bar Chart',\n t4: 'Percentage Bar Chart',\n t5: 'Basic Horizontal Bar Chart',\n t6: 'Stacked Horizontal Bar Chart',\n t7: 'Percentage Stacked Horizontal Bar Chart',\n t8: 'Line Chart',\n t9: 'Smooth Line Chart',\n t10: 'Pie Chart',\n t11: 'Doughnut Chart',\n t12: 'Chart Options',\n _t12: 'Combination Chart',\n t13: 'Legend',\n t14: 'Data Label',\n t15: 'Axis',\n t16: 'Grid Line',\n t17: 'Sector Division',\n t18: 'Horizontal Axis (Category)',\n t19: 'Sector Value',\n t20: 'Vertical Axis (Field)',\n t21: 'Horizontal Axis',\n t22: 'Horizontal Axis Title',\n t23: 'Axis Options',\n t24: 'Show Labels',\n t25: 'Show Axis Line',\n t26: 'Vertical Axis',\n t27: 'Vertical Axis Title',\n t28: 'Axis Options',\n t29: 'Show Labels',\n t30: 'Show Axis Line',\n t31: 'Sort By',\n t32: 'Horizontal Axis Value',\n t33: 'Vertical Axis Value',\n t34: 'Record Sequence',\n t35: 'Sort Order',\n t36: 'Ascending',\n t37: 'Descending',\n t38: 'Grouping And Aggregation',\n\n t39: 'Aggregate by time',\n t40: 'Aggregate by day',\n t41: 'Aggregate by week',\n t42: 'Aggregate by month',\n t43: 'Aggregate by year',\n\n groupFieldConfig: 'Group Field Configuration',\n\n left: 'Left',\n right: 'Right',\n}\n\nconst calendar = {\n t1: 'View Configuration',\n t2: 'Start Date',\n t3: 'End Date',\n t4: 'Title Display',\n}\n\nconst add = {\n add1: 'Chart',\n add2: 'Bar Chart',\n add3: 'Line Chart',\n add4: 'Pie Chart',\n add5: 'Bar Graph',\n _add5: 'Combination Chart',\n add6: 'Other',\n add7: 'Statistics',\n add8: 'Text',\n add9: 'Calendar',\n add10: 'Add Block',\n add11: 'Equal to',\n add12: 'Not Equal to',\n add13: 'Equal to',\n add14: 'Before(<)',\n add15: 'After(>)',\n add16: 'Within Range',\n timeBefore: 'Before (excluding the day)',\n timeAfter: 'After (excluding the day)',\n timeRange: 'Date Range (including the day)',\n add17: 'Is Empty',\n add18: 'Is Not Empty',\n add19: 'Not Equal to',\n add20: 'Greater than',\n add21: 'Greater than or Equal to',\n add22: 'Less than',\n add23: 'Less than or Equal to',\n add24: 'Contains',\n add25: 'Does Not Contain',\n add26: 'Specific Date',\n add27: 'Today',\n add28: 'Yesterday',\n add29: 'This Week',\n add30: 'Last Week',\n add31: 'This Month',\n add32: 'Last Month',\n add33: 'Past 7 Days',\n add34: 'Past 30 Days',\n add35: 'Last Year',\n add36: 'This Year',\n add37: 'The Month Before Last',\n}\n\nexport const displayRange = {\n title: 'Display Data',\n all: 'All',\n top5: 'Top 5',\n top10: 'Top 10',\n top20: 'Top 20',\n top30: 'Top 30',\n bottom5: 'Bottom 5',\n bottom10: 'Bottom 10',\n bottom20: 'Bottom 20',\n bottom30: 'Bottom 30',\n}\n\nexport default {\n ...common,\n displayRange,\n pb,\n statistics,\n chart,\n calendar,\n add,\n}\n"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
package/umd/pivot-table.umd.cjs
CHANGED
|
@@ -160,7 +160,7 @@ echarts.use([`+M+"]);":"Unknown series "+A))}return}if(c==="tooltip"){if(b){proc
|
|
|
160
160
|
`,"Illegal config:",f,`.
|
|
161
161
|
`)),it(n));var y=h?eR(h):null;h&&!y&&(process.env.NODE_ENV!=="production"&&(n=Kr("Invalid parser name "+h+`.
|
|
162
162
|
`,"Illegal config:",f,`.
|
|
163
|
-
`)),it(n)),a.push({dimIdx:m.index,parser:y,comparator:new rR(d,v)})});var o=e.sourceFormat;o!==mr&&o!==mn&&(process.env.NODE_ENV!=="production"&&(n='sourceFormat "'+o+'" is not supported yet'),it(n));for(var s=[],l=0,u=e.count();l<u;l++)s.push(e.getRawDataItem(l));return s.sort(function(f,c){for(var d=0;d<a.length;d++){var h=a[d],v=e.retrieveValueFromItem(f,h.dimIdx),g=e.retrieveValueFromItem(c,h.dimIdx);h.parser&&(v=h.parser(v),g=h.parser(g));var p=h.comparator.evaluate(v,g);if(p!==0)return p}return 0}),{data:s}}};function tue(t){t.registerTransform(Jle),t.registerTransform(eue)}var rue=function(t){he(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.prototype.init=function(r,n,i){t.prototype.init.call(this,r,n,i),this._sourceManager=new HR(this),VR(this)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.call(this,r,n),VR(this)},e.prototype.optionUpdated=function(){this._sourceManager.dirty()},e.prototype.getSourceManager=function(){return this._sourceManager},e.type="dataset",e.defaultOption={seriesLayoutBy:Zn},e}(st),nue=function(t){he(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.type="dataset",e}(yn);function iue(t){t.registerComponentModel(rue),t.registerComponentView(nue)}function aue(t){if(t){for(var e=[],r=0;r<t.length;r++)e.push(t[r].slice());return e}}function oue(t,e){var r=t.label,n=e&&e.getTextGuideLine();return{dataIndex:t.dataIndex,dataType:t.dataType,seriesIndex:t.seriesModel.seriesIndex,text:t.label.style.text,rect:t.hostRect,labelRect:t.rect,align:r.style.align,verticalAlign:r.style.verticalAlign,labelLinePoints:aue(n&&n.shape.points)}}var D8=["align","verticalAlign","width","height","fontSize"],zr=new hf,s_=ht(),sue=ht();function Sp(t,e,r){for(var n=0;n<r.length;n++){var i=r[n];e[i]!=null&&(t[i]=e[i])}}var Ep=["x","y","rotation"],lue=function(){function t(){this._labelList=[],this._chartViewList=[]}return t.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},t.prototype._addLabel=function(e,r,n,i,a){var o=i.style,s=i.__hostTarget,l=s.textConfig||{},u=i.getComputedTransform(),f=i.getBoundingRect().plain();ke.applyTransform(f,f,u),u?zr.setLocalTransform(u):(zr.x=zr.y=zr.rotation=zr.originX=zr.originY=0,zr.scaleX=zr.scaleY=1),zr.rotation=ta(zr.rotation);var c=i.__hostTarget,d;if(c){d=c.getBoundingRect().plain();var h=c.getComputedTransform();ke.applyTransform(d,d,h)}var v=d&&c.getTextGuideLine();this._labelList.push({label:i,labelLine:v,seriesModel:n,dataIndex:e,dataType:r,layoutOptionOrCb:a,layoutOption:null,rect:f,hostRect:d,priority:d?d.width*d.height:0,defaultAttr:{ignore:i.ignore,labelGuideIgnore:v&&v.ignore,x:zr.x,y:zr.y,scaleX:zr.scaleX,scaleY:zr.scaleY,rotation:zr.rotation,style:{x:o.x,y:o.y,align:o.align,verticalAlign:o.verticalAlign,width:o.width,height:o.height,fontSize:o.fontSize},cursor:i.cursor,attachedPos:l.position,attachedRot:l.rotation}})},t.prototype.addLabelsOfSeries=function(e){var r=this;this._chartViewList.push(e);var n=e.__model,i=n.get("labelLayout");(Pe(i)||nt(i).length)&&e.group.traverse(function(a){if(a.ignore)return!0;var o=a.getTextContent(),s=Xe(a);o&&!o.disableLabelLayout&&r._addLabel(s.dataIndex,s.dataType,n,o,i)})},t.prototype.updateLayoutConfig=function(e){var r=e.getWidth(),n=e.getHeight();function i(b,C){return function(){VP(b,C)}}for(var a=0;a<this._labelList.length;a++){var o=this._labelList[a],s=o.label,l=s.__hostTarget,u=o.defaultAttr,f=void 0;Pe(o.layoutOptionOrCb)?f=o.layoutOptionOrCb(oue(o,l)):f=o.layoutOptionOrCb,f=f||{},o.layoutOption=f;var c=Math.PI/180;l&&l.setTextConfig({local:!1,position:f.x!=null||f.y!=null?null:u.attachedPos,rotation:f.rotate!=null?f.rotate*c:u.attachedRot,offset:[f.dx||0,f.dy||0]});var d=!1;if(f.x!=null?(s.x=Dt(f.x,r),s.setStyle("x",0),d=!0):(s.x=u.x,s.setStyle("x",u.style.x)),f.y!=null?(s.y=Dt(f.y,n),s.setStyle("y",0),d=!0):(s.y=u.y,s.setStyle("y",u.style.y)),f.labelLinePoints){var h=l.getTextGuideLine();h&&(h.setShape({points:f.labelLinePoints}),d=!1)}var v=s_(s);v.needsUpdateLabelLine=d,s.rotation=f.rotate!=null?f.rotate*c:u.rotation,s.scaleX=u.scaleX,s.scaleY=u.scaleY;for(var g=0;g<D8.length;g++){var p=D8[g];s.setStyle(p,f[p]!=null?f[p]:u.style[p])}if(f.draggable){if(s.draggable=!0,s.cursor="move",l){var m=o.seriesModel;if(o.dataIndex!=null){var y=o.seriesModel.getData(o.dataType);m=y.getItemModel(o.dataIndex)}s.on("drag",i(l,m.getModel("labelLine")))}}else s.off("drag"),s.cursor=u.cursor}},t.prototype.layout=function(e){var r=e.getWidth(),n=e.getHeight(),i=[];H(this._labelList,function(l){l.defaultAttr.ignore||i.push(I1({},l))});var a=Bt(i,function(l){return l.layoutOption.moveOverlap==="shiftX"}),o=Bt(i,function(l){return l.layoutOption.moveOverlap==="shiftY"});N1(a,0,0,r),N1(o,1,0,n);var s=Bt(i,function(l){return l.layoutOption.hideOverlap});cne(s),KP(s)},t.prototype.processLabelsOverall=function(){var e=this;H(this._chartViewList,function(r){var n=r.__model,i=r.ignoreLabelLineUpdate,a=n.isAnimationEnabled();r.group.traverse(function(o){if(o.ignore&&!o.forceLabelAnimation)return!0;var s=!i,l=o.getTextContent();!s&&l&&(s=s_(l).needsUpdateLabelLine),s&&e._updateLabelLine(o,n),a&&e._animateLabels(o,n)})})},t.prototype._updateLabelLine=function(e,r){var n=e.getTextContent(),i=Xe(e),a=i.dataIndex;if(n&&a!=null){var o=r.getData(i.dataType),s=o.getItemModel(a),l={},u=o.getItemVisual(a,"style");if(u){var f=o.getVisual("drawType");l.stroke=u[f]}var c=s.getModel("labelLine");$P(e,GP(s),l),VP(e,c)}},t.prototype._animateLabels=function(e,r){var n=e.getTextContent(),i=e.getTextGuideLine();if(n&&(e.forceLabelAnimation||!n.ignore&&!n.invisible&&!e.disableLabelAnimation&&!Ll(e))){var a=s_(n),o=a.oldLayout,s=Xe(e),l=s.dataIndex,u={x:n.x,y:n.y,rotation:n.rotation},f=r.getData(s.dataType);if(o){n.attr(o);var d=e.prevStates;d&&(Qe(d,"select")>=0&&n.attr(a.oldLayoutSelect),Qe(d,"emphasis")>=0&&n.attr(a.oldLayoutEmphasis)),sr(n,u,r,l)}else if(n.attr(u),!kl(n).valueAnimation){var c=Ae(n.style.opacity,1);n.style.opacity=0,Or(n,{style:{opacity:c}},r,l)}if(a.oldLayout=u,n.states.select){var h=a.oldLayoutSelect={};Sp(h,u,Ep),Sp(h,n.states.select,Ep)}if(n.states.emphasis){var v=a.oldLayoutEmphasis={};Sp(v,u,Ep),Sp(v,n.states.emphasis,Ep)}LJ(n,l,f,r,r)}if(i&&!i.ignore&&!i.invisible){var a=sue(i),o=a.oldLayout,g={points:i.shape.points};o?(i.attr({shape:o}),sr(i,{shape:g},r)):(i.setShape(g),i.style.strokePercent=0,Or(i,{style:{strokePercent:1}},r)),a.oldLayout=g}},t}(),l_=ht();function uue(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){var i=l_(r).labelManager;i||(i=l_(r).labelManager=new lue),i.clearLabels()}),t.registerUpdateLifecycle("series:layoutlabels",function(e,r,n){var i=l_(r).labelManager;n.updatedSeries.forEach(function(a){i.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),i.updateLayoutConfig(r),i.layout(r),i.processLabelsOverall()})}var Li=ea.CMD;function su(t,e){return Math.abs(t-e)<1e-5}function u_(t){var e=t.data,r=t.len(),n=[],i,a=0,o=0,s=0,l=0;function u(O,P){i&&i.length>2&&n.push(i),i=[O,P]}function f(O,P,N,F){su(O,N)&&su(P,F)||i.push(O,P,N,F,N,F)}function c(O,P,N,F,L,j){var W=Math.abs(P-O),B=Math.tan(W/4)*4/3,z=P<O?-1:1,Y=Math.cos(O),X=Math.sin(O),ee=Math.cos(P),te=Math.sin(P),V=Y*L+N,J=X*j+F,G=ee*L+N,k=te*j+F,Q=L*B*z,K=j*B*z;i.push(V-Q*X,J+K*Y,G+Q*te,k-K*ee,G,k)}for(var d,h,v,g,p=0;p<r;){var m=e[p++],y=p===1;switch(y&&(a=e[p],o=e[p+1],s=a,l=o,(m===Li.L||m===Li.C||m===Li.Q)&&(i=[s,l])),m){case Li.M:a=s=e[p++],o=l=e[p++],u(s,l);break;case Li.L:d=e[p++],h=e[p++],f(a,o,d,h),a=d,o=h;break;case Li.C:i.push(e[p++],e[p++],e[p++],e[p++],a=e[p++],o=e[p++]);break;case Li.Q:d=e[p++],h=e[p++],v=e[p++],g=e[p++],i.push(a+2/3*(d-a),o+2/3*(h-o),v+2/3*(d-v),g+2/3*(h-g),v,g),a=v,o=g;break;case Li.A:var b=e[p++],C=e[p++],_=e[p++],w=e[p++],x=e[p++],S=e[p++]+x;p+=1;var E=!e[p++];d=Math.cos(x)*_+b,h=Math.sin(x)*w+C,y?(s=d,l=h,u(s,l)):f(a,o,d,h),a=Math.cos(S)*_+b,o=Math.sin(S)*w+C;for(var T=(E?-1:1)*Math.PI/2,A=x;E?A>S:A<S;A+=T){var M=E?Math.max(A+T,S):Math.min(A+T,S);c(A,M,b,C,_,w)}break;case Li.R:s=a=e[p++],l=o=e[p++],d=s+e[p++],h=l+e[p++],u(d,l),f(d,l,d,h),f(d,h,s,h),f(s,h,s,l),f(s,l,d,l);break;case Li.Z:i&&f(a,o,s,l),a=s,o=l;break}}return i&&i.length>2&&n.push(i),n}function f_(t,e,r,n,i,a,o,s,l,u){if(su(t,r)&&su(e,n)&&su(i,o)&&su(a,s)){l.push(o,s);return}var f=2/u,c=f*f,d=o-t,h=s-e,v=Math.sqrt(d*d+h*h);d/=v,h/=v;var g=r-t,p=n-e,m=i-o,y=a-s,b=g*g+p*p,C=m*m+y*y;if(b<c&&C<c){l.push(o,s);return}var _=d*g+h*p,w=-d*m-h*y,x=b-_*_,S=C-w*w;if(x<c&&_>=0&&S<c&&w>=0){l.push(o,s);return}var E=[],T=[];Na(t,r,i,o,.5,E),Na(e,n,a,s,.5,T),f_(E[0],T[0],E[1],T[1],E[2],T[2],E[3],T[3],l,u),f_(E[4],T[4],E[5],T[5],E[6],T[6],E[7],T[7],l,u)}function fue(t,e){var r=u_(t),n=[];e=e||1;for(var i=0;i<r.length;i++){var a=r[i],o=[],s=a[0],l=a[1];o.push(s,l);for(var u=2;u<a.length;){var f=a[u++],c=a[u++],d=a[u++],h=a[u++],v=a[u++],g=a[u++];f_(s,l,f,c,d,h,v,g,o,e),s=v,l=g}n.push(o)}return n}function S8(t,e,r){var n=t[e],i=t[1-e],a=Math.abs(n/i),o=Math.ceil(Math.sqrt(a*r)),s=Math.floor(r/o);s===0&&(s=1,o=r);for(var l=[],u=0;u<o;u++)l.push(s);var f=o*s,c=r-f;if(c>0)for(var u=0;u<c;u++)l[u%o]+=1;return l}function E8(t,e,r){for(var n=t.r0,i=t.r,a=t.startAngle,o=t.endAngle,s=Math.abs(o-a),l=s*i,u=i-n,f=l>Math.abs(u),c=S8([l,u],f?0:1,e),d=(f?s:u)/c.length,h=0;h<c.length;h++)for(var v=(f?u:s)/c[h],g=0;g<c[h];g++){var p={};f?(p.startAngle=a+d*h,p.endAngle=a+d*(h+1),p.r0=n+v*g,p.r=n+v*(g+1)):(p.startAngle=a+v*g,p.endAngle=a+v*(g+1),p.r0=n+d*h,p.r=n+d*(h+1)),p.clockwise=t.clockwise,p.cx=t.cx,p.cy=t.cy,r.push(p)}}function cue(t,e,r){for(var n=t.width,i=t.height,a=n>i,o=S8([n,i],a?0:1,e),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",f=a?"y":"x",c=t[s]/o.length,d=0;d<o.length;d++)for(var h=t[l]/o[d],v=0;v<o[d];v++){var g={};g[u]=d*c,g[f]=v*h,g[s]=c,g[l]=h,g.x+=t.x,g.y+=t.y,r.push(g)}}function A8(t,e,r,n){return t*n-r*e}function due(t,e,r,n,i,a,o,s){var l=r-t,u=n-e,f=o-i,c=s-a,d=A8(f,c,l,u);if(Math.abs(d)<1e-6)return null;var h=t-i,v=e-a,g=A8(h,v,f,c)/d;return g<0||g>1?null:new Re(g*l+t,g*u+e)}function hue(t,e,r){var n=new Re;Re.sub(n,r,e),n.normalize();var i=new Re;Re.sub(i,t,e);var a=i.dot(n);return a}function lu(t,e){var r=t[t.length-1];r&&r[0]===e[0]&&r[1]===e[1]||t.push(e)}function vue(t,e,r){for(var n=t.length,i=[],a=0;a<n;a++){var o=t[a],s=t[(a+1)%n],l=due(o[0],o[1],s[0],s[1],e.x,e.y,r.x,r.y);l&&i.push({projPt:hue(l,e,r),pt:l,idx:a})}if(i.length<2)return[{points:t},{points:t}];i.sort(function(p,m){return p.projPt-m.projPt});var u=i[0],f=i[i.length-1];if(f.idx<u.idx){var c=u;u=f,f=c}for(var d=[u.pt.x,u.pt.y],h=[f.pt.x,f.pt.y],v=[d],g=[h],a=u.idx+1;a<=f.idx;a++)lu(v,t[a].slice());lu(v,h),lu(v,d);for(var a=f.idx+1;a<=u.idx+n;a++)lu(g,t[a%n].slice());return lu(g,d),lu(g,h),[{points:v},{points:g}]}function T8(t){var e=t.points,r=[],n=[];K2(e,r,n);var i=new ke(r[0],r[1],n[0]-r[0],n[1]-r[1]),a=i.width,o=i.height,s=i.x,l=i.y,u=new Re,f=new Re;return a>o?(u.x=f.x=s+a/2,u.y=l,f.y=l+o):(u.y=f.y=l+o/2,u.x=s,f.x=s+a),vue(e,u,f)}function Ap(t,e,r,n){if(r===1)n.push(e);else{var i=Math.floor(r/2),a=t(e);Ap(t,a[0],i,n),Ap(t,a[1],r-i,n)}return n}function pue(t,e){for(var r=[],n=0;n<e;n++)r.push(hb(t));return r}function gue(t,e){e.setStyle(t.style),e.z=t.z,e.z2=t.z2,e.zlevel=t.zlevel}function mue(t){for(var e=[],r=0;r<t.length;)e.push([t[r++],t[r++]]);return e}function yue(t,e){var r=[],n=t.shape,i;switch(t.type){case"rect":cue(n,e,r),i=jt;break;case"sector":E8(n,e,r),i=Pi;break;case"circle":E8({r0:0,r:n.r,startAngle:0,endAngle:Math.PI*2,cx:n.cx,cy:n.cy},e,r),i=Pi;break;default:var a=t.getComputedTransform(),o=a?Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1],a[2]*a[2]+a[3]*a[3])):1,s=Ce(fue(t.getUpdatedPathProxy(),o),function(m){return mue(m)}),l=s.length;if(l===0)Ap(T8,{points:s[0]},e,r);else if(l===e)for(var u=0;u<l;u++)r.push({points:s[u]});else{var f=0,c=Ce(s,function(m){var y=[],b=[];K2(m,y,b);var C=(b[1]-y[1])*(b[0]-y[0]);return f+=C,{poly:m,area:C}});c.sort(function(m,y){return y.area-m.area});for(var d=e,u=0;u<l;u++){var h=c[u];if(d<=0)break;var v=u===l-1?d:Math.ceil(h.area/f*e);v<0||(Ap(T8,{points:h.poly},v,r),d-=v)}}i=rv;break}if(!i)return pue(t,e);for(var g=[],u=0;u<r.length;u++){var p=new i;p.setShape(r[u]),gue(t,p),g.push(p)}return g}function bue(t,e){var r=t.length,n=e.length;if(r===n)return[t,e];for(var i=[],a=[],o=r<n?t:e,s=Math.min(r,n),l=Math.abs(n-r)/6,u=(s-2)/6,f=Math.ceil(l/u)+1,c=[o[0],o[1]],d=l,h=2;h<s;){var v=o[h-2],g=o[h-1],p=o[h++],m=o[h++],y=o[h++],b=o[h++],C=o[h++],_=o[h++];if(d<=0){c.push(p,m,y,b,C,_);continue}for(var w=Math.min(d,f-1)+1,x=1;x<=w;x++){var S=x/w;Na(v,p,y,C,S,i),Na(g,m,b,_,S,a),v=i[3],g=a[3],c.push(i[1],a[1],i[2],a[2],v,g),p=i[5],m=a[5],y=i[6],b=a[6]}d-=w-1}return o===t?[c,e]:[t,c]}function O8(t,e){for(var r=t.length,n=t[r-2],i=t[r-1],a=[],o=0;o<e.length;)a[o++]=n,a[o++]=i;return a}function Cue(t,e){for(var r,n,i,a=[],o=[],s=0;s<Math.max(t.length,e.length);s++){var l=t[s],u=e[s],f=void 0,c=void 0;l?u?(r=bue(l,u),f=r[0],c=r[1],n=f,i=c):(c=O8(i||l,l),f=l):(f=O8(n||u,u),c=u),a.push(f),o.push(c)}return[a,o]}function M8(t){for(var e=0,r=0,n=0,i=t.length,a=0,o=i-2;a<i;o=a,a+=2){var s=t[o],l=t[o+1],u=t[a],f=t[a+1],c=s*f-u*l;e+=c,r+=(s+u)*c,n+=(l+f)*c}return e===0?[t[0]||0,t[1]||0]:[r/e/3,n/e/3,e]}function _ue(t,e,r,n){for(var i=(t.length-2)/6,a=1/0,o=0,s=t.length,l=s-2,u=0;u<i;u++){for(var f=u*6,c=0,d=0;d<s;d+=2){var h=d===0?f:(f+d-2)%l+2,v=t[h]-r[0],g=t[h+1]-r[1],p=e[d]-n[0],m=e[d+1]-n[1],y=p-v,b=m-g;c+=y*y+b*b}c<a&&(a=c,o=u)}return o}function wue(t){for(var e=[],r=t.length,n=0;n<r;n+=2)e[n]=t[r-n-2],e[n+1]=t[r-n-1];return e}function xue(t,e,r,n){for(var i=[],a,o=0;o<t.length;o++){var s=t[o],l=e[o],u=M8(s),f=M8(l);a==null&&(a=u[2]<0!=f[2]<0);var c=[],d=[],h=0,v=1/0,g=[],p=s.length;a&&(s=wue(s));for(var m=_ue(s,l,u,f)*6,y=p-2,b=0;b<y;b+=2){var C=(m+b)%y+2;c[b+2]=s[C]-u[0],c[b+3]=s[C+1]-u[1]}c[0]=s[m]-u[0],c[1]=s[m+1]-u[1];for(var _=n/r,w=-n/2;w<=n/2;w+=_){for(var x=Math.sin(w),S=Math.cos(w),E=0,b=0;b<s.length;b+=2){var T=c[b],A=c[b+1],M=l[b]-f[0],O=l[b+1]-f[1],P=M*S-O*x,N=M*x+O*S;g[b]=P,g[b+1]=N;var F=P-T,L=N-A;E+=F*F+L*L}if(E<v){v=E,h=w;for(var j=0;j<g.length;j++)d[j]=g[j]}}i.push({from:c,to:d,fromCp:u,toCp:f,rotation:-h})}return i}function Tp(t){return t.__isCombineMorphing}var R8="__mOriginal_";function Op(t,e,r){var n=R8+e,i=t[n]||t[e];t[n]||(t[n]=t[e]);var a=r.replace,o=r.after,s=r.before;t[e]=function(){var l=arguments,u;return s&&s.apply(this,l),a?u=a.apply(this,l):u=i.apply(this,l),o&&o.apply(this,l),u}}function _c(t,e){var r=R8+e;t[r]&&(t[e]=t[r],t[r]=null)}function P8(t,e){for(var r=0;r<t.length;r++)for(var n=t[r],i=0;i<n.length;){var a=n[i],o=n[i+1];n[i++]=e[0]*a+e[2]*o+e[4],n[i++]=e[1]*a+e[3]*o+e[5]}}function B8(t,e){var r=t.getUpdatedPathProxy(),n=e.getUpdatedPathProxy(),i=Cue(u_(r),u_(n)),a=i[0],o=i[1],s=t.getComputedTransform(),l=e.getComputedTransform();function u(){this.transform=null}s&&P8(a,s),l&&P8(o,l),Op(e,"updateTransform",{replace:u}),e.transform=null;var f=xue(a,o,10,Math.PI),c=[];Op(e,"buildPath",{replace:function(d){for(var h=e.__morphT,v=1-h,g=[],p=0;p<f.length;p++){var m=f[p],y=m.from,b=m.to,C=m.rotation*h,_=m.fromCp,w=m.toCp,x=Math.sin(C),S=Math.cos(C);mh(g,_,w,h);for(var E=0;E<y.length;E+=2){var T=y[E],A=y[E+1],M=b[E],O=b[E+1],P=T*v+M*h,N=A*v+O*h;c[E]=P*S-N*x+g[0],c[E+1]=P*x+N*S+g[1]}var F=c[0],L=c[1];d.moveTo(F,L);for(var E=2;E<y.length;){var M=c[E++],O=c[E++],j=c[E++],W=c[E++],B=c[E++],z=c[E++];F===M&&L===O&&j===B&&W===z?d.lineTo(B,z):d.bezierCurveTo(M,O,j,W,B,z),F=B,L=z}}}})}function c_(t,e,r){if(!t||!e)return e;var n=r.done,i=r.during;B8(t,e),e.__morphT=0;function a(){_c(e,"buildPath"),_c(e,"updateTransform"),e.__morphT=-1,e.createPathProxy(),e.dirtyShape()}return e.animateTo({__morphT:1},Ke({during:function(o){e.dirtyShape(),i&&i(o)},done:function(){a(),n&&n()}},r)),e}function Due(t,e,r,n,i,a){var o=16;t=i===r?0:Math.round(32767*(t-r)/(i-r)),e=a===n?0:Math.round(32767*(e-n)/(a-n));for(var s=0,l,u=(1<<o)/2;u>0;u/=2){var f=0,c=0;(t&u)>0&&(f=1),(e&u)>0&&(c=1),s+=u*u*(3*f^c),c===0&&(f===1&&(t=u-1-t,e=u-1-e),l=t,t=e,e=l)}return s}function Mp(t){var e=1/0,r=1/0,n=-1/0,i=-1/0,a=Ce(t,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),f=l.x+l.width/2+(u?u[4]:0),c=l.y+l.height/2+(u?u[5]:0);return e=Math.min(f,e),r=Math.min(c,r),n=Math.max(f,n),i=Math.max(c,i),[f,c]}),o=Ce(a,function(s,l){return{cp:s,z:Due(s[0],s[1],e,r,n,i),path:t[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function I8(t){return yue(t.path,t.count)}function d_(){return{fromIndividuals:[],toIndividuals:[],count:0}}function Sue(t,e,r){var n=[];function i(_){for(var w=0;w<_.length;w++){var x=_[w];Tp(x)?i(x.childrenRef()):x instanceof Je&&n.push(x)}}i(t);var a=n.length;if(!a)return d_();var o=r.dividePath||I8,s=o({path:e,count:a});if(s.length!==a)return console.error("Invalid morphing: unmatched splitted path"),d_();n=Mp(n),s=Mp(s);for(var l=r.done,u=r.during,f=r.individualDelay,c=new hf,d=0;d<a;d++){var h=n[d],v=s[d];v.parent=e,v.copyTransform(c),f||B8(h,v)}e.__isCombineMorphing=!0,e.childrenRef=function(){return s};function g(_){for(var w=0;w<s.length;w++)s[w].addSelfToZr(_)}Op(e,"addSelfToZr",{after:function(_){g(_)}}),Op(e,"removeSelfFromZr",{after:function(_){for(var w=0;w<s.length;w++)s[w].removeSelfFromZr(_)}});function p(){e.__isCombineMorphing=!1,e.__morphT=-1,e.childrenRef=null,_c(e,"addSelfToZr"),_c(e,"removeSelfFromZr")}var m=s.length;if(f)for(var y=m,b=function(){y--,y===0&&(p(),l&&l())},d=0;d<m;d++){var C=f?Ke({delay:(r.delay||0)+f(d,m,n[d],s[d]),done:b},r):r;c_(n[d],s[d],C)}else e.__morphT=0,e.animateTo({__morphT:1},Ke({during:function(_){for(var w=0;w<m;w++){var x=s[w];x.__morphT=e.__morphT,x.dirtyShape()}u&&u(_)},done:function(){p();for(var _=0;_<t.length;_++)_c(t[_],"updateTransform");l&&l()}},r));return e.__zr&&g(e.__zr),{fromIndividuals:n,toIndividuals:s,count:m}}function Eue(t,e,r){var n=e.length,i=[],a=r.dividePath||I8;function o(h){for(var v=0;v<h.length;v++){var g=h[v];Tp(g)?o(g.childrenRef()):g instanceof Je&&i.push(g)}}if(Tp(t)){o(t.childrenRef());var s=i.length;if(s<n)for(var l=0,u=s;u<n;u++)i.push(hb(i[l++%s]));i.length=n}else{i=a({path:t,count:n});for(var f=t.getComputedTransform(),u=0;u<i.length;u++)i[u].setLocalTransform(f);if(i.length!==n)return console.error("Invalid morphing: unmatched splitted path"),d_()}i=Mp(i),e=Mp(e);for(var c=r.individualDelay,u=0;u<n;u++){var d=c?Ke({delay:(r.delay||0)+c(u,n,i[u],e[u])},r):r;c_(i[u],e[u],d)}return{fromIndividuals:i,toIndividuals:e,count:e.length}}function N8(t){return ve(t[0])}function L8(t,e){for(var r=[],n=t.length,i=0;i<n;i++)r.push({one:t[i],many:[]});for(var i=0;i<e.length;i++){var a=e[i].length,o=void 0;for(o=0;o<a;o++)r[o%n].many.push(e[i][o])}for(var s=0,i=n-1;i>=0;i--)if(!r[i].many.length){var l=r[s].many;if(l.length<=1)if(s)s=0;else return r;var a=l.length,u=Math.ceil(a/2);r[i].many=l.slice(u,a),r[s].many=l.slice(0,u),s++}return r}var Aue={clone:function(t){for(var e=[],r=1-Math.pow(1-t.path.style.opacity,1/t.count),n=0;n<t.count;n++){var i=hb(t.path);i.setStyle("opacity",r),e.push(i)}return e},split:null};function h_(t,e,r,n,i,a){if(!t.length||!e.length)return;var o=Nl("update",n,i);if(!(o&&o.duration>0))return;var s=n.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,f;N8(t)&&(u=t,f=e),N8(e)&&(u=e,f=t);function c(m,y,b,C,_){var w=m.many,x=m.one;if(w.length===1&&!_){var S=y?w[0]:x,E=y?x:w[0];if(Tp(S))c({many:[S],one:E},!0,b,C,!0);else{var T=s?Ke({delay:s(b,C)},l):l;c_(S,E,T),a(S,E,S,E,T)}}else for(var A=Ke({dividePath:Aue[r],individualDelay:s&&function(L,j,W,B){return s(L+b,C)}},l),M=y?Sue(w,x,A):Eue(x,w,A),O=M.fromIndividuals,P=M.toIndividuals,N=O.length,F=0;F<N;F++){var T=s?Ke({delay:s(F,N)},l):l;a(O[F],P[F],y?w[F]:m.one,y?m.one:w[F],T)}}for(var d=u?u===t:t.length>e.length,h=u?L8(f,u):L8(d?e:t,[d?t:e]),v=0,g=0;g<h.length;g++)v+=h[g].many.length;for(var p=0,g=0;g<h.length;g++)c(h[g],d,p,v),p+=h[g].many.length}function Os(t){if(!t)return[];if(ve(t)){for(var e=[],r=0;r<t.length;r++)e.push(Os(t[r]));return e}var n=[];return t.traverse(function(i){i instanceof Je&&!i.disableMorphing&&!i.invisible&&!i.ignore&&n.push(i)}),n}var F8=1e4,Tue=0,k8=1,j8=2,Oue=ht();function Mue(t,e){for(var r=t.dimensions,n=0;n<r.length;n++){var i=t.getDimensionInfo(r[n]);if(i&&i.otherDims[e]===0)return r[n]}}function Rue(t,e,r){var n=t.getDimensionInfo(r),i=n&&n.ordinalMeta;if(n){var a=t.get(n.name,e);return i&&i.categories[a]||a+""}}function z8(t,e,r,n){var i=n?"itemChildGroupId":"itemGroupId",a=Mue(t,i);if(a){var o=Rue(t,e,a);return o}var s=t.getRawDataItem(e),l=n?"childGroupId":"groupId";if(s&&s[l])return s[l]+"";if(!n)return r||t.getId(e)}function H8(t){var e=[];return H(t,function(r){var n=r.data,i=r.dataGroupId;if(n.count()>F8){process.env.NODE_ENV!=="production"&&Qt("Universal transition is disabled on large data > 10k.");return}for(var a=n.getIndices(),o=0;o<a.length;o++)e.push({data:n,groupId:z8(n,o,i,!1),childGroupId:z8(n,o,i,!0),divide:r.divide,dataIndex:o})}),e}function v_(t,e,r){t.traverse(function(n){n instanceof Je&&Or(n,{style:{opacity:0}},e,{dataIndex:r,isFrom:!0})})}function p_(t){if(t.parent){var e=t.getComputedTransform();t.setLocalTransform(e),t.parent.remove(t)}}function uu(t){t.stopAnimation(),t.isGroup&&t.traverse(function(e){e.stopAnimation()})}function Pue(t,e,r){var n=Nl("update",r,e);n&&t.traverse(function(i){if(i instanceof Fa){var a=gJ(i);a&&i.animateFrom({style:a},n)}})}function Bue(t,e){var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++){var i=t[n],a=e[n];if(i.data.getId(i.dataIndex)!==a.data.getId(a.dataIndex))return!1}return!0}function V8(t,e,r){var n=H8(t),i=H8(e);function a(b,C,_,w,x){(_||b)&&C.animateFrom({style:_&&_!==b?ue(ue({},_.style),b.style):b.style},x)}var o=!1,s=Tue,l=Ie(),u=Ie();n.forEach(function(b){b.groupId&&l.set(b.groupId,!0),b.childGroupId&&u.set(b.childGroupId,!0)});for(var f=0;f<i.length;f++){var c=i[f].groupId;if(u.get(c)){s=k8;break}var d=i[f].childGroupId;if(d&&l.get(d)){s=j8;break}}function h(b,C){return function(_){var w=_.data,x=_.dataIndex;return C?w.getId(x):b?s===k8?_.childGroupId:_.groupId:s===j8?_.childGroupId:_.groupId}}var v=Bue(n,i),g={};if(!v)for(var f=0;f<i.length;f++){var p=i[f],m=p.data.getItemGraphicEl(p.dataIndex);m&&(g[m.id]=!0)}function y(b,C){var _=n[C],w=i[b],x=w.data.hostModel,S=_.data.getItemGraphicEl(_.dataIndex),E=w.data.getItemGraphicEl(w.dataIndex);if(S===E){E&&Pue(E,w.dataIndex,x);return}S&&g[S.id]||E&&(uu(E),S?(uu(S),p_(S),o=!0,h_(Os(S),Os(E),w.divide,x,b,a)):v_(E,x,b))}new Pb(n,i,h(!0,v),h(!1,v),null,"multiple").update(y).updateManyToOne(function(b,C){var _=i[b],w=_.data,x=w.hostModel,S=w.getItemGraphicEl(_.dataIndex),E=Bt(Ce(C,function(T){return n[T].data.getItemGraphicEl(n[T].dataIndex)}),function(T){return T&&T!==S&&!g[T.id]});S&&(uu(S),E.length?(H(E,function(T){uu(T),p_(T)}),o=!0,h_(Os(E),Os(S),_.divide,x,b,a)):v_(S,x,_.dataIndex))}).updateOneToMany(function(b,C){var _=n[C],w=_.data.getItemGraphicEl(_.dataIndex);if(!(w&&g[w.id])){var x=Bt(Ce(b,function(E){return i[E].data.getItemGraphicEl(i[E].dataIndex)}),function(E){return E&&E!==w}),S=i[b[0]].data.hostModel;x.length&&(H(x,function(E){return uu(E)}),w?(uu(w),p_(w),o=!0,h_(Os(w),Os(x),_.divide,S,b[0],a)):H(x,function(E){return v_(E,S,b[0])}))}}).updateManyToMany(function(b,C){new Pb(C,b,function(_){return n[_].data.getId(n[_].dataIndex)},function(_){return i[_].data.getId(i[_].dataIndex)}).update(function(_,w){y(b[_],C[w])}).execute()}).execute(),o&&H(e,function(b){var C=b.data,_=C.hostModel,w=_&&r.getViewOfSeriesModel(_),x=Nl("update",_,0);w&&_.isAnimationEnabled()&&x&&x.duration>0&&w.group.traverse(function(S){S instanceof Je&&!S.animators.length&&S.animateFrom({style:{opacity:0}},x)})})}function W8(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function $8(t){return ve(t)?t.sort().join(","):t}function io(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function Iue(t,e){var r=Ie(),n=Ie(),i=Ie();H(t.oldSeries,function(o,s){var l=t.oldDataGroupIds[s],u=t.oldData[s],f=W8(o),c=$8(f);n.set(c,{dataGroupId:l,data:u}),ve(f)&&H(f,function(d){i.set(d,{key:c,dataGroupId:l,data:u})})});function a(o){r.get(o)&&Qt("Duplicated seriesKey in universalTransition "+o)}return H(e.updatedSeries,function(o){if(o.isUniversalTransitionEnabled()&&o.isAnimationEnabled()){var s=o.get("dataGroupId"),l=o.getData(),u=W8(o),f=$8(u),c=n.get(f);if(c)process.env.NODE_ENV!=="production"&&a(f),r.set(f,{oldSeries:[{dataGroupId:c.dataGroupId,divide:io(c.data),data:c.data}],newSeries:[{dataGroupId:s,divide:io(l),data:l}]});else if(ve(u)){process.env.NODE_ENV!=="production"&&a(f);var d=[];H(u,function(g){var p=n.get(g);p.data&&d.push({dataGroupId:p.dataGroupId,divide:io(p.data),data:p.data})}),d.length&&r.set(f,{oldSeries:d,newSeries:[{dataGroupId:s,data:l,divide:io(l)}]})}else{var h=i.get(u);if(h){var v=r.get(h.key);v||(v={oldSeries:[{dataGroupId:h.dataGroupId,data:h.data,divide:io(h.data)}],newSeries:[]},r.set(h.key,v)),v.newSeries.push({dataGroupId:s,data:l,divide:io(l)})}}}}),r}function G8(t,e){for(var r=0;r<t.length;r++){var n=e.seriesIndex!=null&&e.seriesIndex===t[r].seriesIndex||e.seriesId!=null&&e.seriesId===t[r].id;if(n)return r}}function Nue(t,e,r,n){var i=[],a=[];H(It(t.from),function(o){var s=G8(e.oldSeries,o);s>=0&&i.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:io(e.oldData[s]),groupIdDim:o.dimension})}),H(It(t.to),function(o){var s=G8(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:io(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&V8(i,a,n)}function Lue(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){H(It(n.seriesTransition),function(i){H(It(i.to),function(a){for(var o=n.updatedSeries,s=0;s<o.length;s++)(a.seriesIndex!=null&&a.seriesIndex===o[s].seriesIndex||a.seriesId!=null&&a.seriesId===o[s].id)&&(o[s][Iv]=!0)})})}),t.registerUpdateLifecycle("series:transition",function(e,r,n){var i=Oue(r);if(i.oldSeries&&n.updatedSeries&&n.optionChanged){var a=n.seriesTransition;if(a)H(It(a),function(h){Nue(h,i,n,r)});else{var o=Iue(i,n);H(o.keys(),function(h){var v=o.get(h);V8(v.oldSeries,v.newSeries,r)})}H(n.updatedSeries,function(h){h[Iv]&&(h[Iv]=!1)})}for(var s=e.getSeries(),l=i.oldSeries=[],u=i.oldDataGroupIds=[],f=i.oldData=[],c=0;c<s.length;c++){var d=s[c].getData();d.count()<F8&&(l.push(s[c]),u.push(s[c].get("dataGroupId")),f.push(d))}})}function U8(t,e,r){var n=qi.createCanvas(),i=e.getWidth(),a=e.getHeight(),o=n.style;return o&&(o.position="absolute",o.left="0",o.top="0",o.width=i+"px",o.height=a+"px",n.setAttribute("data-zr-dom-id",t)),n.width=i*r,n.height=a*r,n}var g_=function(t){he(e,t);function e(r,n,i){var a=t.call(this)||this;a.motionBlur=!1,a.lastFrameAlpha=.7,a.dpr=1,a.virtual=!1,a.config={},a.incremental=!1,a.zlevel=0,a.maxRepaintRectCount=5,a.__dirty=!0,a.__firstTimePaint=!0,a.__used=!1,a.__drawIndex=0,a.__startIndex=0,a.__endIndex=0,a.__prevStartIndex=null,a.__prevEndIndex=null;var o;i=i||Rh,typeof r=="string"?o=U8(r,n,i):Se(r)&&(o=r,r=o.id),a.id=r,a.dom=o;var s=o.style;return s&&(i2(o),o.onselectstart=function(){return!1},s.padding="0",s.margin="0",s.borderWidth="0"),a.painter=n,a.dpr=i,a}return e.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},e.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},e.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},e.prototype.setUnpainted=function(){this.__firstTimePaint=!0},e.prototype.createBackBuffer=function(){var r=this.dpr;this.domBack=U8("back-"+this.id,this.painter,r),this.ctxBack=this.domBack.getContext("2d"),r!==1&&this.ctxBack.scale(r,r)},e.prototype.createRepaintRects=function(r,n,i,a){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var o=[],s=this.maxRepaintRectCount,l=!1,u=new ke(0,0,0,0);function f(y){if(!(!y.isFinite()||y.isZero()))if(o.length===0){var b=new ke(0,0,0,0);b.copy(y),o.push(b)}else{for(var C=!1,_=1/0,w=0,x=0;x<o.length;++x){var S=o[x];if(S.intersect(y)){var E=new ke(0,0,0,0);E.copy(S),E.union(y),o[x]=E,C=!0;break}else if(l){u.copy(y),u.union(S);var T=y.width*y.height,A=S.width*S.height,M=u.width*u.height,O=M-T-A;O<_&&(_=O,w=x)}}if(l&&(o[w].union(y),C=!0),!C){var b=new ke(0,0,0,0);b.copy(y),o.push(b)}l||(l=o.length>=s)}}for(var c=this.__startIndex;c<this.__endIndex;++c){var d=r[c];if(d){var h=d.shouldBePainted(i,a,!0,!0),v=d.__isRendered&&(d.__dirty&vn||!h)?d.getPrevPaintRect():null;v&&f(v);var g=h&&(d.__dirty&vn||!d.__isRendered)?d.getPaintRect():null;g&&f(g)}}for(var c=this.__prevStartIndex;c<this.__prevEndIndex;++c){var d=n[c],h=d&&d.shouldBePainted(i,a,!0,!0);if(d&&(!h||!d.__zr)&&d.__isRendered){var v=d.getPrevPaintRect();v&&f(v)}}var p;do{p=!1;for(var c=0;c<o.length;){if(o[c].isZero()){o.splice(c,1);continue}for(var m=c+1;m<o.length;)o[c].intersect(o[m])?(p=!0,o[c].union(o[m]),o.splice(m,1)):m++;c++}}while(p);return this._paintRects=o,o},e.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},e.prototype.resize=function(r,n){var i=this.dpr,a=this.dom,o=a.style,s=this.domBack;o&&(o.width=r+"px",o.height=n+"px"),a.width=r*i,a.height=n*i,s&&(s.width=r*i,s.height=n*i,i!==1&&this.ctxBack.scale(i,i))},e.prototype.clear=function(r,n,i){var a=this.dom,o=this.ctx,s=a.width,l=a.height;n=n||this.clearColor;var u=this.motionBlur&&!r,f=this.lastFrameAlpha,c=this.dpr,d=this;u&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(a,0,0,s/c,l/c));var h=this.domBack;function v(g,p,m,y){if(o.clearRect(g,p,m,y),n&&n!=="transparent"){var b=void 0;if(uh(n)){var C=n.global||n.__width===m&&n.__height===y;b=C&&n.__canvasGradient||nC(o,n,{x:0,y:0,width:m,height:y}),n.__canvasGradient=b,n.__width=m,n.__height=y}else hZ(n)&&(n.scaleX=n.scaleX||c,n.scaleY=n.scaleY||c,b=iC(o,n,{dirty:function(){d.setUnpainted(),d.painter.refresh()}}));o.save(),o.fillStyle=b||n,o.fillRect(g,p,m,y),o.restore()}u&&(o.save(),o.globalAlpha=f,o.drawImage(h,g,p,m,y),o.restore())}!i||u?v(0,0,s,l):i.length&&H(i,function(g){v(g.x*c,g.y*c,g.width*c,g.height*c)})},e}(Si),Y8=1e5,Ms=314159,Rp=.01,Fue=.001;function kue(t){return t?t.__builtin__?!0:!(typeof t.resize!="function"||typeof t.refresh!="function"):!1}function jue(t,e){var r=document.createElement("div");return r.style.cssText=["position:relative","width:"+t+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",r}var zue=function(){function t(e,r,n,i){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var a=!e.nodeName||e.nodeName.toUpperCase()==="CANVAS";this._opts=n=ue({},n||{}),this.dpr=n.devicePixelRatio||Rh,this._singleCanvas=a,this.root=e;var o=e.style;o&&(i2(e),e.innerHTML=""),this.storage=r;var s=this._zlevelList;this._prevDisplayList=[];var l=this._layers;if(a){var f=e,c=f.width,d=f.height;n.width!=null&&(c=n.width),n.height!=null&&(d=n.height),this.dpr=n.devicePixelRatio||1,f.width=c*this.dpr,f.height=d*this.dpr,this._width=c,this._height=d;var h=new g_(f,this,this.dpr);h.__builtin__=!0,h.initContext(),l[Ms]=h,h.zlevel=Ms,s.push(Ms),this._domRoot=e}else{this._width=Qv(e,0,n),this._height=Qv(e,1,n);var u=this._domRoot=jue(this._width,this._height);e.appendChild(u)}}return t.prototype.getType=function(){return"canvas"},t.prototype.isSingleCanvas=function(){return this._singleCanvas},t.prototype.getViewportRoot=function(){return this._domRoot},t.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},t.prototype.refresh=function(e){var r=this.storage.getDisplayList(!0),n=this._prevDisplayList,i=this._zlevelList;this._redrawId=Math.random(),this._paintList(r,n,e,this._redrawId);for(var a=0;a<i.length;a++){var o=i[a],s=this._layers[o];if(!s.__builtin__&&s.refresh){var l=a===0?this._backgroundColor:null;s.refresh(l)}}return this._opts.useDirtyRect&&(this._prevDisplayList=r.slice()),this},t.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},t.prototype._paintHoverList=function(e){var r=e.length,n=this._hoverlayer;if(n&&n.clear(),!!r){for(var i={inHover:!0,viewWidth:this._width,viewHeight:this._height},a,o=0;o<r;o++){var s=e[o];s.__inHover&&(n||(n=this._hoverlayer=this.getLayer(Y8)),a||(a=n.ctx,a.save()),Ds(a,s,i,o===r-1))}a&&a.restore()}},t.prototype.getHoverLayer=function(){return this.getLayer(Y8)},t.prototype.paintOne=function(e,r){oI(e,r)},t.prototype._paintList=function(e,r,n,i){if(this._redrawId===i){n=n||!1,this._updateLayerStatus(e);var a=this._doPaintList(e,r,n),o=a.finished,s=a.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),s&&this._paintHoverList(e),o)this.eachLayer(function(u){u.afterBrush&&u.afterBrush()});else{var l=this;Gv(function(){l._paintList(e,r,n,i)})}}},t.prototype._compositeManually=function(){var e=this.getLayer(Ms).ctx,r=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,r,n),this.eachBuiltinLayer(function(i){i.virtual&&e.drawImage(i.dom,0,0,r,n)})},t.prototype._doPaintList=function(e,r,n){for(var i=this,a=[],o=this._opts.useDirtyRect,s=0;s<this._zlevelList.length;s++){var l=this._zlevelList[s],u=this._layers[l];u.__builtin__&&u!==this._hoverlayer&&(u.__dirty||n)&&a.push(u)}for(var f=!0,c=!1,d=function(g){var p=a[g],m=p.ctx,y=o&&p.createRepaintRects(e,r,h._width,h._height),b=n?p.__startIndex:p.__drawIndex,C=!n&&p.incremental&&Date.now,_=C&&Date.now(),w=p.zlevel===h._zlevelList[0]?h._backgroundColor:null;if(p.__startIndex===p.__endIndex)p.clear(!1,w,y);else if(b===p.__startIndex){var x=e[b];(!x.incremental||!x.notClear||n)&&p.clear(!1,w,y)}b===-1&&(console.error("For some unknown reason. drawIndex is -1"),b=p.__startIndex);var S,E=function(O){var P={inHover:!1,allClipped:!1,prevEl:null,viewWidth:i._width,viewHeight:i._height};for(S=b;S<p.__endIndex;S++){var N=e[S];if(N.__inHover&&(c=!0),i._doPaintEl(N,p,o,O,P,S===p.__endIndex-1),C){var F=Date.now()-_;if(F>15)break}}P.prevElClipPaths&&m.restore()};if(y)if(y.length===0)S=p.__endIndex;else for(var T=h.dpr,A=0;A<y.length;++A){var M=y[A];m.save(),m.beginPath(),m.rect(M.x*T,M.y*T,M.width*T,M.height*T),m.clip(),E(M),m.restore()}else m.save(),E(),m.restore();p.__drawIndex=S,p.__drawIndex<p.__endIndex&&(f=!1)},h=this,v=0;v<a.length;v++)d(v);return Fe.wxa&&H(this._layers,function(g){g&&g.ctx&&g.ctx.draw&&g.ctx.draw()}),{finished:f,needsRefreshHover:c}},t.prototype._doPaintEl=function(e,r,n,i,a,o){var s=r.ctx;if(n){var l=e.getPaintRect();(!i||l&&l.intersect(i))&&(Ds(s,e,a,o),e.setPrevPaintRect(l))}else Ds(s,e,a,o)},t.prototype.getLayer=function(e,r){this._singleCanvas&&!this._needsManuallyCompositing&&(e=Ms);var n=this._layers[e];return n||(n=new g_("zr_"+e,this,this.dpr),n.zlevel=e,n.__builtin__=!0,this._layerConfig[e]?dt(n,this._layerConfig[e],!0):this._layerConfig[e-Rp]&&dt(n,this._layerConfig[e-Rp],!0),r&&(n.virtual=r),this.insertLayer(e,n),n.initContext()),n},t.prototype.insertLayer=function(e,r){var n=this._layers,i=this._zlevelList,a=i.length,o=this._domRoot,s=null,l=-1;if(n[e]){process.env.NODE_ENV!=="production"&&Ho("ZLevel "+e+" has been used already");return}if(!kue(r)){process.env.NODE_ENV!=="production"&&Ho("Layer of zlevel "+e+" is not valid");return}if(a>0&&e>i[0]){for(l=0;l<a-1&&!(i[l]<e&&i[l+1]>e);l++);s=n[i[l]]}if(i.splice(l+1,0,e),n[e]=r,!r.virtual)if(s){var u=s.dom;u.nextSibling?o.insertBefore(r.dom,u.nextSibling):o.appendChild(r.dom)}else o.firstChild?o.insertBefore(r.dom,o.firstChild):o.appendChild(r.dom);r.painter||(r.painter=this)},t.prototype.eachLayer=function(e,r){for(var n=this._zlevelList,i=0;i<n.length;i++){var a=n[i];e.call(r,this._layers[a],a)}},t.prototype.eachBuiltinLayer=function(e,r){for(var n=this._zlevelList,i=0;i<n.length;i++){var a=n[i],o=this._layers[a];o.__builtin__&&e.call(r,o,a)}},t.prototype.eachOtherLayer=function(e,r){for(var n=this._zlevelList,i=0;i<n.length;i++){var a=n[i],o=this._layers[a];o.__builtin__||e.call(r,o,a)}},t.prototype.getLayers=function(){return this._layers},t.prototype._updateLayerStatus=function(e){this.eachBuiltinLayer(function(c,d){c.__dirty=c.__used=!1});function r(c){a&&(a.__endIndex!==c&&(a.__dirty=!0),a.__endIndex=c)}if(this._singleCanvas)for(var n=1;n<e.length;n++){var i=e[n];if(i.zlevel!==e[n-1].zlevel||i.incremental){this._needsManuallyCompositing=!0;break}}var a=null,o=0,s,l;for(l=0;l<e.length;l++){var i=e[l],u=i.zlevel,f=void 0;s!==u&&(s=u,o=0),i.incremental?(f=this.getLayer(u+Fue,this._needsManuallyCompositing),f.incremental=!0,o=1):f=this.getLayer(u+(o>0?Rp:0),this._needsManuallyCompositing),f.__builtin__||Ho("ZLevel "+u+" has been used by unkown layer "+f.id),f!==a&&(f.__used=!0,f.__startIndex!==l&&(f.__dirty=!0),f.__startIndex=l,f.incremental?f.__drawIndex=-1:f.__drawIndex=l,r(l),a=f),i.__dirty&vn&&!i.__inHover&&(f.__dirty=!0,f.incremental&&f.__drawIndex<0&&(f.__drawIndex=l))}r(l),this.eachBuiltinLayer(function(c,d){!c.__used&&c.getElementCount()>0&&(c.__dirty=!0,c.__startIndex=c.__endIndex=c.__drawIndex=0),c.__dirty&&c.__drawIndex<0&&(c.__drawIndex=c.__startIndex)})},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(e){e.clear()},t.prototype.setBackgroundColor=function(e){this._backgroundColor=e,H(this._layers,function(r){r.setUnpainted()})},t.prototype.configLayer=function(e,r){if(r){var n=this._layerConfig;n[e]?dt(n[e],r,!0):n[e]=r;for(var i=0;i<this._zlevelList.length;i++){var a=this._zlevelList[i];if(a===e||a===e+Rp){var o=this._layers[a];dt(o,n[e],!0)}}}},t.prototype.delLayer=function(e){var r=this._layers,n=this._zlevelList,i=r[e];i&&(i.dom.parentNode.removeChild(i.dom),delete r[e],n.splice(Qe(n,e),1))},t.prototype.resize=function(e,r){if(this._domRoot.style){var n=this._domRoot;n.style.display="none";var i=this._opts,a=this.root;if(e!=null&&(i.width=e),r!=null&&(i.height=r),e=Qv(a,0,i),r=Qv(a,1,i),n.style.display="",this._width!==e||r!==this._height){n.style.width=e+"px",n.style.height=r+"px";for(var o in this._layers)this._layers.hasOwnProperty(o)&&this._layers[o].resize(e,r);this.refresh(!0)}this._width=e,this._height=r}else{if(e==null||r==null)return;this._width=e,this._height=r,this.getLayer(Ms).resize(e,r)}return this},t.prototype.clearLayer=function(e){var r=this._layers[e];r&&r.clear()},t.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},t.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[Ms].dom;var r=new g_("image",this,e.pixelRatio||this.dpr);r.initContext(),r.clear(!1,e.backgroundColor||this._backgroundColor);var n=r.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var i=r.dom.width,a=r.dom.height;this.eachLayer(function(c){c.__builtin__?n.drawImage(c.dom,0,0,i,a):c.renderToCanvas&&(n.save(),c.renderToCanvas(n),n.restore())})}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},s=this.storage.getDisplayList(!0),l=0,u=s.length;l<u;l++){var f=s[l];Ds(n,f,o,l===u-1)}return r.dom},t.prototype.getWidth=function(){return this._width},t.prototype.getHeight=function(){return this._height},t}();function Hue(t){t.registerPainter("canvas",zue)}Qa([ule,Vle,Ple,Ole,ele,iue,tue,Zre,Tre,wne,uue,Lue,Hue]);const Vue=I.memo(({options:t,echartRef:e})=>{const r=I.useRef(null),n=I.useRef(null);return I.useEffect(()=>(r.current&&(n.current=Eae(r.current),window.__chartInstanceRef=n),()=>{n.current&&n.current.dispose()}),[]),I.useEffect(()=>{n.current&&(n.current.clear(),t&&Object.keys(t).length>0&&n.current.setOption({...t}))},[t]),I.useImperativeHandle(e,()=>({resize:()=>{n.current&&n.current.resize()},getWidth:()=>{n.current&&n.current.getWidth()}})),D.jsx("div",{ref:r,style:{width:"100%",height:"100%"}})}),Wue=()=>D.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:139,height:118,fill:"none",children:[D.jsx("path",{fill:"#F4F4F5",d:"M124.987 58.727c0 13.227-4.202 25.657-11.204 35.463-3.879 5.36-8.511 10.035-13.898 13.684-8.618 6.044-19.068 9.465-30.164 9.465-30.488.114-55.266-26.113-55.266-58.612C14.455 26.34 39.125 0 69.721 0c11.096 0 21.438 3.421 30.164 9.465 5.387 3.649 10.019 8.324 13.898 13.683 7.002 9.921 11.204 22.237 11.204 35.579Z"}),D.jsx("path",{stroke:"#D0D0D4",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,strokeWidth:2,d:"M2 102.569h130.77"}),D.jsx("path",{fill:"#fff",stroke:"#D0D0D4",strokeMiterlimit:10,strokeWidth:2,d:"M93.85 50.054v52.515H23.22c-2.786 0-4.875-2.36-4.875-5.163V50.054H93.85Z"}),D.jsx("path",{fill:"#DAE1ED",d:"M121.874 50.054v47.352c0 2.95-2.323 5.163-5.082 5.163h-22.94V50.054h28.022Z"}),D.jsx("path",{fill:"#F4F4F5",stroke:"#D0D0D4",strokeMiterlimit:10,strokeWidth:2,d:"M121.874 50.054v47.352c0 2.95-2.323 5.163-5.082 5.163h-22.94V50.054h28.022Z"}),D.jsx("path",{fill:"#C5CDDB",d:"m45.59 50.054 14.852-24.617h76.22L121.39 50.055h-75.8Z"}),D.jsx("path",{fill:"#F4F4F5",stroke:"#D0D0D4",strokeMiterlimit:10,strokeWidth:2,d:"m45.59 50.054 14.852-24.617h76.22L121.39 50.055h-75.8Z"}),D.jsx("path",{fill:"url(#a)",d:"M121.874 50.197v27.756h-20.433c-1.898 0-3.211-1.295-3.503-3.164l-4.086-24.735 28.022.143Z",opacity:.3}),D.jsx("path",{fill:"#fff",stroke:"#D0D0D4",strokeMiterlimit:10,strokeWidth:2,d:"M121.287 50.054H93.852l13.93 22.258c.995 1.474 2.559 2.358 4.123 2.358h21.322c1.422 0 2.417-1.769 1.564-2.948l-13.504-21.668ZM93.85 50.054 78.895 25.437H2l15.52 24.617h76.33Z"}),D.jsx("path",{fill:"#D0D0D4",d:"M56.028 80.415H26.59a1.23 1.23 0 0 1-1.238-1.231c0-.684.55-1.23 1.238-1.23h29.438a1.23 1.23 0 0 1 1.238 1.23c-.138.684-.55 1.23-1.238 1.23ZM56.028 86.159H26.59c-.688 0-1.238-.365-1.238-.82 0-.457.55-.821 1.238-.821h29.438c.687 0 1.238.364 1.238.82-.138.456-.55.82-1.238.82ZM40.44 92.723H26.61c-.699 0-1.257-.365-1.257-.82 0-.456.558-.821 1.257-.821H40.44c.699 0 1.258.365 1.258.82-.14.456-.699.821-1.258.821Z"}),D.jsx("defs",{children:D.jsxs("linearGradient",{id:"a",x1:107.869,x2:107.869,y1:78.525,y2:53.113,gradientUnits:"userSpaceOnUse",children:[D.jsx("stop",{offset:.003,stopColor:"#606673",stopOpacity:0}),D.jsx("stop",{offset:1,stopColor:"#AAB2C5"})]})})]}),q8=t=>{const{t:e}=At();return D.jsxs("div",{style:{color:"#A1A1AA",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[D.jsx(Wue,{}),D.jsx("span",{children:e("empty")})]})};q8.displayName="Empty";const $ue=t=>{const{type:e,categories:r}=t;return{"chart-bar":{xAxis:{type:"category",data:r},yAxis:{type:"value"}},"chart-bar-pile":{xAxis:{type:"category",data:r},yAxis:{type:"value"}},"chart-bar-percentage":{xAxis:{type:"category",data:r},yAxis:{type:"value",max:100,axisLabel:{formatter:"{value} %"}}},"chart-line":{xAxis:{type:"category",data:r},yAxis:{type:"value"}},"chart-line-smooth":{xAxis:{type:"category",data:r},yAxis:{type:"value"}},"chart-pie":{xAxis:{show:!1},yAxis:{show:!1}},"chart-pie-circular":{xAxis:{show:!1},yAxis:{show:!1}},"chart-strip-bar":{xAxis:{type:"value"},yAxis:{type:"category",data:r}},"chart-strip-bar-pile":{xAxis:{type:"value"},yAxis:{type:"category",data:r}},"chart-strip-bar-percentage":{xAxis:{type:"value",max:100,axisLabel:{formatter:"{value} %"}},yAxis:{type:"category",data:r}},[Lr.chartCombination]:{xAxis:{type:"category",data:r},yAxis:{type:"value"}}}[e]},X8=({type:t,data:e,label:r,name:n,isGroup:i,groupField:a,labels:o})=>{let s;return t==="chart-pie"?s={data:e.map((l,u)=>({value:l,name:o[u]})),name:n,type:"pie",radius:"50%",label:{...r,position:"outside"},labelLine:{normal:{show:!0}}}:t==="chart-pie-circular"?s={data:e.map((l,u)=>({value:l,name:o[u]})),type:"pie",name:n,radius:["40%","70%"],label:{...r,position:"outside"},labelLine:{normal:{show:!0}}}:t==="chart-line"?s={data:e,name:n,type:"line",label:r}:t==="chart-line-smooth"?s={data:e,name:n,type:"line",smooth:!0,label:r}:s={data:e,name:n,type:"bar",label:r},(t==="chart-bar-percentage"||t==="chart-bar-pile"||t==="chart-strip-bar-pile"||t==="chart-strip-bar-percentage")&&i&&a&&(s.stack=a),s},Gue=({customeStyle:t,series:e,chartConfig:r,width:n})=>{var C,_,w,x;const{isLeftAxisShow:i,isRightAxisShow:a,maxLeftSeriesDataStrLen:o,maxRightSeriesDataStrLen:s,maxSeriesDataLen:l}=e.reduce((S,E)=>{var O;let T={...S},A=E.yAxisIndex==0?"left":"right",M=Math.max(...E.data.map(P=>String(P).length));return A=="left"?(T.maxLeftSeriesDataStrLen=Math.max(T.maxLeftSeriesDataStrLen,M),T.isLeftAxisShow=!0):(T.maxRightSeriesDataStrLen=Math.max(T.maxRightSeriesDataStrLen,M),T.isRightAxisShow=!0),T.maxSeriesDataLen=Math.max(T.maxSeriesDataLen,(O=E==null?void 0:E.data)==null?void 0:O.length),T},{isLeftAxisShow:!1,isRightAxisShow:!1,maxLeftSeriesDataStrLen:0,maxRightSeriesDataStrLen:0,maxSeriesDataLen:0});let u=((C=r==null?void 0:r.xAxis)==null?void 0:C.type)==="category"?"xAxis":"yAxis";const c=(x=(u==="xAxis"?(_=r==null?void 0:r.xAxis)==null?void 0:_.data:(w=r==null?void 0:r.yAxis)==null?void 0:w.data)??[])==null?void 0:x.reduce((S,E)=>{const T=String(E).length;return Math.max(S,T)},0),d=9,h=12;let v=45,g=0,p=0,m=0,y=0;if(u=="xAxis"){const S={45:d*.8,90:d,0:d};l>3&&(c>=15&&(y=90),c>5&&(y=45),n<3&&(y=90)),m=S[`${y}`]*(y==0?1:Math.min(c,18))+h,g=Math.min(o,18)*d+h,p=Math.min(s,18)*d+h}else m=Math.min(o,18)*d+h,g=Math.min(c,18)*d+h,p=h;g=Math.max(g,40),p=Math.max(p,40),i||(g=h),a||(p=h);let b=d;return t!=null&&t.xtitle&&(u=="xAxis"?m=m+b:p=p+b),t!=null&&t.ytitle&&(u=="xAxis"?g=g+b:v=v+b),{top:v+"px",left:g+"px",right:p+"px",bottom:Math.max(m,40)+"px",axisLabelRotate:y}},Uue=({moduleDataApi:t,customData:e,customeStyle:r,width:n=2,height:i=2})=>{const{globalData:a,globalFilterCondition:o}=dn();let s=I.useMemo(()=>o==null?void 0:o.find(w=>(w==null?void 0:w.dataSourceId)===(e==null?void 0:e.dataSourceId)),[o,e==null?void 0:e.dataSourceId]);const[l,u]=I.useState(),[f,c]=I.useState(),d=Tt(async()=>{var _,w,x;if(u([]),e){c(!0);let S="";const E=(e==null?void 0:e.xAxis)==="tags"?"tag":e==null?void 0:e.xAxis,T=(e==null?void 0:e.groupField)==="tags"?"tag":e==null?void 0:e.groupField;e.isGroup?(e.yAxis==="recordTotal"&&(S+=`select=${E},${T},id.count()`),e.yAxis==="fieldValue"&&(e!=null&&e.yAxisField)&&(S+=`select=${E},${T},${e==null?void 0:e.yAxisField}.${e==null?void 0:e.yAxisFieldType}()`)):(e.yAxis==="recordTotal"&&(S+=`select=${E},id.count()`),e.yAxis==="fieldValue"&&(e!=null&&e.yAxisField)&&(S+=`select=${E},${e==null?void 0:e.yAxisField}.${e==null?void 0:e.yAxisFieldType}()`));let A=[];if((((_=s==null?void 0:s.conditionList)==null?void 0:_.length)??0)>0&&A.push(s),(((x=(w=e==null?void 0:e.conditionData)==null?void 0:w.conditionList)==null?void 0:x.length)??0)>0&&A.push(e==null?void 0:e.conditionData),A.length>0){let M=Qd(A);S+=M?`&${M}`:""}e!=null&&e.dataSourceId&&(t==null||t({id:e==null?void 0:e.dataSourceId,query:S}).then(M=>{if(!M.success){Z.message.error(M.message);return}u(M.data)}).finally(()=>{c(!1)}))}else u([])});_9(()=>{e&&d()},[e==null?void 0:e.dataSourceId,e==null?void 0:e.conditionData,e==null?void 0:e.sortField,e==null?void 0:e.sortOrder,e==null?void 0:e.xAxis,e==null?void 0:e.yAxis,e==null?void 0:e.yAxisField,e==null?void 0:e.yAxisFieldType,e==null?void 0:e.isGroup,e==null?void 0:e.groupField,s],{wait:60});const h=I.useMemo(()=>{var w,x;return(x=(w=a==null?void 0:a.sourceData)==null?void 0:w.find(S=>S.value===(e==null?void 0:e.dataSourceId)))==null?void 0:x.fields},[a,e==null?void 0:e.dataSourceId]),v=I.useMemo(()=>e&&l&&e.type&&l.length>0?(w=>{var De,Oe,lt,qt,Ue,St,Rr,at,yt,Pr,lr,Br,_n,Cr;const x=({item:de,field:Be,timeGroupInterval:$e})=>nf({fieldOptions:h,val:de[Be],field:Be,fieldMap:a==null?void 0:a.fieldMap,timeGroupInterval:$e}),S=de=>{const Be=h==null?void 0:h.find($e=>$e.value===de);return Be==null?void 0:Be.label},E=de=>{var Be;return((Be=h==null?void 0:h.find($e=>$e.value===de))==null?void 0:Be.type)==="timestamp"},T={tags:"tag"},A=T[e==null?void 0:e.xAxis]??(e==null?void 0:e.xAxis),M=T[e==null?void 0:e.groupField]??(e==null?void 0:e.groupField);console.log("newGroupField",M);let O=HW(w,de=>x({item:de,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval})),P=Object.keys(O).map(de=>O[de].reduce((tt,Rt)=>(Object.keys(Rt).forEach(_r=>{let ii=Rt[_r];US(ii)?tt[_r]=tt!=null&&tt[_r]?tt[_r]+ii:ii:tt[_r]=ii}),tt),{}));const N=new Set,F=new Set,L={},j={};P.forEach(de=>{const Be=x({item:de,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval}),$e=e.yAxis==="recordTotal"?de==null?void 0:de.count:de[e==null?void 0:e.yAxisFieldType]||0,tt=Be??U0("unknown");j[tt]=$e}),e!=null&&e.isGroup&&(e!=null&&e.groupField)&&w.forEach(de=>{const Be=x({item:de,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval}),$e=e.yAxis==="recordTotal"?de==null?void 0:de.count:de[e==null?void 0:e.yAxisFieldType]||0,tt=x({item:de,field:M}),Rt=Be??U0("unknown");F.add(tt),L[tt]||(L[tt]={}),L[tt][Rt]=$e}),console.log("test",{groupData:O,categories:N,stackCategories:F,valueGroups:L,valueCounts:j});const W={},B={};if(e!=null&&e.isGroup&&(e!=null&&e.groupField)){const de={};Object.keys(L).forEach(Be=>{Object.entries(L[Be]).forEach(([$e,tt])=>{de[$e]=(de[$e]||0)+tt})}),Object.keys(L).forEach(Be=>{B[Be]={},Object.entries(L[Be]).forEach(([$e,tt])=>{const Rt=de[$e]||1;B[Be][$e]=tt/Rt*100})})}else Object.entries(j).forEach(([de,Be])=>{const $e=Be||1;W[de]=Be/$e*100});let z=(e==null?void 0:e.sortField)??"xAxis",Y=(e==null?void 0:e.sortOrder)??"asc";const ee=[...P].sort((de,Be)=>{let $e,tt;switch(z){case"xAxis":$e=x({item:de,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval}),tt=x({item:Be,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval});break;case"yAxisField":$e=e.yAxis==="recordTotal"?de==null?void 0:de.count:de[e==null?void 0:e.yAxisFieldType]||0,tt=e.yAxis==="recordTotal"?Be==null?void 0:Be.count:Be[e==null?void 0:e.yAxisFieldType]||0;break}const Rt=Y==="asc"?1:-1;return $e>tt?1*Rt:$e<tt?-1*Rt:0}).map(de=>x({item:de,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval}));if(N.clear(),ee.forEach(de=>N.add(de)),!E(e==null?void 0:e.xAxis)&&e.displayRange!=="ALL"&&e.displayRange){let de=Array.from(N).sort((Rt,_r)=>j[_r]-j[Rt]),Be=[],[$e,tt]=e.displayRange.split("_");$e==="TOP"?Be=de.slice(0,Number(tt)):Be=de.slice(-Number(tt)),Array.from(N).forEach(Rt=>(Be.includes(Rt)||N.delete(Rt),Rt))}const te=de=>e!=null&&e.isGroup&&(e!=null&&e.groupField)?(de==null?void 0:de.value)==0?"":`${de==null?void 0:de.value}`:`${de==null?void 0:de.value}`,V={show:(De=e==null?void 0:e.chartOptions)==null?void 0:De.includes("label"),position:"top",formatter:te},J=Array.from(N),G=Array.from(F),k=[],Q=$ue({type:e==null?void 0:e.type,categories:J}),K=de=>US(de)?Math.floor(de*100)/100:de;if(e!=null&&e.isGroup&&(e!=null&&e.groupField))G.forEach(de=>{var _r,ii;const Be=["chart-bar-percentage","chart-strip-bar-percentage"].includes(e.type)?J.map(Ir=>K(B[de][Ir]||0)):J.map(Ir=>K(L[de][Ir]||0));let $e=e.type,tt="left";if($e==Lr.chartCombination){let Ir=((e==null?void 0:e.groupFieldConfig)??[]).find(ho=>x({item:{[M]:ho==null?void 0:ho.value},field:M})==de);$e=((_r=Ir==null?void 0:Ir.config)==null?void 0:_r.chartType)??Lr.ChartBar,tt=((ii=Ir==null?void 0:Ir.config)==null?void 0:ii.yAxisPos)??"left"}let Rt=X8({type:$e,data:Be,label:V,name:de,isGroup:e==null?void 0:e.isGroup,groupField:e==null?void 0:e.groupField,labels:J});Rt.yAxisIndex=tt=="left"?0:1,k.push(Rt)});else{const de=["chart-bar-percentage","chart-strip-bar-percentage"].includes(e.type)?J.map(Rt=>{var _r;return K(((_r=W[Rt])==null?void 0:_r.toFixed(2))||0)}):J.map(Rt=>K(j[Rt]||0));let Be=e.type,$e="left";Be==Lr.chartCombination?Be=((Oe=e==null?void 0:e.yAxisFieldConfig)==null?void 0:Oe.chartType)??Lr.ChartBar:$e=((lt=e==null?void 0:e.yAxisFieldConfig)==null?void 0:lt.yAxisPos)??"left";let tt=X8({type:Be,data:de,label:V,name:e.yAxis==="recordTotal"?U0("pb.statisticsText"):S(e==null?void 0:e.yAxisField),isGroup:e==null?void 0:e.isGroup,groupField:e==null?void 0:e.groupField,labels:J});tt.yAxisIndex=$e=="left"?0:1,k.push(tt)}console.log("series",k,e);const q=Gue({series:k,chartConfig:Q,width:n,customeStyle:r}),fe=(qt=e==null?void 0:e.chartOptions)==null?void 0:qt.includes("legend"),se=k.some(de=>(de==null?void 0:de.yAxisIndex)==0),xe=k.some(de=>(de==null?void 0:de.yAxisIndex)==1),ye={...Q.yAxis,axisTick:{show:(Ue=e==null?void 0:e.chartOptions)==null?void 0:Ue.includes("axis")},axisLine:{show:(St=e==null?void 0:e.chartOptions)==null?void 0:St.includes("axis")},axisLabel:{show:(Rr=e==null?void 0:e.chartOptions)==null?void 0:Rr.includes("label"),formatter:de=>de.length>15?`${de.slice(0,15)}...`:de,hideOverlap:!0,...(at=Q.yAxis)==null?void 0:at.axisLabel},splitLine:{show:(yt=e==null?void 0:e.chartOptions)==null?void 0:yt.includes("splitLine")}};return{legend:{type:"scroll",left:"center",right:"center",top:"0",show:fe,itemWidth:12,itemHeight:12,data:(k==null?void 0:k.map(de=>(de==null?void 0:de.name)||""))||[]},grid:q,graphic:{elements:[{type:"text",left:"center",bottom:"10px",style:{text:(r==null?void 0:r.xtitle)||"",fill:"#333",fontSize:12,fontWeight:"bold"}},{type:"text",left:"10px",top:"center",style:{text:(r==null?void 0:r.ytitle)||"",fill:"#333",fontSize:12,fontWeight:"bold"},rotation:Math.PI/2}]},xAxis:{...Q.xAxis,axisTick:{show:(Pr=e==null?void 0:e.chartOptions)==null?void 0:Pr.includes("axis")},axisLine:{show:(lr=e==null?void 0:e.chartOptions)==null?void 0:lr.includes("axis")},axisLabel:{show:(Br=e==null?void 0:e.chartOptions)==null?void 0:Br.includes("label"),rotate:q.axisLabelRotate,interval:"auto",formatter:de=>de.length>15?`${de.slice(0,15)}...`:de,...((_n=Q.xAxis)==null?void 0:_n.axisLabel)??{}},splitLine:{show:(Cr=e==null?void 0:e.chartOptions)==null?void 0:Cr.includes("splitLine")}},yAxis:[{show:se,...ye},{show:xe,...ye}],series:k,tooltip:{trigger:"item",axisPointer:{type:"shadow"},extraCssText:"max-width:30vw; white-space:pre-wrap; word-break:break-all",appendTo:"body"}}})(l):null,[e==null?void 0:e.sortField,e==null?void 0:e.sortOrder,e==null?void 0:e.type,e==null?void 0:e.chartOptions,e==null?void 0:e.timeGroupInterval,e==null?void 0:e.groupFieldConfig,e==null?void 0:e.yAxisFieldConfig,e==null?void 0:e.displayRange,r,l,n,i,h]),g=I.useRef(),p=I.useRef(null),m=Em(p);I.useEffect(()=>{var _;m&&((_=g==null?void 0:g.current)==null||_.resize())},[m]);const y=f,b=!f&&!v,C=!y&&!!v;return D.jsxs("div",{style:{width:"100%",height:"100%"},ref:p,children:[y&&D.jsx(Z.Spin,{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},spinning:f}),b&&D.jsx(q8,{}),C&&D.jsx(Vue,{echartRef:g,options:v??{}})]})},Z8=I.memo(Uue),Pp={"combination-chart-option":"_combination-chart-option_1cwba_1","group-field-config-picker":"_group-field-config-picker_1cwba_11","group-field-config-picker__title":"_group-field-config-picker__title_1cwba_14","group-field-config-picker__item":"_group-field-config-picker__item_1cwba_18","group-field-config-picker__input":"_group-field-config-picker__input_1cwba_23"},K8="combination-chart-option",fu={chartType:Lr.ChartBar,yAxisPos:"left"},Q8=t=>{const{style:e,className:r,initTriggerChange:n=!1}=t,{t:i}=At(),[a,o]=Ao(t),s=[{label:i("chart.t2"),key:Lr.ChartBar,icon:D.jsx($w,{})},{label:i("chart.t8"),key:Lr.ChartLine,icon:D.jsx(Jw,{})}],l=[{label:i("chart.left"),key:"left",icon:D.jsx(Uw,{})},{label:i("chart.right"),key:"right",icon:D.jsx(Yw,{})}],u=(a==null?void 0:a.chartType)??(fu==null?void 0:fu.chartType),f=(a==null?void 0:a.yAxisPos)??(fu==null?void 0:fu.yAxisPos),c=I.useMemo(()=>s.find(h=>h.key===u),[u,s]),d=I.useMemo(()=>l.find(h=>h.key===f),[f,l]);return D.jsxs("div",{className:fn(Pp[`${K8}`],K8),style:e,children:[D.jsx(Z.Dropdown,{trigger:["click"],placement:"bottom",menu:{items:s.map(h=>({...h,onClick:()=>{o({chartType:h.key,yAxisPos:f})}}))},children:D.jsx(Z.Tooltip,{title:c==null?void 0:c.label,children:D.jsx(Z.Button,{size:"small",type:"text",children:c==null?void 0:c.icon})})}),D.jsx(Z.Divider,{type:"vertical",style:{margin:"0 2px"}}),D.jsx(Z.Dropdown,{trigger:["click"],placement:"bottom",menu:{items:l.map(h=>({...h,onClick:()=>{o({chartType:u,yAxisPos:h.key})}}))},children:D.jsx(Z.Tooltip,{title:d==null?void 0:d.label,children:D.jsx(Z.Button,{size:"small",type:"text",children:d==null?void 0:d.icon})})})]})};Q8.displayName="CombinationChartOptionPicker";const m_="group-field-config-picker",J8=[],eN=t=>{const{style:e,className:r,options:n=J8}=t,[i=J8,a]=Ao(t),o=Tt(l=>{let u=(i??[]).find(f=>f.value===l);return u?u.config:void 0}),s=Tt((l,u)=>{let f=[...i??[]],c=f.find(d=>d.value===l);c?c.config=u:f.push({value:l,config:u}),a(f)});return I.useEffect(()=>{if((n==null?void 0:n.length)>0){let l=n.map(u=>({value:u,config:{chartType:Lr.ChartBar,yAxisPos:"left",...o(u)??{}}}));a(l)}},[n]),I.useMemo(()=>D.jsx("div",{className:fn(r,Pp[`${m_}`]),style:e,children:D.jsx("div",{children:((t==null?void 0:t.options)??[]).map(l=>{let u=`${l}`;const f=o(l);return D.jsxs("div",{className:fn(Pp[`${m_}__item`]),children:[D.jsx(Z.Tooltip,{title:u,children:D.jsx("div",{className:fn(Pp[`${m_}__input`]),children:D.jsx(pi,{value:u,disabled:!0,style:{width:200,pointerEvents:"none"}})})}),D.jsx(Q8,{value:f,onChange:c=>{s(l,c)}})]},u)})})}),[i,n])};eN.displayName="GroupFieldConfigPicker";const Yue=()=>D.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[D.jsx("rect",{x:"17",y:"8",width:"6",height:"15.5",rx:"0.5",fill:"#959bee"}),D.jsx("rect",{x:"17",y:"24.5",width:"6",height:"15.5",rx:"0.5",fill:"#5b65f5"}),D.jsx("rect",{x:"28",y:"8",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),D.jsx("rect",{x:"28",y:"18",width:"6",height:"22",rx:"0.5",fill:"#5b65f5"}),D.jsx("rect",{x:"39",y:"8",width:"6",height:"19",rx:"0.5",fill:"#959bee"}),D.jsx("rect",{x:"39",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"}),D.jsx("rect",{x:"50",y:"8",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),D.jsx("rect",{x:"50",y:"18",width:"6",height:"22",rx:"0.5",fill:"#5b65f5"})]}),que=()=>D.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[D.jsx("rect",{x:"17",y:"21",width:"6",height:"6",rx:"0.5",fill:"#959bee"}),D.jsx("rect",{x:"17",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"}),D.jsx("rect",{x:"28",y:"24",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),D.jsx("rect",{x:"28",y:"34",width:"6",height:"6",rx:"0.5",fill:"#5b65f5"}),D.jsx("rect",{x:"39",y:"8",width:"6",height:"19",rx:"0.5",fill:"#959bee"}),D.jsx("rect",{x:"39",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"}),D.jsx("rect",{x:"50",y:"18",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),D.jsx("rect",{x:"50",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"})]}),Xue=()=>D.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[D.jsx("path",{d:"M15.5 33.5C20.2023 32.3804 23.5007 28.5533 25.7095 24.6682C28.3082 20.0974 34.0857 17.3668 38.758 19.7783L39.8066 20.3195C42.9001 21.9162 46.671 21.329 49.1326 18.8674L58 10",stroke:"#959bee",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),D.jsx("path",{d:"M16.5 15L26.844 27.6427C28.7759 30.0039 31.8825 31.0607 34.8535 30.3675L42.3359 28.6216C44.0629 28.2187 45.8748 28.401 47.4869 29.1398L57 33.5",stroke:"#5b65f4",strokeWidth:"1.5",strokeLinecap:"round"})]}),Zue=()=>D.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[D.jsx("path",{d:"M20 24C20 32.8366 27.1634 40 36 40C44.8366 40 52 32.8366 52 24C52 15.1634 44.8366 8 36 8C27.1634 8 20 15.1634 20 24ZM46.3944 24C46.3944 29.7407 41.7407 34.3944 36 34.3944C30.2593 34.3944 25.6056 29.7407 25.6056 24C25.6056 18.2593 30.2593 13.6056 36 13.6056C41.7407 13.6056 46.3944 18.2593 46.3944 24Z",fill:"#5b65f4"}),D.jsx("path",{d:"M52 24C52 19.7565 50.3143 15.6869 47.3137 12.6863C44.3131 9.68571 40.2435 8 36 8V13.6056C38.7568 13.6056 41.4006 14.7007 43.35 16.65C45.2993 18.5994 46.3944 21.2432 46.3944 24H52Z",fill:"#959bee"}),D.jsx("path",{d:"M52 24C52 20.9896 51.1507 18.0403 49.5497 15.4909L44.8026 18.4721C45.8427 20.1283 46.3944 22.0443 46.3944 24H52Z",fill:"#cdcff9"})]}),Kue=()=>D.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[D.jsx("rect",{x:"58",y:"11",width:"4",height:"15",rx:"0.5",transform:"rotate(90 58 11)",fill:"#959bee"}),D.jsx("rect",{x:"42",y:"11",width:"4",height:"28",rx:"0.5",transform:"rotate(90 42 11)",fill:"#5b65f5"}),D.jsx("rect",{x:"58",y:"18",width:"4",height:"21.5",rx:"0.5",transform:"rotate(90 58 18)",fill:"#959bee"}),D.jsx("rect",{x:"35.5",y:"18",width:"4",height:"21.5",rx:"0.5",transform:"rotate(90 35.5 18)",fill:"#5b65f5"}),D.jsx("rect",{x:"58",y:"25",width:"4",height:"34",rx:"0.5",transform:"rotate(90 58 25)",fill:"#959bee"}),D.jsx("rect",{x:"23",y:"25",width:"4",height:"9",rx:"0.5",transform:"rotate(90 23 25)",fill:"#5b65f5"}),D.jsx("rect",{x:"58",y:"32",width:"4",height:"17",rx:"0.5",transform:"rotate(90 58 32)",fill:"#959bee"}),D.jsx("rect",{x:"40",y:"32",width:"4",height:"26",rx:"0.5",transform:"rotate(90 40 32)",fill:"#5b65f5"})]}),Que=()=>D.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[D.jsx("rect",{x:"40",y:"11",width:"4",height:"15",rx:"0.5",transform:"rotate(90 40 11)",fill:"#959bee"}),D.jsx("rect",{x:"24",y:"11",width:"4",height:"8",rx:"0.5",transform:"rotate(90 24 11)",fill:"#5b65f5"}),D.jsx("rect",{x:"48",y:"18",width:"4",height:"15.5",rx:"0.5",transform:"rotate(90 48 18)",fill:"#959bee"}),D.jsx("rect",{x:"31.5",y:"18",width:"4",height:"15.5",rx:"0.5",transform:"rotate(90 31.5 18)",fill:"#5b65f5"}),D.jsx("rect",{x:"60",y:"25",width:"4",height:"34",rx:"0.5",transform:"rotate(90 60 25)",fill:"#959bee"}),D.jsx("rect",{x:"25",y:"25",width:"4",height:"9",rx:"0.5",transform:"rotate(90 25 25)",fill:"#5b65f5"}),D.jsx("rect",{x:"43",y:"32",width:"4",height:"13",rx:"0.5",transform:"rotate(90 43 32)",fill:"#959bee"}),D.jsx("rect",{x:"29",y:"32",width:"4",height:"13",rx:"0.5",transform:"rotate(90 29 32)",fill:"#5b65f5"})]}),Jue=()=>{const{t,i18n:e}=At();return I.useMemo(()=>[{label:t("chart.t2"),value:"chart-bar",icon:D.jsx(ZS,{})},{label:t("chart.t3"),value:"chart-bar-pile",icon:D.jsx(que,{})},{label:t("chart.t4"),value:"chart-bar-percentage",icon:D.jsx(Yue,{})},{label:t("chart.t5"),value:"chart-strip-bar",icon:D.jsx(JS,{})},{label:t("chart.t6"),value:"chart-strip-bar-pile",icon:D.jsx(Que,{})},{label:t("chart.t7"),value:"chart-strip-bar-percentage",icon:D.jsx(Kue,{})},{label:t("chart.t8"),value:"chart-line",icon:D.jsx(KS,{})},{label:t("chart.t9"),value:"chart-line-smooth",icon:D.jsx(Xue,{})},{label:t("chart.t10"),value:"chart-pie",icon:D.jsx(QS,{})},{label:t("chart.t11"),value:"chart-pie-circular",icon:D.jsx(Zue,{})},{label:t("chart._t12"),value:Lr.chartCombination,icon:D.jsx(XS,{})}],[e.language])},efe=()=>{const{t,i18n:e}=At();return I.useMemo(()=>[{label:t("chart.t40"),value:"day"},{label:t("chart.t41"),value:"week"},{label:t("chart.t42"),value:"month"},{label:t("chart.t43"),value:"year"}],[e.language])},tfe=()=>{const{t,i18n:e}=At();return I.useMemo(()=>[{label:t("displayRange.all","ALL"),value:di.ALL},{label:t("displayRange.top5","TOP5"),value:di.TOP5},{label:t("displayRange.top10","TOP10"),value:di.TOP10},{label:t("displayRange.top20","TOP20"),value:di.TOP20},{label:t("displayRange.top30","TOP30"),value:di.TOP30},{label:t("displayRange.bottom5","BOTTOM5"),value:di.BOTTOM5},{label:t("displayRange.bottom10","BOTTOM10"),value:di.BOTTOM10},{label:t("displayRange.bottom20","BOTTOM20"),value:di.BOTTOM20},{label:t("displayRange.bottom30","BOTTOM30"),value:di.BOTTOM30}],[e.language])},rfe={"chart-modal":"_chart-modal_10ivt_1"},nfe="chart-modal",ife=({selectModuleData:t,onAllValuesChange:e,enumDataApi:r})=>{const{globalData:n}=dn(),{t:i}=At(),a=I.useRef(null),o=Jue(),s=efe(),l=tfe(),u={dataSourceId:"",yAxis:"recordTotal",chartOptions:["legend","label","axis","splitLine"],sortField:"xAxis",sortOrder:"asc",timeGroupInterval:"day",displayRange:"ALL",yAxisFieldConfig:{chartType:Lr.ChartBar,yAxisPos:"left"}},[f]=Z.Form.useForm(),c=Z.Form.useWatch("type",f),d=Z.Form.useWatch("dataSourceId",f),h=Z.Form.useWatch("isGroup",f),v=Z.Form.useWatch("xAxis",f),g=Z.Form.useWatch("yAxisField",f),p=Z.Form.useWatch("groupField",f),m=Tt(B=>{var Y,X;return((X=(Y=n==null?void 0:n.sourceData)==null?void 0:Y.find(ee=>ee.value===B))==null?void 0:X.fields)??[]}),{fieldOptions:y,xAxisFieldOption:b,yAxisFieldOption:C,groupFieldOption:_}=I.useMemo(()=>{const B=m(d),z=B.filter(ee=>![g,p].includes(ee.value)),Y=B.filter(ee=>{let te=ee.type==="int"||ee.type==="float",V=[v,p].includes(ee.value);return te&&!V}),X=B.filter(ee=>![v,g].includes(ee.value));return{fieldOptions:B,xAxisFieldOption:z,yAxisFieldOption:Y,groupFieldOption:X}},[d,v,g,p]),w=Tt(B=>{var z;return((z=y.find(Y=>Y.value===B))==null?void 0:z.type)==="timestamp"}),[x,S]=I.useState(!1),E=I.useRef(),[T,A]=I.useState({conditionList:[],conditionType:"all"}),[M,O]=I.useState(0),P=B=>{var z;A(B),E.current=B,O(((z=B==null?void 0:B.conditionList)==null?void 0:z.length)||0)},{service:N}=dn(),{data:F,loading:L}=y9(async()=>{var B,z,Y;if(h&&c===Lr.chartCombination&&p){const X=p==="tags"?"tag":p;let ee=`select=${X}`;if(((B=T==null?void 0:T.conditionList)==null?void 0:B.length)>0){let J=Qd(T);ee+=J?`&${J}`:""}let te=await((z=N==null?void 0:N.moduleDataApi)==null?void 0:z.call(N,{id:d,query:ee})),V=(Y=te==null?void 0:te.data)==null?void 0:Y.map(J=>nf({fieldOptions:y,val:J[X],field:X,fieldMap:n==null?void 0:n.fieldMap}));return[...new Set(V)]}else return[]},{refreshDeps:[c,h,p,T,d]}),{run:j}=Sm(Tt(()=>{e==null||e({...u,...f.getFieldsValue(),conditionData:E.current})}),{wait:100}),W=Tt((B,z)=>{var Y,X,ee;if(B.dataSourceId){const te=m(B.dataSourceId);f.setFieldsValue({xAxis:(Y=te==null?void 0:te[0])==null?void 0:Y.value,yAxis:"recordTotal",isGroup:!1}),P({conditionList:[],conditionType:"all"})}if(B.xAxis&&f.setFieldsValue(w(B.xAxis)?{timeGroupInterval:u==null?void 0:u.timeGroupInterval}:{displayRange:u==null?void 0:u.displayRange}),B.yAxis){let te=B.yAxis;f.setFieldsValue({yAxisField:te==="fieldValue"?(X=C==null?void 0:C[0])==null?void 0:X.value:"",yAxisFieldType:"sum"})}B.isGroup&&f.setFieldsValue({groupField:(ee=_==null?void 0:_[0])==null?void 0:ee.value}),j()});return I.useEffect(()=>{var B,z,Y;if(t!=null&&t.customData){const X=t.customData;f.setFieldsValue(X)}else{const X=(B=n==null?void 0:n.sourceData)==null?void 0:B[0],ee=m(X==null?void 0:X.value)||[];f.setFieldsValue({...u,dataSourceId:X==null?void 0:X.value,type:t==null?void 0:t.type,xAxis:(z=ee==null?void 0:ee[0])==null?void 0:z.value})}P((Y=t==null?void 0:t.customData)==null?void 0:Y.conditionData),j()},[t,n]),D.jsxs("div",{style:{height:"50vh",overflowX:"auto"},className:fn(rfe[`${nfe}`]),ref:a,children:[D.jsxs(Z.Form,{form:f,name:"customData",layout:"vertical",onValuesChange:W,initialValues:u,children:[D.jsx(Z.Form.Item,{label:i("dataSource"),name:"dataSourceId",children:D.jsx(Z.Select,{options:(n==null?void 0:n.sourceData)??[]})}),D.jsxs(Z.Form.Item,{label:i("dataRange"),children:[D.jsx(Z.Button,{style:{marginLeft:"-15px"},onClick:()=>{S(!0)},type:"link",children:i("filterData")}),M>0?`${i("selectNcondition",{n:M})}`:null]}),D.jsx(Z.Form.Item,{label:i("chart.t1"),name:"type",children:D.jsx(Z.Select,{options:o,optionRender:B=>D.jsxs(Z.Flex,{align:"center",children:[D.jsx("span",{role:"img",style:{marginTop:"5px"},"aria-label":B.data.label,children:B.data.icon}),B.data.label]})})}),D.jsx(Z.Form.Item,{name:"chartOptions",label:i("chart.t12"),children:D.jsxs(Z.Checkbox.Group,{children:[D.jsx(Z.Checkbox,{value:"legend",className:"ow-checkbox",style:{lineHeight:"32px"},children:i("chart.t13")}),D.jsx(Z.Checkbox,{value:"label",className:"ow-checkbox",style:{lineHeight:"32px"},children:i("chart.t14")}),["chart-pie","chart-pie-circular"].includes(c)?null:D.jsxs(D.Fragment,{children:[D.jsx(Z.Checkbox,{value:"axis",className:"ow-checkbox",style:{lineHeight:"32px"},children:i("chart.t15")}),D.jsx(Z.Checkbox,{value:"splitLine",className:"ow-checkbox",style:{lineHeight:"32px"},children:i("chart.t16")})]})]})}),D.jsx(Z.Divider,{style:{borderColor:"#e2e2e2",marginTop:0}}),D.jsx(Z.Form.Item,{label:c!=null&&c.includes("pie")?i("chart.t17"):i("chart.t18"),name:"xAxis",children:D.jsx(Z.Select,{options:b})}),D.jsx(Z.Form.Item,{noStyle:!0,dependencies:["type","xAxis"],children:({getFieldValue:B})=>w(B("xAxis"))?D.jsx(D.Fragment,{children:D.jsx(Z.Form.Item,{name:"timeGroupInterval",label:i("chart.t39"),children:D.jsx(Z.Select,{options:s})})}):D.jsx(D.Fragment,{children:D.jsx(Z.Form.Item,{name:"displayRange",label:i("displayRange.title"),children:D.jsx(Z.Select,{options:l})})})}),D.jsx(Z.Form.Item,{dependencies:["type"],noStyle:!0,children:({getFieldValue:B})=>{var z;return(z=B("type"))!=null&&z.includes("pie")?null:D.jsxs(D.Fragment,{children:[D.jsx(Z.Form.Item,{name:"sortField",label:i("chart.t31"),children:D.jsxs(Z.Radio.Group,{children:[D.jsx(Z.Radio,{value:"xAxis",children:i("chart.t32")}),D.jsx(Z.Radio,{value:"yAxisField",children:i("chart.t33")}),D.jsx(Z.Radio,{value:"recordValue",children:i("chart.t34")})]})}),D.jsx(Z.Form.Item,{name:"sortOrder",label:i("chart.t35"),children:D.jsxs(Z.Radio.Group,{children:[D.jsx(Z.Radio,{value:"asc",children:i("chart.t36")}),D.jsx(Z.Radio,{value:"desc",children:i("chart.t37")})]})})]})}}),D.jsx(Z.Form.Item,{label:c!=null&&c.includes("pie")?i("chart.t19"):i("chart.t20"),name:"yAxis",children:D.jsx(Z.Select,{options:[{value:"recordTotal",label:i("statisticstRecordNum")},{value:"fieldValue",label:i("statisticstFieldVal")}]})}),D.jsx(Z.Form.Item,{dependencies:["yAxis","type","isGroup"],noStyle:!0,children:({getFieldValue:B})=>B("yAxis")==="fieldValue"?D.jsx(Z.Form.Item,{label:i("selectField"),children:D.jsx("div",{style:{display:"flex",justifyContent:"space-between"},children:D.jsxs(Z.Space.Compact,{children:[D.jsx(Z.Form.Item,{noStyle:!0,name:"yAxisField",children:D.jsx(Z.Select,{style:{width:"100px"},options:C,dropdownStyle:{width:250}})}),D.jsx(Z.Form.Item,{name:"yAxisFieldType",noStyle:!0,children:D.jsx(Z.Select,{style:{width:"100px"},dropdownStyle:{width:136},options:[{value:"sum",label:i("sumVal")},{value:"max",label:i("maxVal")},{value:"min",label:i("minVal")},{value:"avg",label:i("averageVal")}]})})]})})}):null}),D.jsx(Z.Form.Item,{dependencies:["type","isGroup"],noStyle:!0,children:({getFieldValue:B})=>{var z;return(z=B("type"))!=null&&z.includes("pie")?null:D.jsxs(D.Fragment,{children:[D.jsx(Z.Form.Item,{name:"isGroup",valuePropName:"checked",noStyle:!0,children:D.jsx(Z.Checkbox,{style:{marginBottom:"5px"},children:i("chart.t38")})}),D.jsx(Z.Form.Item,{dependencies:["isGroup"],noStyle:!0,children:({getFieldValue:Y})=>Y("isGroup")?D.jsx(Z.Form.Item,{name:"groupField",children:D.jsx(Z.Select,{options:_})}):null}),D.jsx(Z.Spin,{spinning:L,children:D.jsx(Z.Form.Item,{name:"groupFieldConfig",label:i("chart.groupFieldConfig"),hidden:!(B("type")===Lr.chartCombination&&B("isGroup")),children:D.jsx(eN,{options:F})})})]})}})]}),D.jsx(V0,{open:x,value:T,fieldOptions:y,enumDataApi:r,onClose:()=>{S(!1)},onOk:B=>{P(B),j()}})]})},afe=({customData:t,selectModuleData:e,onAllValuesChange:r})=>{var s,l,u;const[n]=Z.Form.useForm(),{t:i}=At(),a={xtitle:"",ytitle:""},o=()=>{setTimeout(()=>{r==null||r(n.getFieldsValue())})};return I.useEffect(()=>{e!=null&&e.customeStyle?n.setFieldsValue(e.customeStyle):n.setFieldsValue(a)},[e]),(s=t==null?void 0:t.type)!=null&&s.includes("pie")?D.jsx("div",{style:{height:"50vh",overflowX:"auto"}}):D.jsx("div",{style:{height:"50vh",overflowX:"auto"},children:D.jsxs(Z.Form,{form:n,name:"customeStyle",layout:"vertical",initialValues:a,children:[D.jsx(Z.Divider,{orientation:"left",orientationMargin:"0",children:i("chart.t21")}),(l=t==null?void 0:t.type)!=null&&l.includes("pie")?null:D.jsx(Z.Form.Item,{label:i("chart.t22"),name:"xtitle",children:D.jsx(pi,{onChange:()=>{o()}})}),D.jsx(Z.Divider,{orientation:"left",orientationMargin:"0",children:i("chart.t26")}),(u=t==null?void 0:t.type)!=null&&u.includes("pie")?null:D.jsx(Z.Form.Item,{label:i("chart.t27"),name:"ytitle",children:D.jsx(pi,{onChange:()=>{o()}})})]})})},ofe=({open:t,onClose:e,onOk:r,moduleDataApi:n,selectModuleData:i,enumDataApi:a})=>{var v;const{t:o}=At(),[s,l]=I.useState(),[u,f]=I.useState();I.useRef(null);const c=(v=s==null?void 0:s.type)==null?void 0:v.includes("pie");I.useEffect(()=>{i&&(l(i==null?void 0:i.customData),f(i==null?void 0:i.customeStyle))},[i]);const[d,h]=I.useState("");return I.useEffect(()=>{t&&h(i!=null&&i.title?i==null?void 0:i.title:o("chartText"))},[t]),D.jsx(D.Fragment,{children:D.jsx(Z.Modal,{width:"65%",title:D.jsx(Dd,{value:d,onChange:h}),footer:null,open:t,onCancel:e,destroyOnClose:!0,closeIcon:D.jsx(zc,{}),className:"ow-modal ow-modal-2",children:D.jsxs("div",{className:"config-widget-dialog-container",children:[D.jsx("div",{className:"config-widget-dialog-content",children:D.jsx("div",{className:"config-widget-dialog-preview",children:D.jsx(Z8,{customData:s,customeStyle:u,moduleDataApi:n})})}),D.jsxs("div",{className:"config-widget-dialog-panel",children:[D.jsx("div",{className:"bitable-dashboard edit-panel-container",children:D.jsx(Z.Tabs,{defaultActiveKey:"1",items:[{key:"1",label:o("typeData"),children:D.jsx(ife,{enumDataApi:a,selectModuleData:i,onAllValuesChange:g=>{l(g)}})},...c?[]:[{key:"2",label:o("customStyle"),children:D.jsx(afe,{customData:s,selectModuleData:i,onAllValuesChange:g=>{f(g)}})}]]})}),D.jsx("div",{className:"button-container",children:D.jsx(Z.Button,{type:"primary",onClick:()=>{r==null||r({id:i==null?void 0:i.id,type:i==null?void 0:i.type,customData:s,customeStyle:u,title:d})},children:o("confirm")})})]})]})})})};function y_(t,e){const{ranges:r,step:n}=e;let i=null,a=null;for(let o=0;o<r.length-1;o++){const[s,l]=r[o],[u,f]=r[o+1];if(t>=s&&t<=u){i=[s,l],a=[u,f];break}}if(t<r[0][0]&&(i=r[0],a=r[1]),t>r[r.length-1][0]&&(i=r[r.length-2],a=r[r.length-1]),i&&a){let[o,s]=i,[l,u]=a;const f=(u-s)/(l-o),c=s-f*o,d=f*t+c;return Math.round(d/n)*n}if(i||a){let o=i||a,[s,l]=o;const u=l*t/s;return Math.round(u/n)*n}throw new Error("Unexpected error in range calculation")}function sfe(t,e=0){if(!Number.isFinite(t))throw new Error("Value must be a finite number.");return new Intl.NumberFormat(void 0,{style:"percent",minimumFractionDigits:e,maximumFractionDigits:e}).format(t)}function b_(t,e=0){if(!Number.isFinite(t))return"";const r=new Intl.NumberFormat(void 0,{minimumFractionDigits:0,maximumFractionDigits:e}).format(t),[n,i]=r.split("."),a=(i||"").padEnd(e,"0");return`${n}${e>0?".":""}${a}`}const lfe=({moduleDataApi:t,customData:e,customeStyle:r})=>{const[n,i]=I.useState(),[a,o]=I.useState(!1),{globalFilterCondition:s}=dn();let l=I.useMemo(()=>s==null?void 0:s.find(m=>(m==null?void 0:m.dataSourceId)===(e==null?void 0:e.dataSourceId)),[s,e==null?void 0:e.dataSourceId]);const u=Tt(async()=>{var p,m,y;if(e){let b="";o(!0),e.statisticalMethod==="fieldValue"&&e.field?b+=`select=${e.field}.${e==null?void 0:e.statisticalType}()`:e.statisticalMethod==="recordTotal"&&(b+="select=id.count()");let C=[];if((((p=l==null?void 0:l.conditionList)==null?void 0:p.length)??0)>0&&C.push(l),(((y=(m=e==null?void 0:e.conditionData)==null?void 0:m.conditionList)==null?void 0:y.length)??0)>0&&C.push(e==null?void 0:e.conditionData),C.length>0){let _=Qd(C);b+=_?`&${_}`:""}e!=null&&e.dataSourceId&&(t==null||t({id:e==null?void 0:e.dataSourceId,query:b}).then(_=>{if(!_.success){Z.message.error(_.message);return}i(_.data)}).finally(()=>{o(!1)}))}else i([])});I.useEffect(()=>{e&&u()},[e==null?void 0:e.conditionData,e==null?void 0:e.statisticalMethod,e==null?void 0:e.statisticalType,e==null?void 0:e.field,e==null?void 0:e.dataSourceId,l]);const{formatCurrency:f}=dn(),c=Tt(f),d=I.useMemo(()=>{var _,w,x,S,E;if(!n)return"";const p=n,{statisticalMethod:m,statisticalType:y,field:b}=e||{};let C=0;if(p.length&&m==="fieldValue"&&b)switch(y){case"sum":C=((_=p==null?void 0:p[0])==null?void 0:_.sum)||0;break;case"max":C=((w=p==null?void 0:p[0])==null?void 0:w.max)||0;break;case"min":C=((x=p==null?void 0:p[0])==null?void 0:x.min)||0;break;case"avg":C=((S=p==null?void 0:p[0])==null?void 0:S.avg)||0;break;default:C=0}else m==="recordTotal"&&(C=((E=p==null?void 0:p[0])==null?void 0:E.count)||0);if(r!=null&&r.unit){const{unit:T,precision:A}=r;switch(`${T}`){case"4":case"5":case"6":case"7":case"8":case"9":C=(c==null?void 0:c(C,A))??C;break;case"1":C=b_(C,A);break;case"3":C=sfe(C,A);break;default:C=b_(C,A)}}else C=b_(C,r==null?void 0:r.precision);return C},[n,e,r]),h=I.useRef(),v=Em(h),g=I.useMemo(()=>{if(!v)return null;let p=0,m=32,y=0,b=0;p=y_(v.width,{ranges:[[116,16],[760,56]],step:4}),p=Math.max(16,Math.min(72,p));let C=v.width-p*2,_=v.height-m*2;{y=y_(C,{ranges:[[400,60],[500,64]],step:.1});const w=16,x=Math.min(72,_/2);y=Math.max(w,Math.min(x,y))}{b=y_(_,{ranges:[[140,12],[500,24],[860,36]],step:.1});const w=12,x=Math.min(36,_/2);b=Math.max(w,Math.min(x,b))}return{PX:p,PY:m,fontSize:y,subFontSize:b}},[v]);return D.jsxs("div",{ref:h,style:{display:"flex",height:"100%",width:"100%"},children:[a?D.jsx(Z.Spin,{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",background:"rgba(255,255,255,0.6)",top:0,left:0,right:0,bottom:0,zIndex:1e3},spinning:a}):null,D.jsxs("div",{style:{overflow:"hidden",position:"relative",flex:1,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",padding:`${g==null?void 0:g.PY}px ${g==null?void 0:g.PX}px`},children:[d!==""&&D.jsx("div",{style:{width:"100%",position:"relative",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textAlign:"center"},children:D.jsx("span",{style:{fontWeight:"bold",lineHeight:`${g==null?void 0:g.fontSize}px`,fontSize:`${g==null?void 0:g.fontSize}px`,color:r==null?void 0:r.color},children:d})}),(r==null?void 0:r.desc)!==""&&D.jsx("div",{style:{width:"100%",position:"relative",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textAlign:"center"},children:D.jsx("span",{style:{fontSize:`${g==null?void 0:g.subFontSize}px`,lineHeight:`${g==null?void 0:g.subFontSize}px`,color:r==null?void 0:r.color,textAlign:"center"},children:r==null?void 0:r.desc})})]})]})},tN=I.memo(lfe),ufe=({selectModuleData:t,onAllValuesChange:e,enumDataApi:r})=>{const{globalData:n}=dn(),{t:i}=At(),[a,o]=I.useState(),[s,l]=I.useState(),u=_=>{var x,S;const w=(S=(x=n==null?void 0:n.sourceData)==null?void 0:x.find(E=>E.value===_))==null?void 0:S.fields;o(w),l(w==null?void 0:w.filter(E=>E.type==="int"||E.type==="float"))},[f]=Z.Form.useForm(),c={dataSourceId:"",statisticalMethod:"recordTotal",field:""},d=()=>{setTimeout(()=>{e==null||e({...f.getFieldsValue(),conditionData:g.current})})},[h,v]=I.useState(!1),g=I.useRef(),[p,m]=I.useState({conditionList:[],conditionType:"all"}),[y,b]=I.useState(0),C=_=>{var w;m(_),g.current=_,b(((w=_==null?void 0:_.conditionList)==null?void 0:w.length)||0)};return I.useEffect(()=>{var _,w;if(t!=null&&t.customData){const x=t.customData;f.setFieldsValue(x),u(x==null?void 0:x.dataSourceId)}else{const x=(_=n==null?void 0:n.sourceData)==null?void 0:_[0];f.setFieldsValue({...c,dataSourceId:x==null?void 0:x.value}),u(x==null?void 0:x.value),d()}C((w=t==null?void 0:t.customData)==null?void 0:w.conditionData)},[t,n]),D.jsxs(D.Fragment,{children:[D.jsxs(Z.Form,{form:f,name:"customData",layout:"vertical",initialValues:c,children:[D.jsx(Z.Form.Item,{label:i("dataSource"),name:"dataSourceId",children:D.jsx(Z.Select,{options:n==null?void 0:n.sourceData,onChange:_=>{f.setFieldsValue({statisticalMethod:"recordTotal"}),u(_),d(),C({conditionList:[],conditionType:"all"})}})}),D.jsxs(Z.Form.Item,{label:i("dataRange"),children:[D.jsx(Z.Button,{style:{marginLeft:"-15px"},onClick:()=>{v(!0)},type:"link",children:i("filterData")}),y>0?`${i("selectNcondition",{n:y})}`:null]}),D.jsx(Z.Divider,{style:{borderColor:"#e2e2e2",marginTop:0}}),D.jsx(Z.Form.Item,{label:i("statisticstMethods"),name:"statisticalMethod",children:D.jsx(Z.Select,{onChange:_=>{f.setFieldsValue({field:_==="fieldValue"?s==null?void 0:s[0].value:"",statisticalType:"sum"}),d()},options:[{value:"recordTotal",label:i("statisticstRecordNum")},{value:"fieldValue",label:i("statisticstFieldVal")}]})}),D.jsx(Z.Form.Item,{dependencies:["statisticalMethod"],children:({getFieldValue:_})=>_("statisticalMethod")==="fieldValue"?D.jsx(Z.Form.Item,{label:i("selectField"),children:D.jsxs(Z.Space.Compact,{children:[D.jsx(Z.Form.Item,{noStyle:!0,name:"field",children:D.jsx(Z.Select,{style:{width:"100px"},dropdownStyle:{width:250},onChange:()=>{d()},options:s})}),D.jsx(Z.Form.Item,{name:"statisticalType",noStyle:!0,children:D.jsx(Z.Select,{style:{width:"100px"},dropdownStyle:{width:180},onChange:()=>{d()},options:[{value:"sum",label:i("sumVal")},{value:"max",label:i("maxVal")},{value:"min",label:i("minVal")},{value:"avg",label:i("averageVal")}]})})]})}):null})]}),D.jsx(V0,{open:h,value:p,fieldOptions:a,enumDataApi:r,onClose:()=>{v(!1)},onOk:_=>{C(_),d()}})]})},ffe=({value:t,onChange:e})=>{const[r,n]=I.useState(),i=["#373c43","#3370ff","#4954e6","#34c724","#14c0ff","#ffc60a","#f80","#f76964"];return I.useEffect(()=>{n(t)},[t]),D.jsx("div",{className:"pane-item-body item-body-column",children:D.jsx("div",{className:"panel-single-color-selector",children:i.map((a,o)=>D.jsxs("div",{className:"panel-single-color-selector-color-item",onClick:()=>{n(a),e==null||e(a)},children:[D.jsx("div",{className:"panel-single-color-selector-color-item-background",style:{background:a}}),r===a?D.jsx("span",{className:"panel-icon",children:D.jsx(qw,{})}):null]},o))})})},cfe=({selectModuleData:t,onAllValuesChange:e})=>{const[r]=Z.Form.useForm(),{t:n,i18n:i}=At(),a=I.useMemo(()=>[{value:"1",label:n("statistics.t5")},{value:"2",label:n("statistics.t6")},{value:"3",label:n("statistics.t7")},{value:"9",label:n("statistics.currency")}],[i.language]),o={color:"#373c43",unit:"1",precision:"",desc:""},s=()=>{setTimeout(()=>{e==null||e(r.getFieldsValue())})};return I.useEffect(()=>{if(t!=null&&t.customeStyle){`${t.customeStyle.unit??o.unit}`;let l={...o,...t.customeStyle,unit:`${t.customeStyle.unit??o.unit}`};r.setFieldsValue(l)}else r.setFieldsValue(o)},[t]),D.jsxs(Z.Form,{form:r,name:"customeStyle",layout:"vertical",initialValues:o,children:[D.jsx(Z.Form.Item,{label:n("statistics.t1"),name:"color",children:D.jsx(ffe,{onChange:()=>{s()}})}),D.jsx(Z.Form.Item,{label:n("statistics.t2"),extra:n("statistics.t3"),children:D.jsxs(Z.Space.Compact,{children:[D.jsx(Z.Form.Item,{name:"precision",noStyle:!0,children:D.jsx(Z.InputNumber,{min:1,max:10,style:{width:"60%"},placeholder:n("statistics.t4"),onChange:()=>{s()}})}),D.jsx(Z.Form.Item,{name:"unit",noStyle:!0,children:D.jsx(Z.Select,{onChange:()=>{s()},dropdownStyle:{width:240},children:a.map(l=>{const{value:u,label:f}=l;return D.jsx(Z.Select.Option,{value:u,children:f},u)})})})]})}),D.jsx(Z.Form.Item,{label:n("statistics.t10"),name:"desc",children:D.jsx(pi,{onChange:()=>{s()}})})]})},dfe=({open:t,onClose:e,onOk:r,moduleDataApi:n,selectModuleData:i,enumDataApi:a})=>{const{t:o}=At(),[s,l]=I.useState(),[u,f]=I.useState();I.useEffect(()=>{i&&(l(i==null?void 0:i.customData),f(i==null?void 0:i.customeStyle))},[i]);const[c,d]=I.useState("");return I.useEffect(()=>{t&&d(i!=null&&i.title?i==null?void 0:i.title:o("statisticsText"))},[t]),D.jsx(D.Fragment,{children:D.jsx(Z.Modal,{width:"65%",title:D.jsx(Dd,{value:c,onChange:d}),footer:null,open:t,onCancel:e,closeIcon:D.jsx(zc,{}),className:"ow-modal ow-modal-2",children:D.jsxs("div",{className:"config-widget-dialog-container",children:[D.jsx("div",{className:"config-widget-dialog-content",children:D.jsx("div",{className:"config-widget-dialog-preview",children:D.jsx(tN,{customData:s,customeStyle:u,moduleDataApi:n})})}),D.jsxs("div",{className:"config-widget-dialog-panel",children:[D.jsx("div",{className:"bitable-dashboard edit-panel-container",children:D.jsx(Z.Tabs,{defaultActiveKey:"1",items:[{key:"1",label:o("typeData"),children:D.jsx(ufe,{selectModuleData:i,enumDataApi:a,onAllValuesChange:h=>{l(h)}})},{key:"2",label:o("customStyle"),children:D.jsx(cfe,{selectModuleData:i,onAllValuesChange:h=>{f(h)}})}]})}),D.jsx("div",{className:"button-container",children:D.jsx(Z.Button,{type:"primary",onClick:()=>{r==null||r({id:i==null?void 0:i.id,customData:s,customeStyle:u,title:c})},children:o("confirm")})})]})]})})})},hfe=t=>D.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",...t,children:[D.jsx("g",{clipPath:"url(#a)",children:D.jsx("path",{fill:"#000",fillRule:"evenodd",d:"M3 2.666a.167.167 0 0 0-.166.167v1.634c0 .057.03.11.077.14l3.05 1.94c.336.215.54.586.54.985v4.634a.5.5 0 1 1-1 0V7.532c0-.057-.03-.11-.078-.14L2.374 5.45a1.167 1.167 0 0 1-.54-.984V2.833c0-.645.522-1.167 1.167-1.167h10c.644 0 1.166.522 1.166 1.167v1.634c0 .399-.204.77-.54.984l-3.05 1.94a.167.167 0 0 0-.076.141v6.3a.5.5 0 0 1-1 0v-6.3c0-.399.203-.77.54-.984l3.05-1.94a.167.167 0 0 0 .076-.141V2.833a.167.167 0 0 0-.166-.167H3Z",clipRule:"evenodd"})}),D.jsx("defs",{children:D.jsx("clipPath",{id:"a",children:D.jsx("path",{fill:"#fff",d:"M0 0h16v16H0z"})})})]}),rN=I.createContext({}),C_=()=>I.useContext(rN),Bp=(t,e)=>`${t}-${e}`,vfe=t=>{var l,u;const{t:e}=At(),{fieldPickerDataSource:r,flattenFieldMap:n}=C_(),[i,a]=Ao(t),o=Tt(f=>{const[c,d]=f.keyPath;let h=c==null?void 0:c.replace(`${d}-`,"");h&&a({dataSourceId:d,field:h})}),s=I.useMemo(()=>{{let f=Bp(i==null?void 0:i.dataSourceId,i==null?void 0:i.field);return n==null?void 0:n.get(f)}},[i,n]);return D.jsx(Z.Dropdown,{trigger:["click"],menu:{selectable:!0,selectedKeys:s?[(l=s==null?void 0:s.source)==null?void 0:l.value,s==null?void 0:s.mergeId]:[],items:r,onClick:o},children:D.jsx(Z.Select,{open:!1,placeholder:e("selectGroupField"),style:{width:200},value:((u=s==null?void 0:s.field)==null?void 0:u.label)??void 0})})},__=t=>{const[e,r]=Ao(t),n=I.useMemo(()=>e!=null&&e.field?{dataSourceId:e==null?void 0:e.dataSourceId,field:e==null?void 0:e.field}:void 0,[e==null?void 0:e.field,e==null?void 0:e.dataSourceId]),i=u=>{var c;const f={condition:"=",val:"",val2:"",rdate:"exactdate"};if(u){let d=a==null?void 0:a.get(Bp(u.dataSourceId,u.field));r({...f,dataSourceId:u.dataSourceId,field:u.field,type:(c=d==null?void 0:d.field)==null?void 0:c.type})}else r({...f,dataSourceId:void 0,field:void 0,type:void 0})},{flattenFieldMap:a}=C_(),o=a==null?void 0:a.get(Bp(e==null?void 0:e.dataSourceId,e==null?void 0:e.field)),s=qS(e,["field"]),l=Tt(u=>r({...e,...u}));return D.jsxs("div",{style:{display:"flex",gap:"10px"},children:[D.jsx(vfe,{value:n,onChange:i}),D.jsx(IT,{value:s,onChange:l,field:o==null?void 0:o.field}),D.jsx(Cg,{style:{cursor:"pointer"},onClick:t.onDelete})]})};__.displayName="ConditionRowItem";const wc={"global-filter-condition__popover":"_global-filter-condition__popover_qw1om_1","global-filter-condition__block":"_global-filter-condition__block_qw1om_4","sub-popup":"_sub-popup_qw1om_10"},Ip="global-filter-condition",pfe=[],nN=t=>{const{className:e,style:r}=t,{t:n}=At(),{globalFilterCondition:i,setGlobalFilterCondition:a}=dn(),[o,s]=I.useState(!1),{globalData:l}=dn(),{fieldPickerDataSource:u,flattenFieldMap:f}=I.useMemo(()=>{let c=new Map;return{fieldPickerDataSource:((l==null?void 0:l.sourceData)||[]).map(h=>{let v=((h==null?void 0:h.fields)||[]).map(g=>{let p=Bp(h==null?void 0:h.value,g==null?void 0:g.value);return c.set(p,{field:g,source:h,mergeId:p}),{key:p,label:g==null?void 0:g.label,disabled:g.disabled??!1}});return{key:h==null?void 0:h.value,label:h==null?void 0:h.label,children:v,popupClassName:wc["sub-popup"]}}),flattenFieldMap:c}},[l==null?void 0:l.sourceData]);return D.jsx(rN.Provider,{value:{fieldPickerDataSource:u,flattenFieldMap:f},children:D.jsx("div",{className:fn(wc[`${Ip}`],e),style:r,children:D.jsx(Z.Popover,{content:D.jsx(gfe,{defaultValue:i,onClose:(c,d)=>{c&&a(d),s(!1)}}),destroyTooltipOnHide:!0,placement:"bottomRight",trigger:"click",open:o,onOpenChange:s,children:D.jsx(Z.Button,{className:`!px-1 ${((i==null?void 0:i.length)??0)>0?"!bg-primary/10":""}`,type:"text",icon:D.jsx(hfe,{}),children:n("globalfilter")})})})})};nN.displayName="GlobalFilterCondition";const gfe=t=>{const{defaultValue:e}=t,{t:r}=At(),n=C_().fieldPickerDataSource,i=RT(),[a=pfe,o]=I.useState([]);I.useEffect(()=>{e&&o(NV(e))},[e]);const[s,l]=I.useState([]),u=h=>{h!=null&&h.field&&o(v=>{let g=[...v],p=g.find(m=>m.dataSourceId===h.dataSourceId);if(p)return p.conditionList.push(h),[...g];{let m={dataSourceId:h.dataSourceId,conditionType:"all",conditionList:[h]};return[...g,m]}})},f=()=>{l([...s,{}])},c=I.useMemo(()=>!GS(a,e),[a,e]),d=Tt(()=>{var h;(h=t==null?void 0:t.onClose)==null||h.call(t,!0,a)});return D.jsxs("div",{className:fn(wc[`${Ip}__popover`]),children:[D.jsx("div",{style:{marginBottom:"10px"},children:r("setFilterCondition")}),a.map((h,v)=>{var m;let g=h==null?void 0:h.conditionList,p=(m=n==null?void 0:n.find(y=>y.key===(h==null?void 0:h.dataSourceId)))==null?void 0:m.label;return console.log("dataSourceName",p),D.jsxs("div",{className:fn(wc[`${Ip}__block`]),children:[D.jsxs("div",{style:{marginBottom:"10px",display:"flex",justifyContent:"space-between"},children:[D.jsx("div",{children:p}),D.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[r("conformTo"),D.jsx(Z.Select,{style:{width:"80px"},options:i,value:h==null?void 0:h.conditionType,onChange:y=>{o(b=>{let C=[...b];return C[v].conditionType=y,C})}}),r("addCondition")]})]}),D.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:g.map((y,b)=>D.jsx(__,{value:y,onChange:C=>{o(_=>{let w=[..._],x=w[v].conditionList[b];if((x==null?void 0:x.dataSourceId)!==(C==null?void 0:C.dataSourceId)){w[v].conditionList.splice(b,1),w[v].conditionList.length===0&&w.splice(v,1);let S=C,E=w.find(T=>T.dataSourceId===S.dataSourceId);if(E)return E.conditionList.push(S),[...w];{let T={dataSourceId:S.dataSourceId,conditionType:"all",conditionList:[S]};return[...w,T]}}else w[v].conditionList[b]={...x,...C};return w})},onDelete:()=>{o(C=>{let _=[...C];return _[v].conditionList.splice(b,1),_[v].conditionList.length===0&&_.splice(v,1),_})}},b))})]},h==null?void 0:h.dataSourceId)}),s.map((h,v)=>D.jsx("div",{className:fn(wc[`${Ip}__block`]),children:D.jsx(__,{value:h,onChange:g=>{u(g)},onDelete:()=>{l(g=>{let p=[...g];return p.splice(v,1),p})}})},v)),D.jsx(Z.Button,{type:"dashed",block:!0,style:{marginBottom:"10px"},icon:D.jsx(Hc,{}),onClick:()=>{f()},children:r("addCondition")}),D.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:D.jsx(Z.Button,{type:"primary",disabled:!c,onClick:()=>{d()},children:r("confirm")})})]})};/*!
|
|
163
|
+
`)),it(n)),a.push({dimIdx:m.index,parser:y,comparator:new rR(d,v)})});var o=e.sourceFormat;o!==mr&&o!==mn&&(process.env.NODE_ENV!=="production"&&(n='sourceFormat "'+o+'" is not supported yet'),it(n));for(var s=[],l=0,u=e.count();l<u;l++)s.push(e.getRawDataItem(l));return s.sort(function(f,c){for(var d=0;d<a.length;d++){var h=a[d],v=e.retrieveValueFromItem(f,h.dimIdx),g=e.retrieveValueFromItem(c,h.dimIdx);h.parser&&(v=h.parser(v),g=h.parser(g));var p=h.comparator.evaluate(v,g);if(p!==0)return p}return 0}),{data:s}}};function tue(t){t.registerTransform(Jle),t.registerTransform(eue)}var rue=function(t){he(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.prototype.init=function(r,n,i){t.prototype.init.call(this,r,n,i),this._sourceManager=new HR(this),VR(this)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.call(this,r,n),VR(this)},e.prototype.optionUpdated=function(){this._sourceManager.dirty()},e.prototype.getSourceManager=function(){return this._sourceManager},e.type="dataset",e.defaultOption={seriesLayoutBy:Zn},e}(st),nue=function(t){he(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.type="dataset",e}(yn);function iue(t){t.registerComponentModel(rue),t.registerComponentView(nue)}function aue(t){if(t){for(var e=[],r=0;r<t.length;r++)e.push(t[r].slice());return e}}function oue(t,e){var r=t.label,n=e&&e.getTextGuideLine();return{dataIndex:t.dataIndex,dataType:t.dataType,seriesIndex:t.seriesModel.seriesIndex,text:t.label.style.text,rect:t.hostRect,labelRect:t.rect,align:r.style.align,verticalAlign:r.style.verticalAlign,labelLinePoints:aue(n&&n.shape.points)}}var D8=["align","verticalAlign","width","height","fontSize"],zr=new hf,s_=ht(),sue=ht();function Sp(t,e,r){for(var n=0;n<r.length;n++){var i=r[n];e[i]!=null&&(t[i]=e[i])}}var Ep=["x","y","rotation"],lue=function(){function t(){this._labelList=[],this._chartViewList=[]}return t.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},t.prototype._addLabel=function(e,r,n,i,a){var o=i.style,s=i.__hostTarget,l=s.textConfig||{},u=i.getComputedTransform(),f=i.getBoundingRect().plain();ke.applyTransform(f,f,u),u?zr.setLocalTransform(u):(zr.x=zr.y=zr.rotation=zr.originX=zr.originY=0,zr.scaleX=zr.scaleY=1),zr.rotation=ta(zr.rotation);var c=i.__hostTarget,d;if(c){d=c.getBoundingRect().plain();var h=c.getComputedTransform();ke.applyTransform(d,d,h)}var v=d&&c.getTextGuideLine();this._labelList.push({label:i,labelLine:v,seriesModel:n,dataIndex:e,dataType:r,layoutOptionOrCb:a,layoutOption:null,rect:f,hostRect:d,priority:d?d.width*d.height:0,defaultAttr:{ignore:i.ignore,labelGuideIgnore:v&&v.ignore,x:zr.x,y:zr.y,scaleX:zr.scaleX,scaleY:zr.scaleY,rotation:zr.rotation,style:{x:o.x,y:o.y,align:o.align,verticalAlign:o.verticalAlign,width:o.width,height:o.height,fontSize:o.fontSize},cursor:i.cursor,attachedPos:l.position,attachedRot:l.rotation}})},t.prototype.addLabelsOfSeries=function(e){var r=this;this._chartViewList.push(e);var n=e.__model,i=n.get("labelLayout");(Pe(i)||nt(i).length)&&e.group.traverse(function(a){if(a.ignore)return!0;var o=a.getTextContent(),s=Xe(a);o&&!o.disableLabelLayout&&r._addLabel(s.dataIndex,s.dataType,n,o,i)})},t.prototype.updateLayoutConfig=function(e){var r=e.getWidth(),n=e.getHeight();function i(b,C){return function(){VP(b,C)}}for(var a=0;a<this._labelList.length;a++){var o=this._labelList[a],s=o.label,l=s.__hostTarget,u=o.defaultAttr,f=void 0;Pe(o.layoutOptionOrCb)?f=o.layoutOptionOrCb(oue(o,l)):f=o.layoutOptionOrCb,f=f||{},o.layoutOption=f;var c=Math.PI/180;l&&l.setTextConfig({local:!1,position:f.x!=null||f.y!=null?null:u.attachedPos,rotation:f.rotate!=null?f.rotate*c:u.attachedRot,offset:[f.dx||0,f.dy||0]});var d=!1;if(f.x!=null?(s.x=Dt(f.x,r),s.setStyle("x",0),d=!0):(s.x=u.x,s.setStyle("x",u.style.x)),f.y!=null?(s.y=Dt(f.y,n),s.setStyle("y",0),d=!0):(s.y=u.y,s.setStyle("y",u.style.y)),f.labelLinePoints){var h=l.getTextGuideLine();h&&(h.setShape({points:f.labelLinePoints}),d=!1)}var v=s_(s);v.needsUpdateLabelLine=d,s.rotation=f.rotate!=null?f.rotate*c:u.rotation,s.scaleX=u.scaleX,s.scaleY=u.scaleY;for(var g=0;g<D8.length;g++){var p=D8[g];s.setStyle(p,f[p]!=null?f[p]:u.style[p])}if(f.draggable){if(s.draggable=!0,s.cursor="move",l){var m=o.seriesModel;if(o.dataIndex!=null){var y=o.seriesModel.getData(o.dataType);m=y.getItemModel(o.dataIndex)}s.on("drag",i(l,m.getModel("labelLine")))}}else s.off("drag"),s.cursor=u.cursor}},t.prototype.layout=function(e){var r=e.getWidth(),n=e.getHeight(),i=[];H(this._labelList,function(l){l.defaultAttr.ignore||i.push(I1({},l))});var a=Bt(i,function(l){return l.layoutOption.moveOverlap==="shiftX"}),o=Bt(i,function(l){return l.layoutOption.moveOverlap==="shiftY"});N1(a,0,0,r),N1(o,1,0,n);var s=Bt(i,function(l){return l.layoutOption.hideOverlap});cne(s),KP(s)},t.prototype.processLabelsOverall=function(){var e=this;H(this._chartViewList,function(r){var n=r.__model,i=r.ignoreLabelLineUpdate,a=n.isAnimationEnabled();r.group.traverse(function(o){if(o.ignore&&!o.forceLabelAnimation)return!0;var s=!i,l=o.getTextContent();!s&&l&&(s=s_(l).needsUpdateLabelLine),s&&e._updateLabelLine(o,n),a&&e._animateLabels(o,n)})})},t.prototype._updateLabelLine=function(e,r){var n=e.getTextContent(),i=Xe(e),a=i.dataIndex;if(n&&a!=null){var o=r.getData(i.dataType),s=o.getItemModel(a),l={},u=o.getItemVisual(a,"style");if(u){var f=o.getVisual("drawType");l.stroke=u[f]}var c=s.getModel("labelLine");$P(e,GP(s),l),VP(e,c)}},t.prototype._animateLabels=function(e,r){var n=e.getTextContent(),i=e.getTextGuideLine();if(n&&(e.forceLabelAnimation||!n.ignore&&!n.invisible&&!e.disableLabelAnimation&&!Ll(e))){var a=s_(n),o=a.oldLayout,s=Xe(e),l=s.dataIndex,u={x:n.x,y:n.y,rotation:n.rotation},f=r.getData(s.dataType);if(o){n.attr(o);var d=e.prevStates;d&&(Qe(d,"select")>=0&&n.attr(a.oldLayoutSelect),Qe(d,"emphasis")>=0&&n.attr(a.oldLayoutEmphasis)),sr(n,u,r,l)}else if(n.attr(u),!kl(n).valueAnimation){var c=Ae(n.style.opacity,1);n.style.opacity=0,Or(n,{style:{opacity:c}},r,l)}if(a.oldLayout=u,n.states.select){var h=a.oldLayoutSelect={};Sp(h,u,Ep),Sp(h,n.states.select,Ep)}if(n.states.emphasis){var v=a.oldLayoutEmphasis={};Sp(v,u,Ep),Sp(v,n.states.emphasis,Ep)}LJ(n,l,f,r,r)}if(i&&!i.ignore&&!i.invisible){var a=sue(i),o=a.oldLayout,g={points:i.shape.points};o?(i.attr({shape:o}),sr(i,{shape:g},r)):(i.setShape(g),i.style.strokePercent=0,Or(i,{style:{strokePercent:1}},r)),a.oldLayout=g}},t}(),l_=ht();function uue(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){var i=l_(r).labelManager;i||(i=l_(r).labelManager=new lue),i.clearLabels()}),t.registerUpdateLifecycle("series:layoutlabels",function(e,r,n){var i=l_(r).labelManager;n.updatedSeries.forEach(function(a){i.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),i.updateLayoutConfig(r),i.layout(r),i.processLabelsOverall()})}var Li=ea.CMD;function su(t,e){return Math.abs(t-e)<1e-5}function u_(t){var e=t.data,r=t.len(),n=[],i,a=0,o=0,s=0,l=0;function u(O,P){i&&i.length>2&&n.push(i),i=[O,P]}function f(O,P,N,F){su(O,N)&&su(P,F)||i.push(O,P,N,F,N,F)}function c(O,P,N,F,L,j){var W=Math.abs(P-O),B=Math.tan(W/4)*4/3,z=P<O?-1:1,Y=Math.cos(O),X=Math.sin(O),ee=Math.cos(P),te=Math.sin(P),V=Y*L+N,J=X*j+F,G=ee*L+N,k=te*j+F,Q=L*B*z,K=j*B*z;i.push(V-Q*X,J+K*Y,G+Q*te,k-K*ee,G,k)}for(var d,h,v,g,p=0;p<r;){var m=e[p++],y=p===1;switch(y&&(a=e[p],o=e[p+1],s=a,l=o,(m===Li.L||m===Li.C||m===Li.Q)&&(i=[s,l])),m){case Li.M:a=s=e[p++],o=l=e[p++],u(s,l);break;case Li.L:d=e[p++],h=e[p++],f(a,o,d,h),a=d,o=h;break;case Li.C:i.push(e[p++],e[p++],e[p++],e[p++],a=e[p++],o=e[p++]);break;case Li.Q:d=e[p++],h=e[p++],v=e[p++],g=e[p++],i.push(a+2/3*(d-a),o+2/3*(h-o),v+2/3*(d-v),g+2/3*(h-g),v,g),a=v,o=g;break;case Li.A:var b=e[p++],C=e[p++],_=e[p++],w=e[p++],x=e[p++],S=e[p++]+x;p+=1;var E=!e[p++];d=Math.cos(x)*_+b,h=Math.sin(x)*w+C,y?(s=d,l=h,u(s,l)):f(a,o,d,h),a=Math.cos(S)*_+b,o=Math.sin(S)*w+C;for(var T=(E?-1:1)*Math.PI/2,A=x;E?A>S:A<S;A+=T){var M=E?Math.max(A+T,S):Math.min(A+T,S);c(A,M,b,C,_,w)}break;case Li.R:s=a=e[p++],l=o=e[p++],d=s+e[p++],h=l+e[p++],u(d,l),f(d,l,d,h),f(d,h,s,h),f(s,h,s,l),f(s,l,d,l);break;case Li.Z:i&&f(a,o,s,l),a=s,o=l;break}}return i&&i.length>2&&n.push(i),n}function f_(t,e,r,n,i,a,o,s,l,u){if(su(t,r)&&su(e,n)&&su(i,o)&&su(a,s)){l.push(o,s);return}var f=2/u,c=f*f,d=o-t,h=s-e,v=Math.sqrt(d*d+h*h);d/=v,h/=v;var g=r-t,p=n-e,m=i-o,y=a-s,b=g*g+p*p,C=m*m+y*y;if(b<c&&C<c){l.push(o,s);return}var _=d*g+h*p,w=-d*m-h*y,x=b-_*_,S=C-w*w;if(x<c&&_>=0&&S<c&&w>=0){l.push(o,s);return}var E=[],T=[];Na(t,r,i,o,.5,E),Na(e,n,a,s,.5,T),f_(E[0],T[0],E[1],T[1],E[2],T[2],E[3],T[3],l,u),f_(E[4],T[4],E[5],T[5],E[6],T[6],E[7],T[7],l,u)}function fue(t,e){var r=u_(t),n=[];e=e||1;for(var i=0;i<r.length;i++){var a=r[i],o=[],s=a[0],l=a[1];o.push(s,l);for(var u=2;u<a.length;){var f=a[u++],c=a[u++],d=a[u++],h=a[u++],v=a[u++],g=a[u++];f_(s,l,f,c,d,h,v,g,o,e),s=v,l=g}n.push(o)}return n}function S8(t,e,r){var n=t[e],i=t[1-e],a=Math.abs(n/i),o=Math.ceil(Math.sqrt(a*r)),s=Math.floor(r/o);s===0&&(s=1,o=r);for(var l=[],u=0;u<o;u++)l.push(s);var f=o*s,c=r-f;if(c>0)for(var u=0;u<c;u++)l[u%o]+=1;return l}function E8(t,e,r){for(var n=t.r0,i=t.r,a=t.startAngle,o=t.endAngle,s=Math.abs(o-a),l=s*i,u=i-n,f=l>Math.abs(u),c=S8([l,u],f?0:1,e),d=(f?s:u)/c.length,h=0;h<c.length;h++)for(var v=(f?u:s)/c[h],g=0;g<c[h];g++){var p={};f?(p.startAngle=a+d*h,p.endAngle=a+d*(h+1),p.r0=n+v*g,p.r=n+v*(g+1)):(p.startAngle=a+v*g,p.endAngle=a+v*(g+1),p.r0=n+d*h,p.r=n+d*(h+1)),p.clockwise=t.clockwise,p.cx=t.cx,p.cy=t.cy,r.push(p)}}function cue(t,e,r){for(var n=t.width,i=t.height,a=n>i,o=S8([n,i],a?0:1,e),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",f=a?"y":"x",c=t[s]/o.length,d=0;d<o.length;d++)for(var h=t[l]/o[d],v=0;v<o[d];v++){var g={};g[u]=d*c,g[f]=v*h,g[s]=c,g[l]=h,g.x+=t.x,g.y+=t.y,r.push(g)}}function A8(t,e,r,n){return t*n-r*e}function due(t,e,r,n,i,a,o,s){var l=r-t,u=n-e,f=o-i,c=s-a,d=A8(f,c,l,u);if(Math.abs(d)<1e-6)return null;var h=t-i,v=e-a,g=A8(h,v,f,c)/d;return g<0||g>1?null:new Re(g*l+t,g*u+e)}function hue(t,e,r){var n=new Re;Re.sub(n,r,e),n.normalize();var i=new Re;Re.sub(i,t,e);var a=i.dot(n);return a}function lu(t,e){var r=t[t.length-1];r&&r[0]===e[0]&&r[1]===e[1]||t.push(e)}function vue(t,e,r){for(var n=t.length,i=[],a=0;a<n;a++){var o=t[a],s=t[(a+1)%n],l=due(o[0],o[1],s[0],s[1],e.x,e.y,r.x,r.y);l&&i.push({projPt:hue(l,e,r),pt:l,idx:a})}if(i.length<2)return[{points:t},{points:t}];i.sort(function(p,m){return p.projPt-m.projPt});var u=i[0],f=i[i.length-1];if(f.idx<u.idx){var c=u;u=f,f=c}for(var d=[u.pt.x,u.pt.y],h=[f.pt.x,f.pt.y],v=[d],g=[h],a=u.idx+1;a<=f.idx;a++)lu(v,t[a].slice());lu(v,h),lu(v,d);for(var a=f.idx+1;a<=u.idx+n;a++)lu(g,t[a%n].slice());return lu(g,d),lu(g,h),[{points:v},{points:g}]}function T8(t){var e=t.points,r=[],n=[];K2(e,r,n);var i=new ke(r[0],r[1],n[0]-r[0],n[1]-r[1]),a=i.width,o=i.height,s=i.x,l=i.y,u=new Re,f=new Re;return a>o?(u.x=f.x=s+a/2,u.y=l,f.y=l+o):(u.y=f.y=l+o/2,u.x=s,f.x=s+a),vue(e,u,f)}function Ap(t,e,r,n){if(r===1)n.push(e);else{var i=Math.floor(r/2),a=t(e);Ap(t,a[0],i,n),Ap(t,a[1],r-i,n)}return n}function pue(t,e){for(var r=[],n=0;n<e;n++)r.push(hb(t));return r}function gue(t,e){e.setStyle(t.style),e.z=t.z,e.z2=t.z2,e.zlevel=t.zlevel}function mue(t){for(var e=[],r=0;r<t.length;)e.push([t[r++],t[r++]]);return e}function yue(t,e){var r=[],n=t.shape,i;switch(t.type){case"rect":cue(n,e,r),i=jt;break;case"sector":E8(n,e,r),i=Pi;break;case"circle":E8({r0:0,r:n.r,startAngle:0,endAngle:Math.PI*2,cx:n.cx,cy:n.cy},e,r),i=Pi;break;default:var a=t.getComputedTransform(),o=a?Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1],a[2]*a[2]+a[3]*a[3])):1,s=Ce(fue(t.getUpdatedPathProxy(),o),function(m){return mue(m)}),l=s.length;if(l===0)Ap(T8,{points:s[0]},e,r);else if(l===e)for(var u=0;u<l;u++)r.push({points:s[u]});else{var f=0,c=Ce(s,function(m){var y=[],b=[];K2(m,y,b);var C=(b[1]-y[1])*(b[0]-y[0]);return f+=C,{poly:m,area:C}});c.sort(function(m,y){return y.area-m.area});for(var d=e,u=0;u<l;u++){var h=c[u];if(d<=0)break;var v=u===l-1?d:Math.ceil(h.area/f*e);v<0||(Ap(T8,{points:h.poly},v,r),d-=v)}}i=rv;break}if(!i)return pue(t,e);for(var g=[],u=0;u<r.length;u++){var p=new i;p.setShape(r[u]),gue(t,p),g.push(p)}return g}function bue(t,e){var r=t.length,n=e.length;if(r===n)return[t,e];for(var i=[],a=[],o=r<n?t:e,s=Math.min(r,n),l=Math.abs(n-r)/6,u=(s-2)/6,f=Math.ceil(l/u)+1,c=[o[0],o[1]],d=l,h=2;h<s;){var v=o[h-2],g=o[h-1],p=o[h++],m=o[h++],y=o[h++],b=o[h++],C=o[h++],_=o[h++];if(d<=0){c.push(p,m,y,b,C,_);continue}for(var w=Math.min(d,f-1)+1,x=1;x<=w;x++){var S=x/w;Na(v,p,y,C,S,i),Na(g,m,b,_,S,a),v=i[3],g=a[3],c.push(i[1],a[1],i[2],a[2],v,g),p=i[5],m=a[5],y=i[6],b=a[6]}d-=w-1}return o===t?[c,e]:[t,c]}function O8(t,e){for(var r=t.length,n=t[r-2],i=t[r-1],a=[],o=0;o<e.length;)a[o++]=n,a[o++]=i;return a}function Cue(t,e){for(var r,n,i,a=[],o=[],s=0;s<Math.max(t.length,e.length);s++){var l=t[s],u=e[s],f=void 0,c=void 0;l?u?(r=bue(l,u),f=r[0],c=r[1],n=f,i=c):(c=O8(i||l,l),f=l):(f=O8(n||u,u),c=u),a.push(f),o.push(c)}return[a,o]}function M8(t){for(var e=0,r=0,n=0,i=t.length,a=0,o=i-2;a<i;o=a,a+=2){var s=t[o],l=t[o+1],u=t[a],f=t[a+1],c=s*f-u*l;e+=c,r+=(s+u)*c,n+=(l+f)*c}return e===0?[t[0]||0,t[1]||0]:[r/e/3,n/e/3,e]}function _ue(t,e,r,n){for(var i=(t.length-2)/6,a=1/0,o=0,s=t.length,l=s-2,u=0;u<i;u++){for(var f=u*6,c=0,d=0;d<s;d+=2){var h=d===0?f:(f+d-2)%l+2,v=t[h]-r[0],g=t[h+1]-r[1],p=e[d]-n[0],m=e[d+1]-n[1],y=p-v,b=m-g;c+=y*y+b*b}c<a&&(a=c,o=u)}return o}function wue(t){for(var e=[],r=t.length,n=0;n<r;n+=2)e[n]=t[r-n-2],e[n+1]=t[r-n-1];return e}function xue(t,e,r,n){for(var i=[],a,o=0;o<t.length;o++){var s=t[o],l=e[o],u=M8(s),f=M8(l);a==null&&(a=u[2]<0!=f[2]<0);var c=[],d=[],h=0,v=1/0,g=[],p=s.length;a&&(s=wue(s));for(var m=_ue(s,l,u,f)*6,y=p-2,b=0;b<y;b+=2){var C=(m+b)%y+2;c[b+2]=s[C]-u[0],c[b+3]=s[C+1]-u[1]}c[0]=s[m]-u[0],c[1]=s[m+1]-u[1];for(var _=n/r,w=-n/2;w<=n/2;w+=_){for(var x=Math.sin(w),S=Math.cos(w),E=0,b=0;b<s.length;b+=2){var T=c[b],A=c[b+1],M=l[b]-f[0],O=l[b+1]-f[1],P=M*S-O*x,N=M*x+O*S;g[b]=P,g[b+1]=N;var F=P-T,L=N-A;E+=F*F+L*L}if(E<v){v=E,h=w;for(var j=0;j<g.length;j++)d[j]=g[j]}}i.push({from:c,to:d,fromCp:u,toCp:f,rotation:-h})}return i}function Tp(t){return t.__isCombineMorphing}var R8="__mOriginal_";function Op(t,e,r){var n=R8+e,i=t[n]||t[e];t[n]||(t[n]=t[e]);var a=r.replace,o=r.after,s=r.before;t[e]=function(){var l=arguments,u;return s&&s.apply(this,l),a?u=a.apply(this,l):u=i.apply(this,l),o&&o.apply(this,l),u}}function _c(t,e){var r=R8+e;t[r]&&(t[e]=t[r],t[r]=null)}function P8(t,e){for(var r=0;r<t.length;r++)for(var n=t[r],i=0;i<n.length;){var a=n[i],o=n[i+1];n[i++]=e[0]*a+e[2]*o+e[4],n[i++]=e[1]*a+e[3]*o+e[5]}}function B8(t,e){var r=t.getUpdatedPathProxy(),n=e.getUpdatedPathProxy(),i=Cue(u_(r),u_(n)),a=i[0],o=i[1],s=t.getComputedTransform(),l=e.getComputedTransform();function u(){this.transform=null}s&&P8(a,s),l&&P8(o,l),Op(e,"updateTransform",{replace:u}),e.transform=null;var f=xue(a,o,10,Math.PI),c=[];Op(e,"buildPath",{replace:function(d){for(var h=e.__morphT,v=1-h,g=[],p=0;p<f.length;p++){var m=f[p],y=m.from,b=m.to,C=m.rotation*h,_=m.fromCp,w=m.toCp,x=Math.sin(C),S=Math.cos(C);mh(g,_,w,h);for(var E=0;E<y.length;E+=2){var T=y[E],A=y[E+1],M=b[E],O=b[E+1],P=T*v+M*h,N=A*v+O*h;c[E]=P*S-N*x+g[0],c[E+1]=P*x+N*S+g[1]}var F=c[0],L=c[1];d.moveTo(F,L);for(var E=2;E<y.length;){var M=c[E++],O=c[E++],j=c[E++],W=c[E++],B=c[E++],z=c[E++];F===M&&L===O&&j===B&&W===z?d.lineTo(B,z):d.bezierCurveTo(M,O,j,W,B,z),F=B,L=z}}}})}function c_(t,e,r){if(!t||!e)return e;var n=r.done,i=r.during;B8(t,e),e.__morphT=0;function a(){_c(e,"buildPath"),_c(e,"updateTransform"),e.__morphT=-1,e.createPathProxy(),e.dirtyShape()}return e.animateTo({__morphT:1},Ke({during:function(o){e.dirtyShape(),i&&i(o)},done:function(){a(),n&&n()}},r)),e}function Due(t,e,r,n,i,a){var o=16;t=i===r?0:Math.round(32767*(t-r)/(i-r)),e=a===n?0:Math.round(32767*(e-n)/(a-n));for(var s=0,l,u=(1<<o)/2;u>0;u/=2){var f=0,c=0;(t&u)>0&&(f=1),(e&u)>0&&(c=1),s+=u*u*(3*f^c),c===0&&(f===1&&(t=u-1-t,e=u-1-e),l=t,t=e,e=l)}return s}function Mp(t){var e=1/0,r=1/0,n=-1/0,i=-1/0,a=Ce(t,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),f=l.x+l.width/2+(u?u[4]:0),c=l.y+l.height/2+(u?u[5]:0);return e=Math.min(f,e),r=Math.min(c,r),n=Math.max(f,n),i=Math.max(c,i),[f,c]}),o=Ce(a,function(s,l){return{cp:s,z:Due(s[0],s[1],e,r,n,i),path:t[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function I8(t){return yue(t.path,t.count)}function d_(){return{fromIndividuals:[],toIndividuals:[],count:0}}function Sue(t,e,r){var n=[];function i(_){for(var w=0;w<_.length;w++){var x=_[w];Tp(x)?i(x.childrenRef()):x instanceof Je&&n.push(x)}}i(t);var a=n.length;if(!a)return d_();var o=r.dividePath||I8,s=o({path:e,count:a});if(s.length!==a)return console.error("Invalid morphing: unmatched splitted path"),d_();n=Mp(n),s=Mp(s);for(var l=r.done,u=r.during,f=r.individualDelay,c=new hf,d=0;d<a;d++){var h=n[d],v=s[d];v.parent=e,v.copyTransform(c),f||B8(h,v)}e.__isCombineMorphing=!0,e.childrenRef=function(){return s};function g(_){for(var w=0;w<s.length;w++)s[w].addSelfToZr(_)}Op(e,"addSelfToZr",{after:function(_){g(_)}}),Op(e,"removeSelfFromZr",{after:function(_){for(var w=0;w<s.length;w++)s[w].removeSelfFromZr(_)}});function p(){e.__isCombineMorphing=!1,e.__morphT=-1,e.childrenRef=null,_c(e,"addSelfToZr"),_c(e,"removeSelfFromZr")}var m=s.length;if(f)for(var y=m,b=function(){y--,y===0&&(p(),l&&l())},d=0;d<m;d++){var C=f?Ke({delay:(r.delay||0)+f(d,m,n[d],s[d]),done:b},r):r;c_(n[d],s[d],C)}else e.__morphT=0,e.animateTo({__morphT:1},Ke({during:function(_){for(var w=0;w<m;w++){var x=s[w];x.__morphT=e.__morphT,x.dirtyShape()}u&&u(_)},done:function(){p();for(var _=0;_<t.length;_++)_c(t[_],"updateTransform");l&&l()}},r));return e.__zr&&g(e.__zr),{fromIndividuals:n,toIndividuals:s,count:m}}function Eue(t,e,r){var n=e.length,i=[],a=r.dividePath||I8;function o(h){for(var v=0;v<h.length;v++){var g=h[v];Tp(g)?o(g.childrenRef()):g instanceof Je&&i.push(g)}}if(Tp(t)){o(t.childrenRef());var s=i.length;if(s<n)for(var l=0,u=s;u<n;u++)i.push(hb(i[l++%s]));i.length=n}else{i=a({path:t,count:n});for(var f=t.getComputedTransform(),u=0;u<i.length;u++)i[u].setLocalTransform(f);if(i.length!==n)return console.error("Invalid morphing: unmatched splitted path"),d_()}i=Mp(i),e=Mp(e);for(var c=r.individualDelay,u=0;u<n;u++){var d=c?Ke({delay:(r.delay||0)+c(u,n,i[u],e[u])},r):r;c_(i[u],e[u],d)}return{fromIndividuals:i,toIndividuals:e,count:e.length}}function N8(t){return ve(t[0])}function L8(t,e){for(var r=[],n=t.length,i=0;i<n;i++)r.push({one:t[i],many:[]});for(var i=0;i<e.length;i++){var a=e[i].length,o=void 0;for(o=0;o<a;o++)r[o%n].many.push(e[i][o])}for(var s=0,i=n-1;i>=0;i--)if(!r[i].many.length){var l=r[s].many;if(l.length<=1)if(s)s=0;else return r;var a=l.length,u=Math.ceil(a/2);r[i].many=l.slice(u,a),r[s].many=l.slice(0,u),s++}return r}var Aue={clone:function(t){for(var e=[],r=1-Math.pow(1-t.path.style.opacity,1/t.count),n=0;n<t.count;n++){var i=hb(t.path);i.setStyle("opacity",r),e.push(i)}return e},split:null};function h_(t,e,r,n,i,a){if(!t.length||!e.length)return;var o=Nl("update",n,i);if(!(o&&o.duration>0))return;var s=n.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,f;N8(t)&&(u=t,f=e),N8(e)&&(u=e,f=t);function c(m,y,b,C,_){var w=m.many,x=m.one;if(w.length===1&&!_){var S=y?w[0]:x,E=y?x:w[0];if(Tp(S))c({many:[S],one:E},!0,b,C,!0);else{var T=s?Ke({delay:s(b,C)},l):l;c_(S,E,T),a(S,E,S,E,T)}}else for(var A=Ke({dividePath:Aue[r],individualDelay:s&&function(L,j,W,B){return s(L+b,C)}},l),M=y?Sue(w,x,A):Eue(x,w,A),O=M.fromIndividuals,P=M.toIndividuals,N=O.length,F=0;F<N;F++){var T=s?Ke({delay:s(F,N)},l):l;a(O[F],P[F],y?w[F]:m.one,y?m.one:w[F],T)}}for(var d=u?u===t:t.length>e.length,h=u?L8(f,u):L8(d?e:t,[d?t:e]),v=0,g=0;g<h.length;g++)v+=h[g].many.length;for(var p=0,g=0;g<h.length;g++)c(h[g],d,p,v),p+=h[g].many.length}function Os(t){if(!t)return[];if(ve(t)){for(var e=[],r=0;r<t.length;r++)e.push(Os(t[r]));return e}var n=[];return t.traverse(function(i){i instanceof Je&&!i.disableMorphing&&!i.invisible&&!i.ignore&&n.push(i)}),n}var F8=1e4,Tue=0,k8=1,j8=2,Oue=ht();function Mue(t,e){for(var r=t.dimensions,n=0;n<r.length;n++){var i=t.getDimensionInfo(r[n]);if(i&&i.otherDims[e]===0)return r[n]}}function Rue(t,e,r){var n=t.getDimensionInfo(r),i=n&&n.ordinalMeta;if(n){var a=t.get(n.name,e);return i&&i.categories[a]||a+""}}function z8(t,e,r,n){var i=n?"itemChildGroupId":"itemGroupId",a=Mue(t,i);if(a){var o=Rue(t,e,a);return o}var s=t.getRawDataItem(e),l=n?"childGroupId":"groupId";if(s&&s[l])return s[l]+"";if(!n)return r||t.getId(e)}function H8(t){var e=[];return H(t,function(r){var n=r.data,i=r.dataGroupId;if(n.count()>F8){process.env.NODE_ENV!=="production"&&Qt("Universal transition is disabled on large data > 10k.");return}for(var a=n.getIndices(),o=0;o<a.length;o++)e.push({data:n,groupId:z8(n,o,i,!1),childGroupId:z8(n,o,i,!0),divide:r.divide,dataIndex:o})}),e}function v_(t,e,r){t.traverse(function(n){n instanceof Je&&Or(n,{style:{opacity:0}},e,{dataIndex:r,isFrom:!0})})}function p_(t){if(t.parent){var e=t.getComputedTransform();t.setLocalTransform(e),t.parent.remove(t)}}function uu(t){t.stopAnimation(),t.isGroup&&t.traverse(function(e){e.stopAnimation()})}function Pue(t,e,r){var n=Nl("update",r,e);n&&t.traverse(function(i){if(i instanceof Fa){var a=gJ(i);a&&i.animateFrom({style:a},n)}})}function Bue(t,e){var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++){var i=t[n],a=e[n];if(i.data.getId(i.dataIndex)!==a.data.getId(a.dataIndex))return!1}return!0}function V8(t,e,r){var n=H8(t),i=H8(e);function a(b,C,_,w,x){(_||b)&&C.animateFrom({style:_&&_!==b?ue(ue({},_.style),b.style):b.style},x)}var o=!1,s=Tue,l=Ie(),u=Ie();n.forEach(function(b){b.groupId&&l.set(b.groupId,!0),b.childGroupId&&u.set(b.childGroupId,!0)});for(var f=0;f<i.length;f++){var c=i[f].groupId;if(u.get(c)){s=k8;break}var d=i[f].childGroupId;if(d&&l.get(d)){s=j8;break}}function h(b,C){return function(_){var w=_.data,x=_.dataIndex;return C?w.getId(x):b?s===k8?_.childGroupId:_.groupId:s===j8?_.childGroupId:_.groupId}}var v=Bue(n,i),g={};if(!v)for(var f=0;f<i.length;f++){var p=i[f],m=p.data.getItemGraphicEl(p.dataIndex);m&&(g[m.id]=!0)}function y(b,C){var _=n[C],w=i[b],x=w.data.hostModel,S=_.data.getItemGraphicEl(_.dataIndex),E=w.data.getItemGraphicEl(w.dataIndex);if(S===E){E&&Pue(E,w.dataIndex,x);return}S&&g[S.id]||E&&(uu(E),S?(uu(S),p_(S),o=!0,h_(Os(S),Os(E),w.divide,x,b,a)):v_(E,x,b))}new Pb(n,i,h(!0,v),h(!1,v),null,"multiple").update(y).updateManyToOne(function(b,C){var _=i[b],w=_.data,x=w.hostModel,S=w.getItemGraphicEl(_.dataIndex),E=Bt(Ce(C,function(T){return n[T].data.getItemGraphicEl(n[T].dataIndex)}),function(T){return T&&T!==S&&!g[T.id]});S&&(uu(S),E.length?(H(E,function(T){uu(T),p_(T)}),o=!0,h_(Os(E),Os(S),_.divide,x,b,a)):v_(S,x,_.dataIndex))}).updateOneToMany(function(b,C){var _=n[C],w=_.data.getItemGraphicEl(_.dataIndex);if(!(w&&g[w.id])){var x=Bt(Ce(b,function(E){return i[E].data.getItemGraphicEl(i[E].dataIndex)}),function(E){return E&&E!==w}),S=i[b[0]].data.hostModel;x.length&&(H(x,function(E){return uu(E)}),w?(uu(w),p_(w),o=!0,h_(Os(w),Os(x),_.divide,S,b[0],a)):H(x,function(E){return v_(E,S,b[0])}))}}).updateManyToMany(function(b,C){new Pb(C,b,function(_){return n[_].data.getId(n[_].dataIndex)},function(_){return i[_].data.getId(i[_].dataIndex)}).update(function(_,w){y(b[_],C[w])}).execute()}).execute(),o&&H(e,function(b){var C=b.data,_=C.hostModel,w=_&&r.getViewOfSeriesModel(_),x=Nl("update",_,0);w&&_.isAnimationEnabled()&&x&&x.duration>0&&w.group.traverse(function(S){S instanceof Je&&!S.animators.length&&S.animateFrom({style:{opacity:0}},x)})})}function W8(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function $8(t){return ve(t)?t.sort().join(","):t}function io(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function Iue(t,e){var r=Ie(),n=Ie(),i=Ie();H(t.oldSeries,function(o,s){var l=t.oldDataGroupIds[s],u=t.oldData[s],f=W8(o),c=$8(f);n.set(c,{dataGroupId:l,data:u}),ve(f)&&H(f,function(d){i.set(d,{key:c,dataGroupId:l,data:u})})});function a(o){r.get(o)&&Qt("Duplicated seriesKey in universalTransition "+o)}return H(e.updatedSeries,function(o){if(o.isUniversalTransitionEnabled()&&o.isAnimationEnabled()){var s=o.get("dataGroupId"),l=o.getData(),u=W8(o),f=$8(u),c=n.get(f);if(c)process.env.NODE_ENV!=="production"&&a(f),r.set(f,{oldSeries:[{dataGroupId:c.dataGroupId,divide:io(c.data),data:c.data}],newSeries:[{dataGroupId:s,divide:io(l),data:l}]});else if(ve(u)){process.env.NODE_ENV!=="production"&&a(f);var d=[];H(u,function(g){var p=n.get(g);p.data&&d.push({dataGroupId:p.dataGroupId,divide:io(p.data),data:p.data})}),d.length&&r.set(f,{oldSeries:d,newSeries:[{dataGroupId:s,data:l,divide:io(l)}]})}else{var h=i.get(u);if(h){var v=r.get(h.key);v||(v={oldSeries:[{dataGroupId:h.dataGroupId,data:h.data,divide:io(h.data)}],newSeries:[]},r.set(h.key,v)),v.newSeries.push({dataGroupId:s,data:l,divide:io(l)})}}}}),r}function G8(t,e){for(var r=0;r<t.length;r++){var n=e.seriesIndex!=null&&e.seriesIndex===t[r].seriesIndex||e.seriesId!=null&&e.seriesId===t[r].id;if(n)return r}}function Nue(t,e,r,n){var i=[],a=[];H(It(t.from),function(o){var s=G8(e.oldSeries,o);s>=0&&i.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:io(e.oldData[s]),groupIdDim:o.dimension})}),H(It(t.to),function(o){var s=G8(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:io(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&V8(i,a,n)}function Lue(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){H(It(n.seriesTransition),function(i){H(It(i.to),function(a){for(var o=n.updatedSeries,s=0;s<o.length;s++)(a.seriesIndex!=null&&a.seriesIndex===o[s].seriesIndex||a.seriesId!=null&&a.seriesId===o[s].id)&&(o[s][Iv]=!0)})})}),t.registerUpdateLifecycle("series:transition",function(e,r,n){var i=Oue(r);if(i.oldSeries&&n.updatedSeries&&n.optionChanged){var a=n.seriesTransition;if(a)H(It(a),function(h){Nue(h,i,n,r)});else{var o=Iue(i,n);H(o.keys(),function(h){var v=o.get(h);V8(v.oldSeries,v.newSeries,r)})}H(n.updatedSeries,function(h){h[Iv]&&(h[Iv]=!1)})}for(var s=e.getSeries(),l=i.oldSeries=[],u=i.oldDataGroupIds=[],f=i.oldData=[],c=0;c<s.length;c++){var d=s[c].getData();d.count()<F8&&(l.push(s[c]),u.push(s[c].get("dataGroupId")),f.push(d))}})}function U8(t,e,r){var n=qi.createCanvas(),i=e.getWidth(),a=e.getHeight(),o=n.style;return o&&(o.position="absolute",o.left="0",o.top="0",o.width=i+"px",o.height=a+"px",n.setAttribute("data-zr-dom-id",t)),n.width=i*r,n.height=a*r,n}var g_=function(t){he(e,t);function e(r,n,i){var a=t.call(this)||this;a.motionBlur=!1,a.lastFrameAlpha=.7,a.dpr=1,a.virtual=!1,a.config={},a.incremental=!1,a.zlevel=0,a.maxRepaintRectCount=5,a.__dirty=!0,a.__firstTimePaint=!0,a.__used=!1,a.__drawIndex=0,a.__startIndex=0,a.__endIndex=0,a.__prevStartIndex=null,a.__prevEndIndex=null;var o;i=i||Rh,typeof r=="string"?o=U8(r,n,i):Se(r)&&(o=r,r=o.id),a.id=r,a.dom=o;var s=o.style;return s&&(i2(o),o.onselectstart=function(){return!1},s.padding="0",s.margin="0",s.borderWidth="0"),a.painter=n,a.dpr=i,a}return e.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},e.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},e.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},e.prototype.setUnpainted=function(){this.__firstTimePaint=!0},e.prototype.createBackBuffer=function(){var r=this.dpr;this.domBack=U8("back-"+this.id,this.painter,r),this.ctxBack=this.domBack.getContext("2d"),r!==1&&this.ctxBack.scale(r,r)},e.prototype.createRepaintRects=function(r,n,i,a){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var o=[],s=this.maxRepaintRectCount,l=!1,u=new ke(0,0,0,0);function f(y){if(!(!y.isFinite()||y.isZero()))if(o.length===0){var b=new ke(0,0,0,0);b.copy(y),o.push(b)}else{for(var C=!1,_=1/0,w=0,x=0;x<o.length;++x){var S=o[x];if(S.intersect(y)){var E=new ke(0,0,0,0);E.copy(S),E.union(y),o[x]=E,C=!0;break}else if(l){u.copy(y),u.union(S);var T=y.width*y.height,A=S.width*S.height,M=u.width*u.height,O=M-T-A;O<_&&(_=O,w=x)}}if(l&&(o[w].union(y),C=!0),!C){var b=new ke(0,0,0,0);b.copy(y),o.push(b)}l||(l=o.length>=s)}}for(var c=this.__startIndex;c<this.__endIndex;++c){var d=r[c];if(d){var h=d.shouldBePainted(i,a,!0,!0),v=d.__isRendered&&(d.__dirty&vn||!h)?d.getPrevPaintRect():null;v&&f(v);var g=h&&(d.__dirty&vn||!d.__isRendered)?d.getPaintRect():null;g&&f(g)}}for(var c=this.__prevStartIndex;c<this.__prevEndIndex;++c){var d=n[c],h=d&&d.shouldBePainted(i,a,!0,!0);if(d&&(!h||!d.__zr)&&d.__isRendered){var v=d.getPrevPaintRect();v&&f(v)}}var p;do{p=!1;for(var c=0;c<o.length;){if(o[c].isZero()){o.splice(c,1);continue}for(var m=c+1;m<o.length;)o[c].intersect(o[m])?(p=!0,o[c].union(o[m]),o.splice(m,1)):m++;c++}}while(p);return this._paintRects=o,o},e.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},e.prototype.resize=function(r,n){var i=this.dpr,a=this.dom,o=a.style,s=this.domBack;o&&(o.width=r+"px",o.height=n+"px"),a.width=r*i,a.height=n*i,s&&(s.width=r*i,s.height=n*i,i!==1&&this.ctxBack.scale(i,i))},e.prototype.clear=function(r,n,i){var a=this.dom,o=this.ctx,s=a.width,l=a.height;n=n||this.clearColor;var u=this.motionBlur&&!r,f=this.lastFrameAlpha,c=this.dpr,d=this;u&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(a,0,0,s/c,l/c));var h=this.domBack;function v(g,p,m,y){if(o.clearRect(g,p,m,y),n&&n!=="transparent"){var b=void 0;if(uh(n)){var C=n.global||n.__width===m&&n.__height===y;b=C&&n.__canvasGradient||nC(o,n,{x:0,y:0,width:m,height:y}),n.__canvasGradient=b,n.__width=m,n.__height=y}else hZ(n)&&(n.scaleX=n.scaleX||c,n.scaleY=n.scaleY||c,b=iC(o,n,{dirty:function(){d.setUnpainted(),d.painter.refresh()}}));o.save(),o.fillStyle=b||n,o.fillRect(g,p,m,y),o.restore()}u&&(o.save(),o.globalAlpha=f,o.drawImage(h,g,p,m,y),o.restore())}!i||u?v(0,0,s,l):i.length&&H(i,function(g){v(g.x*c,g.y*c,g.width*c,g.height*c)})},e}(Si),Y8=1e5,Ms=314159,Rp=.01,Fue=.001;function kue(t){return t?t.__builtin__?!0:!(typeof t.resize!="function"||typeof t.refresh!="function"):!1}function jue(t,e){var r=document.createElement("div");return r.style.cssText=["position:relative","width:"+t+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",r}var zue=function(){function t(e,r,n,i){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var a=!e.nodeName||e.nodeName.toUpperCase()==="CANVAS";this._opts=n=ue({},n||{}),this.dpr=n.devicePixelRatio||Rh,this._singleCanvas=a,this.root=e;var o=e.style;o&&(i2(e),e.innerHTML=""),this.storage=r;var s=this._zlevelList;this._prevDisplayList=[];var l=this._layers;if(a){var f=e,c=f.width,d=f.height;n.width!=null&&(c=n.width),n.height!=null&&(d=n.height),this.dpr=n.devicePixelRatio||1,f.width=c*this.dpr,f.height=d*this.dpr,this._width=c,this._height=d;var h=new g_(f,this,this.dpr);h.__builtin__=!0,h.initContext(),l[Ms]=h,h.zlevel=Ms,s.push(Ms),this._domRoot=e}else{this._width=Qv(e,0,n),this._height=Qv(e,1,n);var u=this._domRoot=jue(this._width,this._height);e.appendChild(u)}}return t.prototype.getType=function(){return"canvas"},t.prototype.isSingleCanvas=function(){return this._singleCanvas},t.prototype.getViewportRoot=function(){return this._domRoot},t.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},t.prototype.refresh=function(e){var r=this.storage.getDisplayList(!0),n=this._prevDisplayList,i=this._zlevelList;this._redrawId=Math.random(),this._paintList(r,n,e,this._redrawId);for(var a=0;a<i.length;a++){var o=i[a],s=this._layers[o];if(!s.__builtin__&&s.refresh){var l=a===0?this._backgroundColor:null;s.refresh(l)}}return this._opts.useDirtyRect&&(this._prevDisplayList=r.slice()),this},t.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},t.prototype._paintHoverList=function(e){var r=e.length,n=this._hoverlayer;if(n&&n.clear(),!!r){for(var i={inHover:!0,viewWidth:this._width,viewHeight:this._height},a,o=0;o<r;o++){var s=e[o];s.__inHover&&(n||(n=this._hoverlayer=this.getLayer(Y8)),a||(a=n.ctx,a.save()),Ds(a,s,i,o===r-1))}a&&a.restore()}},t.prototype.getHoverLayer=function(){return this.getLayer(Y8)},t.prototype.paintOne=function(e,r){oI(e,r)},t.prototype._paintList=function(e,r,n,i){if(this._redrawId===i){n=n||!1,this._updateLayerStatus(e);var a=this._doPaintList(e,r,n),o=a.finished,s=a.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),s&&this._paintHoverList(e),o)this.eachLayer(function(u){u.afterBrush&&u.afterBrush()});else{var l=this;Gv(function(){l._paintList(e,r,n,i)})}}},t.prototype._compositeManually=function(){var e=this.getLayer(Ms).ctx,r=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,r,n),this.eachBuiltinLayer(function(i){i.virtual&&e.drawImage(i.dom,0,0,r,n)})},t.prototype._doPaintList=function(e,r,n){for(var i=this,a=[],o=this._opts.useDirtyRect,s=0;s<this._zlevelList.length;s++){var l=this._zlevelList[s],u=this._layers[l];u.__builtin__&&u!==this._hoverlayer&&(u.__dirty||n)&&a.push(u)}for(var f=!0,c=!1,d=function(g){var p=a[g],m=p.ctx,y=o&&p.createRepaintRects(e,r,h._width,h._height),b=n?p.__startIndex:p.__drawIndex,C=!n&&p.incremental&&Date.now,_=C&&Date.now(),w=p.zlevel===h._zlevelList[0]?h._backgroundColor:null;if(p.__startIndex===p.__endIndex)p.clear(!1,w,y);else if(b===p.__startIndex){var x=e[b];(!x.incremental||!x.notClear||n)&&p.clear(!1,w,y)}b===-1&&(console.error("For some unknown reason. drawIndex is -1"),b=p.__startIndex);var S,E=function(O){var P={inHover:!1,allClipped:!1,prevEl:null,viewWidth:i._width,viewHeight:i._height};for(S=b;S<p.__endIndex;S++){var N=e[S];if(N.__inHover&&(c=!0),i._doPaintEl(N,p,o,O,P,S===p.__endIndex-1),C){var F=Date.now()-_;if(F>15)break}}P.prevElClipPaths&&m.restore()};if(y)if(y.length===0)S=p.__endIndex;else for(var T=h.dpr,A=0;A<y.length;++A){var M=y[A];m.save(),m.beginPath(),m.rect(M.x*T,M.y*T,M.width*T,M.height*T),m.clip(),E(M),m.restore()}else m.save(),E(),m.restore();p.__drawIndex=S,p.__drawIndex<p.__endIndex&&(f=!1)},h=this,v=0;v<a.length;v++)d(v);return Fe.wxa&&H(this._layers,function(g){g&&g.ctx&&g.ctx.draw&&g.ctx.draw()}),{finished:f,needsRefreshHover:c}},t.prototype._doPaintEl=function(e,r,n,i,a,o){var s=r.ctx;if(n){var l=e.getPaintRect();(!i||l&&l.intersect(i))&&(Ds(s,e,a,o),e.setPrevPaintRect(l))}else Ds(s,e,a,o)},t.prototype.getLayer=function(e,r){this._singleCanvas&&!this._needsManuallyCompositing&&(e=Ms);var n=this._layers[e];return n||(n=new g_("zr_"+e,this,this.dpr),n.zlevel=e,n.__builtin__=!0,this._layerConfig[e]?dt(n,this._layerConfig[e],!0):this._layerConfig[e-Rp]&&dt(n,this._layerConfig[e-Rp],!0),r&&(n.virtual=r),this.insertLayer(e,n),n.initContext()),n},t.prototype.insertLayer=function(e,r){var n=this._layers,i=this._zlevelList,a=i.length,o=this._domRoot,s=null,l=-1;if(n[e]){process.env.NODE_ENV!=="production"&&Ho("ZLevel "+e+" has been used already");return}if(!kue(r)){process.env.NODE_ENV!=="production"&&Ho("Layer of zlevel "+e+" is not valid");return}if(a>0&&e>i[0]){for(l=0;l<a-1&&!(i[l]<e&&i[l+1]>e);l++);s=n[i[l]]}if(i.splice(l+1,0,e),n[e]=r,!r.virtual)if(s){var u=s.dom;u.nextSibling?o.insertBefore(r.dom,u.nextSibling):o.appendChild(r.dom)}else o.firstChild?o.insertBefore(r.dom,o.firstChild):o.appendChild(r.dom);r.painter||(r.painter=this)},t.prototype.eachLayer=function(e,r){for(var n=this._zlevelList,i=0;i<n.length;i++){var a=n[i];e.call(r,this._layers[a],a)}},t.prototype.eachBuiltinLayer=function(e,r){for(var n=this._zlevelList,i=0;i<n.length;i++){var a=n[i],o=this._layers[a];o.__builtin__&&e.call(r,o,a)}},t.prototype.eachOtherLayer=function(e,r){for(var n=this._zlevelList,i=0;i<n.length;i++){var a=n[i],o=this._layers[a];o.__builtin__||e.call(r,o,a)}},t.prototype.getLayers=function(){return this._layers},t.prototype._updateLayerStatus=function(e){this.eachBuiltinLayer(function(c,d){c.__dirty=c.__used=!1});function r(c){a&&(a.__endIndex!==c&&(a.__dirty=!0),a.__endIndex=c)}if(this._singleCanvas)for(var n=1;n<e.length;n++){var i=e[n];if(i.zlevel!==e[n-1].zlevel||i.incremental){this._needsManuallyCompositing=!0;break}}var a=null,o=0,s,l;for(l=0;l<e.length;l++){var i=e[l],u=i.zlevel,f=void 0;s!==u&&(s=u,o=0),i.incremental?(f=this.getLayer(u+Fue,this._needsManuallyCompositing),f.incremental=!0,o=1):f=this.getLayer(u+(o>0?Rp:0),this._needsManuallyCompositing),f.__builtin__||Ho("ZLevel "+u+" has been used by unkown layer "+f.id),f!==a&&(f.__used=!0,f.__startIndex!==l&&(f.__dirty=!0),f.__startIndex=l,f.incremental?f.__drawIndex=-1:f.__drawIndex=l,r(l),a=f),i.__dirty&vn&&!i.__inHover&&(f.__dirty=!0,f.incremental&&f.__drawIndex<0&&(f.__drawIndex=l))}r(l),this.eachBuiltinLayer(function(c,d){!c.__used&&c.getElementCount()>0&&(c.__dirty=!0,c.__startIndex=c.__endIndex=c.__drawIndex=0),c.__dirty&&c.__drawIndex<0&&(c.__drawIndex=c.__startIndex)})},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(e){e.clear()},t.prototype.setBackgroundColor=function(e){this._backgroundColor=e,H(this._layers,function(r){r.setUnpainted()})},t.prototype.configLayer=function(e,r){if(r){var n=this._layerConfig;n[e]?dt(n[e],r,!0):n[e]=r;for(var i=0;i<this._zlevelList.length;i++){var a=this._zlevelList[i];if(a===e||a===e+Rp){var o=this._layers[a];dt(o,n[e],!0)}}}},t.prototype.delLayer=function(e){var r=this._layers,n=this._zlevelList,i=r[e];i&&(i.dom.parentNode.removeChild(i.dom),delete r[e],n.splice(Qe(n,e),1))},t.prototype.resize=function(e,r){if(this._domRoot.style){var n=this._domRoot;n.style.display="none";var i=this._opts,a=this.root;if(e!=null&&(i.width=e),r!=null&&(i.height=r),e=Qv(a,0,i),r=Qv(a,1,i),n.style.display="",this._width!==e||r!==this._height){n.style.width=e+"px",n.style.height=r+"px";for(var o in this._layers)this._layers.hasOwnProperty(o)&&this._layers[o].resize(e,r);this.refresh(!0)}this._width=e,this._height=r}else{if(e==null||r==null)return;this._width=e,this._height=r,this.getLayer(Ms).resize(e,r)}return this},t.prototype.clearLayer=function(e){var r=this._layers[e];r&&r.clear()},t.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},t.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[Ms].dom;var r=new g_("image",this,e.pixelRatio||this.dpr);r.initContext(),r.clear(!1,e.backgroundColor||this._backgroundColor);var n=r.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var i=r.dom.width,a=r.dom.height;this.eachLayer(function(c){c.__builtin__?n.drawImage(c.dom,0,0,i,a):c.renderToCanvas&&(n.save(),c.renderToCanvas(n),n.restore())})}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},s=this.storage.getDisplayList(!0),l=0,u=s.length;l<u;l++){var f=s[l];Ds(n,f,o,l===u-1)}return r.dom},t.prototype.getWidth=function(){return this._width},t.prototype.getHeight=function(){return this._height},t}();function Hue(t){t.registerPainter("canvas",zue)}Qa([ule,Vle,Ple,Ole,ele,iue,tue,Zre,Tre,wne,uue,Lue,Hue]);const Vue=I.memo(({options:t,echartRef:e})=>{const r=I.useRef(null),n=I.useRef(null);return I.useEffect(()=>(r.current&&(n.current=Eae(r.current),window.__chartInstanceRef=n),()=>{n.current&&n.current.dispose()}),[]),I.useEffect(()=>{n.current&&(n.current.clear(),t&&Object.keys(t).length>0&&n.current.setOption({...t}))},[t]),I.useImperativeHandle(e,()=>({resize:()=>{n.current&&n.current.resize()},getWidth:()=>{n.current&&n.current.getWidth()}})),D.jsx("div",{ref:r,style:{width:"100%",height:"100%"}})}),Wue=()=>D.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:139,height:118,fill:"none",children:[D.jsx("path",{fill:"#F4F4F5",d:"M124.987 58.727c0 13.227-4.202 25.657-11.204 35.463-3.879 5.36-8.511 10.035-13.898 13.684-8.618 6.044-19.068 9.465-30.164 9.465-30.488.114-55.266-26.113-55.266-58.612C14.455 26.34 39.125 0 69.721 0c11.096 0 21.438 3.421 30.164 9.465 5.387 3.649 10.019 8.324 13.898 13.683 7.002 9.921 11.204 22.237 11.204 35.579Z"}),D.jsx("path",{stroke:"#D0D0D4",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,strokeWidth:2,d:"M2 102.569h130.77"}),D.jsx("path",{fill:"#fff",stroke:"#D0D0D4",strokeMiterlimit:10,strokeWidth:2,d:"M93.85 50.054v52.515H23.22c-2.786 0-4.875-2.36-4.875-5.163V50.054H93.85Z"}),D.jsx("path",{fill:"#DAE1ED",d:"M121.874 50.054v47.352c0 2.95-2.323 5.163-5.082 5.163h-22.94V50.054h28.022Z"}),D.jsx("path",{fill:"#F4F4F5",stroke:"#D0D0D4",strokeMiterlimit:10,strokeWidth:2,d:"M121.874 50.054v47.352c0 2.95-2.323 5.163-5.082 5.163h-22.94V50.054h28.022Z"}),D.jsx("path",{fill:"#C5CDDB",d:"m45.59 50.054 14.852-24.617h76.22L121.39 50.055h-75.8Z"}),D.jsx("path",{fill:"#F4F4F5",stroke:"#D0D0D4",strokeMiterlimit:10,strokeWidth:2,d:"m45.59 50.054 14.852-24.617h76.22L121.39 50.055h-75.8Z"}),D.jsx("path",{fill:"url(#a)",d:"M121.874 50.197v27.756h-20.433c-1.898 0-3.211-1.295-3.503-3.164l-4.086-24.735 28.022.143Z",opacity:.3}),D.jsx("path",{fill:"#fff",stroke:"#D0D0D4",strokeMiterlimit:10,strokeWidth:2,d:"M121.287 50.054H93.852l13.93 22.258c.995 1.474 2.559 2.358 4.123 2.358h21.322c1.422 0 2.417-1.769 1.564-2.948l-13.504-21.668ZM93.85 50.054 78.895 25.437H2l15.52 24.617h76.33Z"}),D.jsx("path",{fill:"#D0D0D4",d:"M56.028 80.415H26.59a1.23 1.23 0 0 1-1.238-1.231c0-.684.55-1.23 1.238-1.23h29.438a1.23 1.23 0 0 1 1.238 1.23c-.138.684-.55 1.23-1.238 1.23ZM56.028 86.159H26.59c-.688 0-1.238-.365-1.238-.82 0-.457.55-.821 1.238-.821h29.438c.687 0 1.238.364 1.238.82-.138.456-.55.82-1.238.82ZM40.44 92.723H26.61c-.699 0-1.257-.365-1.257-.82 0-.456.558-.821 1.257-.821H40.44c.699 0 1.258.365 1.258.82-.14.456-.699.821-1.258.821Z"}),D.jsx("defs",{children:D.jsxs("linearGradient",{id:"a",x1:107.869,x2:107.869,y1:78.525,y2:53.113,gradientUnits:"userSpaceOnUse",children:[D.jsx("stop",{offset:.003,stopColor:"#606673",stopOpacity:0}),D.jsx("stop",{offset:1,stopColor:"#AAB2C5"})]})})]}),q8=t=>{const{t:e}=At();return D.jsxs("div",{style:{color:"#A1A1AA",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[D.jsx(Wue,{}),D.jsx("span",{children:e("empty")})]})};q8.displayName="Empty";const $ue=t=>{const{type:e,categories:r}=t;return{"chart-bar":{xAxis:{type:"category",data:r},yAxis:{type:"value"}},"chart-bar-pile":{xAxis:{type:"category",data:r},yAxis:{type:"value"}},"chart-bar-percentage":{xAxis:{type:"category",data:r},yAxis:{type:"value",max:100,axisLabel:{formatter:"{value} %"}}},"chart-line":{xAxis:{type:"category",data:r},yAxis:{type:"value"}},"chart-line-smooth":{xAxis:{type:"category",data:r},yAxis:{type:"value"}},"chart-pie":{xAxis:{show:!1},yAxis:{show:!1}},"chart-pie-circular":{xAxis:{show:!1},yAxis:{show:!1}},"chart-strip-bar":{xAxis:{type:"value"},yAxis:{type:"category",data:r}},"chart-strip-bar-pile":{xAxis:{type:"value"},yAxis:{type:"category",data:r}},"chart-strip-bar-percentage":{xAxis:{type:"value",max:100,axisLabel:{formatter:"{value} %"}},yAxis:{type:"category",data:r}},[Lr.chartCombination]:{xAxis:{type:"category",data:r},yAxis:{type:"value"}}}[e]},X8=({type:t,data:e,label:r,name:n,isGroup:i,groupField:a,labels:o})=>{let s;return t==="chart-pie"?s={data:e.map((l,u)=>({value:l,name:o[u]})),name:n,type:"pie",radius:"50%",label:{...r,position:"outside"},labelLine:{normal:{show:!0}}}:t==="chart-pie-circular"?s={data:e.map((l,u)=>({value:l,name:o[u]})),type:"pie",name:n,radius:["40%","70%"],label:{...r,position:"outside"},labelLine:{normal:{show:!0}}}:t==="chart-line"?s={data:e,name:n,type:"line",label:r}:t==="chart-line-smooth"?s={data:e,name:n,type:"line",smooth:!0,label:r}:s={data:e,name:n,type:"bar",label:r},(t==="chart-bar-percentage"||t==="chart-bar-pile"||t==="chart-strip-bar-pile"||t==="chart-strip-bar-percentage")&&i&&a&&(s.stack=a),s},Gue=({customeStyle:t,series:e,chartConfig:r,width:n})=>{var C,_,w,x;const{isLeftAxisShow:i,isRightAxisShow:a,maxLeftSeriesDataStrLen:o,maxRightSeriesDataStrLen:s,maxSeriesDataLen:l}=e.reduce((S,E)=>{var O;let T={...S},A=E.yAxisIndex==0?"left":"right",M=Math.max(...E.data.map(P=>String(P).length));return A=="left"?(T.maxLeftSeriesDataStrLen=Math.max(T.maxLeftSeriesDataStrLen,M),T.isLeftAxisShow=!0):(T.maxRightSeriesDataStrLen=Math.max(T.maxRightSeriesDataStrLen,M),T.isRightAxisShow=!0),T.maxSeriesDataLen=Math.max(T.maxSeriesDataLen,(O=E==null?void 0:E.data)==null?void 0:O.length),T},{isLeftAxisShow:!1,isRightAxisShow:!1,maxLeftSeriesDataStrLen:0,maxRightSeriesDataStrLen:0,maxSeriesDataLen:0});let u=((C=r==null?void 0:r.xAxis)==null?void 0:C.type)==="category"?"xAxis":"yAxis";const c=(x=(u==="xAxis"?(_=r==null?void 0:r.xAxis)==null?void 0:_.data:(w=r==null?void 0:r.yAxis)==null?void 0:w.data)??[])==null?void 0:x.reduce((S,E)=>{const T=String(E).length;return Math.max(S,T)},0),d=9,h=12;let v=45,g=0,p=0,m=0,y=0;if(u=="xAxis"){const S={45:d*.8,90:d,0:d};l>3&&(c>=15&&(y=90),c>5&&(y=45),n<3&&(y=90)),m=S[`${y}`]*(y==0?1:Math.min(c,18))+h,g=Math.min(o,18)*d+h,p=Math.min(s,18)*d+h}else m=Math.min(o,18)*d+h,g=Math.min(c,18)*d+h,p=h;g=Math.max(g,40),p=Math.max(p,40),i||(g=h),a||(p=h);let b=d;return t!=null&&t.xtitle&&(u=="xAxis"?m=m+b:p=p+b),t!=null&&t.ytitle&&(u=="xAxis"?g=g+b:v=v+b),{top:v+"px",left:g+"px",right:p+"px",bottom:Math.max(m,40)+"px",axisLabelRotate:y}},Uue=({moduleDataApi:t,customData:e,customeStyle:r,width:n=2,height:i=2})=>{const{globalData:a,globalFilterCondition:o}=dn();let s=I.useMemo(()=>o==null?void 0:o.find(w=>(w==null?void 0:w.dataSourceId)===(e==null?void 0:e.dataSourceId)),[o,e==null?void 0:e.dataSourceId]);const[l,u]=I.useState(),[f,c]=I.useState(),d=Tt(async()=>{var _,w,x;if(u([]),e){c(!0);let S="";const E=(e==null?void 0:e.xAxis)==="tags"?"tag":e==null?void 0:e.xAxis,T=(e==null?void 0:e.groupField)==="tags"?"tag":e==null?void 0:e.groupField;e.isGroup?(e.yAxis==="recordTotal"&&(S+=`select=${E},${T},id.count()`),e.yAxis==="fieldValue"&&(e!=null&&e.yAxisField)&&(S+=`select=${E},${T},${e==null?void 0:e.yAxisField}.${e==null?void 0:e.yAxisFieldType}()`)):(e.yAxis==="recordTotal"&&(S+=`select=${E},id.count()`),e.yAxis==="fieldValue"&&(e!=null&&e.yAxisField)&&(S+=`select=${E},${e==null?void 0:e.yAxisField}.${e==null?void 0:e.yAxisFieldType}()`));let A=[];if((((_=s==null?void 0:s.conditionList)==null?void 0:_.length)??0)>0&&A.push(s),(((x=(w=e==null?void 0:e.conditionData)==null?void 0:w.conditionList)==null?void 0:x.length)??0)>0&&A.push(e==null?void 0:e.conditionData),A.length>0){let M=Qd(A);S+=M?`&${M}`:""}e!=null&&e.dataSourceId&&(t==null||t({id:e==null?void 0:e.dataSourceId,query:S}).then(M=>{if(!M.success){Z.message.error(M.message);return}u(M.data)}).finally(()=>{c(!1)}))}else u([])});_9(()=>{e&&d()},[e==null?void 0:e.dataSourceId,e==null?void 0:e.conditionData,e==null?void 0:e.sortField,e==null?void 0:e.sortOrder,e==null?void 0:e.xAxis,e==null?void 0:e.yAxis,e==null?void 0:e.yAxisField,e==null?void 0:e.yAxisFieldType,e==null?void 0:e.isGroup,e==null?void 0:e.groupField,s],{wait:60});const h=I.useMemo(()=>{var w,x;return(x=(w=a==null?void 0:a.sourceData)==null?void 0:w.find(S=>S.value===(e==null?void 0:e.dataSourceId)))==null?void 0:x.fields},[a,e==null?void 0:e.dataSourceId]),v=I.useMemo(()=>e&&l&&e.type&&l.length>0?(w=>{var De,Oe,lt,qt,Ue,St,Rr,at,yt,Pr,lr,Br,_n,Cr;const x=({item:de,field:Be,timeGroupInterval:$e})=>nf({fieldOptions:h,val:de[Be],field:Be,fieldMap:a==null?void 0:a.fieldMap,timeGroupInterval:$e}),S=de=>{const Be=h==null?void 0:h.find($e=>$e.value===de);return Be==null?void 0:Be.label},E=de=>{var Be;return((Be=h==null?void 0:h.find($e=>$e.value===de))==null?void 0:Be.type)==="timestamp"},T={tags:"tag"},A=T[e==null?void 0:e.xAxis]??(e==null?void 0:e.xAxis),M=T[e==null?void 0:e.groupField]??(e==null?void 0:e.groupField);console.log("newGroupField",M);let O=HW(w,de=>x({item:de,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval})),P=Object.keys(O).map(de=>O[de].reduce((tt,Rt)=>(Object.keys(Rt).forEach(_r=>{let ii=Rt[_r];US(ii)?tt[_r]=tt!=null&&tt[_r]?tt[_r]+ii:ii:tt[_r]=ii}),tt),{}));const N=new Set,F=new Set,L={},j={};P.forEach(de=>{const Be=x({item:de,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval}),$e=e.yAxis==="recordTotal"?de==null?void 0:de.count:de[e==null?void 0:e.yAxisFieldType]||0,tt=Be??U0("unknown");j[tt]=$e}),e!=null&&e.isGroup&&(e!=null&&e.groupField)&&w.forEach(de=>{const Be=x({item:de,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval}),$e=e.yAxis==="recordTotal"?de==null?void 0:de.count:de[e==null?void 0:e.yAxisFieldType]||0,tt=x({item:de,field:M}),Rt=Be??U0("unknown");F.add(tt),L[tt]||(L[tt]={}),L[tt][Rt]=$e}),console.log("test",{groupData:O,categories:N,stackCategories:F,valueGroups:L,valueCounts:j});const W={},B={};if(e!=null&&e.isGroup&&(e!=null&&e.groupField)){const de={};Object.keys(L).forEach(Be=>{Object.entries(L[Be]).forEach(([$e,tt])=>{de[$e]=(de[$e]||0)+tt})}),Object.keys(L).forEach(Be=>{B[Be]={},Object.entries(L[Be]).forEach(([$e,tt])=>{const Rt=de[$e]||1;B[Be][$e]=tt/Rt*100})})}else Object.entries(j).forEach(([de,Be])=>{const $e=Be||1;W[de]=Be/$e*100});let z=(e==null?void 0:e.sortField)??"xAxis",Y=(e==null?void 0:e.sortOrder)??"asc";const ee=[...P].sort((de,Be)=>{let $e,tt;switch(z){case"xAxis":$e=x({item:de,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval}),tt=x({item:Be,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval});break;case"yAxisField":$e=e.yAxis==="recordTotal"?de==null?void 0:de.count:de[e==null?void 0:e.yAxisFieldType]||0,tt=e.yAxis==="recordTotal"?Be==null?void 0:Be.count:Be[e==null?void 0:e.yAxisFieldType]||0;break}const Rt=Y==="asc"?1:-1;return $e>tt?1*Rt:$e<tt?-1*Rt:0}).map(de=>x({item:de,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval}));if(N.clear(),ee.forEach(de=>N.add(de)),!E(e==null?void 0:e.xAxis)&&e.displayRange!=="ALL"&&e.displayRange){let de=Array.from(N).sort((Rt,_r)=>j[_r]-j[Rt]),Be=[],[$e,tt]=e.displayRange.split("_");$e==="TOP"?Be=de.slice(0,Number(tt)):Be=de.slice(-Number(tt)),Array.from(N).forEach(Rt=>(Be.includes(Rt)||N.delete(Rt),Rt))}const te=de=>e!=null&&e.isGroup&&(e!=null&&e.groupField)?(de==null?void 0:de.value)==0?"":`${de==null?void 0:de.value}`:`${de==null?void 0:de.value}`,V={show:(De=e==null?void 0:e.chartOptions)==null?void 0:De.includes("label"),position:"top",formatter:te},J=Array.from(N),G=Array.from(F),k=[],Q=$ue({type:e==null?void 0:e.type,categories:J}),K=de=>US(de)?Math.floor(de*100)/100:de;if(e!=null&&e.isGroup&&(e!=null&&e.groupField))G.forEach(de=>{var _r,ii;const Be=["chart-bar-percentage","chart-strip-bar-percentage"].includes(e.type)?J.map(Ir=>K(B[de][Ir]||0)):J.map(Ir=>K(L[de][Ir]||0));let $e=e.type,tt="left";if($e==Lr.chartCombination){let Ir=((e==null?void 0:e.groupFieldConfig)??[]).find(ho=>x({item:{[M]:ho==null?void 0:ho.value},field:M})==de);$e=((_r=Ir==null?void 0:Ir.config)==null?void 0:_r.chartType)??Lr.ChartBar,tt=((ii=Ir==null?void 0:Ir.config)==null?void 0:ii.yAxisPos)??"left"}let Rt=X8({type:$e,data:Be,label:V,name:de,isGroup:e==null?void 0:e.isGroup,groupField:e==null?void 0:e.groupField,labels:J});Rt.yAxisIndex=tt=="left"?0:1,k.push(Rt)});else{const de=["chart-bar-percentage","chart-strip-bar-percentage"].includes(e.type)?J.map(Rt=>{var _r;return K(((_r=W[Rt])==null?void 0:_r.toFixed(2))||0)}):J.map(Rt=>K(j[Rt]||0));let Be=e.type,$e="left";Be==Lr.chartCombination?Be=((Oe=e==null?void 0:e.yAxisFieldConfig)==null?void 0:Oe.chartType)??Lr.ChartBar:$e=((lt=e==null?void 0:e.yAxisFieldConfig)==null?void 0:lt.yAxisPos)??"left";let tt=X8({type:Be,data:de,label:V,name:e.yAxis==="recordTotal"?U0("pb.statisticsText"):S(e==null?void 0:e.yAxisField),isGroup:e==null?void 0:e.isGroup,groupField:e==null?void 0:e.groupField,labels:J});tt.yAxisIndex=$e=="left"?0:1,k.push(tt)}console.log("series",k,e);const q=Gue({series:k,chartConfig:Q,width:n,customeStyle:r}),fe=(qt=e==null?void 0:e.chartOptions)==null?void 0:qt.includes("legend"),se=k.some(de=>(de==null?void 0:de.yAxisIndex)==0),xe=k.some(de=>(de==null?void 0:de.yAxisIndex)==1),ye={...Q.yAxis,axisTick:{show:(Ue=e==null?void 0:e.chartOptions)==null?void 0:Ue.includes("axis")},axisLine:{show:(St=e==null?void 0:e.chartOptions)==null?void 0:St.includes("axis")},axisLabel:{show:(Rr=e==null?void 0:e.chartOptions)==null?void 0:Rr.includes("label"),formatter:de=>de.length>15?`${de.slice(0,15)}...`:de,hideOverlap:!0,...(at=Q.yAxis)==null?void 0:at.axisLabel},splitLine:{show:(yt=e==null?void 0:e.chartOptions)==null?void 0:yt.includes("splitLine")}};return{legend:{type:"scroll",left:"center",right:"center",top:"0",show:fe,itemWidth:12,itemHeight:12,data:(k==null?void 0:k.map(de=>(de==null?void 0:de.name)||""))||[]},grid:q,graphic:{elements:[{type:"text",left:"center",bottom:"10px",style:{text:(r==null?void 0:r.xtitle)||"",fill:"#333",fontSize:12,fontWeight:"bold"}},{type:"text",left:"10px",top:"center",style:{text:(r==null?void 0:r.ytitle)||"",fill:"#333",fontSize:12,fontWeight:"bold"},rotation:Math.PI/2}]},xAxis:{...Q.xAxis,axisTick:{show:(Pr=e==null?void 0:e.chartOptions)==null?void 0:Pr.includes("axis")},axisLine:{show:(lr=e==null?void 0:e.chartOptions)==null?void 0:lr.includes("axis")},axisLabel:{show:(Br=e==null?void 0:e.chartOptions)==null?void 0:Br.includes("label"),rotate:q.axisLabelRotate,interval:"auto",formatter:de=>de.length>15?`${de.slice(0,15)}...`:de,...((_n=Q.xAxis)==null?void 0:_n.axisLabel)??{}},splitLine:{show:(Cr=e==null?void 0:e.chartOptions)==null?void 0:Cr.includes("splitLine")}},yAxis:[{show:se,...ye},{show:xe,...ye}],series:k,tooltip:{trigger:"item",axisPointer:{type:"shadow"},extraCssText:"max-width:30vw; white-space:pre-wrap; word-break:break-all",appendTo:"body"}}})(l):null,[e==null?void 0:e.sortField,e==null?void 0:e.sortOrder,e==null?void 0:e.type,e==null?void 0:e.chartOptions,e==null?void 0:e.timeGroupInterval,e==null?void 0:e.groupFieldConfig,e==null?void 0:e.yAxisFieldConfig,e==null?void 0:e.displayRange,r,l,n,i,h]),g=I.useRef(),p=I.useRef(null),m=Em(p);I.useEffect(()=>{var _;m&&((_=g==null?void 0:g.current)==null||_.resize())},[m]);const y=f,b=!f&&!v,C=!y&&!!v;return D.jsxs("div",{style:{width:"100%",height:"100%"},ref:p,children:[y&&D.jsx(Z.Spin,{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},spinning:f}),b&&D.jsx(q8,{}),C&&D.jsx(Vue,{echartRef:g,options:v??{}})]})},Z8=I.memo(Uue),Pp={"combination-chart-option":"_combination-chart-option_1cwba_1","group-field-config-picker":"_group-field-config-picker_1cwba_11","group-field-config-picker__title":"_group-field-config-picker__title_1cwba_14","group-field-config-picker__item":"_group-field-config-picker__item_1cwba_18","group-field-config-picker__input":"_group-field-config-picker__input_1cwba_23"},K8="combination-chart-option",fu={chartType:Lr.ChartBar,yAxisPos:"left"},Q8=t=>{const{style:e,className:r,initTriggerChange:n=!1}=t,{t:i}=At(),[a,o]=Ao(t),s=[{label:i("chart.t2"),key:Lr.ChartBar,icon:D.jsx($w,{})},{label:i("chart.t8"),key:Lr.ChartLine,icon:D.jsx(Jw,{})}],l=[{label:i("chart.left"),key:"left",icon:D.jsx(Uw,{})},{label:i("chart.right"),key:"right",icon:D.jsx(Yw,{})}],u=(a==null?void 0:a.chartType)??(fu==null?void 0:fu.chartType),f=(a==null?void 0:a.yAxisPos)??(fu==null?void 0:fu.yAxisPos),c=I.useMemo(()=>s.find(h=>h.key===u),[u,s]),d=I.useMemo(()=>l.find(h=>h.key===f),[f,l]);return D.jsxs("div",{className:fn(Pp[`${K8}`],K8),style:e,children:[D.jsx(Z.Dropdown,{trigger:["click"],placement:"bottom",menu:{items:s.map(h=>({...h,onClick:()=>{o({chartType:h.key,yAxisPos:f})}}))},children:D.jsx(Z.Tooltip,{title:c==null?void 0:c.label,children:D.jsx(Z.Button,{size:"small",type:"text",children:c==null?void 0:c.icon})})}),D.jsx(Z.Divider,{type:"vertical",style:{margin:"0 2px"}}),D.jsx(Z.Dropdown,{trigger:["click"],placement:"bottom",menu:{items:l.map(h=>({...h,onClick:()=>{o({chartType:u,yAxisPos:h.key})}}))},children:D.jsx(Z.Tooltip,{title:d==null?void 0:d.label,children:D.jsx(Z.Button,{size:"small",type:"text",children:d==null?void 0:d.icon})})})]})};Q8.displayName="CombinationChartOptionPicker";const m_="group-field-config-picker",J8=[],eN=t=>{const{style:e,className:r,options:n=J8}=t,[i=J8,a]=Ao(t),o=Tt(l=>{let u=(i??[]).find(f=>f.value===l);return u?u.config:void 0}),s=Tt((l,u)=>{let f=[...i??[]],c=f.find(d=>d.value===l);c?c.config=u:f.push({value:l,config:u}),a(f)});return I.useEffect(()=>{if((n==null?void 0:n.length)>0){let l=n.map(u=>({value:u,config:{chartType:Lr.ChartBar,yAxisPos:"left",...o(u)??{}}}));a(l)}},[n]),I.useMemo(()=>D.jsx("div",{className:fn(r,Pp[`${m_}`]),style:e,children:D.jsx("div",{children:((t==null?void 0:t.options)??[]).map(l=>{let u=`${l}`;const f=o(l);return D.jsxs("div",{className:fn(Pp[`${m_}__item`]),children:[D.jsx(Z.Tooltip,{title:u,children:D.jsx("div",{className:fn(Pp[`${m_}__input`]),children:D.jsx(pi,{value:u,disabled:!0,style:{width:200,pointerEvents:"none"}})})}),D.jsx(Q8,{value:f,onChange:c=>{s(l,c)}})]},u)})})}),[i,n])};eN.displayName="GroupFieldConfigPicker";const Yue=()=>D.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[D.jsx("rect",{x:"17",y:"8",width:"6",height:"15.5",rx:"0.5",fill:"#959bee"}),D.jsx("rect",{x:"17",y:"24.5",width:"6",height:"15.5",rx:"0.5",fill:"#5b65f5"}),D.jsx("rect",{x:"28",y:"8",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),D.jsx("rect",{x:"28",y:"18",width:"6",height:"22",rx:"0.5",fill:"#5b65f5"}),D.jsx("rect",{x:"39",y:"8",width:"6",height:"19",rx:"0.5",fill:"#959bee"}),D.jsx("rect",{x:"39",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"}),D.jsx("rect",{x:"50",y:"8",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),D.jsx("rect",{x:"50",y:"18",width:"6",height:"22",rx:"0.5",fill:"#5b65f5"})]}),que=()=>D.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[D.jsx("rect",{x:"17",y:"21",width:"6",height:"6",rx:"0.5",fill:"#959bee"}),D.jsx("rect",{x:"17",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"}),D.jsx("rect",{x:"28",y:"24",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),D.jsx("rect",{x:"28",y:"34",width:"6",height:"6",rx:"0.5",fill:"#5b65f5"}),D.jsx("rect",{x:"39",y:"8",width:"6",height:"19",rx:"0.5",fill:"#959bee"}),D.jsx("rect",{x:"39",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"}),D.jsx("rect",{x:"50",y:"18",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),D.jsx("rect",{x:"50",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"})]}),Xue=()=>D.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[D.jsx("path",{d:"M15.5 33.5C20.2023 32.3804 23.5007 28.5533 25.7095 24.6682C28.3082 20.0974 34.0857 17.3668 38.758 19.7783L39.8066 20.3195C42.9001 21.9162 46.671 21.329 49.1326 18.8674L58 10",stroke:"#959bee",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),D.jsx("path",{d:"M16.5 15L26.844 27.6427C28.7759 30.0039 31.8825 31.0607 34.8535 30.3675L42.3359 28.6216C44.0629 28.2187 45.8748 28.401 47.4869 29.1398L57 33.5",stroke:"#5b65f4",strokeWidth:"1.5",strokeLinecap:"round"})]}),Zue=()=>D.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[D.jsx("path",{d:"M20 24C20 32.8366 27.1634 40 36 40C44.8366 40 52 32.8366 52 24C52 15.1634 44.8366 8 36 8C27.1634 8 20 15.1634 20 24ZM46.3944 24C46.3944 29.7407 41.7407 34.3944 36 34.3944C30.2593 34.3944 25.6056 29.7407 25.6056 24C25.6056 18.2593 30.2593 13.6056 36 13.6056C41.7407 13.6056 46.3944 18.2593 46.3944 24Z",fill:"#5b65f4"}),D.jsx("path",{d:"M52 24C52 19.7565 50.3143 15.6869 47.3137 12.6863C44.3131 9.68571 40.2435 8 36 8V13.6056C38.7568 13.6056 41.4006 14.7007 43.35 16.65C45.2993 18.5994 46.3944 21.2432 46.3944 24H52Z",fill:"#959bee"}),D.jsx("path",{d:"M52 24C52 20.9896 51.1507 18.0403 49.5497 15.4909L44.8026 18.4721C45.8427 20.1283 46.3944 22.0443 46.3944 24H52Z",fill:"#cdcff9"})]}),Kue=()=>D.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[D.jsx("rect",{x:"58",y:"11",width:"4",height:"15",rx:"0.5",transform:"rotate(90 58 11)",fill:"#959bee"}),D.jsx("rect",{x:"42",y:"11",width:"4",height:"28",rx:"0.5",transform:"rotate(90 42 11)",fill:"#5b65f5"}),D.jsx("rect",{x:"58",y:"18",width:"4",height:"21.5",rx:"0.5",transform:"rotate(90 58 18)",fill:"#959bee"}),D.jsx("rect",{x:"35.5",y:"18",width:"4",height:"21.5",rx:"0.5",transform:"rotate(90 35.5 18)",fill:"#5b65f5"}),D.jsx("rect",{x:"58",y:"25",width:"4",height:"34",rx:"0.5",transform:"rotate(90 58 25)",fill:"#959bee"}),D.jsx("rect",{x:"23",y:"25",width:"4",height:"9",rx:"0.5",transform:"rotate(90 23 25)",fill:"#5b65f5"}),D.jsx("rect",{x:"58",y:"32",width:"4",height:"17",rx:"0.5",transform:"rotate(90 58 32)",fill:"#959bee"}),D.jsx("rect",{x:"40",y:"32",width:"4",height:"26",rx:"0.5",transform:"rotate(90 40 32)",fill:"#5b65f5"})]}),Que=()=>D.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[D.jsx("rect",{x:"40",y:"11",width:"4",height:"15",rx:"0.5",transform:"rotate(90 40 11)",fill:"#959bee"}),D.jsx("rect",{x:"24",y:"11",width:"4",height:"8",rx:"0.5",transform:"rotate(90 24 11)",fill:"#5b65f5"}),D.jsx("rect",{x:"48",y:"18",width:"4",height:"15.5",rx:"0.5",transform:"rotate(90 48 18)",fill:"#959bee"}),D.jsx("rect",{x:"31.5",y:"18",width:"4",height:"15.5",rx:"0.5",transform:"rotate(90 31.5 18)",fill:"#5b65f5"}),D.jsx("rect",{x:"60",y:"25",width:"4",height:"34",rx:"0.5",transform:"rotate(90 60 25)",fill:"#959bee"}),D.jsx("rect",{x:"25",y:"25",width:"4",height:"9",rx:"0.5",transform:"rotate(90 25 25)",fill:"#5b65f5"}),D.jsx("rect",{x:"43",y:"32",width:"4",height:"13",rx:"0.5",transform:"rotate(90 43 32)",fill:"#959bee"}),D.jsx("rect",{x:"29",y:"32",width:"4",height:"13",rx:"0.5",transform:"rotate(90 29 32)",fill:"#5b65f5"})]}),Jue=()=>{const{t,i18n:e}=At();return I.useMemo(()=>[{label:t("chart.t2"),value:"chart-bar",icon:D.jsx(ZS,{})},{label:t("chart.t3"),value:"chart-bar-pile",icon:D.jsx(que,{})},{label:t("chart.t4"),value:"chart-bar-percentage",icon:D.jsx(Yue,{})},{label:t("chart.t5"),value:"chart-strip-bar",icon:D.jsx(JS,{})},{label:t("chart.t6"),value:"chart-strip-bar-pile",icon:D.jsx(Que,{})},{label:t("chart.t7"),value:"chart-strip-bar-percentage",icon:D.jsx(Kue,{})},{label:t("chart.t8"),value:"chart-line",icon:D.jsx(KS,{})},{label:t("chart.t9"),value:"chart-line-smooth",icon:D.jsx(Xue,{})},{label:t("chart.t10"),value:"chart-pie",icon:D.jsx(QS,{})},{label:t("chart.t11"),value:"chart-pie-circular",icon:D.jsx(Zue,{})},{label:t("chart._t12"),value:Lr.chartCombination,icon:D.jsx(XS,{})}],[e.language])},efe=()=>{const{t,i18n:e}=At();return I.useMemo(()=>[{label:t("chart.t40"),value:"day"},{label:t("chart.t41"),value:"week"},{label:t("chart.t42"),value:"month"},{label:t("chart.t43"),value:"year"}],[e.language])},tfe=()=>{const{t,i18n:e}=At();return I.useMemo(()=>[{label:t("displayRange.all","ALL"),value:di.ALL},{label:t("displayRange.top5","TOP5"),value:di.TOP5},{label:t("displayRange.top10","TOP10"),value:di.TOP10},{label:t("displayRange.top20","TOP20"),value:di.TOP20},{label:t("displayRange.top30","TOP30"),value:di.TOP30},{label:t("displayRange.bottom5","BOTTOM5"),value:di.BOTTOM5},{label:t("displayRange.bottom10","BOTTOM10"),value:di.BOTTOM10},{label:t("displayRange.bottom20","BOTTOM20"),value:di.BOTTOM20},{label:t("displayRange.bottom30","BOTTOM30"),value:di.BOTTOM30}],[e.language])},rfe={"chart-modal":"_chart-modal_10ivt_1"},nfe="chart-modal",ife=({selectModuleData:t,onAllValuesChange:e,enumDataApi:r})=>{const{globalData:n}=dn(),{t:i}=At(),a=I.useRef(null),o=Jue(),s=efe(),l=tfe(),u={dataSourceId:"",yAxis:"recordTotal",chartOptions:["legend","label","axis","splitLine"],sortField:"xAxis",sortOrder:"asc",timeGroupInterval:"day",displayRange:"ALL",yAxisFieldConfig:{chartType:Lr.ChartBar,yAxisPos:"left"}},[f]=Z.Form.useForm(),c=Z.Form.useWatch("type",f),d=Z.Form.useWatch("dataSourceId",f),h=Z.Form.useWatch("isGroup",f),v=Z.Form.useWatch("xAxis",f),g=Z.Form.useWatch("yAxisField",f),p=Z.Form.useWatch("groupField",f),m=Tt(B=>{var Y,X;return((X=(Y=n==null?void 0:n.sourceData)==null?void 0:Y.find(ee=>ee.value===B))==null?void 0:X.fields)??[]}),{fieldOptions:y,xAxisFieldOption:b,yAxisFieldOption:C,groupFieldOption:_}=I.useMemo(()=>{const B=m(d),z=B.filter(ee=>![g,p].includes(ee.value)),Y=B.filter(ee=>{let te=ee.type==="int"||ee.type==="float",V=[v,p].includes(ee.value);return te&&!V}),X=B.filter(ee=>![v,g].includes(ee.value));return{fieldOptions:B,xAxisFieldOption:z,yAxisFieldOption:Y,groupFieldOption:X}},[d,v,g,p]),w=Tt(B=>{var z;return((z=y.find(Y=>Y.value===B))==null?void 0:z.type)==="timestamp"}),[x,S]=I.useState(!1),E=I.useRef(),[T,A]=I.useState({conditionList:[],conditionType:"all"}),[M,O]=I.useState(0),P=B=>{var z;A(B),E.current=B,O(((z=B==null?void 0:B.conditionList)==null?void 0:z.length)||0)},{service:N}=dn(),{data:F,loading:L}=y9(async()=>{var B,z,Y;if(h&&c===Lr.chartCombination&&p){const X=p==="tags"?"tag":p;let ee=`select=${X}`;if(((B=T==null?void 0:T.conditionList)==null?void 0:B.length)>0){let J=Qd(T);ee+=J?`&${J}`:""}let te=await((z=N==null?void 0:N.moduleDataApi)==null?void 0:z.call(N,{id:d,query:ee})),V=(Y=te==null?void 0:te.data)==null?void 0:Y.map(J=>nf({fieldOptions:y,val:J[X],field:X,fieldMap:n==null?void 0:n.fieldMap}));return[...new Set(V)]}else return[]},{refreshDeps:[c,h,p,T,d]}),{run:j}=Sm(Tt(()=>{e==null||e({...u,...f.getFieldsValue(),conditionData:E.current})}),{wait:100}),W=Tt((B,z)=>{var Y,X,ee;if(B.dataSourceId){const te=m(B.dataSourceId);f.setFieldsValue({xAxis:(Y=te==null?void 0:te[0])==null?void 0:Y.value,yAxis:"recordTotal",isGroup:!1}),P({conditionList:[],conditionType:"all"})}if(B.xAxis&&f.setFieldsValue(w(B.xAxis)?{timeGroupInterval:u==null?void 0:u.timeGroupInterval}:{displayRange:u==null?void 0:u.displayRange}),B.yAxis){let te=B.yAxis;f.setFieldsValue({yAxisField:te==="fieldValue"?(X=C==null?void 0:C[0])==null?void 0:X.value:"",yAxisFieldType:"sum"})}B.isGroup&&f.setFieldsValue({groupField:(ee=_==null?void 0:_[0])==null?void 0:ee.value}),j()});return I.useEffect(()=>{var B,z,Y;if(t!=null&&t.customData){const X=t.customData;f.setFieldsValue(X)}else{const X=(B=n==null?void 0:n.sourceData)==null?void 0:B[0],ee=m(X==null?void 0:X.value)||[];f.setFieldsValue({...u,dataSourceId:X==null?void 0:X.value,type:t==null?void 0:t.type,xAxis:(z=ee==null?void 0:ee[0])==null?void 0:z.value})}P((Y=t==null?void 0:t.customData)==null?void 0:Y.conditionData),j()},[t,n]),D.jsxs("div",{style:{height:"50vh",overflowX:"auto"},className:fn(rfe[`${nfe}`]),ref:a,children:[D.jsxs(Z.Form,{form:f,name:"customData",layout:"vertical",onValuesChange:W,initialValues:u,children:[D.jsx(Z.Form.Item,{label:i("dataSource"),name:"dataSourceId",children:D.jsx(Z.Select,{options:(n==null?void 0:n.sourceData)??[]})}),D.jsxs(Z.Form.Item,{label:i("dataRange"),children:[D.jsx(Z.Button,{style:{marginLeft:"-15px"},onClick:()=>{S(!0)},type:"link",children:i("filterData")}),M>0?`${i("selectNcondition",{n:M})}`:null]}),D.jsx(Z.Form.Item,{label:i("chart.t1"),name:"type",children:D.jsx(Z.Select,{options:o,optionRender:B=>D.jsxs(Z.Flex,{align:"center",children:[D.jsx("span",{role:"img",style:{marginTop:"5px"},"aria-label":B.data.label,children:B.data.icon}),B.data.label]})})}),D.jsx(Z.Form.Item,{name:"chartOptions",label:i("chart.t12"),children:D.jsxs(Z.Checkbox.Group,{children:[D.jsx(Z.Checkbox,{value:"legend",className:"ow-checkbox",style:{lineHeight:"32px"},children:i("chart.t13")}),D.jsx(Z.Checkbox,{value:"label",className:"ow-checkbox",style:{lineHeight:"32px"},children:i("chart.t14")}),["chart-pie","chart-pie-circular"].includes(c)?null:D.jsxs(D.Fragment,{children:[D.jsx(Z.Checkbox,{value:"axis",className:"ow-checkbox",style:{lineHeight:"32px"},children:i("chart.t15")}),D.jsx(Z.Checkbox,{value:"splitLine",className:"ow-checkbox",style:{lineHeight:"32px"},children:i("chart.t16")})]})]})}),D.jsx(Z.Divider,{style:{borderColor:"#e2e2e2",marginTop:0}}),D.jsx(Z.Form.Item,{label:c!=null&&c.includes("pie")?i("chart.t17"):i("chart.t18"),name:"xAxis",children:D.jsx(Z.Select,{options:b})}),D.jsx(Z.Form.Item,{noStyle:!0,dependencies:["type","xAxis"],children:({getFieldValue:B})=>w(B("xAxis"))?D.jsx(D.Fragment,{children:D.jsx(Z.Form.Item,{name:"timeGroupInterval",label:i("chart.t39"),children:D.jsx(Z.Select,{options:s})})}):D.jsx(D.Fragment,{children:D.jsx(Z.Form.Item,{name:"displayRange",label:i("displayRange.title"),children:D.jsx(Z.Select,{options:l})})})}),D.jsx(Z.Form.Item,{dependencies:["type"],noStyle:!0,children:({getFieldValue:B})=>{var z;return(z=B("type"))!=null&&z.includes("pie")?null:D.jsxs(D.Fragment,{children:[D.jsx(Z.Form.Item,{name:"sortField",label:i("chart.t31"),children:D.jsxs(Z.Radio.Group,{children:[D.jsx(Z.Radio,{value:"xAxis",children:i("chart.t32")}),D.jsx(Z.Radio,{value:"yAxisField",children:i("chart.t33")}),D.jsx(Z.Radio,{value:"recordValue",children:i("chart.t34")})]})}),D.jsx(Z.Form.Item,{name:"sortOrder",label:i("chart.t35"),children:D.jsxs(Z.Radio.Group,{children:[D.jsx(Z.Radio,{value:"asc",children:i("chart.t36")}),D.jsx(Z.Radio,{value:"desc",children:i("chart.t37")})]})})]})}}),D.jsx(Z.Form.Item,{label:c!=null&&c.includes("pie")?i("chart.t19"):i("chart.t20"),name:"yAxis",children:D.jsx(Z.Select,{options:[{value:"recordTotal",label:i("statisticstRecordNum")},{value:"fieldValue",label:i("statisticstFieldVal")}]})}),D.jsx(Z.Form.Item,{dependencies:["yAxis","type","isGroup"],noStyle:!0,children:({getFieldValue:B})=>B("yAxis")==="fieldValue"?D.jsx(Z.Form.Item,{label:i("selectField"),children:D.jsx("div",{style:{display:"flex",justifyContent:"space-between"},children:D.jsxs(Z.Space.Compact,{children:[D.jsx(Z.Form.Item,{noStyle:!0,name:"yAxisField",children:D.jsx(Z.Select,{style:{width:"100px"},options:C,dropdownStyle:{width:250}})}),D.jsx(Z.Form.Item,{name:"yAxisFieldType",noStyle:!0,children:D.jsx(Z.Select,{style:{width:"100px"},dropdownStyle:{width:136},options:[{value:"sum",label:i("sumVal")},{value:"max",label:i("maxVal")},{value:"min",label:i("minVal")},{value:"avg",label:i("averageVal")}]})})]})})}):null}),D.jsx(Z.Form.Item,{dependencies:["type","isGroup"],noStyle:!0,children:({getFieldValue:B})=>{var z;return(z=B("type"))!=null&&z.includes("pie")?null:D.jsxs(D.Fragment,{children:[D.jsx(Z.Form.Item,{name:"isGroup",valuePropName:"checked",noStyle:!0,children:D.jsx(Z.Checkbox,{style:{marginBottom:"5px"},children:i("chart.t38")})}),D.jsx(Z.Form.Item,{dependencies:["isGroup"],noStyle:!0,children:({getFieldValue:Y})=>Y("isGroup")?D.jsx(Z.Form.Item,{name:"groupField",children:D.jsx(Z.Select,{options:_})}):null}),D.jsx(Z.Spin,{spinning:L,children:D.jsx(Z.Form.Item,{name:"groupFieldConfig",label:i("chart.groupFieldConfig"),hidden:!(B("type")===Lr.chartCombination&&B("isGroup")),children:D.jsx(eN,{options:F})})})]})}})]}),D.jsx(V0,{open:x,value:T,fieldOptions:y,enumDataApi:r,onClose:()=>{S(!1)},onOk:B=>{P(B),j()}})]})},afe=({customData:t,selectModuleData:e,onAllValuesChange:r})=>{var s,l,u;const[n]=Z.Form.useForm(),{t:i}=At(),a={xtitle:"",ytitle:""},o=()=>{setTimeout(()=>{r==null||r(n.getFieldsValue())})};return I.useEffect(()=>{e!=null&&e.customeStyle?n.setFieldsValue(e.customeStyle):n.setFieldsValue(a)},[e]),(s=t==null?void 0:t.type)!=null&&s.includes("pie")?D.jsx("div",{style:{height:"50vh",overflowX:"auto"}}):D.jsx("div",{style:{height:"50vh",overflowX:"auto"},children:D.jsxs(Z.Form,{form:n,name:"customeStyle",layout:"vertical",initialValues:a,children:[D.jsx(Z.Divider,{orientation:"left",orientationMargin:"0",children:i("chart.t21")}),(l=t==null?void 0:t.type)!=null&&l.includes("pie")?null:D.jsx(Z.Form.Item,{label:i("chart.t22"),name:"xtitle",children:D.jsx(pi,{onChange:()=>{o()}})}),D.jsx(Z.Divider,{orientation:"left",orientationMargin:"0",children:i("chart.t26")}),(u=t==null?void 0:t.type)!=null&&u.includes("pie")?null:D.jsx(Z.Form.Item,{label:i("chart.t27"),name:"ytitle",children:D.jsx(pi,{onChange:()=>{o()}})})]})})},ofe=({open:t,onClose:e,onOk:r,moduleDataApi:n,selectModuleData:i,enumDataApi:a})=>{var v;const{t:o}=At(),[s,l]=I.useState(),[u,f]=I.useState();I.useRef(null);const c=(v=s==null?void 0:s.type)==null?void 0:v.includes("pie");I.useEffect(()=>{i&&(l(i==null?void 0:i.customData),f(i==null?void 0:i.customeStyle))},[i]);const[d,h]=I.useState("");return I.useEffect(()=>{t&&h(i!=null&&i.title?i==null?void 0:i.title:o("chartText"))},[t]),D.jsx(D.Fragment,{children:D.jsx(Z.Modal,{width:"65%",title:D.jsx(Dd,{value:d,onChange:h}),footer:null,open:t,onCancel:e,destroyOnClose:!0,closeIcon:D.jsx(zc,{}),className:"ow-modal ow-modal-2",children:D.jsxs("div",{className:"config-widget-dialog-container",children:[D.jsx("div",{className:"config-widget-dialog-content",children:D.jsx("div",{className:"config-widget-dialog-preview",children:D.jsx(Z8,{customData:s,customeStyle:u,moduleDataApi:n})})}),D.jsxs("div",{className:"config-widget-dialog-panel",children:[D.jsx("div",{className:"bitable-dashboard edit-panel-container",children:D.jsx(Z.Tabs,{defaultActiveKey:"1",items:[{key:"1",label:o("typeData"),children:D.jsx(ife,{enumDataApi:a,selectModuleData:i,onAllValuesChange:g=>{l(g)}})},...c?[]:[{key:"2",label:o("customStyle"),children:D.jsx(afe,{customData:s,selectModuleData:i,onAllValuesChange:g=>{f(g)}})}]]})}),D.jsx("div",{className:"button-container",children:D.jsx(Z.Button,{type:"primary",onClick:()=>{r==null||r({id:i==null?void 0:i.id,type:i==null?void 0:i.type,customData:s,customeStyle:u,title:d})},children:o("confirm")})})]})]})})})};function y_(t,e){const{ranges:r,step:n}=e;let i=null,a=null;for(let o=0;o<r.length-1;o++){const[s,l]=r[o],[u,f]=r[o+1];if(t>=s&&t<=u){i=[s,l],a=[u,f];break}}if(t<r[0][0]&&(i=r[0],a=r[1]),t>r[r.length-1][0]&&(i=r[r.length-2],a=r[r.length-1]),i&&a){let[o,s]=i,[l,u]=a;const f=(u-s)/(l-o),c=s-f*o,d=f*t+c;return Math.round(d/n)*n}if(i||a){let o=i||a,[s,l]=o;const u=l*t/s;return Math.round(u/n)*n}throw new Error("Unexpected error in range calculation")}function sfe(t,e=0){if(!Number.isFinite(t))throw new Error("Value must be a finite number.");return new Intl.NumberFormat(void 0,{style:"percent",minimumFractionDigits:e,maximumFractionDigits:e}).format(t)}function b_(t,e=0){if(!Number.isFinite(t))return"";const r=new Intl.NumberFormat(void 0,{minimumFractionDigits:0,maximumFractionDigits:e}).format(t),[n,i]=r.split("."),a=(i||"").padEnd(e,"0");return`${n}${e>0?".":""}${a}`}const lfe=({moduleDataApi:t,customData:e,customeStyle:r})=>{const[n,i]=I.useState(),[a,o]=I.useState(!1),{globalFilterCondition:s}=dn();let l=I.useMemo(()=>s==null?void 0:s.find(m=>(m==null?void 0:m.dataSourceId)===(e==null?void 0:e.dataSourceId)),[s,e==null?void 0:e.dataSourceId]);const u=Tt(async()=>{var p,m,y;if(e){let b="";o(!0),e.statisticalMethod==="fieldValue"&&e.field?b+=`select=${e.field}.${e==null?void 0:e.statisticalType}()`:e.statisticalMethod==="recordTotal"&&(b+="select=id.count()");let C=[];if((((p=l==null?void 0:l.conditionList)==null?void 0:p.length)??0)>0&&C.push(l),(((y=(m=e==null?void 0:e.conditionData)==null?void 0:m.conditionList)==null?void 0:y.length)??0)>0&&C.push(e==null?void 0:e.conditionData),C.length>0){let _=Qd(C);b+=_?`&${_}`:""}e!=null&&e.dataSourceId&&(t==null||t({id:e==null?void 0:e.dataSourceId,query:b}).then(_=>{if(!_.success){Z.message.error(_.message);return}i(_.data)}).finally(()=>{o(!1)}))}else i([])});I.useEffect(()=>{e&&u()},[e==null?void 0:e.conditionData,e==null?void 0:e.statisticalMethod,e==null?void 0:e.statisticalType,e==null?void 0:e.field,e==null?void 0:e.dataSourceId,l]);const{formatCurrency:f}=dn(),c=Tt(f),d=I.useMemo(()=>{var _,w,x,S,E;if(!n)return"";const p=n,{statisticalMethod:m,statisticalType:y,field:b}=e||{};let C=0;if(p.length&&m==="fieldValue"&&b)switch(y){case"sum":C=((_=p==null?void 0:p[0])==null?void 0:_.sum)||0;break;case"max":C=((w=p==null?void 0:p[0])==null?void 0:w.max)||0;break;case"min":C=((x=p==null?void 0:p[0])==null?void 0:x.min)||0;break;case"avg":C=((S=p==null?void 0:p[0])==null?void 0:S.avg)||0;break;default:C=0}else m==="recordTotal"&&(C=((E=p==null?void 0:p[0])==null?void 0:E.count)||0);if(r!=null&&r.unit){const{unit:T,precision:A}=r;switch(`${T}`){case"4":case"5":case"6":case"7":case"8":case"9":C=(c==null?void 0:c(C,A))??C;break;case"1":C=b_(C,A);break;case"3":C=sfe(C,A);break;default:C=b_(C,A)}}else C=b_(C,r==null?void 0:r.precision);return C},[n,e,r]),h=I.useRef(),v=Em(h),g=I.useMemo(()=>{if(!v)return null;let p=0,m=32,y=0,b=0;p=y_(v.width,{ranges:[[116,16],[760,56]],step:4}),p=Math.max(16,Math.min(72,p));let C=v.width-p*2,_=v.height-m*2;{y=y_(C,{ranges:[[400,60],[500,64]],step:.1});const w=16,x=Math.min(72,_/2);y=Math.max(w,Math.min(x,y))}{b=y_(_,{ranges:[[140,12],[500,24],[860,36]],step:.1});const w=12,x=Math.min(36,_/2);b=Math.max(w,Math.min(x,b))}return{PX:p,PY:m,fontSize:y,subFontSize:b}},[v]);return D.jsxs("div",{ref:h,style:{display:"flex",height:"100%",width:"100%"},children:[a?D.jsx(Z.Spin,{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",background:"rgba(255,255,255,0.6)",top:0,left:0,right:0,bottom:0,zIndex:1e3},spinning:a}):null,D.jsxs("div",{style:{overflow:"hidden",position:"relative",flex:1,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",padding:`${g==null?void 0:g.PY}px ${g==null?void 0:g.PX}px`},children:[d!==""&&D.jsx("div",{style:{width:"100%",position:"relative",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textAlign:"center"},children:D.jsx("span",{style:{fontWeight:"bold",lineHeight:`${g==null?void 0:g.fontSize}px`,fontSize:`${g==null?void 0:g.fontSize}px`,color:r==null?void 0:r.color},children:d})}),(r==null?void 0:r.desc)!==""&&D.jsx("div",{style:{width:"100%",position:"relative",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textAlign:"center"},children:D.jsx("span",{style:{fontSize:`${g==null?void 0:g.subFontSize}px`,lineHeight:`${g==null?void 0:g.subFontSize}px`,color:r==null?void 0:r.color,textAlign:"center"},children:r==null?void 0:r.desc})})]})]})},tN=I.memo(lfe),ufe=({selectModuleData:t,onAllValuesChange:e,enumDataApi:r})=>{const{globalData:n}=dn(),{t:i}=At(),[a,o]=I.useState(),[s,l]=I.useState(),u=_=>{var x,S;const w=(S=(x=n==null?void 0:n.sourceData)==null?void 0:x.find(E=>E.value===_))==null?void 0:S.fields;o(w),l(w==null?void 0:w.filter(E=>E.type==="int"||E.type==="float"))},[f]=Z.Form.useForm(),c={dataSourceId:"",statisticalMethod:"recordTotal",field:""},d=()=>{setTimeout(()=>{e==null||e({...f.getFieldsValue(),conditionData:g.current})})},[h,v]=I.useState(!1),g=I.useRef(),[p,m]=I.useState({conditionList:[],conditionType:"all"}),[y,b]=I.useState(0),C=_=>{var w;m(_),g.current=_,b(((w=_==null?void 0:_.conditionList)==null?void 0:w.length)||0)};return I.useEffect(()=>{var _,w;if(t!=null&&t.customData){const x=t.customData;f.setFieldsValue(x),u(x==null?void 0:x.dataSourceId)}else{const x=(_=n==null?void 0:n.sourceData)==null?void 0:_[0];f.setFieldsValue({...c,dataSourceId:x==null?void 0:x.value}),u(x==null?void 0:x.value),d()}C((w=t==null?void 0:t.customData)==null?void 0:w.conditionData)},[t,n]),D.jsxs(D.Fragment,{children:[D.jsxs(Z.Form,{form:f,name:"customData",layout:"vertical",initialValues:c,children:[D.jsx(Z.Form.Item,{label:i("dataSource"),name:"dataSourceId",children:D.jsx(Z.Select,{options:n==null?void 0:n.sourceData,onChange:_=>{f.setFieldsValue({statisticalMethod:"recordTotal"}),u(_),d(),C({conditionList:[],conditionType:"all"})}})}),D.jsxs(Z.Form.Item,{label:i("dataRange"),children:[D.jsx(Z.Button,{style:{marginLeft:"-15px"},onClick:()=>{v(!0)},type:"link",children:i("filterData")}),y>0?`${i("selectNcondition",{n:y})}`:null]}),D.jsx(Z.Divider,{style:{borderColor:"#e2e2e2",marginTop:0}}),D.jsx(Z.Form.Item,{label:i("statisticstMethods"),name:"statisticalMethod",children:D.jsx(Z.Select,{onChange:_=>{f.setFieldsValue({field:_==="fieldValue"?s==null?void 0:s[0].value:"",statisticalType:"sum"}),d()},options:[{value:"recordTotal",label:i("statisticstRecordNum")},{value:"fieldValue",label:i("statisticstFieldVal")}]})}),D.jsx(Z.Form.Item,{dependencies:["statisticalMethod"],children:({getFieldValue:_})=>_("statisticalMethod")==="fieldValue"?D.jsx(Z.Form.Item,{label:i("selectField"),children:D.jsxs(Z.Space.Compact,{children:[D.jsx(Z.Form.Item,{noStyle:!0,name:"field",children:D.jsx(Z.Select,{style:{width:"100px"},dropdownStyle:{width:250},onChange:()=>{d()},options:s})}),D.jsx(Z.Form.Item,{name:"statisticalType",noStyle:!0,children:D.jsx(Z.Select,{style:{width:"100px"},dropdownStyle:{width:180},onChange:()=>{d()},options:[{value:"sum",label:i("sumVal")},{value:"max",label:i("maxVal")},{value:"min",label:i("minVal")},{value:"avg",label:i("averageVal")}]})})]})}):null})]}),D.jsx(V0,{open:h,value:p,fieldOptions:a,enumDataApi:r,onClose:()=>{v(!1)},onOk:_=>{C(_),d()}})]})},ffe=({value:t,onChange:e})=>{const[r,n]=I.useState(),i=["#373c43","#3370ff","#4954e6","#34c724","#14c0ff","#ffc60a","#f80","#f76964"];return I.useEffect(()=>{n(t)},[t]),D.jsx("div",{className:"pane-item-body item-body-column",children:D.jsx("div",{className:"panel-single-color-selector",children:i.map((a,o)=>D.jsxs("div",{className:"panel-single-color-selector-color-item",onClick:()=>{n(a),e==null||e(a)},children:[D.jsx("div",{className:"panel-single-color-selector-color-item-background",style:{background:a}}),r===a?D.jsx("span",{className:"panel-icon",children:D.jsx(qw,{})}):null]},o))})})},cfe=({selectModuleData:t,onAllValuesChange:e})=>{const[r]=Z.Form.useForm(),{t:n,i18n:i}=At(),a=I.useMemo(()=>[{value:"1",label:n("statistics.t5")},{value:"2",label:n("statistics.t6")},{value:"3",label:n("statistics.t7")},{value:"9",label:n("statistics.currency")}],[i.language]),o={color:"#373c43",unit:"1",precision:"",desc:""},s=()=>{setTimeout(()=>{e==null||e(r.getFieldsValue())})};return I.useEffect(()=>{if(t!=null&&t.customeStyle){`${t.customeStyle.unit??o.unit}`;let l={...o,...t.customeStyle,unit:`${t.customeStyle.unit??o.unit}`};r.setFieldsValue(l)}else r.setFieldsValue(o)},[t]),D.jsxs(Z.Form,{form:r,name:"customeStyle",layout:"vertical",initialValues:o,children:[D.jsx(Z.Form.Item,{label:n("statistics.t1"),name:"color",children:D.jsx(ffe,{onChange:()=>{s()}})}),D.jsx(Z.Form.Item,{label:n("statistics.t2"),extra:n("statistics.t3"),children:D.jsxs(Z.Space.Compact,{children:[D.jsx(Z.Form.Item,{name:"precision",noStyle:!0,children:D.jsx(Z.InputNumber,{min:1,max:10,style:{width:"60%"},placeholder:n("statistics.t4"),onChange:()=>{s()}})}),D.jsx(Z.Form.Item,{name:"unit",noStyle:!0,children:D.jsx(Z.Select,{onChange:()=>{s()},dropdownStyle:{width:240},children:a.map(l=>{const{value:u,label:f}=l;return D.jsx(Z.Select.Option,{value:u,children:f},u)})})})]})}),D.jsx(Z.Form.Item,{label:n("statistics.t10"),name:"desc",children:D.jsx(pi,{onChange:()=>{s()}})})]})},dfe=({open:t,onClose:e,onOk:r,moduleDataApi:n,selectModuleData:i,enumDataApi:a})=>{const{t:o}=At(),[s,l]=I.useState(),[u,f]=I.useState();I.useEffect(()=>{i&&(l(i==null?void 0:i.customData),f(i==null?void 0:i.customeStyle))},[i]);const[c,d]=I.useState("");return I.useEffect(()=>{t&&d(i!=null&&i.title?i==null?void 0:i.title:o("statisticsText"))},[t]),D.jsx(D.Fragment,{children:D.jsx(Z.Modal,{width:"65%",title:D.jsx(Dd,{value:c,onChange:d}),footer:null,open:t,onCancel:e,closeIcon:D.jsx(zc,{}),className:"ow-modal ow-modal-2",children:D.jsxs("div",{className:"config-widget-dialog-container",children:[D.jsx("div",{className:"config-widget-dialog-content",children:D.jsx("div",{className:"config-widget-dialog-preview",children:D.jsx(tN,{customData:s,customeStyle:u,moduleDataApi:n})})}),D.jsxs("div",{className:"config-widget-dialog-panel",children:[D.jsx("div",{className:"bitable-dashboard edit-panel-container",children:D.jsx(Z.Tabs,{defaultActiveKey:"1",items:[{key:"1",label:o("typeData"),children:D.jsx(ufe,{selectModuleData:i,enumDataApi:a,onAllValuesChange:h=>{l(h)}})},{key:"2",label:o("customStyle"),children:D.jsx(cfe,{selectModuleData:i,onAllValuesChange:h=>{f(h)}})}]})}),D.jsx("div",{className:"button-container",children:D.jsx(Z.Button,{type:"primary",onClick:()=>{r==null||r({id:i==null?void 0:i.id,customData:s,customeStyle:u,title:c})},children:o("confirm")})})]})]})})})},hfe=t=>D.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",...t,children:[D.jsx("g",{clipPath:"url(#a)",children:D.jsx("path",{fill:"#000",fillRule:"evenodd",d:"M3 2.666a.167.167 0 0 0-.166.167v1.634c0 .057.03.11.077.14l3.05 1.94c.336.215.54.586.54.985v4.634a.5.5 0 1 1-1 0V7.532c0-.057-.03-.11-.078-.14L2.374 5.45a1.167 1.167 0 0 1-.54-.984V2.833c0-.645.522-1.167 1.167-1.167h10c.644 0 1.166.522 1.166 1.167v1.634c0 .399-.204.77-.54.984l-3.05 1.94a.167.167 0 0 0-.076.141v6.3a.5.5 0 0 1-1 0v-6.3c0-.399.203-.77.54-.984l3.05-1.94a.167.167 0 0 0 .076-.141V2.833a.167.167 0 0 0-.166-.167H3Z",clipRule:"evenodd"})}),D.jsx("defs",{children:D.jsx("clipPath",{id:"a",children:D.jsx("path",{fill:"#fff",d:"M0 0h16v16H0z"})})})]}),rN=I.createContext({}),C_=()=>I.useContext(rN),Bp=(t,e)=>`${t}-${e}`,vfe=t=>{var l,u;const{t:e}=At(),{fieldPickerDataSource:r,flattenFieldMap:n}=C_(),[i,a]=Ao(t),o=Tt(f=>{const[c,d]=f.keyPath;let h=c==null?void 0:c.replace(`${d}-`,"");h&&a({dataSourceId:d,field:h})}),s=I.useMemo(()=>{{let f=Bp(i==null?void 0:i.dataSourceId,i==null?void 0:i.field);return n==null?void 0:n.get(f)}},[i,n]);return D.jsx(Z.Dropdown,{trigger:["click"],menu:{selectable:!0,selectedKeys:s?[(l=s==null?void 0:s.source)==null?void 0:l.value,s==null?void 0:s.mergeId]:[],items:r,onClick:o},children:D.jsx(Z.Select,{open:!1,placeholder:e("selectGroupField"),style:{width:200},value:((u=s==null?void 0:s.field)==null?void 0:u.label)??void 0})})},__=t=>{const[e,r]=Ao(t),n=I.useMemo(()=>e!=null&&e.field?{dataSourceId:e==null?void 0:e.dataSourceId,field:e==null?void 0:e.field}:void 0,[e==null?void 0:e.field,e==null?void 0:e.dataSourceId]),i=u=>{var c;const f={condition:"=",val:"",val2:"",rdate:"exactdate"};if(u){let d=a==null?void 0:a.get(Bp(u.dataSourceId,u.field));r({...f,dataSourceId:u.dataSourceId,field:u.field,type:(c=d==null?void 0:d.field)==null?void 0:c.type})}else r({...f,dataSourceId:void 0,field:void 0,type:void 0})},{flattenFieldMap:a}=C_(),o=a==null?void 0:a.get(Bp(e==null?void 0:e.dataSourceId,e==null?void 0:e.field)),s=qS(e,["field"]),l=Tt(u=>r({...e,...u}));return D.jsxs("div",{style:{display:"flex",gap:"10px"},children:[D.jsx(vfe,{value:n,onChange:i}),D.jsx(IT,{value:s,onChange:l,field:o==null?void 0:o.field}),D.jsx(Cg,{style:{cursor:"pointer"},onClick:t.onDelete})]})};__.displayName="ConditionRowItem";const wc={"global-filter-condition__popover":"_global-filter-condition__popover_qw1om_1","global-filter-condition__block":"_global-filter-condition__block_qw1om_4","sub-popup":"_sub-popup_qw1om_10"},Ip="global-filter-condition",pfe=[],nN=t=>{const{className:e,style:r}=t,{t:n}=At(),{globalFilterCondition:i,setGlobalFilterCondition:a}=dn(),[o,s]=I.useState(!1),{globalData:l}=dn(),{fieldPickerDataSource:u,flattenFieldMap:f}=I.useMemo(()=>{let c=new Map;return{fieldPickerDataSource:((l==null?void 0:l.sourceData)||[]).map(h=>{let v=((h==null?void 0:h.fields)||[]).map(g=>{let p=Bp(h==null?void 0:h.value,g==null?void 0:g.value);return c.set(p,{field:g,source:h,mergeId:p}),{key:p,label:g==null?void 0:g.label,disabled:g.disabled??!1}});return{key:h==null?void 0:h.value,label:h==null?void 0:h.label,children:v,popupClassName:wc["sub-popup"]}}),flattenFieldMap:c}},[l==null?void 0:l.sourceData]);return D.jsx(rN.Provider,{value:{fieldPickerDataSource:u,flattenFieldMap:f},children:D.jsx("div",{className:fn(wc[`${Ip}`],e),style:r,children:D.jsx(Z.Popover,{content:D.jsx(gfe,{defaultValue:i,onClose:(c,d)=>{c&&a(d),s(!1)}}),destroyTooltipOnHide:!0,placement:"bottomRight",trigger:"click",open:o,onOpenChange:s,children:D.jsx(Z.Button,{className:`!px-1 ${((i==null?void 0:i.length)??0)>0?"!bg-primary/10":""}`,type:"text",icon:D.jsx(hfe,{}),children:n("globalfilter")})})})})};nN.displayName="GlobalFilterCondition";const gfe=t=>{const{defaultValue:e}=t,{t:r}=At(),n=C_().fieldPickerDataSource,i=RT(),[a=pfe,o]=I.useState([]);I.useEffect(()=>{e&&o(NV(e))},[e]);const[s,l]=I.useState([]),u=h=>{h!=null&&h.field&&o(v=>{let g=[...v],p=g.find(m=>m.dataSourceId===h.dataSourceId);if(p)return p.conditionList.push(h),[...g];{let m={dataSourceId:h.dataSourceId,conditionType:"all",conditionList:[h]};return[...g,m]}})},f=()=>{l([...s,{}])},c=I.useMemo(()=>!GS(a,e),[a,e]),d=Tt(()=>{var h;(h=t==null?void 0:t.onClose)==null||h.call(t,!0,a)});return D.jsxs("div",{className:fn(wc[`${Ip}__popover`]),children:[D.jsx("div",{style:{marginBottom:"10px"},children:r("setFilterCondition")}),a.map((h,v)=>{var m;let g=h==null?void 0:h.conditionList,p=(m=n==null?void 0:n.find(y=>y.key===(h==null?void 0:h.dataSourceId)))==null?void 0:m.label;return console.log("dataSourceName",p),D.jsxs("div",{className:fn(wc[`${Ip}__block`]),children:[D.jsxs("div",{style:{marginBottom:"10px",display:"flex",justifyContent:"space-between"},children:[D.jsx("div",{children:p}),D.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[r("conformTo"),D.jsx(Z.Select,{style:{width:"80px"},options:i,value:h==null?void 0:h.conditionType,onChange:y=>{o(b=>{let C=[...b];return C[v].conditionType=y,C})}}),r("condition")]})]}),D.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:g.map((y,b)=>D.jsx(__,{value:y,onChange:C=>{o(_=>{let w=[..._],x=w[v].conditionList[b];if((x==null?void 0:x.dataSourceId)!==(C==null?void 0:C.dataSourceId)){w[v].conditionList.splice(b,1),w[v].conditionList.length===0&&w.splice(v,1);let S=C,E=w.find(T=>T.dataSourceId===S.dataSourceId);if(E)return E.conditionList.push(S),[...w];{let T={dataSourceId:S.dataSourceId,conditionType:"all",conditionList:[S]};return[...w,T]}}else w[v].conditionList[b]={...x,...C};return w})},onDelete:()=>{o(C=>{let _=[...C];return _[v].conditionList.splice(b,1),_[v].conditionList.length===0&&_.splice(v,1),_})}},b))})]},h==null?void 0:h.dataSourceId)}),s.map((h,v)=>D.jsx("div",{className:fn(wc[`${Ip}__block`]),children:D.jsx(__,{value:h,onChange:g=>{u(g)},onDelete:()=>{l(g=>{let p=[...g];return p.splice(v,1),p})}})},v)),D.jsx(Z.Button,{type:"dashed",block:!0,style:{marginBottom:"10px"},icon:D.jsx(Hc,{}),onClick:()=>{f()},children:r("addCondition")}),D.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:D.jsx(Z.Button,{type:"primary",disabled:!c,onClick:()=>{d()},children:r("confirm")})})]})};/*!
|
|
164
164
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
165
165
|
*
|
|
166
166
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
@@ -175,4 +175,4 @@ echarts.use([`+M+"]);":"Unknown series "+A))}return}if(c==="tooltip"){if(b){proc
|
|
|
175
175
|
`);lr.forEach((Br,_n)=>{Br&&R.insertText(e,Br),_n!==lr.length-1&&R.insertSoftBreak(e)})},{at:N});if(U.equals(N.anchor.path,N.focus.path)){var[St,Rr]=re.edges(N),at={start:St.offset,end:Rr.offset,text:Ue};if(Ue&&u&&P==="insertCompositionText"){var yt=u.start+u.text.search(/\S|$/),Pr=at.start+at.text.search(/\S|$/);Pr===yt+1&&at.end===u.start+u.text.length?(at.start-=1,u=null,T()):u=!1}else P==="insertText"?u===null?u=at:u&&re.isCollapsed(N)&&u.end+u.text.length===St.offset?u=ng(ng({},u),{},{text:u.text+Ue}):u=!1:u=!1;if(B){p(St.path,at);return}}return m(()=>R.insertText(e,Ue),{at:N})}}}}},b=()=>!!uo.get(e),C=()=>{var M;return!!((M=an.get(e))!==null&&M!==void 0&&M.length)},_=()=>b()||C(),w=()=>i,x=M=>{fo.set(e,M),o&&(clearTimeout(o),o=null);var{selection:O}=e;if(M){var P=!O||!U.equals(O.anchor.path,M.anchor.path),N=!O||!U.equals(O.anchor.path.slice(0,-1),M.anchor.path.slice(0,-1));(P&&u||N)&&(u=!1),(P||C())&&(o=setTimeout(d,ive))}},S=()=>{(b()||!C())&&d()},E=M=>{C()||(g(!0),setTimeout(g))},T=()=>{b()||(s=setTimeout(d))},A=M=>{if(!(C()||b())&&M.some(P=>nw(e,P,M))){var O;(O=O4.get(e))===null||O===void 0||O()}};return{flush:d,scheduleFlush:T,hasPendingDiffs:C,hasPendingAction:b,hasPendingChanges:_,isFlushing:w,handleUserSelect:x,handleCompositionEnd:h,handleCompositionStart:v,handleDOMBeforeInput:y,handleKeyDown:E,handleDomMutations:A,handleInput:S}}function lve(){var t=I.useRef(!1);return I.useEffect(()=>(t.current=!0,()=>{t.current=!1}),[]),t.current}var Nc=Jp?I.useLayoutEffect:I.useEffect;function uve(t,e,r){var[n]=I.useState(()=>new MutationObserver(e));Nc(()=>{n.takeRecords()}),I.useEffect(()=>{if(!t.current)throw new Error("Failed to attach MutationObserver, `node` is undefined");return n.observe(t.current,r),()=>n.disconnect()},[n,t,r])}var fve=["node"];function H4(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function cve(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?H4(Object(r),!0).forEach(function(n){kn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):H4(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var dve={subtree:!0,childList:!0,characterData:!0},hve=Vr?t=>{var{node:e}=t,r=pu(t,fve);if(!Vr)return null;var n=oo(),i=lve(),[a]=I.useState(()=>sve(cve({editor:n},r)));return uve(e,a.handleDomMutations,dve),ew.set(n,a.scheduleFlush),i&&a.flush(),a}:()=>null,vve=["anchor","focus"],pve=["anchor","focus"],gve=(t,e)=>Object.keys(t).length===Object.keys(e).length&&Object.keys(t).every(r=>e.hasOwnProperty(r)&&t[r]===e[r]),V4=(t,e)=>{var r=pu(t,vve),n=pu(e,pve);return t[yu]===e[yu]&&gve(r,n)},mve=(t,e)=>{if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++){var n=t[r],i=e[r];if(!re.equals(n,i)||!V4(n,i))return!1}return!0},yve=(t,e)=>{if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++){var n=t[r],i=e[r];if(n.anchor.offset!==i.anchor.offset||n.focus.offset!==i.focus.offset||!V4(n,i))return!1}return!0};function W4(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function bve(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?W4(Object(r),!0).forEach(function(n){kn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):W4(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var Cve=t=>{var{isLast:e,leaf:r,parent:n,text:i}=t,a=oo(),o=ae.findPath(a,i),s=U.parent(o),l=!!r[M4];return a.isVoid(n)?I.createElement(ow,{length:ce.string(n).length}):r.text===""&&n.children[n.children.length-1]===i&&!a.isInline(n)&&R.string(a,s)===""?I.createElement(ow,{isLineBreak:!0,isMarkPlaceholder:l}):r.text===""?I.createElement(ow,{isMarkPlaceholder:l}):e&&r.text.slice(-1)===`
|
|
176
176
|
`?I.createElement($4,{isTrailing:!0,text:r.text}):I.createElement($4,{text:r.text})},$4=t=>{var{text:e,isTrailing:r=!1}=t,n=I.useRef(null),i=()=>"".concat(e??"").concat(r?`
|
|
177
177
|
`:""),[a]=I.useState(i);return Nc(()=>{var o=i();n.current&&n.current.textContent!==o&&(n.current.textContent=o)}),I.createElement(_ve,{ref:n},a)},_ve=I.memo(I.forwardRef((t,e)=>I.createElement("span",{"data-slate-string":!0,ref:e},t.children))),ow=t=>{var{length:e=0,isLineBreak:r=!1,isMarkPlaceholder:n=!1}=t,i={"data-slate-zero-width":r?"n":"z","data-slate-length":e};return n&&(i["data-slate-mark-placeholder"]=!0),I.createElement("span",bve({},i),!(Vr||S4)||!r?"\uFEFF":null,r?I.createElement("br",null):null)};function G4(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function U4(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?G4(Object(r),!0).forEach(function(n){kn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):G4(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var wve=Vr?300:0;function xve(t,e){t.current&&(t.current.disconnect(),e&&(t.current=null))}function Y4(t){t.current&&(clearTimeout(t.current),t.current=null)}var Dve=t=>{var{leaf:e,isLast:r,text:n,parent:i,renderPlaceholder:a,renderLeaf:o=y=>I.createElement(Eve,U4({},y))}=t,s=oo(),l=I.useRef(null),u=I.useRef(null),[f,c]=I.useState(!1),d=I.useRef(null),h=I.useCallback(y=>{if(xve(l,y==null),y==null){var b;K_.delete(s),(b=e.onPlaceholderResize)===null||b===void 0||b.call(e,null)}else{if(K_.set(s,y),!l.current){var C=window.ResizeObserver||Ehe;l.current=new C(()=>{var _;(_=e.onPlaceholderResize)===null||_===void 0||_.call(e,y)})}l.current.observe(y),u.current=y}},[u,e,s]),v=I.createElement(Cve,{isLast:r,leaf:e,parent:i,text:n}),g=!!e[yu];if(I.useEffect(()=>(g?d.current||(d.current=setTimeout(()=>{c(!0),d.current=null},wve)):(Y4(d),c(!1)),()=>Y4(d)),[g,c]),g&&f){var p={children:e.placeholder,attributes:{"data-slate-placeholder":!0,style:{position:"absolute",top:0,pointerEvents:"none",width:"100%",maxWidth:"100%",display:"block",opacity:"0.333",userSelect:"none",textDecoration:"none",WebkitUserModify:ks?"inherit":void 0},contentEditable:!1,ref:h}};v=I.createElement(I.Fragment,null,a(p),v)}var m={"data-slate-leaf":!0};return o({attributes:m,children:v,leaf:e,text:n})},Sve=I.memo(Dve,(t,e)=>e.parent===t.parent&&e.isLast===t.isLast&&e.renderLeaf===t.renderLeaf&&e.renderPlaceholder===t.renderPlaceholder&&e.text===t.text&&be.equals(e.leaf,t.leaf)&&e.leaf[yu]===t.leaf[yu]),Eve=t=>{var{attributes:e,children:r}=t;return I.createElement("span",U4({},e),r)},Ave=t=>{for(var{decorations:e,isLast:r,parent:n,renderPlaceholder:i,renderLeaf:a,text:o}=t,s=oo(),l=I.useRef(null),u=be.decorations(o,e),f=ae.findKey(s,o),c=[],d=0;d<u.length;d++){var h=u[d];c.push(I.createElement(Sve,{isLast:r&&d===u.length-1,key:"".concat(f.id,"-").concat(d),renderPlaceholder:i,leaf:h,text:o,parent:n,renderLeaf:a}))}var v=I.useCallback(g=>{var p=rg.get(s);g?(p==null||p.set(f,g),js.set(o,g),Pc.set(g,o)):(p==null||p.delete(f),js.delete(o),l.current&&Pc.delete(l.current)),l.current=g},[l,s,f,o]);return I.createElement("span",{"data-slate-node":"text",ref:v},c)},q4=I.memo(Ave,(t,e)=>e.parent===t.parent&&e.isLast===t.isLast&&e.renderLeaf===t.renderLeaf&&e.renderPlaceholder===t.renderPlaceholder&&e.text===t.text&&yve(e.decorations,t.decorations));function X4(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function sw(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?X4(Object(r),!0).forEach(function(n){kn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):X4(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var Tve=t=>{var{decorations:e,element:r,renderElement:n=y=>I.createElement(Mve,sw({},y)),renderPlaceholder:i,renderLeaf:a,selection:o}=t,s=oo(),l=Bve(),u=s.isInline(r),f=ae.findKey(s,r),c=I.useCallback(y=>{var b=rg.get(s);y?(b==null||b.set(f,y),js.set(r,y),Pc.set(y,r)):(b==null||b.delete(f),js.delete(r))},[s,f,r]),d=K4({decorations:e,node:r,renderElement:n,renderPlaceholder:i,renderLeaf:a,selection:o}),h={"data-slate-node":"element",ref:c};if(u&&(h["data-slate-inline"]=!0),!u&&R.hasInlines(s,r)){var v=ce.string(r),g=t4(v);g==="rtl"&&(h.dir=g)}if(R.isVoid(s,r)){h["data-slate-void"]=!0,!l&&u&&(h.contentEditable=!1);var p=u?"span":"div",[[m]]=ce.texts(r);d=I.createElement(p,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},I.createElement(q4,{renderPlaceholder:i,decorations:[],isLast:!1,parent:r,text:m})),X_.set(m,0),Z_.set(m,r)}return n({attributes:h,children:d,element:r})},Ove=I.memo(Tve,(t,e)=>t.element===e.element&&t.renderElement===e.renderElement&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&mve(t.decorations,e.decorations)&&(t.selection===e.selection||!!t.selection&&!!e.selection&&re.equals(t.selection,e.selection))),Mve=t=>{var{attributes:e,children:r,element:n}=t,i=oo(),a=i.isInline(n)?"span":"div";return I.createElement(a,sw(sw({},e),{},{style:{position:"relative"}}),r)},Z4=I.createContext(()=>[]),Rve=()=>I.useContext(Z4),Pve=I.createContext(!1),K4=t=>{var{decorations:e,node:r,renderElement:n,renderPlaceholder:i,renderLeaf:a,selection:o}=t,s=Rve(),l=oo();mu.set(l,!1);for(var u=ae.findPath(l,r),f=[],c=me.isElement(r)&&!l.isInline(r)&&R.hasInlines(l,r),d=0;d<r.children.length;d++){var h=u.concat(d),v=r.children[d],g=ae.findKey(l,v),p=R.range(l,h),m=o&&re.intersection(p,o),y=s([v,h]);for(var b of e){var C=re.intersection(b,p);C&&y.push(C)}me.isElement(v)?f.push(I.createElement(Pve.Provider,{key:"provider-".concat(g.id),value:!!m},I.createElement(Ove,{decorations:y,element:v,key:g.id,renderElement:n,renderPlaceholder:i,renderLeaf:a,selection:m}))):f.push(I.createElement(q4,{decorations:y,key:g.id,isLast:c&&d===r.children.length-1,parent:r,renderPlaceholder:i,renderLeaf:a,text:v})),X_.set(v,d),Z_.set(v,r)}return f},Q4=I.createContext(!1),Bve=()=>I.useContext(Q4),J4=I.createContext(null),ig=()=>{var t=I.useContext(J4);if(!t)throw new Error("The `useSlate` hook must be used inside the <Slate> component's context.");var{editor:e}=t;return e};function Ive(){var t=oo(),e=I.useRef(!1),r=I.useRef(0),n=I.useCallback(()=>{if(!e.current){e.current=!0;var i=ae.getWindow(t);i.cancelAnimationFrame(r.current),r.current=i.requestAnimationFrame(()=>{e.current=!1})}},[t]);return I.useEffect(()=>()=>cancelAnimationFrame(r.current),[]),{receivedUserInput:e,onUserInput:n}}var Nve=3,Lve={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",insertSoftBreak:"shift+enter",splitBlock:"enter",undo:"mod+z"},Fve={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},kve={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Lt=t=>{var e=Lve[t],r=Fve[t],n=kve[t],i=e&&G_(e),a=r&&G_(r),o=n&&G_(n);return s=>!!(i&&i(s)||E4&&a&&a(s)||!E4&&o&&o(s))},Ht={isBold:Lt("bold"),isCompose:Lt("compose"),isMoveBackward:Lt("moveBackward"),isMoveForward:Lt("moveForward"),isDeleteBackward:Lt("deleteBackward"),isDeleteForward:Lt("deleteForward"),isDeleteLineBackward:Lt("deleteLineBackward"),isDeleteLineForward:Lt("deleteLineForward"),isDeleteWordBackward:Lt("deleteWordBackward"),isDeleteWordForward:Lt("deleteWordForward"),isExtendBackward:Lt("extendBackward"),isExtendForward:Lt("extendForward"),isExtendLineBackward:Lt("extendLineBackward"),isExtendLineForward:Lt("extendLineForward"),isItalic:Lt("italic"),isMoveLineBackward:Lt("moveLineBackward"),isMoveLineForward:Lt("moveLineForward"),isMoveWordBackward:Lt("moveWordBackward"),isMoveWordForward:Lt("moveWordForward"),isRedo:Lt("redo"),isSoftBreak:Lt("insertSoftBreak"),isSplitBlock:Lt("splitBlock"),isTransposeCharacter:Lt("transposeCharacter"),isUndo:Lt("undo")},jve=(t,e)=>{var r=[],n=()=>{r=[]},i=o=>{if(e.current){var s=o.filter(l=>nw(t,l,o));r.push(...s)}};function a(){r.length>0&&(r.reverse().forEach(o=>{o.type!=="characterData"&&(o.removedNodes.forEach(s=>{o.target.insertBefore(s,o.nextSibling)}),o.addedNodes.forEach(s=>{o.target.removeChild(s)}))}),n())}return{registerMutations:i,restoreDOM:a,clear:n}},zve={subtree:!0,childList:!0,characterData:!0,characterDataOldValue:!0};class eL extends I.Component{constructor(){super(...arguments),kn(this,"context",null),kn(this,"manager",null),kn(this,"mutationObserver",null)}observe(){var e,{node:r}=this.props;if(!r.current)throw new Error("Failed to attach MutationObserver, `node` is undefined");(e=this.mutationObserver)===null||e===void 0||e.observe(r.current,zve)}componentDidMount(){var{receivedUserInput:e}=this.props,r=this.context;this.manager=jve(r,e),this.mutationObserver=new MutationObserver(this.manager.registerMutations),this.observe()}getSnapshotBeforeUpdate(){var e,r,n,i=(e=this.mutationObserver)===null||e===void 0?void 0:e.takeRecords();if(i!=null&&i.length){var a;(a=this.manager)===null||a===void 0||a.registerMutations(i)}return(r=this.mutationObserver)===null||r===void 0||r.disconnect(),(n=this.manager)===null||n===void 0||n.restoreDOM(),null}componentDidUpdate(){var e;(e=this.manager)===null||e===void 0||e.clear(),this.observe()}componentWillUnmount(){var e;(e=this.mutationObserver)===null||e===void 0||e.disconnect()}render(){return this.props.children}}kn(eL,"contextType",U_);var Hve=Vr?eL:t=>{var{children:e}=t;return I.createElement(I.Fragment,null,e)},Vve=I.createContext(!1),Wve=["autoFocus","decorate","onDOMBeforeInput","placeholder","readOnly","renderElement","renderLeaf","renderPlaceholder","scrollSelectionIntoView","style","as","disableDefaultStyles"],$ve=["text"];function tL(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ki(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?tL(Object(r),!0).forEach(function(n){kn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tL(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var Gve=t=>I.createElement(I.Fragment,null,K4(t)),Uve=I.forwardRef((t,e)=>{var r=I.useCallback(V=>I.createElement(Yve,ki({},V)),[]),{autoFocus:n,decorate:i=qve,onDOMBeforeInput:a,placeholder:o,readOnly:s=!1,renderElement:l,renderLeaf:u,renderPlaceholder:f=r,scrollSelectionIntoView:c=Xve,style:d={},as:h="div",disableDefaultStyles:v=!1}=t,g=pu(t,Wve),p=ig(),[m,y]=I.useState(!1),b=I.useRef(null),C=I.useRef([]),[_,w]=I.useState(),x=I.useRef(!1),{onUserInput:S,receivedUserInput:E}=Ive(),[,T]=I.useReducer(V=>V+1,0);O4.set(p,T),Q_.set(p,s);var A=I.useMemo(()=>({isDraggingInternally:!1,isUpdatingSelection:!1,latestElement:null,hasMarkPlaceholder:!1}),[]);I.useEffect(()=>{b.current&&n&&b.current.focus()},[n]);var M=I.useRef(),O=I.useMemo(()=>FD(()=>{if(mu.get(p)){O();return}var V=ae.toDOMNode(p,p),J=V.getRootNode();if(!x.current&&ks&&J instanceof ShadowRoot){x.current=!0;var G=Yhe();G?document.execCommand("indent"):oe.deselect(p),x.current=!1;return}var k=M.current;if((Vr||!ae.isComposing(p))&&(!A.isUpdatingSelection||k!=null&&k.isFlushing())&&!A.isDraggingInternally){var Q=ae.findDocumentOrShadowRoot(p),{activeElement:K}=Q,q=ae.toDOMNode(p,p),fe=Ic(Q);if(K===q?(A.latestElement=K,lo.set(p,!0)):lo.delete(p),!fe)return oe.deselect(p);var{anchorNode:se,focusNode:xe}=fe,ye=ae.hasEditableTarget(p,se)||ae.isTargetInsideNonReadonlyVoid(p,se),Ve=ae.hasTarget(p,xe);if(ye&&Ve){var De=ae.toSlateRange(p,fe,{exactMatch:!1,suppressThrow:!0});De&&(!ae.isComposing(p)&&!(k!=null&&k.hasPendingChanges())&&!(k!=null&&k.isFlushing())?oe.select(p,De):k==null||k.handleUserSelect(De))}s&&(!ye||!Ve)&&oe.deselect(p)}},100),[p,s,A]),P=I.useMemo(()=>xm(O,0),[O]);M.current=hve({node:b,onDOMSelectionChange:O,scheduleOnDOMSelectionChange:P}),Nc(()=>{var V,J,G;b.current&&(G=tw(b.current))?(T4.set(p,G),eg.set(p,b.current),js.set(p,b.current),Pc.set(b.current,p)):js.delete(p);var{selection:k}=p,Q=ae.findDocumentOrShadowRoot(p),K=Ic(Q);if(!(!K||!ae.isFocused(p)||(V=M.current)!==null&&V!==void 0&&V.hasPendingAction())){var q=ye=>{var Ve=K.type!=="None";if(!(!k&&!Ve)){var De=K.focusNode,Oe;if(gu&&K.rangeCount>1){var lt=K.getRangeAt(0),qt=K.getRangeAt(K.rangeCount-1);lt.startContainer===De?Oe=qt.endContainer:Oe=lt.startContainer}else Oe=K.anchorNode;var Ue=eg.get(p),St=!1;if(Ue.contains(Oe)&&Ue.contains(De)&&(St=!0),Ve&&St&&k&&!ye){var Rr=ae.toSlateRange(p,K,{exactMatch:!0,suppressThrow:!0});if(Rr&&re.equals(Rr,k)){var at;if(!A.hasMarkPlaceholder||(at=Oe)!==null&&at!==void 0&&(at=at.parentElement)!==null&&at!==void 0&&at.hasAttribute("data-slate-mark-placeholder"))return}}if(k&&!ae.hasRange(p,k)){p.selection=ae.toSlateRange(p,K,{exactMatch:!1,suppressThrow:!0});return}A.isUpdatingSelection=!0;var yt=k&&ae.toDOMRange(p,k);return yt?(ae.isComposing(p)&&!Vr?K.collapseToEnd():re.isBackward(k)?K.setBaseAndExtent(yt.endContainer,yt.endOffset,yt.startContainer,yt.startOffset):K.setBaseAndExtent(yt.startContainer,yt.startOffset,yt.endContainer,yt.endOffset),c(p,yt)):K.removeAllRanges(),yt}};K.rangeCount<=1&&q();var fe=((J=M.current)===null||J===void 0?void 0:J.isFlushing())==="action";if(!Vr||!fe){setTimeout(()=>{A.isUpdatingSelection=!1});return}var se=null,xe=requestAnimationFrame(()=>{if(fe){var ye=Ve=>{try{var De=ae.toDOMNode(p,p);De.focus(),q(Ve)}catch{}};ye(),se=setTimeout(()=>{ye(!0),A.isUpdatingSelection=!1})}});return()=>{cancelAnimationFrame(xe),se&&clearTimeout(se)}}});var N=I.useCallback(V=>{var J=ae.toDOMNode(p,p),G=J.getRootNode();if(x!=null&&x.current&&ks&&G instanceof ShadowRoot){var k=V.getTargetRanges(),Q=k[0],K=new window.Range;K.setStart(Q.startContainer,Q.startOffset),K.setEnd(Q.endContainer,Q.endOffset);var q=ae.toSlateRange(p,K,{exactMatch:!1,suppressThrow:!1});oe.select(p,q),V.preventDefault(),V.stopImmediatePropagation();return}if(S(),!s&&ae.hasEditableTarget(p,V.target)&&!Zve(V,a)){var fe;if(M.current)return M.current.handleDOMBeforeInput(V);P.flush(),O.flush();var{selection:se}=p,{inputType:xe}=V,ye=V.dataTransfer||V.data||void 0,Ve=xe==="insertCompositionText"||xe==="deleteCompositionText";if(Ve&&ae.isComposing(p))return;var De=!1;if(xe==="insertText"&&se&&re.isCollapsed(se)&&V.data&&V.data.length===1&&/[a-z ]/i.test(V.data)&&se.anchor.offset!==0&&(De=!0,p.marks&&(De=!1),!mu.get(p))){var Oe,lt,{anchor:qt}=se,[Ue,St]=ae.toDOMPoint(p,qt),Rr=(Oe=Ue.parentElement)===null||Oe===void 0?void 0:Oe.closest("a"),at=ae.getWindow(p);if(De&&Rr&&ae.hasDOMNode(p,Rr)){var yt,Pr=at==null?void 0:at.document.createTreeWalker(Rr,NodeFilter.SHOW_TEXT).lastChild();Pr===Ue&&((yt=Pr.textContent)===null||yt===void 0?void 0:yt.length)===St&&(De=!1)}if(De&&Ue.parentElement&&(at==null||(lt=at.getComputedStyle(Ue.parentElement))===null||lt===void 0?void 0:lt.whiteSpace)==="pre"){var lr=R.above(p,{at:qt.path,match:$e=>me.isElement($e)&&R.isBlock(p,$e)});lr&&ce.string(lr[0]).includes(" ")&&(De=!1)}}if((!xe.startsWith("delete")||xe.startsWith("deleteBy"))&&!mu.get(p)){var[Br]=V.getTargetRanges();if(Br){var _n=ae.toSlateRange(p,Br,{exactMatch:!1,suppressThrow:!1});if(!se||!re.equals(se,_n)){De=!1;var Cr=!Ve&&p.selection&&R.rangeRef(p,p.selection);oe.select(p,_n),Cr&&Bc.set(p,Cr)}}}if(Ve)return;if(De||V.preventDefault(),se&&re.isExpanded(se)&&xe.startsWith("delete")){var de=xe.endsWith("Backward")?"backward":"forward";R.deleteFragment(p,{direction:de});return}switch(xe){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":{R.deleteFragment(p);break}case"deleteContent":case"deleteContentForward":{R.deleteForward(p);break}case"deleteContentBackward":{R.deleteBackward(p);break}case"deleteEntireSoftLine":{R.deleteBackward(p,{unit:"line"}),R.deleteForward(p,{unit:"line"});break}case"deleteHardLineBackward":{R.deleteBackward(p,{unit:"block"});break}case"deleteSoftLineBackward":{R.deleteBackward(p,{unit:"line"});break}case"deleteHardLineForward":{R.deleteForward(p,{unit:"block"});break}case"deleteSoftLineForward":{R.deleteForward(p,{unit:"line"});break}case"deleteWordBackward":{R.deleteBackward(p,{unit:"word"});break}case"deleteWordForward":{R.deleteForward(p,{unit:"word"});break}case"insertLineBreak":R.insertSoftBreak(p);break;case"insertParagraph":{R.insertBreak(p);break}case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":{xe==="insertFromComposition"&&ae.isComposing(p)&&(y(!1),zs.set(p,!1)),(ye==null?void 0:ye.constructor.name)==="DataTransfer"?ae.insertData(p,ye):typeof ye=="string"&&(De?C.current.push(()=>R.insertText(p,ye)):R.insertText(p,ye));break}}var Be=(fe=Bc.get(p))===null||fe===void 0?void 0:fe.unref();Bc.delete(p),Be&&(!p.selection||!re.equals(p.selection,Be))&&oe.select(p,Be)}},[p,O,S,a,s,P]),F=I.useCallback(V=>{V==null?(O.cancel(),P.cancel(),eg.delete(p),js.delete(p),b.current&&so&&b.current.removeEventListener("beforeinput",N)):so&&V.addEventListener("beforeinput",N),b.current=V,typeof e=="function"?e(V):e&&(e.current=V)},[O,P,p,N,e]);Nc(()=>{var V=ae.getWindow(p);V.document.addEventListener("selectionchange",P);var J=()=>{A.isDraggingInternally=!1};return V.document.addEventListener("dragend",J),V.document.addEventListener("drop",J),()=>{V.document.removeEventListener("selectionchange",P),V.document.removeEventListener("dragend",J),V.document.removeEventListener("drop",J)}},[P,A]);var L=i([p,[]]),j=o&&p.children.length===1&&Array.from(ce.texts(p)).length===1&&ce.string(p)===""&&!m,W=I.useCallback(V=>{if(V&&j){var J;w((J=V.getBoundingClientRect())===null||J===void 0?void 0:J.height)}else w(void 0)},[j]);if(j){var B=R.start(p,[]);L.push({[yu]:!0,placeholder:o,onPlaceholderResize:W,anchor:B,focus:B})}var{marks:z}=p;if(A.hasMarkPlaceholder=!1,p.selection&&re.isCollapsed(p.selection)&&z){var{anchor:Y}=p.selection,X=ce.leaf(p,Y.path),ee=pu(X,$ve);if(!be.equals(X,z,{loose:!0})){A.hasMarkPlaceholder=!0;var te=Object.fromEntries(Object.keys(ee).map(V=>[V,null]));L.push(ki(ki(ki({[M4]:!0},te),z),{},{anchor:Y,focus:Y}))}}return I.useEffect(()=>{setTimeout(()=>{var{selection:V}=p;if(V){var{anchor:J}=V,G=ce.leaf(p,J.path);if(z&&!be.equals(G,z,{loose:!0})){ni.set(p,z);return}}ni.delete(p)})}),I.createElement(Q4.Provider,{value:s},I.createElement(Vve.Provider,{value:m},I.createElement(Z4.Provider,{value:i},I.createElement(Hve,{node:b,receivedUserInput:E},I.createElement(h,ki(ki({role:s?void 0:"textbox","aria-multiline":s?void 0:!0},g),{},{spellCheck:so||!Jp?g.spellCheck:!1,autoCorrect:so||!Jp?g.autoCorrect:"false",autoCapitalize:so||!Jp?g.autoCapitalize:"false","data-slate-editor":!0,"data-slate-node":"value",contentEditable:!s,zindex:-1,suppressContentEditableWarning:!0,ref:F,style:ki(ki({},v?{}:ki({position:"relative",whiteSpace:"pre-wrap",wordWrap:"break-word"},_?{minHeight:_}:{})),d),onBeforeInput:I.useCallback(V=>{if(!so&&!s&&!Wr(V,g.onBeforeInput)&&ae.hasSelectableTarget(p,V.target)&&(V.preventDefault(),!ae.isComposing(p))){var J=V.data;R.insertText(p,J)}},[g.onBeforeInput,p,s]),onInput:I.useCallback(V=>{if(!Wr(V,g.onInput)){if(M.current){M.current.handleInput();return}for(var J of C.current)J();if(C.current=[],!ae.isFocused(p)){var G=V.nativeEvent,k=p;if(G.inputType==="historyUndo"&&typeof k.undo=="function"){k.undo();return}if(G.inputType==="historyRedo"&&typeof k.redo=="function"){k.redo();return}}}},[g.onInput,p]),onBlur:I.useCallback(V=>{if(!(s||A.isUpdatingSelection||!ae.hasSelectableTarget(p,V.target)||Wr(V,g.onBlur))){var J=ae.findDocumentOrShadowRoot(p);if(A.latestElement!==J.activeElement){var{relatedTarget:G}=V,k=ae.toDOMNode(p,p);if(G!==k&&!(jn(G)&&G.hasAttribute("data-slate-spacer"))){if(G!=null&&co(G)&&ae.hasDOMNode(p,G)){var Q=ae.toSlateNode(p,G);if(me.isElement(Q)&&!p.isVoid(Q))return}if(ks){var K=Ic(J);K==null||K.removeAllRanges()}lo.delete(p)}}}},[s,A.isUpdatingSelection,A.latestElement,p,g.onBlur]),onClick:I.useCallback(V=>{if(ae.hasTarget(p,V.target)&&!Wr(V,g.onClick)&&co(V.target)){var J=ae.toSlateNode(p,V.target),G=ae.findPath(p,J);if(!R.hasPath(p,G)||ce.get(p,G)!==J)return;if(V.detail===Nve&&G.length>=1){var k=G;if(!(me.isElement(J)&&R.isBlock(p,J))){var Q,K=R.above(p,{match:De=>me.isElement(De)&&R.isBlock(p,De),at:G});k=(Q=K==null?void 0:K[1])!==null&&Q!==void 0?Q:G.slice(0,1)}var q=R.range(p,k);oe.select(p,q);return}if(s)return;var fe=R.start(p,G),se=R.end(p,G),xe=R.void(p,{at:fe}),ye=R.void(p,{at:se});if(xe&&ye&&U.equals(xe[1],ye[1])){var Ve=R.range(p,fe);oe.select(p,Ve)}}},[p,g.onClick,s]),onCompositionEnd:I.useCallback(V=>{if(ae.hasSelectableTarget(p,V.target)){var J;if(ae.isComposing(p)&&Promise.resolve().then(()=>{y(!1),zs.set(p,!1)}),(J=M.current)===null||J===void 0||J.handleCompositionEnd(V),Wr(V,g.onCompositionEnd)||Vr)return;if(!ks&&!Lhe&&!S4&&!khe&&!Fhe&&V.data){var G=ni.get(p);ni.delete(p),G!==void 0&&(ya.set(p,p.marks),p.marks=G),R.insertText(p,V.data);var k=ya.get(p);ya.delete(p),k!==void 0&&(p.marks=k)}}},[g.onCompositionEnd,p]),onCompositionUpdate:I.useCallback(V=>{ae.hasSelectableTarget(p,V.target)&&!Wr(V,g.onCompositionUpdate)&&(ae.isComposing(p)||(y(!0),zs.set(p,!0)))},[g.onCompositionUpdate,p]),onCompositionStart:I.useCallback(V=>{if(ae.hasSelectableTarget(p,V.target)){var J;if((J=M.current)===null||J===void 0||J.handleCompositionStart(V),Wr(V,g.onCompositionStart)||Vr)return;y(!0);var{selection:G}=p;if(G&&re.isExpanded(G)){R.deleteFragment(p);return}}},[g.onCompositionStart,p]),onCopy:I.useCallback(V=>{ae.hasSelectableTarget(p,V.target)&&!Wr(V,g.onCopy)&&!rL(V)&&(V.preventDefault(),ae.setFragmentData(p,V.clipboardData,"copy"))},[g.onCopy,p]),onCut:I.useCallback(V=>{if(!s&&ae.hasSelectableTarget(p,V.target)&&!Wr(V,g.onCut)&&!rL(V)){V.preventDefault(),ae.setFragmentData(p,V.clipboardData,"cut");var{selection:J}=p;if(J)if(re.isExpanded(J))R.deleteFragment(p);else{var G=ce.parent(p,J.anchor.path);R.isVoid(p,G)&&oe.delete(p)}}},[s,p,g.onCut]),onDragOver:I.useCallback(V=>{if(ae.hasTarget(p,V.target)&&!Wr(V,g.onDragOver)){var J=ae.toSlateNode(p,V.target);me.isElement(J)&&R.isVoid(p,J)&&V.preventDefault()}},[g.onDragOver,p]),onDragStart:I.useCallback(V=>{if(!s&&ae.hasTarget(p,V.target)&&!Wr(V,g.onDragStart)){var J=ae.toSlateNode(p,V.target),G=ae.findPath(p,J),k=me.isElement(J)&&R.isVoid(p,J)||R.void(p,{at:G,voids:!0});if(k){var Q=R.range(p,G);oe.select(p,Q)}A.isDraggingInternally=!0,ae.setFragmentData(p,V.dataTransfer,"drag")}},[s,p,g.onDragStart,A]),onDrop:I.useCallback(V=>{if(!s&&ae.hasTarget(p,V.target)&&!Wr(V,g.onDrop)){V.preventDefault();var J=p.selection,G=ae.findEventRange(p,V),k=V.dataTransfer;oe.select(p,G),A.isDraggingInternally&&J&&!re.equals(J,G)&&!R.void(p,{at:G,voids:!0})&&oe.delete(p,{at:J}),ae.insertData(p,k),ae.isFocused(p)||ae.focus(p)}},[s,p,g.onDrop,A]),onDragEnd:I.useCallback(V=>{!s&&A.isDraggingInternally&&g.onDragEnd&&ae.hasTarget(p,V.target)&&g.onDragEnd(V)},[s,A,g,p]),onFocus:I.useCallback(V=>{if(!s&&!A.isUpdatingSelection&&ae.hasEditableTarget(p,V.target)&&!Wr(V,g.onFocus)){var J=ae.toDOMNode(p,p),G=ae.findDocumentOrShadowRoot(p);if(A.latestElement=G.activeElement,gu&&V.target!==J){J.focus();return}lo.set(p,!0)}},[s,A,p,g.onFocus]),onKeyDown:I.useCallback(V=>{if(!s&&ae.hasEditableTarget(p,V.target)){var J;(J=M.current)===null||J===void 0||J.handleKeyDown(V);var{nativeEvent:G}=V;if(ae.isComposing(p)&&G.isComposing===!1&&(zs.set(p,!1),y(!1)),Wr(V,g.onKeyDown)||ae.isComposing(p))return;var{selection:k}=p,Q=p.children[k!==null?k.focus.path[0]:0],K=t4(ce.string(Q))==="rtl";if(Ht.isRedo(G)){V.preventDefault();var q=p;typeof q.redo=="function"&&q.redo();return}if(Ht.isUndo(G)){V.preventDefault();var fe=p;typeof fe.undo=="function"&&fe.undo();return}if(Ht.isMoveLineBackward(G)){V.preventDefault(),oe.move(p,{unit:"line",reverse:!0});return}if(Ht.isMoveLineForward(G)){V.preventDefault(),oe.move(p,{unit:"line"});return}if(Ht.isExtendLineBackward(G)){V.preventDefault(),oe.move(p,{unit:"line",edge:"focus",reverse:!0});return}if(Ht.isExtendLineForward(G)){V.preventDefault(),oe.move(p,{unit:"line",edge:"focus"});return}if(Ht.isMoveBackward(G)){V.preventDefault(),k&&re.isCollapsed(k)?oe.move(p,{reverse:!K}):oe.collapse(p,{edge:K?"end":"start"});return}if(Ht.isMoveForward(G)){V.preventDefault(),k&&re.isCollapsed(k)?oe.move(p,{reverse:K}):oe.collapse(p,{edge:K?"start":"end"});return}if(Ht.isMoveWordBackward(G)){V.preventDefault(),k&&re.isExpanded(k)&&oe.collapse(p,{edge:"focus"}),oe.move(p,{unit:"word",reverse:!K});return}if(Ht.isMoveWordForward(G)){V.preventDefault(),k&&re.isExpanded(k)&&oe.collapse(p,{edge:"focus"}),oe.move(p,{unit:"word",reverse:K});return}if(so){if((A4||ks)&&k&&(Ht.isDeleteBackward(G)||Ht.isDeleteForward(G))&&re.isCollapsed(k)){var se=ce.parent(p,k.anchor.path);if(me.isElement(se)&&R.isVoid(p,se)&&(R.isInline(p,se)||R.isBlock(p,se))){V.preventDefault(),R.deleteBackward(p,{unit:"block"});return}}}else{if(Ht.isBold(G)||Ht.isItalic(G)||Ht.isTransposeCharacter(G)){V.preventDefault();return}if(Ht.isSoftBreak(G)){V.preventDefault(),R.insertSoftBreak(p);return}if(Ht.isSplitBlock(G)){V.preventDefault(),R.insertBreak(p);return}if(Ht.isDeleteBackward(G)){V.preventDefault(),k&&re.isExpanded(k)?R.deleteFragment(p,{direction:"backward"}):R.deleteBackward(p);return}if(Ht.isDeleteForward(G)){V.preventDefault(),k&&re.isExpanded(k)?R.deleteFragment(p,{direction:"forward"}):R.deleteForward(p);return}if(Ht.isDeleteLineBackward(G)){V.preventDefault(),k&&re.isExpanded(k)?R.deleteFragment(p,{direction:"backward"}):R.deleteBackward(p,{unit:"line"});return}if(Ht.isDeleteLineForward(G)){V.preventDefault(),k&&re.isExpanded(k)?R.deleteFragment(p,{direction:"forward"}):R.deleteForward(p,{unit:"line"});return}if(Ht.isDeleteWordBackward(G)){V.preventDefault(),k&&re.isExpanded(k)?R.deleteFragment(p,{direction:"backward"}):R.deleteBackward(p,{unit:"word"});return}if(Ht.isDeleteWordForward(G)){V.preventDefault(),k&&re.isExpanded(k)?R.deleteFragment(p,{direction:"forward"}):R.deleteForward(p,{unit:"word"});return}}}},[s,p,g.onKeyDown]),onPaste:I.useCallback(V=>{!s&&ae.hasEditableTarget(p,V.target)&&!Wr(V,g.onPaste)&&(!so||Hhe(V.nativeEvent)||ks)&&(V.preventDefault(),ae.insertData(p,V.clipboardData))},[s,p,g.onPaste])}),I.createElement(Gve,{decorations:L,node:p,renderElement:l,renderPlaceholder:f,renderLeaf:u,selection:p.selection}))))))}),Yve=t=>{var{attributes:e,children:r}=t;return I.createElement("span",ki({},e),r,Vr&&I.createElement("br",null))},qve=()=>[],Xve=(t,e)=>{if(e.getBoundingClientRect&&(!t.selection||t.selection&&re.isCollapsed(t.selection))){var r=e.startContainer.parentElement;r.getBoundingClientRect=e.getBoundingClientRect.bind(e),ahe(r,{scrollMode:"if-needed"}),delete r.getBoundingClientRect}},Wr=(t,e)=>{if(!e)return!1;var r=e(t);return r??(t.isDefaultPrevented()||t.isPropagationStopped())},rL=t=>co(t.target)&&(t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement),Zve=(t,e)=>{if(!e)return!1;var r=e(t);return r??t.defaultPrevented},nL=I.createContext(!1),Kve=()=>I.useContext(nL),Qve=I.createContext({});function Jve(t){var e=I.useRef([]).current,r=I.useRef({editor:t}).current,n=I.useCallback(a=>{r.editor=a,e.forEach(o=>o(a))},[e,r]),i=I.useMemo(()=>({getSlate:()=>r.editor,addEventListener:a=>(e.push(a),()=>{e.splice(e.indexOf(a),1)})}),[e,r]);return{selectorContext:i,onChange:n}}var epe=["editor","children","onChange","onSelectionChange","onValueChange","initialValue"],tpe=t=>{var{editor:e,children:r,onChange:n,onSelectionChange:i,onValueChange:a,initialValue:o}=t,s=pu(t,epe),[l,u]=I.useState(()=>{if(!ce.isNodeList(o))throw new Error("[Slate] initialValue is invalid! Expected a list of elements but got: ".concat(vr.stringify(o)));if(!R.isEditor(e))throw new Error("[Slate] editor is invalid! You passed: ".concat(vr.stringify(e)));return e.children=o,Object.assign(e,s),{v:0,editor:e}}),{selectorContext:f,onChange:c}=Jve(e),d=I.useCallback(g=>{var p;switch(n&&n(e.children),g==null||(p=g.operation)===null||p===void 0?void 0:p.type){case"set_selection":i==null||i(e.selection);break;default:a==null||a(e.children)}u(m=>({v:m.v+1,editor:e})),c(e)},[e,c,n,i,a]);I.useEffect(()=>(J_.set(e,d),()=>{J_.set(e,()=>{})}),[e,d]);var[h,v]=I.useState(ae.isFocused(e));return I.useEffect(()=>{v(ae.isFocused(e))},[e]),Nc(()=>{var g=()=>v(ae.isFocused(e));return D4>=17?(document.addEventListener("focusin",g),document.addEventListener("focusout",g),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",g)}):(document.addEventListener("focus",g,!0),document.addEventListener("blur",g,!0),()=>{document.removeEventListener("focus",g,!0),document.removeEventListener("blur",g,!0)})},[]),I.createElement(Qve.Provider,{value:f},I.createElement(J4.Provider,{value:l},I.createElement(U_.Provider,{value:l.editor},I.createElement(nL.Provider,{value:h},r))))},iL=(t,e)=>{var r=(e.top+e.bottom)/2;return t.top<=r&&t.bottom>=r},aL=(t,e,r)=>{var n=ae.toDOMRange(t,e).getBoundingClientRect(),i=ae.toDOMRange(t,r).getBoundingClientRect();return iL(n,i)&&iL(i,n)},rpe=(t,e)=>{var r=R.range(t,re.end(e)),n=Array.from(R.positions(t,{at:e})),i=0,a=n.length,o=Math.floor(a/2);if(aL(t,R.range(t,n[i]),r))return R.range(t,n[i],r);if(n.length<2)return R.range(t,n[n.length-1],r);for(;o!==n.length&&o!==i;)aL(t,R.range(t,n[o]),r)?a=o:i=o,o=Math.floor((i+a)/2);return R.range(t,n[a],r)};function oL(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function sL(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?oL(Object(r),!0).forEach(function(n){kn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):oL(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var npe=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"x-slate-fragment",n=e,{apply:i,onChange:a,deleteBackward:o,addMark:s,removeMark:l}=n;return rg.set(n,new WeakMap),n.addMark=(u,f)=>{var c,d;(c=ew.get(n))===null||c===void 0||c(),!ni.get(n)&&(d=an.get(n))!==null&&d!==void 0&&d.length&&ni.set(n,null),ya.delete(n),s(u,f)},n.removeMark=u=>{var f;!ni.get(n)&&(f=an.get(n))!==null&&f!==void 0&&f.length&&ni.set(n,null),ya.delete(n),l(u)},n.deleteBackward=u=>{if(u!=="line")return o(u);if(n.selection&&re.isCollapsed(n.selection)){var f=R.above(n,{match:v=>me.isElement(v)&&R.isBlock(n,v),at:n.selection});if(f){var[,c]=f,d=R.range(n,c,n.selection.anchor),h=rpe(n,d);re.isCollapsed(h)||oe.delete(n,{at:h})}}},n.apply=u=>{var f=[],c=[],d=an.get(n);if(d!=null&&d.length){var h=d.map(P=>rve(P,u)).filter(Boolean);an.set(n,h)}var v=fo.get(n);v&&fo.set(n,j4(n,v,u));var g=uo.get(n);if(g!=null&&g.at){var p=Ye.isPoint(g==null?void 0:g.at)?aw(n,g.at,u):j4(n,g.at,u);uo.set(n,p?sL(sL({},g),{},{at:p}):null)}switch(u.type){case"insert_text":case"remove_text":case"set_node":case"split_node":{f.push(...bu(n,u.path));break}case"set_selection":{var m;(m=Bc.get(n))===null||m===void 0||m.unref(),Bc.delete(n);break}case"insert_node":case"remove_node":{f.push(...bu(n,U.parent(u.path)));break}case"merge_node":{var y=U.previous(u.path);f.push(...bu(n,y));break}case"move_node":{var b=U.common(U.parent(u.path),U.parent(u.newPath));f.push(...bu(n,b));var C;U.isBefore(u.path,u.newPath)?(f.push(...bu(n,U.parent(u.path))),C=u.newPath):(f.push(...bu(n,U.parent(u.newPath))),C=u.path);var _=ce.get(e,U.parent(C)),w=ae.findKey(n,_),x=R.pathRef(n,U.parent(C));c.push([x,w]);break}}switch(i(u),u.type){case"insert_node":case"remove_node":case"merge_node":case"move_node":case"split_node":mu.set(n,!0)}for(var[S,E]of f){var[T]=R.node(n,S);tg.set(T,E)}for(var[A,M]of c){if(A.current){var[O]=R.node(n,A.current);tg.set(O,M)}A.unref()}},n.setFragmentData=u=>{var{selection:f}=n;if(f){var[c,d]=re.edges(f),h=R.void(n,{at:c.path}),v=R.void(n,{at:d.path});if(!(re.isCollapsed(f)&&!h)){var g=ae.toDOMRange(n,f),p=g.cloneContents(),m=p.childNodes[0];if(p.childNodes.forEach(T=>{T.textContent&&T.textContent.trim()!==""&&(m=T)}),v){var[y]=v,b=g.cloneRange(),C=ae.toDOMNode(n,y);b.setEndAfter(C),p=b.cloneContents()}if(h&&(m=p.querySelector("[data-slate-spacer]")),Array.from(p.querySelectorAll("[data-slate-zero-width]")).forEach(T=>{var A=T.getAttribute("data-slate-zero-width")==="n";T.textContent=A?`
|
|
178
|
-
`:""}),P4(m)){var _=m.ownerDocument.createElement("span");_.style.whiteSpace="pre",_.appendChild(m),p.appendChild(_),m=_}var w=n.getFragment(),x=JSON.stringify(w),S=window.btoa(encodeURIComponent(x));m.setAttribute("data-slate-fragment",S),u.setData("application/".concat(r),S);var E=p.ownerDocument.createElement("div");return E.appendChild(p),E.setAttribute("hidden","true"),p.ownerDocument.body.appendChild(E),u.setData("text/html",E.innerHTML),u.setData("text/plain",I4(E)),p.ownerDocument.body.removeChild(E),u}}},n.insertData=u=>{n.insertFragmentData(u)||n.insertTextData(u)},n.insertFragmentData=u=>{var f=u.getData("application/".concat(r))||Uhe(u);if(f){var c=decodeURIComponent(window.atob(f)),d=JSON.parse(c);return n.insertFragment(d),!0}return!1},n.insertTextData=u=>{var f=u.getData("text/plain");if(f){var c=f.split(/\r\n|\r|\n/),d=!1;for(var h of c)d&&oe.splitNodes(n,{always:!0}),n.insertText(h),d=!0;return!0}return!1},n.onChange=u=>{var f=D4<18?vo.unstable_batchedUpdates:c=>c();f(()=>{var c=J_.get(n);c&&c(u),a(u)})},n},bu=(t,e)=>{var r=[];for(var[n,i]of R.levels(t,{at:e})){var a=ae.findKey(t,n);r.push([i,a])}return r};const lL=(t,e)=>{const r=I.useRef(null),n=(...i)=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{t(...i)},e)};return I.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]),n},uL=["numbered-list","bulleted-list"],ag=["left","center","right","justify"],ipe=({children:t})=>typeof document=="object"?vo.createPortal(t,document.body):null,ape=({defaultValue:t,onChange:e})=>{const{t:r}=At(),n=I.useCallback(s=>D.jsx(spe,{...s}),[]),i=I.useCallback(s=>D.jsx(lpe,{...s}),[]),a=I.useMemo(()=>Zde(npe(qde())),[]),o=lL(s=>{e==null||e(s)},300);return D.jsx("div",{style:{width:"100%",height:"100%"},children:D.jsxs(tpe,{editor:a,initialValue:t,onChange:o,children:[D.jsx(upe,{}),D.jsx(Uve,{style:{width:"100%",height:"100%",outline:"none"},className:"prose prose-sm",renderElement:n,renderLeaf:i,spellCheck:!0,autoFocus:!0,placeholder:r("pleaseEnter"),onDOMBeforeInput:s=>{switch(s.inputType){case"formatBold":return s.preventDefault(),og(a,"bold");case"formatItalic":return s.preventDefault(),og(a,"italic");case"formatUnderline":return s.preventDefault(),og(a,"underlined")}}})]})})},ope=(t,e)=>{const r=fL(t,e,ag.includes(e)?"align":"type"),n=uL.includes(e);oe.unwrapNodes(t,{match:a=>!R.isEditor(a)&&me.isElement(a)&&uL.includes(a.type)&&!ag.includes(e),split:!0});const i={};if(ag.includes(e)?i.align=r?void 0:e:i.type=r?"paragraph":n?"list-item":e,oe.setNodes(t,i),!r&&n){const a={type:e,children:[]};oe.wrapNodes(t,a)}},og=(t,e)=>{cL(t,e)?R.removeMark(t,e):R.addMark(t,e,!0)},fL=(t,e,r="type")=>{const{selection:n}=t;if(!n)return!1;const[i]=Array.from(R.nodes(t,{at:R.unhangRange(t,n),match:a=>!R.isEditor(a)&&me.isElement(a)&&a[r]===e}));return!!i},cL=(t,e)=>{const r=R.marks(t);return r?r[e]===!0:!1},spe=({attributes:t,children:e,element:r})=>{const n={textAlign:r.align};switch(r.type){case"block-quote":return D.jsx("blockquote",{style:n,...t,children:e});case"bulleted-list":return D.jsx("ul",{style:n,...t,children:e});case"heading-one":return D.jsx("h1",{style:n,...t,children:e});case"heading-two":return D.jsx("h2",{style:n,...t,children:e});case"list-item":return D.jsx("li",{style:n,...t,children:e});case"numbered-list":return D.jsx("ol",{style:n,...t,children:e});default:return D.jsx("p",{style:n,...t,children:e})}},lpe=({attributes:t,children:e,leaf:r})=>(r.bold&&(e=D.jsx("strong",{children:e})),r.code&&(e=D.jsx("code",{children:e})),r.italic&&(e=D.jsx("em",{children:e})),r.underline&&(e=D.jsx("u",{children:e})),D.jsx("span",{...t,children:e})),upe=()=>{const t=I.useRef(null),e=ig(),r=Kve();return I.useEffect(()=>{const n=t.current,{selection:i}=e;if(!n)return;if(!i||!r||re.isCollapsed(i)||R.string(e,i)===""){n.removeAttribute("style");return}const a=window.getSelection(),o=a==null?void 0:a.getRangeAt(0),s=o==null?void 0:o.getBoundingClientRect();n.style.opacity="1",s&&(n.style.top=`${s.top+window.pageYOffset-n.offsetHeight}px`,n.style.left=`${s.left+window.pageXOffset-n.offsetWidth/2+s.width/2}px`)}),D.jsx(ipe,{children:D.jsxs("div",{ref:t,className:"editor-menu",onMouseDown:n=>{n.preventDefault()},children:[D.jsx(lw,{format:"bold",icon:D.jsx(Gw,{})}),D.jsx(lw,{format:"italic",icon:D.jsx(Qw,{})}),D.jsx(lw,{format:"underline",icon:D.jsx(tx,{})}),D.jsx(Cu,{format:"numbered-list",icon:D.jsx(ex,{})}),D.jsx(Cu,{format:"bulleted-list",icon:D.jsx(rx,{})}),D.jsx(Cu,{format:"left",icon:D.jsx(Vw,{})}),D.jsx(Cu,{format:"center",icon:D.jsx(Hw,{})}),D.jsx(Cu,{format:"right",icon:D.jsx(Ww,{})}),D.jsx(Cu,{format:"justify",icon:D.jsx(Xw,{})})]})})},lw=({format:t,icon:e})=>{const r=ig();return D.jsx(Z.Button,{onClick:()=>og(r,t),icon:e,color:cL(r,t)?"primary":"default",variant:"text"})},Cu=({format:t,icon:e})=>{const r=ig();return D.jsx(Z.Button,{color:fL(r,t,ag.includes(t)?"align":"type")?"primary":"default",icon:e,variant:"text",onClick:()=>{ope(r,t)}})},fpe=({defaultValue:t,onChange:e})=>D.jsx("div",{style:{width:"100%",height:"100%",overflowY:"auto",padding:"0 10px"},children:D.jsx(ape,{defaultValue:t,onChange:e})}),cpe=I.memo(fpe);function dpe(t,e){return GS(t.module,e.module)}const hpe=I.memo(({module:t,onUpdate:e,moduleDataApi:r,rowWidth:n,rowHeight:i})=>{var a,o;return D.jsx("div",{className:"module-content isNoCanDrag",style:{overflow:(a=t.type)!=null&&a.includes("chart")?"inherit":"hidden"},children:D.jsxs("div",{className:"dashboard-grid-container",children:[t.type==="text"?D.jsx(cpe,{defaultValue:t.customData.editor,onChange:s=>{t.id&&e(t.id,{type:"text",customData:{title:t.customData.title,editor:s}})}}):null,t.type==="statistics"?D.jsx(tN,{customData:t.customData,customeStyle:t.customeStyle,moduleDataApi:r,width:t.w,height:t.h,rowWidth:n,rowHeight:i}):null,t.type==="calendar"?D.jsx(OT,{customData:t.customData,moduleDataApi:r,width:t.w,height:t.h,rowWidth:n,rowHeight:i}):null,(o=t.type)!=null&&o.includes("chart")?D.jsx(Z8,{width:t.w,height:t.h,customData:t.customData,customeStyle:t.customeStyle,moduleDataApi:r}):null]})})},dpe),vpe=()=>D.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-icon":"DragOutlined",children:D.jsx("path",{d:"M8.25 6.5a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5Zm0 7.25a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5Zm1.75 5.5a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0ZM14.753 6.5a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5ZM16.5 12a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0Zm-1.747 9a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5Z",fill:"#999"})}),ppe=()=>D.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-icon":"MoreVerticalOutlined",children:D.jsx("path",{d:"M12 5.5A1.75 1.75 0 1 1 12 2a1.75 1.75 0 0 1 0 3.5Zm0 8.225a1.75 1.75 0 1 1 0-3.5 1.75 1.75 0 0 1 0 3.5ZM12 22a1.75 1.75 0 1 1 0-3.5 1.75 1.75 0 0 1 0 3.5Z",fill:"currentColor"})}),gpe=({defaultValue:t,onChange:e,module:r,onDropdownItem:n,onMouseDown:i,onMouseUp:a})=>{const[o,s]=I.useState(!1),[l,u]=I.useState(""),f=I.useRef(null),c=lL(g=>{e==null||e(g)},300),{t:d}=At();I.useEffect(()=>{u(l)},[t]);const h=()=>{var p;((p=f.current)==null?void 0:p.input).select()},v=g=>{g.key==="Enter"&&s(!1)};return I.useEffect(()=>{o||u(g=>g.trim())},[o]),D.jsxs("div",{className:"layout-item-head isCanDrag",onMouseDown:()=>{i==null||i()},onMouseUp:()=>{a==null||a()},children:[D.jsxs("div",{className:"head-inner",children:[D.jsx("span",{className:"title",children:D.jsx("span",{className:"title-child",onDoubleClick:g=>{g.stopPropagation(),s(!0),setTimeout(()=>{var p;(p=f.current)==null||p.focus()},100)},children:o?D.jsx(Z.Input,{defaultValue:t,onBlur:()=>{s(!1)},ref:f,onKeyDown:v,onDoubleClick:h,onChange:g=>{u(g.target.value),c(g.target.value)}}):t})}),D.jsx("div",{className:"menu-slot isNoCanDrag",children:D.jsx(Z.Dropdown,{trigger:["click"],menu:{items:[r.type!=="text"?{label:d("configuration"),key:"edit"}:null,{label:d("copy"),key:"copy"},{key:"delete",danger:!0,label:d("delete")}],onClick:({key:g})=>{n==null||n(g)}},children:D.jsx("button",{type:"button",className:"dashboard-grid-menu-button",children:D.jsx("span",{className:"universe-icon",children:D.jsx(ppe,{})})})})})]}),D.jsx("div",{className:"drag isCanDrag",children:D.jsx("span",{className:"universe-icon drag-icon",children:D.jsx(vpe,{})})})]})},mpe=I.memo(gpe),ype={...{title:"Dashboard",text:"Text",confirm:"Confirm",pleaseEnter:"Please enter",configuration:"Configuration",copy:"Copy",delete:"Delete",calendarText:"Calendar",chartText:"Chart",promptTitle:"Prompt",promptContentDeleteComponents:"Are you sure you want to delete this component?",unnamedRecord:"Unnamed Record",setFilteringCriteria:"Set filtering criteria",all:"All",everyone:"Any",condition:"Condition",addCondition:"Add condition",equalto:"Equal to",notequalto:"Not equal to",contain:"Contains",notcontain:"Does not contain",null:"Is empty",notnull:"Is not empty",conformTo:"Match the following",statisticsText:"Statistics Text",typeData:"Type and Data",customStyle:"Custom Style",dataSource:"Data Source",dataRange:"Data Range",data:"Data",filterData:"Filter Data",selectNcondition:"Selected {{n}} conditions",allData:"All Data",statisticstMethods:"Statistical Methods",statisticstRecordNum:"Total Number of Records",statisticstFieldVal:"Statistical Field Values",selectField:"Select Field",sumVal:"Sum",maxVal:"Maximum Value",minVal:"Minimum Value",averageVal:"Average Value",empty:"No Data",filter:"Filter",globalfilter:"Global Filter",setFilterCondition:"Set Filter Condition",selectGroupField:"Select Group Field"},displayRange:{title:"Display Data",all:"All",top5:"Top 5",top10:"Top 10",top20:"Top 20",top30:"Top 30",bottom5:"Bottom 5",bottom10:"Bottom 10",bottom20:"Bottom 20",bottom30:"Bottom 30"},pb:{text:"text",statisticsText:"Statistics",unknown:"unknown"},statistics:{t1:"Color Scheme",t2:"Value Settings",t3:"Decimal Places and Format",t4:"Please enter decimal places",t5:"Number (Thousand Separator)",t6:"Number",t7:"Percentage",currency:"Currency",t8:"Renminbi",t9:"Dollar",t10:"Statistical Value Description",t11:"EUR",t12:"GBP",t13:"THB"},chart:{t1:"Chart Type",t2:"Basic Bar Chart",t3:"Stacked Bar Chart",t4:"Percentage Bar Chart",t5:"Basic Horizontal Bar Chart",t6:"Stacked Horizontal Bar Chart",t7:"Percentage Stacked Horizontal Bar Chart",t8:"Line Chart",t9:"Smooth Line Chart",t10:"Pie Chart",t11:"Doughnut Chart",t12:"Chart Options",_t12:"Combination Chart",t13:"Legend",t14:"Data Label",t15:"Axis",t16:"Grid Line",t17:"Sector Division",t18:"Horizontal Axis (Category)",t19:"Sector Value",t20:"Vertical Axis (Field)",t21:"Horizontal Axis",t22:"Horizontal Axis Title",t23:"Axis Options",t24:"Show Labels",t25:"Show Axis Line",t26:"Vertical Axis",t27:"Vertical Axis Title",t28:"Axis Options",t29:"Show Labels",t30:"Show Axis Line",t31:"Sort By",t32:"Horizontal Axis Value",t33:"Vertical Axis Value",t34:"Record Sequence",t35:"Sort Order",t36:"Ascending",t37:"Descending",t38:"Grouping And Aggregation",t39:"Aggregate by time",t40:"Aggregate by day",t41:"Aggregate by week",t42:"Aggregate by month",t43:"Aggregate by year",groupFieldConfig:"Group Field Configuration",left:"Left",right:"Right"},calendar:{t1:"View Configuration",t2:"Start Date",t3:"End Date",t4:"Title Display"},add:{add1:"Chart",add2:"Bar Chart",add3:"Line Chart",add4:"Pie Chart",add5:"Bar Graph",_add5:"Combination Chart",add6:"Other",add7:"Statistics",add8:"Text",add9:"Calendar",add10:"Add Block",add11:"Equal to",add12:"Not Equal to",add13:"Equal to",add14:"Before(<)",add15:"After(>)",add16:"Within Range",timeBefore:"Before (excluding the day)",timeAfter:"After (excluding the day)",timeRange:"Date Range (including the day)",add17:"Is Empty",add18:"Is Not Empty",add19:"Not Equal to",add20:"Greater than",add21:"Greater than or Equal to",add22:"Less than",add23:"Less than or Equal to",add24:"Contains",add25:"Does Not Contain",add26:"Specific Date",add27:"Today",add28:"Yesterday",add29:"This Week",add30:"Last Week",add31:"This Month",add32:"Last Month",add33:"Past 7 Days",add34:"Past 30 Days",add35:"Last Year",add36:"This Year",add37:"The Month Before Last"}},bpe={...{title:"仪表盘",text:"文本",confirm:"确定",pleaseEnter:"请输入",configuration:"配置",copy:"复制",delete:"删除",calendarText:"日历",chartText:"图表",promptTitle:"提示",promptContentDeleteComponents:"确认删除组件?",unnamedRecord:"未命名记录",setFilteringCriteria:"设置筛选条件",all:"所有",everyone:"任一",condition:"条件",addCondition:"添加条件",equalto:"等于",notequalto:"不等于",contain:"包含",notcontain:"不包含",null:"为空",notnull:"不为空",conformTo:"符合以下",statisticsText:"统计文字",typeData:"类型与数据",customStyle:"自定义样式",dataSource:"数据源",dataRange:"数据范围",data:"数据",filterData:"筛选数据",selectNcondition:"已选{{n}}个条件",allData:"全部数据",statisticstMethods:"统计方式",statisticstRecordNum:"统计记录总数",statisticstFieldVal:"统计字段数值",selectField:"选择字段",sumVal:"求和",maxVal:"最大值",minVal:"最小值",averageVal:"平均值",empty:"暂无数据",filter:"筛选",globalfilter:"全局筛选",setFilterCondition:"设置筛选条件",selectGroupField:"选择分组字段"},displayRange:{title:"显示数据量",all:"全部",top5:"前5项",top10:"前10项",top20:"前20项",top30:"前30项",bottom5:"后5项",bottom10:"后10项",bottom20:"后20项",bottom30:"后30项"},pb:{text:"文本",statisticsText:"统计",unknown:"未知"},statistics:{t1:"配色方案",t2:"数值设置",t3:"小数位数与格式",t4:"请输入小数位数",t5:"数字(千分位)",t6:"数字",t7:"百分比",currency:"币种",t8:"人民币",t9:"美元",t10:"统计数值说明",t11:"欧元",t12:"英镑",t13:"泰铢"},chart:{t1:"图表类型",t2:"基础柱状图",t3:"堆积柱状图",t4:"百分比堆积柱状图",t5:"基础条形图",t6:"堆积条形图",t7:"百分比堆积条形图",t8:"折线图",t9:"平滑折线图",t10:"饼图",t11:"环形图",_t12:"组合图",t12:"图标选项",t13:"图例",t14:"数据标签",t15:"坐标轴",t16:"网格线",t17:"扇形分区",t18:"横轴(类别)",t19:"扇形数值",t20:"纵轴(字段)",t21:"横轴",t22:"横轴标题",t23:"坐标轴选项",t24:"显示标签",t25:"显示轴线",t26:"纵轴",t27:"纵轴标题",t28:"坐标轴选项",t29:"显示标签",t30:"显示轴线",t31:"排序依据",t32:"横轴值",t33:"纵轴值",t34:"记录顺序",t35:"排序规则",t36:"正序",t37:"倒序",t38:"分组聚合",t39:"按时间聚合",t40:"按天聚合",t41:"按周聚合",t42:"按月聚合",t43:"按年聚合",groupFieldConfig:"分组字段配置",left:"左",right:"右"},calendar:{t1:"视图配置",t2:"开始日期",t3:"结束日期",t4:"标题展示"},add:{add1:"图表",add2:"柱状图",add3:"折线图",add4:"饼图",add5:"条形图",_add5:"组合图",add6:"其他",add7:"统计数字",add8:"文本",add9:"日历",add10:"添加组件",add11:"等于",add12:"不等于",add13:"等于",add14:"早于(<)",add15:"晚于(>)",add16:"范围内",timeBefore:"早于 (不含当天)",timeAfter:"晚于 (不含当天)",timeRange:"日期区间(含当天)",add17:"为空",add18:"不为空",add19:"不等于",add20:"大于",add21:"大于等于",add22:"小于",add23:"小于等于",add24:"包含",add25:"不包含",add26:"具体日期",add27:"今天",add28:"昨天",add29:"本周",add30:"上周",add31:"本月",add32:"上月",add33:"过去7天",add34:"过去30天",add35:"去年",add36:"今年",add37:"上上月"}};Sr.use(H6).init({resources:{"zh-CN":{translation:bpe},"en-US":{translation:ype}},lng:"zh-CN",fallbackLng:"zh-CN",interpolation:{escapeValue:!1}});const Cpe=gD.WidthProvider(gD.Responsive),_pe=({moduleConfigData:t,moduleDataApi:e,enumDataApi:r,onCreateModule:n,onUpdateModule:i,onDeleteModule:a,className:o="layout",cols:s={lg:12,md:12,sm:12,xs:12,xxs:12},rowHeight:l=79,renderToolbarLeft:u})=>{const{t:f}=At(),[c,d]=I.useState([]),[h,v]=I.useState();I.useEffect(()=>{d((t==null?void 0:t.map(k=>({...k,i:k.i?k.i:k.id})))||[])},[t]);const g=async k=>{const Q=k.type==="calendar"?5:4,K=k.type==="calendar"?5:3;if(Array.isArray(c)&&k.type){const q={x:0,y:0,w:Q,h:K,title:k.type.includes("chart")?f("chartText"):te[k.type],...k,type:k.type};await(n==null?void 0:n(q).then(fe=>{var se,xe;if(!fe.success){Z.message.error(fe.message);return}d([...c,{...q,i:(se=fe.data)==null?void 0:se.id,id:(xe=fe.data)==null?void 0:xe.id}])}))}},p=async(k,Q)=>{if(c!=null&&c.length){const q={...c.find(se=>se.id===k),...Q},fe=c.map(se=>se.id===k?q:se);d(fe),await(i==null?void 0:i(q).then(se=>{if(!se.success){Z.message.error(se.message);return}}))}},m=async k=>{if(!(c!=null&&c.length)||!(k!=null&&k.length))return;const Q=c.map(K=>{const q=k.find(fe=>fe.id===K.id);return q?{...K,...q}:K});d(Q);try{for(const K of k){const q=await(i==null?void 0:i(K));if(!(q!=null&&q.success))throw new Error((q==null?void 0:q.message)||`Failed to update module: ${K.id}`)}}catch(K){d(c),Z.message.error(K.message||"Failed to update modules")}},y=async k=>{c!=null&&c.length&&(d(c.filter(Q=>Q.id!==k)),await(a==null?void 0:a(k||"")))},b=[10,10],[C,_]=I.useState(0),[,w]=I.useState(s.lg),[x,S]=I.useState(!1),[E,T]=I.useState(!1),A=(k,Q)=>{w(Q)},M=k=>{const K=xX(k,c).map(q=>({...c==null?void 0:c.find(se=>se.i===q.i),...q}));m(K)},O=(k,Q)=>{k==="start"?(S(!0),T(!0)):(S(!1),setTimeout(()=>{T(!1)},500),M(Q||[]))},[P,N]=I.useState(),[F,L]=I.useState(!1),[j,W]=I.useState(!1),[B,z]=I.useState(!1),Y=k=>{if(k==="text"){const Q={type:k,customData:{title:f("text"),editor:[{type:"paragraph",children:[{text:""}]}]}};g(Q)}else k==="statistics"?L(!0):k==="calendar"?W(!0):k!=null&&k.includes("chart")&&z(!0);N({title:"",type:k,w:0,h:0,x:0,y:0})},X={moduleDataApi:e,enumDataApi:r,selectModuleData:P},ee=k=>{k.id?p(k.id,qS(k,"id")):g(k)},te={text:f("pb.text"),calendar:f("calendarText"),statistics:f("chartText")},V=I.useRef(null),J=w9(V),G=((J==null?void 0:J.top)??0)>0;return D.jsxs("div",{className:"pivot-table",children:[D.jsx("div",{className:fn("bitable-block-dashboard-toolbar bitable-toolbar",G&&"bitable-toolbar--shadow"),children:D.jsxs("div",{className:"bitable-block-dashboard-toolbar--left",children:[u==null?void 0:u(),D.jsx(r$,{onOk:k=>{Y(k)}}),D.jsx("div",{style:{width:"1px",height:"1rem",backgroundColor:"rgba(217, 217, 217, 1)",marginLeft:"12px",marginRight:"4px"}}),D.jsx(nN,{})]})}),D.jsx("div",{className:"bitable-block-dashboard__mount",ref:V,children:D.jsx("div",{className:"dashboard-container",children:D.jsx("div",{className:`dashboard-content-container ${x?"isDragOrResize":""} ${E?"isDragOrResizeEnd":""}`,children:D.jsx(Cpe,{onBreakpointChange:A,className:o,compactType:"vertical",preventCollision:!1,cols:s,margin:b,rowHeight:l,measureBeforeMount:!1,draggableHandle:".isCanDrag",onWidthChange:(k,Q,K)=>{_(k/K-1)},onDragStart:()=>{O("start")},onDragStop:k=>{O("end",k)},onResizeStart:()=>{O("start")},onResizeStop:k=>{O("end",k)},style:{backgroundSize:`${C}px ${l+b[0]}px`,backgroundPosition:`${b[0]}px ${b[0]}px`,minHeight:"100vh"},containerPadding:[10,0],children:c==null?void 0:c.map(k=>D.jsxs("div",{className:`box-dashboard ${h===k.id?"active":""}`,onClick:()=>{v(k.id)},"data-grid":{i:k.id,x:k.x||0,y:k.y||0,w:k.w||2,h:k.h||2,minW:2,minH:2},children:[D.jsx(mpe,{module:k,defaultValue:k.title,onChange:Q=>p(k.id,{title:Q}),onDropdownItem:Q=>{var K;if(Q==="edit")v(k.id),N(k),k.type==="statistics"&&L(!0),(K=k.type)!=null&&K.includes("chart")&&z(!0),k.type==="calendar"&&W(!0);else if(Q==="delete")Z.Modal.confirm({title:f("promptTitle"),icon:D.jsx(Kw,{}),content:f("promptContentDeleteComponents"),onOk(){y(k.id)}});else if(Q==="copy"){const q=JSON.parse(JSON.stringify(k));delete q.id,delete q.i,g(q)}}}),D.jsx(hpe,{module:k,onUpdate:p,moduleDataApi:e,activeId:h,onClick:()=>{v(k.id)},rowWidth:C,rowHeight:l,onEdit:()=>{var Q;v(k.id),N(k),k.type==="statistics"&&L(!0),(Q=k.type)!=null&&Q.includes("chart")&&z(!0),k.type==="calendar"&&W(!0)},onDelete:()=>{y(k.id)},onCopy:()=>{const Q=JSON.parse(JSON.stringify(k));delete Q.id,delete Q.i,g(Q)},onStartDragOrResize:()=>{S(!0)},onStopDragOrResize:()=>{S(!1)}})]},k.id))})})})}),D.jsx(dfe,{...X,open:F,onClose:()=>{L(!1)},onOk:k=>{ee({...k,type:"statistics"}),L(!1)}}),D.jsx(MX,{...X,open:j,onClose:()=>{W(!1)},onOk:k=>{ee({...k,type:"calendar"}),W(!1)}}),D.jsx(ofe,{...X,open:B,onClose:()=>{z(!1)},onOk:k=>{ee(k),z(!1)}})]})},wpe=[],xpe=I.memo(t=>{const{i18n:e}=At();I.useEffect(()=>{e.changeLanguage((t==null?void 0:t.lang)||"zh_CN")},[e,t==null?void 0:t.lang]);const r={fieldMap:t.fieldMap,sourceData:t==null?void 0:t.sourceData},n=QW(t,["moduleDataApi","enumDataApi","onCreateModule","onUpdateModule","onDeleteModule"]),[i=wpe,a]=Ao(t,{valuePropName:"globalFilterCondition",trigger:"onGlobalFilterConditionChange"});let o={globalData:r,service:n,formatCurrency:t==null?void 0:t.formatCurrency,globalFilterCondition:i,setGlobalFilterCondition:a};return D.jsx(AT.Provider,{value:o,children:D.jsx(_pe,{...t})})});Xt.PivotTable=xpe,Object.defineProperty(Xt,Symbol.toStringTag,{value:"Module"})});
|
|
178
|
+
`:""}),P4(m)){var _=m.ownerDocument.createElement("span");_.style.whiteSpace="pre",_.appendChild(m),p.appendChild(_),m=_}var w=n.getFragment(),x=JSON.stringify(w),S=window.btoa(encodeURIComponent(x));m.setAttribute("data-slate-fragment",S),u.setData("application/".concat(r),S);var E=p.ownerDocument.createElement("div");return E.appendChild(p),E.setAttribute("hidden","true"),p.ownerDocument.body.appendChild(E),u.setData("text/html",E.innerHTML),u.setData("text/plain",I4(E)),p.ownerDocument.body.removeChild(E),u}}},n.insertData=u=>{n.insertFragmentData(u)||n.insertTextData(u)},n.insertFragmentData=u=>{var f=u.getData("application/".concat(r))||Uhe(u);if(f){var c=decodeURIComponent(window.atob(f)),d=JSON.parse(c);return n.insertFragment(d),!0}return!1},n.insertTextData=u=>{var f=u.getData("text/plain");if(f){var c=f.split(/\r\n|\r|\n/),d=!1;for(var h of c)d&&oe.splitNodes(n,{always:!0}),n.insertText(h),d=!0;return!0}return!1},n.onChange=u=>{var f=D4<18?vo.unstable_batchedUpdates:c=>c();f(()=>{var c=J_.get(n);c&&c(u),a(u)})},n},bu=(t,e)=>{var r=[];for(var[n,i]of R.levels(t,{at:e})){var a=ae.findKey(t,n);r.push([i,a])}return r};const lL=(t,e)=>{const r=I.useRef(null),n=(...i)=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{t(...i)},e)};return I.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]),n},uL=["numbered-list","bulleted-list"],ag=["left","center","right","justify"],ipe=({children:t})=>typeof document=="object"?vo.createPortal(t,document.body):null,ape=({defaultValue:t,onChange:e})=>{const{t:r}=At(),n=I.useCallback(s=>D.jsx(spe,{...s}),[]),i=I.useCallback(s=>D.jsx(lpe,{...s}),[]),a=I.useMemo(()=>Zde(npe(qde())),[]),o=lL(s=>{e==null||e(s)},300);return D.jsx("div",{style:{width:"100%",height:"100%"},children:D.jsxs(tpe,{editor:a,initialValue:t,onChange:o,children:[D.jsx(upe,{}),D.jsx(Uve,{style:{width:"100%",height:"100%",outline:"none"},className:"prose prose-sm",renderElement:n,renderLeaf:i,spellCheck:!0,autoFocus:!0,placeholder:r("pleaseEnter"),onDOMBeforeInput:s=>{switch(s.inputType){case"formatBold":return s.preventDefault(),og(a,"bold");case"formatItalic":return s.preventDefault(),og(a,"italic");case"formatUnderline":return s.preventDefault(),og(a,"underlined")}}})]})})},ope=(t,e)=>{const r=fL(t,e,ag.includes(e)?"align":"type"),n=uL.includes(e);oe.unwrapNodes(t,{match:a=>!R.isEditor(a)&&me.isElement(a)&&uL.includes(a.type)&&!ag.includes(e),split:!0});const i={};if(ag.includes(e)?i.align=r?void 0:e:i.type=r?"paragraph":n?"list-item":e,oe.setNodes(t,i),!r&&n){const a={type:e,children:[]};oe.wrapNodes(t,a)}},og=(t,e)=>{cL(t,e)?R.removeMark(t,e):R.addMark(t,e,!0)},fL=(t,e,r="type")=>{const{selection:n}=t;if(!n)return!1;const[i]=Array.from(R.nodes(t,{at:R.unhangRange(t,n),match:a=>!R.isEditor(a)&&me.isElement(a)&&a[r]===e}));return!!i},cL=(t,e)=>{const r=R.marks(t);return r?r[e]===!0:!1},spe=({attributes:t,children:e,element:r})=>{const n={textAlign:r.align};switch(r.type){case"block-quote":return D.jsx("blockquote",{style:n,...t,children:e});case"bulleted-list":return D.jsx("ul",{style:n,...t,children:e});case"heading-one":return D.jsx("h1",{style:n,...t,children:e});case"heading-two":return D.jsx("h2",{style:n,...t,children:e});case"list-item":return D.jsx("li",{style:n,...t,children:e});case"numbered-list":return D.jsx("ol",{style:n,...t,children:e});default:return D.jsx("p",{style:n,...t,children:e})}},lpe=({attributes:t,children:e,leaf:r})=>(r.bold&&(e=D.jsx("strong",{children:e})),r.code&&(e=D.jsx("code",{children:e})),r.italic&&(e=D.jsx("em",{children:e})),r.underline&&(e=D.jsx("u",{children:e})),D.jsx("span",{...t,children:e})),upe=()=>{const t=I.useRef(null),e=ig(),r=Kve();return I.useEffect(()=>{const n=t.current,{selection:i}=e;if(!n)return;if(!i||!r||re.isCollapsed(i)||R.string(e,i)===""){n.removeAttribute("style");return}const a=window.getSelection(),o=a==null?void 0:a.getRangeAt(0),s=o==null?void 0:o.getBoundingClientRect();n.style.opacity="1",s&&(n.style.top=`${s.top+window.pageYOffset-n.offsetHeight}px`,n.style.left=`${s.left+window.pageXOffset-n.offsetWidth/2+s.width/2}px`)}),D.jsx(ipe,{children:D.jsxs("div",{ref:t,className:"editor-menu",onMouseDown:n=>{n.preventDefault()},children:[D.jsx(lw,{format:"bold",icon:D.jsx(Gw,{})}),D.jsx(lw,{format:"italic",icon:D.jsx(Qw,{})}),D.jsx(lw,{format:"underline",icon:D.jsx(tx,{})}),D.jsx(Cu,{format:"numbered-list",icon:D.jsx(ex,{})}),D.jsx(Cu,{format:"bulleted-list",icon:D.jsx(rx,{})}),D.jsx(Cu,{format:"left",icon:D.jsx(Vw,{})}),D.jsx(Cu,{format:"center",icon:D.jsx(Hw,{})}),D.jsx(Cu,{format:"right",icon:D.jsx(Ww,{})}),D.jsx(Cu,{format:"justify",icon:D.jsx(Xw,{})})]})})},lw=({format:t,icon:e})=>{const r=ig();return D.jsx(Z.Button,{onClick:()=>og(r,t),icon:e,color:cL(r,t)?"primary":"default",variant:"text"})},Cu=({format:t,icon:e})=>{const r=ig();return D.jsx(Z.Button,{color:fL(r,t,ag.includes(t)?"align":"type")?"primary":"default",icon:e,variant:"text",onClick:()=>{ope(r,t)}})},fpe=({defaultValue:t,onChange:e})=>D.jsx("div",{style:{width:"100%",height:"100%",overflowY:"auto",padding:"0 10px"},children:D.jsx(ape,{defaultValue:t,onChange:e})}),cpe=I.memo(fpe);function dpe(t,e){return GS(t.module,e.module)}const hpe=I.memo(({module:t,onUpdate:e,moduleDataApi:r,rowWidth:n,rowHeight:i})=>{var a,o;return D.jsx("div",{className:"module-content isNoCanDrag",style:{overflow:(a=t.type)!=null&&a.includes("chart")?"inherit":"hidden"},children:D.jsxs("div",{className:"dashboard-grid-container",children:[t.type==="text"?D.jsx(cpe,{defaultValue:t.customData.editor,onChange:s=>{t.id&&e(t.id,{type:"text",customData:{title:t.customData.title,editor:s}})}}):null,t.type==="statistics"?D.jsx(tN,{customData:t.customData,customeStyle:t.customeStyle,moduleDataApi:r,width:t.w,height:t.h,rowWidth:n,rowHeight:i}):null,t.type==="calendar"?D.jsx(OT,{customData:t.customData,moduleDataApi:r,width:t.w,height:t.h,rowWidth:n,rowHeight:i}):null,(o=t.type)!=null&&o.includes("chart")?D.jsx(Z8,{width:t.w,height:t.h,customData:t.customData,customeStyle:t.customeStyle,moduleDataApi:r}):null]})})},dpe),vpe=()=>D.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-icon":"DragOutlined",children:D.jsx("path",{d:"M8.25 6.5a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5Zm0 7.25a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5Zm1.75 5.5a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0ZM14.753 6.5a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5ZM16.5 12a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0Zm-1.747 9a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5Z",fill:"#999"})}),ppe=()=>D.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-icon":"MoreVerticalOutlined",children:D.jsx("path",{d:"M12 5.5A1.75 1.75 0 1 1 12 2a1.75 1.75 0 0 1 0 3.5Zm0 8.225a1.75 1.75 0 1 1 0-3.5 1.75 1.75 0 0 1 0 3.5ZM12 22a1.75 1.75 0 1 1 0-3.5 1.75 1.75 0 0 1 0 3.5Z",fill:"currentColor"})}),gpe=({defaultValue:t,onChange:e,module:r,onDropdownItem:n,onMouseDown:i,onMouseUp:a})=>{const[o,s]=I.useState(!1),[l,u]=I.useState(""),f=I.useRef(null),c=lL(g=>{e==null||e(g)},300),{t:d}=At();I.useEffect(()=>{u(l)},[t]);const h=()=>{var p;((p=f.current)==null?void 0:p.input).select()},v=g=>{g.key==="Enter"&&s(!1)};return I.useEffect(()=>{o||u(g=>g.trim())},[o]),D.jsxs("div",{className:"layout-item-head isCanDrag",onMouseDown:()=>{i==null||i()},onMouseUp:()=>{a==null||a()},children:[D.jsxs("div",{className:"head-inner",children:[D.jsx("span",{className:"title",children:D.jsx("span",{className:"title-child",onDoubleClick:g=>{g.stopPropagation(),s(!0),setTimeout(()=>{var p;(p=f.current)==null||p.focus()},100)},children:o?D.jsx(Z.Input,{defaultValue:t,onBlur:()=>{s(!1)},ref:f,onKeyDown:v,onDoubleClick:h,onChange:g=>{u(g.target.value),c(g.target.value)}}):t})}),D.jsx("div",{className:"menu-slot isNoCanDrag",children:D.jsx(Z.Dropdown,{trigger:["click"],menu:{items:[r.type!=="text"?{label:d("configuration"),key:"edit"}:null,{label:d("copy"),key:"copy"},{key:"delete",danger:!0,label:d("delete")}],onClick:({key:g})=>{n==null||n(g)}},children:D.jsx("button",{type:"button",className:"dashboard-grid-menu-button",children:D.jsx("span",{className:"universe-icon",children:D.jsx(ppe,{})})})})})]}),D.jsx("div",{className:"drag isCanDrag",children:D.jsx("span",{className:"universe-icon drag-icon",children:D.jsx(vpe,{})})})]})},mpe=I.memo(gpe),ype={...{title:"Dashboard",text:"Text",confirm:"Confirm",pleaseEnter:"Please enter",configuration:"Configuration",copy:"Copy",delete:"Delete",calendarText:"Calendar",chartText:"Chart",promptTitle:"Prompt",promptContentDeleteComponents:"Are you sure you want to delete this component?",unnamedRecord:"Unnamed Record",setFilteringCriteria:"Set filtering criteria",all:"All",everyone:"Any",condition:"Conditions",addCondition:"Add condition",equalto:"Equal to",notequalto:"Not equal to",contain:"Contains",notcontain:"Does not contain",null:"Is empty",notnull:"Is not empty",conformTo:"Match the following",statisticsText:"Statistics Text",typeData:"Type and Data",customStyle:"Custom Style",dataSource:"Data Source",dataRange:"Data Range",data:"Data",filterData:"Filter Data",selectNcondition:"Selected {{n}} conditions",allData:"All Data",statisticstMethods:"Statistical Methods",statisticstRecordNum:"Total Number of Records",statisticstFieldVal:"Statistical Field Values",selectField:"Select Field",sumVal:"Sum",maxVal:"Maximum Value",minVal:"Minimum Value",averageVal:"Average Value",empty:"No Data",filter:"Filter",globalfilter:"Global Filter",setFilterCondition:"Set Filter Condition",selectGroupField:"Select Group Field"},displayRange:{title:"Display Data",all:"All",top5:"Top 5",top10:"Top 10",top20:"Top 20",top30:"Top 30",bottom5:"Bottom 5",bottom10:"Bottom 10",bottom20:"Bottom 20",bottom30:"Bottom 30"},pb:{text:"text",statisticsText:"Statistics",unknown:"unknown"},statistics:{t1:"Color Scheme",t2:"Value Settings",t3:"Decimal Places and Format",t4:"Please enter decimal places",t5:"Number (Thousand Separator)",t6:"Number",t7:"Percentage",currency:"Currency",t8:"Renminbi",t9:"Dollar",t10:"Statistical Value Description",t11:"EUR",t12:"GBP",t13:"THB"},chart:{t1:"Chart Type",t2:"Basic Bar Chart",t3:"Stacked Bar Chart",t4:"Percentage Bar Chart",t5:"Basic Horizontal Bar Chart",t6:"Stacked Horizontal Bar Chart",t7:"Percentage Stacked Horizontal Bar Chart",t8:"Line Chart",t9:"Smooth Line Chart",t10:"Pie Chart",t11:"Doughnut Chart",t12:"Chart Options",_t12:"Combination Chart",t13:"Legend",t14:"Data Label",t15:"Axis",t16:"Grid Line",t17:"Sector Division",t18:"Horizontal Axis (Category)",t19:"Sector Value",t20:"Vertical Axis (Field)",t21:"Horizontal Axis",t22:"Horizontal Axis Title",t23:"Axis Options",t24:"Show Labels",t25:"Show Axis Line",t26:"Vertical Axis",t27:"Vertical Axis Title",t28:"Axis Options",t29:"Show Labels",t30:"Show Axis Line",t31:"Sort By",t32:"Horizontal Axis Value",t33:"Vertical Axis Value",t34:"Record Sequence",t35:"Sort Order",t36:"Ascending",t37:"Descending",t38:"Grouping And Aggregation",t39:"Aggregate by time",t40:"Aggregate by day",t41:"Aggregate by week",t42:"Aggregate by month",t43:"Aggregate by year",groupFieldConfig:"Group Field Configuration",left:"Left",right:"Right"},calendar:{t1:"View Configuration",t2:"Start Date",t3:"End Date",t4:"Title Display"},add:{add1:"Chart",add2:"Bar Chart",add3:"Line Chart",add4:"Pie Chart",add5:"Bar Graph",_add5:"Combination Chart",add6:"Other",add7:"Statistics",add8:"Text",add9:"Calendar",add10:"Add Block",add11:"Equal to",add12:"Not Equal to",add13:"Equal to",add14:"Before(<)",add15:"After(>)",add16:"Within Range",timeBefore:"Before (excluding the day)",timeAfter:"After (excluding the day)",timeRange:"Date Range (including the day)",add17:"Is Empty",add18:"Is Not Empty",add19:"Not Equal to",add20:"Greater than",add21:"Greater than or Equal to",add22:"Less than",add23:"Less than or Equal to",add24:"Contains",add25:"Does Not Contain",add26:"Specific Date",add27:"Today",add28:"Yesterday",add29:"This Week",add30:"Last Week",add31:"This Month",add32:"Last Month",add33:"Past 7 Days",add34:"Past 30 Days",add35:"Last Year",add36:"This Year",add37:"The Month Before Last"}},bpe={...{title:"仪表盘",text:"文本",confirm:"确定",pleaseEnter:"请输入",configuration:"配置",copy:"复制",delete:"删除",calendarText:"日历",chartText:"图表",promptTitle:"提示",promptContentDeleteComponents:"确认删除组件?",unnamedRecord:"未命名记录",setFilteringCriteria:"设置筛选条件",all:"所有",everyone:"任一",condition:"条件",addCondition:"添加条件",equalto:"等于",notequalto:"不等于",contain:"包含",notcontain:"不包含",null:"为空",notnull:"不为空",conformTo:"符合以下",statisticsText:"统计文字",typeData:"类型与数据",customStyle:"自定义样式",dataSource:"数据源",dataRange:"数据范围",data:"数据",filterData:"筛选数据",selectNcondition:"已选{{n}}个条件",allData:"全部数据",statisticstMethods:"统计方式",statisticstRecordNum:"统计记录总数",statisticstFieldVal:"统计字段数值",selectField:"选择字段",sumVal:"求和",maxVal:"最大值",minVal:"最小值",averageVal:"平均值",empty:"暂无数据",filter:"筛选",globalfilter:"全局筛选",setFilterCondition:"设置筛选条件",selectGroupField:"选择分组字段"},displayRange:{title:"显示数据量",all:"全部",top5:"前5项",top10:"前10项",top20:"前20项",top30:"前30项",bottom5:"后5项",bottom10:"后10项",bottom20:"后20项",bottom30:"后30项"},pb:{text:"文本",statisticsText:"统计",unknown:"未知"},statistics:{t1:"配色方案",t2:"数值设置",t3:"小数位数与格式",t4:"请输入小数位数",t5:"数字(千分位)",t6:"数字",t7:"百分比",currency:"币种",t8:"人民币",t9:"美元",t10:"统计数值说明",t11:"欧元",t12:"英镑",t13:"泰铢"},chart:{t1:"图表类型",t2:"基础柱状图",t3:"堆积柱状图",t4:"百分比堆积柱状图",t5:"基础条形图",t6:"堆积条形图",t7:"百分比堆积条形图",t8:"折线图",t9:"平滑折线图",t10:"饼图",t11:"环形图",_t12:"组合图",t12:"图标选项",t13:"图例",t14:"数据标签",t15:"坐标轴",t16:"网格线",t17:"扇形分区",t18:"横轴(类别)",t19:"扇形数值",t20:"纵轴(字段)",t21:"横轴",t22:"横轴标题",t23:"坐标轴选项",t24:"显示标签",t25:"显示轴线",t26:"纵轴",t27:"纵轴标题",t28:"坐标轴选项",t29:"显示标签",t30:"显示轴线",t31:"排序依据",t32:"横轴值",t33:"纵轴值",t34:"记录顺序",t35:"排序规则",t36:"正序",t37:"倒序",t38:"分组聚合",t39:"按时间聚合",t40:"按天聚合",t41:"按周聚合",t42:"按月聚合",t43:"按年聚合",groupFieldConfig:"分组字段配置",left:"左",right:"右"},calendar:{t1:"视图配置",t2:"开始日期",t3:"结束日期",t4:"标题展示"},add:{add1:"图表",add2:"柱状图",add3:"折线图",add4:"饼图",add5:"条形图",_add5:"组合图",add6:"其他",add7:"统计数字",add8:"文本",add9:"日历",add10:"添加组件",add11:"等于",add12:"不等于",add13:"等于",add14:"早于(<)",add15:"晚于(>)",add16:"范围内",timeBefore:"早于 (不含当天)",timeAfter:"晚于 (不含当天)",timeRange:"日期区间(含当天)",add17:"为空",add18:"不为空",add19:"不等于",add20:"大于",add21:"大于等于",add22:"小于",add23:"小于等于",add24:"包含",add25:"不包含",add26:"具体日期",add27:"今天",add28:"昨天",add29:"本周",add30:"上周",add31:"本月",add32:"上月",add33:"过去7天",add34:"过去30天",add35:"去年",add36:"今年",add37:"上上月"}};Sr.use(H6).init({resources:{"zh-CN":{translation:bpe},"en-US":{translation:ype}},lng:"zh-CN",fallbackLng:"zh-CN",interpolation:{escapeValue:!1}});const Cpe=gD.WidthProvider(gD.Responsive),_pe=({moduleConfigData:t,moduleDataApi:e,enumDataApi:r,onCreateModule:n,onUpdateModule:i,onDeleteModule:a,className:o="layout",cols:s={lg:12,md:12,sm:12,xs:12,xxs:12},rowHeight:l=79,renderToolbarLeft:u})=>{const{t:f}=At(),[c,d]=I.useState([]),[h,v]=I.useState();I.useEffect(()=>{d((t==null?void 0:t.map(k=>({...k,i:k.i?k.i:k.id})))||[])},[t]);const g=async k=>{const Q=k.type==="calendar"?5:4,K=k.type==="calendar"?5:3;if(Array.isArray(c)&&k.type){const q={x:0,y:0,w:Q,h:K,title:k.type.includes("chart")?f("chartText"):te[k.type],...k,type:k.type};await(n==null?void 0:n(q).then(fe=>{var se,xe;if(!fe.success){Z.message.error(fe.message);return}d([...c,{...q,i:(se=fe.data)==null?void 0:se.id,id:(xe=fe.data)==null?void 0:xe.id}])}))}},p=async(k,Q)=>{if(c!=null&&c.length){const q={...c.find(se=>se.id===k),...Q},fe=c.map(se=>se.id===k?q:se);d(fe),await(i==null?void 0:i(q).then(se=>{if(!se.success){Z.message.error(se.message);return}}))}},m=async k=>{if(!(c!=null&&c.length)||!(k!=null&&k.length))return;const Q=c.map(K=>{const q=k.find(fe=>fe.id===K.id);return q?{...K,...q}:K});d(Q);try{for(const K of k){const q=await(i==null?void 0:i(K));if(!(q!=null&&q.success))throw new Error((q==null?void 0:q.message)||`Failed to update module: ${K.id}`)}}catch(K){d(c),Z.message.error(K.message||"Failed to update modules")}},y=async k=>{c!=null&&c.length&&(d(c.filter(Q=>Q.id!==k)),await(a==null?void 0:a(k||"")))},b=[10,10],[C,_]=I.useState(0),[,w]=I.useState(s.lg),[x,S]=I.useState(!1),[E,T]=I.useState(!1),A=(k,Q)=>{w(Q)},M=k=>{const K=xX(k,c).map(q=>({...c==null?void 0:c.find(se=>se.i===q.i),...q}));m(K)},O=(k,Q)=>{k==="start"?(S(!0),T(!0)):(S(!1),setTimeout(()=>{T(!1)},500),M(Q||[]))},[P,N]=I.useState(),[F,L]=I.useState(!1),[j,W]=I.useState(!1),[B,z]=I.useState(!1),Y=k=>{if(k==="text"){const Q={type:k,customData:{title:f("text"),editor:[{type:"paragraph",children:[{text:""}]}]}};g(Q)}else k==="statistics"?L(!0):k==="calendar"?W(!0):k!=null&&k.includes("chart")&&z(!0);N({title:"",type:k,w:0,h:0,x:0,y:0})},X={moduleDataApi:e,enumDataApi:r,selectModuleData:P},ee=k=>{k.id?p(k.id,qS(k,"id")):g(k)},te={text:f("pb.text"),calendar:f("calendarText"),statistics:f("chartText")},V=I.useRef(null),J=w9(V),G=((J==null?void 0:J.top)??0)>0;return D.jsxs("div",{className:"pivot-table",children:[D.jsx("div",{className:fn("bitable-block-dashboard-toolbar bitable-toolbar",G&&"bitable-toolbar--shadow"),children:D.jsxs("div",{className:"bitable-block-dashboard-toolbar--left",children:[u==null?void 0:u(),D.jsx(r$,{onOk:k=>{Y(k)}}),D.jsx("div",{style:{width:"1px",height:"1rem",backgroundColor:"rgba(217, 217, 217, 1)",marginLeft:"12px",marginRight:"4px"}}),D.jsx(nN,{})]})}),D.jsx("div",{className:"bitable-block-dashboard__mount",ref:V,children:D.jsx("div",{className:"dashboard-container",children:D.jsx("div",{className:`dashboard-content-container ${x?"isDragOrResize":""} ${E?"isDragOrResizeEnd":""}`,children:D.jsx(Cpe,{onBreakpointChange:A,className:o,compactType:"vertical",preventCollision:!1,cols:s,margin:b,rowHeight:l,measureBeforeMount:!1,draggableHandle:".isCanDrag",onWidthChange:(k,Q,K)=>{_(k/K-1)},onDragStart:()=>{O("start")},onDragStop:k=>{O("end",k)},onResizeStart:()=>{O("start")},onResizeStop:k=>{O("end",k)},style:{backgroundSize:`${C}px ${l+b[0]}px`,backgroundPosition:`${b[0]}px ${b[0]}px`,minHeight:"100vh"},containerPadding:[10,0],children:c==null?void 0:c.map(k=>D.jsxs("div",{className:`box-dashboard ${h===k.id?"active":""}`,onClick:()=>{v(k.id)},"data-grid":{i:k.id,x:k.x||0,y:k.y||0,w:k.w||2,h:k.h||2,minW:2,minH:2},children:[D.jsx(mpe,{module:k,defaultValue:k.title,onChange:Q=>p(k.id,{title:Q}),onDropdownItem:Q=>{var K;if(Q==="edit")v(k.id),N(k),k.type==="statistics"&&L(!0),(K=k.type)!=null&&K.includes("chart")&&z(!0),k.type==="calendar"&&W(!0);else if(Q==="delete")Z.Modal.confirm({title:f("promptTitle"),icon:D.jsx(Kw,{}),content:f("promptContentDeleteComponents"),onOk(){y(k.id)}});else if(Q==="copy"){const q=JSON.parse(JSON.stringify(k));delete q.id,delete q.i,g(q)}}}),D.jsx(hpe,{module:k,onUpdate:p,moduleDataApi:e,activeId:h,onClick:()=>{v(k.id)},rowWidth:C,rowHeight:l,onEdit:()=>{var Q;v(k.id),N(k),k.type==="statistics"&&L(!0),(Q=k.type)!=null&&Q.includes("chart")&&z(!0),k.type==="calendar"&&W(!0)},onDelete:()=>{y(k.id)},onCopy:()=>{const Q=JSON.parse(JSON.stringify(k));delete Q.id,delete Q.i,g(Q)},onStartDragOrResize:()=>{S(!0)},onStopDragOrResize:()=>{S(!1)}})]},k.id))})})})}),D.jsx(dfe,{...X,open:F,onClose:()=>{L(!1)},onOk:k=>{ee({...k,type:"statistics"}),L(!1)}}),D.jsx(MX,{...X,open:j,onClose:()=>{W(!1)},onOk:k=>{ee({...k,type:"calendar"}),W(!1)}}),D.jsx(ofe,{...X,open:B,onClose:()=>{z(!1)},onOk:k=>{ee(k),z(!1)}})]})},wpe=[],xpe=I.memo(t=>{const{i18n:e}=At();I.useEffect(()=>{e.changeLanguage((t==null?void 0:t.lang)||"zh_CN")},[e,t==null?void 0:t.lang]);const r={fieldMap:t.fieldMap,sourceData:t==null?void 0:t.sourceData},n=QW(t,["moduleDataApi","enumDataApi","onCreateModule","onUpdateModule","onDeleteModule"]),[i=wpe,a]=Ao(t,{valuePropName:"globalFilterCondition",trigger:"onGlobalFilterConditionChange"});let o={globalData:r,service:n,formatCurrency:t==null?void 0:t.formatCurrency,globalFilterCondition:i,setGlobalFilterCondition:a};return D.jsx(AT.Provider,{value:o,children:D.jsx(_pe,{...t})})});Xt.PivotTable=xpe,Object.defineProperty(Xt,Symbol.toStringTag,{value:"Module"})});
|