next-ui3 1.5.11 → 1.5.13
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/dist/index.css +1 -1
- package/dist/index.full.min.js +17 -17
- package/dist/index.full.min.mjs +17 -17
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/utils/index.min.js +2 -2
- package/dist/utils/index.min.mjs +2 -2
- package/es/hooks/use-upload-config/index.d.ts +1 -0
- package/es/utils/file.d.ts +1 -0
- package/es/version.d.ts +1 -1
- package/lib/hooks/use-upload-config/index.d.ts +1 -0
- package/lib/utils/file.d.ts +1 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/nt-file-upload.css +1 -1
- package/theme-chalk/src/file-upload.scss +1 -0
package/dist/locale/en.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! Next UI v1.5.
|
|
1
|
+
/*! Next UI v1.5.13 */(function(e,l){typeof exports=="object"&&typeof module!="undefined"?module.exports=l():typeof define=="function"&&define.amd?define(l):(e=typeof globalThis!="undefined"?globalThis:e||self,e.NextUILocaleEn=l())})(this,function(){"use strict";var e={name:"en",nt:{common:{loadingText:"Loading",loading:"Loading...",loadError:"Load failed, click to retry",empty:"No data",noMatch:"No matching data",success:"Operation successful",checkAll:"Check all",all:"All",more:"More",pleaseInput:"Please input {label}",pleaseSelect:"Please select {label}",to:"To",startDate:"Start date",endDate:"End date",startTime:"Start time",endTime:"End time",systemPrompt:"System prompt",confirm:"Confirm",cancel:"Cancel"},building:{text:"Building..."},datePicker:{quarter:{year:"{year}",firstQuarter:"1st quarter",secondQuarter:"2nd quarter",thirdQuarter:"3rd quarter",fourthQuarter:"4th quarter",first:"1",second:"2",third:"3",fourth:"4",format:"q [quarter], YYYY"},semiAnnual:{year:"{year}",firstHalf:"1st half",secondHalf:"2nd half"}},downloadButton:{downloadError:"Download failed"},fileSelect:{dragAndDrop:"Drag and drop files here, or",selectFile:"Select file",changeFile:"Change file",supportFileTypes:"Only support {fileTypes} files",maxFileSize:"File size cannot exceed {maxSize}",maxFileCount:"Max {maxCount} files can be selected"},fileUpload:{drop:"Drop files here to upload",drag:"Click or drag files here to upload",unsupportedFileType:"Unsupported upload {ext} file, the current selected file {filename} has been discarded",maxFileSize:"File size cannot exceed {maxSize}, the current selected file {filename} has been discarded",maxFileCount:"File total cannot exceed {maxCount}, the files exceeding have been discarded",someFilesFailed:"Some files have not been successfully uploaded",uploadFailed:"Upload failed",retryTip:"Upload failed, click to retry",allFiles:"All ({count})",uploadingFiles:"Uploading ({count})",uploadedFiles:"Success ({count})",failedFiles:"Failed ({count})",retryAll:"Retry all",removeAll:"Remove all",confirmRemoveAll:"Are you sure you want to remove all files in the current tab (total {count} files)?"},filter:{search:"Search",reset:"Reset",expand:"Expand",collapse:"Collapse"},form:{requiredInput:"Please input {label}",requiredSelect:"Please select {label}"},table:{confirm:"Confirm",reset:"Reset"},treePanel:{filterPlaceholder:"Please input keyword",currentSelected:"Current selected"},upload:{upload:"Upload",uploadFailed:"Upload failed",supportFileTypes:"Only support {fileTypes} files",maxFileSize:"File size cannot exceed {maxSize}",maxFileCount:"Max {maxCount} files can be selected"},preview:{scaleUp:"Zoom in",scaleDown:"Zoom out",scaleReset:"Reset",prevPage:"Previous page",nextPage:"Next page",noDoc:"No document",loadPdfError:"Load PDF failed",copy:"Copy",copySuccess:"Copied",lineNumbers:"Line #",wordWrap:"Wrap",fileTooLarge:"File too large to preview (max {maxSize})",noAudio:"No audio file",noVideo:"No video file",play:"Play",pause:"Pause",mute:"Mute",unmute:"Unmute",fullscreen:"Fullscreen",exitFullscreen:"Exit fullscreen",imageLoadError:"Image load failed",audioLoadError:"Audio load failed",videoLoadError:"Video load failed",textLoadError:"File load failed",converting:"Converting document",convertError:"Document conversion failed",converterNotConfigured:"Please configure document converter",notSupported:"Not supported for preview",previewMode:"Preview"}}};return e});
|
package/dist/locale/en.min.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! Next UI v1.5.
|
|
1
|
+
/*! Next UI v1.5.13 */var e={name:"en",nt:{common:{loadingText:"Loading",loading:"Loading...",loadError:"Load failed, click to retry",empty:"No data",noMatch:"No matching data",success:"Operation successful",checkAll:"Check all",all:"All",more:"More",pleaseInput:"Please input {label}",pleaseSelect:"Please select {label}",to:"To",startDate:"Start date",endDate:"End date",startTime:"Start time",endTime:"End time",systemPrompt:"System prompt",confirm:"Confirm",cancel:"Cancel"},building:{text:"Building..."},datePicker:{quarter:{year:"{year}",firstQuarter:"1st quarter",secondQuarter:"2nd quarter",thirdQuarter:"3rd quarter",fourthQuarter:"4th quarter",first:"1",second:"2",third:"3",fourth:"4",format:"q [quarter], YYYY"},semiAnnual:{year:"{year}",firstHalf:"1st half",secondHalf:"2nd half"}},downloadButton:{downloadError:"Download failed"},fileSelect:{dragAndDrop:"Drag and drop files here, or",selectFile:"Select file",changeFile:"Change file",supportFileTypes:"Only support {fileTypes} files",maxFileSize:"File size cannot exceed {maxSize}",maxFileCount:"Max {maxCount} files can be selected"},fileUpload:{drop:"Drop files here to upload",drag:"Click or drag files here to upload",unsupportedFileType:"Unsupported upload {ext} file, the current selected file {filename} has been discarded",maxFileSize:"File size cannot exceed {maxSize}, the current selected file {filename} has been discarded",maxFileCount:"File total cannot exceed {maxCount}, the files exceeding have been discarded",someFilesFailed:"Some files have not been successfully uploaded",uploadFailed:"Upload failed",retryTip:"Upload failed, click to retry",allFiles:"All ({count})",uploadingFiles:"Uploading ({count})",uploadedFiles:"Success ({count})",failedFiles:"Failed ({count})",retryAll:"Retry all",removeAll:"Remove all",confirmRemoveAll:"Are you sure you want to remove all files in the current tab (total {count} files)?"},filter:{search:"Search",reset:"Reset",expand:"Expand",collapse:"Collapse"},form:{requiredInput:"Please input {label}",requiredSelect:"Please select {label}"},table:{confirm:"Confirm",reset:"Reset"},treePanel:{filterPlaceholder:"Please input keyword",currentSelected:"Current selected"},upload:{upload:"Upload",uploadFailed:"Upload failed",supportFileTypes:"Only support {fileTypes} files",maxFileSize:"File size cannot exceed {maxSize}",maxFileCount:"Max {maxCount} files can be selected"},preview:{scaleUp:"Zoom in",scaleDown:"Zoom out",scaleReset:"Reset",prevPage:"Previous page",nextPage:"Next page",noDoc:"No document",loadPdfError:"Load PDF failed",copy:"Copy",copySuccess:"Copied",lineNumbers:"Line #",wordWrap:"Wrap",fileTooLarge:"File too large to preview (max {maxSize})",noAudio:"No audio file",noVideo:"No video file",play:"Play",pause:"Pause",mute:"Mute",unmute:"Unmute",fullscreen:"Fullscreen",exitFullscreen:"Exit fullscreen",imageLoadError:"Image load failed",audioLoadError:"Audio load failed",videoLoadError:"Video load failed",textLoadError:"File load failed",converting:"Converting document",convertError:"Document conversion failed",converterNotConfigured:"Please configure document converter",notSupported:"Not supported for preview",previewMode:"Preview"}}};export{e as default};
|
package/dist/locale/zh-cn.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! Next UI v1.5.
|
|
1
|
+
/*! Next UI v1.5.13 */(function(u,e){typeof exports=="object"&&typeof module!="undefined"?module.exports=e():typeof define=="function"&&define.amd?define(e):(u=typeof globalThis!="undefined"?globalThis:u||self,u.NextUILocaleZhCn=e())})(this,function(){"use strict";var u={name:"zh-cn",nt:{common:{loadingText:"\u6B63\u5728\u52A0\u8F7D",loading:"\u6B63\u5728\u52A0\u8F7D...",loadError:"\u52A0\u8F7D\u5931\u8D25\uFF0C\u70B9\u51FB\u91CD\u8BD5",empty:"\u6682\u65E0\u6570\u636E",noMatch:"\u6682\u65E0\u5339\u914D\u6570\u636E",success:"\u64CD\u4F5C\u6210\u529F",checkAll:"\u5168\u9009",all:"\u5168\u90E8",more:"\u66F4\u591A",pleaseInput:"\u8BF7\u8F93\u5165{label}",pleaseSelect:"\u8BF7\u9009\u62E9{label}",to:"\u81F3",startDate:"\u5F00\u59CB\u65E5\u671F",endDate:"\u7ED3\u675F\u65E5\u671F",startTime:"\u5F00\u59CB\u65F6\u95F4",endTime:"\u7ED3\u675F\u65F6\u95F4",systemPrompt:"\u7CFB\u7EDF\u63D0\u793A",confirm:"\u786E\u8BA4",cancel:"\u53D6\u6D88"},building:{text:"\u6B63\u5728\u5EFA\u8BBE\u4E2D..."},datePicker:{quarter:{year:"{year}\u5E74",firstQuarter:"\u7B2C\u4E00\u5B63\u5EA6",secondQuarter:"\u7B2C\u4E8C\u5B63\u5EA6",thirdQuarter:"\u7B2C\u4E09\u5B63\u5EA6",fourthQuarter:"\u7B2C\u56DB\u5B63\u5EA6",first:"\u4E00",second:"\u4E8C",third:"\u4E09",fourth:"\u56DB",format:"YYYY\u5E74\u7B2Cq\u5B63\u5EA6"},semiAnnual:{year:"{year}\u5E74",firstHalf:"\u4E0A\u534A\u5E74",secondHalf:"\u4E0B\u534A\u5E74"}},downloadButton:{downloadError:"\u4E0B\u8F7D\u5931\u8D25"},fileSelect:{dragAndDrop:"\u62D6\u62FD\u6587\u4EF6\u81F3\u6B64\uFF0C\u6216\u8005",selectFile:"\u9009\u62E9\u6587\u4EF6",changeFile:"\u66F4\u6362\u6587\u4EF6",supportFileTypes:"\u53EA\u652F\u6301 {fileTypes} \u683C\u5F0F\u7684\u6587\u4EF6",maxFileSize:"\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7 {maxSize}",maxFileCount:"\u6700\u591A\u9009\u62E9 {maxCount} \u4E2A\u6587\u4EF6"},fileUpload:{drop:"\u91CA\u653E\u6587\u4EF6\u5230\u6B64\u5904\u4E0A\u4F20",drag:"\u70B9\u51FB\u6216\u62D6\u62FD\u6587\u4EF6\u5230\u6B64\u5904\u4E0A\u4F20",unsupportedFileType:"\u4E0D\u652F\u6301\u4E0A\u4F20{ext}\u6587\u4EF6\uFF0C\u5F53\u524D\u9009\u4E2D\u6587\u4EF6{filename}\u5DF2\u4F5C\u5E9F",maxFileSize:"\u6587\u4EF6\u6700\u5927\u4E0D\u8D85\u8FC7{maxSize}\uFF0C\u5F53\u524D\u9009\u4E2D\u6587\u4EF6{filename}\u5DF2\u4F5C\u5E9F",maxFileCount:"\u6587\u4EF6\u603B\u6570\u4E0D\u80FD\u8D85\u8FC7{maxCount}\u4E2A\uFF0C\u8D85\u51FA\u7684\u6587\u4EF6\u5DF2\u5E9F\u5F03",someFilesFailed:"\u8FD8\u6709\u6587\u4EF6\u672A\u6210\u529F\u4E0A\u4F20",uploadFailed:"\u4E0A\u4F20\u5931\u8D25",retryTip:"\u4E0A\u4F20\u5931\u8D25\uFF0C\u70B9\u51FB\u91CD\u8BD5",allFiles:"\u5168\u90E8 ({count})",uploadingFiles:"\u4E0A\u4F20\u4E2D ({count})",failedFiles:"\u4E0A\u4F20\u5931\u8D25 ({count})",uploadedFiles:"\u4E0A\u4F20\u6210\u529F ({count})",retryAll:"\u5168\u90E8\u91CD\u8BD5",removeAll:"\u5168\u90E8\u79FB\u9664",confirmRemoveAll:"\u786E\u5B9A\u8981\u79FB\u9664\u5F53\u524D\u9875\u7B7E\u4E0B\u6240\u6709\u6587\u4EF6\uFF08\u5171{count}\u4E2A\uFF09\u5417\uFF1F"},filter:{search:"\u641C\u7D22",reset:"\u91CD\u7F6E",expand:"\u5C55\u5F00",collapse:"\u6536\u8D77"},form:{requiredInput:"\u8BF7\u8F93\u5165{label}",requiredSelect:"\u8BF7\u9009\u62E9{label}"},table:{confirm:"\u786E\u8BA4",reset:"\u91CD\u7F6E"},treePanel:{filterPlaceholder:"\u8BF7\u8F93\u5165\u5173\u952E\u5B57",currentSelected:"\u5F53\u524D\u9009\u4E2D"},upload:{upload:"\u4E0A\u4F20",uploadFailed:"\u4E0A\u4F20\u5931\u8D25",supportFileTypes:"\u53EA\u652F\u6301 {fileTypes} \u683C\u5F0F\u7684\u6587\u4EF6",maxFileSize:"\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7 {maxSize}",maxFileCount:"\u6700\u591A\u9009\u62E9 {maxCount} \u4E2A\u6587\u4EF6"},preview:{scaleUp:"\u653E\u5927",scaleDown:"\u7F29\u5C0F",scaleReset:"\u91CD\u7F6E",prevPage:"\u4E0A\u4E00\u9875",nextPage:"\u4E0B\u4E00\u9875",noDoc:"\u6682\u65E0\u6587\u6863",loadPdfError:"\u52A0\u8F7DPDF\u5931\u8D25",copy:"\u590D\u5236",copySuccess:"\u590D\u5236\u6210\u529F",lineNumbers:"\u663E\u793A\u884C\u53F7",wordWrap:"\u81EA\u52A8\u6362\u884C",fileTooLarge:"\u6587\u4EF6\u8FC7\u5927\uFF0C\u65E0\u6CD5\u9884\u89C8\uFF08\u6700\u5927 {maxSize}\uFF09",noAudio:"\u6682\u65E0\u97F3\u9891\u6587\u4EF6",noVideo:"\u6682\u65E0\u89C6\u9891\u6587\u4EF6",play:"\u64AD\u653E",pause:"\u6682\u505C",mute:"\u9759\u97F3",unmute:"\u53D6\u6D88\u9759\u97F3",fullscreen:"\u5168\u5C4F",exitFullscreen:"\u9000\u51FA\u5168\u5C4F",imageLoadError:"\u56FE\u7247\u52A0\u8F7D\u5931\u8D25",audioLoadError:"\u97F3\u9891\u52A0\u8F7D\u5931\u8D25",videoLoadError:"\u89C6\u9891\u52A0\u8F7D\u5931\u8D25",textLoadError:"\u6587\u4EF6\u52A0\u8F7D\u5931\u8D25",converting:"\u6B63\u5728\u8F6C\u6362\u6587\u6863",convertError:"\u6587\u6863\u8F6C\u6362\u5931\u8D25",converterNotConfigured:"\u8BF7\u914D\u7F6E\u6587\u6863\u8F6C\u6362\u670D\u52A1",notSupported:"\u6682\u4E0D\u652F\u6301\u8BE5\u6587\u4EF6\u7C7B\u578B\u9884\u89C8",previewMode:"\u9884\u89C8"}}};return u});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! Next UI v1.5.
|
|
1
|
+
/*! Next UI v1.5.13 */var u={name:"zh-cn",nt:{common:{loadingText:"\u6B63\u5728\u52A0\u8F7D",loading:"\u6B63\u5728\u52A0\u8F7D...",loadError:"\u52A0\u8F7D\u5931\u8D25\uFF0C\u70B9\u51FB\u91CD\u8BD5",empty:"\u6682\u65E0\u6570\u636E",noMatch:"\u6682\u65E0\u5339\u914D\u6570\u636E",success:"\u64CD\u4F5C\u6210\u529F",checkAll:"\u5168\u9009",all:"\u5168\u90E8",more:"\u66F4\u591A",pleaseInput:"\u8BF7\u8F93\u5165{label}",pleaseSelect:"\u8BF7\u9009\u62E9{label}",to:"\u81F3",startDate:"\u5F00\u59CB\u65E5\u671F",endDate:"\u7ED3\u675F\u65E5\u671F",startTime:"\u5F00\u59CB\u65F6\u95F4",endTime:"\u7ED3\u675F\u65F6\u95F4",systemPrompt:"\u7CFB\u7EDF\u63D0\u793A",confirm:"\u786E\u8BA4",cancel:"\u53D6\u6D88"},building:{text:"\u6B63\u5728\u5EFA\u8BBE\u4E2D..."},datePicker:{quarter:{year:"{year}\u5E74",firstQuarter:"\u7B2C\u4E00\u5B63\u5EA6",secondQuarter:"\u7B2C\u4E8C\u5B63\u5EA6",thirdQuarter:"\u7B2C\u4E09\u5B63\u5EA6",fourthQuarter:"\u7B2C\u56DB\u5B63\u5EA6",first:"\u4E00",second:"\u4E8C",third:"\u4E09",fourth:"\u56DB",format:"YYYY\u5E74\u7B2Cq\u5B63\u5EA6"},semiAnnual:{year:"{year}\u5E74",firstHalf:"\u4E0A\u534A\u5E74",secondHalf:"\u4E0B\u534A\u5E74"}},downloadButton:{downloadError:"\u4E0B\u8F7D\u5931\u8D25"},fileSelect:{dragAndDrop:"\u62D6\u62FD\u6587\u4EF6\u81F3\u6B64\uFF0C\u6216\u8005",selectFile:"\u9009\u62E9\u6587\u4EF6",changeFile:"\u66F4\u6362\u6587\u4EF6",supportFileTypes:"\u53EA\u652F\u6301 {fileTypes} \u683C\u5F0F\u7684\u6587\u4EF6",maxFileSize:"\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7 {maxSize}",maxFileCount:"\u6700\u591A\u9009\u62E9 {maxCount} \u4E2A\u6587\u4EF6"},fileUpload:{drop:"\u91CA\u653E\u6587\u4EF6\u5230\u6B64\u5904\u4E0A\u4F20",drag:"\u70B9\u51FB\u6216\u62D6\u62FD\u6587\u4EF6\u5230\u6B64\u5904\u4E0A\u4F20",unsupportedFileType:"\u4E0D\u652F\u6301\u4E0A\u4F20{ext}\u6587\u4EF6\uFF0C\u5F53\u524D\u9009\u4E2D\u6587\u4EF6{filename}\u5DF2\u4F5C\u5E9F",maxFileSize:"\u6587\u4EF6\u6700\u5927\u4E0D\u8D85\u8FC7{maxSize}\uFF0C\u5F53\u524D\u9009\u4E2D\u6587\u4EF6{filename}\u5DF2\u4F5C\u5E9F",maxFileCount:"\u6587\u4EF6\u603B\u6570\u4E0D\u80FD\u8D85\u8FC7{maxCount}\u4E2A\uFF0C\u8D85\u51FA\u7684\u6587\u4EF6\u5DF2\u5E9F\u5F03",someFilesFailed:"\u8FD8\u6709\u6587\u4EF6\u672A\u6210\u529F\u4E0A\u4F20",uploadFailed:"\u4E0A\u4F20\u5931\u8D25",retryTip:"\u4E0A\u4F20\u5931\u8D25\uFF0C\u70B9\u51FB\u91CD\u8BD5",allFiles:"\u5168\u90E8 ({count})",uploadingFiles:"\u4E0A\u4F20\u4E2D ({count})",failedFiles:"\u4E0A\u4F20\u5931\u8D25 ({count})",uploadedFiles:"\u4E0A\u4F20\u6210\u529F ({count})",retryAll:"\u5168\u90E8\u91CD\u8BD5",removeAll:"\u5168\u90E8\u79FB\u9664",confirmRemoveAll:"\u786E\u5B9A\u8981\u79FB\u9664\u5F53\u524D\u9875\u7B7E\u4E0B\u6240\u6709\u6587\u4EF6\uFF08\u5171{count}\u4E2A\uFF09\u5417\uFF1F"},filter:{search:"\u641C\u7D22",reset:"\u91CD\u7F6E",expand:"\u5C55\u5F00",collapse:"\u6536\u8D77"},form:{requiredInput:"\u8BF7\u8F93\u5165{label}",requiredSelect:"\u8BF7\u9009\u62E9{label}"},table:{confirm:"\u786E\u8BA4",reset:"\u91CD\u7F6E"},treePanel:{filterPlaceholder:"\u8BF7\u8F93\u5165\u5173\u952E\u5B57",currentSelected:"\u5F53\u524D\u9009\u4E2D"},upload:{upload:"\u4E0A\u4F20",uploadFailed:"\u4E0A\u4F20\u5931\u8D25",supportFileTypes:"\u53EA\u652F\u6301 {fileTypes} \u683C\u5F0F\u7684\u6587\u4EF6",maxFileSize:"\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7 {maxSize}",maxFileCount:"\u6700\u591A\u9009\u62E9 {maxCount} \u4E2A\u6587\u4EF6"},preview:{scaleUp:"\u653E\u5927",scaleDown:"\u7F29\u5C0F",scaleReset:"\u91CD\u7F6E",prevPage:"\u4E0A\u4E00\u9875",nextPage:"\u4E0B\u4E00\u9875",noDoc:"\u6682\u65E0\u6587\u6863",loadPdfError:"\u52A0\u8F7DPDF\u5931\u8D25",copy:"\u590D\u5236",copySuccess:"\u590D\u5236\u6210\u529F",lineNumbers:"\u663E\u793A\u884C\u53F7",wordWrap:"\u81EA\u52A8\u6362\u884C",fileTooLarge:"\u6587\u4EF6\u8FC7\u5927\uFF0C\u65E0\u6CD5\u9884\u89C8\uFF08\u6700\u5927 {maxSize}\uFF09",noAudio:"\u6682\u65E0\u97F3\u9891\u6587\u4EF6",noVideo:"\u6682\u65E0\u89C6\u9891\u6587\u4EF6",play:"\u64AD\u653E",pause:"\u6682\u505C",mute:"\u9759\u97F3",unmute:"\u53D6\u6D88\u9759\u97F3",fullscreen:"\u5168\u5C4F",exitFullscreen:"\u9000\u51FA\u5168\u5C4F",imageLoadError:"\u56FE\u7247\u52A0\u8F7D\u5931\u8D25",audioLoadError:"\u97F3\u9891\u52A0\u8F7D\u5931\u8D25",videoLoadError:"\u89C6\u9891\u52A0\u8F7D\u5931\u8D25",textLoadError:"\u6587\u4EF6\u52A0\u8F7D\u5931\u8D25",converting:"\u6B63\u5728\u8F6C\u6362\u6587\u6863",convertError:"\u6587\u6863\u8F6C\u6362\u5931\u8D25",converterNotConfigured:"\u8BF7\u914D\u7F6E\u6587\u6863\u8F6C\u6362\u670D\u52A1",notSupported:"\u6682\u4E0D\u652F\u6301\u8BE5\u6587\u4EF6\u7C7B\u578B\u9884\u89C8",previewMode:"\u9884\u89C8"}}};export{u as default};
|
package/dist/utils/index.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! Next UI utils v1.5.
|
|
2
|
-
`);i=f.pop()||"";for(let h of f)if(h=h.trim(),!!h)if(r)yield h;else{if(h==="event: ping")continue;const T=h.match(/^(?:(\w*):)?(.*)$/);if(!T){console.error("[BufferedReader] parse line failed:",h);continue}const E=T[1],F=z(T[2].trim());if(!F){console.error("[BufferedReader] parse json failed:",T[2].trim());continue}yield{event:E,data:F}}}}const Ge=e=>{let{url:n,filename:t}=e;if(t=t||"\u672A\u547D\u540D",n||e.blob&&(n=URL.createObjectURL(e.blob),setTimeout(()=>{URL.revokeObjectURL(n)},1e4)),!n)throw new Error("No URL provided");const r=document.createElement("a");r.href=n,r.target="_blank",r.download=t,r.click()};function ze(e,n,t){let r,i,o,u,f,h,T=0,E=!1,F=!1,M=!0;if(typeof e!="function")throw new TypeError("Expected a function");n=+n||0,t&&C(t)&&(E=!!t.leading,F="maxWait"in t,o=F?Math.max(+t.maxWait||0,n):o,M="trailing"in t?!!t.trailing:M);function I(p){const O=r,D=i;return r=i=void 0,T=p,u=e.apply(D,O),u}function P(p,O){return setTimeout(p,O)}function a(p){clearTimeout(p)}function d(p){return T=p,f=P(g,n),E?I(p):u}function c(p){const O=p-h,D=p-T,B=n-O;return F?Math.min(B,o-D):B}function s(p){const O=p-h,D=p-T;return h===void 0||O>=n||O<0||F&&D>=o}function g(){const p=Date.now();if(s(p))return w(p);f=P(g,c(p))}function w(p){return f=void 0,M&&r?I(p):(r=i=void 0,u)}function v(){f!==void 0&&a(f),T=0,r=h=i=f=void 0}function m(){return f===void 0?u:w(Date.now())}function b(){return f!==void 0}function y(...p){const O=Date.now(),D=s(O);if(r=p,i=this,h=O,D){if(f===void 0)return d(h);if(F)return f=P(g,n),I(h)}return f===void 0&&(f=P(g,n)),u}return y.cancel=v,y.flush=m,y.pending=b,y}function Ve(e){const{el:n,msg:t}=e||{},r=t===void 0?"\u8BF7\u5B8C\u5584\u8868\u5355\u5185\u5BB9":t;if(r&&S.ElMessage.error(r),!n)return;const i=n.querySelector(".is-error");i&&i.scrollIntoView({behavior:"smooth",inline:"nearest",block:"center"})}async function Ye(e,n={successText:"\u590D\u5236\u6210\u529F"}){const{successText:t}=n||{};try{if(navigator.clipboard){await navigator.clipboard.writeText(e),t&&S.ElMessage.success(t);return}}catch(i){}const r=document.createElement("textarea");document.body.appendChild(r),r.style.position="fixed",r.style.clip="rect(0 0 0 0)",r.style.top="10px",r.value=e,r.select(),document.execCommand("copy",!0),document.body.removeChild(r),t&&S.ElMessage.success(t)}function Je(e,...n){if(!e)return;const t=document.createElement("a");t.addEventListener("click",r=>{r.preventDefault(),window.open(e,...n)}),t.click()}function Ke(e){if(!e)return[];const n=[`${e.slice(0,2)}0000`,`${e.slice(0,4)}00`,e.slice(0,6),e.slice(0,9),e.slice(0,12)],t=0,r=n.indexOf(e)+1;return n.slice(t,r)}class N{constructor(n){this._enumItems={};var t;if(n)if(Array.isArray(n))for(const[r,i]of n.entries())this.add((t=i.key)!=null?t:`${r}`,i);else for(const r in n){const i=n[r];this.add(r,i)}}add(n,t){if(this[n])throw new Error(`\u679A\u4E3E\u9879 ${n} \u5DF2\u5B58\u5728`);const r=t.value;return this[n]=r,this._enumItems[r]={...t},this}keys(){return Object.keys(this).filter(n=>n!=="_enumItems")}*[Symbol.iterator](){for(const n of this.keys())yield this.getItem(this[n])}getItem(n){return this._enumItems[n]}getLabel(n){var t;return(t=this.getItem(n))==null?void 0:t.label}getProps(n){var t;return(t=this.getItem(n))==null?void 0:t.props}filter(n){const t=new N;for(const r of this.keys()){const i=this.getItem(this[r]);n(i,r)&&t.add(r,i)}return t}clone(){return this.filter(()=>!0)}set(n,t){const r=this.getItem(this[n]);return r&&Object.assign(r,t),this}remove(n){const t=this[n];return t!==void 0&&(delete this[n],delete this._enumItems[t]),this}forEach(n){for(const t of this.keys())n(this.getItem(this[t]),t)}}const Xe=(e,n)=>{if(!e||!n)return!1;if(n.includes(" "))throw new Error("className should not contain space.");return e.classList.contains(n)},Ze=(e,n,t)=>{var r,i,o,u,f,h,T,E;if(!e)return!1;const F=e.getBoundingClientRect();let M=0,I=0,P=window.innerHeight,a=window.innerWidth;if(n){const w=n.getBoundingClientRect();M=w.top,I=w.left,P=w.bottom,a=w.right}let d=0,c=0,s=0,g=0;return t&&(d=(i=(r=t.topGap)!=null?r:t.gap)!=null?i:0,c=(u=(o=t.leftGap)!=null?o:t.gap)!=null?u:0,s=(h=(f=t.bottomGap)!=null?f:t.gap)!=null?h:0,g=(E=(T=t.rightGap)!=null?T:t.gap)!=null?E:0),F.top>=M+d&&F.left>=I+c&&F.bottom<=P-s&&F.right<=a-g};function xe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var J={exports:{}},R={exports:{}},K;function Qe(){return K||(K=1,function(e,n){(function(t,r){e.exports=r()})(window,function(){return function(t){var r={};function i(o){if(r[o])return r[o].exports;var u=r[o]={i:o,l:!1,exports:{}};return t[o].call(u.exports,u,u.exports,i),u.l=!0,u.exports}return i.m=t,i.c=r,i.d=function(o,u,f){i.o(o,u)||Object.defineProperty(o,u,{enumerable:!0,get:f})},i.r=function(o){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,u){if(1&u&&(o=i(o)),8&u||4&u&&typeof o=="object"&&o&&o.__esModule)return o;var f=Object.create(null);if(i.r(f),Object.defineProperty(f,"default",{enumerable:!0,value:o}),2&u&&typeof o!="string")for(var h in o)i.d(f,h,function(T){return o[T]}.bind(null,h));return f},i.n=function(o){var u=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(u,"a",u),u},i.o=function(o,u){return Object.prototype.hasOwnProperty.call(o,u)},i.p="",i(i.s=0)}([function(t,r,i){i.r(r);var o=window,u=/^image\//,f=/\.\w+$/,h={},T={file:null,quality:.8,convertSize:2048e3,loose:!0,redressOrientation:!0},E=function(a){return typeof a=="function"},F=function(a){return u.test(a)};function M(a){a=Object.assign({},T,a),this.options=a,this.file=a.file,this.image=null,this.ParsedOrientationInfo=null,this.init()}var I=M.prototype;for(var P in r.default=M,I.init=function(){var a=this,d=this.file,c=this.options;d&&F(d.type)?(F(c.mimeType)||(c.mimeType=d.type),h.file2Image(d,function(s){E(a.beforeCompress)&&(a.image=s,d.width=s.naturalWidth,d.height=s.naturalHeight,a.beforeCompress(d)),d.type==="image/jpeg"&&c.redressOrientation?a.getParsedOrientationInfo(function(g){a.parsedOrientationInfo=g,a.rendCanvas()}):(a.parsedOrientationInfo={rotate:0,scaleX:1,scaleY:1},a.rendCanvas())},a.error)):a.error("\u8BF7\u4E0A\u4F20\u56FE\u7247\u6587\u4EF6!")},I.rendCanvas=function(){var a=this,d=this.options,c=this.image,s=this.getExpectedEdge(),g=s.dWidth,w=s.dHeight,v=s.width,m=s.height,b=h.image2Canvas(c,g,w,a.beforeDraw.bind(a),a.afterDraw.bind(a),v,m);h.canvas2Blob(b,function(y){y&&(y.width=b.width,y.height=b.height),a.success(y)},d.quality,d.mimeType)},I.beforeCompress=function(){E(this.options.beforeCompress)&&this.options.beforeCompress(this.file)},I.getExpectedEdge=function(){var a,d=this.image,c=this.parsedOrientationInfo.rotate,s=this.options,g=d.naturalWidth,w=d.naturalHeight,v=Math.abs(c)%180==90;v&&(a=w,w=g,g=a);var m=g/w,b=Math.max(s.maxWidth,0)||1/0,y=Math.max(s.maxHeight,0)||1/0,p=Math.max(s.minWidth,0)||0,O=Math.max(s.minHeight,0)||0,D=Math.max(s.width,0)||g,B=Math.max(s.height,0)||w;b<1/0&&y<1/0?y*m>b?y=b/m:b=y*m:b<1/0?y=b/m:y<1/0&&(b=y*m),p>0&&O>0?O*m>p?O=p/m:p=O*m:p>0?O=p/m:O>0&&(p=O*m),B*m>D?B=D/m:D=B*m;var j=D=Math.floor(Math.min(Math.max(D,p),b)),$=B=Math.floor(Math.min(Math.max(B,O),y));return v&&(a=$,$=j,j=a),{dWidth:j,dHeight:$,width:D,height:B}},I.getParsedOrientationInfo=function(a){var d=this;this.getOrientation(function(c){E(a)&&a(d.parseOrientation(c))})},I.getOrientation=function(a){var d=this;h.file2ArrayBuffer(this.file,function(c){E(a)&&a(d.resetAndGetOrientation(c))})},I.resetAndGetOrientation=function(a){var d,c=new DataView(a);try{var s,g,w;if(c.getUint8(0)===255&&c.getUint8(1)===216)for(var v=c.byteLength,m=2;m+1<v;){if(c.getUint8(m)===255&&c.getUint8(m+1)===225){g=m;break}m+=1}if(g){var b=g+4,y=g+10;if(h.getStringFromCharCode(c,b,4)==="Exif"){var p=c.getUint16(y);if(((s=p===18761)||p===19789)&&c.getUint16(y+2,s)===42){var O=c.getUint32(y+4,s);O>=8&&(w=y+O)}}}if(w){var D;for(v=c.getUint16(w,s),D=0;D<v;D+=1)if(m=w+12*D+2,c.getUint16(m,s)===274){m+=8,d=c.getUint16(m,s),c.setUint16(m,1,s);break}}}catch(B){console.error(B),d=1}return d},I.parseOrientation=function(a){var d=0,c=1,s=1;switch(a){case 2:c=-1;break;case 3:d=-180;break;case 4:s=-1;break;case 5:d=90,s=-1;break;case 6:d=90;break;case 7:d=90,c=-1;break;case 8:d=-90}return{rotate:d,scaleX:c,scaleY:s}},I.beforeDraw=function(a,d){var c=this.parsedOrientationInfo,s=c.rotate,g=c.scaleX,w=c.scaleY,v=this.file,m=this.options,b="transparent",y=d.width,p=d.height;switch(v.size>m.convertSize&&m.mimeType==="image/png"&&(b="#fff",m.mimeType="image/jpeg"),a.fillStyle=b,a.fillRect(0,0,y,p),E(m.beforeDraw)&&m.beforeDraw.call(this,a,d),a.save(),s){case 90:a.translate(y,0);break;case-90:a.translate(0,p);break;case-180:a.translate(y,p)}a.rotate(s*Math.PI/180),a.scale(g,w)},I.afterDraw=function(a,d){var c=this.options;E(c.afterDraw)&&c.afterDraw.call(this,a,d)},I.error=function(a){var d=this.options;if(!E(d.error))throw new Error(a);d.error.call(this,a)},I.success=function(a){var d,c,s=this.options,g=this.file,w=this.image,v=this.getExpectedEdge(),m=w.naturalHeight,b=w.naturalWidth;if(a&&a.size)if(!s.loose&&a.size>g.size&&!(v.width>b||v.height>m))console.warn("\u5F53\u524D\u8BBE\u7F6E\u7684\u662F\u975E\u5BBD\u677E\u6A21\u5F0F\uFF0C\u538B\u7F29\u7ED3\u679C\u5927\u4E8E\u6E90\u56FE\u7247\uFF0C\u8F93\u51FA\u6E90\u56FE\u7247"),a=g;else{var y=new Date;a.lastModified=y.getTime(),a.lastModifiedDate=y,a.name=g.name,a.name&&a.type!==g.type&&(a.name=a.name.replace(f,(d=a.type,(c=F(d)?d.substr(6):"")==="jpeg"&&(c="jpg"),"."+c)))}else console.warn("\u56FE\u7247\u538B\u7F29\u51FA\u4E86\u70B9\u610F\u5916\uFF0C\u8F93\u51FA\u6E90\u56FE\u7247"),a=g;E(s.success)&&s.success.call(this,a)},h.file2DataUrl=function(a,d,c){var s=new FileReader;s.onload=function(){d(s.result)},s.onerror=function(){E(c)&&c("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25\uFF01")},s.readAsDataURL(a)},h.file2ArrayBuffer=function(a,d,c){var s=new FileReader;s.onload=function(g){d(g.target.result)},s.onerror=function(){E(c)&&c("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25\uFF01")},s.readAsArrayBuffer(a)},h.getStringFromCharCode=function(a,d,c){var s,g="";for(c+=d,s=d;s<c;s+=1)g+=String.fromCharCode(a.getUint8(s));return g},h.file2Image=function(a,d,c){var s=new Image,g=o.URL||o.webkitURL;if(o.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(o.navigator.userAgent)&&(s.crossOrigin="anonymous"),s.alt=a.name,s.onerror=function(){E(c)&&c("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")},g){var w=g.createObjectURL(a);s.onload=function(){d(s),g.revokeObjectURL(w)},s.src=w}else this.file2DataUrl(a,function(v){s.onload=function(){d(s)},s.src=v},c)},h.url2Image=function(a,d,c){var s=new Image;s.src=a,s.onload=function(){d(s)},s.onerror=function(){E(c)&&c("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")}},h.image2Canvas=function(a,d,c,s,g,w,v){var m=document.createElement("canvas"),b=m.getContext("2d");return m.width=w||a.naturalWidth,m.height=v||a.naturalHeight,E(s)&&s(b,m),b.save(),b.drawImage(a,0,0,d,c),b.restore(),E(g)&&g(b,m),m},h.canvas2DataUrl=function(a,d,c){return a.toDataURL(c||"image/jpeg",d)},h.dataUrl2Image=function(a,d,c){var s=new Image;s.onload=function(){d(s)},s.error=function(){E(c)&&c("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")},s.src=a},h.dataUrl2Blob=function(a,d){for(var c=a.split(",")[1],s=a.match(/^data:(.*?)(;base64)?,/)[1],g=atob(c),w=c.length,v=new Uint8Array(w),m=0;m<w;m++)v[m]=g.charCodeAt(m);return new Blob([v],{type:d||s})},h.blob2DataUrl=function(a,d,c){this.file2DataUrl(a,d,c)},h.blob2Image=function(a,d,c){this.file2Image(a,d,c)},h.canvas2Blob=function(a,d,c,s){var g=this;HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(w,v,m){var b=this.toDataURL(v,m);w(g.dataUrl2Blob(b))}}),a.toBlob(function(w){d(w)},s||"image/jpeg",c||.8)},h.upload=function(a,d,c){var s=new XMLHttpRequest,g=new FormData;g.append("file",d),s.onreadystatechange=function(){if(s.readyState!==4||s.status!==200)throw new Error(s);c&&c(s.responseText)},s.open("POST",a,!0),s.send(g)},h)h.hasOwnProperty(P)&&(M[P]=h[P])}]).default})}(R)),R.exports}(function(e){e.exports=Qe()})(J);var et=xe(J.exports);const tt=e=>{if(!e.file)throw new Error("file is required");const n=e.file.size/1024;let t=e.quality;if(t===void 0){if(n<200)return e.file;n>200&&n<=512?t=.9:n>512&&n<=1024?t=.8:n>1024&&n<=2048?t=.85:n>2048&&n<=10240?t=.8:n>10240&&n<=20480&&(t=.75)}return new Promise((r,i)=>{var o;new et({...e,quality:t,convertSize:(o=e.convertSize)!=null?o:1024,success:u=>{r(u)},error:u=>{i(u)}})})},X=e=>e&&e.split("?")[0].split("/").pop()||"",nt=e=>{if(e=X(e),!e)return"";const n=e.lastIndexOf(".");return n===-1?"":e.slice(n+1).toLowerCase()},rt=(e,n,t)=>Math.min(Math.max(t,e),n),_=new Map,it=(e,n=3)=>{if(!e)throw new Error("name is required");let t;return _.has(e)?t=_.get(e):(t={maxNum:n,currentNum:0,queue:[]},_.set(e,t)),{acquire:async()=>new Promise((f,h)=>{t.currentNum>=t.maxNum?t.queue.push({resolve:f,reject:h}):(t.currentNum++,f(!0))}),release:()=>{if(t.queue.length>0){const{resolve:f}=t.queue.shift();f(!0)}else t.currentNum--},destroy:async()=>{_.delete(e)},getMaxNum:()=>t.maxNum}};l.Enum=N,l.arrayDiff=ie,l.arrayEquals=q,l.assign=de,l.buildTree=we,l.buildUrl=$e,l.clamp=rt,l.combineByField=Te,l.compressImage=tt,l.copyText=Ye,l.createLock=it,l.createStreamIterator=We,l.createTimer=Ae,l.debounce=ze,l.decodeHTMLEntities=He,l.deepAssign=G,l.deepClone=me,l.delayWhen=Se,l.downloadFile=Ge,l.encodeHTMLEntities=qe,l.fileToBlob=Ne,l.fileToDataURL=ke,l.fileToObjectURL=Le,l.filterTree=Y,l.findNode=ye,l.findNodeWithPath=be,l.findParentAndIndex=Ee,l.flatTree=Oe,l.formatBytes=Pe,l.formatDate=Fe,l.formatInterval=De,l.formatNumber=Ie,l.formatPx=Be,l.formatTime=Me,l.getFileExt=nt,l.getFilename=X,l.getNearestNumbers=se,l.getProp=pe,l.getProperty=k,l.getRandInt=_e,l.groupBy=ue,l.handleFormValidateError=Ve,l.hasClass=Xe,l.isBlob=ee,l.isChildClassOf=ne,l.isElementInViewport=Ze,l.isEmpty=A,l.isEqual=re,l.isIframe=Q,l.isImage=te,l.isObject=x,l.isPlainObject=C,l.looseEqual=U,l.mergeDefaultOptions=V,l.omit=fe,l.omitEmpty=he,l.openPage=Je,l.parseAreaCode=Ke,l.parseJson=z,l.pick=W,l.runAtLeastTime=Ce,l.setProperty=ge,l.sleep=L,l.toArray=ae,l.toCamelCase=le,l.toKebabCase=H,l.toUnderscore=ce,l.urlToBlob=Re,l.urlToDataURL=Ue,l.urlToPngBlob=je,l.walkTree=ve,l.withInstall=Z,l.without=oe,Object.defineProperty(l,"__esModule",{value:!0})});
|
|
1
|
+
/*! Next UI utils v1.5.13 */(function(c,S){typeof exports=="object"&&typeof module!="undefined"?S(exports,require("element-plus")):typeof define=="function"&&define.amd?define(["exports","element-plus"],S):(c=typeof globalThis!="undefined"?globalThis:c||self,S(c.NextUI={},c.ElementPlus))})(this,function(c,S){"use strict";const Z=(e,n)=>{try{if(e.install=t=>{for(const r of[e,...Object.values(n!=null?n:{})])r.name&&t.component(r.name,r)},n)for(const[t,r]of Object.entries(n))e[t]=r;return e}catch(t){}};function x(e){const n=typeof e;return e!=null&&(n==="object"||n==="function")}function M(e){return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"}function A(e){if(typeof e=="boolean"||typeof e=="number")return!1;if(Array.isArray(e)){if(e.length===0)return!0}else if(e instanceof Object&&JSON.stringify(e)==="{}")return!0;return e==null||e==="null"||e==="undefined"||e===""}function Q(){return window.top!==window}function ee(e){return toString.call(e)==="[object Blob]"}function te(e){if(e.startsWith("data:image"))return!0;const n=e.lastIndexOf("."),t=n>=0?e.slice(n+1).toLowerCase():"";return["png","jpg","jpeg","gif","bmp","webp","svg"].includes(t)}function ne(e,n){for(;e;){if(e===n)return!0;e=Object.getPrototypeOf(e)}return!1}const U=(e,n)=>{const t=M(e),r=M(n);return t&&r?JSON.stringify(e)===JSON.stringify(n):!t&&!r?String(e)===String(n):!1},H=(e,n)=>{if(e=e||[],n=n||[],e.length!==n.length)return!1;for(const[t,r]of e.entries())if(!U(r,n[t]))return!1;return!0},re=(e,n)=>Array.isArray(e)&&Array.isArray(n)?H(e,n):U(e,n);function ie(e,n,t){const r={};let i;typeof t=="function"?i=t:t?i=f=>f[t]:i=f=>f,(e||[]).forEach(f=>{const h=i(f);r[h]={item:f,count:-1}}),(n||[]).forEach(f=>{const h=i(f);r[h]?r[h].count=0:r[h]={item:f,count:1}});const o=[],u=[];for(const f in r)Object.prototype.hasOwnProperty.call(r,f)&&(r[f].count===1?u.push(r[f].item):r[f].count===-1&&o.push(r[f].item));return{changed:o.length+u.length>0,removed:o.length>0,added:u.length>0,removedItems:o,addedItems:u}}const oe=(e,...n)=>{const t=[];return e.forEach(r=>{n.includes(r)||t.push(r)}),t},ae=e=>A(e)?[]:Array.isArray(e)?e:[e],ue=(e,n)=>{if(typeof n!="function"){const t=n;n=r=>String(r[t])}return(e||[]).reduce((t,r)=>{const i=n(r);return t[i]||(t[i]=[]),t[i].push(r),t},{})},se=(e,n,t,r)=>{r=r||(()=>!0);const[i,o]=n,u=[];if(t<=0||e>=i&&e<=o&&r(e)&&(u.push(e),u.length>=t))return u;let f=1;for(;u.length<t;){const h=e-f,O=e+f,E=h>=i,T=O<=o;if(!E&&!T||E&&r(h)&&(u.push(h),u.length>=t)||T&&r(O)&&(u.push(O),u.length>=t))break;f++}return u};function ce(e){return e.replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase()}function W(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").toLowerCase()}function le(e){return e.replace(/-([a-z])/g,(n,t)=>t.toUpperCase()).replace(/_([a-z])/g,(n,t)=>t.toUpperCase())}const G=(e,n,...t)=>{const r={};return n=(n?[].concat(n):[]).concat(t),e&&n.forEach(i=>{Object.hasOwnProperty.call(e,i)&&(r[i]=e[i])}),r},fe=(e,n,...t)=>{const r={};return n=(n?[].concat(n):[]).concat(t),e&&Object.keys(e).forEach(i=>{n.includes(i)||(r[i]=e[i])}),r},de=(e,...n)=>{for(const t of n)Object.assign(e,G(t,Object.keys(e)));return e};function z(e,...n){M(e)||(e={});for(const t of n)if(M(t))for(const r in t)r==="__proto__"||e===t[r]||(M(t[r])?e[r]=z(e[r],t[r]):e[r]=t[r]);return e}const he=e=>{const n={};if(e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A(e[t])||(n[t]=e[t]));return n};function me(e){const n=new WeakMap,t=r=>{if(typeof r=="object"&&r!==null){if(n.has(r))return n.get(r);const i=Array.isArray(r)?[]:{};n.set(r,i);for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=t(r[o]));return i}return r};return t(e)}function V(e,n){try{return JSON.parse(e)}catch(t){return console.error("parse json error:",e),n}}function ge(e,n,t){if(!e||!n)return;const r=n.split(".");let i;for(;(i=r.shift())!==void 0&&r.length!==0;)e[i]||(e[i]={}),e=e[i];i&&(e[i]=t)}function k(e,n){if(!e||!n)return;const t=n.split(".");for(const r of t){if(!e)return;e=e[r]}return e}const Y=(e,n)=>{for(const t in e)Object.getOwnPropertyDescriptor(n,t)?M(e[t])&&Y(e[t],n[t]):n[t]=e[t];return n},pe=(e,n)=>{var t;return(t=e[n])!=null?t:e[W(n)]};function we(e,n){let{key:t,parentKey:r}=n||{};t=t||"id",r=r||"pid";const i=(e||[]).reduce((u,f)=>(u[k(f,t)]=f,u),{}),o=[];return(e||[]).forEach(u=>{const f=i[k(u,r)];f?(f.children||(f.children=[])).push(u):o.push(u)}),o}function J(e,n,t=null,r=1){const i=[];return(e||[]).forEach(o=>{let{children:u,...f}=o;u&&u.length>0&&(u=J(u,n,f,r+1),u.length>0&&(f.children=u)),n(f,t,r)&&i.push(f)}),i}function ye(e,n){const t=e?[...e]:[];for(;t.length>0;){const r=t.shift();if(n(r))return r;r.children&&r.children.length>0&&t.push(...r.children)}return null}function be(e,n){const t=(r,i)=>{for(const o of r){if(n(o))return[...i,o];if(o.children&&o.children.length>0){const u=t(o.children,[...i,o]);if(u)return u}}return null};return t(e||[],[])}function Ee(e,n){const t={children:e||[]},r=[t];let i,o=-1;for(;r.length>0;){i=r.shift();const{children:u}=i;if(u&&u.length>0){for(const[f,h]of u.entries())if(n(h)){o=f;break}if(o!==-1)break;r.push(...u)}}return{found:o!==-1,parent:i===t?null:i,index:o}}function ve(e,n){const t=(e||[]).map(r=>({node:r,parent:null}));for(;t.length>0;){const r=t.shift(),{node:i,parent:o}=r;if(n(i,o)===!1)break;i.children&&i.children.length>0&&t.push(...i.children.map(f=>({node:f,parent:i})))}}function Fe(e){const n=[];if(e&&e.length>0){n.push(...e);let t=0;for(;t<n.length;){const{children:r}=n[t];r&&r.length>0&&n.push(...r),t++}}return n}function Oe(e,n,t){t||(t=n);const r=i=>(i||[]).reduce((o,u)=>(u[t]=u[n]+(u.children?r(u.children):0),o+u[t]),0);r(e)}function Te(e,n){if(!e)return"";const t=new Date(e);if(t.getTime()===0)return"";n=n||"yyyy-MM-dd";let r;const i={"Y+":t.getFullYear().toString(),"y+":t.getFullYear().toString(),"M+":(t.getMonth()+1).toString(),"D+":t.getDate().toString(),"d+":t.getDate().toString(),"h+":(t.getHours()%12||12).toString(),"H+":t.getHours().toString(),"m+":t.getMinutes().toString(),"s+":t.getSeconds().toString(),a:t.getHours()<12?"am":"pm",A:t.getHours()<12?"AM":"PM"};for(const o in i)r=new RegExp(`(${o})`).exec(n),r&&(n=n.replace(r[1],r[1].length===1?i[o]:i[o].padStart(r[1].length,"0")));return n}function Ie(e,n){if(A(e))return"";let{minPrecision:t,maxPrecision:r,decimalPoint:i,thousandSeparator:o,grouping:u}=n||{};t=t!=null?t:0,r=r!=null?r:2,i=i||".",o=o!=null?o:",",u=u!=null?u:3;let[f,h]=`${e}`.split(".");return f=f.replace(new RegExp(`(?<!^-?)(?=(\\d{${u}})+$)`,"g"),o),h=(h||"").slice(0,r).padEnd(t,"0"),h&&(h=i+h),f+h}function De(e,n){if(n){const i=A(e[0])||e[0]===Number.NEGATIVE_INFINITY?"-\u221E":e[0],o=A(e[1])||e[1]===+Number.POSITIVE_INFINITY?"+\u221E":e[1];return`${i+(i==="-\u221E"?" < ":" \u2264 ")+n} < ${o}`}const t=A(e[0])||e[0]==="-\u221E"||e[0]==="-Infinity"?"-\u221E":e[0],r=A(e[1])||e[1]==="+\u221E"||e[1]==="Infinity"?"+\u221E":e[1];return`${t==="-\u221E"?"(":"["} ${t}, ${r} )`}function Pe(e){if(e=Number(e),Number.isNaN(e))return"";const n=["B","KB","MB","GB","TB","PB"];let t=0;for(;e>=1024&&t<n.length-1;)e/=1024,t++;return e=Math.round(e*100)/100,`${e} ${n[t]}`}function Be(e){return Number.isNaN(Number(e))?e||"":`${Number(e)}px`}function Ce(e){if(e=Number(e),!Number.isFinite(e)||Number.isNaN(e))return"00:00";const n=Math.floor(e),t=n%60,r=String(t).padStart(2,"0");if(n<3600){const f=Math.floor(n/60);return`${String(f).padStart(2,"0")}:${r}`}const i=Math.floor(n/3600),o=Math.floor(n%3600/60),u=String(o).padStart(2,"0");return`${i}:${u}:${r}`}const L=e=>new Promise(n=>{setTimeout(n,e)}),Me=(e,n)=>new Promise((t,r)=>{(async()=>{try{const o=Date.now(),u=await e(),f=Date.now()-o;f<n&&await L(n-f),t(u)}catch(o){r(o)}})()}),Ae=()=>{const e=Date.now();return{delayTo:async t=>{const r=Date.now()-e;r<t&&await L(t-r)}}},Se=(e,n,t)=>{let r,i=!1,o;const u=()=>{if(i||e()){r(void 0),clearTimeout(o);return}requestAnimationFrame(u)};return t&&(o=setTimeout(()=>{i=!0},t)),new Promise(f=>{r=f,n?setTimeout(u,n):requestAnimationFrame(u)})},_e=(e,n)=>Math.floor(e+Math.random()*(n-e));function Ue(e){return new Promise((n,t)=>{const r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=()=>{if(r.status===200){const i=new FileReader;i.readAsDataURL(r.response),i.onload=o=>{n(o.target.result)},i.onerror=o=>t(o)}else t(new Error("Failed to load file"))},r.onerror=()=>{t(new Error("Failed to load file"))},r.send()})}function ke(e){return new Promise((n,t)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=i=>{n(i.target.result)},r.onerror=i=>t(i)})}function Le(e){return URL.createObjectURL(e)}function Ne(e){return new Promise((n,t)=>{const r=new FileReader;r.readAsArrayBuffer(e),r.onload=i=>{n(new Blob([i.target.result]))},r.onerror=i=>t(i)})}async function Re(e){if(!e)throw new Error("url is empty");return(await fetch(e)).blob()}async function je(e){if(!e)throw new Error("url is empty");return new Promise((n,t)=>{const r=new Image;r.onload=()=>{const i=document.createElement("canvas");i.width=r.width,i.height=r.height;const o=i.getContext("2d");o==null||o.drawImage(r,0,0,r.width,r.height),i.toBlob(u=>{u?n(u):t(new Error("transform image to blob failed"))},"image/png")},r.onerror=t,r.src=e})}function $e(e,n){if(!e)return"";if(typeof e=="string"&&(e=new URL(e)),n)for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&e.searchParams.append(t,n[t]);return e.toString()}function qe(e){return e.replace(/[<>&"]/g,n=>`&#${n.charCodeAt(0)};`)}function He(e){const n=document.createElement("div");return n.innerHTML=e,n.textContent||n.innerText}async function*We(e,n){const t=new TextDecoder("utf-8"),{original:r}=n||{};let i="";for(;;){const{value:o,done:u}=await e.read();if(u)return;i+=t.decode(o);const f=i.split(`
|
|
2
|
+
`);i=f.pop()||"";for(let h of f)if(h=h.trim(),!!h)if(r)yield h;else{if(h==="event: ping")continue;const O=h.match(/^(?:(\w*):)?(.*)$/);if(!O){console.error("[BufferedReader] parse line failed:",h);continue}const E=O[1],T=V(O[2].trim());if(!T){console.error("[BufferedReader] parse json failed:",O[2].trim());continue}yield{event:E,data:T}}}}const Ge=e=>{let{url:n,filename:t}=e;if(t=t||"\u672A\u547D\u540D",n||e.blob&&(n=URL.createObjectURL(e.blob),setTimeout(()=>{URL.revokeObjectURL(n)},1e4)),!n)throw new Error("No URL provided");const r=document.createElement("a");r.href=n,r.target="_blank",r.download=t,r.click()};function ze(e,n,t){let r,i,o,u,f,h,O=0,E=!1,T=!1,C=!0;if(typeof e!="function")throw new TypeError("Expected a function");n=+n||0,t&&M(t)&&(E=!!t.leading,T="maxWait"in t,o=T?Math.max(+t.maxWait||0,n):o,C="trailing"in t?!!t.trailing:C);function I(p){const F=r,D=i;return r=i=void 0,O=p,u=e.apply(D,F),u}function P(p,F){return setTimeout(p,F)}function a(p){clearTimeout(p)}function d(p){return O=p,f=P(g,n),E?I(p):u}function l(p){const F=p-h,D=p-O,B=n-F;return T?Math.min(B,o-D):B}function s(p){const F=p-h,D=p-O;return h===void 0||F>=n||F<0||T&&D>=o}function g(){const p=Date.now();if(s(p))return w(p);f=P(g,l(p))}function w(p){return f=void 0,C&&r?I(p):(r=i=void 0,u)}function v(){f!==void 0&&a(f),O=0,r=h=i=f=void 0}function m(){return f===void 0?u:w(Date.now())}function b(){return f!==void 0}function y(...p){const F=Date.now(),D=s(F);if(r=p,i=this,h=F,D){if(f===void 0)return d(h);if(T)return f=P(g,n),I(h)}return f===void 0&&(f=P(g,n)),u}return y.cancel=v,y.flush=m,y.pending=b,y}function Ve(e){const{el:n,msg:t}=e||{},r=t===void 0?"\u8BF7\u5B8C\u5584\u8868\u5355\u5185\u5BB9":t;if(r&&S.ElMessage.error(r),!n)return;const i=n.querySelector(".is-error");i&&i.scrollIntoView({behavior:"smooth",inline:"nearest",block:"center"})}async function Ye(e,n={successText:"\u590D\u5236\u6210\u529F"}){const{successText:t}=n||{};try{if(navigator.clipboard){await navigator.clipboard.writeText(e),t&&S.ElMessage.success(t);return}}catch(i){}const r=document.createElement("textarea");document.body.appendChild(r),r.style.position="fixed",r.style.clip="rect(0 0 0 0)",r.style.top="10px",r.value=e,r.select(),document.execCommand("copy",!0),document.body.removeChild(r),t&&S.ElMessage.success(t)}function Je(e,...n){if(!e)return;const t=document.createElement("a");t.addEventListener("click",r=>{r.preventDefault(),window.open(e,...n)}),t.click()}function Ke(e){if(!e)return[];const n=[`${e.slice(0,2)}0000`,`${e.slice(0,4)}00`,e.slice(0,6),e.slice(0,9),e.slice(0,12)],t=0,r=n.indexOf(e)+1;return n.slice(t,r)}class N{constructor(n){this._enumItems={};var t;if(n)if(Array.isArray(n))for(const[r,i]of n.entries())this.add((t=i.key)!=null?t:`${r}`,i);else for(const r in n){const i=n[r];this.add(r,i)}}add(n,t){if(this[n])throw new Error(`\u679A\u4E3E\u9879 ${n} \u5DF2\u5B58\u5728`);const r=t.value;return this[n]=r,this._enumItems[r]={...t},this}keys(){return Object.keys(this).filter(n=>n!=="_enumItems")}*[Symbol.iterator](){for(const n of this.keys())yield this.getItem(this[n])}getItem(n){return this._enumItems[n]}getLabel(n){var t;return(t=this.getItem(n))==null?void 0:t.label}getProps(n){var t;return(t=this.getItem(n))==null?void 0:t.props}filter(n){const t=new N;for(const r of this.keys()){const i=this.getItem(this[r]);n(i,r)&&t.add(r,i)}return t}clone(){return this.filter(()=>!0)}set(n,t){const r=this.getItem(this[n]);return r&&Object.assign(r,t),this}remove(n){const t=this[n];return t!==void 0&&(delete this[n],delete this._enumItems[t]),this}forEach(n){for(const t of this.keys())n(this.getItem(this[t]),t)}}const Xe=(e,n)=>{if(!e||!n)return!1;if(n.includes(" "))throw new Error("className should not contain space.");return e.classList.contains(n)},Ze=(e,n,t)=>{var r,i,o,u,f,h,O,E;if(!e)return!1;const T=e.getBoundingClientRect();let C=0,I=0,P=window.innerHeight,a=window.innerWidth;if(n){const w=n.getBoundingClientRect();C=w.top,I=w.left,P=w.bottom,a=w.right}let d=0,l=0,s=0,g=0;return t&&(d=(i=(r=t.topGap)!=null?r:t.gap)!=null?i:0,l=(u=(o=t.leftGap)!=null?o:t.gap)!=null?u:0,s=(h=(f=t.bottomGap)!=null?f:t.gap)!=null?h:0,g=(E=(O=t.rightGap)!=null?O:t.gap)!=null?E:0),T.top>=C+d&&T.left>=I+l&&T.bottom<=P-s&&T.right<=a-g};function xe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var K={exports:{}},R={exports:{}},X;function Qe(){return X||(X=1,function(e,n){(function(t,r){e.exports=r()})(window,function(){return function(t){var r={};function i(o){if(r[o])return r[o].exports;var u=r[o]={i:o,l:!1,exports:{}};return t[o].call(u.exports,u,u.exports,i),u.l=!0,u.exports}return i.m=t,i.c=r,i.d=function(o,u,f){i.o(o,u)||Object.defineProperty(o,u,{enumerable:!0,get:f})},i.r=function(o){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,u){if(1&u&&(o=i(o)),8&u||4&u&&typeof o=="object"&&o&&o.__esModule)return o;var f=Object.create(null);if(i.r(f),Object.defineProperty(f,"default",{enumerable:!0,value:o}),2&u&&typeof o!="string")for(var h in o)i.d(f,h,function(O){return o[O]}.bind(null,h));return f},i.n=function(o){var u=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(u,"a",u),u},i.o=function(o,u){return Object.prototype.hasOwnProperty.call(o,u)},i.p="",i(i.s=0)}([function(t,r,i){i.r(r);var o=window,u=/^image\//,f=/\.\w+$/,h={},O={file:null,quality:.8,convertSize:2048e3,loose:!0,redressOrientation:!0},E=function(a){return typeof a=="function"},T=function(a){return u.test(a)};function C(a){a=Object.assign({},O,a),this.options=a,this.file=a.file,this.image=null,this.ParsedOrientationInfo=null,this.init()}var I=C.prototype;for(var P in r.default=C,I.init=function(){var a=this,d=this.file,l=this.options;d&&T(d.type)?(T(l.mimeType)||(l.mimeType=d.type),h.file2Image(d,function(s){E(a.beforeCompress)&&(a.image=s,d.width=s.naturalWidth,d.height=s.naturalHeight,a.beforeCompress(d)),d.type==="image/jpeg"&&l.redressOrientation?a.getParsedOrientationInfo(function(g){a.parsedOrientationInfo=g,a.rendCanvas()}):(a.parsedOrientationInfo={rotate:0,scaleX:1,scaleY:1},a.rendCanvas())},a.error)):a.error("\u8BF7\u4E0A\u4F20\u56FE\u7247\u6587\u4EF6!")},I.rendCanvas=function(){var a=this,d=this.options,l=this.image,s=this.getExpectedEdge(),g=s.dWidth,w=s.dHeight,v=s.width,m=s.height,b=h.image2Canvas(l,g,w,a.beforeDraw.bind(a),a.afterDraw.bind(a),v,m);h.canvas2Blob(b,function(y){y&&(y.width=b.width,y.height=b.height),a.success(y)},d.quality,d.mimeType)},I.beforeCompress=function(){E(this.options.beforeCompress)&&this.options.beforeCompress(this.file)},I.getExpectedEdge=function(){var a,d=this.image,l=this.parsedOrientationInfo.rotate,s=this.options,g=d.naturalWidth,w=d.naturalHeight,v=Math.abs(l)%180==90;v&&(a=w,w=g,g=a);var m=g/w,b=Math.max(s.maxWidth,0)||1/0,y=Math.max(s.maxHeight,0)||1/0,p=Math.max(s.minWidth,0)||0,F=Math.max(s.minHeight,0)||0,D=Math.max(s.width,0)||g,B=Math.max(s.height,0)||w;b<1/0&&y<1/0?y*m>b?y=b/m:b=y*m:b<1/0?y=b/m:y<1/0&&(b=y*m),p>0&&F>0?F*m>p?F=p/m:p=F*m:p>0?F=p/m:F>0&&(p=F*m),B*m>D?B=D/m:D=B*m;var $=D=Math.floor(Math.min(Math.max(D,p),b)),q=B=Math.floor(Math.min(Math.max(B,F),y));return v&&(a=q,q=$,$=a),{dWidth:$,dHeight:q,width:D,height:B}},I.getParsedOrientationInfo=function(a){var d=this;this.getOrientation(function(l){E(a)&&a(d.parseOrientation(l))})},I.getOrientation=function(a){var d=this;h.file2ArrayBuffer(this.file,function(l){E(a)&&a(d.resetAndGetOrientation(l))})},I.resetAndGetOrientation=function(a){var d,l=new DataView(a);try{var s,g,w;if(l.getUint8(0)===255&&l.getUint8(1)===216)for(var v=l.byteLength,m=2;m+1<v;){if(l.getUint8(m)===255&&l.getUint8(m+1)===225){g=m;break}m+=1}if(g){var b=g+4,y=g+10;if(h.getStringFromCharCode(l,b,4)==="Exif"){var p=l.getUint16(y);if(((s=p===18761)||p===19789)&&l.getUint16(y+2,s)===42){var F=l.getUint32(y+4,s);F>=8&&(w=y+F)}}}if(w){var D;for(v=l.getUint16(w,s),D=0;D<v;D+=1)if(m=w+12*D+2,l.getUint16(m,s)===274){m+=8,d=l.getUint16(m,s),l.setUint16(m,1,s);break}}}catch(B){console.error(B),d=1}return d},I.parseOrientation=function(a){var d=0,l=1,s=1;switch(a){case 2:l=-1;break;case 3:d=-180;break;case 4:s=-1;break;case 5:d=90,s=-1;break;case 6:d=90;break;case 7:d=90,l=-1;break;case 8:d=-90}return{rotate:d,scaleX:l,scaleY:s}},I.beforeDraw=function(a,d){var l=this.parsedOrientationInfo,s=l.rotate,g=l.scaleX,w=l.scaleY,v=this.file,m=this.options,b="transparent",y=d.width,p=d.height;switch(v.size>m.convertSize&&m.mimeType==="image/png"&&(b="#fff",m.mimeType="image/jpeg"),a.fillStyle=b,a.fillRect(0,0,y,p),E(m.beforeDraw)&&m.beforeDraw.call(this,a,d),a.save(),s){case 90:a.translate(y,0);break;case-90:a.translate(0,p);break;case-180:a.translate(y,p)}a.rotate(s*Math.PI/180),a.scale(g,w)},I.afterDraw=function(a,d){var l=this.options;E(l.afterDraw)&&l.afterDraw.call(this,a,d)},I.error=function(a){var d=this.options;if(!E(d.error))throw new Error(a);d.error.call(this,a)},I.success=function(a){var d,l,s=this.options,g=this.file,w=this.image,v=this.getExpectedEdge(),m=w.naturalHeight,b=w.naturalWidth;if(a&&a.size)if(!s.loose&&a.size>g.size&&!(v.width>b||v.height>m))console.warn("\u5F53\u524D\u8BBE\u7F6E\u7684\u662F\u975E\u5BBD\u677E\u6A21\u5F0F\uFF0C\u538B\u7F29\u7ED3\u679C\u5927\u4E8E\u6E90\u56FE\u7247\uFF0C\u8F93\u51FA\u6E90\u56FE\u7247"),a=g;else{var y=new Date;a.lastModified=y.getTime(),a.lastModifiedDate=y,a.name=g.name,a.name&&a.type!==g.type&&(a.name=a.name.replace(f,(d=a.type,(l=T(d)?d.substr(6):"")==="jpeg"&&(l="jpg"),"."+l)))}else console.warn("\u56FE\u7247\u538B\u7F29\u51FA\u4E86\u70B9\u610F\u5916\uFF0C\u8F93\u51FA\u6E90\u56FE\u7247"),a=g;E(s.success)&&s.success.call(this,a)},h.file2DataUrl=function(a,d,l){var s=new FileReader;s.onload=function(){d(s.result)},s.onerror=function(){E(l)&&l("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25\uFF01")},s.readAsDataURL(a)},h.file2ArrayBuffer=function(a,d,l){var s=new FileReader;s.onload=function(g){d(g.target.result)},s.onerror=function(){E(l)&&l("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25\uFF01")},s.readAsArrayBuffer(a)},h.getStringFromCharCode=function(a,d,l){var s,g="";for(l+=d,s=d;s<l;s+=1)g+=String.fromCharCode(a.getUint8(s));return g},h.file2Image=function(a,d,l){var s=new Image,g=o.URL||o.webkitURL;if(o.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(o.navigator.userAgent)&&(s.crossOrigin="anonymous"),s.alt=a.name,s.onerror=function(){E(l)&&l("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")},g){var w=g.createObjectURL(a);s.onload=function(){d(s),g.revokeObjectURL(w)},s.src=w}else this.file2DataUrl(a,function(v){s.onload=function(){d(s)},s.src=v},l)},h.url2Image=function(a,d,l){var s=new Image;s.src=a,s.onload=function(){d(s)},s.onerror=function(){E(l)&&l("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")}},h.image2Canvas=function(a,d,l,s,g,w,v){var m=document.createElement("canvas"),b=m.getContext("2d");return m.width=w||a.naturalWidth,m.height=v||a.naturalHeight,E(s)&&s(b,m),b.save(),b.drawImage(a,0,0,d,l),b.restore(),E(g)&&g(b,m),m},h.canvas2DataUrl=function(a,d,l){return a.toDataURL(l||"image/jpeg",d)},h.dataUrl2Image=function(a,d,l){var s=new Image;s.onload=function(){d(s)},s.error=function(){E(l)&&l("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")},s.src=a},h.dataUrl2Blob=function(a,d){for(var l=a.split(",")[1],s=a.match(/^data:(.*?)(;base64)?,/)[1],g=atob(l),w=l.length,v=new Uint8Array(w),m=0;m<w;m++)v[m]=g.charCodeAt(m);return new Blob([v],{type:d||s})},h.blob2DataUrl=function(a,d,l){this.file2DataUrl(a,d,l)},h.blob2Image=function(a,d,l){this.file2Image(a,d,l)},h.canvas2Blob=function(a,d,l,s){var g=this;HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(w,v,m){var b=this.toDataURL(v,m);w(g.dataUrl2Blob(b))}}),a.toBlob(function(w){d(w)},s||"image/jpeg",l||.8)},h.upload=function(a,d,l){var s=new XMLHttpRequest,g=new FormData;g.append("file",d),s.onreadystatechange=function(){if(s.readyState!==4||s.status!==200)throw new Error(s);l&&l(s.responseText)},s.open("POST",a,!0),s.send(g)},h)h.hasOwnProperty(P)&&(C[P]=h[P])}]).default})}(R)),R.exports}(function(e){e.exports=Qe()})(K);var et=xe(K.exports);const tt=e=>{if(!e.file)throw new Error("file is required");const n=e.file.size/1024;let t=e.quality;if(t===void 0){if(n<200)return e.file;n>200&&n<=512?t=.9:n>512&&n<=1024?t=.8:n>1024&&n<=2048?t=.85:n>2048&&n<=10240?t=.8:n>10240&&n<=20480&&(t=.75)}return new Promise((r,i)=>{var o;new et({...e,quality:t,convertSize:(o=e.convertSize)!=null?o:1024,success:u=>{r(u)},error:u=>{i(u)}})})},j=e=>e&&e.split("?")[0].split("/").pop()||"",nt=e=>{if(e=j(e),!e)return"";const n=e.lastIndexOf(".");return n===-1?"":e.slice(n+1).toLowerCase()},rt=e=>{if(e=j(e),!e)return["",""];const n=e.lastIndexOf(".");if(n===-1)return[e,""];const t=e.slice(0,n),r=e.slice(n+1).toLowerCase();return[t,r]},it=(e,n,t)=>Math.min(Math.max(t,e),n),_=new Map,ot=(e,n=3)=>{if(!e)throw new Error("name is required");let t;return _.has(e)?t=_.get(e):(t={maxNum:n,currentNum:0,queue:[]},_.set(e,t)),{acquire:async()=>new Promise((f,h)=>{t.currentNum>=t.maxNum?t.queue.push({resolve:f,reject:h}):(t.currentNum++,f(!0))}),release:()=>{if(t.queue.length>0){const{resolve:f}=t.queue.shift();f(!0)}else t.currentNum--},destroy:async()=>{_.delete(e)},getMaxNum:()=>t.maxNum}};c.Enum=N,c.arrayDiff=ie,c.arrayEquals=H,c.assign=de,c.buildTree=we,c.buildUrl=$e,c.clamp=it,c.combineByField=Oe,c.compressImage=tt,c.copyText=Ye,c.createLock=ot,c.createStreamIterator=We,c.createTimer=Ae,c.debounce=ze,c.decodeHTMLEntities=He,c.deepAssign=z,c.deepClone=me,c.delayWhen=Se,c.downloadFile=Ge,c.encodeHTMLEntities=qe,c.fileToBlob=Ne,c.fileToDataURL=ke,c.fileToObjectURL=Le,c.filterTree=J,c.findNode=ye,c.findNodeWithPath=be,c.findParentAndIndex=Ee,c.flatTree=Fe,c.formatBytes=Pe,c.formatDate=Te,c.formatInterval=De,c.formatNumber=Ie,c.formatPx=Be,c.formatTime=Ce,c.getFileExt=nt,c.getFilename=j,c.getNearestNumbers=se,c.getProp=pe,c.getProperty=k,c.getRandInt=_e,c.groupBy=ue,c.handleFormValidateError=Ve,c.hasClass=Xe,c.isBlob=ee,c.isChildClassOf=ne,c.isElementInViewport=Ze,c.isEmpty=A,c.isEqual=re,c.isIframe=Q,c.isImage=te,c.isObject=x,c.isPlainObject=M,c.looseEqual=U,c.mergeDefaultOptions=Y,c.omit=fe,c.omitEmpty=he,c.openPage=Je,c.parseAreaCode=Ke,c.parseFilename=rt,c.parseJson=V,c.pick=G,c.runAtLeastTime=Me,c.setProperty=ge,c.sleep=L,c.toArray=ae,c.toCamelCase=le,c.toKebabCase=W,c.toUnderscore=ce,c.urlToBlob=Re,c.urlToDataURL=Ue,c.urlToPngBlob=je,c.walkTree=ve,c.withInstall=Z,c.without=oe,Object.defineProperty(c,"__esModule",{value:!0})});
|
package/dist/utils/index.min.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! Next UI utils v1.5.
|
|
2
|
-
`);i=l.pop()||"";for(let h of l)if(h=h.trim(),!!h)if(r)yield h;else{if(h==="event: ping")continue;const F=h.match(/^(?:(\w*):)?(.*)$/);if(!F){console.error("[BufferedReader] parse line failed:",h);continue}const b=F[1],O=W(F[2].trim());if(!O){console.error("[BufferedReader] parse json failed:",F[2].trim());continue}yield{event:b,data:O}}}}const He=e=>{let{url:n,filename:t}=e;if(t=t||"\u672A\u547D\u540D",n||e.blob&&(n=URL.createObjectURL(e.blob),setTimeout(()=>{URL.revokeObjectURL(n)},1e4)),!n)throw new Error("No URL provided");const r=document.createElement("a");r.href=n,r.target="_blank",r.download=t,r.click()};function We(e,n,t){let r,i,o,u,l,h,F=0,b=!1,O=!1,S=!0;if(typeof e!="function")throw new TypeError("Expected a function");n=+n||0,t&&M(t)&&(b=!!t.leading,O="maxWait"in t,o=O?Math.max(+t.maxWait||0,n):o,S="trailing"in t?!!t.trailing:S);function x(m){const E=r,I=i;return r=i=void 0,F=m,u=e.apply(I,E),u}function T(m,E){return setTimeout(m,E)}function s(m){clearTimeout(m)}function f(m){return F=m,l=T(g,n),b?x(m):u}function c(m){const E=m-h,I=m-F,D=n-E;return O?Math.min(D,o-I):D}function a(m){const E=m-h,I=m-F;return h===void 0||E>=n||E<0||O&&I>=o}function g(){const m=Date.now();if(a(m))return p(m);l=T(g,c(m))}function p(m){return l=void 0,S&&r?x(m):(r=i=void 0,u)}function v(){l!==void 0&&s(l),F=0,r=h=i=l=void 0}function d(){return l===void 0?u:p(Date.now())}function y(){return l!==void 0}function w(...m){const E=Date.now(),I=a(E);if(r=m,i=this,h=E,I){if(l===void 0)return f(h);if(O)return l=T(g,n),x(h)}return l===void 0&&(l=T(g,n)),u}return w.cancel=v,w.flush=d,w.pending=y,w}function Ge(e){const{el:n,msg:t}=e||{},r=t===void 0?"\u8BF7\u5B8C\u5584\u8868\u5355\u5185\u5BB9":t;if(r&&k.error(r),!n)return;const i=n.querySelector(".is-error");i&&i.scrollIntoView({behavior:"smooth",inline:"nearest",block:"center"})}async function ze(e,n={successText:"\u590D\u5236\u6210\u529F"}){const{successText:t}=n||{};try{if(navigator.clipboard){await navigator.clipboard.writeText(e),t&&k.success(t);return}}catch(i){}const r=document.createElement("textarea");document.body.appendChild(r),r.style.position="fixed",r.style.clip="rect(0 0 0 0)",r.style.top="10px",r.value=e,r.select(),document.execCommand("copy",!0),document.body.removeChild(r),t&&k.success(t)}function Ve(e,...n){if(!e)return;const t=document.createElement("a");t.addEventListener("click",r=>{r.preventDefault(),window.open(e,...n)}),t.click()}function Ye(e){if(!e)return[];const n=[`${e.slice(0,2)}0000`,`${e.slice(0,4)}00`,e.slice(0,6),e.slice(0,9),e.slice(0,12)],t=0,r=n.indexOf(e)+1;return n.slice(t,r)}class R{constructor(n){this._enumItems={};var t;if(n)if(Array.isArray(n))for(const[r,i]of n.entries())this.add((t=i.key)!=null?t:`${r}`,i);else for(const r in n){const i=n[r];this.add(r,i)}}add(n,t){if(this[n])throw new Error(`\u679A\u4E3E\u9879 ${n} \u5DF2\u5B58\u5728`);const r=t.value;return this[n]=r,this._enumItems[r]={...t},this}keys(){return Object.keys(this).filter(n=>n!=="_enumItems")}*[Symbol.iterator](){for(const n of this.keys())yield this.getItem(this[n])}getItem(n){return this._enumItems[n]}getLabel(n){var t;return(t=this.getItem(n))==null?void 0:t.label}getProps(n){var t;return(t=this.getItem(n))==null?void 0:t.props}filter(n){const t=new R;for(const r of this.keys()){const i=this.getItem(this[r]);n(i,r)&&t.add(r,i)}return t}clone(){return this.filter(()=>!0)}set(n,t){const r=this.getItem(this[n]);return r&&Object.assign(r,t),this}remove(n){const t=this[n];return t!==void 0&&(delete this[n],delete this._enumItems[t]),this}forEach(n){for(const t of this.keys())n(this.getItem(this[t]),t)}}const Je=(e,n)=>{if(!e||!n)return!1;if(n.includes(" "))throw new Error("className should not contain space.");return e.classList.contains(n)},Xe=(e,n,t)=>{var r,i,o,u,l,h,F,b;if(!e)return!1;const O=e.getBoundingClientRect();let S=0,x=0,T=window.innerHeight,s=window.innerWidth;if(n){const p=n.getBoundingClientRect();S=p.top,x=p.left,T=p.bottom,s=p.right}let f=0,c=0,a=0,g=0;return t&&(f=(i=(r=t.topGap)!=null?r:t.gap)!=null?i:0,c=(u=(o=t.leftGap)!=null?o:t.gap)!=null?u:0,a=(h=(l=t.bottomGap)!=null?l:t.gap)!=null?h:0,g=(b=(F=t.rightGap)!=null?F:t.gap)!=null?b:0),O.top>=S+f&&O.left>=x+c&&O.bottom<=T-a&&O.right<=s-g};function Ke(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var V={exports:{}},N={exports:{}},Y;function Ze(){return Y||(Y=1,function(e,n){(function(t,r){e.exports=r()})(window,function(){return function(t){var r={};function i(o){if(r[o])return r[o].exports;var u=r[o]={i:o,l:!1,exports:{}};return t[o].call(u.exports,u,u.exports,i),u.l=!0,u.exports}return i.m=t,i.c=r,i.d=function(o,u,l){i.o(o,u)||Object.defineProperty(o,u,{enumerable:!0,get:l})},i.r=function(o){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,u){if(1&u&&(o=i(o)),8&u||4&u&&typeof o=="object"&&o&&o.__esModule)return o;var l=Object.create(null);if(i.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:o}),2&u&&typeof o!="string")for(var h in o)i.d(l,h,function(F){return o[F]}.bind(null,h));return l},i.n=function(o){var u=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(u,"a",u),u},i.o=function(o,u){return Object.prototype.hasOwnProperty.call(o,u)},i.p="",i(i.s=0)}([function(t,r,i){i.r(r);var o=window,u=/^image\//,l=/\.\w+$/,h={},F={file:null,quality:.8,convertSize:2048e3,loose:!0,redressOrientation:!0},b=function(s){return typeof s=="function"},O=function(s){return u.test(s)};function S(s){s=Object.assign({},F,s),this.options=s,this.file=s.file,this.image=null,this.ParsedOrientationInfo=null,this.init()}var x=S.prototype;for(var T in r.default=S,x.init=function(){var s=this,f=this.file,c=this.options;f&&O(f.type)?(O(c.mimeType)||(c.mimeType=f.type),h.file2Image(f,function(a){b(s.beforeCompress)&&(s.image=a,f.width=a.naturalWidth,f.height=a.naturalHeight,s.beforeCompress(f)),f.type==="image/jpeg"&&c.redressOrientation?s.getParsedOrientationInfo(function(g){s.parsedOrientationInfo=g,s.rendCanvas()}):(s.parsedOrientationInfo={rotate:0,scaleX:1,scaleY:1},s.rendCanvas())},s.error)):s.error("\u8BF7\u4E0A\u4F20\u56FE\u7247\u6587\u4EF6!")},x.rendCanvas=function(){var s=this,f=this.options,c=this.image,a=this.getExpectedEdge(),g=a.dWidth,p=a.dHeight,v=a.width,d=a.height,y=h.image2Canvas(c,g,p,s.beforeDraw.bind(s),s.afterDraw.bind(s),v,d);h.canvas2Blob(y,function(w){w&&(w.width=y.width,w.height=y.height),s.success(w)},f.quality,f.mimeType)},x.beforeCompress=function(){b(this.options.beforeCompress)&&this.options.beforeCompress(this.file)},x.getExpectedEdge=function(){var s,f=this.image,c=this.parsedOrientationInfo.rotate,a=this.options,g=f.naturalWidth,p=f.naturalHeight,v=Math.abs(c)%180==90;v&&(s=p,p=g,g=s);var d=g/p,y=Math.max(a.maxWidth,0)||1/0,w=Math.max(a.maxHeight,0)||1/0,m=Math.max(a.minWidth,0)||0,E=Math.max(a.minHeight,0)||0,I=Math.max(a.width,0)||g,D=Math.max(a.height,0)||p;y<1/0&&w<1/0?w*d>y?w=y/d:y=w*d:y<1/0?w=y/d:w<1/0&&(y=w*d),m>0&&E>0?E*d>m?E=m/d:m=E*d:m>0?E=m/d:E>0&&(m=E*d),D*d>I?D=I/d:I=D*d;var B=I=Math.floor(Math.min(Math.max(I,m),y)),A=D=Math.floor(Math.min(Math.max(D,E),w));return v&&(s=A,A=B,B=s),{dWidth:B,dHeight:A,width:I,height:D}},x.getParsedOrientationInfo=function(s){var f=this;this.getOrientation(function(c){b(s)&&s(f.parseOrientation(c))})},x.getOrientation=function(s){var f=this;h.file2ArrayBuffer(this.file,function(c){b(s)&&s(f.resetAndGetOrientation(c))})},x.resetAndGetOrientation=function(s){var f,c=new DataView(s);try{var a,g,p;if(c.getUint8(0)===255&&c.getUint8(1)===216)for(var v=c.byteLength,d=2;d+1<v;){if(c.getUint8(d)===255&&c.getUint8(d+1)===225){g=d;break}d+=1}if(g){var y=g+4,w=g+10;if(h.getStringFromCharCode(c,y,4)==="Exif"){var m=c.getUint16(w);if(((a=m===18761)||m===19789)&&c.getUint16(w+2,a)===42){var E=c.getUint32(w+4,a);E>=8&&(p=w+E)}}}if(p){var I;for(v=c.getUint16(p,a),I=0;I<v;I+=1)if(d=p+12*I+2,c.getUint16(d,a)===274){d+=8,f=c.getUint16(d,a),c.setUint16(d,1,a);break}}}catch(D){console.error(D),f=1}return f},x.parseOrientation=function(s){var f=0,c=1,a=1;switch(s){case 2:c=-1;break;case 3:f=-180;break;case 4:a=-1;break;case 5:f=90,a=-1;break;case 6:f=90;break;case 7:f=90,c=-1;break;case 8:f=-90}return{rotate:f,scaleX:c,scaleY:a}},x.beforeDraw=function(s,f){var c=this.parsedOrientationInfo,a=c.rotate,g=c.scaleX,p=c.scaleY,v=this.file,d=this.options,y="transparent",w=f.width,m=f.height;switch(v.size>d.convertSize&&d.mimeType==="image/png"&&(y="#fff",d.mimeType="image/jpeg"),s.fillStyle=y,s.fillRect(0,0,w,m),b(d.beforeDraw)&&d.beforeDraw.call(this,s,f),s.save(),a){case 90:s.translate(w,0);break;case-90:s.translate(0,m);break;case-180:s.translate(w,m)}s.rotate(a*Math.PI/180),s.scale(g,p)},x.afterDraw=function(s,f){var c=this.options;b(c.afterDraw)&&c.afterDraw.call(this,s,f)},x.error=function(s){var f=this.options;if(!b(f.error))throw new Error(s);f.error.call(this,s)},x.success=function(s){var f,c,a=this.options,g=this.file,p=this.image,v=this.getExpectedEdge(),d=p.naturalHeight,y=p.naturalWidth;if(s&&s.size)if(!a.loose&&s.size>g.size&&!(v.width>y||v.height>d))console.warn("\u5F53\u524D\u8BBE\u7F6E\u7684\u662F\u975E\u5BBD\u677E\u6A21\u5F0F\uFF0C\u538B\u7F29\u7ED3\u679C\u5927\u4E8E\u6E90\u56FE\u7247\uFF0C\u8F93\u51FA\u6E90\u56FE\u7247"),s=g;else{var w=new Date;s.lastModified=w.getTime(),s.lastModifiedDate=w,s.name=g.name,s.name&&s.type!==g.type&&(s.name=s.name.replace(l,(f=s.type,(c=O(f)?f.substr(6):"")==="jpeg"&&(c="jpg"),"."+c)))}else console.warn("\u56FE\u7247\u538B\u7F29\u51FA\u4E86\u70B9\u610F\u5916\uFF0C\u8F93\u51FA\u6E90\u56FE\u7247"),s=g;b(a.success)&&a.success.call(this,s)},h.file2DataUrl=function(s,f,c){var a=new FileReader;a.onload=function(){f(a.result)},a.onerror=function(){b(c)&&c("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25\uFF01")},a.readAsDataURL(s)},h.file2ArrayBuffer=function(s,f,c){var a=new FileReader;a.onload=function(g){f(g.target.result)},a.onerror=function(){b(c)&&c("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25\uFF01")},a.readAsArrayBuffer(s)},h.getStringFromCharCode=function(s,f,c){var a,g="";for(c+=f,a=f;a<c;a+=1)g+=String.fromCharCode(s.getUint8(a));return g},h.file2Image=function(s,f,c){var a=new Image,g=o.URL||o.webkitURL;if(o.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(o.navigator.userAgent)&&(a.crossOrigin="anonymous"),a.alt=s.name,a.onerror=function(){b(c)&&c("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")},g){var p=g.createObjectURL(s);a.onload=function(){f(a),g.revokeObjectURL(p)},a.src=p}else this.file2DataUrl(s,function(v){a.onload=function(){f(a)},a.src=v},c)},h.url2Image=function(s,f,c){var a=new Image;a.src=s,a.onload=function(){f(a)},a.onerror=function(){b(c)&&c("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")}},h.image2Canvas=function(s,f,c,a,g,p,v){var d=document.createElement("canvas"),y=d.getContext("2d");return d.width=p||s.naturalWidth,d.height=v||s.naturalHeight,b(a)&&a(y,d),y.save(),y.drawImage(s,0,0,f,c),y.restore(),b(g)&&g(y,d),d},h.canvas2DataUrl=function(s,f,c){return s.toDataURL(c||"image/jpeg",f)},h.dataUrl2Image=function(s,f,c){var a=new Image;a.onload=function(){f(a)},a.error=function(){b(c)&&c("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")},a.src=s},h.dataUrl2Blob=function(s,f){for(var c=s.split(",")[1],a=s.match(/^data:(.*?)(;base64)?,/)[1],g=atob(c),p=c.length,v=new Uint8Array(p),d=0;d<p;d++)v[d]=g.charCodeAt(d);return new Blob([v],{type:f||a})},h.blob2DataUrl=function(s,f,c){this.file2DataUrl(s,f,c)},h.blob2Image=function(s,f,c){this.file2Image(s,f,c)},h.canvas2Blob=function(s,f,c,a){var g=this;HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(p,v,d){var y=this.toDataURL(v,d);p(g.dataUrl2Blob(y))}}),s.toBlob(function(p){f(p)},a||"image/jpeg",c||.8)},h.upload=function(s,f,c){var a=new XMLHttpRequest,g=new FormData;g.append("file",f),a.onreadystatechange=function(){if(a.readyState!==4||a.status!==200)throw new Error(a);c&&c(a.responseText)},a.open("POST",s,!0),a.send(g)},h)h.hasOwnProperty(T)&&(S[T]=h[T])}]).default})}(N)),N.exports}(function(e){e.exports=Ze()})(V);var Qe=Ke(V.exports);const et=e=>{if(!e.file)throw new Error("file is required");const n=e.file.size/1024;let t=e.quality;if(t===void 0){if(n<200)return e.file;n>200&&n<=512?t=.9:n>512&&n<=1024?t=.8:n>1024&&n<=2048?t=.85:n>2048&&n<=10240?t=.8:n>10240&&n<=20480&&(t=.75)}return new Promise((r,i)=>{var o;new Qe({...e,quality:t,convertSize:(o=e.convertSize)!=null?o:1024,success:u=>{r(u)},error:u=>{i(u)}})})},J=e=>e&&e.split("?")[0].split("/").pop()||"",tt=e=>{if(e=J(e),!e)return"";const n=e.lastIndexOf(".");return n===-1?"":e.slice(n+1).toLowerCase()},nt=(e,n,t)=>Math.min(Math.max(t,e),n),_=new Map,rt=(e,n=3)=>{if(!e)throw new Error("name is required");let t;return _.has(e)?t=_.get(e):(t={maxNum:n,currentNum:0,queue:[]},_.set(e,t)),{acquire:async()=>new Promise((l,h)=>{t.currentNum>=t.maxNum?t.queue.push({resolve:l,reject:h}):(t.currentNum++,l(!0))}),release:()=>{if(t.queue.length>0){const{resolve:l}=t.queue.shift();l(!0)}else t.currentNum--},destroy:async()=>{_.delete(e)},getMaxNum:()=>t.maxNum}};export{R as Enum,re as arrayDiff,j as arrayEquals,fe as assign,pe as buildTree,Re as buildUrl,nt as clamp,Fe as combineByField,et as compressImage,ze as copyText,rt as createLock,qe as createStreamIterator,Pe as createTimer,We as debounce,$e as decodeHTMLEntities,H as deepAssign,de as deepClone,_e as delayWhen,He as downloadFile,je as encodeHTMLEntities,Ue as fileToBlob,ke as fileToDataURL,Ce as fileToObjectURL,z as filterTree,we as findNode,ye as findNodeWithPath,be as findParentAndIndex,Ee as flatTree,Te as formatBytes,Oe as formatDate,Ie as formatInterval,xe as formatNumber,De as formatPx,Se as formatTime,tt as getFileExt,J as getFilename,ue as getNearestNumbers,me as getProp,U as getProperty,Be as getRandInt,se as groupBy,Ge as handleFormValidateError,Je as hasClass,Q as isBlob,te as isChildClassOf,Xe as isElementInViewport,P as isEmpty,ne as isEqual,Z as isIframe,ee as isImage,K as isObject,M as isPlainObject,C as looseEqual,G as mergeDefaultOptions,le as omit,he as omitEmpty,Ve as openPage,Ye as parseAreaCode,W as parseJson,q as pick,Me as runAtLeastTime,ge as setProperty,L as sleep,oe as toArray,ce as toCamelCase,$ as toKebabCase,ae as toUnderscore,Le as urlToBlob,Ae as urlToDataURL,Ne as urlToPngBlob,ve as walkTree,X as withInstall,ie as without};
|
|
1
|
+
/*! Next UI utils v1.5.13 */import{ElMessage as C}from"element-plus";const X=(e,n)=>{try{if(e.install=t=>{for(const r of[e,...Object.values(n!=null?n:{})])r.name&&t.component(r.name,r)},n)for(const[t,r]of Object.entries(n))e[t]=r;return e}catch(t){}};function K(e){const n=typeof e;return e!=null&&(n==="object"||n==="function")}function M(e){return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"}function P(e){if(typeof e=="boolean"||typeof e=="number")return!1;if(Array.isArray(e)){if(e.length===0)return!0}else if(e instanceof Object&&JSON.stringify(e)==="{}")return!0;return e==null||e==="null"||e==="undefined"||e===""}function Z(){return window.top!==window}function Q(e){return toString.call(e)==="[object Blob]"}function ee(e){if(e.startsWith("data:image"))return!0;const n=e.lastIndexOf("."),t=n>=0?e.slice(n+1).toLowerCase():"";return["png","jpg","jpeg","gif","bmp","webp","svg"].includes(t)}function te(e,n){for(;e;){if(e===n)return!0;e=Object.getPrototypeOf(e)}return!1}const k=(e,n)=>{const t=M(e),r=M(n);return t&&r?JSON.stringify(e)===JSON.stringify(n):!t&&!r?String(e)===String(n):!1},$=(e,n)=>{if(e=e||[],n=n||[],e.length!==n.length)return!1;for(const[t,r]of e.entries())if(!k(r,n[t]))return!1;return!0},ne=(e,n)=>Array.isArray(e)&&Array.isArray(n)?$(e,n):k(e,n);function re(e,n,t){const r={};let i;typeof t=="function"?i=t:t?i=l=>l[t]:i=l=>l,(e||[]).forEach(l=>{const h=i(l);r[h]={item:l,count:-1}}),(n||[]).forEach(l=>{const h=i(l);r[h]?r[h].count=0:r[h]={item:l,count:1}});const o=[],u=[];for(const l in r)Object.prototype.hasOwnProperty.call(r,l)&&(r[l].count===1?u.push(r[l].item):r[l].count===-1&&o.push(r[l].item));return{changed:o.length+u.length>0,removed:o.length>0,added:u.length>0,removedItems:o,addedItems:u}}const ie=(e,...n)=>{const t=[];return e.forEach(r=>{n.includes(r)||t.push(r)}),t},oe=e=>P(e)?[]:Array.isArray(e)?e:[e],se=(e,n)=>{if(typeof n!="function"){const t=n;n=r=>String(r[t])}return(e||[]).reduce((t,r)=>{const i=n(r);return t[i]||(t[i]=[]),t[i].push(r),t},{})},ue=(e,n,t,r)=>{r=r||(()=>!0);const[i,o]=n,u=[];if(t<=0||e>=i&&e<=o&&r(e)&&(u.push(e),u.length>=t))return u;let l=1;for(;u.length<t;){const h=e-l,F=e+l,b=h>=i,O=F<=o;if(!b&&!O||b&&r(h)&&(u.push(h),u.length>=t)||O&&r(F)&&(u.push(F),u.length>=t))break;l++}return u};function ae(e){return e.replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase()}function q(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").toLowerCase()}function ce(e){return e.replace(/-([a-z])/g,(n,t)=>t.toUpperCase()).replace(/_([a-z])/g,(n,t)=>t.toUpperCase())}const H=(e,n,...t)=>{const r={};return n=(n?[].concat(n):[]).concat(t),e&&n.forEach(i=>{Object.hasOwnProperty.call(e,i)&&(r[i]=e[i])}),r},le=(e,n,...t)=>{const r={};return n=(n?[].concat(n):[]).concat(t),e&&Object.keys(e).forEach(i=>{n.includes(i)||(r[i]=e[i])}),r},fe=(e,...n)=>{for(const t of n)Object.assign(e,H(t,Object.keys(e)));return e};function W(e,...n){M(e)||(e={});for(const t of n)if(M(t))for(const r in t)r==="__proto__"||e===t[r]||(M(t[r])?e[r]=W(e[r],t[r]):e[r]=t[r]);return e}const he=e=>{const n={};if(e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(P(e[t])||(n[t]=e[t]));return n};function de(e){const n=new WeakMap,t=r=>{if(typeof r=="object"&&r!==null){if(n.has(r))return n.get(r);const i=Array.isArray(r)?[]:{};n.set(r,i);for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=t(r[o]));return i}return r};return t(e)}function G(e,n){try{return JSON.parse(e)}catch(t){return console.error("parse json error:",e),n}}function ge(e,n,t){if(!e||!n)return;const r=n.split(".");let i;for(;(i=r.shift())!==void 0&&r.length!==0;)e[i]||(e[i]={}),e=e[i];i&&(e[i]=t)}function U(e,n){if(!e||!n)return;const t=n.split(".");for(const r of t){if(!e)return;e=e[r]}return e}const z=(e,n)=>{for(const t in e)Object.getOwnPropertyDescriptor(n,t)?M(e[t])&&z(e[t],n[t]):n[t]=e[t];return n},me=(e,n)=>{var t;return(t=e[n])!=null?t:e[q(n)]};function pe(e,n){let{key:t,parentKey:r}=n||{};t=t||"id",r=r||"pid";const i=(e||[]).reduce((u,l)=>(u[U(l,t)]=l,u),{}),o=[];return(e||[]).forEach(u=>{const l=i[U(u,r)];l?(l.children||(l.children=[])).push(u):o.push(u)}),o}function V(e,n,t=null,r=1){const i=[];return(e||[]).forEach(o=>{let{children:u,...l}=o;u&&u.length>0&&(u=V(u,n,l,r+1),u.length>0&&(l.children=u)),n(l,t,r)&&i.push(l)}),i}function we(e,n){const t=e?[...e]:[];for(;t.length>0;){const r=t.shift();if(n(r))return r;r.children&&r.children.length>0&&t.push(...r.children)}return null}function ye(e,n){const t=(r,i)=>{for(const o of r){if(n(o))return[...i,o];if(o.children&&o.children.length>0){const u=t(o.children,[...i,o]);if(u)return u}}return null};return t(e||[],[])}function be(e,n){const t={children:e||[]},r=[t];let i,o=-1;for(;r.length>0;){i=r.shift();const{children:u}=i;if(u&&u.length>0){for(const[l,h]of u.entries())if(n(h)){o=l;break}if(o!==-1)break;r.push(...u)}}return{found:o!==-1,parent:i===t?null:i,index:o}}function ve(e,n){const t=(e||[]).map(r=>({node:r,parent:null}));for(;t.length>0;){const r=t.shift(),{node:i,parent:o}=r;if(n(i,o)===!1)break;i.children&&i.children.length>0&&t.push(...i.children.map(l=>({node:l,parent:i})))}}function Ee(e){const n=[];if(e&&e.length>0){n.push(...e);let t=0;for(;t<n.length;){const{children:r}=n[t];r&&r.length>0&&n.push(...r),t++}}return n}function Fe(e,n,t){t||(t=n);const r=i=>(i||[]).reduce((o,u)=>(u[t]=u[n]+(u.children?r(u.children):0),o+u[t]),0);r(e)}function Oe(e,n){if(!e)return"";const t=new Date(e);if(t.getTime()===0)return"";n=n||"yyyy-MM-dd";let r;const i={"Y+":t.getFullYear().toString(),"y+":t.getFullYear().toString(),"M+":(t.getMonth()+1).toString(),"D+":t.getDate().toString(),"d+":t.getDate().toString(),"h+":(t.getHours()%12||12).toString(),"H+":t.getHours().toString(),"m+":t.getMinutes().toString(),"s+":t.getSeconds().toString(),a:t.getHours()<12?"am":"pm",A:t.getHours()<12?"AM":"PM"};for(const o in i)r=new RegExp(`(${o})`).exec(n),r&&(n=n.replace(r[1],r[1].length===1?i[o]:i[o].padStart(r[1].length,"0")));return n}function xe(e,n){if(P(e))return"";let{minPrecision:t,maxPrecision:r,decimalPoint:i,thousandSeparator:o,grouping:u}=n||{};t=t!=null?t:0,r=r!=null?r:2,i=i||".",o=o!=null?o:",",u=u!=null?u:3;let[l,h]=`${e}`.split(".");return l=l.replace(new RegExp(`(?<!^-?)(?=(\\d{${u}})+$)`,"g"),o),h=(h||"").slice(0,r).padEnd(t,"0"),h&&(h=i+h),l+h}function Ie(e,n){if(n){const i=P(e[0])||e[0]===Number.NEGATIVE_INFINITY?"-\u221E":e[0],o=P(e[1])||e[1]===+Number.POSITIVE_INFINITY?"+\u221E":e[1];return`${i+(i==="-\u221E"?" < ":" \u2264 ")+n} < ${o}`}const t=P(e[0])||e[0]==="-\u221E"||e[0]==="-Infinity"?"-\u221E":e[0],r=P(e[1])||e[1]==="+\u221E"||e[1]==="Infinity"?"+\u221E":e[1];return`${t==="-\u221E"?"(":"["} ${t}, ${r} )`}function Te(e){if(e=Number(e),Number.isNaN(e))return"";const n=["B","KB","MB","GB","TB","PB"];let t=0;for(;e>=1024&&t<n.length-1;)e/=1024,t++;return e=Math.round(e*100)/100,`${e} ${n[t]}`}function De(e){return Number.isNaN(Number(e))?e||"":`${Number(e)}px`}function Se(e){if(e=Number(e),!Number.isFinite(e)||Number.isNaN(e))return"00:00";const n=Math.floor(e),t=n%60,r=String(t).padStart(2,"0");if(n<3600){const l=Math.floor(n/60);return`${String(l).padStart(2,"0")}:${r}`}const i=Math.floor(n/3600),o=Math.floor(n%3600/60),u=String(o).padStart(2,"0");return`${i}:${u}:${r}`}const L=e=>new Promise(n=>{setTimeout(n,e)}),Me=(e,n)=>new Promise((t,r)=>{(async()=>{try{const o=Date.now(),u=await e(),l=Date.now()-o;l<n&&await L(n-l),t(u)}catch(o){r(o)}})()}),Pe=()=>{const e=Date.now();return{delayTo:async t=>{const r=Date.now()-e;r<t&&await L(t-r)}}},_e=(e,n,t)=>{let r,i=!1,o;const u=()=>{if(i||e()){r(void 0),clearTimeout(o);return}requestAnimationFrame(u)};return t&&(o=setTimeout(()=>{i=!0},t)),new Promise(l=>{r=l,n?setTimeout(u,n):requestAnimationFrame(u)})},Be=(e,n)=>Math.floor(e+Math.random()*(n-e));function Ae(e){return new Promise((n,t)=>{const r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=()=>{if(r.status===200){const i=new FileReader;i.readAsDataURL(r.response),i.onload=o=>{n(o.target.result)},i.onerror=o=>t(o)}else t(new Error("Failed to load file"))},r.onerror=()=>{t(new Error("Failed to load file"))},r.send()})}function Ce(e){return new Promise((n,t)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=i=>{n(i.target.result)},r.onerror=i=>t(i)})}function ke(e){return URL.createObjectURL(e)}function Ue(e){return new Promise((n,t)=>{const r=new FileReader;r.readAsArrayBuffer(e),r.onload=i=>{n(new Blob([i.target.result]))},r.onerror=i=>t(i)})}async function Le(e){if(!e)throw new Error("url is empty");return(await fetch(e)).blob()}async function Ne(e){if(!e)throw new Error("url is empty");return new Promise((n,t)=>{const r=new Image;r.onload=()=>{const i=document.createElement("canvas");i.width=r.width,i.height=r.height;const o=i.getContext("2d");o==null||o.drawImage(r,0,0,r.width,r.height),i.toBlob(u=>{u?n(u):t(new Error("transform image to blob failed"))},"image/png")},r.onerror=t,r.src=e})}function Re(e,n){if(!e)return"";if(typeof e=="string"&&(e=new URL(e)),n)for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&e.searchParams.append(t,n[t]);return e.toString()}function je(e){return e.replace(/[<>&"]/g,n=>`&#${n.charCodeAt(0)};`)}function $e(e){const n=document.createElement("div");return n.innerHTML=e,n.textContent||n.innerText}async function*qe(e,n){const t=new TextDecoder("utf-8"),{original:r}=n||{};let i="";for(;;){const{value:o,done:u}=await e.read();if(u)return;i+=t.decode(o);const l=i.split(`
|
|
2
|
+
`);i=l.pop()||"";for(let h of l)if(h=h.trim(),!!h)if(r)yield h;else{if(h==="event: ping")continue;const F=h.match(/^(?:(\w*):)?(.*)$/);if(!F){console.error("[BufferedReader] parse line failed:",h);continue}const b=F[1],O=G(F[2].trim());if(!O){console.error("[BufferedReader] parse json failed:",F[2].trim());continue}yield{event:b,data:O}}}}const He=e=>{let{url:n,filename:t}=e;if(t=t||"\u672A\u547D\u540D",n||e.blob&&(n=URL.createObjectURL(e.blob),setTimeout(()=>{URL.revokeObjectURL(n)},1e4)),!n)throw new Error("No URL provided");const r=document.createElement("a");r.href=n,r.target="_blank",r.download=t,r.click()};function We(e,n,t){let r,i,o,u,l,h,F=0,b=!1,O=!1,S=!0;if(typeof e!="function")throw new TypeError("Expected a function");n=+n||0,t&&M(t)&&(b=!!t.leading,O="maxWait"in t,o=O?Math.max(+t.maxWait||0,n):o,S="trailing"in t?!!t.trailing:S);function x(m){const E=r,I=i;return r=i=void 0,F=m,u=e.apply(I,E),u}function T(m,E){return setTimeout(m,E)}function s(m){clearTimeout(m)}function f(m){return F=m,l=T(g,n),b?x(m):u}function c(m){const E=m-h,I=m-F,D=n-E;return O?Math.min(D,o-I):D}function a(m){const E=m-h,I=m-F;return h===void 0||E>=n||E<0||O&&I>=o}function g(){const m=Date.now();if(a(m))return p(m);l=T(g,c(m))}function p(m){return l=void 0,S&&r?x(m):(r=i=void 0,u)}function v(){l!==void 0&&s(l),F=0,r=h=i=l=void 0}function d(){return l===void 0?u:p(Date.now())}function y(){return l!==void 0}function w(...m){const E=Date.now(),I=a(E);if(r=m,i=this,h=E,I){if(l===void 0)return f(h);if(O)return l=T(g,n),x(h)}return l===void 0&&(l=T(g,n)),u}return w.cancel=v,w.flush=d,w.pending=y,w}function Ge(e){const{el:n,msg:t}=e||{},r=t===void 0?"\u8BF7\u5B8C\u5584\u8868\u5355\u5185\u5BB9":t;if(r&&C.error(r),!n)return;const i=n.querySelector(".is-error");i&&i.scrollIntoView({behavior:"smooth",inline:"nearest",block:"center"})}async function ze(e,n={successText:"\u590D\u5236\u6210\u529F"}){const{successText:t}=n||{};try{if(navigator.clipboard){await navigator.clipboard.writeText(e),t&&C.success(t);return}}catch(i){}const r=document.createElement("textarea");document.body.appendChild(r),r.style.position="fixed",r.style.clip="rect(0 0 0 0)",r.style.top="10px",r.value=e,r.select(),document.execCommand("copy",!0),document.body.removeChild(r),t&&C.success(t)}function Ve(e,...n){if(!e)return;const t=document.createElement("a");t.addEventListener("click",r=>{r.preventDefault(),window.open(e,...n)}),t.click()}function Ye(e){if(!e)return[];const n=[`${e.slice(0,2)}0000`,`${e.slice(0,4)}00`,e.slice(0,6),e.slice(0,9),e.slice(0,12)],t=0,r=n.indexOf(e)+1;return n.slice(t,r)}class j{constructor(n){this._enumItems={};var t;if(n)if(Array.isArray(n))for(const[r,i]of n.entries())this.add((t=i.key)!=null?t:`${r}`,i);else for(const r in n){const i=n[r];this.add(r,i)}}add(n,t){if(this[n])throw new Error(`\u679A\u4E3E\u9879 ${n} \u5DF2\u5B58\u5728`);const r=t.value;return this[n]=r,this._enumItems[r]={...t},this}keys(){return Object.keys(this).filter(n=>n!=="_enumItems")}*[Symbol.iterator](){for(const n of this.keys())yield this.getItem(this[n])}getItem(n){return this._enumItems[n]}getLabel(n){var t;return(t=this.getItem(n))==null?void 0:t.label}getProps(n){var t;return(t=this.getItem(n))==null?void 0:t.props}filter(n){const t=new j;for(const r of this.keys()){const i=this.getItem(this[r]);n(i,r)&&t.add(r,i)}return t}clone(){return this.filter(()=>!0)}set(n,t){const r=this.getItem(this[n]);return r&&Object.assign(r,t),this}remove(n){const t=this[n];return t!==void 0&&(delete this[n],delete this._enumItems[t]),this}forEach(n){for(const t of this.keys())n(this.getItem(this[t]),t)}}const Je=(e,n)=>{if(!e||!n)return!1;if(n.includes(" "))throw new Error("className should not contain space.");return e.classList.contains(n)},Xe=(e,n,t)=>{var r,i,o,u,l,h,F,b;if(!e)return!1;const O=e.getBoundingClientRect();let S=0,x=0,T=window.innerHeight,s=window.innerWidth;if(n){const p=n.getBoundingClientRect();S=p.top,x=p.left,T=p.bottom,s=p.right}let f=0,c=0,a=0,g=0;return t&&(f=(i=(r=t.topGap)!=null?r:t.gap)!=null?i:0,c=(u=(o=t.leftGap)!=null?o:t.gap)!=null?u:0,a=(h=(l=t.bottomGap)!=null?l:t.gap)!=null?h:0,g=(b=(F=t.rightGap)!=null?F:t.gap)!=null?b:0),O.top>=S+f&&O.left>=x+c&&O.bottom<=T-a&&O.right<=s-g};function Ke(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Y={exports:{}},N={exports:{}},J;function Ze(){return J||(J=1,function(e,n){(function(t,r){e.exports=r()})(window,function(){return function(t){var r={};function i(o){if(r[o])return r[o].exports;var u=r[o]={i:o,l:!1,exports:{}};return t[o].call(u.exports,u,u.exports,i),u.l=!0,u.exports}return i.m=t,i.c=r,i.d=function(o,u,l){i.o(o,u)||Object.defineProperty(o,u,{enumerable:!0,get:l})},i.r=function(o){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,u){if(1&u&&(o=i(o)),8&u||4&u&&typeof o=="object"&&o&&o.__esModule)return o;var l=Object.create(null);if(i.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:o}),2&u&&typeof o!="string")for(var h in o)i.d(l,h,function(F){return o[F]}.bind(null,h));return l},i.n=function(o){var u=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(u,"a",u),u},i.o=function(o,u){return Object.prototype.hasOwnProperty.call(o,u)},i.p="",i(i.s=0)}([function(t,r,i){i.r(r);var o=window,u=/^image\//,l=/\.\w+$/,h={},F={file:null,quality:.8,convertSize:2048e3,loose:!0,redressOrientation:!0},b=function(s){return typeof s=="function"},O=function(s){return u.test(s)};function S(s){s=Object.assign({},F,s),this.options=s,this.file=s.file,this.image=null,this.ParsedOrientationInfo=null,this.init()}var x=S.prototype;for(var T in r.default=S,x.init=function(){var s=this,f=this.file,c=this.options;f&&O(f.type)?(O(c.mimeType)||(c.mimeType=f.type),h.file2Image(f,function(a){b(s.beforeCompress)&&(s.image=a,f.width=a.naturalWidth,f.height=a.naturalHeight,s.beforeCompress(f)),f.type==="image/jpeg"&&c.redressOrientation?s.getParsedOrientationInfo(function(g){s.parsedOrientationInfo=g,s.rendCanvas()}):(s.parsedOrientationInfo={rotate:0,scaleX:1,scaleY:1},s.rendCanvas())},s.error)):s.error("\u8BF7\u4E0A\u4F20\u56FE\u7247\u6587\u4EF6!")},x.rendCanvas=function(){var s=this,f=this.options,c=this.image,a=this.getExpectedEdge(),g=a.dWidth,p=a.dHeight,v=a.width,d=a.height,y=h.image2Canvas(c,g,p,s.beforeDraw.bind(s),s.afterDraw.bind(s),v,d);h.canvas2Blob(y,function(w){w&&(w.width=y.width,w.height=y.height),s.success(w)},f.quality,f.mimeType)},x.beforeCompress=function(){b(this.options.beforeCompress)&&this.options.beforeCompress(this.file)},x.getExpectedEdge=function(){var s,f=this.image,c=this.parsedOrientationInfo.rotate,a=this.options,g=f.naturalWidth,p=f.naturalHeight,v=Math.abs(c)%180==90;v&&(s=p,p=g,g=s);var d=g/p,y=Math.max(a.maxWidth,0)||1/0,w=Math.max(a.maxHeight,0)||1/0,m=Math.max(a.minWidth,0)||0,E=Math.max(a.minHeight,0)||0,I=Math.max(a.width,0)||g,D=Math.max(a.height,0)||p;y<1/0&&w<1/0?w*d>y?w=y/d:y=w*d:y<1/0?w=y/d:w<1/0&&(y=w*d),m>0&&E>0?E*d>m?E=m/d:m=E*d:m>0?E=m/d:E>0&&(m=E*d),D*d>I?D=I/d:I=D*d;var B=I=Math.floor(Math.min(Math.max(I,m),y)),A=D=Math.floor(Math.min(Math.max(D,E),w));return v&&(s=A,A=B,B=s),{dWidth:B,dHeight:A,width:I,height:D}},x.getParsedOrientationInfo=function(s){var f=this;this.getOrientation(function(c){b(s)&&s(f.parseOrientation(c))})},x.getOrientation=function(s){var f=this;h.file2ArrayBuffer(this.file,function(c){b(s)&&s(f.resetAndGetOrientation(c))})},x.resetAndGetOrientation=function(s){var f,c=new DataView(s);try{var a,g,p;if(c.getUint8(0)===255&&c.getUint8(1)===216)for(var v=c.byteLength,d=2;d+1<v;){if(c.getUint8(d)===255&&c.getUint8(d+1)===225){g=d;break}d+=1}if(g){var y=g+4,w=g+10;if(h.getStringFromCharCode(c,y,4)==="Exif"){var m=c.getUint16(w);if(((a=m===18761)||m===19789)&&c.getUint16(w+2,a)===42){var E=c.getUint32(w+4,a);E>=8&&(p=w+E)}}}if(p){var I;for(v=c.getUint16(p,a),I=0;I<v;I+=1)if(d=p+12*I+2,c.getUint16(d,a)===274){d+=8,f=c.getUint16(d,a),c.setUint16(d,1,a);break}}}catch(D){console.error(D),f=1}return f},x.parseOrientation=function(s){var f=0,c=1,a=1;switch(s){case 2:c=-1;break;case 3:f=-180;break;case 4:a=-1;break;case 5:f=90,a=-1;break;case 6:f=90;break;case 7:f=90,c=-1;break;case 8:f=-90}return{rotate:f,scaleX:c,scaleY:a}},x.beforeDraw=function(s,f){var c=this.parsedOrientationInfo,a=c.rotate,g=c.scaleX,p=c.scaleY,v=this.file,d=this.options,y="transparent",w=f.width,m=f.height;switch(v.size>d.convertSize&&d.mimeType==="image/png"&&(y="#fff",d.mimeType="image/jpeg"),s.fillStyle=y,s.fillRect(0,0,w,m),b(d.beforeDraw)&&d.beforeDraw.call(this,s,f),s.save(),a){case 90:s.translate(w,0);break;case-90:s.translate(0,m);break;case-180:s.translate(w,m)}s.rotate(a*Math.PI/180),s.scale(g,p)},x.afterDraw=function(s,f){var c=this.options;b(c.afterDraw)&&c.afterDraw.call(this,s,f)},x.error=function(s){var f=this.options;if(!b(f.error))throw new Error(s);f.error.call(this,s)},x.success=function(s){var f,c,a=this.options,g=this.file,p=this.image,v=this.getExpectedEdge(),d=p.naturalHeight,y=p.naturalWidth;if(s&&s.size)if(!a.loose&&s.size>g.size&&!(v.width>y||v.height>d))console.warn("\u5F53\u524D\u8BBE\u7F6E\u7684\u662F\u975E\u5BBD\u677E\u6A21\u5F0F\uFF0C\u538B\u7F29\u7ED3\u679C\u5927\u4E8E\u6E90\u56FE\u7247\uFF0C\u8F93\u51FA\u6E90\u56FE\u7247"),s=g;else{var w=new Date;s.lastModified=w.getTime(),s.lastModifiedDate=w,s.name=g.name,s.name&&s.type!==g.type&&(s.name=s.name.replace(l,(f=s.type,(c=O(f)?f.substr(6):"")==="jpeg"&&(c="jpg"),"."+c)))}else console.warn("\u56FE\u7247\u538B\u7F29\u51FA\u4E86\u70B9\u610F\u5916\uFF0C\u8F93\u51FA\u6E90\u56FE\u7247"),s=g;b(a.success)&&a.success.call(this,s)},h.file2DataUrl=function(s,f,c){var a=new FileReader;a.onload=function(){f(a.result)},a.onerror=function(){b(c)&&c("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25\uFF01")},a.readAsDataURL(s)},h.file2ArrayBuffer=function(s,f,c){var a=new FileReader;a.onload=function(g){f(g.target.result)},a.onerror=function(){b(c)&&c("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25\uFF01")},a.readAsArrayBuffer(s)},h.getStringFromCharCode=function(s,f,c){var a,g="";for(c+=f,a=f;a<c;a+=1)g+=String.fromCharCode(s.getUint8(a));return g},h.file2Image=function(s,f,c){var a=new Image,g=o.URL||o.webkitURL;if(o.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(o.navigator.userAgent)&&(a.crossOrigin="anonymous"),a.alt=s.name,a.onerror=function(){b(c)&&c("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")},g){var p=g.createObjectURL(s);a.onload=function(){f(a),g.revokeObjectURL(p)},a.src=p}else this.file2DataUrl(s,function(v){a.onload=function(){f(a)},a.src=v},c)},h.url2Image=function(s,f,c){var a=new Image;a.src=s,a.onload=function(){f(a)},a.onerror=function(){b(c)&&c("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")}},h.image2Canvas=function(s,f,c,a,g,p,v){var d=document.createElement("canvas"),y=d.getContext("2d");return d.width=p||s.naturalWidth,d.height=v||s.naturalHeight,b(a)&&a(y,d),y.save(),y.drawImage(s,0,0,f,c),y.restore(),b(g)&&g(y,d),d},h.canvas2DataUrl=function(s,f,c){return s.toDataURL(c||"image/jpeg",f)},h.dataUrl2Image=function(s,f,c){var a=new Image;a.onload=function(){f(a)},a.error=function(){b(c)&&c("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")},a.src=s},h.dataUrl2Blob=function(s,f){for(var c=s.split(",")[1],a=s.match(/^data:(.*?)(;base64)?,/)[1],g=atob(c),p=c.length,v=new Uint8Array(p),d=0;d<p;d++)v[d]=g.charCodeAt(d);return new Blob([v],{type:f||a})},h.blob2DataUrl=function(s,f,c){this.file2DataUrl(s,f,c)},h.blob2Image=function(s,f,c){this.file2Image(s,f,c)},h.canvas2Blob=function(s,f,c,a){var g=this;HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(p,v,d){var y=this.toDataURL(v,d);p(g.dataUrl2Blob(y))}}),s.toBlob(function(p){f(p)},a||"image/jpeg",c||.8)},h.upload=function(s,f,c){var a=new XMLHttpRequest,g=new FormData;g.append("file",f),a.onreadystatechange=function(){if(a.readyState!==4||a.status!==200)throw new Error(a);c&&c(a.responseText)},a.open("POST",s,!0),a.send(g)},h)h.hasOwnProperty(T)&&(S[T]=h[T])}]).default})}(N)),N.exports}(function(e){e.exports=Ze()})(Y);var Qe=Ke(Y.exports);const et=e=>{if(!e.file)throw new Error("file is required");const n=e.file.size/1024;let t=e.quality;if(t===void 0){if(n<200)return e.file;n>200&&n<=512?t=.9:n>512&&n<=1024?t=.8:n>1024&&n<=2048?t=.85:n>2048&&n<=10240?t=.8:n>10240&&n<=20480&&(t=.75)}return new Promise((r,i)=>{var o;new Qe({...e,quality:t,convertSize:(o=e.convertSize)!=null?o:1024,success:u=>{r(u)},error:u=>{i(u)}})})},R=e=>e&&e.split("?")[0].split("/").pop()||"",tt=e=>{if(e=R(e),!e)return"";const n=e.lastIndexOf(".");return n===-1?"":e.slice(n+1).toLowerCase()},nt=e=>{if(e=R(e),!e)return["",""];const n=e.lastIndexOf(".");if(n===-1)return[e,""];const t=e.slice(0,n),r=e.slice(n+1).toLowerCase();return[t,r]},rt=(e,n,t)=>Math.min(Math.max(t,e),n),_=new Map,it=(e,n=3)=>{if(!e)throw new Error("name is required");let t;return _.has(e)?t=_.get(e):(t={maxNum:n,currentNum:0,queue:[]},_.set(e,t)),{acquire:async()=>new Promise((l,h)=>{t.currentNum>=t.maxNum?t.queue.push({resolve:l,reject:h}):(t.currentNum++,l(!0))}),release:()=>{if(t.queue.length>0){const{resolve:l}=t.queue.shift();l(!0)}else t.currentNum--},destroy:async()=>{_.delete(e)},getMaxNum:()=>t.maxNum}};export{j as Enum,re as arrayDiff,$ as arrayEquals,fe as assign,pe as buildTree,Re as buildUrl,rt as clamp,Fe as combineByField,et as compressImage,ze as copyText,it as createLock,qe as createStreamIterator,Pe as createTimer,We as debounce,$e as decodeHTMLEntities,W as deepAssign,de as deepClone,_e as delayWhen,He as downloadFile,je as encodeHTMLEntities,Ue as fileToBlob,Ce as fileToDataURL,ke as fileToObjectURL,V as filterTree,we as findNode,ye as findNodeWithPath,be as findParentAndIndex,Ee as flatTree,Te as formatBytes,Oe as formatDate,Ie as formatInterval,xe as formatNumber,De as formatPx,Se as formatTime,tt as getFileExt,R as getFilename,ue as getNearestNumbers,me as getProp,U as getProperty,Be as getRandInt,se as groupBy,Ge as handleFormValidateError,Je as hasClass,Q as isBlob,te as isChildClassOf,Xe as isElementInViewport,P as isEmpty,ne as isEqual,Z as isIframe,ee as isImage,K as isObject,M as isPlainObject,k as looseEqual,z as mergeDefaultOptions,le as omit,he as omitEmpty,Ve as openPage,Ye as parseAreaCode,nt as parseFilename,G as parseJson,H as pick,Me as runAtLeastTime,ge as setProperty,L as sleep,oe as toArray,ce as toCamelCase,q as toKebabCase,ae as toUnderscore,Le as urlToBlob,Ae as urlToDataURL,Ne as urlToPngBlob,ve as walkTree,X as withInstall,ie as without};
|
package/es/utils/file.d.ts
CHANGED
package/es/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.5.
|
|
1
|
+
export declare const version = "1.5.13";
|
package/lib/utils/file.d.ts
CHANGED
package/lib/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.5.
|
|
1
|
+
export declare const version = "1.5.13";
|