@jiaozhiye/qm-design-react 1.12.15 → 1.12.16
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/lib/anchor/style/index.less +101 -101
- package/lib/countup/style/index.less +22 -22
- package/lib/divider/style/index.less +68 -68
- package/lib/form/src/form.d.ts +1 -0
- package/lib/form/src/types.d.ts +2 -0
- package/lib/index.esm.js +1 -1
- package/lib/index.full.js +1 -1
- package/lib/index.js +1 -1
- package/lib/style/mixins/reset.less +37 -43
- package/lib/table/src/table/props.d.ts +1 -0
- package/lib/table/src/table/types.d.ts +1 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("dayjs"),l=require("lodash-es"),n=require("dayjs/plugin/localeData"),a=require("dayjs/plugin/advancedFormat"),r=require("dayjs/plugin/customParseFormat"),i=require("dayjs/plugin/quarterOfYear"),o=require("dayjs/plugin/weekOfYear"),s=require("dayjs/plugin/weekday"),d=require("antd"),u=require("dayjs/plugin/weekYear"),c=require("antd/es/calendar/generateCalendar"),f=require("antd/es/date-picker/generatePicker"),p=require("antd/es/locale/zh_CN"),m=require("antd/es/locale/en_GB");require("dayjs/locale/zh-cn"),require("dayjs/locale/en");var h=require("classnames"),g=require("@ant-design/icons"),v=require("react-dom"),y=require("react-countup"),b=require("resize-observer-polyfill"),x=require("sortablejs"),E=require("add-dom-event-listener"),C=require("scroll-into-view-if-needed"),w=require("react-draggable"),S=require("memoize-one"),N=require("prop-types"),T=require("@rc-component/portal"),I=require("react-sortablejs"),O=require("big.js"),R=require("exceljs"),k=require("localforage"),L=require("@rc-component/trigger"),P=require("@rc-component/color-picker"),A=require("copy-to-clipboard"),F=require("china-area-data"),_=require("cropperjs"),D=require("html2canvas");function M(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function H(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(l){if("default"!==l){var n=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(t,l,n.get?n:{enumerable:!0,get:function(){return e[l]}})}})),t.default=e,Object.freeze(t)}var q=M(e),$=H(e),j=M(t),K=M(n),V=M(a),z=M(r),W=M(i),B=M(o),U=M(s),G=M(u),Y=M(c),X=M(f),Q=M(p),Z=M(m),J=M(h),ee=M(v),te=M(y),le=M(b),ne=M(x),ae=M(E),re=M(C),ie=M(w),oe=M(S),se=M(N),de=H(N),ue=M(T),ce=M(O),fe=M(R),pe=M(k),me=M(L),he=M(P),ge=M(A),ve=M(F),ye=M(_),be=M(D);const xe=e.createContext({});var Ee={name:"zh-cn",qm:{button:{confirmPrompt:"提示",confirmTitle:"确认执行删除吗?",shortcutKey:"快捷键"},divider:{collect:"收起",spread:"展开"},dialog:{fullScreen:"全屏",cancelFullScreen:"取消全屏",close:"关 闭",confirm:"确 定",cancel:"取 消"},form:{search:"搜 索",reset:"重 置",save:"保 存",spread:"展开",collect:"收起",trueText:"是",falseText:"否",draggable:"拖动排序",requiredTips:"不能为空",searchHelperTips:"搜索帮助正在加载值",inputPlaceholder:"请输入...",selectPlaceholder:"请选择...",treePlaceholder:"树节点过滤",rangeInputNumberPlaceholder:["开始值","结束值"],rangeSearchHelper:["起始位置","结束位置"],datePlaceholder:"选择日期",timePlaceholder:"选择时间",weekPlaceholder:"选择周",monthPlaceholder:"选择月",quarterPlaceholder:"选择季度",yearPlaceholder:"选择年",daterangePlaceholder:["开始日期","结束日期"],timerangePlaceholder:["开始时间","结束时间"],monthrangePlaceholder:["开始月份","结束月份"],yearrangePlaceholder:["开始年份","结束年份"],datePickers:["今天","昨天","一周前","一个月前"],dateRangePickers:["最近一周","最近一个月","最近三个月","最近六个月"],citySelectType:["按省份","按城市"],regionSelectLabel:["省","市","区","街道"],validatePrompt:"表单校验提示"},clipboard:{success:"复制成功",error:"复制失败"},download:{text:"下载",success:"文件下载成功",error:"文件下载失败!"},upload:{tooltip:"只能上传 {type} 格式",notType:"不支持的文件类型 {type}",sizeLimit:"大小不能超过 {size}M",countLimit:"数量不能超过 {count} 个",uploadError:"文件上传失败!",downError:"文件下载失败!",text:"点击上传",remove:"删除文件",batchDownload:"批量下载"},uploadCropper:{dragableText:"拖放或点击",pasteText:"Ctrl+V 粘贴",tooltip:"只能上传 {type} 格式的图片",preview:"图片预览",cropper:"图片裁剪",uploadError:"图片上传失败!",downError:"图片下载失败!",text:"上传图片",zoomIn:"放大",zoomOut:"缩小",rotatePlus:"顺时针",rotateSubtract:"逆时针"},print:{preview:"打印预览",pageSetting:"页面设置",printError:"打印失败!",exportError:"导出失败!",defaultPrinter:"默认打印机",laserPrinter:"激光打印机",stylusPrinter:"针式打印机",printer:"打印机",type:"类型",copies:"份数",printPage:["打印第","几页"],setting:"设置",export:"导出",print:"打印",scale:"缩放",paper:"纸张",pageNumber:"页码",pagination:"第{currentPage}页 / 共{totalPage}页",setPanel:{printParameter:"打印参数",pagerType:"纸张类型",carbonPaper:"三联复写纸(针式)",printDirection:"打印方向",vertical:"纵向",horizontal:"横向",doublePrint:"双面打印",autoDoublePrint:"自动双面打印",manualDoublePrint:"手动双面打印",fixedLogo:"固定Logo",printMargin:"打印边距",leftMargin:"左边距",rightMargin:"右边距",topMargin:"上边距",bottomMargin:"下边距",sizeUnit:"厘米",noEmpty:"不能为空"}},split:{resize:"拖动改变大小"},searchHelper:{text:"搜索帮助",orderIndex:"序号",rangeStartTip:"起始位置不能大于结束位置",rangeEndTip:"结束位置不能小于起始位置"},tour:{prevStep:"上一步",nextStep:"下一步",finish:"结束引导"},guideTracker:{addButton:"添 加",editButton:"保 存",closeButton:"关 闭",finishButton:"结束并保存",label:"新手引导录入",currentStep:"当前步骤:"},table:{config:{selectionText:"选择",summaryText:"合计",copyText:"复制",emptyText:"暂无数据..."},alert:{total:"共 {total} 条",selected:"已选择 {total} 项",clear:"清空"},selection:{all:"全选所有",invert:"反选所有",clear:"清空所有",currentPage:"当前页全选"},columnFilter:{text:"列定义",reset:"重置",draggable:"拖动排序",fixedLeft:"固定左侧",fixedRight:"固定右侧",cancelFixed:"取消固定"},editable:{inputPlaceholder:"请输入",selectPlaceholder:"请选择",datePlaceholder:"选择日期",datetimePlaceholder:"选择时间"},sorter:{text:"排序",asc:"升序",desc:"降序"},filter:{search:"搜 索",reset:"重 置",searchText:"过滤{text}",searchAreaText:"过滤{text},用逗号隔开",text:"筛选",selectAll:"全选",invert:"反选",onlyItem:"仅此项",keywordSearch:"关键词搜索"},screen:{full:"全屏",cancelFull:"取消全屏"},import:{text:"导 入",textNoSpace:"导入",success:"成功导入 {total} 条记录",error:"导入失败,请检查字段名和数据格式是否正确",settingTitle:"导入设置",importType:"导入模式",insertPos:"插入位置",fillText:"新增",addText:"追加",insertText:"插入"},export:{text:"导 出",textNoSpace:"导出",closeButton:"关 闭",settingTitle:"导出设置",fileName:"文件名",fileType:"文件类型",sheetName:"标题",all:"全部",selected:"选中",custom:"自定义",footSummation:"底部合计",useStyle:"使用样式",warnText:"暂无表格数据或正在导出"},clipboard:{text:"粘 贴",textNoSpace:"粘贴",success:"成功粘贴 {total} 条记录",settingTitle:"粘贴设置",rowIndex:"粘贴起始行",colIndex:"粘贴起始列",content:"粘贴内容",placeholder:"请在此处 ctrl+v 粘贴数据",supportText:"说明:只支持粘贴 Excel 数据"},areaSelect:{mergeCell:"合并单元格",cancelMerge:"取消合并"},print:{text:"打印"},refresh:{text:"刷新"},toolbox:{text:"工具箱"},selectCollection:{text:"行选集合",settingTitle:"行选列表",closeButton:"关 闭"},groupSummary:{text:"汇总",settingTitle:"汇总设置",savedSetting:"保存的汇总设置",saveButton:"保 存",closeButton:"关 闭",confirmButton:"显示汇总",removeText:"移除",configText:"配置名称",resultText:"汇总结果",sumText:"列值汇总",maxText:"列最大值",minText:"列最小值",avgText:"列平均值",countText:"条数汇总",operation:"操作",index:"序号",groupItem:"分组项",summaryColumn:"汇总列",calcFormula:"计算公式"},highSearch:{text:"高级检索",settingTitle:"高级检索设置",searchButton:"开始检索",closeButton:"关 闭",removeText:"移除",andText:"并且",orText:"或者",gtText:"大于",ltText:"小于",gteText:"大于等于",lteText:"小于等于",eqText:"等于",neqText:"不等于",inText:"包含",ninText:"不包含",nullText:"空值",notNullText:"非空值",startsWithText:"开头是",endsWithText:"结尾是",configText:"配置名称",saveButton:"保 存",savedSetting:"保存的高级检索设置",operation:"操作",bracket:"括号",fieldName:"字段名",fieldType:"字段类型",expression:"运算",condition:"条件值",logic:"逻辑",noEmpty:"字段名不能为空"},fastSearch:{text:"数据定位查找",settingTitle:"数据定位查找设置",closeButton:"关 闭",savedSetting:"保存的数据查找设置",queryCondition:"请输入查询条件",notMatch:"没有符合条件的记录!",toTheEnd:"已查找到表格末尾,是否从头开始查找?",toStart:"已查找到表格开始,是否从末尾开始查找",matchCase:"大小写匹配",matchFullchar:"全字符匹配",queryLabel:"查找内容",queryPrev:"查找上一个",queryNext:"查找下一个",queryAll:"查找全部",findTotal:"查找到 {total} 个单元格",cellText:"单元格",valText:"值"},pivotGrid:{text:"多维表",settingTitle:"多维表看板"}},pivotGrid:{saved:{text:"配置",add:"添加配置项",title:"已保存的配置信息"},export:{text:"导出",group:"导出分组",list:"导出列表"},count:{statistic:"统计",records:"记录数",unique:"唯一值",empty:"空值",notEmpty:"非空值",sum:"合计值",max:"最大值",min:"最小值",avg:"平均值"},field:{text:"字段管理",title:"字段自定义设置"},fillColor:{text:"填色",add:"添加条件",title:"设置填色条件",cell:"单元格",row:"整行",col:"整列"},filter:{text:"筛选",title:"设置筛选条件",matchAll:"满足所有条件",matchAny:"满足任一条件"},group:{text:"分组",title:"设置分组条件",foldAll:"折叠所有",unfoldAll:"展开所有",empty:"(内容为空)",ascend:"选项顺序",descend:"选项倒序"},lineHeight:{text:"行高",size:["常规","中等","高"]},search:{text:"查找",title:"设置查找条件"},sorter:{text:"排序",title:"设置排序条件",ascend:"字段升序",descend:"字段降序"},viewMode:{table:"表格视图",gantt:"甘特视图",card:"看板视图"}},translate:{sourceText:"原文",targetText:"翻译",translating:"翻译中"}}};let Ce=Ee;function we(e,t){return e&&t?e.replace(/\{(\w+)\}/g,((e,l)=>t[l])):e}const Se=(...e)=>{const[t,l]=e;let n;const a=t.split(".");let r=Ce;for(let e=0,t=a.length;e<t;e++){if(n=r[a[e]],e===t-1)return we(n,l);if(!n)return"";r=n}return""};function Ne(e,t){var l={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(l[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(l[n[a]]=e[n[a]])}return l}function Te(e,t,l,n){var a,r=arguments.length,i=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,l):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,l,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(i=(r<3?a(i):r>3?a(t,l,i):a(t,l))||i);return r>3&&i&&Object.defineProperty(t,l,i),i}function Ie(e,t,l,n){return new(l||(l=Promise))((function(a,r){function i(e){try{s(n.next(e))}catch(e){r(e)}}function o(e){try{s(n.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof l?t:new l((function(e){e(t)}))).then(i,o)}s((n=n.apply(e,t||[])).next())}))}var Oe="undefined"==typeof window;const Re=e=>q.default.isValidElement(e),ke=e=>Re(e)&&e.type===q.default.Fragment,Le=()=>{},Pe=()=>!0,Ae=e=>Ie(void 0,void 0,void 0,(function*(){return new Promise((t=>setTimeout(t,e)))})),Fe=e=>{Promise.resolve().then(e)},_e=e=>e.replace(/-(\w)/g,((e,t)=>t?t.toUpperCase():"")),De=e=>!!(!e&&0!==e||l.isArray(e)&&!e.length||l.isPlainObject(e)&&!Object.keys(e).length),Me=(e,t)=>t.split(".").reduce(((e,t)=>null==e?void 0:e[t]),e),He=(e,t)=>{const l=Object.assign({},e);for(const e of t)delete l[e];return l};const qe=(e,t=new WeakMap)=>{if(l.isPlainObject(e)||l.isArray(e)){const l=Array.isArray(e),n=l?[]:{};if(t.get(e))return e;t.set(e,n);const a=l?void 0:Object.keys(e);return function(e,t){let l=-1;const n=e.length;for(;++l<n;)t(e[l],l)}(a||e,((l,r)=>{a&&(r=l),n[r]=qe(e[r],t)})),n}return e},$e=e=>l.isNumber(e)?`${e}px`:e.toString(),je=(e,t)=>Object.assign(Object.assign({},e),Object.keys(t).reduce(((l,n)=>(l[n]=void 0!==t[n]?t[n]:e[n],l)),{}));j.default.extend(K.default),j.default.extend(V.default),j.default.extend(z.default),j.default.extend(W.default),j.default.extend(B.default),j.default.extend(U.default);var Ke={},Ve=[];function ze(e,t){if(!e&&void 0!==console){var l=Ve.reduce((function(e,t){return t(null!=e?e:"","warning")}),t);l&&console.error("Warning: ".concat(l))}}function We(e,t){if(!e&&void 0!==console){var l=Ve.reduce((function(e,t){return t(null!=e?e:"","note")}),t);l&&console.warn("Note: ".concat(l))}}function Be(e,t,l){t||Ke[l]||(e(!1,l),Ke[l]=!0)}function Ue(e,t){Be(ze,e,t)}function Ge(e,t){Be(We,e,t)}Ue.preMessage=function(e){Ve.push(e)},Ue.resetWarned=function(){Ke={}},Ue.noteOnce=Ge,j.default.extend(z.default),j.default.extend(V.default),j.default.extend(U.default),j.default.extend(K.default),j.default.extend(B.default),j.default.extend(G.default),j.default.extend((function(e,t){var l=t.prototype,n=l.format;l.format=function(e){var t=(e||"").replace("Wo","wo");return n.bind(this)(t)}}));var Ye={bn_BD:"bn-bd",by_BY:"be",en_GB:"en-gb",en_US:"en",fr_BE:"fr",fr_CA:"fr-ca",hy_AM:"hy-am",kmr_IQ:"ku",nl_BE:"nl-be",pt_BR:"pt-br",zh_CN:"zh-cn",zh_HK:"zh-hk",zh_TW:"zh-tw"},Xe=function(e){return Ye[e]||e.split("_")[0]},Qe=function(){Ge(!1,"Not match any format. Please help to fire a issue about this.")},Ze={getNow:function(){return j.default()},getFixedDate:function(e){return j.default(e,["YYYY-M-DD","YYYY-MM-DD"])},getEndDate:function(e){return e.endOf("month")},getWeekDay:function(e){var t=e.locale("en");return t.weekday()+t.localeData().firstDayOfWeek()},getYear:function(e){return e.year()},getMonth:function(e){return e.month()},getDate:function(e){return e.date()},getHour:function(e){return e.hour()},getMinute:function(e){return e.minute()},getSecond:function(e){return e.second()},addYear:function(e,t){return e.add(t,"year")},addMonth:function(e,t){return e.add(t,"month")},addDate:function(e,t){return e.add(t,"day")},setYear:function(e,t){return e.year(t)},setMonth:function(e,t){return e.month(t)},setDate:function(e,t){return e.date(t)},setHour:function(e,t){return e.hour(t)},setMinute:function(e,t){return e.minute(t)},setSecond:function(e,t){return e.second(t)},isAfter:function(e,t){return e.isAfter(t)},isValidate:function(e){return e.isValid()},locale:{getWeekFirstDay:function(e){return j.default().locale(Xe(e)).localeData().firstDayOfWeek()},getWeekFirstDate:function(e,t){return t.locale(Xe(e)).weekday(0)},getWeek:function(e,t){return t.locale(Xe(e)).week()},getShortWeekDays:function(e){return j.default().locale(Xe(e)).localeData().weekdaysMin()},getShortMonths:function(e){return j.default().locale(Xe(e)).localeData().monthsShort()},format:function(e,t,l){return t.locale(Xe(e)).format(l)},parse:function(e,t,l){for(var n=Xe(e),a=0;a<l.length;a+=1){var r=l[a],i=t;if(r.includes("wo")||r.includes("Wo")){for(var o=i.split("-")[0],s=i.split("-")[1],d=j.default(o,"YYYY").startOf("year").locale(n),u=0;u<=52;u+=1){var c=d.add(u,"week");if(c.format("Wo")===s)return c}return Qe(),null}var f=j.default(i,r).locale(n);if(f.isValid())return f}return t&&Qe(),null}}};const Je=Y.default(Ze),et=X.default(Ze);function tt(){return tt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)({}).hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e},tt.apply(null,arguments)}const lt=$.forwardRef(((e,t)=>$.createElement(et,tt({},e,{picker:"time",mode:void 0,ref:t}))));lt.displayName="TimePicker";const nt=$.forwardRef(((e,t)=>$.createElement(et.RangePicker,tt({},e,{picker:"time",mode:void 0,ref:t}))));nt.displayName="RangePicker",lt.RangePicker=nt;var at={name:"en",qm:{button:{confirmPrompt:"Prompt",confirmTitle:"Are you sure you want to delete it?",shortcutKey:"Shortcut Key"},divider:{collect:"Collapse",spread:"Expand"},dialog:{fullScreen:"Full Screen",cancelFullScreen:"Cancel Full Screen",close:"Close",confirm:"Confirm",cancel:"Cancel"},form:{search:"Search",reset:"Reset",save:"Save",spread:"Expand",collect:"Collapse",trueText:"Yes",falseText:"No",draggable:"Drag and sort",requiredTips:" is required",searchHelperTips:"Search Helper is loading value",inputPlaceholder:"Please enter...",selectPlaceholder:"Please select...",treePlaceholder:"Tree node filter",rangeInputNumberPlaceholder:["Start value","End value"],rangeSearchHelper:["Start","End"],datePlaceholder:"Select date",timePlaceholder:"Select time",weekPlaceholder:"Select week",monthPlaceholder:"Select month",quarterPlaceholder:"Select quarter",yearPlaceholder:"Select year",daterangePlaceholder:["Start date","End date"],timerangePlaceholder:["Start time","End time"],monthrangePlaceholder:["Start month","End month"],yearrangePlaceholder:["Start year","End year"],datePickers:["Today","Yesterday","A Week Ago","A Month Ago"],dateRangePickers:["Nearly A Week","Nearly A Month","Nearly Three Months","Nearly Six Months"],citySelectType:["Province","City"],regionSelectLabel:["Province","City","Region","Street"],validatePrompt:"Form validation tips"},clipboard:{success:"Copy successful",error:"Copy failed"},download:{text:"Download",success:"File downloaded successfully",error:"File download failed!"},upload:{tooltip:"Can only upload {type} format",notType:"Unsupported file types {type}",sizeLimit:"Size cannot exceed {size}M",countLimit:"Quantity cannot exceed {count}",uploadError:"Failed to upload files!",downError:"File download failed!",text:"click and upload",remove:"Delete files",batchDownload:"Batch download"},uploadCropper:{dragableText:"Drop or click",pasteText:"Ctrl+V Paste",tooltip:"Can only upload {type} format",preview:"Preview image",cropper:"Cropper image",uploadError:"Failed to upload images!",downError:"Image download failed!",text:"Upload image",zoomIn:"Zoom in",zoomOut:"Zoom out",rotatePlus:"Rotate plus",rotateSubtract:"Rotate subtract"},print:{preview:"Print preview",pageSetting:"Page setting",printError:"Print failed!",exportError:"Export failed!",defaultPrinter:"Default printer",laserPrinter:"Laser printer",stylusPrinter:"Stylus printer",printer:"Printer",type:"Type",copies:"Copies",printPage:["Print","page"],setting:"Setting",export:"Export",print:"Print",scale:"Scale",paper:"Paper",pageNumber:"Number",pagination:"{currentPage} / {totalPage} page",setPanel:{printParameter:"Print parameter",pagerType:"Pager type",carbonPaper:"Triple carbon paper(stylus)",printDirection:"Print direction",vertical:"Vertical",horizontal:"Horizontal",doublePrint:"Double print",autoDoublePrint:"Auto double print",manualDoublePrint:"Manual double print",fixedLogo:"Fixed Logo",printMargin:"Print margin",leftMargin:"Left margin",rightMargin:"Light margin",topMargin:"Top margin",bottomMargin:"Bottom margin",sizeUnit:"cm",noEmpty:"Can not be empty"}},split:{resize:"Drag to change size"},searchHelper:{text:"Search helper",orderIndex:"Index",rangeStartTip:"Start position cannot be greater than end position",rangeEndTip:"End position cannot be less than start position"},tour:{prevStep:"Prev",nextStep:"Next",finish:"Finish"},guideTracker:{addButton:"Add To",editButton:"Save",closeButton:"Close",finishButton:"Finish And Save",label:"Operation guide collection",currentStep:"Current Step: "},table:{config:{selectionText:"#",summaryText:"Summation",copyText:"Copy",emptyText:"No Data..."},alert:{total:"Total {total} items",selected:"Selected {total}",clear:"Clear"},selection:{all:"Select all",invert:"Invert select",clear:"Clear all",currentPage:"Select all on current page"},columnFilter:{text:"Define",reset:"Reset",draggable:"Drag and sort",fixedLeft:"Fixed left",fixedRight:"Fixed right",cancelFixed:"Cancel fixed"},editable:{inputPlaceholder:"Please input",selectPlaceholder:"Please select",datePlaceholder:"Select date",datetimePlaceholder:"Select time"},sorter:{text:"Sort",asc:"Ascending",desc:"Descending"},filter:{search:"Search",reset:"Reset",searchText:"Filter {text}",searchAreaText:"Filter {text}, separated by commas",text:"Filter",selectAll:"Select all",invert:"Invert",onlyItem:"Only item",keywordSearch:"Keyword Search"},screen:{full:"Full Screen",cancelFull:"Cancel Full Screen"},import:{text:"Import",textNoSpace:"Import",success:"Successfully imported {total} records",error:"Import failed, please check that the field name and data format are correct.",settingTitle:"Import setting",importType:"Import type",insertPos:"Insertion position",fillText:"fill",addText:"add",insertText:"insert"},export:{text:"Export",textNoSpace:"Export",closeButton:"Close",settingTitle:"Export setting",fileName:"File name",fileType:"File type",sheetName:"Title",all:"All",selected:"Selected",custom:"Custom",footSummation:"Summation",useStyle:"Use style",warnText:"No table data or exporting"},clipboard:{text:"Paste",textNoSpace:"Paste",success:"Successfully paste {total} records",settingTitle:"Paste setting",rowIndex:"Start row index",colIndex:"Start col index",content:"content",placeholder:"Please paste data here with ctrl+v",supportText:"Note: only excel data can be pasted"},areaSelect:{mergeCell:"Cell Merge",cancelMerge:"Cancel Merge"},print:{text:"Print"},refresh:{text:"Reload"},toolbox:{text:"Tool box"},selectCollection:{text:"Selected row collection",settingTitle:"Selected row list",closeButton:"Close"},groupSummary:{text:"Summary",settingTitle:"Summary setting",savedSetting:"Saved configuration",saveButton:"Save",closeButton:"Close",confirmButton:"Show summary",removeText:"Remove",configText:"Configuration name",resultText:"Summary result",sumText:"column value summary",maxText:"column max value",minText:"column min value",avgText:"column avg value",countText:"records summary",operation:"Operation",index:"Index",groupItem:"Group item",summaryColumn:"Summary column",calcFormula:"Calculate formula"},highSearch:{text:"Super search",settingTitle:"Super search setting",searchButton:"Start search",closeButton:"Close",removeText:"Remove",andText:"and",orText:"or",gtText:"is greater than",ltText:"is lesser than",gteText:"is equal or greater than",lteText:"is equal or lesser than",eqText:"is equal to",neqText:"is not equal to",inText:"include",ninText:"not include",nullText:"null value",notNullText:"not null value",startsWithText:"beginning is",endsWithText:"ending is",configText:"Configuration name",saveButton:"Save",savedSetting:"Saved configuration",operation:"Operation",bracket:"Bracket",fieldName:"Field name",fieldType:"Field type",expression:"Expression",condition:"Condition value",logic:"Logic",noEmpty:"Can not be empty"},fastSearch:{text:"Records location search",settingTitle:"Records location search setting",closeButton:"Close",savedSetting:"Saved configuration",queryCondition:"Please enter query condition",notMatch:"There are no qualified records!",toTheEnd:"It has been found to the end. Do you want to find it from the beginning?",toStart:"The start has been found. Do you want to start from the end?",matchCase:"Case matching",matchFullchar:"Full character matching",queryLabel:"Find content",queryPrev:"Find previous",queryNext:"Find next",queryAll:"Find all",findTotal:"Found {total} cells",cellText:"Cell",valText:"Value"},pivotGrid:{text:"Pivot Grid",settingTitle:"Pivot Grid Dashboard"}},pivotGrid:{saved:{text:"Config",add:"Add configuration",title:"Saved configuration list"},export:{text:"Export",group:"Export group",list:"Export list"},count:{statistic:"Statistics",records:"count",unique:"unique",empty:"empty",notEmpty:"not empty",sum:"sum value",max:"max value",min:"min value",avg:"avg value"},field:{text:"Field manage",title:"Field customization settings"},fillColor:{text:"Fill color",add:"Add condition",title:"Set fill color conditions",cell:"Cell",row:"Row",col:"Col"},filter:{text:"Filter",title:"Set filter conditions",matchAll:"Meet all conditions",matchAny:"Meet any conditions"},group:{text:"Group",title:"Set group conditions",foldAll:"Fold all",unfoldAll:"unfold all",empty:"(Empty content)",ascend:"Order ascend",descend:"Order descend"},lineHeight:{text:"Line height",size:["Common size","Middle size","Large size"]},search:{text:"Search",title:"Set search conditions"},sorter:{text:"Sorter",title:"Set sorter conditions",ascend:"Field ascend",descend:"Field descend"},viewMode:{table:"Table view",gantt:"Gantt view",card:"Card view"}},translate:{sourceText:"Source Text",targetText:"Target Text",translating:"Translating"}}};const rt={[at.name]:{qm:at,antd:Z.default},[Ee.name]:{qm:Ee,antd:Q.default}},it=e=>{const t="zh-cn",l=je({locale:t,size:"middle"},e),{locale:n,size:a,global:r}=l,i=q.default.useMemo((()=>Object.assign({},rt,null==r?void 0:r.langPackage)),[r]),o=q.default.useMemo((()=>r?He(r,["langPackage"]):r),[r]),s=(e,l)=>{const n=e.split("-")[0],a=i[e]?e:i[n]?n:t;return i[a][l]};q.default.useMemo((()=>{return e=s(n,"qm"),Ce=e||Ce,void(Ce.name&&j.default.locale(Ce.name));var e}),[n]);const u=q.default.useMemo((()=>({locale:n,size:a,global:o})),[n,a]);return q.default.createElement(xe.Provider,{value:u},q.default.createElement(d.ConfigProvider,{locale:s(n,"antd"),componentSize:a,autoInsertSpaceInButton:null==o?void 0:o.autoInsertSpaceInButton},l.children))};function ot(){const{locale:e}=$.useContext(xe);return{t:Se,$locale:e}}function st(e){const t=$.useRef();t.current=e;return $.useCallback(((...e)=>{var l;return null===(l=t.current)||void 0===l?void 0:l.call(t,...e)}),[])}function dt(e){const{size:t}=$.useContext(xe);return{$size:$.useMemo((()=>{var l,n;return null!==(n=null!==(l=e.size)&&void 0!==l?l:t)&&void 0!==n?n:""}),[e.size,t])}}it.displayName="QmConfigProvider";class ut extends Error{constructor(e){super(e),this.name="QmDesignError"}}function ct(e,t){throw new ut(`[${e}] ${t}`)}function ft(e,t){console.warn(new ut(`[${e}] ${t}`))}const pt=e=>{const{loading:t,shortcutKey:n,authConfig:a,click:r,confirm:i}=e,{t:o}=ot(),{$size:s}=dt(e);q.default.useEffect((()=>(n&&document.addEventListener("keyup",f),()=>document.removeEventListener("keyup",f))),[]);const[u,c]=q.default.useState(!1),f=st((e=>{var t;const l=n.split("+").map((e=>e.trim().toLowerCase())),a=l.includes("alt"),r=l.includes("ctrl"),i=l.includes("shift"),o=l[l.length-1];a&&!e.altKey||r&&!e.ctrlKey||i&&!e.shiftKey||e.key.toLowerCase()!==o||(e.preventDefault(),m.disabled||null===(t=m.onClick)||void 0===t||t.call(m,e))})),p=l.isFunction(r)?{onClick:t=>Ie(void 0,void 0,void 0,(function*(){var l;c(!0);try{yield null===(l=e.click)||void 0===l?void 0:l.call(e,t)}catch(e){ft("Button","`click`方法执行出错")}c(!1)}))}:null,m=Object.assign(Object.assign(Object.assign({},He(e,["shortcutKey","authConfig","click","confirm"])),{size:s,loading:u||t||!1}),p);if(a){const{visible:e=1,disabled:t}=a||{};if(!e)return null;t&&(m.disabled=!0)}const h=q.default.createElement(d.Button,m,e.children);return i?q.default.createElement(d.Popconfirm,{title:i.title||o("qm.button.confirmTitle"),disabled:m.disabled,onConfirm:e=>{var t,l;null===(t=i.onConfirm)||void 0===t||t.call(i),null===(l=m.onClick)||void 0===l||l.call(m,e)},onCancel:e=>{var t;null===(t=i.onCancel)||void 0===t||t.call(i,e)}},q.default.createElement(d.Button,tt({},m,{onClick:Le}),e.children)):!n||m.disabled?h:q.default.createElement(d.Tooltip,{placement:"top",title:`${o("qm.button.shortcutKey")}: ${n}`},h)};var mt;pt.displayName="QmButton",function(e){e[e.default=14]="default",e[e.large=12]="large",e[e.middle=10]="middle",e[e.small=8]="small"}(mt||(mt={}));const ht=e=>{const{$size:t}=dt(e),n=l.isNumber(e.size)?e.size:mt[t||"default"],a=Object.assign(Object.assign({},He(e,["size"])),{size:n});return q.default.createElement(d.Space,a,e.children)};ht.displayName="QmSpace";const gt=e=>`qm-${e}`,vt=e=>{const{label:t,extra:l,collapse:n,bordered:a=!0,disabled:r,id:i,className:o,style:s,onCollapseChange:u}=e,{$size:c}=dt(e),{t:f}=ot(),p=gt("divider"),m={[p]:!0,[`${p}-borderless`]:!a,[`${p}--lg`]:"large"===c,[`${p}--sm`]:"small"===c};return q.default.createElement("div",{id:i,className:J.default(m,o),style:s},q.default.createElement("span",{className:`${p}__title`},t),q.default.createElement("div",{className:`${p}__extra`},l),void 0!==n&&q.default.createElement(d.Button,{type:"link",className:`${p}__collapse`,disabled:r,onClick:()=>{null==u||u(!n)}},f(n?"qm.divider.collect":"qm.divider.spread"),n?q.default.createElement(g.UpOutlined,null):q.default.createElement(g.DownOutlined,null)))};vt.displayName="QmDivider";const yt=()=>({height:0,opacity:0}),bt=e=>({height:e.scrollHeight,opacity:1}),xt=e=>({height:e?e.offsetHeight:0}),Et=(e,t)=>!0===(null==t?void 0:t.deadline)||"height"===t.propertyName;function Ct(e){return Ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ct(e)}function wt(e){var t=function(e,t){if("object"!==Ct(e)||null===e)return e;var l=e[Symbol.toPrimitive];if(void 0!==l){var n=l.call(e,t||"default");if("object"!==Ct(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ct(t)?t:String(t)}function St(e,t,l){return(t=wt(t))in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}function Nt(e,t){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),l.push.apply(l,n)}return l}function Tt(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{};t%2?Nt(Object(l),!0).forEach((function(t){St(e,t,l[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(l)):Nt(Object(l)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(l,t))}))}return e}function It(e,t){(null==t||t>e.length)&&(t=e.length);for(var l=0,n=new Array(t);l<t;l++)n[l]=e[l];return n}function Ot(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var l=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=l){var n,a,r,i,o=[],s=!0,d=!1;try{if(r=(l=l.call(e)).next,0===t){if(Object(l)!==l)return;s=!1}else for(;!(s=(n=r.call(l)).done)&&(o.push(n.value),o.length!==t);s=!0);}catch(e){d=!0,a=e}finally{try{if(!s&&null!=l.return&&(i=l.return(),Object(i)!==i))return}finally{if(d)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return It(e,t);var l=Object.prototype.toString.call(e).slice(8,-1);return"Object"===l&&e.constructor&&(l=e.constructor.name),"Map"===l||"Set"===l?Array.from(e):"Arguments"===l||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?It(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rt(e){return e instanceof HTMLElement||e instanceof SVGElement}function kt(e){var t,l=function(e){return e&&"object"===Ct(e)&&Rt(e.nativeElement)?e.nativeElement:Rt(e)?e:null}(e);return l||(e instanceof q.default.Component?null===(t=ee.default.findDOMNode)||void 0===t?void 0:t.call(ee.default,e):null)}var Lt,Pt={exports:{}},At={};Pt.exports=(Lt||(Lt=1,function(){var e,t=Symbol.for("react.element"),l=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),s=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen");function h(e){if("object"==typeof e&&null!==e){var m=e.$$typeof;switch(m){case t:var h=e.type;switch(h){case n:case r:case a:case u:case c:return h;default:var g=h&&h.$$typeof;switch(g){case s:case o:case d:case p:case f:case i:return g;default:return m}}case l:return m}}}e=Symbol.for("react.module.reference");var g=o,v=i,y=t,b=d,x=n,E=p,C=f,w=l,S=r,N=a,T=u,I=c,O=!1,R=!1;At.ContextConsumer=g,At.ContextProvider=v,At.Element=y,At.ForwardRef=b,At.Fragment=x,At.Lazy=E,At.Memo=C,At.Portal=w,At.Profiler=S,At.StrictMode=N,At.Suspense=T,At.SuspenseList=I,At.isAsyncMode=function(e){return O||(O=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},At.isConcurrentMode=function(e){return R||(R=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},At.isContextConsumer=function(e){return h(e)===o},At.isContextProvider=function(e){return h(e)===i},At.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},At.isForwardRef=function(e){return h(e)===d},At.isFragment=function(e){return h(e)===n},At.isLazy=function(e){return h(e)===p},At.isMemo=function(e){return h(e)===f},At.isPortal=function(e){return h(e)===l},At.isProfiler=function(e){return h(e)===r},At.isStrictMode=function(e){return h(e)===a},At.isSuspense=function(e){return h(e)===u},At.isSuspenseList=function(e){return h(e)===c},At.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===r||t===a||t===u||t===c||t===m||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===f||t.$$typeof===i||t.$$typeof===o||t.$$typeof===d||t.$$typeof===e||void 0!==t.getModuleId)},At.typeOf=h}()),At);var Ft=function(e,t){"function"==typeof e?e(t):"object"===Ct(e)&&e&&"current"in e&&(e.current=t)},_t=function(){for(var e=arguments.length,t=new Array(e),l=0;l<e;l++)t[l]=arguments[l];var n=t.filter(Boolean);return n.length<=1?n[0]:function(e){t.forEach((function(t){Ft(t,e)}))}},Dt=function(e){var t,l,n=Pt.exports.isMemo(e)?e.type.type:e.type;return!!("function"!=typeof n||null!==(t=n.prototype)&&void 0!==t&&t.render||n.$$typeof===Pt.exports.ForwardRef)&&!!("function"!=typeof e||null!==(l=e.prototype)&&void 0!==l&&l.render||e.$$typeof===Pt.exports.ForwardRef)};function Mt(e,t){if(null==e)return{};var l,n,a=function(e,t){if(null==e)return{};var l,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)l=r[n],t.indexOf(l)>=0||(a[l]=e[l]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)l=r[n],t.indexOf(l)>=0||Object.prototype.propertyIsEnumerable.call(e,l)&&(a[l]=e[l])}return a}Number(e.version.split(".")[0]);var Ht=$.createContext({});function qt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $t(e,t){for(var l=0;l<t.length;l++){var n=t[l];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,wt(n.key),n)}}function jt(e,t,l){return t&&$t(e.prototype,t),l&&$t(e,l),Object.defineProperty(e,"prototype",{writable:!1}),e}function Kt(e,t){return Kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Kt(e,t)}function Vt(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kt(e,t)}function zt(e){return zt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zt(e)}function Wt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var l,n=zt(e);if(t){var a=zt(this).constructor;l=Reflect.construct(n,arguments,a)}else l=n.apply(this,arguments);return function(e,t){if(t&&("object"===Ct(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Wt(e)}(this,l)}}var Ut=function(e){Vt(l,$.Component);var t=Bt(l);function l(){return qt(this,l),t.apply(this,arguments)}return jt(l,[{key:"render",value:function(){return this.props.children}}]),l}();function Gt(e){var t=$.useRef(!1),l=Ot($.useState(e),2),n=l[0],a=l[1];return $.useEffect((function(){return t.current=!1,function(){t.current=!0}}),[]),[n,function(e,l){l&&t.current||a(e)}]}var Yt="none",Xt="appear",Qt="enter",Zt="leave",Jt="none",el="prepare",tl="start",ll="active",nl="end",al="prepared";function rl(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}function il(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit".concat(e)]="webkit".concat(t),l["Moz".concat(e)]="moz".concat(t),l["ms".concat(e)]="MS".concat(t),l["O".concat(e)]="o".concat(t.toLowerCase()),l}var ol,sl,dl,ul=(ol=rl(),sl="undefined"!=typeof window?window:{},dl={animationend:il("Animation","AnimationEnd"),transitionend:il("Transition","TransitionEnd")},ol&&("AnimationEvent"in sl||delete dl.animationend.animation,"TransitionEvent"in sl||delete dl.transitionend.transition),dl),cl={};if(rl()){var fl=document.createElement("div");cl=fl.style}var pl={};function ml(e){if(pl[e])return pl[e];var t=ul[e];if(t)for(var l=Object.keys(t),n=l.length,a=0;a<n;a+=1){var r=l[a];if(Object.prototype.hasOwnProperty.call(t,r)&&r in cl)return pl[e]=t[r],pl[e]}return""}var hl=ml("animationend"),gl=ml("transitionend"),vl=!(!hl||!gl),yl=hl||"animationend",bl=gl||"transitionend";function xl(e,t){return e?"object"===Ct(e)?e[t.replace(/-\w/g,(function(e){return e[1].toUpperCase()}))]:"".concat(e,"-").concat(t):null}var El=function(t){var l=e.useRef(),n=e.useRef(t);n.current=t;var a=$.useCallback((function(e){n.current(e)}),[]);function r(e){e&&(e.removeEventListener(bl,a),e.removeEventListener(yl,a))}return $.useEffect((function(){return function(){r(l.current)}}),[]),[function(e){l.current&&l.current!==e&&r(l.current),e&&e!==l.current&&(e.addEventListener(bl,a),e.addEventListener(yl,a),l.current=e)},r]},Cl=rl()?e.useLayoutEffect:e.useEffect,wl=function(e){return+setTimeout(e,16)},Sl=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(wl=function(e){return window.requestAnimationFrame(e)},Sl=function(e){return window.cancelAnimationFrame(e)});var Nl=0,Tl=new Map;function Il(e){Tl.delete(e)}var Ol=function(e){var t=Nl+=1;return function l(n){if(0===n)Il(t),e();else{var a=wl((function(){l(n-1)}));Tl.set(t,a)}}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),t};Ol.cancel=function(e){var t=Tl.get(e);return Il(e),Sl(t)},Ol.ids=function(){return Tl};var Rl=[el,tl,ll,nl],kl=[el,al],Ll=!1,Pl=!0;function Al(e){return e===ll||e===nl}var Fl=function(e,t,l){var n=Ot(Gt(Jt),2),a=n[0],r=n[1],i=function(){var e=$.useRef(null);function t(){Ol.cancel(e.current)}return $.useEffect((function(){return function(){t()}}),[]),[function l(n){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;t();var r=Ol((function(){a<=1?n({isCanceled:function(){return r!==e.current}}):l(n,a-1)}));e.current=r},t]}(),o=Ot(i,2),s=o[0],d=o[1];var u=t?kl:Rl;return Cl((function(){if(a!==Jt&&a!==nl){var e=u.indexOf(a),t=u[e+1],n=l(a);n===Ll?r(t,!0):t&&s((function(e){function l(){e.isCanceled()||r(t,!0)}!0===n?l():Promise.resolve(n).then(l)}))}}),[e,a]),$.useEffect((function(){return function(){d()}}),[]),[function(){r(el,!0)},a]};var _l=function(t){var l=t;"object"===Ct(t)&&(l=t.transitionSupport);var n=$.forwardRef((function(t,n){var a=t.visible,r=void 0===a||a,i=t.removeOnLeave,o=void 0===i||i,s=t.forceRender,d=t.children,u=t.motionName,c=t.leavedClassName,f=t.eventProps,p=function(e,t){return!(!e.motionName||!l||!1===t)}(t,$.useContext(Ht).motion),m=e.useRef(),h=e.useRef();var g=function(t,l,n,a){var r=a.motionEnter,i=void 0===r||r,o=a.motionAppear,s=void 0===o||o,d=a.motionLeave,u=void 0===d||d,c=a.motionDeadline,f=a.motionLeaveImmediately,p=a.onAppearPrepare,m=a.onEnterPrepare,h=a.onLeavePrepare,g=a.onAppearStart,v=a.onEnterStart,y=a.onLeaveStart,b=a.onAppearActive,x=a.onEnterActive,E=a.onLeaveActive,C=a.onAppearEnd,w=a.onEnterEnd,S=a.onLeaveEnd,N=a.onVisibleChanged,T=Ot(Gt(),2),I=T[0],O=T[1],R=Ot(Gt(Yt),2),k=R[0],L=R[1],P=Ot(Gt(null),2),A=P[0],F=P[1],_=e.useRef(!1),D=e.useRef(null);function M(){return n()}var H=e.useRef(!1);function q(){L(Yt,!0),F(null,!0)}function j(e){var t=M();if(!e||e.deadline||e.target===t){var l,n=H.current;k===Xt&&n?l=null==C?void 0:C(t,e):k===Qt&&n?l=null==w?void 0:w(t,e):k===Zt&&n&&(l=null==S?void 0:S(t,e)),k!==Yt&&n&&!1!==l&&q()}}var K=Ot(El(j),1)[0],V=function(e){var t,l,n;switch(e){case Xt:return St(t={},el,p),St(t,tl,g),St(t,ll,b),t;case Qt:return St(l={},el,m),St(l,tl,v),St(l,ll,x),l;case Zt:return St(n={},el,h),St(n,tl,y),St(n,ll,E),n;default:return{}}},z=$.useMemo((function(){return V(k)}),[k]),W=Ot(Fl(k,!t,(function(e){if(e===el){var t=z[el];return t?t(M()):Ll}var l;return U in z&&F((null===(l=z[U])||void 0===l?void 0:l.call(z,M(),null))||null),U===ll&&(K(M()),c>0&&(clearTimeout(D.current),D.current=setTimeout((function(){j({deadline:!0})}),c))),U===al&&q(),Pl})),2),B=W[0],U=W[1],G=Al(U);H.current=G,Cl((function(){O(l);var e,n=_.current;_.current=!0,!n&&l&&s&&(e=Xt),n&&l&&i&&(e=Qt),(n&&!l&&u||!n&&f&&!l&&u)&&(e=Zt);var a=V(e);e&&(t||a[el])?(L(e),B()):L(Yt)}),[l]),e.useEffect((function(){(k===Xt&&!s||k===Qt&&!i||k===Zt&&!u)&&L(Yt)}),[s,i,u]),e.useEffect((function(){return function(){_.current=!1,clearTimeout(D.current)}}),[]);var Y=$.useRef(!1);e.useEffect((function(){I&&(Y.current=!0),void 0!==I&&k===Yt&&((Y.current||I)&&(null==N||N(I)),Y.current=!0)}),[I,k]);var X=A;return z[el]&&U===tl&&(X=Tt({transition:"none"},X)),[k,U,X,null!=I?I:l]}(p,r,(function(){try{return m.current instanceof HTMLElement?m.current:kt(h.current)}catch(e){return null}}),t),v=Ot(g,4),y=v[0],b=v[1],x=v[2],E=v[3],C=$.useRef(E);E&&(C.current=!0);var w,S=$.useCallback((function(e){m.current=e,Ft(n,e)}),[n]),N=Tt(Tt({},f),{},{visible:r});if(d)if(y===Yt)w=E?d(Tt({},N),S):!o&&C.current&&c?d(Tt(Tt({},N),{},{className:c}),S):s||!o&&!c?d(Tt(Tt({},N),{},{style:{display:"none"}}),S):null;else{var T,I;b===el?I="prepare":Al(b)?I="active":b===tl&&(I="start");var O=xl(u,"".concat(y,"-").concat(I));w=d(Tt(Tt({},N),{},{className:J.default(xl(u,y),(T={},St(T,O,O&&I),St(T,u,"string"==typeof u),T)),style:x}),S)}else w=null;$.isValidElement(w)&&Dt(w)&&(w.ref||(w=$.cloneElement(w,{ref:S})));return $.createElement(Ut,{ref:h},w)}));return n.displayName="CSSMotion",n}(vl);function Dl(){return Dl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e},Dl.apply(this,arguments)}var Ml="add",Hl="keep",ql="remove",$l="removed";function jl(e){var t;return Tt(Tt({},t=e&&"object"===Ct(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function Kl(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(jl)}var Vl=["component","children","onVisibleChanged","onAllRemoved"],zl=["status"],Wl=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_l,l=function(e){Vt(n,$.Component);var l=Bt(n);function n(){var e;qt(this,n);for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];return St(Wt(e=l.call.apply(l,[this].concat(a))),"state",{keyEntities:[]}),St(Wt(e),"removeKey",(function(t){var l=e.state.keyEntities.map((function(e){return e.key!==t?e:Tt(Tt({},e),{},{status:$l})}));return e.setState({keyEntities:l}),l.filter((function(e){return e.status!==$l})).length})),e}return jt(n,[{key:"render",value:function(){var e=this,l=this.state.keyEntities,n=this.props,a=n.component,r=n.children,i=n.onVisibleChanged,o=n.onAllRemoved,s=Mt(n,Vl),d=a||$.Fragment,u={};return Wl.forEach((function(e){u[e]=s[e],delete s[e]})),delete s.keys,$.createElement(d,s,l.map((function(l){var n=l.status,a=Mt(l,zl),s=n===Ml||n===Hl;return $.createElement(t,Dl({},u,{key:a.key,visible:s,eventProps:a,onVisibleChanged:function(t){(null==i||i(t,{key:a.key}),t)||0===e.removeKey(a.key)&&o&&o()}}),r)})))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var l=e.keys,n=t.keyEntities,a=Kl(l),r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],l=[],n=0,a=t.length,r=Kl(e),i=Kl(t);r.forEach((function(e){for(var t=!1,r=n;r<a;r+=1){var o=i[r];if(o.key===e.key){n<r&&(l=l.concat(i.slice(n,r).map((function(e){return Tt(Tt({},e),{},{status:Ml})}))),n=r),l.push(Tt(Tt({},o),{},{status:Hl})),n+=1,t=!0;break}}t||l.push(Tt(Tt({},e),{},{status:ql}))})),n<a&&(l=l.concat(i.slice(n).map((function(e){return Tt(Tt({},e),{},{status:Ml})}))));var o={};return l.forEach((function(e){var t=e.key;o[t]=(o[t]||0)+1})),Object.keys(o).filter((function(e){return o[e]>1})).forEach((function(e){(l=l.filter((function(t){var l=t.key,n=t.status;return l!==e||n!==ql}))).forEach((function(t){t.key===e&&(t.status=Hl)}))})),l}(n,a);return{keyEntities:r.filter((function(e){var t=n.find((function(t){var l=t.key;return e.key===l}));return!t||t.status!==$l||e.status!==ql}))}}}]),n}();St(l,"defaultProps",{component:"div"})}(vl);const Bl=q.default.forwardRef(((e,t)=>{const{forceRender:l,className:n,style:a,boxStyle:r,isActive:i}=e,[o,s]=q.default.useState(i||l);if(q.default.useEffect((()=>{(l||i)&&s(!0)}),[l,i]),!o)return null;const d=gt("collapse");return q.default.createElement("div",{ref:t,className:J.default(`${d}-content`,{[`${d}-content-active`]:i,[`${d}-content-inactive`]:!i},n),style:a},q.default.createElement("div",{className:`${d}-content-box`,style:r},e.children))}));Bl.displayName="PanelContent";const Ul=e=>{const{defaultActive:t,label:l,extra:n,className:a,style:r,containerStyle:i,bordered:o,disabled:s,forceRender:d,destroyOnClose:u=!1,onChange:c}=e,[f,p]=q.default.useState(!!t),m=gt("collapse"),h=J.default({[`${m}`]:!0,[`${m}-active`]:f,[`${m}-disabled`]:s},a);return q.default.createElement("div",{className:h,style:r},q.default.createElement(vt,{label:l,extra:n,collapse:f,bordered:o,disabled:s,onCollapseChange:e=>{p(e),null==c||c(e)}}),q.default.createElement(_l,tt({visible:f},((e=gt("motion-collapse"))=>({motionName:e,onAppearStart:yt,onEnterStart:yt,onAppearActive:bt,onEnterActive:bt,onLeaveStart:xt,onLeaveActive:yt,onAppearEnd:Et,onEnterEnd:Et,onLeaveEnd:Et,motionDeadline:500}))(),{forceRender:d,removeOnLeave:u}),(({className:t,style:l},n)=>q.default.createElement(Bl,{ref:n,prefixCls:m,className:t,style:l,boxStyle:i,isActive:f,forceRender:d},e.children))))};Ul.displayName="QmCollapse";const Gl=q.default.createContext(void 0);function Yl(e,t){((e,t)=>{const l=$.useRef(!0);$.useEffect((()=>e(l.current)),t),$.useEffect((()=>(l.current=!1,()=>{l.current=!0})),[])})((t=>{if(!t)return e()}),t)}const Xl=(e,t,l)=>{e&&t&&l&&e.addEventListener(t,l,!1)},Ql=(e,t,l)=>{e&&t&&l&&e.removeEventListener(t,l,!1)},Zl=e=>e.preventDefault(),Jl=(e,t)=>{if(Oe||!e||!t)return null;"float"===(t=_e(t))&&(t="cssFloat");try{const l=e.style[t];if(l)return l;const n=window.getComputedStyle(e);return n?n[t]:""}catch(l){return e.style[t]}},en=(e,t,n)=>{!Oe&&e&&t&&(l.isPlainObject(t)?Object.keys(t).forEach((l=>{en(e,l,t[l])})):(t=_e(t),e.style[t]=n))},tn=e=>{let t=0,l=e;for(;l;)t+=l.offsetTop,l=l.offsetParent;return t},ln=(e,t)=>Math.abs(tn(e)-tn(t)),nn=e=>{let t=0,l=0;for(;e;)t+=e.offsetLeft-e.scrollLeft,l+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{x:t,y:l}},an=(e,t)=>{var l;let n=e;for(;n;){if(null===(l=n.classList)||void 0===l?void 0:l.contains(t))return n;n=n.parentNode}return null},rn=(e,t)=>{if(Oe||!e||!t)return!1;let l=e;for(;l;){if(l===t)return!0;l=l.parentNode}return!1},on=e=>Math.pow(e,3),sn=e=>e<.5?on(2*e)/2:1-on(2*(1-e))/2,dn=e=>{const{minValues:t,onDragChange:l,onDragging:n}=e,{splitRef:a,direction:r}=q.default.useContext(Gl),{t:i}=ot(),o=q.default.useRef(Oe?null:document.onselectstart),s=q.default.useMemo((()=>"horizontal"===r),[r]),d=q.default.useMemo((()=>s?"X":"Y"),[s]),u=q.default.useRef({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),c=e=>{u.current=Object.assign({},u.current,e)},f=e=>{if(1!==e.buttons)return p();const l=e[`page${d}`]-u.current[`start${d}`],a=[t[0],u.current[`containerSize${d}`]-t[1]];let r=u.current[`firstElementSize${d}`]+l;r=Math.max(a[0],r),r=Math.min(a[1],r),n(r)},p=()=>{c({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),l(!1),Ql(document,"mousemove",f),Ql(document,"mouseup",p),m()},m=()=>{document.onselectstart!==o.current&&(document.onselectstart=o.current)},h={[`${gt("split")}__resize-bar`]:!0,vertical:"vertical"===r,horizontal:"horizontal"===r};return q.default.createElement("div",{className:J.default(h),title:i("qm.split.resize"),onMouseDown:e=>{e.stopPropagation();const t=a.current,n=t.children[0];c({startX:e.pageX,startY:e.pageY,firstElementSizeX:n.offsetWidth,firstElementSizeY:n.offsetHeight,containerSizeX:t.offsetWidth,containerSizeY:t.offsetHeight}),Xl(document,"mousemove",f),Xl(document,"mouseup",p),l(!0),o.current=document.onselectstart,document.onselectstart=()=>!1}})};dn.displayName="ResizeBar";const un=q.default.forwardRef(((e,t)=>{const{offset:l,className:n,style:a}=e,{direction:r,dragging:i}=q.default.useContext(Gl),o="vertical"===r?"height":"width",s={[gt("split-pane")]:!0,isLocked:i,horizontal:"horizontal"===r,vertical:"vertical"===r,[n]:!!n},d=void 0!==l?{[o]:$e(l)}:{flex:1,[o]:0};return q.default.createElement("div",{ref:t,className:J.default(s),style:Object.assign(Object.assign({},d),a)},e.children)}));un.displayName="SplitPane";const cn=e=>{const{direction:t="horizontal",defaultValue:l="50%",uniqueKey:n,className:a,style:r,onDragStart:i,onDrag:o=Le,onDragEnd:s}=e,{global:d}=q.default.useContext(xe),u=q.default.useRef(null),c=q.default.useRef(null),f=e=>Number(e)>0?`${e}px`:(e=>["px","em","vw","vh","%"].some((t=>e.endsWith(t))))(e.toString())?e.toString():`${Number.parseFloat(e)}px`,p=e=>Number.parseInt(e,10),m=e=>{var t;const l=Number.parseInt((null===(t=e.props)||void 0===t?void 0:t.min)||0);return l>=0?l:0},h=q.default.useMemo((()=>n?`split_${n}`:""),[n]),[g,v]=q.default.useState(!1),[y,b]=q.default.useState(f(l));Yl((()=>{g?null==i||i(p(y)):(null==s||s(p(y)),localStorage.setItem(h,y),C(h,y))}),[g]),q.default.useEffect((()=>{x()}),[]);const x=()=>{if(!h)return;const e=localStorage.getItem(h);e?b(f(e)):E(h).then((e=>{localStorage.setItem(h,f(e||l)),x()})).catch((()=>{}))},E=e=>Ie(void 0,void 0,void 0,(function*(){const t=null==d?void 0:d.getComponentConfigApi;if(t)try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),C=(e,t)=>Ie(void 0,void 0,void 0,(function*(){const l=null==d?void 0:d.saveComponentConfigApi;if(l)try{yield l({[e]:t})}catch(e){}})),w=q.default.useMemo((()=>({splitRef:u,direction:t,dragging:g})),[t,g]),S=[];q.default.Children.map(e.children,(e=>{var t;Re(e)&&!ke(e)&&"SplitPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&S.push(e)}));const[N,T]=S,I=q.default.useMemo((()=>[m(N),m(T)]),[N,T]),O={[gt("split")]:!0,vertical:"vertical"===t};return q.default.createElement(Gl.Provider,{value:w},q.default.createElement("div",{ref:u,className:J.default(O,a),style:r},q.default.createElement(un,tt({},N.props,{ref:c,offset:y})),q.default.createElement(dn,{minValues:I,onDragChange:e=>v(e),onDragging:e=>{b(`${e}px`),o(e)}}),q.default.createElement(un,T.props)))};cn.displayName="QmSplit",cn.Pane=un;const fn=e=>{const{className:t,style:l}=e,{$size:n}=dt(e),a=gt("countup"),r={[a]:!0,[`${a}--lg`]:"large"===n,[`${a}--sm`]:"small"===n};return q.default.createElement(te.default,tt({},e,{className:J.default(r,t),style:l}),e.children)};fn.displayName="QmCountup";const pn=e=>{const{className:t}=e,{$size:l}=dt(e),n=gt("empty"),a=Object.assign(Object.assign({},e),{image:d.Empty.PRESENTED_IMAGE_SIMPLE}),r={[n]:!0,[`${n}--lg`]:"large"===l,[`${n}--sm`]:"small"===l};return q.default.createElement(d.Empty,tt({},a,{className:J.default(r,t)}))};pn.displayName="QmEmpty";const mn=e=>{const t=je({tip:"Loading..."},e),{fullHeight:l,className:n,style:a}=t,r=gt("spin"),i={[r]:!0,[`${r}-fullHeight`]:!!l},o=Object.assign(Object.assign({wrapperClassName:J.default(i,n)},He(t,["fullHeight"])),{style:Object.assign(Object.assign({},a),{maxHeight:"none"})});return q.default.createElement(d.Spin,o,t.children)};mn.displayName="QmSpin";const hn=q.default.createContext(void 0),gn=new Map;const vn=new le.default((function(e){e.forEach((e=>{var t;const{target:l}=e;null===(t=gn.get(l))||void 0===t||t.forEach((e=>e(l)))}))}));function yn(e,t){gn.has(e)||(gn.set(e,new Set),vn.observe(e)),gn.get(e).add(t)}function bn(e,t){gn.has(e)&&(gn.get(e).delete(t),gn.get(e).size||(vn.unobserve(e),gn.delete(e)))}function xn(e){const[t,l]=$.useState({width:0,height:0});return $.useLayoutEffect((()=>{const t=e.current,n=e=>{l({width:e.offsetWidth,height:e.offsetHeight})};return t&&yn(t,n),()=>{t&&bn(t,n)}}),[e]),t}const En=(e,t)=>{const l=$.useRef(!0);$.useLayoutEffect((()=>e(l.current)),t),$.useLayoutEffect((()=>(l.current=!1,()=>{l.current=!0})),[])};function Cn(e,t){En((t=>{if(!t)return e()}),t)}function wn(e,t){const l=$.useRef(null);$.useEffect((()=>()=>{clearTimeout(l.current),l.current=null}),[]);return $.useCallback(((...n)=>{l.current&&clearTimeout(l.current),l.current=setTimeout((()=>e.apply(this,n)),t)}),[e,t])}const Sn=(e,...t)=>q.default.isValidElement(e)?q.default.cloneElement(e,...t):null,Nn=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],Tn=e=>({_s:e,status:Nn[e],isEnter:e<3,isMounted:6!==e,isResolved:2===e||e>4}),In=e=>e?6:5,On=(e,t,l,n,a)=>{clearTimeout(n.current);const r=Tn(e);t(r),l.current=r,null==a||a({current:r})},Rn=(t={})=>{const{enter:n=!0,exit:a=!0,preEnter:r,preExit:i,timeout:o,initialEntered:s,mountOnEnter:d,unmountOnExit:u,onStateChange:c}=t||{},[f,p]=e.useState((()=>Tn(s?2:In(d)))),m=e.useRef(f),h=e.useRef(),[g,v]=(e=>l.isPlainObject(e)?[e.enter,e.exit]:[e,e])(o),y=e.useCallback((()=>{const e=((e,t)=>{switch(e){case 1:case 0:return 2;case 4:case 3:return In(t)}})(m.current._s,u);e&&On(e,p,m,h,c)}),[c,u]),b=e.useCallback((e=>{const t=e=>{switch(On(e,p,m,h,c),e){case 1:g>=0&&(h.current=setTimeout(y,g));break;case 4:v>=0&&(h.current=setTimeout(y,v));break;case 0:case 3:h.current=setTimeout((()=>t(e+1)),0)}},l=m.current.isEnter;"boolean"!=typeof e&&(e=!l),e?!l&&t(n?r?0:1:2):l&&t(a?i?3:4:In(u))}),[y,c,n,a,r,i,g,v,u]);return e.useEffect((()=>()=>clearTimeout(h.current)),[]),[f,b,y]},kn=e=>{const{name:t,in:l,timeout:n,preEnter:a=!0,preExit:r}=e,[i,o]=Rn({timeout:n,preEnter:a,preExit:r,initialEntered:l});return Cn((()=>{o()}),[l]),q.default.createElement(q.default.Fragment,null,q.default.Children.map(e.children,(e=>q.default.isValidElement(e)?Sn(e,{className:J.default(e.props.className,t,i.status)}):e)))},Ln=6,Pn={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",reverse:"width",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",reverse:"height",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},An=e=>{const{thumb:t,always:l,className:n,barSize:a=Ln,direction:r="vertical",onDrag:i=Le}=e,{dragging:o,scrollbarElement:s,wrapElement:d}=q.default.useContext(hn),u=Pn[r],c=q.default.useRef(null),f=q.default.useRef(null),p=q.default.useRef({}),m=q.default.useRef(!1),h=q.default.useRef(!1),g=q.default.useRef(Oe?null:document.onselectstart),[v,y]=q.default.useState(!1);q.default.useEffect((()=>{const e=s.current;return Xl(e,"mousemove",C),Xl(e,"mouseleave",w),()=>{E(),Ql(document,"mouseup",x),Ql(e,"mousemove",C),Ql(e,"mouseleave",w)}}),[]);const b=e=>{if(!c.current||!f.current)return;if(!m.current)return;const t=p.current[u.axis];if(!t)return;const l=100*(-1*(c.current.getBoundingClientRect()[u.direction]-e[u.client])-(f.current[u.offset]-t))/c.current[u.offset];d.current[u.scroll]=l*d.current[u.scrollSize]/100,i(!0)},x=()=>{m.current=!1,p.current={[u.axis]:0},Ql(document,"mousemove",b),Ql(document,"mouseup",x),E(),h.current&&y(!1),i(!1)},E=()=>{document.onselectstart!==g.current&&(document.onselectstart=g.current)},C=st((()=>{h.current=!1,y(!!t.size)})),w=st((()=>{h.current=!0,y(m.current)})),S=gt("scrollbar"),N={[`${S}__bar`]:!0,"is-vertical":"vertical"===r,"is-horizontal":"horizontal"===r},T={[u.reverse]:a},I={[u.size]:t.size,transform:`translate${u.axis}(${t.offset}%)`};return q.default.createElement(kn,{name:"fade",in:l||o||v,timeout:300},q.default.createElement("div",{ref:c,className:J.default(N,n),style:T,onMouseDown:e=>{const t=e.target;if(!t)return;const l=100*(Math.abs(t.getBoundingClientRect()[u.direction]-e[u.client])-f.current[u.offset]/2)/c.current[u.offset];d.current[u.scroll]=l*d.current[u.scrollSize]/100}},q.default.createElement("div",{ref:f,className:`${S}__thumb`,style:I,onMouseDown:e=>{e.stopPropagation(),Xl(document,"mousemove",b),Xl(document,"mouseup",x),m.current=!0,g.current=document.onselectstart,document.onselectstart=()=>!1;const t=e.target;t&&(p.current={[u.axis]:t[u.offset]-(e[u.client]-t.getBoundingClientRect()[u.direction])})}})))},Fn=20,_n=q.default.forwardRef(((e,t)=>{const{wrapClassName:n,wrapStyle:a,innerStyle:r,barWidth:i,always:o,native:s,showTopScrollbar:d,minSize:u=Fn,onScroll:c,onReachedEnd:f}=e,p=q.default.useRef(null),m=q.default.useRef(null),h=q.default.useRef(null),g=q.default.useRef({prevTop:0,prevLeft:0}),[v,y]=q.default.useState({size:0,offset:0,ratio:1}),[b,x]=q.default.useState({size:0,offset:0,ratio:1}),[E,C]=q.default.useState(!1),w=xn(p),S=xn(h);Cn((()=>{!s&&N()}),[S.width,S.height,w.width,w.height]);const N=wn((()=>{if(!m.current)return;const e=m.current.offsetHeight-4,t=m.current.offsetWidth-4,l=Math.pow(e,2)/m.current.scrollHeight,n=Math.pow(t,2)/m.current.scrollWidth,a=Math.max(l,u),r=Math.max(n,u),i=l/(e-l)/(a/(e-a)),o=n/(t-n)/(r/(t-r)),s=a+4<e?a:0,d=r+4<t?r:0,c=100*m.current.scrollTop/e*i,f=100*m.current.scrollLeft/t*o;y(Object.assign({},v,{size:d,ratio:o,offset:f})),x(Object.assign({},b,{size:s,ratio:i,offset:c}))}),5),T=e=>{C(e)},I=(e,t)=>{l.isNumber(e)?t?((e,t)=>{const l=Date.now(),n=e.scrollTop,a=window.requestAnimationFrame,r=()=>{const i=(Date.now()-l)/500;i<1?(e.scrollTop=n+(t-n)*sn(i),a(r)):e.scrollTop=t};a(r)})(m.current,e):m.current.scrollTop=e:ft("Scrollbar","SET_SCROLL_TOP 参数必须是数值类型")},O=(e,t)=>{l.isNumber(e)?t?((e,t)=>{const l=Date.now(),n=e.scrollLeft,a=window.requestAnimationFrame,r=()=>{const i=(Date.now()-l)/500;i<1?(e.scrollLeft=n+(t-n)*sn(i),a(r)):e.scrollLeft=t};a(r)})(m.current,e):m.current.scrollLeft=e:ft("Scrollbar","SET_SCROLL_LEFT 参数必须是数值类型")};q.default.useImperativeHandle(t,(()=>{var e,t;return{container:p.current,scrollElement:m.current,scrollTop:(null===(e=m.current)||void 0===e?void 0:e.scrollTop)||0,scrollLeft:(null===(t=m.current)||void 0===t?void 0:t.scrollLeft)||0,SET_SCROLL_TOP:I,SET_SCROLL_LEFT:O}}));const R=q.default.useMemo((()=>({dragging:E,scrollbarElement:p,wrapElement:m})),[E]),k=gt("scrollbar"),L={[`${k}__wrap`]:!0,[`${k}__wrap--hidden`]:!s};return q.default.createElement("div",{ref:p,className:J.default(k,e.className),style:e.style},q.default.createElement("div",{ref:m,className:J.default(L,n),style:a,onScroll:e=>{const{scrollTop:t,scrollLeft:l}=e.target;!s&&(({scrollTop:e,scrollLeft:t})=>{if(!m.current)return;const l=m.current.offsetHeight-4,n=m.current.offsetWidth-4,a=100*e/l*b.ratio,r=100*t/n*v.ratio;y(Object.assign({},v,{offset:r})),x(Object.assign({},b,{offset:a}))})({scrollTop:t,scrollLeft:l}),null==c||c({scrollTop:t,scrollLeft:l});const{prevTop:n,prevLeft:a}=g.current,r={bottom:t+m.current.clientHeight>=m.current.scrollHeight,top:t<=0&&0!==n,right:l+m.current.clientWidth>=m.current.scrollWidth&&a!==l,left:l<=0&&0!==a};let i;var o;n!==t&&(i=t>n?"bottom":"top"),a!==l&&(i=l>a?"right":"left"),i&&r[i]&&(null==f||f(i,{scrollTop:t,scrollLeft:l})),o={prevTop:t,prevLeft:l},g.current=o}},q.default.createElement("div",{ref:h,className:`${k}__view`,style:r},e.children)),!s&&q.default.createElement(hn.Provider,{value:R},d&&q.default.createElement(An,{className:"top",direction:"horizontal",thumb:v,barSize:i,always:o,onDrag:T}),q.default.createElement(An,{direction:"horizontal",thumb:v,barSize:i,always:o,onDrag:T}),q.default.createElement(An,{direction:"vertical",thumb:b,barSize:i,always:o,onDrag:T})))}));_n.displayName="QmScrollbar";const Dn=(e,t)=>{if(navigator.msSaveBlob)navigator.msSaveBlob(e,decodeURI(t));else{const l=window.URL.createObjectURL(e);let n=document.createElement("a");n.href=l,n.download=decodeURI(t),n.click(),n=null}},Mn=(e,{fileName:t,headers:l,params:n})=>Ie(void 0,void 0,void 0,(function*(){const a=n?new URLSearchParams(n).toString():"",r=a?e.includes("?")?"&":"?":"",i=yield fetch(e+`${r+a}`,{method:"GET",headers:l});if(!i.ok)throw new Error(Se("qm.download.error"));const o=yield i.blob(),s=i.headers.get("content-disposition"),d=t||(s?s.split(";")[1].split("filename=")[1]:e.slice(e.lastIndexOf("/")+1));Dn(o,d)})),Hn=e=>{const t=e.lastIndexOf(".");return-1!==t?e.substring(0,t):e},qn=e=>{const t=e.lastIndexOf(".");return-1!==t?e.substring(t+1):""},$n=e=>{var t,l;const n=je({name:"file",multiple:!0,showUploadList:{showPreviewIcon:!0,showDownloadIcon:!0,showRemoveIcon:!0}},e),{fileList:a=[],fileDirection:r="vertical",batchDownload:i,draggable:o,editable:s,disabled:u,readOnly:c,button:f={},className:p,onPreview:m,onSortChange:h,onEditChange:v,onDownload:y,onChange:b}=n,{t:x}=ot(),{$size:E}=dt(n),C=q.default.useRef(null),w=q.default.useRef(null),[S,N]=q.default.useState({}),T=q.default.useMemo((()=>u||c),[u,c]);q.default.useEffect((()=>(R(),()=>{var e;return null===(e=w.current)||void 0===e?void 0:e.destroy()})),[]);const I=(e,t)=>{N((l=>Object.assign({},l,{[e]:null!=t?t:!l[e]})))},O=st((e=>{const{oldIndex:t,newIndex:l}=e;if(t!==l){const e=[...a],[n]=e.splice(t,1);e.splice(l,0,n),null==h||h(e),null==b||b({file:a[t],fileList:e})}})),R=()=>{o&&(w.current=ne.default.create(an(C.current,gt("upload-file")).querySelector(".ant-upload-list"),{animation:150,handle:".handle",filter:".ignore",draggable:".ant-upload-list-text-container",onEnd:O}))},k=e=>Ie(void 0,void 0,void 0,(function*(){if(y)return void(yield y(e));const{downloadWithHeaders:t,headers:l}=n;try{e.url&&(yield Mn(e.url,Object.assign({fileName:e.name},t?{headers:l}:null)))}catch(e){d.message.error(x("qm.download.error"))}})),L=gt("upload-file"),P={[L]:!0,[`${L}--lg`]:"large"===E,[`${L}--sm`]:"small"===E,[`${L}--horizontal`]:"horizontal"===r};return q.default.createElement(d.Upload,tt({className:J.default(P,p)},He(n,["fileTypes","fileSize","fileDirection","batchDownload","draggable","editable","button"]),{beforeUpload:(e,t)=>new Promise(((l,a)=>Ie(void 0,void 0,void 0,(function*(){const{fileTypes:r=[],fileSize:i,maxCount:o,fileList:s=[],beforeUpload:u}=n,c=!r.length||r.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),f=!i||e.size/1024/1024<i,p=!(o>1)||s.length<o,m=c&&f&&p;if(c||d.message.warning(x("qm.upload.tooltip",{type:r.join(",")})),f||d.message.warning(x("qm.upload.sizeLimit",{size:i})),p||d.message.warning(x("qm.upload.countLimit",{count:o})),!m)return d.Upload.LIST_IGNORE;if(u){const n=u(e,t);if(!0===n)return l(e);if(!1===n)return a("not upload");if(n&&"function"==typeof n.then)try{const e=yield n;l(e)}catch(e){a(e)}}else l(e)})))),disabled:T,onChange:b,onPreview:e=>Ie(void 0,void 0,void 0,(function*(){if("function"==typeof m)return m(e,(t=>k(t||e)));u||(yield k(e))})),onDownload:e=>Ie(void 0,void 0,void 0,(function*(){yield k(e)})),itemRender:(e,t,l,r)=>((e,t)=>{const{iconRender:l}=n,{uid:r,name:i,url:c,status:f="done"}=e,p="ant-btn ant-btn-text ant-btn-sm ant-btn-icon-only ant-upload-list-item-card-actions-btn";return q.default.createElement("div",{className:J.default("ant-upload-list-item",`ant-upload-list-item-${f}`,"ant-upload-list-item-list-type-text",{handle:o})},q.default.createElement("div",{className:"ant-upload-list-item-info"},q.default.createElement("span",{className:"ant-upload-span"},q.default.createElement("div",{className:"ant-upload-text-icon"},l?l(e):q.default.createElement(g.LinkOutlined,null)),q.default.createElement("div",{className:"ant-upload-list-item-name"},S[r]?q.default.createElement(d.Input,{size:"small",autoFocus:!0,defaultValue:Hn(i),onBlur:t=>{const{value:l}=t.target;if(l!==Hn(i)){const t=Object.assign({},e,{name:`${l}.${qn(i)}`}),n=a.map((e=>e.uid!==r?e:t));null==v||v(t,n),null==b||b({file:t,fileList:n})}I(r,!1)}}):q.default.createElement("a",{rel:"noreferrer",target:"_blank",title:i,href:c,onClick:e=>{e.preventDefault(),s?T||I(r,!0):t.preview()}},i)),q.default.createElement("span",{className:"ant-upload-list-item-card-actions"},s&&!T&&q.default.createElement("button",{type:"button",className:p,onClick:()=>I(r)},S[r]?q.default.createElement(g.CheckOutlined,null):q.default.createElement(g.EditOutlined,null)),s&&q.default.createElement("button",{type:"button",className:J.default(p,"preview"),onClick:()=>t.preview()},q.default.createElement(g.EyeOutlined,null)),q.default.createElement("button",{type:"button",className:J.default(p,"download"),disabled:u,onClick:()=>t.download()},q.default.createElement(g.DownloadOutlined,null)),q.default.createElement("button",{type:"button",className:J.default(p,"delete"),disabled:T,onClick:()=>t.remove()},q.default.createElement(g.DeleteOutlined,null))))))})(t,r)}),q.default.createElement("span",{className:"inner",ref:C},n.children||c&&a.length?n.children:q.default.createElement(d.Button,{type:null!==(t=f.type)&&void 0!==t?t:"default",icon:null!==(l=f.icon)&&void 0!==l?l:q.default.createElement(g.UploadOutlined,null),disabled:T},f.text||x("qm.upload.text")),i&&!!a.length&&q.default.createElement(d.Button,{disabled:u,style:{marginLeft:8},onClick:e=>Ie(void 0,void 0,void 0,(function*(){if(e.stopPropagation(),"function"==typeof i)yield i(a);else for(const e of a)yield k(e)}))},x("qm.upload.batchDownload"))))};$n.displayName="QmUploadFile";const jn=e=>{const t=je({icon:q.default.createElement(g.DownloadOutlined,null),withCredentials:!1},e),{$size:n}=dt(t),{t:a}=ot(),[r,i]=q.default.useState(!1),o=He(t,["action","fileName","headers","withCredentials","params","beforeDownload","onSuccess","onError"]);return q.default.createElement(d.Button,tt({},o,{size:n,loading:r,onClick:()=>Ie(void 0,void 0,void 0,(function*(){var e;i(!0);try{const{action:e,fileName:n,headers:r,params:i,beforeDownload:o=Pe,onSuccess:s}=t,u=l.isString(e)?e:yield Ie(void 0,void 0,void 0,(function*(){const e=t.action;if(e.api)try{const t=yield e.api(e.params);if(200===t.code)return t.data}catch(e){}return""}));if(!u)return ft("Download","参数 `action` 有误!");if(!o(u))return;yield Mn(u,{fileName:n,headers:r,params:i}),yield Ae(100),null==s||s(),d.message.success(a("qm.download.success"))}catch(l){null===(e=t.onError)||void 0===e||e.call(t,l),d.message.error(a("qm.download.error"))}i(!1)}))}),t.children||a("qm.download.text"))};function Kn(e,t){const l=$.useRef(null),n=$.useRef(0);$.useEffect((()=>()=>{clearTimeout(l.current),l.current=null}),[]);return $.useCallback(((...l)=>{const a=Date.now();(!n.current||a-n.current>t)&&(e.apply(this,l),n.current=a)}),[e,t])}jn.displayName="QmDownload";const Vn=e=>{const{activeKey:t,labels:l,onTabClick:n}=e;return q.default.createElement(q.default.Fragment,null,l.map(((e,l)=>{const a={item:!0,actived:l===t};return q.default.createElement("div",{key:l,className:J.default(a),onClick:e=>n(l,e)},q.default.createElement("span",null,e))})))},zn=e=>{const{label:t,showDivider:l,className:n,style:a}=e,r={[gt("anchor-item")]:!0};return q.default.createElement("div",{className:J.default(r,n),style:a},l&&q.default.createElement(vt,{label:t,style:{marginBottom:10}}),e.children)};zn.displayName="AnchorItem";const Wn=q.default.forwardRef(((e,t)=>{const{labelList:l=[],defaultActiveIndex:n,labelWidth:a,tabPosition:r="left",onTabClick:i,className:o,style:s}=e,{$size:d}=dt(e),u=q.default.useRef(null),c=q.default.useRef(),f=q.default.useRef("ready"),p=q.default.useRef(0),[m,h]=q.default.useState(n||0),g=q.default.useMemo((()=>!!(null==l?void 0:l.length)),[l]);q.default.useEffect((()=>{v();const e=ae.default(u.current,"scroll",x);return()=>{e.remove()}}),[]);const v=()=>{m>0&&(u.current.scrollTop=ln(b(m),u.current))},y=e=>{const t=Math.abs(e),n=(g?l.map((e=>document.getElementById(e.id))):Array.from((null===(a=u.current)||void 0===a?void 0:a.children)||[])).map((e=>ln(e,u.current)));var a;let r=-1;for(let e=0;e<n.length;e++){const l=n[e],a=n[e+1]||1e4;t>=l-1&&t<a&&(r=e)}return r},b=e=>g?document.getElementById(l[e].id):u.current.children[e],x=Kn((e=>{if("ready"!==f.current)return;const t=y(e.target.scrollTop);-1!==t&&h(t)}),60),E=e=>{const t=b(e);t&&(h(e),f.current="stop",c.current&&clearTimeout(c.current),re.default(t,{block:"start",behavior:"smooth",boundary:u.current}),c.current=setTimeout((()=>f.current="ready"),500))};q.default.useImperativeHandle(t,(()=>({SCROLL_TO_ITEM:e=>{e=(e=e<0?0:e)>p.current?p.current:e,E(e)}})));const C=gt("anchor"),w={[C]:!0,[`${C}-left`]:"left"===r,[`${C}-top`]:"top"===r,[`${C}--lg`]:"large"===d,[`${C}--sm`]:"small"===d},S=[];q.default.Children.map(e.children,(e=>{var t;Re(e)&&!ke(e)&&"AnchorItem"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&S.push(e)}));const N=g?l.map((e=>e.label)):S.map((e=>e.props.label)),T=g?l.map((e=>e.id)):S.map(((e,t)=>e.props["data-id"]||t.toString()));return p.current=N.length,q.default.createElement("div",{className:J.default(w,o),style:s},q.default.createElement("div",{className:J.default("anchor-nav"),style:{width:a?$e(a):""}},q.default.createElement(Vn,{activeKey:m,labels:N,onTabClick:(e,t)=>{E(e),null==i||i({label:N[e],id:T[e]},t)}})),q.default.createElement("div",{ref:u,className:J.default("anchor-container")},g?e.children:S))}));Wn.displayName="QmAnchor",Wn.Item=zn;const Bn=e=>q.default.createElement(d.Tabs.TabPane,e,e.children);Bn.displayName="TabPane";const Un=e=>{const t=je({tabPosition:"top"},e),{items:l,tabPosition:n,tabBarGutter:a,className:r,authConfig:i}=t,{$size:o}=dt(t),s=gt("tabs"),u={[s]:!0,[`${s}--lg`]:"large"===o,[`${s}--sm`]:"small"===o},c=Object.assign(Object.assign({},He(t,["items","authConfig"])),{size:o,tabBarGutter:null!=a?a:["top","bottom"].includes(n)?30:0}),f=[];q.default.Children.map(t.children,(e=>{var t;Re(e)&&!ke(e)&&"TabPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&f.push(e)}));const p=l?[...l]:f.map((({key:e,props:t})=>({key:e,label:t.tab,disabled:t.disabled,closable:t.closable,forceRender:t.forceRender,children:t.children})));if(i){const{fieldList:e=[]}=i||{};for(let t=0;t<p.length;t++){const l=p[t],n=e.find((e=>e.dataIndex===l.key)),{visible:a=1,disabled:r}=n||{};a?r&&(l.disabled=!0):(p.splice(t,1),t--)}}return q.default.createElement(d.Tabs,tt({},c,{items:p,className:J.default(u,r)}))};Un.displayName="QmTabs",Un.TabPane=Bn;const Gn=q.default.forwardRef(((e,t)=>{var n;const a=je({width:"72%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,footer:null},e),{visible:r,open:i,className:o,loading:s,showHeader:u,showFullScreen:c,maskClosable:f,destroyOnClose:p,onClose:m,onClosed:h,onFullChange:v}=a,{global:y}=q.default.useContext(xe),{$size:b}=dt(a),x=q.default.useRef(null),E=q.default.useRef(null),C=q.default.useRef(!1),[w,S]=q.default.useState(!1),[N,T]=q.default.useState(!1),[I,O]=q.default.useState(!1);Yl((()=>{(null!=i?i:r)&&(!p&&C.current||l.isUndefined(s)&&T(!0))}),[null!=i?i:r]),Yl((()=>{E.current&&en(E.current,w?{width:"100%"}:{width:$e(a.width||"72%")})}),[w]);const R=()=>{E.current=an(x.current,"ant-drawer-content-wrapper"),S(!w),null==v||v(!w)};q.default.useImperativeHandle(t,(()=>({START_LOADING:()=>O(!0),STOP_LOADING:()=>O(!1)})));const k=gt("drawer"),L={[k]:!0,"no-header":!u,[`${k}--lg`]:"large"===b,[`${k}--sm`]:"small"===b};return q.default.createElement(d.Drawer,tt({},He(a,["visible","size","showFullScreen","loading","maskClosable","onClosed"]),{open:null!=i?i:r,maskClosable:null!==(n=null!=f?f:null==y?void 0:y.maskClosable)&&void 0!==n&&n,className:J.default(L,o),title:q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{ref:x,className:"text"},u&&a.title),c&&q.default.createElement("button",{type:"button",className:"full-screen",onClick:R},q.default.createElement(w?g.FullscreenExitOutlined:g.FullscreenOutlined))),footer:null,afterOpenChange:e=>{e?(C.current=!0,l.isUndefined(s)&&setTimeout((()=>T(!1)),100)):(S(!1),null==h||h())},onClose:m}),a.children,(s||I||N)&&q.default.createElement(mn,{spinning:!0,className:J.default("spinning")}))}));Gn.displayName="QmDrawer";const Yn="10vh";var Xn;!function(e){e[e.large=48]="large",e[e.middle=44]="middle",e[e.small=40]="small",e[e.none=0]="none"}(Xn||(Xn={}));const Qn=q.default.forwardRef(((e,t)=>{var n;const a=je({width:"60%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,draggable:!0,footer:null,style:{top:Yn}},e),{visible:r,open:i,width:o,height:s,className:u,loading:c,draggable:f,showHeader:p,showFullScreen:m,maskClosable:h,destroyOnClose:v,bodyStyle:y,onFullChange:b,onClose:x,onClosed:E}=a,{global:C}=q.default.useContext(xe),{$size:w}=dt(a),S=q.default.createRef(),N=q.default.useRef(!1),T=q.default.useMemo((()=>`calc(100vh - ${Yn} - ${Yn} - ${Xn[p?w:"none"]}px)`),[w,p]),[I,O]=q.default.useState(!1),[R,k]=q.default.useState(!1),[L,P]=q.default.useState(!1),[A,F]=q.default.useState(!0),[_,D]=q.default.useState({left:0,top:0,bottom:0,right:0}),[M,H]=q.default.useState();Yl((()=>{if(null!=i?i:r){if(!v&&N.current||l.isUndefined(c)&&k(!0),!v&&N.current)return;setTimeout((()=>{N.current=!0,l.isUndefined(c)&&k(!1)}),400)}}),[null!=i?i:r]),Yl((()=>{H(I?{x:0,y:0}:void 0)}),[I]);const $=e=>{const t=an(e.target,"ant-modal");if(!t)return;const l=t.querySelector(".ant-modal-body");I?(en(t,{width:$e(o||"60%"),height:"auto",top:Yn}),en(l,{height:s?$e(s):T,maxHeight:"auto"===s?T:""})):(en(t,{width:"100%",height:"100%",top:0,maxWidth:"100%"}),en(l,{height:`calc(100vh - ${Xn[p?w:"none"]}px)`,maxHeight:""})),O(!I),null==b||b(!I)};q.default.useImperativeHandle(t,(()=>({START_LOADING:()=>P(!0),STOP_LOADING:()=>P(!1)})));const j=gt("modal"),K={height:s?$e(s):T,maxHeight:"auto"===s?T:"",overflow:"auto"},V={[j]:!0,"no-header":!p,[`${j}--lg`]:"large"===w,[`${j}--sm`]:"small"===w};return q.default.createElement(d.Modal,tt({},He(a,["visible","loading","showFullScreen","maskClosable","onClose","onClosed"]),{open:null!=i?i:r,maskClosable:null!==(n=null!=h?h:null==C?void 0:C.maskClosable)&&void 0!==n&&n,className:J.default(V,u),title:q.default.createElement("div",{onMouseOver:()=>{A&&F(!1)},onMouseOut:()=>{F(!0)}},q.default.createElement("span",{className:"text"},p&&a.title),m&&q.default.createElement("button",{type:"button",className:"full-screen",onClick:$},q.default.createElement(I?g.FullscreenExitOutlined:g.FullscreenOutlined))),footer:null,bodyStyle:Object.assign({},K,y),onCancel:x,afterClose:()=>{null==E||E(),O(!1)},modalRender:e=>q.default.createElement(ie.default,{nodeRef:S,bounds:_,position:M,disabled:!f||A||I,onStart:(e,t)=>((e,t)=>{const{clientWidth:l,clientHeight:n}=window.document.documentElement,a=S.current.getBoundingClientRect();a&&D({left:-a.left+t.x,right:l-(a.right-t.x)-1,top:-a.top+t.y,bottom:n-(a.bottom-t.y)-1})})(0,t)},q.default.createElement("div",{ref:S},e))}),a.children,(c||L||R)&&q.default.createElement(mn,{spinning:!0,className:J.default("spinning")}))}));Qn.displayName="QmModal";const Zn=e.createContext(void 0);var Jn={string_format:function(e){return"string"!=typeof e?e:e.split(/[\s'\s"]/).join("")},stringify:function(e,t){return"string"==typeof e?"'"+e.trim().replace(/(')/g,"\\$1").replace(/\(/g,"├").replace(/\)/g,"┤").replace(/\s/g,t)+"'":e},array_format:function(e){let t="[";for(let l=0,n=(e=Array.isArray(e)?e:[e]).length;l<n;l++)t+="number"==typeof e[l]?e[l]:"'"+e[l]+"'",l<n-1&&(t+=",");return t+="]",t},operation_format:function(e){const t=e.split(" ");for(let e=0;e<t.length;e++)""==t[e]&&(t.splice(e,1),e--);if("("==t[0]?t.splice(0,1):"("==t[0][0]&&(t[0]=t[0].split(""),t[0].splice(0,1),t[0]=t[0].join("")),")"==t[t.length-1])t.splice(t.length-1,1);else if(")"==t[t.length-1][t[t.length-1].length-1]){const e=t.length-1;t[e]=t[e].split(""),t[e].splice(t[e].length-1,1).join(""),t[e]=t[e].join("")}return t},find_replace:function(e,t,l){return e.split(t).join(l)},replace_symbols:function(e){return e=this.find_replace(e," AND "," && "),e=this.find_replace(e," and "," && "),e=this.find_replace(e," OR "," || "),e=this.find_replace(e," or "," || "),e=this.find_replace(e," <> "," != ")}};const ea=["==","<",">","<=",">=","!=","like","nlike","likes","in","nin","^=","=$","nil","nnil"];var ta=function(e){let t=0;const l=e.length;for(let n=0;n<l;n++){const l=e.charAt(n);"("===l&&t++,")"===l&&t--}return 0===t},la=function(e,t){let l="";for(let t=0;t<e.length;t++)"("==e[t]||")"==e[t]?l+=" "+e[t]+" ":l+=e[t];const n=l.split(" ").filter((e=>""!==e));for(let e=0;e<n.length;e++)ea.includes(n[e])&&("this"!=n[e-1]?n[e-1]=t+"."+n[e-1]:n[e-1]=t),ea.includes(n[e])&&(n.splice(e-1,3,`__query__(${n[e-1]}, '${n[e]}', ${n[e+1]})`),e-=2);return e=n.join(" ")};const na=/(\^|\.|\[|\]|\$|\(|\)|\||\*|\+|\?|\{|\}|\\)/g,aa=["string","number","boolean","symbol"],ra=e=>aa.includes(typeof e),ia=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}:\d{2})?$/.test(e),oa=e=>new RegExp(e.replace(/├/g,"(").replace(/┤/g,")").replace(new RegExp(Ka,"g")," ").toString().replace(na,"\\$1"),"i"),sa=(e,t,l)=>{e=null!=e?e:"";let n=!0;switch(t){case"like":n=null!==e.toString().match(oa(l));break;case"nlike":n=null===e.toString().match(oa(l));break;case"likes":n=l.split(/,|,/).some((t=>sa(e,"like",t)));break;case"in":ra(l)&&(l=[l]),Array.isArray(l)&&(n=Array.isArray(e)?e.every((e=>l.includes(e))):l.includes(e));break;case"nin":ra(l)&&(l=[l]),Array.isArray(l)&&(n=!(Array.isArray(e)?e.some((e=>l.includes(e))):l.includes(e)));break;case"^=":n=e.toString().startsWith(l);break;case"=$":n=e.toString().endsWith(l);break;case"nil":n=""===e||null==e;break;case"nnil":n=!sa(e,"nil",null);break;case"!=":case"<>":n=(ia(e)?e.slice(0,10):e)!=l;break;case"<":n=(ia(e)?e.slice(0,10):e)<l;break;case"<=":n=(ia(e)?e.slice(0,10):e)<=l;break;case">":n=(ia(e)?e.slice(0,10):e)>l;break;case">=":n=(ia(e)?e.slice(0,10):e)>=l;break;default:n=(ia(e)?e.slice(0,10):e)==l}return n};window.__query__=(...e)=>sa(e[0],e[1],e[2]);const da=Jn.stringify,ua=Jn.array_format,ca=ta,fa=(e,t,l)=>{if(!t)return[...e];let n=[];t=Jn.replace_symbols(t);try{if(l){const l=new Function("record",`return ${la(t,"record")};`);n=Ga(e,(e=>l(e)))}else{const l=new Function("array","i",`return ${la(t,"array[i]")};`);for(let t=0,a=e.length;t<a;t++)l(e,t)&&n.push(e[t])}}catch(t){ft("Table","组件 `initialFilter` 参数有误!"),n=e}return n},pa=e=>{const t=[];return e.forEach((e=>{e.children?t.push(...pa(e.children)):t.push(e)})),t},ma=e=>e.filter((e=>(e.children&&(e.children=ma(e.children)),!e.hidden&&!e.noAuth))),ha=e=>e.map((e=>{const t={dataIndex:e.dataIndex};return Array.isArray(e.children)&&(t.children=ha(e.children)),void 0!==e.hidden&&(t.hidden=e.hidden),void 0!==e.fixed&&(t.fixed=e.fixed),void 0!==e.width&&(t.width=e.width),void 0!==e.renderWidth&&(t.renderWidth=e.renderWidth),t})),ga=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...ga(e.children))})),t},va=(e,t)=>e.map((e=>(e.children&&(e.children=va(e.children,t)),null==t||t(e),e))),ya=(e,t)=>{for(const l of e){if(l.dataIndex===t)return l;if(l.children){const e=ya(l.children,t);if(e)return e}}return null},ba=e=>{const t=e.children;return t?t[0].children?ba(t[0]):t[0]:e},xa=e=>{const t=e.children;return t?t[t.length-1].children?xa(t[t.length-1]):t[t.length-1]:e},Ea=(e,t)=>e.filter((e=>!t.includes(e.dataIndex))),Ca=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...Ca(e.children))})),t},wa=(e,t)=>{const l=[];return e.forEach((e=>{e.children&&l.push(...wa(e.children,t)),Array.isArray(e.children)&&e.children.length&&l.push(t(e))})),l},Sa=(e,t)=>{const l=[];for(let n=0;n<e.length;n++)Array.isArray(e[n].children)&&l.push(...Sa(e[n].children,t)),l.push(t(e[n]));return l},Na=e=>{let t=1;const l=(e,n)=>{var a;if(n&&(e.level=n.level+1,t<e.level&&(t=e.level)),e.children){let t=0;e.children.forEach((n=>{e.fixed?n.fixed=e.fixed:delete n.fixed,l(n,e),t+=n.colSpan})),e.colSpan=t}else e.colSpan=null!==(a=e.colSpan)&&void 0!==a?a:1};e.forEach((e=>{e.level=1,l(e,null)}));const n=[];for(let e=0;e<t;e++)n.push([]);return ga(e).forEach((e=>{e.children?e.rowSpan=1:e.rowSpan=t-e.level+1,n[e.level-1].push(e)})),n},Ta=e=>Object.assign(e,{__prevent__:!0}),Ia=e=>e.__prevent__,Oa=e=>{delete e.__prevent__},Ra=(e,t,l={left:0,top:0})=>{if(e){const n=e.parentNode;if(l.top+=e.offsetTop,l.left+=e.offsetLeft,n&&n!==document.documentElement&&n!==document.body&&(l.top-=n.scrollTop,l.left-=n.scrollLeft),(!t||e!==t&&e.offsetParent!==t)&&e.offsetParent)return Ra(e.offsetParent,t,l)}return l},ka=e=>"number"==typeof e?e:"string"==typeof e?/^\d+(?:px)?$/.test(e)?Number.parseInt(e,10):e:null,La=(e,t)=>l.transform(e,((e,n,a)=>{l.isEqual(n,t[a])||(e[a]=l.isPlainObject(n)&&l.isPlainObject(t[a])?La(n,t[a]):n)})),Pa=(e,t)=>{var n;return null!==(n=l.get(e,t))&&void 0!==n?n:""},Aa=(e,t,n,a)=>{a>=0&&null!=n&&(n=Number(n).toFixed(a)),l.set(e,t,null!=n?n:"")},Fa=(e,t)=>{if(!t.includes("|"))return Pa(e,t);const l=[];return t.split("|").forEach((t=>{t&&l.push(Pa(e,t))})),l.every((e=>!e))?"":l.join(" | ")},_a=e=>/^-?\d+(\.\d+)?$/.test(e.toString()),Da=e=>{const t=(e=e.toString()).split("."),l="-"===t[0].charAt(0)?"-":"";let n=l?t[0].slice(1):t[0],a="";for(;n.length>3;)a=`,${n.slice(-3)}${a}`,n=n.slice(0,n.length-3);return n&&(a=n+a),`${l}${a}${t[1]?`.${t[1]}`:""}`},Ma=(e,t)=>{const l=e.toString();if(!_a(l)||0===t)return e;const n=Number.parseFloat(l).toString(),a=n.indexOf(".");if(-1===a)return n+"."+"0".repeat(t);const r=Math.max(0,t-(n.length-a-1));return n+"0".repeat(r)},Ha=(e,t)=>e?j.default(e,t):null,qa=(e,t)=>e?j.default(e).format(t):"",$a=(e="")=>{let t=(new Date).getTime();return e+"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const l=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?l:3&l|8).toString(16)}))},ja=e=>(e=>{const t=[];return function e(l){null!=l&&"boolean"!=typeof l&&("string"!=typeof l&&"number"!=typeof l?Array.isArray(l)?l.forEach(e):q.default.isValidElement(l)&&e(l.props.children):t.push(l))}(e),t})(e).join(""),Ka="",Va=(e,t=!1)=>{let l="";if(Array.isArray(e)){let n=0;for(let a=0,r=e.length;a<r;a++){const r=e[a];if(!r.fieldName)continue;const i=Array.isArray(r.condition)?ua(r.condition):da(r.condition,Ka);l+=`${r.bracketLeft} ${t?`${r.fieldName}|${r.fieldType}`:r.fieldName} ${r.expression} ${i} ${r.bracketRight} ${r.logic} `,n=r.logic.length}l=l.slice(0,-1*n-2)}else{const n=5;for(const n in e){const[a,r]=n.includes("|")?n.split("|"):[n,""],i=e[n];for(const e in i){l+=`${t?`${a}|${r}`:a} ${e} ${Array.isArray(i[e])?ua(i[e]):da(i[e],Ka)} and `}}l=l.slice(0,-1*n)}return l.replace(/\s+/g," ").trim()},za=(e=[],t=[])=>{const l={};return e.forEach((e=>{const n=JSON.stringify((e=>{const l=[];return t.forEach((t=>l.push(Pa(e,t)))),l})(e));l[n]=l[n]||[],l[n].push(e)})),Object.keys(l).map((e=>l[e]))},Wa=(e,t)=>{for(let l=0;l<e.length;l++){if(e[l].dataIndex===t)return[e[l]];if(Array.isArray(e[l].children)){const n=Wa(e[l].children,t);if(n)return[e[l],n].flat()}}},Ba=(e,t)=>{for(const l of e){if(Array.isArray(l.children)){const e=Ba(l.children,t);if(e)return e}if(t(l))return l}return null},Ua=(e,t)=>{for(let l=0;l<e.length;l++){if(e[l]._rowKey===t)return[t];if(Array.isArray(e[l].children)){const n=Ua(e[l].children,t);if(n)return[e[l]._rowKey,n].flat()}}},Ga=(e,t)=>e.reduce(((e,l)=>{const n=Object.assign({},l);return Array.isArray(l.children)&&(n.children=Ga(l.children,t)),(t(n)||n.children&&n.children.length>0)&&e.push(n),e}),[]),Ya=e=>e.map((e=>(delete e.chosen,delete e.selected,e))),Xa=(e,t,l=!1)=>{const n=new Set;return function e(t,a,r=1){if(n.has(t))return!1;if(t===a)return!0;if(l&&r>1)return!1;n.add(t);const i=r+1;if(Array.isArray(t)){if(!Array.isArray(a)||t.length!==a.length)return!1;for(let l=0;l<t.length;l++)if(!e(t[l],a[l],i))return!1;return!0}if(t&&a&&"object"==typeof t&&"object"==typeof a){const l=Object.keys(t);return l.length===Object.keys(a).length&&l.every((l=>e(t[l],a[l],i)))}return!1}(e,t)},Qa=(e,t)=>e===t,Za=e=>["nil","nnil"].includes(e);function Ja(e,t){for(const l in t){const n=t[l],a=Pa(e,l);if(n)if(Array.isArray(a)){if(!a.some((e=>n.includes(e))))return!1}else if(!n.includes(a))return!1}return!0}const er=(e,t,l)=>Object.keys(t).length&&e.length?l?Ga(e,(e=>Ja(e,t))):e.filter((e=>Ja(e,t))):e,tr=e=>["","small","middle","large"].includes(e),lr=80,nr="1",ar="0",rr=400,ir=["RANGE_INPUT","RANGE_INPUT_NUMBER","RANGE_SEARCH_HELPER","MULTIPLE_CHECKBOX","MULTIPLE_SELECT","RANGE_DATE","RANGE_TIME","MULTIPLE_TREE_SELECT","MULTIPLE_SEARCH_HELPER","MULTIPLE_TREE_TABLE_HELPER","MULTIPLE_CASCADER","UPLOAD_IMG","UPLOAD_FILE"],or={bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}}};var sr,dr,ur;!function(e){e.date="date",e.datetime="date",e.exactdate="date",e.week="week",e.month="month",e.quarter="quarter",e.year="year"}(sr||(sr={})),function(e){e.date="YYYY-MM-DD HH:mm:ss",e.datetime="YYYY-MM-DD HH:mm:ss",e.exactdate="YYYY-MM-DD",e.week="YYYY-wo",e.month="YYYY-MM",e.quarter="YYYY-[Q]Q",e.year="YYYY"}(dr||(dr={})),function(e){e.hour="HH",e["hour-minute"]="HH:mm",e["hour-minute-second"]="HH:mm:ss"}(ur||(ur={}));const cr={items:se.default.arrayOf(se.default.shape({type:se.default.string.isRequired,fieldName:se.default.string.isRequired})),initialValues:se.default.object,initialExtras:se.default.object,layout:se.default.oneOf(["horizontal","vertical"]),size:(e,t,l)=>{if(!tr(e[t]||""))return ct("Form","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},cols:se.default.number,className:se.default.string,style:se.default.object,compactMode:se.default.bool,labelWidth:se.default.oneOfType([se.default.number,se.default.string]),labelAlign:se.default.oneOf(["left","right"]),labelWrap:se.default.bool,formType:se.default.oneOf(["default","search","onlyShow"]),disabled:se.default.bool,uniqueKey:se.default.string,defaultRows:se.default.number,defaultExpand:se.default.bool,searchButtonCols:se.default.number,scrollToFirstError:se.default.bool,authConfig:se.default.object,isAutoFocus:se.default.bool,isCollapse:se.default.bool,isFieldsDefine:se.default.bool,isSearchBtn:se.default.bool,isSubmitBtn:se.default.bool,fieldsChange:se.default.func,onValuesChange:se.default.func,onFieldsChange:se.default.func,onFinish:se.default.func,onFinishFailed:se.default.func,onReset:se.default.func,onCollapse:se.default.func},fr={layout:"horizontal",labelWidth:lr,labelAlign:"right",formType:"default",initialValues:{},initialExtras:{},defaultRows:1,isAutoFocus:!0,isCollapse:!0,isSearchBtn:!0,onValuesChange:Le,onFieldsChange:Le,onFinish:Le,onFinishFailed:Le,onReset:Le,onCollapse:Le},pr=(e,t)=>{if(!e)return null;if(t===dr.week){const t=e.match(/^(\d{4})-(\d+)/);return t?j.default().year(Number(t[1])).week(Number(t[2])):null}if(t===dr.quarter){const t=e.match(/^(\d{4})-Q(\d)/);return t?j.default().year(Number(t[1])).quarter(Number(t[2])):null}return j.default(e,t)},mr=(e,t)=>e?j.default(e).format(t):"",hr=e=>""===e||null==e,gr=(e,t)=>{var l;if(!e)return"";if(!t.includes("|"))return e[t];const n=t.split("|");let a="";for(let t=0,r=n.length;t<r;t++){a+=(null!==(l=e[n[t].trim()])&&void 0!==l?l:"")+(t===r-1?"":" | ")}return a},vr=(e,t,l)=>{for(const n in l)if(Object.keys(t).includes(n)&&t[n]!==l[n])if(t[n].includes("|")){const a=t[n].split("|"),r=l[n].split("|");a.forEach(((t,l)=>e[t]=e[r[l]]))}else e[t[n]]=e[l[n]]},yr=(e,t,l)=>{for(const n in l)if(Object.keys(t).includes(n)&&t[n]!==l[n])if(t[n].includes("|")){const a=t[n].split("|"),r=l[n].split("|");a.forEach(((t,l)=>e[t]=e[r[l]]))}else e[t[n]]=e[l[n]]},br=(e,t,n)=>e.map((e=>{const a={value:e[t],text:e[n]};return e.disabled&&(a.disabled=!0),l.isUndefined(e.isLeaf)||(a.isLeaf=!!e.isLeaf),l.isUndefined(e.selectable)||(a.selectable=!!e.selectable),Array.isArray(e.children)&&(a.children=br(e.children,t,n)),a})),xr=(e,t)=>{for(const l of e){if(l.value===t)return l;if(Array.isArray(l.children)){const e=xr(l.children,t);if(e)return e}}return null},Er=(e,t,l=0)=>{const n=[];return e.forEach((e=>{e.value==t.split(",")[l]&&n.push(e),Array.isArray(e.children)&&n.push(...Er(e.children,t,l+1))})),n},Cr=e=>Re(e)||"string"==typeof e,wr=(e,t,l,n)=>{var a;const r={};return r.filters=(null===(a=e.filters)||void 0===a?void 0:a.filter((e=>"1"===e.isQuery)).map((e=>{const t={type:e.type,label:e.label,fieldName:e.fieldName,options:{}};return Array.isArray(e.dicData)&&(t.options.itemList=e.dicData),t})))||[],r.table={columns:e.columns||[],rowKey:e.valueName},r.fieldsDefine={valueKey:e.valueKey||e.valueName},r.fieldAliasMap={[n?"textKey":t]:e.displayName[0],[n?"valueKey":e.valueKey||e.valueName]:e.valueName},e.tableSetting&&(r.table.fetch={api:l(e.tableSetting.api),dataKey:e.tableSetting.dataKey}),e.echoSetting&&(r.echoRequest={fetchApi:l(e.echoSetting.api),formatter:t=>{var l;return Object.assign({},t,{[e.echoSetting.paramKey]:null!==(l=t.key)&&void 0!==l?l:t.keys})},dataKey:e.echoSetting.dataKey},e.echoSetting.displayKey&&(r.echoRequest.fieldAliasMap={[n?"textKey":t]:e.echoSetting.displayKey[0]})),e.treeSetting&&(r.tree={fetch:{api:l(e.treeSetting.api),dataKey:e.treeSetting.dataKey,valueKey:e.treeSetting.valueKey,textKey:e.treeSetting.textKey},tableParamsMap:()=>{var t;const l={};return null===(t=e.treeSetting.relativeTable)||void 0===t||t.forEach((e=>l[e.tableField]=e.treeField)),l}}),e.emmediateSetting&&(r.columns=e.emmediateSetting.columns,r.request={fetchApi:l(e.emmediateSetting.api),dataKey:e.emmediateSetting.dataKey}),r};var Sr={PINYINS:["A","AI","AN","ANG","AO","BA","BAI","BAN","BANG","BAO","BEI","BEN","BENG","BI","BIAN","BIAO","BIE","BIN","BING","BO","BU","CA","CAI","CAN","CANG","CAO","CE","CEN","CENG","CHA","CHAI","CHAN","CHANG","CHAO","CHE","CHEN","CHENG","CHI","CHONG","CHOU","CHU","CHUA","CHUAI","CHUAN","CHUANG","CHUI","CHUN","CHUO","CI","CONG","COU","CU","CUAN","CUI","CUN","CUO","DA","DAI","DAN","DANG","DAO","DE","DEN","DENG","DI","DIAN","DIAO","DIE","DING","DIU","DONG","DOU","DU","DUAN","DUI","DUN","DUO","E","EI","EN","ENG","ER","FA","FAN","FANG","FEI","FEN","FENG","FIAO","FO","FOU","FU","GA","GAI","GAN","GANG","GAO","GE","GEI","GEN","GENG","GONG","GOU","GU","GUA","GUAI","GUAN","GUANG","GUI","GUN","GUO","HA","HAI","HAN","HANG","HAO","HE","HEI","HEN","HENG","HM","HONG","HOU","HU","HUA","HUAI","HUAN","HUANG","HUI","HUN","HUO","JI","JIA","JIAN","JIANG","JIAO","JIE","JIN","JING","JIONG","JIU","JU","JUAN","JUE","JUN","KA","KAI","KAN","KANG","KAO","KE","KEN","KENG","KONG","KOU","KU","KUA","KUAI","KUAN","KUANG","KUI","KUN","KUO","LA","LAI","LAN","LANG","LAO","LE","LEI","LENG","LI","LIA","LIAN","LIANG","LIAO","LIE","LIN","LING","LIU","LO","LONG","LOU","LU","LV","LUAN","LVE","LUN","LUO","M","MA","MAI","MAN","MANG","MAO","ME","MEI","MEN","MENG","MI","MIAN","MIAO","MIE","MIN","MING","MIU","MO","MOU","MU","N","NA","NAI","NAN","NANG","NAO","NE","NEI","NEN","NENG","NI","NIAN","NIANG","NIAO","NIE","NIN","NING","NIU","NONG","NOU","NU","NV","NUAN","NVE","NUN","NUO","O","OU","PA","PAI","PAN","PANG","PAO","PEI","PEN","PENG","PI","PIAN","PIAO","PIE","PIN","PING","PO","POU","PU","QI","QIA","QIAN","QIANG","QIAO","QIE","QIN","QING","QIONG","QIU","QU","QUAN","QUE","QUN","RAN","RANG","RAO","RE","REN","RENG","RI","RONG","ROU","RU","RUA","RUAN","RUI","RUN","RUO","SA","SAI","SAN","SANG","SAO","SE","SEN","SENG","SHA","SHAI","SHAN","SHANG","SHAO","SHE","SHEN","SHENG","SHI","SHOU","SHU","SHUA","SHUAI","SHUAN","SHUANG","SHUI","SHUN","SHUO","SI","SONG","SOU","SU","SUAN","SUI","SUN","SUO","TA","TAI","TAN","TANG","TAO","TE","TENG","TI","TIAN","TIAO","TIE","TING","TONG","TOU","TU","TUAN","TUI","TUN","TUO","WA","WAI","WAN","WANG","WEI","WEN","WENG","WO","WU","XI","XIA","XIAN","XIANG","XIAO","XIE","XIN","XING","XIONG","XIU","XU","XUAN","XUE","XUN","YA","YAN","YANG","YAO","YE","YI","YIN","YING","YO","YONG","YOU","YU","YUAN","YUE","YUN","ZA","ZAI","ZAN","ZANG","ZAO","ZE","ZEI","ZEN","ZENG","ZHA","ZHAI","ZHAN","ZHANG","ZHAO","ZHE","ZHEN","ZHENG","ZHI","ZHONG","ZHOU","ZHU","ZHUA","ZHUAI","ZHUAN","ZHUANG","ZHUI","ZHUN","ZHUO","ZI","ZONG","ZOU","ZU","ZUAN","ZUI","ZUN","ZUO",""],UNIHANS:["阿","哎","安","肮","凹","八","挀","扳","邦","勹","陂","奔","伻","屄","边","灬","憋","汃","冫","癶","峬","嚓","偲","参","仓","撡","冊","嵾","曽","叉","芆","辿","伥","抄","车","抻","阷","吃","充","抽","出","欻","揣","巛","刅","吹","旾","逴","呲","匆","凑","粗","汆","崔","邨","搓","咑","呆","丹","当","刀","嘚","扥","灯","氐","甸","刁","爹","丁","丟","东","吺","厾","耑","垖","吨","多","妸","诶","奀","鞥","儿","发","帆","匚","飞","分","丰","覅","仏","紑","夫","旮","侅","甘","冈","皋","戈","给","根","刯","工","勾","估","瓜","乖","关","光","归","丨","呙","哈","咍","佄","夯","茠","诃","黒","拫","亨","噷","叿","齁","乎","花","怀","欢","巟","灰","昏","吙","丌","加","戋","江","艽","阶","巾","坕","冂","丩","凥","姢","噘","军","咔","开","刊","忼","尻","匼","肎","劥","空","抠","扝","夸","蒯","宽","匡","亏","坤","扩","垃","来","兰","啷","捞","肋","勒","崚","哩","俩","奁","良","撩","毟","拎","伶","溜","囖","龙","瞜","噜","驴","娈","掠","抡","罗","呣","妈","埋","嫚","牤","猫","么","呅","门","甿","咪","宀","喵","乜","民","名","谬","摸","哞","毪","嗯","拏","腉","囡","囔","孬","疒","娞","恁","能","妮","拈","娘","鸟","捏","囜","宁","妞","农","羺","奴","女","奻","疟","黁","挪","喔","讴","妑","拍","眅","乓","抛","呸","喷","匉","丕","囨","剽","氕","姘","乒","钋","剖","仆","七","掐","千","呛","悄","癿","亲","靑","卭","丘","区","峑","缺","夋","呥","穣","娆","惹","人","扔","日","茸","厹","邚","挼","堧","婑","瞤","捼","仨","毢","三","桒","掻","閪","森","僧","杀","筛","山","伤","弰","奢","申","升","尸","収","书","刷","衰","闩","双","脽","吮","说","厶","忪","捜","苏","狻","夊","孙","唆","他","囼","坍","汤","夲","忑","熥","剔","天","旫","帖","厅","囲","偷","凸","湍","推","吞","乇","穵","歪","弯","尣","危","昷","翁","挝","乌","夕","虲","仙","乡","灱","些","心","星","凶","休","吁","吅","削","坃","丫","恹","央","幺","倻","一","囙","应","哟","佣","优","扜","囦","曰","晕","帀","災","兂","匨","傮","则","贼","怎","増","扎","捚","沾","张","佋","蜇","贞","争","之","中","州","朱","抓","拽","专","妆","隹","宒","卓","乲","宗","邹","租","钻","厜","尊","昨","兙"],EXCEPTIONS:{"曾":"ZENG","沈":"SHEN","嗲":"DIA","碡":"ZHOU","聒":"GUO","炔":"QUE","蚵":"KE","砉":"HUA","嬤":"MO","嬷":"MO","蹒":"PAN","蹊":"XI","丬":"PAN","霰":"XIAN","莘":"XIN","豉":"CHI","饧":"XING","筠":"JUN","长":"CHANG","帧":"ZHEN","峙":"SHI","郍":"NA","芎":"XIONG","谁":"SHUI"}};const Nr="阿",Tr="鿿",Ir=1,Or=2,Rr=3;let kr,Lr=null;function Pr(e){return e||null===Lr?("object"==typeof Intl&&Intl.Collator?(kr=new Intl.Collator(["zh-Hans-CN","zh-CN"]),Lr=1===Intl.Collator.supportedLocalesOf(["zh-CN"]).length):Lr=!1,Lr):Lr}function Ar(e){const t=Sr.UNIHANS,l=Sr.PINYINS,n=Sr.EXCEPTIONS,a={source:e};if(e in n)return a.type=Or,a.target=n[e],a;let r,i=-1;if(e.charCodeAt(0)<256)return a.type=Ir,a.target=e,a;if(r=kr.compare(e,Nr),r<0)return a.type=Rr,a.target=e,a;if(0===r)a.type=Or,i=0;else{if(r=kr.compare(e,Tr),r>0)return a.type=Rr,a.target=e,a;0===r&&(a.type=Or,i=t.length-1)}if(a.type=Or,i<0){let l=0,n=t.length-1;for(;l<=n;){i=~~((l+n)/2);const a=t[i];if(r=kr.compare(e,a),0===r)break;r>0?l=i+1:n=i-1}}return r<0&&i--,a.target=l[i],a.target||(a.type=Rr,a.target=a.source),a}function Fr(e){return"string"==typeof e&&Pr()?e.split("").map((e=>Ar(e))):e}var _r={isSupported:Pr,parse:Fr,patchDict:function(e){e&&("function"==typeof e&&(e=[e]),e.forEach&&e.forEach((e=>{"function"==typeof e&&e(Sr)})))},genToken:Ar,convertToPinyin:(e,t,l)=>Fr(e).map((e=>t&&e.type===Or?e.target.toLowerCase():e.target)).join(l||"")};var Dr={patcher:function(e){e.EXCEPTIONS={"嗲":"DIA","碡":"ZHOU","聒":"GUO","炔":"QUE","蚵":"KE","砉":"HUA","嬷":"MO","蹊":"XI","丬":"PAN","霰":"XIAN","豉":"CHI","饧":"XING","帧":"ZHEN","芎":"XIONG","谁":"SHUI","钶":"KE"},e.UNIHANS[91]="伕",e.UNIHANS[347]="仚",e.UNIHANS[393]="诌",e.UNIHANS[39]="婤",e.UNIHANS[50]="腠",e.UNIHANS[369]="攸",e.UNIHANS[123]="乯",e.UNIHANS[171]="刕",e.UNIHANS[102]="佝",e.UNIHANS[126]="犿",e.UNIHANS[176]="列",e.UNIHANS[178]="刢",e.UNIHANS[252]="娝",e.UNIHANS[330]="偸"},shouldPatch:function(e){return"function"==typeof e&&("FOU"===e("伕").target&&"XIA"===e("仚").target&&"ZHONG"===e("诌").target&&"CHONG"===e("婤").target&&"CONG"===e("腠").target&&"YONG"===e("攸").target&&"HOU"===e("乯").target&&"LENG"===e("刕").target&&"GONG"===e("佝").target&&"HUAI"===e("犿").target&&"LIAO"===e("列").target&&"LIN"===e("刢").target&&"E"===e("钶").target)}};_r.isSupported()&&Dr.shouldPatch(_r.genToken)&&_r.patchDict(Dr);const Mr=e=>{const{value:t,bordered:l}=e;return q.default.createElement(d.Input,{value:t,title:t,bordered:l,readOnly:!0})};Mr.displayName="FormItemView";const Hr=q.default.forwardRef(((e,t)=>{const{text:n="",tag:a="div",enabled:r=!0,copy:i,fetch:o,className:s,style:d,title:u}=e,{global:c}=q.default.useContext(xe),f=gt("translate"),p=n?n.trim():"",m=r&&!!p,h=o||(null==c?void 0:c.translateFetch);q.default.useMemo((()=>{(null==h?void 0:h.api)||ft("Translate","设置 `fetch` 参数,或通过 [ConfigProvider] 配置 `translateFetch` 全局参数")}),[h]);const{translate:g}=(e=>{const[t,n]=q.default.useState(new Map);return{translate:st((a=>Ie(void 0,void 0,void 0,(function*(){var r;if(!a||!e)return null;if(t.has(a))return t.get(a);try{const{params:t,dataKey:i,formatter:o=(e=>e),afterFetch:s}=e,d=yield e.api(o(Object.assign({text:a},t)));if(200===d.code){let e=l.isString(d.data)?d.data:null!==(r=l.get(d.data,i))&&void 0!==r?r:"";return e="function"==typeof s?yield s(e):e,n((t=>new Map(t).set(a,e))),e}return""}catch(e){return console.error("[Translate] 翻译失败:",e),null}}))))}})(h),[v,y,b,x]=(({prefixCls:e,text:t,enabled:l,translate:n})=>{const a=q.default.useRef(null),{t:r}=ot(),[i,o]=q.default.useState(!1),[s,d]=q.default.useState(null),[u,c]=q.default.useState(!1),[f,p]=q.default.useState(""),m={width:150,height:100,zIndex:9999};Yl((()=>{i&&t&&(c(!0),n(t).then((e=>{e&&p(e)})).finally((()=>{c(!1)}))),!t&&i&&v()}),[i,t]);const h=e=>{var t;const{width:l,height:n}=(null===(t=a.current)||void 0===t?void 0:t.getBoundingClientRect())||m,r=l,i=n,o=window.innerWidth,s=window.innerHeight;let u=e.clientX,c=e.clientY;u+r>o?u=Math.max(u-r-5,0):u+=10,c+i>s?c=Math.max(c-i-5,0):c+=10,d({x:u,y:c})},g=st((e=>{l&&e.ctrlKey&&(o(!0),Fe((()=>h(e))))})),v=()=>{i&&(o(!1),d(null))},y=st((e=>{l&&e.ctrlKey&&(i?h(e):(o(!0),Fe((()=>h(e)))))})),b={position:"fixed",top:(null==s?void 0:s.y)||0,left:(null==s?void 0:s.x)||0,zIndex:m.zIndex};return[q.default.createElement(ue.default,{open:i},q.default.createElement("div",{ref:a,className:J.default("ant-dropdown-menu",`${e}__tooltip`),style:b},q.default.createElement("div",{className:"label"},r("qm.translate.sourceText"),":"),q.default.createElement("div",{className:"text"},t),q.default.createElement("div",{className:"label"},r("qm.translate.targetText"),":"),q.default.createElement("div",{className:"text primary"},u?`${r("qm.translate.translating")}...`:f))),g,v,y]})({prefixCls:f,text:p,enabled:m,translate:g}),E=e.children||p;if(!E)return null;const C={[f]:!0,"help-cursor":m};return q.default.createElement(q.default.Fragment,null,q.default.createElement(a,{ref:t,className:J.default(C,s),style:d,title:u,onMouseEnter:y,onMouseLeave:b,onMouseMove:x},E),v)}));Hr.displayName="Translate";const{Option:qr}=d.Select,$r=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,items:n,multiple:a,loading:r,onChange:i,onValuesChange:o}=e,{t:s}=ot(),{fieldName:u,options:c={},style:f={},placeholder:p=s("qm.form.selectPlaceholder"),bordered:m=!0,allowClear:h=!0,translate:g,readOnly:v,disabled:y,onClear:b}=e.option,{itemList:x=[],filterable:E=!0,listHeight:C=rr,collapseTags:w,maxTagTextLength:S,dropdownStyle:N,openPyt:T=!0}=c,I=De(x)?n:x,O=e=>{var t;return(null===(t=I.find((t=>t.value===e)))||void 0===t?void 0:t.text)||(null==e?void 0:e.toString())||""},R=e=>a?(null==e?void 0:e.map((e=>O(e))).join(","))||"":O(e),k=t.isOnlyShow?q.default.createElement(Mr,{value:R(l),bordered:m}):q.default.createElement(d.Select,tt({value:l,mode:a?"multiple":void 0,popupClassName:`form-popper__${u}`,dropdownStyle:N,placeholder:p,style:f,loading:r,bordered:m,allowClear:h,disabled:y,showSearch:E,listHeight:C,maxTagCount:w?"responsive":void 0,maxTagTextLength:S},a?{title:R(l)}:null,{filterOption:(e,t)=>{var l;const n=(null===(l=null==t?void 0:t.children)||void 0===l?void 0:l.toString())||"",a=_r.parse(n).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(T?`${n}|${a}`:n).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{null==i||i(e),o(e,R(e),I)})(e)},onClear:b}),I.map((e=>q.default.createElement(qr,{key:e.value,value:e.value,disabled:e.disabled},e.text))));return g?q.default.createElement(Hr,{text:R(l)},k):k};class jr extends e.Component{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Ie(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:a={},dataKey:r,valueKey:i="value",textKey:o="text",callback:s}=t;if(n){this.setState({loading:!0});try{const t=yield n(a);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=l.get(t.data,r))&&void 0!==e?e:[],a=n.map((e=>({value:e[i],text:e[o]})));this.setState({itemList:a},(()=>null==s?void 0:s(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const a=null===(t=e.option.request)||void 0===t?void 0:t.params,r=null===(n=this.props.option.request)||void 0===n?void 0:n.params;l.isEqual(a,r)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t,loading:l}=this.state,{type:n,label:a,tooltip:r,fieldName:i,invisible:o,options:s={},labelWidth:u=e.props.labelWidth,className:c,extra:f,buttonAfter:p,validateTrigger:m,rules:h=[],onChange:g=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(a),className:J.default(c),tooltip:r,hidden:o,labelCol:{flex:e.verticalLayout?"initial":$e(u)},required:e.getFormItemRequired(h)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:i,noStyle:!0,rules:h,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(a)}},q.default.createElement($r,{option:this.props.option,items:t,loading:l,multiple:this.props.multiple,onValuesChange:(t,l,n)=>{g(t,l,n),e.setViewValue(i,l)}}))),p&&q.default.createElement(d.Col,null,e.renderFormItemButton(i,p)),f&&q.default.createElement(d.Col,{flex:$e(f.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:i},f)))))}}jr.contextType=Zn;const Kr=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{label:r,options:i={},style:o={},readOnly:s,disabled:u=t.isFormDisabled}=e.option,{labelToCheckbox:c,falseValue:f=ar,trueValue:p=nr}=i,{t:m}=ot(),h=e=>m(e===p?"am.form.trueText":"am.form.falseText");return q.default.createElement(d.Checkbox,{checked:l===p,style:o,disabled:u||t.isOnlyShow,onChange:e=>{const{checked:t}=e.target;(e=>{null==n||n(e),a(e,h(e))})(t?p:f)}},c?r:null)};class Vr extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option,{labelToCheckbox:m}=i;return q.default.createElement(d.Form.Item,{label:m?" ":e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Kr,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Vr.contextType=Zn;const zr=e=>{const{uniqueKey:t,items:n,fieldsChange:a}=e,{global:r}=q.default.useContext(xe),{$$form:i}=q.default.useContext(Zn),{$size:o}=dt(e),{t:s}=ot(),u=q.default.useRef(null),[c,f]=q.default.useState(!1),p=q.default.useMemo((()=>t?`form_${t}`:""),[t]);q.default.useLayoutEffect((()=>{v()}),[]);const m=()=>{if(!p)return;const e=JSON.parse(localStorage.getItem(p));var t;if(e||(t=p,Ie(void 0,void 0,void 0,(function*(){const e=null==r?void 0:r.getComponentConfigApi;if(e)try{const l=yield e({key:t});if(200===l.code)return l.data}catch(e){}}))).then((e=>{e?(localStorage.setItem(p,JSON.stringify(e)),v()):(null==r?void 0:r.getComponentConfigApi)&&h(n)})).catch((()=>{})),!e)return;return l.xor(e.map((e=>e.fieldName)),n.map((e=>e.fieldName))).length>0?n.map((t=>{const{fieldName:n}=t,a=e.find((e=>e.fieldName===n));return a?(l.isUndefined(a.hidden)||(t.hidden=a.hidden),t):t})):e.map((e=>{const t=n.find((t=>t.fieldName===e.fieldName));return Object.assign(Object.assign({},t),e)}))},h=e=>{if(!p)return;const t=e.map((e=>{const t={};return l.isUndefined(e.hidden)||(t.hidden=e.hidden),Object.assign({fieldName:e.fieldName},t)})),n=JSON.parse(localStorage.getItem(p));var a,i;l.isEqual(t,n)||(localStorage.setItem(p,JSON.stringify(t)),a=p,i=t,Ie(void 0,void 0,void 0,(function*(){const e=null==r?void 0:r.saveComponentConfigApi;if(e)try{yield e({[a]:i})}catch(e){}})))},v=()=>{const e=m();e&&y(e)},y=e=>{null==a||a([...e])},b=()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","fields-list")},q.default.createElement("div",{className:"reset"},q.default.createElement(pt,{type:"text",size:"small",onClick:()=>(e=>{const t=e.filter((e=>n.find((t=>t.fieldName===e.fieldName)))).map((e=>{const t=n.find((t=>t.fieldName===e.fieldName));return Object.assign({},t,{hidden:e.hidden})}));y(t),h(t)})(i.getOriginItems())},s("qm.table.columnFilter.reset"))),q.default.createElement(I.ReactSortable,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:n,setList:e=>{const t=e.map((e=>e.fieldName)),a=n.map((e=>e.fieldName));if(l.isEqual(t,a))return;i.setExpandHandle(!0);const r=Ya(e);y(r),h(r)}},n.map((e=>{var t;return q.default.createElement("li",{key:e.fieldName,className:"item",style:e.noAuth?{display:"none"}:void 0},q.default.createElement(d.Checkbox,{disabled:(null===(t=e.rules)||void 0===t?void 0:t.findIndex((e=>e.required)))>-1,checked:!e.hidden,onChange:t=>{const{checked:l}=t.target;e.hidden=!l,y(n),h(n)}}),q.default.createElement(g.HolderOutlined,{className:"handle",title:s("qm.form.draggable")}),q.default.createElement("span",{className:"title"},i.getFormItemLabel(e.label)))})))),x=gt("form-fields-filter"),E={[x]:!0,[`${x}--lg`]:"large"===o,[`${x}--sm`]:"small"===o};return q.default.createElement(d.Dropdown,{open:c,trigger:["click"],dropdownRender:()=>b(),overlayClassName:J.default(E),placement:"bottomRight",overlayStyle:{minWidth:160},getPopupContainer:()=>u.current,onOpenChange:e=>{f(e)}},q.default.createElement("a",{ref:u,style:{padding:"5px 0"}},q.default.createElement(g.UnorderedListOutlined,null)))};zr.displayName="FieldsFilter";const Wr=q.default.forwardRef(((e,t)=>{const{$$form:n}=q.default.useContext(Zn),{value:a,onChange:r,onValuesChange:i}=e,{t:o}=ot(),{options:s={},style:u={},placeholder:c=o("qm.form.inputPlaceholder"),bordered:f=!0,allowClear:p=!0,translate:m,readOnly:h,disabled:g,onFocus:v,onBlur:y,onEnter:b,onClear:x}=e.option,{prefix:E,suffix:C,password:w,maxLength:S,pattern:N,toUpper:T,toTrim:I,autoFocus:O,autoComplete:R,secretType:k}=s,L=k&&(h||g),P=q.default.useRef(),A=q.default.useRef(!1);q.default.useEffect((()=>{var e;const t=()=>null==x?void 0:x(),l=null===(e=P.current)||void 0===e?void 0:e.input.parentNode.querySelector("span[class*='clear-icon']");return p&&l&&l.addEventListener("click",t),()=>{null==l||l.removeEventListener("click",t)}}),[]);const F=e=>{null==r||r(e),i(e)},_=w?d.Input.Password:d.Input,D=L?((e="",t)=>(e=e.toString(),"finance"===t&&(e=(e=>e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","))(e)),"name"===t&&(e=e.replace(/^([\u4e00-\u9fa5]{1}).+$/,"$1**")),"phone"===t&&(e=e.replace(/^(\d{3}).+(\d{4})$/,"$1****$2")),"IDnumber"===t&&(e=e.replace(/^(\d{3}).+(\w{4})$/,"$1***********$2")),"bankNumber"===t&&(e=e.replace(/^(\d{4}).+(\w{3})$/,"$1************$2")),e))(a,k):a,M=n.isOnlyShow?q.default.createElement(Mr,{value:(e=>e&&w?new Array(e.length).fill("*").join(""):e)(D),bordered:f}):q.default.createElement(_,{ref:e=>{P.current=e,"function"==typeof t&&t(e)},value:D,autoComplete:w?"new-password":R,autoFocus:O,placeholder:c,style:u,title:w?"":D,prefix:E,suffix:C,maxLength:S,bordered:f,allowClear:p,readOnly:h,disabled:g,onFocus:e=>{null==v||v(e.target.value,e)},onBlur:t=>{var l;let n=null!==(l=t.target.value)&&void 0!==l?l:"";if(I){const e=n.trim();n!==e&&(n=e,F(n))}(t=>{const{onBlur:l}=e;null==l||l(t)})(n),null==y||y(n,t)},onKeyUp:e=>{var t;if(13===e.keyCode){const{value:l}=e.target;null==b||b(l,e),n.isFilterType&&(n.SUBMIT_FORM(),null===(t=P.current)||void 0===t||t.blur())}},onCompositionStart:()=>{A.current=!0},onCompositionEnd:()=>{A.current=!1},onChange:e=>{let t=e.target.value;l.isRegExp(N)&&(t=N.test(t)?t:null!=a?a:""),T&&!A.current&&(t=t.toUpperCase()),F(t)}});return m?q.default.createElement(Hr,{text:D,enabled:!w},M):M}));Wr.displayName="VInput";class Br extends e.Component{constructor(){super(...arguments),this.focus=()=>{const{type:e}=this.props.option;this[e].focus()}}render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,buttonAfter:c,validateTrigger:f,rules:p=[],onChange:m=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(p)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Wr,{ref:e=>this[t]=e,option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(a,t)}}))),c&&q.default.createElement(d.Col,null,e.renderFormItemButton(a,c)),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Br.contextType=Zn;const Ur=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l=[],onChange:n,onValuesChange:a}=e,{t:r}=ot(),{options:i={},placeholder:o=r("qm.form.rangeInputNumberPlaceholder"),bordered:s=!0,allowClear:u,readOnly:c,disabled:f}=e.option,{prefix:p,suffix:m,maxLength:h}=i,g=e=>{const t=e.every((e=>!e))?[]:e;null==n||n(t),a(t,v(t))},v=e=>e.join(" - ");return t.isOnlyShow?q.default.createElement(Mr,{value:v(l),bordered:s}):q.default.createElement(d.Input.Group,null,q.default.createElement(d.Input,{value:l[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:o[0],prefix:p,suffix:m,maxLength:h,allowClear:u,bordered:s,readOnly:c,disabled:f,onChange:e=>{const{value:t}=e.target;g([t,l[1]])}}),q.default.createElement(d.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:s,disabled:f,readOnly:!0}),q.default.createElement(d.Input,{value:l[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:o[1],prefix:p,suffix:m,maxLength:h,bordered:s,allowClear:u,readOnly:c,disabled:f,onChange:e=>{const{value:t}=e.target;g([l[0],t])}}))};class Gr extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,labelWidth:i=e.props.labelWidth,className:o,extra:s,validateTrigger:u,rules:c=[],onChange:f=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(o),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(i)},required:e.getFormItemRequired(c)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:c,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Ur,{option:this.props.option,onValuesChange:(t=[],l)=>{f(t),e.setViewValue(a,l)}}))),s&&q.default.createElement(d.Col,{flex:$e(s.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},s)))))}}Gr.contextType=Zn;const Yr=q.default.forwardRef(((e,t)=>{const{$$form:n}=q.default.useContext(Zn),{value:a,onChange:r,onValuesChange:i}=e,{t:o}=ot(),{options:s={},style:u={},placeholder:c=o("qm.form.inputPlaceholder"),bordered:f=!0,readOnly:p,disabled:m,onFocus:h,onBlur:g,onEnter:v}=e.option,{step:y=1,min:b,max:x,precision:E,autoFocus:C,stringMode:w,textAlign:S="left",controls:N=!0,formatter:T,parser:I}=s,O=q.default.useRef(),R=q.default.useRef(a),k=e=>{const t=hr(e)?"":l.isNumber(e)?e.toFixed(E):new ce.default(e).toFixed(E);return"function"==typeof T?T(t):t},L={[S]:!0,controls:N};return n.isOnlyShow?q.default.createElement(Mr,{value:k(a),bordered:f}):q.default.createElement(d.InputNumber,{ref:e=>{O.current=e,"function"==typeof t&&t(e)},value:a,className:J.default(L),placeholder:c,style:Object.assign({width:"100%"},u),step:y,min:b,max:x,controls:N,precision:E,autoFocus:C,stringMode:w,formatter:T,parser:I,bordered:f,readOnly:p,disabled:m,onFocus:e=>{null==h||h(e.target.value,e)},onBlur:t=>{Fe((()=>{(t=>{const{onBlur:l}=e;null==l||l(t)})(R.current),null==g||g(R.current,t)}))},onKeyUp:e=>{var t;13===e.keyCode&&(null==v||v(a,e),n.isFilterType&&(n.SUBMIT_FORM(),null===(t=O.current)||void 0===t||t.blur()))},onChange:e=>{const t=null!=e?e:"";!w&&(Number(t)>Number.MAX_SAFE_INTEGER||Number(t)<Number.MIN_SAFE_INTEGER)||(e=>{R.current=e,null==r||r(e),i(e,k(e))})(t)}})}));Yr.displayName="VInputNumber";class Xr extends e.Component{constructor(){super(...arguments),this.focus=()=>{const{type:e}=this.props.option;this[e].focus()}}render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,buttonAfter:c,validateTrigger:f,rules:p=[],onChange:m=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(p)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Yr,{ref:e=>this[t]=e,option:this.props.option,onValuesChange:(t,l)=>{m(t),e.setViewValue(a,l)}}))),c&&q.default.createElement(d.Col,null,e.renderFormItemButton(a,c)),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Xr.contextType=Zn;const Qr=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l=[],onChange:n,onValuesChange:a}=e,{t:r}=ot(),{options:i={},placeholder:o=r("qm.form.rangeInputNumberPlaceholder"),bordered:s=!0,allowClear:u,readOnly:c,disabled:f}=e.option,{step:p=1,min:m=0,max:h,textAlign:g="left",controls:v=!0,precision:y,formatter:b,parser:x}=i,E=e=>{e.every((e=>null!==e))&&e[0]>e[1]&&(e[1]=e[0]),C(e)},C=e=>{const t=e.every((e=>null===e))?[]:[...e];null==n||n(t),a(t,w(t))},w=e=>hr(e)?"":e.map((e=>hr(e)?"":Number(e).toFixed(y))),S={[g]:!0,controls:v};return t.isOnlyShow?q.default.createElement(Mr,{value:w(l),bordered:s}):q.default.createElement(d.Input.Group,null,q.default.createElement(d.InputNumber,{value:l[0],className:J.default("site-input-left",S),style:{width:"calc(50% - 5px)",display:"table-cell",float:"left"},placeholder:o[0],step:p,min:m,max:h,controls:v,precision:y,formatter:b,parser:x,bordered:s,readOnly:c,disabled:f,onChange:e=>{C([e,l[1]])},onBlur:()=>{E(l)}}),q.default.createElement(d.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:s,disabled:f,readOnly:!0}),q.default.createElement(d.InputNumber,{value:l[1],className:J.default("site-input-right",S),style:{width:"calc(50% - 5px)"},placeholder:o[1],step:p,min:m,max:h,controls:v,precision:y,formatter:b,parser:x,bordered:s,readOnly:c,disabled:f,onChange:e=>{C([l[0],e])},onBlur:()=>{E(l)}}))};class Zr extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,labelWidth:i=e.props.labelWidth,className:o,extra:s,validateTrigger:u,rules:c=[],onChange:f=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(o),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(i)},required:e.getFormItemRequired(c)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:c,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Qr,{option:this.props.option,onValuesChange:(t=[],l)=>{f(t),e.setViewValue(a,l)}}))),s&&q.default.createElement(d.Col,{flex:$e(s.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},s)))))}}var Jr;Zr.contextType=Zn,function(e){e[e.large=40]="large",e[e.middle=32]="middle",e[e.small=24]="small"}(Jr||(Jr={}));const ei=e.createContext(void 0),ti={dataIndex:se.default.string.isRequired,title:se.default.string.isRequired,description:se.default.string,colSpan:se.default.number,width:se.default.number,minWidth:se.default.number,fixed:se.default.oneOf(["left","right"]),align:se.default.oneOf(["left","center","right"]),theadAlign:se.default.oneOf(["left","center","right"]),theadWrap:se.default.bool,printFixed:se.default.bool,hidden:se.default.bool,noAuth:se.default.bool,noFixed:se.default.bool,ellipsis:se.default.bool,className:se.default.string,theadClassName:se.default.string,children:se.default.array,sorter:se.default.oneOfType([se.default.bool,se.default.func]),filter:se.default.shape({type:se.default.oneOf(["text","textarea","checkbox","radio","number","date","tree"]).isRequired,items:se.default.arrayOf(se.default.shape({text:se.default.string,value:se.default.oneOfType([se.default.string,se.default.number])})),style:se.default.object,openFilterList:se.default.bool}),precision:se.default.number,displayPrecision:se.default.number,formatType:se.default.oneOf(["date","datetime","dateShortTime","finance","percent","secret-name","secret-phone","secret-IDnumber","secret-bankNumber"]),required:se.default.bool,canCopy:se.default.bool,translate:se.default.bool,editRender:se.default.func,dictItems:se.default.arrayOf(se.default.shape({text:se.default.string,value:se.default.oneOfType([se.default.string,se.default.number])})),summation:se.default.shape({sumBySelection:se.default.bool,displayWhenNotSelect:se.default.bool,dataKey:se.default.string,unit:se.default.string,render:se.default.func}),groupSummary:se.default.shape({dataKey:se.default.string,unit:se.default.string,render:se.default.func}),shouldCellUpdate:se.default.func,headRender:se.default.func,render:se.default.func,outputRender:se.default.func};se.default.arrayOf(se.default.shape(ti)).isRequired,se.default.func,se.default.array,se.default.oneOfType([se.default.string,se.default.func]).isRequired,se.default.number,se.default.bool,se.default.bool,se.default.shape({api:se.default.func.isRequired,params:se.default.object.isRequired,formatter:se.default.func,beforeFetch:se.default.func,afterFetch:se.default.func,stopToFirst:se.default.bool,dataKey:se.default.string,callback:se.default.func}),se.default.bool,se.default.bool,se.default.string,se.default.string,se.default.object,se.default.bool,se.default.bool,se.default.bool,se.default.oneOfType([se.default.object,se.default.func]),se.default.oneOfType([se.default.object,se.default.func]),se.default.array,se.default.func,se.default.bool,se.default.func,se.default.object,se.default.object,se.default.shape({type:se.default.oneOf(["checkbox","radio"]).isRequired,defaultSelectedRowKeys:se.default.array,selectedRowKeys:se.default.array,hideSelectAll:se.default.bool,checkStrictly:se.default.bool,filterable:se.default.bool,selectByClickRow:se.default.bool,selectFirstRowOnChange:se.default.bool,clearableAfterFetched:se.default.bool,selectAllOnCurrentPage:se.default.bool,fetchSelectedRows:se.default.shape({api:se.default.func.isRequired,params:se.default.object,dataKey:se.default.string}),fetchAllRowKeys:se.default.shape({api:se.default.func.isRequired,params:se.default.object,dataKey:se.default.string}),disabled:se.default.func,onChange:se.default.func,onSelect:se.default.func,onSelectAll:se.default.func}),se.default.shape({currentRowKey:se.default.oneOfType([se.default.number,se.default.string]),disabled:se.default.func,onChange:se.default.func}),se.default.shape({virtual:se.default.bool,overscan:se.default.number,doubleXScrollbar:se.default.bool,expandIconColumn:se.default.string}),se.default.shape({defaultExpandAllRows:se.default.bool,defaultExpandedRowKeys:se.default.array,expandedRowKeys:se.default.array,hideExpandAll:se.default.bool,rowExpandable:se.default.func,expandedRowClassName:se.default.string,expandedRowRender:se.default.func,onExpand:se.default.func,onChange:se.default.func}),se.default.shape({cellMerge:se.default.bool,onCellMerge:se.default.func,onSelectChange:se.default.func}),se.default.shape({groupItems:se.default.arrayOf(se.default.shape({dataIndex:se.default.string.isRequired,titleIndex:se.default.string,color:se.default.string,backgroundColor:se.default.string})),fetch:se.default.shape({api:se.default.func.isRequired,params:se.default.object,dataKey:se.default.string}),onChange:se.default.func}),se.default.func,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.shape({current:se.default.number,pageSize:se.default.number,pageSizeOptions:se.default.array,showSizeChanger:se.default.bool,showQuickJumper:se.default.bool}),se.default.shape({fileName:se.default.string,fetch:se.default.shape({api:se.default.func.isRequired,params:se.default.object}),beforeExport:se.default.func,cellStyle:se.default.bool,hideIcon:se.default.bool}),se.default.shape({showLogo:se.default.bool}),se.default.shape({fetch:se.default.shape({api:se.default.func.isRequired,params:se.default.object,dataKey:se.default.string}),fieldList:se.default.arrayOf(se.default.object)}),se.default.shape({position:se.default.oneOf(["top","bottom"]),hideAlert:se.default.bool,hideClearButton:se.default.bool}),se.default.oneOf(["left","right"]),se.default.func,se.default.func,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.func,se.default.func,se.default.func,se.default.func,se.default.func,se.default.func,se.default.func,se.default.func,se.default.func;const li={columns:[],dataSource:[],rowKey:"id",border:!0,resizable:!0,showHeader:!0,ellipsis:!0,multipleSort:!0,topSpaceAlign:"right",showFullScreen:!0,showRefresh:!0,showClipboard:!0,showSelectCollection:!0,showSuperSearch:!0,showFastSearch:!0,showGroupSummary:!0,showColumnDefine:!0,showTableInfo:!0},ni=10,ai="1",ri="0",ii="YYYY-MM-DD",oi="YYYY-MM-DD HH:mm:ss",si="YYYYMMDDHHmmss",di={bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}}};var ui;!function(e){e.left="flex-start",e.right="flex-end"}(ui||(ui={}));const ci=Object.assign({},$).useId;let fi=0;var pi=ci?function(e){const t=ci();return e||t}:function(e){const[t]=$.useState(`qm_unique_${fi}`);return $.useEffect((()=>{fi+=1}),[]),e||t};let mi=[];const hi={_getInstance:function(e){var t;return null!==(t=mi.find((t=>t.id===e)))&&void 0!==t?t:null},getFocusInstance:function(){var e;return null!==(e=mi[0])&&void 0!==e?e:null},focus:function(e){const t=this._getInstance(e);t&&0!==mi.findIndex((e=>e===t))&&(this.deregister(e),mi=[t,...mi])},register:function(e,t){e&&t&&(null!==this._getInstance(e)&&this.deregister(e),mi=[{id:e,vm:t},...mi])},deregister:function(e){e&&(mi=mi.filter((t=>t.id!==e)))}};class gi{constructor(e){this.state={required:[],validate:[],edited:[],inserted:[],updated:[],removed:[]},this.addToRequired=e=>{-1===this.state.required.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.required.push(e)},this.removeFromRequired=e=>{const t=this.state.required.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.required.splice(t,1)},this.addToValidate=e=>{-1===this.state.validate.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.validate.push(e)},this.removeFromValidate=e=>{const t=this.state.validate.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.validate.splice(t,1)},this.addToEdited=e=>{-1===this.state.edited.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.edited.push(e)},this.removeFromEdited=e=>{const t=this.state.edited.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.edited.splice(t,1)},this.addToInserted=e=>{-1===this.state.inserted.findIndex((t=>t===e))&&this.state.inserted.push(e)},this.removeFromInserted=e=>{const t=this.state.inserted.findIndex((t=>t===e));t<0||this.state.inserted.splice(t,1)},this.addToUpdated=e=>{const t=this.state.updated.findIndex((t=>t===e||this.getRowKey(t,t.index)===this.getRowKey(e,e.index)));-1===t?this.state.updated.push(e):this.state.updated.splice(t,1,e)},this.removeFromUpdated=e=>{const t=this.state.updated.findIndex((t=>t===e));t<0||this.state.updated.splice(t,1)},this.addToRemoved=e=>{-1===this.state.removed.findIndex((t=>t===e))&&this.state.removed.push(e)},this.removeFromRemoved=e=>{const t=this.state.removed.findIndex((t=>t===e));t<0||this.state.removed.splice(t,1)},this.clearAllLog=()=>{this.state.required=[],this.state.validate=[],this.state.edited=[],this.state.inserted=[],this.state.updated=[],this.state.removed=[]},this.getRowKey=e.getRowKey}destroy(){for(const e in this)Object.prototype.hasOwnProperty.call(this,e)&&(this[e]=null)}}function vi(e){return void 0!==e}function yi(e,t){const{defaultValue:l,value:n,onChange:a,postState:r}=t||{},[i,o]=$.useState((()=>vi(n)?n:vi(l)?"function"==typeof l?l():l:"function"==typeof e?e():e)),s=vi(n)?n:i,d=r?r(s):s,u=st(a),[c,f]=$.useState([s]);Cn((()=>{const e=c[0];i!==e&&u(i,e)}),[c]),Cn((()=>{vi(n)||o(n)}),[n]);return[d,st((e=>{o(e),f([s])}))]}const bi={defaultColumnWidth:80,selectionColumnWidth:50,rowHeightMaps:{large:42,middle:34,small:26},sortDirections:["ascend","descend"],pagination:{current:1,pageSize:20,pageSizeOptions:[10,20,30,40,50],showSizeChanger:!0,showQuickJumper:!0},groupSummary:{total:{text:"记录数",value:"*"},recordTotalIndex:"nRecordsCount",summaryFieldName:"tsummary",groupbyFieldName:"tgroupby"},highSearch:{showSQL:!1},treeTable:{textIndent:17},dataKey:"records",summationKey:"summation",totalKey:"total",virtualScrollX:50,virtualScrollY:100,sorterFieldName:"tsortby",filterFieldName:"twhere",currentPageName:"currentPage",pageSizeName:"pageSize",showFilterType:!0,printWidth:1040,operationColumn:"__action__",selectionColumn:"__selection__",expandableColumn:"__expandable__",summaryIgnore:"sumIgnored",popupClassName:"table-editable__popper"},xi=e=>e.map((e=>{const t=Object.assign({},e);return t.children&&(t.children.forEach((e=>{t.fixed?e.fixed=t.fixed:delete e.fixed})),t.children=xi(t.children)),t})),Ei=(e,t)=>{const{fetch:l,columns:n,border:a,rowHeight:r,rowSelection:i,summation:o,expandable:s,treeConfig:d,tableConfig:u,webPagination:c,scrollPagination:f,showSuperSearch:p,showFastSearch:m,showGroupSummary:h,showTableImport:g,showClipboard:v,showSelectCollection:y,showPivotGrid:b,footRender:x}=e,{tableRef:E,getRowKey:C,$size:w,tableFullData:S,tableFlatData:N,updateMark:T,selectionKeys:I,sorter:O,filters:R,superFilters:k,pagination:L,mergedTdCells:P}=t,{selectionRows:A,summaries:F}=E.current,{expandIconColumn:_=""}=Object.assign({},d,u),{t:D}=ot(),M=e=>{const t=(e=>{const t=[],l=[],n=[];for(let a=0;a<e.length;a++){const r=e[a];"left"===r.fixed?t.push(r):"right"===r.fixed?l.push(r):n.push(r)}return[...t,...n,...l]})(xi(e)),l=(e=>{if(!e)return null;const{type:t}=e;return{dataIndex:bi.selectionColumn,title:"radio"===t?D("qm.table.config.selectionText"):"",width:bi.selectionColumnWidth,fixed:"left",type:t}})(i),n=(null==(a=s)?void 0:a.expandedRowRender)?{dataIndex:bi.expandableColumn,title:"",width:bi.selectionColumnWidth,fixed:"left",type:"expand"}:null;var a;return l&&t.unshift(l),n&&t.unshift(n),ma(t)},H=(e,t,l,n,a)=>{const r=`${t},${l}`;e.has(r)||e.set(r,{row:t,col:l,rowSpan:n,colSpan:a})},$=q.default.useMemo((()=>!!(null==l?void 0:l.api)),[null==l?void 0:l.api]),j=q.default.useMemo((()=>!$&&!!c),[$,c]),K=q.default.useMemo((()=>$&&!!f),[$,f]),V=q.default.useMemo((()=>($||j)&&!K),[$,j,K]),z=q.default.useMemo((()=>M(n)),[n]),W=q.default.useMemo((()=>pa(z)),[z]),B=q.default.useMemo((()=>W.filter((e=>"function"==typeof e.editRender))),[W]),U=q.default.useMemo((()=>W.filter((e=>!!e.summation))),[W]),G=q.default.useMemo((()=>W.filter((e=>"left"===e.fixed))),[W]),Y=q.default.useMemo((()=>W.filter((e=>"right"===e.fixed))),[W]),X=q.default.useMemo((()=>r||bi.rowHeightMaps[w]),[r,w]),Q=q.default.useMemo((()=>(e=>{const t=new Map;return e.forEach((e=>{const l=N.findIndex((t=>C(t,t.index)===e.rowKey)),n=W.findIndex((t=>t.dataIndex===e.dataIndex));if(!(l<0||n<0)){H(t,l,n,e.rowSpan,e.colSpan);for(let a=0;a<e.rowSpan;a++)for(let r=0;r<e.colSpan;r++)0===a&&0===r||H(t,l+a,n+r,0,0)}})),Array.from(t.values()).sort(((e,t)=>e.row-t.row||e.col-t.col))})(P)),[P,W,S]),Z=q.default.useMemo((()=>{var e,t;const l=W.filter((e=>![bi.expandableColumn,bi.selectionColumn,bi.operationColumn].includes(e.dataIndex)));return _&&l.some((e=>e.dataIndex===_))?_:null!==(t=null===(e=l[0])||void 0===e?void 0:e.dataIndex)&&void 0!==t?t:""}),[W,_]),J=q.default.useMemo((()=>U.length>0),[U]),ee=q.default.useMemo((()=>!!x||J),[x,J]),te=q.default.useMemo((()=>Na(z).length>1),[z]),le=q.default.useMemo((()=>a||te),[a,te]),ne=q.default.useMemo((()=>W.some((e=>e.sorter))),[W]),ae=q.default.useMemo((()=>W.some((e=>e.filter))),[W]),re=q.default.useMemo((()=>U.some((e=>!!e.summation.dataKey))),[U]),ie=q.default.useMemo((()=>!$&&!!g),[$,g]),oe=q.default.useMemo((()=>!!v&&B.length>0),[v,B]),se=q.default.useMemo((()=>!!y&&"checkbox"===(null==i?void 0:i.type)),[y,i]),de=q.default.useMemo((()=>!!p&&ae),[p,ae]),ue=q.default.useMemo((()=>!$&&!!m),[$,m]),fe=q.default.useMemo((()=>!$&&!!b),[$,b]),pe=q.default.useMemo((()=>!!h&&W.some((e=>!!e.groupSummary))),[W]),me=q.default.useMemo((()=>{var e;return!!(null===(e=null==o?void 0:o.groupItems)||void 0===e?void 0:e.length)}),[o]),he=q.default.useMemo((()=>!N.length),[N]),ge=q.default.useMemo((()=>(()=>{const e={};return U.forEach((t=>{const{dataIndex:l,precision:n,displayPrecision:a,summation:r}=t,{sumBySelection:i,displayWhenNotSelect:o,unit:s}=r,d=!A.length&&!!o;let u=(!i||d?E.current.tableFullData:A).reduce(((e,t)=>{if(null==t?void 0:t[bi.summaryIgnore])return e;const n=Pa(t,l);return _a(n)?e.plus(n):e}),new ce.default(0));!Object.keys(F).includes(l)||i&&!d||(u=new ce.default(Pa(F,l))),Aa(e,l,u.toNumber());let c=n>=0?u.toFixed(n):u.toString();a>=0&&""!==c&&(c=Ma(c,a)),c=Da(c),Aa(e,`${l}_text`,s?`${c} ${s}`:c)})),[e]})()),[N,T,I,F]),ve=q.default.useMemo((()=>(e=>e.filter((e=>e.summation.dataKey)).map((e=>`sum|${e.dataIndex}`)).join(","))(U)),[U]),ye=q.default.useMemo((()=>{var e;const t=(e=>{const t=[];return Object.keys(e).forEach((l=>{null!==e[l]&&t.push(`${l}|${e[l]}`)})),t.join(",")})(O),n=((e,t)=>{const l=[];if(Object.keys(e).length)for(const t in e){const[n,a]=t.split("|"),r=e[t];Object.keys(r).forEach((e=>{l.push({type:["radio","tree"].includes(a)?"checkbox":a,bracketLeft:"",fieldName:n,expression:e,value:Za(e)?null:r[e],bracketRight:"",logic:"and"})}))}return t.length&&t.forEach((e=>{const t=e.fieldType;l.push({type:["radio","tree"].includes(t)?"checkbox":t,bracketLeft:e.bracketLeft,fieldName:e.fieldName,expression:e.expression,value:Za(e.expression)?null:e.condition,bracketRight:e.bracketRight,logic:e.logic})})),l.length&&(l[l.length-1].logic=""),l})(R,k),a=t?{[bi.sorterFieldName]:t}:null,r=n.length?{[bi.filterFieldName]:n}:null,i=ve?{[bi.groupSummary.summaryFieldName]:ve,usedJH:1}:null,o=null!==(e=null==l?void 0:l.params)&&void 0!==e?e:null,s={[bi.currentPageName]:L.current,[bi.pageSizeName]:L.pageSize};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),r),i),o),s)}),[null==l?void 0:l.params,L.current,L.pageSize,O,R,k,ve]);return{isFetch:$,isWebPagination:j,isScrollPagination:K,showPagination:V,tableColumns:z,flattenColumns:W,editableColumns:B,summationColumns:U,leftFixedColumns:G,rightFixedColumns:Y,tableRowHeight:X,derivedMergeCells:Q,treeExpandIndex:Z,showSummary:J,showFooter:ee,isHeadGroup:te,bordered:le,isHeadSorter:ne,isHeadFilter:ae,isServiceSummation:re,isSelectCollection:se,isTableImport:ie,isTableClipboard:oe,isSuperSearch:de,isFastSearch:ue,isPivotGrid:fe,isGroupSummary:pe,isGroupSubtotal:me,isTableEmpty:he,summationRows:ge,fetchParams:ye}},Ci=(e,t)=>{const{rowKey:n,height:a,dataSource:r,summation:i,fetch:o,rowSelection:s,expandable:d,tableConfig:u,authConfig:c,ignorePageIndex:f,columnsChange:p,onChange:m,onDataChange:h,onDataLoad:g,onScrollEnd:v,onFetchError:y}=e,{getRowKey:b,tableRef:x,tableElementRef:E,$size:C,tableColumns:w,flattenColumns:S,tableFullData:N,pagination:T,layout:I,filters:O,sorter:R,superFilters:k,pagerFilter:L,fetchParams:P,selectionKeys:A,rowExpandedKeys:F,highlightKey:_,summationColumns:D,isFetch:M,isWebPagination:H,isScrollPagination:$,isServiceSummation:j,isGroupSubtotal:K,doLayout:V,setTableFullData:z,setTableOriginData:W,setTableFlatData:B,setTableDataMaps:U,setPagination:G,setPingRight:Y,setPingLeft:X,setSpinning:Q,setSorter:Z,setFilters:J,setSuperFilters:ee,setPagerFilter:te,setActivedCell:le,setSelectionKeys:ne,setRowExpandedKeys:ae,setHighlightKey:re,setSelectionRows:ie,setScrollXLoad:oe,setScrollYLoad:se,setFieldAuth:de,setResizeState:ue,setSummaries:ce,setPermission:fe,resetTableScroll:pe,createTableFocus:me,clearElementStore:he}=t,{t:ge}=ot(),{store:ve}=x.current,ye=q.default.useRef(P),be=q.default.useRef(!1),xe=e=>be.current=e,Ee=xn(E);Cn((()=>{ke(),V()}),[w]),Cn((()=>{Ce()}),[Ee.width,Ee.height,C,a,I.tableAutoHeight]),Cn((()=>{M||we(N.length),V()}),[N]),Cn((()=>{nt(),at(),rt(),M||(H&&Te(),!De(O)&&J({payload:Object.assign({},O),forceUpdate:!0}),!De(R)&&Z({payload:Object.assign({},R),forceUpdate:!0}),Qe(r))}),[r,null==o?void 0:o.params]),Cn((()=>{const e=Oe(P,ye.current);var t;e||M&&(null==s?void 0:s.clearableAfterFetched)&&it(),!e&&P[bi.currentPageName]>1&&!(null==o?void 0:o.stopToFirst)?Te():M&&Be(),t=P,ye.current=t}),[P]),Cn((()=>{x.current.isTreeTable&&tt()}),[F]),Yl((()=>{H&&(tt(),Ge()),$||pe(),je()}),[T.current,T.pageSize]);const Ce=()=>{const{scrollBarRef:e,resizeState:t}=x.current,{width:l,height:n}=Ee;V(),I.tableBodyWidth>l&&Y(!0),e.current.scrollLeft>0&&X(!0),ue(Object.assign({},t,{width:l,height:n}))},we=e=>{e!==T.total&&G((t=>Object.assign({},t,{total:e})))},Se=({current:e,pageSize:t})=>{G((l=>Object.assign({},l,{current:e,pageSize:t})))},Ne=()=>{const{pageSize:e,total:t}=T;return Math.ceil(t/e)||1},Te=()=>{Se(Object.assign({},T,{current:1}))},Oe=(e,t)=>{const l=Object.keys(La(e,t));return 1===l.length&&(l.includes(bi.currentPageName)||l.includes(bi.pageSizeName))},Re=wn((e=>{Ye(),null==v||v(e)})),ke=()=>{oe(S.length>bi.virtualScrollX)},Le=(e=[])=>{var t;let l=e.length>bi.virtualScrollY;x.current.isTreeTable&&(l=!0),se(null!==(t=null==u?void 0:u.virtual)&&void 0!==t?t:l)},Ae=e=>K?Fe(_e(e)):e,Fe=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...Fe(e.children)),delete e.children,t.push(e)})),t},_e=(e,t=0)=>{var l;const a=null===(l=i.groupItems)||void 0===l?void 0:l[t];if(!a)return e.forEach(((t,l)=>{t._rowSpan=0===l?e.length:0,t._colSpan=1})),e;return za(e,[a.dataIndex]).map((e=>{const l={children:_e(e,t+1),_group:a.dataIndex};return"function"!=typeof n&&Aa(l,n.toString(),$a()),a.titleIndex&&Aa(l,a.titleIndex,Pa(e[0],a.titleIndex)),Aa(l,a.dataIndex,Pa(e[0],a.dataIndex)),D.forEach((e=>{var t;const{dataIndex:n}=e,a=null===(t=l.children)||void 0===t?void 0:t.reduce(((e,t)=>{if(t[bi.summaryIgnore])return e;const l=Number(Pa(t,n));return Number.isNaN(l)?e:e+l}),0);Aa(l,n,a)})),l}))},Me=e=>{ne(e),ie((e=>{const{selectionRows:t,recordsMap:l}=x.current,n=new Map;t.forEach((e=>n.set(b(e,e.index),e)));const a=[];for(let t=0,r=e.length;t<r;t++){const r=n.get(e[t])||l.get(e[t]);r&&a.push(r)}return a})(e))},qe=e=>{const{type:t,checkStrictly:l=!0}=s||{},n=Array.isArray(e)?e:A;let a=[];return x.current.isTreeTable&&!l&&n.forEach((e=>{a.push(...((e,t)=>{var l;const{disabled:n}=s||{},{tableFullData:a,recordsMap:r}=x.current,i=Ba(a,(t=>t._rowKey===e));let o=[];if(!i)return o;let d=Sa((null==i?void 0:i.children)||[],(e=>e._rowKey));return n&&(d=d.filter((e=>!r.has(e)||!n(r.get(e))))),o=[...new Set([...t,...d])],((null===(l=Ua(a,e))||void 0===l?void 0:l.slice(0,-1).reverse())||[]).forEach((e=>{var t;const l=Ba(a,(t=>t._rowKey===e)),n=null===(t=null==l?void 0:l.children)||void 0===t?void 0:t.every((e=>o.includes(e._rowKey)));o=n?[...o,e]:o.filter((t=>t!==e))})),o})(e,n))})),a="radio"===t?n.slice(0,1):[...new Set([...n,...a])],a},$e=()=>{const{isTreeTable:e,tableFullData:t,recordsMap:l}=x.current;return e?wa(t,(e=>e._rowKey)):Array.from(l.keys())},je=wn((()=>{null==m||m(T,Ve(O),Ke(R),k,{currentDataSource:et()})})),Ke=e=>{const t={};for(const l in e)null!==e[l]&&(t[l]=e[l]);return t},Ve=e=>{const t={};for(const l in e){if(!l.includes("|"))continue;const[n,a]=l.split("|");t[`${n}|${a}`]=e[l]}return t},ze=()=>Ie(void 0,void 0,void 0,(function*(){var t;if(!c)return;let n=He(c,["fetch"]);if(c.fetch){const{api:e,params:a,dataKey:r}=c.fetch;try{const i=yield e(a);200===i.code&&(n=null!==(t=r?l.get(i.data,r):i.data)&&void 0!==t?t:{})}catch(e){}}if(Object.keys(n).length){const{isExport:e=1,isImport:t=1,isPrint:l=1}=n;fe((n=>Object.assign({},n,{export:!!e,import:!!t,print:!!l})))}if(Array.isArray(n.fieldList)){const t=va(e.columns,(e=>{const{dataIndex:t}=e,l=n.fieldList.find((e=>e.dataIndex===t));if(l){const{visible:n=1,disabled:a,secretName:r}=l,i=ya(x.current.originColumns,t);de(t,{visible:n,disabled:a,secretName:r}),n||(e.noAuth=!0,i.noAuth=!0),r&&(e.formatType=`secret-${r}`,i.formatType=`secret-${r}`)}}));null==p||p(t)}})),We=st((()=>Ie(void 0,void 0,void 0,(function*(){var e,t,n;if(!o)return;const{formatter:a=(e=>e),beforeFetch:r=Pe,afterFetch:s,callback:d}=o;if(!r(P))return;const u=!!(null===(e=null==i?void 0:i.fetch)||void 0===e?void 0:e.api);Q(!0);try{const[e,r]=u?yield Promise.all([o.api(a(P)),i.fetch.api(a(P))]):[yield o.api(a(P))];if(x.current.unMounted)return;if(u?200===e.code&&200===r.code:200===e.code){const a=null!==(t=o.dataKey)&&void 0!==t?t:bi.dataKey;let i=null!==(n=l.get(e.data,a))&&void 0!==n?n:[];i="function"==typeof s?yield s(i):i;const u=l.get(e.data,a.replace(/[^.]+$/,bi.totalKey))||i.length||0,c=Math.max(Math.ceil(u/T.pageSize),1);if(P[bi.currentPageName]>c)return Se(Object.assign(Object.assign({},T),{current:c}));Qe(be.current?x.current.tableFullData.concat(i):i),we(u),Ue((null==r?void 0:r.data)||e.data),null==d||d(e.data,e)}}catch(e){null==y||y(e)}var c,f;c=o,f="stopToFirst",Object.prototype.hasOwnProperty.call(c,f)&&(o.stopToFirst=!1),Q(!1),xe(!1)})))),Be=wn(We),Ue=e=>{var t,n,a;if(!j)return;const r=null!==(n=null===(t=null==i?void 0:i.fetch)||void 0===t?void 0:t.dataKey)&&void 0!==n?n:bi.summationKey,o=null!==(a=r?l.get(e,r):e)&&void 0!==a?a:{},s={};D.filter((e=>!!e.summation.dataKey)).forEach((e=>{Aa(s,e.dataIndex,Number(Pa(o,e.summation.dataKey)))})),ce(s)},Ge=()=>{const{type:e,selectFirstRowOnChange:t}=s||{};if("radio"===e&&t){const e=et();if(e.length){const t=b(e[0],e[0].index);Me([t])}else Me([])}},Ye=()=>{if(!$)return;const e=Ne();be.current||T.current>=e||(xe(!0),Se(Object.assign(Object.assign({},T),{current:T.current+1})))},Xe=e=>e.map(((e,t)=>(Array.isArray(e.children)&&(e.children=Xe(e.children)),e.index=t,f||(e.pageIndex=(e=>{const{current:t,pageSize:l}=T;return!M||$?e:(t-1)*l+e})(t)),e))),Qe=e=>{const t=Ze(e,(e=>er(e,L,x.current.isOriginTree)));Me(qe()),ae((e=>{const{isTreeTable:t,tableFullData:l,recordsMap:n}=x.current,{defaultExpandAllRows:a,rowExpandable:r,expandedRowRender:i}=d||{};let o=Array.isArray(e)?e:[...F];if(a)o=$e();else if(t){i&&ft("Table","树结构表格不能再设置展开行的 `expandedRowRender` 参数");const e=[...A];_&&e.unshift(_),e.forEach((e=>{const t=Ua(l,e)||[];o.push(...t.length>1?t.slice(0,-1).reverse():t)})),o=[...new Set(o)]}return r&&o.filter((e=>{const t=n.get(e);return!!t&&r(t)})),o})()),Ge(),null==g||g(t)},Ze=(e,t)=>{const l=Xe(e);return W(l),lt((null==t?void 0:t(l))||l),l},Je=()=>{const{current:e,pageSize:t}=T;return x.current.tableFullData.slice((e-1)*t,e*t)},et=()=>H?Je():x.current.tableFullData,tt=()=>{const{recordsMap:e,isTreeTable:t}=x.current;let l=H?Ca(Je()):Array.from(e.values());l=t?(e=>{const t=new Map,l=[];return e.forEach((e=>{const n=b(e,e.index);if(!e._parentRowKey)return l.push(e),t.set(n,!0);F.includes(e._parentRowKey)&&t.get(e._parentRowKey)&&(l.push(e),t.set(n,!0))})),t.clear(),l})(l):Ae(l),Le(l),B(l)},lt=e=>{z(e),U(e),tt()},nt=()=>{ee([])},at=()=>{te({})},rt=()=>{le({})},it=()=>{Me([])};return{initialTable:()=>{ze(),me(),ke(),Le(),M?We():Qe(r)},checkDataIndex:()=>{const e=S.map((e=>e.dataIndex));[...new Set(e)].length!==e.length&&ft("Table","配置项 dataIndex 属性是唯一的,不能重复")},createTableFullData:lt,createWebPageData:Je,getTableData:We,createTableData:Ze,createGroupData:Ae,createAllExpandedKeys:$e,setSelectionKeysEffect:Me,doFieldValidate:(e,t,l,n,a)=>{if(!Array.isArray(e))return ft("Table","可编辑单元格的校验规则 `rules` 配置不正确");e.length&&(ve.removeFromRequired({x:l,y:n}),ve.removeFromValidate({x:l,y:n}),e.forEach((e=>{var r;e.required&&De(t)&&ve.addToRequired({x:l,y:n,text:e.message||a+ge("qm.form.requiredTips")}),"function"!=typeof e.validator||(null===(r=e.validator)||void 0===r?void 0:r.call(e,t))||ve.addToValidate({x:l,y:n,text:e.message})})))},getTableLog:()=>{const{required:e,validate:t,inserted:n,updated:a,removed:r}=ve.state,i=l.intersection(n,r),o=e=>e.map((e=>({rowKey:e.x,dataIndex:e.y,text:e.text})));return{required:o(e),validate:o(t),inserted:n.filter((e=>!i.includes(e))),updated:a.filter((e=>![...l.intersection(a,n),...l.intersection(a,r)].includes(e))),removed:r.filter((e=>!i.includes(e)))}},dataChange:()=>{null==h||h(x.current.tableFullData)},tableChange:je,toLastPage:()=>{const e=Ne();T.current!==e&&Se(Object.assign({},T,{current:e}))},toFirstPage:Te,getPageCount:Ne,pagerChangeHandle:Se,scrollBottomDebouncer:Re,clearTableSorter:()=>{Z({payload:{}})},clearTableFilter:()=>{J({payload:{}})},clearSuperFilters:nt,clearPagerFilter:at,clearActivedCell:rt,clearRowSelection:it,clearRowHighlight:()=>{re("")},clearTableLog:()=>{ve.clearAllLog()},destroy:()=>{const{tableManager:e,uid:t}=x.current;he(),ve.destroy(),e.deregister(t)}}},wi=(e,t)=>{const{height:n,minHeight:a,maxHeight:r,ellipsis:i,showHeader:o,spanMethod:s,rowSelection:d}=e,{getRowKey:u,tableRef:c,topElementRef:f,tableElementRef:p,tableBodyRef:m,$size:h,tableColumns:g,flattenColumns:v,leftFixedColumns:y,derivedMergeCells:b,tableFlatData:x,selectionKeys:E,highlightKey:C,layout:w,tableRowHeight:S,showFooter:N,showPagination:T,isFullScreen:I,setLayout:O,setElementStore:R}=t,k=q.default.useMemo((()=>{const{tableFullHeight:e,tableAutoHeight:t}=w,l={};return a&&Object.assign(l,{minHeight:`${ka(a)}px`}),r&&Object.assign(l,{maxHeight:`${ka(r)}px`}),I?Object.assign(Object.assign({},l),{maxHeight:"",minHeight:"",height:`${e}px`}):n?Object.assign(Object.assign({},l),{height:"auto"!==n?`${ka(n)}px`:`${t}px`}):l}),[n,r,a,I,w]),L=(e,t)=>{const{scrollBarRef:l,scrollYLoad:n}=c.current;if(void 0!==t&&t>=0)if(t<x.length)if(n)m.current.scrollToYIndex(t);else{const e=P(u(x[t],x[t].index));e&&l.current.SET_SCROLL_TOP(e.offsetTop)}else l.current.SET_SCROLL_TOP(t*S);else if(n){const t=x.findIndex((t=>e===u(t,t.index)));t>=0&&m.current.scrollToYIndex(t)}else{const t=P(e);t&&l.current.SET_SCROLL_TOP(t.offsetTop)}},P=e=>c.current.elementStore.$tableBody.querySelector(`tbody > tr[data-row-key="${e}"]`);return{createElementStore:()=>{R("$toper",f.current),R("$table",p.current)},tableStyles:k,getSpan:(e,t,n,a,r)=>{let i=1,o=1;if("function"==typeof s){const d=s({row:e,column:t,rowIndex:n,columnIndex:a,tableData:r});Array.isArray(d)?(i=d[0],o=d[1]):l.isPlainObject(d)&&(i=d.rowSpan,o=d.colSpan)}if(b.length>0){const e=b.find((e=>e.row===n&&e.col===a));e&&(i=e.rowSpan,o=e.colSpan)}return{rowSpan:i,colSpan:o}},getStickyLeft:e=>{if(v.findIndex((t=>t.dataIndex===e))<0){const t=ya(g,e);e=t?ba(t).dataIndex:""}let t=0;for(let l=0;l<v.length;l++){const n=v[l];if(n.dataIndex===e)break;t+=n.width||n.renderWidth||0}return t},getStickyRight:(e,t)=>{if(v.findIndex((t=>t.dataIndex===e))<0){const t=ya(g,e);e=t?xa(t).dataIndex:""}const l="thead"===t?(e=>{if(!e.some((e=>e.colSpan>0)))return e;const t=[];let l=[];return e.forEach((e=>{e.colSpan>0&&l.length>0&&(t.push(l),l=[]),l.push(e)})),l.length>0&&t.push(l),t.map((e=>{const[t,l]=e.reduce(((e,t)=>(t.colSpan>0?e[0].push(t):e[1].push(t),e)),[[],[]]);return[...l,...t.reverse()]})).flat()})(v):v;let n=0;for(let t=l.length-1;t>=0;t--){const a=l[t];if(a.dataIndex===e)break;n+=a.width||a.renderWidth||0}return n},scrollXToColumn:(e,t)=>{const l=void 0===t?v.findIndex((t=>t.dataIndex===e)):t;if(l<0)return;const{scrollBarRef:n}=c.current,a=y.reduce(((e,t)=>e+(t.width||t.renderWidth)),0),r=v.slice(0,l).reduce(((e,t)=>e+(t.width||t.renderWidth)),0);n.current.SET_SCROLL_LEFT(r-a)},scrollYToRecord:L,calcTableHeight:()=>{if("auto"!==n)return;const{elementStore:e,resizeState:t}=c.current;try{const l=t.winHeight-e.$table.getBoundingClientRect().top-(T?Jr["small"!==h?"middle":h]+ni:0)-ni;O((e=>Object.assign({},e,{tableAutoHeight:l})))}catch(e){}},resetTableScroll:()=>{L("",0)},createTableFocus:()=>{C&&m.current.setClickedValues([C,""]),"radio"===(null==d?void 0:d.type)&&E.length&&m.current.setClickedValues([E[0],""])},doLayout:()=>{(()=>{const{elementStore:e,scrollXLoad:t}=c.current,l=e.$table.clientWidth,{defaultColumnWidth:n}=bi,a=[];let r=0;if(v.forEach((e=>{"number"==typeof e.width?(e.renderWidth=e.width,r+=e.width):(e.renderWidth=void 0,a.push(e))})),a.length>0){const e=v.reduce(((e,t)=>e+(t.width||t.minWidth||n)),0);if(e<=l){const t=l-e;if(1===a.length)a[0].renderWidth=(a[0].minWidth||n)+t;else{const e=t/a.reduce(((e,t)=>e+(t.minWidth||n)),0);let l=0;a.forEach(((t,a)=>{if(0===a)return;const r=Math.floor((t.minWidth||n)*e);l+=r,t.renderWidth=(t.minWidth||n)+r})),a[0].renderWidth=(a[0].minWidth||n)+t-l}}else a.forEach((e=>{e.renderWidth=e.minWidth||n}));O((t=>Object.assign(Object.assign({},t),{tableBodyWidth:Math.max(e,l)})))}else r=v.reduce(((e,t)=>e+(t.renderWidth=t.width||t.minWidth||n)),0),O((e=>Object.assign(Object.assign({},e),{tableBodyWidth:r})));O((e=>Object.assign(Object.assign({},e),{tableWidth:l}))),t&&m.current.resetItemXSize(v)})(),Fe((()=>(()=>{const{elementStore:e,scrollYLoad:t,resizeState:l}=c.current;if(!e.$table.offsetParent)return;const n=e.$table.offsetHeight,a=o?e.$header.offsetHeight:0,r=N?e.$footer.offsetHeight:0,i=n-a-r,s=e.$tableBody.offsetHeight;let d=0;if(I){const t=e.$toper?e.$toper.offsetHeight+ni:0,n=e.$pager?e.$pager.offsetHeight+ni:0;d=l.winHeight-t-n-20}O((e=>Object.assign({},e,{headerHeight:a,footerHeight:r,viewportHeight:i,tableBodyHeight:s,tableFullHeight:d})))})()))}}};function Si({handler:e,delay:t=0}){const l=Kn(e,t),n=st(t>0?l:e);$.useEffect((()=>(window.addEventListener("resize",n),()=>window.removeEventListener("resize",n))),[n])}const Ni=e=>{const{total:t}=e,{tableRef:l,prefixCls:n,selectionKeys:a,isHeadSorter:r,isHeadFilter:i,clearTableSorter:o,clearTableFilter:s,clearSuperFilters:d,clearPagerFilter:u,clearActivedCell:c,clearRowSelection:f,clearRowHighlight:p}=q.default.useContext(ei),{infoBarConfig:m,rowSelection:h,rowHighlight:v}=l.current.props,{isTreeTable:y,recordsMap:b,invalidRowKeys:x}=l.current,{hideAlert:E,hideClearButton:C}=m||{},{t:w}=ot(),[S,N]=q.default.useState(a.length-x.length);q.default.useEffect((()=>{Fe((()=>N(a.length-x.length)))}),[a,x]);const T=q.default.useMemo((()=>!E),[E]),I=q.default.useMemo((()=>!C&&!!(r||i||h||v)),[C,r,i,h,v]),O={[`${n}__alert`]:!0};return T?q.default.createElement("div",{className:J.default(O)},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.InfoCircleFilled,null)),q.default.createElement("span",null,w("qm.table.alert.total",{total:y?b.size:t}),h?`,${w("qm.table.alert.selected",{total:Math.max(S,0)})}`:""),I&&q.default.createElement("em",{onClick:()=>{s(),d(),u(),o(),c(),f(),p()}},w("qm.table.alert.clear"))):null},Ti=q.default.forwardRef(((e,t)=>{const{isFullScreen:l,open:n=!0}=e,{prefixCls:a,setFullScreen:r}=q.default.useContext(ei),{t:i}=ot(),o=()=>{r(!l)};return q.default.useImperativeHandle(t,(()=>({clickHandle:o}))),n?q.default.createElement("span",{className:`${a}-full-screen`,title:i(l?"qm.table.screen.cancelFull":"qm.table.screen.full"),onClick:()=>o()},q.default.createElement("i",{className:"svgicon icon"},l?q.default.createElement(g.FullscreenExitOutlined,null):q.default.createElement(g.FullscreenOutlined,null))):null}));Ti.displayName="FullScreen";const Ii=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{prefixCls:n,getTableData:a}=q.default.useContext(ei),{t:r}=ot(),i=()=>{a()};return q.default.useImperativeHandle(t,(()=>({clickHandle:i}))),l?q.default.createElement("span",{className:`${n}-reload`,title:r("qm.table.refresh.text"),onClick:()=>i()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.ReloadOutlined,null))):null}));Ii.displayName="Reload";const Oi=()=>{const e={dateFormat:e=>{const t=e?j.default(e).format(ii):"";return t.startsWith("1900-01-01")?"":t},datetimeFormat:e=>{const t=e?j.default(e).format(oi):"";return t.startsWith("1900-01-01")?"":t},dateShortTimeFormat:e=>{const t=e?j.default(e).format(oi.slice(0,-3)):"";return t.startsWith("1900-01-01")?"":t},percentFormat:e=>_a(e)?(100*Number(e)).toFixed(2)+"%":e,financeFormat:e=>Da(e.toString()),secretNameFormat:e=>e.replace(/^([\u4e00-\u9fa5]{1}).+$/,"$1**"),secretPhoneFormat:e=>e.replace(/^(\d{3}).+(\d{4})$/,"$1****$2"),secretIDnumberFormat:e=>e.replace(/^(\d{3}).+(\w{4})$/,"$1***********$2"),secretBankNumberFormat:e=>e.replace(/^(\d{4}).+(\w{3})$/,"$1************$2")},t=(t,l,n)=>{var a,r,i,o;const{dictItems:s,precision:d,displayPrecision:u,formatType:c,editRender:f}=l,p=s||(null===(a=null==f?void 0:f(n,l))||void 0===a?void 0:a.items)||[];let m=null!==(o=null!==(i=null===(r=p.find((e=>e.value==t)))||void 0===r?void 0:r.text)&&void 0!==i?i:t)&&void 0!==o?o:"";if(Array.isArray(t)&&(m=t.map((e=>{var t,l;return null!==(l=null===(t=p.find((t=>t.value==e)))||void 0===t?void 0:t.text)&&void 0!==l?l:e})).join(",")),d>=0&&""!==m&&(m=_a(m)?new ce.default(m).toFixed(d):m),u>=0&&""!==m&&(m=Ma(m,u)),c){const t=e[`${_e(c)}Format`];t?m=t(m):ft("Table","字段的格式化类型 `formatType` 配置不正确")}return m},l=e=>ja(e);return{renderText:t,getTitleFromCellNode:l,getTitleFromCellValue:(e,n,a,r)=>{const i=Pa(e,n.dataIndex),o=n.render?n.render(i,e,n,a,r):t(i,n,e);return l(o)}}},Ri=q.default.forwardRef(((e,t)=>{var n,a,r,i;const{tableColumns:o,open:s=!0}=e,{global:d}=q.default.useContext(xe),{tableRef:u,prefixCls:c,flattenColumns:f,summationRows:p,showSummary:m,createGroupData:h,getSpan:v}=q.default.useContext(ei),{tablePrint:y,showHeader:b}=u.current.props,{t:x}=ot(),{getTitleFromCellValue:E}=Oi(),C=null!==(a=null===(n=null==d?void 0:d.print)||void 0===n?void 0:n.leftLogo)&&void 0!==a?a:"",w=null!==(i=null===(r=null==d?void 0:d.print)||void 0===r?void 0:r.rightLogo)&&void 0!==i?i:"",S=!(!C&&!w),N=q.default.useMemo((()=>qe(Ea(o,[bi.expandableColumn,bi.selectionColumn,bi.operationColumn]))),[o]),T=q.default.useMemo((()=>qe(Ea(f,[bi.expandableColumn,bi.selectionColumn,bi.operationColumn]))),[f]),I=q.default.useMemo((()=>qe(o.filter((e=>e.printFixed)))),[o]),O=e=>{const t=Object.assign({},Wa(N,e.dataIndex).slice(0,-1).reverse()[0]);return t.children=[e],t.level&&t.level>1?O(t):t},R=(e,t)=>l.map(l.groupBy(l.flatten(e),t),l.spread(((...e)=>l.mergeWith(...e,((e,l)=>{if(Array.isArray(e))return R(e.concat(l),t)}))))),k=e=>{const t=[];return e.forEach((e=>{let l=[];e.forEach((e=>{1===e.level?l.push(e):l.push(O(e))})),l=(e=>[...new Set(e.map((e=>e.dataIndex)))].map((t=>{const l=e.filter((e=>e.dataIndex===t));return l.length<=1?l[0]:R(l,"dataIndex")[0]})))(l),t.push(Na(l))})),t},L=()=>{const e=(e=>{const t=[];let l=[],n=0,a=0;for(;a<e.length;){const r=e[a],i=f.find((e=>e.dataIndex===r.dataIndex));r.width=i.width||i.renderWidth||bi.defaultColumnWidth,n+=r.width||r.renderWidth,n<=bi.printWidth?(l.push(r),a===e.length-1&&t.push(l),a++):a>0?(e.splice(0,a),I.length&&e.unshift(...I),t.push(l),l=[],n=0,a=0):(r.width=bi.printWidth,l.push(r),t.push(l),a++)}return t})([...T]),t=k(e);let l=["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">','<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui">',"<style>\n * {\n margin: 0;\n padding: 0;\n }\n body * {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n }\n table {\n table-layout: fixed;\n border-spacing: 0;\n border-collapse: collapse;\n }\n table--print {\n font-size: 14px;\n text-align: left;\n }\n .table--print th,\n .table--print td {\n padding: 5px;\n border: 1px solid #000;\n }\n .no-border th,\n .no-border td {\n border: 0!important;\n }\n .table--print th[colspan]:not([colspan='1']) {\n text-align: center;\n }\n .page-break {\n page-break-after: always;\n }\n </style>","</head>","<body>"].join("");const{isTreeTable:n,tableFullData:a}=u.current;for(let r=0;r<e.length;r++)l+=P(t[r],e[r],n?a:h(a)),l+='<div class="page-break"></div>';return l+"</body></html>"},P=(e,t,l)=>{const{showLogo:n=!0}=y;let a='<table class="table--print" width="100%" border="0" cellspacing="0" cellpadding="0">';return a+=`<colgroup>${t.map((({width:e,renderWidth:t})=>`<col style="width:${e||t}px">`)).join("")}</colgroup>`,b&&(a+=["<thead>",n&&S?`<tr><th colspan="${t.length}" style="border: 0">${['<table class="no-border" width="100%" border="0" cellspacing="0" cellpadding="0">',"<tr>",'<td width="50%" align="left">',C?`<img src="${C}" border="0" height="26" />`:"","</td>",'<td width="50%" align="right">',w?`<img src="${w}" border="0" height="38" />`:"","</td>","</tr>","</table>"].join("")}</th></tr>`:"",e.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:l}=e;return 0===l?null:`<th colspan="${l}" rowspan="${t}">${ja(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),l.length&&(a+=`<tbody>${Ca(l).map((e=>`<tr>${t.map(((t,n)=>{const{rowSpan:a,colSpan:r}=v(e,t,e.index,n,l);if(!a||!r)return null;const{dataIndex:i,outputRender:o}=t;return`<td rowspan="${a}" colspan="${r}">${0===n&&e._level?`<span style="padding-left:${e._level*bi.treeTable.textIndent}px"></span>`:""}${o?o(Pa(e,i),e,t,e.index,n):E(e,t,e.index,n)}</td>`})).join("")}</tr>`)).join("")}</tbody>`),m&&p.length&&(a+=["<tfoot>",p.map((e=>`<tr>${t.map(((t,n)=>{const{dataIndex:a,summation:r}=t,i=(null==r?void 0:r.render)?r.render(l):Pa(e,`${a}_text`);return`<td>${0===n&&""===i?x("qm.table.config.summaryText"):Re(i)?ja(i):i}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),a+="</table>",a},A=()=>{var e;null===(e=((e,t)=>{const{filename:l,type:n,isDownload:a}=e,r=`${l}.${n}`;if(window.Blob){const e=new Blob([t],{type:`text/${n}`});if(!a)return Promise.resolve({type:n,content:t,blob:e});Dn(e,r)}})({filename:"print",type:"html",isDownload:!1},L()))||void 0===e||e.then((({content:e,blob:t})=>{let l=document.createElement("iframe");l.setAttribute("frameborder","0"),l.setAttribute("width","100%"),l.setAttribute("height","0"),l.style.display="none",document.body.appendChild(l),u.current.isIE?(l.contentDocument.write(e),l.contentDocument.execCommand("print"),l.parentNode.removeChild(l),l=null):(l.onload=e=>{e.target.src&&e.target.contentWindow.print(),setTimeout((()=>{l.parentNode.removeChild(l),l=null}))},l.src=URL.createObjectURL(t))}))};return q.default.useImperativeHandle(t,(()=>({clickHandle:A}))),s?q.default.createElement("span",{className:`${c}-print`,title:x("qm.table.print.text"),onClick:()=>A()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.PrinterOutlined,null))):null}));Ri.displayName="TablePrint";const ki="606060",Li="thin",Pi="d4d4d4",Ai=(e,t)=>{t&&(e.height=Math.floor(.75*t))},Fi=(e,t)=>{e.protection={locked:!1},e.alignment={vertical:"middle",horizontal:t||"left"}},_i=()=>({top:{style:Li,color:{argb:Pi}},left:{style:Li,color:{argb:Pi}},bottom:{style:Li,color:{argb:Pi}},right:{style:Li,color:{argb:Pi}}}),Di=e=>{const{children:t}=e;return t&&t.length?Di(t[0]):e},Mi=e=>{const{precision:t,formatType:l}=e,n=t>=0&&t?`.${"0".repeat(t)}`:"";return"percent"===l?{numFmt:n?`0${n}%`:"0%"}:"finance"===l?{numFmt:n?`#,##0${n}`:"#,##0"}:n?{numFmt:`0${n}`}:null},Hi=()=>{const{tableRef:e,tableRowHeight:t,getSpan:n,showSummary:a,isHeadGroup:r}=q.default.useContext(ei),{spanMethod:i,showHeader:o}=e.current.props,{t:s}=ot(),u=(e,t)=>{var l,n,a;return null!==(a=null!==(n=null===(l=e.find((e=>e.text==t)))||void 0===l?void 0:l.value)&&void 0!==n?n:t)&&void 0!==a?a:""};return{exportXLSX:(e,l,d,u)=>Ie(void 0,void 0,void 0,(function*(){const{columns:c,footSummation:f}=e,p=pa(c),m=Na(c),h=[],g=[],v=[],y=[];let b=0;const x={};p.forEach((e=>{const{dataIndex:t,width:l,renderWidth:n}=e;x[t]=ja(e.title),v.push({key:t,width:(l||n||bi.defaultColumnWidth)/8})})),o&&(r?m.forEach(((e,t)=>{const l={};e.forEach((e=>{const{colSpan:n,rowSpan:a}=e,r=Di(e),i=p.findIndex((({dataIndex:e})=>e===r.dataIndex));l[r.dataIndex]=ja(e.title),0!==n&&(n>1||a>1)&&y.push({s:{r:t,c:i},e:{r:t+a-1,c:i+n-1}})})),h.push(l)})):(p.forEach(((e,t)=>{const{colSpan:l,rowSpan:n}=e;(l>1||n>1)&&y.push({s:{r:b,c:t},e:{r:b+n-1,c:t+l-1}})})),h.push(x)),b+=h.length);const E=Ca(l).map(((e,t)=>{const a={};return p.forEach(((r,o)=>{if("function"==typeof i){const{rowSpan:a,colSpan:i}=n(e,r,t,o,l);(i>1||a>1)&&y.push({s:{r:t+b,c:o},e:{r:t+b+a-1,c:o+i-1}})}const s=["percent","finance"].includes(r.formatType);a[r.dataIndex]=s?Pa(e,r.dataIndex):u(e,t,r,o)})),a._level=e._level,a}));b+=E.length,a&&f&&d(p,l).forEach(((e,t)=>{const n={};p.forEach(((t,a)=>{const{dataIndex:r,summation:i}=t,o=(null==i?void 0:i.render)?i.render(l):Pa(e,r);n[r]=0===a&&""===o?s("qm.table.config.summaryText"):Re(o)?ja(o):o})),g.push(n)}));const{sheetName:C,useStyle:w}=e,S=new fe.default.Workbook,N=S.addWorksheet(C);N.columns=v,o&&N.addRows(h).forEach((e=>{w&&Ai(e,t),e.eachCell((e=>{const t=N.getColumn(e.col),l=ya(c,t.key),{align:n,theadAlign:a}=l;Fi(e,a||n),w&&Object.assign(e,{font:{bold:!0,color:{argb:ki}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:_i()})}))})),N.addRows(E).forEach(((e,l)=>{const{_level:n}=E[l];w&&Ai(e,t),e.eachCell((e=>{const t=N.getColumn(e.col),l=ya(c,t.key),{align:a}=l;Fi(e,a),Object.assign(e,Mi(l)),w&&Object.assign(e,{font:{color:{argb:ki}},border:_i()}),1===Number(e.col)&&n&&(e.alignment=Object.assign(Object.assign({},e.alignment),{indent:n}))}))})),a&&f&&N.addRows(g).forEach((e=>{w&&Ai(e,t),e.eachCell((e=>{const t=N.getColumn(e.col),l=ya(c,t.key),{align:n}=l;Fi(e,n),Object.assign(e,Mi(l)),w&&Object.assign(e,{font:{color:{argb:ki}},border:_i()})}))})),y.forEach((({s:e,e:t})=>{N.mergeCells(e.r+1,e.c+1,t.r+1,t.c+1)}));const T=yield S.xlsx.writeBuffer();return new Blob([T],{type:"application/octet-stream"})})),exportCSV:(e,t)=>{const l="\ufeff"+(e=>Array.from(e.rows).map((e=>Array.from(e.cells).map((e=>{var t,l;return((e,t)=>{const l=e.replace(/"/g,'""');return"string"===t?`"=""${l}"""`:"number"===t?l:l.includes(",")||l.includes("\r")||l.includes("\n")?`"${l}"`:l})(null!==(l=null===(t=e.textContent)||void 0===t?void 0:t.trim())&&void 0!==l?l:"",e.getAttribute("data-type"))})).join(","))).join("\r\n"))((e=>{const t=document.createElement("div");t.innerHTML=e.trim();const l=t.querySelector("table");if(!l)throw new Error("Invalid table HTML input.");return l})(t));return new Blob([l],{type:"text/csv;charset=utf-8"})},importXLSX:(e,t)=>{const{columns:n,file:a}=e,r=pa(n),i=new FileReader;i.onerror=()=>{d.message.error(s("qm.table.import.error"))},i.onload=e=>{const n=r.map((e=>ja(e.title))),a=new fe.default.Workbook,i=e.target;i?a.xlsx.load(i.result).then((e=>{const a=e.worksheets[0];if(a){const e=a.getSheetValues(),i=e.findIndex((e=>e&&e.length>0)),o=e[i],c=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(n,o);if(c){const a=e.slice(i+1).map((e=>{const t={};e.forEach(((e,n)=>{var a;let r=e;Array.isArray(null==r?void 0:r.richText)&&(r=r.richText.map((e=>e.text)).join("")),l.isPlainObject(r)&&"text"in r&&(r=r.text),l.isDate(r)&&(r=qa(r,oi)),(null==r?void 0:r.formula)&&(r=null!==(a=r.result)&&void 0!==a?a:r.value),t[o[n]]=r}));const a={};return n.forEach(((e,l)=>{var n;const{dataIndex:i,dictItems:o}=r[l];Array.isArray(o)&&((null===(n=t[e])||void 0===n?void 0:n.toString().includes(","))?t[e]=t[e].split(",").map((e=>u(o,e))).filter((e=>""!==e)):t[e]=u(o,t[e])),Aa(a,i,t[e])})),a}));null==t||t(a)}else d.message.error(s("qm.table.import.error"))}else d.message.error(s("qm.table.import.error"))})):d.message.error(s("qm.table.import.error"))},i.readAsArrayBuffer(a)}}},qi=e=>{const{fileType:t,onChange:l}=e,{prefixCls:n}=q.default.useContext(ei),{t:a}=ot();let r,i;const o=e=>{const t=e.name,l=t.lastIndexOf("."),n=t.substring(l+1,t.length);return{filename:t.substring(0,l),type:n}},s=()=>Ie(void 0,void 0,void 0,(function*(){try{const e=yield(e=>{const t=Object.assign({},e);return r||(r=document.createElement("form"),i=document.createElement("input"),r.className=`${n}--file-form`,i.name="file",i.type="file",r.appendChild(i),document.body.appendChild(r)),new Promise(((e,l)=>{const n=!t.type;i.multiple=!!t.multiple,i.accept=n?"":`.${t.type}`,i.onchange=s=>{const{files:u}=s.target,c=u[0];let f="";if(!n)for(let e=0;e<u.length;e++){const{type:l}=o(u[e]);if(t.type!==l){f=l;break}}f?(d.message.warning(a("qm.upload.notType",{type:f})),l()):e(c),document.body.removeChild(r),r=null,i=null},r.reset(),i.click()}))})({type:t});null==l||l(e.name,e)}catch(e){}}));return q.default.createElement(pt,{onClick:()=>s()},a("qm.upload.text"))},$i=e=>{const{columns:t,onClose:l}=e,{tableRef:n,prefixCls:a,createTableData:r,dataChange:i}=q.default.useContext(ei),{beforeTableImport:o}=n.current.props,{t:s}=ot(),{importXLSX:u}=Hi(),c=q.default.useRef(null),[f,p]=q.default.useState(!1),[m,h]=q.default.useState(!0),g=e=>e.filter((e=>![bi.expandableColumn,bi.selectionColumn,"index","pageIndex",bi.operationColumn].includes(e.dataIndex))),v={posIndex:"条"},[y,b]=q.default.useState([{type:"INPUT",label:s("qm.table.export.fileName"),fieldName:"fileName",render:(e,t)=>{const{fileName:l}=t.GET_FIELDS_VALUE(["fileName"]);return q.default.createElement(q.default.Fragment,null,l?q.default.createElement("span",null,l):q.default.createElement(qi,{fileType:t.state.formData.fileType,onChange:(e,l)=>{t.SET_FIELDS_VALUE({fileName:e,file:l}),l&&h(!1)}}))}},{type:"SELECT",label:s("qm.table.export.fileType"),fieldName:"fileType",allowClear:!1,options:{itemList:[{text:"xlsx",value:"xlsx"}]}},{type:"SELECT",label:s("qm.table.import.importType"),fieldName:"importType",allowClear:!1,options:{itemList:[{text:s("qm.table.import.fillText"),value:"fill"},{text:s("qm.table.import.addText"),value:"add"},{text:s("qm.table.import.insertText"),value:"insert"}]},onChange:e=>{y.find((e=>"posIndex"===e.fieldName)).hidden="insert"!==e,"insert"===e&&c.current.SET_FIELDS_EXTRA(v),b([...y])}},{type:"INPUT_NUMBER",label:s("qm.table.import.insertPos"),fieldName:"posIndex",hidden:!0,rules:[{required:!0}],options:{min:0,max:n.current.tableFullData.length,formatter:e=>`第 ${e}`.replace(/\B(?=(\d{3})+(?!\d))/g,","),parser:e=>e.replace(/第\s?|(,*)/g,"")},extra:{labelWidth:50}}]);return q.default.createElement("div",{className:`${a}-import__setting`},q.default.createElement(ap,{ref:c,initialValues:{fileType:"xlsx",importType:"fill"},initialExtras:v,items:y,cols:1,labelWidth:100}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(pt,{onClick:()=>l(),style:{marginRight:8}},s("qm.table.export.closeButton")),q.default.createElement(pt,{type:"primary",loading:f,disabled:m,onClick:()=>Ie(void 0,void 0,void 0,(function*(){const[e,a]=yield c.current.GET_FORM_DATA();e||(p(!0),u({columns:g(t),file:a.file},(e=>Ie(void 0,void 0,void 0,(function*(){const{tableFullData:t,store:u}=n.current;if(e=Array.from(e).map((e=>e||{})),"function"==typeof o)try{e=yield o(e)}catch(e){}if("fill"===a.importType&&r(e),"add"===a.importType&&r([...t,...e]),"insert"===a.importType){const l=a.posIndex,n=t.slice(0,l).concat(e).concat(t.slice(l));r(n)}e.forEach((e=>{u.addToInserted(e)})),i(),d.message.success(s("qm.table.import.success",{total:e.length})),p(!1),l()})))))}))},s("qm.table.import.text"))))},ji=q.default.forwardRef(((e,t)=>{const{tableColumns:l,open:n=!0}=e,{prefixCls:a}=q.default.useContext(ei),{t:r}=ot(),[i,o]=q.default.useState(!1),s=()=>{o(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:s})));const d={[`${a}-import`]:!0},u={visible:i,title:r("qm.table.import.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>o(!1)};return q.default.createElement(q.default.Fragment,null,n&&q.default.createElement("span",{className:J.default(d),title:r("qm.table.import.textNoSpace"),onClick:()=>s()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.ImportOutlined,null))),q.default.createElement(Qn,u,q.default.createElement($i,{columns:l,onClose:()=>o(!1)})))}));function Ki(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var l=t;l;){if(l===e)return!0;l=l.parentNode}return!1}function Vi(e,t,l,n){var a=ee.default.unstable_batchedUpdates?function(e){ee.default.unstable_batchedUpdates(l,e)}:l;return null!=e&&e.addEventListener&&e.addEventListener(t,a,n),{remove:function(){null!=e&&e.removeEventListener&&e.removeEventListener(t,a,n)}}}ji.displayName="TableImport";var zi=e.forwardRef((function(t,l){var n=t.didUpdate,a=t.getContainer,r=t.children,i=e.useRef(),o=e.useRef();e.useImperativeHandle(l,(function(){return{}}));var s=e.useRef(!1);return!s.current&&rl()&&(o.current=a(),i.current=o.current.parentNode,s.current=!0),e.useEffect((function(){null==n||n(t)})),e.useEffect((function(){return null===o.current.parentNode&&null!==i.current&&i.current.appendChild(o.current),function(){var e;null===(e=o.current)||void 0===e||null===(e=e.parentNode)||void 0===e||e.removeChild(o.current)}}),[]),o.current?ee.default.createPortal(r,o.current):null}));function Wi(e,t,l){return l?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}var Bi;function Ui(e){var t=e.prefixCls,l=e.motion,n=e.animation,a=e.transitionName;return l||(n?{motionName:"".concat(t,"-").concat(n)}:a?{motionName:a}:null)}function Gi(e){var t=e.prefixCls,l=e.visible,n=e.zIndex,a=e.mask,r=e.maskMotion,i=e.maskAnimation,o=e.maskTransitionName;if(!a)return null;var s={};return(r||o||i)&&(s=Tt({motionAppear:!0},Ui({motion:r,prefixCls:t,transitionName:o,animation:i}))),$.createElement(_l,Dl({},s,{visible:l,removeOnLeave:!0}),(function(e){var l=e.className;return $.createElement("div",{style:{zIndex:n},className:J.default("".concat(t,"-mask"),l)})}))}function Yi(e,t){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),l.push.apply(l,n)}return l}function Xi(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{};t%2?Yi(Object(l),!0).forEach((function(t){Zi(e,t,l[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(l)):Yi(Object(l)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(l,t))}))}return e}function Qi(e){return Qi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qi(e)}function Zi(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}var Ji={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function eo(){if(void 0!==Bi)return Bi;Bi="";var e=document.createElement("p").style;for(var t in Ji)t+"Transform"in e&&(Bi=t);return Bi}function to(){return eo()?"".concat(eo(),"TransitionProperty"):"transitionProperty"}function lo(){return eo()?"".concat(eo(),"Transform"):"transform"}function no(e,t){var l=to();l&&(e.style[l]=t,"transitionProperty"!==l&&(e.style.transitionProperty=t))}function ao(e,t){var l=lo();l&&(e.style[l]=t,"transform"!==l&&(e.style.transform=t))}var ro,io=/matrix\((.*)\)/,oo=/matrix3d\((.*)\)/;function so(e){var t=e.style.display;e.style.display="none",e.offsetHeight,e.style.display=t}function uo(e,t,l){var n=l;if("object"!==Qi(t))return void 0!==n?("number"==typeof n&&(n="".concat(n,"px")),void(e.style[t]=n)):ro(e,t);for(var a in t)t.hasOwnProperty(a)&&uo(e,a,t[a])}function co(e,t){var l=e["page".concat(t?"Y":"X","Offset")],n="scroll".concat(t?"Top":"Left");if("number"!=typeof l){var a=e.document;"number"!=typeof(l=a.documentElement[n])&&(l=a.body[n])}return l}function fo(e){return co(e)}function po(e){return co(e,!0)}function mo(e){var t=function(e){var t,l,n,a=e.ownerDocument,r=a.body,i=a&&a.documentElement;return t=e.getBoundingClientRect(),l=Math.floor(t.left),n=Math.floor(t.top),{left:l-=i.clientLeft||r.clientLeft||0,top:n-=i.clientTop||r.clientTop||0}}(e),l=e.ownerDocument,n=l.defaultView||l.parentWindow;return t.left+=fo(n),t.top+=po(n),t}function ho(e){return null!=e&&e==e.window}function go(e){return ho(e)?e.document:9===e.nodeType?e:e.ownerDocument}var vo=new RegExp("^(".concat(/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,")(?!px)[a-z%]+$"),"i"),yo=/^(top|right|bottom|left)$/,bo="currentStyle",xo="runtimeStyle",Eo="left";function Co(e,t){return"left"===e?t.useCssRight?"right":e:t.useCssBottom?"bottom":e}function wo(e){return"left"===e?"right":"right"===e?"left":"top"===e?"bottom":"bottom"===e?"top":void 0}function So(e,t,l){"static"===uo(e,"position")&&(e.style.position="relative");var n=-999,a=-999,r=Co("left",l),i=Co("top",l),o=wo(r),s=wo(i);"left"!==r&&(n=999),"top"!==i&&(a=999);var d,u="",c=mo(e);("left"in t||"top"in t)&&(u=(d=e).style.transitionProperty||d.style[to()]||"",no(e,"none")),"left"in t&&(e.style[o]="",e.style[r]="".concat(n,"px")),"top"in t&&(e.style[s]="",e.style[i]="".concat(a,"px")),so(e);var f=mo(e),p={};for(var m in t)if(t.hasOwnProperty(m)){var h=Co(m,l),g="left"===m?n:a,v=c[m]-f[m];p[h]=h===m?g+v:g-v}uo(e,p),so(e),("left"in t||"top"in t)&&no(e,u);var y={};for(var b in t)if(t.hasOwnProperty(b)){var x=Co(b,l),E=t[b]-c[b];y[x]=b===x?p[x]+E:p[x]-E}uo(e,y)}function No(e,t){var l=mo(e),n=function(e){var t=window.getComputedStyle(e,null),l=t.getPropertyValue("transform")||t.getPropertyValue(lo());if(l&&"none"!==l){var n=l.replace(/[^0-9\-.,]/g,"").split(",");return{x:parseFloat(n[12]||n[4],0),y:parseFloat(n[13]||n[5],0)}}return{x:0,y:0}}(e),a={x:n.x,y:n.y};"left"in t&&(a.x=n.x+t.left-l.left),"top"in t&&(a.y=n.y+t.top-l.top),function(e,t){var l=window.getComputedStyle(e,null),n=l.getPropertyValue("transform")||l.getPropertyValue(lo());if(n&&"none"!==n){var a,r=n.match(io);r?((a=(r=r[1]).split(",").map((function(e){return parseFloat(e,10)})))[4]=t.x,a[5]=t.y,ao(e,"matrix(".concat(a.join(","),")"))):((a=n.match(oo)[1].split(",").map((function(e){return parseFloat(e,10)})))[12]=t.x,a[13]=t.y,ao(e,"matrix3d(".concat(a.join(","),")")))}else ao(e,"translateX(".concat(t.x,"px) translateY(").concat(t.y,"px) translateZ(0)"))}(e,a)}function To(e,t){for(var l=0;l<e.length;l++)t(e[l])}function Io(e){return"border-box"===ro(e,"boxSizing")}"undefined"!=typeof window&&(ro=window.getComputedStyle?function(e,t,l){var n=l,a="",r=go(e);return(n=n||r.defaultView.getComputedStyle(e,null))&&(a=n.getPropertyValue(t)||n[t]),a}:function(e,t){var l=e[bo]&&e[bo][t];if(vo.test(l)&&!yo.test(t)){var n=e.style,a=n[Eo],r=e[xo][Eo];e[xo][Eo]=e[bo][Eo],n[Eo]="fontSize"===t?"1em":l||0,l=n.pixelLeft+"px",n[Eo]=a,e[xo][Eo]=r}return""===l?"auto":l});var Oo=["margin","border","padding"],Ro=-1,ko=2,Lo=1;function Po(e,t,l){var n,a,r,i=0;for(a=0;a<t.length;a++)if(n=t[a])for(r=0;r<l.length;r++){var o=void 0;o="border"===n?"".concat(n).concat(l[r],"Width"):n+l[r],i+=parseFloat(ro(e,o))||0}return i}var Ao={getParent:function(e){var t=e;do{t=11===t.nodeType&&t.host?t.host:t.parentNode}while(t&&1!==t.nodeType&&9!==t.nodeType);return t}};function Fo(e,t,l){var n=l;if(ho(e))return"width"===t?Ao.viewportWidth(e):Ao.viewportHeight(e);if(9===e.nodeType)return"width"===t?Ao.docWidth(e):Ao.docHeight(e);var a="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?Math.floor(e.getBoundingClientRect().width):Math.floor(e.getBoundingClientRect().height),i=Io(e),o=0;(null==r||r<=0)&&(r=void 0,(null==(o=ro(e,t))||Number(o)<0)&&(o=e.style[t]||0),o=Math.floor(parseFloat(o))||0),void 0===n&&(n=i?Lo:Ro);var s=void 0!==r||i,d=r||o;return n===Ro?s?d-Po(e,["border","padding"],a):o:s?n===Lo?d:d+(n===ko?-Po(e,["border"],a):Po(e,["margin"],a)):o+Po(e,Oo.slice(n),a)}To(["Width","Height"],(function(e){Ao["doc".concat(e)]=function(t){var l=t.document;return Math.max(l.documentElement["scroll".concat(e)],l.body["scroll".concat(e)],Ao["viewport".concat(e)](l))},Ao["viewport".concat(e)]=function(t){var l="client".concat(e),n=t.document,a=n.body,r=n.documentElement[l];return"CSS1Compat"===n.compatMode&&r||a&&a[l]||r}}));var _o={position:"absolute",visibility:"hidden",display:"block"};function Do(){for(var e=arguments.length,t=new Array(e),l=0;l<e;l++)t[l]=arguments[l];var n,a=t[0];return 0!==a.offsetWidth?n=Fo.apply(void 0,t):function(e,t,l){var n,a={},r=e.style;for(n in t)t.hasOwnProperty(n)&&(a[n]=r[n],r[n]=t[n]);for(n in l.call(e),t)t.hasOwnProperty(n)&&(r[n]=a[n])}(a,_o,(function(){n=Fo.apply(void 0,t)})),n}function Mo(e,t){for(var l in t)t.hasOwnProperty(l)&&(e[l]=t[l]);return e}To(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);Ao["outer".concat(t)]=function(t,l){return t&&Do(t,e,l?0:Lo)};var l="width"===e?["Left","Right"]:["Top","Bottom"];Ao[e]=function(t,n){var a=n;return void 0!==a?t?(Io(t)&&(a+=Po(t,["padding","border"],l)),uo(t,e,a)):void 0:t&&Do(t,e,Ro)}}));var Ho={getWindow:function(e){if(e&&e.document&&e.setTimeout)return e;var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},getDocument:go,offset:function(e,t,l){if(void 0===t)return mo(e);!function(e,t,l){if(l.ignoreShake){var n=mo(e),a=n.left.toFixed(0),r=n.top.toFixed(0),i=t.left.toFixed(0),o=t.top.toFixed(0);if(a===i&&r===o)return}l.useCssRight||l.useCssBottom?So(e,t,l):l.useCssTransform&&lo()in document.body.style?No(e,t):So(e,t,l)}(e,t,l||{})},isWindow:ho,each:To,css:uo,clone:function(e){var t,l={};for(t in e)e.hasOwnProperty(t)&&(l[t]=e[t]);if(e.overflow)for(t in e)e.hasOwnProperty(t)&&(l.overflow[t]=e.overflow[t]);return l},mix:Mo,getWindowScrollLeft:function(e){return fo(e)},getWindowScrollTop:function(e){return po(e)},merge:function(){for(var e={},t=0;t<arguments.length;t++)Ho.mix(e,t<0||arguments.length<=t?void 0:arguments[t]);return e},viewportWidth:0,viewportHeight:0};Mo(Ho,Ao);var qo=Ho.getParent;function $o(e){if(Ho.isWindow(e)||9===e.nodeType)return null;var t,l=Ho.getDocument(e).body,n=Ho.css(e,"position");if(!("fixed"===n||"absolute"===n))return"html"===e.nodeName.toLowerCase()?null:qo(e);for(t=qo(e);t&&t!==l&&9!==t.nodeType;t=qo(t))if("static"!==(n=Ho.css(t,"position")))return t;return null}var jo=Ho.getParent;function Ko(e,t){for(var l={left:0,right:1/0,top:0,bottom:1/0},n=$o(e),a=Ho.getDocument(e),r=a.defaultView||a.parentWindow,i=a.body,o=a.documentElement;n;){if(-1!==navigator.userAgent.indexOf("MSIE")&&0===n.clientWidth||n===i||n===o||"visible"===Ho.css(n,"overflow")){if(n===i||n===o)break}else{var s=Ho.offset(n);s.left+=n.clientLeft,s.top+=n.clientTop,l.top=Math.max(l.top,s.top),l.right=Math.min(l.right,s.left+n.clientWidth),l.bottom=Math.min(l.bottom,s.top+n.clientHeight),l.left=Math.max(l.left,s.left)}n=$o(n)}var d=null;Ho.isWindow(e)||9===e.nodeType||(d=e.style.position,"absolute"===Ho.css(e,"position")&&(e.style.position="fixed"));var u=Ho.getWindowScrollLeft(r),c=Ho.getWindowScrollTop(r),f=Ho.viewportWidth(r),p=Ho.viewportHeight(r),m=o.scrollWidth,h=o.scrollHeight,g=window.getComputedStyle(i);if("hidden"===g.overflowX&&(m=r.innerWidth),"hidden"===g.overflowY&&(h=r.innerHeight),e.style&&(e.style.position=d),t||function(e){if(Ho.isWindow(e)||9===e.nodeType)return!1;var t=Ho.getDocument(e),l=t.body,n=null;for(n=jo(e);n&&n!==l&&n!==t;n=jo(n))if("fixed"===Ho.css(n,"position"))return!0;return!1}(e))l.left=Math.max(l.left,u),l.top=Math.max(l.top,c),l.right=Math.min(l.right,u+f),l.bottom=Math.min(l.bottom,c+p);else{var v=Math.max(m,u+f);l.right=Math.min(l.right,v);var y=Math.max(h,c+p);l.bottom=Math.min(l.bottom,y)}return l.top>=0&&l.left>=0&&l.bottom>l.top&&l.right>l.left?l:null}function Vo(e){var t,l,n;if(Ho.isWindow(e)||9===e.nodeType){var a=Ho.getWindow(e);t={left:Ho.getWindowScrollLeft(a),top:Ho.getWindowScrollTop(a)},l=Ho.viewportWidth(a),n=Ho.viewportHeight(a)}else t=Ho.offset(e),l=Ho.outerWidth(e),n=Ho.outerHeight(e);return t.width=l,t.height=n,t}function zo(e,t){var l=t.charAt(0),n=t.charAt(1),a=e.width,r=e.height,i=e.left,o=e.top;return"c"===l?o+=r/2:"b"===l&&(o+=r),"c"===n?i+=a/2:"r"===n&&(i+=a),{left:i,top:o}}function Wo(e,t,l,n,a){var r=zo(t,l[1]),i=zo(e,l[0]),o=[i.left-r.left,i.top-r.top];return{left:Math.round(e.left-o[0]+n[0]-a[0]),top:Math.round(e.top-o[1]+n[1]-a[1])}}function Bo(e,t,l){return e.left<l.left||e.left+t.width>l.right}function Uo(e,t,l){return e.top<l.top||e.top+t.height>l.bottom}function Go(e,t,l){var n=[];return Ho.each(e,(function(e){n.push(e.replace(t,(function(e){return l[e]})))})),n}function Yo(e,t){return e[t]=-e[t],e}function Xo(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function Qo(e,t){e[0]=Xo(e[0],t.width),e[1]=Xo(e[1],t.height)}function Zo(e,t,l,n){var a=l.points,r=l.offset||[0,0],i=l.targetOffset||[0,0],o=l.overflow,s=l.source||e;r=[].concat(r),i=[].concat(i);var d={},u=0,c=Ko(s,!(!(o=o||{})||!o.alwaysByViewport)),f=Vo(s);Qo(r,f),Qo(i,t);var p=Wo(f,t,a,r,i),m=Ho.merge(f,p);if(c&&(o.adjustX||o.adjustY)&&n){if(o.adjustX&&Bo(p,f,c)){var h=Go(a,/[lr]/gi,{l:"r",r:"l"}),g=Yo(r,0),v=Yo(i,0);(function(e,t,l){return e.left>l.right||e.left+t.width<l.left})(Wo(f,t,h,g,v),f,c)||(u=1,a=h,r=g,i=v)}if(o.adjustY&&Uo(p,f,c)){var y=Go(a,/[tb]/gi,{t:"b",b:"t"}),b=Yo(r,1),x=Yo(i,1);(function(e,t,l){return e.top>l.bottom||e.top+t.height<l.top})(Wo(f,t,y,b,x),f,c)||(u=1,a=y,r=b,i=x)}u&&(p=Wo(f,t,a,r,i),Ho.mix(m,p));var E=Bo(p,f,c),C=Uo(p,f,c);if(E||C){var w=a;E&&(w=Go(a,/[lr]/gi,{l:"r",r:"l"})),C&&(w=Go(a,/[tb]/gi,{t:"b",b:"t"})),a=w,r=l.offset||[0,0],i=l.targetOffset||[0,0]}d.adjustX=o.adjustX&&E,d.adjustY=o.adjustY&&C,(d.adjustX||d.adjustY)&&(m=function(e,t,l,n){var a=Ho.clone(e),r={width:t.width,height:t.height};return n.adjustX&&a.left<l.left&&(a.left=l.left),n.resizeWidth&&a.left>=l.left&&a.left+r.width>l.right&&(r.width-=a.left+r.width-l.right),n.adjustX&&a.left+r.width>l.right&&(a.left=Math.max(l.right-r.width,l.left)),n.adjustY&&a.top<l.top&&(a.top=l.top),n.resizeHeight&&a.top>=l.top&&a.top+r.height>l.bottom&&(r.height-=a.top+r.height-l.bottom),n.adjustY&&a.top+r.height>l.bottom&&(a.top=Math.max(l.bottom-r.height,l.top)),Ho.mix(a,r)}(p,f,c,d))}return m.width!==f.width&&Ho.css(s,"width",Ho.width(s)+m.width-f.width),m.height!==f.height&&Ho.css(s,"height",Ho.height(s)+m.height-f.height),Ho.offset(s,{left:m.left,top:m.top},{useCssRight:l.useCssRight,useCssBottom:l.useCssBottom,useCssTransform:l.useCssTransform,ignoreShake:l.ignoreShake}),{points:a,offset:r,targetOffset:i,overflow:d}}function Jo(e,t,l){var n=l.target||t,a=Vo(n),r=!function(e,t){var l=Ko(e,t),n=Vo(e);return!l||n.left+n.width<=l.left||n.top+n.height<=l.top||n.left>=l.right||n.top>=l.bottom}(n,l.overflow&&l.overflow.alwaysByViewport);return Zo(e,a,l,r)}Jo.__getOffsetParent=$o,Jo.__getVisibleRectForElement=Ko;var es=rl()?$.useLayoutEffect:$.useEffect,ts=function(e,t){var l=$.useRef(!0);es((function(){return e(l.current)}),t),es((function(){return l.current=!1,function(){l.current=!0}}),[])};function ls(e,t){var l=null,n=null;var a=new le.default((function(e){var a=Ot(e,1)[0].target;if(document.documentElement.contains(a)){var r=a.getBoundingClientRect(),i=r.width,o=r.height,s=Math.floor(i),d=Math.floor(o);l===s&&n===d||Promise.resolve().then((function(){t({width:s,height:d})})),l=s,n=d}}));return e&&a.observe(e),function(){a.disconnect()}}function ns(e){return"function"!=typeof e?null:e()}function as(e){return"object"===Ct(e)&&e?e:null}var rs=function(e,t){var l=e.children,n=e.disabled,a=e.target,r=e.align,i=e.onAlign,o=e.monitorWindowResize,s=e.monitorBufferTime,d=void 0===s?0:s,u=q.default.useRef({}),c=q.default.useRef(),f=q.default.Children.only(l),p=q.default.useRef({});p.current.disabled=n,p.current.target=a,p.current.align=r,p.current.onAlign=i;var m=function(e,t){var l=q.default.useRef(!1),n=q.default.useRef(null);function a(){window.clearTimeout(n.current)}return[function r(i){if(a(),l.current&&!0!==i)n.current=window.setTimeout((function(){l.current=!1,r()}),t);else{if(!1===e(i))return;l.current=!0,n.current=window.setTimeout((function(){l.current=!1}),t)}},function(){l.current=!1,a()}]}((function(){var e=p.current,t=e.disabled,l=e.target,n=e.align,a=e.onAlign,r=c.current;if(!t&&l&&r){var i,o=ns(l),s=as(l);u.current.element=o,u.current.point=s,u.current.align=n;var d=document.activeElement;return o&&function(e){if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox(),l=t.width,n=t.height;if(l||n)return!0}if(e.getBoundingClientRect){var a=e.getBoundingClientRect(),r=a.width,i=a.height;if(r||i)return!0}}return!1}(o)?i=Jo(r,o,n):s&&(i=function(e,t,l){var n,a,r=Ho.getDocument(e),i=r.defaultView||r.parentWindow,o=Ho.getWindowScrollLeft(i),s=Ho.getWindowScrollTop(i),d=Ho.viewportWidth(i),u=Ho.viewportHeight(i),c={left:n="pageX"in t?t.pageX:o+t.clientX,top:a="pageY"in t?t.pageY:s+t.clientY,width:0,height:0},f=n>=0&&n<=o+d&&a>=0&&a<=s+u,p=[l.points[0],"cc"];return Zo(e,c,Xi(Xi({},l),{},{points:p}),f)}(r,s,n)),function(e,t){e!==document.activeElement&&Ki(t,e)&&"function"==typeof e.focus&&e.focus()}(d,r),a&&i&&a(r,i),!0}return!1}),d),h=Ot(m,2),g=h[0],v=h[1],y=Ot(q.default.useState(),2),b=y[0],x=y[1],E=Ot(q.default.useState(),2),C=E[0],w=E[1];return ts((function(){x(ns(a)),w(as(a))})),q.default.useEffect((function(){var e,t;u.current.element===b&&((e=u.current.point)===(t=C)||e&&t&&("pageX"in t&&"pageY"in t?e.pageX===t.pageX&&e.pageY===t.pageY:"clientX"in t&&"clientY"in t&&e.clientX===t.clientX&&e.clientY===t.clientY))&&function(e,t){var l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=new Set;return function e(t,a){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=n.has(t);if(Ue(!i,"Warning: There may be circular references"),i)return!1;if(t===a)return!0;if(l&&r>1)return!1;n.add(t);var o=r+1;if(Array.isArray(t)){if(!Array.isArray(a)||t.length!==a.length)return!1;for(var s=0;s<t.length;s++)if(!e(t[s],a[s],o))return!1;return!0}if(t&&a&&"object"===Ct(t)&&"object"===Ct(a)){var d=Object.keys(t);return d.length===Object.keys(a).length&&d.every((function(l){return e(t[l],a[l],o)}))}return!1}(e,t)}(u.current.align,r)||g()})),q.default.useEffect((function(){return ls(c.current,g)}),[c.current]),q.default.useEffect((function(){return ls(b,g)}),[b]),q.default.useEffect((function(){n?v():g()}),[n]),q.default.useEffect((function(){if(o)return Vi(window,"resize",g).remove}),[o]),q.default.useEffect((function(){return function(){v()}}),[]),q.default.useImperativeHandle(t,(function(){return{forceAlign:function(){return g(!0)}}})),q.default.isValidElement(f)&&(f=q.default.cloneElement(f,{ref:_t(f.ref,c)})),f},is=q.default.forwardRef(rs);function os(){os=function(){return e};var e={},t=Object.prototype,l=t.hasOwnProperty,n=Object.defineProperty||function(e,t,l){e[t]=l.value},a="function"==typeof Symbol?Symbol:{},r=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",o=a.toStringTag||"@@toStringTag";function s(e,t,l){return Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,l){return e[t]=l}}function d(e,t,l,a){var r=t&&t.prototype instanceof f?t:f,i=Object.create(r.prototype),o=new N(a||[]);return n(i,"_invoke",{value:E(e,l,o)}),i}function u(e,t,l){try{return{type:"normal",arg:e.call(t,l)}}catch(e){return{type:"throw",arg:e}}}e.wrap=d;var c={};function f(){}function p(){}function m(){}var h={};s(h,r,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(T([])));v&&v!==t&&l.call(v,r)&&(h=v);var y=m.prototype=f.prototype=Object.create(h);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function a(n,r,i,o){var s=u(e[n],e,r);if("throw"!==s.type){var d=s.arg,c=d.value;return c&&"object"==Ct(c)&&l.call(c,"__await")?t.resolve(c.__await).then((function(e){a("next",e,i,o)}),(function(e){a("throw",e,i,o)})):t.resolve(c).then((function(e){d.value=e,i(d)}),(function(e){return a("throw",e,i,o)}))}o(s.arg)}var r;n(this,"_invoke",{value:function(e,l){function n(){return new t((function(t,n){a(e,l,t,n)}))}return r=r?r.then(n,n):n()}})}function E(e,t,l){var n="suspendedStart";return function(a,r){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw r;return I()}for(l.method=a,l.arg=r;;){var i=l.delegate;if(i){var o=C(i,l);if(o){if(o===c)continue;return o}}if("next"===l.method)l.sent=l._sent=l.arg;else if("throw"===l.method){if("suspendedStart"===n)throw n="completed",l.arg;l.dispatchException(l.arg)}else"return"===l.method&&l.abrupt("return",l.arg);n="executing";var s=u(e,t,l);if("normal"===s.type){if(n=l.done?"completed":"suspendedYield",s.arg===c)continue;return{value:s.arg,done:l.done}}"throw"===s.type&&(n="completed",l.method="throw",l.arg=s.arg)}}}function C(e,t){var l=t.method,n=e.iterator[l];if(void 0===n)return t.delegate=null,"throw"===l&&e.iterator.return&&(t.method="return",t.arg=void 0,C(e,t),"throw"===t.method)||"return"!==l&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+l+"' method")),c;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,c;var r=a.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function T(e){if(e){var t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:I}}function I(){return{value:void 0,done:!0}}return p.prototype=m,n(y,"constructor",{value:m,configurable:!0}),n(m,"constructor",{value:p,configurable:!0}),p.displayName=s(m,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,s(e,o,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),s(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,l,n,a,r){void 0===r&&(r=Promise);var i=new x(d(t,l,n,a),r);return e.isGeneratorFunction(l)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),s(y,o,"Generator"),s(y,r,(function(){return this})),s(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),l=[];for(var n in t)l.push(n);return l.reverse(),function e(){for(;l.length;){var n=l.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=T,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&l.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(l,n){return i.type="throw",i.arg=e,t.next=l,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var r=this.tryEntries[a],i=r.completion;if("root"===r.tryLoc)return n("end");if(r.tryLoc<=this.prev){var o=l.call(r,"catchLoc"),s=l.call(r,"finallyLoc");if(o&&s){if(this.prev<r.catchLoc)return n(r.catchLoc,!0);if(this.prev<r.finallyLoc)return n(r.finallyLoc)}else if(o){if(this.prev<r.catchLoc)return n(r.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return n(r.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&l.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var r=a;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var i=r?r.completion:{};return i.type=e,i.arg=t,r?(this.method="next",this.next=r.finallyLoc,c):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),c},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var l=this.tryEntries[t];if(l.finallyLoc===e)return this.complete(l.completion,l.afterLoc),S(l),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var l=this.tryEntries[t];if(l.tryLoc===e){var n=l.completion;if("throw"===n.type){var a=n.arg;S(l)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,l){return this.delegate={iterator:T(e),resultName:t,nextLoc:l},"next"===this.method&&(this.arg=void 0),c}},e}function ss(e,t,l,n,a,r,i){try{var o=e[r](i),s=o.value}catch(e){return void l(e)}o.done?t(s):Promise.resolve(s).then(n,a)}function ds(e){return function(){var t=this,l=arguments;return new Promise((function(n,a){var r=e.apply(t,l);function i(e){ss(r,n,a,i,o,"next",e)}function o(e){ss(r,n,a,i,o,"throw",e)}i(void 0)}))}}is.displayName="Align";var us=["measure","alignPre","align",null,"motion"],cs=$.forwardRef((function(t,l){var n=t.visible,a=t.prefixCls,r=t.className,i=t.style,o=t.children,s=t.zIndex,d=t.stretch,u=t.destroyPopupOnHide,c=t.forceRender,f=t.align,p=t.point,m=t.getRootDomNode,h=t.getClassNameFromAlign,g=t.onAlign,v=t.onMouseEnter,y=t.onMouseLeave,b=t.onMouseDown,x=t.onTouchStart,E=t.onClick,C=e.useRef(),w=e.useRef(),S=Ot(e.useState(),2),N=S[0],T=S[1],I=function(e){var t=Ot($.useState({width:0,height:0}),2),l=t[0],n=t[1];return[$.useMemo((function(){var t={};if(e){var n=l.width,a=l.height;-1!==e.indexOf("height")&&a?t.height=a:-1!==e.indexOf("minHeight")&&a&&(t.minHeight=a),-1!==e.indexOf("width")&&n?t.width=n:-1!==e.indexOf("minWidth")&&n&&(t.minWidth=n)}return t}),[e,l]),function(e){var t=e.offsetWidth,l=e.offsetHeight,a=e.getBoundingClientRect(),r=a.width,i=a.height;Math.abs(t-r)<1&&Math.abs(l-i)<1&&(t=r,l=i),n({width:t,height:l})}]}(d),O=Ot(I,2),R=O[0],k=O[1];var L=function(t,l){var n=Ot(Gt(null),2),a=n[0],r=n[1],i=e.useRef();function o(e){r(e,!0)}function s(){Ol.cancel(i.current)}return e.useEffect((function(){o("measure")}),[t]),e.useEffect((function(){"measure"===a&&l(),a&&(i.current=Ol(ds(os().mark((function e(){var t,l;return os().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=us.indexOf(a),(l=us[t+1])&&-1!==t&&o(l);case 3:case"end":return e.stop()}}),e)})))))}),[a]),e.useEffect((function(){return function(){s()}}),[]),[a,function(e){s(),i.current=Ol((function(){o((function(e){switch(a){case"align":return"motion";case"motion":return"stable"}return e})),null==e||e()}))}]}(n,(function(){d&&k(m())})),P=Ot(L,2),A=P[0],F=P[1],_=Ot(e.useState(0),2),D=_[0],M=_[1],H=e.useRef();function q(){var e;null===(e=C.current)||void 0===e||e.forceAlign()}function j(e,t){var l=h(t);N!==l&&T(l),M((function(e){return e+1})),"align"===A&&(null==g||g(e,t))}ts((function(){"alignPre"===A&&M(0)}),[A]),ts((function(){"align"===A&&(D<3?q():F((function(){var e;null===(e=H.current)||void 0===e||e.call(H)})))}),[D]);var K=Tt({},Ui(t));function V(){return new Promise((function(e){H.current=e}))}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach((function(e){var t=K[e];K[e]=function(e,l){return F(),null==t?void 0:t(e,l)}})),$.useEffect((function(){K.motionName||"motion"!==A||F()}),[K.motionName,A]),$.useImperativeHandle(l,(function(){return{forceAlign:q,getElement:function(){return w.current}}}));var z=Tt(Tt({},R),{},{zIndex:s,opacity:"motion"!==A&&"stable"!==A&&n?0:void 0,pointerEvents:n||"stable"===A?void 0:"none"},i),W=!0;null==f||!f.points||"align"!==A&&"stable"!==A||(W=!1);var B=o;return $.Children.count(o)>1&&(B=$.createElement("div",{className:"".concat(a,"-content")},o)),$.createElement(_l,Dl({visible:n,ref:w,leavedClassName:"".concat(a,"-hidden")},K,{onAppearPrepare:V,onEnterPrepare:V,removeOnLeave:u,forceRender:c}),(function(e,t){var l=e.className,n=e.style,i=J.default(a,r,N,l);return $.createElement(is,{target:p||m,key:"popup",ref:C,monitorWindowResize:!0,disabled:W,align:f,onAlign:j},$.createElement("div",{ref:t,className:i,onMouseEnter:v,onMouseLeave:y,onMouseDownCapture:b,onTouchStartCapture:x,onClick:E,style:Tt(Tt({},n),z)},B))}))}));cs.displayName="PopupInner";var fs=$.forwardRef((function(e,t){var l=e.prefixCls,n=e.visible,a=e.zIndex,r=e.children,i=e.mobile,o=(i=void 0===i?{}:i).popupClassName,s=i.popupStyle,d=i.popupMotion,u=void 0===d?{}:d,c=i.popupRender,f=e.onClick,p=$.useRef();$.useImperativeHandle(t,(function(){return{forceAlign:function(){},getElement:function(){return p.current}}}));var m=Tt({zIndex:a},s),h=r;return $.Children.count(r)>1&&(h=$.createElement("div",{className:"".concat(l,"-content")},r)),c&&(h=c(h)),$.createElement(_l,Dl({visible:n,ref:p,removeOnLeave:!0},u),(function(e,t){var n=e.className,a=e.style,r=J.default(l,o,n);return $.createElement("div",{ref:t,className:r,onClick:f,style:Tt(Tt({},a),m)},h)}))}));fs.displayName="MobilePopupInner";var ps=["visible","mobile"],ms=$.forwardRef((function(t,l){var n=t.visible,a=t.mobile,r=Mt(t,ps),i=Ot(e.useState(n),2),o=i[0],s=i[1],d=Ot(e.useState(!1),2),u=d[0],c=d[1],f=Tt(Tt({},r),{},{visible:o});e.useEffect((function(){s(n),n&&a&&c(function(){if("undefined"==typeof navigator||"undefined"==typeof window)return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(null==e?void 0:e.substr(0,4))}())}),[n,a]);var p=u?$.createElement(fs,Dl({},f,{mobile:a,ref:l})):$.createElement(cs,Dl({},f,{ref:l}));return $.createElement("div",null,$.createElement(Gi,f),p)}));ms.displayName="Popup";var hs=$.createContext(null);function gs(){}function vs(){return""}function ys(e){return e?e.ownerDocument:window.document}var bs=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];var xs=function(e){var t=function(t){Vt(n,$.Component);var l=Bt(n);function n(e){var t,a;return qt(this,n),St(Wt(t=l.call(this,e)),"popupRef",$.createRef()),St(Wt(t),"triggerRef",$.createRef()),St(Wt(t),"portalContainer",void 0),St(Wt(t),"attachId",void 0),St(Wt(t),"clickOutsideHandler",void 0),St(Wt(t),"touchOutsideHandler",void 0),St(Wt(t),"contextMenuOutsideHandler1",void 0),St(Wt(t),"contextMenuOutsideHandler2",void 0),St(Wt(t),"mouseDownTimeout",void 0),St(Wt(t),"focusTime",void 0),St(Wt(t),"preClickTime",void 0),St(Wt(t),"preTouchTime",void 0),St(Wt(t),"delayTimer",void 0),St(Wt(t),"hasPopupMouseDown",void 0),St(Wt(t),"onMouseEnter",(function(e){var l=t.props.mouseEnterDelay;t.fireEvents("onMouseEnter",e),t.delaySetPopupVisible(!0,l,l?null:e)})),St(Wt(t),"onMouseMove",(function(e){t.fireEvents("onMouseMove",e),t.setPoint(e)})),St(Wt(t),"onMouseLeave",(function(e){t.fireEvents("onMouseLeave",e),t.delaySetPopupVisible(!1,t.props.mouseLeaveDelay)})),St(Wt(t),"onPopupMouseEnter",(function(){t.clearDelayTimer()})),St(Wt(t),"onPopupMouseLeave",(function(e){var l;e.relatedTarget&&!e.relatedTarget.setTimeout&&Ki(null===(l=t.popupRef.current)||void 0===l?void 0:l.getElement(),e.relatedTarget)||t.delaySetPopupVisible(!1,t.props.mouseLeaveDelay)})),St(Wt(t),"onFocus",(function(e){t.fireEvents("onFocus",e),t.clearDelayTimer(),t.isFocusToShow()&&(t.focusTime=Date.now(),t.delaySetPopupVisible(!0,t.props.focusDelay))})),St(Wt(t),"onMouseDown",(function(e){t.fireEvents("onMouseDown",e),t.preClickTime=Date.now()})),St(Wt(t),"onTouchStart",(function(e){t.fireEvents("onTouchStart",e),t.preTouchTime=Date.now()})),St(Wt(t),"onBlur",(function(e){t.fireEvents("onBlur",e),t.clearDelayTimer(),t.isBlurToHide()&&t.delaySetPopupVisible(!1,t.props.blurDelay)})),St(Wt(t),"onContextMenu",(function(e){e.preventDefault(),t.fireEvents("onContextMenu",e),t.setPopupVisible(!0,e)})),St(Wt(t),"onContextMenuClose",(function(){t.isContextMenuToShow()&&t.close()})),St(Wt(t),"onClick",(function(e){if(t.fireEvents("onClick",e),t.focusTime){var l;if(t.preClickTime&&t.preTouchTime?l=Math.min(t.preClickTime,t.preTouchTime):t.preClickTime?l=t.preClickTime:t.preTouchTime&&(l=t.preTouchTime),Math.abs(l-t.focusTime)<20)return;t.focusTime=0}t.preClickTime=0,t.preTouchTime=0,t.isClickToShow()&&(t.isClickToHide()||t.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault();var n=!t.state.popupVisible;(t.isClickToHide()&&!n||n&&t.isClickToShow())&&t.setPopupVisible(!t.state.popupVisible,e)})),St(Wt(t),"onPopupMouseDown",(function(){var e;(t.hasPopupMouseDown=!0,clearTimeout(t.mouseDownTimeout),t.mouseDownTimeout=window.setTimeout((function(){t.hasPopupMouseDown=!1}),0),t.context)&&(e=t.context).onPopupMouseDown.apply(e,arguments)})),St(Wt(t),"onDocumentClick",(function(e){if(!t.props.mask||t.props.maskClosable){var l=e.target,n=t.getRootDomNode(),a=t.getPopupDomNode();Ki(n,l)&&!t.isContextMenuOnly()||Ki(a,l)||t.hasPopupMouseDown||t.close()}})),St(Wt(t),"getRootDomNode",(function(){var e=t.props.getTriggerDOMNode;if(e)return e(t.triggerRef.current);try{var l=kt(t.triggerRef.current);if(l)return l}catch(e){}return ee.default.findDOMNode(Wt(t))})),St(Wt(t),"getPopupClassNameFromAlign",(function(e){var l=[],n=t.props,a=n.popupPlacement,r=n.builtinPlacements,i=n.prefixCls,o=n.alignPoint,s=n.getPopupClassNameFromAlign;return a&&r&&l.push(function(e,t,l,n){for(var a=l.points,r=Object.keys(e),i=0;i<r.length;i+=1){var o=r[i];if(Wi(e[o].points,a,n))return"".concat(t,"-placement-").concat(o)}return""}(r,i,e,o)),s&&l.push(s(e)),l.join(" ")})),St(Wt(t),"getComponent",(function(){var e=t.props,l=e.prefixCls,n=e.destroyPopupOnHide,a=e.popupClassName,r=e.onPopupAlign,i=e.popupMotion,o=e.popupAnimation,s=e.popupTransitionName,d=e.popupStyle,u=e.mask,c=e.maskAnimation,f=e.maskTransitionName,p=e.maskMotion,m=e.zIndex,h=e.popup,g=e.stretch,v=e.alignPoint,y=e.mobile,b=e.forceRender,x=e.onPopupClick,E=t.state,C=E.popupVisible,w=E.point,S=t.getPopupAlign(),N={};return t.isMouseEnterToShow()&&(N.onMouseEnter=t.onPopupMouseEnter),t.isMouseLeaveToHide()&&(N.onMouseLeave=t.onPopupMouseLeave),N.onMouseDown=t.onPopupMouseDown,N.onTouchStart=t.onPopupMouseDown,$.createElement(ms,Dl({prefixCls:l,destroyPopupOnHide:n,visible:C,point:v&&w,className:a,align:S,onAlign:r,animation:o,getClassNameFromAlign:t.getPopupClassNameFromAlign},N,{stretch:g,getRootDomNode:t.getRootDomNode,style:d,mask:u,zIndex:m,transitionName:s,maskAnimation:c,maskTransitionName:f,maskMotion:p,ref:t.popupRef,motion:i,mobile:y,forceRender:b,onClick:x}),"function"==typeof h?h():h)})),St(Wt(t),"attachParent",(function(e){Ol.cancel(t.attachId);var l,n=t.props,a=n.getPopupContainer,r=n.getDocument,i=t.getRootDomNode();a?(i||0===a.length)&&(l=a(i)):l=r(t.getRootDomNode()).body,l?l.appendChild(e):t.attachId=Ol((function(){t.attachParent(e)}))})),St(Wt(t),"getContainer",(function(){if(!t.portalContainer){var e=(0,t.props.getDocument)(t.getRootDomNode()).createElement("div");e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",t.portalContainer=e}return t.attachParent(t.portalContainer),t.portalContainer})),St(Wt(t),"setPoint",(function(e){t.props.alignPoint&&e&&t.setState({point:{pageX:e.pageX,pageY:e.pageY}})})),St(Wt(t),"handlePortalUpdate",(function(){t.state.prevPopupVisible!==t.state.popupVisible&&t.props.afterPopupVisibleChange(t.state.popupVisible)})),St(Wt(t),"triggerContextValue",{onPopupMouseDown:t.onPopupMouseDown}),a="popupVisible"in e?!!e.popupVisible:!!e.defaultPopupVisible,t.state={prevPopupVisible:a,popupVisible:a},bs.forEach((function(e){t["fire".concat(e)]=function(l){t.fireEvents(e,l)}})),t}return jt(n,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var e,t=this.props;if(this.state.popupVisible)return this.clickOutsideHandler||!this.isClickToHide()&&!this.isContextMenuToShow()||(e=t.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Vi(e,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(e=e||t.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Vi(e,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(e=e||t.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Vi(e,"scroll",this.onContextMenuClose)),void(!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Vi(window,"blur",this.onContextMenuClose)));this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),Ol.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var e;return(null===(e=this.popupRef.current)||void 0===e?void 0:e.getElement())||null}},{key:"getPopupAlign",value:function(){var e=this.props,t=e.popupPlacement,l=e.popupAlign,n=e.builtinPlacements;return t&&n?function(e,t,l){return Tt(Tt({},e[t]||{}),l)}(n,t,l):l}},{key:"setPopupVisible",value:function(e,t){var l=this.props.alignPoint,n=this.state.popupVisible;this.clearDelayTimer(),n!==e&&("popupVisible"in this.props||this.setState({popupVisible:e,prevPopupVisible:n}),this.props.onPopupVisibleChange(e)),l&&t&&e&&this.setPoint(t)}},{key:"delaySetPopupVisible",value:function(e,t,l){var n=this,a=1e3*t;if(this.clearDelayTimer(),a){var r=l?{pageX:l.pageX,pageY:l.pageY}:null;this.delayTimer=window.setTimeout((function(){n.setPopupVisible(e,r),n.clearDelayTimer()}),a)}else this.setPopupVisible(e,l)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(e){var t=this.props.children.props,l=this.props;return t[e]&&l[e]?this["fire".concat(e)]:t[e]||l[e]}},{key:"isClickToShow",value:function(){var e=this.props,t=e.action,l=e.showAction;return-1!==t.indexOf("click")||-1!==l.indexOf("click")}},{key:"isContextMenuOnly",value:function(){var e=this.props.action;return"contextMenu"===e||1===e.length&&"contextMenu"===e[0]}},{key:"isContextMenuToShow",value:function(){var e=this.props,t=e.action,l=e.showAction;return-1!==t.indexOf("contextMenu")||-1!==l.indexOf("contextMenu")}},{key:"isClickToHide",value:function(){var e=this.props,t=e.action,l=e.hideAction;return-1!==t.indexOf("click")||-1!==l.indexOf("click")}},{key:"isMouseEnterToShow",value:function(){var e=this.props,t=e.action,l=e.showAction;return-1!==t.indexOf("hover")||-1!==l.indexOf("mouseEnter")}},{key:"isMouseLeaveToHide",value:function(){var e=this.props,t=e.action,l=e.hideAction;return-1!==t.indexOf("hover")||-1!==l.indexOf("mouseLeave")}},{key:"isFocusToShow",value:function(){var e=this.props,t=e.action,l=e.showAction;return-1!==t.indexOf("focus")||-1!==l.indexOf("focus")}},{key:"isBlurToHide",value:function(){var e=this.props,t=e.action,l=e.hideAction;return-1!==t.indexOf("focus")||-1!==l.indexOf("blur")}},{key:"forcePopupAlign",value:function(){var e;this.state.popupVisible&&(null===(e=this.popupRef.current)||void 0===e||e.forceAlign())}},{key:"fireEvents",value:function(e,t){var l=this.props.children.props[e];l&&l(t);var n=this.props[e];n&&n(t)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var t=this.state.popupVisible,l=this.props,n=l.children,a=l.forceRender,r=l.alignPoint,i=l.className,o=l.autoDestroy,s=$.Children.only(n),d={key:"trigger"};this.isContextMenuToShow()?d.onContextMenu=this.onContextMenu:d.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(d.onClick=this.onClick,d.onMouseDown=this.onMouseDown,d.onTouchStart=this.onTouchStart):(d.onClick=this.createTwoChains("onClick"),d.onMouseDown=this.createTwoChains("onMouseDown"),d.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(d.onMouseEnter=this.onMouseEnter,r&&(d.onMouseMove=this.onMouseMove)):d.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?d.onMouseLeave=this.onMouseLeave:d.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(d.onFocus=this.onFocus,d.onBlur=this.onBlur):(d.onFocus=this.createTwoChains("onFocus"),d.onBlur=this.createTwoChains("onBlur"));var u=J.default(s&&s.props&&s.props.className,i);u&&(d.className=u);var c=Tt({},d);Dt(s)&&(c.ref=_t(this.triggerRef,s.ref));var f,p=$.cloneElement(s,c);return(t||this.popupRef.current||a)&&(f=$.createElement(e,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!t&&o&&(f=null),$.createElement(hs.Provider,{value:this.triggerContextValue},p,f)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var l=e.popupVisible,n={};return void 0!==l&&t.popupVisible!==l&&(n.popupVisible=l,n.prevPopupVisible=t.popupVisible),n}}]),n}();return St(t,"contextType",hs),St(t,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:vs,getDocument:ys,onPopupVisibleChange:gs,afterPopupVisibleChange:gs,onPopupAlign:gs,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1}),t}(zi);const Es=e=>{const{columns:t,onChange:n}=e,{prefixCls:a,$size:r}=q.default.useContext(ei),{t:i}=ot(),o=q.default.useRef([]),[s,u]=q.default.useState(!1),[c,f]=q.default.useState(t);Yl((()=>{m()}),[c]),q.default.useEffect((()=>{p()}),[t]);const p=()=>{const e=[];t.forEach(((l,n)=>{const a=l.colSpan;a>1&&t.slice(n+1,n+a).every((({colSpan:e})=>0===e))&&e.push(t.slice(n,n+a))})),o.current=e},m=()=>{const e=[];c.forEach((t=>{const{colSpan:l,dataIndex:n}=t;if(0===l)return;if(1===l)return e.push(t);const a=o.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(n)));if(-1===a)return e.push(t);e.push(...o.current[a].map((({dataIndex:e},l)=>{const n=c.find((t=>t.dataIndex===e));return l>0&&void 0!==t.hidden&&(n.hidden=t.hidden),n})))})),null==n||n(e)},h={[`${a}__popper`]:!0,"column-filter__popper":!0,[`${a}--lg`]:"large"===r,[`${a}--sm`]:"small"===r},v=[`${a}-column-filter`,{selected:s}];return q.default.createElement(xs,{action:["click"],popupVisible:s,popup:q.default.createElement("div",{className:"column-filter--wrap",style:{overflowY:"auto",maxHeight:"calc(100vh - 10px)"}},q.default.createElement("div",{className:"main"},q.default.createElement(I.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:c,setList:e=>{const t=e.map((e=>e.dataIndex)),n=c.map((e=>e.dataIndex));l.isEqual(t,n)||f(Ya(e))}},c.map((e=>((e,t)=>{const{colSpan:l}=e;if(0===l)return q.default.createElement("li",{key:e.dataIndex,style:{display:"none"}});const n=["svgicon","handle",`${t}-handle`];return q.default.createElement("li",{key:e.dataIndex,className:"item"},q.default.createElement(d.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:l}=t.target;e.hidden=!l,f([...c])}}),q.default.createElement("i",{className:J.default(n),title:i("qm.table.columnFilter.draggable")},q.default.createElement(g.HolderOutlined,null)),q.default.createElement("span",{className:"text"},ja(e.title)))})(e,"main")))))),popupClassName:J.default(h),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{u(e)},builtinPlacements:di,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement("span",{className:J.default(v),title:i("qm.table.columnFilter.text")},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.SettingOutlined,null)),q.default.createElement("span",null,i("qm.table.columnFilter.text"))))},Cs=e=>{const{defaultValue:t,onClose:l,onOk:n}=e,{tableRef:a,prefixCls:r,selectionKeys:i,pagination:o,showSummary:s}=q.default.useContext(ei),{rowSelection:d}=a.current.props,{t:u}=ot(),c=q.default.useRef(null),[f,p]=q.default.useState(!1),m=q.default.useMemo((()=>Object.assign({},{fileName:`${j.default().format(si)}.xlsx`,fileType:"xlsx",sheetName:"sheet1",exportType:i.length?"selected":"all","startIndex|endIndex":[1,o.total],footSummation:s?1:0,useStyle:0},t,{columns:qe(t.columns||[])})),[]),[h,g]=q.default.useState([{type:"INPUT",label:u("qm.table.export.fileName"),fieldName:"fileName"},{type:"SELECT",label:u("qm.table.export.fileType"),fieldName:"fileType",options:{itemList:[{text:"xlsx",value:"xlsx"},{text:"csv",value:"csv"}]}},{type:"INPUT",label:u("qm.table.export.sheetName"),fieldName:"sheetName"},{type:"RANGE_INPUT_NUMBER",fieldName:"startIndex|endIndex",label:{type:"SELECT",fieldName:"exportType",options:{itemList:[{text:u("qm.table.export.all"),value:"all"},{text:u("qm.table.export.selected"),value:"selected",disabled:"checkbox"!==(null==d?void 0:d.type)},{text:u("qm.table.export.custom"),value:"custom"}]},onChange:e=>{h.find((e=>"startIndex|endIndex"===e.fieldName)).disabled="custom"!==e,g([...h])}},options:{min:1},disabled:!0},{type:"INPUT",label:u("qm.table.columnFilter.text"),fieldName:"columns",render:(e,t)=>q.default.createElement(Es,{columns:t.state.formData.columns,onChange:e=>{t.SET_FIELDS_VALUE({columns:e})}})},{type:"CHECKBOX",label:u("qm.table.export.footSummation"),fieldName:"footSummation",disabled:!s,options:{trueValue:1,falseValue:0}},{type:"CHECKBOX",label:u("qm.table.export.useStyle"),fieldName:"useStyle",options:{trueValue:1,falseValue:0}}]);return q.default.createElement("div",{className:`${r}-export__setting`},q.default.createElement(ap,{ref:c,initialValues:m,items:h,cols:1,labelWidth:100}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(pt,{onClick:()=>l(),style:{marginRight:8}},u("qm.table.export.closeButton")),q.default.createElement(pt,{type:"primary",loading:f,onClick:()=>Ie(void 0,void 0,void 0,(function*(){const[e,t]=yield c.current.GET_FORM_DATA();if(!e){p(!0);for(const e in t)"footSummation"!==e&&"useStyle"!==e||(t[e]=!!t[e]);n(t),yield Ae(1e3),p(!1),l()}}))},u("qm.table.export.text"))))},ws=q.default.forwardRef(((e,t)=>{var n;const{tableColumns:a,open:r=!0}=e,{global:i}=q.default.useContext(xe),{tableRef:o,prefixCls:s,flattenColumns:u,pagination:c,fetchParams:f,isFetch:p,showSummary:m,getSpan:h}=q.default.useContext(ei),{exportExcel:v,columns:y,fetch:b,showHeader:x}=o.current.props,{t:E}=ot(),{getTitleFromCellValue:C}=Oi(),[w,S]=q.default.useState(!1),[N,T]=q.default.useState(!1),I=q.default.useMemo((()=>{var e;return!!(null===(e=null==v?void 0:v.fetch)||void 0===e?void 0:e.api)}),[v]),O=q.default.useMemo((()=>!c.total||N),[c.total,N]),R=q.default.useMemo((()=>{const e=Ea(y.filter((e=>!e.noAuth)),[bi.expandableColumn,bi.selectionColumn,bi.operationColumn]),t=[],l=[],n=[];return e.forEach((e=>{const r=a.find((t=>t.dataIndex===e.dataIndex));"left"===e.fixed?t.push(r||e):"right"===e.fixed?l.push(r||e):n.push(r||e)})),[...t,...n,...l]}),[a]),k=q.default.useMemo((()=>Ea(u,[bi.expandableColumn,bi.selectionColumn,bi.operationColumn])),[u]),L=(e,t="",l=0)=>e.map(((e,n)=>{const a=Object.assign(Object.assign({},e),{index:n,pageIndex:n}),r=t?`${t}.${a.index+1}`:`${a.index+1}`;return a.indexPath=r,a._level=l,Array.isArray(e.children)&&(a.children=L(e.children,r,l+1)),k.forEach((e=>{const{dataIndex:t}=e;"index"!==t&&"pageIndex"!==t&&"indexPath"!==t&&Aa(a,t,Pa(a,t))})),a})),P=(e,t)=>{const l={};return e.filter((e=>!!e.summation)).forEach((e=>{const{dataIndex:n}=e,a=t.reduce(((e,t)=>{if(null==t?void 0:t[bi.summaryIgnore])return e;const l=Number(Pa(t,n));return Number.isNaN(l)?e:e+l}),0);Aa(l,n,a)})),[l]},A=(e,t,l,n)=>{const{dataIndex:a,precision:r,formatType:i,outputRender:o}=l;if(o)return o(Pa(e,a),e,l,t,n);let s=C(e,l,t,n);return r>=0&&!i&&""!==s&&(s=Number(s)),s},{exportXLSX:F,exportCSV:_}=Hi(),D=e=>Ie(void 0,void 0,void 0,(function*(){var t;const{api:n,formatter:a=(e=>e),afterFetch:r,dataKey:i}=b;let o=[];try{T(!0);const s={[bi.currentPageName]:1,[bi.pageSizeName]:null!=e?e:c.total},d=yield n(Object.assign(Object.assign({},a(Object.assign(Object.assign({},f),s))),s));if(200===d.code){let e=Array.isArray(d.data)?d.data:null!==(t=l.get(d.data,i))&&void 0!==t?t:[];e="function"==typeof r?yield r(e):e,o=L(e)}}catch(e){}return T(!1),o})),M=e=>{var t;const l=null===(t=null==i?void 0:i.table)||void 0===t?void 0:t.recordExportLog;try{null==l||l({fileName:e})}catch(e){}},H=(e,t)=>{const{columns:l,footSummation:n}=e,a=pa(l);let r='<table width="100%" border="0" cellspacing="0" cellpadding="0">';return r+=`<colgroup>${a.map((({width:e,renderWidth:t})=>`<col style="width:${e||t}px">`)).join("")}</colgroup>`,x&&(r+=["<thead>","<tr>",a.map((e=>{const{rowSpan:t,colSpan:l}=e;return 0===l?null:`<th colspan="${l}" rowspan="${t}">${ja(e.title)}</th>`})).join(""),"</tr>","</thead>"].join("")),t.length&&(r+=`<tbody>${Ca(t).map((e=>`<tr>${a.map(((l,n)=>{var a;const{rowSpan:r,colSpan:i}=h(e,l,e.index,n,t);if(!r||!i)return null;const o=A(e,e.index,l,n);return`<td rowspan="${r}" colspan="${i}" data-type="${$(o,null===(a=l.filter)||void 0===a?void 0:a.type)}">${o}</td>`})).join("")}</tr>`)).join("")}</tbody>`),m&&n&&(r+=["<tfoot>",P(a,t).map((e=>`<tr>${a.map(((l,n)=>{const{dataIndex:a,summation:r}=l,i=(null==r?void 0:r.render)?r.render(t):Pa(e,a);return`<td>${0===n&&""===i?E("qm.table.config.summaryText"):Re(i)?ja(i):i}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),r+="</table>",r},$=(e,t)=>{const l={text:"string",textarea:"string",number:"number",date:"date"};return t&&l[t]?l[t]:typeof e},K=null!==(n=null==v?void 0:v.fileName)&&void 0!==n?n:`${j.default().format(si)}.xlsx`,V=K.slice(K.lastIndexOf(".")+1).toLowerCase(),z=()=>{if(O)return d.message.warning(E("qm.table.export.warnText"));var e;I?(e=K,Ie(void 0,void 0,void 0,(function*(){T(!0);try{const{api:t,params:l}=v.fetch,n=yield t(Object.assign(Object.assign(Object.assign({columns:k.map((e=>{const{title:t,dataIndex:l,hidden:n}=e,{type:a}=e.filter||{};return{title:t,dataIndex:l,type:a,hidden:n}}))},f),l),{tsortby:void 0,tsummary:void 0,tgroupby:void 0,[bi.currentPageName]:void 0,[bi.pageSizeName]:void 0}));n.data&&(Dn(n.data,e),M(e))}catch(e){}T(!1)}))):S(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:z})));const W={[`${s}-export`]:!0},B={visible:w,title:E("qm.table.export.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>S(!1)},U={fileName:K.slice(0,K.lastIndexOf(".")),fileType:V,columns:R,useStyle:(null==v?void 0:v.cellStyle)?1:0};return q.default.createElement(q.default.Fragment,null,r&&q.default.createElement("span",{className:J.default(W),title:E("qm.table.export.textNoSpace"),onClick:()=>z()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.DownloadOutlined,null))),q.default.createElement(Qn,B,q.default.createElement(Cs,{defaultValue:U,onClose:()=>S(!1),onOk:e=>{var t;t=Object.assign({},e,{columns:ma(e.columns)}),Ie(void 0,void 0,void 0,(function*(){const{fileName:e,fileType:l,exportType:n,startIndex:a=1,endIndex:r}=t,{tableFullData:i,selectionRows:s}=o.current;let d=[];if(p?("all"===n&&(d=yield D()),"custom"===n&&(d=yield D(r),d=d.slice(a-1))):("all"===n&&(d=i.slice(0)),"custom"===n&&(d=i.slice(a-1,r||void 0))),"selected"===n&&(d=s.slice(0).sort(((e,t)=>e.pageIndex-t.pageIndex))),"function"==typeof(null==v?void 0:v.beforeExport))try{d=null==v?void 0:v.beforeExport(d)}catch(e){}if("xlsx"===l){const l=yield F(t,d,P,A);Dn(l,`${e}.xlsx`),M(`${e}.xlsx`)}if("csv"===l){const l=_(t,H(t,d));Dn(l,`${e}.csv`),M(`${e}.csv`)}}))}})))}));ws.displayName="TableExport";const Ss=e=>{const{columns:t,onClose:l}=e,{tableRef:n,tableBodyRef:a,prefixCls:r,dataChange:i}=q.default.useContext(ei),{beforeClipboard:o}=n.current.props,{t:s}=ot(),u=q.default.useRef(null),[c,f]=q.default.useState([{type:"INPUT_NUMBER",label:s("qm.table.clipboard.rowIndex"),fieldName:"rowIndex",options:{min:1},extra:{labelWidth:50},rules:[{required:!0}]},{type:"SELECT",label:s("qm.table.clipboard.colIndex"),fieldName:"colIndex",options:{itemList:t.map(((e,t)=>({value:t,text:ja(e.title)})))},rules:[{required:!0}],extra:{labelWidth:50}},{type:"TEXT_AREA",label:s("qm.table.clipboard.content"),fieldName:"content",placeholder:s("qm.table.clipboard.placeholder"),options:{autoSize:{minRows:4}},rules:[{required:!0}]}]),[p,m]=q.default.useState(!1);return q.default.createElement("div",{className:`${r}-clipboard__setting`},q.default.createElement("h3",{className:"info"},s("qm.table.clipboard.supportText")),q.default.createElement(ap,{ref:u,initialValues:{},initialExtras:{rowIndex:"行",colIndex:"列"},items:c,cols:1,labelWidth:100}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(pt,{onClick:()=>l(),style:{marginRight:8}},s("qm.table.export.closeButton")),q.default.createElement(pt,{type:"primary",loading:p,onClick:()=>Ie(void 0,void 0,void 0,(function*(){var e;const[r,c]=yield u.current.GET_FORM_DATA();if(r)return;const{tableFullData:f,store:p,fieldAuth:h}=n.current;m(!0);const g=c.content.trim().replace(/(\r|\n)$/,"");let v=g.replace(/"[^"]+"/g,"^");((null===(e=g.match(/"[^"]+"/g))||void 0===e?void 0:e.map((e=>e.replace(/"/g,"").replace(/\r|\n/g," "))))||[]).forEach((e=>{v=v.replace(/\^/,e)}));let y=v.split(/\r|\n/).map((e=>e.split(/\t/)));if("function"==typeof o)try{y=yield o(y,y[0].map(((e,l)=>t[c.colIndex+l].dataIndex)))}catch(r){}y.forEach(((e,l)=>{e.forEach(((e,n)=>{var a,r;const i=f[c.rowIndex-1+l],o=t[c.colIndex+n];if(i&&o){let t=!1;if(o.editRender){const e=o.editRender(i,o);t=!(e.disabled||(null===(a=e.extra)||void 0===a?void 0:a.disabled)||(null===(r=h[o.dataIndex])||void 0===r?void 0:r.disabled))}t&&o.dictItems&&(t=o.dictItems.some((t=>t.value==e))),t&&(Aa(i,o.dataIndex,e),p.addToUpdated(i))}}))})),a.current.forceUpdate(),i(),d.message.success(s("qm.table.clipboard.success",{total:y.length})),m(!1),l()}))},s("qm.table.clipboard.text"))))},Ns=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{prefixCls:n,flattenColumns:a}=q.default.useContext(ei),{t:r}=ot(),[i,o]=q.default.useState(!1),s=q.default.useMemo((()=>(e=>e.filter((e=>![bi.expandableColumn,bi.selectionColumn,"index","pageIndex",bi.operationColumn].includes(e.dataIndex))))(a)),[a]),d=()=>{o(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:d})));const u={[`${n}-clipboard`]:!0},c={visible:i,title:r("qm.table.clipboard.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>o(!1)};return q.default.createElement(q.default.Fragment,null,l&&q.default.createElement("span",{className:J.default(u),title:r("qm.table.clipboard.textNoSpace"),onClick:()=>d()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.CopyOutlined,null))),q.default.createElement(Qn,c,q.default.createElement(Ss,{columns:s,onClose:()=>o(!1)})))}));Ns.displayName="TableClipboard";const Ts=e=>{const{columns:t,onClose:l}=e,{tableRef:n,$size:a,selectionKeys:r,setSelectionKeysEffect:i}=q.default.useContext(ei),{rowKey:o,rowSelection:s}=n.current.props,{t:d}=ot(),u=q.default.useRef(null),c=xn(u),f=e=>e.map((e=>{var t;const l={dataIndex:e.dataIndex,title:e.title,width:e.width,minWidth:e.minWidth,precision:e.precision,dictItems:null!==(t=e.dictItems)&&void 0!==t?t:[],render:e.render};return Array.isArray(e.children)&&(l.children=f(e.children)),l})),[p,m]=q.default.useState([{title:d("qm.table.groupSummary.index"),dataIndex:"index",width:80,render:e=>e+1},...f(t.filter((e=>![bi.expandableColumn,bi.selectionColumn,"index","pageIndex",bi.operationColumn].includes(e.dataIndex))))]),[h]=q.default.useState((()=>{const{disabled:e}=s||{},t=n.current.selectionRows.map((e=>Object.assign(Object.assign({},e),{children:void 0})));return e?t.filter((t=>!e(t))):t})()),[g,v]=q.default.useState(300),y=wn((()=>{const e=u.current;v(e.offsetHeight-2*Jr[a]-30)}),5);return Cn((()=>{y()}),[c.width]),q.default.createElement("div",{ref:u,style:{height:"100%"}},q.default.createElement(wc,{size:a,columns:p,dataSource:h,rowKey:o,height:g,rowSelection:{type:"checkbox",selectedRowKeys:r,onChange:e=>i(e)},webPagination:!0,ignorePageIndex:!0,showFastSearch:!1,showTableImport:!1,showSelectCollection:!1,showClipboard:!1,showFullScreen:!1,showColumnDefine:!1,columnsChange:e=>m(e)}),q.default.createElement("div",{style:{height:10}}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(pt,{onClick:()=>l()},d("qm.table.selectCollection.closeButton"))))},Is=q.default.forwardRef(((e,t)=>{const{columns:n,open:a=!0}=e,{tableRef:r,getRowKey:i,prefixCls:o,selectionKeys:s,isFetch:d,isTableEmpty:u,setSelectionKeysEffect:c,setSelectionRows:f}=q.default.useContext(ei),{rowSelection:p}=r.current.props,{t:m}=ot(),[h,v]=q.default.useState(!1),y=q.default.useRef(!1);Yl((()=>{!y.current&&b()}),[u]);const b=()=>Ie(void 0,void 0,void 0,(function*(){var e;const{fetchSelectedRows:t,disabled:n=(e=>!1)}=p;if(d&&t)try{const a=yield t.api(Object.assign({},{selectedKeys:s},t.params));if(200===a.code){let r=Array.isArray(a.data)?a.data:null!==(e=l.get(a.data,t.dataKey))&&void 0!==e?e:[];r=r.filter((e=>!n(e))),c(r.map(((e,t)=>i(e,t)))),f(r),y.current=!0}}catch(e){}})),x=()=>{v(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:x})));const E={visible:h,title:m("qm.table.selectCollection.settingTitle"),loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>v(!1)};return q.default.createElement(q.default.Fragment,null,a&&q.default.createElement("span",{className:`${o}-select-collection`,title:m("qm.table.selectCollection.text"),onClick:()=>x()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.CheckSquareOutlined,null))),q.default.createElement(Qn,E,q.default.createElement(Ts,{columns:n,onClose:()=>v(!1)})))}));Is.displayName="SelectCollection";const Os=e=>{const{onClose:t}=e,{global:l}=q.default.useContext(xe),{tableRef:n,getRowKey:a,prefixCls:r,$size:i,tableFlatData:o,flattenColumns:s,setActivedCell:u,scrollXToColumn:c,scrollYToRecord:f}=q.default.useContext(ei),{uniqueKey:p}=n.current.props,{t:m}=ot(),{getTitleFromCellValue:h}=Oi(),v=q.default.useRef(""),[y,b]=q.default.useState(""),[x,E]=q.default.useState([]),[C,w]=q.default.useState(0),[S,N]=q.default.useState(!1),[T,I]=q.default.useState({case:0,fullchar:0}),O=q.default.useMemo((()=>`${x.length>0?C+1:C}/${x.length}`),[C,x]);Yl((()=>{A(x[C])}),[C,x]);const R=e=>{I(Object.assign({},T,e))},k=(e,t,l)=>new Promise(((n,a)=>{d.Modal.confirm({title:m("qm.button.confirmPrompt"),content:e,onOk:()=>{t(),n()},onCancel:()=>{l(),n()}})})),L=st((e=>Ie(void 0,void 0,void 0,(function*(){if(!y)return v.current=y,P();const t=((e,t)=>{const l=new RegExp(T.fullchar?`^${t}$`:t,T.case?"":"i"),n=[];return e.forEach(((e,t)=>{s.forEach(((r,i)=>{const{dataIndex:o}=r;if([bi.expandableColumn,bi.selectionColumn,"index","pageIndex",bi.operationColumn].includes(o))return;const s=h(e,r,e.index,i);l.test(s)&&n.push({value:s,rowKey:a(e,e.index),dataIndex:o,rowIndex:t,colIndex:i})}))})),n})(o,y);if(!t.length)return d.Modal.warning({title:m("qm.button.confirmPrompt"),content:m("qm.table.fastSearch.notMatch")});if(E(t),"all"===e&&N(!0),y!==v.current)return v.current=y,w(0);if("next"===e){const e=C+1;e>t.length-1?yield k(m("qm.table.fastSearch.toTheEnd"),(()=>w(0)),(()=>{})):w(e)}if("prev"===e){const e=C-1;e<0?yield k(m("qm.table.fastSearch.toStart"),(()=>w(t.length-1)),(()=>{})):w(e)}})))),P=()=>{w(0),E([]),u({})},A=e=>{e&&(f(e.rowKey),c(e.dataIndex),u(e))},F=q.default.useMemo((()=>p?`fastSearch_${p}`:""),[p]),[_,D]=q.default.useState([]),[M,H]=q.default.useState(""),[$,j]=q.default.useState("");Yl((()=>{if($){const{input:e,config:t}=_.find((e=>e.value===$)).condition;b(e),I(t),setTimeout((()=>L()))}}),[$]),q.default.useEffect((()=>{K()}),[]);const K=()=>Ie(void 0,void 0,void 0,(function*(){if(!F)return;let e=yield pe.default.getItem(F);e||(e=yield V(F),Array.isArray(e)&&(yield pe.default.setItem(F,e))),Array.isArray(e)&&e.length&&D(e)})),V=e=>Ie(void 0,void 0,void 0,(function*(){const t=null==l?void 0:l.getComponentConfigApi;if(t)try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),z=(e,t)=>Ie(void 0,void 0,void 0,(function*(){const n=null==l?void 0:l.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}}));return q.default.createElement("div",{className:`${r}-fast-search__setting`},q.default.createElement("div",{className:"main"},q.default.createElement("div",{className:"container"},q.default.createElement("div",{className:"search-box"},q.default.createElement("span",{className:"label"},m("qm.table.fastSearch.queryLabel"),":"),q.default.createElement(d.Input,{value:y,placeholder:m("qm.table.fastSearch.queryCondition"),allowClear:!0,style:{flex:"auto",width:"auto"},onChange:e=>b(e.target.value)})),q.default.createElement("div",{className:"condition"},q.default.createElement(d.Checkbox,{checked:!!T.case,onChange:e=>R({case:e.target.checked})},m("qm.table.fastSearch.matchCase")),q.default.createElement(d.Checkbox,{checked:!!T.fullchar,onChange:e=>R({fullchar:e.target.checked})},m("qm.table.fastSearch.matchFullchar"))),q.default.createElement("div",{className:"all-list"},S&&q.default.createElement("table",{className:"rtable",tabIndex:-1,cellSpacing:"0",cellPadding:"0"},q.default.createElement("thead",null,q.default.createElement("tr",null,q.default.createElement("th",{style:{width:40,minWidth:40}},"#"),q.default.createElement("th",{style:{width:130,minWidth:130}},m("qm.table.fastSearch.cellText")),q.default.createElement("th",null,m("qm.table.fastSearch.valText")))),q.default.createElement("tbody",null,x.map(((e,t)=>q.default.createElement("tr",{key:t,className:J.default({active:C===t}),onClick:()=>w(t)},q.default.createElement("td",null,t+1),q.default.createElement("td",null,"Row:",e.rowIndex+1,", Col:",e.colIndex+1),q.default.createElement("td",null,e.value)))))))),q.default.createElement("div",{className:"saved line"},q.default.createElement("div",{className:"form-wrap"},q.default.createElement(d.Input,{size:i,value:M,placeholder:m("qm.table.highSearch.configText"),disabled:!y,onChange:e=>{const{value:t}=e.target;H(t)}}),q.default.createElement(pt,{type:"primary",disabled:!M||!y,style:{marginLeft:"10px"},onClick:()=>Ie(void 0,void 0,void 0,(function*(){if(!F)return ft("Table","必须设置组件参数 `uniqueKey` 才能保存");if(!y)return;const e=$a(),t=[..._,{text:M,value:e,condition:{input:y,config:T}}];D(t),H(""),yield pe.default.setItem(F,t),yield z(F,t)}))},m("qm.table.highSearch.saveButton"))),q.default.createElement("div",{className:"card-wrap"},q.default.createElement("h5",{style:{height:`${bi.rowHeightMaps[i]}px`}},q.default.createElement("span",null,m("qm.table.fastSearch.savedSetting"))),q.default.createElement("ul",null,_.map((e=>q.default.createElement("li",{key:e.value,className:J.default({selected:e.value===$}),title:e.text,onClick:()=>{return t=e.value,void j(t!==$?t:"");var t}},q.default.createElement("span",{className:"title"},e.text),q.default.createElement("i",{className:"svgicon close",title:m("qm.table.highSearch.removeText"),onClick:t=>{var l;t.stopPropagation(),l=e.value,Ie(void 0,void 0,void 0,(function*(){if(!l)return;const e=_.filter((e=>e.value!==l));D(e),yield pe.default.setItem(F,e),yield z(F,e)}))}},q.default.createElement(g.CloseCircleOutlined,null))))),!_.length&&q.default.createElement("div",{style:{padding:ni}},q.default.createElement(pn,null)))))),q.default.createElement("div",{className:"bottom-bar",style:{position:"absolute",left:0,bottom:0,right:0,height:`${Jr[i]+20}px`,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",boxSizing:"border-box"}},q.default.createElement("div",null,m("qm.table.fastSearch.findTotal",{total:O})),q.default.createElement("div",null,q.default.createElement(pt,{onClick:()=>L("all"),style:{marginRight:8}},m("qm.table.fastSearch.queryAll")),q.default.createElement(pt,{type:"primary",onClick:()=>L("prev"),style:{marginRight:8}},m("qm.table.fastSearch.queryPrev")),q.default.createElement(pt,{type:"primary",onClick:()=>L("next"),style:{marginRight:8}},m("qm.table.fastSearch.queryNext")),q.default.createElement(pt,{onClick:()=>t()},m("qm.table.fastSearch.closeButton")))))},Rs=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{prefixCls:n,$size:a}=q.default.useContext(ei),{t:r}=ot(),[i,o]=q.default.useState(!1),s=()=>{o(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:s})));const d={visible:i,title:r("qm.table.fastSearch.settingTitle"),width:650,loading:!1,bodyStyle:{paddingBottom:`${Jr[a]+20}px`},onClose:()=>o(!1)};return q.default.createElement(q.default.Fragment,null,l&&q.default.createElement("span",{className:`${n}-super-search`,title:r("qm.table.fastSearch.text"),onClick:()=>s()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.MonitorOutlined,null))),q.default.createElement(Qn,d,q.default.createElement(Os,{onClose:()=>o(!1)})))}));Rs.displayName="FastSearch";var ks={selectionColumnDefine:{title:"",dataIndex:"__selection__",width:60,fixed:"left"},indentWidth:16,groupMargin:15,separator:"^"};const Ls=e=>[ks.selectionColumnDefine,...e].filter((e=>!e.hidden)),Ps=e=>e.some((e=>Array.isArray(e.children))),As=e=>void 0!==e._groupLevel,Fs=(e,t)=>t.split(ks.separator).reduce(((e,t)=>null==e?void 0:e[t]),e),_s=e=>Array.isArray(e)?0:"object"==typeof e&&null!==e?1+Math.max(0,...Object.values(e).map(_s)):0,Ds=(e,t="")=>Array.isArray(e)?[]:Object.keys(e).reduce(((l,n)=>{const a=t?`${t}${ks.separator}${n}`:n;if(l.push(a),Array.isArray(e[n]))return l;const r=Ds(e[n],a);return l.concat(r)}),[]),Ms=(e,t=[],l)=>{const n=(e,t)=>{if(0===t.length)return e;const[{[Object.keys(t[0])[0]]:a}]=t,r=Object.keys(t[0])[0],i=t.slice(1),o=Object.groupBy(e,(e=>l(e,r))),s=Object.keys(o).sort(((e,t)=>{const l=(n=e,r=t,Number.isNaN(n-r)?n.toString().localeCompare(r.toString()):n-r);var n,r;return"ascend"===a?l:-l})),d={};return s.forEach((e=>{d[`#${e}`]=n(o[e],i)})),d};return n(e,t)},Hs={sum:e=>e.reduce(((e,t)=>isNaN(Number(t))?e:e+Number(t)),0),avg:e=>e.length?(e.reduce(((e,t)=>isNaN(Number(t))?e:e+Number(t)),0)/e.length).toFixed(2):"",max:e=>e.length?Math.max(...e):"",min:e=>e.length?Math.min(...e):"",count:e=>e.length,unique:e=>new Set(e).size,empty:e=>e.filter((e=>De(e))).length,notEmpty:e=>e.filter((e=>!De(e))).length},qs=q.default.createContext(void 0),$s=e=>{const{prefixCls:t,pivotProps:l,size:n,getRowKey:a,flatColumns:r,tableData:i}=e,{initialGroup:o,initialCount:s,initialFilter:d,initialSorter:u}=l,c=e=>{const t=new Map;return Ca(e).forEach((e=>t.set(a(e,e.index),e))),t},f=q.default.useRef({props:l,originGridData:i,flatGroupData:[],isTree:Ps(i),keyRecordMap:c(i)}),[p,m]=q.default.useState({pivotRef:f,prefixCls:t,size:n,viewMode:"table",columns:r,gridData:i,groupGridData:[],groupList:o?(e=>{const t=[],l=r.map((e=>e.dataIndex));return e.forEach((e=>{l.includes(e.fieldName)&&["ascend","descend"].includes(e.order)&&t.push(e)})),t})(o):[],filterList:d?(e=>{const t=[],l=r.map((e=>e.dataIndex));for(const n in e){const[a,r]=n.split("|");if(l.includes(a)&&r){const l=e[n]||{};Object.keys(l).forEach((e=>{t.push({type:r,bracketLeft:"",fieldName:a,expression:e,value:Za(e)?null:l[e],bracketRight:"",logic:"and"})}))}}return t})(d):[],sorterList:u?(e=>{const t=[],l=r.map((e=>e.dataIndex));for(const n in e)l.includes(n)&&["ascend","descend"].includes(e[n])&&t.push({fieldName:n,order:e[n]});return t})(u):[],colorList:[],expandedKeys:[],searchResults:[],switchIndex:0,fillColorCells:new Map,countMethod:s?(e=>{const t=["count","unique","empty","notEmpty","sum","max","min","avg"],l=r.map((e=>e.dataIndex)),n={};for(const a in e)l.includes(a)&&t.includes(e[a])&&(n[a]=e[a]);return n})(s):{},summationData:{}}),h=e=>{m((t=>{const l=Object.assign({},t);let n=!1;return Object.keys(e).forEach((a=>{const r=a;Object.is(t[r],e[r])||(l[r]=e[r],n=!0)})),n?l:t}))};Cn((()=>{y(i),g("originGridData",i),g("isTree",Ps(i)),g("keyRecordMap",c(i))}),[i]),Cn((()=>{v(r)}),[r]),Cn((()=>{h({size:n})}),[n]);const g=(e,t)=>{p.pivotRef.current[e]=t};g("props",l);const v=e=>{h({columns:e})},y=e=>{h({gridData:e})},b=e=>{h({groupGridData:e})},x=e=>{h({groupList:e})},E=e=>{h({filterList:e})},C=e=>{h({sorterList:e})},w=e=>{h({colorList:e})},S=e=>{h({expandedKeys:e})},N=e=>{h({searchResults:e})},T=e=>{h({switchIndex:e})},I=e=>{const t=new Map;e.forEach((e=>t.set(`${e.rowKey}|${e.dataIndex}`,e.color))),h({fillColorCells:t})},O=e=>{var t;h({countMethod:(t=Object.assign({},p.countMethod,e),Object.fromEntries(Object.entries(t).filter((([e,t])=>void 0!==t))))})},R=e=>{h({summationData:e})},k=q.default.useMemo((()=>Object.assign(Object.assign({},p),{setContext:h,getRowKey:a,setPivotGridRef:g,setColumns:v,setGridData:y,setGroupGridData:b,setGroupList:x,setFilterList:E,setSorterList:C,setColorList:w,setExpandedKeys:S,setSearchResults:N,setSwitchIndex:T,setFillColor:I,setCountMethod:O,setSummationData:R})),[p]);return q.default.createElement(qs.Provider,{value:k},e.children)},js=()=>q.default.useContext(qs),Ks=()=>{const{prefixCls:e,pivotRef:t,groupList:n,columns:a,gridData:r,setGroupList:i,setExpandedKeys:o,setGroupGridData:s,setPivotGridRef:u}=js(),{originGridData:c}=t.current,{onGroupChange:f,onDataChange:p}=t.current.props,{t:m}=ot(),h=q.default.useRef([]),v=q.default.useRef([]),y=q.default.useMemo((()=>n.filter((e=>e.fieldName&&e.order))),[n]),b=q.default.useMemo((()=>a.filter((e=>![bi.operationColumn].includes(e.dataIndex))).map((e=>({label:ja(e.title),value:e.dataIndex,disabled:n.some((t=>t.fieldName===e.dataIndex))})))),[n,a]),x=q.default.useMemo((()=>{const e=y.map((e=>({[e.fieldName]:e.order})));return l.isEqual(e,h.current)?h.current:(h.current=e,e)}),[y]),E=[{label:m("qm.pivotGrid.group.ascend"),value:"ascend"},{label:m("qm.pivotGrid.group.descend"),value:"descend"}];q.default.useEffect((()=>{o(v.current)}),[x,c]),q.default.useLayoutEffect((()=>{const e=Ms(r,x,((e,t)=>{let n=Pa(e,t);return l.isPlainObject(n)&&(n=Object.values(n)),Array.isArray(n)&&(n=n.join(",")),De(n)?m("qm.pivotGrid.group.empty"):n}));var t;s(e),t=Ds(e),v.current=t,u("flatGroupData",((e,t=[])=>{const l=[];return function e(n,a,r=""){if(Array.isArray(n))n.forEach(((e,t)=>{e._varIndex=t,r?e._parentRowKey=r:delete e._parentRowKey})),l.push(...Ca(n));else for(const i in n){const o=r?`${r}${ks.separator}${i}`:i,s=Object.keys(t[a])[0];l.push({id:o,_fieldName:s,_groupLevel:a}),e(n[i],a+1,o)}}(e,0),l})(e,x))}),[x,r]),Yl((()=>{null==f||f(y)}),[x]),Yl((()=>{null==p||p(r)}),[r]);const C=()=>{i([...n,{fieldName:"",order:"ascend"}])},w=(e,t,l)=>{Object.assign(t,{[e]:l}),i([...n])},S=e=>q.default.createElement(q.default.Fragment,null,q.default.createElement(g.HolderOutlined,{className:"icon handle"}),q.default.createElement(d.Select,{value:e.fieldName||void 0,placeholder:m("qm.table.editable.selectPlaceholder"),options:b,style:{width:160,margin:"0 10px"},onChange:t=>w("fieldName",e,t)}),q.default.createElement(d.Select,{value:e.order,options:E,placeholder:m("qm.table.editable.selectPlaceholder"),style:{width:100},onChange:t=>w("order",e,t)}),q.default.createElement(g.CloseOutlined,{className:"icon close",onClick:()=>(e=>{i(n.filter((t=>t!==e)))})(e)}));return q.default.createElement(d.Dropdown,{trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container")},q.default.createElement("div",{className:"label"},q.default.createElement("span",null,m("qm.pivotGrid.group.title")),!!y.length&&q.default.createElement("div",null,q.default.createElement("button",{className:"button-icon no-hover-bg",onClick:()=>o([])},m("qm.pivotGrid.group.foldAll")),q.default.createElement("button",{className:"button-icon no-hover-bg",onClick:()=>o(v.current)},m("qm.pivotGrid.group.unfoldAll")))),q.default.createElement("div",{className:"list"},q.default.createElement(I.ReactSortable,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:n,setList:e=>{const t=e.map((e=>e.fieldName)),a=n.map((e=>e.fieldName));l.isEqual(t,a)||i(e)}},n.map(((e,t)=>q.default.createElement("li",{key:`${e.fieldName}-${t}`,className:"item"},S(e)))))),q.default.createElement("div",{className:"add-record"},q.default.createElement("span",{className:"insert",onClick:C},q.default.createElement(g.PlusOutlined,{className:"icon"}),m("qm.pivotGrid.fillColor.add")))),className:J.default("action-btn",{active:!!y.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},q.default.createElement("span",null,q.default.createElement(g.FolderOpenOutlined,{className:"icon"}),m("qm.pivotGrid.group.text"),y.length?`(${y.length})`:null))},Vs=()=>{const{prefixCls:e,pivotRef:t,columns:n,filterList:a,setFilterList:r,setGridData:i}=js(),{originGridData:o,isTree:s}=t.current,{onFilterChange:u}=t.current.props,{t:c}=ot(),f=q.default.useRef([]),p=q.default.useMemo((()=>a.filter((e=>e.fieldName&&(Za(e.expression)||!De(e.value))))),[a]),m=q.default.useMemo((()=>n.filter((e=>![bi.operationColumn].includes(e.dataIndex))).map((e=>({label:ja(e.title),value:e.dataIndex})))),[n]),[h,v]=q.default.useState("and"),y=q.default.useMemo((()=>{const e=p.map((e=>{var t;return`${e.fieldName},${e.expression},${null!==(t=e.value)&&void 0!==t?t:""}`}));return l.isEqual(e,f.current)?f.current:(f.current=e,e)}),[p]);Yl((()=>{r(a.map((e=>Object.assign(Object.assign({},e),{logic:h}))))}),[h]),Yl((()=>{x(),null==u||u(p)}),[y]),q.default.useEffect((()=>{p.length&&b()}),[]);const b=()=>{const e=Va(p.map((e=>Object.assign(Object.assign({},He(e,["value"])),{condition:e.value}))));i(e?fa(o,e,s):o)},x=wn(b,200),E=[{label:c("qm.pivotGrid.filter.matchAll"),value:"and"},{label:c("qm.pivotGrid.filter.matchAny"),value:"or"}],C=()=>{r([...a,{type:"",bracketLeft:"",fieldName:"",expression:"",value:null,bracketRight:"",logic:h}])},w=(e,t,l)=>{var i;if(Object.assign(t,{[e]:l}),"fieldName"===e){const e=(null===(i=n.find((e=>e.dataIndex===l)).filter)||void 0===i?void 0:i.type)||"text";Object.assign(t,{type:e,expression:N(e)[0].value,value:""})}"expression"===e&&Za(l)&&Object.assign(t,{value:""}),r([...a])},S=e=>q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Select,{value:e.fieldName||void 0,options:m,placeholder:c("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>w("fieldName",e,t)}),q.default.createElement(d.Select,{value:e.expression||void 0,placeholder:c("qm.table.editable.selectPlaceholder"),options:N(e.type),style:{width:100,margin:"0 10px"},onChange:t=>w("expression",e,t)}),T(e),q.default.createElement(g.CloseOutlined,{className:"icon close",onClick:()=>(e=>{r(a.filter((t=>t!==e)))})(e)})),N=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",label:c("qm.table.highSearch.gtText")},{value:"<",label:c("qm.table.highSearch.ltText")},{value:">=",label:c("qm.table.highSearch.gteText")},{value:"<=",label:c("qm.table.highSearch.lteText")},{value:"==",label:c("qm.table.highSearch.eqText")},{value:"!=",label:c("qm.table.highSearch.neqText")},{value:"nil",label:c("qm.table.highSearch.nullText")},{value:"nnil",label:c("qm.table.highSearch.notNullText")}];break;case"checkbox":case"radio":case"tree":t=[{value:"in",label:c("qm.table.highSearch.inText")},{value:"nin",label:c("qm.table.highSearch.ninText")},{value:"==",label:c("qm.table.highSearch.eqText")},{value:"!=",label:c("qm.table.highSearch.neqText")},{value:"nil",label:c("qm.table.highSearch.nullText")},{value:"nnil",label:c("qm.table.highSearch.notNullText")}];break;default:t=[{value:"like",label:c("qm.table.highSearch.inText")},{value:"nlike",label:c("qm.table.highSearch.ninText")},{value:"==",label:c("qm.table.highSearch.eqText")},{value:"!=",label:c("qm.table.highSearch.neqText")},{value:"^=",label:c("qm.table.highSearch.startsWithText")},{value:"=$",label:c("qm.table.highSearch.endsWithText")},{value:"nil",label:c("qm.table.highSearch.nullText")},{value:"nnil",label:c("qm.table.highSearch.notNullText")}]}return t},T=e=>{var t,l;switch(e.type){case"number":return q.default.createElement(d.InputNumber,{defaultValue:e.value,style:{width:150},onChange:t=>{w("value",e,De(t)?"":t)}});case"date":return q.default.createElement(et,{popupClassName:bi.popupClassName,defaultValue:null!==(t=Ha(e.value,"YYYY-MM-DD"))&&void 0!==t?t:void 0,picker:"date",allowClear:!0,style:{width:150},onChange:t=>{w("value",e,qa(t,"YYYY-MM-DD"))}});case"checkbox":case"radio":{const t=(null===(l=n.find((t=>t.dataIndex===e.fieldName)))||void 0===l?void 0:l.dictItems)||[];return q.default.createElement(d.Select,{mode:"checkbox"===e.type?"multiple":void 0,defaultValue:e.value||void 0,placeholder:c("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>{w("value",e,t)}},t.map((e=>q.default.createElement(d.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))}default:return q.default.createElement(d.Input,{value:e.value,style:{width:150},disabled:Za(e.expression),onChange:t=>{w("value",e,t.target.value)}})}};return q.default.createElement(d.Dropdown,{trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container")},q.default.createElement("div",{className:"label"},q.default.createElement("span",null,c("qm.pivotGrid.filter.title")),!!p.length&&q.default.createElement(d.Select,{value:h,options:E,style:{width:130},onChange:e=>v(e)})),q.default.createElement("div",{className:"list"},a.map(((e,t)=>q.default.createElement("li",{key:`${e.fieldName}-${t}`,className:"item"},S(e))))),q.default.createElement("div",{className:"add-record"},q.default.createElement("span",{className:"insert",onClick:C},q.default.createElement(g.PlusOutlined,{className:"icon"}),c("qm.pivotGrid.fillColor.add")))),className:J.default("action-btn",{active:!!p.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},q.default.createElement("span",null,q.default.createElement(g.FilterOutlined,{className:"icon"}),c("qm.pivotGrid.filter.text"),p.length?`(${p.length})`:null))},zs=()=>{const{prefixCls:e,pivotRef:t,columns:n,gridData:a,sorterList:r,setSorterList:i,setGridData:o}=js(),{onSorterChange:s}=t.current.props,{t:u}=ot(),c=q.default.useMemo((()=>r.filter((e=>e.fieldName&&e.order))),[r]),f=q.default.useMemo((()=>n.filter((e=>![bi.operationColumn].includes(e.dataIndex))).map((e=>({label:ja(e.title),value:e.dataIndex,disabled:r.some((t=>t.fieldName===e.dataIndex))})))),[r,n]);Yl((()=>{h(),null==s||s(c)}),[q.default.useMemo((()=>c.map((e=>Object.values(e).join(":"))).join(",")),[c])]),q.default.useLayoutEffect((()=>{c.length&&h()}),[]);const p=[{label:u("qm.pivotGrid.sorter.ascend"),value:"ascend"},{label:u("qm.pivotGrid.sorter.descend"),value:"descend"}],m=(e,t)=>"number"==typeof e&&"number"==typeof t?e-t:"string"==typeof e&&"string"==typeof t?e.localeCompare(t):e instanceof Date&&t instanceof Date?e.getTime()-t.getTime():0,h=()=>{var e,t;o((e=a,(t=c).length||(t=[{fieldName:"index",order:"ascend"}]),e.sort(((e,l)=>{for(const n of t){const{fieldName:t,order:a}=n,r=Pa(e,t),i=Pa(l,t),o=m(r,i);if(0!==o)return"ascend"===a?o:-o}return 0})).slice(0)))},v=()=>{i([...r,{fieldName:"",order:"ascend"}])},y=(e,t,l)=>{Object.assign(t,{[e]:l}),i([...r])},b=e=>q.default.createElement(q.default.Fragment,null,q.default.createElement(g.HolderOutlined,{className:"icon handle"}),q.default.createElement(d.Select,{value:e.fieldName||void 0,placeholder:u("qm.table.editable.selectPlaceholder"),options:f,style:{width:160,margin:"0 10px"},onChange:t=>y("fieldName",e,t)}),q.default.createElement(d.Select,{value:e.order,options:p,placeholder:u("qm.table.editable.selectPlaceholder"),style:{width:100},onChange:t=>y("order",e,t)}),q.default.createElement(g.CloseOutlined,{className:"icon close",onClick:()=>(e=>{i(r.filter((t=>t!==e)))})(e)}));return q.default.createElement(d.Dropdown,{trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container")},q.default.createElement("div",{className:"label"},q.default.createElement("span",null,u("qm.pivotGrid.sorter.title"))),q.default.createElement("div",{className:"list"},q.default.createElement(I.ReactSortable,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:r,setList:e=>{const t=e.map((e=>e.fieldName)),n=r.map((e=>e.fieldName));l.isEqual(t,n)||i(e)}},r.map(((e,t)=>q.default.createElement("li",{key:`${e.fieldName}-${t}`,className:"item"},b(e)))))),q.default.createElement("div",{className:"add-record"},q.default.createElement("span",{className:"insert",onClick:v},q.default.createElement(g.PlusOutlined,{className:"icon"}),u("qm.pivotGrid.fillColor.add")))),className:J.default("action-btn",{active:!!c.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},q.default.createElement("span",null,q.default.createElement(g.SortAscendingOutlined,{className:"icon"}),u("qm.pivotGrid.sorter.text"),c.length?`(${c.length})`:null))},Ws=()=>{const{prefixCls:e,getRowKey:t,gridData:l,columns:n,searchResults:a,switchIndex:r,setSearchResults:i,setSwitchIndex:o}=js(),{t:s}=ot(),{getTitleFromCellValue:u}=Oi(),[c,f]=q.default.useState(!1),p=q.default.useMemo((()=>a.length),[a]);Yl((()=>{c||setTimeout((()=>{o(0),i([])}),200)}),[c]);const m=(e,l)=>{const a=[];return e.forEach(((e,r)=>{n.forEach(((n,i)=>{const o=u(e,n,r,i)+"";o.includes(l)&&a.push({value:o,rowKey:t(e,e.index),dataIndex:n.dataIndex})})),Array.isArray(e.children)&&a.push(...m(e.children,l))})),a},h=wn((e=>{const t=e.target.value.trim();o(0),i(t?m(l,t):[])}),200),v=e=>{const{keyCode:t}=e;e.preventDefault(),13===t&&y()},y=()=>{if(!p)return;o((r+1)%p)},b=()=>q.default.createElement("div",{className:"search-switch"},q.default.createElement("button",{className:"button-icon",onClick:()=>(()=>{if(!p)return;o((r-1+p)%p)})()},q.default.createElement(g.LeftOutlined,null)),q.default.createElement("span",{className:"num"},p>0?r+1:r,"/",p),q.default.createElement("button",{className:"button-icon",onClick:()=>y()},q.default.createElement(g.RightOutlined,null)));return q.default.createElement(d.Dropdown,{open:c,trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container")},q.default.createElement("div",{className:"label"},q.default.createElement("span",null,s("qm.pivotGrid.search.title")),q.default.createElement("button",{className:"button-icon",onClick:()=>f(!1)},q.default.createElement(g.CloseOutlined,null))),q.default.createElement("div",{className:"list search",style:{margin:"10px 0"}},q.default.createElement(d.Input,{autoFocus:!0,style:{width:280},suffix:b(),onChange:h,onKeyUp:v}))),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300},destroyPopupOnHide:!0},q.default.createElement("span",{onClick:()=>f(!c)},q.default.createElement(g.MonitorOutlined,{className:"icon"}),s("qm.pivotGrid.search.text")))},Bs=(e,t)=>e.map((e=>(e.children&&(e.children=Bs(e.children,t)),t(e)))),Us=()=>{const{prefixCls:e,pivotRef:t,columns:n,setColumns:a}=js(),{uniqueKey:r,onColumnsChange:i}=t.current.props,{t:o}=ot(),s=q.default.useMemo((()=>r?`grid_field_${r}`:""),[r]);q.default.useLayoutEffect((()=>{u()}),[]),Yl((()=>{f(n)}),[n]);const u=()=>{const e=p();e&&(null==i||i(e))},c=e=>e.map((e=>{const t={};return Array.isArray(e.children)&&(t.children=c(e.children)),void 0!==e.hidden&&(t.hidden=e.hidden),void 0!==e.fixed&&(t.fixed=e.fixed),void 0!==e.width&&(t.width=e.width),void 0!==e.renderWidth&&(t.renderWidth=e.renderWidth),Object.assign({dataIndex:e.dataIndex},t)})),f=e=>{if(!s)return;const t=c(e),n=JSON.parse(localStorage.getItem(s));l.isEqual(t,n)||localStorage.setItem(s,JSON.stringify(t))},p=()=>{if(!s)return;const e=JSON.parse(localStorage.getItem(s));if(!e)return;return l.xor(e.map((e=>e.dataIndex)),n.map((e=>e.dataIndex))).length>0?Bs(n,(t=>{const l=e.find((e=>e.dataIndex===t.dataIndex));return l&&(void 0!==l.hidden&&(t.hidden=l.hidden),void 0!==l.fixed&&(t.fixed=l.fixed),void 0!==l.width&&(t.width=l.width),void 0!==l.renderWidth&&(t.renderWidth=l.renderWidth)),t})):Bs(e,(e=>{const t=n.find((t=>t.dataIndex===e.dataIndex));return t&&void 0===e.fixed&&delete t.fixed,Object.assign({},t,e)}))},m=q.default.useMemo((()=>{let e=0;for(let t=0;t<n.length-1&&("left"!==n[t].fixed||n[t+1].fixed||(e=t+1),!(e>0));t++);const t=[];for(let l=0;l<n.length;l++)l===e&&t.push({title:"",dataIndex:"__divider__"}),t.push(n[l]);return t}),[n]),h=()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container","scroll-y"),style:{padding:5}},q.default.createElement("div",{className:"label",style:{padding:"6px 15px 10px"}},q.default.createElement("span",null,o("qm.pivotGrid.field.title"))),q.default.createElement("div",{className:"list"},q.default.createElement(I.ReactSortable,{itemKey:"dataIndex",handle:".handle",tag:"ul",animation:200,list:m,setList:e=>{const t=e.map((e=>e.dataIndex)),n=m.map((e=>e.dataIndex));l.isEqual(t,n)||(e=>{const t=e.findIndex((e=>"__divider__"===e.dataIndex)),l=[];for(let n=0;n<e.length;n++){const a=e[n];n<t?a.fixed="left":delete a.fixed,n!==t&&l.push(a)}i?i(l):a(l)})(Ya(e))}},m.map((e=>"__divider__"!==e.dataIndex?q.default.createElement("li",{key:e.dataIndex,className:"ant-dropdown-menu-item sort-item"},q.default.createElement(g.HolderOutlined,{className:"handle"}),q.default.createElement("span",{className:"label"},q.default.createElement("span",{className:"title"},ja(e.title)),q.default.createElement("button",{className:"button-icon",onClick:()=>(e=>{e.hidden=!e.hidden;const t=[...n];i?i(t):a(t)})(e)},e.hidden?q.default.createElement(g.EyeInvisibleOutlined,null):q.default.createElement(g.EyeOutlined,null)))):q.default.createElement("li",{key:e.dataIndex,className:"divider"}))))));return q.default.createElement(d.Dropdown,{trigger:["click"],dropdownRender:()=>h(),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:240}},q.default.createElement("span",null,q.default.createElement(g.SettingOutlined,{className:"icon"}),o("qm.pivotGrid.field.text")))},Gs=()=>{const{prefixCls:e,size:t,setContext:l}=js(),{t:n}=ot(),a=[{label:n("qm.pivotGrid.lineHeight.size")[0],value:"small"},{label:n("qm.pivotGrid.lineHeight.size")[1],value:"middle"},{label:n("qm.pivotGrid.lineHeight.size")[2],value:"large"}];return q.default.createElement(d.Dropdown,{trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container"),style:{padding:5}},q.default.createElement("div",{className:"list"},a.map((e=>q.default.createElement("li",{key:e.value,className:J.default("ant-dropdown-menu-item check-item",{active:t===e.value}),onClick:()=>l({size:e.value})},q.default.createElement("span",{className:"label"},e.label),q.default.createElement("i",{className:"icon"},q.default.createElement(g.CheckOutlined,null))))))),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:160}},q.default.createElement("span",null,q.default.createElement(g.ColumnHeightOutlined,{className:"icon"}),n("qm.pivotGrid.lineHeight.text")))},Ys="606060",Xs="thin",Qs="d4d4d4",Zs=(e,t)=>{t&&(e.height=Math.floor(.75*t))},Js=(e,t)=>{e.protection={locked:!1},e.alignment={vertical:"middle",horizontal:t||"left"}},ed=()=>({top:{style:Xs,color:{argb:Qs}},left:{style:Xs,color:{argb:Qs}},bottom:{style:Xs,color:{argb:Qs}},right:{style:Xs,color:{argb:Qs}}}),td=e=>{const{precision:t,formatType:l}=e,n=t>=0&&t?`.${"0".repeat(t)}`:"";return"percent"===l?{numFmt:n?`0${n}%`:"0%"}:"finance"===l?{numFmt:n?`#,##0${n}`:"#,##0"}:n?{numFmt:`0${n}`}:null},ld=()=>{const{prefixCls:e,pivotRef:t,columns:n,countMethod:a,summationData:r}=js(),{t:i}=ot(),{exportXLSX:o}=(()=>{const{size:e}=js(),{t:t}=ot(),{rowHeightMaps:n}=bi,a=(e,t)=>{var l,n,a;return null!==(a=null!==(n=null===(l=e.find((e=>e.text==t)))||void 0===l?void 0:l.value)&&void 0!==n?n:t)&&void 0!==a?a:""};return{exportXLSX:(l,a,r,i)=>Ie(void 0,void 0,void 0,(function*(){const{columns:o,footSummation:s}=l,d=n[e],u=pa(o),c=[],f=[],p=[];let m=0;const h={};u.forEach((e=>{const{dataIndex:t,width:l,renderWidth:n}=e;h[t]=ja(e.title),p.push({key:t,width:(l||n)/8})})),c.push(h),m+=c.length;const g=a.map(((e,t)=>{const l={};return u.forEach(((n,a)=>{const r=["percent","finance"].includes(n.formatType);l[n.dataIndex]=r?Pa(e,n.dataIndex):i(e,t,n,a)})),l._level=e._level,l._groupLevel=e._groupLevel,l}));m+=g.length,s&&r(u,a).forEach(((e,l)=>{const n={};u.forEach(((l,r)=>{const{dataIndex:i,summation:o}=l,s=(null==o?void 0:o.render)?o.render(a):Pa(e,i);n[i]=0===r&&""===s?t("qm.table.config.summaryText"):Re(s)?ja(s):s})),f.push(n)}));const{sheetName:v,useStyle:y}=l,b=new fe.default.Workbook,x=b.addWorksheet(v);x.columns=p,x.addRows(c).forEach((e=>{y&&Zs(e,d),e.eachCell((e=>{const t=x.getColumn(e.col),l=ya(o,t.key),{align:n,theadAlign:a}=l;Js(e,a||n),y&&Object.assign(e,{font:{bold:!0,color:{argb:Ys}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:ed()})}))})),x.addRows(g).forEach(((e,t)=>{const{_level:l,_groupLevel:n}=g[t];y&&Zs(e,d),e.eachCell(((e,t)=>{const a=x.getColumn(e.col),r=ya(o,a.key),{align:i}=r;Js(e,1===t||void 0===n?i:"right"),Object.assign(e,td(r)),y&&Object.assign(e,{font:{color:{argb:Ys}},border:ed()}),1===Number(e.col)&&l&&(e.alignment=Object.assign(Object.assign({},e.alignment),{indent:l}))}))})),s&&x.addRows(f).forEach((e=>{y&&Zs(e,d),e.eachCell(((e,t)=>{const l=x.getColumn(e.col),n=ya(o,l.key),{align:a}=n;Js(e,1===t?a:"right"),Object.assign(e,td(n)),y&&Object.assign(e,{font:{color:{argb:Ys}},border:ed()})}))})),[].forEach((({s:e,e:t})=>{x.mergeCells(e.r+1,e.c+1,t.r+1,t.c+1)}));const E=yield b.xlsx.writeBuffer();return new Blob([E],{type:"application/octet-stream"})})),importXLSX:(e,n)=>{const{columns:r,file:i}=e,o=pa(r),s=new FileReader;s.onerror=()=>{d.message.error(t("qm.table.import.error"))},s.onload=e=>{const r=o.map((e=>ja(e.title))),i=new fe.default.Workbook,s=e.target;s?i.xlsx.load(s.result).then((e=>{const i=e.worksheets[0];if(i){const e=i.getSheetValues(),s=e.findIndex((e=>e&&e.length>0)),u=e[s],c=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(r,u);if(c){const t=e.slice(s+1).map((e=>{const t={};e.forEach(((e,n)=>{var a;let r=e;Array.isArray(null==r?void 0:r.richText)&&(r=r.richText.map((e=>e.text)).join("")),l.isPlainObject(r)&&"text"in r&&(r=r.text),l.isDate(r)&&(r=qa(r,oi)),(null==r?void 0:r.formula)&&(r=null!==(a=r.result)&&void 0!==a?a:r.value),t[u[n]]=r}));const n={};return r.forEach(((e,l)=>{var r;const{dataIndex:i,dictItems:s}=o[l];Array.isArray(s)&&((null===(r=t[e])||void 0===r?void 0:r.toString().includes(","))?t[e]=t[e].split(",").map((e=>a(s,e))).filter((e=>""!==e)):t[e]=a(s,t[e])),Aa(n,i,t[e])})),n}));null==n||n(t)}else d.message.error(t("qm.table.import.error"))}else d.message.error(t("qm.table.import.error"))})):d.message.error(t("qm.table.import.error"))},s.readAsArrayBuffer(i)}}})(),{getTitleFromCellValue:s}=Oi(),u=[{text:i("qm.pivotGrid.count.records"),value:"count"},{text:i("qm.pivotGrid.count.unique"),value:"unique"},{text:i("qm.pivotGrid.count.empty"),value:"empty"},{text:i("qm.pivotGrid.count.notEmpty"),value:"notEmpty"},{text:i("qm.pivotGrid.count.sum"),value:"sum"},{text:i("qm.pivotGrid.count.max"),value:"max"},{text:i("qm.pivotGrid.count.min"),value:"min"},{text:i("qm.pivotGrid.count.avg"),value:"avg"}],c={columns:ma(n),fileName:j.default().format(si),fileType:"xlsx",sheetName:"sheet1",footSummation:!1,useStyle:!1},f=(e,t,l,n)=>{const{dataIndex:a,precision:r,formatType:i,outputRender:o}=l;if(As(e))return Pa(e,a);if(o)return o(Pa(e,a),e,l,t,n);let d=s(e,l,t,n);return r>=0&&!i&&""!==d&&(d=Number(d)),d},p=()=>{if(!a||!Object.keys(a).length)return[];const e={};return c.columns.map((e=>e.dataIndex)).forEach(((t,l)=>{if(l>0){let l="";(null==a?void 0:a[t])&&(l=u.find((e=>e.value===a[t])).text+" "+r.total[t]),Aa(e,t,l)}})),[e]},m=e=>Ie(void 0,void 0,void 0,(function*(){const t=yield o(Object.assign(Object.assign({},c),{footSummation:!!Object.keys(a).length}),e,p,f);Dn(t,`${j.default().format(si)}.xlsx`)})),h=[{key:"1",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(g.FolderOutlined,{style:{marginRight:4}})," ",i("qm.pivotGrid.export.group")),onClick:()=>{m((()=>{const e=[];let l=0;return t.current.flatGroupData.forEach((t=>{const i=Object.assign({},t);As(t)?(i._level=t._groupLevel,c.columns.map((e=>e.dataIndex)).forEach(((e,l)=>{if(0===l){const l=n.find((e=>e.dataIndex===t._fieldName)),a=l.outputRender?l.outputRender(Pa(t._record,l.dataIndex),t._record,l,0,0):s(t._record,l,0,0);Aa(i,e,a)}else{let l="";(null==a?void 0:a[e])&&(l=u.find((t=>t.value===a[e])).text+" "+Fs(r,t.id).subtotal[e]),Aa(i,e,l)}})),l=t._groupLevel):l>0&&(i._level=t._level+l+1),e.push(i)})),e})())}},{key:"2",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(g.BarsOutlined,{style:{marginRight:4}})," ",i("qm.pivotGrid.export.list")),onClick:()=>{m(Array.from(t.current.keyRecordMap.values()))}}];return q.default.createElement(d.Dropdown,{trigger:["click"],menu:{items:h},className:J.default("action-btn"),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:140}},q.default.createElement("span",null,q.default.createElement(g.DownloadOutlined,{className:"icon"}),i("qm.pivotGrid.export.text")))},nd=()=>{const{prefixCls:e,pivotRef:t,groupList:l,filterList:n,sorterList:a,colorList:r,countMethod:i,setContext:o}=js(),{uniqueKey:s}=t.current.props,{t:u}=ot(),c=q.default.useMemo((()=>s?`grid_conf_${s}`:""),[s]),f=q.default.useRef({}),[p,m]=q.default.useState([]),[h,v]=q.default.useState({}),[y,b]=q.default.useState(""),x=(e,t)=>{v((l=>Object.assign({},l,{[e]:null!=t?t:!l[e]})))};q.default.useLayoutEffect((()=>{E()}),[]),Yl((()=>{C()}),[p]);const E=()=>Ie(void 0,void 0,void 0,(function*(){try{if(!c)return;const e=yield pe.default.getItem(c);Array.isArray(e)&&(m(e),v(e.reduce(((e,t)=>(t.id&&(e[t.id]=!1),e)),{})))}catch(e){}})),C=()=>Ie(void 0,void 0,void 0,(function*(){try{if(!c)return;yield pe.default.setItem(c,p)}catch(e){}})),w=()=>{const e=$a();m([{id:e,label:j.default().format(si),value:{groupList:l,filterList:n,sorterList:a,colorList:r,countMethod:i}},...p]),Fe((()=>x(e,!0)))},S=()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container"),style:{padding:5}},q.default.createElement("div",{className:"label",style:{padding:"6px 15px 10px"}},q.default.createElement("span",null,u("qm.pivotGrid.saved.title"))),q.default.createElement("div",{className:"list"},q.default.createElement("ul",null,p.map((e=>q.default.createElement("li",{key:e.id,className:J.default("ant-dropdown-menu-item sort-item",{active:e.id===y}),onClick:()=>(e=>{if(h[e.id])return;const t=y!==e.id,l=t?e.value:f.current;o({groupList:l.groupList,filterList:l.filterList,sorterList:l.sorterList,colorList:l.colorList,countMethod:l.countMethod}),b(t?e.id:"")})(e)},q.default.createElement("div",{className:"label",style:{width:200}},h[e.id]?q.default.createElement(d.Input,{size:"small",autoFocus:!0,defaultValue:e.label,style:{width:"100%",marginLeft:-8},onBlur:t=>{const{value:l}=t.target;l!==e.label&&(e.label=l,m([...p])),x(e.id,!1)}}):q.default.createElement("span",null,e.label)),q.default.createElement("button",{className:"button-icon",onClick:t=>{t.stopPropagation(),x(e.id)}},h[e.id]?q.default.createElement(g.CheckOutlined,null):q.default.createElement(g.EditOutlined,null)),q.default.createElement("button",{className:"button-icon",style:{marginLeft:4},onClick:t=>{var l;t.stopPropagation(),l=e.id,m(p.filter((e=>e.id!==l)))}},q.default.createElement(g.CloseOutlined,null))))))),q.default.createElement("div",{className:"add-record",style:{padding:10}},q.default.createElement("span",{className:"insert",onClick:w},q.default.createElement(g.PlusOutlined,{className:"icon"}),u("qm.pivotGrid.saved.add"))));return q.default.createElement(d.Dropdown,{trigger:["click"],dropdownRender:()=>S(),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomRight",overlayStyle:{minWidth:280},onOpenChange:e=>{var t;t=e?{groupList:l,filterList:n,sorterList:a,colorList:r,countMethod:i}:{},f.current=t}},q.default.createElement("span",null,q.default.createElement(g.SaveOutlined,{className:"icon"}),u("qm.pivotGrid.saved.text")))},ad=()=>{const{gridData:e}=js(),{t:t}=ot();return q.default.createElement("div",{className:"alert-info"},q.default.createElement(g.InfoCircleOutlined,{className:"icon"}),t("qm.table.alert.total",{total:(()=>{let t=0;return function e(l){l.forEach((l=>{Array.isArray(l.children)&&e(l.children),t+=1}))}(e),t})()}))},rd=8;const id={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},od={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},sd=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function dd(e){const{arrowWidth:t,autoAdjustOverflow:l,arrowPointAtCenter:n,offset:a,borderRadius:r,visibleFirst:i}=e,o=t/2,s={};return Object.keys(id).forEach((e=>{const d=n&&od[e]||id[e],u=Object.assign(Object.assign({},d),{offset:[0,0],dynamicInset:!0});switch(s[e]=u,sd.has(e)&&(u.autoArrow=!1),e){case"top":case"topLeft":case"topRight":u.offset[1]=-o-a;break;case"bottom":case"bottomLeft":case"bottomRight":u.offset[1]=o+a;break;case"left":case"leftTop":case"leftBottom":u.offset[0]=-o-a;break;case"right":case"rightTop":case"rightBottom":u.offset[0]=o+a}const c=function(e){const{contentRadius:t,limitVerticalRadius:l}=e,n=t>12?t+2:12;return{arrowOffsetHorizontal:n,arrowOffsetVertical:l?rd:n}}({contentRadius:r,limitVerticalRadius:!0});if(n)switch(e){case"topLeft":case"bottomLeft":u.offset[0]=-c.arrowOffsetHorizontal-o;break;case"topRight":case"bottomRight":u.offset[0]=c.arrowOffsetHorizontal+o;break;case"leftTop":case"rightTop":u.offset[1]=2*-c.arrowOffsetHorizontal+o;break;case"leftBottom":case"rightBottom":u.offset[1]=2*c.arrowOffsetHorizontal-o}u.overflow=function(e,t,l,n){if(!1===n)return{adjustX:!1,adjustY:!1};const a=n&&"object"==typeof n?n:{},r={};switch(e){case"top":case"bottom":r.shiftX=2*t.arrowOffsetHorizontal+l,r.shiftY=!0,r.adjustY=!0;break;case"left":case"right":r.shiftY=2*t.arrowOffsetVertical+l,r.shiftX=!0,r.adjustX=!0}const i=Object.assign(Object.assign({},r),a);return i.shiftX||(i.adjustX=!0),i.shiftY||(i.adjustY=!0),i}(e,c,t,l),i&&(u.htmlRegion="visibleFirst")})),s}const ud=e=>{const{value:t,defaultValue:l,disabled:n,disabledAlpha:a,className:r,style:i,onChange:o,onChangeComplete:s}=e,[d,u]=yi("",{value:t,defaultValue:l}),c=e=>({hex:e.toHexString(),rgb:e.toRgbString(),hsb:e.toHsbString()}),f=dd({offset:0,arrowWidth:16,borderRadius:6}),p=gt("color-picker");return q.default.createElement(me.default,{action:["click"],prefixCls:p,popupPlacement:"bottomLeft",builtinPlacements:f,popup:()=>q.default.createElement(he.default,{prefixCls:p,value:d,disabled:n,disabledAlpha:a,onChange:(e,t)=>{u(e.toRgbString()),null==o||o(c(e),t)},onChangeComplete:(e,t)=>{null==s||s(c(e),t)}})},q.default.createElement("div",{className:J.default(`${p}-btn`,r),style:i},q.default.createElement(P.ColorBlock,{color:d,prefixCls:p})))};ud.displayName="ColorPicker";const cd=()=>{const{prefixCls:e,pivotRef:t,getRowKey:n,columns:a,colorList:r,setColorList:i,setFillColor:o}=js(),{flatGroupData:s}=t.current,{t:u}=ot(),c=q.default.useRef([]),f=q.default.useMemo((()=>r.filter((e=>e.fieldName&&e.color&&(Za(e.expression)||!De(e.value)||"col"===e.mode)))),[r]),p=q.default.useMemo((()=>a.filter((e=>![bi.operationColumn].includes(e.dataIndex))).map((e=>({label:ja(e.title),value:e.dataIndex})))),[a]),m=q.default.useMemo((()=>Ls(a)),[a]),h=[{label:u("qm.pivotGrid.fillColor.cell"),value:"cell"},{label:u("qm.pivotGrid.fillColor.row"),value:"row"},{label:u("qm.pivotGrid.fillColor.col"),value:"col"}];Yl((()=>{v()}),[q.default.useMemo((()=>{const e=f.map((e=>{var t;return{[e.color]:`${e.mode},${e.fieldName},${e.expression},${null!==(t=e.value)&&void 0!==t?t:""}`}}));return l.isEqual(e,c.current)?c.current:(c.current=e,e)}),[f])]);const v=wn((()=>{const e=[];f.forEach((t=>{const l=Va([Object.assign(Object.assign({},He(t,["value"])),{condition:t.value})]),a=fa(s.filter((e=>!As(e))),"col"!==t.mode?l:"");if("cell"===t.mode||"col"===t.mode)for(let l=0;l<a.length;l++)e.push({color:t.color,rowKey:n(a[l],a[l].index),dataIndex:t.fieldName});if("row"===t.mode)for(let l=0;l<a.length;l++){const r=n(a[l],a[l].index);for(let l=0;l<m.length;l++)e.push({color:t.color,rowKey:r,dataIndex:m[l].dataIndex})}})),o(e)}),200),y=()=>{i([...r,{type:"",bracketLeft:"",fieldName:"",expression:"",value:null,bracketRight:"",logic:"and",color:"",mode:"cell"}])},b=(e,t,l)=>{var n;if(Object.assign(t,{[e]:l}),"fieldName"===e){const e=(null===(n=a.find((e=>e.dataIndex===l)).filter)||void 0===n?void 0:n.type)||"text";Object.assign(t,{type:e,expression:x(e)[0].value,value:""})}"expression"===e&&Za(l)&&Object.assign(t,{value:""}),i([...r])},x=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",label:u("qm.table.highSearch.gtText")},{value:"<",label:u("qm.table.highSearch.ltText")},{value:">=",label:u("qm.table.highSearch.gteText")},{value:"<=",label:u("qm.table.highSearch.lteText")},{value:"==",label:u("qm.table.highSearch.eqText")},{value:"!=",label:u("qm.table.highSearch.neqText")},{value:"nil",label:u("qm.table.highSearch.nullText")},{value:"nnil",label:u("qm.table.highSearch.notNullText")}];break;case"checkbox":case"radio":case"tree":t=[{value:"in",label:u("qm.table.highSearch.inText")},{value:"nin",label:u("qm.table.highSearch.ninText")},{value:"==",label:u("qm.table.highSearch.eqText")},{value:"!=",label:u("qm.table.highSearch.neqText")},{value:"nil",label:u("qm.table.highSearch.nullText")},{value:"nnil",label:u("qm.table.highSearch.notNullText")}];break;default:t=[{value:"like",label:u("qm.table.highSearch.inText")},{value:"nlike",label:u("qm.table.highSearch.ninText")},{value:"==",label:u("qm.table.highSearch.eqText")},{value:"!=",label:u("qm.table.highSearch.neqText")},{value:"^=",label:u("qm.table.highSearch.startsWithText")},{value:"=$",label:u("qm.table.highSearch.endsWithText")},{value:"nil",label:u("qm.table.highSearch.nullText")},{value:"nnil",label:u("qm.table.highSearch.notNullText")}]}return t},E=e=>q.default.createElement(q.default.Fragment,null,q.default.createElement(g.HolderOutlined,{className:"icon handle"}),q.default.createElement(ud,{defaultValue:e.color,style:{marginLeft:5},onChangeComplete:t=>b("color",e,t.hex)}),q.default.createElement(d.Select,{value:e.mode,options:h,placeholder:u("qm.table.editable.selectPlaceholder"),style:{width:90,marginLeft:10,marginRight:20},onChange:t=>b("mode",e,t)}),q.default.createElement(d.Select,{value:e.fieldName||void 0,options:p,placeholder:u("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>b("fieldName",e,t)}),"col"!==e.mode&&q.default.createElement(d.Select,{value:e.expression||void 0,placeholder:u("qm.table.editable.selectPlaceholder"),options:x(e.type),style:{width:100,margin:"0 10px"},onChange:t=>b("expression",e,t)}),"col"!==e.mode&&(e=>{var t,l;switch(e.type){case"number":return q.default.createElement(d.InputNumber,{defaultValue:e.value,style:{width:150},onChange:t=>{b("value",e,De(t)?"":t)}});case"date":return q.default.createElement(et,{popupClassName:bi.popupClassName,defaultValue:null!==(t=Ha(e.value,"YYYY-MM-DD"))&&void 0!==t?t:void 0,picker:"date",allowClear:!0,style:{width:150},onChange:t=>{b("value",e,qa(t,"YYYY-MM-DD"))}});case"checkbox":case"radio":{const t=(null===(l=a.find((t=>t.dataIndex===e.fieldName)))||void 0===l?void 0:l.dictItems)||[];return q.default.createElement(d.Select,{mode:"checkbox"===e.type?"multiple":void 0,defaultValue:e.value||void 0,placeholder:u("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>{b("value",e,t)}},t.map((e=>q.default.createElement(d.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))}default:return q.default.createElement(d.Input,{value:e.value,style:{width:150},disabled:Za(e.expression),onChange:t=>{b("value",e,t.target.value)}})}})(e),q.default.createElement(g.CloseOutlined,{className:"icon close",onClick:()=>(e=>{i(r.filter((t=>t!==e)))})(e)}));return q.default.createElement(d.Dropdown,{trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container")},q.default.createElement("div",{className:"label"},q.default.createElement("span",null,u("qm.pivotGrid.fillColor.title"))),q.default.createElement("div",{className:"list"},q.default.createElement(I.ReactSortable,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:r,setList:e=>{const t=e.map((e=>e.fieldName)),n=r.map((e=>e.fieldName));l.isEqual(t,n)||i(e)}},r.map(((e,t)=>q.default.createElement("li",{key:`${e.fieldName}-${t}`,className:"item"},E(e)))))),q.default.createElement("div",{className:"add-record"},q.default.createElement("span",{className:"insert",onClick:y},q.default.createElement(g.PlusOutlined,{className:"icon"}),u("qm.pivotGrid.fillColor.add")))),className:J.default("action-btn",{active:!!f.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},q.default.createElement("span",null,q.default.createElement(g.BgColorsOutlined,{className:"icon"}),u("qm.pivotGrid.fillColor.text"),f.length?`(${f.length})`:null))},fd=()=>q.default.createElement("div",{className:"top-bar"},q.default.createElement(ht,{size:4},q.default.createElement(ad,null),q.default.createElement(d.Divider,{type:"vertical"}),q.default.createElement(Us,null),q.default.createElement(Ks,null),q.default.createElement(Vs,null),q.default.createElement(zs,null),q.default.createElement(d.Divider,{type:"vertical"}),q.default.createElement(cd,null),q.default.createElement(Gs,null),q.default.createElement(Ws,null),q.default.createElement(d.Divider,{type:"vertical"}),q.default.createElement(ld,null)),q.default.createElement(ht,{size:4},q.default.createElement(nd,null))),pd=q.default.createContext(void 0),md=e=>{var t,l;const{scrollbar:n}=e,{pivotRef:a,getRowKey:r,columns:i,groupGridData:o,setPivotGridRef:s}=js(),{rowSelection:d,treeExpandable:u,rowHighlight:c}=a.current.props,f=null===(t=null==u?void 0:u.defaultExpandAllRows)||void 0===t||t,p=q.default.useRef({bodyEl:null,rowVirtualizer:null}),[m,h]=q.default.useState({gridRef:p,scrollbarRef:n,selectionKeys:null!==(l=null==d?void 0:d.defaultSelectedRowKeys)&&void 0!==l?l:[],treeExpandKeys:f?wa(a.current.originGridData,(e=>r(e,e.index))):[],highlightKey:"",checkedColumnKey:"",clicked:[],isPingLeft:!1}),g=q.default.useMemo((()=>Math.max(0,_s(o)-1)),[o]),v=q.default.useMemo((()=>Ls(i)),[i]),y=q.default.useMemo((()=>v.filter((e=>"left"===e.fixed)).reduce(((e,t)=>e+(t.width||t.renderWidth||0)),0)+g*ks.indentWidth),[g,v]),b=e=>{h((t=>{const l=Object.assign({},t);let n=!1;return Object.keys(e).forEach((a=>{const r=a;Object.is(t[r],e[r])||(l[r]=e[r],n=!0)})),n?l:t}))},x=(e,t)=>{m.gridRef.current[e]=t};q.default.useLayoutEffect((()=>{I()}),[i]),q.default.useLayoutEffect((()=>{(null==d?void 0:d.selectedRowKeys)&&b({selectionKeys:d.selectedRowKeys})}),[null==d?void 0:d.selectedRowKeys]),q.default.useLayoutEffect((()=>{void 0!==(null==c?void 0:c.currentRowKey)&&b({highlightKey:c.currentRowKey})}),[null==c?void 0:c.currentRowKey]);const E=e=>{Array.isArray(null==d?void 0:d.selectedRowKeys)||b({selectionKeys:e})},C=e=>{b({treeExpandKeys:e})},w=e=>{void 0===(null==c?void 0:c.currentRowKey)&&b({highlightKey:e})},S=e=>{b({checkedColumnKey:e})},N=e=>{Xa(e,m.clicked,!0)||b({clicked:e})},T=e=>{b({isPingLeft:e})},I=()=>{const e=n.current.container.clientWidth,{defaultColumnWidth:t}=bi,l=[];let a=0;if(i.forEach((e=>{"number"==typeof e.width?(e.renderWidth=e.width,a+=e.width):(e.renderWidth=void 0,l.push(e))})),l.length>0){const n=i.reduce(((e,l)=>e+(l.width||l.minWidth||t)),0);if(n<=e){const a=e-n;if(1===l.length)l[0].renderWidth=(l[0].minWidth||t)+a;else{const e=a/l.reduce(((e,l)=>e+(l.minWidth||t)),0);let n=0;l.forEach(((l,a)=>{if(0===a)return;const r=Math.floor((l.minWidth||t)*e);n+=r,l.renderWidth=(l.minWidth||t)+r})),l[0].renderWidth=(l[0].minWidth||t)+a-n}}else l.forEach((e=>{e.renderWidth=e.minWidth||t}))}else a=i.reduce(((e,l)=>e+(l.renderWidth=l.width||l.minWidth||t)),0)},O=q.default.useMemo((()=>Object.assign(Object.assign({},m),{indentDepth:g,fixedWidth:y,gridColumns:v,setContext:b,setGridLayoutRef:x,setSelectionKeys:E,setTreeExpandKeys:C,setHighlightKey:w,setCheckColumnKey:S,setClicked:N,setPingLeft:T,updateColumnsWidth:I})),[m,g,v]);return q.default.createElement(pd.Provider,{value:O},e.children)},hd=()=>q.default.useContext(pd),gd=e=>{var t;const{column:l}=e,{pivotRef:n,columns:a,setColumns:r}=js(),{scrollbarRef:i}=hd(),{onColumnsChange:o}=n.current.props,s=q.default.useRef(null),[d,u]=q.default.useState(!1),c=q.default.useRef(document.onselectstart),f=q.default.useRef({startX:0,originSizeX:0,columnWidth:0}),p=e=>{f.current=Object.assign({},f.current,e)},m=e=>{if(1!==e.buttons)return h();const t=e.clientX-f.current.startX,n=(l.width||l.renderWidth)+t;n<(l.minWidth||bi.defaultColumnWidth)||(p({columnWidth:n}),s.current.style.left=`${f.current.originSizeX+t}px`)},h=()=>{i.current.container.classList.remove("col-resize"),l.width=f.current.columnWidth;const e=[...a];o?o(e):r(e),Fe((()=>u(!1))),Ql(document,"mousemove",m),Ql(document,"mouseup",h),p({startX:0,originSizeX:0,columnWidth:0}),g()},g=()=>{document.onselectstart!==c.current&&(document.onselectstart=c.current)};return q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:"resize-bar",onMouseDown:e=>{e.preventDefault(),i.current.container.classList.add("col-resize");const t=Ra(e.target,i.current.container).left-i.current.scrollLeft+3;p({startX:e.clientX,originSizeX:t,columnWidth:l.width||l.renderWidth||0}),Xl(document,"mousemove",m),Xl(document,"mouseup",h),u(!0),Fe((()=>s.current.style.left=`${t}px`)),c.current=document.onselectstart,document.onselectstart=()=>!1}}),q.default.createElement(ue.default,{open:d,getContainer:null===(t=i.current)||void 0===t?void 0:t.container},q.default.createElement("div",{ref:s,className:"resize-line"})))},vd=e=>{var t;const{left:l}=e,{pivotRef:n,columns:a,setColumns:r}=js(),{scrollbarRef:i,gridColumns:o,indentDepth:s,isPingLeft:d,setPingLeft:u}=hd(),{onColumnsChange:c}=n.current.props,{indentWidth:f}=ks,p=q.default.useRef(document.onselectstart),m=q.default.useRef({startX:0,originSizeX:0}),h=e=>{m.current=Object.assign({},m.current,e)},g=()=>{x(l),O(l)},[v,y]=q.default.useState(0),[b,x]=q.default.useState(l),[E,C]=q.default.useState(l),w=q.default.useRef(!1),S=e=>w.current=e;Yl((()=>{w.current||g()}),[l]);const N=e=>e.width||e.renderWidth||0,T=e=>o.slice(0,e).reduce(((e,t)=>e+N(t)),0)+s*f,I=e=>{let t=-1;for(let l=1;l<o.length;l++){const n=T(l-1)+N(o[l-1])/2,a=T(l)+N(o[l])/2;if(e>n&&e<a){T(l)<i.current.container.offsetWidth&&(t=l);break}}return t},O=Kn((e=>{const t=I(e);t<0||C(T(t))}),60);q.default.useEffect((()=>{const e=e=>u(e.target.scrollLeft>1),t=i.current.scrollElement;return t.addEventListener("scroll",e),Xl(t,"scroll",e),()=>Ql(t,"scroll",e)}),[]);const R=st((e=>{if(1!==e.buttons)return k();const t=e.clientX-m.current.startX,l=m.current.originSizeX+t;x(l),O(l)})),k=st((()=>{i.current.container.classList.remove("col-resize"),S(!1),(e=>{const t=I(e);if(t<0)return g();a.forEach(((e,l)=>{l<t-1?e.fixed="left":delete e.fixed})),x(T(t)),O(e),c?c([...a]):r([...a])})(b),Ql(document,"mousemove",R),Ql(document,"mouseup",k),h({startX:0,originSizeX:0}),L()})),L=()=>{document.onselectstart!==p.current&&(document.onselectstart=p.current)};return q.default.createElement(ue.default,{open:!0,getContainer:null===(t=i.current)||void 0===t?void 0:t.container},q.default.createElement("div",{className:J.default("fixed-line",{leave:d}),style:{left:l}}),q.default.createElement("div",{className:J.default("fixed-bar",{active:w.current}),style:{left:b},onMouseMove:e=>{const{top:t,height:l}=e.target.getBoundingClientRect(),n=e.clientY-t;let a=Math.max(0,n-16);a=Math.min(a,l-32),y(a)},onMouseDown:e=>{e.preventDefault(),i.current.container.classList.add("col-resize"),i.current.SET_SCROLL_LEFT(0),S(!0),h({startX:e.clientX,originSizeX:e.target.offsetLeft}),Xl(document,"mousemove",R),Xl(document,"mouseup",k),p.current=document.onselectstart,document.onselectstart=()=>!1}},q.default.createElement("span",{className:"thumb",style:{top:v}})),w.current&&q.default.createElement("div",{className:"fixed-line active",style:{left:E}}))},yd=()=>{const{pivotRef:e}=js(),{indentDepth:t,fixedWidth:l,gridColumns:n,checkedColumnKey:a,selectionKeys:r,setSelectionKeys:i,setCheckColumnKey:o}=hd(),{rowSelection:s}=e.current.props,{selectionColumn:u}=bi,{indentWidth:c,selectionColumnDefine:f}=ks,p=q.default.useMemo((()=>n.filter((e=>"left"===e.fixed))),[n]),m=q.default.useMemo((()=>n.filter((e=>"left"!==e.fixed))),[n]),h=q.default.useMemo((()=>"radio"!==(null==s?void 0:s.type)),[s]),g=q.default.useMemo((()=>r.length>0&&r.length===e.current.keyRecordMap.size),[r]),v=q.default.useMemo((()=>r.length>0&&r.length<e.current.keyRecordMap.size),[r]),y=(n,r)=>q.default.createElement("div",{className:J.default(r?"fixed-left":"no-fixed"),style:{width:r?l:""}},n.map(((l,p)=>{const{dataIndex:m,title:y,align:b,width:x,renderWidth:E}=l,C={"selection-column":m===u,"col--center":"center"===b,"col--right":"right"===b,"col--checked":a===m},w=p===(r?n.length>1?1:0:n.length-1)?t*c:0,S={width:`${(x||E||0)+w}px`,minWidth:`${(x||E||0)+w}px`};return q.default.createElement("div",{key:m,className:J.default("table-cell",C),title:ja(y),style:S,onClick:()=>{return e=m,void([f.dataIndex,bi.operationColumn].includes(e)||o(a!==e?e:""));var e}},m!==u?q.default.createElement("span",{className:"cell"},y):s&&h?q.default.createElement(d.Checkbox,{checked:g,indeterminate:v,onChange:t=>(t=>{var l;const n=t?Array.from(e.current.keyRecordMap.keys()):[];i(n),null===(l=null==s?void 0:s.onChange)||void 0===l||l.call(s,n,t?Array.from(e.current.keyRecordMap.values()):[])})(t.target.checked)}):"#",m!==u&&q.default.createElement(gd,{column:l}))})));return q.default.createElement("div",{className:"header"},y(p,!0),y(m),q.default.createElement(vd,{left:l}))};function bd(e,t,l){var n;let a,r=null!==(n=l.initialDeps)&&void 0!==n?n:[];function i(){var n,i,o,s,d;let u;l.key&&(null===(n=l.debug)||void 0===n?void 0:n.call(l))&&(u=Date.now());const c=e(),f=c.length!==r.length||c.some(((e,t)=>r[t]!==e));if(!(null===(i=l.noCache)||void 0===i?void 0:i.call(l))&&!f)return a;let p;if(r=c,l.key&&(null===(o=l.debug)||void 0===o?void 0:o.call(l))&&(p=Date.now()),a=t(...c),l.key&&(null===(s=l.debug)||void 0===s?void 0:s.call(l))){const e=Math.round(100*(Date.now()-u))/100,t=Math.round(100*(Date.now()-p))/100,n=t/16,a=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${a(t,5)} /${a(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*n,120))}deg 100% 31%);`,null==l?void 0:l.key)}return null===(d=null==l?void 0:l.onChange)||void 0===d||d.call(l,a),a}return i.updateDeps=e=>{r=e},i}function xd(e,t){if(void 0===e)throw new Error("Unexpected undefined"+(t?`: ${t}`:""));return e}const Ed=(e,t,l)=>{let n;return function(...a){e.clearTimeout(n),n=e.setTimeout((()=>t.apply(this,a)),l)}},Cd=e=>{const{offsetWidth:t,offsetHeight:l}=e;return{width:t,height:l}},wd=e=>e,Sd=e=>{const t=Math.max(e.startIndex-e.overscan,0),l=Math.min(e.endIndex+e.overscan,e.count-1),n=[];for(let e=t;e<=l;e++)n.push(e);return n},Nd=(e,t)=>{const l=e.scrollElement;if(!l)return;const n=e.targetWindow;if(!n)return;const a=e=>{const{width:l,height:n}=e;t({width:Math.round(l),height:Math.round(n)})};if(a(Cd(l)),!n.ResizeObserver)return()=>{};const r=new n.ResizeObserver((t=>{const n=()=>{const e=t[0];if(null==e?void 0:e.borderBoxSize){const t=e.borderBoxSize[0];if(t)return void a({width:t.inlineSize,height:t.blockSize})}a(Cd(l))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(n):n()}));return r.observe(l,{box:"border-box"}),()=>{r.unobserve(l)}},Td={passive:!0},Id="undefined"==typeof window||"onscrollend"in window,Od=(e,t)=>{const l=e.scrollElement;if(!l)return;const n=e.targetWindow;if(!n)return;let a=0;const r=e.options.useScrollendEvent&&Id?()=>{}:Ed(n,(()=>{t(a,!1)}),e.options.isScrollingResetDelay),i=n=>()=>{const{horizontal:i,isRtl:o}=e.options;a=i?l.scrollLeft*(o?-1:1):l.scrollTop,r(),t(a,n)},o=i(!0),s=i(!1);s(),l.addEventListener("scroll",o,Td);const d=e.options.useScrollendEvent&&Id;return d&&l.addEventListener("scrollend",s,Td),()=>{l.removeEventListener("scroll",o),d&&l.removeEventListener("scrollend",s)}},Rd=(e,t,l)=>{if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e){return Math.round(e[l.options.horizontal?"inlineSize":"blockSize"])}}return e[l.options.horizontal?"offsetWidth":"offsetHeight"]},kd=(e,{adjustments:t=0,behavior:l},n)=>{var a,r;const i=e+t;null===(r=null===(a=n.scrollElement)||void 0===a?void 0:a.scrollTo)||void 0===r||r.call(a,{[n.options.horizontal?"left":"top"]:i,behavior:l})};class Ld{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver((e=>{e.forEach((e=>{const t=()=>{this._measureElement(e.target,e)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()}))})):null);return{disconnect:()=>{var l;null===(l=t())||void 0===l||l.disconnect(),e=null},observe:e=>{var l;return null===(l=t())||void 0===l?void 0:l.observe(e,{box:"border-box"})},unobserve:e=>{var l;return null===(l=t())||void 0===l?void 0:l.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach((([t,l])=>{void 0===l&&delete e[t]})),this.options=Object.assign({debug:!1,noCache:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:wd,rangeExtractor:Sd,onChange:()=>{},measureElement:Rd,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1},e)},this.notify=e=>{var t,l;null===(l=(t=this.options).onChange)||void 0===l||l.call(t,this,e)},this.maybeNotify=bd((()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null])),(e=>{this.notify(e)}),{key:"maybeNotify",noCache:()=>this.options.noCache,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach((e=>e())),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e,t;const l=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==l){if(this.cleanup(),!l)return void this.maybeNotify();this.scrollElement=l,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=null!==(t=null===(e=this.scrollElement)||void 0===e?void 0:e.window)&&void 0!==t?t:null,this.elementsCache.forEach((e=>{this.observer.observe(e)})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,(e=>{this.scrollRect=e,this.maybeNotify()}))),this.unsubs.push(this.options.observeElementOffset(this,((e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.maybeNotify()})))}},this.getSize=()=>{var e;return this.options.enabled?(this.scrollRect=null!==(e=this.scrollRect)&&void 0!==e?e:this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0)},this.getScrollOffset=()=>{var e;return this.options.enabled?(this.scrollOffset=null!==(e=this.scrollOffset)&&void 0!==e?e:"function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset,this.scrollOffset):(this.scrollOffset=null,0)},this.getFurthestMeasurement=(e,t)=>{const l=new Map,n=new Map;for(let a=t-1;a>=0;a--){const t=e[a];if(l.has(t.lane))continue;const r=n.get(t.lane);if(null==r||t.end>r.end?n.set(t.lane,t):t.end<r.end&&l.set(t.lane,!0),l.size===this.options.lanes)break}return n.size===this.options.lanes?Array.from(n.values()).sort(((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end))[0]:void 0},this.getMeasurementOptions=bd((()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled]),((e,t,l,n,a)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:l,getItemKey:n,enabled:a})),{key:!1}),this.getMeasurements=bd((()=>[this.getMeasurementOptions(),this.itemSizeCache]),(({count:e,paddingStart:t,scrollMargin:l,getItemKey:n,enabled:a},r)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];0===this.measurementsCache.length&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach((e=>{this.itemSizeCache.set(e.key,e.size)})));const i=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const o=this.measurementsCache.slice(0,i);for(let a=i;a<e;a++){const e=n(a),i=1===this.options.lanes?o[a-1]:this.getFurthestMeasurement(o,a),s=i?i.end+this.options.gap:t+l,d=r.get(e),u="number"==typeof d?d:this.options.estimateSize(a),c=s+u,f=i?i.lane:a%this.options.lanes;o[a]={index:a,start:s,size:u,end:c,key:e,lane:f}}return this.measurementsCache=o,o}),{key:"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=bd((()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes]),((e,t,l,n)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:l,lanes:n}){const a=e.length-1,r=t=>e[t].start;if(e.length<=n)return{startIndex:0,endIndex:a};let i=Pd(0,a,r,l),o=i;if(1===n)for(;o<a&&e[o].end<l+t;)o++;else if(n>1){const r=Array(n).fill(0);for(;o<a&&r.some((e=>e<l+t));){const t=e[o];r[t.lane]=t.end,o++}const s=Array(n).fill(l+t);for(;i>=0&&s.some((e=>e>=l));){const t=e[i];s[t.lane]=t.start,i--}i=Math.max(0,i-i%n),o=Math.min(a,o+(n-1-o%n))}return{startIndex:i,endIndex:o}}({measurements:e,outerSize:t,scrollOffset:l,lanes:n}):null),{key:"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=bd((()=>{let e=null,t=null;const l=this.calculateRange();return l&&(e=l.startIndex,t=l.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]}),((e,t,l,n,a)=>null===n||null===a?[]:e({startIndex:n,endIndex:a,overscan:t,count:l,offset:this.getScrollOffset()})),{key:"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,l=e.getAttribute(t);return l?parseInt(l,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{const l=this.indexFromElement(e),n=this.measurementsCache[l];if(!n)return;const a=n.key,r=this.elementsCache.get(a);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(a,e)),e.isConnected&&this.resizeItem(l,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{var l;const n=this.measurementsCache[e];if(!n)return;const a=t-(null!==(l=this.itemSizeCache.get(n.key))&&void 0!==l?l:n.size);0!==a&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(n,a,this):n.start<this.getScrollOffset()+this.scrollAdjustments)&&(this.options.debug&&console.info("correction",a),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,t)),this.notify(!1))},this.measureElement=e=>{e?this._measureElement(e,void 0):this.elementsCache.forEach(((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))}))},this.getVirtualItems=bd((()=>[this.getVirtualIndexes(),this.getMeasurements()]),((e,t)=>{const l=[];for(let n=0,a=e.length;n<a;n++){const a=t[e[n]];l.push(a)}return l}),{key:"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0!==t.length)return xd(t[Pd(0,t.length-1,(e=>xd(t[e]).start),e)])},this.getOffsetForAlignment=(e,t,l=0)=>{const n=this.getSize(),a=this.getScrollOffset();"auto"===t&&(t=e>=a+n?"end":"start"),"center"===t?e+=(l-n)/2:"end"===t&&(e-=n);const r=this.getTotalSize()+this.options.scrollMargin-n;return Math.max(Math.min(r,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const l=this.measurementsCache[e];if(!l)return;const n=this.getSize(),a=this.getScrollOffset();if("auto"===t)if(l.end>=a+n-this.options.scrollPaddingEnd)t="end";else{if(!(l.start<=a+this.options.scrollPaddingStart))return[a,t];t="start"}const r="end"===t?l.end+this.options.scrollPaddingEnd:l.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(r,t,l.size),t]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:t="start",behavior:l}={})=>{"smooth"===l&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:l})},this.scrollToIndex=(e,{align:t="auto",behavior:l}={})=>{"smooth"===l&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1));let n=0;const a=t=>{if(!this.targetWindow)return;const n=this.getOffsetForIndex(e,t);if(!n)return void console.warn("Failed to get offset for index:",e);const[a,i]=n;this._scrollToOffset(a,{adjustments:void 0,behavior:l}),this.targetWindow.requestAnimationFrame((()=>{const t=this.getScrollOffset(),l=this.getOffsetForIndex(e,i);var n,a;l?(n=l[0],a=t,Math.abs(n-a)<1.01||r(i)):console.warn("Failed to get offset for index:",e)}))},r=t=>{this.targetWindow&&(n++,n<10?(this.options.debug&&console.info("Schedule retry",n,10),this.targetWindow.requestAnimationFrame((()=>a(t)))):console.warn(`Failed to scroll to index ${e} after 10 attempts.`))};a(t)},this.scrollBy=(e,{behavior:t}={})=>{"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e,t;const l=this.getMeasurements();let n;if(0===l.length)n=this.options.paddingStart;else if(1===this.options.lanes)n=null!==(t=null===(e=l[l.length-1])||void 0===e?void 0:e.end)&&void 0!==t?t:0;else{const e=Array(this.options.lanes).fill(null);let t=l.length-1;for(;t>=0&&e.some((e=>null===e));){const n=l[t];null===e[n.lane]&&(e[n.lane]=n.end),t--}n=Math.max(...e.filter((e=>null!==e)))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:l})=>{this.options.scrollToFn(e,{behavior:l,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const Pd=(e,t,l,n)=>{for(;e<=t;){const a=(e+t)/2|0,r=l(a);if(r<n)e=a+1;else{if(!(r>n))return a;t=a-1}}return e>0?e-1:0};const Ad="undefined"!=typeof document?$.useLayoutEffect:$.useEffect;function Fd(e){return function(e){const t=$.useReducer((()=>({})),{})[1],l=Object.assign(Object.assign({},e),{onChange:(l,n)=>{var a;n?v.flushSync(t):t(),null===(a=e.onChange)||void 0===a||a.call(e,l,n)}}),[n]=$.useState((()=>new Ld(l)));return n.setOptions(l),Ad((()=>n._didMount()),[]),Ad((()=>n._willUpdate())),n}(Object.assign({observeElementRect:Nd,observeElementOffset:Od,scrollToFn:kd},e))}const _d=e=>(e=>null!=e&&"object"==typeof e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE)(e)?e.ownerDocument:document,Dd=(e,t)=>!t.map((e=>Array.from(document.querySelectorAll(e)))).flat().some((t=>null==t?void 0:t.contains(e.target))),Md=(e,t)=>{var l;const n=e.target;return!("button"in e&&e.button>0)&&(!(n&&!_d(n).contains(n))&&!(null===(l=t.current)||void 0===l?void 0:l.contains(n)))};function Hd({ref:e,handler:t,enabled:l=!0,omitClassNames:n=[]}){const a=st(t),r=$.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1});$.useEffect((()=>{if(!l)return;const i=t=>{Md(t,e)&&(r.current.isPointerDown=!0)},o=l=>{r.current.ignoreEmulatedMouseEvents?r.current.ignoreEmulatedMouseEvents=!1:t&&r.current.isPointerDown&&Md(l,e)&&Dd(l,n)&&(r.current.isPointerDown=!1,a(l))},s=l=>{r.current.ignoreEmulatedMouseEvents=!0,t&&r.current.isPointerDown&&Md(l,e)&&Dd(l,n)&&(r.current.isPointerDown=!1,a(l))},d=_d(e.current);return d.addEventListener("mousedown",i,!0),d.addEventListener("mouseup",o,!0),d.addEventListener("touchstart",i,!0),d.addEventListener("touchend",s,!0),()=>{d.removeEventListener("mousedown",i,!0),d.removeEventListener("mouseup",o,!0),d.removeEventListener("touchstart",i,!0),d.removeEventListener("touchend",s,!0)}}),[t,e,a,r,l])}const qd=e=>{const{pivotRef:t,getRowKey:l,size:n}=js(),{scrollbarRef:a,clicked:r,setHighlightKey:i,setClicked:o}=hd(),{flatGroupData:s}=t.current,{rowHighlight:d}=t.current.props,u=q.default.useMemo((()=>2*bi.rowHeightMaps[n]),[n]),c=q.default.useMemo((()=>s.filter((e=>!As(e)))),[s]),f=st((t=>{var n,s;const{keyCode:f}=t;if(!De(r)&&(27===f&&(i(""),o([])),38===f||40===f)){Zl(t);const p=c.length;let m=c.findIndex((e=>l(e,e.index)===r[0]));const h=38===f?(--m+p)%p:++m%p,g=c[h],v=l(g,g.index);d&&!(null===(n=d.disabled)||void 0===n?void 0:n.call(d,g))&&(i(v),null===(s=d.onChange)||void 0===s||s.call(d,v,g)),((t,l,n)=>{const r=c.length,i=e.find((e=>e.key===n)),o=a.current.scrollTop,s=a.current.container.offsetHeight,d=i.top,f=i.height;"top"===t?d<o?a.current.SET_SCROLL_TOP(d):l===r-1&&a.current.SET_SCROLL_TOP(d-(s-f)):d+f>o+(s-u)?a.current.SET_SCROLL_TOP(d-(s-u-f)):0===l&&a.current.SET_SCROLL_TOP(d)})(38===f?"top":"bottom",h,v),o([v,r[1]])}}));q.default.useLayoutEffect((()=>(window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f))),[])},$d=()=>q.default.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.createElement("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"})),jd=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.createElement("path",{d:"M839.111111 269.198222V122.908444A9.159111 9.159111 0 0 0 829.980444 113.777778H208.213333A9.159111 9.159111 0 0 0 199.111111 122.908444v146.289778c0 5.034667 4.124444 9.159111 9.130667 9.159111h64a9.159111 9.159111 0 0 0 9.159111-9.159111V196.067556h192v640h-105.159111a9.159111 9.159111 0 0 0-9.130667 9.130666v64c0 5.034667 4.124444 9.159111 9.130667 9.159111h301.738666a9.159111 9.159111 0 0 0 9.130667-9.159111v-64a9.159111 9.159111 0 0 0-9.130667-9.130666h-105.159111v-640h192v73.130666c0 5.034667 4.124444 9.159111 9.159111 9.159111h64a9.159111 9.159111 0 0 0 9.130667-9.159111z"})),Kd=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.createElement("path",{d:"M887.65217391 606.59279489a31.26857185 31.26857185 0 0 1-31.26857185-31.26857087v-363.48819946L158.38608696 909.83354065a31.26857185 31.26857185 0 1 1-44.21962762-44.21962761l697.99751609-698.06906805h-363.48819945a31.26857185 31.26857185 0 0 1 0-62.46559075h439.04795087c17.17267109 0 31.26857185 13.95279489 31.26857086 31.19701891v439.04795087a31.26857185 31.26857185 0 0 1-31.3401238 31.26857087z"})),Vd=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.createElement("path",{d:"M606.4 103.424a64 64 0 0 1 0.704 0.64l320.256 280.32a64 64 0 0 1 7.104 89.024l-330.432 398.72 320.448 0.128a32 32 0 0 1 0 64.064H397.632a32.128 32.128 0 0 1-6.208-0.64h-20.736a64 64 0 0 1-42.304-16.064l-238.08-210.112A64 64 0 0 1 83.84 620.16l432.32-509.312a64 64 0 0 1 90.24-7.36zM242.048 537.536l-87.04 101.76a32 32 0 0 0 3.584 45.248l213.12 180.672a32 32 0 0 0 20.736 7.616l-0.64-0.064a32.192 32.192 0 0 1 5.76-0.512h102.016a32 32 0 0 0 18.176-10.496l40.96-47.232-316.672-276.992zM592.96 177.28a32 32 0 0 0-45.12 3.456L283.712 488.96l316.928 277.248 264.512-304.96a32 32 0 0 0 1.024-40.704l-3.904-4.16-268.928-238.72a32 32 0 0 0-0.384-0.32z"})),zd=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.createElement("path",{d:"M607.75537778 291.05948444H223.6416l115.34336-115.41617778a36.37248 36.37248 0 1 0-51.48216889-51.44576L132.61937778 279.04455111c-13.54410667 13.50769778-21.04433778 31.67573333-21.11715556 50.97244444a71.72551111 71.72551111 0 0 0 21.11715556 51.51857778l154.88341333 154.91982222a36.29966222 36.29966222 0 0 0 51.48216889 0 36.37248 36.37248 0 0 0 0-51.48216889l-121.46005333-121.16878222H607.75537778c130.70791111 0 237.02186667 106.16832 237.02186667 236.65777777s-106.31395555 236.65777778-237.02186667 236.65777778h-254.13404445a36.40888889 36.40888889 0 0 0 0 72.81777779h254.13404445c170.83050667 0 309.83964445-138.82709333 309.83964444-309.47555557 0-170.64846222-139.00913778-309.47555555-309.83964444-309.47555555"})),Wd=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.createElement("path",{d:"M512 680.20451555l354.04003555-354.04003556a48.54556445 48.54556445 0 0 1 68.64213334 68.64213334L546.32220445 783.16999111a48.54556445 48.54556445 0 0 1-68.64213334 0L89.31555555 394.80775111a48.54556445 48.54556445 0 0 1 68.64327112-68.64327112L512 680.20451555z"})),Bd=e=>{const{column:t,keyPath:l,type:n}=e,{prefixCls:a,countMethod:r,summationData:i,setCountMethod:o}=js(),{t:s}=ot(),{dataIndex:u,filter:c}=t,[f,p]=q.default.useState(!1),m=q.default.useMemo((()=>{const e=[{text:s("qm.pivotGrid.count.records"),value:"count",fn:Hs.count},{text:s("qm.pivotGrid.count.unique"),value:"unique",fn:Hs.unique},{text:s("qm.pivotGrid.count.empty"),value:"empty",fn:Hs.empty},{text:s("qm.pivotGrid.count.notEmpty"),value:"notEmpty",fn:Hs.notEmpty},{text:s("qm.pivotGrid.count.sum"),value:"sum",fn:Hs.sum},{text:s("qm.pivotGrid.count.max"),value:"max",fn:Hs.max},{text:s("qm.pivotGrid.count.min"),value:"min",fn:Hs.min},{text:s("qm.pivotGrid.count.avg"),value:"avg",fn:Hs.avg}];return"number"===(null==c?void 0:c.type)?e:e.slice(0,-4)}),[]),h=q.default.useMemo((()=>{var e,t,a;const o=r[u];if(!o)return s("qm.pivotGrid.count.statistic");const d=m.find((e=>e.value===o)).text,c=null!==(a=null===(t=null===(e=((e,t)=>t?Fs(e,t):e)(i,l))||void 0===e?void 0:e[n])||void 0===t?void 0:t[u])&&void 0!==a?a:"";return d+" "+Da(c)}),[i,r]);return q.default.createElement(d.Dropdown,{open:f,trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container"),style:{padding:5}},q.default.createElement("div",{className:"list"},m.map((e=>{const t=e.value===r[u];return q.default.createElement("li",{key:e.value,className:J.default("ant-dropdown-menu-item check-item",{active:t}),onClick:()=>{o({[u]:t?void 0:e.value}),p(!1)}},q.default.createElement("span",{className:"label"},e.text),q.default.createElement("i",{className:"icon"},q.default.createElement(g.CheckOutlined,null)))})))),className:J.default("count-select",{show:!!r[u]}),overlayClassName:`${a}__popper`,placement:"bottomRight",overlayStyle:{minWidth:140},onOpenChange:e=>p(e)},q.default.createElement("span",null,h," ",q.default.createElement(g.CaretDownOutlined,{className:"icon"})))},Ud=(e,t)=>{const{pivotRef:l,columns:n,expandedKeys:a,searchResults:r,switchIndex:i,fillColorCells:o,setExpandedKeys:s}=js(),{gridRef:u,indentDepth:c,highlightKey:f,checkedColumnKey:p,selectionKeys:m,treeExpandKeys:h,setSelectionKeys:v,setTreeExpandKeys:y,setHighlightKey:b,setClicked:x}=hd(),{keyRecordMap:E,isTree:C}=l.current,{bodyEl:w,rowVirtualizer:S}=u.current,{rowSelection:N,treeExpandable:T,rowHighlight:I,openRowDraggable:O,onRowEdit:R,onRowClick:k}=l.current.props,{t:L}=ot(),{renderText:P,getTitleFromCellNode:A}=Oi(),{expandableColumn:F,selectionColumn:_,operationColumn:D,treeTable:M}=bi,{indentWidth:H}=ks,$=q.default.useMemo((()=>t?0:Ls(n).length-e.length),[n,e]),j=q.default.useMemo((()=>"radio"!==(null==N?void 0:N.type)),[N]),K=(e,t)=>{var l,n;null==N||N.checkStrictly;const a=j?e?[...m,t]:m.filter((e=>e!==t)):[t];v(a),null===(l=null==N?void 0:N.onSelect)||void 0===l||l.call(N,e,E.get(t)),null===(n=null==N?void 0:N.onChange)||void 0===n||n.call(N,a,V(a))},V=e=>{const t=[];return e.forEach((e=>t.push(E.get(e)))),t},z=(e,t)=>{var l,n;return(null===(l=r[i])||void 0===l?void 0:l.rowKey)===e&&(null===(n=r[i])||void 0===n?void 0:n.dataIndex)===t},W=(e,t)=>{const l=w.querySelectorAll(`li.table-row[data-row-key='${e}']`);Array.from(l).forEach((e=>{e.classList[t&&!(null==S?void 0:S.isScrolling)?"add":"remove"]("row--hover")}))},B=e=>q.default.createElement("button",{className:J.default("button-icon",{expand:a.includes(e.id)}),onClick:()=>{return t=e.id,void s(a.includes(t)?a.filter((e=>e!==t)):[...a,t]);var t}},q.default.createElement(g.CaretRightOutlined,null)),U=(l,a,r,i)=>{const{dataIndex:o,width:s,renderWidth:d}=l,u={"expandable-column":o===_},f=a===(t?e.length>1?1:0:-1)?(c-r._groupLevel)*H:0,p={width:`${(s||d||0)+f}px`,minWidth:`${(s||d||0)+f}px`};return q.default.createElement("div",{key:o,className:J.default("label-cell",u),style:p},o!==_?q.default.createElement(q.default.Fragment,null,1===a&&(e=>{const{_record:t,_fieldName:l}=e,a=Pa(t,l),r=n.find((e=>e.dataIndex===l));if(De(a)||!r)return q.default.createElement("span",{className:"title empty"},L("qm.pivotGrid.group.empty"));const i=r.render?r.render(a,t,r,0,0):P(a,r,t);return r.translate?q.default.createElement(Hr,{text:A(i),tag:"span",className:"title"},i):q.default.createElement("span",{className:"title"},i)})(r),o!==D&&q.default.createElement(Bd,{column:l,keyPath:r.id,type:"subtotal"})):B(r))},G=(e,t)=>{var l,n;const a=null===(l=null==T?void 0:T.rowExpandable)||void 0===l?void 0:l.call(T,e);return(null===(n=e.children)||void 0===n?void 0:n.length)?q.default.createElement("span",{className:J.default("cell--expand",{fold:!h.includes(t),disabled:a}),onClick:()=>{a||(e=>{var t,l;const n=h.includes(e),a=n?h.filter((t=>t!==e)):[...h,e];y(a),null===(t=null==T?void 0:T.onExpand)||void 0===t||t.call(T,!n,E.get(e)),null===(l=null==T?void 0:T.onChange)||void 0===l||l.call(T,a)})(t)}},q.default.createElement("span",{className:"anticon icon"},q.default.createElement(Wd,null))):q.default.createElement("span",{className:"cell--indent",style:{marginTop:-1,width:M.textIndent}})},Y=(e,t,l,n,a)=>{var r,i;const{dataIndex:s,width:u,renderWidth:c,align:f,translate:h,render:v}=e,y=Pa(l,s),E=v?v(y,l,e,l.index,t):P(y,e,l),w=((e,t)=>[F,_,D].includes(t)?"":A(e))(E,s),S=m.includes(a),T={"selection-column":s===_,"col--center":"center"===f,"col--right":"right"===f,"col--checked":p===s,active:z(a,s)},L={width:`${u||c||0}px`,minWidth:`${u||c||0}px`,backgroundColor:o.get(`${a}|${s}`)};return q.default.createElement("div",{key:s,"data-col-index":t,title:w,className:J.default("table-cell",T),style:L,onClick:t=>{var n,r;[_,D].includes(s)||(x([a,s]),I&&!(null===(n=I.disabled)||void 0===n?void 0:n.call(I,l))&&(b(a),null===(r=I.onChange)||void 0===r||r.call(I,a,l)),null==k||k(l,e,t))}},s!==_?q.default.createElement(q.default.Fragment,null,C&&1===t&&q.default.createElement(q.default.Fragment,null,(H=l._level)?q.default.createElement("span",{key:H,className:`cell--indent indent-level-${H}`,style:{marginTop:-1,width:H*M.textIndent}},new Array(H).fill(null).map(((e,t)=>q.default.createElement("i",{key:t,className:"line"})))):null,G(l,a)),h?q.default.createElement(Hr,{text:w,tag:"span",className:"cell"},E):q.default.createElement("span",{className:"cell"},E)):q.default.createElement("div",{className:"action"},O?q.default.createElement("span",{className:"drag-icon"},q.default.createElement(g.HolderOutlined,null)):q.default.createElement("span",{style:{width:20}}),q.default.createElement("div",{className:"middle"},q.default.createElement("span",{className:"order"},((e,t)=>C?0===e._level?e._varIndex+1:null:t+1)(l,n)),N&&q.default.createElement(q.default.Fragment,null,j?q.default.createElement(d.Checkbox,{className:"checkbox",checked:S,disabled:null===(r=null==N?void 0:N.disabled)||void 0===r?void 0:r.call(N,l),onChange:e=>K(e.target.checked,a)}):q.default.createElement(d.Radio,{className:"checkbox",checked:S,disabled:null===(i=null==N?void 0:N.disabled)||void 0===i?void 0:i.call(N,l),onChange:e=>K(e.target.checked,a)}))),R?q.default.createElement("span",{className:"expand-icon",onClick:()=>R(l,n)},q.default.createElement(g.ExpandAltOutlined,null)):q.default.createElement("span",{style:{width:20}})));var H};return{renderGroupRow:(t,l)=>q.default.createElement("div",{className:"label-row"},e.map(((e,l)=>U(e,$+l,t)))),renderRow:(t,l,n)=>{const a={"row--selection":m.includes(n),"row--highlight":f===n};return q.default.createElement("li",{key:n,"data-row-key":n,className:J.default("table-row",a),onMouseEnter:()=>W(n,!0),onMouseLeave:()=>W(n)},e.map(((e,a)=>Y(e,$+a,t,l,n))))}}},Gd=e=>{const{layout:t,displayList:l,virtualRows:n,notGroup:a}=e,{fixedWidth:r,gridColumns:i}=hd(),o=q.default.useMemo((()=>i.filter((e=>"left"===e.fixed))),[i]),{renderGroupRow:s,renderRow:d}=Ud(o,!0);return q.default.createElement("div",{className:"left-panel",style:{width:r}},q.default.createElement("div",{className:J.default("container",{"no-group":a})},n.map((e=>{const n=e.index,a=t[n],r=l[n];if(As(r))return q.default.createElement("div",{key:r.id,className:J.default("group-label",`level${r._groupLevel}`),style:{top:a.top,left:a.left,right:0,height:a.height}},s(r,a.key));const i=n===t.length-1||As(l[n+1]);return q.default.createElement("div",{key:a.key,className:J.default("row-item",{"is-leaf":r._level,last:i}),style:{top:a.top,left:a.left,right:0,height:a.height}},d(r,r._varIndex,a.key))}))))},Yd=e=>{const{layout:t,displayList:l,virtualRows:n,notGroup:a}=e;js();const{gridColumns:r}=hd(),i=q.default.useMemo((()=>r.filter((e=>"left"!==e.fixed))),[r]),{renderGroupRow:o,renderRow:s}=Ud(i);return q.default.createElement("div",{className:"main-panel"},q.default.createElement("div",{className:J.default("container",{"no-group":a})},n.map((e=>{const n=e.index,a=t[n],r=l[n];if(As(r))return q.default.createElement("div",{key:r.id,className:J.default("group-label",`level${r._groupLevel}`),style:{top:a.top,left:0,right:a.right,height:a.height}},o(r,a.key));const i=n===t.length-1||As(l[n+1]);return q.default.createElement("div",{key:a.key,className:J.default("row-item",{last:i}),style:{top:a.top,left:0,right:a.right,height:a.height}},s(r,r._varIndex,a.key))}))))},Xd=()=>{const{pivotRef:e,getRowKey:t,prefixCls:l,size:n,groupGridData:a,expandedKeys:r,searchResults:i,switchIndex:o}=js(),{scrollbarRef:s,gridColumns:d,treeExpandKeys:u,setGridLayoutRef:c}=hd(),{flatGroupData:f}=e.current,{contextMenues:p}=e.current.props,{groupMargin:m}=ks,{rowHeightMaps:h}=bi,g=q.default.useRef(null),v=q.default.useMemo((()=>Array.isArray(a)),[a]),{contextMenu:y,closeMenu:b}=(({ref:e,popup:t,getTriggerContainer:l,prevent:n,prefixCls:a="",enabled:r=!0})=>{const i=q.default.useRef(null),o=q.default.useRef(null),s=e=>{o.current=e},[d,u]=q.default.useState(!1),[c,f]=q.default.useState(null),p={width:150,height:200,zIndex:9999};Hd({ref:i,handler:()=>m()});const m=()=>{u(!1),f(null),s(null)},h=st((e=>{if(e.preventDefault(),null==n?void 0:n(e.target))return m();s(e),u(!0),Fe((()=>{var t;const{width:l,height:n}=(null===(t=i.current)||void 0===t?void 0:t.getBoundingClientRect())||p,a=l,r=n,o=window.innerWidth,s=window.innerHeight;let d=e.clientX,u=e.clientY;d+a>o&&(d=Math.max(d-a,0)),u+r>s&&(u=Math.max(u-r,0)),f({x:d,y:u})}))}));q.default.useEffect((()=>{const t=(null==l?void 0:l(e.current))||e.current;return r&&t&&t.addEventListener("contextmenu",h),()=>{t&&t.removeEventListener("contextmenu",h)}}),[e]);const g={position:"fixed",top:`${(null==c?void 0:c.y)||0}px`,left:`${(null==c?void 0:c.x)||0}px`,zIndex:p.zIndex};return{contextMenu:q.default.createElement(ue.default,{open:d},q.default.createElement("div",{ref:i,className:`${a}__context-menu`,style:g},o.current?t(o.current):null)),closeMenu:m}})({ref:g,prevent:e=>e.offsetParent.classList.contains("group-label"),prefixCls:l,enabled:!!p,popup:e=>{var l;const n=an(e.target,"table-cell"),a=(null===(l=null==n?void 0:n.parentNode)||void 0===l?void 0:l.getAttribute("data-row-key"))||"",r=f.find((e=>t(e,e.index)==a)),i=Number((null==n?void 0:n.getAttribute("data-col-index"))||-1),o=d[i];return q.default.createElement("ul",{className:"ant-dropdown-menu",style:{padding:5}},p.map((e=>{var t;const l=(null===(t=e.disabled)||void 0===t?void 0:t.call(e,r,o))||!1;return q.default.createElement("li",{key:e.key,className:J.default("ant-dropdown-menu-item",{"ant-dropdown-menu-item-disabled":l}),onClick:()=>{var t;l||(Fe((()=>b())),null===(t=e.onClick)||void 0===t||t.call(e,r,o))}},e.prefix&&q.default.createElement("span",{className:"prefix"},e.prefix),q.default.createElement("span",{className:"label"},e.label),e.suffix&&q.default.createElement("span",{className:"suffix"},e.suffix))})))}}),x=e=>{var t;const l=f[e];for(let n=e+1;n<f.length;n++)if(null===(t=f[n]._parentRowKey)||void 0===t?void 0:t.startsWith(l.id)){Object.assign(l,{_record:f[n]});break}},E=q.default.useMemo((()=>{const e=new Map,l=[];return f.forEach(((n,a)=>{if(As(n)){if(0===n._groupLevel)return e.set(n.id,r.includes(n.id)),x(a),void l.push(n);const t=n.id.slice(0,n.id.lastIndexOf(ks.separator));return void(r.includes(t)&&e.get(t)&&(e.set(n.id,r.includes(n.id)),x(a),l.push(n)))}const i=t(n,n.index);n._parentRowKey&&!e.get(n._parentRowKey)||(e.set(i,u.includes(i)),l.push(n))})),e.clear(),l}),[a,r,u]),C=q.default.useMemo((()=>((e,{getRowKey:t,rowHeight:l})=>{const n=[],a=[],r=l,i=ks.indentWidth,o=ks.groupMargin;let s=o;for(e.forEach((e=>{if(void 0!==e._groupLevel){for(;a.length>0&&a[a.length-1]._level>=e._groupLevel;){const e=a.pop();if(e.height=e._childHeight+r,n[e._index].height=e.height,a.length>0){const t=a[a.length-1];t._childHeight+=e.height+o,t._subGroupCount+=1}s+=o}a[a.length-1];const t={key:e.id,top:s,left:i*e._groupLevel,right:i*e._groupLevel,height:r,_childHeight:0,_subGroupCount:0,_index:n.length,_level:e._groupLevel};n.push(t),a.push(t),s+=r}else{const l=a[a.length-1]||{left:0,right:0},i={key:t(e,e.index),top:s,left:l.left,right:l.right,height:r};n.push(i),s+=r,a.length>0&&(l._childHeight+=r)}}));a.length>0;){const e=a.pop();if(e.height=e._childHeight+r,n[e._index].height=e.height,a.length>0){const t=a[a.length-1];t._childHeight+=e.height+o,t._subGroupCount+=1}s+=o}return n})(E,{getRowKey:t,rowHeight:h[n]})),[E,n]);qd(C);const w=q.default.useMemo((()=>!E.length),[E]),S=q.default.useMemo((()=>{if(w)return 106;if(v)return C.reduce(((e,t)=>e+t.height),0)+2*m;const e=C.filter((e=>0===e._level));return e.reduce(((e,t)=>e+t.height),0)+(e.length-1)*m+2*m}),[w,v,C]),{rowVirtualizer:N,virtualRows:T}=(e=>{const{layout:t,isGroup:l}=e,{size:n}=js(),{scrollbarRef:a}=hd(),{rowHeightMaps:r}=bi,i=q.default.useMemo((()=>{var e;return(null===(e=a.current)||void 0===e?void 0:e.scrollElement)||null}),[a.current]),o=Fd({count:t.length,getScrollElement:()=>i,estimateSize:e=>t[e].height,overscan:1,noCache:l,rangeExtractor:e=>{if(!l)return Sd(e);const a=e.offset,i=o.scrollElement.offsetHeight,s=[];for(let l=0;l<e.count;l++){const e=t[l];a>e.top+e.height+r[n]||a+i+r[n]<e.top||s.push(l)}return s}}),s=o.getVirtualItems();return{rowVirtualizer:o,virtualRows:s}})({layout:C,isGroup:!v});Yl((()=>{const e=f.findIndex((e=>{var l;return t(e,e.index)===(null===(l=i[o])||void 0===l?void 0:l.rowKey)}));e>=0&&s.current.SET_SCROLL_TOP(e*h[n]);const l=d.findIndex((e=>{var t;return e.dataIndex===(null===(t=i[o])||void 0===t?void 0:t.dataIndex)}));if(l>=0){const e=d.slice(0,l).filter((e=>"left"!==e.fixed)).reduce(((e,t)=>e+(t.width||t.renderWidth)),0);s.current.SET_SCROLL_LEFT(e)}}),[o,i]),q.default.useLayoutEffect((()=>{c("bodyEl",g.current),c("rowVirtualizer",N)}),[]);const I={layout:C,displayList:E,virtualRows:T,notGroup:v};return q.default.createElement("div",{ref:g,className:"body",style:{height:S}},w?q.default.createElement(pn,{className:"content-empty"}):q.default.createElement(q.default.Fragment,null,q.default.createElement(Gd,I),q.default.createElement(Yd,I),y))},Qd=()=>{const{groupGridData:e,countMethod:t,setSummationData:l}=js(),{indentDepth:n,fixedWidth:a,gridColumns:r}=hd(),{selectionColumn:i}=bi,{indentWidth:o}=ks,s=q.default.useMemo((()=>r.filter((e=>"left"===e.fixed))),[r]),d=q.default.useMemo((()=>r.filter((e=>"left"!==e.fixed))),[r]);Yl((()=>{l(((e,t)=>{const l=[],n=e=>{const l={};for(const n in t){const a=e.map((e=>Me(e,n)));l[n]=t[n](a)}return l},a=e=>{if(Array.isArray(e))return l.push(...e),{total:n(e)};const r={},i={};Object.keys(t).forEach((e=>{i[e]=[]}));for(const n in e){const o=e[n];if(Array.isArray(o)){l.push(...o);const e={};for(const l in t){const n=o.map((e=>Me(e,l)));e[l]=t[l](n),i[l].push(...n)}r[n]={subtotal:e}}else{const e=a(o);r[n]=e;for(const l in t){const t=e.subtotal[l];void 0!==t&&i[l].push(t)}}}if(0===l.length)return r;const o={};for(const e in t)o[e]=t[e](i[e]);return r.subtotal=o,r},r=Array.isArray(e)?{total:n(e)}:a(e);return l.length>0&&(r.total=n(l)),delete r.subtotal,r})(e,(e=>{const t={};for(const l in e)e[l]&&Object.assign(t,{[l]:Hs[e[l]]});return t})(t)))}),[t,e]);const u=(e,t)=>q.default.createElement("div",{className:J.default(t?"fixed-left":"no-fixed"),style:{width:t?a:""}},e.map(((l,a)=>{const{dataIndex:r,width:s,renderWidth:d}=l,u={"selection-column":r===i,"col--right":!0},c=a===(t?e.length>1?1:0:e.length-1)?n*o:0,f={width:`${(s||d||0)+c}px`,minWidth:`${(s||d||0)+c}px`};return q.default.createElement("div",{key:r,className:J.default("table-cell",u),style:f},r!==i?q.default.createElement(Bd,{column:l,keyPath:"",type:"total"}):null)})));return q.default.createElement("div",{className:"footer"},u(s,!0),u(d))},Zd=()=>{const{prefixCls:e,size:t}=js(),l=q.default.useRef(null);return q.default.createElement(md,{scrollbar:l},q.default.createElement(_n,{ref:l,wrapStyle:{height:"100%",maxHeight:"inherit"},className:J.default(`${e}__layout`,t)},q.default.createElement(yd,null),q.default.createElement(Xd,null),q.default.createElement(Qd,null)))},Jd=()=>q.default.createElement("div",{className:"wrapper"},q.default.createElement(Zd,null)),eu={rowKey:"id",columns:[],dataSource:[]},tu=e=>{const t=je(eu,e),{rowKey:l,fromTable:n,columns:a,dataSource:r,height:i,maxHeight:o,className:s,style:d}=t,{$size:u}=dt(t),c=st(((e,t)=>{const n="function"==typeof l?l(e,t):null==e?void 0:e[l];return void 0===n?(ft("PivotGrid","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):n})),f=(e,t="",l=0)=>e.map(((e,n)=>{const a=c(e,e.index);return e.index=n,e._level=l,Array.isArray(e.children)&&(e.children=f(e.children,a,l+1)),t?Object.assign(e,{_parentRowKey:t}):e})),p=e=>{let t=(e=>e.filter((e=>![bi.expandableColumn,bi.selectionColumn,"index","pageIndex"].includes(e.dataIndex))))(e).map((e=>Object.assign(Object.assign({},e),{fixed:"left"===e.fixed?"left":void 0,editRender:void 0})));return n&&(t=t.filter((e=>![bi.operationColumn].includes(e.dataIndex)))),t},m=q.default.useMemo((()=>p(a)),[a]),h=q.default.useMemo((()=>f(r)),[r]),g=gt("pivot-grid"),v={[g]:!0,"is-from-table":n},y={height:i,maxHeight:o},b={prefixCls:g,size:u,getRowKey:c,flatColumns:m,tableData:h,pivotProps:He(t,["columns","dataSource","rowKey","size","height","maxHeight","className","style"])};return q.default.createElement("div",{className:J.default(v,s),style:Object.assign(Object.assign({},d),y)},q.default.createElement($s,b,q.default.createElement(fd,null),q.default.createElement(Jd,null)))};tu.displayName="PivotGrid";const lu=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{tableRef:n,prefixCls:a,flattenColumns:r}=q.default.useContext(ei),{rowKey:i,uniqueKey:o}=n.current.props,{t:s}=ot(),{tableFullData:d}=n.current,[u,c]=q.default.useState(!1),f=()=>{c(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:f})));const p={visible:u,title:s("qm.table.pivotGrid.settingTitle"),width:"80vw",loading:!1,bodyStyle:{padding:0},onClose:()=>c(!1)};return q.default.createElement(q.default.Fragment,null,l&&q.default.createElement("span",{className:`${a}-pivot-grid`,title:s("qm.table.pivotGrid.text"),onClick:()=>f()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.LineChartOutlined,null))),q.default.createElement(Qn,p,q.default.createElement(tu,{fromTable:!0,rowKey:i,uniqueKey:o,columns:r,dataSource:d})))}));lu.displayName="PivotGrid";const nu=e=>{const{columns:t,group:n,summary:a}=e,{tableRef:r,$size:i,pagination:o,fetchParams:s,isFetch:d}=q.default.useContext(ei),{fetch:u}=r.current.props,{t:c}=ot(),f=e=>{var l;const n=t.find((t=>t.dataIndex===e));return{title:n.title,precision:n.precision,dictItems:null!==(l=n.dictItems)&&void 0!==l?l:[]}},p=n.map((e=>Object.assign({dataIndex:e.group},f(e.group)))),m=a.map((e=>e.summary===bi.groupSummary.total.value?{dataIndex:e.summary,title:bi.groupSummary.total.text,formula:e.formula}:Object.assign(Object.assign({dataIndex:e.summary},f(e.summary)),{formula:e.formula}))),h=q.default.useMemo((()=>Object.assign({},s,{[bi.sorterFieldName]:void 0,[bi.groupSummary.summaryFieldName]:a.map((e=>`${e.formula}|${e.summary}`)).join(","),[bi.groupSummary.groupbyFieldName]:n.map((e=>e.group)).join(","),usedJH:2,[bi.currentPageName]:1})),[s,n,a]),[g,v]=q.default.useState(((e,l)=>[{title:c("qm.table.groupSummary.index"),dataIndex:"pageIndex",width:80,render:e=>e+1},...e.map((e=>({title:e.title,dataIndex:e.dataIndex,dictItems:e.dictItems}))),...l.map((e=>{var l;const n=null===(l=t.find((t=>t.dataIndex===e.dataIndex)))||void 0===l?void 0:l.groupSummary;let a=n?{summation:n}:null;return e.dataIndex===bi.groupSummary.total.value&&(a={dataIndex:bi.groupSummary.recordTotalIndex,summation:{render:()=>o.total}}),Object.assign(Object.assign({},e),"count"===e.formula||"sum"===e.formula?a:null)}))])(p,m)),[y]=q.default.useState(d?[]:(e=>{const t=za(e,n.map((e=>e.group))),r=[];return t.forEach((e=>{const t={};g.forEach((l=>{const{dataIndex:n}=l;"index"!==n&&Aa(t,n,Pa(e[0],n))})),a.forEach((n=>{const a=n.summary!==bi.groupSummary.total.value?n.summary:bi.groupSummary.recordTotalIndex,r=n.formula;"count"===r&&Aa(t,a,e.length),"sum"===r&&Aa(t,a,l.sumBy(e,a)),"max"===r&&Aa(t,a,l.maxBy(e,a)[a]),"min"===r&&Aa(t,a,l.minBy(e,a)[a]),"avg"===r&&Aa(t,a,(l.sumBy(e,a)/e.length).toFixed(2))})),r.push(t)})),r})(r.current.tableFullData)),b=Object.assign(Object.assign({size:i,height:400},d?{fetch:{api:u.api,params:h,dataKey:null==u?void 0:u.dataKey}}:{dataSource:y}),{columns:g,rowKey:e=>e.index,showFastSearch:!1,showTableImport:!1,exportExcel:{fileName:`${j.default().format(si)}.xlsx`},tablePrint:{showLogo:!0},columnsChange:e=>v(e)});return q.default.createElement(wc,b)},au=e=>{const{onClose:t}=e,{global:l}=q.default.useContext(xe),{tableRef:n,prefixCls:a,$size:r,flattenColumns:i}=q.default.useContext(ei),{uniqueKey:o}=n.current.props,{t:s}=ot(),u=q.default.useRef(null),c=q.default.useRef(null),[f,p]=q.default.useState(!1),[m,h]=q.default.useState([]),[v,y]=q.default.useState(""),[b,x]=q.default.useState("");Yl((()=>{if(b){const{group:e,summary:t}=m.find((e=>e.value===b)).list;I(e),L(t)}else{const e=D();I((null==e?void 0:e.group)||[]),L((null==e?void 0:e.summary)||[])}}),[b]),q.default.useEffect((()=>{M()}),[]);const E=q.default.useMemo((()=>o?`summary_${o}`:""),[o]),C=q.default.useMemo((()=>i.filter((e=>![bi.expandableColumn,bi.selectionColumn,"index","pageIndex",bi.operationColumn].includes(e.dataIndex)))),[i]),w=C.filter((e=>!e.groupSummary)).map((e=>({text:ja(e.title),value:e.dataIndex}))),S=[bi.groupSummary.total,...C.filter((e=>!!e.groupSummary)).map((e=>({text:ja(e.title),value:e.dataIndex})))],N=[{text:s("qm.table.groupSummary.sumText"),value:"sum"},{text:s("qm.table.groupSummary.maxText"),value:"max"},{text:s("qm.table.groupSummary.minText"),value:"min"},{text:s("qm.table.groupSummary.avgText"),value:"avg"},{text:s("qm.table.groupSummary.countText"),value:"count"}],[T,I]=q.default.useState([]),[O,R]=q.default.useState([{title:s("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>q.default.createElement("div",null,q.default.createElement(pt,{type:"text",onClick:()=>{u.current.REMOVE_RECORDS(t)}},s("qm.table.groupSummary.removeText")))},{dataIndex:"group",title:s("qm.table.groupSummary.groupItem"),minWidth:200,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:w.map((e=>Object.assign(Object.assign({},e),{disabled:T.findIndex((t=>t.group===e.value))>-1})))})}]),[k,L]=q.default.useState([]),[P,A]=q.default.useState([{title:s("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>q.default.createElement("div",null,q.default.createElement(pt,{type:"text",onClick:()=>{c.current.REMOVE_RECORDS(t)}},s("qm.table.groupSummary.removeText")))},{dataIndex:"summary",title:s("qm.table.groupSummary.summaryColumn"),minWidth:200,editRender:e=>({type:"select",editable:!0,items:S.map((e=>Object.assign(Object.assign({},e),{disabled:k.findIndex((t=>t.summary===e.value))>-1}))),extra:{cornerSign:!1},onChange:t=>{e.formula=""}})},{dataIndex:"formula",title:s("qm.table.groupSummary.calcFormula"),width:140,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:e.summary===bi.groupSummary.total.value?N.slice(N.length-1):N})}]),F=q.default.useMemo((()=>{const e=T.length&&T.every((e=>Object.values(e).every((e=>""!==e)))),t=k.length&&k.every((e=>Object.values(e).every((e=>""!==e))));return!(e&&t)}),[T,k]),_=()=>{E&&sessionStorage.setItem(E,JSON.stringify({group:T.filter((e=>!!e.group)),summary:k.filter((e=>!!e.summary))}))},D=()=>{if(!E)return;const e=sessionStorage.getItem(E);return e?JSON.parse(e):null},M=()=>Ie(void 0,void 0,void 0,(function*(){if(!E)return;const e=D();if(e){const{group:t,summary:l}=e;I(t),L(l)}let t=yield pe.default.getItem(E);t||(t=yield H(E),Array.isArray(t)&&(yield pe.default.setItem(E,t))),Array.isArray(t)&&t.length&&(h(t),!e&&x(t[0].value))})),H=e=>Ie(void 0,void 0,void 0,(function*(){const t=null==l?void 0:l.getComponentConfigApi;if(t)try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),$=(e,t)=>Ie(void 0,void 0,void 0,(function*(){const n=null==l?void 0:l.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),j={visible:f,title:s("qm.table.groupSummary.resultText"),loading:!1,onClose:()=>p(!1)};return q.default.createElement("div",{className:`${a}-group-summary__setting`},q.default.createElement("div",{className:"main"},q.default.createElement("div",{style:{width:"30%"}},q.default.createElement(wc,{ref:u,size:r,columns:O,dataSource:T,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>R(e),onDataChange:e=>{I(e)}},q.default.createElement(pt,{type:"primary",icon:q.default.createElement(g.PlusOutlined,null),onClick:()=>{u.current.INSERT_RECORDS({})},style:{marginRight:0}}))),q.default.createElement("div",{className:"container line"},q.default.createElement(wc,{ref:c,size:r,columns:P,dataSource:k,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>A(e),onDataChange:e=>{L(e)}},q.default.createElement(pt,{type:"primary",icon:q.default.createElement(g.PlusOutlined,null),onClick:()=>{c.current.INSERT_RECORDS({})},style:{marginRight:0}}))),q.default.createElement("div",{className:"saved line"},q.default.createElement("div",{className:"form-wrap"},q.default.createElement(d.Input,{size:r,value:v,placeholder:s("qm.table.groupSummary.configText"),disabled:F,onChange:e=>{const{value:t}=e.target;y(t)}}),q.default.createElement(pt,{type:"primary",disabled:!v||F,style:{marginLeft:"10px"},onClick:()=>Ie(void 0,void 0,void 0,(function*(){if(!E)return ft("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=$a(),t=[...m,{text:v,value:e,list:{group:T.filter((e=>!!e.group)),summary:k.filter((e=>!!e.summary))}}];h(t),x(e),y(""),yield pe.default.setItem(E,t),yield $(E,t)}))},s("qm.table.groupSummary.saveButton"))),q.default.createElement("div",{className:"card-wrap"},q.default.createElement("h5",{style:{height:`${bi.rowHeightMaps[r]}px`}},q.default.createElement("span",null,s("qm.table.groupSummary.savedSetting"))),q.default.createElement("ul",null,m.map((e=>q.default.createElement("li",{key:e.value,className:J.default({selected:e.value===b}),title:e.text,onClick:()=>{return t=e.value,void x(t!==b?t:"");var t}},q.default.createElement("span",{className:"title"},e.text),q.default.createElement("i",{className:"svgicon close",title:s("qm.table.groupSummary.removeText"),onClick:t=>{var l;t.stopPropagation(),l=e.value,Ie(void 0,void 0,void 0,(function*(){if(!l)return;const e=m.filter((e=>e.value!==l));h(e),l===b&&x(""),yield pe.default.setItem(E,e),yield $(E,e)}))}},q.default.createElement(g.CloseCircleOutlined,null))))),!m.length&&q.default.createElement("div",{style:{padding:ni}},q.default.createElement(pn,null)))))),q.default.createElement(Qn,j,q.default.createElement(nu,{columns:C,group:T,summary:k})),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(pt,{onClick:()=>t(),style:{marginRight:8}},s("qm.table.groupSummary.closeButton")),q.default.createElement(pt,{type:"primary",disabled:F,onClick:()=>(_(),void p(!0))},s("qm.table.groupSummary.confirmButton"))))},ru=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{prefixCls:n}=q.default.useContext(ei),{t:a}=ot(),[r,i]=q.default.useState(!1),o=()=>{i(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:o})));const s={visible:r,title:a("qm.table.groupSummary.settingTitle"),loading:!1,width:"65%",bodyStyle:{paddingBottom:"52px"},onClose:()=>i(!1)};return q.default.createElement(q.default.Fragment,null,l&&q.default.createElement("span",{className:`${n}-group-summary`,title:a("qm.table.groupSummary.text"),onClick:()=>o()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.PieChartOutlined,null))),q.default.createElement(Qn,s,q.default.createElement(au,{onClose:()=>i(!1)})))}));ru.displayName="GroupSummary";const iu=e=>{const{onClose:t}=e,{global:l}=q.default.useContext(xe),{tableRef:n,$size:a,prefixCls:r,flattenColumns:i,setSuperFilters:o,clearTableFilter:s,clearPagerFilter:u}=q.default.useContext(ei),{uniqueKey:c}=n.current.props,{t:f}=ot(),p=q.default.useRef(null),[m,h]=q.default.useState([]),[v,y]=q.default.useState([]),[b,x]=q.default.useState(""),[E,C]=q.default.useState("");Yl((()=>{h(E?v.find((e=>e.value===E)).list:M()||[])}),[E]),q.default.useEffect((()=>{H()}),[]);const w=q.default.useMemo((()=>c?`superSearch_${c}`:""),[c]),S=q.default.useMemo((()=>i.filter((e=>!!e.filter))),[i]),N=Va(m),T=q.default.useMemo((()=>!(N&&ca(N))),[N]),I=q.default.useMemo((()=>!!m.length&&T),[m,T]),O=[{value:"and",text:f("qm.table.highSearch.andText")},{value:"or",text:f("qm.table.highSearch.orText")}],R=i.filter((e=>!!e.filter)).map((e=>({value:e.dataIndex,text:ja(e.title)}))),k=e=>["in","nin"].includes(e),L=(e,t)=>{let l;switch(e){case"number":l="number";break;case"date":l="date";break;case"checkbox":case"radio":l=t?"select-multiple":"select";break;default:l="text"}return l},P=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",text:f("qm.table.highSearch.gtText")},{value:"<",text:f("qm.table.highSearch.ltText")},{value:">=",text:f("qm.table.highSearch.gteText")},{value:"<=",text:f("qm.table.highSearch.lteText")},{value:"==",text:f("qm.table.highSearch.eqText")},{value:"!=",text:f("qm.table.highSearch.neqText")},{value:"nil",text:f("qm.table.highSearch.nullText")},{value:"nnil",text:f("qm.table.highSearch.notNullText")}];break;case"checkbox":case"radio":case"tree":t=[{value:"in",text:f("qm.table.highSearch.inText")},{value:"nin",text:f("qm.table.highSearch.ninText")},{value:"==",text:f("qm.table.highSearch.eqText")},{value:"!=",text:f("qm.table.highSearch.neqText")},{value:"nil",text:f("qm.table.highSearch.nullText")},{value:"nnil",text:f("qm.table.highSearch.notNullText")}];break;default:t=[{value:"like",text:f("qm.table.highSearch.inText")},{value:"nlike",text:f("qm.table.highSearch.ninText")},{value:"==",text:f("qm.table.highSearch.eqText")},{value:"!=",text:f("qm.table.highSearch.neqText")},{value:"^=",text:f("qm.table.highSearch.startsWithText")},{value:"=$",text:f("qm.table.highSearch.endsWithText")},{value:"nil",text:f("qm.table.highSearch.nullText")},{value:"nnil",text:f("qm.table.highSearch.notNullText")}]}return t},[A,F]=q.default.useState([{title:f("qm.table.highSearch.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>q.default.createElement("div",null,q.default.createElement(pt,{type:"text",onClick:()=>{p.current.REMOVE_RECORDS(t)}},f("qm.table.highSearch.removeText")))},{title:f("qm.table.highSearch.bracket"),dataIndex:"bracketLeft",align:"right",width:80,render:(e,t)=>q.default.createElement("span",{style:{fontSize:"20px"}},e)},{title:f("qm.table.highSearch.fieldName"),dataIndex:"fieldName",width:160,required:!0,dictItems:R,editRender:e=>({type:"select",editable:!0,rules:[{required:!0,message:f("qm.table.highSearch.noEmpty")}],extra:{cornerSign:!1},onChange:t=>{var l,n;const a=Object.values(t)[0],r=null===(l=S.find((e=>e.dataIndex===a)))||void 0===l?void 0:l.filter.type,i=P(r);e.fieldType=r,e.expression=a?null===(n=i[0])||void 0===n?void 0:n.value:"",e.condition=k(e.expression)?[]:"",a||(e.bracketLeft=e.bracketRight="")}})},{title:f("qm.table.highSearch.fieldType"),dataIndex:"fieldType",width:100,hidden:!0},{title:f("qm.table.highSearch.expression"),dataIndex:"expression",width:120,required:!0,editRender:e=>{var t;const l=null===(t=S.find((t=>t.dataIndex===e.fieldName)))||void 0===t?void 0:t.filter.type;return{type:"select",editable:!0,items:P(l),extra:{disabled:!e.fieldName,cornerSign:!1},onChange:()=>{e.condition=k(e.expression)?[]:""}}}},{title:f("qm.table.highSearch.condition"),dataIndex:"condition",minWidth:200,editRender:e=>{var t,l,n;const a=S.find((t=>t.dataIndex===e.fieldName)),r=null==a?void 0:a.filter.type,i=null!==(n=null!==(l=null===(t=null==a?void 0:a.filter)||void 0===t?void 0:t.items)&&void 0!==l?l:null==a?void 0:a.dictItems)&&void 0!==n?n:[];return{type:L(r,k(e.expression)),editable:!0,items:i,extra:{disabled:!e.fieldName||Za(e.expression),cornerSign:!1}}}},{title:f("qm.table.highSearch.bracket"),dataIndex:"bracketRight",width:80,render:(e,t)=>q.default.createElement("span",{style:{fontSize:"20px"}},e)},{title:f("qm.table.highSearch.logic"),dataIndex:"logic",width:100,required:!0,dictItems:O,editRender:e=>({type:"select",editable:!0,extra:{disabled:!e.fieldName,cornerSign:!1}})}]),_=()=>{s(),u(),o(m.map((e=>He(e,["index","pageIndex"])))),D(),t()},D=()=>{w&&sessionStorage.setItem(w,JSON.stringify(m.filter((e=>!!e.fieldName))))},M=()=>{if(!w)return;const e=sessionStorage.getItem(w);return e?JSON.parse(e):null},H=()=>Ie(void 0,void 0,void 0,(function*(){if(!w)return;const e=M();e&&h(e);let t=yield pe.default.getItem(w);t||(t=yield $(w),Array.isArray(t)&&(yield pe.default.setItem(w,t))),Array.isArray(t)&&t.length&&(y(t),!e&&C(t[0].value))})),$=e=>Ie(void 0,void 0,void 0,(function*(){const t=null==l?void 0:l.getComponentConfigApi;if(t)try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),j=(e,t)=>Ie(void 0,void 0,void 0,(function*(){const n=null==l?void 0:l.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}}));return q.default.createElement("div",{className:`${r}-super-search__setting`},q.default.createElement("div",{className:"main"},q.default.createElement("div",{className:"container"},q.default.createElement(wc,{ref:p,size:a,columns:A,dataSource:m,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>F(e),onRowClick:(e,t)=>{const{dataIndex:l}=t;e.fieldName&&["bracketLeft","bracketRight"].includes(l)&&("bracketLeft"===l&&(e[l]=e[l]?"":"("),"bracketRight"===l&&(e[l]=e[l]?"":")"),h([...m]))},onDataChange:e=>{h(e)}},q.default.createElement(pt,{type:"primary",icon:q.default.createElement(g.PlusOutlined,null),onClick:()=>{p.current.INSERT_RECORDS({bracketLeft:"",bracketRight:"",logic:"and"})},style:{marginRight:0}})),bi.highSearch.showSQL&&N&&q.default.createElement("code",{className:"lang-js"},N)),q.default.createElement("div",{className:"saved line"},q.default.createElement("div",{className:"form-wrap"},q.default.createElement(d.Input,{size:a,value:b,placeholder:f("qm.table.highSearch.configText"),disabled:T,onChange:e=>{const{value:t}=e.target;x(t)}}),q.default.createElement(pt,{type:"primary",disabled:!b||T,style:{marginLeft:"10px"},onClick:()=>Ie(void 0,void 0,void 0,(function*(){if(!w)return ft("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=$a(),t=[...v,{text:b,value:e,list:m.filter((e=>!!e.fieldName))}];y(t),C(e),x(""),yield pe.default.setItem(w,t),yield j(w,t)}))},f("qm.table.highSearch.saveButton"))),q.default.createElement("div",{className:"card-wrap"},q.default.createElement("h5",{style:{height:`${bi.rowHeightMaps[a]}px`}},q.default.createElement("span",null,f("qm.table.highSearch.savedSetting"))),q.default.createElement("ul",null,v.map((e=>q.default.createElement("li",{key:e.value,className:J.default({selected:e.value===E}),title:e.text,onClick:()=>{return t=e.value,void C(t!==E?t:"");var t}},q.default.createElement("span",{className:"title"},e.text),q.default.createElement("i",{className:"svgicon close",title:f("qm.table.highSearch.removeText"),onClick:t=>{var l;t.stopPropagation(),l=e.value,Ie(void 0,void 0,void 0,(function*(){if(!l)return;const e=v.filter((e=>e.value!==l));y(e),l===E&&C(""),yield pe.default.setItem(w,e),yield j(w,e)}))}},q.default.createElement(g.CloseCircleOutlined,null))))),!v.length&&q.default.createElement("div",{style:{padding:ni}},q.default.createElement(pn,null)))))),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(pt,{onClick:()=>t(),style:{marginRight:8}},f("qm.table.highSearch.closeButton")),q.default.createElement(pt,{type:"primary",disabled:I,onClick:()=>_()},f("qm.table.highSearch.searchButton"))))},ou=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{prefixCls:n}=q.default.useContext(ei),{t:a}=ot(),[r,i]=q.default.useState(!1),o=()=>{i(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:o})));const s={visible:r,title:a("qm.table.highSearch.settingTitle"),loading:!1,width:"70%",bodyStyle:{paddingBottom:"52px"},onClose:()=>i(!1)};return q.default.createElement(q.default.Fragment,null,l&&q.default.createElement("span",{className:`${n}-super-search`,title:a("qm.table.highSearch.text"),onClick:()=>o()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.FunnelPlotOutlined,null))),q.default.createElement(Qn,s,q.default.createElement(iu,{onClose:()=>i(!1)})))}));ou.displayName="SuperSearch";const su=q.default.forwardRef(((e,t)=>{const{tableColumns:l,showFullScreen:n,showReload:a,showPrint:r,showImport:i,showExport:o,showClipboard:s,showCollection:u,showFastSearch:c,showSuperSearch:f,showPivotGrid:p,showGroupSummary:m,showToolBox:h}=e,{global:v}=q.default.useContext(xe),{tableRef:y,$size:b,prefixCls:x,isFullScreen:E}=q.default.useContext(ei),{uniqueKey:C,exportExcel:w}=y.current.props,{t:S}=ot(),N=q.default.useRef(null),T=q.default.useRef(null),I=q.default.useRef(null),O=q.default.useRef(null),R=q.default.useRef(null),k=q.default.useRef(null),L=q.default.useRef(null),P=q.default.useRef(null),A=q.default.useRef(null),F=q.default.useRef(null),_=q.default.useRef(null),D=q.default.useRef(!1),M=q.default.useMemo((()=>C?`toolBox_${C}`:""),[C]),[H,$]=q.default.useState({fullScreen:!1,reload:!1,print:!1,import:!1,export:!1,clipboard:!1,collection:!1,fastSearch:!1,superSearch:!1,pivotGrid:!1,groupSummary:!1}),j={fullScreen:n,reload:a,print:r,import:i,export:o&&!(null==w?void 0:w.hideIcon),clipboard:s,collection:u,fastSearch:c,superSearch:f,pivotGrid:p,groupSummary:m},[K,V]=q.default.useState(!1);Yl((()=>{D.current&&(W(),D.current=!1)}),[H]),q.default.useLayoutEffect((()=>{z()}),[]),q.default.useImperativeHandle(t,(()=>({exportHandle:()=>{if(!R.current)return ft("Table","执行导出需要配置 `exportExcel` 参数");R.current.clickHandle()}})));const z=()=>{if(!M||!h)return;const e=JSON.parse(localStorage.getItem(M));e||B(M).then((e=>{e&&($(Object.assign({},H,e)),localStorage.setItem(M,JSON.stringify(e)))})).catch((()=>{})),e&&$(Object.assign({},H,e))},W=()=>{if(!M||!h)return;const e={};for(const t in H)H[t]&&(e[t]=H[t]);localStorage.setItem(M,JSON.stringify(e)),U(M,e)},B=e=>Ie(void 0,void 0,void 0,(function*(){const t=null==v?void 0:v.getComponentConfigApi;if(t)try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),U=(e,t)=>Ie(void 0,void 0,void 0,(function*(){const l=null==v?void 0:v.saveComponentConfigApi;if(l)try{yield l({[e]:t})}catch(e){}})),G=e=>Ie(void 0,void 0,void 0,(function*(){V(!1),yield Ae(100),e.current.clickHandle()})),Y=(e,t)=>{D.current=!0,$(Object.assign({},H,{[t]:e}))},X={"top-toolbox__popper":!0,[`${x}--lg`]:"large"===b,[`${x}--sm`]:"small"===b};return q.default.createElement(q.default.Fragment,null,n&&q.default.createElement(Ti,{ref:N,isFullScreen:E,open:!h||H.fullScreen}),a&&q.default.createElement(Ii,{ref:T,open:!h||H.reload}),r&&q.default.createElement(Ri,{ref:I,tableColumns:l,open:!h||H.print}),i&&q.default.createElement(ji,{ref:O,tableColumns:l,open:!h||H.import}),o&&q.default.createElement(ws,{ref:R,tableColumns:l,open:(!h||H.export)&&!(null==w?void 0:w.hideIcon)}),s&&q.default.createElement(Ns,{ref:k,open:!h||H.clipboard}),u&&q.default.createElement(Is,{ref:L,columns:l,open:!h||H.collection}),c&&q.default.createElement(Rs,{ref:P,open:!h||H.fastSearch}),p&&q.default.createElement(lu,{ref:A,open:!h||H.pivotGrid}),m&&q.default.createElement(ru,{ref:F,open:!h||H.groupSummary}),f&&q.default.createElement(ou,{ref:_,open:!h||H.superSearch}),h&&q.default.createElement(d.Dropdown,{open:K,trigger:["click"],placement:"bottomRight",dropdownRender:()=>(()=>{const e=[{key:"fullScreen",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{checked:H.fullScreen,style:{marginRight:6},onChange:e=>Y(e.target.checked,"fullScreen"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.screen.full"))),onClick:()=>G(N)},{key:"reload",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{checked:H.reload,style:{marginRight:6},onChange:e=>Y(e.target.checked,"reload"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.refresh.text"))),onClick:()=>G(T)},{key:"print",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{checked:H.print,style:{marginRight:6},onChange:e=>Y(e.target.checked,"print"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.print.text"))),onClick:()=>G(I)},{key:"import",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{checked:H.import,style:{marginRight:6},onChange:e=>Y(e.target.checked,"import"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.import.textNoSpace"))),onClick:()=>G(O)},{key:"export",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{checked:H.export,style:{marginRight:6},onChange:e=>Y(e.target.checked,"export"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.export.textNoSpace"))),onClick:()=>G(R)},{key:"clipboard",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{checked:H.clipboard,style:{marginRight:6},onChange:e=>Y(e.target.checked,"clipboard"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.clipboard.textNoSpace"))),onClick:()=>G(k)},{key:"collection",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{checked:H.collection,style:{marginRight:6},onChange:e=>Y(e.target.checked,"collection"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.selectCollection.text"))),onClick:()=>G(L)},{key:"fastSearch",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{checked:H.fastSearch,style:{marginRight:6},onChange:e=>Y(e.target.checked,"fastSearch"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.fastSearch.text"))),onClick:()=>G(P)},{key:"pivotGrid",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{checked:H.pivotGrid,style:{marginRight:6},onChange:e=>Y(e.target.checked,"pivotGrid"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.pivotGrid.text"))),onClick:()=>G(A)},{key:"groupSummary",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{checked:H.groupSummary,style:{marginRight:6},onChange:e=>Y(e.target.checked,"groupSummary"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.groupSummary.text"))),onClick:()=>G(F)},{key:"superSearch",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{checked:H.superSearch,style:{marginRight:6},onChange:e=>Y(e.target.checked,"superSearch"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.highSearch.text"))),onClick:()=>G(_)}];return q.default.createElement(d.Menu,{items:e.filter((e=>j[e.key]))})})(),overlayClassName:J.default(X),overlayStyle:{minWidth:120},onOpenChange:e=>{V(e)}},q.default.createElement("span",{className:`${x}-toolbox`,title:S("qm.table.toolbox.text")},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.AppstoreAddOutlined,null)))))}));su.displayName="ToolBox";const du=(e,t)=>e.map((e=>(e.children&&(e.children=du(e.children,t)),t(e)))),uu=q.default.forwardRef(((e,t)=>{const{columns:n}=e,{global:a}=q.default.useContext(xe),{tableRef:r,prefixCls:i,$size:o}=q.default.useContext(ei),{showColumnDefine:s,uniqueKey:u,onlyShowIcon:c,columnsChange:f}=r.current.props,{t:p}=ot(),m=q.default.useRef([]),[h,v]=q.default.useState(!1),y=q.default.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"left"===e.fixed)))(n)),[n]),b=q.default.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"right"===e.fixed)))(n)),[n]),x=q.default.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&!e.fixed)))(n)),[n]),E=q.default.useMemo((()=>u?`table_${u}`:""),[u]);Yl((()=>{w(n)}),[n]),q.default.useLayoutEffect((()=>{S()}),[]),q.default.useImperativeHandle(t,(()=>({initialHandler:S})));const C=e=>{if(!E)return;const t=e||n,r=JSON.parse(localStorage.getItem(E));var i;if(r||(i=E,Ie(void 0,void 0,void 0,(function*(){const e=null==a?void 0:a.getComponentConfigApi;if(e)try{const t=yield e({key:i});if(200===t.code)return t.data}catch(e){}}))).then((e=>{e?(localStorage.setItem(E,JSON.stringify(e)),S()):(null==a?void 0:a.getComponentConfigApi)&&w(t)})).catch((()=>{})),!r)return;return l.xor(ga(r).map((e=>e.dataIndex)),ga(t).map((e=>e.dataIndex))).length>0?du(t,(e=>{const t=ya(r,e.dataIndex);return t&&(void 0!==t.hidden&&(e.hidden=t.hidden),void 0!==t.fixed&&(e.fixed=t.fixed),void 0!==t.width&&(e.width=t.width),void 0!==t.renderWidth&&(e.renderWidth=t.renderWidth)),e})):du(r,(e=>{const l=ya(t,e.dataIndex);return void 0===e.fixed&&delete l.fixed,Object.assign({},l,e)}))},w=e=>{if(!E||!r.current.columnsDefined)return;const t=ha(e),n=JSON.parse(localStorage.getItem(E));var i,o;l.isEqual(t,n)||(localStorage.setItem(E,JSON.stringify(t)),i=E,o=t,Ie(void 0,void 0,void 0,(function*(){const e=null==a?void 0:a.saveComponentConfigApi;if(e)try{yield e({[i]:o})}catch(e){}})))},S=e=>{if(!r.current.columnsDefined)return;const t=C(e)||e;var l;t&&(l=N(t),m.current=l,null==f||f(t))},N=e=>{const t=[];return e.filter((e=>!e.noAuth)).forEach(((l,n)=>{const a=l.colSpan;a>1&&e.slice(n+1,n+a).every((({colSpan:e})=>0===e))&&t.push(e.slice(n,n+a))})),t},T=()=>{const e=ga(n),t=l=>l.filter((t=>e.find((e=>e.dataIndex===t.dataIndex)))).map((l=>{const n=e.find((e=>e.dataIndex===l.dataIndex)),a=Object.assign({},n,l);return delete a.renderWidth,void 0===l.hidden&&delete a.hidden,void 0===l.fixed&&delete a.fixed,void 0===l.width&&delete a.width,l.children&&(a.children=t(l.children)),a}));null==f||f(t(r.current.originColumns))},O=e=>{const t=[];e.forEach((l=>{const{colSpan:n,dataIndex:a}=l;if(0===n)return;if(1===n)return t.push(l);const r=m.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(a)));if(-1===r)return t.push(l);t.push(...m.current[r].map((({dataIndex:t},n)=>{const a=e.find((e=>e.dataIndex===t));return n>0&&(void 0!==l.hidden&&(a.hidden=l.hidden),void 0!==l.fixed?a.fixed=l.fixed:a.fixed&&delete a.fixed),a})))})),n.forEach(((e,l)=>{e.noAuth&&t.findIndex((t=>t.dataIndex===e.dataIndex))<0&&t.splice(l,0,e)})),null==f||f(t)},R=(e,t)=>{e.noFixed||(t?e.fixed=t:delete e.fixed,O(n))},k=(e,t)=>{var l;const{colSpan:a,noFixed:r}=e;if(0===a)return q.default.createElement("li",{key:e.dataIndex,style:{display:"none"}});const i=ja(e.title),o=["svgicon","handle",`${t}-handle`],s=q.default.createElement("li",{key:e.dataIndex,className:"item"},q.default.createElement(d.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:l}=t.target;e.hidden=!l,O(n)}}),q.default.createElement("i",{className:J.default(o),title:p("qm.table.columnFilter.draggable")},q.default.createElement(g.HolderOutlined,null)),q.default.createElement("span",{className:"text",title:i},i),"main"===t?q.default.createElement("span",{className:J.default("fixed",r?"disabled":"")},q.default.createElement("i",{className:"svgicon",title:p("qm.table.columnFilter.fixedLeft"),onClick:()=>R(e,"left")},q.default.createElement(g.StepBackwardOutlined,null)),q.default.createElement("i",{className:"svgicon",title:p("qm.table.columnFilter.fixedRight"),onClick:()=>R(e,"right")},q.default.createElement(g.StepForwardOutlined,null))):"sub"!==t?q.default.createElement("span",{className:J.default("fixed",r?"disabled":"")},q.default.createElement("i",{className:"svgicon",title:p("qm.table.columnFilter.cancelFixed"),onClick:()=>R(e)},q.default.createElement(g.CloseCircleOutlined,null))):null);return!e.hidden&&(null===(l=e.children)||void 0===l?void 0:l.length)?q.default.createElement(d.Popover,{key:e.dataIndex,trigger:["hover"],placement:"leftTop",overlayClassName:"column-item__popper",content:L(e.children,e.dataIndex)},s):s},L=(e,t)=>q.default.createElement("div",{className:"column-filter--wrap"},q.default.createElement(I.ReactSortable,{itemKey:"dataIndex",handle:".sub-handle",tag:"ul",animation:200,list:e,setList:a=>{const r=a.map((e=>e.dataIndex)),i=e.map((e=>e.dataIndex));l.isEqual(r,i)||((e,t)=>{ya(n,t).children=e,null==f||f([...n])})(Ya(a),t)}},e.map((e=>k(e,"sub"))))),P={[`${i}__popper`]:!0,"column-filter__popper":!0,[`${i}--lg`]:"large"===o,[`${i}--sm`]:"small"===o},A=[`${i}-column-filter`,{selected:h}];return s?q.default.createElement(xs,{action:["click"],popupVisible:h,popup:q.default.createElement("div",{className:"column-filter--wrap",style:{maxHeight:"calc(100vh - 10px)"}},q.default.createElement("div",{className:"reset"},q.default.createElement(pt,{type:"text",size:"small",onClick:T},p("qm.table.columnFilter.reset"))),q.default.createElement("div",{className:"left"},q.default.createElement(I.ReactSortable,{itemKey:"dataIndex",handle:".left-handle",tag:"ul",animation:200,list:y,setList:e=>{const t=e.map((e=>e.dataIndex)),n=y.map((e=>e.dataIndex));l.isEqual(t,n)||O([...Ya(e),...x,...b])}},y.map((e=>k(e,"left"))))),q.default.createElement("div",{className:"divider"}),q.default.createElement("div",{className:"main"},q.default.createElement(I.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:x,setList:e=>{const t=e.map((e=>e.dataIndex)),n=x.map((e=>e.dataIndex));l.isEqual(t,n)||O([...y,...Ya(e),...b])}},x.map((e=>k(e,"main"))))),q.default.createElement("div",{className:"divider"}),q.default.createElement("div",{className:"right"},q.default.createElement(I.ReactSortable,{itemKey:"dataIndex",handle:".right-handle",tag:"ul",animation:200,list:b,setList:e=>{const t=e.map((e=>e.dataIndex)),n=b.map((e=>e.dataIndex));l.isEqual(t,n)||O([...y,...x,...Ya(e)])}},b.map((e=>k(e,"right")))))),popupClassName:J.default(P),popupStyle:{minWidth:160},onPopupVisibleChange:e=>{v(e)},builtinPlacements:di,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},q.default.createElement("span",{className:J.default(A),title:c?p("qm.table.columnFilter.text"):void 0},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.SettingOutlined,null)),!c&&q.default.createElement("span",null,p("qm.table.columnFilter.text")))):null}));uu.displayName="ColumnFilter";const cu=q.default.createContext({}),fu=()=>q.default.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"filter",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.createElement("path",{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"})),pu=q.default.forwardRef(((e,t)=>{const{dataIndex:l,className:n,style:a}=e;return q.default.createElement("li",{ref:t,"data-index":l,className:J.default("list-item",n),style:a},e.children)}));pu.displayName="ListItem";const mu=q.default.forwardRef(((e,t)=>{var l,n;const{dataSource:a=[],height:r,maxHeight:i,itemHeight:o,renderItem:s,onScroll:d,className:u}=e,c=q.default.useRef(null),f=Fd({count:a.length,getScrollElement:()=>{var e;return(null===(e=c.current)||void 0===e?void 0:e.scrollElement)||null},estimateSize:()=>o||40,overscan:3,onChange:(e,t)=>null==d?void 0:d(e,t)}),p=f.getVirtualItems();q.default.useImperativeHandle(t,(()=>({SCROLL_TO_INDEX:e=>f.scrollToIndex(e),SCROLL_TO_OFFSET:e=>f.scrollToOffset(e)})));const m=gt("virtual-list");return q.default.createElement(_n,{ref:c,wrapStyle:{height:r,maxHeight:i},className:J.default(m,u),style:e.style},q.default.createElement("div",{className:"container",style:{height:f.getTotalSize()}},q.default.createElement("ul",{style:{transform:`translateY(${null!==(n=null===(l=p[0])||void 0===l?void 0:l.start)&&void 0!==n?n:0}px)`}},p.map((e=>q.default.createElement(pu,{ref:f.measureElement,key:e.index,dataIndex:e.index,style:{height:o}},null==s?void 0:s(a[e.index],e.index)))))))}));mu.displayName="VirtualList";const hu=e=>{const{column:t,isEnum:n,style:a,onChange:r}=e,{tableRef:i,$size:o,flattenColumns:s,isFetch:u,filters:c,superFilters:f,pagerFilter:p,setPagerFilter:m}=q.default.useContext(ei),{dataKey:h,filterValue:v={}}=q.default.useContext(cu),{t:y}=ot(),{getTitleFromCellValue:b}=Oi(),x=h.split("|")[0],{recordsMap:E,tableOriginData:C,isOriginTree:w}=i.current,S=p,N=x;S[N];const T=Ne(S,["symbol"==typeof N?N:N+""]),I=q.default.useRef(!1),O=q.default.useMemo((()=>s.indexOf(t)),[s,t]),R=q.default.useRef(0),k=e=>{let l=Ca((()=>{if(!(u||De(c)&&De(f))){const e=f.length?Va(f):Va(c);return fa(C,e,w)}return C})());var n;e||(l=((e,t,l)=>{if(!Object.keys(t).length||!e.length)return e;if(!l)return e.filter((e=>Ja(e,t)));const n=new Map,a=new Set;for(const l of e)if(n.set(l._rowKey,l),Ja(l,t)){let e=l;for(;e&&!a.has(e._rowKey);)a.add(e._rowKey),e=n.get(e._parentRowKey)}return e.filter((e=>a.has(e._rowKey)))})(l,T,w),n=l.length,R.current=n);const a=new Map;return l.forEach((e=>{const l=Pa(e,x);a.has(l)||a.set(l,b(e,t,e.index,O))})),a},L=e=>n?[{text:y("qm.table.highSearch.nullText"),value:""},...t.filter.items||t.dictItems||[]]:Array.from(k(e).entries()).map((([e,t])=>({text:t,value:e}))),P=q.default.useMemo((()=>L()),[]),A=q.default.useMemo((()=>De(T)?P:L(!0)),[]),[F,_]=q.default.useState(P),D=q.default.useMemo((()=>new Map(F.map((e=>[e.value,null])))),[F]),[M,H]=q.default.useState(""),[$,j]=q.default.useReducer(((e,t)=>{const n=t(e),a=[...new Set(n)];return l.isEqual(e,a)?e:a}),(n?v.in:p[x])||A.map((e=>e.value))),K=q.default.useMemo((()=>Array.from(D.keys()).every((e=>$.includes(e)))),[$,D]),V=q.default.useMemo((()=>{const e=Array.from(D.keys()).filter((e=>$.includes(e)));return e.length>0&&e.length<F.length}),[$,F,D]),z=q.default.useMemo((()=>$.length===A.length),[$]);Yl((()=>{null==r||r($,z)}),[$]),Yl((()=>{const e=z?null:$;if(!l.isEqual(e,p[x]))return e?void m(Object.assign(Object.assign({},p),{[x]:e})):m(T)}),[F,$]);const W=wn((e=>{const t=P.filter((t=>t.text.includes(e))),l=t.map((e=>e.value));_(t),j((e=>[...l,...e.filter((e=>!D.has(e)))]))}),200),B=e=>{H(e),I.current||W(e)};return q.default.createElement("div",{className:"list-panel",style:a},q.default.createElement(d.Input,{value:M,size:o,style:{width:200},placeholder:y("qm.table.filter.keywordSearch"),suffix:q.default.createElement(g.SearchOutlined,null),autoFocus:!0,allowClear:!0,onCompositionStart:()=>{I.current=!0},onCompositionEnd:e=>{I.current=!1,B(e.target.value)},onChange:e=>B(e.target.value)}),q.default.createElement("div",{className:"select-all"},q.default.createElement("div",{className:"action"},q.default.createElement(d.Checkbox,{checked:K,indeterminate:V,disabled:!F.length,onChange:e=>{j((t=>e.target.checked?[...t,...Array.from(D.keys())]:t.filter((e=>!D.has(e)))))}},y("qm.table.filter.selectAll")),q.default.createElement("i",{className:"divider"},"|"),q.default.createElement("button",{className:"btn invert",disabled:!F.length,onClick:()=>{j((e=>[...Array.from(D.keys()).filter((t=>!e.includes(t))),...e.filter((e=>!D.has(e)))]))}},y("qm.table.filter.invert"))),q.default.createElement("div",{className:"total"},n?null:`${E.size}/${R.current}`)),q.default.createElement(mu,{className:"select-list",maxHeight:180,itemHeight:26,dataSource:F,renderItem:(e,t)=>q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{key:t,checked:$.includes(e.value),onChange:t=>{j((l=>t.target.checked?[...l,e.value]:l.filter((t=>t!==e.value))))}},e.text),q.default.createElement("button",{className:"btn right",onClick:()=>{j((t=>{const n=[e.value,...t.filter((e=>!D.has(e)))];return l.isEqual(t,n)?t:n}))}},y("qm.table.filter.onlyItem")))}))},gu=q.default.forwardRef(((e,t)=>{const{value:l,style:n}=e,{$size:a,filters:r,pagerFilter:i,setPagerFilter:o}=q.default.useContext(ei),{dataKey:s,onChange:u}=q.default.useContext(cu),{t:c}=ot(),f=s.split("|")[0],p=e=>{if(!e){const e=r,t=s;e[t];return Ne(e,["symbol"==typeof t?t:t+""])}const t=Object.assign({},e);for(const e in t)(""===(l=t[e])||null==l)&&delete t[e];var l;return Object.keys(t).length?Object.assign({},r,{[s]:t}):p()},m=(e,t)=>{u(p(null!=e?e:l),null==t||t)};return q.default.useImperativeHandle(t,(()=>({doFinish:m}))),q.default.createElement(d.Space,{className:"footer",style:Object.assign(Object.assign({},n),{justifyContent:"flex-end"})},q.default.createElement(pt,{size:a,onClick:()=>(()=>{if(i[f]){const e=i,t=f;e[t];const l=Ne(e,["symbol"==typeof t?t:t+""]);o(l)}u(p(),!0)})()},c("qm.table.filter.reset")),q.default.createElement(pt,{type:"primary",size:a,onClick:()=>m()},c("qm.table.filter.search")))}));gu.displayName="FooterPanel";const vu=e=>{const{column:t}=e,{$size:l}=q.default.useContext(ei),{filterValue:n={}}=q.default.useContext(cu),{t:a}=ot(),r=q.default.useRef(null),{openFilterList:i=!0}=t.filter,[o,s]=q.default.useState(Object.keys(n)[0]||"like"),[u,c]=q.default.useState(n[o]&&!Za(o)?n[o]:""),f=q.default.useMemo((()=>u?{[o]:u}:Za(o)?{[o]:1}:null),[o,u]),p=[{value:"like",label:a("qm.table.highSearch.inText")},{value:"nlike",label:a("qm.table.highSearch.ninText")},{value:"==",label:a("qm.table.highSearch.eqText")},{value:"!=",label:a("qm.table.highSearch.neqText")},{value:"^=",label:a("qm.table.highSearch.startsWithText")},{value:"=$",label:a("qm.table.highSearch.endsWithText")},{value:"nil",label:a("qm.table.highSearch.nullText")},{value:"nnil",label:a("qm.table.highSearch.notNullText")}];return q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:"filter-box"},q.default.createElement(d.Select,{value:o,options:p,size:l,className:"condition",style:{width:70,marginRight:6},onChange:e=>{s(e),Za(e)&&c("")}}),q.default.createElement(d.Input,{value:u,size:l,autoFocus:!0,style:{width:124,paddingLeft:6,paddingRight:2},placeholder:a("qm.table.filter.searchText",{text:ja(t.title)}),disabled:Za(o),onChange:e=>{c(e.target.value)},onKeyDown:e=>{13===e.keyCode&&r.current.doFinish()}})),i&&q.default.createElement(hu,{column:t,style:{marginTop:6}}),q.default.createElement(gu,{ref:r,value:f}))},yu=e=>{var t,l;const{onChange:n}=e,{filterValue:a={}}=q.default.useContext(cu),{t:r}=ot(),[i,o]=q.default.useState({nil:null!==(t=a.nil)&&void 0!==t?t:0,nnil:null!==(l=a.nnil)&&void 0!==l?l:0});return Yl((()=>{const e={};for(const t in i)i[t]&&(e[t]=1);n(e)}),[i]),q.default.createElement("div",{style:e.style},q.default.createElement(d.Checkbox,{checked:!!i.nil,onChange:e=>{const t=e.target.checked?1:0;o((e=>Object.assign({},e,t?{nnil:0}:null,{nil:t})))}},r("qm.table.highSearch.nullText")),q.default.createElement(d.Checkbox,{checked:!!i.nnil,onChange:e=>{const t=e.target.checked?1:0;o((e=>Object.assign({},e,t?{nil:0}:null,{nnil:t})))}},r("qm.table.highSearch.notNullText")))},bu=e=>{var t;const{column:l}=e,{$size:n}=q.default.useContext(ei),{filterValue:a={}}=q.default.useContext(cu),{t:r}=ot(),i=q.default.useRef(null),{openFilterList:o=!0}=l.filter,s="likes",[u,c]=q.default.useState(null!==(t=a[s])&&void 0!==t?t:""),[f,p]=q.default.useState({}),m=q.default.useMemo((()=>Object.keys(f).length?f:u?{[s]:u}:null),[u,f]);return q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:"filter-box"},q.default.createElement(d.Input.TextArea,{value:u,size:n,autoFocus:!0,placeholder:r("qm.table.filter.searchAreaText",{text:ja(l.title)}),style:{width:200},disabled:!!Object.keys(f).length,onChange:e=>{c(e.target.value)},onKeyDown:e=>{13===e.keyCode&&i.current.doFinish()}})),q.default.createElement(yu,{style:{marginTop:6},onChange:e=>{Object.keys(e).length&&c(""),p(e)}}),o&&q.default.createElement(hu,{column:l,style:{marginTop:6}}),q.default.createElement(gu,{ref:i,value:m}))},xu=e=>{const{$size:t}=q.default.useContext(ei),{filterValue:l={}}=q.default.useContext(cu),{t:n}=ot(),a=q.default.useRef(null),[r,i]=q.default.useState(l),o=e=>({value:r[e],size:t,disabled:Object.keys(r).some((e=>Za(e))),onChange:t=>{t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER||i((l=>Object.assign({},l,{[e]:t})))},onKeyDown:e=>{13===e.keyCode&&a.current.doFinish()}});return q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:"filter-list"},q.default.createElement("ul",null,q.default.createElement("li",null,q.default.createElement("span",{className:"label"},"> "),q.default.createElement(d.InputNumber,tt({},o(">"),{placeholder:n("qm.table.highSearch.gtText"),style:{width:150}}))),q.default.createElement("li",null,q.default.createElement("span",{className:"label"},"< "),q.default.createElement(d.InputNumber,tt({},o("<"),{placeholder:n("qm.table.highSearch.ltText"),style:{width:150}}))),q.default.createElement("li",null,q.default.createElement("span",{className:"label"},"= "),q.default.createElement(d.InputNumber,tt({},o("=="),{placeholder:n("qm.table.highSearch.eqText"),style:{width:150}}))),q.default.createElement("li",null,q.default.createElement("span",{className:"label"},"!="),q.default.createElement(d.InputNumber,tt({},o("!="),{placeholder:n("qm.table.highSearch.neqText"),style:{width:150}}))))),q.default.createElement(yu,{style:{paddingLeft:20},onChange:e=>i(e)}),q.default.createElement(gu,{ref:a,value:r}))},Eu=e=>{const{$size:t}=q.default.useContext(ei),{filterValue:l={}}=q.default.useContext(cu),{t:n}=ot(),[a,r]=q.default.useState(l),i=e=>({value:Ha(a[e],ii),format:ii,size:t,disabled:Object.keys(a).some((e=>Za(e))),onChange:t=>{r((l=>Object.assign({},l,{[e]:qa(t,ii)})))}});return q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:"filter-list"},q.default.createElement("ul",null,q.default.createElement("li",null,q.default.createElement("span",{className:"label"},"> "),q.default.createElement(et,tt({},i(">"),{placeholder:n("qm.table.highSearch.gtText"),style:{width:"150px"}}))),q.default.createElement("li",null,q.default.createElement("span",{className:"label"},"< "),q.default.createElement(et,tt({},i("<"),{placeholder:n("qm.table.highSearch.ltText"),style:{width:"150px"}}))),q.default.createElement("li",null,q.default.createElement("span",{className:"label"},"= "),q.default.createElement(et,tt({},i("=="),{placeholder:n("qm.table.highSearch.eqText"),style:{width:"150px"}}))),q.default.createElement("li",null,q.default.createElement("span",{className:"label"},"!="),q.default.createElement(et,tt({},i("!="),{placeholder:n("qm.table.highSearch.neqText"),style:{width:"150px"}}))))),q.default.createElement(yu,{style:{paddingLeft:20},onChange:e=>r(e)}),q.default.createElement(gu,{value:a}))},Cu=e=>{const{column:t}=e,l=q.default.useRef(null);return q.default.createElement(q.default.Fragment,null,q.default.createElement(hu,{column:t,isEnum:!0,onChange:(e,t)=>{l.current.doFinish(t?null:{in:e},!1)}}),q.default.createElement(gu,{ref:l,style:{display:"none"}}))},wu=(e,t,l)=>{let n;for(let a=0;a<e.length;a++){const r=e[a];if(r.children)if(r.children.some((e=>e[l]===t)))n=r[l];else{const e=wu(r.children,t,l);e&&(n=e)}}return n},Su=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&Su(e.children,t),t(e)||e.children&&e.children.length))),Nu=(e,t)=>{const l=[];return e.forEach((e=>{e.children&&l.push(...Nu(e.children,t)),t(e)&&l.push(e)})),l},Tu=(e,t)=>{let l=null;for(let n=0;n<e.length;n++){if(Array.isArray(e[n].children)&&(l=Tu(e[n].children,t)),l)return l;if(t(e[n]))return e[n]}return l},Iu=(e,t,l,n)=>e.map((e=>e[l]===t?Object.assign(Object.assign({},e),{children:n}):e.children?Object.assign(Object.assign({},e),{children:Iu(e.children,t,l,n)}):e)),Ou=(e,t)=>{const l=[];return e.forEach((e=>{e.children&&l.push(...Ou(e.children,t)),Array.isArray(e.children)&&e.children.length&&l.push(e[t])})),l},Ru=(e,t,l)=>{for(let n=0;n<e.length;n++){if(e[n][l]===t)return[t];if(Array.isArray(e[n].children)){const a=Ru(e[n].children,t,l);if(a)return[e[n][l],a].flat()}}},ku=(e,t)=>{var l;const n=(null===(l=e.children)||void 0===l?void 0:l.map((e=>e[t])))||[];return Array.isArray(e.children)&&e.children.forEach((e=>n.push(...ku(e,t)))),n},Lu=q.default.forwardRef(((e,t)=>{const{className:n,style:a,filterable:r=!0,multiple:i,draggable:o,beforeDrop:s,dataSource:u,fetch:c,autoFocus:f,asyncLoad:p,checkStrictly:m,checkStrategy:h="SHOW_CHILD",placeholder:v,fieldsDefine:y,value:b,height:x,defaultSelectedKeys:E=[],defaultExpandedKeys:C=[],defaultExpandAll:w=!0,showSearchBar:S=!0,showCollapse:N=!0,onSelectChange:T,onCheckChange:I,onDragStart:O,onDragChange:R,onExpand:k}=e,{$size:L}=dt(e),{t:P}=ot(),A=(null==y?void 0:y.valueKey)||"value",F=(null==y?void 0:y.textKey)||"text";null==y||y.children;const _=q.default.useRef(null),D=q.default.useRef(null),M=xn(_),[H,$]=yi(x,{value:x}),[j,K]=q.default.useState(!1),V=wn((()=>{$(_.current.offsetHeight-ne.current.offsetHeight-10)}),5);Cn((()=>{x||V()}),[M.height]);const[z,W]=q.default.useState([]),[B,U]=q.default.useState({}),[G,Y]=q.default.useState([]),[X,Q]=q.default.useState([]),[Z,ee]=q.default.useState(""),[te,le]=q.default.useState(w),ne=q.default.useRef(null),ae=q.default.useRef([]),re=q.default.useRef([]);q.default.useEffect((()=>{Array.isArray(u)&&(ie(u),Y(oe(u)),U({}))}),[u]),q.default.useEffect((()=>{var e;ue(),f&&(null===(e=D.current)||void 0===e||e.focus())}),[]),Yl((()=>{ue()}),[null==c?void 0:c.params]),Yl((()=>{Q(de())}),[B]),q.default.useImperativeHandle(t,(()=>({INSERT_RECORD:(e,t)=>{const l=Array.isArray(t)?t:[t],n=Tu(z,(t=>e===t[A]));n&&(Array.isArray(n.children)?n.children.push(...l):n.children=[...l],ie([...z]))},REMOVE_RECORD:e=>{var t;const l=wu(z,e,A);if(void 0===l&&z.find((t=>t[A]===e)))ie(z.filter((t=>t[A]!==e)));else{const n=Tu(z,(e=>l===e[A]));if(!n)return;const a=null===(t=n.children)||void 0===t?void 0:t.findIndex((t=>e===t[A]));a>=0&&(n.children.splice(a,1),ie([...z]))}},UPDATE_RECORD:(e,t)=>{const n=Tu(z,(t=>e===t[A]));n&&(l.merge(n,t),ie([...z]))}})));const ie=e=>{W(e),ae.current=e,re.current=Ou(e,A)},oe=e=>{if(i)return E;const t=Nu(e,(e=>E.includes(e[F])));return 1===t.length?[t[0][A]]:[]},se=e=>{var t;return(null===(t=Ru(z,e,A))||void 0===t?void 0:t.slice(0,-1))||[]},de=()=>{if(w)return re.current;const e=[];return G.forEach((t=>{if(i){if("SHOW_ALL"===h&&!re.current.includes(t)&&e.push(...se(t)),"SHOW_CHILD"===h&&e.push(...se(t)),"SHOW_PARENT"===h){const l=xr(z,t);if(l){const n=se(t),a=ku(l,A);e.push(...n,...[t,...a].filter((e=>re.current.includes(e))))}}}else e.push(...se(t))})),[...new Set([...C,...e])]},ue=()=>Ie(void 0,void 0,void 0,(function*(){var e;if(!c)return;const{api:t,params:n,dataKey:a,afterFetch:r,callback:i}=c;try{K(!0);const o=yield t(n);if(200===o.code){let t=Array.isArray(o.data)?o.data:null!==(e=l.get(o.data,a))&&void 0!==e?e:[];t="function"==typeof r?yield r(t):t,ie(t),Y(oe(t)),U({}),null==i||i(t)}}catch(e){}K(!1)})),ce=e=>`${e}|${_r.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,fe=gt("search-tree"),pe={[fe]:!0,[`${fe}--lg`]:"large"===L,[`${fe}--sm`]:"small"===L};return q.default.createElement("div",{ref:_,className:J.default(pe,n),style:a},q.default.createElement("div",{ref:ne,className:"topper",style:{display:S||N?"":"none"}},S&&q.default.createElement(d.Input,{ref:D,value:Z,size:L,placeholder:v||P("qm.form.inputPlaceholder"),suffix:q.default.createElement(g.SearchOutlined,null),allowClear:!0,onChange:e=>(e=>{if(!r)return;const t=Su(ae.current,(t=>{if(!e)return!0;const l=t[F]||"";return-1!==ce(l).indexOf(e)}));ee(e),W(t),Q(w||e?Ou(t,A):de())})(e.target.value)}),N&&q.default.createElement("a",{className:"trigger",onClick:()=>{le(!te),Q(te?[]:re.current)}},te?q.default.createElement(g.UpOutlined,null):q.default.createElement(g.DownOutlined,null)," ",P(te?"qm.form.collect":"qm.form.spread"))),q.default.createElement(mn,{spinning:j},q.default.createElement(d.Tree,{fieldNames:{title:F,key:A,children:"children"},multiple:i,draggable:o,blockNode:o,checkable:i,selectable:!i,height:H,disabled:e.disabled,checkStrictly:m,selectedKeys:null!=b?b:G,checkedKeys:null!=b?b:G,expandedKeys:X,treeData:z,loadData:p?({key:e,children:t})=>Ie(void 0,void 0,void 0,(function*(){var n;if(!c||t)return;const{api:a,params:r,dataKey:i,formatter:o=(e=>e),afterFetch:s}=c;try{const t=yield a(o(Object.assign(Object.assign({},r),{[A]:e})));if(200===t.code){let a=Array.isArray(t.data)?t.data:null!==(n=l.get(t.data,i))&&void 0!==n?n:[];a="function"==typeof s?yield s(a):a;const r=Iu(ae.current,e,A,a);ie(r)}}catch(e){}})):void 0,titleRender:e.titleRender,filterTreeNode:e=>{if(!Z)return!1;const t=e[F]||"";return-1!==ce(t).indexOf(Z)},onDragStart:O,onDragEnter:e=>{Q(e.expandedKeys)},onDrop:e=>{const t=e.node.key,l=e.dragNode.key,n=e.node.pos.split("-"),a=e.dropPosition-Number(n[n.length-1]);if(s){if(!1===s(e,z))return}const r=(e,t,l)=>{for(let n=0;n<e.length;n++){if(e[n][A]===t)return l(e[n],n,e);e[n].children&&r(e[n].children,t,l)}},i=[...z];let o;if(r(i,l,((e,t,l)=>{l.splice(t,1),o=e})),e.dropToGap)if((e.node.children||[]).length>0&&e.node.expanded&&1===a)r(i,t,(e=>{e.children=e.children||[],e.children.unshift(o)}));else{let e,l=[];r(i,t,((t,n,a)=>{l=a,e=n})),-1===a?l.splice(e,0,o):l.splice(e+1,0,o)}else r(i,t,(e=>{e.children=e.children||[],e.children.unshift(o)}));ie(i)},onDragEnd:e=>{null==R||R(e,z)},onExpand:(e,t)=>{De(e)&&le(!1),re.current.every((t=>e.includes(t)))&&le(!0),Q(e),null==k||k(e,t)},onSelect:e=>{Y(e);const t=Nu(ae.current,(t=>e.includes(l.get(t,A))));null==T||T(i?t:t[0])},onCheck:e=>{m&&(e=e.checked),Y(e),m||("SHOW_CHILD"===h&&(e=e.filter((e=>!re.current.includes(e)))),"SHOW_PARENT"===h&&(e=e.filter(((e,t,l)=>!l.includes(wu(z,e,A))))));const t=Nu(ae.current,(t=>e.includes(l.get(t,A))));null==I||I(i?t:t[0])}})))}));Lu.displayName="QmSearchTree";const Pu=e=>{var t;const{column:l}=e,{$size:n}=q.default.useContext(ei),{filterValue:a={}}=q.default.useContext(cu),r=q.default.useMemo((()=>l.filter.items||l.dictItems||[]),[]),i=q.default.useMemo((()=>{const e=[];return function t(l){l.forEach((l=>{Array.isArray(l.children)?t(l.children):e.push(l.value)}))}(r),e}),[r]),[o,s]=q.default.useState(null!==(t=a.in)&&void 0!==t?t:i),[d,u]=q.default.useState({}),c=q.default.useMemo((()=>Object.keys(d).length?d:o.length===i.length?null:{in:o}),[o,d]);return q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:"tree-panel",style:l.filter.style},q.default.createElement(Lu,{multiple:!0,value:o,dataSource:r,disabled:!!Object.keys(d).length,size:n,style:{height:238},onCheckChange:e=>{s(e.map((e=>e.value)))}})),q.default.createElement(yu,{style:{marginLeft:-10,marginRight:-10,padding:"6px 0 0 20px",borderTop:"1px solid #e8e8e8"},onChange:e=>{Object.keys(e).length&&s([]),u(e)}}),q.default.createElement(gu,{value:c}))},Au=e=>{const{column:t,filters:l}=e,{$size:n,prefixCls:a,pagerFilter:r,setFilters:i,clearSuperFilters:o}=q.default.useContext(ei),{t:s}=ot(),[d,u]=q.default.useState(!1),c=q.default.useMemo((()=>{const{dataIndex:e,filter:l}=t;return`${e}|${l.type}`}),[t]),f=q.default.useMemo((()=>!!Object.keys(l[c]||{}).length||!!r[t.dataIndex]),[l,r]),p=(e,t)=>{o(),i({payload:e}),t&&u(!1)},m=q.default.useMemo((()=>({dataKey:c,filterValue:l[c],onChange:p})),[l]);q.default.useEffect((()=>{"radio"===t.filter.type&&ft("Table","表头筛选类型 `radio` 即将被弃用,请使用 `checkbox` 替代")}),[]);const h={text:e=>q.default.createElement(vu,{column:e}),textarea:e=>q.default.createElement(bu,{column:e}),number:e=>q.default.createElement(xu,{column:e}),date:e=>q.default.createElement(Eu,{column:e}),radio:e=>h.checkbox(e),checkbox:e=>q.default.createElement(Cu,{column:e}),tree:e=>q.default.createElement(Pu,{column:e})},g={"head-filter__popper":!0,[`${a}--lg`]:"large"===n,[`${a}--sm`]:"small"===n},v=["cell--filter",{selected:d,actived:f}];return q.default.createElement(xs,{action:["click"],popupVisible:d,popup:(()=>{const e=h[t.filter.type];return e?q.default.createElement("div",{className:"head-filter--wrap",onClick:e=>e.stopPropagation()},q.default.createElement(cu.Provider,{value:m},e(t))):(ft("Table","表头筛选的类型 `type` 配置不正确"),null)})(),popupClassName:J.default(g),popupStyle:{minWidth:150},onPopupVisibleChange:e=>u(e),builtinPlacements:di,destroyPopupOnHide:!0,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},q.default.createElement("div",{className:J.default(v),title:s("qm.table.filter.text"),onClick:e=>e.stopPropagation()},q.default.createElement("span",{className:"svgicon icon"},q.default.createElement(fu,null))))},Fu=e=>{const{column:t}=e,{tableRef:l,bordered:n}=q.default.useContext(ei),{columns:a,resizable:r,columnsChange:i=Le}=l.current.props,o=q.default.useMemo((()=>xa(t)),[t]),s={resizable:!0,"is--line":r&&!n};return q.default.createElement("div",{className:J.default(s),onMouseDown:e=>{e.preventDefault();const t=e.target,{elementStore:n,scrollBarRef:r}=l.current,s=n.$resizableBar,d=t.offsetWidth/2,u=e.clientX,c=Ra(t,n.$table).left-r.current.scrollLeft+d;n.$table.classList.add("c--resize"),s.style.left=`${c}px`,s.style.display="block";const f=o.width||o.renderWidth;let p=f;return document.onmousemove=function(e){if("number"!=typeof f)return;const t=e.clientX-u,l=f+t;l<(o.minWidth||bi.defaultColumnWidth)||(p=Math.floor(l),s.style.left=`${t+c}px`)},document.onmouseup=function(){n.$table.classList.remove("c--resize"),s.style.display="none",this.onmousemove=null,this.onmouseup=null,"number"==typeof p&&(ya(a,o.dataIndex).width=p,i([...a]))},!1}})},_u=e=>{const{selectionKeys:t}=e,{tableRef:n,getRowKey:a,fetchParams:r,setSelectionKeysEffect:i,setInvalidRowKeys:o,setSpinning:s,pagination:u,isFetch:c,isWebPagination:f,createWebPageData:p}=q.default.useContext(ei),{t:m}=ot(),{selectionRows:h,recordsMap:v}=n.current,{rowSelection:y}=n.current.props,{fetchAllRowKeys:b,selectAllOnCurrentPage:x,filterable:E,onSelectAll:C}=y,w=q.default.useRef([]),S=q.default.useMemo((()=>c&&!!b),[c,b]),N=q.default.useMemo((()=>!S&&!!x),[S,x]),T=q.default.useMemo((()=>(null==E||E)&&!N),[E,N]),I=()=>{const{disabled:e}=y;return(e?h.filter((t=>!e(t))):h).map((e=>a(e,e.index)))},O=()=>f?Ca(p()):Array.from(v.values()),R=q.default.useMemo((()=>(()=>{const{disabled:e}=y;if(S)return w.current.length?w.current:l.union(Array.from(v.keys()),I());if(!N)return e?Array.from(v.keys()).filter((t=>!e(v.get(t)))):Array.from(v.keys());const t=e?O().filter((t=>!e(t))).map((e=>a(e,e.index))):O().map((e=>a(e,e.index)));return l.union(t,I())})()),[v,w,h,u]),k=t.filter((e=>!R.includes(e))),L=t.length-k.length,P=L>0&&L<R.length,A=!!L&&L===R.length;o(k);const F=()=>Ie(void 0,void 0,void 0,(function*(){var e;const t=b;let n=[];s(!0);try{const i=yield t.api(r);if(200===i.code){n=Array.isArray(i.data)?i.data:null!==(e=l.get(i.data,t.dataKey))&&void 0!==e?e:[];const{disabled:r}=y;r&&(n=l.xor(n,O().filter((e=>r(e))).map((e=>a(e,e.index))))),w.current=n}}catch(e){}return s(!1),n})),_=e=>Ie(void 0,void 0,void 0,(function*(){let t=[];t=S?e?yield F():[]:e?R.slice(0):[],t=[...new Set([...t,...k])],i(t),null==C||C(e,t)})),D=()=>{const e=[{key:1,label:m("qm.table.selection.all"),onClick:()=>{_(!0)}},{key:2,label:m("qm.table.selection.invert"),onClick:()=>Ie(void 0,void 0,void 0,(function*(){let e=[];e=S?l.xor(t,yield F()):l.xor(t,R),e=[...new Set([...e,...k])],i(e)}))},{key:3,label:m("qm.table.selection.clear"),onClick:()=>{_(!1)}}];return q.default.createElement(d.Menu,{items:e})};return q.default.createElement("div",{className:"cell--selection"},q.default.createElement(d.Checkbox,{checked:A,indeterminate:P,disabled:!R.length,onChange:e=>_(e.target.checked)}),T&&q.default.createElement(d.Dropdown,{overlayClassName:"all-selection__popper",dropdownRender:()=>D()},q.default.createElement(g.DownOutlined,{className:"svgicon icon"})),N&&q.default.createElement(d.Tooltip,{placement:"top",title:m("qm.table.selection.currentPage")},q.default.createElement(g.InfoCircleOutlined,{className:"info"})))},Du=e=>{const{style:t}=e,{tableRef:l,rowExpandedKeys:n,setRowExpandedKeys:a,createAllExpandedKeys:r,filters:i,pagerFilter:o,superFilters:s}=q.default.useContext(ei),{expandable:d}=l.current.props,[u,c]=q.default.useState((null==d?void 0:d.defaultExpandAllRows)||!1);Yl((()=>{f(n)!==u&&c(!u)}),[n]),Yl((()=>{l.current.isTreeTable&&(De(i)&&De(o)&&De(s)||Fe((()=>!f(n)&&a(r()))))}),[i,o,s]);const f=e=>r().every((t=>e.includes(t))),p={[`${gt("expand")}--icon`]:!0,expanded:u,collapsed:!u};return q.default.createElement("span",{className:J.default(p),title:"",onClick:e=>{e.stopPropagation(),c(!u),a(u?[]:r())},style:t})},Mu=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-up",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.createElement("path",{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"})),Hu=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.createElement("path",{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"})),qu=e=>{const{tableColumns:t}=e,{global:l}=q.default.useContext(xe),{tableRef:n,prefixCls:a,layout:r,flattenColumns:i,sorter:o,filters:s,superFilters:u,pagerFilter:c,selectionKeys:f,isFetch:p,treeExpandIndex:m,tableChange:h,setSorter:v,setElementStore:y,resetTableScroll:b,getStickyLeft:x,getStickyRight:E,createTableFullData:C}=q.default.useContext(ei),{ellipsis:w,resizable:S,multipleSort:N,rowSelection:T,expandable:I}=n.current.props,[O,R]=bi.sortDirections,{t:k}=ot(),L=q.default.useRef(null),P=q.default.useMemo((()=>!p),[p]),A=q.default.useMemo((()=>!(null==I?void 0:I.hideExpandAll)),[I]),F=q.default.useMemo((()=>!!T&&(p?!(!T.selectAllOnCurrentPage&&!T.fetchAllRowKeys):!T.hideSelectAll)),[p,T]),_=q.default.useMemo((()=>Object.fromEntries(Object.entries(o).filter((([e,t])=>null!==t)))),[o]);Cn((()=>{U(),z(!0),h(),Fe((()=>b()))}),[s,u]),Cn((()=>{Y(),z(!0),h(),Fe((()=>b()))}),[c]),Cn((()=>{V(),h(),Fe((()=>b()))}),[o]),q.default.useEffect((()=>{!De(s)&&U(),!De(o)&&V()}),[]),q.default.useLayoutEffect((()=>{D()}),[]);const D=()=>{y("$header",L.current)},M=(e,t,a)=>{var r,i;const{dataIndex:s,colSpan:d,rowSpan:u,fixed:c,align:f,theadAlign:p,theadWrap:m=(null==l?void 0:l.labelWrap),theadClassName:h="",sorter:g,filter:v,required:y,headRender:b}=e;if(0===d)return null;const C=p||f,N=["header--column",{"col--ellipsis":!m&&w,"col--center":"center"===C,"col--right":"right"===C,"column--required":!!y,"column-has-sorter":g,"column-has-filter":v,"column--sort":!!o[s],"cell-fix-left":"left"===c,"cell-fix-right":"right"===c,"cell-fix-left-last":"left"===c&&!(null===(r=a[t+(null!=d?d:1)])||void 0===r?void 0:r.fixed),"cell-fix-right-first":"right"===c&&!(null===(i=a[t-1])||void 0===i?void 0:i.fixed),[h]:!!h}],T={left:"left"===c?`${x(s)}px`:"",right:"right"===c?`${E(s,"thead")}px`:""},I=S&&![bi.expandableColumn,bi.selectionColumn].includes(s);return q.default.createElement("th",{key:s,className:J.default(N),colSpan:d,rowSpan:u,style:Object.assign({},T),onClick:t=>K(t,e)},q.default.createElement("div",{className:"cell--wrapper"},b?q.default.createElement("div",{className:"cell--text cell"},b(e,n.current.tableFullData)):q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:"cell--text"},H(e)),v?j(e):null)),I&&q.default.createElement(Fu,{column:e}))},H=e=>{const{dataIndex:t,type:l,sorter:a,title:r,description:i}=e;if(t===bi.selectionColumn&&"checkbox"===l){if("checkbox"===l)return q.default.createElement("div",{className:"cell"},F?q.default.createElement(_u,{selectionKeys:f}):k("qm.table.config.selectionText"));if("radio"===l)return q.default.createElement("div",{className:"cell"},r)}const s=[];return s.push(q.default.createElement("div",{key:0,className:"cell",title:ja(r)},n.current.isTreeTable&&t===m&&A?q.default.createElement(Du,null):null,t===bi.expandableColumn&&A?q.default.createElement(Du,null):r)),i&&s.push(q.default.createElement(d.Tooltip,{key:1,placement:"top",title:i},q.default.createElement(g.InfoCircleOutlined,{className:"tip"}))),a&&s.push($(o[t])),s},$=e=>{const t=["svgicon cell--sorter__asc",{actived:e===O}],l=["svgicon cell--sorter__desc",{actived:e===R}];return q.default.createElement("div",{key:2,className:"cell--sorter",title:k("qm.table.sorter.text")},q.default.createElement("span",{className:J.default(t)},q.default.createElement(Mu,null)),q.default.createElement("span",{className:J.default(l)},q.default.createElement(Hu,null)))},j=e=>q.default.createElement(Au,{column:e,filters:s}),K=(e,t)=>{const{sorter:l,dataIndex:n}=t;if(l){const e=o[n],t=e?e===R?null:R:O;N?(delete o[n],v({payload:Object.assign({},o,{[n]:t})})):v({payload:Object.assign({},{[n]:t})})}},V=()=>{P&&z()},z=e=>{const t=Object.keys(_).length>0;e?t&&B(_):B(t?_:{index:O})},W=(e,t)=>Number.isNaN(e-t)?e.toString().localeCompare(t.toString()):e-t,B=e=>{const t=((e,t)=>e.sort(((e,l)=>{for(const n in t){const a=i.find((e=>e.dataIndex===n)),r=t[n],o=Pa(e,n),s=Pa(l,n),d="function"!=typeof(null==a?void 0:a.sorter)?W(o,s):a.sorter(e,l);if(0!==d)return"ascend"===r?d:-d}return 0})).slice(0))(n.current.tableFullData,e);C(t)},U=()=>{P&&G()},G=()=>{const{tableOriginData:e,isOriginTree:t}=n.current,l=u.length?Va(u):Va(s);let a=fa(e,P?l:"",t);a=er(a,c,t),C(a)},Y=()=>{G()},X=Na(t),{tableBodyWidth:Q}=r;return q.default.createElement("div",{ref:L,className:`${a}--header-wrapper`},q.default.createElement("table",{className:`${a}--header`,cellSpacing:"0",cellPadding:"0",style:{width:Q?`${Q}px`:""}},q.default.createElement("colgroup",null,i.map((e=>{const{dataIndex:t,width:l,renderWidth:n}=e;return q.default.createElement("col",{key:t,style:{width:`${l||n}px`,minWidth:`${l||n}px`}})}))),q.default.createElement("thead",null,(e=>e.map(((e,t)=>q.default.createElement("tr",{key:t,className:"header--row"},e.map(((t,l)=>M(t,l,e)))))))(X))))},$u=q.default.createContext([]),ju=(e,t,l,n,a,r,i,o,s,d)=>{var u;const{clientX:c,clientY:f}=e,{top:p,height:m}=e.target.getBoundingClientRect(),h=(((null==a?void 0:a.x)||0)-c-12)/n,g=s.filter((e=>{var t,l;return null===(l=null===(t=o[e])||void 0===t?void 0:t.children)||void 0===l?void 0:l.length}));let v=Ku(o,l.eventKey);if(f<p+m/2){const e=i.findIndex((e=>e===v.key)),t=i[e<=0?0:e-1];v=Ku(o,t)}const y=v.key,b=v,x=v.key;let E=0,C=0;if(!g.includes(y))for(let e=0;e<h&&zu(v);e+=1)v=v.parent,C+=1;const w=t.data,S=v.node;let N=!0;return Wu(v)&&0===v.level&&f<p+m/2&&r({dragNode:w,dropNode:S,dropPosition:-1})&&v.key===l.eventKey?E=-1:(b.children||[]).length&&g.includes(x)?r({dragNode:w,dropNode:S,dropPosition:0})?E=0:N=!1:0===C?h>-1.5?r({dragNode:w,dropNode:S,dropPosition:1})?E=1:N=!1:r({dragNode:w,dropNode:S,dropPosition:0})?E=d?1:0:r({dragNode:w,dropNode:S,dropPosition:1})?E=1:N=!1:r({dragNode:w,dropNode:S,dropPosition:1})?E=1:N=!1,{dropPosition:E,dropLevelOffset:C,dropTargetKey:v.key,dropTargetPos:v.pos,dragOverNodeKey:x,dropContainerKey:0===E?null:(null===(u=v.parent)||void 0===u?void 0:u.key)||null,dropAllowed:N}},Ku=(e,t)=>e[t],Vu=e=>e.split("-"),zu=e=>{if(e.parent){const t=Vu(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1},Wu=e=>{const t=Vu(e.pos);return 0===Number(t[t.length-1])},Bu=({openDragSort:e})=>{const{tableRef:t,getRowKey:l,rowExpandedKeys:n,setRowExpandedKeys:a,createTableData:r,dataChange:i}=q.default.useContext(ei),{tableFullData:o,recordsMap:s,isTreeTable:d}=t.current,{beforeRowDrop:u}=t.current.props,c=Pe,f=q.default.useRef(null),p=q.default.useRef(null),m=q.default.useRef(null),h=q.default.useRef(),[g,v]=q.default.useState({}),[y,b]=q.default.useState(null),[x,E]=q.default.useState([]),[C,w]=q.default.useState(0),[S,N]=q.default.useState({dropPosition:null,dropLevelOffset:null,dropContainerKey:null,dropTargetKey:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null}),T=e=>{N((t=>Object.assign({},t,e)))};q.default.useLayoutEffect((()=>{e&&v((e=>{const t={},n=(e,a=null,r=0)=>{const i=[];return e.forEach(((e,o)=>{const s=l(e,e.index),d={index:o,key:s,level:r,node:e,parent:a,pos:(u=(null==a?void 0:a.pos)||"0",c=o,`${u}-${c}`),nodes:[...(null==a?void 0:a.nodes)||[],e]};var u,c;Array.isArray(e.children)&&(d.children=n(e.children,d,r+1)),t[s]=d,i.push(d)})),i};return n(e),t})(o))}),[o]),q.default.useEffect((()=>()=>{window.removeEventListener("dragend",R)}),[]);const I=()=>{T({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})},O=()=>{null!==y&&(b(null),T({dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null})),p.current=null,m.current=null},R=e=>{k(),window.removeEventListener("dragend",R)},k=(e,t,l)=>{T({dragOverNodeKey:null}),O(),f.current=null,window.removeEventListener("dragend",R)},L=e=>{const t=e.node.eventKey,n=e.dragNode.eventKey,a=e.node.pos.split("-"),s=e.dropPosition-Number(a[a.length-1]);if(u){if(!1===u({dragNode:e.dragNode.data,dropPosition:e.dropPosition,dropToGap:e.dropToGap,dragNodesKeys:e.dragNodesKeys,node:e.node.data,event:e.event},o))return}const d=(e,t,n)=>{for(let a=0;a<e.length;a++){if(l(e[a],e[a].index)===t)return n(e[a],a,e);e[a].children&&d(e[a].children,t,n)}},c=[...o];let f;if(d(c,n,((e,t,l)=>{l.splice(t,1),f=e})),e.dropToGap){let e,l=[];d(c,t,((t,n,a)=>{l=a,e=n})),-1===s?l.splice(e,0,f):l.splice(e+1,0,f)}else d(c,t,(e=>{e.children=e.children||[],e.children.unshift(f)}));r(c),i()};return{onNodeDragStart:(e,t)=>{const{eventKey:l}=t;f.current=t,p.current={x:e.clientX,y:e.clientY};const r=((e,t)=>{if(!e)return[];const l=e.slice(),n=l.indexOf(t);return n>=0&&l.splice(n,1),l})(n,l);b(l),E(((e,t)=>{const l=[];return function e(t=[]){t.forEach((({key:t,children:n})=>{l.push(t),e(n)}))}(Ku(t,e).children),l})(l,g)),w(2*bi.treeTable.textIndent),a(r),window.addEventListener("dragend",R)},onNodeDragEnter:(e,t)=>{const{eventKey:l}=t;if(m.current!==l&&(m.current=l),!f.current)return void I();const{dropPosition:r,dropLevelOffset:i,dropTargetKey:o,dropContainerKey:u,dropTargetPos:v,dropAllowed:b,dragOverNodeKey:E}=ju(e,f.current,t,C,p.current,c,Array.from(s.keys()),g,n,!d);-1===x.indexOf(o)&&b?(h.current||(h.current={}),Object.keys(h.current).forEach((e=>{clearTimeout(h.current[e])})),f.current.eventKey!==l&&(e.persist(),h.current[l]=window.setTimeout((()=>{var e;if(null===y)return;let t=[...n];const r=Ku(g,l);r&&(null===(e=r.children)||void 0===e?void 0:e.length)&&(t=((e,t)=>{const l=(e||[]).slice();return-1===l.indexOf(t)&&l.push(t),l})(n,l)),a(t)}),800)),f.current.eventKey!==o||0!==i?T({dragOverNodeKey:E,dropPosition:r,dropLevelOffset:i,dropTargetKey:o,dropContainerKey:u,dropTargetPos:v,dropAllowed:b}):I()):I()},onNodeDragOver:(e,t)=>{if(!f.current)return;const{dropPosition:l,dropLevelOffset:a,dropTargetKey:r,dropContainerKey:i,dropAllowed:o,dropTargetPos:u,dragOverNodeKey:m}=ju(e,f.current,t,C,p.current,c,Array.from(s.keys()),g,n,!d);-1===x.indexOf(r)&&o&&(f.current.eventKey===r&&0===a?null===S.dropPosition&&null===S.dropLevelOffset&&null===S.dropTargetKey&&null===S.dropContainerKey&&null===S.dropTargetPos&&!1===S.dropAllowed&&null===S.dragOverNodeKey||I():l===S.dropPosition&&a===S.dropLevelOffset&&r===S.dropTargetKey&&i===S.dropContainerKey&&u===S.dropTargetPos&&o===S.dropAllowed&&m===S.dragOverNodeKey||T({dropPosition:l,dropLevelOffset:a,dropTargetKey:r,dropContainerKey:i,dropTargetPos:u,dropAllowed:o,dragOverNodeKey:m}))},onNodeDragLeave:(e,t)=>{m.current!==t.eventKey||e.currentTarget.contains(e.relatedTarget)||(I(),m.current=null)},onNodeDragEnd:k,onNodeDrop:(e,t,l=!1)=>{const{dropPosition:n,dropTargetKey:a,dropTargetPos:r,dropAllowed:i,dragOverNodeKey:o}=S;if(!i)return;if(T({dragOverNodeKey:null}),O(),null===a)return;const s=Object.assign(Object.assign({},((e,{dragOverNodeKey:t,dropPosition:l,keyEntities:n})=>{const a=Ku(n,e);return{eventKey:e,pos:a?a.pos:"",dragOver:t===e&&0===l,dragOverGapTop:t===e&&-1===l,dragOverGapBottom:t===e&&1===l}})(a,{dropPosition:n,dragOverNodeKey:o,keyEntities:g})),{data:Ku(g,a).node});-1!==x.indexOf(a)&&ft("Table Draggable","无法拖放到 `dragNode` 的子节点");const d=Vu(r),u={event:e,node:s,dragNode:f.current,dragNodesKeys:[f.current.eventKey].concat(x),dropToGap:0!==n,dropPosition:n+Number(d[d.length-1])};l||L(u),f.current=null},indent:C,dropOptions:S}};function Uu(){const[,e]=$.useReducer((e=>e+1),0);return e}const Gu=q.default.forwardRef(((e,t)=>{const{rowKey:l,rowIndex:n,row:a,className:r,style:i,indent:o,filter:s,dropOption:d,onNodeDragStart:u,onNodeDragEnter:c,onNodeDragOver:f,onNodeDragLeave:p,onNodeDragEnd:m,onNodeDrop:h}=e,g=q.default.useRef({eventKey:l,data:a,props:e}),v=q.default.useRef(!1),[y,b]=q.default.useState(!1),{dropPosition:x,dropLevelOffset:E,dragOverNodeKey:C,dropTargetKey:w,dropContainerKey:S}=d,N=C===l&&0===x,T=C===l&&-1===x,I=C===l&&1===x,O=a._level||0,R={};switch(x){case-1:Object.assign(R,{top:0,left:-E*o+O*o});break;case 1:Object.assign(R,{bottom:0,left:-E*o+O*o});break;case 0:Object.assign(R,{bottom:0,left:o+O*o})}const k={"body--row-draggable":!0,"body--row-dragging":y,"drop-target":w===l,"drop-container":S===l,"drag-over":N,"drag-over-gap-top":T,"drag-over-gap-bottom":I};return q.default.createElement("tr",{ref:t,"data-row-key":l,"data-row-index":n,className:J.default(r,k),style:i,draggable:!0,onMouseDown:e=>{var t;s&&(t=e.target.matches(s),v.current=t)},onDragStart:e=>{if(e.stopPropagation(),v.current)return e.preventDefault();b(!0),u(e,g.current);try{e.dataTransfer.setData("text/plain","")}catch(e){}},onDragEnter:e=>{e.preventDefault(),e.stopPropagation(),c(e,g.current)},onDragOver:e=>{e.preventDefault(),e.stopPropagation(),f(e,g.current)},onDragLeave:e=>{e.stopPropagation(),p(e,g.current)},onDrop:e=>{e.preventDefault(),e.stopPropagation(),b(!1),h(e,g.current)},onDragEnd:e=>{e.stopPropagation(),b(!1),m(e,g.current)}},e.children,C===l&&null!==x&&null!==E&&q.default.createElement("td",{className:"drop-indicator",style:R}))}));Gu.displayName="DraggableTr";const Yu=e=>{const{selectionKeys:t,column:l,record:n,rowKey:a}=e,{tableRef:r}=q.default.useContext(ei),{rowSelection:i}=r.current.props,o=q.default.useMemo((()=>l.type||""),[l.type]),s=e=>{var l,n;const{isTreeTable:a,tableFullData:o}=r.current,s=null===(l=i.checkStrictly)||void 0===l||l;if(!a||s)return!1;const d=Ba(o,(t=>t._rowKey===e));return((e,t)=>{const l=new Set(t);let n=!1,a=!1;for(const t of e)if(l.has(t)?n=!0:a=!0,n&&a)break;return n&&a})(Sa(null!==(n=null==d?void 0:d.children)&&void 0!==n?n:[],(e=>e._rowKey)),t)};return"radio"===o?(()=>{const e=i.disabled,l=null==e?void 0:e(n),r=!l&&t[0]===a;return q.default.createElement(d.Radio,{checked:r,disabled:l})})():(()=>{const e=i.disabled,l=null==e?void 0:e(n),r=!!t.includes(a);return q.default.createElement(d.Checkbox,{checked:r,indeterminate:s(a),disabled:l})})()},Xu=e=>{const{record:t,rowKey:l,style:n}=e,{tableRef:a,rowExpandedKeys:r,setRowExpandedKeys:i}=q.default.useContext(ei),{expandable:o={}}=a.current.props,[s]=q.default.useState("function"==typeof o.rowExpandable&&!o.rowExpandable(t)),d=q.default.useMemo((()=>r.includes(l)),[r,l]);Yl((()=>{var e;null===(e=o.onExpand)||void 0===e||e.call(o,d,t)}),[d]);const u={[`${gt("expand")}--icon`]:!0,expanded:d,collapsed:!d,disabled:s};return q.default.createElement("span",{className:J.default(u),title:"",onClick:e=>{if(e.stopPropagation(),s)return;const t=d?r.filter((e=>e!==l)):[...r,l];i(t)},style:n})},Qu=q.default.createContext({}),Zu=q.default.forwardRef(((e,t)=>{var l;const{$size:n,doFieldValidate:a}=q.default.useContext(ei),{dataKey:r,doFieldUpdate:i,cellValueChange:o}=q.default.useContext(Qu),{column:s,row:u,rowKey:c,columnKey:f,options:p,isTextArea:m}=e,{t:h}=ot(),g=Uu(),v=q.default.useRef(!1),{dataIndex:y}=s,{type:b,extra:x={},rules:E=[],onInput:C,onChange:w,onEnter:S,onBlur:N}=p,T=Pa(u,y),I=Object.assign({},{minRows:1,maxRows:4},x.autoSize),O=m?{rows:I.minRows,autoSize:I}:null,R=x.password?d.Input.Password:m?d.Input.TextArea:d.Input;return q.default.createElement(R,tt({ref:t,size:n,value:T,maxLength:x.maxLength,showCount:x.showCount},O,{autoComplete:x.password?"new-password":"off",placeholder:null!==(l=x.placeholder)&&void 0!==l?l:h("qm.table.editable.inputPlaceholder"),allowClear:x.allowClear,readOnly:x.readOnly,disabled:x.disabled,suffix:x.suffix,onChange:e=>{var t;const l=null!==(t=e.target.value)&&void 0!==t?t:"";Aa(u,y,l),a(E,l,c,f,ja(s.title)),g(),null==C||C({[r]:l}),v.current=!0},onBlur:e=>{var t;const l=null!==(t=e.target.value)&&void 0!==t?t:"";v.current&&(v.current=!1,i(u,c,f),null==w||w({[r]:l},u),null==N||N({[r]:l},u),o())},onKeyUp:e=>{var t;if(13===e.keyCode&&!e.shiftKey){const l=null!==(t=e.target.value)&&void 0!==t?t:"";null==S||S({[r]:l},u)}},onKeyDown:e=>{m&&13===e.keyCode&&!e.shiftKey&&S&&e.preventDefault()}}))}));Zu.displayName="TextCell";const Ju=q.default.forwardRef(((e,t)=>{const{size:l,defaultValue:n,value:a,min:r,max:i,prefix:o,suffix:s,placeholder:u,maxLength:c,precision:f,stringMode:p,allowClear:m,readOnly:h,disabled:g,formatter:v=(e=>e.toString()),parser:y=(e=>e),onFocus:b}=e,x=e=>{let t=e.toString();return"."!==t.charAt(t.length-1)&&"-"!==t||(t=t.slice(0,-1)),t&&Number(t)>i&&(t=i.toString()),t&&Number(t)<r&&(t=r.toString()),f>=0&&""!==t&&(t=new ce.default(t).toFixed(f)),t},E=void 0!==a,[C,w]=q.default.useState(null!=n?n:""),S=v(E?a:C),N=y(S);Yl((()=>{var t;null===(t=e.onChange)||void 0===t||t.call(e,N)}),[C]);return q.default.createElement(d.Input,{ref:t,size:l,value:S,maxLength:c,prefix:o,suffix:s,placeholder:u,allowClear:m,readOnly:h,disabled:g,onChange:t=>{const l=y(t.target.value.replace(/\s+/g,""));let n=/^-?\d*(\.\d*)?$/.test(l)||""===l||"-"===l;if(0===f&&l.includes(".")&&(n=!1),r>=0&&l.startsWith("-")&&(n=!1),n){if(!p&&(Number(l)>Number.MAX_SAFE_INTEGER||Number(l)<Number.MIN_SAFE_INTEGER))return;(t=>{var l;E?null===(l=e.onChange)||void 0===l||l.call(e,t):w(t)})(l)}},onFocus:b,onBlur:()=>{var t;const l=x(N);null===(t=e.onBlur)||void 0===t||t.call(e,l,N)},onKeyUp:t=>{var l;13===t.keyCode&&(null===(l=e.onEnter)||void 0===l||l.call(e,x(N),N))}})}));Ju.displayName="InputNumber";const ec=q.default.forwardRef(((e,t)=>{var l,n;const{$size:a,doFieldValidate:r}=q.default.useContext(ei),{dataKey:i,doFieldUpdate:o,cellValueChange:s}=q.default.useContext(Qu),{column:d,row:u,rowKey:c,columnKey:f,options:p}=e,{t:m}=ot(),h=Uu(),g=q.default.useRef(!1),{dataIndex:v,precision:y,formatType:b}=d,{type:x,extra:E={},rules:C=[],onInput:w,onChange:S,onEnter:N,onBlur:T}=p,I=Pa(u,v);let O,R;"finance"===b&&(O=e=>{const t=e.toString().split(".");return`${t[0].replace(/\B(?=(\d{3})+(?!\d))/g,",")}${void 0!==t[1]?`.${t[1]}`:""}`},R=e=>e.replace(/\$\s?|(,*)/g,"")),"percent"===b&&(O=e=>"."===(e+="").charAt(e.length-1)||"-"===e||""===e?e:`${new ce.default(e).times(100).toNumber()}`,R=e=>"."===e.charAt(e.length-1)||"-"===e||""===e?e:new ce.default(e).times(.01).toString());const k=e=>e?(e=>/^[+-]?\d+(\.\d+)?[eE][+-]?\d+$/.test(e.toString()))(Number(e))?e:Number(e):"";return q.default.createElement(Ju,{ref:t,size:a,value:I,min:E.min,max:E.max,precision:y,stringMode:E.stringMode,prefix:E.prefix,suffix:null!==(l=E.suffix)&&void 0!==l?l:"percent"===b?"%":void 0,placeholder:null!==(n=E.placeholder)&&void 0!==n?n:m("qm.table.editable.inputPlaceholder"),maxLength:E.maxLength,allowClear:E.allowClear,readOnly:E.readOnly,disabled:E.disabled,formatter:O,parser:R,onChange:e=>{Aa(u,v,e),r(C,e,c,f,ja(d.title)),h(),null==w||w({[i]:e}),g.current=!0},onBlur:(e,t)=>{if(!g.current)return;g.current=!1;let l=E.stringMode?e:k(e);"percent"===b&&"."===t.charAt(t.length-1)&&(l=Number(e)/100),Aa(u,v,l),o(u,c,f),null==S||S({[i]:l},u),null==T||T({[i]:l},u),s()},onEnter:(e,t)=>{let l=E.stringMode?e:k(e);"percent"===b&&"."===t.charAt(t.length-1)&&(l=Number(e)/100),null==N||N({[i]:l},u)}})}));ec.displayName="NumberCell";const tc=e=>{var t,l;const{$size:n,doFieldValidate:a}=q.default.useContext(ei),{dataKey:r,doFieldUpdate:i,cellValueChange:o}=q.default.useContext(Qu),{column:s,row:u,rowKey:c,columnKey:f,options:p,isMultiple:m}=e,{t:h}=ot();Uu();const{dataIndex:g,dictItems:v=[]}=s,{type:y,extra:b={},rules:x=[],items:E,onChange:C,onEnter:w}=p,S=E||v,N=Pa(u,g);let T=N;return q.default.createElement(d.Select,{mode:m?"multiple":void 0,size:n,popupClassName:bi.popupClassName,value:N||void 0,placeholder:null!==(t=b.placeholder)&&void 0!==t?t:h("qm.table.editable.selectPlaceholder"),allowClear:b.allowClear,listHeight:b.listHeight,maxTagCount:b.collapseTags?"responsive":void 0,maxTagTextLength:b.maxTagTextLength,disabled:b.disabled,style:{width:"100%"},showSearch:null===(l=b.filterable)||void 0===l||l,filterOption:(e,t)=>{var l;const n=(null===(l=null==t?void 0:t.children)||void 0===l?void 0:l.toString())||"";return`${n}|${_r.parse(n).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`.toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{Aa(u,g,e),a(x,e,c,f,ja(s.title)),i(u,c,f),null==C||C({[r]:e},u),o()},onSelect:e=>{T=e},onInputKeyDown:e=>{13===e.keyCode&&Fe((()=>null==w?void 0:w({[r]:T},u)))}},S.map((e=>q.default.createElement(d.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))},lc=e=>{var t;const{$size:l,doFieldValidate:n}=q.default.useContext(ei),{dataKey:a,doFieldUpdate:r,cellValueChange:i}=q.default.useContext(Qu),{column:o,row:s,rowKey:d,columnKey:u,options:c,dateType:f}=e;ot(),Uu();const{dataIndex:p}=o,{type:m,extra:h={},rules:g=[],onChange:v}=c,y=Pa(s,p);return q.default.createElement(et,{size:l,popupClassName:bi.popupClassName,value:null!==(t=Ha(y,dr[f]))&&void 0!==t?t:void 0,picker:sr[f],format:h.format,showTime:"datetime"===f,disabledDate:e=>(e=>{const{minDateTime:t,maxDateTime:l}=h;return t&&l?e.isBefore(t,"day")||e.isAfter(l,"day"):t?e.isBefore(t,"day"):!!l&&e.isAfter(l,"day")})(e),placeholder:h.placeholder,allowClear:h.allowClear,disabled:h.disabled,style:{width:"100%"},onChange:e=>{const t=qa(e,dr[f]);Aa(s,p,t),n(g,t,d,u,ja(o.title)),r(s,d,u),null==v||v({[a]:t},s),i()}})},nc=e=>{var t;const{$size:l,doFieldValidate:n}=q.default.useContext(ei),{dataKey:a,doFieldUpdate:r,cellValueChange:i}=q.default.useContext(Qu),{column:o,row:s,rowKey:d,columnKey:u,options:c}=e;ot(),Uu();const{dataIndex:f}=o,{type:p,extra:m={},rules:h=[],onChange:g}=c,v="HH:mm:ss",y=Pa(s,f);return q.default.createElement(lt,{size:l,popupClassName:bi.popupClassName,value:null!==(t=Ha(y,v))&&void 0!==t?t:void 0,format:m.format||v,placeholder:m.placeholder,allowClear:m.allowClear,disabled:m.disabled,style:{width:"100%"},onChange:e=>{const t=qa(e,v);Aa(s,f,t),n(h,t,d,u,ja(o.title)),r(s,d,u),null==g||g({[a]:t},s),i()}})},ac=e=>{const{$size:t,doFieldValidate:l}=q.default.useContext(ei),{dataKey:n,doFieldUpdate:a,cellValueChange:r}=q.default.useContext(Qu),{column:i,row:o,rowKey:s,columnKey:u,options:c}=e;ot(),Uu();const{dataIndex:f}=i,{type:p,extra:m={},rules:h=[],onChange:g}=c,{trueValue:v=ai,falseValue:y=ri,disabled:b}=m,x=Pa(o,f);return q.default.createElement(d.Checkbox,{checked:x===v,disabled:b,onChange:e=>{const t=e.target.checked?v:y;Aa(o,f,t),l(h,t,s,u,ja(i.title)),a(o,s,u),null==g||g({[n]:t},o),r()}})},rc=e=>{const{$size:t,doFieldValidate:l}=q.default.useContext(ei),{dataKey:n,doFieldUpdate:a,cellValueChange:r}=q.default.useContext(Qu),{column:i,row:o,rowKey:s,columnKey:u,options:c}=e;ot(),Uu();const{dataIndex:f}=i,{type:p,extra:m={},rules:h=[],onChange:g}=c,{trueValue:v=ai,falseValue:y=ri,disabled:b}=m,x=Pa(o,f);return q.default.createElement(d.Switch,{checked:x===v,disabled:b,onChange:e=>{const t=e?v:y;Aa(o,f,t),l(h,t,s,u,ja(i.title)),a(o,s,u),null==g||g({[n]:t},o),r()}})},ic=e=>{const{$size:t,doFieldValidate:l}=q.default.useContext(ei),{dataKey:n,doFieldUpdate:a,cellValueChange:r}=q.default.useContext(Qu),{column:i,row:o,rowKey:s,columnKey:d,options:u}=e,{dataIndex:c}=i,{type:f,extra:p={},rules:m=[],render:h,onChange:g}=u;if(!h)return ft("Table","单元格编辑的自定义渲染,必须设置 `render` 参数"),null;const v=Pa(o,c),y=e=>{Aa(o,c,e),l(m,e,s,d,ja(i.title)),a(o,s,d),null==g||g({[n]:e},o),r()},b=h(o,i,y);return q.default.isValidElement(b)?q.default.cloneElement(b,{value:v,disabled:p.disabled,readOnly:p.readOnly,popupClassName:bi.popupClassName,onChange:y}):null},oc=e=>{var t,l,n;const{multiple:a,tree:r={},defaultSelectedKeys:i,className:o,style:s,onClose:d}=e,{$size:u}=dt(e),{t:c}=ot(),[f,p]=q.default.useState(),[m]=q.default.useState(null===(t=r.fetch)||void 0===t?void 0:t.params),h={[`${gt("tree-helper")}--wrapper`]:!0},g=r.fetch?Object.assign(Object.assign({},He(r.fetch,["params","valueKey","textKey"])),{params:m}):void 0;return q.default.createElement("div",{className:J.default(h,o),style:s},q.default.createElement(Lu,{multiple:a,fetch:g,fieldsDefine:{valueKey:null===(l=r.fetch)||void 0===l?void 0:l.valueKey,textKey:null===(n=r.fetch)||void 0===n?void 0:n.textKey},autoFocus:!0,asyncLoad:r.asyncLoad,checkStrictly:r.checkStrictly,checkStrategy:r.checkStrategy,defaultSelectedKeys:i,defaultExpandAll:r.defaultExpandAll,onSelectChange:e=>p(e),onCheckChange:e=>p(e)}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Jr[u]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},q.default.createElement(pt,{onClick:()=>d(null),style:{marginRight:8}},c("qm.dialog.cancel")),q.default.createElement(pt,{type:"primary",disabled:!f,onClick:()=>d(f)},c("qm.dialog.confirm"))))};oc.displayName="TreeHelper";const sc=q.default.forwardRef(((e,t)=>{var n,a,r,i;const{$size:o,flattenColumns:s,doFieldValidate:u}=q.default.useContext(ei),{dataKey:c,visible:f,setVisible:p,doFieldUpdate:m,cellValueChange:h}=q.default.useContext(Qu),{column:g,row:v,rowKey:y,columnKey:b,options:x}=e,{t:E}=ot();Uu();const C=!!(null===(n=x.helper)||void 0===n?void 0:n.combinedDataIndex),{dataIndex:w,precision:S}=g,{type:N,extra:T={},rules:I=[],helper:O={},onChange:R,onEnter:k}=x,L=Fa(v,C?O.combinedDataIndex:w),P=O.fieldAliasMap;P||ft("Table","helper 需要配置 `fieldAliasMap` 选项");const A="function"==typeof P?P():P||{};Object.keys(A).includes(w)||ft("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),C&&(O.combinedDataIndex.split("|").every((e=>Object.keys(A).includes(e)))||ft("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),A[w].includes("|")&&ft("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const F=e=>{const{beforeOpen:t}=O,l=(null!=t?t:Pe)({[c]:L},v,g);(null==l?void 0:l.then)?l.then((()=>{p(!0),null==e||e()})).catch((()=>{})):!1!==l&&(p(!0),null==e||e())},_=()=>{p(!1)},D=(e="",t)=>{var n;if(l.isPlainObject(t)&&Object.keys(t).length)for(const e in t){const l=t[e],a=s.find((t=>t.dataIndex===e));if(a){Aa(v,e,l,a.precision);const t=null===(n=a.editRender)||void 0===n?void 0:n.call(a,v,a);t&&Array.isArray(t.rules)&&u(t.rules,l,y,e,ja(a.title))}else Aa(v,e,l)}Aa(v,w,e,S),u(I,e,y,b,ja(g.title)),m(v,y,b),null==R||R({[c]:e},v),h()},M={visible:f,title:E("qm.searchHelper.text"),width:null!==(a=O.width)&&void 0!==a?a:"40%",loading:!1,wrapClassName:bi.popupClassName,bodyStyle:{paddingBottom:`${Jr[o]+20}px`},onClose:()=>{_()}},H=Object.assign(Object.assign({},O),{defaultSelectedKeys:[L],size:o,onClose:e=>{e?(e=>{const t={};for(const l in A){const n=A[l];l!==w&&(t[l]=Fa(e,n))}const l=A[w]?Fa(e,A[w]):"";D(l,t);const{closed:n}=O;p(!1),null==n||n(e)})(e):_()}});return q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Input.Search,{ref:t,value:L,allowClear:null===(r=T.allowClear)||void 0===r||r,readOnly:T.readOnly,disabled:T.disabled,placeholder:null!==(i=T.placeholder)&&void 0!==i?i:E("qm.table.editable.selectPlaceholder"),onChange:e=>{const{value:t}=e.target},onKeyDown:e=>{13===e.keyCode&&(e.target.value,!f&&F())},onDoubleClick:()=>{F()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?F():D(""))}}),q.default.createElement(Qn,M,q.default.createElement(oc,H)))}));sc.displayName="TreeHelperCell";const dc=e=>{var t,n;const{$size:a,doFieldValidate:r}=q.default.useContext(ei),{dataKey:i,visible:o,setVisible:s,doFieldUpdate:u,cellValueChange:c}=q.default.useContext(Qu),{column:f,row:p,rowKey:m,columnKey:h,options:v}=e,{t:y}=ot();Uu(),q.default.useLayoutEffect((()=>{v.items&&w(v.items.map((e=>({[E.current.valueKey]:e.value,[E.current.textKey]:e.text}))))}),[]);const[b,x]=q.default.useState(v.items||[]),E=q.default.useRef({}),C=q.default.useRef([]),w=e=>C.current=e,{dataIndex:S}=f,{type:N,extra:T={},items:I=[],rules:O=[],helper:R={},onInput:k,onChange:L,onEnter:P}=v,A=Pa(p,S),F=R.fieldAliasMap;F||ft("Table","helper 需要配置 `fieldAliasMap` 选项");const _="function"==typeof F?F():F||{};Object.keys(_).includes("valueKey")&&Object.keys(_).includes("textKey")||ft("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),E.current=_;const D=e=>{const{beforeOpen:t}=R,l=(null!=t?t:Pe)({[i]:A},p,f);(null==l?void 0:l.then)?l.then((()=>{s(!0),null==e||e()})).catch((()=>{})):!1!==l&&(s(!0),null==e||e())},M=()=>{s(!1)},H=e=>{Aa(p,S,e),r(O,e,m,h,ja(f.title)),u(p,m,h),null==L||L({[i]:e},p,C.current),c()},$={visible:o,title:y("qm.searchHelper.text"),width:null!==(t=R.width)&&void 0!==t?t:"40%",loading:!1,wrapClassName:bi.popupClassName,bodyStyle:{paddingBottom:`${Jr[a]+20}px`},onClose:()=>{M()}},j=Object.assign(Object.assign({},R),{size:a,multiple:!0,initialValue:l.merge({},R.initialValue),defaultSelectedKeys:A,onClose:e=>{e?(e=>{const{textKey:t,valueKey:l}=_;w(e);const n=C.current.map((e=>({text:e[t],value:e[l]})));x(n),H(n.map((e=>e.value)));const{closed:a}=R;s(!1),null==a||a(C.current)})(e):M()}});return q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},q.default.createElement("span",{className:"ant-input-wrapper ant-input-group"},q.default.createElement(d.Select,{mode:"multiple",open:!1,value:A,placeholder:null!==(n=T.placeholder)&&void 0!==n?n:y("qm.table.editable.selectPlaceholder"),allowClear:T.allowClear,maxTagCount:T.collapseTags?"responsive":void 0,maxTagTextLength:T.maxTagTextLength,disabled:T.disabled,style:{width:"100%"},onKeyDown:e=>{13===e.keyCode&&!o&&D()},onDoubleClick:()=>{T.disabled||D()},onChange:e=>{const{valueKey:t}=_;w(C.current.filter((l=>e.includes(l[t])))),H(e)}},b.map((e=>q.default.createElement(d.Select.Option,{key:e.value,value:e.value},e.text)))),q.default.createElement("span",{className:"ant-input-group-addon"},q.default.createElement(d.Button,{className:"ant-input-search-button",disabled:T.disabled,icon:q.default.createElement(g.SearchOutlined,null),onClick:()=>{D()}})))),q.default.createElement(Qn,$,q.default.createElement(oc,j)))},uc=q.default.forwardRef(((e,t)=>{var n,a,r;const{$size:i,flattenColumns:o,doFieldValidate:s}=q.default.useContext(ei),{dataKey:u,visible:c,setVisible:f,setMatching:p,doFieldUpdate:m,cellValueChange:h}=q.default.useContext(Qu),{column:g,row:v,rowKey:y,columnKey:b,options:x}=e,{t:E}=ot();Uu();const C=!!(null===(n=x.helper)||void 0===n?void 0:n.combinedDataIndex),w=q.default.useRef(!1),S=q.default.useRef({}),[N,T]=q.default.useState(),{dataIndex:I,precision:O}=g,{type:R,extra:k={},rules:L=[],helper:P={},onInput:A,onChange:F,onEnter:_}=x,D=Fa(v,C?P.combinedDataIndex:I),M=P.fieldAliasMap;M||ft("Table","helper 需要配置 `fieldAliasMap` 选项");const H="function"==typeof M?M():M||{};Object.keys(H).includes(I)||ft("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),C&&(P.combinedDataIndex.split("|").every((e=>Object.keys(H).includes(e)))||ft("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),H[I].includes("|")&&ft("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const $=e=>{const{filterAliasMap:t}=P,n=""!==e?e:void 0,a=("function"==typeof t?t():t)||[],r={[I]:n};return(Array.isArray(a)?a:[a]).forEach((e=>{if(l.isPlainObject(e))for(const t in e)r[t]="function"==typeof e[t]?e[t](n):n;else r[e]=n})),r},j=e=>{const{autoQueryAssign:t=!0}=P;t&&(S.current=$(e)),f(!0)},K=(e,t)=>{const{beforeOpen:l}=P,n=(null!=l?l:Pe)({[u]:D},v,g);(null==n?void 0:n.then)?n.then((()=>{j(e),null==t||t()})).catch((()=>{})):!1!==n&&(j(e),null==t||t())},V=e=>{const t={};for(const l in H){const n=H[l];l!==I&&(t[l]=Fa(e,n))}const l=H[I]?Fa(e,H[I]):"";W(l,t);const{closed:n}=P;f(!1),null==n||n(e)},z=()=>{const{onlySelect:e=!0}=P;w.current&&W(e?"":D),f(!1)},W=(e="",t)=>{var n;if(l.isPlainObject(t)&&Object.keys(t).length)for(const e in t){const l=t[e],a=o.find((t=>t.dataIndex===e));if(a){Aa(v,e,l,a.precision);const t=null===(n=a.editRender)||void 0===n?void 0:n.call(a,v,a);t&&Array.isArray(t.rules)&&s(t.rules,l,y,e,ja(a.title))}else Aa(v,e,l)}C&&!e&&((e,t,l,n)=>{if(!t.includes("|"))return Aa(e,t,l,n);const a=l.split("|")||[];t.split("|").forEach(((t,l)=>{var n;t&&Aa(e,t,null===(n=a[l])||void 0===n?void 0:n.trim())}))})(v,P.combinedDataIndex,""),Aa(v,I,e,O),s(L,e,y,b,ja(g.title)),m(v,y,b),null==F||F({[u]:e},v),h(),S.current={},w.current=!1,T(void 0)},B={visible:c,title:E("qm.searchHelper.text"),width:null!==(a=P.width)&&void 0!==a?a:"60%",loading:!1,wrapClassName:bi.popupClassName,bodyStyle:{paddingBottom:`${Jr[i]+20}px`},onClose:()=>{z()}},U=Object.assign(Object.assign({},P),{size:i,initialValue:Object.assign({},S.current,P.initialValue),onClose:e=>{e?V(e):z()}});return q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Input.Search,{ref:t,value:null!=N?N:D,placeholder:null!==(r=k.placeholder)&&void 0!==r?r:E("qm.table.editable.selectPlaceholder"),allowClear:k.allowClear,readOnly:k.readOnly,disabled:k.disabled,onBlur:e=>{var t;const{value:n}=e.target,{onlySelect:a=!0,table:r}=P;if(w.current&&!c)return n&&a&&(null===(t=null==r?void 0:r.fetch)||void 0===t?void 0:t.api)?(e=>{const{table:t,initialValue:n={}}=P,{beforeFetch:a=Pe}=t.fetch;return new Promise(((r,i)=>Ie(void 0,void 0,void 0,(function*(){var o;const s=l.merge({},t.fetch.params,Object.assign(Object.assign({},n),$(e)),{currentPage:1,pageSize:500});if(!a(s))return i();p(!0);try{const e=yield t.fetch.api(s);if(200===e.code){const n=Array.isArray(e.data)?e.data:null!==(o=l.get(e.data,t.fetch.dataKey))&&void 0!==o?o:[];r(n)}else i()}catch(e){i(e)}finally{Fe((()=>p(!1)))}}))))})(n).then((e=>((e=[],t)=>{const l=e.filter((e=>Fa(e,H[I]).toString().includes(t)));if(1===l.length)return V(l[0]);K(t)})(e,n))).catch((()=>W(""))):void W(n)},onChange:e=>{const{value:t}=e.target;null==A||A({[u]:t}),w.current=!0,T(t)},onKeyDown:e=>{var t;if(13===e.keyCode){const l=null!==(t=e.target.value)&&void 0!==t?t:"";!c&&K(l)}},onDoubleClick:e=>{const{value:t}=e.target;K(t)},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&"INPUT"!==t.target.tagName&&K(e)}}),q.default.createElement(Qn,B,q.default.createElement(Sc,U)))}));uc.displayName="SearchHelperCell";const cc=e=>{var t,n;const{$size:a,doFieldValidate:r}=q.default.useContext(ei),{dataKey:i,visible:o,setVisible:s,doFieldUpdate:u,cellValueChange:c}=q.default.useContext(Qu),{column:f,row:p,rowKey:m,columnKey:h,options:v}=e,{t:y}=ot();Uu();const[b,x]=q.default.useState(v.items||[]),E=q.default.useRef({}),C=q.default.useRef([]),w=e=>C.current=e;q.default.useLayoutEffect((()=>{v.items&&w(v.items.map((e=>({[E.current.valueKey]:e.value,[E.current.textKey]:e.text}))))}),[]);const{dataIndex:S}=f,{type:N,items:T=[],extra:I={},rules:O=[],helper:R={},onInput:k,onChange:L,onEnter:P}=v,A=Pa(p,S),F=R.fieldAliasMap;F||ft("Table","helper 需要配置 `fieldAliasMap` 选项");const _="function"==typeof F?F():F||{};Object.keys(_).includes("valueKey")&&Object.keys(_).includes("textKey")||ft("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),E.current=_;const D=e=>{const{beforeOpen:t}=R,l=(null!=t?t:Pe)({[i]:A},p,f);(null==l?void 0:l.then)?l.then((()=>{s(!0),null==e||e()})).catch((()=>{})):!1!==l&&(s(!0),null==e||e())},M=()=>{s(!1)},H=e=>{Aa(p,S,e),r(O,e,m,h,ja(f.title)),u(p,m,h),null==L||L({[i]:e},p,C.current),c()},$={visible:o,title:y("qm.searchHelper.text"),width:null!==(t=R.width)&&void 0!==t?t:"60%",loading:!1,wrapClassName:bi.popupClassName,bodyStyle:{paddingBottom:`${Jr[a]+20}px`},onClose:()=>{M()}},j=Object.assign(Object.assign({},R),{size:a,multiple:!0,initialValue:l.merge({},R.initialValue),defaultSelectedKeys:A,onClose:(e,t)=>{e?((e,t)=>{const{textKey:n,valueKey:a}=_;w(l.uniqBy([...C.current.filter((e=>t.includes(e[a]))),...e],a));const r=C.current.map((e=>({text:e[n],value:e[a]}))),i=l.uniqBy([...r,...T],"value").filter((e=>t.includes(e.value)));x(i),H(i.map((e=>e.value)));const{closed:o}=R;s(!1),null==o||o(C.current)})(e,t):M()}});return q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},q.default.createElement("span",{className:"ant-input-wrapper ant-input-group"},q.default.createElement(d.Select,{mode:"multiple",open:!1,value:A,placeholder:null!==(n=I.placeholder)&&void 0!==n?n:y("qm.table.editable.selectPlaceholder"),allowClear:I.allowClear,maxTagCount:I.collapseTags?"responsive":void 0,maxTagTextLength:I.maxTagTextLength,disabled:I.disabled,style:{width:"100%"},onKeyDown:e=>{13===e.keyCode&&!o&&D()},onDoubleClick:()=>{I.disabled||D()},onChange:e=>{const{valueKey:t}=_;w(C.current.filter((l=>e.includes(l[t])))),H(e)}},b.map((e=>q.default.createElement(d.Select.Option,{key:e.value,value:e.value},e.text)))),q.default.createElement("span",{className:"ant-input-group-addon"},q.default.createElement(d.Button,{className:"ant-input-search-button",disabled:I.disabled,icon:q.default.createElement(g.SearchOutlined,null),onClick:()=>{D()}})))),q.default.createElement(Qn,$,q.default.createElement(Sc,j)))},fc=q.default.forwardRef(((e,t)=>{var n,a,r,i;const{column:o,record:s,rowKey:d,columnKey:u}=e,{tableRef:c,getRowKey:f,isFetch:p,updateTableFlatData:m,dataChange:h}=q.default.useContext(ei),g=q.default.useContext($u),{store:v,fieldAuth:y}=c.current,b=(null===(n=o.editRender)||void 0===n?void 0:n.call(o,s,o))||{},x=q.default.useRef(null),E=q.default.useRef(null),C=q.default.useRef(null),w=q.default.useRef(null),[S,N]=q.default.useState(!1),[T,I]=q.default.useState(!1),O=`${d}|${u}`,R=2===g.length?`${g[0]}|${g[1]}`:"",k=(b.editable||Xa(g,[d,u],!0))&&!b.disabled&&!(null===(a=y[u])||void 0===a?void 0:a.disabled),L=![...v.state.required,...v.state.validate].some((({x:e,y:t})=>e===d&&t===u)),P=(null===(r=v.state.required.find((({x:e,y:t})=>e===d&&t===u)))||void 0===r?void 0:r.text)||"",A=(null===(i=v.state.validate.find((({x:e,y:t})=>e===d&&t===u)))||void 0===i?void 0:i.text)||"",F=v.state.edited.some((({x:e,y:t})=>e===d&&t===u)),_=k||!L||S||T;q.default.useEffect((()=>{_&&R===O&&D()}),[g]);const D=()=>{var e,t,l,n;const{type:a}=b;switch(a){case"text":null===(e=x.current)||void 0===e||e.focus();break;case"number":null===(t=E.current)||void 0===t||t.select();break;case"search-helper":null===(l=C.current)||void 0===l||l.focus();break;case"tree-helper":null===(n=w.current)||void 0===n||n.focus()}},M=()=>{var e,t,l,n;const{type:a}=b;switch(a){case"text":null===(e=x.current)||void 0===e||e.blur();break;case"number":null===(t=E.current)||void 0===t||t.blur();break;case"search-helper":null===(l=C.current)||void 0===l||l.blur();break;case"tree-helper":null===(n=w.current)||void 0===n||n.blur()}},H=st((()=>{m(),h(),Fe((()=>j()))})),$=(e,t,l)=>{v.addToUpdated(e),v.addToEdited({x:t,y:l})},j=()=>{const{updated:e,edited:t}=v.state,{recordsMap:n,tableOriginData:a,isOriginTree:r}=c.current;r&&!p&&e.length&&function a(r){r.forEach((r=>{r.children&&a(r.children);const i=f(r,r.index),o=e.find((e=>e._rowKey===i)),s=t.filter((e=>e.x===i)).map((e=>e.y));o&&s.length&&r!==n.get(i)&&l.merge(r,l.pick(o,s))}))}(a)};q.default.useImperativeHandle(t,(()=>({focus:D,blur:M,isEditable:()=>!b.disabled,isOpening:()=>S})));const K=q.default.useMemo((()=>({dataKey:O,visible:S,matching:T,setVisible:N,setMatching:I,doFieldUpdate:$,cellValueChange:H})),[S,T]),V={text:()=>q.default.createElement(Zu,{ref:x,column:o,row:s,rowKey:d,columnKey:u,options:b}),textarea:()=>q.default.createElement(Zu,{ref:x,column:o,row:s,rowKey:d,columnKey:u,options:b,isTextArea:!0}),number:()=>q.default.createElement(ec,{ref:E,column:o,row:s,rowKey:d,columnKey:u,options:b}),select:()=>q.default.createElement(tc,{column:o,row:s,rowKey:d,columnKey:u,options:b}),"select-multiple":()=>q.default.createElement(tc,{column:o,row:s,rowKey:d,columnKey:u,options:b,isMultiple:!0}),date:()=>q.default.createElement(lc,{column:o,row:s,rowKey:d,columnKey:u,options:b,dateType:"exactdate"}),datetime:()=>q.default.createElement(lc,{column:o,row:s,rowKey:d,columnKey:u,options:b,dateType:"datetime"}),month:()=>q.default.createElement(lc,{column:o,row:s,rowKey:d,columnKey:u,options:b,dateType:"month"}),year:()=>q.default.createElement(lc,{column:o,row:s,rowKey:d,columnKey:u,options:b,dateType:"year"}),time:()=>q.default.createElement(nc,{column:o,row:s,rowKey:d,columnKey:u,options:b}),checkbox:()=>q.default.createElement(ac,{column:o,row:s,rowKey:d,columnKey:u,options:b}),switch:()=>q.default.createElement(rc,{column:o,row:s,rowKey:d,columnKey:u,options:b}),"search-helper":()=>q.default.createElement(uc,{ref:C,column:o,row:s,rowKey:d,columnKey:u,options:b}),"search-helper-multiple":()=>q.default.createElement(cc,{column:o,row:s,rowKey:d,columnKey:u,options:b}),"tree-helper":()=>q.default.createElement(sc,{ref:w,column:o,row:s,rowKey:d,columnKey:u,options:b}),"tree-helper-multiple":()=>q.default.createElement(dc,{column:o,row:s,rowKey:d,columnKey:u,options:b}),custom:()=>q.default.createElement(ic,{column:o,row:s,rowKey:d,columnKey:u,options:b})};return q.default.createElement(q.default.Fragment,null,_?(()=>{const{type:e}=b,t=V[e];if(!t)return ft("Table","单元格编辑的类型 `type` 配置不正确"),null;const l=["cell--edit",{"is-error":!L}];return q.default.createElement("div",{className:J.default(l)},q.default.createElement(Qu.Provider,{value:K},t()),!L&&q.default.createElement("div",{className:"cell-error"},P||A))})():(()=>{const{disabled:t}=b,{disabledColor:l,disabledBgColor:n}=b.extra||{},a=["cell--show",{"is-cell-bg":t&&n}];return q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{className:J.default(a),style:{color:t?l:""}},e.children),t&&n&&q.default.createElement("i",{className:"cell--bg",style:{background:n}}))})(),F&&(()=>{const{cornerSign:e=!0}=b.extra||{};return e&&q.default.createElement("i",{className:"cell--sign"})})())}));fc.displayName="CellEdit";const pc=e=>{const{text:t,options:l,showMessage:n=!0,onCopy:a}=e,{t:r}=ot();return Sn(e.children,{onClick:i=>{const o=q.default.Children.only(e.children),s=ge.default(t,l);null==a||a(t,s),s&&n&&d.message.success(r("qm.clipboard.success")),o&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(i)}})};pc.displayName="QmCopyToClipboard";const mc=q.default.forwardRef(((e,t)=>{const{column:l,row:n,rowIndex:a,columnIndex:r,rowKey:i,showTitle:o,onUnmount:s}=e,{tableRef:d,selectionKeys:u,treeExpandIndex:c,updateMark:f}=q.default.useContext(ei),{dataIndex:p,translate:m,canCopy:h,render:v,editRender:y,shouldCellUpdate:b}=l,{t:x}=ot(),{renderText:E,getTitleFromCellNode:C}=Oi(),w=q.default.useRef(null),S=Pa(n,p),[N,T]=function(e,t,l){const n=$.useRef({});return"value"in n.current&&!l(n.current.condition,t)||(n.current.value=e(),n.current.condition=t),n.current.value}((()=>{const e=v?v(S,n,l,a,r):E(S,l,n);return[e,y?q.default.createElement(fc,{ref:t,column:l,record:n,rowKey:i,columnKey:p},e):null]}),[f,n,S,v,y],((e,t)=>{if(b){const[,l]=e,[,a]=t;return b(a,l,n)}return!Xa(e,t,!0)})),I=q.default.useMemo((()=>[bi.expandableColumn,bi.selectionColumn,bi.operationColumn].includes(p)?"":C(N)),[N]);q.default.useEffect((()=>()=>null==s?void 0:s()),[]),q.default.useEffect((()=>{o&&(w.current.parentNode.title=I)}),[o,N]);const O=e=>Array.isArray(e.children),R=()=>{return p===bi.expandableColumn?q.default.createElement(Xu,{record:n,rowKey:i}):p===bi.selectionColumn?q.default.createElement(Yu,{selectionKeys:u,column:l,record:n,rowKey:i}):T||(d.current.isTreeTable&&p===c?q.default.createElement(q.default.Fragment,null,(e=n._level)?q.default.createElement("span",{key:e,className:`cell--indent indent-level-${e}`,style:{paddingLeft:e*bi.treeTable.textIndent+"px"}}):null,q.default.createElement(Xu,{key:"expand",record:n,rowKey:i,style:O(n)?{}:{visibility:"hidden"}}),N):h?q.default.createElement("div",{className:"cell--copy"},q.default.createElement("span",{className:"text"},N),I&&q.default.createElement(pc,{text:I},q.default.createElement(g.CopyOutlined,{className:"icon",title:x("qm.table.config.copyText"),onClick:e=>e.stopPropagation()}))):N);var e};return m?q.default.createElement(Hr,{ref:w,text:I,className:"cell"},R()):q.default.createElement("div",{ref:w,className:"cell"},R())}));mc.displayName="Cell";const hc={open:!1,offsetX:0,offsetY:0},gc=q.default.forwardRef(((e,t)=>{const{rowVirtualize:l}=e,{tableRef:n,getRowKey:a,prefixCls:r,tableFlatData:i,flattenColumns:o,tableRowHeight:s,mergedTdCells:d,setMergedCells:u}=q.default.useContext(ei),{areaSelection:c={}}=n.current.props,{elementStore:f,scrollYLoad:p}=n.current,{t:m}=ot(),h=q.default.useRef(document.onselectstart),g=q.default.useRef(null),v=q.default.useRef(null),y=q.default.useRef(null),b=e=>{y.current=e},[x,E]=q.default.useState(null),[C,w]=q.default.useState(null),[S,N]=q.default.useState(null),T=e=>{if(!e)return N(null);let t=!1;for(const l in e)if((null==S?void 0:S[l])!==e[l]){t=!0;break}t&&N(Object.assign({},S,e))};Hd({ref:g,handler:()=>V()}),q.default.useEffect((()=>{const e=ae.default(f.$tableBody,"mousedown",D),t=ae.default(f.$tableBody,"contextmenu",F),l=ae.default(document,"keydown",_);return()=>{e.remove(),t.remove(),l.remove()}}),[]);const I=()=>{E(null),T(null),b(null),w(null)};q.default.useImperativeHandle(t,(()=>({blur:I})));const O=e=>{let t=e;for(;t;){if(!f.$tableBody.contains(t))return null;if("TD"===t.tagName.toUpperCase())return t;t=t.parentNode}return null},R=e=>({rowIndex:parseInt(e.parentNode.getAttribute("data-row-index"),10),colIndex:parseInt(e.getAttribute("data-col-index"),10),rowspan:Number(e.getAttribute("rowspan")||1),colspan:Number(e.getAttribute("colspan")||1),l:e.offsetLeft,t:e.offsetTop,w:e.offsetWidth,h:e.offsetHeight}),k=e=>({colStart:e.colIndex,colEnd:e.colIndex+e.colspan,rowStart:e.rowIndex,rowEnd:e.rowIndex+e.rowspan}),L=e=>{let[t,l,n,a]=[1/0,-1/0,1/0,-1/0];for(const r of e)t=Math.min(t,r.rowStart),l=Math.max(l,r.rowEnd),n=Math.min(n,r.colStart),a=Math.max(a,r.colEnd);return{rowStart:t,rowEnd:l,colStart:n,colEnd:a}},P=wn((e=>{let t=L([k(e),y.current]);d.forEach((e=>{const l=i.findIndex((t=>a(t,t.index)===e.rowKey)),n=o.findIndex((t=>t.dataIndex===e.dataIndex)),r={rowStart:l,rowEnd:l+e.rowSpan,colStart:n,colEnd:n+e.colSpan};var s,d;d=r,(s=t).rowEnd<=d.rowStart||s.rowStart>=d.rowEnd||s.colEnd<=d.colStart||s.colStart>=d.colEnd||(t=L([t,r]))})),T(t)}),5),A=e=>{var t;u(e),null===(t=c.onCellMerge)||void 0===t||t.call(c,e),Fe((()=>I()))},F=st((e=>{c.cellMerge&&x&&j(e.clientX,e.clientY)?(e.preventDefault(),K(e)):(null==C?void 0:C.open)&&V()})),_=st((e=>{27===e.keyCode&&I()})),D=st((e=>{e.stopPropagation();const t=O(e.target);if(1!==e.buttons||!t)return;V();const l=R(t);E(l);const n=k(l);b(n),T(n),document.addEventListener("mousemove",M),document.addEventListener("mouseup",H),h.current=document.onselectstart,document.onselectstart=()=>!1})),M=st((e=>{const t=O(e.target);t&&P(R(t))})),H=st((()=>{var e;null===(e=c.onSelectChange)||void 0===e||e.call(c,(()=>{const e=[];if(!x||!S)return e;for(let t=S.rowStart;t<S.rowEnd;t++)for(let l=S.colStart;l<S.colEnd;l++)e.push({rowKey:a(i[t],i[t].index),dataIndex:o[l].dataIndex,cellValue:Pa(i[t],o[l].dataIndex)});return e})()),document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",H),$()})),$=()=>{document.onselectstart!==h.current&&(document.onselectstart=h.current)},j=(e,t)=>{const{top:l,left:n}=f.$tableBody.parentNode.getBoundingClientRect(),[a,r]=[e-n,t-l],{el:i,et:o,ew:s,eh:d}=G();return!(a<i||a>i+s||r<o||r>o+d)},K=e=>{const{top:t,left:l,height:n}=v.current.getBoundingClientRect();w({open:!0,offsetX:e.clientX-l,offsetY:-1*(n-(e.clientY-t))})},V=()=>{w((e=>Object.assign(Object.assign({},e),{open:!1})))},z=e=>({rowIndex:i.findIndex((t=>a(t,t.index)===e.rowKey)),colIndex:o.findIndex((t=>t.dataIndex===e.dataIndex)),rowSpan:e.rowSpan,colSpan:e.colSpan}),W=()=>{if(!x||!S||(t=S,(e=x).rowIndex===t.rowStart&&e.colIndex===t.colStart&&e.rowspan===t.rowEnd-t.rowStart&&e.colspan===t.colEnd-t.colStart))return I();var e,t;const l={rowKey:a(i[S.rowStart],i[S.rowStart].index),dataIndex:o[S.colStart].dataIndex,rowSpan:S.rowEnd-S.rowStart,colSpan:S.colEnd-S.colStart};A([...d.filter((e=>!((e,t)=>{const l=z(e),n=z(t),[a,r,i,o]=[l.rowIndex,l.colIndex,l.rowIndex+l.rowSpan-1,l.colIndex+l.colSpan-1],[s,d,u,c]=[n.rowIndex,n.colIndex,n.rowIndex+n.rowSpan-1,n.colIndex+n.colSpan-1];return a<=s&&r<=d&&i>=u&&o>=c||s<=a&&d<=r&&u>=i&&c>=o})(e,l))),l])},B=()=>{const e=a(i[S.rowStart],i[S.rowStart].index),t=o[S.colStart].dataIndex;A(d.filter((l=>!(l.rowKey===e&&l.dataIndex===t))))},U=e=>{if(p){return l.measurementsCache.slice(0,e).map((e=>e.size)).reduce(((e,t)=>e+t),0)}if(e>=i.length)return f.$tableBody.parentNode.offsetHeight;const t=a(i[e],i[e].index),n=f.$tableBody.querySelector(`tbody > tr[data-row-key="${t}"]`);return n?n.offsetTop:s*e},G=()=>{const{w:e,h:t,l:l,t:n}=x,a=o.slice(0,S.colStart).reduce(((e,t)=>e+(t.width||t.renderWidth)),0),r=U(S.rowStart);return{sl:l,st:n,sw:e,sh:t,el:a,et:r,ew:o.slice(0,S.colEnd).reduce(((e,t)=>e+(t.width||t.renderWidth)),0)-a,eh:U(S.rowEnd)-r}};return q.default.createElement("div",{className:`${r}--area-select`},(()=>{if(!x||!S)return null;const{sl:e,st:t,sw:l,sh:n,el:a,et:r,ew:i,eh:o}=G(),{open:s,offsetX:d,offsetY:u}=C||hc,c=q.default.createElement("ul",{ref:g,className:"ant-dropdown-menu"},q.default.createElement("li",{className:"ant-dropdown-menu-item",onClick:W},m("qm.table.areaSelect.mergeCell")),q.default.createElement("li",{className:"ant-dropdown-menu-item",onClick:B},m("qm.table.areaSelect.cancelMerge")));return q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:"active-area",style:{left:e,top:t,width:l,height:n}}),q.default.createElement(xs,{popupVisible:s,popup:c,action:[],popupPlacement:"bottomLeft",prefixCls:"ant-dropdown",popupClassName:bi.popupClassName,builtinPlacements:{bottomLeft:{points:["tl","bl"],offset:[d+4,u+4],overflow:{adjustX:1,adjustY:1}}}},q.default.createElement("div",{ref:v,className:"checked-area",style:{left:a,top:r,width:i,height:o}})))})())}));gc.displayName="AreaSelect";const vc=q.default.forwardRef(((e,t)=>{const{tableRef:n,getRowKey:a,prefixCls:r,tableFlatData:i,flattenColumns:o,editableColumns:s,leftFixedColumns:d,rightFixedColumns:u,derivedMergeCells:c,tableRowHeight:f,sorter:p,layout:m,showFooter:h,selectionKeys:g,rowExpandedKeys:v,highlightKey:y,activedCell:b,isPingLeft:x,isPingRight:E,isTableEmpty:C,isGroupSubtotal:w,setElementStore:S,setSelectionKeysEffect:N,setHighlightKey:T,setActivedCell:I,getStickyLeft:O,getStickyRight:R,setPingLeft:k,setPingRight:L,setFullScreen:P,scrollBottomDebouncer:A}=q.default.useContext(ei),{height:F,minHeight:_,maxHeight:D,rowSelection:M,rowHighlight:H,expandable:$,stripe:j,summation:K,rowHeight:V,rowStyle:z,cellStyle:W,spanMethod:B,tableConfig:U,areaSelection:G,ellipsis:Y,showHeader:X,rowDraggable:Q,onRowClick:Z,onRowDblclick:ee,onRowContextmenu:te,onRowEnter:le}=n.current.props,ne=q.default.useRef(null),re=q.default.useRef(new Map),ie=q.default.useRef(null),oe=q.default.useRef({prevST:0,prevSL:0}),{onNodeDragStart:se,onNodeDragEnter:de,onNodeDragOver:ue,onNodeDragLeave:ce,onNodeDragEnd:fe,onNodeDrop:pe,indent:me,dropOptions:he}=Bu({openDragSort:Q}),{rowVirtualizer:ge,columnVirtualizer:ve,virtualRows:ye,virtualColumns:be,resetItemXSize:xe,getYIndexes:Ee,virtualTranslateY:Ce,virtualTranslateX:we,calcVirtualYSize:Se,calcVirtualXSize:Ne,scrollToYIndex:Te}=((e,t)=>{var l;const{tableRef:n,tableRowHeight:a}=q.default.useContext(ei),{props:r,scrollBarRef:i}=n.current,o=(null===(l=r.tableConfig)||void 0===l?void 0:l.overscan)||1,s=q.default.useMemo((()=>{var e;return(null===(e=i.current)||void 0===e?void 0:e.scrollElement)||null}),[i.current]),d=q.default.useMemo((()=>{const e=[],l=[];return t.forEach(((t,n)=>{"left"===t.fixed&&e.push(n),"right"===t.fixed&&l.push(n)})),[e,l]}),[t]),u=Fd({count:e.length,getScrollElement:()=>s,estimateSize:()=>a,indexAttribute:"data-row-index",overscan:o,enabled:n.current.scrollYLoad}),c=u.getVirtualItems(),f=Fd({horizontal:!0,count:t.length,getScrollElement:()=>s,estimateSize:e=>t[e].width||t[e].renderWidth||0,indexAttribute:"data-col-index",overscan:o,enabled:n.current.scrollXLoad,rangeExtractor:e=>[...new Set([...d[0],...Sd(e),...d[1]])]}),p=f.getVirtualItems();return{rowVirtualizer:u,columnVirtualizer:f,virtualRows:c,virtualColumns:p,resetItemXSize:e=>{e.forEach(((e,t)=>{f.resizeItem(t,e.width||e.renderWidth||bi.defaultColumnWidth)}))},getYIndexes:()=>u.getVirtualIndexes()||[],getXIndexes:()=>f.getVirtualIndexes()||[],virtualTranslateY:()=>{var e;return(null===(e=c[0])||void 0===e?void 0:e.start)||0},virtualTranslateX:()=>{var e,t,l,n;const a=d[0].length;return a?(null===(t=p[a])||void 0===t?void 0:t.index)===a?(null===(l=p[0])||void 0===l?void 0:l.start)||0:((null===(n=p[a])||void 0===n?void 0:n.start)||0)-p.slice(0,a).reduce(((e,t)=>e+t.size),0):(null===(e=p[0])||void 0===e?void 0:e.start)||0},calcVirtualYSize:()=>u.getTotalSize()||"",calcVirtualXSize:()=>f.getTotalSize()||"",scrollToYIndex:e=>{u.scrollToIndex(e)},scrollToXIndex:e=>{f.scrollToIndex(e)}}})(i,o),Ie=Ee(),Oe=e=>{if(e&&!Y)return ge.measureElement(e)},Re=q.default.useMemo((()=>c.length&&n.current.scrollYLoad?((e,t)=>{const l=[],n=new Set(t);return e.forEach((({row:e,col:t,rowSpan:a,colSpan:r})=>{const i=e+a-1,o=[];for(let t=e;t<=i;t++)n.has(t)&&o.push(t);if(0===o.length)return;const s=o.length;o.forEach(((e,n)=>{0===n&&l.push({row:e,col:t,rowSpan:s,colSpan:r});for(let a=t;a<t+r;a++)0===n&&a===t||l.push({row:e,col:a,rowSpan:0,colSpan:0})}))})),l})(c,Ie):c),[c,Ie.join(",")]),[ke,Ae]=q.default.useState([]),Fe=Uu();Hd({ref:ne,omitClassNames:[`.${bi.popupClassName}`],handler:()=>{var e;Ye([]),null===(e=ie.current)||void 0===e||e.blur()}}),q.default.useImperativeHandle(t,(()=>({setClickedValues:Ye,createFocus:Ve,forceUpdate:Fe,resetItemXSize:xe,scrollToYIndex:Te}))),Yl((()=>{ke.length&&n.current.tableManager.focus(n.current.uid)}),[ke]),q.default.useLayoutEffect((()=>{Ke();const e=ae.default(document,"keydown",Me);return()=>e.remove()}),[]);const _e=q.default.useMemo((()=>{const{headerHeight:e,viewportHeight:t,footerHeight:l,tableFullHeight:n,tableAutoHeight:a}=m,r={};return C&&Object.assign(r,{minHeight:"100px"}),_&&Object.assign(r,{minHeight:ka(_)-e-l+"px"}),D&&Object.assign(r,{maxHeight:ka(D)-e-l+"px"}),F||n||a?Object.assign(Object.assign({},r),{maxHeight:"",minHeight:"",height:`${t}px`}):r}),[F,D,_,C,m]),De=st((e=>{const{elementStore:t}=n.current,{prevST:l,prevSL:a}=oe.current,{scrollTop:r,scrollLeft:i}=e;if(i!==a){X&&(t.$header.scrollLeft=i),h&&(t.$footer.scrollLeft=i);const e=i>0,l=Math.ceil(i+m.tableWidth)<m.tableBodyWidth;x!==e&&k(e),E!==l&&L(l)}oe.current={prevST:r,prevSL:i}})),Me=st((e=>{var t,l,r,o,s;if(n.current.uid!==(null===(t=n.current.tableManager.getFocusInstance())||void 0===t?void 0:t.id))return;const{keyCode:d}=e;if(27===d&&(Ye([]),T(""),I({}),P(!1)),ke.length&&(rn(document.activeElement,ne.current)||"INPUT"!==(null===(l=document.activeElement)||void 0===l?void 0:l.tagName))){if(13===d&&("radio"===(null==M?void 0:M.type)||H)){const t=null!==(o=null!==(r=g[0])&&void 0!==r?r:y)&&void 0!==o?o:null,l=null!==(s=i.find((e=>a(e,e.index)===t)))&&void 0!==s?s:null;l&&(null==le||le(l,e))}Be(ke[0],ke[1])||(38!==d&&40!==d||(Zl(e),He(e)),(9===d||e.shiftKey&&9===d)&&(Zl(e),qe(e)))}})),He=Kn((e=>{var t,l;if(!ke.length)return;const n=i.length;let r=i.findIndex((e=>a(e,e.index)===ke[0]));const o=38===e.keyCode?(--r+n)%n:++r%n,s=i[o],d=a(s,s.index),u=We(d,ke[1]);"radio"!==(null==M?void 0:M.type)||(null===(t=M.disabled)||void 0===t?void 0:t.call(M,s))||u||N([d]),!H||(null===(l=H.disabled)||void 0===l?void 0:l.call(H,s))||u||T(d),$e(38===e.keyCode?"top":"bottom",o),ze(...ke),Ye([d,ke[1]])}),100),qe=Kn((e=>{if(!ke.length)return;if(!s.length)return Ye([]);const t=s.length;let l=s.findIndex((e=>e.dataIndex===ke[1]));const n=e.shiftKey&&9===e.keyCode?(--l+t)%t:++l%t;ze(...ke),je(e.shiftKey&&9===e.keyCode?"left":"right",n),Ye([ke[0],s[n].dataIndex])}),100),$e=(e,t)=>{const{scrollBarRef:l,scrollYLoad:a}=n.current;if(a)return ge.scrollToIndex(t);const r=i.length,o=t,s=ne.current.querySelectorAll("tbody > tr"),d=i.map(((e,t)=>t)).slice(0,o).reduce(((e,t)=>e+s[t].offsetHeight),0),u=s[o].offsetHeight;"top"===e?d<l.current.scrollTop?l.current.SET_SCROLL_TOP(d):t===r-1&&l.current.SET_SCROLL_TOP(d-(m.viewportHeight-u)):d+u>l.current.scrollTop+m.viewportHeight?l.current.SET_SCROLL_TOP(d-(m.viewportHeight-u)):0===t&&l.current.SET_SCROLL_TOP(d)},je=(e,t)=>{const{scrollBarRef:l}=n.current,a=s.length,r=o.findIndex((e=>e.dataIndex===s[t].dataIndex)),i=o.slice(0,r).reduce(((e,t)=>e+(t.width||t.renderWidth)),0),c=o[r].width||o[r].renderWidth,f=d.reduce(((e,t)=>e+(t.width||t.renderWidth)),0),p=u.reduce(((e,t)=>e+(t.width||t.renderWidth)),0);"left"===e?i<l.current.scrollLeft+f?l.current.SET_SCROLL_LEFT(i-f):t===a-1&&l.current.SET_SCROLL_LEFT(i-(m.tableWidth-c)+p):i+c>l.current.scrollLeft+(m.tableWidth-p)?l.current.SET_SCROLL_LEFT(i-(m.tableWidth-c)+p):0===t&&l.current.SET_SCROLL_LEFT(i-f)},Ke=()=>{S("$tableBody",ne.current)},Ve=(e,t)=>{var l;null===(l=re.current.get(`${e}-${t}`))||void 0===l||l.focus()},ze=(e,t)=>{var l;null===(l=re.current.get(`${e}-${t}`))||void 0===l||l.blur()},We=(e,t)=>{var l,n;return null!==(n=null===(l=re.current.get(`${e}-${t}`))||void 0===l?void 0:l.isEditable())&&void 0!==n&&n},Be=(e,t)=>{var l,n;return null!==(n=null===(l=re.current.get(`${e}-${t}`))||void 0===l?void 0:l.isOpening())&&void 0!==n&&n},Ue=e=>{const t=K.groupItems.findIndex((t=>t.dataIndex===e));return{[`body--row-group_${t+1}`]:t>=0}},Ge=(e,t,l)=>{var r;const{dataIndex:i}=l;if([bi.expandableColumn,bi.operationColumn].includes(i))return;const o=a(t,t.index);Ye([o,i]);const s=We(o,i),{type:d,selectByClickRow:u=!0,disabled:c=Le}=M||{};!d||c(t)||s||(u||i===bi.selectionColumn)&&((e,t)=>{const{type:l,checkStrictly:a=!0,onSelect:r}=M||{};if("radio"===l&&N([e]),"checkbox"===l){const l=!g.includes(e),i=n.current.isTreeTable&&!a?Qe(e,g,l):Xe(e,g,l);N(i),null==r||r(l,t,i)}})(o,t),[bi.selectionColumn].includes(i)||(!H||(null===(r=H.disabled)||void 0===r?void 0:r.call(H,t))||s||T(o),null==Z||Z(t,l,e))},Ye=e=>{l.isEqual(e,ke)||Ae(e)},Xe=(e,t,l)=>l?[...t,e]:t.filter((t=>t!==e)),Qe=(e,t,l)=>{var a;const{disabled:r}=M||{},{tableFullData:i,recordsMap:o}=n.current,s=Ba(i,(t=>t._rowKey===e));let d=[],u=Sa((null==s?void 0:s.children)||[],(e=>e._rowKey));r&&(u=u.filter((e=>!o.has(e)||!r(o.get(e))))),d=l?[...new Set([...t,e,...u])]:t.filter((t=>![e,...u].includes(t)));return((null===(a=Ua(i,e))||void 0===a?void 0:a.slice(0,-1).reverse())||[]).forEach((e=>{var t;const l=Ba(i,(t=>t._rowKey===e)),n=null===(t=null==l?void 0:l.children)||void 0===t?void 0:t.every((e=>d.includes(e._rowKey)));d=n?[...d,e]:d.filter((t=>t!==e))})),d},Ze=(e,t,l)=>{const{scrollXLoad:a}=n.current,{disabled:r}=M||{},i=["body--row",Object.assign({"body--row-striped":j&&t%2!=0,"body--row-selected":g.includes(l)&&!(null==r?void 0:r(e)),"body--row-current":y===l},w?Ue(e._group):null)],s=(a?be:o).map(((n,r)=>Je(a?o[n.index]:n,a?n.index:r,e,t,l)));return Q?q.default.createElement(Gu,{key:l,ref:Oe,className:J.default(i),rowKey:l,rowIndex:t,row:e,indent:me,filter:".cell--edit input",dropOption:he,onNodeDragStart:se,onNodeDragEnter:de,onNodeDragOver:ue,onNodeDragLeave:ce,onNodeDragEnd:fe,onNodeDrop:pe},s):q.default.createElement("tr",{key:l,ref:Oe,"data-row-key":l,"data-row-index":t,className:J.default(i)},s)},Je=(e,t,l,n,a)=>{var r,i,o;const{dataIndex:s,fixed:c,align:m,className:h=""}=e,{rowSpan:g,colSpan:v}=et(l,e,n,t);if(!g||!v)return null;const y=null!==(r=e.ellipsis)&&void 0!==r?r:Y,x=["body--column",{"col--ellipsis":y,"col--center":"center"===m,"col--right":"right"===m,"col-active":b.rowKey===a&&b.dataIndex===s,"column--sort":!!p[s],"cell-fix-left":"left"===c,"cell-fix-right":"right"===c,"cell-fix-left-last":"left"===c&&(null===(i=d[d.length-v])||void 0===i?void 0:i.dataIndex)===s,"cell-fix-right-first":"right"===c&&(null===(o=u[0])||void 0===o?void 0:o.dataIndex)===s,[h]:!!h}],E={left:"left"===c?`${O(s)}px`:"",right:"right"===c?`${R(s)}px`:""},C=z?"function"==typeof z?z(l,n):z:null,S=W?"function"==typeof W?W(l,e,n,t):W:null,N=w?(e=>{var t;const{backgroundColor:l,color:n}=null!==(t=K.groupItems.find((t=>t.dataIndex===e)))&&void 0!==t?t:{};return{backgroundColor:l,color:n}})(l._group):null,T=Object.assign({},E,{height:V?f:""},N,C,S);return q.default.createElement("td",{key:s,"data-col-index":t,rowSpan:g>1?g:void 0,colSpan:v>1?v:void 0,className:J.default(x),style:T,onClick:t=>Ge(t,l,e),onDoubleClick:t=>((e,t,l)=>{const{dataIndex:n}=l;[bi.expandableColumn,bi.selectionColumn,bi.operationColumn].includes(n)||null==ee||ee(t,l,e)})(t,l,e),onContextMenu:t=>((e,t,l)=>{const{dataIndex:n}=l;[bi.expandableColumn,bi.selectionColumn,bi.operationColumn].includes(n)||null==te||te(t,l,e)})(t,l,e)},q.default.createElement(mc,{ref:e=>{e&&re.current.set(`${a}-${s}`,e)},row:l,column:e,rowIndex:n,columnIndex:t,rowKey:a,showTitle:y,onUnmount:()=>re.current.delete(`${a}-${s}`)}))},et=(e,t,n,a)=>{var r;let o=1,s=1;const d=B;if("function"==typeof d){const u=d({row:e,column:t,rowIndex:n,columnIndex:a,tableData:i});Array.isArray(u)?(o=u[0],s=u[1]):l.isPlainObject(u)&&(o=u.rowSpan,s=u.colSpan);const c=null!==(r=Ie[0])&&void 0!==r?r:0;if(e===i[c]&&0===o)for(let e=c;e<i.length;e++){const l=d({row:i[e],column:t,rowIndex:e,columnIndex:a,tableData:i});if((Array.isArray(l)?l[0]:l.rowSpan)>0)break;o++}}if(Re.length>0){const e=Re.find((e=>e.row===n&&e.col===a));e&&(o=e.rowSpan,s=e.colSpan)}return{rowSpan:o,colSpan:s}};return q.default.createElement(_n,{ref:n.current.scrollBarRef,wrapClassName:`${r}--body-wrapper`,wrapStyle:_e,innerStyle:{height:Se(),width:Ne()},showTopScrollbar:null==U?void 0:U.doubleXScrollbar,onScroll:De,onReachedEnd:(e,t)=>{"bottom"===e&&A({type:"scroll",target:t,preventDefault:Le,stopPropagation:Le})}},q.default.createElement($u.Provider,{value:ke},q.default.createElement("table",{ref:ne,style:{width:0,marginTop:Ce(),marginLeft:we()},className:J.default(`${r}--body`,{"virtual-container":n.current.scrollYLoad||n.current.scrollXLoad}),tabIndex:-1,cellSpacing:"0",cellPadding:"0"},(()=>{const{scrollXLoad:e}=n.current;return q.default.createElement("colgroup",null,(e?be:o).map((t=>{const{dataIndex:l,width:n,renderWidth:a}=e?o[t.index]:t;return q.default.createElement("col",{key:l,style:{width:`${n||a}px`,minWidth:`${n||a}px`}})})))})(),q.default.createElement("tbody",null,(e=>{const{scrollYLoad:t,scrollXLoad:l}=n.current,r=[];return(t?e:i).forEach(((e,n)=>{const s=t?i[e.index]:e,d=t?e.index:n,u=a(s,s.index);if(r.push(Ze(s,d,u)),null==$?void 0:$.expandedRowRender){const{expandedRowClassName:e,rowExpandable:t=Pe}=$;v.includes(u)&&t(s)&&r.push(q.default.createElement("tr",{key:`expand_${u}`,className:"body--row-expanded"},q.default.createElement("td",{colSpan:(l?be:o).length,className:"body--column",style:{paddingLeft:M?2*bi.selectionColumnWidth:bi.selectionColumnWidth}},q.default.createElement("div",{className:J.default("cell",e)},$.expandedRowRender(s,d)))))}})),r})(ye)))),!!G&&q.default.createElement(gc,{ref:ie,rowVirtualize:ge}))}));vc.displayName="TableBody";const yc=()=>{const{tableRef:e,prefixCls:t,sorter:l,layout:n,flattenColumns:a,leftFixedColumns:r,rightFixedColumns:i,summationRows:o,setElementStore:s,getStickyLeft:d,getStickyRight:u}=q.default.useContext(ei),{footRender:c}=e.current.props,{t:f}=ot(),p=q.default.useRef(null);q.default.useLayoutEffect((()=>{m()}),[]);const m=()=>{s("$footer",p.current)},h=(t,n,a)=>{var o,s;const{dataIndex:c,fixed:p,align:m,summation:h}=t,g=["footer--column","col--ellipsis",{"col--center":"center"===m,"col--right":"right"===m,"column--sort":!!l[c],"cell-fix-left":"left"===p,"cell-fix-right":"right"===p,"cell-fix-left-last":"left"===p&&(null===(o=r[r.length-1])||void 0===o?void 0:o.dataIndex)===c,"cell-fix-right-first":"right"===p&&(null===(s=i[0])||void 0===s?void 0:s.dataIndex)===c}],v={left:"left"===p?`${d(c)}px`:"",right:"right"===p?`${u(c)}px`:""},y=(null==h?void 0:h.render)?h.render(e.current.tableFullData):Pa(n,`${c}_text`),b=0===a&&""===y?f("qm.table.config.summaryText"):y;return q.default.createElement("td",{key:c,title:b,className:J.default(g),style:Object.assign({},v)},q.default.createElement("div",{className:"cell"},b))},{tableBodyWidth:g}=n;return q.default.createElement("div",{ref:p,className:`${t}--footer-wrapper`},c?c(a,e.current.tableFullData):q.default.createElement("table",{className:`${t}--footer`,cellSpacing:"0",cellPadding:"0",style:{width:g?`${g}px`:""}},q.default.createElement("colgroup",null,a.map((e=>{const{dataIndex:t,width:l,renderWidth:n}=e;return q.default.createElement("col",{key:t,style:{width:`${l||n}px`,minWidth:`${l||n}px`}})}))),q.default.createElement("tfoot",null,o.map(((e,t)=>q.default.createElement("tr",{key:t,className:"footer--row"},a.map(((t,l)=>h(t,e,l)))))))))};var bc;!function(e){e.small="small",e.middle="default",e.large="default"}(bc||(bc={}));const xc=e=>{var t,l,n,a;const{current:r,pageSize:i,total:o,onChange:s}=e,{global:u}=q.default.useContext(xe),{tableRef:c,prefixCls:f,$size:p,setElementStore:m}=q.default.useContext(ei),{uniqueKey:h,paginationConfig:g,infoBarConfig:v}=c.current.props,y=q.default.useRef(null),b=q.default.useMemo((()=>h?`tablePager_${h}`:""),[h]);q.default.useLayoutEffect((()=>{x(),S()}),[]);const x=()=>{m("$pager",y.current)},E=null!==(t=null==g?void 0:g.showSizeChanger)&&void 0!==t?t:bi.pagination.showSizeChanger,C=null!==(l=null==g?void 0:g.showQuickJumper)&&void 0!==l?l:bi.pagination.showQuickJumper,w=(null==g?void 0:g.pageSizeOptions)||(null===(a=null===(n=null==u?void 0:u.table)||void 0===n?void 0:n.pagination)||void 0===a?void 0:a.pageSizeOptions)||bi.pagination.pageSizeOptions,S=()=>Ie(void 0,void 0,void 0,(function*(){if(!b)return;const e=yield N(b);e&&e!==i&&(s(r,e),localStorage.setItem(b,e.toString()))})),N=e=>Ie(void 0,void 0,void 0,(function*(){const t=null==u?void 0:u.getComponentConfigApi;if(t&&!localStorage.getItem(b))try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),T=(e,t)=>Ie(void 0,void 0,void 0,(function*(){const l=null==u?void 0:u.saveComponentConfigApi;if(l)try{yield l({[e]:t})}catch(e){}})),I={[`${f}-pager`]:!0};return q.default.createElement("div",{ref:y,className:J.default(I)},q.default.createElement("div",{className:"pager-alert"},"bottom"===(null==v?void 0:v.position)&&q.default.createElement(Ni,{total:o})),q.default.createElement(d.Pagination,{size:bc[p],showSizeChanger:E,showQuickJumper:C,pageSizeOptions:w,current:r,pageSize:i,total:o,onChange:(e,t)=>{s(e,t)},onShowSizeChange:(e,t)=>{b&&(T(b,t),localStorage.setItem(b,`${t}`))}}))},Ec=()=>{const{prefixCls:e,layout:t}=q.default.useContext(ei),l=q.default.useMemo((()=>{const{headerHeight:e,viewportHeight:l}=t;return{top:`${e}px`,height:`${l}px`}}),[t]);return q.default.createElement("div",{className:`${e}--empty`,style:l},q.default.createElement(pn,null))},Cc=()=>{const{prefixCls:e,setElementStore:t}=q.default.useContext(ei),l=q.default.useRef(null);q.default.useLayoutEffect((()=>{n()}),[]);const n=()=>{t("$resizableBar",l.current)};return q.default.createElement("div",{ref:l,className:`${e}--resizable-bar`})},wc=q.default.forwardRef(((e,t)=>{const n=je(li,e),{rowKey:a,columns:r,loading:i,resizable:o,customClass:s,areaSelection:d,tablePrint:u,exportExcel:c,infoBarConfig:f,topSpaceAlign:p,showTableInfo:m,showFullScreen:h,showRefresh:g,showToolBox:v,showHeader:y,className:b,style:x}=n,{$size:E}=dt(n),C=q.default.useRef(null),w=q.default.useRef(null),S=q.default.useRef(null),N=q.default.useRef(null),T=q.default.useRef(null),I=gt("table"),O=st(((e,t)=>{const l="function"==typeof a?a(e,t):null==e?void 0:e[a];return void 0===l?(ft("Table","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):l})),{tableRef:R,tableFullData:k,setElementStore:L,setOriginColumns:P,setTableFullData:A,setTableOriginData:F,setTableDataMaps:_,setInvalidRowKeys:D,setFieldAuth:M,setColumnsDefined:H,setScrollXLoad:$,setScrollYLoad:j,setResizeState:K,setHandleState:V,setSummaries:z,setSelectionRows:W,setUnMounted:B,clearElementStore:U}=((e,{getRowKey:t})=>{const l=q.default.useRef({props:e,uid:pi(),tableManager:hi,elementStore:{},originColumns:[],tableFullData:[],tableOriginData:[],invalidRowKeys:[],fieldAuth:{},columnsDefined:!e.dynamicThead,scrollBarRef:q.default.createRef(),store:new gi({getRowKey:t}),resizeState:{width:0,height:0,winHeight:window.innerHeight},handleState:{insert:null,remove:!1},summaries:{},isTreeTable:!1,isOriginTree:!1,scrollXLoad:!1,scrollYLoad:!1,selectionRows:[],recordsMap:new Map,unMounted:!1,isIE:!Oe&&/MSIE|Trident/.test(navigator.userAgent)});var n;n=e,l.current.props=n;const a=(e,l,n="",r=0)=>{e.forEach((e=>{const i=t(e,e.index),o=n?`${n}.${e.index+1}`:`${e.index+1}`;e.indexPath=o,e._level=r,e._rowKey=i,e._parentRowKey=r?l:null,Array.isArray(e.children)&&a(e.children,i,o,r+1),e.children&&e.children.length||(e._isLeaf=1)}))};return Object.assign(Object.assign({tableRef:l},l.current),{setElementStore:(e,t)=>{l.current.elementStore[e]=t},setOriginColumns:e=>{l.current.originColumns=e},setTableFullData:e=>{l.current.tableFullData=e;const t=e.some((e=>Array.isArray(e.children)));l.current.isTreeTable=t,t&&a(e,"")},setTableOriginData:e=>{l.current.tableOriginData=e,l.current.isOriginTree=e.some((e=>Array.isArray(e.children)))},setTableDataMaps:e=>{const n=Ca(e);l.current.recordsMap=new Map(n.map(((e,l)=>[t(e,e.index),n[l]])))},setInvalidRowKeys:e=>{l.current.invalidRowKeys=e},setFieldAuth:(e,t)=>{l.current.fieldAuth[e]=t},setColumnsDefined:e=>{l.current.columnsDefined=e},setResizeState:e=>{l.current.resizeState=e},setHandleState:e=>{l.current.handleState=e},setSummaries:e=>{l.current.summaries=e},setScrollXLoad:e=>{l.current.scrollXLoad=e},setScrollYLoad:e=>{l.current.scrollYLoad=e},setSelectionRows:e=>{l.current.selectionRows=e},setUnMounted:e=>{l.current.unMounted=e},clearElementStore:()=>{for(const e in l.current.elementStore)l.current.elementStore[e]=null}})})(n,{getRowKey:O}),{tableFlatData:G,setTableFlatData:Y,filters:X,setFilters:Q,sorter:Z,setSorter:ee,superFilters:te,setSuperFilters:le,pagerFilter:ne,setPagerFilter:ae,pagination:re,setPagination:ie,selectionKeys:oe,setSelectionKeys:se,rowExpandedKeys:de,setRowExpandedKeys:ue,highlightKey:ce,setHighlightKey:fe,updateMark:pe,forceUpdate:me,activedCell:he,setActivedCell:ge,mergedTdCells:ve,setMergedCells:ye,layout:be,setLayout:Ee,permission:Ce,setPermission:we,spinning:Se,setSpinning:Ne,isPingLeft:Te,setPingLeft:Re,isPingRight:ke,setPingRight:Le,isFullScreen:Pe,setFullScreen:_e,updateTableFlatData:De}=(e=>{var t,n,a,r,i,o,s,d,u,c,f;const{uniqueKey:p,initialSorter:m={},initialFilter:h={},paginationConfig:g,rowSelection:v,expandable:y,rowHighlight:b,mergedCells:x}=e,{global:E}=q.default.useContext(xe),C={current:null!==(t=null==g?void 0:g.current)&&void 0!==t?t:bi.pagination.current,pageSize:null!==(o=null!==(a=null!==(n=(()=>{if(p)return Number(localStorage.getItem(`tablePager_${p}`))||void 0})())&&void 0!==n?n:null==g?void 0:g.pageSize)&&void 0!==a?a:null===(i=null===(r=null==E?void 0:E.table)||void 0===r?void 0:r.pagination)||void 0===i?void 0:i.pageSize)&&void 0!==o?o:bi.pagination.pageSize,total:0},w=null!==(d=null!==(s=null==v?void 0:v.selectedRowKeys)&&void 0!==s?s:null==v?void 0:v.defaultSelectedRowKeys)&&void 0!==d?d:[],S=null!==(c=null!==(u=null==y?void 0:y.expandedRowKeys)&&void 0!==u?u:null==y?void 0:y.defaultExpandedRowKeys)&&void 0!==c?c:[],[N,T]=q.default.useState([]),[I,O]=q.default.useReducer(((e,t)=>t.forceUpdate||!l.isEqual(e,t.payload)?t.payload:e),h),[R,k]=q.default.useReducer(((e,t)=>t.forceUpdate||!l.isEqual(e,t.payload)?t.payload:e),m),[L,P]=q.default.useReducer(((e,t)=>l.isEqual(e,t)?e:t),[]),[A,F]=q.default.useReducer(((e,t)=>l.isEqual(e,t)?e:t),{}),[_,D]=q.default.useState(C),[M,H]=q.default.useReducer(((e,t)=>l.isEqual(e,t)?e:t),w),[$,j]=q.default.useReducer(((e,t)=>l.isEqual(e,t)?e:t),S),[K,V]=q.default.useState(null!==(f=null==b?void 0:b.currentRowKey)&&void 0!==f?f:""),[z,W]=q.default.useReducer((e=>e+1),0),[B,U]=q.default.useReducer(((e,t)=>l.isEqual(e,t)?e:t),{}),[G,Y]=yi([],{value:x}),[X,Q]=q.default.useState({gutterWidth:0,tableWidth:0,tableBodyWidth:0,tableBodyHeight:0,viewportHeight:0,headerHeight:0,footerHeight:0,tableAutoHeight:0,tableFullHeight:0}),[Z,J]=q.default.useState({export:!0,import:!0,print:!0}),[ee,te]=q.default.useState(!1),[le,ne]=q.default.useState(!1),[ae,re]=q.default.useState(!1),[ie,oe]=q.default.useState(!1);return{tableFlatData:N,setTableFlatData:T,filters:I,setFilters:O,sorter:R,setSorter:k,superFilters:L,setSuperFilters:P,pagerFilter:A,setPagerFilter:F,pagination:_,setPagination:D,selectionKeys:M,setSelectionKeys:H,rowExpandedKeys:$,setRowExpandedKeys:j,highlightKey:K,setHighlightKey:V,updateMark:z,forceUpdate:W,activedCell:B,setActivedCell:U,mergedTdCells:G,setMergedCells:Y,layout:X,permission:Z,setPermission:J,setLayout:Q,spinning:ee,setSpinning:te,isPingLeft:le,setPingLeft:ne,isPingRight:ae,setPingRight:re,isFullScreen:ie,setFullScreen:oe,updateTableFlatData:()=>T([...N])}})(n),{isFetch:Me,isWebPagination:He,isScrollPagination:qe,showPagination:$e,tableColumns:Ke,flattenColumns:Ve,editableColumns:ze,summationColumns:We,leftFixedColumns:Be,rightFixedColumns:Ue,tableRowHeight:Ge,derivedMergeCells:Ye,treeExpandIndex:Xe,showSummary:Qe,showFooter:Ze,isHeadGroup:Je,bordered:et,isHeadSorter:lt,isHeadFilter:nt,isServiceSummation:at,isSelectCollection:rt,isTableImport:it,isTableClipboard:ot,isSuperSearch:ut,isFastSearch:ct,isPivotGrid:pt,isGroupSummary:mt,isGroupSubtotal:ht,isTableEmpty:vt,summationRows:yt,fetchParams:bt}=Ei(n,{getRowKey:O,tableRef:R,$size:E,tableFullData:k,tableFlatData:G,updateMark:pe,sorter:Z,filters:X,superFilters:te,selectionKeys:oe,pagination:re,mergedTdCells:ve}),{createElementStore:xt,tableStyles:Et,getSpan:Ct,getStickyLeft:wt,getStickyRight:St,scrollXToColumn:Nt,scrollYToRecord:Tt,calcTableHeight:It,resetTableScroll:Ot,createTableFocus:Rt,doLayout:kt}=wi(n,{getRowKey:O,tableRef:R,topElementRef:C,tableElementRef:w,tableBodyRef:S,$size:E,tableColumns:Ke,flattenColumns:Ve,leftFixedColumns:Be,derivedMergeCells:Ye,tableFlatData:G,selectionKeys:oe,highlightKey:ce,tableRowHeight:Ge,layout:be,showFooter:Ze,showPagination:$e,isFullScreen:Pe,setLayout:Ee,setElementStore:L}),{initialTable:Lt,checkDataIndex:Pt,createTableFullData:At,createWebPageData:Ft,getTableData:_t,createTableData:Dt,createGroupData:Mt,createAllExpandedKeys:Ht,setSelectionKeysEffect:qt,doFieldValidate:$t,getTableLog:jt,dataChange:Kt,tableChange:Vt,toLastPage:zt,toFirstPage:Wt,getPageCount:Bt,pagerChangeHandle:Ut,scrollBottomDebouncer:Gt,clearTableSorter:Yt,clearTableFilter:Xt,clearSuperFilters:Qt,clearPagerFilter:Zt,clearActivedCell:Jt,clearRowSelection:el,clearRowHighlight:tl,clearTableLog:ll,destroy:nl}=Ci(n,{getRowKey:O,tableRef:R,tableElementRef:w,$size:E,tableColumns:Ke,flattenColumns:Ve,tableFullData:k,pagination:re,layout:be,filters:X,sorter:Z,superFilters:te,pagerFilter:ne,fetchParams:bt,selectionKeys:oe,rowExpandedKeys:de,highlightKey:ce,summationColumns:We,isFetch:Me,isWebPagination:He,isScrollPagination:qe,isServiceSummation:at,isGroupSubtotal:ht,doLayout:kt,setTableFlatData:Y,setTableFullData:A,setTableOriginData:F,setTableDataMaps:_,setPagination:ie,setPingRight:Le,setPingLeft:Re,setSpinning:Ne,setSorter:ee,setFilters:Q,setSuperFilters:le,setPagerFilter:ae,setActivedCell:ge,setSelectionKeys:se,setRowExpandedKeys:ue,setHighlightKey:fe,setSelectionRows:W,setScrollXLoad:$,setScrollYLoad:j,setFieldAuth:M,setResizeState:K,setSummaries:z,setPermission:we,resetTableScroll:Ot,createTableFocus:Rt,clearElementStore:U});((e,t)=>{const{columns:n,summation:a,rowSelection:r,expandable:i,rowHighlight:o}=e,{tableRef:s,tableBodyRef:d,$size:u,pagination:c,selectionKeys:f,rowExpandedKeys:p,highlightKey:m,summationRows:h,showSummary:g,isWebPagination:v,isScrollPagination:y,checkDataIndex:b,toLastPage:x,toFirstPage:E,getPageCount:C,setHandleState:w,scrollYToRecord:S,setSelectionKeysEffect:N,setOriginColumns:T,setRowExpandedKeys:I,setHighlightKey:O,setResizeState:R,setUnMounted:k,calcTableHeight:L,initialTable:P,destroy:A}=t,F=q.default.useRef(h);Yl((()=>{if(!r)return;const{onChange:e}=r;"radio"===r.type&&d.current.setClickedValues(f.length?[f[0],""]:[]),Ia(f)||null==e||e(f,s.current.selectionRows),Oa(f)}),[f]),Yl((()=>{if(!i)return;const{onChange:e}=i;Ia(p)||null==e||e(p,p.map((e=>s.current.recordsMap.get(e)))),Oa(p)}),[p]),Yl((()=>{var e,t;o&&(d.current.setClickedValues(m?[m,""]:[]),null===(e=o.onChange)||void 0===e||e.call(o,m,null!==(t=s.current.recordsMap.get(m))&&void 0!==t?t:null))}),[m]),Yl((()=>{var e;l.isEqual(h,F.current)||(F.current=h,g&&a&&(null===(e=a.onChange)||void 0===e||e.call(a,h)))}),[h]),Yl((()=>{const e=r.selectedRowKeys||[];l.isEqual(e,f)||N(Ta(e))}),[null==r?void 0:r.selectedRowKeys]),Yl((()=>{const e=i.expandedRowKeys||[];l.isEqual(e,p)||I(Ta(e))}),[null==i?void 0:i.expandedRowKeys]),Yl((()=>{const{currentRowKey:e}=o;e!==m&&O(null!=e?e:"")}),[null==o?void 0:o.currentRowKey]),Yl((()=>{const{insert:e,remove:t}=s.current.handleState;e&&(v&&("after"===e?x():E()),S("","after"===e?1e5:0)),t&&c.current>C()&&x(),(e||t)&&w({insert:null,remove:!1})}),[c.total]),Yl((()=>{L()}),[u]),Yl((()=>{(s.current.scrollYLoad||y)&&(e.height||e.maxHeight||ft("Table","必须设置组件参数 `height` 或 `maxHeight`"))}),[s.current.scrollYLoad,y]),Si({handler:()=>{const{resizeState:e}=s.current,{winHeight:t}=e,l=window.innerHeight;l!==t&&(R(Object.assign({},e,{winHeight:l})),L())},delay:16}),q.default.useLayoutEffect((()=>(T(ha(n)),P(),b(),Fe((()=>L())),()=>{A(),k(!0)})),[])})(n,{tableRef:R,tableBodyRef:S,$size:E,pagination:re,selectionKeys:oe,rowExpandedKeys:de,highlightKey:ce,showSummary:Qe,summationRows:yt,isWebPagination:He,isScrollPagination:qe,checkDataIndex:Pt,toLastPage:zt,toFirstPage:Wt,getPageCount:Bt,setHandleState:V,scrollYToRecord:Tt,setOriginColumns:P,setSelectionKeysEffect:qt,setRowExpandedKeys:ue,setHighlightKey:fe,setResizeState:K,setUnMounted:B,calcTableHeight:It,initialTable:Lt,destroy:nl});const al=q.default.useMemo((()=>({getRowKey:O,tableRef:R,tableBodyRef:S,prefixCls:I,$size:E,tableFlatData:G,flattenColumns:Ve,editableColumns:ze,leftFixedColumns:Be,rightFixedColumns:Ue,treeExpandIndex:Xe,sorter:Z,filters:X,superFilters:te,pagerFilter:ne,layout:be,bordered:et,showFooter:Ze,showSummary:Qe,summationRows:yt,tableRowHeight:Ge,pagination:re,fetchParams:bt,selectionKeys:oe,rowExpandedKeys:de,highlightKey:ce,activedCell:he,mergedTdCells:ve,derivedMergeCells:Ye,updateMark:pe,isFetch:Me,isPingLeft:Te,isPingRight:ke,isHeadSorter:lt,isHeadFilter:nt,isFullScreen:Pe,isTableEmpty:vt,isHeadGroup:Je,isGroupSubtotal:ht,isWebPagination:He,dataChange:Kt,tableChange:Vt,getTableData:_t,setElementStore:L,createTableFullData:At,createWebPageData:Ft,createGroupData:Mt,createAllExpandedKeys:Ht,updateTableFlatData:De,setSorter:ee,setFilters:Q,setSuperFilters:le,setPagerFilter:ae,setHighlightKey:fe,setRowExpandedKeys:ue,setSelectionRows:W,setSelectionKeysEffect:qt,setInvalidRowKeys:D,setActivedCell:ge,setMergedCells:ye,getSpan:Ct,getStickyLeft:wt,getStickyRight:St,scrollXToColumn:Nt,scrollYToRecord:Tt,setPagination:ie,setPingLeft:Re,setPingRight:Le,setSpinning:Ne,setFullScreen:_e,doFieldValidate:$t,createTableData:Dt,scrollBottomDebouncer:Gt,resetTableScroll:Ot,clearTableSorter:Yt,clearTableFilter:Xt,clearSuperFilters:Qt,clearPagerFilter:Zt,clearActivedCell:Jt,clearRowSelection:el,clearRowHighlight:tl})),[E,G,Ve,Z,X,te,ne,be,et,Ze,Qe,yt,Ge,re,bt,oe,de,ce,he,Ye,pe,Me,Te,ke,lt,nt,Pe,vt,Je,ht,He]);((e,t)=>{const{getRowKey:n,tableRef:a,toolBoxRef:r,tableBodyRef:i,columnFilterRef:o,flattenColumns:s,editableColumns:d,pagination:u,fetchParams:c,selectionKeys:f,rowExpandedKeys:p,highlightKey:m,isFetch:h,dataChange:g,getTableData:v,createTableData:y,calcTableHeight:b,scrollXToColumn:x,scrollYToRecord:E,doFieldValidate:C,setHandleState:w,setColumnsDefined:S,setSelectionKeysEffect:N,setRowExpandedKeys:T,setHighlightKey:I,setSelectionRows:O,setOriginColumns:R,forceUpdate:k,getTableLog:L,clearRowSelection:P,clearRowHighlight:A,clearTableSorter:F,clearTableFilter:_,clearSuperFilters:D,clearPagerFilter:M,clearActivedCell:H,clearTableLog:$}=t,{columns:j,columnsChange:K}=a.current.props,V=(e,t,l,a=0)=>e.filter((e=>{const r=n(e,e.index);e.children&&(e.children=V(e.children,t,l,a+1));const i=t.includes(r);return i&&l(e,r,a),!i}));q.default.useImperativeHandle(e,(()=>({CALCULATE_HEIGHT:()=>{b()},DO_REFRESH:e=>Ie(void 0,void 0,void 0,(function*(){h&&(yield Ae(0),yield v(),null==e||e())})),GET_LOG:()=>L(),GET_FETCH_PARAMS:()=>{const e={};for(const t in c)Object.keys(u).includes(t)||(e[t]=c[t]);return e},CLEAR_TABLE_DATA:()=>{h||(_(),D(),M(),F(),H(),P(),A(),$(),y([]))},CLEAR_LOG:()=>{$(),k()},CREATE_FOCUS:(e,t)=>{i.current.createFocus(e,t)},FORCE_UPDATE:()=>{k()},DO_EXPORT:()=>{r.current.exportHandle()},SCROLL_TO_RECORD:e=>{E(e)},SCROLL_TO_COLUMN:e=>{x(e)},SET_SELECTION:(e,t)=>{N(t?Ta([...e]):e)},SET_EXPANDABLE:(e,t)=>{T(t?Ta([...e]):e)},SET_HIGHLIGHT:e=>{I(e)},SET_SELECTION_ROWS:e=>{O(e)},SET_TABLE_DATA:e=>{y(e)},DEFINE_INITIAL_COLUMNS:e=>{R(ha(e)),S(!0),o.current.initialHandler(e)},SET_TABLE_COLUMN:(e,t,n)=>{const a=ya(j,e);if(!a)return ft("Table","SET_TABLE_COLUMN 方法参数 `dataIndex` 的值不正确");if(!l.isPlainObject(t))return ft("Table","SET_TABLE_COLUMN 方法参数 `option` 的值不正确");if(a.noAuth)return ft("Table","SET_TABLE_COLUMN 方法不能操作受权限控制的列");for(const e in t)e&&l.set(a,e,t[e]);n&&(K?K([...j]):ft("Table","需要设置 `columnsChange` 参数"),k())},INSERT_RECORDS:(e,t)=>{const{store:r,tableFullData:i,tableOriginData:o}=a.current,d=(Array.isArray(e)?e:[e]).filter((e=>l.isPlainObject(e)));if(!d.length)return;d.forEach((e=>{s.forEach((t=>{const{dataIndex:l}=t;[bi.expandableColumn,bi.selectionColumn,bi.operationColumn].includes(l)||Aa(e,l,Pa(e,l))})),r.addToInserted(e)}));const u="before"===(null==t?void 0:t.mode),c=void 0===(null==t?void 0:t.parentRowKey),f=[...i];if(c)u?f.unshift(...d):f.push(...d),u?o.unshift(...d):o.push(...d);else{const e=Ba(f,(e=>t.parentRowKey===n(e,e.index)));if(e){const l=Ba(o,(e=>t.parentRowKey===n(e,e.index))),a=Qa(e,l);Array.isArray(e.children)?(u?e.children.unshift(...d):e.children.push(...d),!a&&l&&(u?l.children.unshift(...d):l.children.push(...d))):(e.children=d,!a&&l&&(l.children=d))}}c&&w(Object.assign({},a.current.handleState,{insert:u?"before":"after"})),y(o,(()=>f)),g()},REMOVE_RECORDS:e=>{const{store:t,tableFullData:r,tableOriginData:i}=a.current,o=(Array.isArray(e)?e:[e]).map((e=>l.isPlainObject(e)?n(e,e.index):e));if(!o.length)return;let s=!1;const u=V([...r],o,((e,l,a)=>{if(t.addToRemoved(e),d.forEach((n=>{const{dataIndex:a,editRender:r}=n,i=null==r?void 0:r(e,n);if(!i)return;const{rules:o=[],disabled:s}=i;!s&&o.length&&(t.removeFromRequired({x:l,y:a}),t.removeFromValidate({x:l,y:a}),t.removeFromEdited({x:l,y:a}))})),a<=0){const e=i.findIndex((e=>n(e,e.index)===l));i.splice(e,1)}else if(!Qa(e,Ba(i,(e=>n(e,e.index)===l)))){const t=Ba(i,(t=>n(t,t.index)===e._parentRowKey));t&&(t.children=t.children.filter((e=>n(e,e.index)!==l)))}s=!0}));s&&(w(Object.assign({},a.current.handleState,{remove:!0})),N(f.filter((e=>!o.includes(e)))),o.includes(m)&&A(),T(p.filter((e=>!o.includes(e)))),y(i,(()=>u)),g())},VALIDATE_FIELDS:(e,t)=>{Array.from(a.current.recordsMap.values()).forEach((l=>{d.forEach((a=>{const{dataIndex:r,title:i,editRender:o}=a,s=null==o?void 0:o(l,a);if(!s)return;const d=n(l,l.index);if(e&&!e.includes(d))return;if(t&&!t.includes(r))return;const{rules:u=[],disabled:c}=s;c||C(u,Pa(l,r),d,r,ja(i))}))}));const{required:l,validate:r}=L(),i=[...l,...r];return i.length&&E(i[0].rowKey),k(),{required:l,validate:r}}})))})(t,{getRowKey:O,tableRef:R,toolBoxRef:N,tableBodyRef:S,columnFilterRef:T,flattenColumns:Ve,editableColumns:ze,pagination:re,fetchParams:bt,selectionKeys:oe,rowExpandedKeys:de,highlightKey:ce,isFetch:Me,dataChange:Kt,getTableData:_t,createTableData:Dt,calcTableHeight:It,scrollXToColumn:Nt,scrollYToRecord:Tt,doFieldValidate:$t,setHandleState:V,setColumnsDefined:H,setSelectionKeysEffect:qt,setRowExpandedKeys:ue,setHighlightKey:fe,setSelectionRows:W,setOriginColumns:P,forceUpdate:me,getTableLog:jt,clearRowSelection:el,clearRowHighlight:tl,clearTableSorter:Yt,clearTableFilter:Xt,clearSuperFilters:Qt,clearPagerFilter:Zt,clearActivedCell:Jt,clearTableLog:ll}),q.default.useLayoutEffect((()=>{xt(),R.current.tableManager.register(R.current.uid,null!=t?t:{current:null})}),[]);const rl={[`${I}--wrapper`]:!0,[`${I}--lg`]:"large"===E,[`${I}--sm`]:"small"===E,[`${I}--maximize`]:Pe,[s]:!!s},il={[I]:!0,"is--border":et,"is--fixed":Be.length||Ue.length,"is--sortable":lt,"is--filterable":nt,"is--head-group":Je,"is--area-select":!!d,"is--ping-left":Te,"is--ping-right":ke};return q.default.createElement(ei.Provider,{value:al},q.default.createElement("div",{className:J.default(rl,b),style:x},m&&q.default.createElement("div",{ref:C,className:`${I}-top`},q.default.createElement("div",{className:`${I}-top__space`},"bottom"!==(null==f?void 0:f.position)&&q.default.createElement(Ni,{total:re.total}),q.default.createElement("div",{className:`${I}-top__space-slot`,style:{justifyContent:ui[p]}},n.children)),q.default.createElement("div",{className:`${I}-top__actions`},q.default.createElement(su,{ref:N,showFullScreen:h,showReload:g&&Me,showPrint:Ce.print&&!!u,showImport:Ce.import&&it,showExport:Ce.export&&!!c,showClipboard:ot,showCollection:rt,showFastSearch:ct,showSuperSearch:ut,showPivotGrid:pt,showGroupSummary:mt,showToolBox:v,tableColumns:Ke}),q.default.createElement(uu,{ref:T,columns:r}))),q.default.createElement(mn,{spinning:null!=i?i:Se},q.default.createElement("div",{ref:w,className:J.default(il),style:Et},q.default.createElement("div",{className:`${I}--main-wrapper`},y&&q.default.createElement(qu,{tableColumns:Ke}),q.default.createElement(vc,{ref:S}),Ze&&q.default.createElement(yc,null)),et&&q.default.createElement("div",{className:`${I}--border-line`}),vt&&q.default.createElement(Ec,null),o&&q.default.createElement(Cc,null))),$e&&q.default.createElement(xc,tt({},re,{onChange:(e,t)=>Ut({current:e,pageSize:t})}))))}));wc.displayName="QmTable";const Sc=e=>{var t;const{uniqueKey:n,multiple:a,initialValue:r,selectionRows:i,defaultSelectedKeys:o=[],filters:s=[],table:d={},className:u,style:c,onClose:f}=e,{$size:p}=dt(e),{t:m}=ot(),h=q.default.useRef(null),g=q.default.useRef(null),v=q.default.useRef(null),y=xn(h),[b,x]=q.default.useState(d),[E,C]=q.default.useState(),[w,S]=q.default.useState(o),[N,T]=q.default.useState(!1),[I,O]=q.default.useState(300),[R,k]=q.default.useState(s),[L,P]=q.default.useState((e=>[{title:m("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>q.default.createElement("span",null,e+1)},...e||(d.columns||[])])()),[A,F]=q.default.useState(l.merge({},null===(t=d.fetch)||void 0===t?void 0:t.params,r)),[_,D]=q.default.useState([]),M=()=>{const e=h.current,t=e.querySelector(".form-wrap");O(e.offsetHeight-t.offsetHeight-2*Jr[p]-30)},H=wn(M,5);Cn((()=>{H()}),[y.width]),Yl((()=>{l.isEqual(s,R)||k(s)}),[s]),q.default.useEffect((()=>{$()}),[A]),q.default.useEffect((()=>{i&&v.current.SET_SELECTION_ROWS(i)}),[i]),q.default.useEffect((()=>{var e;r&&(null===(e=g.current)||void 0===e||e.SET_FIELDS_VALUE(r))}),[]);const $=()=>Ie(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=b;if(!t||!(null==n?void 0:n.api))return;const{api:r,dataKey:i,beforeFetch:o=Pe,afterFetch:s}=n;if(o(A)){T(!0);try{const t=yield r(A);if(200===t.code){let n=Array.isArray(t.data)?t.data:null!==(e=l.get(t.data,i))&&void 0!==e?e:[];n="function"==typeof s?yield s(n):n,a||(S([]),yield Ae(0)),D(n)}}catch(e){}T(!1)}})),j=e=>{a||(C(e),f(e))},K=e=>{F(Object.assign({},A,e))},V={[`${gt("search-helper")}--wrapper`]:!0},z=b.webPagination?{dataSource:_,loading:N,webPagination:!0}:{fetch:Object.assign(Object.assign({},b.fetch),{params:A})};return q.default.createElement("div",{ref:h,className:J.default(V,u),style:c},q.default.createElement("div",{className:"form-wrap"},R.length?q.default.createElement(ap,{ref:g,items:R,uniqueKey:n,formType:"search",isAutoFocus:!1,fieldsChange:e=>k(e),onCollapse:()=>M(),onFinish:e=>K(e),onReset:()=>Ie(void 0,void 0,void 0,(function*(){const[e,t]=yield g.current.GET_FORM_DATA();e||K(t)}))}):null),q.default.createElement("div",null,q.default.createElement(wc,tt({ref:v,uniqueKey:n,height:I,columns:L,rowKey:b.rowKey||"pageIndex"},z,{rowSelection:{type:a?"checkbox":"radio",clearableAfterFetched:!a,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:w,onChange:(e,t)=>{S(e),C(a?t:t[0])}},topSpaceAlign:"left",paginationConfig:b.paginationConfig,columnsChange:e=>P(e),onRowDblclick:j,onRowEnter:j}),b.topBarExtra)),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Jr[p]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},q.default.createElement(pt,{onClick:()=>f(null),style:{marginRight:8}},m("qm.dialog.cancel")),q.default.createElement(pt,{type:"primary",disabled:!E,onClick:()=>f(E,a?w:void 0)},m("qm.dialog.confirm"))))};Sc.displayName="QmSearchHelper";const{Search:Nc}=d.Input;class Tc extends e.Component{constructor(e){super(e),this._is_change=!1,this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=oe.default((e=>Object.assign({},this.props.helperConfig,e))),this.echoSearchHelper=()=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const e=this.getItemValue();e!==this._prevValue&&(this.getItemText(),this._prevValue=e)})),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.initialHandle=()=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e}=this.props.option,{fieldAliasMap:t,fieldsDefine:l,echoRequest:n}=this.searchHelper;if(t||ft("Form","SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),l){const e=["valueKey","displayKey","extraKey"];for(const t in l)e.includes(t)&&(this[t]=l[t])}Object.keys(this.alias).includes(e)||ft("Form","SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),n&&!this.valueKey&&ft("Form","SEARCH_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),this.getItemValue=()=>this.context.$$form.GET_FIELDS_VALUE([this.valueKey])[this.valueKey],this.getDerivedSearchHelper=()=>this.searchHelper,this.getItemText=()=>Ie(this,void 0,void 0,(function*(){var e;const{fetchApi:t,params:n={},formatter:a=(e=>e),dataKey:r,callback:i,triggeredChange:o,fieldAliasMap:s,extraAliasMap:d}=this.searchHelper.echoRequest||{},u="function"==typeof s?s():s||{},c="function"==typeof d?d():d||{},f=this.getItemValue();if(t&&!De(f)){this.setState({loading:!0});try{const s=yield t(a(Object.assign(Object.assign({},n),{key:f})));if(200===s.code){const t=Array.isArray(s.data)?s.data:null!==(e=l.get(s.data,r))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(u&&vr(e,this.alias,u),c&&yr(e,this.extras,c),this._record=e,this.setFieldsValue(e),o){const t=gr(e,this.alias[this.props.option.fieldName]);this.triggerChange(t),this.searchHelperChangeHandle(t)}null==i||i([e])}}}catch(e){}this.setState({loading:!1})}})),this.todoOpen=e=>{const{autoQueryAssign:t=!0}=this.searchHelper;t&&(this.deriveParams=this.createFilters(e)),this.setVisible(!0)},this.createFilters=e=>{const{fieldName:t}=this.props.option,{filterAliasMap:n}=this.searchHelper,a=""!==e?e:void 0,r=("function"==typeof n?n():n)||[],i={[t]:a};return(Array.isArray(r)?r:[r]).forEach((e=>{if(l.isPlainObject(e))for(const t in e)i[t]="function"==typeof e[t]?e[t](a):a;else i[e]=a})),i},this.getSearchHelperTableData=e=>{const{table:t,initialValue:n={}}=this.searchHelper,{beforeFetch:a=Pe,formatter:r=(e=>e)}=t.fetch;return new Promise(((i,o)=>Ie(this,void 0,void 0,(function*(){var s;const d=l.merge({},this.searchHelper.table.fetch.params,Object.assign(Object.assign({},n),r(this.createFilters(e))),{currentPage:1,pageSize:500});if(!a(d))return o();this.setState({loading:!0});try{const e=yield t.fetch.api(d);if(200===e.code){const n=Array.isArray(e.data)?e.data:null!==(s=l.get(e.data,t.fetch.dataKey))&&void 0!==s?s:[];i(n)}else o()}catch(e){o(e)}finally{Fe((()=>this.setState({loading:!1})))}}))))},this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;for(const n in this.alias){const a=gr(e,this.alias[n]);void 0!==a&&(t.SET_FIELDS_VALUE({[n]:a}),n===this.valueKey&&(this._prevValue=a),n===l&&t.setViewValue(l,a))}for(const l in this.extras){const n=gr(e,this.extras[l]);void 0!==n&&t.SET_FIELDS_EXTRA({[l]:n})}},this.resetSearchHelperValue=(e=[],t)=>Ie(this,void 0,void 0,(function*(){const{fieldName:l}=this.props.option,n=e.filter((e=>{var n;return null===(n=gr(e,this.alias[l]))||void 0===n?void 0:n.toString().toLowerCase().includes(t.toLowerCase())}));if(1===n.length)return this.closeSearchHelper(n[0]);this.openSearchHelper(t)})),this.openSearchHelper=(e,t)=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:l}=this.context,{beforeOpen:n}=this.searchHelper,a=(null!=n?n:Pe)(l.state.formData);(null==a?void 0:a.then)?a.then((()=>{this.todoOpen(e),null==t||t()})).catch((()=>{})):!1!==a&&(this.todoOpen(e),null==t||t())})),this.closeSearchHelper=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;this._record=e;for(const n in this.alias){if(n===l)continue;const a=gr(e,this.alias[n]);t.SET_FIELDS_VALUE({[n]:a}),n===this.valueKey&&(this._prevValue=a)}for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:gr(e,this.extras[l])});const n=gr(e,this.alias[l]);this.triggerChange(n),this.searchHelperChangeHandle(n);const{closed:a}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==a?void 0:a(e)),200)}))},this.closeButNotSelect=()=>{const{onlySelect:e=!0}=this.searchHelper;this._is_change&&(e?this.clearSearchHelperValue():this.searchHelperChangeHandle(this.props.value)),this._is_change=!1,this.setVisible(!1)},this.clearSearchHelperValue=()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;if(this.triggerChange(""),null!==this._record){for(const l in this.alias)l!==t&&(e.SET_FIELDS_VALUE({[l]:void 0}),l===this.valueKey&&(this._prevValue=null));for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.searchHelperChangeHandle("")}},this.searchHelperChangeHandle=e=>{const{onChange:t}=this.props.option;this.deriveParams={},this._is_change=!1,null==t||t(e,this._record)},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(e)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.focus=()=>{const{type:e}=this.props.option;this[`${e}_Ref`].focus({cursor:"end"})},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidUpdate(){this.echoSearchHelper()}render(){var e;const{$$form:t}=this.context,{visible:l,loading:n}=this.state,{value:a}=this.props,{type:r,fieldName:i,options:o={},searchHelper:s={},style:d={},placeholder:u=Se("qm.form.inputPlaceholder"),bordered:c=!0,allowClear:f=!0,translate:p,readOnly:m,disabled:h}=this.props.option,{prefix:g,suffix:v,maxLength:y}=o,b={visible:l,title:Se("qm.searchHelper.text"),width:null!==(e=s.width)&&void 0!==e?e:"60%",wrapClassName:`form-popper__${i}`,loading:!1,bodyStyle:{paddingBottom:`${Jr[t.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},x=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:t.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${i}`:"",initialValue:Object.assign({},this.deriveParams,s.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}}),E=t.isOnlyShow?q.default.createElement(Mr,{value:a,bordered:c}):q.default.createElement(q.default.Fragment,null,q.default.createElement(Nc,{ref:e=>this[`${r}_Ref`]=e,value:a,title:a,loading:n,placeholder:u,style:d,prefix:g,suffix:v,maxLength:y,bordered:c,allowClear:f,readOnly:m,disabled:h,onBlur:e=>{var t;const{value:n}=e.target,{onlySelect:a=!0,table:r}=this.searchHelper;this.triggerBlur(n),this._is_change&&!l&&(n?a?(null===(t=null==r?void 0:r.fetch)||void 0===t?void 0:t.api)&&this.getSearchHelperTableData(n).then((e=>this.resetSearchHelperValue(e,n))).catch((()=>this.clearSearchHelperValue())):this.searchHelperChangeHandle(n):this.clearSearchHelperValue())},onKeyDown:e=>{if(13===e.keyCode){e.preventDefault();const{value:t}=e.target;!l&&this.openSearchHelper(t)}},onDoubleClick:e=>{const{value:t}=e.target;this.openSearchHelper(t)},onChange:e=>{const{value:t}=e.target;this.triggerChange(t),this._is_change=!0},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper(e):Fe((()=>this.clearSearchHelperValue())))}}),q.default.createElement(Qn,b,q.default.createElement(Sc,x)));return p?q.default.createElement(Hr,{text:a},E):E}}Tc.contextType=Zn;class Ic extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ie(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){ct("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return ft("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ie(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=wr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:u,extra:c,buttonAfter:f,validateTrigger:p,rules:m=[]}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":$e(s)},required:e.getFormItemRequired(m)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:r,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(Tc,{ref:e=>this.searchRef=e,option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t="")=>{e.setViewValue(r,t)}}))),f&&q.default.createElement(d.Col,null,e.renderFormItemButton(r,f)),c&&q.default.createElement(d.Col,{flex:$e(c.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}Ic.contextType=Zn;const Oc=t=>{class l extends e.Component{constructor(){super(...arguments),this.event1=null,this.event2=null,this.$el=null,this.omitClassNames=[],this.state={clickOutside:!1},this.mousedownHandler=e=>{this.startClick=e},this.mouseupHandler=e=>{this.documentHandler(e,this.startClick)},this.documentHandler=(e,t)=>{var l,n;const a=e.target,r=null==t?void 0:t.target,i=!a||!r,o=(null===(l=this.$el)||void 0===l?void 0:l.contains(a))||(null===(n=this.$el)||void 0===n?void 0:n.contains(r)),s=this.$el===a,d=this.omitClassNames.map((e=>Array.from(document.querySelectorAll(e)))).flat(),u=d.some((e=>null==e?void 0:e.contains(a)))||d.includes(r);let c;c=!(i||o||s||u),this.setState({clickOutside:c})},this.setCurrentElement=e=>{e&&(this.$el=e)},this.setOmitClassNames=(e=[])=>{this.omitClassNames=e}}componentDidMount(){this.event1=ae.default(document,"mousedown",this.mousedownHandler),this.event2=ae.default(document,"mouseup",this.mouseupHandler)}componentWillUnmount(){var e,t;null===(e=this.event1)||void 0===e||e.remove(),null===(t=this.event2)||void 0===t||t.remove()}render(){const{forwardedRef:e}=this.props,{clickOutside:l}=this.state;return q.default.createElement(t,tt({ref:e},this.props,{clickOutside:l,setCurrentElement:this.setCurrentElement,setOmitClassNames:this.setOmitClassNames}))}}return l.displayName=`OutsideClick(${t.displayName||t.name})`,q.default.forwardRef(((e,t)=>q.default.createElement(l,tt({},e,{forwardedRef:t}))))};let Rc=class extends e.Component{constructor(e){super(e),this.searchRef=q.default.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=oe.default((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||ft("Form","MULTIPLE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||ft("Form","MULTIPLE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setItemList=e=>{this.setState({itemList:e})},this.setRecords=e=>{this._records=e},this.recordsToDict=()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))),this.setViewValue=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;t.setViewValue(l,this.createViewText(e))},this.openSearchHelper=e=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:l}=this.searchHelper,n=(null!=l?l:Pe)(t.state.formData);(null==n?void 0:n.then)?n.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=(e,t=[])=>{const{valueKey:n}=this.alias;this.setRecords(l.uniqBy([...this._records.filter((e=>t.includes(e[n]))),...e],n));const a=this.recordsToDict();this.setItemList(a),this.triggerChange(a.map((e=>e.value)));const{closed:r}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==r?void 0:r(this._records)),200)}))},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props,{valueKey:n}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[n])))),null==t||t(e),l(e,this.createViewText(e),this._records)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e,t){const{value:n=[]}=e,{value:a=[],clickOutside:r}=this.props;l.isEqual(n,a)||l.isEqual(a,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),r&&t.visible2&&this.setState({visible2:!1})}getItemList(){var e,t;return Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:n,valueKey:a}=this.alias,{fetchApi:r,params:i={},formatter:o=(e=>e),dataKey:s,callback:d,fieldAliasMap:u}=this.searchHelper.echoRequest||(null===(e=this.props.option.searchHelper)||void 0===e?void 0:e.request)||{},c="function"==typeof u?u():u||{},{value:f}=this.props;if(r){if(De(f))return this.setRecords([]);this.setState({loading:!0});try{const e=yield r(o(Object.assign(Object.assign({},i),{keys:f})));if(200===e.code){let r=Array.isArray(e.data)?e.data:null!==(t=l.get(e.data,s))&&void 0!==t?t:[];r.forEach((e=>{(null==c?void 0:c.valueKey)&&c.valueKey!==a&&(e[a]=e[c.valueKey]),(null==c?void 0:c.textKey)&&c.textKey!==n&&(e[n]=e[c.textKey])})),r=r.filter((e=>f.includes(e[a])));const i=r.map((e=>({value:e[a],text:e[n]})));this.setRecords(r),this.setItemList(i),this.setViewValue(f),null==d||d(r)}}catch(e){}this.setState({loading:!1})}}))}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){var e,t,n;const{$$form:a}=this.context,{visible:r,visible2:i,loading:o,itemList:s}=this.state,{value:u}=this.props,{fieldName:c,options:f={},searchHelper:p={},style:m={},placeholder:h=Se("qm.form.selectPlaceholder"),bordered:v=!0,allowClear:y=!0,readOnly:b,disabled:x}=this.props.option,{collapseTags:E,maxTagTextLength:C}=f,w={visible:r,title:Se("qm.searchHelper.text"),width:null!==(e=p.width)&&void 0!==e?e:"60%",wrapClassName:`form-popper__${c}`,loading:!1,bodyStyle:{paddingBottom:`${Jr[a.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},S=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:a.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${c}`:"",initialValue:l.merge({},p.initialValue),defaultSelectedKeys:u,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),N=s.filter((e=>null==u?void 0:u.includes(e.value))),T=q.default.createElement("ul",{className:"ant-dropdown-menu"},N.length?N.map((e=>q.default.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):q.default.createElement("li",{className:"ant-dropdown-menu-item"},Se("qm.table.config.emptyText"))),I=this.searchRef.current?this.searchRef.current.offsetWidth:300,O=gt("form-multiple-search-helper"),{size:R}=a.context,k={[O]:!0,[`${O}--lg`]:"large"===R,[`${O}--sm`]:"small"===R};null===(n=(t=this.props).setOmitClassNames)||void 0===n||n.call(t,[`.${O}`]);const L=s.filter((e=>null==u?void 0:u.includes(e.value))).map((e=>e.text)).join(",");return a.isOnlyShow?q.default.createElement(Mr,{value:L,bordered:v}):q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},q.default.createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},q.default.createElement(xs,{popupVisible:!x&&i,popup:T,popupClassName:J.default(k),popupStyle:{minWidth:I},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:or,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement(d.Select,{mode:"multiple",maxTagCount:E?"responsive":void 0,maxTagTextLength:C,open:!1,value:u,placeholder:h,loading:o,bordered:v,allowClear:y,disabled:x,style:Object.assign({width:"100%"},m),title:L,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{var t,l;const n=e.target;n.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(l=(t=this.props).setCurrentElement)||void 0===l||l.call(t,n),this.setState({visible2:!0}))},onDoubleClick:()=>{x||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},s.map((e=>q.default.createElement(d.Select.Option,{key:e.value,value:e.value},e.text))))),q.default.createElement("span",{className:"ant-input-group-addon"},q.default.createElement(d.Button,{className:"ant-input-search-button",disabled:x,icon:q.default.createElement(g.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),q.default.createElement(Qn,w,q.default.createElement(Sc,S)))}};Rc.contextType=Zn,Rc=Te([Oc],Rc);class kc extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ie(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){ct("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return ft("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ie(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=wr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:u,extra:c,buttonAfter:f,validateTrigger:p,rules:m=[],onChange:h=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":$e(s)},required:e.getFormItemRequired(m)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:r,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(Rc,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,l,n)=>{h(t,n),e.setViewValue(r,l)}}))),f&&q.default.createElement(d.Col,null,e.renderFormItemButton(r,f)),c&&q.default.createElement(d.Col,{flex:$e(c.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}kc.contextType=Zn;const Lc=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...Lc(e.children)),e.children&&t.push(e.value)})),t},Pc=(e,t)=>{let l=null;for(let n=0;n<e.length;n++){if(Array.isArray(e[n].children)&&(l=Pc(e[n].children,t)),l)return l;if(t(e[n]))return e[n]}return l},Ac=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&Ac(e.children,t),t(e)||e.children&&e.children.length))),Fc=e=>{var t;const{uniqueKey:n,multiple:a,initialValue:r,selectionRows:i,defaultSelectedKeys:o=[],filters:s=[],table:u={},tree:c={},className:f,style:p,onClose:m}=e,{$size:h}=dt(e),{t:v}=ot(),y=q.default.useRef(null),b=q.default.useRef(null),x=q.default.useRef(null),E=xn(y),[C,w]=q.default.useState(u),[S,N]=q.default.useState(),[T,I]=q.default.useState(o),[O,R]=q.default.useState(!1),[k,L]=q.default.useState(300),[P,A]=q.default.useState(300),[F,_]=q.default.useState(s),[D,M]=q.default.useState((e=>[{title:v("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>q.default.createElement("span",null,e+1)},...e||(u.columns||[])])()),[H,$]=q.default.useState(l.merge({},null===(t=u.fetch)||void 0===t?void 0:t.params,r)),[j,K]=q.default.useState([]),V=()=>{const e=y.current,t=e.querySelector(".form-wrap"),l=e.querySelector(".input-wrap");L(e.offsetHeight-l.offsetHeight-10),A(e.offsetHeight-t.offsetHeight-2*Jr[h]-30)},z=wn(V,5);Cn((()=>{z()}),[E.width]),Yl((()=>{l.isEqual(s,F)||_(s)}),[s]),q.default.useEffect((()=>{W()}),[H]),q.default.useEffect((()=>{i&&x.current.SET_SELECTION_ROWS(i)}),[i]),q.default.useEffect((()=>{var e;r&&(null===(e=b.current)||void 0===e||e.SET_FIELDS_VALUE(r)),ne()}),[]);const W=()=>Ie(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=C;if(!t||!(null==n?void 0:n.api))return;const{api:r,dataKey:i,beforeFetch:o=Pe}=n;if(o(H)){R(!0);try{const t=yield r(H);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=l.get(t.data,i))&&void 0!==e?e:[];a||(I([]),yield Ae(0)),K(n)}}catch(e){}R(!1)}})),B=e=>{a||(N(e),m(e))},U=e=>{$(Object.assign({},H,e))},[G,Y]=q.default.useState([]),[X,Q]=q.default.useState([]),[Z,ee]=q.default.useState(""),te=q.default.useRef(G),le=q.default.useRef([]);Yl((()=>{Q(Lc(G))}),[G]);const ne=()=>Ie(void 0,void 0,void 0,(function*(){var e;if(!c.fetch)return;const{api:t,params:n,dataKey:a,valueKey:r="value",textKey:i="text"}=c.fetch;try{const o=yield t(n);if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=l.get(o.data,a))&&void 0!==e?e:[],n=br(t,r,i);Y(n),te.current=n,le.current=t}}catch(e){}})),ae=e=>`${e}|${_r.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,re={[`${gt("tree-table-helper")}--wrapper`]:!0},ie=C.webPagination?{dataSource:j,loading:O,webPagination:!0}:{fetch:Object.assign(Object.assign({},C.fetch),{params:H})};return q.default.createElement("div",{ref:y,className:J.default(re,f),style:p},q.default.createElement(cn,{defaultValue:200,style:{height:"100%"}},q.default.createElement(cn.Pane,{min:100,style:{overflowY:"auto"}},q.default.createElement(d.Input,{className:"input-wrap",value:Z,style:{marginBottom:8},placeholder:v("qm.form.inputPlaceholder"),suffix:q.default.createElement(g.SearchOutlined,null),allowClear:!0,onChange:e=>(e=>{const t=Ac(te.current,(t=>{if(!e)return!0;const l=t.text||"";return-1!==ae(l).indexOf(e)}));ee(e),Y(t)})(e.target.value)}),q.default.createElement(d.Tree,{fieldNames:{title:"text",key:"value",children:"children"},height:k,defaultExpandAll:!0,expandedKeys:X,treeData:G,filterTreeNode:e=>{if(!Z)return!1;const t=e.text||"";return-1!==ae(t).indexOf(Z)},onExpand:e=>{Q(e)},onSelect:e=>{const{valueKey:t="value"}=c.fetch;(e=>{if(!c.tableParamsMap)return ft("TreeTableHelper","需要配置 `tree.tableParamsMap` 选项");const t="function"==typeof c.tableParamsMap?c.tableParamsMap():c.tableParamsMap,n={};for(const a in t)n[a]=l.get(e,t[a]);U(n)})(Pc(le.current,(n=>l.get(n,t)===e[0]))||{})}})),q.default.createElement(cn.Pane,{className:"split-pane"},q.default.createElement("div",{className:"form-wrap"},F.length?q.default.createElement(ap,{ref:b,items:F,uniqueKey:n,formType:"search",isAutoFocus:!1,fieldsChange:e=>_(e),onCollapse:()=>V(),onFinish:e=>U(e),onReset:()=>Ie(void 0,void 0,void 0,(function*(){const[e,t]=yield b.current.GET_FORM_DATA();e||U(t)}))}):null),q.default.createElement("div",null,q.default.createElement(wc,tt({ref:x,uniqueKey:n,height:P,columns:D,rowKey:C.rowKey||"pageIndex"},ie,{rowSelection:{type:a?"checkbox":"radio",clearableAfterFetched:!a,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:T,onChange:(e,t)=>{I(e),N(a?t:t[0])}},topSpaceAlign:"left",paginationConfig:C.paginationConfig,columnsChange:e=>M(e),onRowDblclick:B,onRowEnter:B}),C.topBarExtra)))),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Jr[h]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},q.default.createElement(pt,{onClick:()=>m(null),style:{marginRight:8}},v("qm.dialog.cancel")),q.default.createElement(pt,{type:"primary",disabled:!S,onClick:()=>m(S,a?T:void 0)},v("qm.dialog.confirm"))))};Fc.displayName="TreeTableHelper";const{Search:_c}=d.Input;class Dc extends e.Component{constructor(e){super(e),this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=oe.default((e=>Object.assign({},this.props.helperConfig,e))),this.echoSearchHelper=()=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const e=this.getItemValue();e!==this._prevValue&&(this.getItemText(),this._prevValue=e)})),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.initialHandle=()=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e}=this.props.option,{fieldAliasMap:t,fieldsDefine:l,echoRequest:n}=this.searchHelper;if(t||ft("Form","TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),l){const e=["valueKey","displayKey","extraKey"];for(const t in l)e.includes(t)&&(this[t]=l[t])}Object.keys(this.alias).includes(e)||ft("Form","TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),n&&!this.valueKey&&ft("Form","TREE_TABLE_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),this.getItemValue=()=>this.context.$$form.GET_FIELDS_VALUE([this.valueKey])[this.valueKey],this.getDerivedSearchHelper=()=>this.searchHelper,this.getItemText=()=>Ie(this,void 0,void 0,(function*(){var e;const{fetchApi:t,params:n={},formatter:a=(e=>e),dataKey:r,callback:i,triggeredChange:o,fieldAliasMap:s,extraAliasMap:d}=this.searchHelper.echoRequest||{},u="function"==typeof s?s():s||{},c="function"==typeof d?d():d||{},f=this.getItemValue();if(t&&!De(f)){this.setState({loading:!0});try{const s=yield t(a(Object.assign(Object.assign({},n),{key:f})));if(200===s.code){const t=Array.isArray(s.data)?s.data:null!==(e=l.get(s.data,r))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(u&&vr(e,this.alias,u),c&&yr(e,this.extras,c),this._record=e,this.setFieldsValue(e),o){const t=gr(e,this.alias[this.props.option.fieldName]);this.triggerChange(t)}null==i||i([e])}}}catch(e){}this.setState({loading:!1})}})),this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;for(const n in this.alias){const a=gr(e,this.alias[n]);t.SET_FIELDS_VALUE({[n]:a}),n===this.valueKey&&(this._prevValue=a),n===l&&t.setViewValue(l,a)}for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:gr(e,this.extras[l])})},this.openSearchHelper=e=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:l}=this.searchHelper,n=(null!=l?l:Pe)(t.state.formData);(null==n?void 0:n.then)?n.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;this._record=e;for(const n in this.alias){if(n===l)continue;const a=gr(e,this.alias[n]);t.SET_FIELDS_VALUE({[n]:a}),n===this.valueKey&&(this._prevValue=a)}for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:gr(e,this.extras[l])});const n=gr(e,this.alias[l]);this.triggerChange(n);const{closed:a}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==a?void 0:a(e)),200)}))},this.clearSearchHelperValue=()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;for(const l in this.alias)l!==t&&(e.SET_FIELDS_VALUE({[l]:void 0}),l===this.valueKey&&(this._prevValue=null));for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.triggerChange("")},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(e,this._record)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidUpdate(){this.echoSearchHelper()}render(){var e;const{$$form:t}=this.context,{visible:n,loading:a}=this.state,{value:r=""}=this.props,{type:i,fieldName:o,options:s={},searchHelper:d={},style:u={},placeholder:c=Se("qm.form.selectPlaceholder"),bordered:f=!0,allowClear:p=!0,translate:m,readOnly:h,disabled:g}=this.props.option,{prefix:v,suffix:y,maxLength:b}=s,x={visible:n,title:Se("qm.searchHelper.text"),width:null!==(e=d.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${o}`,loading:!1,bodyStyle:{paddingBottom:`${Jr[t.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},E=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:t.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${o}`:"",initialValue:l.merge({},d.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.setVisible(!1)}}),C=t.isOnlyShow?q.default.createElement(Mr,{value:r,bordered:f}):q.default.createElement(q.default.Fragment,null,q.default.createElement(_c,{ref:e=>this[`${i}_Ref`]=e,value:r,title:r,loading:a,placeholder:c,style:u,prefix:v,suffix:y,maxLength:b,bordered:f,allowClear:p,readOnly:h,disabled:g,onBlur:e=>{const{value:t}=e.target;this.triggerBlur(t)},onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onDoubleClick:e=>{this.openSearchHelper()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper():this.clearSearchHelperValue())}}),q.default.createElement(Qn,x,q.default.createElement(Fc,E)));return m?q.default.createElement(Hr,{text:r},C):C}}Dc.contextType=Zn;class Mc extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ie(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){ct("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return ft("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ie(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=wr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:u,extra:c,buttonAfter:f,validateTrigger:p,rules:m=[],onChange:h=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":$e(s)},required:e.getFormItemRequired(m)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:r,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(Dc,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,l)=>{h(t,l),e.setViewValue(r,t)}}))),f&&q.default.createElement(d.Col,null,e.renderFormItemButton(r,f)),c&&q.default.createElement(d.Col,{flex:$e(c.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}Mc.contextType=Zn;let Hc=class extends e.Component{constructor(e){super(e),this.searchRef=q.default.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=oe.default((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||ft("Form","MULTIPLE_TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||ft("Form","MULTIPLE_TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setItemList=e=>{this.setState({itemList:e})},this.setRecords=e=>{this._records=e},this.recordsToDict=()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))),this.setViewValue=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;t.setViewValue(l,this.createViewText(e))},this.openSearchHelper=e=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:l}=this.searchHelper,n=(null!=l?l:Pe)(t.state.formData);(null==n?void 0:n.then)?n.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=(e,t=[])=>{const{valueKey:n}=this.alias;this.setRecords(l.uniqBy([...this._records.filter((e=>t.includes(e[n]))),...e],n));const a=this.recordsToDict();this.setItemList(a),this.triggerChange(a.map((e=>e.value)));const{closed:r}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==r?void 0:r(this._records)),200)}))},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props,{valueKey:n}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[n])))),null==t||t(e),l(e,this.createViewText(e),this._records)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e,t){const{value:n=[]}=e,{value:a=[],clickOutside:r}=this.props;l.isEqual(n,a)||l.isEqual(a,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),r&&t.visible2&&this.setState({visible2:!1})}getItemList(){var e,t;return Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:n,valueKey:a}=this.alias,{fetchApi:r,params:i={},formatter:o=(e=>e),dataKey:s,fieldAliasMap:d}=this.searchHelper.echoRequest||(null===(e=this.props.option.searchHelper)||void 0===e?void 0:e.request)||{},u="function"==typeof d?d():d||{},{value:c}=this.props;if(r){if(De(c))return this.setRecords([]);this.setState({loading:!0});try{const e=yield r(o(Object.assign(Object.assign({},i),{keys:c})));if(200===e.code){let r=Array.isArray(e.data)?e.data:null!==(t=l.get(e.data,s))&&void 0!==t?t:[];r.forEach((e=>{(null==u?void 0:u.valueKey)&&u.valueKey!==a&&(e[a]=e[u.valueKey]),(null==u?void 0:u.textKey)&&u.textKey!==n&&(e[n]=e[u.textKey])})),r=r.filter((e=>c.includes(e[a])));const i=r.map((e=>({value:e[a],text:e[n]})));this.setRecords(r),this.setItemList(i),this.setViewValue(c)}}catch(e){}this.setState({loading:!1})}}))}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){var e,t,n;const{$$form:a}=this.context,{visible:r,visible2:i,loading:o,itemList:s}=this.state,{value:u}=this.props,{fieldName:c,options:f={},searchHelper:p={},style:m={},placeholder:h=Se("qm.form.selectPlaceholder"),bordered:v=!0,allowClear:y=!0,readOnly:b,disabled:x}=this.props.option,{collapseTags:E,maxTagTextLength:C}=f,w={visible:r,title:Se("qm.searchHelper.text"),width:null!==(e=p.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${c}`,loading:!1,bodyStyle:{paddingBottom:`${Jr[a.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},S=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:a.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${c}`:"",initialValue:l.merge({},p.initialValue),defaultSelectedKeys:u,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),N=s.filter((e=>null==u?void 0:u.includes(e.value))),T=q.default.createElement("ul",{className:"ant-dropdown-menu"},N.length?N.map((e=>q.default.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):q.default.createElement("li",{className:"ant-dropdown-menu-item"},Se("qm.table.config.emptyText"))),I=this.searchRef.current?this.searchRef.current.offsetWidth:300,O=gt("form-multiple-tree-table-helper"),{size:R}=a.context,k={[O]:!0,[`${O}--lg`]:"large"===R,[`${O}--sm`]:"small"===R};null===(n=(t=this.props).setOmitClassNames)||void 0===n||n.call(t,[`.${O}`]);const L=s.filter((e=>null==u?void 0:u.includes(e.value))).map((e=>e.text)).join(",");return a.isOnlyShow?q.default.createElement(Mr,{value:L,bordered:v}):q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},q.default.createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},q.default.createElement(xs,{popupVisible:!x&&i,popup:T,popupClassName:J.default(k),popupStyle:{minWidth:I},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:or,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement(d.Select,{mode:"multiple",maxTagCount:E?"responsive":void 0,maxTagTextLength:C,open:!1,value:u,placeholder:h,loading:o,bordered:v,allowClear:y,disabled:x,style:Object.assign({width:"100%"},m),title:L,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{var t,l;const n=e.target;n.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(l=(t=this.props).setCurrentElement)||void 0===l||l.call(t,n),this.setState({visible2:!0}))},onDoubleClick:()=>{x||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},s.map((e=>q.default.createElement(d.Select.Option,{key:e.value,value:e.value},e.text))))),q.default.createElement("span",{className:"ant-input-group-addon"},q.default.createElement(d.Button,{className:"ant-input-search-button",disabled:x,icon:q.default.createElement(g.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),q.default.createElement(Qn,w,q.default.createElement(Fc,S)))}};Hc.contextType=Zn,Hc=Te([Oc],Hc);class qc extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ie(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){ct("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return ft("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ie(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=wr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:u,extra:c,buttonAfter:f,validateTrigger:p,rules:m=[],onChange:h=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":$e(s)},required:e.getFormItemRequired(m)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:r,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(Hc,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,l,n)=>{h(t,n),e.setViewValue(r,l)}}))),f&&q.default.createElement(d.Col,null,e.renderFormItemButton(r,f)),c&&q.default.createElement(d.Col,{flex:$e(c.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}qc.contextType=Zn;const $c="_startSign",jc="_endSign",Kc=e=>{var t;const{uniqueKey:n,initialValue:a,filters:r=[],table:i={},onClose:o}=e,{$size:s}=dt(e),{t:u}=ot(),c=q.default.useRef(null),f=q.default.useRef(null),p=q.default.useRef(null),m=xn(c),[h,v]=q.default.useState(i),[y,b]=q.default.useState(!1),[x,E]=q.default.useState([]),[C,w]=q.default.useState(300),[S,N]=q.default.useState(r),[T,I]=q.default.useState((e=>[{title:u("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>q.default.createElement("span",null,e+1)},{title:u("qm.form.rangeSearchHelper")[0],dataIndex:$c,width:80,align:"right",render:(e,t)=>q.default.createElement("span",{className:"icon-sign"},e)},...e||(i.columns||[]),{title:u("qm.form.rangeSearchHelper")[1],dataIndex:jc,fixed:"right",width:80,render:(e,t)=>q.default.createElement("span",{className:"icon-sign"},e)}])()),[O,R]=q.default.useState(l.merge({},null===(t=i.fetch)||void 0===t?void 0:t.params,a)),[k,L]=q.default.useState([]),P=q.default.useMemo((()=>x.map((e=>null==e?void 0:e.pageIndex))),[x]),A=q.default.useMemo((()=>2===P.length&&P.every((e=>void 0!==e))),[P]),F=()=>{const e=c.current.parentNode.children[0],t=e.querySelector(".form-wrap");w(e.offsetHeight-t.offsetHeight-2*Jr[s]-30)},_=wn(F,5);Cn((()=>{_()}),[m.width]),Yl((()=>{l.isEqual(r,S)||N(r)}),[r]),q.default.useEffect((()=>{D()}),[O]);const D=()=>Ie(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=h;if(!t||!(null==n?void 0:n.api))return;const{api:a,dataKey:r,beforeFetch:i=Pe}=n;if(i(O)){b(!0);try{const t=yield a(O);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=l.get(t.data,r))&&void 0!==e?e:[];L(n)}}catch(e){}b(!1)}})),M=(e,t)=>{delete e[t]},H=()=>{x.forEach((e=>{e&&(M(e,$c),M(e,jc))})),E([])},$=e=>{H(),R(Object.assign({},O,e))},j=gt("range-helper"),K=h.webPagination?{dataSource:k,loading:y,webPagination:!0}:{fetch:Object.assign(Object.assign({},h.fetch),{params:O})};return q.default.createElement("div",{ref:c,className:`${j}--wrapper`},q.default.createElement("div",{className:"form-wrap"},S.length?q.default.createElement(ap,{ref:f,items:S,initialValues:a,uniqueKey:n,formType:"search",isAutoFocus:!1,fieldsChange:e=>N(e),onCollapse:()=>F(),onFinish:e=>$(e),onReset:()=>Ie(void 0,void 0,void 0,(function*(){const[e,t]=yield f.current.GET_FORM_DATA();e||$(t)}))}):null),q.default.createElement("div",null,q.default.createElement(wc,tt({ref:p,height:C,columns:T,rowKey:h.rowKey||"pageIndex",rowStyle:e=>e.pageIndex>=P[0]&&e.pageIndex<=P[1]?{backgroundColor:"#f5f5f5"}:{}},K,{columnsChange:e=>I(e),onRowClick:(e,t)=>{const{dataIndex:l}=t;[$c,jc].includes(l)&&(l===$c&&(e[l]?(M(e,l),E([void 0,x[1]])):e.pageIndex>P[1]?d.message.warning(u("qm.searchHelper.rangeStartTip")):(x[0]&&M(x[0],l),e[l]="[",E([e,x[1]]))),l===jc&&(e[l]?(M(e,l),E([x[0],void 0])):e.pageIndex<P[0]?d.message.warning(u("qm.searchHelper.rangeEndTip")):(x[1]&&M(x[1],l),e[l]="]",E([x[0],e]))),p.current.FORCE_UPDATE())},onDataLoad:e=>{e.forEach((e=>{e.pageIndex===P[0]&&(e[$c]="["),e.pageIndex===P[1]&&(e[jc]="]")}))}}),q.default.createElement(pt,{type:"primary",icon:q.default.createElement(g.ClearOutlined,null),title:u("qm.table.alert.clear"),onClick:()=>H()}))),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Jr[s]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},q.default.createElement(pt,{onClick:()=>o(null),style:{marginRight:8}},u("qm.dialog.cancel")),q.default.createElement(pt,{type:"primary",disabled:!A,onClick:()=>o(x.map((e=>(e=>{const t={};for(const l in e)[$c,jc].includes(l)||(t[l]=e[l]);return t})(e))))},u("qm.dialog.confirm"))))};Kc.displayName="RangeTableHelper";const Vc=new Array(2).fill("");class zc extends e.Component{constructor(e){super(e),this._is_change=!1,this._records=[],this._is_clear=!1,this.state={visible:!1,loading:!1,itemList:[],textValue:Vc},this.getSearchHelper=oe.default((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||ft("Form","RANGE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||ft("Form","RANGE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setItemList=e=>{this.setState({itemList:e})},this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setTextValue=e=>{this.setState({textValue:e})},this.setRecords=e=>{this._records=e},this.setViewValue=()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;e.setViewValue(t,this.createViewText())},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props;this._is_change=!1,null==t||t(e),l(e,this.createViewText(),this._records)},this.clearSearchHelperValue=()=>{this.setRecords([]),this.setTextValue(Vc),this.triggerChange([])},this.closeSearchHelper=e=>{const{valueKey:t,textKey:l}=this.alias,n=e.map((e=>({value:e[t],text:e[l]})));this.setRecords(e),this.setItemList(n),this.setTextValue(n.map((e=>{var t;return null!==(t=e.text)&&void 0!==t?t:""}))),this.triggerChange(e.map((e=>e[t])));const{closed:a}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==a?void 0:a(this._records)),200)}))},this.openSearchHelper=e=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:l}=this.searchHelper,n=(null!=l?l:Pe)(t.state.formData);(null==n?void 0:n.then)?n.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),null==e||e())})),this.createFilters=e=>{const{fieldName:t}=this.props.option;return{[t]:De(e)?void 0:e}},this.getSearchHelperTableData=e=>{const{table:t,initialValue:n={}}=this.searchHelper,{beforeFetch:a=Pe,formatter:r=(e=>e)}=t.fetch;return new Promise(((i,o)=>Ie(this,void 0,void 0,(function*(){var s;const d=l.merge({},this.searchHelper.table.fetch.params,Object.assign(Object.assign({},n),r(this.createFilters(e))),{currentPage:1,pageSize:500});try{if(!a(d))return o();this.setState({loading:!0});const e=yield t.fetch.api(d);if(Fe((()=>this.setState({loading:!1}))),200===e.code){const n=Array.isArray(e.data)?e.data:null!==(s=l.get(e.data,t.fetch.dataKey))&&void 0!==s?s:[];return i(n)}}catch(e){this.setState({loading:!1})}o()}))))},this.resetSearchHelperValue=(e=[])=>Ie(this,void 0,void 0,(function*(){const{textValue:t}=this.state,{textKey:l}=this.alias,n=e.filter((e=>{var n;const a=null===(n=e[l])||void 0===n?void 0:n.toString().toLowerCase();return t.some((e=>null==a?void 0:a.includes(e.toLowerCase())))}));if(2===n.length)return this.closeSearchHelper(n);this.openSearchHelper()})),this.closeButNotSelect=()=>{this._is_change&&this.clearSearchHelperValue(),this.setVisible(!1)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e){const{value:t=[]}=e,{value:n=[]}=this.props;l.isEqual(t,n)||l.isEqual(n,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList();const{echo_data:a}=this.context,{fieldName:r}=this.props.option;if(!l.isEqual(a[r],this._ceho_data)&&(this._ceho_data=a[r],this.setItemList(a[r]),n.length)){const e=Vc.map(((e,t)=>{var l,i;return null!==(i=null===(l=a[r].find((e=>e.value===n[t])))||void 0===l?void 0:l.text)&&void 0!==i?i:""}));this.setTextValue(e)}}getItemList(){var e;return Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:t,valueKey:n}=this.alias,{fetchApi:a,params:r={},formatter:i=(e=>e),dataKey:o,fieldAliasMap:s}=this.searchHelper.echoRequest||{},d="function"==typeof s?s():s||{},{value:u}=this.props;if(a){if(De(u))return this.setRecords([]);this.setState({loading:!0});try{const s=yield a(i(Object.assign(Object.assign({},r),{keys:u})));if(200===s.code){let a=Array.isArray(s.data)?s.data:null!==(e=l.get(s.data,o))&&void 0!==e?e:[];a.forEach((e=>{(null==d?void 0:d.valueKey)&&d.valueKey!==n&&(e[n]=e[d.valueKey]),(null==d?void 0:d.textKey)&&d.textKey!==t&&(e[t]=e[d.textKey])})),a=a.filter((e=>u.includes(e[n]))).slice(0,2);const r=a.map((e=>({value:e[n],text:e[t]})));this.setRecords(a),this.setItemList(r),this.setTextValue(r.map((e=>{var t;return null!==(t=e.text)&&void 0!==t?t:""}))),this.setViewValue()}}catch(e){}this.setState({loading:!1})}}))}createViewText(){const{textKey:e}=this.alias;return this._records.map((t=>t[e])).join(" - ")}render(){var e;const{$$form:t}=this.context;this.props;const{visible:n,loading:a,textValue:r}=this.state,{fieldName:i,options:o={},searchHelper:s={},placeholder:u=Se("qm.form.rangeInputNumberPlaceholder"),bordered:c=!0,readOnly:f,disabled:p}=this.props.option,{onlySelect:m=!0}=this.searchHelper||s,h=r.every((e=>hr(e)))?"":r.join(" - "),g={visible:n,title:Se("qm.searchHelper.text"),width:null!==(e=s.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${i}`,loading:!1,bodyStyle:{paddingBottom:`${Jr[t.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},v=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:t.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${i}`:"",initialValue:l.merge({},s.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}});return t.isOnlyShow?q.default.createElement(Mr,{value:h,bordered:c}):q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Input.Group,null,q.default.createElement(d.Input,{value:r[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:u[0],allowClear:!1,bordered:c,readOnly:f,disabled:p,onBlur:e=>{var t,l;const{value:a}=e.target;this._is_change&&!n&&(a?r.every((e=>!!e))&&(null===(l=null===(t=this.searchHelper.table)||void 0===t?void 0:t.fetch)||void 0===l?void 0:l.api)&&this.getSearchHelperTableData(r).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):r.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;m||(this._is_change=!0,this.setTextValue([t,r[1]]))}}),q.default.createElement(d.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:c,disabled:p,readOnly:!0}),q.default.createElement(d.Input.Search,{value:r[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:u[1],loading:a,bordered:c,allowClear:!0,readOnly:f,disabled:p,onBlur:e=>{var t,l;const{value:a}=e.target;this._is_change&&!n&&(a?r.every((e=>!!e))&&(null===(l=null===(t=this.searchHelper.table)||void 0===t?void 0:t.fetch)||void 0===l?void 0:l.api)&&this.getSearchHelperTableData(r).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):r.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;this._is_clear?this._is_clear=!1:m||(this._is_change=!0,this.setTextValue([r[0],t]))},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper():(this._is_clear=!0,this.clearSearchHelperValue()))}})),q.default.createElement(Qn,g,q.default.createElement(Kc,v)))}}zc.contextType=Zn;class Wc extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ie(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){ct("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return ft("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ie(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=wr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,labelWidth:o=e.props.labelWidth,className:s,extra:u,buttonAfter:c,validateTrigger:f,rules:p=[],onChange:m=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(n),className:J.default(s),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(p)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:r,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(zc,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,l,n)=>{m(t,n),e.setViewValue(r,l)}}))),c&&q.default.createElement(d.Col,null,e.renderFormItemButton(r,c)),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:r},u)))))}}Wc.contextType=Zn;const Bc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,items:n,onChange:a,onValuesChange:r}=e,{options:i={},style:o={},bordered:s=!1,readOnly:u,disabled:c}=e.option,{itemList:f=[]}=i,p=De(f)?n:f,m=e=>p.filter((t=>e.includes(t.value))).map((e=>e.text)).join(",");return t.isOnlyShow?q.default.createElement(Mr,{value:m(l),bordered:s}):q.default.createElement(d.Checkbox.Group,{value:l,style:Object.assign({width:"100%"},o),disabled:c,onChange:e=>{(e=>{null==a||a(e),r(e,m(e))})(e)}},p.map((e=>q.default.createElement(d.Checkbox,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class Uc extends e.Component{constructor(){super(...arguments),this.state={itemList:[]}}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const a=null===(t=e.option.request)||void 0===t?void 0:t.params,r=null===(n=this.props.option.request)||void 0===n?void 0:n.params;l.isEqual(a,r)||this.getItemList()}getItemList(){var e;return Ie(this,void 0,void 0,(function*(){const{request:t={}}=this.props.option,{fetchApi:n,params:a={},dataKey:r,valueKey:i="value",textKey:o="text",callback:s}=t;if(n)try{const t=yield n(a);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=l.get(t.data,r))&&void 0!==e?e:[],a=n.map((e=>({value:e[i],text:e[o]})));this.setState({itemList:a},(()=>null==s?void 0:s(n)))}}catch(e){}}))}render(){const{$$form:e}=this.context,{itemList:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:u,extra:c,validateTrigger:f,rules:p=[],onChange:m=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":$e(s)},required:e.getFormItemRequired(p)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:r,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(Bc,{option:this.props.option,items:t,onValuesChange:(t,l)=>{m(t),e.setViewValue(r,l)}}))),c&&q.default.createElement(d.Col,{flex:$e(c.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}Uc.contextType=Zn;const Gc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{options:r={},style:i={},allowClear:o=!0,readOnly:s,disabled:u=t.isFormDisabled}=e.option,{allowHalf:c,count:f=5,tooltips:p}=r,m=e=>p?p[Math.ceil(e)-1]:e.toString();return q.default.createElement(d.Rate,{value:l,count:f,style:i,allowHalf:c,allowClear:o,tooltips:p,disabled:u||t.isOnlyShow,onChange:e=>{(e=>{null==n||n(e),a(e,m(e))})(e)}})};class Yc extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Gc,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Yc.contextType=Zn;const Xc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,items:n,onChange:a,onValuesChange:r}=e,{options:i={},style:o={},bordered:s=!1,readOnly:u,disabled:c=t.isFormDisabled}=e.option,{itemList:f=[]}=i,p=De(f)?n:f,m=e=>{var t,l;return null!==(l=null===(t=p.find((t=>t.value===e)))||void 0===t?void 0:t.text)&&void 0!==l?l:""};return t.isOnlyShow?q.default.createElement(Mr,{value:m(l),bordered:s}):q.default.createElement(d.Radio.Group,{value:l,style:Object.assign({width:"100%"},o),disabled:c||t.isOnlyShow,onChange:e=>{const{value:t}=e.target;(e=>{null==a||a(e),r(e,m(e))})(t)}},p.map((e=>q.default.createElement(d.Radio,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class Qc extends e.Component{constructor(){super(...arguments),this.state={itemList:[]},this.getItemList=()=>Ie(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:a={},dataKey:r,valueKey:i="value",textKey:o="text",callback:s}=t;if(n)try{const t=yield n(a);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=l.get(t.data,r))&&void 0!==e?e:[],a=n.map((e=>({value:e[i],text:e[o]})));this.setState({itemList:a},(()=>null==s?void 0:s(n)))}}catch(e){}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const a=null===(t=e.option.request)||void 0===t?void 0:t.params,r=null===(n=this.props.option.request)||void 0===n?void 0:n.params;l.isEqual(a,r)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:u,extra:c,validateTrigger:f,rules:p=[],onChange:m=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":$e(s)},required:e.getFormItemRequired(p)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:r,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(Xc,{option:this.props.option,items:t,onValuesChange:(t,l)=>{m(t),e.setViewValue(r,l)}}))),c&&q.default.createElement(d.Col,{flex:$e(c.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}Qc.contextType=Zn;const Zc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{label:r,options:i={},style:o={},readOnly:s,disabled:u=t.isFormDisabled}=e.option,{labelToSwitch:c,falseValue:f=ar,trueValue:p=nr}=i,{t:m}=ot();return q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Switch,{checked:l===p,style:o,disabled:u||t.isOnlyShow,checkedChildren:q.default.createElement(g.CheckOutlined,null),unCheckedChildren:q.default.createElement(g.CloseOutlined,null),onChange:e=>{(e=>{null==n||n(e),a(e,m(e===p?"am.form.trueText":"am.form.falseText"))})(e?p:f)}}),c?q.default.createElement("span",{style:{verticalAlign:"middle",marginLeft:8}},r):null)};class Jc extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option,{labelToSwitch:m}=i;return q.default.createElement(d.Form.Item,{label:m?" ":e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Zc,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Jc.contextType=Zn;const ef=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{t:r}=ot(),{options:i={},style:o={},placeholder:s=r("qm.form.inputPlaceholder"),bordered:u=!0,allowClear:c,translate:f,readOnly:p,disabled:m,onFocus:h,onBlur:g,onEnter:v}=e.option,{showCount:y,maxLength:b,autoSize:x}=i,E=Object.assign({},{minRows:1,maxRows:3},x),C=q.default.createElement(d.Input.TextArea,{value:l,placeholder:s,style:o,maxLength:b,showCount:y,autoSize:E,bordered:u,allowClear:c,readOnly:p||t.isOnlyShow,disabled:m,onFocus:e=>{null==h||h(e.target.value,e)},onBlur:t=>{const{value:l}=t.target;(t=>{const{onBlur:l}=e;null==l||l(t)})(l),null==g||g(l,t)},onKeyUp:e=>{if(13===e.keyCode){const{value:t}=e.target;null==v||v(t,e)}},onChange:e=>{const{value:t}=e.target;(e=>{null==n||n(e),a(e)})(t)}});return f?q.default.createElement(Hr,{text:l},C):C};class tf extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(ef,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,t)}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}tf.contextType=Zn;const lf=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{t:r}=ot(),{fieldName:i,options:o={},style:s={},placeholder:u=r("qm.form.datePlaceholder"),bordered:c=!0,allowClear:f=!0,readOnly:p,disabled:m}=e.option,{dateType:h="date",format:g,disabledDate:v,minDateTime:y,maxDateTime:b,shortCuts:x=!0}=o,E=q.default.createRef(),C=e=>{e&&"date"===h&&(e=e.slice(0,10)+" 00:00:00"),null==n||n(e),a(e,w(e))},w=e=>hr(e)?"":["date","exactdate"].includes(h)?e.slice(0,10):e,S=e=>{let t=mr(j.default().subtract(e,"day"),dr[h]);"date"===h&&(t=t.slice(0,10)),C(t),E.current.blur(),E.current.focus()};return t.isOnlyShow?q.default.createElement(Mr,{value:w(l),bordered:c}):q.default.createElement(et,{ref:E,style:Object.assign({width:"100%"},s),popupClassName:`form-popper__${i}`,picker:sr[h],format:g,bordered:c,showToday:!1,showTime:"datetime"===h&&{defaultValue:j.default("00:00:00","HH:mm:ss")},allowClear:f,disabled:m,inputReadOnly:p,disabledDate:null!=v?v:e=>((e,[t,l])=>t&&l?e.isBefore(t,"day")||e.isAfter(l,"day"):t?e.isBefore(t,"day"):!!l&&e.isAfter(l,"day"))(e,[y,b]),renderExtraFooter:x&&h.includes("date")?()=>"function"==typeof x?x():q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Tag,{color:"processing",onClick:()=>S(0)},r("qm.form.datePickers")[0]),q.default.createElement(d.Tag,{color:"processing",onClick:()=>S(1)},r("qm.form.datePickers")[1]),q.default.createElement(d.Tag,{color:"processing",onClick:()=>S(7)},r("qm.form.datePickers")[2]),q.default.createElement(d.Tag,{color:"processing",onClick:()=>S(30)},r("qm.form.datePickers")[3])):void 0,value:pr(l,dr[h]),onChange:(e,t)=>{C(mr(e,dr[h]))}})};class nf extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(lf,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}nf.contextType=Zn;const af=e=>[j.default().subtract(e,"day"),j.default()],rf=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{t:r}=ot(),{fieldName:i,options:o={},style:s={},placeholder:d=r("qm.form.daterangePlaceholder"),bordered:u=!0,allowClear:c=!0,readOnly:f,disabled:p=t.isFormDisabled}=e.option,{dateType:m="date",format:h,disableds:g=[!1,!1],allowEmpty:v,disabledDate:y,minDateTime:b,maxDateTime:x,shortCuts:E=!0}=o,C={[r("qm.form.dateRangePickers")[0]]:af(7),[r("qm.form.dateRangePickers")[1]]:af(30),[r("qm.form.dateRangePickers")[2]]:af(90),[r("qm.form.dateRangePickers")[3]]:af(180)},w=e=>hr(e)?"":e.map((e=>["date","exactdate"].includes(m)?null==e?void 0:e.slice(0,10):e)).join(" - ");return t.isOnlyShow?q.default.createElement(Mr,{value:w(l),bordered:u}):q.default.createElement(et.RangePicker,{style:Object.assign({width:"100%"},s),popupClassName:`form-popper__${i}`,picker:sr[m],format:h,bordered:u,showTime:"datetime"===m&&{defaultValue:[j.default("00:00:00","HH:mm:ss"),j.default("23:59:59","HH:mm:ss")]},allowClear:c,allowEmpty:v,disabled:p?[!0,!0]:g,inputReadOnly:f,disabledDate:null!=y?y:e=>((e,[t,l])=>t&&l?e.isBefore(t,"day")||e.isAfter(l,"day"):t?e.isBefore(t,"day"):!!l&&e.isAfter(l,"day"))(e,[b,x]),ranges:E&&m.includes("date")?C:void 0,value:De(l)?null:[pr(null==l?void 0:l[0],dr[m]),pr(null==l?void 0:l[1],dr[m])],onChange:(e,t)=>{(e=>{"date"===m&&(e=e.map(((e,t)=>e?0===t?e.slice(0,10)+" 00:00:00":e.slice(0,10)+" 23:59:59":e))),e.every((e=>!e))&&(e=[]),null==n||n(e),a(e,w(e))})([mr(null==e?void 0:e[0],dr[m]),mr(null==e?void 0:e[1],dr[m])])}})};class of extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(rf,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}of.contextType=Zn;const sf=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{t:r}=ot(),{fieldName:i,options:o={},style:s={},placeholder:d=r("qm.form.timePlaceholder"),bordered:u=!0,allowClear:c=!0,readOnly:f,disabled:p}=e.option,{timeType:m="hour-minute-second",hourStep:h=1,minuteStep:g=1,secondStep:v=1}=o;return t.isOnlyShow?q.default.createElement(Mr,{value:l,bordered:u}):q.default.createElement(lt,{style:Object.assign({width:"100%"},s),popupClassName:`form-popper__${i}`,bordered:u,showNow:!0,hourStep:h,minuteStep:g,secondStep:v,allowClear:c,disabled:p,inputReadOnly:f,format:ur[m],value:pr(l,ur[m]),onChange:(e,t)=>{(e=>{const t=mr(e,ur[m]);null==n||n(t),a(t)})(e)}})};class df extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(sf,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,t)}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}df.contextType=Zn;const uf=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{t:r}=ot(),{fieldName:i,options:o={},style:s={},placeholder:d=r("qm.form.timerangePlaceholder"),bordered:u=!0,allowClear:c=!0,readOnly:f,disabled:p=t.isFormDisabled}=e.option,{timeType:m="hour-minute-second",disableds:h=[!1,!1],allowEmpty:g,hourStep:v=1,minuteStep:y=1,secondStep:b=1}=o,x=e=>hr(e)?"":e.join(" - ");return t.isOnlyShow?q.default.createElement(Mr,{value:x(l),bordered:u}):q.default.createElement(lt.RangePicker,{style:Object.assign({width:"100%"},s),popupClassName:`form-popper__${i}`,bordered:u,showNow:!1,hourStep:v,minuteStep:y,secondStep:b,allowClear:c,allowEmpty:g,disabled:p?[!0,!0]:h,inputReadOnly:f,format:ur[m],value:De(l)?null:[pr(null==l?void 0:l[0],ur[m]),pr(null==l?void 0:l[1],ur[m])],onChange:(e,t)=>{(e=>{const t=[mr(null==e?void 0:e[0],ur[m]),mr(null==e?void 0:e[1],ur[m])];null==n||n(t),a(t,x(t))})(e)}})};class cf extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(uf,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}cf.contextType=Zn;class ff extends e.Component{constructor(e){super(e),this.searchRef=q.default.createRef(),this._clicking=!1,this._prevValue=null,this.state={itemList:[],visible:!1,loading:!1,activeIndex:0,inputText:void 0},this.getSearchHelper=oe.default(((e,t)=>Object.assign({},this.props.helperConfig,e,t))),this.paramsChangeHandler=(e,t)=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting(),l.isEqual(e,t)||this.getItemList()})),this.echoSearchHelper=()=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const e=this.getItemValue();e!==this._prevValue&&(this.getItemText(),this._prevValue=e)})),this.initialHandle=()=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e,options:t,searchHelper:l}=this.props.option,{fieldAliasMap:n,fieldsDefine:a,echoRequest:r}=this.searchHelper;if(n||ft("Form","IMMEDIATE 需要配置 `fieldAliasMap` 选项"),a){const e=["valueKey","displayKey","extraKey"];for(const t in a)e.includes(t)&&(this[t]=a[t])}Object.keys(this.alias).includes(e)||ft("Form","IMMEDIATE 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),r&&!this.valueKey&&ft("Form","IMMEDIATE 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用"),t&&!l&&ft("Form","IMMEDIATE 的 `options` 选项即将在下一个大版本中废弃,请使用 `searchHelper` 参数")})),this.getItemValue=()=>this.context.$$form.GET_FIELDS_VALUE([this.valueKey])[this.valueKey],this.getItemText=()=>Ie(this,void 0,void 0,(function*(){var e;const{fetchApi:t,params:n={},formatter:a=(e=>e),dataKey:r,callback:i,triggeredChange:o,fieldAliasMap:s,extraAliasMap:d}=this.searchHelper.echoRequest||{},u="function"==typeof s?s():s||{},c="function"==typeof d?d():d||{},f=this.getItemValue();if(t&&!De(f))try{const s=yield t(a(Object.assign(Object.assign({},n),{key:f})));if(200===s.code){const t=Array.isArray(s.data)?s.data:null!==(e=l.get(s.data,r))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(u&&vr(e,this.alias,u),c&&yr(e,this.extras,c),this._record=e,this.setFieldsValue(e),o){const t=gr(e,this.alias[this.props.option.fieldName]);this.triggerChange(t)}null==i||i([e])}}}catch(e){}})),this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;this._record=e;for(const n in this.alias){const a=gr(e,this.alias[n]);t.SET_FIELDS_VALUE({[n]:a}),n===this.valueKey&&(this._prevValue=a),n===l&&t.setViewValue(l,a)}for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:gr(e,this.extras[l])})},this.fetchHandle=l.debounce(this.getItemList,200),this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(e,this._record)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.clickHandle=(e,t)=>{const{$$form:l}=this.context,{fieldName:n}=this.props.option;for(const t in this.alias){if(t===n)continue;const a=gr(e,this.alias[t]);l.SET_FIELDS_VALUE({[t]:a}),t===this.valueKey&&(this._prevValue=e?a:null)}for(const t in this.extras)l.SET_FIELDS_EXTRA({[t]:gr(e,this.extras[t])});this.searchRef.current.focus({cursor:"end"}),this._record=e;const a=gr(e,this.alias[n]);this.triggerChange(a),this.setState({inputText:void 0}),t&&t()},this.initialHandle()}get searchHelper(){return this.getSearchHelper(this.props.option.options,this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidUpdate(e){var t,l,n,a,r,i;const o=(null===(l=null===(t=e.option.searchHelper)||void 0===t?void 0:t.request)||void 0===l?void 0:l.params)||(null===(n=e.option.request)||void 0===n?void 0:n.params),s=(null===(r=null===(a=this.props.option.searchHelper)||void 0===a?void 0:a.request)||void 0===r?void 0:r.params)||(null===(i=this.props.option.request)||void 0===i?void 0:i.params);this.paramsChangeHandler(s,o),this.echoSearchHelper()}getItemList(e){var t;return Ie(this,void 0,void 0,(function*(){const{fieldName:n}=this.props.option,{fetchApi:a,params:r={},formatter:i=(e=>e),dataKey:o}=this.searchHelper.request||this.props.option.request||{};if(a){this.setState({loading:!0});try{const s=yield a(i(Object.assign(Object.assign({},r),{[n]:e})));if(200===s.code){const e=Array.isArray(s.data)?s.data:null!==(t=l.get(s.data,o))&&void 0!==t?t:[];this.setState({itemList:e,activeIndex:0})}}catch(e){}this.setState({loading:!1})}}))}render(){const{$$form:e}=this.context,{visible:t,loading:n,itemList:a,inputText:r}=this.state,{value:i}=this.props,{fieldName:o,options:s={},style:u={},placeholder:c=Se("qm.form.inputPlaceholder"),bordered:f=!0,allowClear:p=!0,translate:m,readOnly:h,disabled:g}=this.props.option,{listHeight:v=rr}=s,{hideHeader:y,onlySelect:b=!0}=this.searchHelper||s,x=this.searchHelper.columns||[],E=gt("form-immediate"),C=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,w=q.default.createElement(d.Spin,{spinning:n},a.length?q.default.createElement("table",{cellSpacing:0,cellPadding:0,className:J.default("table")},!y&&q.default.createElement("thead",null,q.default.createElement("tr",null,x.filter((e=>!e.hidden)).map((e=>q.default.createElement("th",{key:e.dataIndex,style:{width:`${e.width}px`,backgroundColor:"#f0f0f0"}},e.title))))),q.default.createElement("tbody",null,a.map(((e,t)=>q.default.createElement("tr",{key:t,className:this.state.activeIndex===t?"active":"",onMouseEnter:()=>{this.setState({activeIndex:t})},onMouseDown:()=>{this._clicking=!0},onMouseUp:()=>{this._clicking=!1},onClick:()=>{this.clickHandle(e,(()=>this.handleVisibleChange(!1)))}},x.filter((e=>!e.hidden)).map((t=>q.default.createElement("td",{key:t.dataIndex},l.get(e,t.dataIndex))))))))):q.default.createElement(pn,null)),S=q.default.createElement(xe.Consumer,null,(l=>{const n={[E]:!0,[`${E}--lg`]:"large"===(null==l?void 0:l.size),[`${E}--sm`]:"small"===(null==l?void 0:l.size)};return e.isOnlyShow?q.default.createElement(Mr,{value:i,bordered:f}):q.default.createElement(xs,{action:g?[]:["click"],popupVisible:!g&&t,popup:w,popupClassName:J.default(n,`form-popper__${o}`),popupStyle:{minWidth:C,maxHeight:v},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:or,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement("div",null,q.default.createElement(d.Input,{ref:this.searchRef,placeholder:c,allowClear:p,bordered:f,readOnly:h,disabled:g,style:Object.assign({width:"100%"},u),value:null!=r?r:i,title:i,onFocus:()=>{!a.length&&this.fetchHandle(i)},onBlur:e=>{b&&!this._clicking&&r!==i&&this.setState({inputText:void 0}),this.triggerBlur(e.target.value)},onKeyDown:e=>{if(27===e.keyCode&&this.handleVisibleChange(!1),13===e.keyCode&&this.clickHandle(a[this.state.activeIndex],(()=>this.handleVisibleChange(!1))),38===e.keyCode||40===e.keyCode){if(!this.state.visible)return this.handleVisibleChange(!0);let t=this.state.activeIndex;const l=40===e.keyCode?++t%a.length:(--t+a.length)%a.length;this.setState({activeIndex:l})}},onChange:e=>{const{value:t}=e.target;this.fetchHandle(t),b?this.setState({inputText:t}):t&&this.triggerChange(t),t?this.handleVisibleChange(!0):this.clickHandle(null)}})))}));return m?q.default.createElement(Hr,{text:i},S):S}}ff.contextType=Zn;class pf extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ie(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){ct("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return ft("immediate","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ie(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=wr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:u,extra:c,buttonAfter:f,validateTrigger:p,rules:m=[],onChange:h=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":$e(s)},required:e.getFormItemRequired(m)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:r,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(ff,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t="",l)=>{h(t,l),e.setViewValue(r,t)}}))),f&&q.default.createElement(d.Col,null,e.renderFormItemButton(r,f)),c&&q.default.createElement(d.Col,{flex:$e(c.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}pf.contextType=Zn;class mf extends e.Component{render(){var e;const{$$form:t}=this.context,{type:l,label:n,fieldName:a,className:r,style:i={},collapse:o={}}=this.props.option,{expand:s}=t.state,{showLimit:u,remarkItems:c=[],onCollapse:f=Le}=o,p=[];if(c.length){const l=null!==(e=t.getBlockDerivedItems().find((e=>e[0].fieldName===a)))&&void 0!==e?e:[],n=null!=u?u:l.length-1;l.slice(n+1).forEach((e=>{var l;const n=c.find((t=>t.fieldName===e.fieldName));if(!n)return;const a=n.showLabel?`${e.label}:`:"",r=null!==(l=t.getViewValue(e.fieldName))&&void 0!==l?l:"";""!==r&&p.push(Object.assign(Object.assign({},e),{text:`${a}${r}`}))}))}return q.default.createElement(d.Form.Item,{labelCol:{span:0},wrapperCol:{span:24}},q.default.createElement(vt,{id:a,label:n,className:r,extra:p.map((e=>e.text)).join(" | "),style:Object.assign({},i),collapse:s[a],onCollapseChange:e=>{t.setState((t=>({expand:Object.assign({},t.expand,{[a]:e})}))),f(e)}}))}}mf.contextType=Zn;const hf=(e,t,l,n)=>e.map((e=>e[l]===t?Object.assign(Object.assign({},e),{children:n}):e.children?Object.assign(Object.assign({},e),{children:hf(e.children,t,l,n)}):e)),gf=e=>{var t;const{$$form:n}=q.default.useContext(Zn),{value:a,items:r,multiple:i,loading:o,onChange:s,onValuesChange:u}=e,{t:c}=ot(),{fieldName:f,options:p={},style:m={},placeholder:h=c("qm.form.selectPlaceholder"),bordered:g=!0,allowClear:v=!0,asyncLoad:y,translate:b,readOnly:x,disabled:E}=e.option,{itemList:C,filterable:w=!0,listHeight:S=rr,checkStrictly:N,checkStrategy:T="SHOW_CHILD",collapseTags:I,echoRequest:O,defaultExpandAll:R=!y,defaultExpandedKeys:k,dropdownStyle:L,openPyt:P=!0}=p,[A,F]=q.default.useState(De(C)?r:C),[_,D]=q.default.useState([]),[M,H]=q.default.useState(!1),[$,j]=q.default.useState(!1),K=q.default.useRef(null),V=q.default.useRef(null),z=q.default.useRef(A),W=q.default.useRef($),B=q.default.useRef(null),U=e=>{j(e),W.current=e};Hd({ref:V,handler:()=>U(!1)}),q.default.useEffect((()=>{a!==B.current&&(X(),B.current=a),(()=>{var e;V.current=(null===(e=K.current)||void 0===e?void 0:e.querySelector(".ant-select-selection-overflow-item-rest"))||null})()}),[a]),Yl((()=>{const e=De(C)?r:C;y?l.isEqual(e,z.current)||(F((t=>[...e,...t.filter((e=>!!e.style))])),z.current=e):F(e)}),[C,r]),Yl((()=>{F((e=>[...e,..._.filter((t=>!e.some((e=>e.value===t.value))))]))}),[_]);const G=e=>{var t;return(null===(t=xr(A,e))||void 0===t?void 0:t.text)||(null==e?void 0:e.toString())||""},Y=e=>(N&&Array.isArray(a)&&a.every((e=>l.isPlainObject(e)))&&(e=e.map((e=>e.value))),i?(null==e?void 0:e.map((e=>G(e))).join(","))||"":G(e)),X=()=>Ie(void 0,void 0,void 0,(function*(){var e;if(!O)return;if(!y)return ft("Form","TREE_SELECT 的 echoRequest 选项必须组合 `asyncLoad` 一起使用");const{fetchApi:t,params:n,dataKey:r,callback:i,formatter:o=(e=>e)}=O||{},{textKey:s="text",valueKey:d="value"}=y;if(t&&!De(a))try{const u=yield t(o(Object.assign(Object.assign({},n),{[d]:a})));if(200===u.code){const t=Array.isArray(u.data)?u.data:null!==(e=l.get(u.data,r))&&void 0!==e?e:[];if(t.length){const e=br(t,d,s);D(e.map((e=>Object.assign(Object.assign({},e),{style:{display:"none"}})))),null==i||i(t)}}}catch(e){}})),Q=n.isOnlyShow?q.default.createElement(Mr,{value:Y(a),bordered:g}):q.default.createElement(xs,{popupVisible:!E&&$,popup:(()=>{if(!i)return null;const e=(null==a?void 0:a.map((e=>G(e))))||[];return q.default.createElement("ul",{className:"ant-dropdown-menu"},e.length?e.map(((e,t)=>q.default.createElement("li",{key:`${e}-${t}`,className:"ant-dropdown-menu-item"},e))):q.default.createElement("li",{className:"ant-dropdown-menu-item"},c("qm.table.config.emptyText")))})(),popupStyle:{minWidth:null===(t=K.current)||void 0===t?void 0:t.offsetWidth},onPopupVisibleChange:e=>U(e),builtinPlacements:or,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement("div",{ref:K},q.default.createElement(d.TreeSelect,tt({open:M,fieldNames:{label:"text",value:"value",children:"children"},value:a,multiple:i,treeCheckable:i,treeCheckStrictly:N,showCheckedStrategy:d.TreeSelect[T],popupClassName:`form-popper__${f}`,dropdownStyle:L,placeholder:h,listHeight:S,style:m,loading:o,bordered:g,allowClear:v,disabled:E,treeDefaultExpandAll:R,treeDefaultExpandedKeys:k,showSearch:w,maxTagCount:I?"responsive":void 0,loadData:y?({key:e,children:t})=>Ie(void 0,void 0,void 0,(function*(){var n;if(!y||t)return;const{fetchApi:a,params:r,dataKey:i,textKey:o="text",valueKey:s="value",callback:d,formatter:u=(e=>e)}=y;if(a)try{const t=yield a(u(Object.assign(Object.assign({},r),{[s]:e})));if(200===t.code){const a=Array.isArray(t.data)?t.data:null!==(n=l.get(t.data,i))&&void 0!==n?n:[],r=hf(A,e,s,br(a,s,o));F(r),null==d||d(a)}}catch(e){}})):void 0,treeData:A},i?{title:Y(a)}:null,{filterTreeNode:(e,t)=>{var l;const n=(null===(l=null==t?void 0:t.text)||void 0===l?void 0:l.toString())||"",a=_r.parse(n).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(P?`${n}|${a}`:n).toLowerCase().indexOf(e.toLowerCase())>=0},onMouseDown:e=>{e.target.classList.contains("ant-select-selection-overflow-item-rest")&&(U(!0),H(!1))},onDropdownVisibleChange:e=>{if(!e)return H(e);Fe((()=>{W.current||H(e)}))},onChange:e=>{(e=>{null==s||s(e),u(e,Y(e),A)})(e),B.current=e}}))));return b?q.default.createElement(Hr,{text:Y(a)},Q):Q};class vf extends e.Component{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Ie(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:a={},dataKey:r,valueKey:i="value",textKey:o="text",callback:s}=t;if(n){this.setState({loading:!0});try{const t=yield n(a);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=l.get(t.data,r))&&void 0!==e?e:[],a=br(n,i,o);this.setState({itemList:a},(()=>null==s?void 0:s(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const a=null===(t=e.option.request)||void 0===t?void 0:t.params,r=null===(n=this.props.option.request)||void 0===n?void 0:n.params;l.isEqual(a,r)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t,loading:l}=this.state,{type:n,label:a,tooltip:r,fieldName:i,invisible:o,options:s={},labelWidth:u=e.props.labelWidth,className:c,extra:f,validateTrigger:p,rules:m=[],onChange:h=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(a),className:J.default(c),tooltip:r,hidden:o,labelCol:{flex:e.verticalLayout?"initial":$e(u)},required:e.getFormItemRequired(m)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:i,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(a)}},q.default.createElement(gf,{option:this.props.option,items:t,loading:l,multiple:this.props.multiple,onValuesChange:(t,l,n)=>{h(t,l,n),e.setViewValue(i,l)}}))),f&&q.default.createElement(d.Col,{flex:$e(f.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:i},f)))))}}vf.contextType=Zn;const yf=e=>{const{$$form:t}=q.default.useContext(Zn),{value:n,multiple:a,items:r}=e,{t:i}=ot(),{fieldName:o,options:s={},style:u={},placeholder:c=i("qm.form.selectPlaceholder"),bordered:f=!0,allowClear:p=!0,asyncLoad:m,translate:h,readOnly:g,disabled:v}=e.option,{itemList:y,changeOnSelect:b,checkStrictly:x,checkStrategy:E="SHOW_PARENT",filterable:C=!0,dropdownStyle:w,openPyt:S=!0}=s,[N,T]=q.default.useState(De(y)?r:y),I=q.default.useRef(N);Yl((()=>{const e=De(y)?r:y;m?l.isEqual(e,I.current)||(T(e),I.current=e):T(e)}),[y,r]);const O=e=>Er(N,null!=e?e:"").map((e=>e.text)).join("/"),R=e=>a?(null==e?void 0:e.map((e=>O(e))).join(","))||"":O(e),k=t.isOnlyShow?q.default.createElement(Mr,{value:R(n),bordered:f}):q.default.createElement(d.Cascader,tt({value:(e=>De(e)?[]:a?e.map((e=>e.split(","))):e.split(","))(n),fieldNames:{label:"text",value:"value",children:"children"},options:N,multiple:a,maxTagCount:"responsive",changeOnSelect:b||x,showCheckedStrategy:d.Cascader[E],popupClassName:`form-popper__${o}`,dropdownStyle:w,placeholder:c,style:u,bordered:f,allowClear:p,disabled:v,showSearch:C&&!m&&{filter:(e,t)=>t.some((t=>{var l;const n=(null===(l=null==t?void 0:t.text)||void 0===l?void 0:l.toString())||"",a=_r.parse(n).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(S?`${n}|${a}`:n).toLowerCase().indexOf(e.toLowerCase())>=0}))},loadData:m?e=>Ie(void 0,void 0,void 0,(function*(){var t;const n=e[e.length-1];if(!m||n.children)return;const{fetchApi:a,params:r,dataKey:i,textKey:o="text",valueKey:s="value",callback:d,formatter:u=(e=>e)}=m;if(a)try{const e=yield a(u(Object.assign(Object.assign({},r),{[s]:n.value})));if(200===e.code){const a=Array.isArray(e.data)?e.data:null!==(t=l.get(e.data,i))&&void 0!==t?t:[],r=hf(N,n.value,s,br(a,s,o));T(r),null==d||d(a)}}catch(e){}})):void 0},a?{title:R(n)}:null,{onChange:t=>{(t=>{const{onChange:l,onValuesChange:n}=e;null==l||l(t),n(t,R(t),N)})(((e=[])=>a?e.map((e=>e.join(","))):e.join(","))(t))}}));return h?q.default.createElement(Hr,{text:R(n)},k):k};class bf extends e.Component{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Ie(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:a={},dataKey:r,valueKey:i="value",textKey:o="text",callback:s}=t;if(n){this.setState({loading:!0});try{const t=yield n(a);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=l.get(t.data,r))&&void 0!==e?e:[],a=br(n,i,o);this.setState({itemList:a},(()=>null==s?void 0:s(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const a=null===(t=e.option.request)||void 0===t?void 0:t.params,r=null===(n=this.props.option.request)||void 0===n?void 0:n.params;l.isEqual(a,r)||this.getItemList()}render(){const{$$form:e}=this.context,{multiple:t}=this.props,{itemList:l}=this.state,{type:n,label:a,tooltip:r,fieldName:i,invisible:o,options:s={},labelWidth:u=e.props.labelWidth,className:c,extra:f,validateTrigger:p,rules:m=[],onChange:h=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(a),className:J.default(c),tooltip:r,hidden:o,labelCol:{flex:e.verticalLayout?"initial":$e(u)},required:e.getFormItemRequired(m)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:i,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(a)}},q.default.createElement(yf,{option:this.props.option,multiple:t,items:l,onValuesChange:(t,l,n)=>{h(t,l,n),e.setViewValue(i,l)}}))),f&&q.default.createElement(d.Col,{flex:$e(f.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:i},f)))))}}bf.contextType=Zn;const xf=["110000","120000","310000","500000"],Ef=["810000","820000"],Cf=[{text:"A",value:"A"},{text:"F",value:"F"},{text:"G",value:"G"},{text:"H",value:"H"},{text:"J",value:"J"},{text:"L",value:"L"},{text:"N",value:"N"},{text:"Q",value:"Q"},{text:"S",value:"S"},{text:"T",value:"T"},{text:"X",value:"X"},{text:"Y",value:"Y"},{text:"Z",value:"Z"},{text:"直辖市",value:"Z1"},{text:"港澳",value:"Z2"}],wf=[{text:"A",value:"A"},{text:"B",value:"B"},{text:"C",value:"C"},{text:"D",value:"D"},{text:"E",value:"E"},{text:"F",value:"F"},{text:"G",value:"G"},{text:"H",value:"H"},{text:"J",value:"J"},{text:"K",value:"K"},{text:"L",value:"L"},{text:"M",value:"M"},{text:"N",value:"N"},{text:"P",value:"P"},{text:"Q",value:"Q"},{text:"R",value:"R"},{text:"S",value:"S"},{text:"T",value:"T"},{text:"W",value:"W"},{text:"X",value:"X"},{text:"Y",value:"Y"},{text:"Z",value:"Z"},{text:"直辖市",value:"Z1"},{text:"港澳",value:"Z2"}],Sf=e=>_r.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join(""),Nf=(e,t,l=1)=>{if(l>2||!e[t])return;return("86"===t?Object.keys(e[t]).filter((e=>![...xf,...Ef].includes(e))):Object.keys(e[t])).map((n=>({l:Sf(e[t][n].slice(0,1)).toUpperCase(),n:e[t][n],c:n,p:t,children:Nf(e,n,l+1)})))},Tf=(e,t)=>t.map((t=>({l:Sf(e[86][t].slice(0,1)).toUpperCase(),n:e[86][t],c:t,p:"86",children:void 0})));class If extends e.Component{constructor(e){super(e),this.searchRef=q.default.createRef(),this.scrollRef=q.default.createRef(),this.state={visible:!1,select_type:"0",active_key:""},this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(e,this.createTextValue(e)),this.handleVisibleChange(!1)},this.zxsAndGa=this.createZxsAndGa(),this.provinces=this.createProvince(),this.allCities=this.createAllCity(),this.letterCities=this.createCity()}componentDidMount(){this.setInputReadonly()}setInputReadonly(){var e;null===(e=this.searchRef.current)||void 0===e||e.input.setAttribute("readonly","readonly")}scrollHandle(e){this.setState({active_key:e}),re.default(this[`${e}Ref`],{block:"start",behavior:"smooth",boundary:this.scrollRef.current})}clickHadnle(e){this.triggerChange(e)}createTextValue(e){var t;return(null===(t=this.allCities.find((t=>t.c===e)))||void 0===t?void 0:t.n)||""}createZxsAndGa(){return[{l:"Z1",n:"直辖市",c:"",p:"",children:Tf(ve.default,xf)},{l:"Z2",n:"港澳",c:"",p:"",children:Tf(ve.default,Ef)}]}createProvince(){var e;return(null!==(e=Nf(ve.default,"86"))&&void 0!==e?e:[]).concat(this.zxsAndGa)}createAllCity(){const e=[];return this.provinces.forEach((t=>e.push(...t.children))),e}createCity(){return wf.filter((e=>"Z1"!==e.value&&"Z2"!==e.value)).map((e=>({l:e.value,n:e.text,c:"",p:"",children:this.allCities.filter((e=>![...xf,...Ef].includes(e.c))).filter((t=>t.l===e.value))}))).concat(this.zxsAndGa)}renderType(){const{select_type:e}=this.state;return q.default.createElement(d.Radio.Group,{size:"small",buttonStyle:"solid",value:e,onChange:e=>{const{value:t}=e.target;this.setState({select_type:t,active_key:""},(()=>{this.scrollRef.current.scrollTop=0}))}},q.default.createElement(d.Radio.Button,{value:"0"},Se("qm.form.citySelectType.0")),q.default.createElement(d.Radio.Button,{value:"1"},Se("qm.form.citySelectType.1")))}renderLetter(){const{active_key:e,select_type:t}=this.state;return("0"===t?Cf:wf).map((t=>q.default.createElement("li",{key:t.value,className:J.default({tag:!0,actived:t.value===e}),onClick:()=>this.scrollHandle(t.value.toString())},t.text)))}renderSelect(){const{value:e}=this.props;return q.default.createElement(d.Select,{size:"small",placeholder:Se("qm.form.selectPlaceholder"),style:{width:"200px"},showSearch:!0,filterOption:(e,t)=>{var l;return((null===(l=null==t?void 0:t.children)||void 0===l?void 0:l.toString())||"").toLowerCase().indexOf(e.toLowerCase())>=0},value:e||void 0,onChange:e=>{this.triggerChange(e)}},this.allCities.map((e=>q.default.createElement(d.Select.Option,{key:e.c,value:e.c},e.n))))}renderCity(e){const{select_type:t}=this.state;return("0"===t?this.provinces:this.letterCities).map(((t,l)=>{var n;return q.default.createElement("div",{key:l},q.default.createElement("dt",{ref:e=>this[`${t.l}Ref`]=e},t.n,":"),q.default.createElement("dd",null,null===(n=t.children)||void 0===n?void 0:n.map((t=>q.default.createElement("li",{key:t.c,className:J.default({actived:t.c===e}),onClick:()=>this.clickHadnle(t.c)},t.n)))))}))}render(){const{$$form:e}=this.context,{visible:t}=this.state,{value:l}=this.props,{fieldName:n,options:a={},style:r={},placeholder:i=Se("qm.form.selectPlaceholder"),bordered:o=!0,allowClear:s=!0,readOnly:u,disabled:c}=this.props.option,f=gt("form-city-select"),p=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,m=this.createTextValue(l),h=q.default.createElement("div",{className:"container",style:Object.assign({},r)},q.default.createElement("div",{className:"city-drop"},q.default.createElement("div",{className:"city-drop-toper"},q.default.createElement("div",{className:"city-drop-toper__type"},this.renderType()),q.default.createElement("div",{className:"city-drop-toper__search"},this.renderSelect())),q.default.createElement("div",{className:"city-drop-letter"},this.renderLetter()),q.default.createElement("div",{ref:this.scrollRef,className:"city-drop-list"},q.default.createElement("dl",null,this.renderCity(l)))));return q.default.createElement(xe.Consumer,null,(l=>{const a={[f]:!0,[`${f}--lg`]:"large"===(null==l?void 0:l.size),[`${f}--sm`]:"small"===(null==l?void 0:l.size)};return e.isOnlyShow?q.default.createElement(Mr,{value:m,bordered:o}):q.default.createElement(xs,{action:c?[]:["click"],popupVisible:!c&&t,popup:h,popupClassName:J.default(a,`form-popper__${n}`),popupStyle:{minWidth:p},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:or,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement("div",null,q.default.createElement(d.Input,{ref:this.searchRef,placeholder:i,allowClear:s,bordered:o,readOnly:u,disabled:c,style:Object.assign({width:"100%"},r),value:m,title:m,onChange:e=>{const{value:t}=e.target;this.triggerChange(t)}})))}))}}If.contextType=Zn;class Of extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(If,{option:this.props.option,onValuesChange:(t,l)=>{p(t,l),e.setViewValue(a,l)}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Of.contextType=Zn;const Rf=(e,t)=>{if(e[t])return Object.keys(e[t]).map((l=>({text:e[t][l],value:l,children:Rf(e,l)})))};class kf extends e.Component{constructor(e){super(e),this.searchRef=q.default.createRef(),this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(e,this.createTextValue(e)),this.handleVisibleChange(!1)};const t=Rf(ve.default,"86")||[];this.state={results:t,visible:!1,values:[],tabs:[t.map((e=>({text:e.text,value:e.value})))],activeName:"0"}}componentDidMount(){this.initial(),this.setInputReadonly()}componentDidUpdate(e){const{value:t}=e,{value:l}=this.props;t!==l&&this.state.values.join(",")!==(null!=l?l:"")&&this.initial()}get isFetch(){var e;return!!(null===(e=this.props.option.request)||void 0===e?void 0:e.fetchApi)}get level(){let{selectLevel:e=0}=this.props.option.options||{};return(e<1||e>3)&&(e=3),this.isFetch?4:e}setInputReadonly(){var e;null===(e=this.searchRef.current)||void 0===e||e.input.setAttribute("readonly","readonly")}createTextValue(e){return(e?e.split(","):[]).map(((e,t)=>{var l,n;return null===(n=null===(l=this.state.tabs[t])||void 0===l?void 0:l.find((t=>t.value===e)))||void 0===n?void 0:n.text})).join("/")}initial(){const{value:e}=this.props,t=e?e.split(","):[];this.setState({values:t},(()=>{this.createTabs(),this.createActiveName(t.length?t.length-1:0)}))}createActiveName(e){this.setState({activeName:e.toString()})}createTabs(){const{results:e,values:t}=this.state;if(!e.length)return;const l=this.state.tabs.slice(0,1);for(let n=0;n<t.length;n++){const a=xr(e,t[n]);if(a&&De(a.children)){this.isFetch&&this.getStreetList(t[n]);break}Array.isArray(null==a?void 0:a.children)&&(l[n+1]=null==a?void 0:a.children.map((e=>({text:e.text,value:e.value}))))}this.setState({tabs:l})}getStreetList(e){var t;return Ie(this,void 0,void 0,(function*(){const{request:n={}}=this.props.option,{fetchApi:a,formatter:r=(e=>e),dataKey:i,valueKey:o="value",textKey:s="text"}=n;if(a)try{const n=yield a(r({code:e}));if(200===n.code){const e=Array.isArray(n.data)?n.data:null!==(t=l.get(n.data,i))&&void 0!==t?t:[];this.setState((t=>({tabs:[...t.tabs,e.map((e=>({text:e[s],value:e[o]})))]})))}}catch(e){}}))}renderTabs(){const{values:e}=this.state,t=this.state.tabs.map(((t,l)=>{var n;const a=(null===(n=t.find((t=>t.value===e[l])))||void 0===n?void 0:n.text)||`${Se("qm.form.selectPlaceholder").replace("...","")}(${Se("qm.form.regionSelectLabel")[l]})`;return q.default.createElement(Un.TabPane,{key:l.toString(),tab:a},q.default.createElement("div",{className:"region-box"},t.map((t=>q.default.createElement("span",{key:t.value,className:J.default({"region-box__item":!0,actived:e.includes(t.value.toString())}),title:t.text,onClick:()=>{let{values:e}=this.state;e[l]=t.value.toString(),e=e.slice(0,l+1),this.setState({values:e},(()=>{const t=(e=>["810000","820000"].includes(e[0]))(e)?this.level<3?this.level:this.level-1:this.level;if(l+1>=t)return this.triggerChange(e.join(","));this.createTabs(),this.createActiveName(l+1)}))}},t.text)))))}));return t.length?q.default.createElement(Un,{size:"small",activeKey:this.state.activeName,onChange:e=>{this.createActiveName(e)}},t):q.default.createElement(pn,null)}render(){const{$$form:e}=this.context,{visible:t}=this.state,{value:l}=this.props,{fieldName:n,options:a={},style:r={},placeholder:i=Se("qm.form.selectPlaceholder"),bordered:o=!0,allowClear:s=!0,readOnly:u,disabled:c}=this.props.option,f=gt("form-region-select"),p=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,m=q.default.createElement("div",{className:"container"},this.renderTabs());let h=this.prevText;if(!t){const e=this.createTextValue(l);(""===e||e.split("/").every((e=>""!==e)))&&(h=e,this.prevText=h)}return q.default.createElement(xe.Consumer,null,(l=>{const a={[f]:!0,[`${f}--lg`]:"large"===(null==l?void 0:l.size),[`${f}--sm`]:"small"===(null==l?void 0:l.size)};return e.isOnlyShow?q.default.createElement(Mr,{value:h,bordered:o}):q.default.createElement(xs,{action:c?[]:["click"],popupVisible:!c&&t,popup:m,popupClassName:J.default(a,`form-popper__${n}`),popupStyle:{minWidth:p},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:or,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement("div",null,q.default.createElement(d.Input,{ref:this.searchRef,placeholder:i,allowClear:s,bordered:o,style:Object.assign({width:"100%"},r),readOnly:u,disabled:c,value:h,title:h,onChange:e=>{const{value:t}=e.target;this.triggerChange(t),!t&&Fe((()=>this.initial()))}})))}))}}kf.contextType=Zn;class Lf extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(kf,{option:this.props.option,onValuesChange:(t,l)=>{p(t,l),e.setViewValue(a,l)}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Lf.contextType=Zn;const Pf=e=>{const{$$form:t}=q.default.useContext(Zn),{value:n,onChange:a,onValuesChange:r}=e,{options:i={},upload:o={},disabled:s,readOnly:u}=e.option,{multiple:c=!0,maxCount:f=1,fileTypes:p,fileSize:m,draggable:h,editable:v,batchDownload:y,fileDirection:b,onPreview:x,onDownload:E,onRemove:C,onSortChange:w,onEditChange:S}=i,{action:N,headers:T,params:I,withCredentials:O=!1,dataKey:R="",downloadWithHeaders:k,fieldAliasMap:L,beforeUpload:P,button:A}=o,F="function"==typeof L?L():L||{},{t:_}=ot();return q.default.createElement($n,{name:"file",action:N,multiple:c,headers:T,data:I,withCredentials:O,downloadWithHeaders:k,beforeUpload:P,maxCount:f,fileTypes:p,fileSize:m,draggable:h,editable:v,batchDownload:y,fileDirection:b,disabled:s||t.props.disabled,readOnly:t.isOnlyShow||u,button:A,showUploadList:{showDownloadIcon:!0,downloadIcon:q.default.createElement(g.DownloadOutlined,null)},fileList:n,onChange:({fileList:e})=>{(e=>{const t=e.map((e=>{var t;const n=e.response||{},a={};for(const l in F)a[l]=e[l]||(null===(t=n.data)||void 0===t?void 0:t[F[l]])||"";return e.response&&200!==n.code&&d.message.error(n.message||_("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},a),{url:e.url||(R?l.get(n.data,R):n.data)||"",status:e.status})}));null==a||a(t),t.every((e=>"done"===e.status&&e.url))&&r(t)})(e)},onPreview:x,onDownload:E,onRemove:C,onSortChange:w,onEditChange:S})};class Af extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Pf,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,"")}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Af.contextType=Zn;const Ff=q.default.forwardRef(((e,t)=>{const l=je({src:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0},e),{className:n,style:a,src:r,alt:i,imgStyle:o}=l,s=Ne(l,["className","style","src","alt","imgStyle"]),d=q.default.useRef(null),u=q.default.useRef(null);q.default.useEffect((()=>{const e={};for(const t in s)void 0!==l[t]&&(e[t]=l[t]);return u.current=new ye.default(d.current,e),()=>{v(),u.current=null}}),[]);const c=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.reset()},f=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.clear()},p=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.crop()},m=(e,t=!1)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.replace(e,t)},h=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.enable()},g=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.disable()},v=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.destroy()},y=(e,t)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.move(e,t)},b=(e,t=e)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.moveTo(e,t)},x=(e,t)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.zoom(e)},E=(e,t)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.zoomTo(e,t)},C=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.rotate(e)},w=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.rotateTo(e)},S=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.scaleX(e)},N=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.scaleY(e)},T=(e,t=e)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.scale(e,t)},I=(e=!1)=>{var t;return null===(t=u.current)||void 0===t?void 0:t.getData(e)},O=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.setData(e)},R=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.getContainerData()},k=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.getImageData()},L=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.getCanvasData()},P=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.setCanvasData(e)},A=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.getCropBoxData()},F=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.setCropBoxData(e)},_=(e={})=>{var t;return null===(t=u.current)||void 0===t?void 0:t.getCroppedCanvas(e)},D=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.setAspectRatio(e)},M=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.setDragMode(e)};q.default.useImperativeHandle(t,(()=>({reset:c,clear:f,initCrop:p,replace:m,enable:h,disable:g,destroy:v,move:y,moveTo:b,relativeZoom:x,zoomTo:E,rotate:C,rotateTo:w,scaleX:S,scaleY:N,scale:T,getData:I,setData:O,getContainerData:R,getImageData:k,getCanvasData:L,setCanvasData:P,getCropBoxData:A,setCropBoxData:F,getCroppedCanvas:_,setAspectRatio:D,setDragMode:M})));const H={[gt("cropper")]:!0};return q.default.createElement("div",{className:J.default(H,n),style:a},q.default.createElement("img",{ref:d,src:r,alt:i,style:Object.assign({maxWidth:"100%"},o)}))}));Ff.displayName="Cropper";const _f=e=>{const{fileTypes:t=[],fileSize:l,fixedSize:n,quality:a,beforeCrop:r,className:i}=e,{t:o}=ot(),s=q.default.useRef(null),u=q.default.useRef(),c=q.default.useRef(),f=q.default.useRef(),p=q.default.useRef(),[m,h]=q.default.useState(""),v=e=>{s.current.relativeZoom(e)},y=e=>{s.current.rotate(e)},b=()=>{h("")},x=gt("cropper-preview");return q.default.createElement(q.default.Fragment,null,(()=>{const t=Array.isArray(e.children)?e.children[0]:e.children;if(!t)return null;const l=t.props,{beforeUpload:n}=l,a=Ne(l,["beforeUpload"]);return u.current=n,q.default.createElement(t.type,Object.assign(Object.assign({},a),{beforeUpload:(e,t)=>new Promise(((l,n)=>Ie(void 0,void 0,void 0,(function*(){const n=()=>l(d.Upload.LIST_IGNORE);if(r&&!(yield r(e,t)))return void n();c.current=e,f.current=l,p.current=n;const a=new FileReader;a.onload=()=>{h(a.result),a.onload=null},a.readAsDataURL(e)}))))}))})(),m&&q.default.createElement(d.Modal,{open:!0,wrapClassName:J.default(x,i),title:o("qm.uploadCropper.cropper"),width:790,bodyStyle:{padding:10},onOk:()=>{Ie(void 0,void 0,void 0,(function*(){const{type:e,name:l,uid:n}=c.current;s.current.getCroppedCanvas({maxWidth:1920,fillColor:"image/png"===e?"transparent":"#fff",imageSmoothingEnabled:!1,imageSmoothingQuality:"high"}).toBlob((a=>Ie(void 0,void 0,void 0,(function*(){let r=new File([a],l,{type:e});if(Object.assign(r,{uid:n}),t.length&&!t.includes(r.name.slice(r.name.lastIndexOf(".")+1).toLowerCase()))return d.message.warning(o("qm.upload.tooltip",{type:t.join(",")})),p.current("file type is error");if("function"!=typeof u.current)return f.current(r);const i=u.current(r,[r]);if("boolean"==typeof i||i){if(!0===i)return f.current(r);if(!1===i)return p.current("not upload");if(i&&"function"==typeof i.then)try{const e=yield i,t=Object.prototype.toString.call(e);"[object File]"!==t&&"[object Blob]"!==t||(r=e),f.current(r)}catch(e){p.current(e)}}else ft("CropperPreview","`beforeUpload` 必须返回 `boolean` 或 `Promise` 类型")}))),e,a),yield Ae(100),b()}))},onCancel:b,maskClosable:!1,destroyOnClose:!0},(()=>{const e={width:"380px",height:n?`calc(380px * ${n[1]/n[0]})`:"auto"};return q.default.createElement("div",{className:"cropper-preview"},q.default.createElement("div",{className:"cropper-area"},q.default.createElement("div",{className:"img-cropper"},q.default.createElement(Ff,{ref:s,aspectRatio:n?n[0]/n[1]:n,src:m,dragMode:"move",preview:".preview"})),q.default.createElement("div",{className:"actions"},q.default.createElement(d.Space,{size:"small"},q.default.createElement(d.Button,{type:"primary",size:"middle",icon:q.default.createElement(g.ZoomInOutlined,null),onClick:()=>v(.2)},o("qm.uploadCropper.zoomIn")),q.default.createElement(d.Button,{type:"primary",size:"middle",icon:q.default.createElement(g.ZoomOutOutlined,null),onClick:()=>v(-.2)},o("qm.uploadCropper.zoomOut")),q.default.createElement(d.Button,{type:"primary",size:"middle",icon:q.default.createElement(g.RotateRightOutlined,null),onClick:()=>y(90)},o("qm.uploadCropper.rotatePlus")),q.default.createElement(d.Button,{type:"primary",size:"middle",icon:q.default.createElement(g.RotateLeftOutlined,null),onClick:()=>y(-90)},o("qm.uploadCropper.rotateSubtract"))))),q.default.createElement("div",{className:"preview-area"},q.default.createElement("div",{className:"preview",style:e})))})()))},Df=e=>{const t=je({name:"file",multiple:!0,accept:"image/*",listType:"picture-card"},e),{fileList:l=[],openCropper:n=!0,fixedSize:a,quality:r=1,fileTypes:i,fileSize:o,maxCount:s,draggable:u,disabled:c,readOnly:f,className:p,popupClassName:m,beforeCrop:h,onSortChange:v,onChange:y}=t,{t:b}=ot(),{$size:x}=dt(t),E=q.default.useRef(null),C=q.default.useRef(null),w=q.default.useRef(!1),[S,N]=q.default.useState(!1),[T,I]=q.default.useState(0),O=q.default.useMemo((()=>c||f),[c,f]),R=q.default.useMemo((()=>!s||l.length<s),[l,s]);q.default.useEffect((()=>(L(),document.addEventListener("paste",A),()=>{var e;null===(e=C.current)||void 0===e||e.destroy(),document.removeEventListener("paste",A)})),[]),Yl((()=>{R||(w.current=!1)}),[l]);const k=st((e=>{const{oldIndex:t,newIndex:n}=e;if(t!==n){const e=[...l],[a]=e.splice(t,1);e.splice(n,0,a),null==v||v(e),null==y||y({file:l[t],fileList:e})}})),L=()=>{u&&(C.current=ne.default.create(an(E.current,gt("upload-img")).querySelector(".ant-upload-list"),{animation:150,handle:".handle",filter:".ignore",draggable:".ant-upload-list-picture-card-container",onEnd:k}))},P=(e,l)=>new Promise(((n,a)=>Ie(void 0,void 0,void 0,(function*(){const{fileTypes:r=[],fileSize:i,beforeUpload:o}=t,s=!r.length||r.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),u=!i||e.size/1024/1024<i,c=s&&u;if(s||d.message.warning(b("qm.upload.tooltip",{type:r.join(",")})),u||d.message.warning(b("qm.upload.sizeLimit",{size:i})),!c)return d.Upload.LIST_IGNORE;if(o){const t=o(e,l);if(!0===t)return n(e);if(!1===t)return a("not upload");if(t&&"function"==typeof t.then)try{const e=yield t;n(e)}catch(e){a(e)}}else n(e)})))),A=st((e=>Ie(void 0,void 0,void 0,(function*(){const{action:n,data:a,headers:r}=t;if(w.current&&R&&n)for(const t of e.clipboardData.items)if("file"===t.kind&&t.type.startsWith("image/")){const e=t.getAsFile(),i=Date.now(),o=new File([e],`screenshot-${i}.png`,{type:e.type});Object.assign(o,{uid:`rc-upload-${i}`});try{yield P(o,[...l,o]);const e=new FormData;if(e.append("file",o),a)for(const t in a)e.append(t,a[t]);const t="string"==typeof n?n:yield n(o),i=yield fetch(t,{method:"POST",body:e,headers:r});if(!i.ok)throw new Error(b("qm.upload.uploadError"));const s=yield i.json();null==y||y({file:o,fileList:[...l,{uid:o.uid,lastModified:o.lastModified,lastModifiedDate:o.lastModifiedDate,name:o.name,type:o.type,size:o.size,response:s,status:"done",percent:100,originFileObj:o}]})}catch(e){}}})))),F=gt("upload-img"),_={[F]:!0,[`${F}--lg`]:"large"===x,[`${F}--sm`]:"small"===x},D=q.default.createElement(d.Upload,tt({className:J.default(_,p)},He(t,["fileTypes","fileSize","fixedSize","quality","openCropper","draggable","popupClassName"]),{beforeUpload:P,disabled:O,onPreview:e=>{const t=l.findIndex((t=>t.url===e.url));t<0||(I(t),N(!0))},showUploadList:{showRemoveIcon:!1,showDownloadIcon:!1},itemRender:(e,t,l,n)=>q.default.createElement("div",{className:J.default("upload-item",{handle:u})},e,!O&&q.default.createElement(g.CloseOutlined,{title:b("qm.upload.remove"),className:"icon",onClick:()=>n.remove()}))}),q.default.createElement("span",{className:"inner",ref:E},R&&!(f&&l.length)&&q.default.createElement(q.default.Fragment,null,q.default.createElement("p",{className:"ant-upload-drag-icon"},q.default.createElement(g.InboxOutlined,null)),q.default.createElement("p",{className:"ant-upload-text"},b("qm.uploadCropper.dragableText")),q.default.createElement("button",{className:J.default("ant-upload-button",{disabled:O}),onClick:e=>{e.stopPropagation(),e.preventDefault()},onFocus:()=>{w.current=!0},onBlur:()=>{w.current=!1}},b("qm.uploadCropper.pasteText")))));return q.default.createElement(q.default.Fragment,null,n?q.default.createElement(_f,{className:m,fixedSize:a,quality:r,fileTypes:i,fileSize:o,beforeCrop:h},D):D,q.default.createElement("div",{style:{display:"none"}},q.default.createElement(d.Image.PreviewGroup,{key:l.map((e=>e.uid||"")).join(","),preview:{visible:S,current:T,rootClassName:m,onVisibleChange:e=>N(e)}},l.map(((e,t)=>q.default.createElement(d.Image,{key:e.uid||t,src:e.url,alt:""}))))))};Df.displayName="QmUploadImg";const Mf=e=>{const{$$form:t}=q.default.useContext(Zn),{value:n,onChange:a,onValuesChange:r}=e,{options:i={},upload:o={},disabled:s,readOnly:u}=e.option,{multiple:c=!0,maxCount:f=1,fixedSize:p,quality:m,openCropper:h,fileTypes:g,fileSize:v,draggable:y,onRemove:b,onSortChange:x}=i,{action:E,headers:C,params:w,withCredentials:S=!1,dataKey:N="",popupClassName:T,fieldAliasMap:I,beforeUpload:O}=o,R="function"==typeof I?I():I||{},{t:k}=ot();return q.default.createElement(Df,{name:"file",action:E,multiple:c,headers:C,data:w,withCredentials:S,popupClassName:T,beforeUpload:O,maxCount:f,fixedSize:p,quality:m,openCropper:h,fileTypes:g,fileSize:v,draggable:y,disabled:s||t.props.disabled,readOnly:t.isOnlyShow||u,fileList:n,onChange:({fileList:e})=>{(e=>{const t=e.map((e=>{var t;const n=e.response||{},a={};for(const l in R)a[l]=e[l]||(null===(t=n.data)||void 0===t?void 0:t[R[l]])||"";return e.response&&200!==n.code&&d.message.error(n.message||k("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},a),{url:e.url||(N?l.get(n.data,N):n.data)||"",status:e.status})}));null==a||a(t),t.every((e=>"done"===e.status&&e.url))&&r(t)})(e)},onRemove:b,onSortChange:x})};class Hf extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Mf,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,"")}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Hf.contextType=Zn;const qf={onActivate:de.func,onAddUndo:de.func,onBeforeAddUndo:de.func,onBeforeExecCommand:de.func,onBeforeGetContent:de.func,onBeforeRenderUI:de.func,onBeforeSetContent:de.func,onBeforePaste:de.func,onBlur:de.func,onChange:de.func,onClearUndos:de.func,onClick:de.func,onContextMenu:de.func,onCommentChange:de.func,onCopy:de.func,onCut:de.func,onDblclick:de.func,onDeactivate:de.func,onDirty:de.func,onDrag:de.func,onDragDrop:de.func,onDragEnd:de.func,onDragGesture:de.func,onDragOver:de.func,onDrop:de.func,onExecCommand:de.func,onFocus:de.func,onFocusIn:de.func,onFocusOut:de.func,onGetContent:de.func,onHide:de.func,onInit:de.func,onKeyDown:de.func,onKeyPress:de.func,onKeyUp:de.func,onLoadContent:de.func,onMouseDown:de.func,onMouseEnter:de.func,onMouseLeave:de.func,onMouseMove:de.func,onMouseOut:de.func,onMouseOver:de.func,onMouseUp:de.func,onNodeChange:de.func,onObjectResizeStart:de.func,onObjectResized:de.func,onObjectSelected:de.func,onPaste:de.func,onPostProcess:de.func,onPostRender:de.func,onPreProcess:de.func,onProgressState:de.func,onRedo:de.func,onRemove:de.func,onReset:de.func,onSaveContent:de.func,onSelectionChange:de.func,onSetAttrib:de.func,onSetContent:de.func,onShow:de.func,onSubmit:de.func,onUndo:de.func,onVisualAid:de.func,onSkinLoadError:de.func,onThemeLoadError:de.func,onModelLoadError:de.func,onPluginLoadError:de.func,onIconsLoadError:de.func,onLanguageLoadError:de.func},$f=Object.assign({apiKey:de.string,id:de.string,inline:de.bool,init:de.object,initialValue:de.string,onEditorChange:de.func,value:de.string,tagName:de.string,cloudChannel:de.string,plugins:de.oneOfType([de.string,de.array]),toolbar:de.oneOfType([de.string,de.array]),disabled:de.bool,textareaName:de.string,tinymceScriptSrc:de.string,rollback:de.oneOfType([de.number,de.oneOf([!1])]),scriptLoading:de.shape({async:de.bool,defer:de.bool,delay:de.number})},qf),jf=e=>"function"==typeof e,Kf=e=>e in qf,Vf=e=>e.substr(2),zf=(e,t,l,n,a)=>((e,t,l,n,a,r,i)=>{const o=Object.keys(a).filter(Kf),s=Object.keys(r).filter(Kf),d=o.filter((e=>void 0===r[e])),u=s.filter((e=>void 0===a[e]));d.forEach((e=>{const t=Vf(e),n=i[t];l(t,n),delete i[t]})),u.forEach((l=>{const a=n(e,l),r=Vf(l);i[r]=a,t(r,a)}))})(a,e.on.bind(e),e.off.bind(e),((t,l)=>n=>{var a;return null===(a=t(l))||void 0===a?void 0:a(n,e)}),t,l,n);let Wf=0;const Bf=e=>{const t=Date.now(),l=Math.floor(1e9*Math.random());return Wf++,e+"_"+l+Wf+String(t)},Uf=e=>null!==e&&("textarea"===e.tagName.toLowerCase()||"input"===e.tagName.toLowerCase()),Gf=e=>void 0===e||""===e?[]:Array.isArray(e)?e:e.split(" "),Yf=(e,t)=>{void 0!==e&&(null!=e.mode&&"object"==typeof e.mode&&"function"==typeof e.mode.set?e.mode.set(t):e.setMode(t))},Xf=()=>({listeners:[],scriptId:Bf("tiny-script"),scriptLoading:!1,scriptLoaded:!1}),Qf=(()=>{let e=Xf();return{load:(t,l,n,a,r,i)=>{const o=()=>((e,t,l,n,a,r)=>{const i=t.createElement("script");i.referrerPolicy="origin",i.type="application/javascript",i.id=e,i.src=l,i.async=n,i.defer=a;const o=()=>{i.removeEventListener("load",o),r()};i.addEventListener("load",o),t.head&&t.head.appendChild(i)})(e.scriptId,t,l,n,a,(()=>{e.listeners.forEach((e=>e())),e.scriptLoaded=!0}));e.scriptLoaded?i():(e.listeners.push(i),e.scriptLoading||(e.scriptLoading=!0,r>0?setTimeout(o,r):o()))},reinitialize:()=>{e=Xf()}}})(),Zf=e=>{const t=e;return t&&t.tinymce?t.tinymce:null};class Jf extends $.Component{constructor(e){var t,l,n;super(e),this.rollbackTimer=void 0,this.valueCursor=void 0,this.rollbackChange=()=>{const e=this.editor,t=this.props.value;e&&t&&t!==this.currentContent&&e.undoManager.ignore((()=>{if(e.setContent(t),this.valueCursor&&(!this.inline||e.hasFocus()))try{e.selection.moveToBookmark(this.valueCursor)}catch(e){}})),this.rollbackTimer=void 0},this.handleBeforeInput=e=>{if(void 0!==this.props.value&&this.props.value===this.currentContent&&this.editor&&(!this.inline||this.editor.hasFocus()))try{this.valueCursor=this.editor.selection.getBookmark(3)}catch(e){}},this.handleBeforeInputSpecial=e=>{"Enter"!==e.key&&"Backspace"!==e.key&&"Delete"!==e.key||this.handleBeforeInput(e)},this.handleEditorChange=e=>{const t=this.editor;if(t&&t.initialized){const e=t.getContent();void 0!==this.props.value&&this.props.value!==e&&!1!==this.props.rollback&&(this.rollbackTimer||(this.rollbackTimer=window.setTimeout(this.rollbackChange,"number"==typeof this.props.rollback?this.props.rollback:200))),e!==this.currentContent&&(this.currentContent=e,"function"==typeof this.props.onEditorChange&&this.props.onEditorChange(e,t))}},this.handleEditorChangeSpecial=e=>{"Backspace"!==e.key&&"Delete"!==e.key||this.handleEditorChange(e)},this.initialise=(e=0)=>{var t,l,n;const a=this.elementRef.current;if(!a)return;if(!(e=>{if(!("isConnected"in Node.prototype)){let t=e,l=e.parentNode;for(;null!=l;)t=l,l=t.parentNode;return t===e.ownerDocument}return e.isConnected})(a)){if(0===e)setTimeout((()=>this.initialise(1)),1);else{if(!(e<100))throw new Error("tinymce can only be initialised when in a document");setTimeout((()=>this.initialise(e+1)),100)}return}const r=Zf(this.view);if(!r)throw new Error("tinymce should have been loaded into global scope");const i=Object.assign(Object.assign({},this.props.init),{selector:void 0,target:a,readonly:this.props.disabled,inline:this.inline,plugins:(o=null===(t=this.props.init)||void 0===t?void 0:t.plugins,s=this.props.plugins,Gf(o).concat(Gf(s))),toolbar:null!==(l=this.props.toolbar)&&void 0!==l?l:null===(n=this.props.init)||void 0===n?void 0:n.toolbar,setup:e=>{this.editor=e,this.bindHandlers({}),this.inline&&!Uf(a)&&e.once("PostRender",(t=>{e.setContent(this.getInitialValue(),{no_events:!0})})),this.props.init&&jf(this.props.init.setup)&&this.props.init.setup(e)},init_instance_callback:e=>{var t,l;const n=this.getInitialValue();this.currentContent=null!==(t=this.currentContent)&&void 0!==t?t:e.getContent(),this.currentContent!==n&&(this.currentContent=n,e.setContent(n),e.undoManager.clear(),e.undoManager.add(),e.setDirty(!1));const a=null!==(l=this.props.disabled)&&void 0!==l&&l;Yf(this.editor,a?"readonly":"design"),this.props.init&&jf(this.props.init.init_instance_callback)&&this.props.init.init_instance_callback(e)}});var o,s;this.inline||(a.style.visibility=""),Uf(a)&&(a.value=this.getInitialValue()),r.init(i)},this.id=this.props.id||Bf("tiny-react"),this.elementRef=$.createRef(),this.inline=null!==(n=null!==(t=this.props.inline)&&void 0!==t?t:null===(l=this.props.init)||void 0===l?void 0:l.inline)&&void 0!==n&&n,this.boundHandlers={}}get view(){var e,t;return null!==(t=null===(e=this.elementRef.current)||void 0===e?void 0:e.ownerDocument.defaultView)&&void 0!==t?t:window}componentDidUpdate(e){var t,l;if(this.rollbackTimer&&(clearTimeout(this.rollbackTimer),this.rollbackTimer=void 0),this.editor&&(this.bindHandlers(e),this.editor.initialized)){if(this.currentContent=null!==(t=this.currentContent)&&void 0!==t?t:this.editor.getContent(),"string"==typeof this.props.initialValue&&this.props.initialValue!==e.initialValue)this.editor.setContent(this.props.initialValue),this.editor.undoManager.clear(),this.editor.undoManager.add(),this.editor.setDirty(!1);else if("string"==typeof this.props.value&&this.props.value!==this.currentContent){const e=this.editor;e.undoManager.transact((()=>{let t;if(!this.inline||e.hasFocus())try{t=e.selection.getBookmark(3)}catch(e){}const l=this.valueCursor;if(e.setContent(this.props.value),!this.inline||e.hasFocus())for(const n of[t,l])if(n)try{e.selection.moveToBookmark(n),this.valueCursor=n;break}catch(e){}}))}if(this.props.disabled!==e.disabled){const e=null!==(l=this.props.disabled)&&void 0!==l&&l;Yf(this.editor,e?"readonly":"design")}}}componentDidMount(){var e,t,l,n,a,r;null!==Zf(this.view)?this.initialise():this.elementRef.current&&this.elementRef.current.ownerDocument&&Qf.load(this.elementRef.current.ownerDocument,this.getScriptSrc(),null!==(t=null===(e=this.props.scriptLoading)||void 0===e?void 0:e.async)&&void 0!==t&&t,null!==(n=null===(l=this.props.scriptLoading)||void 0===l?void 0:l.defer)&&void 0!==n&&n,null!==(r=null===(a=this.props.scriptLoading)||void 0===a?void 0:a.delay)&&void 0!==r?r:0,this.initialise)}componentWillUnmount(){const e=this.editor;e&&(e.off(this.changeEvents(),this.handleEditorChange),e.off(this.beforeInputEvent(),this.handleBeforeInput),e.off("keypress",this.handleEditorChangeSpecial),e.off("keydown",this.handleBeforeInputSpecial),e.off("NewBlock",this.handleEditorChange),Object.keys(this.boundHandlers).forEach((t=>{e.off(t,this.boundHandlers[t])})),this.boundHandlers={},e.remove(),this.editor=void 0)}render(){return this.inline?this.renderInline():this.renderIframe()}changeEvents(){var e,t,l;return(null===(l=null===(t=null===(e=Zf(this.view))||void 0===e?void 0:e.Env)||void 0===t?void 0:t.browser)||void 0===l?void 0:l.isIE())?"change keyup compositionend setcontent CommentChange":"change input compositionend setcontent CommentChange"}beforeInputEvent(){return window.InputEvent&&"function"==typeof InputEvent.prototype.getTargetRanges?"beforeinput SelectionChange":"SelectionChange"}renderInline(){const{tagName:e="div"}=this.props;return $.createElement(e,{ref:this.elementRef,id:this.id})}renderIframe(){return $.createElement("textarea",{ref:this.elementRef,style:{visibility:"hidden"},name:this.props.textareaName,id:this.id})}getScriptSrc(){if("string"==typeof this.props.tinymceScriptSrc)return this.props.tinymceScriptSrc;{const e=this.props.cloudChannel;return`https://cdn.tiny.cloud/1/${this.props.apiKey?this.props.apiKey:"no-api-key"}/tinymce/${e}/tinymce.min.js`}}getInitialValue(){return"string"==typeof this.props.initialValue?this.props.initialValue:"string"==typeof this.props.value?this.props.value:""}bindHandlers(e){if(void 0!==this.editor){zf(this.editor,e,this.props,this.boundHandlers,(e=>this.props[e]));const t=e=>void 0!==e.onEditorChange||void 0!==e.value,l=t(e),n=t(this.props);!l&&n?(this.editor.on(this.changeEvents(),this.handleEditorChange),this.editor.on(this.beforeInputEvent(),this.handleBeforeInput),this.editor.on("keydown",this.handleBeforeInputSpecial),this.editor.on("keyup",this.handleEditorChangeSpecial),this.editor.on("NewBlock",this.handleEditorChange)):l&&!n&&(this.editor.off(this.changeEvents(),this.handleEditorChange),this.editor.off(this.beforeInputEvent(),this.handleBeforeInput),this.editor.off("keydown",this.handleBeforeInputSpecial),this.editor.off("keyup",this.handleEditorChangeSpecial),this.editor.off("NewBlock",this.handleEditorChange))}}}var ep;Jf.propTypes=$f,Jf.defaultProps={cloudChannel:"6"},function(e){e["zh-cn"]="zh_CN",e["zh-tw"]="zh_TW",e.en="en"}(ep||(ep={}));const tp=e=>{var t;const{className:n,style:a,tinymce:r={},upload:i={},thresholdSize:o=.5,tinymceScriptSrc:s,disabled:u,value:c,onResizeEditor:f,onChange:p}=e,{global:m}=q.default.useContext(xe),{$size:h}=dt(e),{$locale:g,t:v}=ot(),y=400,b="preview importcss searchreplace autolink save directionality code visualblocks visualchars fullscreen image link media template codesample table charmap pagebreak nonbreaking anchor insertdatetime advlist lists wordcount help charmap quickbars emoticons",x="file edit view insert format tools table help",E="undo redo | blocks fontfamily fontsize | bold italic underline strikethrough | align numlist bullist | link image | table media | lineheight outdent indent| forecolor backcolor removeformat | charmap emoticons | code fullscreen preview | save print | pagebreak anchor codesample | ltr rtl",C=Object.assign(Object.assign({height:r.height||y,plugins:r.plugins||b,toolbar:r.toolbar||E,menubar:r.menubar||x,font_family_formats:"微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",font_size_formats:"10px 12px 14px 16px 18px 20px 24px 36px 48px 56px 72px",language:ep[g],skin:"tinymce-5"},He(r,["height","plugins","toolbar","menubar"])),{images_upload_handler:e=>{const{action:t,headers:n,dataKey:a,customHandler:r}=i;return r?r(e):new Promise(((r,i)=>Ie(void 0,void 0,void 0,(function*(){const s=`data:image/jpeg;base64,${e.base64()}`,u=new FormData;u.append("file",e.blob(),e.filename());const c=e.blob().size;if(t&&c/1024/1024>o)try{const e=yield fetch(t,{method:"POST",body:u,headers:n});if(!e.ok)throw i(""),new Error(v("qm.upload.uploadError"));const o=yield e.json();if(200===o.code){const e=a?l.get(o.data,a):o.data;r(e)}}catch(e){d.message.error(v("qm.uploadCropper.uploadError"))}else r(s)}))))},setup:e=>{e.on("ResizeEditor",(t=>{const{offsetWidth:l,offsetHeight:n}=e.editorContainer;null==f||f({width:l,height:n},t)}))}}),w=gt("tinymce"),S={[w]:!0,[`${w}--lg`]:"large"===h,[`${w}--sm`]:"small"===h},N={init:C,value:c,disabled:u,tinymceScriptSrc:s||(null===(t=null==m?void 0:m.tinymce)||void 0===t?void 0:t.scriptSrc)||void 0,onEditorChange:(e,t)=>{null==p||p(t.getContent(),t)}};return q.default.createElement("div",{className:J.default(S,n),style:a},q.default.createElement(Jf,N))};tp.displayName="QmTinymce";const lp=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{options:r={},upload:i,style:o={},readOnly:s,disabled:d=t.isFormDisabled}=e.option,{tinymce:u,thresholdSize:c,onResizeEditor:f}=r;return q.default.createElement(tp,{value:l,tinymce:u,upload:i,thresholdSize:c,style:Object.assign({width:"100%"},o),disabled:d||s||t.isOnlyShow,onResizeEditor:f,onChange:e=>{(e=>{null==n||n(e),a(e)})(e)}})};class np extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(lp,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,t)}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}np.contextType=Zn;class ap extends e.Component{constructor(e){var t;super(e),this.provide={$$form:this,echo_data:{}},this._fieldAuth={},this.wrapperRef=q.default.createRef(),this.formRef=q.default.createRef(),this.originItems=[],this.state={formData:{},viewData:{},other:{},extra:{},expand:{},flexCols:null!==(t=this.props.cols)&&void 0!==t?t:4,collapse:!!this.props.defaultExpand},this.resizeObserveHandler=()=>{var e;const t=null===(e=this.wrapperRef.current)||void 0===e?void 0:e.offsetWidth;if(void 0===t||0===t||this.props.cols>0)return;let l=Math.floor(t/300);l=24%l==0?l:l-1,l=l<1?1:l,l=l>8?8:l,l!==this.state.flexCols&&this.setState({flexCols:l})},this.resizeListenerHandle=l.debounce(this.resizeObserveHandler,10),this.getFormItems=oe.default((e=>e.filter((e=>!e.noAuth&&!e.hidden)))),this.getFlattenItems=oe.default((e=>{const t=[];return e.filter((e=>e.fieldName&&"DIVIDER"!==e.type)).forEach((e=>{l.isPlainObject(e.label)&&e.label.fieldName&&t.push(e.label),t.push(e)})),t})),this.valuesChangeHandle=(e,t)=>{var l,n;null===(n=(l=this.props).onValuesChange)||void 0===n||n.call(l,e,this._initialValues)},this.fieldsChangeHandle=(e,t)=>{var l,n;null===(n=(l=this.props).onFieldsChange)||void 0===n||n.call(l,e,t)},this.finishHandle=e=>{var t,l;null===(l=(t=this.props).onFinish)||void 0===l||l.call(t,Object.assign({},this.get_fields_other(),this.formatFormValue(e)))},this.finishFailedHandle=({values:e,errorFields:t})=>{var l,n;null===(n=(l=this.props).onFinishFailed)||void 0===n||n.call(l,t)},this.openValidateInfo=e=>{const t=q.default.createElement("ul",null,e.map((e=>{const{label:t}=this.formItems.find((t=>t.fieldName===e.name[0]));return q.default.createElement("li",{key:e.name[0],style:{color:"#ff4d4f"}},"[",("string"==typeof t?`${t}: `:"")+e.errors.join(","),"]")})));d.notification.error({message:Se("qm.form.validatePrompt"),description:t,duration:10})},this.scrollToField=e=>{if(!e)return;const t=this.wrapperRef.current.querySelector(`.${e}`);t&&re.default(t,{scrollMode:"if-needed",block:"nearest",behavior:"smooth"})},this.createOriginItems(),this.createInitialValues(),this.createInitialOthers(),this.createInitialExtras(),this.createFormAuth()}get $size(){var e,t;return null!==(t=null!==(e=this.props.size)&&void 0!==e?e:this.context.size)&&void 0!==t?t:""}get verticalLayout(){return"vertical"===this.props.layout}get formItems(){return this.getFormItems(this.props.items)}get flattenItems(){return this.getFlattenItems(this.formItems)}get dividers(){return this.formItems.filter((e=>"DIVIDER"===e.type))}get isFilterType(){return"search"===this.props.formType}get isOnlyShow(){return"onlyShow"===this.props.formType}get isFormDisabled(){return this.props.disabled}get isCompactMode(){var e,t;return null!==(e=this.props.compactMode)&&void 0!==e?e:"small"===this.$size&&!!(null===(t=this.context.global)||void 0===t?void 0:t.compactModeInSmallSize)}get showDividerCollapse(){return this.dividers.some((e=>!!e.collapse))}get showFilterCollapse(){return this.props.isCollapse&&this.formItems.length>=this.state.flexCols}componentDidMount(){this.checkFieldNames(),this.initialHandle(),this.createInputFocus(),this.bindResizeEvent(),this.resizeObserveHandler()}componentDidUpdate(e,t){this.props.items!==e.items&&this.checkFieldNames()}componentWillUnmount(){this.removeResizeEvent()}bindResizeEvent(){yn(this.wrapperRef.current,this.resizeListenerHandle)}removeResizeEvent(){bn(this.wrapperRef.current,this.resizeListenerHandle)}initialHandle(){this.setState({formData:this.createFormValue(this.props.initialValues),other:this.createOtherValue(this.props.initialValues),extra:this.createExtraValue(this.props.initialExtras),expand:this.createDividerExpand()})}checkFieldNames(){const e=this.flattenItems.map((e=>e.fieldName));[...new Set(e)].length!==e.length&&ft("Form","配置项 fieldName 属性是唯一的,不能重复")}getFormItemRequired(e=[]){return e.some((e=>e.required))}createOtherValue(e){const t=this.flattenItems.map((e=>e.fieldName)),l={};for(const n in e)t.includes(n)||(l[n]=e[n]);return Object.assign({},l)}createExtraValue(e){const t={};return this.flattenItems.filter((e=>l.isPlainObject(e.extra))).forEach((l=>{var n;t[l.fieldName]=null!==(n=e[l.fieldName])&&void 0!==n?n:""})),Object.assign({},t)}createDividerExpand(){const e={};return this.dividers.filter((e=>l.isPlainObject(e.collapse))).forEach((t=>{var l;e[t.fieldName]=null!==(l=t.collapse.defaultExpand)&&void 0!==l&&l})),Object.assign({},e)}getInitialValue(e,t){var l;const{type:n,options:a}=e;return t=null!=t?t:void 0,ir.includes(n)&&(t=null!=t?t:[]),"CHECKBOX"!==n&&"SWITCH"!==n||(t=null!==(l=null!=t?t:null==a?void 0:a.falseValue)&&void 0!==l?l:ar),t}createFormValue(e){const t={};return this.flattenItems.forEach((l=>{t[l.fieldName]=this.getInitialValue(l,e[l.fieldName])})),Object.assign({},e,t)}createInitialValues(){this._initialValues=this.createFormValue(this.props.initialValues)}createInitialOthers(){this._initialOthers=this.createOtherValue(this.props.initialValues)}createInitialExtras(){this._initialExtras=this.createExtraValue(this.props.initialExtras)}createOriginItems(){this.originItems=this.props.items.map((e=>({fieldName:e.fieldName,hidden:e.hidden})))}getOriginItems(){return this.originItems}setViewValue(e,t=""){t!==this.getViewValue(e)&&this.setState((l=>({viewData:Object.assign({},l.viewData,{[e]:t})})))}getViewValue(e){var t;return null!==(t=this.state.viewData[e])&&void 0!==t?t:""}setExpandHandle(e){e!==this.state.collapse&&this.setState({collapse:e},(()=>{Fe((()=>{var t,l;return null===(l=(t=this.props).onCollapse)||void 0===l?void 0:l.call(t,e)}))}))}createInputFocus(){const{isAutoFocus:e}=this.props;if(!e||this.isOnlyShow)return;const{type:t,fieldName:l}=this.formItems.filter((e=>e.fieldName))[0]||{};"INPUT"!==t&&"INPUT_NUMBER"!==t||!l||setTimeout((()=>this.CREATE_FOCUS(l)))}getFormItemLabel(e){var t,n,a,r,i;if(Cr(e))return ja(e);if(l.isPlainObject(e)){const{fieldName:l,label:o,options:s={}}=e;if(Cr(o))return ja(o);const{itemList:d=[]}=s,u=null!==(a=null!==(n=null===(t=this.formRef.current)||void 0===t?void 0:t.getFieldsValue([l])[l])&&void 0!==n?n:this._initialValues[l])&&void 0!==a?a:null===(r=d[0])||void 0===r?void 0:r.value;return(null===(i=d.find((e=>e.value===u)))||void 0===i?void 0:i.text)||""}return""}getBlockDerivedItems(){const e=[];for(let t=0,l=this.dividers.length;t<l;t++){const l=this.formItems.findIndex((e=>e===this.dividers[t]));let n=this.formItems.findIndex((e=>e===this.dividers[t+1]));n=n>-1?n:void 0,e.push(this.formItems.slice(l,n).map((e=>({label:e.label,fieldName:e.fieldName}))))}return e}getFormItemDisplay({type:e,fieldName:t}){var l,n;if("DIVIDER"===e)return!0;const a=this.getBlockDerivedItems();for(let e=0,r=a.length;e<r;e++){const r=a[e],i=this.dividers.find((e=>e.fieldName===r[0].fieldName)),o=null!==(n=null===(l=null==i?void 0:i.collapse)||void 0===l?void 0:l.showLimit)&&void 0!==n?n:r.length-1;for(let e=1;e<r.length;e++){if(r[e].fieldName===t&&e>o)return this.state.expand[r[0].fieldName]}}return!0}formatFormValue(e){var t,l;for(const n in e){const a=e[n];if(hr(a)&&(e[n]=""),Array.isArray(a)&&a.forEach(((t,l)=>{hr(t)&&(e[n][l]="")})),n.includes("|")&&Array.isArray(a)){const[r,i]=n.split("|");e[r]=null!==(t=a[0])&&void 0!==t?t:"",e[i]=null!==(l=a[1])&&void 0!==l?l:""}}if(this.isFilterType)for(const t in e)De(e[t])&&(e[t]=void 0);return e}setFieldAuth(e,t){this._fieldAuth[e]=t}createFormAuth(){var e,t,n;return Ie(this,void 0,void 0,(function*(){const{authConfig:a}=this.props;if(!a)return;let r=He(a,["fetch"]);if(a.fetch){const{api:t,params:n,dataKey:i}=a.fetch;try{const a=yield t(n);200===a.code&&(r=null!==(e=i?l.get(a.data,i):a.data)&&void 0!==e?e:{})}catch(e){}}if(Array.isArray(r.fieldList)){const e=this.props.items.map((e=>{const{fieldName:t}=e,l=r.fieldList.find((e=>e.dataIndex===t));if(l){const n=this.originItems.find((e=>e.fieldName===t)),{visible:a=1,disabled:r,secretName:i}=l;a||(e.noAuth=!0,n.noAuth=!0),r&&(e.disabled=!0,n.disabled=!0),i&&(e.options?e.options.secretType=i:e.options={secretType:i},n.options=Object.assign({},n.options,{secretType:i})),this.setFieldAuth(t,{visible:a,disabled:r,secretName:i})}return e}));null===(n=(t=this.props).fieldsChange)||void 0===n||n.call(t,e)}}))}INPUT(e){return q.default.createElement(Br,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT(e){return q.default.createElement(Gr,{option:e})}INPUT_NUMBER(e){return q.default.createElement(Xr,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT_NUMBER(e){return q.default.createElement(Zr,{option:e})}SEARCH_HELPER(e){return q.default.createElement(Ic,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}MULTIPLE_SEARCH_HELPER(e){return q.default.createElement(kc,{option:e})}TREE_TABLE_HELPER(e){return q.default.createElement(Mc,{option:e})}MULTIPLE_TREE_TABLE_HELPER(e){return q.default.createElement(qc,{option:e})}RANGE_SEARCH_HELPER(e){return q.default.createElement(Wc,{option:e})}CHECKBOX(e){return q.default.createElement(Vr,{option:e})}MULTIPLE_CHECKBOX(e){return q.default.createElement(Uc,{option:e})}RATE(e){return q.default.createElement(Yc,{option:e})}RADIO(e){return q.default.createElement(Qc,{option:e})}SWITCH(e){return q.default.createElement(Jc,{option:e})}TEXT_AREA(e){return q.default.createElement(tf,{option:e})}DATE(e){return q.default.createElement(nf,{option:e})}RANGE_DATE(e){return q.default.createElement(of,{option:e})}TIME(e){return q.default.createElement(df,{option:e})}RANGE_TIME(e){return q.default.createElement(cf,{option:e})}SELECT(e){return q.default.createElement(jr,{option:e})}MULTIPLE_SELECT(e){return q.default.createElement(jr,{option:e,multiple:!0})}IMMEDIATE(e){return q.default.createElement(pf,{option:e})}DIVIDER(e){return q.default.createElement(mf,{option:e})}TREE_SELECT(e){return q.default.createElement(vf,{option:e})}MULTIPLE_TREE_SELECT(e){return q.default.createElement(vf,{option:e,multiple:!0})}CASCADER(e){return q.default.createElement(bf,{option:e})}MULTIPLE_CASCADER(e){return q.default.createElement(bf,{option:e,multiple:!0})}CITY_SELECT(e){return q.default.createElement(Of,{option:e})}REGION_SELECT(e){return q.default.createElement(Lf,{option:e})}UPLOAD_FILE(e){return q.default.createElement(Af,{option:e})}UPLOAD_IMG(e){return q.default.createElement(Hf,{option:e})}TINYMCE(e){return q.default.createElement(np,{option:e})}renderFormLabel(e){if(Cr(e)||!l.isPlainObject(e))return q.default.createElement("span",{className:"text",title:ja(e)},e);const{type:t,fieldName:n,label:a,options:r={},onChange:i=Le}=e,{itemList:o=[]}=r;return"SELECT"===t?q.default.createElement(d.Form.Item,{name:n,noStyle:!0},q.default.createElement($r,{option:e,items:o,loading:!1,onValuesChange:(e,t)=>i(e,t)})):"CHECKBOX"===t?q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{className:"text",style:{paddingRight:5}},a),q.default.createElement(d.Form.Item,{name:n,noStyle:!0},q.default.createElement(Kr,{option:e,onValuesChange:e=>i(e)}))):null}renderFormItemExtra(e){const{fieldName:t,isTooltip:l,style:n,render:a}=e,{extra:r}=this.state;if(l)return q.default.createElement(d.Tooltip,{className:"extra-tooltip",title:r[t]},q.default.createElement(g.ExclamationCircleOutlined,{style:{marginLeft:4}}));const i=this.formItems.find((e=>e.fieldName===t)),{translate:o}=i,s=a?a(i,this):r[t],u=ja(s);return o&&u?q.default.createElement(Hr,{text:u,className:"extra-text",title:u,style:n},s):q.default.createElement("div",{className:"extra-text",title:u,style:n},s)}renderFormItemButton(e,t){const l=this.formItems.find((t=>t.fieldName===e)),n="function"==typeof t?t(l):t;return this.isOnlyShow?null:n}renderFormItem(e){const{label:t,fieldName:l,invisible:n,tooltip:a,className:r,labelWidth:i=this.props.labelWidth,validateTrigger:o,rules:s=[],style:u={},render:c}=e;return q.default.createElement(d.Form.Item,{label:this.renderFormLabel(t),name:l,rules:s,tooltip:a,hidden:n,className:J.default(r),style:Object.assign({width:"100%"},u),labelCol:{flex:this.verticalLayout?"initial":$e(i)},validateTrigger:o,messageVariables:{label:this.getFormItemLabel(t)}},this.formRef.current?c(e,this):q.default.createElement(q.default.Fragment,null))}createFormItem(e){return l.isFunction(this[e.type])?e.render?this.renderFormItem(e):this[e.type](e):(ft("Form",`配置项 ${e.fieldName} 的 type 类型错误`),null)}createFormLayout(){const{flexCols:e}=this.state,{formType:t,defaultRows:l,isFieldsDefine:n}=this.props,a=[];this.formItems.forEach((e=>{const{offsetLeft:t=0,offsetRight:l=0}=e;for(let e=0;e<t;e++)a.push({});a.push(e);for(let e=0;e<l;e++)a.push({})}));const r=24/e,i=[],o=a.reduce(((e,t)=>{const{selfCol:l=1}=t,n=e+l;return i.push(n),n}),0),s=l>Math.ceil(o/e)?Math.ceil(o/e):l,u=[],c=a.map(((t,l)=>{let{selfCol:n=1}=t;const{type:a,fieldName:o}=t;n=n>=24||"DIVIDER"===a||"TINYMCE"===a?e:n;const c=!(!this.state.collapse&&this.showFilterCollapse)||i[l]<s*e,f=!this.showDividerCollapse||this.getFormItemDisplay(t);return c&&u.push(i[l]),q.default.createElement(d.Col,{key:null!=o?o:l,className:o,span:n*r,style:this.isFilterType?{display:!this.showFilterCollapse||c?"block":"none"}:{display:f?"block":"none"}},a?this.createFormItem(qe(t)):null)}));return n&&"default"===t&&c.push(q.default.createElement("div",{className:"form-fields__define"},this.createFieldsDefine())),[...c,this.createSearchButtonLayout(u[u.length-1])]}createSearchButtonLayout(e=0){const{flexCols:t,collapse:l}=this.state,{searchButtonCols:n,isSearchBtn:a,isFieldsDefine:r=!0}=this.props;if(!this.isFilterType)return null;const i=24/t,o=n||1,s=t-e%t-o;return a?q.default.createElement(d.Col,{key:"-",span:o*i,offset:s*i,style:{textAlign:"right"}},q.default.createElement(d.Space,{style:{marginBottom:12}},q.default.createElement(pt,{type:"primary",size:this.$size,icon:q.default.createElement(g.SearchOutlined,null),onClick:()=>this.SUBMIT_FORM()},Se("qm.form.search")),q.default.createElement(pt,{size:this.$size,icon:q.default.createElement(g.ReloadOutlined,null),onClick:()=>this.RESET_FORM()},Se("qm.form.reset")),r?this.createFieldsDefine():null,this.showFilterCollapse&&q.default.createElement("a",{onClick:()=>this.setExpandHandle(!l)},l?q.default.createElement(g.UpOutlined,null):q.default.createElement(g.DownOutlined,null)," ",Se(l?"qm.form.collect":"qm.form.spread")))):null}createFormButtonLayout(){const{flexCols:e}=this.state,{formType:t,isSubmitBtn:l}=this.props;if(this.isFilterType)return null;const n=24/e;return l&&"default"===t?q.default.createElement(d.Row,{gutter:0},q.default.createElement(d.Col,{key:"-",span:n},q.default.createElement(d.Form.Item,null,q.default.createElement(d.Space,{style:{marginBottom:12}},q.default.createElement(pt,{type:"primary",size:this.$size,onClick:()=>this.SUBMIT_FORM()},Se("qm.form.save")),q.default.createElement(pt,{size:this.$size,onClick:()=>this.RESET_FORM()},Se("qm.form.reset")))))):null}createFieldsDefine(){const{uniqueKey:e,items:t,fieldsChange:l}=this.props;return q.default.createElement(zr,{uniqueKey:e,items:t,fieldsChange:l})}set_fields_other(e){this.setState((t=>({other:Object.assign({},t.other,this.createOtherValue(e))})))}get_fields_other(e){if(!e)return this.state.other;const t={};return e.forEach((e=>{t[e]=this.state.other[e]})),t}formValidate(){return new Promise(((e,t)=>Ie(this,void 0,void 0,(function*(){const[l,n]=yield this.VALIDATE_FIELDS(),a=this.formItems.filter((e=>"SEARCH_HELPER"===e.type)).filter((e=>{var t;return null===(t=this[`${e.fieldName}_Ref`])||void 0===t?void 0:t.searchRef._is_change})).map((e=>({name:[e.fieldName],errors:[Se("qm.form.searchHelperTips")],warnings:[]})));l||a.length?t((l||[]).concat(a)):e(n)}))))}SET_FIELDS_VALUE(e){this.formRef.current.setFieldsValue(e),this.set_fields_other(e)}GET_FIELDS_VALUE(e){return e?Object.assign({},this.get_fields_other(e),this.formRef.current.getFieldsValue(e)):Object.assign({},this.state.other,this.formRef.current.getFieldsValue(!0))}GET_FORM_DATA(){return Ie(this,void 0,void 0,(function*(){try{const e=yield this.formValidate();return[null,Object.assign({},this.get_fields_other(),this.formatFormValue(e))]}catch(e){return this.props.scrollToFirstError&&this.scrollToField(e[0].name[0]),[e,null]}}))}VALIDATE_FIELDS(e){return Ie(this,void 0,void 0,(function*(){try{return[null,yield this.formRef.current.validateFields(e)]}catch({errorFields:e}){return this.isCompactMode&&this.openValidateInfo(e),[e,null]}}))}SET_FIELDS_EXTRA(e){this.setState((t=>({extra:Object.assign({},t.extra,e)})))}SET_FIELDS_ECHO(e){Object.keys(e).length&&(Object.assign(this.provide,{echo_data:Object.assign({},this.provide.echo_data,e)}),this.forceUpdate())}GET_FIELDS_EXTRA(e){if(!e)return this.state.extra;const t={};return e.forEach((e=>{t[e]=this.state.extra[e]})),t}GET_FIELDS_TOUCHED(e){return this.formRef.current.isFieldsTouched(e)}SUBMIT_FORM(){return Ie(this,void 0,void 0,(function*(){try{yield this.formValidate(),this.formRef.current.submit()}catch(e){this.isFilterType&&this.setExpandHandle(!0)}}))}RESET_FORM(){var e,t;const l=this.flattenItems.filter((e=>e.noReset)).map((e=>e.fieldName)),n=this.flattenItems.map((e=>e.fieldName)).filter((e=>!l.includes(e)));n.length&&this.formRef.current.resetFields(n),this.setState((e=>{const t=Object.keys(e.other),l=Object.keys(this._initialOthers),n=t.filter((e=>!l.includes(e))),a={};return n.forEach((e=>a[e]=void 0)),{other:Object.assign({},this._initialOthers,a)}})),this.setState({extra:Object.assign({},this._initialExtras)}),null===(t=(e=this.props).onReset)||void 0===t||t.call(e)}CREATE_FOCUS(e){try{this[`${e}_Ref`].focus()}catch(e){ft("Form","参数 `fieldName` 的值不正确或者该表单项不支持获得焦点")}}SET_FORM_ITEM(e,t,n){const{items:a,fieldsChange:r}=this.props,i=a.find((t=>t.fieldName===e));if(!i)return ft("Form","SET_FORM_ITEM 方法参数 `fieldName` 的值不正确");if(!l.isPlainObject(t))return ft("Form","SET_FORM_ITEM 方法参数 `option` 的值不正确");if(i.noAuth)return ft("Form","SET_FORM_ITEM 方法不能操作受权限控制的表单项");for(const n in t)n&&(Object.keys(this._fieldAuth).includes(e)&&"disabled"===n||l.set(i,n,t[n]));n&&(r?r([...a]):ft("Form","需要设置 `fieldsChange` 参数"))}render(){var e,t;const{className:l,style:n,layout:a,disabled:r,labelWidth:i,labelAlign:o,labelWrap:s,customClass:u}=this.props,c=gt("form"),f=null!==(t=null!=s?s:null===(e=this.context.global)||void 0===e?void 0:e.labelWrap)&&void 0!==t&&t,p={required:"${label}"+Se("qm.form.requiredTips")},m={[c]:!0,[`${c}--lg`]:"large"===this.$size,[`${c}--sm`]:"small"===this.$size,[`${c}__only-show`]:this.isOnlyShow,[`${c}__label-wrap`]:f,[`${c}__compact`]:this.isCompactMode,[u]:!!u};return q.default.createElement("div",{ref:this.wrapperRef,className:J.default(m,l),style:n},q.default.createElement(d.Form,{ref:this.formRef,size:this.$size,initialValues:this._initialValues,layout:a,labelAlign:o,labelWrap:f,colon:!1,disabled:r,labelCol:{flex:this.verticalLayout?"initial":$e(i)},validateMessages:p,onValuesChange:this.valuesChangeHandle,onFieldsChange:this.fieldsChangeHandle,onFinish:this.finishHandle,onFinishFailed:this.finishFailedHandle},q.default.createElement(Zn.Provider,{value:this.provide},q.default.createElement(d.Row,{gutter:this.verticalLayout?20:0},this.createFormLayout()),this.createFormButtonLayout())))}}ap.contextType=xe,ap.propTypes=cr,ap.defaultProps=fr;const rp=e=>null!=e;function ip(e,t,l,n){const[a,r]=q.default.useState(void 0);q.default.useLayoutEffect((()=>{const t="function"==typeof e?e():e;r(t||null)}));const[i,o]=q.default.useState(null),s=()=>{if(a){!(e=>{const t=window.innerWidth||document.documentElement.clientWidth,l=window.innerHeight||document.documentElement.clientHeight,{top:n,right:a,bottom:r,left:i}=e.getBoundingClientRect();return n>=0&&i>=0&&a<=t&&r<=l})(a)&&t&&a.scrollIntoView(n);const{left:e,top:l,width:r,height:i}=a.getBoundingClientRect(),s={left:e,top:l,width:r,height:i,radius:0};o((e=>JSON.stringify(e)!==JSON.stringify(s)?s:e))}else o(null)};q.default.useLayoutEffect((()=>{s()}),[a,t]),Si({handler:s});return[q.default.useMemo((()=>{if(!i)return i;const e=(null==l?void 0:l.offset)||6,t=(null==l?void 0:l.radius)||2;return{left:i.left-e,top:i.top-e,width:i.width+2*e,height:i.height+2*e,radius:t}}),[i,l]),a]}const op={fill:"transparent",pointerEvents:"auto"},sp=e=>{const{prefixCls:t,rootClassName:l,pos:n,showMask:a,style:r={},fill:i="rgba(0,0,0,0.5)",open:o,animated:s,zIndex:d}=e,u=`${t}-mask-${pi()}`,c="object"==typeof s?null==s?void 0:s.placeholder:s;return q.default.createElement(ue.default,{open:o,autoLock:!0},q.default.createElement("div",{className:J.default(`${t}-mask`,l),style:Object.assign({position:"fixed",left:0,right:0,top:0,bottom:0,zIndex:d,pointerEvents:"none"},r)},a?q.default.createElement("svg",{style:{width:"100%",height:"100%"}},q.default.createElement("defs",null,q.default.createElement("mask",{id:u},q.default.createElement("rect",{x:"0",y:"0",width:"100vw",height:"100vh",fill:"white"}),n&&q.default.createElement("rect",{x:n.left,y:n.top,rx:n.radius,width:n.width,height:n.height,fill:"black",className:c?`${t}-placeholder-animated`:""}))),q.default.createElement("rect",tt({},n?null:op,{x:"0",y:"0",width:"100%",height:"100%",fill:i,mask:`url(#${u})`})),n&&q.default.createElement(q.default.Fragment,null,q.default.createElement("rect",tt({},op,{x:"0",y:"0",width:"100%",height:`${n.top}px`})),q.default.createElement("rect",tt({},op,{x:"0",y:"0",width:n.left,height:"100%"})),q.default.createElement("rect",tt({},op,{x:"0",y:n.top+n.height,width:"100%",height:`calc(100vh - ${n.top+n.height}px)`})),q.default.createElement("rect",tt({},op,{x:n.left+n.width,y:"0",width:`calc(100vw - ${n.left+n.width}px)`,height:"100%"})))):null))},dp=e=>{const{prefixCls:t,zIndex:l,open:n,onPause:a,onPlay:r}=e,[i,o]=yi(void 0,{value:n,postState:e=>null==e||e}),s=q.default.useRef(null),d=q.default.useRef(!1),u=st((e=>{c(e),e.shiftKey&&32===e.keyCode&&f()}));q.default.useEffect((()=>{const e=ae.default(document,"keyup",u);return()=>e.remove()}),[]);const c=e=>{e.stopPropagation(),e.preventDefault()},f=()=>{d.current?d.current=!1:(o(!i),i?null==a||a():null==r||r())};return q.default.createElement("div",{ref:s,className:`${t}-control`,style:{zIndex:l+1},onMouseDown:e=>{c(e);const t=s.current,l=t.offsetWidth,n=t.offsetHeight,a=window.innerWidth,r=window.innerHeight,i=e.clientX-nn(t).x,o=e.clientY-nn(t).y;return document.onmousemove=e=>{let s=e.clientX-i,u=e.clientY-o;s<0&&(s=0),s>a-l-1&&(s=a-l-1),u<0&&(u=0),u>r-n-1&&(u=r-n-1),en(t,{left:`${s}px`,top:`${u}px`}),d.current=!0},document.onmouseup=function(){this.onmousemove=null,this.onmouseup=null},!1},onClick:()=>f()},i?q.default.createElement(g.PauseOutlined,null):q.default.createElement(g.CaretRightOutlined,null))},up=e=>{const{prefixCls:t,current:l,total:n=0,cover:a,title:r,description:i,helper:o={},type:s,zIndex:u,onClose:c,onPrev:f,onNext:p,onFinish:m,className:h,indicatorsRender:v}=e,{t:y}=ot(),b="primary"!==s?"primary":"default",x=st((e=>{S(e),40===e.keyCode&&(l<n-1?null==p||p():null==m||m()),38===e.keyCode&&l>0&&(null==f||f())}));q.default.useEffect((()=>{const e=ae.default(document,"keyup",x);return()=>e.remove()}),[]);const E=rp(a)?q.default.createElement("div",{className:`${t}-cover`},a):null,C=rp(i)?q.default.createElement("div",{className:`${t}-description`},i):null;let w;w=v?v(l,n):[...Array.from({length:n}).keys()].map(((e,n)=>q.default.createElement("span",{key:e,className:J.default(n===l&&`${t}-indicator-active`,`${t}-indicator`)})));const S=e=>{e.stopPropagation(),e.preventDefault()};return q.default.createElement("div",{className:J.default(`${t}-content`,h)},q.default.createElement("div",{className:`${t}-inner`},q.default.createElement(g.CloseOutlined,{className:`${t}-close`,onClick:c}),o.content&&q.default.createElement(d.Popover,{placement:"bottom",overlayStyle:{width:360,zIndex:u},content:o.content,title:o.title},q.default.createElement(g.QuestionCircleOutlined,{className:J.default(`${t}-close`,"help-icon")})),E,q.default.createElement("div",{className:`${t}-header`},q.default.createElement("div",{className:`${t}-title`},r)),C,q.default.createElement("div",{className:`${t}-footer`},n>1&&q.default.createElement("div",{className:`${t}-indicators`},w),q.default.createElement(ht,{className:`${t}-buttons`},0!==l?q.default.createElement(pt,{className:`${t}-prev-btn`,size:"small",onMouseDown:S,onClick:f},y("qm.tour.prevStep")):null,l===n-1?q.default.createElement(pt,{className:`${t}-finish-btn`,type:b,size:"small",onClick:m},y("qm.tour.finish")):q.default.createElement(pt,{className:`${t}-next-btn`,type:b,size:"small",onMouseDown:S,onClick:p},y("qm.tour.nextStep"))))))},cp=e=>{const{current:t,renderPanel:l}=e;return q.default.createElement(q.default.Fragment,null,"function"==typeof l?l(e,t):q.default.createElement(up,e))},fp={left:"50%",top:"50%",width:1,height:1},pp=q.default.forwardRef(((e,t)=>{const{steps:l=[],defaultCurrent:n,current:a,onChange:r,onClose:i,onFinish:o,open:s,type:d="default",mask:u=!0,arrow:c=!0,control:f=!0,overlayClassName:p,overlayStyle:m,placement:h,helper:g,zIndex:v,renderPanel:y,indicatorsRender:b,gap:x,animated:E=!0,scrollIntoViewOptions:C=!0}=e,w=Ne(e,["steps","defaultCurrent","current","onChange","onClose","onFinish","open","type","mask","arrow","control","overlayClassName","overlayStyle","placement","helper","zIndex","renderPanel","indicatorsRender","gap","animated","scrollIntoViewOptions"]),S=q.default.useRef(),[N,T]=yi(0,{value:a,defaultValue:n}),[I,O]=yi(void 0,{value:s,postState:e=>!(N<0||N>=l.length)&&(null!=e&&e)}),[R,k]=yi(1051,{value:v,defaultValue:v}),[L,P]=q.default.useState(),A=q.default.useRef(I);q.default.useLayoutEffect((()=>{I&&!A.current&&T(0),A.current=I,P(I)}),[I]),q.default.useImperativeHandle(t,(()=>({OPEN:()=>O(!0),CLOSE:()=>O(!1),SET_ZINDEX:e=>k(e)})));const{target:F,type:_,placement:D,trigger:M,delay:H,style:$,arrow:j,className:K,mask:V,scrollIntoViewOptions:z,zIndex:W,action:B}=l[N]||{},U=W||R,G=_||d,Y=I&&(null!=V?V:u),X=null!=z?z:C,[Q,Z]=ip(F,!!s,x,X),ee=((e,t,l)=>{var n;return null!==(n=null!=l?l:t)&&void 0!==n?n:null===e?"center":"bottom"})(Z,h,D),te=!!Z&&(void 0===j?c:j),le="object"==typeof te&&te.pointAtCenter;q.default.useLayoutEffect((()=>{var e;null===(e=S.current)||void 0===e||e.forceAlign()}),[le,N]),Yl((()=>{I&&(re(),null==B||B(Z,N))}),[I,Z]);const ne=e=>{T(e),null==r||r(e)},ae=()=>{O(!1),null==i||i(N)},re=()=>{if(!Z)return;const e=[];!function t(l){if(1===l.nodeType){var n;"INPUT"!==l.tagName&&"TEXTAREA"!==l.tagName||("none"===Jl(n=l,"display")||"hidden"===Jl(n,"visibility")||"0"===Jl(n,"opacity"))||e.push(l);for(const e of Array.from(l.childNodes))t(e)}}(Z),e.length&&e[0].focus()};if(void 0===Z)return null;const ie=()=>Ie(void 0,void 0,void 0,(function*(){if(!M||!Z)return;const{left:e,top:t}=Z.getBoundingClientRect(),l=Z.offsetWidth,n=Z.offsetHeight,[a,r]=[e+l/2,t+n/2],i=new MouseEvent(M,{bubbles:!0,cancelable:!0,button:0,clientX:a,clientY:r}),o=document.elementFromPoint(a,r);o&&(o.dispatchEvent(i),yield Ae(null!=H?H:320))})),oe="boolean"==typeof Y?Y:!!Y,se="boolean"==typeof Y?void 0:Y,de=Object.assign({},m,$),ce=gt("tour"),fe=[{[`${ce}-primary`]:"primary"===G},p,K],pe=dd({arrowPointAtCenter:le,autoAdjustOverflow:!0,offset:6,arrowWidth:16,borderRadius:8});return q.default.createElement(q.default.Fragment,null,q.default.createElement(sp,{zIndex:U,prefixCls:ce,pos:Q,showMask:oe,style:null==se?void 0:se.style,fill:null==se?void 0:se.color,open:L,animated:E,rootClassName:p}),q.default.createElement(ue.default,{open:L,autoLock:!0},q.default.createElement(me.default,tt({ref:S},w,{zIndex:U,builtinPlacements:pe,popupStyle:de,popupPlacement:ee,popupVisible:L,popupClassName:J.default(fe),prefixCls:ce,popup:()=>q.default.createElement(cp,tt({key:"content",arrow:te,prefixCls:ce,total:l.length,helper:g,renderPanel:y,indicatorsRender:b,onPrev:()=>Ie(void 0,void 0,void 0,(function*(){yield ie(),ne(N-1)})),onNext:()=>Ie(void 0,void 0,void 0,(function*(){yield ie(),ne(N+1)})),onClose:ae,current:N,onFinish:()=>{ae(),null==o||o()}},Object.assign({},l[N],{zIndex:U,type:G}))),arrow:!!te,getTriggerDOMNode:e=>e||Z||document.body,forceRender:!1,destroyPopupOnHide:!0}),q.default.createElement("div",{className:J.default(p,`${ce}-target-placeholder`),style:Object.assign(Object.assign({},Q||fp),{position:"fixed",pointerEvents:"none"})}))),f&&q.default.createElement(ue.default,{open:I},q.default.createElement(dp,{zIndex:U,prefixCls:ce,onPause:()=>P(!1),onPlay:()=>P(!0)})))}));pp.displayName="QmTour";var mp={previewWidth:1100,defaultDistance:.45,logoHeight:60};const hp=e.createContext(void 0);var gp=null;function vp(){try{var e=navigator.userAgent;if(e.match(/Windows\sPhone/i))return!0;if(e.match(/iPhone|iPod|iPad/i))return!0;if(e.match(/Android/i))return!0;if(e.match(/Edge\D?\d+/i))return!0;var t=e.match(/Trident\D?\d+/i),l=e.match(/MSIE\D?\d+/i),n=e.match(/OPR\D?\d+/i),a=e.match(/Firefox\D?\d+/i),r=e.match(/x64/i);if(!t&&!l&&r)return!0;if(a){if((a=a[0].match(/\d+/))[0]>=41||r)return!0}else if(n){if((n=n[0].match(/\d+/))[0]>=32)return!0}else if(!t&&!l){var i=e.match(/Chrome\D?\d+/i);if(i&&(i=i[0].match(/\d+/))[0]>=41)return!0}return!1}catch(e){return!0}}function yp(e,t){var l;try{var n=navigator.userAgent,a=!!n.match(/MSIE/i)||!!n.match(/Trident/i);if(vp()){try{l=getCLodop()}catch(e){}if(!l&&"complete"!==document.readyState)return void d.message.warning("打印组件还没有加载完毕,请稍等一下再操作");if(!l)return;CLODOP.CVERSION,t&&t.parentNode&&t.parentNode.removeChild(t),e&&e.parentNode&&e.parentNode.removeChild(e)}else{a&&n.match(/x64/i);if(e||t?l=a?e:t:gp?l=gp:((l=document.createElement("object")).setAttribute("width",0),l.setAttribute("height",0),l.setAttribute("style","position:absolute;left:0px;top:-100px;width:0px;height:0px;"),a?l.setAttribute("classid","clsid:2105C259-1E0C-4534-8141-A753534CB4CA"):l.setAttribute("type","application/x-print-lodop"),document.documentElement.appendChild(l),gp=l),!l||!l.VERSION)return n.indexOf("Chrome"),n.indexOf("Firefox"),l}return l.VERSION<"6.2.2.6"&&vp(),l}catch(e){d.message.error("getLodop 出错:"+e)}}vp();const bp=e=>{const t=e/25.4*(()=>{var e;const t=[],{deviceXDPI:l,deviceYDPI:n}=window.screen;if(l&&n)t[0]=l,t[1]=n;else{let l=document.createElement("DIV");l.style.cssText="width: 1in; height: 1in; position: absolute; left: 0px; top: 0px; z-index: -1; visibility: hidden;",document.body.appendChild(l),t[0]=parseInt(l.offsetWidth.toString()),t[1]=parseInt(l.offsetHeight.toString()),null===(e=l.parentNode)||void 0===e||e.removeChild(l),l=null}return t})()[0];return Math.ceil(t)},xp=q.default.forwardRef(((e,t)=>{const{templateRender:l,directPrint:n}=e,{global:a}=q.default.useContext(xe),{$$preview:r}=q.default.useContext(hp),{state:i,isWindowsPrinter:o,pageSize:s}=r,d=q.default.useRef(null),u=q.default.useRef({}),c=q.default.useRef([]),f=q.default.useRef([]),p=q.default.useRef([]),[m,h]=q.default.useState(!0);q.default.useImperativeHandle(t,(()=>({createPreviewDom:O,createExportHtml:k,createPrintHtml:R,SHOW_PREVIEW:L,DIRECT_PRINT:P}))),Yl((()=>{I()}),[i.form.printerType,i.form.setting.direction,i.form.setting.distance,i.form.setting.fixedLogo]),q.default.useEffect((()=>{u.current.templateEl=d.current.querySelector(".origin-template").children[0],u.current.previewEl=d.current.querySelector(".workspace")}),[]);const g=q.default.useMemo((()=>{const{form:{setting:{direction:e}}}=i,t=o?10*mp.defaultDistance+10*mp.defaultDistance:0;return("vertical"===e?s[0]:s[1])-t}),[i,o,s]),v=q.default.useMemo((()=>{const{form:{setting:{direction:e}}}=i,t=o?10*mp.defaultDistance+10*mp.defaultDistance:0;return("vertical"===e?s[1]:s[0])-t}),[i,o,s]),y=q.default.useMemo((()=>{const{form:{setting:{distance:e}}}=i;return bp(g-10*(e.left-mp.defaultDistance)-10*(e.right-mp.defaultDistance))}),[i,g]),b=q.default.useMemo((()=>{const{form:{setting:{distance:e}}}=i;return bp(v-10*(e.top-mp.defaultDistance)-10*(e.bottom-mp.defaultDistance))}),[i,v]),x=i.form.scale,E=q.default.useMemo((()=>{const{form:{setting:{distance:e}}}=i;return{left:bp(10*e.left),right:bp(10*e.right),top:bp(10*e.top),bottom:bp(10*e.bottom)}}),[i]),C=q.default.useMemo((()=>{const{form:{printerType:e}}=i,{left:t,right:l,top:n,bottom:a}=E,r=y+t+l,o=mp.previewWidth-r<=0?0:(mp.previewWidth-r)/2,s=Math.abs((1-x)*r/2);let d=0;return x>1&&(d=s>o?-1*o:-1*s),x<1&&(d=r-2*s>mp.previewWidth?0:o>0?s:(mp.previewWidth-(r-2*s))/2),{width:`${y}px`,height:""+("stylus"===e?"auto":b+"px"),paddingLeft:`${t}px`,paddingRight:`${l}px`,paddingTop:`${n}px`,paddingBottom:`${a}px`,transform:`translateX(${d}px) scale(${x})`,opacity:m?0:1}}),[i,m,E,x,b,y]);c.current.some((e=>/^<tr[^>]+type="page-break"[^>]+><\/tr>$/.test(e)));const w=()=>{var e,t,l,n;const r=null!==(t=null===(e=null==a?void 0:a.print)||void 0===e?void 0:e.leftLogo)&&void 0!==t?t:"",i=null!==(n=null===(l=null==a?void 0:a.print)||void 0===l?void 0:l.rightLogo)&&void 0!==n?n:"";return[`<tr style="height: ${mp.logoHeight}px;">`,'<td colspan="8" align="left" style="vertical-align: top;">',r?`<img src="${r}" border="0" height="46" />`:"","</td>",'<td colspan="16" align="right" style="vertical-align: top;">',i?`<img src="${i}" border="0" height="46" />`:"","</td>","</tr>"].join("")},S=()=>{let e='<tr style="height: 0;">';for(let t=0;t<24;t++)e+=`<td width="${100/24}%" style="width: ${100/24}%; padding: 0;"></td>`;return e+="</tr>",e},N=()=>{let e=document.createElement("tr");var t,l;e.setAttribute("type","template-cols"),e.style.height="0",e.innerHTML=S().replace(/<tr[^>]+>/,"").replace(/<\/tr>/,""),t=e,(l=u.current.templateEl.children[0]).children[0]?l.insertBefore(t,l.children[0]):l.appendChild(t),e=null},T=()=>{const e=u.current.templateEl.children[0].children,t=[],l=[];for(let n=0;n<e.length;n++){if("template-cols"===e[n].getAttribute("type"))continue;const a=e[n].clientHeight;e[n].style.height=a+"px",l.push(a),t.push(e[n].outerHTML)}f.current=l,c.current=t},I=()=>{var e;if(!c.current.length)return;const{form:{setting:t,printerType:l}}=i;if(n)return p.current.push([S(),w(),...c.current]);const a=t.fixedLogo?b-mp.logoHeight:b;let o=[];if(p.current=[],"stylus"===l)p.current.push([S(),...t.fixedLogo?[w()]:[],...c.current]);else{let e=0;for(let l=0,n=f.current.length;l<n;l++){const r=c.current[l],i=f.current[l];t.fixedLogo||0!==l||(e+=mp.logoHeight),e+=i,e<=a?o.push(r):(p.current.push([S(),...t.fixedLogo?[w()]:[],...o]),o=[],e=0,l-=1),l===n-1&&o.length&&p.current.push([S(),...t.fixedLogo?[w()]:[],...o])}}t.fixedLogo||null===(e=p.current[0])||void 0===e||e.splice(1,0,w());for(let e=0,t=p.current.length;e<t&&e!==t-1;e++)p.current[e].push('<tr type="page-break" style="page-break-after: always;"></tr>');r.setState({currentPage:1,totalPage:p.current.length}),O()},O=()=>{var e,t;const{currentPage:l}=i;let n=`<table cellspacing="0" cellpadding="0" border="0" class="${u.current.templateEl.className}">`;n+=null!==(t=null===(e=p.current[l-1])||void 0===e?void 0:e.join(""))&&void 0!==t?t:"",n+="</table>",u.current.previewEl.innerHTML=n,u.current.previewEl.parentNode.scrollTop=0},R=e=>{let t=`<table cellspacing="0" cellpadding="0" border="0" class="${u.current.templateEl.className}">`;if(void 0!==e){t+=[...p.current[e-1]].join("")}else for(let e=0;e<p.current.length;e++)t+=p.current[e].join("");return t+="</table>",t},k=()=>{const e=[];for(let t=0;t<c.current.length;t++)e[t]=c.current[t].replace(/\s+/g," ").replace(/(<td[^>]+>)\s+/,"$1").replace(/\s+(<\/td>)/,"$1");return"<table>"+w()+S()+e.join("")+"</table>"},L=()=>Ie(void 0,void 0,void 0,(function*(){var e;if("TABLE"!==(null===(e=u.current.templateEl)||void 0===e?void 0:e.tagName))return A();u.current.previewEl.innerHTML||(N(),yield Ae(0),T(),I(),h(!1))})),P=()=>Ie(void 0,void 0,void 0,(function*(){var e;if("TABLE"!==(null===(e=u.current.templateEl)||void 0===e?void 0:e.tagName))return A();N(),yield Ae(0),T(),I(),h(!1),r.doPrint(R()),yield Ae(0),r.doClose()})),A=()=>{ft("Print","[PrintTemplate] 打印模板组件的根元素必须是 `table` 节点")},F={[gt("print-container")]:!0,"no-visible":n};return q.default.createElement("div",{ref:d,className:J.default(F)},q.default.createElement(mn,{wrapperClassName:"spin",spinning:m,tip:"Loading..."},q.default.createElement("div",{className:"preview"},q.default.createElement("div",{className:"origin-template",style:{width:`${y}px`,marginLeft:`-${Math.floor(y/2)}px`}},null==l?void 0:l()),q.default.createElement("div",{className:"workspace",style:C}))))}));xp.displayName="Container";class Ep extends e.Component{constructor(){super(...arguments),this.formRef=q.default.createRef(),this.createFormList=()=>[{type:"DIVIDER",fieldName:"_1",label:Se("qm.print.setPanel.printParameter")},{type:"SELECT",label:Se("qm.print.setPanel.pagerType"),fieldName:"pageSize",options:{itemList:[{text:"A2",value:"420*594"},{text:"A3",value:"420*297"},{text:"A4",value:"210*297"},{text:"A5",value:"210*148"},{text:Se("qm.print.setPanel.carbonPaper"),value:"241*280"}]}},{type:"RADIO",label:Se("qm.print.setPanel.printDirection"),fieldName:"direction",options:{itemList:[{text:Se("qm.print.setPanel.vertical"),value:"vertical"},{text:Se("qm.print.setPanel.horizontal"),value:"horizontal"}]}},{type:"CHECKBOX",fieldName:"doubleSide",label:{type:"SELECT",fieldName:"doubleSideType",options:{itemList:[{text:Se("qm.print.setPanel.autoDoublePrint"),value:"auto"},{text:Se("qm.print.setPanel.manualDoublePrint"),value:"manual"}]},disabled:!this.props.setting.doubleSide},options:{trueValue:1,falseValue:0},onChange:e=>{const{formList:t}=this.state;t.find((e=>"doubleSide"===e.fieldName)).label.disabled=!e,this.setState({formList:t})}},{type:"CHECKBOX",label:Se("qm.print.setPanel.fixedLogo"),fieldName:"fixedLogo",options:{trueValue:1,falseValue:0}},{type:"DIVIDER",fieldName:"_2",label:Se("qm.print.setPanel.printMargin")},{type:"INPUT_NUMBER",label:Se("qm.print.setPanel.leftMargin"),fieldName:"disleft",options:{min:mp.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Se("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Se("qm.print.setPanel.rightMargin"),fieldName:"disright",options:{min:mp.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Se("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Se("qm.print.setPanel.topMargin"),fieldName:"distop",options:{min:mp.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Se("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Se("qm.print.setPanel.bottomMargin"),fieldName:"disbottom",options:{min:mp.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Se("qm.print.setPanel.noEmpty")}]}],this.getInitialvalue=()=>{const{setting:e}=this.props,{distance:t}=e;return Object.assign({},{disleft:t.left,disright:t.right,distop:t.top,disbottom:t.bottom,pageSize:e.pageSize,direction:e.direction,doubleSide:e.doubleSide,doubleSideType:e.doubleSideType,fixedLogo:e.fixedLogo})},this.getInitialExtra=()=>({disleft:Se("qm.print.setPanel.sizeUnit"),disright:Se("qm.print.setPanel.sizeUnit"),distop:Se("qm.print.setPanel.sizeUnit"),disbottom:Se("qm.print.setPanel.sizeUnit")}),this.state={formList:this.createFormList()},this.confirmHandle=()=>Ie(this,void 0,void 0,(function*(){const[e,t]=yield this.formRef.current.GET_FORM_DATA();e||(this.props.onChange({distance:{left:t.disleft,right:t.disright,top:t.distop,bottom:t.disbottom},pageSize:t.pageSize,direction:t.direction,doubleSide:t.doubleSide,doubleSideType:t.doubleSideType,fixedLogo:t.fixedLogo}),this.cancelHandle())})),this.cancelHandle=()=>{this.props.onClose()}}render(){const{formList:e}=this.state;return q.default.createElement(q.default.Fragment,null,q.default.createElement(ap,{ref:this.formRef,items:e,initialValues:this.getInitialvalue(),initialExtras:this.getInitialExtra(),labelWidth:120,cols:2}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(pt,{onClick:()=>this.cancelHandle(),style:{marginRight:8}},Se("qm.dialog.close")),q.default.createElement(pt,{type:"primary",onClick:()=>this.confirmHandle()},Se("qm.dialog.confirm"))))}}Ep.contextType=xe;class Cp extends e.Component{constructor(){var e,t,l;super(...arguments),this.provide={$$preview:this},this.containRef=q.default.createRef(),this.state={visible:!1,form:{printerName:-1,printerType:(null===(e=this.props.defaultConfig)||void 0===e?void 0:e.printerType)||"laser",copies:(null===(t=this.props.defaultConfig)||void 0===t?void 0:t.copies)||1,scale:1,setting:{distance:{left:mp.defaultDistance,right:mp.defaultDistance,top:mp.defaultDistance,bottom:mp.defaultDistance},pageSize:"210*297",direction:(null===(l=this.props.defaultConfig)||void 0===l?void 0:l.direction)||"vertical",doubleSide:0,doubleSideType:"auto",fixedLogo:0}},printPage:void 0,currentPage:1,totalPage:0},this.pageChangeHandle=e=>{this.setState({currentPage:e},(()=>{this.containRef.current.createPreviewDom()}))},this.exportClickHandle=()=>{this.doExport(this.containRef.current.createExportHtml())},this.printClickHandle=()=>Ie(this,void 0,void 0,(function*(){if(this.doPrint(this.containRef.current.createPrintHtml(this.state.printPage)),this.props.uniqueKey)try{const e=Object.assign(Object.assign({},this.state.form),{printerName:this.printerItems.find((e=>e.value===this.state.form.printerName)).text});yield pe.default.setItem(this.printerKey,e),yield this.savePrintConfig(this.printerKey,e)}catch(e){}})),this.doClose=()=>{var e,t;null===(t=(e=this.props).onClose)||void 0===t||t.call(e)},this.getPrintConfig=e=>Ie(this,void 0,void 0,(function*(){const t=this.context.global,l=null==t?void 0:t.getComponentConfigApi;if(l)try{const t=yield l({key:e});if(200===t.code)return t.data}catch(e){}})),this.savePrintConfig=(e,t)=>Ie(this,void 0,void 0,(function*(){const l=this.context.global,n=null==l?void 0:l.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),this.createStyle=()=>'\n <style type="text/css">\n table {\n width: 100%;\n border-spacing: 0;\n border-collapse: collapse;\n table-layout: fixed;\n }\n table tr td {\n padding: 2px;\n line-height: 1.2;\n word-wrap: break-word;\n }\n .fs12 {\n font-size: 12px;\n }\n .fs13 {\n font-size: 13px;\n }\n .fs14 {\n font-size: 14px;\n }\n .fw500 {\n font-weight: 500;\n }\n .fw700 {\n font-weight: 700;\n }\n .fl {\n float: left;\n }\n .fr {\n float: right;\n }\n .tc {\n text-align: center;\n }\n .tr {\n text-align: right;\n }\n .bor {\n border: 1px solid #000;\n }\n .bor-t {\n border-top: 1px solid #000;\n }\n .bor-b {\n border-bottom: 1px solid #000;\n }\n .bor-l {\n border-left: 1px solid #000;\n }\n .bor-r {\n border-right: 1px solid #000;\n }\n .no-bor {\n border: none !important;\n }\n </style>\n ',this.doPrint=e=>{const t=yp();if(!t)return;const{uniqueKey:l,closeAfterPrint:n}=this.props,{form:{setting:a,printerName:r,printerType:i,copies:o}}=this.state,{pageSize:s}=this,{defaultDistance:u}=mp,{left:c,right:f,top:p,bottom:m}=a.distance;t.PRINT_INIT(null!=l?l:Math.random().toString().slice(2)),t.SET_PRINTER_INDEX(r),t.SET_PRINT_COPIES(o),a.doubleSide&&("auto"===a.doubleSideType?(t.SET_PRINT_MODE("PRINT_DUPLEX",2),t.SET_PRINT_MODE("PRINT_DEFAULTSOURCE",1)):t.SET_PRINT_MODE("DOUBLE_SIDED_PRINT",1)),t.SET_PRINT_MODE("AUTO_CLOSE_PREWINDOW",1),"laser"===i&&("vertical"===a.direction&&t.SET_PRINT_PAGESIZE(1),"horizontal"===a.direction&&(t.SET_PRINT_PAGESIZE(2),t.SET_SHOW_MODE("LANDSCAPE_DEFROTATED",1))),"stylus"===i&&t.SET_PRINT_PAGESIZE(3,10*s[0],100*m*2,""),t.ADD_PRINT_TABLE(10*(p-u)+"mm",10*(c-u)+"mm",`RightMargin: ${10*(f-u)}mm`,`BottomMargin: ${"stylus"!==i?10*(m-u):0}mm`,this.createStyle()+e),t.On_Return=(e,t)=>{t?n&&this.doClose():d.message.error(Se("qm.print.printError"))},t.PRINT()},this.doExport=e=>{const t=yp();if(!t)return;const{uniqueKey:l,closeAfterPrint:n}=this.props,{form:{setting:a}}=this.state;t.PRINT_INIT(null!=l?l:Math.random().toString().slice(2)),t.On_Return=(e,t)=>{t?n&&this.doClose():d.message.error(Se("qm.print.exportError"))},t.ADD_PRINT_TABLE(0,0,"RightMargin: 0","BottomMargin: 0",this.createStyle()+e),t.SET_SAVE_MODE("Orientation","vertical"===a.direction?1:2),t.SAVE_TO_FILE(`${j.default().format("YYYYMMDDHHmmss")}.xlsx`)}}get printerTypeItems(){return[{text:Se("qm.print.laserPrinter"),value:"laser"},{text:Se("qm.print.stylusPrinter"),value:"stylus"}]}get printerItems(){const e=yp(),t=[{text:Se("qm.print.defaultPrinter"),value:-1}];try{const l=e.GET_PRINTER_COUNT();for(let n=0;n<l;n++)t.push({text:e.GET_PRINTER_NAME(n),value:n})}catch(e){ft("Print","[ClientPrint]: 请安装 LODOP 打印插件")}return t}get isWindowsPrinter(){const{form:{printerName:e}}=this.state;return!/OneNote|Microsoft|Fax/.test(this.printerItems.find((t=>t.value===e)).text)}get pageSize(){return this.state.form.setting.pageSize.split("*").map((e=>Number(e)))}get printerKey(){return this.props.uniqueKey?`print_${this.props.uniqueKey}`:""}componentDidMount(){var e,t;return Ie(this,void 0,void 0,(function*(){if(this.props.uniqueKey)try{let n=yield pe.default.getItem(this.printerKey);n||(n=yield this.getPrintConfig(this.printerKey),l.isPlainObject(n)&&(yield pe.default.setItem(this.printerKey,n))),l.isPlainObject(n)&&Object.keys(n).length&&l.merge(this.state.form,Object.assign(Object.assign({},n),{printerName:null!==(t=null===(e=this.printerItems.find((e=>e.text===n.printerName)))||void 0===e?void 0:e.value)&&void 0!==t?t:-1}))}catch(e){}}))}render(){const{preview:e,templateRender:t}=this.props,{visible:n,form:a,currentPage:r,totalPage:i,printPage:o}=this.state,s=gt("print-preview"),u={visible:n,title:Se("qm.print.pageSetting"),width:"50%",loading:!1,containerStyle:{paddingBottom:"52px"},onClose:()=>{this.setState({visible:!1})}},c={[s]:!0};return e?q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:J.default(c)},q.default.createElement("div",{className:"outer"},q.default.createElement("div",{className:"header"},q.default.createElement("span",null,Se("qm.print.printer"),":",q.default.createElement(d.Select,{value:a.printerName,onChange:e=>{this.setState((t=>l.merge({},t,{form:{printerName:e}})))},style:{width:"120px"}},this.printerItems.map((e=>q.default.createElement(d.Select.Option,{key:e.value,value:e.value},e.text))))),q.default.createElement("span",null,Se("qm.print.type"),":",q.default.createElement(d.Select,{value:a.printerType,onChange:e=>{this.setState((t=>l.merge({},t,{form:{printerType:e,setting:{pageSize:"stylus"===e?"241*280":"210*297"}}})))},style:{width:"120px"}},this.printerTypeItems.map((e=>q.default.createElement(d.Select.Option,{key:e.value,value:e.value},e.text))))),q.default.createElement("span",null,Se("qm.print.copies"),":",q.default.createElement(d.InputNumber,{value:a.copies,min:1,precision:0,onChange:e=>{this.setState((t=>l.merge({},t,{form:{copies:null!=e?e:1}})))},style:{width:"50px"}})),q.default.createElement("span",null,Se("qm.print.printPage.0"),q.default.createElement(d.InputNumber,{value:o,min:1,max:i,precision:0,onChange:e=>{this.setState({printPage:null!=e?e:void 0})},style:{width:"50px",marginLeft:"4px",marginRight:"4px"}}),Se("qm.print.printPage.1")),q.default.createElement("span",null,q.default.createElement(d.Pagination,{size:"small",current:r,pageSize:1,total:i,onChange:this.pageChangeHandle})),q.default.createElement("span",null,q.default.createElement(pt,{type:"text",icon:q.default.createElement(g.SettingOutlined,null),className:"text-btn",onClick:()=>this.setState({visible:!0})},Se("qm.print.setting"))),q.default.createElement("span",null,q.default.createElement(pt,{type:"text",icon:q.default.createElement(g.DownloadOutlined,null),className:"text-btn",onClick:()=>this.exportClickHandle()},Se("qm.print.export"))),q.default.createElement("span",null,q.default.createElement(pt,{icon:q.default.createElement(g.PrinterOutlined,null),type:"primary",onClick:this.printClickHandle},Se("qm.print.print")))),q.default.createElement("div",{className:"main"},q.default.createElement(hp.Provider,{value:this.provide},q.default.createElement(xp,{ref:this.containRef,templateRender:t,directPrint:!1}))),q.default.createElement("div",{className:"footer"},q.default.createElement("span",null,Se("qm.print.scale"),":",q.default.createElement(d.Slider,{value:a.scale,step:.1,min:.5,max:1.5,onChange:e=>{this.setState((t=>l.merge({},t,{form:{scale:e}})))}}),q.default.createElement("em",{className:"scale-text"},`${Math.floor(100*a.scale)}%`)),q.default.createElement("span",null,Se("qm.print.paper"),":",this.pageSize[0],"mm * ",this.pageSize[1],"mm"),q.default.createElement("span",null,Se("qm.print.pageNumber"),":",Se("qm.print.pagination",{currentPage:r,totalPage:i}))))),q.default.createElement(Qn,u,q.default.createElement(Ep,{setting:a.setting,onChange:e=>{this.setState((t=>l.merge({},t,{form:{setting:e}})))},onClose:()=>{this.setState({visible:!1})}}))):q.default.createElement(hp.Provider,{value:this.provide},q.default.createElement(xp,{ref:this.containRef,templateRender:t,directPrint:!0}))}}Cp.contextType=xe;class wp extends e.Component{constructor(){super(...arguments),this.previewRef=q.default.createRef(),this.state={visible:!1,loading:!1},this.clickHandle=()=>Ie(this,void 0,void 0,(function*(){var e,t;this.setState({loading:!0});try{const l=yield null===(t=(e=this.props).click)||void 0===t?void 0:t.call(e);if(this.setState({loading:!1}),"boolean"==typeof l&&!l)return;yield this.DO_PRINT()}catch(e){}this.setState({loading:!1})})),this.createRender=()=>{const{visible:e}=this.state,{templateRender:t,uniqueKey:l,defaultConfig:n,preview:a,closeAfterPrint:r}=this.props,i={visible:e,title:Se("qm.print.preview"),width:`${mp.previewWidth}px`,loading:!1,onClose:()=>{this.setState({visible:!1})}},o={ref:this.previewRef,templateRender:t,uniqueKey:l,defaultConfig:n,preview:a,closeAfterPrint:r,onClose:()=>{this.setState({visible:!1})}};return a?q.default.createElement(Qn,i,q.default.createElement(Cp,o)):e?q.default.createElement(Cp,o):null},this.DO_PRINT=()=>Ie(this,void 0,void 0,(function*(){const{preview:e}=this.props;yield Ae(0),this.setState({visible:!0}),yield Ae(e?500:0);const t=this.previewRef.current.containRef.current;e?t.SHOW_PREVIEW():t.DIRECT_PRINT()}))}render(){const{loading:e}=this.state,{size:t,icon:l,type:n,disabled:a,shape:r}=this.props,i={size:t||this.context.size||"",type:n,shape:r,icon:l,loading:e,disabled:a,click:this.clickHandle};return q.default.createElement(q.default.Fragment,null,this.props.children&&q.default.createElement(pt,i,this.props.children),this.createRender())}}function Sp(e){return e.ownerDocument?e.ownerDocument.defaultView:null}function Np(e){const t=Sp(e);return t?t.frameElement:null}function Tp(e){const t=Rp(e);return Ip([e.getBoundingClientRect(),{top:t.borderTop,left:t.borderLeft,bottom:t.borderBottom,right:t.borderRight,width:0,height:0}])}function Ip(e){return e.reduce(((e,t)=>null==e?t:{top:e.top+t.top,left:e.left+t.left,width:e.width,height:e.height,bottom:e.bottom+t.bottom,right:e.right+t.right}))}function Op(e,t){const l=Np(e);if(l&&l!==t){const n=[e.getBoundingClientRect()];let a=l,r=!1;for(;a;){const e=Tp(a);if(n.push(e),a=Np(a),r)break;a&&Sp(a)===t&&(r=!0)}return Ip(n)}return e.getBoundingClientRect()}function Rp(e){const t=window.getComputedStyle(e);return{borderLeft:parseInt(t.borderLeftWidth,10),borderRight:parseInt(t.borderRightWidth,10),borderTop:parseInt(t.borderTopWidth,10),borderBottom:parseInt(t.borderBottomWidth,10),marginLeft:parseInt(t.marginLeft,10),marginRight:parseInt(t.marginRight,10),marginTop:parseInt(t.marginTop,10),marginBottom:parseInt(t.marginBottom,10),paddingLeft:parseInt(t.paddingLeft,10),paddingRight:parseInt(t.paddingRight,10),paddingTop:parseInt(t.paddingTop,10),paddingBottom:parseInt(t.paddingBottom,10)}}wp.propTypes={size:(e,t,l)=>{if(!tr(e[t]||""))return ct("Print","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},templateRender:se.default.elementType},wp.defaultProps={preview:!0,type:"primary",icon:q.default.createElement(g.PrinterOutlined,null)},wp.contextType=xe;const kp=Object.assign;class Lp{constructor(e,t){this.node=e.createElement("div"),this.border=e.createElement("div"),this.padding=e.createElement("div"),this.content=e.createElement("div"),this.border.style.borderColor=_p.border,this.padding.style.borderColor=_p.padding,this.content.style.backgroundColor=_p.background,kp(this.node.style,{borderColor:_p.margin,pointerEvents:"none",position:"fixed"}),this.node.style.zIndex="10000000",this.node.appendChild(this.border),this.border.appendChild(this.padding),this.padding.appendChild(this.content),t.appendChild(this.node)}remove(){this.node.parentNode&&this.node.parentNode.removeChild(this.node)}update(e,t){Fp(t,"margin",this.node),Fp(t,"border",this.border),Fp(t,"padding",this.padding),kp(this.content.style,{height:e.height-t.borderTop-t.borderBottom-t.paddingTop-t.paddingBottom+"px",width:e.width-t.borderLeft-t.borderRight-t.paddingLeft-t.paddingRight+"px"}),kp(this.node.style,{top:e.top-t.marginTop+"px",left:e.left-t.marginLeft+"px"})}}class Pp{constructor(e,t){this.tip=e.createElement("div"),kp(this.tip.style,{display:"flex",flexFlow:"row nowrap",backgroundColor:"#333740",borderRadius:"2px",fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace',fontWeight:"bold",padding:"3px 5px",pointerEvents:"none",position:"fixed",fontSize:"12px",whiteSpace:"nowrap"}),this.nameSpan=e.createElement("span"),this.tip.appendChild(this.nameSpan),kp(this.nameSpan.style,{color:"#ee78e6",borderRight:"1px solid #aaaaaa",paddingRight:"0.5rem",marginRight:"0.5rem"}),this.dimSpan=e.createElement("span"),this.tip.appendChild(this.dimSpan),kp(this.dimSpan.style,{color:"#d7d7d7"}),this.tip.style.zIndex="10000000",t.appendChild(this.tip)}remove(){this.tip.parentNode&&this.tip.parentNode.removeChild(this.tip)}updateText(e,t,l){this.nameSpan.textContent=e,this.dimSpan.textContent=Math.round(t)+"px × "+Math.round(l)+"px"}updatePosition(e,t){const l=this.tip.getBoundingClientRect(),n=function(e,t,l){const n=Math.max(l.height,20),a=Math.max(l.width,60),r=5;let i;i=e.top+e.height+n<=t.top+t.height?e.top+e.height<t.top+0?t.top+r:e.top+e.height+r:e.top-n<=t.top+t.height?e.top-n-r<t.top+r?t.top+r:e.top-n-r:t.top+t.height-n-r;let o=e.left+r;e.left<t.left&&(o=t.left+r);e.left+a>t.left+t.width&&(o=t.left+t.width-a-r);return i+="px",o+="px",{style:{top:i,left:o}}}(e,t,{width:l.width,height:l.height});kp(this.tip.style,n.style)}}class Ap{constructor(){const e=window;this.window=e;const t=window;this.tipBoundsWindow=t;const l=e.document;this.container=l.createElement("div"),this.container.style.zIndex="10000000",this.tip=new Pp(l,this.container),this.rects=[],l.body.appendChild(this.container)}remove(){this.tip.remove(),this.rects.forEach((e=>{e.remove()})),this.rects.length=0,this.container.parentNode&&this.container.parentNode.removeChild(this.container)}inspect(e,t){const l=e.filter((e=>e.nodeType===Node.ELEMENT_NODE));for(;this.rects.length>l.length;){const e=this.rects.pop();null==e||e.remove()}if(0===l.length)return;for(;this.rects.length<l.length;)this.rects.push(new Lp(this.window.document,this.container));const n={top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,left:Number.POSITIVE_INFINITY};l.forEach(((e,t)=>{const l=Op(e,this.window),a=Rp(e);n.top=Math.min(n.top,l.top-a.marginTop),n.right=Math.max(n.right,l.left+l.width+a.marginRight),n.bottom=Math.max(n.bottom,l.top+l.height+a.marginBottom),n.left=Math.min(n.left,l.left-a.marginLeft);this.rects[t].update(l,a)})),t||(t=l[0].nodeName.toLowerCase(),l[0]),this.tip.updateText(t,n.right-n.left,n.bottom-n.top);const a=Op(this.tipBoundsWindow.document.documentElement,this.window);this.tip.updatePosition({top:n.top,left:n.left,height:n.bottom-n.top,width:n.right-n.left},{top:a.top+this.tipBoundsWindow.scrollY,left:a.left+this.tipBoundsWindow.scrollX,height:this.tipBoundsWindow.innerHeight,width:this.tipBoundsWindow.innerWidth})}}function Fp(e,t,l){kp(l.style,{borderTopWidth:e[t+"Top"]+"px",borderLeftWidth:e[t+"Left"]+"px",borderRightWidth:e[t+"Right"]+"px",borderBottomWidth:e[t+"Bottom"]+"px",borderStyle:"solid"})}const _p={background:"rgba(120, 170, 210, 0.7)",padding:"rgba(77, 200, 0, 0.3)",margin:"rgba(255, 155, 0, 0.3)",border:"rgba(255, 200, 50, 0.3)"};let Dp=null,Mp=null;function Hp(){null!=window.document&&(Dp=null,null!==Mp&&(Mp.remove(),Mp=null))}class qp{constructor(e){this._lastHoveredNode=null,this.iframesListeningTo=new Set,this.onClick=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())},this.onMouseEvent=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())},this.onPointerDown=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation(),this.selectFiberForNode(this.getEventTarget(e)))},this.onPointerMove=e=>{e.preventDefault(),e.stopPropagation();const t=this.getEventTarget(e);if(this._lastHoveredNode!==t){if(this._lastHoveredNode=t,this.excludeSelectors.some((e=>rn(t,window.document.querySelector(e)))))return this._selectIgnore=!0,Hp();if(this._selectIgnore=!1,"IFRAME"===t.tagName){const e=t;try{if(!this.iframesListeningTo.has(e)){const t=e.contentWindow;this.registerListenersOnWindow(t),this.iframesListeningTo.add(e)}}catch(e){}}var l,n,a;l=[t],n=null,a=!1,null!=window.document?(null!==Dp&&clearTimeout(Dp),null!=l&&(null===Mp&&(Mp=new Ap),Mp.inspect(l,n),a&&(Dp=setTimeout((()=>Hp()),2e3)))):null!=l&&null!=l[0]&&console.error("showNativeHighlight",l[0])}},this.onPointerUp=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())},this.selectFiberForNode=l.throttle((e=>{var t;this._selectIgnore||null===(t=this.onSelect)||void 0===t||t.call(this,e,function(e){if(!(e instanceof Element))return"";const t=document.documentElement;let l=e;const n=[];for(;l!==t&&null!==l;){let e=l.tagName.toLowerCase();const t=/(?:\b|\w+-)(actived?|select(ed)?|focus(ed)?|open(ed)?)$/;for(let e=0,n=Array.from(l.classList).reverse();e<n.length;e++)t.test(n[e])&&l.classList.remove(n[e]);if(l.id&&/^rc-\w+/.test(l.id)&&l.removeAttribute("id"),l.id)e+=`#${l.id}`;else{const t=Array.from(l.parentElement.children).filter((e=>e.tagName===l.tagName)),n=l.className.trim();if(t.filter((e=>e.className.includes(n))).length<=1){if(n){const t=n.split(/\s+/);let l="";for(let e=0;e<t.length;e++)/^ant-col-\d+$/.test(t[e])||(l+=`.${t[e]}`);e+=l}}else l.getAttribute("name")?e+=`[name=${l.getAttribute("name")}]`:e+=`:nth-of-type(${t.indexOf(l)+1})`}l.nodeType!==Node.TEXT_NODE&&n.unshift(e),l=l.parentElement}return n.join(" > ")}(e))}),200,{leading:!1}),this.excludeSelectors=e.excludeSelectors||[],this.onSelect=e.onSelect}startHandle(){this.startInspectingNative()}stopHandle(){this.stopInspectingNative()}startInspectingNative(){this._isRunning||(this.registerListenersOnWindow(window),this._isRunning=!0)}stopInspectingNative(){Hp(),this.removeListenersOnWindow(window),this.iframesListeningTo.forEach((function(e){try{this.removeListenersOnWindow(e.contentWindow)}catch(e){}})),this.iframesListeningTo=new Set,this._isRunning=!1}registerListenersOnWindow(e){e&&"function"==typeof e.addEventListener&&(e.addEventListener("click",this.onClick,!0),e.addEventListener("mousedown",this.onMouseEvent,!0),e.addEventListener("mouseover",this.onMouseEvent,!0),e.addEventListener("mouseup",this.onMouseEvent,!0),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0))}removeListenersOnWindow(e){e&&"function"==typeof e.removeEventListener&&(e.removeEventListener("click",this.onClick,!0),e.removeEventListener("mousedown",this.onMouseEvent,!0),e.removeEventListener("mouseover",this.onMouseEvent,!0),e.removeEventListener("mouseup",this.onMouseEvent,!0),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0))}getEventTarget(e){return e.composed?e.composedPath()[0]:e.target}}function $p(e){return document.querySelector(e)}const jp=e=>{const{action:t,onConfirm:l,onCancel:n,onFinish:a}=e,{t:r}=ot();return q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{style:{height:100}},r("qm.table.config.emptyText")),q.default.createElement(ht,{style:{width:"100%",justifyContent:"flex-end"}},q.default.createElement(pt,{size:"small",onClick:()=>null==n?void 0:n()},r("qm.guideTracker.closeButton")),q.default.createElement(pt,{size:"small",onClick:()=>null==l?void 0:l()},r("add"===t?"qm.guideTracker.addButton":"qm.guideTracker.editButton")),q.default.createElement(pt,{size:"small",onClick:()=>null==a?void 0:a()},r("qm.guideTracker.finishButton"))))},Kp={left:"50%",top:"50%",width:1,height:1},Vp=q.default.forwardRef(((e,t)=>{const{open:n,current:a,defaultCurrent:r,steps:i=[],placement:o="bottom",control:s=!0,overlayClassName:u,overlayStyle:c,destroyOnHide:f,contentRender:p,zIndex:m,helper:h={},selectFilter:v=(e=>e),onSelect:y,onChange:b,onClose:x,onFinish:E}=e,{t:C}=ot(),w=q.default.useRef(),S=q.default.useRef(i.length),[N,T]=yi(0,{value:a,defaultValue:r}),[O,R]=yi(void 0,{value:n,postState:e=>null!=e&&e}),[k,L]=yi(1051,{value:m,defaultValue:m}),[P,A]=q.default.useState({}),[F,_]=q.default.useState(!1),[D,M]=q.default.useState(O),[H,$]=q.default.useState(!1),[j,K]=ip(P.node,!!n),[V,z]=q.default.useState(22),W=q.default.useRef(!1),B=q.default.useMemo((()=>N>=i.length?"add":"edit"),[N,i]),U=q.default.useMemo((()=>`${N+1} / ${i.length}`),[N,i]);q.default.useLayoutEffect((()=>{w.current=new qp({excludeSelectors:[".qm-guide-tracker-control"],onSelect:(e,t)=>{t=v(t),A({id:$a(),node:e,path:t}),T(S.current),_(!0),Y(),null==y||y(t,e)}})}),[]),q.default.useEffect((()=>(O?G():Y(),O?setTimeout((()=>M(!0)),16):M(!1),()=>{Y()})),[O]),q.default.useEffect((()=>{S.current=i.length}),[i]);const G=()=>{w.current.startHandle()},Y=()=>{w.current.stopHandle()},X=e=>{e.stopPropagation(),e.preventDefault()};q.default.useImperativeHandle(t,(()=>({OPEN:()=>R(!0),CLOSE:()=>R(!1),GET_CURRENT_STEP:()=>({current:N,selector:P.path})})));const Q=gt("guide-tracker"),Z=[{[`${Q}-primary`]:!0}],ee=dd({arrowPointAtCenter:!1,autoAdjustOverflow:!0,offset:5,arrowWidth:16,borderRadius:8});return q.default.createElement(q.default.Fragment,null,q.default.createElement(ue.default,{open:O&&F,autoLock:!0},q.default.createElement(me.default,{zIndex:k,builtinPlacements:ee,popupPlacement:o,popupVisible:O&&F,popupClassName:J.default(Z,u),popupStyle:c,prefixCls:Q,popup:()=>{const e=()=>{_(!1),G()};return q.default.createElement("div",{className:`${Q}-content`},q.default.createElement("div",{className:`${Q}-inner`},q.default.createElement(g.CloseOutlined,{className:`${Q}-close`,onClick:()=>{null==x||x(N),e()}}),q.default.createElement(d.Dropdown,{open:H,trigger:["click"],dropdownRender:()=>i.length?q.default.createElement("div",{className:"ant-dropdown-menu step-list"},q.default.createElement(I.ReactSortable,{itemKey:"id",handle:".handle",tag:"ul",animation:200,list:i,setList:e=>{const t=e.map((e=>e.id)),n=i.map((e=>e.id));if(l.isEqual(t,n))return;const a=t.findIndex((e=>e===P.id)),r=-1!==a?a:N;T(r),null==b||b(Ya(e),r)}},i.map(((e,t)=>q.default.createElement("li",{key:t,className:J.default("item",{actived:e.id===P.id})},q.default.createElement(g.HolderOutlined,{className:"handle",title:C("qm.form.draggable")}),q.default.createElement("span",{className:"box"},q.default.createElement("span",{className:"title",title:e.title,onClick:()=>{t!==N&&(A({id:e.id,node:$p(e.selector),path:e.selector}),T(t),z(22===V?V+1:V-1),null==b||b(i,t))}},e.title),q.default.createElement(d.Popconfirm,{title:C("qm.button.confirmTitle"),zIndex:k+1,onConfirm:()=>{const l=i.filter((t=>t.id!==e.id)),n=t===N;let a=t<=N?N-1:N;if(a=a<0?0:a,a=a>l.length?l.length:a,n&&l[a]){const{id:e,selector:t}=l[a];A({id:e,node:$p(t),path:t})}T(a),null==b||b(l,a)}},q.default.createElement(g.CloseOutlined,{className:"close-icon"})))))))):q.default.createElement(q.default.Fragment,null),overlayClassName:`${Q}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:180,zIndex:k},onOpenChange:e=>$(e)},q.default.createElement(g.MenuOutlined,{className:J.default(`${Q}-close`,"menu-icon"),style:{width:V}})),h.content&&q.default.createElement(d.Popover,{placement:"bottom",overlayStyle:{width:360,zIndex:k},content:h.content,title:h.title},q.default.createElement(g.QuestionCircleOutlined,{className:J.default(`${Q}-close`,"help-icon")})),q.default.createElement("div",{className:"panel-label"},q.default.createElement("span",{className:"title"},C("qm.guideTracker.label")),q.default.createElement("span",{className:"step"},C("qm.guideTracker.currentStep"),U)),p?p({id:P.id,selector:P.path,actionStatus:B,DO_CLOSE:e},N):q.default.createElement(jp,{action:B,onConfirm:()=>{null==b||b("add"===B?[...i,{id:P.id,selector:P.path,title:"Guide Title"}]:[...i],N),e()},onCancel:()=>{null==x||x(N),e()},onFinish:()=>{e(),null==x||x(N),null==E||E()}})))},arrow:!0,forceRender:!1,destroyPopupOnHide:f},q.default.createElement("div",{className:J.default(`${Q}-target-placeholder`),style:Object.assign(Object.assign({},j||Kp),{position:"fixed",zIndex:k-1,backgroundColor:"rgba(120, 170, 210, 0.7)"}),onMouseDown:X,onClick:X}))),s&&q.default.createElement(ue.default,{open:D},q.default.createElement(dp,{zIndex:k,prefixCls:Q,onPause:()=>{W.current=F,_(!1),Y()},onPlay:()=>{W.current?_(!0):G()}})))}));Vp.displayName="QmGuideTracker";const zp=e=>{var t,l,n,a,r,i,o,s;const{content:d,image:u,width:c,height:f,font:p={},gap:m=[100,100],offset:h=[50,50],rotate:g=-22,zIndex:v=9,alpha:y=1,antiTamper:b=!0,grayscale:x,className:E,style:C}=e,w=q.default.useRef(null),S=q.default.useRef(new Map),N=null!==(t=p.fontSize)&&void 0!==t?t:16,T=null!==(l=p.fontWeight)&&void 0!==l?l:"normal",I=null!==(n=p.fontStyle)&&void 0!==n?n:"normal",O=null!==(a=p.fontFamily)&&void 0!==a?a:"sans-serif",R=null!==(r=p.color)&&void 0!==r?r:"rgba(0, 0, 0, 0.15)",k=null!==(i=p.textAlign)&&void 0!==i?i:"center",L=Array.isArray(d)?d:[d],P=m[0],A=m[1],F=P/2,_=A/2,D=null!==(o=h[0])&&void 0!==o?o:F,M=null!==(s=h[1])&&void 0!==s?s:_,H=q.default.useMemo((()=>{const e=D-F,t=M-_;return{position:"absolute",left:e>0?`${e}px`:0,top:t>0?`${t}px`:0,width:e>0?`calc(100% - ${e}px)`:"100%",height:t>0?`calc(100% - ${t}px)`:"100%",pointerEvents:"none",backgroundRepeat:"repeat",backgroundPosition:`${e>0?0:e}px ${t>0?0:t}px`,zIndex:v}}),[F,_,D,M,v]),j=(e,t)=>{var l;if(w.current){const n=S.current.get(w.current);n&&(w.current.contains(n)&&w.current.removeChild(n),S.current.delete(w.current));const a=document.createElement("div");a.setAttribute("style",(e=>Object.entries(e).map((([e,t])=>{return`${l=e,l.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${t}`;var l})).join(";"))(Object.assign(Object.assign({},H),{backgroundImage:`url('${e}')`,backgroundSize:`${t}px`}))),null===(l=w.current)||void 0===l||l.append(a),S.current.set(w.current,a)}},K=()=>{const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return;const l=(e=>{if(!e)return 1;const t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t})(t),[n,a]=(e=>{let t=120,l=64;if(!u&&e.measureText){e.font=`${N}px ${O}`;const n=L.map((t=>e.measureText(t).width));t=Math.ceil(Math.max(...n)),l=N*L.length+3*(L.length-1)}return[null!=c?c:t,null!=f?f:l]})(t),r=n*l,i=a*l,o=(P+n)*l,s=(A+a)*l,d=P/2*l,p=A/2*l,m=o/2,h=s/2,v=2*(P+n);e.width=2*o,e.height=2*s,t.globalAlpha=y,t.save(),t.translate(m,h),t.rotate(Math.PI/180*g),t.translate(-m,-h);const b=()=>{t.restore(),t.drawImage(e,0,0,o,s,o,s,o,s),x&&(e=>{const t=e.getContext("2d");if(!t)return;const l=t.getImageData(0,0,e.width,e.height),{data:n}=l;for(let e=0;e<n.length;e+=4){const t=(n[e]+n[e+1]+n[e+2])/3;n[e]=t,n[e+1]=t,n[e+2]=t}t.putImageData(l,0,0)})(e),j(e.toDataURL(),v)},E=()=>{const e=Number(N)*l;t.font=`${I} normal ${T} ${e}px/${a}px ${O}`,t.fillStyle=R,t.textAlign=k,t.textBaseline="top",t.translate(r/2,0),L.forEach(((n,a)=>{t.fillText(null!=n?n:"",d,p+a*(e+3*l))})),b()};if(u){const e=new Image;e.onload=()=>{t.drawImage(e,d,p,r,i),b()},e.onerror=()=>{E()},e.crossOrigin="anonymous",e.referrerPolicy="no-referrer",e.src=u}else E()},V=e=>Array.from(S.current.values()).includes(e);q.default.useEffect((()=>{K()}),[d,u,c,f,p,m,h,g,v,y,b,x]),function(e,t,l={}){const n=window&&"MutationObserver"in window,a=$.useRef(),r=()=>{a.current&&(a.current.disconnect(),a.current=void 0)};$.useLayoutEffect((()=>(r(),n&&e.current&&(a.current=new MutationObserver(t),a.current.observe(e.current,l)),()=>r())),[e])}(w,(e=>{if(b)for(const t of e){const e=Array.from(t.removedNodes).some((e=>V(e))),l="attributes"===t.type&&V(t.target);if(e||l){K();break}}}),{attributes:!0,childList:!0,characterData:!0,subtree:!0});const z=gt("watermark");return q.default.createElement("div",{ref:w,className:J.default(z,E),style:Object.assign({position:"relative"},C)},e.children)},Wp=new Map,Bp=new WeakMap;let Up,Gp=0;function Yp(e){return Object.keys(e).sort().filter((t=>void 0!==e[t])).map((t=>{return`${t}_${"root"===t?(l=e.root,l?(Bp.has(l)||(Gp+=1,Bp.set(l,Gp.toString())),Bp.get(l)):"0"):e[t]}`;var l})).toString()}function Xp(e,t,l={},n=Up){if(void 0===window.IntersectionObserver&&void 0!==n){const a=e.getBoundingClientRect();return t(n,{isIntersecting:n,target:e,intersectionRatio:"number"==typeof l.threshold?l.threshold:0,time:0,boundingClientRect:a,intersectionRect:a,rootBounds:a}),()=>{}}const{id:a,observer:r,elements:i}=function(e){const t=Yp(e);let l=Wp.get(t);if(!l){const n=new Map;let a=[];const r=new IntersectionObserver((t=>{t.forEach((t=>{var l;const r=t.isIntersecting&&a.some((e=>t.intersectionRatio>=e));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=r),null===(l=n.get(t.target))||void 0===l||l.forEach((e=>{e(r,t)}))}))}),e);a=r.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),l={id:t,observer:r,elements:n},Wp.set(t,l)}return l}(l),o=i.get(e)||[];return i.has(e)||i.set(e,o),o.push(t),r.observe(e),function(){o.splice(o.indexOf(t),1),0===o.length&&(i.delete(e),r.unobserve(e)),0===i.size&&(r.disconnect(),Wp.delete(a))}}const Qp=e=>{const{forceRender:t,height:l,placeholder:n=null,unmountIfInvisible:a,className:r,style:i}=e,{ref:o,inView:s,entry:d}=(({root:e,rootMargin:t,threshold:l,triggerOnce:n,fallbackInView:a,trackVisibility:r,skip:i,delay:o,onChange:s}={})=>{var d;const[u,c]=q.default.useState(null),[f,p]=q.default.useState({inView:!1,entry:void 0}),m=q.default.useRef(s);q.default.useEffect((()=>{if(i||!u)return;let s;return s=Xp(u,((e,t)=>{var l;p({inView:e,entry:t}),null===(l=m.current)||void 0===l||l.call(m,e,t),t.isIntersecting&&n&&s&&(s(),s=void 0)}),{root:e,rootMargin:t,threshold:l,trackVisibility:r,delay:o},a),()=>{s&&s()}}),[Array.isArray(l)?l.toString():l,u,e,t,n,i,r,a,o]);const h=null===(d=f.entry)||void 0===d?void 0:d.target,g=q.default.useRef();u||!h||n||i||g.current===h||(g.current=h,p({inView:!1,entry:void 0}));const v=[c,f.inView,f.entry];return v.ref=v[0],v.inView=v[1],v.entry=v[2],v})(Object.assign({},e,{triggerOnce:!a}));q.default.useEffect((()=>{l||ft("LazyLoad","height 是必要参数,需要设定组件的高度值!")}),[]);const u={[gt("lazy-load")]:!0};return q.default.createElement("div",{ref:o,className:J.default(u,r),style:i},t||s?e.children:q.default.createElement("div",{className:"placeholder",style:{height:l}},n))};class Zp{constructor(e,t,l,n){if(isNaN(e)||isNaN(t))throw new Error(`Point is invalid: (${e}, ${t})`);this.x=+e,this.y=+t,this.pressure=l||0,this.time=n||Date.now()}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}equals(e){return this.x===e.x&&this.y===e.y&&this.pressure===e.pressure&&this.time===e.time}velocityFrom(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):0}}class Jp{static fromPoints(e,t){const l=this.calculateControlPoints(e[0],e[1],e[2]).c2,n=this.calculateControlPoints(e[1],e[2],e[3]).c1;return new Jp(e[1],l,n,e[2],t.start,t.end)}static calculateControlPoints(e,t,l){const n=e.x-t.x,a=e.y-t.y,r=t.x-l.x,i=t.y-l.y,o=(e.x+t.x)/2,s=(e.y+t.y)/2,d=(t.x+l.x)/2,u=(t.y+l.y)/2,c=Math.sqrt(n*n+a*a),f=Math.sqrt(r*r+i*i),p=f/(c+f),m=d+(o-d)*p,h=u+(s-u)*p,g=t.x-m,v=t.y-h;return{c1:new Zp(o+g,s+v),c2:new Zp(d+g,u+v)}}constructor(e,t,l,n,a,r){this.startPoint=e,this.control2=t,this.control1=l,this.endPoint=n,this.startWidth=a,this.endWidth=r}length(){let e,t,l=0;for(let n=0;n<=10;n+=1){const a=n/10,r=this.point(a,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),i=this.point(a,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(n>0){const n=r-e,a=i-t;l+=Math.sqrt(n*n+a*a)}e=r,t=i}return l}point(e,t,l,n,a){return t*(1-e)*(1-e)*(1-e)+3*l*(1-e)*(1-e)*e+3*n*(1-e)*e*e+a*e*e*e}}class em{constructor(e,t){this.width=320,this.height=200,this.ratio=Math.max(window.devicePixelRatio||1,1),this.penColor="rgba(0,0,0,1)",this.backgroundColor="rgba(0,0,0,0)",this.canAddHistory=!1,this.openSmooth=!0,this.dotSize=0,this.throttle=16,this.minDistance=5,this.velocityFilterWeight=.7,this.compositeOperation="source-over",this.minWidth=.5,this.maxWidth=2.5,this.fontSize=16,this.eraserSize=20,this.lineHeight=1.25,this.degreeOfBlur=5,this.textInputPos={x:0,y:0},this.onStart=()=>{},this.onEnd=()=>{},this._drawingStroke=!1,this._lastPoints=[],this._data=[],this._historyList=[],this._lastVelocity=0,this._lastWidth=0,this.setCanvasSize=()=>{this.canvas.style.height=`${this.height}px`,this.canvas.style.width=`${this.width}px`,this.canvas.height=this.height*this.ratio,this.canvas.width=this.width*this.ratio,1!==this.ratio&&this.ctx.scale(this.ratio,this.ratio)},this.setTextInput=()=>{this.openSmooth||(this.textInput.setAttribute("class","signature__text-input"),this.textInput.setAttribute("contentEditable","true"),this.textInput.setAttribute("spellCheck","false"),this.canvas.parentNode.appendChild(this.textInput))},this.isTouchEvent=e=>"touches"in e,this.addListener=()=>{this.removeListener(),this.canvas.style.touchAction="none",this.canvas.style.userSelect="none",("ontouchstart"in window||navigator.maxTouchPoints)&&(this.canvas.addEventListener("touchstart",this.onDrawStart,{passive:!1}),this.canvas.addEventListener("touchmove",this.onDrawMove,{passive:!1}),document.addEventListener("touchcancel",this.onDrawEnd,{passive:!1}),document.addEventListener("touchend",this.onDrawEnd,{passive:!1})),this.canvas.addEventListener("mousedown",this.onDrawStart),this.canvas.addEventListener("mousemove",this.onDrawMove),document.addEventListener("mouseup",this.onDrawEnd),this.textInput.addEventListener("blur",this.onInputBlur)},this.removeListener=()=>{this.canvas.style.touchAction="auto",this.canvas.style.userSelect="auto",this.canvas.removeEventListener("touchstart",this.onDrawStart),this.canvas.removeEventListener("touchmove",this.onDrawMove),document.removeEventListener("touchend",this.onDrawEnd),document.removeEventListener("touchcancel",this.onDrawEnd),this.canvas.removeEventListener("mousedown",this.onDrawStart),this.canvas.removeEventListener("mousemove",this.onDrawMove),document.removeEventListener("mouseup",this.onDrawEnd),this.textInput.removeEventListener("blur",this.onInputBlur)},this._isLeftButtonPressed=(e,t)=>this.isTouchEvent(e)?!!e.touches.length:t?1===e.buttons:1==(1&e.buttons),this._pointerEventToSignatureEvent=e=>{var t,l;return{event:e,type:e.type,x:this.isTouchEvent(e)?null===(t=e.touches[0])||void 0===t?void 0:t.clientX:e.clientX,y:this.isTouchEvent(e)?null===(l=e.touches[0])||void 0===l?void 0:l.clientY:e.clientY,pressure:"pressure"in e?e.pressure:0}},this._getPointGroupOptions=e=>({penColor:e&&"penColor"in e?e.penColor:this.penColor,dotSize:e&&"dotSize"in e?e.dotSize:this.dotSize,minWidth:e&&"minWidth"in e?e.minWidth:this.minWidth,maxWidth:e&&"maxWidth"in e?e.maxWidth:this.maxWidth,velocityFilterWeight:e&&"velocityFilterWeight"in e?e.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:e&&"compositeOperation"in e?e.compositeOperation:this.compositeOperation}),this._strokeBegin=e=>{this._drawingStroke=!0;const t=this._getPointGroupOptions(),l=Object.assign(Object.assign({},t),{points:[]});this._data.push(l),this._reset(t),this._strokeUpdate(e,!1)},this._strokeUpdate=(e,t=!0)=>{if(!this._drawingStroke)return;if(0===this._data.length)return void this._strokeBegin(e);const l=this._createPoint(e.x,e.y,e.pressure),n=this._data[this._data.length-1],a=n.points,r=a.length>0&&a[a.length-1],i=!!r&&l.distanceTo(r)<=this.minDistance,o=this._getPointGroupOptions(n);if(!r||!r||!i){const e=this._addPoint(l,o);t&&(r?e&&this._drawCurve(e,o):this._drawDot(l,o)),a.push({time:l.time,x:l.x,y:l.y,pressure:l.pressure})}},this._strokeEnd=(e,t=!1)=>{this._drawingStroke&&(t&&this._strokeUpdate(e),this._drawingStroke=!1)},this._reset=e=>{this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(e.minWidth+e.maxWidth)/2,this.ctx.fillStyle=e.penColor,this.ctx.globalCompositeOperation=e.compositeOperation},this._drawDot=(e,t)=>{const l=this.ctx,n=t.dotSize>0?t.dotSize:(t.minWidth+t.maxWidth)/2;l.beginPath(),this._drawCurveSegment(e.x,e.y,n),l.closePath(),l.fillStyle=t.penColor,l.fill()},this._drawCurve=(e,t)=>{const l=this.ctx,n=e.endWidth-e.startWidth,a=2*Math.ceil(e.length());l.beginPath(),l.fillStyle=t.penColor;for(let l=0;l<a;l+=1){const r=l/a,i=r*r,o=i*r,s=1-r,d=s*s,u=d*s;let c=u*e.startPoint.x;c+=3*d*r*e.control1.x,c+=3*s*i*e.control2.x,c+=o*e.endPoint.x;let f=u*e.startPoint.y;f+=3*d*r*e.control1.y,f+=3*s*i*e.control2.y,f+=o*e.endPoint.y;const p=Math.min(e.startWidth+o*n,t.maxWidth);this._drawCurveSegment(c,f,p)}l.closePath(),l.fill()},this._drawCurveSegment=(e,t,l)=>{const n=this.ctx;n.moveTo(e,t),n.arc(e,t,l,0,2*Math.PI,!1)},this._createPoint=(e,t,l)=>{const n=this.canvas.getBoundingClientRect();return new Zp(e-n.left,t-n.top,l,(new Date).getTime())},this._createPointByEvent=e=>this._createPoint(e.x,e.y,e.pressure),this._addPoint=(e,t)=>{const{_lastPoints:l}=this;if(l.push(e),l.length>2){3===l.length&&l.unshift(l[0]);const e=this._calculateCurveWidths(l[1],l[2],t),n=Jp.fromPoints(l,e);return l.shift(),n}return null},this._strokeWidth=(e,t)=>Math.max(t.maxWidth/(e+1),t.minWidth),this._calculateCurveWidths=(e,t,l)=>{const n=l.velocityFilterWeight*t.velocityFrom(e)+(1-l.velocityFilterWeight)*this._lastVelocity,a=this._strokeWidth(n,l),r={end:a,start:this._lastWidth};return this._lastVelocity=n,this._lastWidth=a,r},this.onDrawStart=e=>{var t;e.preventDefault(),this._isLeftButtonPressed(e,!0)&&!this._drawingStroke&&(this._strokeBegin(this._pointerEventToSignatureEvent(e)),this.ctx.strokeStyle=this.penColor,this.ctx.lineWidth=this.maxWidth,"line"===this.mode&&this.createPencil(e),"eraser"===this.mode&&this.createEraser(e),"text"===this.mode&&this.createTextInput(e),null===(t=this.onStart)||void 0===t||t.call(this,e))},this.onDrawMove=e=>{e.preventDefault(),"text"!==this.mode&&(this._isLeftButtonPressed(e,!0)&&this._drawingStroke?window.requestAnimationFrame?window.requestAnimationFrame((()=>this.drawHandler(e))):this.drawHandler(e):this._strokeEnd(this._pointerEventToSignatureEvent(e)))},this.onDrawEnd=e=>{var t;this._isLeftButtonPressed(e)||(this._strokeEnd(this._pointerEventToSignatureEvent(e)),"text"!==this.mode&&this.addHistory(),null===(t=this.onEnd)||void 0===t||t.call(this,e))},this.onInputBlur=e=>{this.textInput.classList.remove("show"),this.drawHandler(e),this.textInput.innerText="",this.addHistory()},this.drawHandler=e=>{switch(this.mode){case"line":this.drawLine(e);break;case"square":this.drawSquare(e);break;case"round":this.drawRound(e);break;case"arrow":this.drawArrow(e);break;case"mosaic":this.drawMosaic(e);break;case"text":this.drawText(e);break;case"eraser":this.drawEraser(e)}this.canAddHistory=!0},this.drawSquare=e=>{if(!this._lastPoints.length)return;const{x:t,y:l}=this._lastPoints[0],{x:n,y:a}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.setLastHistory(),this.ctx.beginPath(),this.ctx.rect(t,l,n-t,a-l),this.ctx.stroke(),this.ctx.restore()},this.drawRound=e=>{if(!this._lastPoints.length)return;const{x:t,y:l}=this._lastPoints[0],{x:n,y:a}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),r=Math.min(n,t),i=Math.min(a,l),o=.5*(Math.max(n,t)-r),s=.5*(Math.max(a,l)-i),d=r+o,u=i+s;this.setLastHistory(),this.ctx.beginPath(),this.ctx.ellipse(d,u,o,s,0,0,2*Math.PI),this.ctx.stroke(),this.ctx.closePath(),this.ctx.restore()},this.drawArrow=e=>{if(!this._lastPoints.length)return;const{x:t,y:l}=this._lastPoints[0],{x:n,y:a}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),r=180*Math.atan2(l-a,t-n)/Math.PI,i=(r+25)*Math.PI/180,o=(r-25)*Math.PI/180,s=15*Math.cos(i),d=15*Math.sin(i),u=15*Math.cos(o),c=15*Math.sin(o);this.setLastHistory(),this.ctx.beginPath(),this.ctx.moveTo(t,l),this.ctx.lineTo(n,a),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(n,a);const f=n+s,p=a+d;this.ctx.lineTo(f,p);const m=n+u,h=a+c;this.ctx.lineTo(m,h),this.ctx.lineTo(n,a),this.ctx.fill(),this.ctx.restore()},this.getAxisColor=(e,t,l)=>{const n=e.width,a=e.data,r=[];return r[0]=a[4*(l*n+t)],r[1]=a[4*(l*n+t)+1],r[2]=a[4*(l*n+t)+2],r[3]=a[4*(l*n+t)+3],r},this.setAxisColor=(e,t,l,n)=>{const a=e.width,r=e.data;r[4*(l*a+t)]=n[0],r[4*(l*a+t)+1]=n[1],r[4*(l*a+t)+2]=n[2],r[4*(l*a+t)+3]=n[3]},this.drawMosaic=e=>{if(!this._lastPoints.length)return;const{x:t,y:l}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),n=this.ctx.getImageData(t*this.ratio,l*this.ratio,this.maxWidth*this.ratio,this.maxWidth*this.ratio),a=n.width,r=n.height,i=a/this.degreeOfBlur,o=r/this.degreeOfBlur;for(let e=0;e<o;e++)for(let t=0;t<i;t++){const l=this.getAxisColor(n,t*this.degreeOfBlur+Math.floor(Math.random()*this.degreeOfBlur),e*this.degreeOfBlur+Math.floor(Math.random()*this.degreeOfBlur));for(let a=0;a<this.degreeOfBlur;a++)for(let r=0;r<this.degreeOfBlur;r++)this.setAxisColor(n,t*this.degreeOfBlur+r,e*this.degreeOfBlur+a,l)}this.ctx.putImageData(n,t*this.ratio,l*this.ratio)},this.drawText=e=>{const{x:t,y:l}=this.textInputPos;if(0===t&&0===l)return;this.ctx.lineWidth=1,this.ctx.fillStyle=this.penColor,this.ctx.textBaseline="middle",this.ctx.font=`bold ${this.fontSize}px none`;const n=this.fontSize*this.lineHeight,a=this.width-t,r=e.target.innerText,i=[];let o="";for(let e=0;e<r.length;e++){const t=o+r[e];this.ctx.measureText(t).width>a&&o.length>0?(i.push(o),o=r[e]):o=t}i.push(o),i.forEach(((e,a)=>{this.ctx.fillText(e,t+1,l+a*n+2)})),this.ctx.restore(),this.textInputPos={x:0,y:0}},this.createPencil=e=>{if(this.openSmooth||!this._lastPoints.length)return;const{x:t,y:l}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,l)},this.drawPencil=e=>{const{x:t,y:l}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.lineTo(t,l),this.ctx.stroke(),this.ctx.restore()},this.createEraser=e=>{if(!this._lastPoints.length)return;const{x:t,y:l}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,l)},this.drawEraser=e=>{const{x:t,y:l}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.globalCompositeOperation="destination-out",this.ctx.lineCap="round",this.ctx.lineWidth=this.eraserSize,this.ctx.lineTo(t,l),this.ctx.stroke(),this.ctx.globalCompositeOperation="source-over"},this.drawLine=e=>{this.openSmooth?this._strokeMoveUpdate(this._pointerEventToSignatureEvent(e)):this.drawPencil(e)},this.createTextInput=e=>{if(!this._lastPoints.length)return;const{x:t,y:l}=this._lastPoints[0];0!=this.textInputPos.x&&0!=this.textInputPos.y&&this.textInputPos.x!=t&&this.textInputPos.y!=l?this.textInput.blur():(this.textInput.classList.add("show"),this.setInputStyle(),this.textInput.focus())},this.setInputStyle=()=>{if(!this._lastPoints.length)return;const{x:e,y:t}=this._lastPoints[0];this.textInput.style.left=e+"px",this.textInput.style.lineHeight=this.lineHeight.toString(),this.textInput.style.fontSize=this.fontSize+"px",this.textInput.style.color=this.penColor,this.textInput.style.top=t-Math.floor((this.textInput.offsetHeight-2)/2)+"px",this.textInputPos={x:e,y:t}},this.drawBgColor=()=>{this.backgroundColor&&(this.ctx.fillStyle=this.backgroundColor,this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height))},this.clearWorkSpace=()=>{this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)},this.addHistory=()=>{this.canAddHistory&&(this.canAddHistory=!1,this._historyList.push(this.ctx.getImageData(0,0,this.canvas.width,this.canvas.height)))},this.getLastHistory=()=>this._historyList[this._historyList.length-1],this.setLastHistory=()=>{const e=this.getLastHistory();e?this.ctx.putImageData(e,0,0):this.clearWorkSpace()},this.clear=()=>{this.clearWorkSpace(),this.drawBgColor(),this._historyList=[],this._data=[],this._reset(this._getPointGroupOptions())},this.undo=()=>{const e=this._historyList[this._historyList.length-2];e?(this.ctx.putImageData(e,0,0),this._historyList.pop()):this.clear()},this.setDrawMode=e=>{this.mode=e},this.setLineWidth=e=>{this.maxWidth=e},this.setPenColor=e=>{this.penColor=e},this.setFontSize=e=>{this.fontSize=e},this.isEmpty=()=>{const e=document.createElement("canvas"),t=e.getContext("2d");return e.width=this.canvas.width,e.height=this.canvas.height,1!==this.ratio&&t.scale(this.ratio,this.ratio),this.backgroundColor&&(t.fillStyle=this.backgroundColor,t.fillRect(0,0,e.width,e.height)),e.toDataURL()===this.canvas.toDataURL()},this.toDataURL=(e="image/png",t=1)=>{if(this.canvas.width===this.width)return this.canvas.toDataURL(e,t);const l=document.createElement("canvas");l.width=this.width,l.height=this.height;return l.getContext("2d").drawImage(this.canvas,0,0,l.width,l.height),l.toDataURL(e,t)},this.getPNG=()=>this.toDataURL(),this.getJPG=(e=.8)=>this.toDataURL("image/jpeg",e),this.initial(e,t)}initial(e,t={}){e&&(this.canvas=e,this.ctx=e.getContext("2d"),this.textInput=document.createElement("div"),this.width=t.width||e.clientWidth||this.width,this.height=t.height||e.clientHeight||this.height,this.penColor=t.penColor||this.penColor,this.fontSize=t.fontSize||this.fontSize,this.openSmooth=void 0===t.openSmooth?this.openSmooth:!!t.openSmooth,this.backgroundColor=this.openSmooth&&t.backgroundColor||this.backgroundColor,this.mode=t.mode||this.mode,this._strokeMoveUpdate=this.throttle?function(e,t=250){let l,n,a,r=0,i=null;const o=()=>{r=Date.now(),i=null,l=e.apply(n,a),i||(n=null,a=[])};return function(...s){const d=Date.now(),u=t-(d-r);return n=this,a=s,u<=0||u>t?(i&&(clearTimeout(i),i=null),r=d,l=e.apply(n,a),i||(n=null,a=[])):i||(i=window.setTimeout(o,u)),l}}(this._strokeUpdate,this.throttle):this._strokeUpdate,this.minWidth=t.minWidth||this.minWidth,this.maxWidth=t.maxWidth||this.maxWidth,this.onStart=t.onStart,this.onEnd=t.onEnd,this.setCanvasSize(),this.setTextInput(),this.drawBgColor(),this.addListener())}update(){this.setCanvasSize(),this.clear()}destroy(){this.removeListener();for(const e in this)Object.prototype.hasOwnProperty.call(this,e)&&(this[e]=null)}}em.dataURLToBlob=e=>{const t=e.split(";base64,"),l=t[0].split(":")[1],n=window.atob(t[1]),a=n.length,r=new Uint8Array(a);for(let e=0;e<a;++e)r[e]=n.charCodeAt(e);return new Blob([r],{type:l})},em.canvasToDataURL=e=>e.toDataURL("image/png",1),em.canvasToBlob=e=>new Promise(((t,l)=>{e.toBlob((e=>e?t(e):l(null)),"image/png",1)}));const tm=q.default.forwardRef(((e,t)=>{const{open:l,width:n,height:a,imageName:r,penColor:i,penMode:o,minWidth:s,maxWidth:u,backgroundColor:c,className:f,style:p,onOk:m,onCancel:h}=e,{t:v}=ot(),y=q.default.useRef(),b=q.default.useRef(null),x=q.default.useRef(null),E=q.default.useRef(null),C=[2,4,6],w=[14,16,18,20,24,28],S=["#ff0000","#29cc29","#00bfff","#fe6151","#000000","#666666"],[N,T]=yi(void 0,{value:l,postState:e=>null!=e&&e}),I=q.default.useMemo((()=>!!e.children),[e.children]),[O,R]=q.default.useState(o||(I?"square":"line")),[k,L]=q.default.useState(C[0]),[P,A]=q.default.useState(I?S[0]:S[4]),[F,_]=q.default.useState(w[1]),[D,M]=q.default.useState("bottomLeft"),[H,$]=q.default.useState(!1),[K,V]=q.default.useState(!1);q.default.useEffect((()=>{var e,t;const l={width:null!=n?n:null===(e=x.current)||void 0===e?void 0:e.offsetWidth,height:null!=a?a:null===(t=x.current)||void 0===t?void 0:t.offsetHeight,maxWidth:k,mode:O,penColor:P,fontSize:F,backgroundColor:c,openSmooth:!I};return l.openSmooth&&Object.assign(l,{penColor:i,minWidth:s,maxWidth:u}),y.current=new em(b.current,l),()=>y.current.destroy()}),[]);const z=e=>{var t,l;const[r,i]=[null!=n?n:null===(t=x.current)||void 0===t?void 0:t.offsetWidth,null!=a?a:null===(l=x.current)||void 0===l?void 0:l.offsetHeight],{width:o,height:s}=y.current;let d=!1;r&&r!==o&&(y.current.width=r,d=!0),i&&i!==s&&(y.current.height=i,d=!0),(d||e)&&y.current.update()};Yl((()=>{I&&N&&z()}),[N,I]),Yl((()=>{y.current.setDrawMode(O)}),[O]),Yl((()=>{y.current.setLineWidth(k)}),[k]),Yl((()=>{y.current.setPenColor(P)}),[P]),Yl((()=>{y.current.setFontSize(F)}),[F]);const W=()=>Ie(void 0,void 0,void 0,(function*(){const e=I?x.current.parentNode:b.current;if(e)try{const t=yield be.default(e,{useCORS:!0,logging:!1,ignoreElements:e=>e===E.current||e.classList.contains("spinning")});return em.canvasToDataURL(t)}catch(e){ft("Signature","生成合成图片失败!")}})),B=()=>{y.current.clear(),null==h||h()};q.default.useImperativeHandle(t,(()=>({OPEN:()=>T(!0),CLOSE:()=>T(!1),CLEAR:()=>y.current.clear(),UNDO:()=>y.current.undo(),IS_EMPTY:()=>y.current.isEmpty(),UPDATE:z,GET_DATE_URL:W})));const U=e=>{e&&M((()=>{const e=E.current.getBoundingClientRect();return e.top+e.height>=window.innerHeight})()?"topLeft":"bottomLeft")},G=e=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","content")},"text"!==e?q.default.createElement("div",{className:"lineWidth"},C.map((e=>q.default.createElement("span",{key:e,className:J.default("dot",`s${e}`,{active:e===k}),onClick:()=>L(e)})))):q.default.createElement("div",{className:"fontSize"},q.default.createElement(d.Select,{size:"small",value:F,options:w.map((e=>({value:e,label:e.toString()}))),onChange:e=>_(e)})),q.default.createElement("span",{className:"divider"}),q.default.createElement("div",{className:"penColor"},S.map((e=>q.default.createElement("span",{key:e,className:J.default("dot",{active:e===P}),style:{backgroundColor:e},onClick:()=>A(e)},q.default.createElement(g.CheckOutlined,{className:"icon"})))))),Y=gt("signature"),X={[Y]:!0,"is-annotation":I},Q=n?Object.assign(Object.assign({},p),{width:n}):p;return q.default.createElement("div",{className:J.default(X,f),style:Q},I&&q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{ref:x,className:"content"},e.children),K&&q.default.createElement(mn,{spinning:!0,className:"spinning"})),q.default.createElement("div",{className:J.default("signature",{show:N})},q.default.createElement("canvas",{ref:b,className:O}),I&&q.default.createElement("div",{ref:E,className:"signature__tool-bar"},q.default.createElement("div",{className:"wrapper"},q.default.createElement("div",{className:J.default("actions",{hidden:H})},q.default.createElement(d.Dropdown,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:D,trigger:["click"],onOpenChange:U},q.default.createElement("button",{className:"btn",onClick:()=>R("square")},q.default.createElement(g.BorderOutlined,null))),q.default.createElement(d.Dropdown,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:D,trigger:["click"],onOpenChange:U},q.default.createElement("button",{className:"btn",onClick:()=>R("round")},q.default.createElement($d,null))),q.default.createElement(d.Dropdown,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:D,trigger:["click"],onOpenChange:U},q.default.createElement("button",{className:"btn",onClick:()=>R("arrow")},q.default.createElement(Kd,null))),q.default.createElement(d.Dropdown,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:D,trigger:["click"],onOpenChange:U},q.default.createElement("button",{className:"btn",onClick:()=>R("line")},q.default.createElement(g.EditOutlined,null))),q.default.createElement(d.Dropdown,{dropdownRender:()=>G("text"),overlayClassName:`${Y}__popper`,placement:D,trigger:["click"],onOpenChange:U},q.default.createElement("button",{className:"btn",onClick:()=>R("text")},q.default.createElement(jd,null))),q.default.createElement("button",{className:"btn",onClick:()=>Ie(void 0,void 0,void 0,(function*(){yield Ie(void 0,void 0,void 0,(function*(){V(!0);const e=yield W();if(e){const t=r?r.slice(0,r.lastIndexOf(".")>0?r.lastIndexOf("."):void 0):j.default().format(si);Dn(em.dataURLToBlob(e),`${t}.png`)}V(!1)})),B()}))},q.default.createElement(g.DownloadOutlined,null)),q.default.createElement("button",{className:"btn",onClick:()=>R("eraser")},q.default.createElement(Vd,null)),q.default.createElement("button",{className:"btn",onClick:()=>y.current.undo()},q.default.createElement(zd,null)),q.default.createElement("button",{className:"btn",onClick:()=>y.current.clear()},q.default.createElement(g.ClearOutlined,null)),q.default.createElement("span",{className:"divider"}),q.default.createElement("button",{className:"btn",onClick:()=>null==h?void 0:h()},q.default.createElement(g.CloseOutlined,null)),q.default.createElement("button",{className:"btn",onClick:()=>Ie(void 0,void 0,void 0,(function*(){V(!0),yield Ae(10);const e=yield W();V(!1),B(),null==m||m(e)}))},q.default.createElement(g.CheckOutlined,null))),q.default.createElement("button",{className:"btn btn-fold",title:v(H?"qm.divider.spread":"qm.divider.collect"),onClick:()=>$(!H)},H?q.default.createElement(g.LeftOutlined,null):q.default.createElement(g.RightOutlined,null))))))}));tm.displayName="QmSignature";const lm="1.12.15";Object.defineProperty(exports,"Affix",{enumerable:!0,get:function(){return d.Affix}}),Object.defineProperty(exports,"Alert",{enumerable:!0,get:function(){return d.Alert}}),Object.defineProperty(exports,"Anchor",{enumerable:!0,get:function(){return d.Anchor}}),Object.defineProperty(exports,"AutoComplete",{enumerable:!0,get:function(){return d.AutoComplete}}),Object.defineProperty(exports,"Avatar",{enumerable:!0,get:function(){return d.Avatar}}),Object.defineProperty(exports,"BackTop",{enumerable:!0,get:function(){return d.BackTop}}),Object.defineProperty(exports,"Badge",{enumerable:!0,get:function(){return d.Badge}}),Object.defineProperty(exports,"Breadcrumb",{enumerable:!0,get:function(){return d.Breadcrumb}}),Object.defineProperty(exports,"Button",{enumerable:!0,get:function(){return d.Button}}),Object.defineProperty(exports,"Card",{enumerable:!0,get:function(){return d.Card}}),Object.defineProperty(exports,"Carousel",{enumerable:!0,get:function(){return d.Carousel}}),Object.defineProperty(exports,"Cascader",{enumerable:!0,get:function(){return d.Cascader}}),Object.defineProperty(exports,"Checkbox",{enumerable:!0,get:function(){return d.Checkbox}}),Object.defineProperty(exports,"Col",{enumerable:!0,get:function(){return d.Col}}),Object.defineProperty(exports,"Collapse",{enumerable:!0,get:function(){return d.Collapse}}),Object.defineProperty(exports,"Comment",{enumerable:!0,get:function(){return d.Comment}}),Object.defineProperty(exports,"ConfigProvider",{enumerable:!0,get:function(){return d.ConfigProvider}}),Object.defineProperty(exports,"Descriptions",{enumerable:!0,get:function(){return d.Descriptions}}),Object.defineProperty(exports,"Divider",{enumerable:!0,get:function(){return d.Divider}}),Object.defineProperty(exports,"Drawer",{enumerable:!0,get:function(){return d.Drawer}}),Object.defineProperty(exports,"Dropdown",{enumerable:!0,get:function(){return d.Dropdown}}),Object.defineProperty(exports,"Empty",{enumerable:!0,get:function(){return d.Empty}}),Object.defineProperty(exports,"Form",{enumerable:!0,get:function(){return d.Form}}),Object.defineProperty(exports,"Grid",{enumerable:!0,get:function(){return d.Grid}}),Object.defineProperty(exports,"Image",{enumerable:!0,get:function(){return d.Image}}),Object.defineProperty(exports,"Input",{enumerable:!0,get:function(){return d.Input}}),Object.defineProperty(exports,"InputNumber",{enumerable:!0,get:function(){return d.InputNumber}}),Object.defineProperty(exports,"Layout",{enumerable:!0,get:function(){return d.Layout}}),Object.defineProperty(exports,"List",{enumerable:!0,get:function(){return d.List}}),Object.defineProperty(exports,"Mentions",{enumerable:!0,get:function(){return d.Mentions}}),Object.defineProperty(exports,"Menu",{enumerable:!0,get:function(){return d.Menu}}),Object.defineProperty(exports,"Modal",{enumerable:!0,get:function(){return d.Modal}}),Object.defineProperty(exports,"PageHeader",{enumerable:!0,get:function(){return d.PageHeader}}),Object.defineProperty(exports,"Pagination",{enumerable:!0,get:function(){return d.Pagination}}),Object.defineProperty(exports,"Popconfirm",{enumerable:!0,get:function(){return d.Popconfirm}}),Object.defineProperty(exports,"Popover",{enumerable:!0,get:function(){return d.Popover}}),Object.defineProperty(exports,"Progress",{enumerable:!0,get:function(){return d.Progress}}),Object.defineProperty(exports,"Radio",{enumerable:!0,get:function(){return d.Radio}}),Object.defineProperty(exports,"Rate",{enumerable:!0,get:function(){return d.Rate}}),Object.defineProperty(exports,"Result",{enumerable:!0,get:function(){return d.Result}}),Object.defineProperty(exports,"Row",{enumerable:!0,get:function(){return d.Row}}),Object.defineProperty(exports,"Segmented",{enumerable:!0,get:function(){return d.Segmented}}),Object.defineProperty(exports,"Select",{enumerable:!0,get:function(){return d.Select}}),Object.defineProperty(exports,"Skeleton",{enumerable:!0,get:function(){return d.Skeleton}}),Object.defineProperty(exports,"Slider",{enumerable:!0,get:function(){return d.Slider}}),Object.defineProperty(exports,"Space",{enumerable:!0,get:function(){return d.Space}}),Object.defineProperty(exports,"Spin",{enumerable:!0,get:function(){return d.Spin}}),Object.defineProperty(exports,"Statistic",{enumerable:!0,get:function(){return d.Statistic}}),Object.defineProperty(exports,"Steps",{enumerable:!0,get:function(){return d.Steps}}),Object.defineProperty(exports,"Switch",{enumerable:!0,get:function(){return d.Switch}}),Object.defineProperty(exports,"Table",{enumerable:!0,get:function(){return d.Table}}),Object.defineProperty(exports,"Tabs",{enumerable:!0,get:function(){return d.Tabs}}),Object.defineProperty(exports,"Tag",{enumerable:!0,get:function(){return d.Tag}}),Object.defineProperty(exports,"Timeline",{enumerable:!0,get:function(){return d.Timeline}}),Object.defineProperty(exports,"Tooltip",{enumerable:!0,get:function(){return d.Tooltip}}),Object.defineProperty(exports,"Transfer",{enumerable:!0,get:function(){return d.Transfer}}),Object.defineProperty(exports,"Tree",{enumerable:!0,get:function(){return d.Tree}}),Object.defineProperty(exports,"TreeSelect",{enumerable:!0,get:function(){return d.TreeSelect}}),Object.defineProperty(exports,"Typography",{enumerable:!0,get:function(){return d.Typography}}),Object.defineProperty(exports,"Upload",{enumerable:!0,get:function(){return d.Upload}}),Object.defineProperty(exports,"message",{enumerable:!0,get:function(){return d.message}}),Object.defineProperty(exports,"notification",{enumerable:!0,get:function(){return d.notification}}),Object.defineProperty(exports,"DcpPortal",{enumerable:!0,get:function(){return ue.default}}),Object.defineProperty(exports,"QmPortal",{enumerable:!0,get:function(){return ue.default}}),exports.Calendar=Je,exports.DatePicker=et,exports.DcpAnchor=Wn,exports.DcpButton=pt,exports.DcpCollapse=Ul,exports.DcpColorPicker=ud,exports.DcpConfigProvider=it,exports.DcpCopyToClipboard=pc,exports.DcpCountup=fn,exports.DcpCropper=Ff,exports.DcpDivider=vt,exports.DcpDownload=jn,exports.DcpDrawer=Gn,exports.DcpEmpty=pn,exports.DcpForm=ap,exports.DcpGuideTracker=Vp,exports.DcpLazyLoad=Qp,exports.DcpModal=Qn,exports.DcpPivotGrid=tu,exports.DcpPrint=wp,exports.DcpRangeTableHelper=Kc,exports.DcpScrollbar=_n,exports.DcpSearchHelper=Sc,exports.DcpSearchTree=Lu,exports.DcpSignature=tm,exports.DcpSpace=ht,exports.DcpSpin=mn,exports.DcpSplit=cn,exports.DcpTable=wc,exports.DcpTabs=Un,exports.DcpTinymce=tp,exports.DcpTour=pp,exports.DcpTransition=kn,exports.DcpTranslate=Hr,exports.DcpTreeHelper=oc,exports.DcpTreeTableHelper=Fc,exports.DcpUploadFile=$n,exports.DcpUploadImg=Df,exports.DcpVirtualList=mu,exports.DcpWatermark=zp,exports.QmAnchor=Wn,exports.QmButton=pt,exports.QmCollapse=Ul,exports.QmColorPicker=ud,exports.QmConfigProvider=it,exports.QmCopyToClipboard=pc,exports.QmCountup=fn,exports.QmCropper=Ff,exports.QmDivider=vt,exports.QmDownload=jn,exports.QmDrawer=Gn,exports.QmEmpty=pn,exports.QmForm=ap,exports.QmGuideTracker=Vp,exports.QmLazyLoad=Qp,exports.QmModal=Qn,exports.QmPivotGrid=tu,exports.QmPrint=wp,exports.QmRangeTableHelper=Kc,exports.QmScrollbar=_n,exports.QmSearchHelper=Sc,exports.QmSearchTree=Lu,exports.QmSignature=tm,exports.QmSpace=ht,exports.QmSpin=mn,exports.QmSplit=cn,exports.QmTable=wc,exports.QmTabs=Un,exports.QmTinymce=tp,exports.QmTour=pp,exports.QmTransition=kn,exports.QmTranslate=Hr,exports.QmTreeHelper=oc,exports.QmTreeTableHelper=Fc,exports.QmUploadFile=$n,exports.QmUploadImg=Df,exports.QmVirtualList=mu,exports.QmWatermark=zp,exports.TimePicker=lt,exports.pinyin=_r,exports.version=lm;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("dayjs"),l=require("lodash-es"),n=require("dayjs/plugin/localeData"),a=require("dayjs/plugin/advancedFormat"),r=require("dayjs/plugin/customParseFormat"),i=require("dayjs/plugin/quarterOfYear"),o=require("dayjs/plugin/weekOfYear"),s=require("dayjs/plugin/weekday"),d=require("antd"),u=require("dayjs/plugin/weekYear"),c=require("antd/es/calendar/generateCalendar"),f=require("antd/es/date-picker/generatePicker"),p=require("antd/es/locale/zh_CN"),m=require("antd/es/locale/en_GB");require("dayjs/locale/zh-cn"),require("dayjs/locale/en");var h=require("classnames"),g=require("@ant-design/icons"),v=require("react-dom"),y=require("react-countup"),b=require("resize-observer-polyfill"),x=require("sortablejs"),E=require("add-dom-event-listener"),C=require("scroll-into-view-if-needed"),w=require("react-draggable"),S=require("memoize-one"),N=require("prop-types"),T=require("@rc-component/portal"),I=require("react-sortablejs"),O=require("big.js"),R=require("exceljs"),k=require("localforage"),L=require("@rc-component/trigger"),P=require("@rc-component/color-picker"),A=require("copy-to-clipboard"),F=require("china-area-data"),_=require("cropperjs"),D=require("html2canvas");function M(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function H(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(l){if("default"!==l){var n=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(t,l,n.get?n:{enumerable:!0,get:function(){return e[l]}})}})),t.default=e,Object.freeze(t)}var q=M(e),$=H(e),j=M(t),K=M(n),V=M(a),z=M(r),W=M(i),B=M(o),U=M(s),G=M(u),Y=M(c),X=M(f),Q=M(p),Z=M(m),J=M(h),ee=M(v),te=M(y),le=M(b),ne=M(x),ae=M(E),re=M(C),ie=M(w),oe=M(S),se=M(N),de=H(N),ue=M(T),ce=M(O),fe=M(R),pe=M(k),me=M(L),he=M(P),ge=M(A),ve=M(F),ye=M(_),be=M(D);const xe=e.createContext({});var Ee={name:"zh-cn",qm:{button:{confirmPrompt:"提示",confirmTitle:"确认执行删除吗?",shortcutKey:"快捷键"},divider:{collect:"收起",spread:"展开"},dialog:{fullScreen:"全屏",cancelFullScreen:"取消全屏",close:"关 闭",confirm:"确 定",cancel:"取 消"},form:{search:"搜 索",reset:"重 置",save:"保 存",spread:"展开",collect:"收起",trueText:"是",falseText:"否",draggable:"拖动排序",requiredTips:"不能为空",searchHelperTips:"搜索帮助正在加载值",inputPlaceholder:"请输入...",selectPlaceholder:"请选择...",treePlaceholder:"树节点过滤",rangeInputNumberPlaceholder:["开始值","结束值"],rangeSearchHelper:["起始位置","结束位置"],datePlaceholder:"选择日期",timePlaceholder:"选择时间",weekPlaceholder:"选择周",monthPlaceholder:"选择月",quarterPlaceholder:"选择季度",yearPlaceholder:"选择年",daterangePlaceholder:["开始日期","结束日期"],timerangePlaceholder:["开始时间","结束时间"],monthrangePlaceholder:["开始月份","结束月份"],yearrangePlaceholder:["开始年份","结束年份"],datePickers:["今天","昨天","一周前","一个月前"],dateRangePickers:["最近一周","最近一个月","最近三个月","最近六个月"],citySelectType:["按省份","按城市"],regionSelectLabel:["省","市","区","街道"],validatePrompt:"表单校验提示"},clipboard:{success:"复制成功",error:"复制失败"},download:{text:"下载",success:"文件下载成功",error:"文件下载失败!"},upload:{tooltip:"只能上传 {type} 格式",notType:"不支持的文件类型 {type}",sizeLimit:"大小不能超过 {size}M",countLimit:"数量不能超过 {count} 个",uploadError:"文件上传失败!",downError:"文件下载失败!",text:"点击上传",remove:"删除文件",batchDownload:"批量下载"},uploadCropper:{dragableText:"拖放或点击",pasteText:"Ctrl+V 粘贴",tooltip:"只能上传 {type} 格式的图片",preview:"图片预览",cropper:"图片裁剪",uploadError:"图片上传失败!",downError:"图片下载失败!",text:"上传图片",zoomIn:"放大",zoomOut:"缩小",rotatePlus:"顺时针",rotateSubtract:"逆时针"},print:{preview:"打印预览",pageSetting:"页面设置",printError:"打印失败!",exportError:"导出失败!",defaultPrinter:"默认打印机",laserPrinter:"激光打印机",stylusPrinter:"针式打印机",printer:"打印机",type:"类型",copies:"份数",printPage:["打印第","几页"],setting:"设置",export:"导出",print:"打印",scale:"缩放",paper:"纸张",pageNumber:"页码",pagination:"第{currentPage}页 / 共{totalPage}页",setPanel:{printParameter:"打印参数",pagerType:"纸张类型",carbonPaper:"三联复写纸(针式)",printDirection:"打印方向",vertical:"纵向",horizontal:"横向",doublePrint:"双面打印",autoDoublePrint:"自动双面打印",manualDoublePrint:"手动双面打印",fixedLogo:"固定Logo",printMargin:"打印边距",leftMargin:"左边距",rightMargin:"右边距",topMargin:"上边距",bottomMargin:"下边距",sizeUnit:"厘米",noEmpty:"不能为空"}},split:{resize:"拖动改变大小"},searchHelper:{text:"搜索帮助",orderIndex:"序号",rangeStartTip:"起始位置不能大于结束位置",rangeEndTip:"结束位置不能小于起始位置"},tour:{prevStep:"上一步",nextStep:"下一步",finish:"结束引导"},guideTracker:{addButton:"添 加",editButton:"保 存",closeButton:"关 闭",finishButton:"结束并保存",label:"新手引导录入",currentStep:"当前步骤:"},table:{config:{selectionText:"选择",summaryText:"合计",copyText:"复制",emptyText:"暂无数据..."},alert:{total:"共 {total} 条",selected:"已选择 {total} 项",clear:"清空"},selection:{all:"全选所有",invert:"反选所有",clear:"清空所有",currentPage:"当前页全选"},columnFilter:{text:"列定义",reset:"重置",draggable:"拖动排序",fixedLeft:"固定左侧",fixedRight:"固定右侧",cancelFixed:"取消固定"},editable:{inputPlaceholder:"请输入",selectPlaceholder:"请选择",datePlaceholder:"选择日期",datetimePlaceholder:"选择时间"},sorter:{text:"排序",asc:"升序",desc:"降序"},filter:{search:"搜 索",reset:"重 置",searchText:"过滤{text}",searchAreaText:"过滤{text},用逗号隔开",text:"筛选",selectAll:"全选",invert:"反选",onlyItem:"仅此项",keywordSearch:"关键词搜索"},screen:{full:"全屏",cancelFull:"取消全屏"},import:{text:"导 入",textNoSpace:"导入",success:"成功导入 {total} 条记录",error:"导入失败,请检查字段名和数据格式是否正确",settingTitle:"导入设置",importType:"导入模式",insertPos:"插入位置",fillText:"新增",addText:"追加",insertText:"插入"},export:{text:"导 出",textNoSpace:"导出",closeButton:"关 闭",settingTitle:"导出设置",fileName:"文件名",fileType:"文件类型",sheetName:"标题",all:"全部",selected:"选中",custom:"自定义",footSummation:"底部合计",useStyle:"使用样式",warnText:"暂无表格数据或正在导出"},clipboard:{text:"粘 贴",textNoSpace:"粘贴",success:"成功粘贴 {total} 条记录",settingTitle:"粘贴设置",rowIndex:"粘贴起始行",colIndex:"粘贴起始列",content:"粘贴内容",placeholder:"请在此处 ctrl+v 粘贴数据",supportText:"说明:只支持粘贴 Excel 数据"},areaSelect:{mergeCell:"合并单元格",cancelMerge:"取消合并"},print:{text:"打印"},refresh:{text:"刷新"},toolbox:{text:"工具箱"},selectCollection:{text:"行选集合",settingTitle:"行选列表",closeButton:"关 闭"},groupSummary:{text:"汇总",settingTitle:"汇总设置",savedSetting:"保存的汇总设置",saveButton:"保 存",closeButton:"关 闭",confirmButton:"显示汇总",removeText:"移除",configText:"配置名称",resultText:"汇总结果",sumText:"列值汇总",maxText:"列最大值",minText:"列最小值",avgText:"列平均值",countText:"条数汇总",operation:"操作",index:"序号",groupItem:"分组项",summaryColumn:"汇总列",calcFormula:"计算公式"},highSearch:{text:"高级检索",settingTitle:"高级检索设置",searchButton:"开始检索",closeButton:"关 闭",removeText:"移除",andText:"并且",orText:"或者",gtText:"大于",ltText:"小于",gteText:"大于等于",lteText:"小于等于",eqText:"等于",neqText:"不等于",inText:"包含",ninText:"不包含",nullText:"空值",notNullText:"非空值",startsWithText:"开头是",endsWithText:"结尾是",configText:"配置名称",saveButton:"保 存",savedSetting:"保存的高级检索设置",operation:"操作",bracket:"括号",fieldName:"字段名",fieldType:"字段类型",expression:"运算",condition:"条件值",logic:"逻辑",noEmpty:"字段名不能为空"},fastSearch:{text:"数据定位查找",settingTitle:"数据定位查找设置",closeButton:"关 闭",savedSetting:"保存的数据查找设置",queryCondition:"请输入查询条件",notMatch:"没有符合条件的记录!",toTheEnd:"已查找到表格末尾,是否从头开始查找?",toStart:"已查找到表格开始,是否从末尾开始查找",matchCase:"大小写匹配",matchFullchar:"全字符匹配",queryLabel:"查找内容",queryPrev:"查找上一个",queryNext:"查找下一个",queryAll:"查找全部",findTotal:"查找到 {total} 个单元格",cellText:"单元格",valText:"值"},pivotGrid:{text:"多维表",settingTitle:"多维表看板"}},pivotGrid:{saved:{text:"配置",add:"添加配置项",title:"已保存的配置信息"},export:{text:"导出",group:"导出分组",list:"导出列表"},count:{statistic:"统计",records:"记录数",unique:"唯一值",empty:"空值",notEmpty:"非空值",sum:"合计值",max:"最大值",min:"最小值",avg:"平均值"},field:{text:"字段管理",title:"字段自定义设置"},fillColor:{text:"填色",add:"添加条件",title:"设置填色条件",cell:"单元格",row:"整行",col:"整列"},filter:{text:"筛选",title:"设置筛选条件",matchAll:"满足所有条件",matchAny:"满足任一条件"},group:{text:"分组",title:"设置分组条件",foldAll:"折叠所有",unfoldAll:"展开所有",empty:"(内容为空)",ascend:"选项顺序",descend:"选项倒序"},lineHeight:{text:"行高",size:["常规","中等","高"]},search:{text:"查找",title:"设置查找条件"},sorter:{text:"排序",title:"设置排序条件",ascend:"字段升序",descend:"字段降序"},viewMode:{table:"表格视图",gantt:"甘特视图",card:"看板视图"}},translate:{sourceText:"原文",targetText:"翻译",translating:"翻译中"}}};let Ce=Ee;function we(e,t){return e&&t?e.replace(/\{(\w+)\}/g,((e,l)=>t[l])):e}const Se=(...e)=>{const[t,l]=e;let n;const a=t.split(".");let r=Ce;for(let e=0,t=a.length;e<t;e++){if(n=r[a[e]],e===t-1)return we(n,l);if(!n)return"";r=n}return""};function Ne(e,t){var l={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(l[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(l[n[a]]=e[n[a]])}return l}function Te(e,t,l,n){var a,r=arguments.length,i=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,l):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,l,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(i=(r<3?a(i):r>3?a(t,l,i):a(t,l))||i);return r>3&&i&&Object.defineProperty(t,l,i),i}function Ie(e,t,l,n){return new(l||(l=Promise))((function(a,r){function i(e){try{s(n.next(e))}catch(e){r(e)}}function o(e){try{s(n.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof l?t:new l((function(e){e(t)}))).then(i,o)}s((n=n.apply(e,t||[])).next())}))}var Oe="undefined"==typeof window;const Re=e=>q.default.isValidElement(e),ke=e=>Re(e)&&e.type===q.default.Fragment,Le=()=>{},Pe=()=>!0,Ae=e=>Ie(void 0,void 0,void 0,(function*(){return new Promise((t=>setTimeout(t,e)))})),Fe=e=>{Promise.resolve().then(e)},_e=e=>e.replace(/-(\w)/g,((e,t)=>t?t.toUpperCase():"")),De=e=>!!(!e&&0!==e||l.isArray(e)&&!e.length||l.isPlainObject(e)&&!Object.keys(e).length),Me=(e,t)=>t.split(".").reduce(((e,t)=>null==e?void 0:e[t]),e),He=(e,t)=>{const l=Object.assign({},e);for(const e of t)delete l[e];return l};const qe=(e,t=new WeakMap)=>{if(l.isPlainObject(e)||l.isArray(e)){const l=Array.isArray(e),n=l?[]:{};if(t.get(e))return e;t.set(e,n);const a=l?void 0:Object.keys(e);return function(e,t){let l=-1;const n=e.length;for(;++l<n;)t(e[l],l)}(a||e,((l,r)=>{a&&(r=l),n[r]=qe(e[r],t)})),n}return e},$e=e=>l.isNumber(e)?`${e}px`:e.toString(),je=(e,t)=>Object.assign(Object.assign({},e),Object.keys(t).reduce(((l,n)=>(l[n]=void 0!==t[n]?t[n]:e[n],l)),{}));j.default.extend(K.default),j.default.extend(V.default),j.default.extend(z.default),j.default.extend(W.default),j.default.extend(B.default),j.default.extend(U.default);var Ke={},Ve=[];function ze(e,t){if(!e&&void 0!==console){var l=Ve.reduce((function(e,t){return t(null!=e?e:"","warning")}),t);l&&console.error("Warning: ".concat(l))}}function We(e,t){if(!e&&void 0!==console){var l=Ve.reduce((function(e,t){return t(null!=e?e:"","note")}),t);l&&console.warn("Note: ".concat(l))}}function Be(e,t,l){t||Ke[l]||(e(!1,l),Ke[l]=!0)}function Ue(e,t){Be(ze,e,t)}function Ge(e,t){Be(We,e,t)}Ue.preMessage=function(e){Ve.push(e)},Ue.resetWarned=function(){Ke={}},Ue.noteOnce=Ge,j.default.extend(z.default),j.default.extend(V.default),j.default.extend(U.default),j.default.extend(K.default),j.default.extend(B.default),j.default.extend(G.default),j.default.extend((function(e,t){var l=t.prototype,n=l.format;l.format=function(e){var t=(e||"").replace("Wo","wo");return n.bind(this)(t)}}));var Ye={bn_BD:"bn-bd",by_BY:"be",en_GB:"en-gb",en_US:"en",fr_BE:"fr",fr_CA:"fr-ca",hy_AM:"hy-am",kmr_IQ:"ku",nl_BE:"nl-be",pt_BR:"pt-br",zh_CN:"zh-cn",zh_HK:"zh-hk",zh_TW:"zh-tw"},Xe=function(e){return Ye[e]||e.split("_")[0]},Qe=function(){Ge(!1,"Not match any format. Please help to fire a issue about this.")},Ze={getNow:function(){return j.default()},getFixedDate:function(e){return j.default(e,["YYYY-M-DD","YYYY-MM-DD"])},getEndDate:function(e){return e.endOf("month")},getWeekDay:function(e){var t=e.locale("en");return t.weekday()+t.localeData().firstDayOfWeek()},getYear:function(e){return e.year()},getMonth:function(e){return e.month()},getDate:function(e){return e.date()},getHour:function(e){return e.hour()},getMinute:function(e){return e.minute()},getSecond:function(e){return e.second()},addYear:function(e,t){return e.add(t,"year")},addMonth:function(e,t){return e.add(t,"month")},addDate:function(e,t){return e.add(t,"day")},setYear:function(e,t){return e.year(t)},setMonth:function(e,t){return e.month(t)},setDate:function(e,t){return e.date(t)},setHour:function(e,t){return e.hour(t)},setMinute:function(e,t){return e.minute(t)},setSecond:function(e,t){return e.second(t)},isAfter:function(e,t){return e.isAfter(t)},isValidate:function(e){return e.isValid()},locale:{getWeekFirstDay:function(e){return j.default().locale(Xe(e)).localeData().firstDayOfWeek()},getWeekFirstDate:function(e,t){return t.locale(Xe(e)).weekday(0)},getWeek:function(e,t){return t.locale(Xe(e)).week()},getShortWeekDays:function(e){return j.default().locale(Xe(e)).localeData().weekdaysMin()},getShortMonths:function(e){return j.default().locale(Xe(e)).localeData().monthsShort()},format:function(e,t,l){return t.locale(Xe(e)).format(l)},parse:function(e,t,l){for(var n=Xe(e),a=0;a<l.length;a+=1){var r=l[a],i=t;if(r.includes("wo")||r.includes("Wo")){for(var o=i.split("-")[0],s=i.split("-")[1],d=j.default(o,"YYYY").startOf("year").locale(n),u=0;u<=52;u+=1){var c=d.add(u,"week");if(c.format("Wo")===s)return c}return Qe(),null}var f=j.default(i,r).locale(n);if(f.isValid())return f}return t&&Qe(),null}}};const Je=Y.default(Ze),et=X.default(Ze);function tt(){return tt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)({}).hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e},tt.apply(null,arguments)}const lt=$.forwardRef(((e,t)=>$.createElement(et,tt({},e,{picker:"time",mode:void 0,ref:t}))));lt.displayName="TimePicker";const nt=$.forwardRef(((e,t)=>$.createElement(et.RangePicker,tt({},e,{picker:"time",mode:void 0,ref:t}))));nt.displayName="RangePicker",lt.RangePicker=nt;var at={name:"en",qm:{button:{confirmPrompt:"Prompt",confirmTitle:"Are you sure you want to delete it?",shortcutKey:"Shortcut Key"},divider:{collect:"Collapse",spread:"Expand"},dialog:{fullScreen:"Full Screen",cancelFullScreen:"Cancel Full Screen",close:"Close",confirm:"Confirm",cancel:"Cancel"},form:{search:"Search",reset:"Reset",save:"Save",spread:"Expand",collect:"Collapse",trueText:"Yes",falseText:"No",draggable:"Drag and sort",requiredTips:" is required",searchHelperTips:"Search Helper is loading value",inputPlaceholder:"Please enter...",selectPlaceholder:"Please select...",treePlaceholder:"Tree node filter",rangeInputNumberPlaceholder:["Start value","End value"],rangeSearchHelper:["Start","End"],datePlaceholder:"Select date",timePlaceholder:"Select time",weekPlaceholder:"Select week",monthPlaceholder:"Select month",quarterPlaceholder:"Select quarter",yearPlaceholder:"Select year",daterangePlaceholder:["Start date","End date"],timerangePlaceholder:["Start time","End time"],monthrangePlaceholder:["Start month","End month"],yearrangePlaceholder:["Start year","End year"],datePickers:["Today","Yesterday","A Week Ago","A Month Ago"],dateRangePickers:["Nearly A Week","Nearly A Month","Nearly Three Months","Nearly Six Months"],citySelectType:["Province","City"],regionSelectLabel:["Province","City","Region","Street"],validatePrompt:"Form validation tips"},clipboard:{success:"Copy successful",error:"Copy failed"},download:{text:"Download",success:"File downloaded successfully",error:"File download failed!"},upload:{tooltip:"Can only upload {type} format",notType:"Unsupported file types {type}",sizeLimit:"Size cannot exceed {size}M",countLimit:"Quantity cannot exceed {count}",uploadError:"Failed to upload files!",downError:"File download failed!",text:"click and upload",remove:"Delete files",batchDownload:"Batch download"},uploadCropper:{dragableText:"Drop or click",pasteText:"Ctrl+V Paste",tooltip:"Can only upload {type} format",preview:"Preview image",cropper:"Cropper image",uploadError:"Failed to upload images!",downError:"Image download failed!",text:"Upload image",zoomIn:"Zoom in",zoomOut:"Zoom out",rotatePlus:"Rotate plus",rotateSubtract:"Rotate subtract"},print:{preview:"Print preview",pageSetting:"Page setting",printError:"Print failed!",exportError:"Export failed!",defaultPrinter:"Default printer",laserPrinter:"Laser printer",stylusPrinter:"Stylus printer",printer:"Printer",type:"Type",copies:"Copies",printPage:["Print","page"],setting:"Setting",export:"Export",print:"Print",scale:"Scale",paper:"Paper",pageNumber:"Number",pagination:"{currentPage} / {totalPage} page",setPanel:{printParameter:"Print parameter",pagerType:"Pager type",carbonPaper:"Triple carbon paper(stylus)",printDirection:"Print direction",vertical:"Vertical",horizontal:"Horizontal",doublePrint:"Double print",autoDoublePrint:"Auto double print",manualDoublePrint:"Manual double print",fixedLogo:"Fixed Logo",printMargin:"Print margin",leftMargin:"Left margin",rightMargin:"Light margin",topMargin:"Top margin",bottomMargin:"Bottom margin",sizeUnit:"cm",noEmpty:"Can not be empty"}},split:{resize:"Drag to change size"},searchHelper:{text:"Search helper",orderIndex:"Index",rangeStartTip:"Start position cannot be greater than end position",rangeEndTip:"End position cannot be less than start position"},tour:{prevStep:"Prev",nextStep:"Next",finish:"Finish"},guideTracker:{addButton:"Add To",editButton:"Save",closeButton:"Close",finishButton:"Finish And Save",label:"Operation guide collection",currentStep:"Current Step: "},table:{config:{selectionText:"#",summaryText:"Summation",copyText:"Copy",emptyText:"No Data..."},alert:{total:"Total {total} items",selected:"Selected {total}",clear:"Clear"},selection:{all:"Select all",invert:"Invert select",clear:"Clear all",currentPage:"Select all on current page"},columnFilter:{text:"Define",reset:"Reset",draggable:"Drag and sort",fixedLeft:"Fixed left",fixedRight:"Fixed right",cancelFixed:"Cancel fixed"},editable:{inputPlaceholder:"Please input",selectPlaceholder:"Please select",datePlaceholder:"Select date",datetimePlaceholder:"Select time"},sorter:{text:"Sort",asc:"Ascending",desc:"Descending"},filter:{search:"Search",reset:"Reset",searchText:"Filter {text}",searchAreaText:"Filter {text}, separated by commas",text:"Filter",selectAll:"Select all",invert:"Invert",onlyItem:"Only item",keywordSearch:"Keyword Search"},screen:{full:"Full Screen",cancelFull:"Cancel Full Screen"},import:{text:"Import",textNoSpace:"Import",success:"Successfully imported {total} records",error:"Import failed, please check that the field name and data format are correct.",settingTitle:"Import setting",importType:"Import type",insertPos:"Insertion position",fillText:"fill",addText:"add",insertText:"insert"},export:{text:"Export",textNoSpace:"Export",closeButton:"Close",settingTitle:"Export setting",fileName:"File name",fileType:"File type",sheetName:"Title",all:"All",selected:"Selected",custom:"Custom",footSummation:"Summation",useStyle:"Use style",warnText:"No table data or exporting"},clipboard:{text:"Paste",textNoSpace:"Paste",success:"Successfully paste {total} records",settingTitle:"Paste setting",rowIndex:"Start row index",colIndex:"Start col index",content:"content",placeholder:"Please paste data here with ctrl+v",supportText:"Note: only excel data can be pasted"},areaSelect:{mergeCell:"Cell Merge",cancelMerge:"Cancel Merge"},print:{text:"Print"},refresh:{text:"Reload"},toolbox:{text:"Tool box"},selectCollection:{text:"Selected row collection",settingTitle:"Selected row list",closeButton:"Close"},groupSummary:{text:"Summary",settingTitle:"Summary setting",savedSetting:"Saved configuration",saveButton:"Save",closeButton:"Close",confirmButton:"Show summary",removeText:"Remove",configText:"Configuration name",resultText:"Summary result",sumText:"column value summary",maxText:"column max value",minText:"column min value",avgText:"column avg value",countText:"records summary",operation:"Operation",index:"Index",groupItem:"Group item",summaryColumn:"Summary column",calcFormula:"Calculate formula"},highSearch:{text:"Super search",settingTitle:"Super search setting",searchButton:"Start search",closeButton:"Close",removeText:"Remove",andText:"and",orText:"or",gtText:"is greater than",ltText:"is lesser than",gteText:"is equal or greater than",lteText:"is equal or lesser than",eqText:"is equal to",neqText:"is not equal to",inText:"include",ninText:"not include",nullText:"null value",notNullText:"not null value",startsWithText:"beginning is",endsWithText:"ending is",configText:"Configuration name",saveButton:"Save",savedSetting:"Saved configuration",operation:"Operation",bracket:"Bracket",fieldName:"Field name",fieldType:"Field type",expression:"Expression",condition:"Condition value",logic:"Logic",noEmpty:"Can not be empty"},fastSearch:{text:"Records location search",settingTitle:"Records location search setting",closeButton:"Close",savedSetting:"Saved configuration",queryCondition:"Please enter query condition",notMatch:"There are no qualified records!",toTheEnd:"It has been found to the end. Do you want to find it from the beginning?",toStart:"The start has been found. Do you want to start from the end?",matchCase:"Case matching",matchFullchar:"Full character matching",queryLabel:"Find content",queryPrev:"Find previous",queryNext:"Find next",queryAll:"Find all",findTotal:"Found {total} cells",cellText:"Cell",valText:"Value"},pivotGrid:{text:"Pivot Grid",settingTitle:"Pivot Grid Dashboard"}},pivotGrid:{saved:{text:"Config",add:"Add configuration",title:"Saved configuration list"},export:{text:"Export",group:"Export group",list:"Export list"},count:{statistic:"Statistics",records:"count",unique:"unique",empty:"empty",notEmpty:"not empty",sum:"sum value",max:"max value",min:"min value",avg:"avg value"},field:{text:"Field manage",title:"Field customization settings"},fillColor:{text:"Fill color",add:"Add condition",title:"Set fill color conditions",cell:"Cell",row:"Row",col:"Col"},filter:{text:"Filter",title:"Set filter conditions",matchAll:"Meet all conditions",matchAny:"Meet any conditions"},group:{text:"Group",title:"Set group conditions",foldAll:"Fold all",unfoldAll:"unfold all",empty:"(Empty content)",ascend:"Order ascend",descend:"Order descend"},lineHeight:{text:"Line height",size:["Common size","Middle size","Large size"]},search:{text:"Search",title:"Set search conditions"},sorter:{text:"Sorter",title:"Set sorter conditions",ascend:"Field ascend",descend:"Field descend"},viewMode:{table:"Table view",gantt:"Gantt view",card:"Card view"}},translate:{sourceText:"Source Text",targetText:"Target Text",translating:"Translating"}}};const rt={[at.name]:{qm:at,antd:Z.default},[Ee.name]:{qm:Ee,antd:Q.default}},it=e=>{const t="zh-cn",l=je({locale:t,size:"middle"},e),{locale:n,size:a,global:r}=l,i=q.default.useMemo((()=>Object.assign({},rt,null==r?void 0:r.langPackage)),[r]),o=q.default.useMemo((()=>r?He(r,["langPackage"]):r),[r]),s=(e,l)=>{const n=e.split("-")[0],a=i[e]?e:i[n]?n:t;return i[a][l]};q.default.useMemo((()=>{return e=s(n,"qm"),Ce=e||Ce,void(Ce.name&&j.default.locale(Ce.name));var e}),[n]);const u=q.default.useMemo((()=>({locale:n,size:a,global:o})),[n,a]);return q.default.createElement(xe.Provider,{value:u},q.default.createElement(d.ConfigProvider,{locale:s(n,"antd"),componentSize:a,autoInsertSpaceInButton:null==o?void 0:o.autoInsertSpaceInButton},l.children))};function ot(){const{locale:e}=$.useContext(xe);return{t:Se,$locale:e}}function st(e){const t=$.useRef();t.current=e;return $.useCallback(((...e)=>{var l;return null===(l=t.current)||void 0===l?void 0:l.call(t,...e)}),[])}function dt(e){const{size:t}=$.useContext(xe);return{$size:$.useMemo((()=>{var l,n;return null!==(n=null!==(l=e.size)&&void 0!==l?l:t)&&void 0!==n?n:""}),[e.size,t])}}it.displayName="QmConfigProvider";class ut extends Error{constructor(e){super(e),this.name="QmDesignError"}}function ct(e,t){throw new ut(`[${e}] ${t}`)}function ft(e,t){console.warn(new ut(`[${e}] ${t}`))}const pt=e=>{const{loading:t,shortcutKey:n,authConfig:a,click:r,confirm:i}=e,{t:o}=ot(),{$size:s}=dt(e);q.default.useEffect((()=>(n&&document.addEventListener("keyup",f),()=>document.removeEventListener("keyup",f))),[]);const[u,c]=q.default.useState(!1),f=st((e=>{var t;const l=n.split("+").map((e=>e.trim().toLowerCase())),a=l.includes("alt"),r=l.includes("ctrl"),i=l.includes("shift"),o=l[l.length-1];a&&!e.altKey||r&&!e.ctrlKey||i&&!e.shiftKey||e.key.toLowerCase()!==o||(e.preventDefault(),m.disabled||null===(t=m.onClick)||void 0===t||t.call(m,e))})),p=l.isFunction(r)?{onClick:t=>Ie(void 0,void 0,void 0,(function*(){var l;c(!0);try{yield null===(l=e.click)||void 0===l?void 0:l.call(e,t)}catch(e){ft("Button","`click`方法执行出错")}c(!1)}))}:null,m=Object.assign(Object.assign(Object.assign({},He(e,["shortcutKey","authConfig","click","confirm"])),{size:s,loading:u||t||!1}),p);if(a){const{visible:e=1,disabled:t}=a||{};if(!e)return null;t&&(m.disabled=!0)}const h=q.default.createElement(d.Button,m,e.children);return i?q.default.createElement(d.Popconfirm,{title:i.title||o("qm.button.confirmTitle"),disabled:m.disabled,onConfirm:e=>{var t,l;null===(t=i.onConfirm)||void 0===t||t.call(i),null===(l=m.onClick)||void 0===l||l.call(m,e)},onCancel:e=>{var t;null===(t=i.onCancel)||void 0===t||t.call(i,e)}},q.default.createElement(d.Button,tt({},m,{onClick:Le}),e.children)):!n||m.disabled?h:q.default.createElement(d.Tooltip,{placement:"top",title:`${o("qm.button.shortcutKey")}: ${n}`},h)};var mt;pt.displayName="QmButton",function(e){e[e.default=14]="default",e[e.large=12]="large",e[e.middle=10]="middle",e[e.small=8]="small"}(mt||(mt={}));const ht=e=>{const{$size:t}=dt(e),n=l.isNumber(e.size)?e.size:mt[t||"default"],a=Object.assign(Object.assign({},He(e,["size"])),{size:n});return q.default.createElement(d.Space,a,e.children)};ht.displayName="QmSpace";const gt=e=>`qm-${e}`,vt=e=>{const{label:t,extra:l,collapse:n,bordered:a=!0,disabled:r,id:i,className:o,style:s,onCollapseChange:u}=e,{$size:c}=dt(e),{t:f}=ot(),p=gt("divider"),m={[p]:!0,[`${p}-borderless`]:!a,[`${p}--lg`]:"large"===c,[`${p}--sm`]:"small"===c};return q.default.createElement("div",{id:i,className:J.default(m,o),style:s},q.default.createElement("span",{className:`${p}__title`},t),q.default.createElement("div",{className:`${p}__extra`},l),void 0!==n&&q.default.createElement(d.Button,{type:"link",className:`${p}__collapse`,disabled:r,onClick:()=>{null==u||u(!n)}},f(n?"qm.divider.collect":"qm.divider.spread"),n?q.default.createElement(g.UpOutlined,null):q.default.createElement(g.DownOutlined,null)))};vt.displayName="QmDivider";const yt=()=>({height:0,opacity:0}),bt=e=>({height:e.scrollHeight,opacity:1}),xt=e=>({height:e?e.offsetHeight:0}),Et=(e,t)=>!0===(null==t?void 0:t.deadline)||"height"===t.propertyName;function Ct(e){return Ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ct(e)}function wt(e){var t=function(e,t){if("object"!==Ct(e)||null===e)return e;var l=e[Symbol.toPrimitive];if(void 0!==l){var n=l.call(e,t||"default");if("object"!==Ct(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ct(t)?t:String(t)}function St(e,t,l){return(t=wt(t))in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}function Nt(e,t){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),l.push.apply(l,n)}return l}function Tt(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{};t%2?Nt(Object(l),!0).forEach((function(t){St(e,t,l[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(l)):Nt(Object(l)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(l,t))}))}return e}function It(e,t){(null==t||t>e.length)&&(t=e.length);for(var l=0,n=new Array(t);l<t;l++)n[l]=e[l];return n}function Ot(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var l=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=l){var n,a,r,i,o=[],s=!0,d=!1;try{if(r=(l=l.call(e)).next,0===t){if(Object(l)!==l)return;s=!1}else for(;!(s=(n=r.call(l)).done)&&(o.push(n.value),o.length!==t);s=!0);}catch(e){d=!0,a=e}finally{try{if(!s&&null!=l.return&&(i=l.return(),Object(i)!==i))return}finally{if(d)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return It(e,t);var l=Object.prototype.toString.call(e).slice(8,-1);return"Object"===l&&e.constructor&&(l=e.constructor.name),"Map"===l||"Set"===l?Array.from(e):"Arguments"===l||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?It(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rt(e){return e instanceof HTMLElement||e instanceof SVGElement}function kt(e){var t,l=function(e){return e&&"object"===Ct(e)&&Rt(e.nativeElement)?e.nativeElement:Rt(e)?e:null}(e);return l||(e instanceof q.default.Component?null===(t=ee.default.findDOMNode)||void 0===t?void 0:t.call(ee.default,e):null)}var Lt,Pt={exports:{}},At={};Pt.exports=(Lt||(Lt=1,function(){var e,t=Symbol.for("react.element"),l=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),s=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen");function h(e){if("object"==typeof e&&null!==e){var m=e.$$typeof;switch(m){case t:var h=e.type;switch(h){case n:case r:case a:case u:case c:return h;default:var g=h&&h.$$typeof;switch(g){case s:case o:case d:case p:case f:case i:return g;default:return m}}case l:return m}}}e=Symbol.for("react.module.reference");var g=o,v=i,y=t,b=d,x=n,E=p,C=f,w=l,S=r,N=a,T=u,I=c,O=!1,R=!1;At.ContextConsumer=g,At.ContextProvider=v,At.Element=y,At.ForwardRef=b,At.Fragment=x,At.Lazy=E,At.Memo=C,At.Portal=w,At.Profiler=S,At.StrictMode=N,At.Suspense=T,At.SuspenseList=I,At.isAsyncMode=function(e){return O||(O=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},At.isConcurrentMode=function(e){return R||(R=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},At.isContextConsumer=function(e){return h(e)===o},At.isContextProvider=function(e){return h(e)===i},At.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},At.isForwardRef=function(e){return h(e)===d},At.isFragment=function(e){return h(e)===n},At.isLazy=function(e){return h(e)===p},At.isMemo=function(e){return h(e)===f},At.isPortal=function(e){return h(e)===l},At.isProfiler=function(e){return h(e)===r},At.isStrictMode=function(e){return h(e)===a},At.isSuspense=function(e){return h(e)===u},At.isSuspenseList=function(e){return h(e)===c},At.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===r||t===a||t===u||t===c||t===m||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===f||t.$$typeof===i||t.$$typeof===o||t.$$typeof===d||t.$$typeof===e||void 0!==t.getModuleId)},At.typeOf=h}()),At);var Ft=function(e,t){"function"==typeof e?e(t):"object"===Ct(e)&&e&&"current"in e&&(e.current=t)},_t=function(){for(var e=arguments.length,t=new Array(e),l=0;l<e;l++)t[l]=arguments[l];var n=t.filter(Boolean);return n.length<=1?n[0]:function(e){t.forEach((function(t){Ft(t,e)}))}},Dt=function(e){var t,l,n=Pt.exports.isMemo(e)?e.type.type:e.type;return!!("function"!=typeof n||null!==(t=n.prototype)&&void 0!==t&&t.render||n.$$typeof===Pt.exports.ForwardRef)&&!!("function"!=typeof e||null!==(l=e.prototype)&&void 0!==l&&l.render||e.$$typeof===Pt.exports.ForwardRef)};function Mt(e,t){if(null==e)return{};var l,n,a=function(e,t){if(null==e)return{};var l,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)l=r[n],t.indexOf(l)>=0||(a[l]=e[l]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)l=r[n],t.indexOf(l)>=0||Object.prototype.propertyIsEnumerable.call(e,l)&&(a[l]=e[l])}return a}Number(e.version.split(".")[0]);var Ht=$.createContext({});function qt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $t(e,t){for(var l=0;l<t.length;l++){var n=t[l];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,wt(n.key),n)}}function jt(e,t,l){return t&&$t(e.prototype,t),l&&$t(e,l),Object.defineProperty(e,"prototype",{writable:!1}),e}function Kt(e,t){return Kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Kt(e,t)}function Vt(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kt(e,t)}function zt(e){return zt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zt(e)}function Wt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var l,n=zt(e);if(t){var a=zt(this).constructor;l=Reflect.construct(n,arguments,a)}else l=n.apply(this,arguments);return function(e,t){if(t&&("object"===Ct(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Wt(e)}(this,l)}}var Ut=function(e){Vt(l,$.Component);var t=Bt(l);function l(){return qt(this,l),t.apply(this,arguments)}return jt(l,[{key:"render",value:function(){return this.props.children}}]),l}();function Gt(e){var t=$.useRef(!1),l=Ot($.useState(e),2),n=l[0],a=l[1];return $.useEffect((function(){return t.current=!1,function(){t.current=!0}}),[]),[n,function(e,l){l&&t.current||a(e)}]}var Yt="none",Xt="appear",Qt="enter",Zt="leave",Jt="none",el="prepare",tl="start",ll="active",nl="end",al="prepared";function rl(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}function il(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit".concat(e)]="webkit".concat(t),l["Moz".concat(e)]="moz".concat(t),l["ms".concat(e)]="MS".concat(t),l["O".concat(e)]="o".concat(t.toLowerCase()),l}var ol,sl,dl,ul=(ol=rl(),sl="undefined"!=typeof window?window:{},dl={animationend:il("Animation","AnimationEnd"),transitionend:il("Transition","TransitionEnd")},ol&&("AnimationEvent"in sl||delete dl.animationend.animation,"TransitionEvent"in sl||delete dl.transitionend.transition),dl),cl={};if(rl()){var fl=document.createElement("div");cl=fl.style}var pl={};function ml(e){if(pl[e])return pl[e];var t=ul[e];if(t)for(var l=Object.keys(t),n=l.length,a=0;a<n;a+=1){var r=l[a];if(Object.prototype.hasOwnProperty.call(t,r)&&r in cl)return pl[e]=t[r],pl[e]}return""}var hl=ml("animationend"),gl=ml("transitionend"),vl=!(!hl||!gl),yl=hl||"animationend",bl=gl||"transitionend";function xl(e,t){return e?"object"===Ct(e)?e[t.replace(/-\w/g,(function(e){return e[1].toUpperCase()}))]:"".concat(e,"-").concat(t):null}var El=function(t){var l=e.useRef(),n=e.useRef(t);n.current=t;var a=$.useCallback((function(e){n.current(e)}),[]);function r(e){e&&(e.removeEventListener(bl,a),e.removeEventListener(yl,a))}return $.useEffect((function(){return function(){r(l.current)}}),[]),[function(e){l.current&&l.current!==e&&r(l.current),e&&e!==l.current&&(e.addEventListener(bl,a),e.addEventListener(yl,a),l.current=e)},r]},Cl=rl()?e.useLayoutEffect:e.useEffect,wl=function(e){return+setTimeout(e,16)},Sl=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(wl=function(e){return window.requestAnimationFrame(e)},Sl=function(e){return window.cancelAnimationFrame(e)});var Nl=0,Tl=new Map;function Il(e){Tl.delete(e)}var Ol=function(e){var t=Nl+=1;return function l(n){if(0===n)Il(t),e();else{var a=wl((function(){l(n-1)}));Tl.set(t,a)}}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),t};Ol.cancel=function(e){var t=Tl.get(e);return Il(e),Sl(t)},Ol.ids=function(){return Tl};var Rl=[el,tl,ll,nl],kl=[el,al],Ll=!1,Pl=!0;function Al(e){return e===ll||e===nl}var Fl=function(e,t,l){var n=Ot(Gt(Jt),2),a=n[0],r=n[1],i=function(){var e=$.useRef(null);function t(){Ol.cancel(e.current)}return $.useEffect((function(){return function(){t()}}),[]),[function l(n){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;t();var r=Ol((function(){a<=1?n({isCanceled:function(){return r!==e.current}}):l(n,a-1)}));e.current=r},t]}(),o=Ot(i,2),s=o[0],d=o[1];var u=t?kl:Rl;return Cl((function(){if(a!==Jt&&a!==nl){var e=u.indexOf(a),t=u[e+1],n=l(a);n===Ll?r(t,!0):t&&s((function(e){function l(){e.isCanceled()||r(t,!0)}!0===n?l():Promise.resolve(n).then(l)}))}}),[e,a]),$.useEffect((function(){return function(){d()}}),[]),[function(){r(el,!0)},a]};var _l=function(t){var l=t;"object"===Ct(t)&&(l=t.transitionSupport);var n=$.forwardRef((function(t,n){var a=t.visible,r=void 0===a||a,i=t.removeOnLeave,o=void 0===i||i,s=t.forceRender,d=t.children,u=t.motionName,c=t.leavedClassName,f=t.eventProps,p=function(e,t){return!(!e.motionName||!l||!1===t)}(t,$.useContext(Ht).motion),m=e.useRef(),h=e.useRef();var g=function(t,l,n,a){var r=a.motionEnter,i=void 0===r||r,o=a.motionAppear,s=void 0===o||o,d=a.motionLeave,u=void 0===d||d,c=a.motionDeadline,f=a.motionLeaveImmediately,p=a.onAppearPrepare,m=a.onEnterPrepare,h=a.onLeavePrepare,g=a.onAppearStart,v=a.onEnterStart,y=a.onLeaveStart,b=a.onAppearActive,x=a.onEnterActive,E=a.onLeaveActive,C=a.onAppearEnd,w=a.onEnterEnd,S=a.onLeaveEnd,N=a.onVisibleChanged,T=Ot(Gt(),2),I=T[0],O=T[1],R=Ot(Gt(Yt),2),k=R[0],L=R[1],P=Ot(Gt(null),2),A=P[0],F=P[1],_=e.useRef(!1),D=e.useRef(null);function M(){return n()}var H=e.useRef(!1);function q(){L(Yt,!0),F(null,!0)}function j(e){var t=M();if(!e||e.deadline||e.target===t){var l,n=H.current;k===Xt&&n?l=null==C?void 0:C(t,e):k===Qt&&n?l=null==w?void 0:w(t,e):k===Zt&&n&&(l=null==S?void 0:S(t,e)),k!==Yt&&n&&!1!==l&&q()}}var K=Ot(El(j),1)[0],V=function(e){var t,l,n;switch(e){case Xt:return St(t={},el,p),St(t,tl,g),St(t,ll,b),t;case Qt:return St(l={},el,m),St(l,tl,v),St(l,ll,x),l;case Zt:return St(n={},el,h),St(n,tl,y),St(n,ll,E),n;default:return{}}},z=$.useMemo((function(){return V(k)}),[k]),W=Ot(Fl(k,!t,(function(e){if(e===el){var t=z[el];return t?t(M()):Ll}var l;return U in z&&F((null===(l=z[U])||void 0===l?void 0:l.call(z,M(),null))||null),U===ll&&(K(M()),c>0&&(clearTimeout(D.current),D.current=setTimeout((function(){j({deadline:!0})}),c))),U===al&&q(),Pl})),2),B=W[0],U=W[1],G=Al(U);H.current=G,Cl((function(){O(l);var e,n=_.current;_.current=!0,!n&&l&&s&&(e=Xt),n&&l&&i&&(e=Qt),(n&&!l&&u||!n&&f&&!l&&u)&&(e=Zt);var a=V(e);e&&(t||a[el])?(L(e),B()):L(Yt)}),[l]),e.useEffect((function(){(k===Xt&&!s||k===Qt&&!i||k===Zt&&!u)&&L(Yt)}),[s,i,u]),e.useEffect((function(){return function(){_.current=!1,clearTimeout(D.current)}}),[]);var Y=$.useRef(!1);e.useEffect((function(){I&&(Y.current=!0),void 0!==I&&k===Yt&&((Y.current||I)&&(null==N||N(I)),Y.current=!0)}),[I,k]);var X=A;return z[el]&&U===tl&&(X=Tt({transition:"none"},X)),[k,U,X,null!=I?I:l]}(p,r,(function(){try{return m.current instanceof HTMLElement?m.current:kt(h.current)}catch(e){return null}}),t),v=Ot(g,4),y=v[0],b=v[1],x=v[2],E=v[3],C=$.useRef(E);E&&(C.current=!0);var w,S=$.useCallback((function(e){m.current=e,Ft(n,e)}),[n]),N=Tt(Tt({},f),{},{visible:r});if(d)if(y===Yt)w=E?d(Tt({},N),S):!o&&C.current&&c?d(Tt(Tt({},N),{},{className:c}),S):s||!o&&!c?d(Tt(Tt({},N),{},{style:{display:"none"}}),S):null;else{var T,I;b===el?I="prepare":Al(b)?I="active":b===tl&&(I="start");var O=xl(u,"".concat(y,"-").concat(I));w=d(Tt(Tt({},N),{},{className:J.default(xl(u,y),(T={},St(T,O,O&&I),St(T,u,"string"==typeof u),T)),style:x}),S)}else w=null;$.isValidElement(w)&&Dt(w)&&(w.ref||(w=$.cloneElement(w,{ref:S})));return $.createElement(Ut,{ref:h},w)}));return n.displayName="CSSMotion",n}(vl);function Dl(){return Dl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e},Dl.apply(this,arguments)}var Ml="add",Hl="keep",ql="remove",$l="removed";function jl(e){var t;return Tt(Tt({},t=e&&"object"===Ct(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function Kl(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(jl)}var Vl=["component","children","onVisibleChanged","onAllRemoved"],zl=["status"],Wl=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_l,l=function(e){Vt(n,$.Component);var l=Bt(n);function n(){var e;qt(this,n);for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];return St(Wt(e=l.call.apply(l,[this].concat(a))),"state",{keyEntities:[]}),St(Wt(e),"removeKey",(function(t){var l=e.state.keyEntities.map((function(e){return e.key!==t?e:Tt(Tt({},e),{},{status:$l})}));return e.setState({keyEntities:l}),l.filter((function(e){return e.status!==$l})).length})),e}return jt(n,[{key:"render",value:function(){var e=this,l=this.state.keyEntities,n=this.props,a=n.component,r=n.children,i=n.onVisibleChanged,o=n.onAllRemoved,s=Mt(n,Vl),d=a||$.Fragment,u={};return Wl.forEach((function(e){u[e]=s[e],delete s[e]})),delete s.keys,$.createElement(d,s,l.map((function(l){var n=l.status,a=Mt(l,zl),s=n===Ml||n===Hl;return $.createElement(t,Dl({},u,{key:a.key,visible:s,eventProps:a,onVisibleChanged:function(t){(null==i||i(t,{key:a.key}),t)||0===e.removeKey(a.key)&&o&&o()}}),r)})))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var l=e.keys,n=t.keyEntities,a=Kl(l),r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],l=[],n=0,a=t.length,r=Kl(e),i=Kl(t);r.forEach((function(e){for(var t=!1,r=n;r<a;r+=1){var o=i[r];if(o.key===e.key){n<r&&(l=l.concat(i.slice(n,r).map((function(e){return Tt(Tt({},e),{},{status:Ml})}))),n=r),l.push(Tt(Tt({},o),{},{status:Hl})),n+=1,t=!0;break}}t||l.push(Tt(Tt({},e),{},{status:ql}))})),n<a&&(l=l.concat(i.slice(n).map((function(e){return Tt(Tt({},e),{},{status:Ml})}))));var o={};return l.forEach((function(e){var t=e.key;o[t]=(o[t]||0)+1})),Object.keys(o).filter((function(e){return o[e]>1})).forEach((function(e){(l=l.filter((function(t){var l=t.key,n=t.status;return l!==e||n!==ql}))).forEach((function(t){t.key===e&&(t.status=Hl)}))})),l}(n,a);return{keyEntities:r.filter((function(e){var t=n.find((function(t){var l=t.key;return e.key===l}));return!t||t.status!==$l||e.status!==ql}))}}}]),n}();St(l,"defaultProps",{component:"div"})}(vl);const Bl=q.default.forwardRef(((e,t)=>{const{forceRender:l,className:n,style:a,boxStyle:r,isActive:i}=e,[o,s]=q.default.useState(i||l);if(q.default.useEffect((()=>{(l||i)&&s(!0)}),[l,i]),!o)return null;const d=gt("collapse");return q.default.createElement("div",{ref:t,className:J.default(`${d}-content`,{[`${d}-content-active`]:i,[`${d}-content-inactive`]:!i},n),style:a},q.default.createElement("div",{className:`${d}-content-box`,style:r},e.children))}));Bl.displayName="PanelContent";const Ul=e=>{const{defaultActive:t,label:l,extra:n,className:a,style:r,containerStyle:i,bordered:o,disabled:s,forceRender:d,destroyOnClose:u=!1,onChange:c}=e,[f,p]=q.default.useState(!!t),m=gt("collapse"),h=J.default({[`${m}`]:!0,[`${m}-active`]:f,[`${m}-disabled`]:s},a);return q.default.createElement("div",{className:h,style:r},q.default.createElement(vt,{label:l,extra:n,collapse:f,bordered:o,disabled:s,onCollapseChange:e=>{p(e),null==c||c(e)}}),q.default.createElement(_l,tt({visible:f},((e=gt("motion-collapse"))=>({motionName:e,onAppearStart:yt,onEnterStart:yt,onAppearActive:bt,onEnterActive:bt,onLeaveStart:xt,onLeaveActive:yt,onAppearEnd:Et,onEnterEnd:Et,onLeaveEnd:Et,motionDeadline:500}))(),{forceRender:d,removeOnLeave:u}),(({className:t,style:l},n)=>q.default.createElement(Bl,{ref:n,prefixCls:m,className:t,style:l,boxStyle:i,isActive:f,forceRender:d},e.children))))};Ul.displayName="QmCollapse";const Gl=q.default.createContext(void 0);function Yl(e,t){((e,t)=>{const l=$.useRef(!0);$.useEffect((()=>e(l.current)),t),$.useEffect((()=>(l.current=!1,()=>{l.current=!0})),[])})((t=>{if(!t)return e()}),t)}const Xl=(e,t,l)=>{e&&t&&l&&e.addEventListener(t,l,!1)},Ql=(e,t,l)=>{e&&t&&l&&e.removeEventListener(t,l,!1)},Zl=e=>e.preventDefault(),Jl=(e,t)=>{if(Oe||!e||!t)return null;"float"===(t=_e(t))&&(t="cssFloat");try{const l=e.style[t];if(l)return l;const n=window.getComputedStyle(e);return n?n[t]:""}catch(l){return e.style[t]}},en=(e,t,n)=>{!Oe&&e&&t&&(l.isPlainObject(t)?Object.keys(t).forEach((l=>{en(e,l,t[l])})):(t=_e(t),e.style[t]=n))},tn=e=>{let t=0,l=e;for(;l;)t+=l.offsetTop,l=l.offsetParent;return t},ln=(e,t)=>Math.abs(tn(e)-tn(t)),nn=e=>{let t=0,l=0;for(;e;)t+=e.offsetLeft-e.scrollLeft,l+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{x:t,y:l}},an=(e,t)=>{var l;let n=e;for(;n;){if(null===(l=n.classList)||void 0===l?void 0:l.contains(t))return n;n=n.parentNode}return null},rn=(e,t)=>{if(Oe||!e||!t)return!1;let l=e;for(;l;){if(l===t)return!0;l=l.parentNode}return!1},on=e=>Math.pow(e,3),sn=e=>e<.5?on(2*e)/2:1-on(2*(1-e))/2,dn=e=>{const{minValues:t,onDragChange:l,onDragging:n}=e,{splitRef:a,direction:r}=q.default.useContext(Gl),{t:i}=ot(),o=q.default.useRef(Oe?null:document.onselectstart),s=q.default.useMemo((()=>"horizontal"===r),[r]),d=q.default.useMemo((()=>s?"X":"Y"),[s]),u=q.default.useRef({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),c=e=>{u.current=Object.assign({},u.current,e)},f=e=>{if(1!==e.buttons)return p();const l=e[`page${d}`]-u.current[`start${d}`],a=[t[0],u.current[`containerSize${d}`]-t[1]];let r=u.current[`firstElementSize${d}`]+l;r=Math.max(a[0],r),r=Math.min(a[1],r),n(r)},p=()=>{c({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),l(!1),Ql(document,"mousemove",f),Ql(document,"mouseup",p),m()},m=()=>{document.onselectstart!==o.current&&(document.onselectstart=o.current)},h={[`${gt("split")}__resize-bar`]:!0,vertical:"vertical"===r,horizontal:"horizontal"===r};return q.default.createElement("div",{className:J.default(h),title:i("qm.split.resize"),onMouseDown:e=>{e.stopPropagation();const t=a.current,n=t.children[0];c({startX:e.pageX,startY:e.pageY,firstElementSizeX:n.offsetWidth,firstElementSizeY:n.offsetHeight,containerSizeX:t.offsetWidth,containerSizeY:t.offsetHeight}),Xl(document,"mousemove",f),Xl(document,"mouseup",p),l(!0),o.current=document.onselectstart,document.onselectstart=()=>!1}})};dn.displayName="ResizeBar";const un=q.default.forwardRef(((e,t)=>{const{offset:l,className:n,style:a}=e,{direction:r,dragging:i}=q.default.useContext(Gl),o="vertical"===r?"height":"width",s={[gt("split-pane")]:!0,isLocked:i,horizontal:"horizontal"===r,vertical:"vertical"===r,[n]:!!n},d=void 0!==l?{[o]:$e(l)}:{flex:1,[o]:0};return q.default.createElement("div",{ref:t,className:J.default(s),style:Object.assign(Object.assign({},d),a)},e.children)}));un.displayName="SplitPane";const cn=e=>{const{direction:t="horizontal",defaultValue:l="50%",uniqueKey:n,className:a,style:r,onDragStart:i,onDrag:o=Le,onDragEnd:s}=e,{global:d}=q.default.useContext(xe),u=q.default.useRef(null),c=q.default.useRef(null),f=e=>Number(e)>0?`${e}px`:(e=>["px","em","vw","vh","%"].some((t=>e.endsWith(t))))(e.toString())?e.toString():`${Number.parseFloat(e)}px`,p=e=>Number.parseInt(e,10),m=e=>{var t;const l=Number.parseInt((null===(t=e.props)||void 0===t?void 0:t.min)||0);return l>=0?l:0},h=q.default.useMemo((()=>n?`split_${n}`:""),[n]),[g,v]=q.default.useState(!1),[y,b]=q.default.useState(f(l));Yl((()=>{g?null==i||i(p(y)):(null==s||s(p(y)),localStorage.setItem(h,y),C(h,y))}),[g]),q.default.useEffect((()=>{x()}),[]);const x=()=>{if(!h)return;const e=localStorage.getItem(h);e?b(f(e)):E(h).then((e=>{localStorage.setItem(h,f(e||l)),x()})).catch((()=>{}))},E=e=>Ie(void 0,void 0,void 0,(function*(){const t=null==d?void 0:d.getComponentConfigApi;if(t)try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),C=(e,t)=>Ie(void 0,void 0,void 0,(function*(){const l=null==d?void 0:d.saveComponentConfigApi;if(l)try{yield l({[e]:t})}catch(e){}})),w=q.default.useMemo((()=>({splitRef:u,direction:t,dragging:g})),[t,g]),S=[];q.default.Children.map(e.children,(e=>{var t;Re(e)&&!ke(e)&&"SplitPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&S.push(e)}));const[N,T]=S,I=q.default.useMemo((()=>[m(N),m(T)]),[N,T]),O={[gt("split")]:!0,vertical:"vertical"===t};return q.default.createElement(Gl.Provider,{value:w},q.default.createElement("div",{ref:u,className:J.default(O,a),style:r},q.default.createElement(un,tt({},N.props,{ref:c,offset:y})),q.default.createElement(dn,{minValues:I,onDragChange:e=>v(e),onDragging:e=>{b(`${e}px`),o(e)}}),q.default.createElement(un,T.props)))};cn.displayName="QmSplit",cn.Pane=un;const fn=e=>{const{className:t,style:l}=e,{$size:n}=dt(e),a=gt("countup"),r={[a]:!0,[`${a}--lg`]:"large"===n,[`${a}--sm`]:"small"===n};return q.default.createElement(te.default,tt({},e,{className:J.default(r,t),style:l}),e.children)};fn.displayName="QmCountup";const pn=e=>{const{className:t}=e,{$size:l}=dt(e),n=gt("empty"),a=Object.assign(Object.assign({},e),{image:d.Empty.PRESENTED_IMAGE_SIMPLE}),r={[n]:!0,[`${n}--lg`]:"large"===l,[`${n}--sm`]:"small"===l};return q.default.createElement(d.Empty,tt({},a,{className:J.default(r,t)}))};pn.displayName="QmEmpty";const mn=e=>{const t=je({tip:"Loading..."},e),{fullHeight:l,className:n,style:a}=t,r=gt("spin"),i={[r]:!0,[`${r}-fullHeight`]:!!l},o=Object.assign(Object.assign({wrapperClassName:J.default(i,n)},He(t,["fullHeight"])),{style:Object.assign(Object.assign({},a),{maxHeight:"none"})});return q.default.createElement(d.Spin,o,t.children)};mn.displayName="QmSpin";const hn=q.default.createContext(void 0),gn=new Map;const vn=new le.default((function(e){e.forEach((e=>{var t;const{target:l}=e;null===(t=gn.get(l))||void 0===t||t.forEach((e=>e(l)))}))}));function yn(e,t){gn.has(e)||(gn.set(e,new Set),vn.observe(e)),gn.get(e).add(t)}function bn(e,t){gn.has(e)&&(gn.get(e).delete(t),gn.get(e).size||(vn.unobserve(e),gn.delete(e)))}function xn(e){const[t,l]=$.useState({width:0,height:0});return $.useLayoutEffect((()=>{const t=e.current,n=e=>{l({width:e.offsetWidth,height:e.offsetHeight})};return t&&yn(t,n),()=>{t&&bn(t,n)}}),[e]),t}const En=(e,t)=>{const l=$.useRef(!0);$.useLayoutEffect((()=>e(l.current)),t),$.useLayoutEffect((()=>(l.current=!1,()=>{l.current=!0})),[])};function Cn(e,t){En((t=>{if(!t)return e()}),t)}function wn(e,t){const l=$.useRef(null);$.useEffect((()=>()=>{clearTimeout(l.current),l.current=null}),[]);return $.useCallback(((...n)=>{l.current&&clearTimeout(l.current),l.current=setTimeout((()=>e.apply(this,n)),t)}),[e,t])}const Sn=(e,...t)=>q.default.isValidElement(e)?q.default.cloneElement(e,...t):null,Nn=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],Tn=e=>({_s:e,status:Nn[e],isEnter:e<3,isMounted:6!==e,isResolved:2===e||e>4}),In=e=>e?6:5,On=(e,t,l,n,a)=>{clearTimeout(n.current);const r=Tn(e);t(r),l.current=r,null==a||a({current:r})},Rn=(t={})=>{const{enter:n=!0,exit:a=!0,preEnter:r,preExit:i,timeout:o,initialEntered:s,mountOnEnter:d,unmountOnExit:u,onStateChange:c}=t||{},[f,p]=e.useState((()=>Tn(s?2:In(d)))),m=e.useRef(f),h=e.useRef(),[g,v]=(e=>l.isPlainObject(e)?[e.enter,e.exit]:[e,e])(o),y=e.useCallback((()=>{const e=((e,t)=>{switch(e){case 1:case 0:return 2;case 4:case 3:return In(t)}})(m.current._s,u);e&&On(e,p,m,h,c)}),[c,u]),b=e.useCallback((e=>{const t=e=>{switch(On(e,p,m,h,c),e){case 1:g>=0&&(h.current=setTimeout(y,g));break;case 4:v>=0&&(h.current=setTimeout(y,v));break;case 0:case 3:h.current=setTimeout((()=>t(e+1)),0)}},l=m.current.isEnter;"boolean"!=typeof e&&(e=!l),e?!l&&t(n?r?0:1:2):l&&t(a?i?3:4:In(u))}),[y,c,n,a,r,i,g,v,u]);return e.useEffect((()=>()=>clearTimeout(h.current)),[]),[f,b,y]},kn=e=>{const{name:t,in:l,timeout:n,preEnter:a=!0,preExit:r}=e,[i,o]=Rn({timeout:n,preEnter:a,preExit:r,initialEntered:l});return Cn((()=>{o()}),[l]),q.default.createElement(q.default.Fragment,null,q.default.Children.map(e.children,(e=>q.default.isValidElement(e)?Sn(e,{className:J.default(e.props.className,t,i.status)}):e)))},Ln=6,Pn={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",reverse:"width",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",reverse:"height",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},An=e=>{const{thumb:t,always:l,className:n,barSize:a=Ln,direction:r="vertical",onDrag:i=Le}=e,{dragging:o,scrollbarElement:s,wrapElement:d}=q.default.useContext(hn),u=Pn[r],c=q.default.useRef(null),f=q.default.useRef(null),p=q.default.useRef({}),m=q.default.useRef(!1),h=q.default.useRef(!1),g=q.default.useRef(Oe?null:document.onselectstart),[v,y]=q.default.useState(!1);q.default.useEffect((()=>{const e=s.current;return Xl(e,"mousemove",C),Xl(e,"mouseleave",w),()=>{E(),Ql(document,"mouseup",x),Ql(e,"mousemove",C),Ql(e,"mouseleave",w)}}),[]);const b=e=>{if(!c.current||!f.current)return;if(!m.current)return;const t=p.current[u.axis];if(!t)return;const l=100*(-1*(c.current.getBoundingClientRect()[u.direction]-e[u.client])-(f.current[u.offset]-t))/c.current[u.offset];d.current[u.scroll]=l*d.current[u.scrollSize]/100,i(!0)},x=()=>{m.current=!1,p.current={[u.axis]:0},Ql(document,"mousemove",b),Ql(document,"mouseup",x),E(),h.current&&y(!1),i(!1)},E=()=>{document.onselectstart!==g.current&&(document.onselectstart=g.current)},C=st((()=>{h.current=!1,y(!!t.size)})),w=st((()=>{h.current=!0,y(m.current)})),S=gt("scrollbar"),N={[`${S}__bar`]:!0,"is-vertical":"vertical"===r,"is-horizontal":"horizontal"===r},T={[u.reverse]:a},I={[u.size]:t.size,transform:`translate${u.axis}(${t.offset}%)`};return q.default.createElement(kn,{name:"fade",in:l||o||v,timeout:300},q.default.createElement("div",{ref:c,className:J.default(N,n),style:T,onMouseDown:e=>{const t=e.target;if(!t)return;const l=100*(Math.abs(t.getBoundingClientRect()[u.direction]-e[u.client])-f.current[u.offset]/2)/c.current[u.offset];d.current[u.scroll]=l*d.current[u.scrollSize]/100}},q.default.createElement("div",{ref:f,className:`${S}__thumb`,style:I,onMouseDown:e=>{e.stopPropagation(),Xl(document,"mousemove",b),Xl(document,"mouseup",x),m.current=!0,g.current=document.onselectstart,document.onselectstart=()=>!1;const t=e.target;t&&(p.current={[u.axis]:t[u.offset]-(e[u.client]-t.getBoundingClientRect()[u.direction])})}})))},Fn=20,_n=q.default.forwardRef(((e,t)=>{const{wrapClassName:n,wrapStyle:a,innerStyle:r,barWidth:i,always:o,native:s,showTopScrollbar:d,minSize:u=Fn,onScroll:c,onReachedEnd:f}=e,p=q.default.useRef(null),m=q.default.useRef(null),h=q.default.useRef(null),g=q.default.useRef({prevTop:0,prevLeft:0}),[v,y]=q.default.useState({size:0,offset:0,ratio:1}),[b,x]=q.default.useState({size:0,offset:0,ratio:1}),[E,C]=q.default.useState(!1),w=xn(p),S=xn(h);Cn((()=>{!s&&N()}),[S.width,S.height,w.width,w.height]);const N=wn((()=>{if(!m.current)return;const e=m.current.offsetHeight-4,t=m.current.offsetWidth-4,l=Math.pow(e,2)/m.current.scrollHeight,n=Math.pow(t,2)/m.current.scrollWidth,a=Math.max(l,u),r=Math.max(n,u),i=l/(e-l)/(a/(e-a)),o=n/(t-n)/(r/(t-r)),s=a+4<e?a:0,d=r+4<t?r:0,c=100*m.current.scrollTop/e*i,f=100*m.current.scrollLeft/t*o;y(Object.assign({},v,{size:d,ratio:o,offset:f})),x(Object.assign({},b,{size:s,ratio:i,offset:c}))}),5),T=e=>{C(e)},I=(e,t)=>{l.isNumber(e)?t?((e,t)=>{const l=Date.now(),n=e.scrollTop,a=window.requestAnimationFrame,r=()=>{const i=(Date.now()-l)/500;i<1?(e.scrollTop=n+(t-n)*sn(i),a(r)):e.scrollTop=t};a(r)})(m.current,e):m.current.scrollTop=e:ft("Scrollbar","SET_SCROLL_TOP 参数必须是数值类型")},O=(e,t)=>{l.isNumber(e)?t?((e,t)=>{const l=Date.now(),n=e.scrollLeft,a=window.requestAnimationFrame,r=()=>{const i=(Date.now()-l)/500;i<1?(e.scrollLeft=n+(t-n)*sn(i),a(r)):e.scrollLeft=t};a(r)})(m.current,e):m.current.scrollLeft=e:ft("Scrollbar","SET_SCROLL_LEFT 参数必须是数值类型")};q.default.useImperativeHandle(t,(()=>{var e,t;return{container:p.current,scrollElement:m.current,scrollTop:(null===(e=m.current)||void 0===e?void 0:e.scrollTop)||0,scrollLeft:(null===(t=m.current)||void 0===t?void 0:t.scrollLeft)||0,SET_SCROLL_TOP:I,SET_SCROLL_LEFT:O}}));const R=q.default.useMemo((()=>({dragging:E,scrollbarElement:p,wrapElement:m})),[E]),k=gt("scrollbar"),L={[`${k}__wrap`]:!0,[`${k}__wrap--hidden`]:!s};return q.default.createElement("div",{ref:p,className:J.default(k,e.className),style:e.style},q.default.createElement("div",{ref:m,className:J.default(L,n),style:a,onScroll:e=>{const{scrollTop:t,scrollLeft:l}=e.target;!s&&(({scrollTop:e,scrollLeft:t})=>{if(!m.current)return;const l=m.current.offsetHeight-4,n=m.current.offsetWidth-4,a=100*e/l*b.ratio,r=100*t/n*v.ratio;y(Object.assign({},v,{offset:r})),x(Object.assign({},b,{offset:a}))})({scrollTop:t,scrollLeft:l}),null==c||c({scrollTop:t,scrollLeft:l});const{prevTop:n,prevLeft:a}=g.current,r={bottom:t+m.current.clientHeight>=m.current.scrollHeight,top:t<=0&&0!==n,right:l+m.current.clientWidth>=m.current.scrollWidth&&a!==l,left:l<=0&&0!==a};let i;var o;n!==t&&(i=t>n?"bottom":"top"),a!==l&&(i=l>a?"right":"left"),i&&r[i]&&(null==f||f(i,{scrollTop:t,scrollLeft:l})),o={prevTop:t,prevLeft:l},g.current=o}},q.default.createElement("div",{ref:h,className:`${k}__view`,style:r},e.children)),!s&&q.default.createElement(hn.Provider,{value:R},d&&q.default.createElement(An,{className:"top",direction:"horizontal",thumb:v,barSize:i,always:o,onDrag:T}),q.default.createElement(An,{direction:"horizontal",thumb:v,barSize:i,always:o,onDrag:T}),q.default.createElement(An,{direction:"vertical",thumb:b,barSize:i,always:o,onDrag:T})))}));_n.displayName="QmScrollbar";const Dn=(e,t)=>{if(navigator.msSaveBlob)navigator.msSaveBlob(e,decodeURI(t));else{const l=window.URL.createObjectURL(e);let n=document.createElement("a");n.href=l,n.download=decodeURI(t),n.click(),n=null}},Mn=(e,{fileName:t,headers:l,params:n})=>Ie(void 0,void 0,void 0,(function*(){const a=n?new URLSearchParams(n).toString():"",r=a?e.includes("?")?"&":"?":"",i=yield fetch(e+`${r+a}`,{method:"GET",headers:l});if(!i.ok)throw new Error(Se("qm.download.error"));const o=yield i.blob(),s=i.headers.get("content-disposition"),d=t||(s?s.split(";")[1].split("filename=")[1]:e.slice(e.lastIndexOf("/")+1));Dn(o,d)})),Hn=e=>{const t=e.lastIndexOf(".");return-1!==t?e.substring(0,t):e},qn=e=>{const t=e.lastIndexOf(".");return-1!==t?e.substring(t+1):""},$n=e=>{var t,l;const n=je({name:"file",multiple:!0,showUploadList:{showPreviewIcon:!0,showDownloadIcon:!0,showRemoveIcon:!0}},e),{fileList:a=[],fileDirection:r="vertical",batchDownload:i,draggable:o,editable:s,disabled:u,readOnly:c,button:f={},className:p,onPreview:m,onSortChange:h,onEditChange:v,onDownload:y,onChange:b}=n,{t:x}=ot(),{$size:E}=dt(n),C=q.default.useRef(null),w=q.default.useRef(null),[S,N]=q.default.useState({}),T=q.default.useMemo((()=>u||c||!1),[u,c]);q.default.useEffect((()=>(R(),()=>{var e;return null===(e=w.current)||void 0===e?void 0:e.destroy()})),[]);const I=(e,t)=>{N((l=>Object.assign({},l,{[e]:null!=t?t:!l[e]})))},O=st((e=>{const{oldIndex:t,newIndex:l}=e;if(t!==l){const e=[...a],[n]=e.splice(t,1);e.splice(l,0,n),null==h||h(e),null==b||b({file:a[t],fileList:e})}})),R=()=>{o&&(w.current=ne.default.create(an(C.current,gt("upload-file")).querySelector(".ant-upload-list"),{animation:150,handle:".handle",filter:".ignore",draggable:".ant-upload-list-text-container",onEnd:O}))},k=e=>Ie(void 0,void 0,void 0,(function*(){if(y)return void(yield y(e));const{downloadWithHeaders:t,headers:l}=n;try{e.url&&(yield Mn(e.url,Object.assign({fileName:e.name},t?{headers:l}:null)))}catch(e){d.message.error(x("qm.download.error"))}})),L=gt("upload-file"),P={[L]:!0,[`${L}--lg`]:"large"===E,[`${L}--sm`]:"small"===E,[`${L}--horizontal`]:"horizontal"===r};return q.default.createElement(d.Upload,tt({className:J.default(P,p)},He(n,["fileTypes","fileSize","fileDirection","batchDownload","draggable","editable","button"]),{beforeUpload:(e,t)=>new Promise(((l,a)=>Ie(void 0,void 0,void 0,(function*(){const{fileTypes:r=[],fileSize:i,maxCount:o,fileList:s=[],beforeUpload:u}=n,c=!r.length||r.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),f=!i||e.size/1024/1024<i,p=!(o>1)||s.length<o,m=c&&f&&p;if(c||d.message.warning(x("qm.upload.tooltip",{type:r.join(",")})),f||d.message.warning(x("qm.upload.sizeLimit",{size:i})),p||d.message.warning(x("qm.upload.countLimit",{count:o})),!m)return d.Upload.LIST_IGNORE;if(u){const n=u(e,t);if(!0===n)return l(e);if(!1===n)return a("not upload");if(n&&"function"==typeof n.then)try{const e=yield n;l(e)}catch(e){a(e)}}else l(e)})))),disabled:T,onChange:b,onPreview:e=>Ie(void 0,void 0,void 0,(function*(){if("function"==typeof m)return m(e,(t=>k(t||e)));u||(yield k(e))})),onDownload:e=>Ie(void 0,void 0,void 0,(function*(){yield k(e)})),itemRender:(e,t,l,r)=>((e,t)=>{const{iconRender:l}=n,{uid:r,name:i,url:c,status:f="done"}=e,p="ant-btn ant-btn-text ant-btn-sm ant-btn-icon-only ant-upload-list-item-card-actions-btn";return q.default.createElement("div",{className:J.default("ant-upload-list-item",`ant-upload-list-item-${f}`,"ant-upload-list-item-list-type-text",{handle:o})},q.default.createElement("div",{className:"ant-upload-list-item-info"},q.default.createElement("span",{className:"ant-upload-span"},q.default.createElement("div",{className:"ant-upload-text-icon"},l?l(e):q.default.createElement(g.LinkOutlined,null)),q.default.createElement("div",{className:"ant-upload-list-item-name"},S[r]?q.default.createElement(d.Input,{size:"small",autoFocus:!0,defaultValue:Hn(i),onBlur:t=>{const{value:l}=t.target;if(l!==Hn(i)){const t=Object.assign({},e,{name:`${l}.${qn(i)}`}),n=a.map((e=>e.uid!==r?e:t));null==v||v(t,n),null==b||b({file:t,fileList:n})}I(r,!1)}}):q.default.createElement("a",{rel:"noreferrer",target:"_blank",title:i,href:c,onClick:e=>{e.preventDefault(),s?T||I(r,!0):t.preview()}},i)),q.default.createElement("span",{className:"ant-upload-list-item-card-actions"},s&&!T&&q.default.createElement("button",{type:"button",className:p,onClick:()=>I(r)},S[r]?q.default.createElement(g.CheckOutlined,null):q.default.createElement(g.EditOutlined,null)),s&&q.default.createElement("button",{type:"button",className:J.default(p,"preview"),onClick:()=>t.preview()},q.default.createElement(g.EyeOutlined,null)),q.default.createElement("button",{type:"button",className:J.default(p,"download"),disabled:u,onClick:()=>t.download()},q.default.createElement(g.DownloadOutlined,null)),q.default.createElement("button",{type:"button",className:J.default(p,"delete"),disabled:T,onClick:()=>t.remove()},q.default.createElement(g.DeleteOutlined,null))))))})(t,r)}),q.default.createElement("span",{className:"inner",ref:C},n.children||c&&a.length?n.children:q.default.createElement(d.Button,{type:null!==(t=f.type)&&void 0!==t?t:"default",icon:null!==(l=f.icon)&&void 0!==l?l:q.default.createElement(g.UploadOutlined,null),disabled:T},f.text||x("qm.upload.text")),i&&!!a.length&&q.default.createElement(d.Button,{disabled:u,style:{marginLeft:8},onClick:e=>Ie(void 0,void 0,void 0,(function*(){if(e.stopPropagation(),"function"==typeof i)yield i(a);else for(const e of a)yield k(e)}))},x("qm.upload.batchDownload"))))};$n.displayName="QmUploadFile";const jn=e=>{const t=je({icon:q.default.createElement(g.DownloadOutlined,null),withCredentials:!1},e),{$size:n}=dt(t),{t:a}=ot(),[r,i]=q.default.useState(!1),o=He(t,["action","fileName","headers","withCredentials","params","beforeDownload","onSuccess","onError"]);return q.default.createElement(d.Button,tt({},o,{size:n,loading:r,onClick:()=>Ie(void 0,void 0,void 0,(function*(){var e;i(!0);try{const{action:e,fileName:n,headers:r,params:i,beforeDownload:o=Pe,onSuccess:s}=t,u=l.isString(e)?e:yield Ie(void 0,void 0,void 0,(function*(){const e=t.action;if(e.api)try{const t=yield e.api(e.params);if(200===t.code)return t.data}catch(e){}return""}));if(!u)return ft("Download","参数 `action` 有误!");if(!o(u))return;yield Mn(u,{fileName:n,headers:r,params:i}),yield Ae(100),null==s||s(),d.message.success(a("qm.download.success"))}catch(l){null===(e=t.onError)||void 0===e||e.call(t,l),d.message.error(a("qm.download.error"))}i(!1)}))}),t.children||a("qm.download.text"))};function Kn(e,t){const l=$.useRef(null),n=$.useRef(0);$.useEffect((()=>()=>{clearTimeout(l.current),l.current=null}),[]);return $.useCallback(((...l)=>{const a=Date.now();(!n.current||a-n.current>t)&&(e.apply(this,l),n.current=a)}),[e,t])}jn.displayName="QmDownload";const Vn=e=>{const{activeKey:t,labels:l,onTabClick:n}=e;return q.default.createElement(q.default.Fragment,null,l.map(((e,l)=>{const a={item:!0,actived:l===t};return q.default.createElement("div",{key:l,className:J.default(a),onClick:e=>n(l,e)},q.default.createElement("span",null,e))})))},zn=e=>{const{label:t,showDivider:l,className:n,style:a}=e,r={[gt("anchor-item")]:!0};return q.default.createElement("div",{className:J.default(r,n),style:a},l&&q.default.createElement(vt,{label:t,style:{marginBottom:10}}),e.children)};zn.displayName="AnchorItem";const Wn=q.default.forwardRef(((e,t)=>{const{labelList:l=[],defaultActiveIndex:n,labelWidth:a,tabPosition:r="left",onTabClick:i,className:o,style:s}=e,{$size:d}=dt(e),u=q.default.useRef(null),c=q.default.useRef(),f=q.default.useRef("ready"),p=q.default.useRef(0),[m,h]=q.default.useState(n||0),g=q.default.useMemo((()=>!!(null==l?void 0:l.length)),[l]);q.default.useEffect((()=>{v();const e=ae.default(u.current,"scroll",x);return()=>{e.remove()}}),[]);const v=()=>{m>0&&(u.current.scrollTop=ln(b(m),u.current))},y=e=>{const t=Math.abs(e),n=(g?l.map((e=>document.getElementById(e.id))):Array.from((null===(a=u.current)||void 0===a?void 0:a.children)||[])).map((e=>ln(e,u.current)));var a;let r=-1;for(let e=0;e<n.length;e++){const l=n[e],a=n[e+1]||1e4;t>=l-1&&t<a&&(r=e)}return r},b=e=>g?document.getElementById(l[e].id):u.current.children[e],x=Kn((e=>{if("ready"!==f.current)return;const t=y(e.target.scrollTop);-1!==t&&h(t)}),60),E=e=>{const t=b(e);t&&(h(e),f.current="stop",c.current&&clearTimeout(c.current),re.default(t,{block:"start",behavior:"smooth",boundary:u.current}),c.current=setTimeout((()=>f.current="ready"),500))};q.default.useImperativeHandle(t,(()=>({SCROLL_TO_ITEM:e=>{e=(e=e<0?0:e)>p.current?p.current:e,E(e)}})));const C=gt("anchor"),w={[C]:!0,[`${C}-left`]:"left"===r,[`${C}-top`]:"top"===r,[`${C}--lg`]:"large"===d,[`${C}--sm`]:"small"===d},S=[];q.default.Children.map(e.children,(e=>{var t;Re(e)&&!ke(e)&&"AnchorItem"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&S.push(e)}));const N=g?l.map((e=>e.label)):S.map((e=>e.props.label)),T=g?l.map((e=>e.id)):S.map(((e,t)=>e.props["data-id"]||t.toString()));return p.current=N.length,q.default.createElement("div",{className:J.default(w,o),style:s},q.default.createElement("div",{className:J.default("anchor-nav"),style:{width:a?$e(a):""}},q.default.createElement(Vn,{activeKey:m,labels:N,onTabClick:(e,t)=>{E(e),null==i||i({label:N[e],id:T[e]},t)}})),q.default.createElement("div",{ref:u,className:J.default("anchor-container")},g?e.children:S))}));Wn.displayName="QmAnchor",Wn.Item=zn;const Bn=e=>q.default.createElement(d.Tabs.TabPane,e,e.children);Bn.displayName="TabPane";const Un=e=>{const t=je({tabPosition:"top"},e),{items:l,tabPosition:n,tabBarGutter:a,className:r,authConfig:i}=t,{$size:o}=dt(t),s=gt("tabs"),u={[s]:!0,[`${s}--lg`]:"large"===o,[`${s}--sm`]:"small"===o},c=Object.assign(Object.assign({},He(t,["items","authConfig"])),{size:o,tabBarGutter:null!=a?a:["top","bottom"].includes(n)?30:0}),f=[];q.default.Children.map(t.children,(e=>{var t;Re(e)&&!ke(e)&&"TabPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&f.push(e)}));const p=l?[...l]:f.map((({key:e,props:t})=>({key:e,label:t.tab,disabled:t.disabled,closable:t.closable,forceRender:t.forceRender,children:t.children})));if(i){const{fieldList:e=[]}=i||{};for(let t=0;t<p.length;t++){const l=p[t],n=e.find((e=>e.dataIndex===l.key)),{visible:a=1,disabled:r}=n||{};a?r&&(l.disabled=!0):(p.splice(t,1),t--)}}return q.default.createElement(d.Tabs,tt({},c,{items:p,className:J.default(u,r)}))};Un.displayName="QmTabs",Un.TabPane=Bn;const Gn=q.default.forwardRef(((e,t)=>{var n;const a=je({width:"72%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,footer:null},e),{visible:r,open:i,className:o,loading:s,showHeader:u,showFullScreen:c,maskClosable:f,destroyOnClose:p,onClose:m,onClosed:h,onFullChange:v}=a,{global:y}=q.default.useContext(xe),{$size:b}=dt(a),x=q.default.useRef(null),E=q.default.useRef(null),C=q.default.useRef(!1),[w,S]=q.default.useState(!1),[N,T]=q.default.useState(!1),[I,O]=q.default.useState(!1);Yl((()=>{(null!=i?i:r)&&(!p&&C.current||l.isUndefined(s)&&T(!0))}),[null!=i?i:r]),Yl((()=>{E.current&&en(E.current,w?{width:"100%"}:{width:$e(a.width||"72%")})}),[w]);const R=()=>{E.current=an(x.current,"ant-drawer-content-wrapper"),S(!w),null==v||v(!w)};q.default.useImperativeHandle(t,(()=>({START_LOADING:()=>O(!0),STOP_LOADING:()=>O(!1)})));const k=gt("drawer"),L={[k]:!0,"no-header":!u,[`${k}--lg`]:"large"===b,[`${k}--sm`]:"small"===b};return q.default.createElement(d.Drawer,tt({},He(a,["visible","size","showFullScreen","loading","maskClosable","onClosed"]),{open:null!=i?i:r,maskClosable:null!==(n=null!=f?f:null==y?void 0:y.maskClosable)&&void 0!==n&&n,className:J.default(L,o),title:q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{ref:x,className:"text"},u&&a.title),c&&q.default.createElement("button",{type:"button",className:"full-screen",onClick:R},q.default.createElement(w?g.FullscreenExitOutlined:g.FullscreenOutlined))),footer:null,afterOpenChange:e=>{e?(C.current=!0,l.isUndefined(s)&&setTimeout((()=>T(!1)),100)):(S(!1),null==h||h())},onClose:m}),a.children,(s||I||N)&&q.default.createElement(mn,{spinning:!0,className:J.default("spinning")}))}));Gn.displayName="QmDrawer";const Yn="10vh";var Xn;!function(e){e[e.large=48]="large",e[e.middle=44]="middle",e[e.small=40]="small",e[e.none=0]="none"}(Xn||(Xn={}));const Qn=q.default.forwardRef(((e,t)=>{var n;const a=je({width:"60%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,draggable:!0,footer:null,style:{top:Yn}},e),{visible:r,open:i,width:o,height:s,className:u,loading:c,draggable:f,showHeader:p,showFullScreen:m,maskClosable:h,destroyOnClose:v,bodyStyle:y,onFullChange:b,onClose:x,onClosed:E}=a,{global:C}=q.default.useContext(xe),{$size:w}=dt(a),S=q.default.createRef(),N=q.default.useRef(!1),T=q.default.useMemo((()=>`calc(100vh - ${Yn} - ${Yn} - ${Xn[p?w:"none"]}px)`),[w,p]),[I,O]=q.default.useState(!1),[R,k]=q.default.useState(!1),[L,P]=q.default.useState(!1),[A,F]=q.default.useState(!0),[_,D]=q.default.useState({left:0,top:0,bottom:0,right:0}),[M,H]=q.default.useState();Yl((()=>{if(null!=i?i:r){if(!v&&N.current||l.isUndefined(c)&&k(!0),!v&&N.current)return;setTimeout((()=>{N.current=!0,l.isUndefined(c)&&k(!1)}),400)}}),[null!=i?i:r]),Yl((()=>{H(I?{x:0,y:0}:void 0)}),[I]);const $=e=>{const t=an(e.target,"ant-modal");if(!t)return;const l=t.querySelector(".ant-modal-body");I?(en(t,{width:$e(o||"60%"),height:"auto",top:Yn}),en(l,{height:s?$e(s):T,maxHeight:"auto"===s?T:""})):(en(t,{width:"100%",height:"100%",top:0,maxWidth:"100%"}),en(l,{height:`calc(100vh - ${Xn[p?w:"none"]}px)`,maxHeight:""})),O(!I),null==b||b(!I)};q.default.useImperativeHandle(t,(()=>({START_LOADING:()=>P(!0),STOP_LOADING:()=>P(!1)})));const j=gt("modal"),K={height:s?$e(s):T,maxHeight:"auto"===s?T:"",overflow:"auto"},V={[j]:!0,"no-header":!p,[`${j}--lg`]:"large"===w,[`${j}--sm`]:"small"===w};return q.default.createElement(d.Modal,tt({},He(a,["visible","loading","showFullScreen","maskClosable","onClose","onClosed"]),{open:null!=i?i:r,maskClosable:null!==(n=null!=h?h:null==C?void 0:C.maskClosable)&&void 0!==n&&n,className:J.default(V,u),title:q.default.createElement("div",{onMouseOver:()=>{A&&F(!1)},onMouseOut:()=>{F(!0)}},q.default.createElement("span",{className:"text"},p&&a.title),m&&q.default.createElement("button",{type:"button",className:"full-screen",onClick:$},q.default.createElement(I?g.FullscreenExitOutlined:g.FullscreenOutlined))),footer:null,bodyStyle:Object.assign({},K,y),onCancel:x,afterClose:()=>{null==E||E(),O(!1)},modalRender:e=>q.default.createElement(ie.default,{nodeRef:S,bounds:_,position:M,disabled:!f||A||I,onStart:(e,t)=>((e,t)=>{const{clientWidth:l,clientHeight:n}=window.document.documentElement,a=S.current.getBoundingClientRect();a&&D({left:-a.left+t.x,right:l-(a.right-t.x)-1,top:-a.top+t.y,bottom:n-(a.bottom-t.y)-1})})(0,t)},q.default.createElement("div",{ref:S},e))}),a.children,(c||L||R)&&q.default.createElement(mn,{spinning:!0,className:J.default("spinning")}))}));Qn.displayName="QmModal";const Zn=e.createContext(void 0);var Jn={string_format:function(e){return"string"!=typeof e?e:e.split(/[\s'\s"]/).join("")},stringify:function(e,t){return"string"==typeof e?"'"+e.trim().replace(/(')/g,"\\$1").replace(/\(/g,"├").replace(/\)/g,"┤").replace(/\s/g,t)+"'":e},array_format:function(e){let t="[";for(let l=0,n=(e=Array.isArray(e)?e:[e]).length;l<n;l++)t+="number"==typeof e[l]?e[l]:"'"+e[l]+"'",l<n-1&&(t+=",");return t+="]",t},operation_format:function(e){const t=e.split(" ");for(let e=0;e<t.length;e++)""==t[e]&&(t.splice(e,1),e--);if("("==t[0]?t.splice(0,1):"("==t[0][0]&&(t[0]=t[0].split(""),t[0].splice(0,1),t[0]=t[0].join("")),")"==t[t.length-1])t.splice(t.length-1,1);else if(")"==t[t.length-1][t[t.length-1].length-1]){const e=t.length-1;t[e]=t[e].split(""),t[e].splice(t[e].length-1,1).join(""),t[e]=t[e].join("")}return t},find_replace:function(e,t,l){return e.split(t).join(l)},replace_symbols:function(e){return e=this.find_replace(e," AND "," && "),e=this.find_replace(e," and "," && "),e=this.find_replace(e," OR "," || "),e=this.find_replace(e," or "," || "),e=this.find_replace(e," <> "," != ")}};const ea=["==","<",">","<=",">=","!=","like","nlike","likes","in","nin","^=","=$","nil","nnil"];var ta=function(e){let t=0;const l=e.length;for(let n=0;n<l;n++){const l=e.charAt(n);"("===l&&t++,")"===l&&t--}return 0===t},la=function(e,t){let l="";for(let t=0;t<e.length;t++)"("==e[t]||")"==e[t]?l+=" "+e[t]+" ":l+=e[t];const n=l.split(" ").filter((e=>""!==e));for(let e=0;e<n.length;e++)ea.includes(n[e])&&("this"!=n[e-1]?n[e-1]=t+"."+n[e-1]:n[e-1]=t),ea.includes(n[e])&&(n.splice(e-1,3,`__query__(${n[e-1]}, '${n[e]}', ${n[e+1]})`),e-=2);return e=n.join(" ")};const na=/(\^|\.|\[|\]|\$|\(|\)|\||\*|\+|\?|\{|\}|\\)/g,aa=["string","number","boolean","symbol"],ra=e=>aa.includes(typeof e),ia=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}:\d{2})?$/.test(e),oa=e=>new RegExp(e.replace(/├/g,"(").replace(/┤/g,")").replace(new RegExp(Ka,"g")," ").toString().replace(na,"\\$1"),"i"),sa=(e,t,l)=>{e=null!=e?e:"";let n=!0;switch(t){case"like":n=null!==e.toString().match(oa(l));break;case"nlike":n=null===e.toString().match(oa(l));break;case"likes":n=l.split(/,|,/).some((t=>sa(e,"like",t)));break;case"in":ra(l)&&(l=[l]),Array.isArray(l)&&(n=Array.isArray(e)?e.every((e=>l.includes(e))):l.includes(e));break;case"nin":ra(l)&&(l=[l]),Array.isArray(l)&&(n=!(Array.isArray(e)?e.some((e=>l.includes(e))):l.includes(e)));break;case"^=":n=e.toString().startsWith(l);break;case"=$":n=e.toString().endsWith(l);break;case"nil":n=""===e||null==e;break;case"nnil":n=!sa(e,"nil",null);break;case"!=":case"<>":n=(ia(e)?e.slice(0,10):e)!=l;break;case"<":n=(ia(e)?e.slice(0,10):e)<l;break;case"<=":n=(ia(e)?e.slice(0,10):e)<=l;break;case">":n=(ia(e)?e.slice(0,10):e)>l;break;case">=":n=(ia(e)?e.slice(0,10):e)>=l;break;default:n=(ia(e)?e.slice(0,10):e)==l}return n};window.__query__=(...e)=>sa(e[0],e[1],e[2]);const da=Jn.stringify,ua=Jn.array_format,ca=ta,fa=(e,t,l)=>{if(!t)return[...e];let n=[];t=Jn.replace_symbols(t);try{if(l){const l=new Function("record",`return ${la(t,"record")};`);n=Ga(e,(e=>l(e)))}else{const l=new Function("array","i",`return ${la(t,"array[i]")};`);for(let t=0,a=e.length;t<a;t++)l(e,t)&&n.push(e[t])}}catch(t){ft("Table","组件 `initialFilter` 参数有误!"),n=e}return n},pa=e=>{const t=[];return e.forEach((e=>{e.children?t.push(...pa(e.children)):t.push(e)})),t},ma=e=>e.filter((e=>(e.children&&(e.children=ma(e.children)),!e.hidden&&!e.noAuth))),ha=e=>e.map((e=>{const t={dataIndex:e.dataIndex};return Array.isArray(e.children)&&(t.children=ha(e.children)),void 0!==e.hidden&&(t.hidden=e.hidden),void 0!==e.fixed&&(t.fixed=e.fixed),void 0!==e.width&&(t.width=e.width),void 0!==e.renderWidth&&(t.renderWidth=e.renderWidth),t})),ga=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...ga(e.children))})),t},va=(e,t)=>e.map((e=>(e.children&&(e.children=va(e.children,t)),null==t||t(e),e))),ya=(e,t)=>{for(const l of e){if(l.dataIndex===t)return l;if(l.children){const e=ya(l.children,t);if(e)return e}}return null},ba=e=>{const t=e.children;return t?t[0].children?ba(t[0]):t[0]:e},xa=e=>{const t=e.children;return t?t[t.length-1].children?xa(t[t.length-1]):t[t.length-1]:e},Ea=(e,t)=>e.filter((e=>!t.includes(e.dataIndex))),Ca=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...Ca(e.children))})),t},wa=(e,t)=>{const l=[];return e.forEach((e=>{e.children&&l.push(...wa(e.children,t)),Array.isArray(e.children)&&e.children.length&&l.push(t(e))})),l},Sa=(e,t)=>{const l=[];for(let n=0;n<e.length;n++)Array.isArray(e[n].children)&&l.push(...Sa(e[n].children,t)),l.push(t(e[n]));return l},Na=e=>{let t=1;const l=(e,n)=>{var a;if(n&&(e.level=n.level+1,t<e.level&&(t=e.level)),e.children){let t=0;e.children.forEach((n=>{e.fixed?n.fixed=e.fixed:delete n.fixed,l(n,e),t+=n.colSpan})),e.colSpan=t}else e.colSpan=null!==(a=e.colSpan)&&void 0!==a?a:1};e.forEach((e=>{e.level=1,l(e,null)}));const n=[];for(let e=0;e<t;e++)n.push([]);return ga(e).forEach((e=>{e.children?e.rowSpan=1:e.rowSpan=t-e.level+1,n[e.level-1].push(e)})),n},Ta=e=>Object.assign(e,{__prevent__:!0}),Ia=e=>e.__prevent__,Oa=e=>{delete e.__prevent__},Ra=(e,t,l={left:0,top:0})=>{if(e){const n=e.parentNode;if(l.top+=e.offsetTop,l.left+=e.offsetLeft,n&&n!==document.documentElement&&n!==document.body&&(l.top-=n.scrollTop,l.left-=n.scrollLeft),(!t||e!==t&&e.offsetParent!==t)&&e.offsetParent)return Ra(e.offsetParent,t,l)}return l},ka=e=>"number"==typeof e?e:"string"==typeof e?/^\d+(?:px)?$/.test(e)?Number.parseInt(e,10):e:null,La=(e,t)=>l.transform(e,((e,n,a)=>{l.isEqual(n,t[a])||(e[a]=l.isPlainObject(n)&&l.isPlainObject(t[a])?La(n,t[a]):n)})),Pa=(e,t)=>{var n;return null!==(n=l.get(e,t))&&void 0!==n?n:""},Aa=(e,t,n,a)=>{a>=0&&null!=n&&(n=Number(n).toFixed(a)),l.set(e,t,null!=n?n:"")},Fa=(e,t)=>{if(!t.includes("|"))return Pa(e,t);const l=[];return t.split("|").forEach((t=>{t&&l.push(Pa(e,t))})),l.every((e=>!e))?"":l.join(" | ")},_a=e=>/^-?\d+(\.\d+)?$/.test(e.toString()),Da=e=>{const t=(e=e.toString()).split("."),l="-"===t[0].charAt(0)?"-":"";let n=l?t[0].slice(1):t[0],a="";for(;n.length>3;)a=`,${n.slice(-3)}${a}`,n=n.slice(0,n.length-3);return n&&(a=n+a),`${l}${a}${t[1]?`.${t[1]}`:""}`},Ma=(e,t)=>{const l=e.toString();if(!_a(l)||0===t)return e;const n=Number.parseFloat(l).toString(),a=n.indexOf(".");if(-1===a)return n+"."+"0".repeat(t);const r=Math.max(0,t-(n.length-a-1));return n+"0".repeat(r)},Ha=(e,t)=>e?j.default(e,t):null,qa=(e,t)=>e?j.default(e).format(t):"",$a=(e="")=>{let t=(new Date).getTime();return e+"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const l=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?l:3&l|8).toString(16)}))},ja=e=>(e=>{const t=[];return function e(l){null!=l&&"boolean"!=typeof l&&("string"!=typeof l&&"number"!=typeof l?Array.isArray(l)?l.forEach(e):q.default.isValidElement(l)&&e(l.props.children):t.push(l))}(e),t})(e).join(""),Ka="",Va=(e,t=!1)=>{let l="";if(Array.isArray(e)){let n=0;for(let a=0,r=e.length;a<r;a++){const r=e[a];if(!r.fieldName)continue;const i=Array.isArray(r.condition)?ua(r.condition):da(r.condition,Ka);l+=`${r.bracketLeft} ${t?`${r.fieldName}|${r.fieldType}`:r.fieldName} ${r.expression} ${i} ${r.bracketRight} ${r.logic} `,n=r.logic.length}l=l.slice(0,-1*n-2)}else{const n=5;for(const n in e){const[a,r]=n.includes("|")?n.split("|"):[n,""],i=e[n];for(const e in i){l+=`${t?`${a}|${r}`:a} ${e} ${Array.isArray(i[e])?ua(i[e]):da(i[e],Ka)} and `}}l=l.slice(0,-1*n)}return l.replace(/\s+/g," ").trim()},za=(e=[],t=[])=>{const l={};return e.forEach((e=>{const n=JSON.stringify((e=>{const l=[];return t.forEach((t=>l.push(Pa(e,t)))),l})(e));l[n]=l[n]||[],l[n].push(e)})),Object.keys(l).map((e=>l[e]))},Wa=(e,t)=>{for(let l=0;l<e.length;l++){if(e[l].dataIndex===t)return[e[l]];if(Array.isArray(e[l].children)){const n=Wa(e[l].children,t);if(n)return[e[l],n].flat()}}},Ba=(e,t)=>{for(const l of e){if(Array.isArray(l.children)){const e=Ba(l.children,t);if(e)return e}if(t(l))return l}return null},Ua=(e,t)=>{for(let l=0;l<e.length;l++){if(e[l]._rowKey===t)return[t];if(Array.isArray(e[l].children)){const n=Ua(e[l].children,t);if(n)return[e[l]._rowKey,n].flat()}}},Ga=(e,t)=>e.reduce(((e,l)=>{const n=Object.assign({},l);return Array.isArray(l.children)&&(n.children=Ga(l.children,t)),(t(n)||n.children&&n.children.length>0)&&e.push(n),e}),[]),Ya=e=>e.map((e=>(delete e.chosen,delete e.selected,e))),Xa=(e,t,l=!1)=>{const n=new Set;return function e(t,a,r=1){if(n.has(t))return!1;if(t===a)return!0;if(l&&r>1)return!1;n.add(t);const i=r+1;if(Array.isArray(t)){if(!Array.isArray(a)||t.length!==a.length)return!1;for(let l=0;l<t.length;l++)if(!e(t[l],a[l],i))return!1;return!0}if(t&&a&&"object"==typeof t&&"object"==typeof a){const l=Object.keys(t);return l.length===Object.keys(a).length&&l.every((l=>e(t[l],a[l],i)))}return!1}(e,t)},Qa=(e,t)=>e===t,Za=e=>["nil","nnil"].includes(e);function Ja(e,t){for(const l in t){const n=t[l],a=Pa(e,l);if(n)if(Array.isArray(a)){if(!a.some((e=>n.includes(e))))return!1}else if(!n.includes(a))return!1}return!0}const er=(e,t,l)=>Object.keys(t).length&&e.length?l?Ga(e,(e=>Ja(e,t))):e.filter((e=>Ja(e,t))):e,tr=e=>["","small","middle","large"].includes(e),lr=80,nr="1",ar="0",rr=400,ir=["RANGE_INPUT","RANGE_INPUT_NUMBER","RANGE_SEARCH_HELPER","MULTIPLE_CHECKBOX","MULTIPLE_SELECT","RANGE_DATE","RANGE_TIME","MULTIPLE_TREE_SELECT","MULTIPLE_SEARCH_HELPER","MULTIPLE_TREE_TABLE_HELPER","MULTIPLE_CASCADER","UPLOAD_IMG","UPLOAD_FILE"],or={bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}}};var sr,dr,ur;!function(e){e.date="date",e.datetime="date",e.exactdate="date",e.week="week",e.month="month",e.quarter="quarter",e.year="year"}(sr||(sr={})),function(e){e.date="YYYY-MM-DD HH:mm:ss",e.datetime="YYYY-MM-DD HH:mm:ss",e.exactdate="YYYY-MM-DD",e.week="YYYY-wo",e.month="YYYY-MM",e.quarter="YYYY-[Q]Q",e.year="YYYY"}(dr||(dr={})),function(e){e.hour="HH",e["hour-minute"]="HH:mm",e["hour-minute-second"]="HH:mm:ss"}(ur||(ur={}));const cr={items:se.default.arrayOf(se.default.shape({type:se.default.string.isRequired,fieldName:se.default.string.isRequired})),initialValues:se.default.object,initialExtras:se.default.object,layout:se.default.oneOf(["horizontal","vertical"]),size:(e,t,l)=>{if(!tr(e[t]||""))return ct("Form","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},cols:se.default.number,className:se.default.string,style:se.default.object,component:se.default.oneOfType([se.default.string,se.default.bool]),compactMode:se.default.bool,labelWidth:se.default.oneOfType([se.default.number,se.default.string]),labelAlign:se.default.oneOf(["left","right"]),labelWrap:se.default.bool,formType:se.default.oneOf(["default","search","onlyShow"]),disabled:se.default.bool,uniqueKey:se.default.string,defaultRows:se.default.number,defaultExpand:se.default.bool,searchButtonCols:se.default.number,scrollToFirstError:se.default.bool,authConfig:se.default.object,isAutoFocus:se.default.bool,isCollapse:se.default.bool,isFieldsDefine:se.default.bool,isSearchBtn:se.default.bool,isSubmitBtn:se.default.bool,fieldsChange:se.default.func,onValuesChange:se.default.func,onFieldsChange:se.default.func,onFinish:se.default.func,onFinishFailed:se.default.func,onReset:se.default.func,onCollapse:se.default.func},fr={layout:"horizontal",labelWidth:lr,labelAlign:"right",formType:"default",initialValues:{},initialExtras:{},defaultRows:1,isAutoFocus:!0,isCollapse:!0,isSearchBtn:!0,onValuesChange:Le,onFieldsChange:Le,onFinish:Le,onFinishFailed:Le,onReset:Le,onCollapse:Le},pr=(e,t)=>{if(!e)return null;if(t===dr.week){const t=e.match(/^(\d{4})-(\d+)/);return t?j.default().year(Number(t[1])).week(Number(t[2])):null}if(t===dr.quarter){const t=e.match(/^(\d{4})-Q(\d)/);return t?j.default().year(Number(t[1])).quarter(Number(t[2])):null}return j.default(e,t)},mr=(e,t)=>e?j.default(e).format(t):"",hr=e=>""===e||null==e,gr=(e,t)=>{var l;if(!e)return"";if(!t.includes("|"))return e[t];const n=t.split("|");let a="";for(let t=0,r=n.length;t<r;t++){a+=(null!==(l=e[n[t].trim()])&&void 0!==l?l:"")+(t===r-1?"":" | ")}return a},vr=(e,t,l)=>{for(const n in l)if(Object.keys(t).includes(n)&&t[n]!==l[n])if(t[n].includes("|")){const a=t[n].split("|"),r=l[n].split("|");a.forEach(((t,l)=>e[t]=e[r[l]]))}else e[t[n]]=e[l[n]]},yr=(e,t,l)=>{for(const n in l)if(Object.keys(t).includes(n)&&t[n]!==l[n])if(t[n].includes("|")){const a=t[n].split("|"),r=l[n].split("|");a.forEach(((t,l)=>e[t]=e[r[l]]))}else e[t[n]]=e[l[n]]},br=(e,t,n)=>e.map((e=>{const a={value:e[t],text:e[n]};return e.disabled&&(a.disabled=!0),l.isUndefined(e.isLeaf)||(a.isLeaf=!!e.isLeaf),l.isUndefined(e.selectable)||(a.selectable=!!e.selectable),Array.isArray(e.children)&&(a.children=br(e.children,t,n)),a})),xr=(e,t)=>{for(const l of e){if(l.value===t)return l;if(Array.isArray(l.children)){const e=xr(l.children,t);if(e)return e}}return null},Er=(e,t,l=0)=>{const n=[];return e.forEach((e=>{e.value==t.split(",")[l]&&n.push(e),Array.isArray(e.children)&&n.push(...Er(e.children,t,l+1))})),n},Cr=e=>Re(e)||"string"==typeof e,wr=(e,t,l,n)=>{var a;const r={};return r.filters=(null===(a=e.filters)||void 0===a?void 0:a.filter((e=>"1"===e.isQuery)).map((e=>{const t={type:e.type,label:e.label,fieldName:e.fieldName,options:{}};return Array.isArray(e.dicData)&&(t.options.itemList=e.dicData),t})))||[],r.table={columns:e.columns||[],rowKey:e.valueName},r.fieldsDefine={valueKey:e.valueKey||e.valueName},r.fieldAliasMap={[n?"textKey":t]:e.displayName[0],[n?"valueKey":e.valueKey||e.valueName]:e.valueName},e.tableSetting&&(r.table.fetch={api:l(e.tableSetting.api),dataKey:e.tableSetting.dataKey}),e.echoSetting&&(r.echoRequest={fetchApi:l(e.echoSetting.api),formatter:t=>{var l;return Object.assign({},t,{[e.echoSetting.paramKey]:null!==(l=t.key)&&void 0!==l?l:t.keys})},dataKey:e.echoSetting.dataKey},e.echoSetting.displayKey&&(r.echoRequest.fieldAliasMap={[n?"textKey":t]:e.echoSetting.displayKey[0]})),e.treeSetting&&(r.tree={fetch:{api:l(e.treeSetting.api),dataKey:e.treeSetting.dataKey,valueKey:e.treeSetting.valueKey,textKey:e.treeSetting.textKey},tableParamsMap:()=>{var t;const l={};return null===(t=e.treeSetting.relativeTable)||void 0===t||t.forEach((e=>l[e.tableField]=e.treeField)),l}}),e.emmediateSetting&&(r.columns=e.emmediateSetting.columns,r.request={fetchApi:l(e.emmediateSetting.api),dataKey:e.emmediateSetting.dataKey}),r};var Sr={PINYINS:["A","AI","AN","ANG","AO","BA","BAI","BAN","BANG","BAO","BEI","BEN","BENG","BI","BIAN","BIAO","BIE","BIN","BING","BO","BU","CA","CAI","CAN","CANG","CAO","CE","CEN","CENG","CHA","CHAI","CHAN","CHANG","CHAO","CHE","CHEN","CHENG","CHI","CHONG","CHOU","CHU","CHUA","CHUAI","CHUAN","CHUANG","CHUI","CHUN","CHUO","CI","CONG","COU","CU","CUAN","CUI","CUN","CUO","DA","DAI","DAN","DANG","DAO","DE","DEN","DENG","DI","DIAN","DIAO","DIE","DING","DIU","DONG","DOU","DU","DUAN","DUI","DUN","DUO","E","EI","EN","ENG","ER","FA","FAN","FANG","FEI","FEN","FENG","FIAO","FO","FOU","FU","GA","GAI","GAN","GANG","GAO","GE","GEI","GEN","GENG","GONG","GOU","GU","GUA","GUAI","GUAN","GUANG","GUI","GUN","GUO","HA","HAI","HAN","HANG","HAO","HE","HEI","HEN","HENG","HM","HONG","HOU","HU","HUA","HUAI","HUAN","HUANG","HUI","HUN","HUO","JI","JIA","JIAN","JIANG","JIAO","JIE","JIN","JING","JIONG","JIU","JU","JUAN","JUE","JUN","KA","KAI","KAN","KANG","KAO","KE","KEN","KENG","KONG","KOU","KU","KUA","KUAI","KUAN","KUANG","KUI","KUN","KUO","LA","LAI","LAN","LANG","LAO","LE","LEI","LENG","LI","LIA","LIAN","LIANG","LIAO","LIE","LIN","LING","LIU","LO","LONG","LOU","LU","LV","LUAN","LVE","LUN","LUO","M","MA","MAI","MAN","MANG","MAO","ME","MEI","MEN","MENG","MI","MIAN","MIAO","MIE","MIN","MING","MIU","MO","MOU","MU","N","NA","NAI","NAN","NANG","NAO","NE","NEI","NEN","NENG","NI","NIAN","NIANG","NIAO","NIE","NIN","NING","NIU","NONG","NOU","NU","NV","NUAN","NVE","NUN","NUO","O","OU","PA","PAI","PAN","PANG","PAO","PEI","PEN","PENG","PI","PIAN","PIAO","PIE","PIN","PING","PO","POU","PU","QI","QIA","QIAN","QIANG","QIAO","QIE","QIN","QING","QIONG","QIU","QU","QUAN","QUE","QUN","RAN","RANG","RAO","RE","REN","RENG","RI","RONG","ROU","RU","RUA","RUAN","RUI","RUN","RUO","SA","SAI","SAN","SANG","SAO","SE","SEN","SENG","SHA","SHAI","SHAN","SHANG","SHAO","SHE","SHEN","SHENG","SHI","SHOU","SHU","SHUA","SHUAI","SHUAN","SHUANG","SHUI","SHUN","SHUO","SI","SONG","SOU","SU","SUAN","SUI","SUN","SUO","TA","TAI","TAN","TANG","TAO","TE","TENG","TI","TIAN","TIAO","TIE","TING","TONG","TOU","TU","TUAN","TUI","TUN","TUO","WA","WAI","WAN","WANG","WEI","WEN","WENG","WO","WU","XI","XIA","XIAN","XIANG","XIAO","XIE","XIN","XING","XIONG","XIU","XU","XUAN","XUE","XUN","YA","YAN","YANG","YAO","YE","YI","YIN","YING","YO","YONG","YOU","YU","YUAN","YUE","YUN","ZA","ZAI","ZAN","ZANG","ZAO","ZE","ZEI","ZEN","ZENG","ZHA","ZHAI","ZHAN","ZHANG","ZHAO","ZHE","ZHEN","ZHENG","ZHI","ZHONG","ZHOU","ZHU","ZHUA","ZHUAI","ZHUAN","ZHUANG","ZHUI","ZHUN","ZHUO","ZI","ZONG","ZOU","ZU","ZUAN","ZUI","ZUN","ZUO",""],UNIHANS:["阿","哎","安","肮","凹","八","挀","扳","邦","勹","陂","奔","伻","屄","边","灬","憋","汃","冫","癶","峬","嚓","偲","参","仓","撡","冊","嵾","曽","叉","芆","辿","伥","抄","车","抻","阷","吃","充","抽","出","欻","揣","巛","刅","吹","旾","逴","呲","匆","凑","粗","汆","崔","邨","搓","咑","呆","丹","当","刀","嘚","扥","灯","氐","甸","刁","爹","丁","丟","东","吺","厾","耑","垖","吨","多","妸","诶","奀","鞥","儿","发","帆","匚","飞","分","丰","覅","仏","紑","夫","旮","侅","甘","冈","皋","戈","给","根","刯","工","勾","估","瓜","乖","关","光","归","丨","呙","哈","咍","佄","夯","茠","诃","黒","拫","亨","噷","叿","齁","乎","花","怀","欢","巟","灰","昏","吙","丌","加","戋","江","艽","阶","巾","坕","冂","丩","凥","姢","噘","军","咔","开","刊","忼","尻","匼","肎","劥","空","抠","扝","夸","蒯","宽","匡","亏","坤","扩","垃","来","兰","啷","捞","肋","勒","崚","哩","俩","奁","良","撩","毟","拎","伶","溜","囖","龙","瞜","噜","驴","娈","掠","抡","罗","呣","妈","埋","嫚","牤","猫","么","呅","门","甿","咪","宀","喵","乜","民","名","谬","摸","哞","毪","嗯","拏","腉","囡","囔","孬","疒","娞","恁","能","妮","拈","娘","鸟","捏","囜","宁","妞","农","羺","奴","女","奻","疟","黁","挪","喔","讴","妑","拍","眅","乓","抛","呸","喷","匉","丕","囨","剽","氕","姘","乒","钋","剖","仆","七","掐","千","呛","悄","癿","亲","靑","卭","丘","区","峑","缺","夋","呥","穣","娆","惹","人","扔","日","茸","厹","邚","挼","堧","婑","瞤","捼","仨","毢","三","桒","掻","閪","森","僧","杀","筛","山","伤","弰","奢","申","升","尸","収","书","刷","衰","闩","双","脽","吮","说","厶","忪","捜","苏","狻","夊","孙","唆","他","囼","坍","汤","夲","忑","熥","剔","天","旫","帖","厅","囲","偷","凸","湍","推","吞","乇","穵","歪","弯","尣","危","昷","翁","挝","乌","夕","虲","仙","乡","灱","些","心","星","凶","休","吁","吅","削","坃","丫","恹","央","幺","倻","一","囙","应","哟","佣","优","扜","囦","曰","晕","帀","災","兂","匨","傮","则","贼","怎","増","扎","捚","沾","张","佋","蜇","贞","争","之","中","州","朱","抓","拽","专","妆","隹","宒","卓","乲","宗","邹","租","钻","厜","尊","昨","兙"],EXCEPTIONS:{"曾":"ZENG","沈":"SHEN","嗲":"DIA","碡":"ZHOU","聒":"GUO","炔":"QUE","蚵":"KE","砉":"HUA","嬤":"MO","嬷":"MO","蹒":"PAN","蹊":"XI","丬":"PAN","霰":"XIAN","莘":"XIN","豉":"CHI","饧":"XING","筠":"JUN","长":"CHANG","帧":"ZHEN","峙":"SHI","郍":"NA","芎":"XIONG","谁":"SHUI"}};const Nr="阿",Tr="鿿",Ir=1,Or=2,Rr=3;let kr,Lr=null;function Pr(e){return e||null===Lr?("object"==typeof Intl&&Intl.Collator?(kr=new Intl.Collator(["zh-Hans-CN","zh-CN"]),Lr=1===Intl.Collator.supportedLocalesOf(["zh-CN"]).length):Lr=!1,Lr):Lr}function Ar(e){const t=Sr.UNIHANS,l=Sr.PINYINS,n=Sr.EXCEPTIONS,a={source:e};if(e in n)return a.type=Or,a.target=n[e],a;let r,i=-1;if(e.charCodeAt(0)<256)return a.type=Ir,a.target=e,a;if(r=kr.compare(e,Nr),r<0)return a.type=Rr,a.target=e,a;if(0===r)a.type=Or,i=0;else{if(r=kr.compare(e,Tr),r>0)return a.type=Rr,a.target=e,a;0===r&&(a.type=Or,i=t.length-1)}if(a.type=Or,i<0){let l=0,n=t.length-1;for(;l<=n;){i=~~((l+n)/2);const a=t[i];if(r=kr.compare(e,a),0===r)break;r>0?l=i+1:n=i-1}}return r<0&&i--,a.target=l[i],a.target||(a.type=Rr,a.target=a.source),a}function Fr(e){return"string"==typeof e&&Pr()?e.split("").map((e=>Ar(e))):e}var _r={isSupported:Pr,parse:Fr,patchDict:function(e){e&&("function"==typeof e&&(e=[e]),e.forEach&&e.forEach((e=>{"function"==typeof e&&e(Sr)})))},genToken:Ar,convertToPinyin:(e,t,l)=>Fr(e).map((e=>t&&e.type===Or?e.target.toLowerCase():e.target)).join(l||"")};var Dr={patcher:function(e){e.EXCEPTIONS={"嗲":"DIA","碡":"ZHOU","聒":"GUO","炔":"QUE","蚵":"KE","砉":"HUA","嬷":"MO","蹊":"XI","丬":"PAN","霰":"XIAN","豉":"CHI","饧":"XING","帧":"ZHEN","芎":"XIONG","谁":"SHUI","钶":"KE"},e.UNIHANS[91]="伕",e.UNIHANS[347]="仚",e.UNIHANS[393]="诌",e.UNIHANS[39]="婤",e.UNIHANS[50]="腠",e.UNIHANS[369]="攸",e.UNIHANS[123]="乯",e.UNIHANS[171]="刕",e.UNIHANS[102]="佝",e.UNIHANS[126]="犿",e.UNIHANS[176]="列",e.UNIHANS[178]="刢",e.UNIHANS[252]="娝",e.UNIHANS[330]="偸"},shouldPatch:function(e){return"function"==typeof e&&("FOU"===e("伕").target&&"XIA"===e("仚").target&&"ZHONG"===e("诌").target&&"CHONG"===e("婤").target&&"CONG"===e("腠").target&&"YONG"===e("攸").target&&"HOU"===e("乯").target&&"LENG"===e("刕").target&&"GONG"===e("佝").target&&"HUAI"===e("犿").target&&"LIAO"===e("列").target&&"LIN"===e("刢").target&&"E"===e("钶").target)}};_r.isSupported()&&Dr.shouldPatch(_r.genToken)&&_r.patchDict(Dr);const Mr=e=>{const{value:t,bordered:l}=e;return q.default.createElement(d.Input,{value:t,title:t,bordered:l,readOnly:!0})};Mr.displayName="FormItemView";const Hr=q.default.forwardRef(((e,t)=>{const{text:n="",tag:a="div",enabled:r=!0,copy:i,fetch:o,className:s,style:d,title:u}=e,{global:c}=q.default.useContext(xe),f=gt("translate"),p=n?n.trim():"",m=r&&!!p,h=o||(null==c?void 0:c.translateFetch);q.default.useMemo((()=>{(null==h?void 0:h.api)||ft("Translate","设置 `fetch` 参数,或通过 [ConfigProvider] 配置 `translateFetch` 全局参数")}),[h]);const{translate:g}=(e=>{const[t,n]=q.default.useState(new Map);return{translate:st((a=>Ie(void 0,void 0,void 0,(function*(){var r;if(!a||!e)return null;if(t.has(a))return t.get(a);try{const{params:t,dataKey:i,formatter:o=(e=>e),afterFetch:s}=e,d=yield e.api(o(Object.assign({text:a},t)));if(200===d.code){let e=l.isString(d.data)?d.data:null!==(r=l.get(d.data,i))&&void 0!==r?r:"";return e="function"==typeof s?yield s(e):e,n((t=>new Map(t).set(a,e))),e}return""}catch(e){return console.error("[Translate] 翻译失败:",e),null}}))))}})(h),[v,y,b,x]=(({prefixCls:e,text:t,enabled:l,translate:n})=>{const a=q.default.useRef(null),{t:r}=ot(),[i,o]=q.default.useState(!1),[s,d]=q.default.useState(null),[u,c]=q.default.useState(!1),[f,p]=q.default.useState(""),m={width:150,height:100,zIndex:9999};Yl((()=>{i&&t&&(c(!0),n(t).then((e=>{e&&p(e)})).finally((()=>{c(!1)}))),!t&&i&&v()}),[i,t]);const h=e=>{var t;const{width:l,height:n}=(null===(t=a.current)||void 0===t?void 0:t.getBoundingClientRect())||m,r=l,i=n,o=window.innerWidth,s=window.innerHeight;let u=e.clientX,c=e.clientY;u+r>o?u=Math.max(u-r-5,0):u+=10,c+i>s?c=Math.max(c-i-5,0):c+=10,d({x:u,y:c})},g=st((e=>{l&&e.ctrlKey&&(o(!0),Fe((()=>h(e))))})),v=()=>{i&&(o(!1),Fe((()=>d(null))))},y=st((e=>{l&&e.ctrlKey&&(i?h(e):(o(!0),Fe((()=>h(e)))))})),b={position:"fixed",top:(null==s?void 0:s.y)||0,left:(null==s?void 0:s.x)||0,zIndex:m.zIndex};return[q.default.createElement(ue.default,{open:i},q.default.createElement("div",{ref:a,className:J.default("ant-dropdown-menu",`${e}__tooltip`),style:b},q.default.createElement("div",{className:"label"},r("qm.translate.sourceText"),":"),q.default.createElement("div",{className:"text"},t),q.default.createElement("div",{className:"label"},r("qm.translate.targetText"),":"),q.default.createElement("div",{className:"text primary"},u?`${r("qm.translate.translating")}...`:f))),g,v,y]})({prefixCls:f,text:p,enabled:m,translate:g}),E=e.children||p;if(!E)return null;const C={[f]:!0,"help-cursor":m};return q.default.createElement(q.default.Fragment,null,q.default.createElement(a,{ref:t,className:J.default(C,s),style:d,title:u,onMouseEnter:y,onMouseLeave:b,onMouseMove:x},E),v)}));Hr.displayName="Translate";const{Option:qr}=d.Select,$r=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,items:n,multiple:a,loading:r,onChange:i,onValuesChange:o}=e,{t:s}=ot(),{fieldName:u,options:c={},style:f={},placeholder:p=s("qm.form.selectPlaceholder"),bordered:m=!0,allowClear:h=!0,translate:g,readOnly:v,disabled:y,onClear:b}=e.option,{itemList:x=[],filterable:E=!0,listHeight:C=rr,collapseTags:w,maxTagTextLength:S,dropdownStyle:N,openPyt:T=!0}=c,I=De(x)?n:x,O=e=>{var t;return(null===(t=I.find((t=>t.value===e)))||void 0===t?void 0:t.text)||(null==e?void 0:e.toString())||""},R=e=>a?(null==e?void 0:e.map((e=>O(e))).join(","))||"":O(e),k=t.isOnlyShow?q.default.createElement(Mr,{value:R(l),bordered:m}):q.default.createElement(d.Select,tt({value:l,mode:a?"multiple":void 0,popupClassName:`form-popper__${u}`,dropdownStyle:N,placeholder:p,style:f,loading:r,bordered:m,allowClear:h,disabled:y,showSearch:E,listHeight:C,maxTagCount:w?"responsive":void 0,maxTagTextLength:S},a?{title:R(l)}:null,{filterOption:(e,t)=>{var l;const n=(null===(l=null==t?void 0:t.children)||void 0===l?void 0:l.toString())||"",a=_r.parse(n).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(T?`${n}|${a}`:n).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{null==i||i(e),o(e,R(e),I)})(e)},onClear:b}),I.map((e=>q.default.createElement(qr,{key:e.value,value:e.value,disabled:e.disabled},e.text))));return g?q.default.createElement(Hr,{text:R(l)},k):k};class jr extends e.Component{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Ie(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:a={},dataKey:r,valueKey:i="value",textKey:o="text",callback:s}=t;if(n){this.setState({loading:!0});try{const t=yield n(a);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=l.get(t.data,r))&&void 0!==e?e:[],a=n.map((e=>({value:e[i],text:e[o]})));this.setState({itemList:a},(()=>null==s?void 0:s(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const a=null===(t=e.option.request)||void 0===t?void 0:t.params,r=null===(n=this.props.option.request)||void 0===n?void 0:n.params;l.isEqual(a,r)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t,loading:l}=this.state,{type:n,label:a,tooltip:r,fieldName:i,invisible:o,options:s={},labelWidth:u=e.props.labelWidth,className:c,extra:f,buttonAfter:p,validateTrigger:m,rules:h=[],onChange:g=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(a),className:J.default(c),tooltip:r,hidden:o,labelCol:{flex:e.verticalLayout?"initial":$e(u)},required:e.getFormItemRequired(h)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:i,noStyle:!0,rules:h,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(a)}},q.default.createElement($r,{option:this.props.option,items:t,loading:l,multiple:this.props.multiple,onValuesChange:(t,l,n)=>{g(t,l,n),e.setViewValue(i,l)}}))),p&&q.default.createElement(d.Col,null,e.renderFormItemButton(i,p)),f&&q.default.createElement(d.Col,{flex:$e(f.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:i},f)))))}}jr.contextType=Zn;const Kr=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{label:r,options:i={},style:o={},readOnly:s,disabled:u=t.isFormDisabled}=e.option,{labelToCheckbox:c,falseValue:f=ar,trueValue:p=nr}=i,{t:m}=ot(),h=e=>m(e===p?"am.form.trueText":"am.form.falseText");return q.default.createElement(d.Checkbox,{checked:l===p,style:o,disabled:u||t.isOnlyShow,onChange:e=>{const{checked:t}=e.target;(e=>{null==n||n(e),a(e,h(e))})(t?p:f)}},c?r:null)};class Vr extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option,{labelToCheckbox:m}=i;return q.default.createElement(d.Form.Item,{label:m?" ":e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Kr,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Vr.contextType=Zn;const zr=e=>{const{uniqueKey:t,items:n,fieldsChange:a}=e,{global:r}=q.default.useContext(xe),{$$form:i}=q.default.useContext(Zn),{$size:o}=dt(e),{t:s}=ot(),u=q.default.useRef(null),[c,f]=q.default.useState(!1),p=q.default.useMemo((()=>t?`form_${t}`:""),[t]);q.default.useLayoutEffect((()=>{v()}),[]);const m=()=>{if(!p)return;const e=JSON.parse(localStorage.getItem(p));var t;if(e||(t=p,Ie(void 0,void 0,void 0,(function*(){const e=null==r?void 0:r.getComponentConfigApi;if(e)try{const l=yield e({key:t});if(200===l.code)return l.data}catch(e){}}))).then((e=>{e?(localStorage.setItem(p,JSON.stringify(e)),v()):(null==r?void 0:r.getComponentConfigApi)&&h(n)})).catch((()=>{})),!e)return;return l.xor(e.map((e=>e.fieldName)),n.map((e=>e.fieldName))).length>0?n.map((t=>{const{fieldName:n}=t,a=e.find((e=>e.fieldName===n));return a?(l.isUndefined(a.hidden)||(t.hidden=a.hidden),t):t})):e.map((e=>{const t=n.find((t=>t.fieldName===e.fieldName));return Object.assign(Object.assign({},t),e)}))},h=e=>{if(!p)return;const t=e.map((e=>{const t={};return l.isUndefined(e.hidden)||(t.hidden=e.hidden),Object.assign({fieldName:e.fieldName},t)})),n=JSON.parse(localStorage.getItem(p));var a,i;l.isEqual(t,n)||(localStorage.setItem(p,JSON.stringify(t)),a=p,i=t,Ie(void 0,void 0,void 0,(function*(){const e=null==r?void 0:r.saveComponentConfigApi;if(e)try{yield e({[a]:i})}catch(e){}})))},v=()=>{const e=m();e&&y(e)},y=e=>{null==a||a([...e])},b=()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","fields-list")},q.default.createElement("div",{className:"reset"},q.default.createElement(pt,{type:"text",size:"small",onClick:()=>(e=>{const t=e.filter((e=>n.find((t=>t.fieldName===e.fieldName)))).map((e=>{const t=n.find((t=>t.fieldName===e.fieldName));return Object.assign({},t,{hidden:e.hidden})}));y(t),h(t)})(i.getOriginItems())},s("qm.table.columnFilter.reset"))),q.default.createElement(I.ReactSortable,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:n,setList:e=>{const t=e.map((e=>e.fieldName)),a=n.map((e=>e.fieldName));if(l.isEqual(t,a))return;i.setExpandHandle(!0);const r=Ya(e);y(r),h(r)}},n.map((e=>{var t;return q.default.createElement("li",{key:e.fieldName,className:"item",style:e.noAuth?{display:"none"}:void 0},q.default.createElement(d.Checkbox,{disabled:(null===(t=e.rules)||void 0===t?void 0:t.findIndex((e=>e.required)))>-1,checked:!e.hidden,onChange:t=>{const{checked:l}=t.target;e.hidden=!l,y(n),h(n)}}),q.default.createElement(g.HolderOutlined,{className:"handle",title:s("qm.form.draggable")}),q.default.createElement("span",{className:"title"},i.getFormItemLabel(e.label)))})))),x=gt("form-fields-filter"),E={[x]:!0,[`${x}--lg`]:"large"===o,[`${x}--sm`]:"small"===o};return q.default.createElement(d.Dropdown,{open:c,trigger:["click"],dropdownRender:()=>b(),overlayClassName:J.default(E),placement:"bottomRight",overlayStyle:{minWidth:160},getPopupContainer:()=>u.current,onOpenChange:e=>{f(e)}},q.default.createElement("a",{ref:u,style:{padding:"5px 0"}},q.default.createElement(g.UnorderedListOutlined,null)))};zr.displayName="FieldsFilter";const Wr=q.default.forwardRef(((e,t)=>{const{$$form:n}=q.default.useContext(Zn),{value:a,onChange:r,onValuesChange:i}=e,{t:o}=ot(),{options:s={},style:u={},placeholder:c=o("qm.form.inputPlaceholder"),bordered:f=!0,allowClear:p=!0,translate:m,readOnly:h,disabled:g,onFocus:v,onBlur:y,onEnter:b,onClear:x}=e.option,{prefix:E,suffix:C,password:w,maxLength:S,pattern:N,toUpper:T,toTrim:I,autoFocus:O,autoComplete:R,secretType:k}=s,L=k&&(h||g),P=q.default.useRef(),A=q.default.useRef(!1);q.default.useEffect((()=>{var e;const t=()=>null==x?void 0:x(),l=null===(e=P.current)||void 0===e?void 0:e.input.parentNode.querySelector("span[class*='clear-icon']");return p&&l&&l.addEventListener("click",t),()=>{null==l||l.removeEventListener("click",t)}}),[]);const F=e=>{null==r||r(e),i(e)},_=w?d.Input.Password:d.Input,D=L?((e="",t)=>(e=e.toString(),"finance"===t&&(e=(e=>e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","))(e)),"name"===t&&(e=e.replace(/^([\u4e00-\u9fa5]{1}).+$/,"$1**")),"phone"===t&&(e=e.replace(/^(\d{3}).+(\d{4})$/,"$1****$2")),"IDnumber"===t&&(e=e.replace(/^(\d{3}).+(\w{4})$/,"$1***********$2")),"bankNumber"===t&&(e=e.replace(/^(\d{4}).+(\w{3})$/,"$1************$2")),e))(a,k):a,M=n.isOnlyShow?q.default.createElement(Mr,{value:(e=>e&&w?new Array(e.length).fill("*").join(""):e)(D),bordered:f}):q.default.createElement(_,{ref:e=>{P.current=e,"function"==typeof t&&t(e)},value:D,autoComplete:w?"new-password":R,autoFocus:O,placeholder:c,style:u,title:w?"":D,prefix:E,suffix:C,maxLength:S,bordered:f,allowClear:p,readOnly:h,disabled:g,onFocus:e=>{null==v||v(e.target.value,e)},onBlur:t=>{var l;let n=null!==(l=t.target.value)&&void 0!==l?l:"";if(I){const e=n.trim();n!==e&&(n=e,F(n))}(t=>{const{onBlur:l}=e;null==l||l(t)})(n),null==y||y(n,t)},onKeyUp:e=>{var t;if(13===e.keyCode){const{value:l}=e.target;null==b||b(l,e),n.isFilterType&&(n.SUBMIT_FORM(),null===(t=P.current)||void 0===t||t.blur())}},onCompositionStart:()=>{A.current=!0},onCompositionEnd:()=>{A.current=!1},onChange:e=>{let t=e.target.value;l.isRegExp(N)&&(t=N.test(t)?t:null!=a?a:""),T&&!A.current&&(t=t.toUpperCase()),F(t)}});return m?q.default.createElement(Hr,{text:D,enabled:!w},M):M}));Wr.displayName="VInput";class Br extends e.Component{constructor(){super(...arguments),this.focus=()=>{const{type:e}=this.props.option;this[e].focus()}}render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,buttonAfter:c,validateTrigger:f,rules:p=[],onChange:m=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(p)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Wr,{ref:e=>this[t]=e,option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(a,t)}}))),c&&q.default.createElement(d.Col,null,e.renderFormItemButton(a,c)),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Br.contextType=Zn;const Ur=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l=[],onChange:n,onValuesChange:a}=e,{t:r}=ot(),{options:i={},placeholder:o=r("qm.form.rangeInputNumberPlaceholder"),bordered:s=!0,allowClear:u,readOnly:c,disabled:f}=e.option,{prefix:p,suffix:m,maxLength:h}=i,g=e=>{const t=e.every((e=>!e))?[]:e;null==n||n(t),a(t,v(t))},v=e=>e.join(" - ");return t.isOnlyShow?q.default.createElement(Mr,{value:v(l),bordered:s}):q.default.createElement(d.Input.Group,null,q.default.createElement(d.Input,{value:l[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:o[0],prefix:p,suffix:m,maxLength:h,allowClear:u,bordered:s,readOnly:c,disabled:f,onChange:e=>{const{value:t}=e.target;g([t,l[1]])}}),q.default.createElement(d.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:s,disabled:f,readOnly:!0}),q.default.createElement(d.Input,{value:l[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:o[1],prefix:p,suffix:m,maxLength:h,bordered:s,allowClear:u,readOnly:c,disabled:f,onChange:e=>{const{value:t}=e.target;g([l[0],t])}}))};class Gr extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,labelWidth:i=e.props.labelWidth,className:o,extra:s,validateTrigger:u,rules:c=[],onChange:f=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(o),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(i)},required:e.getFormItemRequired(c)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:c,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Ur,{option:this.props.option,onValuesChange:(t=[],l)=>{f(t),e.setViewValue(a,l)}}))),s&&q.default.createElement(d.Col,{flex:$e(s.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},s)))))}}Gr.contextType=Zn;const Yr=q.default.forwardRef(((e,t)=>{const{$$form:n}=q.default.useContext(Zn),{value:a,onChange:r,onValuesChange:i}=e,{t:o}=ot(),{options:s={},style:u={},placeholder:c=o("qm.form.inputPlaceholder"),bordered:f=!0,readOnly:p,disabled:m,onFocus:h,onBlur:g,onEnter:v}=e.option,{step:y=1,min:b,max:x,precision:E,autoFocus:C,stringMode:w,textAlign:S="left",controls:N=!0,formatter:T,parser:I}=s,O=q.default.useRef(),R=q.default.useRef(a),k=e=>{const t=hr(e)?"":l.isNumber(e)?e.toFixed(E):new ce.default(e).toFixed(E);return"function"==typeof T?T(t):t},L={[S]:!0,controls:N};return n.isOnlyShow?q.default.createElement(Mr,{value:k(a),bordered:f}):q.default.createElement(d.InputNumber,{ref:e=>{O.current=e,"function"==typeof t&&t(e)},value:a,className:J.default(L),placeholder:c,style:Object.assign({width:"100%"},u),step:y,min:b,max:x,controls:N,precision:E,autoFocus:C,stringMode:w,formatter:T,parser:I,bordered:f,readOnly:p,disabled:m,onFocus:e=>{null==h||h(e.target.value,e)},onBlur:t=>{Fe((()=>{(t=>{const{onBlur:l}=e;null==l||l(t)})(R.current),null==g||g(R.current,t)}))},onKeyUp:e=>{var t;13===e.keyCode&&(null==v||v(a,e),n.isFilterType&&(n.SUBMIT_FORM(),null===(t=O.current)||void 0===t||t.blur()))},onChange:e=>{const t=null!=e?e:"";!w&&(Number(t)>Number.MAX_SAFE_INTEGER||Number(t)<Number.MIN_SAFE_INTEGER)||(e=>{R.current=e,null==r||r(e),i(e,k(e))})(t)}})}));Yr.displayName="VInputNumber";class Xr extends e.Component{constructor(){super(...arguments),this.focus=()=>{const{type:e}=this.props.option;this[e].focus()}}render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,buttonAfter:c,validateTrigger:f,rules:p=[],onChange:m=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(p)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Yr,{ref:e=>this[t]=e,option:this.props.option,onValuesChange:(t,l)=>{m(t),e.setViewValue(a,l)}}))),c&&q.default.createElement(d.Col,null,e.renderFormItemButton(a,c)),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Xr.contextType=Zn;const Qr=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l=[],onChange:n,onValuesChange:a}=e,{t:r}=ot(),{options:i={},placeholder:o=r("qm.form.rangeInputNumberPlaceholder"),bordered:s=!0,allowClear:u,readOnly:c,disabled:f}=e.option,{step:p=1,min:m=0,max:h,textAlign:g="left",controls:v=!0,precision:y,formatter:b,parser:x}=i,E=e=>{e.every((e=>null!==e))&&e[0]>e[1]&&(e[1]=e[0]),C(e)},C=e=>{const t=e.every((e=>null===e))?[]:[...e];null==n||n(t),a(t,w(t))},w=e=>hr(e)?"":e.map((e=>hr(e)?"":Number(e).toFixed(y))),S={[g]:!0,controls:v};return t.isOnlyShow?q.default.createElement(Mr,{value:w(l),bordered:s}):q.default.createElement(d.Input.Group,null,q.default.createElement(d.InputNumber,{value:l[0],className:J.default("site-input-left",S),style:{width:"calc(50% - 5px)",display:"table-cell",float:"left"},placeholder:o[0],step:p,min:m,max:h,controls:v,precision:y,formatter:b,parser:x,bordered:s,readOnly:c,disabled:f,onChange:e=>{C([e,l[1]])},onBlur:()=>{E(l)}}),q.default.createElement(d.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:s,disabled:f,readOnly:!0}),q.default.createElement(d.InputNumber,{value:l[1],className:J.default("site-input-right",S),style:{width:"calc(50% - 5px)"},placeholder:o[1],step:p,min:m,max:h,controls:v,precision:y,formatter:b,parser:x,bordered:s,readOnly:c,disabled:f,onChange:e=>{C([l[0],e])},onBlur:()=>{E(l)}}))};class Zr extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,labelWidth:i=e.props.labelWidth,className:o,extra:s,validateTrigger:u,rules:c=[],onChange:f=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(o),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(i)},required:e.getFormItemRequired(c)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:c,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Qr,{option:this.props.option,onValuesChange:(t=[],l)=>{f(t),e.setViewValue(a,l)}}))),s&&q.default.createElement(d.Col,{flex:$e(s.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},s)))))}}var Jr;Zr.contextType=Zn,function(e){e[e.large=40]="large",e[e.middle=32]="middle",e[e.small=24]="small"}(Jr||(Jr={}));const ei=e.createContext(void 0),ti={dataIndex:se.default.string.isRequired,title:se.default.string.isRequired,description:se.default.string,colSpan:se.default.number,width:se.default.number,minWidth:se.default.number,fixed:se.default.oneOf(["left","right"]),align:se.default.oneOf(["left","center","right"]),theadAlign:se.default.oneOf(["left","center","right"]),theadWrap:se.default.bool,printFixed:se.default.bool,hidden:se.default.bool,noAuth:se.default.bool,noFixed:se.default.bool,ellipsis:se.default.bool,className:se.default.string,theadClassName:se.default.string,children:se.default.array,sorter:se.default.oneOfType([se.default.bool,se.default.func]),filter:se.default.shape({type:se.default.oneOf(["text","textarea","checkbox","radio","number","date","tree"]).isRequired,items:se.default.arrayOf(se.default.shape({text:se.default.string,value:se.default.oneOfType([se.default.string,se.default.number])})),style:se.default.object,openFilterList:se.default.bool}),precision:se.default.number,displayPrecision:se.default.number,formatType:se.default.oneOf(["date","datetime","dateShortTime","finance","percent","secret-name","secret-phone","secret-IDnumber","secret-bankNumber"]),required:se.default.bool,canCopy:se.default.bool,translate:se.default.bool,editRender:se.default.func,dictItems:se.default.arrayOf(se.default.shape({text:se.default.string,value:se.default.oneOfType([se.default.string,se.default.number])})),summation:se.default.shape({sumBySelection:se.default.bool,displayWhenNotSelect:se.default.bool,dataKey:se.default.string,unit:se.default.string,render:se.default.func}),groupSummary:se.default.shape({dataKey:se.default.string,unit:se.default.string,render:se.default.func}),shouldCellUpdate:se.default.func,headRender:se.default.func,render:se.default.func,outputRender:se.default.func};se.default.arrayOf(se.default.shape(ti)).isRequired,se.default.func,se.default.array,se.default.oneOfType([se.default.string,se.default.func]).isRequired,se.default.number,se.default.bool,se.default.bool,se.default.shape({api:se.default.func.isRequired,params:se.default.object.isRequired,formatter:se.default.func,beforeFetch:se.default.func,afterFetch:se.default.func,stopToFirst:se.default.bool,dataKey:se.default.string,callback:se.default.func}),se.default.bool,se.default.bool,se.default.string,se.default.string,se.default.object,se.default.bool,se.default.bool,se.default.bool,se.default.oneOfType([se.default.object,se.default.func]),se.default.oneOfType([se.default.object,se.default.func]),se.default.array,se.default.func,se.default.bool,se.default.func,se.default.object,se.default.object,se.default.shape({type:se.default.oneOf(["checkbox","radio"]).isRequired,defaultSelectedRowKeys:se.default.array,selectedRowKeys:se.default.array,hideSelectAll:se.default.bool,checkStrictly:se.default.bool,filterable:se.default.bool,selectByClickRow:se.default.bool,selectFirstRowOnChange:se.default.bool,clearableAfterFetched:se.default.bool,selectAllOnCurrentPage:se.default.bool,fetchSelectedRows:se.default.shape({api:se.default.func.isRequired,params:se.default.object,dataKey:se.default.string}),fetchAllRowKeys:se.default.shape({api:se.default.func.isRequired,params:se.default.object,dataKey:se.default.string}),disabled:se.default.func,onChange:se.default.func,onSelect:se.default.func,onSelectAll:se.default.func}),se.default.shape({currentRowKey:se.default.oneOfType([se.default.number,se.default.string]),disabled:se.default.func,onChange:se.default.func}),se.default.shape({virtual:se.default.bool,overscan:se.default.number,doubleXScrollbar:se.default.bool,expandIconColumn:se.default.string}),se.default.shape({defaultExpandAllRows:se.default.bool,defaultExpandedRowKeys:se.default.array,expandedRowKeys:se.default.array,hideExpandAll:se.default.bool,rowExpandable:se.default.func,expandedRowClassName:se.default.string,expandedRowRender:se.default.func,onExpand:se.default.func,onChange:se.default.func}),se.default.shape({cellMerge:se.default.bool,onCellMerge:se.default.func,onSelectChange:se.default.func}),se.default.shape({groupItems:se.default.arrayOf(se.default.shape({dataIndex:se.default.string.isRequired,titleIndex:se.default.string,color:se.default.string,backgroundColor:se.default.string})),fetch:se.default.shape({api:se.default.func.isRequired,params:se.default.object,dataKey:se.default.string}),onChange:se.default.func}),se.default.func,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.shape({current:se.default.number,pageSize:se.default.number,pageSizeOptions:se.default.array,showSizeChanger:se.default.bool,showQuickJumper:se.default.bool}),se.default.shape({fileName:se.default.string,fetch:se.default.shape({api:se.default.func.isRequired,params:se.default.object}),beforeExport:se.default.func,cellStyle:se.default.bool,hideIcon:se.default.bool}),se.default.shape({showLogo:se.default.bool}),se.default.shape({fetch:se.default.shape({api:se.default.func.isRequired,params:se.default.object,dataKey:se.default.string}),fieldList:se.default.arrayOf(se.default.object)}),se.default.shape({position:se.default.oneOf(["top","bottom"]),hideAlert:se.default.bool,hideClearButton:se.default.bool}),se.default.oneOf(["left","right"]),se.default.func,se.default.func,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.func,se.default.func,se.default.func,se.default.func,se.default.func,se.default.func,se.default.func,se.default.func,se.default.func;const li={columns:[],dataSource:[],rowKey:"id",border:!0,resizable:!0,showHeader:!0,ellipsis:!0,multipleSort:!0,topSpaceAlign:"right",showFullScreen:!0,showRefresh:!0,showClipboard:!0,showSelectCollection:!0,showSuperSearch:!0,showFastSearch:!0,showGroupSummary:!0,showColumnDefine:!0,showTableInfo:!0},ni=10,ai="1",ri="0",ii="YYYY-MM-DD",oi="YYYY-MM-DD HH:mm:ss",si="YYYYMMDDHHmmss",di={bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}}};var ui;!function(e){e.left="flex-start",e.right="flex-end"}(ui||(ui={}));const ci=Object.assign({},$).useId;let fi=0;var pi=ci?function(e){const t=ci();return e||t}:function(e){const[t]=$.useState(`qm_unique_${fi}`);return $.useEffect((()=>{fi+=1}),[]),e||t};let mi=[];const hi={_getInstance:function(e){var t;return null!==(t=mi.find((t=>t.id===e)))&&void 0!==t?t:null},getFocusInstance:function(){var e;return null!==(e=mi[0])&&void 0!==e?e:null},focus:function(e){const t=this._getInstance(e);t&&0!==mi.findIndex((e=>e===t))&&(this.deregister(e),mi=[t,...mi])},register:function(e,t){e&&t&&(null!==this._getInstance(e)&&this.deregister(e),mi=[{id:e,vm:t},...mi])},deregister:function(e){e&&(mi=mi.filter((t=>t.id!==e)))}};class gi{constructor(e){this.state={required:[],validate:[],edited:[],inserted:[],updated:[],removed:[]},this.addToRequired=e=>{-1===this.state.required.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.required.push(e)},this.removeFromRequired=e=>{const t=this.state.required.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.required.splice(t,1)},this.addToValidate=e=>{-1===this.state.validate.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.validate.push(e)},this.removeFromValidate=e=>{const t=this.state.validate.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.validate.splice(t,1)},this.addToEdited=e=>{-1===this.state.edited.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.edited.push(e)},this.removeFromEdited=e=>{const t=this.state.edited.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.edited.splice(t,1)},this.addToInserted=e=>{-1===this.state.inserted.findIndex((t=>t===e))&&this.state.inserted.push(e)},this.removeFromInserted=e=>{const t=this.state.inserted.findIndex((t=>t===e));t<0||this.state.inserted.splice(t,1)},this.addToUpdated=e=>{const t=this.state.updated.findIndex((t=>t===e||this.getRowKey(t,t.index)===this.getRowKey(e,e.index)));-1===t?this.state.updated.push(e):this.state.updated.splice(t,1,e)},this.removeFromUpdated=e=>{const t=this.state.updated.findIndex((t=>t===e));t<0||this.state.updated.splice(t,1)},this.addToRemoved=e=>{-1===this.state.removed.findIndex((t=>t===e))&&this.state.removed.push(e)},this.removeFromRemoved=e=>{const t=this.state.removed.findIndex((t=>t===e));t<0||this.state.removed.splice(t,1)},this.clearAllLog=()=>{this.state.required=[],this.state.validate=[],this.state.edited=[],this.state.inserted=[],this.state.updated=[],this.state.removed=[]},this.getRowKey=e.getRowKey}destroy(){for(const e in this)Object.prototype.hasOwnProperty.call(this,e)&&(this[e]=null)}}function vi(e){return void 0!==e}function yi(e,t){const{defaultValue:l,value:n,onChange:a,postState:r}=t||{},[i,o]=$.useState((()=>vi(n)?n:vi(l)?"function"==typeof l?l():l:"function"==typeof e?e():e)),s=vi(n)?n:i,d=r?r(s):s,u=st(a),[c,f]=$.useState([s]);Cn((()=>{const e=c[0];i!==e&&u(i,e)}),[c]),Cn((()=>{vi(n)||o(n)}),[n]);return[d,st((e=>{o(e),f([s])}))]}const bi={defaultColumnWidth:80,selectionColumnWidth:50,rowHeightMaps:{large:42,middle:34,small:26},sortDirections:["ascend","descend"],pagination:{current:1,pageSize:20,pageSizeOptions:[10,20,30,40,50],showSizeChanger:!0,showQuickJumper:!0},groupSummary:{total:{text:"记录数",value:"*"},recordTotalIndex:"nRecordsCount",summaryFieldName:"tsummary",groupbyFieldName:"tgroupby"},highSearch:{showSQL:!1},treeTable:{textIndent:17},dataKey:"records",summationKey:"summation",totalKey:"total",virtualScrollX:50,virtualScrollY:100,sorterFieldName:"tsortby",filterFieldName:"twhere",currentPageName:"currentPage",pageSizeName:"pageSize",showFilterType:!0,printWidth:1040,operationColumn:"__action__",selectionColumn:"__selection__",expandableColumn:"__expandable__",summaryIgnore:"sumIgnored",popupClassName:"table-editable__popper"},xi=e=>e.map((e=>{const t=Object.assign({},e);return t.children&&(t.children.forEach((e=>{t.fixed?e.fixed=t.fixed:delete e.fixed})),t.children=xi(t.children)),t})),Ei=(e,t)=>{const{fetch:l,columns:n,border:a,rowHeight:r,rowSelection:i,summation:o,expandable:s,treeConfig:d,tableConfig:u,webPagination:c,scrollPagination:f,showSuperSearch:p,showFastSearch:m,showGroupSummary:h,showTableImport:g,showClipboard:v,showSelectCollection:y,showPivotGrid:b,footRender:x}=e,{tableRef:E,getRowKey:C,$size:w,tableFullData:S,tableFlatData:N,updateMark:T,selectionKeys:I,sorter:O,filters:R,superFilters:k,pagination:L,mergedTdCells:P}=t,{selectionRows:A,summaries:F}=E.current,{expandIconColumn:_=""}=Object.assign({},d,u),{t:D}=ot(),M=e=>{const t=(e=>{const t=[],l=[],n=[];for(let a=0;a<e.length;a++){const r=e[a];"left"===r.fixed?t.push(r):"right"===r.fixed?l.push(r):n.push(r)}return[...t,...n,...l]})(xi(e)),l=(e=>{if(!e)return null;const{type:t}=e;return{dataIndex:bi.selectionColumn,title:"radio"===t?D("qm.table.config.selectionText"):"",width:bi.selectionColumnWidth,fixed:"left",type:t}})(i),n=(null==(a=s)?void 0:a.expandedRowRender)?{dataIndex:bi.expandableColumn,title:"",width:bi.selectionColumnWidth,fixed:"left",type:"expand"}:null;var a;return l&&t.unshift(l),n&&t.unshift(n),ma(t)},H=(e,t,l,n,a)=>{const r=`${t},${l}`;e.has(r)||e.set(r,{row:t,col:l,rowSpan:n,colSpan:a})},$=q.default.useMemo((()=>!!(null==l?void 0:l.api)),[null==l?void 0:l.api]),j=q.default.useMemo((()=>!$&&!!c),[$,c]),K=q.default.useMemo((()=>$&&!!f),[$,f]),V=q.default.useMemo((()=>($||j)&&!K),[$,j,K]),z=q.default.useMemo((()=>M(n)),[n]),W=q.default.useMemo((()=>pa(z)),[z]),B=q.default.useMemo((()=>W.filter((e=>"function"==typeof e.editRender))),[W]),U=q.default.useMemo((()=>W.filter((e=>!!e.summation))),[W]),G=q.default.useMemo((()=>W.filter((e=>"left"===e.fixed))),[W]),Y=q.default.useMemo((()=>W.filter((e=>"right"===e.fixed))),[W]),X=q.default.useMemo((()=>r||bi.rowHeightMaps[w]),[r,w]),Q=q.default.useMemo((()=>(e=>{const t=new Map;return e.forEach((e=>{const l=N.findIndex((t=>C(t,t.index)===e.rowKey)),n=W.findIndex((t=>t.dataIndex===e.dataIndex));if(!(l<0||n<0)){H(t,l,n,e.rowSpan,e.colSpan);for(let a=0;a<e.rowSpan;a++)for(let r=0;r<e.colSpan;r++)0===a&&0===r||H(t,l+a,n+r,0,0)}})),Array.from(t.values()).sort(((e,t)=>e.row-t.row||e.col-t.col))})(P)),[P,W,S]),Z=q.default.useMemo((()=>{var e,t;const l=W.filter((e=>![bi.expandableColumn,bi.selectionColumn,bi.operationColumn].includes(e.dataIndex)));return _&&l.some((e=>e.dataIndex===_))?_:null!==(t=null===(e=l[0])||void 0===e?void 0:e.dataIndex)&&void 0!==t?t:""}),[W,_]),J=q.default.useMemo((()=>U.length>0),[U]),ee=q.default.useMemo((()=>!!x||J),[x,J]),te=q.default.useMemo((()=>Na(z).length>1),[z]),le=q.default.useMemo((()=>a||te),[a,te]),ne=q.default.useMemo((()=>W.some((e=>e.sorter))),[W]),ae=q.default.useMemo((()=>W.some((e=>e.filter))),[W]),re=q.default.useMemo((()=>U.some((e=>!!e.summation.dataKey))),[U]),ie=q.default.useMemo((()=>!$&&!!g),[$,g]),oe=q.default.useMemo((()=>!!v&&B.length>0),[v,B]),se=q.default.useMemo((()=>!!y&&"checkbox"===(null==i?void 0:i.type)),[y,i]),de=q.default.useMemo((()=>!!p&&ae),[p,ae]),ue=q.default.useMemo((()=>!$&&!!m),[$,m]),fe=q.default.useMemo((()=>!$&&!!b),[$,b]),pe=q.default.useMemo((()=>!!h&&W.some((e=>!!e.groupSummary))),[W]),me=q.default.useMemo((()=>{var e;return!!(null===(e=null==o?void 0:o.groupItems)||void 0===e?void 0:e.length)}),[o]),he=q.default.useMemo((()=>!N.length),[N]),ge=q.default.useMemo((()=>(()=>{const e={};return U.forEach((t=>{const{dataIndex:l,precision:n,displayPrecision:a,summation:r}=t,{sumBySelection:i,displayWhenNotSelect:o,unit:s}=r,d=!A.length&&!!o;let u=(!i||d?E.current.tableFullData:A).reduce(((e,t)=>{if(null==t?void 0:t[bi.summaryIgnore])return e;const n=Pa(t,l);return _a(n)?e.plus(n):e}),new ce.default(0));!Object.keys(F).includes(l)||i&&!d||(u=new ce.default(Pa(F,l))),Aa(e,l,u.toNumber());let c=n>=0?u.toFixed(n):u.toString();a>=0&&""!==c&&(c=Ma(c,a)),c=Da(c),Aa(e,`${l}_text`,s?`${c} ${s}`:c)})),[e]})()),[N,T,I,F]),ve=q.default.useMemo((()=>(e=>e.filter((e=>e.summation.dataKey)).map((e=>`sum|${e.dataIndex}`)).join(","))(U)),[U]),ye=q.default.useMemo((()=>{var e;const t=(e=>{const t=[];return Object.keys(e).forEach((l=>{null!==e[l]&&t.push(`${l}|${e[l]}`)})),t.join(",")})(O),n=((e,t)=>{const l=[];if(Object.keys(e).length)for(const t in e){const[n,a]=t.split("|"),r=e[t];Object.keys(r).forEach((e=>{l.push({type:["radio","tree"].includes(a)?"checkbox":a,bracketLeft:"",fieldName:n,expression:e,value:Za(e)?null:r[e],bracketRight:"",logic:"and"})}))}return t.length&&t.forEach((e=>{const t=e.fieldType;l.push({type:["radio","tree"].includes(t)?"checkbox":t,bracketLeft:e.bracketLeft,fieldName:e.fieldName,expression:e.expression,value:Za(e.expression)?null:e.condition,bracketRight:e.bracketRight,logic:e.logic})})),l.length&&(l[l.length-1].logic=""),l})(R,k),a=t?{[bi.sorterFieldName]:t}:null,r=n.length?{[bi.filterFieldName]:n}:null,i=ve?{[bi.groupSummary.summaryFieldName]:ve,usedJH:1}:null,o=null!==(e=null==l?void 0:l.params)&&void 0!==e?e:null,s={[bi.currentPageName]:L.current,[bi.pageSizeName]:L.pageSize};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),r),i),o),s)}),[null==l?void 0:l.params,L.current,L.pageSize,O,R,k,ve]);return{isFetch:$,isWebPagination:j,isScrollPagination:K,showPagination:V,tableColumns:z,flattenColumns:W,editableColumns:B,summationColumns:U,leftFixedColumns:G,rightFixedColumns:Y,tableRowHeight:X,derivedMergeCells:Q,treeExpandIndex:Z,showSummary:J,showFooter:ee,isHeadGroup:te,bordered:le,isHeadSorter:ne,isHeadFilter:ae,isServiceSummation:re,isSelectCollection:se,isTableImport:ie,isTableClipboard:oe,isSuperSearch:de,isFastSearch:ue,isPivotGrid:fe,isGroupSummary:pe,isGroupSubtotal:me,isTableEmpty:he,summationRows:ge,fetchParams:ye}},Ci=(e,t)=>{const{rowKey:n,height:a,dataSource:r,summation:i,fetch:o,rowSelection:s,expandable:d,tableConfig:u,authConfig:c,ignorePageIndex:f,keepScrollOnDataChange:p,columnsChange:m,onChange:h,onDataChange:g,onDataLoad:v,onScrollEnd:y,onFetchError:b}=e,{getRowKey:x,tableRef:E,tableElementRef:C,$size:w,tableColumns:S,flattenColumns:N,tableFullData:T,pagination:I,layout:O,filters:R,sorter:k,superFilters:L,pagerFilter:P,fetchParams:A,selectionKeys:F,rowExpandedKeys:_,highlightKey:D,summationColumns:M,isFetch:H,isWebPagination:$,isScrollPagination:j,isServiceSummation:K,isGroupSubtotal:V,doLayout:z,setTableFullData:W,setTableOriginData:B,setTableFlatData:U,setTableDataMaps:G,setPagination:Y,setPingRight:X,setPingLeft:Q,setSpinning:Z,setSorter:J,setFilters:ee,setSuperFilters:te,setPagerFilter:le,setActivedCell:ne,setSelectionKeys:ae,setRowExpandedKeys:re,setHighlightKey:ie,setSelectionRows:oe,setScrollXLoad:se,setScrollYLoad:de,setFieldAuth:ue,setResizeState:ce,setSummaries:fe,setPermission:pe,resetTableScroll:me,createTableFocus:he,clearElementStore:ge}=t,{t:ve}=ot(),{store:ye}=E.current,be=q.default.useRef(A),xe=q.default.useRef(!1),Ee=e=>xe.current=e,Ce=xn(C);Cn((()=>{Le(),z()}),[S]),Cn((()=>{we()}),[Ce.width,Ce.height,w,a,O.tableAutoHeight]),Cn((()=>{H||Se(T.length),z()}),[T]),Cn((()=>{at(),rt(),it(),H||(!De(R)&&ee({payload:Object.assign({},R),forceUpdate:!0}),!De(k)&&J({payload:Object.assign({},k),forceUpdate:!0}),Ze(r),$&&Oe(),!p&&me())}),[r,null==o?void 0:o.params]),Cn((()=>{const e=Re(A,be.current);var t;e||H&&(null==s?void 0:s.clearableAfterFetched)&&dt(),!e&&A[bi.currentPageName]>1&&!(null==o?void 0:o.stopToFirst)?Oe():H&&Ue(),t=A,be.current=t}),[A]),Cn((()=>{E.current.isTreeTable&<()}),[_]),Yl((()=>{$&&(lt(),Ye()),j||me(),Ke()}),[I.current,I.pageSize]);const we=()=>{const{scrollBarRef:e,resizeState:t}=E.current,{width:l,height:n}=Ce;z(),O.tableBodyWidth>l&&X(!0),e.current.scrollLeft>0&&Q(!0),ce(Object.assign({},t,{width:l,height:n}))},Se=e=>{e!==I.total&&Y((t=>Object.assign({},t,{total:e})))},Ne=({current:e,pageSize:t})=>{Y((l=>Object.assign({},l,{current:e,pageSize:t})))},Te=()=>{const{pageSize:e,total:t}=I;return Math.ceil(t/e)||1},Oe=()=>{Ne(Object.assign({},I,{current:1}))},Re=(e,t)=>{const l=Object.keys(La(e,t));return 1===l.length&&(l.includes(bi.currentPageName)||l.includes(bi.pageSizeName))},ke=wn((e=>{Xe(),null==y||y(e)})),Le=()=>{se(N.length>bi.virtualScrollX)},Ae=(e=[])=>{var t;let l=e.length>bi.virtualScrollY;E.current.isTreeTable&&(l=!0),de(null!==(t=null==u?void 0:u.virtual)&&void 0!==t?t:l)},Fe=e=>V?_e(Me(e)):e,_e=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(..._e(e.children)),delete e.children,t.push(e)})),t},Me=(e,t=0)=>{var l;const a=null===(l=i.groupItems)||void 0===l?void 0:l[t];if(!a)return e.forEach(((t,l)=>{t._rowSpan=0===l?e.length:0,t._colSpan=1})),e;return za(e,[a.dataIndex]).map((e=>{const l={children:Me(e,t+1),_group:a.dataIndex};return"function"!=typeof n&&Aa(l,n.toString(),$a()),a.titleIndex&&Aa(l,a.titleIndex,Pa(e[0],a.titleIndex)),Aa(l,a.dataIndex,Pa(e[0],a.dataIndex)),M.forEach((e=>{var t;const{dataIndex:n}=e,a=null===(t=l.children)||void 0===t?void 0:t.reduce(((e,t)=>{if(t[bi.summaryIgnore])return e;const l=Number(Pa(t,n));return Number.isNaN(l)?e:e+l}),0);Aa(l,n,a)})),l}))},qe=e=>{ae(e),oe((e=>{const{selectionRows:t,recordsMap:l}=E.current,n=new Map;t.forEach((e=>n.set(x(e,e.index),e)));const a=[];for(let t=0,r=e.length;t<r;t++){const r=n.get(e[t])||l.get(e[t]);r&&a.push(r)}return a})(e))},$e=e=>{const{type:t,checkStrictly:l=!0}=s||{},n=Array.isArray(e)?e:F;let a=[];return E.current.isTreeTable&&!l&&n.forEach((e=>{a.push(...((e,t)=>{var l;const{disabled:n}=s||{},{tableFullData:a,recordsMap:r}=E.current,i=Ba(a,(t=>t._rowKey===e));let o=[];if(!i)return o;let d=Sa((null==i?void 0:i.children)||[],(e=>e._rowKey));return n&&(d=d.filter((e=>!r.has(e)||!n(r.get(e))))),o=[...new Set([...t,...d])],((null===(l=Ua(a,e))||void 0===l?void 0:l.slice(0,-1).reverse())||[]).forEach((e=>{var t;const l=Ba(a,(t=>t._rowKey===e)),n=null===(t=null==l?void 0:l.children)||void 0===t?void 0:t.every((e=>o.includes(e._rowKey)));o=n?[...o,e]:o.filter((t=>t!==e))})),o})(e,n))})),a="radio"===t?n.slice(0,1):[...new Set([...n,...a])],a},je=()=>{const{isTreeTable:e,tableFullData:t,recordsMap:l}=E.current;return e?wa(t,(e=>e._rowKey)):Array.from(l.keys())},Ke=wn((()=>{null==h||h(I,ze(R),Ve(k),L,{currentDataSource:tt()})})),Ve=e=>{const t={};for(const l in e)null!==e[l]&&(t[l]=e[l]);return t},ze=e=>{const t={};for(const l in e){if(!l.includes("|"))continue;const[n,a]=l.split("|");t[`${n}|${a}`]=e[l]}return t},We=()=>Ie(void 0,void 0,void 0,(function*(){var t;if(!c)return;let n=He(c,["fetch"]);if(c.fetch){const{api:e,params:a,dataKey:r}=c.fetch;try{const i=yield e(a);200===i.code&&(n=null!==(t=r?l.get(i.data,r):i.data)&&void 0!==t?t:{})}catch(e){}}if(Object.keys(n).length){const{isExport:e=1,isImport:t=1,isPrint:l=1}=n;pe((n=>Object.assign({},n,{export:!!e,import:!!t,print:!!l})))}if(Array.isArray(n.fieldList)){const t=va(e.columns,(e=>{const{dataIndex:t}=e,l=n.fieldList.find((e=>e.dataIndex===t));if(l){const{visible:n=1,disabled:a,secretName:r}=l,i=ya(E.current.originColumns,t);ue(t,{visible:n,disabled:a,secretName:r}),n||(e.noAuth=!0,i.noAuth=!0),r&&(e.formatType=`secret-${r}`,i.formatType=`secret-${r}`)}}));null==m||m(t)}})),Be=st((()=>Ie(void 0,void 0,void 0,(function*(){var e,t,n;if(!o)return;const{formatter:a=(e=>e),beforeFetch:r=Pe,afterFetch:s,callback:d}=o;if(!r(A))return;const u=!!(null===(e=null==i?void 0:i.fetch)||void 0===e?void 0:e.api);Z(!0);try{const[e,r]=u?yield Promise.all([o.api(a(A)),i.fetch.api(a(A))]):[yield o.api(a(A))];if(E.current.unMounted)return;if(u?200===e.code&&200===r.code:200===e.code){const a=null!==(t=o.dataKey)&&void 0!==t?t:bi.dataKey;let i=null!==(n=l.get(e.data,a))&&void 0!==n?n:[];i="function"==typeof s?yield s(i):i;const u=l.get(e.data,a.replace(/[^.]+$/,bi.totalKey))||i.length||0,c=Math.max(Math.ceil(u/I.pageSize),1);if(A[bi.currentPageName]>c)return Ne(Object.assign(Object.assign({},I),{current:c}));Ze(xe.current?E.current.tableFullData.concat(i):i),Se(u),Ge((null==r?void 0:r.data)||e.data),null==d||d(e.data,e)}}catch(e){null==b||b(e)}var c,f;c=o,f="stopToFirst",Object.prototype.hasOwnProperty.call(c,f)&&(o.stopToFirst=!1),Z(!1),Ee(!1)})))),Ue=wn(Be),Ge=e=>{var t,n,a;if(!K)return;const r=null!==(n=null===(t=null==i?void 0:i.fetch)||void 0===t?void 0:t.dataKey)&&void 0!==n?n:bi.summationKey,o=null!==(a=r?l.get(e,r):e)&&void 0!==a?a:{},s={};M.filter((e=>!!e.summation.dataKey)).forEach((e=>{Aa(s,e.dataIndex,Number(Pa(o,e.summation.dataKey)))})),fe(s)},Ye=()=>{const{type:e,selectFirstRowOnChange:t}=s||{};if("radio"===e&&t){const e=tt();if(e.length){const t=x(e[0],e[0].index);qe([t])}else qe([])}},Xe=()=>{if(!j)return;const e=Te();xe.current||I.current>=e||(Ee(!0),Ne(Object.assign(Object.assign({},I),{current:I.current+1})))},Qe=e=>e.map(((e,t)=>(Array.isArray(e.children)&&(e.children=Qe(e.children)),e.index=t,f||(e.pageIndex=(e=>{const{current:t,pageSize:l}=I;return!H||j?e:(t-1)*l+e})(t)),e))),Ze=e=>{const t=Je(e,(e=>er(e,P,E.current.isOriginTree)));qe($e()),re((e=>{const{isTreeTable:t,tableFullData:l,recordsMap:n}=E.current,{defaultExpandAllRows:a,rowExpandable:r,expandedRowRender:i}=d||{};let o=Array.isArray(e)?e:[..._];if(a)o=je();else if(t){i&&ft("Table","树结构表格不能再设置展开行的 `expandedRowRender` 参数");const e=[...F];D&&e.unshift(D),e.forEach((e=>{const t=Ua(l,e)||[];o.push(...t.length>1?t.slice(0,-1).reverse():t)})),o=[...new Set(o)]}return r&&o.filter((e=>{const t=n.get(e);return!!t&&r(t)})),o})()),Ye(),null==v||v(t)},Je=(e,t)=>{const l=Qe(e);return B(l),nt((null==t?void 0:t(l))||l),l},et=()=>{const{current:e,pageSize:t}=I;return E.current.tableFullData.slice((e-1)*t,e*t)},tt=()=>$?et():E.current.tableFullData,lt=()=>{const{recordsMap:e,isTreeTable:t}=E.current;let l=$?Ca(et()):Array.from(e.values());l=t?(e=>{const t=new Map,l=[];return e.forEach((e=>{const n=x(e,e.index);if(!e._parentRowKey)return l.push(e),t.set(n,!0);_.includes(e._parentRowKey)&&t.get(e._parentRowKey)&&(l.push(e),t.set(n,!0))})),t.clear(),l})(l):Fe(l),Ae(l),U(l)},nt=e=>{W(e),G(e),lt()},at=()=>{te([])},rt=()=>{le({})},it=()=>{ne({})},dt=()=>{qe([])};return{initialTable:()=>{We(),he(),Le(),Ae(),H?Be():Ze(r)},checkDataIndex:()=>{const e=N.map((e=>e.dataIndex));[...new Set(e)].length!==e.length&&ft("Table","配置项 dataIndex 属性是唯一的,不能重复")},createTableFullData:nt,createWebPageData:et,getTableData:Be,createTableData:Je,createGroupData:Fe,createAllExpandedKeys:je,setSelectionKeysEffect:qe,doFieldValidate:(e,t,l,n,a)=>{if(!Array.isArray(e))return ft("Table","可编辑单元格的校验规则 `rules` 配置不正确");e.length&&(ye.removeFromRequired({x:l,y:n}),ye.removeFromValidate({x:l,y:n}),e.forEach((e=>{var r;e.required&&De(t)&&ye.addToRequired({x:l,y:n,text:e.message||a+ve("qm.form.requiredTips")}),"function"!=typeof e.validator||(null===(r=e.validator)||void 0===r?void 0:r.call(e,t))||ye.addToValidate({x:l,y:n,text:e.message})})))},getTableLog:()=>{const{required:e,validate:t,inserted:n,updated:a,removed:r}=ye.state,i=l.intersection(n,r),o=e=>e.map((e=>({rowKey:e.x,dataIndex:e.y,text:e.text})));return{required:o(e),validate:o(t),inserted:n.filter((e=>!i.includes(e))),updated:a.filter((e=>![...l.intersection(a,n),...l.intersection(a,r)].includes(e))),removed:r.filter((e=>!i.includes(e)))}},dataChange:()=>{null==g||g(E.current.tableFullData)},tableChange:Ke,toLastPage:()=>{const e=Te();I.current!==e&&Ne(Object.assign({},I,{current:e}))},toFirstPage:Oe,getPageCount:Te,pagerChangeHandle:Ne,scrollBottomDebouncer:ke,clearTableSorter:()=>{J({payload:{}})},clearTableFilter:()=>{ee({payload:{}})},clearSuperFilters:at,clearPagerFilter:rt,clearActivedCell:it,clearRowSelection:dt,clearRowHighlight:()=>{ie("")},clearTableLog:()=>{ye.clearAllLog()},destroy:()=>{const{tableManager:e,uid:t}=E.current;ge(),ye.destroy(),e.deregister(t)}}},wi=(e,t)=>{const{height:n,minHeight:a,maxHeight:r,ellipsis:i,showHeader:o,spanMethod:s,rowSelection:d}=e,{getRowKey:u,tableRef:c,topElementRef:f,tableElementRef:p,tableBodyRef:m,$size:h,tableColumns:g,flattenColumns:v,leftFixedColumns:y,derivedMergeCells:b,tableFlatData:x,selectionKeys:E,highlightKey:C,layout:w,tableRowHeight:S,showFooter:N,showPagination:T,isFullScreen:I,setLayout:O,setElementStore:R}=t,k=q.default.useMemo((()=>{const{tableFullHeight:e,tableAutoHeight:t}=w,l={};return a&&Object.assign(l,{minHeight:`${ka(a)}px`}),r&&Object.assign(l,{maxHeight:`${ka(r)}px`}),I?Object.assign(Object.assign({},l),{maxHeight:"",minHeight:"",height:`${e}px`}):n?Object.assign(Object.assign({},l),{height:"auto"!==n?`${ka(n)}px`:`${t}px`}):l}),[n,r,a,I,w]),L=e=>c.current.elementStore.$tableBody.querySelector(`tbody > tr[data-row-key="${e}"]`);return{createElementStore:()=>{R("$toper",f.current),R("$table",p.current)},tableStyles:k,getSpan:(e,t,n,a,r)=>{let i=1,o=1;if("function"==typeof s){const d=s({row:e,column:t,rowIndex:n,columnIndex:a,tableData:r});Array.isArray(d)?(i=d[0],o=d[1]):l.isPlainObject(d)&&(i=d.rowSpan,o=d.colSpan)}if(b.length>0){const e=b.find((e=>e.row===n&&e.col===a));e&&(i=e.rowSpan,o=e.colSpan)}return{rowSpan:i,colSpan:o}},getStickyLeft:e=>{if(v.findIndex((t=>t.dataIndex===e))<0){const t=ya(g,e);e=t?ba(t).dataIndex:""}let t=0;for(let l=0;l<v.length;l++){const n=v[l];if(n.dataIndex===e)break;t+=n.width||n.renderWidth||0}return t},getStickyRight:(e,t)=>{if(v.findIndex((t=>t.dataIndex===e))<0){const t=ya(g,e);e=t?xa(t).dataIndex:""}const l="thead"===t?(e=>{if(!e.some((e=>e.colSpan>0)))return e;const t=[];let l=[];return e.forEach((e=>{e.colSpan>0&&l.length>0&&(t.push(l),l=[]),l.push(e)})),l.length>0&&t.push(l),t.map((e=>{const[t,l]=e.reduce(((e,t)=>(t.colSpan>0?e[0].push(t):e[1].push(t),e)),[[],[]]);return[...l,...t.reverse()]})).flat()})(v):v;let n=0;for(let t=l.length-1;t>=0;t--){const a=l[t];if(a.dataIndex===e)break;n+=a.width||a.renderWidth||0}return n},scrollXToColumn:(e,t)=>{const l=void 0===t?v.findIndex((t=>t.dataIndex===e)):t;if(l<0)return;const{scrollBarRef:n}=c.current,a=y.reduce(((e,t)=>e+(t.width||t.renderWidth)),0),r=v.slice(0,l).reduce(((e,t)=>e+(t.width||t.renderWidth)),0);n.current.SET_SCROLL_LEFT(r-a)},scrollYToRecord:(e,t)=>{const{scrollBarRef:l,scrollYLoad:n}=c.current;if(void 0!==t&&t>=0)if(t<x.length)if(n)m.current.scrollToYIndex(t);else{const e=L(u(x[t],x[t].index));e&&l.current.SET_SCROLL_TOP(e.offsetTop)}else l.current.SET_SCROLL_TOP(t*S);else if(n){const t=x.findIndex((t=>e===u(t,t.index)));t>=0&&m.current.scrollToYIndex(t)}else{const t=L(e);t&&l.current.SET_SCROLL_TOP(t.offsetTop)}},calcTableHeight:()=>{if("auto"!==n)return;const{elementStore:e,resizeState:t}=c.current;try{const l=t.winHeight-e.$table.getBoundingClientRect().top-(T?Jr["small"!==h?"middle":h]+ni:0)-ni;O((e=>Object.assign({},e,{tableAutoHeight:l})))}catch(e){}},resetTableScroll:()=>{var e;const{scrollBarRef:t}=c.current;null===(e=t.current)||void 0===e||e.SET_SCROLL_TOP(0)},createTableFocus:()=>{C&&m.current.setClickedValues([C,""]),"radio"===(null==d?void 0:d.type)&&E.length&&m.current.setClickedValues([E[0],""])},doLayout:()=>{(()=>{const{elementStore:e,scrollXLoad:t}=c.current,l=e.$table.clientWidth,{defaultColumnWidth:n}=bi,a=[];let r=0;if(v.forEach((e=>{"number"==typeof e.width?(e.renderWidth=e.width,r+=e.width):(e.renderWidth=void 0,a.push(e))})),a.length>0){const e=v.reduce(((e,t)=>e+(t.width||t.minWidth||n)),0);if(e<=l){const t=l-e;if(1===a.length)a[0].renderWidth=(a[0].minWidth||n)+t;else{const e=t/a.reduce(((e,t)=>e+(t.minWidth||n)),0);let l=0;a.forEach(((t,a)=>{if(0===a)return;const r=Math.floor((t.minWidth||n)*e);l+=r,t.renderWidth=(t.minWidth||n)+r})),a[0].renderWidth=(a[0].minWidth||n)+t-l}}else a.forEach((e=>{e.renderWidth=e.minWidth||n}));O((t=>Object.assign(Object.assign({},t),{tableBodyWidth:Math.max(e,l)})))}else r=v.reduce(((e,t)=>e+(t.renderWidth=t.width||t.minWidth||n)),0),O((e=>Object.assign(Object.assign({},e),{tableBodyWidth:r})));O((e=>Object.assign(Object.assign({},e),{tableWidth:l}))),t&&m.current.resetItemXSize(v)})(),Fe((()=>(()=>{const{elementStore:e,scrollYLoad:t,resizeState:l}=c.current;if(!e.$table.offsetParent)return;const n=e.$table.offsetHeight,a=o?e.$header.offsetHeight:0,r=N?e.$footer.offsetHeight:0,i=n-a-r,s=e.$tableBody.offsetHeight;let d=0;if(I){const t=e.$toper?e.$toper.offsetHeight+ni:0,n=e.$pager?e.$pager.offsetHeight+ni:0;d=l.winHeight-t-n-20}O((e=>Object.assign({},e,{headerHeight:a,footerHeight:r,viewportHeight:i,tableBodyHeight:s,tableFullHeight:d})))})()))}}};function Si({handler:e,delay:t=0}){const l=Kn(e,t),n=st(t>0?l:e);$.useEffect((()=>(window.addEventListener("resize",n),()=>window.removeEventListener("resize",n))),[n])}const Ni=e=>{const{total:t}=e,{tableRef:l,prefixCls:n,selectionKeys:a,isHeadSorter:r,isHeadFilter:i,clearTableSorter:o,clearTableFilter:s,clearSuperFilters:d,clearPagerFilter:u,clearActivedCell:c,clearRowSelection:f,clearRowHighlight:p}=q.default.useContext(ei),{infoBarConfig:m,rowSelection:h,rowHighlight:v}=l.current.props,{isTreeTable:y,recordsMap:b,invalidRowKeys:x}=l.current,{hideAlert:E,hideClearButton:C}=m||{},{t:w}=ot(),[S,N]=q.default.useState(a.length-x.length);q.default.useEffect((()=>{Fe((()=>N(a.length-x.length)))}),[a,x]);const T=q.default.useMemo((()=>!E),[E]),I=q.default.useMemo((()=>!C&&!!(r||i||h||v)),[C,r,i,h,v]),O={[`${n}__alert`]:!0};return T?q.default.createElement("div",{className:J.default(O)},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.InfoCircleFilled,null)),q.default.createElement("span",null,w("qm.table.alert.total",{total:y?b.size:t}),h?`,${w("qm.table.alert.selected",{total:Math.max(S,0)})}`:""),I&&q.default.createElement("em",{onClick:()=>{s(),d(),u(),o(),c(),f(),p()}},w("qm.table.alert.clear"))):null},Ti=q.default.forwardRef(((e,t)=>{const{isFullScreen:l,open:n=!0}=e,{prefixCls:a,setFullScreen:r}=q.default.useContext(ei),{t:i}=ot(),o=()=>{r(!l)};return q.default.useImperativeHandle(t,(()=>({clickHandle:o}))),n?q.default.createElement("span",{className:`${a}-full-screen`,title:i(l?"qm.table.screen.cancelFull":"qm.table.screen.full"),onClick:()=>o()},q.default.createElement("i",{className:"svgicon icon"},l?q.default.createElement(g.FullscreenExitOutlined,null):q.default.createElement(g.FullscreenOutlined,null))):null}));Ti.displayName="FullScreen";const Ii=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{prefixCls:n,getTableData:a}=q.default.useContext(ei),{t:r}=ot(),i=()=>{a()};return q.default.useImperativeHandle(t,(()=>({clickHandle:i}))),l?q.default.createElement("span",{className:`${n}-reload`,title:r("qm.table.refresh.text"),onClick:()=>i()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.ReloadOutlined,null))):null}));Ii.displayName="Reload";const Oi=()=>{const e={dateFormat:e=>{const t=e?j.default(e).format(ii):"";return t.startsWith("1900-01-01")?"":t},datetimeFormat:e=>{const t=e?j.default(e).format(oi):"";return t.startsWith("1900-01-01")?"":t},dateShortTimeFormat:e=>{const t=e?j.default(e).format(oi.slice(0,-3)):"";return t.startsWith("1900-01-01")?"":t},percentFormat:e=>_a(e)?(100*Number(e)).toFixed(2)+"%":e,financeFormat:e=>Da(e.toString()),secretNameFormat:e=>e.replace(/^([\u4e00-\u9fa5]{1}).+$/,"$1**"),secretPhoneFormat:e=>e.replace(/^(\d{3}).+(\d{4})$/,"$1****$2"),secretIDnumberFormat:e=>e.replace(/^(\d{3}).+(\w{4})$/,"$1***********$2"),secretBankNumberFormat:e=>e.replace(/^(\d{4}).+(\w{3})$/,"$1************$2")},t=(t,l,n)=>{var a,r,i,o;const{dictItems:s,precision:d,displayPrecision:u,formatType:c,editRender:f}=l,p=s||(null===(a=null==f?void 0:f(n,l))||void 0===a?void 0:a.items)||[];let m=null!==(o=null!==(i=null===(r=p.find((e=>e.value==t)))||void 0===r?void 0:r.text)&&void 0!==i?i:t)&&void 0!==o?o:"";if(Array.isArray(t)&&(m=t.map((e=>{var t,l;return null!==(l=null===(t=p.find((t=>t.value==e)))||void 0===t?void 0:t.text)&&void 0!==l?l:e})).join(",")),d>=0&&""!==m&&(m=_a(m)?new ce.default(m).toFixed(d):m),u>=0&&""!==m&&(m=Ma(m,u)),c){const t=e[`${_e(c)}Format`];t?m=t(m):ft("Table","字段的格式化类型 `formatType` 配置不正确")}return m},l=e=>ja(e);return{renderText:t,getTitleFromCellNode:l,getTitleFromCellValue:(e,n,a,r)=>{const i=Pa(e,n.dataIndex),o=n.render?n.render(i,e,n,a,r):t(i,n,e);return l(o)}}},Ri=q.default.forwardRef(((e,t)=>{var n,a,r,i;const{tableColumns:o,open:s=!0}=e,{global:d}=q.default.useContext(xe),{tableRef:u,prefixCls:c,flattenColumns:f,summationRows:p,showSummary:m,createGroupData:h,getSpan:v}=q.default.useContext(ei),{tablePrint:y,showHeader:b}=u.current.props,{t:x}=ot(),{getTitleFromCellValue:E}=Oi(),C=null!==(a=null===(n=null==d?void 0:d.print)||void 0===n?void 0:n.leftLogo)&&void 0!==a?a:"",w=null!==(i=null===(r=null==d?void 0:d.print)||void 0===r?void 0:r.rightLogo)&&void 0!==i?i:"",S=!(!C&&!w),N=q.default.useMemo((()=>qe(Ea(o,[bi.expandableColumn,bi.selectionColumn,bi.operationColumn]))),[o]),T=q.default.useMemo((()=>qe(Ea(f,[bi.expandableColumn,bi.selectionColumn,bi.operationColumn]))),[f]),I=q.default.useMemo((()=>qe(o.filter((e=>e.printFixed)))),[o]),O=e=>{const t=Object.assign({},Wa(N,e.dataIndex).slice(0,-1).reverse()[0]);return t.children=[e],t.level&&t.level>1?O(t):t},R=(e,t)=>l.map(l.groupBy(l.flatten(e),t),l.spread(((...e)=>l.mergeWith(...e,((e,l)=>{if(Array.isArray(e))return R(e.concat(l),t)}))))),k=e=>{const t=[];return e.forEach((e=>{let l=[];e.forEach((e=>{1===e.level?l.push(e):l.push(O(e))})),l=(e=>[...new Set(e.map((e=>e.dataIndex)))].map((t=>{const l=e.filter((e=>e.dataIndex===t));return l.length<=1?l[0]:R(l,"dataIndex")[0]})))(l),t.push(Na(l))})),t},L=()=>{const e=(e=>{const t=[];let l=[],n=0,a=0;for(;a<e.length;){const r=e[a],i=f.find((e=>e.dataIndex===r.dataIndex));r.width=i.width||i.renderWidth||bi.defaultColumnWidth,n+=r.width||r.renderWidth,n<=bi.printWidth?(l.push(r),a===e.length-1&&t.push(l),a++):a>0?(e.splice(0,a),I.length&&e.unshift(...I),t.push(l),l=[],n=0,a=0):(r.width=bi.printWidth,l.push(r),t.push(l),a++)}return t})([...T]),t=k(e);let l=["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">','<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui">',"<style>\n * {\n margin: 0;\n padding: 0;\n }\n body * {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n }\n table {\n table-layout: fixed;\n border-spacing: 0;\n border-collapse: collapse;\n }\n table--print {\n font-size: 14px;\n text-align: left;\n }\n .table--print th,\n .table--print td {\n padding: 5px;\n border: 1px solid #000;\n }\n .no-border th,\n .no-border td {\n border: 0!important;\n }\n .table--print th[colspan]:not([colspan='1']) {\n text-align: center;\n }\n .page-break {\n page-break-after: always;\n }\n </style>","</head>","<body>"].join("");const{isTreeTable:n,tableFullData:a}=u.current;for(let r=0;r<e.length;r++)l+=P(t[r],e[r],n?a:h(a)),l+='<div class="page-break"></div>';return l+"</body></html>"},P=(e,t,l)=>{const{showLogo:n=!0}=y;let a='<table class="table--print" width="100%" border="0" cellspacing="0" cellpadding="0">';return a+=`<colgroup>${t.map((({width:e,renderWidth:t})=>`<col style="width:${e||t}px">`)).join("")}</colgroup>`,b&&(a+=["<thead>",n&&S?`<tr><th colspan="${t.length}" style="border: 0">${['<table class="no-border" width="100%" border="0" cellspacing="0" cellpadding="0">',"<tr>",'<td width="50%" align="left">',C?`<img src="${C}" border="0" height="26" />`:"","</td>",'<td width="50%" align="right">',w?`<img src="${w}" border="0" height="38" />`:"","</td>","</tr>","</table>"].join("")}</th></tr>`:"",e.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:l}=e;return 0===l?null:`<th colspan="${l}" rowspan="${t}">${ja(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),l.length&&(a+=`<tbody>${Ca(l).map((e=>`<tr>${t.map(((t,n)=>{const{rowSpan:a,colSpan:r}=v(e,t,e.index,n,l);if(!a||!r)return null;const{dataIndex:i,outputRender:o}=t;return`<td rowspan="${a}" colspan="${r}">${0===n&&e._level?`<span style="padding-left:${e._level*bi.treeTable.textIndent}px"></span>`:""}${o?o(Pa(e,i),e,t,e.index,n):E(e,t,e.index,n)}</td>`})).join("")}</tr>`)).join("")}</tbody>`),m&&p.length&&(a+=["<tfoot>",p.map((e=>`<tr>${t.map(((t,n)=>{const{dataIndex:a,summation:r}=t,i=(null==r?void 0:r.render)?r.render(l):Pa(e,`${a}_text`);return`<td>${0===n&&""===i?x("qm.table.config.summaryText"):Re(i)?ja(i):i}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),a+="</table>",a},A=()=>{var e;null===(e=((e,t)=>{const{filename:l,type:n,isDownload:a}=e,r=`${l}.${n}`;if(window.Blob){const e=new Blob([t],{type:`text/${n}`});if(!a)return Promise.resolve({type:n,content:t,blob:e});Dn(e,r)}})({filename:"print",type:"html",isDownload:!1},L()))||void 0===e||e.then((({content:e,blob:t})=>{let l=document.createElement("iframe");l.setAttribute("frameborder","0"),l.setAttribute("width","100%"),l.setAttribute("height","0"),l.style.display="none",document.body.appendChild(l),u.current.isIE?(l.contentDocument.write(e),l.contentDocument.execCommand("print"),l.parentNode.removeChild(l),l=null):(l.onload=e=>{e.target.src&&e.target.contentWindow.print(),setTimeout((()=>{l.parentNode.removeChild(l),l=null}))},l.src=URL.createObjectURL(t))}))};return q.default.useImperativeHandle(t,(()=>({clickHandle:A}))),s?q.default.createElement("span",{className:`${c}-print`,title:x("qm.table.print.text"),onClick:()=>A()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.PrinterOutlined,null))):null}));Ri.displayName="TablePrint";const ki="606060",Li="thin",Pi="d4d4d4",Ai=(e,t)=>{t&&(e.height=Math.floor(.75*t))},Fi=(e,t)=>{e.protection={locked:!1},e.alignment={vertical:"middle",horizontal:t||"left"}},_i=()=>({top:{style:Li,color:{argb:Pi}},left:{style:Li,color:{argb:Pi}},bottom:{style:Li,color:{argb:Pi}},right:{style:Li,color:{argb:Pi}}}),Di=e=>{const{children:t}=e;return t&&t.length?Di(t[0]):e},Mi=e=>{const{precision:t,formatType:l}=e,n=t>=0&&t?`.${"0".repeat(t)}`:"";return"percent"===l?{numFmt:n?`0${n}%`:"0%"}:"finance"===l?{numFmt:n?`#,##0${n}`:"#,##0"}:n?{numFmt:`0${n}`}:null},Hi=()=>{const{tableRef:e,tableRowHeight:t,getSpan:n,showSummary:a,isHeadGroup:r}=q.default.useContext(ei),{spanMethod:i,showHeader:o}=e.current.props,{t:s}=ot(),u=(e,t)=>{var l,n,a;return null!==(a=null!==(n=null===(l=e.find((e=>e.text==t)))||void 0===l?void 0:l.value)&&void 0!==n?n:t)&&void 0!==a?a:""};return{exportXLSX:(e,l,d,u)=>Ie(void 0,void 0,void 0,(function*(){const{columns:c,footSummation:f}=e,p=pa(c),m=Na(c),h=[],g=[],v=[],y=[];let b=0;const x={};p.forEach((e=>{const{dataIndex:t,width:l,renderWidth:n}=e;x[t]=ja(e.title),v.push({key:t,width:(l||n||bi.defaultColumnWidth)/8})})),o&&(r?m.forEach(((e,t)=>{const l={};e.forEach((e=>{const{colSpan:n,rowSpan:a}=e,r=Di(e),i=p.findIndex((({dataIndex:e})=>e===r.dataIndex));l[r.dataIndex]=ja(e.title),0!==n&&(n>1||a>1)&&y.push({s:{r:t,c:i},e:{r:t+a-1,c:i+n-1}})})),h.push(l)})):(p.forEach(((e,t)=>{const{colSpan:l,rowSpan:n}=e;(l>1||n>1)&&y.push({s:{r:b,c:t},e:{r:b+n-1,c:t+l-1}})})),h.push(x)),b+=h.length);const E=Ca(l).map(((e,t)=>{const a={};return p.forEach(((r,o)=>{if("function"==typeof i){const{rowSpan:a,colSpan:i}=n(e,r,t,o,l);(i>1||a>1)&&y.push({s:{r:t+b,c:o},e:{r:t+b+a-1,c:o+i-1}})}const s=["percent","finance"].includes(r.formatType);a[r.dataIndex]=s?Pa(e,r.dataIndex):u(e,t,r,o)})),a._level=e._level,a}));b+=E.length,a&&f&&d(p,l).forEach(((e,t)=>{const n={};p.forEach(((t,a)=>{const{dataIndex:r,summation:i}=t,o=(null==i?void 0:i.render)?i.render(l):Pa(e,r);n[r]=0===a&&""===o?s("qm.table.config.summaryText"):Re(o)?ja(o):o})),g.push(n)}));const{sheetName:C,useStyle:w}=e,S=new fe.default.Workbook,N=S.addWorksheet(C);N.columns=v,o&&N.addRows(h).forEach((e=>{w&&Ai(e,t),e.eachCell((e=>{const t=N.getColumn(e.col),l=ya(c,t.key),{align:n,theadAlign:a}=l;Fi(e,a||n),w&&Object.assign(e,{font:{bold:!0,color:{argb:ki}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:_i()})}))})),N.addRows(E).forEach(((e,l)=>{const{_level:n}=E[l];w&&Ai(e,t),e.eachCell((e=>{const t=N.getColumn(e.col),l=ya(c,t.key),{align:a}=l;Fi(e,a),Object.assign(e,Mi(l)),w&&Object.assign(e,{font:{color:{argb:ki}},border:_i()}),1===Number(e.col)&&n&&(e.alignment=Object.assign(Object.assign({},e.alignment),{indent:n}))}))})),a&&f&&N.addRows(g).forEach((e=>{w&&Ai(e,t),e.eachCell((e=>{const t=N.getColumn(e.col),l=ya(c,t.key),{align:n}=l;Fi(e,n),Object.assign(e,Mi(l)),w&&Object.assign(e,{font:{color:{argb:ki}},border:_i()})}))})),y.forEach((({s:e,e:t})=>{N.mergeCells(e.r+1,e.c+1,t.r+1,t.c+1)}));const T=yield S.xlsx.writeBuffer();return new Blob([T],{type:"application/octet-stream"})})),exportCSV:(e,t)=>{const l="\ufeff"+(e=>Array.from(e.rows).map((e=>Array.from(e.cells).map((e=>{var t,l;return((e,t)=>{const l=e.replace(/"/g,'""');return"string"===t?`"=""${l}"""`:"number"===t?l:l.includes(",")||l.includes("\r")||l.includes("\n")?`"${l}"`:l})(null!==(l=null===(t=e.textContent)||void 0===t?void 0:t.trim())&&void 0!==l?l:"",e.getAttribute("data-type"))})).join(","))).join("\r\n"))((e=>{const t=document.createElement("div");t.innerHTML=e.trim();const l=t.querySelector("table");if(!l)throw new Error("Invalid table HTML input.");return l})(t));return new Blob([l],{type:"text/csv;charset=utf-8"})},importXLSX:(e,t)=>{const{columns:n,file:a}=e,r=pa(n),i=new FileReader;i.onerror=()=>{d.message.error(s("qm.table.import.error"))},i.onload=e=>{const n=r.map((e=>ja(e.title))),a=new fe.default.Workbook,i=e.target;i?a.xlsx.load(i.result).then((e=>{const a=e.worksheets[0];if(a){const e=a.getSheetValues(),i=e.findIndex((e=>e&&e.length>0)),o=e[i],c=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(n,o);if(c){const a=e.slice(i+1).map((e=>{const t={};e.forEach(((e,n)=>{var a;let r=e;Array.isArray(null==r?void 0:r.richText)&&(r=r.richText.map((e=>e.text)).join("")),l.isPlainObject(r)&&"text"in r&&(r=r.text),l.isDate(r)&&(r=qa(r,oi)),(null==r?void 0:r.formula)&&(r=null!==(a=r.result)&&void 0!==a?a:r.value),t[o[n]]=r}));const a={};return n.forEach(((e,l)=>{var n;const{dataIndex:i,dictItems:o}=r[l];Array.isArray(o)&&((null===(n=t[e])||void 0===n?void 0:n.toString().includes(","))?t[e]=t[e].split(",").map((e=>u(o,e))).filter((e=>""!==e)):t[e]=u(o,t[e])),Aa(a,i,t[e])})),a}));null==t||t(a)}else d.message.error(s("qm.table.import.error"))}else d.message.error(s("qm.table.import.error"))})):d.message.error(s("qm.table.import.error"))},i.readAsArrayBuffer(a)}}},qi=e=>{const{fileType:t,onChange:l}=e,{prefixCls:n}=q.default.useContext(ei),{t:a}=ot();let r,i;const o=e=>{const t=e.name,l=t.lastIndexOf("."),n=t.substring(l+1,t.length);return{filename:t.substring(0,l),type:n}},s=()=>Ie(void 0,void 0,void 0,(function*(){try{const e=yield(e=>{const t=Object.assign({},e);return r||(r=document.createElement("form"),i=document.createElement("input"),r.className=`${n}--file-form`,i.name="file",i.type="file",r.appendChild(i),document.body.appendChild(r)),new Promise(((e,l)=>{const n=!t.type;i.multiple=!!t.multiple,i.accept=n?"":`.${t.type}`,i.onchange=s=>{const{files:u}=s.target,c=u[0];let f="";if(!n)for(let e=0;e<u.length;e++){const{type:l}=o(u[e]);if(t.type!==l){f=l;break}}f?(d.message.warning(a("qm.upload.notType",{type:f})),l()):e(c),document.body.removeChild(r),r=null,i=null},r.reset(),i.click()}))})({type:t});null==l||l(e.name,e)}catch(e){}}));return q.default.createElement(pt,{onClick:()=>s()},a("qm.upload.text"))},$i=e=>{const{columns:t,onClose:l}=e,{tableRef:n,prefixCls:a,createTableData:r,dataChange:i}=q.default.useContext(ei),{beforeTableImport:o}=n.current.props,{t:s}=ot(),{importXLSX:u}=Hi(),c=q.default.useRef(null),[f,p]=q.default.useState(!1),[m,h]=q.default.useState(!0),g=e=>e.filter((e=>![bi.expandableColumn,bi.selectionColumn,"index","pageIndex",bi.operationColumn].includes(e.dataIndex))),v={posIndex:"条"},[y,b]=q.default.useState([{type:"INPUT",label:s("qm.table.export.fileName"),fieldName:"fileName",render:(e,t)=>{const{fileName:l}=t.GET_FIELDS_VALUE(["fileName"]);return q.default.createElement(q.default.Fragment,null,l?q.default.createElement("span",null,l):q.default.createElement(qi,{fileType:t.state.formData.fileType,onChange:(e,l)=>{t.SET_FIELDS_VALUE({fileName:e,file:l}),l&&h(!1)}}))}},{type:"SELECT",label:s("qm.table.export.fileType"),fieldName:"fileType",allowClear:!1,options:{itemList:[{text:"xlsx",value:"xlsx"}]}},{type:"SELECT",label:s("qm.table.import.importType"),fieldName:"importType",allowClear:!1,options:{itemList:[{text:s("qm.table.import.fillText"),value:"fill"},{text:s("qm.table.import.addText"),value:"add"},{text:s("qm.table.import.insertText"),value:"insert"}]},onChange:e=>{y.find((e=>"posIndex"===e.fieldName)).hidden="insert"!==e,"insert"===e&&c.current.SET_FIELDS_EXTRA(v),b([...y])}},{type:"INPUT_NUMBER",label:s("qm.table.import.insertPos"),fieldName:"posIndex",hidden:!0,rules:[{required:!0}],options:{min:0,max:n.current.tableFullData.length,formatter:e=>`第 ${e}`.replace(/\B(?=(\d{3})+(?!\d))/g,","),parser:e=>e.replace(/第\s?|(,*)/g,"")},extra:{labelWidth:50}}]);return q.default.createElement("div",{className:`${a}-import__setting`},q.default.createElement(ap,{ref:c,initialValues:{fileType:"xlsx",importType:"fill"},initialExtras:v,items:y,cols:1,labelWidth:100}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(pt,{onClick:()=>l(),style:{marginRight:8}},s("qm.table.export.closeButton")),q.default.createElement(pt,{type:"primary",loading:f,disabled:m,onClick:()=>Ie(void 0,void 0,void 0,(function*(){const[e,a]=yield c.current.GET_FORM_DATA();e||(p(!0),u({columns:g(t),file:a.file},(e=>Ie(void 0,void 0,void 0,(function*(){const{tableFullData:t,store:u}=n.current;if(e=Array.from(e).map((e=>e||{})),"function"==typeof o)try{e=yield o(e)}catch(e){}if("fill"===a.importType&&r(e),"add"===a.importType&&r([...t,...e]),"insert"===a.importType){const l=a.posIndex,n=t.slice(0,l).concat(e).concat(t.slice(l));r(n)}e.forEach((e=>{u.addToInserted(e)})),i(),d.message.success(s("qm.table.import.success",{total:e.length})),p(!1),l()})))))}))},s("qm.table.import.text"))))},ji=q.default.forwardRef(((e,t)=>{const{tableColumns:l,open:n=!0}=e,{prefixCls:a}=q.default.useContext(ei),{t:r}=ot(),[i,o]=q.default.useState(!1),s=()=>{o(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:s})));const d={[`${a}-import`]:!0},u={visible:i,title:r("qm.table.import.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>o(!1)};return q.default.createElement(q.default.Fragment,null,n&&q.default.createElement("span",{className:J.default(d),title:r("qm.table.import.textNoSpace"),onClick:()=>s()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.ImportOutlined,null))),q.default.createElement(Qn,u,q.default.createElement($i,{columns:l,onClose:()=>o(!1)})))}));function Ki(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var l=t;l;){if(l===e)return!0;l=l.parentNode}return!1}function Vi(e,t,l,n){var a=ee.default.unstable_batchedUpdates?function(e){ee.default.unstable_batchedUpdates(l,e)}:l;return null!=e&&e.addEventListener&&e.addEventListener(t,a,n),{remove:function(){null!=e&&e.removeEventListener&&e.removeEventListener(t,a,n)}}}ji.displayName="TableImport";var zi=e.forwardRef((function(t,l){var n=t.didUpdate,a=t.getContainer,r=t.children,i=e.useRef(),o=e.useRef();e.useImperativeHandle(l,(function(){return{}}));var s=e.useRef(!1);return!s.current&&rl()&&(o.current=a(),i.current=o.current.parentNode,s.current=!0),e.useEffect((function(){null==n||n(t)})),e.useEffect((function(){return null===o.current.parentNode&&null!==i.current&&i.current.appendChild(o.current),function(){var e;null===(e=o.current)||void 0===e||null===(e=e.parentNode)||void 0===e||e.removeChild(o.current)}}),[]),o.current?ee.default.createPortal(r,o.current):null}));function Wi(e,t,l){return l?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}var Bi;function Ui(e){var t=e.prefixCls,l=e.motion,n=e.animation,a=e.transitionName;return l||(n?{motionName:"".concat(t,"-").concat(n)}:a?{motionName:a}:null)}function Gi(e){var t=e.prefixCls,l=e.visible,n=e.zIndex,a=e.mask,r=e.maskMotion,i=e.maskAnimation,o=e.maskTransitionName;if(!a)return null;var s={};return(r||o||i)&&(s=Tt({motionAppear:!0},Ui({motion:r,prefixCls:t,transitionName:o,animation:i}))),$.createElement(_l,Dl({},s,{visible:l,removeOnLeave:!0}),(function(e){var l=e.className;return $.createElement("div",{style:{zIndex:n},className:J.default("".concat(t,"-mask"),l)})}))}function Yi(e,t){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),l.push.apply(l,n)}return l}function Xi(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{};t%2?Yi(Object(l),!0).forEach((function(t){Zi(e,t,l[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(l)):Yi(Object(l)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(l,t))}))}return e}function Qi(e){return Qi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qi(e)}function Zi(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}var Ji={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function eo(){if(void 0!==Bi)return Bi;Bi="";var e=document.createElement("p").style;for(var t in Ji)t+"Transform"in e&&(Bi=t);return Bi}function to(){return eo()?"".concat(eo(),"TransitionProperty"):"transitionProperty"}function lo(){return eo()?"".concat(eo(),"Transform"):"transform"}function no(e,t){var l=to();l&&(e.style[l]=t,"transitionProperty"!==l&&(e.style.transitionProperty=t))}function ao(e,t){var l=lo();l&&(e.style[l]=t,"transform"!==l&&(e.style.transform=t))}var ro,io=/matrix\((.*)\)/,oo=/matrix3d\((.*)\)/;function so(e){var t=e.style.display;e.style.display="none",e.offsetHeight,e.style.display=t}function uo(e,t,l){var n=l;if("object"!==Qi(t))return void 0!==n?("number"==typeof n&&(n="".concat(n,"px")),void(e.style[t]=n)):ro(e,t);for(var a in t)t.hasOwnProperty(a)&&uo(e,a,t[a])}function co(e,t){var l=e["page".concat(t?"Y":"X","Offset")],n="scroll".concat(t?"Top":"Left");if("number"!=typeof l){var a=e.document;"number"!=typeof(l=a.documentElement[n])&&(l=a.body[n])}return l}function fo(e){return co(e)}function po(e){return co(e,!0)}function mo(e){var t=function(e){var t,l,n,a=e.ownerDocument,r=a.body,i=a&&a.documentElement;return t=e.getBoundingClientRect(),l=Math.floor(t.left),n=Math.floor(t.top),{left:l-=i.clientLeft||r.clientLeft||0,top:n-=i.clientTop||r.clientTop||0}}(e),l=e.ownerDocument,n=l.defaultView||l.parentWindow;return t.left+=fo(n),t.top+=po(n),t}function ho(e){return null!=e&&e==e.window}function go(e){return ho(e)?e.document:9===e.nodeType?e:e.ownerDocument}var vo=new RegExp("^(".concat(/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,")(?!px)[a-z%]+$"),"i"),yo=/^(top|right|bottom|left)$/,bo="currentStyle",xo="runtimeStyle",Eo="left";function Co(e,t){return"left"===e?t.useCssRight?"right":e:t.useCssBottom?"bottom":e}function wo(e){return"left"===e?"right":"right"===e?"left":"top"===e?"bottom":"bottom"===e?"top":void 0}function So(e,t,l){"static"===uo(e,"position")&&(e.style.position="relative");var n=-999,a=-999,r=Co("left",l),i=Co("top",l),o=wo(r),s=wo(i);"left"!==r&&(n=999),"top"!==i&&(a=999);var d,u="",c=mo(e);("left"in t||"top"in t)&&(u=(d=e).style.transitionProperty||d.style[to()]||"",no(e,"none")),"left"in t&&(e.style[o]="",e.style[r]="".concat(n,"px")),"top"in t&&(e.style[s]="",e.style[i]="".concat(a,"px")),so(e);var f=mo(e),p={};for(var m in t)if(t.hasOwnProperty(m)){var h=Co(m,l),g="left"===m?n:a,v=c[m]-f[m];p[h]=h===m?g+v:g-v}uo(e,p),so(e),("left"in t||"top"in t)&&no(e,u);var y={};for(var b in t)if(t.hasOwnProperty(b)){var x=Co(b,l),E=t[b]-c[b];y[x]=b===x?p[x]+E:p[x]-E}uo(e,y)}function No(e,t){var l=mo(e),n=function(e){var t=window.getComputedStyle(e,null),l=t.getPropertyValue("transform")||t.getPropertyValue(lo());if(l&&"none"!==l){var n=l.replace(/[^0-9\-.,]/g,"").split(",");return{x:parseFloat(n[12]||n[4],0),y:parseFloat(n[13]||n[5],0)}}return{x:0,y:0}}(e),a={x:n.x,y:n.y};"left"in t&&(a.x=n.x+t.left-l.left),"top"in t&&(a.y=n.y+t.top-l.top),function(e,t){var l=window.getComputedStyle(e,null),n=l.getPropertyValue("transform")||l.getPropertyValue(lo());if(n&&"none"!==n){var a,r=n.match(io);r?((a=(r=r[1]).split(",").map((function(e){return parseFloat(e,10)})))[4]=t.x,a[5]=t.y,ao(e,"matrix(".concat(a.join(","),")"))):((a=n.match(oo)[1].split(",").map((function(e){return parseFloat(e,10)})))[12]=t.x,a[13]=t.y,ao(e,"matrix3d(".concat(a.join(","),")")))}else ao(e,"translateX(".concat(t.x,"px) translateY(").concat(t.y,"px) translateZ(0)"))}(e,a)}function To(e,t){for(var l=0;l<e.length;l++)t(e[l])}function Io(e){return"border-box"===ro(e,"boxSizing")}"undefined"!=typeof window&&(ro=window.getComputedStyle?function(e,t,l){var n=l,a="",r=go(e);return(n=n||r.defaultView.getComputedStyle(e,null))&&(a=n.getPropertyValue(t)||n[t]),a}:function(e,t){var l=e[bo]&&e[bo][t];if(vo.test(l)&&!yo.test(t)){var n=e.style,a=n[Eo],r=e[xo][Eo];e[xo][Eo]=e[bo][Eo],n[Eo]="fontSize"===t?"1em":l||0,l=n.pixelLeft+"px",n[Eo]=a,e[xo][Eo]=r}return""===l?"auto":l});var Oo=["margin","border","padding"],Ro=-1,ko=2,Lo=1;function Po(e,t,l){var n,a,r,i=0;for(a=0;a<t.length;a++)if(n=t[a])for(r=0;r<l.length;r++){var o=void 0;o="border"===n?"".concat(n).concat(l[r],"Width"):n+l[r],i+=parseFloat(ro(e,o))||0}return i}var Ao={getParent:function(e){var t=e;do{t=11===t.nodeType&&t.host?t.host:t.parentNode}while(t&&1!==t.nodeType&&9!==t.nodeType);return t}};function Fo(e,t,l){var n=l;if(ho(e))return"width"===t?Ao.viewportWidth(e):Ao.viewportHeight(e);if(9===e.nodeType)return"width"===t?Ao.docWidth(e):Ao.docHeight(e);var a="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?Math.floor(e.getBoundingClientRect().width):Math.floor(e.getBoundingClientRect().height),i=Io(e),o=0;(null==r||r<=0)&&(r=void 0,(null==(o=ro(e,t))||Number(o)<0)&&(o=e.style[t]||0),o=Math.floor(parseFloat(o))||0),void 0===n&&(n=i?Lo:Ro);var s=void 0!==r||i,d=r||o;return n===Ro?s?d-Po(e,["border","padding"],a):o:s?n===Lo?d:d+(n===ko?-Po(e,["border"],a):Po(e,["margin"],a)):o+Po(e,Oo.slice(n),a)}To(["Width","Height"],(function(e){Ao["doc".concat(e)]=function(t){var l=t.document;return Math.max(l.documentElement["scroll".concat(e)],l.body["scroll".concat(e)],Ao["viewport".concat(e)](l))},Ao["viewport".concat(e)]=function(t){var l="client".concat(e),n=t.document,a=n.body,r=n.documentElement[l];return"CSS1Compat"===n.compatMode&&r||a&&a[l]||r}}));var _o={position:"absolute",visibility:"hidden",display:"block"};function Do(){for(var e=arguments.length,t=new Array(e),l=0;l<e;l++)t[l]=arguments[l];var n,a=t[0];return 0!==a.offsetWidth?n=Fo.apply(void 0,t):function(e,t,l){var n,a={},r=e.style;for(n in t)t.hasOwnProperty(n)&&(a[n]=r[n],r[n]=t[n]);for(n in l.call(e),t)t.hasOwnProperty(n)&&(r[n]=a[n])}(a,_o,(function(){n=Fo.apply(void 0,t)})),n}function Mo(e,t){for(var l in t)t.hasOwnProperty(l)&&(e[l]=t[l]);return e}To(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);Ao["outer".concat(t)]=function(t,l){return t&&Do(t,e,l?0:Lo)};var l="width"===e?["Left","Right"]:["Top","Bottom"];Ao[e]=function(t,n){var a=n;return void 0!==a?t?(Io(t)&&(a+=Po(t,["padding","border"],l)),uo(t,e,a)):void 0:t&&Do(t,e,Ro)}}));var Ho={getWindow:function(e){if(e&&e.document&&e.setTimeout)return e;var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},getDocument:go,offset:function(e,t,l){if(void 0===t)return mo(e);!function(e,t,l){if(l.ignoreShake){var n=mo(e),a=n.left.toFixed(0),r=n.top.toFixed(0),i=t.left.toFixed(0),o=t.top.toFixed(0);if(a===i&&r===o)return}l.useCssRight||l.useCssBottom?So(e,t,l):l.useCssTransform&&lo()in document.body.style?No(e,t):So(e,t,l)}(e,t,l||{})},isWindow:ho,each:To,css:uo,clone:function(e){var t,l={};for(t in e)e.hasOwnProperty(t)&&(l[t]=e[t]);if(e.overflow)for(t in e)e.hasOwnProperty(t)&&(l.overflow[t]=e.overflow[t]);return l},mix:Mo,getWindowScrollLeft:function(e){return fo(e)},getWindowScrollTop:function(e){return po(e)},merge:function(){for(var e={},t=0;t<arguments.length;t++)Ho.mix(e,t<0||arguments.length<=t?void 0:arguments[t]);return e},viewportWidth:0,viewportHeight:0};Mo(Ho,Ao);var qo=Ho.getParent;function $o(e){if(Ho.isWindow(e)||9===e.nodeType)return null;var t,l=Ho.getDocument(e).body,n=Ho.css(e,"position");if(!("fixed"===n||"absolute"===n))return"html"===e.nodeName.toLowerCase()?null:qo(e);for(t=qo(e);t&&t!==l&&9!==t.nodeType;t=qo(t))if("static"!==(n=Ho.css(t,"position")))return t;return null}var jo=Ho.getParent;function Ko(e,t){for(var l={left:0,right:1/0,top:0,bottom:1/0},n=$o(e),a=Ho.getDocument(e),r=a.defaultView||a.parentWindow,i=a.body,o=a.documentElement;n;){if(-1!==navigator.userAgent.indexOf("MSIE")&&0===n.clientWidth||n===i||n===o||"visible"===Ho.css(n,"overflow")){if(n===i||n===o)break}else{var s=Ho.offset(n);s.left+=n.clientLeft,s.top+=n.clientTop,l.top=Math.max(l.top,s.top),l.right=Math.min(l.right,s.left+n.clientWidth),l.bottom=Math.min(l.bottom,s.top+n.clientHeight),l.left=Math.max(l.left,s.left)}n=$o(n)}var d=null;Ho.isWindow(e)||9===e.nodeType||(d=e.style.position,"absolute"===Ho.css(e,"position")&&(e.style.position="fixed"));var u=Ho.getWindowScrollLeft(r),c=Ho.getWindowScrollTop(r),f=Ho.viewportWidth(r),p=Ho.viewportHeight(r),m=o.scrollWidth,h=o.scrollHeight,g=window.getComputedStyle(i);if("hidden"===g.overflowX&&(m=r.innerWidth),"hidden"===g.overflowY&&(h=r.innerHeight),e.style&&(e.style.position=d),t||function(e){if(Ho.isWindow(e)||9===e.nodeType)return!1;var t=Ho.getDocument(e),l=t.body,n=null;for(n=jo(e);n&&n!==l&&n!==t;n=jo(n))if("fixed"===Ho.css(n,"position"))return!0;return!1}(e))l.left=Math.max(l.left,u),l.top=Math.max(l.top,c),l.right=Math.min(l.right,u+f),l.bottom=Math.min(l.bottom,c+p);else{var v=Math.max(m,u+f);l.right=Math.min(l.right,v);var y=Math.max(h,c+p);l.bottom=Math.min(l.bottom,y)}return l.top>=0&&l.left>=0&&l.bottom>l.top&&l.right>l.left?l:null}function Vo(e){var t,l,n;if(Ho.isWindow(e)||9===e.nodeType){var a=Ho.getWindow(e);t={left:Ho.getWindowScrollLeft(a),top:Ho.getWindowScrollTop(a)},l=Ho.viewportWidth(a),n=Ho.viewportHeight(a)}else t=Ho.offset(e),l=Ho.outerWidth(e),n=Ho.outerHeight(e);return t.width=l,t.height=n,t}function zo(e,t){var l=t.charAt(0),n=t.charAt(1),a=e.width,r=e.height,i=e.left,o=e.top;return"c"===l?o+=r/2:"b"===l&&(o+=r),"c"===n?i+=a/2:"r"===n&&(i+=a),{left:i,top:o}}function Wo(e,t,l,n,a){var r=zo(t,l[1]),i=zo(e,l[0]),o=[i.left-r.left,i.top-r.top];return{left:Math.round(e.left-o[0]+n[0]-a[0]),top:Math.round(e.top-o[1]+n[1]-a[1])}}function Bo(e,t,l){return e.left<l.left||e.left+t.width>l.right}function Uo(e,t,l){return e.top<l.top||e.top+t.height>l.bottom}function Go(e,t,l){var n=[];return Ho.each(e,(function(e){n.push(e.replace(t,(function(e){return l[e]})))})),n}function Yo(e,t){return e[t]=-e[t],e}function Xo(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function Qo(e,t){e[0]=Xo(e[0],t.width),e[1]=Xo(e[1],t.height)}function Zo(e,t,l,n){var a=l.points,r=l.offset||[0,0],i=l.targetOffset||[0,0],o=l.overflow,s=l.source||e;r=[].concat(r),i=[].concat(i);var d={},u=0,c=Ko(s,!(!(o=o||{})||!o.alwaysByViewport)),f=Vo(s);Qo(r,f),Qo(i,t);var p=Wo(f,t,a,r,i),m=Ho.merge(f,p);if(c&&(o.adjustX||o.adjustY)&&n){if(o.adjustX&&Bo(p,f,c)){var h=Go(a,/[lr]/gi,{l:"r",r:"l"}),g=Yo(r,0),v=Yo(i,0);(function(e,t,l){return e.left>l.right||e.left+t.width<l.left})(Wo(f,t,h,g,v),f,c)||(u=1,a=h,r=g,i=v)}if(o.adjustY&&Uo(p,f,c)){var y=Go(a,/[tb]/gi,{t:"b",b:"t"}),b=Yo(r,1),x=Yo(i,1);(function(e,t,l){return e.top>l.bottom||e.top+t.height<l.top})(Wo(f,t,y,b,x),f,c)||(u=1,a=y,r=b,i=x)}u&&(p=Wo(f,t,a,r,i),Ho.mix(m,p));var E=Bo(p,f,c),C=Uo(p,f,c);if(E||C){var w=a;E&&(w=Go(a,/[lr]/gi,{l:"r",r:"l"})),C&&(w=Go(a,/[tb]/gi,{t:"b",b:"t"})),a=w,r=l.offset||[0,0],i=l.targetOffset||[0,0]}d.adjustX=o.adjustX&&E,d.adjustY=o.adjustY&&C,(d.adjustX||d.adjustY)&&(m=function(e,t,l,n){var a=Ho.clone(e),r={width:t.width,height:t.height};return n.adjustX&&a.left<l.left&&(a.left=l.left),n.resizeWidth&&a.left>=l.left&&a.left+r.width>l.right&&(r.width-=a.left+r.width-l.right),n.adjustX&&a.left+r.width>l.right&&(a.left=Math.max(l.right-r.width,l.left)),n.adjustY&&a.top<l.top&&(a.top=l.top),n.resizeHeight&&a.top>=l.top&&a.top+r.height>l.bottom&&(r.height-=a.top+r.height-l.bottom),n.adjustY&&a.top+r.height>l.bottom&&(a.top=Math.max(l.bottom-r.height,l.top)),Ho.mix(a,r)}(p,f,c,d))}return m.width!==f.width&&Ho.css(s,"width",Ho.width(s)+m.width-f.width),m.height!==f.height&&Ho.css(s,"height",Ho.height(s)+m.height-f.height),Ho.offset(s,{left:m.left,top:m.top},{useCssRight:l.useCssRight,useCssBottom:l.useCssBottom,useCssTransform:l.useCssTransform,ignoreShake:l.ignoreShake}),{points:a,offset:r,targetOffset:i,overflow:d}}function Jo(e,t,l){var n=l.target||t,a=Vo(n),r=!function(e,t){var l=Ko(e,t),n=Vo(e);return!l||n.left+n.width<=l.left||n.top+n.height<=l.top||n.left>=l.right||n.top>=l.bottom}(n,l.overflow&&l.overflow.alwaysByViewport);return Zo(e,a,l,r)}Jo.__getOffsetParent=$o,Jo.__getVisibleRectForElement=Ko;var es=rl()?$.useLayoutEffect:$.useEffect,ts=function(e,t){var l=$.useRef(!0);es((function(){return e(l.current)}),t),es((function(){return l.current=!1,function(){l.current=!0}}),[])};function ls(e,t){var l=null,n=null;var a=new le.default((function(e){var a=Ot(e,1)[0].target;if(document.documentElement.contains(a)){var r=a.getBoundingClientRect(),i=r.width,o=r.height,s=Math.floor(i),d=Math.floor(o);l===s&&n===d||Promise.resolve().then((function(){t({width:s,height:d})})),l=s,n=d}}));return e&&a.observe(e),function(){a.disconnect()}}function ns(e){return"function"!=typeof e?null:e()}function as(e){return"object"===Ct(e)&&e?e:null}var rs=function(e,t){var l=e.children,n=e.disabled,a=e.target,r=e.align,i=e.onAlign,o=e.monitorWindowResize,s=e.monitorBufferTime,d=void 0===s?0:s,u=q.default.useRef({}),c=q.default.useRef(),f=q.default.Children.only(l),p=q.default.useRef({});p.current.disabled=n,p.current.target=a,p.current.align=r,p.current.onAlign=i;var m=function(e,t){var l=q.default.useRef(!1),n=q.default.useRef(null);function a(){window.clearTimeout(n.current)}return[function r(i){if(a(),l.current&&!0!==i)n.current=window.setTimeout((function(){l.current=!1,r()}),t);else{if(!1===e(i))return;l.current=!0,n.current=window.setTimeout((function(){l.current=!1}),t)}},function(){l.current=!1,a()}]}((function(){var e=p.current,t=e.disabled,l=e.target,n=e.align,a=e.onAlign,r=c.current;if(!t&&l&&r){var i,o=ns(l),s=as(l);u.current.element=o,u.current.point=s,u.current.align=n;var d=document.activeElement;return o&&function(e){if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox(),l=t.width,n=t.height;if(l||n)return!0}if(e.getBoundingClientRect){var a=e.getBoundingClientRect(),r=a.width,i=a.height;if(r||i)return!0}}return!1}(o)?i=Jo(r,o,n):s&&(i=function(e,t,l){var n,a,r=Ho.getDocument(e),i=r.defaultView||r.parentWindow,o=Ho.getWindowScrollLeft(i),s=Ho.getWindowScrollTop(i),d=Ho.viewportWidth(i),u=Ho.viewportHeight(i),c={left:n="pageX"in t?t.pageX:o+t.clientX,top:a="pageY"in t?t.pageY:s+t.clientY,width:0,height:0},f=n>=0&&n<=o+d&&a>=0&&a<=s+u,p=[l.points[0],"cc"];return Zo(e,c,Xi(Xi({},l),{},{points:p}),f)}(r,s,n)),function(e,t){e!==document.activeElement&&Ki(t,e)&&"function"==typeof e.focus&&e.focus()}(d,r),a&&i&&a(r,i),!0}return!1}),d),h=Ot(m,2),g=h[0],v=h[1],y=Ot(q.default.useState(),2),b=y[0],x=y[1],E=Ot(q.default.useState(),2),C=E[0],w=E[1];return ts((function(){x(ns(a)),w(as(a))})),q.default.useEffect((function(){var e,t;u.current.element===b&&((e=u.current.point)===(t=C)||e&&t&&("pageX"in t&&"pageY"in t?e.pageX===t.pageX&&e.pageY===t.pageY:"clientX"in t&&"clientY"in t&&e.clientX===t.clientX&&e.clientY===t.clientY))&&function(e,t){var l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=new Set;return function e(t,a){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=n.has(t);if(Ue(!i,"Warning: There may be circular references"),i)return!1;if(t===a)return!0;if(l&&r>1)return!1;n.add(t);var o=r+1;if(Array.isArray(t)){if(!Array.isArray(a)||t.length!==a.length)return!1;for(var s=0;s<t.length;s++)if(!e(t[s],a[s],o))return!1;return!0}if(t&&a&&"object"===Ct(t)&&"object"===Ct(a)){var d=Object.keys(t);return d.length===Object.keys(a).length&&d.every((function(l){return e(t[l],a[l],o)}))}return!1}(e,t)}(u.current.align,r)||g()})),q.default.useEffect((function(){return ls(c.current,g)}),[c.current]),q.default.useEffect((function(){return ls(b,g)}),[b]),q.default.useEffect((function(){n?v():g()}),[n]),q.default.useEffect((function(){if(o)return Vi(window,"resize",g).remove}),[o]),q.default.useEffect((function(){return function(){v()}}),[]),q.default.useImperativeHandle(t,(function(){return{forceAlign:function(){return g(!0)}}})),q.default.isValidElement(f)&&(f=q.default.cloneElement(f,{ref:_t(f.ref,c)})),f},is=q.default.forwardRef(rs);function os(){os=function(){return e};var e={},t=Object.prototype,l=t.hasOwnProperty,n=Object.defineProperty||function(e,t,l){e[t]=l.value},a="function"==typeof Symbol?Symbol:{},r=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",o=a.toStringTag||"@@toStringTag";function s(e,t,l){return Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,l){return e[t]=l}}function d(e,t,l,a){var r=t&&t.prototype instanceof f?t:f,i=Object.create(r.prototype),o=new N(a||[]);return n(i,"_invoke",{value:E(e,l,o)}),i}function u(e,t,l){try{return{type:"normal",arg:e.call(t,l)}}catch(e){return{type:"throw",arg:e}}}e.wrap=d;var c={};function f(){}function p(){}function m(){}var h={};s(h,r,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(T([])));v&&v!==t&&l.call(v,r)&&(h=v);var y=m.prototype=f.prototype=Object.create(h);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function a(n,r,i,o){var s=u(e[n],e,r);if("throw"!==s.type){var d=s.arg,c=d.value;return c&&"object"==Ct(c)&&l.call(c,"__await")?t.resolve(c.__await).then((function(e){a("next",e,i,o)}),(function(e){a("throw",e,i,o)})):t.resolve(c).then((function(e){d.value=e,i(d)}),(function(e){return a("throw",e,i,o)}))}o(s.arg)}var r;n(this,"_invoke",{value:function(e,l){function n(){return new t((function(t,n){a(e,l,t,n)}))}return r=r?r.then(n,n):n()}})}function E(e,t,l){var n="suspendedStart";return function(a,r){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw r;return I()}for(l.method=a,l.arg=r;;){var i=l.delegate;if(i){var o=C(i,l);if(o){if(o===c)continue;return o}}if("next"===l.method)l.sent=l._sent=l.arg;else if("throw"===l.method){if("suspendedStart"===n)throw n="completed",l.arg;l.dispatchException(l.arg)}else"return"===l.method&&l.abrupt("return",l.arg);n="executing";var s=u(e,t,l);if("normal"===s.type){if(n=l.done?"completed":"suspendedYield",s.arg===c)continue;return{value:s.arg,done:l.done}}"throw"===s.type&&(n="completed",l.method="throw",l.arg=s.arg)}}}function C(e,t){var l=t.method,n=e.iterator[l];if(void 0===n)return t.delegate=null,"throw"===l&&e.iterator.return&&(t.method="return",t.arg=void 0,C(e,t),"throw"===t.method)||"return"!==l&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+l+"' method")),c;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,c;var r=a.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function T(e){if(e){var t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:I}}function I(){return{value:void 0,done:!0}}return p.prototype=m,n(y,"constructor",{value:m,configurable:!0}),n(m,"constructor",{value:p,configurable:!0}),p.displayName=s(m,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,s(e,o,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),s(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,l,n,a,r){void 0===r&&(r=Promise);var i=new x(d(t,l,n,a),r);return e.isGeneratorFunction(l)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),s(y,o,"Generator"),s(y,r,(function(){return this})),s(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),l=[];for(var n in t)l.push(n);return l.reverse(),function e(){for(;l.length;){var n=l.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=T,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&l.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(l,n){return i.type="throw",i.arg=e,t.next=l,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var r=this.tryEntries[a],i=r.completion;if("root"===r.tryLoc)return n("end");if(r.tryLoc<=this.prev){var o=l.call(r,"catchLoc"),s=l.call(r,"finallyLoc");if(o&&s){if(this.prev<r.catchLoc)return n(r.catchLoc,!0);if(this.prev<r.finallyLoc)return n(r.finallyLoc)}else if(o){if(this.prev<r.catchLoc)return n(r.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return n(r.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&l.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var r=a;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var i=r?r.completion:{};return i.type=e,i.arg=t,r?(this.method="next",this.next=r.finallyLoc,c):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),c},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var l=this.tryEntries[t];if(l.finallyLoc===e)return this.complete(l.completion,l.afterLoc),S(l),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var l=this.tryEntries[t];if(l.tryLoc===e){var n=l.completion;if("throw"===n.type){var a=n.arg;S(l)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,l){return this.delegate={iterator:T(e),resultName:t,nextLoc:l},"next"===this.method&&(this.arg=void 0),c}},e}function ss(e,t,l,n,a,r,i){try{var o=e[r](i),s=o.value}catch(e){return void l(e)}o.done?t(s):Promise.resolve(s).then(n,a)}function ds(e){return function(){var t=this,l=arguments;return new Promise((function(n,a){var r=e.apply(t,l);function i(e){ss(r,n,a,i,o,"next",e)}function o(e){ss(r,n,a,i,o,"throw",e)}i(void 0)}))}}is.displayName="Align";var us=["measure","alignPre","align",null,"motion"],cs=$.forwardRef((function(t,l){var n=t.visible,a=t.prefixCls,r=t.className,i=t.style,o=t.children,s=t.zIndex,d=t.stretch,u=t.destroyPopupOnHide,c=t.forceRender,f=t.align,p=t.point,m=t.getRootDomNode,h=t.getClassNameFromAlign,g=t.onAlign,v=t.onMouseEnter,y=t.onMouseLeave,b=t.onMouseDown,x=t.onTouchStart,E=t.onClick,C=e.useRef(),w=e.useRef(),S=Ot(e.useState(),2),N=S[0],T=S[1],I=function(e){var t=Ot($.useState({width:0,height:0}),2),l=t[0],n=t[1];return[$.useMemo((function(){var t={};if(e){var n=l.width,a=l.height;-1!==e.indexOf("height")&&a?t.height=a:-1!==e.indexOf("minHeight")&&a&&(t.minHeight=a),-1!==e.indexOf("width")&&n?t.width=n:-1!==e.indexOf("minWidth")&&n&&(t.minWidth=n)}return t}),[e,l]),function(e){var t=e.offsetWidth,l=e.offsetHeight,a=e.getBoundingClientRect(),r=a.width,i=a.height;Math.abs(t-r)<1&&Math.abs(l-i)<1&&(t=r,l=i),n({width:t,height:l})}]}(d),O=Ot(I,2),R=O[0],k=O[1];var L=function(t,l){var n=Ot(Gt(null),2),a=n[0],r=n[1],i=e.useRef();function o(e){r(e,!0)}function s(){Ol.cancel(i.current)}return e.useEffect((function(){o("measure")}),[t]),e.useEffect((function(){"measure"===a&&l(),a&&(i.current=Ol(ds(os().mark((function e(){var t,l;return os().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=us.indexOf(a),(l=us[t+1])&&-1!==t&&o(l);case 3:case"end":return e.stop()}}),e)})))))}),[a]),e.useEffect((function(){return function(){s()}}),[]),[a,function(e){s(),i.current=Ol((function(){o((function(e){switch(a){case"align":return"motion";case"motion":return"stable"}return e})),null==e||e()}))}]}(n,(function(){d&&k(m())})),P=Ot(L,2),A=P[0],F=P[1],_=Ot(e.useState(0),2),D=_[0],M=_[1],H=e.useRef();function q(){var e;null===(e=C.current)||void 0===e||e.forceAlign()}function j(e,t){var l=h(t);N!==l&&T(l),M((function(e){return e+1})),"align"===A&&(null==g||g(e,t))}ts((function(){"alignPre"===A&&M(0)}),[A]),ts((function(){"align"===A&&(D<3?q():F((function(){var e;null===(e=H.current)||void 0===e||e.call(H)})))}),[D]);var K=Tt({},Ui(t));function V(){return new Promise((function(e){H.current=e}))}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach((function(e){var t=K[e];K[e]=function(e,l){return F(),null==t?void 0:t(e,l)}})),$.useEffect((function(){K.motionName||"motion"!==A||F()}),[K.motionName,A]),$.useImperativeHandle(l,(function(){return{forceAlign:q,getElement:function(){return w.current}}}));var z=Tt(Tt({},R),{},{zIndex:s,opacity:"motion"!==A&&"stable"!==A&&n?0:void 0,pointerEvents:n||"stable"===A?void 0:"none"},i),W=!0;null==f||!f.points||"align"!==A&&"stable"!==A||(W=!1);var B=o;return $.Children.count(o)>1&&(B=$.createElement("div",{className:"".concat(a,"-content")},o)),$.createElement(_l,Dl({visible:n,ref:w,leavedClassName:"".concat(a,"-hidden")},K,{onAppearPrepare:V,onEnterPrepare:V,removeOnLeave:u,forceRender:c}),(function(e,t){var l=e.className,n=e.style,i=J.default(a,r,N,l);return $.createElement(is,{target:p||m,key:"popup",ref:C,monitorWindowResize:!0,disabled:W,align:f,onAlign:j},$.createElement("div",{ref:t,className:i,onMouseEnter:v,onMouseLeave:y,onMouseDownCapture:b,onTouchStartCapture:x,onClick:E,style:Tt(Tt({},n),z)},B))}))}));cs.displayName="PopupInner";var fs=$.forwardRef((function(e,t){var l=e.prefixCls,n=e.visible,a=e.zIndex,r=e.children,i=e.mobile,o=(i=void 0===i?{}:i).popupClassName,s=i.popupStyle,d=i.popupMotion,u=void 0===d?{}:d,c=i.popupRender,f=e.onClick,p=$.useRef();$.useImperativeHandle(t,(function(){return{forceAlign:function(){},getElement:function(){return p.current}}}));var m=Tt({zIndex:a},s),h=r;return $.Children.count(r)>1&&(h=$.createElement("div",{className:"".concat(l,"-content")},r)),c&&(h=c(h)),$.createElement(_l,Dl({visible:n,ref:p,removeOnLeave:!0},u),(function(e,t){var n=e.className,a=e.style,r=J.default(l,o,n);return $.createElement("div",{ref:t,className:r,onClick:f,style:Tt(Tt({},a),m)},h)}))}));fs.displayName="MobilePopupInner";var ps=["visible","mobile"],ms=$.forwardRef((function(t,l){var n=t.visible,a=t.mobile,r=Mt(t,ps),i=Ot(e.useState(n),2),o=i[0],s=i[1],d=Ot(e.useState(!1),2),u=d[0],c=d[1],f=Tt(Tt({},r),{},{visible:o});e.useEffect((function(){s(n),n&&a&&c(function(){if("undefined"==typeof navigator||"undefined"==typeof window)return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(null==e?void 0:e.substr(0,4))}())}),[n,a]);var p=u?$.createElement(fs,Dl({},f,{mobile:a,ref:l})):$.createElement(cs,Dl({},f,{ref:l}));return $.createElement("div",null,$.createElement(Gi,f),p)}));ms.displayName="Popup";var hs=$.createContext(null);function gs(){}function vs(){return""}function ys(e){return e?e.ownerDocument:window.document}var bs=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];var xs=function(e){var t=function(t){Vt(n,$.Component);var l=Bt(n);function n(e){var t,a;return qt(this,n),St(Wt(t=l.call(this,e)),"popupRef",$.createRef()),St(Wt(t),"triggerRef",$.createRef()),St(Wt(t),"portalContainer",void 0),St(Wt(t),"attachId",void 0),St(Wt(t),"clickOutsideHandler",void 0),St(Wt(t),"touchOutsideHandler",void 0),St(Wt(t),"contextMenuOutsideHandler1",void 0),St(Wt(t),"contextMenuOutsideHandler2",void 0),St(Wt(t),"mouseDownTimeout",void 0),St(Wt(t),"focusTime",void 0),St(Wt(t),"preClickTime",void 0),St(Wt(t),"preTouchTime",void 0),St(Wt(t),"delayTimer",void 0),St(Wt(t),"hasPopupMouseDown",void 0),St(Wt(t),"onMouseEnter",(function(e){var l=t.props.mouseEnterDelay;t.fireEvents("onMouseEnter",e),t.delaySetPopupVisible(!0,l,l?null:e)})),St(Wt(t),"onMouseMove",(function(e){t.fireEvents("onMouseMove",e),t.setPoint(e)})),St(Wt(t),"onMouseLeave",(function(e){t.fireEvents("onMouseLeave",e),t.delaySetPopupVisible(!1,t.props.mouseLeaveDelay)})),St(Wt(t),"onPopupMouseEnter",(function(){t.clearDelayTimer()})),St(Wt(t),"onPopupMouseLeave",(function(e){var l;e.relatedTarget&&!e.relatedTarget.setTimeout&&Ki(null===(l=t.popupRef.current)||void 0===l?void 0:l.getElement(),e.relatedTarget)||t.delaySetPopupVisible(!1,t.props.mouseLeaveDelay)})),St(Wt(t),"onFocus",(function(e){t.fireEvents("onFocus",e),t.clearDelayTimer(),t.isFocusToShow()&&(t.focusTime=Date.now(),t.delaySetPopupVisible(!0,t.props.focusDelay))})),St(Wt(t),"onMouseDown",(function(e){t.fireEvents("onMouseDown",e),t.preClickTime=Date.now()})),St(Wt(t),"onTouchStart",(function(e){t.fireEvents("onTouchStart",e),t.preTouchTime=Date.now()})),St(Wt(t),"onBlur",(function(e){t.fireEvents("onBlur",e),t.clearDelayTimer(),t.isBlurToHide()&&t.delaySetPopupVisible(!1,t.props.blurDelay)})),St(Wt(t),"onContextMenu",(function(e){e.preventDefault(),t.fireEvents("onContextMenu",e),t.setPopupVisible(!0,e)})),St(Wt(t),"onContextMenuClose",(function(){t.isContextMenuToShow()&&t.close()})),St(Wt(t),"onClick",(function(e){if(t.fireEvents("onClick",e),t.focusTime){var l;if(t.preClickTime&&t.preTouchTime?l=Math.min(t.preClickTime,t.preTouchTime):t.preClickTime?l=t.preClickTime:t.preTouchTime&&(l=t.preTouchTime),Math.abs(l-t.focusTime)<20)return;t.focusTime=0}t.preClickTime=0,t.preTouchTime=0,t.isClickToShow()&&(t.isClickToHide()||t.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault();var n=!t.state.popupVisible;(t.isClickToHide()&&!n||n&&t.isClickToShow())&&t.setPopupVisible(!t.state.popupVisible,e)})),St(Wt(t),"onPopupMouseDown",(function(){var e;(t.hasPopupMouseDown=!0,clearTimeout(t.mouseDownTimeout),t.mouseDownTimeout=window.setTimeout((function(){t.hasPopupMouseDown=!1}),0),t.context)&&(e=t.context).onPopupMouseDown.apply(e,arguments)})),St(Wt(t),"onDocumentClick",(function(e){if(!t.props.mask||t.props.maskClosable){var l=e.target,n=t.getRootDomNode(),a=t.getPopupDomNode();Ki(n,l)&&!t.isContextMenuOnly()||Ki(a,l)||t.hasPopupMouseDown||t.close()}})),St(Wt(t),"getRootDomNode",(function(){var e=t.props.getTriggerDOMNode;if(e)return e(t.triggerRef.current);try{var l=kt(t.triggerRef.current);if(l)return l}catch(e){}return ee.default.findDOMNode(Wt(t))})),St(Wt(t),"getPopupClassNameFromAlign",(function(e){var l=[],n=t.props,a=n.popupPlacement,r=n.builtinPlacements,i=n.prefixCls,o=n.alignPoint,s=n.getPopupClassNameFromAlign;return a&&r&&l.push(function(e,t,l,n){for(var a=l.points,r=Object.keys(e),i=0;i<r.length;i+=1){var o=r[i];if(Wi(e[o].points,a,n))return"".concat(t,"-placement-").concat(o)}return""}(r,i,e,o)),s&&l.push(s(e)),l.join(" ")})),St(Wt(t),"getComponent",(function(){var e=t.props,l=e.prefixCls,n=e.destroyPopupOnHide,a=e.popupClassName,r=e.onPopupAlign,i=e.popupMotion,o=e.popupAnimation,s=e.popupTransitionName,d=e.popupStyle,u=e.mask,c=e.maskAnimation,f=e.maskTransitionName,p=e.maskMotion,m=e.zIndex,h=e.popup,g=e.stretch,v=e.alignPoint,y=e.mobile,b=e.forceRender,x=e.onPopupClick,E=t.state,C=E.popupVisible,w=E.point,S=t.getPopupAlign(),N={};return t.isMouseEnterToShow()&&(N.onMouseEnter=t.onPopupMouseEnter),t.isMouseLeaveToHide()&&(N.onMouseLeave=t.onPopupMouseLeave),N.onMouseDown=t.onPopupMouseDown,N.onTouchStart=t.onPopupMouseDown,$.createElement(ms,Dl({prefixCls:l,destroyPopupOnHide:n,visible:C,point:v&&w,className:a,align:S,onAlign:r,animation:o,getClassNameFromAlign:t.getPopupClassNameFromAlign},N,{stretch:g,getRootDomNode:t.getRootDomNode,style:d,mask:u,zIndex:m,transitionName:s,maskAnimation:c,maskTransitionName:f,maskMotion:p,ref:t.popupRef,motion:i,mobile:y,forceRender:b,onClick:x}),"function"==typeof h?h():h)})),St(Wt(t),"attachParent",(function(e){Ol.cancel(t.attachId);var l,n=t.props,a=n.getPopupContainer,r=n.getDocument,i=t.getRootDomNode();a?(i||0===a.length)&&(l=a(i)):l=r(t.getRootDomNode()).body,l?l.appendChild(e):t.attachId=Ol((function(){t.attachParent(e)}))})),St(Wt(t),"getContainer",(function(){if(!t.portalContainer){var e=(0,t.props.getDocument)(t.getRootDomNode()).createElement("div");e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",t.portalContainer=e}return t.attachParent(t.portalContainer),t.portalContainer})),St(Wt(t),"setPoint",(function(e){t.props.alignPoint&&e&&t.setState({point:{pageX:e.pageX,pageY:e.pageY}})})),St(Wt(t),"handlePortalUpdate",(function(){t.state.prevPopupVisible!==t.state.popupVisible&&t.props.afterPopupVisibleChange(t.state.popupVisible)})),St(Wt(t),"triggerContextValue",{onPopupMouseDown:t.onPopupMouseDown}),a="popupVisible"in e?!!e.popupVisible:!!e.defaultPopupVisible,t.state={prevPopupVisible:a,popupVisible:a},bs.forEach((function(e){t["fire".concat(e)]=function(l){t.fireEvents(e,l)}})),t}return jt(n,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var e,t=this.props;if(this.state.popupVisible)return this.clickOutsideHandler||!this.isClickToHide()&&!this.isContextMenuToShow()||(e=t.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Vi(e,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(e=e||t.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Vi(e,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(e=e||t.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Vi(e,"scroll",this.onContextMenuClose)),void(!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Vi(window,"blur",this.onContextMenuClose)));this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),Ol.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var e;return(null===(e=this.popupRef.current)||void 0===e?void 0:e.getElement())||null}},{key:"getPopupAlign",value:function(){var e=this.props,t=e.popupPlacement,l=e.popupAlign,n=e.builtinPlacements;return t&&n?function(e,t,l){return Tt(Tt({},e[t]||{}),l)}(n,t,l):l}},{key:"setPopupVisible",value:function(e,t){var l=this.props.alignPoint,n=this.state.popupVisible;this.clearDelayTimer(),n!==e&&("popupVisible"in this.props||this.setState({popupVisible:e,prevPopupVisible:n}),this.props.onPopupVisibleChange(e)),l&&t&&e&&this.setPoint(t)}},{key:"delaySetPopupVisible",value:function(e,t,l){var n=this,a=1e3*t;if(this.clearDelayTimer(),a){var r=l?{pageX:l.pageX,pageY:l.pageY}:null;this.delayTimer=window.setTimeout((function(){n.setPopupVisible(e,r),n.clearDelayTimer()}),a)}else this.setPopupVisible(e,l)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(e){var t=this.props.children.props,l=this.props;return t[e]&&l[e]?this["fire".concat(e)]:t[e]||l[e]}},{key:"isClickToShow",value:function(){var e=this.props,t=e.action,l=e.showAction;return-1!==t.indexOf("click")||-1!==l.indexOf("click")}},{key:"isContextMenuOnly",value:function(){var e=this.props.action;return"contextMenu"===e||1===e.length&&"contextMenu"===e[0]}},{key:"isContextMenuToShow",value:function(){var e=this.props,t=e.action,l=e.showAction;return-1!==t.indexOf("contextMenu")||-1!==l.indexOf("contextMenu")}},{key:"isClickToHide",value:function(){var e=this.props,t=e.action,l=e.hideAction;return-1!==t.indexOf("click")||-1!==l.indexOf("click")}},{key:"isMouseEnterToShow",value:function(){var e=this.props,t=e.action,l=e.showAction;return-1!==t.indexOf("hover")||-1!==l.indexOf("mouseEnter")}},{key:"isMouseLeaveToHide",value:function(){var e=this.props,t=e.action,l=e.hideAction;return-1!==t.indexOf("hover")||-1!==l.indexOf("mouseLeave")}},{key:"isFocusToShow",value:function(){var e=this.props,t=e.action,l=e.showAction;return-1!==t.indexOf("focus")||-1!==l.indexOf("focus")}},{key:"isBlurToHide",value:function(){var e=this.props,t=e.action,l=e.hideAction;return-1!==t.indexOf("focus")||-1!==l.indexOf("blur")}},{key:"forcePopupAlign",value:function(){var e;this.state.popupVisible&&(null===(e=this.popupRef.current)||void 0===e||e.forceAlign())}},{key:"fireEvents",value:function(e,t){var l=this.props.children.props[e];l&&l(t);var n=this.props[e];n&&n(t)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var t=this.state.popupVisible,l=this.props,n=l.children,a=l.forceRender,r=l.alignPoint,i=l.className,o=l.autoDestroy,s=$.Children.only(n),d={key:"trigger"};this.isContextMenuToShow()?d.onContextMenu=this.onContextMenu:d.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(d.onClick=this.onClick,d.onMouseDown=this.onMouseDown,d.onTouchStart=this.onTouchStart):(d.onClick=this.createTwoChains("onClick"),d.onMouseDown=this.createTwoChains("onMouseDown"),d.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(d.onMouseEnter=this.onMouseEnter,r&&(d.onMouseMove=this.onMouseMove)):d.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?d.onMouseLeave=this.onMouseLeave:d.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(d.onFocus=this.onFocus,d.onBlur=this.onBlur):(d.onFocus=this.createTwoChains("onFocus"),d.onBlur=this.createTwoChains("onBlur"));var u=J.default(s&&s.props&&s.props.className,i);u&&(d.className=u);var c=Tt({},d);Dt(s)&&(c.ref=_t(this.triggerRef,s.ref));var f,p=$.cloneElement(s,c);return(t||this.popupRef.current||a)&&(f=$.createElement(e,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!t&&o&&(f=null),$.createElement(hs.Provider,{value:this.triggerContextValue},p,f)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var l=e.popupVisible,n={};return void 0!==l&&t.popupVisible!==l&&(n.popupVisible=l,n.prevPopupVisible=t.popupVisible),n}}]),n}();return St(t,"contextType",hs),St(t,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:vs,getDocument:ys,onPopupVisibleChange:gs,afterPopupVisibleChange:gs,onPopupAlign:gs,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1}),t}(zi);const Es=e=>{const{columns:t,onChange:n}=e,{prefixCls:a,$size:r}=q.default.useContext(ei),{t:i}=ot(),o=q.default.useRef([]),[s,u]=q.default.useState(!1),[c,f]=q.default.useState(t);Yl((()=>{m()}),[c]),q.default.useEffect((()=>{p()}),[t]);const p=()=>{const e=[];t.forEach(((l,n)=>{const a=l.colSpan;a>1&&t.slice(n+1,n+a).every((({colSpan:e})=>0===e))&&e.push(t.slice(n,n+a))})),o.current=e},m=()=>{const e=[];c.forEach((t=>{const{colSpan:l,dataIndex:n}=t;if(0===l)return;if(1===l)return e.push(t);const a=o.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(n)));if(-1===a)return e.push(t);e.push(...o.current[a].map((({dataIndex:e},l)=>{const n=c.find((t=>t.dataIndex===e));return l>0&&void 0!==t.hidden&&(n.hidden=t.hidden),n})))})),null==n||n(e)},h={[`${a}__popper`]:!0,"column-filter__popper":!0,[`${a}--lg`]:"large"===r,[`${a}--sm`]:"small"===r},v=[`${a}-column-filter`,{selected:s}];return q.default.createElement(xs,{action:["click"],popupVisible:s,popup:q.default.createElement("div",{className:"column-filter--wrap",style:{overflowY:"auto",maxHeight:"calc(100vh - 10px)"}},q.default.createElement("div",{className:"main"},q.default.createElement(I.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:c,setList:e=>{const t=e.map((e=>e.dataIndex)),n=c.map((e=>e.dataIndex));l.isEqual(t,n)||f(Ya(e))}},c.map((e=>((e,t)=>{const{colSpan:l}=e;if(0===l)return q.default.createElement("li",{key:e.dataIndex,style:{display:"none"}});const n=["svgicon","handle",`${t}-handle`];return q.default.createElement("li",{key:e.dataIndex,className:"item"},q.default.createElement(d.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:l}=t.target;e.hidden=!l,f([...c])}}),q.default.createElement("i",{className:J.default(n),title:i("qm.table.columnFilter.draggable")},q.default.createElement(g.HolderOutlined,null)),q.default.createElement("span",{className:"text"},ja(e.title)))})(e,"main")))))),popupClassName:J.default(h),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{u(e)},builtinPlacements:di,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement("span",{className:J.default(v),title:i("qm.table.columnFilter.text")},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.SettingOutlined,null)),q.default.createElement("span",null,i("qm.table.columnFilter.text"))))},Cs=e=>{const{defaultValue:t,onClose:l,onOk:n}=e,{tableRef:a,prefixCls:r,selectionKeys:i,pagination:o,showSummary:s}=q.default.useContext(ei),{rowSelection:d}=a.current.props,{t:u}=ot(),c=q.default.useRef(null),[f,p]=q.default.useState(!1),m=q.default.useMemo((()=>Object.assign({},{fileName:`${j.default().format(si)}.xlsx`,fileType:"xlsx",sheetName:"sheet1",exportType:i.length?"selected":"all","startIndex|endIndex":[1,o.total],footSummation:s?1:0,useStyle:0},t,{columns:qe(t.columns||[])})),[]),[h,g]=q.default.useState([{type:"INPUT",label:u("qm.table.export.fileName"),fieldName:"fileName"},{type:"SELECT",label:u("qm.table.export.fileType"),fieldName:"fileType",options:{itemList:[{text:"xlsx",value:"xlsx"},{text:"csv",value:"csv"}]}},{type:"INPUT",label:u("qm.table.export.sheetName"),fieldName:"sheetName"},{type:"RANGE_INPUT_NUMBER",fieldName:"startIndex|endIndex",label:{type:"SELECT",fieldName:"exportType",options:{itemList:[{text:u("qm.table.export.all"),value:"all"},{text:u("qm.table.export.selected"),value:"selected",disabled:"checkbox"!==(null==d?void 0:d.type)},{text:u("qm.table.export.custom"),value:"custom"}]},onChange:e=>{h.find((e=>"startIndex|endIndex"===e.fieldName)).disabled="custom"!==e,g([...h])}},options:{min:1},disabled:!0},{type:"INPUT",label:u("qm.table.columnFilter.text"),fieldName:"columns",render:(e,t)=>q.default.createElement(Es,{columns:t.state.formData.columns,onChange:e=>{t.SET_FIELDS_VALUE({columns:e})}})},{type:"CHECKBOX",label:u("qm.table.export.footSummation"),fieldName:"footSummation",disabled:!s,options:{trueValue:1,falseValue:0}},{type:"CHECKBOX",label:u("qm.table.export.useStyle"),fieldName:"useStyle",options:{trueValue:1,falseValue:0}}]);return q.default.createElement("div",{className:`${r}-export__setting`},q.default.createElement(ap,{ref:c,initialValues:m,items:h,cols:1,labelWidth:100}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(pt,{onClick:()=>l(),style:{marginRight:8}},u("qm.table.export.closeButton")),q.default.createElement(pt,{type:"primary",loading:f,onClick:()=>Ie(void 0,void 0,void 0,(function*(){const[e,t]=yield c.current.GET_FORM_DATA();if(!e){p(!0);for(const e in t)"footSummation"!==e&&"useStyle"!==e||(t[e]=!!t[e]);n(t),yield Ae(1e3),p(!1),l()}}))},u("qm.table.export.text"))))},ws=q.default.forwardRef(((e,t)=>{var n;const{tableColumns:a,open:r=!0}=e,{global:i}=q.default.useContext(xe),{tableRef:o,prefixCls:s,flattenColumns:u,pagination:c,fetchParams:f,isFetch:p,showSummary:m,getSpan:h}=q.default.useContext(ei),{exportExcel:v,columns:y,fetch:b,showHeader:x}=o.current.props,{t:E}=ot(),{getTitleFromCellValue:C}=Oi(),[w,S]=q.default.useState(!1),[N,T]=q.default.useState(!1),I=q.default.useMemo((()=>{var e;return!!(null===(e=null==v?void 0:v.fetch)||void 0===e?void 0:e.api)}),[v]),O=q.default.useMemo((()=>!c.total||N),[c.total,N]),R=q.default.useMemo((()=>{const e=Ea(y.filter((e=>!e.noAuth)),[bi.expandableColumn,bi.selectionColumn,bi.operationColumn]),t=[],l=[],n=[];return e.forEach((e=>{const r=a.find((t=>t.dataIndex===e.dataIndex));"left"===e.fixed?t.push(r||e):"right"===e.fixed?l.push(r||e):n.push(r||e)})),[...t,...n,...l]}),[a]),k=q.default.useMemo((()=>Ea(u,[bi.expandableColumn,bi.selectionColumn,bi.operationColumn])),[u]),L=(e,t="",l=0)=>e.map(((e,n)=>{const a=Object.assign(Object.assign({},e),{index:n,pageIndex:n}),r=t?`${t}.${a.index+1}`:`${a.index+1}`;return a.indexPath=r,a._level=l,Array.isArray(e.children)&&(a.children=L(e.children,r,l+1)),k.forEach((e=>{const{dataIndex:t}=e;"index"!==t&&"pageIndex"!==t&&"indexPath"!==t&&Aa(a,t,Pa(a,t))})),a})),P=(e,t)=>{const l={};return e.filter((e=>!!e.summation)).forEach((e=>{const{dataIndex:n}=e,a=t.reduce(((e,t)=>{if(null==t?void 0:t[bi.summaryIgnore])return e;const l=Number(Pa(t,n));return Number.isNaN(l)?e:e+l}),0);Aa(l,n,a)})),[l]},A=(e,t,l,n)=>{const{dataIndex:a,precision:r,formatType:i,outputRender:o}=l;if(o)return o(Pa(e,a),e,l,t,n);let s=C(e,l,t,n);return r>=0&&!i&&""!==s&&(s=Number(s)),s},{exportXLSX:F,exportCSV:_}=Hi(),D=e=>Ie(void 0,void 0,void 0,(function*(){var t;const{api:n,formatter:a=(e=>e),afterFetch:r,dataKey:i}=b;let o=[];try{T(!0);const s={[bi.currentPageName]:1,[bi.pageSizeName]:null!=e?e:c.total},d=yield n(Object.assign(Object.assign({},a(Object.assign(Object.assign({},f),s))),s));if(200===d.code){let e=Array.isArray(d.data)?d.data:null!==(t=l.get(d.data,i))&&void 0!==t?t:[];e="function"==typeof r?yield r(e):e,o=L(e)}}catch(e){}return T(!1),o})),M=e=>{var t;const l=null===(t=null==i?void 0:i.table)||void 0===t?void 0:t.recordExportLog;try{null==l||l({fileName:e})}catch(e){}},H=(e,t)=>{const{columns:l,footSummation:n}=e,a=pa(l);let r='<table width="100%" border="0" cellspacing="0" cellpadding="0">';return r+=`<colgroup>${a.map((({width:e,renderWidth:t})=>`<col style="width:${e||t}px">`)).join("")}</colgroup>`,x&&(r+=["<thead>","<tr>",a.map((e=>{const{rowSpan:t,colSpan:l}=e;return 0===l?null:`<th colspan="${l}" rowspan="${t}">${ja(e.title)}</th>`})).join(""),"</tr>","</thead>"].join("")),t.length&&(r+=`<tbody>${Ca(t).map((e=>`<tr>${a.map(((l,n)=>{var a;const{rowSpan:r,colSpan:i}=h(e,l,e.index,n,t);if(!r||!i)return null;const o=A(e,e.index,l,n);return`<td rowspan="${r}" colspan="${i}" data-type="${$(o,null===(a=l.filter)||void 0===a?void 0:a.type)}">${o}</td>`})).join("")}</tr>`)).join("")}</tbody>`),m&&n&&(r+=["<tfoot>",P(a,t).map((e=>`<tr>${a.map(((l,n)=>{const{dataIndex:a,summation:r}=l,i=(null==r?void 0:r.render)?r.render(t):Pa(e,a);return`<td>${0===n&&""===i?E("qm.table.config.summaryText"):Re(i)?ja(i):i}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),r+="</table>",r},$=(e,t)=>{const l={text:"string",textarea:"string",number:"number",date:"date"};return t&&l[t]?l[t]:typeof e},K=null!==(n=null==v?void 0:v.fileName)&&void 0!==n?n:`${j.default().format(si)}.xlsx`,V=K.slice(K.lastIndexOf(".")+1).toLowerCase(),z=()=>{if(O)return d.message.warning(E("qm.table.export.warnText"));var e;I?(e=K,Ie(void 0,void 0,void 0,(function*(){T(!0);try{const{api:t,params:l}=v.fetch,n=yield t(Object.assign(Object.assign(Object.assign({columns:k.map((e=>{const{title:t,dataIndex:l,hidden:n}=e,{type:a}=e.filter||{};return{title:t,dataIndex:l,type:a,hidden:n}}))},f),l),{tsortby:void 0,tsummary:void 0,tgroupby:void 0,[bi.currentPageName]:void 0,[bi.pageSizeName]:void 0}));n.data&&(Dn(n.data,e),M(e))}catch(e){}T(!1)}))):S(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:z})));const W={[`${s}-export`]:!0},B={visible:w,title:E("qm.table.export.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>S(!1)},U={fileName:K.slice(0,K.lastIndexOf(".")),fileType:V,columns:R,useStyle:(null==v?void 0:v.cellStyle)?1:0};return q.default.createElement(q.default.Fragment,null,r&&q.default.createElement("span",{className:J.default(W),title:E("qm.table.export.textNoSpace"),onClick:()=>z()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.DownloadOutlined,null))),q.default.createElement(Qn,B,q.default.createElement(Cs,{defaultValue:U,onClose:()=>S(!1),onOk:e=>{var t;t=Object.assign({},e,{columns:ma(e.columns)}),Ie(void 0,void 0,void 0,(function*(){const{fileName:e,fileType:l,exportType:n,startIndex:a=1,endIndex:r}=t,{tableFullData:i,selectionRows:s}=o.current;let d=[];if(p?("all"===n&&(d=yield D()),"custom"===n&&(d=yield D(r),d=d.slice(a-1))):("all"===n&&(d=i.slice(0)),"custom"===n&&(d=i.slice(a-1,r||void 0))),"selected"===n&&(d=s.slice(0).sort(((e,t)=>e.pageIndex-t.pageIndex))),"function"==typeof(null==v?void 0:v.beforeExport))try{d=null==v?void 0:v.beforeExport(d)}catch(e){}if("xlsx"===l){const l=yield F(t,d,P,A);Dn(l,`${e}.xlsx`),M(`${e}.xlsx`)}if("csv"===l){const l=_(t,H(t,d));Dn(l,`${e}.csv`),M(`${e}.csv`)}}))}})))}));ws.displayName="TableExport";const Ss=e=>{const{columns:t,onClose:l}=e,{tableRef:n,tableBodyRef:a,prefixCls:r,dataChange:i}=q.default.useContext(ei),{beforeClipboard:o}=n.current.props,{t:s}=ot(),u=q.default.useRef(null),[c,f]=q.default.useState([{type:"INPUT_NUMBER",label:s("qm.table.clipboard.rowIndex"),fieldName:"rowIndex",options:{min:1},extra:{labelWidth:50},rules:[{required:!0}]},{type:"SELECT",label:s("qm.table.clipboard.colIndex"),fieldName:"colIndex",options:{itemList:t.map(((e,t)=>({value:t,text:ja(e.title)})))},rules:[{required:!0}],extra:{labelWidth:50}},{type:"TEXT_AREA",label:s("qm.table.clipboard.content"),fieldName:"content",placeholder:s("qm.table.clipboard.placeholder"),options:{autoSize:{minRows:4}},rules:[{required:!0}]}]),[p,m]=q.default.useState(!1);return q.default.createElement("div",{className:`${r}-clipboard__setting`},q.default.createElement("h3",{className:"info"},s("qm.table.clipboard.supportText")),q.default.createElement(ap,{ref:u,initialValues:{},initialExtras:{rowIndex:"行",colIndex:"列"},items:c,cols:1,labelWidth:100}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(pt,{onClick:()=>l(),style:{marginRight:8}},s("qm.table.export.closeButton")),q.default.createElement(pt,{type:"primary",loading:p,onClick:()=>Ie(void 0,void 0,void 0,(function*(){var e;const[r,c]=yield u.current.GET_FORM_DATA();if(r)return;const{tableFullData:f,store:p,fieldAuth:h}=n.current;m(!0);const g=c.content.trim().replace(/(\r|\n)$/,"");let v=g.replace(/"[^"]+"/g,"^");((null===(e=g.match(/"[^"]+"/g))||void 0===e?void 0:e.map((e=>e.replace(/"/g,"").replace(/\r|\n/g," "))))||[]).forEach((e=>{v=v.replace(/\^/,e)}));let y=v.split(/\r|\n/).map((e=>e.split(/\t/)));if("function"==typeof o)try{y=yield o(y,y[0].map(((e,l)=>t[c.colIndex+l].dataIndex)))}catch(r){}y.forEach(((e,l)=>{e.forEach(((e,n)=>{var a,r;const i=f[c.rowIndex-1+l],o=t[c.colIndex+n];if(i&&o){let t=!1;if(o.editRender){const e=o.editRender(i,o);t=!(e.disabled||(null===(a=e.extra)||void 0===a?void 0:a.disabled)||(null===(r=h[o.dataIndex])||void 0===r?void 0:r.disabled))}t&&o.dictItems&&(t=o.dictItems.some((t=>t.value==e))),t&&(Aa(i,o.dataIndex,e),p.addToUpdated(i))}}))})),a.current.forceUpdate(),i(),d.message.success(s("qm.table.clipboard.success",{total:y.length})),m(!1),l()}))},s("qm.table.clipboard.text"))))},Ns=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{prefixCls:n,flattenColumns:a}=q.default.useContext(ei),{t:r}=ot(),[i,o]=q.default.useState(!1),s=q.default.useMemo((()=>(e=>e.filter((e=>![bi.expandableColumn,bi.selectionColumn,"index","pageIndex",bi.operationColumn].includes(e.dataIndex))))(a)),[a]),d=()=>{o(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:d})));const u={[`${n}-clipboard`]:!0},c={visible:i,title:r("qm.table.clipboard.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>o(!1)};return q.default.createElement(q.default.Fragment,null,l&&q.default.createElement("span",{className:J.default(u),title:r("qm.table.clipboard.textNoSpace"),onClick:()=>d()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.CopyOutlined,null))),q.default.createElement(Qn,c,q.default.createElement(Ss,{columns:s,onClose:()=>o(!1)})))}));Ns.displayName="TableClipboard";const Ts=e=>{const{columns:t,onClose:l}=e,{tableRef:n,$size:a,selectionKeys:r,setSelectionKeysEffect:i}=q.default.useContext(ei),{rowKey:o,rowSelection:s}=n.current.props,{t:d}=ot(),u=q.default.useRef(null),c=xn(u),f=e=>e.map((e=>{var t;const l={dataIndex:e.dataIndex,title:e.title,width:e.width,minWidth:e.minWidth,precision:e.precision,dictItems:null!==(t=e.dictItems)&&void 0!==t?t:[],render:e.render};return Array.isArray(e.children)&&(l.children=f(e.children)),l})),[p,m]=q.default.useState([{title:d("qm.table.groupSummary.index"),dataIndex:"index",width:80,render:e=>e+1},...f(t.filter((e=>![bi.expandableColumn,bi.selectionColumn,"index","pageIndex",bi.operationColumn].includes(e.dataIndex))))]),[h]=q.default.useState((()=>{const{disabled:e}=s||{},t=n.current.selectionRows.map((e=>Object.assign(Object.assign({},e),{children:void 0})));return e?t.filter((t=>!e(t))):t})()),[g,v]=q.default.useState(300),y=wn((()=>{const e=u.current;v(e.offsetHeight-2*Jr[a]-30)}),5);return Cn((()=>{y()}),[c.width]),q.default.createElement("div",{ref:u,style:{height:"100%"}},q.default.createElement(wc,{size:a,columns:p,dataSource:h,rowKey:o,height:g,rowSelection:{type:"checkbox",selectedRowKeys:r,onChange:e=>i(e)},webPagination:!0,ignorePageIndex:!0,showFastSearch:!1,showTableImport:!1,showSelectCollection:!1,showClipboard:!1,showFullScreen:!1,showColumnDefine:!1,columnsChange:e=>m(e)}),q.default.createElement("div",{style:{height:10}}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(pt,{onClick:()=>l()},d("qm.table.selectCollection.closeButton"))))},Is=q.default.forwardRef(((e,t)=>{const{columns:n,open:a=!0}=e,{tableRef:r,getRowKey:i,prefixCls:o,selectionKeys:s,isFetch:d,isTableEmpty:u,setSelectionKeysEffect:c,setSelectionRows:f}=q.default.useContext(ei),{rowSelection:p}=r.current.props,{t:m}=ot(),[h,v]=q.default.useState(!1),y=q.default.useRef(!1);Yl((()=>{!y.current&&b()}),[u]);const b=()=>Ie(void 0,void 0,void 0,(function*(){var e;const{fetchSelectedRows:t,disabled:n=(e=>!1)}=p;if(d&&t)try{const a=yield t.api(Object.assign({},{selectedKeys:s},t.params));if(200===a.code){let r=Array.isArray(a.data)?a.data:null!==(e=l.get(a.data,t.dataKey))&&void 0!==e?e:[];r=r.filter((e=>!n(e))),c(r.map(((e,t)=>i(e,t)))),f(r),y.current=!0}}catch(e){}})),x=()=>{v(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:x})));const E={visible:h,title:m("qm.table.selectCollection.settingTitle"),loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>v(!1)};return q.default.createElement(q.default.Fragment,null,a&&q.default.createElement("span",{className:`${o}-select-collection`,title:m("qm.table.selectCollection.text"),onClick:()=>x()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.CheckSquareOutlined,null))),q.default.createElement(Qn,E,q.default.createElement(Ts,{columns:n,onClose:()=>v(!1)})))}));Is.displayName="SelectCollection";const Os=e=>{const{onClose:t}=e,{global:l}=q.default.useContext(xe),{tableRef:n,getRowKey:a,prefixCls:r,$size:i,tableFlatData:o,flattenColumns:s,setActivedCell:u,scrollXToColumn:c,scrollYToRecord:f}=q.default.useContext(ei),{uniqueKey:p}=n.current.props,{t:m}=ot(),{getTitleFromCellValue:h}=Oi(),v=q.default.useRef(""),[y,b]=q.default.useState(""),[x,E]=q.default.useState([]),[C,w]=q.default.useState(0),[S,N]=q.default.useState(!1),[T,I]=q.default.useState({case:0,fullchar:0}),O=q.default.useMemo((()=>`${x.length>0?C+1:C}/${x.length}`),[C,x]);Yl((()=>{A(x[C])}),[C,x]);const R=e=>{I(Object.assign({},T,e))},k=(e,t,l)=>new Promise(((n,a)=>{d.Modal.confirm({title:m("qm.button.confirmPrompt"),content:e,onOk:()=>{t(),n()},onCancel:()=>{l(),n()}})})),L=st((e=>Ie(void 0,void 0,void 0,(function*(){if(!y)return v.current=y,P();const t=((e,t)=>{const l=new RegExp(T.fullchar?`^${t}$`:t,T.case?"":"i"),n=[];return e.forEach(((e,t)=>{s.forEach(((r,i)=>{const{dataIndex:o}=r;if([bi.expandableColumn,bi.selectionColumn,"index","pageIndex",bi.operationColumn].includes(o))return;const s=h(e,r,e.index,i);l.test(s)&&n.push({value:s,rowKey:a(e,e.index),dataIndex:o,rowIndex:t,colIndex:i})}))})),n})(o,y);if(!t.length)return d.Modal.warning({title:m("qm.button.confirmPrompt"),content:m("qm.table.fastSearch.notMatch")});if(E(t),"all"===e&&N(!0),y!==v.current)return v.current=y,w(0);if("next"===e){const e=C+1;e>t.length-1?yield k(m("qm.table.fastSearch.toTheEnd"),(()=>w(0)),(()=>{})):w(e)}if("prev"===e){const e=C-1;e<0?yield k(m("qm.table.fastSearch.toStart"),(()=>w(t.length-1)),(()=>{})):w(e)}})))),P=()=>{w(0),E([]),u({})},A=e=>{e&&(f(e.rowKey),c(e.dataIndex),u(e))},F=q.default.useMemo((()=>p?`fastSearch_${p}`:""),[p]),[_,D]=q.default.useState([]),[M,H]=q.default.useState(""),[$,j]=q.default.useState("");Yl((()=>{if($){const{input:e,config:t}=_.find((e=>e.value===$)).condition;b(e),I(t),setTimeout((()=>L()))}}),[$]),q.default.useEffect((()=>{K()}),[]);const K=()=>Ie(void 0,void 0,void 0,(function*(){if(!F)return;let e=yield pe.default.getItem(F);e||(e=yield V(F),Array.isArray(e)&&(yield pe.default.setItem(F,e))),Array.isArray(e)&&e.length&&D(e)})),V=e=>Ie(void 0,void 0,void 0,(function*(){const t=null==l?void 0:l.getComponentConfigApi;if(t)try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),z=(e,t)=>Ie(void 0,void 0,void 0,(function*(){const n=null==l?void 0:l.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}}));return q.default.createElement("div",{className:`${r}-fast-search__setting`},q.default.createElement("div",{className:"main"},q.default.createElement("div",{className:"container"},q.default.createElement("div",{className:"search-box"},q.default.createElement("span",{className:"label"},m("qm.table.fastSearch.queryLabel"),":"),q.default.createElement(d.Input,{value:y,placeholder:m("qm.table.fastSearch.queryCondition"),allowClear:!0,style:{flex:"auto",width:"auto"},onChange:e=>b(e.target.value)})),q.default.createElement("div",{className:"condition"},q.default.createElement(d.Checkbox,{checked:!!T.case,onChange:e=>R({case:e.target.checked})},m("qm.table.fastSearch.matchCase")),q.default.createElement(d.Checkbox,{checked:!!T.fullchar,onChange:e=>R({fullchar:e.target.checked})},m("qm.table.fastSearch.matchFullchar"))),q.default.createElement("div",{className:"all-list"},S&&q.default.createElement("table",{className:"rtable",tabIndex:-1,cellSpacing:"0",cellPadding:"0"},q.default.createElement("thead",null,q.default.createElement("tr",null,q.default.createElement("th",{style:{width:40,minWidth:40}},"#"),q.default.createElement("th",{style:{width:130,minWidth:130}},m("qm.table.fastSearch.cellText")),q.default.createElement("th",null,m("qm.table.fastSearch.valText")))),q.default.createElement("tbody",null,x.map(((e,t)=>q.default.createElement("tr",{key:t,className:J.default({active:C===t}),onClick:()=>w(t)},q.default.createElement("td",null,t+1),q.default.createElement("td",null,"Row:",e.rowIndex+1,", Col:",e.colIndex+1),q.default.createElement("td",null,e.value)))))))),q.default.createElement("div",{className:"saved line"},q.default.createElement("div",{className:"form-wrap"},q.default.createElement(d.Input,{size:i,value:M,placeholder:m("qm.table.highSearch.configText"),disabled:!y,onChange:e=>{const{value:t}=e.target;H(t)}}),q.default.createElement(pt,{type:"primary",disabled:!M||!y,style:{marginLeft:"10px"},onClick:()=>Ie(void 0,void 0,void 0,(function*(){if(!F)return ft("Table","必须设置组件参数 `uniqueKey` 才能保存");if(!y)return;const e=$a(),t=[..._,{text:M,value:e,condition:{input:y,config:T}}];D(t),H(""),yield pe.default.setItem(F,t),yield z(F,t)}))},m("qm.table.highSearch.saveButton"))),q.default.createElement("div",{className:"card-wrap"},q.default.createElement("h5",{style:{height:`${bi.rowHeightMaps[i]}px`}},q.default.createElement("span",null,m("qm.table.fastSearch.savedSetting"))),q.default.createElement("ul",null,_.map((e=>q.default.createElement("li",{key:e.value,className:J.default({selected:e.value===$}),title:e.text,onClick:()=>{return t=e.value,void j(t!==$?t:"");var t}},q.default.createElement("span",{className:"title"},e.text),q.default.createElement("i",{className:"svgicon close",title:m("qm.table.highSearch.removeText"),onClick:t=>{var l;t.stopPropagation(),l=e.value,Ie(void 0,void 0,void 0,(function*(){if(!l)return;const e=_.filter((e=>e.value!==l));D(e),yield pe.default.setItem(F,e),yield z(F,e)}))}},q.default.createElement(g.CloseCircleOutlined,null))))),!_.length&&q.default.createElement("div",{style:{padding:ni}},q.default.createElement(pn,null)))))),q.default.createElement("div",{className:"bottom-bar",style:{position:"absolute",left:0,bottom:0,right:0,height:`${Jr[i]+20}px`,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",boxSizing:"border-box"}},q.default.createElement("div",null,m("qm.table.fastSearch.findTotal",{total:O})),q.default.createElement("div",null,q.default.createElement(pt,{onClick:()=>L("all"),style:{marginRight:8}},m("qm.table.fastSearch.queryAll")),q.default.createElement(pt,{type:"primary",onClick:()=>L("prev"),style:{marginRight:8}},m("qm.table.fastSearch.queryPrev")),q.default.createElement(pt,{type:"primary",onClick:()=>L("next"),style:{marginRight:8}},m("qm.table.fastSearch.queryNext")),q.default.createElement(pt,{onClick:()=>t()},m("qm.table.fastSearch.closeButton")))))},Rs=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{prefixCls:n,$size:a}=q.default.useContext(ei),{t:r}=ot(),[i,o]=q.default.useState(!1),s=()=>{o(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:s})));const d={visible:i,title:r("qm.table.fastSearch.settingTitle"),width:650,loading:!1,bodyStyle:{paddingBottom:`${Jr[a]+20}px`},onClose:()=>o(!1)};return q.default.createElement(q.default.Fragment,null,l&&q.default.createElement("span",{className:`${n}-super-search`,title:r("qm.table.fastSearch.text"),onClick:()=>s()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.MonitorOutlined,null))),q.default.createElement(Qn,d,q.default.createElement(Os,{onClose:()=>o(!1)})))}));Rs.displayName="FastSearch";var ks={selectionColumnDefine:{title:"",dataIndex:"__selection__",width:60,fixed:"left"},indentWidth:16,groupMargin:15,separator:"^"};const Ls=e=>[ks.selectionColumnDefine,...e].filter((e=>!e.hidden)),Ps=e=>e.some((e=>Array.isArray(e.children))),As=e=>void 0!==e._groupLevel,Fs=(e,t)=>t.split(ks.separator).reduce(((e,t)=>null==e?void 0:e[t]),e),_s=e=>Array.isArray(e)?0:"object"==typeof e&&null!==e?1+Math.max(0,...Object.values(e).map(_s)):0,Ds=(e,t="")=>Array.isArray(e)?[]:Object.keys(e).reduce(((l,n)=>{const a=t?`${t}${ks.separator}${n}`:n;if(l.push(a),Array.isArray(e[n]))return l;const r=Ds(e[n],a);return l.concat(r)}),[]),Ms=(e,t=[],l)=>{const n=(e,t)=>{if(0===t.length)return e;const[{[Object.keys(t[0])[0]]:a}]=t,r=Object.keys(t[0])[0],i=t.slice(1),o=Object.groupBy(e,(e=>l(e,r))),s=Object.keys(o).sort(((e,t)=>{const l=(n=e,r=t,Number.isNaN(n-r)?n.toString().localeCompare(r.toString()):n-r);var n,r;return"ascend"===a?l:-l})),d={};return s.forEach((e=>{d[`#${e}`]=n(o[e],i)})),d};return n(e,t)},Hs={sum:e=>e.reduce(((e,t)=>isNaN(Number(t))?e:e+Number(t)),0),avg:e=>e.length?(e.reduce(((e,t)=>isNaN(Number(t))?e:e+Number(t)),0)/e.length).toFixed(2):"",max:e=>e.length?Math.max(...e):"",min:e=>e.length?Math.min(...e):"",count:e=>e.length,unique:e=>new Set(e).size,empty:e=>e.filter((e=>De(e))).length,notEmpty:e=>e.filter((e=>!De(e))).length},qs=q.default.createContext(void 0),$s=e=>{const{prefixCls:t,pivotProps:l,size:n,getRowKey:a,flatColumns:r,tableData:i}=e,{initialGroup:o,initialCount:s,initialFilter:d,initialSorter:u}=l,c=e=>{const t=new Map;return Ca(e).forEach((e=>t.set(a(e,e.index),e))),t},f=q.default.useRef({props:l,originGridData:i,flatGroupData:[],isTree:Ps(i),keyRecordMap:c(i)}),[p,m]=q.default.useState({pivotRef:f,prefixCls:t,size:n,viewMode:"table",columns:r,gridData:i,groupGridData:[],groupList:o?(e=>{const t=[],l=r.map((e=>e.dataIndex));return e.forEach((e=>{l.includes(e.fieldName)&&["ascend","descend"].includes(e.order)&&t.push(e)})),t})(o):[],filterList:d?(e=>{const t=[],l=r.map((e=>e.dataIndex));for(const n in e){const[a,r]=n.split("|");if(l.includes(a)&&r){const l=e[n]||{};Object.keys(l).forEach((e=>{t.push({type:r,bracketLeft:"",fieldName:a,expression:e,value:Za(e)?null:l[e],bracketRight:"",logic:"and"})}))}}return t})(d):[],sorterList:u?(e=>{const t=[],l=r.map((e=>e.dataIndex));for(const n in e)l.includes(n)&&["ascend","descend"].includes(e[n])&&t.push({fieldName:n,order:e[n]});return t})(u):[],colorList:[],expandedKeys:[],searchResults:[],switchIndex:0,fillColorCells:new Map,countMethod:s?(e=>{const t=["count","unique","empty","notEmpty","sum","max","min","avg"],l=r.map((e=>e.dataIndex)),n={};for(const a in e)l.includes(a)&&t.includes(e[a])&&(n[a]=e[a]);return n})(s):{},summationData:{}}),h=e=>{m((t=>{const l=Object.assign({},t);let n=!1;return Object.keys(e).forEach((a=>{const r=a;Object.is(t[r],e[r])||(l[r]=e[r],n=!0)})),n?l:t}))};Cn((()=>{y(i),g("originGridData",i),g("isTree",Ps(i)),g("keyRecordMap",c(i))}),[i]),Cn((()=>{v(r)}),[r]),Cn((()=>{h({size:n})}),[n]);const g=(e,t)=>{p.pivotRef.current[e]=t};g("props",l);const v=e=>{h({columns:e})},y=e=>{h({gridData:e})},b=e=>{h({groupGridData:e})},x=e=>{h({groupList:e})},E=e=>{h({filterList:e})},C=e=>{h({sorterList:e})},w=e=>{h({colorList:e})},S=e=>{h({expandedKeys:e})},N=e=>{h({searchResults:e})},T=e=>{h({switchIndex:e})},I=e=>{const t=new Map;e.forEach((e=>t.set(`${e.rowKey}|${e.dataIndex}`,e.color))),h({fillColorCells:t})},O=e=>{var t;h({countMethod:(t=Object.assign({},p.countMethod,e),Object.fromEntries(Object.entries(t).filter((([e,t])=>void 0!==t))))})},R=e=>{h({summationData:e})},k=q.default.useMemo((()=>Object.assign(Object.assign({},p),{setContext:h,getRowKey:a,setPivotGridRef:g,setColumns:v,setGridData:y,setGroupGridData:b,setGroupList:x,setFilterList:E,setSorterList:C,setColorList:w,setExpandedKeys:S,setSearchResults:N,setSwitchIndex:T,setFillColor:I,setCountMethod:O,setSummationData:R})),[p]);return q.default.createElement(qs.Provider,{value:k},e.children)},js=()=>q.default.useContext(qs),Ks=()=>{const{prefixCls:e,pivotRef:t,groupList:n,columns:a,gridData:r,setGroupList:i,setExpandedKeys:o,setGroupGridData:s,setPivotGridRef:u}=js(),{originGridData:c}=t.current,{onGroupChange:f,onDataChange:p}=t.current.props,{t:m}=ot(),h=q.default.useRef([]),v=q.default.useRef([]),y=q.default.useMemo((()=>n.filter((e=>e.fieldName&&e.order))),[n]),b=q.default.useMemo((()=>a.filter((e=>![bi.operationColumn].includes(e.dataIndex))).map((e=>({label:ja(e.title),value:e.dataIndex,disabled:n.some((t=>t.fieldName===e.dataIndex))})))),[n,a]),x=q.default.useMemo((()=>{const e=y.map((e=>({[e.fieldName]:e.order})));return l.isEqual(e,h.current)?h.current:(h.current=e,e)}),[y]),E=[{label:m("qm.pivotGrid.group.ascend"),value:"ascend"},{label:m("qm.pivotGrid.group.descend"),value:"descend"}];q.default.useEffect((()=>{o(v.current)}),[x,c]),q.default.useLayoutEffect((()=>{const e=Ms(r,x,((e,t)=>{let n=Pa(e,t);return l.isPlainObject(n)&&(n=Object.values(n)),Array.isArray(n)&&(n=n.join(",")),De(n)?m("qm.pivotGrid.group.empty"):n}));var t;s(e),t=Ds(e),v.current=t,u("flatGroupData",((e,t=[])=>{const l=[];return function e(n,a,r=""){if(Array.isArray(n))n.forEach(((e,t)=>{e._varIndex=t,r?e._parentRowKey=r:delete e._parentRowKey})),l.push(...Ca(n));else for(const i in n){const o=r?`${r}${ks.separator}${i}`:i,s=Object.keys(t[a])[0];l.push({id:o,_fieldName:s,_groupLevel:a}),e(n[i],a+1,o)}}(e,0),l})(e,x))}),[x,r]),Yl((()=>{null==f||f(y)}),[x]),Yl((()=>{null==p||p(r)}),[r]);const C=()=>{i([...n,{fieldName:"",order:"ascend"}])},w=(e,t,l)=>{Object.assign(t,{[e]:l}),i([...n])},S=e=>q.default.createElement(q.default.Fragment,null,q.default.createElement(g.HolderOutlined,{className:"icon handle"}),q.default.createElement(d.Select,{value:e.fieldName||void 0,placeholder:m("qm.table.editable.selectPlaceholder"),options:b,style:{width:160,margin:"0 10px"},onChange:t=>w("fieldName",e,t)}),q.default.createElement(d.Select,{value:e.order,options:E,placeholder:m("qm.table.editable.selectPlaceholder"),style:{width:100},onChange:t=>w("order",e,t)}),q.default.createElement(g.CloseOutlined,{className:"icon close",onClick:()=>(e=>{i(n.filter((t=>t!==e)))})(e)}));return q.default.createElement(d.Dropdown,{trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container")},q.default.createElement("div",{className:"label"},q.default.createElement("span",null,m("qm.pivotGrid.group.title")),!!y.length&&q.default.createElement("div",null,q.default.createElement("button",{className:"button-icon no-hover-bg",onClick:()=>o([])},m("qm.pivotGrid.group.foldAll")),q.default.createElement("button",{className:"button-icon no-hover-bg",onClick:()=>o(v.current)},m("qm.pivotGrid.group.unfoldAll")))),q.default.createElement("div",{className:"list"},q.default.createElement(I.ReactSortable,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:n,setList:e=>{const t=e.map((e=>e.fieldName)),a=n.map((e=>e.fieldName));l.isEqual(t,a)||i(e)}},n.map(((e,t)=>q.default.createElement("li",{key:`${e.fieldName}-${t}`,className:"item"},S(e)))))),q.default.createElement("div",{className:"add-record"},q.default.createElement("span",{className:"insert",onClick:C},q.default.createElement(g.PlusOutlined,{className:"icon"}),m("qm.pivotGrid.fillColor.add")))),className:J.default("action-btn",{active:!!y.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},q.default.createElement("span",null,q.default.createElement(g.FolderOpenOutlined,{className:"icon"}),m("qm.pivotGrid.group.text"),y.length?`(${y.length})`:null))},Vs=()=>{const{prefixCls:e,pivotRef:t,columns:n,filterList:a,setFilterList:r,setGridData:i}=js(),{originGridData:o,isTree:s}=t.current,{onFilterChange:u}=t.current.props,{t:c}=ot(),f=q.default.useRef([]),p=q.default.useMemo((()=>a.filter((e=>e.fieldName&&(Za(e.expression)||!De(e.value))))),[a]),m=q.default.useMemo((()=>n.filter((e=>![bi.operationColumn].includes(e.dataIndex))).map((e=>({label:ja(e.title),value:e.dataIndex})))),[n]),[h,v]=q.default.useState("and"),y=q.default.useMemo((()=>{const e=p.map((e=>{var t;return`${e.fieldName},${e.expression},${null!==(t=e.value)&&void 0!==t?t:""}`}));return l.isEqual(e,f.current)?f.current:(f.current=e,e)}),[p]);Yl((()=>{r(a.map((e=>Object.assign(Object.assign({},e),{logic:h}))))}),[h]),Yl((()=>{x(),null==u||u(p)}),[y]),q.default.useEffect((()=>{p.length&&b()}),[]);const b=()=>{const e=Va(p.map((e=>Object.assign(Object.assign({},He(e,["value"])),{condition:e.value}))));i(e?fa(o,e,s):o)},x=wn(b,200),E=[{label:c("qm.pivotGrid.filter.matchAll"),value:"and"},{label:c("qm.pivotGrid.filter.matchAny"),value:"or"}],C=()=>{r([...a,{type:"",bracketLeft:"",fieldName:"",expression:"",value:null,bracketRight:"",logic:h}])},w=(e,t,l)=>{var i;if(Object.assign(t,{[e]:l}),"fieldName"===e){const e=(null===(i=n.find((e=>e.dataIndex===l)).filter)||void 0===i?void 0:i.type)||"text";Object.assign(t,{type:e,expression:N(e)[0].value,value:""})}"expression"===e&&Za(l)&&Object.assign(t,{value:""}),r([...a])},S=e=>q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Select,{value:e.fieldName||void 0,options:m,placeholder:c("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>w("fieldName",e,t)}),q.default.createElement(d.Select,{value:e.expression||void 0,placeholder:c("qm.table.editable.selectPlaceholder"),options:N(e.type),style:{width:100,margin:"0 10px"},onChange:t=>w("expression",e,t)}),T(e),q.default.createElement(g.CloseOutlined,{className:"icon close",onClick:()=>(e=>{r(a.filter((t=>t!==e)))})(e)})),N=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",label:c("qm.table.highSearch.gtText")},{value:"<",label:c("qm.table.highSearch.ltText")},{value:">=",label:c("qm.table.highSearch.gteText")},{value:"<=",label:c("qm.table.highSearch.lteText")},{value:"==",label:c("qm.table.highSearch.eqText")},{value:"!=",label:c("qm.table.highSearch.neqText")},{value:"nil",label:c("qm.table.highSearch.nullText")},{value:"nnil",label:c("qm.table.highSearch.notNullText")}];break;case"checkbox":case"radio":case"tree":t=[{value:"in",label:c("qm.table.highSearch.inText")},{value:"nin",label:c("qm.table.highSearch.ninText")},{value:"==",label:c("qm.table.highSearch.eqText")},{value:"!=",label:c("qm.table.highSearch.neqText")},{value:"nil",label:c("qm.table.highSearch.nullText")},{value:"nnil",label:c("qm.table.highSearch.notNullText")}];break;default:t=[{value:"like",label:c("qm.table.highSearch.inText")},{value:"nlike",label:c("qm.table.highSearch.ninText")},{value:"==",label:c("qm.table.highSearch.eqText")},{value:"!=",label:c("qm.table.highSearch.neqText")},{value:"^=",label:c("qm.table.highSearch.startsWithText")},{value:"=$",label:c("qm.table.highSearch.endsWithText")},{value:"nil",label:c("qm.table.highSearch.nullText")},{value:"nnil",label:c("qm.table.highSearch.notNullText")}]}return t},T=e=>{var t,l;switch(e.type){case"number":return q.default.createElement(d.InputNumber,{defaultValue:e.value,style:{width:150},onChange:t=>{w("value",e,De(t)?"":t)}});case"date":return q.default.createElement(et,{popupClassName:bi.popupClassName,defaultValue:null!==(t=Ha(e.value,"YYYY-MM-DD"))&&void 0!==t?t:void 0,picker:"date",allowClear:!0,style:{width:150},onChange:t=>{w("value",e,qa(t,"YYYY-MM-DD"))}});case"checkbox":case"radio":{const t=(null===(l=n.find((t=>t.dataIndex===e.fieldName)))||void 0===l?void 0:l.dictItems)||[];return q.default.createElement(d.Select,{mode:"checkbox"===e.type?"multiple":void 0,defaultValue:e.value||void 0,placeholder:c("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>{w("value",e,t)}},t.map((e=>q.default.createElement(d.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))}default:return q.default.createElement(d.Input,{value:e.value,style:{width:150},disabled:Za(e.expression),onChange:t=>{w("value",e,t.target.value)}})}};return q.default.createElement(d.Dropdown,{trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container")},q.default.createElement("div",{className:"label"},q.default.createElement("span",null,c("qm.pivotGrid.filter.title")),!!p.length&&q.default.createElement(d.Select,{value:h,options:E,style:{width:130},onChange:e=>v(e)})),q.default.createElement("div",{className:"list"},a.map(((e,t)=>q.default.createElement("li",{key:`${e.fieldName}-${t}`,className:"item"},S(e))))),q.default.createElement("div",{className:"add-record"},q.default.createElement("span",{className:"insert",onClick:C},q.default.createElement(g.PlusOutlined,{className:"icon"}),c("qm.pivotGrid.fillColor.add")))),className:J.default("action-btn",{active:!!p.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},q.default.createElement("span",null,q.default.createElement(g.FilterOutlined,{className:"icon"}),c("qm.pivotGrid.filter.text"),p.length?`(${p.length})`:null))},zs=()=>{const{prefixCls:e,pivotRef:t,columns:n,gridData:a,sorterList:r,setSorterList:i,setGridData:o}=js(),{onSorterChange:s}=t.current.props,{t:u}=ot(),c=q.default.useMemo((()=>r.filter((e=>e.fieldName&&e.order))),[r]),f=q.default.useMemo((()=>n.filter((e=>![bi.operationColumn].includes(e.dataIndex))).map((e=>({label:ja(e.title),value:e.dataIndex,disabled:r.some((t=>t.fieldName===e.dataIndex))})))),[r,n]);Yl((()=>{h(),null==s||s(c)}),[q.default.useMemo((()=>c.map((e=>Object.values(e).join(":"))).join(",")),[c])]),q.default.useLayoutEffect((()=>{c.length&&h()}),[]);const p=[{label:u("qm.pivotGrid.sorter.ascend"),value:"ascend"},{label:u("qm.pivotGrid.sorter.descend"),value:"descend"}],m=(e,t)=>"number"==typeof e&&"number"==typeof t?e-t:"string"==typeof e&&"string"==typeof t?e.localeCompare(t):e instanceof Date&&t instanceof Date?e.getTime()-t.getTime():0,h=()=>{var e,t;o((e=a,(t=c).length||(t=[{fieldName:"index",order:"ascend"}]),e.sort(((e,l)=>{for(const n of t){const{fieldName:t,order:a}=n,r=Pa(e,t),i=Pa(l,t),o=m(r,i);if(0!==o)return"ascend"===a?o:-o}return 0})).slice(0)))},v=()=>{i([...r,{fieldName:"",order:"ascend"}])},y=(e,t,l)=>{Object.assign(t,{[e]:l}),i([...r])},b=e=>q.default.createElement(q.default.Fragment,null,q.default.createElement(g.HolderOutlined,{className:"icon handle"}),q.default.createElement(d.Select,{value:e.fieldName||void 0,placeholder:u("qm.table.editable.selectPlaceholder"),options:f,style:{width:160,margin:"0 10px"},onChange:t=>y("fieldName",e,t)}),q.default.createElement(d.Select,{value:e.order,options:p,placeholder:u("qm.table.editable.selectPlaceholder"),style:{width:100},onChange:t=>y("order",e,t)}),q.default.createElement(g.CloseOutlined,{className:"icon close",onClick:()=>(e=>{i(r.filter((t=>t!==e)))})(e)}));return q.default.createElement(d.Dropdown,{trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container")},q.default.createElement("div",{className:"label"},q.default.createElement("span",null,u("qm.pivotGrid.sorter.title"))),q.default.createElement("div",{className:"list"},q.default.createElement(I.ReactSortable,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:r,setList:e=>{const t=e.map((e=>e.fieldName)),n=r.map((e=>e.fieldName));l.isEqual(t,n)||i(e)}},r.map(((e,t)=>q.default.createElement("li",{key:`${e.fieldName}-${t}`,className:"item"},b(e)))))),q.default.createElement("div",{className:"add-record"},q.default.createElement("span",{className:"insert",onClick:v},q.default.createElement(g.PlusOutlined,{className:"icon"}),u("qm.pivotGrid.fillColor.add")))),className:J.default("action-btn",{active:!!c.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},q.default.createElement("span",null,q.default.createElement(g.SortAscendingOutlined,{className:"icon"}),u("qm.pivotGrid.sorter.text"),c.length?`(${c.length})`:null))},Ws=()=>{const{prefixCls:e,getRowKey:t,gridData:l,columns:n,searchResults:a,switchIndex:r,setSearchResults:i,setSwitchIndex:o}=js(),{t:s}=ot(),{getTitleFromCellValue:u}=Oi(),[c,f]=q.default.useState(!1),p=q.default.useMemo((()=>a.length),[a]);Yl((()=>{c||setTimeout((()=>{o(0),i([])}),200)}),[c]);const m=(e,l)=>{const a=[];return e.forEach(((e,r)=>{n.forEach(((n,i)=>{const o=u(e,n,r,i)+"";o.includes(l)&&a.push({value:o,rowKey:t(e,e.index),dataIndex:n.dataIndex})})),Array.isArray(e.children)&&a.push(...m(e.children,l))})),a},h=wn((e=>{const t=e.target.value.trim();o(0),i(t?m(l,t):[])}),200),v=e=>{const{keyCode:t}=e;e.preventDefault(),13===t&&y()},y=()=>{if(!p)return;o((r+1)%p)},b=()=>q.default.createElement("div",{className:"search-switch"},q.default.createElement("button",{className:"button-icon",onClick:()=>(()=>{if(!p)return;o((r-1+p)%p)})()},q.default.createElement(g.LeftOutlined,null)),q.default.createElement("span",{className:"num"},p>0?r+1:r,"/",p),q.default.createElement("button",{className:"button-icon",onClick:()=>y()},q.default.createElement(g.RightOutlined,null)));return q.default.createElement(d.Dropdown,{open:c,trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container")},q.default.createElement("div",{className:"label"},q.default.createElement("span",null,s("qm.pivotGrid.search.title")),q.default.createElement("button",{className:"button-icon",onClick:()=>f(!1)},q.default.createElement(g.CloseOutlined,null))),q.default.createElement("div",{className:"list search",style:{margin:"10px 0"}},q.default.createElement(d.Input,{autoFocus:!0,style:{width:280},suffix:b(),onChange:h,onKeyUp:v}))),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300},destroyPopupOnHide:!0},q.default.createElement("span",{onClick:()=>f(!c)},q.default.createElement(g.MonitorOutlined,{className:"icon"}),s("qm.pivotGrid.search.text")))},Bs=(e,t)=>e.map((e=>(e.children&&(e.children=Bs(e.children,t)),t(e)))),Us=()=>{const{prefixCls:e,pivotRef:t,columns:n,setColumns:a}=js(),{uniqueKey:r,onColumnsChange:i}=t.current.props,{t:o}=ot(),s=q.default.useMemo((()=>r?`grid_field_${r}`:""),[r]);q.default.useLayoutEffect((()=>{u()}),[]),Yl((()=>{f(n)}),[n]);const u=()=>{const e=p();e&&(null==i||i(e))},c=e=>e.map((e=>{const t={};return Array.isArray(e.children)&&(t.children=c(e.children)),void 0!==e.hidden&&(t.hidden=e.hidden),void 0!==e.fixed&&(t.fixed=e.fixed),void 0!==e.width&&(t.width=e.width),void 0!==e.renderWidth&&(t.renderWidth=e.renderWidth),Object.assign({dataIndex:e.dataIndex},t)})),f=e=>{if(!s)return;const t=c(e),n=JSON.parse(localStorage.getItem(s));l.isEqual(t,n)||localStorage.setItem(s,JSON.stringify(t))},p=()=>{if(!s)return;const e=JSON.parse(localStorage.getItem(s));if(!e)return;return l.xor(e.map((e=>e.dataIndex)),n.map((e=>e.dataIndex))).length>0?Bs(n,(t=>{const l=e.find((e=>e.dataIndex===t.dataIndex));return l&&(void 0!==l.hidden&&(t.hidden=l.hidden),void 0!==l.fixed&&(t.fixed=l.fixed),void 0!==l.width&&(t.width=l.width),void 0!==l.renderWidth&&(t.renderWidth=l.renderWidth)),t})):Bs(e,(e=>{const t=n.find((t=>t.dataIndex===e.dataIndex));return t&&void 0===e.fixed&&delete t.fixed,Object.assign({},t,e)}))},m=q.default.useMemo((()=>{let e=0;for(let t=0;t<n.length-1&&("left"!==n[t].fixed||n[t+1].fixed||(e=t+1),!(e>0));t++);const t=[];for(let l=0;l<n.length;l++)l===e&&t.push({title:"",dataIndex:"__divider__"}),t.push(n[l]);return t}),[n]),h=()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container","scroll-y"),style:{padding:5}},q.default.createElement("div",{className:"label",style:{padding:"6px 15px 10px"}},q.default.createElement("span",null,o("qm.pivotGrid.field.title"))),q.default.createElement("div",{className:"list"},q.default.createElement(I.ReactSortable,{itemKey:"dataIndex",handle:".handle",tag:"ul",animation:200,list:m,setList:e=>{const t=e.map((e=>e.dataIndex)),n=m.map((e=>e.dataIndex));l.isEqual(t,n)||(e=>{const t=e.findIndex((e=>"__divider__"===e.dataIndex)),l=[];for(let n=0;n<e.length;n++){const a=e[n];n<t?a.fixed="left":delete a.fixed,n!==t&&l.push(a)}i?i(l):a(l)})(Ya(e))}},m.map((e=>"__divider__"!==e.dataIndex?q.default.createElement("li",{key:e.dataIndex,className:"ant-dropdown-menu-item sort-item"},q.default.createElement(g.HolderOutlined,{className:"handle"}),q.default.createElement("span",{className:"label"},q.default.createElement("span",{className:"title"},ja(e.title)),q.default.createElement("button",{className:"button-icon",onClick:()=>(e=>{e.hidden=!e.hidden;const t=[...n];i?i(t):a(t)})(e)},e.hidden?q.default.createElement(g.EyeInvisibleOutlined,null):q.default.createElement(g.EyeOutlined,null)))):q.default.createElement("li",{key:e.dataIndex,className:"divider"}))))));return q.default.createElement(d.Dropdown,{trigger:["click"],dropdownRender:()=>h(),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:240}},q.default.createElement("span",null,q.default.createElement(g.SettingOutlined,{className:"icon"}),o("qm.pivotGrid.field.text")))},Gs=()=>{const{prefixCls:e,size:t,setContext:l}=js(),{t:n}=ot(),a=[{label:n("qm.pivotGrid.lineHeight.size")[0],value:"small"},{label:n("qm.pivotGrid.lineHeight.size")[1],value:"middle"},{label:n("qm.pivotGrid.lineHeight.size")[2],value:"large"}];return q.default.createElement(d.Dropdown,{trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container"),style:{padding:5}},q.default.createElement("div",{className:"list"},a.map((e=>q.default.createElement("li",{key:e.value,className:J.default("ant-dropdown-menu-item check-item",{active:t===e.value}),onClick:()=>l({size:e.value})},q.default.createElement("span",{className:"label"},e.label),q.default.createElement("i",{className:"icon"},q.default.createElement(g.CheckOutlined,null))))))),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:160}},q.default.createElement("span",null,q.default.createElement(g.ColumnHeightOutlined,{className:"icon"}),n("qm.pivotGrid.lineHeight.text")))},Ys="606060",Xs="thin",Qs="d4d4d4",Zs=(e,t)=>{t&&(e.height=Math.floor(.75*t))},Js=(e,t)=>{e.protection={locked:!1},e.alignment={vertical:"middle",horizontal:t||"left"}},ed=()=>({top:{style:Xs,color:{argb:Qs}},left:{style:Xs,color:{argb:Qs}},bottom:{style:Xs,color:{argb:Qs}},right:{style:Xs,color:{argb:Qs}}}),td=e=>{const{precision:t,formatType:l}=e,n=t>=0&&t?`.${"0".repeat(t)}`:"";return"percent"===l?{numFmt:n?`0${n}%`:"0%"}:"finance"===l?{numFmt:n?`#,##0${n}`:"#,##0"}:n?{numFmt:`0${n}`}:null},ld=()=>{const{prefixCls:e,pivotRef:t,columns:n,countMethod:a,summationData:r}=js(),{t:i}=ot(),{exportXLSX:o}=(()=>{const{size:e}=js(),{t:t}=ot(),{rowHeightMaps:n}=bi,a=(e,t)=>{var l,n,a;return null!==(a=null!==(n=null===(l=e.find((e=>e.text==t)))||void 0===l?void 0:l.value)&&void 0!==n?n:t)&&void 0!==a?a:""};return{exportXLSX:(l,a,r,i)=>Ie(void 0,void 0,void 0,(function*(){const{columns:o,footSummation:s}=l,d=n[e],u=pa(o),c=[],f=[],p=[];let m=0;const h={};u.forEach((e=>{const{dataIndex:t,width:l,renderWidth:n}=e;h[t]=ja(e.title),p.push({key:t,width:(l||n)/8})})),c.push(h),m+=c.length;const g=a.map(((e,t)=>{const l={};return u.forEach(((n,a)=>{const r=["percent","finance"].includes(n.formatType);l[n.dataIndex]=r?Pa(e,n.dataIndex):i(e,t,n,a)})),l._level=e._level,l._groupLevel=e._groupLevel,l}));m+=g.length,s&&r(u,a).forEach(((e,l)=>{const n={};u.forEach(((l,r)=>{const{dataIndex:i,summation:o}=l,s=(null==o?void 0:o.render)?o.render(a):Pa(e,i);n[i]=0===r&&""===s?t("qm.table.config.summaryText"):Re(s)?ja(s):s})),f.push(n)}));const{sheetName:v,useStyle:y}=l,b=new fe.default.Workbook,x=b.addWorksheet(v);x.columns=p,x.addRows(c).forEach((e=>{y&&Zs(e,d),e.eachCell((e=>{const t=x.getColumn(e.col),l=ya(o,t.key),{align:n,theadAlign:a}=l;Js(e,a||n),y&&Object.assign(e,{font:{bold:!0,color:{argb:Ys}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:ed()})}))})),x.addRows(g).forEach(((e,t)=>{const{_level:l,_groupLevel:n}=g[t];y&&Zs(e,d),e.eachCell(((e,t)=>{const a=x.getColumn(e.col),r=ya(o,a.key),{align:i}=r;Js(e,1===t||void 0===n?i:"right"),Object.assign(e,td(r)),y&&Object.assign(e,{font:{color:{argb:Ys}},border:ed()}),1===Number(e.col)&&l&&(e.alignment=Object.assign(Object.assign({},e.alignment),{indent:l}))}))})),s&&x.addRows(f).forEach((e=>{y&&Zs(e,d),e.eachCell(((e,t)=>{const l=x.getColumn(e.col),n=ya(o,l.key),{align:a}=n;Js(e,1===t?a:"right"),Object.assign(e,td(n)),y&&Object.assign(e,{font:{color:{argb:Ys}},border:ed()})}))})),[].forEach((({s:e,e:t})=>{x.mergeCells(e.r+1,e.c+1,t.r+1,t.c+1)}));const E=yield b.xlsx.writeBuffer();return new Blob([E],{type:"application/octet-stream"})})),importXLSX:(e,n)=>{const{columns:r,file:i}=e,o=pa(r),s=new FileReader;s.onerror=()=>{d.message.error(t("qm.table.import.error"))},s.onload=e=>{const r=o.map((e=>ja(e.title))),i=new fe.default.Workbook,s=e.target;s?i.xlsx.load(s.result).then((e=>{const i=e.worksheets[0];if(i){const e=i.getSheetValues(),s=e.findIndex((e=>e&&e.length>0)),u=e[s],c=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(r,u);if(c){const t=e.slice(s+1).map((e=>{const t={};e.forEach(((e,n)=>{var a;let r=e;Array.isArray(null==r?void 0:r.richText)&&(r=r.richText.map((e=>e.text)).join("")),l.isPlainObject(r)&&"text"in r&&(r=r.text),l.isDate(r)&&(r=qa(r,oi)),(null==r?void 0:r.formula)&&(r=null!==(a=r.result)&&void 0!==a?a:r.value),t[u[n]]=r}));const n={};return r.forEach(((e,l)=>{var r;const{dataIndex:i,dictItems:s}=o[l];Array.isArray(s)&&((null===(r=t[e])||void 0===r?void 0:r.toString().includes(","))?t[e]=t[e].split(",").map((e=>a(s,e))).filter((e=>""!==e)):t[e]=a(s,t[e])),Aa(n,i,t[e])})),n}));null==n||n(t)}else d.message.error(t("qm.table.import.error"))}else d.message.error(t("qm.table.import.error"))})):d.message.error(t("qm.table.import.error"))},s.readAsArrayBuffer(i)}}})(),{getTitleFromCellValue:s}=Oi(),u=[{text:i("qm.pivotGrid.count.records"),value:"count"},{text:i("qm.pivotGrid.count.unique"),value:"unique"},{text:i("qm.pivotGrid.count.empty"),value:"empty"},{text:i("qm.pivotGrid.count.notEmpty"),value:"notEmpty"},{text:i("qm.pivotGrid.count.sum"),value:"sum"},{text:i("qm.pivotGrid.count.max"),value:"max"},{text:i("qm.pivotGrid.count.min"),value:"min"},{text:i("qm.pivotGrid.count.avg"),value:"avg"}],c={columns:ma(n),fileName:j.default().format(si),fileType:"xlsx",sheetName:"sheet1",footSummation:!1,useStyle:!1},f=(e,t,l,n)=>{const{dataIndex:a,precision:r,formatType:i,outputRender:o}=l;if(As(e))return Pa(e,a);if(o)return o(Pa(e,a),e,l,t,n);let d=s(e,l,t,n);return r>=0&&!i&&""!==d&&(d=Number(d)),d},p=()=>{if(!a||!Object.keys(a).length)return[];const e={};return c.columns.map((e=>e.dataIndex)).forEach(((t,l)=>{if(l>0){let l="";(null==a?void 0:a[t])&&(l=u.find((e=>e.value===a[t])).text+" "+r.total[t]),Aa(e,t,l)}})),[e]},m=e=>Ie(void 0,void 0,void 0,(function*(){const t=yield o(Object.assign(Object.assign({},c),{footSummation:!!Object.keys(a).length}),e,p,f);Dn(t,`${j.default().format(si)}.xlsx`)})),h=[{key:"1",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(g.FolderOutlined,{style:{marginRight:4}})," ",i("qm.pivotGrid.export.group")),onClick:()=>{m((()=>{const e=[];let l=0;return t.current.flatGroupData.forEach((t=>{const i=Object.assign({},t);As(t)?(i._level=t._groupLevel,c.columns.map((e=>e.dataIndex)).forEach(((e,l)=>{if(0===l){const l=n.find((e=>e.dataIndex===t._fieldName)),a=l.outputRender?l.outputRender(Pa(t._record,l.dataIndex),t._record,l,0,0):s(t._record,l,0,0);Aa(i,e,a)}else{let l="";(null==a?void 0:a[e])&&(l=u.find((t=>t.value===a[e])).text+" "+Fs(r,t.id).subtotal[e]),Aa(i,e,l)}})),l=t._groupLevel):l>0&&(i._level=t._level+l+1),e.push(i)})),e})())}},{key:"2",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(g.BarsOutlined,{style:{marginRight:4}})," ",i("qm.pivotGrid.export.list")),onClick:()=>{m(Array.from(t.current.keyRecordMap.values()))}}];return q.default.createElement(d.Dropdown,{trigger:["click"],menu:{items:h},className:J.default("action-btn"),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:140}},q.default.createElement("span",null,q.default.createElement(g.DownloadOutlined,{className:"icon"}),i("qm.pivotGrid.export.text")))},nd=()=>{const{prefixCls:e,pivotRef:t,groupList:l,filterList:n,sorterList:a,colorList:r,countMethod:i,setContext:o}=js(),{uniqueKey:s}=t.current.props,{t:u}=ot(),c=q.default.useMemo((()=>s?`grid_conf_${s}`:""),[s]),f=q.default.useRef({}),[p,m]=q.default.useState([]),[h,v]=q.default.useState({}),[y,b]=q.default.useState(""),x=(e,t)=>{v((l=>Object.assign({},l,{[e]:null!=t?t:!l[e]})))};q.default.useLayoutEffect((()=>{E()}),[]),Yl((()=>{C()}),[p]);const E=()=>Ie(void 0,void 0,void 0,(function*(){try{if(!c)return;const e=yield pe.default.getItem(c);Array.isArray(e)&&(m(e),v(e.reduce(((e,t)=>(t.id&&(e[t.id]=!1),e)),{})))}catch(e){}})),C=()=>Ie(void 0,void 0,void 0,(function*(){try{if(!c)return;yield pe.default.setItem(c,p)}catch(e){}})),w=()=>{const e=$a();m([{id:e,label:j.default().format(si),value:{groupList:l,filterList:n,sorterList:a,colorList:r,countMethod:i}},...p]),Fe((()=>x(e,!0)))},S=()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container"),style:{padding:5}},q.default.createElement("div",{className:"label",style:{padding:"6px 15px 10px"}},q.default.createElement("span",null,u("qm.pivotGrid.saved.title"))),q.default.createElement("div",{className:"list"},q.default.createElement("ul",null,p.map((e=>q.default.createElement("li",{key:e.id,className:J.default("ant-dropdown-menu-item sort-item",{active:e.id===y}),onClick:()=>(e=>{if(h[e.id])return;const t=y!==e.id,l=t?e.value:f.current;o({groupList:l.groupList,filterList:l.filterList,sorterList:l.sorterList,colorList:l.colorList,countMethod:l.countMethod}),b(t?e.id:"")})(e)},q.default.createElement("div",{className:"label",style:{width:200}},h[e.id]?q.default.createElement(d.Input,{size:"small",autoFocus:!0,defaultValue:e.label,style:{width:"100%",marginLeft:-8},onBlur:t=>{const{value:l}=t.target;l!==e.label&&(e.label=l,m([...p])),x(e.id,!1)}}):q.default.createElement("span",null,e.label)),q.default.createElement("button",{className:"button-icon",onClick:t=>{t.stopPropagation(),x(e.id)}},h[e.id]?q.default.createElement(g.CheckOutlined,null):q.default.createElement(g.EditOutlined,null)),q.default.createElement("button",{className:"button-icon",style:{marginLeft:4},onClick:t=>{var l;t.stopPropagation(),l=e.id,m(p.filter((e=>e.id!==l)))}},q.default.createElement(g.CloseOutlined,null))))))),q.default.createElement("div",{className:"add-record",style:{padding:10}},q.default.createElement("span",{className:"insert",onClick:w},q.default.createElement(g.PlusOutlined,{className:"icon"}),u("qm.pivotGrid.saved.add"))));return q.default.createElement(d.Dropdown,{trigger:["click"],dropdownRender:()=>S(),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomRight",overlayStyle:{minWidth:280},onOpenChange:e=>{var t;t=e?{groupList:l,filterList:n,sorterList:a,colorList:r,countMethod:i}:{},f.current=t}},q.default.createElement("span",null,q.default.createElement(g.SaveOutlined,{className:"icon"}),u("qm.pivotGrid.saved.text")))},ad=()=>{const{gridData:e}=js(),{t:t}=ot();return q.default.createElement("div",{className:"alert-info"},q.default.createElement(g.InfoCircleOutlined,{className:"icon"}),t("qm.table.alert.total",{total:(()=>{let t=0;return function e(l){l.forEach((l=>{Array.isArray(l.children)&&e(l.children),t+=1}))}(e),t})()}))},rd=8;const id={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},od={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},sd=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function dd(e){const{arrowWidth:t,autoAdjustOverflow:l,arrowPointAtCenter:n,offset:a,borderRadius:r,visibleFirst:i}=e,o=t/2,s={};return Object.keys(id).forEach((e=>{const d=n&&od[e]||id[e],u=Object.assign(Object.assign({},d),{offset:[0,0],dynamicInset:!0});switch(s[e]=u,sd.has(e)&&(u.autoArrow=!1),e){case"top":case"topLeft":case"topRight":u.offset[1]=-o-a;break;case"bottom":case"bottomLeft":case"bottomRight":u.offset[1]=o+a;break;case"left":case"leftTop":case"leftBottom":u.offset[0]=-o-a;break;case"right":case"rightTop":case"rightBottom":u.offset[0]=o+a}const c=function(e){const{contentRadius:t,limitVerticalRadius:l}=e,n=t>12?t+2:12;return{arrowOffsetHorizontal:n,arrowOffsetVertical:l?rd:n}}({contentRadius:r,limitVerticalRadius:!0});if(n)switch(e){case"topLeft":case"bottomLeft":u.offset[0]=-c.arrowOffsetHorizontal-o;break;case"topRight":case"bottomRight":u.offset[0]=c.arrowOffsetHorizontal+o;break;case"leftTop":case"rightTop":u.offset[1]=2*-c.arrowOffsetHorizontal+o;break;case"leftBottom":case"rightBottom":u.offset[1]=2*c.arrowOffsetHorizontal-o}u.overflow=function(e,t,l,n){if(!1===n)return{adjustX:!1,adjustY:!1};const a=n&&"object"==typeof n?n:{},r={};switch(e){case"top":case"bottom":r.shiftX=2*t.arrowOffsetHorizontal+l,r.shiftY=!0,r.adjustY=!0;break;case"left":case"right":r.shiftY=2*t.arrowOffsetVertical+l,r.shiftX=!0,r.adjustX=!0}const i=Object.assign(Object.assign({},r),a);return i.shiftX||(i.adjustX=!0),i.shiftY||(i.adjustY=!0),i}(e,c,t,l),i&&(u.htmlRegion="visibleFirst")})),s}const ud=e=>{const{value:t,defaultValue:l,disabled:n,disabledAlpha:a,className:r,style:i,onChange:o,onChangeComplete:s}=e,[d,u]=yi("",{value:t,defaultValue:l}),c=e=>({hex:e.toHexString(),rgb:e.toRgbString(),hsb:e.toHsbString()}),f=dd({offset:0,arrowWidth:16,borderRadius:6}),p=gt("color-picker");return q.default.createElement(me.default,{action:["click"],prefixCls:p,popupPlacement:"bottomLeft",builtinPlacements:f,popup:()=>q.default.createElement(he.default,{prefixCls:p,value:d,disabled:n,disabledAlpha:a,onChange:(e,t)=>{u(e.toRgbString()),null==o||o(c(e),t)},onChangeComplete:(e,t)=>{null==s||s(c(e),t)}})},q.default.createElement("div",{className:J.default(`${p}-btn`,r),style:i},q.default.createElement(P.ColorBlock,{color:d,prefixCls:p})))};ud.displayName="ColorPicker";const cd=()=>{const{prefixCls:e,pivotRef:t,getRowKey:n,columns:a,colorList:r,setColorList:i,setFillColor:o}=js(),{flatGroupData:s}=t.current,{t:u}=ot(),c=q.default.useRef([]),f=q.default.useMemo((()=>r.filter((e=>e.fieldName&&e.color&&(Za(e.expression)||!De(e.value)||"col"===e.mode)))),[r]),p=q.default.useMemo((()=>a.filter((e=>![bi.operationColumn].includes(e.dataIndex))).map((e=>({label:ja(e.title),value:e.dataIndex})))),[a]),m=q.default.useMemo((()=>Ls(a)),[a]),h=[{label:u("qm.pivotGrid.fillColor.cell"),value:"cell"},{label:u("qm.pivotGrid.fillColor.row"),value:"row"},{label:u("qm.pivotGrid.fillColor.col"),value:"col"}];Yl((()=>{v()}),[q.default.useMemo((()=>{const e=f.map((e=>{var t;return{[e.color]:`${e.mode},${e.fieldName},${e.expression},${null!==(t=e.value)&&void 0!==t?t:""}`}}));return l.isEqual(e,c.current)?c.current:(c.current=e,e)}),[f])]);const v=wn((()=>{const e=[];f.forEach((t=>{const l=Va([Object.assign(Object.assign({},He(t,["value"])),{condition:t.value})]),a=fa(s.filter((e=>!As(e))),"col"!==t.mode?l:"");if("cell"===t.mode||"col"===t.mode)for(let l=0;l<a.length;l++)e.push({color:t.color,rowKey:n(a[l],a[l].index),dataIndex:t.fieldName});if("row"===t.mode)for(let l=0;l<a.length;l++){const r=n(a[l],a[l].index);for(let l=0;l<m.length;l++)e.push({color:t.color,rowKey:r,dataIndex:m[l].dataIndex})}})),o(e)}),200),y=()=>{i([...r,{type:"",bracketLeft:"",fieldName:"",expression:"",value:null,bracketRight:"",logic:"and",color:"",mode:"cell"}])},b=(e,t,l)=>{var n;if(Object.assign(t,{[e]:l}),"fieldName"===e){const e=(null===(n=a.find((e=>e.dataIndex===l)).filter)||void 0===n?void 0:n.type)||"text";Object.assign(t,{type:e,expression:x(e)[0].value,value:""})}"expression"===e&&Za(l)&&Object.assign(t,{value:""}),i([...r])},x=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",label:u("qm.table.highSearch.gtText")},{value:"<",label:u("qm.table.highSearch.ltText")},{value:">=",label:u("qm.table.highSearch.gteText")},{value:"<=",label:u("qm.table.highSearch.lteText")},{value:"==",label:u("qm.table.highSearch.eqText")},{value:"!=",label:u("qm.table.highSearch.neqText")},{value:"nil",label:u("qm.table.highSearch.nullText")},{value:"nnil",label:u("qm.table.highSearch.notNullText")}];break;case"checkbox":case"radio":case"tree":t=[{value:"in",label:u("qm.table.highSearch.inText")},{value:"nin",label:u("qm.table.highSearch.ninText")},{value:"==",label:u("qm.table.highSearch.eqText")},{value:"!=",label:u("qm.table.highSearch.neqText")},{value:"nil",label:u("qm.table.highSearch.nullText")},{value:"nnil",label:u("qm.table.highSearch.notNullText")}];break;default:t=[{value:"like",label:u("qm.table.highSearch.inText")},{value:"nlike",label:u("qm.table.highSearch.ninText")},{value:"==",label:u("qm.table.highSearch.eqText")},{value:"!=",label:u("qm.table.highSearch.neqText")},{value:"^=",label:u("qm.table.highSearch.startsWithText")},{value:"=$",label:u("qm.table.highSearch.endsWithText")},{value:"nil",label:u("qm.table.highSearch.nullText")},{value:"nnil",label:u("qm.table.highSearch.notNullText")}]}return t},E=e=>q.default.createElement(q.default.Fragment,null,q.default.createElement(g.HolderOutlined,{className:"icon handle"}),q.default.createElement(ud,{defaultValue:e.color,style:{marginLeft:5},onChangeComplete:t=>b("color",e,t.hex)}),q.default.createElement(d.Select,{value:e.mode,options:h,placeholder:u("qm.table.editable.selectPlaceholder"),style:{width:90,marginLeft:10,marginRight:20},onChange:t=>b("mode",e,t)}),q.default.createElement(d.Select,{value:e.fieldName||void 0,options:p,placeholder:u("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>b("fieldName",e,t)}),"col"!==e.mode&&q.default.createElement(d.Select,{value:e.expression||void 0,placeholder:u("qm.table.editable.selectPlaceholder"),options:x(e.type),style:{width:100,margin:"0 10px"},onChange:t=>b("expression",e,t)}),"col"!==e.mode&&(e=>{var t,l;switch(e.type){case"number":return q.default.createElement(d.InputNumber,{defaultValue:e.value,style:{width:150},onChange:t=>{b("value",e,De(t)?"":t)}});case"date":return q.default.createElement(et,{popupClassName:bi.popupClassName,defaultValue:null!==(t=Ha(e.value,"YYYY-MM-DD"))&&void 0!==t?t:void 0,picker:"date",allowClear:!0,style:{width:150},onChange:t=>{b("value",e,qa(t,"YYYY-MM-DD"))}});case"checkbox":case"radio":{const t=(null===(l=a.find((t=>t.dataIndex===e.fieldName)))||void 0===l?void 0:l.dictItems)||[];return q.default.createElement(d.Select,{mode:"checkbox"===e.type?"multiple":void 0,defaultValue:e.value||void 0,placeholder:u("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>{b("value",e,t)}},t.map((e=>q.default.createElement(d.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))}default:return q.default.createElement(d.Input,{value:e.value,style:{width:150},disabled:Za(e.expression),onChange:t=>{b("value",e,t.target.value)}})}})(e),q.default.createElement(g.CloseOutlined,{className:"icon close",onClick:()=>(e=>{i(r.filter((t=>t!==e)))})(e)}));return q.default.createElement(d.Dropdown,{trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container")},q.default.createElement("div",{className:"label"},q.default.createElement("span",null,u("qm.pivotGrid.fillColor.title"))),q.default.createElement("div",{className:"list"},q.default.createElement(I.ReactSortable,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:r,setList:e=>{const t=e.map((e=>e.fieldName)),n=r.map((e=>e.fieldName));l.isEqual(t,n)||i(e)}},r.map(((e,t)=>q.default.createElement("li",{key:`${e.fieldName}-${t}`,className:"item"},E(e)))))),q.default.createElement("div",{className:"add-record"},q.default.createElement("span",{className:"insert",onClick:y},q.default.createElement(g.PlusOutlined,{className:"icon"}),u("qm.pivotGrid.fillColor.add")))),className:J.default("action-btn",{active:!!f.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},q.default.createElement("span",null,q.default.createElement(g.BgColorsOutlined,{className:"icon"}),u("qm.pivotGrid.fillColor.text"),f.length?`(${f.length})`:null))},fd=()=>q.default.createElement("div",{className:"top-bar"},q.default.createElement(ht,{size:4},q.default.createElement(ad,null),q.default.createElement(d.Divider,{type:"vertical"}),q.default.createElement(Us,null),q.default.createElement(Ks,null),q.default.createElement(Vs,null),q.default.createElement(zs,null),q.default.createElement(d.Divider,{type:"vertical"}),q.default.createElement(cd,null),q.default.createElement(Gs,null),q.default.createElement(Ws,null),q.default.createElement(d.Divider,{type:"vertical"}),q.default.createElement(ld,null)),q.default.createElement(ht,{size:4},q.default.createElement(nd,null))),pd=q.default.createContext(void 0),md=e=>{var t,l;const{scrollbar:n}=e,{pivotRef:a,getRowKey:r,columns:i,groupGridData:o,setPivotGridRef:s}=js(),{rowSelection:d,treeExpandable:u,rowHighlight:c}=a.current.props,f=null===(t=null==u?void 0:u.defaultExpandAllRows)||void 0===t||t,p=q.default.useRef({bodyEl:null,rowVirtualizer:null}),[m,h]=q.default.useState({gridRef:p,scrollbarRef:n,selectionKeys:null!==(l=null==d?void 0:d.defaultSelectedRowKeys)&&void 0!==l?l:[],treeExpandKeys:f?wa(a.current.originGridData,(e=>r(e,e.index))):[],highlightKey:"",checkedColumnKey:"",clicked:[],isPingLeft:!1}),g=q.default.useMemo((()=>Math.max(0,_s(o)-1)),[o]),v=q.default.useMemo((()=>Ls(i)),[i]),y=q.default.useMemo((()=>v.filter((e=>"left"===e.fixed)).reduce(((e,t)=>e+(t.width||t.renderWidth||0)),0)+g*ks.indentWidth),[g,v]),b=e=>{h((t=>{const l=Object.assign({},t);let n=!1;return Object.keys(e).forEach((a=>{const r=a;Object.is(t[r],e[r])||(l[r]=e[r],n=!0)})),n?l:t}))},x=(e,t)=>{m.gridRef.current[e]=t};q.default.useLayoutEffect((()=>{I()}),[i]),q.default.useLayoutEffect((()=>{(null==d?void 0:d.selectedRowKeys)&&b({selectionKeys:d.selectedRowKeys})}),[null==d?void 0:d.selectedRowKeys]),q.default.useLayoutEffect((()=>{void 0!==(null==c?void 0:c.currentRowKey)&&b({highlightKey:c.currentRowKey})}),[null==c?void 0:c.currentRowKey]);const E=e=>{Array.isArray(null==d?void 0:d.selectedRowKeys)||b({selectionKeys:e})},C=e=>{b({treeExpandKeys:e})},w=e=>{void 0===(null==c?void 0:c.currentRowKey)&&b({highlightKey:e})},S=e=>{b({checkedColumnKey:e})},N=e=>{Xa(e,m.clicked,!0)||b({clicked:e})},T=e=>{b({isPingLeft:e})},I=()=>{const e=n.current.container.clientWidth,{defaultColumnWidth:t}=bi,l=[];let a=0;if(i.forEach((e=>{"number"==typeof e.width?(e.renderWidth=e.width,a+=e.width):(e.renderWidth=void 0,l.push(e))})),l.length>0){const n=i.reduce(((e,l)=>e+(l.width||l.minWidth||t)),0);if(n<=e){const a=e-n;if(1===l.length)l[0].renderWidth=(l[0].minWidth||t)+a;else{const e=a/l.reduce(((e,l)=>e+(l.minWidth||t)),0);let n=0;l.forEach(((l,a)=>{if(0===a)return;const r=Math.floor((l.minWidth||t)*e);n+=r,l.renderWidth=(l.minWidth||t)+r})),l[0].renderWidth=(l[0].minWidth||t)+a-n}}else l.forEach((e=>{e.renderWidth=e.minWidth||t}))}else a=i.reduce(((e,l)=>e+(l.renderWidth=l.width||l.minWidth||t)),0)},O=q.default.useMemo((()=>Object.assign(Object.assign({},m),{indentDepth:g,fixedWidth:y,gridColumns:v,setContext:b,setGridLayoutRef:x,setSelectionKeys:E,setTreeExpandKeys:C,setHighlightKey:w,setCheckColumnKey:S,setClicked:N,setPingLeft:T,updateColumnsWidth:I})),[m,g,v]);return q.default.createElement(pd.Provider,{value:O},e.children)},hd=()=>q.default.useContext(pd),gd=e=>{var t;const{column:l}=e,{pivotRef:n,columns:a,setColumns:r}=js(),{scrollbarRef:i}=hd(),{onColumnsChange:o}=n.current.props,s=q.default.useRef(null),[d,u]=q.default.useState(!1),c=q.default.useRef(document.onselectstart),f=q.default.useRef({startX:0,originSizeX:0,columnWidth:0}),p=e=>{f.current=Object.assign({},f.current,e)},m=e=>{if(1!==e.buttons)return h();const t=e.clientX-f.current.startX,n=(l.width||l.renderWidth)+t;n<(l.minWidth||bi.defaultColumnWidth)||(p({columnWidth:n}),s.current.style.left=`${f.current.originSizeX+t}px`)},h=()=>{i.current.container.classList.remove("col-resize"),l.width=f.current.columnWidth;const e=[...a];o?o(e):r(e),Fe((()=>u(!1))),Ql(document,"mousemove",m),Ql(document,"mouseup",h),p({startX:0,originSizeX:0,columnWidth:0}),g()},g=()=>{document.onselectstart!==c.current&&(document.onselectstart=c.current)};return q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:"resize-bar",onMouseDown:e=>{e.preventDefault(),i.current.container.classList.add("col-resize");const t=Ra(e.target,i.current.container).left-i.current.scrollLeft+3;p({startX:e.clientX,originSizeX:t,columnWidth:l.width||l.renderWidth||0}),Xl(document,"mousemove",m),Xl(document,"mouseup",h),u(!0),Fe((()=>s.current.style.left=`${t}px`)),c.current=document.onselectstart,document.onselectstart=()=>!1}}),q.default.createElement(ue.default,{open:d,getContainer:null===(t=i.current)||void 0===t?void 0:t.container},q.default.createElement("div",{ref:s,className:"resize-line"})))},vd=e=>{var t;const{left:l}=e,{pivotRef:n,columns:a,setColumns:r}=js(),{scrollbarRef:i,gridColumns:o,indentDepth:s,isPingLeft:d,setPingLeft:u}=hd(),{onColumnsChange:c}=n.current.props,{indentWidth:f}=ks,p=q.default.useRef(document.onselectstart),m=q.default.useRef({startX:0,originSizeX:0}),h=e=>{m.current=Object.assign({},m.current,e)},g=()=>{x(l),O(l)},[v,y]=q.default.useState(0),[b,x]=q.default.useState(l),[E,C]=q.default.useState(l),w=q.default.useRef(!1),S=e=>w.current=e;Yl((()=>{w.current||g()}),[l]);const N=e=>e.width||e.renderWidth||0,T=e=>o.slice(0,e).reduce(((e,t)=>e+N(t)),0)+s*f,I=e=>{let t=-1;for(let l=1;l<o.length;l++){const n=T(l-1)+N(o[l-1])/2,a=T(l)+N(o[l])/2;if(e>n&&e<a){T(l)<i.current.container.offsetWidth&&(t=l);break}}return t},O=Kn((e=>{const t=I(e);t<0||C(T(t))}),60);q.default.useEffect((()=>{const e=e=>u(e.target.scrollLeft>1),t=i.current.scrollElement;return t.addEventListener("scroll",e),Xl(t,"scroll",e),()=>Ql(t,"scroll",e)}),[]);const R=st((e=>{if(1!==e.buttons)return k();const t=e.clientX-m.current.startX,l=m.current.originSizeX+t;x(l),O(l)})),k=st((()=>{i.current.container.classList.remove("col-resize"),S(!1),(e=>{const t=I(e);if(t<0)return g();a.forEach(((e,l)=>{l<t-1?e.fixed="left":delete e.fixed})),x(T(t)),O(e),c?c([...a]):r([...a])})(b),Ql(document,"mousemove",R),Ql(document,"mouseup",k),h({startX:0,originSizeX:0}),L()})),L=()=>{document.onselectstart!==p.current&&(document.onselectstart=p.current)};return q.default.createElement(ue.default,{open:!0,getContainer:null===(t=i.current)||void 0===t?void 0:t.container},q.default.createElement("div",{className:J.default("fixed-line",{leave:d}),style:{left:l}}),q.default.createElement("div",{className:J.default("fixed-bar",{active:w.current}),style:{left:b},onMouseMove:e=>{const{top:t,height:l}=e.target.getBoundingClientRect(),n=e.clientY-t;let a=Math.max(0,n-16);a=Math.min(a,l-32),y(a)},onMouseDown:e=>{e.preventDefault(),i.current.container.classList.add("col-resize"),i.current.SET_SCROLL_LEFT(0),S(!0),h({startX:e.clientX,originSizeX:e.target.offsetLeft}),Xl(document,"mousemove",R),Xl(document,"mouseup",k),p.current=document.onselectstart,document.onselectstart=()=>!1}},q.default.createElement("span",{className:"thumb",style:{top:v}})),w.current&&q.default.createElement("div",{className:"fixed-line active",style:{left:E}}))},yd=()=>{const{pivotRef:e}=js(),{indentDepth:t,fixedWidth:l,gridColumns:n,checkedColumnKey:a,selectionKeys:r,setSelectionKeys:i,setCheckColumnKey:o}=hd(),{rowSelection:s}=e.current.props,{selectionColumn:u}=bi,{indentWidth:c,selectionColumnDefine:f}=ks,p=q.default.useMemo((()=>n.filter((e=>"left"===e.fixed))),[n]),m=q.default.useMemo((()=>n.filter((e=>"left"!==e.fixed))),[n]),h=q.default.useMemo((()=>"radio"!==(null==s?void 0:s.type)),[s]),g=q.default.useMemo((()=>r.length>0&&r.length===e.current.keyRecordMap.size),[r]),v=q.default.useMemo((()=>r.length>0&&r.length<e.current.keyRecordMap.size),[r]),y=(n,r)=>q.default.createElement("div",{className:J.default(r?"fixed-left":"no-fixed"),style:{width:r?l:""}},n.map(((l,p)=>{const{dataIndex:m,title:y,align:b,width:x,renderWidth:E}=l,C={"selection-column":m===u,"col--center":"center"===b,"col--right":"right"===b,"col--checked":a===m},w=p===(r?n.length>1?1:0:n.length-1)?t*c:0,S={width:`${(x||E||0)+w}px`,minWidth:`${(x||E||0)+w}px`};return q.default.createElement("div",{key:m,className:J.default("table-cell",C),title:ja(y),style:S,onClick:()=>{return e=m,void([f.dataIndex,bi.operationColumn].includes(e)||o(a!==e?e:""));var e}},m!==u?q.default.createElement("span",{className:"cell"},y):s&&h?q.default.createElement(d.Checkbox,{checked:g,indeterminate:v,onChange:t=>(t=>{var l;const n=t?Array.from(e.current.keyRecordMap.keys()):[];i(n),null===(l=null==s?void 0:s.onChange)||void 0===l||l.call(s,n,t?Array.from(e.current.keyRecordMap.values()):[])})(t.target.checked)}):"#",m!==u&&q.default.createElement(gd,{column:l}))})));return q.default.createElement("div",{className:"header"},y(p,!0),y(m),q.default.createElement(vd,{left:l}))};function bd(e,t,l){var n;let a,r=null!==(n=l.initialDeps)&&void 0!==n?n:[];function i(){var n,i,o,s,d;let u;l.key&&(null===(n=l.debug)||void 0===n?void 0:n.call(l))&&(u=Date.now());const c=e(),f=c.length!==r.length||c.some(((e,t)=>r[t]!==e));if(!(null===(i=l.noCache)||void 0===i?void 0:i.call(l))&&!f)return a;let p;if(r=c,l.key&&(null===(o=l.debug)||void 0===o?void 0:o.call(l))&&(p=Date.now()),a=t(...c),l.key&&(null===(s=l.debug)||void 0===s?void 0:s.call(l))){const e=Math.round(100*(Date.now()-u))/100,t=Math.round(100*(Date.now()-p))/100,n=t/16,a=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${a(t,5)} /${a(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*n,120))}deg 100% 31%);`,null==l?void 0:l.key)}return null===(d=null==l?void 0:l.onChange)||void 0===d||d.call(l,a),a}return i.updateDeps=e=>{r=e},i}function xd(e,t){if(void 0===e)throw new Error("Unexpected undefined"+(t?`: ${t}`:""));return e}const Ed=(e,t,l)=>{let n;return function(...a){e.clearTimeout(n),n=e.setTimeout((()=>t.apply(this,a)),l)}},Cd=e=>{const{offsetWidth:t,offsetHeight:l}=e;return{width:t,height:l}},wd=e=>e,Sd=e=>{const t=Math.max(e.startIndex-e.overscan,0),l=Math.min(e.endIndex+e.overscan,e.count-1),n=[];for(let e=t;e<=l;e++)n.push(e);return n},Nd=(e,t)=>{const l=e.scrollElement;if(!l)return;const n=e.targetWindow;if(!n)return;const a=e=>{const{width:l,height:n}=e;t({width:Math.round(l),height:Math.round(n)})};if(a(Cd(l)),!n.ResizeObserver)return()=>{};const r=new n.ResizeObserver((t=>{const n=()=>{const e=t[0];if(null==e?void 0:e.borderBoxSize){const t=e.borderBoxSize[0];if(t)return void a({width:t.inlineSize,height:t.blockSize})}a(Cd(l))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(n):n()}));return r.observe(l,{box:"border-box"}),()=>{r.unobserve(l)}},Td={passive:!0},Id="undefined"==typeof window||"onscrollend"in window,Od=(e,t)=>{const l=e.scrollElement;if(!l)return;const n=e.targetWindow;if(!n)return;let a=0;const r=e.options.useScrollendEvent&&Id?()=>{}:Ed(n,(()=>{t(a,!1)}),e.options.isScrollingResetDelay),i=n=>()=>{const{horizontal:i,isRtl:o}=e.options;a=i?l.scrollLeft*(o?-1:1):l.scrollTop,r(),t(a,n)},o=i(!0),s=i(!1);s(),l.addEventListener("scroll",o,Td);const d=e.options.useScrollendEvent&&Id;return d&&l.addEventListener("scrollend",s,Td),()=>{l.removeEventListener("scroll",o),d&&l.removeEventListener("scrollend",s)}},Rd=(e,t,l)=>{if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e){return Math.round(e[l.options.horizontal?"inlineSize":"blockSize"])}}return e[l.options.horizontal?"offsetWidth":"offsetHeight"]},kd=(e,{adjustments:t=0,behavior:l},n)=>{var a,r;const i=e+t;null===(r=null===(a=n.scrollElement)||void 0===a?void 0:a.scrollTo)||void 0===r||r.call(a,{[n.options.horizontal?"left":"top"]:i,behavior:l})};class Ld{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver((e=>{e.forEach((e=>{const t=()=>{this._measureElement(e.target,e)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()}))})):null);return{disconnect:()=>{var l;null===(l=t())||void 0===l||l.disconnect(),e=null},observe:e=>{var l;return null===(l=t())||void 0===l?void 0:l.observe(e,{box:"border-box"})},unobserve:e=>{var l;return null===(l=t())||void 0===l?void 0:l.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach((([t,l])=>{void 0===l&&delete e[t]})),this.options=Object.assign({debug:!1,noCache:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:wd,rangeExtractor:Sd,onChange:()=>{},measureElement:Rd,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1},e)},this.notify=e=>{var t,l;null===(l=(t=this.options).onChange)||void 0===l||l.call(t,this,e)},this.maybeNotify=bd((()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null])),(e=>{this.notify(e)}),{key:"maybeNotify",noCache:()=>this.options.noCache,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach((e=>e())),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e,t;const l=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==l){if(this.cleanup(),!l)return void this.maybeNotify();this.scrollElement=l,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=null!==(t=null===(e=this.scrollElement)||void 0===e?void 0:e.window)&&void 0!==t?t:null,this.elementsCache.forEach((e=>{this.observer.observe(e)})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,(e=>{this.scrollRect=e,this.maybeNotify()}))),this.unsubs.push(this.options.observeElementOffset(this,((e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.maybeNotify()})))}},this.getSize=()=>{var e;return this.options.enabled?(this.scrollRect=null!==(e=this.scrollRect)&&void 0!==e?e:this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0)},this.getScrollOffset=()=>{var e;return this.options.enabled?(this.scrollOffset=null!==(e=this.scrollOffset)&&void 0!==e?e:"function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset,this.scrollOffset):(this.scrollOffset=null,0)},this.getFurthestMeasurement=(e,t)=>{const l=new Map,n=new Map;for(let a=t-1;a>=0;a--){const t=e[a];if(l.has(t.lane))continue;const r=n.get(t.lane);if(null==r||t.end>r.end?n.set(t.lane,t):t.end<r.end&&l.set(t.lane,!0),l.size===this.options.lanes)break}return n.size===this.options.lanes?Array.from(n.values()).sort(((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end))[0]:void 0},this.getMeasurementOptions=bd((()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled]),((e,t,l,n,a)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:l,getItemKey:n,enabled:a})),{key:!1}),this.getMeasurements=bd((()=>[this.getMeasurementOptions(),this.itemSizeCache]),(({count:e,paddingStart:t,scrollMargin:l,getItemKey:n,enabled:a},r)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];0===this.measurementsCache.length&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach((e=>{this.itemSizeCache.set(e.key,e.size)})));const i=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const o=this.measurementsCache.slice(0,i);for(let a=i;a<e;a++){const e=n(a),i=1===this.options.lanes?o[a-1]:this.getFurthestMeasurement(o,a),s=i?i.end+this.options.gap:t+l,d=r.get(e),u="number"==typeof d?d:this.options.estimateSize(a),c=s+u,f=i?i.lane:a%this.options.lanes;o[a]={index:a,start:s,size:u,end:c,key:e,lane:f}}return this.measurementsCache=o,o}),{key:"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=bd((()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes]),((e,t,l,n)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:l,lanes:n}){const a=e.length-1,r=t=>e[t].start;if(e.length<=n)return{startIndex:0,endIndex:a};let i=Pd(0,a,r,l),o=i;if(1===n)for(;o<a&&e[o].end<l+t;)o++;else if(n>1){const r=Array(n).fill(0);for(;o<a&&r.some((e=>e<l+t));){const t=e[o];r[t.lane]=t.end,o++}const s=Array(n).fill(l+t);for(;i>=0&&s.some((e=>e>=l));){const t=e[i];s[t.lane]=t.start,i--}i=Math.max(0,i-i%n),o=Math.min(a,o+(n-1-o%n))}return{startIndex:i,endIndex:o}}({measurements:e,outerSize:t,scrollOffset:l,lanes:n}):null),{key:"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=bd((()=>{let e=null,t=null;const l=this.calculateRange();return l&&(e=l.startIndex,t=l.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]}),((e,t,l,n,a)=>null===n||null===a?[]:e({startIndex:n,endIndex:a,overscan:t,count:l,offset:this.getScrollOffset()})),{key:"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,l=e.getAttribute(t);return l?parseInt(l,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{const l=this.indexFromElement(e),n=this.measurementsCache[l];if(!n)return;const a=n.key,r=this.elementsCache.get(a);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(a,e)),e.isConnected&&this.resizeItem(l,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{var l;const n=this.measurementsCache[e];if(!n)return;const a=t-(null!==(l=this.itemSizeCache.get(n.key))&&void 0!==l?l:n.size);0!==a&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(n,a,this):n.start<this.getScrollOffset()+this.scrollAdjustments)&&(this.options.debug&&console.info("correction",a),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,t)),this.notify(!1))},this.measureElement=e=>{e?this._measureElement(e,void 0):this.elementsCache.forEach(((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))}))},this.getVirtualItems=bd((()=>[this.getVirtualIndexes(),this.getMeasurements()]),((e,t)=>{const l=[];for(let n=0,a=e.length;n<a;n++){const a=t[e[n]];l.push(a)}return l}),{key:"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0!==t.length)return xd(t[Pd(0,t.length-1,(e=>xd(t[e]).start),e)])},this.getOffsetForAlignment=(e,t,l=0)=>{const n=this.getSize(),a=this.getScrollOffset();"auto"===t&&(t=e>=a+n?"end":"start"),"center"===t?e+=(l-n)/2:"end"===t&&(e-=n);const r=this.getTotalSize()+this.options.scrollMargin-n;return Math.max(Math.min(r,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const l=this.measurementsCache[e];if(!l)return;const n=this.getSize(),a=this.getScrollOffset();if("auto"===t)if(l.end>=a+n-this.options.scrollPaddingEnd)t="end";else{if(!(l.start<=a+this.options.scrollPaddingStart))return[a,t];t="start"}const r="end"===t?l.end+this.options.scrollPaddingEnd:l.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(r,t,l.size),t]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:t="start",behavior:l}={})=>{"smooth"===l&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:l})},this.scrollToIndex=(e,{align:t="auto",behavior:l}={})=>{"smooth"===l&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1));let n=0;const a=t=>{if(!this.targetWindow)return;const n=this.getOffsetForIndex(e,t);if(!n)return void console.warn("Failed to get offset for index:",e);const[a,i]=n;this._scrollToOffset(a,{adjustments:void 0,behavior:l}),this.targetWindow.requestAnimationFrame((()=>{const t=this.getScrollOffset(),l=this.getOffsetForIndex(e,i);var n,a;l?(n=l[0],a=t,Math.abs(n-a)<1.01||r(i)):console.warn("Failed to get offset for index:",e)}))},r=t=>{this.targetWindow&&(n++,n<10?(this.options.debug&&console.info("Schedule retry",n,10),this.targetWindow.requestAnimationFrame((()=>a(t)))):console.warn(`Failed to scroll to index ${e} after 10 attempts.`))};a(t)},this.scrollBy=(e,{behavior:t}={})=>{"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e,t;const l=this.getMeasurements();let n;if(0===l.length)n=this.options.paddingStart;else if(1===this.options.lanes)n=null!==(t=null===(e=l[l.length-1])||void 0===e?void 0:e.end)&&void 0!==t?t:0;else{const e=Array(this.options.lanes).fill(null);let t=l.length-1;for(;t>=0&&e.some((e=>null===e));){const n=l[t];null===e[n.lane]&&(e[n.lane]=n.end),t--}n=Math.max(...e.filter((e=>null!==e)))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:l})=>{this.options.scrollToFn(e,{behavior:l,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const Pd=(e,t,l,n)=>{for(;e<=t;){const a=(e+t)/2|0,r=l(a);if(r<n)e=a+1;else{if(!(r>n))return a;t=a-1}}return e>0?e-1:0};const Ad="undefined"!=typeof document?$.useLayoutEffect:$.useEffect;function Fd(e){return function(e){const t=$.useReducer((()=>({})),{})[1],l=Object.assign(Object.assign({},e),{onChange:(l,n)=>{var a;n?v.flushSync(t):t(),null===(a=e.onChange)||void 0===a||a.call(e,l,n)}}),[n]=$.useState((()=>new Ld(l)));return n.setOptions(l),Ad((()=>n._didMount()),[]),Ad((()=>n._willUpdate())),n}(Object.assign({observeElementRect:Nd,observeElementOffset:Od,scrollToFn:kd},e))}const _d=e=>(e=>null!=e&&"object"==typeof e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE)(e)?e.ownerDocument:document,Dd=(e,t)=>!t.map((e=>Array.from(document.querySelectorAll(e)))).flat().some((t=>null==t?void 0:t.contains(e.target))),Md=(e,t)=>{var l;const n=e.target;return!("button"in e&&e.button>0)&&(!(n&&!_d(n).contains(n))&&!(null===(l=t.current)||void 0===l?void 0:l.contains(n)))};function Hd({ref:e,handler:t,enabled:l=!0,omitClassNames:n=[]}){const a=st(t),r=$.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1});$.useEffect((()=>{if(!l)return;const i=t=>{Md(t,e)&&(r.current.isPointerDown=!0)},o=l=>{r.current.ignoreEmulatedMouseEvents?r.current.ignoreEmulatedMouseEvents=!1:t&&r.current.isPointerDown&&Md(l,e)&&Dd(l,n)&&(r.current.isPointerDown=!1,a(l))},s=l=>{r.current.ignoreEmulatedMouseEvents=!0,t&&r.current.isPointerDown&&Md(l,e)&&Dd(l,n)&&(r.current.isPointerDown=!1,a(l))},d=_d(e.current);return d.addEventListener("mousedown",i,!0),d.addEventListener("mouseup",o,!0),d.addEventListener("touchstart",i,!0),d.addEventListener("touchend",s,!0),()=>{d.removeEventListener("mousedown",i,!0),d.removeEventListener("mouseup",o,!0),d.removeEventListener("touchstart",i,!0),d.removeEventListener("touchend",s,!0)}}),[t,e,a,r,l])}const qd=e=>{const{pivotRef:t,getRowKey:l,size:n}=js(),{scrollbarRef:a,clicked:r,setHighlightKey:i,setClicked:o}=hd(),{flatGroupData:s}=t.current,{rowHighlight:d}=t.current.props,u=q.default.useMemo((()=>2*bi.rowHeightMaps[n]),[n]),c=q.default.useMemo((()=>s.filter((e=>!As(e)))),[s]),f=st((t=>{var n,s;const{keyCode:f}=t;if(!De(r)&&(27===f&&(i(""),o([])),38===f||40===f)){Zl(t);const p=c.length;let m=c.findIndex((e=>l(e,e.index)===r[0]));const h=38===f?(--m+p)%p:++m%p,g=c[h],v=l(g,g.index);d&&!(null===(n=d.disabled)||void 0===n?void 0:n.call(d,g))&&(i(v),null===(s=d.onChange)||void 0===s||s.call(d,v,g)),((t,l,n)=>{const r=c.length,i=e.find((e=>e.key===n)),o=a.current.scrollTop,s=a.current.container.offsetHeight,d=i.top,f=i.height;"top"===t?d<o?a.current.SET_SCROLL_TOP(d):l===r-1&&a.current.SET_SCROLL_TOP(d-(s-f)):d+f>o+(s-u)?a.current.SET_SCROLL_TOP(d-(s-u-f)):0===l&&a.current.SET_SCROLL_TOP(d)})(38===f?"top":"bottom",h,v),o([v,r[1]])}}));q.default.useLayoutEffect((()=>(window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f))),[])},$d=()=>q.default.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.createElement("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"})),jd=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.createElement("path",{d:"M839.111111 269.198222V122.908444A9.159111 9.159111 0 0 0 829.980444 113.777778H208.213333A9.159111 9.159111 0 0 0 199.111111 122.908444v146.289778c0 5.034667 4.124444 9.159111 9.130667 9.159111h64a9.159111 9.159111 0 0 0 9.159111-9.159111V196.067556h192v640h-105.159111a9.159111 9.159111 0 0 0-9.130667 9.130666v64c0 5.034667 4.124444 9.159111 9.130667 9.159111h301.738666a9.159111 9.159111 0 0 0 9.130667-9.159111v-64a9.159111 9.159111 0 0 0-9.130667-9.130666h-105.159111v-640h192v73.130666c0 5.034667 4.124444 9.159111 9.159111 9.159111h64a9.159111 9.159111 0 0 0 9.130667-9.159111z"})),Kd=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.createElement("path",{d:"M887.65217391 606.59279489a31.26857185 31.26857185 0 0 1-31.26857185-31.26857087v-363.48819946L158.38608696 909.83354065a31.26857185 31.26857185 0 1 1-44.21962762-44.21962761l697.99751609-698.06906805h-363.48819945a31.26857185 31.26857185 0 0 1 0-62.46559075h439.04795087c17.17267109 0 31.26857185 13.95279489 31.26857086 31.19701891v439.04795087a31.26857185 31.26857185 0 0 1-31.3401238 31.26857087z"})),Vd=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.createElement("path",{d:"M606.4 103.424a64 64 0 0 1 0.704 0.64l320.256 280.32a64 64 0 0 1 7.104 89.024l-330.432 398.72 320.448 0.128a32 32 0 0 1 0 64.064H397.632a32.128 32.128 0 0 1-6.208-0.64h-20.736a64 64 0 0 1-42.304-16.064l-238.08-210.112A64 64 0 0 1 83.84 620.16l432.32-509.312a64 64 0 0 1 90.24-7.36zM242.048 537.536l-87.04 101.76a32 32 0 0 0 3.584 45.248l213.12 180.672a32 32 0 0 0 20.736 7.616l-0.64-0.064a32.192 32.192 0 0 1 5.76-0.512h102.016a32 32 0 0 0 18.176-10.496l40.96-47.232-316.672-276.992zM592.96 177.28a32 32 0 0 0-45.12 3.456L283.712 488.96l316.928 277.248 264.512-304.96a32 32 0 0 0 1.024-40.704l-3.904-4.16-268.928-238.72a32 32 0 0 0-0.384-0.32z"})),zd=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.createElement("path",{d:"M607.75537778 291.05948444H223.6416l115.34336-115.41617778a36.37248 36.37248 0 1 0-51.48216889-51.44576L132.61937778 279.04455111c-13.54410667 13.50769778-21.04433778 31.67573333-21.11715556 50.97244444a71.72551111 71.72551111 0 0 0 21.11715556 51.51857778l154.88341333 154.91982222a36.29966222 36.29966222 0 0 0 51.48216889 0 36.37248 36.37248 0 0 0 0-51.48216889l-121.46005333-121.16878222H607.75537778c130.70791111 0 237.02186667 106.16832 237.02186667 236.65777777s-106.31395555 236.65777778-237.02186667 236.65777778h-254.13404445a36.40888889 36.40888889 0 0 0 0 72.81777779h254.13404445c170.83050667 0 309.83964445-138.82709333 309.83964444-309.47555557 0-170.64846222-139.00913778-309.47555555-309.83964444-309.47555555"})),Wd=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.createElement("path",{d:"M512 680.20451555l354.04003555-354.04003556a48.54556445 48.54556445 0 0 1 68.64213334 68.64213334L546.32220445 783.16999111a48.54556445 48.54556445 0 0 1-68.64213334 0L89.31555555 394.80775111a48.54556445 48.54556445 0 0 1 68.64327112-68.64327112L512 680.20451555z"})),Bd=e=>{const{column:t,keyPath:l,type:n}=e,{prefixCls:a,countMethod:r,summationData:i,setCountMethod:o}=js(),{t:s}=ot(),{dataIndex:u,filter:c}=t,[f,p]=q.default.useState(!1),m=q.default.useMemo((()=>{const e=[{text:s("qm.pivotGrid.count.records"),value:"count",fn:Hs.count},{text:s("qm.pivotGrid.count.unique"),value:"unique",fn:Hs.unique},{text:s("qm.pivotGrid.count.empty"),value:"empty",fn:Hs.empty},{text:s("qm.pivotGrid.count.notEmpty"),value:"notEmpty",fn:Hs.notEmpty},{text:s("qm.pivotGrid.count.sum"),value:"sum",fn:Hs.sum},{text:s("qm.pivotGrid.count.max"),value:"max",fn:Hs.max},{text:s("qm.pivotGrid.count.min"),value:"min",fn:Hs.min},{text:s("qm.pivotGrid.count.avg"),value:"avg",fn:Hs.avg}];return"number"===(null==c?void 0:c.type)?e:e.slice(0,-4)}),[]),h=q.default.useMemo((()=>{var e,t,a;const o=r[u];if(!o)return s("qm.pivotGrid.count.statistic");const d=m.find((e=>e.value===o)).text,c=null!==(a=null===(t=null===(e=((e,t)=>t?Fs(e,t):e)(i,l))||void 0===e?void 0:e[n])||void 0===t?void 0:t[u])&&void 0!==a?a:"";return d+" "+Da(c)}),[i,r]);return q.default.createElement(d.Dropdown,{open:f,trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container"),style:{padding:5}},q.default.createElement("div",{className:"list"},m.map((e=>{const t=e.value===r[u];return q.default.createElement("li",{key:e.value,className:J.default("ant-dropdown-menu-item check-item",{active:t}),onClick:()=>{o({[u]:t?void 0:e.value}),p(!1)}},q.default.createElement("span",{className:"label"},e.text),q.default.createElement("i",{className:"icon"},q.default.createElement(g.CheckOutlined,null)))})))),className:J.default("count-select",{show:!!r[u]}),overlayClassName:`${a}__popper`,placement:"bottomRight",overlayStyle:{minWidth:140},onOpenChange:e=>p(e)},q.default.createElement("span",null,h," ",q.default.createElement(g.CaretDownOutlined,{className:"icon"})))},Ud=(e,t)=>{const{pivotRef:l,columns:n,expandedKeys:a,searchResults:r,switchIndex:i,fillColorCells:o,setExpandedKeys:s}=js(),{gridRef:u,indentDepth:c,highlightKey:f,checkedColumnKey:p,selectionKeys:m,treeExpandKeys:h,setSelectionKeys:v,setTreeExpandKeys:y,setHighlightKey:b,setClicked:x}=hd(),{keyRecordMap:E,isTree:C}=l.current,{bodyEl:w,rowVirtualizer:S}=u.current,{rowSelection:N,treeExpandable:T,rowHighlight:I,openRowDraggable:O,onRowEdit:R,onRowClick:k}=l.current.props,{t:L}=ot(),{renderText:P,getTitleFromCellNode:A}=Oi(),{expandableColumn:F,selectionColumn:_,operationColumn:D,treeTable:M}=bi,{indentWidth:H}=ks,$=q.default.useMemo((()=>t?0:Ls(n).length-e.length),[n,e]),j=q.default.useMemo((()=>"radio"!==(null==N?void 0:N.type)),[N]),K=(e,t)=>{var l,n;null==N||N.checkStrictly;const a=j?e?[...m,t]:m.filter((e=>e!==t)):[t];v(a),null===(l=null==N?void 0:N.onSelect)||void 0===l||l.call(N,e,E.get(t)),null===(n=null==N?void 0:N.onChange)||void 0===n||n.call(N,a,V(a))},V=e=>{const t=[];return e.forEach((e=>t.push(E.get(e)))),t},z=(e,t)=>{var l,n;return(null===(l=r[i])||void 0===l?void 0:l.rowKey)===e&&(null===(n=r[i])||void 0===n?void 0:n.dataIndex)===t},W=(e,t)=>{const l=w.querySelectorAll(`li.table-row[data-row-key='${e}']`);Array.from(l).forEach((e=>{e.classList[t&&!(null==S?void 0:S.isScrolling)?"add":"remove"]("row--hover")}))},B=e=>q.default.createElement("button",{className:J.default("button-icon",{expand:a.includes(e.id)}),onClick:()=>{return t=e.id,void s(a.includes(t)?a.filter((e=>e!==t)):[...a,t]);var t}},q.default.createElement(g.CaretRightOutlined,null)),U=(l,a,r,i)=>{const{dataIndex:o,width:s,renderWidth:d}=l,u={"expandable-column":o===_},f=a===(t?e.length>1?1:0:-1)?(c-r._groupLevel)*H:0,p={width:`${(s||d||0)+f}px`,minWidth:`${(s||d||0)+f}px`};return q.default.createElement("div",{key:o,className:J.default("label-cell",u),style:p},o!==_?q.default.createElement(q.default.Fragment,null,1===a&&(e=>{const{_record:t,_fieldName:l}=e,a=Pa(t,l),r=n.find((e=>e.dataIndex===l));if(De(a)||!r)return q.default.createElement("span",{className:"title empty"},L("qm.pivotGrid.group.empty"));const i=r.render?r.render(a,t,r,0,0):P(a,r,t);return r.translate?q.default.createElement(Hr,{text:A(i),tag:"span",className:"title"},i):q.default.createElement("span",{className:"title"},i)})(r),o!==D&&q.default.createElement(Bd,{column:l,keyPath:r.id,type:"subtotal"})):B(r))},G=(e,t)=>{var l,n;const a=null===(l=null==T?void 0:T.rowExpandable)||void 0===l?void 0:l.call(T,e);return(null===(n=e.children)||void 0===n?void 0:n.length)?q.default.createElement("span",{className:J.default("cell--expand",{fold:!h.includes(t),disabled:a}),onClick:()=>{a||(e=>{var t,l;const n=h.includes(e),a=n?h.filter((t=>t!==e)):[...h,e];y(a),null===(t=null==T?void 0:T.onExpand)||void 0===t||t.call(T,!n,E.get(e)),null===(l=null==T?void 0:T.onChange)||void 0===l||l.call(T,a)})(t)}},q.default.createElement("span",{className:"anticon icon"},q.default.createElement(Wd,null))):q.default.createElement("span",{className:"cell--indent",style:{marginTop:-1,width:M.textIndent}})},Y=(e,t,l,n,a)=>{var r,i;const{dataIndex:s,width:u,renderWidth:c,align:f,translate:h,render:v}=e,y=Pa(l,s),E=v?v(y,l,e,l.index,t):P(y,e,l),w=((e,t)=>[F,_,D].includes(t)?"":A(e))(E,s),S=m.includes(a),T={"selection-column":s===_,"col--center":"center"===f,"col--right":"right"===f,"col--checked":p===s,active:z(a,s)},L={width:`${u||c||0}px`,minWidth:`${u||c||0}px`,backgroundColor:o.get(`${a}|${s}`)};return q.default.createElement("div",{key:s,"data-col-index":t,title:w,className:J.default("table-cell",T),style:L,onClick:t=>{var n,r;[_,D].includes(s)||(x([a,s]),I&&!(null===(n=I.disabled)||void 0===n?void 0:n.call(I,l))&&(b(a),null===(r=I.onChange)||void 0===r||r.call(I,a,l)),null==k||k(l,e,t))}},s!==_?q.default.createElement(q.default.Fragment,null,C&&1===t&&q.default.createElement(q.default.Fragment,null,(H=l._level)?q.default.createElement("span",{key:H,className:`cell--indent indent-level-${H}`,style:{marginTop:-1,width:H*M.textIndent}},new Array(H).fill(null).map(((e,t)=>q.default.createElement("i",{key:t,className:"line"})))):null,G(l,a)),h?q.default.createElement(Hr,{text:w,tag:"span",className:"cell"},E):q.default.createElement("span",{className:"cell"},E)):q.default.createElement("div",{className:"action"},O?q.default.createElement("span",{className:"drag-icon"},q.default.createElement(g.HolderOutlined,null)):q.default.createElement("span",{style:{width:20}}),q.default.createElement("div",{className:"middle"},q.default.createElement("span",{className:"order"},((e,t)=>C?0===e._level?e._varIndex+1:null:t+1)(l,n)),N&&q.default.createElement(q.default.Fragment,null,j?q.default.createElement(d.Checkbox,{className:"checkbox",checked:S,disabled:null===(r=null==N?void 0:N.disabled)||void 0===r?void 0:r.call(N,l),onChange:e=>K(e.target.checked,a)}):q.default.createElement(d.Radio,{className:"checkbox",checked:S,disabled:null===(i=null==N?void 0:N.disabled)||void 0===i?void 0:i.call(N,l),onChange:e=>K(e.target.checked,a)}))),R?q.default.createElement("span",{className:"expand-icon",onClick:()=>R(l,n)},q.default.createElement(g.ExpandAltOutlined,null)):q.default.createElement("span",{style:{width:20}})));var H};return{renderGroupRow:(t,l)=>q.default.createElement("div",{className:"label-row"},e.map(((e,l)=>U(e,$+l,t)))),renderRow:(t,l,n)=>{const a={"row--selection":m.includes(n),"row--highlight":f===n};return q.default.createElement("li",{key:n,"data-row-key":n,className:J.default("table-row",a),onMouseEnter:()=>W(n,!0),onMouseLeave:()=>W(n)},e.map(((e,a)=>Y(e,$+a,t,l,n))))}}},Gd=e=>{const{layout:t,displayList:l,virtualRows:n,notGroup:a}=e,{fixedWidth:r,gridColumns:i}=hd(),o=q.default.useMemo((()=>i.filter((e=>"left"===e.fixed))),[i]),{renderGroupRow:s,renderRow:d}=Ud(o,!0);return q.default.createElement("div",{className:"left-panel",style:{width:r}},q.default.createElement("div",{className:J.default("container",{"no-group":a})},n.map((e=>{const n=e.index,a=t[n],r=l[n];if(As(r))return q.default.createElement("div",{key:r.id,className:J.default("group-label",`level${r._groupLevel}`),style:{top:a.top,left:a.left,right:0,height:a.height}},s(r,a.key));const i=n===t.length-1||As(l[n+1]);return q.default.createElement("div",{key:a.key,className:J.default("row-item",{"is-leaf":r._level,last:i}),style:{top:a.top,left:a.left,right:0,height:a.height}},d(r,r._varIndex,a.key))}))))},Yd=e=>{const{layout:t,displayList:l,virtualRows:n,notGroup:a}=e;js();const{gridColumns:r}=hd(),i=q.default.useMemo((()=>r.filter((e=>"left"!==e.fixed))),[r]),{renderGroupRow:o,renderRow:s}=Ud(i);return q.default.createElement("div",{className:"main-panel"},q.default.createElement("div",{className:J.default("container",{"no-group":a})},n.map((e=>{const n=e.index,a=t[n],r=l[n];if(As(r))return q.default.createElement("div",{key:r.id,className:J.default("group-label",`level${r._groupLevel}`),style:{top:a.top,left:0,right:a.right,height:a.height}},o(r,a.key));const i=n===t.length-1||As(l[n+1]);return q.default.createElement("div",{key:a.key,className:J.default("row-item",{last:i}),style:{top:a.top,left:0,right:a.right,height:a.height}},s(r,r._varIndex,a.key))}))))},Xd=()=>{const{pivotRef:e,getRowKey:t,prefixCls:l,size:n,groupGridData:a,expandedKeys:r,searchResults:i,switchIndex:o}=js(),{scrollbarRef:s,gridColumns:d,treeExpandKeys:u,setGridLayoutRef:c}=hd(),{flatGroupData:f}=e.current,{contextMenues:p}=e.current.props,{groupMargin:m}=ks,{rowHeightMaps:h}=bi,g=q.default.useRef(null),v=q.default.useMemo((()=>Array.isArray(a)),[a]),{contextMenu:y,closeMenu:b}=(({ref:e,popup:t,getTriggerContainer:l,prevent:n,prefixCls:a="",enabled:r=!0})=>{const i=q.default.useRef(null),o=q.default.useRef(null),s=e=>{o.current=e},[d,u]=q.default.useState(!1),[c,f]=q.default.useState(null),p={width:150,height:200,zIndex:9999};Hd({ref:i,handler:()=>m()});const m=()=>{u(!1),f(null),s(null)},h=st((e=>{if(e.preventDefault(),null==n?void 0:n(e.target))return m();s(e),u(!0),Fe((()=>{var t;const{width:l,height:n}=(null===(t=i.current)||void 0===t?void 0:t.getBoundingClientRect())||p,a=l,r=n,o=window.innerWidth,s=window.innerHeight;let d=e.clientX,u=e.clientY;d+a>o&&(d=Math.max(d-a,0)),u+r>s&&(u=Math.max(u-r,0)),f({x:d,y:u})}))}));q.default.useEffect((()=>{const t=(null==l?void 0:l(e.current))||e.current;return r&&t&&t.addEventListener("contextmenu",h),()=>{t&&t.removeEventListener("contextmenu",h)}}),[e]);const g={position:"fixed",top:`${(null==c?void 0:c.y)||0}px`,left:`${(null==c?void 0:c.x)||0}px`,zIndex:p.zIndex};return{contextMenu:q.default.createElement(ue.default,{open:d},q.default.createElement("div",{ref:i,className:`${a}__context-menu`,style:g},o.current?t(o.current):null)),closeMenu:m}})({ref:g,prevent:e=>e.offsetParent.classList.contains("group-label"),prefixCls:l,enabled:!!p,popup:e=>{var l;const n=an(e.target,"table-cell"),a=(null===(l=null==n?void 0:n.parentNode)||void 0===l?void 0:l.getAttribute("data-row-key"))||"",r=f.find((e=>t(e,e.index)==a)),i=Number((null==n?void 0:n.getAttribute("data-col-index"))||-1),o=d[i];return q.default.createElement("ul",{className:"ant-dropdown-menu",style:{padding:5}},p.map((e=>{var t;const l=(null===(t=e.disabled)||void 0===t?void 0:t.call(e,r,o))||!1;return q.default.createElement("li",{key:e.key,className:J.default("ant-dropdown-menu-item",{"ant-dropdown-menu-item-disabled":l}),onClick:()=>{var t;l||(Fe((()=>b())),null===(t=e.onClick)||void 0===t||t.call(e,r,o))}},e.prefix&&q.default.createElement("span",{className:"prefix"},e.prefix),q.default.createElement("span",{className:"label"},e.label),e.suffix&&q.default.createElement("span",{className:"suffix"},e.suffix))})))}}),x=e=>{var t;const l=f[e];for(let n=e+1;n<f.length;n++)if(null===(t=f[n]._parentRowKey)||void 0===t?void 0:t.startsWith(l.id)){Object.assign(l,{_record:f[n]});break}},E=q.default.useMemo((()=>{const e=new Map,l=[];return f.forEach(((n,a)=>{if(As(n)){if(0===n._groupLevel)return e.set(n.id,r.includes(n.id)),x(a),void l.push(n);const t=n.id.slice(0,n.id.lastIndexOf(ks.separator));return void(r.includes(t)&&e.get(t)&&(e.set(n.id,r.includes(n.id)),x(a),l.push(n)))}const i=t(n,n.index);n._parentRowKey&&!e.get(n._parentRowKey)||(e.set(i,u.includes(i)),l.push(n))})),e.clear(),l}),[a,r,u]),C=q.default.useMemo((()=>((e,{getRowKey:t,rowHeight:l})=>{const n=[],a=[],r=l,i=ks.indentWidth,o=ks.groupMargin;let s=o;for(e.forEach((e=>{if(void 0!==e._groupLevel){for(;a.length>0&&a[a.length-1]._level>=e._groupLevel;){const e=a.pop();if(e.height=e._childHeight+r,n[e._index].height=e.height,a.length>0){const t=a[a.length-1];t._childHeight+=e.height+o,t._subGroupCount+=1}s+=o}a[a.length-1];const t={key:e.id,top:s,left:i*e._groupLevel,right:i*e._groupLevel,height:r,_childHeight:0,_subGroupCount:0,_index:n.length,_level:e._groupLevel};n.push(t),a.push(t),s+=r}else{const l=a[a.length-1]||{left:0,right:0},i={key:t(e,e.index),top:s,left:l.left,right:l.right,height:r};n.push(i),s+=r,a.length>0&&(l._childHeight+=r)}}));a.length>0;){const e=a.pop();if(e.height=e._childHeight+r,n[e._index].height=e.height,a.length>0){const t=a[a.length-1];t._childHeight+=e.height+o,t._subGroupCount+=1}s+=o}return n})(E,{getRowKey:t,rowHeight:h[n]})),[E,n]);qd(C);const w=q.default.useMemo((()=>!E.length),[E]),S=q.default.useMemo((()=>{if(w)return 106;if(v)return C.reduce(((e,t)=>e+t.height),0)+2*m;const e=C.filter((e=>0===e._level));return e.reduce(((e,t)=>e+t.height),0)+(e.length-1)*m+2*m}),[w,v,C]),{rowVirtualizer:N,virtualRows:T}=(e=>{const{layout:t,isGroup:l}=e,{size:n}=js(),{scrollbarRef:a}=hd(),{rowHeightMaps:r}=bi,i=q.default.useMemo((()=>{var e;return(null===(e=a.current)||void 0===e?void 0:e.scrollElement)||null}),[a.current]),o=Fd({count:t.length,getScrollElement:()=>i,estimateSize:e=>t[e].height,overscan:1,noCache:l,rangeExtractor:e=>{if(!l)return Sd(e);const a=e.offset,i=o.scrollElement.offsetHeight,s=[];for(let l=0;l<e.count;l++){const e=t[l];a>e.top+e.height+r[n]||a+i+r[n]<e.top||s.push(l)}return s}}),s=o.getVirtualItems();return{rowVirtualizer:o,virtualRows:s}})({layout:C,isGroup:!v});Yl((()=>{const e=f.findIndex((e=>{var l;return t(e,e.index)===(null===(l=i[o])||void 0===l?void 0:l.rowKey)}));e>=0&&s.current.SET_SCROLL_TOP(e*h[n]);const l=d.findIndex((e=>{var t;return e.dataIndex===(null===(t=i[o])||void 0===t?void 0:t.dataIndex)}));if(l>=0){const e=d.slice(0,l).filter((e=>"left"!==e.fixed)).reduce(((e,t)=>e+(t.width||t.renderWidth)),0);s.current.SET_SCROLL_LEFT(e)}}),[o,i]),q.default.useLayoutEffect((()=>{c("bodyEl",g.current),c("rowVirtualizer",N)}),[]);const I={layout:C,displayList:E,virtualRows:T,notGroup:v};return q.default.createElement("div",{ref:g,className:"body",style:{height:S}},w?q.default.createElement(pn,{className:"content-empty"}):q.default.createElement(q.default.Fragment,null,q.default.createElement(Gd,I),q.default.createElement(Yd,I),y))},Qd=()=>{const{groupGridData:e,countMethod:t,setSummationData:l}=js(),{indentDepth:n,fixedWidth:a,gridColumns:r}=hd(),{selectionColumn:i}=bi,{indentWidth:o}=ks,s=q.default.useMemo((()=>r.filter((e=>"left"===e.fixed))),[r]),d=q.default.useMemo((()=>r.filter((e=>"left"!==e.fixed))),[r]);Yl((()=>{l(((e,t)=>{const l=[],n=e=>{const l={};for(const n in t){const a=e.map((e=>Me(e,n)));l[n]=t[n](a)}return l},a=e=>{if(Array.isArray(e))return l.push(...e),{total:n(e)};const r={},i={};Object.keys(t).forEach((e=>{i[e]=[]}));for(const n in e){const o=e[n];if(Array.isArray(o)){l.push(...o);const e={};for(const l in t){const n=o.map((e=>Me(e,l)));e[l]=t[l](n),i[l].push(...n)}r[n]={subtotal:e}}else{const e=a(o);r[n]=e;for(const l in t){const t=e.subtotal[l];void 0!==t&&i[l].push(t)}}}if(0===l.length)return r;const o={};for(const e in t)o[e]=t[e](i[e]);return r.subtotal=o,r},r=Array.isArray(e)?{total:n(e)}:a(e);return l.length>0&&(r.total=n(l)),delete r.subtotal,r})(e,(e=>{const t={};for(const l in e)e[l]&&Object.assign(t,{[l]:Hs[e[l]]});return t})(t)))}),[t,e]);const u=(e,t)=>q.default.createElement("div",{className:J.default(t?"fixed-left":"no-fixed"),style:{width:t?a:""}},e.map(((l,a)=>{const{dataIndex:r,width:s,renderWidth:d}=l,u={"selection-column":r===i,"col--right":!0},c=a===(t?e.length>1?1:0:e.length-1)?n*o:0,f={width:`${(s||d||0)+c}px`,minWidth:`${(s||d||0)+c}px`};return q.default.createElement("div",{key:r,className:J.default("table-cell",u),style:f},r!==i?q.default.createElement(Bd,{column:l,keyPath:"",type:"total"}):null)})));return q.default.createElement("div",{className:"footer"},u(s,!0),u(d))},Zd=()=>{const{prefixCls:e,size:t}=js(),l=q.default.useRef(null);return q.default.createElement(md,{scrollbar:l},q.default.createElement(_n,{ref:l,wrapStyle:{height:"100%",maxHeight:"inherit"},className:J.default(`${e}__layout`,t)},q.default.createElement(yd,null),q.default.createElement(Xd,null),q.default.createElement(Qd,null)))},Jd=()=>q.default.createElement("div",{className:"wrapper"},q.default.createElement(Zd,null)),eu={rowKey:"id",columns:[],dataSource:[]},tu=e=>{const t=je(eu,e),{rowKey:l,fromTable:n,columns:a,dataSource:r,height:i,maxHeight:o,className:s,style:d}=t,{$size:u}=dt(t),c=st(((e,t)=>{const n="function"==typeof l?l(e,t):null==e?void 0:e[l];return void 0===n?(ft("PivotGrid","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):n})),f=(e,t="",l=0)=>e.map(((e,n)=>{const a=c(e,e.index);return e.index=n,e._level=l,Array.isArray(e.children)&&(e.children=f(e.children,a,l+1)),t?Object.assign(e,{_parentRowKey:t}):e})),p=e=>{let t=(e=>e.filter((e=>![bi.expandableColumn,bi.selectionColumn,"index","pageIndex"].includes(e.dataIndex))))(e).map((e=>Object.assign(Object.assign({},e),{fixed:"left"===e.fixed?"left":void 0,editRender:void 0})));return n&&(t=t.filter((e=>![bi.operationColumn].includes(e.dataIndex)))),t},m=q.default.useMemo((()=>p(a)),[a]),h=q.default.useMemo((()=>f(r)),[r]),g=gt("pivot-grid"),v={[g]:!0,"is-from-table":n},y={height:i,maxHeight:o},b={prefixCls:g,size:u,getRowKey:c,flatColumns:m,tableData:h,pivotProps:He(t,["columns","dataSource","rowKey","size","height","maxHeight","className","style"])};return q.default.createElement("div",{className:J.default(v,s),style:Object.assign(Object.assign({},d),y)},q.default.createElement($s,b,q.default.createElement(fd,null),q.default.createElement(Jd,null)))};tu.displayName="PivotGrid";const lu=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{tableRef:n,prefixCls:a,flattenColumns:r}=q.default.useContext(ei),{rowKey:i,uniqueKey:o}=n.current.props,{t:s}=ot(),{tableFullData:d}=n.current,[u,c]=q.default.useState(!1),f=()=>{c(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:f})));const p={visible:u,title:s("qm.table.pivotGrid.settingTitle"),width:"80vw",loading:!1,bodyStyle:{padding:0},onClose:()=>c(!1)};return q.default.createElement(q.default.Fragment,null,l&&q.default.createElement("span",{className:`${a}-pivot-grid`,title:s("qm.table.pivotGrid.text"),onClick:()=>f()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.LineChartOutlined,null))),q.default.createElement(Qn,p,q.default.createElement(tu,{fromTable:!0,rowKey:i,uniqueKey:o,columns:r,dataSource:d})))}));lu.displayName="PivotGrid";const nu=e=>{const{columns:t,group:n,summary:a}=e,{tableRef:r,$size:i,pagination:o,fetchParams:s,isFetch:d}=q.default.useContext(ei),{fetch:u}=r.current.props,{t:c}=ot(),f=e=>{var l;const n=t.find((t=>t.dataIndex===e));return{title:n.title,precision:n.precision,dictItems:null!==(l=n.dictItems)&&void 0!==l?l:[]}},p=n.map((e=>Object.assign({dataIndex:e.group},f(e.group)))),m=a.map((e=>e.summary===bi.groupSummary.total.value?{dataIndex:e.summary,title:bi.groupSummary.total.text,formula:e.formula}:Object.assign(Object.assign({dataIndex:e.summary},f(e.summary)),{formula:e.formula}))),h=q.default.useMemo((()=>Object.assign({},s,{[bi.sorterFieldName]:void 0,[bi.groupSummary.summaryFieldName]:a.map((e=>`${e.formula}|${e.summary}`)).join(","),[bi.groupSummary.groupbyFieldName]:n.map((e=>e.group)).join(","),usedJH:2,[bi.currentPageName]:1})),[s,n,a]),[g,v]=q.default.useState(((e,l)=>[{title:c("qm.table.groupSummary.index"),dataIndex:"pageIndex",width:80,render:e=>e+1},...e.map((e=>({title:e.title,dataIndex:e.dataIndex,dictItems:e.dictItems}))),...l.map((e=>{var l;const n=null===(l=t.find((t=>t.dataIndex===e.dataIndex)))||void 0===l?void 0:l.groupSummary;let a=n?{summation:n}:null;return e.dataIndex===bi.groupSummary.total.value&&(a={dataIndex:bi.groupSummary.recordTotalIndex,summation:{render:()=>o.total}}),Object.assign(Object.assign({},e),"count"===e.formula||"sum"===e.formula?a:null)}))])(p,m)),[y]=q.default.useState(d?[]:(e=>{const t=za(e,n.map((e=>e.group))),r=[];return t.forEach((e=>{const t={};g.forEach((l=>{const{dataIndex:n}=l;"index"!==n&&Aa(t,n,Pa(e[0],n))})),a.forEach((n=>{const a=n.summary!==bi.groupSummary.total.value?n.summary:bi.groupSummary.recordTotalIndex,r=n.formula;"count"===r&&Aa(t,a,e.length),"sum"===r&&Aa(t,a,l.sumBy(e,a)),"max"===r&&Aa(t,a,l.maxBy(e,a)[a]),"min"===r&&Aa(t,a,l.minBy(e,a)[a]),"avg"===r&&Aa(t,a,(l.sumBy(e,a)/e.length).toFixed(2))})),r.push(t)})),r})(r.current.tableFullData)),b=Object.assign(Object.assign({size:i,height:400},d?{fetch:{api:u.api,params:h,dataKey:null==u?void 0:u.dataKey}}:{dataSource:y}),{columns:g,rowKey:e=>e.index,showFastSearch:!1,showTableImport:!1,exportExcel:{fileName:`${j.default().format(si)}.xlsx`},tablePrint:{showLogo:!0},columnsChange:e=>v(e)});return q.default.createElement(wc,b)},au=e=>{const{onClose:t}=e,{global:l}=q.default.useContext(xe),{tableRef:n,prefixCls:a,$size:r,flattenColumns:i}=q.default.useContext(ei),{uniqueKey:o}=n.current.props,{t:s}=ot(),u=q.default.useRef(null),c=q.default.useRef(null),[f,p]=q.default.useState(!1),[m,h]=q.default.useState([]),[v,y]=q.default.useState(""),[b,x]=q.default.useState("");Yl((()=>{if(b){const{group:e,summary:t}=m.find((e=>e.value===b)).list;I(e),L(t)}else{const e=D();I((null==e?void 0:e.group)||[]),L((null==e?void 0:e.summary)||[])}}),[b]),q.default.useEffect((()=>{M()}),[]);const E=q.default.useMemo((()=>o?`summary_${o}`:""),[o]),C=q.default.useMemo((()=>i.filter((e=>![bi.expandableColumn,bi.selectionColumn,"index","pageIndex",bi.operationColumn].includes(e.dataIndex)))),[i]),w=C.filter((e=>!e.groupSummary)).map((e=>({text:ja(e.title),value:e.dataIndex}))),S=[bi.groupSummary.total,...C.filter((e=>!!e.groupSummary)).map((e=>({text:ja(e.title),value:e.dataIndex})))],N=[{text:s("qm.table.groupSummary.sumText"),value:"sum"},{text:s("qm.table.groupSummary.maxText"),value:"max"},{text:s("qm.table.groupSummary.minText"),value:"min"},{text:s("qm.table.groupSummary.avgText"),value:"avg"},{text:s("qm.table.groupSummary.countText"),value:"count"}],[T,I]=q.default.useState([]),[O,R]=q.default.useState([{title:s("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>q.default.createElement("div",null,q.default.createElement(pt,{type:"text",onClick:()=>{u.current.REMOVE_RECORDS(t)}},s("qm.table.groupSummary.removeText")))},{dataIndex:"group",title:s("qm.table.groupSummary.groupItem"),minWidth:200,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:w.map((e=>Object.assign(Object.assign({},e),{disabled:T.findIndex((t=>t.group===e.value))>-1})))})}]),[k,L]=q.default.useState([]),[P,A]=q.default.useState([{title:s("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>q.default.createElement("div",null,q.default.createElement(pt,{type:"text",onClick:()=>{c.current.REMOVE_RECORDS(t)}},s("qm.table.groupSummary.removeText")))},{dataIndex:"summary",title:s("qm.table.groupSummary.summaryColumn"),minWidth:200,editRender:e=>({type:"select",editable:!0,items:S.map((e=>Object.assign(Object.assign({},e),{disabled:k.findIndex((t=>t.summary===e.value))>-1}))),extra:{cornerSign:!1},onChange:t=>{e.formula=""}})},{dataIndex:"formula",title:s("qm.table.groupSummary.calcFormula"),width:140,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:e.summary===bi.groupSummary.total.value?N.slice(N.length-1):N})}]),F=q.default.useMemo((()=>{const e=T.length&&T.every((e=>Object.values(e).every((e=>""!==e)))),t=k.length&&k.every((e=>Object.values(e).every((e=>""!==e))));return!(e&&t)}),[T,k]),_=()=>{E&&sessionStorage.setItem(E,JSON.stringify({group:T.filter((e=>!!e.group)),summary:k.filter((e=>!!e.summary))}))},D=()=>{if(!E)return;const e=sessionStorage.getItem(E);return e?JSON.parse(e):null},M=()=>Ie(void 0,void 0,void 0,(function*(){if(!E)return;const e=D();if(e){const{group:t,summary:l}=e;I(t),L(l)}let t=yield pe.default.getItem(E);t||(t=yield H(E),Array.isArray(t)&&(yield pe.default.setItem(E,t))),Array.isArray(t)&&t.length&&(h(t),!e&&x(t[0].value))})),H=e=>Ie(void 0,void 0,void 0,(function*(){const t=null==l?void 0:l.getComponentConfigApi;if(t)try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),$=(e,t)=>Ie(void 0,void 0,void 0,(function*(){const n=null==l?void 0:l.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),j={visible:f,title:s("qm.table.groupSummary.resultText"),loading:!1,onClose:()=>p(!1)};return q.default.createElement("div",{className:`${a}-group-summary__setting`},q.default.createElement("div",{className:"main"},q.default.createElement("div",{style:{width:"30%"}},q.default.createElement(wc,{ref:u,size:r,columns:O,dataSource:T,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>R(e),onDataChange:e=>{I(e)}},q.default.createElement(pt,{type:"primary",icon:q.default.createElement(g.PlusOutlined,null),onClick:()=>{u.current.INSERT_RECORDS({})},style:{marginRight:0}}))),q.default.createElement("div",{className:"container line"},q.default.createElement(wc,{ref:c,size:r,columns:P,dataSource:k,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>A(e),onDataChange:e=>{L(e)}},q.default.createElement(pt,{type:"primary",icon:q.default.createElement(g.PlusOutlined,null),onClick:()=>{c.current.INSERT_RECORDS({})},style:{marginRight:0}}))),q.default.createElement("div",{className:"saved line"},q.default.createElement("div",{className:"form-wrap"},q.default.createElement(d.Input,{size:r,value:v,placeholder:s("qm.table.groupSummary.configText"),disabled:F,onChange:e=>{const{value:t}=e.target;y(t)}}),q.default.createElement(pt,{type:"primary",disabled:!v||F,style:{marginLeft:"10px"},onClick:()=>Ie(void 0,void 0,void 0,(function*(){if(!E)return ft("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=$a(),t=[...m,{text:v,value:e,list:{group:T.filter((e=>!!e.group)),summary:k.filter((e=>!!e.summary))}}];h(t),x(e),y(""),yield pe.default.setItem(E,t),yield $(E,t)}))},s("qm.table.groupSummary.saveButton"))),q.default.createElement("div",{className:"card-wrap"},q.default.createElement("h5",{style:{height:`${bi.rowHeightMaps[r]}px`}},q.default.createElement("span",null,s("qm.table.groupSummary.savedSetting"))),q.default.createElement("ul",null,m.map((e=>q.default.createElement("li",{key:e.value,className:J.default({selected:e.value===b}),title:e.text,onClick:()=>{return t=e.value,void x(t!==b?t:"");var t}},q.default.createElement("span",{className:"title"},e.text),q.default.createElement("i",{className:"svgicon close",title:s("qm.table.groupSummary.removeText"),onClick:t=>{var l;t.stopPropagation(),l=e.value,Ie(void 0,void 0,void 0,(function*(){if(!l)return;const e=m.filter((e=>e.value!==l));h(e),l===b&&x(""),yield pe.default.setItem(E,e),yield $(E,e)}))}},q.default.createElement(g.CloseCircleOutlined,null))))),!m.length&&q.default.createElement("div",{style:{padding:ni}},q.default.createElement(pn,null)))))),q.default.createElement(Qn,j,q.default.createElement(nu,{columns:C,group:T,summary:k})),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(pt,{onClick:()=>t(),style:{marginRight:8}},s("qm.table.groupSummary.closeButton")),q.default.createElement(pt,{type:"primary",disabled:F,onClick:()=>(_(),void p(!0))},s("qm.table.groupSummary.confirmButton"))))},ru=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{prefixCls:n}=q.default.useContext(ei),{t:a}=ot(),[r,i]=q.default.useState(!1),o=()=>{i(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:o})));const s={visible:r,title:a("qm.table.groupSummary.settingTitle"),loading:!1,width:"65%",bodyStyle:{paddingBottom:"52px"},onClose:()=>i(!1)};return q.default.createElement(q.default.Fragment,null,l&&q.default.createElement("span",{className:`${n}-group-summary`,title:a("qm.table.groupSummary.text"),onClick:()=>o()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.PieChartOutlined,null))),q.default.createElement(Qn,s,q.default.createElement(au,{onClose:()=>i(!1)})))}));ru.displayName="GroupSummary";const iu=e=>{const{onClose:t}=e,{global:l}=q.default.useContext(xe),{tableRef:n,$size:a,prefixCls:r,flattenColumns:i,setSuperFilters:o,clearTableFilter:s,clearPagerFilter:u}=q.default.useContext(ei),{uniqueKey:c}=n.current.props,{t:f}=ot(),p=q.default.useRef(null),[m,h]=q.default.useState([]),[v,y]=q.default.useState([]),[b,x]=q.default.useState(""),[E,C]=q.default.useState("");Yl((()=>{h(E?v.find((e=>e.value===E)).list:M()||[])}),[E]),q.default.useEffect((()=>{H()}),[]);const w=q.default.useMemo((()=>c?`superSearch_${c}`:""),[c]),S=q.default.useMemo((()=>i.filter((e=>!!e.filter))),[i]),N=Va(m),T=q.default.useMemo((()=>!(N&&ca(N))),[N]),I=q.default.useMemo((()=>!!m.length&&T),[m,T]),O=[{value:"and",text:f("qm.table.highSearch.andText")},{value:"or",text:f("qm.table.highSearch.orText")}],R=i.filter((e=>!!e.filter)).map((e=>({value:e.dataIndex,text:ja(e.title)}))),k=e=>["in","nin"].includes(e),L=(e,t)=>{let l;switch(e){case"number":l="number";break;case"date":l="date";break;case"checkbox":case"radio":l=t?"select-multiple":"select";break;default:l="text"}return l},P=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",text:f("qm.table.highSearch.gtText")},{value:"<",text:f("qm.table.highSearch.ltText")},{value:">=",text:f("qm.table.highSearch.gteText")},{value:"<=",text:f("qm.table.highSearch.lteText")},{value:"==",text:f("qm.table.highSearch.eqText")},{value:"!=",text:f("qm.table.highSearch.neqText")},{value:"nil",text:f("qm.table.highSearch.nullText")},{value:"nnil",text:f("qm.table.highSearch.notNullText")}];break;case"checkbox":case"radio":case"tree":t=[{value:"in",text:f("qm.table.highSearch.inText")},{value:"nin",text:f("qm.table.highSearch.ninText")},{value:"==",text:f("qm.table.highSearch.eqText")},{value:"!=",text:f("qm.table.highSearch.neqText")},{value:"nil",text:f("qm.table.highSearch.nullText")},{value:"nnil",text:f("qm.table.highSearch.notNullText")}];break;default:t=[{value:"like",text:f("qm.table.highSearch.inText")},{value:"nlike",text:f("qm.table.highSearch.ninText")},{value:"==",text:f("qm.table.highSearch.eqText")},{value:"!=",text:f("qm.table.highSearch.neqText")},{value:"^=",text:f("qm.table.highSearch.startsWithText")},{value:"=$",text:f("qm.table.highSearch.endsWithText")},{value:"nil",text:f("qm.table.highSearch.nullText")},{value:"nnil",text:f("qm.table.highSearch.notNullText")}]}return t},[A,F]=q.default.useState([{title:f("qm.table.highSearch.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>q.default.createElement("div",null,q.default.createElement(pt,{type:"text",onClick:()=>{p.current.REMOVE_RECORDS(t)}},f("qm.table.highSearch.removeText")))},{title:f("qm.table.highSearch.bracket"),dataIndex:"bracketLeft",align:"right",width:80,render:(e,t)=>q.default.createElement("span",{style:{fontSize:"20px"}},e)},{title:f("qm.table.highSearch.fieldName"),dataIndex:"fieldName",width:160,required:!0,dictItems:R,editRender:e=>({type:"select",editable:!0,rules:[{required:!0,message:f("qm.table.highSearch.noEmpty")}],extra:{cornerSign:!1},onChange:t=>{var l,n;const a=Object.values(t)[0],r=null===(l=S.find((e=>e.dataIndex===a)))||void 0===l?void 0:l.filter.type,i=P(r);e.fieldType=r,e.expression=a?null===(n=i[0])||void 0===n?void 0:n.value:"",e.condition=k(e.expression)?[]:"",a||(e.bracketLeft=e.bracketRight="")}})},{title:f("qm.table.highSearch.fieldType"),dataIndex:"fieldType",width:100,hidden:!0},{title:f("qm.table.highSearch.expression"),dataIndex:"expression",width:120,required:!0,editRender:e=>{var t;const l=null===(t=S.find((t=>t.dataIndex===e.fieldName)))||void 0===t?void 0:t.filter.type;return{type:"select",editable:!0,items:P(l),extra:{disabled:!e.fieldName,cornerSign:!1},onChange:()=>{e.condition=k(e.expression)?[]:""}}}},{title:f("qm.table.highSearch.condition"),dataIndex:"condition",minWidth:200,editRender:e=>{var t,l,n;const a=S.find((t=>t.dataIndex===e.fieldName)),r=null==a?void 0:a.filter.type,i=null!==(n=null!==(l=null===(t=null==a?void 0:a.filter)||void 0===t?void 0:t.items)&&void 0!==l?l:null==a?void 0:a.dictItems)&&void 0!==n?n:[];return{type:L(r,k(e.expression)),editable:!0,items:i,extra:{disabled:!e.fieldName||Za(e.expression),cornerSign:!1}}}},{title:f("qm.table.highSearch.bracket"),dataIndex:"bracketRight",width:80,render:(e,t)=>q.default.createElement("span",{style:{fontSize:"20px"}},e)},{title:f("qm.table.highSearch.logic"),dataIndex:"logic",width:100,required:!0,dictItems:O,editRender:e=>({type:"select",editable:!0,extra:{disabled:!e.fieldName,cornerSign:!1}})}]),_=()=>{s(),u(),o(m.map((e=>He(e,["index","pageIndex"])))),D(),t()},D=()=>{w&&sessionStorage.setItem(w,JSON.stringify(m.filter((e=>!!e.fieldName))))},M=()=>{if(!w)return;const e=sessionStorage.getItem(w);return e?JSON.parse(e):null},H=()=>Ie(void 0,void 0,void 0,(function*(){if(!w)return;const e=M();e&&h(e);let t=yield pe.default.getItem(w);t||(t=yield $(w),Array.isArray(t)&&(yield pe.default.setItem(w,t))),Array.isArray(t)&&t.length&&(y(t),!e&&C(t[0].value))})),$=e=>Ie(void 0,void 0,void 0,(function*(){const t=null==l?void 0:l.getComponentConfigApi;if(t)try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),j=(e,t)=>Ie(void 0,void 0,void 0,(function*(){const n=null==l?void 0:l.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}}));return q.default.createElement("div",{className:`${r}-super-search__setting`},q.default.createElement("div",{className:"main"},q.default.createElement("div",{className:"container"},q.default.createElement(wc,{ref:p,size:a,columns:A,dataSource:m,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>F(e),onRowClick:(e,t)=>{const{dataIndex:l}=t;e.fieldName&&["bracketLeft","bracketRight"].includes(l)&&("bracketLeft"===l&&(e[l]=e[l]?"":"("),"bracketRight"===l&&(e[l]=e[l]?"":")"),h([...m]))},onDataChange:e=>{h(e)}},q.default.createElement(pt,{type:"primary",icon:q.default.createElement(g.PlusOutlined,null),onClick:()=>{p.current.INSERT_RECORDS({bracketLeft:"",bracketRight:"",logic:"and"})},style:{marginRight:0}})),bi.highSearch.showSQL&&N&&q.default.createElement("code",{className:"lang-js"},N)),q.default.createElement("div",{className:"saved line"},q.default.createElement("div",{className:"form-wrap"},q.default.createElement(d.Input,{size:a,value:b,placeholder:f("qm.table.highSearch.configText"),disabled:T,onChange:e=>{const{value:t}=e.target;x(t)}}),q.default.createElement(pt,{type:"primary",disabled:!b||T,style:{marginLeft:"10px"},onClick:()=>Ie(void 0,void 0,void 0,(function*(){if(!w)return ft("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=$a(),t=[...v,{text:b,value:e,list:m.filter((e=>!!e.fieldName))}];y(t),C(e),x(""),yield pe.default.setItem(w,t),yield j(w,t)}))},f("qm.table.highSearch.saveButton"))),q.default.createElement("div",{className:"card-wrap"},q.default.createElement("h5",{style:{height:`${bi.rowHeightMaps[a]}px`}},q.default.createElement("span",null,f("qm.table.highSearch.savedSetting"))),q.default.createElement("ul",null,v.map((e=>q.default.createElement("li",{key:e.value,className:J.default({selected:e.value===E}),title:e.text,onClick:()=>{return t=e.value,void C(t!==E?t:"");var t}},q.default.createElement("span",{className:"title"},e.text),q.default.createElement("i",{className:"svgicon close",title:f("qm.table.highSearch.removeText"),onClick:t=>{var l;t.stopPropagation(),l=e.value,Ie(void 0,void 0,void 0,(function*(){if(!l)return;const e=v.filter((e=>e.value!==l));y(e),l===E&&C(""),yield pe.default.setItem(w,e),yield j(w,e)}))}},q.default.createElement(g.CloseCircleOutlined,null))))),!v.length&&q.default.createElement("div",{style:{padding:ni}},q.default.createElement(pn,null)))))),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(pt,{onClick:()=>t(),style:{marginRight:8}},f("qm.table.highSearch.closeButton")),q.default.createElement(pt,{type:"primary",disabled:I,onClick:()=>_()},f("qm.table.highSearch.searchButton"))))},ou=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{prefixCls:n}=q.default.useContext(ei),{t:a}=ot(),[r,i]=q.default.useState(!1),o=()=>{i(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:o})));const s={visible:r,title:a("qm.table.highSearch.settingTitle"),loading:!1,width:"70%",bodyStyle:{paddingBottom:"52px"},onClose:()=>i(!1)};return q.default.createElement(q.default.Fragment,null,l&&q.default.createElement("span",{className:`${n}-super-search`,title:a("qm.table.highSearch.text"),onClick:()=>o()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.FunnelPlotOutlined,null))),q.default.createElement(Qn,s,q.default.createElement(iu,{onClose:()=>i(!1)})))}));ou.displayName="SuperSearch";const su=q.default.forwardRef(((e,t)=>{const{tableColumns:l,showFullScreen:n,showReload:a,showPrint:r,showImport:i,showExport:o,showClipboard:s,showCollection:u,showFastSearch:c,showSuperSearch:f,showPivotGrid:p,showGroupSummary:m,showToolBox:h}=e,{global:v}=q.default.useContext(xe),{tableRef:y,$size:b,prefixCls:x,isFullScreen:E}=q.default.useContext(ei),{uniqueKey:C,exportExcel:w}=y.current.props,{t:S}=ot(),N=q.default.useRef(null),T=q.default.useRef(null),I=q.default.useRef(null),O=q.default.useRef(null),R=q.default.useRef(null),k=q.default.useRef(null),L=q.default.useRef(null),P=q.default.useRef(null),A=q.default.useRef(null),F=q.default.useRef(null),_=q.default.useRef(null),D=q.default.useRef(!1),M=q.default.useMemo((()=>C?`toolBox_${C}`:""),[C]),[H,$]=q.default.useState({fullScreen:!1,reload:!1,print:!1,import:!1,export:!1,clipboard:!1,collection:!1,fastSearch:!1,superSearch:!1,pivotGrid:!1,groupSummary:!1}),j={fullScreen:n,reload:a,print:r,import:i,export:o&&!(null==w?void 0:w.hideIcon),clipboard:s,collection:u,fastSearch:c,superSearch:f,pivotGrid:p,groupSummary:m},[K,V]=q.default.useState(!1);Yl((()=>{D.current&&(W(),D.current=!1)}),[H]),q.default.useLayoutEffect((()=>{z()}),[]),q.default.useImperativeHandle(t,(()=>({exportHandle:()=>{if(!R.current)return ft("Table","执行导出需要配置 `exportExcel` 参数");R.current.clickHandle()}})));const z=()=>{if(!M||!h)return;const e=JSON.parse(localStorage.getItem(M));e||B(M).then((e=>{e&&($(Object.assign({},H,e)),localStorage.setItem(M,JSON.stringify(e)))})).catch((()=>{})),e&&$(Object.assign({},H,e))},W=()=>{if(!M||!h)return;const e={};for(const t in H)H[t]&&(e[t]=H[t]);localStorage.setItem(M,JSON.stringify(e)),U(M,e)},B=e=>Ie(void 0,void 0,void 0,(function*(){const t=null==v?void 0:v.getComponentConfigApi;if(t)try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),U=(e,t)=>Ie(void 0,void 0,void 0,(function*(){const l=null==v?void 0:v.saveComponentConfigApi;if(l)try{yield l({[e]:t})}catch(e){}})),G=e=>Ie(void 0,void 0,void 0,(function*(){V(!1),yield Ae(100),e.current.clickHandle()})),Y=(e,t)=>{D.current=!0,$(Object.assign({},H,{[t]:e}))},X={"top-toolbox__popper":!0,[`${x}--lg`]:"large"===b,[`${x}--sm`]:"small"===b};return q.default.createElement(q.default.Fragment,null,n&&q.default.createElement(Ti,{ref:N,isFullScreen:E,open:!h||H.fullScreen}),a&&q.default.createElement(Ii,{ref:T,open:!h||H.reload}),r&&q.default.createElement(Ri,{ref:I,tableColumns:l,open:!h||H.print}),i&&q.default.createElement(ji,{ref:O,tableColumns:l,open:!h||H.import}),o&&q.default.createElement(ws,{ref:R,tableColumns:l,open:(!h||H.export)&&!(null==w?void 0:w.hideIcon)}),s&&q.default.createElement(Ns,{ref:k,open:!h||H.clipboard}),u&&q.default.createElement(Is,{ref:L,columns:l,open:!h||H.collection}),c&&q.default.createElement(Rs,{ref:P,open:!h||H.fastSearch}),p&&q.default.createElement(lu,{ref:A,open:!h||H.pivotGrid}),m&&q.default.createElement(ru,{ref:F,open:!h||H.groupSummary}),f&&q.default.createElement(ou,{ref:_,open:!h||H.superSearch}),h&&q.default.createElement(d.Dropdown,{open:K,trigger:["click"],placement:"bottomRight",dropdownRender:()=>(()=>{const e=[{key:"fullScreen",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{checked:H.fullScreen,style:{marginRight:6},onChange:e=>Y(e.target.checked,"fullScreen"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.screen.full"))),onClick:()=>G(N)},{key:"reload",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{checked:H.reload,style:{marginRight:6},onChange:e=>Y(e.target.checked,"reload"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.refresh.text"))),onClick:()=>G(T)},{key:"print",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{checked:H.print,style:{marginRight:6},onChange:e=>Y(e.target.checked,"print"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.print.text"))),onClick:()=>G(I)},{key:"import",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{checked:H.import,style:{marginRight:6},onChange:e=>Y(e.target.checked,"import"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.import.textNoSpace"))),onClick:()=>G(O)},{key:"export",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{checked:H.export,style:{marginRight:6},onChange:e=>Y(e.target.checked,"export"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.export.textNoSpace"))),onClick:()=>G(R)},{key:"clipboard",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{checked:H.clipboard,style:{marginRight:6},onChange:e=>Y(e.target.checked,"clipboard"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.clipboard.textNoSpace"))),onClick:()=>G(k)},{key:"collection",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{checked:H.collection,style:{marginRight:6},onChange:e=>Y(e.target.checked,"collection"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.selectCollection.text"))),onClick:()=>G(L)},{key:"fastSearch",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{checked:H.fastSearch,style:{marginRight:6},onChange:e=>Y(e.target.checked,"fastSearch"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.fastSearch.text"))),onClick:()=>G(P)},{key:"pivotGrid",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{checked:H.pivotGrid,style:{marginRight:6},onChange:e=>Y(e.target.checked,"pivotGrid"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.pivotGrid.text"))),onClick:()=>G(A)},{key:"groupSummary",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{checked:H.groupSummary,style:{marginRight:6},onChange:e=>Y(e.target.checked,"groupSummary"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.groupSummary.text"))),onClick:()=>G(F)},{key:"superSearch",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{checked:H.superSearch,style:{marginRight:6},onChange:e=>Y(e.target.checked,"superSearch"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.highSearch.text"))),onClick:()=>G(_)}];return q.default.createElement(d.Menu,{items:e.filter((e=>j[e.key]))})})(),overlayClassName:J.default(X),overlayStyle:{minWidth:120},onOpenChange:e=>{V(e)}},q.default.createElement("span",{className:`${x}-toolbox`,title:S("qm.table.toolbox.text")},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.AppstoreAddOutlined,null)))))}));su.displayName="ToolBox";const du=(e,t)=>e.map((e=>(e.children&&(e.children=du(e.children,t)),t(e)))),uu=q.default.forwardRef(((e,t)=>{const{columns:n}=e,{global:a}=q.default.useContext(xe),{tableRef:r,prefixCls:i,$size:o}=q.default.useContext(ei),{showColumnDefine:s,uniqueKey:u,onlyShowIcon:c,columnsChange:f}=r.current.props,{t:p}=ot(),m=q.default.useRef([]),[h,v]=q.default.useState(!1),y=q.default.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"left"===e.fixed)))(n)),[n]),b=q.default.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"right"===e.fixed)))(n)),[n]),x=q.default.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&!e.fixed)))(n)),[n]),E=q.default.useMemo((()=>u?`table_${u}`:""),[u]);Yl((()=>{w(n)}),[n]),q.default.useLayoutEffect((()=>{S()}),[]),q.default.useImperativeHandle(t,(()=>({initialHandler:S})));const C=e=>{if(!E)return;const t=e||n,r=JSON.parse(localStorage.getItem(E));var i;if(r||(i=E,Ie(void 0,void 0,void 0,(function*(){const e=null==a?void 0:a.getComponentConfigApi;if(e)try{const t=yield e({key:i});if(200===t.code)return t.data}catch(e){}}))).then((e=>{e?(localStorage.setItem(E,JSON.stringify(e)),S()):(null==a?void 0:a.getComponentConfigApi)&&w(t)})).catch((()=>{})),!r)return;return l.xor(ga(r).map((e=>e.dataIndex)),ga(t).map((e=>e.dataIndex))).length>0?du(t,(e=>{const t=ya(r,e.dataIndex);return t&&(void 0!==t.hidden&&(e.hidden=t.hidden),void 0!==t.fixed&&(e.fixed=t.fixed),void 0!==t.width&&(e.width=t.width),void 0!==t.renderWidth&&(e.renderWidth=t.renderWidth)),e})):du(r,(e=>{const l=ya(t,e.dataIndex);return void 0===e.fixed&&delete l.fixed,Object.assign({},l,e)}))},w=e=>{if(!E||!r.current.columnsDefined)return;const t=ha(e),n=JSON.parse(localStorage.getItem(E));var i,o;l.isEqual(t,n)||(localStorage.setItem(E,JSON.stringify(t)),i=E,o=t,Ie(void 0,void 0,void 0,(function*(){const e=null==a?void 0:a.saveComponentConfigApi;if(e)try{yield e({[i]:o})}catch(e){}})))},S=e=>{if(!r.current.columnsDefined)return;const t=C(e)||e;var l;t&&(l=N(t),m.current=l,null==f||f(t))},N=e=>{const t=[];return e.filter((e=>!e.noAuth)).forEach(((l,n)=>{const a=l.colSpan;a>1&&e.slice(n+1,n+a).every((({colSpan:e})=>0===e))&&t.push(e.slice(n,n+a))})),t},T=()=>{const e=ga(n),t=l=>l.filter((t=>e.find((e=>e.dataIndex===t.dataIndex)))).map((l=>{const n=e.find((e=>e.dataIndex===l.dataIndex)),a=Object.assign({},n,l);return delete a.renderWidth,void 0===l.hidden&&delete a.hidden,void 0===l.fixed&&delete a.fixed,void 0===l.width&&delete a.width,l.children&&(a.children=t(l.children)),a}));null==f||f(t(r.current.originColumns))},O=e=>{const t=[];e.forEach((l=>{const{colSpan:n,dataIndex:a}=l;if(0===n)return;if(1===n)return t.push(l);const r=m.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(a)));if(-1===r)return t.push(l);t.push(...m.current[r].map((({dataIndex:t},n)=>{const a=e.find((e=>e.dataIndex===t));return n>0&&(void 0!==l.hidden&&(a.hidden=l.hidden),void 0!==l.fixed?a.fixed=l.fixed:a.fixed&&delete a.fixed),a})))})),n.forEach(((e,l)=>{e.noAuth&&t.findIndex((t=>t.dataIndex===e.dataIndex))<0&&t.splice(l,0,e)})),null==f||f(t)},R=(e,t)=>{e.noFixed||(t?e.fixed=t:delete e.fixed,O(n))},k=(e,t)=>{var l;const{colSpan:a,noFixed:r}=e;if(0===a)return q.default.createElement("li",{key:e.dataIndex,style:{display:"none"}});const i=ja(e.title),o=["svgicon","handle",`${t}-handle`],s=q.default.createElement("li",{key:e.dataIndex,className:"item"},q.default.createElement(d.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:l}=t.target;e.hidden=!l,O(n)}}),q.default.createElement("i",{className:J.default(o),title:p("qm.table.columnFilter.draggable")},q.default.createElement(g.HolderOutlined,null)),q.default.createElement("span",{className:"text",title:i},i),"main"===t?q.default.createElement("span",{className:J.default("fixed",r?"disabled":"")},q.default.createElement("i",{className:"svgicon",title:p("qm.table.columnFilter.fixedLeft"),onClick:()=>R(e,"left")},q.default.createElement(g.StepBackwardOutlined,null)),q.default.createElement("i",{className:"svgicon",title:p("qm.table.columnFilter.fixedRight"),onClick:()=>R(e,"right")},q.default.createElement(g.StepForwardOutlined,null))):"sub"!==t?q.default.createElement("span",{className:J.default("fixed",r?"disabled":"")},q.default.createElement("i",{className:"svgicon",title:p("qm.table.columnFilter.cancelFixed"),onClick:()=>R(e)},q.default.createElement(g.CloseCircleOutlined,null))):null);return!e.hidden&&(null===(l=e.children)||void 0===l?void 0:l.length)?q.default.createElement(d.Popover,{key:e.dataIndex,trigger:["hover"],placement:"leftTop",overlayClassName:"column-item__popper",content:L(e.children,e.dataIndex)},s):s},L=(e,t)=>q.default.createElement("div",{className:"column-filter--wrap"},q.default.createElement(I.ReactSortable,{itemKey:"dataIndex",handle:".sub-handle",tag:"ul",animation:200,list:e,setList:a=>{const r=a.map((e=>e.dataIndex)),i=e.map((e=>e.dataIndex));l.isEqual(r,i)||((e,t)=>{ya(n,t).children=e,null==f||f([...n])})(Ya(a),t)}},e.map((e=>k(e,"sub"))))),P={[`${i}__popper`]:!0,"column-filter__popper":!0,[`${i}--lg`]:"large"===o,[`${i}--sm`]:"small"===o},A=[`${i}-column-filter`,{selected:h}];return s?q.default.createElement(xs,{action:["click"],popupVisible:h,popup:q.default.createElement("div",{className:"column-filter--wrap",style:{maxHeight:"calc(100vh - 10px)"}},q.default.createElement("div",{className:"reset"},q.default.createElement(pt,{type:"text",size:"small",onClick:T},p("qm.table.columnFilter.reset"))),q.default.createElement("div",{className:"left"},q.default.createElement(I.ReactSortable,{itemKey:"dataIndex",handle:".left-handle",tag:"ul",animation:200,list:y,setList:e=>{const t=e.map((e=>e.dataIndex)),n=y.map((e=>e.dataIndex));l.isEqual(t,n)||O([...Ya(e),...x,...b])}},y.map((e=>k(e,"left"))))),q.default.createElement("div",{className:"divider"}),q.default.createElement("div",{className:"main"},q.default.createElement(I.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:x,setList:e=>{const t=e.map((e=>e.dataIndex)),n=x.map((e=>e.dataIndex));l.isEqual(t,n)||O([...y,...Ya(e),...b])}},x.map((e=>k(e,"main"))))),q.default.createElement("div",{className:"divider"}),q.default.createElement("div",{className:"right"},q.default.createElement(I.ReactSortable,{itemKey:"dataIndex",handle:".right-handle",tag:"ul",animation:200,list:b,setList:e=>{const t=e.map((e=>e.dataIndex)),n=b.map((e=>e.dataIndex));l.isEqual(t,n)||O([...y,...x,...Ya(e)])}},b.map((e=>k(e,"right")))))),popupClassName:J.default(P),popupStyle:{minWidth:160},onPopupVisibleChange:e=>{v(e)},builtinPlacements:di,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},q.default.createElement("span",{className:J.default(A),title:c?p("qm.table.columnFilter.text"):void 0},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.SettingOutlined,null)),!c&&q.default.createElement("span",null,p("qm.table.columnFilter.text")))):null}));uu.displayName="ColumnFilter";const cu=q.default.createContext({}),fu=()=>q.default.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"filter",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.createElement("path",{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"})),pu=q.default.forwardRef(((e,t)=>{const{dataIndex:l,className:n,style:a}=e;return q.default.createElement("li",{ref:t,"data-index":l,className:J.default("list-item",n),style:a},e.children)}));pu.displayName="ListItem";const mu=q.default.forwardRef(((e,t)=>{var l,n;const{dataSource:a=[],height:r,maxHeight:i,itemHeight:o,renderItem:s,onScroll:d,className:u}=e,c=q.default.useRef(null),f=Fd({count:a.length,getScrollElement:()=>{var e;return(null===(e=c.current)||void 0===e?void 0:e.scrollElement)||null},estimateSize:()=>o||40,overscan:3,onChange:(e,t)=>null==d?void 0:d(e,t)}),p=f.getVirtualItems();q.default.useImperativeHandle(t,(()=>({SCROLL_TO_INDEX:e=>f.scrollToIndex(e),SCROLL_TO_OFFSET:e=>f.scrollToOffset(e)})));const m=gt("virtual-list");return q.default.createElement(_n,{ref:c,wrapStyle:{height:r,maxHeight:i},className:J.default(m,u),style:e.style},q.default.createElement("div",{className:"container",style:{height:f.getTotalSize()}},q.default.createElement("ul",{style:{transform:`translateY(${null!==(n=null===(l=p[0])||void 0===l?void 0:l.start)&&void 0!==n?n:0}px)`}},p.map((e=>q.default.createElement(pu,{ref:f.measureElement,key:e.index,dataIndex:e.index,style:{height:o}},null==s?void 0:s(a[e.index],e.index)))))))}));mu.displayName="VirtualList";const hu=e=>{const{column:t,isEnum:n,style:a,onChange:r}=e,{tableRef:i,$size:o,flattenColumns:s,isFetch:u,filters:c,superFilters:f,pagerFilter:p,setPagerFilter:m}=q.default.useContext(ei),{dataKey:h,filterValue:v={}}=q.default.useContext(cu),{t:y}=ot(),{getTitleFromCellValue:b}=Oi(),x=h.split("|")[0],{recordsMap:E,tableOriginData:C,isOriginTree:w}=i.current,S=p,N=x;S[N];const T=Ne(S,["symbol"==typeof N?N:N+""]),I=q.default.useRef(!1),O=q.default.useMemo((()=>s.indexOf(t)),[s,t]),R=q.default.useRef(0),k=e=>{let l=Ca((()=>{if(!(u||De(c)&&De(f))){const e=f.length?Va(f):Va(c);return fa(C,e,w)}return C})());var n;e||(l=((e,t,l)=>{if(!Object.keys(t).length||!e.length)return e;if(!l)return e.filter((e=>Ja(e,t)));const n=new Map,a=new Set;for(const l of e)if(n.set(l._rowKey,l),Ja(l,t)){let e=l;for(;e&&!a.has(e._rowKey);)a.add(e._rowKey),e=n.get(e._parentRowKey)}return e.filter((e=>a.has(e._rowKey)))})(l,T,w),n=l.length,R.current=n);const a=new Map;return l.forEach((e=>{const l=Pa(e,x);a.has(l)||a.set(l,b(e,t,e.index,O))})),a},L=e=>n?[{text:y("qm.table.highSearch.nullText"),value:""},...t.filter.items||t.dictItems||[]]:Array.from(k(e).entries()).map((([e,t])=>({text:t,value:e}))),P=q.default.useMemo((()=>L()),[]),A=q.default.useMemo((()=>De(T)?P:L(!0)),[]),[F,_]=q.default.useState(P),D=q.default.useMemo((()=>new Map(F.map((e=>[e.value,null])))),[F]),[M,H]=q.default.useState(""),[$,j]=q.default.useReducer(((e,t)=>{const n=t(e),a=[...new Set(n)];return l.isEqual(e,a)?e:a}),(n?v.in:p[x])||A.map((e=>e.value))),K=q.default.useMemo((()=>Array.from(D.keys()).every((e=>$.includes(e)))),[$,D]),V=q.default.useMemo((()=>{const e=Array.from(D.keys()).filter((e=>$.includes(e)));return e.length>0&&e.length<F.length}),[$,F,D]),z=q.default.useMemo((()=>$.length===A.length),[$]);Yl((()=>{null==r||r($,z)}),[$]),Yl((()=>{const e=z?null:$;if(!l.isEqual(e,p[x]))return e?void m(Object.assign(Object.assign({},p),{[x]:e})):m(T)}),[F,$]);const W=wn((e=>{const t=P.filter((t=>t.text.includes(e))),l=t.map((e=>e.value));_(t),j((e=>[...l,...e.filter((e=>!D.has(e)))]))}),200),B=e=>{H(e),I.current||W(e)};return q.default.createElement("div",{className:"list-panel",style:a},q.default.createElement(d.Input,{value:M,size:o,style:{width:200},placeholder:y("qm.table.filter.keywordSearch"),suffix:q.default.createElement(g.SearchOutlined,null),autoFocus:!0,allowClear:!0,onCompositionStart:()=>{I.current=!0},onCompositionEnd:e=>{I.current=!1,B(e.target.value)},onChange:e=>B(e.target.value)}),q.default.createElement("div",{className:"select-all"},q.default.createElement("div",{className:"action"},q.default.createElement(d.Checkbox,{checked:K,indeterminate:V,disabled:!F.length,onChange:e=>{j((t=>e.target.checked?[...t,...Array.from(D.keys())]:t.filter((e=>!D.has(e)))))}},y("qm.table.filter.selectAll")),q.default.createElement("i",{className:"divider"},"|"),q.default.createElement("button",{className:"btn invert",disabled:!F.length,onClick:()=>{j((e=>[...Array.from(D.keys()).filter((t=>!e.includes(t))),...e.filter((e=>!D.has(e)))]))}},y("qm.table.filter.invert"))),q.default.createElement("div",{className:"total"},n?null:`${E.size}/${R.current}`)),q.default.createElement(mu,{className:"select-list",maxHeight:180,itemHeight:26,dataSource:F,renderItem:(e,t)=>q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Checkbox,{key:t,checked:$.includes(e.value),onChange:t=>{j((l=>t.target.checked?[...l,e.value]:l.filter((t=>t!==e.value))))}},e.text),q.default.createElement("button",{className:"btn right",onClick:()=>{j((t=>{const n=[e.value,...t.filter((e=>!D.has(e)))];return l.isEqual(t,n)?t:n}))}},y("qm.table.filter.onlyItem")))}))},gu=q.default.forwardRef(((e,t)=>{const{value:l,style:n}=e,{$size:a,filters:r,pagerFilter:i,setPagerFilter:o}=q.default.useContext(ei),{dataKey:s,onChange:u}=q.default.useContext(cu),{t:c}=ot(),f=s.split("|")[0],p=e=>{if(!e){const e=r,t=s;e[t];return Ne(e,["symbol"==typeof t?t:t+""])}const t=Object.assign({},e);for(const e in t)(""===(l=t[e])||null==l)&&delete t[e];var l;return Object.keys(t).length?Object.assign({},r,{[s]:t}):p()},m=(e,t)=>{u(p(null!=e?e:l),null==t||t)};return q.default.useImperativeHandle(t,(()=>({doFinish:m}))),q.default.createElement(d.Space,{className:"footer",style:Object.assign(Object.assign({},n),{justifyContent:"flex-end"})},q.default.createElement(pt,{size:a,onClick:()=>(()=>{if(i[f]){const e=i,t=f;e[t];const l=Ne(e,["symbol"==typeof t?t:t+""]);o(l)}u(p(),!0)})()},c("qm.table.filter.reset")),q.default.createElement(pt,{type:"primary",size:a,onClick:()=>m()},c("qm.table.filter.search")))}));gu.displayName="FooterPanel";const vu=e=>{const{column:t}=e,{$size:l}=q.default.useContext(ei),{filterValue:n={}}=q.default.useContext(cu),{t:a}=ot(),r=q.default.useRef(null),{openFilterList:i=!0}=t.filter,[o,s]=q.default.useState(Object.keys(n)[0]||"like"),[u,c]=q.default.useState(n[o]&&!Za(o)?n[o]:""),f=q.default.useMemo((()=>u?{[o]:u}:Za(o)?{[o]:1}:null),[o,u]),p=[{value:"like",label:a("qm.table.highSearch.inText")},{value:"nlike",label:a("qm.table.highSearch.ninText")},{value:"==",label:a("qm.table.highSearch.eqText")},{value:"!=",label:a("qm.table.highSearch.neqText")},{value:"^=",label:a("qm.table.highSearch.startsWithText")},{value:"=$",label:a("qm.table.highSearch.endsWithText")},{value:"nil",label:a("qm.table.highSearch.nullText")},{value:"nnil",label:a("qm.table.highSearch.notNullText")}];return q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:"filter-box"},q.default.createElement(d.Select,{value:o,options:p,size:l,className:"condition",style:{width:70,marginRight:6},onChange:e=>{s(e),Za(e)&&c("")}}),q.default.createElement(d.Input,{value:u,size:l,autoFocus:!0,style:{width:124,paddingLeft:6,paddingRight:2},placeholder:a("qm.table.filter.searchText",{text:ja(t.title)}),disabled:Za(o),onChange:e=>{c(e.target.value)},onKeyDown:e=>{13===e.keyCode&&r.current.doFinish()}})),i&&q.default.createElement(hu,{column:t,style:{marginTop:6}}),q.default.createElement(gu,{ref:r,value:f}))},yu=e=>{var t,l;const{onChange:n}=e,{filterValue:a={}}=q.default.useContext(cu),{t:r}=ot(),[i,o]=q.default.useState({nil:null!==(t=a.nil)&&void 0!==t?t:0,nnil:null!==(l=a.nnil)&&void 0!==l?l:0});return Yl((()=>{const e={};for(const t in i)i[t]&&(e[t]=1);n(e)}),[i]),q.default.createElement("div",{style:e.style},q.default.createElement(d.Checkbox,{checked:!!i.nil,onChange:e=>{const t=e.target.checked?1:0;o((e=>Object.assign({},e,t?{nnil:0}:null,{nil:t})))}},r("qm.table.highSearch.nullText")),q.default.createElement(d.Checkbox,{checked:!!i.nnil,onChange:e=>{const t=e.target.checked?1:0;o((e=>Object.assign({},e,t?{nil:0}:null,{nnil:t})))}},r("qm.table.highSearch.notNullText")))},bu=e=>{var t;const{column:l}=e,{$size:n}=q.default.useContext(ei),{filterValue:a={}}=q.default.useContext(cu),{t:r}=ot(),i=q.default.useRef(null),{openFilterList:o=!0}=l.filter,s="likes",[u,c]=q.default.useState(null!==(t=a[s])&&void 0!==t?t:""),[f,p]=q.default.useState({}),m=q.default.useMemo((()=>Object.keys(f).length?f:u?{[s]:u}:null),[u,f]);return q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:"filter-box"},q.default.createElement(d.Input.TextArea,{value:u,size:n,autoFocus:!0,placeholder:r("qm.table.filter.searchAreaText",{text:ja(l.title)}),style:{width:200},disabled:!!Object.keys(f).length,onChange:e=>{c(e.target.value)},onKeyDown:e=>{13===e.keyCode&&i.current.doFinish()}})),q.default.createElement(yu,{style:{marginTop:6},onChange:e=>{Object.keys(e).length&&c(""),p(e)}}),o&&q.default.createElement(hu,{column:l,style:{marginTop:6}}),q.default.createElement(gu,{ref:i,value:m}))},xu=e=>{const{$size:t}=q.default.useContext(ei),{filterValue:l={}}=q.default.useContext(cu),{t:n}=ot(),a=q.default.useRef(null),[r,i]=q.default.useState(l),o=e=>({value:r[e],size:t,disabled:Object.keys(r).some((e=>Za(e))),onChange:t=>{t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER||i((l=>Object.assign({},l,{[e]:t})))},onKeyDown:e=>{13===e.keyCode&&a.current.doFinish()}});return q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:"filter-list"},q.default.createElement("ul",null,q.default.createElement("li",null,q.default.createElement("span",{className:"label"},"> "),q.default.createElement(d.InputNumber,tt({},o(">"),{placeholder:n("qm.table.highSearch.gtText"),style:{width:150}}))),q.default.createElement("li",null,q.default.createElement("span",{className:"label"},"< "),q.default.createElement(d.InputNumber,tt({},o("<"),{placeholder:n("qm.table.highSearch.ltText"),style:{width:150}}))),q.default.createElement("li",null,q.default.createElement("span",{className:"label"},"= "),q.default.createElement(d.InputNumber,tt({},o("=="),{placeholder:n("qm.table.highSearch.eqText"),style:{width:150}}))),q.default.createElement("li",null,q.default.createElement("span",{className:"label"},"!="),q.default.createElement(d.InputNumber,tt({},o("!="),{placeholder:n("qm.table.highSearch.neqText"),style:{width:150}}))))),q.default.createElement(yu,{style:{paddingLeft:20},onChange:e=>i(e)}),q.default.createElement(gu,{ref:a,value:r}))},Eu=e=>{const{$size:t}=q.default.useContext(ei),{filterValue:l={}}=q.default.useContext(cu),{t:n}=ot(),[a,r]=q.default.useState(l),i=e=>({value:Ha(a[e],ii),format:ii,size:t,disabled:Object.keys(a).some((e=>Za(e))),onChange:t=>{r((l=>Object.assign({},l,{[e]:qa(t,ii)})))}});return q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:"filter-list"},q.default.createElement("ul",null,q.default.createElement("li",null,q.default.createElement("span",{className:"label"},"> "),q.default.createElement(et,tt({},i(">"),{placeholder:n("qm.table.highSearch.gtText"),style:{width:"150px"}}))),q.default.createElement("li",null,q.default.createElement("span",{className:"label"},"< "),q.default.createElement(et,tt({},i("<"),{placeholder:n("qm.table.highSearch.ltText"),style:{width:"150px"}}))),q.default.createElement("li",null,q.default.createElement("span",{className:"label"},"= "),q.default.createElement(et,tt({},i("=="),{placeholder:n("qm.table.highSearch.eqText"),style:{width:"150px"}}))),q.default.createElement("li",null,q.default.createElement("span",{className:"label"},"!="),q.default.createElement(et,tt({},i("!="),{placeholder:n("qm.table.highSearch.neqText"),style:{width:"150px"}}))))),q.default.createElement(yu,{style:{paddingLeft:20},onChange:e=>r(e)}),q.default.createElement(gu,{value:a}))},Cu=e=>{const{column:t}=e,l=q.default.useRef(null);return q.default.createElement(q.default.Fragment,null,q.default.createElement(hu,{column:t,isEnum:!0,onChange:(e,t)=>{l.current.doFinish(t?null:{in:e},!1)}}),q.default.createElement(gu,{ref:l,style:{display:"none"}}))},wu=(e,t,l)=>{let n;for(let a=0;a<e.length;a++){const r=e[a];if(r.children)if(r.children.some((e=>e[l]===t)))n=r[l];else{const e=wu(r.children,t,l);e&&(n=e)}}return n},Su=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&Su(e.children,t),t(e)||e.children&&e.children.length))),Nu=(e,t)=>{const l=[];return e.forEach((e=>{e.children&&l.push(...Nu(e.children,t)),t(e)&&l.push(e)})),l},Tu=(e,t)=>{let l=null;for(let n=0;n<e.length;n++){if(Array.isArray(e[n].children)&&(l=Tu(e[n].children,t)),l)return l;if(t(e[n]))return e[n]}return l},Iu=(e,t,l,n)=>e.map((e=>e[l]===t?Object.assign(Object.assign({},e),{children:n}):e.children?Object.assign(Object.assign({},e),{children:Iu(e.children,t,l,n)}):e)),Ou=(e,t)=>{const l=[];return e.forEach((e=>{e.children&&l.push(...Ou(e.children,t)),Array.isArray(e.children)&&e.children.length&&l.push(e[t])})),l},Ru=(e,t,l)=>{for(let n=0;n<e.length;n++){if(e[n][l]===t)return[t];if(Array.isArray(e[n].children)){const a=Ru(e[n].children,t,l);if(a)return[e[n][l],a].flat()}}},ku=(e,t)=>{var l;const n=(null===(l=e.children)||void 0===l?void 0:l.map((e=>e[t])))||[];return Array.isArray(e.children)&&e.children.forEach((e=>n.push(...ku(e,t)))),n},Lu=q.default.forwardRef(((e,t)=>{const{className:n,style:a,filterable:r=!0,multiple:i,draggable:o,beforeDrop:s,dataSource:u,fetch:c,autoFocus:f,asyncLoad:p,checkStrictly:m,checkStrategy:h="SHOW_CHILD",placeholder:v,fieldsDefine:y,value:b,height:x,defaultSelectedKeys:E=[],defaultExpandedKeys:C=[],defaultExpandAll:w=!0,showSearchBar:S=!0,showCollapse:N=!0,onSelectChange:T,onCheckChange:I,onDragStart:O,onDragChange:R,onExpand:k}=e,{$size:L}=dt(e),{t:P}=ot(),A=(null==y?void 0:y.valueKey)||"value",F=(null==y?void 0:y.textKey)||"text";null==y||y.children;const _=q.default.useRef(null),D=q.default.useRef(null),M=xn(_),[H,$]=yi(x,{value:x}),[j,K]=q.default.useState(!1),V=wn((()=>{$(_.current.offsetHeight-ne.current.offsetHeight-10)}),5);Cn((()=>{x||V()}),[M.height]);const[z,W]=q.default.useState([]),[B,U]=q.default.useState({}),[G,Y]=q.default.useState([]),[X,Q]=q.default.useState([]),[Z,ee]=q.default.useState(""),[te,le]=q.default.useState(w),ne=q.default.useRef(null),ae=q.default.useRef([]),re=q.default.useRef([]);q.default.useEffect((()=>{Array.isArray(u)&&(ie(u),Y(oe(u)),U({}))}),[u]),q.default.useEffect((()=>{var e;ue(),f&&(null===(e=D.current)||void 0===e||e.focus())}),[]),Yl((()=>{ue()}),[null==c?void 0:c.params]),Yl((()=>{Q(de())}),[B]),q.default.useImperativeHandle(t,(()=>({INSERT_RECORD:(e,t)=>{const l=Array.isArray(t)?t:[t],n=Tu(z,(t=>e===t[A]));n&&(Array.isArray(n.children)?n.children.push(...l):n.children=[...l],ie([...z]))},REMOVE_RECORD:e=>{var t;const l=wu(z,e,A);if(void 0===l&&z.find((t=>t[A]===e)))ie(z.filter((t=>t[A]!==e)));else{const n=Tu(z,(e=>l===e[A]));if(!n)return;const a=null===(t=n.children)||void 0===t?void 0:t.findIndex((t=>e===t[A]));a>=0&&(n.children.splice(a,1),ie([...z]))}},UPDATE_RECORD:(e,t)=>{const n=Tu(z,(t=>e===t[A]));n&&(l.merge(n,t),ie([...z]))}})));const ie=e=>{W(e),ae.current=e,re.current=Ou(e,A)},oe=e=>{if(i)return E;const t=Nu(e,(e=>E.includes(e[F])));return 1===t.length?[t[0][A]]:[]},se=e=>{var t;return(null===(t=Ru(z,e,A))||void 0===t?void 0:t.slice(0,-1))||[]},de=()=>{if(w)return re.current;const e=[];return G.forEach((t=>{if(i){if("SHOW_ALL"===h&&!re.current.includes(t)&&e.push(...se(t)),"SHOW_CHILD"===h&&e.push(...se(t)),"SHOW_PARENT"===h){const l=xr(z,t);if(l){const n=se(t),a=ku(l,A);e.push(...n,...[t,...a].filter((e=>re.current.includes(e))))}}}else e.push(...se(t))})),[...new Set([...C,...e])]},ue=()=>Ie(void 0,void 0,void 0,(function*(){var e;if(!c)return;const{api:t,params:n,dataKey:a,afterFetch:r,callback:i}=c;try{K(!0);const o=yield t(n);if(200===o.code){let t=Array.isArray(o.data)?o.data:null!==(e=l.get(o.data,a))&&void 0!==e?e:[];t="function"==typeof r?yield r(t):t,ie(t),Y(oe(t)),U({}),null==i||i(t)}}catch(e){}K(!1)})),ce=e=>`${e}|${_r.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,fe=gt("search-tree"),pe={[fe]:!0,[`${fe}--lg`]:"large"===L,[`${fe}--sm`]:"small"===L};return q.default.createElement("div",{ref:_,className:J.default(pe,n),style:a},q.default.createElement("div",{ref:ne,className:"topper",style:{display:S||N?"":"none"}},S&&q.default.createElement(d.Input,{ref:D,value:Z,size:L,placeholder:v||P("qm.form.inputPlaceholder"),suffix:q.default.createElement(g.SearchOutlined,null),allowClear:!0,onChange:e=>(e=>{if(!r)return;const t=Su(ae.current,(t=>{if(!e)return!0;const l=t[F]||"";return-1!==ce(l).indexOf(e)}));ee(e),W(t),Q(w||e?Ou(t,A):de())})(e.target.value)}),N&&q.default.createElement("a",{className:"trigger",onClick:()=>{le(!te),Q(te?[]:re.current)}},te?q.default.createElement(g.UpOutlined,null):q.default.createElement(g.DownOutlined,null)," ",P(te?"qm.form.collect":"qm.form.spread"))),q.default.createElement(mn,{spinning:j},q.default.createElement(d.Tree,{fieldNames:{title:F,key:A,children:"children"},multiple:i,draggable:o,blockNode:o,checkable:i,selectable:!i,height:H,disabled:e.disabled,checkStrictly:m,selectedKeys:null!=b?b:G,checkedKeys:null!=b?b:G,expandedKeys:X,treeData:z,loadData:p?({key:e,children:t})=>Ie(void 0,void 0,void 0,(function*(){var n;if(!c||t)return;const{api:a,params:r,dataKey:i,formatter:o=(e=>e),afterFetch:s}=c;try{const t=yield a(o(Object.assign(Object.assign({},r),{[A]:e})));if(200===t.code){let a=Array.isArray(t.data)?t.data:null!==(n=l.get(t.data,i))&&void 0!==n?n:[];a="function"==typeof s?yield s(a):a;const r=Iu(ae.current,e,A,a);ie(r)}}catch(e){}})):void 0,titleRender:e.titleRender,filterTreeNode:e=>{if(!Z)return!1;const t=e[F]||"";return-1!==ce(t).indexOf(Z)},onDragStart:O,onDragEnter:e=>{Q(e.expandedKeys)},onDrop:e=>{const t=e.node.key,l=e.dragNode.key,n=e.node.pos.split("-"),a=e.dropPosition-Number(n[n.length-1]);if(s){if(!1===s(e,z))return}const r=(e,t,l)=>{for(let n=0;n<e.length;n++){if(e[n][A]===t)return l(e[n],n,e);e[n].children&&r(e[n].children,t,l)}},i=[...z];let o;if(r(i,l,((e,t,l)=>{l.splice(t,1),o=e})),e.dropToGap)if((e.node.children||[]).length>0&&e.node.expanded&&1===a)r(i,t,(e=>{e.children=e.children||[],e.children.unshift(o)}));else{let e,l=[];r(i,t,((t,n,a)=>{l=a,e=n})),-1===a?l.splice(e,0,o):l.splice(e+1,0,o)}else r(i,t,(e=>{e.children=e.children||[],e.children.unshift(o)}));ie(i)},onDragEnd:e=>{null==R||R(e,z)},onExpand:(e,t)=>{De(e)&&le(!1),re.current.every((t=>e.includes(t)))&&le(!0),Q(e),null==k||k(e,t)},onSelect:e=>{Y(e);const t=Nu(ae.current,(t=>e.includes(l.get(t,A))));null==T||T(i?t:t[0])},onCheck:e=>{m&&(e=e.checked),Y(e),m||("SHOW_CHILD"===h&&(e=e.filter((e=>!re.current.includes(e)))),"SHOW_PARENT"===h&&(e=e.filter(((e,t,l)=>!l.includes(wu(z,e,A))))));const t=Nu(ae.current,(t=>e.includes(l.get(t,A))));null==I||I(i?t:t[0])}})))}));Lu.displayName="QmSearchTree";const Pu=e=>{var t;const{column:l}=e,{$size:n}=q.default.useContext(ei),{filterValue:a={}}=q.default.useContext(cu),r=q.default.useMemo((()=>l.filter.items||l.dictItems||[]),[]),i=q.default.useMemo((()=>{const e=[];return function t(l){l.forEach((l=>{Array.isArray(l.children)?t(l.children):e.push(l.value)}))}(r),e}),[r]),[o,s]=q.default.useState(null!==(t=a.in)&&void 0!==t?t:i),[d,u]=q.default.useState({}),c=q.default.useMemo((()=>Object.keys(d).length?d:o.length===i.length?null:{in:o}),[o,d]);return q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:"tree-panel",style:l.filter.style},q.default.createElement(Lu,{multiple:!0,value:o,dataSource:r,disabled:!!Object.keys(d).length,size:n,style:{height:238},onCheckChange:e=>{s(e.map((e=>e.value)))}})),q.default.createElement(yu,{style:{marginLeft:-10,marginRight:-10,padding:"6px 0 0 20px",borderTop:"1px solid #e8e8e8"},onChange:e=>{Object.keys(e).length&&s([]),u(e)}}),q.default.createElement(gu,{value:c}))},Au=e=>{const{column:t,filters:l}=e,{$size:n,prefixCls:a,pagerFilter:r,setFilters:i,clearSuperFilters:o}=q.default.useContext(ei),{t:s}=ot(),[d,u]=q.default.useState(!1),c=q.default.useMemo((()=>{const{dataIndex:e,filter:l}=t;return`${e}|${l.type}`}),[t]),f=q.default.useMemo((()=>!!Object.keys(l[c]||{}).length||!!r[t.dataIndex]),[l,r]),p=(e,t)=>{o(),i({payload:e}),t&&u(!1)},m=q.default.useMemo((()=>({dataKey:c,filterValue:l[c],onChange:p})),[l]);q.default.useEffect((()=>{"radio"===t.filter.type&&ft("Table","表头筛选类型 `radio` 即将被弃用,请使用 `checkbox` 替代")}),[]);const h={text:e=>q.default.createElement(vu,{column:e}),textarea:e=>q.default.createElement(bu,{column:e}),number:e=>q.default.createElement(xu,{column:e}),date:e=>q.default.createElement(Eu,{column:e}),radio:e=>h.checkbox(e),checkbox:e=>q.default.createElement(Cu,{column:e}),tree:e=>q.default.createElement(Pu,{column:e})},g={"head-filter__popper":!0,[`${a}--lg`]:"large"===n,[`${a}--sm`]:"small"===n},v=["cell--filter",{selected:d,actived:f}];return q.default.createElement(xs,{action:["click"],popupVisible:d,popup:(()=>{const e=h[t.filter.type];return e?q.default.createElement("div",{className:"head-filter--wrap",onClick:e=>e.stopPropagation()},q.default.createElement(cu.Provider,{value:m},e(t))):(ft("Table","表头筛选的类型 `type` 配置不正确"),null)})(),popupClassName:J.default(g),popupStyle:{minWidth:150},onPopupVisibleChange:e=>u(e),builtinPlacements:di,destroyPopupOnHide:!0,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},q.default.createElement("div",{className:J.default(v),title:s("qm.table.filter.text"),onClick:e=>e.stopPropagation()},q.default.createElement("span",{className:"svgicon icon"},q.default.createElement(fu,null))))},Fu=e=>{const{column:t}=e,{tableRef:l,bordered:n}=q.default.useContext(ei),{columns:a,resizable:r,columnsChange:i=Le}=l.current.props,o=q.default.useMemo((()=>xa(t)),[t]),s={resizable:!0,"is--line":r&&!n};return q.default.createElement("div",{className:J.default(s),onMouseDown:e=>{e.preventDefault();const t=e.target,{elementStore:n,scrollBarRef:r}=l.current,s=n.$resizableBar,d=t.offsetWidth/2,u=e.clientX,c=Ra(t,n.$table).left-r.current.scrollLeft+d;n.$table.classList.add("c--resize"),s.style.left=`${c}px`,s.style.display="block";const f=o.width||o.renderWidth;let p=f;return document.onmousemove=function(e){if("number"!=typeof f)return;const t=e.clientX-u,l=f+t;l<(o.minWidth||bi.defaultColumnWidth)||(p=Math.floor(l),s.style.left=`${t+c}px`)},document.onmouseup=function(){n.$table.classList.remove("c--resize"),s.style.display="none",this.onmousemove=null,this.onmouseup=null,"number"==typeof p&&(ya(a,o.dataIndex).width=p,i([...a]))},!1}})},_u=e=>{const{selectionKeys:t}=e,{tableRef:n,getRowKey:a,fetchParams:r,setSelectionKeysEffect:i,setInvalidRowKeys:o,setSpinning:s,pagination:u,isFetch:c,isWebPagination:f,createWebPageData:p}=q.default.useContext(ei),{t:m}=ot(),{selectionRows:h,recordsMap:v}=n.current,{rowSelection:y}=n.current.props,{fetchAllRowKeys:b,selectAllOnCurrentPage:x,filterable:E,onSelectAll:C}=y,w=q.default.useRef([]),S=q.default.useMemo((()=>c&&!!b),[c,b]),N=q.default.useMemo((()=>!S&&!!x),[S,x]),T=q.default.useMemo((()=>(null==E||E)&&!N),[E,N]),I=()=>{const{disabled:e}=y;return(e?h.filter((t=>!e(t))):h).map((e=>a(e,e.index)))},O=()=>f?Ca(p()):Array.from(v.values()),R=q.default.useMemo((()=>(()=>{const{disabled:e}=y;if(S)return w.current.length?w.current:l.union(Array.from(v.keys()),I());if(!N)return e?Array.from(v.keys()).filter((t=>!e(v.get(t)))):Array.from(v.keys());const t=e?O().filter((t=>!e(t))).map((e=>a(e,e.index))):O().map((e=>a(e,e.index)));return l.union(t,I())})()),[v,w,h,u]),k=t.filter((e=>!R.includes(e))),L=t.length-k.length,P=L>0&&L<R.length,A=!!L&&L===R.length;o(k);const F=()=>Ie(void 0,void 0,void 0,(function*(){var e;const t=b;let n=[];s(!0);try{const i=yield t.api(r);if(200===i.code){n=Array.isArray(i.data)?i.data:null!==(e=l.get(i.data,t.dataKey))&&void 0!==e?e:[];const{disabled:r}=y;r&&(n=l.xor(n,O().filter((e=>r(e))).map((e=>a(e,e.index))))),w.current=n}}catch(e){}return s(!1),n})),_=e=>Ie(void 0,void 0,void 0,(function*(){let t=[];t=S?e?yield F():[]:e?R.slice(0):[],t=[...new Set([...t,...k])],i(t),null==C||C(e,t)})),D=()=>{const e=[{key:1,label:m("qm.table.selection.all"),onClick:()=>{_(!0)}},{key:2,label:m("qm.table.selection.invert"),onClick:()=>Ie(void 0,void 0,void 0,(function*(){let e=[];e=S?l.xor(t,yield F()):l.xor(t,R),e=[...new Set([...e,...k])],i(e)}))},{key:3,label:m("qm.table.selection.clear"),onClick:()=>{_(!1)}}];return q.default.createElement(d.Menu,{items:e})};return q.default.createElement("div",{className:"cell--selection"},q.default.createElement(d.Checkbox,{checked:A,indeterminate:P,disabled:!R.length,onChange:e=>_(e.target.checked)}),T&&q.default.createElement(d.Dropdown,{overlayClassName:"all-selection__popper",dropdownRender:()=>D()},q.default.createElement(g.DownOutlined,{className:"svgicon icon"})),N&&q.default.createElement(d.Tooltip,{placement:"top",title:m("qm.table.selection.currentPage")},q.default.createElement(g.InfoCircleOutlined,{className:"info"})))},Du=e=>{const{style:t}=e,{tableRef:l,rowExpandedKeys:n,setRowExpandedKeys:a,createAllExpandedKeys:r,filters:i,pagerFilter:o,superFilters:s}=q.default.useContext(ei),{expandable:d}=l.current.props,[u,c]=q.default.useState((null==d?void 0:d.defaultExpandAllRows)||!1);Yl((()=>{f(n)!==u&&c(!u)}),[n]),Yl((()=>{l.current.isTreeTable&&(De(i)&&De(o)&&De(s)||Fe((()=>!f(n)&&a(r()))))}),[i,o,s]);const f=e=>r().every((t=>e.includes(t))),p={[`${gt("expand")}--icon`]:!0,expanded:u,collapsed:!u};return q.default.createElement("span",{className:J.default(p),title:"",onClick:e=>{e.stopPropagation(),c(!u),a(u?[]:r())},style:t})},Mu=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-up",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.createElement("path",{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"})),Hu=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.createElement("path",{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"})),qu=e=>{const{tableColumns:t}=e,{global:l}=q.default.useContext(xe),{tableRef:n,prefixCls:a,layout:r,flattenColumns:i,sorter:o,filters:s,superFilters:u,pagerFilter:c,selectionKeys:f,isFetch:p,treeExpandIndex:m,tableChange:h,setSorter:v,setElementStore:y,resetTableScroll:b,getStickyLeft:x,getStickyRight:E,createTableFullData:C}=q.default.useContext(ei),{ellipsis:w,resizable:S,multipleSort:N,rowSelection:T,expandable:I,keepScrollOnDataChange:O}=n.current.props,[R,k]=bi.sortDirections,{t:L}=ot(),P=q.default.useRef(null),A=q.default.useMemo((()=>!p),[p]),F=q.default.useMemo((()=>!(null==I?void 0:I.hideExpandAll)),[I]),_=q.default.useMemo((()=>!!T&&(p?!(!T.selectAllOnCurrentPage&&!T.fetchAllRowKeys):!T.hideSelectAll)),[p,T]),D=q.default.useMemo((()=>Object.fromEntries(Object.entries(o).filter((([e,t])=>null!==t)))),[o]);Cn((()=>{G(),W(!0),h(),!O&&Fe(b)}),[s,u]),Cn((()=>{X(),W(!0),h(),!O&&Fe(b)}),[c]),Cn((()=>{z(),h(),!O&&Fe(b)}),[o]),q.default.useEffect((()=>{!De(s)&&G(),!De(o)&&z()}),[]),q.default.useLayoutEffect((()=>{M()}),[]);const M=()=>{y("$header",P.current)},H=(e,t,a)=>{var r,i;const{dataIndex:s,colSpan:d,rowSpan:u,fixed:c,align:f,theadAlign:p,theadWrap:m=(null==l?void 0:l.labelWrap),theadClassName:h="",sorter:g,filter:v,required:y,headRender:b}=e;if(0===d)return null;const C=p||f,N=["header--column",{"col--ellipsis":!m&&w,"col--center":"center"===C,"col--right":"right"===C,"column--required":!!y,"column-has-sorter":g,"column-has-filter":v,"column--sort":!!o[s],"cell-fix-left":"left"===c,"cell-fix-right":"right"===c,"cell-fix-left-last":"left"===c&&!(null===(r=a[t+(null!=d?d:1)])||void 0===r?void 0:r.fixed),"cell-fix-right-first":"right"===c&&!(null===(i=a[t-1])||void 0===i?void 0:i.fixed),[h]:!!h}],T={left:"left"===c?`${x(s)}px`:"",right:"right"===c?`${E(s,"thead")}px`:""},I=S&&![bi.expandableColumn,bi.selectionColumn].includes(s);return q.default.createElement("th",{key:s,className:J.default(N),colSpan:d,rowSpan:u,style:Object.assign({},T),onClick:t=>V(t,e)},q.default.createElement("div",{className:"cell--wrapper"},b?q.default.createElement("div",{className:"cell--text cell"},b(e,n.current.tableFullData)):q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:"cell--text"},$(e)),v?K(e):null)),I&&q.default.createElement(Fu,{column:e}))},$=e=>{const{dataIndex:t,type:l,sorter:a,title:r,description:i}=e;if(t===bi.selectionColumn&&"checkbox"===l){if("checkbox"===l)return q.default.createElement("div",{className:"cell"},_?q.default.createElement(_u,{selectionKeys:f}):L("qm.table.config.selectionText"));if("radio"===l)return q.default.createElement("div",{className:"cell"},r)}const s=[];return s.push(q.default.createElement("div",{key:0,className:"cell",title:ja(r)},n.current.isTreeTable&&t===m&&F?q.default.createElement(Du,null):null,t===bi.expandableColumn&&F?q.default.createElement(Du,null):r)),i&&s.push(q.default.createElement(d.Tooltip,{key:1,placement:"top",title:i},q.default.createElement(g.InfoCircleOutlined,{className:"tip"}))),a&&s.push(j(o[t])),s},j=e=>{const t=["svgicon cell--sorter__asc",{actived:e===R}],l=["svgicon cell--sorter__desc",{actived:e===k}];return q.default.createElement("div",{key:2,className:"cell--sorter",title:L("qm.table.sorter.text")},q.default.createElement("span",{className:J.default(t)},q.default.createElement(Mu,null)),q.default.createElement("span",{className:J.default(l)},q.default.createElement(Hu,null)))},K=e=>q.default.createElement(Au,{column:e,filters:s}),V=(e,t)=>{const{sorter:l,dataIndex:n}=t;if(l){const e=o[n],t=e?e===k?null:k:R;N?(delete o[n],v({payload:Object.assign({},o,{[n]:t})})):v({payload:Object.assign({},{[n]:t})})}},z=()=>{A&&W()},W=e=>{const t=Object.keys(D).length>0;e?t&&U(D):U(t?D:{index:R})},B=(e,t)=>Number.isNaN(e-t)?e.toString().localeCompare(t.toString()):e-t,U=e=>{const t=((e,t)=>e.sort(((e,l)=>{for(const n in t){const a=i.find((e=>e.dataIndex===n)),r=t[n],o=Pa(e,n),s=Pa(l,n),d="function"!=typeof(null==a?void 0:a.sorter)?B(o,s):a.sorter(e,l);if(0!==d)return"ascend"===r?d:-d}return 0})).slice(0))(n.current.tableFullData,e);C(t)},G=()=>{A&&Y()},Y=()=>{const{tableOriginData:e,isOriginTree:t}=n.current,l=u.length?Va(u):Va(s);let a=fa(e,A?l:"",t);a=er(a,c,t),C(a)},X=()=>{Y()},Q=Na(t),{tableBodyWidth:Z}=r;return q.default.createElement("div",{ref:P,className:`${a}--header-wrapper`},q.default.createElement("table",{className:`${a}--header`,cellSpacing:"0",cellPadding:"0",style:{width:Z?`${Z}px`:""}},q.default.createElement("colgroup",null,i.map((e=>{const{dataIndex:t,width:l,renderWidth:n}=e;return q.default.createElement("col",{key:t,style:{width:`${l||n}px`,minWidth:`${l||n}px`}})}))),q.default.createElement("thead",null,(e=>e.map(((e,t)=>q.default.createElement("tr",{key:t,className:"header--row"},e.map(((t,l)=>H(t,l,e)))))))(Q))))},$u=q.default.createContext([]),ju=(e,t,l,n,a,r,i,o,s,d)=>{var u;const{clientX:c,clientY:f}=e,{top:p,height:m}=e.target.getBoundingClientRect(),h=(((null==a?void 0:a.x)||0)-c-12)/n,g=s.filter((e=>{var t,l;return null===(l=null===(t=o[e])||void 0===t?void 0:t.children)||void 0===l?void 0:l.length}));let v=Ku(o,l.eventKey);if(f<p+m/2){const e=i.findIndex((e=>e===v.key)),t=i[e<=0?0:e-1];v=Ku(o,t)}const y=v.key,b=v,x=v.key;let E=0,C=0;if(!g.includes(y))for(let e=0;e<h&&zu(v);e+=1)v=v.parent,C+=1;const w=t.data,S=v.node;let N=!0;return Wu(v)&&0===v.level&&f<p+m/2&&r({dragNode:w,dropNode:S,dropPosition:-1})&&v.key===l.eventKey?E=-1:(b.children||[]).length&&g.includes(x)?r({dragNode:w,dropNode:S,dropPosition:0})?E=0:N=!1:0===C?h>-1.5?r({dragNode:w,dropNode:S,dropPosition:1})?E=1:N=!1:r({dragNode:w,dropNode:S,dropPosition:0})?E=d?1:0:r({dragNode:w,dropNode:S,dropPosition:1})?E=1:N=!1:r({dragNode:w,dropNode:S,dropPosition:1})?E=1:N=!1,{dropPosition:E,dropLevelOffset:C,dropTargetKey:v.key,dropTargetPos:v.pos,dragOverNodeKey:x,dropContainerKey:0===E?null:(null===(u=v.parent)||void 0===u?void 0:u.key)||null,dropAllowed:N}},Ku=(e,t)=>e[t],Vu=e=>e.split("-"),zu=e=>{if(e.parent){const t=Vu(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1},Wu=e=>{const t=Vu(e.pos);return 0===Number(t[t.length-1])},Bu=({openDragSort:e})=>{const{tableRef:t,getRowKey:l,rowExpandedKeys:n,setRowExpandedKeys:a,createTableData:r,dataChange:i}=q.default.useContext(ei),{tableFullData:o,recordsMap:s,isTreeTable:d}=t.current,{beforeRowDrop:u}=t.current.props,c=Pe,f=q.default.useRef(null),p=q.default.useRef(null),m=q.default.useRef(null),h=q.default.useRef(),[g,v]=q.default.useState({}),[y,b]=q.default.useState(null),[x,E]=q.default.useState([]),[C,w]=q.default.useState(0),[S,N]=q.default.useState({dropPosition:null,dropLevelOffset:null,dropContainerKey:null,dropTargetKey:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null}),T=e=>{N((t=>Object.assign({},t,e)))};q.default.useLayoutEffect((()=>{e&&v((e=>{const t={},n=(e,a=null,r=0)=>{const i=[];return e.forEach(((e,o)=>{const s=l(e,e.index),d={index:o,key:s,level:r,node:e,parent:a,pos:(u=(null==a?void 0:a.pos)||"0",c=o,`${u}-${c}`),nodes:[...(null==a?void 0:a.nodes)||[],e]};var u,c;Array.isArray(e.children)&&(d.children=n(e.children,d,r+1)),t[s]=d,i.push(d)})),i};return n(e),t})(o))}),[o]),q.default.useEffect((()=>()=>{window.removeEventListener("dragend",R)}),[]);const I=()=>{T({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})},O=()=>{null!==y&&(b(null),T({dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null})),p.current=null,m.current=null},R=e=>{k(),window.removeEventListener("dragend",R)},k=(e,t,l)=>{T({dragOverNodeKey:null}),O(),f.current=null,window.removeEventListener("dragend",R)},L=e=>{const t=e.node.eventKey,n=e.dragNode.eventKey,a=e.node.pos.split("-"),s=e.dropPosition-Number(a[a.length-1]);if(u){if(!1===u({dragNode:e.dragNode.data,dropPosition:e.dropPosition,dropToGap:e.dropToGap,dragNodesKeys:e.dragNodesKeys,node:e.node.data,event:e.event},o))return}const d=(e,t,n)=>{for(let a=0;a<e.length;a++){if(l(e[a],e[a].index)===t)return n(e[a],a,e);e[a].children&&d(e[a].children,t,n)}},c=[...o];let f;if(d(c,n,((e,t,l)=>{l.splice(t,1),f=e})),e.dropToGap){let e,l=[];d(c,t,((t,n,a)=>{l=a,e=n})),-1===s?l.splice(e,0,f):l.splice(e+1,0,f)}else d(c,t,(e=>{e.children=e.children||[],e.children.unshift(f)}));r(c),i()};return{onNodeDragStart:(e,t)=>{const{eventKey:l}=t;f.current=t,p.current={x:e.clientX,y:e.clientY};const r=((e,t)=>{if(!e)return[];const l=e.slice(),n=l.indexOf(t);return n>=0&&l.splice(n,1),l})(n,l);b(l),E(((e,t)=>{const l=[];return function e(t=[]){t.forEach((({key:t,children:n})=>{l.push(t),e(n)}))}(Ku(t,e).children),l})(l,g)),w(2*bi.treeTable.textIndent),a(r),window.addEventListener("dragend",R)},onNodeDragEnter:(e,t)=>{const{eventKey:l}=t;if(m.current!==l&&(m.current=l),!f.current)return void I();const{dropPosition:r,dropLevelOffset:i,dropTargetKey:o,dropContainerKey:u,dropTargetPos:v,dropAllowed:b,dragOverNodeKey:E}=ju(e,f.current,t,C,p.current,c,Array.from(s.keys()),g,n,!d);-1===x.indexOf(o)&&b?(h.current||(h.current={}),Object.keys(h.current).forEach((e=>{clearTimeout(h.current[e])})),f.current.eventKey!==l&&(e.persist(),h.current[l]=window.setTimeout((()=>{var e;if(null===y)return;let t=[...n];const r=Ku(g,l);r&&(null===(e=r.children)||void 0===e?void 0:e.length)&&(t=((e,t)=>{const l=(e||[]).slice();return-1===l.indexOf(t)&&l.push(t),l})(n,l)),a(t)}),800)),f.current.eventKey!==o||0!==i?T({dragOverNodeKey:E,dropPosition:r,dropLevelOffset:i,dropTargetKey:o,dropContainerKey:u,dropTargetPos:v,dropAllowed:b}):I()):I()},onNodeDragOver:(e,t)=>{if(!f.current)return;const{dropPosition:l,dropLevelOffset:a,dropTargetKey:r,dropContainerKey:i,dropAllowed:o,dropTargetPos:u,dragOverNodeKey:m}=ju(e,f.current,t,C,p.current,c,Array.from(s.keys()),g,n,!d);-1===x.indexOf(r)&&o&&(f.current.eventKey===r&&0===a?null===S.dropPosition&&null===S.dropLevelOffset&&null===S.dropTargetKey&&null===S.dropContainerKey&&null===S.dropTargetPos&&!1===S.dropAllowed&&null===S.dragOverNodeKey||I():l===S.dropPosition&&a===S.dropLevelOffset&&r===S.dropTargetKey&&i===S.dropContainerKey&&u===S.dropTargetPos&&o===S.dropAllowed&&m===S.dragOverNodeKey||T({dropPosition:l,dropLevelOffset:a,dropTargetKey:r,dropContainerKey:i,dropTargetPos:u,dropAllowed:o,dragOverNodeKey:m}))},onNodeDragLeave:(e,t)=>{m.current!==t.eventKey||e.currentTarget.contains(e.relatedTarget)||(I(),m.current=null)},onNodeDragEnd:k,onNodeDrop:(e,t,l=!1)=>{const{dropPosition:n,dropTargetKey:a,dropTargetPos:r,dropAllowed:i,dragOverNodeKey:o}=S;if(!i)return;if(T({dragOverNodeKey:null}),O(),null===a)return;const s=Object.assign(Object.assign({},((e,{dragOverNodeKey:t,dropPosition:l,keyEntities:n})=>{const a=Ku(n,e);return{eventKey:e,pos:a?a.pos:"",dragOver:t===e&&0===l,dragOverGapTop:t===e&&-1===l,dragOverGapBottom:t===e&&1===l}})(a,{dropPosition:n,dragOverNodeKey:o,keyEntities:g})),{data:Ku(g,a).node});-1!==x.indexOf(a)&&ft("Table Draggable","无法拖放到 `dragNode` 的子节点");const d=Vu(r),u={event:e,node:s,dragNode:f.current,dragNodesKeys:[f.current.eventKey].concat(x),dropToGap:0!==n,dropPosition:n+Number(d[d.length-1])};l||L(u),f.current=null},indent:C,dropOptions:S}};function Uu(){const[,e]=$.useReducer((e=>e+1),0);return e}const Gu=q.default.forwardRef(((e,t)=>{const{rowKey:l,rowIndex:n,row:a,className:r,style:i,indent:o,filter:s,dropOption:d,onNodeDragStart:u,onNodeDragEnter:c,onNodeDragOver:f,onNodeDragLeave:p,onNodeDragEnd:m,onNodeDrop:h}=e,g=q.default.useRef({eventKey:l,data:a,props:e}),v=q.default.useRef(!1),[y,b]=q.default.useState(!1),{dropPosition:x,dropLevelOffset:E,dragOverNodeKey:C,dropTargetKey:w,dropContainerKey:S}=d,N=C===l&&0===x,T=C===l&&-1===x,I=C===l&&1===x,O=a._level||0,R={};switch(x){case-1:Object.assign(R,{top:0,left:-E*o+O*o});break;case 1:Object.assign(R,{bottom:0,left:-E*o+O*o});break;case 0:Object.assign(R,{bottom:0,left:o+O*o})}const k={"body--row-draggable":!0,"body--row-dragging":y,"drop-target":w===l,"drop-container":S===l,"drag-over":N,"drag-over-gap-top":T,"drag-over-gap-bottom":I};return q.default.createElement("tr",{ref:t,"data-row-key":l,"data-row-index":n,className:J.default(r,k),style:i,draggable:!0,onMouseDown:e=>{var t;s&&(t=e.target.matches(s),v.current=t)},onDragStart:e=>{if(e.stopPropagation(),v.current)return e.preventDefault();b(!0),u(e,g.current);try{e.dataTransfer.setData("text/plain","")}catch(e){}},onDragEnter:e=>{e.preventDefault(),e.stopPropagation(),c(e,g.current)},onDragOver:e=>{e.preventDefault(),e.stopPropagation(),f(e,g.current)},onDragLeave:e=>{e.stopPropagation(),p(e,g.current)},onDrop:e=>{e.preventDefault(),e.stopPropagation(),b(!1),h(e,g.current)},onDragEnd:e=>{e.stopPropagation(),b(!1),m(e,g.current)}},e.children,C===l&&null!==x&&null!==E&&q.default.createElement("td",{className:"drop-indicator",style:R}))}));Gu.displayName="DraggableTr";const Yu=e=>{const{selectionKeys:t,column:l,record:n,rowKey:a}=e,{tableRef:r}=q.default.useContext(ei),{rowSelection:i}=r.current.props,o=q.default.useMemo((()=>l.type||""),[l.type]),s=e=>{var l,n;const{isTreeTable:a,tableFullData:o}=r.current,s=null===(l=i.checkStrictly)||void 0===l||l;if(!a||s)return!1;const d=Ba(o,(t=>t._rowKey===e));return((e,t)=>{const l=new Set(t);let n=!1,a=!1;for(const t of e)if(l.has(t)?n=!0:a=!0,n&&a)break;return n&&a})(Sa(null!==(n=null==d?void 0:d.children)&&void 0!==n?n:[],(e=>e._rowKey)),t)};return"radio"===o?(()=>{var e;const l=i.disabled,r=null!==(e=null==l?void 0:l(n))&&void 0!==e&&e,o=!r&&t[0]===a;return q.default.createElement(d.Radio,{checked:o,disabled:r})})():(()=>{var e;const l=i.disabled,r=null!==(e=null==l?void 0:l(n))&&void 0!==e&&e,o=!!t.includes(a);return q.default.createElement(d.Checkbox,{checked:o,indeterminate:s(a),disabled:r})})()},Xu=e=>{const{record:t,rowKey:l,style:n}=e,{tableRef:a,rowExpandedKeys:r,setRowExpandedKeys:i}=q.default.useContext(ei),{expandable:o={}}=a.current.props,[s]=q.default.useState("function"==typeof o.rowExpandable&&!o.rowExpandable(t)),d=q.default.useMemo((()=>r.includes(l)),[r,l]);Yl((()=>{var e;null===(e=o.onExpand)||void 0===e||e.call(o,d,t)}),[d]);const u={[`${gt("expand")}--icon`]:!0,expanded:d,collapsed:!d,disabled:s};return q.default.createElement("span",{className:J.default(u),title:"",onClick:e=>{if(e.stopPropagation(),s)return;const t=d?r.filter((e=>e!==l)):[...r,l];i(t)},style:n})},Qu=q.default.createContext({}),Zu=q.default.forwardRef(((e,t)=>{var l;const{$size:n,doFieldValidate:a}=q.default.useContext(ei),{dataKey:r,doFieldUpdate:i,cellValueChange:o}=q.default.useContext(Qu),{column:s,row:u,rowKey:c,columnKey:f,options:p,isTextArea:m}=e,{t:h}=ot(),g=Uu(),v=q.default.useRef(!1),{dataIndex:y}=s,{type:b,extra:x={},rules:E=[],onInput:C,onChange:w,onEnter:S,onBlur:N}=p,T=Pa(u,y),I=Object.assign({},{minRows:1,maxRows:4},x.autoSize),O=m?{rows:I.minRows,autoSize:I}:null,R=x.password?d.Input.Password:m?d.Input.TextArea:d.Input;return q.default.createElement(R,tt({ref:t,size:n,value:T,maxLength:x.maxLength,showCount:x.showCount},O,{autoComplete:x.password?"new-password":"off",placeholder:null!==(l=x.placeholder)&&void 0!==l?l:h("qm.table.editable.inputPlaceholder"),allowClear:x.allowClear,readOnly:x.readOnly,disabled:x.disabled,suffix:x.suffix,onChange:e=>{var t;const l=null!==(t=e.target.value)&&void 0!==t?t:"";Aa(u,y,l),a(E,l,c,f,ja(s.title)),g(),null==C||C({[r]:l}),v.current=!0},onBlur:e=>{var t;const l=null!==(t=e.target.value)&&void 0!==t?t:"";v.current&&(v.current=!1,i(u,c,f),null==w||w({[r]:l},u),null==N||N({[r]:l},u),o())},onKeyUp:e=>{var t;if(13===e.keyCode&&!e.shiftKey){const l=null!==(t=e.target.value)&&void 0!==t?t:"";null==S||S({[r]:l},u)}},onKeyDown:e=>{m&&13===e.keyCode&&!e.shiftKey&&S&&e.preventDefault()}}))}));Zu.displayName="TextCell";const Ju=q.default.forwardRef(((e,t)=>{const{size:l,defaultValue:n,value:a,min:r,max:i,prefix:o,suffix:s,placeholder:u,maxLength:c,precision:f,stringMode:p,allowClear:m,readOnly:h,disabled:g,formatter:v=(e=>e.toString()),parser:y=(e=>e),onFocus:b}=e,x=e=>{let t=e.toString();return"."!==t.charAt(t.length-1)&&"-"!==t||(t=t.slice(0,-1)),t&&Number(t)>i&&(t=i.toString()),t&&Number(t)<r&&(t=r.toString()),f>=0&&""!==t&&(t=new ce.default(t).toFixed(f)),t},E=void 0!==a,[C,w]=q.default.useState(null!=n?n:""),S=v(E?a:C),N=y(S);Yl((()=>{var t;null===(t=e.onChange)||void 0===t||t.call(e,N)}),[C]);return q.default.createElement(d.Input,{ref:t,size:l,value:S,maxLength:c,prefix:o,suffix:s,placeholder:u,allowClear:m,readOnly:h,disabled:g,onChange:t=>{const l=y(t.target.value.replace(/\s+/g,""));let n=/^-?\d*(\.\d*)?$/.test(l)||""===l||"-"===l;if(0===f&&l.includes(".")&&(n=!1),r>=0&&l.startsWith("-")&&(n=!1),n){if(!p&&(Number(l)>Number.MAX_SAFE_INTEGER||Number(l)<Number.MIN_SAFE_INTEGER))return;(t=>{var l;E?null===(l=e.onChange)||void 0===l||l.call(e,t):w(t)})(l)}},onFocus:b,onBlur:()=>{var t;const l=x(N);null===(t=e.onBlur)||void 0===t||t.call(e,l,N)},onKeyUp:t=>{var l;13===t.keyCode&&(null===(l=e.onEnter)||void 0===l||l.call(e,x(N),N))}})}));Ju.displayName="InputNumber";const ec=q.default.forwardRef(((e,t)=>{var l,n;const{$size:a,doFieldValidate:r}=q.default.useContext(ei),{dataKey:i,doFieldUpdate:o,cellValueChange:s}=q.default.useContext(Qu),{column:d,row:u,rowKey:c,columnKey:f,options:p}=e,{t:m}=ot(),h=Uu(),g=q.default.useRef(!1),{dataIndex:v,precision:y,formatType:b}=d,{type:x,extra:E={},rules:C=[],onInput:w,onChange:S,onEnter:N,onBlur:T}=p,I=Pa(u,v);let O,R;"finance"===b&&(O=e=>{const t=e.toString().split(".");return`${t[0].replace(/\B(?=(\d{3})+(?!\d))/g,",")}${void 0!==t[1]?`.${t[1]}`:""}`},R=e=>e.replace(/\$\s?|(,*)/g,"")),"percent"===b&&(O=e=>"."===(e+="").charAt(e.length-1)||"-"===e||""===e?e:`${new ce.default(e).times(100).toNumber()}`,R=e=>"."===e.charAt(e.length-1)||"-"===e||""===e?e:new ce.default(e).times(.01).toString());const k=e=>e?(e=>/^[+-]?\d+(\.\d+)?[eE][+-]?\d+$/.test(e.toString()))(Number(e))?e:Number(e):"";return q.default.createElement(Ju,{ref:t,size:a,value:I,min:E.min,max:E.max,precision:y,stringMode:E.stringMode,prefix:E.prefix,suffix:null!==(l=E.suffix)&&void 0!==l?l:"percent"===b?"%":void 0,placeholder:null!==(n=E.placeholder)&&void 0!==n?n:m("qm.table.editable.inputPlaceholder"),maxLength:E.maxLength,allowClear:E.allowClear,readOnly:E.readOnly,disabled:E.disabled,formatter:O,parser:R,onChange:e=>{Aa(u,v,e),r(C,e,c,f,ja(d.title)),h(),null==w||w({[i]:e}),g.current=!0},onBlur:(e,t)=>{if(!g.current)return;g.current=!1;let l=E.stringMode?e:k(e);"percent"===b&&"."===t.charAt(t.length-1)&&(l=Number(e)/100),Aa(u,v,l),o(u,c,f),null==S||S({[i]:l},u),null==T||T({[i]:l},u),s()},onEnter:(e,t)=>{let l=E.stringMode?e:k(e);"percent"===b&&"."===t.charAt(t.length-1)&&(l=Number(e)/100),null==N||N({[i]:l},u)}})}));ec.displayName="NumberCell";const tc=e=>{var t,l;const{$size:n,doFieldValidate:a}=q.default.useContext(ei),{dataKey:r,doFieldUpdate:i,cellValueChange:o}=q.default.useContext(Qu),{column:s,row:u,rowKey:c,columnKey:f,options:p,isMultiple:m}=e,{t:h}=ot();Uu();const{dataIndex:g,dictItems:v=[]}=s,{type:y,extra:b={},rules:x=[],items:E,onChange:C,onEnter:w}=p,S=E||v,N=Pa(u,g);let T=N;return q.default.createElement(d.Select,{mode:m?"multiple":void 0,size:n,popupClassName:bi.popupClassName,value:N||void 0,placeholder:null!==(t=b.placeholder)&&void 0!==t?t:h("qm.table.editable.selectPlaceholder"),allowClear:b.allowClear,listHeight:b.listHeight,maxTagCount:b.collapseTags?"responsive":void 0,maxTagTextLength:b.maxTagTextLength,disabled:b.disabled,style:{width:"100%"},showSearch:null===(l=b.filterable)||void 0===l||l,filterOption:(e,t)=>{var l;const n=(null===(l=null==t?void 0:t.children)||void 0===l?void 0:l.toString())||"";return`${n}|${_r.parse(n).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`.toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{Aa(u,g,e),a(x,e,c,f,ja(s.title)),i(u,c,f),null==C||C({[r]:e},u),o()},onSelect:e=>{T=e},onInputKeyDown:e=>{13===e.keyCode&&Fe((()=>null==w?void 0:w({[r]:T},u)))}},S.map((e=>q.default.createElement(d.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))},lc=e=>{var t;const{$size:l,doFieldValidate:n}=q.default.useContext(ei),{dataKey:a,doFieldUpdate:r,cellValueChange:i}=q.default.useContext(Qu),{column:o,row:s,rowKey:d,columnKey:u,options:c,dateType:f}=e;ot(),Uu();const{dataIndex:p}=o,{type:m,extra:h={},rules:g=[],onChange:v}=c,y=Pa(s,p);return q.default.createElement(et,{size:l,popupClassName:bi.popupClassName,value:null!==(t=Ha(y,dr[f]))&&void 0!==t?t:void 0,picker:sr[f],format:h.format,showTime:"datetime"===f,disabledDate:e=>(e=>{const{minDateTime:t,maxDateTime:l}=h;return t&&l?e.isBefore(t,"day")||e.isAfter(l,"day"):t?e.isBefore(t,"day"):!!l&&e.isAfter(l,"day")})(e),placeholder:h.placeholder,allowClear:h.allowClear,disabled:h.disabled,style:{width:"100%"},onChange:e=>{const t=qa(e,dr[f]);Aa(s,p,t),n(g,t,d,u,ja(o.title)),r(s,d,u),null==v||v({[a]:t},s),i()}})},nc=e=>{var t;const{$size:l,doFieldValidate:n}=q.default.useContext(ei),{dataKey:a,doFieldUpdate:r,cellValueChange:i}=q.default.useContext(Qu),{column:o,row:s,rowKey:d,columnKey:u,options:c}=e;ot(),Uu();const{dataIndex:f}=o,{type:p,extra:m={},rules:h=[],onChange:g}=c,v="HH:mm:ss",y=Pa(s,f);return q.default.createElement(lt,{size:l,popupClassName:bi.popupClassName,value:null!==(t=Ha(y,v))&&void 0!==t?t:void 0,format:m.format||v,placeholder:m.placeholder,allowClear:m.allowClear,disabled:m.disabled,style:{width:"100%"},onChange:e=>{const t=qa(e,v);Aa(s,f,t),n(h,t,d,u,ja(o.title)),r(s,d,u),null==g||g({[a]:t},s),i()}})},ac=e=>{const{$size:t,doFieldValidate:l}=q.default.useContext(ei),{dataKey:n,doFieldUpdate:a,cellValueChange:r}=q.default.useContext(Qu),{column:i,row:o,rowKey:s,columnKey:u,options:c}=e;ot(),Uu();const{dataIndex:f}=i,{type:p,extra:m={},rules:h=[],onChange:g}=c,{trueValue:v=ai,falseValue:y=ri,disabled:b}=m,x=Pa(o,f);return q.default.createElement(d.Checkbox,{checked:x===v,disabled:b,onChange:e=>{const t=e.target.checked?v:y;Aa(o,f,t),l(h,t,s,u,ja(i.title)),a(o,s,u),null==g||g({[n]:t},o),r()}})},rc=e=>{const{$size:t,doFieldValidate:l}=q.default.useContext(ei),{dataKey:n,doFieldUpdate:a,cellValueChange:r}=q.default.useContext(Qu),{column:i,row:o,rowKey:s,columnKey:u,options:c}=e;ot(),Uu();const{dataIndex:f}=i,{type:p,extra:m={},rules:h=[],onChange:g}=c,{trueValue:v=ai,falseValue:y=ri,disabled:b}=m,x=Pa(o,f);return q.default.createElement(d.Switch,{checked:x===v,disabled:b,onChange:e=>{const t=e?v:y;Aa(o,f,t),l(h,t,s,u,ja(i.title)),a(o,s,u),null==g||g({[n]:t},o),r()}})},ic=e=>{const{$size:t,doFieldValidate:l}=q.default.useContext(ei),{dataKey:n,doFieldUpdate:a,cellValueChange:r}=q.default.useContext(Qu),{column:i,row:o,rowKey:s,columnKey:d,options:u}=e,{dataIndex:c}=i,{type:f,extra:p={},rules:m=[],render:h,onChange:g}=u;if(!h)return ft("Table","单元格编辑的自定义渲染,必须设置 `render` 参数"),null;const v=Pa(o,c),y=e=>{Aa(o,c,e),l(m,e,s,d,ja(i.title)),a(o,s,d),null==g||g({[n]:e},o),r()},b=h(o,i,y);return q.default.isValidElement(b)?q.default.cloneElement(b,{value:v,disabled:p.disabled,readOnly:p.readOnly,popupClassName:bi.popupClassName,onChange:y}):null},oc=e=>{var t,l,n;const{multiple:a,tree:r={},defaultSelectedKeys:i,className:o,style:s,onClose:d}=e,{$size:u}=dt(e),{t:c}=ot(),[f,p]=q.default.useState(),[m]=q.default.useState(null===(t=r.fetch)||void 0===t?void 0:t.params),h={[`${gt("tree-helper")}--wrapper`]:!0},g=r.fetch?Object.assign(Object.assign({},He(r.fetch,["params","valueKey","textKey"])),{params:m}):void 0;return q.default.createElement("div",{className:J.default(h,o),style:s},q.default.createElement(Lu,{multiple:a,fetch:g,fieldsDefine:{valueKey:null===(l=r.fetch)||void 0===l?void 0:l.valueKey,textKey:null===(n=r.fetch)||void 0===n?void 0:n.textKey},autoFocus:!0,asyncLoad:r.asyncLoad,checkStrictly:r.checkStrictly,checkStrategy:r.checkStrategy,defaultSelectedKeys:i,defaultExpandAll:r.defaultExpandAll,onSelectChange:e=>p(e),onCheckChange:e=>p(e)}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Jr[u]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},q.default.createElement(pt,{onClick:()=>d(null),style:{marginRight:8}},c("qm.dialog.cancel")),q.default.createElement(pt,{type:"primary",disabled:!f,onClick:()=>d(f)},c("qm.dialog.confirm"))))};oc.displayName="TreeHelper";const sc=q.default.forwardRef(((e,t)=>{var n,a,r,i;const{$size:o,flattenColumns:s,doFieldValidate:u}=q.default.useContext(ei),{dataKey:c,visible:f,setVisible:p,doFieldUpdate:m,cellValueChange:h}=q.default.useContext(Qu),{column:g,row:v,rowKey:y,columnKey:b,options:x}=e,{t:E}=ot();Uu();const C=!!(null===(n=x.helper)||void 0===n?void 0:n.combinedDataIndex),{dataIndex:w,precision:S}=g,{type:N,extra:T={},rules:I=[],helper:O={},onChange:R,onEnter:k}=x,L=Fa(v,C?O.combinedDataIndex:w),P=O.fieldAliasMap;P||ft("Table","helper 需要配置 `fieldAliasMap` 选项");const A="function"==typeof P?P():P||{};Object.keys(A).includes(w)||ft("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),C&&(O.combinedDataIndex.split("|").every((e=>Object.keys(A).includes(e)))||ft("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),A[w].includes("|")&&ft("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const F=e=>{const{beforeOpen:t}=O,l=(null!=t?t:Pe)({[c]:L},v,g);(null==l?void 0:l.then)?l.then((()=>{p(!0),null==e||e()})).catch((()=>{})):!1!==l&&(p(!0),null==e||e())},_=()=>{p(!1)},D=(e="",t)=>{var n;if(l.isPlainObject(t)&&Object.keys(t).length)for(const e in t){const l=t[e],a=s.find((t=>t.dataIndex===e));if(a){Aa(v,e,l,a.precision);const t=null===(n=a.editRender)||void 0===n?void 0:n.call(a,v,a);t&&Array.isArray(t.rules)&&u(t.rules,l,y,e,ja(a.title))}else Aa(v,e,l)}Aa(v,w,e,S),u(I,e,y,b,ja(g.title)),m(v,y,b),null==R||R({[c]:e},v),h()},M={visible:f,title:E("qm.searchHelper.text"),width:null!==(a=O.width)&&void 0!==a?a:"40%",loading:!1,wrapClassName:bi.popupClassName,bodyStyle:{paddingBottom:`${Jr[o]+20}px`},onClose:()=>{_()}},H=Object.assign(Object.assign({},O),{defaultSelectedKeys:[L],size:o,onClose:e=>{e?(e=>{const t={};for(const l in A){const n=A[l];l!==w&&(t[l]=Fa(e,n))}const l=A[w]?Fa(e,A[w]):"";D(l,t);const{closed:n}=O;p(!1),null==n||n(e)})(e):_()}});return q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Input.Search,{ref:t,value:L,allowClear:null===(r=T.allowClear)||void 0===r||r,readOnly:T.readOnly,disabled:T.disabled,placeholder:null!==(i=T.placeholder)&&void 0!==i?i:E("qm.table.editable.selectPlaceholder"),onChange:e=>{const{value:t}=e.target},onKeyDown:e=>{13===e.keyCode&&(e.target.value,!f&&F())},onDoubleClick:()=>{F()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?F():D(""))}}),q.default.createElement(Qn,M,q.default.createElement(oc,H)))}));sc.displayName="TreeHelperCell";const dc=e=>{var t,n;const{$size:a,doFieldValidate:r}=q.default.useContext(ei),{dataKey:i,visible:o,setVisible:s,doFieldUpdate:u,cellValueChange:c}=q.default.useContext(Qu),{column:f,row:p,rowKey:m,columnKey:h,options:v}=e,{t:y}=ot();Uu(),q.default.useLayoutEffect((()=>{v.items&&w(v.items.map((e=>({[E.current.valueKey]:e.value,[E.current.textKey]:e.text}))))}),[]);const[b,x]=q.default.useState(v.items||[]),E=q.default.useRef({}),C=q.default.useRef([]),w=e=>C.current=e,{dataIndex:S}=f,{type:N,extra:T={},items:I=[],rules:O=[],helper:R={},onInput:k,onChange:L,onEnter:P}=v,A=Pa(p,S),F=R.fieldAliasMap;F||ft("Table","helper 需要配置 `fieldAliasMap` 选项");const _="function"==typeof F?F():F||{};Object.keys(_).includes("valueKey")&&Object.keys(_).includes("textKey")||ft("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),E.current=_;const D=e=>{const{beforeOpen:t}=R,l=(null!=t?t:Pe)({[i]:A},p,f);(null==l?void 0:l.then)?l.then((()=>{s(!0),null==e||e()})).catch((()=>{})):!1!==l&&(s(!0),null==e||e())},M=()=>{s(!1)},H=e=>{Aa(p,S,e),r(O,e,m,h,ja(f.title)),u(p,m,h),null==L||L({[i]:e},p,C.current),c()},$={visible:o,title:y("qm.searchHelper.text"),width:null!==(t=R.width)&&void 0!==t?t:"40%",loading:!1,wrapClassName:bi.popupClassName,bodyStyle:{paddingBottom:`${Jr[a]+20}px`},onClose:()=>{M()}},j=Object.assign(Object.assign({},R),{size:a,multiple:!0,initialValue:l.merge({},R.initialValue),defaultSelectedKeys:A,onClose:e=>{e?(e=>{const{textKey:t,valueKey:l}=_;w(e);const n=C.current.map((e=>({text:e[t],value:e[l]})));x(n),H(n.map((e=>e.value)));const{closed:a}=R;s(!1),null==a||a(C.current)})(e):M()}});return q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},q.default.createElement("span",{className:"ant-input-wrapper ant-input-group"},q.default.createElement(d.Select,{mode:"multiple",open:!1,value:A,placeholder:null!==(n=T.placeholder)&&void 0!==n?n:y("qm.table.editable.selectPlaceholder"),allowClear:T.allowClear,maxTagCount:T.collapseTags?"responsive":void 0,maxTagTextLength:T.maxTagTextLength,disabled:T.disabled,style:{width:"100%"},onKeyDown:e=>{13===e.keyCode&&!o&&D()},onDoubleClick:()=>{T.disabled||D()},onChange:e=>{const{valueKey:t}=_;w(C.current.filter((l=>e.includes(l[t])))),H(e)}},b.map((e=>q.default.createElement(d.Select.Option,{key:e.value,value:e.value},e.text)))),q.default.createElement("span",{className:"ant-input-group-addon"},q.default.createElement(d.Button,{className:"ant-input-search-button",disabled:T.disabled,icon:q.default.createElement(g.SearchOutlined,null),onClick:()=>{D()}})))),q.default.createElement(Qn,$,q.default.createElement(oc,j)))},uc=q.default.forwardRef(((e,t)=>{var n,a,r;const{$size:i,flattenColumns:o,doFieldValidate:s}=q.default.useContext(ei),{dataKey:u,visible:c,setVisible:f,setMatching:p,doFieldUpdate:m,cellValueChange:h}=q.default.useContext(Qu),{column:g,row:v,rowKey:y,columnKey:b,options:x}=e,{t:E}=ot();Uu();const C=!!(null===(n=x.helper)||void 0===n?void 0:n.combinedDataIndex),w=q.default.useRef(!1),S=q.default.useRef({}),[N,T]=q.default.useState(),{dataIndex:I,precision:O}=g,{type:R,extra:k={},rules:L=[],helper:P={},onInput:A,onChange:F,onEnter:_}=x,D=Fa(v,C?P.combinedDataIndex:I),M=P.fieldAliasMap;M||ft("Table","helper 需要配置 `fieldAliasMap` 选项");const H="function"==typeof M?M():M||{};Object.keys(H).includes(I)||ft("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),C&&(P.combinedDataIndex.split("|").every((e=>Object.keys(H).includes(e)))||ft("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),H[I].includes("|")&&ft("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const $=e=>{const{filterAliasMap:t}=P,n=""!==e?e:void 0,a=("function"==typeof t?t():t)||[],r={[I]:n};return(Array.isArray(a)?a:[a]).forEach((e=>{if(l.isPlainObject(e))for(const t in e)r[t]="function"==typeof e[t]?e[t](n):n;else r[e]=n})),r},j=e=>{const{autoQueryAssign:t=!0}=P;t&&(S.current=$(e)),f(!0)},K=(e,t)=>{const{beforeOpen:l}=P,n=(null!=l?l:Pe)({[u]:D},v,g);(null==n?void 0:n.then)?n.then((()=>{j(e),null==t||t()})).catch((()=>{})):!1!==n&&(j(e),null==t||t())},V=e=>{const t={};for(const l in H){const n=H[l];l!==I&&(t[l]=Fa(e,n))}const l=H[I]?Fa(e,H[I]):"";W(l,t);const{closed:n}=P;f(!1),null==n||n(e)},z=()=>{const{onlySelect:e=!0}=P;w.current&&W(e?"":D),f(!1)},W=(e="",t)=>{var n;if(l.isPlainObject(t)&&Object.keys(t).length)for(const e in t){const l=t[e],a=o.find((t=>t.dataIndex===e));if(a){Aa(v,e,l,a.precision);const t=null===(n=a.editRender)||void 0===n?void 0:n.call(a,v,a);t&&Array.isArray(t.rules)&&s(t.rules,l,y,e,ja(a.title))}else Aa(v,e,l)}C&&!e&&((e,t,l,n)=>{if(!t.includes("|"))return Aa(e,t,l,n);const a=l.split("|")||[];t.split("|").forEach(((t,l)=>{var n;t&&Aa(e,t,null===(n=a[l])||void 0===n?void 0:n.trim())}))})(v,P.combinedDataIndex,""),Aa(v,I,e,O),s(L,e,y,b,ja(g.title)),m(v,y,b),null==F||F({[u]:e},v),h(),S.current={},w.current=!1,T(void 0)},B={visible:c,title:E("qm.searchHelper.text"),width:null!==(a=P.width)&&void 0!==a?a:"60%",loading:!1,wrapClassName:bi.popupClassName,bodyStyle:{paddingBottom:`${Jr[i]+20}px`},onClose:()=>{z()}},U=Object.assign(Object.assign({},P),{size:i,initialValue:Object.assign({},S.current,P.initialValue),onClose:e=>{e?V(e):z()}});return q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Input.Search,{ref:t,value:null!=N?N:D,placeholder:null!==(r=k.placeholder)&&void 0!==r?r:E("qm.table.editable.selectPlaceholder"),allowClear:k.allowClear,readOnly:k.readOnly,disabled:k.disabled,onBlur:e=>{var t;const{value:n}=e.target,{onlySelect:a=!0,table:r}=P;if(w.current&&!c)return n&&a&&(null===(t=null==r?void 0:r.fetch)||void 0===t?void 0:t.api)?(e=>{const{table:t,initialValue:n={}}=P,{beforeFetch:a=Pe}=t.fetch;return new Promise(((r,i)=>Ie(void 0,void 0,void 0,(function*(){var o;const s=l.merge({},t.fetch.params,Object.assign(Object.assign({},n),$(e)),{currentPage:1,pageSize:500});if(!a(s))return i();p(!0);try{const e=yield t.fetch.api(s);if(200===e.code){const n=Array.isArray(e.data)?e.data:null!==(o=l.get(e.data,t.fetch.dataKey))&&void 0!==o?o:[];r(n)}else i()}catch(e){i(e)}finally{Fe((()=>p(!1)))}}))))})(n).then((e=>((e=[],t)=>{const l=e.filter((e=>Fa(e,H[I]).toString().includes(t)));if(1===l.length)return V(l[0]);K(t)})(e,n))).catch((()=>W(""))):void W(n)},onChange:e=>{const{value:t}=e.target;null==A||A({[u]:t}),w.current=!0,T(t)},onKeyDown:e=>{var t;if(13===e.keyCode){const l=null!==(t=e.target.value)&&void 0!==t?t:"";!c&&K(l)}},onDoubleClick:e=>{const{value:t}=e.target;K(t)},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&"INPUT"!==t.target.tagName&&K(e)}}),q.default.createElement(Qn,B,q.default.createElement(Sc,U)))}));uc.displayName="SearchHelperCell";const cc=e=>{var t,n;const{$size:a,doFieldValidate:r}=q.default.useContext(ei),{dataKey:i,visible:o,setVisible:s,doFieldUpdate:u,cellValueChange:c}=q.default.useContext(Qu),{column:f,row:p,rowKey:m,columnKey:h,options:v}=e,{t:y}=ot();Uu();const[b,x]=q.default.useState(v.items||[]),E=q.default.useRef({}),C=q.default.useRef([]),w=e=>C.current=e;q.default.useLayoutEffect((()=>{v.items&&w(v.items.map((e=>({[E.current.valueKey]:e.value,[E.current.textKey]:e.text}))))}),[]);const{dataIndex:S}=f,{type:N,items:T=[],extra:I={},rules:O=[],helper:R={},onInput:k,onChange:L,onEnter:P}=v,A=Pa(p,S),F=R.fieldAliasMap;F||ft("Table","helper 需要配置 `fieldAliasMap` 选项");const _="function"==typeof F?F():F||{};Object.keys(_).includes("valueKey")&&Object.keys(_).includes("textKey")||ft("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),E.current=_;const D=e=>{const{beforeOpen:t}=R,l=(null!=t?t:Pe)({[i]:A},p,f);(null==l?void 0:l.then)?l.then((()=>{s(!0),null==e||e()})).catch((()=>{})):!1!==l&&(s(!0),null==e||e())},M=()=>{s(!1)},H=e=>{Aa(p,S,e),r(O,e,m,h,ja(f.title)),u(p,m,h),null==L||L({[i]:e},p,C.current),c()},$={visible:o,title:y("qm.searchHelper.text"),width:null!==(t=R.width)&&void 0!==t?t:"60%",loading:!1,wrapClassName:bi.popupClassName,bodyStyle:{paddingBottom:`${Jr[a]+20}px`},onClose:()=>{M()}},j=Object.assign(Object.assign({},R),{size:a,multiple:!0,initialValue:l.merge({},R.initialValue),defaultSelectedKeys:A,onClose:(e,t)=>{e?((e,t)=>{const{textKey:n,valueKey:a}=_;w(l.uniqBy([...C.current.filter((e=>t.includes(e[a]))),...e],a));const r=C.current.map((e=>({text:e[n],value:e[a]}))),i=l.uniqBy([...r,...T],"value").filter((e=>t.includes(e.value)));x(i),H(i.map((e=>e.value)));const{closed:o}=R;s(!1),null==o||o(C.current)})(e,t):M()}});return q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},q.default.createElement("span",{className:"ant-input-wrapper ant-input-group"},q.default.createElement(d.Select,{mode:"multiple",open:!1,value:A,placeholder:null!==(n=I.placeholder)&&void 0!==n?n:y("qm.table.editable.selectPlaceholder"),allowClear:I.allowClear,maxTagCount:I.collapseTags?"responsive":void 0,maxTagTextLength:I.maxTagTextLength,disabled:I.disabled,style:{width:"100%"},onKeyDown:e=>{13===e.keyCode&&!o&&D()},onDoubleClick:()=>{I.disabled||D()},onChange:e=>{const{valueKey:t}=_;w(C.current.filter((l=>e.includes(l[t])))),H(e)}},b.map((e=>q.default.createElement(d.Select.Option,{key:e.value,value:e.value},e.text)))),q.default.createElement("span",{className:"ant-input-group-addon"},q.default.createElement(d.Button,{className:"ant-input-search-button",disabled:I.disabled,icon:q.default.createElement(g.SearchOutlined,null),onClick:()=>{D()}})))),q.default.createElement(Qn,$,q.default.createElement(Sc,j)))},fc=q.default.forwardRef(((e,t)=>{var n,a,r,i;const{column:o,record:s,rowKey:d,columnKey:u}=e,{tableRef:c,getRowKey:f,isFetch:p,updateTableFlatData:m,dataChange:h}=q.default.useContext(ei),g=q.default.useContext($u),{store:v,fieldAuth:y}=c.current,b=(null===(n=o.editRender)||void 0===n?void 0:n.call(o,s,o))||{},x=q.default.useRef(null),E=q.default.useRef(null),C=q.default.useRef(null),w=q.default.useRef(null),[S,N]=q.default.useState(!1),[T,I]=q.default.useState(!1),O=`${d}|${u}`,R=2===g.length?`${g[0]}|${g[1]}`:"",k=(b.editable||Xa(g,[d,u],!0))&&!b.disabled&&!(null===(a=y[u])||void 0===a?void 0:a.disabled),L=![...v.state.required,...v.state.validate].some((({x:e,y:t})=>e===d&&t===u)),P=(null===(r=v.state.required.find((({x:e,y:t})=>e===d&&t===u)))||void 0===r?void 0:r.text)||"",A=(null===(i=v.state.validate.find((({x:e,y:t})=>e===d&&t===u)))||void 0===i?void 0:i.text)||"",F=v.state.edited.some((({x:e,y:t})=>e===d&&t===u)),_=k||!L||S||T;q.default.useEffect((()=>{_&&R===O&&D()}),[g]);const D=()=>{var e,t,l,n;const{type:a}=b;switch(a){case"text":null===(e=x.current)||void 0===e||e.focus();break;case"number":null===(t=E.current)||void 0===t||t.select();break;case"search-helper":null===(l=C.current)||void 0===l||l.focus();break;case"tree-helper":null===(n=w.current)||void 0===n||n.focus()}},M=()=>{var e,t,l,n;const{type:a}=b;switch(a){case"text":null===(e=x.current)||void 0===e||e.blur();break;case"number":null===(t=E.current)||void 0===t||t.blur();break;case"search-helper":null===(l=C.current)||void 0===l||l.blur();break;case"tree-helper":null===(n=w.current)||void 0===n||n.blur()}},H=st((()=>{m(),h(),Fe((()=>j()))})),$=(e,t,l)=>{v.addToUpdated(e),v.addToEdited({x:t,y:l})},j=()=>{const{updated:e,edited:t}=v.state,{recordsMap:n,tableOriginData:a,isOriginTree:r}=c.current;r&&!p&&e.length&&function a(r){r.forEach((r=>{r.children&&a(r.children);const i=f(r,r.index),o=e.find((e=>e._rowKey===i)),s=t.filter((e=>e.x===i)).map((e=>e.y));o&&s.length&&r!==n.get(i)&&l.merge(r,l.pick(o,s))}))}(a)};q.default.useImperativeHandle(t,(()=>({focus:D,blur:M,isEditable:()=>!b.disabled,isOpening:()=>S})));const K=q.default.useMemo((()=>({dataKey:O,visible:S,matching:T,setVisible:N,setMatching:I,doFieldUpdate:$,cellValueChange:H})),[S,T]),V={text:()=>q.default.createElement(Zu,{ref:x,column:o,row:s,rowKey:d,columnKey:u,options:b}),textarea:()=>q.default.createElement(Zu,{ref:x,column:o,row:s,rowKey:d,columnKey:u,options:b,isTextArea:!0}),number:()=>q.default.createElement(ec,{ref:E,column:o,row:s,rowKey:d,columnKey:u,options:b}),select:()=>q.default.createElement(tc,{column:o,row:s,rowKey:d,columnKey:u,options:b}),"select-multiple":()=>q.default.createElement(tc,{column:o,row:s,rowKey:d,columnKey:u,options:b,isMultiple:!0}),date:()=>q.default.createElement(lc,{column:o,row:s,rowKey:d,columnKey:u,options:b,dateType:"exactdate"}),datetime:()=>q.default.createElement(lc,{column:o,row:s,rowKey:d,columnKey:u,options:b,dateType:"datetime"}),month:()=>q.default.createElement(lc,{column:o,row:s,rowKey:d,columnKey:u,options:b,dateType:"month"}),year:()=>q.default.createElement(lc,{column:o,row:s,rowKey:d,columnKey:u,options:b,dateType:"year"}),time:()=>q.default.createElement(nc,{column:o,row:s,rowKey:d,columnKey:u,options:b}),checkbox:()=>q.default.createElement(ac,{column:o,row:s,rowKey:d,columnKey:u,options:b}),switch:()=>q.default.createElement(rc,{column:o,row:s,rowKey:d,columnKey:u,options:b}),"search-helper":()=>q.default.createElement(uc,{ref:C,column:o,row:s,rowKey:d,columnKey:u,options:b}),"search-helper-multiple":()=>q.default.createElement(cc,{column:o,row:s,rowKey:d,columnKey:u,options:b}),"tree-helper":()=>q.default.createElement(sc,{ref:w,column:o,row:s,rowKey:d,columnKey:u,options:b}),"tree-helper-multiple":()=>q.default.createElement(dc,{column:o,row:s,rowKey:d,columnKey:u,options:b}),custom:()=>q.default.createElement(ic,{column:o,row:s,rowKey:d,columnKey:u,options:b})};return q.default.createElement(q.default.Fragment,null,_?(()=>{const{type:e}=b,t=V[e];if(!t)return ft("Table","单元格编辑的类型 `type` 配置不正确"),null;const l=["cell--edit",{"is-error":!L}];return q.default.createElement("div",{className:J.default(l)},q.default.createElement(Qu.Provider,{value:K},t()),!L&&q.default.createElement("div",{className:"cell-error"},P||A))})():(()=>{const{disabled:t}=b,{disabledColor:l,disabledBgColor:n}=b.extra||{},a=["cell--show",{"is-cell-bg":t&&n}];return q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{className:J.default(a),style:{color:t?l:""}},e.children),t&&n&&q.default.createElement("i",{className:"cell--bg",style:{background:n}}))})(),F&&(()=>{const{cornerSign:e=!0}=b.extra||{};return e&&q.default.createElement("i",{className:"cell--sign"})})())}));fc.displayName="CellEdit";const pc=e=>{const{text:t,options:l,showMessage:n=!0,onCopy:a}=e,{t:r}=ot();return Sn(e.children,{onClick:i=>{const o=q.default.Children.only(e.children),s=ge.default(t,l);null==a||a(t,s),s&&n&&d.message.success(r("qm.clipboard.success")),o&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(i)}})};pc.displayName="QmCopyToClipboard";const mc=q.default.forwardRef(((e,t)=>{const{column:l,row:n,rowIndex:a,columnIndex:r,rowKey:i,showTitle:o,onUnmount:s}=e,{tableRef:d,selectionKeys:u,treeExpandIndex:c,updateMark:f}=q.default.useContext(ei),{dataIndex:p,translate:m,canCopy:h,render:v,editRender:y,shouldCellUpdate:b}=l,{t:x}=ot(),{renderText:E,getTitleFromCellNode:C}=Oi(),w=q.default.useRef(null),S=Pa(n,p),[N,T]=function(e,t,l){const n=$.useRef({});return"value"in n.current&&!l(n.current.condition,t)||(n.current.value=e(),n.current.condition=t),n.current.value}((()=>{const e=v?v(S,n,l,a,r):E(S,l,n);return[e,y?q.default.createElement(fc,{ref:t,column:l,record:n,rowKey:i,columnKey:p},e):null]}),[f,n,S,v,y],((e,t)=>{if(b){const[,l]=e,[,a]=t;return b(a,l,n)}return!Xa(e,t,!0)})),I=q.default.useMemo((()=>[bi.expandableColumn,bi.selectionColumn,bi.operationColumn].includes(p)?"":C(N)),[N]);q.default.useEffect((()=>()=>null==s?void 0:s()),[]),q.default.useEffect((()=>{o&&(w.current.parentNode.title=I)}),[o,N]);const O=e=>Array.isArray(e.children),R=()=>{return p===bi.expandableColumn?q.default.createElement(Xu,{record:n,rowKey:i}):p===bi.selectionColumn?q.default.createElement(Yu,{selectionKeys:u,column:l,record:n,rowKey:i}):T||(d.current.isTreeTable&&p===c?q.default.createElement(q.default.Fragment,null,(e=n._level)?q.default.createElement("span",{key:e,className:`cell--indent indent-level-${e}`,style:{paddingLeft:e*bi.treeTable.textIndent+"px"}}):null,q.default.createElement(Xu,{key:"expand",record:n,rowKey:i,style:O(n)?{}:{visibility:"hidden"}}),N):h?q.default.createElement("div",{className:"cell--copy"},q.default.createElement("span",{className:"text"},N),I&&q.default.createElement(pc,{text:I},q.default.createElement(g.CopyOutlined,{className:"icon",title:x("qm.table.config.copyText"),onClick:e=>e.stopPropagation()}))):N);var e};return m?q.default.createElement(Hr,{ref:w,text:I,className:"cell"},R()):q.default.createElement("div",{ref:w,className:"cell"},R())}));mc.displayName="Cell";const hc={open:!1,offsetX:0,offsetY:0},gc=q.default.forwardRef(((e,t)=>{const{rowVirtualize:l}=e,{tableRef:n,getRowKey:a,prefixCls:r,tableFlatData:i,flattenColumns:o,tableRowHeight:s,mergedTdCells:d,setMergedCells:u}=q.default.useContext(ei),{areaSelection:c={}}=n.current.props,{elementStore:f,scrollYLoad:p}=n.current,{t:m}=ot(),h=q.default.useRef(document.onselectstart),g=q.default.useRef(null),v=q.default.useRef(null),y=q.default.useRef(null),b=e=>{y.current=e},[x,E]=q.default.useState(null),[C,w]=q.default.useState(null),[S,N]=q.default.useState(null),T=e=>{if(!e)return N(null);let t=!1;for(const l in e)if((null==S?void 0:S[l])!==e[l]){t=!0;break}t&&N(Object.assign({},S,e))};Hd({ref:g,handler:()=>V()}),q.default.useEffect((()=>{const e=ae.default(f.$tableBody,"mousedown",D),t=ae.default(f.$tableBody,"contextmenu",F),l=ae.default(document,"keydown",_);return()=>{e.remove(),t.remove(),l.remove()}}),[]);const I=()=>{E(null),T(null),b(null),w(null)};q.default.useImperativeHandle(t,(()=>({blur:I})));const O=e=>{let t=e;for(;t;){if(!f.$tableBody.contains(t))return null;if("TD"===t.tagName.toUpperCase())return t;t=t.parentNode}return null},R=e=>({rowIndex:parseInt(e.parentNode.getAttribute("data-row-index"),10),colIndex:parseInt(e.getAttribute("data-col-index"),10),rowspan:Number(e.getAttribute("rowspan")||1),colspan:Number(e.getAttribute("colspan")||1),l:e.offsetLeft,t:e.offsetTop,w:e.offsetWidth,h:e.offsetHeight}),k=e=>({colStart:e.colIndex,colEnd:e.colIndex+e.colspan,rowStart:e.rowIndex,rowEnd:e.rowIndex+e.rowspan}),L=e=>{let[t,l,n,a]=[1/0,-1/0,1/0,-1/0];for(const r of e)t=Math.min(t,r.rowStart),l=Math.max(l,r.rowEnd),n=Math.min(n,r.colStart),a=Math.max(a,r.colEnd);return{rowStart:t,rowEnd:l,colStart:n,colEnd:a}},P=wn((e=>{let t=L([k(e),y.current]);d.forEach((e=>{const l=i.findIndex((t=>a(t,t.index)===e.rowKey)),n=o.findIndex((t=>t.dataIndex===e.dataIndex)),r={rowStart:l,rowEnd:l+e.rowSpan,colStart:n,colEnd:n+e.colSpan};var s,d;d=r,(s=t).rowEnd<=d.rowStart||s.rowStart>=d.rowEnd||s.colEnd<=d.colStart||s.colStart>=d.colEnd||(t=L([t,r]))})),T(t)}),5),A=e=>{var t;u(e),null===(t=c.onCellMerge)||void 0===t||t.call(c,e),Fe((()=>I()))},F=st((e=>{c.cellMerge&&x&&j(e.clientX,e.clientY)?(e.preventDefault(),K(e)):(null==C?void 0:C.open)&&V()})),_=st((e=>{27===e.keyCode&&I()})),D=st((e=>{e.stopPropagation();const t=O(e.target);if(1!==e.buttons||!t)return;V();const l=R(t);E(l);const n=k(l);b(n),T(n),document.addEventListener("mousemove",M),document.addEventListener("mouseup",H),h.current=document.onselectstart,document.onselectstart=()=>!1})),M=st((e=>{const t=O(e.target);t&&P(R(t))})),H=st((()=>{var e;null===(e=c.onSelectChange)||void 0===e||e.call(c,(()=>{const e=[];if(!x||!S)return e;for(let t=S.rowStart;t<S.rowEnd;t++)for(let l=S.colStart;l<S.colEnd;l++)e.push({rowKey:a(i[t],i[t].index),dataIndex:o[l].dataIndex,cellValue:Pa(i[t],o[l].dataIndex)});return e})()),document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",H),$()})),$=()=>{document.onselectstart!==h.current&&(document.onselectstart=h.current)},j=(e,t)=>{const{top:l,left:n}=f.$tableBody.parentNode.getBoundingClientRect(),[a,r]=[e-n,t-l],{el:i,et:o,ew:s,eh:d}=G();return!(a<i||a>i+s||r<o||r>o+d)},K=e=>{const{top:t,left:l,height:n}=v.current.getBoundingClientRect();w({open:!0,offsetX:e.clientX-l,offsetY:-1*(n-(e.clientY-t))})},V=()=>{w((e=>Object.assign(Object.assign({},e),{open:!1})))},z=e=>({rowIndex:i.findIndex((t=>a(t,t.index)===e.rowKey)),colIndex:o.findIndex((t=>t.dataIndex===e.dataIndex)),rowSpan:e.rowSpan,colSpan:e.colSpan}),W=()=>{if(!x||!S||(t=S,(e=x).rowIndex===t.rowStart&&e.colIndex===t.colStart&&e.rowspan===t.rowEnd-t.rowStart&&e.colspan===t.colEnd-t.colStart))return I();var e,t;const l={rowKey:a(i[S.rowStart],i[S.rowStart].index),dataIndex:o[S.colStart].dataIndex,rowSpan:S.rowEnd-S.rowStart,colSpan:S.colEnd-S.colStart};A([...d.filter((e=>!((e,t)=>{const l=z(e),n=z(t),[a,r,i,o]=[l.rowIndex,l.colIndex,l.rowIndex+l.rowSpan-1,l.colIndex+l.colSpan-1],[s,d,u,c]=[n.rowIndex,n.colIndex,n.rowIndex+n.rowSpan-1,n.colIndex+n.colSpan-1];return a<=s&&r<=d&&i>=u&&o>=c||s<=a&&d<=r&&u>=i&&c>=o})(e,l))),l])},B=()=>{const e=a(i[S.rowStart],i[S.rowStart].index),t=o[S.colStart].dataIndex;A(d.filter((l=>!(l.rowKey===e&&l.dataIndex===t))))},U=e=>{if(p){return l.measurementsCache.slice(0,e).map((e=>e.size)).reduce(((e,t)=>e+t),0)}if(e>=i.length)return f.$tableBody.parentNode.offsetHeight;const t=a(i[e],i[e].index),n=f.$tableBody.querySelector(`tbody > tr[data-row-key="${t}"]`);return n?n.offsetTop:s*e},G=()=>{const{w:e,h:t,l:l,t:n}=x,a=o.slice(0,S.colStart).reduce(((e,t)=>e+(t.width||t.renderWidth)),0),r=U(S.rowStart);return{sl:l,st:n,sw:e,sh:t,el:a,et:r,ew:o.slice(0,S.colEnd).reduce(((e,t)=>e+(t.width||t.renderWidth)),0)-a,eh:U(S.rowEnd)-r}};return q.default.createElement("div",{className:`${r}--area-select`},(()=>{if(!x||!S)return null;const{sl:e,st:t,sw:l,sh:n,el:a,et:r,ew:i,eh:o}=G(),{open:s,offsetX:d,offsetY:u}=C||hc,c=q.default.createElement("ul",{ref:g,className:"ant-dropdown-menu"},q.default.createElement("li",{className:"ant-dropdown-menu-item",onClick:W},m("qm.table.areaSelect.mergeCell")),q.default.createElement("li",{className:"ant-dropdown-menu-item",onClick:B},m("qm.table.areaSelect.cancelMerge")));return q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:"active-area",style:{left:e,top:t,width:l,height:n}}),q.default.createElement(xs,{popupVisible:s,popup:c,action:[],popupPlacement:"bottomLeft",prefixCls:"ant-dropdown",popupClassName:bi.popupClassName,builtinPlacements:{bottomLeft:{points:["tl","bl"],offset:[d+4,u+4],overflow:{adjustX:1,adjustY:1}}}},q.default.createElement("div",{ref:v,className:"checked-area",style:{left:a,top:r,width:i,height:o}})))})())}));gc.displayName="AreaSelect";const vc=q.default.forwardRef(((e,t)=>{const{tableRef:n,getRowKey:a,prefixCls:r,tableFlatData:i,flattenColumns:o,editableColumns:s,leftFixedColumns:d,rightFixedColumns:u,derivedMergeCells:c,tableRowHeight:f,sorter:p,layout:m,showFooter:h,selectionKeys:g,rowExpandedKeys:v,highlightKey:y,activedCell:b,isPingLeft:x,isPingRight:E,isTableEmpty:C,isGroupSubtotal:w,setElementStore:S,setSelectionKeysEffect:N,setHighlightKey:T,setActivedCell:I,getStickyLeft:O,getStickyRight:R,setPingLeft:k,setPingRight:L,setFullScreen:P,scrollBottomDebouncer:A}=q.default.useContext(ei),{height:F,minHeight:_,maxHeight:D,rowSelection:M,rowHighlight:H,expandable:$,stripe:j,summation:K,rowHeight:V,rowStyle:z,cellStyle:W,spanMethod:B,tableConfig:U,areaSelection:G,ellipsis:Y,showHeader:X,rowDraggable:Q,onRowClick:Z,onRowDblclick:ee,onRowContextmenu:te,onRowEnter:le}=n.current.props,ne=q.default.useRef(null),re=q.default.useRef(new Map),ie=q.default.useRef(null),oe=q.default.useRef({prevST:0,prevSL:0}),{onNodeDragStart:se,onNodeDragEnter:de,onNodeDragOver:ue,onNodeDragLeave:ce,onNodeDragEnd:fe,onNodeDrop:pe,indent:me,dropOptions:he}=Bu({openDragSort:Q}),{rowVirtualizer:ge,columnVirtualizer:ve,virtualRows:ye,virtualColumns:be,resetItemXSize:xe,getYIndexes:Ee,virtualTranslateY:Ce,virtualTranslateX:we,calcVirtualYSize:Se,calcVirtualXSize:Ne,scrollToYIndex:Te}=((e,t)=>{var l;const{tableRef:n,tableRowHeight:a}=q.default.useContext(ei),{props:r,scrollBarRef:i}=n.current,o=(null===(l=r.tableConfig)||void 0===l?void 0:l.overscan)||1,s=q.default.useMemo((()=>{var e;return(null===(e=i.current)||void 0===e?void 0:e.scrollElement)||null}),[i.current]),d=q.default.useMemo((()=>{const e=[],l=[];return t.forEach(((t,n)=>{"left"===t.fixed&&e.push(n),"right"===t.fixed&&l.push(n)})),[e,l]}),[t]),u=Fd({count:e.length,getScrollElement:()=>s,estimateSize:()=>a,indexAttribute:"data-row-index",overscan:o,enabled:n.current.scrollYLoad}),c=u.getVirtualItems(),f=Fd({horizontal:!0,count:t.length,getScrollElement:()=>s,estimateSize:e=>t[e].width||t[e].renderWidth||0,indexAttribute:"data-col-index",overscan:o,enabled:n.current.scrollXLoad,rangeExtractor:e=>[...new Set([...d[0],...Sd(e),...d[1]])]}),p=f.getVirtualItems();return{rowVirtualizer:u,columnVirtualizer:f,virtualRows:c,virtualColumns:p,resetItemXSize:e=>{e.forEach(((e,t)=>{f.resizeItem(t,e.width||e.renderWidth||bi.defaultColumnWidth)}))},getYIndexes:()=>u.getVirtualIndexes()||[],getXIndexes:()=>f.getVirtualIndexes()||[],virtualTranslateY:()=>{var e;return(null===(e=c[0])||void 0===e?void 0:e.start)||0},virtualTranslateX:()=>{var e,t,l,n;const a=d[0].length;return a?(null===(t=p[a])||void 0===t?void 0:t.index)===a?(null===(l=p[0])||void 0===l?void 0:l.start)||0:((null===(n=p[a])||void 0===n?void 0:n.start)||0)-p.slice(0,a).reduce(((e,t)=>e+t.size),0):(null===(e=p[0])||void 0===e?void 0:e.start)||0},calcVirtualYSize:()=>u.getTotalSize()||"",calcVirtualXSize:()=>f.getTotalSize()||"",scrollToYIndex:e=>{u.scrollToIndex(e)},scrollToXIndex:e=>{f.scrollToIndex(e)}}})(i,o),Ie=Ee(),Oe=e=>{if(e&&!Y)return ge.measureElement(e)},Re=q.default.useMemo((()=>c.length&&n.current.scrollYLoad?((e,t)=>{const l=[],n=new Set(t);return e.forEach((({row:e,col:t,rowSpan:a,colSpan:r})=>{const i=e+a-1,o=[];for(let t=e;t<=i;t++)n.has(t)&&o.push(t);if(0===o.length)return;const s=o.length;o.forEach(((e,n)=>{0===n&&l.push({row:e,col:t,rowSpan:s,colSpan:r});for(let a=t;a<t+r;a++)0===n&&a===t||l.push({row:e,col:a,rowSpan:0,colSpan:0})}))})),l})(c,Ie):c),[c,Ie.join(",")]),[ke,Ae]=q.default.useState([]),Fe=Uu();Hd({ref:ne,omitClassNames:[`.${bi.popupClassName}`],handler:()=>{var e;Ye([]),null===(e=ie.current)||void 0===e||e.blur()}}),q.default.useImperativeHandle(t,(()=>({setClickedValues:Ye,createFocus:Ve,forceUpdate:Fe,resetItemXSize:xe,scrollToYIndex:Te}))),Yl((()=>{ke.length&&n.current.tableManager.focus(n.current.uid)}),[ke]),q.default.useLayoutEffect((()=>{Ke();const e=ae.default(document,"keydown",Me);return()=>e.remove()}),[]);const _e=q.default.useMemo((()=>{const{headerHeight:e,viewportHeight:t,footerHeight:l,tableFullHeight:n,tableAutoHeight:a}=m,r={};return C&&Object.assign(r,{minHeight:"100px"}),_&&Object.assign(r,{minHeight:ka(_)-e-l+"px"}),D&&Object.assign(r,{maxHeight:ka(D)-e-l+"px"}),F||n||a?Object.assign(Object.assign({},r),{maxHeight:"",minHeight:"",height:`${t}px`}):r}),[F,D,_,C,m]),De=st((e=>{const{elementStore:t}=n.current,{prevST:l,prevSL:a}=oe.current,{scrollTop:r,scrollLeft:i}=e;if(i!==a){X&&(t.$header.scrollLeft=i),h&&(t.$footer.scrollLeft=i);const e=i>0,l=Math.ceil(i+m.tableWidth)<m.tableBodyWidth;x!==e&&k(e),E!==l&&L(l)}oe.current={prevST:r,prevSL:i}})),Me=st((e=>{var t,l,r,o,s;if(n.current.uid!==(null===(t=n.current.tableManager.getFocusInstance())||void 0===t?void 0:t.id))return;const{keyCode:d}=e;if(27===d&&(Ye([]),T(""),I({}),P(!1)),ke.length&&(rn(document.activeElement,ne.current)||"INPUT"!==(null===(l=document.activeElement)||void 0===l?void 0:l.tagName))){if(13===d&&("radio"===(null==M?void 0:M.type)||H)){const t=null!==(o=null!==(r=g[0])&&void 0!==r?r:y)&&void 0!==o?o:null,l=null!==(s=i.find((e=>a(e,e.index)===t)))&&void 0!==s?s:null;l&&(null==le||le(l,e))}Be(ke[0],ke[1])||(38!==d&&40!==d||(Zl(e),He(e)),(9===d||e.shiftKey&&9===d)&&(Zl(e),qe(e)))}})),He=Kn((e=>{var t,l;if(!ke.length)return;const n=i.length;let r=i.findIndex((e=>a(e,e.index)===ke[0]));const o=38===e.keyCode?(--r+n)%n:++r%n,s=i[o],d=a(s,s.index),u=We(d,ke[1]);"radio"!==(null==M?void 0:M.type)||(null===(t=M.disabled)||void 0===t?void 0:t.call(M,s))||u||N([d]),!H||(null===(l=H.disabled)||void 0===l?void 0:l.call(H,s))||u||T(d),$e(38===e.keyCode?"top":"bottom",o),ze(...ke),Ye([d,ke[1]])}),100),qe=Kn((e=>{if(!ke.length)return;if(!s.length)return Ye([]);const t=s.length;let l=s.findIndex((e=>e.dataIndex===ke[1]));const n=e.shiftKey&&9===e.keyCode?(--l+t)%t:++l%t;ze(...ke),je(e.shiftKey&&9===e.keyCode?"left":"right",n),Ye([ke[0],s[n].dataIndex])}),100),$e=(e,t)=>{const{scrollBarRef:l,scrollYLoad:a}=n.current;if(a)return ge.scrollToIndex(t);const r=i.length,o=t,s=ne.current.querySelectorAll("tbody > tr"),d=i.map(((e,t)=>t)).slice(0,o).reduce(((e,t)=>e+s[t].offsetHeight),0),u=s[o].offsetHeight;"top"===e?d<l.current.scrollTop?l.current.SET_SCROLL_TOP(d):t===r-1&&l.current.SET_SCROLL_TOP(d-(m.viewportHeight-u)):d+u>l.current.scrollTop+m.viewportHeight?l.current.SET_SCROLL_TOP(d-(m.viewportHeight-u)):0===t&&l.current.SET_SCROLL_TOP(d)},je=(e,t)=>{const{scrollBarRef:l}=n.current,a=s.length,r=o.findIndex((e=>e.dataIndex===s[t].dataIndex)),i=o.slice(0,r).reduce(((e,t)=>e+(t.width||t.renderWidth)),0),c=o[r].width||o[r].renderWidth,f=d.reduce(((e,t)=>e+(t.width||t.renderWidth)),0),p=u.reduce(((e,t)=>e+(t.width||t.renderWidth)),0);"left"===e?i<l.current.scrollLeft+f?l.current.SET_SCROLL_LEFT(i-f):t===a-1&&l.current.SET_SCROLL_LEFT(i-(m.tableWidth-c)+p):i+c>l.current.scrollLeft+(m.tableWidth-p)?l.current.SET_SCROLL_LEFT(i-(m.tableWidth-c)+p):0===t&&l.current.SET_SCROLL_LEFT(i-f)},Ke=()=>{S("$tableBody",ne.current)},Ve=(e,t)=>{var l;null===(l=re.current.get(`${e}-${t}`))||void 0===l||l.focus()},ze=(e,t)=>{var l;null===(l=re.current.get(`${e}-${t}`))||void 0===l||l.blur()},We=(e,t)=>{var l,n;return null!==(n=null===(l=re.current.get(`${e}-${t}`))||void 0===l?void 0:l.isEditable())&&void 0!==n&&n},Be=(e,t)=>{var l,n;return null!==(n=null===(l=re.current.get(`${e}-${t}`))||void 0===l?void 0:l.isOpening())&&void 0!==n&&n},Ue=e=>{const t=K.groupItems.findIndex((t=>t.dataIndex===e));return{[`body--row-group_${t+1}`]:t>=0}},Ge=(e,t,l)=>{var r;const{dataIndex:i}=l;if([bi.expandableColumn,bi.operationColumn].includes(i))return;const o=a(t,t.index);Ye([o,i]);const s=We(o,i),{type:d,selectByClickRow:u=!0,disabled:c=Le}=M||{};!d||c(t)||s||(u||i===bi.selectionColumn)&&((e,t)=>{const{type:l,checkStrictly:a=!0,onSelect:r}=M||{};if("radio"===l&&N([e]),"checkbox"===l){const l=!g.includes(e),i=n.current.isTreeTable&&!a?Qe(e,g,l):Xe(e,g,l);N(i),null==r||r(l,t,i)}})(o,t),[bi.selectionColumn].includes(i)||(!H||(null===(r=H.disabled)||void 0===r?void 0:r.call(H,t))||s||T(o),null==Z||Z(t,l,e))},Ye=e=>{l.isEqual(e,ke)||Ae(e)},Xe=(e,t,l)=>l?[...t,e]:t.filter((t=>t!==e)),Qe=(e,t,l)=>{var a;const{disabled:r}=M||{},{tableFullData:i,recordsMap:o}=n.current,s=Ba(i,(t=>t._rowKey===e));let d=[],u=Sa((null==s?void 0:s.children)||[],(e=>e._rowKey));r&&(u=u.filter((e=>!o.has(e)||!r(o.get(e))))),d=l?[...new Set([...t,e,...u])]:t.filter((t=>![e,...u].includes(t)));return((null===(a=Ua(i,e))||void 0===a?void 0:a.slice(0,-1).reverse())||[]).forEach((e=>{var t;const l=Ba(i,(t=>t._rowKey===e)),n=null===(t=null==l?void 0:l.children)||void 0===t?void 0:t.every((e=>d.includes(e._rowKey)));d=n?[...d,e]:d.filter((t=>t!==e))})),d},Ze=(e,t,l)=>{const{scrollXLoad:a}=n.current,{disabled:r}=M||{},i=["body--row",Object.assign({"body--row-striped":j&&t%2!=0,"body--row-selected":g.includes(l)&&!(null==r?void 0:r(e)),"body--row-current":y===l},w?Ue(e._group):null)],s=(a?be:o).map(((n,r)=>Je(a?o[n.index]:n,a?n.index:r,e,t,l)));return Q?q.default.createElement(Gu,{key:l,ref:Oe,className:J.default(i),rowKey:l,rowIndex:t,row:e,indent:me,filter:".cell--edit input",dropOption:he,onNodeDragStart:se,onNodeDragEnter:de,onNodeDragOver:ue,onNodeDragLeave:ce,onNodeDragEnd:fe,onNodeDrop:pe},s):q.default.createElement("tr",{key:l,ref:Oe,"data-row-key":l,"data-row-index":t,className:J.default(i)},s)},Je=(e,t,l,n,a)=>{var r,i,o;const{dataIndex:s,fixed:c,align:m,className:h=""}=e,{rowSpan:g,colSpan:v}=et(l,e,n,t);if(!g||!v)return null;const y=null!==(r=e.ellipsis)&&void 0!==r?r:Y,x=["body--column",{"col--ellipsis":y,"col--center":"center"===m,"col--right":"right"===m,"col-active":b.rowKey===a&&b.dataIndex===s,"column--sort":!!p[s],"cell-fix-left":"left"===c,"cell-fix-right":"right"===c,"cell-fix-left-last":"left"===c&&(null===(i=d[d.length-v])||void 0===i?void 0:i.dataIndex)===s,"cell-fix-right-first":"right"===c&&(null===(o=u[0])||void 0===o?void 0:o.dataIndex)===s,[h]:!!h}],E={left:"left"===c?`${O(s)}px`:"",right:"right"===c?`${R(s)}px`:""},C=z?"function"==typeof z?z(l,n):z:null,S=W?"function"==typeof W?W(l,e,n,t):W:null,N=w?(e=>{var t;const{backgroundColor:l,color:n}=null!==(t=K.groupItems.find((t=>t.dataIndex===e)))&&void 0!==t?t:{};return{backgroundColor:l,color:n}})(l._group):null,T=Object.assign({},E,{height:V?f:""},N,C,S);return q.default.createElement("td",{key:s,"data-col-index":t,rowSpan:g>1?g:void 0,colSpan:v>1?v:void 0,className:J.default(x),style:T,onClick:t=>Ge(t,l,e),onDoubleClick:t=>((e,t,l)=>{const{dataIndex:n}=l;[bi.expandableColumn,bi.selectionColumn,bi.operationColumn].includes(n)||null==ee||ee(t,l,e)})(t,l,e),onContextMenu:t=>((e,t,l)=>{const{dataIndex:n}=l;[bi.expandableColumn,bi.selectionColumn,bi.operationColumn].includes(n)||null==te||te(t,l,e)})(t,l,e)},q.default.createElement(mc,{ref:e=>{e&&re.current.set(`${a}-${s}`,e)},row:l,column:e,rowIndex:n,columnIndex:t,rowKey:a,showTitle:y,onUnmount:()=>re.current.delete(`${a}-${s}`)}))},et=(e,t,n,a)=>{var r;let o=1,s=1;const d=B;if("function"==typeof d){const u=d({row:e,column:t,rowIndex:n,columnIndex:a,tableData:i});Array.isArray(u)?(o=u[0],s=u[1]):l.isPlainObject(u)&&(o=u.rowSpan,s=u.colSpan);const c=null!==(r=Ie[0])&&void 0!==r?r:0;if(e===i[c]&&0===o)for(let e=c;e<i.length;e++){const l=d({row:i[e],column:t,rowIndex:e,columnIndex:a,tableData:i});if((Array.isArray(l)?l[0]:l.rowSpan)>0)break;o++}}if(Re.length>0){const e=Re.find((e=>e.row===n&&e.col===a));e&&(o=e.rowSpan,s=e.colSpan)}return{rowSpan:o,colSpan:s}};return q.default.createElement(_n,{ref:n.current.scrollBarRef,wrapClassName:`${r}--body-wrapper`,wrapStyle:_e,innerStyle:{height:Se(),width:Ne()},showTopScrollbar:null==U?void 0:U.doubleXScrollbar,onScroll:De,onReachedEnd:(e,t)=>{"bottom"===e&&A({type:"scroll",target:t,preventDefault:Le,stopPropagation:Le})}},q.default.createElement($u.Provider,{value:ke},q.default.createElement("table",{ref:ne,style:{width:0,marginTop:Ce(),marginLeft:we()},className:J.default(`${r}--body`,{"virtual-container":n.current.scrollYLoad||n.current.scrollXLoad}),tabIndex:-1,cellSpacing:"0",cellPadding:"0"},(()=>{const{scrollXLoad:e}=n.current;return q.default.createElement("colgroup",null,(e?be:o).map((t=>{const{dataIndex:l,width:n,renderWidth:a}=e?o[t.index]:t;return q.default.createElement("col",{key:l,style:{width:`${n||a}px`,minWidth:`${n||a}px`}})})))})(),q.default.createElement("tbody",null,(e=>{const{scrollYLoad:t,scrollXLoad:l}=n.current,r=[];return(t?e:i).forEach(((e,n)=>{const s=t?i[e.index]:e,d=t?e.index:n,u=a(s,s.index);if(r.push(Ze(s,d,u)),null==$?void 0:$.expandedRowRender){const{expandedRowClassName:e,rowExpandable:t=Pe}=$;v.includes(u)&&t(s)&&r.push(q.default.createElement("tr",{key:`expand_${u}`,className:"body--row-expanded"},q.default.createElement("td",{colSpan:(l?be:o).length,className:"body--column",style:{paddingLeft:M?2*bi.selectionColumnWidth:bi.selectionColumnWidth}},q.default.createElement("div",{className:J.default("cell",e)},$.expandedRowRender(s,d)))))}})),r})(ye)))),!!G&&q.default.createElement(gc,{ref:ie,rowVirtualize:ge}))}));vc.displayName="TableBody";const yc=()=>{const{tableRef:e,prefixCls:t,sorter:l,layout:n,flattenColumns:a,leftFixedColumns:r,rightFixedColumns:i,summationRows:o,setElementStore:s,getStickyLeft:d,getStickyRight:u}=q.default.useContext(ei),{footRender:c}=e.current.props,{t:f}=ot(),p=q.default.useRef(null);q.default.useLayoutEffect((()=>{m()}),[]);const m=()=>{s("$footer",p.current)},h=(t,n,a)=>{var o,s;const{dataIndex:c,fixed:p,align:m,summation:h}=t,g=["footer--column","col--ellipsis",{"col--center":"center"===m,"col--right":"right"===m,"column--sort":!!l[c],"cell-fix-left":"left"===p,"cell-fix-right":"right"===p,"cell-fix-left-last":"left"===p&&(null===(o=r[r.length-1])||void 0===o?void 0:o.dataIndex)===c,"cell-fix-right-first":"right"===p&&(null===(s=i[0])||void 0===s?void 0:s.dataIndex)===c}],v={left:"left"===p?`${d(c)}px`:"",right:"right"===p?`${u(c)}px`:""},y=(null==h?void 0:h.render)?h.render(e.current.tableFullData):Pa(n,`${c}_text`),b=0===a&&""===y?f("qm.table.config.summaryText"):y;return q.default.createElement("td",{key:c,title:b,className:J.default(g),style:Object.assign({},v)},q.default.createElement("div",{className:"cell"},b))},{tableBodyWidth:g}=n;return q.default.createElement("div",{ref:p,className:`${t}--footer-wrapper`},c?c(a,e.current.tableFullData):q.default.createElement("table",{className:`${t}--footer`,cellSpacing:"0",cellPadding:"0",style:{width:g?`${g}px`:""}},q.default.createElement("colgroup",null,a.map((e=>{const{dataIndex:t,width:l,renderWidth:n}=e;return q.default.createElement("col",{key:t,style:{width:`${l||n}px`,minWidth:`${l||n}px`}})}))),q.default.createElement("tfoot",null,o.map(((e,t)=>q.default.createElement("tr",{key:t,className:"footer--row"},a.map(((t,l)=>h(t,e,l)))))))))};var bc;!function(e){e.small="small",e.middle="default",e.large="default"}(bc||(bc={}));const xc=e=>{var t,l,n,a;const{current:r,pageSize:i,total:o,onChange:s}=e,{global:u}=q.default.useContext(xe),{tableRef:c,prefixCls:f,$size:p,setElementStore:m}=q.default.useContext(ei),{uniqueKey:h,paginationConfig:g,infoBarConfig:v}=c.current.props,y=q.default.useRef(null),b=q.default.useMemo((()=>h?`tablePager_${h}`:""),[h]);q.default.useLayoutEffect((()=>{x(),S()}),[]);const x=()=>{m("$pager",y.current)},E=null!==(t=null==g?void 0:g.showSizeChanger)&&void 0!==t?t:bi.pagination.showSizeChanger,C=null!==(l=null==g?void 0:g.showQuickJumper)&&void 0!==l?l:bi.pagination.showQuickJumper,w=(null==g?void 0:g.pageSizeOptions)||(null===(a=null===(n=null==u?void 0:u.table)||void 0===n?void 0:n.pagination)||void 0===a?void 0:a.pageSizeOptions)||bi.pagination.pageSizeOptions,S=()=>Ie(void 0,void 0,void 0,(function*(){if(!b)return;const e=yield N(b);e&&e!==i&&(s(r,e),localStorage.setItem(b,e.toString()))})),N=e=>Ie(void 0,void 0,void 0,(function*(){const t=null==u?void 0:u.getComponentConfigApi;if(t&&!localStorage.getItem(b))try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),T=(e,t)=>Ie(void 0,void 0,void 0,(function*(){const l=null==u?void 0:u.saveComponentConfigApi;if(l)try{yield l({[e]:t})}catch(e){}})),I={[`${f}-pager`]:!0};return q.default.createElement("div",{ref:y,className:J.default(I)},q.default.createElement("div",{className:"pager-alert"},"bottom"===(null==v?void 0:v.position)&&q.default.createElement(Ni,{total:o})),q.default.createElement(d.Pagination,{size:bc[p],showSizeChanger:E,showQuickJumper:C,pageSizeOptions:w,current:r,pageSize:i,total:o,onChange:(e,t)=>{s(e,t)},onShowSizeChange:(e,t)=>{b&&(T(b,t),localStorage.setItem(b,`${t}`))}}))},Ec=()=>{const{prefixCls:e,layout:t}=q.default.useContext(ei),l=q.default.useMemo((()=>{const{headerHeight:e,viewportHeight:l}=t;return{top:`${e}px`,height:`${l}px`}}),[t]);return q.default.createElement("div",{className:`${e}--empty`,style:l},q.default.createElement(pn,null))},Cc=()=>{const{prefixCls:e,setElementStore:t}=q.default.useContext(ei),l=q.default.useRef(null);q.default.useLayoutEffect((()=>{n()}),[]);const n=()=>{t("$resizableBar",l.current)};return q.default.createElement("div",{ref:l,className:`${e}--resizable-bar`})},wc=q.default.forwardRef(((e,t)=>{const n=je(li,e),{rowKey:a,columns:r,loading:i,resizable:o,customClass:s,areaSelection:d,tablePrint:u,exportExcel:c,infoBarConfig:f,topSpaceAlign:p,showTableInfo:m,showFullScreen:h,showRefresh:g,showToolBox:v,showHeader:y,className:b,style:x}=n,{$size:E}=dt(n),C=q.default.useRef(null),w=q.default.useRef(null),S=q.default.useRef(null),N=q.default.useRef(null),T=q.default.useRef(null),I=gt("table"),O=st(((e,t)=>{const l="function"==typeof a?a(e,t):null==e?void 0:e[a];return void 0===l?(ft("Table","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):l})),{tableRef:R,tableFullData:k,setElementStore:L,setOriginColumns:P,setTableFullData:A,setTableOriginData:F,setTableDataMaps:_,setInvalidRowKeys:D,setFieldAuth:M,setColumnsDefined:H,setScrollXLoad:$,setScrollYLoad:j,setResizeState:K,setHandleState:V,setSummaries:z,setSelectionRows:W,setUnMounted:B,clearElementStore:U}=((e,{getRowKey:t})=>{const l=q.default.useRef({props:e,uid:pi(),tableManager:hi,elementStore:{},originColumns:[],tableFullData:[],tableOriginData:[],invalidRowKeys:[],fieldAuth:{},columnsDefined:!e.dynamicThead,scrollBarRef:q.default.createRef(),store:new gi({getRowKey:t}),resizeState:{width:0,height:0,winHeight:window.innerHeight},handleState:{insert:null,remove:!1},summaries:{},isTreeTable:!1,isOriginTree:!1,scrollXLoad:!1,scrollYLoad:!1,selectionRows:[],recordsMap:new Map,unMounted:!1,isIE:!Oe&&/MSIE|Trident/.test(navigator.userAgent)});var n;n=e,l.current.props=n;const a=(e,l,n="",r=0)=>{e.forEach((e=>{const i=t(e,e.index),o=n?`${n}.${e.index+1}`:`${e.index+1}`;e.indexPath=o,e._level=r,e._rowKey=i,e._parentRowKey=r?l:null,Array.isArray(e.children)&&a(e.children,i,o,r+1),e.children&&e.children.length||(e._isLeaf=1)}))};return Object.assign(Object.assign({tableRef:l},l.current),{setElementStore:(e,t)=>{l.current.elementStore[e]=t},setOriginColumns:e=>{l.current.originColumns=e},setTableFullData:e=>{l.current.tableFullData=e;const t=e.some((e=>Array.isArray(e.children)));l.current.isTreeTable=t,t&&a(e,"")},setTableOriginData:e=>{l.current.tableOriginData=e,l.current.isOriginTree=e.some((e=>Array.isArray(e.children)))},setTableDataMaps:e=>{const n=Ca(e);l.current.recordsMap=new Map(n.map(((e,l)=>[t(e,e.index),n[l]])))},setInvalidRowKeys:e=>{l.current.invalidRowKeys=e},setFieldAuth:(e,t)=>{l.current.fieldAuth[e]=t},setColumnsDefined:e=>{l.current.columnsDefined=e},setResizeState:e=>{l.current.resizeState=e},setHandleState:e=>{l.current.handleState=e},setSummaries:e=>{l.current.summaries=e},setScrollXLoad:e=>{l.current.scrollXLoad=e},setScrollYLoad:e=>{l.current.scrollYLoad=e},setSelectionRows:e=>{l.current.selectionRows=e},setUnMounted:e=>{l.current.unMounted=e},clearElementStore:()=>{for(const e in l.current.elementStore)l.current.elementStore[e]=null}})})(n,{getRowKey:O}),{tableFlatData:G,setTableFlatData:Y,filters:X,setFilters:Q,sorter:Z,setSorter:ee,superFilters:te,setSuperFilters:le,pagerFilter:ne,setPagerFilter:ae,pagination:re,setPagination:ie,selectionKeys:oe,setSelectionKeys:se,rowExpandedKeys:de,setRowExpandedKeys:ue,highlightKey:ce,setHighlightKey:fe,updateMark:pe,forceUpdate:me,activedCell:he,setActivedCell:ge,mergedTdCells:ve,setMergedCells:ye,layout:be,setLayout:Ee,permission:Ce,setPermission:we,spinning:Se,setSpinning:Ne,isPingLeft:Te,setPingLeft:Re,isPingRight:ke,setPingRight:Le,isFullScreen:Pe,setFullScreen:_e,updateTableFlatData:De}=(e=>{var t,n,a,r,i,o,s,d,u,c,f;const{uniqueKey:p,initialSorter:m={},initialFilter:h={},paginationConfig:g,rowSelection:v,expandable:y,rowHighlight:b,mergedCells:x}=e,{global:E}=q.default.useContext(xe),C={current:null!==(t=null==g?void 0:g.current)&&void 0!==t?t:bi.pagination.current,pageSize:null!==(o=null!==(a=null!==(n=(()=>{if(p)return Number(localStorage.getItem(`tablePager_${p}`))||void 0})())&&void 0!==n?n:null==g?void 0:g.pageSize)&&void 0!==a?a:null===(i=null===(r=null==E?void 0:E.table)||void 0===r?void 0:r.pagination)||void 0===i?void 0:i.pageSize)&&void 0!==o?o:bi.pagination.pageSize,total:0},w=null!==(d=null!==(s=null==v?void 0:v.selectedRowKeys)&&void 0!==s?s:null==v?void 0:v.defaultSelectedRowKeys)&&void 0!==d?d:[],S=null!==(c=null!==(u=null==y?void 0:y.expandedRowKeys)&&void 0!==u?u:null==y?void 0:y.defaultExpandedRowKeys)&&void 0!==c?c:[],[N,T]=q.default.useState([]),[I,O]=q.default.useReducer(((e,t)=>t.forceUpdate||!l.isEqual(e,t.payload)?t.payload:e),h),[R,k]=q.default.useReducer(((e,t)=>t.forceUpdate||!l.isEqual(e,t.payload)?t.payload:e),m),[L,P]=q.default.useReducer(((e,t)=>l.isEqual(e,t)?e:t),[]),[A,F]=q.default.useReducer(((e,t)=>l.isEqual(e,t)?e:t),{}),[_,D]=q.default.useState(C),[M,H]=q.default.useReducer(((e,t)=>l.isEqual(e,t)?e:t),w),[$,j]=q.default.useReducer(((e,t)=>l.isEqual(e,t)?e:t),S),[K,V]=q.default.useState(null!==(f=null==b?void 0:b.currentRowKey)&&void 0!==f?f:""),[z,W]=q.default.useReducer((e=>e+1),0),[B,U]=q.default.useReducer(((e,t)=>l.isEqual(e,t)?e:t),{}),[G,Y]=yi([],{value:x}),[X,Q]=q.default.useState({gutterWidth:0,tableWidth:0,tableBodyWidth:0,tableBodyHeight:0,viewportHeight:0,headerHeight:0,footerHeight:0,tableAutoHeight:0,tableFullHeight:0}),[Z,J]=q.default.useState({export:!0,import:!0,print:!0}),[ee,te]=q.default.useState(!1),[le,ne]=q.default.useState(!1),[ae,re]=q.default.useState(!1),[ie,oe]=q.default.useState(!1);return{tableFlatData:N,setTableFlatData:T,filters:I,setFilters:O,sorter:R,setSorter:k,superFilters:L,setSuperFilters:P,pagerFilter:A,setPagerFilter:F,pagination:_,setPagination:D,selectionKeys:M,setSelectionKeys:H,rowExpandedKeys:$,setRowExpandedKeys:j,highlightKey:K,setHighlightKey:V,updateMark:z,forceUpdate:W,activedCell:B,setActivedCell:U,mergedTdCells:G,setMergedCells:Y,layout:X,permission:Z,setPermission:J,setLayout:Q,spinning:ee,setSpinning:te,isPingLeft:le,setPingLeft:ne,isPingRight:ae,setPingRight:re,isFullScreen:ie,setFullScreen:oe,updateTableFlatData:()=>T([...N])}})(n),{isFetch:Me,isWebPagination:He,isScrollPagination:qe,showPagination:$e,tableColumns:Ke,flattenColumns:Ve,editableColumns:ze,summationColumns:We,leftFixedColumns:Be,rightFixedColumns:Ue,tableRowHeight:Ge,derivedMergeCells:Ye,treeExpandIndex:Xe,showSummary:Qe,showFooter:Ze,isHeadGroup:Je,bordered:et,isHeadSorter:lt,isHeadFilter:nt,isServiceSummation:at,isSelectCollection:rt,isTableImport:it,isTableClipboard:ot,isSuperSearch:ut,isFastSearch:ct,isPivotGrid:pt,isGroupSummary:mt,isGroupSubtotal:ht,isTableEmpty:vt,summationRows:yt,fetchParams:bt}=Ei(n,{getRowKey:O,tableRef:R,$size:E,tableFullData:k,tableFlatData:G,updateMark:pe,sorter:Z,filters:X,superFilters:te,selectionKeys:oe,pagination:re,mergedTdCells:ve}),{createElementStore:xt,tableStyles:Et,getSpan:Ct,getStickyLeft:wt,getStickyRight:St,scrollXToColumn:Nt,scrollYToRecord:Tt,calcTableHeight:It,resetTableScroll:Ot,createTableFocus:Rt,doLayout:kt}=wi(n,{getRowKey:O,tableRef:R,topElementRef:C,tableElementRef:w,tableBodyRef:S,$size:E,tableColumns:Ke,flattenColumns:Ve,leftFixedColumns:Be,derivedMergeCells:Ye,tableFlatData:G,selectionKeys:oe,highlightKey:ce,tableRowHeight:Ge,layout:be,showFooter:Ze,showPagination:$e,isFullScreen:Pe,setLayout:Ee,setElementStore:L}),{initialTable:Lt,checkDataIndex:Pt,createTableFullData:At,createWebPageData:Ft,getTableData:_t,createTableData:Dt,createGroupData:Mt,createAllExpandedKeys:Ht,setSelectionKeysEffect:qt,doFieldValidate:$t,getTableLog:jt,dataChange:Kt,tableChange:Vt,toLastPage:zt,toFirstPage:Wt,getPageCount:Bt,pagerChangeHandle:Ut,scrollBottomDebouncer:Gt,clearTableSorter:Yt,clearTableFilter:Xt,clearSuperFilters:Qt,clearPagerFilter:Zt,clearActivedCell:Jt,clearRowSelection:el,clearRowHighlight:tl,clearTableLog:ll,destroy:nl}=Ci(n,{getRowKey:O,tableRef:R,tableElementRef:w,$size:E,tableColumns:Ke,flattenColumns:Ve,tableFullData:k,pagination:re,layout:be,filters:X,sorter:Z,superFilters:te,pagerFilter:ne,fetchParams:bt,selectionKeys:oe,rowExpandedKeys:de,highlightKey:ce,summationColumns:We,isFetch:Me,isWebPagination:He,isScrollPagination:qe,isServiceSummation:at,isGroupSubtotal:ht,doLayout:kt,setTableFlatData:Y,setTableFullData:A,setTableOriginData:F,setTableDataMaps:_,setPagination:ie,setPingRight:Le,setPingLeft:Re,setSpinning:Ne,setSorter:ee,setFilters:Q,setSuperFilters:le,setPagerFilter:ae,setActivedCell:ge,setSelectionKeys:se,setRowExpandedKeys:ue,setHighlightKey:fe,setSelectionRows:W,setScrollXLoad:$,setScrollYLoad:j,setFieldAuth:M,setResizeState:K,setSummaries:z,setPermission:we,resetTableScroll:Ot,createTableFocus:Rt,clearElementStore:U});((e,t)=>{const{columns:n,summation:a,rowSelection:r,expandable:i,rowHighlight:o}=e,{tableRef:s,tableBodyRef:d,$size:u,pagination:c,selectionKeys:f,rowExpandedKeys:p,highlightKey:m,summationRows:h,showSummary:g,isWebPagination:v,isScrollPagination:y,checkDataIndex:b,toLastPage:x,toFirstPage:E,getPageCount:C,setHandleState:w,scrollYToRecord:S,setSelectionKeysEffect:N,setOriginColumns:T,setRowExpandedKeys:I,setHighlightKey:O,setResizeState:R,setUnMounted:k,calcTableHeight:L,initialTable:P,destroy:A}=t,F=q.default.useRef(h);Yl((()=>{if(!r)return;const{onChange:e}=r;"radio"===r.type&&d.current.setClickedValues(f.length?[f[0],""]:[]),Ia(f)||null==e||e(f,s.current.selectionRows),Oa(f)}),[f]),Yl((()=>{if(!i)return;const{onChange:e}=i;Ia(p)||null==e||e(p,p.map((e=>s.current.recordsMap.get(e)))),Oa(p)}),[p]),Yl((()=>{var e,t;o&&(d.current.setClickedValues(m?[m,""]:[]),null===(e=o.onChange)||void 0===e||e.call(o,m,null!==(t=s.current.recordsMap.get(m))&&void 0!==t?t:null))}),[m]),Yl((()=>{var e;l.isEqual(h,F.current)||(F.current=h,g&&a&&(null===(e=a.onChange)||void 0===e||e.call(a,h)))}),[h]),Yl((()=>{const e=r.selectedRowKeys||[];l.isEqual(e,f)||N(Ta(e))}),[null==r?void 0:r.selectedRowKeys]),Yl((()=>{const e=i.expandedRowKeys||[];l.isEqual(e,p)||I(Ta(e))}),[null==i?void 0:i.expandedRowKeys]),Yl((()=>{const{currentRowKey:e}=o;e!==m&&O(null!=e?e:"")}),[null==o?void 0:o.currentRowKey]),Yl((()=>{const{insert:e,remove:t}=s.current.handleState;e&&(v&&("after"===e?x():E()),S("","after"===e?1e5:0)),t&&c.current>C()&&x(),(e||t)&&w({insert:null,remove:!1})}),[c.total]),Yl((()=>{L()}),[u]),Yl((()=>{(s.current.scrollYLoad||y)&&(e.height||e.maxHeight||ft("Table","必须设置组件参数 `height` 或 `maxHeight`"))}),[s.current.scrollYLoad,y]),Si({handler:()=>{const{resizeState:e}=s.current,{winHeight:t}=e,l=window.innerHeight;l!==t&&(R(Object.assign({},e,{winHeight:l})),L())},delay:16}),q.default.useLayoutEffect((()=>(T(ha(n)),P(),b(),Fe((()=>L())),()=>{A(),k(!0)})),[])})(n,{tableRef:R,tableBodyRef:S,$size:E,pagination:re,selectionKeys:oe,rowExpandedKeys:de,highlightKey:ce,showSummary:Qe,summationRows:yt,isWebPagination:He,isScrollPagination:qe,checkDataIndex:Pt,toLastPage:zt,toFirstPage:Wt,getPageCount:Bt,setHandleState:V,scrollYToRecord:Tt,setOriginColumns:P,setSelectionKeysEffect:qt,setRowExpandedKeys:ue,setHighlightKey:fe,setResizeState:K,setUnMounted:B,calcTableHeight:It,initialTable:Lt,destroy:nl});const al=q.default.useMemo((()=>({getRowKey:O,tableRef:R,tableBodyRef:S,prefixCls:I,$size:E,tableFlatData:G,flattenColumns:Ve,editableColumns:ze,leftFixedColumns:Be,rightFixedColumns:Ue,treeExpandIndex:Xe,sorter:Z,filters:X,superFilters:te,pagerFilter:ne,layout:be,bordered:et,showFooter:Ze,showSummary:Qe,summationRows:yt,tableRowHeight:Ge,pagination:re,fetchParams:bt,selectionKeys:oe,rowExpandedKeys:de,highlightKey:ce,activedCell:he,mergedTdCells:ve,derivedMergeCells:Ye,updateMark:pe,isFetch:Me,isPingLeft:Te,isPingRight:ke,isHeadSorter:lt,isHeadFilter:nt,isFullScreen:Pe,isTableEmpty:vt,isHeadGroup:Je,isGroupSubtotal:ht,isWebPagination:He,dataChange:Kt,tableChange:Vt,getTableData:_t,setElementStore:L,createTableFullData:At,createWebPageData:Ft,createGroupData:Mt,createAllExpandedKeys:Ht,updateTableFlatData:De,setSorter:ee,setFilters:Q,setSuperFilters:le,setPagerFilter:ae,setHighlightKey:fe,setRowExpandedKeys:ue,setSelectionRows:W,setSelectionKeysEffect:qt,setInvalidRowKeys:D,setActivedCell:ge,setMergedCells:ye,getSpan:Ct,getStickyLeft:wt,getStickyRight:St,scrollXToColumn:Nt,scrollYToRecord:Tt,setPagination:ie,setPingLeft:Re,setPingRight:Le,setSpinning:Ne,setFullScreen:_e,doFieldValidate:$t,createTableData:Dt,scrollBottomDebouncer:Gt,resetTableScroll:Ot,clearTableSorter:Yt,clearTableFilter:Xt,clearSuperFilters:Qt,clearPagerFilter:Zt,clearActivedCell:Jt,clearRowSelection:el,clearRowHighlight:tl})),[E,G,Ve,Z,X,te,ne,be,et,Ze,Qe,yt,Ge,re,bt,oe,de,ce,he,Ye,pe,Me,Te,ke,lt,nt,Pe,vt,Je,ht,He]);((e,t)=>{const{getRowKey:n,tableRef:a,toolBoxRef:r,tableBodyRef:i,columnFilterRef:o,flattenColumns:s,editableColumns:d,pagination:u,fetchParams:c,selectionKeys:f,rowExpandedKeys:p,highlightKey:m,isFetch:h,dataChange:g,getTableData:v,createTableData:y,calcTableHeight:b,scrollXToColumn:x,scrollYToRecord:E,doFieldValidate:C,setHandleState:w,setColumnsDefined:S,setSelectionKeysEffect:N,setRowExpandedKeys:T,setHighlightKey:I,setSelectionRows:O,setOriginColumns:R,forceUpdate:k,getTableLog:L,clearRowSelection:P,clearRowHighlight:A,clearTableSorter:F,clearTableFilter:_,clearSuperFilters:D,clearPagerFilter:M,clearActivedCell:H,clearTableLog:$}=t,{columns:j,columnsChange:K}=a.current.props,V=(e,t,l,a=0)=>e.filter((e=>{const r=n(e,e.index);e.children&&(e.children=V(e.children,t,l,a+1));const i=t.includes(r);return i&&l(e,r,a),!i}));q.default.useImperativeHandle(e,(()=>({CALCULATE_HEIGHT:()=>{b()},DO_REFRESH:e=>Ie(void 0,void 0,void 0,(function*(){h&&(yield Ae(0),yield v(),null==e||e())})),GET_LOG:()=>L(),GET_FETCH_PARAMS:()=>{const e={};for(const t in c)Object.keys(u).includes(t)||(e[t]=c[t]);return e},CLEAR_TABLE_DATA:()=>{h||(_(),D(),M(),F(),H(),P(),A(),$(),y([]))},CLEAR_LOG:()=>{$(),k()},CREATE_FOCUS:(e,t)=>{i.current.createFocus(e,t)},FORCE_UPDATE:()=>{k()},DO_EXPORT:()=>{r.current.exportHandle()},SCROLL_TO_RECORD:e=>{E(e)},SCROLL_TO_COLUMN:e=>{x(e)},SET_SELECTION:(e,t)=>{N(t?Ta([...e]):e)},SET_EXPANDABLE:(e,t)=>{T(t?Ta([...e]):e)},SET_HIGHLIGHT:e=>{I(e)},SET_SELECTION_ROWS:e=>{O(e)},SET_TABLE_DATA:e=>{y(e)},DEFINE_INITIAL_COLUMNS:e=>{R(ha(e)),S(!0),o.current.initialHandler(e)},SET_TABLE_COLUMN:(e,t,n)=>{const a=ya(j,e);if(!a)return ft("Table","SET_TABLE_COLUMN 方法参数 `dataIndex` 的值不正确");if(!l.isPlainObject(t))return ft("Table","SET_TABLE_COLUMN 方法参数 `option` 的值不正确");if(a.noAuth)return ft("Table","SET_TABLE_COLUMN 方法不能操作受权限控制的列");for(const e in t)e&&l.set(a,e,t[e]);n&&(K?K([...j]):ft("Table","需要设置 `columnsChange` 参数"),k())},INSERT_RECORDS:(e,t)=>{const{store:r,tableFullData:i,tableOriginData:o}=a.current,d=(Array.isArray(e)?e:[e]).filter((e=>l.isPlainObject(e)));if(!d.length)return;d.forEach((e=>{s.forEach((t=>{const{dataIndex:l}=t;[bi.expandableColumn,bi.selectionColumn,bi.operationColumn].includes(l)||Aa(e,l,Pa(e,l))})),r.addToInserted(e)}));const u="before"===(null==t?void 0:t.mode),c=void 0===(null==t?void 0:t.parentRowKey),f=[...i];if(c)u?f.unshift(...d):f.push(...d),u?o.unshift(...d):o.push(...d);else{const e=Ba(f,(e=>t.parentRowKey===n(e,e.index)));if(e){const l=Ba(o,(e=>t.parentRowKey===n(e,e.index))),a=Qa(e,l);Array.isArray(e.children)?(u?e.children.unshift(...d):e.children.push(...d),!a&&l&&(u?l.children.unshift(...d):l.children.push(...d))):(e.children=d,!a&&l&&(l.children=d))}}c&&w(Object.assign({},a.current.handleState,{insert:u?"before":"after"})),y(o,(()=>f)),g()},REMOVE_RECORDS:e=>{const{store:t,tableFullData:r,tableOriginData:i}=a.current,o=(Array.isArray(e)?e:[e]).map((e=>l.isPlainObject(e)?n(e,e.index):e));if(!o.length)return;let s=!1;const u=V([...r],o,((e,l,a)=>{if(t.addToRemoved(e),d.forEach((n=>{const{dataIndex:a,editRender:r}=n,i=null==r?void 0:r(e,n);if(!i)return;const{rules:o=[],disabled:s}=i;!s&&o.length&&(t.removeFromRequired({x:l,y:a}),t.removeFromValidate({x:l,y:a}),t.removeFromEdited({x:l,y:a}))})),a<=0){const e=i.findIndex((e=>n(e,e.index)===l));i.splice(e,1)}else if(!Qa(e,Ba(i,(e=>n(e,e.index)===l)))){const t=Ba(i,(t=>n(t,t.index)===e._parentRowKey));t&&(t.children=t.children.filter((e=>n(e,e.index)!==l)))}s=!0}));s&&(w(Object.assign({},a.current.handleState,{remove:!0})),N(f.filter((e=>!o.includes(e)))),o.includes(m)&&A(),T(p.filter((e=>!o.includes(e)))),y(i,(()=>u)),g())},VALIDATE_FIELDS:(e,t)=>{Array.from(a.current.recordsMap.values()).forEach((l=>{d.forEach((a=>{const{dataIndex:r,title:i,editRender:o}=a,s=null==o?void 0:o(l,a);if(!s)return;const d=n(l,l.index);if(e&&!e.includes(d))return;if(t&&!t.includes(r))return;const{rules:u=[],disabled:c}=s;c||C(u,Pa(l,r),d,r,ja(i))}))}));const{required:l,validate:r}=L(),i=[...l,...r];return i.length&&E(i[0].rowKey),k(),{required:l,validate:r}}})))})(t,{getRowKey:O,tableRef:R,toolBoxRef:N,tableBodyRef:S,columnFilterRef:T,flattenColumns:Ve,editableColumns:ze,pagination:re,fetchParams:bt,selectionKeys:oe,rowExpandedKeys:de,highlightKey:ce,isFetch:Me,dataChange:Kt,getTableData:_t,createTableData:Dt,calcTableHeight:It,scrollXToColumn:Nt,scrollYToRecord:Tt,doFieldValidate:$t,setHandleState:V,setColumnsDefined:H,setSelectionKeysEffect:qt,setRowExpandedKeys:ue,setHighlightKey:fe,setSelectionRows:W,setOriginColumns:P,forceUpdate:me,getTableLog:jt,clearRowSelection:el,clearRowHighlight:tl,clearTableSorter:Yt,clearTableFilter:Xt,clearSuperFilters:Qt,clearPagerFilter:Zt,clearActivedCell:Jt,clearTableLog:ll}),q.default.useLayoutEffect((()=>{xt(),R.current.tableManager.register(R.current.uid,null!=t?t:{current:null})}),[]);const rl={[`${I}--wrapper`]:!0,[`${I}--lg`]:"large"===E,[`${I}--sm`]:"small"===E,[`${I}--maximize`]:Pe,[s]:!!s},il={[I]:!0,"is--border":et,"is--fixed":Be.length||Ue.length,"is--sortable":lt,"is--filterable":nt,"is--head-group":Je,"is--area-select":!!d,"is--ping-left":Te,"is--ping-right":ke};return q.default.createElement(ei.Provider,{value:al},q.default.createElement("div",{className:J.default(rl,b),style:x},m&&q.default.createElement("div",{ref:C,className:`${I}-top`},q.default.createElement("div",{className:`${I}-top__space`},"bottom"!==(null==f?void 0:f.position)&&q.default.createElement(Ni,{total:re.total}),q.default.createElement("div",{className:`${I}-top__space-slot`,style:{justifyContent:ui[p]}},n.children)),q.default.createElement("div",{className:`${I}-top__actions`},q.default.createElement(su,{ref:N,showFullScreen:h,showReload:g&&Me,showPrint:Ce.print&&!!u,showImport:Ce.import&&it,showExport:Ce.export&&!!c,showClipboard:ot,showCollection:rt,showFastSearch:ct,showSuperSearch:ut,showPivotGrid:pt,showGroupSummary:mt,showToolBox:v,tableColumns:Ke}),q.default.createElement(uu,{ref:T,columns:r}))),q.default.createElement(mn,{spinning:null!=i?i:Se},q.default.createElement("div",{ref:w,className:J.default(il),style:Et},q.default.createElement("div",{className:`${I}--main-wrapper`},y&&q.default.createElement(qu,{tableColumns:Ke}),q.default.createElement(vc,{ref:S}),Ze&&q.default.createElement(yc,null)),et&&q.default.createElement("div",{className:`${I}--border-line`}),vt&&q.default.createElement(Ec,null),o&&q.default.createElement(Cc,null))),$e&&q.default.createElement(xc,tt({},re,{onChange:(e,t)=>Ut({current:e,pageSize:t})}))))}));wc.displayName="QmTable";const Sc=e=>{var t;const{uniqueKey:n,multiple:a,initialValue:r,selectionRows:i,defaultSelectedKeys:o=[],filters:s=[],table:d={},className:u,style:c,onClose:f}=e,{$size:p}=dt(e),{t:m}=ot(),h=q.default.useRef(null),g=q.default.useRef(null),v=q.default.useRef(null),y=xn(h),[b,x]=q.default.useState(d),[E,C]=q.default.useState(),[w,S]=q.default.useState(o),[N,T]=q.default.useState(!1),[I,O]=q.default.useState(300),[R,k]=q.default.useState(s),[L,P]=q.default.useState((e=>[{title:m("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>q.default.createElement("span",null,e+1)},...e||(d.columns||[])])()),[A,F]=q.default.useState(l.merge({},null===(t=d.fetch)||void 0===t?void 0:t.params,r)),[_,D]=q.default.useState([]),M=()=>{const e=h.current,t=e.querySelector(".form-wrap");O(e.offsetHeight-t.offsetHeight-2*Jr[p]-30)},H=wn(M,5);Cn((()=>{H()}),[y.width]),Yl((()=>{l.isEqual(s,R)||k(s)}),[s]),q.default.useEffect((()=>{$()}),[A]),q.default.useEffect((()=>{i&&v.current.SET_SELECTION_ROWS(i)}),[i]),q.default.useEffect((()=>{var e;r&&(null===(e=g.current)||void 0===e||e.SET_FIELDS_VALUE(r))}),[]);const $=()=>Ie(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=b;if(!t||!(null==n?void 0:n.api))return;const{api:r,dataKey:i,beforeFetch:o=Pe,afterFetch:s}=n;if(o(A)){T(!0);try{const t=yield r(A);if(200===t.code){let n=Array.isArray(t.data)?t.data:null!==(e=l.get(t.data,i))&&void 0!==e?e:[];n="function"==typeof s?yield s(n):n,a||(S([]),yield Ae(0)),D(n)}}catch(e){}T(!1)}})),j=e=>{a||(C(e),f(e))},K=e=>{F(Object.assign({},A,e))},V={[`${gt("search-helper")}--wrapper`]:!0},z=b.webPagination?{dataSource:_,loading:N,webPagination:!0}:{fetch:Object.assign(Object.assign({},b.fetch),{params:A})};return q.default.createElement("div",{ref:h,className:J.default(V,u),style:c},q.default.createElement("div",{className:"form-wrap"},R.length?q.default.createElement(ap,{ref:g,items:R,uniqueKey:n,formType:"search",disabled:!1,isAutoFocus:!1,fieldsChange:e=>k(e),onCollapse:()=>M(),onFinish:e=>K(e),onReset:()=>Ie(void 0,void 0,void 0,(function*(){const[e,t]=yield g.current.GET_FORM_DATA();e||K(t)}))}):null),q.default.createElement("div",null,q.default.createElement(wc,tt({ref:v,uniqueKey:n,height:I,columns:L,rowKey:b.rowKey||"pageIndex"},z,{rowSelection:{type:a?"checkbox":"radio",clearableAfterFetched:!a,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:w,onChange:(e,t)=>{S(e),C(a?t:t[0])}},topSpaceAlign:"left",paginationConfig:b.paginationConfig,columnsChange:e=>P(e),onRowDblclick:j,onRowEnter:j}),b.topBarExtra)),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Jr[p]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},q.default.createElement(pt,{onClick:()=>f(null),style:{marginRight:8}},m("qm.dialog.cancel")),q.default.createElement(pt,{type:"primary",disabled:!E,onClick:()=>f(E,a?w:void 0)},m("qm.dialog.confirm"))))};Sc.displayName="QmSearchHelper";const{Search:Nc}=d.Input;class Tc extends e.Component{constructor(e){super(e),this._is_change=!1,this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=oe.default((e=>Object.assign({},this.props.helperConfig,e))),this.echoSearchHelper=()=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const e=this.getItemValue();e!==this._prevValue&&(this.getItemText(),this._prevValue=e)})),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.initialHandle=()=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e}=this.props.option,{fieldAliasMap:t,fieldsDefine:l,echoRequest:n}=this.searchHelper;if(t||ft("Form","SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),l){const e=["valueKey","displayKey","extraKey"];for(const t in l)e.includes(t)&&(this[t]=l[t])}Object.keys(this.alias).includes(e)||ft("Form","SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),n&&!this.valueKey&&ft("Form","SEARCH_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),this.getItemValue=()=>this.context.$$form.GET_FIELDS_VALUE([this.valueKey])[this.valueKey],this.getDerivedSearchHelper=()=>this.searchHelper,this.getItemText=()=>Ie(this,void 0,void 0,(function*(){var e;const{fetchApi:t,params:n={},formatter:a=(e=>e),dataKey:r,callback:i,triggeredChange:o,fieldAliasMap:s,extraAliasMap:d}=this.searchHelper.echoRequest||{},u="function"==typeof s?s():s||{},c="function"==typeof d?d():d||{},f=this.getItemValue();if(t&&!De(f)){this.setState({loading:!0});try{const s=yield t(a(Object.assign(Object.assign({},n),{key:f})));if(200===s.code){const t=Array.isArray(s.data)?s.data:null!==(e=l.get(s.data,r))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(u&&vr(e,this.alias,u),c&&yr(e,this.extras,c),this._record=e,this.setFieldsValue(e),o){const t=gr(e,this.alias[this.props.option.fieldName]);this.triggerChange(t),this.searchHelperChangeHandle(t)}null==i||i([e])}}}catch(e){}this.setState({loading:!1})}})),this.todoOpen=e=>{const{autoQueryAssign:t=!0}=this.searchHelper;t&&(this.deriveParams=this.createFilters(e)),this.setVisible(!0)},this.createFilters=e=>{const{fieldName:t}=this.props.option,{filterAliasMap:n}=this.searchHelper,a=""!==e?e:void 0,r=("function"==typeof n?n():n)||[],i={[t]:a};return(Array.isArray(r)?r:[r]).forEach((e=>{if(l.isPlainObject(e))for(const t in e)i[t]="function"==typeof e[t]?e[t](a):a;else i[e]=a})),i},this.getSearchHelperTableData=e=>{const{table:t,initialValue:n={}}=this.searchHelper,{beforeFetch:a=Pe,formatter:r=(e=>e)}=t.fetch;return new Promise(((i,o)=>Ie(this,void 0,void 0,(function*(){var s;const d=l.merge({},this.searchHelper.table.fetch.params,Object.assign(Object.assign({},n),r(this.createFilters(e))),{currentPage:1,pageSize:500});if(!a(d))return o();this.setState({loading:!0});try{const e=yield t.fetch.api(d);if(200===e.code){const n=Array.isArray(e.data)?e.data:null!==(s=l.get(e.data,t.fetch.dataKey))&&void 0!==s?s:[];i(n)}else o()}catch(e){o(e)}finally{Fe((()=>this.setState({loading:!1})))}}))))},this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;for(const n in this.alias){const a=gr(e,this.alias[n]);void 0!==a&&(t.SET_FIELDS_VALUE({[n]:a}),n===this.valueKey&&(this._prevValue=a),n===l&&t.setViewValue(l,a))}for(const l in this.extras){const n=gr(e,this.extras[l]);void 0!==n&&t.SET_FIELDS_EXTRA({[l]:n})}},this.resetSearchHelperValue=(e=[],t)=>Ie(this,void 0,void 0,(function*(){const{fieldName:l}=this.props.option,n=e.filter((e=>{var n;return null===(n=gr(e,this.alias[l]))||void 0===n?void 0:n.toString().toLowerCase().includes(t.toLowerCase())}));if(1===n.length)return this.closeSearchHelper(n[0]);this.openSearchHelper(t)})),this.openSearchHelper=(e,t)=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:l}=this.context,{beforeOpen:n}=this.searchHelper,a=(null!=n?n:Pe)(l.state.formData);(null==a?void 0:a.then)?a.then((()=>{this.todoOpen(e),null==t||t()})).catch((()=>{})):!1!==a&&(this.todoOpen(e),null==t||t())})),this.closeSearchHelper=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;this._record=e;for(const n in this.alias){if(n===l)continue;const a=gr(e,this.alias[n]);t.SET_FIELDS_VALUE({[n]:a}),n===this.valueKey&&(this._prevValue=a)}for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:gr(e,this.extras[l])});const n=gr(e,this.alias[l]);this.triggerChange(n),this.searchHelperChangeHandle(n);const{closed:a}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==a?void 0:a(e)),200)}))},this.closeButNotSelect=()=>{const{onlySelect:e=!0}=this.searchHelper;this._is_change&&(e?this.clearSearchHelperValue():this.searchHelperChangeHandle(this.props.value)),this._is_change=!1,this.setVisible(!1)},this.clearSearchHelperValue=()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;if(this.triggerChange(""),null!==this._record){for(const l in this.alias)l!==t&&(e.SET_FIELDS_VALUE({[l]:void 0}),l===this.valueKey&&(this._prevValue=null));for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.searchHelperChangeHandle("")}},this.searchHelperChangeHandle=e=>{const{onChange:t}=this.props.option;this.deriveParams={},this._is_change=!1,null==t||t(e,this._record)},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(e)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.focus=()=>{const{type:e}=this.props.option;this[`${e}_Ref`].focus({cursor:"end"})},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidUpdate(){this.echoSearchHelper()}render(){var e;const{$$form:t}=this.context,{visible:l,loading:n}=this.state,{value:a}=this.props,{type:r,fieldName:i,options:o={},searchHelper:s={},style:d={},placeholder:u=Se("qm.form.inputPlaceholder"),bordered:c=!0,allowClear:f=!0,translate:p,readOnly:m,disabled:h}=this.props.option,{prefix:g,suffix:v,maxLength:y}=o,b={visible:l,title:Se("qm.searchHelper.text"),width:null!==(e=s.width)&&void 0!==e?e:"60%",wrapClassName:`form-popper__${i}`,loading:!1,bodyStyle:{paddingBottom:`${Jr[t.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},x=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:t.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${i}`:"",initialValue:Object.assign({},this.deriveParams,s.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}}),E=t.isOnlyShow?q.default.createElement(Mr,{value:a,bordered:c}):q.default.createElement(q.default.Fragment,null,q.default.createElement(Nc,{ref:e=>this[`${r}_Ref`]=e,value:a,title:a,loading:n,placeholder:u,style:d,prefix:g,suffix:v,maxLength:y,bordered:c,allowClear:f,readOnly:m,disabled:h,onBlur:e=>{var t;const{value:n}=e.target,{onlySelect:a=!0,table:r}=this.searchHelper;this.triggerBlur(n),this._is_change&&!l&&(n?a?(null===(t=null==r?void 0:r.fetch)||void 0===t?void 0:t.api)&&this.getSearchHelperTableData(n).then((e=>this.resetSearchHelperValue(e,n))).catch((()=>this.clearSearchHelperValue())):this.searchHelperChangeHandle(n):this.clearSearchHelperValue())},onKeyDown:e=>{if(13===e.keyCode){e.preventDefault();const{value:t}=e.target;!l&&this.openSearchHelper(t)}},onDoubleClick:e=>{const{value:t}=e.target;this.openSearchHelper(t)},onChange:e=>{const{value:t}=e.target;this.triggerChange(t),this._is_change=!0},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper(e):Fe((()=>this.clearSearchHelperValue())))}}),q.default.createElement(Qn,b,q.default.createElement(Sc,x)));return p?q.default.createElement(Hr,{text:a},E):E}}Tc.contextType=Zn;class Ic extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ie(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){ct("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return ft("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ie(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=wr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:u,extra:c,buttonAfter:f,validateTrigger:p,rules:m=[]}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":$e(s)},required:e.getFormItemRequired(m)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:r,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(Tc,{ref:e=>this.searchRef=e,option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t="")=>{e.setViewValue(r,t)}}))),f&&q.default.createElement(d.Col,null,e.renderFormItemButton(r,f)),c&&q.default.createElement(d.Col,{flex:$e(c.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}Ic.contextType=Zn;const Oc=t=>{class l extends e.Component{constructor(){super(...arguments),this.event1=null,this.event2=null,this.$el=null,this.omitClassNames=[],this.state={clickOutside:!1},this.mousedownHandler=e=>{this.startClick=e},this.mouseupHandler=e=>{this.documentHandler(e,this.startClick)},this.documentHandler=(e,t)=>{var l,n;const a=e.target,r=null==t?void 0:t.target,i=!a||!r,o=(null===(l=this.$el)||void 0===l?void 0:l.contains(a))||(null===(n=this.$el)||void 0===n?void 0:n.contains(r)),s=this.$el===a,d=this.omitClassNames.map((e=>Array.from(document.querySelectorAll(e)))).flat(),u=d.some((e=>null==e?void 0:e.contains(a)))||d.includes(r);let c;c=!(i||o||s||u),this.setState({clickOutside:c})},this.setCurrentElement=e=>{e&&(this.$el=e)},this.setOmitClassNames=(e=[])=>{this.omitClassNames=e}}componentDidMount(){this.event1=ae.default(document,"mousedown",this.mousedownHandler),this.event2=ae.default(document,"mouseup",this.mouseupHandler)}componentWillUnmount(){var e,t;null===(e=this.event1)||void 0===e||e.remove(),null===(t=this.event2)||void 0===t||t.remove()}render(){const{forwardedRef:e}=this.props,{clickOutside:l}=this.state;return q.default.createElement(t,tt({ref:e},this.props,{clickOutside:l,setCurrentElement:this.setCurrentElement,setOmitClassNames:this.setOmitClassNames}))}}return l.displayName=`OutsideClick(${t.displayName||t.name})`,q.default.forwardRef(((e,t)=>q.default.createElement(l,tt({},e,{forwardedRef:t}))))};let Rc=class extends e.Component{constructor(e){super(e),this.searchRef=q.default.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=oe.default((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||ft("Form","MULTIPLE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||ft("Form","MULTIPLE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setItemList=e=>{this.setState({itemList:e})},this.setRecords=e=>{this._records=e},this.recordsToDict=()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))),this.setViewValue=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;t.setViewValue(l,this.createViewText(e))},this.openSearchHelper=e=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:l}=this.searchHelper,n=(null!=l?l:Pe)(t.state.formData);(null==n?void 0:n.then)?n.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=(e,t=[])=>{const{valueKey:n}=this.alias;this.setRecords(l.uniqBy([...this._records.filter((e=>t.includes(e[n]))),...e],n));const a=this.recordsToDict();this.setItemList(a),this.triggerChange(a.map((e=>e.value)));const{closed:r}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==r?void 0:r(this._records)),200)}))},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props,{valueKey:n}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[n])))),null==t||t(e),l(e,this.createViewText(e),this._records)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e,t){const{value:n=[]}=e,{value:a=[],clickOutside:r}=this.props;l.isEqual(n,a)||l.isEqual(a,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),r&&t.visible2&&this.setState({visible2:!1})}getItemList(){var e,t;return Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:n,valueKey:a}=this.alias,{fetchApi:r,params:i={},formatter:o=(e=>e),dataKey:s,callback:d,fieldAliasMap:u}=this.searchHelper.echoRequest||(null===(e=this.props.option.searchHelper)||void 0===e?void 0:e.request)||{},c="function"==typeof u?u():u||{},{value:f}=this.props;if(r){if(De(f))return this.setRecords([]);this.setState({loading:!0});try{const e=yield r(o(Object.assign(Object.assign({},i),{keys:f})));if(200===e.code){let r=Array.isArray(e.data)?e.data:null!==(t=l.get(e.data,s))&&void 0!==t?t:[];r.forEach((e=>{(null==c?void 0:c.valueKey)&&c.valueKey!==a&&(e[a]=e[c.valueKey]),(null==c?void 0:c.textKey)&&c.textKey!==n&&(e[n]=e[c.textKey])})),r=r.filter((e=>f.includes(e[a])));const i=r.map((e=>({value:e[a],text:e[n]})));this.setRecords(r),this.setItemList(i),this.setViewValue(f),null==d||d(r)}}catch(e){}this.setState({loading:!1})}}))}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){var e,t,n;const{$$form:a}=this.context,{visible:r,visible2:i,loading:o,itemList:s}=this.state,{value:u}=this.props,{fieldName:c,options:f={},searchHelper:p={},style:m={},placeholder:h=Se("qm.form.selectPlaceholder"),bordered:v=!0,allowClear:y=!0,readOnly:b,disabled:x}=this.props.option,{collapseTags:E,maxTagTextLength:C}=f,w={visible:r,title:Se("qm.searchHelper.text"),width:null!==(e=p.width)&&void 0!==e?e:"60%",wrapClassName:`form-popper__${c}`,loading:!1,bodyStyle:{paddingBottom:`${Jr[a.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},S=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:a.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${c}`:"",initialValue:l.merge({},p.initialValue),defaultSelectedKeys:u,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),N=s.filter((e=>null==u?void 0:u.includes(e.value))),T=q.default.createElement("ul",{className:"ant-dropdown-menu"},N.length?N.map((e=>q.default.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):q.default.createElement("li",{className:"ant-dropdown-menu-item"},Se("qm.table.config.emptyText"))),I=this.searchRef.current?this.searchRef.current.offsetWidth:300,O=gt("form-multiple-search-helper"),{size:R}=a.context,k={[O]:!0,[`${O}--lg`]:"large"===R,[`${O}--sm`]:"small"===R};null===(n=(t=this.props).setOmitClassNames)||void 0===n||n.call(t,[`.${O}`]);const L=s.filter((e=>null==u?void 0:u.includes(e.value))).map((e=>e.text)).join(",");return a.isOnlyShow?q.default.createElement(Mr,{value:L,bordered:v}):q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},q.default.createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},q.default.createElement(xs,{popupVisible:!x&&i,popup:T,popupClassName:J.default(k),popupStyle:{minWidth:I},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:or,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement(d.Select,{mode:"multiple",maxTagCount:E?"responsive":void 0,maxTagTextLength:C,open:!1,value:u,placeholder:h,loading:o,bordered:v,allowClear:y,disabled:x,style:Object.assign({width:"100%"},m),title:L,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{var t,l;const n=e.target;n.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(l=(t=this.props).setCurrentElement)||void 0===l||l.call(t,n),this.setState({visible2:!0}))},onDoubleClick:()=>{x||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},s.map((e=>q.default.createElement(d.Select.Option,{key:e.value,value:e.value},e.text))))),q.default.createElement("span",{className:"ant-input-group-addon"},q.default.createElement(d.Button,{className:"ant-input-search-button",disabled:x,icon:q.default.createElement(g.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),q.default.createElement(Qn,w,q.default.createElement(Sc,S)))}};Rc.contextType=Zn,Rc=Te([Oc],Rc);class kc extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ie(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){ct("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return ft("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ie(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=wr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:u,extra:c,buttonAfter:f,validateTrigger:p,rules:m=[],onChange:h=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":$e(s)},required:e.getFormItemRequired(m)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:r,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(Rc,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,l,n)=>{h(t,n),e.setViewValue(r,l)}}))),f&&q.default.createElement(d.Col,null,e.renderFormItemButton(r,f)),c&&q.default.createElement(d.Col,{flex:$e(c.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}kc.contextType=Zn;const Lc=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...Lc(e.children)),e.children&&t.push(e.value)})),t},Pc=(e,t)=>{let l=null;for(let n=0;n<e.length;n++){if(Array.isArray(e[n].children)&&(l=Pc(e[n].children,t)),l)return l;if(t(e[n]))return e[n]}return l},Ac=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&Ac(e.children,t),t(e)||e.children&&e.children.length))),Fc=e=>{var t;const{uniqueKey:n,multiple:a,initialValue:r,selectionRows:i,defaultSelectedKeys:o=[],filters:s=[],table:u={},tree:c={},className:f,style:p,onClose:m}=e,{$size:h}=dt(e),{t:v}=ot(),y=q.default.useRef(null),b=q.default.useRef(null),x=q.default.useRef(null),E=xn(y),[C,w]=q.default.useState(u),[S,N]=q.default.useState(),[T,I]=q.default.useState(o),[O,R]=q.default.useState(!1),[k,L]=q.default.useState(300),[P,A]=q.default.useState(300),[F,_]=q.default.useState(s),[D,M]=q.default.useState((e=>[{title:v("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>q.default.createElement("span",null,e+1)},...e||(u.columns||[])])()),[H,$]=q.default.useState(l.merge({},null===(t=u.fetch)||void 0===t?void 0:t.params,r)),[j,K]=q.default.useState([]),V=()=>{const e=y.current,t=e.querySelector(".form-wrap"),l=e.querySelector(".input-wrap");L(e.offsetHeight-l.offsetHeight-10),A(e.offsetHeight-t.offsetHeight-2*Jr[h]-30)},z=wn(V,5);Cn((()=>{z()}),[E.width]),Yl((()=>{l.isEqual(s,F)||_(s)}),[s]),q.default.useEffect((()=>{W()}),[H]),q.default.useEffect((()=>{i&&x.current.SET_SELECTION_ROWS(i)}),[i]),q.default.useEffect((()=>{var e;r&&(null===(e=b.current)||void 0===e||e.SET_FIELDS_VALUE(r)),ne()}),[]);const W=()=>Ie(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=C;if(!t||!(null==n?void 0:n.api))return;const{api:r,dataKey:i,beforeFetch:o=Pe}=n;if(o(H)){R(!0);try{const t=yield r(H);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=l.get(t.data,i))&&void 0!==e?e:[];a||(I([]),yield Ae(0)),K(n)}}catch(e){}R(!1)}})),B=e=>{a||(N(e),m(e))},U=e=>{$(Object.assign({},H,e))},[G,Y]=q.default.useState([]),[X,Q]=q.default.useState([]),[Z,ee]=q.default.useState(""),te=q.default.useRef(G),le=q.default.useRef([]);Yl((()=>{Q(Lc(G))}),[G]);const ne=()=>Ie(void 0,void 0,void 0,(function*(){var e;if(!c.fetch)return;const{api:t,params:n,dataKey:a,valueKey:r="value",textKey:i="text"}=c.fetch;try{const o=yield t(n);if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=l.get(o.data,a))&&void 0!==e?e:[],n=br(t,r,i);Y(n),te.current=n,le.current=t}}catch(e){}})),ae=e=>`${e}|${_r.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,re={[`${gt("tree-table-helper")}--wrapper`]:!0},ie=C.webPagination?{dataSource:j,loading:O,webPagination:!0}:{fetch:Object.assign(Object.assign({},C.fetch),{params:H})};return q.default.createElement("div",{ref:y,className:J.default(re,f),style:p},q.default.createElement(cn,{defaultValue:200,style:{height:"100%"}},q.default.createElement(cn.Pane,{min:100,style:{overflowY:"auto"}},q.default.createElement(d.Input,{className:"input-wrap",value:Z,style:{marginBottom:8},placeholder:v("qm.form.inputPlaceholder"),suffix:q.default.createElement(g.SearchOutlined,null),disabled:!1,allowClear:!0,onChange:e=>(e=>{const t=Ac(te.current,(t=>{if(!e)return!0;const l=t.text||"";return-1!==ae(l).indexOf(e)}));ee(e),Y(t)})(e.target.value)}),q.default.createElement(d.Tree,{fieldNames:{title:"text",key:"value",children:"children"},height:k,defaultExpandAll:!0,expandedKeys:X,treeData:G,filterTreeNode:e=>{if(!Z)return!1;const t=e.text||"";return-1!==ae(t).indexOf(Z)},onExpand:e=>{Q(e)},onSelect:e=>{const{valueKey:t="value"}=c.fetch;(e=>{if(!c.tableParamsMap)return ft("TreeTableHelper","需要配置 `tree.tableParamsMap` 选项");const t="function"==typeof c.tableParamsMap?c.tableParamsMap():c.tableParamsMap,n={};for(const a in t)n[a]=l.get(e,t[a]);U(n)})(Pc(le.current,(n=>l.get(n,t)===e[0]))||{})}})),q.default.createElement(cn.Pane,{className:"split-pane"},q.default.createElement("div",{className:"form-wrap"},F.length?q.default.createElement(ap,{ref:b,items:F,uniqueKey:n,formType:"search",disabled:!1,isAutoFocus:!1,fieldsChange:e=>_(e),onCollapse:()=>V(),onFinish:e=>U(e),onReset:()=>Ie(void 0,void 0,void 0,(function*(){const[e,t]=yield b.current.GET_FORM_DATA();e||U(t)}))}):null),q.default.createElement("div",null,q.default.createElement(wc,tt({ref:x,uniqueKey:n,height:P,columns:D,rowKey:C.rowKey||"pageIndex"},ie,{rowSelection:{type:a?"checkbox":"radio",clearableAfterFetched:!a,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:T,onChange:(e,t)=>{I(e),N(a?t:t[0])}},topSpaceAlign:"left",paginationConfig:C.paginationConfig,columnsChange:e=>M(e),onRowDblclick:B,onRowEnter:B}),C.topBarExtra)))),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Jr[h]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},q.default.createElement(pt,{onClick:()=>m(null),style:{marginRight:8}},v("qm.dialog.cancel")),q.default.createElement(pt,{type:"primary",disabled:!S,onClick:()=>m(S,a?T:void 0)},v("qm.dialog.confirm"))))};Fc.displayName="TreeTableHelper";const{Search:_c}=d.Input;class Dc extends e.Component{constructor(e){super(e),this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=oe.default((e=>Object.assign({},this.props.helperConfig,e))),this.echoSearchHelper=()=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const e=this.getItemValue();e!==this._prevValue&&(this.getItemText(),this._prevValue=e)})),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.initialHandle=()=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e}=this.props.option,{fieldAliasMap:t,fieldsDefine:l,echoRequest:n}=this.searchHelper;if(t||ft("Form","TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),l){const e=["valueKey","displayKey","extraKey"];for(const t in l)e.includes(t)&&(this[t]=l[t])}Object.keys(this.alias).includes(e)||ft("Form","TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),n&&!this.valueKey&&ft("Form","TREE_TABLE_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),this.getItemValue=()=>this.context.$$form.GET_FIELDS_VALUE([this.valueKey])[this.valueKey],this.getDerivedSearchHelper=()=>this.searchHelper,this.getItemText=()=>Ie(this,void 0,void 0,(function*(){var e;const{fetchApi:t,params:n={},formatter:a=(e=>e),dataKey:r,callback:i,triggeredChange:o,fieldAliasMap:s,extraAliasMap:d}=this.searchHelper.echoRequest||{},u="function"==typeof s?s():s||{},c="function"==typeof d?d():d||{},f=this.getItemValue();if(t&&!De(f)){this.setState({loading:!0});try{const s=yield t(a(Object.assign(Object.assign({},n),{key:f})));if(200===s.code){const t=Array.isArray(s.data)?s.data:null!==(e=l.get(s.data,r))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(u&&vr(e,this.alias,u),c&&yr(e,this.extras,c),this._record=e,this.setFieldsValue(e),o){const t=gr(e,this.alias[this.props.option.fieldName]);this.triggerChange(t)}null==i||i([e])}}}catch(e){}this.setState({loading:!1})}})),this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;for(const n in this.alias){const a=gr(e,this.alias[n]);t.SET_FIELDS_VALUE({[n]:a}),n===this.valueKey&&(this._prevValue=a),n===l&&t.setViewValue(l,a)}for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:gr(e,this.extras[l])})},this.openSearchHelper=e=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:l}=this.searchHelper,n=(null!=l?l:Pe)(t.state.formData);(null==n?void 0:n.then)?n.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;this._record=e;for(const n in this.alias){if(n===l)continue;const a=gr(e,this.alias[n]);t.SET_FIELDS_VALUE({[n]:a}),n===this.valueKey&&(this._prevValue=a)}for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:gr(e,this.extras[l])});const n=gr(e,this.alias[l]);this.triggerChange(n);const{closed:a}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==a?void 0:a(e)),200)}))},this.clearSearchHelperValue=()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;for(const l in this.alias)l!==t&&(e.SET_FIELDS_VALUE({[l]:void 0}),l===this.valueKey&&(this._prevValue=null));for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.triggerChange("")},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(e,this._record)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidUpdate(){this.echoSearchHelper()}render(){var e;const{$$form:t}=this.context,{visible:n,loading:a}=this.state,{value:r=""}=this.props,{type:i,fieldName:o,options:s={},searchHelper:d={},style:u={},placeholder:c=Se("qm.form.selectPlaceholder"),bordered:f=!0,allowClear:p=!0,translate:m,readOnly:h,disabled:g}=this.props.option,{prefix:v,suffix:y,maxLength:b}=s,x={visible:n,title:Se("qm.searchHelper.text"),width:null!==(e=d.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${o}`,loading:!1,bodyStyle:{paddingBottom:`${Jr[t.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},E=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:t.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${o}`:"",initialValue:l.merge({},d.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.setVisible(!1)}}),C=t.isOnlyShow?q.default.createElement(Mr,{value:r,bordered:f}):q.default.createElement(q.default.Fragment,null,q.default.createElement(_c,{ref:e=>this[`${i}_Ref`]=e,value:r,title:r,loading:a,placeholder:c,style:u,prefix:v,suffix:y,maxLength:b,bordered:f,allowClear:p,readOnly:h,disabled:g,onBlur:e=>{const{value:t}=e.target;this.triggerBlur(t)},onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onDoubleClick:e=>{this.openSearchHelper()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper():this.clearSearchHelperValue())}}),q.default.createElement(Qn,x,q.default.createElement(Fc,E)));return m?q.default.createElement(Hr,{text:r},C):C}}Dc.contextType=Zn;class Mc extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ie(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){ct("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return ft("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ie(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=wr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:u,extra:c,buttonAfter:f,validateTrigger:p,rules:m=[],onChange:h=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":$e(s)},required:e.getFormItemRequired(m)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:r,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(Dc,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,l)=>{h(t,l),e.setViewValue(r,t)}}))),f&&q.default.createElement(d.Col,null,e.renderFormItemButton(r,f)),c&&q.default.createElement(d.Col,{flex:$e(c.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}Mc.contextType=Zn;let Hc=class extends e.Component{constructor(e){super(e),this.searchRef=q.default.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=oe.default((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||ft("Form","MULTIPLE_TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||ft("Form","MULTIPLE_TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setItemList=e=>{this.setState({itemList:e})},this.setRecords=e=>{this._records=e},this.recordsToDict=()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))),this.setViewValue=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;t.setViewValue(l,this.createViewText(e))},this.openSearchHelper=e=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:l}=this.searchHelper,n=(null!=l?l:Pe)(t.state.formData);(null==n?void 0:n.then)?n.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=(e,t=[])=>{const{valueKey:n}=this.alias;this.setRecords(l.uniqBy([...this._records.filter((e=>t.includes(e[n]))),...e],n));const a=this.recordsToDict();this.setItemList(a),this.triggerChange(a.map((e=>e.value)));const{closed:r}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==r?void 0:r(this._records)),200)}))},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props,{valueKey:n}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[n])))),null==t||t(e),l(e,this.createViewText(e),this._records)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e,t){const{value:n=[]}=e,{value:a=[],clickOutside:r}=this.props;l.isEqual(n,a)||l.isEqual(a,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),r&&t.visible2&&this.setState({visible2:!1})}getItemList(){var e,t;return Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:n,valueKey:a}=this.alias,{fetchApi:r,params:i={},formatter:o=(e=>e),dataKey:s,fieldAliasMap:d}=this.searchHelper.echoRequest||(null===(e=this.props.option.searchHelper)||void 0===e?void 0:e.request)||{},u="function"==typeof d?d():d||{},{value:c}=this.props;if(r){if(De(c))return this.setRecords([]);this.setState({loading:!0});try{const e=yield r(o(Object.assign(Object.assign({},i),{keys:c})));if(200===e.code){let r=Array.isArray(e.data)?e.data:null!==(t=l.get(e.data,s))&&void 0!==t?t:[];r.forEach((e=>{(null==u?void 0:u.valueKey)&&u.valueKey!==a&&(e[a]=e[u.valueKey]),(null==u?void 0:u.textKey)&&u.textKey!==n&&(e[n]=e[u.textKey])})),r=r.filter((e=>c.includes(e[a])));const i=r.map((e=>({value:e[a],text:e[n]})));this.setRecords(r),this.setItemList(i),this.setViewValue(c)}}catch(e){}this.setState({loading:!1})}}))}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){var e,t,n;const{$$form:a}=this.context,{visible:r,visible2:i,loading:o,itemList:s}=this.state,{value:u}=this.props,{fieldName:c,options:f={},searchHelper:p={},style:m={},placeholder:h=Se("qm.form.selectPlaceholder"),bordered:v=!0,allowClear:y=!0,readOnly:b,disabled:x}=this.props.option,{collapseTags:E,maxTagTextLength:C}=f,w={visible:r,title:Se("qm.searchHelper.text"),width:null!==(e=p.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${c}`,loading:!1,bodyStyle:{paddingBottom:`${Jr[a.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},S=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:a.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${c}`:"",initialValue:l.merge({},p.initialValue),defaultSelectedKeys:u,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),N=s.filter((e=>null==u?void 0:u.includes(e.value))),T=q.default.createElement("ul",{className:"ant-dropdown-menu"},N.length?N.map((e=>q.default.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):q.default.createElement("li",{className:"ant-dropdown-menu-item"},Se("qm.table.config.emptyText"))),I=this.searchRef.current?this.searchRef.current.offsetWidth:300,O=gt("form-multiple-tree-table-helper"),{size:R}=a.context,k={[O]:!0,[`${O}--lg`]:"large"===R,[`${O}--sm`]:"small"===R};null===(n=(t=this.props).setOmitClassNames)||void 0===n||n.call(t,[`.${O}`]);const L=s.filter((e=>null==u?void 0:u.includes(e.value))).map((e=>e.text)).join(",");return a.isOnlyShow?q.default.createElement(Mr,{value:L,bordered:v}):q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},q.default.createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},q.default.createElement(xs,{popupVisible:!x&&i,popup:T,popupClassName:J.default(k),popupStyle:{minWidth:I},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:or,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement(d.Select,{mode:"multiple",maxTagCount:E?"responsive":void 0,maxTagTextLength:C,open:!1,value:u,placeholder:h,loading:o,bordered:v,allowClear:y,disabled:x,style:Object.assign({width:"100%"},m),title:L,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{var t,l;const n=e.target;n.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(l=(t=this.props).setCurrentElement)||void 0===l||l.call(t,n),this.setState({visible2:!0}))},onDoubleClick:()=>{x||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},s.map((e=>q.default.createElement(d.Select.Option,{key:e.value,value:e.value},e.text))))),q.default.createElement("span",{className:"ant-input-group-addon"},q.default.createElement(d.Button,{className:"ant-input-search-button",disabled:x,icon:q.default.createElement(g.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),q.default.createElement(Qn,w,q.default.createElement(Fc,S)))}};Hc.contextType=Zn,Hc=Te([Oc],Hc);class qc extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ie(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){ct("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return ft("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ie(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=wr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:u,extra:c,buttonAfter:f,validateTrigger:p,rules:m=[],onChange:h=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":$e(s)},required:e.getFormItemRequired(m)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:r,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(Hc,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,l,n)=>{h(t,n),e.setViewValue(r,l)}}))),f&&q.default.createElement(d.Col,null,e.renderFormItemButton(r,f)),c&&q.default.createElement(d.Col,{flex:$e(c.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}qc.contextType=Zn;const $c="_startSign",jc="_endSign",Kc=e=>{var t;const{uniqueKey:n,initialValue:a,filters:r=[],table:i={},onClose:o}=e,{$size:s}=dt(e),{t:u}=ot(),c=q.default.useRef(null),f=q.default.useRef(null),p=q.default.useRef(null),m=xn(c),[h,v]=q.default.useState(i),[y,b]=q.default.useState(!1),[x,E]=q.default.useState([]),[C,w]=q.default.useState(300),[S,N]=q.default.useState(r),[T,I]=q.default.useState((e=>[{title:u("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>q.default.createElement("span",null,e+1)},{title:u("qm.form.rangeSearchHelper")[0],dataIndex:$c,width:80,align:"right",render:(e,t)=>q.default.createElement("span",{className:"icon-sign"},e)},...e||(i.columns||[]),{title:u("qm.form.rangeSearchHelper")[1],dataIndex:jc,fixed:"right",width:80,render:(e,t)=>q.default.createElement("span",{className:"icon-sign"},e)}])()),[O,R]=q.default.useState(l.merge({},null===(t=i.fetch)||void 0===t?void 0:t.params,a)),[k,L]=q.default.useState([]),P=q.default.useMemo((()=>x.map((e=>null==e?void 0:e.pageIndex))),[x]),A=q.default.useMemo((()=>2===P.length&&P.every((e=>void 0!==e))),[P]),F=()=>{const e=c.current.parentNode.children[0],t=e.querySelector(".form-wrap");w(e.offsetHeight-t.offsetHeight-2*Jr[s]-30)},_=wn(F,5);Cn((()=>{_()}),[m.width]),Yl((()=>{l.isEqual(r,S)||N(r)}),[r]),q.default.useEffect((()=>{D()}),[O]);const D=()=>Ie(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=h;if(!t||!(null==n?void 0:n.api))return;const{api:a,dataKey:r,beforeFetch:i=Pe}=n;if(i(O)){b(!0);try{const t=yield a(O);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=l.get(t.data,r))&&void 0!==e?e:[];L(n)}}catch(e){}b(!1)}})),M=(e,t)=>{delete e[t]},H=()=>{x.forEach((e=>{e&&(M(e,$c),M(e,jc))})),E([])},$=e=>{H(),R(Object.assign({},O,e))},j=gt("range-helper"),K=h.webPagination?{dataSource:k,loading:y,webPagination:!0}:{fetch:Object.assign(Object.assign({},h.fetch),{params:O})};return q.default.createElement("div",{ref:c,className:`${j}--wrapper`},q.default.createElement("div",{className:"form-wrap"},S.length?q.default.createElement(ap,{ref:f,items:S,initialValues:a,uniqueKey:n,formType:"search",disabled:!1,isAutoFocus:!1,fieldsChange:e=>N(e),onCollapse:()=>F(),onFinish:e=>$(e),onReset:()=>Ie(void 0,void 0,void 0,(function*(){const[e,t]=yield f.current.GET_FORM_DATA();e||$(t)}))}):null),q.default.createElement("div",null,q.default.createElement(wc,tt({ref:p,height:C,columns:T,rowKey:h.rowKey||"pageIndex",rowStyle:e=>e.pageIndex>=P[0]&&e.pageIndex<=P[1]?{backgroundColor:"#f5f5f5"}:{}},K,{columnsChange:e=>I(e),onRowClick:(e,t)=>{const{dataIndex:l}=t;[$c,jc].includes(l)&&(l===$c&&(e[l]?(M(e,l),E([void 0,x[1]])):e.pageIndex>P[1]?d.message.warning(u("qm.searchHelper.rangeStartTip")):(x[0]&&M(x[0],l),e[l]="[",E([e,x[1]]))),l===jc&&(e[l]?(M(e,l),E([x[0],void 0])):e.pageIndex<P[0]?d.message.warning(u("qm.searchHelper.rangeEndTip")):(x[1]&&M(x[1],l),e[l]="]",E([x[0],e]))),p.current.FORCE_UPDATE())},onDataLoad:e=>{e.forEach((e=>{e.pageIndex===P[0]&&(e[$c]="["),e.pageIndex===P[1]&&(e[jc]="]")}))}}),q.default.createElement(pt,{type:"primary",icon:q.default.createElement(g.ClearOutlined,null),title:u("qm.table.alert.clear"),onClick:()=>H()}))),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Jr[s]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},q.default.createElement(pt,{onClick:()=>o(null),style:{marginRight:8}},u("qm.dialog.cancel")),q.default.createElement(pt,{type:"primary",disabled:!A,onClick:()=>o(x.map((e=>(e=>{const t={};for(const l in e)[$c,jc].includes(l)||(t[l]=e[l]);return t})(e))))},u("qm.dialog.confirm"))))};Kc.displayName="RangeTableHelper";const Vc=new Array(2).fill("");class zc extends e.Component{constructor(e){super(e),this._is_change=!1,this._records=[],this._is_clear=!1,this.state={visible:!1,loading:!1,itemList:[],textValue:Vc},this.getSearchHelper=oe.default((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||ft("Form","RANGE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||ft("Form","RANGE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setItemList=e=>{this.setState({itemList:e})},this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setTextValue=e=>{this.setState({textValue:e})},this.setRecords=e=>{this._records=e},this.setViewValue=()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;e.setViewValue(t,this.createViewText())},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props;this._is_change=!1,null==t||t(e),l(e,this.createViewText(),this._records)},this.clearSearchHelperValue=()=>{this.setRecords([]),this.setTextValue(Vc),this.triggerChange([])},this.closeSearchHelper=e=>{const{valueKey:t,textKey:l}=this.alias,n=e.map((e=>({value:e[t],text:e[l]})));this.setRecords(e),this.setItemList(n),this.setTextValue(n.map((e=>{var t;return null!==(t=e.text)&&void 0!==t?t:""}))),this.triggerChange(e.map((e=>e[t])));const{closed:a}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==a?void 0:a(this._records)),200)}))},this.openSearchHelper=e=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:l}=this.searchHelper,n=(null!=l?l:Pe)(t.state.formData);(null==n?void 0:n.then)?n.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),null==e||e())})),this.createFilters=e=>{const{fieldName:t}=this.props.option;return{[t]:De(e)?void 0:e}},this.getSearchHelperTableData=e=>{const{table:t,initialValue:n={}}=this.searchHelper,{beforeFetch:a=Pe,formatter:r=(e=>e)}=t.fetch;return new Promise(((i,o)=>Ie(this,void 0,void 0,(function*(){var s;const d=l.merge({},this.searchHelper.table.fetch.params,Object.assign(Object.assign({},n),r(this.createFilters(e))),{currentPage:1,pageSize:500});try{if(!a(d))return o();this.setState({loading:!0});const e=yield t.fetch.api(d);if(Fe((()=>this.setState({loading:!1}))),200===e.code){const n=Array.isArray(e.data)?e.data:null!==(s=l.get(e.data,t.fetch.dataKey))&&void 0!==s?s:[];return i(n)}}catch(e){this.setState({loading:!1})}o()}))))},this.resetSearchHelperValue=(e=[])=>Ie(this,void 0,void 0,(function*(){const{textValue:t}=this.state,{textKey:l}=this.alias,n=e.filter((e=>{var n;const a=null===(n=e[l])||void 0===n?void 0:n.toString().toLowerCase();return t.some((e=>null==a?void 0:a.includes(e.toLowerCase())))}));if(2===n.length)return this.closeSearchHelper(n);this.openSearchHelper()})),this.closeButNotSelect=()=>{this._is_change&&this.clearSearchHelperValue(),this.setVisible(!1)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e){const{value:t=[]}=e,{value:n=[]}=this.props;l.isEqual(t,n)||l.isEqual(n,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList();const{echo_data:a}=this.context,{fieldName:r}=this.props.option;if(!l.isEqual(a[r],this._ceho_data)&&(this._ceho_data=a[r],this.setItemList(a[r]),n.length)){const e=Vc.map(((e,t)=>{var l,i;return null!==(i=null===(l=a[r].find((e=>e.value===n[t])))||void 0===l?void 0:l.text)&&void 0!==i?i:""}));this.setTextValue(e)}}getItemList(){var e;return Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:t,valueKey:n}=this.alias,{fetchApi:a,params:r={},formatter:i=(e=>e),dataKey:o,fieldAliasMap:s}=this.searchHelper.echoRequest||{},d="function"==typeof s?s():s||{},{value:u}=this.props;if(a){if(De(u))return this.setRecords([]);this.setState({loading:!0});try{const s=yield a(i(Object.assign(Object.assign({},r),{keys:u})));if(200===s.code){let a=Array.isArray(s.data)?s.data:null!==(e=l.get(s.data,o))&&void 0!==e?e:[];a.forEach((e=>{(null==d?void 0:d.valueKey)&&d.valueKey!==n&&(e[n]=e[d.valueKey]),(null==d?void 0:d.textKey)&&d.textKey!==t&&(e[t]=e[d.textKey])})),a=a.filter((e=>u.includes(e[n]))).slice(0,2);const r=a.map((e=>({value:e[n],text:e[t]})));this.setRecords(a),this.setItemList(r),this.setTextValue(r.map((e=>{var t;return null!==(t=e.text)&&void 0!==t?t:""}))),this.setViewValue()}}catch(e){}this.setState({loading:!1})}}))}createViewText(){const{textKey:e}=this.alias;return this._records.map((t=>t[e])).join(" - ")}render(){var e;const{$$form:t}=this.context;this.props;const{visible:n,loading:a,textValue:r}=this.state,{fieldName:i,options:o={},searchHelper:s={},placeholder:u=Se("qm.form.rangeInputNumberPlaceholder"),bordered:c=!0,readOnly:f,disabled:p}=this.props.option,{onlySelect:m=!0}=this.searchHelper||s,h=r.every((e=>hr(e)))?"":r.join(" - "),g={visible:n,title:Se("qm.searchHelper.text"),width:null!==(e=s.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${i}`,loading:!1,bodyStyle:{paddingBottom:`${Jr[t.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},v=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:t.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${i}`:"",initialValue:l.merge({},s.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}});return t.isOnlyShow?q.default.createElement(Mr,{value:h,bordered:c}):q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Input.Group,null,q.default.createElement(d.Input,{value:r[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:u[0],allowClear:!1,bordered:c,readOnly:f,disabled:p,onBlur:e=>{var t,l;const{value:a}=e.target;this._is_change&&!n&&(a?r.every((e=>!!e))&&(null===(l=null===(t=this.searchHelper.table)||void 0===t?void 0:t.fetch)||void 0===l?void 0:l.api)&&this.getSearchHelperTableData(r).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):r.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;m||(this._is_change=!0,this.setTextValue([t,r[1]]))}}),q.default.createElement(d.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:c,disabled:p,readOnly:!0}),q.default.createElement(d.Input.Search,{value:r[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:u[1],loading:a,bordered:c,allowClear:!0,readOnly:f,disabled:p,onBlur:e=>{var t,l;const{value:a}=e.target;this._is_change&&!n&&(a?r.every((e=>!!e))&&(null===(l=null===(t=this.searchHelper.table)||void 0===t?void 0:t.fetch)||void 0===l?void 0:l.api)&&this.getSearchHelperTableData(r).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):r.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;this._is_clear?this._is_clear=!1:m||(this._is_change=!0,this.setTextValue([r[0],t]))},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper():(this._is_clear=!0,this.clearSearchHelperValue()))}})),q.default.createElement(Qn,g,q.default.createElement(Kc,v)))}}zc.contextType=Zn;class Wc extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ie(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){ct("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return ft("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ie(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=wr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,labelWidth:o=e.props.labelWidth,className:s,extra:u,buttonAfter:c,validateTrigger:f,rules:p=[],onChange:m=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(n),className:J.default(s),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(p)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:r,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(zc,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,l,n)=>{m(t,n),e.setViewValue(r,l)}}))),c&&q.default.createElement(d.Col,null,e.renderFormItemButton(r,c)),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:r},u)))))}}Wc.contextType=Zn;const Bc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,items:n,onChange:a,onValuesChange:r}=e,{options:i={},style:o={},bordered:s=!1,readOnly:u,disabled:c}=e.option,{itemList:f=[]}=i,p=De(f)?n:f,m=e=>p.filter((t=>e.includes(t.value))).map((e=>e.text)).join(",");return t.isOnlyShow?q.default.createElement(Mr,{value:m(l),bordered:s}):q.default.createElement(d.Checkbox.Group,{value:l,style:Object.assign({width:"100%"},o),disabled:c,onChange:e=>{(e=>{null==a||a(e),r(e,m(e))})(e)}},p.map((e=>q.default.createElement(d.Checkbox,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class Uc extends e.Component{constructor(){super(...arguments),this.state={itemList:[]}}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const a=null===(t=e.option.request)||void 0===t?void 0:t.params,r=null===(n=this.props.option.request)||void 0===n?void 0:n.params;l.isEqual(a,r)||this.getItemList()}getItemList(){var e;return Ie(this,void 0,void 0,(function*(){const{request:t={}}=this.props.option,{fetchApi:n,params:a={},dataKey:r,valueKey:i="value",textKey:o="text",callback:s}=t;if(n)try{const t=yield n(a);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=l.get(t.data,r))&&void 0!==e?e:[],a=n.map((e=>({value:e[i],text:e[o]})));this.setState({itemList:a},(()=>null==s?void 0:s(n)))}}catch(e){}}))}render(){const{$$form:e}=this.context,{itemList:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:u,extra:c,validateTrigger:f,rules:p=[],onChange:m=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":$e(s)},required:e.getFormItemRequired(p)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:r,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(Bc,{option:this.props.option,items:t,onValuesChange:(t,l)=>{m(t),e.setViewValue(r,l)}}))),c&&q.default.createElement(d.Col,{flex:$e(c.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}Uc.contextType=Zn;const Gc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{options:r={},style:i={},allowClear:o=!0,readOnly:s,disabled:u=t.isFormDisabled}=e.option,{allowHalf:c,count:f=5,tooltips:p}=r,m=e=>p?p[Math.ceil(e)-1]:e.toString();return q.default.createElement(d.Rate,{value:l,count:f,style:i,allowHalf:c,allowClear:o,tooltips:p,disabled:u||t.isOnlyShow,onChange:e=>{(e=>{null==n||n(e),a(e,m(e))})(e)}})};class Yc extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Gc,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Yc.contextType=Zn;const Xc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,items:n,onChange:a,onValuesChange:r}=e,{options:i={},style:o={},bordered:s=!1,readOnly:u,disabled:c=t.isFormDisabled}=e.option,{itemList:f=[]}=i,p=De(f)?n:f,m=e=>{var t,l;return null!==(l=null===(t=p.find((t=>t.value===e)))||void 0===t?void 0:t.text)&&void 0!==l?l:""};return t.isOnlyShow?q.default.createElement(Mr,{value:m(l),bordered:s}):q.default.createElement(d.Radio.Group,{value:l,style:Object.assign({width:"100%"},o),disabled:c||t.isOnlyShow,onChange:e=>{const{value:t}=e.target;(e=>{null==a||a(e),r(e,m(e))})(t)}},p.map((e=>q.default.createElement(d.Radio,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class Qc extends e.Component{constructor(){super(...arguments),this.state={itemList:[]},this.getItemList=()=>Ie(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:a={},dataKey:r,valueKey:i="value",textKey:o="text",callback:s}=t;if(n)try{const t=yield n(a);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=l.get(t.data,r))&&void 0!==e?e:[],a=n.map((e=>({value:e[i],text:e[o]})));this.setState({itemList:a},(()=>null==s?void 0:s(n)))}}catch(e){}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const a=null===(t=e.option.request)||void 0===t?void 0:t.params,r=null===(n=this.props.option.request)||void 0===n?void 0:n.params;l.isEqual(a,r)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:u,extra:c,validateTrigger:f,rules:p=[],onChange:m=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":$e(s)},required:e.getFormItemRequired(p)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:r,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(Xc,{option:this.props.option,items:t,onValuesChange:(t,l)=>{m(t),e.setViewValue(r,l)}}))),c&&q.default.createElement(d.Col,{flex:$e(c.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}Qc.contextType=Zn;const Zc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{label:r,options:i={},style:o={},readOnly:s,disabled:u=t.isFormDisabled}=e.option,{labelToSwitch:c,falseValue:f=ar,trueValue:p=nr}=i,{t:m}=ot();return q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Switch,{checked:l===p,style:o,disabled:u||t.isOnlyShow,checkedChildren:q.default.createElement(g.CheckOutlined,null),unCheckedChildren:q.default.createElement(g.CloseOutlined,null),onChange:e=>{(e=>{null==n||n(e),a(e,m(e===p?"am.form.trueText":"am.form.falseText"))})(e?p:f)}}),c?q.default.createElement("span",{style:{verticalAlign:"middle",marginLeft:8}},r):null)};class Jc extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option,{labelToSwitch:m}=i;return q.default.createElement(d.Form.Item,{label:m?" ":e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Zc,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Jc.contextType=Zn;const ef=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{t:r}=ot(),{options:i={},style:o={},placeholder:s=r("qm.form.inputPlaceholder"),bordered:u=!0,allowClear:c,translate:f,readOnly:p,disabled:m,onFocus:h,onBlur:g,onEnter:v}=e.option,{showCount:y,maxLength:b,autoSize:x}=i,E=Object.assign({},{minRows:1,maxRows:3},x),C=q.default.createElement(d.Input.TextArea,{value:l,placeholder:s,style:o,maxLength:b,showCount:y,autoSize:E,bordered:u,allowClear:c,readOnly:p||t.isOnlyShow,disabled:m,onFocus:e=>{null==h||h(e.target.value,e)},onBlur:t=>{const{value:l}=t.target;(t=>{const{onBlur:l}=e;null==l||l(t)})(l),null==g||g(l,t)},onKeyUp:e=>{if(13===e.keyCode){const{value:t}=e.target;null==v||v(t,e)}},onChange:e=>{const{value:t}=e.target;(e=>{null==n||n(e),a(e)})(t)}});return f?q.default.createElement(Hr,{text:l},C):C};class tf extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(ef,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,t)}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}tf.contextType=Zn;const lf=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{t:r}=ot(),{fieldName:i,options:o={},style:s={},placeholder:u=r("qm.form.datePlaceholder"),bordered:c=!0,allowClear:f=!0,readOnly:p,disabled:m}=e.option,{dateType:h="date",format:g,disabledDate:v,minDateTime:y,maxDateTime:b,shortCuts:x=!0}=o,E=q.default.createRef(),C=e=>{e&&"date"===h&&(e=e.slice(0,10)+" 00:00:00"),null==n||n(e),a(e,w(e))},w=e=>hr(e)?"":["date","exactdate"].includes(h)?e.slice(0,10):e,S=e=>{let t=mr(j.default().subtract(e,"day"),dr[h]);"date"===h&&(t=t.slice(0,10)),C(t),E.current.blur(),E.current.focus()};return t.isOnlyShow?q.default.createElement(Mr,{value:w(l),bordered:c}):q.default.createElement(et,{ref:E,style:Object.assign({width:"100%"},s),popupClassName:`form-popper__${i}`,picker:sr[h],format:g,bordered:c,showToday:!1,showTime:"datetime"===h&&{defaultValue:j.default("00:00:00","HH:mm:ss")},allowClear:f,disabled:m,inputReadOnly:p,disabledDate:null!=v?v:e=>((e,[t,l])=>t&&l?e.isBefore(t,"day")||e.isAfter(l,"day"):t?e.isBefore(t,"day"):!!l&&e.isAfter(l,"day"))(e,[y,b]),renderExtraFooter:x&&h.includes("date")?()=>"function"==typeof x?x():q.default.createElement(q.default.Fragment,null,q.default.createElement(d.Tag,{color:"processing",onClick:()=>S(0)},r("qm.form.datePickers")[0]),q.default.createElement(d.Tag,{color:"processing",onClick:()=>S(1)},r("qm.form.datePickers")[1]),q.default.createElement(d.Tag,{color:"processing",onClick:()=>S(7)},r("qm.form.datePickers")[2]),q.default.createElement(d.Tag,{color:"processing",onClick:()=>S(30)},r("qm.form.datePickers")[3])):void 0,value:pr(l,dr[h]),onChange:(e,t)=>{C(mr(e,dr[h]))}})};class nf extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(lf,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}nf.contextType=Zn;const af=e=>[j.default().subtract(e,"day"),j.default()],rf=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{t:r}=ot(),{fieldName:i,options:o={},style:s={},placeholder:d=r("qm.form.daterangePlaceholder"),bordered:u=!0,allowClear:c=!0,readOnly:f,disabled:p=t.isFormDisabled}=e.option,{dateType:m="date",format:h,disableds:g=[!1,!1],allowEmpty:v,disabledDate:y,minDateTime:b,maxDateTime:x,shortCuts:E=!0}=o,C={[r("qm.form.dateRangePickers")[0]]:af(7),[r("qm.form.dateRangePickers")[1]]:af(30),[r("qm.form.dateRangePickers")[2]]:af(90),[r("qm.form.dateRangePickers")[3]]:af(180)},w=e=>hr(e)?"":e.map((e=>["date","exactdate"].includes(m)?null==e?void 0:e.slice(0,10):e)).join(" - ");return t.isOnlyShow?q.default.createElement(Mr,{value:w(l),bordered:u}):q.default.createElement(et.RangePicker,{style:Object.assign({width:"100%"},s),popupClassName:`form-popper__${i}`,picker:sr[m],format:h,bordered:u,showTime:"datetime"===m&&{defaultValue:[j.default("00:00:00","HH:mm:ss"),j.default("23:59:59","HH:mm:ss")]},allowClear:c,allowEmpty:v,disabled:p?[!0,!0]:g,inputReadOnly:f,disabledDate:null!=y?y:e=>((e,[t,l])=>t&&l?e.isBefore(t,"day")||e.isAfter(l,"day"):t?e.isBefore(t,"day"):!!l&&e.isAfter(l,"day"))(e,[b,x]),ranges:E&&m.includes("date")?C:void 0,value:De(l)?null:[pr(null==l?void 0:l[0],dr[m]),pr(null==l?void 0:l[1],dr[m])],onChange:(e,t)=>{(e=>{"date"===m&&(e=e.map(((e,t)=>e?0===t?e.slice(0,10)+" 00:00:00":e.slice(0,10)+" 23:59:59":e))),e.every((e=>!e))&&(e=[]),null==n||n(e),a(e,w(e))})([mr(null==e?void 0:e[0],dr[m]),mr(null==e?void 0:e[1],dr[m])])}})};class of extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(rf,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}of.contextType=Zn;const sf=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{t:r}=ot(),{fieldName:i,options:o={},style:s={},placeholder:d=r("qm.form.timePlaceholder"),bordered:u=!0,allowClear:c=!0,readOnly:f,disabled:p}=e.option,{timeType:m="hour-minute-second",hourStep:h=1,minuteStep:g=1,secondStep:v=1}=o;return t.isOnlyShow?q.default.createElement(Mr,{value:l,bordered:u}):q.default.createElement(lt,{style:Object.assign({width:"100%"},s),popupClassName:`form-popper__${i}`,bordered:u,showNow:!0,hourStep:h,minuteStep:g,secondStep:v,allowClear:c,disabled:p,inputReadOnly:f,format:ur[m],value:pr(l,ur[m]),onChange:(e,t)=>{(e=>{const t=mr(e,ur[m]);null==n||n(t),a(t)})(e)}})};class df extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(sf,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,t)}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}df.contextType=Zn;const uf=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{t:r}=ot(),{fieldName:i,options:o={},style:s={},placeholder:d=r("qm.form.timerangePlaceholder"),bordered:u=!0,allowClear:c=!0,readOnly:f,disabled:p=t.isFormDisabled}=e.option,{timeType:m="hour-minute-second",disableds:h=[!1,!1],allowEmpty:g,hourStep:v=1,minuteStep:y=1,secondStep:b=1}=o,x=e=>hr(e)?"":e.join(" - ");return t.isOnlyShow?q.default.createElement(Mr,{value:x(l),bordered:u}):q.default.createElement(lt.RangePicker,{style:Object.assign({width:"100%"},s),popupClassName:`form-popper__${i}`,bordered:u,showNow:!1,hourStep:v,minuteStep:y,secondStep:b,allowClear:c,allowEmpty:g,disabled:p?[!0,!0]:h,inputReadOnly:f,format:ur[m],value:De(l)?null:[pr(null==l?void 0:l[0],ur[m]),pr(null==l?void 0:l[1],ur[m])],onChange:(e,t)=>{(e=>{const t=[mr(null==e?void 0:e[0],ur[m]),mr(null==e?void 0:e[1],ur[m])];null==n||n(t),a(t,x(t))})(e)}})};class cf extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(uf,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}cf.contextType=Zn;class ff extends e.Component{constructor(e){super(e),this.searchRef=q.default.createRef(),this._clicking=!1,this._prevValue=null,this.state={itemList:[],visible:!1,loading:!1,activeIndex:0,inputText:void 0},this.getSearchHelper=oe.default(((e,t)=>Object.assign({},this.props.helperConfig,e,t))),this.paramsChangeHandler=(e,t)=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting(),l.isEqual(e,t)||this.getItemList()})),this.echoSearchHelper=()=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const e=this.getItemValue();e!==this._prevValue&&(this.getItemText(),this._prevValue=e)})),this.initialHandle=()=>Ie(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e,options:t,searchHelper:l}=this.props.option,{fieldAliasMap:n,fieldsDefine:a,echoRequest:r}=this.searchHelper;if(n||ft("Form","IMMEDIATE 需要配置 `fieldAliasMap` 选项"),a){const e=["valueKey","displayKey","extraKey"];for(const t in a)e.includes(t)&&(this[t]=a[t])}Object.keys(this.alias).includes(e)||ft("Form","IMMEDIATE 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),r&&!this.valueKey&&ft("Form","IMMEDIATE 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用"),t&&!l&&ft("Form","IMMEDIATE 的 `options` 选项即将在下一个大版本中废弃,请使用 `searchHelper` 参数")})),this.getItemValue=()=>this.context.$$form.GET_FIELDS_VALUE([this.valueKey])[this.valueKey],this.getItemText=()=>Ie(this,void 0,void 0,(function*(){var e;const{fetchApi:t,params:n={},formatter:a=(e=>e),dataKey:r,callback:i,triggeredChange:o,fieldAliasMap:s,extraAliasMap:d}=this.searchHelper.echoRequest||{},u="function"==typeof s?s():s||{},c="function"==typeof d?d():d||{},f=this.getItemValue();if(t&&!De(f))try{const s=yield t(a(Object.assign(Object.assign({},n),{key:f})));if(200===s.code){const t=Array.isArray(s.data)?s.data:null!==(e=l.get(s.data,r))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(u&&vr(e,this.alias,u),c&&yr(e,this.extras,c),this._record=e,this.setFieldsValue(e),o){const t=gr(e,this.alias[this.props.option.fieldName]);this.triggerChange(t)}null==i||i([e])}}}catch(e){}})),this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;this._record=e;for(const n in this.alias){const a=gr(e,this.alias[n]);t.SET_FIELDS_VALUE({[n]:a}),n===this.valueKey&&(this._prevValue=a),n===l&&t.setViewValue(l,a)}for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:gr(e,this.extras[l])})},this.fetchHandle=l.debounce(this.getItemList,200),this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(e,this._record)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.clickHandle=(e,t)=>{const{$$form:l}=this.context,{fieldName:n}=this.props.option;for(const t in this.alias){if(t===n)continue;const a=gr(e,this.alias[t]);l.SET_FIELDS_VALUE({[t]:a}),t===this.valueKey&&(this._prevValue=e?a:null)}for(const t in this.extras)l.SET_FIELDS_EXTRA({[t]:gr(e,this.extras[t])});this.searchRef.current.focus({cursor:"end"}),this._record=e;const a=gr(e,this.alias[n]);this.triggerChange(a),this.setState({inputText:void 0}),t&&t()},this.initialHandle()}get searchHelper(){return this.getSearchHelper(this.props.option.options,this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidUpdate(e){var t,l,n,a,r,i;const o=(null===(l=null===(t=e.option.searchHelper)||void 0===t?void 0:t.request)||void 0===l?void 0:l.params)||(null===(n=e.option.request)||void 0===n?void 0:n.params),s=(null===(r=null===(a=this.props.option.searchHelper)||void 0===a?void 0:a.request)||void 0===r?void 0:r.params)||(null===(i=this.props.option.request)||void 0===i?void 0:i.params);this.paramsChangeHandler(s,o),this.echoSearchHelper()}getItemList(e){var t;return Ie(this,void 0,void 0,(function*(){const{fieldName:n}=this.props.option,{fetchApi:a,params:r={},formatter:i=(e=>e),dataKey:o}=this.searchHelper.request||this.props.option.request||{};if(a){this.setState({loading:!0});try{const s=yield a(i(Object.assign(Object.assign({},r),{[n]:e})));if(200===s.code){const e=Array.isArray(s.data)?s.data:null!==(t=l.get(s.data,o))&&void 0!==t?t:[];this.setState({itemList:e,activeIndex:0})}}catch(e){}this.setState({loading:!1})}}))}render(){const{$$form:e}=this.context,{visible:t,loading:n,itemList:a,inputText:r}=this.state,{value:i}=this.props,{fieldName:o,options:s={},style:u={},placeholder:c=Se("qm.form.inputPlaceholder"),bordered:f=!0,allowClear:p=!0,translate:m,readOnly:h,disabled:g}=this.props.option,{listHeight:v=rr}=s,{hideHeader:y,onlySelect:b=!0}=this.searchHelper||s,x=this.searchHelper.columns||[],E=gt("form-immediate"),C=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,w=q.default.createElement(d.Spin,{spinning:n},a.length?q.default.createElement("table",{cellSpacing:0,cellPadding:0,className:J.default("table")},!y&&q.default.createElement("thead",null,q.default.createElement("tr",null,x.filter((e=>!e.hidden)).map((e=>q.default.createElement("th",{key:e.dataIndex,style:{width:`${e.width}px`,backgroundColor:"#f0f0f0"}},e.title))))),q.default.createElement("tbody",null,a.map(((e,t)=>q.default.createElement("tr",{key:t,className:this.state.activeIndex===t?"active":"",onMouseEnter:()=>{this.setState({activeIndex:t})},onMouseDown:()=>{this._clicking=!0},onMouseUp:()=>{this._clicking=!1},onClick:()=>{this.clickHandle(e,(()=>this.handleVisibleChange(!1)))}},x.filter((e=>!e.hidden)).map((t=>q.default.createElement("td",{key:t.dataIndex},l.get(e,t.dataIndex))))))))):q.default.createElement(pn,null)),S=q.default.createElement(xe.Consumer,null,(l=>{const n={[E]:!0,[`${E}--lg`]:"large"===(null==l?void 0:l.size),[`${E}--sm`]:"small"===(null==l?void 0:l.size)};return e.isOnlyShow?q.default.createElement(Mr,{value:i,bordered:f}):q.default.createElement(xs,{action:g?[]:["click"],popupVisible:!g&&t,popup:w,popupClassName:J.default(n,`form-popper__${o}`),popupStyle:{minWidth:C,maxHeight:v},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:or,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement("div",null,q.default.createElement(d.Input,{ref:this.searchRef,placeholder:c,allowClear:p,bordered:f,readOnly:h,disabled:g,style:Object.assign({width:"100%"},u),value:null!=r?r:i,title:i,onFocus:()=>{!a.length&&this.fetchHandle(i)},onBlur:e=>{b&&!this._clicking&&r!==i&&this.setState({inputText:void 0}),this.triggerBlur(e.target.value)},onKeyDown:e=>{if(27===e.keyCode&&this.handleVisibleChange(!1),13===e.keyCode&&this.clickHandle(a[this.state.activeIndex],(()=>this.handleVisibleChange(!1))),38===e.keyCode||40===e.keyCode){if(!this.state.visible)return this.handleVisibleChange(!0);let t=this.state.activeIndex;const l=40===e.keyCode?++t%a.length:(--t+a.length)%a.length;this.setState({activeIndex:l})}},onChange:e=>{const{value:t}=e.target;this.fetchHandle(t),b?this.setState({inputText:t}):t&&this.triggerChange(t),t?this.handleVisibleChange(!0):this.clickHandle(null)}})))}));return m?q.default.createElement(Hr,{text:i},S):S}}ff.contextType=Zn;class pf extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ie(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){ct("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return ft("immediate","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ie(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=wr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:u,extra:c,buttonAfter:f,validateTrigger:p,rules:m=[],onChange:h=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":$e(s)},required:e.getFormItemRequired(m)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:r,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(ff,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t="",l)=>{h(t,l),e.setViewValue(r,t)}}))),f&&q.default.createElement(d.Col,null,e.renderFormItemButton(r,f)),c&&q.default.createElement(d.Col,{flex:$e(c.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}pf.contextType=Zn;class mf extends e.Component{render(){var e;const{$$form:t}=this.context,{type:l,label:n,fieldName:a,className:r,style:i={},collapse:o={}}=this.props.option,{expand:s}=t.state,{showLimit:u,remarkItems:c=[],onCollapse:f=Le}=o,p=[];if(c.length){const l=null!==(e=t.getBlockDerivedItems().find((e=>e[0].fieldName===a)))&&void 0!==e?e:[],n=null!=u?u:l.length-1;l.slice(n+1).forEach((e=>{var l;const n=c.find((t=>t.fieldName===e.fieldName));if(!n)return;const a=n.showLabel?`${e.label}:`:"",r=null!==(l=t.getViewValue(e.fieldName))&&void 0!==l?l:"";""!==r&&p.push(Object.assign(Object.assign({},e),{text:`${a}${r}`}))}))}return q.default.createElement(d.Form.Item,{labelCol:{span:0},wrapperCol:{span:24}},q.default.createElement(vt,{id:a,label:n,className:r,extra:p.map((e=>e.text)).join(" | "),style:Object.assign({},i),collapse:s[a],onCollapseChange:e=>{t.setState((t=>({expand:Object.assign({},t.expand,{[a]:e})}))),f(e)}}))}}mf.contextType=Zn;const hf=(e,t,l,n)=>e.map((e=>e[l]===t?Object.assign(Object.assign({},e),{children:n}):e.children?Object.assign(Object.assign({},e),{children:hf(e.children,t,l,n)}):e)),gf=e=>{var t;const{$$form:n}=q.default.useContext(Zn),{value:a,items:r,multiple:i,loading:o,onChange:s,onValuesChange:u}=e,{t:c}=ot(),{fieldName:f,options:p={},style:m={},placeholder:h=c("qm.form.selectPlaceholder"),bordered:g=!0,allowClear:v=!0,asyncLoad:y,translate:b,readOnly:x,disabled:E}=e.option,{itemList:C,filterable:w=!0,listHeight:S=rr,checkStrictly:N,checkStrategy:T="SHOW_CHILD",collapseTags:I,echoRequest:O,defaultExpandAll:R=!y,defaultExpandedKeys:k,dropdownStyle:L,openPyt:P=!0}=p,[A,F]=q.default.useState(De(C)?r:C),[_,D]=q.default.useState([]),[M,H]=q.default.useState(!1),[$,j]=q.default.useState(!1),K=q.default.useRef(null),V=q.default.useRef(null),z=q.default.useRef(A),W=q.default.useRef($),B=q.default.useRef(null),U=e=>{j(e),W.current=e};Hd({ref:V,handler:()=>U(!1)}),q.default.useEffect((()=>{a!==B.current&&(X(),B.current=a),(()=>{var e;V.current=(null===(e=K.current)||void 0===e?void 0:e.querySelector(".ant-select-selection-overflow-item-rest"))||null})()}),[a]),Yl((()=>{const e=De(C)?r:C;y?l.isEqual(e,z.current)||(F((t=>[...e,...t.filter((e=>!!e.style))])),z.current=e):F(e)}),[C,r]),Yl((()=>{F((e=>[...e,..._.filter((t=>!e.some((e=>e.value===t.value))))]))}),[_]);const G=e=>{var t;return(null===(t=xr(A,e))||void 0===t?void 0:t.text)||(null==e?void 0:e.toString())||""},Y=e=>(N&&Array.isArray(a)&&a.every((e=>l.isPlainObject(e)))&&(e=e.map((e=>e.value))),i?(null==e?void 0:e.map((e=>G(e))).join(","))||"":G(e)),X=()=>Ie(void 0,void 0,void 0,(function*(){var e;if(!O)return;if(!y)return ft("Form","TREE_SELECT 的 echoRequest 选项必须组合 `asyncLoad` 一起使用");const{fetchApi:t,params:n,dataKey:r,callback:i,formatter:o=(e=>e)}=O||{},{textKey:s="text",valueKey:d="value"}=y;if(t&&!De(a))try{const u=yield t(o(Object.assign(Object.assign({},n),{[d]:a})));if(200===u.code){const t=Array.isArray(u.data)?u.data:null!==(e=l.get(u.data,r))&&void 0!==e?e:[];if(t.length){const e=br(t,d,s);D(e.map((e=>Object.assign(Object.assign({},e),{style:{display:"none"}})))),null==i||i(t)}}}catch(e){}})),Q=n.isOnlyShow?q.default.createElement(Mr,{value:Y(a),bordered:g}):q.default.createElement(xs,{popupVisible:!E&&$,popup:(()=>{if(!i)return null;const e=(null==a?void 0:a.map((e=>G(e))))||[];return q.default.createElement("ul",{className:"ant-dropdown-menu"},e.length?e.map(((e,t)=>q.default.createElement("li",{key:`${e}-${t}`,className:"ant-dropdown-menu-item"},e))):q.default.createElement("li",{className:"ant-dropdown-menu-item"},c("qm.table.config.emptyText")))})(),popupStyle:{minWidth:null===(t=K.current)||void 0===t?void 0:t.offsetWidth},onPopupVisibleChange:e=>U(e),builtinPlacements:or,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement("div",{ref:K},q.default.createElement(d.TreeSelect,tt({open:M,fieldNames:{label:"text",value:"value",children:"children"},value:a,multiple:i,treeCheckable:i,treeCheckStrictly:N,showCheckedStrategy:d.TreeSelect[T],popupClassName:`form-popper__${f}`,dropdownStyle:L,placeholder:h,listHeight:S,style:m,loading:o,bordered:g,allowClear:v,disabled:E,treeDefaultExpandAll:R,treeDefaultExpandedKeys:k,showSearch:w,maxTagCount:I?"responsive":void 0,loadData:y?({key:e,children:t})=>Ie(void 0,void 0,void 0,(function*(){var n;if(!y||t)return;const{fetchApi:a,params:r,dataKey:i,textKey:o="text",valueKey:s="value",callback:d,formatter:u=(e=>e)}=y;if(a)try{const t=yield a(u(Object.assign(Object.assign({},r),{[s]:e})));if(200===t.code){const a=Array.isArray(t.data)?t.data:null!==(n=l.get(t.data,i))&&void 0!==n?n:[],r=hf(A,e,s,br(a,s,o));F(r),null==d||d(a)}}catch(e){}})):void 0,treeData:A},i?{title:Y(a)}:null,{filterTreeNode:(e,t)=>{var l;const n=(null===(l=null==t?void 0:t.text)||void 0===l?void 0:l.toString())||"",a=_r.parse(n).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(P?`${n}|${a}`:n).toLowerCase().indexOf(e.toLowerCase())>=0},onMouseDown:e=>{e.target.classList.contains("ant-select-selection-overflow-item-rest")&&(U(!0),H(!1))},onDropdownVisibleChange:e=>{if(!e)return H(e);Fe((()=>{W.current||H(e)}))},onChange:e=>{(e=>{null==s||s(e),u(e,Y(e),A)})(e),B.current=e}}))));return b?q.default.createElement(Hr,{text:Y(a)},Q):Q};class vf extends e.Component{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Ie(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:a={},dataKey:r,valueKey:i="value",textKey:o="text",callback:s}=t;if(n){this.setState({loading:!0});try{const t=yield n(a);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=l.get(t.data,r))&&void 0!==e?e:[],a=br(n,i,o);this.setState({itemList:a},(()=>null==s?void 0:s(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const a=null===(t=e.option.request)||void 0===t?void 0:t.params,r=null===(n=this.props.option.request)||void 0===n?void 0:n.params;l.isEqual(a,r)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t,loading:l}=this.state,{type:n,label:a,tooltip:r,fieldName:i,invisible:o,options:s={},labelWidth:u=e.props.labelWidth,className:c,extra:f,validateTrigger:p,rules:m=[],onChange:h=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(a),className:J.default(c),tooltip:r,hidden:o,labelCol:{flex:e.verticalLayout?"initial":$e(u)},required:e.getFormItemRequired(m)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:i,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(a)}},q.default.createElement(gf,{option:this.props.option,items:t,loading:l,multiple:this.props.multiple,onValuesChange:(t,l,n)=>{h(t,l,n),e.setViewValue(i,l)}}))),f&&q.default.createElement(d.Col,{flex:$e(f.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:i},f)))))}}vf.contextType=Zn;const yf=e=>{const{$$form:t}=q.default.useContext(Zn),{value:n,multiple:a,items:r}=e,{t:i}=ot(),{fieldName:o,options:s={},style:u={},placeholder:c=i("qm.form.selectPlaceholder"),bordered:f=!0,allowClear:p=!0,asyncLoad:m,translate:h,readOnly:g,disabled:v}=e.option,{itemList:y,changeOnSelect:b,checkStrictly:x,checkStrategy:E="SHOW_PARENT",filterable:C=!0,dropdownStyle:w,openPyt:S=!0}=s,[N,T]=q.default.useState(De(y)?r:y),I=q.default.useRef(N);Yl((()=>{const e=De(y)?r:y;m?l.isEqual(e,I.current)||(T(e),I.current=e):T(e)}),[y,r]);const O=e=>Er(N,null!=e?e:"").map((e=>e.text)).join("/"),R=e=>a?(null==e?void 0:e.map((e=>O(e))).join(","))||"":O(e),k=t.isOnlyShow?q.default.createElement(Mr,{value:R(n),bordered:f}):q.default.createElement(d.Cascader,tt({value:(e=>De(e)?[]:a?e.map((e=>e.split(","))):e.split(","))(n),fieldNames:{label:"text",value:"value",children:"children"},options:N,multiple:a,maxTagCount:"responsive",changeOnSelect:b||x,showCheckedStrategy:d.Cascader[E],popupClassName:`form-popper__${o}`,dropdownMenuColumnStyle:w,placeholder:c,style:u,bordered:f,allowClear:p,disabled:v,showSearch:C&&!m&&{filter:(e,t)=>t.some((t=>{var l;const n=(null===(l=null==t?void 0:t.text)||void 0===l?void 0:l.toString())||"",a=_r.parse(n).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(S?`${n}|${a}`:n).toLowerCase().indexOf(e.toLowerCase())>=0}))},loadData:m?e=>Ie(void 0,void 0,void 0,(function*(){var t;const n=e[e.length-1];if(!m||n.children)return;const{fetchApi:a,params:r,dataKey:i,textKey:o="text",valueKey:s="value",callback:d,formatter:u=(e=>e)}=m;if(a)try{const e=yield a(u(Object.assign(Object.assign({},r),{[s]:n.value})));if(200===e.code){const a=Array.isArray(e.data)?e.data:null!==(t=l.get(e.data,i))&&void 0!==t?t:[],r=hf(N,n.value,s,br(a,s,o));T(r),null==d||d(a)}}catch(e){}})):void 0},a?{title:R(n)}:null,{onChange:t=>{(t=>{const{onChange:l,onValuesChange:n}=e;null==l||l(t),n(t,R(t),N)})(((e=[])=>a?e.map((e=>e.join(","))):e.join(","))(t))}}));return h?q.default.createElement(Hr,{text:R(n)},k):k};class bf extends e.Component{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Ie(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:a={},dataKey:r,valueKey:i="value",textKey:o="text",callback:s}=t;if(n){this.setState({loading:!0});try{const t=yield n(a);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=l.get(t.data,r))&&void 0!==e?e:[],a=br(n,i,o);this.setState({itemList:a},(()=>null==s?void 0:s(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const a=null===(t=e.option.request)||void 0===t?void 0:t.params,r=null===(n=this.props.option.request)||void 0===n?void 0:n.params;l.isEqual(a,r)||this.getItemList()}render(){const{$$form:e}=this.context,{multiple:t}=this.props,{itemList:l}=this.state,{type:n,label:a,tooltip:r,fieldName:i,invisible:o,options:s={},labelWidth:u=e.props.labelWidth,className:c,extra:f,validateTrigger:p,rules:m=[],onChange:h=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(a),className:J.default(c),tooltip:r,hidden:o,labelCol:{flex:e.verticalLayout?"initial":$e(u)},required:e.getFormItemRequired(m)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:i,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(a)}},q.default.createElement(yf,{option:this.props.option,multiple:t,items:l,onValuesChange:(t,l,n)=>{h(t,l,n),e.setViewValue(i,l)}}))),f&&q.default.createElement(d.Col,{flex:$e(f.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:i},f)))))}}bf.contextType=Zn;const xf=["110000","120000","310000","500000"],Ef=["810000","820000"],Cf=[{text:"A",value:"A"},{text:"F",value:"F"},{text:"G",value:"G"},{text:"H",value:"H"},{text:"J",value:"J"},{text:"L",value:"L"},{text:"N",value:"N"},{text:"Q",value:"Q"},{text:"S",value:"S"},{text:"T",value:"T"},{text:"X",value:"X"},{text:"Y",value:"Y"},{text:"Z",value:"Z"},{text:"直辖市",value:"Z1"},{text:"港澳",value:"Z2"}],wf=[{text:"A",value:"A"},{text:"B",value:"B"},{text:"C",value:"C"},{text:"D",value:"D"},{text:"E",value:"E"},{text:"F",value:"F"},{text:"G",value:"G"},{text:"H",value:"H"},{text:"J",value:"J"},{text:"K",value:"K"},{text:"L",value:"L"},{text:"M",value:"M"},{text:"N",value:"N"},{text:"P",value:"P"},{text:"Q",value:"Q"},{text:"R",value:"R"},{text:"S",value:"S"},{text:"T",value:"T"},{text:"W",value:"W"},{text:"X",value:"X"},{text:"Y",value:"Y"},{text:"Z",value:"Z"},{text:"直辖市",value:"Z1"},{text:"港澳",value:"Z2"}],Sf=e=>_r.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join(""),Nf=(e,t,l=1)=>{if(l>2||!e[t])return;return("86"===t?Object.keys(e[t]).filter((e=>![...xf,...Ef].includes(e))):Object.keys(e[t])).map((n=>({l:Sf(e[t][n].slice(0,1)).toUpperCase(),n:e[t][n],c:n,p:t,children:Nf(e,n,l+1)})))},Tf=(e,t)=>t.map((t=>({l:Sf(e[86][t].slice(0,1)).toUpperCase(),n:e[86][t],c:t,p:"86",children:void 0})));class If extends e.Component{constructor(e){super(e),this.searchRef=q.default.createRef(),this.scrollRef=q.default.createRef(),this.state={visible:!1,select_type:"0",active_key:""},this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(e,this.createTextValue(e)),this.handleVisibleChange(!1)},this.zxsAndGa=this.createZxsAndGa(),this.provinces=this.createProvince(),this.allCities=this.createAllCity(),this.letterCities=this.createCity()}componentDidMount(){this.setInputReadonly()}setInputReadonly(){var e;null===(e=this.searchRef.current)||void 0===e||e.input.setAttribute("readonly","readonly")}scrollHandle(e){this.setState({active_key:e}),re.default(this[`${e}Ref`],{block:"start",behavior:"smooth",boundary:this.scrollRef.current})}clickHadnle(e){this.triggerChange(e)}createTextValue(e){var t;return(null===(t=this.allCities.find((t=>t.c===e)))||void 0===t?void 0:t.n)||""}createZxsAndGa(){return[{l:"Z1",n:"直辖市",c:"",p:"",children:Tf(ve.default,xf)},{l:"Z2",n:"港澳",c:"",p:"",children:Tf(ve.default,Ef)}]}createProvince(){var e;return(null!==(e=Nf(ve.default,"86"))&&void 0!==e?e:[]).concat(this.zxsAndGa)}createAllCity(){const e=[];return this.provinces.forEach((t=>e.push(...t.children))),e}createCity(){return wf.filter((e=>"Z1"!==e.value&&"Z2"!==e.value)).map((e=>({l:e.value,n:e.text,c:"",p:"",children:this.allCities.filter((e=>![...xf,...Ef].includes(e.c))).filter((t=>t.l===e.value))}))).concat(this.zxsAndGa)}renderType(){const{select_type:e}=this.state;return q.default.createElement(d.Radio.Group,{size:"small",buttonStyle:"solid",value:e,onChange:e=>{const{value:t}=e.target;this.setState({select_type:t,active_key:""},(()=>{this.scrollRef.current.scrollTop=0}))}},q.default.createElement(d.Radio.Button,{value:"0"},Se("qm.form.citySelectType.0")),q.default.createElement(d.Radio.Button,{value:"1"},Se("qm.form.citySelectType.1")))}renderLetter(){const{active_key:e,select_type:t}=this.state;return("0"===t?Cf:wf).map((t=>q.default.createElement("li",{key:t.value,className:J.default({tag:!0,actived:t.value===e}),onClick:()=>this.scrollHandle(t.value.toString())},t.text)))}renderSelect(){const{value:e}=this.props;return q.default.createElement(d.Select,{size:"small",placeholder:Se("qm.form.selectPlaceholder"),style:{width:"200px"},showSearch:!0,filterOption:(e,t)=>{var l;return((null===(l=null==t?void 0:t.children)||void 0===l?void 0:l.toString())||"").toLowerCase().indexOf(e.toLowerCase())>=0},value:e||void 0,onChange:e=>{this.triggerChange(e)}},this.allCities.map((e=>q.default.createElement(d.Select.Option,{key:e.c,value:e.c},e.n))))}renderCity(e){const{select_type:t}=this.state;return("0"===t?this.provinces:this.letterCities).map(((t,l)=>{var n;return q.default.createElement("div",{key:l},q.default.createElement("dt",{ref:e=>this[`${t.l}Ref`]=e},t.n,":"),q.default.createElement("dd",null,null===(n=t.children)||void 0===n?void 0:n.map((t=>q.default.createElement("li",{key:t.c,className:J.default({actived:t.c===e}),onClick:()=>this.clickHadnle(t.c)},t.n)))))}))}render(){const{$$form:e}=this.context,{visible:t}=this.state,{value:l}=this.props,{fieldName:n,options:a={},style:r={},placeholder:i=Se("qm.form.selectPlaceholder"),bordered:o=!0,allowClear:s=!0,readOnly:u,disabled:c}=this.props.option,f=gt("form-city-select"),p=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,m=this.createTextValue(l),h=q.default.createElement("div",{className:"container",style:Object.assign({},r)},q.default.createElement("div",{className:"city-drop"},q.default.createElement("div",{className:"city-drop-toper"},q.default.createElement("div",{className:"city-drop-toper__type"},this.renderType()),q.default.createElement("div",{className:"city-drop-toper__search"},this.renderSelect())),q.default.createElement("div",{className:"city-drop-letter"},this.renderLetter()),q.default.createElement("div",{ref:this.scrollRef,className:"city-drop-list"},q.default.createElement("dl",null,this.renderCity(l)))));return q.default.createElement(xe.Consumer,null,(l=>{const a={[f]:!0,[`${f}--lg`]:"large"===(null==l?void 0:l.size),[`${f}--sm`]:"small"===(null==l?void 0:l.size)};return e.isOnlyShow?q.default.createElement(Mr,{value:m,bordered:o}):q.default.createElement(xs,{action:c?[]:["click"],popupVisible:!c&&t,popup:h,popupClassName:J.default(a,`form-popper__${n}`),popupStyle:{minWidth:p},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:or,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement("div",null,q.default.createElement(d.Input,{ref:this.searchRef,placeholder:i,allowClear:s,bordered:o,readOnly:u,disabled:c,style:Object.assign({width:"100%"},r),value:m,title:m,onChange:e=>{const{value:t}=e.target;this.triggerChange(t)}})))}))}}If.contextType=Zn;class Of extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(If,{option:this.props.option,onValuesChange:(t,l)=>{p(t,l),e.setViewValue(a,l)}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Of.contextType=Zn;const Rf=(e,t)=>{if(e[t])return Object.keys(e[t]).map((l=>({text:e[t][l],value:l,children:Rf(e,l)})))};class kf extends e.Component{constructor(e){super(e),this.searchRef=q.default.createRef(),this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(e,this.createTextValue(e)),this.handleVisibleChange(!1)};const t=Rf(ve.default,"86")||[];this.state={results:t,visible:!1,values:[],tabs:[t.map((e=>({text:e.text,value:e.value})))],activeName:"0"}}componentDidMount(){this.initial(),this.setInputReadonly()}componentDidUpdate(e){const{value:t}=e,{value:l}=this.props;t!==l&&this.state.values.join(",")!==(null!=l?l:"")&&this.initial()}get isFetch(){var e;return!!(null===(e=this.props.option.request)||void 0===e?void 0:e.fetchApi)}get level(){let{selectLevel:e=0}=this.props.option.options||{};return(e<1||e>3)&&(e=3),this.isFetch?4:e}setInputReadonly(){var e;null===(e=this.searchRef.current)||void 0===e||e.input.setAttribute("readonly","readonly")}createTextValue(e){return(e?e.split(","):[]).map(((e,t)=>{var l,n;return null===(n=null===(l=this.state.tabs[t])||void 0===l?void 0:l.find((t=>t.value===e)))||void 0===n?void 0:n.text})).join("/")}initial(){const{value:e}=this.props,t=e?e.split(","):[];this.setState({values:t},(()=>{this.createTabs(),this.createActiveName(t.length?t.length-1:0)}))}createActiveName(e){this.setState({activeName:e.toString()})}createTabs(){const{results:e,values:t}=this.state;if(!e.length)return;const l=this.state.tabs.slice(0,1);for(let n=0;n<t.length;n++){const a=xr(e,t[n]);if(a&&De(a.children)){this.isFetch&&this.getStreetList(t[n]);break}Array.isArray(null==a?void 0:a.children)&&(l[n+1]=null==a?void 0:a.children.map((e=>({text:e.text,value:e.value}))))}this.setState({tabs:l})}getStreetList(e){var t;return Ie(this,void 0,void 0,(function*(){const{request:n={}}=this.props.option,{fetchApi:a,formatter:r=(e=>e),dataKey:i,valueKey:o="value",textKey:s="text"}=n;if(a)try{const n=yield a(r({code:e}));if(200===n.code){const e=Array.isArray(n.data)?n.data:null!==(t=l.get(n.data,i))&&void 0!==t?t:[];this.setState((t=>({tabs:[...t.tabs,e.map((e=>({text:e[s],value:e[o]})))]})))}}catch(e){}}))}renderTabs(){const{values:e}=this.state,t=this.state.tabs.map(((t,l)=>{var n;const a=(null===(n=t.find((t=>t.value===e[l])))||void 0===n?void 0:n.text)||`${Se("qm.form.selectPlaceholder").replace("...","")}(${Se("qm.form.regionSelectLabel")[l]})`;return q.default.createElement(Un.TabPane,{key:l.toString(),tab:a},q.default.createElement("div",{className:"region-box"},t.map((t=>q.default.createElement("span",{key:t.value,className:J.default({"region-box__item":!0,actived:e.includes(t.value.toString())}),title:t.text,onClick:()=>{let{values:e}=this.state;e[l]=t.value.toString(),e=e.slice(0,l+1),this.setState({values:e},(()=>{const t=(e=>["810000","820000"].includes(e[0]))(e)?this.level<3?this.level:this.level-1:this.level;if(l+1>=t)return this.triggerChange(e.join(","));this.createTabs(),this.createActiveName(l+1)}))}},t.text)))))}));return t.length?q.default.createElement(Un,{size:"small",activeKey:this.state.activeName,onChange:e=>{this.createActiveName(e)}},t):q.default.createElement(pn,null)}render(){const{$$form:e}=this.context,{visible:t}=this.state,{value:l}=this.props,{fieldName:n,options:a={},style:r={},placeholder:i=Se("qm.form.selectPlaceholder"),bordered:o=!0,allowClear:s=!0,readOnly:u,disabled:c}=this.props.option,f=gt("form-region-select"),p=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,m=q.default.createElement("div",{className:"container"},this.renderTabs());let h=this.prevText;if(!t){const e=this.createTextValue(l);(""===e||e.split("/").every((e=>""!==e)))&&(h=e,this.prevText=h)}return q.default.createElement(xe.Consumer,null,(l=>{const a={[f]:!0,[`${f}--lg`]:"large"===(null==l?void 0:l.size),[`${f}--sm`]:"small"===(null==l?void 0:l.size)};return e.isOnlyShow?q.default.createElement(Mr,{value:h,bordered:o}):q.default.createElement(xs,{action:c?[]:["click"],popupVisible:!c&&t,popup:m,popupClassName:J.default(a,`form-popper__${n}`),popupStyle:{minWidth:p},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:or,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement("div",null,q.default.createElement(d.Input,{ref:this.searchRef,placeholder:i,allowClear:s,bordered:o,style:Object.assign({width:"100%"},r),readOnly:u,disabled:c,value:h,title:h,onChange:e=>{const{value:t}=e.target;this.triggerChange(t),!t&&Fe((()=>this.initial()))}})))}))}}kf.contextType=Zn;class Lf extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(kf,{option:this.props.option,onValuesChange:(t,l)=>{p(t,l),e.setViewValue(a,l)}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Lf.contextType=Zn;const Pf=e=>{const{$$form:t}=q.default.useContext(Zn),{value:n,onChange:a,onValuesChange:r}=e,{options:i={},upload:o={},disabled:s,readOnly:u}=e.option,{multiple:c=!0,maxCount:f=1,fileTypes:p,fileSize:m,draggable:h,editable:v,batchDownload:y,fileDirection:b,onPreview:x,onDownload:E,onRemove:C,onSortChange:w,onEditChange:S}=i,{action:N,headers:T,params:I,withCredentials:O=!1,dataKey:R="",downloadWithHeaders:k,fieldAliasMap:L,beforeUpload:P,button:A}=o,F="function"==typeof L?L():L||{},{t:_}=ot();return q.default.createElement($n,{name:"file",action:N,multiple:c,headers:T,data:I,withCredentials:O,downloadWithHeaders:k,beforeUpload:P,maxCount:f,fileTypes:p,fileSize:m,draggable:h,editable:v,batchDownload:y,fileDirection:b,disabled:null!=s?s:t.props.disabled,readOnly:t.isOnlyShow||u,button:A,showUploadList:{showDownloadIcon:!0,downloadIcon:q.default.createElement(g.DownloadOutlined,null)},fileList:n,onChange:({fileList:e})=>{(e=>{const t=e.map((e=>{var t;const n=e.response||{},a={};for(const l in F)a[l]=e[l]||(null===(t=n.data)||void 0===t?void 0:t[F[l]])||"";return e.response&&200!==n.code&&d.message.error(n.message||_("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},a),{url:e.url||(R?l.get(n.data,R):n.data)||"",status:e.status})}));null==a||a(t),t.every((e=>"done"===e.status&&e.url))&&r(t)})(e)},onPreview:x,onDownload:E,onRemove:C,onSortChange:w,onEditChange:S})};class Af extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Pf,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,"")}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Af.contextType=Zn;const Ff=q.default.forwardRef(((e,t)=>{const l=je({src:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0},e),{className:n,style:a,src:r,alt:i,imgStyle:o}=l,s=Ne(l,["className","style","src","alt","imgStyle"]),d=q.default.useRef(null),u=q.default.useRef(null);q.default.useEffect((()=>{const e={};for(const t in s)void 0!==l[t]&&(e[t]=l[t]);return u.current=new ye.default(d.current,e),()=>{v(),u.current=null}}),[]);const c=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.reset()},f=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.clear()},p=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.crop()},m=(e,t=!1)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.replace(e,t)},h=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.enable()},g=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.disable()},v=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.destroy()},y=(e,t)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.move(e,t)},b=(e,t=e)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.moveTo(e,t)},x=(e,t)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.zoom(e)},E=(e,t)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.zoomTo(e,t)},C=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.rotate(e)},w=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.rotateTo(e)},S=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.scaleX(e)},N=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.scaleY(e)},T=(e,t=e)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.scale(e,t)},I=(e=!1)=>{var t;return null===(t=u.current)||void 0===t?void 0:t.getData(e)},O=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.setData(e)},R=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.getContainerData()},k=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.getImageData()},L=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.getCanvasData()},P=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.setCanvasData(e)},A=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.getCropBoxData()},F=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.setCropBoxData(e)},_=(e={})=>{var t;return null===(t=u.current)||void 0===t?void 0:t.getCroppedCanvas(e)},D=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.setAspectRatio(e)},M=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.setDragMode(e)};q.default.useImperativeHandle(t,(()=>({reset:c,clear:f,initCrop:p,replace:m,enable:h,disable:g,destroy:v,move:y,moveTo:b,relativeZoom:x,zoomTo:E,rotate:C,rotateTo:w,scaleX:S,scaleY:N,scale:T,getData:I,setData:O,getContainerData:R,getImageData:k,getCanvasData:L,setCanvasData:P,getCropBoxData:A,setCropBoxData:F,getCroppedCanvas:_,setAspectRatio:D,setDragMode:M})));const H={[gt("cropper")]:!0};return q.default.createElement("div",{className:J.default(H,n),style:a},q.default.createElement("img",{ref:d,src:r,alt:i,style:Object.assign({maxWidth:"100%"},o)}))}));Ff.displayName="Cropper";const _f=e=>{const{fileTypes:t=[],fileSize:l,fixedSize:n,quality:a,beforeCrop:r,className:i}=e,{t:o}=ot(),s=q.default.useRef(null),u=q.default.useRef(),c=q.default.useRef(),f=q.default.useRef(),p=q.default.useRef(),[m,h]=q.default.useState(""),v=e=>{s.current.relativeZoom(e)},y=e=>{s.current.rotate(e)},b=()=>{h("")},x=gt("cropper-preview");return q.default.createElement(q.default.Fragment,null,(()=>{const t=Array.isArray(e.children)?e.children[0]:e.children;if(!t)return null;const l=t.props,{beforeUpload:n}=l,a=Ne(l,["beforeUpload"]);return u.current=n,q.default.createElement(t.type,Object.assign(Object.assign({},a),{beforeUpload:(e,t)=>new Promise(((l,n)=>Ie(void 0,void 0,void 0,(function*(){const n=()=>l(d.Upload.LIST_IGNORE);if(r&&!(yield r(e,t)))return void n();c.current=e,f.current=l,p.current=n;const a=new FileReader;a.onload=()=>{h(a.result),a.onload=null},a.readAsDataURL(e)}))))}))})(),m&&q.default.createElement(d.Modal,{open:!0,wrapClassName:J.default(x,i),title:o("qm.uploadCropper.cropper"),width:790,bodyStyle:{padding:10},onOk:()=>{Ie(void 0,void 0,void 0,(function*(){const{type:e,name:l,uid:n}=c.current;s.current.getCroppedCanvas({maxWidth:1920,fillColor:"image/png"===e?"transparent":"#fff",imageSmoothingEnabled:!1,imageSmoothingQuality:"high"}).toBlob((a=>Ie(void 0,void 0,void 0,(function*(){let r=new File([a],l,{type:e});if(Object.assign(r,{uid:n}),t.length&&!t.includes(r.name.slice(r.name.lastIndexOf(".")+1).toLowerCase()))return d.message.warning(o("qm.upload.tooltip",{type:t.join(",")})),p.current("file type is error");if("function"!=typeof u.current)return f.current(r);const i=u.current(r,[r]);if("boolean"==typeof i||i){if(!0===i)return f.current(r);if(!1===i)return p.current("not upload");if(i&&"function"==typeof i.then)try{const e=yield i,t=Object.prototype.toString.call(e);"[object File]"!==t&&"[object Blob]"!==t||(r=e),f.current(r)}catch(e){p.current(e)}}else ft("CropperPreview","`beforeUpload` 必须返回 `boolean` 或 `Promise` 类型")}))),e,a),yield Ae(100),b()}))},onCancel:b,maskClosable:!1,destroyOnClose:!0},(()=>{const e={width:"380px",height:n?`calc(380px * ${n[1]/n[0]})`:"auto"};return q.default.createElement("div",{className:"cropper-preview"},q.default.createElement("div",{className:"cropper-area"},q.default.createElement("div",{className:"img-cropper"},q.default.createElement(Ff,{ref:s,aspectRatio:n?n[0]/n[1]:n,src:m,dragMode:"move",preview:".preview"})),q.default.createElement("div",{className:"actions"},q.default.createElement(d.Space,{size:"small"},q.default.createElement(d.Button,{type:"primary",size:"middle",icon:q.default.createElement(g.ZoomInOutlined,null),onClick:()=>v(.2)},o("qm.uploadCropper.zoomIn")),q.default.createElement(d.Button,{type:"primary",size:"middle",icon:q.default.createElement(g.ZoomOutOutlined,null),onClick:()=>v(-.2)},o("qm.uploadCropper.zoomOut")),q.default.createElement(d.Button,{type:"primary",size:"middle",icon:q.default.createElement(g.RotateRightOutlined,null),onClick:()=>y(90)},o("qm.uploadCropper.rotatePlus")),q.default.createElement(d.Button,{type:"primary",size:"middle",icon:q.default.createElement(g.RotateLeftOutlined,null),onClick:()=>y(-90)},o("qm.uploadCropper.rotateSubtract"))))),q.default.createElement("div",{className:"preview-area"},q.default.createElement("div",{className:"preview",style:e})))})()))},Df=e=>{const t=je({name:"file",multiple:!0,accept:"image/*",listType:"picture-card"},e),{fileList:l=[],openCropper:n=!0,fixedSize:a,quality:r=1,fileTypes:i,fileSize:o,maxCount:s,draggable:u,disabled:c,readOnly:f,className:p,popupClassName:m,beforeCrop:h,onSortChange:v,onChange:y}=t,{t:b}=ot(),{$size:x}=dt(t),E=q.default.useRef(null),C=q.default.useRef(null),w=q.default.useRef(!1),[S,N]=q.default.useState(!1),[T,I]=q.default.useState(0),O=q.default.useMemo((()=>c||f||!1),[c,f]),R=q.default.useMemo((()=>!s||l.length<s),[l,s]);q.default.useEffect((()=>(L(),document.addEventListener("paste",A),()=>{var e;null===(e=C.current)||void 0===e||e.destroy(),document.removeEventListener("paste",A)})),[]),Yl((()=>{R||(w.current=!1)}),[l]);const k=st((e=>{const{oldIndex:t,newIndex:n}=e;if(t!==n){const e=[...l],[a]=e.splice(t,1);e.splice(n,0,a),null==v||v(e),null==y||y({file:l[t],fileList:e})}})),L=()=>{u&&(C.current=ne.default.create(an(E.current,gt("upload-img")).querySelector(".ant-upload-list"),{animation:150,handle:".handle",filter:".ignore",draggable:".ant-upload-list-picture-card-container",onEnd:k}))},P=(e,l)=>new Promise(((n,a)=>Ie(void 0,void 0,void 0,(function*(){const{fileTypes:r=[],fileSize:i,beforeUpload:o}=t,s=!r.length||r.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),u=!i||e.size/1024/1024<i,c=s&&u;if(s||d.message.warning(b("qm.upload.tooltip",{type:r.join(",")})),u||d.message.warning(b("qm.upload.sizeLimit",{size:i})),!c)return d.Upload.LIST_IGNORE;if(o){const t=o(e,l);if(!0===t)return n(e);if(!1===t)return a("not upload");if(t&&"function"==typeof t.then)try{const e=yield t;n(e)}catch(e){a(e)}}else n(e)})))),A=st((e=>Ie(void 0,void 0,void 0,(function*(){const{action:n,data:a,headers:r}=t;if(w.current&&R&&n)for(const t of e.clipboardData.items)if("file"===t.kind&&t.type.startsWith("image/")){const e=t.getAsFile(),i=Date.now(),o=new File([e],`screenshot-${i}.png`,{type:e.type});Object.assign(o,{uid:`rc-upload-${i}`});try{yield P(o,[...l,o]);const e=new FormData;if(e.append("file",o),a)for(const t in a)e.append(t,a[t]);const t="string"==typeof n?n:yield n(o),i=yield fetch(t,{method:"POST",body:e,headers:r});if(!i.ok)throw new Error(b("qm.upload.uploadError"));const s=yield i.json();null==y||y({file:o,fileList:[...l,{uid:o.uid,lastModified:o.lastModified,lastModifiedDate:o.lastModifiedDate,name:o.name,type:o.type,size:o.size,response:s,status:"done",percent:100,originFileObj:o}]})}catch(e){}}})))),F=gt("upload-img"),_={[F]:!0,[`${F}--lg`]:"large"===x,[`${F}--sm`]:"small"===x},D=q.default.createElement(d.Upload,tt({className:J.default(_,p)},He(t,["fileTypes","fileSize","fixedSize","quality","openCropper","draggable","popupClassName"]),{beforeUpload:P,disabled:O,onPreview:e=>{const t=l.findIndex((t=>t.url===e.url));t<0||(I(t),N(!0))},showUploadList:{showRemoveIcon:!1,showDownloadIcon:!1},itemRender:(e,t,l,n)=>q.default.createElement("div",{className:J.default("upload-item",{handle:u})},e,!O&&q.default.createElement(g.CloseOutlined,{title:b("qm.upload.remove"),className:"icon",onClick:()=>n.remove()}))}),q.default.createElement("span",{className:"inner",ref:E},R&&!(f&&l.length)&&q.default.createElement(q.default.Fragment,null,q.default.createElement("p",{className:"ant-upload-drag-icon"},q.default.createElement(g.InboxOutlined,null)),q.default.createElement("p",{className:"ant-upload-text"},b("qm.uploadCropper.dragableText")),q.default.createElement("button",{className:J.default("ant-upload-button",{disabled:O}),onClick:e=>{e.stopPropagation(),e.preventDefault()},onFocus:()=>{w.current=!0},onBlur:()=>{w.current=!1}},b("qm.uploadCropper.pasteText")))));return q.default.createElement(q.default.Fragment,null,n?q.default.createElement(_f,{className:m,fixedSize:a,quality:r,fileTypes:i,fileSize:o,beforeCrop:h},D):D,q.default.createElement("div",{style:{display:"none"}},q.default.createElement(d.Image.PreviewGroup,{key:l.map((e=>e.uid||"")).join(","),preview:{visible:S,current:T,rootClassName:m,onVisibleChange:e=>N(e)}},l.map(((e,t)=>q.default.createElement(d.Image,{key:e.uid||t,src:e.url,alt:""}))))))};Df.displayName="QmUploadImg";const Mf=e=>{const{$$form:t}=q.default.useContext(Zn),{value:n,onChange:a,onValuesChange:r}=e,{options:i={},upload:o={},disabled:s,readOnly:u}=e.option,{multiple:c=!0,maxCount:f=1,fixedSize:p,quality:m,openCropper:h,fileTypes:g,fileSize:v,draggable:y,onRemove:b,onSortChange:x}=i,{action:E,headers:C,params:w,withCredentials:S=!1,dataKey:N="",popupClassName:T,fieldAliasMap:I,beforeUpload:O}=o,R="function"==typeof I?I():I||{},{t:k}=ot();return q.default.createElement(Df,{name:"file",action:E,multiple:c,headers:C,data:w,withCredentials:S,popupClassName:T,beforeUpload:O,maxCount:f,fixedSize:p,quality:m,openCropper:h,fileTypes:g,fileSize:v,draggable:y,disabled:null!=s?s:t.props.disabled,readOnly:t.isOnlyShow||u,fileList:n,onChange:({fileList:e})=>{(e=>{const t=e.map((e=>{var t;const n=e.response||{},a={};for(const l in R)a[l]=e[l]||(null===(t=n.data)||void 0===t?void 0:t[R[l]])||"";return e.response&&200!==n.code&&d.message.error(n.message||k("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},a),{url:e.url||(N?l.get(n.data,N):n.data)||"",status:e.status})}));null==a||a(t),t.every((e=>"done"===e.status&&e.url))&&r(t)})(e)},onRemove:b,onSortChange:x})};class Hf extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Mf,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,"")}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Hf.contextType=Zn;const qf={onActivate:de.func,onAddUndo:de.func,onBeforeAddUndo:de.func,onBeforeExecCommand:de.func,onBeforeGetContent:de.func,onBeforeRenderUI:de.func,onBeforeSetContent:de.func,onBeforePaste:de.func,onBlur:de.func,onChange:de.func,onClearUndos:de.func,onClick:de.func,onContextMenu:de.func,onCommentChange:de.func,onCopy:de.func,onCut:de.func,onDblclick:de.func,onDeactivate:de.func,onDirty:de.func,onDrag:de.func,onDragDrop:de.func,onDragEnd:de.func,onDragGesture:de.func,onDragOver:de.func,onDrop:de.func,onExecCommand:de.func,onFocus:de.func,onFocusIn:de.func,onFocusOut:de.func,onGetContent:de.func,onHide:de.func,onInit:de.func,onKeyDown:de.func,onKeyPress:de.func,onKeyUp:de.func,onLoadContent:de.func,onMouseDown:de.func,onMouseEnter:de.func,onMouseLeave:de.func,onMouseMove:de.func,onMouseOut:de.func,onMouseOver:de.func,onMouseUp:de.func,onNodeChange:de.func,onObjectResizeStart:de.func,onObjectResized:de.func,onObjectSelected:de.func,onPaste:de.func,onPostProcess:de.func,onPostRender:de.func,onPreProcess:de.func,onProgressState:de.func,onRedo:de.func,onRemove:de.func,onReset:de.func,onSaveContent:de.func,onSelectionChange:de.func,onSetAttrib:de.func,onSetContent:de.func,onShow:de.func,onSubmit:de.func,onUndo:de.func,onVisualAid:de.func,onSkinLoadError:de.func,onThemeLoadError:de.func,onModelLoadError:de.func,onPluginLoadError:de.func,onIconsLoadError:de.func,onLanguageLoadError:de.func},$f=Object.assign({apiKey:de.string,id:de.string,inline:de.bool,init:de.object,initialValue:de.string,onEditorChange:de.func,value:de.string,tagName:de.string,cloudChannel:de.string,plugins:de.oneOfType([de.string,de.array]),toolbar:de.oneOfType([de.string,de.array]),disabled:de.bool,textareaName:de.string,tinymceScriptSrc:de.string,rollback:de.oneOfType([de.number,de.oneOf([!1])]),scriptLoading:de.shape({async:de.bool,defer:de.bool,delay:de.number})},qf),jf=e=>"function"==typeof e,Kf=e=>e in qf,Vf=e=>e.substr(2),zf=(e,t,l,n,a)=>((e,t,l,n,a,r,i)=>{const o=Object.keys(a).filter(Kf),s=Object.keys(r).filter(Kf),d=o.filter((e=>void 0===r[e])),u=s.filter((e=>void 0===a[e]));d.forEach((e=>{const t=Vf(e),n=i[t];l(t,n),delete i[t]})),u.forEach((l=>{const a=n(e,l),r=Vf(l);i[r]=a,t(r,a)}))})(a,e.on.bind(e),e.off.bind(e),((t,l)=>n=>{var a;return null===(a=t(l))||void 0===a?void 0:a(n,e)}),t,l,n);let Wf=0;const Bf=e=>{const t=Date.now(),l=Math.floor(1e9*Math.random());return Wf++,e+"_"+l+Wf+String(t)},Uf=e=>null!==e&&("textarea"===e.tagName.toLowerCase()||"input"===e.tagName.toLowerCase()),Gf=e=>void 0===e||""===e?[]:Array.isArray(e)?e:e.split(" "),Yf=(e,t)=>{void 0!==e&&(null!=e.mode&&"object"==typeof e.mode&&"function"==typeof e.mode.set?e.mode.set(t):e.setMode(t))},Xf=()=>({listeners:[],scriptId:Bf("tiny-script"),scriptLoading:!1,scriptLoaded:!1}),Qf=(()=>{let e=Xf();return{load:(t,l,n,a,r,i)=>{const o=()=>((e,t,l,n,a,r)=>{const i=t.createElement("script");i.referrerPolicy="origin",i.type="application/javascript",i.id=e,i.src=l,i.async=n,i.defer=a;const o=()=>{i.removeEventListener("load",o),r()};i.addEventListener("load",o),t.head&&t.head.appendChild(i)})(e.scriptId,t,l,n,a,(()=>{e.listeners.forEach((e=>e())),e.scriptLoaded=!0}));e.scriptLoaded?i():(e.listeners.push(i),e.scriptLoading||(e.scriptLoading=!0,r>0?setTimeout(o,r):o()))},reinitialize:()=>{e=Xf()}}})(),Zf=e=>{const t=e;return t&&t.tinymce?t.tinymce:null};class Jf extends $.Component{constructor(e){var t,l,n;super(e),this.rollbackTimer=void 0,this.valueCursor=void 0,this.rollbackChange=()=>{const e=this.editor,t=this.props.value;e&&t&&t!==this.currentContent&&e.undoManager.ignore((()=>{if(e.setContent(t),this.valueCursor&&(!this.inline||e.hasFocus()))try{e.selection.moveToBookmark(this.valueCursor)}catch(e){}})),this.rollbackTimer=void 0},this.handleBeforeInput=e=>{if(void 0!==this.props.value&&this.props.value===this.currentContent&&this.editor&&(!this.inline||this.editor.hasFocus()))try{this.valueCursor=this.editor.selection.getBookmark(3)}catch(e){}},this.handleBeforeInputSpecial=e=>{"Enter"!==e.key&&"Backspace"!==e.key&&"Delete"!==e.key||this.handleBeforeInput(e)},this.handleEditorChange=e=>{const t=this.editor;if(t&&t.initialized){const e=t.getContent();void 0!==this.props.value&&this.props.value!==e&&!1!==this.props.rollback&&(this.rollbackTimer||(this.rollbackTimer=window.setTimeout(this.rollbackChange,"number"==typeof this.props.rollback?this.props.rollback:200))),e!==this.currentContent&&(this.currentContent=e,"function"==typeof this.props.onEditorChange&&this.props.onEditorChange(e,t))}},this.handleEditorChangeSpecial=e=>{"Backspace"!==e.key&&"Delete"!==e.key||this.handleEditorChange(e)},this.initialise=(e=0)=>{var t,l,n;const a=this.elementRef.current;if(!a)return;if(!(e=>{if(!("isConnected"in Node.prototype)){let t=e,l=e.parentNode;for(;null!=l;)t=l,l=t.parentNode;return t===e.ownerDocument}return e.isConnected})(a)){if(0===e)setTimeout((()=>this.initialise(1)),1);else{if(!(e<100))throw new Error("tinymce can only be initialised when in a document");setTimeout((()=>this.initialise(e+1)),100)}return}const r=Zf(this.view);if(!r)throw new Error("tinymce should have been loaded into global scope");const i=Object.assign(Object.assign({},this.props.init),{selector:void 0,target:a,readonly:this.props.disabled,inline:this.inline,plugins:(o=null===(t=this.props.init)||void 0===t?void 0:t.plugins,s=this.props.plugins,Gf(o).concat(Gf(s))),toolbar:null!==(l=this.props.toolbar)&&void 0!==l?l:null===(n=this.props.init)||void 0===n?void 0:n.toolbar,setup:e=>{this.editor=e,this.bindHandlers({}),this.inline&&!Uf(a)&&e.once("PostRender",(t=>{e.setContent(this.getInitialValue(),{no_events:!0})})),this.props.init&&jf(this.props.init.setup)&&this.props.init.setup(e)},init_instance_callback:e=>{var t,l;const n=this.getInitialValue();this.currentContent=null!==(t=this.currentContent)&&void 0!==t?t:e.getContent(),this.currentContent!==n&&(this.currentContent=n,e.setContent(n),e.undoManager.clear(),e.undoManager.add(),e.setDirty(!1));const a=null!==(l=this.props.disabled)&&void 0!==l&&l;Yf(this.editor,a?"readonly":"design"),this.props.init&&jf(this.props.init.init_instance_callback)&&this.props.init.init_instance_callback(e)}});var o,s;this.inline||(a.style.visibility=""),Uf(a)&&(a.value=this.getInitialValue()),r.init(i)},this.id=this.props.id||Bf("tiny-react"),this.elementRef=$.createRef(),this.inline=null!==(n=null!==(t=this.props.inline)&&void 0!==t?t:null===(l=this.props.init)||void 0===l?void 0:l.inline)&&void 0!==n&&n,this.boundHandlers={}}get view(){var e,t;return null!==(t=null===(e=this.elementRef.current)||void 0===e?void 0:e.ownerDocument.defaultView)&&void 0!==t?t:window}componentDidUpdate(e){var t,l;if(this.rollbackTimer&&(clearTimeout(this.rollbackTimer),this.rollbackTimer=void 0),this.editor&&(this.bindHandlers(e),this.editor.initialized)){if(this.currentContent=null!==(t=this.currentContent)&&void 0!==t?t:this.editor.getContent(),"string"==typeof this.props.initialValue&&this.props.initialValue!==e.initialValue)this.editor.setContent(this.props.initialValue),this.editor.undoManager.clear(),this.editor.undoManager.add(),this.editor.setDirty(!1);else if("string"==typeof this.props.value&&this.props.value!==this.currentContent){const e=this.editor;e.undoManager.transact((()=>{let t;if(!this.inline||e.hasFocus())try{t=e.selection.getBookmark(3)}catch(e){}const l=this.valueCursor;if(e.setContent(this.props.value),!this.inline||e.hasFocus())for(const n of[t,l])if(n)try{e.selection.moveToBookmark(n),this.valueCursor=n;break}catch(e){}}))}if(this.props.disabled!==e.disabled){const e=null!==(l=this.props.disabled)&&void 0!==l&&l;Yf(this.editor,e?"readonly":"design")}}}componentDidMount(){var e,t,l,n,a,r;null!==Zf(this.view)?this.initialise():this.elementRef.current&&this.elementRef.current.ownerDocument&&Qf.load(this.elementRef.current.ownerDocument,this.getScriptSrc(),null!==(t=null===(e=this.props.scriptLoading)||void 0===e?void 0:e.async)&&void 0!==t&&t,null!==(n=null===(l=this.props.scriptLoading)||void 0===l?void 0:l.defer)&&void 0!==n&&n,null!==(r=null===(a=this.props.scriptLoading)||void 0===a?void 0:a.delay)&&void 0!==r?r:0,this.initialise)}componentWillUnmount(){const e=this.editor;e&&(e.off(this.changeEvents(),this.handleEditorChange),e.off(this.beforeInputEvent(),this.handleBeforeInput),e.off("keypress",this.handleEditorChangeSpecial),e.off("keydown",this.handleBeforeInputSpecial),e.off("NewBlock",this.handleEditorChange),Object.keys(this.boundHandlers).forEach((t=>{e.off(t,this.boundHandlers[t])})),this.boundHandlers={},e.remove(),this.editor=void 0)}render(){return this.inline?this.renderInline():this.renderIframe()}changeEvents(){var e,t,l;return(null===(l=null===(t=null===(e=Zf(this.view))||void 0===e?void 0:e.Env)||void 0===t?void 0:t.browser)||void 0===l?void 0:l.isIE())?"change keyup compositionend setcontent CommentChange":"change input compositionend setcontent CommentChange"}beforeInputEvent(){return window.InputEvent&&"function"==typeof InputEvent.prototype.getTargetRanges?"beforeinput SelectionChange":"SelectionChange"}renderInline(){const{tagName:e="div"}=this.props;return $.createElement(e,{ref:this.elementRef,id:this.id})}renderIframe(){return $.createElement("textarea",{ref:this.elementRef,style:{visibility:"hidden"},name:this.props.textareaName,id:this.id})}getScriptSrc(){if("string"==typeof this.props.tinymceScriptSrc)return this.props.tinymceScriptSrc;{const e=this.props.cloudChannel;return`https://cdn.tiny.cloud/1/${this.props.apiKey?this.props.apiKey:"no-api-key"}/tinymce/${e}/tinymce.min.js`}}getInitialValue(){return"string"==typeof this.props.initialValue?this.props.initialValue:"string"==typeof this.props.value?this.props.value:""}bindHandlers(e){if(void 0!==this.editor){zf(this.editor,e,this.props,this.boundHandlers,(e=>this.props[e]));const t=e=>void 0!==e.onEditorChange||void 0!==e.value,l=t(e),n=t(this.props);!l&&n?(this.editor.on(this.changeEvents(),this.handleEditorChange),this.editor.on(this.beforeInputEvent(),this.handleBeforeInput),this.editor.on("keydown",this.handleBeforeInputSpecial),this.editor.on("keyup",this.handleEditorChangeSpecial),this.editor.on("NewBlock",this.handleEditorChange)):l&&!n&&(this.editor.off(this.changeEvents(),this.handleEditorChange),this.editor.off(this.beforeInputEvent(),this.handleBeforeInput),this.editor.off("keydown",this.handleBeforeInputSpecial),this.editor.off("keyup",this.handleEditorChangeSpecial),this.editor.off("NewBlock",this.handleEditorChange))}}}var ep;Jf.propTypes=$f,Jf.defaultProps={cloudChannel:"6"},function(e){e["zh-cn"]="zh_CN",e["zh-tw"]="zh_TW",e.en="en"}(ep||(ep={}));const tp=e=>{var t;const{className:n,style:a,tinymce:r={},upload:i={},thresholdSize:o=.5,tinymceScriptSrc:s,disabled:u,value:c,onResizeEditor:f,onChange:p}=e,{global:m}=q.default.useContext(xe),{$size:h}=dt(e),{$locale:g,t:v}=ot(),y=400,b="preview importcss searchreplace autolink save directionality code visualblocks visualchars fullscreen image link media template codesample table charmap pagebreak nonbreaking anchor insertdatetime advlist lists wordcount help charmap quickbars emoticons",x="file edit view insert format tools table help",E="undo redo | blocks fontfamily fontsize | bold italic underline strikethrough | align numlist bullist | link image | table media | lineheight outdent indent| forecolor backcolor removeformat | charmap emoticons | code fullscreen preview | save print | pagebreak anchor codesample | ltr rtl",C=Object.assign(Object.assign({height:r.height||y,plugins:r.plugins||b,toolbar:r.toolbar||E,menubar:r.menubar||x,font_family_formats:"微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",font_size_formats:"10px 12px 14px 16px 18px 20px 24px 36px 48px 56px 72px",language:ep[g],skin:"tinymce-5"},He(r,["height","plugins","toolbar","menubar"])),{images_upload_handler:e=>{const{action:t,headers:n,dataKey:a,customHandler:r}=i;return r?r(e):new Promise(((r,i)=>Ie(void 0,void 0,void 0,(function*(){const s=`data:image/jpeg;base64,${e.base64()}`,u=new FormData;u.append("file",e.blob(),e.filename());const c=e.blob().size;if(t&&c/1024/1024>o)try{const e=yield fetch(t,{method:"POST",body:u,headers:n});if(!e.ok)throw i(""),new Error(v("qm.upload.uploadError"));const o=yield e.json();if(200===o.code){const e=a?l.get(o.data,a):o.data;r(e)}}catch(e){d.message.error(v("qm.uploadCropper.uploadError"))}else r(s)}))))},setup:e=>{e.on("ResizeEditor",(t=>{const{offsetWidth:l,offsetHeight:n}=e.editorContainer;null==f||f({width:l,height:n},t)}))}}),w=gt("tinymce"),S={[w]:!0,[`${w}--lg`]:"large"===h,[`${w}--sm`]:"small"===h},N={init:C,value:c,disabled:u,tinymceScriptSrc:s||(null===(t=null==m?void 0:m.tinymce)||void 0===t?void 0:t.scriptSrc)||void 0,onEditorChange:(e,t)=>{null==p||p(t.getContent(),t)}};return q.default.createElement("div",{className:J.default(S,n),style:a},q.default.createElement(Jf,N))};tp.displayName="QmTinymce";const lp=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{options:r={},upload:i,style:o={},readOnly:s,disabled:d=t.isFormDisabled}=e.option,{tinymce:u,thresholdSize:c,onResizeEditor:f}=r;return q.default.createElement(tp,{value:l,tinymce:u,upload:i,thresholdSize:c,style:Object.assign({width:"100%"},o),disabled:d||s||t.isOnlyShow,onResizeEditor:f,onChange:e=>{(e=>{null==n||n(e),a(e)})(e)}})};class np extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:u,validateTrigger:c,rules:f=[],onChange:p=Le}=this.props.option;return q.default.createElement(d.Form.Item,{label:e.renderFormLabel(l),className:J.default(s),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":$e(o)},required:e.getFormItemRequired(f)},q.default.createElement(d.Row,{wrap:!1,gutter:4},q.default.createElement(d.Col,{flex:"auto"},q.default.createElement(d.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(lp,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,t)}}))),u&&q.default.createElement(d.Col,{flex:$e(u.labelWidth||lr)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}np.contextType=Zn;class ap extends e.Component{constructor(e){var t;super(e),this.provide={$$form:this,echo_data:{}},this._fieldAuth={},this.wrapperRef=q.default.createRef(),this.formRef=q.default.createRef(),this.originItems=[],this.state={formData:{},viewData:{},other:{},extra:{},expand:{},flexCols:null!==(t=this.props.cols)&&void 0!==t?t:4,collapse:!!this.props.defaultExpand},this.resizeObserveHandler=()=>{var e;const t=null===(e=this.wrapperRef.current)||void 0===e?void 0:e.offsetWidth;if(void 0===t||0===t||this.props.cols>0)return;let l=Math.floor(t/300);l=24%l==0?l:l-1,l=l<1?1:l,l=l>8?8:l,l!==this.state.flexCols&&this.setState({flexCols:l})},this.resizeListenerHandle=l.debounce(this.resizeObserveHandler,10),this.getFormItems=oe.default((e=>e.filter((e=>!e.noAuth&&!e.hidden)))),this.getFlattenItems=oe.default((e=>{const t=[];return e.filter((e=>e.fieldName&&"DIVIDER"!==e.type)).forEach((e=>{l.isPlainObject(e.label)&&e.label.fieldName&&t.push(e.label),t.push(e)})),t})),this.valuesChangeHandle=(e,t)=>{var l,n;null===(n=(l=this.props).onValuesChange)||void 0===n||n.call(l,e,this._initialValues)},this.fieldsChangeHandle=(e,t)=>{var l,n;null===(n=(l=this.props).onFieldsChange)||void 0===n||n.call(l,e,t)},this.finishHandle=e=>{var t,l;null===(l=(t=this.props).onFinish)||void 0===l||l.call(t,Object.assign({},this.get_fields_other(),this.formatFormValue(e)))},this.finishFailedHandle=({values:e,errorFields:t})=>{var l,n;null===(n=(l=this.props).onFinishFailed)||void 0===n||n.call(l,t)},this.openValidateInfo=e=>{const t=q.default.createElement("ul",null,e.map((e=>{const{label:t}=this.formItems.find((t=>t.fieldName===e.name[0]));return q.default.createElement("li",{key:e.name[0],style:{color:"#ff4d4f"}},"[",("string"==typeof t?`${t}: `:"")+e.errors.join(","),"]")})));d.notification.error({message:Se("qm.form.validatePrompt"),description:t,duration:10})},this.scrollToField=e=>{if(!e)return;const t=this.wrapperRef.current.querySelector(`.${e}`);t&&re.default(t,{scrollMode:"if-needed",block:"nearest",behavior:"smooth"})},this.createOriginItems(),this.createInitialValues(),this.createInitialOthers(),this.createInitialExtras(),this.createFormAuth()}get $size(){var e,t;return null!==(t=null!==(e=this.props.size)&&void 0!==e?e:this.context.size)&&void 0!==t?t:""}get verticalLayout(){return"vertical"===this.props.layout}get formItems(){return this.getFormItems(this.props.items)}get flattenItems(){return this.getFlattenItems(this.formItems)}get dividers(){return this.formItems.filter((e=>"DIVIDER"===e.type))}get isFilterType(){return"search"===this.props.formType}get isOnlyShow(){return"onlyShow"===this.props.formType}get isFormDisabled(){return this.props.disabled}get isCompactMode(){var e,t;return null!==(e=this.props.compactMode)&&void 0!==e?e:"small"===this.$size&&!!(null===(t=this.context.global)||void 0===t?void 0:t.compactModeInSmallSize)}get showDividerCollapse(){return this.dividers.some((e=>!!e.collapse))}get showFilterCollapse(){return this.props.isCollapse&&this.formItems.length>=this.state.flexCols}componentDidMount(){this.checkFieldNames(),this.initialHandle(),this.createInputFocus(),this.bindResizeEvent(),this.resizeObserveHandler()}componentDidUpdate(e,t){this.props.items!==e.items&&this.checkFieldNames()}componentWillUnmount(){this.removeResizeEvent()}bindResizeEvent(){yn(this.wrapperRef.current,this.resizeListenerHandle)}removeResizeEvent(){bn(this.wrapperRef.current,this.resizeListenerHandle)}initialHandle(){this.setState({formData:this.createFormValue(this.props.initialValues),other:this.createOtherValue(this.props.initialValues),extra:this.createExtraValue(this.props.initialExtras),expand:this.createDividerExpand()})}checkFieldNames(){const e=this.flattenItems.map((e=>e.fieldName));[...new Set(e)].length!==e.length&&ft("Form","配置项 fieldName 属性是唯一的,不能重复")}getFormItemRequired(e=[]){return e.some((e=>e.required))}createOtherValue(e){const t=this.flattenItems.map((e=>e.fieldName)),l={};for(const n in e)t.includes(n)||(l[n]=e[n]);return Object.assign({},l)}createExtraValue(e){const t={};return this.flattenItems.filter((e=>l.isPlainObject(e.extra))).forEach((l=>{var n;t[l.fieldName]=null!==(n=e[l.fieldName])&&void 0!==n?n:""})),Object.assign({},t)}createDividerExpand(){const e={};return this.dividers.filter((e=>l.isPlainObject(e.collapse))).forEach((t=>{var l;e[t.fieldName]=null!==(l=t.collapse.defaultExpand)&&void 0!==l&&l})),Object.assign({},e)}getInitialValue(e,t){var l;const{type:n,options:a}=e;return t=null!=t?t:void 0,ir.includes(n)&&(t=null!=t?t:[]),"CHECKBOX"!==n&&"SWITCH"!==n||(t=null!==(l=null!=t?t:null==a?void 0:a.falseValue)&&void 0!==l?l:ar),t}createFormValue(e){const t={};return this.flattenItems.forEach((l=>{t[l.fieldName]=this.getInitialValue(l,e[l.fieldName])})),Object.assign({},e,t)}createInitialValues(){this._initialValues=this.createFormValue(this.props.initialValues)}createInitialOthers(){this._initialOthers=this.createOtherValue(this.props.initialValues)}createInitialExtras(){this._initialExtras=this.createExtraValue(this.props.initialExtras)}createOriginItems(){this.originItems=this.props.items.map((e=>({fieldName:e.fieldName,hidden:e.hidden})))}getOriginItems(){return this.originItems}setViewValue(e,t=""){t!==this.getViewValue(e)&&this.setState((l=>({viewData:Object.assign({},l.viewData,{[e]:t})})))}getViewValue(e){var t;return null!==(t=this.state.viewData[e])&&void 0!==t?t:""}setExpandHandle(e){e!==this.state.collapse&&this.setState({collapse:e},(()=>{Fe((()=>{var t,l;return null===(l=(t=this.props).onCollapse)||void 0===l?void 0:l.call(t,e)}))}))}createInputFocus(){const{isAutoFocus:e}=this.props;if(!e||this.isOnlyShow)return;const{type:t,fieldName:l}=this.formItems.filter((e=>e.fieldName))[0]||{};"INPUT"!==t&&"INPUT_NUMBER"!==t||!l||setTimeout((()=>this.CREATE_FOCUS(l)))}getFormItemLabel(e){var t,n,a,r,i;if(Cr(e))return ja(e);if(l.isPlainObject(e)){const{fieldName:l,label:o,options:s={}}=e;if(Cr(o))return ja(o);const{itemList:d=[]}=s,u=null!==(a=null!==(n=null===(t=this.formRef.current)||void 0===t?void 0:t.getFieldsValue([l])[l])&&void 0!==n?n:this._initialValues[l])&&void 0!==a?a:null===(r=d[0])||void 0===r?void 0:r.value;return(null===(i=d.find((e=>e.value===u)))||void 0===i?void 0:i.text)||""}return""}getBlockDerivedItems(){const e=[];for(let t=0,l=this.dividers.length;t<l;t++){const l=this.formItems.findIndex((e=>e===this.dividers[t]));let n=this.formItems.findIndex((e=>e===this.dividers[t+1]));n=n>-1?n:void 0,e.push(this.formItems.slice(l,n).map((e=>({label:e.label,fieldName:e.fieldName}))))}return e}getFormItemDisplay({type:e,fieldName:t}){var l,n;if("DIVIDER"===e)return!0;const a=this.getBlockDerivedItems();for(let e=0,r=a.length;e<r;e++){const r=a[e],i=this.dividers.find((e=>e.fieldName===r[0].fieldName)),o=null!==(n=null===(l=null==i?void 0:i.collapse)||void 0===l?void 0:l.showLimit)&&void 0!==n?n:r.length-1;for(let e=1;e<r.length;e++){if(r[e].fieldName===t&&e>o)return this.state.expand[r[0].fieldName]}}return!0}formatFormValue(e){var t,l;for(const n in e){const a=e[n];if(hr(a)&&(e[n]=""),Array.isArray(a)&&a.forEach(((t,l)=>{hr(t)&&(e[n][l]="")})),n.includes("|")&&Array.isArray(a)){const[r,i]=n.split("|");e[r]=null!==(t=a[0])&&void 0!==t?t:"",e[i]=null!==(l=a[1])&&void 0!==l?l:""}}if(this.isFilterType)for(const t in e)De(e[t])&&(e[t]=void 0);return e}setFieldAuth(e,t){this._fieldAuth[e]=t}createFormAuth(){var e,t,n;return Ie(this,void 0,void 0,(function*(){const{authConfig:a}=this.props;if(!a)return;let r=He(a,["fetch"]);if(a.fetch){const{api:t,params:n,dataKey:i}=a.fetch;try{const a=yield t(n);200===a.code&&(r=null!==(e=i?l.get(a.data,i):a.data)&&void 0!==e?e:{})}catch(e){}}if(Array.isArray(r.fieldList)){const e=this.props.items.map((e=>{const{fieldName:t}=e,l=r.fieldList.find((e=>e.dataIndex===t));if(l){const n=this.originItems.find((e=>e.fieldName===t)),{visible:a=1,disabled:r,secretName:i}=l;a||(e.noAuth=!0,n.noAuth=!0),r&&(e.disabled=!0,n.disabled=!0),i&&(e.options?e.options.secretType=i:e.options={secretType:i},n.options=Object.assign({},n.options,{secretType:i})),this.setFieldAuth(t,{visible:a,disabled:r,secretName:i})}return e}));null===(n=(t=this.props).fieldsChange)||void 0===n||n.call(t,e)}}))}INPUT(e){return q.default.createElement(Br,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT(e){return q.default.createElement(Gr,{option:e})}INPUT_NUMBER(e){return q.default.createElement(Xr,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT_NUMBER(e){return q.default.createElement(Zr,{option:e})}SEARCH_HELPER(e){return q.default.createElement(Ic,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}MULTIPLE_SEARCH_HELPER(e){return q.default.createElement(kc,{option:e})}TREE_TABLE_HELPER(e){return q.default.createElement(Mc,{option:e})}MULTIPLE_TREE_TABLE_HELPER(e){return q.default.createElement(qc,{option:e})}RANGE_SEARCH_HELPER(e){return q.default.createElement(Wc,{option:e})}CHECKBOX(e){return q.default.createElement(Vr,{option:e})}MULTIPLE_CHECKBOX(e){return q.default.createElement(Uc,{option:e})}RATE(e){return q.default.createElement(Yc,{option:e})}RADIO(e){return q.default.createElement(Qc,{option:e})}SWITCH(e){return q.default.createElement(Jc,{option:e})}TEXT_AREA(e){return q.default.createElement(tf,{option:e})}DATE(e){return q.default.createElement(nf,{option:e})}RANGE_DATE(e){return q.default.createElement(of,{option:e})}TIME(e){return q.default.createElement(df,{option:e})}RANGE_TIME(e){return q.default.createElement(cf,{option:e})}SELECT(e){return q.default.createElement(jr,{option:e})}MULTIPLE_SELECT(e){return q.default.createElement(jr,{option:e,multiple:!0})}IMMEDIATE(e){return q.default.createElement(pf,{option:e})}DIVIDER(e){return q.default.createElement(mf,{option:e})}TREE_SELECT(e){return q.default.createElement(vf,{option:e})}MULTIPLE_TREE_SELECT(e){return q.default.createElement(vf,{option:e,multiple:!0})}CASCADER(e){return q.default.createElement(bf,{option:e})}MULTIPLE_CASCADER(e){return q.default.createElement(bf,{option:e,multiple:!0})}CITY_SELECT(e){return q.default.createElement(Of,{option:e})}REGION_SELECT(e){return q.default.createElement(Lf,{option:e})}UPLOAD_FILE(e){return q.default.createElement(Af,{option:e})}UPLOAD_IMG(e){return q.default.createElement(Hf,{option:e})}TINYMCE(e){return q.default.createElement(np,{option:e})}renderFormLabel(e){if(Cr(e)||!l.isPlainObject(e))return q.default.createElement("span",{className:"text",title:ja(e)},e);const{type:t,fieldName:n,label:a,options:r={},onChange:i=Le}=e,{itemList:o=[]}=r;return"SELECT"===t?q.default.createElement(d.Form.Item,{name:n,noStyle:!0},q.default.createElement($r,{option:e,items:o,loading:!1,onValuesChange:(e,t)=>i(e,t)})):"CHECKBOX"===t?q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{className:"text",style:{paddingRight:5}},a),q.default.createElement(d.Form.Item,{name:n,noStyle:!0},q.default.createElement(Kr,{option:e,onValuesChange:e=>i(e)}))):null}renderFormItemExtra(e){const{fieldName:t,isTooltip:l,style:n,render:a}=e,{extra:r}=this.state;if(l)return q.default.createElement(d.Tooltip,{className:"extra-tooltip",title:r[t]},q.default.createElement(g.ExclamationCircleOutlined,{style:{marginLeft:4}}));const i=this.formItems.find((e=>e.fieldName===t)),{translate:o}=i,s=a?a(i,this):r[t],u=ja(s);return o&&u?q.default.createElement(Hr,{text:u,className:"extra-text",title:u,style:n},s):q.default.createElement("div",{className:"extra-text",title:u,style:n},s)}renderFormItemButton(e,t){const l=this.formItems.find((t=>t.fieldName===e)),n="function"==typeof t?t(l):t;return this.isOnlyShow?null:n}renderFormItem(e){const{label:t,fieldName:l,invisible:n,tooltip:a,className:r,labelWidth:i=this.props.labelWidth,validateTrigger:o,rules:s=[],style:u={},render:c}=e;return q.default.createElement(d.Form.Item,{label:this.renderFormLabel(t),name:l,rules:s,tooltip:a,hidden:n,className:J.default(r),style:Object.assign({width:"100%"},u),labelCol:{flex:this.verticalLayout?"initial":$e(i)},validateTrigger:o,messageVariables:{label:this.getFormItemLabel(t)}},this.formRef.current?c(e,this):q.default.createElement(q.default.Fragment,null))}createFormItem(e){return l.isFunction(this[e.type])?e.render?this.renderFormItem(e):this[e.type](e):(ft("Form",`配置项 ${e.fieldName} 的 type 类型错误`),null)}createFormLayout(){const{flexCols:e}=this.state,{formType:t,defaultRows:l,isFieldsDefine:n}=this.props,a=[];this.formItems.forEach((e=>{const{offsetLeft:t=0,offsetRight:l=0}=e;for(let e=0;e<t;e++)a.push({});a.push(e);for(let e=0;e<l;e++)a.push({})}));const r=24/e,i=[],o=a.reduce(((e,t)=>{const{selfCol:l=1}=t,n=e+l;return i.push(n),n}),0),s=l>Math.ceil(o/e)?Math.ceil(o/e):l,u=[],c=a.map(((t,l)=>{let{selfCol:n=1}=t;const{type:a,fieldName:o}=t;n=n>=24||"DIVIDER"===a||"TINYMCE"===a?e:n;const c=!(!this.state.collapse&&this.showFilterCollapse)||i[l]<s*e,f=!this.showDividerCollapse||this.getFormItemDisplay(t);return c&&u.push(i[l]),q.default.createElement(d.Col,{key:null!=o?o:l,className:o,span:n*r,style:this.isFilterType?{display:!this.showFilterCollapse||c?"block":"none"}:{display:f?"block":"none"}},a?this.createFormItem(qe(t)):null)}));return n&&"default"===t&&c.push(q.default.createElement("div",{className:"form-fields__define"},this.createFieldsDefine())),[...c,this.createSearchButtonLayout(u[u.length-1])]}createSearchButtonLayout(e=0){const{flexCols:t,collapse:l}=this.state,{searchButtonCols:n,isSearchBtn:a,isFieldsDefine:r=!0}=this.props;if(!this.isFilterType)return null;const i=24/t,o=n||1,s=t-e%t-o;return a?q.default.createElement(d.Col,{key:"-",span:o*i,offset:s*i,style:{textAlign:"right"}},q.default.createElement(d.Space,{style:{marginBottom:12}},q.default.createElement(pt,{type:"primary",size:this.$size,icon:q.default.createElement(g.SearchOutlined,null),onClick:()=>this.SUBMIT_FORM()},Se("qm.form.search")),q.default.createElement(pt,{size:this.$size,icon:q.default.createElement(g.ReloadOutlined,null),onClick:()=>this.RESET_FORM()},Se("qm.form.reset")),r?this.createFieldsDefine():null,this.showFilterCollapse&&q.default.createElement("a",{onClick:()=>this.setExpandHandle(!l)},l?q.default.createElement(g.UpOutlined,null):q.default.createElement(g.DownOutlined,null)," ",Se(l?"qm.form.collect":"qm.form.spread")))):null}createFormButtonLayout(){const{flexCols:e}=this.state,{formType:t,isSubmitBtn:l}=this.props;if(this.isFilterType)return null;const n=24/e;return l&&"default"===t?q.default.createElement(d.Row,{gutter:0},q.default.createElement(d.Col,{key:"-",span:n},q.default.createElement(d.Form.Item,null,q.default.createElement(d.Space,{style:{marginBottom:12}},q.default.createElement(pt,{type:"primary",size:this.$size,onClick:()=>this.SUBMIT_FORM()},Se("qm.form.save")),q.default.createElement(pt,{size:this.$size,onClick:()=>this.RESET_FORM()},Se("qm.form.reset")))))):null}createFieldsDefine(){const{uniqueKey:e,items:t,fieldsChange:l}=this.props;return q.default.createElement(zr,{uniqueKey:e,items:t,fieldsChange:l})}set_fields_other(e){this.setState((t=>({other:Object.assign({},t.other,this.createOtherValue(e))})))}get_fields_other(e){if(!e)return this.state.other;const t={};return e.forEach((e=>{t[e]=this.state.other[e]})),t}formValidate(){return new Promise(((e,t)=>Ie(this,void 0,void 0,(function*(){const[l,n]=yield this.VALIDATE_FIELDS(),a=this.formItems.filter((e=>"SEARCH_HELPER"===e.type)).filter((e=>{var t;return null===(t=this[`${e.fieldName}_Ref`])||void 0===t?void 0:t.searchRef._is_change})).map((e=>({name:[e.fieldName],errors:[Se("qm.form.searchHelperTips")],warnings:[]})));l||a.length?t((l||[]).concat(a)):e(n)}))))}SET_FIELDS_VALUE(e){this.formRef.current.setFieldsValue(e),this.set_fields_other(e)}GET_FIELDS_VALUE(e){return e?Object.assign({},this.get_fields_other(e),this.formRef.current.getFieldsValue(e)):Object.assign({},this.state.other,this.formRef.current.getFieldsValue(!0))}GET_FORM_DATA(){return Ie(this,void 0,void 0,(function*(){try{const e=yield this.formValidate();return[null,Object.assign({},this.get_fields_other(),this.formatFormValue(e))]}catch(e){return this.props.scrollToFirstError&&this.scrollToField(e[0].name[0]),[e,null]}}))}VALIDATE_FIELDS(e){return Ie(this,void 0,void 0,(function*(){try{return[null,yield this.formRef.current.validateFields(e)]}catch({errorFields:e}){return this.isCompactMode&&this.openValidateInfo(e),[e,null]}}))}SET_FIELDS_EXTRA(e){this.setState((t=>({extra:Object.assign({},t.extra,e)})))}SET_FIELDS_ECHO(e){Object.keys(e).length&&(Object.assign(this.provide,{echo_data:Object.assign({},this.provide.echo_data,e)}),this.forceUpdate())}GET_FIELDS_EXTRA(e){if(!e)return this.state.extra;const t={};return e.forEach((e=>{t[e]=this.state.extra[e]})),t}GET_FIELDS_TOUCHED(e){return this.formRef.current.isFieldsTouched(e)}SUBMIT_FORM(){return Ie(this,void 0,void 0,(function*(){try{yield this.formValidate(),this.formRef.current.submit()}catch(e){this.isFilterType&&this.setExpandHandle(!0)}}))}RESET_FORM(){var e,t;const l=this.flattenItems.filter((e=>e.noReset)).map((e=>e.fieldName)),n=this.flattenItems.map((e=>e.fieldName)).filter((e=>!l.includes(e)));n.length&&this.formRef.current.resetFields(n),this.setState((e=>{const t=Object.keys(e.other),l=Object.keys(this._initialOthers),n=t.filter((e=>!l.includes(e))),a={};return n.forEach((e=>a[e]=void 0)),{other:Object.assign({},this._initialOthers,a)}})),this.setState({extra:Object.assign({},this._initialExtras)}),null===(t=(e=this.props).onReset)||void 0===t||t.call(e)}CREATE_FOCUS(e){try{this[`${e}_Ref`].focus()}catch(e){ft("Form","参数 `fieldName` 的值不正确或者该表单项不支持获得焦点")}}SET_FORM_ITEM(e,t,n){const{items:a,fieldsChange:r}=this.props,i=a.find((t=>t.fieldName===e));if(!i)return ft("Form","SET_FORM_ITEM 方法参数 `fieldName` 的值不正确");if(!l.isPlainObject(t))return ft("Form","SET_FORM_ITEM 方法参数 `option` 的值不正确");if(i.noAuth)return ft("Form","SET_FORM_ITEM 方法不能操作受权限控制的表单项");for(const n in t)n&&(Object.keys(this._fieldAuth).includes(e)&&"disabled"===n||l.set(i,n,t[n]));n&&(r?r([...a]):ft("Form","需要设置 `fieldsChange` 参数"))}render(){var e,t;const{className:l,style:n,layout:a,disabled:r,labelWidth:i,labelAlign:o,labelWrap:s,component:u,customClass:c}=this.props,f=gt("form"),p=null!==(t=null!=s?s:null===(e=this.context.global)||void 0===e?void 0:e.labelWrap)&&void 0!==t&&t,m={required:"${label}"+Se("qm.form.requiredTips")},h={[f]:!0,[`${f}--lg`]:"large"===this.$size,[`${f}--sm`]:"small"===this.$size,[`${f}__only-show`]:this.isOnlyShow,[`${f}__label-wrap`]:p,[`${f}__compact`]:this.isCompactMode,[c]:!!c};return q.default.createElement("div",{ref:this.wrapperRef,className:J.default(h,l),style:n},q.default.createElement(d.Form,{ref:this.formRef,size:this.$size,initialValues:this._initialValues,layout:a,labelAlign:o,labelWrap:p,component:u,colon:!1,disabled:r,labelCol:{flex:this.verticalLayout?"initial":$e(i)},validateMessages:m,onValuesChange:this.valuesChangeHandle,onFieldsChange:this.fieldsChangeHandle,onFinish:this.finishHandle,onFinishFailed:this.finishFailedHandle},q.default.createElement(Zn.Provider,{value:this.provide},q.default.createElement(d.Row,{gutter:this.verticalLayout?20:0},this.createFormLayout()),this.createFormButtonLayout())))}}ap.contextType=xe,ap.propTypes=cr,ap.defaultProps=fr;const rp=e=>null!=e;function ip(e,t,l,n){const[a,r]=q.default.useState(void 0);q.default.useLayoutEffect((()=>{const t="function"==typeof e?e():e;r(t||null)}));const[i,o]=q.default.useState(null),s=()=>{if(a){!(e=>{const t=window.innerWidth||document.documentElement.clientWidth,l=window.innerHeight||document.documentElement.clientHeight,{top:n,right:a,bottom:r,left:i}=e.getBoundingClientRect();return n>=0&&i>=0&&a<=t&&r<=l})(a)&&t&&a.scrollIntoView(n);const{left:e,top:l,width:r,height:i}=a.getBoundingClientRect(),s={left:e,top:l,width:r,height:i,radius:0};o((e=>JSON.stringify(e)!==JSON.stringify(s)?s:e))}else o(null)};q.default.useLayoutEffect((()=>{s()}),[a,t]),Si({handler:s});return[q.default.useMemo((()=>{if(!i)return i;const e=(null==l?void 0:l.offset)||6,t=(null==l?void 0:l.radius)||2;return{left:i.left-e,top:i.top-e,width:i.width+2*e,height:i.height+2*e,radius:t}}),[i,l]),a]}const op={fill:"transparent",pointerEvents:"auto"},sp=e=>{const{prefixCls:t,rootClassName:l,pos:n,showMask:a,style:r={},fill:i="rgba(0,0,0,0.5)",open:o,animated:s,zIndex:d}=e,u=`${t}-mask-${pi()}`,c="object"==typeof s?null==s?void 0:s.placeholder:s;return q.default.createElement(ue.default,{open:o,autoLock:!0},q.default.createElement("div",{className:J.default(`${t}-mask`,l),style:Object.assign({position:"fixed",left:0,right:0,top:0,bottom:0,zIndex:d,pointerEvents:"none"},r)},a?q.default.createElement("svg",{style:{width:"100%",height:"100%"}},q.default.createElement("defs",null,q.default.createElement("mask",{id:u},q.default.createElement("rect",{x:"0",y:"0",width:"100vw",height:"100vh",fill:"white"}),n&&q.default.createElement("rect",{x:n.left,y:n.top,rx:n.radius,width:n.width,height:n.height,fill:"black",className:c?`${t}-placeholder-animated`:""}))),q.default.createElement("rect",tt({},n?null:op,{x:"0",y:"0",width:"100%",height:"100%",fill:i,mask:`url(#${u})`})),n&&q.default.createElement(q.default.Fragment,null,q.default.createElement("rect",tt({},op,{x:"0",y:"0",width:"100%",height:`${n.top}px`})),q.default.createElement("rect",tt({},op,{x:"0",y:"0",width:n.left,height:"100%"})),q.default.createElement("rect",tt({},op,{x:"0",y:n.top+n.height,width:"100%",height:`calc(100vh - ${n.top+n.height}px)`})),q.default.createElement("rect",tt({},op,{x:n.left+n.width,y:"0",width:`calc(100vw - ${n.left+n.width}px)`,height:"100%"})))):null))},dp=e=>{const{prefixCls:t,zIndex:l,open:n,onPause:a,onPlay:r}=e,[i,o]=yi(void 0,{value:n,postState:e=>null==e||e}),s=q.default.useRef(null),d=q.default.useRef(!1),u=st((e=>{c(e),e.shiftKey&&32===e.keyCode&&f()}));q.default.useEffect((()=>{const e=ae.default(document,"keyup",u);return()=>e.remove()}),[]);const c=e=>{e.stopPropagation(),e.preventDefault()},f=()=>{d.current?d.current=!1:(o(!i),i?null==a||a():null==r||r())};return q.default.createElement("div",{ref:s,className:`${t}-control`,style:{zIndex:l+1},onMouseDown:e=>{c(e);const t=s.current,l=t.offsetWidth,n=t.offsetHeight,a=window.innerWidth,r=window.innerHeight,i=e.clientX-nn(t).x,o=e.clientY-nn(t).y;return document.onmousemove=e=>{let s=e.clientX-i,u=e.clientY-o;s<0&&(s=0),s>a-l-1&&(s=a-l-1),u<0&&(u=0),u>r-n-1&&(u=r-n-1),en(t,{left:`${s}px`,top:`${u}px`}),d.current=!0},document.onmouseup=function(){this.onmousemove=null,this.onmouseup=null},!1},onClick:()=>f()},i?q.default.createElement(g.PauseOutlined,null):q.default.createElement(g.CaretRightOutlined,null))},up=e=>{const{prefixCls:t,current:l,total:n=0,cover:a,title:r,description:i,helper:o={},type:s,zIndex:u,onClose:c,onPrev:f,onNext:p,onFinish:m,className:h,indicatorsRender:v}=e,{t:y}=ot(),b="primary"!==s?"primary":"default",x=st((e=>{S(e),40===e.keyCode&&(l<n-1?null==p||p():null==m||m()),38===e.keyCode&&l>0&&(null==f||f())}));q.default.useEffect((()=>{const e=ae.default(document,"keyup",x);return()=>e.remove()}),[]);const E=rp(a)?q.default.createElement("div",{className:`${t}-cover`},a):null,C=rp(i)?q.default.createElement("div",{className:`${t}-description`},i):null;let w;w=v?v(l,n):[...Array.from({length:n}).keys()].map(((e,n)=>q.default.createElement("span",{key:e,className:J.default(n===l&&`${t}-indicator-active`,`${t}-indicator`)})));const S=e=>{e.stopPropagation(),e.preventDefault()};return q.default.createElement("div",{className:J.default(`${t}-content`,h)},q.default.createElement("div",{className:`${t}-inner`},q.default.createElement(g.CloseOutlined,{className:`${t}-close`,onClick:c}),o.content&&q.default.createElement(d.Popover,{placement:"bottom",overlayStyle:{width:360,zIndex:u},content:o.content,title:o.title},q.default.createElement(g.QuestionCircleOutlined,{className:J.default(`${t}-close`,"help-icon")})),E,q.default.createElement("div",{className:`${t}-header`},q.default.createElement("div",{className:`${t}-title`},r)),C,q.default.createElement("div",{className:`${t}-footer`},n>1&&q.default.createElement("div",{className:`${t}-indicators`},w),q.default.createElement(ht,{className:`${t}-buttons`},0!==l?q.default.createElement(pt,{className:`${t}-prev-btn`,size:"small",onMouseDown:S,onClick:f},y("qm.tour.prevStep")):null,l===n-1?q.default.createElement(pt,{className:`${t}-finish-btn`,type:b,size:"small",onClick:m},y("qm.tour.finish")):q.default.createElement(pt,{className:`${t}-next-btn`,type:b,size:"small",onMouseDown:S,onClick:p},y("qm.tour.nextStep"))))))},cp=e=>{const{current:t,renderPanel:l}=e;return q.default.createElement(q.default.Fragment,null,"function"==typeof l?l(e,t):q.default.createElement(up,e))},fp={left:"50%",top:"50%",width:1,height:1},pp=q.default.forwardRef(((e,t)=>{const{steps:l=[],defaultCurrent:n,current:a,onChange:r,onClose:i,onFinish:o,open:s,type:d="default",mask:u=!0,arrow:c=!0,control:f=!0,overlayClassName:p,overlayStyle:m,placement:h,helper:g,zIndex:v,renderPanel:y,indicatorsRender:b,gap:x,animated:E=!0,scrollIntoViewOptions:C=!0}=e,w=Ne(e,["steps","defaultCurrent","current","onChange","onClose","onFinish","open","type","mask","arrow","control","overlayClassName","overlayStyle","placement","helper","zIndex","renderPanel","indicatorsRender","gap","animated","scrollIntoViewOptions"]),S=q.default.useRef(),[N,T]=yi(0,{value:a,defaultValue:n}),[I,O]=yi(void 0,{value:s,postState:e=>!(N<0||N>=l.length)&&(null!=e&&e)}),[R,k]=yi(1051,{value:v,defaultValue:v}),[L,P]=q.default.useState(),A=q.default.useRef(I);q.default.useLayoutEffect((()=>{I&&!A.current&&T(0),A.current=I,P(I)}),[I]),q.default.useImperativeHandle(t,(()=>({OPEN:()=>O(!0),CLOSE:()=>O(!1),SET_ZINDEX:e=>k(e)})));const{target:F,type:_,placement:D,trigger:M,delay:H,style:$,arrow:j,className:K,mask:V,scrollIntoViewOptions:z,zIndex:W,action:B}=l[N]||{},U=W||R,G=_||d,Y=I&&(null!=V?V:u),X=null!=z?z:C,[Q,Z]=ip(F,!!s,x,X),ee=((e,t,l)=>{var n;return null!==(n=null!=l?l:t)&&void 0!==n?n:null===e?"center":"bottom"})(Z,h,D),te=!!Z&&(void 0===j?c:j),le="object"==typeof te&&te.pointAtCenter;q.default.useLayoutEffect((()=>{var e;null===(e=S.current)||void 0===e||e.forceAlign()}),[le,N]),Yl((()=>{I&&(re(),null==B||B(Z,N))}),[I,Z]);const ne=e=>{T(e),null==r||r(e)},ae=()=>{O(!1),null==i||i(N)},re=()=>{if(!Z)return;const e=[];!function t(l){if(1===l.nodeType){var n;"INPUT"!==l.tagName&&"TEXTAREA"!==l.tagName||("none"===Jl(n=l,"display")||"hidden"===Jl(n,"visibility")||"0"===Jl(n,"opacity"))||e.push(l);for(const e of Array.from(l.childNodes))t(e)}}(Z),e.length&&e[0].focus()};if(void 0===Z)return null;const ie=()=>Ie(void 0,void 0,void 0,(function*(){if(!M||!Z)return;const{left:e,top:t}=Z.getBoundingClientRect(),l=Z.offsetWidth,n=Z.offsetHeight,[a,r]=[e+l/2,t+n/2],i=new MouseEvent(M,{bubbles:!0,cancelable:!0,button:0,clientX:a,clientY:r}),o=document.elementFromPoint(a,r);o&&(o.dispatchEvent(i),yield Ae(null!=H?H:320))})),oe="boolean"==typeof Y?Y:!!Y,se="boolean"==typeof Y?void 0:Y,de=Object.assign({},m,$),ce=gt("tour"),fe=[{[`${ce}-primary`]:"primary"===G},p,K],pe=dd({arrowPointAtCenter:le,autoAdjustOverflow:!0,offset:6,arrowWidth:16,borderRadius:8});return q.default.createElement(q.default.Fragment,null,q.default.createElement(sp,{zIndex:U,prefixCls:ce,pos:Q,showMask:oe,style:null==se?void 0:se.style,fill:null==se?void 0:se.color,open:L,animated:E,rootClassName:p}),q.default.createElement(ue.default,{open:L,autoLock:!0},q.default.createElement(me.default,tt({ref:S},w,{zIndex:U,builtinPlacements:pe,popupStyle:de,popupPlacement:ee,popupVisible:L,popupClassName:J.default(fe),prefixCls:ce,popup:()=>q.default.createElement(cp,tt({key:"content",arrow:te,prefixCls:ce,total:l.length,helper:g,renderPanel:y,indicatorsRender:b,onPrev:()=>Ie(void 0,void 0,void 0,(function*(){yield ie(),ne(N-1)})),onNext:()=>Ie(void 0,void 0,void 0,(function*(){yield ie(),ne(N+1)})),onClose:ae,current:N,onFinish:()=>{ae(),null==o||o()}},Object.assign({},l[N],{zIndex:U,type:G}))),arrow:!!te,getTriggerDOMNode:e=>e||Z||document.body,forceRender:!1,destroyPopupOnHide:!0}),q.default.createElement("div",{className:J.default(p,`${ce}-target-placeholder`),style:Object.assign(Object.assign({},Q||fp),{position:"fixed",pointerEvents:"none"})}))),f&&q.default.createElement(ue.default,{open:I},q.default.createElement(dp,{zIndex:U,prefixCls:ce,onPause:()=>P(!1),onPlay:()=>P(!0)})))}));pp.displayName="QmTour";var mp={previewWidth:1100,defaultDistance:.45,logoHeight:60};const hp=e.createContext(void 0);var gp=null;function vp(){try{var e=navigator.userAgent;if(e.match(/Windows\sPhone/i))return!0;if(e.match(/iPhone|iPod|iPad/i))return!0;if(e.match(/Android/i))return!0;if(e.match(/Edge\D?\d+/i))return!0;var t=e.match(/Trident\D?\d+/i),l=e.match(/MSIE\D?\d+/i),n=e.match(/OPR\D?\d+/i),a=e.match(/Firefox\D?\d+/i),r=e.match(/x64/i);if(!t&&!l&&r)return!0;if(a){if((a=a[0].match(/\d+/))[0]>=41||r)return!0}else if(n){if((n=n[0].match(/\d+/))[0]>=32)return!0}else if(!t&&!l){var i=e.match(/Chrome\D?\d+/i);if(i&&(i=i[0].match(/\d+/))[0]>=41)return!0}return!1}catch(e){return!0}}function yp(e,t){var l;try{var n=navigator.userAgent,a=!!n.match(/MSIE/i)||!!n.match(/Trident/i);if(vp()){try{l=getCLodop()}catch(e){}if(!l&&"complete"!==document.readyState)return void d.message.warning("打印组件还没有加载完毕,请稍等一下再操作");if(!l)return;CLODOP.CVERSION,t&&t.parentNode&&t.parentNode.removeChild(t),e&&e.parentNode&&e.parentNode.removeChild(e)}else{a&&n.match(/x64/i);if(e||t?l=a?e:t:gp?l=gp:((l=document.createElement("object")).setAttribute("width",0),l.setAttribute("height",0),l.setAttribute("style","position:absolute;left:0px;top:-100px;width:0px;height:0px;"),a?l.setAttribute("classid","clsid:2105C259-1E0C-4534-8141-A753534CB4CA"):l.setAttribute("type","application/x-print-lodop"),document.documentElement.appendChild(l),gp=l),!l||!l.VERSION)return n.indexOf("Chrome"),n.indexOf("Firefox"),l}return l.VERSION<"6.2.2.6"&&vp(),l}catch(e){d.message.error("getLodop 出错:"+e)}}vp();const bp=e=>{const t=e/25.4*(()=>{var e;const t=[],{deviceXDPI:l,deviceYDPI:n}=window.screen;if(l&&n)t[0]=l,t[1]=n;else{let l=document.createElement("DIV");l.style.cssText="width: 1in; height: 1in; position: absolute; left: 0px; top: 0px; z-index: -1; visibility: hidden;",document.body.appendChild(l),t[0]=parseInt(l.offsetWidth.toString()),t[1]=parseInt(l.offsetHeight.toString()),null===(e=l.parentNode)||void 0===e||e.removeChild(l),l=null}return t})()[0];return Math.ceil(t)},xp=q.default.forwardRef(((e,t)=>{const{templateRender:l,directPrint:n}=e,{global:a}=q.default.useContext(xe),{$$preview:r}=q.default.useContext(hp),{state:i,isWindowsPrinter:o,pageSize:s}=r,d=q.default.useRef(null),u=q.default.useRef({}),c=q.default.useRef([]),f=q.default.useRef([]),p=q.default.useRef([]),[m,h]=q.default.useState(!0);q.default.useImperativeHandle(t,(()=>({createPreviewDom:O,createExportHtml:k,createPrintHtml:R,SHOW_PREVIEW:L,DIRECT_PRINT:P}))),Yl((()=>{I()}),[i.form.printerType,i.form.setting.direction,i.form.setting.distance,i.form.setting.fixedLogo]),q.default.useEffect((()=>{u.current.templateEl=d.current.querySelector(".origin-template").children[0],u.current.previewEl=d.current.querySelector(".workspace")}),[]);const g=q.default.useMemo((()=>{const{form:{setting:{direction:e}}}=i,t=o?10*mp.defaultDistance+10*mp.defaultDistance:0;return("vertical"===e?s[0]:s[1])-t}),[i,o,s]),v=q.default.useMemo((()=>{const{form:{setting:{direction:e}}}=i,t=o?10*mp.defaultDistance+10*mp.defaultDistance:0;return("vertical"===e?s[1]:s[0])-t}),[i,o,s]),y=q.default.useMemo((()=>{const{form:{setting:{distance:e}}}=i;return bp(g-10*(e.left-mp.defaultDistance)-10*(e.right-mp.defaultDistance))}),[i,g]),b=q.default.useMemo((()=>{const{form:{setting:{distance:e}}}=i;return bp(v-10*(e.top-mp.defaultDistance)-10*(e.bottom-mp.defaultDistance))}),[i,v]),x=i.form.scale,E=q.default.useMemo((()=>{const{form:{setting:{distance:e}}}=i;return{left:bp(10*e.left),right:bp(10*e.right),top:bp(10*e.top),bottom:bp(10*e.bottom)}}),[i]),C=q.default.useMemo((()=>{const{form:{printerType:e}}=i,{left:t,right:l,top:n,bottom:a}=E,r=y+t+l,o=mp.previewWidth-r<=0?0:(mp.previewWidth-r)/2,s=Math.abs((1-x)*r/2);let d=0;return x>1&&(d=s>o?-1*o:-1*s),x<1&&(d=r-2*s>mp.previewWidth?0:o>0?s:(mp.previewWidth-(r-2*s))/2),{width:`${y}px`,height:""+("stylus"===e?"auto":b+"px"),paddingLeft:`${t}px`,paddingRight:`${l}px`,paddingTop:`${n}px`,paddingBottom:`${a}px`,transform:`translateX(${d}px) scale(${x})`,opacity:m?0:1}}),[i,m,E,x,b,y]);c.current.some((e=>/^<tr[^>]+type="page-break"[^>]+><\/tr>$/.test(e)));const w=()=>{var e,t,l,n;const r=null!==(t=null===(e=null==a?void 0:a.print)||void 0===e?void 0:e.leftLogo)&&void 0!==t?t:"",i=null!==(n=null===(l=null==a?void 0:a.print)||void 0===l?void 0:l.rightLogo)&&void 0!==n?n:"";return[`<tr style="height: ${mp.logoHeight}px;">`,'<td colspan="8" align="left" style="vertical-align: top;">',r?`<img src="${r}" border="0" height="46" />`:"","</td>",'<td colspan="16" align="right" style="vertical-align: top;">',i?`<img src="${i}" border="0" height="46" />`:"","</td>","</tr>"].join("")},S=()=>{let e='<tr style="height: 0;">';for(let t=0;t<24;t++)e+=`<td width="${100/24}%" style="width: ${100/24}%; padding: 0;"></td>`;return e+="</tr>",e},N=()=>{let e=document.createElement("tr");var t,l;e.setAttribute("type","template-cols"),e.style.height="0",e.innerHTML=S().replace(/<tr[^>]+>/,"").replace(/<\/tr>/,""),t=e,(l=u.current.templateEl.children[0]).children[0]?l.insertBefore(t,l.children[0]):l.appendChild(t),e=null},T=()=>{const e=u.current.templateEl.children[0].children,t=[],l=[];for(let n=0;n<e.length;n++){if("template-cols"===e[n].getAttribute("type"))continue;const a=e[n].clientHeight;e[n].style.height=a+"px",l.push(a),t.push(e[n].outerHTML)}f.current=l,c.current=t},I=()=>{var e;if(!c.current.length)return;const{form:{setting:t,printerType:l}}=i;if(n)return p.current.push([S(),w(),...c.current]);const a=t.fixedLogo?b-mp.logoHeight:b;let o=[];if(p.current=[],"stylus"===l)p.current.push([S(),...t.fixedLogo?[w()]:[],...c.current]);else{let e=0;for(let l=0,n=f.current.length;l<n;l++){const r=c.current[l],i=f.current[l];t.fixedLogo||0!==l||(e+=mp.logoHeight),e+=i,e<=a?o.push(r):(p.current.push([S(),...t.fixedLogo?[w()]:[],...o]),o=[],e=0,l-=1),l===n-1&&o.length&&p.current.push([S(),...t.fixedLogo?[w()]:[],...o])}}t.fixedLogo||null===(e=p.current[0])||void 0===e||e.splice(1,0,w());for(let e=0,t=p.current.length;e<t&&e!==t-1;e++)p.current[e].push('<tr type="page-break" style="page-break-after: always;"></tr>');r.setState({currentPage:1,totalPage:p.current.length}),O()},O=()=>{var e,t;const{currentPage:l}=i;let n=`<table cellspacing="0" cellpadding="0" border="0" class="${u.current.templateEl.className}">`;n+=null!==(t=null===(e=p.current[l-1])||void 0===e?void 0:e.join(""))&&void 0!==t?t:"",n+="</table>",u.current.previewEl.innerHTML=n,u.current.previewEl.parentNode.scrollTop=0},R=e=>{let t=`<table cellspacing="0" cellpadding="0" border="0" class="${u.current.templateEl.className}">`;if(void 0!==e){t+=[...p.current[e-1]].join("")}else for(let e=0;e<p.current.length;e++)t+=p.current[e].join("");return t+="</table>",t},k=()=>{const e=[];for(let t=0;t<c.current.length;t++)e[t]=c.current[t].replace(/\s+/g," ").replace(/(<td[^>]+>)\s+/,"$1").replace(/\s+(<\/td>)/,"$1");return"<table>"+w()+S()+e.join("")+"</table>"},L=()=>Ie(void 0,void 0,void 0,(function*(){var e;if("TABLE"!==(null===(e=u.current.templateEl)||void 0===e?void 0:e.tagName))return A();u.current.previewEl.innerHTML||(N(),yield Ae(0),T(),I(),h(!1))})),P=()=>Ie(void 0,void 0,void 0,(function*(){var e;if("TABLE"!==(null===(e=u.current.templateEl)||void 0===e?void 0:e.tagName))return A();N(),yield Ae(0),T(),I(),h(!1),r.doPrint(R()),yield Ae(0),r.doClose()})),A=()=>{ft("Print","[PrintTemplate] 打印模板组件的根元素必须是 `table` 节点")},F={[gt("print-container")]:!0,"no-visible":n};return q.default.createElement("div",{ref:d,className:J.default(F)},q.default.createElement(mn,{wrapperClassName:"spin",spinning:m,tip:"Loading..."},q.default.createElement("div",{className:"preview"},q.default.createElement("div",{className:"origin-template",style:{width:`${y}px`,marginLeft:`-${Math.floor(y/2)}px`}},null==l?void 0:l()),q.default.createElement("div",{className:"workspace",style:C}))))}));xp.displayName="Container";class Ep extends e.Component{constructor(){super(...arguments),this.formRef=q.default.createRef(),this.createFormList=()=>[{type:"DIVIDER",fieldName:"_1",label:Se("qm.print.setPanel.printParameter")},{type:"SELECT",label:Se("qm.print.setPanel.pagerType"),fieldName:"pageSize",options:{itemList:[{text:"A2",value:"420*594"},{text:"A3",value:"420*297"},{text:"A4",value:"210*297"},{text:"A5",value:"210*148"},{text:Se("qm.print.setPanel.carbonPaper"),value:"241*280"}]}},{type:"RADIO",label:Se("qm.print.setPanel.printDirection"),fieldName:"direction",options:{itemList:[{text:Se("qm.print.setPanel.vertical"),value:"vertical"},{text:Se("qm.print.setPanel.horizontal"),value:"horizontal"}]}},{type:"CHECKBOX",fieldName:"doubleSide",label:{type:"SELECT",fieldName:"doubleSideType",options:{itemList:[{text:Se("qm.print.setPanel.autoDoublePrint"),value:"auto"},{text:Se("qm.print.setPanel.manualDoublePrint"),value:"manual"}]},disabled:!this.props.setting.doubleSide},options:{trueValue:1,falseValue:0},onChange:e=>{const{formList:t}=this.state;t.find((e=>"doubleSide"===e.fieldName)).label.disabled=!e,this.setState({formList:t})}},{type:"CHECKBOX",label:Se("qm.print.setPanel.fixedLogo"),fieldName:"fixedLogo",options:{trueValue:1,falseValue:0}},{type:"DIVIDER",fieldName:"_2",label:Se("qm.print.setPanel.printMargin")},{type:"INPUT_NUMBER",label:Se("qm.print.setPanel.leftMargin"),fieldName:"disleft",options:{min:mp.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Se("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Se("qm.print.setPanel.rightMargin"),fieldName:"disright",options:{min:mp.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Se("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Se("qm.print.setPanel.topMargin"),fieldName:"distop",options:{min:mp.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Se("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Se("qm.print.setPanel.bottomMargin"),fieldName:"disbottom",options:{min:mp.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Se("qm.print.setPanel.noEmpty")}]}],this.getInitialvalue=()=>{const{setting:e}=this.props,{distance:t}=e;return Object.assign({},{disleft:t.left,disright:t.right,distop:t.top,disbottom:t.bottom,pageSize:e.pageSize,direction:e.direction,doubleSide:e.doubleSide,doubleSideType:e.doubleSideType,fixedLogo:e.fixedLogo})},this.getInitialExtra=()=>({disleft:Se("qm.print.setPanel.sizeUnit"),disright:Se("qm.print.setPanel.sizeUnit"),distop:Se("qm.print.setPanel.sizeUnit"),disbottom:Se("qm.print.setPanel.sizeUnit")}),this.state={formList:this.createFormList()},this.confirmHandle=()=>Ie(this,void 0,void 0,(function*(){const[e,t]=yield this.formRef.current.GET_FORM_DATA();e||(this.props.onChange({distance:{left:t.disleft,right:t.disright,top:t.distop,bottom:t.disbottom},pageSize:t.pageSize,direction:t.direction,doubleSide:t.doubleSide,doubleSideType:t.doubleSideType,fixedLogo:t.fixedLogo}),this.cancelHandle())})),this.cancelHandle=()=>{this.props.onClose()}}render(){const{formList:e}=this.state;return q.default.createElement(q.default.Fragment,null,q.default.createElement(ap,{ref:this.formRef,items:e,initialValues:this.getInitialvalue(),initialExtras:this.getInitialExtra(),labelWidth:120,cols:2}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(pt,{onClick:()=>this.cancelHandle(),style:{marginRight:8}},Se("qm.dialog.close")),q.default.createElement(pt,{type:"primary",onClick:()=>this.confirmHandle()},Se("qm.dialog.confirm"))))}}Ep.contextType=xe;class Cp extends e.Component{constructor(){var e,t,l;super(...arguments),this.provide={$$preview:this},this.containRef=q.default.createRef(),this.state={visible:!1,form:{printerName:-1,printerType:(null===(e=this.props.defaultConfig)||void 0===e?void 0:e.printerType)||"laser",copies:(null===(t=this.props.defaultConfig)||void 0===t?void 0:t.copies)||1,scale:1,setting:{distance:{left:mp.defaultDistance,right:mp.defaultDistance,top:mp.defaultDistance,bottom:mp.defaultDistance},pageSize:"210*297",direction:(null===(l=this.props.defaultConfig)||void 0===l?void 0:l.direction)||"vertical",doubleSide:0,doubleSideType:"auto",fixedLogo:0}},printPage:void 0,currentPage:1,totalPage:0},this.pageChangeHandle=e=>{this.setState({currentPage:e},(()=>{this.containRef.current.createPreviewDom()}))},this.exportClickHandle=()=>{this.doExport(this.containRef.current.createExportHtml())},this.printClickHandle=()=>Ie(this,void 0,void 0,(function*(){if(this.doPrint(this.containRef.current.createPrintHtml(this.state.printPage)),this.props.uniqueKey)try{const e=Object.assign(Object.assign({},this.state.form),{printerName:this.printerItems.find((e=>e.value===this.state.form.printerName)).text});yield pe.default.setItem(this.printerKey,e),yield this.savePrintConfig(this.printerKey,e)}catch(e){}})),this.doClose=()=>{var e,t;null===(t=(e=this.props).onClose)||void 0===t||t.call(e)},this.getPrintConfig=e=>Ie(this,void 0,void 0,(function*(){const t=this.context.global,l=null==t?void 0:t.getComponentConfigApi;if(l)try{const t=yield l({key:e});if(200===t.code)return t.data}catch(e){}})),this.savePrintConfig=(e,t)=>Ie(this,void 0,void 0,(function*(){const l=this.context.global,n=null==l?void 0:l.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),this.createStyle=()=>'\n <style type="text/css">\n table {\n width: 100%;\n border-spacing: 0;\n border-collapse: collapse;\n table-layout: fixed;\n }\n table tr td {\n padding: 2px;\n line-height: 1.2;\n word-wrap: break-word;\n }\n .fs12 {\n font-size: 12px;\n }\n .fs13 {\n font-size: 13px;\n }\n .fs14 {\n font-size: 14px;\n }\n .fw500 {\n font-weight: 500;\n }\n .fw700 {\n font-weight: 700;\n }\n .fl {\n float: left;\n }\n .fr {\n float: right;\n }\n .tc {\n text-align: center;\n }\n .tr {\n text-align: right;\n }\n .bor {\n border: 1px solid #000;\n }\n .bor-t {\n border-top: 1px solid #000;\n }\n .bor-b {\n border-bottom: 1px solid #000;\n }\n .bor-l {\n border-left: 1px solid #000;\n }\n .bor-r {\n border-right: 1px solid #000;\n }\n .no-bor {\n border: none !important;\n }\n </style>\n ',this.doPrint=e=>{const t=yp();if(!t)return;const{uniqueKey:l,closeAfterPrint:n}=this.props,{form:{setting:a,printerName:r,printerType:i,copies:o}}=this.state,{pageSize:s}=this,{defaultDistance:u}=mp,{left:c,right:f,top:p,bottom:m}=a.distance;t.PRINT_INIT(null!=l?l:Math.random().toString().slice(2)),t.SET_PRINTER_INDEX(r),t.SET_PRINT_COPIES(o),a.doubleSide&&("auto"===a.doubleSideType?(t.SET_PRINT_MODE("PRINT_DUPLEX",2),t.SET_PRINT_MODE("PRINT_DEFAULTSOURCE",1)):t.SET_PRINT_MODE("DOUBLE_SIDED_PRINT",1)),t.SET_PRINT_MODE("AUTO_CLOSE_PREWINDOW",1),"laser"===i&&("vertical"===a.direction&&t.SET_PRINT_PAGESIZE(1),"horizontal"===a.direction&&(t.SET_PRINT_PAGESIZE(2),t.SET_SHOW_MODE("LANDSCAPE_DEFROTATED",1))),"stylus"===i&&t.SET_PRINT_PAGESIZE(3,10*s[0],100*m*2,""),t.ADD_PRINT_TABLE(10*(p-u)+"mm",10*(c-u)+"mm",`RightMargin: ${10*(f-u)}mm`,`BottomMargin: ${"stylus"!==i?10*(m-u):0}mm`,this.createStyle()+e),t.On_Return=(e,t)=>{t?n&&this.doClose():d.message.error(Se("qm.print.printError"))},t.PRINT()},this.doExport=e=>{const t=yp();if(!t)return;const{uniqueKey:l,closeAfterPrint:n}=this.props,{form:{setting:a}}=this.state;t.PRINT_INIT(null!=l?l:Math.random().toString().slice(2)),t.On_Return=(e,t)=>{t?n&&this.doClose():d.message.error(Se("qm.print.exportError"))},t.ADD_PRINT_TABLE(0,0,"RightMargin: 0","BottomMargin: 0",this.createStyle()+e),t.SET_SAVE_MODE("Orientation","vertical"===a.direction?1:2),t.SAVE_TO_FILE(`${j.default().format("YYYYMMDDHHmmss")}.xlsx`)}}get printerTypeItems(){return[{text:Se("qm.print.laserPrinter"),value:"laser"},{text:Se("qm.print.stylusPrinter"),value:"stylus"}]}get printerItems(){const e=yp(),t=[{text:Se("qm.print.defaultPrinter"),value:-1}];try{const l=e.GET_PRINTER_COUNT();for(let n=0;n<l;n++)t.push({text:e.GET_PRINTER_NAME(n),value:n})}catch(e){ft("Print","[ClientPrint]: 请安装 LODOP 打印插件")}return t}get isWindowsPrinter(){const{form:{printerName:e}}=this.state;return!/OneNote|Microsoft|Fax/.test(this.printerItems.find((t=>t.value===e)).text)}get pageSize(){return this.state.form.setting.pageSize.split("*").map((e=>Number(e)))}get printerKey(){return this.props.uniqueKey?`print_${this.props.uniqueKey}`:""}componentDidMount(){var e,t;return Ie(this,void 0,void 0,(function*(){if(this.props.uniqueKey)try{let n=yield pe.default.getItem(this.printerKey);n||(n=yield this.getPrintConfig(this.printerKey),l.isPlainObject(n)&&(yield pe.default.setItem(this.printerKey,n))),l.isPlainObject(n)&&Object.keys(n).length&&l.merge(this.state.form,Object.assign(Object.assign({},n),{printerName:null!==(t=null===(e=this.printerItems.find((e=>e.text===n.printerName)))||void 0===e?void 0:e.value)&&void 0!==t?t:-1}))}catch(e){}}))}render(){const{preview:e,templateRender:t}=this.props,{visible:n,form:a,currentPage:r,totalPage:i,printPage:o}=this.state,s=gt("print-preview"),u={visible:n,title:Se("qm.print.pageSetting"),width:"50%",loading:!1,containerStyle:{paddingBottom:"52px"},onClose:()=>{this.setState({visible:!1})}},c={[s]:!0};return e?q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:J.default(c)},q.default.createElement("div",{className:"outer"},q.default.createElement("div",{className:"header"},q.default.createElement("span",null,Se("qm.print.printer"),":",q.default.createElement(d.Select,{value:a.printerName,onChange:e=>{this.setState((t=>l.merge({},t,{form:{printerName:e}})))},style:{width:"120px"}},this.printerItems.map((e=>q.default.createElement(d.Select.Option,{key:e.value,value:e.value},e.text))))),q.default.createElement("span",null,Se("qm.print.type"),":",q.default.createElement(d.Select,{value:a.printerType,onChange:e=>{this.setState((t=>l.merge({},t,{form:{printerType:e,setting:{pageSize:"stylus"===e?"241*280":"210*297"}}})))},style:{width:"120px"}},this.printerTypeItems.map((e=>q.default.createElement(d.Select.Option,{key:e.value,value:e.value},e.text))))),q.default.createElement("span",null,Se("qm.print.copies"),":",q.default.createElement(d.InputNumber,{value:a.copies,min:1,precision:0,onChange:e=>{this.setState((t=>l.merge({},t,{form:{copies:null!=e?e:1}})))},style:{width:"50px"}})),q.default.createElement("span",null,Se("qm.print.printPage.0"),q.default.createElement(d.InputNumber,{value:o,min:1,max:i,precision:0,onChange:e=>{this.setState({printPage:null!=e?e:void 0})},style:{width:"50px",marginLeft:"4px",marginRight:"4px"}}),Se("qm.print.printPage.1")),q.default.createElement("span",null,q.default.createElement(d.Pagination,{size:"small",current:r,pageSize:1,total:i,onChange:this.pageChangeHandle})),q.default.createElement("span",null,q.default.createElement(pt,{type:"text",icon:q.default.createElement(g.SettingOutlined,null),className:"text-btn",onClick:()=>this.setState({visible:!0})},Se("qm.print.setting"))),q.default.createElement("span",null,q.default.createElement(pt,{type:"text",icon:q.default.createElement(g.DownloadOutlined,null),className:"text-btn",onClick:()=>this.exportClickHandle()},Se("qm.print.export"))),q.default.createElement("span",null,q.default.createElement(pt,{icon:q.default.createElement(g.PrinterOutlined,null),type:"primary",onClick:this.printClickHandle},Se("qm.print.print")))),q.default.createElement("div",{className:"main"},q.default.createElement(hp.Provider,{value:this.provide},q.default.createElement(xp,{ref:this.containRef,templateRender:t,directPrint:!1}))),q.default.createElement("div",{className:"footer"},q.default.createElement("span",null,Se("qm.print.scale"),":",q.default.createElement(d.Slider,{value:a.scale,step:.1,min:.5,max:1.5,onChange:e=>{this.setState((t=>l.merge({},t,{form:{scale:e}})))}}),q.default.createElement("em",{className:"scale-text"},`${Math.floor(100*a.scale)}%`)),q.default.createElement("span",null,Se("qm.print.paper"),":",this.pageSize[0],"mm * ",this.pageSize[1],"mm"),q.default.createElement("span",null,Se("qm.print.pageNumber"),":",Se("qm.print.pagination",{currentPage:r,totalPage:i}))))),q.default.createElement(Qn,u,q.default.createElement(Ep,{setting:a.setting,onChange:e=>{this.setState((t=>l.merge({},t,{form:{setting:e}})))},onClose:()=>{this.setState({visible:!1})}}))):q.default.createElement(hp.Provider,{value:this.provide},q.default.createElement(xp,{ref:this.containRef,templateRender:t,directPrint:!0}))}}Cp.contextType=xe;class wp extends e.Component{constructor(){super(...arguments),this.previewRef=q.default.createRef(),this.state={visible:!1,loading:!1},this.clickHandle=()=>Ie(this,void 0,void 0,(function*(){var e,t;this.setState({loading:!0});try{const l=yield null===(t=(e=this.props).click)||void 0===t?void 0:t.call(e);if(this.setState({loading:!1}),"boolean"==typeof l&&!l)return;yield this.DO_PRINT()}catch(e){}this.setState({loading:!1})})),this.createRender=()=>{const{visible:e}=this.state,{templateRender:t,uniqueKey:l,defaultConfig:n,preview:a,closeAfterPrint:r}=this.props,i={visible:e,title:Se("qm.print.preview"),width:`${mp.previewWidth}px`,loading:!1,onClose:()=>{this.setState({visible:!1})}},o={ref:this.previewRef,templateRender:t,uniqueKey:l,defaultConfig:n,preview:a,closeAfterPrint:r,onClose:()=>{this.setState({visible:!1})}};return a?q.default.createElement(Qn,i,q.default.createElement(Cp,o)):e?q.default.createElement(Cp,o):null},this.DO_PRINT=()=>Ie(this,void 0,void 0,(function*(){const{preview:e}=this.props;yield Ae(0),this.setState({visible:!0}),yield Ae(e?500:0);const t=this.previewRef.current.containRef.current;e?t.SHOW_PREVIEW():t.DIRECT_PRINT()}))}render(){const{loading:e}=this.state,{size:t,icon:l,type:n,disabled:a,shape:r}=this.props,i={size:t||this.context.size||"",type:n,shape:r,icon:l,loading:e,disabled:a,click:this.clickHandle};return q.default.createElement(q.default.Fragment,null,this.props.children&&q.default.createElement(pt,i,this.props.children),this.createRender())}}function Sp(e){return e.ownerDocument?e.ownerDocument.defaultView:null}function Np(e){const t=Sp(e);return t?t.frameElement:null}function Tp(e){const t=Rp(e);return Ip([e.getBoundingClientRect(),{top:t.borderTop,left:t.borderLeft,bottom:t.borderBottom,right:t.borderRight,width:0,height:0}])}function Ip(e){return e.reduce(((e,t)=>null==e?t:{top:e.top+t.top,left:e.left+t.left,width:e.width,height:e.height,bottom:e.bottom+t.bottom,right:e.right+t.right}))}function Op(e,t){const l=Np(e);if(l&&l!==t){const n=[e.getBoundingClientRect()];let a=l,r=!1;for(;a;){const e=Tp(a);if(n.push(e),a=Np(a),r)break;a&&Sp(a)===t&&(r=!0)}return Ip(n)}return e.getBoundingClientRect()}function Rp(e){const t=window.getComputedStyle(e);return{borderLeft:parseInt(t.borderLeftWidth,10),borderRight:parseInt(t.borderRightWidth,10),borderTop:parseInt(t.borderTopWidth,10),borderBottom:parseInt(t.borderBottomWidth,10),marginLeft:parseInt(t.marginLeft,10),marginRight:parseInt(t.marginRight,10),marginTop:parseInt(t.marginTop,10),marginBottom:parseInt(t.marginBottom,10),paddingLeft:parseInt(t.paddingLeft,10),paddingRight:parseInt(t.paddingRight,10),paddingTop:parseInt(t.paddingTop,10),paddingBottom:parseInt(t.paddingBottom,10)}}wp.propTypes={size:(e,t,l)=>{if(!tr(e[t]||""))return ct("Print","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},templateRender:se.default.elementType},wp.defaultProps={preview:!0,type:"primary",icon:q.default.createElement(g.PrinterOutlined,null)},wp.contextType=xe;const kp=Object.assign;class Lp{constructor(e,t){this.node=e.createElement("div"),this.border=e.createElement("div"),this.padding=e.createElement("div"),this.content=e.createElement("div"),this.border.style.borderColor=_p.border,this.padding.style.borderColor=_p.padding,this.content.style.backgroundColor=_p.background,kp(this.node.style,{borderColor:_p.margin,pointerEvents:"none",position:"fixed"}),this.node.style.zIndex="10000000",this.node.appendChild(this.border),this.border.appendChild(this.padding),this.padding.appendChild(this.content),t.appendChild(this.node)}remove(){this.node.parentNode&&this.node.parentNode.removeChild(this.node)}update(e,t){Fp(t,"margin",this.node),Fp(t,"border",this.border),Fp(t,"padding",this.padding),kp(this.content.style,{height:e.height-t.borderTop-t.borderBottom-t.paddingTop-t.paddingBottom+"px",width:e.width-t.borderLeft-t.borderRight-t.paddingLeft-t.paddingRight+"px"}),kp(this.node.style,{top:e.top-t.marginTop+"px",left:e.left-t.marginLeft+"px"})}}class Pp{constructor(e,t){this.tip=e.createElement("div"),kp(this.tip.style,{display:"flex",flexFlow:"row nowrap",backgroundColor:"#333740",borderRadius:"2px",fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace',fontWeight:"bold",padding:"3px 5px",pointerEvents:"none",position:"fixed",fontSize:"12px",whiteSpace:"nowrap"}),this.nameSpan=e.createElement("span"),this.tip.appendChild(this.nameSpan),kp(this.nameSpan.style,{color:"#ee78e6",borderRight:"1px solid #aaaaaa",paddingRight:"0.5rem",marginRight:"0.5rem"}),this.dimSpan=e.createElement("span"),this.tip.appendChild(this.dimSpan),kp(this.dimSpan.style,{color:"#d7d7d7"}),this.tip.style.zIndex="10000000",t.appendChild(this.tip)}remove(){this.tip.parentNode&&this.tip.parentNode.removeChild(this.tip)}updateText(e,t,l){this.nameSpan.textContent=e,this.dimSpan.textContent=Math.round(t)+"px × "+Math.round(l)+"px"}updatePosition(e,t){const l=this.tip.getBoundingClientRect(),n=function(e,t,l){const n=Math.max(l.height,20),a=Math.max(l.width,60),r=5;let i;i=e.top+e.height+n<=t.top+t.height?e.top+e.height<t.top+0?t.top+r:e.top+e.height+r:e.top-n<=t.top+t.height?e.top-n-r<t.top+r?t.top+r:e.top-n-r:t.top+t.height-n-r;let o=e.left+r;e.left<t.left&&(o=t.left+r);e.left+a>t.left+t.width&&(o=t.left+t.width-a-r);return i+="px",o+="px",{style:{top:i,left:o}}}(e,t,{width:l.width,height:l.height});kp(this.tip.style,n.style)}}class Ap{constructor(){const e=window;this.window=e;const t=window;this.tipBoundsWindow=t;const l=e.document;this.container=l.createElement("div"),this.container.style.zIndex="10000000",this.tip=new Pp(l,this.container),this.rects=[],l.body.appendChild(this.container)}remove(){this.tip.remove(),this.rects.forEach((e=>{e.remove()})),this.rects.length=0,this.container.parentNode&&this.container.parentNode.removeChild(this.container)}inspect(e,t){const l=e.filter((e=>e.nodeType===Node.ELEMENT_NODE));for(;this.rects.length>l.length;){const e=this.rects.pop();null==e||e.remove()}if(0===l.length)return;for(;this.rects.length<l.length;)this.rects.push(new Lp(this.window.document,this.container));const n={top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,left:Number.POSITIVE_INFINITY};l.forEach(((e,t)=>{const l=Op(e,this.window),a=Rp(e);n.top=Math.min(n.top,l.top-a.marginTop),n.right=Math.max(n.right,l.left+l.width+a.marginRight),n.bottom=Math.max(n.bottom,l.top+l.height+a.marginBottom),n.left=Math.min(n.left,l.left-a.marginLeft);this.rects[t].update(l,a)})),t||(t=l[0].nodeName.toLowerCase(),l[0]),this.tip.updateText(t,n.right-n.left,n.bottom-n.top);const a=Op(this.tipBoundsWindow.document.documentElement,this.window);this.tip.updatePosition({top:n.top,left:n.left,height:n.bottom-n.top,width:n.right-n.left},{top:a.top+this.tipBoundsWindow.scrollY,left:a.left+this.tipBoundsWindow.scrollX,height:this.tipBoundsWindow.innerHeight,width:this.tipBoundsWindow.innerWidth})}}function Fp(e,t,l){kp(l.style,{borderTopWidth:e[t+"Top"]+"px",borderLeftWidth:e[t+"Left"]+"px",borderRightWidth:e[t+"Right"]+"px",borderBottomWidth:e[t+"Bottom"]+"px",borderStyle:"solid"})}const _p={background:"rgba(120, 170, 210, 0.7)",padding:"rgba(77, 200, 0, 0.3)",margin:"rgba(255, 155, 0, 0.3)",border:"rgba(255, 200, 50, 0.3)"};let Dp=null,Mp=null;function Hp(){null!=window.document&&(Dp=null,null!==Mp&&(Mp.remove(),Mp=null))}class qp{constructor(e){this._lastHoveredNode=null,this.iframesListeningTo=new Set,this.onClick=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())},this.onMouseEvent=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())},this.onPointerDown=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation(),this.selectFiberForNode(this.getEventTarget(e)))},this.onPointerMove=e=>{e.preventDefault(),e.stopPropagation();const t=this.getEventTarget(e);if(this._lastHoveredNode!==t){if(this._lastHoveredNode=t,this.excludeSelectors.some((e=>rn(t,window.document.querySelector(e)))))return this._selectIgnore=!0,Hp();if(this._selectIgnore=!1,"IFRAME"===t.tagName){const e=t;try{if(!this.iframesListeningTo.has(e)){const t=e.contentWindow;this.registerListenersOnWindow(t),this.iframesListeningTo.add(e)}}catch(e){}}var l,n,a;l=[t],n=null,a=!1,null!=window.document?(null!==Dp&&clearTimeout(Dp),null!=l&&(null===Mp&&(Mp=new Ap),Mp.inspect(l,n),a&&(Dp=setTimeout((()=>Hp()),2e3)))):null!=l&&null!=l[0]&&console.error("showNativeHighlight",l[0])}},this.onPointerUp=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())},this.selectFiberForNode=l.throttle((e=>{var t;this._selectIgnore||null===(t=this.onSelect)||void 0===t||t.call(this,e,function(e){if(!(e instanceof Element))return"";const t=document.documentElement;let l=e;const n=[];for(;l!==t&&null!==l;){let e=l.tagName.toLowerCase();const t=/(?:\b|\w+-)(actived?|select(ed)?|focus(ed)?|open(ed)?)$/;for(let e=0,n=Array.from(l.classList).reverse();e<n.length;e++)t.test(n[e])&&l.classList.remove(n[e]);if(l.id&&/^rc-\w+/.test(l.id)&&l.removeAttribute("id"),l.id)e+=`#${l.id}`;else{const t=Array.from(l.parentElement.children).filter((e=>e.tagName===l.tagName)),n=l.className.trim();if(t.filter((e=>e.className.includes(n))).length<=1){if(n){const t=n.split(/\s+/);let l="";for(let e=0;e<t.length;e++)/^ant-col-\d+$/.test(t[e])||(l+=`.${t[e]}`);e+=l}}else l.getAttribute("name")?e+=`[name=${l.getAttribute("name")}]`:e+=`:nth-of-type(${t.indexOf(l)+1})`}l.nodeType!==Node.TEXT_NODE&&n.unshift(e),l=l.parentElement}return n.join(" > ")}(e))}),200,{leading:!1}),this.excludeSelectors=e.excludeSelectors||[],this.onSelect=e.onSelect}startHandle(){this.startInspectingNative()}stopHandle(){this.stopInspectingNative()}startInspectingNative(){this._isRunning||(this.registerListenersOnWindow(window),this._isRunning=!0)}stopInspectingNative(){Hp(),this.removeListenersOnWindow(window),this.iframesListeningTo.forEach((function(e){try{this.removeListenersOnWindow(e.contentWindow)}catch(e){}})),this.iframesListeningTo=new Set,this._isRunning=!1}registerListenersOnWindow(e){e&&"function"==typeof e.addEventListener&&(e.addEventListener("click",this.onClick,!0),e.addEventListener("mousedown",this.onMouseEvent,!0),e.addEventListener("mouseover",this.onMouseEvent,!0),e.addEventListener("mouseup",this.onMouseEvent,!0),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0))}removeListenersOnWindow(e){e&&"function"==typeof e.removeEventListener&&(e.removeEventListener("click",this.onClick,!0),e.removeEventListener("mousedown",this.onMouseEvent,!0),e.removeEventListener("mouseover",this.onMouseEvent,!0),e.removeEventListener("mouseup",this.onMouseEvent,!0),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0))}getEventTarget(e){return e.composed?e.composedPath()[0]:e.target}}function $p(e){return document.querySelector(e)}const jp=e=>{const{action:t,onConfirm:l,onCancel:n,onFinish:a}=e,{t:r}=ot();return q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{style:{height:100}},r("qm.table.config.emptyText")),q.default.createElement(ht,{style:{width:"100%",justifyContent:"flex-end"}},q.default.createElement(pt,{size:"small",onClick:()=>null==n?void 0:n()},r("qm.guideTracker.closeButton")),q.default.createElement(pt,{size:"small",onClick:()=>null==l?void 0:l()},r("add"===t?"qm.guideTracker.addButton":"qm.guideTracker.editButton")),q.default.createElement(pt,{size:"small",onClick:()=>null==a?void 0:a()},r("qm.guideTracker.finishButton"))))},Kp={left:"50%",top:"50%",width:1,height:1},Vp=q.default.forwardRef(((e,t)=>{const{open:n,current:a,defaultCurrent:r,steps:i=[],placement:o="bottom",control:s=!0,overlayClassName:u,overlayStyle:c,destroyOnHide:f,contentRender:p,zIndex:m,helper:h={},selectFilter:v=(e=>e),onSelect:y,onChange:b,onClose:x,onFinish:E}=e,{t:C}=ot(),w=q.default.useRef(),S=q.default.useRef(i.length),[N,T]=yi(0,{value:a,defaultValue:r}),[O,R]=yi(void 0,{value:n,postState:e=>null!=e&&e}),[k,L]=yi(1051,{value:m,defaultValue:m}),[P,A]=q.default.useState({}),[F,_]=q.default.useState(!1),[D,M]=q.default.useState(O),[H,$]=q.default.useState(!1),[j,K]=ip(P.node,!!n),[V,z]=q.default.useState(22),W=q.default.useRef(!1),B=q.default.useMemo((()=>N>=i.length?"add":"edit"),[N,i]),U=q.default.useMemo((()=>`${N+1} / ${i.length}`),[N,i]);q.default.useLayoutEffect((()=>{w.current=new qp({excludeSelectors:[".qm-guide-tracker-control"],onSelect:(e,t)=>{t=v(t),A({id:$a(),node:e,path:t}),T(S.current),_(!0),Y(),null==y||y(t,e)}})}),[]),q.default.useEffect((()=>(O?G():Y(),O?setTimeout((()=>M(!0)),16):M(!1),()=>{Y()})),[O]),q.default.useEffect((()=>{S.current=i.length}),[i]);const G=()=>{w.current.startHandle()},Y=()=>{w.current.stopHandle()},X=e=>{e.stopPropagation(),e.preventDefault()};q.default.useImperativeHandle(t,(()=>({OPEN:()=>R(!0),CLOSE:()=>R(!1),GET_CURRENT_STEP:()=>({current:N,selector:P.path})})));const Q=gt("guide-tracker"),Z=[{[`${Q}-primary`]:!0}],ee=dd({arrowPointAtCenter:!1,autoAdjustOverflow:!0,offset:5,arrowWidth:16,borderRadius:8});return q.default.createElement(q.default.Fragment,null,q.default.createElement(ue.default,{open:O&&F,autoLock:!0},q.default.createElement(me.default,{zIndex:k,builtinPlacements:ee,popupPlacement:o,popupVisible:O&&F,popupClassName:J.default(Z,u),popupStyle:c,prefixCls:Q,popup:()=>{const e=()=>{_(!1),G()};return q.default.createElement("div",{className:`${Q}-content`},q.default.createElement("div",{className:`${Q}-inner`},q.default.createElement(g.CloseOutlined,{className:`${Q}-close`,onClick:()=>{null==x||x(N),e()}}),q.default.createElement(d.Dropdown,{open:H,trigger:["click"],dropdownRender:()=>i.length?q.default.createElement("div",{className:"ant-dropdown-menu step-list"},q.default.createElement(I.ReactSortable,{itemKey:"id",handle:".handle",tag:"ul",animation:200,list:i,setList:e=>{const t=e.map((e=>e.id)),n=i.map((e=>e.id));if(l.isEqual(t,n))return;const a=t.findIndex((e=>e===P.id)),r=-1!==a?a:N;T(r),null==b||b(Ya(e),r)}},i.map(((e,t)=>q.default.createElement("li",{key:t,className:J.default("item",{actived:e.id===P.id})},q.default.createElement(g.HolderOutlined,{className:"handle",title:C("qm.form.draggable")}),q.default.createElement("span",{className:"box"},q.default.createElement("span",{className:"title",title:e.title,onClick:()=>{t!==N&&(A({id:e.id,node:$p(e.selector),path:e.selector}),T(t),z(22===V?V+1:V-1),null==b||b(i,t))}},e.title),q.default.createElement(d.Popconfirm,{title:C("qm.button.confirmTitle"),zIndex:k+1,onConfirm:()=>{const l=i.filter((t=>t.id!==e.id)),n=t===N;let a=t<=N?N-1:N;if(a=a<0?0:a,a=a>l.length?l.length:a,n&&l[a]){const{id:e,selector:t}=l[a];A({id:e,node:$p(t),path:t})}T(a),null==b||b(l,a)}},q.default.createElement(g.CloseOutlined,{className:"close-icon"})))))))):q.default.createElement(q.default.Fragment,null),overlayClassName:`${Q}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:180,zIndex:k},onOpenChange:e=>$(e)},q.default.createElement(g.MenuOutlined,{className:J.default(`${Q}-close`,"menu-icon"),style:{width:V}})),h.content&&q.default.createElement(d.Popover,{placement:"bottom",overlayStyle:{width:360,zIndex:k},content:h.content,title:h.title},q.default.createElement(g.QuestionCircleOutlined,{className:J.default(`${Q}-close`,"help-icon")})),q.default.createElement("div",{className:"panel-label"},q.default.createElement("span",{className:"title"},C("qm.guideTracker.label")),q.default.createElement("span",{className:"step"},C("qm.guideTracker.currentStep"),U)),p?p({id:P.id,selector:P.path,actionStatus:B,DO_CLOSE:e},N):q.default.createElement(jp,{action:B,onConfirm:()=>{null==b||b("add"===B?[...i,{id:P.id,selector:P.path,title:"Guide Title"}]:[...i],N),e()},onCancel:()=>{null==x||x(N),e()},onFinish:()=>{e(),null==x||x(N),null==E||E()}})))},arrow:!0,forceRender:!1,destroyPopupOnHide:f},q.default.createElement("div",{className:J.default(`${Q}-target-placeholder`),style:Object.assign(Object.assign({},j||Kp),{position:"fixed",zIndex:k-1,backgroundColor:"rgba(120, 170, 210, 0.7)"}),onMouseDown:X,onClick:X}))),s&&q.default.createElement(ue.default,{open:D},q.default.createElement(dp,{zIndex:k,prefixCls:Q,onPause:()=>{W.current=F,_(!1),Y()},onPlay:()=>{W.current?_(!0):G()}})))}));Vp.displayName="QmGuideTracker";const zp=e=>{var t,l,n,a,r,i,o,s;const{content:d,image:u,width:c,height:f,font:p={},gap:m=[100,100],offset:h=[50,50],rotate:g=-22,zIndex:v=9,alpha:y=1,antiTamper:b=!0,grayscale:x,className:E,style:C}=e,w=q.default.useRef(null),S=q.default.useRef(new Map),N=null!==(t=p.fontSize)&&void 0!==t?t:16,T=null!==(l=p.fontWeight)&&void 0!==l?l:"normal",I=null!==(n=p.fontStyle)&&void 0!==n?n:"normal",O=null!==(a=p.fontFamily)&&void 0!==a?a:"sans-serif",R=null!==(r=p.color)&&void 0!==r?r:"rgba(0, 0, 0, 0.15)",k=null!==(i=p.textAlign)&&void 0!==i?i:"center",L=Array.isArray(d)?d:[d],P=m[0],A=m[1],F=P/2,_=A/2,D=null!==(o=h[0])&&void 0!==o?o:F,M=null!==(s=h[1])&&void 0!==s?s:_,H=q.default.useMemo((()=>{const e=D-F,t=M-_;return{position:"absolute",left:e>0?`${e}px`:0,top:t>0?`${t}px`:0,width:e>0?`calc(100% - ${e}px)`:"100%",height:t>0?`calc(100% - ${t}px)`:"100%",pointerEvents:"none",backgroundRepeat:"repeat",backgroundPosition:`${e>0?0:e}px ${t>0?0:t}px`,zIndex:v}}),[F,_,D,M,v]),j=(e,t)=>{var l;if(w.current){const n=S.current.get(w.current);n&&(w.current.contains(n)&&w.current.removeChild(n),S.current.delete(w.current));const a=document.createElement("div");a.setAttribute("style",(e=>Object.entries(e).map((([e,t])=>{return`${l=e,l.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${t}`;var l})).join(";"))(Object.assign(Object.assign({},H),{backgroundImage:`url('${e}')`,backgroundSize:`${t}px`}))),null===(l=w.current)||void 0===l||l.append(a),S.current.set(w.current,a)}},K=()=>{const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return;const l=(e=>{if(!e)return 1;const t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t})(t),[n,a]=(e=>{let t=120,l=64;if(!u&&e.measureText){e.font=`${N}px ${O}`;const n=L.map((t=>e.measureText(t).width));t=Math.ceil(Math.max(...n)),l=N*L.length+3*(L.length-1)}return[null!=c?c:t,null!=f?f:l]})(t),r=n*l,i=a*l,o=(P+n)*l,s=(A+a)*l,d=P/2*l,p=A/2*l,m=o/2,h=s/2,v=2*(P+n);e.width=2*o,e.height=2*s,t.globalAlpha=y,t.save(),t.translate(m,h),t.rotate(Math.PI/180*g),t.translate(-m,-h);const b=()=>{t.restore(),t.drawImage(e,0,0,o,s,o,s,o,s),x&&(e=>{const t=e.getContext("2d");if(!t)return;const l=t.getImageData(0,0,e.width,e.height),{data:n}=l;for(let e=0;e<n.length;e+=4){const t=(n[e]+n[e+1]+n[e+2])/3;n[e]=t,n[e+1]=t,n[e+2]=t}t.putImageData(l,0,0)})(e),j(e.toDataURL(),v)},E=()=>{const e=Number(N)*l;t.font=`${I} normal ${T} ${e}px/${a}px ${O}`,t.fillStyle=R,t.textAlign=k,t.textBaseline="top",t.translate(r/2,0),L.forEach(((n,a)=>{t.fillText(null!=n?n:"",d,p+a*(e+3*l))})),b()};if(u){const e=new Image;e.onload=()=>{t.drawImage(e,d,p,r,i),b()},e.onerror=()=>{E()},e.crossOrigin="anonymous",e.referrerPolicy="no-referrer",e.src=u}else E()},V=e=>Array.from(S.current.values()).includes(e);q.default.useEffect((()=>{K()}),[d,u,c,f,p,m,h,g,v,y,b,x]),function(e,t,l={}){const n=window&&"MutationObserver"in window,a=$.useRef(),r=()=>{a.current&&(a.current.disconnect(),a.current=void 0)};$.useLayoutEffect((()=>(r(),n&&e.current&&(a.current=new MutationObserver(t),a.current.observe(e.current,l)),()=>r())),[e])}(w,(e=>{if(b)for(const t of e){const e=Array.from(t.removedNodes).some((e=>V(e))),l="attributes"===t.type&&V(t.target);if(e||l){K();break}}}),{attributes:!0,childList:!0,characterData:!0,subtree:!0});const z=gt("watermark");return q.default.createElement("div",{ref:w,className:J.default(z,E),style:Object.assign({position:"relative"},C)},e.children)},Wp=new Map,Bp=new WeakMap;let Up,Gp=0;function Yp(e){return Object.keys(e).sort().filter((t=>void 0!==e[t])).map((t=>{return`${t}_${"root"===t?(l=e.root,l?(Bp.has(l)||(Gp+=1,Bp.set(l,Gp.toString())),Bp.get(l)):"0"):e[t]}`;var l})).toString()}function Xp(e,t,l={},n=Up){if(void 0===window.IntersectionObserver&&void 0!==n){const a=e.getBoundingClientRect();return t(n,{isIntersecting:n,target:e,intersectionRatio:"number"==typeof l.threshold?l.threshold:0,time:0,boundingClientRect:a,intersectionRect:a,rootBounds:a}),()=>{}}const{id:a,observer:r,elements:i}=function(e){const t=Yp(e);let l=Wp.get(t);if(!l){const n=new Map;let a=[];const r=new IntersectionObserver((t=>{t.forEach((t=>{var l;const r=t.isIntersecting&&a.some((e=>t.intersectionRatio>=e));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=r),null===(l=n.get(t.target))||void 0===l||l.forEach((e=>{e(r,t)}))}))}),e);a=r.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),l={id:t,observer:r,elements:n},Wp.set(t,l)}return l}(l),o=i.get(e)||[];return i.has(e)||i.set(e,o),o.push(t),r.observe(e),function(){o.splice(o.indexOf(t),1),0===o.length&&(i.delete(e),r.unobserve(e)),0===i.size&&(r.disconnect(),Wp.delete(a))}}const Qp=e=>{const{forceRender:t,height:l,placeholder:n=null,unmountIfInvisible:a,className:r,style:i}=e,{ref:o,inView:s,entry:d}=(({root:e,rootMargin:t,threshold:l,triggerOnce:n,fallbackInView:a,trackVisibility:r,skip:i,delay:o,onChange:s}={})=>{var d;const[u,c]=q.default.useState(null),[f,p]=q.default.useState({inView:!1,entry:void 0}),m=q.default.useRef(s);q.default.useEffect((()=>{if(i||!u)return;let s;return s=Xp(u,((e,t)=>{var l;p({inView:e,entry:t}),null===(l=m.current)||void 0===l||l.call(m,e,t),t.isIntersecting&&n&&s&&(s(),s=void 0)}),{root:e,rootMargin:t,threshold:l,trackVisibility:r,delay:o},a),()=>{s&&s()}}),[Array.isArray(l)?l.toString():l,u,e,t,n,i,r,a,o]);const h=null===(d=f.entry)||void 0===d?void 0:d.target,g=q.default.useRef();u||!h||n||i||g.current===h||(g.current=h,p({inView:!1,entry:void 0}));const v=[c,f.inView,f.entry];return v.ref=v[0],v.inView=v[1],v.entry=v[2],v})(Object.assign({},e,{triggerOnce:!a}));q.default.useEffect((()=>{l||ft("LazyLoad","height 是必要参数,需要设定组件的高度值!")}),[]);const u={[gt("lazy-load")]:!0};return q.default.createElement("div",{ref:o,className:J.default(u,r),style:i},t||s?e.children:q.default.createElement("div",{className:"placeholder",style:{height:l}},n))};class Zp{constructor(e,t,l,n){if(isNaN(e)||isNaN(t))throw new Error(`Point is invalid: (${e}, ${t})`);this.x=+e,this.y=+t,this.pressure=l||0,this.time=n||Date.now()}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}equals(e){return this.x===e.x&&this.y===e.y&&this.pressure===e.pressure&&this.time===e.time}velocityFrom(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):0}}class Jp{static fromPoints(e,t){const l=this.calculateControlPoints(e[0],e[1],e[2]).c2,n=this.calculateControlPoints(e[1],e[2],e[3]).c1;return new Jp(e[1],l,n,e[2],t.start,t.end)}static calculateControlPoints(e,t,l){const n=e.x-t.x,a=e.y-t.y,r=t.x-l.x,i=t.y-l.y,o=(e.x+t.x)/2,s=(e.y+t.y)/2,d=(t.x+l.x)/2,u=(t.y+l.y)/2,c=Math.sqrt(n*n+a*a),f=Math.sqrt(r*r+i*i),p=f/(c+f),m=d+(o-d)*p,h=u+(s-u)*p,g=t.x-m,v=t.y-h;return{c1:new Zp(o+g,s+v),c2:new Zp(d+g,u+v)}}constructor(e,t,l,n,a,r){this.startPoint=e,this.control2=t,this.control1=l,this.endPoint=n,this.startWidth=a,this.endWidth=r}length(){let e,t,l=0;for(let n=0;n<=10;n+=1){const a=n/10,r=this.point(a,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),i=this.point(a,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(n>0){const n=r-e,a=i-t;l+=Math.sqrt(n*n+a*a)}e=r,t=i}return l}point(e,t,l,n,a){return t*(1-e)*(1-e)*(1-e)+3*l*(1-e)*(1-e)*e+3*n*(1-e)*e*e+a*e*e*e}}class em{constructor(e,t){this.width=320,this.height=200,this.ratio=Math.max(window.devicePixelRatio||1,1),this.penColor="rgba(0,0,0,1)",this.backgroundColor="rgba(0,0,0,0)",this.canAddHistory=!1,this.openSmooth=!0,this.dotSize=0,this.throttle=16,this.minDistance=5,this.velocityFilterWeight=.7,this.compositeOperation="source-over",this.minWidth=.5,this.maxWidth=2.5,this.fontSize=16,this.eraserSize=20,this.lineHeight=1.25,this.degreeOfBlur=5,this.textInputPos={x:0,y:0},this.onStart=()=>{},this.onEnd=()=>{},this._drawingStroke=!1,this._lastPoints=[],this._data=[],this._historyList=[],this._lastVelocity=0,this._lastWidth=0,this.setCanvasSize=()=>{this.canvas.style.height=`${this.height}px`,this.canvas.style.width=`${this.width}px`,this.canvas.height=this.height*this.ratio,this.canvas.width=this.width*this.ratio,1!==this.ratio&&this.ctx.scale(this.ratio,this.ratio)},this.setTextInput=()=>{this.openSmooth||(this.textInput.setAttribute("class","signature__text-input"),this.textInput.setAttribute("contentEditable","true"),this.textInput.setAttribute("spellCheck","false"),this.canvas.parentNode.appendChild(this.textInput))},this.isTouchEvent=e=>"touches"in e,this.addListener=()=>{this.removeListener(),this.canvas.style.touchAction="none",this.canvas.style.userSelect="none",("ontouchstart"in window||navigator.maxTouchPoints)&&(this.canvas.addEventListener("touchstart",this.onDrawStart,{passive:!1}),this.canvas.addEventListener("touchmove",this.onDrawMove,{passive:!1}),document.addEventListener("touchcancel",this.onDrawEnd,{passive:!1}),document.addEventListener("touchend",this.onDrawEnd,{passive:!1})),this.canvas.addEventListener("mousedown",this.onDrawStart),this.canvas.addEventListener("mousemove",this.onDrawMove),document.addEventListener("mouseup",this.onDrawEnd),this.textInput.addEventListener("blur",this.onInputBlur)},this.removeListener=()=>{this.canvas.style.touchAction="auto",this.canvas.style.userSelect="auto",this.canvas.removeEventListener("touchstart",this.onDrawStart),this.canvas.removeEventListener("touchmove",this.onDrawMove),document.removeEventListener("touchend",this.onDrawEnd),document.removeEventListener("touchcancel",this.onDrawEnd),this.canvas.removeEventListener("mousedown",this.onDrawStart),this.canvas.removeEventListener("mousemove",this.onDrawMove),document.removeEventListener("mouseup",this.onDrawEnd),this.textInput.removeEventListener("blur",this.onInputBlur)},this._isLeftButtonPressed=(e,t)=>this.isTouchEvent(e)?!!e.touches.length:t?1===e.buttons:1==(1&e.buttons),this._pointerEventToSignatureEvent=e=>{var t,l;return{event:e,type:e.type,x:this.isTouchEvent(e)?null===(t=e.touches[0])||void 0===t?void 0:t.clientX:e.clientX,y:this.isTouchEvent(e)?null===(l=e.touches[0])||void 0===l?void 0:l.clientY:e.clientY,pressure:"pressure"in e?e.pressure:0}},this._getPointGroupOptions=e=>({penColor:e&&"penColor"in e?e.penColor:this.penColor,dotSize:e&&"dotSize"in e?e.dotSize:this.dotSize,minWidth:e&&"minWidth"in e?e.minWidth:this.minWidth,maxWidth:e&&"maxWidth"in e?e.maxWidth:this.maxWidth,velocityFilterWeight:e&&"velocityFilterWeight"in e?e.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:e&&"compositeOperation"in e?e.compositeOperation:this.compositeOperation}),this._strokeBegin=e=>{this._drawingStroke=!0;const t=this._getPointGroupOptions(),l=Object.assign(Object.assign({},t),{points:[]});this._data.push(l),this._reset(t),this._strokeUpdate(e,!1)},this._strokeUpdate=(e,t=!0)=>{if(!this._drawingStroke)return;if(0===this._data.length)return void this._strokeBegin(e);const l=this._createPoint(e.x,e.y,e.pressure),n=this._data[this._data.length-1],a=n.points,r=a.length>0&&a[a.length-1],i=!!r&&l.distanceTo(r)<=this.minDistance,o=this._getPointGroupOptions(n);if(!r||!r||!i){const e=this._addPoint(l,o);t&&(r?e&&this._drawCurve(e,o):this._drawDot(l,o)),a.push({time:l.time,x:l.x,y:l.y,pressure:l.pressure})}},this._strokeEnd=(e,t=!1)=>{this._drawingStroke&&(t&&this._strokeUpdate(e),this._drawingStroke=!1)},this._reset=e=>{this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(e.minWidth+e.maxWidth)/2,this.ctx.fillStyle=e.penColor,this.ctx.globalCompositeOperation=e.compositeOperation},this._drawDot=(e,t)=>{const l=this.ctx,n=t.dotSize>0?t.dotSize:(t.minWidth+t.maxWidth)/2;l.beginPath(),this._drawCurveSegment(e.x,e.y,n),l.closePath(),l.fillStyle=t.penColor,l.fill()},this._drawCurve=(e,t)=>{const l=this.ctx,n=e.endWidth-e.startWidth,a=2*Math.ceil(e.length());l.beginPath(),l.fillStyle=t.penColor;for(let l=0;l<a;l+=1){const r=l/a,i=r*r,o=i*r,s=1-r,d=s*s,u=d*s;let c=u*e.startPoint.x;c+=3*d*r*e.control1.x,c+=3*s*i*e.control2.x,c+=o*e.endPoint.x;let f=u*e.startPoint.y;f+=3*d*r*e.control1.y,f+=3*s*i*e.control2.y,f+=o*e.endPoint.y;const p=Math.min(e.startWidth+o*n,t.maxWidth);this._drawCurveSegment(c,f,p)}l.closePath(),l.fill()},this._drawCurveSegment=(e,t,l)=>{const n=this.ctx;n.moveTo(e,t),n.arc(e,t,l,0,2*Math.PI,!1)},this._createPoint=(e,t,l)=>{const n=this.canvas.getBoundingClientRect();return new Zp(e-n.left,t-n.top,l,(new Date).getTime())},this._createPointByEvent=e=>this._createPoint(e.x,e.y,e.pressure),this._addPoint=(e,t)=>{const{_lastPoints:l}=this;if(l.push(e),l.length>2){3===l.length&&l.unshift(l[0]);const e=this._calculateCurveWidths(l[1],l[2],t),n=Jp.fromPoints(l,e);return l.shift(),n}return null},this._strokeWidth=(e,t)=>Math.max(t.maxWidth/(e+1),t.minWidth),this._calculateCurveWidths=(e,t,l)=>{const n=l.velocityFilterWeight*t.velocityFrom(e)+(1-l.velocityFilterWeight)*this._lastVelocity,a=this._strokeWidth(n,l),r={end:a,start:this._lastWidth};return this._lastVelocity=n,this._lastWidth=a,r},this.onDrawStart=e=>{var t;e.preventDefault(),this._isLeftButtonPressed(e,!0)&&!this._drawingStroke&&(this._strokeBegin(this._pointerEventToSignatureEvent(e)),this.ctx.strokeStyle=this.penColor,this.ctx.lineWidth=this.maxWidth,"line"===this.mode&&this.createPencil(e),"eraser"===this.mode&&this.createEraser(e),"text"===this.mode&&this.createTextInput(e),null===(t=this.onStart)||void 0===t||t.call(this,e))},this.onDrawMove=e=>{e.preventDefault(),"text"!==this.mode&&(this._isLeftButtonPressed(e,!0)&&this._drawingStroke?window.requestAnimationFrame?window.requestAnimationFrame((()=>this.drawHandler(e))):this.drawHandler(e):this._strokeEnd(this._pointerEventToSignatureEvent(e)))},this.onDrawEnd=e=>{var t;this._isLeftButtonPressed(e)||(this._strokeEnd(this._pointerEventToSignatureEvent(e)),"text"!==this.mode&&this.addHistory(),null===(t=this.onEnd)||void 0===t||t.call(this,e))},this.onInputBlur=e=>{this.textInput.classList.remove("show"),this.drawHandler(e),this.textInput.innerText="",this.addHistory()},this.drawHandler=e=>{switch(this.mode){case"line":this.drawLine(e);break;case"square":this.drawSquare(e);break;case"round":this.drawRound(e);break;case"arrow":this.drawArrow(e);break;case"mosaic":this.drawMosaic(e);break;case"text":this.drawText(e);break;case"eraser":this.drawEraser(e)}this.canAddHistory=!0},this.drawSquare=e=>{if(!this._lastPoints.length)return;const{x:t,y:l}=this._lastPoints[0],{x:n,y:a}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.setLastHistory(),this.ctx.beginPath(),this.ctx.rect(t,l,n-t,a-l),this.ctx.stroke(),this.ctx.restore()},this.drawRound=e=>{if(!this._lastPoints.length)return;const{x:t,y:l}=this._lastPoints[0],{x:n,y:a}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),r=Math.min(n,t),i=Math.min(a,l),o=.5*(Math.max(n,t)-r),s=.5*(Math.max(a,l)-i),d=r+o,u=i+s;this.setLastHistory(),this.ctx.beginPath(),this.ctx.ellipse(d,u,o,s,0,0,2*Math.PI),this.ctx.stroke(),this.ctx.closePath(),this.ctx.restore()},this.drawArrow=e=>{if(!this._lastPoints.length)return;const{x:t,y:l}=this._lastPoints[0],{x:n,y:a}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),r=180*Math.atan2(l-a,t-n)/Math.PI,i=(r+25)*Math.PI/180,o=(r-25)*Math.PI/180,s=15*Math.cos(i),d=15*Math.sin(i),u=15*Math.cos(o),c=15*Math.sin(o);this.setLastHistory(),this.ctx.beginPath(),this.ctx.moveTo(t,l),this.ctx.lineTo(n,a),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(n,a);const f=n+s,p=a+d;this.ctx.lineTo(f,p);const m=n+u,h=a+c;this.ctx.lineTo(m,h),this.ctx.lineTo(n,a),this.ctx.fill(),this.ctx.restore()},this.getAxisColor=(e,t,l)=>{const n=e.width,a=e.data,r=[];return r[0]=a[4*(l*n+t)],r[1]=a[4*(l*n+t)+1],r[2]=a[4*(l*n+t)+2],r[3]=a[4*(l*n+t)+3],r},this.setAxisColor=(e,t,l,n)=>{const a=e.width,r=e.data;r[4*(l*a+t)]=n[0],r[4*(l*a+t)+1]=n[1],r[4*(l*a+t)+2]=n[2],r[4*(l*a+t)+3]=n[3]},this.drawMosaic=e=>{if(!this._lastPoints.length)return;const{x:t,y:l}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),n=this.ctx.getImageData(t*this.ratio,l*this.ratio,this.maxWidth*this.ratio,this.maxWidth*this.ratio),a=n.width,r=n.height,i=a/this.degreeOfBlur,o=r/this.degreeOfBlur;for(let e=0;e<o;e++)for(let t=0;t<i;t++){const l=this.getAxisColor(n,t*this.degreeOfBlur+Math.floor(Math.random()*this.degreeOfBlur),e*this.degreeOfBlur+Math.floor(Math.random()*this.degreeOfBlur));for(let a=0;a<this.degreeOfBlur;a++)for(let r=0;r<this.degreeOfBlur;r++)this.setAxisColor(n,t*this.degreeOfBlur+r,e*this.degreeOfBlur+a,l)}this.ctx.putImageData(n,t*this.ratio,l*this.ratio)},this.drawText=e=>{const{x:t,y:l}=this.textInputPos;if(0===t&&0===l)return;this.ctx.lineWidth=1,this.ctx.fillStyle=this.penColor,this.ctx.textBaseline="middle",this.ctx.font=`bold ${this.fontSize}px none`;const n=this.fontSize*this.lineHeight,a=this.width-t,r=e.target.innerText,i=[];let o="";for(let e=0;e<r.length;e++){const t=o+r[e];this.ctx.measureText(t).width>a&&o.length>0?(i.push(o),o=r[e]):o=t}i.push(o),i.forEach(((e,a)=>{this.ctx.fillText(e,t+1,l+a*n+2)})),this.ctx.restore(),this.textInputPos={x:0,y:0}},this.createPencil=e=>{if(this.openSmooth||!this._lastPoints.length)return;const{x:t,y:l}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,l)},this.drawPencil=e=>{const{x:t,y:l}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.lineTo(t,l),this.ctx.stroke(),this.ctx.restore()},this.createEraser=e=>{if(!this._lastPoints.length)return;const{x:t,y:l}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,l)},this.drawEraser=e=>{const{x:t,y:l}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.globalCompositeOperation="destination-out",this.ctx.lineCap="round",this.ctx.lineWidth=this.eraserSize,this.ctx.lineTo(t,l),this.ctx.stroke(),this.ctx.globalCompositeOperation="source-over"},this.drawLine=e=>{this.openSmooth?this._strokeMoveUpdate(this._pointerEventToSignatureEvent(e)):this.drawPencil(e)},this.createTextInput=e=>{if(!this._lastPoints.length)return;const{x:t,y:l}=this._lastPoints[0];0!=this.textInputPos.x&&0!=this.textInputPos.y&&this.textInputPos.x!=t&&this.textInputPos.y!=l?this.textInput.blur():(this.textInput.classList.add("show"),this.setInputStyle(),this.textInput.focus())},this.setInputStyle=()=>{if(!this._lastPoints.length)return;const{x:e,y:t}=this._lastPoints[0];this.textInput.style.left=e+"px",this.textInput.style.lineHeight=this.lineHeight.toString(),this.textInput.style.fontSize=this.fontSize+"px",this.textInput.style.color=this.penColor,this.textInput.style.top=t-Math.floor((this.textInput.offsetHeight-2)/2)+"px",this.textInputPos={x:e,y:t}},this.drawBgColor=()=>{this.backgroundColor&&(this.ctx.fillStyle=this.backgroundColor,this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height))},this.clearWorkSpace=()=>{this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)},this.addHistory=()=>{this.canAddHistory&&(this.canAddHistory=!1,this._historyList.push(this.ctx.getImageData(0,0,this.canvas.width,this.canvas.height)))},this.getLastHistory=()=>this._historyList[this._historyList.length-1],this.setLastHistory=()=>{const e=this.getLastHistory();e?this.ctx.putImageData(e,0,0):this.clearWorkSpace()},this.clear=()=>{this.clearWorkSpace(),this.drawBgColor(),this._historyList=[],this._data=[],this._reset(this._getPointGroupOptions())},this.undo=()=>{const e=this._historyList[this._historyList.length-2];e?(this.ctx.putImageData(e,0,0),this._historyList.pop()):this.clear()},this.setDrawMode=e=>{this.mode=e},this.setLineWidth=e=>{this.maxWidth=e},this.setPenColor=e=>{this.penColor=e},this.setFontSize=e=>{this.fontSize=e},this.isEmpty=()=>{const e=document.createElement("canvas"),t=e.getContext("2d");return e.width=this.canvas.width,e.height=this.canvas.height,1!==this.ratio&&t.scale(this.ratio,this.ratio),this.backgroundColor&&(t.fillStyle=this.backgroundColor,t.fillRect(0,0,e.width,e.height)),e.toDataURL()===this.canvas.toDataURL()},this.toDataURL=(e="image/png",t=1)=>{if(this.canvas.width===this.width)return this.canvas.toDataURL(e,t);const l=document.createElement("canvas");l.width=this.width,l.height=this.height;return l.getContext("2d").drawImage(this.canvas,0,0,l.width,l.height),l.toDataURL(e,t)},this.getPNG=()=>this.toDataURL(),this.getJPG=(e=.8)=>this.toDataURL("image/jpeg",e),this.initial(e,t)}initial(e,t={}){e&&(this.canvas=e,this.ctx=e.getContext("2d"),this.textInput=document.createElement("div"),this.width=t.width||e.clientWidth||this.width,this.height=t.height||e.clientHeight||this.height,this.penColor=t.penColor||this.penColor,this.fontSize=t.fontSize||this.fontSize,this.openSmooth=void 0===t.openSmooth?this.openSmooth:!!t.openSmooth,this.backgroundColor=this.openSmooth&&t.backgroundColor||this.backgroundColor,this.mode=t.mode||this.mode,this._strokeMoveUpdate=this.throttle?function(e,t=250){let l,n,a,r=0,i=null;const o=()=>{r=Date.now(),i=null,l=e.apply(n,a),i||(n=null,a=[])};return function(...s){const d=Date.now(),u=t-(d-r);return n=this,a=s,u<=0||u>t?(i&&(clearTimeout(i),i=null),r=d,l=e.apply(n,a),i||(n=null,a=[])):i||(i=window.setTimeout(o,u)),l}}(this._strokeUpdate,this.throttle):this._strokeUpdate,this.minWidth=t.minWidth||this.minWidth,this.maxWidth=t.maxWidth||this.maxWidth,this.onStart=t.onStart,this.onEnd=t.onEnd,this.setCanvasSize(),this.setTextInput(),this.drawBgColor(),this.addListener())}update(){this.setCanvasSize(),this.clear()}destroy(){this.removeListener();for(const e in this)Object.prototype.hasOwnProperty.call(this,e)&&(this[e]=null)}}em.dataURLToBlob=e=>{const t=e.split(";base64,"),l=t[0].split(":")[1],n=window.atob(t[1]),a=n.length,r=new Uint8Array(a);for(let e=0;e<a;++e)r[e]=n.charCodeAt(e);return new Blob([r],{type:l})},em.canvasToDataURL=e=>e.toDataURL("image/png",1),em.canvasToBlob=e=>new Promise(((t,l)=>{e.toBlob((e=>e?t(e):l(null)),"image/png",1)}));const tm=q.default.forwardRef(((e,t)=>{const{open:l,width:n,height:a,imageName:r,penColor:i,penMode:o,minWidth:s,maxWidth:u,backgroundColor:c,className:f,style:p,onOk:m,onCancel:h}=e,{t:v}=ot(),y=q.default.useRef(),b=q.default.useRef(null),x=q.default.useRef(null),E=q.default.useRef(null),C=[2,4,6],w=[14,16,18,20,24,28],S=["#ff0000","#29cc29","#00bfff","#fe6151","#000000","#666666"],[N,T]=yi(void 0,{value:l,postState:e=>null!=e&&e}),I=q.default.useMemo((()=>!!e.children),[e.children]),[O,R]=q.default.useState(o||(I?"square":"line")),[k,L]=q.default.useState(C[0]),[P,A]=q.default.useState(I?S[0]:S[4]),[F,_]=q.default.useState(w[1]),[D,M]=q.default.useState("bottomLeft"),[H,$]=q.default.useState(!1),[K,V]=q.default.useState(!1);q.default.useEffect((()=>{var e,t;const l={width:null!=n?n:null===(e=x.current)||void 0===e?void 0:e.offsetWidth,height:null!=a?a:null===(t=x.current)||void 0===t?void 0:t.offsetHeight,maxWidth:k,mode:O,penColor:P,fontSize:F,backgroundColor:c,openSmooth:!I};return l.openSmooth&&Object.assign(l,{penColor:i,minWidth:s,maxWidth:u}),y.current=new em(b.current,l),()=>y.current.destroy()}),[]);const z=e=>{var t,l;const[r,i]=[null!=n?n:null===(t=x.current)||void 0===t?void 0:t.offsetWidth,null!=a?a:null===(l=x.current)||void 0===l?void 0:l.offsetHeight],{width:o,height:s}=y.current;let d=!1;r&&r!==o&&(y.current.width=r,d=!0),i&&i!==s&&(y.current.height=i,d=!0),(d||e)&&y.current.update()};Yl((()=>{I&&N&&z()}),[N,I]),Yl((()=>{y.current.setDrawMode(O)}),[O]),Yl((()=>{y.current.setLineWidth(k)}),[k]),Yl((()=>{y.current.setPenColor(P)}),[P]),Yl((()=>{y.current.setFontSize(F)}),[F]);const W=()=>Ie(void 0,void 0,void 0,(function*(){const e=I?x.current.parentNode:b.current;if(e)try{const t=yield be.default(e,{useCORS:!0,logging:!1,ignoreElements:e=>e===E.current||e.classList.contains("spinning")});return em.canvasToDataURL(t)}catch(e){ft("Signature","生成合成图片失败!")}})),B=()=>{y.current.clear(),null==h||h()};q.default.useImperativeHandle(t,(()=>({OPEN:()=>T(!0),CLOSE:()=>T(!1),CLEAR:()=>y.current.clear(),UNDO:()=>y.current.undo(),IS_EMPTY:()=>y.current.isEmpty(),UPDATE:z,GET_DATE_URL:W})));const U=e=>{e&&M((()=>{const e=E.current.getBoundingClientRect();return e.top+e.height>=window.innerHeight})()?"topLeft":"bottomLeft")},G=e=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","content")},"text"!==e?q.default.createElement("div",{className:"lineWidth"},C.map((e=>q.default.createElement("span",{key:e,className:J.default("dot",`s${e}`,{active:e===k}),onClick:()=>L(e)})))):q.default.createElement("div",{className:"fontSize"},q.default.createElement(d.Select,{size:"small",value:F,options:w.map((e=>({value:e,label:e.toString()}))),onChange:e=>_(e)})),q.default.createElement("span",{className:"divider"}),q.default.createElement("div",{className:"penColor"},S.map((e=>q.default.createElement("span",{key:e,className:J.default("dot",{active:e===P}),style:{backgroundColor:e},onClick:()=>A(e)},q.default.createElement(g.CheckOutlined,{className:"icon"})))))),Y=gt("signature"),X={[Y]:!0,"is-annotation":I},Q=n?Object.assign(Object.assign({},p),{width:n}):p;return q.default.createElement("div",{className:J.default(X,f),style:Q},I&&q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{ref:x,className:"content"},e.children),K&&q.default.createElement(mn,{spinning:!0,className:"spinning"})),q.default.createElement("div",{className:J.default("signature",{show:N})},q.default.createElement("canvas",{ref:b,className:O}),I&&q.default.createElement("div",{ref:E,className:"signature__tool-bar"},q.default.createElement("div",{className:"wrapper"},q.default.createElement("div",{className:J.default("actions",{hidden:H})},q.default.createElement(d.Dropdown,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:D,trigger:["click"],onOpenChange:U},q.default.createElement("button",{className:"btn",onClick:()=>R("square")},q.default.createElement(g.BorderOutlined,null))),q.default.createElement(d.Dropdown,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:D,trigger:["click"],onOpenChange:U},q.default.createElement("button",{className:"btn",onClick:()=>R("round")},q.default.createElement($d,null))),q.default.createElement(d.Dropdown,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:D,trigger:["click"],onOpenChange:U},q.default.createElement("button",{className:"btn",onClick:()=>R("arrow")},q.default.createElement(Kd,null))),q.default.createElement(d.Dropdown,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:D,trigger:["click"],onOpenChange:U},q.default.createElement("button",{className:"btn",onClick:()=>R("line")},q.default.createElement(g.EditOutlined,null))),q.default.createElement(d.Dropdown,{dropdownRender:()=>G("text"),overlayClassName:`${Y}__popper`,placement:D,trigger:["click"],onOpenChange:U},q.default.createElement("button",{className:"btn",onClick:()=>R("text")},q.default.createElement(jd,null))),q.default.createElement("button",{className:"btn",onClick:()=>Ie(void 0,void 0,void 0,(function*(){yield Ie(void 0,void 0,void 0,(function*(){V(!0);const e=yield W();if(e){const t=r?r.slice(0,r.lastIndexOf(".")>0?r.lastIndexOf("."):void 0):j.default().format(si);Dn(em.dataURLToBlob(e),`${t}.png`)}V(!1)})),B()}))},q.default.createElement(g.DownloadOutlined,null)),q.default.createElement("button",{className:"btn",onClick:()=>R("eraser")},q.default.createElement(Vd,null)),q.default.createElement("button",{className:"btn",onClick:()=>y.current.undo()},q.default.createElement(zd,null)),q.default.createElement("button",{className:"btn",onClick:()=>y.current.clear()},q.default.createElement(g.ClearOutlined,null)),q.default.createElement("span",{className:"divider"}),q.default.createElement("button",{className:"btn",onClick:()=>null==h?void 0:h()},q.default.createElement(g.CloseOutlined,null)),q.default.createElement("button",{className:"btn",onClick:()=>Ie(void 0,void 0,void 0,(function*(){V(!0),yield Ae(10);const e=yield W();V(!1),B(),null==m||m(e)}))},q.default.createElement(g.CheckOutlined,null))),q.default.createElement("button",{className:"btn btn-fold",title:v(H?"qm.divider.spread":"qm.divider.collect"),onClick:()=>$(!H)},H?q.default.createElement(g.LeftOutlined,null):q.default.createElement(g.RightOutlined,null))))))}));tm.displayName="QmSignature";const lm="1.12.16";Object.defineProperty(exports,"Affix",{enumerable:!0,get:function(){return d.Affix}}),Object.defineProperty(exports,"Alert",{enumerable:!0,get:function(){return d.Alert}}),Object.defineProperty(exports,"Anchor",{enumerable:!0,get:function(){return d.Anchor}}),Object.defineProperty(exports,"AutoComplete",{enumerable:!0,get:function(){return d.AutoComplete}}),Object.defineProperty(exports,"Avatar",{enumerable:!0,get:function(){return d.Avatar}}),Object.defineProperty(exports,"BackTop",{enumerable:!0,get:function(){return d.BackTop}}),Object.defineProperty(exports,"Badge",{enumerable:!0,get:function(){return d.Badge}}),Object.defineProperty(exports,"Breadcrumb",{enumerable:!0,get:function(){return d.Breadcrumb}}),Object.defineProperty(exports,"Button",{enumerable:!0,get:function(){return d.Button}}),Object.defineProperty(exports,"Card",{enumerable:!0,get:function(){return d.Card}}),Object.defineProperty(exports,"Carousel",{enumerable:!0,get:function(){return d.Carousel}}),Object.defineProperty(exports,"Cascader",{enumerable:!0,get:function(){return d.Cascader}}),Object.defineProperty(exports,"Checkbox",{enumerable:!0,get:function(){return d.Checkbox}}),Object.defineProperty(exports,"Col",{enumerable:!0,get:function(){return d.Col}}),Object.defineProperty(exports,"Collapse",{enumerable:!0,get:function(){return d.Collapse}}),Object.defineProperty(exports,"Comment",{enumerable:!0,get:function(){return d.Comment}}),Object.defineProperty(exports,"ConfigProvider",{enumerable:!0,get:function(){return d.ConfigProvider}}),Object.defineProperty(exports,"Descriptions",{enumerable:!0,get:function(){return d.Descriptions}}),Object.defineProperty(exports,"Divider",{enumerable:!0,get:function(){return d.Divider}}),Object.defineProperty(exports,"Drawer",{enumerable:!0,get:function(){return d.Drawer}}),Object.defineProperty(exports,"Dropdown",{enumerable:!0,get:function(){return d.Dropdown}}),Object.defineProperty(exports,"Empty",{enumerable:!0,get:function(){return d.Empty}}),Object.defineProperty(exports,"Form",{enumerable:!0,get:function(){return d.Form}}),Object.defineProperty(exports,"Grid",{enumerable:!0,get:function(){return d.Grid}}),Object.defineProperty(exports,"Image",{enumerable:!0,get:function(){return d.Image}}),Object.defineProperty(exports,"Input",{enumerable:!0,get:function(){return d.Input}}),Object.defineProperty(exports,"InputNumber",{enumerable:!0,get:function(){return d.InputNumber}}),Object.defineProperty(exports,"Layout",{enumerable:!0,get:function(){return d.Layout}}),Object.defineProperty(exports,"List",{enumerable:!0,get:function(){return d.List}}),Object.defineProperty(exports,"Mentions",{enumerable:!0,get:function(){return d.Mentions}}),Object.defineProperty(exports,"Menu",{enumerable:!0,get:function(){return d.Menu}}),Object.defineProperty(exports,"Modal",{enumerable:!0,get:function(){return d.Modal}}),Object.defineProperty(exports,"PageHeader",{enumerable:!0,get:function(){return d.PageHeader}}),Object.defineProperty(exports,"Pagination",{enumerable:!0,get:function(){return d.Pagination}}),Object.defineProperty(exports,"Popconfirm",{enumerable:!0,get:function(){return d.Popconfirm}}),Object.defineProperty(exports,"Popover",{enumerable:!0,get:function(){return d.Popover}}),Object.defineProperty(exports,"Progress",{enumerable:!0,get:function(){return d.Progress}}),Object.defineProperty(exports,"Radio",{enumerable:!0,get:function(){return d.Radio}}),Object.defineProperty(exports,"Rate",{enumerable:!0,get:function(){return d.Rate}}),Object.defineProperty(exports,"Result",{enumerable:!0,get:function(){return d.Result}}),Object.defineProperty(exports,"Row",{enumerable:!0,get:function(){return d.Row}}),Object.defineProperty(exports,"Segmented",{enumerable:!0,get:function(){return d.Segmented}}),Object.defineProperty(exports,"Select",{enumerable:!0,get:function(){return d.Select}}),Object.defineProperty(exports,"Skeleton",{enumerable:!0,get:function(){return d.Skeleton}}),Object.defineProperty(exports,"Slider",{enumerable:!0,get:function(){return d.Slider}}),Object.defineProperty(exports,"Space",{enumerable:!0,get:function(){return d.Space}}),Object.defineProperty(exports,"Spin",{enumerable:!0,get:function(){return d.Spin}}),Object.defineProperty(exports,"Statistic",{enumerable:!0,get:function(){return d.Statistic}}),Object.defineProperty(exports,"Steps",{enumerable:!0,get:function(){return d.Steps}}),Object.defineProperty(exports,"Switch",{enumerable:!0,get:function(){return d.Switch}}),Object.defineProperty(exports,"Table",{enumerable:!0,get:function(){return d.Table}}),Object.defineProperty(exports,"Tabs",{enumerable:!0,get:function(){return d.Tabs}}),Object.defineProperty(exports,"Tag",{enumerable:!0,get:function(){return d.Tag}}),Object.defineProperty(exports,"Timeline",{enumerable:!0,get:function(){return d.Timeline}}),Object.defineProperty(exports,"Tooltip",{enumerable:!0,get:function(){return d.Tooltip}}),Object.defineProperty(exports,"Transfer",{enumerable:!0,get:function(){return d.Transfer}}),Object.defineProperty(exports,"Tree",{enumerable:!0,get:function(){return d.Tree}}),Object.defineProperty(exports,"TreeSelect",{enumerable:!0,get:function(){return d.TreeSelect}}),Object.defineProperty(exports,"Typography",{enumerable:!0,get:function(){return d.Typography}}),Object.defineProperty(exports,"Upload",{enumerable:!0,get:function(){return d.Upload}}),Object.defineProperty(exports,"message",{enumerable:!0,get:function(){return d.message}}),Object.defineProperty(exports,"notification",{enumerable:!0,get:function(){return d.notification}}),Object.defineProperty(exports,"DcpPortal",{enumerable:!0,get:function(){return ue.default}}),Object.defineProperty(exports,"QmPortal",{enumerable:!0,get:function(){return ue.default}}),exports.Calendar=Je,exports.DatePicker=et,exports.DcpAnchor=Wn,exports.DcpButton=pt,exports.DcpCollapse=Ul,exports.DcpColorPicker=ud,exports.DcpConfigProvider=it,exports.DcpCopyToClipboard=pc,exports.DcpCountup=fn,exports.DcpCropper=Ff,exports.DcpDivider=vt,exports.DcpDownload=jn,exports.DcpDrawer=Gn,exports.DcpEmpty=pn,exports.DcpForm=ap,exports.DcpGuideTracker=Vp,exports.DcpLazyLoad=Qp,exports.DcpModal=Qn,exports.DcpPivotGrid=tu,exports.DcpPrint=wp,exports.DcpRangeTableHelper=Kc,exports.DcpScrollbar=_n,exports.DcpSearchHelper=Sc,exports.DcpSearchTree=Lu,exports.DcpSignature=tm,exports.DcpSpace=ht,exports.DcpSpin=mn,exports.DcpSplit=cn,exports.DcpTable=wc,exports.DcpTabs=Un,exports.DcpTinymce=tp,exports.DcpTour=pp,exports.DcpTransition=kn,exports.DcpTranslate=Hr,exports.DcpTreeHelper=oc,exports.DcpTreeTableHelper=Fc,exports.DcpUploadFile=$n,exports.DcpUploadImg=Df,exports.DcpVirtualList=mu,exports.DcpWatermark=zp,exports.QmAnchor=Wn,exports.QmButton=pt,exports.QmCollapse=Ul,exports.QmColorPicker=ud,exports.QmConfigProvider=it,exports.QmCopyToClipboard=pc,exports.QmCountup=fn,exports.QmCropper=Ff,exports.QmDivider=vt,exports.QmDownload=jn,exports.QmDrawer=Gn,exports.QmEmpty=pn,exports.QmForm=ap,exports.QmGuideTracker=Vp,exports.QmLazyLoad=Qp,exports.QmModal=Qn,exports.QmPivotGrid=tu,exports.QmPrint=wp,exports.QmRangeTableHelper=Kc,exports.QmScrollbar=_n,exports.QmSearchHelper=Sc,exports.QmSearchTree=Lu,exports.QmSignature=tm,exports.QmSpace=ht,exports.QmSpin=mn,exports.QmSplit=cn,exports.QmTable=wc,exports.QmTabs=Un,exports.QmTinymce=tp,exports.QmTour=pp,exports.QmTransition=kn,exports.QmTranslate=Hr,exports.QmTreeHelper=oc,exports.QmTreeTableHelper=Fc,exports.QmUploadFile=$n,exports.QmUploadImg=Df,exports.QmVirtualList=mu,exports.QmWatermark=zp,exports.TimePicker=lt,exports.pinyin=_r,exports.version=lm;
|